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
cdcc4ba244e33d2637455f4b4f1acebe4471b419
678
asm
Assembly
oeis/053/A053042.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/053/A053042.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/053/A053042.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A053042: a(n) = n^n + n!. ; Submitted by Jon Maiga ; 2,6,33,280,3245,47376,828583,16817536,387783369,10003628800,285351587411,8916579449856,302881333613053,11112094003849216,437895198055227375,18446764996499439616,827240617573764860177,39346414477670243303424,1978419777305413997955979,104857602432902008176640000,5842587069476924693090564421,341427878488220285174254403584,20880468025699928773240009550567,1333735777470732526182320912203776,88817841985523733277221519431265625,6156119580610448771923279923984203776 add $0,1 mov $1,$0 pow $1,$0 seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters). add $0,$1
67.8
464
0.842183
cdf5c5a1740f6821446f3f71c5d0efbda8429275
1,378
asm
Assembly
programs/oeis/295/A295680.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/295/A295680.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/295/A295680.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A295680: a(n) = a(n-1) + a(n-3) + a(n-4), where a(0) = 0, a(1) = 0, a(2) = 0, a(3) = 2. ; 0,0,0,2,2,2,4,8,12,18,30,50,80,128,208,338,546,882,1428,2312,3740,6050,9790,15842,25632,41472,67104,108578,175682,284258,459940,744200,1204140,1948338,3152478,5100818,8253296,13354112,21607408,34961522,56568930,91530450,148099380,239629832,387729212,627359042,1015088254,1642447298,2657535552,4299982848,6957518400,11257501250,18215019650,29472520898,47687540548,77160061448,124847601996,202007663442,326855265438,528862928882,855718194320,1384581123200,2240299317520,3624880440722,5865179758242,9490060198962,15355239957204,24845300156168,40200540113372,65045840269538,105246380382910,170292220652450,275538601035360,445830821687808,721369422723168,1167200244410978,1888569667134146,3055769911545122,4944339578679268,8000109490224392,12944449068903660,20944558559128050,33889007628031710,54833566187159762,88722573815191472,143556140002351232,232278713817542704,375834853819893938,608113567637436642,983948421457330578,1592061989094767220,2576010410552097800,4168072399646865020,6744082810198962818,10912155209845827838,17656238020044790658,28568393229890618496,46224631249935409152,74793024479826027648,121017655729761436802 trn $0,2 seq $0,74677 ; a(n) = Sum_{i = 0..floor(n/2)} (-1)^(i + floor(n/2)) F(2*i + e), where F = A000045 (Fibonacci numbers) and e = (1-(-1)^n)/2. mul $0,2
196.857143
1,128
0.83164
8dd35d49c4cc3bba4c39cfcb1bd46dcc06534c50
906
asm
Assembly
spinny.asm
somerandomdev49/Simple_ISA
1616f859e675ef17b9497aa969b7d2753c9d73ed
[ "CC0-1.0" ]
1
2021-07-30T18:53:11.000Z
2021-07-30T18:53:11.000Z
spinny.asm
somerandomdev49/Simple_ISA
1616f859e675ef17b9497aa969b7d2753c9d73ed
[ "CC0-1.0" ]
null
null
null
spinny.asm
somerandomdev49/Simple_ISA
1616f859e675ef17b9497aa969b7d2753c9d73ed
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/sisa16_asm -run .ZERO_STACK_POINTER: astp;popa; section 0x40000; :ascii_spinny: ..asciz:-\|/ .ascii_spinny_len:4 .ITER_REGION:3 ..(ITER_REGION): bytes 0,0,0,0; .ld_iter: farllda %&@&% .ld_iterb: farlldb %&@&% .st_iter: farstla %&@&% //..include"libc.hasm" ..include"libc_pre.hasm" ..(2): ..dinclude"libc_pre.bin" .line_length: 90 .line_length_plus_1: 91 .num_lines: 20 .wait_time: 50 ..main(3): lrx0 %/0x70000%; proc_krenel; halt; ..(7): asm_begin_region_restriction; la '\r'; putchar; la 0; st_iter; alpush; //our loop! asciifun_looptop: la ' '; putchar; alpop; aincr; alpush; lb ascii_spinny_len;mod; sc %4%; lb %~ascii_spinny%; add; ba; farilda; putchar; la '\r'; putchar; la '\n'; interrupt; la %~wait_time%; alpush; proc_wait; alpop; sc %asciifun_looptop%;jmp; asciifun_loopout: la 7; putchar; halt; asm_end_restriction;
14.15625
32
0.652318
2753373e030ba55dca6bd6a8321cc63995832dc1
519
asm
Assembly
macros/gfx.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
macros/gfx.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
macros/gfx.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
RGB: MACRO rept _NARG / 3 dw palred (\1) + palgreen (\2) + palblue (\3) shift shift shift endr ENDM palred EQUS "(1 << 0) *" palgreen EQUS "(1 << 5) *" palblue EQUS "(1 << 10) *" palettes EQUS "* PALETTE_SIZE" palette EQUS "+ PALETTE_SIZE *" color EQUS "+ PAL_COLOR_SIZE *" tiles EQUS "* LEN_2BPP_TILE" tile EQUS "+ LEN_2BPP_TILE *" ; extracts the middle two colors from a 2bpp binary palette ; example usage: ; INCBIN "foo.gbcpal", middle_colors middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2"
20.76
59
0.682081
a87a4932270f360dcb96aa54c41e915a9256da24
1,130
asm
Assembly
runme/solution/solution.asm
BSidesSF/ctf-2021-release
53c74b532bcb42dfd33bcc3fca36549598153493
[ "MIT" ]
7
2021-03-17T13:32:29.000Z
2021-11-23T17:49:06.000Z
runme/solution/solution.asm
BSidesSF/ctf-2021-release
53c74b532bcb42dfd33bcc3fca36549598153493
[ "MIT" ]
null
null
null
runme/solution/solution.asm
BSidesSF/ctf-2021-release
53c74b532bcb42dfd33bcc3fca36549598153493
[ "MIT" ]
null
null
null
bits 64 ;;; OPEN mov rax, 2 ; Syscall 2 = sys_open call getfilename ; Pushes the next address onto the stack and jumps down db "/home/ctf/flag.txt",0 ; The literal flag, null terminated getfilename: pop rdi ; Pop the top of the stack (which is the filename) into rdi mov rsi, 0 ; Flags = 0 mov rdx, 0 ; Mode = 0 syscall ; Perform sys_open() syscall, the file handle is returned in rax ;;; READ push rdi ; Temporarly store the filename pointer push rax ; Temporarily store the handle mov rax, 0 ; Syscall 0 = sys_read pop rdi ; Move the file handle into rdi pop rsi ; Use the same buffer where the filename pointer is stored (it's readable and writable) mov rdx, 30 ; rdx is the count syscall ; Perform sys_read() syscall, reading from the opened file ;;; WRITE mov rax, 1 ; Syscall 1 = sys_write mov rdi, 1 ; File handle to write to = stdout = 1 ; (rsi is already the buffer) mov rdx, 30 ; rdx is the count again syscall ; Perform the sys_write syscall, writing the data to stdout ;;; EXIT mov rax, 60 ; Syscall 60 = exit mov rdi, 0 ; Exit with code 0 syscall ; Perform an exit
30.540541
97
0.69646
e31ce477425df1047d18ccf35b4e805fca24df07
60
asm
Assembly
gfx/pokemon/rattata/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
gfx/pokemon/rattata/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
gfx/pokemon/rattata/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
setrepeat 3 frame 0, 05 frame 4, 05 dorepeat 1 endanim
10
12
0.7
504d0541fcef59d877f8649b0c92f51bf77a7ccc
337
asm
Assembly
programs/oeis/094/A094919.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/094/A094919.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/094/A094919.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A094919: (4^n-1)/3 mod n. ; 0,1,0,1,1,3,1,5,0,5,1,9,1,5,6,5,1,9,1,5,0,5,1,21,16,5,0,1,1,15,1,21,21,5,26,9,1,5,21,5,1,21,1,41,36,5,1,21,22,25,21,33,1,27,11,5,21,5,1,45,1,5,0,21,16,45,1,17,21,15,1,45,1,5,66,9,5,39,1,5,0,5,1,21,1,5,21,21,1,45 add $0,1 mov $2,$0 lpb $0 sub $0,1 add $1,1 mod $1,$2 mul $1,4 lpe div $1,4 mov $0,$1
24.071429
213
0.545994
9222406eb370598fde15e5f44f9c86510fae7f4e
7,938
asm
Assembly
astro_sound.asm
nealvis/astroblast
521b5300c4b00d96971ed72106de79e7b9f9250d
[ "MIT" ]
null
null
null
astro_sound.asm
nealvis/astroblast
521b5300c4b00d96971ed72106de79e7b9f9250d
[ "MIT" ]
null
null
null
astro_sound.asm
nealvis/astroblast
521b5300c4b00d96971ed72106de79e7b9f9250d
[ "MIT" ]
null
null
null
////////////////////////////////////////////////////////////////////////////// // astro_sound.asm // Copyright(c) 2021 Neal Smith. // License: MIT. See LICENSE file in root directory. ////////////////////////////////////////////////////////////////////////////// // sound routines for astroblast project. // Anything with Private in the name shouldn't be used outside of this file ////////////////////////////////////////////////////////////////////////////// #importonce ////////////////////////////////////////////////////////////// #import "../nv_c64_util/nv_c64_util_macs_and_data.asm" *=$8000 "astro sound" SoundLoadAddr: .import binary "sounds/astro_sound.bin" /////////////////////// // sound effects // higher memory addresses for an effect are higher priority // lower addresses effects don't interupt higher address effects SoundFxShip1HitAsteroidPrivate: SoundFxShip2HitAsteroidPrivate: .import binary "sounds/ship_hit_asteroid_sound_fx.bin" //SoundFxShip2HitAsteroid: //.import binary "ship_hit_asteroid_sound_fx.bin" SoundFxTurretFirePrivate: .import binary "sounds/turret_fire_sound_fx.bin" SoundFxShipHitByTurretPrivate: .import binary "sounds/ship_hit_by_turret_sound_fx.bin" SoundFxHolePrivate: .import binary "sounds/hole_sound_fx.bin" SoundFxSilencePrivate: .import binary "sounds/silent_sound_fx.bin" sound_master_volume: .byte 7 sound_mute: .byte 0 .const MAX_VOLUME = $0F .const MIN_VOLUME = $00 #import "astro_sound_macs.asm" ////////////////////////////////////////////////////////////// // Subroutine to initialize Sound. // to call // LDA #0 (for song zero) // JSR SoundInit .label PrivateSoundInit = SoundLoadAddr ////////////////////////////////////////////////////////////// // Subroutine to call every raster interupt to step the sound. // To call: // JSR PrivateSoundStep .label PrivateSoundStep = SoundLoadAddr + 3 ////////////////////////////////////////////////////////////// // to play sound fx: //LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 .label PrivateSoundPlayFx = SoundLoadAddr + 6 ////////////////////////////////////////////////////////////// // subroutine to set the volume // LDA volume (0-15) // JSR startaddress + 9 .label PrivateSoundVolumeSet = SoundLoadAddr + 9 ////////////////////////////////////////////////////////////// // Public subroutines and macros below // the private routines above should be used internally // to this file only. ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// // Subroutine to initialize Sound for song 0 // to call // JSR SoundInit SoundInit: //lda #$00 jsr PrivateSoundInit rts ////////////////////////////////////////////////////////////// // Subroutine to call when done playing sounds // JSR SoundDone SoundDone: lda #ASTRO_SOUND_MAIN_TUNE jsr PrivateSoundInit rts ////////////////////////////////////////////////////////////// // To turn volume Up // JSR VolumeUp SoundVolumeUp: lda sound_master_volume cmp #MAX_VOLUME beq AtMaxVol inc sound_master_volume lda sound_master_volume jsr PrivateSoundVolumeSet AtMaxVol: rts ////////////////////////////////////////////////////////////// // To turn volume down // JSR VolumeDown SoundVolumeDown: lda sound_master_volume cmp #MIN_VOLUME beq AtMinVol dec sound_master_volume lda sound_master_volume jsr PrivateSoundVolumeSet AtMinVol: rts ////////////////////////////////////////////////////////////// // To turn volume down // LDA #vol (0-15 level of vol to set) // JSR VolumeDown SoundVolumeSet: and #$0F sta sound_master_volume jsr PrivateSoundVolumeSet rts ////////////////////////////////////////////////////////////// // subroutine to set mute on // JSR SoundMuteOn SoundMuteOn: lda #$01 sta sound_mute lda #$00 jsr PrivateSoundVolumeSet SoundDoStep() // step sound once to apply volume rts ////////////////////////////////////////////////////////////// // subroutine to set mute off // JSR SoundMuteOff SoundMuteOff: lda #$00 sta sound_mute lda sound_master_volume jsr PrivateSoundVolumeSet SoundDoStep() // step sound once to apply volume rts ////////////////////////////////////////////////////////////// // subroutine to toggle mute // JSR SoundMuteOff SoundMuteToggle: lda sound_mute beq MuteCurrentlyOff MuteCurrentlyOn: jsr SoundMuteOff rts MuteCurrentlyOff: jsr SoundMuteOn rts //////////////////////////////////////////////////////////////// // Call once every raster interupt to play sounds .macro SoundDoStep() { jsr PrivateSoundStep } ////////////////////////////////////////////////////////////////////////////// // play a sound effect // Before calling the private sound effect routine we'll need to // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlayShip1AsteroidFX: lda #<SoundFxShip1HitAsteroidPrivate ldy #>SoundFxShip1HitAsteroidPrivate ldx #14 jsr PrivateSoundPlayFx rts ////////////////////////////////////////////////////////////////////////////// // play a sound effect // Before calling the private sound effect routine we'll need to: // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlayShip2AsteroidFX: lda #<SoundFxShip2HitAsteroidPrivate ldy #>SoundFxShip2HitAsteroidPrivate ldx #14 jsr PrivateSoundPlayFx rts ////////////////////////////////////////////////////////////////////////////// // play turret firing sound effect // Before calling the private sound effect routine we'll need to: // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlayTurretFireFX: lda #<SoundFxTurretFirePrivate ldy #>SoundFxTurretFirePrivate ldx #14 jsr PrivateSoundPlayFx rts ////////////////////////////////////////////////////////////////////////////// // play turret firing sound effect // Before calling the private sound effect routine we'll need to: // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlayShipHitByTurretFX: lda #<SoundFxShipHitByTurretPrivate ldy #>SoundFxShipHitByTurretPrivate ldx #14 jsr PrivateSoundPlayFx rts ////////////////////////////////////////////////////////////////////////////// // play turret firing sound effect // Before calling the private sound effect routine we'll need to: // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlayHoleFX: lda #<SoundFxHolePrivate ldy #>SoundFxHolePrivate //lda #<SoundFxTurretFirePrivate //ldy #>SoundFxTurretFirePrivate ldx #14 jsr PrivateSoundPlayFx rts ////////////////////////////////////////////////////////////////////////////// // Stops all the effect sounds // Before calling the private sound effect routine we'll need to: // LDA #<effect ;Start address of sound effect data // LDY #>effect // LDX #channel ;0, 7 or 14 for channels 1-3 // JSR startaddress+6 SoundPlaySilenceFX: { lda #<SoundFxSilencePrivate ldy #>SoundFxSilencePrivate ldx #14 jsr PrivateSoundPlayFx Done: rts }
28.451613
78
0.540816
06f5579b9efb0899837942bdb7dfd621bd215f2d
35,755
asm
Assembly
base/Kernel/Native/arm/Crt/macros.asm
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
base/Kernel/Native/arm/Crt/macros.asm
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
base/Kernel/Native/arm/Crt/macros.asm
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Microsoft Research Singularity ;;; ;;; Copyright (c) Microsoft Corporation. All rights reserved. ;;; ;;; This file contains ARM-specific assembly code. ;;; ; Assembler source for FPA support code and emulator ; ================================================== ; Some useful assembler macros. Also used by "fplib". ; ; Copyright (C) Advanced RISC Machines Limited, 1992-7. All rights reserved. ; ; RCS Revision: 1 ; Checkin Date: 2007/06/29 02:59:16 ; Revising Author ;=========================================================================== ; Register names used when isolating the base register of a PC-relative or ; register-relative expression in the macros below. The technique is to set ; a temporary arithmetic variable Base to :BASE:(expression), then refer to ; R$Base. R00000000 RN R0 R00000001 RN R1 R00000002 RN R2 R00000003 RN R3 R00000004 RN R4 R00000005 RN R5 R00000006 RN R6 R00000007 RN R7 R00000008 RN R8 R00000009 RN R9 R0000000A RN R10 R0000000B RN R11 R0000000C RN R12 R0000000D RN R13 R0000000E RN R14 R0000000F RN R15 ;=========================================================================== ; Two general purpose arithmetic variables. GBLA Tempa GBLA Tempa2 ;=========================================================================== ; The following macro is useful for shifting bit fields around when their ; positions are symbolic constants - which makes it unclear to the author ; whether LSR or LSL is needed. MACRO $label BiShift $opc,$Rd,$Rn,$Rm,$rshift,$lshift [ "$lshift":LEFT:5 <> "LSL #" ! 4,"Left shift must start exactly 'LSL #'" | [ "$rshift":LEFT:5 <> "LSR #" ! 4,"Right shift must start exactly 'LSR #'" | LCLS left LCLS right left SETS "$lshift":RIGHT:(:LEN:"$lshift" - 5) right SETS "$rshift":RIGHT:(:LEN:"$rshift" - 5) [ "$Rn" = "" ASSERT (("$opc":LEFT:3) <> "LDR") :LAND: (("$opc":LEFT:3) <> "STR") [ ($right) > ($left) $label $opc $Rd,$Rm,LSR #(($right) - ($left)) | $label $opc $Rd,$Rm,LSL #(($left) - ($right)) ] | [ ($right) > ($left) [ (("$opc":LEFT:3) = "LDR") :LOR: (("$opc":LEFT:3) = "STR") $label $opc $Rd,[$Rn,$Rm,LSR #(($right) - ($left))] | $label $opc $Rd,$Rn,$Rm,LSR #(($right) - ($left)) ] | [ (("$opc":LEFT:3) = "LDR") :LOR: (("$opc":LEFT:3) = "STR") $label $opc $Rd,[$Rn,$Rm,LSL #(($left) - ($right))] | $label $opc $Rd,$Rn,$Rm,LSL #(($left) - ($right)) ] ] ] ] ] MEND ;=========================================================================== ; The following macro isolates the exponent field from the standard sign/ ; uncommon bit/exponent word, putting it at the top of the destination ; register. MACRO $label Exp2Top $dest,$src,$cond,$s [ EIExp_pos = 0 $label MOV$cond$s $dest,$src,LSL #32-EIExp_len | $label MOV$cond $dest,$src,LSR #EIExp_pos MOV$cond$s $dest,$dest,LSL #32-EIExp_len ] MEND ;=========================================================================== ; The following macros isolate the exponent fields from two standard sign/ ; uncommon bit/exponent words, putting the first one at the top of a ; destination register. ExpDiff puts the difference at the top of another ; register and sets the condition codes on it, while ExpComp simply sets the ; condition codes on the difference. MACRO $label ExpComp $dest,$src1,$src2,$tmp ASSERT $dest <> $src1 ASSERT $dest <> $src2 ASSERT $dest <> $tmp ASSERT $tmp <> $src1 ASSERT $tmp <> $src2 [ EIExp_pos = 0 $label MOV $dest,$src1,LSL #32-EIExp_len CMP $dest,$src2,LSL #32-EIExp_len | $label MOV $dest,$src1,LSR #EIExp_pos MOV $dest,$dest,LSL #32-EIExp_len MOV $tmp,$src2,LSR #EIExp_pos CMP $dest,$tmp,LSL #32-EIExp_len ] MEND MACRO $label ExpDiff $diff,$dest,$src1,$src2 ASSERT $diff <> $dest ASSERT $diff <> $src1 ASSERT $diff <> $src2 ASSERT $dest <> $src1 ASSERT $dest <> $src2 [ EIExp_pos = 0 $label MOV $dest,$src1,LSL #32-EIExp_len SUBS $diff,$dest,$src2,LSL #32-EIExp_len | $label MOV $dest,$src1,LSR #EIExp_pos MOV $dest,$dest,LSL #32-EIExp_len MOV $diff,$src2,LSR #EIExp_pos SUBS $diff,$dest,$diff,LSL #32-EIExp_len ] MEND ;=========================================================================== ; The following macro performs the standard test for infinities or NaNs on ; an internal floating point number. It only works on legitimate internal ; precision numbers - i.e. it produces undefined results if the bit pattern ; in the internal precision number is an undefined one. The parameters are: ; $res: On exit, the top bit of this register is set if the number is a ; NaN or infinity, clear if it isn't; ; $sue: Register holding sign, uncommon bit and exponent of number to be ; tested; preserved on exit; ; $mhi: Register containing high word of mantissa of number to be tested; ; preserved on exit; ; $mlo: Register containing low word of mantissa of number to be tested; ; preserved on exit; ; ; In addition, the N flag is set on exit if the number is a NaN or infinity, ; clear if it isn't. ; ; The criterion used for a number to be a NaN or infinity is: ; ; Uncommon bit = 1; and ; Exponent top bit = 1; and ; Exponent = MAX or units bit = 1. ; ; Whether the operand is in fact a NaN or an infinity is then determined by ; seeing whether the fraction is non-zero or zero. MACRO $label TNaNInf $res,$sue,$mhi ASSERT $res <> $sue ASSERT $res <> $mhi $label MOV $res,$sue,LSL #32-(EIExp_pos+EIExp_len) ;Top bit of exponent CMN $res,#1:SHL:(32-(EIExp_pos+EIExp_len)) ;Is exp. = MAX? If ANDCC $res,$res,$mhi ; not, use units bit ANDS $res,$res,$sue,LSL #31-Uncommon_pos ;Use uncommon anyway MEND ;=========================================================================== ; The following macro contains the standard code for denormalising a ; mantissa by a specified amount, producing guard, round and sticky bits in ; the process. The parameters are: ; $mhi: Register containing mantissa high word; updated on exit; ; $mlo: Register containing mantissa low word; updated on exit; ; $grs: Register that will contain the guard bit (in bit 31), the round ; bit (in bit 30) and the sticky bit (in whether bits 29:0 are zero ; or non-zero) on exit; ; $sh: Register containing the shift amount; corrupt on exit; ; $t1,$t2: Registers used as temporaries; corrupt on exit. ; $grs may be null to indicate that the guard, round and sticky information ; isn't wanted. $mlo can be null to indicate that we only need to ; denormalise a single word: in this case, $grs must be null. ; Note that the $grs register may alternatively be interpreted as ; containing a round bit in bit 31 and a sticky bit in bits 30:0, in cases ; when there is no need for a guard bit. Also note that $sh may be the same ; register as either of $grs and $t2; otherwise, the registers must be ; distinct from each other. ; Finally, note that branch instructions are used around a 4 instruction ; sequence and a 5 instruction sequence. This is because statistics show ; that larger shift amounts are less common than smaller ones in general: ; thus these instruction sequences are obeyed less than 50% of the time, ; which makes the code with branches slightly faster. MACRO $label Denorm $mhi,$mlo,$grs,$sh,$t1,$t2 ASSERT $mhi <> $sh ASSERT $mhi <> $t1 ASSERT $mhi <> $t2 ASSERT $sh <> $t1 ASSERT $t1 <> $t2 $label MOV $t1,$sh,LSR #5 ;Number of words to shift by BIC $t2,$sh,$t1,LSL #5 ;Number of odd bits to shift by [ "$mlo" = "" ASSERT "$grs" = "" CMP $t1,#1 ;At least one word? MOVLO $mhi,$mhi,LSR $t2 ;Shift by odd bits if not MOVHS $mhi,#0 ;And clear out completely if so | ASSERT $mlo <> $mhi ASSERT $mlo <> $sh ASSERT $mlo <> $t1 ASSERT $mlo <> $t2 [ "$grs" = "" CMP $t1,#1 ;HI for 2+ words, EQ for 1, LO for 0 RSBLS $t1,$t2,#32 ;Shift by the number of odd bits MOVLS $mlo,$mlo,LSR $t2 ORRLS $mlo,$mlo,$mhi,LSL $t1 MOVLS $mhi,$mhi,LSR $t2 MOVEQ $mlo,$mhi ;Now do full words MOVHI $mlo,#0 MOVHS $mhi,#0 | ASSERT $grs <> $mhi ASSERT $grs <> $mlo ASSERT $grs <> $t1 ASSERT $grs <> $t2 CMP $t1,#2 ;CS/NE for 3+ words, CS/EQ for 2, TEQCC $t1,#0 ; CC/NE for 1 and CC/EQ for 0. RSB $t1,$t2,#32 ;Shift by the number of odd bits MOV $grs,$mlo,LSL $t1 MOV $mlo,$mlo,LSR $t2 ORR $mlo,$mlo,$mhi,LSL $t1 MOV $mhi,$mhi,LSR $t2 BEQ %f90 ;Branch if no 32-bit shift ORRNE $grs,$grs,$grs,LSL #2 ;Shift by 32 bits, accumulating ORRNE $grs,$mlo,$grs,LSR #2 ; sticky bit MOVNE $mlo,$mhi MOVNE $mhi,#0 90 BCC %f99 ;Branch if no 64-bit shift ORRCS $grs,$grs,$mlo ;Shift by 64 bits, accumulating ORRCS $grs,$grs,$grs,LSL #2 ; sticky bit ORRCS $grs,$mhi,$grs,LSR #2 MOVCS $mlo,#0 MOVCS $mhi,#0 99 ] ] MEND ;=========================================================================== ; Macro to separate a 32-bit value in a register into its two 16-bit halves. MACRO $label Split16 $resh,$resl,$src ASSERT $resh <> $src $label MOV $resh,$src,LSR #16 BIC $resl,$src,$resh,LSL #16 MEND ;=========================================================================== ; Macro to do a (16,16)x32 -> 64 multiplication. Done by breaking it up into ; four 16x16 multiplications and recombining the pieces. (N.B. The trick ; described in Knuth section 4.3.3 for reducing the four multiplications to ; three plus some additions and sign manipulations is not profitable at this ; size: it only becomes profitable when trying to synthesise a 64x64 ; multiplication out of 32x32 multiplications.) ; Also allows the flags to be set on the high word of the result and an ; optional addend to be added into the high word of the result: however, ; combining these does *not* result in the C flag being set correctly for ; the carry-out from the notional addition of the addend and the high word. ; Only the Z and N flags have meaningful values. ; The operands are: ; $resh,$resl: Registers that will receive the 64-bit product; ; $op1h,$op1l: Registers containing the high and low 16 bits of the first ; 32-bit operand; ; $op2: Register containing the second 32-bit operand; ; $add: If present, register containing the addend; ; $s: "S" to set the condition codes; ; $t1,$t2,$t3: Three temporary registers required during the calculation. ; The restrictions on which registers may be the same are complicated and ; are detailed in the ASSERT statements below. MACRO $label Mul64 $resh,$resl,$op1h,$op1l,$op2,$add,$s,$t1,$t2,$t3 ASSERT $resh <> $resl ASSERT $resl <> $op1h ASSERT $resl <> $t1 ASSERT $resl <> $t2 ASSERT $resl <> $t3 ASSERT $op1h <> $op1l ASSERT $op1h <> $op2 ASSERT $op1h <> $t1 ASSERT $op1h <> $t2 ASSERT $op1h <> $t3 ASSERT $op1l <> $op2 ASSERT $op1l <> $t1 ASSERT $op1l <> $t2 ASSERT $op1l <> $t3 ASSERT $op2 <> $t1 ASSERT $t1 <> $t2 ASSERT $t1 <> $t3 ASSERT $t2 <> $t3 $label Split16 $t1,$t2,$op2 ;t1 := op2h, t2 := op2l [ "$add" <> "" ASSERT $add <> $op1h ASSERT $add <> $op1l ASSERT $add <> $op2 ASSERT $add <> $t1 ASSERT $add <> $t2 MLA $t3,$op1h,$t1,$add ;t3 := op1h * op2h + add | MUL $t3,$op1h,$t1 ;t3 := op1h * op2h ] MUL $t1,$op1l,$t1 ;t1 := op1l * op2h MUL $resl,$t2,$op1l ;resl := op1l * op2l ADDS $resl,$resl,$t1,LSL #16 ;Add op1l * op2h into (t3,resl) ADC $t3,$t3,$t1,LSR #16 MUL $t2,$op1h,$t2 ;t2 := op1h * op2l ADDS $resl,$resl,$t2,LSL #16 ;Add op1h * op2l into (t3,resl) ADC$s $resh,$t3,$t2,LSR #16 ; to produce (resh,resl) MEND ;=========================================================================== ; Macro to transfer the destination register of an instruction to a set of ; registers. Operands are: ; $type: "FPASC" or "FPE"; ; $dest: The destination register list; ; $instr: The instruction whose destination is to be transferred; ; $t: A temporary. MACRO $label GetDst $type,$dest,$instr,$t LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") [ ("$type" = "FPASC") $label TST $instr,#4:SHL:Ds_pos ;Check whether F0-3 or F4-7 SFMEQFD F0,4,[Rsp]! ;Dump set of 4 registers - SFMNEFD F4,4,[Rsp]! ; faster than trying to get ; the correct register only AND $t,$instr,#3:SHL:Ds_pos ;Get position in dump ADD $t,$t,$t,LSL #1 ;Convert to number of words BiShift ADD,$t,Rsp,$t,LSR #Ds_pos,LSL #2 ;Make address of register LDMIA $t,$dest ; value, then get value ADD Rsp,Rsp,#48 ;Discard dumped registers ASSERT Ds_mask = ((4+3):SHL:Ds_pos) | $label AND $t,$instr,#Ds_mask [ :LNOT:FPE4WordsPerReg ADD $t,$t,$t,LSL #1 ASSERT Ds_pos <= 27 ] Base SETA :BASE:FPE_Regs [ Base = 15 Offset SETA FPE_Regs-({PC}+8) | Offset SETA :INDEX:FPE_Regs ] [ FPE4WordsPerReg BiShift ADD,$t,R$Base,$t,LSR #Ds_pos,LSL #4 | BiShift ADD,$t,R$Base,$t,LSR #Ds_pos,LSL #2 ] [ Offset <> 0 ADD $t,$t,#Offset ] LDMIA $t,$dest ] MEND ;=========================================================================== ; Macro to transfer the destination register of a non-FLT instruction from a ; set of registers. Operands are: ; $type: "FPASC" or "FPE"; ; $source: The source register list; ; $instr: The instruction whose destination is to be transferred; ; $t: A temporary. ; $l: If present, this produces a "long" form of the macro MACRO $label PutDst $type,$source,$instr,$t,$l ASSERT $t <> $instr LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") [ ("$type" = "FPASC") ALIGN $label STMFD Rsp!,$source AND $t,$instr,#Ds_mask 10 BiShift ADD,$t,PC,$t,LSR #Ds_pos,LSL #3 [ "$l"="" MOV LR,PC ADD PC,$t,#($type._PutDstRoutines - (%b10+8)) | ADD $t,$t,#($type._PutDstRoutines - (%b10+8)):AND:&FF MOV LR,PC ADD PC,$t,#($type._PutDstRoutines - (%b10+8)):AND::NOT:&FF ] | ; "$type" = "FPE" $label AND $t,$instr,#Ds_mask [ :LNOT:FPE4WordsPerReg ADD $t,$t,$t,LSL #1 ASSERT Ds_pos <= 27 ] Base SETA :BASE:FPE_Regs [ Base = 15 Offset SETA FPE_Regs-({PC}+8) | Offset SETA :INDEX:FPE_Regs ] [ FPE4WordsPerReg BiShift ADD,$t,R$Base,$t,LSR #Ds_pos,LSL #4 | BiShift ADD,$t,R$Base,$t,LSR #Ds_pos,LSL #2 ] [ Offset <> 0 ADD $t,$t,#Offset ] STMIA $t,$source ] MEND ;=========================================================================== ; Macro to transfer the destination register of a FLT instruction from a set ; of registers. Operands are: ; $type: "FPASC" or "FPE"; ; $source: The source register list; ; $instr: The instruction whose destination is to be transferred; ; $t: A temporary. MACRO $label PutFDst $type,$source,$instr,$t ASSERT $t <> $instr LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") [ ("$type" = "FPASC") ALIGN $label STMFD Rsp!,$source AND $t,$instr,#S1_mask 10 BiShift ADD,$t,PC,$t,LSR #S1_pos,LSL #3 MOV LR,PC ADD PC,$t,#($type._PutDstRoutines - (%b10+8)) | ; "$type" = "FPE" $label AND $t,$instr,#S1_mask [ :LNOT:FPE4WordsPerReg ADD $t,$t,$t,LSL #1 ASSERT S1_pos <= 27 ] Base SETA :BASE:FPE_Regs [ Base = 15 Offset SETA FPE_Regs-({PC}+8) | Offset SETA :INDEX:FPE_Regs ] [ FPE4WordsPerReg BiShift ADD,$t,R$Base,$t,LSR #S1_pos,LSL #4 | BiShift ADD,$t,R$Base,$t,LSR #S1_pos,LSL #2 ] [ Offset <> 0 ADD $t,$t,#Offset ] STMIA $t,$source ] MEND ;=========================================================================== ; Macro to get the first source register of an instruction into three ; registers. Operands are: ; $type: "FPASC" or "FPE"; ; $dest: The destination register list; ; $instr: The instruction whose first source is to be transferred; ; $t: A temporary. MACRO $label GetS1 $type,$dest,$instr,$t LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") [ ("$type" = "FPASC") $label TST $instr,#4:SHL:S1_pos ;Check whether F0-3 or F4-7 SFMEQFD F0,4,[Rsp]! ;Dump set of 4 registers - SFMNEFD F4,4,[Rsp]! ; faster than trying to get ; the correct register only AND $t,$instr,#3:SHL:S1_pos ;Get position in dump ADD $t,$t,$t,LSL #1 ;Convert to number of words BiShift ADD,$t,Rsp,$t,LSR #S1_pos,LSL #2 ;Make address of register LDMIA $t,$dest ; value, then get value ADD Rsp,Rsp,#48 ;Discard dumped registers ASSERT S1_mask = ((4+3):SHL:S1_pos) | $label AND $t,$instr,#S1_mask [ :LNOT:FPE4WordsPerReg ADD $t,$t,$t,LSL #1 ASSERT S1_pos <= 27 ] Base SETA :BASE:FPE_Regs [ Base = 15 Offset SETA FPE_Regs-({PC}+8) | Offset SETA :INDEX:FPE_Regs ] [ FPE4WordsPerReg BiShift ADD,$t,R$Base,$t,LSR #S1_pos,LSL #4 | BiShift ADD,$t,R$Base,$t,LSR #S1_pos,LSL #2 ] [ Offset <> 0 ADD $t,$t,#Offset ] LDMIA $t,$dest ] MEND ;=========================================================================== ; Macro to get the second source register or constant of an instruction into ; three registers. Operands are: ; $type: "FPASC" or "FPE"; ; $dest: The destination register list; ; $instr: The instruction whose second source is to be transferred; ; $t,$t2: Temporaries. MACRO $label GetS2 $type,$dest,$instr,$t,$t2 LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") ASSERT S2_Ibit = 1:SHL:(S2_pos+3) ASSERT S2_pos = 0 ASSERT $t <> $t2 $label MOVS $t2,$instr,LSL #29 ;C:=S2_Ibit, N:=F4-7, not F0-3 ;$t2 := left-al. reg/const no. [ ("$type" = "FPASC") Base SETA :BASE:$type.ConstTable [ Base = 15 Offset SETA $type.ConstTable-({PC}+8) | Offset SETA :INDEX:$type.ConstTable ] ADDCS $t,R$Base,$t2,LSR #25 ;Address the constant if it [ Offset <> 0 ADDCS $t,$t,#Offset ; is one ] BCS %f10 SFMPLFD F0,4,[Rsp]! ;Dump set of 4 registers - SFMMIFD F4,4,[Rsp]! ; faster than trying to get ; the correct register only BIC $t2,$t2,#TopBit ;Get position within set ADD $t,Rsp,$t2,LSR #27 ;Make address of register ADD $t,$t,$t2,LSR #26 ; value 10 LDMIA $t,$dest ;Get reg. value or constant ADDCC Rsp,Rsp,#48 ;If reg, discard dumped regs | Base SETA :BASE:FPEConstTable [ Base = 15 Offset SETA FPEConstTable-({PC}+8) | Offset SETA :INDEX:FPEConstTable ] ADDCS $t,R$Base,$t2,LSR #25 [ Offset <> 0 ADDCS $t,$t,#Offset ] Base SETA :BASE:FPE_Regs [ Base = 15 Offset SETA FPE_Regs-({PC}+8) | Offset SETA :INDEX:FPE_Regs ] [ FPE4WordsPerReg ADDCC $t,R$Base,$t2,LSR #25 | ADDCC $t,R$Base,$t2,LSR #27 ADDCC $t,$t,$t2,LSR #26 ] [ Offset <> 0 ADDCC $t,$t,#Offset ] LDMIA $t,$dest ] MEND ;=========================================================================== ; Macro to get both source operands of an instruction into two groups of ; three registers. Operands are: ; $type: "FPASC" or "FPE"; ; $dest1: The destination register list for the first operand; ; $dest2: The destination register list for the second operand; ; $instr: The instruction whose second source is to be transferred; ; $t, $t2: Temporaries. MACRO $label GetS12 $type,$dest1,$dest2,$instr,$t,$t2 LCLA Base LCLA Offset ASSERT ("$type" = "FPASC") :LOR: ("$type" = "FPE") [ ("$type" = "FPASC") SFMFD F4,4,[Rsp]! ;Dump all registers SFMFD F0,4,[Rsp]! AND $t,$instr,#S1_mask ;Get S1 position in dump ADD $t,$t,$t,LSL #1 ;Convert to number of words BiShift ADD,$t,Rsp,$t,LSR #S1_pos,LSL #2 ;Make address of register LDMIA $t,$dest1 ; value, then get value ASSERT S2_Ibit = 1:SHL:(S2_pos+3) ASSERT S2_pos = 0 MOVS $t2,$instr,LSL #29 ;C:=S2_Ibit, N:=F4-7, not F0-3 ;$t2 := left-al. reg/const no. Base SETA :BASE:$type.ConstTable [ Base = 15 Offset SETA $type.ConstTable-({PC}+8) | Offset SETA :INDEX:$type.ConstTable ] ADDCS $t,R$Base,$t2,LSR #25 ;Address the constant if it [ Offset <> 0 ADDCS $t,$t,#Offset ; is one ] ADDCC $t,Rsp,$t2,LSR #27 ;Otherwise address the register ADDCC $t,$t,$t2,LSR #26 ; value LDMIA $t,$dest2 ADD Rsp,Rsp,#96 ;Discard the register dump | $label GetS1 $type,$dest1,$instr,$t GetS2 $type,$dest2,$instr,$t,$t2 ] MEND ;=========================================================================== ; The standard macro to return to the caller. Note that care has to be taken ; here never to leave Rsp pointing above any useful stack contents, in case ; of a badly-timed interrupt. MACRO $label Return [ {CONFIG} = 26 $label MOV Rsp,Rfp ;Discard now-spurious stack contents ] [ {CONFIG} = 32 $label LDMDB Rfp,{Rtmp,Rtmp2} ;Recover the SPSR and CPSR MSR CPSR_all,Rtmp2 ; (restoring the CPSR re-disables MSR SPSR_all,Rtmp ; interrupts, so the SPSR isn't ever ; valid when interrupts are enabled) MOV Rsp,Rfp ;Discard now-spurious stack contents ] LDMIA Rfp,{R0-R14}^ ;Coding rules: cannot use write-back NOP ; and must protect next instruction ADD Rsp,Rsp,#15*4 ;Do the write-back LDMFD Rsp!,{PC}^ ;Restore R13_svr/R13_und, PC and PSR MEND ;=========================================================================== ; Macro to get the processor mode for the caller, with the 26/32 bit ; distinction removed. The flags are set on the result value, so Z indicates ; whether we're in user mode. MACRO $label GetMode $res [ {CONFIG}=32 $label LDR $res,[Rfp,#-8] ;Recover original SPSR value ANDS $res,$res,#Mode_mask-Mode_32not26 ASSERT (Mode_USR26:AND::NOT:Mode_32not26) = 0 ASSERT (Mode_USR32:AND::NOT:Mode_32not26) = 0 ] [ {CONFIG}=26 $label LDR $res,[Rfp,#15*4] ;Recover original LR value ANDS $res,$res,#Mode_mask ASSERT Mode_USR26 = 0 ] MEND ;=========================================================================== ; Macro to insert the right amount of padding between a table-driven branch ; instruction (e.g. ADD PC,PC,reg,LSL #2) and the in-line branch table that ; follows it. Made into a macro for documentation purposes, and also just in ; case the user-visible pipeline depth has to change at some point in the ; future. MACRO BranchTablePad DCD 0 ;Padding before branch table MEND ;=========================================================================== ; Macro to re-enable interrupts if "EnableInterrupts" is {TRUE}. Only ; argument is a temporary register. MACRO $label InterruptEnable $t [ EnableInterrupts [ {CONFIG} = 32 $label MRS $t,CPSR_all BIC $t,$t,#I_bit MSR CPSR_all,$t ] [ {CONFIG} = 26 $label MOV $t,PC BIC $t,$t,#I_bit TEQP PC,$t ] NOP ] MEND ;=========================================================================== ; Macro to re-disable interrupts if "EnableInterrupts" is {TRUE}. Only ; argument is a temporary register. MACRO $label InterruptDisable $t [ EnableInterrupts [ {CONFIG} = 32 $label MRS $t,CPSR_all ORR $t,$t,#I_bit MSR CPSR_all,$t ] [ {CONFIG} = 26 $label MOV $t,PC ORR $t,$t,#I_bit TEQP PC,$t ] NOP ] MEND ;=========================================================================== ; Macro to do the standard "enter recursive floating point code" processing. ; The operands are: ; $freeregs: Number of floating point registers to free up, in the range 1 ; to 8; ; $extra: Number of bytes of extra space to be left on the stack above ; the register dump; ; $addr: Register to contain address of extra space - also used to hold ; temporary values during macro, so must be present even if no ; extra space is wanted; ; $nofpsr: If this operand is non-null, it inhibits the FPSR changes ; described below. ; Rsp and Rfpsr are also operands. ; This code is written quite carefully, to avoid the use of floating point ; instructions the FPE won't like (e.g. those which use mode-dependent ; registers). It also disables interrupts (if they were ever enabled) and ; leaves a record of what floating point registers are on the stack, to make ; certain core_abort works. Finally, it clears out the exception enable bits ; and cumulative flags from the real FPSR, since exceptions in recursive ; code must not go out to the user trap handlers. Note that Rfpsr holds the ; real FPSR value and will be written back to the real FPSR before control ; is returned to the user, either via a trap handler or by normal return. MACRO $label EnterRecursive $freeregs,$extra,$addr,$nofpsr ASSERT ($freeregs) <= 8 ASSERT ($freeregs) >= 1 $label SUB Rsp,Rsp,#($freeregs)*12+4+($extra) MOV $addr,Rfpsr,LSL #8 ORR $addr,$addr,#(1:SHL:($freeregs))-1 STR $addr,[Rsp] InterruptDisable $addr [ "$nofpsr" = "" BIC $addr,Rfpsr,#IOE_bit+DZE_bit+OFE_bit+UFE_bit+IXE_bit BIC $addr,$addr,#IOC_bit+DZC_bit+OFC_bit+UFC_bit+IXC_bit WFS $addr ] ADD $addr,Rsp,#($freeregs)*12+4 [ ($freeregs) <= 4 SFM F0,($freeregs),[$addr,#-12*($freeregs)] | SFM F0,4,[$addr,#-12*($freeregs)] SFM F4,($freeregs)-4,[$addr,#-12*($freeregs)+48] ] MEND ;=========================================================================== ; Macro to do the standard "exit recursive floating point code" processing. ; The operands are: ; $freeregs: Number of floating point registers to recover from the stack, ; in the range 1 to 8; ; $extra: Number of bytes of extra space to recover from the stack; ; $t: A temporary register; ; $fpres: Floating point register that contains the floating point result ; - null if no such result; ; $result: Register list to take 3 word floating point result - null if ; no such result. ; Rsp is also an operand. MACRO $label ExitRecursive $freeregs,$extra,$t,$fpres,$result ASSERT ($freeregs) <= 8 ASSERT ($freeregs) >= 1 ADD $t,Rsp,#($freeregs)*12+4 [ "$fpres" <> "" ASSERT ($extra) >= 12 SFM $fpres,1,[$t] LDMIA $t,$result ] [ ($freeregs) <= 4 LFM F0,($freeregs),[$t,#-12*($freeregs)] | LFM F0,4,[$t,#-12*($freeregs)] LFM F4,($freeregs)-4,[$t,#-12*($freeregs)+48] ] ADD Rsp,Rsp,#($freeregs)*12+4+($extra) InterruptEnable $t MEND ;=========================================================================== ; Macro to determine whether an exception was precise or imprecise. Implicit ; operands are Rfpsr (for the SO bit and to determine whether it is a ; hardware or software context) and Rins (to determine what type of ; instruction this is). Explicit operands are: ; $dst: Set to zero if precise, non-zero if imprecise; ; $t: A temporary register; ; $tbl_fpa: The address of a bit table used to determine whether FPA ; instructions are capable of producing imprecise exceptions. ; ; The full set of conditions for the operation to be imprecise are: ; ; * The FPA hardware is being used; ; * The SO bit is clear in the FPSR; ; * The instruction is a CPDO or CPRT; ; * The instruction is capable of delivering an imprecise exception (e.g. ; not a purely software-implemented instruction, a FIX or a compare); ; ; Testing this last condition is complicated: it is done via the bit table ; mentioned above. ; ; The optimisation that the whole test is unnecessary for FPE-only code is ; not performed here: it is instead done in the main assembly source and ; this macro is never used. MACRO $label TestImp $dst,$t,$tbl_fpa ASSERT $dst <> Rins ASSERT $dst <> Rfpsr ASSERT $t <> Rins ASSERT $t <> Rfpsr ASSERT $t <> $dst $label ; Address the table ADR $t,$tbl_fpa ; Then look up correct table entry AND $dst,Rins,#RTnotDO_bit BiShift LDR,$dst,$t,$dst,LSR #RTnotDO_pos,LSL #2 TST Rins,#Op2_mask MOVNE $dst,$dst,LSR #16 AND $t,Rins,#Op1_mask MOV $t,$t,LSR #Op1_pos ; Now incorporate other tests MOV $dst,$dst,LSR $t ;Bit0 is result so far AND $dst,$dst,Rfpsr,LSR #31 ;Isolate bit0 and AND ; with (hardware in use) BIC $dst,$dst,Rfpsr,LSR #SO_pos ;AND with (SO bit clear) AND $dst,$dst,Rins,LSR #RTDOnotDT_pos ;AND with (CPRT or CPDO) MEND ;=========================================================================== ; Macros used for byte arrays. GBLA ByteArrayCount ByteArrayCount SETA 0 MACRO $label BytesStart ALIGN $label ByteArray_$ByteArrayCount MEND MACRO $label BytesEnd ALIGN $label ByteArrayEnd_$ByteArrayCount ByteArrayCount SETA ByteArrayCount+1 MEND ;=========================================================================== END
38.529095
99
0.48754
f569530c592256ed5e8f727cf9a6b99920fa916f
192
asm
Assembly
alice2/brads_alice2_archive/asm/test_code.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
63
2015-08-14T23:27:39.000Z
2022-03-09T22:46:11.000Z
alice2/brads_alice2_archive/asm/test_code.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
64
2015-09-11T23:13:03.000Z
2018-10-29T09:38:06.000Z
alice2/brads_alice2_archive/asm/test_code.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
9
2016-01-06T00:06:33.000Z
2021-12-07T10:38:15.000Z
; to be included by rom.asm SHITAGAIN LD HL, SHITSTR CALL LCDPRINT LD HL, SHOOTSTR CALL LCDPRINT JP SHITAGAIN SHITSTR DB "This shit works", 10, 0 SHOOTSTR DB "Shoot my dog", 10, 0
12
36
0.703125
4cec2c7042e60d03653bc28b2e08e6cb2cdaf44a
996
asm
Assembly
utils/bubble_sort.asm
pastchick3/risc-v-processor-sv
1de8fdb08f14ba3e2dffa0ddcc950a628384171c
[ "MIT" ]
null
null
null
utils/bubble_sort.asm
pastchick3/risc-v-processor-sv
1de8fdb08f14ba3e2dffa0ddcc950a628384171c
[ "MIT" ]
null
null
null
utils/bubble_sort.asm
pastchick3/risc-v-processor-sv
1de8fdb08f14ba3e2dffa0ddcc950a628384171c
[ "MIT" ]
null
null
null
// The C version of the bubble sort is given as below: // // void bubbleSort(int arr[], size_t n) { // for (size_t i = 0; i < n - 1; i++) { // for (size_t j = 0; j < n - i - 1; j++) { // if (arr[j] > arr[j+1]) { // swap(&arr[j], &arr[j+1]); // } // } // } // } // // void swap(int *a, int *b) { // int temp = *a; // *a = *b; // *b = temp; // } // Load n-1 into x28. x29 will be the counter i. ld x28, 12(x0) ld x5, 1(x0) sub x28, x28, x5 OuterLoop: // Load n-i-1 into x30. x31 will be the counter j. ld x30, 12(x0) sub x30, x30, x29 ld x5, 1(x0) sub x30, x30, x5 add x31, x0, x0 InnerLoop: // Compare and swap arr[j] and arr[j+1]. ld x5, 13(x31) ld x6, 14(x31) blt x5, x6, SwapSkipped add x7, x5, x0 add x5, x6, x0 add x6, x7, x0 sd x5, 13(x31) sd x6, 14(x31) SwapSkipped: // Compute j++. ld x5, 1(x0) add x31, x31, x5 blt x31, x30, InnerLoop // Compute i++. ld x5, 1(x0) add x29, x29, x5 blt x29, x28, OuterLoop
18.792453
54
0.522088
2c00eb36d5d2734cf4d7d210b34e8e7a0a3a124e
682
asm
Assembly
unittests/ASM/PrimaryGroup/2_D3_02_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
628
2020-03-06T14:01:32.000Z
2022-03-31T06:35:14.000Z
unittests/ASM/PrimaryGroup/2_D3_02_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
576
2020-03-06T08:25:12.000Z
2022-03-30T04:05:29.000Z
unittests/ASM/PrimaryGroup/2_D3_02_2.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
38
2020-03-07T06:10:00.000Z
2022-03-29T09:27:36.000Z
%ifdef CONFIG { "RegData": { "RBX": "0x00000006", "RDI": "0x00000004", "RDX": "0x00000002", "RSI": "0x00000000", "R8": "0x0", "R9": "0x0", "R10": "0x1", "R11": "0x1" } } %endif mov rbx, 0x00000001 mov rdi, 0x00000001 mov rdx, 0x40000000 mov rsi, 0x40000000 mov rcx, 2 stc rcl ebx, cl lahf mov r8w, ax shr r8, 8 and r8, 1 ; We only care about carry flag here clc rcl edi, cl lahf mov r9w, ax shr r9, 8 and r9, 1 ; We only care about carry flag here stc rcl edx, cl lahf mov r10w, ax shr r10, 8 and r10, 1 ; We only care about carry flag here clc rcl esi, cl lahf mov r11w, ax shr r11, 8 and r11, 1 ; We only care about carry flag here hlt
13.372549
47
0.629032
ddddaeeae5b7f6195ddc7e1f3109a7597ef7f3cc
425
asm
Assembly
oeis/214/A214885.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/214/A214885.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/214/A214885.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A214885: a(n) = Sum_{k=0..n} (-1)^k*F(k)*F(k+3), where F=A000045 (Fibonacci numbers). ; Submitted by Christian Krause ; 0,-3,2,-14,25,-80,192,-523,1346,-3550,9265,-24288,63552,-166419,435650,-1140590,2986057,-7817648,20466816,-53582875,140281730,-367262398,961505377,-2517253824,6590256000,-17253514275,45170286722,-118257345998 mov $2,$0 seq $0,77916 ; Expansion of (1-x)^(-1)/(1 + 2*x - 2*x^2 - x^3). sub $0,$2 sub $0,1
47.222222
210
0.684706
63097216947fdc97f5548a3f711122f42b128201
316
asm
Assembly
programs/oeis/070/A070457.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/070/A070457.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/070/A070457.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A070457: a(n) = n^2 mod 35. ; 0,1,4,9,16,25,1,14,29,11,30,16,4,29,21,15,11,9,9,11,15,21,29,4,16,30,11,29,14,1,25,16,9,4,1,0,1,4,9,16,25,1,14,29,11,30,16,4,29,21,15,11,9,9,11,15,21,29,4,16,30,11,29,14,1,25,16,9,4,1,0,1,4,9,16,25,1,14,29,11,30,16,4,29,21,15,11,9,9,11,15,21,29,4,16,30,11,29,14,1 pow $0,2 mod $0,35
52.666667
265
0.60443
ed8d9e37812a17ad041377650936792696646ac1
200
asm
Assembly
bootdict/tc/literal.asm
ikysil/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
8
2017-08-03T08:49:06.000Z
2021-12-17T12:02:19.000Z
bootdict/tc/literal.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
58
2016-04-21T20:03:54.000Z
2022-01-16T00:40:50.000Z
bootdict/tc/literal.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
1
2018-07-25T21:07:00.000Z
2018-07-25T21:07:00.000Z
; 6.1.1780 LITERAL $COLON 'LITERAL',$LITERAL,VEF_IMMEDIATE_COMPILE_ONLY CWLIT $LIT CW $COMPILEC, $COMMA $END_COLON
33.333333
73
0.45
80a8210eb69e0e7dbd5e1c8bcd7465a2a2976694
834
asm
Assembly
oeis/046/A046994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/046/A046994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/046/A046994.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A046994: Number of Greek-key tours on a 3 X n board; i.e., self-avoiding walks on a 3 X n grid starting in the top left corner. ; Submitted by Christian Krause ; 1,3,8,17,38,78,164,332,680,1368,2768,5552,11168,22368,44864,89792,179840,359808,720128,1440512,2882048,5764608,11531264,23063552,46131200,92264448,184537088,369078272,738172928,1476354048,2952740864,5905498112,11811061760,23622156288,47244443648,94488952832,188978167808,377956466688,755913457664,1511827177472,3023655403520,6047311331328,12094624759808,24189250568192,48378505330688,96757012758528,193514033905664,387028072005632,774056160788480,1548112329965568,3096224693485568,6192449403748352 mov $1,7 mov $2,4 mov $4,1 lpb $0 sub $0,1 sub $1,1 add $1,$4 mul $1,2 mov $3,$4 sub $3,$2 mov $4,$2 add $2,$3 mul $2,2 lpe mov $0,$1 mul $0,4 div $0,16
37.909091
499
0.778177
4f732fe1b30916194cbb0721410f044b3b2ffa2f
606
asm
Assembly
programs/oeis/313/A313289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/313/A313289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/313/A313289.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A313289: Coordination sequence Gal.4.55.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,9,15,21,27,32,36,40,45,51,57,63,68,72,76,81,87,93,99,104,108,112,117,123,129,135,140,144,148,153,159,165,171,176,180,184,189,195,201,207,212,216,220,225,231,237,243,248,252 mov $3,$0 add $3,1 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 sub $0,$3 mov $2,1 sub $2,$0 mov $4,$0 mul $4,2 lpb $4 mov $4,1 sub $4,$2 mov $2,$4 pow $4,2 mod $4,7 add $4,3 lpe add $4,1 add $1,$4 lpe mov $0,$1
22.444444
178
0.618812
adfc2b044bb16f7d4611c2b2b91756665a147221
378
asm
Assembly
programs/oeis/296/A296196.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/296/A296196.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/296/A296196.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A296196: Harary index of the n X n queen graph. ; 0,6,32,98,230,460,826,1372,2148,3210,4620,6446,8762,11648,15190,19480,24616,30702,37848,46170,55790,66836,79442,93748,109900,128050,148356,170982,196098,223880,254510,288176,325072,365398,409360,457170,509046,565212,625898,691340 lpb $0,1 add $3,$0 sub $0,1 add $2,$3 add $3,4 add $2,$3 sub $2,$0 add $1,$2 lpe
29.076923
231
0.71164
80727ab7be4e0dc8d81549f6401853f1f631aa1e
2,287
asm
Assembly
examples/asm-64/float.asm
patrickf2000/upl
a58e3fd3f185e52d40332d4e7473ff7de8245f04
[ "BSD-3-Clause" ]
null
null
null
examples/asm-64/float.asm
patrickf2000/upl
a58e3fd3f185e52d40332d4e7473ff7de8245f04
[ "BSD-3-Clause" ]
6
2019-06-15T12:38:26.000Z
2019-06-15T13:03:05.000Z
examples/asm-64/float.asm
patrickf2000/upl
a58e3fd3f185e52d40332d4e7473ff7de8245f04
[ "BSD-3-Clause" ]
null
null
null
.intel_syntax noprefix .data flt_1: .long 1067299373 flt_2: .long 1080255578 flt_3: .long 1078875652 STR_1: .string "Add: %f\n" flt_4: .long 1067299373 flt_5: .long 1080255578 flt_6: .long 1078875652 STR_2: .string "Sub: %f\n" flt_7: .long 1067299373 flt_8: .long 1080255578 flt_9: .long 1078875652 STR_3: .string "Mul: %f\n" flt_10: .long 1067299373 flt_11: .long 1080255578 flt_12: .long 1078875652 STR_4: .string "Div: %f\n" .bss .text .extern puts .extern printf .extern exit .extern fflush .extern input_int .extern print_int .global add_test .global sub_test .global mul_test .global div_test .global main add_test: push rbp mov rbp, rsp sub rsp, 48 movss xmm0, [flt_1] movss [rbp-8], xmm0 movss xmm0, [flt_2] movss [rbp-12], xmm0 movss xmm0, [rbp-8] addss xmm0, [rbp-12] movss [rbp-16], xmm0 movss xmm0, [rbp-16] addss xmm0, [flt_3] movss [rbp-16], xmm0 mov edi, OFFSET FLAT:STR_1 movss xmm0, [rbp-16] cvtss2sd xmm0, xmm0 call printf leave ret sub_test: push rbp mov rbp, rsp sub rsp, 48 movss xmm0, [flt_4] movss [rbp-8], xmm0 movss xmm0, [flt_5] movss [rbp-12], xmm0 movss xmm0, [rbp-8] subss xmm0, [rbp-12] movss [rbp-16], xmm0 movss xmm0, [rbp-16] addss xmm0, [flt_6] movss [rbp-16], xmm0 mov edi, OFFSET FLAT:STR_2 movss xmm0, [rbp-16] cvtss2sd xmm0, xmm0 call printf leave ret mul_test: push rbp mov rbp, rsp sub rsp, 48 movss xmm0, [flt_7] movss [rbp-8], xmm0 movss xmm0, [flt_8] movss [rbp-12], xmm0 movss xmm0, [rbp-8] mulss xmm0, [rbp-12] movss [rbp-16], xmm0 movss xmm0, [rbp-16] addss xmm0, [flt_9] movss [rbp-16], xmm0 mov edi, OFFSET FLAT:STR_3 movss xmm0, [rbp-16] cvtss2sd xmm0, xmm0 call printf leave ret div_test: push rbp mov rbp, rsp sub rsp, 48 movss xmm0, [flt_10] movss [rbp-8], xmm0 movss xmm0, [flt_11] movss [rbp-12], xmm0 movss xmm0, [rbp-8] divss xmm0, [rbp-12] movss [rbp-16], xmm0 movss xmm0, [rbp-16] addss xmm0, [flt_12] movss [rbp-16], xmm0 mov edi, OFFSET FLAT:STR_4 movss xmm0, [rbp-16] cvtss2sd xmm0, xmm0 call printf leave ret main: push rbp mov rbp, rsp sub rsp, 48 call add_test call sub_test call mul_test call div_test mov edi, 0 call fflush leave ret
14.117284
27
0.66725
66f753af740c687d6155fc10887a1de25c780341
44,840
asm
Assembly
stressfs.asm
gangwareGremlins/PA3
2d9b6103a93a2633e0328f9ba30347b01a37cde3
[ "MIT-0" ]
null
null
null
stressfs.asm
gangwareGremlins/PA3
2d9b6103a93a2633e0328f9ba30347b01a37cde3
[ "MIT-0" ]
null
null
null
stressfs.asm
gangwareGremlins/PA3
2d9b6103a93a2633e0328f9ba30347b01a37cde3
[ "MIT-0" ]
null
null
null
_stressfs: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "fs.h" #include "fcntl.h" int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: 56 push %esi f: 53 push %ebx 10: 51 push %ecx 11: 81 ec 28 02 00 00 sub $0x228,%esp int fd, i; char path[] = "stressfs0"; 17: 8d 55 d6 lea -0x2a(%ebp),%edx 1a: bb e0 08 00 00 mov $0x8e0,%ebx 1f: b8 0a 00 00 00 mov $0xa,%eax 24: 89 d7 mov %edx,%edi 26: 89 de mov %ebx,%esi 28: 89 c1 mov %eax,%ecx 2a: f3 a4 rep movsb %ds:(%esi),%es:(%edi) char data[512]; printf(1, "stressfs starting\n"); 2c: 83 ec 08 sub $0x8,%esp 2f: 68 bd 08 00 00 push $0x8bd 34: 6a 01 push $0x1 36: e8 d6 04 00 00 call 511 <printf> 3b: 83 c4 10 add $0x10,%esp memset(data, 'a', sizeof(data)); 3e: 83 ec 04 sub $0x4,%esp 41: 68 00 02 00 00 push $0x200 46: 6a 61 push $0x61 48: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax 4e: 50 push %eax 4f: e8 ad 01 00 00 call 201 <memset> 54: 83 c4 10 add $0x10,%esp for(i = 0; i < 4; i++) 57: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 5e: eb 0e jmp 6e <main+0x6e> if(fork() > 0) 60: e8 22 03 00 00 call 387 <fork> 65: 85 c0 test %eax,%eax 67: 7e 02 jle 6b <main+0x6b> break; 69: eb 09 jmp 74 <main+0x74> char data[512]; printf(1, "stressfs starting\n"); memset(data, 'a', sizeof(data)); for(i = 0; i < 4; i++) 6b: ff 45 e4 incl -0x1c(%ebp) 6e: 83 7d e4 03 cmpl $0x3,-0x1c(%ebp) 72: 7e ec jle 60 <main+0x60> if(fork() > 0) break; printf(1, "write %d\n", i); 74: 83 ec 04 sub $0x4,%esp 77: ff 75 e4 pushl -0x1c(%ebp) 7a: 68 d0 08 00 00 push $0x8d0 7f: 6a 01 push $0x1 81: e8 8b 04 00 00 call 511 <printf> 86: 83 c4 10 add $0x10,%esp path[8] += i; 89: 8a 45 de mov -0x22(%ebp),%al 8c: 88 c2 mov %al,%dl 8e: 8b 45 e4 mov -0x1c(%ebp),%eax 91: 01 d0 add %edx,%eax 93: 88 45 de mov %al,-0x22(%ebp) fd = open(path, O_CREATE | O_RDWR); 96: 83 ec 08 sub $0x8,%esp 99: 68 02 02 00 00 push $0x202 9e: 8d 45 d6 lea -0x2a(%ebp),%eax a1: 50 push %eax a2: e8 28 03 00 00 call 3cf <open> a7: 83 c4 10 add $0x10,%esp aa: 89 45 e0 mov %eax,-0x20(%ebp) for(i = 0; i < 20; i++) ad: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) b4: eb 1d jmp d3 <main+0xd3> // printf(fd, "%d\n", i); write(fd, data, sizeof(data)); b6: 83 ec 04 sub $0x4,%esp b9: 68 00 02 00 00 push $0x200 be: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax c4: 50 push %eax c5: ff 75 e0 pushl -0x20(%ebp) c8: e8 e2 02 00 00 call 3af <write> cd: 83 c4 10 add $0x10,%esp printf(1, "write %d\n", i); path[8] += i; fd = open(path, O_CREATE | O_RDWR); for(i = 0; i < 20; i++) d0: ff 45 e4 incl -0x1c(%ebp) d3: 83 7d e4 13 cmpl $0x13,-0x1c(%ebp) d7: 7e dd jle b6 <main+0xb6> // printf(fd, "%d\n", i); write(fd, data, sizeof(data)); close(fd); d9: 83 ec 0c sub $0xc,%esp dc: ff 75 e0 pushl -0x20(%ebp) df: e8 d3 02 00 00 call 3b7 <close> e4: 83 c4 10 add $0x10,%esp printf(1, "read\n"); e7: 83 ec 08 sub $0x8,%esp ea: 68 da 08 00 00 push $0x8da ef: 6a 01 push $0x1 f1: e8 1b 04 00 00 call 511 <printf> f6: 83 c4 10 add $0x10,%esp fd = open(path, O_RDONLY); f9: 83 ec 08 sub $0x8,%esp fc: 6a 00 push $0x0 fe: 8d 45 d6 lea -0x2a(%ebp),%eax 101: 50 push %eax 102: e8 c8 02 00 00 call 3cf <open> 107: 83 c4 10 add $0x10,%esp 10a: 89 45 e0 mov %eax,-0x20(%ebp) for (i = 0; i < 20; i++) 10d: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 114: eb 1d jmp 133 <main+0x133> read(fd, data, sizeof(data)); 116: 83 ec 04 sub $0x4,%esp 119: 68 00 02 00 00 push $0x200 11e: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax 124: 50 push %eax 125: ff 75 e0 pushl -0x20(%ebp) 128: e8 7a 02 00 00 call 3a7 <read> 12d: 83 c4 10 add $0x10,%esp close(fd); printf(1, "read\n"); fd = open(path, O_RDONLY); for (i = 0; i < 20; i++) 130: ff 45 e4 incl -0x1c(%ebp) 133: 83 7d e4 13 cmpl $0x13,-0x1c(%ebp) 137: 7e dd jle 116 <main+0x116> read(fd, data, sizeof(data)); close(fd); 139: 83 ec 0c sub $0xc,%esp 13c: ff 75 e0 pushl -0x20(%ebp) 13f: e8 73 02 00 00 call 3b7 <close> 144: 83 c4 10 add $0x10,%esp wait(); 147: e8 4b 02 00 00 call 397 <wait> exit(); 14c: e8 3e 02 00 00 call 38f <exit> 00000151 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 151: 55 push %ebp 152: 89 e5 mov %esp,%ebp 154: 57 push %edi 155: 53 push %ebx asm volatile("cld; rep stosb" : 156: 8b 4d 08 mov 0x8(%ebp),%ecx 159: 8b 55 10 mov 0x10(%ebp),%edx 15c: 8b 45 0c mov 0xc(%ebp),%eax 15f: 89 cb mov %ecx,%ebx 161: 89 df mov %ebx,%edi 163: 89 d1 mov %edx,%ecx 165: fc cld 166: f3 aa rep stos %al,%es:(%edi) 168: 89 ca mov %ecx,%edx 16a: 89 fb mov %edi,%ebx 16c: 89 5d 08 mov %ebx,0x8(%ebp) 16f: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 172: 5b pop %ebx 173: 5f pop %edi 174: 5d pop %ebp 175: c3 ret 00000176 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 176: 55 push %ebp 177: 89 e5 mov %esp,%ebp 179: 83 ec 10 sub $0x10,%esp char *os; os = s; 17c: 8b 45 08 mov 0x8(%ebp),%eax 17f: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 182: 90 nop 183: 8b 45 08 mov 0x8(%ebp),%eax 186: 8d 50 01 lea 0x1(%eax),%edx 189: 89 55 08 mov %edx,0x8(%ebp) 18c: 8b 55 0c mov 0xc(%ebp),%edx 18f: 8d 4a 01 lea 0x1(%edx),%ecx 192: 89 4d 0c mov %ecx,0xc(%ebp) 195: 8a 12 mov (%edx),%dl 197: 88 10 mov %dl,(%eax) 199: 8a 00 mov (%eax),%al 19b: 84 c0 test %al,%al 19d: 75 e4 jne 183 <strcpy+0xd> ; return os; 19f: 8b 45 fc mov -0x4(%ebp),%eax } 1a2: c9 leave 1a3: c3 ret 000001a4 <strcmp>: int strcmp(const char *p, const char *q) { 1a4: 55 push %ebp 1a5: 89 e5 mov %esp,%ebp while(*p && *p == *q) 1a7: eb 06 jmp 1af <strcmp+0xb> p++, q++; 1a9: ff 45 08 incl 0x8(%ebp) 1ac: ff 45 0c incl 0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 1af: 8b 45 08 mov 0x8(%ebp),%eax 1b2: 8a 00 mov (%eax),%al 1b4: 84 c0 test %al,%al 1b6: 74 0e je 1c6 <strcmp+0x22> 1b8: 8b 45 08 mov 0x8(%ebp),%eax 1bb: 8a 10 mov (%eax),%dl 1bd: 8b 45 0c mov 0xc(%ebp),%eax 1c0: 8a 00 mov (%eax),%al 1c2: 38 c2 cmp %al,%dl 1c4: 74 e3 je 1a9 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 1c6: 8b 45 08 mov 0x8(%ebp),%eax 1c9: 8a 00 mov (%eax),%al 1cb: 0f b6 d0 movzbl %al,%edx 1ce: 8b 45 0c mov 0xc(%ebp),%eax 1d1: 8a 00 mov (%eax),%al 1d3: 0f b6 c0 movzbl %al,%eax 1d6: 29 c2 sub %eax,%edx 1d8: 89 d0 mov %edx,%eax } 1da: 5d pop %ebp 1db: c3 ret 000001dc <strlen>: uint strlen(char *s) { 1dc: 55 push %ebp 1dd: 89 e5 mov %esp,%ebp 1df: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1e2: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1e9: eb 03 jmp 1ee <strlen+0x12> 1eb: ff 45 fc incl -0x4(%ebp) 1ee: 8b 55 fc mov -0x4(%ebp),%edx 1f1: 8b 45 08 mov 0x8(%ebp),%eax 1f4: 01 d0 add %edx,%eax 1f6: 8a 00 mov (%eax),%al 1f8: 84 c0 test %al,%al 1fa: 75 ef jne 1eb <strlen+0xf> ; return n; 1fc: 8b 45 fc mov -0x4(%ebp),%eax } 1ff: c9 leave 200: c3 ret 00000201 <memset>: void* memset(void *dst, int c, uint n) { 201: 55 push %ebp 202: 89 e5 mov %esp,%ebp stosb(dst, c, n); 204: 8b 45 10 mov 0x10(%ebp),%eax 207: 50 push %eax 208: ff 75 0c pushl 0xc(%ebp) 20b: ff 75 08 pushl 0x8(%ebp) 20e: e8 3e ff ff ff call 151 <stosb> 213: 83 c4 0c add $0xc,%esp return dst; 216: 8b 45 08 mov 0x8(%ebp),%eax } 219: c9 leave 21a: c3 ret 0000021b <strchr>: char* strchr(const char *s, char c) { 21b: 55 push %ebp 21c: 89 e5 mov %esp,%ebp 21e: 83 ec 04 sub $0x4,%esp 221: 8b 45 0c mov 0xc(%ebp),%eax 224: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 227: eb 12 jmp 23b <strchr+0x20> if(*s == c) 229: 8b 45 08 mov 0x8(%ebp),%eax 22c: 8a 00 mov (%eax),%al 22e: 3a 45 fc cmp -0x4(%ebp),%al 231: 75 05 jne 238 <strchr+0x1d> return (char*)s; 233: 8b 45 08 mov 0x8(%ebp),%eax 236: eb 11 jmp 249 <strchr+0x2e> } char* strchr(const char *s, char c) { for(; *s; s++) 238: ff 45 08 incl 0x8(%ebp) 23b: 8b 45 08 mov 0x8(%ebp),%eax 23e: 8a 00 mov (%eax),%al 240: 84 c0 test %al,%al 242: 75 e5 jne 229 <strchr+0xe> if(*s == c) return (char*)s; return 0; 244: b8 00 00 00 00 mov $0x0,%eax } 249: c9 leave 24a: c3 ret 0000024b <gets>: char* gets(char *buf, int max) { 24b: 55 push %ebp 24c: 89 e5 mov %esp,%ebp 24e: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 251: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 258: eb 41 jmp 29b <gets+0x50> cc = read(0, &c, 1); 25a: 83 ec 04 sub $0x4,%esp 25d: 6a 01 push $0x1 25f: 8d 45 ef lea -0x11(%ebp),%eax 262: 50 push %eax 263: 6a 00 push $0x0 265: e8 3d 01 00 00 call 3a7 <read> 26a: 83 c4 10 add $0x10,%esp 26d: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 270: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 274: 7f 02 jg 278 <gets+0x2d> break; 276: eb 2c jmp 2a4 <gets+0x59> buf[i++] = c; 278: 8b 45 f4 mov -0xc(%ebp),%eax 27b: 8d 50 01 lea 0x1(%eax),%edx 27e: 89 55 f4 mov %edx,-0xc(%ebp) 281: 89 c2 mov %eax,%edx 283: 8b 45 08 mov 0x8(%ebp),%eax 286: 01 c2 add %eax,%edx 288: 8a 45 ef mov -0x11(%ebp),%al 28b: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 28d: 8a 45 ef mov -0x11(%ebp),%al 290: 3c 0a cmp $0xa,%al 292: 74 10 je 2a4 <gets+0x59> 294: 8a 45 ef mov -0x11(%ebp),%al 297: 3c 0d cmp $0xd,%al 299: 74 09 je 2a4 <gets+0x59> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 29b: 8b 45 f4 mov -0xc(%ebp),%eax 29e: 40 inc %eax 29f: 3b 45 0c cmp 0xc(%ebp),%eax 2a2: 7c b6 jl 25a <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 2a4: 8b 55 f4 mov -0xc(%ebp),%edx 2a7: 8b 45 08 mov 0x8(%ebp),%eax 2aa: 01 d0 add %edx,%eax 2ac: c6 00 00 movb $0x0,(%eax) return buf; 2af: 8b 45 08 mov 0x8(%ebp),%eax } 2b2: c9 leave 2b3: c3 ret 000002b4 <stat>: int stat(char *n, struct stat *st) { 2b4: 55 push %ebp 2b5: 89 e5 mov %esp,%ebp 2b7: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 2ba: 83 ec 08 sub $0x8,%esp 2bd: 6a 00 push $0x0 2bf: ff 75 08 pushl 0x8(%ebp) 2c2: e8 08 01 00 00 call 3cf <open> 2c7: 83 c4 10 add $0x10,%esp 2ca: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 2cd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 2d1: 79 07 jns 2da <stat+0x26> return -1; 2d3: b8 ff ff ff ff mov $0xffffffff,%eax 2d8: eb 25 jmp 2ff <stat+0x4b> r = fstat(fd, st); 2da: 83 ec 08 sub $0x8,%esp 2dd: ff 75 0c pushl 0xc(%ebp) 2e0: ff 75 f4 pushl -0xc(%ebp) 2e3: e8 ff 00 00 00 call 3e7 <fstat> 2e8: 83 c4 10 add $0x10,%esp 2eb: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 2ee: 83 ec 0c sub $0xc,%esp 2f1: ff 75 f4 pushl -0xc(%ebp) 2f4: e8 be 00 00 00 call 3b7 <close> 2f9: 83 c4 10 add $0x10,%esp return r; 2fc: 8b 45 f0 mov -0x10(%ebp),%eax } 2ff: c9 leave 300: c3 ret 00000301 <atoi>: int atoi(const char *s) { 301: 55 push %ebp 302: 89 e5 mov %esp,%ebp 304: 83 ec 10 sub $0x10,%esp int n; n = 0; 307: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 30e: eb 24 jmp 334 <atoi+0x33> n = n*10 + *s++ - '0'; 310: 8b 55 fc mov -0x4(%ebp),%edx 313: 89 d0 mov %edx,%eax 315: c1 e0 02 shl $0x2,%eax 318: 01 d0 add %edx,%eax 31a: 01 c0 add %eax,%eax 31c: 89 c1 mov %eax,%ecx 31e: 8b 45 08 mov 0x8(%ebp),%eax 321: 8d 50 01 lea 0x1(%eax),%edx 324: 89 55 08 mov %edx,0x8(%ebp) 327: 8a 00 mov (%eax),%al 329: 0f be c0 movsbl %al,%eax 32c: 01 c8 add %ecx,%eax 32e: 83 e8 30 sub $0x30,%eax 331: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 334: 8b 45 08 mov 0x8(%ebp),%eax 337: 8a 00 mov (%eax),%al 339: 3c 2f cmp $0x2f,%al 33b: 7e 09 jle 346 <atoi+0x45> 33d: 8b 45 08 mov 0x8(%ebp),%eax 340: 8a 00 mov (%eax),%al 342: 3c 39 cmp $0x39,%al 344: 7e ca jle 310 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 346: 8b 45 fc mov -0x4(%ebp),%eax } 349: c9 leave 34a: c3 ret 0000034b <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 34b: 55 push %ebp 34c: 89 e5 mov %esp,%ebp 34e: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 351: 8b 45 08 mov 0x8(%ebp),%eax 354: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 357: 8b 45 0c mov 0xc(%ebp),%eax 35a: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 35d: eb 16 jmp 375 <memmove+0x2a> *dst++ = *src++; 35f: 8b 45 fc mov -0x4(%ebp),%eax 362: 8d 50 01 lea 0x1(%eax),%edx 365: 89 55 fc mov %edx,-0x4(%ebp) 368: 8b 55 f8 mov -0x8(%ebp),%edx 36b: 8d 4a 01 lea 0x1(%edx),%ecx 36e: 89 4d f8 mov %ecx,-0x8(%ebp) 371: 8a 12 mov (%edx),%dl 373: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 375: 8b 45 10 mov 0x10(%ebp),%eax 378: 8d 50 ff lea -0x1(%eax),%edx 37b: 89 55 10 mov %edx,0x10(%ebp) 37e: 85 c0 test %eax,%eax 380: 7f dd jg 35f <memmove+0x14> *dst++ = *src++; return vdst; 382: 8b 45 08 mov 0x8(%ebp),%eax } 385: c9 leave 386: c3 ret 00000387 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 387: b8 01 00 00 00 mov $0x1,%eax 38c: cd 40 int $0x40 38e: c3 ret 0000038f <exit>: SYSCALL(exit) 38f: b8 02 00 00 00 mov $0x2,%eax 394: cd 40 int $0x40 396: c3 ret 00000397 <wait>: SYSCALL(wait) 397: b8 03 00 00 00 mov $0x3,%eax 39c: cd 40 int $0x40 39e: c3 ret 0000039f <pipe>: SYSCALL(pipe) 39f: b8 04 00 00 00 mov $0x4,%eax 3a4: cd 40 int $0x40 3a6: c3 ret 000003a7 <read>: SYSCALL(read) 3a7: b8 05 00 00 00 mov $0x5,%eax 3ac: cd 40 int $0x40 3ae: c3 ret 000003af <write>: SYSCALL(write) 3af: b8 10 00 00 00 mov $0x10,%eax 3b4: cd 40 int $0x40 3b6: c3 ret 000003b7 <close>: SYSCALL(close) 3b7: b8 15 00 00 00 mov $0x15,%eax 3bc: cd 40 int $0x40 3be: c3 ret 000003bf <kill>: SYSCALL(kill) 3bf: b8 06 00 00 00 mov $0x6,%eax 3c4: cd 40 int $0x40 3c6: c3 ret 000003c7 <exec>: SYSCALL(exec) 3c7: b8 07 00 00 00 mov $0x7,%eax 3cc: cd 40 int $0x40 3ce: c3 ret 000003cf <open>: SYSCALL(open) 3cf: b8 0f 00 00 00 mov $0xf,%eax 3d4: cd 40 int $0x40 3d6: c3 ret 000003d7 <mknod>: SYSCALL(mknod) 3d7: b8 11 00 00 00 mov $0x11,%eax 3dc: cd 40 int $0x40 3de: c3 ret 000003df <unlink>: SYSCALL(unlink) 3df: b8 12 00 00 00 mov $0x12,%eax 3e4: cd 40 int $0x40 3e6: c3 ret 000003e7 <fstat>: SYSCALL(fstat) 3e7: b8 08 00 00 00 mov $0x8,%eax 3ec: cd 40 int $0x40 3ee: c3 ret 000003ef <link>: SYSCALL(link) 3ef: b8 13 00 00 00 mov $0x13,%eax 3f4: cd 40 int $0x40 3f6: c3 ret 000003f7 <mkdir>: SYSCALL(mkdir) 3f7: b8 14 00 00 00 mov $0x14,%eax 3fc: cd 40 int $0x40 3fe: c3 ret 000003ff <chdir>: SYSCALL(chdir) 3ff: b8 09 00 00 00 mov $0x9,%eax 404: cd 40 int $0x40 406: c3 ret 00000407 <dup>: SYSCALL(dup) 407: b8 0a 00 00 00 mov $0xa,%eax 40c: cd 40 int $0x40 40e: c3 ret 0000040f <getpid>: SYSCALL(getpid) 40f: b8 0b 00 00 00 mov $0xb,%eax 414: cd 40 int $0x40 416: c3 ret 00000417 <sbrk>: SYSCALL(sbrk) 417: b8 0c 00 00 00 mov $0xc,%eax 41c: cd 40 int $0x40 41e: c3 ret 0000041f <sleep>: SYSCALL(sleep) 41f: b8 0d 00 00 00 mov $0xd,%eax 424: cd 40 int $0x40 426: c3 ret 00000427 <uptime>: SYSCALL(uptime) 427: b8 0e 00 00 00 mov $0xe,%eax 42c: cd 40 int $0x40 42e: c3 ret 0000042f <getCallCount>: SYSCALL(getCallCount) 42f: b8 16 00 00 00 mov $0x16,%eax 434: cd 40 int $0x40 436: c3 ret 00000437 <myMemory>: SYSCALL(myMemory) 437: b8 17 00 00 00 mov $0x17,%eax 43c: cd 40 int $0x40 43e: c3 ret 0000043f <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 43f: 55 push %ebp 440: 89 e5 mov %esp,%ebp 442: 83 ec 18 sub $0x18,%esp 445: 8b 45 0c mov 0xc(%ebp),%eax 448: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 44b: 83 ec 04 sub $0x4,%esp 44e: 6a 01 push $0x1 450: 8d 45 f4 lea -0xc(%ebp),%eax 453: 50 push %eax 454: ff 75 08 pushl 0x8(%ebp) 457: e8 53 ff ff ff call 3af <write> 45c: 83 c4 10 add $0x10,%esp } 45f: c9 leave 460: c3 ret 00000461 <printint>: static void printint(int fd, int xx, int base, int sgn) { 461: 55 push %ebp 462: 89 e5 mov %esp,%ebp 464: 53 push %ebx 465: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 468: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 46f: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 473: 74 17 je 48c <printint+0x2b> 475: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 479: 79 11 jns 48c <printint+0x2b> neg = 1; 47b: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 482: 8b 45 0c mov 0xc(%ebp),%eax 485: f7 d8 neg %eax 487: 89 45 ec mov %eax,-0x14(%ebp) 48a: eb 06 jmp 492 <printint+0x31> } else { x = xx; 48c: 8b 45 0c mov 0xc(%ebp),%eax 48f: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 492: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 499: 8b 4d f4 mov -0xc(%ebp),%ecx 49c: 8d 41 01 lea 0x1(%ecx),%eax 49f: 89 45 f4 mov %eax,-0xc(%ebp) 4a2: 8b 5d 10 mov 0x10(%ebp),%ebx 4a5: 8b 45 ec mov -0x14(%ebp),%eax 4a8: ba 00 00 00 00 mov $0x0,%edx 4ad: f7 f3 div %ebx 4af: 89 d0 mov %edx,%eax 4b1: 8a 80 48 0b 00 00 mov 0xb48(%eax),%al 4b7: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 4bb: 8b 5d 10 mov 0x10(%ebp),%ebx 4be: 8b 45 ec mov -0x14(%ebp),%eax 4c1: ba 00 00 00 00 mov $0x0,%edx 4c6: f7 f3 div %ebx 4c8: 89 45 ec mov %eax,-0x14(%ebp) 4cb: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4cf: 75 c8 jne 499 <printint+0x38> if(neg) 4d1: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 4d5: 74 0e je 4e5 <printint+0x84> buf[i++] = '-'; 4d7: 8b 45 f4 mov -0xc(%ebp),%eax 4da: 8d 50 01 lea 0x1(%eax),%edx 4dd: 89 55 f4 mov %edx,-0xc(%ebp) 4e0: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 4e5: eb 1c jmp 503 <printint+0xa2> putc(fd, buf[i]); 4e7: 8d 55 dc lea -0x24(%ebp),%edx 4ea: 8b 45 f4 mov -0xc(%ebp),%eax 4ed: 01 d0 add %edx,%eax 4ef: 8a 00 mov (%eax),%al 4f1: 0f be c0 movsbl %al,%eax 4f4: 83 ec 08 sub $0x8,%esp 4f7: 50 push %eax 4f8: ff 75 08 pushl 0x8(%ebp) 4fb: e8 3f ff ff ff call 43f <putc> 500: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 503: ff 4d f4 decl -0xc(%ebp) 506: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 50a: 79 db jns 4e7 <printint+0x86> putc(fd, buf[i]); } 50c: 8b 5d fc mov -0x4(%ebp),%ebx 50f: c9 leave 510: c3 ret 00000511 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 511: 55 push %ebp 512: 89 e5 mov %esp,%ebp 514: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 517: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 51e: 8d 45 0c lea 0xc(%ebp),%eax 521: 83 c0 04 add $0x4,%eax 524: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 527: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 52e: e9 54 01 00 00 jmp 687 <printf+0x176> c = fmt[i] & 0xff; 533: 8b 55 0c mov 0xc(%ebp),%edx 536: 8b 45 f0 mov -0x10(%ebp),%eax 539: 01 d0 add %edx,%eax 53b: 8a 00 mov (%eax),%al 53d: 0f be c0 movsbl %al,%eax 540: 25 ff 00 00 00 and $0xff,%eax 545: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 548: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 54c: 75 2c jne 57a <printf+0x69> if(c == '%'){ 54e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 552: 75 0c jne 560 <printf+0x4f> state = '%'; 554: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 55b: e9 24 01 00 00 jmp 684 <printf+0x173> } else { putc(fd, c); 560: 8b 45 e4 mov -0x1c(%ebp),%eax 563: 0f be c0 movsbl %al,%eax 566: 83 ec 08 sub $0x8,%esp 569: 50 push %eax 56a: ff 75 08 pushl 0x8(%ebp) 56d: e8 cd fe ff ff call 43f <putc> 572: 83 c4 10 add $0x10,%esp 575: e9 0a 01 00 00 jmp 684 <printf+0x173> } } else if(state == '%'){ 57a: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 57e: 0f 85 00 01 00 00 jne 684 <printf+0x173> if(c == 'd'){ 584: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 588: 75 1e jne 5a8 <printf+0x97> printint(fd, *ap, 10, 1); 58a: 8b 45 e8 mov -0x18(%ebp),%eax 58d: 8b 00 mov (%eax),%eax 58f: 6a 01 push $0x1 591: 6a 0a push $0xa 593: 50 push %eax 594: ff 75 08 pushl 0x8(%ebp) 597: e8 c5 fe ff ff call 461 <printint> 59c: 83 c4 10 add $0x10,%esp ap++; 59f: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5a3: e9 d5 00 00 00 jmp 67d <printf+0x16c> } else if(c == 'x' || c == 'p'){ 5a8: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 5ac: 74 06 je 5b4 <printf+0xa3> 5ae: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 5b2: 75 1e jne 5d2 <printf+0xc1> printint(fd, *ap, 16, 0); 5b4: 8b 45 e8 mov -0x18(%ebp),%eax 5b7: 8b 00 mov (%eax),%eax 5b9: 6a 00 push $0x0 5bb: 6a 10 push $0x10 5bd: 50 push %eax 5be: ff 75 08 pushl 0x8(%ebp) 5c1: e8 9b fe ff ff call 461 <printint> 5c6: 83 c4 10 add $0x10,%esp ap++; 5c9: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5cd: e9 ab 00 00 00 jmp 67d <printf+0x16c> } else if(c == 's'){ 5d2: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 5d6: 75 40 jne 618 <printf+0x107> s = (char*)*ap; 5d8: 8b 45 e8 mov -0x18(%ebp),%eax 5db: 8b 00 mov (%eax),%eax 5dd: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 5e0: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 5e4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 5e8: 75 07 jne 5f1 <printf+0xe0> s = "(null)"; 5ea: c7 45 f4 ea 08 00 00 movl $0x8ea,-0xc(%ebp) while(*s != 0){ 5f1: eb 1a jmp 60d <printf+0xfc> putc(fd, *s); 5f3: 8b 45 f4 mov -0xc(%ebp),%eax 5f6: 8a 00 mov (%eax),%al 5f8: 0f be c0 movsbl %al,%eax 5fb: 83 ec 08 sub $0x8,%esp 5fe: 50 push %eax 5ff: ff 75 08 pushl 0x8(%ebp) 602: e8 38 fe ff ff call 43f <putc> 607: 83 c4 10 add $0x10,%esp s++; 60a: ff 45 f4 incl -0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 60d: 8b 45 f4 mov -0xc(%ebp),%eax 610: 8a 00 mov (%eax),%al 612: 84 c0 test %al,%al 614: 75 dd jne 5f3 <printf+0xe2> 616: eb 65 jmp 67d <printf+0x16c> putc(fd, *s); s++; } } else if(c == 'c'){ 618: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 61c: 75 1d jne 63b <printf+0x12a> putc(fd, *ap); 61e: 8b 45 e8 mov -0x18(%ebp),%eax 621: 8b 00 mov (%eax),%eax 623: 0f be c0 movsbl %al,%eax 626: 83 ec 08 sub $0x8,%esp 629: 50 push %eax 62a: ff 75 08 pushl 0x8(%ebp) 62d: e8 0d fe ff ff call 43f <putc> 632: 83 c4 10 add $0x10,%esp ap++; 635: 83 45 e8 04 addl $0x4,-0x18(%ebp) 639: eb 42 jmp 67d <printf+0x16c> } else if(c == '%'){ 63b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 63f: 75 17 jne 658 <printf+0x147> putc(fd, c); 641: 8b 45 e4 mov -0x1c(%ebp),%eax 644: 0f be c0 movsbl %al,%eax 647: 83 ec 08 sub $0x8,%esp 64a: 50 push %eax 64b: ff 75 08 pushl 0x8(%ebp) 64e: e8 ec fd ff ff call 43f <putc> 653: 83 c4 10 add $0x10,%esp 656: eb 25 jmp 67d <printf+0x16c> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 658: 83 ec 08 sub $0x8,%esp 65b: 6a 25 push $0x25 65d: ff 75 08 pushl 0x8(%ebp) 660: e8 da fd ff ff call 43f <putc> 665: 83 c4 10 add $0x10,%esp putc(fd, c); 668: 8b 45 e4 mov -0x1c(%ebp),%eax 66b: 0f be c0 movsbl %al,%eax 66e: 83 ec 08 sub $0x8,%esp 671: 50 push %eax 672: ff 75 08 pushl 0x8(%ebp) 675: e8 c5 fd ff ff call 43f <putc> 67a: 83 c4 10 add $0x10,%esp } state = 0; 67d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 684: ff 45 f0 incl -0x10(%ebp) 687: 8b 55 0c mov 0xc(%ebp),%edx 68a: 8b 45 f0 mov -0x10(%ebp),%eax 68d: 01 d0 add %edx,%eax 68f: 8a 00 mov (%eax),%al 691: 84 c0 test %al,%al 693: 0f 85 9a fe ff ff jne 533 <printf+0x22> putc(fd, c); } state = 0; } } } 699: c9 leave 69a: c3 ret 0000069b <free>: static Header base; static Header *freep; void free(void *ap) { 69b: 55 push %ebp 69c: 89 e5 mov %esp,%ebp 69e: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 6a1: 8b 45 08 mov 0x8(%ebp),%eax 6a4: 83 e8 08 sub $0x8,%eax 6a7: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6aa: a1 64 0b 00 00 mov 0xb64,%eax 6af: 89 45 fc mov %eax,-0x4(%ebp) 6b2: eb 24 jmp 6d8 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6b4: 8b 45 fc mov -0x4(%ebp),%eax 6b7: 8b 00 mov (%eax),%eax 6b9: 3b 45 fc cmp -0x4(%ebp),%eax 6bc: 77 12 ja 6d0 <free+0x35> 6be: 8b 45 f8 mov -0x8(%ebp),%eax 6c1: 3b 45 fc cmp -0x4(%ebp),%eax 6c4: 77 24 ja 6ea <free+0x4f> 6c6: 8b 45 fc mov -0x4(%ebp),%eax 6c9: 8b 00 mov (%eax),%eax 6cb: 3b 45 f8 cmp -0x8(%ebp),%eax 6ce: 77 1a ja 6ea <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6d0: 8b 45 fc mov -0x4(%ebp),%eax 6d3: 8b 00 mov (%eax),%eax 6d5: 89 45 fc mov %eax,-0x4(%ebp) 6d8: 8b 45 f8 mov -0x8(%ebp),%eax 6db: 3b 45 fc cmp -0x4(%ebp),%eax 6de: 76 d4 jbe 6b4 <free+0x19> 6e0: 8b 45 fc mov -0x4(%ebp),%eax 6e3: 8b 00 mov (%eax),%eax 6e5: 3b 45 f8 cmp -0x8(%ebp),%eax 6e8: 76 ca jbe 6b4 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 6ea: 8b 45 f8 mov -0x8(%ebp),%eax 6ed: 8b 40 04 mov 0x4(%eax),%eax 6f0: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 6f7: 8b 45 f8 mov -0x8(%ebp),%eax 6fa: 01 c2 add %eax,%edx 6fc: 8b 45 fc mov -0x4(%ebp),%eax 6ff: 8b 00 mov (%eax),%eax 701: 39 c2 cmp %eax,%edx 703: 75 24 jne 729 <free+0x8e> bp->s.size += p->s.ptr->s.size; 705: 8b 45 f8 mov -0x8(%ebp),%eax 708: 8b 50 04 mov 0x4(%eax),%edx 70b: 8b 45 fc mov -0x4(%ebp),%eax 70e: 8b 00 mov (%eax),%eax 710: 8b 40 04 mov 0x4(%eax),%eax 713: 01 c2 add %eax,%edx 715: 8b 45 f8 mov -0x8(%ebp),%eax 718: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 71b: 8b 45 fc mov -0x4(%ebp),%eax 71e: 8b 00 mov (%eax),%eax 720: 8b 10 mov (%eax),%edx 722: 8b 45 f8 mov -0x8(%ebp),%eax 725: 89 10 mov %edx,(%eax) 727: eb 0a jmp 733 <free+0x98> } else bp->s.ptr = p->s.ptr; 729: 8b 45 fc mov -0x4(%ebp),%eax 72c: 8b 10 mov (%eax),%edx 72e: 8b 45 f8 mov -0x8(%ebp),%eax 731: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 733: 8b 45 fc mov -0x4(%ebp),%eax 736: 8b 40 04 mov 0x4(%eax),%eax 739: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 740: 8b 45 fc mov -0x4(%ebp),%eax 743: 01 d0 add %edx,%eax 745: 3b 45 f8 cmp -0x8(%ebp),%eax 748: 75 20 jne 76a <free+0xcf> p->s.size += bp->s.size; 74a: 8b 45 fc mov -0x4(%ebp),%eax 74d: 8b 50 04 mov 0x4(%eax),%edx 750: 8b 45 f8 mov -0x8(%ebp),%eax 753: 8b 40 04 mov 0x4(%eax),%eax 756: 01 c2 add %eax,%edx 758: 8b 45 fc mov -0x4(%ebp),%eax 75b: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 75e: 8b 45 f8 mov -0x8(%ebp),%eax 761: 8b 10 mov (%eax),%edx 763: 8b 45 fc mov -0x4(%ebp),%eax 766: 89 10 mov %edx,(%eax) 768: eb 08 jmp 772 <free+0xd7> } else p->s.ptr = bp; 76a: 8b 45 fc mov -0x4(%ebp),%eax 76d: 8b 55 f8 mov -0x8(%ebp),%edx 770: 89 10 mov %edx,(%eax) freep = p; 772: 8b 45 fc mov -0x4(%ebp),%eax 775: a3 64 0b 00 00 mov %eax,0xb64 } 77a: c9 leave 77b: c3 ret 0000077c <morecore>: static Header* morecore(uint nu) { 77c: 55 push %ebp 77d: 89 e5 mov %esp,%ebp 77f: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 782: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 789: 77 07 ja 792 <morecore+0x16> nu = 4096; 78b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 792: 8b 45 08 mov 0x8(%ebp),%eax 795: c1 e0 03 shl $0x3,%eax 798: 83 ec 0c sub $0xc,%esp 79b: 50 push %eax 79c: e8 76 fc ff ff call 417 <sbrk> 7a1: 83 c4 10 add $0x10,%esp 7a4: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 7a7: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 7ab: 75 07 jne 7b4 <morecore+0x38> return 0; 7ad: b8 00 00 00 00 mov $0x0,%eax 7b2: eb 26 jmp 7da <morecore+0x5e> hp = (Header*)p; 7b4: 8b 45 f4 mov -0xc(%ebp),%eax 7b7: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 7ba: 8b 45 f0 mov -0x10(%ebp),%eax 7bd: 8b 55 08 mov 0x8(%ebp),%edx 7c0: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 7c3: 8b 45 f0 mov -0x10(%ebp),%eax 7c6: 83 c0 08 add $0x8,%eax 7c9: 83 ec 0c sub $0xc,%esp 7cc: 50 push %eax 7cd: e8 c9 fe ff ff call 69b <free> 7d2: 83 c4 10 add $0x10,%esp return freep; 7d5: a1 64 0b 00 00 mov 0xb64,%eax } 7da: c9 leave 7db: c3 ret 000007dc <malloc>: void* malloc(uint nbytes) { 7dc: 55 push %ebp 7dd: 89 e5 mov %esp,%ebp 7df: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7e2: 8b 45 08 mov 0x8(%ebp),%eax 7e5: 83 c0 07 add $0x7,%eax 7e8: c1 e8 03 shr $0x3,%eax 7eb: 40 inc %eax 7ec: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 7ef: a1 64 0b 00 00 mov 0xb64,%eax 7f4: 89 45 f0 mov %eax,-0x10(%ebp) 7f7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 7fb: 75 23 jne 820 <malloc+0x44> base.s.ptr = freep = prevp = &base; 7fd: c7 45 f0 5c 0b 00 00 movl $0xb5c,-0x10(%ebp) 804: 8b 45 f0 mov -0x10(%ebp),%eax 807: a3 64 0b 00 00 mov %eax,0xb64 80c: a1 64 0b 00 00 mov 0xb64,%eax 811: a3 5c 0b 00 00 mov %eax,0xb5c base.s.size = 0; 816: c7 05 60 0b 00 00 00 movl $0x0,0xb60 81d: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 820: 8b 45 f0 mov -0x10(%ebp),%eax 823: 8b 00 mov (%eax),%eax 825: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 828: 8b 45 f4 mov -0xc(%ebp),%eax 82b: 8b 40 04 mov 0x4(%eax),%eax 82e: 3b 45 ec cmp -0x14(%ebp),%eax 831: 72 4d jb 880 <malloc+0xa4> if(p->s.size == nunits) 833: 8b 45 f4 mov -0xc(%ebp),%eax 836: 8b 40 04 mov 0x4(%eax),%eax 839: 3b 45 ec cmp -0x14(%ebp),%eax 83c: 75 0c jne 84a <malloc+0x6e> prevp->s.ptr = p->s.ptr; 83e: 8b 45 f4 mov -0xc(%ebp),%eax 841: 8b 10 mov (%eax),%edx 843: 8b 45 f0 mov -0x10(%ebp),%eax 846: 89 10 mov %edx,(%eax) 848: eb 26 jmp 870 <malloc+0x94> else { p->s.size -= nunits; 84a: 8b 45 f4 mov -0xc(%ebp),%eax 84d: 8b 40 04 mov 0x4(%eax),%eax 850: 2b 45 ec sub -0x14(%ebp),%eax 853: 89 c2 mov %eax,%edx 855: 8b 45 f4 mov -0xc(%ebp),%eax 858: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 85b: 8b 45 f4 mov -0xc(%ebp),%eax 85e: 8b 40 04 mov 0x4(%eax),%eax 861: c1 e0 03 shl $0x3,%eax 864: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 867: 8b 45 f4 mov -0xc(%ebp),%eax 86a: 8b 55 ec mov -0x14(%ebp),%edx 86d: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 870: 8b 45 f0 mov -0x10(%ebp),%eax 873: a3 64 0b 00 00 mov %eax,0xb64 return (void*)(p + 1); 878: 8b 45 f4 mov -0xc(%ebp),%eax 87b: 83 c0 08 add $0x8,%eax 87e: eb 3b jmp 8bb <malloc+0xdf> } if(p == freep) 880: a1 64 0b 00 00 mov 0xb64,%eax 885: 39 45 f4 cmp %eax,-0xc(%ebp) 888: 75 1e jne 8a8 <malloc+0xcc> if((p = morecore(nunits)) == 0) 88a: 83 ec 0c sub $0xc,%esp 88d: ff 75 ec pushl -0x14(%ebp) 890: e8 e7 fe ff ff call 77c <morecore> 895: 83 c4 10 add $0x10,%esp 898: 89 45 f4 mov %eax,-0xc(%ebp) 89b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 89f: 75 07 jne 8a8 <malloc+0xcc> return 0; 8a1: b8 00 00 00 00 mov $0x0,%eax 8a6: eb 13 jmp 8bb <malloc+0xdf> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8a8: 8b 45 f4 mov -0xc(%ebp),%eax 8ab: 89 45 f0 mov %eax,-0x10(%ebp) 8ae: 8b 45 f4 mov -0xc(%ebp),%eax 8b1: 8b 00 mov (%eax),%eax 8b3: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 8b6: e9 6d ff ff ff jmp 828 <malloc+0x4c> } 8bb: c9 leave 8bc: c3 ret
34.307575
60
0.421632
63c9b8aaeed8e5722fa3125b13b9a745bc3e829b
13,595
asm
Assembly
Library/Cards/cardsMain.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Cards/cardsMain.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Cards/cardsMain.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: Card Library FILE: cardMain.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Jon 9/90 Initial Version DESCRIPTION: RCS STAMP: $Id: cardsMain.asm,v 1.1 97/04/04 17:44:29 newdeal Exp $ ------------------------------------------------------------------------------@ ;------------------------------------------------------------------------------ ; Common GEODE stuff ;------------------------------------------------------------------------------ _Library = 1 ;Standard include files include geos.def include geode.def include ec.def include myMacros.def include library.def include geode.def ;------------------------------------------------------------------------------ ; FULL_EXECUTE_IN_PLACE : Indicates that the cards lib is going to ; be used in a system where all geodes (or most, at any rate) ; are to be executed out of ROM. ;------------------------------------------------------------------------------ ifndef FULL_EXECUTE_IN_PLACE FULL_EXECUTE_IN_PLACE equ FALSE endif ;------------------------------------------------------------------------------ ; The .GP file only understands defined/not defined; ; it can not deal with expression evaluation. ; Thus, for the TRUE/FALSE conditionals, we define ; GP symbols that _only_ get defined when the ; condition is true. ;----------------------------------------------------------------------------- if FULL_EXECUTE_IN_PLACE GP_FULL_EXECUTE_IN_PLACE equ TRUE endif if FULL_EXECUTE_IN_PLACE include Internal/xip.def endif include resource.def include object.def include graphics.def include gstring.def include Objects/winC.def include heap.def include lmem.def include timer.def include timedate.def include system.def include file.def include fileEnum.def include vm.def include hugearr.def include Objects/inputC.def include myMacros.def include deckMap.def include chunkarr.def include initfile.def ;------------------------------------------------------------------------------ ; Libraries used ;------------------------------------------------------------------------------ UseLib ui.def UseLib Objects/vTextC.def DefLib cards.def CardBackDynamicListClass class GenDynamicListClass CardBackDynamicListClass endc include cards.rdef CardsCodeResource segment resource include game.asm include card.asm include deck.asm include hand.asm include uiCardBackSelector.asm udata segment vmFileHandle hptr udata ends if FULL_EXECUTE_IN_PLACE and ERROR_CHECK NOT_DGROUP enum FatalErrors endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Entry procedure for the cards library. Since we don't need to do anything special for our clients, we just clear the carry to indicate our happiness. CALLED BY: Kernel PASS: di = LibraryCallType LCT_ATTACH = library just loaded LCT_NEW_CLIENT = client of the library just loaded LCT_CLIENT_EXIT = client of the library is going away LCT_DETACH = library is about to be unloaded cx = handle of client geode, if LCT_NEW_CLIENT or LCT_CLIENT_EXIT RETURN: carry set on error DESTROYED: Nothing PSEUDO CODE/STRATEGY: ; KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/20/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ global CardsEntry:far ; so Esp won't whine CardsEntry proc far FXIP < mov_tr ax, bx ; save value of bx > FXIP < mov bx, handle dgroup > FXIP < call MemDerefDS ; ds = dgroup > FXIP < mov_tr bx, ax ; restore bx > NOFXIP< segmov ds, dgroup, ax > cmp di, LCT_ATTACH ; attaching??? je attach cmp di, LCT_DETACH ; detaching??? je detach ;default: clc jmp endCardsEntry attach: ; ; The library is trying to attach, so we call CardsAttach ; call CardsAttach jmp endCardsEntry detach: ; ; The library is trying to detach, so we call CardsDetach ; call CardsDetach endCardsEntry: ret CardsEntry endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsAttach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Called by entry routine on attaching. Opens up the card deck vm file and checks its protocol CALLED BY: PASS: ds = dgroup CHANGES: RETURN: carry clear if everything went ok carry set on error DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsAttach proc near ; ; Open the VM file containing the card bitmaps ; call FilePushDir call CardsFindVMFile jc fileError call CardsCheckProtocol jc protocolError ;Give the ownership of this mov ax, handle 0 ;file to the library. This call HandleModifyOwner ;makes sure that the file will ;stay open until we close it. if FULL_EXECUTE_IN_PLACE and ERROR_CHECK ; ; make sure ds is dgroup ; push ax, bx, ds mov ax, ds ; ax = dgroup (supposed) mov bx, handle dgroup call MemDerefDS ; ds = dgroup mov bx, ds ; bx = dgroup cmp ax, bx ERROR_NE NOT_DGROUP pop ax, bx, ds endif mov ds:vmFileHandle, bx clc jmp endCardsAttach fileError: mov bx, handle vmErrorText mov si, offset vmErrorText jmp bitchAtUser protocolError: mov al, FILE_NO_ERRORS call VMClose mov bx, handle badProtocolText mov si, offset badProtocolText bitchAtUser: if 0 ; Don't do this anymore, this causes threadlock when UI's ; launching and only has two threads! -dhunter 2/11/2000 SBCS< sub sp, DOS_STD_PATH_LENGTH > DBCS< sub sp, DOS_STD_PATH_LENGTH*(size wchar) > mov di, sp segmov es, ss call CardsGetDeckDir sub sp, FILE_LONGNAME_BUFFER_SIZE mov_tr cx, di ;es:cx <- path mov di, sp call CardsGetDeckName ;es:di <- filename sub sp, (size StandardDialogParams) mov bp, sp ;ss:di <- params mov ss:[bp].SDP_customFlags, mask CDBF_SYSTEM_MODAL or \ (CDT_ERROR shl offset CDBF_DIALOG_TYPE) or \ (GIT_NOTIFICATION shl offset CDBF_INTERACTION_TYPE) call MemLock mov ds, ax mov ax, ds:[si] ;ds:si <- error string movdw ss:[bp].SDP_customString, dsax movdw ss:[bp].SDP_stringArg1, escx movdw ss:[bp].SDP_stringArg2, esdi clr ss:[bp].SDP_helpContext.segment call UserStandardDialog ; ; UserStandardDialog pops the StandardDialogParams off ; the stack. Why? I don't know. ; SBCS< add sp, DOS_STD_PATH_LENGTH + FILE_LONGNAME_BUFFER_SIZE > DBCS< add sp, DOS_STD_PATH_LENGTH*(size wchar) + FILE_LONGNAME_BUFFER_SIZE > call MemUnlock endif stc ;return failure endCardsAttach: call FilePopDir ret CardsAttach endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsFindVMFile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Pass: nothing Return: carry set on error else bx = VM file Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Nov 18, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsFindVMFile proc near uses ax, cx, dx, bp, di, si, es, ds .enter SBCS< mov bp, DOS_STD_PATH_LENGTH > DBCS< mov bp, DOS_STD_PATH_LENGTH*(size wchar) ; attr from .ini file > sub sp, bp mov di, sp segmov es, ss call CardsGetDeckDir segmov ds, es mov dx, di mov bx, SP_PUBLIC_DATA call FileSetCurrentPath SBCS< add sp, DOS_STD_PATH_LENGTH > DBCS< add sp, DOS_STD_PATH_LENGTH*(size wchar) > mov bp, FILE_LONGNAME_BUFFER_SIZE sub sp, bp mov di, sp call CardsGetDeckName segmov ds, es mov dx, di mov ax, (VMO_OPEN shl 8) or mask VMAF_FORCE_READ_ONLY or mask VMAF_FORCE_DENY_WRITE clr cx ; Use standard compaction threshhold call VMOpen ; Go ahead, open it! lahf add sp, FILE_LONGNAME_BUFFER_SIZE sahf .leave ret CardsFindVMFile endp cardsCategoryString char "cards",0 cardsDeckDirKey char "deckdir",0 cardsDeckNameKey char "deckfile",0 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsGetDeckDir %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Get the sub directory of SP_PUBLIC_DATA that presumably contains the card bitmap file. Pass: es:di - empty buffer bp - InitFileReadFlags Return: es:di - null terminated string Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Nov 18, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsGetDeckDir proc near uses ax, bx, cx, dx, di, si, ds .enter mov cx, cs segmov ds, cx mov si, offset cardsCategoryString mov dx, offset cardsDeckDirKey call InitFileReadString jc useDefaultDir done: .leave ret useDefaultDir: ; ; We want to fill the buffer at es:di with the default directory ; mov bx, handle cardsDefaultDeckDir call MemLock mov ds, ax mov si, offset cardsDefaultDeckDir mov si, ds:[si] ;copyDirLoop: LocalCopyString call MemUnlock jmp done CardsGetDeckDir endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsGetDeckName %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Get the longname of the cards bitmap file containing the card bitmap file. Pass: es:di - empty buffer bp - InitFileReadFlags Return: es:di - null terminated string Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Nov 18, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsGetDeckName proc near uses ax, bx, cx, dx, di, si, ds .enter mov cx, cs mov ds, cx mov si, offset cardsCategoryString mov dx, offset cardsDeckNameKey call InitFileReadString jc useDefaultName done: .leave ret useDefaultName: ; ; We want to fill the buffer at es:di with the default name ; mov bx, handle cardsDefaultDeckName call MemLock mov ds, ax mov si, offset cardsDefaultDeckName mov si, ds:[si] ;copyNameLoop: LocalCopyString call MemUnlock jmp done CardsGetDeckName endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsDetach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Called when the cards library detaches from he system. Closes the card bitmap VM file. CALLED BY: PASS: ds = dgroup CHANGES: RETURN: ax, bx DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version clee 6/30/94 add XIP EC code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsDetach proc near if FULL_EXECUTE_IN_PLACE and ERROR_CHECK ; ; make sure ds is dgroup ; push ax, bx, ds mov ax, ds ; ax = dgroup (supposed) mov bx, handle dgroup call MemDerefDS ; ds = dgroup mov bx, ds ; bx = dgroup cmp ax, bx ERROR_NE NOT_DGROUP pop ax, bx, ds endif mov bx, ds:vmFileHandle mov al, FILE_NO_ERRORS call VMClose ret CardsDetach endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CardsCheckProtocol %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if the deck vm file and the cards library have the same protocol numbers CALLED BY: CardsAttach PASS: bx = VM file handle RETURN: carry set if protocol mismatch DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 10/23/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CardsCheckProtocol proc near uses ax, ds, dx .enter ; ; Let's get the protocol of this thing and compare it to the ; values from our last compile ; mov cx, size ProtocolNumber sub sp, cx mov di, sp segmov es, ss mov ax, FEA_PROTOCOL call FileGetHandleExtAttributes jc clearStack ; Check major protocol number (the library and the vm file must ; have the same major protocol number to work properly). cmp es:[di].PN_major, DECK_PROTO_MAJOR jne noDice ; ; Check minor protocol number (the vm file's minor protocol must be ; less than or equal to the deck's minor protocol number). ; cmp es:[di].PN_minor, DECK_PROTO_MINOR ja noDice clc ;OK! clearStack: lahf add sp, size ProtocolNumber sahf .leave ret noDice: stc jmp clearStack CardsCheckProtocol endp CardsCodeResource ends
22.250409
85
0.570651
d273d75b7305a5f44597f0934e07439dd079ed2c
267
asm
Assembly
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_insert_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; size_t w_vector_insert_callee(w_vector_t *v, size_t idx, void *item) SECTION code_adt_w_vector PUBLIC _w_vector_insert_callee _w_vector_insert_callee: pop af pop hl pop bc pop de push af INCLUDE "adt/w_vector/z80/asm_w_vector_insert.asm"
15.705882
70
0.752809
e145ab687e7cb4984a05dd67478718ce620fa7e6
6,559
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1903.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1903.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1903.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x17b0, %r14 nop nop nop sub $63382, %r9 movl $0x61626364, (%r14) nop nop xor $17217, %rsi lea addresses_UC_ht+0x65f0, %r11 and %r14, %r14 movb (%r11), %cl nop nop sub %rsi, %rsi lea addresses_A_ht+0x14eb0, %rsi lea addresses_A_ht+0x6350, %rdi nop nop nop nop xor $34166, %r10 mov $38, %rcx rep movsb cmp $39376, %rcx lea addresses_UC_ht+0x132b0, %rsi lea addresses_WT_ht+0x106b0, %rdi clflush (%rdi) nop nop nop cmp $51598, %r11 mov $40, %rcx rep movsb nop nop nop add $3661, %r11 lea addresses_UC_ht+0x78be, %rsi lea addresses_WT_ht+0x19570, %rdi nop nop nop nop cmp %r11, %r11 mov $58, %rcx rep movsq nop nop nop sub %r9, %r9 lea addresses_UC_ht+0xe758, %rdi nop nop nop and %rcx, %rcx mov (%rdi), %r11w nop cmp $13915, %rdi lea addresses_normal_ht+0x5a70, %rsi lea addresses_A_ht+0x13470, %rdi nop inc %rbp mov $2, %rcx rep movsl nop nop cmp $37936, %rcx lea addresses_normal_ht+0x16450, %rbp xor $59904, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm6 movups %xmm6, (%rbp) nop add $15270, %r11 lea addresses_WC_ht+0x18e2, %rsi lea addresses_A_ht+0x180f2, %rdi nop nop nop and %rbp, %rbp mov $25, %rcx rep movsw inc %rdi lea addresses_WC_ht+0x133f0, %rsi lea addresses_WT_ht+0x15f0, %rdi nop nop nop xor %r11, %r11 mov $36, %rcx rep movsl nop nop nop nop dec %r11 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r9 push %rax push %rbp // Faulty Load mov $0x251b350000000ab0, %r15 nop nop nop nop nop and %rax, %rax mov (%r15), %r12 lea oracles, %r9 and $0xff, %r12 shlq $12, %r12 mov (%r9,%r12,1), %r12 pop %rbp pop %rax pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
38.582353
2,999
0.661076
dd2fe21840d87c26d88d7e1aedae29366c64c596
1,929
asm
Assembly
PRG/levels/Giant/4-1.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Giant/4-1.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Giant/4-1.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
; Original address was $AB88 ; 4-1 .word W401_BonusL ; Alternate level layout .word W401_BonusO ; Alternate object layout .byte LEVEL1_SIZE_08 | LEVEL1_YSTART_170 .byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18 | LEVEL2_UNUSEDFLAG .byte LEVEL3_TILESET_11 | LEVEL3_VSCROLL_LOCKLOW | LEVEL3_PIPENOTEXIT .byte LEVEL4_BGBANK_INDEX(11) | LEVEL4_INITACT_NOTHING .byte LEVEL5_BGM_OVERWORLD | LEVEL5_TIME_300 .byte $19, $00, $7F, $15, $03, $05, $11, $08, $10, $16, $07, $82, $16, $0C, $82, $03 .byte $0E, $50, $05, $0E, $50, $07, $0E, $50, $29, $0F, $40, $43, $10, $85, $1B, $43 .byte $2C, $83, $01, $43, $2E, $81, $0B, $43, $3A, $83, $09, $27, $12, $91, $09, $10 .byte $5D, $15, $1E, $40, $13, $14, $30, $15, $12, $05, $17, $18, $20, $19, $1F, $70 .byte $17, $1E, $20, $17, $1A, $50, $35, $21, $82, $11, $24, $10, $19, $23, $7F, $12 .byte $2B, $05, $27, $26, $A1, $07, $2C, $50, $05, $2E, $50, $37, $23, $A1, $27, $2E .byte $40, $29, $2C, $40, $2A, $34, $10, $11, $3E, $20, $16, $38, $05, $36, $3B, $10 .byte $37, $3B, $10, $38, $3B, $10, $45, $32, $67, $03, $51, $32, $64, $03, $25, $30 .byte $41, $25, $36, $41, $05, $38, $50, $07, $38, $55, $27, $3A, $A1, $29, $3A, $41 .byte $36, $32, $A2, $36, $34, $A2, $2D, $32, $A1, $2D, $34, $A1, $2F, $32, $D1, $2F .byte $34, $D1, $16, $4F, $82, $14, $40, $05, $19, $42, $77, $35, $42, $30, $11, $42 .byte $40, $03, $44, $50, $05, $44, $50, $23, $48, $41, $0F, $48, $20, $11, $48, $20 .byte $15, $48, $20, $17, $48, $20, $35, $5E, $82, $11, $4C, $10, $27, $44, $40, $14 .byte $54, $10, $15, $58, $11, $17, $5E, $21, $13, $6A, $87, $15, $64, $30, $19, $72 .byte $76, $15, $72, $83, $16, $78, $05, $11, $78, $10, $77, $7C, $61, $20, $7E, $41 .byte $01, $7E, $50, $03, $7E, $50, $05, $7E, $50, $07, $7E, $50, $09, $7E, $50, $0B .byte $7E, $50, $0D, $7E, $50, $0F, $7E, $50, $11, $7E, $50, $13, $7E, $50, $15, $7E .byte $50, $17, $7E, $50, $E1, $42, $70, $FF
66.517241
85
0.50648
c7d84f26780c5920d173bd1026ba8662c5770ec2
1,342
asm
Assembly
source/floatingpoint/compare.asm
paulscottrobson/6502-basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
3
2021-09-30T19:34:11.000Z
2021-10-31T06:55:50.000Z
source/floatingpoint/compare.asm
paulscottrobson/6502-Basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
null
null
null
source/floatingpoint/compare.asm
paulscottrobson/6502-Basic
d4c360041bfa49427a506465e58bb0ef94beaa44
[ "MIT" ]
1
2021-12-07T21:58:44.000Z
2021-12-07T21:58:44.000Z
; ************************************************************************************************ ; ************************************************************************************************ ; ; Name: compare.asm ; Purpose: Comparison for floats ; Created: 22nd February 2021 ; Author: Paul Robson (paul@robsons.org.uk) ; ; ************************************************************************************************ ; ************************************************************************************************ .section code ; ************************************************************************************************ ; ; Compare two floats TOS, return $FF,$00,$01 in X, SP to/from in A ; (non destructive of values) ; ; ************************************************************************************************ FLTCompare: ;; <fCompare> debug jmp FLTCompare .send code ; ************************************************************************************************ ; ; Changes and Updates ; ; ************************************************************************************************ ; ; Date Notes ; ==== ===== ; 07-Mar-21 Pre code read v0.01 ; ; ************************************************************************************************
35.315789
98
0.197466
6e9461eeb55f5c79458490c0368079b6c5e75339
330
asm
Assembly
programs/oeis/343/A343859.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/343/A343859.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/343/A343859.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A343859: Partial sums of the primes excluding 3. ; 2,7,14,25,38,55,74,97,126,157,194,235,278,325,378,437,498,565,636,709,788,871,960,1057,1158,1261,1368,1477,1590,1717,1848,1985,2124,2273,2424,2581,2744,2911,3084,3263,3444,3635,3828,4025,4224,4435,4658,4885,5114,5347 add $0,2 seq $0,7504 ; Sum of the first n primes. sub $0,3
47.142857
218
0.739394
0b2b27ef4faab4eb422d7c0d053b3e8a4b2504a1
669
asm
Assembly
programs/oeis/038/A038189.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/038/A038189.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/038/A038189.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A038189: Bit to left of least significant 1-bit in binary expansion of n. ; 0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0 lpb $0,1 add $0,2 mov $1,$0 add $1,1 div $1,2 gcd $0,$1 sub $0,1 lpe mod $1,2
51.461538
501
0.524664
dcfbb78a63199177268276d36fbb9f63f605b1b0
128
asm
Assembly
samples/bcd_daa.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
samples/bcd_daa.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
samples/bcd_daa.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
LDA f100 MOV B, A LDA f200 ADD B DAA STA f300 MVI A, 00 JNC NCY // if CY == 0 then jump to NCY MVI A, 01 NCY: STA f301 HLT
7.529412
38
0.640625
bc69556fc0484090afe7f89366a41c8e8e8862b2
826
asm
Assembly
sk/sfx/41.asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
9
2017-10-09T20:28:45.000Z
2021-06-29T21:19:20.000Z
sk/sfx/41.asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
12
2018-08-01T13:52:20.000Z
2022-02-21T02:19:37.000Z
sk/sfx/41.asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
2
2018-02-17T19:50:36.000Z
2019-10-30T19:28:06.000Z
Sound_41_Header: smpsHeaderStartSong 3 smpsHeaderVoice Sound_41_Voices smpsHeaderTempoSFX $01 smpsHeaderChanSFX $01 smpsHeaderSFXChannel cFM5, Sound_3E_3F_40_41_FM5, $0A, $00 Sound_41_Voices: ; Voice $00 ; $36 ; $07, $10, $0E, $0C, $1F, $1F, $1F, $1F, $00, $00, $00, $00 ; $00, $0D, $0D, $0E, $0F, $0F, $0F, $0F, $17, $80, $80, $80 smpsVcAlgorithm $06 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $01, $00 smpsVcCoarseFreq $0C, $0E, $00, $07 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $00, $00, $00, $00 smpsVcDecayRate2 $0E, $0D, $0D, $00 smpsVcDecayLevel $00, $00, $00, $00 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $00, $00, $17
29.5
62
0.615012
bcb51033d5a81dcdfe88c9d99b640ae6848fccfb
324
asm
Assembly
programs/oeis/140/A140788.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/140/A140788.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/140/A140788.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A140788: a(n) = 6*4^n + 2. ; 8,26,98,386,1538,6146,24578,98306,393218,1572866,6291458,25165826,100663298,402653186,1610612738,6442450946,25769803778,103079215106,412316860418,1649267441666,6597069766658,26388279066626,105553116266498,422212465065986,1688849860263938,6755399441055746 mov $1,4 pow $1,$0 mul $1,6 add $1,2
40.5
256
0.808642
37d2152904ff28d4fd5981ecccae2149ed1d7a7f
7,166
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_1863.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_1863.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_1863.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x1f7f, %rcx nop nop nop nop nop dec %r15 mov $0x6162636465666768, %rdi movq %rdi, (%rcx) nop nop xor %rcx, %rcx lea addresses_A_ht+0x193c9, %rdi clflush (%rdi) nop nop xor %r13, %r13 movw $0x6162, (%rdi) nop nop nop nop nop cmp $23523, %rdx lea addresses_WC_ht+0x1a77f, %r11 cmp %r12, %r12 mov (%r11), %r15w nop nop nop nop nop dec %rdx lea addresses_UC_ht+0x19b2f, %rdx and %r12, %r12 movb $0x61, (%rdx) nop nop nop and %rcx, %rcx lea addresses_normal_ht+0x65a7, %r15 nop nop nop nop nop sub $26059, %rdi mov $0x6162636465666768, %r13 movq %r13, (%r15) nop nop nop nop add $43780, %r15 lea addresses_WC_ht+0x1af7f, %rdi nop dec %rdx mov (%rdi), %ecx nop sub $49841, %r13 lea addresses_normal_ht+0x10b7f, %r13 nop xor %r12, %r12 and $0xffffffffffffffc0, %r13 movntdqa (%r13), %xmm0 vpextrq $1, %xmm0, %r15 nop nop nop add %rdi, %rdi lea addresses_WT_ht+0x323f, %rdi nop nop nop nop xor $42444, %rdx mov $0x6162636465666768, %r12 movq %r12, %xmm1 movups %xmm1, (%rdi) nop nop cmp %r13, %r13 lea addresses_WC_ht+0x114fd, %rsi lea addresses_A_ht+0x19437, %rdi nop nop nop inc %r12 mov $107, %rcx rep movsw nop add $25999, %r13 lea addresses_UC_ht+0x1dc7f, %rdi nop xor $51599, %r12 movb $0x61, (%rdi) xor $31556, %rcx lea addresses_normal_ht+0x1d7f, %r12 nop nop nop nop nop sub %r11, %r11 movw $0x6162, (%r12) nop nop xor $29082, %rsi lea addresses_A_ht+0x6087, %rsi lea addresses_WC_ht+0xf88f, %rdi mfence mov $101, %rcx rep movsl inc %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %r9 push %rbx push %rdx // Store lea addresses_UC+0x16567, %rdx and %r11, %r11 mov $0x5152535455565758, %r14 movq %r14, %xmm0 movups %xmm0, (%rdx) nop nop nop nop cmp %r11, %r11 // Faulty Load lea addresses_US+0x1577f, %rbx clflush (%rbx) inc %r9 movaps (%rbx), %xmm4 vpextrq $0, %xmm4, %r15 lea oracles, %r11 and $0xff, %r15 shlq $12, %r15 mov (%r11,%r15,1), %r15 pop %rdx pop %rbx pop %r9 pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 3, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'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 */
36.375635
2,999
0.65755
861967b45f5f7fe2a121be39f8a480a67c77606e
7,565
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1092.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1092.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1092.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x18feb, %rsi lea addresses_normal_ht+0xcb4b, %rdi nop nop nop nop xor $5714, %r8 mov $109, %rcx rep movsb nop nop nop nop xor $64146, %rax lea addresses_WC_ht+0x1a233, %rsi lea addresses_D_ht+0x169ab, %rdi clflush (%rdi) cmp %r8, %r8 mov $81, %rcx rep movsl xor $32725, %rdi lea addresses_A_ht+0x1178b, %rsi lea addresses_A_ht+0xd3ab, %rdi clflush (%rdi) nop and $16467, %r15 mov $64, %rcx rep movsb nop nop nop nop add $60844, %rsi lea addresses_WC_ht+0x81b7, %rax clflush (%rax) nop nop xor $22749, %rbx vmovups (%rax), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %rsi nop nop nop add $22393, %r8 lea addresses_A_ht+0x1daff, %rdi nop nop lfence mov (%rdi), %r8w nop nop nop nop nop xor $11648, %r15 lea addresses_WT_ht+0xb91d, %rbx nop nop cmp $54389, %rcx and $0xffffffffffffffc0, %rbx vmovntdqa (%rbx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %rax inc %rax lea addresses_D_ht+0x123b, %r15 nop nop nop nop nop inc %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm7 and $0xffffffffffffffc0, %r15 vmovaps %ymm7, (%r15) nop nop nop cmp %rcx, %rcx lea addresses_WT_ht+0x1022b, %rsi nop nop nop nop sub $50351, %rax mov $0x6162636465666768, %r8 movq %r8, %xmm1 movups %xmm1, (%rsi) nop sub %rbx, %rbx lea addresses_WT_ht+0x1b9ab, %rcx nop nop nop and $23992, %rsi movb (%rcx), %al nop nop nop add %r8, %r8 lea addresses_A_ht+0xfab4, %rsi lea addresses_WC_ht+0xb1ab, %rdi clflush (%rsi) xor %r11, %r11 mov $8, %rcx rep movsw add $44864, %r15 lea addresses_normal_ht+0x10d1b, %rax clflush (%rax) nop nop nop nop nop inc %r11 vmovups (%rax), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %rsi nop nop nop nop nop add %rbx, %rbx lea addresses_A_ht+0x442b, %rbx nop nop dec %rcx movl $0x61626364, (%rbx) nop mfence pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %r9 push %rdx push %rsi // Load lea addresses_WT+0x1b0ab, %rdx nop add $38045, %r15 vmovups (%rdx), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %r14 nop nop nop add $28812, %r9 // Faulty Load lea addresses_normal+0x39ab, %r9 nop nop nop nop sub %r8, %r8 vmovups (%r9), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %r14 lea oracles, %r9 and $0xff, %r14 shlq $12, %r14 mov (%r9,%r14,1), %r14 pop %rsi pop %rdx pop %r9 pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 32, 'NT': True, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 6}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
34.543379
2,999
0.660013
37662eccbb2b81df05160488922b8626676028e5
17,394
asm
Assembly
code/vendor/openssl/asm/crypto/ec/x25519-x86_64.asm
thorium-cfx/fivem
587eb7c12066a2ebf8631bde7bb39ee2df1b5a0c
[ "MIT" ]
5,411
2017-04-14T08:57:56.000Z
2022-03-30T19:35:15.000Z
code/vendor/openssl/asm/crypto/ec/x25519-x86_64.asm
thorium-cfx/fivem
587eb7c12066a2ebf8631bde7bb39ee2df1b5a0c
[ "MIT" ]
802
2017-04-21T14:18:36.000Z
2022-03-31T21:20:48.000Z
code/vendor/openssl/asm/crypto/ec/x25519-x86_64.asm
thorium-cfx/fivem
587eb7c12066a2ebf8631bde7bb39ee2df1b5a0c
[ "MIT" ]
2,011
2017-04-14T09:44:15.000Z
2022-03-31T15:40:39.000Z
OPTION DOTNAME .text$ SEGMENT ALIGN(256) 'CODE' PUBLIC x25519_fe51_mul ALIGN 32 x25519_fe51_mul PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_mul:: mov rdi,rcx mov rsi,rdx mov rdx,r8 push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_mul_body:: mov rax,QWORD PTR[rsi] mov r11,QWORD PTR[rdx] mov r12,QWORD PTR[8+rdx] mov r13,QWORD PTR[16+rdx] mov rbp,QWORD PTR[24+rdx] mov r14,QWORD PTR[32+rdx] mov QWORD PTR[32+rsp],rdi mov rdi,rax mul r11 mov QWORD PTR[rsp],r11 mov rbx,rax mov rax,rdi mov rcx,rdx mul r12 mov QWORD PTR[8+rsp],r12 mov r8,rax mov rax,rdi lea r15,QWORD PTR[r14*8+r14] mov r9,rdx mul r13 mov QWORD PTR[16+rsp],r13 mov r10,rax mov rax,rdi lea rdi,QWORD PTR[r15*2+r14] mov r11,rdx mul rbp mov r12,rax mov rax,QWORD PTR[rsi] mov r13,rdx mul r14 mov r14,rax mov rax,QWORD PTR[8+rsi] mov r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[16+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[24+rsi] adc r9,rdx mul rdi add r10,rax mov rax,QWORD PTR[32+rsi] adc r11,rdx mul rdi imul rdi,rbp,19 add r12,rax mov rax,QWORD PTR[8+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[16+rsp] add r14,rax mov rax,QWORD PTR[16+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[24+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[32+rsi] adc r9,rdx mul rdi imul rdi,rbp,19 add r10,rax mov rax,QWORD PTR[8+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[16+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[8+rsp] add r14,rax mov rax,QWORD PTR[24+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[32+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[8+rsi] adc r9,rdx mul rbp imul rdi,rbp,19 add r10,rax mov rax,QWORD PTR[16+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[24+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[rsp] add r14,rax mov rax,QWORD PTR[32+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[8+rsi] adc rcx,rdx mul rbp add r8,rax mov rax,QWORD PTR[16+rsi] adc r9,rdx mul rbp add r10,rax mov rax,QWORD PTR[24+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[32+rsi] adc r13,rdx mul rbp add r14,rax adc r15,rdx mov rdi,QWORD PTR[32+rsp] jmp $L$reduce51 $L$fe51_mul_epilogue:: $L$SEH_end_x25519_fe51_mul:: x25519_fe51_mul ENDP PUBLIC x25519_fe51_sqr ALIGN 32 x25519_fe51_sqr PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_sqr:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_sqr_body:: mov rax,QWORD PTR[rsi] mov r15,QWORD PTR[16+rsi] mov rbp,QWORD PTR[32+rsi] mov QWORD PTR[32+rsp],rdi lea r14,QWORD PTR[rax*1+rax] mul rax mov rbx,rax mov rax,QWORD PTR[8+rsi] mov rcx,rdx mul r14 mov r8,rax mov rax,r15 mov QWORD PTR[rsp],r15 mov r9,rdx mul r14 mov r10,rax mov rax,QWORD PTR[24+rsi] mov r11,rdx imul rdi,rbp,19 mul r14 mov r12,rax mov rax,rbp mov r13,rdx mul r14 mov r14,rax mov rax,rbp mov r15,rdx mul rdi add r12,rax mov rax,QWORD PTR[8+rsi] adc r13,rdx mov rsi,QWORD PTR[24+rsi] lea rbp,QWORD PTR[rax*1+rax] mul rax add r10,rax mov rax,QWORD PTR[rsp] adc r11,rdx mul rbp add r12,rax mov rax,rbp adc r13,rdx mul rsi add r14,rax mov rax,rbp adc r15,rdx imul rbp,rsi,19 mul rdi add rbx,rax lea rax,QWORD PTR[rsi*1+rsi] adc rcx,rdx mul rdi add r10,rax mov rax,rsi adc r11,rdx mul rbp add r8,rax mov rax,QWORD PTR[rsp] adc r9,rdx lea rsi,QWORD PTR[rax*1+rax] mul rax add r14,rax mov rax,rbp adc r15,rdx mul rsi add rbx,rax mov rax,rsi adc rcx,rdx mul rdi add r8,rax adc r9,rdx mov rdi,QWORD PTR[32+rsp] jmp $L$reduce51 ALIGN 32 $L$reduce51:: mov rbp,07ffffffffffffh mov rdx,r10 shr r10,51 shl r11,13 and rdx,rbp or r11,r10 add r12,r11 adc r13,0 mov rax,rbx shr rbx,51 shl rcx,13 and rax,rbp or rcx,rbx add r8,rcx adc r9,0 mov rbx,r12 shr r12,51 shl r13,13 and rbx,rbp or r13,r12 add r14,r13 adc r15,0 mov rcx,r8 shr r8,51 shl r9,13 and rcx,rbp or r9,r8 add rdx,r9 mov r10,r14 shr r14,51 shl r15,13 and r10,rbp or r15,r14 lea r14,QWORD PTR[r15*8+r15] lea r15,QWORD PTR[r14*2+r15] add rax,r15 mov r8,rdx and rdx,rbp shr r8,51 add rbx,r8 mov r9,rax and rax,rbp shr r9,51 add rcx,r9 mov QWORD PTR[rdi],rax mov QWORD PTR[8+rdi],rcx mov QWORD PTR[16+rdi],rdx mov QWORD PTR[24+rdi],rbx mov QWORD PTR[32+rdi],r10 mov r15,QWORD PTR[40+rsp] mov r14,QWORD PTR[48+rsp] mov r13,QWORD PTR[56+rsp] mov r12,QWORD PTR[64+rsp] mov rbx,QWORD PTR[72+rsp] mov rbp,QWORD PTR[80+rsp] lea rsp,QWORD PTR[88+rsp] $L$fe51_sqr_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe51_sqr:: x25519_fe51_sqr ENDP PUBLIC x25519_fe51_mul121666 ALIGN 32 x25519_fe51_mul121666 PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_mul121666:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_mul121666_body:: mov eax,121666 mul QWORD PTR[rsi] mov rbx,rax mov eax,121666 mov rcx,rdx mul QWORD PTR[8+rsi] mov r8,rax mov eax,121666 mov r9,rdx mul QWORD PTR[16+rsi] mov r10,rax mov eax,121666 mov r11,rdx mul QWORD PTR[24+rsi] mov r12,rax mov eax,121666 mov r13,rdx mul QWORD PTR[32+rsi] mov r14,rax mov r15,rdx jmp $L$reduce51 $L$fe51_mul121666_epilogue:: $L$SEH_end_x25519_fe51_mul121666:: x25519_fe51_mul121666 ENDP EXTERN OPENSSL_ia32cap_P:NEAR PUBLIC x25519_fe64_eligible ALIGN 32 x25519_fe64_eligible PROC PUBLIC mov ecx,DWORD PTR[((OPENSSL_ia32cap_P+8))] xor eax,eax and ecx,080100h cmp ecx,080100h cmove eax,ecx DB 0F3h,0C3h ;repret x25519_fe64_eligible ENDP PUBLIC x25519_fe64_mul ALIGN 32 x25519_fe64_mul PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_mul:: mov rdi,rcx mov rsi,rdx mov rdx,r8 push rbp push rbx push r12 push r13 push r14 push r15 push rdi lea rsp,QWORD PTR[((-16))+rsp] $L$fe64_mul_body:: mov rax,rdx mov rbp,QWORD PTR[rdx] mov rdx,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rax] mov r14,QWORD PTR[16+rax] mov r15,QWORD PTR[24+rax] mulx rax,r8,rbp xor edi,edi mulx rbx,r9,rcx adcx r9,rax mulx rax,r10,r14 adcx r10,rbx mulx r12,r11,r15 mov rdx,QWORD PTR[8+rsi] adcx r11,rax mov QWORD PTR[rsp],r14 adcx r12,rdi mulx rbx,rax,rbp adox r9,rax adcx r10,rbx mulx rbx,rax,rcx adox r10,rax adcx r11,rbx mulx rbx,rax,r14 adox r11,rax adcx r12,rbx mulx r13,rax,r15 mov rdx,QWORD PTR[16+rsi] adox r12,rax adcx r13,rdi adox r13,rdi mulx rbx,rax,rbp adcx r10,rax adox r11,rbx mulx rbx,rax,rcx adcx r11,rax adox r12,rbx mulx rbx,rax,r14 adcx r12,rax adox r13,rbx mulx r14,rax,r15 mov rdx,QWORD PTR[24+rsi] adcx r13,rax adox r14,rdi adcx r14,rdi mulx rbx,rax,rbp adox r11,rax adcx r12,rbx mulx rbx,rax,rcx adox r12,rax adcx r13,rbx mulx rbx,rax,QWORD PTR[rsp] adox r13,rax adcx r14,rbx mulx r15,rax,r15 mov edx,38 adox r14,rax adcx r15,rdi adox r15,rdi jmp $L$reduce64 $L$fe64_mul_epilogue:: $L$SEH_end_x25519_fe64_mul:: x25519_fe64_mul ENDP PUBLIC x25519_fe64_sqr ALIGN 32 x25519_fe64_sqr PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_sqr:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 push rdi lea rsp,QWORD PTR[((-16))+rsp] $L$fe64_sqr_body:: mov rdx,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rsi] mov rbp,QWORD PTR[16+rsi] mov rsi,QWORD PTR[24+rsi] mulx r15,r8,rdx mulx rax,r9,rcx xor edi,edi mulx rbx,r10,rbp adcx r10,rax mulx r12,r11,rsi mov rdx,rcx adcx r11,rbx adcx r12,rdi mulx rbx,rax,rbp adox r11,rax adcx r12,rbx mulx r13,rax,rsi mov rdx,rbp adox r12,rax adcx r13,rdi mulx r14,rax,rsi mov rdx,rcx adox r13,rax adcx r14,rdi adox r14,rdi adcx r9,r9 adox r9,r15 adcx r10,r10 mulx rbx,rax,rdx mov rdx,rbp adcx r11,r11 adox r10,rax adcx r12,r12 adox r11,rbx mulx rbx,rax,rdx mov rdx,rsi adcx r13,r13 adox r12,rax adcx r14,r14 adox r13,rbx mulx r15,rax,rdx mov edx,38 adox r14,rax adcx r15,rdi adox r15,rdi jmp $L$reduce64 ALIGN 32 $L$reduce64:: mulx rbx,rax,r12 adcx r8,rax adox r9,rbx mulx rbx,rax,r13 adcx r9,rax adox r10,rbx mulx rbx,rax,r14 adcx r10,rax adox r11,rbx mulx r12,rax,r15 adcx r11,rax adox r12,rdi adcx r12,rdi mov rdi,QWORD PTR[16+rsp] imul r12,rdx add r8,r12 adc r9,0 adc r10,0 adc r11,0 sbb rax,rax and rax,38 add r8,rax mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 mov QWORD PTR[rdi],r8 mov r15,QWORD PTR[24+rsp] mov r14,QWORD PTR[32+rsp] mov r13,QWORD PTR[40+rsp] mov r12,QWORD PTR[48+rsp] mov rbx,QWORD PTR[56+rsp] mov rbp,QWORD PTR[64+rsp] lea rsp,QWORD PTR[72+rsp] $L$fe64_sqr_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_sqr:: x25519_fe64_sqr ENDP PUBLIC x25519_fe64_mul121666 ALIGN 32 x25519_fe64_mul121666 PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_mul121666:: mov rdi,rcx mov rsi,rdx $L$fe64_mul121666_body:: mov edx,121666 mulx rcx,r8,QWORD PTR[rsi] mulx rax,r9,QWORD PTR[8+rsi] add r9,rcx mulx rcx,r10,QWORD PTR[16+rsi] adc r10,rax mulx rax,r11,QWORD PTR[24+rsi] adc r11,rcx adc rax,0 imul rax,rax,38 add r8,rax adc r9,0 adc r10,0 adc r11,0 sbb rax,rax and rax,38 add r8,rax mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 mov QWORD PTR[rdi],r8 $L$fe64_mul121666_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_mul121666:: x25519_fe64_mul121666 ENDP PUBLIC x25519_fe64_add ALIGN 32 x25519_fe64_add PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_add:: mov rdi,rcx mov rsi,rdx mov rdx,r8 $L$fe64_add_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] add r8,QWORD PTR[rdx] adc r9,QWORD PTR[8+rdx] adc r10,QWORD PTR[16+rdx] adc r11,QWORD PTR[24+rdx] sbb rax,rax and rax,38 add r8,rax adc r9,0 adc r10,0 mov QWORD PTR[8+rdi],r9 adc r11,0 mov QWORD PTR[16+rdi],r10 sbb rax,rax mov QWORD PTR[24+rdi],r11 and rax,38 add r8,rax mov QWORD PTR[rdi],r8 $L$fe64_add_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_add:: x25519_fe64_add ENDP PUBLIC x25519_fe64_sub ALIGN 32 x25519_fe64_sub PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_sub:: mov rdi,rcx mov rsi,rdx mov rdx,r8 $L$fe64_sub_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] sub r8,QWORD PTR[rdx] sbb r9,QWORD PTR[8+rdx] sbb r10,QWORD PTR[16+rdx] sbb r11,QWORD PTR[24+rdx] sbb rax,rax and rax,38 sub r8,rax sbb r9,0 sbb r10,0 mov QWORD PTR[8+rdi],r9 sbb r11,0 mov QWORD PTR[16+rdi],r10 sbb rax,rax mov QWORD PTR[24+rdi],r11 and rax,38 sub r8,rax mov QWORD PTR[rdi],r8 $L$fe64_sub_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_sub:: x25519_fe64_sub ENDP PUBLIC x25519_fe64_tobytes ALIGN 32 x25519_fe64_tobytes PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_tobytes:: mov rdi,rcx mov rsi,rdx $L$fe64_to_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] lea rax,QWORD PTR[r11*1+r11] sar r11,63 shr rax,1 and r11,19 add r11,19 add r8,r11 adc r9,0 adc r10,0 adc rax,0 lea r11,QWORD PTR[rax*1+rax] sar rax,63 shr r11,1 not rax and rax,19 sub r8,rax sbb r9,0 sbb r10,0 sbb r11,0 mov QWORD PTR[rdi],r8 mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 $L$fe64_to_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_tobytes:: x25519_fe64_tobytes ENDP DB 88,50,53,53,49,57,32,112,114,105,109,105,116,105,118,101 DB 115,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82 DB 89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112 DB 114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 EXTERN __imp_RtlVirtualUnwind:NEAR ALIGN 16 short_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[120+r8] mov rbx,QWORD PTR[248+r8] mov rsi,QWORD PTR[8+r9] mov r11,QWORD PTR[56+r9] mov r10d,DWORD PTR[r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jb $L$common_seh_tail mov rax,QWORD PTR[152+r8] jmp $L$common_seh_tail short_handler ENDP ALIGN 16 full_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[120+r8] mov rbx,QWORD PTR[248+r8] mov rsi,QWORD PTR[8+r9] mov r11,QWORD PTR[56+r9] mov r10d,DWORD PTR[r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jb $L$common_seh_tail mov rax,QWORD PTR[152+r8] mov r10d,DWORD PTR[4+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail mov r10d,DWORD PTR[8+r11] lea rax,QWORD PTR[r10*1+rax] mov rbp,QWORD PTR[((-8))+rax] mov rbx,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] mov r13,QWORD PTR[((-32))+rax] mov r14,QWORD PTR[((-40))+rax] mov r15,QWORD PTR[((-48))+rax] mov QWORD PTR[144+r8],rbx mov QWORD PTR[160+r8],rbp mov QWORD PTR[216+r8],r12 mov QWORD PTR[224+r8],r13 mov QWORD PTR[232+r8],r14 mov QWORD PTR[240+r8],r15 $L$common_seh_tail:: mov rdi,QWORD PTR[8+rax] mov rsi,QWORD PTR[16+rax] mov QWORD PTR[152+r8],rax mov QWORD PTR[168+r8],rsi mov QWORD PTR[176+r8],rdi mov rdi,QWORD PTR[40+r9] mov rsi,r8 mov ecx,154 DD 0a548f3fch mov rsi,r9 xor rcx,rcx mov rdx,QWORD PTR[8+rsi] mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[16+rsi] mov r10,QWORD PTR[40+rsi] lea r11,QWORD PTR[56+rsi] lea r12,QWORD PTR[24+rsi] mov QWORD PTR[32+rsp],r10 mov QWORD PTR[40+rsp],r11 mov QWORD PTR[48+rsp],r12 mov QWORD PTR[56+rsp],rcx call QWORD PTR[__imp_RtlVirtualUnwind] mov eax,1 add rsp,64 popfq pop r15 pop r14 pop r13 pop r12 pop rbp pop rbx pop rdi pop rsi DB 0F3h,0C3h ;repret full_handler ENDP .text$ ENDS .pdata SEGMENT READONLY ALIGN(4) ALIGN 4 DD imagerel $L$SEH_begin_x25519_fe51_mul DD imagerel $L$SEH_end_x25519_fe51_mul DD imagerel $L$SEH_info_x25519_fe51_mul DD imagerel $L$SEH_begin_x25519_fe51_sqr DD imagerel $L$SEH_end_x25519_fe51_sqr DD imagerel $L$SEH_info_x25519_fe51_sqr DD imagerel $L$SEH_begin_x25519_fe51_mul121666 DD imagerel $L$SEH_end_x25519_fe51_mul121666 DD imagerel $L$SEH_info_x25519_fe51_mul121666 DD imagerel $L$SEH_begin_x25519_fe64_mul DD imagerel $L$SEH_end_x25519_fe64_mul DD imagerel $L$SEH_info_x25519_fe64_mul DD imagerel $L$SEH_begin_x25519_fe64_sqr DD imagerel $L$SEH_end_x25519_fe64_sqr DD imagerel $L$SEH_info_x25519_fe64_sqr DD imagerel $L$SEH_begin_x25519_fe64_mul121666 DD imagerel $L$SEH_end_x25519_fe64_mul121666 DD imagerel $L$SEH_info_x25519_fe64_mul121666 DD imagerel $L$SEH_begin_x25519_fe64_add DD imagerel $L$SEH_end_x25519_fe64_add DD imagerel $L$SEH_info_x25519_fe64_add DD imagerel $L$SEH_begin_x25519_fe64_sub DD imagerel $L$SEH_end_x25519_fe64_sub DD imagerel $L$SEH_info_x25519_fe64_sub DD imagerel $L$SEH_begin_x25519_fe64_tobytes DD imagerel $L$SEH_end_x25519_fe64_tobytes DD imagerel $L$SEH_info_x25519_fe64_tobytes .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 $L$SEH_info_x25519_fe51_mul:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_mul_body,imagerel $L$fe51_mul_epilogue DD 88,0 $L$SEH_info_x25519_fe51_sqr:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_sqr_body,imagerel $L$fe51_sqr_epilogue DD 88,0 $L$SEH_info_x25519_fe51_mul121666:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_mul121666_body,imagerel $L$fe51_mul121666_epilogue DD 88,0 $L$SEH_info_x25519_fe64_mul:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe64_mul_body,imagerel $L$fe64_mul_epilogue DD 72,0 $L$SEH_info_x25519_fe64_sqr:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe64_sqr_body,imagerel $L$fe64_sqr_epilogue DD 72,0 $L$SEH_info_x25519_fe64_mul121666:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_mul121666_body,imagerel $L$fe64_mul121666_epilogue $L$SEH_info_x25519_fe64_add:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_add_body,imagerel $L$fe64_add_epilogue $L$SEH_info_x25519_fe64_sub:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_sub_body,imagerel $L$fe64_sub_epilogue $L$SEH_info_x25519_fe64_tobytes:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_to_body,imagerel $L$fe64_to_epilogue .xdata ENDS END
16.180465
71
0.72663
65ea25f57ab3a5cf9b0bf9abff58405b04903893
571
asm
Assembly
programs/oeis/033/A033537.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/033/A033537.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/033/A033537.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A033537: a(n) = n*(2*n+5). ; 0,7,18,33,52,75,102,133,168,207,250,297,348,403,462,525,592,663,738,817,900,987,1078,1173,1272,1375,1482,1593,1708,1827,1950,2077,2208,2343,2482,2625,2772,2923,3078,3237,3400,3567,3738,3913,4092,4275,4462,4653,4848,5047,5250,5457,5668,5883,6102,6325,6552,6783,7018,7257,7500,7747,7998,8253,8512,8775,9042,9313,9588,9867,10150,10437,10728,11023,11322,11625,11932,12243,12558,12877,13200,13527,13858,14193,14532,14875,15222,15573,15928,16287,16650,17017,17388,17763,18142,18525,18912,19303,19698,20097 mov $1,$0 add $0,5 add $0,$1 mul $0,$1
71.375
501
0.758319
d3e467a4cacf76e9a8c9d74ea842ca5d3ba06f7a
1,212
asm
Assembly
Quiz and Lab Assessment/Solution/4.asm
simonahsan2129/CSE331L-Section-1-Fall20-NSU
e430f061e4046d212c536b67025b9fcb950e2497
[ "MIT" ]
1
2021-01-13T09:48:44.000Z
2021-01-13T09:48:44.000Z
Quiz and Lab Assessment/Solution/4.asm
AmirulAhsanSimon/CSE331L-Section-1-Fall20-NSU
e430f061e4046d212c536b67025b9fcb950e2497
[ "MIT" ]
null
null
null
Quiz and Lab Assessment/Solution/4.asm
AmirulAhsanSimon/CSE331L-Section-1-Fall20-NSU
e430f061e4046d212c536b67025b9fcb950e2497
[ "MIT" ]
1
2021-03-15T16:18:20.000Z
2021-03-15T16:18:20.000Z
.model small .stack 100h .data msg1 db 10,13,"ENTER A HEX DIGIT: $" msg2 db 10,13,"IN DECIMAL IS IT: $" msg3 db 10,13,"DO YOU WANT TO DO IT AGAIN? $" msg4 db 10,13,"INVALID CHARACTER- ENTER 0-9 OR A-F: $" .code again: mov ax,@data mov ds,ax lea dx,msg1 mov ah,9 int 21h mov ah,1 int 21h mov bl,al jmp go go: cmp bl,'9' ja hex jb num je num hex: cmp bl,'F' ja illegal lea dx,msg2 mov ah,9 int 21h mov dl,49d mov ah,2 int 21h sub bl,17d mov dl,bl mov ah,2 int 21h jmp inp inp: lea dx,msg3 mov ah,9 int 21h mov ah,1 int 21h mov cl,al cmp cl,'y' je again cmp cl,'Y' je again jmp exit num: cmp bl,'0' jb illegal lea dx,msg2 mov ah,9 int 21h mov dl,bl mov ah,2 int 21h jmp inp illegal: lea dx,msg4 mov ah,9 int 21h mov ah,1 int 21h mov bl,al jmp go exit:
9.696
54
0.427393
f0ab99a220c8c4c104f06a215d883a53f9ea96ec
8,467
asm
Assembly
c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/fir16.asm
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
null
null
null
c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/fir16.asm
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
null
null
null
c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/fir16.asm
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
1
2021-07-21T08:10:37.000Z
2021-07-21T08:10:37.000Z
;;############################################################################# ;;! \file source/fir16.asm ;;! ;;! \brief 16-bit FIR filter ;;! ;;! \date May 11, 2010 ;;! ;; ;; Group: C2000 ;; Target Family: C28x ;; ;;############################################################################# ;;$TI Release: C28x Fixed Point DSP Library v1.20.00.00 $ ;;$Release Date: Thu Oct 18 15:57:22 CDT 2018 $ ;;$Copyright: Copyright (C) 2014-2018 Texas Instruments Incorporated - ;; http://www.ti.com/ ALL RIGHTS RESERVED $ ;;############################################################################# ;; ;;***************************************************************************** ;; includes ;;***************************************************************************** ;; ;;***************************************************************************** ;; globals ;;***************************************************************************** ; Module definition for external reference .def _FIR16_init .def _FIR16_calc ;; ;;============================================================================= ;; Routine Type : C Callable ;; Description : ;; void FIR16_calc(FIR16_handle) ;; ;; This routine implements the non-recursive difference equation of an ;; all-zero filter(FIR), of order N. All the coefficients of all-zero ;; filter are assumed to be less than 1 in magnitude. ;;============================================================================= ;; ;; Algorithm: Y = sat(X0*C0 + X1*C1 + X2*C2 + ... Xn*Cn) >> 15 ;; Xn = Xn-1 ;; . ;; . ;; X2 = X1 ;; X1 = X0 ;; ;; X0 = input, Q15 ;; X1,..,Xn = Data, Q15 ;; C0,..,Cn = Coef, Q15 ;; Y = output, Q15 ;; n = N - 1 (N = number of taps, must always be an even number) ;; ;; This program uses the Dual-MAC capability of the C28x. The data ;; and coef structures must be organized into 32-bit words as follows: ;; ;; 31 16 15 0 ;; +------------+------------+ ;; *Data -> | N-2 | Index | 0 lowest address ;; | SatMax | 2 ;; | SatMin | 4 ;; | unused | (N/2)-1 | 6 ;; +------------+------------+ ;; | . | . | 0 ;; | . | . | 2 ;; tail-> | . | X(1) | 4 ;; head-> | X((n+1)/2) | X(0) | 6<- index value before ;; | X(n) | X((n-1)/2) | 8 executing FIR ;; | X(n-1) | . | . ;; | . | . | . ;; +------------+------------+ ;; ;; 31 16 15 0 ;; +------------+------------+ ;; *Coef -> | C(n) | C((n-1)/2) | 0 lowest address ;; | C(n-1) | . | 2 ;; | . | . | 4 ;; | . | C(2) | . ;; | . | C(1) | . ;; | C((n+1)/2) | C(0) | . ;; +------------+------------+ ;; ;; * For maximum performance, locate Data & Coef ;; structures in seperate RAM blocks. ;; * The Data & Coef pointers must always point to the lowest ;; address of the array and always aligned to even address ;; ;; Before calling FIR, need to initialize following data parameters: ;; ;; Index = 0 ;; N = Number of filter taps (must always be even) ;; N-2 = Size of data buffer (must always be an even number) ;; (N/2)-1 = number of times to repeat Dual MAC operation ;; SatMax = 0x00FFFFFF (corresponds to SPM of -6) ;; SatMin = 0xFF000000 (corresponds to SPM of -6) ;; ;; Note: Don't forget to clear all data values ;============================================================================== ;; Function Input: This function accepts the handle of the below structure ;; ;; typedef struct { <------------ XAR4 ;; int32_t *coeff_ptr; /* +0 Pointer to Filter coefficient */ ;; int32_t * dbuffer_ptr; /* +2 Delay buffer ptr */ ;; int16_t cbindex; /* +4 Circular Buffer Index */ ;; int16_t order; /* +5 Order of the Filter */ ;; int16_t input; /* +6 Latest Input sample */ ;; int16_t output; /* +7 Filter Output */ ;; void (*init)(void *); /* +8 Ptr to Init funtion */ ;; void (*calc)(void *); /* +10 Ptr to calc fn */ ;; }FIR16; ;; _FIR16_init: MOV *+XAR4[6],#0 ; XAR4->ouput, input=0 MOV *+XAR4[7],#0 ; output=0 MOVL XAR6,*+XAR4[2] ; XAR6=dbuffer_ptr MOV AL,*+XAR4[5] ; AL=order MOV AH,AL ; AH=order TBIT AL,#0 ADDB AL,#1 ; AL=order+1 MOV AL,AH,TC ; AL=order, if odd MOV AH,AL SUBB AH,#1 MOV *+XAR4[4],AH ; cbindex = order, even ; = order-1, odd RPT AL || MOV *XAR6++,#0 LRETR ConstTable: PosSatVal: .long 0x00FFFFFF ; Corresponds to >> 6 NegSatVal: .long 0xFF000000 ; Corresponds to >> 6 ;;FILTER_ORDER .set 43 ;;RPT_COUNT .set (FILTER_ORDER/2) _FIR16_calc: PUSH XAR1 ; Context Save SETC SXM,OVM ; AR4=FIR16_handle->coeff_ptr SPM -6 ; Create guard band of >> 6 MOVL XAR7,*XAR4 ; XAR4->coeff_ptr, XAR7=coeff_ptr MOVZ AR1,*+XAR4[4] ; XAR4->coeff_ptr, AR1=cbindex MOVL XAR6,*+XAR4[2] ; XAR4->coeff_ptr, XAR6=dbuffer_ptr MOVL ACC,*XAR6 ; ACC = -:X MOV AH,@AL ; ACC = X:X MOV AL,*+XAR4[6] ; ACC = X:Input MOVL *XAR6%++,ACC ; Store in data array and inc circ address MOVL *+XAR4[2],XAR6 ; XAR4->coeff_ptr, update the dbuffer pointer MOV ACC,*+XAR4[5]<<15 ; AR0=cbindex MOVZ AR0,AH ; AR0=order/2 ZAPA ; Zero the ACC, P registers and OVC counter ;; <<VC140828 - debug only ;;.asg 0, N ;;.loop ;;DMAC ACC:P,*XAR6%++,*XAR7++ ; XT = *+XAR6[AR1%++], Temp = *XAR7++ ;; ; ACC = (XT.MSW*Temp.MSW) << PM (>> -6) ;; ; P = (XT.LSW*Temp.LSW) << PM (>> -6) ;;.eval N + 1, N ; increment N ;;.break N = (RPT_COUNT+1) ;;.endloop ;; VC140828>> RPT AR0 || DMAC ACC:P,*XAR6%++,*XAR7++ ADDL ACC,P ; Add the two sums with shift MOVW DP,#PosSatVal MINL ACC,@PosSatVal ; Saturate result MOVW DP,#NegSatVal MAXL ACC,@NegSatVal MOVH *+XAR4[7],ACC<<7 ; Store saturated result (Q15) SPM 0 POP XAR1 CLRC OVM LRETR ;;############################################################################# ;; End of File ;;#############################################################################
43.64433
88
0.328097
ddc4f3923fa93a5a9eacef94480c4e01526447a3
6,764
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1608.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1608.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1608.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 %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x3e0f, %rdi nop nop nop nop inc %r9 movw $0x6162, (%rdi) nop nop add %rbp, %rbp lea addresses_normal_ht+0x1b74f, %rsi nop nop nop nop inc %r12 movl $0x61626364, (%rsi) nop nop xor %rsi, %rsi lea addresses_normal_ht+0x1894f, %r12 nop nop nop sub $55030, %rbx mov (%r12), %di nop nop nop nop sub %rsi, %rsi lea addresses_D_ht+0x334f, %rbp nop dec %rsi mov (%rbp), %edi nop nop nop nop nop sub $45012, %rbp lea addresses_A_ht+0x16b4f, %rsi lea addresses_WT_ht+0xff09, %rdi nop nop cmp %r15, %r15 mov $76, %rcx rep movsw nop nop nop nop cmp %rbx, %rbx lea addresses_WT_ht+0x1574f, %rsi lea addresses_WT_ht+0x17c65, %rdi nop nop nop nop cmp $42971, %r15 mov $75, %rcx rep movsb nop nop sub %r12, %r12 lea addresses_WT_ht+0x1c91b, %rsi lea addresses_UC_ht+0xd0df, %rdi clflush (%rdi) nop nop nop nop nop xor %r12, %r12 mov $49, %rcx rep movsl nop nop nop sub $56426, %r15 lea addresses_normal_ht+0xd74f, %r9 nop nop nop nop cmp %rbp, %rbp mov (%r9), %rsi nop nop and $15196, %r9 lea addresses_WC_ht+0x774f, %r9 clflush (%r9) nop nop nop nop cmp %r15, %r15 movl $0x61626364, (%r9) nop nop cmp %r15, %r15 lea addresses_normal_ht+0xeb4f, %r9 nop nop nop nop nop cmp %rsi, %rsi and $0xffffffffffffffc0, %r9 movntdqa (%r9), %xmm6 vpextrq $0, %xmm6, %rdi nop nop dec %rsi lea addresses_WT_ht+0xb14f, %rsi lea addresses_WT_ht+0x7eff, %rdi nop nop nop dec %rbx mov $18, %rcx rep movsw nop nop nop nop nop xor $3469, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r14 push %r9 push %rax push %rbp // Faulty Load lea addresses_RW+0x1474f, %r13 nop nop nop nop add $8247, %r10 mov (%r13), %ebp lea oracles, %rax and $0xff, %rbp shlq $12, %rbp mov (%rax,%rbp,1), %rbp pop %rbp pop %rax pop %r9 pop %r14 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_RW', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': True, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': True, 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': True, 'AVXalign': False, 'congruent': 11}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
33.98995
2,999
0.660112
00650db4f8245e086cf85d23102566fc38da844b
1,585
nasm
Assembly
Microprocessor lab/nearFarProcedure/p2.nasm
IamVaibhavsar/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
34
2020-02-09T08:42:49.000Z
2022-03-01T09:04:53.000Z
Microprocessor lab/nearFarProcedure/p2.nasm
MXNXV/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
1
2020-10-16T15:41:43.000Z
2020-10-16T16:03:50.000Z
Microprocessor lab/nearFarProcedure/p2.nasm
MXNXV/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
34
2020-01-07T08:47:42.000Z
2022-03-29T16:45:56.000Z
%include "macro.nasm" global _main _main: global proc1 extern buff,abufflen section .text proc1 : display buff,[abufflen] ; to rsi display msg1,len1 ;enter the character to search: accept char2,2 ;to bl mov bl,[char2] mov rsi,buff n1: mov al,[rsi] ;buff->rsi->al cmp al, 0Ah ;new line je enter1 cmp al,20H ;spaces je space1 cmp al,bl ;No. of occurance je ccount jmp n2 enter1: inc byte[lcnt] ;to al jmp n2 space1: inc byte[scnt] ;to al jmp n2 ccount: inc byte[ccnt] ;to al jmp n2 n2: inc rsi dec byte[abufflen] jnz n1 display dispmsg1,displen1 mov al,byte[lcnt] call displayproc display dispmsg2,displen2 mov al,byte[scnt] call displayproc display dispmsg3,displen3 mov al,byte[ccnt] call displayproc ret displayproc: mov rsi,disparr+1 mov rcx,2 l1:mov rdx,0H mov rbx,10H div rbx cmp dl,09H jle l2 add dl,07H l2:add dl,30H mov [rsi],dl dec rsi dec rcx jnz l1 mov rax,1 mov rdi,1 mov rsi,disparr mov rdx,2 syscall ret section .data msg1: db "",10 db "Enter the Char to be search : " len1: equ $-msg1 dispmsg1: db "Number of Lines in the File : ", displen1: equ $-dispmsg1 dispmsg2: db "",10 db "Number of Blank Spaces in the File : ", displen2: equ $-dispmsg2 dispmsg3: db "",10 db "Number of times Char occuring in the File : ", displen3: equ $-dispmsg3 db "",10 db "",10 section .bss lcnt resb 10 scnt resb 10 ccnt resb 10 disparr resb 2 char2 resb 2
14.279279
60
0.628391
ca4ce4092f816018212bfe1dded16811fccd8e19
88
asm
Assembly
PRG/objects/6-F2A.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/objects/6-F2A.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/objects/6-F2A.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
.byte $01 ; Unknown purpose .byte OBJ_BOOMBOOMJUMP, $1D, $24 .byte $FF ; Terminator
17.6
33
0.681818
a3cada2f38aaaf1612f4a46b7a01a67af47e8ab3
3,971
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2301.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2301.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2301.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %rcx push %rsi lea addresses_WT_ht+0x8a5f, %rsi nop nop nop nop dec %rcx movb (%rsi), %r13b mfence pop %rsi pop %rcx pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %rax push %rbx push %rcx // Faulty Load mov $0x358f000000085f, %r11 nop nop and %r13, %r13 mov (%r11), %r12 lea oracles, %rbx and $0xff, %r12 shlq $12, %r12 mov (%rbx,%r12,1), %r12 pop %rcx pop %rbx pop %rax pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 8, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
67.305085
2,999
0.662302
4e85114425d3418d5ad805669ba55881d8758278
753
asm
Assembly
text/maps/viridian_mart.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
text/maps/viridian_mart.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
text/maps/viridian_mart.asm
longlostsoul/EvoYellow
fe5d0d372c4e90d384c4005a93f19d7968f2ff13
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
_ViridianMartText1:: text "We scared those" line "trouble makers!" done _ViridianMartText4:: text "Hey! You came from" line "PALLET TOWN?" done ViridianMartParcelQuestText:: text "You know PROF." line "OAK, right?" para "His order came in." line "Will you take it" cont "to him?" para $52, " got" line "OAK's PARCEL!@@" _ViridianMartText2:: text "STRANGER: Hold it!" line "We, Team Rocket," cont "are taking that!" para "Prepare for" line "devastation!" cont "Make it double!" para " Jessie!" line "James! Meowth!" done _ViridianMartText3:: text "Blasting off" line "for the first and" cont "last time!" done ;_ViridianMartText6:: ; text "A talking MON?" ; line "Meowth thinks ya" ; cont "imagining things!" ; done
16.021277
29
0.683931
dc42f3accc35c6174bb28fd441a131469a9bea3b
3,574
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_7_461.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_7_461.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_7_461.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 %r15 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0xde40, %r15 add %rbp, %rbp mov (%r15), %r11 nop nop nop nop nop dec %r15 lea addresses_WT_ht+0x3b23, %r15 nop nop add %rdx, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%r15) nop nop xor $43184, %rbp lea addresses_D_ht+0x16a40, %r13 nop nop nop nop nop dec %r15 mov $0x6162636465666768, %rdx movq %rdx, (%r13) dec %r15 lea addresses_normal_ht+0x93c0, %rsi lea addresses_A_ht+0x10860, %rdi clflush (%rsi) nop nop nop inc %r15 mov $42, %rcx rep movsb nop nop nop nop xor %rdi, %rdi lea addresses_A_ht+0x1cb40, %r11 add %r15, %r15 mov (%r11), %cx nop dec %r13 lea addresses_WC_ht+0xf3f8, %rbp nop nop nop and $36326, %r11 mov (%rbp), %dx nop nop nop nop add $46559, %r11 lea addresses_WT_ht+0xa922, %rdi nop nop nop and %rcx, %rcx movl $0x61626364, (%rdi) lfence lea addresses_UC_ht+0x17cc0, %rdx nop nop add %rsi, %rsi movl $0x61626364, (%rdx) nop nop nop sub $1130, %rbp lea addresses_normal_ht+0x10e40, %rcx nop nop nop nop and $15620, %r13 mov (%rcx), %r11 and %rdi, %rdi lea addresses_WC_ht+0xd6d0, %rcx xor %r11, %r11 movw $0x6162, (%rcx) nop nop nop nop nop and %rdx, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r15 push %r8 push %rcx // Store mov $0x3cd0e70000000ca0, %r13 add $36754, %r12 mov $0x5152535455565758, %r15 movq %r15, %xmm0 vmovups %ymm0, (%r13) nop nop nop nop nop add %r8, %r8 // Faulty Load lea addresses_A+0xb640, %rcx nop sub %r15, %r15 vmovups (%rcx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %r12 lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rcx pop %r8 pop %r15 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}} {'00': 7} 00 00 00 00 00 00 00 */
20.54023
151
0.646894
245388b5e8532cea367cd961018f0d19072fe94f
1,380
asm
Assembly
programs/oeis/127/A127944.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/127/A127944.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/127/A127944.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A127944: Partial sums of A093049. ; 0,0,0,2,3,7,11,17,21,29,37,47,56,68,80,94,105,121,137,155,172,192,212,234,254,278,302,328,353,381,409,439,465,497,529,563,596,632,668,706,742,782,822,864,905,949,993,1039,1082,1130,1178,1228,1277,1329,1381,1435,1487,1543,1599,1657,1714,1774,1834,1896,1953,2017,2081,2147,2212,2280,2348,2418,2486,2558,2630,2704,2777,2853,2929,3007,3082,3162,3242,3324,3405,3489,3573,3659,3743,3831,3919,4009,4098,4190,4282,4376,4466,4562,4658,4756,4853,4953,5053,5155,5255,5359,5463,5569,5674,5782,5890,6000,6107,6219,6331,6445,6558,6674,6790,6908,7024,7144,7264,7386,7507,7631,7755,7881,8001,8129,8257,8387,8516,8648,8780,8914,9046,9182,9318,9456,9593,9733,9873,10015,10154,10298,10442,10588,10733,10881,11029,11179,11327,11479,11631,11785,11938,12094,12250,12408,12562,12722,12882,13044,13205,13369,13533,13699,13863,14031,14199,14369,14538,14710,14882,15056,15227,15403,15579,15757,15934,16114,16294,16476,16656,16840,17024,17210,17395,17583,17771,17961,18146,18338,18530,18724,18917,19113,19309,19507,19703,19903,20103,20305,20506,20710,20914,21120,21323,21531,21739,21949,22158,22370,22582,22796,23008,23224,23440,23658,23875,24095,24315,24537,24755,24979,25203,25429,25654,25882,26110,26340,26568,26800,27032,27266,27499,27735,27971,28209,28444,28684,28924,29166,29407,29651,29895,30141,30385,30633 mov $1,$0 bin $1,2 lpb $0 div $0,2 sub $1,$0 lpe
138
1,289
0.791304
666984c09eaeffc23914eaa4c4fcbedbdf4192f0
433
asm
Assembly
Test/Assembler/Test01.asm
CharlesCarley/HackComputer
2f29ec7929ef08f295b5be5810f324acc99604e0
[ "MIT" ]
null
null
null
Test/Assembler/Test01.asm
CharlesCarley/HackComputer
2f29ec7929ef08f295b5be5810f324acc99604e0
[ "MIT" ]
null
null
null
Test/Assembler/Test01.asm
CharlesCarley/HackComputer
2f29ec7929ef08f295b5be5810f324acc99604e0
[ "MIT" ]
null
null
null
// -- 01 -- @0 M=-1 // == -1 // -- 02 -- @256 D=A @1 M=D // == 256 // -- 03 -- @123 MD=A @2 M=D // == 123 // -- 04 -- @123 D=M // == 123 @3 M=D // == 123 // -- 05 -- @15 M=0 @15 M=M+1 D=M @16384 A=D+A M=!M D=M @4 M=D @15 M=M+1 D=M @16384 A=D+A M=!M D=M @5 M=D @15 M=M+1 D=M @16384 A=D+A M=!M D=M @6 M=D @15 M=M+1 D=M @16384 A=D+A M=!M D=M @7 M=D
11.394737
20
0.330254
60eaa1103fd6eb19a46de967caa76b9675341ce9
764
asm
Assembly
books/nand2tetris/ch08/FunctionCalls/SimpleFunction.asm
luksamuk/study
7a4062cb894be52d786852b4729ac6a4e784b5a3
[ "MIT" ]
3
2019-03-13T02:16:44.000Z
2020-03-05T21:14:18.000Z
books/nand2tetris/ch08/FunctionCalls/SimpleFunction.asm
luksamuk/study
7a4062cb894be52d786852b4729ac6a4e784b5a3
[ "MIT" ]
1
2019-03-15T00:52:59.000Z
2019-03-15T00:53:54.000Z
books/nand2tetris/ch08/FunctionCalls/SimpleFunction.asm
luksamuk/study
7a4062cb894be52d786852b4729ac6a4e784b5a3
[ "MIT" ]
1
2020-03-05T21:14:29.000Z
2020-03-05T21:14:29.000Z
(SimpleFunction.test) @0 D=A @SP A=M M=D @SP M=M+1 @0 D=A @SP A=M M=D @SP M=M+1 @LCL A=M D=M @SP A=M M=D @SP M=M+1 @LCL D=M @1 A=D+A D=M @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @R13 M=D @SP M=M-1 A=M D=M @R13 A=M D=D+A @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M D=!D @SP A=M M=D @SP M=M+1 @ARG A=M D=M @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @R13 M=D @SP M=M-1 A=M D=M @R13 A=M D=D+A @SP A=M M=D @SP M=M+1 @ARG D=M @1 A=D+A D=M @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @R13 M=D @SP M=M-1 A=M D=M @R13 A=M D=D-A @SP A=M M=D @SP M=M+1 @LCL D=M @R13 M=D @5 A=D-A D=M @R14 M=D @SP M=M-1 A=M D=M @ARG A=M M=D @ARG A=M D=A+1 @SP M=D @R13 D=M @1 A=D-A D=M @THAT M=D @R13 D=M @2 A=D-A D=M @THIS M=D @R13 D=M @3 A=D-A D=M @ARG M=D @R13 D=M @4 A=D-A D=M @LCL M=D @R14 A=M 0;JMP
4.547619
21
0.520942
0652d9953cd3e7455dd6c76e9e5efe4f86c9c197
4,903
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_995.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_995.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_995.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 %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x16f6d, %rdi nop nop nop nop nop sub %rsi, %rsi movb $0x61, (%rdi) nop nop nop xor %r10, %r10 lea addresses_A_ht+0x16dad, %rsi lea addresses_A_ht+0x8c7, %rdi and %rbx, %rbx mov $26, %rcx rep movsb nop nop nop nop and $29513, %rbx lea addresses_WC_ht+0x6099, %rbx nop nop cmp $38507, %rbp mov (%rbx), %r15w nop nop nop nop nop add $16083, %rbp lea addresses_UC_ht+0x139fd, %rbx nop dec %rbp movups (%rbx), %xmm6 vpextrq $1, %xmm6, %rdi nop nop nop sub %rsi, %rsi lea addresses_UC_ht+0xb66d, %rsi nop and $16985, %rbp movl $0x61626364, (%rsi) nop nop nop sub %rsi, %rsi lea addresses_normal_ht+0x816d, %r15 nop nop sub %rcx, %rcx movb $0x61, (%r15) nop nop cmp %rdi, %rdi lea addresses_UC_ht+0x13fed, %rcx nop xor $8709, %rdi mov (%rcx), %r15d nop nop nop nop and %r10, %r10 lea addresses_A_ht+0x18bed, %rdi nop nop nop nop nop inc %rbp mov (%rdi), %r15 add %rsi, %rsi lea addresses_WC_ht+0x1827d, %rsi nop nop nop nop and $46221, %r15 movl $0x61626364, (%rsi) nop sub %r10, %r10 lea addresses_A_ht+0xcaed, %rdi nop nop nop nop sub %rcx, %rcx movb $0x61, (%rdi) xor $20623, %rsi lea addresses_normal_ht+0x51e9, %rsi lea addresses_D_ht+0x1c5cd, %rdi nop nop nop add $22655, %r9 mov $85, %rcx rep movsl nop sub $58220, %r9 lea addresses_D_ht+0x696d, %rsi lea addresses_UC_ht+0x1945f, %rdi and %r9, %r9 mov $17, %rcx rep movsw nop nop cmp $21825, %rbx lea addresses_D_ht+0xf96d, %rsi lea addresses_normal_ht+0xd96d, %rdi clflush (%rsi) clflush (%rdi) inc %r9 mov $14, %rcx rep movsl inc %r9 lea addresses_A_ht+0x1bddd, %rdi nop nop nop nop add $62432, %rsi mov (%rdi), %ecx and $48970, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_A+0xfeed, %rbp add %rsi, %rsi mov $0x5152535455565758, %r12 movq %r12, (%rbp) nop nop nop xor %rbp, %rbp // REPMOV lea addresses_RW+0xb5e2, %rsi mov $0xb5d, %rdi nop and $21652, %rbp mov $81, %rcx rep movsb nop nop sub $4440, %r11 // Faulty Load lea addresses_WC+0x1316d, %r10 nop inc %rdx vmovups (%r10), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rbp lea oracles, %rsi and $0xff, %rbp shlq $12, %rbp mov (%rsi,%rbp,1), %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_RW', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_P', 'congruent': 4, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 6, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'00': 2} 00 00 */
21.599119
152
0.644911
2c8e0b9aab968d31d6da2314d413fea38fae7318
338
asm
Assembly
programs/oeis/129/A129371.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/129/A129371.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/129/A129371.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A129371: a(n)=sum{k=0..floor(n/2), (n-k)^2}. ; 0,1,5,13,29,50,86,126,190,255,355,451,595,728,924,1100,1356,1581,1905,2185,2585,2926,3410,3818,4394,4875,5551,6111,6895,7540,8440,9176,10200,11033,12189,13125,14421,15466,16910,18070 lpb $0 mov $2,$0 sub $0,1 seq $2,129370 ; a(n)=n^2-(n-1)^2*(1-(-1)^n)/8. add $1,$2 lpe mov $0,$1
30.727273
184
0.636095
83c2f3979d3e343c387ed895d19cdcf3301847ca
2,789
asm
Assembly
programs/oeis/166/A166957.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/166/A166957.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/166/A166957.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A166957: a(n) = 841*n^3 + 261*n^2 + 28*n + 1. ; 1,1131,7829,25141,58113,111791,191221,301449,447521,634483,867381,1151261,1491169,1892151,2359253,2897521,3512001,4207739,4989781,5863173,6832961,7904191,9081909,10371161,11776993,13304451,14958581,16744429,18667041,20731463,22942741,25305921,27826049,30508171,33357333,36378581,39576961,42957519,46525301,50285353,54242721,58402451,62769589,67349181,72146273,77165911,82413141,87893009,93610561,99570843,105778901,112239781,118958529,125940191,133189813,140712441,148513121,156596899,164968821,173633933,182597281,191863911,201438869,211327201,221533953,232064171,242922901,254115189,265646081,277520623,289743861,302320841,315256609,328556211,342224693,356267101,370688481,385493879,400688341,416276913,432264641,448656571,465457749,482673221,500308033,518367231,536855861,555778969,575141601,594948803,615205621,635917101,657088289,678724231,700829973,723410561,746471041,770016459,794051861,818582293,843612801,869148431,895194229,921755241,948836513,976443091,1004580021,1033252349,1062465121,1092223383,1122532181,1153396561,1184821569,1216812251,1249373653,1282510821,1316228801,1350532639,1385427381,1420918073,1457009761,1493707491,1531016309,1568941261,1607487393,1646659751,1686463381,1726903329,1767984641,1809712363,1852091541,1895127221,1938824449,1983188271,2028223733,2073935881,2120329761,2167410419,2215182901,2263652253,2312823521,2362701751,2413291989,2464599281,2516628673,2569385211,2622873941,2677099909,2732068161,2787783743,2844251701,2901477081,2959464929,3018220291,3077748213,3138053741,3199141921,3261017799,3323686421,3387152833,3451422081,3516499211,3582389269,3649097301,3716628353,3784987471,3854179701,3924210089,3995083681,4066805523,4139380661,4212814141,4287111009,4362276311,4438315093,4515232401,4593033281,4671722779,4751305941,4831787813,4913173441,4995467871,5078676149,5162803321,5247854433,5333834531,5420748661,5508601869,5597399201,5687145703,5777846421,5869506401,5962130689,6055724331,6150292373,6245839861,6342371841,6439893359,6538409461,6637925193,6738445601,6839975731,6942520629,7046085341,7150674913,7256294391,7362948821,7470643249,7579382721,7689172283,7800016981,7911921861,8024891969,8138932351,8254048053,8370244121,8487525601,8605897539,8725364981,8845932973,8967606561,9090390791,9214290709,9339311361,9465457793,9592735051,9721148181,9850702229,9981402241,10113253263,10246260341,10380428521,10515762849,10652268371,10789950133,10928813181,11068862561,11210103319,11352540501,11496179153,11641024321,11787081051,11934354389,12082849381,12232571073,12383524511,12535714741,12689146809,12843825761,12999756643 mov $4,$0 mul $0,16 pow $0,2 mov $1,$0 add $1,1 mov $2,$4 mul $2,28 add $1,$2 mov $3,$4 mul $3,$4 mov $2,$3 mul $2,5 add $1,$2 mul $3,$4 mov $2,$3 mul $2,841 add $1,$2
132.809524
2,571
0.871997
6e9d89e42d86a41bf7d908fd426dbad597409107
550
asm
Assembly
exe/ratstuff.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
28
2015-02-03T01:38:24.000Z
2022-03-23T05:48:24.000Z
exe/ratstuff.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
20
2015-01-02T14:51:20.000Z
2021-01-09T21:37:19.000Z
exe/ratstuff.asm
DigitalMars/optlink
493de158282046641ef2a3a60a88e25e26d88ec4
[ "BSL-1.0" ]
9
2015-02-11T17:43:56.000Z
2019-09-05T11:07:02.000Z
if fg_rat RAT_OUT_INIT PROC ; ;OPEN EXE OR COM FILE FOR OUTPUT ; CALL COMMON_OUT_INIT CALL OPEN_OUTPUT MOV _EXE_DEVICE,BX XOR DX,DX MOV EXEHDR_ADDR.LW,DX ;NEXT EXEHDR WRITE ADDRESS MOV EXEHDR_ADDR.HW,DX RET RAT_OUT_INIT ENDP endif if fg_rat PUBLIC RAT_OUT_TABLE RAT_OUT_TABLE LABEL WORD DW RAT_OUT_INIT DW PROT_OUT_NEW_SEGMENT DW PROT_OUT_NEW_SEGMOD DW EXE_OUT_SEGMOD_FINISH DW EXE_OUT_SEGMENT_FINISH DW EXE_OUT_END_OF_SEGMENTS DW PROT_FLUSH_SEGMOD DW PROT_FLUSH_SEGMENT DW RAT_OUT_FLUSH_EXE endif
13.75
50
0.78
6e6df0a8fbed14f7ff46e5af9f7956be891079f6
737
asm
Assembly
oeis/003/A003469.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/003/A003469.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/003/A003469.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A003469: Number of minimal covers of an (n + 1)-set by a collection of n nonempty subsets, a(n) = A035348(n,n-1). ; Submitted by Jamie Morken(s1) ; 1,6,22,65,171,420,988,2259,5065,11198,24498,53157,114583,245640,524152,1113959,2359125,4980546,10485550,22019865,46137091,96468716,201326292,419430075,872414881,1811938950,3758095978,7784627789,16106126895,33285996048,68719476208,141733920207,292057775533,601295420810,1236950580582,2542620638529,5222680231195,10720238370036,21990232554700,45079976737955,92358976732281,189115999976526,387028092976162,791648371997685,1618481116085191,3307330976349080,6755399441054568,13792273858820919 lpb $0 sub $0,1 add $1,1 add $2,2 mul $2,2 add $2,$0 add $1,$2 lpe mov $0,$1 add $0,1
49.133333
489
0.8019
245689dbe29909e6cd27c24f99187cf13b077bdd
17,146
asm
Assembly
Cameras/Watch_Dogs2/InjectableGenericCameraSystem/Interceptor.asm
Cyberim/InjectableGenericCameraSystem
d74f8786a903211e72c5da7f2f3be30826bb8329
[ "BSD-2-Clause" ]
623
2016-12-02T16:01:05.000Z
2022-03-29T19:59:10.000Z
Cameras/Watch_Dogs2/InjectableGenericCameraSystem/Interceptor.asm
Cyberim/InjectableGenericCameraSystem
d74f8786a903211e72c5da7f2f3be30826bb8329
[ "BSD-2-Clause" ]
113
2016-12-10T17:34:24.000Z
2022-02-06T21:59:42.000Z
Cameras/Watch_Dogs2/InjectableGenericCameraSystem/Interceptor.asm
Cyberim/InjectableGenericCameraSystem
d74f8786a903211e72c5da7f2f3be30826bb8329
[ "BSD-2-Clause" ]
232
2016-12-17T06:32:08.000Z
2022-03-27T16:51:29.000Z
;//////////////////////////////////////////////////////////////////////////////////////////////////////// ;// Part of Injectable Generic Camera System ;// Copyright(c) 2017, Frans Bouma ;// All rights reserved. ;// https://github.com/FransBouma/InjectableGenericCameraSystem ;// ;// Redistribution and use in source and binary forms, with or without ;// modification, are permitted provided that the following conditions are met : ;// ;// * Redistributions of source code must retain the above copyright notice, this ;// list of conditions and the following disclaimer. ;// ;// * Redistributions in binary form must reproduce the above copyright notice, ;// this list of conditions and the following disclaimer in the documentation ;// and / or other materials provided with the distribution. ;// ;// 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. ;//////////////////////////////////////////////////////////////////////////////////////////////////////// ;--------------------------------------------------------------- ; Game specific asm file to intercept execution flow to obtain addresses, prevent writes etc. ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Public definitions so the linker knows which names are present in this file PUBLIC cameraStructInterceptor PUBLIC cameraWriteInterceptor PUBLIC gamespeedStructInterceptor PUBLIC todStructInterceptor PUBLIC hotsampleInterceptor ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Externs which are used and set by the system. Read / write these ; values in asm to communicate with the system EXTERN g_cameraEnabled: byte EXTERN g_hotsampleEnabled: byte EXTERN g_hotsampleFactor: dword EXTERN g_cameraStructAddress: qword EXTERN g_gamespeedStructAddress: qword EXTERN g_todStructAddress: qword ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Own externs, defined in InterceptorHelper.cpp EXTERN _cameraStructInterceptionContinue: qword EXTERN _cameraWriteInterceptionContinue: qword EXTERN _gamespeedStructInterceptorContinue: qword EXTERN _todStructInterceptorContinue: qword EXTERN _hotsampleInterceptorContinue: qword .data ;--------------------------------------------------------------- ; Scratch pad ; Thanks to DJH (DET) for this location: manipulate r14d & ebp to get bigger framebuffer for shots! ; This is really nifty and simple. I looked at how to intercept the limiter code for the hotsampling, instead he simply manipulated the ; values passed to the routine, no limiter disable needed. To find this, it was a matter of resizing the window and check where the resolution was stored, then check ; which code this reads. I found that, but didn't think manipulating the values in the registers would bring me anything. ; ; To built this in: add keys to increase/decrease the scaling factor: 1, 2, 3, 4, 5, 6, 7, 8. ; Then build a toggle to enable / disable scaling with this factor. Simply multiply r14d and ebp dwords with the scaling factor. ; the intercepted code should check whether the toggle is enabled, and if so, it should read the multiply factor and multiply both r14d and ebp with the factor ; otherwise simply skip it. Using a factor and a toggle is better, as you can set the factor to a value and simply toggle hotsampling on for a shot and off again, without ; finetuning the factor. ; ;Disrupt_64.dll+6AA914C - EB 0F - jmp Disrupt_64.dll+6AA915D ;Disrupt_64.dll+6AA914E - 01 21 - add [rcx],esp ;Disrupt_64.dll+6AA9150 - 44 8B B3 70010000 - mov r14d,[rbx+00000170] <<< WIDTH READ OF FRAMEBUFFER (DWORD values) ;Disrupt_64.dll+6AA9157 - 8B AB 74010000 - mov ebp,[rbx+00000174] <<< HEIGHT READ OF FRAMEBUFFER. ;Disrupt_64.dll+6AA915D - 48 8B 4E 08 - mov rcx,[rsi+08] ;Disrupt_64.dll+6AA9161 - 48 85 C9 - test rcx,rcx ;Disrupt_64.dll+6AA9164 - 0F84 44010000 - je Disrupt_64.dll+6AA92AE ;Disrupt_64.dll+6AA916A - 48 8B 01 - mov rax,[rcx] ;Disrupt_64.dll+6AA916D - 48 8D 54 24 30 - lea rdx,[rsp+30] ;Disrupt_64.dll+6AA9172 - FF 50 60 - call qword ptr [rax+60] ; ;--------------------------------------------------------------- .code cameraStructInterceptor PROC ; v1.13 ;Disrupt_64.dll+51E03AF - F3 0F59 35 098727FE - mulss xmm6,[Disrupt_64.dll+3458AC0] { [0.02] } ;Disrupt_64.dll+51E03B7 - F3 0F11 40 D8 - movss [rax-28],xmm0 ;Disrupt_64.dll+51E03BC - F3 0F11 50 E0 - movss [rax-20],xmm2 ;Disrupt_64.dll+51E03C1 - E8 7516FF00 - call Disrupt_64.dll+61D1A3B ;Disrupt_64.dll+51E03C6 - 48 8B 44 24 20 - mov rax,[rsp+20] <<< INTERCEPT HERE ;Disrupt_64.dll+51E03CB - 48 89 43 70 - mov [rbx+70],rax <<< X -axe rotation. Writes 64bits, so also writes roll (y axe rotation)! Angles are 2PI rad. ;Disrupt_64.dll+51E03CF - 8B 44 24 28 - mov eax,[rsp+28] ;Disrupt_64.dll+51E03D3 - 89 43 78 - mov [rbx+78],eax <<< Z axe rotation (UP) ;Disrupt_64.dll+51E03D6 - F3 0F11 73 7C - movss [rbx+7C],xmm6 <<< FOV WRITE ;Disrupt_64.dll+51E03DB - 8B 83 AC0D0000 - mov eax,[rbx+00000DAC] <<< CONTINUE HERE ;Disrupt_64.dll+51E03E1 - 0F28 74 24 30 - movaps xmm6,[rsp+30] ;Disrupt_64.dll+51E03E6 - 89 43 58 - mov [rbx+58],eax ;Disrupt_64.dll+51E03E9 - 8B 83 B00D0000 - mov eax,[rbx+00000DB0] ; v1.11 ;Disrupt_64.dll+50E323C - F3 0F59 35 74952BFE - mulss xmm6,[Disrupt_64.dll+339C7B8] { [0.02] } ;Disrupt_64.dll+50E3244 - F3 0F11 40 D8 - movss [rax-28],xmm0 ;Disrupt_64.dll+50E3249 - F3 0F11 50 E0 - movss [rax-20],xmm2 ;Disrupt_64.dll+50E324E - E8 DD3C2101 - call Disrupt_64.dll+62F6F30 ;Disrupt_64.dll+50E3253 - 48 8B 44 24 20 - mov rax,[rsp+20] <<< INTERCEPT HERE ;Disrupt_64.dll+50E3258 - 48 89 43 70 - mov [rbx+70],rax <<< X -axe rotation. Writes 64bits, so also writes roll (y axe rotation)! Angles are 2PI rad. ;Disrupt_64.dll+50E325C - 8B 44 24 28 - mov eax,[rsp+28] ;Disrupt_64.dll+50E3260 - 89 43 78 - mov [rbx+78],eax <<< Z axe rotation (UP) ;Disrupt_64.dll+50E3263 - F3 0F11 73 7C - movss [rbx+7C],xmm6 <<< FOV WRITE ;Disrupt_64.dll+50E3268 - 8B 83 DC150000 - mov eax,[rbx+000015DC] <<< CONTINUE HERE ;Disrupt_64.dll+50E326E - 0F28 74 24 30 - movaps xmm6,[rsp+30] ;Disrupt_64.dll+50E3273 - 89 43 58 - mov [rbx+58],eax ;Disrupt_64.dll+50E3276 - 8B 83 E0150000 - mov eax,[rbx+000015E0] mov [g_cameraStructAddress], rbx mov rax, [rsp+20h] cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code. je exit ; our own camera is enabled, just skip the writes originalCode: mov [rbx+70h], rax ; write rotation angles around X and Y (pitch / roll, as Y is into the screen) mov eax, [rsp+28h] mov [rbx+78h],eax ; write rotation angle around Z (up) movss dword ptr [rbx+7Ch],xmm6 ; write FOV exit: jmp qword ptr [_cameraStructInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraStructInterceptor ENDP cameraWriteInterceptor PROC ; v1.13 ;Disrupt_64.dll+61D1A3B - 48 83 EC 28 - sub rsp,28 { 40 } ;Disrupt_64.dll+61D1A3F - 8B 02 - mov eax,[rdx] ;Disrupt_64.dll+61D1A41 - 4C 8D 41 64 - lea r8,[rcx+64] ;Disrupt_64.dll+61D1A45 - 41 89 00 - mov [r8],eax <<< INTERCEPT HERE <<<< X WRITE ;Disrupt_64.dll+61D1A48 - 8B 42 04 - mov eax,[rdx+04] ;Disrupt_64.dll+61D1A4B - 41 89 40 04 - mov [r8+04],eax <<<< Y WRITE ;Disrupt_64.dll+61D1A4F - 8B 42 08 - mov eax,[rdx+08] ;Disrupt_64.dll+61D1A52 - 41 89 40 08 - mov [r8+08],eax <<<< Z WRITE ;Disrupt_64.dll+61D1A56 - 48 8B 0D 7BB5D5FD - mov rcx,[Disrupt_64.dll+3F2CFD8] <<< CONTINUE HERE ;Disrupt_64.dll+61D1A5D - 48 85 C9 - test rcx,rcx ;Disrupt_64.dll+61D1A60 - 74 35 - je Disrupt_64.dll+61D1A97 ;Disrupt_64.dll+61D1A62 - F3 0F10 05 22A134FD - movss xmm0,[Disrupt_64.dll+351BB8C] ;Disrupt_64.dll+61D1A6A - F3 0F10 0D C2595CFD - movss xmm1,[Disrupt_64.dll+3797434] ;Disrupt_64.dll+61D1A72 - F3 0F10 15 0EFC29FD - movss xmm2,[Disrupt_64.dll+3471688] ;Disrupt_64.dll+61D1A7A - 4C 8D 4C 24 30 - lea r9,[rsp+30] ;Disrupt_64.dll+61D1A7F - 48 83 C1 78 - add rcx,78 { 120 } ;Disrupt_64.dll+61D1A83 - 4C 89 C2 - mov rdx,r8 ;Disrupt_64.dll+61D1A86 - F3 0F11 44 24 30 - movss [rsp+30],xmm0 ;Disrupt_64.dll+61D1A8C - F3 0F11 4C 24 34 - movss [rsp+34],xmm1 ;Disrupt_64.dll+61D1A92 - E8 89B02800 - call Disrupt_64.dll+645CB20 ;Disrupt_64.dll+61D1A97 - 48 83 C4 28 - add rsp,28 { 40 } ;Disrupt_64.dll+61D1A9B - C3 - ret ;v 1.11 ;Disrupt_64.dll+62F6F30 - 48 83 EC 28 - sub rsp,28 { 40 } ;Disrupt_64.dll+62F6F34 - 8B 02 - mov eax,[rdx] ;Disrupt_64.dll+62F6F36 - 4C 8D 41 64 - lea r8,[rcx+64] ;Disrupt_64.dll+62F6F3A - 41 89 00 - mov [r8],eax <<< INTERCEPT HERE <<<< X WRITE ;Disrupt_64.dll+62F6F3D - 8B 42 04 - mov eax,[rdx+04] ;Disrupt_64.dll+62F6F40 - 41 89 40 04 - mov [r8+04],eax <<<< Y WRITE ;Disrupt_64.dll+62F6F44 - 8B 42 08 - mov eax,[rdx+08] ;Disrupt_64.dll+62F6F47 - 41 89 40 08 - mov [r8+08],eax <<<< Z WRITE ;Disrupt_64.dll+62F6F4B - 48 8B 0D 564EB6FD - mov rcx,[Disrupt_64.dll+3E5BDA8] <<< CONTINUE HERE ;Disrupt_64.dll+62F6F52 - 48 85 C9 - test rcx,rcx ;Disrupt_64.dll+62F6F55 - 74 35 - je Disrupt_64.dll+62F6F8C ;Disrupt_64.dll+62F6F57 - F3 0F10 05 558416FD - movss xmm0,[Disrupt_64.dll+345F3B4] ;Disrupt_64.dll+62F6F5F - F3 0F10 0D C52B3DFD - movss xmm1,[Disrupt_64.dll+36C9B2C] ;Disrupt_64.dll+62F6F67 - F3 0F10 15 49EA0BFD - movss xmm2,[Disrupt_64.dll+33B59B8] ;Disrupt_64.dll+62F6F6F - 4C 8D 4C 24 30 - lea r9,[rsp+30] ;Disrupt_64.dll+62F6F74 - 48 83 C1 78 - add rcx,78 { 120 } ;Disrupt_64.dll+62F6F78 - 4C 89 C2 - mov rdx,r8 ;Disrupt_64.dll+62F6F7B - F3 0F11 44 24 30 - movss [rsp+30],xmm0 ;Disrupt_64.dll+62F6F81 - F3 0F11 4C 24 34 - movss [rsp+34],xmm1 ;Disrupt_64.dll+62F6F87 - E8 A4D72700 - call Disrupt_64.dll+6574730 ;Disrupt_64.dll+62F6F8C - 48 83 C4 28 - add rsp,28 { 40 } ;Disrupt_64.dll+62F6F90 - C3 - ret ; check for our coord target address. This code is used by multiple target structures cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code. je exit ; our own camera is enabled, just skip the writes originalCode: mov [r8],eax mov eax,[rdx+04h] mov [r8+04h],eax mov eax,[rdx+08h] mov [r8+08h],eax exit: jmp qword ptr [_cameraWriteInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWriteInterceptor ENDP gamespeedStructInterceptor PROC ;v1.13 ;Disrupt_64.dll+49BE533 - F2 0F5C 4B 20 - subsd xmm1,[rbx+20] ;Disrupt_64.dll+49BE538 - 74 0F - je Disrupt_64.dll+49BE549 ;Disrupt_64.dll+49BE53A - F2 0F10 0D FE51ABFE - movsd xmm1,[Disrupt_64.dll+3473740] ;Disrupt_64.dll+49BE542 - C6 83 9C000000 00 - mov byte ptr [rbx+0000009C],00 ;Disrupt_64.dll+49BE549 - 80 BB 9D000000 00 - cmp byte ptr [rbx+0000009D],00 ;Disrupt_64.dll+49BE550 - 75 11 - jne Disrupt_64.dll+49BE563 ;Disrupt_64.dll+49BE552 - F2 0F10 93 80000000 - movsd xmm2,[rbx+00000080] <<< INTERCEPT HERE <<<< READ GAME SPEED HERE. ;Disrupt_64.dll+49BE55A - 66 0F2F CA - comisd xmm1,xmm2 ;Disrupt_64.dll+49BE55E - 72 03 - jb Disrupt_64.dll+49BE563 ;Disrupt_64.dll+49BE560 - 0F28 CA - movaps xmm1,xmm2 ;Disrupt_64.dll+49BE563 - 80 BB 91000000 00 - cmp byte ptr [rbx+00000091],00 <<< CONTINUE HERE ;Disrupt_64.dll+49BE56A - F2 0F11 43 20 - movsd [rbx+20],xmm0 ;Disrupt_64.dll+49BE56F - 74 1A - je Disrupt_64.dll+49BE58B ;v1.11 ;Disrupt_64.dll+48E03B3 - F2 0F5C 4B 20 - subsd xmm1,[rbx+20] ;Disrupt_64.dll+48E03B8 - 74 0F - je Disrupt_64.dll+48E03C9 ;Disrupt_64.dll+48E03BA - F2 0F10 0D 4E76ADFE - movsd xmm1,[Disrupt_64.dll+33B7A10] ;Disrupt_64.dll+48E03C2 - C6 83 9C000000 00 - mov byte ptr [rbx+0000009C],00 ;Disrupt_64.dll+48E03C9 - 80 BB 9D000000 00 - cmp byte ptr [rbx+0000009D],00 ;Disrupt_64.dll+48E03D0 - 75 11 - jne Disrupt_64.dll+48E03E3 ;Disrupt_64.dll+48E03D2 - F2 0F10 93 80000000 - movsd xmm2,[rbx+00000080] <<< INTERCEPT HERE <<<< READ GAME SPEED HERE. ;Disrupt_64.dll+48E03DA - 66 0F2F CA - comisd xmm1,xmm2 ;Disrupt_64.dll+48E03DE - 72 03 - jb Disrupt_64.dll+48E03E3 ;Disrupt_64.dll+48E03E0 - 0F28 CA - movaps xmm1,xmm2 ;Disrupt_64.dll+48E03E3 - 80 BB 91000000 00 - cmp byte ptr [rbx+00000091],00 { 0 } <<< CONTINUE HERE ;Disrupt_64.dll+48E03EA - F2 0F11 43 20 - movsd [rbx+20],xmm0 ;Disrupt_64.dll+48E03EF - 74 1A - je Disrupt_64.dll+48E040B mov [g_gamespeedStructAddress], rbx movsd xmm2, qword ptr [rbx+00000080h] comisd xmm1,xmm2 jb exit movaps xmm1,xmm2 exit: jmp qword ptr [_gamespeedStructInterceptorContinue] ; jmp back into the original game code, which is the location after the original statements above. gamespeedStructInterceptor ENDP todStructInterceptor PROC ;v1.13 ;Disrupt_64.dll+5A1C23C - 4C 8D 4C 24 58 - lea r9,[rsp+58] ;Disrupt_64.dll+5A1C241 - 4C 8D 44 24 48 - lea r8,[rsp+48] ;Disrupt_64.dll+5A1C246 - 48 8B 08 - mov rcx,[rax] <<< INTERCEPT HERE. TOD READ ;Disrupt_64.dll+5A1C249 - 48 8D 54 24 50 - lea rdx,[rsp+50] ;Disrupt_64.dll+5A1C24E - 48 89 4C 24 20 - mov [rsp+20],rcx ;Disrupt_64.dll+5A1C253 - 48 8D 4C 24 20 - lea rcx,[rsp+20] ;Disrupt_64.dll+5A1C258 - E8 0312B300 - call Disrupt_64.dll+654D460 << CONTINUE HERE ;v1.11 ;Disrupt_64.dll+590DC79 - 4C 8D 4C 24 58 - lea r9,[rsp+58] ;Disrupt_64.dll+590DC7E - 4C 8D 44 24 48 - lea r8,[rsp+48] ;Disrupt_64.dll+590DC83 - 48 8B 08 - mov rcx,[rax] <<< INTERCEPT HERE. TOD READ ;Disrupt_64.dll+590DC86 - 48 8D 54 24 50 - lea rdx,[rsp+50] ;Disrupt_64.dll+590DC8B - 48 89 4C 24 20 - mov [rsp+20],rcx ;Disrupt_64.dll+590DC90 - 48 8D 4C 24 20 - lea rcx,[rsp+20] ;Disrupt_64.dll+590DC95 - E8 8950D500 - call Disrupt_64.dll+6662D23 << CONTINUE HERE ; mov [g_todStructAddress], rax originalCode: mov rcx,[rax] lea rdx,[rsp+50h] mov [rsp+20h],rcx lea rcx,[rsp+20h] exit: jmp qword ptr [_todStructInterceptorContinue] ; jmp back into the original game code, which is the location after the original statements above. todStructInterceptor ENDP hotsampleInterceptor PROC ;Disrupt_64.dll+6F052F0 - 44 8B B3 A0010000 - mov r14d,[rbx+000001A0] <<< INTERCEPT HERE <<< WIDTH READ OF FRAMEBUFFER (DWORD values) ;Disrupt_64.dll+6F052F7 - 8B AB A4010000 - mov ebp,[rbx+000001A4] <<< HEIGHT READ OF FRAMEBUFFER. ;Disrupt_64.dll+6F052FD - 48 8B 4E 08 - mov rcx,[rsi+08] ;Disrupt_64.dll+6F05301 - 48 85 C9 - test rcx,rcx <<< CONTINUE HERE ;Disrupt_64.dll+6F05304 - 0F84 42010000 - je Disrupt_64.dll+6F0544C ;Disrupt_64.dll+6F0530A - 48 8B 01 - mov rax,[rcx] push rax mov eax, [g_hotsampleFactor] mov r14d, dword ptr [rbx+000001A0h] ; read width mov ebp, dword ptr [rbx+000001A4h] ; read height cmp byte ptr [g_hotsampleEnabled], 1 jne originalCode ; hotsampling enabled. Multiply both registers with factor, using integer math imul r14d, eax imul ebp, eax originalCode: mov rcx, [rsi+08h] exit: pop rax jmp qword ptr [_hotsampleInterceptorContinue] ; jmp back into the original game code, which is the location after the original statements above. hotsampleInterceptor ENDP END
59.32872
171
0.646973
1307e2d67b0ccb82764d4a0dda425eccd3245172
249
asm
Assembly
libsrc/stdio_new/file/vscanf.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/stdio_new/file/vscanf.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/stdio_new/file/vscanf.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
; wrapper for function pointers PUBLIC vscanf EXTERN vfscanf_callee EXTERN ASMDISP_VFSCANF_CALLEE, _stdin .vscanf pop hl pop bc pop de push de push bc push hl ld ix,(_stdin) jp vfscanf_callee + ASMDISP_VFSCANF_CALLEE
13.105263
45
0.718876
fb5bcafa629956b9aeda04b31b158b8098fe5b18
178
asm
Assembly
libsrc/_DEVELOPMENT/z180/c/sccz80/z180_get_int_state.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/z180/c/sccz80/z180_get_int_state.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/z180/c/sccz80/z180_get_int_state.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; uint z180_get_int_state(void) SECTION code_clib SECTION code_z180 PUBLIC z180_get_int_state EXTERN asm_z180_get_int_state defc z180_get_int_state = asm_z180_get_int_state
14.833333
48
0.865169
4a9163d979c6599bf865203622f71e3ed9de34e9
1,983
asm
Assembly
python_src/other/export/screen_7_2.asm
fjpena/sword-of-ianna-msx2
f104f46a677e4b21f42fbed478307a0bb1d372f3
[ "Apache-2.0" ]
43
2017-10-21T23:01:25.000Z
2022-02-21T17:45:11.000Z
python_src/other/export/screen_7_2.asm
fjpena/sword-of-ianna-msx2
f104f46a677e4b21f42fbed478307a0bb1d372f3
[ "Apache-2.0" ]
null
null
null
python_src/other/export/screen_7_2.asm
fjpena/sword-of-ianna-msx2
f104f46a677e4b21f42fbed478307a0bb1d372f3
[ "Apache-2.0" ]
6
2017-10-23T05:48:50.000Z
2022-01-06T03:11:49.000Z
org $0000 ; Object types OBJECT_NONE EQU 0 OBJECT_SWITCH EQU 1 OBJECT_DOOR EQU 2 OBJECT_DOOR_DESTROY EQU 3 OBJECT_FLOOR_DESTROY EQU 4 OBJECT_WALL_DESTROY EQU 5 OBJECT_BOX_LEFT EQU 6 OBJECT_BOX_RIGHT EQU 7 OBJECT_JAR EQU 8 OBJECT_TELEPORTER EQU 9 ; Pickable object types OBJECT_KEY_GREEN EQU 11 OBJECT_KEY_BLUE EQU 12 OBJECT_KEY_YELLOW EQU 13 OBJECT_BREAD EQU 14 OBJECT_MEAT EQU 15 OBJECT_HEALTH EQU 16 OBJECT_KEY_RED EQU 17 OBJECT_KEY_WHITE EQU 18 OBJECT_KEY_PURPLE EQU 19 ; Object types for enemies OBJECT_ENEMY_SKELETON EQU 20 OBJECT_ENEMY_ORC EQU 21 OBJECT_ENEMY_MUMMY EQU 22 OBJECT_ENEMY_TROLL EQU 23 OBJECT_ENEMY_ROCK EQU 24 OBJECT_ENEMY_KNIGHT EQU 25 OBJECT_ENEMY_DALGURAK EQU 26 OBJECT_ENEMY_GOLEM EQU 27 OBJECT_ENEMY_OGRE EQU 28 OBJECT_ENEMY_MINOTAUR EQU 29 OBJECT_ENEMY_DEMON EQU 30 OBJECT_ENEMY_SECONDARY EQU 31 Screen_7_2: DB 101, 169, 170, 169, 170, 169, 170, 169, 170, 169, 170, 176, 169, 170, 252, 98 DB 0, 0, 145, 0, 0, 0, 0, 146, 0, 0, 0, 166, 0, 0, 70, 100 DB 0, 0, 0, 147, 0, 0, 0, 147, 0, 0, 0, 166, 0, 0, 146, 80 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 73, 176, 20, 0, 147, 82 DB 89, 90, 17, 16, 90, 20, 0, 0, 0, 0, 75, 176, 0, 0, 0, 98 DB 49, 50, 49, 50, 49, 147, 0, 0, 0, 0, 80, 176, 167, 167, 167, 22 DB 0, 0, 0, 0, 0, 0, 147, 0, 0, 21, 82, 83, 20, 0, 0, 23 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 0, 0, 0, 23 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 100, 101, 118, 0, 0, 24 DB 14, 15, 14, 15, 14, 14, 15, 14, 15, 15, 14, 15, 15, 14, 15, 15 HardScreen_7_2: DB 106, 170, 170, 165 DB 0, 0, 0, 1 DB 0, 0, 0, 1 DB 0, 0, 37, 129 DB 85, 96, 5, 1 DB 0, 0, 5, 1 DB 0, 0, 37, 129 DB 0, 0, 5, 1 DB 0, 0, 5, 1 DB 85, 85, 85, 85 Obj_7_2: DB 1 ; PLAYER DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY ENEMY DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY ENEMY DB 72, OBJECT_DOOR, 15, 5, 0, 71 DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
29.597015
80
0.667171
8f89e5908b7308839e9a47159825a234f7b78880
588
asm
Assembly
test/unittest_drawrectangle.asm
muellevin/RARS_Game_of_Life
45ce71ebce5cd9fa8371e0cb24541224c0e4ca46
[ "MIT" ]
1
2021-10-30T19:57:24.000Z
2021-10-30T19:57:24.000Z
test/unittest_drawrectangle.asm
muellevin/RARS_Game_of_Life
45ce71ebce5cd9fa8371e0cb24541224c0e4ca46
[ "MIT" ]
null
null
null
test/unittest_drawrectangle.asm
muellevin/RARS_Game_of_Life
45ce71ebce5cd9fa8371e0cb24541224c0e4ca46
[ "MIT" ]
null
null
null
# ___ ___ ___ ___ _ ___ ___ _____ _ _ ___ ___ # / __| __/ __| _ \ | | | __/ __|_ _| | | | _ \ __| # | (__| _|\__ \ _/ | |__| _| (__ | | | |_| | / _| # \___|___|___/_| |____|___\___| |_| \___/|_|_\___| # # Copyright 2021 Michael J. Klaiber .include "../src/constants_settings.asm" la t0, settings li t1, 256 sw t1, 12(t0) sw t1, 16(t0) li a3, 1 li a4, 1 li a5, 8 li a6, 9 li a7, 0x00ff00 jal draw_rectangle li a3, 100 li a4, 180 li a5, 140 li a6, 200 li a7, 0xffff00 jal draw_rectangle li a7,10 ecall .include "../src/exercise_solutions/draw_rectangle.asm"
16.333333
55
0.588435
167d9bd53c8de403980a3e9a9661e1b0a08ff84c
334
asm
Assembly
programs/oeis/058/A058161.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/058/A058161.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/058/A058161.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A058161: Number of labeled cyclic groups with a fixed identity. ; 1,1,1,3,6,60,120,1260,6720,90720,362880,9979200,39916800,1037836800,10897286400,163459296000,1307674368000,59281238016000,355687428096000,15205637551104000 mov $1,$0 cal $1,142 cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n. div $1,$0
41.75
157
0.775449
1e9819e05fd0cfeae9245c7939a1063ad186bf28
366
asm
Assembly
programs/oeis/194/A194066.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/194/A194066.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/194/A194066.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A194066: Natural fractal sequence of A087483; a rectangular array, by antidiagonals. ; 1,1,2,1,2,1,2,3,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,7,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,11,1 lpb $0 add $1,$2 add $1,1 sub $2,$1 add $0,$2 mod $2,2 lpe add $0,1
30.5
199
0.568306
750915a7b8a34da46a761e33188c465ffe82426c
6,698
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_601.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_601.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_601.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 %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x16db4, %r8 nop nop nop nop nop add $18367, %r12 movb (%r8), %cl nop nop nop nop and $39843, %r8 lea addresses_WC_ht+0x10744, %r10 cmp $41970, %rax movw $0x6162, (%r10) nop cmp %r8, %r8 lea addresses_WT_ht+0xe294, %rsi lea addresses_A_ht+0x16ea0, %rdi cmp $9539, %r10 mov $95, %rcx rep movsq nop nop nop sub %r12, %r12 lea addresses_D_ht+0x121b4, %rsi nop dec %rcx mov $0x6162636465666768, %r12 movq %r12, (%rsi) nop lfence lea addresses_UC_ht+0x19e5e, %r10 nop nop nop nop nop and %r12, %r12 movl $0x61626364, (%r10) nop nop nop xor $40398, %rax lea addresses_WC_ht+0x1a314, %r10 nop nop xor %rax, %rax mov $0x6162636465666768, %rsi movq %rsi, (%r10) nop nop nop nop nop add %rcx, %rcx lea addresses_WC_ht+0x1c8b4, %rsi lea addresses_A_ht+0x1a2b4, %rdi nop nop add $20779, %r8 mov $28, %rcx rep movsw nop nop dec %r8 lea addresses_UC_ht+0x1c7f4, %rax nop sub %rbx, %rbx movb $0x61, (%rax) nop nop nop nop cmp %r8, %r8 lea addresses_normal_ht+0x1e4f4, %r10 nop nop and %rax, %rax movl $0x61626364, (%r10) nop nop nop nop nop add %r8, %r8 lea addresses_A_ht+0x17db4, %r8 clflush (%r8) nop nop nop add $2050, %r12 mov $0x6162636465666768, %r10 movq %r10, %xmm3 and $0xffffffffffffffc0, %r8 vmovntdq %ymm3, (%r8) nop nop nop nop nop and %r8, %r8 lea addresses_D_ht+0x15e52, %rsi lea addresses_D_ht+0x139e4, %rdi nop nop nop nop nop sub %r12, %r12 mov $9, %rcx rep movsl nop nop nop nop nop xor %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r15 push %r9 push %rcx push %rdx // Faulty Load lea addresses_WC+0xadb4, %rcx nop inc %r15 mov (%rcx), %rdx lea oracles, %r15 and $0xff, %rdx shlq $12, %rdx mov (%r15,%rdx,1), %rdx pop %rdx pop %rcx pop %r9 pop %r15 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 10}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 3}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 8}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': True, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
35.62766
2,999
0.658853
62bbef02d704b0efa6009ecf9940f1d96720ec52
44,206
asm
Assembly
cat.asm
joeofportland/project4final
4140c7c9293205eb6dcdadb5c8ed537e8e5c2f59
[ "MIT-0" ]
null
null
null
cat.asm
joeofportland/project4final
4140c7c9293205eb6dcdadb5c8ed537e8e5c2f59
[ "MIT-0" ]
null
null
null
cat.asm
joeofportland/project4final
4140c7c9293205eb6dcdadb5c8ed537e8e5c2f59
[ "MIT-0" ]
null
null
null
_cat: file format elf32-i386 Disassembly of section .text: 00000000 <cat>: char buf[512]; void cat(int fd) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 28 sub $0x28,%esp int n; while((n = read(fd, buf, sizeof(buf))) > 0) 6: eb 1b jmp 23 <cat+0x23> write(1, buf, n); 8: 8b 45 f4 mov -0xc(%ebp),%eax b: 89 44 24 08 mov %eax,0x8(%esp) f: c7 44 24 04 e0 0b 00 movl $0xbe0,0x4(%esp) 16: 00 17: c7 04 24 01 00 00 00 movl $0x1,(%esp) 1e: e8 82 03 00 00 call 3a5 <write> void cat(int fd) { int n; while((n = read(fd, buf, sizeof(buf))) > 0) 23: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 2a: 00 2b: c7 44 24 04 e0 0b 00 movl $0xbe0,0x4(%esp) 32: 00 33: 8b 45 08 mov 0x8(%ebp),%eax 36: 89 04 24 mov %eax,(%esp) 39: e8 5f 03 00 00 call 39d <read> 3e: 89 45 f4 mov %eax,-0xc(%ebp) 41: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 45: 7f c1 jg 8 <cat+0x8> write(1, buf, n); if(n < 0){ 47: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4b: 79 19 jns 66 <cat+0x66> printf(1, "cat: read error\n"); 4d: c7 44 24 04 19 09 00 movl $0x919,0x4(%esp) 54: 00 55: c7 04 24 01 00 00 00 movl $0x1,(%esp) 5c: e8 ec 04 00 00 call 54d <printf> exit(); 61: e8 1f 03 00 00 call 385 <exit> } } 66: c9 leave 67: c3 ret 00000068 <main>: int main(int argc, char *argv[]) { 68: 55 push %ebp 69: 89 e5 mov %esp,%ebp 6b: 83 e4 f0 and $0xfffffff0,%esp 6e: 83 ec 20 sub $0x20,%esp int fd, i; if(argc <= 1){ 71: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 75: 7f 11 jg 88 <main+0x20> cat(0); 77: c7 04 24 00 00 00 00 movl $0x0,(%esp) 7e: e8 7d ff ff ff call 0 <cat> exit(); 83: e8 fd 02 00 00 call 385 <exit> } for(i = 1; i < argc; i++){ 88: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp) 8f: 00 90: eb 79 jmp 10b <main+0xa3> if((fd = open(argv[i], 0)) < 0){ 92: 8b 44 24 1c mov 0x1c(%esp),%eax 96: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 9d: 8b 45 0c mov 0xc(%ebp),%eax a0: 01 d0 add %edx,%eax a2: 8b 00 mov (%eax),%eax a4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) ab: 00 ac: 89 04 24 mov %eax,(%esp) af: e8 11 03 00 00 call 3c5 <open> b4: 89 44 24 18 mov %eax,0x18(%esp) b8: 83 7c 24 18 00 cmpl $0x0,0x18(%esp) bd: 79 2f jns ee <main+0x86> printf(1, "cat: cannot open %s\n", argv[i]); bf: 8b 44 24 1c mov 0x1c(%esp),%eax c3: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx ca: 8b 45 0c mov 0xc(%ebp),%eax cd: 01 d0 add %edx,%eax cf: 8b 00 mov (%eax),%eax d1: 89 44 24 08 mov %eax,0x8(%esp) d5: c7 44 24 04 2a 09 00 movl $0x92a,0x4(%esp) dc: 00 dd: c7 04 24 01 00 00 00 movl $0x1,(%esp) e4: e8 64 04 00 00 call 54d <printf> exit(); e9: e8 97 02 00 00 call 385 <exit> } cat(fd); ee: 8b 44 24 18 mov 0x18(%esp),%eax f2: 89 04 24 mov %eax,(%esp) f5: e8 06 ff ff ff call 0 <cat> close(fd); fa: 8b 44 24 18 mov 0x18(%esp),%eax fe: 89 04 24 mov %eax,(%esp) 101: e8 a7 02 00 00 call 3ad <close> if(argc <= 1){ cat(0); exit(); } for(i = 1; i < argc; i++){ 106: 83 44 24 1c 01 addl $0x1,0x1c(%esp) 10b: 8b 44 24 1c mov 0x1c(%esp),%eax 10f: 3b 45 08 cmp 0x8(%ebp),%eax 112: 0f 8c 7a ff ff ff jl 92 <main+0x2a> exit(); } cat(fd); close(fd); } exit(); 118: e8 68 02 00 00 call 385 <exit> 0000011d <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 11d: 55 push %ebp 11e: 89 e5 mov %esp,%ebp 120: 57 push %edi 121: 53 push %ebx asm volatile("cld; rep stosb" : 122: 8b 4d 08 mov 0x8(%ebp),%ecx 125: 8b 55 10 mov 0x10(%ebp),%edx 128: 8b 45 0c mov 0xc(%ebp),%eax 12b: 89 cb mov %ecx,%ebx 12d: 89 df mov %ebx,%edi 12f: 89 d1 mov %edx,%ecx 131: fc cld 132: f3 aa rep stos %al,%es:(%edi) 134: 89 ca mov %ecx,%edx 136: 89 fb mov %edi,%ebx 138: 89 5d 08 mov %ebx,0x8(%ebp) 13b: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 13e: 5b pop %ebx 13f: 5f pop %edi 140: 5d pop %ebp 141: c3 ret 00000142 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 142: 55 push %ebp 143: 89 e5 mov %esp,%ebp 145: 83 ec 10 sub $0x10,%esp char *os; os = s; 148: 8b 45 08 mov 0x8(%ebp),%eax 14b: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 14e: 90 nop 14f: 8b 45 08 mov 0x8(%ebp),%eax 152: 8d 50 01 lea 0x1(%eax),%edx 155: 89 55 08 mov %edx,0x8(%ebp) 158: 8b 55 0c mov 0xc(%ebp),%edx 15b: 8d 4a 01 lea 0x1(%edx),%ecx 15e: 89 4d 0c mov %ecx,0xc(%ebp) 161: 0f b6 12 movzbl (%edx),%edx 164: 88 10 mov %dl,(%eax) 166: 0f b6 00 movzbl (%eax),%eax 169: 84 c0 test %al,%al 16b: 75 e2 jne 14f <strcpy+0xd> ; return os; 16d: 8b 45 fc mov -0x4(%ebp),%eax } 170: c9 leave 171: c3 ret 00000172 <strcmp>: int strcmp(const char *p, const char *q) { 172: 55 push %ebp 173: 89 e5 mov %esp,%ebp while(*p && *p == *q) 175: eb 08 jmp 17f <strcmp+0xd> p++, q++; 177: 83 45 08 01 addl $0x1,0x8(%ebp) 17b: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 17f: 8b 45 08 mov 0x8(%ebp),%eax 182: 0f b6 00 movzbl (%eax),%eax 185: 84 c0 test %al,%al 187: 74 10 je 199 <strcmp+0x27> 189: 8b 45 08 mov 0x8(%ebp),%eax 18c: 0f b6 10 movzbl (%eax),%edx 18f: 8b 45 0c mov 0xc(%ebp),%eax 192: 0f b6 00 movzbl (%eax),%eax 195: 38 c2 cmp %al,%dl 197: 74 de je 177 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 199: 8b 45 08 mov 0x8(%ebp),%eax 19c: 0f b6 00 movzbl (%eax),%eax 19f: 0f b6 d0 movzbl %al,%edx 1a2: 8b 45 0c mov 0xc(%ebp),%eax 1a5: 0f b6 00 movzbl (%eax),%eax 1a8: 0f b6 c0 movzbl %al,%eax 1ab: 29 c2 sub %eax,%edx 1ad: 89 d0 mov %edx,%eax } 1af: 5d pop %ebp 1b0: c3 ret 000001b1 <strlen>: uint strlen(char *s) { 1b1: 55 push %ebp 1b2: 89 e5 mov %esp,%ebp 1b4: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1b7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1be: eb 04 jmp 1c4 <strlen+0x13> 1c0: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1c4: 8b 55 fc mov -0x4(%ebp),%edx 1c7: 8b 45 08 mov 0x8(%ebp),%eax 1ca: 01 d0 add %edx,%eax 1cc: 0f b6 00 movzbl (%eax),%eax 1cf: 84 c0 test %al,%al 1d1: 75 ed jne 1c0 <strlen+0xf> ; return n; 1d3: 8b 45 fc mov -0x4(%ebp),%eax } 1d6: c9 leave 1d7: c3 ret 000001d8 <memset>: void* memset(void *dst, int c, uint n) { 1d8: 55 push %ebp 1d9: 89 e5 mov %esp,%ebp 1db: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 1de: 8b 45 10 mov 0x10(%ebp),%eax 1e1: 89 44 24 08 mov %eax,0x8(%esp) 1e5: 8b 45 0c mov 0xc(%ebp),%eax 1e8: 89 44 24 04 mov %eax,0x4(%esp) 1ec: 8b 45 08 mov 0x8(%ebp),%eax 1ef: 89 04 24 mov %eax,(%esp) 1f2: e8 26 ff ff ff call 11d <stosb> return dst; 1f7: 8b 45 08 mov 0x8(%ebp),%eax } 1fa: c9 leave 1fb: c3 ret 000001fc <strchr>: char* strchr(const char *s, char c) { 1fc: 55 push %ebp 1fd: 89 e5 mov %esp,%ebp 1ff: 83 ec 04 sub $0x4,%esp 202: 8b 45 0c mov 0xc(%ebp),%eax 205: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 208: eb 14 jmp 21e <strchr+0x22> if(*s == c) 20a: 8b 45 08 mov 0x8(%ebp),%eax 20d: 0f b6 00 movzbl (%eax),%eax 210: 3a 45 fc cmp -0x4(%ebp),%al 213: 75 05 jne 21a <strchr+0x1e> return (char*)s; 215: 8b 45 08 mov 0x8(%ebp),%eax 218: eb 13 jmp 22d <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 21a: 83 45 08 01 addl $0x1,0x8(%ebp) 21e: 8b 45 08 mov 0x8(%ebp),%eax 221: 0f b6 00 movzbl (%eax),%eax 224: 84 c0 test %al,%al 226: 75 e2 jne 20a <strchr+0xe> if(*s == c) return (char*)s; return 0; 228: b8 00 00 00 00 mov $0x0,%eax } 22d: c9 leave 22e: c3 ret 0000022f <gets>: char* gets(char *buf, int max) { 22f: 55 push %ebp 230: 89 e5 mov %esp,%ebp 232: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 235: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 23c: eb 4c jmp 28a <gets+0x5b> cc = read(0, &c, 1); 23e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 245: 00 246: 8d 45 ef lea -0x11(%ebp),%eax 249: 89 44 24 04 mov %eax,0x4(%esp) 24d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 254: e8 44 01 00 00 call 39d <read> 259: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 25c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 260: 7f 02 jg 264 <gets+0x35> break; 262: eb 31 jmp 295 <gets+0x66> buf[i++] = c; 264: 8b 45 f4 mov -0xc(%ebp),%eax 267: 8d 50 01 lea 0x1(%eax),%edx 26a: 89 55 f4 mov %edx,-0xc(%ebp) 26d: 89 c2 mov %eax,%edx 26f: 8b 45 08 mov 0x8(%ebp),%eax 272: 01 c2 add %eax,%edx 274: 0f b6 45 ef movzbl -0x11(%ebp),%eax 278: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 27a: 0f b6 45 ef movzbl -0x11(%ebp),%eax 27e: 3c 0a cmp $0xa,%al 280: 74 13 je 295 <gets+0x66> 282: 0f b6 45 ef movzbl -0x11(%ebp),%eax 286: 3c 0d cmp $0xd,%al 288: 74 0b je 295 <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 28a: 8b 45 f4 mov -0xc(%ebp),%eax 28d: 83 c0 01 add $0x1,%eax 290: 3b 45 0c cmp 0xc(%ebp),%eax 293: 7c a9 jl 23e <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 295: 8b 55 f4 mov -0xc(%ebp),%edx 298: 8b 45 08 mov 0x8(%ebp),%eax 29b: 01 d0 add %edx,%eax 29d: c6 00 00 movb $0x0,(%eax) return buf; 2a0: 8b 45 08 mov 0x8(%ebp),%eax } 2a3: c9 leave 2a4: c3 ret 000002a5 <stat>: int stat(char *n, struct stat *st) { 2a5: 55 push %ebp 2a6: 89 e5 mov %esp,%ebp 2a8: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 2ab: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 2b2: 00 2b3: 8b 45 08 mov 0x8(%ebp),%eax 2b6: 89 04 24 mov %eax,(%esp) 2b9: e8 07 01 00 00 call 3c5 <open> 2be: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 2c1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 2c5: 79 07 jns 2ce <stat+0x29> return -1; 2c7: b8 ff ff ff ff mov $0xffffffff,%eax 2cc: eb 23 jmp 2f1 <stat+0x4c> r = fstat(fd, st); 2ce: 8b 45 0c mov 0xc(%ebp),%eax 2d1: 89 44 24 04 mov %eax,0x4(%esp) 2d5: 8b 45 f4 mov -0xc(%ebp),%eax 2d8: 89 04 24 mov %eax,(%esp) 2db: e8 fd 00 00 00 call 3dd <fstat> 2e0: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 2e3: 8b 45 f4 mov -0xc(%ebp),%eax 2e6: 89 04 24 mov %eax,(%esp) 2e9: e8 bf 00 00 00 call 3ad <close> return r; 2ee: 8b 45 f0 mov -0x10(%ebp),%eax } 2f1: c9 leave 2f2: c3 ret 000002f3 <atoi>: int atoi(const char *s) { 2f3: 55 push %ebp 2f4: 89 e5 mov %esp,%ebp 2f6: 83 ec 10 sub $0x10,%esp int n; n = 0; 2f9: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 300: eb 25 jmp 327 <atoi+0x34> n = n*10 + *s++ - '0'; 302: 8b 55 fc mov -0x4(%ebp),%edx 305: 89 d0 mov %edx,%eax 307: c1 e0 02 shl $0x2,%eax 30a: 01 d0 add %edx,%eax 30c: 01 c0 add %eax,%eax 30e: 89 c1 mov %eax,%ecx 310: 8b 45 08 mov 0x8(%ebp),%eax 313: 8d 50 01 lea 0x1(%eax),%edx 316: 89 55 08 mov %edx,0x8(%ebp) 319: 0f b6 00 movzbl (%eax),%eax 31c: 0f be c0 movsbl %al,%eax 31f: 01 c8 add %ecx,%eax 321: 83 e8 30 sub $0x30,%eax 324: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 327: 8b 45 08 mov 0x8(%ebp),%eax 32a: 0f b6 00 movzbl (%eax),%eax 32d: 3c 2f cmp $0x2f,%al 32f: 7e 0a jle 33b <atoi+0x48> 331: 8b 45 08 mov 0x8(%ebp),%eax 334: 0f b6 00 movzbl (%eax),%eax 337: 3c 39 cmp $0x39,%al 339: 7e c7 jle 302 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 33b: 8b 45 fc mov -0x4(%ebp),%eax } 33e: c9 leave 33f: c3 ret 00000340 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 340: 55 push %ebp 341: 89 e5 mov %esp,%ebp 343: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 346: 8b 45 08 mov 0x8(%ebp),%eax 349: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 34c: 8b 45 0c mov 0xc(%ebp),%eax 34f: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 352: eb 17 jmp 36b <memmove+0x2b> *dst++ = *src++; 354: 8b 45 fc mov -0x4(%ebp),%eax 357: 8d 50 01 lea 0x1(%eax),%edx 35a: 89 55 fc mov %edx,-0x4(%ebp) 35d: 8b 55 f8 mov -0x8(%ebp),%edx 360: 8d 4a 01 lea 0x1(%edx),%ecx 363: 89 4d f8 mov %ecx,-0x8(%ebp) 366: 0f b6 12 movzbl (%edx),%edx 369: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 36b: 8b 45 10 mov 0x10(%ebp),%eax 36e: 8d 50 ff lea -0x1(%eax),%edx 371: 89 55 10 mov %edx,0x10(%ebp) 374: 85 c0 test %eax,%eax 376: 7f dc jg 354 <memmove+0x14> *dst++ = *src++; return vdst; 378: 8b 45 08 mov 0x8(%ebp),%eax } 37b: c9 leave 37c: c3 ret 0000037d <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 37d: b8 01 00 00 00 mov $0x1,%eax 382: cd 40 int $0x40 384: c3 ret 00000385 <exit>: SYSCALL(exit) 385: b8 02 00 00 00 mov $0x2,%eax 38a: cd 40 int $0x40 38c: c3 ret 0000038d <wait>: SYSCALL(wait) 38d: b8 03 00 00 00 mov $0x3,%eax 392: cd 40 int $0x40 394: c3 ret 00000395 <pipe>: SYSCALL(pipe) 395: b8 04 00 00 00 mov $0x4,%eax 39a: cd 40 int $0x40 39c: c3 ret 0000039d <read>: SYSCALL(read) 39d: b8 05 00 00 00 mov $0x5,%eax 3a2: cd 40 int $0x40 3a4: c3 ret 000003a5 <write>: SYSCALL(write) 3a5: b8 10 00 00 00 mov $0x10,%eax 3aa: cd 40 int $0x40 3ac: c3 ret 000003ad <close>: SYSCALL(close) 3ad: b8 15 00 00 00 mov $0x15,%eax 3b2: cd 40 int $0x40 3b4: c3 ret 000003b5 <kill>: SYSCALL(kill) 3b5: b8 06 00 00 00 mov $0x6,%eax 3ba: cd 40 int $0x40 3bc: c3 ret 000003bd <exec>: SYSCALL(exec) 3bd: b8 07 00 00 00 mov $0x7,%eax 3c2: cd 40 int $0x40 3c4: c3 ret 000003c5 <open>: SYSCALL(open) 3c5: b8 0f 00 00 00 mov $0xf,%eax 3ca: cd 40 int $0x40 3cc: c3 ret 000003cd <mknod>: SYSCALL(mknod) 3cd: b8 11 00 00 00 mov $0x11,%eax 3d2: cd 40 int $0x40 3d4: c3 ret 000003d5 <unlink>: SYSCALL(unlink) 3d5: b8 12 00 00 00 mov $0x12,%eax 3da: cd 40 int $0x40 3dc: c3 ret 000003dd <fstat>: SYSCALL(fstat) 3dd: b8 08 00 00 00 mov $0x8,%eax 3e2: cd 40 int $0x40 3e4: c3 ret 000003e5 <link>: SYSCALL(link) 3e5: b8 13 00 00 00 mov $0x13,%eax 3ea: cd 40 int $0x40 3ec: c3 ret 000003ed <mkdir>: SYSCALL(mkdir) 3ed: b8 14 00 00 00 mov $0x14,%eax 3f2: cd 40 int $0x40 3f4: c3 ret 000003f5 <chdir>: SYSCALL(chdir) 3f5: b8 09 00 00 00 mov $0x9,%eax 3fa: cd 40 int $0x40 3fc: c3 ret 000003fd <dup>: SYSCALL(dup) 3fd: b8 0a 00 00 00 mov $0xa,%eax 402: cd 40 int $0x40 404: c3 ret 00000405 <getpid>: SYSCALL(getpid) 405: b8 0b 00 00 00 mov $0xb,%eax 40a: cd 40 int $0x40 40c: c3 ret 0000040d <sbrk>: SYSCALL(sbrk) 40d: b8 0c 00 00 00 mov $0xc,%eax 412: cd 40 int $0x40 414: c3 ret 00000415 <sleep>: SYSCALL(sleep) 415: b8 0d 00 00 00 mov $0xd,%eax 41a: cd 40 int $0x40 41c: c3 ret 0000041d <uptime>: SYSCALL(uptime) 41d: b8 0e 00 00 00 mov $0xe,%eax 422: cd 40 int $0x40 424: c3 ret 00000425 <date>: SYSCALL(date) 425: b8 16 00 00 00 mov $0x16,%eax 42a: cd 40 int $0x40 42c: c3 ret 0000042d <timem>: SYSCALL(timem) 42d: b8 17 00 00 00 mov $0x17,%eax 432: cd 40 int $0x40 434: c3 ret 00000435 <getuid>: SYSCALL(getuid) 435: b8 18 00 00 00 mov $0x18,%eax 43a: cd 40 int $0x40 43c: c3 ret 0000043d <getgid>: SYSCALL(getgid) 43d: b8 19 00 00 00 mov $0x19,%eax 442: cd 40 int $0x40 444: c3 ret 00000445 <getppid>: SYSCALL(getppid) 445: b8 1a 00 00 00 mov $0x1a,%eax 44a: cd 40 int $0x40 44c: c3 ret 0000044d <setuid>: SYSCALL(setuid) 44d: b8 1b 00 00 00 mov $0x1b,%eax 452: cd 40 int $0x40 454: c3 ret 00000455 <setgid>: SYSCALL(setgid) 455: b8 1c 00 00 00 mov $0x1c,%eax 45a: cd 40 int $0x40 45c: c3 ret 0000045d <getprocs>: SYSCALL(getprocs) 45d: b8 1d 00 00 00 mov $0x1d,%eax 462: cd 40 int $0x40 464: c3 ret 00000465 <setpriority>: SYSCALL(setpriority) 465: b8 1e 00 00 00 mov $0x1e,%eax 46a: cd 40 int $0x40 46c: c3 ret 0000046d <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 46d: 55 push %ebp 46e: 89 e5 mov %esp,%ebp 470: 83 ec 18 sub $0x18,%esp 473: 8b 45 0c mov 0xc(%ebp),%eax 476: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 479: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 480: 00 481: 8d 45 f4 lea -0xc(%ebp),%eax 484: 89 44 24 04 mov %eax,0x4(%esp) 488: 8b 45 08 mov 0x8(%ebp),%eax 48b: 89 04 24 mov %eax,(%esp) 48e: e8 12 ff ff ff call 3a5 <write> } 493: c9 leave 494: c3 ret 00000495 <printint>: static void printint(int fd, int xx, int base, int sgn) { 495: 55 push %ebp 496: 89 e5 mov %esp,%ebp 498: 56 push %esi 499: 53 push %ebx 49a: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 49d: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 4a4: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 4a8: 74 17 je 4c1 <printint+0x2c> 4aa: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 4ae: 79 11 jns 4c1 <printint+0x2c> neg = 1; 4b0: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 4b7: 8b 45 0c mov 0xc(%ebp),%eax 4ba: f7 d8 neg %eax 4bc: 89 45 ec mov %eax,-0x14(%ebp) 4bf: eb 06 jmp 4c7 <printint+0x32> } else { x = xx; 4c1: 8b 45 0c mov 0xc(%ebp),%eax 4c4: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 4c7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 4ce: 8b 4d f4 mov -0xc(%ebp),%ecx 4d1: 8d 41 01 lea 0x1(%ecx),%eax 4d4: 89 45 f4 mov %eax,-0xc(%ebp) 4d7: 8b 5d 10 mov 0x10(%ebp),%ebx 4da: 8b 45 ec mov -0x14(%ebp),%eax 4dd: ba 00 00 00 00 mov $0x0,%edx 4e2: f7 f3 div %ebx 4e4: 89 d0 mov %edx,%eax 4e6: 0f b6 80 ac 0b 00 00 movzbl 0xbac(%eax),%eax 4ed: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 4f1: 8b 75 10 mov 0x10(%ebp),%esi 4f4: 8b 45 ec mov -0x14(%ebp),%eax 4f7: ba 00 00 00 00 mov $0x0,%edx 4fc: f7 f6 div %esi 4fe: 89 45 ec mov %eax,-0x14(%ebp) 501: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 505: 75 c7 jne 4ce <printint+0x39> if(neg) 507: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 50b: 74 10 je 51d <printint+0x88> buf[i++] = '-'; 50d: 8b 45 f4 mov -0xc(%ebp),%eax 510: 8d 50 01 lea 0x1(%eax),%edx 513: 89 55 f4 mov %edx,-0xc(%ebp) 516: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 51b: eb 1f jmp 53c <printint+0xa7> 51d: eb 1d jmp 53c <printint+0xa7> putc(fd, buf[i]); 51f: 8d 55 dc lea -0x24(%ebp),%edx 522: 8b 45 f4 mov -0xc(%ebp),%eax 525: 01 d0 add %edx,%eax 527: 0f b6 00 movzbl (%eax),%eax 52a: 0f be c0 movsbl %al,%eax 52d: 89 44 24 04 mov %eax,0x4(%esp) 531: 8b 45 08 mov 0x8(%ebp),%eax 534: 89 04 24 mov %eax,(%esp) 537: e8 31 ff ff ff call 46d <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 53c: 83 6d f4 01 subl $0x1,-0xc(%ebp) 540: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 544: 79 d9 jns 51f <printint+0x8a> putc(fd, buf[i]); } 546: 83 c4 30 add $0x30,%esp 549: 5b pop %ebx 54a: 5e pop %esi 54b: 5d pop %ebp 54c: c3 ret 0000054d <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 54d: 55 push %ebp 54e: 89 e5 mov %esp,%ebp 550: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 553: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 55a: 8d 45 0c lea 0xc(%ebp),%eax 55d: 83 c0 04 add $0x4,%eax 560: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 563: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 56a: e9 7c 01 00 00 jmp 6eb <printf+0x19e> c = fmt[i] & 0xff; 56f: 8b 55 0c mov 0xc(%ebp),%edx 572: 8b 45 f0 mov -0x10(%ebp),%eax 575: 01 d0 add %edx,%eax 577: 0f b6 00 movzbl (%eax),%eax 57a: 0f be c0 movsbl %al,%eax 57d: 25 ff 00 00 00 and $0xff,%eax 582: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 585: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 589: 75 2c jne 5b7 <printf+0x6a> if(c == '%'){ 58b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 58f: 75 0c jne 59d <printf+0x50> state = '%'; 591: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 598: e9 4a 01 00 00 jmp 6e7 <printf+0x19a> } else { putc(fd, c); 59d: 8b 45 e4 mov -0x1c(%ebp),%eax 5a0: 0f be c0 movsbl %al,%eax 5a3: 89 44 24 04 mov %eax,0x4(%esp) 5a7: 8b 45 08 mov 0x8(%ebp),%eax 5aa: 89 04 24 mov %eax,(%esp) 5ad: e8 bb fe ff ff call 46d <putc> 5b2: e9 30 01 00 00 jmp 6e7 <printf+0x19a> } } else if(state == '%'){ 5b7: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 5bb: 0f 85 26 01 00 00 jne 6e7 <printf+0x19a> if(c == 'd'){ 5c1: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 5c5: 75 2d jne 5f4 <printf+0xa7> printint(fd, *ap, 10, 1); 5c7: 8b 45 e8 mov -0x18(%ebp),%eax 5ca: 8b 00 mov (%eax),%eax 5cc: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 5d3: 00 5d4: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 5db: 00 5dc: 89 44 24 04 mov %eax,0x4(%esp) 5e0: 8b 45 08 mov 0x8(%ebp),%eax 5e3: 89 04 24 mov %eax,(%esp) 5e6: e8 aa fe ff ff call 495 <printint> ap++; 5eb: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5ef: e9 ec 00 00 00 jmp 6e0 <printf+0x193> } else if(c == 'x' || c == 'p'){ 5f4: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 5f8: 74 06 je 600 <printf+0xb3> 5fa: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 5fe: 75 2d jne 62d <printf+0xe0> printint(fd, *ap, 16, 0); 600: 8b 45 e8 mov -0x18(%ebp),%eax 603: 8b 00 mov (%eax),%eax 605: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 60c: 00 60d: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 614: 00 615: 89 44 24 04 mov %eax,0x4(%esp) 619: 8b 45 08 mov 0x8(%ebp),%eax 61c: 89 04 24 mov %eax,(%esp) 61f: e8 71 fe ff ff call 495 <printint> ap++; 624: 83 45 e8 04 addl $0x4,-0x18(%ebp) 628: e9 b3 00 00 00 jmp 6e0 <printf+0x193> } else if(c == 's'){ 62d: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 631: 75 45 jne 678 <printf+0x12b> s = (char*)*ap; 633: 8b 45 e8 mov -0x18(%ebp),%eax 636: 8b 00 mov (%eax),%eax 638: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 63b: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 63f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 643: 75 09 jne 64e <printf+0x101> s = "(null)"; 645: c7 45 f4 3f 09 00 00 movl $0x93f,-0xc(%ebp) while(*s != 0){ 64c: eb 1e jmp 66c <printf+0x11f> 64e: eb 1c jmp 66c <printf+0x11f> putc(fd, *s); 650: 8b 45 f4 mov -0xc(%ebp),%eax 653: 0f b6 00 movzbl (%eax),%eax 656: 0f be c0 movsbl %al,%eax 659: 89 44 24 04 mov %eax,0x4(%esp) 65d: 8b 45 08 mov 0x8(%ebp),%eax 660: 89 04 24 mov %eax,(%esp) 663: e8 05 fe ff ff call 46d <putc> s++; 668: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 66c: 8b 45 f4 mov -0xc(%ebp),%eax 66f: 0f b6 00 movzbl (%eax),%eax 672: 84 c0 test %al,%al 674: 75 da jne 650 <printf+0x103> 676: eb 68 jmp 6e0 <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ 678: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 67c: 75 1d jne 69b <printf+0x14e> putc(fd, *ap); 67e: 8b 45 e8 mov -0x18(%ebp),%eax 681: 8b 00 mov (%eax),%eax 683: 0f be c0 movsbl %al,%eax 686: 89 44 24 04 mov %eax,0x4(%esp) 68a: 8b 45 08 mov 0x8(%ebp),%eax 68d: 89 04 24 mov %eax,(%esp) 690: e8 d8 fd ff ff call 46d <putc> ap++; 695: 83 45 e8 04 addl $0x4,-0x18(%ebp) 699: eb 45 jmp 6e0 <printf+0x193> } else if(c == '%'){ 69b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 69f: 75 17 jne 6b8 <printf+0x16b> putc(fd, c); 6a1: 8b 45 e4 mov -0x1c(%ebp),%eax 6a4: 0f be c0 movsbl %al,%eax 6a7: 89 44 24 04 mov %eax,0x4(%esp) 6ab: 8b 45 08 mov 0x8(%ebp),%eax 6ae: 89 04 24 mov %eax,(%esp) 6b1: e8 b7 fd ff ff call 46d <putc> 6b6: eb 28 jmp 6e0 <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 6b8: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 6bf: 00 6c0: 8b 45 08 mov 0x8(%ebp),%eax 6c3: 89 04 24 mov %eax,(%esp) 6c6: e8 a2 fd ff ff call 46d <putc> putc(fd, c); 6cb: 8b 45 e4 mov -0x1c(%ebp),%eax 6ce: 0f be c0 movsbl %al,%eax 6d1: 89 44 24 04 mov %eax,0x4(%esp) 6d5: 8b 45 08 mov 0x8(%ebp),%eax 6d8: 89 04 24 mov %eax,(%esp) 6db: e8 8d fd ff ff call 46d <putc> } state = 0; 6e0: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 6e7: 83 45 f0 01 addl $0x1,-0x10(%ebp) 6eb: 8b 55 0c mov 0xc(%ebp),%edx 6ee: 8b 45 f0 mov -0x10(%ebp),%eax 6f1: 01 d0 add %edx,%eax 6f3: 0f b6 00 movzbl (%eax),%eax 6f6: 84 c0 test %al,%al 6f8: 0f 85 71 fe ff ff jne 56f <printf+0x22> putc(fd, c); } state = 0; } } } 6fe: c9 leave 6ff: c3 ret 00000700 <free>: static Header base; static Header *freep; void free(void *ap) { 700: 55 push %ebp 701: 89 e5 mov %esp,%ebp 703: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 706: 8b 45 08 mov 0x8(%ebp),%eax 709: 83 e8 08 sub $0x8,%eax 70c: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 70f: a1 c8 0b 00 00 mov 0xbc8,%eax 714: 89 45 fc mov %eax,-0x4(%ebp) 717: eb 24 jmp 73d <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 719: 8b 45 fc mov -0x4(%ebp),%eax 71c: 8b 00 mov (%eax),%eax 71e: 3b 45 fc cmp -0x4(%ebp),%eax 721: 77 12 ja 735 <free+0x35> 723: 8b 45 f8 mov -0x8(%ebp),%eax 726: 3b 45 fc cmp -0x4(%ebp),%eax 729: 77 24 ja 74f <free+0x4f> 72b: 8b 45 fc mov -0x4(%ebp),%eax 72e: 8b 00 mov (%eax),%eax 730: 3b 45 f8 cmp -0x8(%ebp),%eax 733: 77 1a ja 74f <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 735: 8b 45 fc mov -0x4(%ebp),%eax 738: 8b 00 mov (%eax),%eax 73a: 89 45 fc mov %eax,-0x4(%ebp) 73d: 8b 45 f8 mov -0x8(%ebp),%eax 740: 3b 45 fc cmp -0x4(%ebp),%eax 743: 76 d4 jbe 719 <free+0x19> 745: 8b 45 fc mov -0x4(%ebp),%eax 748: 8b 00 mov (%eax),%eax 74a: 3b 45 f8 cmp -0x8(%ebp),%eax 74d: 76 ca jbe 719 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 74f: 8b 45 f8 mov -0x8(%ebp),%eax 752: 8b 40 04 mov 0x4(%eax),%eax 755: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 75c: 8b 45 f8 mov -0x8(%ebp),%eax 75f: 01 c2 add %eax,%edx 761: 8b 45 fc mov -0x4(%ebp),%eax 764: 8b 00 mov (%eax),%eax 766: 39 c2 cmp %eax,%edx 768: 75 24 jne 78e <free+0x8e> bp->s.size += p->s.ptr->s.size; 76a: 8b 45 f8 mov -0x8(%ebp),%eax 76d: 8b 50 04 mov 0x4(%eax),%edx 770: 8b 45 fc mov -0x4(%ebp),%eax 773: 8b 00 mov (%eax),%eax 775: 8b 40 04 mov 0x4(%eax),%eax 778: 01 c2 add %eax,%edx 77a: 8b 45 f8 mov -0x8(%ebp),%eax 77d: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 780: 8b 45 fc mov -0x4(%ebp),%eax 783: 8b 00 mov (%eax),%eax 785: 8b 10 mov (%eax),%edx 787: 8b 45 f8 mov -0x8(%ebp),%eax 78a: 89 10 mov %edx,(%eax) 78c: eb 0a jmp 798 <free+0x98> } else bp->s.ptr = p->s.ptr; 78e: 8b 45 fc mov -0x4(%ebp),%eax 791: 8b 10 mov (%eax),%edx 793: 8b 45 f8 mov -0x8(%ebp),%eax 796: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 798: 8b 45 fc mov -0x4(%ebp),%eax 79b: 8b 40 04 mov 0x4(%eax),%eax 79e: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 7a5: 8b 45 fc mov -0x4(%ebp),%eax 7a8: 01 d0 add %edx,%eax 7aa: 3b 45 f8 cmp -0x8(%ebp),%eax 7ad: 75 20 jne 7cf <free+0xcf> p->s.size += bp->s.size; 7af: 8b 45 fc mov -0x4(%ebp),%eax 7b2: 8b 50 04 mov 0x4(%eax),%edx 7b5: 8b 45 f8 mov -0x8(%ebp),%eax 7b8: 8b 40 04 mov 0x4(%eax),%eax 7bb: 01 c2 add %eax,%edx 7bd: 8b 45 fc mov -0x4(%ebp),%eax 7c0: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 7c3: 8b 45 f8 mov -0x8(%ebp),%eax 7c6: 8b 10 mov (%eax),%edx 7c8: 8b 45 fc mov -0x4(%ebp),%eax 7cb: 89 10 mov %edx,(%eax) 7cd: eb 08 jmp 7d7 <free+0xd7> } else p->s.ptr = bp; 7cf: 8b 45 fc mov -0x4(%ebp),%eax 7d2: 8b 55 f8 mov -0x8(%ebp),%edx 7d5: 89 10 mov %edx,(%eax) freep = p; 7d7: 8b 45 fc mov -0x4(%ebp),%eax 7da: a3 c8 0b 00 00 mov %eax,0xbc8 } 7df: c9 leave 7e0: c3 ret 000007e1 <morecore>: static Header* morecore(uint nu) { 7e1: 55 push %ebp 7e2: 89 e5 mov %esp,%ebp 7e4: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 7e7: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 7ee: 77 07 ja 7f7 <morecore+0x16> nu = 4096; 7f0: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 7f7: 8b 45 08 mov 0x8(%ebp),%eax 7fa: c1 e0 03 shl $0x3,%eax 7fd: 89 04 24 mov %eax,(%esp) 800: e8 08 fc ff ff call 40d <sbrk> 805: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 808: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 80c: 75 07 jne 815 <morecore+0x34> return 0; 80e: b8 00 00 00 00 mov $0x0,%eax 813: eb 22 jmp 837 <morecore+0x56> hp = (Header*)p; 815: 8b 45 f4 mov -0xc(%ebp),%eax 818: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 81b: 8b 45 f0 mov -0x10(%ebp),%eax 81e: 8b 55 08 mov 0x8(%ebp),%edx 821: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 824: 8b 45 f0 mov -0x10(%ebp),%eax 827: 83 c0 08 add $0x8,%eax 82a: 89 04 24 mov %eax,(%esp) 82d: e8 ce fe ff ff call 700 <free> return freep; 832: a1 c8 0b 00 00 mov 0xbc8,%eax } 837: c9 leave 838: c3 ret 00000839 <malloc>: void* malloc(uint nbytes) { 839: 55 push %ebp 83a: 89 e5 mov %esp,%ebp 83c: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 83f: 8b 45 08 mov 0x8(%ebp),%eax 842: 83 c0 07 add $0x7,%eax 845: c1 e8 03 shr $0x3,%eax 848: 83 c0 01 add $0x1,%eax 84b: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 84e: a1 c8 0b 00 00 mov 0xbc8,%eax 853: 89 45 f0 mov %eax,-0x10(%ebp) 856: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 85a: 75 23 jne 87f <malloc+0x46> base.s.ptr = freep = prevp = &base; 85c: c7 45 f0 c0 0b 00 00 movl $0xbc0,-0x10(%ebp) 863: 8b 45 f0 mov -0x10(%ebp),%eax 866: a3 c8 0b 00 00 mov %eax,0xbc8 86b: a1 c8 0b 00 00 mov 0xbc8,%eax 870: a3 c0 0b 00 00 mov %eax,0xbc0 base.s.size = 0; 875: c7 05 c4 0b 00 00 00 movl $0x0,0xbc4 87c: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 87f: 8b 45 f0 mov -0x10(%ebp),%eax 882: 8b 00 mov (%eax),%eax 884: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 887: 8b 45 f4 mov -0xc(%ebp),%eax 88a: 8b 40 04 mov 0x4(%eax),%eax 88d: 3b 45 ec cmp -0x14(%ebp),%eax 890: 72 4d jb 8df <malloc+0xa6> if(p->s.size == nunits) 892: 8b 45 f4 mov -0xc(%ebp),%eax 895: 8b 40 04 mov 0x4(%eax),%eax 898: 3b 45 ec cmp -0x14(%ebp),%eax 89b: 75 0c jne 8a9 <malloc+0x70> prevp->s.ptr = p->s.ptr; 89d: 8b 45 f4 mov -0xc(%ebp),%eax 8a0: 8b 10 mov (%eax),%edx 8a2: 8b 45 f0 mov -0x10(%ebp),%eax 8a5: 89 10 mov %edx,(%eax) 8a7: eb 26 jmp 8cf <malloc+0x96> else { p->s.size -= nunits; 8a9: 8b 45 f4 mov -0xc(%ebp),%eax 8ac: 8b 40 04 mov 0x4(%eax),%eax 8af: 2b 45 ec sub -0x14(%ebp),%eax 8b2: 89 c2 mov %eax,%edx 8b4: 8b 45 f4 mov -0xc(%ebp),%eax 8b7: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 8ba: 8b 45 f4 mov -0xc(%ebp),%eax 8bd: 8b 40 04 mov 0x4(%eax),%eax 8c0: c1 e0 03 shl $0x3,%eax 8c3: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 8c6: 8b 45 f4 mov -0xc(%ebp),%eax 8c9: 8b 55 ec mov -0x14(%ebp),%edx 8cc: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 8cf: 8b 45 f0 mov -0x10(%ebp),%eax 8d2: a3 c8 0b 00 00 mov %eax,0xbc8 return (void*)(p + 1); 8d7: 8b 45 f4 mov -0xc(%ebp),%eax 8da: 83 c0 08 add $0x8,%eax 8dd: eb 38 jmp 917 <malloc+0xde> } if(p == freep) 8df: a1 c8 0b 00 00 mov 0xbc8,%eax 8e4: 39 45 f4 cmp %eax,-0xc(%ebp) 8e7: 75 1b jne 904 <malloc+0xcb> if((p = morecore(nunits)) == 0) 8e9: 8b 45 ec mov -0x14(%ebp),%eax 8ec: 89 04 24 mov %eax,(%esp) 8ef: e8 ed fe ff ff call 7e1 <morecore> 8f4: 89 45 f4 mov %eax,-0xc(%ebp) 8f7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 8fb: 75 07 jne 904 <malloc+0xcb> return 0; 8fd: b8 00 00 00 00 mov $0x0,%eax 902: eb 13 jmp 917 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 904: 8b 45 f4 mov -0xc(%ebp),%eax 907: 89 45 f0 mov %eax,-0x10(%ebp) 90a: 8b 45 f4 mov -0xc(%ebp),%eax 90d: 8b 00 mov (%eax),%eax 90f: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 912: e9 70 ff ff ff jmp 887 <malloc+0x4e> } 917: c9 leave 918: c3 ret
33.61673
60
0.429829
b270402727c9f7cbbc1828248fa541628c646d97
575
asm
Assembly
oeis/248/A248749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/248/A248749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/248/A248749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A248749: Decimal expansion of limit of the real part of f(1+i,n), where f(x,0) = 1 and f(x,n) = x + 1/f(x,n-1). ; Submitted by Christian Krause ; 1,5,2,9,0,8,5,5,1,3,6,3,5,7,4,6,1,2,5,1,6,0,9,9,0,5,2,3,7,9,0,2,2,5,2,1,0,6,1,9,3,6,5,0,4,9,8,3,8,9,0,9,7,4,3,1,4,0,7,7,1,1,7,6,3,2,0,2,3,9,8,1,1,5,7,9,1,8,9,4,6,2,7,7,1,1 mov $1,1 mov $3,$0 mul $3,4 mov $8,10 lpb $3 add $6,$8 add $1,$6 add $1,$8 add $2,$1 mov $1,$6 sub $3,1 add $5,$2 add $8,$6 add $6,$5 lpe mov $4,10 pow $4,$0 div $2,$4 mov $7,$4 cmp $7,0 cmp $7,0 add $2,$7 div $1,$2 mov $0,$1 mod $0,10
19.166667
173
0.533913
6c3715ffd91d2e3872176d6707ef4730af956ec1
42,597
asm
Assembly
CDROOT/COBALT/SOURCE/SYSLINUX/ldlinux.asm
Michael2626/Cobalt
b1446963d9c21e9dff7f646dc655858aeee7f3a7
[ "MIT" ]
35
2018-07-16T04:49:00.000Z
2021-04-12T06:46:41.000Z
CDROOT/COBALT/SOURCE/SYSLINUX/ldlinux.asm
ercanersoy/cobalt
ba8c594c015479484aeebe424f47e188ebf1aa4f
[ "MIT" ]
null
null
null
CDROOT/COBALT/SOURCE/SYSLINUX/ldlinux.asm
ercanersoy/cobalt
ba8c594c015479484aeebe424f47e188ebf1aa4f
[ "MIT" ]
7
2018-08-23T13:33:24.000Z
2020-04-04T21:06:34.000Z
; -*- fundamental -*- (asm-mode sucks) ; $Id: ldlinux.asm,v 1.147 2004/06/13 20:50:44 hpa Exp $ ; **************************************************************************** ; ; ldlinux.asm ; ; A program to boot Linux kernels off an MS-DOS formatted floppy disk. This ; functionality is good to have for installation floppies, where it may ; be hard to find a functional Linux system to run LILO off. ; ; This program allows manipulation of the disk to take place entirely ; from MS-LOSS, and can be especially useful in conjunction with the ; umsdos filesystem. ; ; This file is loaded in stages; first the boot sector at offset 7C00h, ; then the first sector (cluster, really, but we can only assume 1 sector) ; of LDLINUX.SYS at 7E00h and finally the remainder of LDLINUX.SYS at 8000h. ; ; Copyright (C) 1994-2004 H. Peter Anvin ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, ; USA; either version 2 of the License, or (at your option) any later ; version; incorporated herein by reference. ; ; **************************************************************************** %ifndef IS_MDSLINUX %define IS_SYSLINUX 1 %endif %include "macros.inc" %include "config.inc" %include "kernel.inc" %include "bios.inc" %include "tracers.inc" ; ; Some semi-configurable constants... change on your own risk. ; my_id equ syslinux_id FILENAME_MAX_LG2 equ 4 ; log2(Max filename size Including final null) FILENAME_MAX equ 11 ; Max mangled filename size NULLFILE equ ' ' ; First char space == null filename retry_count equ 6 ; How patient are we with the disk? %assign HIGHMEM_SLOP 0 ; Avoid this much memory near the top ; ; This is what we need to do when idle ; %macro RESET_IDLE 0 ; Nothing %endmacro %macro DO_IDLE 0 ; Nothing %endmacro ; ; The following structure is used for "virtual kernels"; i.e. LILO-style ; option labels. The options we permit here are `kernel' and `append ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; ; Note: this structure can be added to, but it must ; %define vk_power 7 ; log2(max number of vkernels) %define max_vk (1 << vk_power) ; Maximum number of vkernels %define vk_shift (16-vk_power) ; Number of bits to shift %define vk_size (1 << vk_shift) ; Size of a vkernel buffer struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name vk_appendlen: resw 1 alignb 4 vk_append: resb max_cmd_len+1 ; Command line alignb 4 vk_end: equ $ ; Should be <= vk_size endstruc %ifndef DEPEND %if (vk_end > vk_size) || (vk_size*max_vk > 65536) %error "Too many vkernels defined, reduce vk_power" %endif %endif ; ; Segment assignments in the bottom 640K ; Stick to the low 512K in case we're using something like M-systems flash ; which load a driver into low RAM (evil!!) ; ; 0000h - main code/data segment (and BIOS segment) ; real_mode_seg equ 5000h fat_seg equ 3000h ; 128K area for FAT (2x64K) vk_seg equ 2000h ; Virtual kernels xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem comboot_seg equ real_mode_seg ; COMBOOT image loading zone ; --------------------------------------------------------------------------- ; BEGIN CODE ; --------------------------------------------------------------------------- ; ; Memory below this point is reserved for the BIOS and the MBR ; absolute 1000h trackbuf equ $ ; Track buffer goes here trackbufsize equ 16384 ; Safe size of track buffer ; trackbuf ends at 5000h ; ; Constants for the xfer_buf_seg ; ; The xfer_buf_seg is also used to store message file buffers. We ; need two trackbuffers (text and graphics), plus a work buffer ; for the graphics decompressor. ; xbs_textbuf equ 0 ; Also hard-coded, do not change xbs_vgabuf equ trackbufsize xbs_vgatmpbuf equ 2*trackbufsize absolute 5000h ; Here we keep our BSS stuff VKernelBuf: resb vk_size ; "Current" vkernel alignb 4 AppendBuf resb max_cmd_len+1 ; append= Ontimeout resb max_cmd_len+1 ; ontimeout Onerror resb max_cmd_len+1 ; onerror KbdMap resb 256 ; Keyboard map FKeyName resb 10*16 ; File names for F-key help NumBuf resb 15 ; Buffer to load number NumBufEnd resb 1 ; Last byte in NumBuf alignb 8 ; Expanded superblock SuperInfo equ $ resq 16 ; The first 16 bytes expanded 8 times ; ; These need to follow SuperInfo ; RootDir resd 1 ; Location of root directory DataArea resd 1 ; Location of data area RootDirSize resw 1 ; Root dir size in sectors DirScanCtr resw 1 ; Used while searching directory EndofDirSec resw 1 ; = trackbuf+bsBytesPerSec-31 alignb 4 E820Buf resd 5 ; INT 15:E820 data buffer E820Mem resd 1 ; Memory detected by E820 E820Max resd 1 ; Is E820 memory capped? HiLoadAddr resd 1 ; Address pointer for high load loop HighMemSize resd 1 ; End of memory pointer (bytes) RamdiskMax resd 1 ; Highest address for a ramdisk KernelSize resd 1 ; Size of kernel (bytes) SavedSSSP resd 1 ; Our SS:SP while running a COMBOOT image PMESP resd 1 ; Protected-mode ESP ClustPerMoby resd 1 ; Clusters per 64K ClustSize resd 1 ; Bytes/cluster KernelName resb 12 ; Mangled name for kernel ; (note the spare byte after!) OrigKernelExt resd 1 ; Original kernel extension FBytes equ $ ; Used by open/getc FBytes1 resw 1 FBytes2 resw 1 DirBlocksLeft resw 1 ; Ditto RunLinClust resw 1 ; Cluster # for LDLINUX.SYS BufSafe resw 1 ; Clusters we can load into trackbuf BufSafeSec resw 1 ; = how many sectors? BufSafeBytes resw 1 ; = how many bytes? EndOfGetCBuf resw 1 ; = getcbuf+BufSafeBytes KernelClust resw 1 ; Kernel size in clusters FClust resw 1 ; Number of clusters in open/getc file FNextClust resw 1 ; Pointer to next cluster in d:o FPtr resw 1 ; Pointer to next char in buffer CmdOptPtr resw 1 ; Pointer to first option on cmd line KernelCNameLen resw 1 ; Length of unmangled kernel name InitRDCNameLen resw 1 ; Length of unmangled initrd name NextCharJump resw 1 ; Routine to interpret next print char SetupSecs resw 1 ; Number of setup sectors A20Test resw 1 ; Counter for testing status of A20 A20Type resw 1 ; A20 type CmdLineLen resw 1 ; Length of command line including null GraphXSize resw 1 ; Width of splash screen file VGAPos resw 1 ; Pointer into VGA memory VGACluster resw 1 ; Cluster pointer for VGA image file VGAFilePtr resw 1 ; Pointer into VGAFileBuf Com32SysSP resw 1 ; SP saved during COM32 syscall CursorDX equ $ CursorCol resb 1 ; Cursor column for message file CursorRow resb 1 ; Cursor row for message file ScreenSize equ $ VidCols resb 1 ; Columns on screen-1 VidRows resb 1 ; Rows on screen-1 BaudDivisor resw 1 ; Baud rate divisor FlowControl equ $ FlowOutput resb 1 ; Outputs to assert for serial flow FlowInput resb 1 ; Input bits for serial flow FlowIgnore resb 1 ; Ignore input unless these bits set TextAttribute resb 1 ; Text attribute for message file RetryCount resb 1 ; Used for disk access retries KbdFlags resb 1 ; Check for keyboard escapes LoadFlags resb 1 ; Loadflags from kernel A20Tries resb 1 ; Times until giving up on A20 FuncFlag resb 1 ; Escape sequences received from keyboard DisplayMask resb 1 ; Display modes mask CopySuper resb 1 ; Distinguish .bs versus .bss MNameBuf resb 11 ; Generic mangled file name buffer InitRD resb 11 ; initrd= mangled name KernelCName resb 13 ; Unmangled kernel name InitRDCName resb 13 ; Unmangled initrd name TextColorReg resb 17 ; VGA color registers for text mode VGAFileBuf resb 13 ; Unmangled VGA image name VGAFileBufEnd equ $ VGAFileMBuf resb 11 ; Mangled VGA image name alignb 4 ; For the good of REP MOVSD command_line resb max_cmd_len+2 ; Command line buffer default_cmd resb max_cmd_len+1 ; "default" command line kern_cmd_len equ $-command_line section .text org 7C00h ; ; Some of the things that have to be saved very early are saved ; "close" to the initial stack pointer offset, in order to ; reduce the code size... ; StackBuf equ $-44-32 ; Start the stack here (grow down - 4K) PartInfo equ StackBuf ; Saved partition table entry FloppyTable equ PartInfo+16 ; Floppy info table (must follow PartInfo) OrigFDCTabPtr equ StackBuf-4 ; The high dword on the stack ; ; Primary entry point. Tempting as though it may be, we can't put the ; initial "cli" here; the jmp opcode in the first byte is part of the ; "magic number" (using the term very loosely) for the DOS superblock. ; bootsec equ $ jmp short start ; 2 bytes nop ; 1 byte ; ; "Superblock" follows -- it's in the boot sector, so it's already ; loaded and ready for us ; bsOemName db 'SYSLINUX' ; The SYS command sets this, so... ; ; These are the fields we actually care about. We end up expanding them ; all to dword size early in the code, so generate labels for both ; the expanded and unexpanded versions. ;; %macro superb 1 bx %+ %1 equ SuperInfo+($-superblock)*8+4 bs %+ %1 equ $ zb 1 %endmacro %macro superw 1 bx %+ %1 equ SuperInfo+($-superblock)*8 bs %+ %1 equ $ zw 1 %endmacro %macro superd 1 bx %+ %1 equ $ ; no expansion for dwords bs %+ %1 equ $ zd 1 %endmacro superblock equ $ superw BytesPerSec superb SecPerClust superw ResSectors superb FATs superw RootDirEnts superw Sectors superb Media superw FATsecs superw SecPerTrack superw Heads superinfo_size equ ($-superblock)-1 ; How much to expand superd Hidden superd HugeSectors superb DriveNumber superb Reserved1 superb BootSignature ; 29h if the following fields exist superd VolumeID bsVolumeLabel zb 11 bsFileSysType zb 8 ; Must be FAT12 or FAT16 for this version superblock_len equ $-superblock SecPerClust equ bxSecPerClust ; ; Note we don't check the constraints above now; we did that at install ; time (we hope!) ; ;floppy_table equ $ ; No sense in wasting memory, overwrite start start: cli ; No interrupts yet, please cld ; Copy upwards ; ; Set up the stack ; xor ax,ax mov ss,ax mov sp,StackBuf ; Just below BSS mov es,ax ; ; DS:SI may contain a partition table entry. Preserve it for us. ; mov cx,8 ; Save partition info mov di,sp rep movsw mov ds,ax ; Now we can initialize DS... mov [di+bsDriveNumber-FloppyTable],dl ; ; Now sautee the BIOS floppy info block to that it will support decent- ; size transfers; the floppy block is 11 bytes and is stored in the ; INT 1Eh vector (brilliant waste of resources, eh?) ; ; Of course, if BIOSes had been properly programmed, we wouldn't have ; had to waste precious space with this code. ; mov bx,fdctab lfs si,[bx] ; FS:SI -> original fdctab push fs ; Save on stack in case we need to bail push si ; Save the old fdctab even if hard disk so the stack layout ; is the same. The instructions above do not change the flags and dl,dl ; If floppy disk (00-7F), assume no ; partition table js harddisk floppy: mov cl,6 ; 12 bytes (CX == 0) ; es:di -> FloppyTable already ; This should be safe to do now, interrupts are off... mov [bx],di ; FloppyTable mov [bx+2],ax ; Segment 0 fs rep movsw ; Faster to move words mov cl,[bsSecPerTrack] ; Patch the sector count mov [di-8],cl ; AX == 0 here int 13h ; Some BIOSes need this jmp short not_harddisk ; ; The drive number and possibly partition information was passed to us ; by the BIOS or previous boot loader (MBR). Current "best practice" is to ; trust that rather than what the superblock contains. ; ; Would it be better to zero out bsHidden if we don't have a partition table? ; ; Note: di points to beyond the end of PartInfo ; harddisk: test byte [di-16],7Fh ; Sanity check: "active flag" should jnz no_partition ; be 00 or 80 mov eax,[di-8] ; Partition offset (dword) mov [bsHidden],eax no_partition: ; ; Get disk drive parameters (don't trust the superblock.) Don't do this for ; floppy drives -- INT 13:08 on floppy drives will (may?) return info about ; what the *drive* supports, not about the *media*. Fortunately floppy disks ; tend to have a fixed, well-defined geometry which is stored in the superblock. ; ; DL == drive # still mov ah,08h int 13h jc no_driveparm and ah,ah jnz no_driveparm shr dx,8 inc dx ; Contains # of heads - 1 mov [bsHeads],dx and cx,3fh mov [bsSecPerTrack],cx no_driveparm: not_harddisk: ; ; Ready to enable interrupts, captain ; sti ; ; Insane hack to expand the superblock to dwords ; expand_super: xor eax,eax mov es,ax ; INT 13:08 destroys ES mov si,superblock mov di,SuperInfo mov cl,superinfo_size ; CH == 0 .loop: lodsw dec si stosd ; Store expanded word xor ah,ah stosd ; Store expanded byte loop .loop ; ; Now we have to do some arithmetric to figure out where things are located. ; If Micro$oft had had brains they would already have done this for us, ; and stored it in the superblock at format time, but here we go, ; wasting precious boot sector space again... ; %define Z di-superinfo_size*8-SuperInfo debugentrypt: mov ax,[bxFATs] ; Number of FATs (eax<31:16> == 0) mov edx,[Z+bxFATsecs] ; Sectors/FAT mul edx ; Get the size of the FAT area ; edx <- 0 add eax,[bxHidden] ; Add hidden sectors add eax,[Z+bxResSectors] ; And reserved sectors mov [RootDir],eax ; Location of root directory mov [DataArea],eax ; First data sector push eax mov eax,[Z+bxRootDirEnts] shl ax,5 ; Size of a directory entry mov bx,[Z+bxBytesPerSec] add ax,bx ; Round up, not down dec ax div bx ; Now we have the size of the root dir mov [RootDirSize],ax mov [DirScanCtr],ax add bx,trackbuf-31 mov [Z+EndofDirSec],bx ; End of a single directory sector add [Z+DataArea],eax pop eax ; Reload root directory starting point ; ; Now the fun begins. We have to search the root directory for ; LDLINUX.SYS and load the first sector, so we have a little more ; space to have fun with. Then we can go chasing through the FAT. ; Joy!! ; sd_nextsec: push eax mov bx,trackbuf push bx call getonesec pop si sd_nextentry: mov cx,11 cmp [si],ch ; Directory high water mark je kaboom ; This no longer fits... since we'd be dead anyway if there ; was a nonfile named LDLINUX.SYS on the disk, it shouldn't ; matter... ; test byte [si+11],18h ; Must be a file ; jnz sd_not_file mov di,ldlinux_name push si repe cmpsb pop si je found_it sd_not_file: add si,byte 32 ; Distance to next cmp si,[EndofDirSec] jb sd_nextentry pop eax inc eax dec word [DirScanCtr] jnz sd_nextsec ; ; kaboom: write a message and bail out. ; kaboom: xor si,si mov ss,si mov sp,StackBuf-4 ; Reset stack mov ds,si ; Reset data segment pop dword [fdctab] ; Restore FDC table .patch: mov si,bailmsg call writestr ; Returns with AL = 0 cbw ; AH <- 0 int 16h ; Wait for keypress int 19h ; And try once more to boot... .norge: jmp short .norge ; If int 19h returned; this is the end ; ; found_it: now we compute the location of the first sector, then ; load it and JUMP (since we're almost out of space) ; found_it: ; Note: we actually leave two words on the stack here ; (who cares?) mov eax,[bxSecPerClust] mov bp,ax ; Load an entire cluster movzx ebx,word [si+26] ; First cluster mov [RunLinClust],bx ; Save for later use dec bx ; First cluster is "cluster 2" dec bx mul ebx add eax,[DataArea] mov bx,ldlinux_sys call getlinsec mov si,bs_magic mov di,ldlinux_magic mov cx,magic_len repe cmpsb ; Make sure that the bootsector jne kaboom ; matches LDLINUX.SYS ; ; Done! Jump to the entry point! ; jmp ldlinux_ent ; ; ; writestr: write a null-terminated string to the console ; This assumes we're on page 0. This is only used for early ; messages, so it should be OK. ; writestr: .loop: lodsb and al,al jz .return mov ah,0Eh ; Write to screen as TTY mov bx,0007h ; Attribute int 10h jmp short .loop .return: ret ; ; disk_error: decrement the retry count and bail if zero. ; This gets patched once we have more space to try to ; optimize transfer sizes on broken machines. ; disk_error: dec si ; SI holds the disk retry counter jz kaboom ; End of patched "call" instruction! jmp short disk_try_again ; ; getonesec: like getlinsec, but pre-sets the count to 1 ; getonesec: mov bp,1 ; Fall through to getlinsec ; ; getlinsec: load a sequence of BP floppy sector given by the linear sector ; number in EAX into the buffer at ES:BX. We try to optimize ; by loading up to a whole track at a time, but the user ; is responsible for not crossing a 64K boundary. ; (Yes, BP is weird for a count, but it was available...) ; ; On return, BX points to the first byte after the transferred ; block. ; ; The "stupid patch area" gets replaced by the code ; mov bp,1 ; nop ... (BD 01 00 90 90...) when installing with ; the -s option. ; ; This routine assumes CS == DS. ; ; Stylistic note: use "xchg" instead of "mov" when the source is a register ; that is dead from that point; this saves space. However, please keep ; the order to dst,src to keep things sane. ; getlinsec: mov esi,[bxSecPerTrack] ; ; Dividing by sectors to get (track,sector): we may have ; up to 2^18 tracks, so we need to use 32-bit arithmetric. ; xor edx,edx ; Zero-extend LBA to 64 bits div esi xor cx,cx xchg cx,dx ; CX <- sector index (0-based) ; EDX <- 0 ; eax = track # div dword [bxHeads] ; Convert track to head/cyl ; ; Now we have AX = cyl, DX = head, CX = sector (0-based), ; BP = sectors to transfer, SI = bsSecPerTrack, ; ES:BX = data target ; gls_nextchunk: push si ; <A> bsSecPerTrack push bp ; <B> Sectors to transfer ; Important - this gets patched with a call. The call ; assumes cx, si and bp are set up, and can modify bp ; and destroy si. Until we have the space to do so, ; transfer one sector at a time. gls_set_size: __BEGIN_STUPID_PATCH_AREA: mov bp,1 ; 3 bytes, same as a call insn __END_STUPID_PATCH_AREA: push ax ; <C> Cylinder # push dx ; <D> Head # push cx ; <E> Sector # shl ah,6 ; Because IBM was STOOPID ; and thought 8 bits were enough ; then thought 10 bits were enough... pop cx ; <E> Sector # push cx ; <E> Sector # inc cx ; Sector numbers are 1-based, sigh or cl,ah mov ch,al mov dh,dl mov dl,[bsDriveNumber] xchg ax,bp ; Sector to transfer count ; (xchg shorter than mov) mov si,retry_count ; # of times to retry a disk access ; ; Do the disk transfer... save the registers in case we fail :( ; disk_try_again: pusha ; <F> mov ah,02h ; READ DISK int 13h popa ; <F> jc disk_error ; ; Disk access successful ; pop cx ; <E> Sector # mov di,ax ; Reduce sector left count mul word [bsBytesPerSec] ; Figure out how much to advance ptr add bx,ax ; Update buffer location pop dx ; <D> Head # pop ax ; <C> Cyl # pop bp ; <B> Sectors left to transfer pop si ; <A> Number of sectors/track sub bp,di ; Reduce with # of sectors just read jz writestr.return ; Done! add cx,di cmp cx,si jb gls_nextchunk inc dx ; Next track on cyl cmp dx,[bsHeads] ; Was this the last one? jb gls_nonewcyl inc ax ; If so, new cylinder xor dx,dx ; First head on new cylinder gls_nonewcyl: sub cx,si ; First sector on new track jmp short gls_nextchunk bailmsg: db 'Boot failed', 0Dh, 0Ah, 0 bs_checkpt equ $ ; Must be <= 7DEFh %if 1 bs_checkpt_off equ ($-$$) %ifndef DEPEND %if bs_checkpt_off > 1EFh %error "Boot sector overflow" %endif %endif zb 1EFh-($-$$) %endif bs_magic equ $ ; From here to the magic_len equ ; must match ldlinux_magic ldlinux_name: db 'LDLINUX SYS' ; Looks like this in the root dir dd HEXDATE ; Hopefully unique between compiles bootsignature dw 0AA55h magic_len equ $-bs_magic ; ; =========================================================================== ; End of boot sector ; =========================================================================== ; Start of LDLINUX.SYS ; =========================================================================== ldlinux_sys: syslinux_banner db 0Dh, 0Ah %if IS_MDSLINUX db 'MDSLINUX ' %else db 'SYSLINUX ' %endif db version_str, ' ', date, ' ', 0 db 0Dh, 0Ah, 1Ah ; EOF if we "type" this in DOS ldlinux_magic db 'LDLINUX SYS' dd HEXDATE dw 0AA55h ; ; This area is possibly patched by the installer. It is located ; immediately after the EOF + LDLINUX SYS + 4 bytes + 55 AA + alignment, ; so we can find it algorithmically. ; alignb 4, db 0 MaxTransfer dw 00FFh ; Absolutely maximum transfer size align 4 ldlinux_ent: ; ; Note that some BIOSes are buggy and run the boot sector at 07C0:0000 ; instead of 0000:7C00 and the like. We don't want to add anything ; more to the boot sector, so it is written to not assume a fixed ; value in CS, but we don't want to deal with that anymore from now ; on. ; jmp 0:.next .next: ; ; Tell the user we got this far ; mov si,syslinux_banner call writestr ; ; Remember, the boot sector loaded only the first cluster of LDLINUX.SYS. ; We can really only rely on a single sector having been loaded. Hence ; we should load the FAT into RAM and start chasing pointers... ; xor ax,ax cwd inc dx ; DX:AX <- 64K div word [bxBytesPerSec] ; sectors/64K mov si,ax push es mov bx,fat_seg ; Load into fat_seg:0000 mov es,bx mov eax,[bsHidden] ; Hidden sectors add edx,[bxResSectors] add eax,edx mov ecx,[bxFATsecs] ; Sectors/FAT fat_load_loop: mov ebp,ecx ; Make sure high EBP = 0 cmp bp,si jna fat_load mov bp,si ; A full 64K moby fat_load: xor bx,bx ; Offset 0 in the current ES call getlinsecsr sub cx,bp jz fat_load_done ; Last moby? add eax,ebp ; Advance sector count mov bx,es ; Next 64K moby add bx,1000h mov es,bx jmp short fat_load_loop fat_load_done: pop es ; ; Fine, now we have the FAT in memory. How big is a cluster, really? ; Also figure out how many clusters will fit in an 8K buffer, and how ; many sectors and bytes that is ; mov edi,[bxBytesPerSec] ; Used a lot below mov eax,[SecPerClust] mov si,ax ; Also used a lot mul di mov [ClustSize],eax ; Bytes/cluster mov bx,ax mov ax,trackbufsize ; High bit 0 cwd div bx mov [BufSafe],ax ; # of cluster in trackbuf mul si mov [BufSafeSec],ax mul di mov [BufSafeBytes],ax add ax,getcbuf ; Size of getcbuf is the same mov [EndOfGetCBuf],ax ; as for trackbuf ; ; FAT12 or FAT16? This computation is fscking ridiculous... ; mov eax,[bxSectors] and ax,ax jnz have_secs mov eax,[bsHugeSectors] have_secs: add eax,[bsHidden] ; These are not included sub eax,[RootDir] ; Start of root directory movzx ebx,word [RootDirSize] sub eax,ebx ; Subtract root directory size xor edx,edx div esi ; Convert to clusters cmp ax,4086 ; FAT12 limit jna is_fat12 ; Patch the jump mov byte [nextcluster+1],nextcluster_fat16-(nextcluster+2) is_fat12: ; ; Patch gls_set_size so we can transfer more than one sector at a time. ; mov byte [gls_set_size],0xe8 ; E8 = CALL NEAR mov word [gls_set_size+1],do_gls_set_size-(gls_set_size+3) mov byte [disk_error],0xe8 mov word [disk_error+1],do_disk_error-(disk_error+3) ; ; Now we read the rest of LDLINUX.SYS. Don't bother loading the first ; cluster again, though. ; load_rest: mov cx,[ClustSize] mov bx,ldlinux_sys add bx,cx mov si,[RunLinClust] call nextcluster xor dx,dx mov ax,ldlinux_len-1 ; To be on the safe side add ax,cx div cx ; the number of clusters dec ax ; We've already read one jz all_read_jmp mov cx,ax call getfssec ; ; All loaded up ; all_read_jmp: jmp all_read ; ; ----------------------------------------------------------------------------- ; Subroutines that have to be in the first sector ; ----------------------------------------------------------------------------- ; ; getfssec: Get multiple clusters from a file, given the starting cluster. ; ; This routine makes sure the subtransfers do not cross a 64K boundary, ; and will correct the situation if it does, UNLESS *sectors* cross ; 64K boundaries. ; ; ES:BX -> Buffer ; SI -> Starting cluster number (2-based) ; CX -> Cluster count (0FFFFh = until end of file) ; ; Returns CF=1 on EOF ; getfssec: .getfragment: xor ebp,ebp ; Fragment sector count lea eax,[si-2] ; Get 0-based sector address mul dword [SecPerClust] add eax,[DataArea] .getseccnt: ; See if we can read > 1 clust add bp,[SecPerClust] dec cx ; Reduce clusters left to find lea di,[si+1] call nextcluster cmc jc .eof ; At EOF? jcxz .endfragment ; Or was it the last we wanted? cmp si,di ; Is file continuous? je .getseccnt ; Yes, we can get .endfragment: clc ; Not at EOF .eof: pushf ; Remember EOF or not push si push cx .getchunk: push eax mov ax,es ; Check for 64K boundaries. shl ax,4 add ax,bx xor dx,dx neg ax setz dl ; DX <- 1 if full 64K segment div word [bsBytesPerSec] ; How many sectors fit? mov si,bp sub si,ax ; Compute remaining sectors jbe .lastchunk mov bp,ax pop eax call getlinsecsr add eax,ebp ; EBP<31:16> == 0 mov bp,si ; Remaining sector count jmp short .getchunk .lastchunk: pop eax call getlinsec pop cx pop si popf jcxz .return ; If we hit the count limit jnc .getfragment ; If we didn't hit EOF .return: ret ; ; getlinsecsr: save registers, call getlinsec, restore registers ; getlinsecsr: pushad call getlinsec popad ret ; ; nextcluster: Advance a cluster pointer in SI to the next cluster ; pointed at in the FAT tables. CF=0 on return if end of file. ; nextcluster: jmp short nextcluster_fat12 ; This gets patched nextcluster_fat12: push bx push ds mov bx,fat_seg mov ds,bx mov bx,si ; Multiply by 3/2 shr bx,1 ; CF now set if odd mov si,[si+bx] jnc nc_even shr si,4 ; Needed for odd only nc_even: and si,0FFFh cmp si,0FF0h ; Clears CF if at end of file pop ds pop bx nc_return: ret ; ; FAT16 decoding routine. Note that a 16-bit FAT can be up to 128K, ; so we have to decide if we're in the "low" or the "high" 64K-segment... ; nextcluster_fat16: push ax push ds mov ax,fat_seg shl si,1 jnc .seg0 mov ax,fat_seg+1000h .seg0: mov ds,ax mov si,[si] cmp si,0FFF0h pop ds pop ax ret ; ; Routine that controls how much we can transfer in one chunk. Called ; from gls_set_size in getlinsec. ; do_gls_set_size: sub si,cx ; Sectors left on track cmp bp,si jna .lastchunk mov bp,si ; No more than a trackful, please! .lastchunk: cmp bp,[MaxTransfer] ; Absolute maximum transfer size jna .oktransfer mov bp,[MaxTransfer] .oktransfer: ret ; ; This routine captures disk errors, and tries to decide if it is ; time to reduce the transfer size. ; do_disk_error: dec si ; Decrement the retry counter jz kaboom ; If expired, croak cmp si,2 ; If only 2 attempts left ja .nodanger mov al,1 ; Drop transfer size to 1 jmp short .setsize .nodanger: cmp si,retry_count-2 ja .again ; First time, just try again shr al,1 ; Otherwise, try to reduce adc al,0 ; the max transfer size, but not to 0 .setsize: mov [MaxTransfer],al .again: ret ; ; Debug routine ; %ifdef debug safedumpregs: cmp word [Debug_Magic],0D00Dh jnz nc_return jmp dumpregs %endif rl_checkpt equ $ ; Must be <= 8000h rl_checkpt_off equ ($-$$) %ifndef DEPEND %if rl_checkpt_off > 400h %error "Sector 1 overflow" %endif %endif ; ---------------------------------------------------------------------------- ; End of code and data that have to be in the first sector ; ---------------------------------------------------------------------------- all_read: ; ; Let the user (and programmer!) know we got this far. This used to be ; in Sector 1, but makes a lot more sense here. ; mov si,copyright_str call writestr ; ; Common initialization code ; %include "cpuinit.inc" ; ; Initialization that does not need to go into the any of the pre-load ; areas ; ; Now set up screen parameters call adjust_screen ; Wipe the F-key area mov al,NULLFILE mov di,FKeyName mov cx,10*(1 << FILENAME_MAX_LG2) rep stosb ; ; Now, everything is "up and running"... patch kaboom for more ; verbosity and using the full screen system ; ; E9 = JMP NEAR mov dword [kaboom.patch],0e9h+((kaboom2-(kaboom.patch+3)) << 8) ; ; Compute some parameters that depend on cluster size ; xor eax,eax cwd ; DX <- 0 inc dx ; DX:AX <- 64K div word [ClustSize] mov [ClustPerMoby],eax ; Clusters/64K ; ; Now we're all set to start with our *real* business. First load the ; configuration file (if any) and parse it. ; ; In previous versions I avoided using 32-bit registers because of a ; rumour some BIOSes clobbered the upper half of 32-bit registers at ; random. I figure, though, that if there are any of those still left ; they probably won't be trying to install Linux on them... ; ; The code is still ripe with 16-bitisms, though. Not worth the hassle ; to take'm out. In fact, we may want to put them back if we're going ; to boot ELKS at some point. ; mov si,linuxauto_cmd ; Default command: "linux auto" mov di,default_cmd mov cx,linuxauto_len rep movsb mov di,KbdMap ; Default keymap 1:1 xor al,al inc ch ; CX <- 256 mkkeymap: stosb inc al loop mkkeymap ; ; Load configuration file ; mov di,syslinux_cfg call open jz no_config_file ; ; Now we have the config file open. Parse the config file and ; run the user interface. ; %include "ui.inc" ; ; Linux kernel loading code is common. ; %include "runkernel.inc" ; ; COMBOOT-loading code ; %include "comboot.inc" %include "com32.inc" %include "cmdline.inc" ; ; Boot sector loading code ; %include "bootsect.inc" ; ; abort_check: let the user abort with <ESC> or <Ctrl-C> ; abort_check: call pollchar jz ac_ret1 pusha call getchar cmp al,27 ; <ESC> je ac_kill cmp al,3 ; <Ctrl-C> jne ac_ret2 ac_kill: mov si,aborted_msg ; ; abort_load: Called by various routines which wants to print a fatal ; error message and return to the command prompt. Since this ; may happen at just about any stage of the boot process, assume ; our state is messed up, and just reset the segment registers ; and the stack forcibly. ; ; SI = offset (in _text) of error message to print ; abort_load: mov ax,cs ; Restore CS = DS = ES mov ds,ax mov es,ax cli mov sp,StackBuf-2*3 ; Reset stack mov ss,ax ; Just in case... sti call cwritestr ; Expects SI -> error msg al_ok: jmp enter_command ; Return to command prompt ; ; End of abort_check ; ac_ret2: popa ac_ret1: ret ; ; searchdir: Search the root directory for a pre-mangled filename in ; DS:DI. This routine is similar to the one in the boot ; sector, but is a little less Draconian when it comes to ; error handling, plus it reads the root directory in ; larger chunks than a sector at a time (which is probably ; a waste of coding effort, but I like to do things right). ; ; FIXME: usually we can load the entire root dir in memory, ; and files are usually at the beginning anyway. It probably ; would be worthwhile to remember if we have the first chunk ; in memory and skip the load if that (it would speed up online ; help, mainly.) ; ; NOTE: This file considers finding a zero-length file an ; error. This is so we don't have to deal with that special ; case elsewhere in the program (most loops have the test ; at the end). ; ; If successful: ; ZF clear ; SI = cluster # for the first cluster ; DX:AX = file length in bytes ; If unsuccessful ; ZF set ; searchdir: push bp mov ax,[bsRootDirEnts] mov [DirScanCtr],ax mov ax,[RootDirSize] mov [DirBlocksLeft],ax mov eax,[RootDir] scan_group: movzx ebp,word [DirBlocksLeft] and bp,bp jz dir_return cmp bp,[BufSafeSec] jna load_last mov bp,[BufSafeSec] load_last: sub [DirBlocksLeft],bp push eax mov ax,[bsBytesPerSec] mul bp add ax,trackbuf-31 mov [EndofDirSec],ax ; End of loaded pop eax mov bx,trackbuf call getlinsecsr mov si,trackbuf dir_test_name: cmp byte [si],0 ; Directory high water mark je dir_return ; Failed test byte [si+11],18h ; Check it really is a file jnz dir_not_this push di push si mov cx,11 ; Filename = 11 bytes repe cmpsb pop si pop di je dir_success dir_not_this: add si,byte 32 dec word [DirScanCtr] jz dir_return ; Out of it... cmp si,[EndofDirSec] jb dir_test_name add eax,ebp ; Increment linear sector number jmp short scan_group dir_success: mov ax,[si+28] ; Length of file mov dx,[si+30] mov si,[si+26] ; Cluster pointer mov bx,ax or bx,dx ; Sets ZF iff DX:AX is zero dir_return: pop bp ret ; ; writechr: Write a single character in AL to the console without ; mangling any registers; handle video pages correctly. ; writechr: call write_serial ; write to serial port if needed pushfd pushad mov ah,0Eh mov bl,07h ; attribute mov bh,[cs:BIOS_page] ; current page int 10h popad popfd ret ; ; ; kaboom2: once everything is loaded, replace the part of kaboom ; starting with "kaboom.patch" with this part kaboom2: mov si,err_bootfailed call cwritestr call getchar call vgaclearmode int 19h ; And try once more to boot... .norge: jmp short .norge ; If int 19h returned; this is the end ; ; mangle_name: Mangle a DOS filename pointed to by DS:SI into a buffer pointed ; to by ES:DI; ends on encountering any whitespace ; mangle_name: mov cx,11 ; # of bytes to write mn_loop: lodsb cmp al,' ' ; If control or space, end jna mn_end cmp al,'.' ; Period -> space-fill je mn_is_period cmp al,'a' jb mn_not_lower cmp al,'z' ja mn_not_uslower sub al,020h jmp short mn_not_lower mn_is_period: mov al,' ' ; We need to space-fill mn_period_loop: cmp cx,3 ; If <= 3 characters left jbe mn_loop ; Just ignore it stosb ; Otherwise, write a period loop mn_period_loop ; Dec CX and (always) jump mn_not_uslower: cmp al,ucase_low jb mn_not_lower cmp al,ucase_high ja mn_not_lower mov bx,ucase_tab-ucase_low cs xlatb mn_not_lower: stosb loop mn_loop ; Don't continue if too long mn_end: mov al,' ' ; Space-fill name rep stosb ; Doesn't do anything if CX=0 ret ; Done ; ; Upper-case table for extended characters; this is technically code page 865, ; but code page 437 users will probably not miss not being able to use the ; cent sign in kernel images too much :-) ; ; The table only covers the range 129 to 164; the rest we can deal with. ; ucase_low equ 129 ucase_high equ 164 ucase_tab db 154, 144, 'A', 142, 'A', 143, 128, 'EEEIII' db 142, 143, 144, 146, 146, 'O', 153, 'OUUY', 153, 154 db 157, 156, 157, 158, 159, 'AIOU', 165 ; ; unmangle_name: Does the opposite of mangle_name; converts a DOS-mangled ; filename to the conventional representation. This is needed ; for the BOOT_IMAGE= parameter for the kernel. ; NOTE: A 13-byte buffer is mandatory, even if the string is ; known to be shorter. ; ; DS:SI -> input mangled file name ; ES:DI -> output buffer ; ; On return, DI points to the first byte after the output name, ; which is set to a null byte. ; unmangle_name: push si ; Save pointer to original name mov cx,8 mov bp,di un_copy_body: lodsb call lower_case stosb cmp al,' ' jbe un_cb_space mov bp,di ; Position of last nonblank+1 un_cb_space: loop un_copy_body mov di,bp mov al,'.' ; Don't save stosb mov cx,3 un_copy_ext: lodsb call lower_case stosb cmp al,' ' jbe un_ce_space mov bp,di un_ce_space: loop un_copy_ext mov di,bp mov byte [es:di], 0 pop si ret ; ; lower_case: Lower case a character in AL ; lower_case: cmp al,'A' jb lc_ret cmp al,'Z' ja lc_1 or al,20h ret lc_1: cmp al,lcase_low jb lc_ret cmp al,lcase_high ja lc_ret push bx mov bx,lcase_tab-lcase_low cs xlatb pop bx lc_ret: ret ; ----------------------------------------------------------------------------- ; Common modules ; ----------------------------------------------------------------------------- %include "getc.inc" ; getc et al %include "conio.inc" ; Console I/O %include "writestr.inc" ; String output %include "parseconfig.inc" ; High-level config file handling %include "parsecmd.inc" ; Low-level config file handling %include "bcopy32.inc" ; 32-bit bcopy %include "loadhigh.inc" ; Load a file into high memory %include "font.inc" ; VGA font stuff %include "graphics.inc" ; VGA graphics %include "highmem.inc" ; High memory sizing ; ----------------------------------------------------------------------------- ; Begin data section ; ----------------------------------------------------------------------------- CR equ 13 ; Carriage Return LF equ 10 ; Line Feed FF equ 12 ; Form Feed BS equ 8 ; Backspace ; ; Lower-case table for codepage 865 ; lcase_low equ 128 lcase_high equ 165 lcase_tab db 135, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 db 139, 140, 141, 132, 134, 130, 145, 145, 147, 148, 149 db 150, 151, 152, 148, 129, 155, 156, 155, 158, 159, 160 db 161, 162, 163, 164, 164 copyright_str db ' Copyright (C) 1994-', year, ' H. Peter Anvin' db CR, LF, 0 boot_prompt db 'boot: ', 0 wipe_char db BS, ' ', BS, 0 err_notfound db 'Could not find kernel image: ',0 err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0 err_noram db 'It appears your computer has less than ' asciidec dosram_k db 'K of low ("DOS")' db CR, LF db 'RAM. Linux needs at least this amount to boot. If you get' db CR, LF db 'this message in error, hold down the Ctrl key while' db CR, LF db 'booting, and I will take your word for it.', CR, LF, 0 err_badcfg db 'Unknown keyword in syslinux.cfg.', CR, LF, 0 err_noparm db 'Missing parameter in syslinux.cfg.', CR, LF, 0 err_noinitrd db CR, LF, 'Could not find ramdisk image: ', 0 err_nohighmem db 'Not enough memory to load specified kernel.', CR, LF, 0 err_highload db CR, LF, 'Kernel transfer failure.', CR, LF, 0 err_oldkernel db 'Cannot load a ramdisk with an old kernel image.' db CR, LF, 0 err_notdos db ': attempted DOS system call', CR, LF, 0 err_comlarge db 'COMBOOT image too large.', CR, LF, 0 err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0 err_bootfailed db CR, LF, 'Boot failed: please change disks and press ' db 'a key to continue.', CR, LF, 0 ready_msg db 'Ready.', CR, LF, 0 crlfloading_msg db CR, LF loading_msg db 'Loading ', 0 dotdot_msg db '.' dot_msg db '.', 0 aborted_msg db ' aborted.' ; Fall through to crlf_msg! crlf_msg db CR, LF null_msg db 0 crff_msg db CR, FF, 0 syslinux_cfg db 'SYSLINUXCFG' %if IS_MDSLINUX manifest db 'MANIFEST ' %endif ; ; Command line options we'd like to take a look at ; ; mem= and vga= are handled as normal 32-bit integer values initrd_cmd db 'initrd=' initrd_cmd_len equ 7 ; ; Config file keyword table ; %include "keywords.inc" ; ; Extensions to search for (in *forward* order). ; exten_table: db 'CBT',0 ; COMBOOT (specific) db 'BSS',0 ; Boot Sector (add superblock) db 'BS ',0 ; Boot Sector db 'COM',0 ; COMBOOT (same as DOS) db 'C32',0 ; COM32 exten_table_end: dd 0, 0 ; Need 8 null bytes here ; ; Misc initialized (data) variables ; %ifdef debug ; This code for debugging only debug_magic dw 0D00Dh ; Debug code sentinel %endif AppendLen dw 0 ; Bytes in append= command OntimeoutLen dw 0 ; Bytes in ontimeout command OnerrorLen dw 0 ; Bytes in onerror command KbdTimeOut dw 0 ; Keyboard timeout (if any) CmdLinePtr dw cmd_line_here ; Command line advancing pointer initrd_flag equ $ initrd_ptr dw 0 ; Initial ramdisk pointer/flag VKernelCtr dw 0 ; Number of registered vkernels ForcePrompt dw 0 ; Force prompt AllowImplicit dw 1 ; Allow implicit kernels AllowOptions dw 1 ; User-specified options allowed SerialPort dw 0 ; Serial port base (or 0 for no serial port) VGAFontSize dw 16 ; Defaults to 16 byte font UserFont db 0 ; Using a user-specified font ScrollAttribute db 07h ; White on black (for text mode) ; ; Stuff for the command line; we do some trickery here with equ to avoid ; tons of zeros appended to our file and wasting space ; linuxauto_cmd db 'linux auto',0 linuxauto_len equ $-linuxauto_cmd boot_image db 'BOOT_IMAGE=' boot_image_len equ $-boot_image ldlinux_end equ $ ldlinux_len equ $-ldlinux_magic ; ; Put the getcbuf right after the code, aligned on a sector boundary ; end_of_code equ (ldlinux_end-bootsec)+7C00h getcbuf equ (end_of_code + 511) & 0FE00h ; VGA font buffer at the end of memory (so loading a font works even ; in graphics mode.) vgafontbuf equ 0E000h ; This is a compile-time assert that we didn't run out of space %ifndef DEPEND %if (getcbuf+trackbufsize) > vgafontbuf %error "Out of memory, better reorganize something..." %endif %endif
28.60779
80
0.6623
e904abf9c18bf4970dcd6119f8438c3503b924bf
792
asm
Assembly
oeis/089/A089408.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/089/A089408.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/089/A089408.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A089408: Number of fixed points in range [A014137(n-1)..A014138(n-1)] of permutation A089864. ; Submitted by Jon Maiga ; 1,1,2,1,2,2,4,5,10,14,28,42,84,132,264,429,858,1430,2860,4862,9724,16796,33592,58786,117572,208012,416024,742900,1485800,2674440,5348880,9694845,19389690,35357670,70715340,129644790,259289580,477638700,955277400,1767263190,3534526380,6564120420,13128240840,24466267020,48932534040,91482563640,182965127280,343059613650,686119227300,1289904147324,2579808294648,4861946401452,9723892802904,18367353072152,36734706144304,69533550916004,139067101832008,263747951750360,527495903500720,1002242216651368 trn $0,1 mov $2,$0 div $0,2 seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). mod $2,2 seq $2,59426 ; First differences of A026273. mul $0,$2
66
499
0.792929
19c0b3f9241e30376567755a837c58ae3b2ce8b6
3,248
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i3-7100_9_0xca_notsx.log_480_575.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i3-7100_9_0xca_notsx.log_480_575.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i3-7100_9_0xca_notsx.log_480_575.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 %rbp push %rbx push %rcx push %rdx push %rsi lea addresses_normal_ht+0xed2e, %rbx sub %rcx, %rcx movb $0x61, (%rbx) nop and %rcx, %rcx lea addresses_UC_ht+0x1436e, %rsi mfence movups (%rsi), %xmm6 vpextrq $0, %xmm6, %rdx add %rbx, %rbx pop %rsi pop %rdx pop %rcx pop %rbx pop %rbp ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %rbp push %rbx push %rcx push %rdx push %rsi // Load lea addresses_RW+0x55e2, %rbp nop nop nop nop sub %rsi, %rsi mov (%rbp), %r11w add $18163, %rcx // Store lea addresses_D+0x1346e, %rbx nop nop xor $5839, %r10 mov $0x5152535455565758, %rcx movq %rcx, (%rbx) nop nop nop nop add %rbp, %rbp // Faulty Load lea addresses_D+0x18d2e, %rbx nop nop nop nop dec %rsi vmovaps (%rbx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rcx lea oracles, %rbp and $0xff, %rcx shlq $12, %rcx mov (%rbp,%rcx,1), %rcx pop %rsi pop %rdx pop %rcx pop %rbx pop %rbp pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_D', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 179, '47': 301} 47 47 47 00 00 47 47 47 00 00 47 47 47 47 47 00 47 00 47 47 47 00 47 00 47 47 00 00 00 47 47 47 47 00 00 47 00 47 47 00 00 47 47 47 00 47 00 00 47 47 00 47 47 47 47 00 47 47 00 47 00 47 00 47 47 00 47 00 47 00 47 47 00 00 47 00 47 47 47 00 47 47 47 47 47 47 47 00 00 00 47 47 47 00 00 47 47 00 47 00 47 47 47 00 47 47 00 00 00 00 47 00 47 47 47 00 00 47 00 47 00 47 47 47 47 47 00 47 00 47 47 47 47 47 00 00 47 00 47 00 00 47 00 47 47 47 47 47 47 47 00 47 00 47 00 47 47 47 47 00 47 00 47 00 47 47 00 47 00 00 00 47 00 47 47 00 47 47 47 00 47 47 47 47 47 00 00 47 47 47 47 47 00 47 00 47 47 47 47 47 00 00 47 00 47 47 47 47 00 47 47 47 47 00 00 47 00 47 47 47 47 47 47 47 47 47 47 47 00 47 47 47 47 00 00 00 47 00 47 00 00 47 00 47 47 00 47 47 47 00 47 47 47 47 47 00 47 00 47 47 47 47 47 47 47 00 47 47 00 00 47 47 47 00 47 00 47 47 00 47 47 00 00 47 00 47 47 00 00 47 00 00 47 47 47 00 47 00 47 47 47 47 47 47 00 47 00 00 47 47 00 47 00 00 47 47 00 00 00 47 47 00 00 47 00 00 47 00 47 00 47 47 00 00 47 47 47 00 00 47 00 00 47 00 47 47 00 00 47 00 00 00 00 00 00 00 00 47 47 47 00 47 47 47 47 47 47 47 47 00 00 00 47 00 47 47 47 47 00 47 47 47 47 00 00 47 47 47 00 47 47 47 47 00 47 47 47 47 47 47 47 47 00 00 47 47 47 47 47 00 47 47 00 47 00 47 47 47 47 00 00 00 47 47 00 00 47 47 00 47 47 00 47 47 00 00 47 00 47 47 47 00 47 47 00 00 47 47 47 00 47 00 00 47 00 47 47 47 00 47 47 47 47 00 47 00 47 00 47 47 47 00 00 00 47 47 00 47 47 47 */
34.189474
1,439
0.652709
266ceb34764063131a29f2660af2c0ee9e46ea22
59,697
asm
Assembly
init.asm
phung001/xv6_lab2_mark
3ba15e5880a3facdb709c3708d8366ade948cba2
[ "MIT-0" ]
null
null
null
init.asm
phung001/xv6_lab2_mark
3ba15e5880a3facdb709c3708d8366ade948cba2
[ "MIT-0" ]
null
null
null
init.asm
phung001/xv6_lab2_mark
3ba15e5880a3facdb709c3708d8366ade948cba2
[ "MIT-0" ]
null
null
null
_init: file format elf32-i386 Disassembly of section .text: 00000000 <main>: char *argv[] = { "sh", 0 }; int main(void) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 20 sub $0x20,%esp int pid, wpid; if(open("console", O_RDWR) < 0){ 9: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 10: 00 11: c7 04 24 21 0c 00 00 movl $0xc21,(%esp) 18: e8 9f 03 00 00 call 3bc <open> 1d: 85 c0 test %eax,%eax 1f: 79 30 jns 51 <main+0x51> mknod("console", 1, 1); 21: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 28: 00 29: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 30: 00 31: c7 04 24 21 0c 00 00 movl $0xc21,(%esp) 38: e8 87 03 00 00 call 3c4 <mknod> open("console", O_RDWR); 3d: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 44: 00 45: c7 04 24 21 0c 00 00 movl $0xc21,(%esp) 4c: e8 6b 03 00 00 call 3bc <open> } dup(0); // stdout 51: c7 04 24 00 00 00 00 movl $0x0,(%esp) 58: e8 97 03 00 00 call 3f4 <dup> dup(0); // stderr 5d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 64: e8 8b 03 00 00 call 3f4 <dup> 69: eb 01 jmp 6c <main+0x6c> printf(1, "init: exec sh failed\n"); exit(); } while((wpid=wait()) >= 0 && wpid != pid) printf(1, "zombie!\n"); } 6b: 90 nop } dup(0); // stdout dup(0); // stderr for(;;){ printf(1, "init: starting sh\n"); 6c: c7 44 24 04 29 0c 00 movl $0xc29,0x4(%esp) 73: 00 74: c7 04 24 01 00 00 00 movl $0x1,(%esp) 7b: e8 9d 04 00 00 call 51d <printf> pid = fork(); 80: e8 ef 02 00 00 call 374 <fork> 85: 89 44 24 18 mov %eax,0x18(%esp) if(pid < 0){ 89: 83 7c 24 18 00 cmpl $0x0,0x18(%esp) 8e: 79 19 jns a9 <main+0xa9> printf(1, "init: fork failed\n"); 90: c7 44 24 04 3c 0c 00 movl $0xc3c,0x4(%esp) 97: 00 98: c7 04 24 01 00 00 00 movl $0x1,(%esp) 9f: e8 79 04 00 00 call 51d <printf> exit(); a4: e8 d3 02 00 00 call 37c <exit> } if(pid == 0){ a9: 83 7c 24 18 00 cmpl $0x0,0x18(%esp) ae: 75 43 jne f3 <main+0xf3> exec("sh", argv); b0: c7 44 24 04 b8 0c 00 movl $0xcb8,0x4(%esp) b7: 00 b8: c7 04 24 1e 0c 00 00 movl $0xc1e,(%esp) bf: e8 f0 02 00 00 call 3b4 <exec> printf(1, "init: exec sh failed\n"); c4: c7 44 24 04 4f 0c 00 movl $0xc4f,0x4(%esp) cb: 00 cc: c7 04 24 01 00 00 00 movl $0x1,(%esp) d3: e8 45 04 00 00 call 51d <printf> exit(); d8: e8 9f 02 00 00 call 37c <exit> } while((wpid=wait()) >= 0 && wpid != pid) printf(1, "zombie!\n"); dd: c7 44 24 04 65 0c 00 movl $0xc65,0x4(%esp) e4: 00 e5: c7 04 24 01 00 00 00 movl $0x1,(%esp) ec: e8 2c 04 00 00 call 51d <printf> f1: eb 01 jmp f4 <main+0xf4> if(pid == 0){ exec("sh", argv); printf(1, "init: exec sh failed\n"); exit(); } while((wpid=wait()) >= 0 && wpid != pid) f3: 90 nop f4: e8 8b 02 00 00 call 384 <wait> f9: 89 44 24 1c mov %eax,0x1c(%esp) fd: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp) 102: 0f 88 63 ff ff ff js 6b <main+0x6b> 108: 8b 44 24 1c mov 0x1c(%esp),%eax 10c: 3b 44 24 18 cmp 0x18(%esp),%eax 110: 75 cb jne dd <main+0xdd> printf(1, "zombie!\n"); } 112: e9 55 ff ff ff jmp 6c <main+0x6c> 117: 90 nop 00000118 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 118: 55 push %ebp 119: 89 e5 mov %esp,%ebp 11b: 57 push %edi 11c: 53 push %ebx asm volatile("cld; rep stosb" : 11d: 8b 4d 08 mov 0x8(%ebp),%ecx 120: 8b 55 10 mov 0x10(%ebp),%edx 123: 8b 45 0c mov 0xc(%ebp),%eax 126: 89 cb mov %ecx,%ebx 128: 89 df mov %ebx,%edi 12a: 89 d1 mov %edx,%ecx 12c: fc cld 12d: f3 aa rep stos %al,%es:(%edi) 12f: 89 ca mov %ecx,%edx 131: 89 fb mov %edi,%ebx 133: 89 5d 08 mov %ebx,0x8(%ebp) 136: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 139: 5b pop %ebx 13a: 5f pop %edi 13b: 5d pop %ebp 13c: c3 ret 0000013d <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 13d: 55 push %ebp 13e: 89 e5 mov %esp,%ebp 140: 83 ec 10 sub $0x10,%esp char *os; os = s; 143: 8b 45 08 mov 0x8(%ebp),%eax 146: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 149: 8b 45 0c mov 0xc(%ebp),%eax 14c: 0f b6 10 movzbl (%eax),%edx 14f: 8b 45 08 mov 0x8(%ebp),%eax 152: 88 10 mov %dl,(%eax) 154: 8b 45 08 mov 0x8(%ebp),%eax 157: 0f b6 00 movzbl (%eax),%eax 15a: 84 c0 test %al,%al 15c: 0f 95 c0 setne %al 15f: 83 45 08 01 addl $0x1,0x8(%ebp) 163: 83 45 0c 01 addl $0x1,0xc(%ebp) 167: 84 c0 test %al,%al 169: 75 de jne 149 <strcpy+0xc> ; return os; 16b: 8b 45 fc mov -0x4(%ebp),%eax } 16e: c9 leave 16f: c3 ret 00000170 <strcmp>: int strcmp(const char *p, const char *q) { 170: 55 push %ebp 171: 89 e5 mov %esp,%ebp while(*p && *p == *q) 173: eb 08 jmp 17d <strcmp+0xd> p++, q++; 175: 83 45 08 01 addl $0x1,0x8(%ebp) 179: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 17d: 8b 45 08 mov 0x8(%ebp),%eax 180: 0f b6 00 movzbl (%eax),%eax 183: 84 c0 test %al,%al 185: 74 10 je 197 <strcmp+0x27> 187: 8b 45 08 mov 0x8(%ebp),%eax 18a: 0f b6 10 movzbl (%eax),%edx 18d: 8b 45 0c mov 0xc(%ebp),%eax 190: 0f b6 00 movzbl (%eax),%eax 193: 38 c2 cmp %al,%dl 195: 74 de je 175 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 197: 8b 45 08 mov 0x8(%ebp),%eax 19a: 0f b6 00 movzbl (%eax),%eax 19d: 0f b6 d0 movzbl %al,%edx 1a0: 8b 45 0c mov 0xc(%ebp),%eax 1a3: 0f b6 00 movzbl (%eax),%eax 1a6: 0f b6 c0 movzbl %al,%eax 1a9: 89 d1 mov %edx,%ecx 1ab: 29 c1 sub %eax,%ecx 1ad: 89 c8 mov %ecx,%eax } 1af: 5d pop %ebp 1b0: c3 ret 000001b1 <strlen>: uint strlen(char *s) { 1b1: 55 push %ebp 1b2: 89 e5 mov %esp,%ebp 1b4: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1b7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1be: eb 04 jmp 1c4 <strlen+0x13> 1c0: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1c4: 8b 45 fc mov -0x4(%ebp),%eax 1c7: 03 45 08 add 0x8(%ebp),%eax 1ca: 0f b6 00 movzbl (%eax),%eax 1cd: 84 c0 test %al,%al 1cf: 75 ef jne 1c0 <strlen+0xf> ; return n; 1d1: 8b 45 fc mov -0x4(%ebp),%eax } 1d4: c9 leave 1d5: c3 ret 000001d6 <memset>: void* memset(void *dst, int c, uint n) { 1d6: 55 push %ebp 1d7: 89 e5 mov %esp,%ebp 1d9: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 1dc: 8b 45 10 mov 0x10(%ebp),%eax 1df: 89 44 24 08 mov %eax,0x8(%esp) 1e3: 8b 45 0c mov 0xc(%ebp),%eax 1e6: 89 44 24 04 mov %eax,0x4(%esp) 1ea: 8b 45 08 mov 0x8(%ebp),%eax 1ed: 89 04 24 mov %eax,(%esp) 1f0: e8 23 ff ff ff call 118 <stosb> return dst; 1f5: 8b 45 08 mov 0x8(%ebp),%eax } 1f8: c9 leave 1f9: c3 ret 000001fa <strchr>: char* strchr(const char *s, char c) { 1fa: 55 push %ebp 1fb: 89 e5 mov %esp,%ebp 1fd: 83 ec 04 sub $0x4,%esp 200: 8b 45 0c mov 0xc(%ebp),%eax 203: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 206: eb 14 jmp 21c <strchr+0x22> if(*s == c) 208: 8b 45 08 mov 0x8(%ebp),%eax 20b: 0f b6 00 movzbl (%eax),%eax 20e: 3a 45 fc cmp -0x4(%ebp),%al 211: 75 05 jne 218 <strchr+0x1e> return (char*)s; 213: 8b 45 08 mov 0x8(%ebp),%eax 216: eb 13 jmp 22b <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 218: 83 45 08 01 addl $0x1,0x8(%ebp) 21c: 8b 45 08 mov 0x8(%ebp),%eax 21f: 0f b6 00 movzbl (%eax),%eax 222: 84 c0 test %al,%al 224: 75 e2 jne 208 <strchr+0xe> if(*s == c) return (char*)s; return 0; 226: b8 00 00 00 00 mov $0x0,%eax } 22b: c9 leave 22c: c3 ret 0000022d <gets>: char* gets(char *buf, int max) { 22d: 55 push %ebp 22e: 89 e5 mov %esp,%ebp 230: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 233: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 23a: eb 44 jmp 280 <gets+0x53> cc = read(0, &c, 1); 23c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 243: 00 244: 8d 45 ef lea -0x11(%ebp),%eax 247: 89 44 24 04 mov %eax,0x4(%esp) 24b: c7 04 24 00 00 00 00 movl $0x0,(%esp) 252: e8 3d 01 00 00 call 394 <read> 257: 89 45 f4 mov %eax,-0xc(%ebp) if(cc < 1) 25a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 25e: 7e 2d jle 28d <gets+0x60> break; buf[i++] = c; 260: 8b 45 f0 mov -0x10(%ebp),%eax 263: 03 45 08 add 0x8(%ebp),%eax 266: 0f b6 55 ef movzbl -0x11(%ebp),%edx 26a: 88 10 mov %dl,(%eax) 26c: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(c == '\n' || c == '\r') 270: 0f b6 45 ef movzbl -0x11(%ebp),%eax 274: 3c 0a cmp $0xa,%al 276: 74 16 je 28e <gets+0x61> 278: 0f b6 45 ef movzbl -0x11(%ebp),%eax 27c: 3c 0d cmp $0xd,%al 27e: 74 0e je 28e <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 280: 8b 45 f0 mov -0x10(%ebp),%eax 283: 83 c0 01 add $0x1,%eax 286: 3b 45 0c cmp 0xc(%ebp),%eax 289: 7c b1 jl 23c <gets+0xf> 28b: eb 01 jmp 28e <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; 28d: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 28e: 8b 45 f0 mov -0x10(%ebp),%eax 291: 03 45 08 add 0x8(%ebp),%eax 294: c6 00 00 movb $0x0,(%eax) return buf; 297: 8b 45 08 mov 0x8(%ebp),%eax } 29a: c9 leave 29b: c3 ret 0000029c <stat>: int stat(char *n, struct stat *st) { 29c: 55 push %ebp 29d: 89 e5 mov %esp,%ebp 29f: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 2a2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 2a9: 00 2aa: 8b 45 08 mov 0x8(%ebp),%eax 2ad: 89 04 24 mov %eax,(%esp) 2b0: e8 07 01 00 00 call 3bc <open> 2b5: 89 45 f0 mov %eax,-0x10(%ebp) if(fd < 0) 2b8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 2bc: 79 07 jns 2c5 <stat+0x29> return -1; 2be: b8 ff ff ff ff mov $0xffffffff,%eax 2c3: eb 23 jmp 2e8 <stat+0x4c> r = fstat(fd, st); 2c5: 8b 45 0c mov 0xc(%ebp),%eax 2c8: 89 44 24 04 mov %eax,0x4(%esp) 2cc: 8b 45 f0 mov -0x10(%ebp),%eax 2cf: 89 04 24 mov %eax,(%esp) 2d2: e8 fd 00 00 00 call 3d4 <fstat> 2d7: 89 45 f4 mov %eax,-0xc(%ebp) close(fd); 2da: 8b 45 f0 mov -0x10(%ebp),%eax 2dd: 89 04 24 mov %eax,(%esp) 2e0: e8 bf 00 00 00 call 3a4 <close> return r; 2e5: 8b 45 f4 mov -0xc(%ebp),%eax } 2e8: c9 leave 2e9: c3 ret 000002ea <atoi>: int atoi(const char *s) { 2ea: 55 push %ebp 2eb: 89 e5 mov %esp,%ebp 2ed: 83 ec 10 sub $0x10,%esp int n; n = 0; 2f0: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 2f7: eb 24 jmp 31d <atoi+0x33> n = n*10 + *s++ - '0'; 2f9: 8b 55 fc mov -0x4(%ebp),%edx 2fc: 89 d0 mov %edx,%eax 2fe: c1 e0 02 shl $0x2,%eax 301: 01 d0 add %edx,%eax 303: 01 c0 add %eax,%eax 305: 89 c2 mov %eax,%edx 307: 8b 45 08 mov 0x8(%ebp),%eax 30a: 0f b6 00 movzbl (%eax),%eax 30d: 0f be c0 movsbl %al,%eax 310: 8d 04 02 lea (%edx,%eax,1),%eax 313: 83 e8 30 sub $0x30,%eax 316: 89 45 fc mov %eax,-0x4(%ebp) 319: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 31d: 8b 45 08 mov 0x8(%ebp),%eax 320: 0f b6 00 movzbl (%eax),%eax 323: 3c 2f cmp $0x2f,%al 325: 7e 0a jle 331 <atoi+0x47> 327: 8b 45 08 mov 0x8(%ebp),%eax 32a: 0f b6 00 movzbl (%eax),%eax 32d: 3c 39 cmp $0x39,%al 32f: 7e c8 jle 2f9 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 331: 8b 45 fc mov -0x4(%ebp),%eax } 334: c9 leave 335: c3 ret 00000336 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 336: 55 push %ebp 337: 89 e5 mov %esp,%ebp 339: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 33c: 8b 45 08 mov 0x8(%ebp),%eax 33f: 89 45 f8 mov %eax,-0x8(%ebp) src = vsrc; 342: 8b 45 0c mov 0xc(%ebp),%eax 345: 89 45 fc mov %eax,-0x4(%ebp) while(n-- > 0) 348: eb 13 jmp 35d <memmove+0x27> *dst++ = *src++; 34a: 8b 45 fc mov -0x4(%ebp),%eax 34d: 0f b6 10 movzbl (%eax),%edx 350: 8b 45 f8 mov -0x8(%ebp),%eax 353: 88 10 mov %dl,(%eax) 355: 83 45 f8 01 addl $0x1,-0x8(%ebp) 359: 83 45 fc 01 addl $0x1,-0x4(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 35d: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 361: 0f 9f c0 setg %al 364: 83 6d 10 01 subl $0x1,0x10(%ebp) 368: 84 c0 test %al,%al 36a: 75 de jne 34a <memmove+0x14> *dst++ = *src++; return vdst; 36c: 8b 45 08 mov 0x8(%ebp),%eax } 36f: c9 leave 370: c3 ret 371: 90 nop 372: 90 nop 373: 90 nop 00000374 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 374: b8 01 00 00 00 mov $0x1,%eax 379: cd 40 int $0x40 37b: c3 ret 0000037c <exit>: SYSCALL(exit) 37c: b8 02 00 00 00 mov $0x2,%eax 381: cd 40 int $0x40 383: c3 ret 00000384 <wait>: SYSCALL(wait) 384: b8 03 00 00 00 mov $0x3,%eax 389: cd 40 int $0x40 38b: c3 ret 0000038c <pipe>: SYSCALL(pipe) 38c: b8 04 00 00 00 mov $0x4,%eax 391: cd 40 int $0x40 393: c3 ret 00000394 <read>: SYSCALL(read) 394: b8 05 00 00 00 mov $0x5,%eax 399: cd 40 int $0x40 39b: c3 ret 0000039c <write>: SYSCALL(write) 39c: b8 10 00 00 00 mov $0x10,%eax 3a1: cd 40 int $0x40 3a3: c3 ret 000003a4 <close>: SYSCALL(close) 3a4: b8 15 00 00 00 mov $0x15,%eax 3a9: cd 40 int $0x40 3ab: c3 ret 000003ac <kill>: SYSCALL(kill) 3ac: b8 06 00 00 00 mov $0x6,%eax 3b1: cd 40 int $0x40 3b3: c3 ret 000003b4 <exec>: SYSCALL(exec) 3b4: b8 07 00 00 00 mov $0x7,%eax 3b9: cd 40 int $0x40 3bb: c3 ret 000003bc <open>: SYSCALL(open) 3bc: b8 0f 00 00 00 mov $0xf,%eax 3c1: cd 40 int $0x40 3c3: c3 ret 000003c4 <mknod>: SYSCALL(mknod) 3c4: b8 11 00 00 00 mov $0x11,%eax 3c9: cd 40 int $0x40 3cb: c3 ret 000003cc <unlink>: SYSCALL(unlink) 3cc: b8 12 00 00 00 mov $0x12,%eax 3d1: cd 40 int $0x40 3d3: c3 ret 000003d4 <fstat>: SYSCALL(fstat) 3d4: b8 08 00 00 00 mov $0x8,%eax 3d9: cd 40 int $0x40 3db: c3 ret 000003dc <link>: SYSCALL(link) 3dc: b8 13 00 00 00 mov $0x13,%eax 3e1: cd 40 int $0x40 3e3: c3 ret 000003e4 <mkdir>: SYSCALL(mkdir) 3e4: b8 14 00 00 00 mov $0x14,%eax 3e9: cd 40 int $0x40 3eb: c3 ret 000003ec <chdir>: SYSCALL(chdir) 3ec: b8 09 00 00 00 mov $0x9,%eax 3f1: cd 40 int $0x40 3f3: c3 ret 000003f4 <dup>: SYSCALL(dup) 3f4: b8 0a 00 00 00 mov $0xa,%eax 3f9: cd 40 int $0x40 3fb: c3 ret 000003fc <getpid>: SYSCALL(getpid) 3fc: b8 0b 00 00 00 mov $0xb,%eax 401: cd 40 int $0x40 403: c3 ret 00000404 <sbrk>: SYSCALL(sbrk) 404: b8 0c 00 00 00 mov $0xc,%eax 409: cd 40 int $0x40 40b: c3 ret 0000040c <sleep>: SYSCALL(sleep) 40c: b8 0d 00 00 00 mov $0xd,%eax 411: cd 40 int $0x40 413: c3 ret 00000414 <uptime>: SYSCALL(uptime) 414: b8 0e 00 00 00 mov $0xe,%eax 419: cd 40 int $0x40 41b: c3 ret 0000041c <clone>: SYSCALL(clone) 41c: b8 16 00 00 00 mov $0x16,%eax 421: cd 40 int $0x40 423: c3 ret 00000424 <texit>: SYSCALL(texit) 424: b8 17 00 00 00 mov $0x17,%eax 429: cd 40 int $0x40 42b: c3 ret 0000042c <tsleep>: SYSCALL(tsleep) 42c: b8 18 00 00 00 mov $0x18,%eax 431: cd 40 int $0x40 433: c3 ret 00000434 <twakeup>: SYSCALL(twakeup) 434: b8 19 00 00 00 mov $0x19,%eax 439: cd 40 int $0x40 43b: c3 ret 0000043c <thread_yield>: SYSCALL(thread_yield) 43c: b8 1a 00 00 00 mov $0x1a,%eax 441: cd 40 int $0x40 443: c3 ret 00000444 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 444: 55 push %ebp 445: 89 e5 mov %esp,%ebp 447: 83 ec 28 sub $0x28,%esp 44a: 8b 45 0c mov 0xc(%ebp),%eax 44d: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 450: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 457: 00 458: 8d 45 f4 lea -0xc(%ebp),%eax 45b: 89 44 24 04 mov %eax,0x4(%esp) 45f: 8b 45 08 mov 0x8(%ebp),%eax 462: 89 04 24 mov %eax,(%esp) 465: e8 32 ff ff ff call 39c <write> } 46a: c9 leave 46b: c3 ret 0000046c <printint>: static void printint(int fd, int xx, int base, int sgn) { 46c: 55 push %ebp 46d: 89 e5 mov %esp,%ebp 46f: 53 push %ebx 470: 83 ec 44 sub $0x44,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 473: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 47a: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 47e: 74 17 je 497 <printint+0x2b> 480: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 484: 79 11 jns 497 <printint+0x2b> neg = 1; 486: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 48d: 8b 45 0c mov 0xc(%ebp),%eax 490: f7 d8 neg %eax 492: 89 45 f4 mov %eax,-0xc(%ebp) char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 495: eb 06 jmp 49d <printint+0x31> neg = 1; x = -xx; } else { x = xx; 497: 8b 45 0c mov 0xc(%ebp),%eax 49a: 89 45 f4 mov %eax,-0xc(%ebp) } i = 0; 49d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) do{ buf[i++] = digits[x % base]; 4a4: 8b 4d ec mov -0x14(%ebp),%ecx 4a7: 8b 5d 10 mov 0x10(%ebp),%ebx 4aa: 8b 45 f4 mov -0xc(%ebp),%eax 4ad: ba 00 00 00 00 mov $0x0,%edx 4b2: f7 f3 div %ebx 4b4: 89 d0 mov %edx,%eax 4b6: 0f b6 80 c0 0c 00 00 movzbl 0xcc0(%eax),%eax 4bd: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) 4c1: 83 45 ec 01 addl $0x1,-0x14(%ebp) }while((x /= base) != 0); 4c5: 8b 45 10 mov 0x10(%ebp),%eax 4c8: 89 45 d4 mov %eax,-0x2c(%ebp) 4cb: 8b 45 f4 mov -0xc(%ebp),%eax 4ce: ba 00 00 00 00 mov $0x0,%edx 4d3: f7 75 d4 divl -0x2c(%ebp) 4d6: 89 45 f4 mov %eax,-0xc(%ebp) 4d9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4dd: 75 c5 jne 4a4 <printint+0x38> if(neg) 4df: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 4e3: 74 28 je 50d <printint+0xa1> buf[i++] = '-'; 4e5: 8b 45 ec mov -0x14(%ebp),%eax 4e8: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) 4ed: 83 45 ec 01 addl $0x1,-0x14(%ebp) while(--i >= 0) 4f1: eb 1a jmp 50d <printint+0xa1> putc(fd, buf[i]); 4f3: 8b 45 ec mov -0x14(%ebp),%eax 4f6: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax 4fb: 0f be c0 movsbl %al,%eax 4fe: 89 44 24 04 mov %eax,0x4(%esp) 502: 8b 45 08 mov 0x8(%ebp),%eax 505: 89 04 24 mov %eax,(%esp) 508: e8 37 ff ff ff call 444 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 50d: 83 6d ec 01 subl $0x1,-0x14(%ebp) 511: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 515: 79 dc jns 4f3 <printint+0x87> putc(fd, buf[i]); } 517: 83 c4 44 add $0x44,%esp 51a: 5b pop %ebx 51b: 5d pop %ebp 51c: c3 ret 0000051d <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 51d: 55 push %ebp 51e: 89 e5 mov %esp,%ebp 520: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 523: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ap = (uint*)(void*)&fmt + 1; 52a: 8d 45 0c lea 0xc(%ebp),%eax 52d: 83 c0 04 add $0x4,%eax 530: 89 45 f4 mov %eax,-0xc(%ebp) for(i = 0; fmt[i]; i++){ 533: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 53a: e9 7e 01 00 00 jmp 6bd <printf+0x1a0> c = fmt[i] & 0xff; 53f: 8b 55 0c mov 0xc(%ebp),%edx 542: 8b 45 ec mov -0x14(%ebp),%eax 545: 8d 04 02 lea (%edx,%eax,1),%eax 548: 0f b6 00 movzbl (%eax),%eax 54b: 0f be c0 movsbl %al,%eax 54e: 25 ff 00 00 00 and $0xff,%eax 553: 89 45 e8 mov %eax,-0x18(%ebp) if(state == 0){ 556: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 55a: 75 2c jne 588 <printf+0x6b> if(c == '%'){ 55c: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 560: 75 0c jne 56e <printf+0x51> state = '%'; 562: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp) 569: e9 4b 01 00 00 jmp 6b9 <printf+0x19c> } else { putc(fd, c); 56e: 8b 45 e8 mov -0x18(%ebp),%eax 571: 0f be c0 movsbl %al,%eax 574: 89 44 24 04 mov %eax,0x4(%esp) 578: 8b 45 08 mov 0x8(%ebp),%eax 57b: 89 04 24 mov %eax,(%esp) 57e: e8 c1 fe ff ff call 444 <putc> 583: e9 31 01 00 00 jmp 6b9 <printf+0x19c> } } else if(state == '%'){ 588: 83 7d f0 25 cmpl $0x25,-0x10(%ebp) 58c: 0f 85 27 01 00 00 jne 6b9 <printf+0x19c> if(c == 'd'){ 592: 83 7d e8 64 cmpl $0x64,-0x18(%ebp) 596: 75 2d jne 5c5 <printf+0xa8> printint(fd, *ap, 10, 1); 598: 8b 45 f4 mov -0xc(%ebp),%eax 59b: 8b 00 mov (%eax),%eax 59d: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 5a4: 00 5a5: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 5ac: 00 5ad: 89 44 24 04 mov %eax,0x4(%esp) 5b1: 8b 45 08 mov 0x8(%ebp),%eax 5b4: 89 04 24 mov %eax,(%esp) 5b7: e8 b0 fe ff ff call 46c <printint> ap++; 5bc: 83 45 f4 04 addl $0x4,-0xc(%ebp) 5c0: e9 ed 00 00 00 jmp 6b2 <printf+0x195> } else if(c == 'x' || c == 'p'){ 5c5: 83 7d e8 78 cmpl $0x78,-0x18(%ebp) 5c9: 74 06 je 5d1 <printf+0xb4> 5cb: 83 7d e8 70 cmpl $0x70,-0x18(%ebp) 5cf: 75 2d jne 5fe <printf+0xe1> printint(fd, *ap, 16, 0); 5d1: 8b 45 f4 mov -0xc(%ebp),%eax 5d4: 8b 00 mov (%eax),%eax 5d6: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 5dd: 00 5de: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 5e5: 00 5e6: 89 44 24 04 mov %eax,0x4(%esp) 5ea: 8b 45 08 mov 0x8(%ebp),%eax 5ed: 89 04 24 mov %eax,(%esp) 5f0: e8 77 fe ff ff call 46c <printint> ap++; 5f5: 83 45 f4 04 addl $0x4,-0xc(%ebp) } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 5f9: e9 b4 00 00 00 jmp 6b2 <printf+0x195> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 5fe: 83 7d e8 73 cmpl $0x73,-0x18(%ebp) 602: 75 46 jne 64a <printf+0x12d> s = (char*)*ap; 604: 8b 45 f4 mov -0xc(%ebp),%eax 607: 8b 00 mov (%eax),%eax 609: 89 45 e4 mov %eax,-0x1c(%ebp) ap++; 60c: 83 45 f4 04 addl $0x4,-0xc(%ebp) if(s == 0) 610: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 614: 75 27 jne 63d <printf+0x120> s = "(null)"; 616: c7 45 e4 6e 0c 00 00 movl $0xc6e,-0x1c(%ebp) while(*s != 0){ 61d: eb 1f jmp 63e <printf+0x121> putc(fd, *s); 61f: 8b 45 e4 mov -0x1c(%ebp),%eax 622: 0f b6 00 movzbl (%eax),%eax 625: 0f be c0 movsbl %al,%eax 628: 89 44 24 04 mov %eax,0x4(%esp) 62c: 8b 45 08 mov 0x8(%ebp),%eax 62f: 89 04 24 mov %eax,(%esp) 632: e8 0d fe ff ff call 444 <putc> s++; 637: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 63b: eb 01 jmp 63e <printf+0x121> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 63d: 90 nop 63e: 8b 45 e4 mov -0x1c(%ebp),%eax 641: 0f b6 00 movzbl (%eax),%eax 644: 84 c0 test %al,%al 646: 75 d7 jne 61f <printf+0x102> 648: eb 68 jmp 6b2 <printf+0x195> putc(fd, *s); s++; } } else if(c == 'c'){ 64a: 83 7d e8 63 cmpl $0x63,-0x18(%ebp) 64e: 75 1d jne 66d <printf+0x150> putc(fd, *ap); 650: 8b 45 f4 mov -0xc(%ebp),%eax 653: 8b 00 mov (%eax),%eax 655: 0f be c0 movsbl %al,%eax 658: 89 44 24 04 mov %eax,0x4(%esp) 65c: 8b 45 08 mov 0x8(%ebp),%eax 65f: 89 04 24 mov %eax,(%esp) 662: e8 dd fd ff ff call 444 <putc> ap++; 667: 83 45 f4 04 addl $0x4,-0xc(%ebp) 66b: eb 45 jmp 6b2 <printf+0x195> } else if(c == '%'){ 66d: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 671: 75 17 jne 68a <printf+0x16d> putc(fd, c); 673: 8b 45 e8 mov -0x18(%ebp),%eax 676: 0f be c0 movsbl %al,%eax 679: 89 44 24 04 mov %eax,0x4(%esp) 67d: 8b 45 08 mov 0x8(%ebp),%eax 680: 89 04 24 mov %eax,(%esp) 683: e8 bc fd ff ff call 444 <putc> 688: eb 28 jmp 6b2 <printf+0x195> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 68a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 691: 00 692: 8b 45 08 mov 0x8(%ebp),%eax 695: 89 04 24 mov %eax,(%esp) 698: e8 a7 fd ff ff call 444 <putc> putc(fd, c); 69d: 8b 45 e8 mov -0x18(%ebp),%eax 6a0: 0f be c0 movsbl %al,%eax 6a3: 89 44 24 04 mov %eax,0x4(%esp) 6a7: 8b 45 08 mov 0x8(%ebp),%eax 6aa: 89 04 24 mov %eax,(%esp) 6ad: e8 92 fd ff ff call 444 <putc> } state = 0; 6b2: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 6b9: 83 45 ec 01 addl $0x1,-0x14(%ebp) 6bd: 8b 55 0c mov 0xc(%ebp),%edx 6c0: 8b 45 ec mov -0x14(%ebp),%eax 6c3: 8d 04 02 lea (%edx,%eax,1),%eax 6c6: 0f b6 00 movzbl (%eax),%eax 6c9: 84 c0 test %al,%al 6cb: 0f 85 6e fe ff ff jne 53f <printf+0x22> putc(fd, c); } state = 0; } } } 6d1: c9 leave 6d2: c3 ret 6d3: 90 nop 000006d4 <free>: static Header base; static Header *freep; void free(void *ap) { 6d4: 55 push %ebp 6d5: 89 e5 mov %esp,%ebp 6d7: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 6da: 8b 45 08 mov 0x8(%ebp),%eax 6dd: 83 e8 08 sub $0x8,%eax 6e0: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6e3: a1 dc 0c 00 00 mov 0xcdc,%eax 6e8: 89 45 fc mov %eax,-0x4(%ebp) 6eb: eb 24 jmp 711 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6ed: 8b 45 fc mov -0x4(%ebp),%eax 6f0: 8b 00 mov (%eax),%eax 6f2: 3b 45 fc cmp -0x4(%ebp),%eax 6f5: 77 12 ja 709 <free+0x35> 6f7: 8b 45 f8 mov -0x8(%ebp),%eax 6fa: 3b 45 fc cmp -0x4(%ebp),%eax 6fd: 77 24 ja 723 <free+0x4f> 6ff: 8b 45 fc mov -0x4(%ebp),%eax 702: 8b 00 mov (%eax),%eax 704: 3b 45 f8 cmp -0x8(%ebp),%eax 707: 77 1a ja 723 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 709: 8b 45 fc mov -0x4(%ebp),%eax 70c: 8b 00 mov (%eax),%eax 70e: 89 45 fc mov %eax,-0x4(%ebp) 711: 8b 45 f8 mov -0x8(%ebp),%eax 714: 3b 45 fc cmp -0x4(%ebp),%eax 717: 76 d4 jbe 6ed <free+0x19> 719: 8b 45 fc mov -0x4(%ebp),%eax 71c: 8b 00 mov (%eax),%eax 71e: 3b 45 f8 cmp -0x8(%ebp),%eax 721: 76 ca jbe 6ed <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 723: 8b 45 f8 mov -0x8(%ebp),%eax 726: 8b 40 04 mov 0x4(%eax),%eax 729: c1 e0 03 shl $0x3,%eax 72c: 89 c2 mov %eax,%edx 72e: 03 55 f8 add -0x8(%ebp),%edx 731: 8b 45 fc mov -0x4(%ebp),%eax 734: 8b 00 mov (%eax),%eax 736: 39 c2 cmp %eax,%edx 738: 75 24 jne 75e <free+0x8a> bp->s.size += p->s.ptr->s.size; 73a: 8b 45 f8 mov -0x8(%ebp),%eax 73d: 8b 50 04 mov 0x4(%eax),%edx 740: 8b 45 fc mov -0x4(%ebp),%eax 743: 8b 00 mov (%eax),%eax 745: 8b 40 04 mov 0x4(%eax),%eax 748: 01 c2 add %eax,%edx 74a: 8b 45 f8 mov -0x8(%ebp),%eax 74d: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 750: 8b 45 fc mov -0x4(%ebp),%eax 753: 8b 00 mov (%eax),%eax 755: 8b 10 mov (%eax),%edx 757: 8b 45 f8 mov -0x8(%ebp),%eax 75a: 89 10 mov %edx,(%eax) 75c: eb 0a jmp 768 <free+0x94> } else bp->s.ptr = p->s.ptr; 75e: 8b 45 fc mov -0x4(%ebp),%eax 761: 8b 10 mov (%eax),%edx 763: 8b 45 f8 mov -0x8(%ebp),%eax 766: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 768: 8b 45 fc mov -0x4(%ebp),%eax 76b: 8b 40 04 mov 0x4(%eax),%eax 76e: c1 e0 03 shl $0x3,%eax 771: 03 45 fc add -0x4(%ebp),%eax 774: 3b 45 f8 cmp -0x8(%ebp),%eax 777: 75 20 jne 799 <free+0xc5> p->s.size += bp->s.size; 779: 8b 45 fc mov -0x4(%ebp),%eax 77c: 8b 50 04 mov 0x4(%eax),%edx 77f: 8b 45 f8 mov -0x8(%ebp),%eax 782: 8b 40 04 mov 0x4(%eax),%eax 785: 01 c2 add %eax,%edx 787: 8b 45 fc mov -0x4(%ebp),%eax 78a: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 78d: 8b 45 f8 mov -0x8(%ebp),%eax 790: 8b 10 mov (%eax),%edx 792: 8b 45 fc mov -0x4(%ebp),%eax 795: 89 10 mov %edx,(%eax) 797: eb 08 jmp 7a1 <free+0xcd> } else p->s.ptr = bp; 799: 8b 45 fc mov -0x4(%ebp),%eax 79c: 8b 55 f8 mov -0x8(%ebp),%edx 79f: 89 10 mov %edx,(%eax) freep = p; 7a1: 8b 45 fc mov -0x4(%ebp),%eax 7a4: a3 dc 0c 00 00 mov %eax,0xcdc } 7a9: c9 leave 7aa: c3 ret 000007ab <morecore>: static Header* morecore(uint nu) { 7ab: 55 push %ebp 7ac: 89 e5 mov %esp,%ebp 7ae: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 7b1: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 7b8: 77 07 ja 7c1 <morecore+0x16> nu = 4096; 7ba: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 7c1: 8b 45 08 mov 0x8(%ebp),%eax 7c4: c1 e0 03 shl $0x3,%eax 7c7: 89 04 24 mov %eax,(%esp) 7ca: e8 35 fc ff ff call 404 <sbrk> 7cf: 89 45 f0 mov %eax,-0x10(%ebp) if(p == (char*)-1) 7d2: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp) 7d6: 75 07 jne 7df <morecore+0x34> return 0; 7d8: b8 00 00 00 00 mov $0x0,%eax 7dd: eb 22 jmp 801 <morecore+0x56> hp = (Header*)p; 7df: 8b 45 f0 mov -0x10(%ebp),%eax 7e2: 89 45 f4 mov %eax,-0xc(%ebp) hp->s.size = nu; 7e5: 8b 45 f4 mov -0xc(%ebp),%eax 7e8: 8b 55 08 mov 0x8(%ebp),%edx 7eb: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 7ee: 8b 45 f4 mov -0xc(%ebp),%eax 7f1: 83 c0 08 add $0x8,%eax 7f4: 89 04 24 mov %eax,(%esp) 7f7: e8 d8 fe ff ff call 6d4 <free> return freep; 7fc: a1 dc 0c 00 00 mov 0xcdc,%eax } 801: c9 leave 802: c3 ret 00000803 <malloc>: void* malloc(uint nbytes) { 803: 55 push %ebp 804: 89 e5 mov %esp,%ebp 806: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 809: 8b 45 08 mov 0x8(%ebp),%eax 80c: 83 c0 07 add $0x7,%eax 80f: c1 e8 03 shr $0x3,%eax 812: 83 c0 01 add $0x1,%eax 815: 89 45 f4 mov %eax,-0xc(%ebp) if((prevp = freep) == 0){ 818: a1 dc 0c 00 00 mov 0xcdc,%eax 81d: 89 45 f0 mov %eax,-0x10(%ebp) 820: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 824: 75 23 jne 849 <malloc+0x46> base.s.ptr = freep = prevp = &base; 826: c7 45 f0 d4 0c 00 00 movl $0xcd4,-0x10(%ebp) 82d: 8b 45 f0 mov -0x10(%ebp),%eax 830: a3 dc 0c 00 00 mov %eax,0xcdc 835: a1 dc 0c 00 00 mov 0xcdc,%eax 83a: a3 d4 0c 00 00 mov %eax,0xcd4 base.s.size = 0; 83f: c7 05 d8 0c 00 00 00 movl $0x0,0xcd8 846: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 849: 8b 45 f0 mov -0x10(%ebp),%eax 84c: 8b 00 mov (%eax),%eax 84e: 89 45 ec mov %eax,-0x14(%ebp) if(p->s.size >= nunits){ 851: 8b 45 ec mov -0x14(%ebp),%eax 854: 8b 40 04 mov 0x4(%eax),%eax 857: 3b 45 f4 cmp -0xc(%ebp),%eax 85a: 72 4d jb 8a9 <malloc+0xa6> if(p->s.size == nunits) 85c: 8b 45 ec mov -0x14(%ebp),%eax 85f: 8b 40 04 mov 0x4(%eax),%eax 862: 3b 45 f4 cmp -0xc(%ebp),%eax 865: 75 0c jne 873 <malloc+0x70> prevp->s.ptr = p->s.ptr; 867: 8b 45 ec mov -0x14(%ebp),%eax 86a: 8b 10 mov (%eax),%edx 86c: 8b 45 f0 mov -0x10(%ebp),%eax 86f: 89 10 mov %edx,(%eax) 871: eb 26 jmp 899 <malloc+0x96> else { p->s.size -= nunits; 873: 8b 45 ec mov -0x14(%ebp),%eax 876: 8b 40 04 mov 0x4(%eax),%eax 879: 89 c2 mov %eax,%edx 87b: 2b 55 f4 sub -0xc(%ebp),%edx 87e: 8b 45 ec mov -0x14(%ebp),%eax 881: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 884: 8b 45 ec mov -0x14(%ebp),%eax 887: 8b 40 04 mov 0x4(%eax),%eax 88a: c1 e0 03 shl $0x3,%eax 88d: 01 45 ec add %eax,-0x14(%ebp) p->s.size = nunits; 890: 8b 45 ec mov -0x14(%ebp),%eax 893: 8b 55 f4 mov -0xc(%ebp),%edx 896: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 899: 8b 45 f0 mov -0x10(%ebp),%eax 89c: a3 dc 0c 00 00 mov %eax,0xcdc return (void*)(p + 1); 8a1: 8b 45 ec mov -0x14(%ebp),%eax 8a4: 83 c0 08 add $0x8,%eax 8a7: eb 38 jmp 8e1 <malloc+0xde> } if(p == freep) 8a9: a1 dc 0c 00 00 mov 0xcdc,%eax 8ae: 39 45 ec cmp %eax,-0x14(%ebp) 8b1: 75 1b jne 8ce <malloc+0xcb> if((p = morecore(nunits)) == 0) 8b3: 8b 45 f4 mov -0xc(%ebp),%eax 8b6: 89 04 24 mov %eax,(%esp) 8b9: e8 ed fe ff ff call 7ab <morecore> 8be: 89 45 ec mov %eax,-0x14(%ebp) 8c1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8c5: 75 07 jne 8ce <malloc+0xcb> return 0; 8c7: b8 00 00 00 00 mov $0x0,%eax 8cc: eb 13 jmp 8e1 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8ce: 8b 45 ec mov -0x14(%ebp),%eax 8d1: 89 45 f0 mov %eax,-0x10(%ebp) 8d4: 8b 45 ec mov -0x14(%ebp),%eax 8d7: 8b 00 mov (%eax),%eax 8d9: 89 45 ec mov %eax,-0x14(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 8dc: e9 70 ff ff ff jmp 851 <malloc+0x4e> } 8e1: c9 leave 8e2: c3 ret 8e3: 90 nop 000008e4 <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { 8e4: 55 push %ebp 8e5: 89 e5 mov %esp,%ebp 8e7: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 8ea: 8b 55 08 mov 0x8(%ebp),%edx 8ed: 8b 45 0c mov 0xc(%ebp),%eax 8f0: 8b 4d 08 mov 0x8(%ebp),%ecx 8f3: f0 87 02 lock xchg %eax,(%edx) 8f6: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; 8f9: 8b 45 fc mov -0x4(%ebp),%eax } 8fc: c9 leave 8fd: c3 ret 000008fe <lock_init>: #include "x86.h" #include "proc.h" void lock_init(lock_t *lock){ 8fe: 55 push %ebp 8ff: 89 e5 mov %esp,%ebp lock->locked = 0; 901: 8b 45 08 mov 0x8(%ebp),%eax 904: c7 00 00 00 00 00 movl $0x0,(%eax) } 90a: 5d pop %ebp 90b: c3 ret 0000090c <lock_acquire>: void lock_acquire(lock_t *lock){ 90c: 55 push %ebp 90d: 89 e5 mov %esp,%ebp 90f: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); 912: 8b 45 08 mov 0x8(%ebp),%eax 915: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 91c: 00 91d: 89 04 24 mov %eax,(%esp) 920: e8 bf ff ff ff call 8e4 <xchg> 925: 85 c0 test %eax,%eax 927: 75 e9 jne 912 <lock_acquire+0x6> } 929: c9 leave 92a: c3 ret 0000092b <lock_release>: void lock_release(lock_t *lock){ 92b: 55 push %ebp 92c: 89 e5 mov %esp,%ebp 92e: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); 931: 8b 45 08 mov 0x8(%ebp),%eax 934: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 93b: 00 93c: 89 04 24 mov %eax,(%esp) 93f: e8 a0 ff ff ff call 8e4 <xchg> } 944: c9 leave 945: c3 ret 00000946 <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ 946: 55 push %ebp 947: 89 e5 mov %esp,%ebp 949: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); 94c: c7 04 24 00 20 00 00 movl $0x2000,(%esp) 953: e8 ab fe ff ff call 803 <malloc> 958: 89 45 f0 mov %eax,-0x10(%ebp) void *garbage_stack = stack; 95b: 8b 45 f0 mov -0x10(%ebp),%eax 95e: 89 45 f4 mov %eax,-0xc(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ 961: 8b 45 f0 mov -0x10(%ebp),%eax 964: 25 ff 0f 00 00 and $0xfff,%eax 969: 85 c0 test %eax,%eax 96b: 74 15 je 982 <thread_create+0x3c> stack = stack + (4096 - (uint)stack % 4096); 96d: 8b 45 f0 mov -0x10(%ebp),%eax 970: 89 c2 mov %eax,%edx 972: 81 e2 ff 0f 00 00 and $0xfff,%edx 978: b8 00 10 00 00 mov $0x1000,%eax 97d: 29 d0 sub %edx,%eax 97f: 01 45 f0 add %eax,-0x10(%ebp) } if (stack == 0){ 982: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 986: 75 1b jne 9a3 <thread_create+0x5d> printf(1,"malloc fail \n"); 988: c7 44 24 04 75 0c 00 movl $0xc75,0x4(%esp) 98f: 00 990: c7 04 24 01 00 00 00 movl $0x1,(%esp) 997: e8 81 fb ff ff call 51d <printf> return 0; 99c: b8 00 00 00 00 mov $0x0,%eax 9a1: eb 6f jmp a12 <thread_create+0xcc> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); 9a3: 8b 4d 0c mov 0xc(%ebp),%ecx 9a6: 8b 55 08 mov 0x8(%ebp),%edx 9a9: 8b 45 f0 mov -0x10(%ebp),%eax 9ac: 89 4c 24 0c mov %ecx,0xc(%esp) 9b0: 89 54 24 08 mov %edx,0x8(%esp) 9b4: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) 9bb: 00 9bc: 89 04 24 mov %eax,(%esp) 9bf: e8 58 fa ff ff call 41c <clone> 9c4: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ 9c7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 9cb: 79 1b jns 9e8 <thread_create+0xa2> printf(1,"clone fails\n"); 9cd: c7 44 24 04 83 0c 00 movl $0xc83,0x4(%esp) 9d4: 00 9d5: c7 04 24 01 00 00 00 movl $0x1,(%esp) 9dc: e8 3c fb ff ff call 51d <printf> return 0; 9e1: b8 00 00 00 00 mov $0x0,%eax 9e6: eb 2a jmp a12 <thread_create+0xcc> } if(tid > 0){ 9e8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 9ec: 7e 05 jle 9f3 <thread_create+0xad> //store threads on thread table return garbage_stack; 9ee: 8b 45 f4 mov -0xc(%ebp),%eax 9f1: eb 1f jmp a12 <thread_create+0xcc> } if(tid == 0){ 9f3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 9f7: 75 14 jne a0d <thread_create+0xc7> printf(1,"tid = 0 return \n"); 9f9: c7 44 24 04 90 0c 00 movl $0xc90,0x4(%esp) a00: 00 a01: c7 04 24 01 00 00 00 movl $0x1,(%esp) a08: e8 10 fb ff ff call 51d <printf> } // wait(); // free(garbage_stack); return 0; a0d: b8 00 00 00 00 mov $0x0,%eax } a12: c9 leave a13: c3 ret 00000a14 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ a14: 55 push %ebp a15: 89 e5 mov %esp,%ebp q->size = 0; a17: 8b 45 08 mov 0x8(%ebp),%eax a1a: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; a20: 8b 45 08 mov 0x8(%ebp),%eax a23: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; a2a: 8b 45 08 mov 0x8(%ebp),%eax a2d: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } a34: 5d pop %ebp a35: c3 ret 00000a36 <add_q>: void add_q(struct queue *q, int v){ a36: 55 push %ebp a37: 89 e5 mov %esp,%ebp a39: 83 ec 28 sub $0x28,%esp //printf(1, "here \n"); struct node * n = malloc(sizeof(struct node)); a3c: c7 04 24 08 00 00 00 movl $0x8,(%esp) a43: e8 bb fd ff ff call 803 <malloc> a48: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; a4b: 8b 45 f4 mov -0xc(%ebp),%eax a4e: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; a55: 8b 45 f4 mov -0xc(%ebp),%eax a58: 8b 55 0c mov 0xc(%ebp),%edx a5b: 89 10 mov %edx,(%eax) if(q->head == 0){ a5d: 8b 45 08 mov 0x8(%ebp),%eax a60: 8b 40 04 mov 0x4(%eax),%eax a63: 85 c0 test %eax,%eax a65: 75 0b jne a72 <add_q+0x3c> q->head = n; a67: 8b 45 08 mov 0x8(%ebp),%eax a6a: 8b 55 f4 mov -0xc(%ebp),%edx a6d: 89 50 04 mov %edx,0x4(%eax) a70: eb 0c jmp a7e <add_q+0x48> }else{ q->tail->next = n; a72: 8b 45 08 mov 0x8(%ebp),%eax a75: 8b 40 08 mov 0x8(%eax),%eax a78: 8b 55 f4 mov -0xc(%ebp),%edx a7b: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; a7e: 8b 45 08 mov 0x8(%ebp),%eax a81: 8b 55 f4 mov -0xc(%ebp),%edx a84: 89 50 08 mov %edx,0x8(%eax) q->size++; a87: 8b 45 08 mov 0x8(%ebp),%eax a8a: 8b 00 mov (%eax),%eax a8c: 8d 50 01 lea 0x1(%eax),%edx a8f: 8b 45 08 mov 0x8(%ebp),%eax a92: 89 10 mov %edx,(%eax) } a94: c9 leave a95: c3 ret 00000a96 <empty_q>: int empty_q(struct queue *q){ a96: 55 push %ebp a97: 89 e5 mov %esp,%ebp if(q->size == 0) a99: 8b 45 08 mov 0x8(%ebp),%eax a9c: 8b 00 mov (%eax),%eax a9e: 85 c0 test %eax,%eax aa0: 75 07 jne aa9 <empty_q+0x13> return 1; aa2: b8 01 00 00 00 mov $0x1,%eax aa7: eb 05 jmp aae <empty_q+0x18> else return 0; aa9: b8 00 00 00 00 mov $0x0,%eax } aae: 5d pop %ebp aaf: c3 ret 00000ab0 <pop_q>: int pop_q(struct queue *q){ ab0: 55 push %ebp ab1: 89 e5 mov %esp,%ebp ab3: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ ab6: 8b 45 08 mov 0x8(%ebp),%eax ab9: 89 04 24 mov %eax,(%esp) abc: e8 d5 ff ff ff call a96 <empty_q> ac1: 85 c0 test %eax,%eax ac3: 75 5d jne b22 <pop_q+0x72> val = q->head->value; ac5: 8b 45 08 mov 0x8(%ebp),%eax ac8: 8b 40 04 mov 0x4(%eax),%eax acb: 8b 00 mov (%eax),%eax acd: 89 45 f0 mov %eax,-0x10(%ebp) destroy = q->head; ad0: 8b 45 08 mov 0x8(%ebp),%eax ad3: 8b 40 04 mov 0x4(%eax),%eax ad6: 89 45 f4 mov %eax,-0xc(%ebp) q->head = q->head->next; ad9: 8b 45 08 mov 0x8(%ebp),%eax adc: 8b 40 04 mov 0x4(%eax),%eax adf: 8b 50 04 mov 0x4(%eax),%edx ae2: 8b 45 08 mov 0x8(%ebp),%eax ae5: 89 50 04 mov %edx,0x4(%eax) free(destroy); ae8: 8b 45 f4 mov -0xc(%ebp),%eax aeb: 89 04 24 mov %eax,(%esp) aee: e8 e1 fb ff ff call 6d4 <free> q->size--; af3: 8b 45 08 mov 0x8(%ebp),%eax af6: 8b 00 mov (%eax),%eax af8: 8d 50 ff lea -0x1(%eax),%edx afb: 8b 45 08 mov 0x8(%ebp),%eax afe: 89 10 mov %edx,(%eax) if(q->size == 0){ b00: 8b 45 08 mov 0x8(%ebp),%eax b03: 8b 00 mov (%eax),%eax b05: 85 c0 test %eax,%eax b07: 75 14 jne b1d <pop_q+0x6d> q->head = 0; b09: 8b 45 08 mov 0x8(%ebp),%eax b0c: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; b13: 8b 45 08 mov 0x8(%ebp),%eax b16: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; b1d: 8b 45 f0 mov -0x10(%ebp),%eax b20: eb 05 jmp b27 <pop_q+0x77> } return -1; b22: b8 ff ff ff ff mov $0xffffffff,%eax } b27: c9 leave b28: c3 ret b29: 90 nop b2a: 90 nop b2b: 90 nop 00000b2c <init_semaphore>: #include "semaphore.h" #include "user.h" //lab 2 //Semaphore void init_semaphore(struct Semaphore *s, int count_num) { b2c: 55 push %ebp b2d: 89 e5 mov %esp,%ebp b2f: 83 ec 18 sub $0x18,%esp s->count = count_num; b32: 8b 45 08 mov 0x8(%ebp),%eax b35: 8b 55 0c mov 0xc(%ebp),%edx b38: 89 10 mov %edx,(%eax) init_q(&s->threads); b3a: 8b 45 08 mov 0x8(%ebp),%eax b3d: 83 c0 04 add $0x4,%eax b40: 89 04 24 mov %eax,(%esp) b43: e8 cc fe ff ff call a14 <init_q> lock_init(&s->lock); b48: 8b 45 08 mov 0x8(%ebp),%eax b4b: 83 c0 10 add $0x10,%eax b4e: 89 04 24 mov %eax,(%esp) b51: e8 a8 fd ff ff call 8fe <lock_init> } b56: c9 leave b57: c3 ret 00000b58 <sem_acquire>: void sem_acquire(struct Semaphore *s) { b58: 55 push %ebp b59: 89 e5 mov %esp,%ebp b5b: 83 ec 18 sub $0x18,%esp while(1) { if (s->count > 0) { //if there are available resources b5e: 8b 45 08 mov 0x8(%ebp),%eax b61: 8b 00 mov (%eax),%eax b63: 85 c0 test %eax,%eax b65: 7e 2c jle b93 <sem_acquire+0x3b> //printf(1, "COUNT IS = %d\n", s->count); //printf(1, "acquiring lock\n"); lock_acquire(&s->lock); //acquire count lock b67: 8b 45 08 mov 0x8(%ebp),%eax b6a: 83 c0 10 add $0x10,%eax b6d: 89 04 24 mov %eax,(%esp) b70: e8 97 fd ff ff call 90c <lock_acquire> //printf(1, "acquired lock\n"); s->count = s->count - 1; //decrement resource by one b75: 8b 45 08 mov 0x8(%ebp),%eax b78: 8b 00 mov (%eax),%eax b7a: 8d 50 ff lea -0x1(%eax),%edx b7d: 8b 45 08 mov 0x8(%ebp),%eax b80: 89 10 mov %edx,(%eax) //printf(1, "DECREMENT! COUNT IS = %d\n", s->count); lock_release(&s->lock); //release count lock b82: 8b 45 08 mov 0x8(%ebp),%eax b85: 83 c0 10 add $0x10,%eax b88: 89 04 24 mov %eax,(%esp) b8b: e8 9b fd ff ff call 92b <lock_release> break; b90: 90 nop add_q(&s->threads, getpid()); //add thread to sleep queueu //printf(1, "asleep \n"); tsleep(); } } } b91: c9 leave b92: c3 ret //printf(1, "DECREMENT! COUNT IS = %d\n", s->count); lock_release(&s->lock); //release count lock break; } else { //if there are no available resources printf(1, "Waiting for semaphore\n"); b93: c7 44 24 04 a1 0c 00 movl $0xca1,0x4(%esp) b9a: 00 b9b: c7 04 24 01 00 00 00 movl $0x1,(%esp) ba2: e8 76 f9 ff ff call 51d <printf> //printf(1, "%d", getpid()); add_q(&s->threads, getpid()); //add thread to sleep queueu ba7: e8 50 f8 ff ff call 3fc <getpid> bac: 8b 55 08 mov 0x8(%ebp),%edx baf: 83 c2 04 add $0x4,%edx bb2: 89 44 24 04 mov %eax,0x4(%esp) bb6: 89 14 24 mov %edx,(%esp) bb9: e8 78 fe ff ff call a36 <add_q> //printf(1, "asleep \n"); tsleep(); bbe: e8 69 f8 ff ff call 42c <tsleep> } } bc3: eb 99 jmp b5e <sem_acquire+0x6> 00000bc5 <sem_signal>: } void sem_signal(struct Semaphore *s) { bc5: 55 push %ebp bc6: 89 e5 mov %esp,%ebp bc8: 83 ec 18 sub $0x18,%esp lock_acquire(&s->lock); bcb: 8b 45 08 mov 0x8(%ebp),%eax bce: 83 c0 10 add $0x10,%eax bd1: 89 04 24 mov %eax,(%esp) bd4: e8 33 fd ff ff call 90c <lock_acquire> s->count++; bd9: 8b 45 08 mov 0x8(%ebp),%eax bdc: 8b 00 mov (%eax),%eax bde: 8d 50 01 lea 0x1(%eax),%edx be1: 8b 45 08 mov 0x8(%ebp),%eax be4: 89 10 mov %edx,(%eax) lock_release(&s->lock); be6: 8b 45 08 mov 0x8(%ebp),%eax be9: 83 c0 10 add $0x10,%eax bec: 89 04 24 mov %eax,(%esp) bef: e8 37 fd ff ff call 92b <lock_release> if (!empty_q(&s->threads)) { bf4: 8b 45 08 mov 0x8(%ebp),%eax bf7: 83 c0 04 add $0x4,%eax bfa: 89 04 24 mov %eax,(%esp) bfd: e8 94 fe ff ff call a96 <empty_q> c02: 85 c0 test %eax,%eax c04: 75 16 jne c1c <sem_signal+0x57> twakeup(pop_q(&s->threads)); //remove thread from queue and wake up c06: 8b 45 08 mov 0x8(%ebp),%eax c09: 83 c0 04 add $0x4,%eax c0c: 89 04 24 mov %eax,(%esp) c0f: e8 9c fe ff ff call ab0 <pop_q> c14: 89 04 24 mov %eax,(%esp) c17: e8 18 f8 ff ff call 434 <twakeup> } } c1c: c9 leave c1d: c3 ret
34.24957
75
0.438196
ab0f7ad7b8694527e5d8f5718451be69ae19e16e
2,431
asm
Assembly
software/atommc2/exec.asm
AtomicRoland/AtomFpga
200d57d85cb2abf43f80723a78db98a8b21c1d7d
[ "Apache-2.0" ]
25
2015-01-19T20:53:43.000Z
2021-10-04T18:42:06.000Z
software/atommc2/exec.asm
AtomicRoland/AtomFpga
200d57d85cb2abf43f80723a78db98a8b21c1d7d
[ "Apache-2.0" ]
2
2019-06-15T17:10:09.000Z
2019-06-15T17:15:35.000Z
software/atommc2/exec.asm
AtomicRoland/AtomFpga
200d57d85cb2abf43f80723a78db98a8b21c1d7d
[ "Apache-2.0" ]
12
2015-02-12T14:38:00.000Z
2021-06-09T10:05:34.000Z
;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~;~~ ; ; *EXEC [filename] ; ; Feed bytes from a file to the system as if they were typed. ; Highly experimental :) ; STAREXEC: jsr read_filename jsr open_file_read SETRWPTR NAME ; get the FAT file size - text files won't have ATM headers SLOWCMDI CMD_FILE_GETINFO ldx #13 jsr read_data_buffer lda NAME sta RDCLEN lda NAME+1 sta RDCLEN+1 lda #0 ; indicate there are no bytes in the pipe sta RDCCNT lda #<execrdch ; point OSRDCH at our routine sta RDCVEC lda #>execrdch sta RDCVEC+1 rts ; ; pull characters from the file and return these to the OS ; until none left at which point unhook ourselves ; ; ---== no X or Y reg used ) ==--- ; execrdch: php cld sinkchar: lda RDCCNT ; exhausted our little pool? bne plentyleft lda RDCLEN+1 ; are there pages left in the file? bne @nextread16 lda RDCLEN ; less than 16 left in the file? cmp #17 bcc @fillpool @nextread16: lda #16 ; 16 or more left in the file @fillpool: sta RDCCNT ; pool count lda RDCLEN ; file length remaining -= pool count sec sbc RDCCNT sta RDCLEN bcs @refillpool dec RDCLEN+1 @refillpool: lda RDCCNT ; recover count writeportFAST ALATCH_REG ; set ammount to read jsr interwritedelay SLOWCMDI CMD_READ_BYTES ; set command cmp #STATUS_COMPLETE beq @allok ; error! bail! jmp osrdchcode_unhook ; eek @allok: jsr prepare_read_data ; get data from pic plentyleft: dec RDCCNT ; one less in the pool bne @finally lda RDCLEN ; all done completely? ora RDCLEN+1 bne @finally lda #$94 ; unhook and avoid trailing 'A' gotcha sta RDCVEC lda #$fe sta RDCVEC+1 readportFAST AREAD_DATA_REG ; get char from PIC/AVR plp rts @finally: readportFAST AREAD_DATA_REG ; get char from PIC/AVR cmp #$0a ; lose LFs - god this is so ghetto i can't believe i've done it beq sinkchar ; this will fubar if the last char in a file is A. which is likely. BEWARE! plp rts
21.324561
99
0.559029
2505594b3a27ea5692f4da49b35a3e90cb4896ac
543
asm
Assembly
programs/oeis/218/A218739.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/218/A218739.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/218/A218739.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A218739: a(n) = (36^n-1)/35. ; 0,1,37,1333,47989,1727605,62193781,2238976117,80603140213,2901713047669,104461669716085,3760620109779061,135382323952046197,4873763662273663093,175455491841851871349,6316397706306667368565,227390317427040025268341,8186051427373440909660277,294697851385443872747769973,10609122649875979418919719029,381928415395535259081109885045,13749422954239269326919955861621,494979226352613695769118411018357,17819252148694093047688262796660853,641493077352987349716777460679790709 mov $1,36 pow $1,$0 div $1,35 mov $0,$1
67.875
470
0.88582
d5c5b4f172cf5ab1e427dbb694a32cb63e01a599
362
asm
Assembly
programs/oeis/205/A205088.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/205/A205088.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/205/A205088.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A205088: a(n)=n 8's sandwiched between two 1's. ; 11,181,1881,18881,188881,1888881,18888881,188888881,1888888881,18888888881,188888888881,1888888888881,18888888888881,188888888888881,1888888888888881,18888888888888881,188888888888888881,1888888888888888881,18888888888888888881 mov $1,10 pow $1,$0 div $1,9 mul $1,8500 add $1,950 div $1,50 sub $1,8 mov $0,$1
30.166667
229
0.801105
7b1a7b588fe9538d89a6854fa2c4c71b23a95e83
10,816
asm
Assembly
source/jni/u2/plzpart/main.asm
Falken42/SecondReality
b998d193a066523cb4ca2b86c8041bea1bddfcb4
[ "Unlicense" ]
9
2015-05-13T21:02:00.000Z
2018-04-15T16:32:27.000Z
source/jni/u2/plzpart/main.asm
falken42/SecondReality
b998d193a066523cb4ca2b86c8041bea1bddfcb4
[ "Unlicense" ]
null
null
null
source/jni/u2/plzpart/main.asm
falken42/SecondReality
b998d193a066523cb4ca2b86c8041bea1bddfcb4
[ "Unlicense" ]
null
null
null
.386p ifndef ??version ?debug macro endm publicdll macro name public name endm endif ?debug V 300h ?debug S "MAIN.C" ?debug C E9C789EC1A064D41494E2E43 ?debug C E94019CA1815473A5C42435C494E434C5544455C535444494F2E48 ?debug C E94019CA1815473A5C42435C494E434C5544455C5F444546532E48 ?debug C E94019CA1816473A5C42435C494E434C5544455C5F4E46494C452E+ ?debug C 48 ?debug C E94019CA1815473A5C42435C494E434C5544455C5F4E554C4C2E48 ?debug C E94019CA1814473A5C42435C494E434C5544455C4D4154482E48 ?debug C E94019CA1815473A5C42435C494E434C5544455C434F4E494F2E48 ?debug C E94019CA1813473A5C42435C494E434C5544455C444F532E48 ?debug C E93587EB1A102E2E5C545745414B5C545745414B2E48 MAIN_TEXT segment byte public use16 'CODE' MAIN_TEXT ends DGROUP group _DATA,_BSS assume cs:MAIN_TEXT,ds:DGROUP _DATA segment word public use16 'DATA' d@ label byte d@w label word _DATA ends _BSS segment word public use16 'BSS' b@ label byte b@w label word _BSS ends _DATA segment word public use16 'DATA' _vmem label dword db 0 db 0 db 0 db 160 ?debug C E947A5DC1A08505441552E505245 _ptau label byte db 0 db 1 db 1 db 1 db 1 db 1 db 2 db 2 db 3 db 3 db 4 db 5 db 6 db 7 db 8 db 9 db 10 db 11 db 12 db 13 db 14 db 16 db 17 db 18 db 20 db 21 db 23 db 24 db 25 db 27 db 28 db 30 db 31 db 33 db 35 db 36 db 38 db 39 db 40 db 42 db 43 db 45 db 46 db 47 db 49 db 50 db 51 db 52 db 53 db 54 db 55 db 56 db 57 db 58 db 59 db 60 db 60 db 61 db 61 db 62 db 62 db 62 db 62 db 62 db 63 db 62 db 62 db 62 db 62 db 62 db 61 db 61 db 60 db 60 db 59 db 58 db 57 db 56 db 55 db 54 db 53 db 52 db 51 db 50 db 49 db 47 db 46 db 45 db 43 db 42 db 40 db 39 db 38 db 36 db 35 db 33 db 32 db 30 db 28 db 27 db 25 db 24 db 23 db 21 db 20 db 18 db 17 db 16 db 14 db 13 db 12 db 11 db 10 db 9 db 8 db 7 db 6 db 5 db 4 db 3 db 3 db 2 db 2 db 1 db 1 db 1 db 1 db 1 db 1 db 127 dup (0) _l1 label word db 144 db 1 _l2 label word db 44 db 1 _l3 label word db 32 db 3 _l4 label word db 100 db 0 _k1 label word db 244 db 1 _k2 label word db 44 db 1 _k3 label word db 132 db 3 _k4 label word db 158 db 2 _m1 label word db 244 db 1 _m2 label word db 200 db 0 _m3 label word db 144 db 1 _m4 label word db 132 db 3 _n1 label word db 188 db 2 _n2 label word db 244 db 1 _n3 label word db 132 db 3 _n4 label word db 214 db 1 _DATA ends MAIN_TEXT segment byte public use16 'CODE' ?debug C E801064D41494E2E43C789EC1A ?debug L 42 assume cs:MAIN_TEXT _main proc far ?debug B push bp mov bp,sp sub sp,22 push si push di ?debug B ?debug L 45 mov dword ptr [bp-4],large 0 mov dword ptr [bp-8],large 0 ?debug L 46 mov word ptr [bp-10],0 ?debug L 48 call far ptr _init_plz ?debug L 50 mov ax,seg _frame_count mov es,ax mov word ptr es:_frame_count,0 jmp @1@1066 @1@58: ?debug L 53 mov ax,seg _frame_count mov es,ax movsx eax,word ptr es:_frame_count add dword ptr [bp-4],eax inc dword ptr [bp-8] ?debug L 54 cmp word ptr [bp-10],37 jne short @1@114 push large 000140014h push large 000140000h call far ptr _tw_setrgbpalette add sp,8 @1@114: ?debug L 56 mov dx, 3c4h ?debug L 57 mov ax, 0a02h ?debug L 58 out dx, ax ?debug L 60 push word ptr DGROUP:_k4 push word ptr DGROUP:_k3 push word ptr DGROUP:_k2 push word ptr DGROUP:_k1 call far ptr _setplzparas add sp,8 ?debug L 61 xor si,si mov word ptr [bp-16],00000A000h @1@254: ?debug L 62 push word ptr [bp-16] push si call far ptr _plzline add sp,4 ?debug L 61 add word ptr [bp-16],12 add si,2 cmp si,350 jl short @1@254 ?debug L 63 push word ptr DGROUP:_l4 push word ptr DGROUP:_l3 push word ptr DGROUP:_l2 push word ptr DGROUP:_l1 call far ptr _setplzparas add sp,8 ?debug L 64 mov si,1 mov word ptr [bp-18],00000A006h jmp short @1@506 @1@422: ?debug L 65 push word ptr [bp-18] push si call far ptr _plzline add sp,4 ?debug L 64 add word ptr [bp-18],12 add si,2 @1@506: cmp si,350 jl short @1@422 ?debug L 68 mov dx, 3c4h ?debug L 69 mov ax, 0502h ?debug L 70 out dx, ax ?debug L 72 push word ptr DGROUP:_k4 push word ptr DGROUP:_k3 push word ptr DGROUP:_k2 push word ptr DGROUP:_k1 call far ptr _setplzparas add sp,8 ?debug L 73 mov si,1 mov word ptr [bp-20],00000A006h jmp short @1@758 @1@674: ?debug L 74 push word ptr [bp-20] push si call far ptr _plzline add sp,4 ?debug L 73 add word ptr [bp-20],12 add si,2 @1@758: cmp si,350 jl short @1@674 ?debug L 75 push word ptr DGROUP:_l4 push word ptr DGROUP:_l3 push word ptr DGROUP:_l2 push word ptr DGROUP:_l1 call far ptr _setplzparas add sp,8 ?debug L 76 xor si,si mov word ptr [bp-22],00000A000h @1@842: ?debug L 77 push word ptr [bp-22] push si call far ptr _plzline add sp,4 ?debug L 76 add word ptr [bp-22],12 add si,2 cmp si,350 jl short @1@842 ?debug L 79 cmp word ptr [bp-10],37 jne short @1@1010 push large 0 push large 0 call far ptr _tw_setrgbpalette add sp,8 @1@1010: ?debug L 83 call far ptr _kbhit or ax,ax je short @1@1066 call far ptr _getch mov word ptr [bp-10],ax @1@1066: ?debug L 51 cmp word ptr [bp-10],27 je short @@4 jmp @1@58 @@4: ?debug L 85 call far ptr _close_copper ?debug L 86 call far ptr _tw_closegraph ?debug L 88 mov eax,dword ptr [bp-4] mov dword ptr [bp-14],eax fild dword ptr [bp-14] mov eax,dword ptr [bp-8] mov dword ptr [bp-14],eax fild dword ptr [bp-14] fdiv sub sp,8 fstp qword ptr [bp-34] push ds push offset DGROUP:s@ fwait call far ptr _printf add sp,12 ?debug L 89 pop di pop si leave ret ?debug C E60263680402F6FF0005636F756E740602F8FF00+ ?debug C 0374696D0602FCFF00017904080192007B010406+ ?debug C 00 ?debug E ?debug E _main endp ?debug L 91 assume cs:MAIN_TEXT _init_plz proc far ?debug B push bp mov bp,sp sub sp,2 push si ?debug B ?debug L 141 call far ptr _tw_opengraph ?debug L 142 push -17536 call far ptr _tw_setstart add sp,2 ?debug L 144 mov dx, 3d4h ?debug L 145 mov ax, 4009h ?debug L 146 out dx, ax ?debug L 147 mov ax, 3013h ?debug L 148 out dx, ax ?debug L 149 mov ax, a018h ?debug L 150 out dx, ax ?debug L 151 mov ax, 0f07h ?debug L 152 out dx, ax ?debug L 155 call far ptr _init_copper ?debug L 158 mov word ptr [bp-2],0 @2@338: mov al,byte ptr DGROUP:_ptau cbw mov si,ax push ax push ax mov bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax push bx call far ptr _tw_setrgbpalette add sp,8 inc word ptr [bp-2] cmp word ptr [bp-2],64 jl short @2@338 ?debug L 159 mov word ptr [bp-2],0 @2@450: mov bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov al,byte ptr DGROUP:_ptau cbw push ax mov bx,63 sub bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov ax,word ptr [bp-2] add ax,64 push ax call far ptr _tw_setrgbpalette add sp,8 inc word ptr [bp-2] cmp word ptr [bp-2],64 jl short @2@450 ?debug L 160 mov word ptr [bp-2],0 @2@562: mov bx,63 sub bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov al,byte ptr DGROUP:_ptau cbw push ax mov ax,word ptr [bp-2] add ax,128 push ax call far ptr _tw_setrgbpalette add sp,8 inc word ptr [bp-2] cmp word ptr [bp-2],64 jl short @2@562 ?debug L 161 mov word ptr [bp-2],0 @2@674: mov bx,word ptr [bp-2] mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov al,byte ptr DGROUP:_ptau+63 cbw push ax mov al,byte ptr DGROUP:_ptau[bx] cbw push ax mov ax,word ptr [bp-2] add ax,192 push ax call far ptr _tw_setrgbpalette add sp,8 inc word ptr [bp-2] cmp word ptr [bp-2],64 jl short @2@674 ?debug L 185 pop si leave ret ?debug C E601610402FEFF00 ?debug E ?debug E _init_plz endp ?debug C E9 ?debug C FA15000000 MAIN_TEXT ends _DATA segment word public use16 'DATA' s@ label byte db '%le' db 10 db 0 _DATA ends MAIN_TEXT segment byte public use16 'CODE' MAIN_TEXT ends public _init_plz public _main public _n4 public _n3 public _n2 public _n1 public _m4 public _m3 public _m2 public _m1 public _k4 public _k3 public _k2 public _k1 public _l4 public _l3 public _l2 public _l1 public _ptau public _vmem extrn _setplzparas:far extrn _plzline:far extrn _frame_count:word extrn _close_copper:far extrn _init_copper:far extrn _tw_setstart:far extrn _tw_setrgbpalette:far extrn _tw_closegraph:far extrn _tw_opengraph:far extrn _kbhit:far extrn _getch:far extrn _printf:far _s@ equ s@ ?debug C EA010C ?debug C E31800000023040400 ?debug C EC095F696E69745F706C7A181800 ?debug C E31900000023040400 ?debug C EC055F6D61696E191800 ?debug C EC035F6E34040000 ?debug C EC035F6E33040000 ?debug C EC035F6E32040000 ?debug C EC035F6E31040000 ?debug C EC035F6D34040000 ?debug C EC035F6D33040000 ?debug C EC035F6D32040000 ?debug C EC035F6D31040000 ?debug C EC035F6B34040000 ?debug C EC035F6B33040000 ?debug C EC035F6B32040000 ?debug C EC035F6B31040000 ?debug C EC035F6C34040000 ?debug C EC035F6C33040000 ?debug C EC035F6C32040000 ?debug C EC035F6C31040000 ?debug C E31A0000011A02 ?debug C EC055F707461751A0000 ?debug C E31C0052001A04 ?debug C E31B000400161C00 ?debug C EC055F766D656D1B0000 ?debug C E31D00000023040400 ?debug C EB0C5F736574706C7A70617261731D00 ?debug C E31E00000023040400 ?debug C EB085F706C7A6C696E651E00 ?debug C EB0C5F6672616D655F636F756E740400 ?debug C E31F00000023040400 ?debug C EB0D5F636C6F73655F636F707065721F00 ?debug C E32000000023040400 ?debug C EB0C5F696E69745F636F707065722000 ?debug C E32100000023010400 ?debug C EB0C5F74775F73657473746172742100 ?debug C E32200000023010400 ?debug C EB115F74775F73657472676270616C6574746522+ ?debug C 00 ?debug C E32300000023010400 ?debug C EB0E5F74775F636C6F736567726170682300 ?debug C E32400000023010400 ?debug C EB0D5F74775F6F70656E67726170682400 ?debug C E32500000023040400 ?debug C EB065F6B626869742500 ?debug C E32600000023040400 ?debug C EB065F67657463682600 ?debug C E32700000023040401 ?debug C EB075F7072696E74662700 ?debug C E60666706F735F740606000673697A655F740A06+ ?debug C 00 end 
17.059937
66
0.678902
1d2ded3dbda8e017b7036516912285299557921c
279
asm
Assembly
programs/oeis/028/A028293.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/028/A028293.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/028/A028293.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A028293: Period 7. ; 1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1 mul $0,1297 add $0,1 lpb $0 sub $0,1 mul $0,4 mod $0,7 add $1,2 lpe div $1,2 mov $0,$1
19.928571
161
0.516129
fe5ede7ab62e7d5a748962ffa64e5daa3cb26fca
987
asm
Assembly
ch10/List.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
ch10/List.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
ch10/List.asm
William0Friend/my_masm
e8073266c03c01424ad84b9ed9cf13e9da1eabb1
[ "Apache-2.0" ]
null
null
null
; Creating a Linked List (List.asm) ; This program shows how the STRUC directive ; and the REPT directive can be combined to ; create a linked list at assembly time. INCLUDE Irvine32.inc ListNode STRUCT NodeData DWORD ? NextPtr DWORD ? ListNode ENDS TotalNodeCount = 15 NULL = 0 Counter = 0 .data LinkedList LABEL PTR ListNode REPT TotalNodeCount Counter = Counter + 1 ; ListNode <Counter, ($ + SIZEOF ListNode)> ; TRY THIS ListNode <Counter, ($ + Counter * SIZEOF ListNode)> ENDM ListNode <0,0> ; tail node .code main PROC mov esi,OFFSET LinkedList ; Display the integers in the NodeData members. NextNode: ; Check for the tail node. mov eax,(ListNode PTR [esi]).NextPtr cmp eax,NULL je quit ; Display the node data. mov eax,(ListNode PTR [esi]).NodeData call WriteDec call Crlf ; Get pointer to next node. mov esi,(ListNode PTR [esi]).NextPtr jmp NextNode quit: exit main ENDP END main
19.74
57
0.679838
26fae089d978980ddb7ea77a6dbddd9874b620cd
16
asm
Assembly
tests/inputs/test_single_inst/test_sub_one_inst/sub_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
null
null
null
tests/inputs/test_single_inst/test_sub_one_inst/sub_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
6
2021-11-13T03:26:46.000Z
2021-11-17T15:20:10.000Z
tests/inputs/test_single_inst/test_sub_one_inst/sub_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
null
null
null
sub, R3, R1, R2
16
16
0.5625
a5e71eb1f01929855661b0e632f8459c31b990a2
5,998
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_1915.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_1915.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_1915.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 %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x16a44, %r9 clflush (%r9) nop nop sub $50670, %r10 movl $0x61626364, (%r9) nop nop nop nop nop add %r12, %r12 lea addresses_normal_ht+0x1ae4, %rsi lea addresses_UC_ht+0x7a64, %rdi clflush (%rsi) nop nop cmp $61439, %rbx mov $77, %rcx rep movsl cmp $51556, %r10 lea addresses_WC_ht+0xd2e4, %rdx nop add $42455, %r12 mov (%rdx), %rcx nop nop nop cmp $61595, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %rax push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_WC+0x9d64, %rsi lea addresses_WC+0x1d2e4, %rdi clflush (%rsi) nop nop xor $46462, %r11 mov $10, %rcx rep movsl nop nop nop add %rsi, %rsi // Store lea addresses_D+0x11704, %r11 nop dec %rax movl $0x51525354, (%r11) nop nop add %rcx, %rcx // Load mov $0xe0c, %rbx nop nop nop nop nop and $15137, %r11 movups (%rbx), %xmm0 vpextrq $0, %xmm0, %rsi nop nop nop cmp %rbx, %rbx // Store lea addresses_WT+0x4ce4, %rbx nop nop nop inc %rax mov $0x5152535455565758, %rsi movq %rsi, %xmm5 vmovups %ymm5, (%rbx) nop nop nop nop and %rsi, %rsi // Store lea addresses_D+0x16c64, %rax nop sub $14908, %rcx mov $0x5152535455565758, %rbx movq %rbx, %xmm5 vmovups %ymm5, (%rax) xor %rcx, %rcx // Faulty Load lea addresses_A+0xfae4, %rax nop nop nop nop add %r14, %r14 movb (%rax), %r11b lea oracles, %r14 and $0xff, %r11 shlq $12, %r11 mov (%r14,%r11,1), %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 0}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D', 'congruent': 5}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_P', 'congruent': 1}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 7}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': True, 'size': 1, 'type': 'addresses_A', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 10}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
37.254658
2,999
0.656219
14ee8cb008dd0fbf05ba6d1a1d1cc35e4db3ffd4
951
asm
Assembly
oeis/068/A068010.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/068/A068010.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/068/A068010.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A068010: Number of subsets of {1,2,3,...,n} that sum to 0 mod 3. ; Submitted by Jon Maiga ; 1,1,2,4,6,12,24,44,88,176,344,688,1376,2736,5472,10944,21856,43712,87424,174784,349568,699136,1398144,2796288,5592576,11184896,22369792,44739584,89478656,178957312,357914624,715828224,1431656448,2863312896,5726623744,11453247488,22906494976,45812985856,91625971712,183251943424,366503878656,733007757312,1466015514624,2932031012864,5864062025728,11728124051456,23456248070144,46912496140288,93824992280576,187649984495616,375299968991232,750599937982464,1501199875833856,3002399751667712 mov $3,$0 seq $0,60547 ; a(n) is the number of patterns, invariant under 120 degree rotations, that may appear in a top-down equilateral triangular arrangement of closely packed black and white cells satisfying the local matching rule of Pascal's triangle modulo 2, where n is the number of cells in each edge of the arrangement. mov $2,2 pow $2,$3 add $0,$2 div $0,3
86.454545
489
0.815983
d7cc161596c4fc81647e0fe71db93a05aed260e7
11,371
asm
Assembly
C/LoDosLib/startdev.asm
p-k-p/SysToolsLib
827be2799e541410cb5c11358cd4ce6859e171ad
[ "Apache-2.0" ]
232
2016-04-27T21:56:11.000Z
2022-03-29T09:02:15.000Z
C/LoDosLib/startdev.asm
p-k-p/SysToolsLib
827be2799e541410cb5c11358cd4ce6859e171ad
[ "Apache-2.0" ]
31
2016-05-09T09:05:36.000Z
2022-03-29T19:17:45.000Z
C/LoDosLib/startdev.asm
p-k-p/SysToolsLib
827be2799e541410cb5c11358cd4ce6859e171ad
[ "Apache-2.0" ]
94
2016-06-01T18:10:39.000Z
2022-03-26T10:44:57.000Z
page ,132 ;*****************************************************************************; ; ; ; FILE NAME: startdev.asm ; ; ; ; DESCRIPTION: Generic device driver startup module ; ; ; ; NOTES: Must be linked first. ; ; ; ; Calls during the initialization the C routine: ; ; int _cdecl devmain(char far *fpParms) ; ; If devmain() returns 0, the driver stays resident. ; ; Else it is unloaded from memory. ; ; ; ; Calls the C routines Read, Write, Peek, RStatus, WStatus. ; ; They must be implemented in a resident module with a .r ; ; extension. See DOSDRV.H for prototypes. ; ; ; ; Adaptations: ; ; - Set the driver name in the device header structure. ; ; - Change the list of supported functions if needed. ; ; ; ; HISTORY: ; ; ; ; 1995-08-22 JFL Leveraged this file. Set the driver name to "MARMOTT$". ; ; 2016-04-11 JFL Renamed NODOSLIB as BIOSLIB. ; ; ; ; (c) Copyright 1995-2017 Hewlett Packard Enterprise Development LP ; ; Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 ; ;*****************************************************************************; INCLUDE ADEFINE.INC ; BIOS.LIB definitions INCLUDE DOSDRV.INC ; MS-DOS device drivers definitions DGROUP GROUP RESID, _TEXT, CONST, _DATA, _BSS, C_COMMON, STACK public _acrtused ; Identify this module as the startup module _acrtused equ 0 ; The actual value does not matter ;=============================================================================; ; Structures, equates ; ;=============================================================================; init_request struc ; Init command request structure db (size RequestHeader) dup (?) ; Standard request header n_units db ? ; Number of units end_address dd ? ; Driver end address bpb dd ? ; parameters / bpb pointer dev_number db ? ; Block device number (read only) init_request ends ;=============================================================================; ; Driver header & data ; ;=============================================================================; RSEG ASSUME DS:NOTHING, ES:NOTHING, SS:NOTHING ; Device driver header (Must be at offset 0) public deviceHeader deviceHeader label DeviceHeader dd -1 ; Only one driver in this file dw 08020H ; Character device dw offset strategy ; Pointer to strategy routine dw offset interrupt ; Pointer to interrupt routine db 'MARMOTT$' ; 8 byte character device name db 0 ; Make the device name accessi- ; -ble by C string functions db 0 ; Align the rest on a dword ;=============================================================================; ; Resident variables ; ;=============================================================================; pRequest dd ? ; Request pointer ;=============================================================================; ; Strategy routine ; ;=============================================================================; strategy proc far mov word ptr pRequest , bx mov word ptr pRequest +2, es ret strategy endp ;=============================================================================; ; Interrupt routine ; ;=============================================================================; dispatch label word ; Command dispatch table dw offset DGROUP:init ; Command 0 = initialization dw offset DGROUP:unsup ; Command 1 = Media check dw offset DGROUP:unsup ; Command 2 = Build BPB dw offset DGROUP:unsup ; Command 3 = IOCTL input dw offset DGROUP:Read ; Command 4 = Input dw offset DGROUP:Peek ; Command 5 = Peek dw offset DGROUP:RStatus ; Command 6 = Input status dw offset DGROUP:succeed ; Command 7 = Input flush dw offset DGROUP:Write ; Command 8 = Output dw offset DGROUP:Write ; Command 9 = Output & verify dw offset DGROUP:WStatus ; Command 10 = Output status dw offset DGROUP:succeed ; Command 11 = Output flush dw offset DGROUP:unsup ; Command 12 = IOCTL output dw offset DGROUP:succeed ; Command 13 = Open device dw offset DGROUP:succeed ; Command 14 = Close device DISPATCH_SIZE equ $-offset dispatch ; Size of the table interrupt proc far push ax push bx push cx push dx push si push di push bp push ds push es cld ; Always useful les bx, pRequest ; Get the request pointer ; Get the command byte mov al, (RequestHeader PTR es:[bx]).rhFunction IFDEF _DEBUG call DebugStart ENDIF cbw ; Convert it to a word, shl ax, 1 ; then to an offset in the mov si, ax ; dispatch table. cmp si, DISPATCH_SIZE ; Is this outside of the table? mov ax, 8003H ; Assume failure jae unsupported push cs ; Load segment registers for C pop ds push es ; Push argument for C push bx call word ptr dispatch[si] ; Routine is supported. Call it. pop bx ; Restore ES:BX pop es unsupported: or ah, 1 ; Set "done" bit in status code. mov (RequestHeader PTR es:[bx]).rhStatus, ax IFDEF _DEBUG call DebugStop ENDIF pop es pop ds pop bp pop di pop si pop dx pop cx pop bx pop ax ret interrupt endp ;=============================================================================; ; Resident command routines ; ;=============================================================================; ; All others have been moved to the C .R modules succeed proc near sub ax, ax unsup proc near ret unsup endp succeed endp ;=============================================================================; ; Optional resident DEBUG code ; ;=============================================================================; IFDEF _DEBUG ASSUME DS:NOTHING, ES:NOTHING, SS:NOTHING DebugStart proc near mov ah, '!' xchg al, ah call outc ; Output the I/O character mov al, ah call outal mov al, ah ; Restore the function code ret DebugStart endp DebugStop proc near push ax mov al, '.' call outc ; Output the end code pop ax ret DebugStop endp THR equ 0 ; Transmitter Holding Register LSR equ 5 ; Line Status Register THRE equ 020H ; LSR Transmit Holding Register Empty public DebugPort ; Debug port base address. DebugPort dw 0 ; Default: None public outc outc proc near ; Output a character to a serial port push dx push bx mov bx, DebugPort ; Debug port base address test bx, bx jz no_debug push ax lea dx, [bx+LSR] @@: in al, dx test al, THRE jz @B ; Wait til the transmit reg is empty pop ax lea dx, [bx+THR] out dx, al ; Send the character no_debug: pop bx pop dx ret outc endp public outal outal proc near ; Ouput AL in hexadecimal push ax shr al, 1 shr al, 1 shr al, 1 shr al, 1 call outh pop ax call outh ret outal endp outh proc near ; Output AL lowest nibble in hexadecimal push ax and al, 0FH cmp al, 0AH jb @F add al, ('A'-0AH)-'0' @@: add al, '0' call outc ; Output the function number pop ax ret outh endp ENDIF ASSUME DS:NOTHING, ES:NOTHING, SS:NOTHING ;=============================================================================; ; ; ;=============================================================================; ENDRS ;=============================================================================; ; Discardable initialization routine ; ;=============================================================================; .CODE extrn devmain:near init proc near ; Load segment registers for C ASSUME DS:DGROUP ; ds already set ; Clear the uninitialized data area and near heap mov dx, cs mov es, dx mov di, offset DGROUP:_BSS ; Beginning of the area mov cx, offset DGROUP:STACK ; end of the area sub cx, di ; size in bytes (it's even) shr cx, 1 ; Idem in words sub ax, ax rep stosw ; Clear the area ; Load a stack for C call SwitchStack ; Call the C main initialization routine les bx, pRequest les bx, es:[bx].bpb push es ; Push a far pointer to the parameter line push bx call devmain add sp, 4 ; Remove the parameters from the stack ; Restore the pointer to the request packet les bx, pRequest ; Switch back to the DOS stack pop cx pop ss mov sp, cx test ax, ax jz success ; Driver failure mov word ptr es:[bx].end_address, 0 mov word ptr es:[bx].end_address+2, cs mov ax, 80FEH ; Initialization failed. ret success: mov word ptr es:[bx].end_address, offset DGROUP:_TEXT mov word ptr es:[bx].end_address+2, cs sub ax, ax ; Initialization succeeded. ret init endp ;=============================================================================; ; ; ENTRY POINT NAME: SwitchStack ; ; DESCRIPTION: Switch to a local C-compatible stack ; ; INPUT PARAMETERS ; DS = DGROUP ; ; OUTPUT PARAMETERS ; SS:SP = Top of local stack. First DWORD on it = Top of DOS stack ; ; REGISTERS DESTROYED: AX, BX, CX, DX, ES ; ; REGISTERS PRESERVED: Others ; ; DEPENDENCIES ; ; ALGORITHM USED ; ; NOTES ; The trick with DOS versions allows to be loaded high in small UMBs ; under DOS 5 and later versions. The UMB should at least 6 or 7 KB ; for a sucessful initialization. ; ; ; MODIFICATION HISTORY NOTES ; JFL 93/08/04 Initial implementation. ; ;=============================================================================; SwitchStack proc near ASSUME DS:DGROUP mov dx, ds ; dx = DGROUP now on ; Get DOS version number mov ah, 30H int 21H ; Get DOS version. Destroys BX, CX les bx, pRequest ; Restore the pointer to request ; For DOS versions below 5, we must provide a dummy end address cmp al, 5 jae @F ; Jump if at least DOS 5 mov ax, dx ; AX = DGROUP add ax, 1000H ; AX = DGROUP + 64 KB mov word ptr es:[bx+end_address], 0 mov word ptr es:[bx+end_address+2], ax @@: ; Compute the top of stack address mov ax, word ptr es:[bx+end_address] mov cl, 4 shr ax, cl ; Convert offset to paragraphs add ax, word ptr es:[bx+end_address+2] ; Add segment sub ax, dx ; Number of paragraph we own cmp ax, 1000H ; More than 64 KB available? jbe @F mov ax, 1000H ; If more, use only 64 KB anyway @@: shl ax, cl ; Convert paragraphs to offset of top of st. mov bx, ax ; Top of local stack ; Save the DOS stack top on the new stack pop ax ; Return address dec bx dec bx mov [bx], ss dec bx dec bx mov [bx], sp ; Now switch stack. No need to clear ints for stack switches. mov ss, dx mov sp, bx ; Cleanup and return push ax ; Return address xor bp, bp ; Used by Debuggers to end stack back trace ret ASSUME DS:NOTHING, ES:NOTHING, SS:NOTHING SwitchStack endp ;=============================================================================; ; Discardable data ; ;=============================================================================; END
24.142251
79
0.534869
3e3e9f37728ead2b637b8fd8d76d52927e3657ef
70
asm
Assembly
align.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
17
2018-06-17T19:12:27.000Z
2021-05-31T16:20:44.000Z
align.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
null
null
null
align.asm
gp48k/lpfp
070c73a8b67d98f85d2de86d75b23f0e71a18a8a
[ "MIT" ]
4
2018-10-14T16:08:26.000Z
2021-06-21T23:31:59.000Z
; Align to 256-byte page boundary DEFS (($ + $FF) / $100) * $100 - $
23.333333
35
0.542857
a0a3edd74f0b3f84697cfe6267f78a3712f11e38
258
asm
Assembly
programs/oeis/004/A004930.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/004/A004930.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/004/A004930.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A004930: Floor of n*phi^15, where phi is the golden ratio, A001622. ; 0,1364,2728,4092,5456,6820,8184,9548,10912,12276,13640,15004,16368,17732,19096,20460,21824,23188,24552,25916,27280,28644,30008,31372,32736,34100,35464,36828,38192 mov $1,$0 mul $1,1364
43
164
0.767442
73e2d0f59d12247a7d0359c7f532657f3295c653
671
asm
Assembly
oeis/075/A075745.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/075/A075745.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/075/A075745.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A075745: Numbers n such that 210*n + 13 is prime. ; Submitted by Jon Maiga ; 0,1,2,3,4,5,7,8,10,14,15,16,17,18,19,21,27,32,36,38,41,43,45,47,48,49,50,51,54,60,61,62,66,67,68,69,70,71,76,77,79,83,85,88,90,92,93,94,95,96,98,100,102,105,106,107,113,116,118,121,122,124,125,127,128,129,132,133,136,142,144,150,151,153,154,155,157,159,160,162,167,171,173,176,180,184,189,191,193,198,200,201,202,203,204,205,212,214,222,230 mov $1,4 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,2 mov $3,$1 mul $3,3 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,35 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 div $0,70
29.173913
342
0.648286
56354803dd29f945f2a90bacf07486d88025ddb4
3,539
asm
Assembly
source/features/keyboard.asm
mynameispyo/InpyoOS
b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d
[ "BSD-3-Clause", "MIT" ]
null
null
null
source/features/keyboard.asm
mynameispyo/InpyoOS
b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d
[ "BSD-3-Clause", "MIT" ]
null
null
null
source/features/keyboard.asm
mynameispyo/InpyoOS
b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d
[ "BSD-3-Clause", "MIT" ]
null
null
null
; ================================================================== ; 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 .try_again: mov bh, 0 call .screen_power mov byte [.scrn_active], 0 ; Reset all the screensaver variables mov word [.ticks], 0 mov al, [0082h] ; Save the current screen state, for later mov [.gfx_state], al mov ah, 03h mov bh, 0 int 10h mov [.orig_crsr], cx ; Get the shape of the cursor .loop: hlt ; Halt the CPU for 1/18.2 seconds, to save the CPU usage call .screensaver call os_check_for_key cmp ax, 0 je .loop pusha mov ax, 0500h int 10h mov al, [.gfx_state] mov [0082h], al mov cx, [.orig_crsr] mov ah, 01h int 10h popa cmp byte [.scrn_active], 1 je .try_again mov [.tmp_buf], ax popa mov ax, [.tmp_buf] ret .screensaver: inc word [.ticks] movzx ax, byte [57074] mov bx, 1092 ; 18.2 Hz * 60 seconds mul bx cmp word [.ticks], ax jl .good cmp word [57074], 0 je .good mov ah, 0Fh int 10h cmp al, 3 jne .good pusha mov byte [0082h], 1 mov ax, 0501h int 10h call os_hide_cursor mov byte [.scrn_active], 1 mov bh, 4 call .screen_power popa .good: ret .screen_power: cmp bh, [.scrn_power] je .good pusha mov ax, 4F10h mov bl, 1 mov [.scrn_power], bh int 10h popa ret .ticks dw 0 .tmp_buf dw 0 .gfx_state db 0 .orig_crsr dw 0 .scrn_active db 0 .scrn_power db 0 ; ------------------------------------------------------------------ ; os_check_for_key -- Scans keyboard buffer 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, 0100h ; BIOS call to check for key int 16h jz .nokey ; If no key, skip to end xor ax, ax ; Otherwise get it from buffer int 16h call special_keys mov [.tmp_buf], ax ; Store resulting keypress popa ; But restore all other regs mov ax, [.tmp_buf] ret .nokey: call special_keys popa xor ax, ax ; Zero result if no key pressed ret .tmp_buf dw 0 ; ================================================================== ; Checks for special keys and performs their action. ; IN: AX = key ; OUT: nothing special_keys: pusha cmp ah, 105 je near .disable_sound cmp ah, 106 je near .enable_sound cmp ah, 107 je near .exit_app cmp ah, 140 je near .intended_system_crash popa ret .intended_system_crash: mov ax, .crash_msg call os_fatal_error .crash_msg db 'Intended system crash', 0 .exit_app: cmp byte [app_running], 0 je near .no_exit popa call os_return_app_timer mov al,00110110b out 43h, al mov al, 0 out 40h, al out 40h, al mov sp, [origstack] sub sp, 2 ret .no_exit: popa ret .enable_sound: mov byte [0083h], 1 jmp .display_speaker .disable_sound: mov byte [0083h], 0 call os_speaker_off .display_speaker: cmp byte [0082h], 1 je .no_display_spkr call os_get_cursor_pos push dx mov dx, 79 ; Print the little speaker icon call os_move_cursor mov ax, 0E17h mov bh, 0 cmp byte [0083h], 0 je .no_crossed_spkr dec al .no_crossed_spkr: int 10h pop dx call os_move_cursor .no_display_spkr: popa ret .tmp_buffer times 12 db 0 .tmp_time dw 0 .tmp_hours db 0 ; ==================================================================
15.869955
71
0.60243
a6463db45313adc98afcc5e44f35353ed93ebef1
321
asm
Assembly
programs/oeis/092/A092242.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/092/A092242.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/092/A092242.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A092242: Numbers that are congruent to {5, 7} mod 12. ; 5,7,17,19,29,31,41,43,53,55,65,67,77,79,89,91,101,103,113,115,125,127,137,139,149,151,161,163,173,175,185,187,197,199,209,211,221,223,233,235,245,247,257,259,269,271,281,283,293,295,305,307,317,319,329,331 mov $1,$0 div $0,2 mul $0,4 add $1,$0 mul $1,2 add $1,5
32.1
207
0.682243
c4fffc5ab6f72544ef1fc2ecaada9ed72beb2eab
408
asm
Assembly
programs/oeis/095/A095076.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/095/A095076.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/095/A095076.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A095076: Parity of 1-fibits in Zeckendorf expansion A014417(n). ; 0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,1,1,1,0,1,0,0,0,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1 seq $0,7895 ; Number of terms in Zeckendorf representation of n (write n as a sum of non-consecutive distinct Fibonacci numbers). mod $0,2
68
201
0.632353
da7b1e37c8e70ef86465fdf089842f3c5813f595
1,862
asm
Assembly
game_vblank.asm
adamsmasher/bustfree
446d6777f42d3baa57f29ec9e4613a3e5cd4afe9
[ "MIT" ]
null
null
null
game_vblank.asm
adamsmasher/bustfree
446d6777f42d3baa57f29ec9e4613a3e5cd4afe9
[ "MIT" ]
null
null
null
game_vblank.asm
adamsmasher/bustfree
446d6777f42d3baa57f29ec9e4613a3e5cd4afe9
[ "MIT" ]
null
null
null
RSRESET vramUpdate_Addr RW 1 vramUpdate_Data RB 1 vramUpdate_Padding RB 1 vramUpdate_SIZEOF RB 0 MAX_VRAM_UPDATES EQU 2 SECTION "GameVBlankRAM", WRAM0 VRAMUpdates:: DS vramUpdate_SIZEOF * MAX_VRAM_UPDATES VRAMUpdateLen:: DS 1 StatusDirty:: DS 1 StatusBar:: DS 20 SECTION "GameVBlank", ROM0 VBlank: CALL EnableSprites CALL RunVBlankUpdates LD A, [StatusDirty] AND A CALL NZ, CopyStatus XOR A LD [VRAMUpdateLen], A LD [StatusDirty], A RET EnableSprites: LD HL, $FF40 SET 1, [HL] RET CopyStatus: LD HL, StatusBar LD DE, $9C00 LD B, 20 .loop LD A, [HLI] LD [DE], A INC E DEC B JR NZ, .loop RET ClearStatus:: XOR A LD HL, StatusBar LD B, 20 .loop LD [HLI], A DEC B JR NZ, .loop RET InitGameVBlank:: XOR A LD [VRAMUpdateLen], A LD [StatusDirty], A LD HL, VBlankHandler LD A, LOW(VBlank) LD [HLI], A LD [HL], HIGH(VBlank) RET RunVBlankUpdates: LD A, [VRAMUpdateLen] AND A RET Z LD B, A LD HL, VRAMUpdates .loop LD A, [HLI] ; get dest addr LD E, A LD A, [HLI] LD D, A LD A, [HLI] ; get data LD [DE], A INC L ; skip padding DEC B JR NZ, .loop RET
25.162162
59
0.404404
1c971cf359f45a7006b4766d6633c304e52725f7
850
asm
Assembly
oeis/142/A142385.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142385.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142385.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142385: Primes congruent to 34 mod 47. ; Submitted by Christian Krause ; 269,457,739,1021,1303,1867,2243,2713,3089,3371,3559,4217,4969,6379,6473,6661,7507,7789,7883,8353,8447,9011,9199,9293,9857,10139,10891,11173,11549,11831,12113,12301,12583,12959,13147,13241,13523,13711,14087,14369,14557,15121,15497,16061,16249,17189,17377,17471,17659,18223,18787,19069,19163,19727,20479,21419,21701,22171,22453,23017,23581,23957,24239,24709,25367,25931,26119,26683,26777,27059,27529,28657,28751,29033,29221,29879,30161,30631,31477,32323,32887,33827,34297,34673,35801,36083,36929,37117 mov $1,50 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $1,10 sub $2,1 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,57 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,113
34
501
0.730588
75eb10f9232a682486dab5c8ba7d8cac23f9e249
725
asm
Assembly
oeis/268/A268827.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/268/A268827.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/268/A268827.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A268827: Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268825(n-1)). ; Submitted by Simon Strandgaard ; 0,1,3,2,6,7,5,12,4,10,14,13,15,30,26,25,27,11,9,24,8,54,50,49,51,19,17,48,16,31,29,20,28,18,22,21,23,102,98,97,99,35,33,96,32,47,45,36,44,34,38,37,39,55,53,60,52,58,62,61,63,46,42,41,43,59,57,40,56,198,194,193,195,67,65,192,64,79,77,68,76,66,70,69,71,87,85,92,84,90,94,93,95,78,74,73,75,91,89,72 mov $1,$0 trn $0,1 seq $0,268825 ; Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268823(n-1)). add $0,1 seq $0,268717 ; Permutation of natural numbers: a(0) = 0, a(n) = A003188(1+A006068(n-1)), where A003188 is binary Gray code and A006068 is its inverse. cmp $1,0 cmp $1,0 mul $0,$1
55.769231
297
0.671724
7a4635a020c134bec6be572545cb83a42c57efb4
4,637
asm
Assembly
sound.asm
DChristianson/atari-vcs-samples
3ceed98ddd242d1991abab619c321d2d58de60d3
[ "MIT" ]
null
null
null
sound.asm
DChristianson/atari-vcs-samples
3ceed98ddd242d1991abab619c321d2d58de60d3
[ "MIT" ]
null
null
null
sound.asm
DChristianson/atari-vcs-samples
3ceed98ddd242d1991abab619c321d2d58de60d3
[ "MIT" ]
null
null
null
processor 6502 include "vcs.h" include "macro.h" NTSC = 0 PAL60 = 1 IFNCONST SYSTEM SYSTEM = NTSC ENDIF ; ---------------------------------- ; constants #if SYSTEM = NTSC ; NTSC Colors POND_WATER = $A0 #else ; PAL Colors POND_WATER = $92 #endif SEG.U variables ORG $80 frame ds 1 audspeed ds 1 audpat ds 1 mode ds 1 audc ds 1 audf ds 1 buzzer ds 1 ;------------- ;.| |.; ;-/ \-; ; G ; ;-\ B /-; ;.| |.; ;------------- SEG ORG $F000 Reset ; clear cld cld ; set TIA to known state (clear to 0) lda #0 ldx #$3f .zapTIA sta 0,x dex bpl .zapTIA ldx #127 .zapRAM sta $80,x dex bpl .zapRAM lda #$13 sta audf lda #$00 sta audc lda #$02 sta audspeed sta frame lda #$d8 sta audpat sta mode StartOfFrame ; Start of vertical blank processing lda #0 sta VBLANK ; 3 scanlines of vertical sync signal to follow lda #%00000010 sta VSYNC ; turn ON VSYNC bit 1 sta WSYNC ; wait a scanline sta WSYNC ; another sta WSYNC ; another = 3 lines total lda #0 sta VSYNC ; turn OFF VSYNC bit 1 ; 37 scanlines of vertical blank to follow lda #1 sta VBLANK ldx #36 vBlank sta WSYNC dex bne vBlank lda #0 sta VBLANK movePlayer_dir ; SL 23 sta WSYNC ;3 0 lda #$08 sta AUDV1 lda #$80 bit SWCHA ;3 3 beq movePlayer_right ;2 5 lsr ;2 7 bit SWCHA ;3 10 beq movePlayer_left ;2 12 lda #$00 sta AUDV1 jmp movePlayer_end ;3 30 movePlayer_right lda #$02 sta AUDF1 jmp movePlayer_end movePlayer_left sec lda audspeed sbc frame sta AUDF1 lda #$0a movePlayer_end sta AUDC1 updateAudio sta WSYNC dec frame bpl updateAudio_end ror mode bcc updateAudio_clear lda audf sta AUDF0 lda audc sta AUDC0 lda #$03 sta AUDV0 jmp updateAudio_reset updateAudio_clear bne updateAudio_clear_0 lda audpat sta mode updateAudio_clear_0 lda #$00 sta AUDF0 sta AUDC0 sta AUDV0 updateAudio_reset lda audspeed sta frame updateAudio_end startPlayfield ; 44 22 * * * * * ; ee 77 *** *** *** *** *** ; ******************** ; 45677654321001234567 ; c0 c0 0f **** **** ; f0 f3 3f ******** ******** ; ff ff ff ******************** ; 45677654321001234567 ; parallax sta WSYNC lda #POND_WATER sta COLUBK sta WSYNC lda #$22 sta PF1 asl sta PF2 sta WSYNC lda #$22 sta PF1 asl sta PF0 sta PF2 sta WSYNC lda #$77 sta PF1 asl sta PF0 sta PF2 sta WSYNC lda #$77 sta PF1 asl sta PF0 sta PF2 sta WSYNC lda #$ff sta PF1 sta PF0 sta PF2 sta WSYNC ; pond sta WSYNC lda #POND_WATER sta COLUBK lda #$00 sta PF1 sta PF0 sta PF2 ldx #185 pondLoop sta WSYNC dex bne pondLoop ; overscan lda #0 sta COLUBK ldx #30 overscan sta WSYNC dex bne overscan jmp StartOfFrame ;----------------------------------------------------------------------------------- ; the CPU reset vectors ORG $F7FA .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END
19.401674
84
0.386025
87904944611afbcbcad59750d7a6b1b7b6981af9
177
asm
Assembly
data/pokemon/dex_entries/kricketune.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/dex_entries/kricketune.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/dex_entries/kricketune.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db "CRICKET@" ; species name db "By allowing its" next "cry to resonate in" next "the hollow of its" page "belly, it can" next "produce a" next "captivating sound.@"
17.7
29
0.666667
c20110b48959f4322e1c304658ebd118e3f6e9b4
712
asm
Assembly
oeis/290/A290923.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/290/A290923.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/290/A290923.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A290923: p-INVERT of the positive integers, where p(S) = 1 - 2*S - 2*S^2. ; Submitted by Christian Krause ; 2,10,46,208,938,4230,19078,86048,388106,1750490,7895302,35610480,160615298,724429270,3267420814,14737172032,66469626002,299800475370,1352201455582,6098885514512,27508034668634,124070532153830,559600027205398,2523985228499040,11384026311605402,51345805672718650,231586934887257526,1044535336582929328,4711207348124222258,21249137199732725430,95840789498012892958,432274348142377958528,1949703388720436737826,8793821146971941391050,39663105071424409301902,178894007236951167151440 add $0,1 mov $3,1 lpb $0 sub $0,1 sub $4,$2 add $2,$3 add $2,$3 add $1,$2 add $4,$1 add $3,$4 lpe mov $0,$4
41.882353
480
0.80618
8eb6ccfdddd2968fff808d01b38a601bed590df2
12,627
asm
Assembly
P6/data_P6_2/ALUTest107.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
1
2022-01-23T09:24:47.000Z
2022-01-23T09:24:47.000Z
P6/data_P6_2/ALUTest107.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
P6/data_P6_2/ALUTest107.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
subu $3,$6,$3 addiu $5,$3,6263 lh $4,6($0) slti $4,$3,-28897 slti $3,$3,1088 lbu $4,14($0) srav $1,$3,$3 slt $1,$4,$3 lb $3,9($0) lw $0,0($0) subu $5,$5,$3 srlv $6,$6,$3 sltiu $0,$4,-3673 srl $0,$3,11 sra $4,$3,7 sll $3,$3,28 xori $1,$3,55169 srav $3,$6,$3 sh $3,8($0) andi $0,$6,52380 addiu $5,$5,-16638 addiu $0,$5,25729 addiu $3,$3,-15999 xori $3,$3,11361 or $5,$3,$3 sw $4,0($0) srlv $3,$3,$3 lhu $6,10($0) nor $5,$0,$3 ori $3,$3,48048 sra $5,$3,6 addiu $3,$3,-7624 lh $5,8($0) lh $3,14($0) xori $3,$3,54945 sw $4,4($0) sw $4,12($0) lb $3,4($0) lhu $3,10($0) srlv $3,$5,$3 sll $4,$3,11 subu $1,$6,$3 slt $5,$4,$3 sllv $4,$4,$3 sb $3,6($0) lbu $3,1($0) lw $1,4($0) lh $3,10($0) sllv $3,$1,$3 addu $5,$6,$3 sb $5,16($0) subu $3,$1,$3 addiu $3,$1,-16408 sll $6,$4,24 and $3,$3,$3 sb $4,9($0) xori $4,$0,59261 srav $4,$6,$3 sltiu $3,$3,-23747 xori $0,$0,23083 subu $4,$3,$3 sra $5,$5,11 srl $1,$4,16 srlv $4,$4,$3 subu $5,$4,$3 or $3,$3,$3 subu $4,$4,$3 sb $5,10($0) subu $1,$1,$3 addiu $1,$4,27613 andi $4,$3,59821 slt $4,$3,$3 lbu $4,16($0) sh $3,2($0) srl $5,$5,24 addiu $4,$4,7721 sltiu $4,$4,11795 lb $4,0($0) addu $3,$6,$3 xor $0,$1,$3 or $1,$4,$3 sb $5,10($0) sw $6,4($0) sltiu $3,$0,9281 lbu $5,16($0) ori $1,$4,39833 sltiu $3,$1,-685 lbu $0,15($0) srl $0,$3,25 sb $6,1($0) or $3,$6,$3 addu $5,$5,$3 lhu $1,16($0) xori $4,$5,54708 lbu $0,14($0) ori $3,$0,41277 sltu $1,$5,$3 addiu $3,$5,2946 xori $4,$4,41415 slt $4,$3,$3 srl $3,$3,21 lbu $4,4($0) lbu $4,15($0) slt $0,$3,$3 slti $5,$1,32247 addu $5,$5,$3 and $5,$3,$3 subu $4,$3,$3 srl $4,$4,28 addiu $0,$0,-20801 lb $1,9($0) srav $4,$4,$3 slti $4,$4,-8907 srlv $0,$1,$3 slti $5,$5,17137 sltu $3,$1,$3 sllv $1,$1,$3 sltu $3,$4,$3 sltiu $4,$4,-26246 lh $3,0($0) sllv $0,$5,$3 sllv $1,$1,$3 lbu $4,1($0) addu $3,$3,$3 lh $4,12($0) sb $1,11($0) sll $3,$3,0 and $1,$3,$3 sllv $5,$5,$3 lbu $3,4($0) and $3,$4,$3 sltu $6,$4,$3 and $5,$6,$3 lw $0,12($0) slt $3,$6,$3 sb $3,11($0) srl $4,$4,2 xori $5,$1,55919 lb $6,5($0) xori $5,$5,22614 srav $5,$4,$3 subu $6,$6,$3 or $3,$6,$3 sra $4,$4,26 sltu $1,$5,$3 sltiu $4,$1,31296 subu $6,$3,$3 sltu $5,$1,$3 slt $6,$6,$3 sh $3,16($0) sltiu $4,$3,22072 sh $1,4($0) slt $4,$4,$3 sw $5,4($0) lh $5,12($0) srl $4,$3,4 lb $0,14($0) subu $3,$1,$3 lh $1,14($0) lbu $4,4($0) addu $3,$4,$3 slti $0,$4,-18536 xori $3,$3,34093 or $3,$3,$3 addiu $4,$1,-29396 sh $5,10($0) sra $1,$1,3 and $4,$3,$3 sltiu $5,$1,-12458 sb $3,8($0) xori $3,$4,38059 lbu $5,6($0) sra $3,$6,11 and $3,$4,$3 sw $3,12($0) addu $3,$4,$3 addu $5,$4,$3 lw $3,4($0) subu $6,$6,$3 sw $4,8($0) lb $3,5($0) sllv $4,$4,$3 lb $4,13($0) addiu $1,$3,-4478 slti $5,$3,-7112 subu $3,$3,$3 nor $5,$6,$3 addiu $6,$4,8981 ori $0,$3,20713 xori $1,$3,17538 sltiu $4,$6,-9683 nor $0,$0,$3 slti $6,$1,-30738 srav $5,$5,$3 sltu $6,$6,$3 lw $5,12($0) and $4,$5,$3 sh $6,4($0) sltiu $4,$0,-27339 nor $4,$1,$3 srav $5,$5,$3 lhu $6,12($0) ori $4,$4,19278 xori $4,$4,62724 nor $4,$5,$3 andi $3,$3,28598 slti $0,$1,17515 ori $3,$3,10096 srl $3,$3,21 lw $1,4($0) addu $4,$4,$3 xori $1,$3,52346 srlv $1,$3,$3 srl $4,$3,24 addiu $6,$6,-19937 slt $3,$4,$3 sw $3,4($0) sll $1,$1,4 sw $3,16($0) xor $5,$3,$3 xori $3,$3,25571 andi $4,$3,53890 andi $5,$5,24875 ori $4,$5,54077 xor $6,$5,$3 sltu $3,$3,$3 subu $3,$3,$3 nor $3,$3,$3 addu $0,$4,$3 sra $4,$5,14 sb $5,13($0) andi $1,$4,46576 srl $5,$5,9 srlv $4,$0,$3 sra $4,$3,29 sltiu $3,$3,5839 subu $5,$4,$3 sltiu $4,$1,-12688 lb $6,11($0) andi $3,$0,39297 xor $5,$1,$3 nor $3,$3,$3 addu $3,$4,$3 srl $6,$6,4 sw $3,8($0) lbu $3,13($0) slti $0,$5,-19404 sltiu $0,$3,-20414 xori $4,$4,9632 lw $3,4($0) subu $3,$3,$3 sltu $4,$4,$3 nor $3,$1,$3 sh $3,4($0) slt $4,$4,$3 addiu $3,$3,-30229 srav $3,$3,$3 addiu $4,$6,-8696 sll $3,$0,15 sra $4,$5,19 xori $1,$4,50461 or $4,$0,$3 subu $5,$1,$3 lbu $1,16($0) andi $3,$1,31519 addu $0,$5,$3 addu $3,$5,$3 xor $1,$1,$3 slti $5,$5,-8285 addiu $3,$3,-2255 lb $3,7($0) ori $1,$1,8619 sllv $4,$2,$3 andi $1,$1,32699 subu $5,$5,$3 srlv $5,$4,$3 lw $5,0($0) srav $4,$4,$3 addiu $6,$3,-24663 sb $4,14($0) sltiu $3,$6,-1561 srl $6,$1,7 sh $4,10($0) sll $3,$3,0 sltiu $5,$6,11437 sra $1,$1,30 srl $3,$5,3 and $3,$3,$3 sllv $5,$0,$3 lb $0,15($0) or $3,$3,$3 subu $2,$2,$3 srlv $4,$3,$3 sll $0,$0,6 slt $5,$4,$3 lh $4,4($0) or $1,$1,$3 slti $5,$3,5083 lw $4,12($0) nor $4,$3,$3 lbu $4,1($0) addiu $3,$4,27548 or $4,$1,$3 addu $3,$3,$3 sll $3,$6,5 sra $3,$3,12 subu $5,$1,$3 addiu $1,$3,-31056 slti $6,$6,-27321 sh $6,2($0) sltiu $1,$4,32562 sllv $6,$3,$3 addiu $3,$3,-1681 addiu $5,$6,5405 lw $4,12($0) xori $4,$4,57015 nor $5,$0,$3 sll $4,$5,25 lhu $3,6($0) and $1,$3,$3 xor $0,$4,$3 lhu $1,16($0) srl $1,$3,25 xor $3,$3,$3 addiu $3,$6,1225 andi $5,$5,62966 sllv $0,$0,$3 sra $3,$3,17 lhu $6,14($0) lhu $3,4($0) sllv $4,$5,$3 addiu $6,$3,9080 slti $6,$1,1225 addu $3,$3,$3 sra $5,$4,16 and $3,$3,$3 xor $6,$6,$3 xor $1,$1,$3 slti $4,$4,-2878 lbu $4,9($0) addu $1,$1,$3 sw $6,8($0) sltiu $4,$3,-15872 ori $5,$5,43450 and $3,$3,$3 sltu $0,$5,$3 sll $3,$5,3 sw $3,12($0) addiu $0,$0,2955 addiu $3,$5,23592 slti $3,$1,-6569 subu $3,$4,$3 lh $1,16($0) sra $4,$5,2 sllv $4,$3,$3 lhu $1,6($0) lhu $3,12($0) subu $3,$4,$3 lb $5,14($0) lh $0,14($0) slt $6,$6,$3 sb $3,3($0) lh $5,8($0) addiu $3,$4,16174 sw $4,12($0) sra $3,$3,0 sb $4,7($0) or $4,$3,$3 xor $1,$5,$3 subu $3,$3,$3 sra $4,$4,31 xori $0,$0,62995 addiu $4,$4,-21494 lhu $3,16($0) lh $4,6($0) sh $5,8($0) andi $5,$4,9412 xori $3,$5,3817 slt $1,$3,$3 subu $6,$3,$3 sb $3,12($0) srav $4,$4,$3 or $4,$4,$3 srl $1,$1,24 sw $4,0($0) addiu $5,$3,-23431 slt $4,$1,$3 sll $1,$3,24 xori $5,$4,7648 andi $3,$4,59130 ori $1,$5,15115 lbu $5,12($0) subu $3,$3,$3 lh $3,0($0) addiu $1,$1,25204 nor $4,$3,$3 lh $3,12($0) sw $4,4($0) lw $5,0($0) ori $3,$5,37877 lh $5,2($0) lbu $4,4($0) sra $4,$5,18 lbu $5,1($0) xori $1,$5,51832 addu $4,$0,$3 slti $4,$5,-10242 addiu $4,$1,10678 srlv $3,$3,$3 xor $3,$4,$3 slt $3,$3,$3 addu $3,$4,$3 xor $3,$3,$3 addiu $5,$3,9143 addiu $6,$1,5363 lbu $5,12($0) or $0,$0,$3 subu $4,$1,$3 xor $3,$3,$3 xori $6,$3,6721 sllv $3,$3,$3 addu $1,$1,$3 sra $4,$5,10 sltiu $3,$3,4039 addiu $4,$4,26301 slti $5,$1,23327 sra $1,$3,18 srav $3,$3,$3 sw $5,16($0) lhu $1,16($0) subu $4,$4,$3 sra $3,$1,3 srlv $4,$5,$3 lb $3,6($0) sb $3,6($0) andi $3,$1,34027 lh $4,10($0) nor $3,$3,$3 sllv $3,$3,$3 srl $1,$3,1 sra $1,$4,7 slti $4,$4,10411 addiu $4,$1,-25203 or $3,$4,$3 lh $1,14($0) addu $1,$0,$3 slt $3,$1,$3 addiu $2,$2,18400 sllv $3,$3,$3 slti $4,$4,6944 sra $4,$3,27 sltu $5,$5,$3 ori $4,$6,55217 andi $4,$4,19749 slti $5,$5,-21452 or $3,$3,$3 lb $1,12($0) subu $5,$3,$3 sltiu $6,$4,-16682 slti $1,$4,-15685 srlv $6,$6,$3 sltiu $3,$2,-4490 srl $3,$3,30 xor $0,$1,$3 sb $3,1($0) slti $3,$5,32414 xori $3,$3,57512 srlv $3,$5,$3 slt $5,$5,$3 xor $3,$0,$3 addu $6,$0,$3 sll $5,$5,5 srav $3,$6,$3 addiu $1,$2,-28402 addiu $5,$1,23836 lhu $1,12($0) lb $4,11($0) and $4,$1,$3 ori $3,$3,29531 sllv $1,$3,$3 andi $1,$4,6424 addiu $4,$4,9349 srl $4,$2,5 sll $5,$3,31 sh $4,16($0) subu $3,$3,$3 srav $1,$1,$3 sra $3,$3,3 slti $2,$2,11945 lb $3,7($0) addu $5,$5,$3 lb $3,2($0) nor $3,$6,$3 sll $4,$4,0 sra $5,$3,28 andi $3,$3,47559 slti $3,$3,25716 addiu $6,$6,-30295 addu $5,$6,$3 sll $3,$4,9 xori $0,$5,9098 sw $1,0($0) sllv $0,$2,$3 andi $2,$2,20929 nor $4,$5,$3 and $3,$4,$3 addu $0,$0,$3 srl $5,$5,11 srav $5,$4,$3 xori $4,$4,26558 addiu $3,$3,-11644 sllv $4,$0,$3 addiu $4,$5,-29596 sw $1,16($0) lhu $4,8($0) lh $3,8($0) or $3,$3,$3 addiu $5,$5,-16796 lw $1,12($0) sltu $4,$4,$3 sb $0,12($0) srav $6,$5,$3 and $3,$4,$3 ori $4,$4,16304 srlv $1,$1,$3 lb $3,12($0) srav $3,$1,$3 sw $0,8($0) andi $3,$3,3087 lbu $0,16($0) sll $4,$4,16 sh $1,0($0) lbu $3,14($0) srav $1,$3,$3 sra $1,$4,15 slt $5,$1,$3 lw $3,8($0) lh $3,12($0) addiu $3,$0,23632 sll $4,$3,1 lhu $0,8($0) addiu $1,$3,-28063 sb $3,1($0) lw $4,16($0) andi $4,$5,6235 srlv $6,$4,$3 ori $5,$1,3363 sltiu $1,$1,5362 sll $6,$4,2 lhu $5,6($0) lh $5,4($0) lhu $4,6($0) addiu $6,$3,32002 lh $4,2($0) sltiu $1,$5,20806 or $4,$3,$3 lh $3,8($0) subu $6,$3,$3 sll $1,$1,30 addiu $5,$5,-1695 xor $0,$3,$3 sltiu $1,$3,21534 lbu $4,7($0) nor $3,$1,$3 srl $1,$1,6 addiu $6,$3,-12949 slti $3,$2,-23122 lh $0,6($0) sllv $0,$0,$3 or $5,$3,$3 slt $5,$5,$3 srav $4,$4,$3 sltu $4,$5,$3 lhu $5,10($0) slti $5,$4,22189 nor $3,$5,$3 sb $1,12($0) srav $3,$3,$3 subu $5,$5,$3 sltiu $3,$1,28889 addu $3,$2,$3 sb $1,14($0) addu $3,$3,$3 subu $6,$1,$3 sh $3,16($0) subu $3,$1,$3 lhu $5,4($0) xori $5,$5,61303 lbu $1,9($0) subu $4,$4,$3 or $3,$3,$3 sllv $1,$4,$3 xori $5,$0,943 addiu $4,$4,8353 addiu $4,$1,30620 sll $3,$3,31 sh $3,0($0) lb $4,9($0) sltiu $5,$1,-6995 srl $4,$3,27 or $3,$3,$3 ori $3,$5,44971 lbu $5,2($0) sh $3,8($0) addu $0,$5,$3 lh $3,2($0) ori $1,$4,45306 sll $4,$4,30 subu $3,$6,$3 or $3,$4,$3 addu $5,$5,$3 lbu $0,2($0) srl $1,$6,26 addiu $0,$4,8304 ori $1,$5,56562 subu $4,$0,$3 addu $4,$6,$3 lbu $3,7($0) subu $0,$3,$3 ori $4,$1,55674 slti $3,$3,-32180 lh $0,14($0) and $3,$4,$3 sb $4,8($0) sltu $5,$5,$3 subu $4,$4,$3 slt $0,$3,$3 andi $3,$6,34544 subu $1,$1,$3 ori $5,$5,53027 sllv $3,$1,$3 sltu $5,$2,$3 lb $4,6($0) and $5,$4,$3 addiu $4,$1,25998 subu $0,$3,$3 lhu $3,2($0) slt $5,$4,$3 or $1,$4,$3 xori $1,$3,41067 lb $3,5($0) sll $4,$5,30 lh $6,0($0) lb $3,9($0) nor $1,$5,$3 lhu $3,10($0) lbu $5,12($0) sllv $4,$1,$3 lh $3,10($0) xor $1,$1,$3 lhu $3,12($0) lw $5,4($0) ori $1,$1,6317 addu $4,$4,$3 andi $4,$3,59796 lh $4,2($0) subu $6,$5,$3 addu $6,$0,$3 slt $4,$3,$3 srl $3,$4,26 addiu $1,$3,-2497 subu $3,$4,$3 lh $4,2($0) addiu $4,$3,13082 sltiu $6,$4,-15249 sltu $3,$4,$3 sw $4,0($0) lbu $5,1($0) lbu $3,12($0) addu $4,$3,$3 sll $3,$1,28 addu $4,$5,$3 xori $0,$0,32572 xor $4,$3,$3 addu $3,$6,$3 sll $3,$3,27 sb $1,10($0) sllv $3,$4,$3 sllv $3,$3,$3 nor $5,$3,$3 xor $5,$5,$3 andi $6,$4,28649 slti $1,$6,-26762 andi $1,$4,19646 addiu $5,$5,3514 lb $3,11($0) slt $1,$4,$3 addu $3,$3,$3 addu $5,$1,$3 subu $4,$4,$3 sb $1,5($0) xori $3,$4,64296 lh $6,0($0) lw $1,0($0) ori $1,$1,1185 sltiu $3,$6,31458 and $6,$5,$3 srlv $4,$4,$3 lh $4,6($0) sll $5,$5,6 slti $6,$1,-24859 lbu $3,5($0) sh $3,16($0) lb $4,4($0) srav $0,$1,$3 sra $5,$5,9 sh $4,6($0) or $4,$3,$3 addiu $1,$1,-11437 subu $3,$3,$3 addu $0,$5,$3 lw $3,4($0) xori $3,$3,16355 andi $0,$4,55200 lb $3,3($0) sw $3,16($0) ori $1,$4,52613 xori $4,$0,63505 addiu $0,$0,-26818 srlv $0,$4,$3 subu $4,$4,$3 xor $3,$4,$3 srlv $5,$5,$3 subu $4,$3,$3 andi $0,$0,54747 addiu $0,$1,-12419 srav $4,$4,$3 lh $3,10($0) addu $1,$4,$3 lw $4,12($0) sw $4,0($0) sllv $3,$3,$3 addiu $4,$0,-30864 sra $2,$2,16 sltu $5,$4,$3 sllv $4,$4,$3 sh $4,8($0) sb $0,9($0) addu $5,$4,$3 andi $5,$5,49151 lb $5,2($0) lhu $4,2($0) slti $3,$5,-9208 addu $0,$1,$3 sh $1,16($0) sll $6,$0,18 xor $4,$5,$3 or $5,$1,$3 addiu $6,$5,-7924 addu $5,$5,$3 sllv $2,$2,$3 sra $3,$2,13 addiu $3,$3,24991 andi $4,$2,1640 addiu $3,$4,-30104 lw $1,8($0) subu $5,$2,$3 sra $4,$4,26 sltu $3,$5,$3 ori $4,$4,20367 srlv $3,$3,$3 slti $4,$5,19305 addu $3,$3,$3 sra $3,$3,24 addu $0,$0,$3 addu $3,$2,$3 subu $5,$5,$3 ori $5,$3,27987 sw $3,4($0) xori $3,$5,7926 ori $1,$3,49174 andi $1,$6,14488 xor $3,$0,$3 or $6,$0,$3 or $3,$3,$3 sh $3,14($0) addiu $1,$1,22905 lb $3,4($0) lhu $3,6($0) addu $5,$6,$3 lb $4,16($0) sb $3,13($0) nor $3,$3,$3 slt $5,$4,$3 sllv $3,$3,$3 subu $4,$3,$3 sltu $4,$3,$3 sll $1,$1,7 sra $1,$3,26 lbu $3,3($0) addiu $4,$5,18714 sh $3,8($0) sltu $3,$4,$3 andi $0,$0,8966 sra $4,$1,25 sb $4,6($0) slt $5,$6,$3 and $3,$4,$3 lbu $3,0($0) xori $0,$5,61373 lhu $1,8($0) sltu $4,$1,$3 sltu $1,$6,$3 xor $3,$1,$3 sll $1,$1,15 sw $3,0($0) or $1,$1,$3 andi $3,$5,37313 subu $1,$4,$3 sll $5,$5,29 addu $4,$3,$3 andi $1,$5,55457 sw $5,12($0) sb $3,5($0) slt $6,$3,$3 slt $0,$5,$3 nor $1,$4,$3 srlv $5,$3,$3 sltu $1,$3,$3 subu $3,$0,$3 srav $1,$4,$3 xori $5,$3,1636 subu $1,$6,$3 srl $5,$4,22 lw $4,4($0) subu $0,$3,$3 xor $1,$3,$3 addu $1,$1,$3 slti $0,$3,-10517 xori $3,$3,27304 sll $4,$4,30 slti $5,$4,-15415 lhu $3,12($0) subu $5,$5,$3 xor $3,$5,$3 addu $3,$6,$3 xor $3,$3,$3 xor $3,$4,$3 sltiu $4,$4,11297 srav $6,$4,$3 sllv $0,$3,$3 ori $4,$4,4462 slti $1,$3,-12650 xori $3,$6,17470 slt $1,$4,$3 sra $1,$1,16 lbu $3,10($0) sltu $1,$1,$3 sll $6,$6,8 sll $5,$0,29 addu $2,$2,$3 lw $4,8($0) sra $5,$5,26 addu $3,$3,$3 sltiu $2,$2,19721 sw $6,12($0) lh $5,0($0) lb $5,15($0) xori $3,$3,11036 subu $5,$5,$3 or $1,$5,$3 srlv $0,$0,$3 addu $4,$3,$3 sltu $5,$5,$3 or $6,$3,$3 srav $0,$3,$3 lh $4,8($0) lbu $0,10($0) ori $0,$0,46036 srl $3,$5,9 addu $6,$6,$3 slti $4,$5,12025 ori $3,$3,38121 slti $5,$6,-16493 sllv $5,$3,$3 sllv $3,$0,$3 andi $3,$0,33774 lhu $5,12($0) sll $4,$4,7 slt $3,$1,$3 sltu $5,$1,$3 sltu $1,$1,$3 sb $3,2($0) srlv $0,$5,$3 addu $3,$1,$3 xori $0,$0,58250 sll $6,$4,2 lw $0,16($0)
14.2036
18
0.528154
4101695655ea6693b98892c364de4be83081b33d
916
asm
Assembly
programs/oeis/333/A333167.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/333/A333167.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/333/A333167.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A333167: a(n) = r_2(n^2 + 1), where r_2(k) is the number of ways of writing k as a sum of 2 squares (A004018). ; 4,4,8,8,8,8,8,12,16,8,8,8,16,16,8,8,8,16,24,8,8,16,16,16,8,8,8,16,16,8,16,16,24,16,16,8,8,16,24,8,8,12,16,24,16,8,16,32,16,8,16,8,16,16,8,16,8,32,16,8,16,8,16,16,16,8,8,16,32,8,24,8,32,32,8,16,16,16,16,8,16,16,24,32,8,8,16,16,16,16,8,16,16,24,8,8,16,16,32,24,16,8,16,16,16,16,16,24,16,16,8,16,32,16,16,16,8,24,24,16,8,8,32,32,8,16,8,16,32,16,8,8,48,32,8,16,16,16,32,8,16,8,32,24,16,8,8,16,32,16,8,16,16,16,16,16,8,48,16,8,8,16,32,16,16,8,16,16,24,8,8,8,32,32,32,8,8,32,16,16,8,8,40,32,8,16,16,32,16,16,16,32,32,32,16,8,16,16,16,8,32,8,16,32,8,8,8,24,32,8,8,16,32,32,16,16,32,32,24,8,16,8,16,16,8,16,16,16,32,16,8,8,24,32,16,16,8,32,16,20,8,16,64,24,16,8,16,16,16,16 pow $0,2 cal $0,338117 ; Number of partitions of n into two parts (s,t) such that (t-s) | n, where s < t. mov $1,$0 mul $1,4 add $1,4
101.777778
667
0.625546
f9dd760ff71db564b4f1be1c86a8c55b6d8e9225
186
asm
Assembly
divide.asm
creativcoder/asm8085
94eee431aec7e49df6ea8df01cc4c5a370e86df7
[ "MIT" ]
null
null
null
divide.asm
creativcoder/asm8085
94eee431aec7e49df6ea8df01cc4c5a370e86df7
[ "MIT" ]
null
null
null
divide.asm
creativcoder/asm8085
94eee431aec7e49df6ea8df01cc4c5a370e86df7
[ "MIT" ]
null
null
null
; Performs division of numbers using repeated subtraction jmp start start: lxi h,0000h mov a,m inx h mov d,m mvi b,00h loop: sub d inr b cmp d jnc loop inx h mov m,a inx h mov m,b hlt
10.333333
58
0.731183
c973f88a3953f90d2dc84c623cc196d308ad864e
432
asm
Assembly
programs/oeis/184/A184549.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/184/A184549.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/184/A184549.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A184549: Super-birthdays (falling on the same weekday), version 1 (birth within the year following a February 29). ; 0,6,17,23,28,34,45,51,56,62,73,79,84,90,101,107,112,118,129,135,140,146,157,163,168,174,185,191,196,202,213,219,224,230,241,247,252,258,269,275,280,286,297,303,308,314 add $0,15 seq $0,184551 ; Super-birthdays (falling on the same weekday), version 3 (birth within 2 and 3 years after a February 29). sub $0,106
61.714286
169
0.733796
1e81bebfd55a009a5692e130ed582af61c38eabe
3,110
asm
Assembly
Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0x48_notsx.log_9_358.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0x48_notsx.log_9_358.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_zr_un_/i7-7700_9_0x48_notsx.log_9_358.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0x9b6d, %r10 nop nop nop and %rbp, %rbp movb $0x61, (%r10) nop nop nop nop nop xor %rsi, %rsi lea addresses_D_ht+0x12dbd, %r8 nop nop nop nop nop xor $5980, %r10 movb (%r8), %r9b nop nop xor $36630, %r8 lea addresses_A_ht+0x1291d, %r8 nop nop nop nop nop cmp $21495, %r11 mov $0x6162636465666768, %rsi movq %rsi, %xmm5 and $0xffffffffffffffc0, %r8 vmovntdq %ymm5, (%r8) nop inc %rbp lea addresses_A_ht+0xcabd, %rsi lea addresses_normal_ht+0xe3fd, %rdi nop nop nop xor $35531, %r11 mov $18, %rcx rep movsw nop nop nop nop sub %rcx, %rcx lea addresses_WC_ht+0x209d, %rsi lea addresses_D_ht+0x143d, %rdi nop nop nop cmp $10882, %r10 mov $116, %rcx rep movsw nop nop nop sub $41356, %r11 lea addresses_A_ht+0x11cbd, %rsi lea addresses_normal_ht+0x13be7, %rdi nop sub $13199, %r9 mov $66, %rcx rep movsl nop xor $4665, %rcx lea addresses_WT_ht+0x1eed, %rsi lea addresses_UC_ht+0x16b54, %rdi nop nop nop nop sub %rbp, %rbp mov $43, %rcx rep movsq nop nop nop xor $27580, %r8 lea addresses_A_ht+0x1d07d, %rbp nop nop and %r10, %r10 vmovups (%rbp), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $0, %xmm4, %r11 xor $53281, %r10 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %rbx push %rcx push %rdx push %rsi // Faulty Load lea addresses_US+0xc7bd, %rbx nop nop nop nop nop and %rcx, %rcx mov (%rbx), %edx lea oracles, %r12 and $0xff, %rdx shlq $12, %rdx mov (%r12,%rdx,1), %rdx pop %rsi pop %rdx pop %rcx pop %rbx pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_US', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_US', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 4}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 9}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 5}} {'d0': 6, '00': 3} d0 d0 00 d0 00 d0 00 d0 d0 */
19.808917
151
0.656592
468e34d050a676043a353239e8517fadbf86aebf
322
asm
Assembly
programs/oeis/102/A102348.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/102/A102348.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/102/A102348.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A102348: Decimated primes: every 10th prime has been omitted. ; 2,3,5,7,11,13,17,19,23,31,37,41,43,47,53,59,61,67,73,79,83,89,97,101,103,107,109,127,131,137,139,149,151,157,163,167,179,181,191,193,197,199,211,223,227,233,239,241,251,257,263,269,271,277,283,293,307,311 mul $0,10 div $0,9 seq $0,40 ; The prime numbers.
46
206
0.71118
5eb94ae55558a88db716f1f5105cfbd664e9902c
30,725
asm
Assembly
picbot.asm
Mikibits/PIC-bot
e8e99c9c0022749b65135a1be4d7681d42cd3400
[ "CC0-1.0" ]
null
null
null
picbot.asm
Mikibits/PIC-bot
e8e99c9c0022749b65135a1be4d7681d42cd3400
[ "CC0-1.0" ]
null
null
null
picbot.asm
Mikibits/PIC-bot
e8e99c9c0022749b65135a1be4d7681d42cd3400
[ "CC0-1.0" ]
null
null
null
;========================================================== ; Picbot.asm ;---------------------------------------------------------- ; First Bot prototype project, an autonomous mobile robot ; platform employing various features of the Motorola ; PIC 16F877 microcontroller. ; Author: Miki Marshall ; Updated: 2018.05.29 ;---------------------------------------------------------- ; Current capabilities: (See documentation) ;========================================================== ;---------------------------------------------------------- ;Compile options title "PicBot 1" list p=16f877 ;Include files include "p16f877.inc" include "macros.inc" include "register.inc" ;Turn off annoying messages ERRORLEVEL -306, -302, -202 ;---------------------------------------------------------- ;Configuration Bits __CONFIG _CP_OFF&_WDT_OFF&_BODEN_OFF&_PWRTE_ON&_HS_OSC&_WRT_ENABLE_ON&_LVP_ON&_DEBUG_OFF&_CPD_OFF ;========================================================== ;========================================================== ;PAGE 0 -- The Main Program Page (Reset/power-up vector) ;---------------------------------------------------------- ;Reset vector ............................................. ORG h'0000' ;.........................................................; Reset clrf STATUS ;Bank0 clrf PCLATH ;Page0 goto MainInit ;Main program ;Interrupt vector ......................................... ORG h'0004' ;.......................................................... Interrupt movwf SAVINTW ;Save W register swapf STATUS,W ;Save STATUS register clrf STATUS ;(Bank 0) movwf SAVINTSTAT movfw PCLATH ;Save PCLATH register movwf SAVINTPCL movfw FSR ;Save FSR register movwf SAVINTFSR movfw SELECT ;Save lookup selection movwf SAVSELECT bcf PCLATH,3 ;Page 2 (Interrupts) bsf PCLATH,4 goto IntHandler ;Handle interrupt Resume movfw SAVSELECT ;Restore lookup selection movwf SELECT movfw SAVINTFSR ;Restore FSR register movwf FSR movfw SAVINTPCL ;Restore PCLATH register movwf PCLATH swapf SAVINTSTAT,W ;Restore STATUS/Bank reg. movwf STATUS swapf SAVINTW,F ;Get saved W register swapf SAVINTW,W ;Swap to self (sets status) retfie ;Return from interrupt ;---------------------------------------------------------- ;Main Program MainInit SCall Initialize ;Setup PIC movlw 'P' ;Send "PIC Reset" status SCall TxPut movlw 'R' SCall TxPut SCall TxCRLF MainLoop btfsc RUNSTAT,RXCMD ;Command ready? call CommandHandler btfsc RUNSTAT,ERR ;Error logged? call ErrorHandler btfsc RUNSTAT,BRK ;User break? call BreakHandler goto MainLoop ;Loop ;---------------------------------------------------------- ;Break handler BreakHandler movlw 'B' ;Send <break> to SCI SCall TxPut movlw 'K' SCall TxPut SCall TxCRLF ;;Place triggered test code here;; ; movlw 'M' ; SCall RxPut ; movlw '0' ; SCall RxPut ; movlw 'F' ; SCall RxPut ; movlw '3' ; SCall RxPut ; movlw CR ; SCall RxPut ; movlw 'M' ; SCall RxPut ; movlw '1' ; SCall RxPut ; movlw 'R' ; SCall RxPut ; movlw '1' ; SCall RxPut ; movlw CR ; SCall RxPut bcf RUNSTAT,BRK ;Clear break return ;Return to idle loop ;---------------------------------------------------------- ;Command Handler CommandHandler SCall RxGet ;Get first cmd char movfw RXCHAR xorlw CR ;Equal <CR>? btfsc STATUS,Z goto CmdValid ;Yes, "ACK" connection movlw h'20' ;>= 20? subwf RXCHAR,W btfss STATUS,C goto CmdDone ;No, skip it movfw RXCHAR xorlw 'A' ;A/D command? btfsc STATUS,Z goto CmdAD ;Yes xorlw 'A' xorlw 'D' ;SPI (data IO) command? btfsc STATUS,Z goto CmdSPI ;Yes xorlw 'D' xorlw 'E' ;Error command? btfsc STATUS,Z goto CmdError ;Yes xorlw 'E' xorlw 'I' ;Input port command? btfsc STATUS,Z goto CmdInPort ;Yes xorlw 'I' ; xorlw 'M' ;Motor command? ; btfsc STATUS,Z ; goto CmdMotor ;Yes ; xorlw 'M' xorlw 'O' ;Output port command? btfsc STATUS,Z goto CmdOutPort ;Yes xorlw 'O' xorlw 'P' ;PIC system command? btfsc STATUS,Z goto CmdPic ;Yes xorlw 'P' xorlw 'S' ;Servo command? btfsc STATUS,Z goto CmdServo ;Yes xorlw 'S' goto CmdInvalid ;Bad command ;A/D port command ----------------------------------------- CmdAD SCall RxGet ;Get port# movlw '0' ;Valid (>=0)? subwf RXCHAR,W btfss STATUS,C goto CmdADBad ;No, error movlw '5' ;Valid (<5)? subwf RXCHAR,W btfsc STATUS,C goto CmdADBad ;No, error movfw RXCHAR ;Convert to A/D address SCall AsciiToHex movwf ADCH SCall SendAD ;Send pin value goto CmdValid CmdADBad movlw ERR_BADPORT ;Bad port# movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error goto CmdClear ;Abort ;Input port command --------------------------------------- CmdInPort movlw 'I' ;Send port value (as hex) SCall TxPut movfw PORTB SCall TxPutHex SCall TxCRLF goto CmdValid ;Motor command ---------------------------------- ;CmdMotor ; SCall RxGet ;Get next char ; movfw RXCHAR ; ; xorlw '0' ;Motor 0? ; btfsc STATUS,Z ; goto CmdMotor0 ;Yes ; xorlw '0' ; ; xorlw '1' ;Motor 1? ; btfsc STATUS,Z ; goto CmdMotor1 ;Yes ; goto CmdMotorBadNo ;Bad motor# ; ;CmdMotor0 ; SCall RxGet ;Get next char ; movfw RXCHAR ; ; xorlw 'F' ;Forward? ; btfsc STATUS,Z ; goto CmdMotor0Fwd ;Yes ; xorlw 'F' ; ; xorlw 'H' ;Hold position? ; btfsc STATUS,Z ; goto CmdMotor0Hold ;Yes ; xorlw 'H' ; ; xorlw 'R' ;Reverse? ; btfsc STATUS,Z ; goto CmdMotor0Rev ;Yes ; xorlw 'R' ; ; xorlw 'S' ;Stop? ; btfsc STATUS,Z ; goto CmdMotor0Stop ;Yes ; goto CmdMotorBadDir ;Bad direction ; ;CmdMotor0Fwd ; bsf RUNSTAT,M0FWD ;Set Motor0=Fwd ; bsf RUNSTAT,M0RUN ; goto CmdMotor0Speed ; ;CmdMotor0Rev ; bcf RUNSTAT,M0FWD ;Set Motor0=Rev ; bsf RUNSTAT,M0RUN ; goto CmdMotor0Speed ; ;CmdMotor0Hold ; bcf RUNSTAT,M0RUN ;Set Motor0=Stop ; goto CmdValid ; ;CmdMotor0Stop ; bcf RUNSTAT,M0RUN ;Set Motor0=Stop ; movlw h'5' ;Set phase to "rest" ; movwf M0PHASE ; goto CmdValid ; ;CmdMotor0Speed ; SCall RxGet ;Get next char ; movfw RXCHAR ; ; SCall AsciiToHex ;Convert to hex value ; movwf M0SPEED ;Store as speed ; ; movlw '8' ;Valid (<8)? ; subwf RXCHAR,W ; btfsc STATUS,C ; goto CmdMotorBadSpd ;No, error ; ; SCall Motor0Step ;Activate motor0 ; goto CmdValid ;Done ; ;CmdMotor1 ; SCall RxGet ;Get next char ; movfw RXCHAR ; ; xorlw 'F' ;Forward? ; btfsc STATUS,Z ; goto CmdMotor1Fwd ;Yes ; xorlw 'F' ; ; xorlw 'H' ;Hold position? ; btfsc STATUS,Z ; goto CmdMotor1Hold ;Yes ; xorlw 'H' ; ; xorlw 'R' ;Reverse? ; btfsc STATUS,Z ; goto CmdMotor1Rev ;Yes ; xorlw 'R' ; ; xorlw 'S' ;Stop? ; btfsc STATUS,Z ; goto CmdMotor1Stop ;Yes ; goto CmdMotorBadDir ;Bad direction ; ;CmdMotor1Fwd ; bsf RUNSTAT,M1FWD ;Set Motor1=Fwd ; bsf RUNSTAT,M1RUN ; goto CmdMotor1Speed ; ;CmdMotor1Rev ; bcf RUNSTAT,M1FWD ;Set Motor1=Rev ; bsf RUNSTAT,M1RUN ; goto CmdMotor1Speed ; ;CmdMotor1Hold ; bcf RUNSTAT,M1RUN ;Set Motor1=Stop ; goto CmdValid ; ;CmdMotor1Stop ; bcf RUNSTAT,M1RUN ;Set Motor1=Stop ; movlw h'5' ;Set phase to "rest" ; movwf M1PHASE ; goto CmdValid ; ;CmdMotor1Speed ; SCall RxGet ;Get next char ; movfw RXCHAR ; SCall AsciiToHex ;Convert to hex value ; movwf M1SPEED ;Store as speed ; ; movlw '8' ;Valid (<8)? ; subwf RXCHAR,W ; btfsc STATUS,C ; goto CmdMotorBadSpd ;No, error ; ; SCall Motor1Step ;Activate motor1 ; goto CmdValid ;Done ; ;CmdMotorBadNo ; movlw ERR_BADMOTNO ;Bad motor# ; movwf ERRSTAT ;Log to error status ; bsf RUNSTAT,ERR ;Flag an error ; goto CmdClear ;Abort ; ;CmdMotorBadDir ; movlw ERR_BADMOTDIR ;Bad direction ; movwf ERRSTAT ;Log to error status ; bsf RUNSTAT,ERR ;Flag an error ; goto CmdClear ;Abort ; ;CmdMotorBadSpd ; movlw ERR_BADMOTSPD ;Bad speed ; movwf ERRSTAT ;Log to error status ; bsf RUNSTAT,ERR ;Flag an error ; goto CmdClear ;Abort ;Output port command -------------------------------------- ;NOTE: If the above motor stuff works, this may be ; superceded by it. Output ports may have to be ; moved to remaining C and E ports... CmdOutPort SCall RxGetHex ;Get hex value movfw RXCHAR ;Copy to Output port (D) movwf PORTD goto CmdValid ;System command ------------------------------------------- CmdPic SCall RxGet ;Get next char movfw RXCHAR xorlw 'B' ;Bootload command? btfsc STATUS,Z goto CmdPicBootload ;Yes xorlw 'B' xorlw 'R' ;Reset command? btfsc STATUS,Z goto CmdPicReset ;Yes xorlw 'R' xorlw 'Z' ;Sleep command? btfsc STATUS,Z goto CmdPicSleep ;Yes goto CmdInvalid ;Invalid command CmdPicBootload bsf PCLATH,3 ;Bootloader Page (4) bsf PCLATH,4 goto h'1FFF' ;Goto bootloader entry point ;Bootloader should announce itself as "PB" CmdPicReset goto Reset ;Reset PIC ;Should announce Reset with "PR" CmdPicSleep sleep ;Put PIC to sleep goto CmdValid ;Response to waking back up? ;Servo port command ----------------------------------------- CmdServo SCall RxGet ;Get port# movlw '0' ;Valid (>=0)? subwf RXCHAR,W btfss STATUS,C goto CmdServoBad ;No, error movlw '5' ;Valid (<5)? subwf RXCHAR,W btfsc STATUS,C goto CmdServoBad ;No, error movfw RXCHAR ;Convert to Servo address SCall AsciiToHex addlw SERVODELAY0 movwf SERVOTEMP ;Save it SCall RxGetHex ;Get position setting movfw RXCHAR ;Zero? btfsc STATUS,Z goto CmdServoOff ;Yes, shutoff servo sublw d'42' ;Valid range (0 - 2A)? btfss STATUS,C goto CmdServoPosBad ;No, error movlw d'4' ;Tweak pulse range for addwf RXCHAR,F ;servo timing CmdServoOff movfw SERVOTEMP ;At saved servo port movwf FSR movfw RXCHAR ;Store position delay movwf INDF goto CmdValid ;Done CmdServoBad movlw ERR_BADPORT ;Bad port# movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error goto CmdClear ;Abort CmdServoPosBad movlw ERR_BADSRVPOS ;Bad port# movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error goto CmdClear ;Abort ;SPI command ---------------------------------------------- CmdSPI ;;; To Do ... goto CmdInvalid ;Error command -------------------------------------------- CmdError SCall RxGet ;Get error no (0-Z) movfw RXCHAR ;Move to error reg movwf ERRSTAT bsf RUNSTAT,RXERR ;Set error recvd status goto CmdValid ;Done ;Command cleanup ................................ CmdInvalid movlw ERR_BADCMD ;Invalid command movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error goto CmdClear ;Abort CmdValid movlw 'O' ;Reply "OK" SCall TxPut movlw 'K' SCall TxPut SCall TxCRLF CmdClear btfsc SCISTAT,RXEMPTY ;Chars left? goto CmdDone ;No, done movfw RXCHAR ;Yes, <CR>? xorlw CR btfsc STATUS,Z goto CmdDone ;Yes, all done SCall RxGet ;No, get next char goto CmdClear ;Loop CmdDone return ;Return to idle loop ;---------------------------------------------------------- ;Error Handler ErrorHandler movlw 'E' ;Send error SCall TxPut movfw ERRSTAT SCall TxPut SCall TxCRLF bcf RUNSTAT,ERR ;Clear error clrf ERRSTAT return ;Return to idle loop ;---------------------------------------------------------- ;End of Page0 ;========================================================== ;========================================================== ;PAGE 1 -- The Subroutines Page ;---------------------------------------------------------- ORG h'0800' ;.......................................................... ;---------------------------------------------------------- ;Convert ASCII byte (W) to low-nibble hex value (W) AsciiToHex addlw h'BF' ;Add -'A' btfss STATUS,C ;Positive? addlw h'07' ;No, add 17 (0-9) addlw h'0A' ;Yes, add 10 (A-F) return ;---------------------------------------------------------- ;Retrieve the current servo delay GetServoDelay addwf PCL,F ;Select Servo delay goto GetServo0 ;Servo 0 goto GetServo1 ;Servo 1 goto GetServo2 ;Servo 2 goto GetServo3 ;Servo 3 goto GetServo4 ;Servo 4 GetServo0 movfw SERVODELAY0 ;Servo 0 return GetServo1 movfw SERVODELAY1 ;Servo 1 return GetServo2 movfw SERVODELAY2 ;Servo 2 return GetServo3 movfw SERVODELAY3 ;Servo 3 return GetServo4 movfw SERVODELAY4 ;Servo 4 return ;---------------------------------------------------------- ;Convert nibble hex value (W) to ASCII byte (W) HexToAsciiH movwf SELECT ;High-nibble swapf SELECT,W ;Move to low-nibble HexToAscii movwf SELECT ;Save table seletion movlw HIGH HexToAscii ;Set PCH movwf PCLATH movfw SELECT ;Restore table selection andlw h'0F' ;Use low-nibble only addwf PCL,F ;Return correct value retlw '0' retlw '1' retlw '2' retlw '3' retlw '4' retlw '5' retlw '6' retlw '7' retlw '8' retlw '9' retlw 'A' retlw 'B' retlw 'C' retlw 'D' retlw 'E' retlw 'F' ;---------------------------------------------------------- ;Initialize PIC Initialize Bank0 ;Default bank bcf INTCON,GIE ;Disable interrupts btfsc INTCON,GIE ;Did it take? goto $-2 ;No, try again InitPorts ;Setup I/O ports clrf PORTA ;Clear output latches clrf PORTB clrf PORTC clrf PORTD clrf PORTE clrf ADCON0 ;A/D = standby Bank1 movlw b'00111111' ;A = All A/D (exc A4), movwf TRISA movlw b'00000010' ;left-justified movwf ADCON1 movlw b'11111111' ;B = Digital inputs movwf TRISB movlw b'11000000' ;C = Digital outputs movwf TRISC ;(except SCI/SPI) movlw b'00000000' ;D = Digital outputs movwf TRISD movlw b'00000000' ;E = Digital outputs movwf TRISE Bank0 clrf CCP1CON ;CCP1 mode=off clrf CCP2CON ;CCP2 mode=off InitRegisters ;Clear status registers: clrf RUNSTAT ;Runtime clrf ERRSTAT ;Error clrf SCISTAT ;Serial communication clrf RUNSTAT ;Motor clrf SERVODELAY0 ;Servos pulse delays (0-5) clrf SERVODELAY1 clrf SERVODELAY2 clrf SERVODELAY3 clrf SERVODELAY4 clrf RXCMDCNT ;Clear command counter ;Clear timers: clrf TMRHMSEC ;Hundredths of mSecs (10 uSecs) clrf TMRMSEC ;Milliseconds (100 TMRHMSEC's) clrf TMRTSEC ;Tenth seconds (100 TMRMSEC's) clrf TMRAD ;A/D conversion timer clrf TMRMOT0 ;Motor 0 step delay clrf TMRMOT1 ;Motor 1 step delay clrf SERVOTIMER ;Servo pulse timer (1-2ms) movlw d'80' ;Next servo pulse timer movwf SERVOTMRNEXT ;(80 * .05ms = 4ms) clrf SERVOSELECT ;Select current servo (0-4) ;(4ms * 5 servos = 20ms) InitTimers ;Setup Tmr2=default/internal ;Timer0 (and misc B-port stuff) Bank1 movlw b'11000000' ;B-Pullups=off, B0-edge=hi; movwf OPTION_REG ;Tmr0=int. osc., ;Prescaler=Tmr0 @ 1:2 ;Timer1 (Not in use) Bank0 clrf T1CON ;Prescale=1:1, osc=off, ;sync=off, Tmr1=int. osc., ;Tmr1=standby ;Timer2 (Default timer) clrf T2CON ;Pre/postscale=1:1, Standby Bank1 movlw d'250' ;TMR2 O/F's every .05 mSeconds movwf PR2 Bank0 bcf PIR1,TMR2IF ;Clear interrupt flag bsf T2CON,TMR2ON ;Turn on Timer 2 movlw d'20' ;Set timers movwf TMRHMSEC ; (20 HMSecs = 1 millisec) movlw d'100' movwf TMRMSEC ; (100 mSecs = 1 tenthSec) InitSCI ;Setup SCI port Bank1 movlw d'129' ;BRGH=0, 2400 baud movwf SPBRG ;BRGH=1, 9600 baud movlw b'00100110' ;TX: On, Asynch, 8-bit movwf TXSTA ;BRGH=1 (9600 baud) Bank0 movlw b'10010000' ;RC: On, Contin., 8-bit movwf RCSTA clrf CNTR ;Use a counter... incfsz CNTR,F ;To pause for the... goto $-1 ;Port to settle down movfw RCREG ;Clear out any garbage movfw RCREG movfw RCREG bsf SCISTAT,RXEMPTY ;Set buffers=empty Bank1 movlw RXFIFO ;Set Put=top movwf RXPUTPTR movlw RXFIFO ;Set Get=top movwf RXGETPTR InitSPI ;Setup SPI port ;(stay in Bank2) clrf SSPSTAT ;Clear status clrf SSPCON2 ;No I2C stuff Bank0 movlw b'00100000' ;Enable SPI @ 5 MHz movwf SSPCON InitInterrupts ;Setup default interrupts clrf PIR1 ;Clear interrupt flags bsf PIR1,TXIF ;(except TXIF) clrf PIR2 Bank1 movlw b'00101010' ;RCIE,TMR2,SSPIE=ON movwf PIE1 clrf PIE2 Bank0 movlw b'11010000' ;GIE,PEIE,INTE=ON movwf INTCON InitDone return ;---------------------------------------------------------- ;Return motor speed delay (W) ;MotorDelay ; addwf PCL,F ;Select delay value ; retlw d'255' ;0=Slowest ; retlw d'127' ;1 ; retlw d'63' ;2 ; retlw d'31' ;3 ; retlw d'15' ;4 ; retlw d'7' ;5 ; retlw d'3' ;6 ; retlw d'1' ;7=Fastest ;---------------------------------------------------------- ;Return motor phase (W) ;MotorPhase ; addwf PCL,F ;Select phase value ; retlw b'00001100' ; retlw b'00000110' ; retlw b'00000011' ; retlw b'00001001' ; retlw b'00000000' ;Motor resting ;---------------------------------------------------------- ;Motor0 stepper ;Motor0Step ; movfw M0SPEED ;Convert speed to delay ; call MotorDelay ; movwf TMRMOT0 ;Set motor0 timer ; ; btfss RUNSTAT,M0FWD ;Run forward? ; goto Mot0Rev ;No, reverse ; ;Mot0Fwd ; incf M0PHASE,F ;Increment phase# ; ; movlw h'4' ;>= 4? ; subwf M0PHASE,W ; btfsc STATUS,C ; clrf M0PHASE ;Yes, reset to 0 ; goto Mot0Done ;Done ; ;Mot0Rev ; movfw M0PHASE ;Phase no = 0? ; btfss STATUS,Z ; goto Mot0RevA ;No ; ; movlw h'3' ;Yes, set to 3 ; movwf M0PHASE ; goto Mot0Done ;Done ; ;Mot0RevA ; decf M0PHASE,F ;Decrement phase no ; ;Mot0Done ; return ;Motor1 stepper ------------------------------------------- ;Motor1Step ; movfw M1SPEED ;Convert speed to delay ; call MotorDelay ; movwf TMRMOT1 ;Set motor1 timer ; ; btfss RUNSTAT,M1FWD ;Run forward? ; goto Mot1Rev ;No, reverse ; ;Mot1Fwd ; incf M1PHASE,F ;Increment phase# ; ; movlw h'4' ;>= 4? ; subwf M1PHASE,W ; btfsc STATUS,C ; clrf M1PHASE ;Yes, reset to 0 ; goto Mot1Done ;Done ; ;Mot1Rev ; movfw M1PHASE ;Phase no = 0? ; btfss STATUS,Z ; goto Mot1RevA ;No ; ; movlw h'3' ;Yes, set to 3 ; movwf M1PHASE ; goto Mot1Done ;Done ; ;Mot1RevA ; decf M1PHASE,F ;Decrement phase no ; ;Mot1Done ; return ; Motor step-setter (both motors) ------------------------- ;MotorSet ; clrf MTEMP ;Clear, in case... ; btfss RUNSTAT,M1RUN ;Motor1 running? ; goto MotorSetA ;No, leave zeros ; ; movfw M1PHASE ;Get motor1 phase ; call MotorPhase ; ; movwf MTEMP ;Set to upper nibble ; swapf MTEMP,F ; ;MotorSetA ; clrw ;Clear, in case... ; btfss RUNSTAT,M0RUN ;Motor0 running? ; goto MotorSetB ;No, leave zeros ; ; movfw M0PHASE ;Get motor0 phase ; call MotorPhase ; ;MotorSetB ; iorwf MTEMP,W ;Combine as lower nibble ; ; movwf PORTD ;Update motor port ; return ;---------------------------------------------------------- ;Set the current servo pin (from pin # in W) PulseServo addwf PCL,F ;Pulse selected servo pin goto PulseSrv0 ;Servo 0 goto PulseSrv1 ;Servo 1 goto PulseSrv2 ;Servo 2 goto PulseSrv3 ;Servo 3 goto PulseSrv4 ;Servo 4 PulseSrv0 bsf PORTE,0 ;Pin E0 on goto PulseSrvDone PulseSrv1 bsf PORTE,1 ;Pin E1 on goto PulseSrvDone PulseSrv2 bsf PORTE,2 ;Pin E2 on goto PulseSrvDone PulseSrv3 bsf PORTC,1 ;Pin C1 on goto PulseSrvDone PulseSrv4 bsf PORTC,2 ;Pin C2 on PulseSrvDone return ;---------------------------------------------------------- ;Get a character from SCI RX buffer (returns RXCHAR) RxGet bcf INTCON,GIE ;Disable interrupts btfsc INTCON,GIE ;Did it take? goto $-2 ;No, try again Bank1 ;(FIFO bank) clrf RXCHAR ;Clear result reg btfsc SCISTAT,RXEMPTY ;FIFO empty? goto RxGetError ;Yes, error movfw RXGETPTR ;Get char from FIFO movwf FSR movfw INDF movwf RXCHAR xorlw CR ;<CR>? btfsc STATUS,Z decf RXCMDCNT,F ;Yes, decr. command counter incf RXGETPTR,F ;Increment Get pointer movfw RXGETPTR ;Past end of buffer? sublw RXFIFOMAX btfsc STATUS,C goto RxGetDone ;No, done movlw RXFIFO ;Set get=top movwf RXGETPTR goto RxGetDone ;Done RxGetError movlw ERR_RXGETUF ;Log underflow error movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error RxGetDone call RxStatSet ;Update FIFO statuses bsf INTCON,GIE ;Enable interrupts Bank0 ;(Default bank) return ;---------------------------------------------------------- ;Get 2 ascii hex chars, return 1-byte hex value (RXCHAR) RxGetHex call RxGet ;Get next char movfw RXCHAR call AsciiToHex ;Convert to hex nibble movwf HEXBYTE ;Swap nibble to high position swapf HEXBYTE,F call RxGet ;Get next char movfw RXCHAR call AsciiToHex ;Convert to hex nibble iorwf HEXBYTE,F ;Combine nibbles movfw HEXBYTE movwf RXCHAR ;Return in RXCHAR return ;---------------------------------------------------------- ;Put a character into SCI RX buffer (from W) RxPut movwf RXTEMP ;Save char Bank1 ;(FIFO bank) btfsc SCISTAT,RXFULL ;Already full? goto RxPutError ;Yes, log an error movfw RXTEMP ;<CR>? xorlw h'0D' btfsc STATUS,Z incf RXCMDCNT,F ;Yes, incr. command counter movfw RXPUTPTR ;Address (ind.) Put pointer movwf FSR movfw RXTEMP ;Restore char movwf INDF ;Insert in FIFO incf RXPUTPTR,F ;Increment Put pointer movfw RXPUTPTR ;Past end of buffer? sublw RXFIFOMAX btfsc STATUS,C goto RxPutDone ;No, done movlw RXFIFO ;Yes, set put=top movwf RXPUTPTR goto RxPutDone ;Done RxPutError movlw ERR_RXPUTOF ;Overflow error movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error RxPutDone call RxStatSet ;Update FIFO statuses Bank0 ;(Default bank) return ;---------------------------------------------------------- ;Determine RXFIFO Full & Empty statuses RxStatSet Bank1 ;(RXFIFO bank) bcf SCISTAT,RXEMPTY ;Clear empty flag movfw RXGETPTR ;Get=Put positions? subwf RXPUTPTR,W btfsc STATUS,Z bsf SCISTAT,RXEMPTY ;Yes, set empty flag bcf SCISTAT,RXFULL ;Clear full flag movfw RXGETPTR ;Get at top of buffer? xorlw RXFIFO btfss STATUS,Z goto RxStatSet2 ;No, continue movfw RXPUTPTR ;Put at end of buffer? xorlw RXFIFOMAX btfsc STATUS,Z bsf SCISTAT,RXFULL ;Yes, set full flag RxStatSet2 decf RXGETPTR,W ;Look at get-1 xorwf RXPUTPTR,W ;Compare w/put btfsc STATUS,Z ;(Get-1)=put? bsf SCISTAT,RXFULL ;Yes, set full flag bcf RUNSTAT,RXCMD ;Clear RX cmd flag movfw RXCMDCNT ;RX commands=0? btfss STATUS,Z bsf RUNSTAT,RXCMD ;No, set RX cmd flag Bank0 ;(Default bank) return ;---------------------------------------------------------- ;Send A/D value for channel ADCH SendAD clrf ADCON0 ;Clear A/D contr bsf ADCON0,ADCS1 ;Clock=FOsc/32 btfsc ADCH,2 ;Set channel bsf ADCON0,CHS2 btfsc ADCH,1 bsf ADCON0,CHS1 btfsc ADCH,0 bsf ADCON0,CHS0 bsf ADCON0,ADON ;Turn on A/D module movlw h'02' ;Wait 2 msecs to acquire movwf TMRAD SendADWait movfw TMRAD ;Zero? btfss STATUS,Z goto SendADWait ;No, wait some more bsf ADCON0,GO_DONE ;Yes, start conversion SendADGo btfsc ADCON0,GO_DONE ;Done? goto SendADGo ;No, wait movfw ADRESH ;Send as ascii hex chars call TxPutHex call TxCRLF bcf ADCON0,ADON ;Turn off A/D module return ;---------------------------------------------------------- ;Send a line terminator TxCRLF movlw CR ;Send <CR><LF> call TxPut movlw LF call TxPut return ;---------------------------------------------------------- ;Send a character to the SCI TxPut bcf INTCON,GIE ;Disable interrupts btfsc INTCON,GIE ;Did it take? goto $-2 ;No, try again btfss PIR1,TXIF ;Buffer empty? goto $-1 ;No, try again movwf TXREG ;Transmit byte bsf INTCON,GIE ;Enable interrupts return ;---------------------------------------------------------- ;Send 1-byte hex value (W) as 2-byte ascii hex chars TxPutHex movwf HEXBYTE ;Save original value call HexToAsciiH ;Send high nibble call TxPut movfw HEXBYTE ;Retrieve original value call HexToAscii ;Send low nibble call TxPut return ;---------------------------------------------------------- ;Reset the current servo pin UnpulseServo addwf PCL,F ;Unpulse selected servo pin goto UnpulseSrv0 ;Servo 0 goto UnpulseSrv1 ;Servo 1 goto UnpulseSrv2 ;Servo 2 goto UnpulseSrv3 ;Servo 3 goto UnpulseSrv4 ;Servo 4 UnpulseSrv0 bcf PORTE,0 ;Pin E0-2 off goto UnpulseSrvDone UnpulseSrv1 bcf PORTE,1 ;Pin E1 off goto UnpulseSrvDone UnpulseSrv2 bcf PORTE,2 ;Pin E2 off goto UnpulseSrvDone UnpulseSrv3 bcf PORTC,1 ;Pin C1 off goto UnpulseSrvDone UnpulseSrv4 bcf PORTC,2 ;Pin C2 off UnpulseSrvDone return ;---------------------------------------------------------- ;End of Page1 ;========================================================== ;========================================================== ;PAGE 2 -- The Interrupt Handlers Page ;---------------------------------------------------------- ORG h'1000' ;.......................................................... IntHandler ;External (RB0) btfss INTCON,INTF ;Flagged? goto RCIF_Check ;No, next check bcf INTCON,INTF ;Clear flag goto INTF_Handler ;Call handler RCIF_Check ;SCI received byte btfss PIR1,RCIF ;Flagged? goto SSPIF_Check ;No, next check bcf PIR1,RCIF ;Clear flag goto RCIF_Handler ;Call handler SSPIF_Check ;SPI tx/rcv occurred btfss PIR1,SSPIF ;Flagged? goto TMR2IF_Check ;No, next check bcf PIR1,SSPIF ;Clear flag goto SSPIF_Handler ;Call handler TMR2IF_Check ;Timer2 register overflow btfss PIR1,TMR2IF ;Flagged? goto IntHandlerDone ;No, done bcf PIR1,TMR2IF ;Clear flag goto TMR2IF_Handler ;Call handler ;---------------------------------------------------------- ;External interrupt (RB0) INTF_Handler bsf RUNSTAT,BRK ;Set break flag goto IntHandlerDone ;Done ;---------------------------------------------------------- ;SCI received byte RCIF_Handler btfsc RCSTA,FERR ;Framing error? goto RCIF_Error ;Yes, log it btfsc RCSTA,OERR ;Overrun error? goto RCIF_Overrun ;Yes, log it movfw RCREG ;Get the char ISCall RxPut ;Put it in RX FIFO goto RCIF_Done ;Done RCIF_Overrun bcf RCSTA,CREN ;Reset SCI port bsf RCSTA,CREN movlw ERR_RCIFOR ;Log overflow error movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error goto RCIF_Done RCIF_Error movfw RCREG ;Discard byte movlw ERR_RCIFFE ;Log general error movwf ERRSTAT ;Log to error status bsf RUNSTAT,ERR ;Flag an error RCIF_Done goto IntHandlerDone ;Done ;---------------------------------------------------------- ;SPI transmit/receive occurred SSPIF_Handler ;TO DO ... goto IntHandlerDone ;Done ;---------------------------------------------------------- ;Timer2 O/F Handler ; Timer2 overflow, occurs every 50 uSecs (.05 mS) TMR2IF_Handler ;Countdown to end current servo pulse movfw SERVOTIMER ;Get pulse timer btfsc STATUS,Z ;Already zero? goto TMR2IF_NextPulse ;Yes, skip decfsz SERVOTIMER,F ;Decrement timer. Zero? goto TMR2IF_NextPulse ;No, skip movfw SERVOSELECT ;End current servo pulse ISCall UnpulseServo ;Countdown to next servo pulse TMR2IF_NextPulse decfsz SERVOTMRNEXT,F ;Decrement timer. Zero? goto TMR2IF_MSec ;No, skip ;2.5ms passed, pulse next servo (if active) movlw d'75' ;Reset Next timer movwf SERVOTMRNEXT ;(75 * .05ms = 3.75ms) ;(5 servos * 3.75ms = 18.75ms) incf SERVOSELECT,F ;Select next servo movfw SERVOSELECT sublw d'4' ;In range (0-4)? btfss STATUS,C clrf SERVOSELECT ;No, restart servo cycle movfw SERVOSELECT ;Retrieve current servo delay ISCall GetServoDelay btfsc STATUS,Z ;Zero? goto TMR2IF_MSec ;Yes, inactive servo, skip movwf SERVOTIMER ;Set servo pulse timer movfw SERVOSELECT ;Pulse current servo ISCall PulseServo ;Check for Millisecond passed TMR2IF_MSec decfsz TMRHMSEC,F ;Decrement HMStimer; zero? goto IntHandlerDone ;No, done movlw d'20' ;Yes, reset HMStimer movwf TMRHMSEC ;(1 millisecond passed) ;Update A/D, Servo Pulse, and Motor timers TMR2IF_AD movfw TMRAD ;A/D convsn. timer zero? btfss STATUS,Z decf TMRAD,F ;No, decrement it ;TMR2IF_Motor0 ; btfss RUNSTAT,M0RUN ;Motor0 running? ; goto TMR2IF_Motor1 ;No ; ; decfsz TMRMOT0,F ;Yes, decrement timer. Zero? ; goto TMR2IF_Motor1 ;No, skip ; ISCall Motor0Step ;Yes, step motor0 ; ;TMR2IF_Motor1 ; btfss RUNSTAT,M1RUN ;Motor1 running? ; goto TMR2IF_MotorSet ;No ; ; decfsz TMRMOT1,F ;Yes, decrement timer. Zero? ; goto TMR2IF_MotorSet ;No ; ISCall Motor1Step ;Yes, step motor1 ; ;Refresh motor port (whether it needs it or not) ;TMR2IF_MotorSet ; btfsc RUNSTAT,M0RUN ;Motor 0 on? ; goto TMR2IF_MotorRef ;Yes, refresh port ; btfsc RUNSTAT,M1RUN ;No, Motor 1 on? ; goto TMR2IF_MotorRef ;Yes, refresh port ; goto TMR2IF_TSec ;No, skip refresh ; ;TMR2IF_MotorRef ; ISCall MotorSet ;Refresh motor port ;Check for Tenth second passed TMR2IF_TSec decfsz TMRMSEC,F ;Decrement MSTimer; zero? goto IntHandlerDone ;No, done movlw d'100' ;Yes, reset MSTimer movwf TMRMSEC ;(1/10th second passed) ;---------------------------------------------------------- ;Interrupt handled, resume normal operation IntHandlerDone bcf PCLATH,3 ;Page 0 (Main) bcf PCLATH,4 goto Resume ;Resume from interrupt ;---------------------------------------------------------- ;End of Page2 ;========================================================== ;========================================================== ;PAGE 3 -- Available (up to 1E00, which is the bootloader) ;---------------------------------------------------------- ; ORG h'1800' ;.......................................................... ;---------------------------------------------------------- ;End of Page3 ;========================================================== ;========================================================== END ;End of program ;==========================================================
22.877885
99
0.593621
bd59daeb73ddd9cdc4c7773a2a4909536531039a
8,425
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1669.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1669.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1669.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x162de, %r15 nop nop nop nop cmp $1409, %r10 movb $0x61, (%r15) nop nop nop and $31688, %r14 lea addresses_WC_ht+0xebde, %rdi nop nop add %rbx, %rbx movups (%rdi), %xmm1 vpextrq $0, %xmm1, %r12 nop and %rsi, %rsi lea addresses_A_ht+0x3d2e, %rbx nop nop nop cmp %r14, %r14 mov $0x6162636465666768, %rdi movq %rdi, (%rbx) nop nop nop cmp %rbx, %rbx lea addresses_D_ht+0x147de, %rsi lea addresses_D_ht+0x16e9e, %rdi cmp %rbx, %rbx mov $126, %rcx rep movsb nop and $53736, %rsi lea addresses_WC_ht+0xd62e, %r12 and %r10, %r10 mov (%r12), %rbx nop nop nop cmp $64260, %r14 lea addresses_D_ht+0x1b988, %r15 nop xor %r10, %r10 movups (%r15), %xmm2 vpextrq $1, %xmm2, %rcx nop nop nop nop add %rdi, %rdi lea addresses_D_ht+0xf456, %rsi lea addresses_D_ht+0x136fe, %rdi nop nop cmp %rbx, %rbx mov $96, %rcx rep movsl cmp $3667, %rdi lea addresses_UC_ht+0x17fde, %rsi lea addresses_WT_ht+0x4c5e, %rdi nop nop nop nop nop cmp $54993, %rbx mov $56, %rcx rep movsl nop nop nop and %rsi, %rsi lea addresses_D_ht+0x13cd6, %rcx nop nop nop xor %rbx, %rbx movw $0x6162, (%rcx) and $22259, %r14 lea addresses_normal_ht+0x1049e, %r12 nop nop nop nop inc %r15 mov $0x6162636465666768, %r14 movq %r14, %xmm2 movups %xmm2, (%r12) nop nop nop nop and %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %r9 push %rax push %rbp push %rdi // Load lea addresses_WT+0x1c876, %r14 nop nop nop nop and $54158, %rbp vmovups (%r14), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rax nop nop sub %r9, %r9 // Store lea addresses_A+0xdae, %rdi nop and %r8, %r8 mov $0x5152535455565758, %rbp movq %rbp, %xmm2 vmovups %ymm2, (%rdi) nop nop nop nop nop and $48358, %rdi // Store lea addresses_normal+0x1f91, %r11 nop nop nop inc %rax movl $0x51525354, (%r11) nop nop nop dec %rbp // Store lea addresses_D+0x6316, %rax nop inc %r8 movw $0x5152, (%rax) nop nop nop nop sub %r11, %r11 // Store lea addresses_WT+0xcbde, %rdi cmp %r8, %r8 movb $0x51, (%rdi) nop dec %r11 // Store lea addresses_normal+0x1ebde, %rdi sub $14642, %rbp movb $0x51, (%rdi) nop nop nop nop nop xor $6425, %r8 // Store lea addresses_WT+0xf09e, %r8 nop nop nop sub $3150, %r14 movb $0x51, (%r8) nop nop nop and %r8, %r8 // Load lea addresses_A+0x3cfe, %rax nop add %rdi, %rdi movb (%rax), %r9b nop dec %r11 // Faulty Load lea addresses_WT+0xbde, %rdi nop nop nop dec %r11 vmovups (%rdi), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %rax lea oracles, %rbp and $0xff, %rax shlq $12, %rax mov (%rbp,%rax,1), %rax pop %rdi pop %rbp pop %rax pop %r9 pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_A', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
31.554307
2,999
0.650208
16b553d21e0f6305bf7163f124425267451ccdbd
679
asm
Assembly
oeis/021/A021454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/021/A021454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/021/A021454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A021454: Expansion of 1/((1-x)(1-3x)(1-5x)(1-9x)). ; Submitted by Jon Maiga ; 1,18,220,2310,22561,212268,1957600,17857620,161924521,1463379918,13200803980,118959425130,1071396569881,9646380238968,86836484875360,781623699024840,7035090031526641,63318194178965418,569875667667947740,5128940611041216750,46160763514749562801,415448361725329655268,3739042706037956437120,33651421607032770400860,302862980727174390246361,2725767757865237728324518,24531914477394293434199500,220787253579595848700417170,1987085398631632992455545321,17883769169761151648424909168 add $0,2 lpb $0 sub $0,1 add $2,2 mul $2,5 sub $2,9 mul $3,9 add $3,$1 mul $1,3 add $1,$2 lpe mov $0,$3
39.941176
479
0.815906
d32cf0e5ea79db2a0ddfc63ddd908fb327605988
405
asm
Assembly
oeis/100/A100144.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/100/A100144.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/100/A100144.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A100144: First differences of A100143. ; Submitted by Jamie Morken(w1) ; 1,2,2,4,4,4,4,6,6,6,6,6,6,10,10,10,10,10,10,10,10,10,10,14,14,14,14,14,14,14,14,14,14,14,14,14,14,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22 mov $3,1 lpb $0 sub $0,1 sub $0,$4 add $2,2 add $4,$3 mov $3,$2 mov $2,$1 mov $1,2 lpe add $4,1 mov $0,$4
23.823529
210
0.612346
08568fb84ee903a8880a5aacebdccec10004d8a4
3,054
asm
Assembly
Aurora/Aurora/x64/Debug/postbox.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
8
2021-07-19T04:46:35.000Z
2022-03-12T17:56:00.000Z
Aurora/Aurora/x64/Debug/postbox.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
Aurora/Aurora/x64/Debug/postbox.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z ; post_box_put_msg EXTRN memcpy:PROC EXTRN ?unblock_thread@@YAXPEAU_thread_@@@Z:PROC ; unblock_thread EXTRN ?is_multi_task_enable@@YA_NXZ:PROC ; is_multi_task_enable EXTRN ?thread_iterate_ready_list@@YAPEAU_thread_@@G@Z:PROC ; thread_iterate_ready_list EXTRN ?thread_iterate_block_list@@YAPEAU_thread_@@H@Z:PROC ; thread_iterate_block_list pdata SEGMENT $pdata$?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z DD imagerel $LN7 DD imagerel $LN7+157 DD imagerel $unwind$?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z pdata ENDS xdata SEGMENT $unwind$?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z DD 010e01H DD 0620eH xdata ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\ipc\postbox.cpp _TEXT SEGMENT t$ = 32 tmsg$ = 40 msg$ = 64 to_id$ = 72 ?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z PROC ; post_box_put_msg ; 29 : void post_box_put_msg (postmsg_t *msg, uint16_t to_id) { $LN7: mov WORD PTR [rsp+16], dx mov QWORD PTR [rsp+8], rcx sub rsp, 56 ; 00000038H ; 30 : ; 31 : /* check, if multitasking is initialized, ; 32 : if not, just return ; 33 : */ ; 34 : if (!is_multi_task_enable()) call ?is_multi_task_enable@@YA_NXZ ; is_multi_task_enable movzx eax, al test eax, eax jne SHORT $LN4@post_box_p ; 35 : return; jmp SHORT $LN5@post_box_p $LN4@post_box_p: ; 36 : ; 37 : thread_t *t = thread_iterate_ready_list (to_id); //!ready list movzx ecx, WORD PTR to_id$[rsp] call ?thread_iterate_ready_list@@YAPEAU_thread_@@G@Z ; thread_iterate_ready_list mov QWORD PTR t$[rsp], rax ; 38 : if (t == NULL) { cmp QWORD PTR t$[rsp], 0 jne SHORT $LN3@post_box_p ; 39 : t = thread_iterate_block_list(to_id); movzx eax, WORD PTR to_id$[rsp] mov ecx, eax call ?thread_iterate_block_list@@YAPEAU_thread_@@H@Z ; thread_iterate_block_list mov QWORD PTR t$[rsp], rax $LN3@post_box_p: ; 40 : } ; 41 : ; 42 : postmsg_t *tmsg = (postmsg_t*)t->msg_box; mov rax, QWORD PTR t$[rsp] mov rax, QWORD PTR [rax+248] mov QWORD PTR tmsg$[rsp], rax ; 43 : if (tmsg->type == 0) mov rax, QWORD PTR tmsg$[rsp] movzx eax, WORD PTR [rax] test eax, eax jne SHORT $LN2@post_box_p ; 44 : memcpy (t->msg_box,msg,sizeof(postmsg_t)); mov r8d, 32 ; 00000020H mov rdx, QWORD PTR msg$[rsp] mov rax, QWORD PTR t$[rsp] mov rcx, QWORD PTR [rax+248] call memcpy $LN2@post_box_p: ; 45 : ; 46 : if (t->state == THREAD_STATE_BLOCKED){ mov rax, QWORD PTR t$[rsp] movzx eax, BYTE PTR [rax+232] cmp eax, 3 jne SHORT $LN1@post_box_p ; 47 : unblock_thread(t); mov rcx, QWORD PTR t$[rsp] call ?unblock_thread@@YAXPEAU_thread_@@@Z ; unblock_thread $LN1@post_box_p: $LN5@post_box_p: ; 48 : } ; 49 : } add rsp, 56 ; 00000038H ret 0 ?post_box_put_msg@@YAXPEAU_post_box_message_@@G@Z ENDP ; post_box_put_msg _TEXT ENDS END
25.032787
86
0.711526
22ba84fae2b16caebcaacee1a9659cc693046f0a
131
asm
Assembly
graphics/palettes.asm
cppchriscpp/ld38
fe2e11a2f1a1098c716289b444c867a8113c39ea
[ "MIT" ]
4
2018-08-18T15:31:04.000Z
2021-03-28T22:21:15.000Z
graphics/palettes.asm
cppchriscpp/missing-lands
fe2e11a2f1a1098c716289b444c867a8113c39ea
[ "MIT" ]
null
null
null
graphics/palettes.asm
cppchriscpp/missing-lands
fe2e11a2f1a1098c716289b444c867a8113c39ea
[ "MIT" ]
null
null
null
.export _main_palette, _sprite_palette _main_palette: .incbin "graphics/main.pal" _sprite_palette: .incbin "graphics/sprite.pal"
26.2
38
0.80916
6c0067054e28bc9ecccb75669187ad6952c5311a
5,302
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1208.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_1208.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_1208.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r14 push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x6d80, %rsi nop nop nop nop nop add $49401, %rdi mov $0x6162636465666768, %r11 movq %r11, %xmm4 vmovups %ymm4, (%rsi) nop nop nop nop xor %r14, %r14 lea addresses_normal_ht+0x91e5, %r13 nop nop nop nop nop and %rdx, %rdx vmovups (%r13), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r12 nop nop add $3413, %rdx lea addresses_normal_ht+0x52f1, %rsi lea addresses_A_ht+0xc919, %rdi nop nop nop nop sub %r11, %r11 mov $124, %rcx rep movsb nop xor $10388, %r11 lea addresses_UC_ht+0x4ae0, %r11 dec %rsi mov $0x6162636465666768, %rdi movq %rdi, %xmm6 movups %xmm6, (%r11) nop nop nop add %r11, %r11 lea addresses_A_ht+0x15bf1, %rsi lea addresses_D_ht+0xc3f1, %rdi nop nop nop nop nop and $42005, %rdx mov $100, %rcx rep movsl nop nop nop nop nop and %rcx, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %rax push %rdx // Faulty Load lea addresses_UC+0x5bf1, %r13 nop xor $23600, %rdx mov (%r13), %r15w lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rdx pop %rax pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 11}} {'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 */
42.758065
2,999
0.664466
bb6cc41fe7fee07331a368423e3e55f3301695af
557
asm
Assembly
oeis/017/A017076.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017076.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017076.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017076: a(n) = (8*n)^12. ; 0,68719476736,281474976710656,36520347436056576,1152921504606846976,16777216000000000000,149587343098087735296,951166013805414055936,4722366482869645213696,19408409961765342806016,68719476736000000000000,215671155821681003462656,612709757329767363772416,1601032218567680790102016,3895975992546975973113856,8916100448256000000000000,19342813113834066795298816,40037495277186834126340096,79496847203390844133441536,152097843090208773684330496,281474976710656000000000000,505488617542763051300683776 pow $0,12 mul $0,68719476736
92.833333
498
0.913824