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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e1f1f75f3b3db4ffb9829e9b14897169b2e7c486 | 608 | asm | Assembly | oeis/317/A317984.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/317/A317984.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/317/A317984.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A317984: Expansion of 140*x*(1 + 4*x + x^2) / (1 - x)^5.
; 140,1260,5040,14000,31500,61740,109760,181440,283500,423500,609840,851760,1159340,1543500,2016000,2589440,3277260,4093740,5054000,6174000,7470540,8961260,10664640,12600000,14787500,17248140,20003760,23077040,26491500,30271500,34442240,39029760,44060940,49563500,55566000,62097840,69189260,76871340,85176000,94136000,103784940,114157260,125288240,137214000,149971500,163598540,178133760,193616640,210087500,227587500,246158640,265843760,286686540,308731500,332024000,356610240,382537260,409852940
mov $1,-3
bin $1,$0
pow $1,2
mul $1,140
mov $0,$1
| 67.555556 | 497 | 0.814145 |
8de19cfc248efe886864ce6c469fc4c0acb97877 | 258 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_trunc.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_trunc.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_trunc.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | ; unsigned char esx_f_trunc(unsigned char *filename,uint32_t size)
SECTION code_esxdos
PUBLIC esx_f_trunc
EXTERN asm_esx_f_trunc
esx_f_trunc:
pop af
pop de
pop bc
pop hl
push hl
push bc
push de
push af
jp asm_esx_f_trunc
| 11.727273 | 66 | 0.709302 |
6ac651163337116149f524108b14d354a110c3e8 | 435 | asm | Assembly | tests/devices/save3dos/save3dos_0.asm | NEO-SPECTRUMAN/sjasmplus | cc260ea609114d6920858a139b448350bf1bce27 | [
"BSD-3-Clause"
] | null | null | null | tests/devices/save3dos/save3dos_0.asm | NEO-SPECTRUMAN/sjasmplus | cc260ea609114d6920858a139b448350bf1bce27 | [
"BSD-3-Clause"
] | null | null | null | tests/devices/save3dos/save3dos_0.asm | NEO-SPECTRUMAN/sjasmplus | cc260ea609114d6920858a139b448350bf1bce27 | [
"BSD-3-Clause"
] | null | null | null | DEVICE ZXSPECTRUM48
ORG $5D00
PRINT EQU $F5
basic:
DB 0,10 ;; Line number 10
DW .l10ln ;; Line length
.l10: DB PRINT,"\"https://github.com/z00m128/sjasmplus\"\r"
.l10ln: EQU $-.l10
.sz EQU $-basic
SAVE3DOS "save3dos_0.bin", basic, basic.sz, 0 ; basic, no LINE, no vars
SAVE3DOS "save3dos_0.raw", basic, basic.sz, 0, 10 ; basic, LINE 10
| 27.1875 | 85 | 0.537931 |
edbde5cd6edcee86bfe0135744b38cf0eda83cd6 | 4,992 | nasm | Assembly | modules/taskman/mem/paging.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | modules/taskman/mem/paging.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | modules/taskman/mem/paging.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | ;-------------------------------------------------------------------------------
; paging.nasm - routines for manipulating page tables.
;-------------------------------------------------------------------------------
module tm.memman.paging
%include "sys.ah"
%include "errors.ah"
%include "tm/process.ah"
%include "cpu/paging.ah"
publicproc NewPageDir, FreePageDir
publicproc GetPTEaddr, AllocPTifNecessary, MapArea
externproc PageAlloc, PageDealloc
externdata ?KernPCB
section .text
; Make a copy of the kernel page directory.
; Input: none.
; Output: CF=0 - OK, EDX=new directory address;
; CF=1 - error, AX=error code.
proc NewPageDir
mpush ebx,ecx,esi,edi
; Allocate a page for a new directory
mov dl,1 ; In upper memory
call PageAlloc
jc .Exit
and eax,PGENTRY_ADDRMASK
mov ebx,eax ; EBX=new dir addr
; Copy contents
mov edi,ebx
mov eax,[?KernPCB]
mov esi,[eax+tProcDesc.PageDir]
mov ecx,PG_ITEMSPERTABLE
cld
rep movsd
mov edx,ebx
clc
.Exit: mpop edi,esi,ecx,ebx
ret
endp ;---------------------------------------------------------------
; Free a page directory and all user page tables.
; Input: EDX=directory address.
; Output: none.
proc FreePageDir
push ecx
mov ecx,PG_ITEMSPERTABLE / 2 ; Start from user mem
.ChkPDE: mov eax,[edx+ecx*4] ; First we free all
test eax,PG_PRESENT ; page tables
jz .NextPDE
call PageDealloc
.NextPDE: inc ecx
cmp ecx,PG_ITEMSPERTABLE
jb .ChkPDE
mov eax,edx ; Free directory page
call PageDealloc
pop ecx
ret
endp ;---------------------------------------------------------------
; For given linear address, get a physical address of PTE.
; Input: EBX=linear address,
; EDX=directory address.
; Output: CF=0 - OK, EDI=physical address of PTE;
; CF=1 - error, AX=error code.
proc GetPTEaddr
mpush ebx,edx
mov eax,ebx
shr eax,PAGEDIRSHIFT ; EAX=PDE number
mov edx,[edx+eax*4] ; EDX=page table addr.
cmp edx,PG_DISABLE ; Page table present?
je .Err ; No, bad address
and edx,PGENTRY_ADDRMASK ; Mask control bits
and ebx,ADDR_PTEMASK
shr ebx,PAGESHIFT ; EBX=PTE number
lea edi,[edx+ebx*4] ; EDI=PTE address
clc
.Exit: mpop edx,ebx
ret
.Err: mov eax,ERR_PG_BadLinearAddr
stc
jmp .Exit
endp ;---------------------------------------------------------------
; Initialize all PTEs with default value (PG_DISABLE).
; Input: EAX=page table address.
; Output: none.
proc InitPTEs
mpush eax,ecx,edi
mov edi,eax
and edi,~ADDR_OFSMASK
mov ecx,PAGESIZE / 4
mov eax,PG_DISABLE
cld
rep stosd
mpop edi,ecx,eax
ret
endp ;---------------------------------------------------------------
; Allocate a page table for given address if it is not
; allocated yet.
; Input: EBX=address,
; EDX=page directory address,
; AH=page table attributes (PG_USERMODE, PG_WRITABLE).
; Output: CF=0 - OK;
; CF=1 - error, AX=error code.
proc AllocPTifNecessary
mpush ecx,edi
mov edi,ebx
mov cl,ah
shr edi,PAGEDIRSHIFT ; EDI=PDE number
cmp dword [edx+edi*4],PG_DISABLE ; Page table present?
jne .OK ; If yes, exit
push edx ; No, allocate new one
mov dl,1 ; in upper memory
call PageAlloc
pop edx
jc .Exit
or al,cl
mov [edx+edi*4],eax
call InitPTEs
.OK: clc
.Exit: mpop edi,ecx
ret
endp ;---------------------------------------------------------------
; MapArea - map arbitrary area of physical memory.
; Input: AH=page directory attributes (ORed with existing),
; AL=page enry attributes,
; ECX=area size,
; EDX=page directory address,
; ESI=physical address of mapped area,
; EDI=virtual address.
; Output: CF=0 - OK;
; CF=1 - error, AX=error code.
proc MapArea
locals attrs,numpages,pte
prologue
mpush ebx,ecx,edx,esi,edi
or ecx,ecx
jz near .Exit
mov [%$attrs],eax
mAlignOnPage ecx
shr ecx,PAGESHIFT
mov [%$numpages],ecx
shr ecx,PAGEDIRSHIFT-PAGESHIFT ; Number of page dirs
and esi,PGENTRY_ADDRMASK
mov ebx,edx
mov eax,edi
and eax,ADDR_PTEMASK
shr eax,PAGESHIFT ; EAX=PTE#
mov [%$pte],eax
shr edi,PAGEDIRSHIFT ; EDI=PDE#
.PDloop: mov dx,[%$attrs]
mov eax,[ebx+edi*4]
cmp eax,PG_DISABLE ; Is page table missing?
jne .SetPDEattr ; No, just set attrs
mov dl,1 ; Else allocate a new one
call PageAlloc
jc .Exit
call InitPTEs
.SetPDEattr: or al,dh
mov [ebx+edi*4],eax
; Do actual mapping and initialize page attributes
.InitPT: push edi
mov edi,eax
and edi,PGENTRY_ADDRMASK
movzx eax,byte [%$attrs]
or eax,PG_MAPPED
or esi,eax
mov eax,[%$pte]
.PTloop: mov [edi+eax*4],esi
dec dword [%$numpages]
jz .InitPTdone
add esi,PAGESIZE
inc eax
cmp eax,PG_ITEMSPERTABLE
jne .PTloop
xor eax,eax ; Next dir - PTE #0
.InitPTdone: mov [%$pte],eax
pop edi
inc edi
jecxz .OK
loop .PDloop
.OK: clc
.Exit: mpop edi,esi,edx,ecx,ebx
epilogue
ret
endp ;---------------------------------------------------------------
| 23.658768 | 80 | 0.606971 |
2113f19a3130ee74f6d7d930c7a26f0c81f33541 | 3,167 | asm | Assembly | src/engine.asm | Daivuk/NESEngine | 5194a0267e76c53bd66ca37bbeb3c6bd8b57f795 | [
"MIT"
] | null | null | null | src/engine.asm | Daivuk/NESEngine | 5194a0267e76c53bd66ca37bbeb3c6bd8b57f795 | [
"MIT"
] | null | null | null | src/engine.asm | Daivuk/NESEngine | 5194a0267e76c53bd66ca37bbeb3c6bd8b57f795 | [
"MIT"
] | 2 | 2018-11-07T01:47:19.000Z | 2019-10-19T04:50:10.000Z | ;-----------------------------------------------------------------------------------------
; iNES header
;-----------------------------------------------------------------------------------------
.inesprg 2 ; 2x 16KB PRG code
.ineschr 1 ; 1x 8KB CHR data
.inesmir 1 ; background mirroring
.inesmap 0 ; mapper 0 = NROM, no bank swapping
;-----------------------------------------------------------------------------------------
; Interrupts
;-----------------------------------------------------------------------------------------
.bank 3
.org $FFFA ;first of the three vectors starts here
.dw NMI ;when an NMI happens (once per frame if enabled) the processor will jump to the label NMI:
.dw RESET ;when the processor first turns on or is reset, it will jump to the label RESET:
.dw 0 ;external interrupt IRQ is not used in this engine
;-----------------------------------------------------------------------------------------
; CHR banks
;-----------------------------------------------------------------------------------------
.bank 4
.org $0000
.incbin "assets/pattern.chr"
;-----------------------------------------------------------------------------------------
; Game code bank
;-----------------------------------------------------------------------------------------
.bank 0
.org $8000
.rsset $0000
tmp1 .rs 2 ; $00-$01
tmp2 .rs 2 ; $02-$03
tmp3 .rs 2 ; $04-$05
tmp4 .rs 2 ; $06-$07
tmp5 .rs 2 ; $08-$09
tmp6 .rs 2 ; $0A-$0B
tmp7 .rs 2 ; $0C-$0D
tmp8 .rs 2 ; $0E-$0F
;-----------------------------------------------------------------------------------------
; Turn ON, Reset. Start of the program
;-----------------------------------------------------------------------------------------
.bank 0
RESET:
sei ; disable IRQs
cld ; disable decimal mode
ldx #$40
stx $4017 ; disable APU frame IRQ
ldx #$FF
txs ; Set up stack
inx ; now X = 0
stx $2000 ; disable NMI
stx $2001 ; disable rendering
stx $4010 ; disable DMC IRQs
jsr WaitVBlank
clrmem:
lda #$00
sta $0000, x
sta $0100, x
sta $0200, x
sta $0400, x
sta $0500, x
sta $0600, x
sta $0700, x
lda #$FE
sta $0300, x
inx
bne clrmem
jsr WaitVBlank
ldx #$10 ; Wait couple frames
jsr Wait ;---
jmp Main
;-----------------------------------------------------------------------------------------
; Includes
;-----------------------------------------------------------------------------------------
.include "src/macro.asm"
.include "src/ppu.asm"
.include "src/timing.asm"
;-----------------------------------------------------------------------------------------
; Main loop
;-----------------------------------------------------------------------------------------
.bank 0
Main:
jsr ppu_On
jsr OnInit
MainLoop:
jsr ppu_Submit
jsr OnFrame
jmp MainLoop
;-----------------------------------------------------------------------------------------
; Lastly, includes our game code
;-----------------------------------------------------------------------------------------
.include "src/game.asm"
| 31.989899 | 106 | 0.328071 |
679ecb1bacf36c5a444c3a32ce54586d4b5d9561 | 5,478 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2429.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2429.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2429.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdx
push %rsi
lea addresses_UC_ht+0x13f4f, %rax
and %r14, %r14
mov (%rax), %bp
xor %rsi, %rsi
lea addresses_D_ht+0x18d13, %rsi
nop
nop
nop
nop
inc %rdx
movl $0x61626364, (%rsi)
nop
dec %rax
lea addresses_WT_ht+0x17efb, %r12
nop
nop
nop
nop
nop
sub %r14, %r14
movups (%r12), %xmm0
vpextrq $1, %xmm0, %rsi
xor $29943, %r14
lea addresses_A_ht+0x111df, %rbp
nop
nop
nop
nop
add %rcx, %rcx
mov (%rbp), %r14d
nop
nop
nop
nop
nop
and $46610, %r12
lea addresses_A_ht+0x195f7, %rax
nop
nop
sub %rsi, %rsi
movb (%rax), %dl
nop
xor $58553, %rbp
pop %rsi
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_A+0x11c4f, %rsi
lea addresses_WT+0x12f5f, %rdi
nop
nop
nop
and $3179, %r11
mov $38, %rcx
rep movsl
nop
nop
add $13636, %r8
// Load
mov $0x1b9, %r15
nop
nop
inc %rdi
mov (%r15), %r8d
nop
nop
nop
add %rsi, %rsi
// Faulty Load
lea addresses_D+0xd4f, %rsi
nop
nop
sub $6831, %rdi
mov (%rsi), %r15w
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_P', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 41.5 | 2,999 | 0.653341 |
dc703cd79bed7bcc9f691f586f1240eea0c1a22c | 392 | asm | Assembly | oeis/132/A132814.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/132/A132814.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/132/A132814.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A132814: A007318^(-1) * A132813.
; Submitted by Christian Krause
; 1,0,2,0,2,3,0,0,9,4,0,0,6,24,5,0,0,0,40,50,6,0,0,0,20,150,90,7,0,0,0,0,175,420,147,8,0,0,0,0,70,840,980,224,9,0,0,0,0,0,756,2940,2016,324,10,0,0,0,0,0,252,4410,8400,3780,450,11
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
bin $1,$0
add $0,1
mul $1,2
add $2,1
bin $0,$2
mul $1,16
mul $1,$0
mov $0,$1
div $0,32
| 19.6 | 178 | 0.594388 |
c939938da2d09b23fa1dc4ec5eabee3d9083c6a5 | 1,756 | asm | Assembly | programs/oeis/178/A178455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/178/A178455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/178/A178455.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A178455: Partial sums of floor(2^n/7).
; 0,0,0,1,3,7,16,34,70,143,289,581,1166,2336,4676,9357,18719,37443,74892,149790,299586,599179,1198365,2396737,4793482,9586972,19173952,38347913,76695835,153391679,306783368,613566746,1227133502,2454267015,4908534041,9817068093,19634136198,39268272408,78536544828,157073089669,314146179351,628292358715,1256584717444,2513169434902,5026338869818,10052677739651,20105355479317,40210710958649,80421421917314,160842843834644,321685687669304,643371375338625,1286742750677267,2573485501354551,5146971002709120,10293942005418258,20587884010836534,41175768021673087,82351536043346193,164703072086692405,329406144173384830,658812288346769680,1317624576693539380,2635249153387078781,5270498306774157583,10540996613548315187,21081993227096630396,42163986454193260814,84327972908386521650,168655945816773043323,337311891633546086669,674623783267092173361,1349247566534184346746,2698495133068368693516,5396990266136737387056,10793980532273474774137,21587961064546949548299,43175922129093899096623,86351844258187798193272,172703688516375596386570,345407377032751192773166,690814754065502385546359,1381629508131004771092745,2763259016262009542185517,5526518032524019084371062,11053036065048038168742152,22106072130096076337484332,44212144260192152674968693,88424288520384305349937415,176848577040768610699874859,353697154081537221399749748,707394308163074442799499526,1414788616326148885598999082,2829577232652297771197998195,5659154465304595542395996421,11318308930609191084791992873,22636617861218382169583985778,45273235722436764339167971588,90546471444873528678335943208,181092942889747057356671886449
lpb $0
mov $2,$0
sub $0,1
seq $2,155803 ; A023001 interleaved with 2*A023001 and 4*A023001.
add $1,$2
lpe
mov $0,$1
| 159.636364 | 1,589 | 0.907745 |
94b944831b75e5ae970e4cf85c5ee66f573667b7 | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_mplay0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_mplay0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_mplay0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_mplay0.asm
Type: file
Size: 43685
Last-Modified: '2016-05-13T04:52:57Z'
SHA-1: 8678B03BD6785EF98FBCD8E9BB97E9FDC3BE943F
Description: null
| 21 | 47 | 0.816327 |
b3bf78d2366bdff6fedef7048dec7205de4cf588 | 4,480 | asm | Assembly | nRF24L01_PER_Measurement/PER_TX_27443/PER_TX/PER_TX/delay.asm | TuningSweeper/nRF24L01-PSOC | 917c8fa21639a06936c7e39b7ff6a9eb802a1383 | [
"MIT"
] | null | null | null | nRF24L01_PER_Measurement/PER_TX_27443/PER_TX/PER_TX/delay.asm | TuningSweeper/nRF24L01-PSOC | 917c8fa21639a06936c7e39b7ff6a9eb802a1383 | [
"MIT"
] | null | null | null | nRF24L01_PER_Measurement/PER_TX_27443/PER_TX/PER_TX/delay.asm | TuningSweeper/nRF24L01-PSOC | 917c8fa21639a06936c7e39b7ff6a9eb802a1383 | [
"MIT"
] | null | null | null | ;;*****************************************************************************
;;*****************************************************************************
;; FILENAME: delay.asm
;;
;; DESCRIPTION: Delay functions implementation file
;;
;;-----------------------------------------------------------------------------
;; Copyright (c) Cypress MicroSystems 2002-2006. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************
;-----------------------------------------------------------------------------
; Include Files
;-----------------------------------------------------------------------------
include "m8c.inc"
include "memory.inc"
;-----------------------------------------------------------------------------
; Global Symbols
;-----------------------------------------------------------------------------
export Delay50uTimes
export _Delay50uTimes
export Delay50u
export _Delay50u
export Delay10msTimes
export _Delay10msTimes
area text(rom)
.SECTION
;-----------------------------------------------------------------------------
; FUNCTION NAME: DelaySeconds
;
; DESCRIPTION:
; Delay increments of 10mSeconds
;
;-----------------------------------------------------------------------------
;
; ARGUMENTS:
; A contains the delay multiplier
;
; RETURNS:
;
; SIDE EFFECTS:
; The A and X registers may be modified by this or future implementations
; of this function. The same is true for all RAM page pointer registers in
; the Large Memory Model. When necessary, it is the calling function's
; responsibility to perserve their values across calls to fastcall16
; functions.
Delay10msTimes:
_Delay10msTimes:
RAM_PROLOGUE RAM_USE_CLASS_1
push A
mov A, 200
DELAY50US:
call Delay50u
dec A
jnz DELAY50US
pop A
dec A
jnz Delay10msTimes
RAM_EPILOGUE RAM_USE_CLASS_1
ret
.ENDSECTION
.SECTION
;-----------------------------------------------------------------------------
; FUNCTION NAME: Delay50uTimes
;
; DESCRIPTION:
; Delay increments of 50uSeconds
;
;-----------------------------------------------------------------------------
;
; ARGUMENTS:
; A contains the delay multiplier
;
; RETURNS:
;
; SIDE EFFECTS:
; The A and X registers may be modified by this or future implementations
; of this function. The same is true for all RAM page pointer registers in
; the Large Memory Model. When necessary, it is the calling function's
; responsibility to perserve their values across calls to fastcall16
; functions.
;
;
Delay50uTimes:
_Delay50uTimes:
RAM_PROLOGUE RAM_USE_CLASS_1
call Delay50u
dec A
jnz Delay50uTimes
RAM_EPILOGUE RAM_USE_CLASS_1
ret
.ENDSECTION
;-----------------------------------------------------------------------------
; FUNCTION NAME: Delay50u
;
; DESCRIPTION:
; Delay 50uSec for any clock frequency from 1.5MHz to 24MHz
; Slower clock frequencies the delay will be;
; 1.5
; -------------- * 50uSec
; clock_freq(MHz)
;
;
;-----------------------------------------------------------------------------
;
; ARGUMENTS: none
;
; RETURNS: none
;
; SIDE EFFECTS:
; The A and X registers may be modified by this or future implementations
; of this function. The same is true for all RAM page pointer registers in
; the Large Memory Model. When necessary, it is the calling function's
; responsibility to perserve their values across calls to fastcall16
; functions.
;
; THEORY of OPERATION or PROCEDURE:
;
.LITERAL
Delay50u_Table::
DB 08h, 19h, 3Ah, 7Ch, 01h, 01h, 01h, 01h
; 3MHz, 6MHz, 12MHz, 24MHz, 1.5MHz, 750kHz, 188kHz, 94kHz
.ENDLITERAL
.SECTION
Delay50u:
_Delay50u: ; [11] Call
RAM_PROLOGUE RAM_USE_CLASS_1
push A
M8C_SetBank1 ; [4]
mov A, reg[OSC_CR0] ; [6] Get delay value
M8C_SetBank0 ; [4]
and A,07h ; [4] Mask off only the clock bits
cmp A,05h
jnc Delay50u_End
index Delay50u_Table ; [13] Get delay value
Delay50u_Loop: ;
dec A ; [4]
jnz Delay50u_Loop ; [5]
Delay50u_End:
pop A
RAM_EPILOGUE RAM_USE_CLASS_1
ret
.ENDSECTION
| 27.151515 | 79 | 0.476786 |
106e868156dfb2a83bf619803e43036edaca22d7 | 148 | asm | Assembly | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/mak/kart-enemy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/mak/kart-enemy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/mak/kart-enemy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: kart-enemy.asm
Type: file
Size: 24496
Last-Modified: '1992-08-31T05:36:28Z'
SHA-1: 4BC42D62711BB032B3703D09E68AC8B714E21A4C
Description: null
| 21.142857 | 47 | 0.810811 |
eaaffe60d2f98fa8ad6dfad343d9bbb0bcb586cc | 351 | asm | Assembly | read-caharacter.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | 1 | 2022-01-13T07:29:30.000Z | 2022-01-13T07:29:30.000Z | read-caharacter.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | null | null | null | read-caharacter.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | null | null | null | name 'read-character'
.model small
.stack
.data
var db ?
var1 db ?
.code
mov ah, 01h
int 21h
mov var, al
int 21h
mov var1,al
mov ah,02h
mov dl, var
int 21h
mov dl,var1
int 21h
EXIT:
mov al,4ch
int 21h
end | 11.7 | 25 | 0.415954 |
92a073b3f6476adf2f9ee166a9b4e02fb0b783e3 | 6,805 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_677.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_677.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_677.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 %r13
push %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x12a6b, %rbp
nop
nop
nop
nop
dec %r14
movb $0x61, (%rbp)
inc %r15
lea addresses_D_ht+0x114d7, %r11
nop
nop
nop
nop
cmp $18821, %rcx
mov $0x6162636465666768, %r10
movq %r10, (%r11)
nop
cmp %r15, %r15
lea addresses_D_ht+0x895b, %rsi
lea addresses_WC_ht+0x1bb0b, %rdi
nop
add $27892, %r14
mov $106, %rcx
rep movsw
nop
nop
nop
inc %rbp
lea addresses_WT_ht+0x6703, %r14
sub $28025, %r11
vmovups (%r14), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %r13
nop
nop
nop
nop
inc %r14
lea addresses_WT_ht+0x155b, %rsi
lea addresses_normal_ht+0x1d31b, %rdi
clflush (%rdi)
nop
add $10736, %r10
mov $0, %rcx
rep movsw
sub $5461, %r11
lea addresses_UC_ht+0x45c6, %r14
clflush (%r14)
nop
dec %r15
movups (%r14), %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
nop
inc %r10
lea addresses_normal_ht+0x60bb, %rsi
lea addresses_WT_ht+0x1dd5b, %rdi
nop
sub %r15, %r15
mov $27, %rcx
rep movsl
nop
nop
nop
and $10804, %rdi
lea addresses_A_ht+0x1315b, %r14
nop
nop
nop
cmp %rsi, %rsi
mov (%r14), %r11w
nop
xor $43004, %rdi
lea addresses_UC_ht+0x18a0b, %rsi
nop
nop
nop
nop
sub $51360, %r10
mov $0x6162636465666768, %r11
movq %r11, %xmm6
vmovups %ymm6, (%rsi)
nop
nop
add %rdi, %rdi
lea addresses_WC_ht+0x344b, %rbp
nop
nop
nop
nop
and %r15, %r15
mov $0x6162636465666768, %r13
movq %r13, %xmm1
movups %xmm1, (%rbp)
nop
nop
nop
nop
nop
dec %r14
lea addresses_WT_ht+0x1641b, %r15
nop
cmp $29618, %rcx
mov $0x6162636465666768, %r10
movq %r10, (%r15)
nop
nop
nop
nop
nop
dec %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %rbp
push %rbx
push %rcx
push %rdx
// Faulty Load
lea addresses_RW+0x11d5b, %r8
nop
nop
nop
nop
nop
sub $43531, %rdx
mov (%r8), %rcx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}}
{'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
*/
| 36.586022 | 2,999 | 0.660544 |
b5f376e24fee4ea8f875a55ac7f615e0884ce49b | 7,973 | asm | Assembly | base/ntos/ke/amd64/clockint.asm | yang235/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 209 | 2018-10-30T15:59:10.000Z | 2022-03-31T06:02:48.000Z | base/ntos/ke/amd64/clockint.asm | WindowsExploitation/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 2 | 2019-01-17T04:52:33.000Z | 2019-06-11T06:37:43.000Z | base/ntos/ke/amd64/clockint.asm | WindowsExploitation/wrk-v1.2 | daeeb598c7bf091b1370e8875626ad0cb3cd1ec0 | [
"Intel"
] | 66 | 2018-08-03T11:15:44.000Z | 2022-03-31T01:03:03.000Z | title "Interval Clock Interrupt"
;++
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt).
; If you do not agree to the terms, do not use the code.
;
;
; Module Name:
;
; clockint.asm
;
; Abstract:
;
; This module implements the architecture dependent code necessary to
; process the interval clock interrupt.
;
;--
include ksamd64.inc
extern ExpInterlockedPopEntrySListEnd:proc
extern ExpInterlockedPopEntrySListResume:proc
extern KeMaximumIncrement:dword
extern KeTimeAdjustment:dword
extern KeUpdateRunTime:proc
extern KiCheckForSListAddress:proc
extern KiDpcInterruptBypass:proc
extern KiIdleSummary:qword
extern KiInitiateUserApc:proc
extern KiRestoreDebugRegisterState:proc
extern KiSaveDebugRegisterState:proc
extern KiTimeIncrement:qword
extern KiTimerTableListHead:qword
extern __imp_HalRequestSoftwareInterrupt:qword
subttl "Update System Time"
;++
;
; VOID
; KeUpdateSystemTime (
; IN PKTRAP_FRAME TrapFrame,
; IN ULONG64 Increment
; )
;
; Routine Description:
;
; This routine is called as the result of an interrupt generated by the
; interval timer. Its function is to update the interrupt time, update the
; system time, and check to determine if a timer has expired.
;
; N.B. This routine is executed on a single processor in a multiprocess
; system. The remainder of the processors only execute the quantum end
; and runtime update code.
;
; Arguments:
;
; TrapFrame (rcx) - Supplies the address of a trap frame.
;
; Increment (rdx) - Supplies the time increment value in 100 nanosecond
; units.
;
; Return Value:
;
; None.
;
;--
UsFrame struct
P1Home dq ? ; parameter home addresses
P2Home dq ? ;
P3Home dq ? ;
P4Home dq ?
SavedRbp dq ? ; saved register RBP
UsFrame ends
NESTED_ENTRY KeUpdateSystemTime, _TEXT$00
alloc_stack (sizeof UsFrame) ; allocate stack frame
save_reg rbp, UsFrame.SavedRbp ; save nonvolatile register
END_PROLOGUE
lea rbp, 128[rcx] ; set display pointer address
mov KiTimeIncrement, rdx ; save time increment value
;
; Check if the current clock tick should be skipped.
;
; Skip tick is set when the kernel debugger is entered.
;
if DBG
cmp byte ptr gs:[PcSkipTick], 0 ; check if tick should be skipped
jnz KiUS50 ; if nz, skip clock tick
endif
;
; Update interrupt time.
;
; N.B. Interrupt time is aligned 0 mod 8.
;
mov rcx, USER_SHARED_DATA ; get user shared data address
lea r11, KiTimerTableListHead ; get timer table address
mov r8, UsInterruptTime[rcx] ; get interrupt time
add r8, rdx ; compute updated interrupt time
ror r8, 32 ; swap upper and lower halves
mov UsInterruptTime + 8[rcx], r8d ; save 2nd upper half
ror r8, 32 ; swap upper and lower halves
mov UsInterruptTime[rcx], r8 ; save updated interrupt time
mov r10, UsTickCount[rcx] ; get tick count value
ifndef NT_UP
lock sub gs:[PcMasterOffset], edx ; subtract time increment
else
sub gs:[PcMasterOffset], edx ; subtract time increment
endif
jg short KiUS20 ; if greater, not complete tick
mov eax, KeMaximumIncrement ; get maximum time increment
add gs:[PcMasterOffset], eax ; add maximum time to residue
;
; Update system time.
;
; N.B. System time is aligned 4 mod 8, however, this data does not cross
; a cache line and is, therefore, updated atomically,
;
mov eax, KeTimeAdjustment ; get time adjustment value
add rax, UsSystemTime[rcx] ; compute updated system time
ror rax, 32 ; swap upper and lower halves
mov UsSystemTime + 8[rcx], eax ; save upper 2nd half
ror rax, 32 ; swap upper and lower halves
mov UsSystemTime[rcx], rax ; save updated system time
;
; Update tick count.
;
; N.B. Tick count is aligned 0 mod 8.
;
mov rax, UsTickCount[rcx] ; get tick count
inc rax ; increment tick count
ror rax, 32 ; swap upper and lower halves
mov UsTickCount + 8[rcx], eax ; save 2nd upper half
ror rax, 32 ; swap upper and lower halves
mov UsTickCount[rcx], rax ; save updated tick count
;
; Check to determine if a timer has expired.
;
.errnz (TIMER_ENTRY_SIZE - 24)
mov rcx, r10 ; copy tick count value
and ecx, TIMER_TABLE_SIZE - 1 ; isolate current hand value
lea rcx, [rcx + rcx * 2] ; multiply by 3
cmp r8, TtTime[r11 + rcx * 8] ; compare due time
jae short KiUS30 ; if ae, timer has expired
inc r10 ; advance tick count value
;
; Check to determine if a timer has expired.
;
KiUS20: mov rcx, r10 ; copy tick count value
and ecx, TIMER_TABLE_SIZE - 1 ; isolate current hand value
lea rcx, [rcx + rcx * 2] ; multiply by 3
cmp r8, TtTime[r11 + rcx * 8] ; compare due time
jb short KiUS40 ; if b, timer has not expired
;
; A timer has expired.
;
; Set the timer hand value in the current processor block if it is not already
; set.
;
KiUS30: mov rdx, gs:[PcCurrentPrcb] ; get current processor block address
cmp qword ptr PbTimerRequest[rdx], 0 ; check if expiration active
jne short KiUS40 ; if ne, expiration already active
mov PbTimerHand[rdx], r10 ; set timer hand value
mov byte ptr PbInterruptRequest[rdx], TRUE ; set interrupt request
;
; Update runtime.
;
KiUS40: lea rcx, (-128)[rbp] ; set trap frame address
mov rdx, KiTimeIncrement ; set time increment value
call KeUpdateRunTime ; update runtime
if DBG
KiUS50: mov byte ptr gs:[PcSkipTick], 0 ; clear skip tick indicator
endif
mov rbp, UsFrame.SavedRbp[rsp] ; restore nonvolatile register
add rsp, (sizeof UsFrame) ; deallocate stack frame
ret ; return
NESTED_END KeUpdateSystemTime, _TEXT$00
subttl "Secondary Processor Clock Interrupt Service Routine"
;++
;
; VOID
; KiSecondaryClockInterrupt (
; VOID
; )
;
; Routine Description:
;
; This routine is entered as the result of an interprocessor interrupt
; at CLOCK_LEVEL. Its function is to provide clock interrupt service on
; secondary processors.
;
; Arguments:
;
; None.
;
; Return Value:
;
; None.
;
;--
NESTED_ENTRY KiSecondaryClockInterrupt, _TEXT$00
.pushframe ; mark machine frame
alloc_stack 8 ; allocate dummy vector
push_reg rbp ; save nonvolatile register
GENERATE_INTERRUPT_FRAME <>, <Direct> ; generate interrupt frame
mov ecx, CLOCK_LEVEL ; set new IRQL level
ENTER_INTERRUPT <NoEoi> ; raise IRQL and enable interrupts
;
; Update runtime.
;
lea rcx, (-128)[rbp] ; set trap frame address
mov rdx, KiTimeIncrement ; set time increment value
call KeUpdateRunTime ; update runtime
EXIT_INTERRUPT <>, <>, <Direct> ; do EOI, lower IRQL and restore state
NESTED_END KiSecondaryClockInterrupt, _TEXT$00
end
| 30.086792 | 134 | 0.611062 |
6139fb87670630f937788c191ae501963b931818 | 3,461 | asm | Assembly | asm/text.ext.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | 6 | 2019-11-16T10:19:15.000Z | 2022-03-25T16:36:40.000Z | asm/text.ext.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | null | null | null | asm/text.ext.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | null | null | null | .align 2
text_cmdEuropeBlock:
push r14
ldrb r0,[r4,0x1]
cmp r0,0x0
beq @@skip
cmp r0,(VAR_TEXT_EU ? 0x2 : 0x1)
bne @@loop
@@skip:
add r4,0x2
b @@end
@@loop:
// Loop until 0xFE 0x00
ldrb r0,[r4]
add r4,0x1
cmp r0,0xE4
bne @@checkFE
add r4,0x1
b @@loop
@@checkFE:
cmp r0,0xFE
bne @@loop
ldrb r0,[r4]
add r4,0x1
cmp r0,0x0
bne @@loop
@@end:
mov r0,0x1
pop r15
.align 2
text_loadMailContentsUncompressed:
push r14
// Get Mail Contents for current Navi
ldrb r2,[r5,0x10] // get current Navi
lsl r2,r2,0x2
ldr r0,[r0,r2]
bl 0x804F7B6
pop r15
.align 2
text_multiStringComma:
mov r0,0xA1 // ','
strb r0,[r5]
mov r0,0xE8 // '\n'
strb r0,[r5,0x1]
add r5,0x2
bx r14
.align 2
text_applyStringCapsROM:
push r14
// Read capitalization bit
ldrb r7,[r4,0x1]
// Read string type
ldrb r1,[r4,0x2]
cmp r1,0x80
blt @@next
// Read string type from buffer
sub r1,0x80
lsl r1,r1,0x2
add r1,0x4C
ldr r1,[r5,r1]
@@next:
// Store old script pointer
add r4,0x3
str r4,[r5,0x44]
// Set new script pointer
mov r4,r0
bl @text_doStringCaps
pop r15
.align 2
text_applyStringCapsRAM:
// Read capitalization bit
ldrb r7,[r0,0x1]
// Read string type
ldrb r1,[r0,0x2]
// Store old script pointer
add r0,0x3
str r0,[r3,0x28]
// Set new script pointer
mov r0,r6
bl @text_doStringCaps
pop r1-r7,r15
.align 2
@text_doStringCaps:
// in: r0 = script pointer, r1 = string type, r7 = capitalization flags
// destroys r2
push r14
// Replace with indefinite article
lsr r2,r7,0x6
bcc @@checkCaps
push r1
mov r1,r0
ldr r3,=file_05290C+0x2
@@checkVowel:
ldrb r2,[r1]
lsl r2,r2,0x2
ldrb r2,[r3,r2]
cmp r2,0xB // 'A'
beq @@printN
cmp r2,0xF // 'E'
beq @@printN
cmp r2,0x13 // 'I'
beq @@printN
cmp r2,0x19 // 'O'
beq @@printN
cmp r2,0x1F // 'U'
beq @@printN
cmp r2,0xFF
bne @@printEmpty
add r1,0x1
b @@checkVowel
@@printN:
mov r2,0x33 // 'n'
strb r2,[r0]
mov r2,0xE5
strb r2,[r0,0x1]
b @@printEnd
@@printEmpty:
mov r2,0xE5
strb r2,[r0]
@@printEnd:
pop r1
@@checkCaps:
// Check if capitalization flags
lsr r2,r7,0x7
// Checks capitalizeAll, always capitalized
bcs @@applyCaps
lsr r2,r7,0x8
// Checks capitalize, depends on string type
bcc @@end
@@checkTypes:
// Check if string type should be capitalized
cmp r1,0x1
ble @@end
cmp r1,0x3
blt @@applyCaps
cmp r1,0x7
ble @@end
cmp r1,0xB
blt @@applyCaps
cmp r1,0xD
ble @@end
cmp r1,0x12
blt @@applyCaps
cmp r1,0x1B
ble @@end
cmp r1,0x1F
blt @@applyCaps
cmp r1,0x37
ble @@end
cmp r1,0x45
blt @@applyCaps
cmp r1,0x46
ble @@end
@@applyCaps:
mov r2,0x0
@@loop:
// Load next character of script
ldrb r1,[r0,r2]
cmp r1,0xE5
beq @@end
@@AtoZ:
cmp r1,0x26 // 'a'
blt @@nextChar
cmp r1,0x3F // 'z'
bgt @@special1
// a-z -> A-Z
sub r1,0x1B
b @@storeChar
// I know, I know...
@@special1:
cmp r1,0x40 // 'ÿ'
bne @@special2
mov r1,0x41 // 'Ÿ'
b @@storeChar
@@special2:
cmp r1,0x46 // 'œ'
bne @@special3
mov r1,0x45 // 'Œ'
b @@storeChar
@@special3:
cmp r1,0x62 // 'ý'
bne @@special4
mov r1,0x68 // 'Ý'
b @@storeChar
@@special4:
cmp r1,0x82 // 'þ'
bne @@special5
mov r1,0x69 // 'Þ'
b @@storeChar
@@special5:
cmp r1,0x6B // 'à'
blt @@nextChar
cmp r1,0x87 // 'ü'
bgt @@nextChar
// a-z -> A-Z
sub r1,0x20
@@storeChar:
strb r1,[r0,r2]
@@nextChar:
// Checks capitalizeAll
lsr r1,r7,0x7
bcc @@end
add r2,0x1
b @@loop
@@end:
pop r15
.pool
| 13.011278 | 71 | 0.640855 |
ca268e23dfa6c6683e0a38972a2c75595565fa7d | 211 | asm | Assembly | libsrc/fcntl/spectrum/plus3/lseek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/fcntl/spectrum/plus3/lseek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/fcntl/spectrum/plus3/lseek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; long fdtell(int fd, long posn, int whence)
;
; Set position in file
;
; Not written as yet!
;
; $Id: lseek.asm,v 1.2 2015/01/21 08:09:27 stefano Exp $
PUBLIC lseek
.lseek
ld hl,-1
ld d,h
ld e,l
ret
| 12.411765 | 56 | 0.630332 |
4ed21c717c6d697fb34eec14fe30905293b33f87 | 2,320 | asm | Assembly | code/6502/lib/inp/nes.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 65 | 2021-07-22T10:32:02.000Z | 2022-03-30T04:42:45.000Z | code/6502/lib/inp/nes.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 5 | 2022-03-29T20:23:57.000Z | 2022-03-30T23:12:42.000Z | code/6502/lib/inp/nes.asm | visrealm/hbc-56 | 9c082946e247e79edc12867299b5b0fda3b6c873 | [
"MIT"
] | 4 | 2021-12-30T17:13:23.000Z | 2022-03-05T09:07:22.000Z | ; 6502 NES Controllers - HBC-56
;
; Copyright (c) 2021 Troy Schrapel
;
; This code is licensed under the MIT license
;
; https://github.com/visrealm/hbc-56
;
!ifndef NES_IO_PORT { NES_IO_PORT = $82
!warn "NES_IO_PORT not provided. Defaulting to ", NES_IO_PORT
}
!ifndef NES_RAM_START { NES_RAM_START = $7ea1
!warn "NES_RAM_START not provided. Defaulting to ", NES_RAM_START
}
; -------------------------
; High RAM
; -------------------------
NES_TMP = NES_RAM_START
NES_RAM_SIZE = 1
!if NES_RAM_END < (NES_RAM_START + NES_RAM_SIZE) {
!error "NES_RAM requires ",NES_RAM_SIZE," bytes. Allocated ",NES_RAM_END - NES_RAM_START
}
; IO Ports
NES1_IO_ADDR = IO_PORT_BASE_ADDRESS | NES_IO_PORT
NES2_IO_ADDR = IO_PORT_BASE_ADDRESS | NES_IO_PORT | $01
NES_RIGHT = %00000001
NES_LEFT = %00000010
NES_DOWN = %00000100
NES_UP = %00001000
NES_START = %00010000
NES_SELECT = %00100000
NES_B = %01000000
NES_A = %10000000
; -----------------------------------------------------------------------------
; nesWaitForPress: Wait for a NES button press (either port)
; -----------------------------------------------------------------------------
nesWaitForPress:
lda NES1_IO_ADDR
cmp #$ff
bne @pressed
lda NES2_IO_ADDR
cmp #$ff
beq nesWaitForPress
@pressed
rts
; -----------------------------------------------------------------------------
; nes1Pressed: Is a button pressed?
; -----------------------------------------------------------------------------
; Inputs:
; A: Button to test
; Outputs:
; Carry set if pressed, Carry clear if not
nes1Pressed:
sta NES_TMP
lda NES1_IO_ADDR
eor #$ff
and NES_TMP
clc
beq +
sec
+
lda NES_TMP
rts
; -----------------------------------------------------------------------------
; nes2Pressed: Is a button pressed?
; -----------------------------------------------------------------------------
; Inputs:
; A: Button to test
; Outputs:
; Carry set if pressed, Carry clear if not
nes2Pressed:
sta NES_TMP
lda NES2_IO_ADDR
eor #$ff
and NES_TMP
clc
beq +
sec
+
lda NES_TMP
rts
| 23.434343 | 89 | 0.475431 |
92fdb03e83dabafe9703ba2716844c3de0918684 | 18,318 | asm | Assembly | hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/x86/hevc_sao.asm | APCVSRepo/android_packet | 5d4237234656b777cd9b0cae4731afea51986582 | [
"BSD-3-Clause"
] | 4 | 2016-09-21T12:36:24.000Z | 2020-10-29T01:45:03.000Z | hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/x86/hevc_sao.asm | APCVSRepo/android_packet | 5d4237234656b777cd9b0cae4731afea51986582 | [
"BSD-3-Clause"
] | 7 | 2016-06-01T01:21:44.000Z | 2017-11-03T08:18:23.000Z | hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/x86/hevc_sao.asm | APCVSRepo/android_packet | 5d4237234656b777cd9b0cae4731afea51986582 | [
"BSD-3-Clause"
] | 8 | 2017-08-29T10:51:50.000Z | 2021-03-24T10:19:11.000Z | ;******************************************************************************
;* SIMD optimized SAO functions for HEVC decoding
;*
;* Copyright (c) 2013 Pierre-Edouard LEPERE
;* Copyright (c) 2014 James Almer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA 32
pw_mask10: times 16 dw 0x03FF
pw_mask12: times 16 dw 0x0FFF
pw_m2: times 16 dw -2
pb_edge_shuffle: times 2 db 1, 2, 0, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
pb_eo: db -1, 0, 1, 0, 0, -1, 0, 1, -1, -1, 1, 1, 1, -1, -1, 1
cextern pw_m1
cextern pw_1
cextern pw_2
cextern pb_1
cextern pb_2
SECTION_TEXT
%define MAX_PB_SIZE 64
%define PADDING_SIZE 32 ; FF_INPUT_BUFFER_PADDING_SIZE
;******************************************************************************
;SAO Band Filter
;******************************************************************************
%macro HEVC_SAO_BAND_FILTER_INIT 1
and leftq, 31
movd xm0, leftd
add leftq, 1
and leftq, 31
movd xm1, leftd
add leftq, 1
and leftq, 31
movd xm2, leftd
add leftq, 1
and leftq, 31
movd xm3, leftd
SPLATW m0, xm0
SPLATW m1, xm1
SPLATW m2, xm2
SPLATW m3, xm3
%if mmsize > 16
SPLATW m4, [offsetq + 2]
SPLATW m5, [offsetq + 4]
SPLATW m6, [offsetq + 6]
SPLATW m7, [offsetq + 8]
%else
movq m7, [offsetq + 2]
SPLATW m4, m7, 0
SPLATW m5, m7, 1
SPLATW m6, m7, 2
SPLATW m7, m7, 3
%endif
%if ARCH_X86_64
%if %1 > 8
mova m13, [pw_mask %+ %1]
%endif
pxor m14, m14
%else ; ARCH_X86_32
mova [rsp+mmsize*0], m0
mova [rsp+mmsize*1], m1
mova [rsp+mmsize*2], m2
mova [rsp+mmsize*3], m3
mova [rsp+mmsize*4], m4
mova [rsp+mmsize*5], m5
mova [rsp+mmsize*6], m6
pxor m0, m0
%if %1 > 8
mova m1, [pw_mask %+ %1]
%endif
%assign MMSIZE mmsize
%define m14 m0
%define m13 m1
%define m9 m2
%define m8 m3
%endif ; ARCH
DEFINE_ARGS dst, src, dststride, srcstride, offset, height
mov heightd, r7m
%endmacro
%macro HEVC_SAO_BAND_FILTER_COMPUTE 3
psraw %2, %3, %1-5
%if ARCH_X86_64
pcmpeqw m10, %2, m0
pcmpeqw m11, %2, m1
pcmpeqw m12, %2, m2
pcmpeqw %2, m3
pand m10, m4
pand m11, m5
pand m12, m6
pand %2, m7
por m10, m11
por m12, %2
por m10, m12
paddw %3, m10
%else ; ARCH_X86_32
pcmpeqw m4, %2, [rsp+MMSIZE*0]
pcmpeqw m5, %2, [rsp+MMSIZE*1]
pcmpeqw m6, %2, [rsp+MMSIZE*2]
pcmpeqw %2, [rsp+MMSIZE*3]
pand m4, [rsp+MMSIZE*4]
pand m5, [rsp+MMSIZE*5]
pand m6, [rsp+MMSIZE*6]
pand %2, m7
por m4, m5
por m6, %2
por m4, m6
paddw %3, m4
%endif ; ARCH
%endmacro
;void ff_hevc_sao_band_filter_<width>_8_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
; int16_t *sao_offset_val, int sao_left_class, int width, int height);
%macro HEVC_SAO_BAND_FILTER_8 2
cglobal hevc_sao_band_filter_%1_8, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left
HEVC_SAO_BAND_FILTER_INIT 8
align 16
.loop
%if %1 == 8
movq m8, [srcq]
punpcklbw m8, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
packuswb m8, m14
movq [dstq], m8
%endif ; %1 == 8
%assign i 0
%rep %2
mova m13, [srcq + i]
punpcklbw m8, m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
punpckhbw m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m13
packuswb m8, m13
mova [dstq + i], m8
%assign i i+mmsize
%endrep
%if %1 == 48
INIT_XMM cpuname
mova m13, [srcq + i]
punpcklbw m8, m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m8
punpckhbw m13, m14
HEVC_SAO_BAND_FILTER_COMPUTE 8, m9, m13
packuswb m8, m13
mova [dstq + i], m8
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif ; %1 == 48
add dstq, dststrideq ; dst += dststride
add srcq, srcstrideq ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
REP_RET
%endmacro
;void ff_hevc_sao_band_filter_<width>_<depth>_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
; int16_t *sao_offset_val, int sao_left_class, int width, int height);
%macro HEVC_SAO_BAND_FILTER_16 3
cglobal hevc_sao_band_filter_%2_%1, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left
HEVC_SAO_BAND_FILTER_INIT %1
align 16
.loop
%if %2 == 8
movu m8, [srcq]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
movu [dstq], m8
%endif
%assign i 0
%rep %3
mova m8, [srcq + i]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
mova [dstq + i], m8
mova m9, [srcq + i + mmsize]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m8, m9
CLIPW m9, m14, m13
mova [dstq + i + mmsize], m9
%assign i i+mmsize*2
%endrep
%if %2 == 48
INIT_XMM cpuname
mova m8, [srcq + i]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
CLIPW m8, m14, m13
mova [dstq + i], m8
mova m9, [srcq + i + mmsize]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m8, m9
CLIPW m9, m14, m13
mova [dstq + i + mmsize], m9
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif ; %1 == 48
add dstq, dststrideq
add srcq, srcstrideq
dec heightd
jg .loop
REP_RET
%endmacro
%macro HEVC_SAO_BAND_FILTER_FUNCS 0
HEVC_SAO_BAND_FILTER_8 8, 0
HEVC_SAO_BAND_FILTER_8 16, 1
HEVC_SAO_BAND_FILTER_8 32, 2
HEVC_SAO_BAND_FILTER_8 48, 2
HEVC_SAO_BAND_FILTER_8 64, 4
HEVC_SAO_BAND_FILTER_16 10, 8, 0
HEVC_SAO_BAND_FILTER_16 10, 16, 1
HEVC_SAO_BAND_FILTER_16 10, 32, 2
HEVC_SAO_BAND_FILTER_16 10, 48, 2
HEVC_SAO_BAND_FILTER_16 10, 64, 4
HEVC_SAO_BAND_FILTER_16 12, 8, 0
HEVC_SAO_BAND_FILTER_16 12, 16, 1
HEVC_SAO_BAND_FILTER_16 12, 32, 2
HEVC_SAO_BAND_FILTER_16 12, 48, 2
HEVC_SAO_BAND_FILTER_16 12, 64, 4
%endmacro
INIT_XMM sse2
HEVC_SAO_BAND_FILTER_FUNCS
INIT_XMM avx
HEVC_SAO_BAND_FILTER_FUNCS
%if HAVE_AVX2_EXTERNAL
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_8 8, 0
HEVC_SAO_BAND_FILTER_8 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_8 32, 1
HEVC_SAO_BAND_FILTER_8 48, 1
HEVC_SAO_BAND_FILTER_8 64, 2
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_16 10, 8, 0
HEVC_SAO_BAND_FILTER_16 10, 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_16 10, 32, 1
HEVC_SAO_BAND_FILTER_16 10, 48, 1
HEVC_SAO_BAND_FILTER_16 10, 64, 2
INIT_XMM avx2
HEVC_SAO_BAND_FILTER_16 12, 8, 0
HEVC_SAO_BAND_FILTER_16 12, 16, 1
INIT_YMM avx2
HEVC_SAO_BAND_FILTER_16 12, 32, 1
HEVC_SAO_BAND_FILTER_16 12, 48, 1
HEVC_SAO_BAND_FILTER_16 12, 64, 2
%endif
;******************************************************************************
;SAO Edge Filter
;******************************************************************************
%define EDGE_SRCSTRIDE 2 * MAX_PB_SIZE + PADDING_SIZE
%macro HEVC_SAO_EDGE_FILTER_INIT 1
%if WIN64
movsxd eoq, dword eom
%elif ARCH_X86_64
movsxd eoq, eod
%else
mov eoq, r4m
%endif
lea tmp2q, [pb_eo]
movsx a_strideq, byte [tmp2q+eoq*4+1]
movsx b_strideq, byte [tmp2q+eoq*4+3]
imul a_strideq, EDGE_SRCSTRIDE>>%1
imul b_strideq, EDGE_SRCSTRIDE>>%1
movsx tmpq, byte [tmp2q+eoq*4]
add a_strideq, tmpq
movsx tmpq, byte [tmp2q+eoq*4+2]
add b_strideq, tmpq
%endmacro
%macro HEVC_SAO_EDGE_FILTER_COMPUTE_8 1
pminub m4, m1, m2
pminub m5, m1, m3
pcmpeqb m2, m4
pcmpeqb m3, m5
pcmpeqb m4, m1
pcmpeqb m5, m1
psubb m4, m2
psubb m5, m3
paddb m4, m6
paddb m4, m5
pshufb m2, m0, m4
%if %1 > 8
punpckhbw m5, m7, m1
punpckhbw m4, m2, m7
punpcklbw m3, m7, m1
punpcklbw m2, m7
pmaddubsw m5, m4
pmaddubsw m3, m2
packuswb m3, m5
%else
punpcklbw m3, m7, m1
punpcklbw m2, m7
pmaddubsw m3, m2
packuswb m3, m3
%endif
%endmacro
;void ff_hevc_sao_edge_filter_<width>_8_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
; int eo, int width, int height);
%macro HEVC_SAO_EDGE_FILTER_8 2-3
%if ARCH_X86_64
cglobal hevc_sao_edge_filter_%1_8, 4, 9, 8, dst, src, dststride, offset, eo, a_stride, b_stride, height, tmp
%define tmp2q heightq
HEVC_SAO_EDGE_FILTER_INIT 0
mov heightd, r6m
%else ; ARCH_X86_32
cglobal hevc_sao_edge_filter_%1_8, 1, 6, 8, dst, src, dststride, a_stride, b_stride, height
%define eoq srcq
%define tmpq heightq
%define tmp2q dststrideq
%define offsetq heightq
HEVC_SAO_EDGE_FILTER_INIT 0
mov srcq, srcm
mov offsetq, r3m
mov dststrideq, dststridem
%endif ; ARCH
%if mmsize > 16
vbroadcasti128 m0, [offsetq]
%else
movu m0, [offsetq]
%endif
mova m1, [pb_edge_shuffle]
packsswb m0, m0
mova m7, [pb_1]
pshufb m0, m1
mova m6, [pb_2]
%if ARCH_X86_32
mov heightd, r6m
%endif
align 16
.loop:
%if %1 == 8
movq m1, [srcq]
movq m2, [srcq + a_strideq]
movq m3, [srcq + b_strideq]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
movq [dstq], m3
%endif
%assign i 0
%rep %2
mova m1, [srcq + i]
movu m2, [srcq + a_strideq + i]
movu m3, [srcq + b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
mov%3 [dstq + i], m3
%assign i i+mmsize
%endrep
%if %1 == 48
INIT_XMM cpuname
mova m1, [srcq + i]
movu m2, [srcq + a_strideq + i]
movu m3, [srcq + b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_8 %1
mova [dstq + i], m3
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif
add dstq, dststrideq
add srcq, EDGE_SRCSTRIDE
dec heightd
jg .loop
RET
%endmacro
%macro PMINUW 4
%if cpuflag(sse4)
pminuw %1, %2, %3
%else
psubusw %4, %2, %3
psubw %1, %2, %4
%endif
%endmacro
%macro HEVC_SAO_EDGE_FILTER_COMPUTE_10 0
PMINUW m4, m1, m2, m6
PMINUW m5, m1, m3, m7
pcmpeqw m2, m4
pcmpeqw m3, m5
pcmpeqw m4, m1
pcmpeqw m5, m1
psubw m4, m2
psubw m5, m3
paddw m4, m5
pcmpeqw m2, m4, [pw_m2]
%if ARCH_X86_64
pcmpeqw m3, m4, m13
pcmpeqw m5, m4, m0
pcmpeqw m6, m4, m14
pcmpeqw m7, m4, m15
pand m2, m8
pand m3, m9
pand m5, m10
pand m6, m11
pand m7, m12
%else
pcmpeqw m3, m4, [pw_m1]
pcmpeqw m5, m4, m0
pcmpeqw m6, m4, [pw_1]
pcmpeqw m7, m4, [pw_2]
pand m2, [rsp+MMSIZE*0]
pand m3, [rsp+MMSIZE*1]
pand m5, [rsp+MMSIZE*2]
pand m6, [rsp+MMSIZE*3]
pand m7, [rsp+MMSIZE*4]
%endif
paddw m2, m3
paddw m5, m6
paddw m2, m7
paddw m2, m1
paddw m2, m5
%endmacro
;void ff_hevc_sao_edge_filter_<width>_<depth>_<opt>(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
; int eo, int width, int height);
%macro HEVC_SAO_EDGE_FILTER_16 3
%if ARCH_X86_64
cglobal hevc_sao_edge_filter_%2_%1, 4, 9, 16, dst, src, dststride, offset, eo, a_stride, b_stride, height, tmp
%define tmp2q heightq
HEVC_SAO_EDGE_FILTER_INIT 1
mov heightd, r6m
add a_strideq, a_strideq
add b_strideq, b_strideq
%else ; ARCH_X86_32
cglobal hevc_sao_edge_filter_%2_%1, 1, 6, 8, 5*mmsize, dst, src, dststride, a_stride, b_stride, height
%assign MMSIZE mmsize
%define eoq srcq
%define tmpq heightq
%define tmp2q dststrideq
%define offsetq heightq
%define m8 m1
%define m9 m2
%define m10 m3
%define m11 m4
%define m12 m5
HEVC_SAO_EDGE_FILTER_INIT 1
mov srcq, srcm
mov offsetq, r3m
mov dststrideq, dststridem
add a_strideq, a_strideq
add b_strideq, b_strideq
%endif ; ARCH
%if cpuflag(avx2)
SPLATW m8, [offsetq+2]
SPLATW m9, [offsetq+4]
SPLATW m10, [offsetq+0]
SPLATW m11, [offsetq+6]
SPLATW m12, [offsetq+8]
%else
movq m10, [offsetq+0]
movd m12, [offsetq+6]
SPLATW m8, xm10, 1
SPLATW m9, xm10, 2
SPLATW m10, xm10, 0
SPLATW m11, xm12, 0
SPLATW m12, xm12, 1
%endif
pxor m0, m0
%if ARCH_X86_64
mova m13, [pw_m1]
mova m14, [pw_1]
mova m15, [pw_2]
%else
mov heightd, r6m
mova [rsp+mmsize*0], m8
mova [rsp+mmsize*1], m9
mova [rsp+mmsize*2], m10
mova [rsp+mmsize*3], m11
mova [rsp+mmsize*4], m12
%endif
align 16
.loop
%if %2 == 8
mova m1, [srcq]
movu m2, [srcq+a_strideq]
movu m3, [srcq+b_strideq]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
movu [dstq], m2
%endif
%assign i 0
%rep %3
mova m1, [srcq + i]
movu m2, [srcq+a_strideq + i]
movu m3, [srcq+b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i], m2
mova m1, [srcq + i + mmsize]
movu m2, [srcq+a_strideq + i + mmsize]
movu m3, [srcq+b_strideq + i + mmsize]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i + mmsize], m2
%assign i i+mmsize*2
%endrep
%if %2 == 48
INIT_XMM cpuname
mova m1, [srcq + i]
movu m2, [srcq+a_strideq + i]
movu m3, [srcq+b_strideq + i]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i], m2
mova m1, [srcq + i + mmsize]
movu m2, [srcq+a_strideq + i + mmsize]
movu m3, [srcq+b_strideq + i + mmsize]
HEVC_SAO_EDGE_FILTER_COMPUTE_10
CLIPW m2, m0, [pw_mask %+ %1]
mova [dstq + i + mmsize], m2
%if cpuflag(avx2)
INIT_YMM cpuname
%endif
%endif
add dstq, dststrideq
add srcq, EDGE_SRCSTRIDE
dec heightd
jg .loop
RET
%endmacro
INIT_XMM ssse3
HEVC_SAO_EDGE_FILTER_8 8, 0
HEVC_SAO_EDGE_FILTER_8 16, 1, a
HEVC_SAO_EDGE_FILTER_8 32, 2, a
HEVC_SAO_EDGE_FILTER_8 48, 2, a
HEVC_SAO_EDGE_FILTER_8 64, 4, a
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
HEVC_SAO_EDGE_FILTER_8 32, 1, a
HEVC_SAO_EDGE_FILTER_8 48, 1, u
HEVC_SAO_EDGE_FILTER_8 64, 2, a
%endif
INIT_XMM sse2
HEVC_SAO_EDGE_FILTER_16 10, 8, 0
HEVC_SAO_EDGE_FILTER_16 10, 16, 1
HEVC_SAO_EDGE_FILTER_16 10, 32, 2
HEVC_SAO_EDGE_FILTER_16 10, 48, 2
HEVC_SAO_EDGE_FILTER_16 10, 64, 4
HEVC_SAO_EDGE_FILTER_16 12, 8, 0
HEVC_SAO_EDGE_FILTER_16 12, 16, 1
HEVC_SAO_EDGE_FILTER_16 12, 32, 2
HEVC_SAO_EDGE_FILTER_16 12, 48, 2
HEVC_SAO_EDGE_FILTER_16 12, 64, 4
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
HEVC_SAO_EDGE_FILTER_16 10, 32, 1
HEVC_SAO_EDGE_FILTER_16 10, 48, 1
HEVC_SAO_EDGE_FILTER_16 10, 64, 2
HEVC_SAO_EDGE_FILTER_16 12, 32, 1
HEVC_SAO_EDGE_FILTER_16 12, 48, 1
HEVC_SAO_EDGE_FILTER_16 12, 64, 2
%endif
| 29.3088 | 129 | 0.530134 |
76e3e340d6b282bc4a5634ce4886227cfd39cb78 | 2,103 | asm | Assembly | master/gr_common/core/utility/T4_src/checksum/rx/cksum_rx_little.asm | tarosay/v2wrbbfirm | 651ff977c7919b55dcfc77cc23f94edfec2782b8 | [
"MIT"
] | null | null | null | master/gr_common/core/utility/T4_src/checksum/rx/cksum_rx_little.asm | tarosay/v2wrbbfirm | 651ff977c7919b55dcfc77cc23f94edfec2782b8 | [
"MIT"
] | null | null | null | master/gr_common/core/utility/T4_src/checksum/rx/cksum_rx_little.asm | tarosay/v2wrbbfirm | 651ff977c7919b55dcfc77cc23f94edfec2782b8 | [
"MIT"
] | null | null | null | .ifdef __RX
.SECTION P,CODE
.glb __cksum
.else
.file "cksum_rx_little.asm"
.section .text.ck
.global __cksum
.endif
__cksum: ; function: _cksum
.ifdef __RX
.stack __cksum=4
.else
;uint16 _cksum(uchar *data, uint16 nbytes, uint16 sum0);
and #0ffffh, r2 ;arg2 uint16
and #0ffffh, r3 ;arg3 uint16
.endif
cmp #0, r2
beq CKSUM_ZERO_EXIT
btst #0, r1
beq CKSUM_EVEN
; data is odd
add #-1, r1
movu.w [r1+], r4
revw r3, r3
revw r4, r4
and #0ffH, r4
revw r4, r4
add r4, r3
add #-1, r2
shlr #3, r2, r15
beq CKSUM_ODD_NEXT4
?:
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
movu.w [r1+], r5
add r4, r3
movu.w [r1+], r4
add r5, r3
add r4, r3
sub #1, r15
bne ?-
CKSUM_ODD_NEXT4:
btst #2, r2
beq CKSUM_ODD_NEXT2
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
add r4, r3
CKSUM_ODD_NEXT2:
btst #1, r2
beq CKSUM_ODD_NEXT1
movu.w [r1+], r5
add r5, r3
CKSUM_ODD_NEXT1:
btst #0, r2
beq CKSUM_ODD_NBYTES_NOT_ODD
movu.w [r1], r5
revw r5, r5
and #0ff00H, r5
revw r5, r5
add r5, r3
CKSUM_ODD_NBYTES_NOT_ODD:
mov.l #0000ffffh, r4
shlr #16, r3, r5
and r4, r3
add r5, r3
shlr #16, r3, r5
and r4, r3
add r5, r3
revw r3, r1
revw r1, r1
not r1
movu.w r1, r1
rts
CKSUM_EVEN:
shlr #3, r2, r15
beq CKSUM_EVEN_NEXT4
?:
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
movu.w [r1+], r5
add r4, r3
movu.w [r1+], r4
add r5, r3
add r4, r3
sub #1, r15
bne ?-
CKSUM_EVEN_NEXT4:
btst #2, r2
beq CKSUM_EVEN_NEXT2
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
add r4, r3
CKSUM_EVEN_NEXT2:
btst #1, r2
beq CKSUM_EVEN_NEXT1
movu.w [r1+], r5
add r5, r3
CKSUM_EVEN_NEXT1:
btst #0, r2
beq CKSUM_EVEN_NBYTES_NOT_ODD
movu.w [r1], r5
revw r5, r5
and #0ff00H, r5
revw r5, r5
add r5, r3
CKSUM_EVEN_NBYTES_NOT_ODD:
mov.l #0000ffffh, r4
shlr #16, r3, r5
and r4, r3
add r5, r3
shlr #16, r3, r5
and r4, r3
add r5, r3
CKSUM_EXIT:
revw r3, r3
not r3
movu.w r3, r1
rts
CKSUM_ZERO_EXIT:
revw r3, r3
not r3, r1
movu.w r1, r1
rts
.end
| 11.881356 | 56 | 0.612458 |
62a60ddea3536856260d07f1255bddc02771a992 | 6,637 | asm | Assembly | 2021-04-03-smallest-possible-container/asm/string.asm | huutuanit/dockercomposeexample | 2c43da0c2471ef4a32984c900885b9f13eb8229f | [
"MIT"
] | 181 | 2020-08-31T21:42:40.000Z | 2022-03-23T07:25:26.000Z | 2021-04-03-smallest-possible-container/asm/string.asm | cola-boya/devops-directive | 8330e6d1237970bc8a452776f8c3837a667e3f68 | [
"MIT"
] | null | null | null | 2021-04-03-smallest-possible-container/asm/string.asm | cola-boya/devops-directive | 8330e6d1237970bc8a452776f8c3837a667e3f68 | [
"MIT"
] | 167 | 2020-09-16T02:09:58.000Z | 2022-03-31T18:09:43.000Z | ;asmttpd - Web server for Linux written in amd64 assembly.
;Copyright (C) 2014 nemasu <nemasu@gmail.com>
;
;This file is part of asmttpd.
;
;asmttpd 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, either version 2 of the License, or
;(at your option) any later version.
;
;asmttpd is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with asmttpd. If not, see <http://www.gnu.org/licenses/>.
string_itoa:; rdi - buffer, rsi - int
stackpush
push rcx
push rbx
xchg rdi, rsi
call get_number_of_digits
xchg rdi, rsi
mov rcx, rax ;
;add null
mov al, 0x0
mov [rdi+rcx], al
dec rcx
mov rax, rsi ; value to print
xor rdx, rdx ; zero other half
mov rbx, 10
string_itoa_start:
xor rdx, rdx ; zero other half
div rbx ; divide by 10
add rdx, 0x30
mov [rdi+rcx], dl
dec rcx
cmp rax, 9
ja string_itoa_start
cmp rcx, 0
jl string_itoa_done
add rax, 0x30 ;last digit
mov [rdi+rcx], al
string_itoa_done:
pop rbx
pop rcx
stackpop
ret
string_atoi: ; rdi = string, rax = int
stackpush
mov r8, 0 ; ;return
call get_string_length
mov r10, rax ; length
cmp rax, 0
je string_atoi_ret_empty
mov r9, 1 ; multiplier
dec r10
string_atoi_loop:
xor rbx, rbx
mov bl, BYTE [rdi+r10]
sub bl, 0x30 ;get byte, subtract to get real from ascii value
mov rax, r9
mul rbx ; multiply value by multiplier
add r8, rax ; add result to running total
dec r10 ; next digit
mov rax, 10 ; multiply r9 ( multiplier ) by 10
mul r9
mov r9, rax
cmp r10, -1
jne string_atoi_loop
jmp string_atoi_ret
string_atoi_ret_empty:
mov rax, -1
stackpop
ret
string_atoi_ret:
mov rax, r8
stackpop
ret
string_copy: ; rdi = dest, rsi = source, rdx = bytes to copy
stackpush
mov rcx, rdx
inc rcx ; to get null
cld
rep movsb
stackpop
ret
string_concat_int: ;rdi = string being added to, rsi = int to add, ret: new length
stackpush
call get_string_length
add rdi, rax
call string_itoa
call get_string_length
stackpop
ret
string_concat: ;rdi = string being added to, rsi = string to add, ret: new length
stackpush
call get_string_length
add rdi, rax ; Go to end of string
mov r10, rax
;Get length of source ie. bytes to copy
push rdi
mov rdi, rsi
call get_string_length
inc rax ; null
mov rcx, rax
add r10, rax
pop rdi
rep movsb
mov rax, r10
stackpop
ret
string_contains: ;rdi = haystack, rsi = needle, ret = rax: location of string, else -1
stackpush
xor r10, r10 ; total length from beginning
xor r8, r8 ; count from offset
string_contains_start:
mov dl, BYTE [rdi]
cmp dl, 0x00
je string_contains_ret_no
cmp dl, BYTE [rsi]
je string_contains_check
inc rdi
inc r10 ; count from base ( total will be r10 + r8 )
jmp string_contains_start
string_contains_check:
inc r8 ; already checked at pos 0
cmp BYTE [rsi+r8], 0x00
je string_contains_ret_ok
mov dl, [rdi+r8]
cmp dl ,0x00
je string_contains_ret_no
cmp dl, [rsi+r8]
je string_contains_check
inc rdi
inc r10
xor r8, r8
jmp string_contains_start
string_contains_ret_ok:
mov rax, r10
jmp string_contains_ret
string_contains_ret_no:
mov rax, -1
string_contains_ret:
stackpop
ret
;Removes first instance of string
string_remove: ;rdi = source, rsi = string to remove, ret = 1 for removed, 0 for not found
stackpush
mov r9, 0 ; return flag
call get_string_length
mov r8, rax ; r8: source length
cmp r8, 0
mov rax, 0
jle string_remove_ret ; source string empty?
push rdi
mov rdi, rsi
call get_string_length
mov r10, rax ; r10: string to remove length
pop rdi
cmp r10, 0
mov rax, 0
jle string_remove_ret ; string to remove is blank?
string_remove_start:
call string_contains
cmp rax,-1
je string_remove_ret
;Shift source string over
add rdi, rax
mov rsi, rdi
add rsi, r10 ; copying to itself sans found string
cld
string_remove_do_copy:
lodsb
stosb
cmp al, 0x00
jne string_remove_do_copy
mov r9, 1
string_remove_ret:
mov rax, r9
stackpop
ret
string_ends_with:;rdi = haystack, rsi = needle, ret = rax: 0 false, 1 true
stackpush
;Get length of haystack, store in r8
call get_string_length
mov r8, rax
;Get length of needle, store in r10
push rdi
mov rdi, rsi
call get_string_length
mov r10, rax
pop rdi
add rdi, r8
add rsi, r10
xor rax, rax
xor rdx, rdx
string_ends_with_loop:
;Start from end, dec r10 till 0
mov dl, BYTE [rdi]
cmp dl, BYTE [rsi]
jne string_ends_with_ret
dec rdi
dec rsi
dec r10
cmp r10, 0
jne string_ends_with_loop
mov rax, 1
string_ends_with_ret:
stackpop
ret
string_char_at_reverse: ;rdi = haystack, rsi = count from end, rdx = character(not pointer), ret = rax: 0 false, 1 true
stackpush
inc rsi ; include null
call get_string_length
add rdi, rax ; go to end
sub rdi, rsi ; subtract count
mov rax, 0 ; set return to false
cmp dl, BYTE [rdi] ; compare rdx(dl)
jne string_char_at_reverse_ret
mov rax, 1
string_char_at_reverse_ret:
stackpop
ret
print_line: ; rdi = pointer, rsi = length
stackpush
call sys_write
mov rdi, new_line
mov rsi, 1
call sys_write
stackpop
ret
get_string_length: ; rdi = pointer, ret rax
stackpush
cld
mov r10, -1
mov rsi, rdi
get_string_length_start:
inc r10
lodsb
cmp al, 0x00
jne get_string_length_start
mov rax, r10
stackpop
ret
get_number_of_digits: ; of rdi, ret rax
stackpush
push rbx
push rcx
mov rax, rdi
mov rbx, 10
mov rcx, 1 ;count
gnod_cont:
cmp rax, 10
jb gnod_ret
xor rdx,rdx
div rbx
inc rcx
jmp gnod_cont
gnod_ret:
mov rax, rcx
pop rcx
pop rbx
stackpop
ret
| 20.234756 | 119 | 0.642007 |
9ca59bae5904c8a219dd84dffa3c0a488e3a7331 | 1,419 | asm | Assembly | test/shrd.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 147 | 2021-09-01T03:52:49.000Z | 2022-03-30T16:59:58.000Z | test/shrd.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 9 | 2021-09-15T18:04:36.000Z | 2021-09-28T01:22:15.000Z | test/shrd.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 19 | 2021-09-09T10:54:44.000Z | 2022-03-18T19:56:45.000Z | SECTION .text
GLOBAL test
test:
shrd rax, rax, 0
shrd rax, rax, 1
shrd rax, rax, 2
shrd rax, rax, 3
shrd rax, rax, 4
shrd rax, rax, 5
shrd rax, rax, 6
shrd rax, rax, 7
shrd rax, rax, 8
shrd rax, rax, 9
shrd rax, rax, 10
shrd rax, rax, 11
shrd rax, rax, 12
shrd rax, rax, 13
shrd rax, rax, 14
shrd rax, rax, 15
shrd rax, rbx, 16
shrd rax, rbx, 17
shrd rax, rbx, 18
shrd rax, rbx, 19
shrd rax, rbx, 20
shrd rax, rbx, 21
shrd rax, rbx, 22
shrd rax, rbx, 23
shrd rax, rbx, 24
shrd rax, rbx, 25
shrd rax, rbx, 26
shrd rax, rbx, 27
shrd rax, rbx, 28
shrd rax, rbx, 29
shrd rax, rbx, 30
shrd rax, rbx, 31
shrd rax, rcx, 32
shrd rax, rcx, 33
shrd rax, rcx, 34
shrd rax, rcx, 35
shrd rax, rcx, 36
shrd rax, rcx, 37
shrd rax, rcx, 38
shrd rax, rcx, 39
shrd rax, rcx, 40
shrd rax, rcx, 41
shrd rax, rcx, 42
shrd rax, rcx, 43
shrd rax, rcx, 44
shrd rax, rcx, 45
shrd rax, rcx, 46
shrd rax, rcx, 47
shrd rax, rdx, 48
shrd rax, rdx, 49
shrd rax, rdx, 50
shrd rax, rdx, 51
shrd rax, rdx, 52
shrd rax, rdx, 53
shrd rax, rdx, 54
shrd rax, rdx, 55
shrd rax, rdx, 56
shrd rax, rdx, 57
shrd rax, rdx, 58
shrd rax, rdx, 59
shrd rax, rdx, 60
shrd rax, rdx, 61
shrd rax, rdx, 62
shrd rax, rdx, 63
shrd r10, r11, 51
shrd r12, r15, 51
shrd r12, r8, 51
shrd r12, rbx, 51
shrd r12, rdx, 51
shrd r14, rcx, 51
shrd r15, rbp, 51
shrd r8, r13, 51
shrd r8, rcx, 51
shrd r8, rdx, 51
shrd r9, r8, 51
shrd rax, rbp, 51
shrd rbp, r15, 51
shrd rcx, r8, 51
| 17.304878 | 17 | 0.665257 |
d71a5353486a7c78633f12e0fa036578d8663fd5 | 344 | asm | Assembly | programs/oeis/134/A134770.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/134/A134770.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/134/A134770.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A134770: a(n) = 4*A000984(n) - 3.
; 1,5,21,77,277,1005,3693,13725,51477,194477,739021,2821725,10816621,41602397,160466397,620470077,2404321557,9334424877,36300541197,141381055197,551386115277,2153031497757,8416395854877,32933722910397,128990414732397,505642425751005,1983674131792413
mov $1,2
mul $1,$0
bin $1,$0
mul $1,4
sub $1,3
mov $0,$1
| 34.4 | 249 | 0.784884 |
1c551e7c55ea9cfc77b1009a7c8a5c69ea846add | 209 | asm | Assembly | libsrc/psg/vt2/ay_vt2_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/psg/vt2/ay_vt2_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/psg/vt2/ay_vt2_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
IF !__CPU_INTEL__ && !__CPU_GBZ80__
SECTION code_psg
PUBLIC ay_vt2_init
PUBLIC _ay_vt2_init
EXTERN asm_VT_INIT
ay_vt2_init:
_ay_vt2_init:
push ix
push iy
call asm_VT_INIT
pop iy
pop ix
ret
ENDIF
| 11 | 35 | 0.779904 |
bd40403e2377cf5f69027408da5e1a9a8a43c0a3 | 844 | asm | Assembly | src/test/ref/struct-35.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/struct-35.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/struct-35.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Minimal struct with C-Standard behavior - copy assignment through struct pointer
// Commodore 64 PRG executable file
.file [name="struct-35.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.const SIZEOF_STRUCT_POINT = 2
.const OFFSET_STRUCT_POINT_Y = 1
.label SCREEN = $400
.segment Code
main: {
.label p2 = point2
// *p2 = point1
ldy #SIZEOF_STRUCT_POINT
!:
lda point1-1,y
sta p2-1,y
dey
bne !-
// SCREEN[0] = point2.x
lda point2
sta SCREEN
// SCREEN[1] = point2.y
lda point2+OFFSET_STRUCT_POINT_Y
sta SCREEN+1
// }
rts
}
.segment Data
point1: .byte 2, 3
point2: .fill SIZEOF_STRUCT_POINT, 0
| 24.114286 | 83 | 0.671801 |
39492188f7e2e38c0a55b8c4b8d0c3340086e675 | 60 | asm | Assembly | gfx/pokemon/diglett/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/diglett/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/diglett/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | setrepeat 2
frame 0, 05
frame 4, 08
dorepeat 1
endanim
| 10 | 12 | 0.7 |
b43c43c3243b25311af22d341dc0a64d91acae59 | 66 | asm | Assembly | C vs Assembly/print an integer.asm | zakarialaoui10/HIGH-TO-LOW | 6fba545110b1188e1afc72c414fbf4f48f780070 | [
"MIT"
] | 18 | 2021-07-21T11:01:04.000Z | 2022-01-19T03:38:41.000Z | C vs Assembly/print an integer.asm | zakarialaoui10/HIGH-TO-LOW | 6fba545110b1188e1afc72c414fbf4f48f780070 | [
"MIT"
] | null | null | null | C vs Assembly/print an integer.asm | zakarialaoui10/HIGH-TO-LOW | 6fba545110b1188e1afc72c414fbf4f48f780070 | [
"MIT"
] | 1 | 2021-06-25T19:48:30.000Z | 2021-06-25T19:48:30.000Z | .data
number: .word 2
.text
li $v0,1
lw $a0,number
syscall
| 8.25 | 16 | 0.621212 |
d041c6284dedde3eb64d6ab469721b59d8043703 | 536 | asm | Assembly | programs/oeis/179/A179865.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/179/A179865.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/179/A179865.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A179865: Number of n-bit binary numbers containing one run of 0's.
; 1,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276,300,325,351,378,406,435,465,496,528,561,595,630,666,703,741,780,820,861,903,946,990,1035,1081,1128,1176,1225,1275,1326,1378,1431,1485,1540,1596,1653,1711,1770,1830,1891,1953,2016,2080,2145,2211,2278,2346,2415,2485,2556,2628,2701,2775,2850,2926,3003,3081,3160,3240,3321,3403,3486,3570,3655,3741,3828,3916,4005,4095,4186,4278,4371,4465,4560,4656,4753,4851,4950
trn $0,1
add $0,2
bin $0,2
| 76.571429 | 438 | 0.753731 |
cfdab512c9aac0cf9662b3852877260b415281ad | 1,155 | asm | Assembly | libsrc/z88/fdstdio/fdfgetc.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | 1 | 2018-09-04T23:07:24.000Z | 2018-09-04T23:07:24.000Z | libsrc/z88/fdstdio/fdfgetc.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/z88/fdstdio/fdfgetc.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;
; Small C z88 File functions
; Written by Dominic Morris <djm@jb.man.ac.uk>
; 22 August 1998 ** UNTESTED **
;
; *** THIS IS A Z88 SPECIFIC ROUTINE!!! ***
;
; 11/3/99 Fixed for stdin
;
; 22/3/2000 Now calls getchar() for stdin stuff instead of doing
; os_in itself
INCLUDE "#fileio.def"
INCLUDE "#stdio.def"
INCLUDE "libdefs.def"
XLIB fdfgetc
LIB fgetc_cons
LIB fhand_ck
;fgetc(fp)
;FILE *fp
;on stack
;return address,fp
;fp=filepointer
;
;fgetc - read byte from file - also handles stdin
.fdfgetc
ld hl,2
add hl,sp
ld e,(hl)
inc hl
ld d,(hl)
ld a,d
or e
jp nz,fgetc1
.fgetc_abort
ld hl,EOF
ret
.fgetc1
call fhand_ck
jr nz,fgetc_file
ld hl,stdin
and a
sbc hl,de
jp nz,fgetc_abort
jp fgetc_cons
.fgetc_file
push de
pop ix
call_oz(os_gb)
jp c,fgetc_abort
ld l,a
ld h,0
ret
| 18.629032 | 64 | 0.481385 |
062e834639144e5c1af059fc9d9877917b65e340 | 5,028 | asm | Assembly | Transynther/x86/_processed/US/_st_zr_un_/i7-7700_9_0x48_notsx.log_6532_753.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_st_zr_un_/i7-7700_9_0x48_notsx.log_6532_753.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_st_zr_un_/i7-7700_9_0x48_notsx.log_6532_753.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 %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1cd7f, %r15
nop
cmp %rbp, %rbp
vmovups (%r15), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r12
nop
nop
sub $64767, %r15
lea addresses_WT_ht+0x1c63f, %rsi
nop
nop
add %r12, %r12
movl $0x61626364, (%rsi)
nop
nop
xor $55199, %rbp
lea addresses_normal_ht+0x863f, %rsi
lea addresses_UC_ht+0x463f, %rdi
nop
nop
nop
nop
and %rdx, %rdx
mov $5, %rcx
rep movsb
xor $27648, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r9
push %rax
push %rbx
push %rcx
// Store
mov $0x63f, %rax
nop
nop
nop
nop
nop
add $33727, %r9
mov $0x5152535455565758, %r14
movq %r14, %xmm4
vmovntdq %ymm4, (%rax)
nop
nop
nop
nop
nop
dec %r14
// Faulty Load
lea addresses_US+0x6e3f, %r13
add %rcx, %rcx
movups (%r13), %xmm3
vpextrq $0, %xmm3, %rbx
lea oracles, %r14
and $0xff, %rbx
shlq $12, %rbx
mov (%r14,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_US', 'congruent': 0}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_P', 'congruent': 9}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_US', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 2}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': True, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}}
{'50': 172, 'd4': 1, '00': 3800, '1a': 20, 'f6': 1, '32': 2530, '7f': 8}
32 00 32 00 00 00 32 32 32 50 32 32 00 32 00 32 00 32 50 32 00 00 32 32 00 32 00 00 00 00 00 00 00 00 00 32 00 32 00 00 00 32 00 00 00 00 32 00 32 50 32 00 00 32 00 32 50 32 32 00 32 00 32 00 00 00 00 32 00 00 32 32 32 32 00 32 32 32 00 00 00 32 00 00 32 32 32 00 50 00 50 00 32 32 00 00 00 32 32 00 00 32 32 00 00 00 32 00 00 32 00 00 00 00 00 00 00 00 32 00 32 00 32 00 00 32 00 00 00 00 00 32 00 00 00 00 00 32 00 00 00 00 32 32 32 32 00 00 32 00 00 00 00 00 00 00 00 00 32 32 00 00 00 00 00 00 00 00 00 32 00 00 00 32 00 32 00 32 00 00 32 32 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 32 00 32 00 00 00 00 00 00 00 00 32 32 32 32 00 32 00 32 00 32 32 00 00 00 00 00 00 00 00 32 00 00 32 00 00 32 32 00 00 00 00 00 00 00 00 00 32 32 00 32 32 32 32 00 00 32 00 32 32 32 00 00 32 32 32 00 32 00 32 32 32 00 00 32 32 32 32 32 00 32 00 32 00 32 32 00 32 32 00 32 32 00 00 32 32 00 00 00 32 32 32 32 00 32 00 32 32 32 32 00 00 00 32 32 00 32 00 00 32 32 00 00 32 00 32 32 32 32 32 00 32 00 32 32 00 00 32 32 32 32 32 32 00 00 32 00 00 00 50 32 00 32 32 32 32 32 00 32 00 00 32 00 32 32 32 50 00 00 00 00 32 32 00 00 00 32 00 00 32 32 32 32 00 00 32 00 32 32 32 00 00 32 32 32 32 32 00 32 32 00 00 50 32 00 00 32 00 00 00 32 00 32 00 00 32 32 00 7f 32 32 32 32 00 32 00 32 00 32 32 32 00 00 32 00 32 32 32 00 00 32 32 00 32 32 00 32 32 00 00 32 32 32 00 32 32 00 00 32 32 32 32 00 50 00 32 00 32 32 32 00 32 32 00 00 32 00 00 32 32 32 00 32 32 00 00 00 00 50 00 32 00 00 00 00 32 32 00 00 32 32 00 32 00 50 00 00 32 00 32 50 00 00 32 00 00 00 00 00 32 00 00 00 00 00 32 00 00 32 32 00 00 32 32 00 00 50 32 00 32 32 00 32 32 32 00 00 00 32 32 32 32 32 00 32 00 00 00 00 00 00 00 00 00 00 00 32 32 00 32 00 00 32 32 00 32 00 32 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 32 00 00 32 00 00 00 50 00 00 00 00 00 00 32 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 32 00 32 00 00 00 32 00 00 32 32 00 32 32 32 00 32 32 32 00 32 00 32 00 32 32 00 32 00 00 32 00 00 32 32 32 00 32 32 32 00 00 32 32 32 32 00 00 00 32 32 00 00 00 00 00 00 00 32 32 1a 00 00 32 00 00 00 32 32 32 00 00 d4 32 50 00 32 32 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 32 32 32 00 00 32 32 32 00 00 00 32 00 32 00 00 32 32 00 00 32 00 32 00 32 00 32 32 32 32 32 32 32 00 32 00 00 32 00 50 00 32 32 00 32 32 32 00 32 32 32 00 00 00 32 32 32 00 32 00 00 1a 00 32 32 00 00 00 00 32 00 32 00 32 32 32 32 32 00 32 32 32 00 32 00 32 00 00 00 00 00 32 32 50 00 32 00 32 32 32 32 32 00 00 32 32 32 32 32 32 32 00 32 00 32 50 00 00 32 00 00 00 00 00 00 00 00 00 00 32 00 32 00 00 32 32 00 00 00 00 00 00 00 00 00 00 00 50 32 00 00 00 00 00 00 00 00 32 32 32 00 32 32 00 00 00 32 32 32 32 32 00 00 00 32 00 00 32 00 00 00 00 00 00 00 00 00 50 32 32 32 50 1a 32 00 00 32 32 32 32 00 50 32 32 32 32 32 32 00 32 32 32 00 32 32 50 32 00 32 32 00 50 32 00 32 32 32 32 32 00 32 32 32 32 00 00 32 32 00 32 00 32 00 32 32 50 00 32 00 00 00 00 00 32 32 32 32 50 00 00 00 00 00 00 00 00 00 32 32 32 00 00 00 00 00 00 32 00 00
*/
| 46.555556 | 2,999 | 0.657518 |
55630ffeaf66044109fb821ef2938849add95b94 | 463 | asm | Assembly | programs/oeis/135/A135908.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135908.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/135/A135908.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A135908: Clique number of commuting graph of symmetric group S_n.
; 0,0,0,2,3,5,8,11,17,26,35,53,80,107,161,242,323,485,728,971,1457,2186,2915,4373,6560,8747,13121,19682,26243,39365,59048,78731,118097,177146,236195,354293,531440,708587,1062881,1594322,2125763,3188645,4782968,6377291,9565937
lpb $0,1
sub $0,1
mov $3,$0
pow $3,4
lpb $3,1
mov $0,$3
mov $3,$2
lpe
lpe
cal $0,792 ; a(n) = max{(n - i)*a(i) : i < n}; a(0) = 1.
mov $1,$0
sub $1,1
| 28.9375 | 225 | 0.658747 |
6dccb49d921f8904463be678481b3226fd8034c7 | 553 | asm | Assembly | programs/oeis/060/A060872.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/060/A060872.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/060/A060872.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A060872: Sum of d*d' over all unordered pairs (d,d') with d*d' = n.
; 1,2,3,8,5,12,7,16,18,20,11,36,13,28,30,48,17,54,19,60,42,44,23,96,50,52,54,84,29,120,31,96,66,68,70,180,37,76,78,160,41,168,43,132,135,92,47,240,98,150,102,156,53,216,110,224,114,116,59,360,61,124,189,256,130,264,67,204,138,280,71,432,73,148,225,228,154,312,79,400,243,164,83,504,170,172,174,352,89,540,182,276,186,188,190,576,97,294,297,500
mov $1,1
add $1,$0
seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
add $0,1
div $0,2
mul $1,$0
mov $0,$1
| 50.272727 | 343 | 0.667269 |
b84b0499f022dc978dd11f991deebad26ed032d0 | 308 | asm | Assembly | src/boot/switch_to_pm.asm | hculpan/hoss | c45dad85df20f72f834e56682407d2d8344e7424 | [
"MIT"
] | null | null | null | src/boot/switch_to_pm.asm | hculpan/hoss | c45dad85df20f72f834e56682407d2d8344e7424 | [
"MIT"
] | 2 | 2020-07-16T18:30:03.000Z | 2021-05-08T05:17:08.000Z | src/boot/switch_to_pm.asm | hculpan/hoss | c45dad85df20f72f834e56682407d2d8344e7424 | [
"MIT"
] | null | null | null | [bits 16]
switch_to_pm:
cli
lgdt [gdt_descriptor]
mov eax, cr0
or eax, 0x1
mov cr0, eax
jmp CODE_SEG:init_pm
[bits 32]
init_pm:
mov ax, DATA_SEG
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, 0x90000
mov esp, ebp
call BEGIN_PM | 12.833333 | 25 | 0.577922 |
c57b510474041ecd8196b31dcc2525dbdf67e531 | 482 | asm | Assembly | programs/oeis/280/A280050.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/280/A280050.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/280/A280050.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A280050: a(n) = Sum_{k=2..n} k/lpf(k), where lpf(k) is the least prime dividing k (A020639).
; 0,1,2,4,5,8,9,13,16,21,22,28,29,36,41,49,50,59,60,70,77,88,89,101,106,119,128,142,143,158,159,175,186,203,210,228,229,248,261,281,282,303,304,326,341,364,365,389,396,421,438,464,465,492,503,531,550,579,580,610,611,642,663,695,708,741,742,776,799,834,835
lpb $0
mov $2,$0
sub $0,1
seq $2,32742 ; a(1) = 1; for n > 1, a(n) = largest proper divisor of n.
add $1,$2
lpe
mov $0,$1
| 43.818182 | 255 | 0.649378 |
a81378bf8661ede26a2979b082871445b3c82f92 | 1,643 | asm | Assembly | Assignment 4/recursive_factorial.asm | sidarthshahri/Computer-Architecture-and-Design | 6abef46d85e6cf3e5bce071acbe4c061fbde990c | [
"MIT"
] | null | null | null | Assignment 4/recursive_factorial.asm | sidarthshahri/Computer-Architecture-and-Design | 6abef46d85e6cf3e5bce071acbe4c061fbde990c | [
"MIT"
] | null | null | null | Assignment 4/recursive_factorial.asm | sidarthshahri/Computer-Architecture-and-Design | 6abef46d85e6cf3e5bce071acbe4c061fbde990c | [
"MIT"
] | 4 | 2021-10-05T04:38:42.000Z | 2022-02-09T18:58:25.000Z | # $a0 = array base address
# $a1 = n
# $s0 = n!
Main:
addi $a0, $0, 0x100 # array base address = 0x100
addi $a1, $0, 0 # i = 0
addi $t0, $0, 3 # store 3 for use in for loop
addi $t1, $0, 50 # $t1 = 50
CreateArray_Loop:
slt $t2, $a1, $t1 # i < 50?
beq $t2, $0, Exit_Loop # if not then exit loop
sll $t2, $a1, 2 # $t2 = i * 4 (byte offset)
add $t2, $t2, $a0 # address of array[i]
mult $a1, $t0
mflo $t3 # $t3 = i * 3
sw $t3, 0($t2) # save array[i]
addi $a1, $a1, 1 # i = i + 1
j CreateArray_Loop
Exit_Loop:
# n = (my_array[25] + my_array[30])/30
lw $t0, 100($a0) # loading my_array[25]
lw $t1, 120($a0) # loading my_array[30]
add $a1, $t0, $t1 # add my_array[25] and my_array[30]
ori $t0, $0, 30 # load imm 30 for division
div $a1, $t0 # divide n by 30
mflo $a1 # store result into n = 5
# factorial computation
jal factorial # call procedure
add $s0, $v0, $0 # return value
j end
factorial:
addi $sp, $sp, -8 # make room on the stack
sw $a1, 4($sp) # store $a1
sw $ra, 0($sp) # store $ra
addi $t0, $0, 2 # $t0 = 2
slt $t0, $a1, $t0 # n <= 1?
beq $t0, $0, else # no: go to else (recursion)
addi $v0, $0, 1 # yes: return 1
addi $sp, $sp, 8 # restore $sp
jr $ra # return
else: addi $a1, $a1, -1 # n = n -1
jal factorial # recursive call
lw $ra, 0($sp) # restore return address
lw $a1, 4($sp) # restore input
addi $sp, $sp, 8 # restore $sp
mul $v0, $a1, $v0 # n * factorial(n-1)
jr $ra # return
end: sw $a1, 0($0) # store n in 0x00
sh $s0, 10($0) # store n! in 0x10
# finish
| 28.824561 | 55 | 0.536823 |
ee268a21a7fea0ba4add96ccce2ac6d3ed562b8f | 262 | asm | Assembly | inst_jump_branch.asm | ForceTower/MIPS32Processor_UART | 8d0202fd6734a1d0c7f62b98051e936e916d78bf | [
"MIT"
] | null | null | null | inst_jump_branch.asm | ForceTower/MIPS32Processor_UART | 8d0202fd6734a1d0c7f62b98051e936e916d78bf | [
"MIT"
] | null | null | null | inst_jump_branch.asm | ForceTower/MIPS32Processor_UART | 8d0202fd6734a1d0c7f62b98051e936e916d78bf | [
"MIT"
] | null | null | null | addi $t0, $zero, 200
addi $t1, $t0, 300
addi $t4, $zero, 0
addi $t2, $zero, 2
addi $t5, $zero, 0
loop: beq $t2, $t5, end
j function
return: addi $t5, $t5, 1
add $t4, $t4, $t5
j loop
function:
add $t3, $t0, $t1
add $t0, $t3, $zero
j return
end:
nop
| 15.411765 | 24 | 0.572519 |
fbe402cfc72f30108e94227100ffbda7dea84d68 | 562 | asm | Assembly | programs/oeis/333/A333596.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/333/A333596.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/333/A333596.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A333596: a(0) = 0; for n > 0, a(n) = a(n-1) + (number of 1's and 3's in base-4 representation of n) - (number of 0's and 2's in base-4 representation of n).
; 0,1,0,1,1,3,3,5,3,3,1,1,1,3,3,5,4,5,4,5,6,9,10,13,12,13,12,13,14,17,18,21,18,17,14,13,12,13,12,13,10,9,6,5,4,5,4,5,4,5,4,5,6,9,10,13,12,13,12,13,14,17,18,21,19,19,17,17,17,19,19,21,19,19
lpb $0
mov $2,$0
sub $0,1
seq $2,334841 ; a(0) = 0; for n > 0, a(n) = (number of 1's and 3's in base 4 representation of n) - (number of 0's and 2's in base 4 representation of n).
add $1,$2
lpe
mov $0,$1
| 51.090909 | 188 | 0.597865 |
f1f7d9b0bc9a679845909da7c0a17196cbb7237a | 45 | asm | Assembly | L1/TPs/0204-ASM/tp1/pgm0.asm | Tehcam/Studies | 69477a211d8c686473b171ad2fa4298ead2ee60d | [
"MIT"
] | null | null | null | L1/TPs/0204-ASM/tp1/pgm0.asm | Tehcam/Studies | 69477a211d8c686473b171ad2fa4298ead2ee60d | [
"MIT"
] | null | null | null | L1/TPs/0204-ASM/tp1/pgm0.asm | Tehcam/Studies | 69477a211d8c686473b171ad2fa4298ead2ee60d | [
"MIT"
] | null | null | null | ;Corentin Machet
;18.03.2021
In
MUL 2
Out
END | 7.5 | 16 | 0.755556 |
eeed0e67c61d25be286174218ec7b6e912dd9b64 | 833 | asm | Assembly | oeis/324/A324352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/324/A324352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/324/A324352.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A324352: Total number of occurrences of 2 in the (signed) displacement sets of all permutations of [n+2] divided by 2!.
; Submitted by Jamie Morken(w2)
; 0,1,5,28,179,1306,10757,98932,1006007,11214406,136041329,1784556808,25174694723,380087428618,6115760751869,104481070398556,1888837397941487,36026457717419662,723015306101706857,15230427461356523056,336009169512596054459,7747901220675953099218,186381921363089046105653,4669471956307893051358468,121644031500781613783751719,3290323356015042377594147926,92283122861052290175219786977,2680364716816273578884369881432,80527109449532059482879164809907,2499705257550557146649680916977306
add $0,1
mov $1,1
mov $2,1
mov $4,-1
mov $5,-1
lpb $0
sub $0,1
add $2,1
sub $3,$1
mul $1,$2
mul $3,$0
mul $3,$5
sub $4,$3
add $3,$4
add $3,$1
add $3,$4
lpe
mov $0,$3
div $0,2
| 34.708333 | 482 | 0.791116 |
fd21efd3c9e66b32e41bdc866c801e8e673da338 | 10,986 | asm | Assembly | Marker-32/markers.asm | meibrahim/Computer-Architecture- | 0568e49562aed4d3bc7f643c50650cc46def6d61 | [
"MIT"
] | null | null | null | Marker-32/markers.asm | meibrahim/Computer-Architecture- | 0568e49562aed4d3bc7f643c50650cc46def6d61 | [
"MIT"
] | null | null | null | Marker-32/markers.asm | meibrahim/Computer-Architecture- | 0568e49562aed4d3bc7f643c50650cc46def6d61 | [
"MIT"
] | null | null | null | ; Mazen Ibrahim 295924
bits 32
extern _print_debug
extern _get_int32
extern _get_int24
extern _get_int16
extern _find_black
extern _find_color
extern _get_bmp_s
extern _get_pixel_offset
extern _print_marker
%define header_size 54
%define get_int32 _get_int32
%define get_int24 _get_int24
%define get_int16 _get_int16
%define is_black _is_black
%define get_width _get_width
%define get_bmp_h _get_bmp_h
%define get_bmp_w _get_bmp_w
%define get_pixel _get_pixel
%define get_pixel_offset _get_pixel_offset
%define find_black _find_black
%define find_color _find_color
%define next_marker _next_marker
global _get_bmp_w
global _get_bmp_h
global _get_pixel
global _is_black
global _next_marker
global _find_markers
SECTION .text
align 4
; int32_t find_markers(uint8_t* bitmap, uint32_t* x_pos, uint32_t* y_pos)
; args
%define arg_bitmap ebp+8
%define arg_x_pos ebp+12
%define arg_y_pos ebp+16
; locals
%define local_x ebp-4
%define local_y ebp-8
%define local_width ebp-12
%define local_result ebp-16
;
_find_markers:
push ebp
mov ebp, esp
; setup globals
mov eax, DWORD [arg_bitmap]
mov DWORD [bmp_header], eax
add eax, header_size
mov DWORD [bmp_pixels], eax
;
; setup locals
sub esp, 16
mov DWORD [local_result], 0
mov DWORD [local_y], 0
;
find_markers_y:
; y < get_bmp_h()
call get_bmp_h
mov ecx, DWORD[local_y]
cmp ecx, eax
jge find_markers_y_break
;
; int x = get_bmp_w() - 1
call get_bmp_w
dec eax
mov DWORD[local_x], eax
;
find_markers_x:
; x > 0
mov eax, DWORD[local_x]
cmp eax, 0
jle find_markers_x_break
;
; int32_t width = next_marker(x, y);
push DWORD [local_y]
push DWORD [local_x]
call next_marker
add esp, 8
mov DWORD [local_width], eax
;
; if (width != -1)
cmp eax, 0
jl find_markers_else
find_markers_if:
; x_pos[result] = x;
mov eax, DWORD [local_result]
mov ecx, DWORD [arg_x_pos]
shl eax, 2
add eax, ecx
mov ecx, DWORD [local_x]
mov DWORD [eax], ecx
;
; y_pos[result] = width / 2 + y - 1;
mov eax, DWORD [local_result]
mov ecx, DWORD [arg_y_pos]
shl eax, 2
add eax, ecx
mov ecx, DWORD [local_y]
dec ecx
mov edx, DWORD [local_width]
shr edx, 1
add ecx, edx
mov DWORD [eax], ecx
;
; result = result + 1;
mov eax, DWORD [local_result]
inc eax
mov DWORD [local_result], eax
;
; x = x - width;
mov eax, DWORD [local_x]
mov ecx, DWORD [local_width]
sub eax, ecx
mov DWORD [local_x], eax
;
find_markers_else:
; --x
mov eax, DWORD[local_x]
dec eax
mov DWORD[local_x], eax
;
jmp find_markers_x
find_markers_x_break:
; ++y
mov eax, DWORD[local_y]
inc eax
mov DWORD[local_y], eax
;
jmp find_markers_y
find_markers_y_break:
find_markers_return:
mov eax, DWORD[local_result]
add esp, 16
leave
ret
; returns: number of patterns found
; int32_t next_marker(int32_t x, int32_t y)
; args
%define arg_x ebp+8
%define arg_y ebp+12
; locals
%define local_minX ebp-4
%define local_maxX ebp-8
%define local_minY ebp-12
%define local_maxY ebp-16
%define local_wthicc ebp-20
%define local_hthicc ebp-24
%define local_envelope ebp-28
%define local_line ebp-32
;
_next_marker:
push ebp
mov ebp, esp
sub esp, 32
;
; if (!is_black(x, y))
push DWORD [arg_y]
push DWORD [arg_x]
call is_black
add esp, 8
cmp eax, 0
je next_marker_error ; return false
;
; if (is_black(x + 1, y))
push DWORD [arg_y]
mov eax, DWORD [arg_x]
inc eax
push eax
call is_black
add esp, 8
cmp eax, 1
je next_marker_error ; return false
;
; if (is_black(x, y - 1))
mov eax, DWORD [arg_y]
dec eax
push eax
push DWORD [arg_x]
call is_black
add esp, 8
cmp eax, 1
je next_marker_error ; return false
;
; if (is_black(x + 1, y - 1))
mov eax, DWORD [arg_y]
dec eax
push eax
mov eax, DWORD [arg_x]
inc eax
push eax
call is_black
add esp, 8
cmp eax, 1
je next_marker_error ; return false
;
; setup locals
mov DWORD [local_minX], -1 ; minX = -1
mov DWORD [local_minY], -1 ; minY = -1
mov DWORD [local_hthicc], -1 ; hthicc = -1
mov DWORD [local_envelope], -1 ; envelope = -1
mov eax, DWORD [arg_x]
mov DWORD [local_maxX], eax ; maxX = x
mov eax, DWORD [arg_y]
mov DWORD [local_minY], eax ; minY = y
mov eax, DWORD [arg_y]
push eax
mov eax, DWORD [arg_x]
push eax
call get_width
add esp, 8
mov DWORD [local_wthicc], eax ; wthicc = get_width(x, y);
;
; do
next_marker_loop_a:
; if (is_black(x + 1, y))
mov eax, DWORD [arg_y]
push eax
mov eax, DWORD [arg_x]
inc eax
push eax
call is_black
add esp, 8
cmp eax, 1
je next_marker_error ; return -1;
;
; int line = get_width(x, ++y);
mov eax, DWORD [arg_y]
inc eax
push eax
mov DWORD [arg_y], eax
mov eax, DWORD [arg_x]
push eax
call get_width
add esp, 8
mov DWORD [local_line], eax
;
; if (line == wthicc)
mov ecx, DWORD [local_wthicc]
cmp eax, ecx
je next_marker_loop_a_logic ; continue;
;
; if (line < wthicc)
jl next_marker_error ; return false;
;
; if (line > wthicc)
mov ecx, DWORD [arg_x]
sub ecx, eax
inc ecx
mov DWORD [local_minX], ecx
mov eax, DWORD [arg_y]
mov DWORD [local_hthicc], eax
jmp next_marker_loop_a_break
;
next_marker_loop_a_logic:
; while (y < get_bmp_h());
call get_bmp_h
mov ecx, DWORD [arg_y]
cmp eax, ecx
jg next_marker_loop_a
;
next_marker_loop_a_break:
;
; do
next_marker_loop_b:
; if (is_black(x + 1, y))
mov eax, DWORD [arg_y]
push eax
mov eax, DWORD [arg_x]
inc eax
push eax
call is_black
add esp, 8
cmp eax, 1
je next_marker_error ; return -1;
;
; int line = get_width(x, ++y);
mov eax, DWORD [arg_y]
inc eax
push eax
mov DWORD [arg_y], eax
mov eax, DWORD [arg_x]
push eax
call get_width
add esp, 8
mov DWORD [local_line], eax
;
; if (line == 0)
next_marker_loop_b_if:
cmp eax, 0
jne next_marker_loop_b_else
; hthicc = y - hthicc;
mov eax, DWORD [arg_y]
mov ecx, DWORD [local_hthicc]
sub eax, ecx
mov DWORD [local_hthicc], eax
; maxY = y - 1;
mov eax, DWORD [arg_y]
dec eax
mov DWORD [local_maxY], eax
; break;
jmp next_marker_loop_b_break
next_marker_loop_b_else:
; if (line != (maxX - minX + 1))
mov eax, DWORD [local_line]
mov ecx, DWORD [local_maxX]
mov edx, DWORD [local_minX]
sub ecx, edx
inc ecx
cmp eax, ecx
jne next_marker_error
next_marker_loop_b_logic:
; while (y < get_bmp_h());
call get_bmp_h
mov ecx, DWORD [arg_y]
cmp eax, ecx
jg next_marker_loop_b
;
next_marker_loop_b_break:
; // our logical condition
; if ((maxX - minX + 1) / 2 != (maxY - minY + 1))
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_minX]
sub eax, ecx
inc eax
shr eax, 1
mov ecx, DWORD [local_maxY]
mov edx, DWORD [local_minY]
sub ecx, edx
inc ecx
cmp eax, ecx
jne next_marker_error ; return -1
; if (hthicc != wthicc)
mov eax, DWORD [local_wthicc]
mov ecx, DWORD [local_hthicc]
cmp eax, ecx
jne next_marker_error ; return -1
;;
; // check the lowest envelope
; envelope = find_black(maxX - 1, minY - 1);
mov eax, DWORD [local_minY]
dec eax
push eax
mov eax, DWORD [local_maxX]
dec eax
push eax
call find_black
add esp, 8
mov DWORD [local_envelope], eax
; if (maxX - envelope <= wthicc)
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_envelope]
sub eax, ecx
mov ecx, DWORD [local_wthicc]
cmp eax, ecx
jle next_marker_error ; return -1
;;
; // check the middle envelope
; envelope = find_black(maxX - wthicc, maxY - hthicc);
mov eax, DWORD [local_maxY]
mov ecx, DWORD [local_hthicc]
sub eax, ecx
push eax
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_wthicc]
sub eax, ecx
push eax
call find_black
add esp, 8
mov DWORD [local_envelope], eax
; if (maxX - envelope <= (maxX - minX + 1))
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_envelope]
sub eax, ecx
mov ecx, DWORD [local_maxX]
mov edx, DWORD [local_minX]
sub ecx, edx
inc ecx
mov edx, DWORD [local_wthicc]
sub ecx, edx
cmp eax, ecx
jle next_marker_error ; return false
;;
; // check the upper envelope
; envelope = find_black(maxX - 1, minY - 1);
mov eax, DWORD [local_maxY]
inc eax
push eax
mov eax, DWORD [local_maxX]
push eax
call find_black
add esp, 8
mov DWORD [local_envelope], eax
; if (maxX - envelope <= (maxX - minX + 1))
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_envelope]
sub eax, ecx
mov ecx, DWORD [local_maxX]
mov edx, DWORD [local_minX]
sub ecx, edx
inc ecx
cmp eax, ecx
jle next_marker_error ; return false
;;
jmp next_marker_return
next_marker_error:
mov eax, -1
jmp next_marker_leave
next_marker_return:
mov eax, DWORD [local_maxX]
mov ecx, DWORD [local_minX]
sub eax, ecx
inc eax
next_marker_leave:
add esp, 32
leave
ret
; int32_t get_pixel(int32_t x, int32_t y)
; args:
%define arg_x ebp+8
%define arg_y ebp+12
; locals:
_get_pixel:
push ebp
mov ebp, esp
;
push DWORD [arg_y]
push DWORD [arg_x]
call get_pixel_offset
add esp, 8
cmp eax, -1
je get_pixel_error
push eax
push DWORD [bmp_pixels]
call get_int24
add esp, 8
jmp get_pixel_leave
get_pixel_error:
mov eax, -1
get_pixel_leave:
;
leave
ret
; boolean is_black(int32_t x, int32_t y)
; args:
%define arg_x ebp+8
%define arg_y ebp+12
;
_is_black:
push ebp
mov ebp, esp
;
push DWORD [arg_y]
push DWORD [arg_x]
call get_pixel
add esp, 8
cmp eax, 0
jne is_black_false
is_black_true:
mov eax, 1
jmp is_black_leave
is_black_false:
mov eax, 0
is_black_leave:
leave
ret
;
; int32_t get_width(int32_t x, int32_t y)
; args:
%define arg_x ebp+8
%define arg_y ebp+12
_get_width:
push ebp
mov ebp, esp
;
push DWORD [arg_y]
push DWORD [arg_x]
call find_color
add esp, 8
mov ecx, eax
cmp eax, -1
je get_width_return_a
get_width_return_b:
mov eax, DWORD [arg_x]
sub eax, ecx
jmp get_width_leave
get_width_return_a:
mov eax, DWORD [arg_x]
get_width_leave:
leave
ret
;
; int32_t get_bmp_w()
_get_bmp_w:
push ebp
mov ebp, esp
;
mov ecx, DWORD[bmp_header]
add ecx, 12h
mov eax, DWORD[ecx]
;
pop ebp
ret
;
; int32_t get_bmp_h()
_get_bmp_h:
push ebp
mov ebp, esp
mov ecx, DWORD[bmp_header]
add ecx, 16h
mov eax, DWORD[ecx]
leave
ret
;
SECTION .data
align 4
bmp_header dd 00000000H
bmp_pixels dd 00000000H
SECTION .bss
align 4 | 18.843911 | 74 | 0.644912 |
ca98011ecd6d9ff2722d913d1371859c055ad48f | 7,209 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_902.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_902.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_902.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+0xf554, %rsi
lea addresses_A_ht+0x14174, %rdi
nop
nop
nop
nop
nop
and $43392, %rdx
mov $122, %rcx
rep movsl
nop
nop
nop
inc %r15
lea addresses_A_ht+0x15738, %rsi
clflush (%rsi)
nop
nop
nop
and %rbp, %rbp
vmovups (%rsi), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %rcx
nop
nop
sub $15550, %rdi
lea addresses_D_ht+0x1d54, %rsi
lea addresses_WT_ht+0x17718, %rdi
nop
nop
nop
sub $20012, %r11
mov $46, %rcx
rep movsq
nop
nop
nop
nop
nop
add $447, %rdi
lea addresses_WC_ht+0x17154, %rsi
nop
nop
nop
nop
and %rcx, %rcx
mov (%rsi), %di
nop
nop
nop
nop
nop
and $28503, %r15
lea addresses_WC_ht+0xd554, %rsi
cmp %r15, %r15
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
xor $27703, %r11
lea addresses_WC_ht+0x19d54, %r15
nop
nop
nop
and $10432, %rsi
movw $0x6162, (%r15)
nop
add $49642, %r11
lea addresses_D_ht+0x1ad54, %r15
nop
nop
add %rcx, %rcx
mov (%r15), %si
sub $21959, %rdx
lea addresses_A_ht+0x19954, %r11
nop
nop
nop
nop
sub %rsi, %rsi
mov (%r11), %edx
cmp %rdi, %rdi
lea addresses_UC_ht+0xe63a, %rsi
lea addresses_D_ht+0xdcd0, %rdi
nop
nop
nop
nop
add %r13, %r13
mov $110, %rcx
rep movsw
nop
nop
nop
and %r13, %r13
lea addresses_WC_ht+0x19794, %rdi
nop
nop
and %r13, %r13
mov $0x6162636465666768, %r11
movq %r11, %xmm7
movups %xmm7, (%rdi)
nop
nop
add %r11, %r11
lea addresses_normal_ht+0x1d124, %r11
nop
nop
xor %r15, %r15
mov (%r11), %edx
nop
add $5825, %rbp
lea addresses_WC_ht+0x4554, %rbp
clflush (%rbp)
nop
add %rdx, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, (%rbp)
nop
sub $36089, %rdx
lea addresses_UC_ht+0xfbb4, %rbp
nop
nop
nop
nop
nop
sub %rcx, %rcx
and $0xffffffffffffffc0, %rbp
movaps (%rbp), %xmm5
vpextrq $1, %xmm5, %r11
nop
nop
nop
and $36720, %rsi
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 %r10
push %r11
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_D+0x10554, %r10
add %rbx, %rbx
mov (%r10), %ecx
lea oracles, %rdi
and $0xff, %rcx
shlq $12, %rcx
mov (%rdi,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': True, 'AVXalign': False, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 11}, 'dst': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 35.512315 | 2,999 | 0.656263 |
3da598d84b709da45cac9ed792f49ad918a11ab8 | 8,121 | asm | Assembly | Library/Styles/Manip/manipSaveRecall.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Styles/Manip/manipSaveRecall.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Styles/Manip/manipSaveRecall.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) Berkeley Softworks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Library/Styles
FILE: Manip/manipSaveRecall.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 12/91 Initial version
DESCRIPTION:
This file contains code for StyleSheetSaveStyle and
StyleSheetPrepareForRecallStyle
$Id: manipSaveRecall.asm,v 1.1 97/04/07 11:15:28 newdeal Exp $
------------------------------------------------------------------------------@
SaveRecallBlockHeader struct
SRBH_meta ObjLMemBlockHeader
SRBH_styleArray lptr
SRBH_attrArrays lptr MAX_STYLE_SHEET_ATTRS dup (?)
SRBH_attrTokens word MAX_STYLE_SHEET_ATTRS dup (?)
SaveRecallBlockHeader ends
ManipCode segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: StyleSheetSaveStyle
DESCRIPTION: Define a new style
CALLED BY: GLOBAL
PASS:
ss:bp - StyleSheetParams
ss:ax - SSCSaveStyleParams
RETURN:
none
DESTROYED:
ax, bx, cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 12/91 Initial version
------------------------------------------------------------------------------@
StyleSheetSaveStyle proc far
STYLE_COPY_LOCALS
; if no style array was passed then bail out
tst ss:[bp].SSP_styleArray.SCD_chunk
jnz 1$
ret
1$:
.enter
call EnterStyleSheet
; We must allocate a block and put a style array and attribute
; arrays in it. We then copy the elements into this block. We
; set up the block as the "xferArray".
; Since we have already done the EnterStyleSheet, we need to
; manually lock the xfer style.
mov ax, LMEM_TYPE_OBJ_BLOCK
mov cx, size SaveRecallBlockHeader
call MemAllocLMem
mov di, ss:[bp] ;ss:di = StyleSheetParams
mov ss:[di].SSP_xferStyleArray.SCD_vmFile, 0
mov ss:[di].SSP_xferStyleArray.SCD_vmBlockOrMemHandle, bx
mov xferStyleArrayHandle, bx
clc
pushf
pop xferStyleArrayFlags
call MemLock
; allocate a style array
call Load_dssi_styleArray ;get source data size
mov si, ds:[si]
mov bx, ds:[si].NAH_dataSize
mov cx, ds:[si].CAH_offset
; NOTE: We set the low bit of the chunk handle saved in the
; StyleSheetParams to mark this this is not an object block
mov ds, ax
clr si
clr ax
call NameArrayCreate ;*ds:si = xfer style array
mov ss:[di].SSP_xferStyleArray.SCD_chunk, si
ornf ss:[di].SSP_xferStyleArray.SCD_chunk,
STYLE_CHUNK_NOT_IN_OBJ_BLOCK
movdw xferStyleArray, dssi
mov ds:SRBH_styleArray, si
; allocate attribute arrays
createAttrLoop:
push di
mov ax, CA_NULL_ELEMENT
call LockLoopAttrArray ;ds:si = attr array
pop di
mov si, ds:[si]
mov bx, ds:[si].CAH_elementSize
mov cx, ds:[si].CAH_offset
mov ds, xferStyleArray.segment
clr si
clr ax
call ElementArrayCreate ;*ds:si = element array
mov xferStyleArray.segment, ds
mov bx, ds:[LMBH_handle]
mov ss:[di].SSP_xferAttrArrays.SCD_vmFile, 0
mov ss:[di].SSP_xferAttrArrays.SCD_vmBlockOrMemHandle, bx
mov ss:[di].SSP_xferAttrArrays.SCD_chunk, si
ornf ss:[di].SSP_xferAttrArrays.SCD_chunk,
STYLE_CHUNK_NOT_IN_OBJ_BLOCK
add di, size StyleChunkDesc
mov bx, attrCounter2
mov ds:[SRBH_attrArrays][bx], si
; unlock attribute array
call UnlockLoopAttrArray
jnz createAttrLoop
clr optBlock
clr fromTransfer
clr changeDestStyles
; copy the elements
copyAttrLoop:
mov di, saved_ax ;ss:di = SSCSaveStyleParams
add di, attrCounter2
mov ax, ss:[di].SSCSSP_attrTokens ;ax = source token
push ax
call LockLoopAttrArray ;ds:si = attr array
;ds:di = element
mov ax, ds:[di].SSEH_style
mov styleToChange, ax
; CopyStyle locks and unlocks attribute arrays, so we can't keep
; this one locked
push attrCounter1
call UnlockSpecificAttrArray
call CopyStyle ;ax = style in dest
mov destStyle, ax
mov destCopyFromStyle, ax
mov ax, CA_NULL_ELEMENT
pop bx
call LockSpecificAttrArray
pop ax ;ax = element
clr dx
call CopyElement ;ax = element in dest
mov ds, xferStyleArray.segment
mov di, attrCounter2
mov ds:[SRBH_attrTokens][di], ax
; unlock attribute array
call UnlockLoopAttrArray
jnz copyAttrLoop
mov di, saved_ax ;ss:di = SSCSaveStyleParams
movdw bxsi, ss:[di].SSCSSP_replyObject
mov cx, xferStyleArrayHandle
mov ax, MSG_STYLE_SHEET_SET_SAVED_STYLE
clr di
call ObjMessage
call FreeOptBlock
call LeaveStyleSheet
.leave
ret
StyleSheetSaveStyle endp
FreeOptBlock proc near
STYLE_COPY_LOCALS
.enter inherit far
mov bx, optBlock
tst bx
jz done
call MemFree
done:
.leave
ret
FreeOptBlock endp
COMMENT @----------------------------------------------------------------------
FUNCTION: StyleSheetPrepareForRecallStyle
DESCRIPTION: Prepare for recall style by copying saved attributes back
into the arrays
CALLED BY: GLOBAL
PASS:
ss:bp - StyleSheetParams
cx - block containing saved style
RETURN:
ss:bp - StyleSheetParams with SSP_attrTokens filled in
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 12/91 Initial version
------------------------------------------------------------------------------@
StyleSheetPrepareForRecallStyle proc far uses bx
STYLE_COPY_LOCALS
; if no style array was passed then bail out
tst ss:[bp].SSP_styleArray.SCD_chunk
jnz 1$
ret
1$:
.enter
call EnterStyleSheet
; first set up the xferStyleArray
mov bx, cx
mov xferStyleArrayHandle, bx
call MemLock
mov ds, ax
mov si, ds:SRBH_styleArray
; NOTE: We set the low bit of the chunk handle saved in the
; StyleSheetParams to mark this this is not an object block
mov di, ss:[bp] ;ss:di = StyleSheetParams
mov ss:[di].SSP_xferStyleArray.SCD_vmFile, 0
mov ss:[di].SSP_xferStyleArray.SCD_vmBlockOrMemHandle, bx
mov ss:[di].SSP_xferStyleArray.SCD_chunk, si
ornf ss:[di].SSP_xferStyleArray.SCD_chunk,
STYLE_CHUNK_NOT_IN_OBJ_BLOCK
movdw xferStyleArray, dssi
clc
pushf
pop xferStyleArrayFlags
clr optBlock
mov fromTransfer, 1
clr changeDestStyles
; fill in the table
mov ds, xferStyleArray.segment
mov bx, ds:[LMBH_handle]
clr di
fillLoop:
shl di
mov ax, ds:[SRBH_attrTokens][di] ;ax = element
mov cx, ds:[SRBH_attrArrays][di] ;cx = chunk
mov si, di
shl si
add si, di
add si, ss:[bp]
mov ss:[si].SSP_xferAttrArrays.SCD_vmFile, 0
mov ss:[si].SSP_xferAttrArrays.SCD_vmBlockOrMemHandle, bx
mov ss:[si].SSP_xferAttrArrays.SCD_chunk, cx
ornf ss:[si].SSP_xferAttrArrays.SCD_chunk,
STYLE_CHUNK_NOT_IN_OBJ_BLOCK
shr di
inc di
cmp di, attrTotal
jnz fillLoop
; copy in the attributes
copyAttrLoop:
mov ds, xferStyleArray.segment
mov di, attrCounter2
mov ax, ds:[SRBH_attrTokens][di] ;ax = element
push ax
mov ax, CA_NULL_ELEMENT
call LockLoopAttrArray ;ds:si = attr array
;ds:di = element
call Load_dssi_xferAttrArray
pop ax
push ax
call ChunkArrayElementToPtr
mov ax, ds:[di].SSEH_style
mov styleToChange, ax
; CopyStyle locks and unlocks attribute arrays, so we can't keep
; this one locked
push attrCounter1
call UnlockSpecificAttrArray
call CopyStyle ;ax = style in dest
mov destStyle, ax
mov destCopyFromStyle, ax
mov ax, CA_NULL_ELEMENT
pop bx
call LockSpecificAttrArray
pop ax ;ax = element
clr dx
call CopyElement ;ax = element in dest
mov di, ss:[bp]
add di, attrCounter2
mov ss:[di].SSP_attrTokens, ax
call UnlockLoopAttrArray
jnz copyAttrLoop
call FreeOptBlock
push xferStyleArrayHandle
call LeaveStyleSheet
pop bx
call MemDecRefCount
.leave
ret
StyleSheetPrepareForRecallStyle endp
ManipCode ends
| 21.656 | 80 | 0.678242 |
86b8b9a0dbff37931cb55ffde98978dbeceabe09 | 7,680 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_19850_824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_19850_824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_19850_824.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x25ad, %rsi
clflush (%rsi)
nop
nop
cmp $40168, %r14
movw $0x6162, (%rsi)
nop
nop
nop
xor %r15, %r15
lea addresses_A_ht+0x14ead, %r12
nop
nop
nop
and %rsi, %rsi
mov (%r12), %di
nop
nop
xor %r15, %r15
lea addresses_WT_ht+0x2216, %rsi
sub %rbp, %rbp
mov (%rsi), %r12w
nop
nop
nop
cmp $5748, %r15
lea addresses_normal_ht+0x11ead, %r15
xor %rdx, %rdx
mov $0x6162636465666768, %r14
movq %r14, %xmm7
vmovups %ymm7, (%r15)
nop
nop
inc %r14
lea addresses_A_ht+0x9597, %rdx
nop
nop
inc %rbp
mov (%rdx), %di
nop
nop
nop
nop
xor $10422, %rsi
lea addresses_WT_ht+0x822d, %r15
nop
nop
nop
sub $47119, %r14
movb $0x61, (%r15)
xor $7059, %rsi
lea addresses_A_ht+0xe42d, %r15
nop
nop
nop
nop
nop
and %rsi, %rsi
movb $0x61, (%r15)
nop
nop
nop
nop
nop
xor $59789, %rbp
lea addresses_WC_ht+0x30ad, %rsi
lea addresses_WT_ht+0x17f2d, %rdi
clflush (%rsi)
nop
nop
nop
sub $36211, %rbp
mov $48, %rcx
rep movsq
inc %rdi
lea addresses_A_ht+0x7aa5, %r15
clflush (%r15)
nop
nop
nop
nop
nop
cmp $44258, %rdi
movl $0x61626364, (%r15)
inc %rsi
lea addresses_WT_ht+0x5f9d, %rsi
lea addresses_A_ht+0x1723f, %rdi
nop
nop
nop
nop
add $50954, %r14
mov $14, %rcx
rep movsw
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x17f2d, %rsi
nop
nop
nop
nop
nop
xor $44437, %r15
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
movups %xmm1, (%rsi)
nop
nop
nop
xor %r15, %r15
lea addresses_normal_ht+0x1daf7, %rcx
nop
nop
nop
nop
sub $41029, %r12
and $0xffffffffffffffc0, %rcx
vmovntdqa (%rcx), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbp
nop
nop
nop
nop
xor %rdx, %rdx
lea addresses_UC_ht+0x3609, %r12
nop
nop
nop
xor %rbp, %rbp
mov (%r12), %dx
nop
inc %rdx
lea addresses_A_ht+0x8996, %rdi
nop
nop
nop
add $32065, %rdx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm2
vmovups %ymm2, (%rdi)
nop
add %rbp, %rbp
lea addresses_WT_ht+0x282d, %rsi
nop
nop
xor %r12, %r12
movl $0x61626364, (%rsi)
nop
nop
nop
sub $55223, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rax
push %rcx
push %rdx
push %rsi
// Faulty Load
lea addresses_PSE+0x1482d, %rsi
nop
nop
and $28323, %r9
movb (%rsi), %dl
lea oracles, %r9
and $0xff, %rdx
shlq $12, %rdx
mov (%r9,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rcx
pop %rax
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'33': 19850}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 33.832599 | 2,999 | 0.65612 |
10a90957716205108440a25a63a7b155fe4b9f15 | 272 | asm | Assembly | programs/oeis/199/A199321.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/199/A199321.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/199/A199321.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A199321: 7*6^n+1.
; 8,43,253,1513,9073,54433,326593,1959553,11757313,70543873,423263233,2539579393,15237476353,91424858113,548549148673,3291294892033,19747769352193,118486616113153,710919696678913,4265518180073473,25593109080440833
mov $1,6
pow $1,$0
mul $1,7
add $1,1
| 34 | 213 | 0.816176 |
c00a1272c046e74ff2b00ff920c16ca0048a5277 | 1,105 | asm | Assembly | programs/oeis/173/A173455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/173/A173455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/173/A173455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A173455: Row sums of triangle A027751.
; 1,1,1,3,1,6,1,7,4,8,1,16,1,10,9,15,1,21,1,22,11,14,1,36,6,16,13,28,1,42,1,31,15,20,13,55,1,22,17,50,1,54,1,40,33,26,1,76,8,43,21,46,1,66,17,64,23,32,1,108,1,34,41,63,19,78,1,58,27,74,1,123,1,40,49,64,19,90,1,106,40,44,1,140,23,46,33,92,1,144,21,76,35,50,25,156,1,73,57,117,1,114,1,106,87,56,1,172,1,106,41,136,1,126,29,94,65,62,25,240,12,64,45,100,31,186,1,127,47,122,1,204,27,70,105,134,1,150,1,196,51,74,25,259,35,76,81,118,1,222,1,148,81,134,37,236,1,82,57,218,31,201,1,130,123,86,1,312,14,154,89,136,1,186,73,196,63,92,1,366,1,154,65,176,43,198,29,148,131,170,1,316,1,100,141,203,1,270,1,265,71,104,37,300,47,106,105,226,31,366,1,166,75,110,49,384,39,112,77,284,31,234,1,280,178,116,1,332,1,202,153,218,1,312,53,184,83,194,1,504,1,157,121,190,97,258,33,232,87,218
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
sub $0,1
cal $0,244049 ; Sum of all proper divisors of all positive integers <= n.
mov $2,$3
mov $4,$0
mul $4,2
mov $6,$4
lpb $2
mov $1,$6
sub $2,1
lpe
lpe
lpb $5
sub $1,$6
mov $5,0
lpe
div $1,2
add $1,1
| 40.925926 | 769 | 0.637104 |
8117ffce5ad4604ecd36bee658441cb8f7cee64c | 532 | asm | Assembly | Word_Count.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | 2 | 2017-02-05T00:30:55.000Z | 2020-06-07T11:05:09.000Z | Word_Count.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | null | null | null | Word_Count.asm | nasim-aust/AUST_CSE_2214_ASSEMBLY_LAB | c264a198aa6ba330105a1a78c8655461e8188ed8 | [
"MIT"
] | null | null | null | .MODEL SMALL
.STACK 100H
.DATA
SUM DB 0
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
INPUT:
MOV AH,1
INT 21H
CMP AL,20H
JE WORD
CMP AL,0DH
JNE INPUT
INC SUM
JMP OUTPUT
WORD:
INC SUM
JMP INPUT
OUTPUT:
ADD SUM,48
MOV AH,2
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
MOV AH,2
MOV DL,SUM
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
;INCLUDE READ_STR.ASM
;INCLUDE OUTDEC.ASM
END MAIN
| 9.5 | 21 | 0.503759 |
5489a36c5b4508b861c5c699aee0b369ba0c9671 | 89,060 | asm | Assembly | zombie.asm | danilocapkob/xv6plus | 9c4b22809094b9c9739201dee316ec2cdbd1a100 | [
"Xnet",
"X11"
] | 1 | 2020-07-14T11:28:42.000Z | 2020-07-14T11:28:42.000Z | zombie.asm | danilocapkob/xv6plus | 9c4b22809094b9c9739201dee316ec2cdbd1a100 | [
"Xnet",
"X11"
] | null | null | null | zombie.asm | danilocapkob/xv6plus | 9c4b22809094b9c9739201dee316ec2cdbd1a100 | [
"Xnet",
"X11"
] | null | null | null |
_zombie: file format elf32-i386-freebsd
Disassembly of section .text:
00000000 <main>:
#include "user.h"
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl 0xfffffffc(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 51 push %ecx
e: 83 ec 04 sub $0x4,%esp
if(fork() > 0)
11: e8 a6 02 00 00 call 2bc <fork>
16: 85 c0 test %eax,%eax
18: 7e 0c jle 26 <main+0x26>
sleep(5); // Let child exit before parent.
1a: c7 04 24 05 00 00 00 movl $0x5,(%esp)
21: e8 2e 03 00 00 call 354 <sleep>
exit();
26: e8 99 02 00 00 call 2c4 <exit>
2b: 90 nop
2c: 90 nop
2d: 90 nop
2e: 90 nop
2f: 90 nop
00000030 <strcpy>:
#include "user.h"
char*
strcpy(char *s, char *t)
{
30: 55 push %ebp
31: 89 e5 mov %esp,%ebp
33: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
36: 8b 45 08 mov 0x8(%ebp),%eax
39: 89 45 fc mov %eax,0xfffffffc(%ebp)
while((*s++ = *t++) != 0)
3c: 8b 45 0c mov 0xc(%ebp),%eax
3f: 0f b6 10 movzbl (%eax),%edx
42: 8b 45 08 mov 0x8(%ebp),%eax
45: 88 10 mov %dl,(%eax)
47: 8b 45 08 mov 0x8(%ebp),%eax
4a: 0f b6 00 movzbl (%eax),%eax
4d: 84 c0 test %al,%al
4f: 0f 95 c0 setne %al
52: 83 45 08 01 addl $0x1,0x8(%ebp)
56: 83 45 0c 01 addl $0x1,0xc(%ebp)
5a: 84 c0 test %al,%al
5c: 75 de jne 3c <strcpy+0xc>
;
return os;
5e: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
61: c9 leave
62: c3 ret
63: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000070 <strcmp>:
int
strcmp(const char *p, const char *q)
{
70: 55 push %ebp
71: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
73: eb 08 jmp 7d <strcmp+0xd>
p++, q++;
75: 83 45 08 01 addl $0x1,0x8(%ebp)
79: 83 45 0c 01 addl $0x1,0xc(%ebp)
7d: 8b 45 08 mov 0x8(%ebp),%eax
80: 0f b6 00 movzbl (%eax),%eax
83: 84 c0 test %al,%al
85: 74 10 je 97 <strcmp+0x27>
87: 8b 45 08 mov 0x8(%ebp),%eax
8a: 0f b6 10 movzbl (%eax),%edx
8d: 8b 45 0c mov 0xc(%ebp),%eax
90: 0f b6 00 movzbl (%eax),%eax
93: 38 c2 cmp %al,%dl
95: 74 de je 75 <strcmp+0x5>
return (uchar)*p - (uchar)*q;
97: 8b 45 08 mov 0x8(%ebp),%eax
9a: 0f b6 00 movzbl (%eax),%eax
9d: 0f b6 d0 movzbl %al,%edx
a0: 8b 45 0c mov 0xc(%ebp),%eax
a3: 0f b6 00 movzbl (%eax),%eax
a6: 0f b6 c0 movzbl %al,%eax
a9: 89 d1 mov %edx,%ecx
ab: 29 c1 sub %eax,%ecx
ad: 89 c8 mov %ecx,%eax
}
af: 5d pop %ebp
b0: c3 ret
b1: eb 0d jmp c0 <strlen>
b3: 90 nop
b4: 90 nop
b5: 90 nop
b6: 90 nop
b7: 90 nop
b8: 90 nop
b9: 90 nop
ba: 90 nop
bb: 90 nop
bc: 90 nop
bd: 90 nop
be: 90 nop
bf: 90 nop
000000c0 <strlen>:
uint
strlen(char *s)
{
c0: 55 push %ebp
c1: 89 e5 mov %esp,%ebp
c3: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
c6: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
cd: eb 04 jmp d3 <strlen+0x13>
cf: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
d3: 8b 45 fc mov 0xfffffffc(%ebp),%eax
d6: 03 45 08 add 0x8(%ebp),%eax
d9: 0f b6 00 movzbl (%eax),%eax
dc: 84 c0 test %al,%al
de: 75 ef jne cf <strlen+0xf>
;
return n;
e0: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
e3: c9 leave
e4: c3 ret
e5: 8d 74 26 00 lea 0x0(%esi),%esi
e9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
000000f0 <memset>:
void*
memset(void *dst, int c, uint n)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 83 ec 10 sub $0x10,%esp
char *d;
d = dst;
f6: 8b 45 08 mov 0x8(%ebp),%eax
f9: 89 45 fc mov %eax,0xfffffffc(%ebp)
while(n-- > 0)
fc: eb 0e jmp 10c <memset+0x1c>
*d++ = c;
fe: 8b 45 0c mov 0xc(%ebp),%eax
101: 89 c2 mov %eax,%edx
103: 8b 45 fc mov 0xfffffffc(%ebp),%eax
106: 88 10 mov %dl,(%eax)
108: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
10c: 83 6d 10 01 subl $0x1,0x10(%ebp)
110: 83 7d 10 ff cmpl $0xffffffff,0x10(%ebp)
114: 75 e8 jne fe <memset+0xe>
return dst;
116: 8b 45 08 mov 0x8(%ebp),%eax
}
119: c9 leave
11a: c3 ret
11b: 90 nop
11c: 8d 74 26 00 lea 0x0(%esi),%esi
00000120 <strchr>:
char*
strchr(const char *s, char c)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 83 ec 08 sub $0x8,%esp
126: 8b 45 0c mov 0xc(%ebp),%eax
129: 88 45 fc mov %al,0xfffffffc(%ebp)
for(; *s; s++)
12c: eb 17 jmp 145 <strchr+0x25>
if(*s == c)
12e: 8b 45 08 mov 0x8(%ebp),%eax
131: 0f b6 00 movzbl (%eax),%eax
134: 3a 45 fc cmp 0xfffffffc(%ebp),%al
137: 75 08 jne 141 <strchr+0x21>
return (char*) s;
139: 8b 45 08 mov 0x8(%ebp),%eax
13c: 89 45 f8 mov %eax,0xfffffff8(%ebp)
13f: eb 15 jmp 156 <strchr+0x36>
141: 83 45 08 01 addl $0x1,0x8(%ebp)
145: 8b 45 08 mov 0x8(%ebp),%eax
148: 0f b6 00 movzbl (%eax),%eax
14b: 84 c0 test %al,%al
14d: 75 df jne 12e <strchr+0xe>
return 0;
14f: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
156: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
}
159: c9 leave
15a: c3 ret
15b: 90 nop
15c: 8d 74 26 00 lea 0x0(%esi),%esi
00000160 <gets>:
char*
gets(char *buf, int max)
{
160: 55 push %ebp
161: 89 e5 mov %esp,%ebp
163: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
166: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
16d: eb 46 jmp 1b5 <gets+0x55>
cc = read(0, &c, 1);
16f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
176: 00
177: 8d 45 f7 lea 0xfffffff7(%ebp),%eax
17a: 89 44 24 04 mov %eax,0x4(%esp)
17e: c7 04 24 00 00 00 00 movl $0x0,(%esp)
185: e8 52 01 00 00 call 2dc <read>
18a: 89 45 fc mov %eax,0xfffffffc(%ebp)
if(cc < 1)
18d: 83 7d fc 00 cmpl $0x0,0xfffffffc(%ebp)
191: 7e 2d jle 1c0 <gets+0x60>
break;
buf[i++] = c;
193: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
196: 89 c2 mov %eax,%edx
198: 03 55 08 add 0x8(%ebp),%edx
19b: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
19f: 88 02 mov %al,(%edx)
1a1: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
if(c == '\n' || c == '\r')
1a5: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
1a9: 3c 0a cmp $0xa,%al
1ab: 74 13 je 1c0 <gets+0x60>
1ad: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
1b1: 3c 0d cmp $0xd,%al
1b3: 74 0b je 1c0 <gets+0x60>
1b5: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
1b8: 83 c0 01 add $0x1,%eax
1bb: 3b 45 0c cmp 0xc(%ebp),%eax
1be: 7c af jl 16f <gets+0xf>
break;
}
buf[i] = '\0';
1c0: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
1c3: 03 45 08 add 0x8(%ebp),%eax
1c6: c6 00 00 movb $0x0,(%eax)
return buf;
1c9: 8b 45 08 mov 0x8(%ebp),%eax
}
1cc: c9 leave
1cd: c3 ret
1ce: 89 f6 mov %esi,%esi
000001d0 <stat>:
int
stat(char *n, struct stat *st)
{
1d0: 55 push %ebp
1d1: 89 e5 mov %esp,%ebp
1d3: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1d6: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1dd: 00
1de: 8b 45 08 mov 0x8(%ebp),%eax
1e1: 89 04 24 mov %eax,(%esp)
1e4: e8 1b 01 00 00 call 304 <open>
1e9: 89 45 f8 mov %eax,0xfffffff8(%ebp)
if(fd < 0)
1ec: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
1f0: 79 09 jns 1fb <stat+0x2b>
return -1;
1f2: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp)
1f9: eb 26 jmp 221 <stat+0x51>
r = fstat(fd, st);
1fb: 8b 45 0c mov 0xc(%ebp),%eax
1fe: 89 44 24 04 mov %eax,0x4(%esp)
202: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
205: 89 04 24 mov %eax,(%esp)
208: e8 0f 01 00 00 call 31c <fstat>
20d: 89 45 fc mov %eax,0xfffffffc(%ebp)
close(fd);
210: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
213: 89 04 24 mov %eax,(%esp)
216: e8 d1 00 00 00 call 2ec <close>
return r;
21b: 8b 45 fc mov 0xfffffffc(%ebp),%eax
21e: 89 45 ec mov %eax,0xffffffec(%ebp)
221: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
224: c9 leave
225: c3 ret
226: 8d 76 00 lea 0x0(%esi),%esi
229: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000230 <atoi>:
int
atoi(const char *s)
{
230: 55 push %ebp
231: 89 e5 mov %esp,%ebp
233: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
236: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
while('0' <= *s && *s <= '9')
23d: eb 24 jmp 263 <atoi+0x33>
n = n*10 + *s++ - '0';
23f: 8b 55 fc mov 0xfffffffc(%ebp),%edx
242: 89 d0 mov %edx,%eax
244: c1 e0 02 shl $0x2,%eax
247: 01 d0 add %edx,%eax
249: 01 c0 add %eax,%eax
24b: 89 c2 mov %eax,%edx
24d: 8b 45 08 mov 0x8(%ebp),%eax
250: 0f b6 00 movzbl (%eax),%eax
253: 0f be c0 movsbl %al,%eax
256: 8d 04 02 lea (%edx,%eax,1),%eax
259: 83 e8 30 sub $0x30,%eax
25c: 89 45 fc mov %eax,0xfffffffc(%ebp)
25f: 83 45 08 01 addl $0x1,0x8(%ebp)
263: 8b 45 08 mov 0x8(%ebp),%eax
266: 0f b6 00 movzbl (%eax),%eax
269: 3c 2f cmp $0x2f,%al
26b: 7e 0a jle 277 <atoi+0x47>
26d: 8b 45 08 mov 0x8(%ebp),%eax
270: 0f b6 00 movzbl (%eax),%eax
273: 3c 39 cmp $0x39,%al
275: 7e c8 jle 23f <atoi+0xf>
return n;
277: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
27a: c9 leave
27b: c3 ret
27c: 8d 74 26 00 lea 0x0(%esi),%esi
00000280 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
280: 55 push %ebp
281: 89 e5 mov %esp,%ebp
283: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
286: 8b 45 08 mov 0x8(%ebp),%eax
289: 89 45 f8 mov %eax,0xfffffff8(%ebp)
src = vsrc;
28c: 8b 45 0c mov 0xc(%ebp),%eax
28f: 89 45 fc mov %eax,0xfffffffc(%ebp)
while(n-- > 0)
292: eb 13 jmp 2a7 <memmove+0x27>
*dst++ = *src++;
294: 8b 45 fc mov 0xfffffffc(%ebp),%eax
297: 0f b6 10 movzbl (%eax),%edx
29a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
29d: 88 10 mov %dl,(%eax)
29f: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
2a3: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
2a7: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
2ab: 0f 9f c0 setg %al
2ae: 83 6d 10 01 subl $0x1,0x10(%ebp)
2b2: 84 c0 test %al,%al
2b4: 75 de jne 294 <memmove+0x14>
return vdst;
2b6: 8b 45 08 mov 0x8(%ebp),%eax
}
2b9: c9 leave
2ba: c3 ret
2bb: 90 nop
000002bc <fork>:
2bc: b8 01 00 00 00 mov $0x1,%eax
2c1: cd 30 int $0x30
2c3: c3 ret
000002c4 <exit>:
2c4: b8 02 00 00 00 mov $0x2,%eax
2c9: cd 30 int $0x30
2cb: c3 ret
000002cc <wait>:
2cc: b8 03 00 00 00 mov $0x3,%eax
2d1: cd 30 int $0x30
2d3: c3 ret
000002d4 <pipe>:
2d4: b8 04 00 00 00 mov $0x4,%eax
2d9: cd 30 int $0x30
2db: c3 ret
000002dc <read>:
2dc: b8 06 00 00 00 mov $0x6,%eax
2e1: cd 30 int $0x30
2e3: c3 ret
000002e4 <write>:
2e4: b8 05 00 00 00 mov $0x5,%eax
2e9: cd 30 int $0x30
2eb: c3 ret
000002ec <close>:
2ec: b8 07 00 00 00 mov $0x7,%eax
2f1: cd 30 int $0x30
2f3: c3 ret
000002f4 <kill>:
2f4: b8 08 00 00 00 mov $0x8,%eax
2f9: cd 30 int $0x30
2fb: c3 ret
000002fc <exec>:
2fc: b8 09 00 00 00 mov $0x9,%eax
301: cd 30 int $0x30
303: c3 ret
00000304 <open>:
304: b8 0a 00 00 00 mov $0xa,%eax
309: cd 30 int $0x30
30b: c3 ret
0000030c <mknod>:
30c: b8 0b 00 00 00 mov $0xb,%eax
311: cd 30 int $0x30
313: c3 ret
00000314 <unlink>:
314: b8 0c 00 00 00 mov $0xc,%eax
319: cd 30 int $0x30
31b: c3 ret
0000031c <fstat>:
31c: b8 0d 00 00 00 mov $0xd,%eax
321: cd 30 int $0x30
323: c3 ret
00000324 <link>:
324: b8 0e 00 00 00 mov $0xe,%eax
329: cd 30 int $0x30
32b: c3 ret
0000032c <mkdir>:
32c: b8 0f 00 00 00 mov $0xf,%eax
331: cd 30 int $0x30
333: c3 ret
00000334 <chdir>:
334: b8 10 00 00 00 mov $0x10,%eax
339: cd 30 int $0x30
33b: c3 ret
0000033c <dup>:
33c: b8 11 00 00 00 mov $0x11,%eax
341: cd 30 int $0x30
343: c3 ret
00000344 <getpid>:
344: b8 12 00 00 00 mov $0x12,%eax
349: cd 30 int $0x30
34b: c3 ret
0000034c <sbrk>:
34c: b8 13 00 00 00 mov $0x13,%eax
351: cd 30 int $0x30
353: c3 ret
00000354 <sleep>:
354: b8 14 00 00 00 mov $0x14,%eax
359: cd 30 int $0x30
35b: c3 ret
0000035c <upmsec>:
35c: b8 15 00 00 00 mov $0x15,%eax
361: cd 30 int $0x30
363: c3 ret
00000364 <socket>:
364: b8 16 00 00 00 mov $0x16,%eax
369: cd 30 int $0x30
36b: c3 ret
0000036c <bind>:
36c: b8 17 00 00 00 mov $0x17,%eax
371: cd 30 int $0x30
373: c3 ret
00000374 <listen>:
374: b8 18 00 00 00 mov $0x18,%eax
379: cd 30 int $0x30
37b: c3 ret
0000037c <accept>:
37c: b8 19 00 00 00 mov $0x19,%eax
381: cd 30 int $0x30
383: c3 ret
00000384 <recv>:
384: b8 1a 00 00 00 mov $0x1a,%eax
389: cd 30 int $0x30
38b: c3 ret
0000038c <recvfrom>:
38c: b8 1b 00 00 00 mov $0x1b,%eax
391: cd 30 int $0x30
393: c3 ret
00000394 <send>:
394: b8 1c 00 00 00 mov $0x1c,%eax
399: cd 30 int $0x30
39b: c3 ret
0000039c <sendto>:
39c: b8 1d 00 00 00 mov $0x1d,%eax
3a1: cd 30 int $0x30
3a3: c3 ret
000003a4 <shutdown>:
3a4: b8 1e 00 00 00 mov $0x1e,%eax
3a9: cd 30 int $0x30
3ab: c3 ret
000003ac <getsockopt>:
3ac: b8 1f 00 00 00 mov $0x1f,%eax
3b1: cd 30 int $0x30
3b3: c3 ret
000003b4 <setsockopt>:
3b4: b8 20 00 00 00 mov $0x20,%eax
3b9: cd 30 int $0x30
3bb: c3 ret
000003bc <sockclose>:
3bc: b8 21 00 00 00 mov $0x21,%eax
3c1: cd 30 int $0x30
3c3: c3 ret
000003c4 <connect>:
3c4: b8 22 00 00 00 mov $0x22,%eax
3c9: cd 30 int $0x30
3cb: c3 ret
000003cc <getpeername>:
3cc: b8 23 00 00 00 mov $0x23,%eax
3d1: cd 30 int $0x30
3d3: c3 ret
000003d4 <getsockname>:
3d4: b8 24 00 00 00 mov $0x24,%eax
3d9: cd 30 int $0x30
3db: c3 ret
3dc: 90 nop
3dd: 90 nop
3de: 90 nop
3df: 90 nop
000003e0 <putc>:
#include "user.h"
void
putc(int fd, char c)
{
3e0: 55 push %ebp
3e1: 89 e5 mov %esp,%ebp
3e3: 83 ec 18 sub $0x18,%esp
3e6: 8b 45 0c mov 0xc(%ebp),%eax
3e9: 88 45 fc mov %al,0xfffffffc(%ebp)
write(fd, &c, 1);
3ec: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
3f3: 00
3f4: 8d 45 fc lea 0xfffffffc(%ebp),%eax
3f7: 89 44 24 04 mov %eax,0x4(%esp)
3fb: 8b 45 08 mov 0x8(%ebp),%eax
3fe: 89 04 24 mov %eax,(%esp)
401: e8 de fe ff ff call 2e4 <write>
}
406: c9 leave
407: c3 ret
408: 90 nop
409: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi
00000410 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 53 push %ebx
414: 83 ec 34 sub $0x34,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
417: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
if(sgn && xx < 0){
41e: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
422: 74 17 je 43b <printint+0x2b>
424: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
428: 79 11 jns 43b <printint+0x2b>
neg = 1;
42a: c7 45 f4 01 00 00 00 movl $0x1,0xfffffff4(%ebp)
x = -xx;
431: 8b 45 0c mov 0xc(%ebp),%eax
434: f7 d8 neg %eax
436: 89 45 f8 mov %eax,0xfffffff8(%ebp)
439: eb 06 jmp 441 <printint+0x31>
} else {
x = xx;
43b: 8b 45 0c mov 0xc(%ebp),%eax
43e: 89 45 f8 mov %eax,0xfffffff8(%ebp)
}
i = 0;
441: c7 45 f0 00 00 00 00 movl $0x0,0xfffffff0(%ebp)
do{
buf[i++] = digits[x % base];
448: 8b 4d f0 mov 0xfffffff0(%ebp),%ecx
44b: 8b 55 10 mov 0x10(%ebp),%edx
44e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
451: 89 d3 mov %edx,%ebx
453: ba 00 00 00 00 mov $0x0,%edx
458: f7 f3 div %ebx
45a: 89 d0 mov %edx,%eax
45c: 0f b6 80 70 10 00 00 movzbl 0x1070(%eax),%eax
463: 88 44 0d e0 mov %al,0xffffffe0(%ebp,%ecx,1)
467: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
}while((x /= base) != 0);
46b: 8b 55 10 mov 0x10(%ebp),%edx
46e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
471: 89 d1 mov %edx,%ecx
473: ba 00 00 00 00 mov $0x0,%edx
478: f7 f1 div %ecx
47a: 89 45 f8 mov %eax,0xfffffff8(%ebp)
47d: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
481: 75 c5 jne 448 <printint+0x38>
if(neg)
483: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp)
487: 74 28 je 4b1 <printint+0xa1>
buf[i++] = '-';
489: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
48c: c6 44 05 e0 2d movb $0x2d,0xffffffe0(%ebp,%eax,1)
491: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
while(--i >= 0)
495: eb 1a jmp 4b1 <printint+0xa1>
putc(fd, buf[i]);
497: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
49a: 0f b6 44 05 e0 movzbl 0xffffffe0(%ebp,%eax,1),%eax
49f: 0f be c0 movsbl %al,%eax
4a2: 89 44 24 04 mov %eax,0x4(%esp)
4a6: 8b 45 08 mov 0x8(%ebp),%eax
4a9: 89 04 24 mov %eax,(%esp)
4ac: e8 2f ff ff ff call 3e0 <putc>
4b1: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp)
4b5: 83 7d f0 00 cmpl $0x0,0xfffffff0(%ebp)
4b9: 79 dc jns 497 <printint+0x87>
}
4bb: 83 c4 34 add $0x34,%esp
4be: 5b pop %ebx
4bf: 5d pop %ebp
4c0: c3 ret
4c1: eb 0d jmp 4d0 <printf>
4c3: 90 nop
4c4: 90 nop
4c5: 90 nop
4c6: 90 nop
4c7: 90 nop
4c8: 90 nop
4c9: 90 nop
4ca: 90 nop
4cb: 90 nop
4cc: 90 nop
4cd: 90 nop
4ce: 90 nop
4cf: 90 nop
000004d0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4d0: 55 push %ebp
4d1: 89 e5 mov %esp,%ebp
4d3: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
4d6: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
ap = (uint*)(void*)&fmt + 1;
4dd: 8d 45 0c lea 0xc(%ebp),%eax
4e0: 83 c0 04 add $0x4,%eax
4e3: 89 45 fc mov %eax,0xfffffffc(%ebp)
for(i = 0; fmt[i]; i++){
4e6: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
4ed: e9 7b 01 00 00 jmp 66d <printf+0x19d>
c = fmt[i] & 0xff;
4f2: 8b 55 0c mov 0xc(%ebp),%edx
4f5: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
4f8: 8d 04 02 lea (%edx,%eax,1),%eax
4fb: 0f b6 00 movzbl (%eax),%eax
4fe: 0f be c0 movsbl %al,%eax
501: 25 ff 00 00 00 and $0xff,%eax
506: 89 45 f0 mov %eax,0xfffffff0(%ebp)
if(state == 0){
509: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
50d: 75 2c jne 53b <printf+0x6b>
if(c == '%'){
50f: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp)
513: 75 0c jne 521 <printf+0x51>
state = '%';
515: c7 45 f8 25 00 00 00 movl $0x25,0xfffffff8(%ebp)
51c: e9 48 01 00 00 jmp 669 <printf+0x199>
} else {
putc(fd, c);
521: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
524: 0f be c0 movsbl %al,%eax
527: 89 44 24 04 mov %eax,0x4(%esp)
52b: 8b 45 08 mov 0x8(%ebp),%eax
52e: 89 04 24 mov %eax,(%esp)
531: e8 aa fe ff ff call 3e0 <putc>
536: e9 2e 01 00 00 jmp 669 <printf+0x199>
}
} else if(state == '%'){
53b: 83 7d f8 25 cmpl $0x25,0xfffffff8(%ebp)
53f: 0f 85 24 01 00 00 jne 669 <printf+0x199>
if(c == 'd'){
545: 83 7d f0 64 cmpl $0x64,0xfffffff0(%ebp)
549: 75 2d jne 578 <printf+0xa8>
printint(fd, *ap, 10, 1);
54b: 8b 45 fc mov 0xfffffffc(%ebp),%eax
54e: 8b 00 mov (%eax),%eax
550: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
557: 00
558: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
55f: 00
560: 89 44 24 04 mov %eax,0x4(%esp)
564: 8b 45 08 mov 0x8(%ebp),%eax
567: 89 04 24 mov %eax,(%esp)
56a: e8 a1 fe ff ff call 410 <printint>
ap++;
56f: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
573: e9 ea 00 00 00 jmp 662 <printf+0x192>
} else if(c == 'x' || c == 'p'){
578: 83 7d f0 78 cmpl $0x78,0xfffffff0(%ebp)
57c: 74 06 je 584 <printf+0xb4>
57e: 83 7d f0 70 cmpl $0x70,0xfffffff0(%ebp)
582: 75 2d jne 5b1 <printf+0xe1>
printint(fd, *ap, 16, 0);
584: 8b 45 fc mov 0xfffffffc(%ebp),%eax
587: 8b 00 mov (%eax),%eax
589: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
590: 00
591: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
598: 00
599: 89 44 24 04 mov %eax,0x4(%esp)
59d: 8b 45 08 mov 0x8(%ebp),%eax
5a0: 89 04 24 mov %eax,(%esp)
5a3: e8 68 fe ff ff call 410 <printint>
ap++;
5a8: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
5ac: e9 b1 00 00 00 jmp 662 <printf+0x192>
} else if(c == 's'){
5b1: 83 7d f0 73 cmpl $0x73,0xfffffff0(%ebp)
5b5: 75 43 jne 5fa <printf+0x12a>
s = (char*)*ap;
5b7: 8b 45 fc mov 0xfffffffc(%ebp),%eax
5ba: 8b 00 mov (%eax),%eax
5bc: 89 45 ec mov %eax,0xffffffec(%ebp)
ap++;
5bf: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
if(s == 0)
5c3: 83 7d ec 00 cmpl $0x0,0xffffffec(%ebp)
5c7: 75 25 jne 5ee <printf+0x11e>
s = "(null)";
5c9: c7 45 ec 54 10 00 00 movl $0x1054,0xffffffec(%ebp)
while(*s != 0){
5d0: eb 1c jmp 5ee <printf+0x11e>
putc(fd, *s);
5d2: 8b 45 ec mov 0xffffffec(%ebp),%eax
5d5: 0f b6 00 movzbl (%eax),%eax
5d8: 0f be c0 movsbl %al,%eax
5db: 89 44 24 04 mov %eax,0x4(%esp)
5df: 8b 45 08 mov 0x8(%ebp),%eax
5e2: 89 04 24 mov %eax,(%esp)
5e5: e8 f6 fd ff ff call 3e0 <putc>
s++;
5ea: 83 45 ec 01 addl $0x1,0xffffffec(%ebp)
5ee: 8b 45 ec mov 0xffffffec(%ebp),%eax
5f1: 0f b6 00 movzbl (%eax),%eax
5f4: 84 c0 test %al,%al
5f6: 75 da jne 5d2 <printf+0x102>
5f8: eb 68 jmp 662 <printf+0x192>
}
} else if(c == 'c'){
5fa: 83 7d f0 63 cmpl $0x63,0xfffffff0(%ebp)
5fe: 75 1d jne 61d <printf+0x14d>
putc(fd, *ap);
600: 8b 45 fc mov 0xfffffffc(%ebp),%eax
603: 8b 00 mov (%eax),%eax
605: 0f be c0 movsbl %al,%eax
608: 89 44 24 04 mov %eax,0x4(%esp)
60c: 8b 45 08 mov 0x8(%ebp),%eax
60f: 89 04 24 mov %eax,(%esp)
612: e8 c9 fd ff ff call 3e0 <putc>
ap++;
617: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
61b: eb 45 jmp 662 <printf+0x192>
} else if(c == '%'){
61d: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp)
621: 75 17 jne 63a <printf+0x16a>
putc(fd, c);
623: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
626: 0f be c0 movsbl %al,%eax
629: 89 44 24 04 mov %eax,0x4(%esp)
62d: 8b 45 08 mov 0x8(%ebp),%eax
630: 89 04 24 mov %eax,(%esp)
633: e8 a8 fd ff ff call 3e0 <putc>
638: eb 28 jmp 662 <printf+0x192>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
63a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
641: 00
642: 8b 45 08 mov 0x8(%ebp),%eax
645: 89 04 24 mov %eax,(%esp)
648: e8 93 fd ff ff call 3e0 <putc>
putc(fd, c);
64d: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
650: 0f be c0 movsbl %al,%eax
653: 89 44 24 04 mov %eax,0x4(%esp)
657: 8b 45 08 mov 0x8(%ebp),%eax
65a: 89 04 24 mov %eax,(%esp)
65d: e8 7e fd ff ff call 3e0 <putc>
}
state = 0;
662: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
669: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp)
66d: 8b 55 0c mov 0xc(%ebp),%edx
670: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
673: 8d 04 02 lea (%edx,%eax,1),%eax
676: 0f b6 00 movzbl (%eax),%eax
679: 84 c0 test %al,%al
67b: 0f 85 71 fe ff ff jne 4f2 <printf+0x22>
}
}
}
681: c9 leave
682: c3 ret
683: 90 nop
684: 90 nop
685: 90 nop
686: 90 nop
687: 90 nop
688: 90 nop
689: 90 nop
68a: 90 nop
68b: 90 nop
68c: 90 nop
68d: 90 nop
68e: 90 nop
68f: 90 nop
00000690 <free>:
static Header *freep;
void
free(void *ap)
{
690: 55 push %ebp
691: 89 e5 mov %esp,%ebp
693: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*) ap - 1;
696: 8b 45 08 mov 0x8(%ebp),%eax
699: 83 e8 08 sub $0x8,%eax
69c: 89 45 f8 mov %eax,0xfffffff8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
69f: a1 8c 10 00 00 mov 0x108c,%eax
6a4: 89 45 fc mov %eax,0xfffffffc(%ebp)
6a7: eb 24 jmp 6cd <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6a9: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6ac: 8b 00 mov (%eax),%eax
6ae: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
6b1: 77 12 ja 6c5 <free+0x35>
6b3: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
6b6: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
6b9: 77 24 ja 6df <free+0x4f>
6bb: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6be: 8b 00 mov (%eax),%eax
6c0: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
6c3: 77 1a ja 6df <free+0x4f>
6c5: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6c8: 8b 00 mov (%eax),%eax
6ca: 89 45 fc mov %eax,0xfffffffc(%ebp)
6cd: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
6d0: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
6d3: 76 d4 jbe 6a9 <free+0x19>
6d5: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6d8: 8b 00 mov (%eax),%eax
6da: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
6dd: 76 ca jbe 6a9 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
6df: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
6e2: 8b 40 04 mov 0x4(%eax),%eax
6e5: c1 e0 03 shl $0x3,%eax
6e8: 89 c2 mov %eax,%edx
6ea: 03 55 f8 add 0xfffffff8(%ebp),%edx
6ed: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6f0: 8b 00 mov (%eax),%eax
6f2: 39 c2 cmp %eax,%edx
6f4: 75 24 jne 71a <free+0x8a>
bp->s.size += p->s.ptr->s.size;
6f6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
6f9: 8b 50 04 mov 0x4(%eax),%edx
6fc: 8b 45 fc mov 0xfffffffc(%ebp),%eax
6ff: 8b 00 mov (%eax),%eax
701: 8b 40 04 mov 0x4(%eax),%eax
704: 01 c2 add %eax,%edx
706: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
709: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
70c: 8b 45 fc mov 0xfffffffc(%ebp),%eax
70f: 8b 00 mov (%eax),%eax
711: 8b 10 mov (%eax),%edx
713: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
716: 89 10 mov %edx,(%eax)
718: eb 0a jmp 724 <free+0x94>
} else
bp->s.ptr = p->s.ptr;
71a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
71d: 8b 10 mov (%eax),%edx
71f: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
722: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
724: 8b 45 fc mov 0xfffffffc(%ebp),%eax
727: 8b 40 04 mov 0x4(%eax),%eax
72a: c1 e0 03 shl $0x3,%eax
72d: 03 45 fc add 0xfffffffc(%ebp),%eax
730: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
733: 75 20 jne 755 <free+0xc5>
p->s.size += bp->s.size;
735: 8b 45 fc mov 0xfffffffc(%ebp),%eax
738: 8b 50 04 mov 0x4(%eax),%edx
73b: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
73e: 8b 40 04 mov 0x4(%eax),%eax
741: 01 c2 add %eax,%edx
743: 8b 45 fc mov 0xfffffffc(%ebp),%eax
746: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
749: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
74c: 8b 10 mov (%eax),%edx
74e: 8b 45 fc mov 0xfffffffc(%ebp),%eax
751: 89 10 mov %edx,(%eax)
753: eb 08 jmp 75d <free+0xcd>
} else
p->s.ptr = bp;
755: 8b 55 fc mov 0xfffffffc(%ebp),%edx
758: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
75b: 89 02 mov %eax,(%edx)
freep = p;
75d: 8b 45 fc mov 0xfffffffc(%ebp),%eax
760: a3 8c 10 00 00 mov %eax,0x108c
}
765: c9 leave
766: c3 ret
767: 89 f6 mov %esi,%esi
769: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000770 <morecore>:
static Header*
morecore(uint nu)
{
770: 55 push %ebp
771: 89 e5 mov %esp,%ebp
773: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
int size;
#ifdef UMALLOC_DEBUG
printf(1, "morecore: %d\n", nu);
#endif
#ifdef UMALLOC_NOALIGN
if(nu < PAGE)
nu = PAGE;
#else
size = nu * sizeof(Header);
776: 8b 45 08 mov 0x8(%ebp),%eax
779: c1 e0 03 shl $0x3,%eax
77c: 89 45 fc mov %eax,0xfffffffc(%ebp)
size += PAGE - size % PAGE;
77f: 8b 55 fc mov 0xfffffffc(%ebp),%edx
782: 89 d0 mov %edx,%eax
784: c1 f8 1f sar $0x1f,%eax
787: 89 c1 mov %eax,%ecx
789: c1 e9 14 shr $0x14,%ecx
78c: 8d 04 0a lea (%edx,%ecx,1),%eax
78f: 25 ff 0f 00 00 and $0xfff,%eax
794: 29 c8 sub %ecx,%eax
796: 89 c2 mov %eax,%edx
798: b8 00 10 00 00 mov $0x1000,%eax
79d: 29 d0 sub %edx,%eax
79f: 01 45 fc add %eax,0xfffffffc(%ebp)
#endif
#ifdef UMALLOC_DEBUG
printf(1, "size: %d\n", size);
#endif
p = sbrk(size);
7a2: 8b 45 fc mov 0xfffffffc(%ebp),%eax
7a5: 89 04 24 mov %eax,(%esp)
7a8: e8 9f fb ff ff call 34c <sbrk>
7ad: 89 45 f4 mov %eax,0xfffffff4(%ebp)
if(p == (char*) -1)
7b0: 83 7d f4 ff cmpl $0xffffffff,0xfffffff4(%ebp)
7b4: 75 09 jne 7bf <morecore+0x4f>
return 0;
7b6: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
7bd: eb 2a jmp 7e9 <morecore+0x79>
hp = (Header*)p;
7bf: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
7c2: 89 45 f8 mov %eax,0xfffffff8(%ebp)
#ifdef UMALLOC_NOALIGN
hp->s.size = nu;
#else
hp->s.size = size / sizeof(Header);
7c5: 8b 45 fc mov 0xfffffffc(%ebp),%eax
7c8: 89 c2 mov %eax,%edx
7ca: c1 ea 03 shr $0x3,%edx
7cd: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
7d0: 89 50 04 mov %edx,0x4(%eax)
#endif
free((void*)(hp + 1));
7d3: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
7d6: 83 c0 08 add $0x8,%eax
7d9: 89 04 24 mov %eax,(%esp)
7dc: e8 af fe ff ff call 690 <free>
return freep;
7e1: a1 8c 10 00 00 mov 0x108c,%eax
7e6: 89 45 ec mov %eax,0xffffffec(%ebp)
7e9: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
7ec: c9 leave
7ed: c3 ret
7ee: 89 f6 mov %esi,%esi
000007f0 <malloc>:
void*
malloc(uint nbytes)
{
7f0: 55 push %ebp
7f1: 89 e5 mov %esp,%ebp
7f3: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
#ifdef UMALLOC_DEBUG
printf(1, "malloc: %d bytes\n", nbytes);
printf(1, "size of Header: %d\n", sizeof(Header));
#endif
if (PAGE % sizeof(Header))
printf(2, "Warning! align failed! Need UMALLOC_NOALIGN\n");
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7f6: 8b 45 08 mov 0x8(%ebp),%eax
7f9: 83 c0 07 add $0x7,%eax
7fc: c1 e8 03 shr $0x3,%eax
7ff: 83 c0 01 add $0x1,%eax
802: 89 45 fc mov %eax,0xfffffffc(%ebp)
if((prevp = freep) == 0){
805: a1 8c 10 00 00 mov 0x108c,%eax
80a: 89 45 f8 mov %eax,0xfffffff8(%ebp)
80d: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
811: 75 23 jne 836 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
813: c7 45 f8 84 10 00 00 movl $0x1084,0xfffffff8(%ebp)
81a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
81d: a3 8c 10 00 00 mov %eax,0x108c
822: a1 8c 10 00 00 mov 0x108c,%eax
827: a3 84 10 00 00 mov %eax,0x1084
base.s.size = 0;
82c: c7 05 88 10 00 00 00 movl $0x0,0x1088
833: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
836: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
839: 8b 00 mov (%eax),%eax
83b: 89 45 f4 mov %eax,0xfffffff4(%ebp)
if(p->s.size >= nunits){
83e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
841: 8b 40 04 mov 0x4(%eax),%eax
844: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
847: 72 50 jb 899 <malloc+0xa9>
if(p->s.size == nunits)
849: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
84c: 8b 40 04 mov 0x4(%eax),%eax
84f: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
852: 75 0c jne 860 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
854: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
857: 8b 10 mov (%eax),%edx
859: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
85c: 89 10 mov %edx,(%eax)
85e: eb 26 jmp 886 <malloc+0x96>
else {
p->s.size -= nunits;
860: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
863: 8b 40 04 mov 0x4(%eax),%eax
866: 89 c2 mov %eax,%edx
868: 2b 55 fc sub 0xfffffffc(%ebp),%edx
86b: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
86e: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
871: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
874: 8b 40 04 mov 0x4(%eax),%eax
877: c1 e0 03 shl $0x3,%eax
87a: 01 45 f4 add %eax,0xfffffff4(%ebp)
p->s.size = nunits;
87d: 8b 55 f4 mov 0xfffffff4(%ebp),%edx
880: 8b 45 fc mov 0xfffffffc(%ebp),%eax
883: 89 42 04 mov %eax,0x4(%edx)
}
freep = prevp;
886: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
889: a3 8c 10 00 00 mov %eax,0x108c
return (void*) (p + 1);
88e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
891: 83 c0 08 add $0x8,%eax
894: 89 45 ec mov %eax,0xffffffec(%ebp)
897: eb 3a jmp 8d3 <malloc+0xe3>
}
if(p == freep)
899: a1 8c 10 00 00 mov 0x108c,%eax
89e: 39 45 f4 cmp %eax,0xfffffff4(%ebp)
8a1: 75 1d jne 8c0 <malloc+0xd0>
if((p = morecore(nunits)) == 0)
8a3: 8b 45 fc mov 0xfffffffc(%ebp),%eax
8a6: 89 04 24 mov %eax,(%esp)
8a9: e8 c2 fe ff ff call 770 <morecore>
8ae: 89 45 f4 mov %eax,0xfffffff4(%ebp)
8b1: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp)
8b5: 75 09 jne 8c0 <malloc+0xd0>
return 0;
8b7: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
8be: eb 13 jmp 8d3 <malloc+0xe3>
8c0: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
8c3: 89 45 f8 mov %eax,0xfffffff8(%ebp)
8c6: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
8c9: 8b 00 mov (%eax),%eax
8cb: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
8ce: e9 6b ff ff ff jmp 83e <malloc+0x4e>
8d3: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
8d6: c9 leave
8d7: c3 ret
8d8: 90 nop
8d9: 90 nop
8da: 90 nop
8db: 90 nop
8dc: 90 nop
8dd: 90 nop
8de: 90 nop
8df: 90 nop
000008e0 <lwip_chksum>:
static u16_t
lwip_chksum(void *dataptr, int len)
{
8e0: 55 push %ebp
8e1: 89 e5 mov %esp,%ebp
8e3: 83 ec 18 sub $0x18,%esp
u32_t acc;
LWIP_DEBUGF(INET_DEBUG, ("lwip_chksum(%p, %d)\n", (void *)dataptr, len));
for(acc = 0; len > 1; len -= 2) {
8e6: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
8ed: eb 19 jmp 908 <lwip_chksum+0x28>
/* acc = acc + *((u16_t *)dataptr)++;*/
acc += *(u16_t *)dataptr;
8ef: 8b 45 08 mov 0x8(%ebp),%eax
8f2: 0f b7 00 movzwl (%eax),%eax
8f5: 0f b7 c0 movzwl %ax,%eax
8f8: 01 45 fc add %eax,0xfffffffc(%ebp)
dataptr = (void *)((u16_t *)dataptr + 1);
8fb: 8b 45 08 mov 0x8(%ebp),%eax
8fe: 83 c0 02 add $0x2,%eax
901: 89 45 08 mov %eax,0x8(%ebp)
904: 83 6d 0c 02 subl $0x2,0xc(%ebp)
908: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
90c: 7f e1 jg 8ef <lwip_chksum+0xf>
}
/* add up any odd byte */
if (len == 1) {
90e: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
912: 75 1d jne 931 <lwip_chksum+0x51>
acc += htons((u16_t)((*(u8_t *)dataptr) & 0xff) << 8);
914: 8b 45 08 mov 0x8(%ebp),%eax
917: 0f b6 00 movzbl (%eax),%eax
91a: 0f b6 c0 movzbl %al,%eax
91d: c1 e0 08 shl $0x8,%eax
920: 0f b7 c0 movzwl %ax,%eax
923: 89 04 24 mov %eax,(%esp)
926: e8 85 06 00 00 call fb0 <htons>
92b: 0f b7 c0 movzwl %ax,%eax
92e: 01 45 fc add %eax,0xfffffffc(%ebp)
LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", (unsigned int)(*(u8_t *)dataptr)));
} else {
LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: no odd byte\n"));
}
acc = (acc >> 16) + (acc & 0xffffUL);
931: 8b 45 fc mov 0xfffffffc(%ebp),%eax
934: 89 c2 mov %eax,%edx
936: c1 ea 10 shr $0x10,%edx
939: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
93d: 8d 04 02 lea (%edx,%eax,1),%eax
940: 89 45 fc mov %eax,0xfffffffc(%ebp)
if ((acc & 0xffff0000) != 0) {
943: 8b 45 fc mov 0xfffffffc(%ebp),%eax
946: 66 b8 00 00 mov $0x0,%ax
94a: 85 c0 test %eax,%eax
94c: 74 12 je 960 <lwip_chksum+0x80>
acc = (acc >> 16) + (acc & 0xffffUL);
94e: 8b 45 fc mov 0xfffffffc(%ebp),%eax
951: 89 c2 mov %eax,%edx
953: c1 ea 10 shr $0x10,%edx
956: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
95a: 8d 04 02 lea (%edx,%eax,1),%eax
95d: 89 45 fc mov %eax,0xfffffffc(%ebp)
}
return (u16_t)acc;
960: 8b 45 fc mov 0xfffffffc(%ebp),%eax
963: 0f b7 c0 movzwl %ax,%eax
}
966: c9 leave
967: c3 ret
968: 90 nop
969: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi
00000970 <inet_chksum_pseudo>:
/* inet_chksum_pseudo:
*
* Calculates the pseudo Internet checksum used by TCP and UDP for a pbuf chain.
*/
u16_t
inet_chksum_pseudo(struct pbuf *p,
struct ip_addr *src, struct ip_addr *dest,
u8_t proto, u16_t proto_len)
{
970: 55 push %ebp
971: 89 e5 mov %esp,%ebp
973: 83 ec 28 sub $0x28,%esp
976: 8b 45 14 mov 0x14(%ebp),%eax
979: 8b 55 18 mov 0x18(%ebp),%edx
97c: 88 45 ec mov %al,0xffffffec(%ebp)
97f: 66 89 55 e8 mov %dx,0xffffffe8(%ebp)
u32_t acc;
struct pbuf *q;
u8_t swapped;
acc = 0;
983: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
swapped = 0;
98a: c6 45 ff 00 movb $0x0,0xffffffff(%ebp)
/* iterate through all pbuf in chain */
for(q = p; q != NULL; q = q->next) {
98e: 8b 45 08 mov 0x8(%ebp),%eax
991: 89 45 f8 mov %eax,0xfffffff8(%ebp)
994: eb 7b jmp a11 <inet_chksum_pseudo+0xa1>
LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
(void *)q, (void *)q->next));
acc += lwip_chksum(q->payload, q->len);
996: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
999: 0f b7 40 0a movzwl 0xa(%eax),%eax
99d: 0f b7 d0 movzwl %ax,%edx
9a0: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
9a3: 8b 40 04 mov 0x4(%eax),%eax
9a6: 89 54 24 04 mov %edx,0x4(%esp)
9aa: 89 04 24 mov %eax,(%esp)
9ad: e8 2e ff ff ff call 8e0 <lwip_chksum>
9b2: 0f b7 c0 movzwl %ax,%eax
9b5: 01 45 f4 add %eax,0xfffffff4(%ebp)
/*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%lx \n", acc));*/
while (acc >> 16) {
9b8: eb 10 jmp 9ca <inet_chksum_pseudo+0x5a>
acc = (acc & 0xffffUL) + (acc >> 16);
9ba: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
9be: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
9c1: c1 e8 10 shr $0x10,%eax
9c4: 8d 04 02 lea (%edx,%eax,1),%eax
9c7: 89 45 f4 mov %eax,0xfffffff4(%ebp)
9ca: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
9cd: c1 e8 10 shr $0x10,%eax
9d0: 85 c0 test %eax,%eax
9d2: 75 e6 jne 9ba <inet_chksum_pseudo+0x4a>
}
if (q->len % 2 != 0) {
9d4: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
9d7: 0f b7 40 0a movzwl 0xa(%eax),%eax
9db: 0f b7 c0 movzwl %ax,%eax
9de: 83 e0 01 and $0x1,%eax
9e1: 84 c0 test %al,%al
9e3: 74 24 je a09 <inet_chksum_pseudo+0x99>
swapped = 1 - swapped;
9e5: b8 01 00 00 00 mov $0x1,%eax
9ea: 2a 45 ff sub 0xffffffff(%ebp),%al
9ed: 88 45 ff mov %al,0xffffffff(%ebp)
acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);
9f0: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
9f4: 89 c2 mov %eax,%edx
9f6: c1 e2 08 shl $0x8,%edx
9f9: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
9fc: 25 00 ff 00 00 and $0xff00,%eax
a01: c1 e8 08 shr $0x8,%eax
a04: 09 d0 or %edx,%eax
a06: 89 45 f4 mov %eax,0xfffffff4(%ebp)
a09: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a0c: 8b 00 mov (%eax),%eax
a0e: 89 45 f8 mov %eax,0xfffffff8(%ebp)
a11: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
a15: 0f 85 7b ff ff ff jne 996 <inet_chksum_pseudo+0x26>
}
/*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%lx \n", acc));*/
}
if (swapped) {
a1b: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp)
a1f: 74 19 je a3a <inet_chksum_pseudo+0xca>
acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);
a21: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
a25: 89 c2 mov %eax,%edx
a27: c1 e2 08 shl $0x8,%edx
a2a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
a2d: 25 00 ff 00 00 and $0xff00,%eax
a32: c1 e8 08 shr $0x8,%eax
a35: 09 d0 or %edx,%eax
a37: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
acc += (src->addr & 0xffffUL);
a3a: 8b 45 0c mov 0xc(%ebp),%eax
a3d: 8b 00 mov (%eax),%eax
a3f: 25 ff ff 00 00 and $0xffff,%eax
a44: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += ((src->addr >> 16) & 0xffffUL);
a47: 8b 45 0c mov 0xc(%ebp),%eax
a4a: 8b 00 mov (%eax),%eax
a4c: c1 e8 10 shr $0x10,%eax
a4f: 25 ff ff 00 00 and $0xffff,%eax
a54: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (dest->addr & 0xffffUL);
a57: 8b 45 10 mov 0x10(%ebp),%eax
a5a: 8b 00 mov (%eax),%eax
a5c: 25 ff ff 00 00 and $0xffff,%eax
a61: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += ((dest->addr >> 16) & 0xffffUL);
a64: 8b 45 10 mov 0x10(%ebp),%eax
a67: 8b 00 mov (%eax),%eax
a69: c1 e8 10 shr $0x10,%eax
a6c: 25 ff ff 00 00 and $0xffff,%eax
a71: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (u32_t)htons((u16_t)proto);
a74: 0f b6 45 ec movzbl 0xffffffec(%ebp),%eax
a78: 89 04 24 mov %eax,(%esp)
a7b: e8 30 05 00 00 call fb0 <htons>
a80: 0f b7 c0 movzwl %ax,%eax
a83: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (u32_t)htons(proto_len);
a86: 0f b7 45 e8 movzwl 0xffffffe8(%ebp),%eax
a8a: 89 04 24 mov %eax,(%esp)
a8d: e8 1e 05 00 00 call fb0 <htons>
a92: 0f b7 c0 movzwl %ax,%eax
a95: 01 45 f4 add %eax,0xfffffff4(%ebp)
while (acc >> 16) {
a98: eb 10 jmp aaa <inet_chksum_pseudo+0x13a>
acc = (acc & 0xffffUL) + (acc >> 16);
a9a: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
a9e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
aa1: c1 e8 10 shr $0x10,%eax
aa4: 8d 04 02 lea (%edx,%eax,1),%eax
aa7: 89 45 f4 mov %eax,0xfffffff4(%ebp)
aaa: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
aad: c1 e8 10 shr $0x10,%eax
ab0: 85 c0 test %eax,%eax
ab2: 75 e6 jne a9a <inet_chksum_pseudo+0x12a>
}
LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%lx\n", acc));
return ~(acc & 0xffffUL);
ab4: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
ab7: f7 d0 not %eax
ab9: 0f b7 c0 movzwl %ax,%eax
}
abc: c9 leave
abd: c3 ret
abe: 89 f6 mov %esi,%esi
00000ac0 <inet_chksum>:
/* inet_chksum:
*
* Calculates the Internet checksum over a portion of memory. Used primarely for IP
* and ICMP.
*/
u16_t
inet_chksum(void *dataptr, u16_t len)
{
ac0: 55 push %ebp
ac1: 89 e5 mov %esp,%ebp
ac3: 83 ec 28 sub $0x28,%esp
ac6: 8b 45 0c mov 0xc(%ebp),%eax
ac9: 66 89 45 ec mov %ax,0xffffffec(%ebp)
u32_t acc;
acc = lwip_chksum(dataptr, len);
acd: 0f b7 45 ec movzwl 0xffffffec(%ebp),%eax
ad1: 89 44 24 04 mov %eax,0x4(%esp)
ad5: 8b 45 08 mov 0x8(%ebp),%eax
ad8: 89 04 24 mov %eax,(%esp)
adb: e8 00 fe ff ff call 8e0 <lwip_chksum>
ae0: 0f b7 c0 movzwl %ax,%eax
ae3: 89 45 fc mov %eax,0xfffffffc(%ebp)
while (acc >> 16) {
ae6: eb 10 jmp af8 <inet_chksum+0x38>
acc = (acc & 0xffff) + (acc >> 16);
ae8: 0f b7 55 fc movzwl 0xfffffffc(%ebp),%edx
aec: 8b 45 fc mov 0xfffffffc(%ebp),%eax
aef: c1 e8 10 shr $0x10,%eax
af2: 8d 04 02 lea (%edx,%eax,1),%eax
af5: 89 45 fc mov %eax,0xfffffffc(%ebp)
af8: 8b 45 fc mov 0xfffffffc(%ebp),%eax
afb: c1 e8 10 shr $0x10,%eax
afe: 85 c0 test %eax,%eax
b00: 75 e6 jne ae8 <inet_chksum+0x28>
}
return ~(acc & 0xffff);
b02: 8b 45 fc mov 0xfffffffc(%ebp),%eax
b05: f7 d0 not %eax
b07: 0f b7 c0 movzwl %ax,%eax
}
b0a: c9 leave
b0b: c3 ret
b0c: 8d 74 26 00 lea 0x0(%esi),%esi
00000b10 <inet_chksum_pbuf>:
u16_t
inet_chksum_pbuf(struct pbuf *p)
{
b10: 55 push %ebp
b11: 89 e5 mov %esp,%ebp
b13: 83 ec 18 sub $0x18,%esp
u32_t acc;
struct pbuf *q;
u8_t swapped;
acc = 0;
b16: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
swapped = 0;
b1d: c6 45 ff 00 movb $0x0,0xffffffff(%ebp)
for(q = p; q != NULL; q = q->next) {
b21: 8b 45 08 mov 0x8(%ebp),%eax
b24: 89 45 f8 mov %eax,0xfffffff8(%ebp)
b27: eb 69 jmp b92 <inet_chksum_pbuf+0x82>
acc += lwip_chksum(q->payload, q->len);
b29: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b2c: 0f b7 40 0a movzwl 0xa(%eax),%eax
b30: 0f b7 d0 movzwl %ax,%edx
b33: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b36: 8b 40 04 mov 0x4(%eax),%eax
b39: 89 54 24 04 mov %edx,0x4(%esp)
b3d: 89 04 24 mov %eax,(%esp)
b40: e8 9b fd ff ff call 8e0 <lwip_chksum>
b45: 0f b7 c0 movzwl %ax,%eax
b48: 01 45 f4 add %eax,0xfffffff4(%ebp)
while (acc >> 16) {
b4b: eb 10 jmp b5d <inet_chksum_pbuf+0x4d>
acc = (acc & 0xffffUL) + (acc >> 16);
b4d: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
b51: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
b54: c1 e8 10 shr $0x10,%eax
b57: 8d 04 02 lea (%edx,%eax,1),%eax
b5a: 89 45 f4 mov %eax,0xfffffff4(%ebp)
b5d: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
b60: c1 e8 10 shr $0x10,%eax
b63: 85 c0 test %eax,%eax
b65: 75 e6 jne b4d <inet_chksum_pbuf+0x3d>
}
if (q->len % 2 != 0) {
b67: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b6a: 0f b7 40 0a movzwl 0xa(%eax),%eax
b6e: 0f b7 c0 movzwl %ax,%eax
b71: 83 e0 01 and $0x1,%eax
b74: 84 c0 test %al,%al
b76: 74 12 je b8a <inet_chksum_pbuf+0x7a>
swapped = 1 - swapped;
b78: b8 01 00 00 00 mov $0x1,%eax
b7d: 2a 45 ff sub 0xffffffff(%ebp),%al
b80: 88 45 ff mov %al,0xffffffff(%ebp)
acc = (acc & 0x00ffUL << 8) | (acc & 0xff00UL >> 8);
b83: 81 65 f4 ff ff 00 00 andl $0xffff,0xfffffff4(%ebp)
b8a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b8d: 8b 00 mov (%eax),%eax
b8f: 89 45 f8 mov %eax,0xfffffff8(%ebp)
b92: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
b96: 75 91 jne b29 <inet_chksum_pbuf+0x19>
}
}
if (swapped) {
b98: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp)
b9c: 74 19 je bb7 <inet_chksum_pbuf+0xa7>
acc = ((acc & 0x00ffUL) << 8) | ((acc & 0xff00UL) >> 8);
b9e: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
ba2: 89 c2 mov %eax,%edx
ba4: c1 e2 08 shl $0x8,%edx
ba7: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
baa: 25 00 ff 00 00 and $0xff00,%eax
baf: c1 e8 08 shr $0x8,%eax
bb2: 09 d0 or %edx,%eax
bb4: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
return ~(acc & 0xffffUL);
bb7: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bba: f7 d0 not %eax
bbc: 0f b7 c0 movzwl %ax,%eax
}
bbf: c9 leave
bc0: c3 ret
bc1: eb 0d jmp bd0 <inet_addr>
bc3: 90 nop
bc4: 90 nop
bc5: 90 nop
bc6: 90 nop
bc7: 90 nop
bc8: 90 nop
bc9: 90 nop
bca: 90 nop
bcb: 90 nop
bcc: 90 nop
bcd: 90 nop
bce: 90 nop
bcf: 90 nop
00000bd0 <inet_addr>:
/* Here for now until needed in other places in lwIP */
#ifndef isascii
#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up)
#define isascii(c) in_range(c, 0x20, 0x7f)
#define isdigit(c) in_range(c, '0', '9')
#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F'))
#define islower(c) in_range(c, 'a', 'z')
#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
#endif
/*
* Ascii internet address interpretation routine.
* The value returned is in network order.
*/
/* */
/* inet_addr */
u32_t inet_addr(const char *cp)
{
bd0: 55 push %ebp
bd1: 89 e5 mov %esp,%ebp
bd3: 83 ec 28 sub $0x28,%esp
struct in_addr val;
if (inet_aton(cp, &val)) {
bd6: 8d 45 fc lea 0xfffffffc(%ebp),%eax
bd9: 89 44 24 04 mov %eax,0x4(%esp)
bdd: 8b 45 08 mov 0x8(%ebp),%eax
be0: 89 04 24 mov %eax,(%esp)
be3: e8 18 00 00 00 call c00 <inet_aton>
be8: 85 c0 test %eax,%eax
bea: 74 08 je bf4 <inet_addr+0x24>
return (val.s_addr);
bec: 8b 45 fc mov 0xfffffffc(%ebp),%eax
bef: 89 45 ec mov %eax,0xffffffec(%ebp)
bf2: eb 07 jmp bfb <inet_addr+0x2b>
}
return (INADDR_NONE);
bf4: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp)
bfb: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
bfe: c9 leave
bff: c3 ret
00000c00 <inet_aton>:
/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
* This replaces inet_addr, the return value from which
* cannot distinguish between failure and a local broadcast address.
*/
/* */
/* inet_aton */
int inet_aton(const char *cp, struct in_addr *addr)
{
c00: 55 push %ebp
c01: 89 e5 mov %esp,%ebp
c03: 83 ec 48 sub $0x48,%esp
u32_t val;
int base, n;
char c;
u32_t parts[4];
u32_t* pp = parts;
c06: 8d 45 dc lea 0xffffffdc(%ebp),%eax
c09: 89 45 fc mov %eax,0xfffffffc(%ebp)
c = *cp;
c0c: 8b 45 08 mov 0x8(%ebp),%eax
c0f: 0f b6 00 movzbl (%eax),%eax
c12: 88 45 fb mov %al,0xfffffffb(%ebp)
for (;;) {
/*
* Collect number up to ``.''.
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
if (!isdigit(c))
c15: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
c19: 3c 2f cmp $0x2f,%al
c1b: 76 08 jbe c25 <inet_aton+0x25>
c1d: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
c21: 3c 39 cmp $0x39,%al
c23: 76 0c jbe c31 <inet_aton+0x31>
return (0);
c25: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
c2c: e9 78 02 00 00 jmp ea9 <inet_aton+0x2a9>
val = 0; base = 10;
c31: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
c38: c7 45 f0 0a 00 00 00 movl $0xa,0xfffffff0(%ebp)
if (c == '0') {
c3f: 80 7d fb 30 cmpb $0x30,0xfffffffb(%ebp)
c43: 75 36 jne c7b <inet_aton+0x7b>
c = *++cp;
c45: 83 45 08 01 addl $0x1,0x8(%ebp)
c49: 8b 45 08 mov 0x8(%ebp),%eax
c4c: 0f b6 00 movzbl (%eax),%eax
c4f: 88 45 fb mov %al,0xfffffffb(%ebp)
if (c == 'x' || c == 'X')
c52: 80 7d fb 78 cmpb $0x78,0xfffffffb(%ebp)
c56: 74 06 je c5e <inet_aton+0x5e>
c58: 80 7d fb 58 cmpb $0x58,0xfffffffb(%ebp)
c5c: 75 16 jne c74 <inet_aton+0x74>
base = 16, c = *++cp;
c5e: c7 45 f0 10 00 00 00 movl $0x10,0xfffffff0(%ebp)
c65: 83 45 08 01 addl $0x1,0x8(%ebp)
c69: 8b 45 08 mov 0x8(%ebp),%eax
c6c: 0f b6 00 movzbl (%eax),%eax
c6f: 88 45 fb mov %al,0xfffffffb(%ebp)
c72: eb 07 jmp c7b <inet_aton+0x7b>
else
base = 8;
c74: c7 45 f0 08 00 00 00 movl $0x8,0xfffffff0(%ebp)
}
for (;;) {
if (isascii(c) && isdigit(c)) {
c7b: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
c7f: 3c 1f cmp $0x1f,%al
c81: 76 3b jbe cbe <inet_aton+0xbe>
c83: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
c87: 78 35 js cbe <inet_aton+0xbe>
c89: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
c8d: 3c 2f cmp $0x2f,%al
c8f: 76 2d jbe cbe <inet_aton+0xbe>
c91: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
c95: 3c 39 cmp $0x39,%al
c97: 77 25 ja cbe <inet_aton+0xbe>
val = (val * base) + (c - '0');
c99: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
c9c: 89 c2 mov %eax,%edx
c9e: 0f af 55 ec imul 0xffffffec(%ebp),%edx
ca2: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax
ca6: 8d 04 02 lea (%edx,%eax,1),%eax
ca9: 83 e8 30 sub $0x30,%eax
cac: 89 45 ec mov %eax,0xffffffec(%ebp)
c = *++cp;
caf: 83 45 08 01 addl $0x1,0x8(%ebp)
cb3: 8b 45 08 mov 0x8(%ebp),%eax
cb6: 0f b6 00 movzbl (%eax),%eax
cb9: 88 45 fb mov %al,0xfffffffb(%ebp)
cbc: eb bd jmp c7b <inet_aton+0x7b>
} else if (base == 16 && isascii(c) && isxdigit(c)) {
cbe: 83 7d f0 10 cmpl $0x10,0xfffffff0(%ebp)
cc2: 0f 85 99 00 00 00 jne d61 <inet_aton+0x161>
cc8: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
ccc: 3c 1f cmp $0x1f,%al
cce: 0f 86 8d 00 00 00 jbe d61 <inet_aton+0x161>
cd4: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
cd8: 0f 88 83 00 00 00 js d61 <inet_aton+0x161>
cde: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
ce2: 3c 2f cmp $0x2f,%al
ce4: 76 08 jbe cee <inet_aton+0xee>
ce6: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
cea: 3c 39 cmp $0x39,%al
cec: 76 20 jbe d0e <inet_aton+0x10e>
cee: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
cf2: 3c 60 cmp $0x60,%al
cf4: 76 08 jbe cfe <inet_aton+0xfe>
cf6: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
cfa: 3c 66 cmp $0x66,%al
cfc: 76 10 jbe d0e <inet_aton+0x10e>
cfe: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
d02: 3c 40 cmp $0x40,%al
d04: 76 5b jbe d61 <inet_aton+0x161>
d06: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
d0a: 3c 46 cmp $0x46,%al
d0c: 77 53 ja d61 <inet_aton+0x161>
val = (val << 4) |
d0e: 8b 45 ec mov 0xffffffec(%ebp),%eax
d11: 89 c2 mov %eax,%edx
d13: c1 e2 04 shl $0x4,%edx
d16: 89 55 c4 mov %edx,0xffffffc4(%ebp)
d19: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax
d1d: 83 c0 0a add $0xa,%eax
d20: 89 45 c8 mov %eax,0xffffffc8(%ebp)
d23: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
d27: 3c 60 cmp $0x60,%al
d29: 76 11 jbe d3c <inet_aton+0x13c>
d2b: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
d2f: 3c 7a cmp $0x7a,%al
d31: 77 09 ja d3c <inet_aton+0x13c>
d33: c7 45 cc 61 00 00 00 movl $0x61,0xffffffcc(%ebp)
d3a: eb 07 jmp d43 <inet_aton+0x143>
d3c: c7 45 cc 41 00 00 00 movl $0x41,0xffffffcc(%ebp)
d43: 8b 45 c8 mov 0xffffffc8(%ebp),%eax
d46: 2b 45 cc sub 0xffffffcc(%ebp),%eax
d49: 0b 45 c4 or 0xffffffc4(%ebp),%eax
d4c: 89 45 ec mov %eax,0xffffffec(%ebp)
(c + 10 - (islower(c) ? 'a' : 'A'));
c = *++cp;
d4f: 83 45 08 01 addl $0x1,0x8(%ebp)
d53: 8b 45 08 mov 0x8(%ebp),%eax
d56: 0f b6 00 movzbl (%eax),%eax
d59: 88 45 fb mov %al,0xfffffffb(%ebp)
} else
break;
}
d5c: e9 1a ff ff ff jmp c7b <inet_aton+0x7b>
if (c == '.') {
d61: 80 7d fb 2e cmpb $0x2e,0xfffffffb(%ebp)
d65: 75 35 jne d9c <inet_aton+0x19c>
/*
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
if (pp >= parts + 3)
d67: 8d 45 dc lea 0xffffffdc(%ebp),%eax
d6a: 83 c0 0c add $0xc,%eax
d6d: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
d70: 77 0c ja d7e <inet_aton+0x17e>
return (0);
d72: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
d79: e9 2b 01 00 00 jmp ea9 <inet_aton+0x2a9>
*pp++ = val;
d7e: 8b 55 fc mov 0xfffffffc(%ebp),%edx
d81: 8b 45 ec mov 0xffffffec(%ebp),%eax
d84: 89 02 mov %eax,(%edx)
d86: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
c = *++cp;
d8a: 83 45 08 01 addl $0x1,0x8(%ebp)
d8e: 8b 45 08 mov 0x8(%ebp),%eax
d91: 0f b6 00 movzbl (%eax),%eax
d94: 88 45 fb mov %al,0xfffffffb(%ebp)
} else
break;
}
d97: e9 79 fe ff ff jmp c15 <inet_aton+0x15>
/*
* Check for trailing characters.
*/
if (c != '\0' && (!isascii(c) || !isspace(c)))
d9c: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
da0: 74 3e je de0 <inet_aton+0x1e0>
da2: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
da6: 3c 1f cmp $0x1f,%al
da8: 76 2a jbe dd4 <inet_aton+0x1d4>
daa: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
dae: 78 24 js dd4 <inet_aton+0x1d4>
db0: 80 7d fb 20 cmpb $0x20,0xfffffffb(%ebp)
db4: 74 2a je de0 <inet_aton+0x1e0>
db6: 80 7d fb 0c cmpb $0xc,0xfffffffb(%ebp)
dba: 74 24 je de0 <inet_aton+0x1e0>
dbc: 80 7d fb 0a cmpb $0xa,0xfffffffb(%ebp)
dc0: 74 1e je de0 <inet_aton+0x1e0>
dc2: 80 7d fb 0d cmpb $0xd,0xfffffffb(%ebp)
dc6: 74 18 je de0 <inet_aton+0x1e0>
dc8: 80 7d fb 09 cmpb $0x9,0xfffffffb(%ebp)
dcc: 74 12 je de0 <inet_aton+0x1e0>
dce: 80 7d fb 0b cmpb $0xb,0xfffffffb(%ebp)
dd2: 74 0c je de0 <inet_aton+0x1e0>
return (0);
dd4: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
ddb: e9 c9 00 00 00 jmp ea9 <inet_aton+0x2a9>
/*
* Concoct the address according to
* the number of parts specified.
*/
n = pp - parts + 1;
de0: 8b 55 fc mov 0xfffffffc(%ebp),%edx
de3: 8d 45 dc lea 0xffffffdc(%ebp),%eax
de6: 89 d1 mov %edx,%ecx
de8: 29 c1 sub %eax,%ecx
dea: 89 c8 mov %ecx,%eax
dec: c1 f8 02 sar $0x2,%eax
def: 83 c0 01 add $0x1,%eax
df2: 89 45 f4 mov %eax,0xfffffff4(%ebp)
switch (n) {
df5: 83 7d f4 04 cmpl $0x4,0xfffffff4(%ebp)
df9: 0f 87 8b 00 00 00 ja e8a <inet_aton+0x28a>
dff: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
e02: c1 e0 02 shl $0x2,%eax
e05: 8b 80 5c 10 00 00 mov 0x105c(%eax),%eax
e0b: ff e0 jmp *%eax
case 0:
return (0); /* initial nondigit */
e0d: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
e14: e9 90 00 00 00 jmp ea9 <inet_aton+0x2a9>
case 1: /* a -- 32 bits */
break;
case 2: /* a.b -- 8.24 bits */
if (val > 0xffffff)
e19: 81 7d ec ff ff ff 00 cmpl $0xffffff,0xffffffec(%ebp)
e20: 76 09 jbe e2b <inet_aton+0x22b>
return (0);
e22: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
e29: eb 7e jmp ea9 <inet_aton+0x2a9>
val |= parts[0] << 24;
e2b: 8b 45 dc mov 0xffffffdc(%ebp),%eax
e2e: c1 e0 18 shl $0x18,%eax
e31: 09 45 ec or %eax,0xffffffec(%ebp)
break;
e34: eb 54 jmp e8a <inet_aton+0x28a>
case 3: /* a.b.c -- 8.8.16 bits */
if (val > 0xffff)
e36: 81 7d ec ff ff 00 00 cmpl $0xffff,0xffffffec(%ebp)
e3d: 76 09 jbe e48 <inet_aton+0x248>
return (0);
e3f: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
e46: eb 61 jmp ea9 <inet_aton+0x2a9>
val |= (parts[0] << 24) | (parts[1] << 16);
e48: 8b 45 dc mov 0xffffffdc(%ebp),%eax
e4b: 89 c2 mov %eax,%edx
e4d: c1 e2 18 shl $0x18,%edx
e50: 8b 45 e0 mov 0xffffffe0(%ebp),%eax
e53: c1 e0 10 shl $0x10,%eax
e56: 09 d0 or %edx,%eax
e58: 09 45 ec or %eax,0xffffffec(%ebp)
break;
e5b: eb 2d jmp e8a <inet_aton+0x28a>
case 4: /* a.b.c.d -- 8.8.8.8 bits */
if (val > 0xff)
e5d: 81 7d ec ff 00 00 00 cmpl $0xff,0xffffffec(%ebp)
e64: 76 09 jbe e6f <inet_aton+0x26f>
return (0);
e66: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
e6d: eb 3a jmp ea9 <inet_aton+0x2a9>
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
e6f: 8b 45 dc mov 0xffffffdc(%ebp),%eax
e72: 89 c2 mov %eax,%edx
e74: c1 e2 18 shl $0x18,%edx
e77: 8b 45 e0 mov 0xffffffe0(%ebp),%eax
e7a: c1 e0 10 shl $0x10,%eax
e7d: 09 c2 or %eax,%edx
e7f: 8b 45 e4 mov 0xffffffe4(%ebp),%eax
e82: c1 e0 08 shl $0x8,%eax
e85: 09 d0 or %edx,%eax
e87: 09 45 ec or %eax,0xffffffec(%ebp)
break;
}
if (addr)
e8a: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
e8e: 74 12 je ea2 <inet_aton+0x2a2>
addr->s_addr = htonl(val);
e90: 8b 45 ec mov 0xffffffec(%ebp),%eax
e93: 89 04 24 mov %eax,(%esp)
e96: e8 65 01 00 00 call 1000 <htonl>
e9b: 89 c2 mov %eax,%edx
e9d: 8b 45 0c mov 0xc(%ebp),%eax
ea0: 89 10 mov %edx,(%eax)
return (1);
ea2: c7 45 c0 01 00 00 00 movl $0x1,0xffffffc0(%ebp)
ea9: 8b 45 c0 mov 0xffffffc0(%ebp),%eax
}
eac: c9 leave
ead: c3 ret
eae: 89 f6 mov %esi,%esi
00000eb0 <inet_ntoa>:
/* Convert numeric IP address into decimal dotted ASCII representation.
* returns ptr to static buffer; not reentrant!
*/
char *inet_ntoa(struct in_addr addr)
{
eb0: 55 push %ebp
eb1: 89 e5 mov %esp,%ebp
eb3: 53 push %ebx
eb4: 83 ec 24 sub $0x24,%esp
static char str[16];
u32_t s_addr = addr.s_addr;
eb7: 8b 45 08 mov 0x8(%ebp),%eax
eba: 89 45 ec mov %eax,0xffffffec(%ebp)
char inv[3];
char *rp;
char *ap;
u8_t rem;
u8_t n;
u8_t i;
rp = str;
ebd: c7 45 f0 90 10 00 00 movl $0x1090,0xfffffff0(%ebp)
ap = (u8_t *)&s_addr;
ec4: 8d 45 ec lea 0xffffffec(%ebp),%eax
ec7: 89 45 f4 mov %eax,0xfffffff4(%ebp)
for(n = 0; n < 4; n++) {
eca: c6 45 fa 00 movb $0x0,0xfffffffa(%ebp)
ece: e9 af 00 00 00 jmp f82 <inet_ntoa+0xd2>
i = 0;
ed3: c6 45 fb 00 movb $0x0,0xfffffffb(%ebp)
do {
rem = *ap % (u8_t)10;
ed7: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
eda: 0f b6 08 movzbl (%eax),%ecx
edd: b8 67 00 00 00 mov $0x67,%eax
ee2: f6 e9 imul %cl
ee4: 66 c1 e8 08 shr $0x8,%ax
ee8: 89 c2 mov %eax,%edx
eea: c0 fa 02 sar $0x2,%dl
eed: 89 c8 mov %ecx,%eax
eef: c0 f8 07 sar $0x7,%al
ef2: 89 d3 mov %edx,%ebx
ef4: 28 c3 sub %al,%bl
ef6: 88 5d db mov %bl,0xffffffdb(%ebp)
ef9: 0f b6 45 db movzbl 0xffffffdb(%ebp),%eax
efd: c1 e0 02 shl $0x2,%eax
f00: 02 45 db add 0xffffffdb(%ebp),%al
f03: 01 c0 add %eax,%eax
f05: 89 ca mov %ecx,%edx
f07: 28 c2 sub %al,%dl
f09: 88 55 db mov %dl,0xffffffdb(%ebp)
f0c: 0f b6 5d db movzbl 0xffffffdb(%ebp),%ebx
f10: 88 5d f9 mov %bl,0xfffffff9(%ebp)
*ap /= (u8_t)10;
f13: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
f16: 0f b6 08 movzbl (%eax),%ecx
f19: b8 67 00 00 00 mov $0x67,%eax
f1e: f6 e9 imul %cl
f20: 66 c1 e8 08 shr $0x8,%ax
f24: 89 c2 mov %eax,%edx
f26: c0 fa 02 sar $0x2,%dl
f29: 89 c8 mov %ecx,%eax
f2b: c0 f8 07 sar $0x7,%al
f2e: 28 c2 sub %al,%dl
f30: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
f33: 88 10 mov %dl,(%eax)
inv[i++] = '0' + rem;
f35: 0f b6 55 fb movzbl 0xfffffffb(%ebp),%edx
f39: 0f b6 45 f9 movzbl 0xfffffff9(%ebp),%eax
f3d: 83 c0 30 add $0x30,%eax
f40: 88 44 15 e9 mov %al,0xffffffe9(%ebp,%edx,1)
f44: 80 45 fb 01 addb $0x1,0xfffffffb(%ebp)
} while(*ap);
f48: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
f4b: 0f b6 00 movzbl (%eax),%eax
f4e: 84 c0 test %al,%al
f50: 75 85 jne ed7 <inet_ntoa+0x27>
while(i--)
f52: eb 12 jmp f66 <inet_ntoa+0xb6>
*rp++ = inv[i];
f54: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
f58: 0f b6 54 05 e9 movzbl 0xffffffe9(%ebp,%eax,1),%edx
f5d: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
f60: 88 10 mov %dl,(%eax)
f62: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
f66: 80 6d fb 01 subb $0x1,0xfffffffb(%ebp)
f6a: 80 7d fb ff cmpb $0xff,0xfffffffb(%ebp)
f6e: 75 e4 jne f54 <inet_ntoa+0xa4>
*rp++ = '.';
f70: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
f73: c6 00 2e movb $0x2e,(%eax)
f76: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
ap++;
f7a: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp)
f7e: 80 45 fa 01 addb $0x1,0xfffffffa(%ebp)
f82: 80 7d fa 03 cmpb $0x3,0xfffffffa(%ebp)
f86: 0f 86 47 ff ff ff jbe ed3 <inet_ntoa+0x23>
}
*--rp = 0;
f8c: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp)
f90: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
f93: c6 00 00 movb $0x0,(%eax)
return str;
f96: b8 90 10 00 00 mov $0x1090,%eax
}
f9b: 83 c4 24 add $0x24,%esp
f9e: 5b pop %ebx
f9f: 5d pop %ebp
fa0: c3 ret
fa1: eb 0d jmp fb0 <htons>
fa3: 90 nop
fa4: 90 nop
fa5: 90 nop
fa6: 90 nop
fa7: 90 nop
fa8: 90 nop
fa9: 90 nop
faa: 90 nop
fab: 90 nop
fac: 90 nop
fad: 90 nop
fae: 90 nop
faf: 90 nop
00000fb0 <htons>:
#ifndef BYTE_ORDER
#error BYTE_ORDER is not defined
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
u16_t
htons(u16_t n)
{
fb0: 55 push %ebp
fb1: 89 e5 mov %esp,%ebp
fb3: 83 ec 04 sub $0x4,%esp
fb6: 8b 45 08 mov 0x8(%ebp),%eax
fb9: 66 89 45 fc mov %ax,0xfffffffc(%ebp)
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
fbd: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
fc1: 25 ff 00 00 00 and $0xff,%eax
fc6: c1 e0 08 shl $0x8,%eax
fc9: 89 c2 mov %eax,%edx
fcb: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
fcf: 25 00 ff 00 00 and $0xff00,%eax
fd4: c1 f8 08 sar $0x8,%eax
fd7: 09 d0 or %edx,%eax
fd9: 0f b7 c0 movzwl %ax,%eax
}
fdc: c9 leave
fdd: c3 ret
fde: 89 f6 mov %esi,%esi
00000fe0 <ntohs>:
u16_t
ntohs(u16_t n)
{
fe0: 55 push %ebp
fe1: 89 e5 mov %esp,%ebp
fe3: 83 ec 08 sub $0x8,%esp
fe6: 8b 45 08 mov 0x8(%ebp),%eax
fe9: 66 89 45 fc mov %ax,0xfffffffc(%ebp)
return htons(n);
fed: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
ff1: 89 04 24 mov %eax,(%esp)
ff4: e8 b7 ff ff ff call fb0 <htons>
ff9: 0f b7 c0 movzwl %ax,%eax
}
ffc: c9 leave
ffd: c3 ret
ffe: 89 f6 mov %esi,%esi
00001000 <htonl>:
u32_t
htonl(u32_t n)
{
1000: 55 push %ebp
1001: 89 e5 mov %esp,%ebp
return ((n & 0xff) << 24) |
1003: 0f b6 45 08 movzbl 0x8(%ebp),%eax
1007: 89 c2 mov %eax,%edx
1009: c1 e2 18 shl $0x18,%edx
100c: 8b 45 08 mov 0x8(%ebp),%eax
100f: 25 00 ff 00 00 and $0xff00,%eax
1014: c1 e0 08 shl $0x8,%eax
1017: 09 c2 or %eax,%edx
1019: 8b 45 08 mov 0x8(%ebp),%eax
101c: 25 00 00 ff 00 and $0xff0000,%eax
1021: c1 e8 08 shr $0x8,%eax
1024: 09 c2 or %eax,%edx
1026: 8b 45 08 mov 0x8(%ebp),%eax
1029: 25 00 00 00 ff and $0xff000000,%eax
102e: c1 e8 18 shr $0x18,%eax
1031: 09 d0 or %edx,%eax
((n & 0xff00) << 8) |
((n & 0xff0000) >> 8) |
((n & 0xff000000) >> 24);
}
1033: 5d pop %ebp
1034: c3 ret
1035: 8d 74 26 00 lea 0x0(%esi),%esi
1039: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00001040 <ntohl>:
u32_t
ntohl(u32_t n)
{
1040: 55 push %ebp
1041: 89 e5 mov %esp,%ebp
1043: 83 ec 04 sub $0x4,%esp
return htonl(n);
1046: 8b 45 08 mov 0x8(%ebp),%eax
1049: 89 04 24 mov %eax,(%esp)
104c: e8 af ff ff ff call 1000 <htonl>
}
1051: c9 leave
1052: c3 ret
| 41.098293 | 104 | 0.42157 |
fd6afedbdd72ba0c8b42a3f6d99d4de6f645cf4b | 744 | asm | Assembly | programs/oeis/267/A267815.asm | ckrause/cm | 0021b6ca0be0fbe79164e647ddfd0e65869304fe | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/267/A267815.asm | ckrause/cm | 0021b6ca0be0fbe79164e647ddfd0e65869304fe | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/267/A267815.asm | ckrause/cm | 0021b6ca0be0fbe79164e647ddfd0e65869304fe | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A267815: Binary representation of the n-th iteration of the "Rule 221" elementary cellular automaton starting with a single ON (black) cell.
; 1,11,10111,1101111,111011111,11110111111,1111101111111,111111011111111,11111110111111111,1111111101111111111,111111111011111111111,11111111110111111111111,1111111111101111111111111,111111111111011111111111111,11111111111110111111111111111,1111111111111101111111111111111,111111111111111011111111111111111,11111111111111110111111111111111111
seq $0,269911 ; Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 3", based on the 5-celled von Neumann neighborhood.
seq $0,204093 ; Numbers whose set of base-10 digits is {0,6}.
div $0,60
add $0,1
| 93 | 342 | 0.840054 |
e3faa00c5c33cc1e353d09c99bb32d0ee7e7d603 | 184 | asm | Assembly | programs/oeis/121/A121150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/121/A121150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/121/A121150.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A121150: Minimal number of vertices in an n-polyomino.
; 4,6,8,9,11,12,14,15,16,18,19,20,22,23,24,25
mov $1,$0
mul $1,2
seq $1,103128 ; a(n) = floor(sqrt(2n-1)).
add $0,$1
add $0,3
| 20.444444 | 56 | 0.630435 |
349cfd88fd0cb2ce42d6c56d9eed1209fdd96290 | 788 | asm | Assembly | nand2tetris/projects/04/mult/mult.asm | eklavyamirani/nand2tetris | bab7ac2d710227367047b66f8243ead22c902d48 | [
"MIT"
] | null | null | null | nand2tetris/projects/04/mult/mult.asm | eklavyamirani/nand2tetris | bab7ac2d710227367047b66f8243ead22c902d48 | [
"MIT"
] | null | null | null | nand2tetris/projects/04/mult/mult.asm | eklavyamirani/nand2tetris | bab7ac2d710227367047b66f8243ead22c902d48 | [
"MIT"
] | null | null | null | // This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/04/Mult.asm
// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)
// Put your code here.
// var multiplicand = R0;
// var multiplier = R1;
// var result = 0;
// for (int i=1; i <= multiplier; ++i)
// {
// result = result + multiplicand;
// }
// R2 = result;
// result = 0
@R2
M = 0;
// i = 0
@i
M = 0;
(LOOP)
// if i >= multiplier, jump to end of loop
@R1
D = M
@i
D = M - D
@END_LOOP
D; JGE
// result = result + multiplicand
@R0
D = M
@R2
M = M + D
// i++
@i
M = M + 1
// Keep looping
@LOOP
0;JMP
(END)
@END
0;JMP | 13.355932 | 66 | 0.56599 |
dc516887c8992aa8dc5ec1fc42e55b2811d13715 | 665 | asm | Assembly | engine/flag_action_predef.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | engine/flag_action.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | engine/flag_action.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | FlagActionPredef:
call GetPredefRegisters
FlagAction:
; Perform action b on bit c
; in the bitfield at hl.
; 0: reset
; 1: set
; 2: read
; Return the result in c.
push hl
push de
push bc
; bit
ld a, c
ld d, a
and 7
ld e, a
; byte
ld a, d
srl a
srl a
srl a
add l
ld l, a
jr nc, .ok
inc h
.ok
; d = 1 << e (bitmask)
inc e
ld d, 1
.shift
dec e
jr z, .shifted
sla d
jr .shift
.shifted
ld a, b
and a
jr z, .reset
cp 2
jr z, .read
.set
ld b, [hl]
ld a, d
or b
ld [hl], a
jr .done
.reset
ld b, [hl]
ld a, d
xor $ff
and b
ld [hl], a
jr .done
.read
ld b, [hl]
ld a, d
and b
.done
pop bc
pop de
pop hl
ld c, a
ret
| 8.986486 | 27 | 0.569925 |
6374db6940b176fdd9a8b6da1d1fbb717865fed3 | 326 | asm | Assembly | ffight/lcs/boss/3F.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | ffight/lcs/boss/3F.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | ffight/lcs/boss/3F.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
003CDE move.b #$3, ($3f,A3) [boss+3C]
003CE4 sub.w D5, ($18,A3) [boss+3F]
007340 move.b ($b,A2), ($3f,A3) [boss+16, enemy+16]
007346 bmi $746c [boss+3F, enemy+3F]
03ED34 move.b #$4, ($3,A6) [boss+3F]
copyright zengfr site:http://github.com/zengfr/romhack
| 32.6 | 54 | 0.650307 |
f59e56ef128070a508aca912edff8d58284b3a00 | 605 | asm | Assembly | src/test/ref/loop-while-continue.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/loop-while-continue.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/loop-while-continue.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Tests break statement in a simple loop
// Commodore 64 PRG executable file
.file [name="loop-while-continue.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label SCREEN = $400
.segment Code
main: {
ldx #0
__b1:
// while(++i<40*6)
inx
cpx #$28*6
bcc __b2
// }
rts
__b2:
// if(SCREEN[i]==' ')
lda SCREEN,x
cmp #' '
beq __b1
// SCREEN[i]++;
inc SCREEN,x
jmp __b1
}
| 20.166667 | 70 | 0.614876 |
13622d2bd31a98ecd1cd166175f812dac1112d98 | 310 | asm | Assembly | programs/oeis/021/A021928.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/021/A021928.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/021/A021928.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A021928: Decimal expansion of 1/924.
; 0,0,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1,0,8,2,2,5,1
add $0,1
mov $1,10
pow $1,$0
mul $1,7
div $1,6468
mod $1,10
mov $0,$1
| 28.181818 | 199 | 0.541935 |
40b0b0064a94c2f41198f1391df87902e5800c88 | 2,538 | asm | Assembly | src/init.asm | tewtal/sm_practice_hack | 2e435012a4259035cb69b0d3bc90a221cb5de37d | [
"Unlicense"
] | 15 | 2019-02-23T20:38:49.000Z | 2022-02-18T01:14:04.000Z | src/init.asm | tewtal/sm_practice_hack | 2e435012a4259035cb69b0d3bc90a221cb5de37d | [
"Unlicense"
] | 50 | 2019-03-06T22:02:17.000Z | 2022-03-31T05:25:54.000Z | src/init.asm | tewtal/sm_practice_hack | 2e435012a4259035cb69b0d3bc90a221cb5de37d | [
"Unlicense"
] | 20 | 2019-02-23T20:40:53.000Z | 2022-02-22T17:44:45.000Z | !SRAM_VERSION = $0009
; hijack, runs as game is starting, JSR to RAM initialization to avoid bad values
org $808455
JML init_code
org $81F000
print pc, " init start"
init_code:
{
REP #$30
PHA
; Clear WRAM
{
; We mostly use $7FFB00 and upward, so just zero everything
LDA #$0000
LDX #$04FE
.loop
STA $7FFB00,X
DEX : DEX : BPL .loop
LDA #$0000
STA !ram_slowdown_mode
}
; Check if we should initialize SRAM
+ LDA !sram_initialized : CMP #!SRAM_VERSION : BEQ .sram_initialized
JSR init_sram
.sram_initialized
; Check if any less common controller shortcuts are configured
JSL GameModeExtras
PLA
; Execute overwritten logic and return
if !FEATURE_PAL
JSL $8B90EF
else
JSL $8B9146
endif
JML $808459
}
init_sram:
{
; Controllers
LDA #$3000 : STA !sram_ctrl_menu ; Start + Select
LDA #$6010 : STA !sram_ctrl_save_state ; Select + Y + R
LDA #$6020 : STA !sram_ctrl_load_state ; Select + Y + L
LDA #$5020 : STA !sram_ctrl_load_last_preset ; Start + Y + L
LDA #$0000 : STA !sram_ctrl_full_equipment
LDA #$0000 : STA !sram_ctrl_kill_enemies
LDA #$0000 : STA !sram_ctrl_reset_segment_timer
LDA #$0000 : STA !sram_ctrl_reset_segment_later
LDA #$0000 : STA !sram_ctrl_random_preset
LDA #$0000 : STA !sram_ctrl_save_custom_preset
LDA #$0000 : STA !sram_ctrl_load_custom_preset
LDA #$0000 : STA !sram_ctrl_inc_custom_preset
LDA #$0000 : STA !sram_ctrl_dec_custom_preset
; Input Cheat Sheet ($4218)
; $8000 = B
; $4000 = Y
; $2000 = Select
; $1000 = Start
; $0800 = Up
; $0400 = Down
; $0200 = Left
; $0100 = Right
; $0080 = A
; $0040 = X
; $0020 = L
; $0010 = R
; Features
LDA #$0015 : STA !sram_artificial_lag
LDA #$0001 : STA !sram_rerandomize
LDA #$0000 : STA !sram_fanfare_toggle
LDA #$0001 : STA !sram_music_toggle
LDA #$0000 : STA !sram_frame_counter_mode
LDA #$0000 : STA !sram_display_mode
LDA #$0000 : STA !sram_last_preset
LDA #$0000 : STA !sram_save_has_set_rng
LDA #$0000 : STA !sram_preset_category
LDA #$0000 : STA !sram_custom_preset_slot
LDA #$0000 : STA !sram_room_strat
LDA #$0000 : STA !sram_sprite_prio_flag
LDA #$000A : STA !sram_metronome_tickrate
LDA #$0002 : STA !sram_metronome_sfx
LDA #!SRAM_VERSION : STA !sram_initialized
RTS
}
print pc, " init end"
warnpc $81FF00
| 25.128713 | 81 | 0.63357 |
580f03f29cecca9e1541903455f3f800fa8eab7d | 699 | asm | Assembly | oeis/007/A007407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/007/A007407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/007/A007407.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A007407: a(n) = denominator of Sum_{k=1..n} 1/k^2.
; Submitted by Jon Maiga
; 1,4,36,144,3600,3600,176400,705600,6350400,1270080,153679680,153679680,25971865920,25971865920,129859329600,519437318400,150117385017600,150117385017600,54192375991353600,10838475198270720,221193371393280,221193371393280,117011293467045120,117011293467045120,14626411683380640000,14626411683380640000,131637705150425760000,6450247552370862240000,5424658191543895143840000,5424658191543895143840000,5213096522073683233230240000,20852386088294732932920960000,20852386088294732932920960000
mov $1,1
lpb $0
mov $2,$0
sub $0,1
add $2,1
pow $2,2
mul $3,$2
add $3,$1
mul $1,$2
lpe
gcd $3,$1
div $1,$3
mov $0,$1
| 38.833333 | 488 | 0.811159 |
9631c2cc13ec6e091ee323eccfd2222b8d3ec45a | 787 | asm | Assembly | programs/oeis/255/A255201.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/255/A255201.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/255/A255201.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A255201: Number of prime factors of n^2.
; 0,2,2,4,2,4,2,6,4,4,2,6,2,4,4,8,2,6,2,6,4,4,2,8,4,4,6,6,2,6,2,10,4,4,4,8,2,4,4,8,2,6,2,6,6,4,2,10,4,6,4,6,2,8,4,8,4,4,2,8,2,4,6,12,4,6,2,6,4,6,2,10,2,4,6,6,4,6,2,10,8,4,2,8,4,4,4,8,2,8,4,6,4,4,4,12,2,6,6,8,2,6,2,8,6,4,2,10,2,6,4,10,2,6,4,6,6,4,4,10,4,4,4,6,6,8,2,14,4,6,2,8,4,4,8,8,2,6,2,8,4,4,4,12,4,4,6,6,2,8,2,8,6,6,4,8,2,4,4,12,4,10,2,6,6,4,2,10,4,6,6,6,2,6,6,10,4,4,2,10,2,6,4,8,4,6,4,6,8,6,2,14,2,4,6,8,2,8,2,10,4,4,4,8,4,4,6,10,4,8,2,6,4,4,4,12,4,4,4,8,4,6,2,12,8,4,2,8,2,6,6,8,2,8,4,6,4,6,2,12,2,6,10,6,6,6,4,8,4,8
mov $1,$0
cal $0,86436 ; Maximum number of parts possible in a factorization of n; a(1) = 1, and for n > 1, a(n) = A001222(n) = bigomega(n).
mov $2,17
lpb $2,1
sub $0,1
mul $1,$2
mov $2,$1
lpe
mov $1,$0
mul $1,2
| 56.214286 | 524 | 0.551461 |
2d5a233c6d2b4c9a33f153f24041ddabcb7a1399 | 242 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_sync.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_sync.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_sync.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned char esx_f_sync(unsigned char handle)
SECTION code_esxdos
PUBLIC esx_f_sync
EXTERN asm_esx_f_sync
defc esx_f_sync = asm_esx_f_sync
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _esx_f_sync
defc _esx_f_sync = esx_f_sync
ENDIF
| 14.235294 | 48 | 0.826446 |
6dc3f35b3f711375dd208b12a899e538a5555e34 | 1,754 | asm | Assembly | Vivid/libv/linux_x64_vivid/math.asm | lehtojo/v | f86911ed110639312e05bc1bf042c728cf82f4f9 | [
"MIT"
] | 3 | 2021-07-15T20:45:25.000Z | 2022-02-08T17:51:33.000Z | Vivid/libv/linux_x64_vivid/math.asm | lehtojo/zz | ca17d6d6c03420908d53e3b0b7c3cfa3e2e4d209 | [
"MIT"
] | null | null | null | Vivid/libv/linux_x64_vivid/math.asm | lehtojo/zz | ca17d6d6c03420908d53e3b0b7c3cfa3e2e4d209 | [
"MIT"
] | null | null | null | .export _V22internal_integer_powerxx_rx
.export _V3powxx_rx
# rdi: base
# rsi: exponent
mov qword [rsp+8], rdi
mov qword [rsp+16], rsi
fld1
fild qword [rsp+16]
fild qword [rsp+8]
# st0: base, st1: exponent, st2: 1.0
fyl2x # Replace st1 with st1 ∗ log2(st0) and pop the register stack.
# st0: exponent ∗ log2(base), st1: 1.0
f2xm1 # Replace st0 with (2^st0 – 1)
# st0: 2^(exponent ∗ log2(base)) - 1.0 = base^exponent - 1, st1: 1.0
faddp # Add st0 to st1, store result in st1, and pop the register stack.
# st0: base^exponent - 1.0 + 1.0 = base^exponent
fistp qword [rsp+8] # Load and pop base^exponent from the FPU-stack
mov rax, qword [rsp+8] # Load the result (base^exponent)
ret
.export _V22internal_decimal_powerdd_rd
.export _V3powdd_rd
# rcx: base
# rdx: exponent
movsd qword [rsp+8], xmm0
movsd qword [rsp+16], xmm1
fld1
fld qword [rsp+16]
fld qword [rsp+8]
# st0: base, st1: exponent, st2: 1.0
fyl2x # Replace st1 with st1 ∗ log2(st0) and pop the register stack.
# st0: exponent ∗ log2(base), st1: 1.0
f2xm1 # Replace st0 with (2^st0 – 1)
# st0: 2^(exponent ∗ log2(base)) - 1.0 = base^exponent - 1, st1: 1.0
faddp # Add st0 to st1, store result in st1, and pop the register stack.
# st0: base^exponent - 1.0 + 1.0 = base^exponent
fstp qword [rsp+8] # Load and pop base^exponent from the FPU-stack
movsd xmm0, qword [rsp+8] # Load the result (base^exponent)
ret
.export _V3cosd_rd
sub rsp, 8
movsd qword [rsp], xmm0
fld qword [rsp]
fcos
fstp qword [rsp]
movsd xmm0, qword [rsp]
add rsp, 8
ret
.export _V3sind_rd
sub rsp, 8
movsd qword [rsp], xmm0
fld qword [rsp]
fsin
fstp qword [rsp]
movsd xmm0, qword [rsp]
add rsp, 8
ret
.export _V4sqrtd_rd
sqrtsd xmm0, xmm0
ret
.export _V4sqrtx_rd
cvtsi2sd xmm0, rdi
sqrtsd xmm0, xmm0
ret
| 21.654321 | 72 | 0.699544 |
df54bf7a0481f5e67d998f16e4397a38722fdb2b | 595 | asm | Assembly | oeis/304/A304510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/304/A304510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/304/A304510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A304510: a(n) = 69*2^n - 42 (n>=1).
; 96,234,510,1062,2166,4374,8790,17622,35286,70614,141270,282582,565206,1130454,2260950,4521942,9043926,18087894,36175830,72351702,144703446,289406934,578813910,1157627862,2315255766,4630511574,9261023190,18522046422,37044092886,74088185814,148176371670,296352743382,592705486806,1185410973654,2370821947350,4741643894742,9483287789526,18966575579094,37933151158230,75866302316502,151732604633046,303465209266134,606930418532310,1213860837064662,2427721674129366,4855443348258774,9710886696517590
mov $1,2
pow $1,$0
sub $1,1
mul $1,138
add $1,96
mov $0,$1
| 59.5 | 496 | 0.836975 |
8d3ba1fac08b80bbccf15b7be2bacdf95ebb7010 | 44,963 | asm | Assembly | schedtest.asm | xiaoqing2027/Operating-System | f6429aa175de2a4f9f0ad457bea47ae1ea60e0f2 | [
"MIT-0"
] | null | null | null | schedtest.asm | xiaoqing2027/Operating-System | f6429aa175de2a4f9f0ad457bea47ae1ea60e0f2 | [
"MIT-0"
] | null | null | null | schedtest.asm | xiaoqing2027/Operating-System | f6429aa175de2a4f9f0ad457bea47ae1ea60e0f2 | [
"MIT-0"
] | null | null | null |
_schedtest: file format elf32-i386
Disassembly of section .text:
00000000 <rand>:
unsigned short lfsr = 0xACE1u;
unsigned bit;
unsigned rand() {
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5) ) & 1;
3: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
a: 0f b7 d0 movzwl %ax,%edx
d: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
14: 66 c1 e8 02 shr $0x2,%ax
18: 0f b7 c0 movzwl %ax,%eax
1b: 31 c2 xor %eax,%edx
1d: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
24: 66 c1 e8 03 shr $0x3,%ax
28: 0f b7 c0 movzwl %ax,%eax
2b: 31 c2 xor %eax,%edx
2d: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
34: 66 c1 e8 05 shr $0x5,%ax
38: 0f b7 c0 movzwl %ax,%eax
3b: 31 d0 xor %edx,%eax
3d: 83 e0 01 and $0x1,%eax
40: a3 d0 0b 00 00 mov %eax,0xbd0
return lfsr = (lfsr >> 1) | (bit << 15);
45: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
4c: 66 d1 e8 shr %ax
4f: 89 c2 mov %eax,%edx
51: a1 d0 0b 00 00 mov 0xbd0,%eax
56: c1 e0 0f shl $0xf,%eax
59: 09 d0 or %edx,%eax
5b: 66 a3 b0 0b 00 00 mov %ax,0xbb0
61: 0f b7 05 b0 0b 00 00 movzwl 0xbb0,%eax
68: 0f b7 c0 movzwl %ax,%eax
}
6b: 5d pop %ebp
6c: c3 ret
0000006d <main>:
// printf(1, "hello %d \n", getpid());
// exit();
int main(int argc, char *argv[])
{
6d: 55 push %ebp
6e: 89 e5 mov %esp,%ebp
70: 53 push %ebx
71: 83 e4 f0 and $0xfffffff0,%esp
74: 83 ec 30 sub $0x30,%esp
int process_count;
int pid = -1;
77: c7 44 24 28 ff ff ff movl $0xffffffff,0x28(%esp)
7e: ff
for (process_count = 0; process_count <= 2; process_count++) {
7f: c7 44 24 2c 00 00 00 movl $0x0,0x2c(%esp)
86: 00
87: eb 0e jmp 97 <main+0x2a>
pid = fork();
89: e8 0d 03 00 00 call 39b <fork>
8e: 89 44 24 28 mov %eax,0x28(%esp)
int main(int argc, char *argv[])
{
int process_count;
int pid = -1;
for (process_count = 0; process_count <= 2; process_count++) {
92: 83 44 24 2c 01 addl $0x1,0x2c(%esp)
97: 83 7c 24 2c 02 cmpl $0x2,0x2c(%esp)
9c: 7e eb jle 89 <main+0x1c>
pid = fork();
}
if (pid == 0) { // Children execute the test
9e: 83 7c 24 28 00 cmpl $0x0,0x28(%esp)
a3: 0f 85 82 00 00 00 jne 12b <main+0xbe>
int i, j, garbage;
for (i = 0; i < 20; i++) {
a9: c7 44 24 24 00 00 00 movl $0x0,0x24(%esp)
b0: 00
b1: eb 4d jmp 100 <main+0x93>
int rand_num = rand() * (100 * getpid());
b3: e8 48 ff ff ff call 0 <rand>
b8: 89 c3 mov %eax,%ebx
ba: e8 64 03 00 00 call 423 <getpid>
bf: 0f af c3 imul %ebx,%eax
c2: 6b c0 64 imul $0x64,%eax,%eax
c5: 89 44 24 18 mov %eax,0x18(%esp)
garbage = 0;
c9: c7 44 24 1c 00 00 00 movl $0x0,0x1c(%esp)
d0: 00
for (j = 0; j < rand_num; j++) {
d1: c7 44 24 20 00 00 00 movl $0x0,0x20(%esp)
d8: 00
d9: eb 0a jmp e5 <main+0x78>
garbage += 1;
db: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
for (i = 0; i < 20; i++) {
int rand_num = rand() * (100 * getpid());
garbage = 0;
for (j = 0; j < rand_num; j++) {
e0: 83 44 24 20 01 addl $0x1,0x20(%esp)
e5: 8b 44 24 20 mov 0x20(%esp),%eax
e9: 3b 44 24 18 cmp 0x18(%esp),%eax
ed: 7c ec jl db <main+0x6e>
garbage += 1;
}
sleep(0);
ef: c7 04 24 00 00 00 00 movl $0x0,(%esp)
f6: e8 38 03 00 00 call 433 <sleep>
}
if (pid == 0) { // Children execute the test
int i, j, garbage;
for (i = 0; i < 20; i++) {
fb: 83 44 24 24 01 addl $0x1,0x24(%esp)
100: 83 7c 24 24 13 cmpl $0x13,0x24(%esp)
105: 7e ac jle b3 <main+0x46>
}
sleep(0);
}
printf(1, "Process %d bursts: ", getpid());
107: e8 17 03 00 00 call 423 <getpid>
10c: 89 44 24 08 mov %eax,0x8(%esp)
110: c7 44 24 04 2f 09 00 movl $0x92f,0x4(%esp)
117: 00
118: c7 04 24 01 00 00 00 movl $0x1,(%esp)
11f: e8 3f 04 00 00 call 563 <printf>
print_bursts();
124: e8 2a 03 00 00 call 453 <print_bursts>
129: eb 0b jmp 136 <main+0xc9>
}
else {
while (wait() != -1);
12b: 90 nop
12c: e8 7a 02 00 00 call 3ab <wait>
131: 83 f8 ff cmp $0xffffffff,%eax
134: 75 f6 jne 12c <main+0xbf>
}
exit();
136: e8 68 02 00 00 call 3a3 <exit>
0000013b <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
13b: 55 push %ebp
13c: 89 e5 mov %esp,%ebp
13e: 57 push %edi
13f: 53 push %ebx
asm volatile("cld; rep stosb" :
140: 8b 4d 08 mov 0x8(%ebp),%ecx
143: 8b 55 10 mov 0x10(%ebp),%edx
146: 8b 45 0c mov 0xc(%ebp),%eax
149: 89 cb mov %ecx,%ebx
14b: 89 df mov %ebx,%edi
14d: 89 d1 mov %edx,%ecx
14f: fc cld
150: f3 aa rep stos %al,%es:(%edi)
152: 89 ca mov %ecx,%edx
154: 89 fb mov %edi,%ebx
156: 89 5d 08 mov %ebx,0x8(%ebp)
159: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
15c: 5b pop %ebx
15d: 5f pop %edi
15e: 5d pop %ebp
15f: c3 ret
00000160 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
160: 55 push %ebp
161: 89 e5 mov %esp,%ebp
163: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
166: 8b 45 08 mov 0x8(%ebp),%eax
169: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
16c: 90 nop
16d: 8b 45 08 mov 0x8(%ebp),%eax
170: 8d 50 01 lea 0x1(%eax),%edx
173: 89 55 08 mov %edx,0x8(%ebp)
176: 8b 55 0c mov 0xc(%ebp),%edx
179: 8d 4a 01 lea 0x1(%edx),%ecx
17c: 89 4d 0c mov %ecx,0xc(%ebp)
17f: 0f b6 12 movzbl (%edx),%edx
182: 88 10 mov %dl,(%eax)
184: 0f b6 00 movzbl (%eax),%eax
187: 84 c0 test %al,%al
189: 75 e2 jne 16d <strcpy+0xd>
;
return os;
18b: 8b 45 fc mov -0x4(%ebp),%eax
}
18e: c9 leave
18f: c3 ret
00000190 <strcmp>:
int
strcmp(const char *p, const char *q)
{
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
193: eb 08 jmp 19d <strcmp+0xd>
p++, q++;
195: 83 45 08 01 addl $0x1,0x8(%ebp)
199: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
19d: 8b 45 08 mov 0x8(%ebp),%eax
1a0: 0f b6 00 movzbl (%eax),%eax
1a3: 84 c0 test %al,%al
1a5: 74 10 je 1b7 <strcmp+0x27>
1a7: 8b 45 08 mov 0x8(%ebp),%eax
1aa: 0f b6 10 movzbl (%eax),%edx
1ad: 8b 45 0c mov 0xc(%ebp),%eax
1b0: 0f b6 00 movzbl (%eax),%eax
1b3: 38 c2 cmp %al,%dl
1b5: 74 de je 195 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
1b7: 8b 45 08 mov 0x8(%ebp),%eax
1ba: 0f b6 00 movzbl (%eax),%eax
1bd: 0f b6 d0 movzbl %al,%edx
1c0: 8b 45 0c mov 0xc(%ebp),%eax
1c3: 0f b6 00 movzbl (%eax),%eax
1c6: 0f b6 c0 movzbl %al,%eax
1c9: 29 c2 sub %eax,%edx
1cb: 89 d0 mov %edx,%eax
}
1cd: 5d pop %ebp
1ce: c3 ret
000001cf <strlen>:
uint
strlen(char *s)
{
1cf: 55 push %ebp
1d0: 89 e5 mov %esp,%ebp
1d2: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1d5: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1dc: eb 04 jmp 1e2 <strlen+0x13>
1de: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1e2: 8b 55 fc mov -0x4(%ebp),%edx
1e5: 8b 45 08 mov 0x8(%ebp),%eax
1e8: 01 d0 add %edx,%eax
1ea: 0f b6 00 movzbl (%eax),%eax
1ed: 84 c0 test %al,%al
1ef: 75 ed jne 1de <strlen+0xf>
;
return n;
1f1: 8b 45 fc mov -0x4(%ebp),%eax
}
1f4: c9 leave
1f5: c3 ret
000001f6 <memset>:
void*
memset(void *dst, int c, uint n)
{
1f6: 55 push %ebp
1f7: 89 e5 mov %esp,%ebp
1f9: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
1fc: 8b 45 10 mov 0x10(%ebp),%eax
1ff: 89 44 24 08 mov %eax,0x8(%esp)
203: 8b 45 0c mov 0xc(%ebp),%eax
206: 89 44 24 04 mov %eax,0x4(%esp)
20a: 8b 45 08 mov 0x8(%ebp),%eax
20d: 89 04 24 mov %eax,(%esp)
210: e8 26 ff ff ff call 13b <stosb>
return dst;
215: 8b 45 08 mov 0x8(%ebp),%eax
}
218: c9 leave
219: c3 ret
0000021a <strchr>:
char*
strchr(const char *s, char c)
{
21a: 55 push %ebp
21b: 89 e5 mov %esp,%ebp
21d: 83 ec 04 sub $0x4,%esp
220: 8b 45 0c mov 0xc(%ebp),%eax
223: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
226: eb 14 jmp 23c <strchr+0x22>
if(*s == c)
228: 8b 45 08 mov 0x8(%ebp),%eax
22b: 0f b6 00 movzbl (%eax),%eax
22e: 3a 45 fc cmp -0x4(%ebp),%al
231: 75 05 jne 238 <strchr+0x1e>
return (char*)s;
233: 8b 45 08 mov 0x8(%ebp),%eax
236: eb 13 jmp 24b <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
238: 83 45 08 01 addl $0x1,0x8(%ebp)
23c: 8b 45 08 mov 0x8(%ebp),%eax
23f: 0f b6 00 movzbl (%eax),%eax
242: 84 c0 test %al,%al
244: 75 e2 jne 228 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
246: b8 00 00 00 00 mov $0x0,%eax
}
24b: c9 leave
24c: c3 ret
0000024d <gets>:
char*
gets(char *buf, int max)
{
24d: 55 push %ebp
24e: 89 e5 mov %esp,%ebp
250: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
253: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
25a: eb 4c jmp 2a8 <gets+0x5b>
cc = read(0, &c, 1);
25c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
263: 00
264: 8d 45 ef lea -0x11(%ebp),%eax
267: 89 44 24 04 mov %eax,0x4(%esp)
26b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
272: e8 44 01 00 00 call 3bb <read>
277: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
27a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
27e: 7f 02 jg 282 <gets+0x35>
break;
280: eb 31 jmp 2b3 <gets+0x66>
buf[i++] = c;
282: 8b 45 f4 mov -0xc(%ebp),%eax
285: 8d 50 01 lea 0x1(%eax),%edx
288: 89 55 f4 mov %edx,-0xc(%ebp)
28b: 89 c2 mov %eax,%edx
28d: 8b 45 08 mov 0x8(%ebp),%eax
290: 01 c2 add %eax,%edx
292: 0f b6 45 ef movzbl -0x11(%ebp),%eax
296: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
298: 0f b6 45 ef movzbl -0x11(%ebp),%eax
29c: 3c 0a cmp $0xa,%al
29e: 74 13 je 2b3 <gets+0x66>
2a0: 0f b6 45 ef movzbl -0x11(%ebp),%eax
2a4: 3c 0d cmp $0xd,%al
2a6: 74 0b je 2b3 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
2a8: 8b 45 f4 mov -0xc(%ebp),%eax
2ab: 83 c0 01 add $0x1,%eax
2ae: 3b 45 0c cmp 0xc(%ebp),%eax
2b1: 7c a9 jl 25c <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
2b3: 8b 55 f4 mov -0xc(%ebp),%edx
2b6: 8b 45 08 mov 0x8(%ebp),%eax
2b9: 01 d0 add %edx,%eax
2bb: c6 00 00 movb $0x0,(%eax)
return buf;
2be: 8b 45 08 mov 0x8(%ebp),%eax
}
2c1: c9 leave
2c2: c3 ret
000002c3 <stat>:
int
stat(char *n, struct stat *st)
{
2c3: 55 push %ebp
2c4: 89 e5 mov %esp,%ebp
2c6: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
2c9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2d0: 00
2d1: 8b 45 08 mov 0x8(%ebp),%eax
2d4: 89 04 24 mov %eax,(%esp)
2d7: e8 07 01 00 00 call 3e3 <open>
2dc: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2df: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2e3: 79 07 jns 2ec <stat+0x29>
return -1;
2e5: b8 ff ff ff ff mov $0xffffffff,%eax
2ea: eb 23 jmp 30f <stat+0x4c>
r = fstat(fd, st);
2ec: 8b 45 0c mov 0xc(%ebp),%eax
2ef: 89 44 24 04 mov %eax,0x4(%esp)
2f3: 8b 45 f4 mov -0xc(%ebp),%eax
2f6: 89 04 24 mov %eax,(%esp)
2f9: e8 fd 00 00 00 call 3fb <fstat>
2fe: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
301: 8b 45 f4 mov -0xc(%ebp),%eax
304: 89 04 24 mov %eax,(%esp)
307: e8 bf 00 00 00 call 3cb <close>
return r;
30c: 8b 45 f0 mov -0x10(%ebp),%eax
}
30f: c9 leave
310: c3 ret
00000311 <atoi>:
int
atoi(const char *s)
{
311: 55 push %ebp
312: 89 e5 mov %esp,%ebp
314: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
317: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
31e: eb 25 jmp 345 <atoi+0x34>
n = n*10 + *s++ - '0';
320: 8b 55 fc mov -0x4(%ebp),%edx
323: 89 d0 mov %edx,%eax
325: c1 e0 02 shl $0x2,%eax
328: 01 d0 add %edx,%eax
32a: 01 c0 add %eax,%eax
32c: 89 c1 mov %eax,%ecx
32e: 8b 45 08 mov 0x8(%ebp),%eax
331: 8d 50 01 lea 0x1(%eax),%edx
334: 89 55 08 mov %edx,0x8(%ebp)
337: 0f b6 00 movzbl (%eax),%eax
33a: 0f be c0 movsbl %al,%eax
33d: 01 c8 add %ecx,%eax
33f: 83 e8 30 sub $0x30,%eax
342: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
345: 8b 45 08 mov 0x8(%ebp),%eax
348: 0f b6 00 movzbl (%eax),%eax
34b: 3c 2f cmp $0x2f,%al
34d: 7e 0a jle 359 <atoi+0x48>
34f: 8b 45 08 mov 0x8(%ebp),%eax
352: 0f b6 00 movzbl (%eax),%eax
355: 3c 39 cmp $0x39,%al
357: 7e c7 jle 320 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
359: 8b 45 fc mov -0x4(%ebp),%eax
}
35c: c9 leave
35d: c3 ret
0000035e <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
35e: 55 push %ebp
35f: 89 e5 mov %esp,%ebp
361: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
364: 8b 45 08 mov 0x8(%ebp),%eax
367: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
36a: 8b 45 0c mov 0xc(%ebp),%eax
36d: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
370: eb 17 jmp 389 <memmove+0x2b>
*dst++ = *src++;
372: 8b 45 fc mov -0x4(%ebp),%eax
375: 8d 50 01 lea 0x1(%eax),%edx
378: 89 55 fc mov %edx,-0x4(%ebp)
37b: 8b 55 f8 mov -0x8(%ebp),%edx
37e: 8d 4a 01 lea 0x1(%edx),%ecx
381: 89 4d f8 mov %ecx,-0x8(%ebp)
384: 0f b6 12 movzbl (%edx),%edx
387: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
389: 8b 45 10 mov 0x10(%ebp),%eax
38c: 8d 50 ff lea -0x1(%eax),%edx
38f: 89 55 10 mov %edx,0x10(%ebp)
392: 85 c0 test %eax,%eax
394: 7f dc jg 372 <memmove+0x14>
*dst++ = *src++;
return vdst;
396: 8b 45 08 mov 0x8(%ebp),%eax
}
399: c9 leave
39a: c3 ret
0000039b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
39b: b8 01 00 00 00 mov $0x1,%eax
3a0: cd 40 int $0x40
3a2: c3 ret
000003a3 <exit>:
SYSCALL(exit)
3a3: b8 02 00 00 00 mov $0x2,%eax
3a8: cd 40 int $0x40
3aa: c3 ret
000003ab <wait>:
SYSCALL(wait)
3ab: b8 03 00 00 00 mov $0x3,%eax
3b0: cd 40 int $0x40
3b2: c3 ret
000003b3 <pipe>:
SYSCALL(pipe)
3b3: b8 04 00 00 00 mov $0x4,%eax
3b8: cd 40 int $0x40
3ba: c3 ret
000003bb <read>:
SYSCALL(read)
3bb: b8 05 00 00 00 mov $0x5,%eax
3c0: cd 40 int $0x40
3c2: c3 ret
000003c3 <write>:
SYSCALL(write)
3c3: b8 10 00 00 00 mov $0x10,%eax
3c8: cd 40 int $0x40
3ca: c3 ret
000003cb <close>:
SYSCALL(close)
3cb: b8 15 00 00 00 mov $0x15,%eax
3d0: cd 40 int $0x40
3d2: c3 ret
000003d3 <kill>:
SYSCALL(kill)
3d3: b8 06 00 00 00 mov $0x6,%eax
3d8: cd 40 int $0x40
3da: c3 ret
000003db <exec>:
SYSCALL(exec)
3db: b8 07 00 00 00 mov $0x7,%eax
3e0: cd 40 int $0x40
3e2: c3 ret
000003e3 <open>:
SYSCALL(open)
3e3: b8 0f 00 00 00 mov $0xf,%eax
3e8: cd 40 int $0x40
3ea: c3 ret
000003eb <mknod>:
SYSCALL(mknod)
3eb: b8 11 00 00 00 mov $0x11,%eax
3f0: cd 40 int $0x40
3f2: c3 ret
000003f3 <unlink>:
SYSCALL(unlink)
3f3: b8 12 00 00 00 mov $0x12,%eax
3f8: cd 40 int $0x40
3fa: c3 ret
000003fb <fstat>:
SYSCALL(fstat)
3fb: b8 08 00 00 00 mov $0x8,%eax
400: cd 40 int $0x40
402: c3 ret
00000403 <link>:
SYSCALL(link)
403: b8 13 00 00 00 mov $0x13,%eax
408: cd 40 int $0x40
40a: c3 ret
0000040b <mkdir>:
SYSCALL(mkdir)
40b: b8 14 00 00 00 mov $0x14,%eax
410: cd 40 int $0x40
412: c3 ret
00000413 <chdir>:
SYSCALL(chdir)
413: b8 09 00 00 00 mov $0x9,%eax
418: cd 40 int $0x40
41a: c3 ret
0000041b <dup>:
SYSCALL(dup)
41b: b8 0a 00 00 00 mov $0xa,%eax
420: cd 40 int $0x40
422: c3 ret
00000423 <getpid>:
SYSCALL(getpid)
423: b8 0b 00 00 00 mov $0xb,%eax
428: cd 40 int $0x40
42a: c3 ret
0000042b <sbrk>:
SYSCALL(sbrk)
42b: b8 0c 00 00 00 mov $0xc,%eax
430: cd 40 int $0x40
432: c3 ret
00000433 <sleep>:
SYSCALL(sleep)
433: b8 0d 00 00 00 mov $0xd,%eax
438: cd 40 int $0x40
43a: c3 ret
0000043b <uptime>:
SYSCALL(uptime)
43b: b8 0e 00 00 00 mov $0xe,%eax
440: cd 40 int $0x40
442: c3 ret
00000443 <startBurst>:
SYSCALL(startBurst)
443: b8 16 00 00 00 mov $0x16,%eax
448: cd 40 int $0x40
44a: c3 ret
0000044b <endBurst>:
SYSCALL(endBurst)
44b: b8 17 00 00 00 mov $0x17,%eax
450: cd 40 int $0x40
452: c3 ret
00000453 <print_bursts>:
SYSCALL(print_bursts)
453: b8 18 00 00 00 mov $0x18,%eax
458: cd 40 int $0x40
45a: c3 ret
0000045b <thread_create>:
SYSCALL(thread_create)
45b: b8 19 00 00 00 mov $0x19,%eax
460: cd 40 int $0x40
462: c3 ret
00000463 <thread_join>:
SYSCALL(thread_join)
463: b8 1a 00 00 00 mov $0x1a,%eax
468: cd 40 int $0x40
46a: c3 ret
0000046b <mtx_create>:
SYSCALL(mtx_create)
46b: b8 1b 00 00 00 mov $0x1b,%eax
470: cd 40 int $0x40
472: c3 ret
00000473 <mtx_lock>:
SYSCALL(mtx_lock)
473: b8 1c 00 00 00 mov $0x1c,%eax
478: cd 40 int $0x40
47a: c3 ret
0000047b <mtx_unlock>:
SYSCALL(mtx_unlock)
47b: b8 1d 00 00 00 mov $0x1d,%eax
480: cd 40 int $0x40
482: c3 ret
00000483 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
483: 55 push %ebp
484: 89 e5 mov %esp,%ebp
486: 83 ec 18 sub $0x18,%esp
489: 8b 45 0c mov 0xc(%ebp),%eax
48c: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
48f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
496: 00
497: 8d 45 f4 lea -0xc(%ebp),%eax
49a: 89 44 24 04 mov %eax,0x4(%esp)
49e: 8b 45 08 mov 0x8(%ebp),%eax
4a1: 89 04 24 mov %eax,(%esp)
4a4: e8 1a ff ff ff call 3c3 <write>
}
4a9: c9 leave
4aa: c3 ret
000004ab <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4ab: 55 push %ebp
4ac: 89 e5 mov %esp,%ebp
4ae: 56 push %esi
4af: 53 push %ebx
4b0: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
4b3: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
4ba: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
4be: 74 17 je 4d7 <printint+0x2c>
4c0: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
4c4: 79 11 jns 4d7 <printint+0x2c>
neg = 1;
4c6: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
4cd: 8b 45 0c mov 0xc(%ebp),%eax
4d0: f7 d8 neg %eax
4d2: 89 45 ec mov %eax,-0x14(%ebp)
4d5: eb 06 jmp 4dd <printint+0x32>
} else {
x = xx;
4d7: 8b 45 0c mov 0xc(%ebp),%eax
4da: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
4dd: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
4e4: 8b 4d f4 mov -0xc(%ebp),%ecx
4e7: 8d 41 01 lea 0x1(%ecx),%eax
4ea: 89 45 f4 mov %eax,-0xc(%ebp)
4ed: 8b 5d 10 mov 0x10(%ebp),%ebx
4f0: 8b 45 ec mov -0x14(%ebp),%eax
4f3: ba 00 00 00 00 mov $0x0,%edx
4f8: f7 f3 div %ebx
4fa: 89 d0 mov %edx,%eax
4fc: 0f b6 80 b2 0b 00 00 movzbl 0xbb2(%eax),%eax
503: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
507: 8b 75 10 mov 0x10(%ebp),%esi
50a: 8b 45 ec mov -0x14(%ebp),%eax
50d: ba 00 00 00 00 mov $0x0,%edx
512: f7 f6 div %esi
514: 89 45 ec mov %eax,-0x14(%ebp)
517: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
51b: 75 c7 jne 4e4 <printint+0x39>
if(neg)
51d: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
521: 74 10 je 533 <printint+0x88>
buf[i++] = '-';
523: 8b 45 f4 mov -0xc(%ebp),%eax
526: 8d 50 01 lea 0x1(%eax),%edx
529: 89 55 f4 mov %edx,-0xc(%ebp)
52c: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
531: eb 1f jmp 552 <printint+0xa7>
533: eb 1d jmp 552 <printint+0xa7>
putc(fd, buf[i]);
535: 8d 55 dc lea -0x24(%ebp),%edx
538: 8b 45 f4 mov -0xc(%ebp),%eax
53b: 01 d0 add %edx,%eax
53d: 0f b6 00 movzbl (%eax),%eax
540: 0f be c0 movsbl %al,%eax
543: 89 44 24 04 mov %eax,0x4(%esp)
547: 8b 45 08 mov 0x8(%ebp),%eax
54a: 89 04 24 mov %eax,(%esp)
54d: e8 31 ff ff ff call 483 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
552: 83 6d f4 01 subl $0x1,-0xc(%ebp)
556: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
55a: 79 d9 jns 535 <printint+0x8a>
putc(fd, buf[i]);
}
55c: 83 c4 30 add $0x30,%esp
55f: 5b pop %ebx
560: 5e pop %esi
561: 5d pop %ebp
562: c3 ret
00000563 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
563: 55 push %ebp
564: 89 e5 mov %esp,%ebp
566: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
569: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
570: 8d 45 0c lea 0xc(%ebp),%eax
573: 83 c0 04 add $0x4,%eax
576: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
579: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
580: e9 7c 01 00 00 jmp 701 <printf+0x19e>
c = fmt[i] & 0xff;
585: 8b 55 0c mov 0xc(%ebp),%edx
588: 8b 45 f0 mov -0x10(%ebp),%eax
58b: 01 d0 add %edx,%eax
58d: 0f b6 00 movzbl (%eax),%eax
590: 0f be c0 movsbl %al,%eax
593: 25 ff 00 00 00 and $0xff,%eax
598: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
59b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
59f: 75 2c jne 5cd <printf+0x6a>
if(c == '%'){
5a1: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
5a5: 75 0c jne 5b3 <printf+0x50>
state = '%';
5a7: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
5ae: e9 4a 01 00 00 jmp 6fd <printf+0x19a>
} else {
putc(fd, c);
5b3: 8b 45 e4 mov -0x1c(%ebp),%eax
5b6: 0f be c0 movsbl %al,%eax
5b9: 89 44 24 04 mov %eax,0x4(%esp)
5bd: 8b 45 08 mov 0x8(%ebp),%eax
5c0: 89 04 24 mov %eax,(%esp)
5c3: e8 bb fe ff ff call 483 <putc>
5c8: e9 30 01 00 00 jmp 6fd <printf+0x19a>
}
} else if(state == '%'){
5cd: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
5d1: 0f 85 26 01 00 00 jne 6fd <printf+0x19a>
if(c == 'd'){
5d7: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
5db: 75 2d jne 60a <printf+0xa7>
printint(fd, *ap, 10, 1);
5dd: 8b 45 e8 mov -0x18(%ebp),%eax
5e0: 8b 00 mov (%eax),%eax
5e2: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
5e9: 00
5ea: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
5f1: 00
5f2: 89 44 24 04 mov %eax,0x4(%esp)
5f6: 8b 45 08 mov 0x8(%ebp),%eax
5f9: 89 04 24 mov %eax,(%esp)
5fc: e8 aa fe ff ff call 4ab <printint>
ap++;
601: 83 45 e8 04 addl $0x4,-0x18(%ebp)
605: e9 ec 00 00 00 jmp 6f6 <printf+0x193>
} else if(c == 'x' || c == 'p'){
60a: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
60e: 74 06 je 616 <printf+0xb3>
610: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
614: 75 2d jne 643 <printf+0xe0>
printint(fd, *ap, 16, 0);
616: 8b 45 e8 mov -0x18(%ebp),%eax
619: 8b 00 mov (%eax),%eax
61b: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
622: 00
623: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
62a: 00
62b: 89 44 24 04 mov %eax,0x4(%esp)
62f: 8b 45 08 mov 0x8(%ebp),%eax
632: 89 04 24 mov %eax,(%esp)
635: e8 71 fe ff ff call 4ab <printint>
ap++;
63a: 83 45 e8 04 addl $0x4,-0x18(%ebp)
63e: e9 b3 00 00 00 jmp 6f6 <printf+0x193>
} else if(c == 's'){
643: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
647: 75 45 jne 68e <printf+0x12b>
s = (char*)*ap;
649: 8b 45 e8 mov -0x18(%ebp),%eax
64c: 8b 00 mov (%eax),%eax
64e: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
651: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
655: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
659: 75 09 jne 664 <printf+0x101>
s = "(null)";
65b: c7 45 f4 43 09 00 00 movl $0x943,-0xc(%ebp)
while(*s != 0){
662: eb 1e jmp 682 <printf+0x11f>
664: eb 1c jmp 682 <printf+0x11f>
putc(fd, *s);
666: 8b 45 f4 mov -0xc(%ebp),%eax
669: 0f b6 00 movzbl (%eax),%eax
66c: 0f be c0 movsbl %al,%eax
66f: 89 44 24 04 mov %eax,0x4(%esp)
673: 8b 45 08 mov 0x8(%ebp),%eax
676: 89 04 24 mov %eax,(%esp)
679: e8 05 fe ff ff call 483 <putc>
s++;
67e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
682: 8b 45 f4 mov -0xc(%ebp),%eax
685: 0f b6 00 movzbl (%eax),%eax
688: 84 c0 test %al,%al
68a: 75 da jne 666 <printf+0x103>
68c: eb 68 jmp 6f6 <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
68e: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
692: 75 1d jne 6b1 <printf+0x14e>
putc(fd, *ap);
694: 8b 45 e8 mov -0x18(%ebp),%eax
697: 8b 00 mov (%eax),%eax
699: 0f be c0 movsbl %al,%eax
69c: 89 44 24 04 mov %eax,0x4(%esp)
6a0: 8b 45 08 mov 0x8(%ebp),%eax
6a3: 89 04 24 mov %eax,(%esp)
6a6: e8 d8 fd ff ff call 483 <putc>
ap++;
6ab: 83 45 e8 04 addl $0x4,-0x18(%ebp)
6af: eb 45 jmp 6f6 <printf+0x193>
} else if(c == '%'){
6b1: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
6b5: 75 17 jne 6ce <printf+0x16b>
putc(fd, c);
6b7: 8b 45 e4 mov -0x1c(%ebp),%eax
6ba: 0f be c0 movsbl %al,%eax
6bd: 89 44 24 04 mov %eax,0x4(%esp)
6c1: 8b 45 08 mov 0x8(%ebp),%eax
6c4: 89 04 24 mov %eax,(%esp)
6c7: e8 b7 fd ff ff call 483 <putc>
6cc: eb 28 jmp 6f6 <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
6ce: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
6d5: 00
6d6: 8b 45 08 mov 0x8(%ebp),%eax
6d9: 89 04 24 mov %eax,(%esp)
6dc: e8 a2 fd ff ff call 483 <putc>
putc(fd, c);
6e1: 8b 45 e4 mov -0x1c(%ebp),%eax
6e4: 0f be c0 movsbl %al,%eax
6e7: 89 44 24 04 mov %eax,0x4(%esp)
6eb: 8b 45 08 mov 0x8(%ebp),%eax
6ee: 89 04 24 mov %eax,(%esp)
6f1: e8 8d fd ff ff call 483 <putc>
}
state = 0;
6f6: 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++){
6fd: 83 45 f0 01 addl $0x1,-0x10(%ebp)
701: 8b 55 0c mov 0xc(%ebp),%edx
704: 8b 45 f0 mov -0x10(%ebp),%eax
707: 01 d0 add %edx,%eax
709: 0f b6 00 movzbl (%eax),%eax
70c: 84 c0 test %al,%al
70e: 0f 85 71 fe ff ff jne 585 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
714: c9 leave
715: c3 ret
00000716 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
716: 55 push %ebp
717: 89 e5 mov %esp,%ebp
719: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
71c: 8b 45 08 mov 0x8(%ebp),%eax
71f: 83 e8 08 sub $0x8,%eax
722: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
725: a1 cc 0b 00 00 mov 0xbcc,%eax
72a: 89 45 fc mov %eax,-0x4(%ebp)
72d: eb 24 jmp 753 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
72f: 8b 45 fc mov -0x4(%ebp),%eax
732: 8b 00 mov (%eax),%eax
734: 3b 45 fc cmp -0x4(%ebp),%eax
737: 77 12 ja 74b <free+0x35>
739: 8b 45 f8 mov -0x8(%ebp),%eax
73c: 3b 45 fc cmp -0x4(%ebp),%eax
73f: 77 24 ja 765 <free+0x4f>
741: 8b 45 fc mov -0x4(%ebp),%eax
744: 8b 00 mov (%eax),%eax
746: 3b 45 f8 cmp -0x8(%ebp),%eax
749: 77 1a ja 765 <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)
74b: 8b 45 fc mov -0x4(%ebp),%eax
74e: 8b 00 mov (%eax),%eax
750: 89 45 fc mov %eax,-0x4(%ebp)
753: 8b 45 f8 mov -0x8(%ebp),%eax
756: 3b 45 fc cmp -0x4(%ebp),%eax
759: 76 d4 jbe 72f <free+0x19>
75b: 8b 45 fc mov -0x4(%ebp),%eax
75e: 8b 00 mov (%eax),%eax
760: 3b 45 f8 cmp -0x8(%ebp),%eax
763: 76 ca jbe 72f <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
765: 8b 45 f8 mov -0x8(%ebp),%eax
768: 8b 40 04 mov 0x4(%eax),%eax
76b: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
772: 8b 45 f8 mov -0x8(%ebp),%eax
775: 01 c2 add %eax,%edx
777: 8b 45 fc mov -0x4(%ebp),%eax
77a: 8b 00 mov (%eax),%eax
77c: 39 c2 cmp %eax,%edx
77e: 75 24 jne 7a4 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
780: 8b 45 f8 mov -0x8(%ebp),%eax
783: 8b 50 04 mov 0x4(%eax),%edx
786: 8b 45 fc mov -0x4(%ebp),%eax
789: 8b 00 mov (%eax),%eax
78b: 8b 40 04 mov 0x4(%eax),%eax
78e: 01 c2 add %eax,%edx
790: 8b 45 f8 mov -0x8(%ebp),%eax
793: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
796: 8b 45 fc mov -0x4(%ebp),%eax
799: 8b 00 mov (%eax),%eax
79b: 8b 10 mov (%eax),%edx
79d: 8b 45 f8 mov -0x8(%ebp),%eax
7a0: 89 10 mov %edx,(%eax)
7a2: eb 0a jmp 7ae <free+0x98>
} else
bp->s.ptr = p->s.ptr;
7a4: 8b 45 fc mov -0x4(%ebp),%eax
7a7: 8b 10 mov (%eax),%edx
7a9: 8b 45 f8 mov -0x8(%ebp),%eax
7ac: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
7ae: 8b 45 fc mov -0x4(%ebp),%eax
7b1: 8b 40 04 mov 0x4(%eax),%eax
7b4: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
7bb: 8b 45 fc mov -0x4(%ebp),%eax
7be: 01 d0 add %edx,%eax
7c0: 3b 45 f8 cmp -0x8(%ebp),%eax
7c3: 75 20 jne 7e5 <free+0xcf>
p->s.size += bp->s.size;
7c5: 8b 45 fc mov -0x4(%ebp),%eax
7c8: 8b 50 04 mov 0x4(%eax),%edx
7cb: 8b 45 f8 mov -0x8(%ebp),%eax
7ce: 8b 40 04 mov 0x4(%eax),%eax
7d1: 01 c2 add %eax,%edx
7d3: 8b 45 fc mov -0x4(%ebp),%eax
7d6: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
7d9: 8b 45 f8 mov -0x8(%ebp),%eax
7dc: 8b 10 mov (%eax),%edx
7de: 8b 45 fc mov -0x4(%ebp),%eax
7e1: 89 10 mov %edx,(%eax)
7e3: eb 08 jmp 7ed <free+0xd7>
} else
p->s.ptr = bp;
7e5: 8b 45 fc mov -0x4(%ebp),%eax
7e8: 8b 55 f8 mov -0x8(%ebp),%edx
7eb: 89 10 mov %edx,(%eax)
freep = p;
7ed: 8b 45 fc mov -0x4(%ebp),%eax
7f0: a3 cc 0b 00 00 mov %eax,0xbcc
}
7f5: c9 leave
7f6: c3 ret
000007f7 <morecore>:
static Header*
morecore(uint nu)
{
7f7: 55 push %ebp
7f8: 89 e5 mov %esp,%ebp
7fa: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
7fd: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
804: 77 07 ja 80d <morecore+0x16>
nu = 4096;
806: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
80d: 8b 45 08 mov 0x8(%ebp),%eax
810: c1 e0 03 shl $0x3,%eax
813: 89 04 24 mov %eax,(%esp)
816: e8 10 fc ff ff call 42b <sbrk>
81b: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
81e: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
822: 75 07 jne 82b <morecore+0x34>
return 0;
824: b8 00 00 00 00 mov $0x0,%eax
829: eb 22 jmp 84d <morecore+0x56>
hp = (Header*)p;
82b: 8b 45 f4 mov -0xc(%ebp),%eax
82e: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
831: 8b 45 f0 mov -0x10(%ebp),%eax
834: 8b 55 08 mov 0x8(%ebp),%edx
837: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
83a: 8b 45 f0 mov -0x10(%ebp),%eax
83d: 83 c0 08 add $0x8,%eax
840: 89 04 24 mov %eax,(%esp)
843: e8 ce fe ff ff call 716 <free>
return freep;
848: a1 cc 0b 00 00 mov 0xbcc,%eax
}
84d: c9 leave
84e: c3 ret
0000084f <malloc>:
void*
malloc(uint nbytes)
{
84f: 55 push %ebp
850: 89 e5 mov %esp,%ebp
852: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
855: 8b 45 08 mov 0x8(%ebp),%eax
858: 83 c0 07 add $0x7,%eax
85b: c1 e8 03 shr $0x3,%eax
85e: 83 c0 01 add $0x1,%eax
861: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
864: a1 cc 0b 00 00 mov 0xbcc,%eax
869: 89 45 f0 mov %eax,-0x10(%ebp)
86c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
870: 75 23 jne 895 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
872: c7 45 f0 c4 0b 00 00 movl $0xbc4,-0x10(%ebp)
879: 8b 45 f0 mov -0x10(%ebp),%eax
87c: a3 cc 0b 00 00 mov %eax,0xbcc
881: a1 cc 0b 00 00 mov 0xbcc,%eax
886: a3 c4 0b 00 00 mov %eax,0xbc4
base.s.size = 0;
88b: c7 05 c8 0b 00 00 00 movl $0x0,0xbc8
892: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
895: 8b 45 f0 mov -0x10(%ebp),%eax
898: 8b 00 mov (%eax),%eax
89a: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
89d: 8b 45 f4 mov -0xc(%ebp),%eax
8a0: 8b 40 04 mov 0x4(%eax),%eax
8a3: 3b 45 ec cmp -0x14(%ebp),%eax
8a6: 72 4d jb 8f5 <malloc+0xa6>
if(p->s.size == nunits)
8a8: 8b 45 f4 mov -0xc(%ebp),%eax
8ab: 8b 40 04 mov 0x4(%eax),%eax
8ae: 3b 45 ec cmp -0x14(%ebp),%eax
8b1: 75 0c jne 8bf <malloc+0x70>
prevp->s.ptr = p->s.ptr;
8b3: 8b 45 f4 mov -0xc(%ebp),%eax
8b6: 8b 10 mov (%eax),%edx
8b8: 8b 45 f0 mov -0x10(%ebp),%eax
8bb: 89 10 mov %edx,(%eax)
8bd: eb 26 jmp 8e5 <malloc+0x96>
else {
p->s.size -= nunits;
8bf: 8b 45 f4 mov -0xc(%ebp),%eax
8c2: 8b 40 04 mov 0x4(%eax),%eax
8c5: 2b 45 ec sub -0x14(%ebp),%eax
8c8: 89 c2 mov %eax,%edx
8ca: 8b 45 f4 mov -0xc(%ebp),%eax
8cd: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
8d0: 8b 45 f4 mov -0xc(%ebp),%eax
8d3: 8b 40 04 mov 0x4(%eax),%eax
8d6: c1 e0 03 shl $0x3,%eax
8d9: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
8dc: 8b 45 f4 mov -0xc(%ebp),%eax
8df: 8b 55 ec mov -0x14(%ebp),%edx
8e2: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
8e5: 8b 45 f0 mov -0x10(%ebp),%eax
8e8: a3 cc 0b 00 00 mov %eax,0xbcc
return (void*)(p + 1);
8ed: 8b 45 f4 mov -0xc(%ebp),%eax
8f0: 83 c0 08 add $0x8,%eax
8f3: eb 38 jmp 92d <malloc+0xde>
}
if(p == freep)
8f5: a1 cc 0b 00 00 mov 0xbcc,%eax
8fa: 39 45 f4 cmp %eax,-0xc(%ebp)
8fd: 75 1b jne 91a <malloc+0xcb>
if((p = morecore(nunits)) == 0)
8ff: 8b 45 ec mov -0x14(%ebp),%eax
902: 89 04 24 mov %eax,(%esp)
905: e8 ed fe ff ff call 7f7 <morecore>
90a: 89 45 f4 mov %eax,-0xc(%ebp)
90d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
911: 75 07 jne 91a <malloc+0xcb>
return 0;
913: b8 00 00 00 00 mov $0x0,%eax
918: eb 13 jmp 92d <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){
91a: 8b 45 f4 mov -0xc(%ebp),%eax
91d: 89 45 f0 mov %eax,-0x10(%ebp)
920: 8b 45 f4 mov -0xc(%ebp),%eax
923: 8b 00 mov (%eax),%eax
925: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
928: e9 70 ff ff ff jmp 89d <malloc+0x4e>
}
92d: c9 leave
92e: c3 ret
| 33.756006 | 69 | 0.433645 |
fb3338f2f9a85b6a06cbd591f7f85d21920c9a75 | 366 | asm | Assembly | programs/oeis/138/A138441.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/138/A138441.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/138/A138441.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A138441: a(n) = ((n-th prime)^6-(n-th prime^2))/2.
; 30,360,7800,58800,885720,2413320,12068640,23522760,74017680,297411240,443751360,1282862520,2375051280,3160680600,5389606560,11082179160,21090265080,25760185320,45229188840,64050139440,75667110480,121543724640,163470183240
seq $0,40 ; The prime numbers.
pow $0,2
mov $1,1
add $1,$0
bin $0,2
mul $1,$0
mov $0,$1
| 33.272727 | 223 | 0.759563 |
cd9959a0cd637e39d1255f56114dab1e994f392e | 197 | asm | Assembly | tests/asm/32/reljmp.asm | ReneNyffenegger/udis86 | 6b6122c3552925d4d0216beac29b09800440f2fe | [
"BSD-2-Clause"
] | 710 | 2015-01-05T05:16:09.000Z | 2022-03-23T14:24:53.000Z | tests/asm/32/reljmp.asm | ReneNyffenegger/udis86 | 6b6122c3552925d4d0216beac29b09800440f2fe | [
"BSD-2-Clause"
] | 28 | 2015-01-17T23:19:45.000Z | 2021-12-23T21:39:49.000Z | tests/asm/32/reljmp.asm | ReneNyffenegger/udis86 | 6b6122c3552925d4d0216beac29b09800440f2fe | [
"BSD-2-Clause"
] | 227 | 2015-01-05T21:24:53.000Z | 2022-03-10T18:24:43.000Z | [bits 32]
[org 0x80000000]
l1:
nop
nop
nop
nop
nop
jmp l1
nop
jmp word l2
nop
nop
jmp dword l2
nop
nop
nop
l2:
nop
nop
jmp l1
| 7.88 | 16 | 0.461929 |
0b12ff1e782e23c0bb4de37b07da54a304d525d0 | 5,945 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1031.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xd63d, %rsi
lea addresses_WC_ht+0x11a4c, %rdi
clflush (%rdi)
nop
nop
xor %r9, %r9
mov $125, %rcx
rep movsl
cmp %rdi, %rdi
lea addresses_normal_ht+0x1b772, %r13
nop
nop
nop
inc %rdi
mov $0x6162636465666768, %r10
movq %r10, %xmm7
vmovups %ymm7, (%r13)
nop
nop
and %rcx, %rcx
lea addresses_D_ht+0x19494, %r10
nop
nop
nop
xor $5431, %rbp
mov (%r10), %rcx
nop
nop
nop
nop
nop
cmp %r9, %r9
lea addresses_UC_ht+0x177c2, %rdi
nop
xor %rsi, %rsi
mov (%rdi), %r10
nop
nop
nop
nop
dec %rbp
lea addresses_D_ht+0x1d78c, %rsi
lea addresses_WT_ht+0x1078c, %rdi
and %r14, %r14
mov $49, %rcx
rep movsb
nop
add $17004, %rbp
lea addresses_D_ht+0x9e0c, %r9
clflush (%r9)
nop
nop
nop
sub $55294, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%r9)
nop
nop
nop
nop
nop
inc %rcx
lea addresses_A_ht+0xda2c, %rsi
nop
nop
cmp %r13, %r13
mov (%rsi), %r9d
nop
nop
nop
cmp %rdi, %rdi
lea addresses_UC_ht+0x14fdc, %rdi
nop
nop
nop
and %r14, %r14
mov (%rdi), %rbp
nop
nop
nop
nop
nop
add %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r8
push %rbp
push %rbx
push %rsi
// Faulty Load
mov $0x991660000000b8c, %rbx
and %r11, %r11
vmovups (%rbx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r8
lea oracles, %r11
and $0xff, %r8
shlq $12, %r8
mov (%r11,%r8,1), %r8
pop %rsi
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, '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
*/
| 39.633333 | 2,999 | 0.658032 |
835248a434624be3823c419f35fd6bdd3274d000 | 2,613 | asm | Assembly | Source/NativeASM/HijackASM_x64.asm | KNSoft/NTAssassin | 4f51b8b33f685fd4cc0f12026345fb70f8fc040a | [
"MIT"
] | 8 | 2021-05-11T07:45:13.000Z | 2021-09-08T05:17:27.000Z | Source/NativeASM/HijackASM_x64.asm | KNSoft/NTAssassin | 4f51b8b33f685fd4cc0f12026345fb70f8fc040a | [
"MIT"
] | null | null | null | Source/NativeASM/HijackASM_x64.asm | KNSoft/NTAssassin | 4f51b8b33f685fd4cc0f12026345fb70f8fc040a | [
"MIT"
] | 2 | 2021-06-29T08:30:18.000Z | 2021-08-05T01:37:01.000Z | include HijackASM.inc
.code
Hijack_CallProc_InjectThread_x64 PROC USES rbx rdi rsi
; rdi point to HIJACK_CALLPROCHEADER
mov rdi, rcx
; Support stdcall only
cmp dword ptr [rdi + 8], 0 ; [rdi].CallConvention
je @f
mov eax, STATUS_NOT_IMPLEMENTED
ret
@@:
; rsi point to HIJACK_CALLPROCPARAM array, rbx point to random parameters
lea rsi, [rdi + sizeof HIJACK_CALLPROCHEADER]
mov r10d, [rdi + 32] ;[rdi].ParamCount
mov rax, sizeof HIJACK_CALLPROCPARAM
mul r10d
lea rbx, [rsi + rax]
; Enum HIJACK_CALLPROCPARAM
LN_ENUMPARAM:
or r10d, r10d
je LN_CALLPROC
mov rax, [rsi + 8] ; [rsi]._Size
or rax, rax
je LN02
cmp rax, -1
je LN02
; rdx = address to random parameter
mov r11, rbx
; Align size of random parameter to 4
add rax, 3
and rax, -4
; rbx point to the next random parameter
add rbx, rax
xor rax, rax
jmp LN03
LN02:
mov r11, [rsi] ; [rsi]._Address
LN03:
; Push parameter, rax = -1 if parameter is float
cmp r10d, 4
jne LN_P3
or rax, rax
je @f
movq xmm3, r11
jmp LN_PUSHPARAM
@@:
mov r9, r11
jmp LN_PUSHPARAM
LN_P3:
cmp r10d, 3
jne LN_P2
or rax, rax
je @f
movq xmm2, r11
jmp LN_PUSHPARAM
@@:
mov r8, r11
jmp LN_PUSHPARAM
LN_P2:
cmp r10d, 2
jne LN_P1
or rax, rax
je @f
movq xmm1, r11
jmp LN_PUSHPARAM
@@:
mov rdx, r11
jmp LN_PUSHPARAM
LN_P1:
cmp r10d, 1
jne LN_PX
or rax, rax
je @f
movq xmm0, r11
jmp LN_PUSHPARAM
@@:
mov rcx, r11
jmp LN_PUSHPARAM
LN_PX:
push r11
LN_PUSHPARAM:
add rsi, sizeof HIJACK_CALLPROCPARAM
dec r10d
jmp LN_ENUMPARAM
LN_CALLPROC:
; Clear LastError, LastStatus and ExceptionCode
xor eax, eax
mov gs:[68h], eax
mov gs:[1248h], eax
mov gs:[2C0h], eax
; Call procedure
call qword ptr [rdi] ; [rdi].Procedure
; Write RetValue, LastError, LastStatus and ExceptionCode
mov [rdi + 12], rax ; [rdi].RetValue
mov eax, gs:[68h]
mov [rdi + 20], eax ; [rdi].LastError
mov eax, gs:[1248h]
mov [rdi + 24], eax ; [rdi].LastStatus
mov eax, gs:[2C0h]
mov [rdi + 28], eax ; [rdi].ExceptionCode
; Return
xor eax, eax
ret
Hijack_CallProc_InjectThread_x64 ENDP
END | 23.540541 | 77 | 0.553004 |
6e16365fb7c8b8296b65c55f8254dd0dbac0d612 | 7,496 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1702.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_0xa0.log_21829_1702.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_0xa0.log_21829_1702.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x199b5, %r9
nop
nop
nop
nop
sub %r11, %r11
movb (%r9), %r12b
nop
nop
nop
nop
dec %rsi
lea addresses_WT_ht+0x11615, %r15
nop
nop
nop
nop
and %r14, %r14
mov (%r15), %ebp
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0xe9b5, %r14
nop
nop
add $43483, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, (%r14)
nop
and $40826, %r15
lea addresses_normal_ht+0x168b5, %rbp
nop
nop
nop
nop
nop
and $56604, %r11
movb $0x61, (%rbp)
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x10db5, %rsi
nop
nop
nop
xor $65013, %r12
mov $0x6162636465666768, %rbp
movq %rbp, %xmm7
movups %xmm7, (%rsi)
cmp %rsi, %rsi
lea addresses_A_ht+0x2595, %rsi
lea addresses_D_ht+0x18ac5, %rdi
nop
nop
nop
sub %r12, %r12
mov $24, %rcx
rep movsb
and %rbp, %rbp
lea addresses_WC_ht+0xd68d, %rsi
lea addresses_WT_ht+0x9f21, %rdi
nop
nop
lfence
mov $115, %rcx
rep movsb
nop
and %rbp, %rbp
lea addresses_UC_ht+0xd5b5, %r15
sub %r11, %r11
mov (%r15), %r9
nop
nop
and $26588, %r15
lea addresses_UC_ht+0x189b5, %rsi
lea addresses_normal_ht+0x135b5, %rdi
nop
nop
nop
nop
xor $15553, %r14
mov $102, %rcx
rep movsw
nop
nop
nop
nop
and $16043, %r12
lea addresses_WT_ht+0x3dd5, %r15
clflush (%r15)
dec %r12
mov (%r15), %di
add %r14, %r14
lea addresses_UC_ht+0xd1f5, %r15
clflush (%r15)
nop
nop
inc %rdi
mov (%r15), %cx
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_normal_ht+0x1105, %rsi
lea addresses_UC_ht+0xb7b5, %rdi
and $55977, %r14
mov $37, %rcx
rep movsq
nop
and %r12, %r12
lea addresses_WT_ht+0x12db5, %r11
nop
nop
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%r11)
nop
sub %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rsi
// Store
lea addresses_US+0xdab5, %r11
clflush (%r11)
nop
nop
nop
nop
nop
add %rcx, %rcx
movw $0x5152, (%r11)
nop
add %r11, %r11
// Faulty Load
lea addresses_UC+0x16db5, %rax
nop
nop
nop
nop
nop
xor %r12, %r12
movups (%rax), %xmm6
vpextrq $0, %xmm6, %r14
lea oracles, %rbx
and $0xff, %r14
shlq $12, %r14
mov (%rbx,%r14,1), %r14
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_US', 'AVXalign': True, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.865116 | 2,999 | 0.65675 |
8b348bb39c17300808f4c8238ef24cc129e4f9b1 | 12,749 | asm | Assembly | OSSOURCE/jobcode.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | 3 | 2015-11-05T09:13:10.000Z | 2021-03-24T13:30:27.000Z | OSSOURCE/jobcode.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | null | null | null | OSSOURCE/jobcode.asm | mooseman/smallOS | a4468b69e8372350310828d5b72b56fb5e3a0fa8 | [
"Unlicense"
] | 1 | 2017-03-30T12:46:43.000Z | 2017-03-30T12:46:43.000Z | ; MMURTL Operating System Source Code
; Written by Richard A. Burgess
;
; This code is released to the public domain.
; "Share and enjoy....." ;)
;
.DATA
.INCLUDE MOSEDF.INC
.INCLUDE JOB.INC
.INCLUDE TSS.INC
PUBLIC pFreeJCB DD 0 ; Ptr to free Job Control Blocks
PUBLIC pJCBs DD 0 ; JCBs are in allocated memory
PUBLIC _nJCBLeft DD nJCBs ; For Monitor stats
EXTRN MonJCB DB ; Monitor JCB reference
EXTRN _BootDrive DD ; From Main.asm
;======= End data,Begin Code ==================
.CODE
;================================================================
;InitNewJCB is used initially by the OS to fill in the first two
;jobs (Monitor & Debugger)
;
PUBLIC InitNewJCB:
; INPUT : EAX -- Ptr to JCB that is to be filled in
; EBX -- Linear Ptr to Page Directory for Job
; ESI -- pbJobName
; ECX -- cbJobName
; EDX -- Pointer to Job Virtual Video Buffer (all jobs have one!)
;
; OUTPUT : JOB Number in EAX
; USED : EAX, EBX, ECX, EDX, EDI, ESI, EFlags
; MODIFIES : JCB pointed to in EBX
;
; This fills in a JCB with new information. This is used to initilaize
; a new JCB during OS init and when a new Job is loaded and run.
;
MOV [EAX+JcbPD],EBX ;Put Ptr to PD into JCB
MOV EDI, EAX ;EDI points to JCB
ADD EDI, sbJobName ;Now to JobName
MOV BYTE PTR [EDI], CL ;size is filled in
INC EDI ;first byte of name
REP MOVSB ;Move it in
MOV [EAX+pVirtVid], EDX ;Video number is in JCB
MOV DWORD PTR [EAX+nCols], 80 ;
MOV DWORD PTR [EAX+nLines], 25 ;
MOV DWORD PTR [EAX+NormAttr], 7 ;
MOV EAX, [EAX+JobNum]
RETN
;=============================================================================
; InitFreeJCB
; INPUT : EAX - Address of JCBs to be initialized
; ECX - Count of JCBs
; EDX - Size of JCBs
; OUTPUT : NONE
; USED: EAX,EBX,ECX,EDX,ESI EFLAGS
; MODIFIES: pFreeJCB, pJCBs
;
; This routine will initialize the free pool of Job Control Blocks (JCBs).
; EAX points to the first JCB,
; ECX is count of JCBs,
; EDX is size of each JCB.
;
; The pFreeJCB pointer is set to address the first element in rgJCBs.
; Each element of rgJCBs is set to point to the next element of rgJCBs.
; The last element of rgJCBs is set to point to nothing (NIL).
; The JCBs are also sequentially numbered. We can't use it's position
; in the array because some JCBs are static (Mon and Debugger), while
; others (the ones we are initializing now) are dynamicly allocated.
;
PUBLIC InitFreeJCB:
MOV pFreeJCB,EAX ;Set up OS pointer to list
MOV pJCBs, EAX ;Set up global ptr to first JCB
MOV EBX, 3 ;1st number for Dynamic JCBs
JCB_Loop:
MOV ESI,EAX ;EBX has pointer to current one
ADD EAX,EDX ;EAX points to next one
MOV [ESI+NextJCB],EAX ;Make current point to next
MOV [ESI+JobNum], EBX ;Number it
INC EBX
LOOP JCB_Loop ;Go back till done
MOV DWORD PTR [ESI+NextJCB], 0 ;Make last one NIL
RETN ;
;================================================================
; Allocate 4 pages (16384 bytes) for 32 Job Control Blocks (structures).
; Then call InitFreeJCB
PUBLIC InitDynamicJCBs:
PUSH 4 ; 4 pages for 32 JCBs (16384 bytes)
MOV EAX, OFFSET pJCBs ; Returns ptr to allocated mem in pJCBs
PUSH EAX ;
CALL FWORD PTR _AllocOSPage ; Get 'em!
XOR EAX, EAX ; Clear allocated memory for JCBs
MOV ECX, 4096 ; (4*4096=16384 - DWORDS!)
MOV EDI, pJCBs ; where to store 0s
REP STOSD ; Do it
MOV EAX, pJCBs ; Ptr to JCBs
MOV ECX, nJCBs ; Count of Job Control Blocks
MOV EDX, sJCB ; EDX is size of a JCB
CALL InitFreeJCB ; Init the array of JCBs
RETN
;=============================================================================
PUBLIC NewJCB:
; INPUT : NONE
; OUTPUT : EAX
; REGISTERS : EAX,EBX,FLAGS
; MODIFIES : pFreeJCB
;
; This routine will return to the caller a pointer to the next free jcb.
; The data used in this algorithm is the free jcb pointer (pFreeJCB).
; This routine will return in EAX register the address of the next free jcb.
; If none exists, then EAX will contain NIL (0). This routine will also
; update the value of pFreeJCB to point to the next "unused" JCB in
; the free pool.
;
MOV EAX,pFreeJCB ;Get OS pointer to JCBs
CMP EAX,0 ;IF pFreeJCB=NIL THEN Return;
JE NewJCBDone ;
MOV EBX,[EAX+NextJCB] ;Get pointer to next free one
MOV pFreeJCB,EBX ;Put it in OS pointer
DEC DWORD PTR _nJCBLeft ;
NewJCBDone:
RETN ;
;=============================================================================
PUBLIC DisposeJCB:
; INPUT : EAX
; OUTPUT : NONE
; REGISTERS : EBX,FLAGS
; MODIFIES : pFreeJCB
;
; This routine will place the jcb pointed to by EAX back into the free
; pool of JCBs pointed to by (pFreeJCB) if EAX is not NIL.
; This invalidates the JCB by placing 0 in JcbPD.
;
CMP EAX, 0 ; If pJCBin = NIL THEN Return;
JE DispJCBDone ;
MOV DWORD PTR [EAX+JcbPD], 0 ;Invalidate JCB
MOV EBX,pFreeJCB ;EBX has OS ptr to free list
MOV [EAX+NextJCB],EBX ;Move it into newly freed JCB
MOV pFreeJCB,EAX ;Move ptr to newly frred JCB to OS
INC DWORD PTR _nJCBLeft ;
DispJCBDone:
RETN ;
;============================================================
;
; GetpCrntJCB
; Returns a pointer to the current Job Control Block in EAX.
; This is based on which Task is executing. All TSSs are
; assigned to a Job. A Job may have more than one Task.
;
; INPUT: Nothing
; OUTPUT: EAX -- Linear Address of current JCB
; USED: EAX, EFlags
;
PUBLIC GetpCrntJCB:
MOV EAX, pRunTSS ;Current Task State Segment
MOV EAX, [EAX+TSS_pJCB] ;Pointer to JCB
RETN
;============================================================
;
; GetCrntJobNum
; Many OS functions deal with the Job number. The Job number
; is a field in the JCB structure.
; Returns the Job number for the currently executing task.
; This is based on which Task is executing. All TSSs are
; assigned to a Job! A Job may have more than one Task.
;
; INPUT: Nothing
; OUTPUT: EAX -- Current Job Number
; USED: EAX, EFlags
;
PUBLIC GetCrntJobNum:
CALL GetpCrntJCB
MOV EAX, [EAX+JobNum] ;Current JCB
RETN
;============================================================
;
; GetpJCB
; Returns a pointer to a Job Control Block identified by number
; in EAX. All TSSs are assigned to a Job.
;
; INPUT: EAX -- Job Number of desired pJCB
; OUTPUT: EAX -- Linear Address of the JCB or 0 for invalid number
; USED: EAX, EFlags
;
PUBLIC GetpJCB:
PUSH EDX
CMP EAX, 1
JNE GetpJCB1
MOV EAX, OFFSET MonJCB
POP EDX
RETN
GetpJCB1:
CMP EAX, 2
JNE GetpJCB2
MOV EAX, OFFSET DbgJCB
POP EDX
RETN
GetpJCB2:
CMP EAX, nJCBs+2 ;Add in two static JCBs
JLE GetpJCB3 ;Within range of JCBs
XOR EAX, EAX
POP EDX
RETN
GetpJCB3:
SUB EAX, 3 ;Take off static JCBs+1 (make it an offset)
MOV EDX, sJCB
MUL EDX ;Times size of JCB
ADD EAX, pJCBs ;Now points to desired JCB
POP EDX
RETN ;
;============================================================
;
; GetJobNum
; Many OS functions deal with the Job number. The Job number
; is a field in the JCB structure.
; Returns the Job number for the pJCB in EAX in EAX.
;
; INPUT: EAX pJCB we want job number from.
; OUTPUT: EAX -- Current Job Number
; USED: EAX, EFlags
;
PUBLIC GetJobNum:
MOV EAX, [EAX+JobNum] ;Current JCB
RETN
;============================================================
;
; AllocJCB (NEAR)
; This allocates a new JCB (from the pool). This is a NEAR
; call to support the public job management calls in high level
; languages.
;
; Procedureal Interface :
;
; AllocJCB(pdJobNumRet, ppJCBRet):ercType
;
; pdJobNumRet is the number of the new JCB.
; pJCBRet is a pointer where you want the pointer to the new JCB is returned.
;
; ErcNoMoreJCBs will be returned if no more JCBs are avaialble.
;
; pdJobNum EQU [EBP+12]
; pJCBRet EQU [EBP+8]
PUBLIC _AllocJCB: ;
PUSH EBP ;
MOV EBP,ESP ;
CALL NewJCB ; Get a new JCB
OR EAX, EAX ;
JNZ SHORT AJCB01 ; We got one!
MOV EAX, ErcNoMoreJCBs ; Sorry, out of them!
MOV ESP,EBP ;
POP EBP ;
RETN 8 ;
AJCB01:
MOV ESI, [EBP+8] ;pJCBRet
MOV [ESI], EAX
MOV ESI, [EBP+12] ;Job Num
CALL GetJobNum ;
MOV [ESI], EAX ;
XOR EAX, EAX ;No error
MOV ESP,EBP ;
POP EBP ;
RETN 8 ;
;============================================================
;
; DeAllocJCB (NEAR)
; This Deallocates a JCB (returns it to the pool). This is a NEAR
; call to support the public job management calls in high level
; languages in the OS code.
;
; Procedureal Interface :
;
; DeAllocJCB(pJCB):ercType
;
; pJCB is a pointer the JCB to be deallocated.
;
; ErcNoMoreJCBs will be returned if no more JCBs are avaialble.
;
; pJCB EQU [EBP+8]
PUBLIC _DeAllocJCB: ;
PUSH EBP ;
MOV EBP,ESP ;
MOV EAX, [EBP+8] ; pJCB
CALL DisposeJCB ; Get a new JCB
XOR EAX, EAX ;
MOV ESP,EBP ;
POP EBP ;
RETN 4 ;
;============================================================
;===== BEGIN PUBLIC FAR JOB CALLS ===========================
;============================================================
;
; GetpJCB
; This PUBLIC returns a pointer to the JCB for the JobNum
; you specifiy.
;
; Procedureal Interface :
;
; GetpJCB(dJobNum, pJCBRet):ercType
;
; dJobNum is the number of the JCB you want.
; pJCBRet is a pointer where you want the JCB returned.
;
; ErcBadJobNum will be returned if dJobNum is out of range
;
; ErcBadJobNum will be returned if dJobNum is invalid
; or 0 will be returned with the data.
;
; dJobNum EQU [EBP+16]
; pJCBRet EQU [EBP+12]
PUBLIC __GetpJCB: ;
PUSH EBP ;
MOV EBP,ESP ;
MOV EAX, [EBP+16] ;Job Num
OR EAX, EAX
JZ GetpJcbBad ;0 is invalid
CMP EAX, nJCBs + 2; ;Dynamic + 2 static
JBE GetpJcbOK
GetpJcbBad:
MOV EAX, ErcBadJobNum ;
MOV ESP,EBP ;
POP EBP ;
RETF 8 ;
GetpJcbOk:
CALL GetpJCB ;puts address of JCB in EAX
MOV ESI, [EBP+12] ;pJCBRet
MOV [ESI], EAX
CMP DWORD PTR [EAX+JcbPD], 0 ;Is this a valid JCB
JNE GetpJCBOk1
MOV EAX, ErcInvalidJCB ;JCB we are pointing to is unused
MOV ESP,EBP ;
POP EBP ;
RETF 8 ;
GetpJcbOk1:
XOR EAX, EAX
MOV ESP,EBP ;
POP EBP ;
RETF 8 ;
;============================================================
;
; GetJobNum
; This PUBLIC returns the number for the current Job. This is
; the job that the task that called this belongs to.
;
; Procedureal Interface :
;
; GetJobNum(pJobNumRet):ercType
;
; pJCBRet is a pointer where you want the JCB returned.
;
; pJobNumRet EQU [EBP+12]
PUBLIC __GetJobNum: ;
PUSH EBP ;
MOV EBP,ESP ;
CALL GetCrntJobNum ;Leave jobnum in EAX
MOV ESI, [EBP+12] ;pJobNumRet
MOV [ESI], EAX ;
XOR EAX, EAX ;No Error
POP EBP ;
RETF 4 ;
;============================================================
;
; GetSystemDisk
; This PUBLIC returns a single byte which represents the
; disk that the system booted from. This is from the public
; variable _BootDrive defined in Main.asm.
; It return 0-n (which corresponds to A-x)
; This code is here for lack of a better place.
; It's really not a filesystem function either. And will
; still be needed if a loadable filesystem is installed.
;
; Procedureal Interface :
;
; GetSystemDisk(pSysDiskRet):ercType
;
; pSysDiskRet is a pointer to a byte where
; the number representing the system disk is returned.
;
; pSysDiskRet EQU [EBP+12]
PUBLIC __GetSystemDisk ;
PUSH EBP ;
MOV EBP,ESP ;
MOV EAX, _BootDrive
AND EAX, 7Fh ;get rid of high bits
MOV ESI, [EBP+12] ;pJobNumRet
MOV [ESI], AL ;
XOR EAX, EAX ;No Error
POP EBP ;
RETF 4 ;
;================= MODULE END =================================
| 29.997647 | 79 | 0.566554 |
c384cad7cb3afda4fa42f9d6e0c634428ba6918c | 651 | asm | Assembly | oeis/102/A102206.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/102/A102206.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/102/A102206.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A102206: a(0) = 3, a(1) = 8, a(n+2) = 4*a(n+1) - a(n) - 2.
; 3,8,27,98,363,1352,5043,18818,70227,262088,978123,3650402,13623483,50843528,189750627,708158978,2642885283,9863382152,36810643323,137379191138,512706121227,1913445293768,7141075053843,26650854921602,99462344632563,371198523608648,1385331749802027,5170128475599458,19295182152595803,72010600134783752,268747218386539203,1002978273411373058,3743165875258953027,13969685227624439048,52135575035238803163,194572614913330773602,726154884618084291243,2710046923559006391368,10114032809617941274227
mov $1,2
mov $2,1
lpb $0
sub $0,1
add $1,$2
add $2,$1
add $1,$2
lpe
add $1,1
mov $0,$1
| 46.5 | 493 | 0.803379 |
a8d48f40714f8317ec7f66ccc107d6fb46bc1c4a | 706 | asm | Assembly | oeis/041/A041634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/041/A041634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/041/A041634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A041634: Numerators of continued fraction convergents to sqrt(336).
; Submitted by Jon Maiga
; 18,55,1998,6049,219762,665335,24171822,73180801,2658680658,8049222775,292430700558,885341324449,32164718380722,97379496466615,3537826591178862,10710859270003201,389128760311294098,1178097140203885495,42800625807651171918,129579974563157401249,4707679710081317616882,14252619104807110251895,517801967483137286685102,1567658521554218970307201,56953508743435020217744338,172428184751859279623540215,6264368159810369086665192078,18965532664182966539619116449,689023544070397164512953384242
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,12
mul $2,18
add $3,$2
lpe
mov $0,$3
| 41.529412 | 487 | 0.83711 |
45d95b3e0f7f5322b962b2f48bb1df93dc19a555 | 1,527 | asm | Assembly | Wk06_MiniBomb2/phase2.asm | jwatson-CO-edu/CSCI2400-201_Demo | 166c411c1deac9e76d831146dab5b5b75b9286c7 | [
"MIT"
] | 1 | 2020-09-04T21:30:57.000Z | 2020-09-04T21:30:57.000Z | Wk06_MiniBomb2/phase2.asm | jwatson-CO-edu/CSCI2400-201_Demo | 166c411c1deac9e76d831146dab5b5b75b9286c7 | [
"MIT"
] | null | null | null | Wk06_MiniBomb2/phase2.asm | jwatson-CO-edu/CSCI2400-201_Demo | 166c411c1deac9e76d831146dab5b5b75b9286c7 | [
"MIT"
] | null | null | null | 00000000000006df <driver_2>:
# Stack Frame Creation
6df: 55 push %rbp
6e0: 48 89 e5 mov %rsp,%rbp
6e3: 48 83 ec 10 sub $0x10,%rsp
# Function logic begins
6e7: 48 8d 05 82 09 20 00 lea 0x200982(%rip),%rax # Add 0x200982 to ProgCountr -> $rax # 201070 <items+0x30>
6ee: 48 89 45 f8 mov %rax,-0x8(%rbp) # Move $rax --> Loc 1
6f2: eb 25 jmp 719 <driver_2+0x3a> # vvv- GOTO A -vvv
6f4: 48 8b 45 f8 mov -0x8(%rbp),%rax # Loc 1 --> $rax
6f8: 8b 00 mov (%rax),%eax # Move the value at addr $rax --to-> $eax
6fa: 89 c6 mov %eax,%esi # $eax --> $esi
6fc: 48 8d 3d 81 01 00 00 lea 0x181(%rip),%rdi # 385 + ProgCountr --> $rdi # 884 <_IO_stdin_used+0x4>
703: b8 00 00 00 00 mov $0x0,%eax # 0 --to-> $eax
708: e8 53 fe ff ff callq 560 <printf@plt> # printf
70d: 48 8b 45 f8 mov -0x8(%rbp),%rax # Loc 1 --> $rax
711: 48 8b 40 08 mov 0x8(%rax),%rax
715: 48 89 45 f8 mov %rax,-0x8(%rbp)
719: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp) # >>> A <<<: Compare Loc 1 and 0
71e: 75 d4 jne 6f4 <driver_2+0x15> # If Loc 1 != 0, then ^^^- GOTO B -^^^
720: bf 0a 00 00 00 mov $0xa,%edi # 0 --to-> $eax
725: e8 26 fe ff ff callq 550 <putchar@plt> # Call putchar
72a: b8 00 00 00 00 mov $0x0,%eax # 0 --to-> $eax
72f: c9 leaveq
730: c3 retq
| 58.730769 | 113 | 0.497053 |
dcfd6bae99c374486beafa7585bd154d6a3454b1 | 53 | asm | Assembly | unittests/arch/x86/insn/bswap64.asm | path64/assembler | 32ade96bc087d3a3e015e03d69fa48c41a7071a6 | [
"BSD-2-Clause"
] | 1 | 2016-06-03T20:02:45.000Z | 2016-06-03T20:02:45.000Z | unittests/arch/x86/insn/bswap64.asm | path64/assembler | 32ade96bc087d3a3e015e03d69fa48c41a7071a6 | [
"BSD-2-Clause"
] | null | null | null | unittests/arch/x86/insn/bswap64.asm | path64/assembler | 32ade96bc087d3a3e015e03d69fa48c41a7071a6 | [
"BSD-2-Clause"
] | null | null | null | [bits 64]
bswap r8 ; 49 0f c8
bswap rax ; 48 0f c8
| 8.833333 | 20 | 0.622642 |
f8d02a6f746e6e693d053d286c60dfb8677ad057 | 622 | asm | Assembly | oeis/315/A315318.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/315/A315318.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/315/A315318.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A315318: Coordination sequence Gal.6.622.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Christian Krause
; 1,6,10,16,21,26,31,36,41,46,52,56,62,68,72,78,83,88,93,98,103,108,114,118,124,130,134,140,145,150,155,160,165,170,176,180,186,192,196,202,207,212,217,222,227,232,238,242,248,254
mov $1,$0
add $1,$0
seq $0,314836 ; Coordination sequence Gal.6.131.4 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.
add $1,1
div $1,3
add $0,$1
| 56.545455 | 182 | 0.742765 |
e0b55ad19b5acdee61299158fafecf208497f9b5 | 448 | asm | Assembly | oeis/039/A039649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/039/A039649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/039/A039649.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A039649: a(n) = phi(n)+1.
; Submitted by Jamie Morken
; 2,2,3,3,5,3,7,5,7,5,11,5,13,7,9,9,17,7,19,9,13,11,23,9,21,13,19,13,29,9,31,17,21,17,25,13,37,19,25,17,41,13,43,21,25,23,47,17,43,21,33,25,53,19,41,25,37,29,59,17,61,31,37,33,49,21,67,33,45,25,71,25,73,37,41,37,61,25,79,33,55,41,83,25,65,43,57,41,89,25,73,45,61,47,73,33,97,43,61,41
add $0,1
mov $2,$0
lpb $2
mov $3,$2
gcd $3,$0
cmp $3,1
add $1,$3
sub $2,1
lpe
mov $0,$1
add $0,1
| 28 | 283 | 0.602679 |
fd73e5ce19d2a291793a11a22cf867995e2a94c2 | 2,724 | asm | Assembly | arch/x86-64/src/isrs.asm | circutrider21/Night | 27b12fec805c4710cbbdc7c3d09b87a7632123d7 | [
"Apache-2.0"
] | 4 | 2021-02-09T19:40:31.000Z | 2021-12-17T15:39:18.000Z | arch/x86-64/src/isrs.asm | circutrider21/Night | 27b12fec805c4710cbbdc7c3d09b87a7632123d7 | [
"Apache-2.0"
] | 2 | 2021-03-04T18:49:37.000Z | 2021-03-07T20:24:33.000Z | arch/x86-64/src/isrs.asm | circutrider21/Night | 27b12fec805c4710cbbdc7c3d09b87a7632123d7 | [
"Apache-2.0"
] | null | null | null | %macro INTERRUPT_NAME 1
dq __interrupt%1
%endmacro
%macro INTERRUPT_ERR 1
__interrupt%1:
push %1
jmp __interrupt_common
%endmacro
%macro INTERRUPT_NOERR 1
__interrupt%1:
push 0
push %1
jmp __interrupt_common
%endmacro
%macro __pusha 0
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push rbp
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro __popa 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
%endmacro
extern handle_interrupt
__interrupt_common:
cld
__pusha
mov rdi, rsp
call handle_interrupt
mov rsp, rax
__popa
add rsp, 16 ; pop errcode and int number
iretq
INTERRUPT_NOERR 0
INTERRUPT_NOERR 1
INTERRUPT_NOERR 2
INTERRUPT_NOERR 3
INTERRUPT_NOERR 4
INTERRUPT_NOERR 5
INTERRUPT_NOERR 6
INTERRUPT_NOERR 7
INTERRUPT_ERR 8
INTERRUPT_NOERR 9
INTERRUPT_ERR 10
INTERRUPT_ERR 11
INTERRUPT_ERR 12
INTERRUPT_ERR 13
INTERRUPT_ERR 14
INTERRUPT_NOERR 15
INTERRUPT_NOERR 16
INTERRUPT_ERR 17
INTERRUPT_NOERR 18
INTERRUPT_NOERR 19
INTERRUPT_NOERR 20
INTERRUPT_NOERR 21
INTERRUPT_NOERR 22
INTERRUPT_NOERR 23
INTERRUPT_NOERR 24
INTERRUPT_NOERR 25
INTERRUPT_NOERR 26
INTERRUPT_NOERR 27
INTERRUPT_NOERR 28
INTERRUPT_NOERR 29
INTERRUPT_ERR 30
INTERRUPT_NOERR 31
INTERRUPT_NOERR 32
INTERRUPT_NOERR 33
INTERRUPT_NOERR 34
INTERRUPT_NOERR 35
INTERRUPT_NOERR 36
INTERRUPT_NOERR 37
INTERRUPT_NOERR 38
INTERRUPT_NOERR 39
INTERRUPT_NOERR 40
INTERRUPT_NOERR 41
INTERRUPT_NOERR 42
INTERRUPT_NOERR 43
INTERRUPT_NOERR 44
INTERRUPT_NOERR 45
INTERRUPT_NOERR 46
INTERRUPT_NOERR 47
INTERRUPT_NOERR 127
INTERRUPT_NOERR 128
global __interrupt_vector
__interrupt_vector:
INTERRUPT_NAME 0
INTERRUPT_NAME 1
INTERRUPT_NAME 2
INTERRUPT_NAME 3
INTERRUPT_NAME 4
INTERRUPT_NAME 5
INTERRUPT_NAME 6
INTERRUPT_NAME 7
INTERRUPT_NAME 8
INTERRUPT_NAME 9
INTERRUPT_NAME 10
INTERRUPT_NAME 11
INTERRUPT_NAME 12
INTERRUPT_NAME 13
INTERRUPT_NAME 14
INTERRUPT_NAME 15
INTERRUPT_NAME 16
INTERRUPT_NAME 17
INTERRUPT_NAME 18
INTERRUPT_NAME 19
INTERRUPT_NAME 20
INTERRUPT_NAME 21
INTERRUPT_NAME 22
INTERRUPT_NAME 23
INTERRUPT_NAME 24
INTERRUPT_NAME 25
INTERRUPT_NAME 26
INTERRUPT_NAME 27
INTERRUPT_NAME 28
INTERRUPT_NAME 29
INTERRUPT_NAME 30
INTERRUPT_NAME 31
INTERRUPT_NAME 32
INTERRUPT_NAME 33
INTERRUPT_NAME 34
INTERRUPT_NAME 35
INTERRUPT_NAME 36
INTERRUPT_NAME 37
INTERRUPT_NAME 38
INTERRUPT_NAME 39
INTERRUPT_NAME 40
INTERRUPT_NAME 41
INTERRUPT_NAME 42
INTERRUPT_NAME 43
INTERRUPT_NAME 44
INTERRUPT_NAME 45
INTERRUPT_NAME 46
INTERRUPT_NAME 47
| 15.303371 | 42 | 0.795154 |
81c9c8ae475c95c6edfaea45be44adbae41bea39 | 870 | asm | Assembly | oeis/184/A184036.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/184/A184036.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/184/A184036.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A184036: 1/16 the number of (n+1) X 7 0..3 arrays with all 2 X 2 subblocks having the same four values.
; Submitted by Jon Maiga
; 325,337,358,400,478,634,934,1534,2710,5062,9718,19030,37558,74614,148534,296374,591670,1182262,2362678,4723510,9443638,18883894,37761334,75516214,151019830,302027062,604029238,1208033590,2416017718,4831985974,9663873334,19327648054,38655099190,77310001462,154619609398,309238825270,618476863798,1236952940854,2473904308534,4947807043894,9895610941750,19791218737462,39582431183158,79164856074550,158329699565878,316659386548534,633318747930934,1266637470695734,2533274891059510,5066549731787062
mov $3,$0
seq $0,209726 ; 1/4 the number of (n+1) X 8 0..2 arrays with every 2 X 2 subblock having distinct clockwise edge differences.
mov $2,2
add $3,1
pow $2,$3
add $0,$2
sub $0,18
mul $0,2
add $0,$2
sub $0,2
div $0,2
mul $0,3
add $0,325
| 48.333333 | 496 | 0.798851 |
27a3e2818e19338b852c44ce8f6144831d86ec88 | 16,601 | asm | Assembly | DependentExtensions/cat/src/math/big_x64_elf.asm | RichardRanft/RakNet | 1a169895a900c9fc4841c556e16514182b75faf8 | [
"BSD-2-Clause"
] | 1,255 | 2015-01-01T12:16:18.000Z | 2017-05-24T20:56:12.000Z | DependentExtensions/cat/src/math/big_x64_elf.asm | RichardRanft/RakNet | 1a169895a900c9fc4841c556e16514182b75faf8 | [
"BSD-2-Clause"
] | 76 | 2017-06-07T21:05:41.000Z | 2021-12-14T21:15:49.000Z | DependentExtensions/cat/src/math/big_x64_elf.asm | RichardRanft/RakNet | 1a169895a900c9fc4841c556e16514182b75faf8 | [
"BSD-2-Clause"
] | 535 | 2015-01-05T01:09:02.000Z | 2017-05-17T00:58:03.000Z | ; Copyright (c) 2009-2010 Christopher A. Taylor. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; * Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; * Neither the name of LibCat nor the names of its contributors may be used
; to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
; arith_x64.asm
;
; 64-bit Arithmetic with Big Pseudo-Mersenne (BPM) modulus 2^N-C, for small C
;
; Assembly code written for FASM (flatassembler.net)
format ELF64
section '.code' executable
;-----------------------------------------------------------------------------
; Function Declarations
;-----------------------------------------------------------------------------
public bpm_add_4 as 'bpm_add_4'
public bpm_sub_4 as 'bpm_sub_4'
public bpm_mul_4 as 'bpm_mul_4'
public bpm_mulx_4 as 'bpm_mulx_4'
public bpm_sqr_4 as 'bpm_sqr_4'
; Does not provide these -- just extra complexity i don't need
;public divide_x as 'divide64_x'
;public modulus_x as 'modulus64_x'
;public divide_core as 'divide64_core'
;-----------------------------------------------------------------------------
; bpm_add_4
;-----------------------------------------------------------------------------
; Arguments:
; rdi (arg 1) : modulus parameter C
; rsi (arg 2) : pointer to input A first leg
; rdx (arg 3) : pointer to input B first leg
; rcx (arg 4) : pointer to output first leg
; Preconditions:
; legs per bigint = 4
; Output:
; out = A + B (mod C)
;-----------------------------------------------------------------------------
bpm_add_4:
; perform addition chain
mov r8, qword[rsi]
add r8, qword[rdx]
mov qword[rcx], r8
mov r9, qword[rsi+8]
adc r9, qword[rdx+8]
mov qword[rcx+8], r9
mov r10, qword[rsi+16]
adc r10, qword[rdx+16]
mov qword[rcx+16], r10
mov r11, qword[rsi+24]
adc r11, qword[rdx+24]
jnc bpm_add_4_done
; add C when it overflows
bpm_add_4_mod:
add r8, rdi
adc r9, 0
adc r10, 0
adc r11, 0
jc bpm_add_4_mod
bpm_add_4_done:
mov qword[rcx], r8
mov qword[rcx+8], r9
mov qword[rcx+16], r10
mov qword[rcx+24], r11
ret
;-----------------------------------------------------------------------------
; bpm_sub_4
;-----------------------------------------------------------------------------
; Arguments:
; rdi (arg 1) : modulus parameter C
; rsi (arg 2) : pointer to input A first leg
; rdx (arg 3) : pointer to input B first leg
; rcx (arg 4) : pointer to output first leg
; Preconditions:
; legs per bigint = 4
; Output:
; out = A - B (mod C)
;-----------------------------------------------------------------------------
bpm_sub_4:
; perform subtraction chain
mov r8, qword[rsi]
sub r8, qword[rdx]
mov qword[rcx], r8
mov r9, qword[rsi+8]
sbb r9, qword[rdx+8]
mov qword[rcx+8], r9
mov r10, qword[rsi+16]
sbb r10, qword[rdx+16]
mov qword[rcx+16], r10
mov r11, qword[rsi+24]
sbb r11, qword[rdx+24]
jnc bpm_sub_4_done
; subtract C when it overflows
bpm_sub_4_mod:
sub r8, rdi
sbb r9, 0
sbb r10, 0
sbb r11, 0
jc bpm_sub_4_mod
bpm_sub_4_done:
mov qword[rcx], r8
mov qword[rcx+8], r9
mov qword[rcx+16], r10
mov qword[rcx+24], r11
ret
;-----------------------------------------------------------------------------
; bpm_mul_4
;-----------------------------------------------------------------------------
; Arguments:
; rcx->rdi (arg 1) : modulus parameter C
; rdx->rsi (arg 2) : pointer to input A first leg
; r8->rdx (arg 3) : pointer to input B first leg
; r9->rcx (arg 4) : pointer to output first leg
; Preconditions:
; legs per bigint = 4
; Output:
; out = A * B (mod C)
;-----------------------------------------------------------------------------
bpm_mul_4:
; a b c d : A
; x e f g h : B
; ------------------------
; ah bh ch dh
; ag bg cg dg
; af bf cf df
; + ae be ce de
; ------------------------
push rbp
mov rbp, rsp
sub rsp, 8*10
push r12 r13 r14 r15
label .pro1 qword at rbp-8
label .pro2 qword at rbp-16
label .pro3 qword at rbp-24
label .pro4 qword at rbp-32
label .pro5 qword at rbp-40
label .pro6 qword at rbp-48
label .pro7 qword at rbp-56
label .pro8 qword at rbp-64
label .modc qword at rbp-72
label .out qword at rbp-80
mov qword[.modc], rdi
mov qword[.out], rcx
; ---- 4x4 comba multiply
mov r8, [rsi]
mov r9, [rsi+8]
mov r10, [rsi+16]
mov r11, [rsi+24]
mov r12, [rdx]
mov r13, [rdx+8]
mov r14, [rdx+16]
mov r15, [rdx+24]
; column 1
mov rax, r8
xor rcx, rcx
mul r12 ; dh
mov qword[.pro1], rax
mov rdi, rdx
; column 2
mov rax, r9
xor rsi, rsi
mul r12 ; ch
add rdi, rax
adc rcx, rdx
adc rsi, 0
mov rax, r8
mul r13 ; dg
add rdi, rax
adc rcx, rdx
adc rsi, 0
mov qword[.pro2], rdi
; column 3
mov rax, r10
xor rdi, rdi
mul r12 ; bh
add rcx, rax
adc rsi, rdx
adc rdi, 0
mov rax, r9
mul r13 ; cg
add rcx, rax
adc rsi, rdx
adc rdi, 0
mov rax, r8
mul r14 ; df
add rcx, rax
adc rsi, rdx
adc rdi, 0
mov qword[.pro3], rcx
; column 4
mov rax, r11
xor rcx, rcx
mul r12 ; ah
add rsi, rax
adc rdi, rdx
adc rcx, 0
mov rax, r10
mul r13 ; bg
add rsi, rax
adc rdi, rdx
adc rcx, 0
mov rax, r9
mul r14 ; cf
add rsi, rax
adc rdi, rdx
adc rcx, 0
mov rax, r8
mul r15 ; de
add rsi, rax
adc rdi, rdx
adc rcx, 0
mov rax, r11
mov qword[.pro4], rsi
; column 5
xor rsi, rsi
mul r13 ; ag
add rdi, rax
adc rcx, rdx
adc rsi, 0
mov rax, r10
mul r14 ; bf
add rdi, rax
adc rcx, rdx
adc rsi, 0
mov rax, r9
mul r15 ; ce
add rdi, rax
adc rcx, rdx
adc rsi, 0
; mov qword[.pro5], rbx
mov r8, rdi
; column 6
mov rax, r11
xor rdi, rdi
mul r14 ; af
add rcx, rax
adc rsi, rdx
adc rdi, 0
mov rax, r10
mul r15 ; be
add rcx, rax
adc rsi, rdx
adc rdi, 0
; mov qword[.pro6], rcx
mov r12, rcx ; r12 gets .pro6 from rcx
; column 7
mov rax, r11
mul r15 ; ae
add rsi, rax
adc rdi, rdx
; mov qword[.pro7], rsi
; column 8
; mov qword[.pro8], rbx
; ---- modular reduction 8->5
mov rcx, qword[.modc]
; generate r12..8 = .pro8..5 * c + .pro4..1
mov rax, r8
mul rcx
mov r8, rax
mov r9, rdx
add r8, qword[.pro1]
adc r9, 0
mov rax, r12
mul rcx
xor r10, r10
add r9, rax
adc r10, rdx
add r9, qword[.pro2]
adc r10, 0
mov rax, rsi
mul rcx
xor r11, r11
add r10, rax
adc r11, rdx
add r10, qword[.pro3]
adc r11, 0
mov rax, rdi
mul rcx
xor r12, r12
add r11, rax
adc r12, rdx
add r11, qword[.pro4]
adc r12, 0
; ---- modular reduction 5->4
; generate r11..8 = r12 * c + r11..8
mov rax, r12
mul rcx
add r8, rax
adc r9, rdx
adc r10, 0
adc r11, 0
mov rsi, qword[.out]
; ---- modular reduction 4.1->4
jnc bpm_mul_4_out
; final add carried out so add once more
bpm_mul_4_mod:
add r8, rcx
adc r9, 0
adc r10, 0
adc r11, 0
jc bpm_mul_4_mod
bpm_mul_4_out:
mov qword[rsi], r8
mov qword[rsi+8], r9
mov qword[rsi+16], r10
mov qword[rsi+24], r11
pop r15 r14 r13 r12
mov rsp, rbp
pop rbp
ret
;-----------------------------------------------------------------------------
; bpm_mulx_4
;-----------------------------------------------------------------------------
; Arguments:
; rcx->rdi (arg 1) : modulus parameter C
; rdx->rsi (arg 2) : pointer to input A first leg
; r8->rdx (arg 3) : single leg input B
; r9->rcx (arg 4) : pointer to output first leg
; Preconditions:
; legs per bigint = 4
; Output:
; out = A * B (mod C)
;-----------------------------------------------------------------------------
bpm_mulx_4:
mov r8, rdx
mov rax, qword[rsi]
mul r8
mov r9, rax
mov r10, rdx
mov rax, qword[rsi+8]
mul r8
xor r11, r11
add r10, rax
adc r11, rdx
mov rax, qword[rsi+16]
mul r8
add r11, rax
adc rdx, 0
mov rax, qword[rsi+24]
mov rsi, rdx
mul r8
add rsi, rax
adc rdx, 0
; ---- modular reduction 5->4
mov rax, rdi
mul rdx
add r9, rax
adc r10, rdx
adc r11, 0
adc rsi, 0
; ---- modular reduction 4.1->4
jnc bpm_mulx_4_out
; final add carried out so add once more
bpm_mulx_4_mod:
add r9, rdi
adc r10, 0
adc r11, 0
adc rsi, 0
jc bpm_mulx_4_mod
bpm_mulx_4_out:
mov qword[rcx], r9
mov qword[rcx+8], r10
mov qword[rcx+16], r11
mov qword[rcx+24], rsi
ret
;-----------------------------------------------------------------------------
; bpm_sqr_4
;-----------------------------------------------------------------------------
; Arguments:
; rcx->rdi (arg 1) : modulus parameter C
; rdx->rsi (arg 2) : pointer to input first leg
; r8->rdx (arg 3) : pointer to output first leg
; Preconditions:
; legs per bigint = 4
; Output:
; out = in*in (mod C)
;-----------------------------------------------------------------------------
bpm_sqr_4:
; a b c d
; x a b c d
; ------------------------
; ad bd cd dd
; ac bc cc dc
; ab bb cb db
; + aa ba ca da
; ------------------------
; 2bd dd
; 2ad 2cd
; 2ac cc
; 2ab 2bc
; bb
; + aa
; ------------------------
push rbp
mov rbp, rsp
sub rsp, 8*10
push r12
label .pro1 qword at rbp-8
label .pro2 qword at rbp-16
label .pro3 qword at rbp-24
label .pro4 qword at rbp-32
label .pro5 qword at rbp-40
label .pro6 qword at rbp-48
label .pro7 qword at rbp-56
label .pro8 qword at rbp-64
label .modc qword at rbp-72
label .out qword at rbp-80
mov qword[.modc], rdi
mov qword[.out], rdx
; ---- 4x4 comba square
mov r8, qword[rsi]
mov r9, qword[rsi+8]
mov r10, qword[rsi+16]
mov r11, qword[rsi+24]
; column 1
mov rax, r8
mul r8 ; dd
mov qword[.pro1], rax
mov r12, rdx
xor rsi, rsi
xor rdi, rdi
; column 2
mov rax, r8
mul r9 ; cd
; r14:r13:r12 = 2(rdx:rax) + r12
add r12, rax
adc rsi, rdx
adc rdi, 0
add r12, rax
adc rsi, rdx
adc rdi, 0
mov qword[.pro2], r12
; column 3
mov rax, r8
xor r12, r12
mul r10 ; bd
; r12:r14:r13 = 2(rdx:rax) + 0:r14:r13
add rsi, rax
adc rdi, rdx
adc r12, 0
add rsi, rax
adc rdi, rdx
adc r12, 0
mov rax, r9
mul r9 ; cc
; r12:r14:r13 += 0:rdx:rax
add rsi, rax
adc rdi, rdx
adc r12, 0
mov qword[.pro3], rsi
; column 4
mov rax, r8
xor rsi, rsi
mul r11 ; ad
; r13:r12:r14 = 2(rdx:rax) + 0:r12:r14
add rdi, rax
adc r12, rdx
adc rsi, 0
add rdi, rax
adc r12, rdx
adc rsi, 0
mov rax, r9
mul r10 ; bc
; r13:r12:r14 += 2(rdx:rax)
add rdi, rax
adc r12, rdx
adc rsi, 0
add rdi, rax
adc r12, rdx
adc rsi, 0
mov qword[.pro4], rdi
; column 5
mov rax, r9
xor rdi, rdi
mul r11 ; ac
; r14:r13:r12 = 2(rdx:rax) + 0:r13:r12
add r12, rax
adc rsi, rdx
adc rdi, 0
add r12, rax
adc rsi, rdx
adc rdi, 0
mov rax, r10
mul r10 ; bb
; r14:r13:r12 += 0:rdx:rax
add r12, rax
adc rsi, rdx
adc rdi, 0
; mov qword[.pro5], r12
mov r8, r12
; column 6
mov rax, r10
xor r12, r12
mul r11 ; ab
; r12:r14:r13 = 2(rdx:rax) + 0:r14:r13
add rsi, rax
adc rdi, rdx
adc r12, 0
add rsi, rax
adc rdi, rdx
adc r12, 0
; mov qword[.pro6], r13
; column 7
mov rax, r11
mul r11 ; aa
; r13:r12:r14 = rdx:rax + 0:r12:r14
add rdi, rax
adc r12, rdx
; mov qword[.pro7], r14
; column 8
; mov qword[.pro8], r12
; ---- modular reduction 8->5
mov rcx, qword[.modc]
; generate r12..8 = .pro8..5 * c + .pro4..1
mov rax, r8
mul rcx
mov r8, rax
mov r9, rdx
add r8, qword[.pro1]
adc r9, 0
mov rax, rsi
mul rcx
xor r10, r10
add r9, rax
adc r10, rdx
add r9, qword[.pro2]
adc r10, 0
mov rax, rdi
mul rcx
xor r11, r11
add r10, rax
adc r11, rdx
add r10, qword[.pro3]
adc r11, 0
mov rax, r12
mul rcx
xor r12, r12
add r11, rax
adc r12, rdx
add r11, qword[.pro4]
adc r12, 0
; ---- modular reduction 5->4
; generate r11..8 = r12 * c + r11..8
mov rax, r12
mul rcx
add r8, rax
adc r9, rdx
adc r10, 0
adc r11, 0
mov rsi, qword[.out]
; ---- modular reduction 4.1->4
jnc bpm_sqr_4_out
; final add carried out so add once more
bpm_sqr_4_mod:
add r8, rcx
adc r9, 0
adc r10, 0
adc r11, 0
jc bpm_sqr_4_mod
bpm_sqr_4_out:
mov qword[rsi], r8
mov qword[rsi+8], r9
mov qword[rsi+16], r10
mov qword[rsi+24], r11
pop r12
mov rsp, rbp
pop rbp
ret
;-----------------------------------------------------------------------------
; Appendix: x86-ELF64 Calling Convention
;-----------------------------------------------------------------------------
; Callee save: rsp(stack), rbx(base), rbp(frame), r12-r15
; Caller save: rax(ret), rcx, rdx, r8-r11, rdi, rsi
| 23.38169 | 79 | 0.464791 |
8cf76e58fc27a02350ad66b681b79e24e99211da | 188 | asm | Assembly | libsrc/target/nc100/padreadyparallel.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/nc100/padreadyparallel.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/nc100/padreadyparallel.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
PUBLIC padreadyparallel
PUBLIC _padreadyparallel
; fastcall
.padreadyparallel
._padreadyparallel
call 0xb866
ld hl, 0
ret nc
inc hl
ret
| 13.428571 | 33 | 0.691489 |
321e96966286c310f686e82200ed71517db5efb8 | 7,072 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_915.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_915.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_915.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x218a, %rcx
nop
nop
nop
nop
and $62363, %r15
mov $0x6162636465666768, %r14
movq %r14, %xmm1
movups %xmm1, (%rcx)
nop
nop
lfence
lea addresses_normal_ht+0x717c, %rsi
lea addresses_A_ht+0x71bc, %rdi
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $74, %rcx
rep movsb
nop
nop
xor %rdx, %rdx
lea addresses_D_ht+0xdefc, %rsi
nop
nop
nop
nop
cmp %r13, %r13
mov (%rsi), %di
nop
nop
nop
add $44950, %rsi
lea addresses_WT_ht+0x5836, %rdi
clflush (%rdi)
nop
nop
nop
dec %r14
mov (%rdi), %si
nop
nop
cmp $43905, %rcx
lea addresses_UC_ht+0x437c, %rsi
lea addresses_UC_ht+0x517c, %rdi
nop
nop
sub %r9, %r9
mov $57, %rcx
rep movsw
nop
nop
nop
dec %rdx
lea addresses_WC_ht+0x37dc, %rsi
lea addresses_A_ht+0x1e9c, %rdi
nop
nop
nop
nop
nop
mfence
mov $47, %rcx
rep movsb
nop
and %rdi, %rdi
lea addresses_WT_ht+0x1433c, %rsi
lea addresses_WT_ht+0xa57c, %rdi
nop
nop
nop
xor $1425, %rdx
mov $31, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_UC_ht+0x16b74, %rsi
lea addresses_normal_ht+0x1bbc, %rdi
nop
xor $19263, %r13
mov $45, %rcx
rep movsw
nop
nop
nop
nop
inc %r9
lea addresses_A_ht+0x194e5, %rdi
nop
cmp $61499, %r15
mov $0x6162636465666768, %r14
movq %r14, (%rdi)
nop
nop
nop
nop
cmp $18177, %r14
lea addresses_WT_ht+0x2ad4, %rsi
lea addresses_WC_ht+0x9944, %rdi
clflush (%rsi)
clflush (%rdi)
dec %rdx
mov $105, %rcx
rep movsl
nop
xor $42804, %rcx
lea addresses_WT_ht+0x6c7c, %r13
nop
add %rsi, %rsi
movb (%r13), %cl
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_UC_ht+0x1597c, %rdi
nop
nop
nop
nop
nop
cmp $51478, %rsi
movw $0x6162, (%rdi)
nop
and %r15, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %rdx
// Faulty Load
lea addresses_A+0x1c17c, %r11
nop
nop
nop
nop
xor $37202, %r10
mov (%r11), %r13
lea oracles, %r11
and $0xff, %r13
shlq $12, %r13
mov (%r11,%r13,1), %r13
pop %rdx
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': True, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': True}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 34.497561 | 2,999 | 0.660351 |
811ccc288380b943d4822141c045b09e6d47c816 | 54,085 | asm | Assembly | ls/ls.asm | NudelErde/Kernel | 875a0635b5bbd910680970a9446cb86b96b62323 | [
"MIT"
] | null | null | null | ls/ls.asm | NudelErde/Kernel | 875a0635b5bbd910680970a9446cb86b96b62323 | [
"MIT"
] | null | null | null | ls/ls.asm | NudelErde/Kernel | 875a0635b5bbd910680970a9446cb86b96b62323 | [
"MIT"
] | 1 | 2021-04-28T10:13:53.000Z | 2021-04-28T10:13:53.000Z |
../ls/ls.elf: file format elf64-x86-64
Disassembly of section .text:
0000000060000000 <exit(unsigned long)>:
60000000: 55 push %rbp
60000001: 48 89 e5 mov %rsp,%rbp
60000004: 48 83 ec 10 sub $0x10,%rsp
60000008: 48 89 7d f8 mov %rdi,-0x8(%rbp)
6000000c: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000010: b9 00 00 00 00 mov $0x0,%ecx
60000015: 48 89 c2 mov %rax,%rdx
60000018: be 01 00 00 00 mov $0x1,%esi
6000001d: bf 01 00 00 00 mov $0x1,%edi
60000022: e8 6f 0b 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000027: 90 nop
60000028: c9 leaveq
60000029: c3 retq
000000006000002a <getpid()>:
6000002a: 55 push %rbp
6000002b: 48 89 e5 mov %rsp,%rbp
6000002e: 48 83 ec 10 sub $0x10,%rsp
60000032: 48 8d 45 f8 lea -0x8(%rbp),%rax
60000036: b9 00 00 00 00 mov $0x0,%ecx
6000003b: 48 89 c2 mov %rax,%rdx
6000003e: be 02 00 00 00 mov $0x2,%esi
60000043: bf 01 00 00 00 mov $0x1,%edi
60000048: e8 49 0b 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000004d: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000051: c9 leaveq
60000052: c3 retq
0000000060000053 <createProcess(unsigned long, char const*, char const*, bool)>:
60000053: 55 push %rbp
60000054: 48 89 e5 mov %rsp,%rbp
60000057: 48 83 ec 50 sub $0x50,%rsp
6000005b: 48 89 7d c8 mov %rdi,-0x38(%rbp)
6000005f: 48 89 75 c0 mov %rsi,-0x40(%rbp)
60000063: 48 89 55 b8 mov %rdx,-0x48(%rbp)
60000067: 89 c8 mov %ecx,%eax
60000069: 88 45 b4 mov %al,-0x4c(%rbp)
6000006c: 48 8b 45 c8 mov -0x38(%rbp),%rax
60000070: 48 89 45 d8 mov %rax,-0x28(%rbp)
60000074: 48 8b 45 c0 mov -0x40(%rbp),%rax
60000078: 48 89 45 e0 mov %rax,-0x20(%rbp)
6000007c: 48 8b 45 b8 mov -0x48(%rbp),%rax
60000080: 48 89 45 e8 mov %rax,-0x18(%rbp)
60000084: 0f b6 45 b4 movzbl -0x4c(%rbp),%eax
60000088: 88 45 f8 mov %al,-0x8(%rbp)
6000008b: 48 8d 45 d8 lea -0x28(%rbp),%rax
6000008f: b9 00 00 00 00 mov $0x0,%ecx
60000094: 48 89 c2 mov %rax,%rdx
60000097: be 03 00 00 00 mov $0x3,%esi
6000009c: bf 01 00 00 00 mov $0x1,%edi
600000a1: e8 f0 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600000a6: 48 8b 45 f0 mov -0x10(%rbp),%rax
600000aa: c9 leaveq
600000ab: c3 retq
00000000600000ac <sleep(unsigned long)>:
600000ac: 55 push %rbp
600000ad: 48 89 e5 mov %rsp,%rbp
600000b0: 48 83 ec 10 sub $0x10,%rsp
600000b4: 48 89 7d f8 mov %rdi,-0x8(%rbp)
600000b8: 48 8b 45 f8 mov -0x8(%rbp),%rax
600000bc: b9 00 00 00 00 mov $0x0,%ecx
600000c1: 48 89 c2 mov %rax,%rdx
600000c4: be 04 00 00 00 mov $0x4,%esi
600000c9: bf 01 00 00 00 mov $0x1,%edi
600000ce: e8 c3 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600000d3: 90 nop
600000d4: c9 leaveq
600000d5: c3 retq
00000000600000d6 <malloc(unsigned long)>:
600000d6: 55 push %rbp
600000d7: 48 89 e5 mov %rsp,%rbp
600000da: 48 83 ec 20 sub $0x20,%rsp
600000de: 48 89 7d e8 mov %rdi,-0x18(%rbp)
600000e2: 48 8d 55 f8 lea -0x8(%rbp),%rdx
600000e6: 48 8b 45 e8 mov -0x18(%rbp),%rax
600000ea: 48 89 d1 mov %rdx,%rcx
600000ed: 48 89 c2 mov %rax,%rdx
600000f0: be 05 00 00 00 mov $0x5,%esi
600000f5: bf 01 00 00 00 mov $0x1,%edi
600000fa: e8 97 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600000ff: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000103: c9 leaveq
60000104: c3 retq
0000000060000105 <free(void*)>:
60000105: 55 push %rbp
60000106: 48 89 e5 mov %rsp,%rbp
60000109: 48 83 ec 10 sub $0x10,%rsp
6000010d: 48 89 7d f8 mov %rdi,-0x8(%rbp)
60000111: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000115: b9 00 00 00 00 mov $0x0,%ecx
6000011a: 48 89 c2 mov %rax,%rdx
6000011d: be 06 00 00 00 mov $0x6,%esi
60000122: bf 01 00 00 00 mov $0x1,%edi
60000127: e8 6a 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000012c: 90 nop
6000012d: c9 leaveq
6000012e: c3 retq
000000006000012f <createSharedPage()>:
6000012f: 55 push %rbp
60000130: 48 89 e5 mov %rsp,%rbp
60000133: 48 83 ec 10 sub $0x10,%rsp
60000137: 48 8d 45 f8 lea -0x8(%rbp),%rax
6000013b: b9 00 00 00 00 mov $0x0,%ecx
60000140: 48 89 c2 mov %rax,%rdx
60000143: be 07 00 00 00 mov $0x7,%esi
60000148: bf 01 00 00 00 mov $0x1,%edi
6000014d: e8 44 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000152: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000156: c9 leaveq
60000157: c3 retq
0000000060000158 <inviteProcessToSharedPage(unsigned long, unsigned long)>:
60000158: 55 push %rbp
60000159: 48 89 e5 mov %rsp,%rbp
6000015c: 48 83 ec 10 sub $0x10,%rsp
60000160: 48 89 7d f8 mov %rdi,-0x8(%rbp)
60000164: 48 89 75 f0 mov %rsi,-0x10(%rbp)
60000168: 48 8b 55 f0 mov -0x10(%rbp),%rdx
6000016c: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000170: 48 89 d1 mov %rdx,%rcx
60000173: 48 89 c2 mov %rax,%rdx
60000176: be 08 00 00 00 mov $0x8,%esi
6000017b: bf 01 00 00 00 mov $0x1,%edi
60000180: e8 11 0a 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000185: 90 nop
60000186: c9 leaveq
60000187: c3 retq
0000000060000188 <getPointerToSharedPage(unsigned long)>:
60000188: 55 push %rbp
60000189: 48 89 e5 mov %rsp,%rbp
6000018c: 48 83 ec 20 sub $0x20,%rsp
60000190: 48 89 7d e8 mov %rdi,-0x18(%rbp)
60000194: 48 8d 55 f8 lea -0x8(%rbp),%rdx
60000198: 48 8b 45 e8 mov -0x18(%rbp),%rax
6000019c: 48 89 d1 mov %rdx,%rcx
6000019f: 48 89 c2 mov %rax,%rdx
600001a2: be 09 00 00 00 mov $0x9,%esi
600001a7: bf 01 00 00 00 mov $0x1,%edi
600001ac: e8 e5 09 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600001b1: 48 8b 45 f8 mov -0x8(%rbp),%rax
600001b5: c9 leaveq
600001b6: c3 retq
00000000600001b7 <freeSharedMemoryPage(unsigned long)>:
600001b7: 55 push %rbp
600001b8: 48 89 e5 mov %rsp,%rbp
600001bb: 48 83 ec 10 sub $0x10,%rsp
600001bf: 48 89 7d f8 mov %rdi,-0x8(%rbp)
600001c3: 48 8b 45 f8 mov -0x8(%rbp),%rax
600001c7: b9 00 00 00 00 mov $0x0,%ecx
600001cc: 48 89 c2 mov %rax,%rdx
600001cf: be 0a 00 00 00 mov $0xa,%esi
600001d4: bf 01 00 00 00 mov $0x1,%edi
600001d9: e8 b8 09 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600001de: 90 nop
600001df: c9 leaveq
600001e0: c3 retq
00000000600001e1 <waitForProcess(unsigned long)>:
600001e1: 55 push %rbp
600001e2: 48 89 e5 mov %rsp,%rbp
600001e5: 48 83 ec 20 sub $0x20,%rsp
600001e9: 48 89 7d e8 mov %rdi,-0x18(%rbp)
600001ed: 48 8d 55 f8 lea -0x8(%rbp),%rdx
600001f1: 48 8b 45 e8 mov -0x18(%rbp),%rax
600001f5: 48 89 d1 mov %rdx,%rcx
600001f8: 48 89 c2 mov %rax,%rdx
600001fb: be 0b 00 00 00 mov $0xb,%esi
60000200: bf 01 00 00 00 mov $0x1,%edi
60000205: e8 8c 09 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000020a: 48 8b 45 f8 mov -0x8(%rbp),%rax
6000020e: c9 leaveq
6000020f: c3 retq
0000000060000210 <getArguments()>:
60000210: 55 push %rbp
60000211: 48 89 e5 mov %rsp,%rbp
60000214: 48 83 ec 10 sub $0x10,%rsp
60000218: 48 8d 45 f8 lea -0x8(%rbp),%rax
6000021c: b9 00 00 00 00 mov $0x0,%ecx
60000221: 48 89 c2 mov %rax,%rdx
60000224: be 0c 00 00 00 mov $0xc,%esi
60000229: bf 01 00 00 00 mov $0x1,%edi
6000022e: e8 63 09 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000233: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000237: c9 leaveq
60000238: c3 retq
0000000060000239 <getParentPid()>:
60000239: 55 push %rbp
6000023a: 48 89 e5 mov %rsp,%rbp
6000023d: 48 83 ec 10 sub $0x10,%rsp
60000241: 48 8d 45 f8 lea -0x8(%rbp),%rax
60000245: b9 00 00 00 00 mov $0x0,%ecx
6000024a: 48 89 c2 mov %rax,%rdx
6000024d: be 0d 00 00 00 mov $0xd,%esi
60000252: bf 01 00 00 00 mov $0x1,%edi
60000257: e8 3a 09 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000025c: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000260: c9 leaveq
60000261: c3 retq
0000000060000262 <getInterProcessMethodInfo(unsigned long, unsigned char)>:
60000262: 55 push %rbp
60000263: 48 89 e5 mov %rsp,%rbp
60000266: 48 83 ec 30 sub $0x30,%rsp
6000026a: 48 89 7d d8 mov %rdi,-0x28(%rbp)
6000026e: 89 f0 mov %esi,%eax
60000270: 88 45 d4 mov %al,-0x2c(%rbp)
60000273: 48 8b 45 d8 mov -0x28(%rbp),%rax
60000277: 48 89 45 f0 mov %rax,-0x10(%rbp)
6000027b: 0f b6 45 d4 movzbl -0x2c(%rbp),%eax
6000027f: 88 45 f8 mov %al,-0x8(%rbp)
60000282: 48 8d 45 f0 lea -0x10(%rbp),%rax
60000286: b9 00 00 00 00 mov $0x0,%ecx
6000028b: 48 89 c2 mov %rax,%rdx
6000028e: be 10 00 00 00 mov $0x10,%esi
60000293: bf 01 00 00 00 mov $0x1,%edi
60000298: e8 f9 08 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000029d: 0f b6 45 f9 movzbl -0x7(%rbp),%eax
600002a1: 88 45 ee mov %al,-0x12(%rbp)
600002a4: 0f b6 45 fa movzbl -0x6(%rbp),%eax
600002a8: 88 45 ef mov %al,-0x11(%rbp)
600002ab: 0f b7 45 ee movzwl -0x12(%rbp),%eax
600002af: c9 leaveq
600002b0: c3 retq
00000000600002b1 <callInterProcessMethod(unsigned long, unsigned char, unsigned long*)>:
600002b1: 55 push %rbp
600002b2: 48 89 e5 mov %rsp,%rbp
600002b5: 48 83 ec 40 sub $0x40,%rsp
600002b9: 48 89 7d d8 mov %rdi,-0x28(%rbp)
600002bd: 89 f0 mov %esi,%eax
600002bf: 48 89 55 c8 mov %rdx,-0x38(%rbp)
600002c3: 88 45 d4 mov %al,-0x2c(%rbp)
600002c6: 48 8b 45 d8 mov -0x28(%rbp),%rax
600002ca: 48 89 45 e0 mov %rax,-0x20(%rbp)
600002ce: 0f b6 45 d4 movzbl -0x2c(%rbp),%eax
600002d2: 88 45 f0 mov %al,-0x10(%rbp)
600002d5: 48 8b 45 c8 mov -0x38(%rbp),%rax
600002d9: 48 89 45 e8 mov %rax,-0x18(%rbp)
600002dd: 48 8d 45 e0 lea -0x20(%rbp),%rax
600002e1: b9 00 00 00 00 mov $0x0,%ecx
600002e6: 48 89 c2 mov %rax,%rdx
600002e9: be 11 00 00 00 mov $0x11,%esi
600002ee: bf 01 00 00 00 mov $0x1,%edi
600002f3: e8 9e 08 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600002f8: 48 8b 45 f8 mov -0x8(%rbp),%rax
600002fc: c9 leaveq
600002fd: c3 retq
00000000600002fe <registerInterProcessMethod(unsigned char, unsigned char, unsigned long, bool)>:
600002fe: 55 push %rbp
600002ff: 48 89 e5 mov %rsp,%rbp
60000302: 48 83 ec 40 sub $0x40,%rsp
60000306: 89 f8 mov %edi,%eax
60000308: 48 89 55 d0 mov %rdx,-0x30(%rbp)
6000030c: 89 ca mov %ecx,%edx
6000030e: 88 45 dc mov %al,-0x24(%rbp)
60000311: 89 f0 mov %esi,%eax
60000313: 88 45 d8 mov %al,-0x28(%rbp)
60000316: 89 d0 mov %edx,%eax
60000318: 88 45 cc mov %al,-0x34(%rbp)
6000031b: 0f b6 45 dc movzbl -0x24(%rbp),%eax
6000031f: 88 45 e8 mov %al,-0x18(%rbp)
60000322: 0f b6 45 d8 movzbl -0x28(%rbp),%eax
60000326: 88 45 e9 mov %al,-0x17(%rbp)
60000329: 48 8b 45 d0 mov -0x30(%rbp),%rax
6000032d: 48 89 45 f0 mov %rax,-0x10(%rbp)
60000331: 0f b6 45 cc movzbl -0x34(%rbp),%eax
60000335: 88 45 f8 mov %al,-0x8(%rbp)
60000338: 48 8d 45 e8 lea -0x18(%rbp),%rax
6000033c: b9 00 00 00 00 mov $0x0,%ecx
60000341: 48 89 c2 mov %rax,%rdx
60000344: be 12 00 00 00 mov $0x12,%esi
60000349: bf 01 00 00 00 mov $0x1,%edi
6000034e: e8 43 08 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000353: 90 nop
60000354: c9 leaveq
60000355: c3 retq
0000000060000356 <removeInterProcessMethod(unsigned char)>:
60000356: 55 push %rbp
60000357: 48 89 e5 mov %rsp,%rbp
6000035a: 48 83 ec 10 sub $0x10,%rsp
6000035e: 89 f8 mov %edi,%eax
60000360: 88 45 fc mov %al,-0x4(%rbp)
60000363: 0f b6 45 fc movzbl -0x4(%rbp),%eax
60000367: b9 00 00 00 00 mov $0x0,%ecx
6000036c: 48 89 c2 mov %rax,%rdx
6000036f: be 13 00 00 00 mov $0x13,%esi
60000374: bf 01 00 00 00 mov $0x1,%edi
60000379: e8 18 08 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000037e: 90 nop
6000037f: c9 leaveq
60000380: c3 retq
0000000060000381 <getDeviceCount()>:
60000381: 55 push %rbp
60000382: 48 89 e5 mov %rsp,%rbp
60000385: 48 83 ec 10 sub $0x10,%rsp
60000389: 48 8d 45 f8 lea -0x8(%rbp),%rax
6000038d: b9 00 00 00 00 mov $0x0,%ecx
60000392: 48 89 c2 mov %rax,%rdx
60000395: be 01 00 00 00 mov $0x1,%esi
6000039a: bf 02 00 00 00 mov $0x2,%edi
6000039f: e8 f2 07 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600003a4: 48 8b 45 f8 mov -0x8(%rbp),%rax
600003a8: c9 leaveq
600003a9: c3 retq
00000000600003aa <getSystemDevice()>:
600003aa: 55 push %rbp
600003ab: 48 89 e5 mov %rsp,%rbp
600003ae: 48 83 ec 10 sub $0x10,%rsp
600003b2: 48 8d 45 f8 lea -0x8(%rbp),%rax
600003b6: b9 00 00 00 00 mov $0x0,%ecx
600003bb: 48 89 c2 mov %rax,%rdx
600003be: be 02 00 00 00 mov $0x2,%esi
600003c3: bf 02 00 00 00 mov $0x2,%edi
600003c8: e8 c9 07 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600003cd: 48 8b 45 f8 mov -0x8(%rbp),%rax
600003d1: c9 leaveq
600003d2: c3 retq
00000000600003d3 <write(unsigned char)>:
600003d3: 55 push %rbp
600003d4: 48 89 e5 mov %rsp,%rbp
600003d7: 48 83 ec 10 sub $0x10,%rsp
600003db: 89 f8 mov %edi,%eax
600003dd: 88 45 fc mov %al,-0x4(%rbp)
600003e0: 0f b6 45 fc movzbl -0x4(%rbp),%eax
600003e4: b9 00 00 00 00 mov $0x0,%ecx
600003e9: 48 89 c2 mov %rax,%rdx
600003ec: be 01 00 00 00 mov $0x1,%esi
600003f1: bf 03 00 00 00 mov $0x3,%edi
600003f6: e8 9b 07 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600003fb: 90 nop
600003fc: c9 leaveq
600003fd: c3 retq
00000000600003fe <read()>:
600003fe: 55 push %rbp
600003ff: 48 89 e5 mov %rsp,%rbp
60000402: 48 83 ec 10 sub $0x10,%rsp
60000406: 48 8d 45 ff lea -0x1(%rbp),%rax
6000040a: b9 00 00 00 00 mov $0x0,%ecx
6000040f: 48 89 c2 mov %rax,%rdx
60000412: be 02 00 00 00 mov $0x2,%esi
60000417: bf 03 00 00 00 mov $0x3,%edi
6000041c: e8 75 07 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000421: 0f b6 45 ff movzbl -0x1(%rbp),%eax
60000425: c9 leaveq
60000426: c3 retq
0000000060000427 <getINodeOfPath(unsigned long, char const*)>:
60000427: 55 push %rbp
60000428: 48 89 e5 mov %rsp,%rbp
6000042b: 48 83 ec 20 sub $0x20,%rsp
6000042f: 48 89 7d e8 mov %rdi,-0x18(%rbp)
60000433: 48 89 75 e0 mov %rsi,-0x20(%rbp)
60000437: 48 8b 45 e0 mov -0x20(%rbp),%rax
6000043b: 48 89 45 f0 mov %rax,-0x10(%rbp)
6000043f: 48 8d 55 f0 lea -0x10(%rbp),%rdx
60000443: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000447: 48 89 d1 mov %rdx,%rcx
6000044a: 48 89 c2 mov %rax,%rdx
6000044d: be 01 00 00 00 mov $0x1,%esi
60000452: bf 04 00 00 00 mov $0x4,%edi
60000457: e8 3a 07 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000045c: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000460: c9 leaveq
60000461: c3 retq
0000000060000462 <getSectorOfINode(unsigned long, unsigned long, unsigned long, unsigned char*)>:
60000462: 55 push %rbp
60000463: 48 89 e5 mov %rsp,%rbp
60000466: 48 83 ec 40 sub $0x40,%rsp
6000046a: 48 89 7d d8 mov %rdi,-0x28(%rbp)
6000046e: 48 89 75 d0 mov %rsi,-0x30(%rbp)
60000472: 48 89 55 c8 mov %rdx,-0x38(%rbp)
60000476: 48 89 4d c0 mov %rcx,-0x40(%rbp)
6000047a: 48 8b 45 d0 mov -0x30(%rbp),%rax
6000047e: 48 89 45 e0 mov %rax,-0x20(%rbp)
60000482: 48 8b 45 c8 mov -0x38(%rbp),%rax
60000486: 48 89 45 e8 mov %rax,-0x18(%rbp)
6000048a: 48 8b 45 c0 mov -0x40(%rbp),%rax
6000048e: 48 89 45 f0 mov %rax,-0x10(%rbp)
60000492: 48 8d 55 e0 lea -0x20(%rbp),%rdx
60000496: 48 8b 45 d8 mov -0x28(%rbp),%rax
6000049a: 48 89 d1 mov %rdx,%rcx
6000049d: 48 89 c2 mov %rax,%rdx
600004a0: be 02 00 00 00 mov $0x2,%esi
600004a5: bf 04 00 00 00 mov $0x4,%edi
600004aa: e8 e7 06 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600004af: 0f b6 45 f8 movzbl -0x8(%rbp),%eax
600004b3: c9 leaveq
600004b4: c3 retq
00000000600004b5 <getFlagsOfINode(unsigned long, unsigned long)>:
600004b5: 55 push %rbp
600004b6: 48 89 e5 mov %rsp,%rbp
600004b9: 48 83 ec 20 sub $0x20,%rsp
600004bd: 48 89 7d e8 mov %rdi,-0x18(%rbp)
600004c1: 48 89 75 e0 mov %rsi,-0x20(%rbp)
600004c5: 48 8b 45 e0 mov -0x20(%rbp),%rax
600004c9: 48 89 45 f0 mov %rax,-0x10(%rbp)
600004cd: 48 8d 55 f0 lea -0x10(%rbp),%rdx
600004d1: 48 8b 45 e8 mov -0x18(%rbp),%rax
600004d5: 48 89 d1 mov %rdx,%rcx
600004d8: 48 89 c2 mov %rax,%rdx
600004db: be 03 00 00 00 mov $0x3,%esi
600004e0: bf 04 00 00 00 mov $0x4,%edi
600004e5: e8 ac 06 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600004ea: 48 8b 45 f8 mov -0x8(%rbp),%rax
600004ee: c9 leaveq
600004ef: c3 retq
00000000600004f0 <getDirectoryEntriesOfINode(unsigned long, unsigned long, unsigned long, DirectoryEntry*)>:
600004f0: 55 push %rbp
600004f1: 48 89 e5 mov %rsp,%rbp
600004f4: 48 83 ec 40 sub $0x40,%rsp
600004f8: 48 89 7d d8 mov %rdi,-0x28(%rbp)
600004fc: 48 89 75 d0 mov %rsi,-0x30(%rbp)
60000500: 48 89 55 c8 mov %rdx,-0x38(%rbp)
60000504: 48 89 4d c0 mov %rcx,-0x40(%rbp)
60000508: 48 8b 45 d0 mov -0x30(%rbp),%rax
6000050c: 48 89 45 e0 mov %rax,-0x20(%rbp)
60000510: 48 8b 45 c8 mov -0x38(%rbp),%rax
60000514: 48 89 45 e8 mov %rax,-0x18(%rbp)
60000518: 48 8b 45 c0 mov -0x40(%rbp),%rax
6000051c: 48 89 45 f0 mov %rax,-0x10(%rbp)
60000520: 48 8d 55 e0 lea -0x20(%rbp),%rdx
60000524: 48 8b 45 d8 mov -0x28(%rbp),%rax
60000528: 48 89 d1 mov %rdx,%rcx
6000052b: 48 89 c2 mov %rax,%rdx
6000052e: be 04 00 00 00 mov $0x4,%esi
60000533: bf 04 00 00 00 mov $0x4,%edi
60000538: e8 59 06 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000053d: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000541: c9 leaveq
60000542: c3 retq
0000000060000543 <getFileSize(unsigned long, unsigned long)>:
60000543: 55 push %rbp
60000544: 48 89 e5 mov %rsp,%rbp
60000547: 48 83 ec 20 sub $0x20,%rsp
6000054b: 48 89 7d e8 mov %rdi,-0x18(%rbp)
6000054f: 48 89 75 e0 mov %rsi,-0x20(%rbp)
60000553: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000557: 48 89 45 f0 mov %rax,-0x10(%rbp)
6000055b: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp)
60000562: 00
60000563: 48 8d 55 f0 lea -0x10(%rbp),%rdx
60000567: 48 8b 45 e8 mov -0x18(%rbp),%rax
6000056b: 48 89 d1 mov %rdx,%rcx
6000056e: 48 89 c2 mov %rax,%rdx
60000571: be 05 00 00 00 mov $0x5,%esi
60000576: bf 04 00 00 00 mov $0x4,%edi
6000057b: e8 16 06 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000580: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000584: c9 leaveq
60000585: c3 retq
0000000060000586 <getPciDeviceCount()>:
60000586: 55 push %rbp
60000587: 48 89 e5 mov %rsp,%rbp
6000058a: 48 83 ec 10 sub $0x10,%rsp
6000058e: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp)
60000595: 00
60000596: 48 8d 45 f8 lea -0x8(%rbp),%rax
6000059a: 48 89 c1 mov %rax,%rcx
6000059d: ba 00 00 00 00 mov $0x0,%edx
600005a2: be 02 00 00 00 mov $0x2,%esi
600005a7: bf 05 00 00 00 mov $0x5,%edi
600005ac: e8 e5 05 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600005b1: 48 8b 45 f8 mov -0x8(%rbp),%rax
600005b5: c9 leaveq
600005b6: c3 retq
00000000600005b7 <getPciDeviceList(unsigned long*, unsigned long)>:
600005b7: 55 push %rbp
600005b8: 48 89 e5 mov %rsp,%rbp
600005bb: 48 83 ec 10 sub $0x10,%rsp
600005bf: 48 89 7d f8 mov %rdi,-0x8(%rbp)
600005c3: 48 89 75 f0 mov %rsi,-0x10(%rbp)
600005c7: 48 8b 55 f8 mov -0x8(%rbp),%rdx
600005cb: 48 8b 45 f0 mov -0x10(%rbp),%rax
600005cf: 48 89 d1 mov %rdx,%rcx
600005d2: 48 89 c2 mov %rax,%rdx
600005d5: be 02 00 00 00 mov $0x2,%esi
600005da: bf 05 00 00 00 mov $0x5,%edi
600005df: e8 b2 05 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600005e4: 90 nop
600005e5: c9 leaveq
600005e6: c3 retq
00000000600005e7 <getPciDeviceHeader(unsigned long, unsigned char*)>:
600005e7: 55 push %rbp
600005e8: 48 89 e5 mov %rsp,%rbp
600005eb: 48 83 ec 10 sub $0x10,%rsp
600005ef: 48 89 7d f8 mov %rdi,-0x8(%rbp)
600005f3: 48 89 75 f0 mov %rsi,-0x10(%rbp)
600005f7: 48 8b 55 f0 mov -0x10(%rbp),%rdx
600005fb: 48 8b 45 f8 mov -0x8(%rbp),%rax
600005ff: 48 89 d1 mov %rdx,%rcx
60000602: 48 89 c2 mov %rax,%rdx
60000605: be 03 00 00 00 mov $0x3,%esi
6000060a: bf 05 00 00 00 mov $0x5,%edi
6000060f: e8 82 05 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000614: 90 nop
60000615: c9 leaveq
60000616: c3 retq
0000000060000617 <allocateMemoryPage(unsigned long)>:
60000617: 55 push %rbp
60000618: 48 89 e5 mov %rsp,%rbp
6000061b: 48 83 ec 10 sub $0x10,%rsp
6000061f: 48 89 7d f8 mov %rdi,-0x8(%rbp)
60000623: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000627: b9 00 00 00 00 mov $0x0,%ecx
6000062c: 48 89 c2 mov %rax,%rdx
6000062f: be 04 00 00 00 mov $0x4,%esi
60000634: bf 05 00 00 00 mov $0x5,%edi
60000639: e8 58 05 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000063e: 90 nop
6000063f: c9 leaveq
60000640: c3 retq
0000000060000641 <freeMemoryPage(unsigned long)>:
60000641: 55 push %rbp
60000642: 48 89 e5 mov %rsp,%rbp
60000645: 48 83 ec 10 sub $0x10,%rsp
60000649: 48 89 7d f8 mov %rdi,-0x8(%rbp)
6000064d: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000651: b9 00 00 00 00 mov $0x0,%ecx
60000656: 48 89 c2 mov %rax,%rdx
60000659: be 05 00 00 00 mov $0x5,%esi
6000065e: bf 05 00 00 00 mov $0x5,%edi
60000663: e8 2e 05 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000668: 90 nop
60000669: c9 leaveq
6000066a: c3 retq
000000006000066b <virtualToPhysicalAddress(unsigned long)>:
6000066b: 55 push %rbp
6000066c: 48 89 e5 mov %rsp,%rbp
6000066f: 48 83 ec 20 sub $0x20,%rsp
60000673: 48 89 7d e8 mov %rdi,-0x18(%rbp)
60000677: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp)
6000067e: 00
6000067f: 48 8d 55 f8 lea -0x8(%rbp),%rdx
60000683: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000687: 48 89 d1 mov %rdx,%rcx
6000068a: 48 89 c2 mov %rax,%rdx
6000068d: be 06 00 00 00 mov $0x6,%esi
60000692: bf 05 00 00 00 mov $0x5,%edi
60000697: e8 fa 04 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
6000069c: 48 8b 45 f8 mov -0x8(%rbp),%rax
600006a0: c9 leaveq
600006a1: c3 retq
00000000600006a2 <mapVirtualToPhysicalAddress(unsigned long, unsigned long)>:
600006a2: 55 push %rbp
600006a3: 48 89 e5 mov %rsp,%rbp
600006a6: 48 83 ec 10 sub $0x10,%rsp
600006aa: 48 89 7d f8 mov %rdi,-0x8(%rbp)
600006ae: 48 89 75 f0 mov %rsi,-0x10(%rbp)
600006b2: 48 8b 55 f0 mov -0x10(%rbp),%rdx
600006b6: 48 8b 45 f8 mov -0x8(%rbp),%rax
600006ba: 48 89 d1 mov %rdx,%rcx
600006bd: 48 89 c2 mov %rax,%rdx
600006c0: be 07 00 00 00 mov $0x7,%esi
600006c5: bf 05 00 00 00 mov $0x5,%edi
600006ca: e8 c7 04 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
600006cf: 90 nop
600006d0: c9 leaveq
600006d1: c3 retq
00000000600006d2 <getDriverStatus(unsigned long)>:
600006d2: 55 push %rbp
600006d3: 48 89 e5 mov %rsp,%rbp
600006d6: 48 83 ec 20 sub $0x20,%rsp
600006da: 48 89 7d e8 mov %rdi,-0x18(%rbp)
600006de: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp)
600006e5: 00
600006e6: 48 8d 55 f8 lea -0x8(%rbp),%rdx
600006ea: 48 8b 45 e8 mov -0x18(%rbp),%rax
600006ee: 48 89 d1 mov %rdx,%rcx
600006f1: 48 89 c2 mov %rax,%rdx
600006f4: be 10 00 00 00 mov $0x10,%esi
600006f9: bf 05 00 00 00 mov $0x5,%edi
600006fe: e8 93 04 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000703: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000707: c9 leaveq
60000708: c3 retq
0000000060000709 <driverCall(unsigned long, unsigned char, void*)>:
60000709: 55 push %rbp
6000070a: 48 89 e5 mov %rsp,%rbp
6000070d: 48 83 ec 20 sub $0x20,%rsp
60000711: 48 89 7d f8 mov %rdi,-0x8(%rbp)
60000715: 89 f0 mov %esi,%eax
60000717: 48 89 55 e8 mov %rdx,-0x18(%rbp)
6000071b: 88 45 f4 mov %al,-0xc(%rbp)
6000071e: 80 7d f4 00 cmpb $0x0,-0xc(%rbp)
60000722: 74 26 je 6000074a <driverCall(unsigned long, unsigned char, void*)+0x41>
60000724: 80 7d f4 0f cmpb $0xf,-0xc(%rbp)
60000728: 77 20 ja 6000074a <driverCall(unsigned long, unsigned char, void*)+0x41>
6000072a: 48 8b 4d e8 mov -0x18(%rbp),%rcx
6000072e: 0f b6 45 f4 movzbl -0xc(%rbp),%eax
60000732: 83 c0 10 add $0x10,%eax
60000735: 48 98 cltq
60000737: 48 8b 55 f8 mov -0x8(%rbp),%rdx
6000073b: 48 89 c6 mov %rax,%rsi
6000073e: bf 05 00 00 00 mov $0x5,%edi
60000743: e8 4e 04 00 00 callq 60000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>
60000748: eb 01 jmp 6000074b <driverCall(unsigned long, unsigned char, void*)+0x42>
6000074a: 90 nop
6000074b: c9 leaveq
6000074c: c3 retq
000000006000074d <countArgc(char const*)>:
6000074d: 55 push %rbp
6000074e: 48 89 e5 mov %rsp,%rbp
60000751: 48 83 ec 18 sub $0x18,%rsp
60000755: 48 89 7d e8 mov %rdi,-0x18(%rbp)
60000759: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
60000760: 48 83 7d e8 00 cmpq $0x0,-0x18(%rbp)
60000765: 74 0b je 60000772 <countArgc(char const*)+0x25>
60000767: 48 8b 45 e8 mov -0x18(%rbp),%rax
6000076b: 0f b6 00 movzbl (%rax),%eax
6000076e: 84 c0 test %al,%al
60000770: 75 09 jne 6000077b <countArgc(char const*)+0x2e>
60000772: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
60000779: eb 31 jmp 600007ac <countArgc(char const*)+0x5f>
6000077b: 48 8b 45 e8 mov -0x18(%rbp),%rax
6000077f: 0f b6 00 movzbl (%rax),%eax
60000782: 84 c0 test %al,%al
60000784: 75 04 jne 6000078a <countArgc(char const*)+0x3d>
60000786: 83 45 fc 01 addl $0x1,-0x4(%rbp)
6000078a: 48 8b 45 e8 mov -0x18(%rbp),%rax
6000078e: 0f b6 00 movzbl (%rax),%eax
60000791: 84 c0 test %al,%al
60000793: 75 0f jne 600007a4 <countArgc(char const*)+0x57>
60000795: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000799: 48 83 c0 01 add $0x1,%rax
6000079d: 0f b6 00 movzbl (%rax),%eax
600007a0: 84 c0 test %al,%al
600007a2: 74 07 je 600007ab <countArgc(char const*)+0x5e>
600007a4: 48 83 45 e8 01 addq $0x1,-0x18(%rbp)
600007a9: eb d0 jmp 6000077b <countArgc(char const*)+0x2e>
600007ab: 90 nop
600007ac: 8b 45 fc mov -0x4(%rbp),%eax
600007af: c9 leaveq
600007b0: c3 retq
00000000600007b1 <buildArgv(int, char const*)>:
600007b1: 55 push %rbp
600007b2: 48 89 e5 mov %rsp,%rbp
600007b5: 48 83 ec 20 sub $0x20,%rsp
600007b9: 89 7d ec mov %edi,-0x14(%rbp)
600007bc: 48 89 75 e0 mov %rsi,-0x20(%rbp)
600007c0: 8b 45 ec mov -0x14(%rbp),%eax
600007c3: 83 c0 01 add $0x1,%eax
600007c6: 48 98 cltq
600007c8: 48 c1 e0 03 shl $0x3,%rax
600007cc: 48 89 c7 mov %rax,%rdi
600007cf: e8 02 f9 ff ff callq 600000d6 <malloc(unsigned long)>
600007d4: 48 89 45 f0 mov %rax,-0x10(%rbp)
600007d8: 8b 45 ec mov -0x14(%rbp),%eax
600007db: 48 98 cltq
600007dd: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx
600007e4: 00
600007e5: 48 8b 45 f0 mov -0x10(%rbp),%rax
600007e9: 48 01 d0 add %rdx,%rax
600007ec: 48 c7 00 00 00 00 00 movq $0x0,(%rax)
600007f3: 83 7d ec 00 cmpl $0x0,-0x14(%rbp)
600007f7: 7e 4b jle 60000844 <buildArgv(int, char const*)+0x93>
600007f9: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp)
60000800: 00
60000801: 48 8b 45 f8 mov -0x8(%rbp),%rax
60000805: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx
6000080c: 00
6000080d: 48 8b 45 f0 mov -0x10(%rbp),%rax
60000811: 48 01 c2 add %rax,%rdx
60000814: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000818: 48 89 02 mov %rax,(%rdx)
6000081b: 48 83 45 f8 01 addq $0x1,-0x8(%rbp)
60000820: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000824: 0f b6 00 movzbl (%rax),%eax
60000827: 84 c0 test %al,%al
60000829: 74 07 je 60000832 <buildArgv(int, char const*)+0x81>
6000082b: 48 83 45 e0 01 addq $0x1,-0x20(%rbp)
60000830: eb ee jmp 60000820 <buildArgv(int, char const*)+0x6f>
60000832: 48 83 45 e0 01 addq $0x1,-0x20(%rbp)
60000837: 48 8b 45 e0 mov -0x20(%rbp),%rax
6000083b: 0f b6 00 movzbl (%rax),%eax
6000083e: 84 c0 test %al,%al
60000840: 74 02 je 60000844 <buildArgv(int, char const*)+0x93>
60000842: eb bd jmp 60000801 <buildArgv(int, char const*)+0x50>
60000844: 48 8b 45 f0 mov -0x10(%rbp),%rax
60000848: c9 leaveq
60000849: c3 retq
000000006000084a <__start1>:
6000084a: 55 push %rbp
6000084b: 48 89 e5 mov %rsp,%rbp
6000084e: 48 83 ec 20 sub $0x20,%rsp
60000852: e8 d3 f7 ff ff callq 6000002a <getpid()>
60000857: 48 89 05 a2 07 00 00 mov %rax,0x7a2(%rip) # 60001000 <myPid>
6000085e: e8 ad f9 ff ff callq 60000210 <getArguments()>
60000863: 48 89 45 f8 mov %rax,-0x8(%rbp)
60000867: 48 8b 45 f8 mov -0x8(%rbp),%rax
6000086b: 48 89 c7 mov %rax,%rdi
6000086e: e8 da fe ff ff callq 6000074d <countArgc(char const*)>
60000873: 89 45 f4 mov %eax,-0xc(%rbp)
60000876: 48 8b 55 f8 mov -0x8(%rbp),%rdx
6000087a: 8b 45 f4 mov -0xc(%rbp),%eax
6000087d: 48 89 d6 mov %rdx,%rsi
60000880: 89 c7 mov %eax,%edi
60000882: e8 2a ff ff ff callq 600007b1 <buildArgv(int, char const*)>
60000887: 48 89 45 e8 mov %rax,-0x18(%rbp)
6000088b: 48 8b 55 e8 mov -0x18(%rbp),%rdx
6000088f: 8b 45 f4 mov -0xc(%rbp),%eax
60000892: 48 89 d6 mov %rdx,%rsi
60000895: 89 c7 mov %eax,%edi
60000897: e8 2a 01 00 00 callq 600009c6 <main>
6000089c: 89 45 e4 mov %eax,-0x1c(%rbp)
6000089f: 8b 45 e4 mov -0x1c(%rbp),%eax
600008a2: 48 98 cltq
600008a4: 48 89 c7 mov %rax,%rdi
600008a7: e8 54 f7 ff ff callq 60000000 <exit(unsigned long)>
600008ac: 90 nop
600008ad: c9 leaveq
600008ae: c3 retq
00000000600008af <__start>:
600008af: 48 89 e5 mov %rsp,%rbp
600008b2: e8 93 ff ff ff callq 6000084a <__start1>
600008b7: cc int3
00000000600008b8 <print(char const*)>:
600008b8: 55 push %rbp
600008b9: 48 89 e5 mov %rsp,%rbp
600008bc: 48 83 ec 20 sub $0x20,%rsp
600008c0: 48 89 7d e8 mov %rdi,-0x18(%rbp)
600008c4: 48 8b 45 e8 mov -0x18(%rbp),%rax
600008c8: 48 89 45 f8 mov %rax,-0x8(%rbp)
600008cc: 48 8b 45 f8 mov -0x8(%rbp),%rax
600008d0: 0f b6 00 movzbl (%rax),%eax
600008d3: 84 c0 test %al,%al
600008d5: 74 18 je 600008ef <print(char const*)+0x37>
600008d7: 48 8b 45 f8 mov -0x8(%rbp),%rax
600008db: 0f b6 00 movzbl (%rax),%eax
600008de: 0f b6 c0 movzbl %al,%eax
600008e1: 89 c7 mov %eax,%edi
600008e3: e8 eb fa ff ff callq 600003d3 <write(unsigned char)>
600008e8: 48 83 45 f8 01 addq $0x1,-0x8(%rbp)
600008ed: eb dd jmp 600008cc <print(char const*)+0x14>
600008ef: 90 nop
600008f0: c9 leaveq
600008f1: c3 retq
00000000600008f2 <printBase(unsigned long, unsigned long, int)>:
600008f2: 55 push %rbp
600008f3: 48 89 e5 mov %rsp,%rbp
600008f6: 48 83 c4 80 add $0xffffffffffffff80,%rsp
600008fa: 48 89 7d 98 mov %rdi,-0x68(%rbp)
600008fe: 48 89 75 90 mov %rsi,-0x70(%rbp)
60000902: 89 55 8c mov %edx,-0x74(%rbp)
60000905: 48 c7 45 e8 00 20 00 movq $0x60002000,-0x18(%rbp)
6000090c: 60
6000090d: 48 8d 55 a8 lea -0x58(%rbp),%rdx
60000911: b8 00 00 00 00 mov $0x0,%eax
60000916: b9 08 00 00 00 mov $0x8,%ecx
6000091b: 48 89 d7 mov %rdx,%rdi
6000091e: f3 48 ab rep stos %rax,%es:(%rdi)
60000921: c7 45 fc 01 00 00 00 movl $0x1,-0x4(%rbp)
60000928: 48 83 7d 98 00 cmpq $0x0,-0x68(%rbp)
6000092d: 74 37 je 60000966 <printBase(unsigned long, unsigned long, int)+0x74>
6000092f: 48 8b 45 98 mov -0x68(%rbp),%rax
60000933: ba 00 00 00 00 mov $0x0,%edx
60000938: 48 f7 75 90 divq -0x70(%rbp)
6000093c: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000940: 48 01 d0 add %rdx,%rax
60000943: 0f b6 10 movzbl (%rax),%edx
60000946: 8b 45 fc mov -0x4(%rbp),%eax
60000949: 48 98 cltq
6000094b: 88 54 05 a8 mov %dl,-0x58(%rbp,%rax,1)
6000094f: 48 8b 45 98 mov -0x68(%rbp),%rax
60000953: ba 00 00 00 00 mov $0x0,%edx
60000958: 48 f7 75 90 divq -0x70(%rbp)
6000095c: 48 89 45 98 mov %rax,-0x68(%rbp)
60000960: 83 45 fc 01 addl $0x1,-0x4(%rbp)
60000964: eb c2 jmp 60000928 <printBase(unsigned long, unsigned long, int)+0x36>
60000966: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp)
6000096d: 8b 45 8c mov -0x74(%rbp),%eax
60000970: 2b 45 fc sub -0x4(%rbp),%eax
60000973: 39 45 f8 cmp %eax,-0x8(%rbp)
60000976: 7f 10 jg 60000988 <printBase(unsigned long, unsigned long, int)+0x96>
60000978: bf 30 00 00 00 mov $0x30,%edi
6000097d: e8 51 fa ff ff callq 600003d3 <write(unsigned char)>
60000982: 83 45 f8 01 addl $0x1,-0x8(%rbp)
60000986: eb e5 jmp 6000096d <printBase(unsigned long, unsigned long, int)+0x7b>
60000988: c6 45 e7 00 movb $0x0,-0x19(%rbp)
6000098c: 8b 45 fc mov -0x4(%rbp),%eax
6000098f: 48 98 cltq
60000991: 48 8d 50 ff lea -0x1(%rax),%rdx
60000995: 48 8d 45 a8 lea -0x58(%rbp),%rax
60000999: 48 01 d0 add %rdx,%rax
6000099c: 48 89 45 f0 mov %rax,-0x10(%rbp)
600009a0: 48 8b 45 f0 mov -0x10(%rbp),%rax
600009a4: 0f b6 00 movzbl (%rax),%eax
600009a7: 84 c0 test %al,%al
600009a9: 74 18 je 600009c3 <printBase(unsigned long, unsigned long, int)+0xd1>
600009ab: 48 8b 45 f0 mov -0x10(%rbp),%rax
600009af: 0f b6 00 movzbl (%rax),%eax
600009b2: 0f b6 c0 movzbl %al,%eax
600009b5: 89 c7 mov %eax,%edi
600009b7: e8 17 fa ff ff callq 600003d3 <write(unsigned char)>
600009bc: 48 83 6d f0 01 subq $0x1,-0x10(%rbp)
600009c1: eb dd jmp 600009a0 <printBase(unsigned long, unsigned long, int)+0xae>
600009c3: 90 nop
600009c4: c9 leaveq
600009c5: c3 retq
00000000600009c6 <main>:
600009c6: 55 push %rbp
600009c7: 48 89 e5 mov %rsp,%rbp
600009ca: 48 81 ec 10 01 00 00 sub $0x110,%rsp
600009d1: 89 bd fc fe ff ff mov %edi,-0x104(%rbp)
600009d7: 48 89 b5 f0 fe ff ff mov %rsi,-0x110(%rbp)
600009de: e8 c7 f9 ff ff callq 600003aa <getSystemDevice()>
600009e3: 48 89 45 e0 mov %rax,-0x20(%rbp)
600009e7: 48 c7 45 f8 11 20 00 movq $0x60002011,-0x8(%rbp)
600009ee: 60
600009ef: 83 bd fc fe ff ff 01 cmpl $0x1,-0x104(%rbp)
600009f6: 7e 0f jle 60000a07 <main+0x41>
600009f8: 48 8b 85 f0 fe ff ff mov -0x110(%rbp),%rax
600009ff: 48 8b 40 08 mov 0x8(%rax),%rax
60000a03: 48 89 45 f8 mov %rax,-0x8(%rbp)
60000a07: 48 8b 55 f8 mov -0x8(%rbp),%rdx
60000a0b: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000a0f: 48 89 d6 mov %rdx,%rsi
60000a12: 48 89 c7 mov %rax,%rdi
60000a15: e8 0d fa ff ff callq 60000427 <getINodeOfPath(unsigned long, char const*)>
60000a1a: 48 89 45 d8 mov %rax,-0x28(%rbp)
60000a1e: 48 83 7d d8 00 cmpq $0x0,-0x28(%rbp)
60000a23: 74 1a je 60000a3f <main+0x79>
60000a25: 48 8b 55 d8 mov -0x28(%rbp),%rdx
60000a29: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000a2d: 48 89 d6 mov %rdx,%rsi
60000a30: 48 89 c7 mov %rax,%rdi
60000a33: e8 7d fa ff ff callq 600004b5 <getFlagsOfINode(unsigned long, unsigned long)>
60000a38: b8 00 00 00 00 mov $0x0,%eax
60000a3d: eb 05 jmp 60000a44 <main+0x7e>
60000a3f: b8 01 00 00 00 mov $0x1,%eax
60000a44: 84 c0 test %al,%al
60000a46: 74 14 je 60000a5c <main+0x96>
60000a48: bf 13 20 00 60 mov $0x60002013,%edi
60000a4d: e8 66 fe ff ff callq 600008b8 <print(char const*)>
60000a52: b8 01 00 00 00 mov $0x1,%eax
60000a57: e9 38 01 00 00 jmpq 60000b94 <main+0x1ce>
60000a5c: 48 8d 95 00 ff ff ff lea -0x100(%rbp),%rdx
60000a63: 48 8b 75 d8 mov -0x28(%rbp),%rsi
60000a67: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000a6b: 48 89 d1 mov %rdx,%rcx
60000a6e: ba 08 00 00 00 mov $0x8,%edx
60000a73: 48 89 c7 mov %rax,%rdi
60000a76: e8 75 fa ff ff callq 600004f0 <getDirectoryEntriesOfINode(unsigned long, unsigned long, unsigned long, DirectoryEntry*)>
60000a7b: 48 89 45 d0 mov %rax,-0x30(%rbp)
60000a7f: b8 08 00 00 00 mov $0x8,%eax
60000a84: 48 83 7d d0 08 cmpq $0x8,-0x30(%rbp)
60000a89: 48 0f 46 45 d0 cmovbe -0x30(%rbp),%rax
60000a8e: 48 89 45 c8 mov %rax,-0x38(%rbp)
60000a92: 48 c7 45 f0 00 00 00 movq $0x0,-0x10(%rbp)
60000a99: 00
60000a9a: 48 8b 45 f0 mov -0x10(%rbp),%rax
60000a9e: 48 3b 45 c8 cmp -0x38(%rbp),%rax
60000aa2: 73 36 jae 60000ada <main+0x114>
60000aa4: 48 8b 55 f0 mov -0x10(%rbp),%rdx
60000aa8: 48 89 d0 mov %rdx,%rax
60000aab: 48 01 c0 add %rax,%rax
60000aae: 48 01 d0 add %rdx,%rax
60000ab1: 48 c1 e0 03 shl $0x3,%rax
60000ab5: 48 01 e8 add %rbp,%rax
60000ab8: 48 2d f0 00 00 00 sub $0xf0,%rax
60000abe: 48 8b 00 mov (%rax),%rax
60000ac1: 48 89 c7 mov %rax,%rdi
60000ac4: e8 ef fd ff ff callq 600008b8 <print(char const*)>
60000ac9: bf 09 00 00 00 mov $0x9,%edi
60000ace: e8 00 f9 ff ff callq 600003d3 <write(unsigned char)>
60000ad3: 48 83 45 f0 01 addq $0x1,-0x10(%rbp)
60000ad8: eb c0 jmp 60000a9a <main+0xd4>
60000ada: 48 83 7d d0 08 cmpq $0x8,-0x30(%rbp)
60000adf: 0f 86 a0 00 00 00 jbe 60000b85 <main+0x1bf>
60000ae5: 48 8b 55 d0 mov -0x30(%rbp),%rdx
60000ae9: 48 89 d0 mov %rdx,%rax
60000aec: 48 01 c0 add %rax,%rax
60000aef: 48 01 d0 add %rdx,%rax
60000af2: 48 c1 e0 03 shl $0x3,%rax
60000af6: 48 89 c7 mov %rax,%rdi
60000af9: e8 d8 f5 ff ff callq 600000d6 <malloc(unsigned long)>
60000afe: 48 89 45 c0 mov %rax,-0x40(%rbp)
60000b02: 48 8b 4d c0 mov -0x40(%rbp),%rcx
60000b06: 48 8b 55 d0 mov -0x30(%rbp),%rdx
60000b0a: 48 8b 75 d8 mov -0x28(%rbp),%rsi
60000b0e: 48 8b 45 e0 mov -0x20(%rbp),%rax
60000b12: 48 89 c7 mov %rax,%rdi
60000b15: e8 d6 f9 ff ff callq 600004f0 <getDirectoryEntriesOfINode(unsigned long, unsigned long, unsigned long, DirectoryEntry*)>
60000b1a: 48 89 45 d0 mov %rax,-0x30(%rbp)
60000b1e: 48 c7 45 e8 00 00 00 movq $0x0,-0x18(%rbp)
60000b25: 00
60000b26: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000b2a: 48 3b 45 d0 cmp -0x30(%rbp),%rax
60000b2e: 73 55 jae 60000b85 <main+0x1bf>
60000b30: 48 83 7d e8 07 cmpq $0x7,-0x18(%rbp)
60000b35: 76 47 jbe 60000b7e <main+0x1b8>
60000b37: 48 8b 45 e8 mov -0x18(%rbp),%rax
60000b3b: 83 e0 07 and $0x7,%eax
60000b3e: 48 85 c0 test %rax,%rax
60000b41: 75 0a jne 60000b4d <main+0x187>
60000b43: bf 0a 00 00 00 mov $0xa,%edi
60000b48: e8 86 f8 ff ff callq 600003d3 <write(unsigned char)>
60000b4d: 48 8b 55 e8 mov -0x18(%rbp),%rdx
60000b51: 48 89 d0 mov %rdx,%rax
60000b54: 48 01 c0 add %rax,%rax
60000b57: 48 01 d0 add %rdx,%rax
60000b5a: 48 c1 e0 03 shl $0x3,%rax
60000b5e: 48 89 c2 mov %rax,%rdx
60000b61: 48 8b 45 c0 mov -0x40(%rbp),%rax
60000b65: 48 01 d0 add %rdx,%rax
60000b68: 48 8b 40 10 mov 0x10(%rax),%rax
60000b6c: 48 89 c7 mov %rax,%rdi
60000b6f: e8 44 fd ff ff callq 600008b8 <print(char const*)>
60000b74: bf 09 00 00 00 mov $0x9,%edi
60000b79: e8 55 f8 ff ff callq 600003d3 <write(unsigned char)>
60000b7e: 48 83 45 e8 01 addq $0x1,-0x18(%rbp)
60000b83: eb a1 jmp 60000b26 <main+0x160>
60000b85: bf 0a 00 00 00 mov $0xa,%edi
60000b8a: e8 44 f8 ff ff callq 600003d3 <write(unsigned char)>
60000b8f: b8 00 00 00 00 mov $0x0,%eax
60000b94: c9 leaveq
60000b95: c3 retq
Disassembly of section .text._Z7syscallmmmm:
0000000060000b96 <syscall(unsigned long, unsigned long, unsigned long, unsigned long)>:
60000b96: 55 push %rbp
60000b97: 48 89 e5 mov %rsp,%rbp
60000b9a: 53 push %rbx
60000b9b: 48 83 ec 20 sub $0x20,%rsp
60000b9f: 48 89 7d f0 mov %rdi,-0x10(%rbp)
60000ba3: 48 89 75 e8 mov %rsi,-0x18(%rbp)
60000ba7: 48 89 55 e0 mov %rdx,-0x20(%rbp)
60000bab: 48 89 4d d8 mov %rcx,-0x28(%rbp)
60000baf: 48 8b 45 f0 mov -0x10(%rbp),%rax
60000bb3: 48 8b 5d e8 mov -0x18(%rbp),%rbx
60000bb7: 48 8b 4d e0 mov -0x20(%rbp),%rcx
60000bbb: 48 8b 55 d8 mov -0x28(%rbp),%rdx
60000bbf: cd 80 int $0x80
60000bc1: 90 nop
60000bc2: 48 83 c4 20 add $0x20,%rsp
60000bc6: 5b pop %rbx
60000bc7: 5d pop %rbp
60000bc8: c3 retq
| 55.188776 | 142 | 0.505038 |
53d1e73632e3ea003d17579166612d10643683db | 597 | asm | Assembly | oeis/305/A305877.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/305/A305877.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/305/A305877.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A305877: Numbers in base 3 reversed.
; Submitted by Jamie Morken(s3)
; 0,1,2,1,11,21,2,12,22,1,101,201,11,111,211,21,121,221,2,102,202,12,112,212,22,122,222,1,1001,2001,101,1101,2101,201,1201,2201,11,1011,2011,111,1111,2111,211,1211,2211,21,1021,2021,121,1121,2121,221,1221,2221,2,1002,2002,102,1102,2102,202,1202,2202,12,1012,2012,112,1112,2112,212,1212,2212,22,1022,2022,122,1122,2122,222,1222,2222,1,10001,20001,1001,11001,21001,2001,12001,22001,101,10101,20101,1101,11101,21101,2101,12101,22101,201
lpb $0
mov $2,$0
div $0,3
mul $1,10
add $2,$0
mod $2,4
add $1,$2
lpe
mov $0,$1
| 42.642857 | 433 | 0.716918 |
fb1d6ace98d1f65696bb4cdbbd0986e436d2d224 | 5,007 | asm | Assembly | Transynther/x86/_processed/NONE/_st_un_/i9-9900K_12_0xa0.log_21829_646.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_st_un_/i9-9900K_12_0xa0.log_21829_646.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_st_un_/i9-9900K_12_0xa0.log_21829_646.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r8
push %rbx
push %rdi
push %rdx
lea addresses_UC_ht+0x3466, %r8
nop
nop
xor $6725, %rdi
movw $0x6162, (%r8)
nop
nop
nop
nop
nop
inc %r8
lea addresses_UC_ht+0x14ca6, %r13
nop
nop
nop
nop
nop
add %rdi, %rdi
movw $0x6162, (%r13)
add $628, %rdx
lea addresses_WT_ht+0x1a46, %r14
nop
cmp %r12, %r12
mov (%r14), %rdi
and %r8, %r8
lea addresses_WC_ht+0x15e46, %r14
add %rbx, %rbx
vmovups (%r14), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %r13
cmp $24397, %r12
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rax
push %rbp
push %rdx
// Store
lea addresses_US+0x4e46, %rax
nop
nop
inc %r8
movl $0x51525354, (%rax)
nop
sub %r9, %r9
// Faulty Load
lea addresses_WC+0x15e46, %rbp
nop
nop
nop
nop
and %rdx, %rdx
mov (%rbp), %r8d
lea oracles, %rbp
and $0xff, %r8
shlq $12, %r8
mov (%rbp,%r8,1), %r8
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_US', 'AVXalign': True, 'size': 4}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'54': 21827, '5f': 2}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 47.685714 | 2,999 | 0.655283 |
5c876f6c22521791c0aa726355b07485a610b208 | 2,393 | asm | Assembly | Programs/src/config.asm | royprocell/GoldOS16 | ebce72ff9fcfad474bb67d8c117046ce260927ec | [
"BSD-3-Clause"
] | 4 | 2016-02-28T20:22:24.000Z | 2016-07-08T07:28:27.000Z | Programs/src/config.asm | royprocell/GoldOS16 | ebce72ff9fcfad474bb67d8c117046ce260927ec | [
"BSD-3-Clause"
] | null | null | null | Programs/src/config.asm | royprocell/GoldOS16 | ebce72ff9fcfad474bb67d8c117046ce260927ec | [
"BSD-3-Clause"
] | null | null | null | ;Roy Procell
;2/18/2016
;GoldOS config.bin
org 40960
main:
;sets video mode
mov di, 0
mov al, 3
int 0F1h
;clears screen
mov bl, 0x70
mov di, 0xA
int 0F1h
;draws header at the top
mov bl, 0x83
mov dh, 0
mov di, 0Ch
int 0F1h
mov dh, 1
int 0F1h
mov di, 1
mov ax, 2000h
mov bx, list
mov cx, welcome
mov dx, 0
mov si, 0
int 0F8h
;resets cursor to bar and hides it
mov di, 7
int 0F1h
mov di, 5
int 0F1h
choose_option:
cmp ah, 0xFF
je exit
cmp al, 1
je setting_blinking
jmp main
setting_blinking:
mov word [selected_title], title1
call screen_setup
mov si, msg11
mov di, 0
int 0F4h
mov di, 3
int 0F1h
inc dh
mov di, 2
int 0F1h
mov si, msg12
mov di, 0
int 0F4h
mov di, 3
int 0F1h
inc dh
inc dh
mov di, 2
int 0F1h
mov si, msg13
mov di, 0
int 0F4h
mov di, 3
int 0F1h
inc dh
mov di, 2
int 0F1h
mov si, msg14
mov di, 0
int 0F4h
mov di, 3
int 0F1h
add dh, 14
mov di, 2
int 0F1h
mov si, back_msg_1
mov di, 0
int 0F4h
mov di, 0
int 0F3h
cmp al, '0'
je .off
cmp al, '1'
je .on
jmp main
.on:
mov di, 0
int 0F9h
mov si, ax
mov byte [ds:si], 1
jmp main
.off:
mov di, 0
int 0F9h
mov si, ax
mov byte [ds:si], 0
jmp main
screen_setup:
;draws header at the top
mov bl, 0x83
mov dh, 0
mov di, 0Ch
int 0F1h
mov dh, 1
int 0F1h
;moves the cursor to 0,0 and writes the welcome and instruction strings
mov dx, 0
mov di, 02h
int 0F1h
mov ax, 2000h
mov ds, ax
mov si, welcome
mov di, 0
int 0F4h
mov bl, 0x83
mov dh, 3
mov dl, 2
mov cx, 76
mov ax, 21
mov di, 0xE
int 0F1h
mov bl, 0xF0
mov dh, 4
mov dl, 3
mov cx, 74
mov ax, 19
mov di, 0xE
int 0F1h
mov dh, 3
mov dl, 2
mov di, 2
int 0F1h
mov si, [selected_title]
mov di, 0
int 0F4h
mov dh, 4
mov dl, 3
mov di, 2
int 0F1h
ret
exit:
retf
vars:
welcome db 'GoldOS Settings 1.1', 0
title1 db 'Blinking text', 0
list db 'Blinking text', 0
msg11 db 'If you are running GoldOS on an older computer, it is likely that the', 0
msg12 db 'colors are reduced and most text is blinking.', 0
msg13 db 'If you have noticed this problem, press 1 to stop the blinking text.', 0
msg14 db 'If you wish to turn off this setting, press 0.', 0
back_msg db 'Press any key to go back.', 0
back_msg_1 db 'Press any key except 0 or 1 to go back without changing settings.', 0
selected_title dw 0 | 12.398964 | 84 | 0.651483 |
b94f06bb6479b68376e37698966e774a19562344 | 1,351 | asm | Assembly | projects/08/FunctionCalls/StaticsTest/Sys.asm | nadavWeisler/Nand2Tetris | 59c2e616c45044c15b99aeb8459d39b59e5e07ba | [
"MIT"
] | null | null | null | projects/08/FunctionCalls/StaticsTest/Sys.asm | nadavWeisler/Nand2Tetris | 59c2e616c45044c15b99aeb8459d39b59e5e07ba | [
"MIT"
] | null | null | null | projects/08/FunctionCalls/StaticsTest/Sys.asm | nadavWeisler/Nand2Tetris | 59c2e616c45044c15b99aeb8459d39b59e5e07ba | [
"MIT"
] | null | null | null | (Sys.init)
@0
D=A
@i
M=D
D=M
@Sys.init.0
D;JEQ
(Sys.init..0)
@SP
A=M
M=0
@SP
D=M
D=D+1
M=D
@i
D=M
D=D-1
M=D
@Sys.init..0
D;JNE
(Sys.init.0)
@6
D=A
@SP
A=M
M=D
@SP
M=M+1
@8
D=A
@SP
A=M
M=D
@SP
M=M+1
@RETURN2
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@SP
D=M
@2
D=D-A
@5
D=D-A
@ARG
M=D
@SP
D=M
@LCL
M=D
@Class1.set
0;JMP
(RETURN2)
@0
D=A
@5
D=D+A
@13
M=D
@SP
M=M-1
A=M
D=M
@13
A=M
M=D
@23
D=A
@SP
A=M
M=D
@SP
M=M+1
@15
D=A
@SP
A=M
M=D
@SP
M=M+1
@RETURN3
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@SP
D=M
@2
D=D-A
@5
D=D-A
@ARG
M=D
@SP
D=M
@LCL
M=D
@Class2.set
0;JMP
(RETURN3)
@0
D=A
@5
D=D+A
@13
M=D
@SP
M=M-1
A=M
D=M
@13
A=M
M=D
@RETURN4
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@SP
D=M
@0
D=D-A
@5
D=D-A
@ARG
M=D
@SP
D=M
@LCL
M=D
@Class1.get
0;JMP
(RETURN4)
@RETURN5
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@SP
D=M
@0
D=D-A
@5
D=D-A
@ARG
M=D
@SP
D=M
@LCL
M=D
@Class2.get
0;JMP
(RETURN5)
(WHILE)
@WHILE
0;JMP
| 4.807829 | 13 | 0.54034 |
568fe1a30e0691bbb131dcdebfe046afe1f6da77 | 429 | asm | Assembly | oeis/272/A272525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/272/A272525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/272/A272525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A272525: Convolution of nonzero repunits (A002275) with themselves.
; 1,22,343,4664,58985,713306,8367627,96021948,1083676269,12071330590,133058984911,1454046639232,15775034293553,170096021947874,1824417009602195,19478737997256516,207133058984910837,2194787379972565158,23182441700960219479,244170096021947873800
add $0,1
mov $1,$0
seq $1,338226 ; a(n) = Sum_{i=0..n-1} i*10^i - Sum_{i=0..n-1} (n-1-i)*10^i.
mov $0,$1
div $0,9
| 47.666667 | 243 | 0.783217 |
fdf910ceb14e6abe5e198ee20f2fe2660a0b8490 | 841 | asm | Assembly | programs/oeis/056/A056553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/056/A056553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/056/A056553.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A056553: Smallest 4th-power divisible by n divided by largest 4th-power which divides n.
; 1,16,81,16,625,1296,2401,16,81,10000,14641,1296,28561,38416,50625,1,83521,1296,130321,10000,194481,234256,279841,1296,625,456976,81,38416,707281,810000,923521,16,1185921,1336336,1500625,1296,1874161,2085136,2313441,10000,2825761,3111696,3418801,234256,50625,4477456,4879681,81,2401,10000,6765201,456976,7890481,1296,9150625,38416,10556001,11316496,12117361,810000,13845841,14776336,194481,16,17850625,18974736,20151121,1336336,22667121,24010000,25411681,1296,28398241,29986576,50625,2085136,35153041,37015056,38950081,625,1,45212176,47458321,3111696,52200625,54700816,57289761,234256,62742241,810000,68574961,4477456,74805201,78074896,81450625,1296,88529281,38416,1185921,10000
seq $0,56554 ; Powerfree kernel of 4th-powerfree part of n.
pow $0,4
| 140.166667 | 679 | 0.832342 |
6d67290b26b2d97b0e440502affb26b483f6474c | 456 | asm | Assembly | talk1.asm | kanpapa/cosmac | 044ca0439a636515e46c4138a9a16958db8a90d1 | [
"MIT"
] | 2 | 2020-07-18T11:38:57.000Z | 2022-01-11T17:21:32.000Z | talk1.asm | kanpapa/cosmac | 044ca0439a636515e46c4138a9a16958db8a90d1 | [
"MIT"
] | null | null | null | talk1.asm | kanpapa/cosmac | 044ca0439a636515e46c4138a9a16958db8a90d1 | [
"MIT"
] | null | null | null | *
* AquesTalkPico Sample program 1 for COSMAC
* SB-Assembler
*
.CR 1802
.OR $0000
*
START LDI #IOR ;#IOR -> D
PLO 5 ;D -> R(5).0
SEX 5 ;5 -> X
*
LDI #0 ;0 -> D
STR 5 ;D -> M(R(5))
OUT 4 ;M(R(5)) -> BUS; R(5)+1 -> R(5)
DEC 5 ;R(5)-1 -> R(N)
*
LOOP1 LDI #1 ;1 -> D
ADD ;M(R(X))+D -> DF,D
STR 5 ;D -> M(R(5))
BN4 LOOP1 ;IF EF4=0 MAIN
OUT 4 ;M(R(5)) -> BUS; R(5)+1 -> R(5)
DEC 5 ;R(5)--
BR LOOP1 ;Branch to LOOP1
*
IOR .DB 0 ;IO Register
.EN
| 16.285714 | 43 | 0.508772 |
e0a8f8b8db09e95c59b1f577ce90d0c8fadc3977 | 344 | asm | Assembly | programs/oeis/266/A266224.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/266/A266224.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/266/A266224.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A266224: Least x such that prime(n)*x+x+1 is a prime, or -1 if no such x exists.
; 2,1,1,2,1,2,1,2,3,1,3,5,1,2,2,2,1,5,2,1,2,3,4,2,2,1,3,1,3,2,2,3,1,2,1,3,2,5,2,2,1,3,1,2,1,2,5,2,1,2,4,1,3,3,4,5,1,5,2,1,2,3,2,1,5,10,3,2,1,2,2,5,9,3,2,2,3,2,4,2,1,5,1,3,2,4,4
seq $0,40 ; The prime numbers.
seq $0,34693 ; Smallest k such that k*n+1 is prime.
| 57.333333 | 176 | 0.584302 |
a89ae8189fd1ff93dff5707302b238a2d6034423 | 8,167 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_997.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_997.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_997.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 %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xadce, %rbx
xor %rax, %rax
mov (%rbx), %r12d
nop
nop
nop
nop
sub %r14, %r14
lea addresses_WT_ht+0x1ebce, %rdx
clflush (%rdx)
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %r14
movq %r14, (%rdx)
nop
inc %rax
lea addresses_WC_ht+0x9776, %rdx
nop
and $41144, %r14
vmovups (%rdx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rax
nop
nop
nop
nop
nop
xor $20054, %r14
lea addresses_D_ht+0x15dce, %r14
nop
nop
add $39242, %r10
movl $0x61626364, (%r14)
nop
nop
nop
nop
nop
xor %rdx, %rdx
lea addresses_WT_ht+0x17de, %rax
nop
nop
nop
cmp %r10, %r10
mov (%rax), %rbp
nop
nop
nop
nop
nop
add $9091, %rax
lea addresses_UC_ht+0x9ce, %rbp
and %rbx, %rbx
mov (%rbp), %edx
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0x9eda, %rsi
lea addresses_WT_ht+0x109be, %rdi
clflush (%rsi)
nop
xor %rbx, %rbx
mov $33, %rcx
rep movsq
nop
nop
add $52226, %r10
lea addresses_WT_ht+0xb89d, %rsi
nop
nop
nop
nop
nop
and %rbx, %rbx
movb (%rsi), %dl
nop
cmp $64750, %rbp
lea addresses_D_ht+0x151ce, %rsi
lea addresses_A_ht+0xf1ce, %rdi
clflush (%rsi)
nop
nop
xor $62791, %r10
mov $23, %rcx
rep movsw
nop
nop
nop
nop
and %r14, %r14
lea addresses_WC_ht+0x17a4e, %rbx
nop
nop
inc %r14
mov (%rbx), %ecx
nop
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0xd1ce, %r14
clflush (%r14)
nop
nop
nop
nop
and $18534, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
movups %xmm4, (%r14)
nop
nop
nop
and %r12, %r12
lea addresses_A_ht+0x1d4fa, %rbp
nop
nop
nop
nop
nop
dec %r12
mov (%rbp), %rdi
nop
sub $56540, %r14
lea addresses_WT_ht+0x5a4e, %rsi
nop
nop
nop
nop
sub %rax, %rax
mov (%rsi), %r14d
nop
nop
nop
and $48565, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %rbp
push %rbx
push %rcx
// Store
lea addresses_A+0x199ce, %r11
nop
and %r12, %r12
movl $0x51525354, (%r11)
nop
cmp $5412, %r11
// Load
lea addresses_US+0x1b04e, %rbx
clflush (%rbx)
nop
xor %r13, %r13
mov (%rbx), %rcx
inc %r13
// Store
lea addresses_WT+0x8a07, %rbx
nop
nop
nop
nop
and $46296, %r12
mov $0x5152535455565758, %r14
movq %r14, (%rbx)
nop
nop
xor %rbp, %rbp
// Store
lea addresses_normal+0x1adb6, %r12
nop
nop
nop
nop
cmp $57296, %r13
movl $0x51525354, (%r12)
cmp $12208, %r13
// Faulty Load
lea addresses_D+0x191ce, %r14
nop
nop
nop
nop
cmp %r13, %r13
mov (%r14), %rbp
lea oracles, %rcx
and $0xff, %rbp
shlq $12, %rbp
mov (%rcx,%rbp,1), %rbp
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A', 'congruent': 11}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_US', 'congruent': 7}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 1}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 10}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 6}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 9}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 10}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 31.291188 | 2,999 | 0.651892 |
2a2791031ba9b40fd96b505541d18f5fadb63fe7 | 347 | asm | Assembly | msx/apps/libraries/msxdos/msxdos_set_time.asm | zoggins/yellow-msx-series-for-rc2014 | dbc95fa1480bc7bc541fd985fb4a67aab6c8b0fd | [
"MIT"
] | 19 | 2021-02-20T11:48:37.000Z | 2022-03-14T21:02:14.000Z | msx/apps/libraries/msxdos/msxdos_set_time.asm | zoggins/yellow-msx-series-for-rc2014 | dbc95fa1480bc7bc541fd985fb4a67aab6c8b0fd | [
"MIT"
] | 3 | 2021-06-11T06:07:16.000Z | 2021-11-14T07:43:11.000Z | msx/apps/libraries/msxdos/msxdos_set_time.asm | zoggins/yellow-msx-series-for-rc2014 | dbc95fa1480bc7bc541fd985fb4a67aab6c8b0fd | [
"MIT"
] | 2 | 2021-05-03T19:09:36.000Z | 2021-11-13T19:16:52.000Z | include "msxdos.inc"
; extern uint8_t msxdosSetTime(uint8_t hour, uint8_t minutes, uint8_t seconds, uint8_t centiseconds);
PUBLIC _msxdosSetTime
_msxdosSetTime:
PUSH IX
LD IX, 0
ADD IX, SP
LD H, (IX+4) ; HOUR
LD L, (IX+5) ; MINUTES
LD D, (IX+6) ; SECONDS
LD E, (IX+7) ; CENTI-SECONDS
ld c, $2D
CALL BDOS
LD L, A
POP IX
RET
| 15.086957 | 101 | 0.665706 |
37cf244e841f5ceb0a598027230cd5d2084a2914 | 378 | asm | Assembly | oeis/125/A125586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/125/A125586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/125/A125586.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A125586: 2^(2n-1) - (n+2)*3^(n-2).
; Submitted by Jon Maiga
; 1,4,17,74,323,1400,6005,25478,107015,445556,1841273,7561922,30897227,125714672,509767421,2061390206,8317305359,33498803948,134727010049,541232563130,2172291241811,8712410196584,34922863258757,139921580805494,560408087592983
mov $3,$0
seq $0,86443 ; Expansion of x^2/((1-4x)(1-3x)^2).
mov $2,4
pow $2,$3
add $0,$2
| 37.8 | 225 | 0.748677 |
54ccf8c67451034a191e7a78263596fd73286f6c | 640 | asm | Assembly | oeis/083/A083295.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/083/A083295.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/083/A083295.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A083295: a(n) = (4*2^n + (-8)^n)/5.
; Submitted by Jamie Morken(s4.)
; 1,0,16,-96,832,-6528,52480,-419328,3355648,-26843136,214749184,-1717985280,13743898624,-109951156224,879609315328,-7036874391552,56294995394560,-450359962632192,3602879702106112,-28823037614751744,230584300922208256,-1844674407369277440,14757395258970996736,-118059162071734419456,944473296573942464512,-7555786372591405498368,60446290980731512422400,-483570327845851562508288,3868562622766813573808128,-30948500982134506442981376,247588007857076055838818304,-1980704062856608438120611840
mov $1,-8
pow $1,$0
add $0,2
mov $2,2
pow $2,$0
add $1,$2
mov $0,$1
div $0,5
| 49.230769 | 490 | 0.814063 |
827d74f2ae977117c4ec640c17089f9084eb94eb | 5,690 | asm | Assembly | Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca_notsx.log_21829_1622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca_notsx.log_21829_1622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca_notsx.log_21829_1622.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x103b1, %r9
and $11327, %r15
movb $0x61, (%r9)
and %r8, %r8
lea addresses_A_ht+0x2db1, %rsi
lea addresses_WC_ht+0xde31, %rdi
nop
nop
nop
nop
sub $2109, %r12
mov $47, %rcx
rep movsb
nop
nop
nop
nop
cmp %r9, %r9
lea addresses_UC_ht+0x167b1, %r8
sub $5427, %rcx
movl $0x61626364, (%r8)
nop
sub %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_PSE+0x81b1, %r15
lfence
movb $0x51, (%r15)
nop
nop
nop
nop
sub %r10, %r10
// REPMOV
lea addresses_US+0x6df1, %rsi
lea addresses_D+0x2cb1, %rdi
nop
nop
nop
nop
nop
xor $18649, %rbx
mov $81, %rcx
rep movsb
nop
nop
nop
nop
xor $2146, %r10
// Load
lea addresses_A+0x85b1, %rbx
nop
nop
sub $29038, %r11
mov (%rbx), %rcx
nop
nop
nop
nop
sub %rcx, %rcx
// Store
lea addresses_UC+0x9731, %r11
nop
nop
nop
nop
and %r10, %r10
movw $0x5152, (%r11)
sub %rdx, %rdx
// Faulty Load
lea addresses_US+0x10db1, %r15
nop
sub %r10, %r10
movups (%r15), %xmm1
vpextrq $0, %xmm1, %rdi
lea oracles, %r10
and $0xff, %rdi
shlq $12, %rdi
mov (%r10,%rdi,1), %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_US'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'67': 32, '00': 14653, '60': 588, 'f0': 1, '46': 33, '18': 1, 'd0': 1, '45': 311, '28': 6209}
46 00 00 00 00 00 00 00 60 00 45 00 46 00 28 00 28 00 00 00 00 28 28 00 28 00 60 00 00 00 28 00 00 28 00 28 00 00 00 00 00 00 00 00 00 00 00 00 28 28 28 00 00 28 00 28 00 00 00 00 00 00 28 00 00 00 00 28 00 00 00 00 00 00 00 00 00 28 00 00 00 00 28 28 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 28 00 00 00 00 00 28 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 28 60 60 28 28 00 28 28 00 00 00 00 28 00 28 00 00 00 28 28 28 28 00 00 00 28 00 00 28 28 00 00 28 28 28 28 28 45 00 28 67 00 00 28 00 00 00 00 00 00 28 00 00 00 28 60 28 00 00 00 28 28 28 28 28 28 00 00 00 28 00 28 00 28 28 00 28 00 00 28 00 00 00 00 00 00 00 28 00 28 00 00 00 00 45 00 00 00 28 00 28 28 28 00 45 67 00 28 00 28 00 28 28 00 28 00 00 00 00 28 00 00 60 00 00 00 00 28 00 00 00 28 00 00 00 28 28 28 28 28 00 00 00 00 00 28 00 00 60 00 00 00 28 28 28 28 00 28 00 00 28 00 00 00 00 00 28 00 00 00 00 00 00 28 00 00 28 60 28 00 00 28 00 28 00 28 00 00 00 00 00 00 00 45 00 00 00 00 00 28 28 00 00 28 00 28 28 00 00 28 00 28 00 28 00 00 60 28 00 28 00 00 00 00 28 28 00 28 00 28 00 00 00 00 28 00 00 28 00 00 00 28 00 00 00 00 60 00 00 28 00 60 00 28 00 00 00 00 28 00 28 00 00 28 00 28 28 00 00 28 00 28 00 00 00 28 28 28 00 00 28 00 28 28 00 00 00 28 28 28 00 00 28 00 00 00 28 28 28 28 00 00 00 28 28 00 28 00 00 00 28 28 28 28 28 00 28 00 28 28 00 00 28 00 28 00 00 28 00 00 00 00 00 00 00 00 28 00 00 00 00 28 00 00 00 28 00 00 00 00 00 00 28 28 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 28 00 28 28 00 00 60 00 00 00 00 00 00 00 00 28 00 28 00 00 00 00 00 00 00 00 00 60 00 00 00 00 00 28 28 00 00 60 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 28 00 00 00 45 60 00 00 00 28 00 00 60 00 00 00 28 00 00 28 28 00 00 28 28 00 28 00 00 00 00 00 60 00 00 00 28 00 28 00 00 00 00 00 00 28 60 00 00 28 00 00 00 00 28 00 00 00 00 00 00 00 00 28 00 28 00 45 28 28 00 00 28 00 28 00 00 00 00 00 00 00 00 00 00 28 00 00 28 28 28 00 60 28 00 00 00 00 00 28 00 00 28 00 28 00 00 00 28 00 28 00 00 00 00 00 28 28 00 00 00 00 00 28 28 28 00 00 67 00 28 28 00 28 00 00 00 28 00 00 28 00 28 00 00 00 28 00 00 00 00 00 28 00 00 00 00 00 28 00 00 00 00 00 28 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 45 28 28 28 00 00 00 67 60 00 00 00 00 00 28 00 28 00 00 28 28 00 00 00 28 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 28 00 00 00 00 00 00 28 00 00 00 28 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 28 00 00 00 28 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 28 28 28 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 28 00 28 28 00 00 00 28 00 00 00 00 28 00 00 00 00 00 28 00 00 45 28 00 28 28 28 28 28 00 60 28 00 28 45 00 00 00 00 28 00 28 28 00 28 00 00 28 28 28 00 28 28 00 28 00 28 00 00 60 00 00 00 00 00 00 28 60 00 00 00 00 00 00 28 00
*/
| 40.35461 | 2,999 | 0.650967 |
fd2e68a1cca36a50c0251e2081544bc5dc99ecd8 | 778 | asm | Assembly | tools/reboot.asm | ssbostan/zagros | 7ac9959b07d4e5459cdfc9bd34b9ef062c4b9050 | [
"MIT"
] | 21 | 2020-03-28T09:40:49.000Z | 2022-01-28T17:26:01.000Z | tools/reboot.asm | ssbostan/zagros | 7ac9959b07d4e5459cdfc9bd34b9ef062c4b9050 | [
"MIT"
] | null | null | null | tools/reboot.asm | ssbostan/zagros | 7ac9959b07d4e5459cdfc9bd34b9ef062c4b9050 | [
"MIT"
] | 1 | 2019-12-21T14:36:27.000Z | 2019-12-21T14:36:27.000Z |
; ======================= ZagrOS =======================
; Zagros Open Source Operating System
; Saeid Bostandoust (ssbostan@linuxmail.org)
; Bostandoust.IR
; ======================= ZagrOS =======================
; ==================== tools_reboot ====================
tools_reboot:
push ax
push si
call endl
mov si, offset REBOOT_WELCOME
call putstr
call endl
mov si, offset REBOOT_PROMPT
call putstr
call getchr
cmp al, 79h
je tools_reboot_rsys
call endl
pop si
pop ax
ret
tools_reboot_rsys:
call reboot
ret
REBOOT_WELCOME db "reboot v.0.0.2 (26/10/2012).", 00h
REBOOT_PROMPT db " Are you sure? (y/n): ", 00h
; ==================== tools_reboot ====================
| 18.52381 | 58 | 0.488432 |
80fc202a47ae89ab0738ca1923fa420af735cabd | 4,554 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2522.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2522.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2522.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 %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1e524, %r15
xor $617, %rdi
movw $0x6162, (%r15)
nop
nop
nop
and $10783, %rdi
lea addresses_WT_ht+0x382a, %rbp
nop
nop
nop
and $57908, %r9
movb (%rbp), %r11b
nop
nop
sub $59185, %rdi
lea addresses_A_ht+0x11c18, %rsi
lea addresses_A_ht+0xdc60, %rdi
and $35147, %rbx
mov $35, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rax
push %rbp
// Faulty Load
lea addresses_D+0x174a0, %rax
nop
nop
sub %rbp, %rbp
mov (%rax), %r8d
lea oracles, %r15
and $0xff, %r8
shlq $12, %r8
mov (%r15,%r8,1), %r8
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 52.953488 | 2,999 | 0.660079 |
4cd695f88d0590d119d2c4b3cf8fb18cdbf5ddae | 854 | asm | Assembly | dist/osp.asm | pedroxian/jeriko-source | a166713b788852e405bb4ab4f79bc16381382f4c | [
"BSD-3-Clause"
] | null | null | null | dist/osp.asm | pedroxian/jeriko-source | a166713b788852e405bb4ab4f79bc16381382f4c | [
"BSD-3-Clause"
] | null | null | null | dist/osp.asm | pedroxian/jeriko-source | a166713b788852e405bb4ab4f79bc16381382f4c | [
"BSD-3-Clause"
] | null | null | null | ;nasm 2.10.09
section .data
hello: db 'Hello Dcoder!',10 ; 'Hello Dcoder!' plus a linefeed character
helloLen: equ $-hello ; Length of the 'Hello Dcoder!' string
section .text
global _start
_start:
mov eax,4 ; The system call for write (sys_write)
mov ebx,1 ; File descriptor 1 - standard output
mov ecx,hello ; Put the offset of hello in ecx
mov edx,helloLen ; helloLen is a constant, so we don't need to say
; mov edx,[helloLen] to get it's actual value
int 80h ; Call the kernel
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
int 80h;
mode.72 fapst;raiser hacking;hacker
rate;com portself;...rot;apper
kernel;.port.5
sys_write execute
root.masterclass.create hackdude.com
online;cage port;6583
triest.py;raw | 25.878788 | 73 | 0.67096 |
a71780e063c9c07f2d65797b4ce0c16bbd984235 | 1,093 | asm | Assembly | programs/oeis/008/A008722.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/008/A008722.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008722.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A008722: Molien series for 3-dimensional group [2,9] = *229.
; 1,0,2,0,3,0,4,0,5,1,6,2,7,3,8,4,9,5,11,6,13,7,15,8,17,9,19,11,21,13,23,15,25,17,27,19,30,21,33,23,36,25,39,27,42,30,45,33,48,36,51,39,54,42,58,45,62,48,66,51,70,54,74,58,78,62,82,66,86,70,90,74,95,78,100,82,105,86,110,90,115,95,120,100,125,105,130,110,135,115,141,120,147,125,153,130,159,135,165,141,171,147,177,153,183,159,189,165,196,171,203,177,210,183,217,189,224,196,231,203,238,210,245,217,252,224,260,231,268,238,276,245,284,252,292,260,300,268,308,276,316,284,324,292,333,300,342,308,351,316,360,324,369,333,378,342,387,351,396,360,405,369,415,378,425,387,435,396,445,405,455,415,465,425,475,435,485,445,495,455,506,465,517,475,528,485,539,495,550,506,561,517,572,528,583,539,594,550,606,561,618,572,630,583,642,594,654,606,666,618,678,630,690,642,702,654,715,666,728,678,741,690,754,702,767,715,780,728,793,741,806,754,819,767,833,780,847,793,861,806,875,819,889,833,903,847,917,861,931,875
add $0,1
mul $0,2
add $0,4
mov $2,2
lpb $0
sub $0,1
add $1,$2
sub $1,$0
trn $1,$0
add $0,1
trn $0,4
add $2,1
lpe
| 64.294118 | 901 | 0.691674 |
c35491b58034dbfdf74af5d7f46c91995e149179 | 639 | asm | Assembly | oeis/081/A081911.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/081/A081911.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/081/A081911.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A081911: a(n) = 5^n*(n^2 - n + 50)/50.
; Submitted by Jamie Morken(s1.)
; 1,5,26,140,775,4375,25000,143750,828125,4765625,27343750,156250000,888671875,5029296875,28320312500,158691406250,885009765625,4913330078125,27160644531250,149536132812500,820159912109375,4482269287109375,24414062500000000,132560729980468750,717639923095703125,3874301910400390625,20861625671386718750,112056732177734375000,600516796112060546875,3211200237274169921875,17136335372924804687500,91269612312316894531250,485219061374664306640625,2575106918811798095703125,13643875718116760253906250
mov $1,5
pow $1,$0
bin $0,2
add $0,25
mul $1,$0
div $1,25
mov $0,$1
| 53.25 | 495 | 0.841941 |
43ed02e7db41ad69c65331b129e26027b4fb264e | 364 | asm | Assembly | oeis/021/A021858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021858: Decimal expansion of 1/854.
; Submitted by Jamie Morken(m2)
; 0,0,1,1,7,0,9,6,0,1,8,7,3,5,3,6,2,9,9,7,6,5,8,0,7,9,6,2,5,2,9,2,7,4,0,0,4,6,8,3,8,4,0,7,4,9,4,1,4,5,1,9,9,0,6,3,2,3,1,8,5,0,1,1,7,0,9,6,0,1,8,7,3,5,3,6,2,9,9,7,6,5,8,0,7,9,6,2,5,2,9,2,7,4,0,0,4,6,8
seq $0,83811 ; Numbers n such that 2n+1 is the digit reversal of n+1.
div $0,3416
mod $0,10
| 45.5 | 199 | 0.593407 |
96686d3cdef65571c4ccff6d89fdfc34a1ae6e3d | 402 | asm | Assembly | libsrc/games/sam/bit_open_di.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/games/sam/bit_open_di.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/games/sam/bit_open_di.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; $Id: bit_open_di.asm,v 1.1 2003/02/04 09:10:18 stefano Exp $
;
; ZX Spectrum 1 bit sound functions
;
; Open sound and disable interrupts for exact timing
;
; Stefano Bodrato - 28/9/2001
;
XLIB bit_open_di
LIB bit_open
XREF snd_tick
.bit_open_di
di
jp bit_open
; ld a,(23624)
; rrca
; rrca
; rrca
; or 8
; ld (snd_tick),a
; ret
| 16.08 | 62 | 0.579602 |
f054d94b313ce5d84151ab536ae89ff37be33efa | 15,017 | asm | Assembly | joytester.asm | maziac/zx_joystick_tester | 457afe508852c4ad09a98316f4525e492a23463c | [
"MIT"
] | 1 | 2020-06-10T09:58:57.000Z | 2020-06-10T09:58:57.000Z | joytester.asm | maziac/zx_joystick_tester | 457afe508852c4ad09a98316f4525e492a23463c | [
"MIT"
] | null | null | null | joytester.asm | maziac/zx_joystick_tester | 457afe508852c4ad09a98316f4525e492a23463c | [
"MIT"
] | null | null | null | ;===========================================================================
; joytester.asm
;
; This is a program to test the joystick connected to a ZX Spectrum or
; ZX Spectrum Next.
;
; Features:
; - Kempston IF support
; - Sinclair IF support
; - ZX Next 3 Button Joystick support
; - Supports both joysticks.
;
;===========================================================================
;===========================================================================
; Constants.
;===========================================================================
; Color codes
BLACK: equ 0
BLUE: equ 1
RED: equ 2
MAGENTA: equ 3
GREEN: equ 4
CYAN: equ 5
YELLOW: equ 6
WHITE: equ 7
BRIGHT: equ 01000000b ; (Bit 6)
; Color for joystick bit (button or direction) that is not set.
COLOR_BIT_NOT_SET: equ (WHITE<<3)+BRIGHT
; Color for joystick bit (button or direction) that is set.
COLOR_BIT_SET: equ (RED<<3)+BRIGHT
; Interface II joystick ports.
PORT_IF2_JOY_1: equ 0xEFFE ; Keys: 6, 7, 8, 9, 0, Bits: xxxLRDUF
PORT_IF2_JOY_2: equ 0xF7FE ; Keys: 5, 4, 3, 2, 1, Bits: xxxFUDRL
; Kempston joystick ports.
PORT_KEMPSTON_JOY1: equ 0x1f
PORT_KEMPSTON_JOY2: equ 0x37
; Fuller joystick port.
PORT_FULLER: equ 0x7f
; Keyboard port
KEYB_ASDFG: equ 0xFDFE
; ZXNext peripheral.
REG_PERIPHERAL_1: equ 5
; String formatting.
EOS: equ 0xff ; End of string:
AT: equ 0x16 ; ZX Spectrum ASCII Control code: AT, y, x
; Color attribute screen.
SCREEN_COLOR_ATTR: equ 0x5800
; Color screen width.
COLOR_SCREEN_WIDTH: equ 32
; Start addresses for visualization.
COLOR_ATTR_IF2_JOY1: equ SCREEN_COLOR_ATTR+7*COLOR_SCREEN_WIDTH+15
COLOR_ATTR_IF2_JOY2: equ COLOR_ATTR_IF2_JOY1+9
COLOR_ATTR_KEMPSTON_JOY1: equ COLOR_ATTR_IF2_JOY1+COLOR_SCREEN_WIDTH
COLOR_ATTR_KEMPSTON_JOY2: equ COLOR_ATTR_KEMPSTON_JOY1+9
COLOR_ATTR_FULLER: equ COLOR_ATTR_KEMPSTON_JOY1+COLOR_SCREEN_WIDTH
COLOR_ATTR_ZXNEXT_JOY1: equ COLOR_ATTR_FULLER+COLOR_SCREEN_WIDTH
COLOR_ATTR_ZXNEXT_JOY2: equ COLOR_ATTR_ZXNEXT_JOY1+9
; For accessing the ZXNext joystick mode register
TBBLUE_REG_SELECT: equ 243Bh
TBBLUE_REG_ACCESS: equ 253Bh
; Expansion Bus Enable Register
REG_EXPANSION_PORT_ENABLE: equ 80h
REG_INTERNAL_PORT_DECODING_B07: equ 82h
REG_EXPANSION_BUS_DECODING_B07: equ 86h
REG_EXPANSION_BUS_IO_PROPAGATE: equ 8Ah
;===========================================================================
; Macros.
;===========================================================================
; For "out-of-bounds" checks.
MEMGUARD: macro
defs 1 ; WPMEM
endm
; Sets a Next Feature Control Register with A.
; Parameters:
; register = The Next Feature Control Register to set.
NEXTRA: macro register
defb 0xED, 0x92
defb register
endm
; Directly sets a Next Feature Control Register with the given value.
; Parameters:
; register = The Next Feature Control Register to set.
; value = The value for the register.
NEXTREG: macro register value
defb 0xED, 0x91
defb register
defb value
endm
; Reads a Next Feature Control Register .
; Parameters:
; register = The Next Feature Control Register to read.
; Returns:
; A = The value for the register.
READNREG: macro register
push bc
ld bc,TBBLUE_REG_SELECT
ld a,register
out (c),a
ld bc,TBBLUE_REG_ACCESS
in a,(c)
pop bc
endm
; Multiplies D by E and stores the result in DE.
; Does not alter any flags.
; Input: DE
; Output: DE = D*E
MUL_D_E: macro
defb 0xED, 0x30
endm
;===========================================================================
; Start of main program.
;===========================================================================
org 0x7000
LBL_MAIN:
jr MAIN_START
; Use as stack for sna file (at 0x7002)
defw LBL_MAIN
MAIN_START:
di
; Setup stack
ld sp,stack_top
; Load system variable to iy
; Enable interrupt
ei
; Allow printing to bottom lines.
;ld a,0
;ld (VAR_BOTTOM_LINES),a
; Set pointer to user defined graphics
; ld hl,user_defined_graphics
; ld (VAR_UDG),hl
; Clear screen
;call 0D6Bh
; Print text.
ld hl,MAIN_TEXT
call print
; Check for ZX Next
call check_for_z80n
jr nz,main_loop
; Print additional text
ld hl,ZXNEXT_TEXT
call print
; Disable expansion port
READNREG REG_EXPANSION_PORT_ENABLE
or 80h ; Enable expansion port
NEXTRA REG_EXPANSION_PORT_ENABLE
; Enable internal and expansion bus decoding
READNREG REG_EXPANSION_BUS_DECODING_B07
or 11000000b
NEXTRA REG_EXPANSION_BUS_DECODING_B07
READNREG REG_INTERNAL_PORT_DECODING_B07
or 11000000b
NEXTRA REG_INTERNAL_PORT_DECODING_B07
READNREG REG_EXPANSION_BUS_IO_PROPAGATE
or 00000001b
NEXTRA REG_EXPANSION_BUS_IO_PROPAGATE
; The main loop:
; - Check joystick input
; - Visualize it
main_loop:
; Make the loop slower.
halt
; Get joystick value. Interface II, joystick 1
ld bc,PORT_IF2_JOY_1
ld hl,COLOR_ATTR_IF2_JOY1
call visualize_joystick_inport
; Get joystick value. Interface II, joystick 2
ld bc,PORT_IF2_JOY_2
ld hl,COLOR_ATTR_IF2_JOY2
call visualize_joystick_inport
; Get joystick value. Kempston, joystick 0.
ld bc,PORT_KEMPSTON_JOY1
ld hl,COLOR_ATTR_KEMPSTON_JOY1
call visualize_joystick_inport
; Get joystick value. Kempston, joystick 1.
ld bc,PORT_KEMPSTON_JOY2
ld hl,COLOR_ATTR_KEMPSTON_JOY2
call visualize_joystick_inport
; Get joystick value. Fuller.
ld bc,PORT_FULLER
ld hl,COLOR_ATTR_FULLER
call visualize_joystick_inport
; Check for ZX Next
call check_for_z80n
jr nz,main_loop
; Check for keypress to change the joystick mode
ld bc,KEYB_ASDFG
in a,(c)
; Check if value changed
ld hl,prev_keyb
cp (hl)
jr z,no_key_pressed
; Changed, store
ld (hl),a
ld e,a
; Key was pressed
; Read configuration of ZX Next joystick
READNREG REG_PERIPHERAL_1
; Evaluate key
bit 0,e ; "A"
jr nz,key1_not_pressed
; "A" was pressed
add 01000000b
jr nc,j1_no_overflw
; Handle overflow
xor 00001000b
j1_no_overflw:
; Set new value
NEXTRA REG_PERIPHERAL_1
key1_not_pressed:
; Evaluate key
bit 1,e ; "S"
jr nz,key_exp_not_pressed
; "S" was pressed
ld l,a
and 10111111b
add 00010000b
ld h,a
; Restore
res 6,a
bit 6,l
jr z,restore_0
set 6,a
restore_0:
bit 6,h
jr z,j2_no_overflw
; Handle overflow
xor 00000010b
j2_no_overflw:
; Set new value
NEXTRA REG_PERIPHERAL_1
key_exp_not_pressed:
; Evaluate key
bit 4,e ; "G"
jr nz,no_key_pressed
; Key to toggle expansion port was pressed
call toggle_expansion_port
no_key_pressed:
; Read configuration of ZX Next joystick
ld bc,TBBLUE_REG_SELECT
ld a,REG_PERIPHERAL_1
out (c),a
ld bc,TBBLUE_REG_ACCESS
in a,(c)
; Check if value changed
ld hl,prev_zxn_joy_config
cp (hl)
jp z,print_expansion_port
; Changed, store
ld (hl),a
push af
push af
; Print defaults for the kempston joysticks
ld hl,KEMPSTON_JOY1_POS
call print
ld hl,KEMPSTON_NORMAL_JOY_TEXT
call print
ld hl,KEMPSTON_JOY2_POS
call print
ld hl,KEMPSTON_NORMAL_JOY_TEXT
call print
; Print joystick 1
ld hl,JOY1_MODE_TEXT
call print
; Evaluate joystick 1
pop af
and 11001000b ; Mask out all other registers
ld l,a
sra l
rlca
rlca
or l
and 0111b
call print_zxn_joy_config
; Print joystick 2
ld hl,JOY2_MODE_TEXT
call print
; Evaluate joystick 2
pop af
and 00110010b ; Mask out all other registers
ld l,a
sla l
rlca
rlca
rlca
rlca
or l
and 0111b
call print_zxn_joy_config
print_expansion_port:
; Print expansion board configuration
ld hl,EXPANSION_TEXT
call print
; Show the current state
READNREG REG_EXPANSION_PORT_ENABLE
bit 7,a ; Check for expansion port
ld hl,DISABLED_TEXT
jr z,exp_disabled
ld hl,ENABLED_TEXT
exp_disabled:
call print
jp main_loop
; Check for Z80N (ZX Next) CPU, i.e. check if extended opcodes are available.
; Returns: Z is set if it is a Z80N
check_for_z80n:
ld e,2
ld d,e
MUL_D_E
ld a,e
cp 4
ret
; Visualizes the Joystick Input.
; IN: BC = Port to read (Joystick input)
; HL = Pointer to start address in color attributes screen.
visualize_joystick_inport:
in a,(c)
visualize_joystick_a: ; For unit tests
ld b,8 ; 8 bits
visualize_joystick_loop:
rlca ; Rotate left most bit into carry
ld c,COLOR_BIT_NOT_SET
jr c,visualize_joystick_l1
ld c,COLOR_BIT_SET ; Show as pressed if bit is zero
visualize_joystick_l1:
; Set color on screen
ld (hl),c
inc hl
djnz visualize_joystick_loop
ret
; Prints the ZX Next joystick configuration of one joystick.
; A has to contain the config. I.e. only the least 3 bits should be set.
print_zxn_joy_config:
cp 0
jr nz,no_if2_joy2
; It is IF2 joystick 2
ld hl,IF2_TEXT
ld de,JOY2_TEXT
jr zxn_joy_print
no_if2_joy2:
cp 1
jr nz,no_kempston_joy1
; It is Kempston joystick 1
ld hl,KEMPSTON_TEXT
ld de,JOY1_TEXT
jr zxn_joy_print
no_kempston_joy1:
cp 2
jr nz,no_cursor
; It is Cursor joystick
ld hl,CURSOR_TEXT
ld de,JOYSTICK_TEXT
jr zxn_joy_print
no_cursor:
cp 3
jr nz,no_if2_joy1
; It is IF2 joystick 1
ld hl,IF2_TEXT
ld de,JOY1_TEXT
jr zxn_joy_print
no_if2_joy1:
cp 4
jr nz,no_kempston_joy2
; It is Kempston joystick 2
ld hl,KEMPSTON_TEXT
ld de,JOY2_TEXT
jr zxn_joy_print
no_kempston_joy2:
cp 5
jr nz,no_md1
; It is MD (MegaDrive) joystick 1
ld bc,KEMPSTON_JOY1_POS
ld ix,KEMPSTON_MD_JOY_TEXT
ld hl,MD_TEXT
ld de,JOY1_TEXT
jr zxn_joy_print_kempston_md
no_md1:
cp 6
jr nz,no_md2
; It is MD (MegaDrive) joystick 2
ld bc,KEMPSTON_JOY2_POS
ld ix,KEMPSTON_MD_JOY_TEXT
ld hl,MD_TEXT
ld de,JOY2_TEXT
jr zxn_joy_print_kempston_md
no_md2:
ld hl,UNDEFINED_TEXT
call print
ret ; Print nothing
zxn_joy_print_kempston_md:
push ix
push bc
call zxn_joy_print
pop hl ; bc
call print
pop hl ; ix
call print
ret
zxn_joy_print:
push de
call print
pop hl
call print
ret
; Toggle enabling of the expansion port.
toggle_expansion_port:
; Get current value
READNREG REG_EXPANSION_PORT_ENABLE
xor 80h ; Toggle
; Write
NEXTRA REG_EXPANSION_PORT_ENABLE
ret
; Prints a text until an EOS (end of string) is found.
; IN: HL = Points to the start of the text. The text may contains positional
; commands like AT.
print:
; Load character.
ld a,(hl)
cp EOS
ret z ; Return if end found
; Print
rst 10h
; Next
inc hl
jr print
;===========================================================================
; Data.
;===========================================================================
prev_zxn_joy_config: defb 0xFF ; Is an invalid value
prev_keyb: defb 0x80
;===========================================================================
; Constant data.
;===========================================================================
; Texts.
MAIN_TEXT:
defb AT, 0, 0
defb 'Joystick Tester for ZX Spectrum and ZX Next. Version 1.2.'
defb AT, 3, 0
defb 'White=1, Red=0, Black=Not Avail.'
defb AT, 5, 15
defb 'Joy1: Joy2:'
defb AT, 6, 15
defb '76543210 76543210'
defb AT, 7, 0
defb 'Interface II: ???LRDUF ???FUDRL'
defb AT, 8, 0
defb 'Kempston:'
defb AT, 9, 0
defb 'Fuller: F???RLDU'
defb EOS
KEMPSTON_JOY1_POS:
defb AT, 8, 15, EOS
KEMPSTON_JOY2_POS:
defb AT, 8, 24, EOS
KEMPSTON_NORMAL_JOY_TEXT:
defb '???FUDLR'
defb EOS
KEMPSTON_MD_JOY_TEXT:
defb 'SACBUDLR'
defb EOS
ZXNEXT_TEXT:
defb AT, 12, 0
defb 'ZXNEXT Joystick Modes:'
defb AT, 17, 0
defb 'Press a key to change mode:'
defb AT, 18, 0
defb 'A=Change Joystick 1 mode'
defb AT, 19, 0
defb 'S=Change Joystick 2 mode'
defb AT, 20, 0
defb 'G=Toggle expansion port mode'
defb EOS
JOY1_MODE_TEXT:
defb AT, 13, 0
defb 'Joy1: '
defb AT, 13, 6
defb EOS
JOY2_MODE_TEXT:
defb AT, 14, 0
defb 'Joy2: '
defb AT, 14, 6
defb EOS
IF2_TEXT:
defb 'Interface II ', EOS
KEMPSTON_TEXT:
defb 'Kempston ', EOS
CURSOR_TEXT:
defb 'Cursor ', EOS
MD_TEXT:
defb 'MD mapped to Kempston ', EOS
JOY1_TEXT: defb 'JOY1', EOS
JOY2_TEXT: defb 'JOY2', EOS
JOYSTICK_TEXT: defb 'Joystick', EOS
UNDEFINED_TEXT: defb 'Undefined', EOS
EXPANSION_TEXT: defb AT, 15, 0
defb 'Expansion port: ', EOS
ENABLED_TEXT: defb 'Enabled ', EOS
DISABLED_TEXT: defb 'Disabled', EOS
;===========================================================================
; STACK
; Stack: this area is reserved for the stack
STACK_SIZE: equ 100d ; in words
; Reserve stack space
stack_check:
MEMGUARD
stack_bottom:
defs STACK_SIZE*2, 0
stack_top:
;===========================================================================
;===========================================================================
; UNIT TESTS
;===========================================================================
include "unit_tests.inc"
if 01
UT_visualize_joystick_1:
ld hl,COLOR_ATTR_ZXNEXT_JOY1
ld a,10101010b
call visualize_joystick_a
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+1 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+2 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+3 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+4 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+5 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+6 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+7 COLOR_BIT_SET
TC_END
UT_visualize_joystick_2:
ld hl,COLOR_ATTR_ZXNEXT_JOY1
ld a,01010101b
call visualize_joystick_a
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+1 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+2 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+3 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+4 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+5 COLOR_BIT_NOT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+6 COLOR_BIT_SET
TEST_MEMORY_BYTE COLOR_ATTR_ZXNEXT_JOY1+7 COLOR_BIT_NOT_SET
TC_END
UNITTEST_INITIALIZE
; Start of unit test initialization.
ret
endif
| 21.795356 | 77 | 0.634548 |
dca72dd4903b7aca58895d30fdafd16c1b65b3c6 | 1,382 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_20_294.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_20_294.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_20_294.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 %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1e43a, %rsi
lea addresses_WC_ht+0x573a, %rdi
nop
sub $60545, %rax
mov $117, %rcx
rep movsw
nop
nop
xor %rcx, %rcx
lea addresses_WT_ht+0xabfa, %r12
nop
inc %rcx
mov $0x6162636465666768, %rbp
movq %rbp, (%r12)
nop
nop
nop
and $57865, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbp
push %rcx
push %rdi
// Faulty Load
lea addresses_US+0x5bba, %rdi
xor %r10, %r10
movb (%rdi), %cl
lea oracles, %rbp
and $0xff, %rcx
shlq $12, %rcx
mov (%rbp,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'00': 20}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 19.194444 | 147 | 0.654124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.