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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cb07ada930bedfea4d4c123b96225c36a0ff78f6 | 713 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_fma.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_fma.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_fma.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; double fma(double x, double y, double z)
SECTION code_clib
SECTION code_fp_math48
PUBLIC am48_fma
EXTERN am48_dmul, am48_dadd
am48_fma:
; compute x*y+z
;
; enter : AC = double x
; AC' = double y
; stack = double z, return address
;
; exit : AC = double z
;
; success
;
; AC' = x*y+z
; carry reset
;
; fail if overflow
;
; AC' = +-inf
; carry set, errno set
;
; uses : af, bc, de, hl, af', bc', de', hl'
call am48_dmul ; AC'= x * y
ex af,af'
pop af
pop hl
pop de
pop bc
push af
ex af,af'
jp nc, am48_dadd
ret
| 15.170213 | 47 | 0.465638 |
6080cac55fedb9d054cfefd3a1c51cc7a556b0ad | 2,079 | asm | Assembly | VBlank.asm | Kannagi/Super-Kannagi-Sound | d3b078f6501717d67d1d3c5ed2fdb9c89491df0d | [
"MIT"
] | 11 | 2016-10-26T19:32:05.000Z | 2020-11-20T11:11:43.000Z | VBlank.asm | KungFuFurby/Super-Kannagi-Sound | bf6696cc7d0bd7843fb0a036a07dcd3ff39ca75e | [
"MIT"
] | null | null | null | VBlank.asm | KungFuFurby/Super-Kannagi-Sound | bf6696cc7d0bd7843fb0a036a07dcd3ff39ca75e | [
"MIT"
] | 1 | 2018-02-17T10:41:14.000Z | 2018-02-17T10:41:14.000Z |
VBlank:
phd
php
phb
pha
phx
phy
rep #$10 ;16 bit xy
sep #$20 ; 8 bit a
lda RDNMI
lda LKS_VBLANK
cmp #$00
bne +
ply
plx
pla
plb
plp
pld
rti
+:
lda #1
sta LKS_VBLANK+_vblenable
;lda TIMEUP
jsl LKS_DMA_OAM
;VBLANK pour le Mode7
lda LKS_VBLANK
cmp #$01
bne +
jsr VBlankMode7
bra ++
+:
;VBLANK pour le Mode1
cmp #$02
bne +
jsr VBlank0
bra ++
+:
++:
;--------------------
LKS_BG1_update
LKS_BG2_update
LKS_BG3_update
LKS_BG4_update
;--------------------
/*
-:
lda HVBJOY
and #$01
bne -
*/
/*
-:
ldx.w HVBJOY ; MUST do 8 bit read on HVJOY
txa
lsr
bcs -
*/
;SNES_DMAX $00
;SNES_DMAX_BADD $80
-:
lda HVBJOY
and #$01
bne -
jsl LKS_NMI_Joypad
ldy #0
sty LKS_VBLANK+_vbltime
-:
iny
lda HVBJOY
and #$80
bne -
sty LKS_VBLANK+_vbltime
;inc MEM_VBLANK+3
;lda TIMEUP
ply
plx
pla
plb
plp
pld
rti
VBlank0:
LKS_BG1_cpy_BG2
SNES_DMAX $01
SNES_DMAX_BADD $18
stz LKS_DMAT
jsl LKS_DMA_BG3
;---------------------------
jsl Background1Y
jsl Background1X
jsl Background2Y
jsl Background2X
;---------------------------
LKS_DMA_VRAM 8
LKS_DMA_VRAM 9
LKS_DMA_VRAM 10
LKS_DMA_VRAM 11
LKS_DMA_VRAM 12
LKS_DMA_VRAM 13
LKS_DMA_VRAM 14
LKS_DMA_VRAM 15
LKS_DMA_VRAM 0
LKS_DMA_VRAM 1
LKS_DMA_VRAM 2
LKS_DMA_VRAM 3
LKS_DMA_VRAM 4
LKS_DMA_VRAM 5
LKS_DMA_VRAM 6
LKS_DMA_VRAM 7
LKS_DMA_VRAM 16
LKS_DMA_VRAM 17
;---------------------------
jsl LKS_DMA_PAL
;lda $4210
;---------------------------
;---------------------------
rts
.include "VBlankmode7.asm"
.include "LKS/DMA_spd.asm"
| 9.995192 | 48 | 0.463684 |
985162b4bf4af4b9d640b1921462f287da0a90c5 | 8,486 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2355.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_2355.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_2355.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x10b5f, %r8
nop
nop
xor $5765, %rcx
mov $0x6162636465666768, %rax
movq %rax, (%r8)
nop
inc %rcx
lea addresses_WT_ht+0x1075f, %rsi
lea addresses_D_ht+0x157c9, %rdi
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $90, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $46286, %rsi
lea addresses_A_ht+0x873f, %rdi
nop
xor %r12, %r12
movups (%rdi), %xmm4
vpextrq $0, %xmm4, %rax
nop
nop
nop
nop
inc %rdi
lea addresses_normal_ht+0x11f5f, %rdx
nop
nop
nop
nop
inc %rax
vmovups (%rdx), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdi
nop
nop
nop
nop
xor $13150, %rdi
lea addresses_A_ht+0x10b5f, %rax
nop
nop
nop
nop
cmp %r8, %r8
movb $0x61, (%rax)
nop
nop
add %r12, %r12
lea addresses_WT_ht+0x13f5f, %r12
and %rax, %rax
movb $0x61, (%r12)
nop
and $17968, %rsi
lea addresses_WT_ht+0xceff, %rsi
lea addresses_normal_ht+0x305f, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
cmp $46433, %rdx
mov $13, %rcx
rep movsb
nop
nop
nop
dec %rcx
lea addresses_WC_ht+0xb55f, %r8
inc %rdi
movw $0x6162, (%r8)
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0xff5f, %rdx
nop
dec %r8
mov $0x6162636465666768, %r12
movq %r12, %xmm2
vmovups %ymm2, (%rdx)
nop
nop
nop
sub %r8, %r8
lea addresses_WT_ht+0x1d15f, %rdx
nop
nop
nop
nop
nop
sub %rsi, %rsi
movb (%rdx), %r12b
nop
nop
cmp %r12, %r12
lea addresses_UC_ht+0x715f, %rsi
lea addresses_WT_ht+0x21f, %rdi
nop
nop
nop
nop
dec %rax
mov $108, %rcx
rep movsq
nop
nop
and %rax, %rax
lea addresses_normal_ht+0xd75f, %r8
nop
nop
nop
cmp %rcx, %rcx
mov (%r8), %r12d
nop
nop
and %rax, %rax
lea addresses_A_ht+0x45f, %rcx
inc %rdi
movl $0x61626364, (%rcx)
nop
nop
and $44232, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbx
push %rdi
push %rsi
// Store
lea addresses_A+0x1bf5f, %rbx
nop
and %r9, %r9
mov $0x5152535455565758, %r8
movq %r8, (%rbx)
nop
nop
and %rsi, %rsi
// Store
lea addresses_WT+0x102df, %rbx
nop
add %rax, %rax
mov $0x5152535455565758, %r9
movq %r9, (%rbx)
nop
nop
xor %rdi, %rdi
// Load
lea addresses_US+0xf05f, %rbx
nop
cmp $17399, %r11
movups (%rbx), %xmm4
vpextrq $0, %xmm4, %rsi
nop
nop
nop
nop
nop
sub $47381, %r9
// Store
lea addresses_normal+0x1b19f, %r9
nop
and $48034, %rbx
mov $0x5152535455565758, %rsi
movq %rsi, (%r9)
nop
xor $11672, %r11
// Load
lea addresses_PSE+0x1cb5f, %r11
nop
nop
nop
nop
nop
xor $26244, %r9
movntdqa (%r11), %xmm3
vpextrq $0, %xmm3, %rbx
nop
dec %rsi
// Faulty Load
lea addresses_A+0x1bf5f, %rdi
nop
nop
and $41371, %rbx
vmovups (%rdi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %rsi
lea oracles, %rax
and $0xff, %rsi
shlq $12, %rsi
mov (%rax,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': True, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'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
*/
| 32.022642 | 2,999 | 0.653076 |
63a07652dd0f5c3c5cec9716d3ad57fdbda760e9 | 475 | asm | Assembly | programs/oeis/019/A019744.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/019/A019744.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/019/A019744.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A019744: Decimal expansion of e/7.
; 3,8,8,3,2,5,9,7,5,4,9,4,1,4,9,3,1,9,3,3,7,1,8,3,9,2,4,4,7,8,9,5,1,7,8,5,3,9,3,8,9,2,4,4,1,9,5,7,1,3,7,0,8,2,1,3,8,1,3,8,2,3,2,5,3,2,0,1,0,9,4,7,1,9,3,3,6,3,9,4,2,0,8,1,6,2,6,0,2,5,5,0,3,5,9,5,2,0,3,9
add $0,1
mov $3,$0
mul $3,5
lpb $3
sub $2,2
mul $2,$3
add $1,$2
cmp $4,0
mov $5,$3
div $5,3
add $5,$4
div $1,$5
div $2,$5
sub $3,1
cmp $4,0
lpe
mul $2,7
mov $6,10
pow $6,$0
div $2,$6
div $1,$2
mod $1,10
mov $0,$1
| 17.592593 | 201 | 0.507368 |
d8cea1aa42af2e3369c2e2bc661991d0c0f8228a | 1,008 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/z80/asm_flockfile.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/z80/asm_flockfile.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/z80/asm_flockfile.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; ===============================================================
; Jan 2014
; ===============================================================
;
; int flockfile(FILE *file)
;
; Increase lock count on file by one.
;
; ===============================================================
INCLUDE "clib_cfg.asm"
SECTION code_stdio
PUBLIC asm_flockfile
EXTERN __stdio_lock_acquire, error_znc
asm_flockfile:
; Acquire the FILE lock
;
; enter : ix = FILE *
;
; exit : ix = FILE *
;
; success
;
; hl = 0
; carry reset
;
; fail if FILE is invalid
;
; hl = -1
; carry set, errno = EBADF
;
; uses : af, hl
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_STDIO & $01
EXTERN __stdio_verify_valid
call __stdio_verify_valid
ret c
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call __stdio_lock_acquire
jp nc, error_znc ; if lock acquired
jr asm_flockfile ; try again
| 18.327273 | 65 | 0.41369 |
cfafd85028d2b0883befa37a678fbbf8fb8ad9ab | 3,487 | asm | Assembly | x86/Move_GivesCheck.asm | lantonov/asm | b9ddd4ed9a8c73cbd3600608847769f4690c293c | [
"BSD-3-Clause"
] | 150 | 2016-11-26T05:41:31.000Z | 2022-02-09T20:54:53.000Z | x86/Move_GivesCheck.asm | lantonov/asm | b9ddd4ed9a8c73cbd3600608847769f4690c293c | [
"BSD-3-Clause"
] | 199 | 2016-12-07T22:13:00.000Z | 2022-03-22T15:42:18.000Z | x86/Move_GivesCheck.asm | lantonov/asm | b9ddd4ed9a8c73cbd3600608847769f4690c293c | [
"BSD-3-Clause"
] | 95 | 2016-11-24T22:57:13.000Z | 2022-01-24T19:42:10.000Z |
calign 64
Move_GivesCheck:
; in: rbp address of Pos
; rbx address of State - check info must be filled in
; ecx move assumed to be psuedo legal
; out: eax = 0 if does not give check
; eax = -1 if does give check
;ProfileInc Move_GivesCheck
mov r8d, ecx
shr r8d, 6
and r8d, 63 ; r8d = from
mov r9d, ecx
and r9d, 63 ; r9d = to
mov r11, qword[rbx+State.dcCandidates]
movzx r10d, byte[rbp+Pos.board+r8] ; r10 = FROM PIECE
and r10d, 7
or eax, -1
mov rdx, qword[rbx+State.checkSq+8*r10]
bt rdx, r9
jc .Ret
bt r11, r8
jc .DiscoveredCheck
xor eax, eax
cmp ecx, MOVE_TYPE_PROM shl 12
jae .Special
.Ret:
ret
calign 8
.Special:
push rsi rdi
.Special.AfterPrologue:
shr ecx, 12 ; ecx = move type
mov esi, dword[rbp+Pos.sideToMove]
movzx edi, byte[rbx+State.ksq]
mov rdx, qword[rbp+Pos.typeBB+8*White]
or rdx, qword[rbp+Pos.typeBB+8*Black]
btr rdx, r8
bts rdx, r9
mov eax, dword[.JmpTable+4*(rcx-MOVE_TYPE_PROM)]
jmp rax
calign 8
.JmpTable: dd .PromKnight,.PromBishop,.PromRook,.PromQueen
dd .EpCapture,0,0,0
dd .Castling,0,0,0
calign 8
.Castling:
; esi starts as
; esi=0 if we are white
; esi=1 if we are black
; we are supposed to get into esi the following number
; esi=0 if white and O-O
; esi=1 if white and O-O-O
; esi=2 if black and O-O
; esi=3 if black and O-O-O
; r9d contains to square (square of rook)
; r8d contains from square (square of king)
;
; since we assume that only one of the four possible castling moves have been passed in,
; this can be corrected by comparing the rook square to the king square
cmp r9d, r8d
adc esi, esi
movzx eax, byte[rbp-Thread.rootPos+Thread.castling_rfrom+rsi]
movzx r11d, byte[rbp-Thread.rootPos+Thread.castling_rto+rsi]
btr rdx, rax
bts rdx, r11
bts rdx, r9 ; set king again if nec
RookAttacks rax, r11, rdx, r10
bt rax, rdi
sbb eax, eax
pop rdi rsi
ret
calign 8
.PromQueen:
BishopAttacks r8, r9, rdx, r10
RookAttacks rax, r9, rdx, r10
or rax, r8
bt rax, rdi
sbb eax, eax
pop rdi rsi
ret
calign 8
.EpCapture:
lea ecx, [2*rsi-1]
lea ecx, [r9+8*rcx]
mov r8, qword[rbp+Pos.typeBB+8*Bishop]
mov r9, qword[rbp+Pos.typeBB+8*Rook]
btr rdx, rcx
BishopAttacks rax, rdi, rdx, r10
RookAttacks r11, rdi, rdx, r10
mov r10, qword[rbp+Pos.typeBB+8*Queen]
or r8, r10
or r9, r10
and rax, r8
and r11, r9
or rax, r11
and rax, qword[rbp+Pos.typeBB+8*rsi]
neg rax
sbb eax, eax
pop rdi rsi
ret
calign 8
.PromBishop:
BishopAttacks rax, r9, rdx, r10
bt rax, rdi
sbb eax, eax
pop rdi rsi
ret
calign 8
.PromRook:
RookAttacks rax, r9, rdx, r10
bt rax, rdi
sbb eax, eax
pop rdi rsi
ret
calign 8
.PromKnight:
mov rax, qword[KnightAttacks+8*r9]
bt rax, rdi
sbb eax, eax
pop rdi rsi
ret
calign 8
.DiscoveredCheck:
push rsi rdi
movzx edi, byte[rbx+State.ksq]
mov eax, ecx
and eax, 64*64-1
mov rax, qword[LineBB+8*rax]
bt rax, rdi
jc .DiscoveredCheckRet
or eax, -1
pop rdi rsi
ret
.DiscoveredCheckRet:
xor eax, eax
cmp ecx, MOVE_TYPE_PROM shl 12
jae .Special.AfterPrologue
pop rdi rsi
ret
| 21.79375 | 90 | 0.607972 |
6b81f2668d0f009123a7b246caa4b3b75ffead0a | 1,141 | asm | Assembly | util/menus/getexts.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | util/menus/getexts.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | util/menus/getexts.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Read all extensions into table 1994 Jochen Merz
section utility
include dev8_mac_xref
include dev8_keys_thg
xdef mu_getexts ; get pre-defined extensions
;+++
; Reads all eight pre-defined extensions into a table. The table has to be
; 64 bytes long, every entry containing a word length and up to 6 chars.
;
; Entry Exit
; a5 ptr to table preserved
;
; All possible error returns from Menu.
;---
mu_getexts
stk_frm equ 16
get_reg reg d4/a1/a4-a5
movem.l get_reg,-(sp)
move.l #'INFO',d2
xbsr ut_usmen ; try to use Menu Thing
bne.s no_menu
move.l a1,a4 ; address of Thing
sub.l #stk_frm,sp
move.l sp,a1 ; here is our parameter table
move.l #(thp.ret+thp.str)<<16,4(a1) ; return parameter is string
moveq #0,d4 ; start with first extension
get_loop
move.l d4,(a1) ; inquiry key
move.l a5,8(a1) ; result to here
jsr thh_code(a4) ; call routine to get string
bne.s get_error
addq.l #8,a5 ; point to next result location
addq.b #1,d4
cmp.b #8,d4 ; all done?
bne.s get_loop
get_error
xbsr ut_frmen ; finally free Menu Extension
add.l #stk_frm,sp
no_menu
movem.l (sp)+,get_reg
tst.l d0
rts
end
| 20.017544 | 74 | 0.71078 |
c37df41149ed8b43bfdd13dbcc81113d947c21e8 | 684 | asm | Assembly | oeis/102/A102446.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/102/A102446.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/102/A102446.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A102446: a(n) = a(n-1) + 4*a(n-2) for n>1, a(0) = a(1) = 2.
; Submitted by Jon Maiga
; 2,2,10,18,58,130,362,882,2330,5858,15178,38610,99322,253762,651050,1666098,4270298,10934690,28015882,71754642,183818170,470836738,1206109418,3089456370,7913894042,20271719522,51927295690,133014173778,340723356538,872780051650,2235673477802,5726793684402,14669487595610,37576662333218,96254612715658,246561262048530,631579712911162,1617824761105282,4144143612749930,10615442657171058,27192017108170778,69653787736855010,178421856169538122,457037007116958162,1170724431795110650,2998872460262943298
mov $3,1
lpb $0
sub $0,1
mov $2,$3
add $3,$1
mov $1,4
mul $1,$2
lpe
mov $0,$3
mul $0,2
| 45.6 | 498 | 0.79386 |
77aaa10cfae92421d9362e37a1acc65b97dc3586 | 73 | asm | Assembly | gfx/pokemon/onix/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/onix/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/onix/anim_idle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | setrepeat 2
frame 0, 10
frame 7, 10
frame 8, 10
dorepeat 1
endanim
| 10.428571 | 12 | 0.684932 |
1b6c12c72859d39012656c1b526a8cab2361a2f0 | 324 | asm | Assembly | programs/oeis/024/A024057.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/024/A024057.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/024/A024057.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A024057: a(n) = 5^n - n^8.
; 1,4,-231,-6436,-64911,-387500,-1663991,-5686676,-16386591,-41093596,-90234375,-165530756,-185841071,404972404,4627726569,27954687500,148292923329,755963695684,3803677305049,19056502765084,95341831640625,476799335343764,2384130915142089
mov $1,5
pow $1,$0
pow $0,8
add $0,1
sub $1,$0
add $1,1
| 32.4 | 237 | 0.756173 |
6359c85904d86c679b5941ee79455a1ee8ae00fb | 928 | asm | Assembly | programs/oeis/327/A327253.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/327/A327253.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/327/A327253.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A327253: a(n) = floor(2*n*r) - 2*floor(n*r), where r = sqrt(6).
; 0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1
lpb $0
pow $0,2
add $4,6
mul $0,$4
mov $1,$0
cmp $1,0
add $0,$1
div $4,$0
sub $0,1
mov $5,$0
cal $5,118175 ; Binary representation of n-th iteration of the Rule 220 elementary cellular automaton starting with a single black cell.
mov $0,$4
sub $3,3
add $5,$3
add $2,$5
sub $0,$2
mod $0,2
mov $1,$0
cmp $1,0
add $0,$1
lpe
| 37.12 | 501 | 0.532328 |
5328860ab20bbc514ce32fba60d77970b049639f | 334 | asm | Assembly | oeis/022/A022128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/022/A022128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/022/A022128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A022128: Fibonacci sequence beginning 3, 19.
; Submitted by Jamie Morken(s4)
; 3,19,22,41,63,104,167,271,438,709,1147,1856,3003,4859,7862,12721,20583,33304,53887,87191,141078,228269,369347,597616,966963,1564579,2531542,4096121,6627663,10723784
mov $1,3
mov $2,16
lpb $0
sub $0,1
mov $3,$2
mov $2,$1
add $1,$3
lpe
mov $0,$1
| 23.857143 | 166 | 0.712575 |
2444d07a9c83c7118e7c0034f1058fc94633b974 | 2,679 | asm | Assembly | rom0/tokenizer.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 15 | 2018-09-07T15:49:44.000Z | 2021-09-21T20:47:14.000Z | rom0/tokenizer.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 6 | 2020-05-24T08:43:07.000Z | 2020-05-26T22:02:36.000Z | rom0/tokenizer.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 3 | 2020-08-03T06:28:34.000Z | 2021-12-29T00:27:50.000Z | ; Find token in either ROM
; Input: B length of text to match, HL address of text to match
; Output: A token code matched or zero, if none; CF token matched fully
TOK_F: LD A,(HL)
CP " "
JR NZ,TOK_IN0
INC HL
DJNZ TOK_F
RET
TOK_IN0:LD DE,T_ELSE
LD C,RND_T-$7F ; new tokens
CALL FTOKEN
JR C,TOK_TF ; full token found
LD C,$100-RND_T ; old tokens
OR A
JR Z,TOK_IN ; no new token found
ADD A,C
ADD A,A
JR C,TOK_EL ; partially matched ELSE
TOK_IN: EX AF,AF'
LD DE,L0095+1 ; RND token
RST $30
DEFW FTOKENL_R1 ; search in ROM1
RR D ; save CF
DEC A
CPL
RL D
RET
TOK_TF: ADD A,$5A
CPL
CP $7F
SCF
RET NZ
TOK_EL: LD A,ELSE_T
RET
;Find token
; Input: HL text to match, B length of text, DE token table, C number of tokens in the table
; Output: A remaining tokens in the table at full match, CF token matched fully
FTOKEN: XOR A
EX AF,AF' ; clear A' and CF'
FTOKENL:PUSH BC
PUSH HL
LD C,0
CALL TESTKW
RR H
EX AF,AF'
RL H
EX AF,AF' ; move CF to CF'
POP HL
LD A,C
POP BC
CP B
JR NZ,FTOK_N ; no full match
EX AF,AF'
BIT 0,A
JR NZ,FTOK_F ; do not overwrite full matches
LD A,C
ADC A,A
FTOK_F: EX AF,AF'
FTOK_N: DEC C
JR NZ,FTOKENL
EX AF,AF'
SRL A
RET
; Test one keyword
; Input: HL text to match, B length of text, DE keyword to check, C=0
; Output: CF set iff keyword matches fully, C length of match, DE next keyword
TESTKW: LD A,(DE)
CP $A0 ; final space is not matched
JR Z,TESTKW1
AND $7F ; remove end marker
RST $30
DEFW L2C8D ; ALPHA
ADC A,A
RRCA
XOR (HL)
ADD A,A
JR NC,TESTKW0 ; not a letter
AND $BF ; capitalize
TESTKW0:JR NZ,SPACEKW
INC C ; increment length
LD A,(DE)
TESTKW1:INC DE
ADD A
RET C ; full match
INC HL
DJNZ TESTKW
LD A,(DE)
INC DE
CP $80 + " "
CCF
RET Z
ADD A,A
CCF
RET NC
TESTKW2:LD A,(DE)
INC DE
ADD A,A
JR NC,TESTKW2
AND A ; partial match
RET
SPACEKW:LD A,(DE)
INC DE
CP " " ; spaces inside keywords are optional
JR Z,TESTKW
DEC DE
JR TESTKW2
; First non-whitespace of a token in this ROM
; In: DE=token table-1, B=token code+1
; Out: A=character code
FC_TOKEN_R0:
LD A,(DE)
INC DE
ADD A,A
JR NC,FC_TOKEN_R0
DJNZ FC_TOKEN_R0
FC_WSP: LD A,(DE)
CP " "
RET NZ
INC DE
LD A,(DE)
AND $7F
RET
; First non-whitespace of a token in ROM1
; In: DE=token table-1, A=token code
; Out: A=character code
FC_TOKEN_R1:
RST $30
DEFW L0C41 ; PO-SEARCH
EX DE,HL
FC_TR1: RST $30
DEFW X007B ; LD A,(HL)
CP " "
RET NZ
INC HL
; works only with these particular tokens
JR FC_TR1
; correct, but too long
; RST $30
; DEFW X007B ; LD A,(HL)
; AND $7F
; RET
| 17.741722 | 92 | 0.643897 |
779d0d1df15b2fbafee1e025ebc98f5b26cbea5b | 1,801 | asm | Assembly | p8/onclass/uart_dt/uart_dt.asm | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | 2 | 2022-03-06T06:05:24.000Z | 2022-03-10T09:08:08.000Z | p8/onclass/uart_dt/uart_dt.asm | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | p8/onclass/uart_dt/uart_dt.asm | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | # li $t0, 0x12
# sb $t0, 0x7f57($0)
# li $t0, 1
# sb $t0, 0x7f58($0)
li $s0, 0 #before
li $s1, 8 #loop_limit
li $sp, 0x2000 #buffer
loop:
lw $t0, 0x7f58($0)
andi $t0, $t0, 1
beq $t0, $s0, if_1_end
nop
addu $s0, $0, $t0
beq $t0, $0, if_1_end
nop
lw $t0, 0x7f54($0)
sw $t0, 0x7f40($0)
li $t2, 0
for_1_begin:
beq $t2, $s1, for_1_end
nop
andi $t1, $t0, 0xf
sll $t1, $t1, 3
la $a0, table
addu $a0, $a0, $t1
jr $a0
nop
table:
j table_end
li $a1, 48
j table_end
li $a1, 49
j table_end
li $a1, 50
j table_end
li $a1, 51
j table_end
li $a1, 52
j table_end
li $a1, 53
j table_end
li $a1, 54
j table_end
li $a1, 55
j table_end
li $a1, 56
j table_end
li $a1, 57
j table_end
li $a1, 65
j table_end
li $a1, 66
j table_end
li $a1, 67
j table_end
li $a1, 68
j table_end
li $a1, 69
j table_end
li $a1, 70
table_end:
addiu $sp, $sp, -1
sb $a1, 0($sp)
srl $t0, $t0, 4
addi $t2, $t2, 1
j for_1_begin
nop
for_1_end:
if_1_end:
lw $t0, 0x7f30($0)
andi $t1, $t0, 32
beqz $t1, if_2_end
nop
bge $sp, 0x3000, if_2_end
nop
lb $t0, 0($sp)
addiu $sp, $sp, 1
sw $t0, 0x7f20($0)
if_2_end:
beq $0, $0, loop
nop
| 18.56701 | 31 | 0.383676 |
eac8d5c702d886d66ed3cc85a7f0cb6271fa2aa4 | 867 | asm | Assembly | solutions/64 - Binary Counter/size-60_speed-17.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 45 | 2018-09-05T04:56:59.000Z | 2021-11-22T08:57:26.000Z | solutions/64 - Binary Counter/size-60_speed-17.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 36 | 2018-09-01T11:34:26.000Z | 2021-05-19T23:20:49.000Z | solutions/64 - Binary Counter/size-60_speed-17.asm | michaelgundlach/7billionhumans | 02c6f3963364362c95cb516cbc6ef1efc073bb2e | [
"MIT"
] | 36 | 2018-09-01T07:44:19.000Z | 2021-09-10T19:07:35.000Z | -- 7 Billion Humans (2144) --
-- 64: Binary Counter --
-- Author: soerface
-- Size: 60
-- Speed: 17
if e == nothing and
w == worker:
step s
step s
pickup n
a:
mem1 = set c
drop
mem1 = set c
pickup c
jump a
endif
if w == datacube:
step s
b:
step s
step n
jump b
endif
if w == nothing:
step s
step s
pickup n
mem1 = calc 0 + 0
mem1 = calc 0 + 0
mem1 = calc 0 + 0
mem1 = set c
mem1 = set c
drop
endif
if e == nothing:
step s
step s
pickup n
jump c
d:
mem1 = set c
mem1 = set c
mem1 = set c
c:
drop
mem1 = set c
mem1 = set c
mem1 = set c
pickup c
jump d
else:
step s
step s
pickup n
jump e
f:
mem1 = set c
mem1 = set c
mem1 = set c
e:
mem1 = set c
mem1 = set c
mem1 = set c
mem1 = set c
drop
mem1 = set c
mem1 = set c
mem1 = set c
mem1 = set c
mem1 = set c
mem1 = set c
mem1 = set c
pickup c
jump f
endif
| 10.703704 | 29 | 0.591696 |
8616fae39ec9b9b75439f5729d9132f73d3272cb | 109,319 | asm | Assembly | sh.asm | jieun-cloud/xv6-file | 50ead4a176f9111b01a087ab2b9a46883bbaec66 | [
"MIT-0"
] | 1 | 2020-02-10T06:49:36.000Z | 2020-02-10T06:49:36.000Z | sh.asm | jieun-cloud/xv6-file | 50ead4a176f9111b01a087ab2b9a46883bbaec66 | [
"MIT-0"
] | null | null | null | sh.asm | jieun-cloud/xv6-file | 50ead4a176f9111b01a087ab2b9a46883bbaec66 | [
"MIT-0"
] | null | null | null |
_sh: file format elf32-i386
Disassembly of section .text:
00000000 <nulterminate>:
}
// NUL-terminate all the counted strings.
struct cmd*
nulterminate(struct cmd *cmd)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 ec 14 sub $0x14,%esp
7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct execcmd *ecmd;
struct listcmd *lcmd;
struct pipecmd *pcmd;
struct redircmd *rcmd;
if(cmd == 0)
a: 85 db test %ebx,%ebx
c: 74 05 je 13 <nulterminate+0x13>
return 0;
switch(cmd->type){
e: 83 3b 05 cmpl $0x5,(%ebx)
11: 76 0d jbe 20 <nulterminate+0x20>
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
break;
}
return cmd;
}
13: 89 d8 mov %ebx,%eax
15: 83 c4 14 add $0x14,%esp
18: 5b pop %ebx
19: 5d pop %ebp
1a: c3 ret
1b: 90 nop
1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
struct redircmd *rcmd;
if(cmd == 0)
return 0;
switch(cmd->type){
20: 8b 03 mov (%ebx),%eax
22: ff 24 85 38 13 00 00 jmp *0x1338(,%eax,4)
29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
nulterminate(pcmd->right);
break;
case LIST:
lcmd = (struct listcmd*)cmd;
nulterminate(lcmd->left);
30: 8b 43 04 mov 0x4(%ebx),%eax
33: 89 04 24 mov %eax,(%esp)
36: e8 c5 ff ff ff call 0 <nulterminate>
nulterminate(lcmd->right);
3b: 8b 43 08 mov 0x8(%ebx),%eax
3e: 89 04 24 mov %eax,(%esp)
41: e8 ba ff ff ff call 0 <nulterminate>
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
break;
}
return cmd;
}
46: 89 d8 mov %ebx,%eax
48: 83 c4 14 add $0x14,%esp
4b: 5b pop %ebx
4c: 5d pop %ebp
4d: c3 ret
4e: 66 90 xchg %ax,%ax
nulterminate(lcmd->right);
break;
case BACK:
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
50: 8b 43 04 mov 0x4(%ebx),%eax
53: 89 04 24 mov %eax,(%esp)
56: e8 a5 ff ff ff call 0 <nulterminate>
break;
}
return cmd;
}
5b: 89 d8 mov %ebx,%eax
5d: 83 c4 14 add $0x14,%esp
60: 5b pop %ebx
61: 5d pop %ebp
62: c3 ret
63: 90 nop
64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*ecmd->eargv[i] = 0;
break;
case REDIR:
rcmd = (struct redircmd*)cmd;
nulterminate(rcmd->cmd);
68: 8b 43 04 mov 0x4(%ebx),%eax
6b: 89 04 24 mov %eax,(%esp)
6e: e8 8d ff ff ff call 0 <nulterminate>
*rcmd->efile = 0;
73: 8b 43 0c mov 0xc(%ebx),%eax
76: c6 00 00 movb $0x0,(%eax)
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
break;
}
return cmd;
}
79: 89 d8 mov %ebx,%eax
7b: 83 c4 14 add $0x14,%esp
7e: 5b pop %ebx
7f: 5d pop %ebp
80: c3 ret
81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
switch(cmd->type){
case EXEC:
ecmd = (struct execcmd*)cmd;
for(i=0; ecmd->argv[i]; i++)
88: 8b 43 04 mov 0x4(%ebx),%eax
8b: 85 c0 test %eax,%eax
8d: 74 84 je 13 <nulterminate+0x13>
8f: 89 d8 mov %ebx,%eax
91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
*ecmd->eargv[i] = 0;
98: 8b 50 2c mov 0x2c(%eax),%edx
9b: c6 02 00 movb $0x0,(%edx)
return 0;
switch(cmd->type){
case EXEC:
ecmd = (struct execcmd*)cmd;
for(i=0; ecmd->argv[i]; i++)
9e: 8b 50 08 mov 0x8(%eax),%edx
a1: 83 c0 04 add $0x4,%eax
a4: 85 d2 test %edx,%edx
a6: 75 f0 jne 98 <nulterminate+0x98>
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
break;
}
return cmd;
}
a8: 89 d8 mov %ebx,%eax
aa: 83 c4 14 add $0x14,%esp
ad: 5b pop %ebx
ae: 5d pop %ebp
af: c3 ret
000000b0 <peek>:
return ret;
}
int
peek(char **ps, char *es, char *toks)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 57 push %edi
b4: 56 push %esi
b5: 53 push %ebx
b6: 83 ec 1c sub $0x1c,%esp
b9: 8b 7d 08 mov 0x8(%ebp),%edi
bc: 8b 75 0c mov 0xc(%ebp),%esi
char *s;
s = *ps;
bf: 8b 1f mov (%edi),%ebx
while(s < es && strchr(whitespace, *s))
c1: 39 f3 cmp %esi,%ebx
c3: 72 0a jb cf <peek+0x1f>
c5: eb 1f jmp e6 <peek+0x36>
c7: 90 nop
s++;
c8: 83 c3 01 add $0x1,%ebx
peek(char **ps, char *es, char *toks)
{
char *s;
s = *ps;
while(s < es && strchr(whitespace, *s))
cb: 39 de cmp %ebx,%esi
cd: 76 17 jbe e6 <peek+0x36>
cf: 0f be 03 movsbl (%ebx),%eax
d2: c7 04 24 38 14 00 00 movl $0x1438,(%esp)
d9: 89 44 24 04 mov %eax,0x4(%esp)
dd: e8 2e 0c 00 00 call d10 <strchr>
e2: 85 c0 test %eax,%eax
e4: 75 e2 jne c8 <peek+0x18>
s++;
*ps = s;
e6: 89 1f mov %ebx,(%edi)
return *s && strchr(toks, *s);
e8: 0f b6 13 movzbl (%ebx),%edx
eb: 31 c0 xor %eax,%eax
ed: 84 d2 test %dl,%dl
ef: 75 0f jne 100 <peek+0x50>
}
f1: 83 c4 1c add $0x1c,%esp
f4: 5b pop %ebx
f5: 5e pop %esi
f6: 5f pop %edi
f7: 5d pop %ebp
f8: c3 ret
f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = *ps;
while(s < es && strchr(whitespace, *s))
s++;
*ps = s;
return *s && strchr(toks, *s);
100: 0f be d2 movsbl %dl,%edx
103: 89 54 24 04 mov %edx,0x4(%esp)
107: 8b 45 10 mov 0x10(%ebp),%eax
10a: 89 04 24 mov %eax,(%esp)
10d: e8 fe 0b 00 00 call d10 <strchr>
112: 85 c0 test %eax,%eax
114: 0f 95 c0 setne %al
}
117: 83 c4 1c add $0x1c,%esp
s = *ps;
while(s < es && strchr(whitespace, *s))
s++;
*ps = s;
return *s && strchr(toks, *s);
11a: 0f b6 c0 movzbl %al,%eax
}
11d: 5b pop %ebx
11e: 5e pop %esi
11f: 5f pop %edi
120: 5d pop %ebp
121: c3 ret
122: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000130 <gettoken>:
char whitespace[] = " \t\r\n\v";
char symbols[] = "<|>&;()";
int
gettoken(char **ps, char *es, char **q, char **eq)
{
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 57 push %edi
134: 56 push %esi
135: 53 push %ebx
136: 83 ec 1c sub $0x1c,%esp
char *s;
int ret;
s = *ps;
139: 8b 45 08 mov 0x8(%ebp),%eax
char whitespace[] = " \t\r\n\v";
char symbols[] = "<|>&;()";
int
gettoken(char **ps, char *es, char **q, char **eq)
{
13c: 8b 75 0c mov 0xc(%ebp),%esi
13f: 8b 7d 10 mov 0x10(%ebp),%edi
char *s;
int ret;
s = *ps;
142: 8b 18 mov (%eax),%ebx
while(s < es && strchr(whitespace, *s))
144: 39 f3 cmp %esi,%ebx
146: 72 0f jb 157 <gettoken+0x27>
148: eb 24 jmp 16e <gettoken+0x3e>
14a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
s++;
150: 83 c3 01 add $0x1,%ebx
{
char *s;
int ret;
s = *ps;
while(s < es && strchr(whitespace, *s))
153: 39 de cmp %ebx,%esi
155: 76 17 jbe 16e <gettoken+0x3e>
157: 0f be 03 movsbl (%ebx),%eax
15a: c7 04 24 38 14 00 00 movl $0x1438,(%esp)
161: 89 44 24 04 mov %eax,0x4(%esp)
165: e8 a6 0b 00 00 call d10 <strchr>
16a: 85 c0 test %eax,%eax
16c: 75 e2 jne 150 <gettoken+0x20>
s++;
if(q)
16e: 85 ff test %edi,%edi
170: 74 02 je 174 <gettoken+0x44>
*q = s;
172: 89 1f mov %ebx,(%edi)
ret = *s;
174: 0f b6 13 movzbl (%ebx),%edx
177: 0f be fa movsbl %dl,%edi
switch(*s){
17a: 80 fa 3c cmp $0x3c,%dl
s = *ps;
while(s < es && strchr(whitespace, *s))
s++;
if(q)
*q = s;
ret = *s;
17d: 89 f8 mov %edi,%eax
switch(*s){
17f: 7f 4f jg 1d0 <gettoken+0xa0>
181: 80 fa 3b cmp $0x3b,%dl
184: 0f 8c a6 00 00 00 jl 230 <gettoken+0x100>
case '(':
case ')':
case ';':
case '&':
case '<':
s++;
18a: 83 c3 01 add $0x1,%ebx
ret = 'a';
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
s++;
break;
}
if(eq)
18d: 8b 55 14 mov 0x14(%ebp),%edx
190: 85 d2 test %edx,%edx
192: 74 05 je 199 <gettoken+0x69>
*eq = s;
194: 8b 45 14 mov 0x14(%ebp),%eax
197: 89 18 mov %ebx,(%eax)
while(s < es && strchr(whitespace, *s))
199: 39 f3 cmp %esi,%ebx
19b: 72 0a jb 1a7 <gettoken+0x77>
19d: eb 1f jmp 1be <gettoken+0x8e>
19f: 90 nop
s++;
1a0: 83 c3 01 add $0x1,%ebx
break;
}
if(eq)
*eq = s;
while(s < es && strchr(whitespace, *s))
1a3: 39 de cmp %ebx,%esi
1a5: 76 17 jbe 1be <gettoken+0x8e>
1a7: 0f be 03 movsbl (%ebx),%eax
1aa: c7 04 24 38 14 00 00 movl $0x1438,(%esp)
1b1: 89 44 24 04 mov %eax,0x4(%esp)
1b5: e8 56 0b 00 00 call d10 <strchr>
1ba: 85 c0 test %eax,%eax
1bc: 75 e2 jne 1a0 <gettoken+0x70>
s++;
*ps = s;
1be: 8b 45 08 mov 0x8(%ebp),%eax
1c1: 89 18 mov %ebx,(%eax)
return ret;
}
1c3: 83 c4 1c add $0x1c,%esp
1c6: 89 f8 mov %edi,%eax
1c8: 5b pop %ebx
1c9: 5e pop %esi
1ca: 5f pop %edi
1cb: 5d pop %ebp
1cc: c3 ret
1cd: 8d 76 00 lea 0x0(%esi),%esi
while(s < es && strchr(whitespace, *s))
s++;
if(q)
*q = s;
ret = *s;
switch(*s){
1d0: 80 fa 3e cmp $0x3e,%dl
1d3: 0f 84 7f 00 00 00 je 258 <gettoken+0x128>
1d9: 80 fa 7c cmp $0x7c,%dl
1dc: 74 ac je 18a <gettoken+0x5a>
s++;
}
break;
default:
ret = 'a';
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
1de: 39 de cmp %ebx,%esi
1e0: 77 2f ja 211 <gettoken+0xe1>
1e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1e8: eb 3b jmp 225 <gettoken+0xf5>
1ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1f0: 0f be 03 movsbl (%ebx),%eax
1f3: c7 04 24 3e 14 00 00 movl $0x143e,(%esp)
1fa: 89 44 24 04 mov %eax,0x4(%esp)
1fe: e8 0d 0b 00 00 call d10 <strchr>
203: 85 c0 test %eax,%eax
205: 75 1e jne 225 <gettoken+0xf5>
s++;
207: 83 c3 01 add $0x1,%ebx
s++;
}
break;
default:
ret = 'a';
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
20a: 39 de cmp %ebx,%esi
20c: 76 17 jbe 225 <gettoken+0xf5>
20e: 0f be 03 movsbl (%ebx),%eax
211: 89 44 24 04 mov %eax,0x4(%esp)
215: c7 04 24 38 14 00 00 movl $0x1438,(%esp)
21c: e8 ef 0a 00 00 call d10 <strchr>
221: 85 c0 test %eax,%eax
223: 74 cb je 1f0 <gettoken+0xc0>
225: bf 61 00 00 00 mov $0x61,%edi
22a: e9 5e ff ff ff jmp 18d <gettoken+0x5d>
22f: 90 nop
while(s < es && strchr(whitespace, *s))
s++;
if(q)
*q = s;
ret = *s;
switch(*s){
230: 80 fa 29 cmp $0x29,%dl
233: 7f a9 jg 1de <gettoken+0xae>
235: 80 fa 28 cmp $0x28,%dl
238: 0f 8d 4c ff ff ff jge 18a <gettoken+0x5a>
23e: 84 d2 test %dl,%dl
240: 0f 84 47 ff ff ff je 18d <gettoken+0x5d>
246: 80 fa 26 cmp $0x26,%dl
249: 75 93 jne 1de <gettoken+0xae>
24b: 90 nop
24c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
250: e9 35 ff ff ff jmp 18a <gettoken+0x5a>
255: 8d 76 00 lea 0x0(%esi),%esi
case '&':
case '<':
s++;
break;
case '>':
s++;
258: 83 c3 01 add $0x1,%ebx
if(*s == '>'){
25b: 80 3b 3e cmpb $0x3e,(%ebx)
25e: 66 90 xchg %ax,%ax
260: 0f 85 27 ff ff ff jne 18d <gettoken+0x5d>
ret = '+';
s++;
266: 83 c3 01 add $0x1,%ebx
269: bf 2b 00 00 00 mov $0x2b,%edi
26e: 66 90 xchg %ax,%ax
270: e9 18 ff ff ff jmp 18d <gettoken+0x5d>
275: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000280 <backcmd>:
return (struct cmd*)cmd;
}
struct cmd*
backcmd(struct cmd *subcmd)
{
280: 55 push %ebp
281: 89 e5 mov %esp,%ebp
283: 53 push %ebx
284: 83 ec 14 sub $0x14,%esp
struct backcmd *cmd;
cmd = malloc(sizeof(*cmd));
287: c7 04 24 08 00 00 00 movl $0x8,(%esp)
28e: e8 bd 0f 00 00 call 1250 <malloc>
memset(cmd, 0, sizeof(*cmd));
293: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp)
29a: 00
29b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2a2: 00
struct cmd*
backcmd(struct cmd *subcmd)
{
struct backcmd *cmd;
cmd = malloc(sizeof(*cmd));
2a3: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
2a5: 89 04 24 mov %eax,(%esp)
2a8: e8 43 0a 00 00 call cf0 <memset>
cmd->type = BACK;
2ad: c7 03 05 00 00 00 movl $0x5,(%ebx)
cmd->cmd = subcmd;
2b3: 8b 45 08 mov 0x8(%ebp),%eax
2b6: 89 43 04 mov %eax,0x4(%ebx)
return (struct cmd*)cmd;
}
2b9: 89 d8 mov %ebx,%eax
2bb: 83 c4 14 add $0x14,%esp
2be: 5b pop %ebx
2bf: 5d pop %ebp
2c0: c3 ret
2c1: eb 0d jmp 2d0 <listcmd>
2c3: 90 nop
2c4: 90 nop
2c5: 90 nop
2c6: 90 nop
2c7: 90 nop
2c8: 90 nop
2c9: 90 nop
2ca: 90 nop
2cb: 90 nop
2cc: 90 nop
2cd: 90 nop
2ce: 90 nop
2cf: 90 nop
000002d0 <listcmd>:
return (struct cmd*)cmd;
}
struct cmd*
listcmd(struct cmd *left, struct cmd *right)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 53 push %ebx
2d4: 83 ec 14 sub $0x14,%esp
struct listcmd *cmd;
cmd = malloc(sizeof(*cmd));
2d7: c7 04 24 0c 00 00 00 movl $0xc,(%esp)
2de: e8 6d 0f 00 00 call 1250 <malloc>
memset(cmd, 0, sizeof(*cmd));
2e3: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp)
2ea: 00
2eb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2f2: 00
struct cmd*
listcmd(struct cmd *left, struct cmd *right)
{
struct listcmd *cmd;
cmd = malloc(sizeof(*cmd));
2f3: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
2f5: 89 04 24 mov %eax,(%esp)
2f8: e8 f3 09 00 00 call cf0 <memset>
cmd->type = LIST;
2fd: c7 03 04 00 00 00 movl $0x4,(%ebx)
cmd->left = left;
303: 8b 45 08 mov 0x8(%ebp),%eax
306: 89 43 04 mov %eax,0x4(%ebx)
cmd->right = right;
309: 8b 45 0c mov 0xc(%ebp),%eax
30c: 89 43 08 mov %eax,0x8(%ebx)
return (struct cmd*)cmd;
}
30f: 89 d8 mov %ebx,%eax
311: 83 c4 14 add $0x14,%esp
314: 5b pop %ebx
315: 5d pop %ebp
316: c3 ret
317: 89 f6 mov %esi,%esi
319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000320 <pipecmd>:
return (struct cmd*)cmd;
}
struct cmd*
pipecmd(struct cmd *left, struct cmd *right)
{
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 53 push %ebx
324: 83 ec 14 sub $0x14,%esp
struct pipecmd *cmd;
cmd = malloc(sizeof(*cmd));
327: c7 04 24 0c 00 00 00 movl $0xc,(%esp)
32e: e8 1d 0f 00 00 call 1250 <malloc>
memset(cmd, 0, sizeof(*cmd));
333: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp)
33a: 00
33b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
342: 00
struct cmd*
pipecmd(struct cmd *left, struct cmd *right)
{
struct pipecmd *cmd;
cmd = malloc(sizeof(*cmd));
343: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
345: 89 04 24 mov %eax,(%esp)
348: e8 a3 09 00 00 call cf0 <memset>
cmd->type = PIPE;
34d: c7 03 03 00 00 00 movl $0x3,(%ebx)
cmd->left = left;
353: 8b 45 08 mov 0x8(%ebp),%eax
356: 89 43 04 mov %eax,0x4(%ebx)
cmd->right = right;
359: 8b 45 0c mov 0xc(%ebp),%eax
35c: 89 43 08 mov %eax,0x8(%ebx)
return (struct cmd*)cmd;
}
35f: 89 d8 mov %ebx,%eax
361: 83 c4 14 add $0x14,%esp
364: 5b pop %ebx
365: 5d pop %ebp
366: c3 ret
367: 89 f6 mov %esi,%esi
369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000370 <redircmd>:
return (struct cmd*)cmd;
}
struct cmd*
redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 53 push %ebx
374: 83 ec 14 sub $0x14,%esp
struct redircmd *cmd;
cmd = malloc(sizeof(*cmd));
377: c7 04 24 18 00 00 00 movl $0x18,(%esp)
37e: e8 cd 0e 00 00 call 1250 <malloc>
memset(cmd, 0, sizeof(*cmd));
383: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp)
38a: 00
38b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
392: 00
struct cmd*
redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd)
{
struct redircmd *cmd;
cmd = malloc(sizeof(*cmd));
393: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
395: 89 04 24 mov %eax,(%esp)
398: e8 53 09 00 00 call cf0 <memset>
cmd->type = REDIR;
39d: c7 03 02 00 00 00 movl $0x2,(%ebx)
cmd->cmd = subcmd;
3a3: 8b 45 08 mov 0x8(%ebp),%eax
3a6: 89 43 04 mov %eax,0x4(%ebx)
cmd->file = file;
3a9: 8b 45 0c mov 0xc(%ebp),%eax
3ac: 89 43 08 mov %eax,0x8(%ebx)
cmd->efile = efile;
3af: 8b 45 10 mov 0x10(%ebp),%eax
3b2: 89 43 0c mov %eax,0xc(%ebx)
cmd->mode = mode;
3b5: 8b 45 14 mov 0x14(%ebp),%eax
3b8: 89 43 10 mov %eax,0x10(%ebx)
cmd->fd = fd;
3bb: 8b 45 18 mov 0x18(%ebp),%eax
3be: 89 43 14 mov %eax,0x14(%ebx)
return (struct cmd*)cmd;
}
3c1: 89 d8 mov %ebx,%eax
3c3: 83 c4 14 add $0x14,%esp
3c6: 5b pop %ebx
3c7: 5d pop %ebp
3c8: c3 ret
3c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000003d0 <execcmd>:
//PAGEBREAK!
// Constructors
struct cmd*
execcmd(void)
{
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
3d3: 53 push %ebx
3d4: 83 ec 14 sub $0x14,%esp
struct execcmd *cmd;
cmd = malloc(sizeof(*cmd));
3d7: c7 04 24 54 00 00 00 movl $0x54,(%esp)
3de: e8 6d 0e 00 00 call 1250 <malloc>
memset(cmd, 0, sizeof(*cmd));
3e3: c7 44 24 08 54 00 00 movl $0x54,0x8(%esp)
3ea: 00
3eb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
3f2: 00
struct cmd*
execcmd(void)
{
struct execcmd *cmd;
cmd = malloc(sizeof(*cmd));
3f3: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
3f5: 89 04 24 mov %eax,(%esp)
3f8: e8 f3 08 00 00 call cf0 <memset>
cmd->type = EXEC;
return (struct cmd*)cmd;
}
3fd: 89 d8 mov %ebx,%eax
{
struct execcmd *cmd;
cmd = malloc(sizeof(*cmd));
memset(cmd, 0, sizeof(*cmd));
cmd->type = EXEC;
3ff: c7 03 01 00 00 00 movl $0x1,(%ebx)
return (struct cmd*)cmd;
}
405: 83 c4 14 add $0x14,%esp
408: 5b pop %ebx
409: 5d pop %ebp
40a: c3 ret
40b: 90 nop
40c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000410 <panic>:
exit();
}
void
panic(char *s)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 83 ec 18 sub $0x18,%esp
printf(2, "%s\n", s);
416: 8b 45 08 mov 0x8(%ebp),%eax
419: c7 44 24 04 d1 13 00 movl $0x13d1,0x4(%esp)
420: 00
421: c7 04 24 02 00 00 00 movl $0x2,(%esp)
428: 89 44 24 08 mov %eax,0x8(%esp)
42c: e8 8f 0b 00 00 call fc0 <printf>
exit();
431: e8 42 0a 00 00 call e78 <exit>
436: 8d 76 00 lea 0x0(%esi),%esi
439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000440 <parseredirs>:
return cmd;
}
struct cmd*
parseredirs(struct cmd *cmd, char **ps, char *es)
{
440: 55 push %ebp
441: 89 e5 mov %esp,%ebp
443: 57 push %edi
444: 56 push %esi
445: 53 push %ebx
446: 83 ec 3c sub $0x3c,%esp
449: 8b 7d 0c mov 0xc(%ebp),%edi
44c: 8b 75 10 mov 0x10(%ebp),%esi
44f: 90 nop
int tok;
char *q, *eq;
while(peek(ps, es, "<>")){
450: c7 44 24 08 85 13 00 movl $0x1385,0x8(%esp)
457: 00
458: 89 74 24 04 mov %esi,0x4(%esp)
45c: 89 3c 24 mov %edi,(%esp)
45f: e8 4c fc ff ff call b0 <peek>
464: 85 c0 test %eax,%eax
466: 0f 84 a4 00 00 00 je 510 <parseredirs+0xd0>
tok = gettoken(ps, es, 0, 0);
46c: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
473: 00
474: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
47b: 00
47c: 89 74 24 04 mov %esi,0x4(%esp)
480: 89 3c 24 mov %edi,(%esp)
483: e8 a8 fc ff ff call 130 <gettoken>
if(gettoken(ps, es, &q, &eq) != 'a')
488: 89 74 24 04 mov %esi,0x4(%esp)
48c: 89 3c 24 mov %edi,(%esp)
{
int tok;
char *q, *eq;
while(peek(ps, es, "<>")){
tok = gettoken(ps, es, 0, 0);
48f: 89 c3 mov %eax,%ebx
if(gettoken(ps, es, &q, &eq) != 'a')
491: 8d 45 e0 lea -0x20(%ebp),%eax
494: 89 44 24 0c mov %eax,0xc(%esp)
498: 8d 45 e4 lea -0x1c(%ebp),%eax
49b: 89 44 24 08 mov %eax,0x8(%esp)
49f: e8 8c fc ff ff call 130 <gettoken>
4a4: 83 f8 61 cmp $0x61,%eax
4a7: 74 0c je 4b5 <parseredirs+0x75>
panic("missing file for redirection");
4a9: c7 04 24 68 13 00 00 movl $0x1368,(%esp)
4b0: e8 5b ff ff ff call 410 <panic>
switch(tok){
4b5: 83 fb 3c cmp $0x3c,%ebx
4b8: 74 3e je 4f8 <parseredirs+0xb8>
4ba: 83 fb 3e cmp $0x3e,%ebx
4bd: 74 05 je 4c4 <parseredirs+0x84>
4bf: 83 fb 2b cmp $0x2b,%ebx
4c2: 75 8c jne 450 <parseredirs+0x10>
break;
case '>':
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
break;
case '+': // >>
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
4c4: c7 44 24 10 01 00 00 movl $0x1,0x10(%esp)
4cb: 00
4cc: c7 44 24 0c 01 02 00 movl $0x201,0xc(%esp)
4d3: 00
4d4: 8b 45 e0 mov -0x20(%ebp),%eax
4d7: 89 44 24 08 mov %eax,0x8(%esp)
4db: 8b 45 e4 mov -0x1c(%ebp),%eax
4de: 89 44 24 04 mov %eax,0x4(%esp)
4e2: 8b 45 08 mov 0x8(%ebp),%eax
4e5: 89 04 24 mov %eax,(%esp)
4e8: e8 83 fe ff ff call 370 <redircmd>
4ed: 89 45 08 mov %eax,0x8(%ebp)
4f0: e9 5b ff ff ff jmp 450 <parseredirs+0x10>
4f5: 8d 76 00 lea 0x0(%esi),%esi
tok = gettoken(ps, es, 0, 0);
if(gettoken(ps, es, &q, &eq) != 'a')
panic("missing file for redirection");
switch(tok){
case '<':
cmd = redircmd(cmd, q, eq, O_RDONLY, 0);
4f8: c7 44 24 10 00 00 00 movl $0x0,0x10(%esp)
4ff: 00
500: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
507: 00
508: eb ca jmp 4d4 <parseredirs+0x94>
50a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
break;
}
}
return cmd;
}
510: 8b 45 08 mov 0x8(%ebp),%eax
513: 83 c4 3c add $0x3c,%esp
516: 5b pop %ebx
517: 5e pop %esi
518: 5f pop %edi
519: 5d pop %ebp
51a: c3 ret
51b: 90 nop
51c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000520 <parseexec>:
return cmd;
}
struct cmd*
parseexec(char **ps, char *es)
{
520: 55 push %ebp
521: 89 e5 mov %esp,%ebp
523: 57 push %edi
524: 56 push %esi
525: 53 push %ebx
526: 83 ec 3c sub $0x3c,%esp
529: 8b 75 08 mov 0x8(%ebp),%esi
52c: 8b 7d 0c mov 0xc(%ebp),%edi
char *q, *eq;
int tok, argc;
struct execcmd *cmd;
struct cmd *ret;
if(peek(ps, es, "("))
52f: c7 44 24 08 88 13 00 movl $0x1388,0x8(%esp)
536: 00
537: 89 34 24 mov %esi,(%esp)
53a: 89 7c 24 04 mov %edi,0x4(%esp)
53e: e8 6d fb ff ff call b0 <peek>
543: 85 c0 test %eax,%eax
545: 0f 85 cd 00 00 00 jne 618 <parseexec+0xf8>
return parseblock(ps, es);
ret = execcmd();
54b: e8 80 fe ff ff call 3d0 <execcmd>
cmd = (struct execcmd*)ret;
argc = 0;
ret = parseredirs(ret, ps, es);
550: 31 db xor %ebx,%ebx
struct cmd *ret;
if(peek(ps, es, "("))
return parseblock(ps, es);
ret = execcmd();
552: 89 45 d4 mov %eax,-0x2c(%ebp)
cmd = (struct execcmd*)ret;
argc = 0;
ret = parseredirs(ret, ps, es);
555: 89 7c 24 08 mov %edi,0x8(%esp)
559: 89 74 24 04 mov %esi,0x4(%esp)
55d: 89 04 24 mov %eax,(%esp)
560: e8 db fe ff ff call 440 <parseredirs>
565: 89 45 d0 mov %eax,-0x30(%ebp)
while(!peek(ps, es, "|)&;")){
568: eb 1c jmp 586 <parseexec+0x66>
56a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cmd->argv[argc] = q;
cmd->eargv[argc] = eq;
argc++;
if(argc >= MAXARGS)
panic("too many args");
ret = parseredirs(ret, ps, es);
570: 89 7c 24 08 mov %edi,0x8(%esp)
574: 89 74 24 04 mov %esi,0x4(%esp)
578: 8b 45 d0 mov -0x30(%ebp),%eax
57b: 89 04 24 mov %eax,(%esp)
57e: e8 bd fe ff ff call 440 <parseredirs>
583: 89 45 d0 mov %eax,-0x30(%ebp)
ret = execcmd();
cmd = (struct execcmd*)ret;
argc = 0;
ret = parseredirs(ret, ps, es);
while(!peek(ps, es, "|)&;")){
586: c7 44 24 08 9f 13 00 movl $0x139f,0x8(%esp)
58d: 00
58e: 89 7c 24 04 mov %edi,0x4(%esp)
592: 89 34 24 mov %esi,(%esp)
595: e8 16 fb ff ff call b0 <peek>
59a: 85 c0 test %eax,%eax
59c: 75 5a jne 5f8 <parseexec+0xd8>
if((tok=gettoken(ps, es, &q, &eq)) == 0)
59e: 8d 45 e0 lea -0x20(%ebp),%eax
5a1: 8d 55 e4 lea -0x1c(%ebp),%edx
5a4: 89 44 24 0c mov %eax,0xc(%esp)
5a8: 89 54 24 08 mov %edx,0x8(%esp)
5ac: 89 7c 24 04 mov %edi,0x4(%esp)
5b0: 89 34 24 mov %esi,(%esp)
5b3: e8 78 fb ff ff call 130 <gettoken>
5b8: 85 c0 test %eax,%eax
5ba: 74 3c je 5f8 <parseexec+0xd8>
break;
if(tok != 'a')
5bc: 83 f8 61 cmp $0x61,%eax
5bf: 74 0c je 5cd <parseexec+0xad>
panic("syntax");
5c1: c7 04 24 8a 13 00 00 movl $0x138a,(%esp)
5c8: e8 43 fe ff ff call 410 <panic>
cmd->argv[argc] = q;
5cd: 8b 45 e4 mov -0x1c(%ebp),%eax
5d0: 8b 55 d4 mov -0x2c(%ebp),%edx
5d3: 89 44 9a 04 mov %eax,0x4(%edx,%ebx,4)
cmd->eargv[argc] = eq;
5d7: 8b 45 e0 mov -0x20(%ebp),%eax
5da: 89 44 9a 2c mov %eax,0x2c(%edx,%ebx,4)
argc++;
5de: 83 c3 01 add $0x1,%ebx
if(argc >= MAXARGS)
5e1: 83 fb 09 cmp $0x9,%ebx
5e4: 7e 8a jle 570 <parseexec+0x50>
panic("too many args");
5e6: c7 04 24 91 13 00 00 movl $0x1391,(%esp)
5ed: e8 1e fe ff ff call 410 <panic>
5f2: e9 79 ff ff ff jmp 570 <parseexec+0x50>
5f7: 90 nop
ret = parseredirs(ret, ps, es);
}
cmd->argv[argc] = 0;
5f8: 8b 55 d4 mov -0x2c(%ebp),%edx
5fb: c7 44 9a 04 00 00 00 movl $0x0,0x4(%edx,%ebx,4)
602: 00
cmd->eargv[argc] = 0;
603: c7 44 9a 2c 00 00 00 movl $0x0,0x2c(%edx,%ebx,4)
60a: 00
return ret;
}
60b: 8b 45 d0 mov -0x30(%ebp),%eax
60e: 83 c4 3c add $0x3c,%esp
611: 5b pop %ebx
612: 5e pop %esi
613: 5f pop %edi
614: 5d pop %ebp
615: c3 ret
616: 66 90 xchg %ax,%ax
int tok, argc;
struct execcmd *cmd;
struct cmd *ret;
if(peek(ps, es, "("))
return parseblock(ps, es);
618: 89 7c 24 04 mov %edi,0x4(%esp)
61c: 89 34 24 mov %esi,(%esp)
61f: e8 6c 01 00 00 call 790 <parseblock>
624: 89 45 d0 mov %eax,-0x30(%ebp)
ret = parseredirs(ret, ps, es);
}
cmd->argv[argc] = 0;
cmd->eargv[argc] = 0;
return ret;
}
627: 8b 45 d0 mov -0x30(%ebp),%eax
62a: 83 c4 3c add $0x3c,%esp
62d: 5b pop %ebx
62e: 5e pop %esi
62f: 5f pop %edi
630: 5d pop %ebp
631: c3 ret
632: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000640 <parsepipe>:
return cmd;
}
struct cmd*
parsepipe(char **ps, char *es)
{
640: 55 push %ebp
641: 89 e5 mov %esp,%ebp
643: 83 ec 28 sub $0x28,%esp
646: 89 5d f4 mov %ebx,-0xc(%ebp)
649: 8b 5d 08 mov 0x8(%ebp),%ebx
64c: 89 75 f8 mov %esi,-0x8(%ebp)
64f: 8b 75 0c mov 0xc(%ebp),%esi
652: 89 7d fc mov %edi,-0x4(%ebp)
struct cmd *cmd;
cmd = parseexec(ps, es);
655: 89 1c 24 mov %ebx,(%esp)
658: 89 74 24 04 mov %esi,0x4(%esp)
65c: e8 bf fe ff ff call 520 <parseexec>
if(peek(ps, es, "|")){
661: c7 44 24 08 a4 13 00 movl $0x13a4,0x8(%esp)
668: 00
669: 89 74 24 04 mov %esi,0x4(%esp)
66d: 89 1c 24 mov %ebx,(%esp)
struct cmd*
parsepipe(char **ps, char *es)
{
struct cmd *cmd;
cmd = parseexec(ps, es);
670: 89 c7 mov %eax,%edi
if(peek(ps, es, "|")){
672: e8 39 fa ff ff call b0 <peek>
677: 85 c0 test %eax,%eax
679: 75 15 jne 690 <parsepipe+0x50>
gettoken(ps, es, 0, 0);
cmd = pipecmd(cmd, parsepipe(ps, es));
}
return cmd;
}
67b: 89 f8 mov %edi,%eax
67d: 8b 5d f4 mov -0xc(%ebp),%ebx
680: 8b 75 f8 mov -0x8(%ebp),%esi
683: 8b 7d fc mov -0x4(%ebp),%edi
686: 89 ec mov %ebp,%esp
688: 5d pop %ebp
689: c3 ret
68a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
struct cmd *cmd;
cmd = parseexec(ps, es);
if(peek(ps, es, "|")){
gettoken(ps, es, 0, 0);
690: 89 74 24 04 mov %esi,0x4(%esp)
694: 89 1c 24 mov %ebx,(%esp)
697: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
69e: 00
69f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
6a6: 00
6a7: e8 84 fa ff ff call 130 <gettoken>
cmd = pipecmd(cmd, parsepipe(ps, es));
6ac: 89 74 24 04 mov %esi,0x4(%esp)
6b0: 89 1c 24 mov %ebx,(%esp)
6b3: e8 88 ff ff ff call 640 <parsepipe>
}
return cmd;
}
6b8: 8b 5d f4 mov -0xc(%ebp),%ebx
struct cmd *cmd;
cmd = parseexec(ps, es);
if(peek(ps, es, "|")){
gettoken(ps, es, 0, 0);
cmd = pipecmd(cmd, parsepipe(ps, es));
6bb: 89 7d 08 mov %edi,0x8(%ebp)
}
return cmd;
}
6be: 8b 75 f8 mov -0x8(%ebp),%esi
6c1: 8b 7d fc mov -0x4(%ebp),%edi
struct cmd *cmd;
cmd = parseexec(ps, es);
if(peek(ps, es, "|")){
gettoken(ps, es, 0, 0);
cmd = pipecmd(cmd, parsepipe(ps, es));
6c4: 89 45 0c mov %eax,0xc(%ebp)
}
return cmd;
}
6c7: 89 ec mov %ebp,%esp
6c9: 5d pop %ebp
struct cmd *cmd;
cmd = parseexec(ps, es);
if(peek(ps, es, "|")){
gettoken(ps, es, 0, 0);
cmd = pipecmd(cmd, parsepipe(ps, es));
6ca: e9 51 fc ff ff jmp 320 <pipecmd>
6cf: 90 nop
000006d0 <parseline>:
return cmd;
}
struct cmd*
parseline(char **ps, char *es)
{
6d0: 55 push %ebp
6d1: 89 e5 mov %esp,%ebp
6d3: 57 push %edi
6d4: 56 push %esi
6d5: 53 push %ebx
6d6: 83 ec 1c sub $0x1c,%esp
6d9: 8b 5d 08 mov 0x8(%ebp),%ebx
6dc: 8b 75 0c mov 0xc(%ebp),%esi
struct cmd *cmd;
cmd = parsepipe(ps, es);
6df: 89 1c 24 mov %ebx,(%esp)
6e2: 89 74 24 04 mov %esi,0x4(%esp)
6e6: e8 55 ff ff ff call 640 <parsepipe>
6eb: 89 c7 mov %eax,%edi
while(peek(ps, es, "&")){
6ed: eb 27 jmp 716 <parseline+0x46>
6ef: 90 nop
gettoken(ps, es, 0, 0);
6f0: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
6f7: 00
6f8: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
6ff: 00
700: 89 74 24 04 mov %esi,0x4(%esp)
704: 89 1c 24 mov %ebx,(%esp)
707: e8 24 fa ff ff call 130 <gettoken>
cmd = backcmd(cmd);
70c: 89 3c 24 mov %edi,(%esp)
70f: e8 6c fb ff ff call 280 <backcmd>
714: 89 c7 mov %eax,%edi
parseline(char **ps, char *es)
{
struct cmd *cmd;
cmd = parsepipe(ps, es);
while(peek(ps, es, "&")){
716: c7 44 24 08 a6 13 00 movl $0x13a6,0x8(%esp)
71d: 00
71e: 89 74 24 04 mov %esi,0x4(%esp)
722: 89 1c 24 mov %ebx,(%esp)
725: e8 86 f9 ff ff call b0 <peek>
72a: 85 c0 test %eax,%eax
72c: 75 c2 jne 6f0 <parseline+0x20>
gettoken(ps, es, 0, 0);
cmd = backcmd(cmd);
}
if(peek(ps, es, ";")){
72e: c7 44 24 08 a2 13 00 movl $0x13a2,0x8(%esp)
735: 00
736: 89 74 24 04 mov %esi,0x4(%esp)
73a: 89 1c 24 mov %ebx,(%esp)
73d: e8 6e f9 ff ff call b0 <peek>
742: 85 c0 test %eax,%eax
744: 75 0a jne 750 <parseline+0x80>
gettoken(ps, es, 0, 0);
cmd = listcmd(cmd, parseline(ps, es));
}
return cmd;
}
746: 83 c4 1c add $0x1c,%esp
749: 89 f8 mov %edi,%eax
74b: 5b pop %ebx
74c: 5e pop %esi
74d: 5f pop %edi
74e: 5d pop %ebp
74f: c3 ret
while(peek(ps, es, "&")){
gettoken(ps, es, 0, 0);
cmd = backcmd(cmd);
}
if(peek(ps, es, ";")){
gettoken(ps, es, 0, 0);
750: 89 74 24 04 mov %esi,0x4(%esp)
754: 89 1c 24 mov %ebx,(%esp)
757: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
75e: 00
75f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
766: 00
767: e8 c4 f9 ff ff call 130 <gettoken>
cmd = listcmd(cmd, parseline(ps, es));
76c: 89 74 24 04 mov %esi,0x4(%esp)
770: 89 1c 24 mov %ebx,(%esp)
773: e8 58 ff ff ff call 6d0 <parseline>
778: 89 7d 08 mov %edi,0x8(%ebp)
77b: 89 45 0c mov %eax,0xc(%ebp)
}
return cmd;
}
77e: 83 c4 1c add $0x1c,%esp
781: 5b pop %ebx
782: 5e pop %esi
783: 5f pop %edi
784: 5d pop %ebp
gettoken(ps, es, 0, 0);
cmd = backcmd(cmd);
}
if(peek(ps, es, ";")){
gettoken(ps, es, 0, 0);
cmd = listcmd(cmd, parseline(ps, es));
785: e9 46 fb ff ff jmp 2d0 <listcmd>
78a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000790 <parseblock>:
return cmd;
}
struct cmd*
parseblock(char **ps, char *es)
{
790: 55 push %ebp
791: 89 e5 mov %esp,%ebp
793: 83 ec 28 sub $0x28,%esp
796: 89 5d f4 mov %ebx,-0xc(%ebp)
799: 8b 5d 08 mov 0x8(%ebp),%ebx
79c: 89 75 f8 mov %esi,-0x8(%ebp)
79f: 8b 75 0c mov 0xc(%ebp),%esi
7a2: 89 7d fc mov %edi,-0x4(%ebp)
struct cmd *cmd;
if(!peek(ps, es, "("))
7a5: c7 44 24 08 88 13 00 movl $0x1388,0x8(%esp)
7ac: 00
7ad: 89 1c 24 mov %ebx,(%esp)
7b0: 89 74 24 04 mov %esi,0x4(%esp)
7b4: e8 f7 f8 ff ff call b0 <peek>
7b9: 85 c0 test %eax,%eax
7bb: 0f 84 87 00 00 00 je 848 <parseblock+0xb8>
panic("parseblock");
gettoken(ps, es, 0, 0);
7c1: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
7c8: 00
7c9: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
7d0: 00
7d1: 89 74 24 04 mov %esi,0x4(%esp)
7d5: 89 1c 24 mov %ebx,(%esp)
7d8: e8 53 f9 ff ff call 130 <gettoken>
cmd = parseline(ps, es);
7dd: 89 74 24 04 mov %esi,0x4(%esp)
7e1: 89 1c 24 mov %ebx,(%esp)
7e4: e8 e7 fe ff ff call 6d0 <parseline>
if(!peek(ps, es, ")"))
7e9: c7 44 24 08 c4 13 00 movl $0x13c4,0x8(%esp)
7f0: 00
7f1: 89 74 24 04 mov %esi,0x4(%esp)
7f5: 89 1c 24 mov %ebx,(%esp)
struct cmd *cmd;
if(!peek(ps, es, "("))
panic("parseblock");
gettoken(ps, es, 0, 0);
cmd = parseline(ps, es);
7f8: 89 c7 mov %eax,%edi
if(!peek(ps, es, ")"))
7fa: e8 b1 f8 ff ff call b0 <peek>
7ff: 85 c0 test %eax,%eax
801: 75 0c jne 80f <parseblock+0x7f>
panic("syntax - missing )");
803: c7 04 24 b3 13 00 00 movl $0x13b3,(%esp)
80a: e8 01 fc ff ff call 410 <panic>
gettoken(ps, es, 0, 0);
80f: 89 74 24 04 mov %esi,0x4(%esp)
813: 89 1c 24 mov %ebx,(%esp)
816: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
81d: 00
81e: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
825: 00
826: e8 05 f9 ff ff call 130 <gettoken>
cmd = parseredirs(cmd, ps, es);
82b: 89 74 24 08 mov %esi,0x8(%esp)
82f: 89 5c 24 04 mov %ebx,0x4(%esp)
833: 89 3c 24 mov %edi,(%esp)
836: e8 05 fc ff ff call 440 <parseredirs>
return cmd;
}
83b: 8b 5d f4 mov -0xc(%ebp),%ebx
83e: 8b 75 f8 mov -0x8(%ebp),%esi
841: 8b 7d fc mov -0x4(%ebp),%edi
844: 89 ec mov %ebp,%esp
846: 5d pop %ebp
847: c3 ret
parseblock(char **ps, char *es)
{
struct cmd *cmd;
if(!peek(ps, es, "("))
panic("parseblock");
848: c7 04 24 a8 13 00 00 movl $0x13a8,(%esp)
84f: e8 bc fb ff ff call 410 <panic>
854: e9 68 ff ff ff jmp 7c1 <parseblock+0x31>
859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000860 <parsecmd>:
struct cmd *parseexec(char**, char*);
struct cmd *nulterminate(struct cmd*);
struct cmd*
parsecmd(char *s)
{
860: 55 push %ebp
861: 89 e5 mov %esp,%ebp
863: 56 push %esi
864: 53 push %ebx
865: 83 ec 10 sub $0x10,%esp
char *es;
struct cmd *cmd;
es = s + strlen(s);
868: 8b 5d 08 mov 0x8(%ebp),%ebx
86b: 89 1c 24 mov %ebx,(%esp)
86e: e8 5d 04 00 00 call cd0 <strlen>
873: 01 c3 add %eax,%ebx
cmd = parseline(&s, es);
875: 8d 45 08 lea 0x8(%ebp),%eax
878: 89 5c 24 04 mov %ebx,0x4(%esp)
87c: 89 04 24 mov %eax,(%esp)
87f: e8 4c fe ff ff call 6d0 <parseline>
peek(&s, es, "");
884: c7 44 24 08 f3 13 00 movl $0x13f3,0x8(%esp)
88b: 00
88c: 89 5c 24 04 mov %ebx,0x4(%esp)
{
char *es;
struct cmd *cmd;
es = s + strlen(s);
cmd = parseline(&s, es);
890: 89 c6 mov %eax,%esi
peek(&s, es, "");
892: 8d 45 08 lea 0x8(%ebp),%eax
895: 89 04 24 mov %eax,(%esp)
898: e8 13 f8 ff ff call b0 <peek>
if(s != es){
89d: 8b 45 08 mov 0x8(%ebp),%eax
8a0: 39 d8 cmp %ebx,%eax
8a2: 74 24 je 8c8 <parsecmd+0x68>
printf(2, "leftovers: %s\n", s);
8a4: 89 44 24 08 mov %eax,0x8(%esp)
8a8: c7 44 24 04 c6 13 00 movl $0x13c6,0x4(%esp)
8af: 00
8b0: c7 04 24 02 00 00 00 movl $0x2,(%esp)
8b7: e8 04 07 00 00 call fc0 <printf>
panic("syntax");
8bc: c7 04 24 8a 13 00 00 movl $0x138a,(%esp)
8c3: e8 48 fb ff ff call 410 <panic>
}
nulterminate(cmd);
8c8: 89 34 24 mov %esi,(%esp)
8cb: e8 30 f7 ff ff call 0 <nulterminate>
return cmd;
}
8d0: 83 c4 10 add $0x10,%esp
8d3: 89 f0 mov %esi,%eax
8d5: 5b pop %ebx
8d6: 5e pop %esi
8d7: 5d pop %ebp
8d8: c3 ret
8d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000008e0 <fork1>:
exit();
}
int
fork1(void)
{
8e0: 55 push %ebp
8e1: 89 e5 mov %esp,%ebp
8e3: 83 ec 28 sub $0x28,%esp
int pid;
pid = fork();
8e6: e8 85 05 00 00 call e70 <fork>
if(pid == -1)
8eb: 83 f8 ff cmp $0xffffffff,%eax
8ee: 74 08 je 8f8 <fork1+0x18>
panic("fork");
return pid;
}
8f0: c9 leave
8f1: c3 ret
8f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
int pid;
pid = fork();
if(pid == -1)
panic("fork");
8f8: c7 04 24 d5 13 00 00 movl $0x13d5,(%esp)
8ff: 89 45 f4 mov %eax,-0xc(%ebp)
902: e8 09 fb ff ff call 410 <panic>
907: 8b 45 f4 mov -0xc(%ebp),%eax
return pid;
}
90a: c9 leave
90b: c3 ret
90c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000910 <getcmd>:
exit();
}
int
getcmd(char *buf, int nbuf)
{
910: 55 push %ebp
911: 89 e5 mov %esp,%ebp
913: 83 ec 18 sub $0x18,%esp
916: 89 5d f8 mov %ebx,-0x8(%ebp)
919: 8b 5d 08 mov 0x8(%ebp),%ebx
91c: 89 75 fc mov %esi,-0x4(%ebp)
91f: 8b 75 0c mov 0xc(%ebp),%esi
printf(2, "$ ");
922: c7 44 24 04 da 13 00 movl $0x13da,0x4(%esp)
929: 00
92a: c7 04 24 02 00 00 00 movl $0x2,(%esp)
931: e8 8a 06 00 00 call fc0 <printf>
memset(buf, 0, nbuf);
936: 89 74 24 08 mov %esi,0x8(%esp)
93a: 89 1c 24 mov %ebx,(%esp)
93d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
944: 00
945: e8 a6 03 00 00 call cf0 <memset>
gets(buf, nbuf);
94a: 89 74 24 04 mov %esi,0x4(%esp)
94e: 89 1c 24 mov %ebx,(%esp)
951: e8 ba 04 00 00 call e10 <gets>
if(buf[0] == 0) // EOF
return -1;
return 0;
}
956: 8b 75 fc mov -0x4(%ebp),%esi
getcmd(char *buf, int nbuf)
{
printf(2, "$ ");
memset(buf, 0, nbuf);
gets(buf, nbuf);
if(buf[0] == 0) // EOF
959: 80 3b 01 cmpb $0x1,(%ebx)
return -1;
return 0;
}
95c: 8b 5d f8 mov -0x8(%ebp),%ebx
getcmd(char *buf, int nbuf)
{
printf(2, "$ ");
memset(buf, 0, nbuf);
gets(buf, nbuf);
if(buf[0] == 0) // EOF
95f: 19 c0 sbb %eax,%eax
return -1;
return 0;
}
961: 89 ec mov %ebp,%esp
963: 5d pop %ebp
964: c3 ret
965: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
969: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000970 <runcmd>:
struct cmd *parsecmd(char*);
// Execute cmd. Never returns.
void
runcmd(struct cmd *cmd)
{
970: 55 push %ebp
971: 89 e5 mov %esp,%ebp
973: 53 push %ebx
974: 83 ec 24 sub $0x24,%esp
977: 8b 5d 08 mov 0x8(%ebp),%ebx
struct execcmd *ecmd;
struct listcmd *lcmd;
struct pipecmd *pcmd;
struct redircmd *rcmd;
if(cmd == 0)
97a: 85 db test %ebx,%ebx
97c: 74 42 je 9c0 <runcmd+0x50>
exit();
switch(cmd->type){
97e: 83 3b 05 cmpl $0x5,(%ebx)
981: 76 45 jbe 9c8 <runcmd+0x58>
default:
panic("runcmd");
983: c7 04 24 dd 13 00 00 movl $0x13dd,(%esp)
98a: e8 81 fa ff ff call 410 <panic>
case EXEC:
ecmd = (struct execcmd*)cmd;
if(ecmd->argv[0] == 0)
98f: 8b 43 04 mov 0x4(%ebx),%eax
992: 85 c0 test %eax,%eax
994: 74 2a je 9c0 <runcmd+0x50>
exit();
exec(ecmd->argv[0], ecmd->argv);
996: 8d 53 04 lea 0x4(%ebx),%edx
999: 89 54 24 04 mov %edx,0x4(%esp)
99d: 89 04 24 mov %eax,(%esp)
9a0: e8 0b 05 00 00 call eb0 <exec>
printf(2, "exec %s failed\n", ecmd->argv[0]);
9a5: 8b 43 04 mov 0x4(%ebx),%eax
9a8: c7 44 24 04 e4 13 00 movl $0x13e4,0x4(%esp)
9af: 00
9b0: c7 04 24 02 00 00 00 movl $0x2,(%esp)
9b7: 89 44 24 08 mov %eax,0x8(%esp)
9bb: e8 00 06 00 00 call fc0 <printf>
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
runcmd(bcmd->cmd);
break;
}
exit();
9c0: e8 b3 04 00 00 call e78 <exit>
9c5: 8d 76 00 lea 0x0(%esi),%esi
struct redircmd *rcmd;
if(cmd == 0)
exit();
switch(cmd->type){
9c8: 8b 03 mov (%ebx),%eax
9ca: ff 24 85 50 13 00 00 jmp *0x1350(,%eax,4)
9d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
wait();
break;
case BACK:
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
9d8: e8 03 ff ff ff call 8e0 <fork1>
9dd: 85 c0 test %eax,%eax
9df: 90 nop
9e0: 0f 84 a7 00 00 00 je a8d <runcmd+0x11d>
runcmd(bcmd->cmd);
break;
}
exit();
9e6: e8 8d 04 00 00 call e78 <exit>
9eb: 90 nop
9ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
runcmd(rcmd->cmd);
break;
case LIST:
lcmd = (struct listcmd*)cmd;
if(fork1() == 0)
9f0: e8 eb fe ff ff call 8e0 <fork1>
9f5: 85 c0 test %eax,%eax
9f7: 0f 84 a3 00 00 00 je aa0 <runcmd+0x130>
9fd: 8d 76 00 lea 0x0(%esi),%esi
runcmd(lcmd->left);
wait();
a00: e8 7b 04 00 00 call e80 <wait>
runcmd(lcmd->right);
a05: 8b 43 08 mov 0x8(%ebx),%eax
a08: 89 04 24 mov %eax,(%esp)
a0b: e8 60 ff ff ff call 970 <runcmd>
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
runcmd(bcmd->cmd);
break;
}
exit();
a10: e8 63 04 00 00 call e78 <exit>
a15: 8d 76 00 lea 0x0(%esi),%esi
runcmd(lcmd->right);
break;
case PIPE:
pcmd = (struct pipecmd*)cmd;
if(pipe(p) < 0)
a18: 8d 45 f0 lea -0x10(%ebp),%eax
a1b: 89 04 24 mov %eax,(%esp)
a1e: e8 65 04 00 00 call e88 <pipe>
a23: 85 c0 test %eax,%eax
a25: 0f 88 25 01 00 00 js b50 <runcmd+0x1e0>
panic("pipe");
if(fork1() == 0){
a2b: e8 b0 fe ff ff call 8e0 <fork1>
a30: 85 c0 test %eax,%eax
a32: 0f 84 b8 00 00 00 je af0 <runcmd+0x180>
dup(p[1]);
close(p[0]);
close(p[1]);
runcmd(pcmd->left);
}
if(fork1() == 0){
a38: e8 a3 fe ff ff call 8e0 <fork1>
a3d: 85 c0 test %eax,%eax
a3f: 90 nop
a40: 74 6e je ab0 <runcmd+0x140>
dup(p[0]);
close(p[0]);
close(p[1]);
runcmd(pcmd->right);
}
close(p[0]);
a42: 8b 45 f0 mov -0x10(%ebp),%eax
a45: 89 04 24 mov %eax,(%esp)
a48: e8 53 04 00 00 call ea0 <close>
close(p[1]);
a4d: 8b 45 f4 mov -0xc(%ebp),%eax
a50: 89 04 24 mov %eax,(%esp)
a53: e8 48 04 00 00 call ea0 <close>
wait();
a58: e8 23 04 00 00 call e80 <wait>
wait();
a5d: e8 1e 04 00 00 call e80 <wait>
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
runcmd(bcmd->cmd);
break;
}
exit();
a62: e8 11 04 00 00 call e78 <exit>
a67: 90 nop
printf(2, "exec %s failed\n", ecmd->argv[0]);
break;
case REDIR:
rcmd = (struct redircmd*)cmd;
close(rcmd->fd);
a68: 8b 43 14 mov 0x14(%ebx),%eax
a6b: 89 04 24 mov %eax,(%esp)
a6e: e8 2d 04 00 00 call ea0 <close>
if(open(rcmd->file, rcmd->mode) < 0){
a73: 8b 43 10 mov 0x10(%ebx),%eax
a76: 89 44 24 04 mov %eax,0x4(%esp)
a7a: 8b 43 08 mov 0x8(%ebx),%eax
a7d: 89 04 24 mov %eax,(%esp)
a80: e8 33 04 00 00 call eb8 <open>
a85: 85 c0 test %eax,%eax
a87: 0f 88 a3 00 00 00 js b30 <runcmd+0x1c0>
break;
case BACK:
bcmd = (struct backcmd*)cmd;
if(fork1() == 0)
runcmd(bcmd->cmd);
a8d: 8b 43 04 mov 0x4(%ebx),%eax
a90: 89 04 24 mov %eax,(%esp)
a93: e8 d8 fe ff ff call 970 <runcmd>
break;
}
exit();
a98: e8 db 03 00 00 call e78 <exit>
a9d: 8d 76 00 lea 0x0(%esi),%esi
break;
case LIST:
lcmd = (struct listcmd*)cmd;
if(fork1() == 0)
runcmd(lcmd->left);
aa0: 8b 43 04 mov 0x4(%ebx),%eax
aa3: 89 04 24 mov %eax,(%esp)
aa6: e8 c5 fe ff ff call 970 <runcmd>
aab: e9 4d ff ff ff jmp 9fd <runcmd+0x8d>
close(p[0]);
close(p[1]);
runcmd(pcmd->left);
}
if(fork1() == 0){
close(0);
ab0: c7 04 24 00 00 00 00 movl $0x0,(%esp)
ab7: e8 e4 03 00 00 call ea0 <close>
dup(p[0]);
abc: 8b 45 f0 mov -0x10(%ebp),%eax
abf: 89 04 24 mov %eax,(%esp)
ac2: e8 29 04 00 00 call ef0 <dup>
close(p[0]);
ac7: 8b 45 f0 mov -0x10(%ebp),%eax
aca: 89 04 24 mov %eax,(%esp)
acd: e8 ce 03 00 00 call ea0 <close>
close(p[1]);
ad2: 8b 45 f4 mov -0xc(%ebp),%eax
ad5: 89 04 24 mov %eax,(%esp)
ad8: e8 c3 03 00 00 call ea0 <close>
runcmd(pcmd->right);
add: 8b 43 08 mov 0x8(%ebx),%eax
ae0: 89 04 24 mov %eax,(%esp)
ae3: e8 88 fe ff ff call 970 <runcmd>
ae8: e9 55 ff ff ff jmp a42 <runcmd+0xd2>
aed: 8d 76 00 lea 0x0(%esi),%esi
case PIPE:
pcmd = (struct pipecmd*)cmd;
if(pipe(p) < 0)
panic("pipe");
if(fork1() == 0){
close(1);
af0: c7 04 24 01 00 00 00 movl $0x1,(%esp)
af7: e8 a4 03 00 00 call ea0 <close>
dup(p[1]);
afc: 8b 45 f4 mov -0xc(%ebp),%eax
aff: 89 04 24 mov %eax,(%esp)
b02: e8 e9 03 00 00 call ef0 <dup>
close(p[0]);
b07: 8b 45 f0 mov -0x10(%ebp),%eax
b0a: 89 04 24 mov %eax,(%esp)
b0d: e8 8e 03 00 00 call ea0 <close>
close(p[1]);
b12: 8b 45 f4 mov -0xc(%ebp),%eax
b15: 89 04 24 mov %eax,(%esp)
b18: e8 83 03 00 00 call ea0 <close>
runcmd(pcmd->left);
b1d: 8b 43 04 mov 0x4(%ebx),%eax
b20: 89 04 24 mov %eax,(%esp)
b23: e8 48 fe ff ff call 970 <runcmd>
b28: e9 0b ff ff ff jmp a38 <runcmd+0xc8>
b2d: 8d 76 00 lea 0x0(%esi),%esi
case REDIR:
rcmd = (struct redircmd*)cmd;
close(rcmd->fd);
if(open(rcmd->file, rcmd->mode) < 0){
printf(2, "open %s failed\n", rcmd->file);
b30: 8b 43 08 mov 0x8(%ebx),%eax
b33: c7 44 24 04 f4 13 00 movl $0x13f4,0x4(%esp)
b3a: 00
b3b: c7 04 24 02 00 00 00 movl $0x2,(%esp)
b42: 89 44 24 08 mov %eax,0x8(%esp)
b46: e8 75 04 00 00 call fc0 <printf>
exit();
b4b: e8 28 03 00 00 call e78 <exit>
break;
case PIPE:
pcmd = (struct pipecmd*)cmd;
if(pipe(p) < 0)
panic("pipe");
b50: c7 04 24 04 14 00 00 movl $0x1404,(%esp)
b57: e8 b4 f8 ff ff call 410 <panic>
b5c: e9 ca fe ff ff jmp a2b <runcmd+0xbb>
b61: eb 0d jmp b70 <main>
b63: 90 nop
b64: 90 nop
b65: 90 nop
b66: 90 nop
b67: 90 nop
b68: 90 nop
b69: 90 nop
b6a: 90 nop
b6b: 90 nop
b6c: 90 nop
b6d: 90 nop
b6e: 90 nop
b6f: 90 nop
00000b70 <main>:
return 0;
}
int
main(void)
{
b70: 55 push %ebp
b71: 89 e5 mov %esp,%ebp
b73: 83 e4 f0 and $0xfffffff0,%esp
b76: 83 ec 10 sub $0x10,%esp
b79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
static char buf[100];
int fd;
// Ensure that three file descriptors are open.
while((fd = open("console", O_RDWR)) >= 0){
b80: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
b87: 00
b88: c7 04 24 09 14 00 00 movl $0x1409,(%esp)
b8f: e8 24 03 00 00 call eb8 <open>
b94: 85 c0 test %eax,%eax
b96: 78 28 js bc0 <main+0x50>
if(fd >= 3){
b98: 83 f8 02 cmp $0x2,%eax
b9b: 7e e3 jle b80 <main+0x10>
close(fd);
b9d: 89 04 24 mov %eax,(%esp)
ba0: e8 fb 02 00 00 call ea0 <close>
break;
ba5: eb 19 jmp bc0 <main+0x50>
if(chdir(buf+3) < 0)
printf(2, "cannot cd %s\n", buf+3);
continue;
}
if(fork1() == 0)
runcmd(parsecmd(buf));
ba7: c7 04 24 60 14 00 00 movl $0x1460,(%esp)
bae: e8 ad fc ff ff call 860 <parsecmd>
bb3: 89 04 24 mov %eax,(%esp)
bb6: e8 b5 fd ff ff call 970 <runcmd>
wait();
bbb: e8 c0 02 00 00 call e80 <wait>
break;
}
}
// Read and run input commands.
while(getcmd(buf, sizeof(buf)) >= 0){
bc0: c7 44 24 04 64 00 00 movl $0x64,0x4(%esp)
bc7: 00
bc8: c7 04 24 60 14 00 00 movl $0x1460,(%esp)
bcf: e8 3c fd ff ff call 910 <getcmd>
bd4: 85 c0 test %eax,%eax
bd6: 78 70 js c48 <main+0xd8>
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
bd8: 80 3d 60 14 00 00 63 cmpb $0x63,0x1460
bdf: 75 09 jne bea <main+0x7a>
be1: 80 3d 61 14 00 00 64 cmpb $0x64,0x1461
be8: 74 0e je bf8 <main+0x88>
buf[strlen(buf)-1] = 0; // chop \n
if(chdir(buf+3) < 0)
printf(2, "cannot cd %s\n", buf+3);
continue;
}
if(fork1() == 0)
bea: e8 f1 fc ff ff call 8e0 <fork1>
bef: 85 c0 test %eax,%eax
bf1: 75 c8 jne bbb <main+0x4b>
bf3: eb b2 jmp ba7 <main+0x37>
bf5: 8d 76 00 lea 0x0(%esi),%esi
}
}
// Read and run input commands.
while(getcmd(buf, sizeof(buf)) >= 0){
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
bf8: 80 3d 62 14 00 00 20 cmpb $0x20,0x1462
bff: 90 nop
c00: 75 e8 jne bea <main+0x7a>
// Chdir must be called by the parent, not the child.
buf[strlen(buf)-1] = 0; // chop \n
c02: c7 04 24 60 14 00 00 movl $0x1460,(%esp)
c09: e8 c2 00 00 00 call cd0 <strlen>
if(chdir(buf+3) < 0)
c0e: c7 04 24 63 14 00 00 movl $0x1463,(%esp)
// Read and run input commands.
while(getcmd(buf, sizeof(buf)) >= 0){
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
// Chdir must be called by the parent, not the child.
buf[strlen(buf)-1] = 0; // chop \n
c15: c6 80 5f 14 00 00 00 movb $0x0,0x145f(%eax)
if(chdir(buf+3) < 0)
c1c: e8 c7 02 00 00 call ee8 <chdir>
c21: 85 c0 test %eax,%eax
c23: 79 9b jns bc0 <main+0x50>
printf(2, "cannot cd %s\n", buf+3);
c25: c7 44 24 08 63 14 00 movl $0x1463,0x8(%esp)
c2c: 00
c2d: c7 44 24 04 11 14 00 movl $0x1411,0x4(%esp)
c34: 00
c35: c7 04 24 02 00 00 00 movl $0x2,(%esp)
c3c: e8 7f 03 00 00 call fc0 <printf>
c41: e9 7a ff ff ff jmp bc0 <main+0x50>
c46: 66 90 xchg %ax,%ax
}
if(fork1() == 0)
runcmd(parsecmd(buf));
wait();
}
exit();
c48: e8 2b 02 00 00 call e78 <exit>
c4d: 90 nop
c4e: 90 nop
c4f: 90 nop
00000c50 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
c50: 55 push %ebp
c51: 31 d2 xor %edx,%edx
c53: 89 e5 mov %esp,%ebp
c55: 8b 45 08 mov 0x8(%ebp),%eax
c58: 53 push %ebx
c59: 8b 5d 0c mov 0xc(%ebp),%ebx
c5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char *os;
os = s;
while((*s++ = *t++) != 0)
c60: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
c64: 88 0c 10 mov %cl,(%eax,%edx,1)
c67: 83 c2 01 add $0x1,%edx
c6a: 84 c9 test %cl,%cl
c6c: 75 f2 jne c60 <strcpy+0x10>
;
return os;
}
c6e: 5b pop %ebx
c6f: 5d pop %ebp
c70: c3 ret
c71: eb 0d jmp c80 <strcmp>
c73: 90 nop
c74: 90 nop
c75: 90 nop
c76: 90 nop
c77: 90 nop
c78: 90 nop
c79: 90 nop
c7a: 90 nop
c7b: 90 nop
c7c: 90 nop
c7d: 90 nop
c7e: 90 nop
c7f: 90 nop
00000c80 <strcmp>:
int
strcmp(const char *p, const char *q)
{
c80: 55 push %ebp
c81: 89 e5 mov %esp,%ebp
c83: 53 push %ebx
c84: 8b 4d 08 mov 0x8(%ebp),%ecx
c87: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
c8a: 0f b6 01 movzbl (%ecx),%eax
c8d: 84 c0 test %al,%al
c8f: 75 14 jne ca5 <strcmp+0x25>
c91: eb 25 jmp cb8 <strcmp+0x38>
c93: 90 nop
c94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p++, q++;
c98: 83 c1 01 add $0x1,%ecx
c9b: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
c9e: 0f b6 01 movzbl (%ecx),%eax
ca1: 84 c0 test %al,%al
ca3: 74 13 je cb8 <strcmp+0x38>
ca5: 0f b6 1a movzbl (%edx),%ebx
ca8: 38 d8 cmp %bl,%al
caa: 74 ec je c98 <strcmp+0x18>
cac: 0f b6 db movzbl %bl,%ebx
caf: 0f b6 c0 movzbl %al,%eax
cb2: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
cb4: 5b pop %ebx
cb5: 5d pop %ebp
cb6: c3 ret
cb7: 90 nop
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
cb8: 0f b6 1a movzbl (%edx),%ebx
cbb: 31 c0 xor %eax,%eax
cbd: 0f b6 db movzbl %bl,%ebx
cc0: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
cc2: 5b pop %ebx
cc3: 5d pop %ebp
cc4: c3 ret
cc5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000cd0 <strlen>:
uint
strlen(const char *s)
{
cd0: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
cd1: 31 d2 xor %edx,%edx
return (uchar)*p - (uchar)*q;
}
uint
strlen(const char *s)
{
cd3: 89 e5 mov %esp,%ebp
int n;
for(n = 0; s[n]; n++)
cd5: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
}
uint
strlen(const char *s)
{
cd7: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
cda: 80 39 00 cmpb $0x0,(%ecx)
cdd: 74 0c je ceb <strlen+0x1b>
cdf: 90 nop
ce0: 83 c2 01 add $0x1,%edx
ce3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
ce7: 89 d0 mov %edx,%eax
ce9: 75 f5 jne ce0 <strlen+0x10>
;
return n;
}
ceb: 5d pop %ebp
cec: c3 ret
ced: 8d 76 00 lea 0x0(%esi),%esi
00000cf0 <memset>:
void*
memset(void *dst, int c, uint n)
{
cf0: 55 push %ebp
cf1: 89 e5 mov %esp,%ebp
cf3: 8b 55 08 mov 0x8(%ebp),%edx
cf6: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
cf7: 8b 4d 10 mov 0x10(%ebp),%ecx
cfa: 8b 45 0c mov 0xc(%ebp),%eax
cfd: 89 d7 mov %edx,%edi
cff: fc cld
d00: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
d02: 89 d0 mov %edx,%eax
d04: 5f pop %edi
d05: 5d pop %ebp
d06: c3 ret
d07: 89 f6 mov %esi,%esi
d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000d10 <strchr>:
char*
strchr(const char *s, char c)
{
d10: 55 push %ebp
d11: 89 e5 mov %esp,%ebp
d13: 8b 45 08 mov 0x8(%ebp),%eax
d16: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
d1a: 0f b6 10 movzbl (%eax),%edx
d1d: 84 d2 test %dl,%dl
d1f: 75 11 jne d32 <strchr+0x22>
d21: eb 15 jmp d38 <strchr+0x28>
d23: 90 nop
d24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
d28: 83 c0 01 add $0x1,%eax
d2b: 0f b6 10 movzbl (%eax),%edx
d2e: 84 d2 test %dl,%dl
d30: 74 06 je d38 <strchr+0x28>
if(*s == c)
d32: 38 ca cmp %cl,%dl
d34: 75 f2 jne d28 <strchr+0x18>
return (char*)s;
return 0;
}
d36: 5d pop %ebp
d37: c3 ret
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
d38: 31 c0 xor %eax,%eax
if(*s == c)
return (char*)s;
return 0;
}
d3a: 5d pop %ebp
d3b: 90 nop
d3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
d40: c3 ret
d41: eb 0d jmp d50 <atoi>
d43: 90 nop
d44: 90 nop
d45: 90 nop
d46: 90 nop
d47: 90 nop
d48: 90 nop
d49: 90 nop
d4a: 90 nop
d4b: 90 nop
d4c: 90 nop
d4d: 90 nop
d4e: 90 nop
d4f: 90 nop
00000d50 <atoi>:
return r;
}
int
atoi(const char *s)
{
d50: 55 push %ebp
int n;
n = 0;
while('0' <= *s && *s <= '9')
d51: 31 c0 xor %eax,%eax
return r;
}
int
atoi(const char *s)
{
d53: 89 e5 mov %esp,%ebp
d55: 8b 4d 08 mov 0x8(%ebp),%ecx
d58: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
d59: 0f b6 11 movzbl (%ecx),%edx
d5c: 8d 5a d0 lea -0x30(%edx),%ebx
d5f: 80 fb 09 cmp $0x9,%bl
d62: 77 1c ja d80 <atoi+0x30>
d64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
n = n*10 + *s++ - '0';
d68: 0f be d2 movsbl %dl,%edx
d6b: 83 c1 01 add $0x1,%ecx
d6e: 8d 04 80 lea (%eax,%eax,4),%eax
d71: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
d75: 0f b6 11 movzbl (%ecx),%edx
d78: 8d 5a d0 lea -0x30(%edx),%ebx
d7b: 80 fb 09 cmp $0x9,%bl
d7e: 76 e8 jbe d68 <atoi+0x18>
n = n*10 + *s++ - '0';
return n;
}
d80: 5b pop %ebx
d81: 5d pop %ebp
d82: c3 ret
d83: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
d89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000d90 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
d90: 55 push %ebp
d91: 89 e5 mov %esp,%ebp
d93: 56 push %esi
d94: 8b 45 08 mov 0x8(%ebp),%eax
d97: 53 push %ebx
d98: 8b 5d 10 mov 0x10(%ebp),%ebx
d9b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
d9e: 85 db test %ebx,%ebx
da0: 7e 14 jle db6 <memmove+0x26>
n = n*10 + *s++ - '0';
return n;
}
void*
memmove(void *vdst, const void *vsrc, int n)
da2: 31 d2 xor %edx,%edx
da4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
*dst++ = *src++;
da8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
dac: 88 0c 10 mov %cl,(%eax,%edx,1)
daf: 83 c2 01 add $0x1,%edx
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
db2: 39 da cmp %ebx,%edx
db4: 75 f2 jne da8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
db6: 5b pop %ebx
db7: 5e pop %esi
db8: 5d pop %ebp
db9: c3 ret
dba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000dc0 <stat>:
return buf;
}
int
stat(const char *n, struct stat *st)
{
dc0: 55 push %ebp
dc1: 89 e5 mov %esp,%ebp
dc3: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
dc6: 8b 45 08 mov 0x8(%ebp),%eax
return buf;
}
int
stat(const char *n, struct stat *st)
{
dc9: 89 5d f8 mov %ebx,-0x8(%ebp)
dcc: 89 75 fc mov %esi,-0x4(%ebp)
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
dcf: be ff ff ff ff mov $0xffffffff,%esi
stat(const char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
dd4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
ddb: 00
ddc: 89 04 24 mov %eax,(%esp)
ddf: e8 d4 00 00 00 call eb8 <open>
if(fd < 0)
de4: 85 c0 test %eax,%eax
stat(const char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
de6: 89 c3 mov %eax,%ebx
if(fd < 0)
de8: 78 19 js e03 <stat+0x43>
return -1;
r = fstat(fd, st);
dea: 8b 45 0c mov 0xc(%ebp),%eax
ded: 89 1c 24 mov %ebx,(%esp)
df0: 89 44 24 04 mov %eax,0x4(%esp)
df4: e8 d7 00 00 00 call ed0 <fstat>
close(fd);
df9: 89 1c 24 mov %ebx,(%esp)
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
r = fstat(fd, st);
dfc: 89 c6 mov %eax,%esi
close(fd);
dfe: e8 9d 00 00 00 call ea0 <close>
return r;
}
e03: 89 f0 mov %esi,%eax
e05: 8b 5d f8 mov -0x8(%ebp),%ebx
e08: 8b 75 fc mov -0x4(%ebp),%esi
e0b: 89 ec mov %ebp,%esp
e0d: 5d pop %ebp
e0e: c3 ret
e0f: 90 nop
00000e10 <gets>:
return 0;
}
char*
gets(char *buf, int max)
{
e10: 55 push %ebp
e11: 89 e5 mov %esp,%ebp
e13: 57 push %edi
e14: 56 push %esi
e15: 31 f6 xor %esi,%esi
e17: 53 push %ebx
e18: 83 ec 2c sub $0x2c,%esp
e1b: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
e1e: eb 06 jmp e26 <gets+0x16>
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
e20: 3c 0a cmp $0xa,%al
e22: 74 39 je e5d <gets+0x4d>
e24: 89 de mov %ebx,%esi
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
e26: 8d 5e 01 lea 0x1(%esi),%ebx
e29: 3b 5d 0c cmp 0xc(%ebp),%ebx
e2c: 7d 31 jge e5f <gets+0x4f>
cc = read(0, &c, 1);
e2e: 8d 45 e7 lea -0x19(%ebp),%eax
e31: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
e38: 00
e39: 89 44 24 04 mov %eax,0x4(%esp)
e3d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
e44: e8 47 00 00 00 call e90 <read>
if(cc < 1)
e49: 85 c0 test %eax,%eax
e4b: 7e 12 jle e5f <gets+0x4f>
break;
buf[i++] = c;
e4d: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
e51: 88 44 1f ff mov %al,-0x1(%edi,%ebx,1)
if(c == '\n' || c == '\r')
e55: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
e59: 3c 0d cmp $0xd,%al
e5b: 75 c3 jne e20 <gets+0x10>
e5d: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
e5f: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
e63: 89 f8 mov %edi,%eax
e65: 83 c4 2c add $0x2c,%esp
e68: 5b pop %ebx
e69: 5e pop %esi
e6a: 5f pop %edi
e6b: 5d pop %ebp
e6c: c3 ret
e6d: 90 nop
e6e: 90 nop
e6f: 90 nop
00000e70 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
e70: b8 01 00 00 00 mov $0x1,%eax
e75: cd 40 int $0x40
e77: c3 ret
00000e78 <exit>:
SYSCALL(exit)
e78: b8 02 00 00 00 mov $0x2,%eax
e7d: cd 40 int $0x40
e7f: c3 ret
00000e80 <wait>:
SYSCALL(wait)
e80: b8 03 00 00 00 mov $0x3,%eax
e85: cd 40 int $0x40
e87: c3 ret
00000e88 <pipe>:
SYSCALL(pipe)
e88: b8 04 00 00 00 mov $0x4,%eax
e8d: cd 40 int $0x40
e8f: c3 ret
00000e90 <read>:
SYSCALL(read)
e90: b8 05 00 00 00 mov $0x5,%eax
e95: cd 40 int $0x40
e97: c3 ret
00000e98 <write>:
SYSCALL(write)
e98: b8 10 00 00 00 mov $0x10,%eax
e9d: cd 40 int $0x40
e9f: c3 ret
00000ea0 <close>:
SYSCALL(close)
ea0: b8 15 00 00 00 mov $0x15,%eax
ea5: cd 40 int $0x40
ea7: c3 ret
00000ea8 <kill>:
SYSCALL(kill)
ea8: b8 06 00 00 00 mov $0x6,%eax
ead: cd 40 int $0x40
eaf: c3 ret
00000eb0 <exec>:
SYSCALL(exec)
eb0: b8 07 00 00 00 mov $0x7,%eax
eb5: cd 40 int $0x40
eb7: c3 ret
00000eb8 <open>:
SYSCALL(open)
eb8: b8 0f 00 00 00 mov $0xf,%eax
ebd: cd 40 int $0x40
ebf: c3 ret
00000ec0 <mknod>:
SYSCALL(mknod)
ec0: b8 11 00 00 00 mov $0x11,%eax
ec5: cd 40 int $0x40
ec7: c3 ret
00000ec8 <unlink>:
SYSCALL(unlink)
ec8: b8 12 00 00 00 mov $0x12,%eax
ecd: cd 40 int $0x40
ecf: c3 ret
00000ed0 <fstat>:
SYSCALL(fstat)
ed0: b8 08 00 00 00 mov $0x8,%eax
ed5: cd 40 int $0x40
ed7: c3 ret
00000ed8 <link>:
SYSCALL(link)
ed8: b8 13 00 00 00 mov $0x13,%eax
edd: cd 40 int $0x40
edf: c3 ret
00000ee0 <mkdir>:
SYSCALL(mkdir)
ee0: b8 14 00 00 00 mov $0x14,%eax
ee5: cd 40 int $0x40
ee7: c3 ret
00000ee8 <chdir>:
SYSCALL(chdir)
ee8: b8 09 00 00 00 mov $0x9,%eax
eed: cd 40 int $0x40
eef: c3 ret
00000ef0 <dup>:
SYSCALL(dup)
ef0: b8 0a 00 00 00 mov $0xa,%eax
ef5: cd 40 int $0x40
ef7: c3 ret
00000ef8 <getpid>:
SYSCALL(getpid)
ef8: b8 0b 00 00 00 mov $0xb,%eax
efd: cd 40 int $0x40
eff: c3 ret
00000f00 <sbrk>:
SYSCALL(sbrk)
f00: b8 0c 00 00 00 mov $0xc,%eax
f05: cd 40 int $0x40
f07: c3 ret
00000f08 <sleep>:
SYSCALL(sleep)
f08: b8 0d 00 00 00 mov $0xd,%eax
f0d: cd 40 int $0x40
f0f: c3 ret
00000f10 <uptime>:
SYSCALL(uptime)
f10: b8 0e 00 00 00 mov $0xe,%eax
f15: cd 40 int $0x40
f17: c3 ret
f18: 90 nop
f19: 90 nop
f1a: 90 nop
f1b: 90 nop
f1c: 90 nop
f1d: 90 nop
f1e: 90 nop
f1f: 90 nop
00000f20 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
f20: 55 push %ebp
f21: 89 e5 mov %esp,%ebp
f23: 57 push %edi
f24: 89 cf mov %ecx,%edi
f26: 56 push %esi
f27: 89 c6 mov %eax,%esi
f29: 53 push %ebx
f2a: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
f2d: 8b 4d 08 mov 0x8(%ebp),%ecx
f30: 85 c9 test %ecx,%ecx
f32: 74 04 je f38 <printint+0x18>
f34: 85 d2 test %edx,%edx
f36: 78 70 js fa8 <printint+0x88>
neg = 1;
x = -xx;
} else {
x = xx;
f38: 89 d0 mov %edx,%eax
f3a: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
f41: 31 c9 xor %ecx,%ecx
f43: 8d 5d d7 lea -0x29(%ebp),%ebx
f46: 66 90 xchg %ax,%ax
}
i = 0;
do{
buf[i++] = digits[x % base];
f48: 31 d2 xor %edx,%edx
f4a: f7 f7 div %edi
f4c: 0f b6 92 26 14 00 00 movzbl 0x1426(%edx),%edx
f53: 88 14 0b mov %dl,(%ebx,%ecx,1)
f56: 83 c1 01 add $0x1,%ecx
}while((x /= base) != 0);
f59: 85 c0 test %eax,%eax
f5b: 75 eb jne f48 <printint+0x28>
if(neg)
f5d: 8b 45 c4 mov -0x3c(%ebp),%eax
f60: 85 c0 test %eax,%eax
f62: 74 08 je f6c <printint+0x4c>
buf[i++] = '-';
f64: c6 44 0d d7 2d movb $0x2d,-0x29(%ebp,%ecx,1)
f69: 83 c1 01 add $0x1,%ecx
while(--i >= 0)
f6c: 8d 79 ff lea -0x1(%ecx),%edi
f6f: 01 fb add %edi,%ebx
f71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
f78: 0f b6 03 movzbl (%ebx),%eax
f7b: 83 ef 01 sub $0x1,%edi
f7e: 83 eb 01 sub $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
f81: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
f88: 00
f89: 89 34 24 mov %esi,(%esp)
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
f8c: 88 45 e7 mov %al,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
f8f: 8d 45 e7 lea -0x19(%ebp),%eax
f92: 89 44 24 04 mov %eax,0x4(%esp)
f96: e8 fd fe ff ff call e98 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
f9b: 83 ff ff cmp $0xffffffff,%edi
f9e: 75 d8 jne f78 <printint+0x58>
putc(fd, buf[i]);
}
fa0: 83 c4 4c add $0x4c,%esp
fa3: 5b pop %ebx
fa4: 5e pop %esi
fa5: 5f pop %edi
fa6: 5d pop %ebp
fa7: c3 ret
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
fa8: 89 d0 mov %edx,%eax
faa: f7 d8 neg %eax
fac: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
fb3: eb 8c jmp f41 <printint+0x21>
fb5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
fb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000fc0 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
fc0: 55 push %ebp
fc1: 89 e5 mov %esp,%ebp
fc3: 57 push %edi
fc4: 56 push %esi
fc5: 53 push %ebx
fc6: 83 ec 3c sub $0x3c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
fc9: 8b 45 0c mov 0xc(%ebp),%eax
fcc: 0f b6 10 movzbl (%eax),%edx
fcf: 84 d2 test %dl,%dl
fd1: 0f 84 c9 00 00 00 je 10a0 <printf+0xe0>
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
fd7: 8d 4d 10 lea 0x10(%ebp),%ecx
fda: 31 ff xor %edi,%edi
fdc: 89 4d d4 mov %ecx,-0x2c(%ebp)
fdf: 31 db xor %ebx,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
fe1: 8d 75 e7 lea -0x19(%ebp),%esi
fe4: eb 1e jmp 1004 <printf+0x44>
fe6: 66 90 xchg %ax,%ax
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
fe8: 83 fa 25 cmp $0x25,%edx
feb: 0f 85 b7 00 00 00 jne 10a8 <printf+0xe8>
ff1: 66 bf 25 00 mov $0x25,%di
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
ff5: 83 c3 01 add $0x1,%ebx
ff8: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx
ffc: 84 d2 test %dl,%dl
ffe: 0f 84 9c 00 00 00 je 10a0 <printf+0xe0>
c = fmt[i] & 0xff;
if(state == 0){
1004: 85 ff test %edi,%edi
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
1006: 0f b6 d2 movzbl %dl,%edx
if(state == 0){
1009: 74 dd je fe8 <printf+0x28>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
100b: 83 ff 25 cmp $0x25,%edi
100e: 75 e5 jne ff5 <printf+0x35>
if(c == 'd'){
1010: 83 fa 64 cmp $0x64,%edx
1013: 0f 84 47 01 00 00 je 1160 <printf+0x1a0>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
1019: 83 fa 70 cmp $0x70,%edx
101c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1020: 0f 84 aa 00 00 00 je 10d0 <printf+0x110>
1026: 83 fa 78 cmp $0x78,%edx
1029: 0f 84 a1 00 00 00 je 10d0 <printf+0x110>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
102f: 83 fa 73 cmp $0x73,%edx
1032: 0f 84 c0 00 00 00 je 10f8 <printf+0x138>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
1038: 83 fa 63 cmp $0x63,%edx
103b: 90 nop
103c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1040: 0f 84 42 01 00 00 je 1188 <printf+0x1c8>
putc(fd, *ap);
ap++;
} else if(c == '%'){
1046: 83 fa 25 cmp $0x25,%edx
1049: 0f 84 01 01 00 00 je 1150 <printf+0x190>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
104f: 8b 4d 08 mov 0x8(%ebp),%ecx
1052: 89 55 cc mov %edx,-0x34(%ebp)
1055: c6 45 e7 25 movb $0x25,-0x19(%ebp)
1059: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1060: 00
1061: 89 74 24 04 mov %esi,0x4(%esp)
1065: 89 0c 24 mov %ecx,(%esp)
1068: e8 2b fe ff ff call e98 <write>
106d: 8b 55 cc mov -0x34(%ebp),%edx
1070: 88 55 e7 mov %dl,-0x19(%ebp)
1073: 8b 45 08 mov 0x8(%ebp),%eax
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
1076: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1079: 31 ff xor %edi,%edi
107b: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1082: 00
1083: 89 74 24 04 mov %esi,0x4(%esp)
1087: 89 04 24 mov %eax,(%esp)
108a: e8 09 fe ff ff call e98 <write>
108f: 8b 45 0c mov 0xc(%ebp),%eax
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
1092: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx
1096: 84 d2 test %dl,%dl
1098: 0f 85 66 ff ff ff jne 1004 <printf+0x44>
109e: 66 90 xchg %ax,%ax
putc(fd, c);
}
state = 0;
}
}
}
10a0: 83 c4 3c add $0x3c,%esp
10a3: 5b pop %ebx
10a4: 5e pop %esi
10a5: 5f pop %edi
10a6: 5d pop %ebp
10a7: c3 ret
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
10a8: 8b 45 08 mov 0x8(%ebp),%eax
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
10ab: 88 55 e7 mov %dl,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
10ae: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
10b5: 00
10b6: 89 74 24 04 mov %esi,0x4(%esp)
10ba: 89 04 24 mov %eax,(%esp)
10bd: e8 d6 fd ff ff call e98 <write>
10c2: 8b 45 0c mov 0xc(%ebp),%eax
10c5: e9 2b ff ff ff jmp ff5 <printf+0x35>
10ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
10d0: 8b 45 d4 mov -0x2c(%ebp),%eax
10d3: b9 10 00 00 00 mov $0x10,%ecx
ap++;
10d8: 31 ff xor %edi,%edi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
10da: c7 04 24 00 00 00 00 movl $0x0,(%esp)
10e1: 8b 10 mov (%eax),%edx
10e3: 8b 45 08 mov 0x8(%ebp),%eax
10e6: e8 35 fe ff ff call f20 <printint>
10eb: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
10ee: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
10f2: e9 fe fe ff ff jmp ff5 <printf+0x35>
10f7: 90 nop
} else if(c == 's'){
s = (char*)*ap;
10f8: 8b 55 d4 mov -0x2c(%ebp),%edx
ap++;
if(s == 0)
10fb: b9 1f 14 00 00 mov $0x141f,%ecx
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
s = (char*)*ap;
1100: 8b 3a mov (%edx),%edi
ap++;
1102: 83 c2 04 add $0x4,%edx
1105: 89 55 d4 mov %edx,-0x2c(%ebp)
if(s == 0)
1108: 85 ff test %edi,%edi
110a: 0f 44 f9 cmove %ecx,%edi
s = "(null)";
while(*s != 0){
110d: 0f b6 17 movzbl (%edi),%edx
1110: 84 d2 test %dl,%dl
1112: 74 33 je 1147 <printf+0x187>
1114: 89 5d d0 mov %ebx,-0x30(%ebp)
1117: 8b 5d 08 mov 0x8(%ebp),%ebx
111a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
putc(fd, *s);
s++;
1120: 83 c7 01 add $0x1,%edi
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
1123: 88 55 e7 mov %dl,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1126: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
112d: 00
112e: 89 74 24 04 mov %esi,0x4(%esp)
1132: 89 1c 24 mov %ebx,(%esp)
1135: e8 5e fd ff ff call e98 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
113a: 0f b6 17 movzbl (%edi),%edx
113d: 84 d2 test %dl,%dl
113f: 75 df jne 1120 <printf+0x160>
1141: 8b 5d d0 mov -0x30(%ebp),%ebx
1144: 8b 45 0c mov 0xc(%ebp),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1147: 31 ff xor %edi,%edi
1149: e9 a7 fe ff ff jmp ff5 <printf+0x35>
114e: 66 90 xchg %ax,%ax
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
} else if(c == '%'){
1150: c6 45 e7 25 movb $0x25,-0x19(%ebp)
1154: e9 1a ff ff ff jmp 1073 <printf+0xb3>
1159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
1160: 8b 45 d4 mov -0x2c(%ebp),%eax
1163: b9 0a 00 00 00 mov $0xa,%ecx
ap++;
1168: 66 31 ff xor %di,%di
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
116b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1172: 8b 10 mov (%eax),%edx
1174: 8b 45 08 mov 0x8(%ebp),%eax
1177: e8 a4 fd ff ff call f20 <printint>
117c: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
117f: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
1183: e9 6d fe ff ff jmp ff5 <printf+0x35>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
1188: 8b 55 d4 mov -0x2c(%ebp),%edx
putc(fd, *ap);
ap++;
118b: 31 ff xor %edi,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
118d: 8b 4d 08 mov 0x8(%ebp),%ecx
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
1190: 8b 02 mov (%edx),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1192: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1199: 00
119a: 89 74 24 04 mov %esi,0x4(%esp)
119e: 89 0c 24 mov %ecx,(%esp)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
11a1: 88 45 e7 mov %al,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
11a4: e8 ef fc ff ff call e98 <write>
11a9: 8b 45 0c mov 0xc(%ebp),%eax
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
11ac: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
11b0: e9 40 fe ff ff jmp ff5 <printf+0x35>
11b5: 90 nop
11b6: 90 nop
11b7: 90 nop
11b8: 90 nop
11b9: 90 nop
11ba: 90 nop
11bb: 90 nop
11bc: 90 nop
11bd: 90 nop
11be: 90 nop
11bf: 90 nop
000011c0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
11c0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
11c1: a1 cc 14 00 00 mov 0x14cc,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
11c6: 89 e5 mov %esp,%ebp
11c8: 57 push %edi
11c9: 56 push %esi
11ca: 53 push %ebx
11cb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
11ce: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
11d1: 39 c8 cmp %ecx,%eax
11d3: 73 1d jae 11f2 <free+0x32>
11d5: 8d 76 00 lea 0x0(%esi),%esi
11d8: 8b 10 mov (%eax),%edx
11da: 39 d1 cmp %edx,%ecx
11dc: 72 1a jb 11f8 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
11de: 39 d0 cmp %edx,%eax
11e0: 72 08 jb 11ea <free+0x2a>
11e2: 39 c8 cmp %ecx,%eax
11e4: 72 12 jb 11f8 <free+0x38>
11e6: 39 d1 cmp %edx,%ecx
11e8: 72 0e jb 11f8 <free+0x38>
11ea: 89 d0 mov %edx,%eax
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
11ec: 39 c8 cmp %ecx,%eax
11ee: 66 90 xchg %ax,%ax
11f0: 72 e6 jb 11d8 <free+0x18>
11f2: 8b 10 mov (%eax),%edx
11f4: eb e8 jmp 11de <free+0x1e>
11f6: 66 90 xchg %ax,%ax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
11f8: 8b 71 04 mov 0x4(%ecx),%esi
11fb: 8d 3c f1 lea (%ecx,%esi,8),%edi
11fe: 39 d7 cmp %edx,%edi
1200: 74 19 je 121b <free+0x5b>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
1202: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
1205: 8b 50 04 mov 0x4(%eax),%edx
1208: 8d 34 d0 lea (%eax,%edx,8),%esi
120b: 39 ce cmp %ecx,%esi
120d: 74 23 je 1232 <free+0x72>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
120f: 89 08 mov %ecx,(%eax)
freep = p;
1211: a3 cc 14 00 00 mov %eax,0x14cc
}
1216: 5b pop %ebx
1217: 5e pop %esi
1218: 5f pop %edi
1219: 5d pop %ebp
121a: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
121b: 03 72 04 add 0x4(%edx),%esi
121e: 89 71 04 mov %esi,0x4(%ecx)
bp->s.ptr = p->s.ptr->s.ptr;
1221: 8b 10 mov (%eax),%edx
1223: 8b 12 mov (%edx),%edx
1225: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
1228: 8b 50 04 mov 0x4(%eax),%edx
122b: 8d 34 d0 lea (%eax,%edx,8),%esi
122e: 39 ce cmp %ecx,%esi
1230: 75 dd jne 120f <free+0x4f>
p->s.size += bp->s.size;
1232: 03 51 04 add 0x4(%ecx),%edx
1235: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
1238: 8b 53 f8 mov -0x8(%ebx),%edx
123b: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
123d: a3 cc 14 00 00 mov %eax,0x14cc
}
1242: 5b pop %ebx
1243: 5e pop %esi
1244: 5f pop %edi
1245: 5d pop %ebp
1246: c3 ret
1247: 89 f6 mov %esi,%esi
1249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00001250 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
1250: 55 push %ebp
1251: 89 e5 mov %esp,%ebp
1253: 57 push %edi
1254: 56 push %esi
1255: 53 push %ebx
1256: 83 ec 2c sub $0x2c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1259: 8b 5d 08 mov 0x8(%ebp),%ebx
if((prevp = freep) == 0){
125c: 8b 0d cc 14 00 00 mov 0x14cc,%ecx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1262: 83 c3 07 add $0x7,%ebx
1265: c1 eb 03 shr $0x3,%ebx
1268: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
126b: 85 c9 test %ecx,%ecx
126d: 0f 84 9b 00 00 00 je 130e <malloc+0xbe>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1273: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
1275: 8b 50 04 mov 0x4(%eax),%edx
1278: 39 d3 cmp %edx,%ebx
127a: 76 27 jbe 12a3 <malloc+0x53>
p->s.size -= nunits;
p += p->s.size;
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
127c: 8d 3c dd 00 00 00 00 lea 0x0(,%ebx,8),%edi
morecore(uint nu)
{
char *p;
Header *hp;
if(nu < 4096)
1283: be 00 80 00 00 mov $0x8000,%esi
1288: 89 7d e4 mov %edi,-0x1c(%ebp)
128b: 90 nop
128c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
1290: 3b 05 cc 14 00 00 cmp 0x14cc,%eax
1296: 74 30 je 12c8 <malloc+0x78>
1298: 89 c1 mov %eax,%ecx
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){
129a: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
129c: 8b 50 04 mov 0x4(%eax),%edx
129f: 39 d3 cmp %edx,%ebx
12a1: 77 ed ja 1290 <malloc+0x40>
if(p->s.size == nunits)
12a3: 39 d3 cmp %edx,%ebx
12a5: 74 61 je 1308 <malloc+0xb8>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
12a7: 29 da sub %ebx,%edx
12a9: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
12ac: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
12af: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
12b2: 89 0d cc 14 00 00 mov %ecx,0x14cc
return (void*)(p + 1);
12b8: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
12bb: 83 c4 2c add $0x2c,%esp
12be: 5b pop %ebx
12bf: 5e pop %esi
12c0: 5f pop %edi
12c1: 5d pop %ebp
12c2: c3 ret
12c3: 90 nop
12c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
morecore(uint nu)
{
char *p;
Header *hp;
if(nu < 4096)
12c8: 8b 45 e4 mov -0x1c(%ebp),%eax
12cb: 81 fb 00 10 00 00 cmp $0x1000,%ebx
12d1: bf 00 10 00 00 mov $0x1000,%edi
12d6: 0f 43 fb cmovae %ebx,%edi
12d9: 0f 42 c6 cmovb %esi,%eax
nu = 4096;
p = sbrk(nu * sizeof(Header));
12dc: 89 04 24 mov %eax,(%esp)
12df: e8 1c fc ff ff call f00 <sbrk>
if(p == (char*)-1)
12e4: 83 f8 ff cmp $0xffffffff,%eax
12e7: 74 18 je 1301 <malloc+0xb1>
return 0;
hp = (Header*)p;
hp->s.size = nu;
12e9: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
12ec: 83 c0 08 add $0x8,%eax
12ef: 89 04 24 mov %eax,(%esp)
12f2: e8 c9 fe ff ff call 11c0 <free>
return freep;
12f7: 8b 0d cc 14 00 00 mov 0x14cc,%ecx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
12fd: 85 c9 test %ecx,%ecx
12ff: 75 99 jne 129a <malloc+0x4a>
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){
if(p->s.size >= nunits){
1301: 31 c0 xor %eax,%eax
1303: eb b6 jmp 12bb <malloc+0x6b>
1305: 8d 76 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
1308: 8b 10 mov (%eax),%edx
130a: 89 11 mov %edx,(%ecx)
130c: eb a4 jmp 12b2 <malloc+0x62>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
130e: c7 05 cc 14 00 00 c4 movl $0x14c4,0x14cc
1315: 14 00 00
base.s.size = 0;
1318: b9 c4 14 00 00 mov $0x14c4,%ecx
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
131d: c7 05 c4 14 00 00 c4 movl $0x14c4,0x14c4
1324: 14 00 00
base.s.size = 0;
1327: c7 05 c8 14 00 00 00 movl $0x0,0x14c8
132e: 00 00 00
1331: e9 3d ff ff ff jmp 1273 <malloc+0x23>
| 32.700867 | 71 | 0.418015 |
4ee6e11d608b1abced645fdd4c841e74a7faa525 | 799 | asm | Assembly | programs/oeis/123/A123253.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/123/A123253.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/123/A123253.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A123253: Sum of 7th powers of digits of n.
; 0,1,128,2187,16384,78125,279936,823543,2097152,4782969,1,2,129,2188,16385,78126,279937,823544,2097153,4782970,128,129,256,2315,16512,78253,280064,823671,2097280,4783097,2187,2188,2315,4374,18571,80312,282123,825730,2099339,4785156,16384,16385,16512,18571,32768,94509,296320,839927,2113536,4799353,78125,78126,78253,80312,94509,156250,358061,901668,2175277,4861094,279936,279937,280064,282123,296320,358061,559872,1103479,2377088,5062905,823543,823544,823671,825730,839927,901668,1103479,1647086,2920695,5606512,2097152,2097153,2097280,2099339,2113536,2175277,2377088,2920695,4194304,6880121,4782969,4782970,4783097,4785156,4799353,4861094,5062905,5606512,6880121,9565938
lpb $0
mov $2,$0
div $0,10
mod $2,10
pow $2,7
add $1,$2
lpe
mov $0,$1
| 66.583333 | 672 | 0.803504 |
f6fb3ea5eb07f816d07d087188e6903751693508 | 229 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/frexp.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/frexp.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/frexp.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math16
PUBLIC f16_frexp
EXTERN cm16_sccz80_frexp
defc f16_frexp = cm16_sccz80_frexp
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _f16_frexp
EXTERN cm16_sdcc_frexp
defc _f16_frexp = cm16_sdcc_frexp
ENDIF
| 14.3125 | 35 | 0.834061 |
36528220397dc16d7e9fb56305d86c5ce72beac7 | 4,304 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_186.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_186.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_186.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 %r15
push %r8
push %r9
push %rax
lea addresses_WC_ht+0x17ed8, %rax
nop
nop
nop
dec %r8
movups (%rax), %xmm4
vpextrq $0, %xmm4, %r15
nop
nop
nop
nop
nop
add %r9, %r9
pop %rax
pop %r9
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r9
push %rax
push %rbp
push %rbx
push %rsi
// Store
lea addresses_UC+0x1790, %r9
cmp $45426, %r15
mov $0x5152535455565758, %rax
movq %rax, %xmm1
movups %xmm1, (%r9)
nop
nop
nop
nop
xor $43714, %rbp
// Faulty Load
mov $0x5aba1b0000000ed8, %rbx
nop
nop
nop
nop
sub %r9, %r9
movb (%rbx), %al
lea oracles, %r15
and $0xff, %rax
shlq $12, %rax
mov (%r15,%rax,1), %rax
pop %rsi
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_NC', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC', 'congruent': 3}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_NC', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 9}}
{'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
*/
| 54.481013 | 2,999 | 0.660548 |
ee8bdf81b0cecd5429e42afb1c96cea9526f0bbd | 1,684 | asm | Assembly | MODULE1/6-logical_instructions/thor/thor.asm | wetw0rk/SLAE | c78bc5a8559b35fefb0b3302be8d3d1acd712e11 | [
"MIT"
] | 18 | 2017-11-28T01:10:10.000Z | 2020-07-22T13:24:26.000Z | MODULE1/6-logical_instructions/thor/thor.asm | wetw0rk/SLAE | c78bc5a8559b35fefb0b3302be8d3d1acd712e11 | [
"MIT"
] | null | null | null | MODULE1/6-logical_instructions/thor/thor.asm | wetw0rk/SLAE | c78bc5a8559b35fefb0b3302be8d3d1acd712e11 | [
"MIT"
] | 11 | 2018-12-14T16:18:03.000Z | 2020-12-01T16:37:19.000Z | ; Executable name : thor
; Designed OS : Linux (32-bit)
; Author : wetw0rk
; Version : 1.0
; Created Following : SLAE
; Description : A simple program that shows how logical
; operators/instructions work. Thor sounds
; like XOR!
;
; Build using these commands:
; nasm -f elf32 -o thor.o thor.asm
; ld -o thor thor.o
;
; How to run and use this program (intention):
; gdb -q ./thor
;
SECTION .data
v1: db 0xaa
v2: dw 0xbbcc
v3: dd 0xdeadbeef
SECTION .text
global _start
_start:
; AND example
mov al,0x10 ; MOV 0x10 into AL
and al,0x01 ; AND will result in a zero. This is easy to
; understand by viewing the AND truth table.
and byte [v1],0xaa ; AND will result in 0xaa. The bit position gives this
; result. Once again check the truth table.
and word [v2],0x1122 ; AND will result in 0x1100 again check the table :)
; OR example
mov al,0x10 ; MOV 0x10 into AL
or al,0x01 ; AL = 11 this is pretty direct. If it does not make sense
; check the truth table
or byte [v1],0xaa ; v1 will be 0xaa for similiar reasons
mov eax,0 ; zero out eax
or eax,0x0 ; 0 or 0 = 0. Very clear.
; XOR example
xor dword [v3],0xdeadbeef ; zero out v3 since they are = to each other
xor dword [v3],0xdeadbeef ; since no longer the same v3 will contain 0xdeadbeef
; NOT example
mov eax,0xffffffff ; MOV 0xffffffff into EAX
not eax ; NOT will make EAX zero since 1 will now be 0.
; if confusing check truth table!
not eax ; NOT will make EAX 0xffffffff
mov eax,1 ; dat exit() syscall
mov ebx,0 ; exit cleanly or x
int 80h ; call the kernel
| 27.16129 | 80 | 0.650831 |
8dd35c2e8fe1c8e8abafbaa9c0ec717fa5c77bcb | 1,653 | asm | Assembly | programs/oeis/194/A194715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/194/A194715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/194/A194715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A194715: 15 times triangular numbers.
; 0,15,45,90,150,225,315,420,540,675,825,990,1170,1365,1575,1800,2040,2295,2565,2850,3150,3465,3795,4140,4500,4875,5265,5670,6090,6525,6975,7440,7920,8415,8925,9450,9990,10545,11115,11700,12300,12915,13545,14190,14850,15525,16215,16920,17640,18375,19125,19890,20670,21465,22275,23100,23940,24795,25665,26550,27450,28365,29295,30240,31200,32175,33165,34170,35190,36225,37275,38340,39420,40515,41625,42750,43890,45045,46215,47400,48600,49815,51045,52290,53550,54825,56115,57420,58740,60075,61425,62790,64170,65565,66975,68400,69840,71295,72765,74250,75750,77265,78795,80340,81900,83475,85065,86670,88290,89925,91575,93240,94920,96615,98325,100050,101790,103545,105315,107100,108900,110715,112545,114390,116250,118125,120015,121920,123840,125775,127725,129690,131670,133665,135675,137700,139740,141795,143865,145950,148050,150165,152295,154440,156600,158775,160965,163170,165390,167625,169875,172140,174420,176715,179025,181350,183690,186045,188415,190800,193200,195615,198045,200490,202950,205425,207915,210420,212940,215475,218025,220590,223170,225765,228375,231000,233640,236295,238965,241650,244350,247065,249795,252540,255300,258075,260865,263670,266490,269325,272175,275040,277920,280815,283725,286650,289590,292545,295515,298500,301500,304515,307545,310590,313650,316725,319815,322920,326040,329175,332325,335490,338670,341865,345075,348300,351540,354795,358065,361350,364650,367965,371295,374640,378000,381375,384765,388170,391590,395025,398475,401940,405420,408915,412425,415950,419490,423045,426615,430200,433800,437415,441045,444690,448350,452025,455715,459420,463140,466875
sub $1,$0
bin $1,2
mul $1,15
| 236.142857 | 1,582 | 0.833636 |
6b7b405aea76471bba4024d04ad6a93f815b5f99 | 374 | asm | Assembly | oeis/062/A062190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/062/A062190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/062/A062190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A062190: Coefficient triangle of certain polynomials N(5; m,x).
; Submitted by Christian Krause
; 1,1,6,1,14,21,1,24,84,56,1,36,216,336,126,1,50,450,1200,1050,252,1,66,825,3300,4950,2772,462,1,84,1386,7700,17325,16632,6468,792,1,104,2184,16016,50050,72072,48048,13728
mov $1,1
lpb $0
add $2,1
sub $0,$2
add $1,1
lpe
add $1,4
bin $1,$0
bin $2,$0
mul $1,$2
mov $0,$1
| 23.375 | 171 | 0.679144 |
77ae20f0541ced2d579682b921305259af6d1bab | 366 | asm | Assembly | programs/oeis/247/A247432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/247/A247432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/247/A247432.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A247432: Complement of A247431.
; 4,7,11,15,18,22,26,29,33,36,40,44,47,51,54,58,62,65,69,73,76,80,83,87,91,94,98,102,105,109,112,116,120,123,127,130,134,138,141,145,149,152,156,159,163,167,170,174,178,181,185,188,192,196,199,203,206,210
mov $3,$0
add $3,$0
mov $5,$0
div $5,7
sub $3,$5
mov $2,$3
div $2,3
mov $1,$2
add $1,4
mov $4,$0
mul $4,3
add $1,$4
mov $0,$1
| 21.529412 | 204 | 0.644809 |
407e5e32239574873d8cb3ebe66cefb1f99bdf8e | 705 | asm | Assembly | data/pokemon/base_stats/hitmonchan.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/pokemon/base_stats/hitmonchan.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/pokemon/base_stats/hitmonchan.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | db DEX_HITMONCHAN ; pokedex id
db 50, 105, 79, 76, 35
; hp atk def spd spc
db FIGHTING, FIGHTING ; type
db 45 ; catch rate
db 140 ; base exp
INCBIN "gfx/pokemon/front/hitmonchan.pic", 0, 1 ; sprite dimensions
dw HitmonchanPicFront, HitmonchanPicBack
db COMET_PUNCH, AGILITY, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
tmhm MEGA_PUNCH, MEGA_KICK, TOXIC, BODY_SLAM, TAKE_DOWN, \
DOUBLE_EDGE, SUBMISSION, COUNTER, SEISMIC_TOSS, RAGE, \
MIMIC, DOUBLE_TEAM, BIDE, METRONOME, SWIFT, \
SKULL_BASH, REST, SUBSTITUTE, STRENGTH
; end
db 0 ; padding
| 29.375 | 77 | 0.634043 |
8c5d8feef6d99f60897bfef3a0d55d198f17bc4e | 6,569 | asm | Assembly | libsrc/_DEVELOPMENT/fcntl/z80/drivers/terminal/console_01/output/console_01_output_terminal_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/fcntl/z80/drivers/terminal/console_01/output/console_01_output_terminal_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/fcntl/z80/drivers/terminal/console_01/output/console_01_output_terminal_char.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CONSOLE_01_OUTPUT_TERMINAL_CHAR
; library driver for output terminals
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Windowed output terminal for fixed width fonts.
;
; ;;;;;;;;;;;;;;;;;;;;
; DRIVER CLASS DIAGRAM
; ;;;;;;;;;;;;;;;;;;;;
;
; CONSOLE_01_OUTPUT_TERMINAL (root, abstract)
; CONSOLE_01_OUTPUT_TERMINAL_CHAR (abstract)
;
; This driver implements most of the functions necessary
; for fixed width font output terminals, including
; consuming messages delivered from an attached
; CONSOLE_01_INPUT_TERMINAL.
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM STDIO
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * STDIO_MSG_PUTC
; Generates multiple OTERM_MSG_PUTC messages.
;
; * STDIO_MSG_WRIT
; Generates multiple OTERM_MSG_PUTC messages.
;
; * STDIO_MSG_SEEK -> no error, do nothing
; * STDIO_MSG_FLSH -> no error, do nothing
; * STDIO_MSG_ICTL
; * STDIO_MSG_CLOS -> no error, do nothing
;
; Any other messages are reported as errors via
; error_enotsup_zc
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM CONSOLE_01_OUTPUT_TERMINAL
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * OTERM_MSG_PUTC
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM CONSOLE_01_INPUT_TERMINAL
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * ITERM_MSG_PUTC
; * ITERM_MSG_PRINT_CURSOR
; * ITERM_MSG_BS
; * ITERM_MSG_BS_PWD
; * ITERM_MSG_ERASE_CURSOR
; * ITERM_MSG_ERASE_CURSOR_PWD
; * ITERM_MSG_READLINE_BEGIN
; * ITERM_MSG_READLINE_END
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES GENERATED FOR DERIVED DRIVERS
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * OTERM_MSG_TTY (optional)
;
; enter : c = char to output
; exit : c = char to output (possibly modified)
; carry reset if tty emulation absorbs char
; can use: af, bc, de, hl
;
; The driver should call the tty emulation module.
; If not implemented characters are output without processing.
;
; * OTERM_MSG_PRINTC
;
; enter : c = ascii code >= 32
; b = 255 if not supplied by iterm
; l = absolute x coordinate
; h = absolute y coordinate
; can use: af, bc, de, hl, af'
;
; Print the char to screen at given character coordinate.
;
; * OTERM_MSG_BELL (optional)
;
; can use: af, bc, de, hl
;
; Sound the terminal's bell.
;
; * OTERM_MSG_SCROLL
;
; enter : c = number of rows to scroll
; can use: af, bc, de, hl
;
; Scroll the window upward 'c' character rows.
;
; * OTERM_MSG_CLS
;
; can use: af, bc, de, hl
;
; Clear the window.
;
; * OTERM_MSG_PAUSE
;
; can use: af, bc, de, hl
;
; The scroll count has reached zero so the driver
; should pause the output somehow.
;
; * ITERM_MSG_BELL (optional)
;
; can use: af, bc, de, hl
;
; The input terminal generates this message to
; indicate the edit buffer is either empty or full.
; The output terminal generates this message to
; indicate the output window is full and is being paused.
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; IOCTLs UNDERSTOOD BY THIS DRIVER
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * IOCTL_OTERM_CRLF
; enable / disable crlf processing
;
; * IOCTL_OTERM_BELL
; enable / disable terminal bell
;
; * IOCTL_OTERM_SIGNAL
; enable / disable signal bell
;
; * IOCTL_OTERM_COOK
; enable / disable cook mode (tty emulation)
;
; * IOCTL_OTERM_PAUSE
; enable / disable pause when window filled
;
; * IOCTL_OTERM_PAGE
; select scroll or page mode
;
; * IOCTL_OTERM_CLEAR
; enable / disable clear window when in page mode
;
; * IOCTL_OTERM_CLS
; clear window, set (x,y) = (0,0)
;
; * IOCTL_OTERM_RESET_SCROLL
; reset scroll count
;
; * IOCTL_OTERM_GET_WINDOW_COORD
; get coord of top left corner of window
;
; * IOCTL_OTERM_SET_WINDOW_COORD
; set coord of top left corner of window
;
; * IOCTL_OTERM_GET_WINDOW_RECT
; get window size
;
; * IOCTL_OTERM_SET_WINDOW_RECT
; set window size
;
; * IOCTL_OTERM_GET_CURSOR_COORD
;
; * IOCTL_OTERM_SET_CURSOR_COORD
;
; * IOCTL_OTERM_GET_OTERM
;
; * IOCTL_OTERM_SCROLL
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
; BYTES RESERVED IN FDSTRUCT
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; offset (wrt FDSTRUCT.JP) description
;
; 8..13 mutex
; 14 x coordinate
; 15 y coordinate
; 16 window.x
; 17 window.width
; 18 window.y
; 19 window.height
; 20 scroll_limit
SECTION code_fcntl
PUBLIC console_01_output_terminal_char
EXTERN console_01_output_terminal, error_zc
EXTERN console_01_output_char_oterm_msg_putc, console_01_output_char_stdio_msg_ictl
EXTERN console_01_output_char_iterm_msg_putc, console_01_output_char_iterm_msg_bs
EXTERN console_01_output_char_iterm_msg_readline_begin, console_01_output_char_iterm_msg_readline_end
EXTERN OTERM_MSG_TTY, OTERM_MSG_BELL, ITERM_MSG_BELL
EXTERN OTERM_MSG_PUTC, STDIO_MSG_ICTL, ITERM_MSG_PUTC, ITERM_MSG_BS, ITERM_MSG_READLINE_BEGIN
EXTERN ITERM_MSG_BS_PWD, ITERM_MSG_PRINT_CURSOR, ITERM_MSG_ERASE_CURSOR, ITERM_MSG_READLINE_END
EXTERN ITERM_MSG_ERASE_CURSOR_PWD
console_01_output_terminal_char:
; messages generated by stdio
cp OTERM_MSG_PUTC
jp z, console_01_output_char_oterm_msg_putc
cp STDIO_MSG_ICTL
jp z, console_01_output_char_stdio_msg_ictl
; messages generated by input terminal
cp ITERM_MSG_PUTC
jp z, console_01_output_char_iterm_msg_putc
jp c, console_01_output_terminal ; forward to library
cp ITERM_MSG_BS
jp z, console_01_output_char_iterm_msg_bs
cp ITERM_MSG_BS_PWD
jp z, console_01_output_char_iterm_msg_bs
cp ITERM_MSG_PRINT_CURSOR
jp z, console_01_output_char_iterm_msg_putc
cp ITERM_MSG_ERASE_CURSOR
jp z, console_01_output_char_iterm_msg_bs
cp ITERM_MSG_ERASE_CURSOR_PWD
jp z, console_01_output_char_iterm_msg_bs
cp ITERM_MSG_READLINE_BEGIN
jp z, console_01_output_char_iterm_msg_readline_begin
cp ITERM_MSG_READLINE_END
jp z, console_01_output_char_iterm_msg_readline_end
; prevent error generation for unimplemented optional messages
cp OTERM_MSG_TTY
jp z, error_zc
cp OTERM_MSG_BELL
jp z, error_zc
cp ITERM_MSG_BELL
jp z, error_zc
jp console_01_output_terminal ; forward to library
| 26.595142 | 101 | 0.635561 |
1b482916c484a0e1c22258c6e6aeab5f1dedf30a | 1,083 | asm | Assembly | programs/oeis/241/A241275.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/241/A241275.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/241/A241275.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A241275: a(n) = 6*a(n-1) + 5*(2^(n-1)-1) for n > 0, a(0) = 0.
; 0,0,5,45,305,1905,11585,69825,419585,2518785,15115265,90696705,544190465,3265163265,19591020545,117546205185,705277394945,4231664697345,25389988839425,152339934347265,914039608705025,5484237657473025,32905425955323905,197432555752914945,1184595334559432705,7107572007440482305,42645432044810665985,255872592269199540225,1535235553615868329985,9211413321696552157185,55268479930181997297665,331610879581097352495105,1989665277486594852388865,11937991664919590589169665,71627949989517586484690945,429767699937105604807491585,2578606199622633800643641345,15471637197735803147459231745,92829823186414819571950157825,556978939118488918806090481665,3341873634710933515585321959425,20051241808265601099009489895425,120307450849593606605052055650305,721844705097561639652302566457345,4331068230585369837957795863855105,25986409383512219027834736113352705,155918456301073314167184338540560385,935510737806439885003457874964250625
lpb $0
sub $0,1
mul $1,6
add $1,$2
mul $2,2
add $2,2
lpe
div $1,2
mul $1,5
mov $0,$1
| 77.357143 | 922 | 0.8735 |
a8fd79c9c1625486c2f8b6c5c8d08651c71dfb2f | 1,402 | asm | Assembly | programs/oeis/022/A022375.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/022/A022375.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/022/A022375.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A022375: Fibonacci sequence beginning 2, 26.
; 2,26,28,54,82,136,218,354,572,926,1498,2424,3922,6346,10268,16614,26882,43496,70378,113874,184252,298126,482378,780504,1262882,2043386,3306268,5349654,8655922,14005576,22661498,36667074,59328572,95995646,155324218,251319864,406644082,657963946,1064608028,1722571974,2787180002,4509751976,7296931978,11806683954,19103615932,30910299886,50013915818,80924215704,130938131522,211862347226,342800478748,554662825974,897463304722,1452126130696,2349589435418,3801715566114,6151305001532,9953020567646,16104325569178,26057346136824,42161671706002,68219017842826,110380689548828,178599707391654,288980396940482,467580104332136,756560501272618,1224140605604754,1980701106877372,3204841712482126,5185542819359498,8390384531841624,13575927351201122,21966311883042746,35542239234243868,57508551117286614,93050790351530482,150559341468817096,243610131820347578,394169473289164674,637779605109512252,1031949078398676926,1669728683508189178,2701677761906866104,4371406445415055282,7073084207321921386,11444490652736976668,18517574860058898054,29962065512795874722,48479640372854772776,78441705885650647498,126921346258505420274,205363052144156067772,332284398402661488046,537647450546817555818,869931848949479043864,1407579299496296599682,2277511148445775643546,3685090447942072243228,5962601596387847886774
seq $0,22103 ; Fibonacci sequence beginning 1, 13.
mul $0,2
| 233.666667 | 1,293 | 0.906562 |
d178a312cb121bcb9c1b2ae4756904fbfc0c7a4c | 490 | asm | Assembly | oeis/060/A060367.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/060/A060367.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/060/A060367.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A060367: Average order of an element in a cyclic group of order n rounded down.
; Submitted by Christian Krause
; 1,1,2,2,4,3,6,5,6,6,10,6,12,9,9,10,16,10,18,11,14,15,22,12,20,18,20,16,28,14,30,21,23,24,25,18,36,27,28,22,40,21,42,27,28,33,46,24,42,31,37,33,52,30,42,33,42,42,58,26,60,45,41,42,50,35,66,44,51,38,70,36,72,54,48,49,61,42,78,44,60,60,82,39,67,63,65,54,88,42,74,60,70,69,75,49,96,64,68,57
mov $1,$0
seq $0,57660 ; a(n) = Sum_{k=1..n} n/gcd(n,k).
mov $2,$1
add $2,1
div $0,$2
| 49 | 288 | 0.653061 |
61a7498db134650b8ebf58a4c03f1a75eb57b9c2 | 201 | asm | Assembly | libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_base_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_base_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_base_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void *obstack_base_fastcall(struct obstack *ob)
SECTION code_clib
SECTION code_alloc_obstack
PUBLIC _obstack_base_fastcall
EXTERN asm_obstack_base
defc _obstack_base_fastcall = asm_obstack_base
| 16.75 | 49 | 0.860697 |
86f5fa155bc411cda554055aa100111aad7aff6f | 1,256 | asm | Assembly | programs/oeis/085/A085373.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/085/A085373.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/085/A085373.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A085373: a(n) = binomial(2n+1, n+1)*binomial(n+2, 2).
; 1,9,60,350,1890,9702,48048,231660,1093950,5080790,23279256,105462084,473227300,2106121500,9307051200,40873466520,178520875830,775924068150,3357800061000,14473885526100,62168784497820,266168518910580,1136213440408800,4837140552465000,20541723546134700,87033702532392252,367971551447493168,1552684191954369320,6539630463650176200,27496515213830281080,115426231607304749824,483812773208843900976,2025049675741562540070,8464779838884071580150,35338677512248796311080,147356675912186647474932,613764893363972612755948,2553715950340853331879300,10614635798987622486084000,44077955580667832349264200,182869762055404836161215620,758028084524668827246664980,3139562609216236338762488400,12993010163934001338536091000,53730690516308890383804804600,222034940423432970214041690120,916895443154676021309419153280,3783819404153383758151902622800,15605037508625774852922387517500,64318232147797173250942967000700,264940670776651571697217617794256,1090732369358778981821350660285704,4487991679437065912138648943265560,18456904984966549890241753341102600,75865958268172269717195732251912640,311690855819951915909543764907695632
add $0,2
mov $1,$0
mul $0,2
sub $0,2
bin $0,$1
mul $0,$1
mul $1,$0
mov $0,$1
div $0,4
| 96.615385 | 1,112 | 0.90207 |
c369685e20560bbf76243358f222d0be338d3b77 | 43,247 | asm | Assembly | cat.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null | cat.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null | cat.asm | Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads | 1f48674b6c30c9b5bdc66f85708823fa4a261f1a | [
"MIT-0"
] | null | null | null |
_cat: file format elf32-i386
Disassembly of section .text:
00000000 <cat>:
char buf[512];
void
cat(int fd)
{
0: f3 0f 1e fb endbr32
4: 55 push %ebp
5: 89 e5 mov %esp,%ebp
7: 56 push %esi
8: 53 push %ebx
9: 8b 75 08 mov 0x8(%ebp),%esi
int n;
while((n = read(fd, buf, sizeof(buf))) > 0) {
c: 83 ec 04 sub $0x4,%esp
f: 68 00 02 00 00 push $0x200
14: 68 20 0c 00 00 push $0xc20
19: 56 push %esi
1a: e8 18 04 00 00 call 437 <read>
1f: 89 c3 mov %eax,%ebx
21: 83 c4 10 add $0x10,%esp
24: 85 c0 test %eax,%eax
26: 7e 2b jle 53 <cat+0x53>
if (write(1, buf, n) != n) {
28: 83 ec 04 sub $0x4,%esp
2b: 53 push %ebx
2c: 68 20 0c 00 00 push $0xc20
31: 6a 01 push $0x1
33: e8 07 04 00 00 call 43f <write>
38: 83 c4 10 add $0x10,%esp
3b: 39 d8 cmp %ebx,%eax
3d: 74 cd je c <cat+0xc>
printf(1, "cat: write error\n");
3f: 83 ec 08 sub $0x8,%esp
42: 68 20 08 00 00 push $0x820
47: 6a 01 push $0x1
49: e8 12 05 00 00 call 560 <printf>
exit();
4e: e8 c4 03 00 00 call 417 <exit>
}
}
if(n < 0){
53: 78 07 js 5c <cat+0x5c>
printf(1, "cat: read error\n");
exit();
}
}
55: 8d 65 f8 lea -0x8(%ebp),%esp
58: 5b pop %ebx
59: 5e pop %esi
5a: 5d pop %ebp
5b: c3 ret
printf(1, "cat: read error\n");
5c: 83 ec 08 sub $0x8,%esp
5f: 68 32 08 00 00 push $0x832
64: 6a 01 push $0x1
66: e8 f5 04 00 00 call 560 <printf>
exit();
6b: e8 a7 03 00 00 call 417 <exit>
00000070 <main>:
int
main(int argc, char *argv[])
{
70: f3 0f 1e fb endbr32
74: 8d 4c 24 04 lea 0x4(%esp),%ecx
78: 83 e4 f0 and $0xfffffff0,%esp
7b: ff 71 fc pushl -0x4(%ecx)
7e: 55 push %ebp
7f: 89 e5 mov %esp,%ebp
81: 57 push %edi
82: 56 push %esi
83: 53 push %ebx
84: 51 push %ecx
85: 83 ec 18 sub $0x18,%esp
88: 8b 01 mov (%ecx),%eax
8a: 89 45 e4 mov %eax,-0x1c(%ebp)
8d: 8b 51 04 mov 0x4(%ecx),%edx
90: 89 55 e0 mov %edx,-0x20(%ebp)
int fd, i;
if(argc <= 1){
93: 83 f8 01 cmp $0x1,%eax
96: 7e 3e jle d6 <main+0x66>
cat(0);
exit();
}
for(i = 1; i < argc; i++){
98: be 01 00 00 00 mov $0x1,%esi
9d: 3b 75 e4 cmp -0x1c(%ebp),%esi
a0: 7d 59 jge fb <main+0x8b>
if((fd = open(argv[i], 0)) < 0){
a2: 8b 45 e0 mov -0x20(%ebp),%eax
a5: 8d 3c b0 lea (%eax,%esi,4),%edi
a8: 83 ec 08 sub $0x8,%esp
ab: 6a 00 push $0x0
ad: ff 37 pushl (%edi)
af: e8 ab 03 00 00 call 45f <open>
b4: 89 c3 mov %eax,%ebx
b6: 83 c4 10 add $0x10,%esp
b9: 85 c0 test %eax,%eax
bb: 78 28 js e5 <main+0x75>
printf(1, "cat: cannot open %s\n", argv[i]);
exit();
}
cat(fd);
bd: 83 ec 0c sub $0xc,%esp
c0: 50 push %eax
c1: e8 3a ff ff ff call 0 <cat>
close(fd);
c6: 89 1c 24 mov %ebx,(%esp)
c9: e8 79 03 00 00 call 447 <close>
for(i = 1; i < argc; i++){
ce: 83 c6 01 add $0x1,%esi
d1: 83 c4 10 add $0x10,%esp
d4: eb c7 jmp 9d <main+0x2d>
cat(0);
d6: 83 ec 0c sub $0xc,%esp
d9: 6a 00 push $0x0
db: e8 20 ff ff ff call 0 <cat>
exit();
e0: e8 32 03 00 00 call 417 <exit>
printf(1, "cat: cannot open %s\n", argv[i]);
e5: 83 ec 04 sub $0x4,%esp
e8: ff 37 pushl (%edi)
ea: 68 43 08 00 00 push $0x843
ef: 6a 01 push $0x1
f1: e8 6a 04 00 00 call 560 <printf>
exit();
f6: e8 1c 03 00 00 call 417 <exit>
}
exit();
fb: e8 17 03 00 00 call 417 <exit>
00000100 <strcpy>:
ptr_storage ptr_pairs[NPROC];
int cell_full[NPROC];
char*
strcpy(char *s, const char *t)
{
100: f3 0f 1e fb endbr32
104: 55 push %ebp
105: 89 e5 mov %esp,%ebp
107: 56 push %esi
108: 53 push %ebx
109: 8b 75 08 mov 0x8(%ebp),%esi
10c: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
while((*s++ = *t++) != 0)
10f: 89 f0 mov %esi,%eax
111: 89 d1 mov %edx,%ecx
113: 83 c2 01 add $0x1,%edx
116: 89 c3 mov %eax,%ebx
118: 83 c0 01 add $0x1,%eax
11b: 0f b6 09 movzbl (%ecx),%ecx
11e: 88 0b mov %cl,(%ebx)
120: 84 c9 test %cl,%cl
122: 75 ed jne 111 <strcpy+0x11>
;
return os;
}
124: 89 f0 mov %esi,%eax
126: 5b pop %ebx
127: 5e pop %esi
128: 5d pop %ebp
129: c3 ret
0000012a <strcmp>:
int
strcmp(const char *p, const char *q)
{
12a: f3 0f 1e fb endbr32
12e: 55 push %ebp
12f: 89 e5 mov %esp,%ebp
131: 8b 4d 08 mov 0x8(%ebp),%ecx
134: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
137: 0f b6 01 movzbl (%ecx),%eax
13a: 84 c0 test %al,%al
13c: 74 0c je 14a <strcmp+0x20>
13e: 3a 02 cmp (%edx),%al
140: 75 08 jne 14a <strcmp+0x20>
p++, q++;
142: 83 c1 01 add $0x1,%ecx
145: 83 c2 01 add $0x1,%edx
148: eb ed jmp 137 <strcmp+0xd>
return (uchar)*p - (uchar)*q;
14a: 0f b6 c0 movzbl %al,%eax
14d: 0f b6 12 movzbl (%edx),%edx
150: 29 d0 sub %edx,%eax
}
152: 5d pop %ebp
153: c3 ret
00000154 <strlen>:
uint
strlen(const char *s)
{
154: f3 0f 1e fb endbr32
158: 55 push %ebp
159: 89 e5 mov %esp,%ebp
15b: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
15e: b8 00 00 00 00 mov $0x0,%eax
163: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
167: 74 05 je 16e <strlen+0x1a>
169: 83 c0 01 add $0x1,%eax
16c: eb f5 jmp 163 <strlen+0xf>
;
return n;
}
16e: 5d pop %ebp
16f: c3 ret
00000170 <memset>:
void*
memset(void *dst, int c, uint n)
{
170: f3 0f 1e fb endbr32
174: 55 push %ebp
175: 89 e5 mov %esp,%ebp
177: 57 push %edi
178: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
17b: 89 d7 mov %edx,%edi
17d: 8b 4d 10 mov 0x10(%ebp),%ecx
180: 8b 45 0c mov 0xc(%ebp),%eax
183: fc cld
184: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
186: 89 d0 mov %edx,%eax
188: 5f pop %edi
189: 5d pop %ebp
18a: c3 ret
0000018b <strchr>:
char*
strchr(const char *s, char c)
{
18b: f3 0f 1e fb endbr32
18f: 55 push %ebp
190: 89 e5 mov %esp,%ebp
192: 8b 45 08 mov 0x8(%ebp),%eax
195: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
199: 0f b6 10 movzbl (%eax),%edx
19c: 84 d2 test %dl,%dl
19e: 74 09 je 1a9 <strchr+0x1e>
if(*s == c)
1a0: 38 ca cmp %cl,%dl
1a2: 74 0a je 1ae <strchr+0x23>
for(; *s; s++)
1a4: 83 c0 01 add $0x1,%eax
1a7: eb f0 jmp 199 <strchr+0xe>
return (char*)s;
return 0;
1a9: b8 00 00 00 00 mov $0x0,%eax
}
1ae: 5d pop %ebp
1af: c3 ret
000001b0 <gets>:
char*
gets(char *buf, int max)
{
1b0: f3 0f 1e fb endbr32
1b4: 55 push %ebp
1b5: 89 e5 mov %esp,%ebp
1b7: 57 push %edi
1b8: 56 push %esi
1b9: 53 push %ebx
1ba: 83 ec 1c sub $0x1c,%esp
1bd: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
1c0: bb 00 00 00 00 mov $0x0,%ebx
1c5: 89 de mov %ebx,%esi
1c7: 83 c3 01 add $0x1,%ebx
1ca: 3b 5d 0c cmp 0xc(%ebp),%ebx
1cd: 7d 2e jge 1fd <gets+0x4d>
cc = read(0, &c, 1);
1cf: 83 ec 04 sub $0x4,%esp
1d2: 6a 01 push $0x1
1d4: 8d 45 e7 lea -0x19(%ebp),%eax
1d7: 50 push %eax
1d8: 6a 00 push $0x0
1da: e8 58 02 00 00 call 437 <read>
if(cc < 1)
1df: 83 c4 10 add $0x10,%esp
1e2: 85 c0 test %eax,%eax
1e4: 7e 17 jle 1fd <gets+0x4d>
break;
buf[i++] = c;
1e6: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
1ea: 88 04 37 mov %al,(%edi,%esi,1)
if(c == '\n' || c == '\r')
1ed: 3c 0a cmp $0xa,%al
1ef: 0f 94 c2 sete %dl
1f2: 3c 0d cmp $0xd,%al
1f4: 0f 94 c0 sete %al
1f7: 08 c2 or %al,%dl
1f9: 74 ca je 1c5 <gets+0x15>
buf[i++] = c;
1fb: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
1fd: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
201: 89 f8 mov %edi,%eax
203: 8d 65 f4 lea -0xc(%ebp),%esp
206: 5b pop %ebx
207: 5e pop %esi
208: 5f pop %edi
209: 5d pop %ebp
20a: c3 ret
0000020b <stat>:
int
stat(const char *n, struct stat *st)
{
20b: f3 0f 1e fb endbr32
20f: 55 push %ebp
210: 89 e5 mov %esp,%ebp
212: 56 push %esi
213: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
214: 83 ec 08 sub $0x8,%esp
217: 6a 00 push $0x0
219: ff 75 08 pushl 0x8(%ebp)
21c: e8 3e 02 00 00 call 45f <open>
if(fd < 0)
221: 83 c4 10 add $0x10,%esp
224: 85 c0 test %eax,%eax
226: 78 24 js 24c <stat+0x41>
228: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
22a: 83 ec 08 sub $0x8,%esp
22d: ff 75 0c pushl 0xc(%ebp)
230: 50 push %eax
231: e8 41 02 00 00 call 477 <fstat>
236: 89 c6 mov %eax,%esi
close(fd);
238: 89 1c 24 mov %ebx,(%esp)
23b: e8 07 02 00 00 call 447 <close>
return r;
240: 83 c4 10 add $0x10,%esp
}
243: 89 f0 mov %esi,%eax
245: 8d 65 f8 lea -0x8(%ebp),%esp
248: 5b pop %ebx
249: 5e pop %esi
24a: 5d pop %ebp
24b: c3 ret
return -1;
24c: be ff ff ff ff mov $0xffffffff,%esi
251: eb f0 jmp 243 <stat+0x38>
00000253 <atoi>:
int
atoi(const char *s)
{
253: f3 0f 1e fb endbr32
257: 55 push %ebp
258: 89 e5 mov %esp,%ebp
25a: 53 push %ebx
25b: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
25e: ba 00 00 00 00 mov $0x0,%edx
while('0' <= *s && *s <= '9')
263: 0f b6 01 movzbl (%ecx),%eax
266: 8d 58 d0 lea -0x30(%eax),%ebx
269: 80 fb 09 cmp $0x9,%bl
26c: 77 12 ja 280 <atoi+0x2d>
n = n*10 + *s++ - '0';
26e: 8d 1c 92 lea (%edx,%edx,4),%ebx
271: 8d 14 1b lea (%ebx,%ebx,1),%edx
274: 83 c1 01 add $0x1,%ecx
277: 0f be c0 movsbl %al,%eax
27a: 8d 54 10 d0 lea -0x30(%eax,%edx,1),%edx
27e: eb e3 jmp 263 <atoi+0x10>
return n;
}
280: 89 d0 mov %edx,%eax
282: 5b pop %ebx
283: 5d pop %ebp
284: c3 ret
00000285 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
285: f3 0f 1e fb endbr32
289: 55 push %ebp
28a: 89 e5 mov %esp,%ebp
28c: 56 push %esi
28d: 53 push %ebx
28e: 8b 75 08 mov 0x8(%ebp),%esi
291: 8b 4d 0c mov 0xc(%ebp),%ecx
294: 8b 45 10 mov 0x10(%ebp),%eax
char *dst;
const char *src;
dst = vdst;
297: 89 f2 mov %esi,%edx
src = vsrc;
while(n-- > 0)
299: 8d 58 ff lea -0x1(%eax),%ebx
29c: 85 c0 test %eax,%eax
29e: 7e 0f jle 2af <memmove+0x2a>
*dst++ = *src++;
2a0: 0f b6 01 movzbl (%ecx),%eax
2a3: 88 02 mov %al,(%edx)
2a5: 8d 49 01 lea 0x1(%ecx),%ecx
2a8: 8d 52 01 lea 0x1(%edx),%edx
while(n-- > 0)
2ab: 89 d8 mov %ebx,%eax
2ad: eb ea jmp 299 <memmove+0x14>
return vdst;
}
2af: 89 f0 mov %esi,%eax
2b1: 5b pop %ebx
2b2: 5e pop %esi
2b3: 5d pop %ebp
2b4: c3 ret
000002b5 <thread_create>:
int thread_create(void (*start_routine)(void *, void *), void *arg1, void *arg2) {
2b5: f3 0f 1e fb endbr32
2b9: 55 push %ebp
2ba: 89 e5 mov %esp,%ebp
2bc: 53 push %ebx
2bd: 83 ec 10 sub $0x10,%esp
void *curr_ptr = malloc(PGSIZE*2);
2c0: 68 00 20 00 00 push $0x2000
2c5: e8 c7 04 00 00 call 791 <malloc>
void *user_stack = curr_ptr;
if ((uint)user_stack % PGSIZE != 0) {
2ca: 83 c4 10 add $0x10,%esp
2cd: 89 c2 mov %eax,%edx
2cf: 81 e2 ff 0f 00 00 and $0xfff,%edx
2d5: 74 22 je 2f9 <thread_create+0x44>
user_stack += (PGSIZE - ((uint)user_stack % PGSIZE));
2d7: b9 00 10 00 00 mov $0x1000,%ecx
2dc: 29 d1 sub %edx,%ecx
2de: 01 c1 add %eax,%ecx
}
int i;
for (i = 0; i < NPROC; i++) {
2e0: ba 00 00 00 00 mov $0x0,%edx
2e5: 83 fa 3f cmp $0x3f,%edx
2e8: 7f 13 jg 2fd <thread_create+0x48>
if (cell_full[i] != 1) { break; }
2ea: 83 3c 95 20 11 00 00 cmpl $0x1,0x1120(,%edx,4)
2f1: 01
2f2: 75 09 jne 2fd <thread_create+0x48>
for (i = 0; i < NPROC; i++) {
2f4: 83 c2 01 add $0x1,%edx
2f7: eb ec jmp 2e5 <thread_create+0x30>
void *user_stack = curr_ptr;
2f9: 89 c1 mov %eax,%ecx
2fb: eb e3 jmp 2e0 <thread_create+0x2b>
}
if (cell_full[i] == 1) {
2fd: 83 3c 95 20 11 00 00 cmpl $0x1,0x1120(,%edx,4)
304: 01
305: 74 34 je 33b <thread_create+0x86>
return -1;
}
ptr_pairs[i].orig_ptr = curr_ptr;
307: 8d 1c 52 lea (%edx,%edx,2),%ebx
30a: c1 e3 02 shl $0x2,%ebx
30d: 89 83 20 0e 00 00 mov %eax,0xe20(%ebx)
ptr_pairs[i].offset_ptr = user_stack;
313: 89 8b 24 0e 00 00 mov %ecx,0xe24(%ebx)
cell_full[i] = 1;
319: c7 04 95 20 11 00 00 movl $0x1,0x1120(,%edx,4)
320: 01 00 00 00
// curr_ptrs->next->orig_ptr = curr_ptr;
// curr_ptrs->next->offset_ptr = user_stack;
// curr_ptrs->next->next = NULL;
// }
return clone(user_stack, start_routine, arg1, arg2);
324: ff 75 10 pushl 0x10(%ebp)
327: ff 75 0c pushl 0xc(%ebp)
32a: ff 75 08 pushl 0x8(%ebp)
32d: 51 push %ecx
32e: e8 dc 00 00 00 call 40f <clone>
333: 83 c4 10 add $0x10,%esp
}
336: 8b 5d fc mov -0x4(%ebp),%ebx
339: c9 leave
33a: c3 ret
return -1;
33b: b8 ff ff ff ff mov $0xffffffff,%eax
340: eb f4 jmp 336 <thread_create+0x81>
00000342 <thread_join>:
int thread_join(){
342: f3 0f 1e fb endbr32
346: 55 push %ebp
347: 89 e5 mov %esp,%ebp
349: 56 push %esi
34a: 53 push %ebx
34b: 83 ec 1c sub $0x1c,%esp
void* diov;
int out = join(&diov);
34e: 8d 45 f4 lea -0xc(%ebp),%eax
351: 50 push %eax
352: e8 d0 00 00 00 call 427 <join>
357: 89 c6 mov %eax,%esi
// free(curr_ptrs->orig_ptr);
// prev_ptrs->next = curr_ptrs->next;
// free(curr_ptrs);
int i;
for (i = 0; i < NPROC; i++) {
359: 83 c4 10 add $0x10,%esp
35c: bb 00 00 00 00 mov $0x0,%ebx
361: 83 fb 3f cmp $0x3f,%ebx
364: 7f 14 jg 37a <thread_join+0x38>
if (ptr_pairs[i].offset_ptr == diov) { break; }
366: 8d 04 5b lea (%ebx,%ebx,2),%eax
369: 8b 55 f4 mov -0xc(%ebp),%edx
36c: 39 14 85 24 0e 00 00 cmp %edx,0xe24(,%eax,4)
373: 74 05 je 37a <thread_join+0x38>
for (i = 0; i < NPROC; i++) {
375: 83 c3 01 add $0x1,%ebx
378: eb e7 jmp 361 <thread_join+0x1f>
}
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
37a: 8d 04 5b lea (%ebx,%ebx,2),%eax
37d: 8b 4d f4 mov -0xc(%ebp),%ecx
380: 39 0c 85 24 0e 00 00 cmp %ecx,0xe24(,%eax,4)
387: 75 26 jne 3af <thread_join+0x6d>
free(ptr_pairs[i].orig_ptr);
389: 83 ec 0c sub $0xc,%esp
38c: ff 34 85 20 0e 00 00 pushl 0xe20(,%eax,4)
393: e8 35 03 00 00 call 6cd <free>
cell_full[i] = 0;
398: c7 04 9d 20 11 00 00 movl $0x0,0x1120(,%ebx,4)
39f: 00 00 00 00
return out;
3a3: 83 c4 10 add $0x10,%esp
}
3a6: 89 f0 mov %esi,%eax
3a8: 8d 65 f8 lea -0x8(%ebp),%esp
3ab: 5b pop %ebx
3ac: 5e pop %esi
3ad: 5d pop %ebp
3ae: c3 ret
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
3af: be ff ff ff ff mov $0xffffffff,%esi
3b4: eb f0 jmp 3a6 <thread_join+0x64>
000003b6 <lock_init>:
: "memory"
);
return value;
}
void lock_init(lock_t *lock) {
3b6: f3 0f 1e fb endbr32
3ba: 55 push %ebp
3bb: 89 e5 mov %esp,%ebp
3bd: 8b 45 08 mov 0x8(%ebp),%eax
lock->ticket = 0;
3c0: c7 00 00 00 00 00 movl $0x0,(%eax)
lock->turn = 0;
3c6: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
}
3cd: 5d pop %ebp
3ce: c3 ret
000003cf <lock_acquire>:
void lock_acquire(lock_t *lock) {
3cf: f3 0f 1e fb endbr32
3d3: 55 push %ebp
3d4: 89 e5 mov %esp,%ebp
3d6: 8b 55 08 mov 0x8(%ebp),%edx
__asm__ volatile("lock; xaddl %0, %1"
3d9: b9 01 00 00 00 mov $0x1,%ecx
3de: f0 0f c1 0a lock xadd %ecx,(%edx)
3e2: b8 00 00 00 00 mov $0x0,%eax
3e7: f0 0f c1 42 04 lock xadd %eax,0x4(%edx)
int myturn = fetch_and_add(&lock->ticket, 1);
while( fetch_and_add(&lock->turn, 0) != myturn ) { //changed
3ec: 39 c1 cmp %eax,%ecx
3ee: 75 f2 jne 3e2 <lock_acquire+0x13>
; // spin
}
}
3f0: 5d pop %ebp
3f1: c3 ret
000003f2 <lock_release>:
void lock_release(lock_t *lock) {
3f2: f3 0f 1e fb endbr32
3f6: 55 push %ebp
3f7: 89 e5 mov %esp,%ebp
3f9: 8b 55 08 mov 0x8(%ebp),%edx
lock->turn = lock->turn + 1;
3fc: 8b 42 04 mov 0x4(%edx),%eax
3ff: 83 c0 01 add $0x1,%eax
402: 89 42 04 mov %eax,0x4(%edx)
}
405: 5d pop %ebp
406: c3 ret
00000407 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
407: b8 01 00 00 00 mov $0x1,%eax
40c: cd 40 int $0x40
40e: c3 ret
0000040f <clone>:
SYSCALL(clone)
40f: b8 16 00 00 00 mov $0x16,%eax
414: cd 40 int $0x40
416: c3 ret
00000417 <exit>:
SYSCALL(exit)
417: b8 02 00 00 00 mov $0x2,%eax
41c: cd 40 int $0x40
41e: c3 ret
0000041f <wait>:
SYSCALL(wait)
41f: b8 03 00 00 00 mov $0x3,%eax
424: cd 40 int $0x40
426: c3 ret
00000427 <join>:
SYSCALL(join)
427: b8 17 00 00 00 mov $0x17,%eax
42c: cd 40 int $0x40
42e: c3 ret
0000042f <pipe>:
SYSCALL(pipe)
42f: b8 04 00 00 00 mov $0x4,%eax
434: cd 40 int $0x40
436: c3 ret
00000437 <read>:
SYSCALL(read)
437: b8 05 00 00 00 mov $0x5,%eax
43c: cd 40 int $0x40
43e: c3 ret
0000043f <write>:
SYSCALL(write)
43f: b8 10 00 00 00 mov $0x10,%eax
444: cd 40 int $0x40
446: c3 ret
00000447 <close>:
SYSCALL(close)
447: b8 15 00 00 00 mov $0x15,%eax
44c: cd 40 int $0x40
44e: c3 ret
0000044f <kill>:
SYSCALL(kill)
44f: b8 06 00 00 00 mov $0x6,%eax
454: cd 40 int $0x40
456: c3 ret
00000457 <exec>:
SYSCALL(exec)
457: b8 07 00 00 00 mov $0x7,%eax
45c: cd 40 int $0x40
45e: c3 ret
0000045f <open>:
SYSCALL(open)
45f: b8 0f 00 00 00 mov $0xf,%eax
464: cd 40 int $0x40
466: c3 ret
00000467 <mknod>:
SYSCALL(mknod)
467: b8 11 00 00 00 mov $0x11,%eax
46c: cd 40 int $0x40
46e: c3 ret
0000046f <unlink>:
SYSCALL(unlink)
46f: b8 12 00 00 00 mov $0x12,%eax
474: cd 40 int $0x40
476: c3 ret
00000477 <fstat>:
SYSCALL(fstat)
477: b8 08 00 00 00 mov $0x8,%eax
47c: cd 40 int $0x40
47e: c3 ret
0000047f <link>:
SYSCALL(link)
47f: b8 13 00 00 00 mov $0x13,%eax
484: cd 40 int $0x40
486: c3 ret
00000487 <mkdir>:
SYSCALL(mkdir)
487: b8 14 00 00 00 mov $0x14,%eax
48c: cd 40 int $0x40
48e: c3 ret
0000048f <chdir>:
SYSCALL(chdir)
48f: b8 09 00 00 00 mov $0x9,%eax
494: cd 40 int $0x40
496: c3 ret
00000497 <dup>:
SYSCALL(dup)
497: b8 0a 00 00 00 mov $0xa,%eax
49c: cd 40 int $0x40
49e: c3 ret
0000049f <getpid>:
SYSCALL(getpid)
49f: b8 0b 00 00 00 mov $0xb,%eax
4a4: cd 40 int $0x40
4a6: c3 ret
000004a7 <sbrk>:
SYSCALL(sbrk)
4a7: b8 0c 00 00 00 mov $0xc,%eax
4ac: cd 40 int $0x40
4ae: c3 ret
000004af <sleep>:
SYSCALL(sleep)
4af: b8 0d 00 00 00 mov $0xd,%eax
4b4: cd 40 int $0x40
4b6: c3 ret
000004b7 <uptime>:
SYSCALL(uptime)
4b7: b8 0e 00 00 00 mov $0xe,%eax
4bc: cd 40 int $0x40
4be: c3 ret
000004bf <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
4bf: 55 push %ebp
4c0: 89 e5 mov %esp,%ebp
4c2: 83 ec 1c sub $0x1c,%esp
4c5: 88 55 f4 mov %dl,-0xc(%ebp)
write(fd, &c, 1);
4c8: 6a 01 push $0x1
4ca: 8d 55 f4 lea -0xc(%ebp),%edx
4cd: 52 push %edx
4ce: 50 push %eax
4cf: e8 6b ff ff ff call 43f <write>
}
4d4: 83 c4 10 add $0x10,%esp
4d7: c9 leave
4d8: c3 ret
000004d9 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4d9: 55 push %ebp
4da: 89 e5 mov %esp,%ebp
4dc: 57 push %edi
4dd: 56 push %esi
4de: 53 push %ebx
4df: 83 ec 2c sub $0x2c,%esp
4e2: 89 45 d0 mov %eax,-0x30(%ebp)
4e5: 89 d6 mov %edx,%esi
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4e7: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
4eb: 0f 95 c2 setne %dl
4ee: 89 f0 mov %esi,%eax
4f0: c1 e8 1f shr $0x1f,%eax
4f3: 84 c2 test %al,%dl
4f5: 74 42 je 539 <printint+0x60>
neg = 1;
x = -xx;
4f7: f7 de neg %esi
neg = 1;
4f9: c7 45 d4 01 00 00 00 movl $0x1,-0x2c(%ebp)
} else {
x = xx;
}
i = 0;
500: bb 00 00 00 00 mov $0x0,%ebx
do{
buf[i++] = digits[x % base];
505: 89 f0 mov %esi,%eax
507: ba 00 00 00 00 mov $0x0,%edx
50c: f7 f1 div %ecx
50e: 89 df mov %ebx,%edi
510: 83 c3 01 add $0x1,%ebx
513: 0f b6 92 60 08 00 00 movzbl 0x860(%edx),%edx
51a: 88 54 3d d8 mov %dl,-0x28(%ebp,%edi,1)
}while((x /= base) != 0);
51e: 89 f2 mov %esi,%edx
520: 89 c6 mov %eax,%esi
522: 39 d1 cmp %edx,%ecx
524: 76 df jbe 505 <printint+0x2c>
if(neg)
526: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
52a: 74 2f je 55b <printint+0x82>
buf[i++] = '-';
52c: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
531: 8d 5f 02 lea 0x2(%edi),%ebx
534: 8b 75 d0 mov -0x30(%ebp),%esi
537: eb 15 jmp 54e <printint+0x75>
neg = 0;
539: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
540: eb be jmp 500 <printint+0x27>
while(--i >= 0)
putc(fd, buf[i]);
542: 0f be 54 1d d8 movsbl -0x28(%ebp,%ebx,1),%edx
547: 89 f0 mov %esi,%eax
549: e8 71 ff ff ff call 4bf <putc>
while(--i >= 0)
54e: 83 eb 01 sub $0x1,%ebx
551: 79 ef jns 542 <printint+0x69>
}
553: 83 c4 2c add $0x2c,%esp
556: 5b pop %ebx
557: 5e pop %esi
558: 5f pop %edi
559: 5d pop %ebp
55a: c3 ret
55b: 8b 75 d0 mov -0x30(%ebp),%esi
55e: eb ee jmp 54e <printint+0x75>
00000560 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
560: f3 0f 1e fb endbr32
564: 55 push %ebp
565: 89 e5 mov %esp,%ebp
567: 57 push %edi
568: 56 push %esi
569: 53 push %ebx
56a: 83 ec 1c sub $0x1c,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
56d: 8d 45 10 lea 0x10(%ebp),%eax
570: 89 45 e4 mov %eax,-0x1c(%ebp)
state = 0;
573: be 00 00 00 00 mov $0x0,%esi
for(i = 0; fmt[i]; i++){
578: bb 00 00 00 00 mov $0x0,%ebx
57d: eb 14 jmp 593 <printf+0x33>
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
57f: 89 fa mov %edi,%edx
581: 8b 45 08 mov 0x8(%ebp),%eax
584: e8 36 ff ff ff call 4bf <putc>
589: eb 05 jmp 590 <printf+0x30>
}
} else if(state == '%'){
58b: 83 fe 25 cmp $0x25,%esi
58e: 74 25 je 5b5 <printf+0x55>
for(i = 0; fmt[i]; i++){
590: 83 c3 01 add $0x1,%ebx
593: 8b 45 0c mov 0xc(%ebp),%eax
596: 0f b6 04 18 movzbl (%eax,%ebx,1),%eax
59a: 84 c0 test %al,%al
59c: 0f 84 23 01 00 00 je 6c5 <printf+0x165>
c = fmt[i] & 0xff;
5a2: 0f be f8 movsbl %al,%edi
5a5: 0f b6 c0 movzbl %al,%eax
if(state == 0){
5a8: 85 f6 test %esi,%esi
5aa: 75 df jne 58b <printf+0x2b>
if(c == '%'){
5ac: 83 f8 25 cmp $0x25,%eax
5af: 75 ce jne 57f <printf+0x1f>
state = '%';
5b1: 89 c6 mov %eax,%esi
5b3: eb db jmp 590 <printf+0x30>
if(c == 'd'){
5b5: 83 f8 64 cmp $0x64,%eax
5b8: 74 49 je 603 <printf+0xa3>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5ba: 83 f8 78 cmp $0x78,%eax
5bd: 0f 94 c1 sete %cl
5c0: 83 f8 70 cmp $0x70,%eax
5c3: 0f 94 c2 sete %dl
5c6: 08 d1 or %dl,%cl
5c8: 75 63 jne 62d <printf+0xcd>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5ca: 83 f8 73 cmp $0x73,%eax
5cd: 0f 84 84 00 00 00 je 657 <printf+0xf7>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5d3: 83 f8 63 cmp $0x63,%eax
5d6: 0f 84 b7 00 00 00 je 693 <printf+0x133>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5dc: 83 f8 25 cmp $0x25,%eax
5df: 0f 84 cc 00 00 00 je 6b1 <printf+0x151>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
5e5: ba 25 00 00 00 mov $0x25,%edx
5ea: 8b 45 08 mov 0x8(%ebp),%eax
5ed: e8 cd fe ff ff call 4bf <putc>
putc(fd, c);
5f2: 89 fa mov %edi,%edx
5f4: 8b 45 08 mov 0x8(%ebp),%eax
5f7: e8 c3 fe ff ff call 4bf <putc>
}
state = 0;
5fc: be 00 00 00 00 mov $0x0,%esi
601: eb 8d jmp 590 <printf+0x30>
printint(fd, *ap, 10, 1);
603: 8b 7d e4 mov -0x1c(%ebp),%edi
606: 8b 17 mov (%edi),%edx
608: 83 ec 0c sub $0xc,%esp
60b: 6a 01 push $0x1
60d: b9 0a 00 00 00 mov $0xa,%ecx
612: 8b 45 08 mov 0x8(%ebp),%eax
615: e8 bf fe ff ff call 4d9 <printint>
ap++;
61a: 83 c7 04 add $0x4,%edi
61d: 89 7d e4 mov %edi,-0x1c(%ebp)
620: 83 c4 10 add $0x10,%esp
state = 0;
623: be 00 00 00 00 mov $0x0,%esi
628: e9 63 ff ff ff jmp 590 <printf+0x30>
printint(fd, *ap, 16, 0);
62d: 8b 7d e4 mov -0x1c(%ebp),%edi
630: 8b 17 mov (%edi),%edx
632: 83 ec 0c sub $0xc,%esp
635: 6a 00 push $0x0
637: b9 10 00 00 00 mov $0x10,%ecx
63c: 8b 45 08 mov 0x8(%ebp),%eax
63f: e8 95 fe ff ff call 4d9 <printint>
ap++;
644: 83 c7 04 add $0x4,%edi
647: 89 7d e4 mov %edi,-0x1c(%ebp)
64a: 83 c4 10 add $0x10,%esp
state = 0;
64d: be 00 00 00 00 mov $0x0,%esi
652: e9 39 ff ff ff jmp 590 <printf+0x30>
s = (char*)*ap;
657: 8b 45 e4 mov -0x1c(%ebp),%eax
65a: 8b 30 mov (%eax),%esi
ap++;
65c: 83 c0 04 add $0x4,%eax
65f: 89 45 e4 mov %eax,-0x1c(%ebp)
if(s == 0)
662: 85 f6 test %esi,%esi
664: 75 28 jne 68e <printf+0x12e>
s = "(null)";
666: be 58 08 00 00 mov $0x858,%esi
66b: 8b 7d 08 mov 0x8(%ebp),%edi
66e: eb 0d jmp 67d <printf+0x11d>
putc(fd, *s);
670: 0f be d2 movsbl %dl,%edx
673: 89 f8 mov %edi,%eax
675: e8 45 fe ff ff call 4bf <putc>
s++;
67a: 83 c6 01 add $0x1,%esi
while(*s != 0){
67d: 0f b6 16 movzbl (%esi),%edx
680: 84 d2 test %dl,%dl
682: 75 ec jne 670 <printf+0x110>
state = 0;
684: be 00 00 00 00 mov $0x0,%esi
689: e9 02 ff ff ff jmp 590 <printf+0x30>
68e: 8b 7d 08 mov 0x8(%ebp),%edi
691: eb ea jmp 67d <printf+0x11d>
putc(fd, *ap);
693: 8b 7d e4 mov -0x1c(%ebp),%edi
696: 0f be 17 movsbl (%edi),%edx
699: 8b 45 08 mov 0x8(%ebp),%eax
69c: e8 1e fe ff ff call 4bf <putc>
ap++;
6a1: 83 c7 04 add $0x4,%edi
6a4: 89 7d e4 mov %edi,-0x1c(%ebp)
state = 0;
6a7: be 00 00 00 00 mov $0x0,%esi
6ac: e9 df fe ff ff jmp 590 <printf+0x30>
putc(fd, c);
6b1: 89 fa mov %edi,%edx
6b3: 8b 45 08 mov 0x8(%ebp),%eax
6b6: e8 04 fe ff ff call 4bf <putc>
state = 0;
6bb: be 00 00 00 00 mov $0x0,%esi
6c0: e9 cb fe ff ff jmp 590 <printf+0x30>
}
}
}
6c5: 8d 65 f4 lea -0xc(%ebp),%esp
6c8: 5b pop %ebx
6c9: 5e pop %esi
6ca: 5f pop %edi
6cb: 5d pop %ebp
6cc: c3 ret
000006cd <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6cd: f3 0f 1e fb endbr32
6d1: 55 push %ebp
6d2: 89 e5 mov %esp,%ebp
6d4: 57 push %edi
6d5: 56 push %esi
6d6: 53 push %ebx
6d7: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
6da: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6dd: a1 00 0c 00 00 mov 0xc00,%eax
6e2: eb 02 jmp 6e6 <free+0x19>
6e4: 89 d0 mov %edx,%eax
6e6: 39 c8 cmp %ecx,%eax
6e8: 73 04 jae 6ee <free+0x21>
6ea: 39 08 cmp %ecx,(%eax)
6ec: 77 12 ja 700 <free+0x33>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6ee: 8b 10 mov (%eax),%edx
6f0: 39 c2 cmp %eax,%edx
6f2: 77 f0 ja 6e4 <free+0x17>
6f4: 39 c8 cmp %ecx,%eax
6f6: 72 08 jb 700 <free+0x33>
6f8: 39 ca cmp %ecx,%edx
6fa: 77 04 ja 700 <free+0x33>
6fc: 89 d0 mov %edx,%eax
6fe: eb e6 jmp 6e6 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
700: 8b 73 fc mov -0x4(%ebx),%esi
703: 8d 3c f1 lea (%ecx,%esi,8),%edi
706: 8b 10 mov (%eax),%edx
708: 39 d7 cmp %edx,%edi
70a: 74 19 je 725 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
70c: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
70f: 8b 50 04 mov 0x4(%eax),%edx
712: 8d 34 d0 lea (%eax,%edx,8),%esi
715: 39 ce cmp %ecx,%esi
717: 74 1b je 734 <free+0x67>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
719: 89 08 mov %ecx,(%eax)
freep = p;
71b: a3 00 0c 00 00 mov %eax,0xc00
}
720: 5b pop %ebx
721: 5e pop %esi
722: 5f pop %edi
723: 5d pop %ebp
724: c3 ret
bp->s.size += p->s.ptr->s.size;
725: 03 72 04 add 0x4(%edx),%esi
728: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
72b: 8b 10 mov (%eax),%edx
72d: 8b 12 mov (%edx),%edx
72f: 89 53 f8 mov %edx,-0x8(%ebx)
732: eb db jmp 70f <free+0x42>
p->s.size += bp->s.size;
734: 03 53 fc add -0x4(%ebx),%edx
737: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
73a: 8b 53 f8 mov -0x8(%ebx),%edx
73d: 89 10 mov %edx,(%eax)
73f: eb da jmp 71b <free+0x4e>
00000741 <morecore>:
static Header*
morecore(uint nu)
{
741: 55 push %ebp
742: 89 e5 mov %esp,%ebp
744: 53 push %ebx
745: 83 ec 04 sub $0x4,%esp
748: 89 c3 mov %eax,%ebx
char *p;
Header *hp;
if(nu < 4096)
74a: 3d ff 0f 00 00 cmp $0xfff,%eax
74f: 77 05 ja 756 <morecore+0x15>
nu = 4096;
751: bb 00 10 00 00 mov $0x1000,%ebx
p = sbrk(nu * sizeof(Header));
756: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax
75d: 83 ec 0c sub $0xc,%esp
760: 50 push %eax
761: e8 41 fd ff ff call 4a7 <sbrk>
if(p == (char*)-1)
766: 83 c4 10 add $0x10,%esp
769: 83 f8 ff cmp $0xffffffff,%eax
76c: 74 1c je 78a <morecore+0x49>
return 0;
hp = (Header*)p;
hp->s.size = nu;
76e: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
771: 83 c0 08 add $0x8,%eax
774: 83 ec 0c sub $0xc,%esp
777: 50 push %eax
778: e8 50 ff ff ff call 6cd <free>
return freep;
77d: a1 00 0c 00 00 mov 0xc00,%eax
782: 83 c4 10 add $0x10,%esp
}
785: 8b 5d fc mov -0x4(%ebp),%ebx
788: c9 leave
789: c3 ret
return 0;
78a: b8 00 00 00 00 mov $0x0,%eax
78f: eb f4 jmp 785 <morecore+0x44>
00000791 <malloc>:
void*
malloc(uint nbytes)
{
791: f3 0f 1e fb endbr32
795: 55 push %ebp
796: 89 e5 mov %esp,%ebp
798: 53 push %ebx
799: 83 ec 04 sub $0x4,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
79c: 8b 45 08 mov 0x8(%ebp),%eax
79f: 8d 58 07 lea 0x7(%eax),%ebx
7a2: c1 eb 03 shr $0x3,%ebx
7a5: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
7a8: 8b 0d 00 0c 00 00 mov 0xc00,%ecx
7ae: 85 c9 test %ecx,%ecx
7b0: 74 04 je 7b6 <malloc+0x25>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7b2: 8b 01 mov (%ecx),%eax
7b4: eb 4b jmp 801 <malloc+0x70>
base.s.ptr = freep = prevp = &base;
7b6: c7 05 00 0c 00 00 04 movl $0xc04,0xc00
7bd: 0c 00 00
7c0: c7 05 04 0c 00 00 04 movl $0xc04,0xc04
7c7: 0c 00 00
base.s.size = 0;
7ca: c7 05 08 0c 00 00 00 movl $0x0,0xc08
7d1: 00 00 00
base.s.ptr = freep = prevp = &base;
7d4: b9 04 0c 00 00 mov $0xc04,%ecx
7d9: eb d7 jmp 7b2 <malloc+0x21>
if(p->s.size >= nunits){
if(p->s.size == nunits)
7db: 74 1a je 7f7 <malloc+0x66>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
7dd: 29 da sub %ebx,%edx
7df: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
7e2: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
7e5: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
7e8: 89 0d 00 0c 00 00 mov %ecx,0xc00
return (void*)(p + 1);
7ee: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
7f1: 83 c4 04 add $0x4,%esp
7f4: 5b pop %ebx
7f5: 5d pop %ebp
7f6: c3 ret
prevp->s.ptr = p->s.ptr;
7f7: 8b 10 mov (%eax),%edx
7f9: 89 11 mov %edx,(%ecx)
7fb: eb eb jmp 7e8 <malloc+0x57>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7fd: 89 c1 mov %eax,%ecx
7ff: 8b 00 mov (%eax),%eax
if(p->s.size >= nunits){
801: 8b 50 04 mov 0x4(%eax),%edx
804: 39 da cmp %ebx,%edx
806: 73 d3 jae 7db <malloc+0x4a>
if(p == freep)
808: 39 05 00 0c 00 00 cmp %eax,0xc00
80e: 75 ed jne 7fd <malloc+0x6c>
if((p = morecore(nunits)) == 0)
810: 89 d8 mov %ebx,%eax
812: e8 2a ff ff ff call 741 <morecore>
817: 85 c0 test %eax,%eax
819: 75 e2 jne 7fd <malloc+0x6c>
81b: eb d4 jmp 7f1 <malloc+0x60>
| 32.987796 | 82 | 0.422873 |
8d1c25ced91f8499f9f109de5a312697b5cf449b | 1,969 | asm | Assembly | Kernel/asm/interrupt.asm | lmarzora/TPE | 9410040c58904b8321f240b428f930a26333e48f | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/interrupt.asm | lmarzora/TPE | 9410040c58904b8321f240b428f930a26333e48f | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/interrupt.asm | lmarzora/TPE | 9410040c58904b8321f240b428f930a26333e48f | [
"BSD-3-Clause"
] | null | null | null | ;PIT
GLOBAL pit_handler
GLOBAL call_pit
GLOBAL sti
GLOBAL cli
GLOBAL halt
GLOBAL keyboard_handler
EXTERN irqDispatcher
GLOBAL pic
GLOBAL getKey
GLOBAL int80handler
GLOBAL pageFaultHandler
GLOBAL int81handler
GLOBAL int82handler
GLOBAL int83handler
GLOBAL int84handler
GLOBAL getFlags
GLOBAL doubleFaultHandler
EXTERN syscall
EXTERN schedule
EXTERN ncPrintHex
EXTERN ncNewline
EXTERN pageFault
EXTERN processHandler
EXTERN msgQueueHandler
EXTERN semaphoreHandler
GLOBAL beyondStack
GLOBAL moreStack
EXTERN cpuHandler
%macro irqHandlerMaster 1
mov rdi, %1
call irqDispatcher
;signal pic
mov al, 20h
out 20h, al
iretq
%endmacro
%macro pushState 0
push rax
push rbx
push rcx
push rdx
push rbp
push rdi
push rsi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
push fs
push gs
%endmacro
%macro popState 0
pop gs
pop fs
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsi
pop rdi
pop rbp
pop rdx
pop rcx
pop rbx
pop rax
%endmacro
keyboard_handler:
irqHandlerMaster 1
pit_handler:
pushState
mov rdi, rsp
call schedule
mov rsp, rax
popState
mov al, 20h
out 20h, al
iretq
int80handler:
; sti
call syscall
iretq
int81handler:
call processHandler
iretq
int82handler:
call msgQueueHandler
iretq
int83handler:
call semaphoreHandler
iretq
int84handler:
call cpuHandler
iretq
getKey:
; push ebp
; mov ebp,esp
mov rax, 0
; mov eax,0
; in ax,60h
in ax, 60h
; leave
ret
sti:
sti
ret
cli:
cli
ret
halt:
hlt
ret
pic:
mov al, 0xfc
out 0x21, al
mov al, 0xff
out 0xA1, al
sti
ret
call_pit:
int 20h
ret
getFlags:
pushf
mov rax, 0
pop rax
ret
doubleFaultHandler:
cli
hlt
pageFaultHandler:
;cli
;hlt
pop rdi
mov rsi, cr2
call pageFault
;cli
;hlt
iretq
beyondStack:
mov rbx, 12
mov rdx, rsp
sub rdx, 0x900000
mov [rdx], rbx
ret
moreStack:
mov rbx, 12
mov rdx, rsp
sub rdx, 0x300000
mov [rdx], rbx
ret
| 9.512077 | 25 | 0.736414 |
86f1414ed850e92eff66aa30d2dfeeb67f3e221c | 9,575 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/x86_64/k8/mulmid_basecase.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | libtool/src/gmp-6.1.2/mpn/x86_64/k8/mulmid_basecase.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | libtool/src/gmp-6.1.2/mpn/x86_64/k8/mulmid_basecase.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl AMD64 mpn_mulmid_basecase
dnl Contributed by David Harvey.
dnl Copyright 2011, 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C K8,K9: 2.375 (2.5 when un - vn is "small")
C K10: ?
C P4: ?
C P6-15: ?
C INPUT PARAMETERS
define(`rp', `%rdi')
define(`up', `%rsi')
define(`un_param',`%rdx')
define(`vp_param',`%rcx')
define(`vn', `%r8')
define(`v0', `%r12')
define(`v1', `%r9')
define(`w0', `%rbx')
define(`w1', `%rcx')
define(`w2', `%rbp')
define(`w3', `%r10')
define(`n', `%r11')
define(`outer_addr', `%r14')
define(`un', `%r13')
define(`vp', `%r15')
define(`vp_inner', `%r10')
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_mulmid_basecase)
FUNC_ENTRY(4)
IFDOS(` mov 56(%rsp), %r8d ')
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
mov vp_param, vp
C use un for row length (= un_param - vn + 1)
lea 1(un_param), un
sub vn, un
lea (rp,un,8), rp
cmp $4, un C TODO: needs tuning
jc L(diagonal)
lea (up,un_param,8), up
test $1, vn
jz L(mul_2)
C ===========================================================
C mul_1 for vp[0] if vn is odd
L(mul_1):
mov R32(un), R32(w0)
neg un
mov (up,un,8), %rax
mov (vp), v0
mul v0
and $-4, un C round down to multiple of 4
mov un, n
and $3, R32(w0)
jz L(mul_1_prologue_0)
cmp $2, R32(w0)
jc L(mul_1_prologue_1)
jz L(mul_1_prologue_2)
L(mul_1_prologue_3):
mov %rax, w3
mov %rdx, w0
lea L(addmul_prologue_3)(%rip), outer_addr
jmp L(mul_1_entry_3)
ALIGN(16)
L(mul_1_prologue_0):
mov %rax, w2
mov %rdx, w3 C note already w0 == 0
lea L(addmul_prologue_0)(%rip), outer_addr
jmp L(mul_1_entry_0)
ALIGN(16)
L(mul_1_prologue_1):
add $4, n
mov %rax, w1
mov %rdx, w2
mov $0, R32(w3)
mov (up,n,8), %rax
lea L(addmul_prologue_1)(%rip), outer_addr
jmp L(mul_1_entry_1)
ALIGN(16)
L(mul_1_prologue_2):
mov %rax, w0
mov %rdx, w1
mov 24(up,n,8), %rax
mov $0, R32(w2)
mov $0, R32(w3)
lea L(addmul_prologue_2)(%rip), outer_addr
jmp L(mul_1_entry_2)
C this loop is 10 c/loop = 2.5 c/l on K8
ALIGN(16)
L(mul_1_top):
mov w0, -16(rp,n,8)
add %rax, w1
mov (up,n,8), %rax
adc %rdx, w2
L(mul_1_entry_1):
mov $0, R32(w0)
mul v0
mov w1, -8(rp,n,8)
add %rax, w2
adc %rdx, w3
L(mul_1_entry_0):
mov 8(up,n,8), %rax
mul v0
mov w2, (rp,n,8)
add %rax, w3
adc %rdx, w0
L(mul_1_entry_3):
mov 16(up,n,8), %rax
mul v0
mov w3, 8(rp,n,8)
mov $0, R32(w2) C zero
mov w2, w3 C zero
add %rax, w0
mov 24(up,n,8), %rax
mov w2, w1 C zero
adc %rdx, w1
L(mul_1_entry_2):
mul v0
add $4, n
js L(mul_1_top)
mov w0, -16(rp)
add %rax, w1
mov w1, -8(rp)
mov w2, 8(rp) C zero last limb of output
adc %rdx, w2
mov w2, (rp)
dec vn
jz L(ret)
lea -8(up), up
lea 8(vp), vp
mov un, n
mov (vp), v0
mov 8(vp), v1
jmp *outer_addr
C ===========================================================
C mul_2 for vp[0], vp[1] if vn is even
ALIGN(16)
L(mul_2):
mov R32(un), R32(w0)
neg un
mov -8(up,un,8), %rax
mov (vp), v0
mov 8(vp), v1
mul v1
and $-4, un C round down to multiple of 4
mov un, n
and $3, R32(w0)
jz L(mul_2_prologue_0)
cmp $2, R32(w0)
jc L(mul_2_prologue_1)
jz L(mul_2_prologue_2)
L(mul_2_prologue_3):
mov %rax, w1
mov %rdx, w2
lea L(addmul_prologue_3)(%rip), outer_addr
jmp L(mul_2_entry_3)
ALIGN(16)
L(mul_2_prologue_0):
mov %rax, w0
mov %rdx, w1
lea L(addmul_prologue_0)(%rip), outer_addr
jmp L(mul_2_entry_0)
ALIGN(16)
L(mul_2_prologue_1):
mov %rax, w3
mov %rdx, w0
mov $0, R32(w1)
lea L(addmul_prologue_1)(%rip), outer_addr
jmp L(mul_2_entry_1)
ALIGN(16)
L(mul_2_prologue_2):
mov %rax, w2
mov %rdx, w3
mov $0, R32(w0)
mov 16(up,n,8), %rax
lea L(addmul_prologue_2)(%rip), outer_addr
jmp L(mul_2_entry_2)
C this loop is 18 c/loop = 2.25 c/l on K8
ALIGN(16)
L(mul_2_top):
mov -8(up,n,8), %rax
mul v1
add %rax, w0
adc %rdx, w1
L(mul_2_entry_0):
mov $0, R32(w2)
mov (up,n,8), %rax
mul v0
add %rax, w0
mov (up,n,8), %rax
adc %rdx, w1
adc $0, R32(w2)
mul v1
add %rax, w1
mov w0, (rp,n,8)
adc %rdx, w2
L(mul_2_entry_3):
mov 8(up,n,8), %rax
mul v0
mov $0, R32(w3)
add %rax, w1
adc %rdx, w2
mov $0, R32(w0)
adc $0, R32(w3)
mov 8(up,n,8), %rax
mov w1, 8(rp,n,8)
mul v1
add %rax, w2
mov 16(up,n,8), %rax
adc %rdx, w3
L(mul_2_entry_2):
mov $0, R32(w1)
mul v0
add %rax, w2
mov 16(up,n,8), %rax
adc %rdx, w3
adc $0, R32(w0)
mul v1
add %rax, w3
mov w2, 16(rp,n,8)
adc %rdx, w0
L(mul_2_entry_1):
mov 24(up,n,8), %rax
mul v0
add %rax, w3
adc %rdx, w0
adc $0, R32(w1)
add $4, n
mov w3, -8(rp,n,8)
jnz L(mul_2_top)
mov w0, (rp)
mov w1, 8(rp)
sub $2, vn
jz L(ret)
lea 16(vp), vp
lea -16(up), up
mov un, n
mov (vp), v0
mov 8(vp), v1
jmp *outer_addr
C ===========================================================
C addmul_2 for remaining vp's
ALIGN(16)
L(addmul_prologue_0):
mov -8(up,n,8), %rax
mul v1
mov %rax, w1
mov %rdx, w2
mov $0, R32(w3)
jmp L(addmul_entry_0)
ALIGN(16)
L(addmul_prologue_1):
mov 16(up,n,8), %rax
mul v1
mov %rax, w0
mov %rdx, w1
mov $0, R32(w2)
mov 24(up,n,8), %rax
jmp L(addmul_entry_1)
ALIGN(16)
L(addmul_prologue_2):
mov 8(up,n,8), %rax
mul v1
mov %rax, w3
mov %rdx, w0
mov $0, R32(w1)
jmp L(addmul_entry_2)
ALIGN(16)
L(addmul_prologue_3):
mov (up,n,8), %rax
mul v1
mov %rax, w2
mov %rdx, w3
mov $0, R32(w0)
mov $0, R32(w1)
jmp L(addmul_entry_3)
C this loop is 19 c/loop = 2.375 c/l on K8
ALIGN(16)
L(addmul_top):
mov $0, R32(w3)
add %rax, w0
mov -8(up,n,8), %rax
adc %rdx, w1
adc $0, R32(w2)
mul v1
add w0, -8(rp,n,8)
adc %rax, w1
adc %rdx, w2
L(addmul_entry_0):
mov (up,n,8), %rax
mul v0
add %rax, w1
mov (up,n,8), %rax
adc %rdx, w2
adc $0, R32(w3)
mul v1
add w1, (rp,n,8)
mov $0, R32(w1)
adc %rax, w2
mov $0, R32(w0)
adc %rdx, w3
L(addmul_entry_3):
mov 8(up,n,8), %rax
mul v0
add %rax, w2
mov 8(up,n,8), %rax
adc %rdx, w3
adc $0, R32(w0)
mul v1
add w2, 8(rp,n,8)
adc %rax, w3
adc %rdx, w0
L(addmul_entry_2):
mov 16(up,n,8), %rax
mul v0
add %rax, w3
mov 16(up,n,8), %rax
adc %rdx, w0
adc $0, R32(w1)
mul v1
add w3, 16(rp,n,8)
nop C don't ask...
adc %rax, w0
mov $0, R32(w2)
mov 24(up,n,8), %rax
adc %rdx, w1
L(addmul_entry_1):
mul v0
add $4, n
jnz L(addmul_top)
add %rax, w0
adc %rdx, w1
adc $0, R32(w2)
add w0, -8(rp)
adc w1, (rp)
adc w2, 8(rp)
sub $2, vn
jz L(ret)
lea 16(vp), vp
lea -16(up), up
mov un, n
mov (vp), v0
mov 8(vp), v1
jmp *outer_addr
C ===========================================================
C accumulate along diagonals if un - vn is small
ALIGN(16)
L(diagonal):
xor R32(w0), R32(w0)
xor R32(w1), R32(w1)
xor R32(w2), R32(w2)
neg un
mov R32(vn), %eax
and $3, %eax
jz L(diag_prologue_0)
cmp $2, %eax
jc L(diag_prologue_1)
jz L(diag_prologue_2)
L(diag_prologue_3):
lea -8(vp), vp
mov vp, vp_inner
add $1, vn
mov vn, n
lea L(diag_entry_3)(%rip), outer_addr
jmp L(diag_entry_3)
L(diag_prologue_0):
mov vp, vp_inner
mov vn, n
lea 0(%rip), outer_addr
mov -8(up,n,8), %rax
jmp L(diag_entry_0)
L(diag_prologue_1):
lea 8(vp), vp
mov vp, vp_inner
add $3, vn
mov vn, n
lea 0(%rip), outer_addr
mov -8(vp_inner), %rax
jmp L(diag_entry_1)
L(diag_prologue_2):
lea -16(vp), vp
mov vp, vp_inner
add $2, vn
mov vn, n
lea 0(%rip), outer_addr
mov 16(vp_inner), %rax
jmp L(diag_entry_2)
C this loop is 10 c/loop = 2.5 c/l on K8
ALIGN(16)
L(diag_top):
add %rax, w0
adc %rdx, w1
mov -8(up,n,8), %rax
adc $0, w2
L(diag_entry_0):
mulq (vp_inner)
add %rax, w0
adc %rdx, w1
adc $0, w2
L(diag_entry_3):
mov -16(up,n,8), %rax
mulq 8(vp_inner)
add %rax, w0
mov 16(vp_inner), %rax
adc %rdx, w1
adc $0, w2
L(diag_entry_2):
mulq -24(up,n,8)
add %rax, w0
mov 24(vp_inner), %rax
adc %rdx, w1
lea 32(vp_inner), vp_inner
adc $0, w2
L(diag_entry_1):
mulq -32(up,n,8)
sub $4, n
jnz L(diag_top)
add %rax, w0
adc %rdx, w1
adc $0, w2
mov w0, (rp,un,8)
inc un
jz L(diag_end)
mov vn, n
mov vp, vp_inner
lea 8(up), up
mov w1, w0
mov w2, w1
xor R32(w2), R32(w2)
jmp *outer_addr
L(diag_end):
mov w1, (rp)
mov w2, 8(rp)
L(ret): pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
FUNC_EXIT()
ret
EPILOGUE()
| 17.098214 | 79 | 0.599791 |
99fe0170a825a3d53c294e60209b792ac2cd485b | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending2-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending2-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending2-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: Ending2-p.asm
Type: file
Size: 15545
Last-Modified: '1992-07-27T15:00:00Z'
SHA-1: ED30D9D46E6D0B681EBD0D92B710DD33CEEC9724
Description: null
| 21 | 47 | 0.809524 |
880f75dab77b6ddd324e00732d0092fbab60f455 | 821 | asm | Assembly | programs/oeis/184/A184016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/184/A184016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/184/A184016.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A184016: n+floor(3*sqrt(n)); complement of A184017.
; 4,6,8,10,11,13,14,16,18,19,20,22,23,25,26,28,29,30,32,33,34,36,37,38,40,41,42,43,45,46,47,48,50,51,52,54,55,56,57,58,60,61,62,63,65,66,67,68,70,71,72,73,74,76,77,78,79,80,82,83,84,85,86,88,89,90,91,92,93,95,96,97,98,99,100,102,103,104,105,106,108,109,110,111,112,113,114,116,117,118,119,120,121,123,124,125,126,127,128,130
mov $6,$0
mov $8,$0
add $8,1
lpb $8
mov $0,$6
mov $3,0
sub $8,1
sub $0,$8
mov $2,$0
mov $4,2
lpb $4
mov $0,$2
sub $4,1
add $0,$4
mul $0,9
max $0,0
seq $0,196 ; Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times.
mov $5,$4
mul $5,$0
add $3,$5
mov $7,$0
lpe
min $2,1
mul $2,$7
mov $7,$3
sub $7,$2
add $7,1
add $1,$7
lpe
mov $0,$1
| 24.147059 | 324 | 0.580999 |
c7ecc3e8b8801e216996690da7f81d6b7478918d | 978 | asm | Assembly | src/loop.asm | mckenney5/x86-intel-code-snips | 5dada8f3ebe520a30a3b27b327cc09eafc7598ee | [
"Unlicense"
] | null | null | null | src/loop.asm | mckenney5/x86-intel-code-snips | 5dada8f3ebe520a30a3b27b327cc09eafc7598ee | [
"Unlicense"
] | null | null | null | src/loop.asm | mckenney5/x86-intel-code-snips | 5dada8f3ebe520a30a3b27b327cc09eafc7598ee | [
"Unlicense"
] | null | null | null | ; Writes msg X times
; x86 32bit Linux kernel only
SECTION .data ; initalized data
msg: db "Hi",10,0 ; the mesg to display
msg_len equ $ - msg ; msg's length
SECTION .text ; the code
global main ; main used so gcc can be linker
; can be changed to _start for ld
main:
push ebp ; prolog
mov ebp, esp
mov ecx, 10 ; loop for 10 times (i=10)
L1: ; for(i=10; i > 0; i--)
push ecx ; save the loop counter (int i)
mov ecx, msg ; display hi
mov edx, msg_len ; with len of 4
call write ; sys_call write(msg, len)
pop ecx ; retreive loop counter (i)
loop L1 ; loop
; end of loop
call done ; exit
write:
; write(msg, len)
; ecx, edx
push ebp ; prolog
mov ebp, esp
mov eax, 4 ; sys_call write
mov ebx, 1 ; stdout
int 0x80 ; call kernel
mov esp, ebp ; epilog
pop ebp
ret
done:
; Revert stack pointer to the base
; Then tell the kernel that we are done
mov esp, ebp
pop ebp
mov eax, 1
mov ebx, 0
int 0x80
ret
| 18.111111 | 46 | 0.638037 |
27539102bd5648f8fbe9bbd599135482fb88f461 | 67,551 | asm | Assembly | ls.asm | adrianna157/CS444-Lab5-Mutexes | a6d4d67cae45b5f37ce4b26d17636659d9e5b58b | [
"MIT-0"
] | null | null | null | ls.asm | adrianna157/CS444-Lab5-Mutexes | a6d4d67cae45b5f37ce4b26d17636659d9e5b58b | [
"MIT-0"
] | null | null | null | ls.asm | adrianna157/CS444-Lab5-Mutexes | a6d4d67cae45b5f37ce4b26d17636659d9e5b58b | [
"MIT-0"
] | null | null | null |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
close(fd);
}
int
main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 57 push %edi
4: 56 push %esi
5: 53 push %ebx
#ifdef LS_IS_MORE
printf(1, "%s\t\t%s\t%s\t%s\t%s\n",
"name", "type", "# lks", "ino #", "size"
);
#endif // LS_IS_MORE
if(argc < 2){
6: bb 01 00 00 00 mov $0x1,%ebx
{
b: 83 e4 f0 and $0xfffffff0,%esp
e: 83 ec 20 sub $0x20,%esp
11: 8b 75 08 mov 0x8(%ebp),%esi
printf(1, "%s\t\t%s\t%s\t%s\t%s\n",
14: c7 44 24 18 04 0e 00 movl $0xe04,0x18(%esp)
1b: 00
{
1c: 8b 7d 0c mov 0xc(%ebp),%edi
printf(1, "%s\t\t%s\t%s\t%s\t%s\n",
1f: c7 44 24 14 09 0e 00 movl $0xe09,0x14(%esp)
26: 00
27: c7 44 24 10 0f 0e 00 movl $0xe0f,0x10(%esp)
2e: 00
2f: c7 44 24 0c 15 0e 00 movl $0xe15,0xc(%esp)
36: 00
37: c7 44 24 08 1a 0e 00 movl $0xe1a,0x8(%esp)
3e: 00
3f: c7 44 24 04 1f 0e 00 movl $0xe1f,0x4(%esp)
46: 00
47: c7 04 24 01 00 00 00 movl $0x1,(%esp)
4e: e8 5d 07 00 00 call 7b0 <printf>
if(argc < 2){
53: 83 fe 01 cmp $0x1,%esi
56: 7e 17 jle 6f <main+0x6f>
ls(".");
exit();
}
for(i=1; i<argc; i++)
ls(argv[i]);
58: 8b 04 9f mov (%edi,%ebx,4),%eax
for(i=1; i<argc; i++)
5b: 83 c3 01 add $0x1,%ebx
ls(argv[i]);
5e: 89 04 24 mov %eax,(%esp)
61: e8 da 00 00 00 call 140 <ls>
for(i=1; i<argc; i++)
66: 39 f3 cmp %esi,%ebx
68: 75 ee jne 58 <main+0x58>
exit();
6a: e8 93 05 00 00 call 602 <exit>
ls(".");
6f: c7 04 24 30 0e 00 00 movl $0xe30,(%esp)
76: e8 c5 00 00 00 call 140 <ls>
exit();
7b: e8 82 05 00 00 call 602 <exit>
00000080 <filetype>:
{
80: 55 push %ebp
switch (sttype) {
81: b8 3f 00 00 00 mov $0x3f,%eax
{
86: 89 e5 mov %esp,%ebp
88: 8b 55 08 mov 0x8(%ebp),%edx
8b: 8d 4a ff lea -0x1(%edx),%ecx
8e: 83 f9 02 cmp $0x2,%ecx
91: 77 07 ja 9a <filetype+0x1a>
93: 0f b6 82 31 0e 00 00 movzbl 0xe31(%edx),%eax
}
9a: 5d pop %ebp
9b: c3 ret
9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000000a0 <fmtname>:
{
a0: 55 push %ebp
a1: 89 e5 mov %esp,%ebp
a3: 56 push %esi
a4: 53 push %ebx
a5: 83 ec 10 sub $0x10,%esp
a8: 8b 5d 08 mov 0x8(%ebp),%ebx
for(p=path+strlen(path); p >= path && *p != '/'; p--)
ab: 89 1c 24 mov %ebx,(%esp)
ae: e8 ad 03 00 00 call 460 <strlen>
b3: 01 d8 add %ebx,%eax
b5: 73 10 jae c7 <fmtname+0x27>
b7: eb 13 jmp cc <fmtname+0x2c>
b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
c0: 83 e8 01 sub $0x1,%eax
c3: 39 c3 cmp %eax,%ebx
c5: 77 05 ja cc <fmtname+0x2c>
c7: 80 38 2f cmpb $0x2f,(%eax)
ca: 75 f4 jne c0 <fmtname+0x20>
p++;
cc: 8d 58 01 lea 0x1(%eax),%ebx
if(strlen(p) >= DIRSIZ)
cf: 89 1c 24 mov %ebx,(%esp)
d2: e8 89 03 00 00 call 460 <strlen>
d7: 83 f8 0d cmp $0xd,%eax
da: 77 53 ja 12f <fmtname+0x8f>
memmove(buf, p, strlen(p));
dc: 89 1c 24 mov %ebx,(%esp)
df: e8 7c 03 00 00 call 460 <strlen>
e4: 89 5c 24 04 mov %ebx,0x4(%esp)
e8: c7 04 24 50 13 00 00 movl $0x1350,(%esp)
ef: 89 44 24 08 mov %eax,0x8(%esp)
f3: e8 d8 04 00 00 call 5d0 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
f8: 89 1c 24 mov %ebx,(%esp)
fb: e8 60 03 00 00 call 460 <strlen>
100: 89 1c 24 mov %ebx,(%esp)
return buf;
103: bb 50 13 00 00 mov $0x1350,%ebx
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
108: 89 c6 mov %eax,%esi
10a: e8 51 03 00 00 call 460 <strlen>
10f: ba 0e 00 00 00 mov $0xe,%edx
114: 29 f2 sub %esi,%edx
116: 89 54 24 08 mov %edx,0x8(%esp)
11a: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
121: 00
122: 05 50 13 00 00 add $0x1350,%eax
127: 89 04 24 mov %eax,(%esp)
12a: e8 61 03 00 00 call 490 <memset>
}
12f: 83 c4 10 add $0x10,%esp
132: 89 d8 mov %ebx,%eax
134: 5b pop %ebx
135: 5e pop %esi
136: 5d pop %ebp
137: c3 ret
138: 90 nop
139: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000140 <ls>:
{
140: 55 push %ebp
141: 89 e5 mov %esp,%ebp
143: 57 push %edi
144: 56 push %esi
145: 53 push %ebx
146: 81 ec 7c 02 00 00 sub $0x27c,%esp
14c: 8b 75 08 mov 0x8(%ebp),%esi
if((fd = open(path, 0)) < 0){
14f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
156: 00
157: 89 34 24 mov %esi,(%esp)
15a: e8 e3 04 00 00 call 642 <open>
15f: 85 c0 test %eax,%eax
161: 89 c3 mov %eax,%ebx
163: 0f 88 e7 01 00 00 js 350 <ls+0x210>
if(fstat(fd, &st) < 0){
169: 8d bd d4 fd ff ff lea -0x22c(%ebp),%edi
16f: 89 7c 24 04 mov %edi,0x4(%esp)
173: 89 04 24 mov %eax,(%esp)
176: e8 df 04 00 00 call 65a <fstat>
17b: 85 c0 test %eax,%eax
17d: 0f 88 15 02 00 00 js 398 <ls+0x258>
switch(st.type){
183: 0f b7 85 d4 fd ff ff movzwl -0x22c(%ebp),%eax
18a: 66 83 f8 01 cmp $0x1,%ax
18e: 74 78 je 208 <ls+0xc8>
190: 66 83 f8 02 cmp $0x2,%ax
194: 75 5f jne 1f5 <ls+0xb5>
printf(1, "%s\t%c\t%d\t%d\t%d\n"
196: 8b 8d e4 fd ff ff mov -0x21c(%ebp),%ecx
19c: 8b 95 dc fd ff ff mov -0x224(%ebp),%edx
1a2: 89 34 24 mov %esi,(%esp)
1a5: 0f bf bd e0 fd ff ff movswl -0x220(%ebp),%edi
1ac: 89 8d b0 fd ff ff mov %ecx,-0x250(%ebp)
1b2: 89 95 b4 fd ff ff mov %edx,-0x24c(%ebp)
1b8: e8 e3 fe ff ff call a0 <fmtname>
1bd: 8b 8d b0 fd ff ff mov -0x250(%ebp),%ecx
1c3: 8b 95 b4 fd ff ff mov -0x24c(%ebp),%edx
1c9: 89 7c 24 10 mov %edi,0x10(%esp)
1cd: c7 44 24 0c 66 00 00 movl $0x66,0xc(%esp)
1d4: 00
1d5: 89 4c 24 18 mov %ecx,0x18(%esp)
1d9: 89 54 24 14 mov %edx,0x14(%esp)
1dd: 89 44 24 08 mov %eax,0x8(%esp)
1e1: c7 44 24 04 e1 0d 00 movl $0xde1,0x4(%esp)
1e8: 00
1e9: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1f0: e8 bb 05 00 00 call 7b0 <printf>
close(fd);
1f5: 89 1c 24 mov %ebx,(%esp)
1f8: e8 2d 04 00 00 call 62a <close>
}
1fd: 81 c4 7c 02 00 00 add $0x27c,%esp
203: 5b pop %ebx
204: 5e pop %esi
205: 5f pop %edi
206: 5d pop %ebp
207: c3 ret
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
208: 89 34 24 mov %esi,(%esp)
20b: e8 50 02 00 00 call 460 <strlen>
210: 83 c0 10 add $0x10,%eax
213: 3d 00 02 00 00 cmp $0x200,%eax
218: 0f 87 5a 01 00 00 ja 378 <ls+0x238>
strcpy(buf, path);
21e: 89 74 24 04 mov %esi,0x4(%esp)
222: 8d b5 e8 fd ff ff lea -0x218(%ebp),%esi
228: 89 34 24 mov %esi,(%esp)
22b: e8 b0 01 00 00 call 3e0 <strcpy>
p = buf+strlen(buf);
230: 89 34 24 mov %esi,(%esp)
233: e8 28 02 00 00 call 460 <strlen>
238: 01 f0 add %esi,%eax
*p++ = '/';
23a: 8d 48 01 lea 0x1(%eax),%ecx
p = buf+strlen(buf);
23d: 89 85 a4 fd ff ff mov %eax,-0x25c(%ebp)
*p++ = '/';
243: 89 8d a0 fd ff ff mov %ecx,-0x260(%ebp)
249: c6 00 2f movb $0x2f,(%eax)
24c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(read(fd, &de, sizeof(de)) == sizeof(de)){
250: 8d 85 c4 fd ff ff lea -0x23c(%ebp),%eax
256: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
25d: 00
25e: 89 44 24 04 mov %eax,0x4(%esp)
262: 89 1c 24 mov %ebx,(%esp)
265: e8 b0 03 00 00 call 61a <read>
26a: 83 f8 10 cmp $0x10,%eax
26d: 75 86 jne 1f5 <ls+0xb5>
if(de.inum == 0)
26f: 66 83 bd c4 fd ff ff cmpw $0x0,-0x23c(%ebp)
276: 00
277: 74 d7 je 250 <ls+0x110>
memmove(p, de.name, DIRSIZ);
279: 8d 85 c6 fd ff ff lea -0x23a(%ebp),%eax
27f: 89 44 24 04 mov %eax,0x4(%esp)
283: 8b 85 a0 fd ff ff mov -0x260(%ebp),%eax
289: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
290: 00
291: 89 04 24 mov %eax,(%esp)
294: e8 37 03 00 00 call 5d0 <memmove>
p[DIRSIZ] = 0;
299: 8b 85 a4 fd ff ff mov -0x25c(%ebp),%eax
29f: c6 40 0f 00 movb $0x0,0xf(%eax)
if(stat(buf, &st) < 0){
2a3: 89 7c 24 04 mov %edi,0x4(%esp)
2a7: 89 34 24 mov %esi,(%esp)
2aa: e8 a1 02 00 00 call 550 <stat>
2af: 85 c0 test %eax,%eax
2b1: 0f 88 09 01 00 00 js 3c0 <ls+0x280>
printf(1, "%s\t%c\t%d\t%d\t%d\n", fmtname(buf), filetype(st.type), st.nlink, st.ino, st.size);
2b7: 8b 85 dc fd ff ff mov -0x224(%ebp),%eax
switch (sttype) {
2bd: ba 3f 00 00 00 mov $0x3f,%edx
printf(1, "%s\t%c\t%d\t%d\t%d\n", fmtname(buf), filetype(st.type), st.nlink, st.ino, st.size);
2c2: 8b 8d e4 fd ff ff mov -0x21c(%ebp),%ecx
2c8: 89 85 b4 fd ff ff mov %eax,-0x24c(%ebp)
2ce: 0f bf 85 e0 fd ff ff movswl -0x220(%ebp),%eax
2d5: 89 85 b0 fd ff ff mov %eax,-0x250(%ebp)
switch (sttype) {
2db: 0f bf 85 d4 fd ff ff movswl -0x22c(%ebp),%eax
2e2: 83 e8 01 sub $0x1,%eax
2e5: 83 f8 02 cmp $0x2,%eax
2e8: 77 07 ja 2f1 <ls+0x1b1>
2ea: 0f be 90 32 0e 00 00 movsbl 0xe32(%eax),%edx
printf(1, "%s\t%c\t%d\t%d\t%d\n", fmtname(buf), filetype(st.type), st.nlink, st.ino, st.size);
2f1: 89 34 24 mov %esi,(%esp)
2f4: 89 8d a8 fd ff ff mov %ecx,-0x258(%ebp)
2fa: 89 95 ac fd ff ff mov %edx,-0x254(%ebp)
300: e8 9b fd ff ff call a0 <fmtname>
305: 8b 8d a8 fd ff ff mov -0x258(%ebp),%ecx
30b: 8b 95 b0 fd ff ff mov -0x250(%ebp),%edx
311: c7 44 24 04 e1 0d 00 movl $0xde1,0x4(%esp)
318: 00
319: c7 04 24 01 00 00 00 movl $0x1,(%esp)
320: 89 4c 24 18 mov %ecx,0x18(%esp)
324: 8b 8d b4 fd ff ff mov -0x24c(%ebp),%ecx
32a: 89 54 24 10 mov %edx,0x10(%esp)
32e: 8b 95 ac fd ff ff mov -0x254(%ebp),%edx
334: 89 44 24 08 mov %eax,0x8(%esp)
338: 89 4c 24 14 mov %ecx,0x14(%esp)
33c: 89 54 24 0c mov %edx,0xc(%esp)
340: e8 6b 04 00 00 call 7b0 <printf>
345: e9 06 ff ff ff jmp 250 <ls+0x110>
34a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printf(2, "ls: cannot open %s\n", path);
350: 89 74 24 08 mov %esi,0x8(%esp)
354: c7 44 24 04 b9 0d 00 movl $0xdb9,0x4(%esp)
35b: 00
35c: c7 04 24 02 00 00 00 movl $0x2,(%esp)
363: e8 48 04 00 00 call 7b0 <printf>
}
368: 81 c4 7c 02 00 00 add $0x27c,%esp
36e: 5b pop %ebx
36f: 5e pop %esi
370: 5f pop %edi
371: 5d pop %ebp
372: c3 ret
373: 90 nop
374: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printf(1, "ls: path too long\n");
378: c7 44 24 04 f1 0d 00 movl $0xdf1,0x4(%esp)
37f: 00
380: c7 04 24 01 00 00 00 movl $0x1,(%esp)
387: e8 24 04 00 00 call 7b0 <printf>
break;
38c: e9 64 fe ff ff jmp 1f5 <ls+0xb5>
391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printf(2, "ls: cannot stat %s\n", path);
398: 89 74 24 08 mov %esi,0x8(%esp)
39c: c7 44 24 04 cd 0d 00 movl $0xdcd,0x4(%esp)
3a3: 00
3a4: c7 04 24 02 00 00 00 movl $0x2,(%esp)
3ab: e8 00 04 00 00 call 7b0 <printf>
close(fd);
3b0: 89 1c 24 mov %ebx,(%esp)
3b3: e8 72 02 00 00 call 62a <close>
return;
3b8: e9 40 fe ff ff jmp 1fd <ls+0xbd>
3bd: 8d 76 00 lea 0x0(%esi),%esi
printf(1, "ls: cannot stat %s\n", buf);
3c0: 89 74 24 08 mov %esi,0x8(%esp)
3c4: c7 44 24 04 cd 0d 00 movl $0xdcd,0x4(%esp)
3cb: 00
3cc: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3d3: e8 d8 03 00 00 call 7b0 <printf>
continue;
3d8: e9 73 fe ff ff jmp 250 <ls+0x110>
3dd: 66 90 xchg %ax,%ax
3df: 90 nop
000003e0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
3e0: 55 push %ebp
3e1: 89 e5 mov %esp,%ebp
3e3: 8b 45 08 mov 0x8(%ebp),%eax
3e6: 8b 4d 0c mov 0xc(%ebp),%ecx
3e9: 53 push %ebx
char *os;
os = s;
while((*s++ = *t++) != 0)
3ea: 89 c2 mov %eax,%edx
3ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
3f0: 83 c1 01 add $0x1,%ecx
3f3: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
3f7: 83 c2 01 add $0x1,%edx
3fa: 84 db test %bl,%bl
3fc: 88 5a ff mov %bl,-0x1(%edx)
3ff: 75 ef jne 3f0 <strcpy+0x10>
;
return os;
}
401: 5b pop %ebx
402: 5d pop %ebp
403: c3 ret
404: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
40a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000410 <strcmp>:
int
strcmp(const char *p, const char *q)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 8b 55 08 mov 0x8(%ebp),%edx
416: 53 push %ebx
417: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
41a: 0f b6 02 movzbl (%edx),%eax
41d: 84 c0 test %al,%al
41f: 74 2d je 44e <strcmp+0x3e>
421: 0f b6 19 movzbl (%ecx),%ebx
424: 38 d8 cmp %bl,%al
426: 74 0e je 436 <strcmp+0x26>
428: eb 2b jmp 455 <strcmp+0x45>
42a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
430: 38 c8 cmp %cl,%al
432: 75 15 jne 449 <strcmp+0x39>
p++, q++;
434: 89 d9 mov %ebx,%ecx
436: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
439: 0f b6 02 movzbl (%edx),%eax
p++, q++;
43c: 8d 59 01 lea 0x1(%ecx),%ebx
while(*p && *p == *q)
43f: 0f b6 49 01 movzbl 0x1(%ecx),%ecx
443: 84 c0 test %al,%al
445: 75 e9 jne 430 <strcmp+0x20>
447: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
449: 29 c8 sub %ecx,%eax
}
44b: 5b pop %ebx
44c: 5d pop %ebp
44d: c3 ret
44e: 0f b6 09 movzbl (%ecx),%ecx
while(*p && *p == *q)
451: 31 c0 xor %eax,%eax
453: eb f4 jmp 449 <strcmp+0x39>
455: 0f b6 cb movzbl %bl,%ecx
458: eb ef jmp 449 <strcmp+0x39>
45a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000460 <strlen>:
uint
strlen(const char *s)
{
460: 55 push %ebp
461: 89 e5 mov %esp,%ebp
463: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
466: 80 39 00 cmpb $0x0,(%ecx)
469: 74 12 je 47d <strlen+0x1d>
46b: 31 d2 xor %edx,%edx
46d: 8d 76 00 lea 0x0(%esi),%esi
470: 83 c2 01 add $0x1,%edx
473: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
477: 89 d0 mov %edx,%eax
479: 75 f5 jne 470 <strlen+0x10>
;
return n;
}
47b: 5d pop %ebp
47c: c3 ret
for(n = 0; s[n]; n++)
47d: 31 c0 xor %eax,%eax
}
47f: 5d pop %ebp
480: c3 ret
481: eb 0d jmp 490 <memset>
483: 90 nop
484: 90 nop
485: 90 nop
486: 90 nop
487: 90 nop
488: 90 nop
489: 90 nop
48a: 90 nop
48b: 90 nop
48c: 90 nop
48d: 90 nop
48e: 90 nop
48f: 90 nop
00000490 <memset>:
void*
memset(void *dst, int c, uint n)
{
490: 55 push %ebp
491: 89 e5 mov %esp,%ebp
493: 8b 55 08 mov 0x8(%ebp),%edx
496: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
497: 8b 4d 10 mov 0x10(%ebp),%ecx
49a: 8b 45 0c mov 0xc(%ebp),%eax
49d: 89 d7 mov %edx,%edi
49f: fc cld
4a0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
4a2: 89 d0 mov %edx,%eax
4a4: 5f pop %edi
4a5: 5d pop %ebp
4a6: c3 ret
4a7: 89 f6 mov %esi,%esi
4a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000004b0 <strchr>:
char*
strchr(const char *s, char c)
{
4b0: 55 push %ebp
4b1: 89 e5 mov %esp,%ebp
4b3: 8b 45 08 mov 0x8(%ebp),%eax
4b6: 53 push %ebx
4b7: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
4ba: 0f b6 18 movzbl (%eax),%ebx
4bd: 84 db test %bl,%bl
4bf: 74 1d je 4de <strchr+0x2e>
if(*s == c)
4c1: 38 d3 cmp %dl,%bl
4c3: 89 d1 mov %edx,%ecx
4c5: 75 0d jne 4d4 <strchr+0x24>
4c7: eb 17 jmp 4e0 <strchr+0x30>
4c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
4d0: 38 ca cmp %cl,%dl
4d2: 74 0c je 4e0 <strchr+0x30>
for(; *s; s++)
4d4: 83 c0 01 add $0x1,%eax
4d7: 0f b6 10 movzbl (%eax),%edx
4da: 84 d2 test %dl,%dl
4dc: 75 f2 jne 4d0 <strchr+0x20>
return (char*)s;
return 0;
4de: 31 c0 xor %eax,%eax
}
4e0: 5b pop %ebx
4e1: 5d pop %ebp
4e2: c3 ret
4e3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
4e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000004f0 <gets>:
char*
gets(char *buf, int max)
{
4f0: 55 push %ebp
4f1: 89 e5 mov %esp,%ebp
4f3: 57 push %edi
4f4: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
4f5: 31 f6 xor %esi,%esi
{
4f7: 53 push %ebx
4f8: 83 ec 2c sub $0x2c,%esp
cc = read(0, &c, 1);
4fb: 8d 7d e7 lea -0x19(%ebp),%edi
for(i=0; i+1 < max; ){
4fe: eb 31 jmp 531 <gets+0x41>
cc = read(0, &c, 1);
500: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
507: 00
508: 89 7c 24 04 mov %edi,0x4(%esp)
50c: c7 04 24 00 00 00 00 movl $0x0,(%esp)
513: e8 02 01 00 00 call 61a <read>
if(cc < 1)
518: 85 c0 test %eax,%eax
51a: 7e 1d jle 539 <gets+0x49>
break;
buf[i++] = c;
51c: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
for(i=0; i+1 < max; ){
520: 89 de mov %ebx,%esi
buf[i++] = c;
522: 8b 55 08 mov 0x8(%ebp),%edx
if(c == '\n' || c == '\r')
525: 3c 0d cmp $0xd,%al
buf[i++] = c;
527: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
52b: 74 0c je 539 <gets+0x49>
52d: 3c 0a cmp $0xa,%al
52f: 74 08 je 539 <gets+0x49>
for(i=0; i+1 < max; ){
531: 8d 5e 01 lea 0x1(%esi),%ebx
534: 3b 5d 0c cmp 0xc(%ebp),%ebx
537: 7c c7 jl 500 <gets+0x10>
break;
}
buf[i] = '\0';
539: 8b 45 08 mov 0x8(%ebp),%eax
53c: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
540: 83 c4 2c add $0x2c,%esp
543: 5b pop %ebx
544: 5e pop %esi
545: 5f pop %edi
546: 5d pop %ebp
547: c3 ret
548: 90 nop
549: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000550 <stat>:
int
stat(const char *n, struct stat *st)
{
550: 55 push %ebp
551: 89 e5 mov %esp,%ebp
553: 56 push %esi
554: 53 push %ebx
555: 83 ec 10 sub $0x10,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
558: 8b 45 08 mov 0x8(%ebp),%eax
55b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
562: 00
563: 89 04 24 mov %eax,(%esp)
566: e8 d7 00 00 00 call 642 <open>
if(fd < 0)
56b: 85 c0 test %eax,%eax
fd = open(n, O_RDONLY);
56d: 89 c3 mov %eax,%ebx
if(fd < 0)
56f: 78 27 js 598 <stat+0x48>
return -1;
r = fstat(fd, st);
571: 8b 45 0c mov 0xc(%ebp),%eax
574: 89 1c 24 mov %ebx,(%esp)
577: 89 44 24 04 mov %eax,0x4(%esp)
57b: e8 da 00 00 00 call 65a <fstat>
close(fd);
580: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
583: 89 c6 mov %eax,%esi
close(fd);
585: e8 a0 00 00 00 call 62a <close>
return r;
58a: 89 f0 mov %esi,%eax
}
58c: 83 c4 10 add $0x10,%esp
58f: 5b pop %ebx
590: 5e pop %esi
591: 5d pop %ebp
592: c3 ret
593: 90 nop
594: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
598: b8 ff ff ff ff mov $0xffffffff,%eax
59d: eb ed jmp 58c <stat+0x3c>
59f: 90 nop
000005a0 <atoi>:
int
atoi(const char *s)
{
5a0: 55 push %ebp
5a1: 89 e5 mov %esp,%ebp
5a3: 8b 4d 08 mov 0x8(%ebp),%ecx
5a6: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
5a7: 0f be 11 movsbl (%ecx),%edx
5aa: 8d 42 d0 lea -0x30(%edx),%eax
5ad: 3c 09 cmp $0x9,%al
n = 0;
5af: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
5b4: 77 17 ja 5cd <atoi+0x2d>
5b6: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
5b8: 83 c1 01 add $0x1,%ecx
5bb: 8d 04 80 lea (%eax,%eax,4),%eax
5be: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
5c2: 0f be 11 movsbl (%ecx),%edx
5c5: 8d 5a d0 lea -0x30(%edx),%ebx
5c8: 80 fb 09 cmp $0x9,%bl
5cb: 76 eb jbe 5b8 <atoi+0x18>
return n;
}
5cd: 5b pop %ebx
5ce: 5d pop %ebp
5cf: c3 ret
000005d0 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
5d0: 55 push %ebp
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
5d1: 31 d2 xor %edx,%edx
{
5d3: 89 e5 mov %esp,%ebp
5d5: 56 push %esi
5d6: 8b 45 08 mov 0x8(%ebp),%eax
5d9: 53 push %ebx
5da: 8b 5d 10 mov 0x10(%ebp),%ebx
5dd: 8b 75 0c mov 0xc(%ebp),%esi
while(n-- > 0)
5e0: 85 db test %ebx,%ebx
5e2: 7e 12 jle 5f6 <memmove+0x26>
5e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
5e8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
5ec: 88 0c 10 mov %cl,(%eax,%edx,1)
5ef: 83 c2 01 add $0x1,%edx
while(n-- > 0)
5f2: 39 da cmp %ebx,%edx
5f4: 75 f2 jne 5e8 <memmove+0x18>
return vdst;
}
5f6: 5b pop %ebx
5f7: 5e pop %esi
5f8: 5d pop %ebp
5f9: c3 ret
000005fa <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
5fa: b8 01 00 00 00 mov $0x1,%eax
5ff: cd 40 int $0x40
601: c3 ret
00000602 <exit>:
SYSCALL(exit)
602: b8 02 00 00 00 mov $0x2,%eax
607: cd 40 int $0x40
609: c3 ret
0000060a <wait>:
SYSCALL(wait)
60a: b8 03 00 00 00 mov $0x3,%eax
60f: cd 40 int $0x40
611: c3 ret
00000612 <pipe>:
SYSCALL(pipe)
612: b8 04 00 00 00 mov $0x4,%eax
617: cd 40 int $0x40
619: c3 ret
0000061a <read>:
SYSCALL(read)
61a: b8 05 00 00 00 mov $0x5,%eax
61f: cd 40 int $0x40
621: c3 ret
00000622 <write>:
SYSCALL(write)
622: b8 10 00 00 00 mov $0x10,%eax
627: cd 40 int $0x40
629: c3 ret
0000062a <close>:
SYSCALL(close)
62a: b8 15 00 00 00 mov $0x15,%eax
62f: cd 40 int $0x40
631: c3 ret
00000632 <kill>:
SYSCALL(kill)
632: b8 06 00 00 00 mov $0x6,%eax
637: cd 40 int $0x40
639: c3 ret
0000063a <exec>:
SYSCALL(exec)
63a: b8 07 00 00 00 mov $0x7,%eax
63f: cd 40 int $0x40
641: c3 ret
00000642 <open>:
SYSCALL(open)
642: b8 0f 00 00 00 mov $0xf,%eax
647: cd 40 int $0x40
649: c3 ret
0000064a <mknod>:
SYSCALL(mknod)
64a: b8 11 00 00 00 mov $0x11,%eax
64f: cd 40 int $0x40
651: c3 ret
00000652 <unlink>:
SYSCALL(unlink)
652: b8 12 00 00 00 mov $0x12,%eax
657: cd 40 int $0x40
659: c3 ret
0000065a <fstat>:
SYSCALL(fstat)
65a: b8 08 00 00 00 mov $0x8,%eax
65f: cd 40 int $0x40
661: c3 ret
00000662 <link>:
SYSCALL(link)
662: b8 13 00 00 00 mov $0x13,%eax
667: cd 40 int $0x40
669: c3 ret
0000066a <mkdir>:
SYSCALL(mkdir)
66a: b8 14 00 00 00 mov $0x14,%eax
66f: cd 40 int $0x40
671: c3 ret
00000672 <chdir>:
SYSCALL(chdir)
672: b8 09 00 00 00 mov $0x9,%eax
677: cd 40 int $0x40
679: c3 ret
0000067a <dup>:
SYSCALL(dup)
67a: b8 0a 00 00 00 mov $0xa,%eax
67f: cd 40 int $0x40
681: c3 ret
00000682 <getpid>:
SYSCALL(getpid)
682: b8 0b 00 00 00 mov $0xb,%eax
687: cd 40 int $0x40
689: c3 ret
0000068a <sbrk>:
SYSCALL(sbrk)
68a: b8 0c 00 00 00 mov $0xc,%eax
68f: cd 40 int $0x40
691: c3 ret
00000692 <sleep>:
SYSCALL(sleep)
692: b8 0d 00 00 00 mov $0xd,%eax
697: cd 40 int $0x40
699: c3 ret
0000069a <uptime>:
SYSCALL(uptime)
69a: b8 0e 00 00 00 mov $0xe,%eax
69f: cd 40 int $0x40
6a1: c3 ret
000006a2 <getppid>:
#ifdef GETPPID
SYSCALL(getppid)
6a2: b8 16 00 00 00 mov $0x16,%eax
6a7: cd 40 int $0x40
6a9: c3 ret
000006aa <cps>:
#endif // GETPPID
#ifdef CPS
SYSCALL(cps)
6aa: b8 17 00 00 00 mov $0x17,%eax
6af: cd 40 int $0x40
6b1: c3 ret
000006b2 <halt>:
#endif // CPS
#ifdef HALT
SYSCALL(halt)
6b2: b8 18 00 00 00 mov $0x18,%eax
6b7: cd 40 int $0x40
6b9: c3 ret
000006ba <kdebug>:
#endif // HALT
#ifdef KDEBUG
SYSCALL(kdebug)
6ba: b8 19 00 00 00 mov $0x19,%eax
6bf: cd 40 int $0x40
6c1: c3 ret
000006c2 <va2pa>:
#endif // KDEBUG
#ifdef VA2PA
SYSCALL(va2pa)
6c2: b8 1a 00 00 00 mov $0x1a,%eax
6c7: cd 40 int $0x40
6c9: c3 ret
000006ca <kthread_create>:
#endif // VA2PA
#ifdef KTHREADS
SYSCALL(kthread_create)
6ca: b8 1b 00 00 00 mov $0x1b,%eax
6cf: cd 40 int $0x40
6d1: c3 ret
000006d2 <kthread_join>:
SYSCALL(kthread_join)
6d2: b8 1c 00 00 00 mov $0x1c,%eax
6d7: cd 40 int $0x40
6d9: c3 ret
000006da <kthread_exit>:
SYSCALL(kthread_exit)
6da: b8 1d 00 00 00 mov $0x1d,%eax
6df: cd 40 int $0x40
6e1: c3 ret
000006e2 <kthread_self>:
#endif // KTHREADS
#ifdef BENNY_MOOTEX
SYSCALL(kthread_self)
6e2: b8 1e 00 00 00 mov $0x1e,%eax
6e7: cd 40 int $0x40
6e9: c3 ret
000006ea <kthread_yield>:
SYSCALL(kthread_yield)
6ea: b8 1f 00 00 00 mov $0x1f,%eax
6ef: cd 40 int $0x40
6f1: c3 ret
000006f2 <kthread_cpu_count>:
SYSCALL(kthread_cpu_count)
6f2: b8 20 00 00 00 mov $0x20,%eax
6f7: cd 40 int $0x40
6f9: c3 ret
000006fa <kthread_thread_count>:
SYSCALL(kthread_thread_count)
6fa: b8 21 00 00 00 mov $0x21,%eax
6ff: cd 40 int $0x40
701: c3 ret
702: 66 90 xchg %ax,%ax
704: 66 90 xchg %ax,%ax
706: 66 90 xchg %ax,%ax
708: 66 90 xchg %ax,%ax
70a: 66 90 xchg %ax,%ax
70c: 66 90 xchg %ax,%ax
70e: 66 90 xchg %ax,%ax
00000710 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
710: 55 push %ebp
711: 89 e5 mov %esp,%ebp
713: 57 push %edi
714: 56 push %esi
715: 89 c6 mov %eax,%esi
717: 53 push %ebx
718: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
71b: 8b 5d 08 mov 0x8(%ebp),%ebx
71e: 85 db test %ebx,%ebx
720: 74 09 je 72b <printint+0x1b>
722: 89 d0 mov %edx,%eax
724: c1 e8 1f shr $0x1f,%eax
727: 84 c0 test %al,%al
729: 75 75 jne 7a0 <printint+0x90>
neg = 1;
x = -xx;
} else {
x = xx;
72b: 89 d0 mov %edx,%eax
neg = 0;
72d: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
734: 89 75 c0 mov %esi,-0x40(%ebp)
}
i = 0;
737: 31 ff xor %edi,%edi
739: 89 ce mov %ecx,%esi
73b: 8d 5d d7 lea -0x29(%ebp),%ebx
73e: eb 02 jmp 742 <printint+0x32>
do{
buf[i++] = digits[x % base];
740: 89 cf mov %ecx,%edi
742: 31 d2 xor %edx,%edx
744: f7 f6 div %esi
746: 8d 4f 01 lea 0x1(%edi),%ecx
749: 0f b6 92 3c 0e 00 00 movzbl 0xe3c(%edx),%edx
}while((x /= base) != 0);
750: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
752: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
755: 75 e9 jne 740 <printint+0x30>
if(neg)
757: 8b 55 c4 mov -0x3c(%ebp),%edx
buf[i++] = digits[x % base];
75a: 89 c8 mov %ecx,%eax
75c: 8b 75 c0 mov -0x40(%ebp),%esi
if(neg)
75f: 85 d2 test %edx,%edx
761: 74 08 je 76b <printint+0x5b>
buf[i++] = '-';
763: 8d 4f 02 lea 0x2(%edi),%ecx
766: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
76b: 8d 79 ff lea -0x1(%ecx),%edi
76e: 66 90 xchg %ax,%ax
770: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
775: 83 ef 01 sub $0x1,%edi
write(fd, &c, 1);
778: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
77f: 00
780: 89 5c 24 04 mov %ebx,0x4(%esp)
784: 89 34 24 mov %esi,(%esp)
787: 88 45 d7 mov %al,-0x29(%ebp)
78a: e8 93 fe ff ff call 622 <write>
while(--i >= 0)
78f: 83 ff ff cmp $0xffffffff,%edi
792: 75 dc jne 770 <printint+0x60>
putc(fd, buf[i]);
}
794: 83 c4 4c add $0x4c,%esp
797: 5b pop %ebx
798: 5e pop %esi
799: 5f pop %edi
79a: 5d pop %ebp
79b: c3 ret
79c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = -xx;
7a0: 89 d0 mov %edx,%eax
7a2: f7 d8 neg %eax
neg = 1;
7a4: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
7ab: eb 87 jmp 734 <printint+0x24>
7ad: 8d 76 00 lea 0x0(%esi),%esi
000007b0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
7b0: 55 push %ebp
7b1: 89 e5 mov %esp,%ebp
7b3: 57 push %edi
char *s;
int c, i, state;
uint *ap;
state = 0;
7b4: 31 ff xor %edi,%edi
{
7b6: 56 push %esi
7b7: 53 push %ebx
7b8: 83 ec 3c sub $0x3c,%esp
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
7bb: 8b 5d 0c mov 0xc(%ebp),%ebx
ap = (uint*)(void*)&fmt + 1;
7be: 8d 45 10 lea 0x10(%ebp),%eax
{
7c1: 8b 75 08 mov 0x8(%ebp),%esi
ap = (uint*)(void*)&fmt + 1;
7c4: 89 45 d4 mov %eax,-0x2c(%ebp)
for(i = 0; fmt[i]; i++){
7c7: 0f b6 13 movzbl (%ebx),%edx
7ca: 83 c3 01 add $0x1,%ebx
7cd: 84 d2 test %dl,%dl
7cf: 75 39 jne 80a <printf+0x5a>
7d1: e9 ca 00 00 00 jmp 8a0 <printf+0xf0>
7d6: 66 90 xchg %ax,%ax
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
7d8: 83 fa 25 cmp $0x25,%edx
7db: 0f 84 c7 00 00 00 je 8a8 <printf+0xf8>
write(fd, &c, 1);
7e1: 8d 45 e0 lea -0x20(%ebp),%eax
7e4: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
7eb: 00
7ec: 89 44 24 04 mov %eax,0x4(%esp)
7f0: 89 34 24 mov %esi,(%esp)
state = '%';
} else {
putc(fd, c);
7f3: 88 55 e0 mov %dl,-0x20(%ebp)
write(fd, &c, 1);
7f6: e8 27 fe ff ff call 622 <write>
7fb: 83 c3 01 add $0x1,%ebx
for(i = 0; fmt[i]; i++){
7fe: 0f b6 53 ff movzbl -0x1(%ebx),%edx
802: 84 d2 test %dl,%dl
804: 0f 84 96 00 00 00 je 8a0 <printf+0xf0>
if(state == 0){
80a: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
80c: 0f be c2 movsbl %dl,%eax
if(state == 0){
80f: 74 c7 je 7d8 <printf+0x28>
}
} else if(state == '%'){
811: 83 ff 25 cmp $0x25,%edi
814: 75 e5 jne 7fb <printf+0x4b>
if(c == 'd' || c == 'u'){
816: 83 fa 75 cmp $0x75,%edx
819: 0f 84 99 00 00 00 je 8b8 <printf+0x108>
81f: 83 fa 64 cmp $0x64,%edx
822: 0f 84 90 00 00 00 je 8b8 <printf+0x108>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
828: 25 f7 00 00 00 and $0xf7,%eax
82d: 83 f8 70 cmp $0x70,%eax
830: 0f 84 aa 00 00 00 je 8e0 <printf+0x130>
putc(fd, '0');
putc(fd, 'x');
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
836: 83 fa 73 cmp $0x73,%edx
839: 0f 84 e9 00 00 00 je 928 <printf+0x178>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
83f: 83 fa 63 cmp $0x63,%edx
842: 0f 84 2b 01 00 00 je 973 <printf+0x1c3>
putc(fd, *ap);
ap++;
} else if(c == '%'){
848: 83 fa 25 cmp $0x25,%edx
84b: 0f 84 4f 01 00 00 je 9a0 <printf+0x1f0>
write(fd, &c, 1);
851: 8d 45 e6 lea -0x1a(%ebp),%eax
854: 83 c3 01 add $0x1,%ebx
857: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
85e: 00
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
85f: 31 ff xor %edi,%edi
write(fd, &c, 1);
861: 89 44 24 04 mov %eax,0x4(%esp)
865: 89 34 24 mov %esi,(%esp)
868: 89 55 d0 mov %edx,-0x30(%ebp)
86b: c6 45 e6 25 movb $0x25,-0x1a(%ebp)
86f: e8 ae fd ff ff call 622 <write>
putc(fd, c);
874: 8b 55 d0 mov -0x30(%ebp),%edx
write(fd, &c, 1);
877: 8d 45 e7 lea -0x19(%ebp),%eax
87a: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
881: 00
882: 89 44 24 04 mov %eax,0x4(%esp)
886: 89 34 24 mov %esi,(%esp)
putc(fd, c);
889: 88 55 e7 mov %dl,-0x19(%ebp)
write(fd, &c, 1);
88c: e8 91 fd ff ff call 622 <write>
for(i = 0; fmt[i]; i++){
891: 0f b6 53 ff movzbl -0x1(%ebx),%edx
895: 84 d2 test %dl,%dl
897: 0f 85 6d ff ff ff jne 80a <printf+0x5a>
89d: 8d 76 00 lea 0x0(%esi),%esi
}
}
}
8a0: 83 c4 3c add $0x3c,%esp
8a3: 5b pop %ebx
8a4: 5e pop %esi
8a5: 5f pop %edi
8a6: 5d pop %ebp
8a7: c3 ret
state = '%';
8a8: bf 25 00 00 00 mov $0x25,%edi
8ad: e9 49 ff ff ff jmp 7fb <printf+0x4b>
8b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
8b8: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8bf: b9 0a 00 00 00 mov $0xa,%ecx
printint(fd, *ap, 16, 0);
8c4: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
8c7: 31 ff xor %edi,%edi
printint(fd, *ap, 16, 0);
8c9: 8b 10 mov (%eax),%edx
8cb: 89 f0 mov %esi,%eax
8cd: e8 3e fe ff ff call 710 <printint>
ap++;
8d2: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
8d6: e9 20 ff ff ff jmp 7fb <printf+0x4b>
8db: 90 nop
8dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
8e0: 8d 45 e1 lea -0x1f(%ebp),%eax
8e3: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
8ea: 00
8eb: 89 44 24 04 mov %eax,0x4(%esp)
8ef: 89 34 24 mov %esi,(%esp)
8f2: c6 45 e1 30 movb $0x30,-0x1f(%ebp)
8f6: e8 27 fd ff ff call 622 <write>
8fb: 8d 45 e2 lea -0x1e(%ebp),%eax
8fe: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
905: 00
906: 89 44 24 04 mov %eax,0x4(%esp)
90a: 89 34 24 mov %esi,(%esp)
90d: c6 45 e2 78 movb $0x78,-0x1e(%ebp)
911: e8 0c fd ff ff call 622 <write>
printint(fd, *ap, 16, 0);
916: b9 10 00 00 00 mov $0x10,%ecx
91b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
922: eb a0 jmp 8c4 <printf+0x114>
924: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
928: 8b 45 d4 mov -0x2c(%ebp),%eax
ap++;
92b: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
s = (char*)*ap;
92f: 8b 38 mov (%eax),%edi
s = "(null)";
931: b8 35 0e 00 00 mov $0xe35,%eax
936: 85 ff test %edi,%edi
938: 0f 44 f8 cmove %eax,%edi
while(*s != 0){
93b: 0f b6 07 movzbl (%edi),%eax
93e: 84 c0 test %al,%al
940: 74 2a je 96c <printf+0x1bc>
942: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
948: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
94b: 8d 45 e3 lea -0x1d(%ebp),%eax
s++;
94e: 83 c7 01 add $0x1,%edi
write(fd, &c, 1);
951: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
958: 00
959: 89 44 24 04 mov %eax,0x4(%esp)
95d: 89 34 24 mov %esi,(%esp)
960: e8 bd fc ff ff call 622 <write>
while(*s != 0){
965: 0f b6 07 movzbl (%edi),%eax
968: 84 c0 test %al,%al
96a: 75 dc jne 948 <printf+0x198>
state = 0;
96c: 31 ff xor %edi,%edi
96e: e9 88 fe ff ff jmp 7fb <printf+0x4b>
putc(fd, *ap);
973: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
976: 31 ff xor %edi,%edi
putc(fd, *ap);
978: 8b 00 mov (%eax),%eax
write(fd, &c, 1);
97a: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
981: 00
982: 89 34 24 mov %esi,(%esp)
putc(fd, *ap);
985: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
988: 8d 45 e4 lea -0x1c(%ebp),%eax
98b: 89 44 24 04 mov %eax,0x4(%esp)
98f: e8 8e fc ff ff call 622 <write>
ap++;
994: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
998: e9 5e fe ff ff jmp 7fb <printf+0x4b>
99d: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
9a0: 8d 45 e5 lea -0x1b(%ebp),%eax
state = 0;
9a3: 31 ff xor %edi,%edi
write(fd, &c, 1);
9a5: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
9ac: 00
9ad: 89 44 24 04 mov %eax,0x4(%esp)
9b1: 89 34 24 mov %esi,(%esp)
9b4: c6 45 e5 25 movb $0x25,-0x1b(%ebp)
9b8: e8 65 fc ff ff call 622 <write>
9bd: e9 39 fe ff ff jmp 7fb <printf+0x4b>
9c2: 66 90 xchg %ax,%ax
9c4: 66 90 xchg %ax,%ax
9c6: 66 90 xchg %ax,%ax
9c8: 66 90 xchg %ax,%ax
9ca: 66 90 xchg %ax,%ax
9cc: 66 90 xchg %ax,%ax
9ce: 66 90 xchg %ax,%ax
000009d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
9d0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9d1: a1 60 13 00 00 mov 0x1360,%eax
{
9d6: 89 e5 mov %esp,%ebp
9d8: 57 push %edi
9d9: 56 push %esi
9da: 53 push %ebx
9db: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
9de: 8b 08 mov (%eax),%ecx
bp = (Header*)ap - 1;
9e0: 8d 53 f8 lea -0x8(%ebx),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9e3: 39 d0 cmp %edx,%eax
9e5: 72 11 jb 9f8 <free+0x28>
9e7: 90 nop
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
9e8: 39 c8 cmp %ecx,%eax
9ea: 72 04 jb 9f0 <free+0x20>
9ec: 39 ca cmp %ecx,%edx
9ee: 72 10 jb a00 <free+0x30>
9f0: 89 c8 mov %ecx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9f2: 39 d0 cmp %edx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
9f4: 8b 08 mov (%eax),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9f6: 73 f0 jae 9e8 <free+0x18>
9f8: 39 ca cmp %ecx,%edx
9fa: 72 04 jb a00 <free+0x30>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
9fc: 39 c8 cmp %ecx,%eax
9fe: 72 f0 jb 9f0 <free+0x20>
break;
if(bp + bp->s.size == p->s.ptr){
a00: 8b 73 fc mov -0x4(%ebx),%esi
a03: 8d 3c f2 lea (%edx,%esi,8),%edi
a06: 39 cf cmp %ecx,%edi
a08: 74 1e je a28 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
a0a: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
a0d: 8b 48 04 mov 0x4(%eax),%ecx
a10: 8d 34 c8 lea (%eax,%ecx,8),%esi
a13: 39 f2 cmp %esi,%edx
a15: 74 28 je a3f <free+0x6f>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
a17: 89 10 mov %edx,(%eax)
freep = p;
a19: a3 60 13 00 00 mov %eax,0x1360
}
a1e: 5b pop %ebx
a1f: 5e pop %esi
a20: 5f pop %edi
a21: 5d pop %ebp
a22: c3 ret
a23: 90 nop
a24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
a28: 03 71 04 add 0x4(%ecx),%esi
a2b: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
a2e: 8b 08 mov (%eax),%ecx
a30: 8b 09 mov (%ecx),%ecx
a32: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
a35: 8b 48 04 mov 0x4(%eax),%ecx
a38: 8d 34 c8 lea (%eax,%ecx,8),%esi
a3b: 39 f2 cmp %esi,%edx
a3d: 75 d8 jne a17 <free+0x47>
p->s.size += bp->s.size;
a3f: 03 4b fc add -0x4(%ebx),%ecx
freep = p;
a42: a3 60 13 00 00 mov %eax,0x1360
p->s.size += bp->s.size;
a47: 89 48 04 mov %ecx,0x4(%eax)
p->s.ptr = bp->s.ptr;
a4a: 8b 53 f8 mov -0x8(%ebx),%edx
a4d: 89 10 mov %edx,(%eax)
}
a4f: 5b pop %ebx
a50: 5e pop %esi
a51: 5f pop %edi
a52: 5d pop %ebp
a53: c3 ret
a54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
a5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000a60 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
a60: 55 push %ebp
a61: 89 e5 mov %esp,%ebp
a63: 57 push %edi
a64: 56 push %esi
a65: 53 push %ebx
a66: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
a69: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
a6c: 8b 1d 60 13 00 00 mov 0x1360,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
a72: 8d 48 07 lea 0x7(%eax),%ecx
a75: c1 e9 03 shr $0x3,%ecx
if((prevp = freep) == 0){
a78: 85 db test %ebx,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
a7a: 8d 71 01 lea 0x1(%ecx),%esi
if((prevp = freep) == 0){
a7d: 0f 84 9b 00 00 00 je b1e <malloc+0xbe>
a83: 8b 13 mov (%ebx),%edx
a85: 8b 7a 04 mov 0x4(%edx),%edi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
a88: 39 fe cmp %edi,%esi
a8a: 76 64 jbe af0 <malloc+0x90>
a8c: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax
if(nu < 4096)
a93: bb 00 80 00 00 mov $0x8000,%ebx
a98: 89 45 e4 mov %eax,-0x1c(%ebp)
a9b: eb 0e jmp aab <malloc+0x4b>
a9d: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
aa0: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
aa2: 8b 78 04 mov 0x4(%eax),%edi
aa5: 39 fe cmp %edi,%esi
aa7: 76 4f jbe af8 <malloc+0x98>
aa9: 89 c2 mov %eax,%edx
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
aab: 3b 15 60 13 00 00 cmp 0x1360,%edx
ab1: 75 ed jne aa0 <malloc+0x40>
if(nu < 4096)
ab3: 8b 45 e4 mov -0x1c(%ebp),%eax
ab6: 81 fe 00 10 00 00 cmp $0x1000,%esi
abc: bf 00 10 00 00 mov $0x1000,%edi
ac1: 0f 43 fe cmovae %esi,%edi
ac4: 0f 42 c3 cmovb %ebx,%eax
p = sbrk(nu * sizeof(Header));
ac7: 89 04 24 mov %eax,(%esp)
aca: e8 bb fb ff ff call 68a <sbrk>
if(p == (char*)-1)
acf: 83 f8 ff cmp $0xffffffff,%eax
ad2: 74 18 je aec <malloc+0x8c>
hp->s.size = nu;
ad4: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
ad7: 83 c0 08 add $0x8,%eax
ada: 89 04 24 mov %eax,(%esp)
add: e8 ee fe ff ff call 9d0 <free>
return freep;
ae2: 8b 15 60 13 00 00 mov 0x1360,%edx
if((p = morecore(nunits)) == 0)
ae8: 85 d2 test %edx,%edx
aea: 75 b4 jne aa0 <malloc+0x40>
return 0;
aec: 31 c0 xor %eax,%eax
aee: eb 20 jmp b10 <malloc+0xb0>
if(p->s.size >= nunits){
af0: 89 d0 mov %edx,%eax
af2: 89 da mov %ebx,%edx
af4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
af8: 39 fe cmp %edi,%esi
afa: 74 1c je b18 <malloc+0xb8>
p->s.size -= nunits;
afc: 29 f7 sub %esi,%edi
afe: 89 78 04 mov %edi,0x4(%eax)
p += p->s.size;
b01: 8d 04 f8 lea (%eax,%edi,8),%eax
p->s.size = nunits;
b04: 89 70 04 mov %esi,0x4(%eax)
freep = prevp;
b07: 89 15 60 13 00 00 mov %edx,0x1360
return (void*)(p + 1);
b0d: 83 c0 08 add $0x8,%eax
}
}
b10: 83 c4 1c add $0x1c,%esp
b13: 5b pop %ebx
b14: 5e pop %esi
b15: 5f pop %edi
b16: 5d pop %ebp
b17: c3 ret
prevp->s.ptr = p->s.ptr;
b18: 8b 08 mov (%eax),%ecx
b1a: 89 0a mov %ecx,(%edx)
b1c: eb e9 jmp b07 <malloc+0xa7>
base.s.ptr = freep = prevp = &base;
b1e: c7 05 60 13 00 00 64 movl $0x1364,0x1360
b25: 13 00 00
base.s.size = 0;
b28: ba 64 13 00 00 mov $0x1364,%edx
base.s.ptr = freep = prevp = &base;
b2d: c7 05 64 13 00 00 64 movl $0x1364,0x1364
b34: 13 00 00
base.s.size = 0;
b37: c7 05 68 13 00 00 00 movl $0x0,0x1368
b3e: 00 00 00
b41: e9 46 ff ff ff jmp a8c <malloc+0x2c>
b46: 66 90 xchg %ax,%ax
b48: 66 90 xchg %ax,%ax
b4a: 66 90 xchg %ax,%ax
b4c: 66 90 xchg %ax,%ax
b4e: 66 90 xchg %ax,%ax
00000b50 <benny_thread_create>:
static struct benny_thread_s *bt_new(void);
int
benny_thread_create(benny_thread_t *abt, void (*func)(void*), void *arg_ptr)
{
b50: 55 push %ebp
b51: 89 e5 mov %esp,%ebp
b53: 56 push %esi
b54: 53 push %ebx
b55: 83 ec 10 sub $0x10,%esp
}
static struct benny_thread_s *
bt_new(void)
{
struct benny_thread_s *bt = malloc(sizeof(struct benny_thread_s));
b58: c7 04 24 0c 00 00 00 movl $0xc,(%esp)
b5f: e8 fc fe ff ff call a60 <malloc>
if (bt == NULL) {
b64: 85 c0 test %eax,%eax
struct benny_thread_s *bt = malloc(sizeof(struct benny_thread_s));
b66: 89 c6 mov %eax,%esi
if (bt == NULL) {
b68: 74 66 je bd0 <benny_thread_create+0x80>
// allocate 2 pages worth of memory and then make sure the
// beginning address used for the stack is page alligned.
// we want it page alligned so that we don't generate a
// page fault by accessing the stack for a thread.
bt->bt_stack = bt->mem_stack = malloc(PGSIZE * 2);
b6a: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
b71: e8 ea fe ff ff call a60 <malloc>
if (bt->bt_stack == NULL) {
b76: 85 c0 test %eax,%eax
bt->bt_stack = bt->mem_stack = malloc(PGSIZE * 2);
b78: 89 c3 mov %eax,%ebx
b7a: 89 46 08 mov %eax,0x8(%esi)
b7d: 89 46 04 mov %eax,0x4(%esi)
if (bt->bt_stack == NULL) {
b80: 74 5d je bdf <benny_thread_create+0x8f>
free(bt);
return NULL;
}
if (((uint) bt->bt_stack) % PGSIZE != 0) {
b82: 25 ff 0f 00 00 and $0xfff,%eax
b87: 75 37 jne bc0 <benny_thread_create+0x70>
// allign the thread stack to a page boundary
bt->bt_stack += (PGSIZE - ((uint) bt->bt_stack) % PGSIZE);
}
bt->bid = -1;
b89: c7 06 ff ff ff ff movl $0xffffffff,(%esi)
bt->bid = kthread_create(func, arg_ptr, bt->bt_stack);
b8f: 8b 45 10 mov 0x10(%ebp),%eax
b92: 89 5c 24 08 mov %ebx,0x8(%esp)
b96: 89 44 24 04 mov %eax,0x4(%esp)
b9a: 8b 45 0c mov 0xc(%ebp),%eax
b9d: 89 04 24 mov %eax,(%esp)
ba0: e8 25 fb ff ff call 6ca <kthread_create>
if (bt->bid != 0) {
ba5: 85 c0 test %eax,%eax
bt->bid = kthread_create(func, arg_ptr, bt->bt_stack);
ba7: 89 06 mov %eax,(%esi)
if (bt->bid != 0) {
ba9: 74 2d je bd8 <benny_thread_create+0x88>
*abt = (benny_thread_t) bt;
bab: 8b 45 08 mov 0x8(%ebp),%eax
bae: 89 30 mov %esi,(%eax)
result = 0;
bb0: 31 c0 xor %eax,%eax
}
bb2: 83 c4 10 add $0x10,%esp
bb5: 5b pop %ebx
bb6: 5e pop %esi
bb7: 5d pop %ebp
bb8: c3 ret
bb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bt->bt_stack += (PGSIZE - ((uint) bt->bt_stack) % PGSIZE);
bc0: 29 c3 sub %eax,%ebx
bc2: 81 c3 00 10 00 00 add $0x1000,%ebx
bc8: 89 5e 04 mov %ebx,0x4(%esi)
bcb: eb bc jmp b89 <benny_thread_create+0x39>
bcd: 8d 76 00 lea 0x0(%esi),%esi
bd0: 8b 1d 04 00 00 00 mov 0x4,%ebx
bd6: eb b7 jmp b8f <benny_thread_create+0x3f>
int result = -1;
bd8: b8 ff ff ff ff mov $0xffffffff,%eax
bdd: eb d3 jmp bb2 <benny_thread_create+0x62>
free(bt);
bdf: 89 34 24 mov %esi,(%esp)
return NULL;
be2: 31 f6 xor %esi,%esi
free(bt);
be4: e8 e7 fd ff ff call 9d0 <free>
be9: 8b 5b 04 mov 0x4(%ebx),%ebx
bec: eb a1 jmp b8f <benny_thread_create+0x3f>
bee: 66 90 xchg %ax,%ax
00000bf0 <benny_thread_bid>:
{
bf0: 55 push %ebp
bf1: 89 e5 mov %esp,%ebp
return bt->bid;
bf3: 8b 45 08 mov 0x8(%ebp),%eax
}
bf6: 5d pop %ebp
return bt->bid;
bf7: 8b 00 mov (%eax),%eax
}
bf9: c3 ret
bfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000c00 <benny_thread_join>:
{
c00: 55 push %ebp
c01: 89 e5 mov %esp,%ebp
c03: 53 push %ebx
c04: 83 ec 14 sub $0x14,%esp
c07: 8b 5d 08 mov 0x8(%ebp),%ebx
retVal = kthread_join(bt->bid);
c0a: 8b 03 mov (%ebx),%eax
c0c: 89 04 24 mov %eax,(%esp)
c0f: e8 be fa ff ff call 6d2 <kthread_join>
if (retVal == 0) {
c14: 85 c0 test %eax,%eax
c16: 75 27 jne c3f <benny_thread_join+0x3f>
free(bt->mem_stack);
c18: 8b 53 08 mov 0x8(%ebx),%edx
c1b: 89 45 f4 mov %eax,-0xc(%ebp)
c1e: 89 14 24 mov %edx,(%esp)
c21: e8 aa fd ff ff call 9d0 <free>
bt->bt_stack = bt->mem_stack = NULL;
c26: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
c2d: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx)
free(bt);
c34: 89 1c 24 mov %ebx,(%esp)
c37: e8 94 fd ff ff call 9d0 <free>
c3c: 8b 45 f4 mov -0xc(%ebp),%eax
}
c3f: 83 c4 14 add $0x14,%esp
c42: 5b pop %ebx
c43: 5d pop %ebp
c44: c3 ret
c45: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000c50 <benny_thread_exit>:
{
c50: 55 push %ebp
c51: 89 e5 mov %esp,%ebp
}
c53: 5d pop %ebp
return kthread_exit(exitValue);
c54: e9 81 fa ff ff jmp 6da <kthread_exit>
c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000c60 <benny_mootex_init>:
}
# ifdef BENNY_MOOTEX
int
benny_mootex_init(benny_mootex_t *benny_mootex)
{
c60: 55 push %ebp
c61: 89 e5 mov %esp,%ebp
c63: 8b 45 08 mov 0x8(%ebp),%eax
benny_mootex->locked = 0;
c66: c7 00 00 00 00 00 movl $0x0,(%eax)
benny_mootex->bid = -1;
c6c: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
return 0;
}
c73: 31 c0 xor %eax,%eax
c75: 5d pop %ebp
c76: c3 ret
c77: 89 f6 mov %esi,%esi
c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000c80 <benny_mootex_yieldlock>:
int
benny_mootex_yieldlock(benny_mootex_t *benny_mootex)
{
c80: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
c81: b8 01 00 00 00 mov $0x1,%eax
c86: 89 e5 mov %esp,%ebp
c88: 56 push %esi
c89: 53 push %ebx
c8a: 8b 5d 08 mov 0x8(%ebp),%ebx
c8d: f0 87 03 lock xchg %eax,(%ebx)
// #error this is the call to lock the mootex that will yield in a
// #error loop until the lock is acquired.
while(xchg(&benny_mootex->locked, 1) != 0){
c90: 85 c0 test %eax,%eax
c92: be 01 00 00 00 mov $0x1,%esi
c97: 74 15 je cae <benny_mootex_yieldlock+0x2e>
c99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
benny_yield(void)
{
// # error This just gives up the rest of this scheduled time slice to
// # error another process/thread.
return kthread_yield();
ca0: e8 45 fa ff ff call 6ea <kthread_yield>
ca5: 89 f0 mov %esi,%eax
ca7: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&benny_mootex->locked, 1) != 0){
caa: 85 c0 test %eax,%eax
cac: 75 f2 jne ca0 <benny_mootex_yieldlock+0x20>
return kthread_self();
cae: e8 2f fa ff ff call 6e2 <kthread_self>
benny_mootex->bid = benny_self();
cb3: 89 43 04 mov %eax,0x4(%ebx)
}
cb6: 31 c0 xor %eax,%eax
cb8: 5b pop %ebx
cb9: 5e pop %esi
cba: 5d pop %ebp
cbb: c3 ret
cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000cc0 <benny_mootex_spinlock>:
{
cc0: 55 push %ebp
cc1: ba 01 00 00 00 mov $0x1,%edx
cc6: 89 e5 mov %esp,%ebp
cc8: 53 push %ebx
cc9: 83 ec 04 sub $0x4,%esp
ccc: 8b 5d 08 mov 0x8(%ebp),%ebx
ccf: 90 nop
cd0: 89 d0 mov %edx,%eax
cd2: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&benny_mootex->locked, 1) != 0){
cd5: 85 c0 test %eax,%eax
cd7: 75 f7 jne cd0 <benny_mootex_spinlock+0x10>
return kthread_self();
cd9: e8 04 fa ff ff call 6e2 <kthread_self>
benny_mootex->bid = benny_self();
cde: 89 43 04 mov %eax,0x4(%ebx)
}
ce1: 83 c4 04 add $0x4,%esp
ce4: 31 c0 xor %eax,%eax
ce6: 5b pop %ebx
ce7: 5d pop %ebp
ce8: c3 ret
ce9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000cf0 <benny_mootex_unlock>:
{
cf0: 55 push %ebp
cf1: 89 e5 mov %esp,%ebp
cf3: 53 push %ebx
cf4: 83 ec 04 sub $0x4,%esp
cf7: 8b 5d 08 mov 0x8(%ebp),%ebx
return kthread_self();
cfa: e8 e3 f9 ff ff call 6e2 <kthread_self>
if(tid == benny_mootex->bid){
cff: 39 43 04 cmp %eax,0x4(%ebx)
d02: 75 1c jne d20 <benny_mootex_unlock+0x30>
__sync_synchronize();
d04: 0f ae f0 mfence
return 0;
d07: 31 c0 xor %eax,%eax
benny_mootex->bid = -1;
d09: c7 43 04 ff ff ff ff movl $0xffffffff,0x4(%ebx)
__sync_lock_release(&benny_mootex->locked);
d10: c7 03 00 00 00 00 movl $0x0,(%ebx)
}
d16: 83 c4 04 add $0x4,%esp
d19: 5b pop %ebx
d1a: 5d pop %ebp
d1b: c3 ret
d1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
d20: 83 c4 04 add $0x4,%esp
return -1;
d23: b8 ff ff ff ff mov $0xffffffff,%eax
}
d28: 5b pop %ebx
d29: 5d pop %ebp
d2a: c3 ret
d2b: 90 nop
d2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000d30 <benny_mootex_trylock>:
{
d30: 55 push %ebp
d31: b8 01 00 00 00 mov $0x1,%eax
d36: 89 e5 mov %esp,%ebp
d38: 53 push %ebx
d39: 83 ec 04 sub $0x4,%esp
d3c: 8b 5d 08 mov 0x8(%ebp),%ebx
d3f: f0 87 03 lock xchg %eax,(%ebx)
if(xchg(&benny_mootex->locked, 1) != 0){
d42: 85 c0 test %eax,%eax
d44: 75 08 jne d4e <benny_mootex_trylock+0x1e>
int tid = kthread_self();
d46: e8 97 f9 ff ff call 6e2 <kthread_self>
benny_mootex->bid = tid;
d4b: 89 43 04 mov %eax,0x4(%ebx)
}
d4e: 83 c4 04 add $0x4,%esp
d51: b8 ff ff ff ff mov $0xffffffff,%eax
d56: 5b pop %ebx
d57: 5d pop %ebp
d58: c3 ret
d59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000d60 <benny_mootex_wholock>:
{
d60: 55 push %ebp
d61: 89 e5 mov %esp,%ebp
return benny_mootex->bid;
d63: 8b 45 08 mov 0x8(%ebp),%eax
}
d66: 5d pop %ebp
return benny_mootex->bid;
d67: 8b 40 04 mov 0x4(%eax),%eax
}
d6a: c3 ret
d6b: 90 nop
d6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000d70 <benny_mootex_islocked>:
{
d70: 55 push %ebp
d71: 89 e5 mov %esp,%ebp
return benny_mootex->locked;
d73: 8b 45 08 mov 0x8(%ebp),%eax
}
d76: 5d pop %ebp
return benny_mootex->locked;
d77: 8b 00 mov (%eax),%eax
}
d79: c3 ret
d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000d80 <benny_self>:
{
d80: 55 push %ebp
d81: 89 e5 mov %esp,%ebp
}
d83: 5d pop %ebp
return kthread_self();
d84: e9 59 f9 ff ff jmp 6e2 <kthread_self>
d89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000d90 <benny_yield>:
{
d90: 55 push %ebp
d91: 89 e5 mov %esp,%ebp
}
d93: 5d pop %ebp
return kthread_yield();
d94: e9 51 f9 ff ff jmp 6ea <kthread_yield>
d99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000da0 <benny_cpu_count>:
int
benny_cpu_count(void)
{
da0: 55 push %ebp
da1: 89 e5 mov %esp,%ebp
// # error call the kthread_cpu_count() function.
// kthread_cpu_count();
return kthread_cpu_count();
}
da3: 5d pop %ebp
return kthread_cpu_count();
da4: e9 49 f9 ff ff jmp 6f2 <kthread_cpu_count>
da9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000db0 <benny_thread_count>:
int
benny_thread_count(void)
{
db0: 55 push %ebp
db1: 89 e5 mov %esp,%ebp
// # error call the kthread_thread_count() function.
// kthread_thread_count()
return kthread_thread_count();
}
db3: 5d pop %ebp
return kthread_thread_count();
db4: e9 41 f9 ff ff jmp 6fa <kthread_thread_count>
| 34.820103 | 100 | 0.444494 |
22c556e632089fb2b54bbf233a1b3b76ee2b1344 | 411 | asm | Assembly | oeis/160/A160039.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/160/A160039.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/160/A160039.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A160039: Numerators of n!*(1 + 1/2 + 1/3 +...+ 1/(n+1))
; Submitted by Simon Strandgaard
; 1,3,11,25,274,294,13068,13698,114064,1062864,120543840,123870240,19802759040,20247546240,289277533440,4420892649600,1223405590579200,1243166003251200,431565146817638400,437647401838080000
add $0,1
mov $2,$0
seq $0,254 ; Unsigned Stirling numbers of first kind, s(n+1,2): a(n+1) = (n+1)*a(n) + n!.
gcd $2,$0
div $0,$2
| 41.1 | 189 | 0.720195 |
6c768c26468806c6d91e906c5fec95c9d4ec0104 | 6,993 | asm | Assembly | thirdparty/ffmpeg/libavcodec/x86/cavsidct.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | thirdparty/ffmpeg/libavcodec/x86/cavsidct.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | thirdparty/ffmpeg/libavcodec/x86/cavsidct.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 353 | 2017-05-08T01:33:31.000Z | 2022-03-12T05:57:16.000Z | ; Chinese AVS video (AVS1-P2, JiZhun profile) decoder
; Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
;
; MMX-optimized DSP functions, based on H.264 optimizations by
; Michael Niedermayer and Loren Merritt
; Conversion from gcc syntax to x264asm syntax with modifications
; by Ronald S. Bultje <rsbultje@gmail.com>
;
; 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"
cextern pw_4
cextern pw_64
SECTION .text
%macro CAVS_IDCT8_1D 2-3 1 ; source, round, init_load
%if %3 == 1
mova m4, [%1+7*16] ; m4 = src7
mova m5, [%1+1*16] ; m5 = src1
mova m2, [%1+5*16] ; m2 = src5
mova m7, [%1+3*16] ; m7 = src3
%else
SWAP 1, 7
SWAP 4, 6
%endif
mova m0, m4
mova m3, m5
mova m6, m2
mova m1, m7
paddw m4, m4 ; m4 = 2*src7
paddw m3, m3 ; m3 = 2*src1
paddw m6, m6 ; m6 = 2*src5
paddw m1, m1 ; m1 = 2*src3
paddw m0, m4 ; m0 = 3*src7
paddw m5, m3 ; m5 = 3*src1
paddw m2, m6 ; m2 = 3*src5
paddw m7, m1 ; m7 = 3*src3
psubw m5, m4 ; m5 = 3*src1 - 2*src7 = a0
paddw m7, m6 ; m7 = 3*src3 - 2*src5 = a1
psubw m1, m2 ; m1 = 2*src3 - 3*src5 = a2
paddw m3, m0 ; m3 = 2*src1 - 3*src7 = a3
mova m4, m5
mova m6, m7
mova m0, m3
mova m2, m1
SUMSUB_BA w, 7, 5 ; m7 = a0 + a1, m5 = a0 - a1
paddw m7, m3 ; m7 = a0 + a1 + a3
paddw m5, m1 ; m5 = a0 - a1 + a2
paddw m7, m7
paddw m5, m5
paddw m7, m6 ; m7 = b4
paddw m5, m4 ; m5 = b5
SUMSUB_BA w, 1, 3 ; m1 = a3 + a2, m3 = a3 - a2
psubw m4, m1 ; m4 = a0 - a2 - a3
mova m1, m4 ; m1 = a0 - a2 - a3
psubw m3, m6 ; m3 = a3 - a2 - a1
paddw m1, m1
paddw m3, m3
psubw m1, m2 ; m1 = b7
paddw m3, m0 ; m3 = b6
mova m2, [%1+2*16] ; m2 = src2
mova m6, [%1+6*16] ; m6 = src6
mova m4, m2
mova m0, m6
psllw m4, 2 ; m4 = 4*src2
psllw m6, 2 ; m6 = 4*src6
paddw m2, m4 ; m2 = 5*src2
paddw m0, m6 ; m0 = 5*src6
paddw m2, m2
paddw m0, m0
psubw m4, m0 ; m4 = 4*src2 - 10*src6 = a7
paddw m6, m2 ; m6 = 4*src6 + 10*src2 = a6
mova m2, [%1+0*16] ; m2 = src0
mova m0, [%1+4*16] ; m0 = src4
SUMSUB_BA w, 0, 2 ; m0 = src0 + src4, m2 = src0 - src4
psllw m0, 3
psllw m2, 3
paddw m0, %2 ; add rounding bias
paddw m2, %2 ; add rounding bias
SUMSUB_BA w, 6, 0 ; m6 = a4 + a6, m0 = a4 - a6
SUMSUB_BA w, 4, 2 ; m4 = a5 + a7, m2 = a5 - a7
SUMSUB_BA w, 7, 6 ; m7 = dst0, m6 = dst7
SUMSUB_BA w, 5, 4 ; m5 = dst1, m4 = dst6
SUMSUB_BA w, 3, 2 ; m3 = dst2, m2 = dst5
SUMSUB_BA w, 1, 0 ; m1 = dst3, m0 = dst4
%endmacro
INIT_MMX mmx
cglobal cavs_idct8, 2, 4, 8, 8 * 16, out, in, cnt, tmp
mov cntd, 2
mov tmpq, rsp
.loop_1:
CAVS_IDCT8_1D inq, [pw_4]
psraw m7, 3
psraw m6, 3
psraw m5, 3
psraw m4, 3
psraw m3, 3
psraw m2, 3
psraw m1, 3
psraw m0, 3
mova [tmpq], m7
TRANSPOSE4x4W 0, 2, 4, 6, 7
mova [tmpq+1*8], m0
mova [tmpq+3*8], m2
mova [tmpq+5*8], m4
mova [tmpq+7*8], m6
mova m7, [tmpq]
TRANSPOSE4x4W 7, 5, 3, 1, 0
mova [tmpq+0*8], m7
mova [tmpq+2*8], m5
mova [tmpq+4*8], m3
mova [tmpq+6*8], m1
add inq, mmsize
add tmpq, 64
dec cntd
jg .loop_1
mov cntd, 2
mov tmpq, rsp
.loop_2:
CAVS_IDCT8_1D tmpq, [pw_64]
psraw m7, 7
psraw m6, 7
psraw m5, 7
psraw m4, 7
psraw m3, 7
psraw m2, 7
psraw m1, 7
psraw m0, 7
mova [outq+0*16], m7
mova [outq+1*16], m5
mova [outq+2*16], m3
mova [outq+3*16], m1
mova [outq+4*16], m0
mova [outq+5*16], m2
mova [outq+6*16], m4
mova [outq+7*16], m6
add outq, mmsize
add tmpq, mmsize
dec cntd
jg .loop_2
RET
INIT_XMM sse2
cglobal cavs_idct8, 2, 2, 8 + ARCH_X86_64, 0 - 8 * 16, out, in
CAVS_IDCT8_1D inq, [pw_4]
psraw m7, 3
psraw m6, 3
psraw m5, 3
psraw m4, 3
psraw m3, 3
psraw m2, 3
psraw m1, 3
psraw m0, 3
%if ARCH_X86_64
TRANSPOSE8x8W 7, 5, 3, 1, 0, 2, 4, 6, 8
mova [rsp+4*16], m0
%else
mova [rsp+0*16], m4
TRANSPOSE8x8W 7, 5, 3, 1, 0, 2, 4, 6, [rsp+0*16], [rsp+4*16], 1
%endif
mova [rsp+0*16], m7
mova [rsp+2*16], m3
mova [rsp+6*16], m4
CAVS_IDCT8_1D rsp, [pw_64], 0
psraw m7, 7
psraw m6, 7
psraw m5, 7
psraw m4, 7
psraw m3, 7
psraw m2, 7
psraw m1, 7
psraw m0, 7
mova [outq+0*16], m7
mova [outq+1*16], m5
mova [outq+2*16], m3
mova [outq+3*16], m1
mova [outq+4*16], m0
mova [outq+5*16], m2
mova [outq+6*16], m4
mova [outq+7*16], m6
RET
| 32.985849 | 76 | 0.434577 |
a6ee50bbde7cfc9e9c4591cc90836d0c3b03f104 | 1,792 | asm | Assembly | boot/boot1.asm | ssbostan/zagros | 7ac9959b07d4e5459cdfc9bd34b9ef062c4b9050 | [
"MIT"
] | 21 | 2020-03-28T09:40:49.000Z | 2022-01-28T17:26:01.000Z | boot/boot1.asm | ssbostan/zagros | 7ac9959b07d4e5459cdfc9bd34b9ef062c4b9050 | [
"MIT"
] | null | null | null | boot/boot1.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 ======================
; ================ precompile section ================
#make_boot#
#load_segment=0000#
#load_offset=7c00h#
#cs=0000h#
#ds=0000h#
#es=0000h#
#ss=0000h#
#bp=fdfeh#
#sp=fffeh#
#ax=0#
#bx=0#
#cx=0#
#dx=0#
#si=0#
#di=0#
; ================ precompile section ================
; =================== first sector ===================
org 7c00h
mov ax, 0000h
mov ds, ax
mov es, ax
mov ss, ax
mov bp, 0fdfeh
mov sp, 0fffeh
push es
mov ax, 1000h
mov es, ax
mov ah, 02h
mov al, 08h
mov bx, 00h
mov ch, 00h
mov cl, 02h
mov dh, 00h
mov dl, 00h
int 13h
cmp es:[bx], 33h
jnz exit
jmp 1000h:0000h
exit:
pop es
mov ah, 00h
mov al, 03h
int 10h
mov ah, 01h
mov ch, 20h
mov cl, 00h
int 10h
mov ah, 02h
mov bh, 00h
mov dh, 00h
mov dl, 00h
int 10h
mov ah, 07h
mov al, 00h
mov bh, 07h
mov ch, 00h
mov cl, 00h
mov dh, 18h
mov dl, 4fh
int 10h
mov ah, 13h
mov al, 01h
mov bh, 00h
mov bl, 07h
mov ch, 00h
mov cl, [BOOT_ERROR_LEN]
mov dh, 00h
mov dl, 00h
lea bp, [BOOT_ERROR_MSG]
int 10h
mov ah, 00h
int 16h
jmp 0ffffh:0000h
hlt
; =================== first sector ===================
; ================= define variables =================
BOOT_ERROR_MSG db "Bootloader is missing..."
BOOT_ERROR_LEN db $-BOOT_ERROR_MSG
; ================= define variables =================
| 14.569106 | 56 | 0.453125 |
ac97410c694cfad4841e795f6338155caa696b5f | 451 | asm | Assembly | thcrap/src/bp_entry.asm | exphp-forks/thcrap | df99529271d0bdf08833df3688cfd38ee00a013e | [
"Unlicense"
] | null | null | null | thcrap/src/bp_entry.asm | exphp-forks/thcrap | df99529271d0bdf08833df3688cfd38ee00a013e | [
"Unlicense"
] | null | null | null | thcrap/src/bp_entry.asm | exphp-forks/thcrap | df99529271d0bdf08833df3688cfd38ee00a013e | [
"Unlicense"
] | null | null | null | /**
* Touhou Community Reliant Automatic Patcher
* Main DLL
*
* ----
*
* Breakpoint entry point. Written for i686-w64-mingw32-as.
*/
.intel_syntax
.global _bp_entry, _bp_entry_localptr, _bp_entry_end
_bp_entry:
pusha
pushf
push %esp
_bp_entry_localptr:
push 0x12345678
/* Since we need to be position-independent... */
mov %eax, offset _breakpoint_process
call eax
add %esp, 8
add %esp, %eax
popf
popa
ret
_bp_entry_end:
| 16.107143 | 60 | 0.707317 |
f4b759f1e0a1f5e60ab80cf6009fc42a67434da0 | 1,011 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_1_432.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_1_432.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_1_432.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_normal+0xd203, %rsi
lea addresses_WT+0x7073, %rdi
nop
nop
xor $62358, %r15
mov $106, %rcx
rep movsb
nop
nop
nop
xor $2480, %rax
// Faulty Load
lea addresses_WT+0x1eb33, %rax
nop
nop
add $17241, %r8
movb (%rax), %r15b
lea oracles, %rax
and $0xff, %r15
shlq $12, %r15
mov (%rax,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'00': 1}
00
*/
| 17.431034 | 146 | 0.65183 |
855de9c67e21b9f3e4dc56c286f21194acc7e348 | 479 | asm | Assembly | programs/oeis/346/A346880.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/346/A346880.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/346/A346880.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A346880: Sum of the divisors, except the smallest and the largest, of the n-th positive even number.
; 0,2,5,6,7,15,9,14,20,21,13,35,15,27,41,30,19,54,21,49,53,39,25,75,42,45,65,63,31,107,33,62,77,57,73,122,39,63,89,105,43,139,45,91,143,75,49,155,72,116,113,105,55,171,105,135,125,93,61,239,63,99,185,126,121
add $0,1
mov $2,$0
add $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $1,$3
lpe
mov $0,$1
| 23.95 | 207 | 0.620042 |
196db537464baa6f5f34e0894f832523ea2d553c | 260 | asm | Assembly | kernel/src/arch/x86_64/init/memory.asm | aeleos/VeOS | 4c766539ac10ad7b044bcf1b49fd5f0ae8fc21c6 | [
"MIT"
] | null | null | null | kernel/src/arch/x86_64/init/memory.asm | aeleos/VeOS | 4c766539ac10ad7b044bcf1b49fd5f0ae8fc21c6 | [
"MIT"
] | null | null | null | kernel/src/arch/x86_64/init/memory.asm | aeleos/VeOS | 4c766539ac10ad7b044bcf1b49fd5f0ae8fc21c6 | [
"MIT"
] | null | null | null | global gdt
global gdt.code
global gdt.pointer
section .init
align 4096
gdt:
dq 0 ;required
.code: equ $ - gdt
dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53) ;executable, code, present, 64-bit
.gdt_end:
.pointer:
dw .gdt_end - gdt - 1
dq gdt
| 17.333333 | 87 | 0.592308 |
c5473df755d8b3a73e5223ec16399dc94ef00f91 | 4,059 | asm | Assembly | 1996-fall/mp4/maze3d.asm | ece291/machine-problems | 5f91f9f2ddceb7cda1e14c2973d83023a42d9929 | [
"RSA-MD"
] | 3 | 2016-07-16T04:33:49.000Z | 2021-07-13T16:18:17.000Z | 1997-spring/mp4/maze3d.asm | ece291/machine-problems | 5f91f9f2ddceb7cda1e14c2973d83023a42d9929 | [
"RSA-MD"
] | null | null | null | 1997-spring/mp4/maze3d.asm | ece291/machine-problems | 5f91f9f2ddceb7cda1e14c2973d83023a42d9929 | [
"RSA-MD"
] | null | null | null |
; Additions to MAZE3D.ASM for MP4
; External Routines (called from C)
PUBLIC _TestGeometry
; Public variables (used by C Program and libmp4)
PUBLIC View3d, Side3d, P3d, X3d, W3d, VidMode
; Public variables (used by libmp3)
PUBLIC updatescreen
; =================== External Library Procedures =======================
; LIBMP4 Routines (Comment these out to use your own code)
EXTRN DrawBox:near
EXTRN DrawTrap:near
EXTRN DrawBackWall:near
EXTRN DrawSides:near
EXTRN DrawFloorCeiling:near
EXTRN DrawGrScreen:near
EXTRN UpdateGrScreen:near
; ============================= Variables ===============================
VidMode db TEXTMODE ; Can be TEXTMODE (default) or GRMODE
; Pointed Mouse Attribute:Character Lookup Table (North, East, South, West)
mousech dw MNCH, MECH, MSCH, MWCH
View3d db HALL,HALL,HALL,HALL,HALL,HALL,HALL,HALL,HALL,HALL,WALL
; The elements in _MAZE, looking down a direction
; Sample data (your program will change these)
Side3d db LSW, LRSW,LRSW,LSW, RSW, LRSW, 0 ,LRSW, 0 ,LRSW,LRSW
; The elements to the side (Bit7=1=LeftSideWall | Bit6=1=RightSideWall)
; Sample data (your program will change these)
; 3D Coordinate Arrays
; Widths of walls for each depth (Large at front, small in back)
w3d dw 20, 30, 24, 20, 16, 14, 12, 10, 8, 4, 2
; Sum of W3d (i.e., total size at each depth)
X3d dw 160,140,110, 86, 66, 50, 36, 24, 14, 6, 2
; Position Along the upper-left diagonal (screen offset)
; Example: At Level 2, Top-Left corner is at Column 20, Row 10
P3d dw 0
dw 20+320*10
dw 20+30+320*(10+15)
dw 20+30+24+320*(10+15+12)
dw 20+30+24+20+320*(10+15+12+10)
dw 20+30+24+20+16+320*(10+15+12+10+8)
dw 20+30+24+20+16+14+320*(10+15+12+10+8+7)
dw 20+30+24+20+16+14+12+320*(10+15+12+10+8+7+6)
dw 20+30+24+20+16+14+12+10+320*(10+15+12+10+8+7+6+5)
dw 20+30+24+20+16+14+12+10+8+320*(10+15+12+10+8+7+6+5+4)
dw 20+30+24+20+16+14+12+10+8+4+320*(10+15+12+10+8+7+6+5+4+2)
dw 20+30+24+20+16+14+12+10+8+4+2+320*(10+15+12+10+8+7+6+5+4+2+1)
; ================= Procedures (Your code goes here) ====================
; ============================== Free Code ==============================
_TestGeometry proc far
; Geometry Test Cases
; This routine is called when you run "mazec -t"
; Use and modify this routine to debug your code.
PUSH AX
PUSH BX ; Save Registers
PUSH CX
PUSH DX
PUSH DS
PUSH ES
MOV AX,CS ; Set DS=CS
MOV DS,AX
GMODE ; Switch to 320x200 Graphics-Mode (MACRO)
; --- Draw a Rectangular Box ---
mov dx,160-20
mov cx,40 ; 20 Pixels Wide
mov bx,40 ; 20 Pixels Tall
mov AL,RED ; Colored Red
call drawbox ; Width unchanged
; --- Draw a Left-Sided Trapezoid at left of screen ----
mov dx,0 ; Position
mov bx,80 ; 40 Pixels Tall
mov AL,GREEN ; Colored green
mov AH,0 ; Left-Sided trapezoid
call drawtrap ; Width (CX) unchanged
; --- Draw a Right-Sided Trapezoid at right of screen ---
add dx,320 - 2 ; Position (with -2 correction)
mov AH,1 ; Right-Sided
mov AL,BLUE ; Colored blue
call drawtrap ; Width (CX), Height(BX), and Color(AL) Unchanged
; --- Wait for a keypress while we look at the screen ---
call kbdin
TMODE ; Switch back to 80x25 Text-Mode (MACRO)
call showlibuse
POP ES
POP DS
POP DX
POP CX
POP BX ; Restore Registers
POP AX
ret
_TestGeometry endp
; ------------------------------------------------------------------------
UpdateScreen PROC NEAR
cmp VidMode,TEXTMODE
jne USGrMode
call UpdateTextScreen
ret
USGrMode: Call UpdateGrScreen
ret
UpdateScreen ENDP
| 28.992857 | 75 | 0.558019 |
1cf0babf21e7e4f41b50f4d5b104d93c9cc33365 | 278 | asm | Assembly | programs/oeis/130/A130794.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/130/A130794.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/130/A130794.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A130794: Periodic sequence with period 1,5,3.
; 1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1,5,3,1
mul $0,4
mod $0,6
add $0,1
| 39.714286 | 201 | 0.543165 |
f4d3e05620607eef3164222dc2d6b95c13e28079 | 207 | asm | Assembly | programs/oeis/005/A005359.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/005/A005359.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/005/A005359.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A005359: a(n) = n! if n is even, otherwise 0 (from Taylor series for cos x).
; 1,0,2,0,24,0,720,0,40320,0,3628800,0,479001600,0,87178291200,0,20922789888000,0,6402373705728000,0
sub $1,$0
fac $1
trn $1,0
| 29.571429 | 100 | 0.700483 |
4665abbbb40836e74a39dfd774466495d9be5635 | 5,673 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1a479, %r8
clflush (%r8)
nop
nop
xor $43723, %r11
movw $0x6162, (%r8)
nop
nop
sub %rdi, %rdi
lea addresses_WT_ht+0xf797, %rsi
lea addresses_UC_ht+0x5077, %rdi
sub $55359, %rbp
mov $47, %rcx
rep movsb
nop
nop
inc %rsi
lea addresses_WT_ht+0x5e07, %r11
nop
nop
nop
xor %rax, %rax
movups (%r11), %xmm3
vpextrq $0, %xmm3, %rsi
nop
dec %r8
lea addresses_normal_ht+0x11d67, %rsi
lea addresses_WT_ht+0x15477, %rdi
clflush (%rdi)
nop
cmp $7844, %r13
mov $11, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rax
lea addresses_A_ht+0x1bf2b, %rsi
nop
nop
sub %rcx, %rcx
vmovups (%rsi), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
nop
xor $24058, %rcx
lea addresses_UC_ht+0xf677, %r13
sub $49719, %rcx
movb $0x61, (%r13)
nop
cmp %r11, %r11
lea addresses_D_ht+0x19a77, %r8
and $38147, %r13
vmovups (%r8), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rcx
nop
nop
nop
nop
nop
dec %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r9
push %rbx
push %rdi
// Faulty Load
lea addresses_WT+0xd277, %r15
and %rdi, %rdi
movb (%r15), %bl
lea oracles, %r15
and $0xff, %rbx
shlq $12, %rbx
mov (%r15,%rbx,1), %rbx
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, '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
*/
| 44.320313 | 2,999 | 0.659087 |
3bfdefaa98c6296efe6d76cb783292532074a178 | 303 | asm | Assembly | data/maps/objects/Route18Gate1F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/objects/Route18Gate1F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/objects/Route18Gate1F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | Route18Gate1F_Object:
db $a ; border block
def_warps
warp 0, 4, 0, LAST_MAP
warp 0, 5, 1, LAST_MAP
warp 7, 4, 2, LAST_MAP
warp 7, 5, 3, LAST_MAP
warp 6, 8, 0, ROUTE_18_GATE_2F
def_signs
def_objects
object SPRITE_GUARD, 4, 1, STAY, DOWN, 1 ; person
def_warps_to ROUTE_18_GATE_1F
| 17.823529 | 50 | 0.689769 |
0979bed2c8f40b2ee49a6a59f704dc6ced2ab10a | 1,666 | asm | Assembly | subs/xref.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | subs/xref.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | subs/xref.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE XREF - Copyright (c) SLR Systems 1994
INCLUDE MACROS
XREF_STRUCT STRUC
STORE_PTR DD ?
BYTES_LEFT DD ?
BLOCK_BASE DD ?
BLOCK_CNT DD ?
XREF_STRUCT ENDS
.DATA
EXTERNDEF XR_CURNMOD_GINDEX:DWORD,LAST_XR_CURNMOD_GINDEX:DWORD,FIRST_XREF_BLK:DWORD
.CODE ROOT_TEXT
EXTERNDEF GET_NEW_LOG_BLK:PROC
if fg_xref
PUBLIC STORE_XREF_ENTRY,NEW_XREF_BLK_INIT
STORE_XREF_ENTRY PROC
;
;EAX IS GINDEX TO STORE
;
MOV ECX,XR_CURNMOD_GINDEX
MOV EDX,LAST_XR_CURNMOD_GINDEX
CMP ECX,EDX
JNZ L1$
L3$:
L2$ LABEL PROC
MOV ECX,XREF_STRUCTURE.BYTES_LEFT ;COUNT BYTES LEFT
MOV EDX,XREF_STRUCTURE.STORE_PTR ;STORAGE POINTER
SUB ECX,4
JZ L4$
MOV [EDX],EAX
ADD EDX,4
MOV XREF_STRUCTURE.BYTES_LEFT,ECX
MOV XREF_STRUCTURE.STORE_PTR,EDX
L5$:
RET
L1$:
PUSH EAX
MOV LAST_XR_CURNMOD_GINDEX,ECX
MOV EAX,-1
CALL L2$
MOV EAX,XR_CURNMOD_GINDEX
CALL L2$
POP EAX
JMP L3$
L4$:
PUSH EAX
MOV [EDX],EAX
LEA EAX,[EDX+4]
MOV ECX,OFF XREF_STRUCTURE
ASSUME ECX:PTR XREF_STRUCT
CALL NEW_XREF_BLK
POP EAX
RET
STORE_XREF_ENTRY ENDP
NEW_XREF_BLK PROC
;
;ALLOCATE ANOTHER 16K BLOCK FOR STORING XREF INFORMATION
;
;ESI IS PLACE TO STORE NEW BLOCK ADDRESS
;EBX IS XREF_STRUCTURE
;
MOV EDX,EAX
CALL GET_NEW_LOG_BLK ;GET LOGICAL BLOCK
MOV [EDX],EAX
MOV [ECX].STORE_PTR,EAX
MOV [ECX].BLOCK_BASE,EAX
INC [ECX].BLOCK_CNT
MOV [ECX].BYTES_LEFT,PAGE_SIZE-4
RET
NEW_XREF_BLK ENDP
NEW_XREF_BLK_INIT PROC
MOV EAX,OFF FIRST_XREF_BLK
MOV ECX,OFF XREF_STRUCTURE
CALL NEW_XREF_BLK
RET
NEW_XREF_BLK_INIT ENDP
.DATA?
ALIGN 4
XREF_STRUCTURE XREF_STRUCT<>
endif
END
| 12.621212 | 85 | 0.726291 |
f78f640ef209fb7b2412a728da7557c202de78c0 | 582 | asm | Assembly | programs/oeis/093/A093960.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/093/A093960.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/093/A093960.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A093960: a(1) = 1, a(2) = 2, a(n + 1) = n*a(1) + (n-1)*a(2) + ...(n-r)*a(r + 1) + ... + a(n).
; 1,2,4,11,29,76,199,521,1364,3571,9349,24476,64079,167761,439204,1149851,3010349,7881196,20633239,54018521,141422324,370248451,969323029,2537720636,6643838879,17393796001,45537549124,119218851371,312119004989,817138163596,2139295485799,5600748293801,14662949395604,38388099893011,100501350283429,263115950957276,688846502588399,1803423556807921,4721424167835364
mul $0,2
sub $0,1
mov $1,1
lpb $0,1
sub $0,1
mov $2,1
trn $4,$1
add $2,$4
add $3,$1
add $1,$2
mov $4,$3
lpe
| 36.375 | 362 | 0.704467 |
b546d978c5543484833a25508b76707945a2a200 | 450 | asm | Assembly | libsrc/graphics/osborne/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/graphics/osborne/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/graphics/osborne/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | INCLUDE "graphics/grafix.inc"
SECTION code_clib
PUBLIC cleargraphics
PUBLIC _cleargraphics
EXTERN base_graphics
;
; $Id: clsgraph.asm $
;
; ******************************************************************
;
; Clear graphics area, i.e. reset all bits in graphics
;
;
.cleargraphics
._cleargraphics
ld e,$1a
ld c,2
call 5
ld hl,$f000
ld (hl),32 ; hide cursor (overwrite the underscored space character)
ret
| 16.666667 | 69 | 0.571111 |
7bd67367bd1295947e1a71f8f7d9780428f6dc2e | 31,790 | asm | Assembly | main.asm | VincentFoulon80/vixx | d997ad6ca6e5608b9b18b580eee03a92e98612db | [
"MIT"
] | 1 | 2021-02-10T12:42:15.000Z | 2021-02-10T12:42:15.000Z | main.asm | VincentFoulon80/vixx | d997ad6ca6e5608b9b18b580eee03a92e98612db | [
"MIT"
] | 2 | 2021-02-09T21:32:13.000Z | 2021-02-20T23:14:27.000Z | main.asm | VincentFoulon80/vixx | d997ad6ca6e5608b9b18b580eee03a92e98612db | [
"MIT"
] | null | null | null | is_main = 1
!src "lib/x16.asm"
!src "lib/irq.asm"
!src "lib/vera.asm"
!src "lib/math.asm"
!src "lib/utils.asm"
!src "paper.asm"
; =======================================================================================================
; ### ##### ###### ###### ###### ###### ###### ##### ###### ###### ##########################
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##########################
; ### #### ## ## ## ## ## ###### ## #### ###### ###### ##########################
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##########################
; ### ##### ###### ###### ## ###### ## ## ## ## ## ## ##########################
; =======================================================================================================
prg_boot:
+basic_startup
+fn_vera_init_subroutines
+game_video_init
+game_init
jsr change_gamemode
rts
; =======================================================================================================
; ### ###### ###### ## ## ###### ## ###### ###### ###### ###########################
; ### ## ## ## #### #### ## ## ## ## ## ## ## ## ###########################
; ### ## ### ###### ## ### ## ##### ## ## ## ## ## ###### ###########################
; ### ## ## ## ## ## # ## ## ## ## ## ## ## ## ###########################
; ### ###### ## ## ## ## ###### ###### ###### ###### ## ###########################
; =======================================================================================================
change_gamemode:
lda game_mode ;
;
cmp #gamemode_quit ; \
bne + ; |- gamemode QUIT
jmp quit_game ; /
;
+ cmp #gamemode_title ; \
bne + ; |- gamemode TITLE
jmp title_screen ; /
;
+ cmp #gamemode_game_init ; \
bne + ; |
jsr init_game_screen; |- gamemode INIT GAME
jsr init_game ; |
lda #gamemode_game ; |
sta game_mode ; |
jmp change_gamemode ; /
;
+ cmp #gamemode_game ; \
bne + ; |- gamemode GAME
jmp game_loop ; /
;
+ cmp #gamemode_gameover ; \
bne + ; |- gamemode GAMEOVER
jmp game_over ; /
;
+ jmp quit_game ; )- gamemode not found! quit game
gamemode_quit = $FF
quit_game:
+fn_irq_restore kernal_irq ; \_ restore IRQ and quit
rts ; /
gamemode_title = $00
title_screen: ;
lda hiscore_21 ; \
bne .score_loaded ; |
lda hiscore_43 ; |- check if the hiscore
bne .score_loaded ; | is already loaded.
lda hiscore_65 ; | if not, load from the
bne .score_loaded ; | file
lda hiscore_87 ; |
bne .score_loaded ; /
jsr load_game ; )- load the score file
.score_loaded: ;
lda #t_empty_id ; \
jsr fill_layer0 ; |- reset game screen
jsr init_game_screen ; | and remove all objects
jsr refresh_hiscore ; |
jsr reset_objects ; /
lda #$FF ; \
sta r_obj_t ; |- insert a hidden object
stz r_obj_p ; | the first object has the
stz r_obj_x ; | player sprite
stz r_obj_y ; |
jsr insert_object ; /
lda #$6D ; \
sta r_obj_x ; |- insert the virus object
lda #$50 ; | second object has his sprite
sta r_obj_y ; |
jsr insert_object ; /
jsr sleep_one_frame ; )- wait one frame to update the object positions
+fn_locate 2, 2, str_title_0 ; \
+fn_locate 2, 3, str_title_1 ; |- display the title
+fn_locate 2, 4, str_title_2 ; |
+fn_locate 2, 5, str_title_3 ; |
+fn_locate 2, 6, str_title_4 ; /
- jsr sleep_one_frame ; \
lda #0 ; |
jsr joystick_get ; |- check release start button
and #joystick_mask_start ; |
beq - ; /
+fn_locate 9,16, str_press_start; )- display "press start"
+fn_locate 8,24, str_volume_ctrl; )- display volume controls
+fn_locate 6,21, str_difficulty ; )- display difficulty setting
stz x16_r0 ; )- clear r0
refresh_ui:
lda difficulty ; \
cmp #DIFFICULTY_EASY ; |- check current difficulty setting
bne + ; |
+fn_locate 11,22,str_diff_easy ; | )- write "easy"
bra refresh_volume
+ cmp #DIFFICULTY_HARD ; |
bne + ; |
+fn_locate 11,22,str_diff_hard ; | )- write "hard"
bra refresh_volume
+ +fn_locate 11,22,str_diff_normal; / )- write "normal"
refresh_volume:
+fn_locate 1,25,str_ui_volume ; \_ draw the volume UI
+fn_plot 10,25 ; /
lda music_volume ; \
inc ; |- load the volume divided by 8
lsr ; | so we have 8 segments of volume
lsr ; |
lsr ; |
tax ; /
beq title_wait_start ; \
lda #PET_COLOR_WHITE ; |- if we have segments to draw,
jsr CHROUT ; | print them
lda chr_volume ; |
- jsr CHROUT ; |
dex ; |
bne - ; |
lda #PET_COLOR_BLACK ; |
jsr CHROUT ; /
title_wait_start:
lda wait_frame ; \
bne title_wait_start ; |- wait for next frame
inc wait_frame ; /
lda frame_count ; \
and #$01 ; |- on every odd frame:
bne + ; |
jsr rng ; | \
and #$01 ; | |
adc #$6D ; | |- set the virus's position
sta obj_table+6 ; | | directly via the table
jsr rng ; | | moves it randomly 1 pixel
and #$01 ; | | right or down
adc #$50 ; | |
sta obj_table+7 ; | /
lda volume_cooldown ; | \
beq + ; | |- decrease volume countdown
dec volume_cooldown ; / /
+ lda #0 ; \
jsr joystick_get ; |- MAIN MENU
tay ; |
and #joystick_mask_up ; | \
bne + ; | |- check for joystick UP
lda music_volume ; | | increase the game's volume
clc ; | |
adc #$08 ; | |
bra title_update_volume ; | /
+ tya ; | \
and #joystick_mask_down ; | |- check for joystick DOWN
bne + ; | | decrease the game's volume
lda music_volume ; | |
sec ; | |
sbc #$08 ; | |
bra title_update_volume ; | /
+ tya
and #joystick_mask_left
bne +
lda difficulty
dec
bra title_update_difficulty
+ tya
and #joystick_mask_right
bne +
lda difficulty
inc
bra title_update_difficulty
+ stz volume_cooldown ; | \
tya ; | |- check for joystick START
and #joystick_mask_start ; | | start the game
bne title_wait_start ; | /
bra title_started ; /
title_update_volume:
tax ; \
lda volume_cooldown ; |
bne title_wait_start ; |- updates volume, uses r2 as temporary cooldown
txa ; |
bpl + ; | \_ lower limit ($00)
lda #$00 ; | /
+ cmp #$40 ; | \
bmi + ; | |- upper limit ($3F)
lda #$3F ; | /
+ sta music_volume ; | \
sta sfx_volume ; | |- store the new volume
lda #$05 ; | | and set the cooldown
sta volume_cooldown ; | /
lda #<game_sfx_pause ; | \
sta x16_r0_l ; | |- play the "pause" sfx
lda #>game_sfx_pause ; | | to give a sample to the user
sta x16_r0_h ; | |
jsr play_sfx ; | /
jmp refresh_volume ; /
title_update_difficulty:
tax ; \
lda volume_cooldown ; |
beq + ; |- updates difficulty, uses r2 as temporary cooldown
jmp title_wait_start ; |
+ txa ; |
bpl + ; | \_ lower limit ($00)
lda #$00 ; | /
+ cmp #$03 ; | \
bmi + ; | |- upper limit ($02)
lda #$02 ; | /
+ tax
lda game_status
and #STATUS_FINISHED_NORMAL
bne +
cpx #$02
bne +
ldx #$01
+ stx difficulty ; |
lda #$05 ; |
sta volume_cooldown ; |
lda #<game_sfx_pause ; | \
sta x16_r0_l ; | |- play the "pause" sfx
lda #>game_sfx_pause ; | | to give a sample to the user
sta x16_r0_h ; | |
jsr play_sfx ; | /
+ jmp refresh_ui ; /
title_started:
; game started
+fn_locate 1,2, str_ui_game ; \
+fn_locate 1,3, str_ui_game ; |- clear the title screen
+fn_locate 1,4, str_ui_game ; |
+fn_locate 1,5, str_ui_game ; |
+fn_locate 1,6, str_ui_game ; |
+fn_locate 1,16,str_ui_game ; |
+fn_locate 1,21,str_ui_game ; |
+fn_locate 1,22,str_ui_game ; |
+fn_locate 1,24,str_ui_game ; |
+fn_locate 1,25,str_ui_game ; /
- jsr sleep_one_frame ; \
dec obj_table+7 ; |- move the virus to the
beq + ; | top of the screen
dec obj_table+7 ; | at 2px / frame
bne - ; /
+ ; \
ldx #$04 ; |
- jsr sleep_one_frame ; |- then move it 8 more pixels
dec obj_table+7 ; | to hide it completely
dec obj_table+7 ; |
dex ; |
bne - ; /
lda music_volume ; \
cmp saved_volume ; |- save volume setting
beq + ; |
jsr save_game ; /
+
ldx #$3C ; \
- jsr sleep_one_frame ; |- wait 1 second
dex ; |
bne - ; /
lda #gamemode_game_init ; \
sta game_mode ; |- change gamemode to INIT GAME
jmp change_gamemode ; /
gamemode_gameover = $FE
game_over:
lda #<game_sfx_gameover ; \
sta x16_r0_l ; |- play the "gameover" sfx
lda #>game_sfx_gameover ; |
sta x16_r0_h ; |
jsr play_sfx ; /
lda #t_empty_id ; \
jsr fill_layer0 ; |- clear the game screen
jsr reset_objects ; | and display "game over"
jsr sleep_one_frame ; |
jsr music_clear ; |
+fn_locate 10,10,str_game_over ; /
; compare hiscore with score
lda hiscore_87 ; \
cmp score_87 ; |
bcc .save_score ; |- compare current score
bne + ; | with current high score
lda hiscore_65 ; |
cmp score_65 ; | if score is higher,
bcc .save_score ; | save it (see .save_score)
bne + ; | else skip the save
lda hiscore_43 ; |
cmp score_43 ; |
bcc .save_score ; |
bne + ; |
lda hiscore_21 ; |
cmp score_21 ; |
bcc .save_score ; |
+ jmp .gameover_sleep ; /
.save_score:
jsr save_game ; )- save the score
ldx #$3C ; \
- jsr sleep_one_frame ; |- wait 1 second
dex ; |
bne - ; /
+fn_locate 7, 12, str_new_hiscore;)- display "new hiscore!"
.gameover_sleep
ldx #$3C ; \
ldy #GAMEOVER_WAIT_S ; |
- ; |- sleeping loop
jsr sleep_one_frame ; |
dex ; |
bne - ; |
ldx #$3C ; |
dey ; |
bne - ; /
lda #gamemode_title ; \
sta game_mode ; |- back to title screen
jmp change_gamemode ; /
gamemode_game_init = $01
gamemode_game = $02
game_loop:
lda #0 ; \
jsr joystick_get ; |- check for start button
and #joystick_mask_start ; |
bne + ; /
jmp game_paused
+
lda #0 ; \
jsr joystick_get ; |- check for B button
and #joystick_mask_B ; |
bne + ; /
lda panics ; \_ check if can panic
beq + ; /
jmp throw_panic
+
!src "components/objects.asm"
!src "components/music.asm"
!src "components/choregraphy.asm"
jmp game_loop
game_paused:
lda #<game_sfx_pause ; \
sta x16_r0_l ; |- play the "pause" sfx
lda #>game_sfx_pause ; |
sta x16_r0_h ; |
jsr play_sfx ; /
lda scroll_speed ; \
pha ; |- backup & clear scrolling speed
stz scroll_speed ; /
lda music_volume ; \
pha ; |- backup & clear global volume
stz music_volume ; /
- jsr sleep_one_frame ; \
lda #0 ; |
jsr joystick_get ; |- check release start button
and #joystick_mask_start ; |
beq - ; /
- jsr sleep_one_frame ; \
lda frame_count ; |
and #$20 ; |- display a blinking "paused"
bne + ; |
+fn_locate 31,27, str_paused ; |
jmp .paused_text_printed ; |
+ +fn_locate 31,27, str_paused_clr; |
.paused_text_printed: ; /
lda #0 ; \
jsr joystick_get ; |- check for start button
and #joystick_mask_start ; |
bne - ; /
lda #<game_sfx_pause ; \
sta x16_r0_l ; |- play the "pause" sfx
lda #>game_sfx_pause ; |
sta x16_r0_h ; |
jsr play_sfx ; /
- jsr sleep_one_frame ; \
lda #0 ; |
jsr joystick_get ; |- check release start button
and #joystick_mask_start ; |
beq - ; /
+fn_locate 31,27, str_paused_clr; )- remove "paused" text
pla ; \_ restore global volume
sta music_volume ; /
pla ; \_ restore the scrolling speed
sta scroll_speed ; /
jmp game_loop
throw_panic:
lda scroll_speed ; \
pha ; |- backup & clear scrolling speed
stz scroll_speed ; /
lda music_volume ; \
pha ; |- backup & clear global volume
stz music_volume ; /
dec panics ; \_ update panics counter
jsr refresh_panics ; /
lda #<game_sfx_panic
sta x16_r0_l
lda #>game_sfx_panic
sta x16_r0_h
jsr play_sfx
ldx #$02 ; \
ldy #$7D ; |- change bullet sprite
lda #bullet_panic_spid ; |
jsr change_obj_sprite ; /
lda obj_count ; \ - add obj_count to score
dec ; | \_ remove player & virus from count
dec ; | /
sta x16_r0 ; |
jsr hex_to_dec ; | )- convert obj_count to decimal #0123
ldy #$00 ; | )- Y should contain #00
lda x16_r0 ; | \
asl ; | |- shift hundreds
asl ; | |
asl ; | |
asl ; | |
sta x16_r0 ; | /
lda x16_r1_l ; | \
lsr ; | |- X should contain #12
lsr ; | |
lsr ; | |
lsr ; | |
ora x16_r0 ; | |
tax ; | /
lda x16_r1_l ; | \
asl ; | |- Y should contain #30
asl ; | |
asl ; | |
asl ; | /
jsr add_to_score ; / )- should add #001230 to score
ldx #$3C ; \
- jsr sleep_one_frame ; |- sleep 1 second
dex ; |
bne - ; /
ldx #$08 ; \
- lda obj_table,x ; |
sta x16_r0,x ; |- backup the first two objects
dex ; | (player and virus)
cpx #$FF ; |
bne - ; /
jsr reset_objects ; \
lda #$02 ; |- reset objects and set count to 2
sta obj_count ; /
ldx #$08 ; \
- lda x16_r0,x ; |
sta obj_table,x ; |- restore the first two objects
dex ; |
cpx #$FF ; |
bne - ; /
jsr sleep_one_frame
ldx #$02 ; \
ldy #$7D ; |- restore bullet sprite
lda #bullet_spid ; |
jsr change_obj_sprite ; /
lda #<game_sfx_panic2
sta x16_r0_l
lda #>game_sfx_panic2
sta x16_r0_h
jsr play_sfx
pla ; \_ restore global volume
sta music_volume ; /
pla ; \_ restore the scrolling speed
sta scroll_speed ; /
jmp game_loop
; =======================================================================================================
; ### ###### ## ## ##### ##### ###### ## ## ###### ## ## ## ###### ###### ############
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ## ############
; ### ###### ## ## #### #### ## ## ## ## ## ## ## ## ## ##### ###### ############
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ############
; ### ###### ###### ##### ## ## ###### ###### ## ## ## ## ###### ###### ############
; =======================================================================================================
!src "routines/screen.asm"
; ###########################
sleep_one_frame:
lda #$FF ; \
sta wait_frame ; |- wait vsync
- lda wait_frame ; |
bne - ; /
rts
; ###########################
; ###########################
; Linear feedback shift register (see https://wiki.nesdev.com/w/index.php/Random_number_generator)
; returns a random byte to A (0-255)
; resets Y to 0
rng:
ldy #8 ; iteration count (generates 8 bits)
lda rng_seed_0
-
asl ; shift the register
rol rng_seed_1
bcc +
eor #$39 ; apply XOR feedback whenever a 1 bit is shifted out
+
dey
bne -
sta rng_seed_0
cmp #0 ; reload flags
rts
; ###########################
; ###########################
; Convert input into a BCD value (see http://6502.org/source/integers/hex2dec.htm)
; input: r0
; return: r1
.htd_in = x16_r0
.htd_out= x16_r1
.htd_table:
!word $01, $02, $04, $08, $10, $20, $40, $80
; (Word directive puts low byte first.)
hex_to_dec:
sed ; output gets added up in decimal.
stz .htd_out ; inititalize output word as 0.
stz .htd_out+1
ldx #$0E ; $e is 14 for 2x7 bits. (0-7 is 8 positions.)
-
asl .htd_in ; look at next high bit. if it's 0,
bcc + ; don't add anything to the output for this bit.
lda .htd_out ; otherwise get the running output sum
clc
adc .htd_table,x ; and add the appropriate value for this bit
sta .htd_out ; from the table, and store the new sum.
lda .htd_out+1 ; after low byte, do high byte.
adc .htd_table+1,x
sta .htd_out+1
+ dex ; go down to next bit value to loop again.
dex
bpl - ; if still not done, go back for another loop.
cld
rts
; ###########################
!src "routines/game.asm"
; =======================================================================================================
; ### ## ## ###### ## ## ## ## ###### ## ###### ###### ###### ####################
; ### ## ## ## ## ## #### ## ## ## ## ## ## ## ## ## ####################
; ### ## ## ###### #### ## ## ## ## ## ## ## ## ## ###### ####################
; ### #### ## ## ## #### ## ## ## ## ## ## ## ####################
; ### ## ###### ## ## ## ###### ###### ###### ###### ## ####################
; =======================================================================================================
vsync_loop:
lda vera_isr ; \
and #vera_isr_mask_vsync ; |- work only on vsync
bne + ; |
jmp irq_done ; /
+
backup_vera_addr:
lda vera_high_addr ; \
pha ; |
lda vera_low_addr ; |- backup VERA addresses
pha ; |
lda vera_stride_bank ; |
pha ; /
draw_sprites:
lda #%00010001 ; \_ set vera stride & bank values
sta vera_stride_bank ; /
lda #$FC ; \
sta vera_high_addr ; |- set vera to the sprite address
lda #$02 ; |
sta vera_low_addr ; /
lda #<obj_table-obj_size ; \
sta unsafe_addr_l ; |- init object address
lda #>obj_table-obj_size ; |
sta unsafe_addr_h ; /
ldy obj_count ; \
iny ; |
phy ; |
draw_sprites_lp: ; |
clc ; |- for x=obj_count to 0
+adc16 unsafe_addr,obj_size ; |- addr += obj_size
ply ; |
dey ; |
beq draw_sprites_done ; /
phy
ldy #obj_idx_pos_x ; \
lda (unsafe_addr),Y ; |- update pos x
sta vera_data_0 ; |
stz vera_data_0 ; /
ldy #obj_idx_pos_y ; \
lda (unsafe_addr),Y ; |- update pos y
sta vera_data_0 ; |
stz vera_data_0 ; /
lda vera_data_0 ; \
lda vera_data_0 ; |- sprite data padding
lda vera_data_0 ; |
lda vera_data_0 ; /
jmp draw_sprites_lp
draw_sprites_done:
autoscroll:
lda scroll_speed ; \
beq autoscroll_done ; |
tax ; |- extract bit 7 - 2
clc ; | and store into tmp var
ror ; |
clc ; |
ror ; |
sta unsafe_addr_l ; /
txa ; \
and #$03 ; |- extract bit 1-0
beq + ; |
sta unsafe_addr_h ; /
and frame_count ; \
cmp unsafe_addr_h ; |- handle 1/4 movements
bne + ; |
dec vera_layer0_vscroll_L ; /
+ lda vera_layer0_vscroll_L ; \
sec ; |- handle integer movements
sbc unsafe_addr_l ; |
sta vera_layer0_vscroll_L ; /
autoscroll_done:
psg_upload:
ldy #$00
+fn_vera_set_address $10|vera_mem_psg_bank, vera_mem_psg
-
ldx psg_vo_note,y ; \
lda note_l,x ; |- pick voice note
sta vera_data_0 ; | from note table
lda note_h,x ; |
sta vera_data_0 ; /
lda psg_vo_instr,y ; \
asl ; |- get instrument index
asl ; |
asl ; |
tax ; /
lda psg_vo_volumeHi,y ; \
and music_volume ; |- set instrument waveform
ora instrument_def + instr_idx_direction,x ; | volume and direction
sta vera_data_0 ; | based on instrument table
lda instrument_def + instr_idx_waveform,x ; |
ora #$3F ; |
sta vera_data_0 ; /
iny ; \
cpy #$08 ; |- loop through 8 voices
bne - ; /
psg_upload_sfx:
lda sfx_duration ; \
bne + ; |- check if should play a sfx
stz vera_data_0 ; |
stz vera_data_0 ; |
stz vera_data_0 ; |
stz vera_data_0 ; |
bra psg_upload_end ; /
+ ;
lda sfx_freq_l ; \
sta vera_data_0 ; |- upload SFX to PSG
lda sfx_freq_h ; |
sta vera_data_0 ; |
lda sfx_volume ; |
ora #vera_psg_left|vera_psg_right
sta vera_data_0 ; |
lda sfx_wave ; |
sta vera_data_0 ; /
lda sfx_change ; \
beq psg_upload_sfx_end ; |- update frequency and duration
bmi + ; |
and #$7F ; | \
clc ; | |
adc sfx_freq_l ; | |- add to frequency
bcc psg_upload_sfx_end ; | |
inc sfx_freq_h ; | |
bra psg_upload_sfx_end ; | /
+ and #$7F ; | \
sta unsafe_addr_l ; | |
lda sfx_freq_l ; | |- substract to frequency
sec ; | |
sbc sfx_change ; | |
bcs psg_upload_sfx_end ; | |
dec sfx_freq_h ; | |
bra psg_upload_sfx_end ; | /
psg_upload_sfx_end: ; | \
sta sfx_freq_l ; | |- save the calculated values
dec sfx_duration ; / /
psg_upload_end:
restore_vera_addr:
pla ; \
sta vera_stride_bank ; |
pla ; |- restore VERA addresses
sta vera_low_addr ; |
pla ; |
sta vera_high_addr ; /
stz wait_frame ; \
inc frame_count ; |- increment frame_count and clear wait_frame flag
irq_done: ; | and hand over to the kernal's IRQ handler
jmp (kernal_irq) ; /
; =======================================================================================================
; ### ##### ###### ###### ###### ## ## ##### ###### ###### ###### ##########################
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## ##########################
; ### #### ##### ###### ## ## ## ## #### ## ##### ###### ##########################
; ### ## ## ## ## ## ## ## ## ## ## ## ## ## ##########################
; ### ## ## ###### ###### ###### ###### ## ## ###### ###### ###### ##########################
; =======================================================================================================
!src "components/movements.asm"
!src "resources/strings.asm"
!src "resources/sprites.asm"
!src "resources/tiles.asm"
!src "resources/sfx.asm"
music_idle:
!byte N_GSP
!byte N_VOI,1
!byte N_RTM, 10
music_idle_lp:
!byte N_GNP
!byte N_JMP, <music_idle_lp, >music_idle_lp
!src "resources/musics/coward_menace.asm"
!src "resources/musics/coward_menace2.asm"
!src "resources/musics/coward_menace3.asm"
!src "resources/musics/seeking.asm"
!src "resources/musics/data_rain.asm"
!src "resources/musics/moving_bytes.asm"
choregraphy_start:
!byte CHOR_OP_SPS, $6F, $C7
!byte CHOR_OP_INS, id_mov_plyr, $00
!byte CHOR_OP_SPS, $00, $FF
!byte CHOR_OP_INS, id_mov_incr, $00
!src "resources/levels/1-filesystem.asm"
!src "resources/levels/2-high-ram.asm"
!src "resources/levels/3-low-ram.asm"
; force virus out
!byte CHOR_OP_SPS, $00, $FF
!byte CHOR_OP_INS, id_mov_incr, $00
; end loop, kill the player
!byte CHOR_OP_SPS, $01, $01
!pet CHOR_OP_PRD, 7, 2, "- end of game -", PET_NULL
.choregraphy_end:
!byte CHOR_OP_SLP, $02
!byte CHOR_OP_FPS, $60
!byte CHOR_OP_INS, id_mov_incr, $04
!byte CHOR_OP_JMP, <.choregraphy_end, >.choregraphy_end
| 40.291508 | 105 | 0.361057 |
56aefe5c96b0e5731d68137cbb6fb018cf0cffb7 | 5,010 | asm | Assembly | src/main.asm | Hacktix/BullyGB | e24fe6fd7f3fbc6021e3ee7f0f29e9166fce5937 | [
"MIT"
] | 10 | 2020-12-18T21:57:20.000Z | 2021-10-31T23:17:37.000Z | src/main.asm | Hacktix/BullyGB | e24fe6fd7f3fbc6021e3ee7f0f29e9166fce5937 | [
"MIT"
] | null | null | null | src/main.asm | Hacktix/BullyGB | e24fe6fd7f3fbc6021e3ee7f0f29e9166fce5937 | [
"MIT"
] | null | null | null | INCLUDE "inc/hardware.inc"
INCLUDE "src/functions.asm"
INCLUDE "src/ram.asm"
INCLUDE "src/io.asm"
INCLUDE "src/tests.asm"
SECTION "Vectors", ROM0[$0]
ds $38 - @
;------------------------------------------------------------------------
; General purpose crash handler vector for instruction $FF.
;------------------------------------------------------------------------
CrashHandlerVector::
jp CrashHandler
ds $100 - @
SECTION "Test", ROM0[$100]
di
jp InitTests
ds $150 - @
;------------------------------------------------------------------------
; Initializes the GB for running the testing routines and falls through
; to the test running routine.
;------------------------------------------------------------------------
InitTests::
cp $01
jr nz, .notDMGorSGB ; Check if A = $01 (DMG or SGB)
ld a, h
cp $01
jr z, .isDMG ; Check if H = $01 (DMG)
ld a, $03 ; Otherwise SGB
jr .endModelCheck
.isDMG
ld a, $01
jr .endModelCheck
.notDMGorSGB
cp $ff
jr nz, .notMGBorSGB ; Check if A = $FF (MGB or SGB)
ld a, c
cp $13
jr z, .isMGB ; Check if C = $13 (MGB)
ld a, $03 ; Otherwise SGB
jr .endModelCheck
.isMGB
ld a, $02
jr .endModelCheck
.notMGBorSGB
ld a, b
and a
jr z, .isCGB ; Check if B = $00 (CGB)
ld a, $05 ; Otherwise AGB/AGS
jr .endModelCheck
.isCGB
ld a, $04
.endModelCheck
ldh [hDeviceModel], a
.initWaitLCD
; Wait for VBlank, disable LCD
ldh a, [rLY]
cp SCRN_Y
jr c, .initWaitLCD
xor a
ld [rLCDC], a
;------------------------------------------------------------------------
; Iterates over the given list of tests and locks up once all
; tests finish or one fails.
;------------------------------------------------------------------------
RunTests::
; Initially load pointer to test routine pointers
ld hl, TestRoutines
.testIterateLoop
; Load compatibility header length
ld a, [hli]
cp $ff
jr z, .breakTestLoop ; Break if header $ff found
and a
jr z, .skipCompatibilityCheck ; Run test regardless of model if value is zero
; Check if model is compatible
ld b, a
xor a
ld c, a
.compatibilityCheckLoop
ld a, [hli]
ld d, a
ldh a, [hDeviceModel]
cp d
jr nz, .notCompatible
inc c ; Increment C to $01 if compatible
.notCompatible
dec b
jr nz, .compatibilityCheckLoop
; Run test if compatible
xor a
or c
jr nz, .skipCompatibilityCheck
; Skip test otherwise
inc hl
inc hl
jr .testIterateLoop
.skipCompatibilityCheck
; Load DE with test routine pointer
ld a, [hl]
cp $ff
jr z, .breakTestLoop ; Exit loop when $FF byte is read
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
; Preserve HL, load DE into HL, call HL
push hl
ld h, d
ld l, e
call _hl_
pop hl
; Skip lockup if null pointer returned
ld a, e
or d
jr z, .testIterateLoop
; Print string
call PrintString
; Load font tiles
ld hl, $9210
ld de, FontTiles
ld bc, FontTilesEnd - FontTiles
call Memcpy
; Initialize CGB Palettes
ld a, BCPSF_AUTOINC | 6
ldh [rBCPS], a
xor a
ldh [rBCPD], a
ldh [rBCPD], a
; Initialize DMG Palettes
ld a, %11100100
ldh [rBGP], a
; Enable LCD and lock up
ld a, LCDCF_ON | LCDCF_BGON
ld [rLCDC], a
jr @
.breakTestLoop
; Load font tiles
ld hl, $9210
ld de, FontTiles
ld bc, FontTilesEnd - FontTiles
call Memcpy
; Initialize CGB Palettes
ld a, BCPSF_AUTOINC | 6
ldh [rBCPS], a
xor a
ldh [rBCPD], a
ldh [rBCPD], a
; Initialize DMG Palettes
ld a, %11100100
ldh [rBGP], a
; Print "All tests OK!"
ld de, strAllPassed
call PrintString
; Enable LCD
ld a, LCDCF_ON | LCDCF_BGON
ld [rLCDC], a
jr @
;------------------------------------------------------------------------
; Jumped to from the $38 reset vector (most commonly associated with)
; inaccuracy-related crashes. Fetches a string pointer from HRAM,
; prints it to the screen and locks up.
;------------------------------------------------------------------------
CrashHandler::
; Reset SP in case of stack overflow
ld sp, _RAM+$1000
; Load font tiles
ld hl, $9210
ld de, FontTiles
ld bc, FontTilesEnd - FontTiles
call Memcpy
; Initialize CGB Palettes
ld a, BCPSF_AUTOINC | 6
ldh [rBCPS], a
xor a
ldh [rBCPD], a
ldh [rBCPD], a
; Initialize DMG Palettes
ld a, %11100100
ldh [rBGP], a
; Fetch pointer from HRAM and print
ld hl, hCrashError
ld a, [hli]
ld e, a
ld a, [hl]
ld d, a
call PrintString
; Enable LCD and lock up
ld a, LCDCF_ON | LCDCF_BGON
ld [rLCDC], a
jr @
strAllPassed: db "All tests OK!", 0
SECTION "Font", ROM0
FontTiles:
INCBIN "inc/font.chr"
FontTilesEnd: | 22.070485 | 81 | 0.531936 |
c564023a17689c59ccbe369be978ad0e8c1e8e73 | 268 | asm | Assembly | programs/oeis/004/A004330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/004/A004330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/004/A004330.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A004330: Binomial coefficient C(3n,n-12).
; 1,39,861,14190,194580,2349060,25827165,264385836,2558620845,23667689815,210980549208,1823810410032,15363284301456,126600387152400,1023729916348425,8144022047817960,63871405575418665
mov $1,$0
add $0,12
mul $0,3
bin $0,$1
| 33.5 | 183 | 0.813433 |
e03eb1a3d28dacf1ea1f2f4d281720cfeef59b0a | 7,044 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1982.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_1982.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_1982.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xc42f, %rax
nop
nop
xor %r8, %r8
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
vmovups %ymm4, (%rax)
nop
nop
nop
nop
inc %r11
lea addresses_A_ht+0xfa0f, %r14
nop
nop
nop
and $54225, %rax
movups (%r14), %xmm7
vpextrq $1, %xmm7, %r11
nop
add $20313, %rdx
lea addresses_UC_ht+0x678f, %rsi
nop
nop
nop
nop
nop
and $30728, %r13
movl $0x61626364, (%rsi)
add $29427, %rax
lea addresses_WC_ht+0x19e0f, %r13
add %r14, %r14
mov $0x6162636465666768, %r11
movq %r11, (%r13)
nop
nop
nop
nop
and $25668, %r11
lea addresses_A_ht+0x1060f, %r8
nop
nop
nop
nop
dec %rdx
mov (%r8), %r11
sub $32447, %rax
lea addresses_normal_ht+0x77f5, %rsi
nop
nop
sub %r14, %r14
and $0xffffffffffffffc0, %rsi
movaps (%rsi), %xmm6
vpextrq $1, %xmm6, %r11
nop
nop
xor $49499, %rax
lea addresses_WC_ht+0x3bd1, %r8
clflush (%r8)
nop
nop
nop
xor $20839, %rsi
movw $0x6162, (%r8)
nop
nop
nop
nop
nop
add $51295, %rsi
lea addresses_D_ht+0x17041, %r14
nop
xor $53208, %r13
mov $0x6162636465666768, %r11
movq %r11, %xmm0
vmovups %ymm0, (%r14)
nop
xor $64900, %rax
lea addresses_normal_ht+0x4d8f, %rsi
lea addresses_WT_ht+0x1d40f, %rdi
nop
nop
nop
and $54849, %r14
mov $119, %rcx
rep movsw
nop
nop
cmp %rdx, %rdx
lea addresses_UC_ht+0x770f, %rax
nop
nop
nop
nop
nop
xor $61237, %rdx
mov (%rax), %r14w
nop
nop
add $5050, %r13
lea addresses_A_ht+0x460f, %rsi
lea addresses_D_ht+0x14aa7, %rdi
nop
nop
nop
nop
xor $39935, %r14
mov $100, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0x1780f, %rcx
nop
nop
nop
nop
nop
cmp $39721, %rdi
movups (%rcx), %xmm6
vpextrq $0, %xmm6, %r11
nop
nop
nop
nop
mfence
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r9
push %rbp
push %rbx
push %rdx
// Faulty Load
lea addresses_WC+0x1380f, %r9
nop
nop
nop
nop
nop
add $38610, %rbx
movb (%r9), %r10b
lea oracles, %r14
and $0xff, %r10
shlq $12, %r10
mov (%r14,%r10,1), %r10
pop %rdx
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16, 'NT': True, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 11}, 'OP': 'LOAD'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 34.194175 | 2,999 | 0.658575 |
ed41bf8eaf38540e57e02a767da2f5ca4a2ea8a4 | 168 | asm | Assembly | resources/sleepy.asm | dgtized/redwall | a7feacefed313b343b5cb6cbc1acb379d9f7504b | [
"MIT"
] | null | null | null | resources/sleepy.asm | dgtized/redwall | a7feacefed313b343b5cb6cbc1acb379d9f7504b | [
"MIT"
] | null | null | null | resources/sleepy.asm | dgtized/redwall | a7feacefed313b343b5cb6cbc1acb379d9f7504b | [
"MIT"
] | null | null | null | ;redcode-94
;name Sleepy
;author John Q. Smith
;strategy bombing core
org sleepy
sleepy: ADD #10, -1
MOV 2, @-1
JMP -2
DAT #33, #33
end
| 15.272727 | 22 | 0.559524 |
fe33abcf8bed61ebbe1eaeb9a9a680c22704645f | 9,856 | asm | Assembly | Test/ZXSP/template_p.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 43 | 2019-12-06T23:46:40.000Z | 2022-03-31T15:34:44.000Z | Test/ZXSP/template_p.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 21 | 2019-12-27T01:49:08.000Z | 2022-03-31T15:38:42.000Z | Test/ZXSP/template_p.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 13 | 2019-12-27T00:38:46.000Z | 2022-03-15T08:34:51.000Z | #!/usr/local/bin/zasm -o original/
; ================================================================
; Example source with target 'p' or '81'
; ZX81 tape file / snapshot
; Copyright (c) Günter Woigk 1994 - 2015
; mailto:kio@little-bat.de
; ================================================================
; #target p / #target 81
;
; "p" and "81" files are the same and used when saving ZX81 programs.
; The file consist of the raw ram data as saved by the ZX81 tape saving routine WITHOUT the filename.
; The file can only store one program, not a whole tape with multiple programs.
; The data is save from and loaded back to address $4009++.
;
; #target p81
;
; ".p81" files consist of the raw data as saved by the ZX81 tape saving routine INCLUDING the filename.
; This format can store multiple programs.
; "p81" files are like "p" and "81" files preceded with the program's name.
; The file start with the 1..127 bytes filename, last byte ORed with $80,
; which is exactly what is actually saved by the ZX81 tape saving routine.
;
; --------------------------------------------------------------------
; A ZX81 program is stored like this on a real audio tape:
;
; x seconds video noise
; 5 seconds silence
; 1-127 bytes filename (bit 7 set in last char)
; LEN bytes data, loaded to address $4009, LEN = ($4014)-$4009.
; 1 pulse video retrace signal if display was enabled
; x seconds silence / video noise
;
; --------------------------------------------------------------------
; Notes:
; The data contains system area, basic program, video memory, VARS.
; the last byte of a (clean) file should be $80 (the last byte of VARS)
;
; $4014 defines the end address (used to calculate the file length)
; $4029 points to the next executed (autostarted) BASIC line
; $403B indicates if program runs in SLOW or FAST mode (bit 6)
; $403C++ may be misused for whatever purpose,
; video memory must contain 25 HALT opcodes if the file was saved in SLOW mode.
;
; While loading, the data at address $4014/4015 (E_LINE) is overwritten. After this they contain
; the real data end address of the data loaded and define when loading will stop. :-)
;
; Files should usually not exceed 16 kBytes.
; The memory detection procedure in both ZX80 and ZX81 stops after 16 kBytes (at $8000)
;
;
; ---------------------------------------------------------------
; Character Set
; ---------------------------------------------------------------
;
; $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
; spc gra gra gra gra gra gra gra gra gra gra " £ $ : ?
;
; $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $1A $1B $1C $1D $1E $1F
; ( ) > < = + - * / ; , . 0 1 2 3
;
; $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $2A $2B $2C $2D $2E $2F
; 4 5 6 7 8 9 A B C D E F G H I J
;
; $30 $31 $32 $33 $34 $35 $36 $37 $38 $39 $3A $3B $3C $3D $3E $3F
; K L M N O P Q R S T U V W X Y Z
;
;
; ---------------------------------------------------------------
; Memory Map
; ---------------------------------------------------------------
;
; 16509 - (D_FILE) Basic Program
; (D_FILE) - (VARS) Display File (Screen)
; (VARS) - (E_LINE) Basic Variables; last byte at (E_LINE)-1 = $80
; (E_LINE) - (STKBOT) Line being typed and work space
; (STKBOT) - (STKEND) Calculator Stack
; (STKEND) - (ERR_SP) Spare space and Z80 Machine Stack (sp)
; (ERR_SP) - (RAMTOP) Gosub Stack
; (RAMTOP) End of memory (address of last byte (incl.))
;
; value of RAMTOP:
; $43FF = 17407 For 1k internal ram (ZX81)
; $47FF = 18431 For 2k internal ram (TS1000)
; $7fff = 32767 for 16k Ram Pack
; $bfff = 49151 for 32k Ram Pack
; $ffff = 65535 for 64k Ram Pack
;#target p
;#target 81
#target p81
#charset ZX81
; only if target p81:
#if target(p81)
#code _PROGNAME
dm "PROGNAME" | $80 ; this will be translated by zasm into the ZX81 character set!
#endif
; ---------------------------------------------------------------
; THE SYSTEM VARIABLES
; Source: ZX81 BASIC Programming by Steven Vickers, (c) Sinclair Research Limited
; ---------------------------------------------------------------
;
; SYSVARS $4000 - $4008 which are not saved to tape by the ZX81:
;
#data SYSVARS_NOT_SAVED, $4000, 9
;
ERR_NR db 0 ; 4000 1 less than the report code. Starts off at 255 (for -1), so PEEK 16384, if it works at all, gives 255.
; POKE 16384,n can be used to force an error halt: 0 … 14 gives one of the usual reports,
; 15 … 34 or 99 … 127 gives a nonstandard report, and 35 … 98 is likely to mess up the display file.
FLAGS db 0 ; 4001 X Various flags to control the BASIC system.
ERR_SP dw 0 ; 4002 X Address of first item on machine stack (after GOSUB returns).
RAMTOP dw 0 ; 4004 Address of first byte above BASIC system area. You can poke this to make NEW reserve space above that area
; (see Chapter 26) or to fool CLS into setting up a minimal display file.
; Poking RAMTOP has no effect until one of these two is executed.
MODE db 0 ; 4006 N Specifies K, L, F or G cursor.
PPC dw 0 ; 4007 N Line number of statement currently being executed.
; Poking this has no lasting effect except in the last line of the program.
; SYSVARS $4009 - $403B which are saved in the tape file:
;
#code SYSVARS, $4009, $407D-$4009
;
VERSN db 0 ; 4009 0 identifies 8K ZX81 Basic in saved programs.
E_PPC dw 0 ; 400A Number of current line (with program cursor).
D_FILE dw _DFILE ; 400C X Address of Display File (screen data) in memory.
DF_CC dw 0 ; 400E Address of PRINT position in display file. Can be poked so that PRINT output is sent elsewhere.
VARS dw _VARS ; 4010 X Address of user program variables in memory.
DEST dw 0 ; 4012 N Address of variable in assignment.
E_LINE dw _E_LINE ; 4014 X Address of line being edited in memory.
CH_ADD dw 0 ; 4016 X Address of the next character to be interpreted: the character after the argument of PEEK,
; or the ENTER/NEWLINE at the end of a POKE statement.
X_PTR dw 0 ; 4018 Address of the character preceding the [S] marker.
STKBOT dw 0 ; 401A X Address of the Calculator stack in memory. This is where Basic does the math calculations.
STKEND dw 0 ; 401C X End of the Calculator stack.
BREG db 0 ; 401E N Calculator’s b register.
MEM dw 0 ; 401F N Address of area used for calculator’s memory. (Usually MEMBOT but not always.)
db 0 ; 4021 not used
DF_SZ db 0 ; 4022 X The number of lines (including one blank line) in the lower part of the screen.
S_TOP dw 0 ; 4023 The number of the top program line in automatic listings.
LAST_K dw 0 ; 4025 N Shows which keys pressed
db 0 ; 4027 N Debounce status of keyboard.
MARGIN db 0 ; 4028 N Number of blank lines above or below picture: 55 in Britain (50Hz), 31 in America (60Hz).
NXTLIN dw 0 ; 4029 X Address of next program line to be executed.
OLDPPC dw 0 ; 402B Line number to which CONT jumps.
FLAGX db 0 ; 402D N Various flags.
STRLEN dw 0 ; 402E N Length of string type designation in assignment.
T_ADDR dw 0 ; 4030 N Address of next item in syntax table.
SEED dw 0 ; 4032 The seed for RND. This is the variable that is set by RAND.
FRAMES dw $8000 ; 4034 Counts the frames displayed on the television. Bit 15 is 1. Bits 0 to 14 are decremented for each frame
; sent to the television. This can be used for timing, but PAUSE also uses it. PAUSE resets bit 15 to 0 and
; puts in bits 0 to 14 the length of the pause. When these have been counted down to zero, the pause stops.
; If the pause stops because of a key depression, bit 15 is set to 1 again.
COORDS db 0 ; 4036 x-coordinate of last pointed PLOTted.
db 0 ; 4037 y-coordinate of last pointed PLOTted.
PR_CC db 0 ; 4038 Less significant byte of address of next position for LPRINT to print at (in PRBUFF).
S_POSN db 0 ; 4039 X Column number for PRINT position.
db 0 ; 403A X Line number for PRINT position.
CDFLAG db $80 ; 403B Various flags. Bit 7 is set during compute and display (SLOW) mode.
PRBUFF ds 33 ; 403C Printer buffer (33rd character is ENTER/NEWLINE).
MEMBOT ds 30 ; 405D N Calculator’s memory area; used to store numbers that cannot conveniently be put on the calculator stack.
dw 0 ; 407B not used
; X = The variable should not be poked because the system might crash.
; N = Poking the variable will have no lasting effect.
#assert $ == $407D
; --------------------------------------
; BASIC code and variables, Machine code
; --------------------------------------
#code _BASIC
; add code for Basic starter here
; add basic program and/or machine code here
; The machine code must be hidden somehow in the basic program or in the variables
#code _DFILE
; if saved in slow mode (CDFLAG bit 7 set) the display file must contain valid data
#if 0
; collapsed dfile:
ds 25, opcode(halt)
#else
; inflated dfile:
db opcode(halt)
rept 24
ds 32,' ' ; note: or use $00: ' ' is charset translated to $00 by zasm
db opcode(halt)
endm
#endif
#code _VARS
; add basic variables and/or machine code here
; if less than 16k are installed then the variables will be moved up and down
; as text is printed to the screen!
db $80 ; end-of-variables indicator
_E_LINE:
; unsaved areas:
; (E_LINE) - (STKBOT) Line being typed and work space
; (STKBOT) - (STKEND) Calculator Stack
; (STKEND) - (ERR_SP) Spare space and Z80 Machine Stack (sp)
; (ERR_SP) - (RAMTOP) Gosub Stack
; (RAMTOP) End of memory (address of last byte (incl.))
#end
| 41.586498 | 128 | 0.620231 |
d72a5d009bea2612db9c52b288eba5072d1d903c | 212 | asm | Assembly | oeis/063/A063487.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/063/A063487.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/063/A063487.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A063487: Number of distinct prime divisors of 2^(2^n)-1 (A051179).
; Submitted by Christian Krause
; 0,1,2,3,4,5,7,9,11,13,16,20,25
mov $1,$0
lpb $1
sub $1,1
trn $1,4
add $0,$1
trn $1,2
mul $1,2
lpe
| 16.307692 | 68 | 0.613208 |
9abce87a4c1b8607c5171ec77cacf5865c5817b9 | 391 | asm | Assembly | programs/oeis/305/A305861.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/305/A305861.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/305/A305861.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A305861: a(n) = 32*3^n - 2^(n+5) + 5.
; 5,37,165,613,2085,6757,21285,65893,201765,613477,1856805,5603173,16875045,50756197,152530725,458116453,1375397925,4128290917,12389067045,37175589733,111543546405,334664193637,1004059689765,3012313287013,9037208296485,27112161760357
mov $2,3
mov $3,1
lpb $0
sub $0,1
add $3,$2
mov $2,$3
mul $3,2
add $1,$3
mul $1,2
lpe
mul $1,2
add $1,5
| 24.4375 | 233 | 0.716113 |
f793176d309170930bd276d77070d040d5032fab | 383 | asm | Assembly | oeis/164/A164510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/164/A164510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/164/A164510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A164510: First differences of A071904 (Odd composite numbers).
; Submitted by Jon Maiga
; 6,6,4,2,6,2,4,6,4,2,4,2,6,2,4,6,2,4,4,2,4,2,2,4,6,6,4,2,2,2,2,2,4,4,2,6,2,2,2,6,2,4,2,4,4,2,4,2,6,2,2,2,6,6,2,2,2,2,4,2,2,2,2,4,6,4,2,6,2,2,2,4,2,4,2,4,2,6,2,4,6,2,2,2,4,2,2,2,2,2,4,6,4,2,2,2,2,2,4,2
add $0,1
seq $0,196274 ; Half of the gaps A067970 between odd nonprimes A014076.
mul $0,2
| 47.875 | 201 | 0.616188 |
47bf4d8fb78d93659418427897d59965be4f74ad | 7,197 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_416.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_notsx.log_21829_416.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_notsx.log_21829_416.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x128d, %rdx
cmp $34168, %rbp
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
and $0xffffffffffffffc0, %rdx
movaps %xmm2, (%rdx)
nop
nop
nop
add %r9, %r9
lea addresses_WT_ht+0xc1d, %r9
nop
nop
nop
nop
add %r8, %r8
movups (%r9), %xmm1
vpextrq $1, %xmm1, %r12
sub $54694, %r12
lea addresses_WT_ht+0xfc8d, %r8
nop
nop
and %r10, %r10
mov $0x6162636465666768, %rbp
movq %rbp, %xmm7
and $0xffffffffffffffc0, %r8
movntdq %xmm7, (%r8)
cmp %rdx, %rdx
lea addresses_normal_ht+0x2b1f, %rdx
nop
nop
nop
nop
nop
and $2841, %r8
mov $0x6162636465666768, %r12
movq %r12, %xmm0
movups %xmm0, (%rdx)
nop
nop
nop
nop
nop
xor %r8, %r8
lea addresses_UC_ht+0x182e9, %rsi
lea addresses_UC_ht+0x640d, %rdi
nop
nop
xor $51533, %r10
mov $93, %rcx
rep movsl
sub $6182, %rdi
lea addresses_A_ht+0x10e8d, %rsi
lea addresses_A_ht+0xdc35, %rdi
nop
nop
nop
add $9862, %r8
mov $102, %rcx
rep movsl
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0xe25, %r12
and %rbp, %rbp
mov (%r12), %rdx
nop
nop
nop
nop
nop
and %r10, %r10
lea addresses_D_ht+0x1e50d, %r12
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $0x6162636465666768, %r9
movq %r9, %xmm2
movups %xmm2, (%r12)
nop
nop
cmp $27633, %rdx
lea addresses_WT_ht+0xb28d, %rsi
lea addresses_D_ht+0x1df35, %rdi
nop
nop
nop
nop
xor %rbp, %rbp
mov $78, %rcx
rep movsw
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WT_ht+0x15eed, %r8
nop
nop
and %rdx, %rdx
movb $0x61, (%r8)
nop
nop
nop
nop
nop
and $170, %rbp
lea addresses_WC_ht+0x7001, %rsi
lea addresses_normal_ht+0x548d, %rdi
nop
nop
dec %r12
mov $45, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %rax
push %rbp
push %rbx
push %rcx
push %rdx
// Load
lea addresses_US+0x6ce0, %rbp
clflush (%rbp)
nop
nop
add %rdx, %rdx
mov (%rbp), %cx
nop
nop
nop
nop
nop
xor $31228, %r11
// Faulty Load
lea addresses_PSE+0x1aa8d, %r14
nop
nop
nop
nop
xor %rax, %rax
movb (%r14), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 33.474419 | 2,999 | 0.659164 |
b15bbe8d73839e113cba6d052882c530d2268e37 | 3,040 | asm | Assembly | programs/oeis/016/A016980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/016/A016980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/016/A016980.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A016980: a(n) = (6*n + 5)^12.
; 244140625,3138428376721,582622237229761,21914624432020321,353814783205469041,3379220508056640625,22563490300366186081,116191483108948578241,491258904256726154641,1779197418239532716881,5688009063105712890625,16409682740640811134241,43439888521963583647921,106890007738661124410161,246990403565262140303521,540360087662636962890625,1126825030131969720661201,2252191588960823337718801,4334523100191686738306881,8064241715186276625588961,14551915228366851806640625,25542038069936263923006961,43716643078717303412870881,73119371471655725294164801,119738888098469732352733201,192300484323376406494140625,303326610665644763629211521,470541197898347534873984161,718709255220793060317103921,1082022699327332498100696241,1607166017050789863525390625,2357221572577185690065114881,3416604542324232545384738641,4897252030306448390395044241,6946330348617183160431238081,9755769237612933691650390625,13573982477229290545823357041,18720191467045367574023614321,25601832525455335435322705761,34735600510611194263176918721,46772761567521097265869140625,62529457064557415999535378001,83022819845310162051379891201,109513833574845676773925608481,143557987030641165766449098161,187064908547461032867431640625,242368312385016936196463417761,312307749504346137016129649281,400323831115571027902364072401,510568785444411275443565936401,648034417553121620683837890625,818699769887346816976612516321,1029701028696997844179291768561,1289526489840334121941717217521,1608239688021097644574300393441,1997734107576381138808837890625,2472023231929042220921962513681,3047570054198584854687363929041,3743660564739813658463646963841,4582826154117173651132848229281,5591320323850160818242431640625,6799655583865908142394420049841,8243206936713178643875538610721,9962888906032515816542942031361,12005913662407062729708916003921,14426638435467322602890869140625,17287511078984605626766090564801,20660123377720792838942199093601,24626382453131088146385741940081,29279811441833443519640329077361,34726991488323271274566650390625,41089158014054007099883470298561,48503965201122371247515895457681,57127433662862356193722241010001,67136097368206902852275559609601,78729367044337105142988525390625,92132128505596173454447158291121,107597595648665281034526000582961,125410439217423266704592672361121,145890213878661931676924574560641,169395107664901855540781494140625,196326039436028365961428688382481,227131131690502261690628246149441,262310587822735519273195371913441,302422004779181639964896403690481,348086154015180406603476806640625,399993265701109317068886081212641,458909853273506385605676338637121,525686117678205789920105722386961,601263973011921357734061827559121,686685737739964474054511962890625,783103538254824010709579716221601,891789474247188754533370855326001,1014146598191772065370414777301681,1151720764209211801514619585526561,1306213404656667768955230712890625,1479495296027921174174630123649361,1673621379113289154856256620296081,1890846701885093112349176364977601,2133643557240451317422184503752801
mul $0,6
add $0,5
pow $0,12
| 434.285714 | 2,978 | 0.95625 |
c54cdeaf2f678f4910e81a7e50d54f7fb76f0b41 | 7,394 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_20855_1741.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_20855_1741.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_20855_1741.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 %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xb71d, %rsi
nop
nop
add $883, %r14
movw $0x6162, (%rsi)
nop
and $33153, %rdx
lea addresses_normal_ht+0xc8e1, %r12
and $59902, %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm4
vmovups %ymm4, (%r12)
nop
xor $25302, %r8
lea addresses_D_ht+0x13b11, %rsi
nop
nop
nop
nop
nop
and %r11, %r11
vmovups (%rsi), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r14
nop
mfence
lea addresses_UC_ht+0xe841, %rsi
nop
nop
nop
nop
nop
and $33256, %r8
vmovups (%rsi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %rdx
nop
cmp $59890, %r14
lea addresses_normal_ht+0x17139, %rsi
nop
nop
nop
add %rdx, %rdx
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_WT_ht+0x1df9d, %r14
dec %rcx
movb (%r14), %r12b
dec %rsi
lea addresses_WT_ht+0x1e9e1, %r12
sub $42495, %r8
movl $0x61626364, (%r12)
add %r12, %r12
lea addresses_A_ht+0x14f49, %rcx
nop
nop
nop
add %r12, %r12
mov $0x6162636465666768, %r14
movq %r14, %xmm1
movups %xmm1, (%rcx)
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0xe1e1, %rsi
lea addresses_A_ht+0x1ea57, %rdi
nop
xor $52274, %rdx
mov $43, %rcx
rep movsq
and $41181, %r8
lea addresses_WT_ht+0x25e1, %rdi
nop
nop
nop
nop
nop
dec %rcx
mov $0x6162636465666768, %rsi
movq %rsi, (%rdi)
nop
and %r8, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rax
push %rbp
push %rcx
// Load
lea addresses_A+0x18e55, %rax
nop
nop
nop
and $24918, %r13
mov (%rax), %r10
nop
xor $14594, %rcx
// Store
lea addresses_PSE+0x1a761, %r15
nop
nop
cmp %r10, %r10
mov $0x5152535455565758, %rax
movq %rax, %xmm1
vmovups %ymm1, (%r15)
nop
nop
dec %r15
// Store
lea addresses_WC+0x12961, %r12
nop
nop
and %rbp, %rbp
movl $0x51525354, (%r12)
nop
nop
nop
nop
sub %rbp, %rbp
// Store
lea addresses_WT+0x89e1, %r10
and %r12, %r12
movl $0x51525354, (%r10)
and %r10, %r10
// Faulty Load
lea addresses_normal+0x51e1, %rcx
cmp %rax, %rax
mov (%rcx), %r13w
lea oracles, %rax
and $0xff, %r13
shlq $12, %r13
mov (%rax,%r13,1), %r13
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': True}}
{'34': 20855}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 36.60396 | 2,999 | 0.65472 |
499aa37e520ff3c19e45b0f3c1b9d15bddd7ea0f | 290 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_nearbyint_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_nearbyint_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_nearbyint_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; float nearbyint(float x) __z88dk_fastcall
SECTION code_fp_math48
PUBLIC cm48_sdcciy_nearbyint_fastcall
EXTERN cm48_sdcciyp_dx2m48, am48_nearbyint, cm48_sdcciyp_m482d
cm48_sdcciy_nearbyint_fastcall:
call cm48_sdcciyp_dx2m48
call am48_nearbyint
jp cm48_sdcciyp_m482d
| 17.058824 | 62 | 0.831034 |
18c7a87e6d18c1a33e0977fe6782c502150529ad | 491 | asm | Assembly | programs/oeis/284/A284776.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/284/A284776.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/284/A284776.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A284776: Positions of 0 in A284775; complement of A284777.
; 1,3,4,7,9,11,12,15,16,19,21,22,25,27,28,31,33,35,36,39,40,43,45,47,48,51,52,55,57,58,61,63,65,66,69,70,73,75,76,79,81,83,84,87,88,91,93,94,97,99,100,103,105,107,108,111,112,115,117,119,120,123,124,127,129,130,133,135,136,139,141,143,144,147,148,151,153,155,156,159,160,163,165,166,169,171,173,174,177,178,181,183,184,187,189,190,193,195,197,198
mov $1,$0
mul $0,2
seq $1,284817 ; a(n) = 2n - 1 - A284776(n).
sub $0,$1
add $0,1
| 54.555556 | 346 | 0.682281 |
c29e9d2de7101bfdade2b9b72ee0ee4b88b1093f | 391 | asm | Assembly | programs/oeis/339/A339825.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/339/A339825.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/339/A339825.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A339825: Odd bisection of the infinite Fibonacci word A003849.
; 1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,1
mul $0,2
mov $1,3
mov $2,3
add $2,$0
cal $2,189661 ; Fixed point of the morphism 0->010, 1->10 starting with 0.
sub $1,$0
add $1,$2
add $1,$0
sub $1,3
| 30.076923 | 173 | 0.590793 |
46718a060b11855a4cd437f0946cc085a80f1eca | 588 | asm | Assembly | oeis/195/A195158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/195/A195158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/195/A195158.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A195158: Concentric 24-gonal numbers.
; 0,1,24,49,96,145,216,289,384,481,600,721,864,1009,1176,1345,1536,1729,1944,2161,2400,2641,2904,3169,3456,3745,4056,4369,4704,5041,5400,5761,6144,6529,6936,7345,7776,8209,8664,9121,9600,10081,10584,11089,11616,12145,12696,13249,13824,14401,15000,15601,16224,16849,17496,18145,18816,19489,20184,20881,21600,22321,23064,23809,24576,25345,26136,26929,27744,28561,29400,30241,31104,31969,32856,33745,34656,35569,36504,37441,38400,39361,40344,41329,42336,43345,44376,45409,46464,47521,48600,49681,50784
pow $0,2
mov $1,$0
div $0,2
mul $0,10
add $0,$1
| 65.333333 | 498 | 0.784014 |
5d8e008ef2063ca1444bb85d278247ddc74a5e98 | 136 | asm | Assembly | testcase/jump/jtest.asm | dhy2000/CO_Judger | fcc1d97b738268ca15cfbe8aa628032ce636a14e | [
"MIT"
] | null | null | null | testcase/jump/jtest.asm | dhy2000/CO_Judger | fcc1d97b738268ca15cfbe8aa628032ce636a14e | [
"MIT"
] | null | null | null | testcase/jump/jtest.asm | dhy2000/CO_Judger | fcc1d97b738268ca15cfbe8aa628032ce636a14e | [
"MIT"
] | null | null | null | L0: j JB
L1: ori $t0 $0 50
L2: addiu $t1 $t0 100
L3: andi $t2 $t1 200
L4: ori $t3 $t2 300
L5: xori $t4 $t3 400
j END
JB:
j L1
END:
nop
| 10.461538 | 21 | 0.602941 |
9eb2f8ae76e767ce5cd079af00f2ddb1686f722d | 9,832 | asm | Assembly | Library/Spreadsheet/UI/uiChooseName.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Spreadsheet/UI/uiChooseName.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Spreadsheet/UI/uiChooseName.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @-----------------------------------------------------------------------
Copyright (c) Geoworks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: uiChooseName.asm
AUTHOR: Cheng, 7/92
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 7/92 Initial revision
DESCRIPTION:
$Id: uiChooseName.asm,v 1.1 97/04/07 11:12:40 newdeal Exp $
-------------------------------------------------------------------------------@
;---------------------------------------------------
SpreadsheetClassStructures segment resource
SSChooseNameControlClass ;declare the class record
SpreadsheetClassStructures ends
;---------------------------------------------------
ChooseNameControlCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SSCNGetInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get GenControl info for the SSChooseNameControl
CALLED BY: MSG_GEN_CONTROL_GET_INFO
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of SSChooseNameControlClass
ax - the message
cx:dx - GenControlBuildInfo structure to fill in
RETURN: cx:dx - filled in
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cheng 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SSCNGetInfo method dynamic SSChooseNameControlClass, \
MSG_GEN_CONTROL_GET_INFO
mov si, offset SSCN_dupInfo
mov es, cx
mov di, dx ;es:di = dest
segmov ds, cs
mov cx, size GenControlBuildInfo
rep movsb
ret
SSCNGetInfo endm
SSCN_dupInfo GenControlBuildInfo <
mask GCBF_SUSPEND_ON_APPLY, ; GCBI_flags
SSCN_IniFileKey, ; GCBI_initFileKey
SSCN_gcnList, ; GCBI_gcnList
length SSCN_gcnList, ; GCBI_gcnCount
SSCN_notifyTypeList, ; GCBI_notificationList
length SSCN_notifyTypeList, ; GCBI_notificationCount
SSCNName, ; GCBI_controllerName
handle SSChooseNameControlUI, ; GCBI_dupBlock
SSCN_childList, ; GCBI_childList
length SSCN_childList, ; GCBI_childCount
SSCN_featuresList, ; GCBI_featuresList
length SSCN_featuresList, ; GCBI_featuresCount
SSCN_DEFAULT_FEATURES, ; GCBI_features
0, ; GCBI_toolBlock
0, ; GCBI_toolList
0, ; GCBI_toolCount
0, ; GCBI_toolFeaturesList
0, ; GCBI_toolFeaturesCount
0, ; GCBI_toolFeatures
SSCN_helpContext> ; GCBI_helpContext
if FULL_EXECUTE_IN_PLACE
SpreadsheetControlInfoXIP segment resource
endif
SSCN_helpContext char "dbInsName", 0
SSCN_IniFileKey char "ssChooseName", 0
SSCN_gcnList GCNListType \
<MANUFACTURER_ID_GEOWORKS, GAGCNLT_APP_TARGET_NOTIFY_SPREADSHEET_NAME_CHANGE>
SSCN_notifyTypeList NotificationType \
<MANUFACTURER_ID_GEOWORKS, GWNT_SPREADSHEET_NAME_CHANGE>
;---
SSCN_childList GenControlChildInfo \
<offset ChooseNameDB, mask SSCNF_CHOOSE_NAME, mask GCCF_IS_DIRECTLY_A_FEATURE>
; Careful, this table is in the *opposite* order as the record which
; it corresponds to.
SSCN_featuresList GenControlFeaturesInfo \
<offset ChooseNameList, ChooseNameName, 0>
if FULL_EXECUTE_IN_PLACE
SpreadsheetControlInfoXIP ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SSCNUpdateUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update UI for SSChooseNameControl
CALLED BY: MSG_GEN_CONTROL_UPDATE_UI
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of SSChooseNameControlClass
ax - the message
RETURN: none
DESTROYED: ax, bx, cx, dx, bp, si (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cheng 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SSCNUpdateUI method dynamic SSChooseNameControlClass, \
MSG_GEN_CONTROL_UPDATE_UI
call SSCGetChildBlockAndFeatures
mov ax, MSG_SPREADSHEET_INIT_CHOOSE_NAME_LIST
mov cx, ds:LMBH_handle
mov dx, si
call SSCSendToSpreadsheet
ret
SSCNUpdateUI endm
COMMENT @-----------------------------------------------------------------------
FUNCTION: SSCNUpdateUIWithNumNames
DESCRIPTION:
CALLED BY: INTERNAL (MSG_CNC_UPDATE_UI_WITH_NUM_NAMES)
PASS: cx - number of names
RETURN:
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/92 Initial version
-------------------------------------------------------------------------------@
SSCNUpdateUIWithNumNames method dynamic SSChooseNameControlClass, \
MSG_CNC_UPDATE_UI_WITH_NUM_NAMES
call SSCNEnableDisableUI
call SSCGetChildBlockAndFeatures
mov si, offset ChooseNameList
mov ax, MSG_GEN_DYNAMIC_LIST_INITIALIZE
clr di
call ObjMessage
ret
SSCNUpdateUIWithNumNames endm
COMMENT @-----------------------------------------------------------------------
FUNCTION: SSCNEnableDisableUI
DESCRIPTION:
CALLED BY: INTERNAL ()
PASS: cx - number of names
RETURN:
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/92 Initial version
-------------------------------------------------------------------------------@
SSCNEnableDisableUI proc near uses ax,bx,cx,dx,di,si,bp
.enter
call SSCGetChildBlockAndFeatures ; bx <- child block
;
; We want to enable/disable the Paste trigger
; depending on whether or not there are any items
;
mov ax, MSG_GEN_SET_ENABLED
tst cx ; Check for items
jnz enableDisable ; Branch if has items
mov ax, MSG_GEN_SET_NOT_ENABLED
enableDisable:
;
; If there are no entries in the list we disable the Paste triggers
;
push bx
mov si, offset ChooseNameTrigger
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
pop bx
.leave
ret
SSCNEnableDisableUI endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: SSCNRequestMoniker
DESCRIPTION:
CALLED BY: INTERNAL ()
PASS: cx:dx GenDynamicList OD
bp - entry #
RETURN:
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/92 Initial version
-------------------------------------------------------------------------------@
SSCNRequestMoniker method dynamic SSChooseNameControlClass,
MSG_CHOOSE_NAME_REQUEST_MONIKER
.enter
call SSCGetChildBlockAndFeatures
mov ax, MSG_SPREADSHEET_NAME_REQUEST_ENTRY_MONIKER
mov cx, bx
mov dx, offset ChooseNameList ;^lcx:dx <- OD of list
call SSCSendToSpreadsheet
.leave
ret
SSCNRequestMoniker endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SSCNChooseName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the function that is selected
CALLED BY: MSG_SS_CHOOSE_NAME
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of SSChooseNameControlClass
ax - the message
cx - index of the function in the list
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 9/27/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SSCNChooseName method dynamic SSChooseNameControlClass,
MSG_SS_CHOOSE_NAME
if not KEYBOARD_ONLY_UI
mov ax, MSG_META_RELEASE_FOCUS_EXCL
call ObjCallInstanceNoLock
mov ax, MSG_META_ENSURE_ACTIVE_FT
call GenCallApplication
endif
push si
call SSCGetChildBlockAndFeatures
mov si, offset ChooseNameList ;^lbx:si <- OD of list
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call SSCNObjMessageCall ; ax <- cur selection, carry if none
jc donePop ;branch if none selected
mov cx, ax ; cx <- item to get
mov ax, MSG_GEN_ITEM_GROUP_GET_ITEM_OPTR
call SSCNObjMessageCall ; ^lcx:dx <- selected item
jnc donePop ;branch if none selected
movdw bxsi, cxdx
mov ax, MSG_GEN_GET_VIS_MONIKER
call SSCNObjMessageCall ; ^lax <- VisMoniker chunk
;
; allocate a block of memory for the string and copy the string over
;
push bx, ds
mov si, ax
call ObjLockObjBlock
mov ds, ax
mov si, ds:[si]
ChunkSizePtr ds, si, cx
add si, (offset VM_data + offset VMT_text) ; ds:si <- text string
sub cx, (offset VM_data + offset VMT_text) ; cx <- text size
push cx
mov ax, cx ;ax <- # bytes to allocate
mov cx, (mask HAF_LOCK shl 8)
call MemAlloc ;ax <- seg; bx <- handle
mov es, ax
clr di ;es:di <- dest
pop cx ;cx <- # of bytes to copy
rep movsb
call MemUnlock
mov dx, bx ;dx <- handle of string
pop bx, ds
call MemUnlock
pop si ;*ds:si <- controller
;
; dx = mem handle
;
; clr cx ; string is null-terminated
clr bp ;bp.low <- offset; bp.high <- md
mov ax, MSG_SPREADSHEET_REPLACE_TEXT_SELECTION
clr bx, di
call GenControlOutputActionRegs
ret
donePop:
add sp, 2 ;clear si from stack
ret
SSCNChooseName endm
SSCNObjMessageCall proc near
uses di
.enter
mov di, mask MF_FIXUP_DS or mask MF_CALL
call ObjMessage
.leave
ret
SSCNObjMessageCall endp
ChooseNameControlCode ends
| 23.864078 | 83 | 0.613507 |
a256ee78bb2f9de8faba90742e7ee8ff109356ea | 19,817 | asm | Assembly | PREV/prevNaloga2/prgs/final/matrixmultiplication.asm | RokKos/FRI_Programiranje | d1b0c73585af049be9283447039f5f3e3fa4bdd9 | [
"MIT"
] | 5 | 2016-11-26T14:24:53.000Z | 2020-07-29T07:54:38.000Z | PREV/prevNaloga3/prgs/final/matrixmultiplication.asm | RokKos/FRI_Programiranje | d1b0c73585af049be9283447039f5f3e3fa4bdd9 | [
"MIT"
] | 8 | 2016-12-07T19:32:57.000Z | 2021-06-11T17:58:11.000Z | PREV/prev/prgs/final/matrixmultiplication.asm | RokKos/FRI_Programiranje | d1b0c73585af049be9283447039f5f3e3fa4bdd9 | [
"MIT"
] | 12 | 2016-11-27T17:00:26.000Z | 2018-05-22T04:44:08.000Z | % Code generated by PREV compiler
SP GREG Stack_Segment
FP GREG #6100000000000000
HP GREG Data_Segment
LOC Data_Segment
L4 BYTE " ",0
L5 BYTE "\n",0
L9 BYTE "a:\n",0
L10 BYTE "b:\n",0
L11 BYTE "a*b:\n",0
ReadSize IS 255
ReadArgs BYTE 0,ReadSize
% Code Segment
LOC #500
Main PUSHJ $8,_main
% STOPPING PROGRAM
TRAP 0,Halt,0
% Code for function: _multiply
% --- Prolog ---
_multiply SET $0,56
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,56
SUB SP,SP,$0
JMP L43
L43 SET $0,0
SET $1,$0
SET $0,200
SET $0,$0
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_new
LDO $0,$254,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
SET $0,0
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
L14 SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L21
L13 SET $0,0
SET $2,$0
SET $0,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
STO $2,$0,0
L16 SET $0,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L20
L15 SET $0,0
SET $2,$0
SET $1,$253
SET $0,32
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
STO $2,$0,0
SET $0,0
SET $1,$0
SET $0,$253
SET $2,40
NEG $2,0,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
L18 SET $1,$253
SET $0,32
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L19
L17 SET $1,$253
SET $0,40
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,$253
SET $2,8
SET $2,$2
ADD $0,$0,$2
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,$253
SET $3,16
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $3,$253
SET $2,32
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $3,8
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
LDO $0,$0,0
SET $2,$0
SET $3,$253
SET $0,16
SET $0,$0
ADD $0,$3,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $4,$253
SET $3,32
NEG $3,0,$3
SET $3,$3
ADD $3,$4,$3
SET $3,$3
LDO $3,$3,0
SET $4,$3
SET $3,40
SET $3,$3
MUL $3,$4,$3
SET $3,$3
ADD $0,$0,$3
SET $0,$0
SET $3,$253
SET $4,24
NEG $4,0,$4
SET $4,$4
ADD $3,$3,$4
SET $3,$3
LDO $3,$3,0
SET $3,$3
SET $4,8
SET $4,$4
MUL $3,$3,$4
SET $3,$3
ADD $0,$0,$3
SET $0,$0
LDO $0,$0,0
SET $0,$0
MUL $0,$2,$0
SET $0,$0
ADD $0,$1,$0
SET $1,$0
SET $2,$253
SET $0,40
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
SET $1,$253
SET $0,32
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $2,$0
SET $1,$253
SET $0,32
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
STO $2,$0,0
JMP L18
L19 SET $1,$253
SET $0,40
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,$253
SET $3,16
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $3,40
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $2,$253
SET $3,24
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,8
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
SET $1,$253
SET $0,24
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $0,$0
SET $2,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
STO $0,$1,0
JMP L16
L20 SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,1
SET $1,$1
ADD $0,$0,$1
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
JMP L14
L21 SET $0,$253
SET $1,8
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $0,$0
JMP L44
% --- Epilogue ---
L44 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,56
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _print
% --- Prolog ---
_print SET $0,32
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,48
SUB SP,SP,$0
JMP L45
L45 SET $0,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
L23 SET $1,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L27
L22 SET $0,0
SET $2,$0
SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
STO $2,$0,0
L25 SET $1,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L26
L24 SET $0,0
SET $0,$0
SET $2,$253
SET $1,8
SET $1,$1
ADD $1,$2,$1
SET $1,$1
LDO $1,$1,0
SET $1,$1
SET $3,$253
SET $2,8
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $1,$1,$2
SET $1,$1
SET $3,$253
SET $2,16
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,8
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $1,$1,$2
SET $1,$1
LDO $1,$1,0
SET $1,$1
STO $0,$254,0
STO $1,$254,8
PUSHJ $8,_putInt
LDO $0,$254,0
SET $0,0
SET $2,$0
LDA $0,L4
LDO $1,$0,0
SET $0,$0
STO $2,$254,0
STO $0,$254,8
PUSHJ $8,_putString
LDO $0,$254,0
SET $1,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $0,$0
SET $2,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
STO $0,$1,0
JMP L25
L26 SET $0,0
SET $1,$0
LDA $2,L5
LDO $0,$2,0
SET $0,$2
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_putString
LDO $0,$254,0
SET $0,$253
SET $1,8
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $0,$0
SET $2,$253
SET $1,8
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
STO $0,$1,0
JMP L23
L27 SET $0,0
SET $0,$0
JMP L46
% --- Epilogue ---
L46 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,32
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _init
% --- Prolog ---
_init SET $0,40
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,40
SUB SP,SP,$0
JMP L47
L47 SET $0,0
SET $0,$0
SET $1,200
SET $1,$1
STO $0,$254,0
STO $1,$254,8
PUSHJ $8,_new
LDO $0,$254,0
SET $2,$0
SET $1,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
STO $2,$0,0
SET $0,0
SET $0,$0
SET $2,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
STO $0,$1,0
L29 SET $1,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,5
SET $1,$1
CMP $0,$0,$1
ZSN $0,$0,1
SET $0,$0
BZ $0,L33
L28 SET $0,0
SET $2,$0
SET $0,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
STO $2,$0,0
L31 SET $1,$253
SET $0,24
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L32
L30 SET $0,$253
SET $1,8
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $3,$253
SET $2,16
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $3,$253
SET $2,24
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,8
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
SET $1,$253
SET $0,24
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $1,$0
SET $0,$253
SET $2,24
NEG $2,0,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
JMP L31
L32 SET $1,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,1
SET $1,$1
ADD $0,$0,$1
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
JMP L29
L33 SET $1,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
JMP L48
% --- Epilogue ---
L48 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,40
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _eye
% --- Prolog ---
_eye SET $0,40
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,40
SUB SP,SP,$0
JMP L49
L49 SET $0,0
SET $1,$0
SET $0,200
SET $0,$0
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_new
LDO $0,$254,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
SET $0,0
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
L35 SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,5
SET $1,$1
CMP $0,$0,$1
ZSN $0,$0,1
SET $0,$0
BZ $0,L42
L34 SET $0,0
SET $1,$0
SET $0,$253
SET $2,24
NEG $2,0,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
L37 SET $0,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,5
SET $0,$0
CMP $0,$1,$0
ZSN $0,$0,1
SET $0,$0
BZ $0,L41
L36 SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,$253
SET $2,24
NEG $2,0,$2
SET $2,$2
ADD $1,$1,$2
SET $1,$1
LDO $1,$1,0
SET $1,$1
CMP $0,$0,$1
ZSZ $0,$0,1
SET $0,$0
BZ $0,L40
L38 SET $0,1
SET $1,$0
SET $0,$253
SET $2,8
NEG $2,0,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,$253
SET $3,16
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $3,$253
SET $2,24
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $3,8
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
JMP L39
L40 SET $0,0
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $3,$253
SET $2,16
NEG $2,0,$2
SET $2,$2
ADD $2,$3,$2
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $3,40
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $2,$253
SET $3,24
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $3,8
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
L39 SET $1,$253
SET $0,24
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $1,$0
SET $0,1
SET $0,$0
ADD $0,$1,$0
SET $0,$0
SET $2,$253
SET $1,24
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
STO $0,$1,0
JMP L37
L41 SET $1,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $1,1
SET $1,$1
ADD $0,$0,$1
SET $2,$0
SET $0,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
STO $2,$0,0
JMP L35
L42 SET $1,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$1,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
JMP L50
% --- Epilogue ---
L50 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,40
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _main
% --- Prolog ---
_main SET $0,32
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,56
SUB SP,SP,$0
JMP L51
L51 SET $0,0
SET $0,$0
STO $0,$254,0
PUSHJ $8,_eye
LDO $0,$254,0
SET $2,$0
SET $0,$253
SET $1,8
NEG $1,0,$1
SET $1,$1
ADD $0,$0,$1
SET $0,$0
STO $2,$0,0
SET $0,2
SET $1,$0
SET $2,$253
SET $0,8
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,4
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $2,3
SET $3,$2
SET $2,8
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
SET $0,0
SET $0,$0
LDA $1,L9
LDO $2,$1,0
SET $1,$1
STO $0,$254,0
STO $1,$254,8
PUSHJ $8,_putString
LDO $0,$254,0
SET $0,0
SET $0,$0
SET $2,$253
SET $1,8
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
LDO $1,$1,0
SET $1,$1
STO $0,$254,0
STO $1,$254,8
PUSHJ $8,_print
LDO $0,$254,0
SET $0,0
SET $1,$0
SET $0,1
SET $0,$0
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_init
LDO $0,$254,0
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
STO $1,$0,0
SET $0,9
SET $0,$0
SET $2,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
LDO $1,$1,0
SET $1,$1
SET $2,1
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $1,$1,$2
SET $1,$1
SET $2,2
SET $2,$2
SET $3,8
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $1,$1,$2
SET $1,$1
STO $0,$1,0
SET $0,4
SET $1,$0
SET $0,$253
SET $2,16
NEG $2,0,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,2
SET $3,$2
SET $2,40
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $2,2
SET $2,$2
SET $3,8
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
SET $0,3
SET $1,$0
SET $2,$253
SET $0,16
NEG $0,0,$0
SET $0,$0
ADD $0,$2,$0
SET $0,$0
LDO $0,$0,0
SET $0,$0
SET $2,3
SET $2,$2
SET $3,40
SET $3,$3
MUL $2,$2,$3
SET $2,$2
ADD $0,$0,$2
SET $0,$0
SET $2,2
SET $3,$2
SET $2,8
SET $2,$2
MUL $2,$3,$2
SET $2,$2
ADD $0,$0,$2
SET $0,$0
STO $1,$0,0
SET $0,0
SET $1,$0
LDA $0,L10
LDO $2,$0,0
SET $0,$0
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_putString
LDO $0,$254,0
SET $0,0
SET $0,$0
SET $2,$253
SET $1,16
NEG $1,0,$1
SET $1,$1
ADD $1,$2,$1
SET $1,$1
LDO $1,$1,0
SET $1,$1
STO $0,$254,0
STO $1,$254,8
PUSHJ $8,_print
LDO $0,$254,0
SET $0,0
SET $1,$0
LDA $2,L11
LDO $0,$2,0
SET $0,$2
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_putString
LDO $0,$254,0
SET $0,0
SET $1,$0
SET $0,0
SET $0,$0
SET $2,$253
SET $3,8
NEG $3,0,$3
SET $3,$3
ADD $2,$2,$3
SET $2,$2
LDO $2,$2,0
SET $2,$2
SET $4,$253
SET $3,16
NEG $3,0,$3
SET $3,$3
ADD $3,$4,$3
SET $3,$3
LDO $3,$3,0
SET $3,$3
STO $0,$254,0
STO $2,$254,8
STO $3,$254,16
PUSHJ $8,_multiply
LDO $0,$254,0
SET $0,$0
STO $1,$254,0
STO $0,$254,8
PUSHJ $8,_print
LDO $0,$254,0
SET $0,0
SET $0,$0
JMP L52
% --- Epilogue ---
L52 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,32
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
--- PREV STD LIB ---
% Code for function: _new
% --- Prolog ---
_new SET $0,16
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,24
SUB SP,SP,$0
JMP L53
L53 SET $0,8
ADD $0,FP,$0
LDO $1,$0,0
SET $0,HP % For return value
ADD HP,HP,$1
% --- Epilogue ---
L54 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,16
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
_del POP 8,0 % Memory leak
% Code for function: _putChar
% --- Prolog ---
_putChar SET $0,16
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,24
SUB SP,SP,$0
JMP L55
L55 SET $0,14
ADD $0,FP,$0
%Putting char one position in front
%so that we put end char at the end
LDB $1,$0,1
STB $1,$0,0
SET $1,0
STB $1,$0,1
SET $255,$0
TRAP 0,Fputs,StdOut
% --- Epilogue ---
L56 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,16
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _putString
% --- Prolog ---
_putString SET $0,16
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,24
SUB SP,SP,$0
JMP L57
L57 SET $0,8
ADD $0,FP,$0
LDO $1,$0,0
SET $255,$1
TRAP 0,Fputs,StdOut
% --- Epilogue ---
L58 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,16
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _readString
% --- Prolog ---
_readString SET $0,16
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,24
SUB SP,SP,$0
JMP L59
L59 LDA $255,ReadArgs
SET $0,$255
TRAP 0,Fgets,StdIn
% --- Epilogue ---
L60 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,16
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
% Code for function: _putInt
% --- Prolog ---
_putInt SET $0,32
% Storing FP
SUB $0,SP,$0
STO FP,$0,0
% STORING RA
GET $1,rJ
STO $1,$0,8
% Lowering FP
SET FP,SP
% Lowering SP
SET $0,48
SUB SP,SP,$0
JMP L61
% Storing inverse number
L61 SET $0,16
SUB $0,FP,$0
SET $1,1
STO $1,$0,0
% While condition of inverse loop
_putInt_Inverse_Loop_ SET $0,8
ADD $0,$0,FP
LDO $0,$0,0
BZ $0,_putInt_Print_out_loop
% While loop of inverse loop
SET $0,16
SUB $0,FP,$0
LDO $2,$0,0
MUL $2,$2,10 % Multipling inverse num
SET $0,8
ADD $0,$0,FP
LDO $3,$0,0
DIV $3,$3,10
STO $3,$0,0 % Storing N
GET $1,rR
ADD $2,$2,$1
SET $0,16
SUB $0,FP,$0
STO $2,$0,0
JMP _putInt_Inverse_Loop_
% While condition of print loop
_putInt_Print_out_loop SET $0,16
SUB $0,FP,$0
LDO $0,$0,0
SET $1,1
CMP $0,$0,$1
ZSP $0,$0,1
BZ $0,_putInt_Print_out_end
SET $0,16
SUB $0,FP,$0
LDO $1,$0,0
DIV $1,$1,10
GET $2,rR
STO $1,$0,0
ADD $2,$2,48
STO $2,$254,8
PUSHJ $8,_putChar
JMP _putInt_Print_out_loop
_putInt_Print_out_end JMP L62 % --- Epilogue ---
L62 STO $0,FP,0 % Save return value
% Highering Stack pointer
SET SP,FP
% Getting RA
SET $0,32
SUB $0,SP,$0
LDO $1,$0,8
PUT rJ,$1
% Getting old FP
LDO FP,$0,0
POP 8,0
| 14.134807 | 49 | 0.489933 |
6550970399c6c4e06871e2383ad9e184f70aa9a3 | 1,581 | asm | Assembly | savefile/engine/choice_menu.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 35 | 2018-04-01T06:55:28.000Z | 2021-05-09T19:09:42.000Z | savefile/engine/choice_menu.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 4 | 2018-04-01T15:32:55.000Z | 2019-02-23T20:46:49.000Z | savefile/engine/choice_menu.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 12 | 2018-04-01T15:48:09.000Z | 2021-01-27T10:22:33.000Z | ; === choice_menu.asm
; Functions that aid in creating option choice menus.
; Create and display a new choice menu.
; bc -> textbox dimensions
; hl -> menu text
; Selected option index is saved to A upon completion.
_PrintChoiceMenu:
push bc
push de
call SaveScreenTilesToBuffer1
pop de
pop bc
call ChoiceMenuHandler
push af
call LoadScreenTilesFromBuffer1
pop af
ret
ChoiceMenuHandler:
push bc
push de
push bc
ld de, -20
ld hl, $c48f
inc b
inc c
inc c
.calcHeight
add hl, de
dec b
jr nz, .calcHeight
.calcWidth
dec hl
dec c
jr nz, .calcWidth
pop bc
inc c
push hl
call TextBoxBorder
pop hl
ld de, 22
add hl, de
pop de
push hl
call _PutString
pop hl
dec hl
pop bc
call UpdateSpritesSafeguarded
; fall through to ChoiceMenuLoop
ChoiceMenuLoop:
ld c, 0
.inputLoop
ld de, 20
push hl
push bc
xor a
.cursorDraw
push af
cp c
ld a, $ed
jr z, .cursorOn
ld a, $7f
.cursorOn
ld [hl], a
add hl, de
pop af
inc a
cp b
jr nz, .cursorDraw
.inputdecision
pop bc
pop hl
call WaitNonzeroInput
ld d, a
bit 6, a
jr z, .notU
ld a, c
and a
jr z, .notU
call PlayOptionChangeSound
dec c
.notU
ld a, d
bit 7, a
jr z, .notD
ld a, c
inc a
cp b
jr z, .notD
call PlayOptionChangeSound
inc c
.notD
ld a, d
bit 0, a
jr z, .notA
ld a, c
jp PlayOptionSelectSound
.notA
jr .inputLoop
| 15.201923 | 54 | 0.587603 |
189b09e512f6212687411c4e7fffe54a1b477642 | 7,571 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1075.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1075.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1075.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 %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x15338, %rsi
lea addresses_WC_ht+0x18d78, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $27, %rcx
rep movsb
nop
nop
sub $22038, %r13
lea addresses_A_ht+0x94f8, %rbp
nop
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
movups %xmm6, (%rbp)
nop
nop
nop
nop
nop
dec %rdx
lea addresses_normal_ht+0xb9e8, %rdi
nop
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%rdi), %dx
nop
nop
nop
nop
xor $4657, %rsi
lea addresses_UC_ht+0x3d48, %rsi
lea addresses_UC_ht+0xcd43, %rdi
nop
nop
nop
nop
nop
xor %rbp, %rbp
mov $107, %rcx
rep movsb
nop
nop
nop
add $12203, %rdi
lea addresses_WC_ht+0x18738, %rbp
nop
nop
nop
nop
add $46647, %rdx
mov (%rbp), %ecx
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x126b8, %r14
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
movups %xmm2, (%r14)
nop
nop
nop
sub $57306, %r14
lea addresses_A_ht+0x10faa, %rsi
lea addresses_normal_ht+0x12438, %rdi
nop
nop
nop
nop
sub $38006, %r13
mov $120, %rcx
rep movsw
nop
nop
nop
cmp $16165, %rdi
lea addresses_UC_ht+0x1d18e, %r14
nop
nop
nop
nop
nop
sub $56040, %r13
movl $0x61626364, (%r14)
and $33195, %r13
lea addresses_D_ht+0x90f8, %r13
nop
nop
nop
nop
nop
sub $45093, %rcx
movb (%r13), %r14b
and %rcx, %rcx
lea addresses_A_ht+0x4338, %rcx
sub %rbp, %rbp
movups (%rcx), %xmm7
vpextrq $0, %xmm7, %rdi
nop
and %r14, %r14
lea addresses_WT_ht+0x7ca8, %rdx
nop
nop
nop
xor %rdi, %rdi
movups (%rdx), %xmm5
vpextrq $0, %xmm5, %r14
nop
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_WT_ht+0x14138, %rsi
nop
nop
nop
nop
sub $7046, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm2
movups %xmm2, (%rsi)
nop
nop
nop
inc %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %r9
push %rbp
push %rbx
// Store
lea addresses_RW+0x7938, %r11
nop
nop
cmp $10318, %r9
mov $0x5152535455565758, %rbx
movq %rbx, (%r11)
nop
nop
dec %r15
// Store
lea addresses_D+0x1e078, %r11
nop
nop
nop
dec %r12
movw $0x5152, (%r11)
nop
nop
nop
xor $31792, %r12
// Faulty Load
lea addresses_US+0x1d338, %r14
nop
nop
nop
nop
nop
xor %r11, %r11
movb (%r14), %r9b
lea oracles, %rbx
and $0xff, %r9
shlq $12, %r9
mov (%rbx,%r9,1), %r9
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_RW', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 8, '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
*/
| 31.414938 | 2,999 | 0.657377 |
203d12470ba857de99408bc1323de9e3487d4d5c | 404 | asm | Assembly | oeis/107/A107384.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/107/A107384.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/107/A107384.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A107384: a(n)= a(n-1) +3*a(n-2) -3*a(n-4).
; Submitted by Christian Krause
; 0,1,1,2,5,8,20,38,83,173,362,767,1604,3386,7112,14969,31493,66242,139385,293204,616880,1297766,2730251,5743937,12084050,25422563,53483960,112519838,236719568,498011393,1047718217,2204192882
lpb $0
sub $0,1
mul $1,3
add $2,2
mov $3,$1
mov $1,$2
add $4,$3
mov $2,$4
mov $4,$3
sub $4,4
lpe
mov $0,$1
div $0,2
| 22.444444 | 191 | 0.658416 |
25783cff474c5f90ca7a24f69f98b63d6afe0e06 | 363 | nasm | Assembly | winxp_sp3/trun/pop_calc/system/calc_system.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | winxp_sp3/trun/pop_calc/system/calc_system.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | winxp_sp3/trun/pop_calc/system/calc_system.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | [BITS 32]
global _start
section .text
_start:
xor edx, edx ; zero out edx
push edx ; push null byte onto stack
push 0x6578652e ; push '.exe' onto stack
push 0x636c6163 ; push 'calc' onto stack
mov ebx, esp ; save stack pointer
push ebx ; push pointer to 'calc.exe'
mov edx, 0x77c293c7 ; mov address of system
call edx
| 21.352941 | 47 | 0.650138 |
6fb0040948f9f2f8a1349cf7980d731e4997a207 | 705 | asm | Assembly | tools/DOSBox-0.74Win/FSysFAT/avt/p1_asm/X2_PROC/aa1.asm | cyberitsec/antivirus | 812be691c2a24cc4488ec848b64b57558c0311ab | [
"MIT"
] | 1 | 2021-09-28T23:47:40.000Z | 2021-09-28T23:47:40.000Z | tools/DOSBox-0.74Win/FSysFAT/avt/p1_asm/X2_PROC/aa1.asm | cyberitsec/antivirus | 812be691c2a24cc4488ec848b64b57558c0311ab | [
"MIT"
] | null | null | null | tools/DOSBox-0.74Win/FSysFAT/avt/p1_asm/X2_PROC/aa1.asm | cyberitsec/antivirus | 812be691c2a24cc4488ec848b64b57558c0311ab | [
"MIT"
] | null | null | null | ;doar se compileaza si link-editeaza si doar se discuta pe slide-uri
;mai apoi se transforma in segmente cu nume dupa care se depaneaza
.model small ; diferenta intre model small si large
.stack 10h
.data
n dw 4
vector dw 23,16,35,12
suma dw ?
.code
START:
mov ax,@data
mov ds,ax
mov AX, offset vector
push AX
mov AX,n
push AX
mov AX, offset suma
push AX
CALL addv
mov ax, 4C00h
int 21h
addv PROC NEAR
push BP
mov BP, SP
xor CX,CX
mov CX, [BP+6]
mov BX, [BP+8]
xor AX,AX
xor SI,SI
repeta:
add AX, [BX][SI]
inc SI
inc SI
loop repeta
mov BX, [BP+4]
mov [BX],AX
pop BP
ret 6h
addv ENDP
end START
| 15.326087 | 69 | 0.611348 |
e46741b20c4b37b53fd3bc43f3c7599b8a0e207e | 4,310 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_987.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_987.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_987.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %rbp
push %rcx
push %rdi
lea addresses_WT_ht+0x6138, %rdi
nop
and %r14, %r14
mov (%rdi), %bp
nop
add $15606, %rcx
pop %rdi
pop %rcx
pop %rbp
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %rax
push %rbx
push %rcx
// Store
lea addresses_A+0x12058, %r11
dec %rbx
mov $0x5152535455565758, %rax
movq %rax, %xmm5
vmovups %ymm5, (%r11)
nop
nop
nop
cmp $41548, %r10
// Faulty Load
lea addresses_WT+0x12438, %rcx
nop
nop
nop
inc %rbx
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r11
lea oracles, %r13
and $0xff, %r11
shlq $12, %r11
mov (%r13,%r11,1), %r11
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 59.861111 | 2,999 | 0.661485 |
d08780e47911e12c85884820cfacb07a9f5db7ff | 414 | asm | Assembly | oeis/109/A109634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/109/A109634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/109/A109634.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A109634: Number of 1's that appear among all ternary strings of length n that contain no consecutive 1's.
; 0,1,4,16,56,188,608,1920,5952,18192,54976,164608,489088,1443776,4238336,12382208,36022272,104407296,301618176,868765696,2495715328,7152286720,20452548608,58369409024,166276481024,472876388352
lpb $0
sub $0,1
add $2,2
add $2,$0
max $1,$2
add $2,$3
mul $2,2
mov $3,$1
lpe
mov $0,$1
div $0,2
| 27.6 | 193 | 0.729469 |
c1ae19290b45fbf70c7e5b2ad2cba6439a2714c7 | 435 | asm | Assembly | programs/oeis/196/A196126.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/196/A196126.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/196/A196126.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A196126: Let A = {(x,y): x, y positive natural numbers and y <= x <= y^2}. a(n) is the cardinality of the subset {(x,y) in A such that x <= n}.
; 1,2,4,7,10,14,19,25,32,39,47,56,66,77,89,102,115,129,144,160,177,195,214,234,255,276,298,321,345,370,396,423,451,480,510,541,572,604,637,671
mov $2,$0
mov $3,3
mov $4,$0
lpb $0,1
add $1,$0
sub $0,1
sub $1,$2
trn $2,$3
add $3,2
lpe
add $1,1
lpb $4,1
add $1,1
sub $4,1
lpe
| 22.894737 | 146 | 0.597701 |
0a3bc87d79ec17004721e23f2dbd4a83f0576b56 | 285 | asm | Assembly | tests/bank_bits/2.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 414 | 2016-10-14T22:39:20.000Z | 2022-03-30T07:52:44.000Z | tests/bank_bits/2.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 100 | 2018-03-22T16:12:24.000Z | 2022-03-26T09:19:23.000Z | tests/bank_bits/2.asm | NullMember/customasm | 6e34d6432583a41278e6b3596f1817ae82149531 | [
"Apache-2.0"
] | 47 | 2017-06-29T15:12:13.000Z | 2022-03-10T04:50:51.000Z | #bankdef bits8
{
#bits 8
#addr 0x0
#size 0x8
#outp 0x0
}
#bankdef bits16
{
#bits 16
#addr 0x0
#size 0x8
#outp 8 * 0x8
}
#bank bits8
#d8 -1
#res 1
#d8 -1
#bank bits16
#d16 -1
#res 1
#d16 -1
#bank bits8
#res 1
#d8 -1
; = 0xff00ff00ff000000_ffff0000ffff | 9.827586 | 35 | 0.585965 |
a00eaa415e47c88e28f320b8173a67fcce1acb06 | 1,715 | asm | Assembly | programs/oeis/152/A152996.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/152/A152996.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/152/A152996.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A152996: 9 times pentagonal numbers: 9*n*(3*n-1)/2.
; 0,9,45,108,198,315,459,630,828,1053,1305,1584,1890,2223,2583,2970,3384,3825,4293,4788,5310,5859,6435,7038,7668,8325,9009,9720,10458,11223,12015,12834,13680,14553,15453,16380,17334,18315,19323,20358,21420,22509,23625,24768,25938,27135,28359,29610,30888,32193,33525,34884,36270,37683,39123,40590,42084,43605,45153,46728,48330,49959,51615,53298,55008,56745,58509,60300,62118,63963,65835,67734,69660,71613,73593,75600,77634,79695,81783,83898,86040,88209,90405,92628,94878,97155,99459,101790,104148,106533,108945,111384,113850,116343,118863,121410,123984,126585,129213,131868,134550,137259,139995,142758,145548,148365,151209,154080,156978,159903,162855,165834,168840,171873,174933,178020,181134,184275,187443,190638,193860,197109,200385,203688,207018,210375,213759,217170,220608,224073,227565,231084,234630,238203,241803,245430,249084,252765,256473,260208,263970,267759,271575,275418,279288,283185,287109,291060,295038,299043,303075,307134,311220,315333,319473,323640,327834,332055,336303,340578,344880,349209,353565,357948,362358,366795,371259,375750,380268,384813,389385,393984,398610,403263,407943,412650,417384,422145,426933,431748,436590,441459,446355,451278,456228,461205,466209,471240,476298,481383,486495,491634,496800,501993,507213,512460,517734,523035,528363,533718,539100,544509,549945,555408,560898,566415,571959,577530,583128,588753,594405,600084,605790,611523,617283,623070,628884,634725,640593,646488,652410,658359,664335,670338,676368,682425,688509,694620,700758,706923,713115,719334,725580,731853,738153,744480,750834,757215,763623,770058,776520,783009,789525,796068,802638,809235,815859,822510,829188,835893
mul $0,3
bin $0,2
mul $0,3
mov $1,$0
| 214.375 | 1,622 | 0.83207 |
f49291f14d628f8cfdbb5f66cac18a1e13add43a | 985 | asm | Assembly | tests/include_simple.asm | clubby789/customasm | c85b2422d933e6266dd817e0ec3cbb9e30b181fa | [
"Apache-2.0"
] | 1 | 2021-01-02T13:38:01.000Z | 2021-01-02T13:38:01.000Z | tests/include_simple.asm | clubby789/customasm | c85b2422d933e6266dd817e0ec3cbb9e30b181fa | [
"Apache-2.0"
] | null | null | null | tests/include_simple.asm | clubby789/customasm | c85b2422d933e6266dd817e0ec3cbb9e30b181fa | [
"Apache-2.0"
] | null | null | null | ; ::: cpu.asm
#ruledef test
{
halt => 0x55
}
; ::: code.asm
halt
halt
halt
#d8 0xaa, 0x55, 0xaa
; ::: code2.asm
#include "code.asm"
; :::
#include "cpu.asm"
halt ; = 0x55
; :::
#include "cpu.asm"
#include "code.asm"
; = 0x555555aa55aa
; :::
#include "cpu.asm"
#include "code2.asm"
; = 0x555555aa55aa
; :::
#include "code.asm"
; error: code.asm:2: no match
; error: code.asm:3: no match
; error: code.asm:4: no match
; :::
#include "code.asm"
#include "code2.asm"
; error: code.asm:2: no match
; error: code.asm:3: no match
; error: code.asm:4: no match
; error: code.asm:2: no match
; error: code.asm:3: no match
; error: code.asm:4: no match
; :::
halt ; error: no match
#include "code.asm"
halt ; error: no match
; error: code.asm:2: no match
; error: code.asm:3: no match
; error: code.asm:4: no match
; :::
#include "unk.asm" ; error: not found
; :::
#include "/unk.asm" ; error: not found
; failing in GitHub actions:
;
;#include "C:/unk.asm" ; invalid | 13.133333 | 38 | 0.617259 |
a7e274e47e7fc16ce541794a9d985915a0910ad0 | 1,022 | asm | Assembly | programs/oeis/016/A016789.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/016/A016789.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/016/A016789.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A016789: a(n) = 3*n + 2.
; 2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194,197,200,203,206,209,212,215,218,221,224,227,230,233,236,239,242,245,248,251,254,257,260,263,266,269,272,275,278,281,284,287,290,293,296,299,302,305,308,311,314,317,320,323,326,329,332,335,338,341,344,347,350,353,356,359,362,365,368,371,374,377,380,383,386,389,392,395,398,401,404,407,410,413,416,419,422,425,428,431,434,437,440,443,446,449,452,455,458,461,464,467,470,473,476,479,482,485,488,491,494,497,500,503,506,509,512,515,518,521,524,527,530,533,536,539,542,545,548,551,554,557,560,563,566,569,572,575,578,581,584,587,590,593,596,599,602,605,608,611,614,617,620,623,626,629,632,635,638,641,644,647,650,653,656,659,662,665,668,671,674,677,680,683,686,689,692,695,698,701,704,707,710,713,716,719,722,725,728,731,734,737,740,743,746,749
mov $1,$0
mul $1,3
add $1,2
| 146 | 965 | 0.725049 |
fbe66e162aea44f50cfb6ac7d5fa126c3e9f24ab | 471 | asm | Assembly | programs/oeis/016/A016825.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/016/A016825.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/016/A016825.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A016825: Positive integers congruent to 2 mod 4: a(n) = 4*n+2, for n >= 0.
; 2,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290,294,298,302,306,310,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398
mul $0,4
add $0,2
| 78.5 | 374 | 0.704883 |
0cf8194ff334c1769877c2dafb200ecaa77042e9 | 340 | asm | Assembly | PRG/objects/C565.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/objects/C565.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/objects/C565.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | .byte $01 ; Unknown purpose
.byte OBJ_GOOMBA, $1A, $12
.byte OBJ_GREENTROOPA, $18, $19
.byte OBJ_CFIRE_GOOMBAPIPE_L, $10, $19
.byte OBJ_CFIRE_GOOMBAPIPE_R, $13, $19
.byte OBJ_REDTROOPA, $2D, $13
.byte OBJ_CFIRE_GOOMBAPIPE_L, $34, $12
.byte OBJ_CFIRE_GOOMBAPIPE_R, $37, $12
.byte OBJ_ENDLEVELCARD, $58, $15
.byte $FF ; Terminator
| 28.333333 | 39 | 0.711765 |
e9fb7bfa7349160ef1b7f4a010b010d7bdcb3130 | 3,274 | asm | Assembly | programs/oeis/017/A017292.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017292.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017292.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017292: a(n) = (10*n + 1)^12.
; 1,3138428376721,7355827511386641,787662783788549761,22563490300366186081,309629344375621415601,2654348974297586158321,16409682740640811134241,79766443076872509863361,322475487413604782665681,1126825030131969720661201,3498450596935634189769921,9849732675807611094711841,25542038069936263923006961,61748917974902741368975281,140515219945627518837736801,303326610665644763629211521,625105506678337880602119441,1236354171303115835117980561,2357221572577185690065114881,4348632317396990233762642401,7787345861668898615544483121,13573982477229290545823357041,23085737796000848857434784161,38388797722185519065061084481,62529457064557415999535378001,99927745220846124633825584721,156903087818962082857498424641,242368312385016936196463417761,368736278169776566314796884081,553092726310835924575445943601,818699769887346816976612516321,1196906950228928915420617322241,1729561165382261200512043881361,2472023231929042220921962513681,3496917589577226791795034339201,4898762930960846817716295277921,6799655583865908142394420049841,9356204552249879185458266174961,12767947514633659874603497973281,17287511078984605626766090564801,23232816514396602443039513869521,31001674351559225686692396607441,41089158014054007099883470298561,54108198377272584130510593262881,70813898236538278094070654620401,92132128505596173454447158291121,119193036985710246500182286995041,153370176189268183007030246252161,196326039436028365961428688382481,250064884752295712280965016506001,316993824502572670874954368542721,399993265701109317068886081212641,502497902141583120258735434035761,628589585424465130312977473332081,783103538254824010709579716221601,971749520653969010650290534624321,1201249718626740564963180019260241,1479495296027921174174630123649361,1815723734577332468151810888111681,2220719284911033302994119543767201,2707039063979597279155099296535921,3289267561794796586432994591137841,3984302564291813457966339655092961,4811675759752071123958817122721281,5793911574687201865143063539142801,6956928082211856941544138544277521,8330484142655824678048014536845441,9948677273438057188906683618366561,11850497104030975984667318617160881,14080439653198038396506364992348401,16689188070637629248948480417849121,19734365914790425893382878846383041,23281369493976380470743875853470161,27404286280365141501046272061430481,32186906916727206510367651443384001,37723838875673284825516711307250721,44121730401411477830747380759750641,51500613966215951343360724450403761,59995379109122034297528468395530081,69757385194192116119181424682249601,80956225331421531041301131852482321,93781653446397701682961667766948241,108445687266650227555678831749167361,125184900814733057351483732809459681,144262920861999216020455260748945201,165973142704339215401988956943543921,190641681573470793705176441607975841,218630576996344103142807794339760961,250341268462557039747937124743219281,286218361857094751614277009933470801,326753707264991140811478515720435521,372490809957475540881738158272833441,424029597627673817513439403062184561,482031568259881455640732137886808881,547225344391761231308486996775826401,620412660965527688188300451573157121,702474815464296590198099228001521041,794379610595375902378486843006438161,897188821415476595676138900180228481
mul $0,10
add $0,1
pow $0,12
| 467.714286 | 3,210 | 0.959377 |
5af825815edcfabcb6424bc64e5c5a9d4a22b437 | 4,408 | asm | Assembly | bin/JWASM/Samples/Win32Tls.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | 3 | 2022-03-08T16:53:42.000Z | 2022-03-18T21:55:57.000Z | bin/JWASM/Samples/Win32Tls.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | null | null | null | bin/JWASM/Samples/Win32Tls.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | null | null | null |
;--- sample demonstrates how to
;--- + define static TLS variables ( "__declspec(thread)" in MSC) in assembly.
;--- + access static thread variables.
;--- + use OPTION CODEVIEW to make debugger access the items correctly.
;--- from an assembly point of view, there is not much gained with
;--- static TLS. Unlike in C, access isn't transparent, it's quite similiar
;--- to variables allocated vis TlsAlloc().
;--- assemble: jwasm -coff win32tls.asm
;--- link: link win32tls.obj /subsystem:console kernel32.lib msvcrt.lib
.386
.model FLAT, stdcall
option casemap:none
;--- TLS directory definition from PE/COFF specification (32-bit)
IMAGE_TLS_DIRECTORY32 struct
StartAddressOfRawData DWORD ?
EndAddressOfRawData DWORD ?
AddressOfIndex DWORD ?
AddressOfCallBacks DWORD ?
SizeOfZeroFill DWORD ?
Characteristics DWORD ?
IMAGE_TLS_DIRECTORY32 ends
HANDLE typedef ptr
;--- Win32 functions used in this program
CloseHandle proto :ptr
CreateMutexA proto :ptr, :dword, :ptr
CreateThread proto :ptr, :dword, :ptr, :ptr, :dword, :ptr
ExitProcess proto :dword
ReleaseMutex proto :ptr
Sleep proto :dword
WaitForMultipleObjects proto :dword, :ptr, :dword, :dword
WaitForSingleObject proto :ptr, :dword
;--- CRT functions used in this program
memset proto c :ptr, :dword, :dword
printf proto c :vararg
;--- macro to define a text constant
CStr macro Text:VARARG
local szText
.const
szText db Text,0
.code
exitm <offset szText>
endm
;--- macro to access thread variables
TLSACC macro var
mov eax,fs:[2Ch] ;this is Win32-specific
mov edx,tls_index
mov eax,[eax+edx*4]
exitm <[eax + sectionrel var]>
endm
ifdef __JWASM__
;--- if option -Zi is set and debugger is to show correct value
;--- of static thread variables, option codeview:1 must be set.
option codeview:1
endif
_TLS segment dword alias(".tls") public 'TLS'
tls_start label byte ;start of initialized thread variables
var1 DD -1
tls_end label byte ;end of initialized thread variables
_TLS ends
.const
;--- the important thing is public "_tls_used".
;--- if the linker finds this global label, it will set the TLS data
;--- directory entry in the PE binary.
public _tls_used ;tell the linker that a TLS directory is wanted
_tls_used IMAGE_TLS_DIRECTORY32 <tls_start, tls_end, tls_index, tls_cb_array>
;--- zero-terminated array of TLS callbacks
tls_cb_array label ptr
dd tls_callback
dd 0
.data
tls_index dd -1 ;this variable will receive the index allocated by the loader
.data?
g_hMutex HANDLE ?
.code
assume fs:nothing
;--- thread callback - does nothing
tls_callback proc hMod:HANDLE, Reason:dword, Reserved:ptr
; invoke printf, CStr("tls_callback: reason=%d",10), Reason
ret
tls_callback endp
;--- thread procedure
threadproc proc uses ebx lParam:dword
;--- use mutex to serialize access to printf (not needed for msvcrt)
invoke WaitForSingleObject, g_hMutex, 5000
lea eax, TLSACC(var1)
mov ecx, TLSACC(var1)
invoke printf, CStr("thread(%u): init var1=%d &var1=%Xh",10), lParam, ecx, eax
invoke ReleaseMutex, g_hMutex
;--- release time slice so the other threads will get a chance to run
invoke Sleep, 0
;--- modify the thread variable
mov ecx, lParam
mov TLSACC(var1), ecx
;--- use mutex to serialize access to printf (not needed for msvcrt)
invoke WaitForSingleObject, g_hMutex, 5000
mov ecx, TLSACC(var1)
invoke printf, CStr("thread(%u): mod. var1=%d",10), lParam, ecx
invoke ReleaseMutex, g_hMutex
ret
align 4
threadproc endp
start:
mainCRTStartup proc
local hConInp:HANDLE
local hThread[10]:HANDLE
invoke printf, CStr("main: tls_index=%d",10), tls_index
;--- create a mutex to synchronize access to printf()
invoke CreateMutexA, 0, 0, 0
mov g_hMutex, eax
;--- reset thread handles
invoke memset, addr hThread, 0, sizeof hThread
;--- start threads
mov esi,0
lea ebx, hThread
.while esi < lengthof hThread
invoke CreateThread, 0, 4000h, offset threadproc, esi, 0, 0
mov [ebx], eax
inc esi
;invoke printf, CStr("main: %u. CreateThread()=%X",10), esi, eax
add ebx, sizeof HANDLE
.endw
;--- wait until all threads are done
invoke WaitForMultipleObjects, lengthof hThread, addr hThread, 1, 5000
invoke CloseHandle, g_hMutex
mov ecx, TLSACC(var1)
lea eax, TLSACC(var1)
invoke printf, CStr("main: var1=%d &var1=%X",10), ecx, eax
invoke ExitProcess, 0
ret
align 4
mainCRTStartup endp
END start
| 25.045455 | 79 | 0.731397 |
0912a74f400a0ab1834968a38d41d5e5b5c76581 | 6,917 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_369.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_369.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_369.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 %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x1eeaa, %rdx
dec %rbp
movl $0x61626364, (%rdx)
nop
nop
cmp $63371, %r11
lea addresses_normal_ht+0x2268, %rsi
lea addresses_WC_ht+0x482a, %rdi
nop
nop
add $60695, %r9
mov $84, %rcx
rep movsw
nop
nop
nop
nop
sub $7424, %r11
lea addresses_WT_ht+0x1d92a, %rdi
nop
nop
nop
inc %rbp
mov (%rdi), %rsi
nop
nop
xor $55447, %rbp
lea addresses_WC_ht+0xf2a, %rsi
lea addresses_normal_ht+0x1127a, %rdi
nop
inc %r11
mov $70, %rcx
rep movsb
nop
xor %rdx, %rdx
lea addresses_WT_ht+0x19f82, %rsi
lea addresses_D_ht+0x1e12a, %rdi
and $36356, %rdx
mov $122, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WC_ht+0xd326, %r9
nop
nop
nop
nop
add $64946, %rbp
mov $0x6162636465666768, %r12
movq %r12, (%r9)
nop
dec %r11
lea addresses_D_ht+0xb732, %rsi
lea addresses_normal_ht+0x1844a, %rdi
nop
nop
nop
nop
and %rbp, %rbp
mov $90, %rcx
rep movsl
nop
nop
dec %rsi
lea addresses_WT_ht+0xf6d2, %rcx
nop
nop
sub %rbp, %rbp
movw $0x6162, (%rcx)
nop
add $21330, %rcx
lea addresses_WC_ht+0x1cc2a, %r12
nop
nop
nop
sub $15935, %rcx
mov (%r12), %r9d
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_UC_ht+0xc3b6, %rsi
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
movups %xmm0, (%rsi)
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0x1582a, %rsi
lea addresses_D_ht+0x1524a, %rdi
nop
nop
inc %r11
mov $115, %rcx
rep movsl
xor $18989, %r9
lea addresses_D_ht+0xe0ba, %rbp
nop
nop
add %r9, %r9
movw $0x6162, (%rbp)
nop
xor $11756, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %r9
push %rax
// Faulty Load
lea addresses_D+0x792a, %rax
nop
nop
nop
dec %r8
movb (%rax), %r14b
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rax
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True}}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': True}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': 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
*/
| 37.188172 | 2,999 | 0.659245 |
a20b3c924b059b2304ad4e7066addf3dabfa6f00 | 262 | asm | Assembly | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_insert_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_insert_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_insert_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; size_t b_vector_insert_callee(b_vector_t *v, size_t idx, int c)
SECTION code_adt_b_vector
PUBLIC _b_vector_insert_callee
_b_vector_insert_callee:
pop af
pop hl
pop bc
pop de
push af
INCLUDE "adt/b_vector/z80/asm_b_vector_insert.asm"
| 15.411765 | 65 | 0.751908 |
8a05e3a78a2c98ecb6bb0edb5c99725d53575742 | 3,501 | asm | Assembly | Driver/Power/APM10/apmpwrManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Power/APM10/apmpwrManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Power/APM10/apmpwrManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: PC/GEOS
MODULE: Power Drivers
FILE: apmpwrManager.asm
AUTHOR: Todd Stumpf, Jul 28, 1994
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 7/28/94 Initial revision
DESCRIPTION:
This file brings together all the files necessary to produce
the default APM driver.
This driver should run on any system with APM, but will not
take advantage of special features on the hardware platform
(like BIOS level passwords and such...)
$Id: apmpwrManager.asm,v 1.1 97/04/18 11:48:29 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;-----------------------------------------------------------------------------
; Common Code Defines and Includes
;-----------------------------------------------------------------------------
; Use APM v1.0 features.
APM_MAJOR_VERSION equ 1
APM_MINOR_VERSION equ 0
APM_MAJOR_VERSION_BCD equ 1
APM_MINOR_VERSION_BCD equ 0
HARDWARE_TYPE equ <PC>
;-----------------------------------------------------------------------------
; Standard Common Power Code Definitions
;-----------------------------------------------------------------------------
PowerStrategy equ <APMPowerStrategy>
NUMBER_OF_CUSTOM_POWER_WARNINGS equ 3
PW_APM_BIOS_STAND_BY_REQUEST equ <PW_CUSTOM_1>
PW_APM_BIOS_SUSPEND_REQUEST equ <PW_CUSTOM_2>
PW_APM_BIOS_RESTORE_FROM_CRITICAL_SUSPEND equ <PW_CUSTOM_3>
WARNINGS_SUPPORTED equ (mask PW_MAIN_BATTERY or \
mask PW_APM_BIOS_STAND_BY_REQUEST or \
mask PW_APM_BIOS_SUSPEND_REQUEST or \
mask PW_APM_BIOS_RESTORE_FROM_CRITICAL_SUSPEND)
BATTERY_POLL_INITIAL_WAIT = 15*60 ; 15 seconds
BATTERY_POLL_INTERVAL = 30 ; twice per seconds
include geos.def ; to define TRUE and FALSE
include apm10Configure.def ; must be included next
include powerGeode.def ; this is where all the powerCommon gets
; included
;------------------------------------------------------------------------------
; Include files
;------------------------------------------------------------------------------
include Internal/im.def
include Internal/interrup.def
include thread.def
include file.def
include fileEnum.def
include Objects/inputC.def
include system.def
include timedate.def
include assert.def
;-----------------------------------------------------------------------------
; Included Libraries & Drivers
;-----------------------------------------------------------------------------
if HAS_PCMCIA_PORTS
UseLib pcmcia.def
endif
if HAS_SERIAL_PORTS
UseDriver Internal/serialDr.def
endif
;----------------------------------------------------------------------------
; Definitions local to this module
;-----------------------------------------------------------------------------
include apmConstant.def
include apmVariables.def
include apmStrings.asm
include apmpwrMacro.def
;-----------------------------------------------------------------------------
; Code
;-----------------------------------------------------------------------------
include apmCustom.asm
include apmStrategy.asm
include apmPassword.asm
include apmIdle.asm
include apmOnOff.asm
include apmVerify.asm
include apmUtil.asm
include apmRegister.asm
include apmPoll.asm
include apmEsc.asm
include apm10Poll.asm
| 30.181034 | 80 | 0.51471 |
6c4c9a85afee0f10d4161d87f457b08bea648003 | 1,846 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48_notsx.log_26_1553.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48_notsx.log_26_1553.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48_notsx.log_26_1553.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %rbp
push %rdi
push %rdx
lea addresses_UC_ht+0xd782, %rdi
nop
nop
nop
and %rbp, %rbp
mov $0x6162636465666768, %rdx
movq %rdx, (%rdi)
cmp $55285, %rbp
pop %rdx
pop %rdi
pop %rbp
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rax
push %rbp
push %rcx
push %rdi
// Store
lea addresses_normal+0x1e0aa, %rax
nop
nop
nop
nop
xor $12640, %rdi
movw $0x5152, (%rax)
nop
nop
dec %rbp
// Store
mov $0xa0a, %rdi
nop
add %rcx, %rcx
movl $0x51525354, (%rdi)
nop
nop
nop
nop
add %r8, %r8
// Store
lea addresses_US+0x1d22a, %rax
cmp $7650, %r14
movl $0x51525354, (%rax)
nop
nop
dec %rax
// Faulty Load
lea addresses_US+0x1d22a, %rdi
nop
nop
nop
nop
nop
and %rax, %rax
vmovups (%rdi), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
lea oracles, %r14
and $0xff, %rcx
shlq $12, %rcx
mov (%r14,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_US', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_normal', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_P', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_US', 'congruent': 0}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_US', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 1}, 'OP': 'STOR'}
{'00': 26}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 18.836735 | 124 | 0.64247 |
5ecb4fc5a6aa8b2c6e2cc230074100f542a3500d | 5,287 | asm | Assembly | deps/gmp.js/mpn/x86/k7/mod_1_4.asm | 6un9-h0-Dan/cobaul | 11115a7a77924d6e1642f847c613efb25f217e56 | [
"MIT"
] | 184 | 2020-04-15T14:28:37.000Z | 2020-09-22T15:57:55.000Z | deps/gmp.js/mpn/x86/k7/mod_1_4.asm | 6un9-h0-Dan/cobaul | 11115a7a77924d6e1642f847c613efb25f217e56 | [
"MIT"
] | 3 | 2020-09-22T05:09:36.000Z | 2020-09-22T11:56:00.000Z | deps/gmp.js/mpn/x86/k7/mod_1_4.asm | 6un9-h0-Dan/cobaul | 11115a7a77924d6e1642f847c613efb25f217e56 | [
"MIT"
] | 5 | 2020-04-21T19:50:23.000Z | 2020-09-22T10:58:02.000Z | dnl x86-32 mpn_mod_1s_4p, requiring cmov.
dnl Contributed to the GNU project by Torbjorn Granlund.
dnl Copyright 2009 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 3 of the License, or (at
dnl your option) any later version.
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C P5:
C P6 model 0-8,10-12)
C P6 model 9 (Banias)
C P6 model 13 (Dothan) 6.0
C P4 model 0 (Willamette)
C P4 model 1 (?)
C P4 model 2 (Northwood) 15.5
C P4 model 3 (Prescott)
C P4 model 4 (Nocona)
C K6:
C K7: 4.75
C K8:
C Ths inner loop was manually written, it ought to be loopmixed.
C Presumably, we could get to 4 c/l for K7.
C The cps function was compiler generated. It can clearly be optimized.
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_mod_1s_4p)
push %ebp
push %edi
push %esi
push %ebx
sub $28, %esp
mov 60(%esp), %edi C cps
mov 8(%edi), %eax
mov 12(%edi), %edx
mov 16(%edi), %ecx
mov 20(%edi), %esi
mov 24(%edi), %edi
mov %eax, 4(%esp)
mov %edx, 8(%esp)
mov %ecx, 12(%esp)
mov %esi, 16(%esp)
mov %edi, 20(%esp)
mov 52(%esp), %eax C n
xor %edi, %edi
mov 48(%esp), %esi C up
lea -12(%esi,%eax,4), %esi
and $3, %eax
je L(b0)
cmp $2, %eax
jc L(b1)
je L(b2)
L(b3): mov 4(%esi), %eax
mull 4(%esp)
mov (%esi), %ebp
add %eax, %ebp
adc %edx, %edi
mov 8(%esi), %eax
mull 8(%esp)
lea -12(%esi), %esi
jmp L(m0)
L(b0): mov (%esi), %eax
mull 4(%esp)
mov -4(%esi), %ebp
add %eax, %ebp
adc %edx, %edi
mov 4(%esi), %eax
mull 8(%esp)
add %eax, %ebp
adc %edx, %edi
mov 8(%esi), %eax
mull 12(%esp)
lea -16(%esi), %esi
jmp L(m0)
L(b1): mov 8(%esi), %ebp
lea -4(%esi), %esi
jmp L(m1)
L(b2): mov 8(%esi), %eax
mull 4(%esp)
mov 4(%esi), %ebp
lea -8(%esi), %esi
jmp L(m0)
ALIGN(16)
L(top): mov (%esi), %eax
mull 4(%esp)
mov -4(%esi), %ebx
xor %ecx, %ecx
add %eax, %ebx
adc %edx, %ecx
mov 4(%esi), %eax
mull 8(%esp)
add %eax, %ebx
adc %edx, %ecx
mov 8(%esi), %eax
mull 12(%esp)
add %eax, %ebx
adc %edx, %ecx
lea -16(%esi), %esi
mov 16(%esp), %eax
mul %ebp
add %eax, %ebx
adc %edx, %ecx
mov 20(%esp), %eax
mul %edi
mov %ebx, %ebp
mov %ecx, %edi
L(m0): add %eax, %ebp
adc %edx, %edi
L(m1): sub $4, 52(%esp)
ja L(top)
L(end): mov 4(%esp), %eax
mul %edi
mov 60(%esp), %edi
add %eax, %ebp
adc $0, %edx
mov 4(%edi), %ecx
mov %edx, %esi
mov %ebp, %eax
sal %cl, %esi
mov %ecx, %ebx
neg %ecx
shr %cl, %eax
or %esi, %eax
lea 1(%eax), %esi
mull (%edi)
mov %ebx, %ecx
mov %eax, %ebx
mov %ebp, %eax
sal %cl, %eax
add %eax, %ebx
adc %esi, %edx
imul 56(%esp), %edx
mov 56(%esp), %esi
sub %edx, %eax
lea (%eax,%esi), %edx
cmp %eax, %ebx
cmovb( %edx, %eax)
mov %eax, %edx
sub %esi, %eax
cmovb( %edx, %eax)
add $28, %esp
pop %ebx
pop %esi
pop %edi
pop %ebp
shr %cl, %eax
ret
EPILOGUE()
ALIGN(16)
PROLOGUE(mpn_mod_1s_4p_cps)
sub $56, %esp
mov %esi, 44(%esp)
mov 64(%esp), %esi
mov %edi, 48(%esp)
mov %ebx, 40(%esp)
mov $-1, %ebx
mov %ebp, 52(%esp)
bsr %esi, %eax
xor $31, %eax
mov %eax, %ecx
mov %eax, 24(%esp)
mov %ebx, %eax
sal %cl, %esi
mov %esi, %ecx
mov %esi, %edi
mov %esi, %ebp
neg %ecx
not %edi
mov %ecx, 20(%esp)
mov $32, %ecx
sub 24(%esp), %ecx
mov %edi, %edx
mov %edi, 16(%esp)
mov 20(%esp), %edi
div %esi
mov %eax, %ebx
shr %cl, %eax
movzbl 24(%esp), %ecx
mov %eax, 12(%esp)
mov $1, %eax
sal %cl, %eax
or %eax, 12(%esp)
imul 12(%esp), %edi
mov %edi, %eax
mov %edi, 20(%esp)
mul %ebx
mov %eax, %ecx
lea 1(%edx,%edi), %eax
neg %eax
imul %eax, %ebp
lea (%ebp,%esi), %eax
cmp %ebp, %ecx
cmovb( %eax, %ebp)
mov %ebp, %eax
mul %ebx
lea 1(%ebp,%edx), %edi
mov %eax, %ecx
neg %edi
mov %edi, 8(%esp)
imul %esi, %edi
mov %edi, %eax
add %esi, %eax
cmp %edi, %ecx
cmovae( %edi, %eax)
mov %eax, 32(%esp)
mov 32(%esp), %edi
mul %ebx
mov %eax, 36(%esp)
lea 1(%edi,%edx), %eax
negl %eax
imul %esi, %eax
mov %eax, %ecx
add %esi, %ecx
cmp %eax, 36(%esp)
cmovae( %eax, %ecx)
mov %ecx, (%esp)
mov %ecx, %eax
mul %ebx
mov %eax, %edi
mov (%esp), %eax
lea 1(%eax,%edx), %ecx
mov 60(%esp), %edx
neg %ecx
imul %esi, %ecx
mov %ebx, (%edx)
add %ecx, %esi
cmp %ecx, %edi
cmovae( %ecx, %esi)
mov 24(%esp), %ecx
shrl %cl, 20(%esp)
mov 20(%esp), %edi
mov %esi, 4(%esp)
mov %ecx, 4(%edx)
movzbl 24(%esp), %ecx
mov %edi, 8(%edx)
shr %cl, %ebp
shr %cl, %eax
mov %ebp, 12(%edx)
shrl %cl, 32(%esp)
mov 32(%esp), %edi
shrl %cl, 4(%esp)
mov %eax, 20(%edx)
mov %edi, 16(%edx)
mov 4(%esp), %edi
mov %edi, 24(%edx)
mov 40(%esp), %ebx
mov 44(%esp), %esi
mov 48(%esp), %edi
mov 52(%esp), %ebp
add $56, %esp
ret
EPILOGUE()
| 18.748227 | 79 | 0.599016 |
1922438984a85cc4f6a1aa3e7d112d28b28aec37 | 4,858 | asm | Assembly | Transynther/x86/_processed/NC/_zr_un_/i9-9900K_12_0xa0.log_2542_1452.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_un_/i9-9900K_12_0xa0.log_2542_1452.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_un_/i9-9900K_12_0xa0.log_2542_1452.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rdx
push %rsi
// Store
lea addresses_WC+0x13b30, %r11
nop
nop
nop
sub %rdx, %rdx
mov $0x5152535455565758, %r8
movq %r8, %xmm2
movups %xmm2, (%r11)
nop
nop
add %r13, %r13
// Load
lea addresses_normal+0x4b0, %rdx
nop
nop
nop
add %r11, %r11
mov (%rdx), %r13w
nop
nop
nop
nop
and %r10, %r10
// Load
lea addresses_A+0x1c030, %r13
nop
nop
nop
add $41793, %r15
movntdqa (%r13), %xmm2
vpextrq $1, %xmm2, %r11
nop
cmp $64160, %rsi
// Store
mov $0x5f4, %r13
nop
nop
nop
and $63713, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm2
movntdq %xmm2, (%r13)
nop
nop
nop
cmp %r8, %r8
// Faulty Load
mov $0x36c1a0000000a30, %r8
and %r10, %r10
movups (%r8), %xmm5
vpextrq $1, %xmm5, %r11
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rsi
pop %rdx
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_A', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_P', 'AVXalign': False, 'size': 16}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 1738, 'c0': 11, 'e2': 171, 'ff': 1, '5d': 108, '99': 20, '07': 103, '08': 285, '09': 105}
00 c0 00 00 00 00 00 00 08 00 08 00 08 c0 00 00 08 00 00 00 08 00 00 00 00 00 00 c0 00 00 00 00 00 00 08 00 00 00 00 00 00 08 00 08 00 00 00 08 00 00 00 08 08 08 00 00 00 00 08 00 00 00 00 c0 00 00 08 08 08 00 00 00 00 00 08 00 00 00 00 08 08 08 00 00 00 00 00 00 08 00 00 00 00 08 00 00 00 00 00 00 08 00 00 08 00 00 00 00 08 00 00 00 08 00 00 00 00 08 00 00 08 00 00 08 00 08 00 00 00 00 00 08 00 08 00 08 08 00 00 08 08 00 00 00 08 00 00 c0 00 00 00 08 c0 00 00 08 00 00 c0 00 00 00 00 00 00 00 00 08 00 00 08 00 08 08 08 08 00 08 c0 00 00 08 00 c0 00 00 00 00 00 08 08 08 c0 00 00 00 00 00 08 00 00 00 c0 00 00 00 00 08 08 00 00 00 00 08 08 08 08 00 00 00 08 08 00 5d 00 00 5d 5d 00 00 5d 00 00 00 00 00 00 5d 00 00 00 00 5d 00 00 5d 00 00 00 5d 00 00 00 00 5d 00 00 00 00 5d 5d 5d 5d 00 00 00 00 00 00 00 00 5d 00 5d 5d 5d 5d 00 00 00 00 00 00 5d 00 00 5d 00 00 5d 00 00 00 00 5d 5d 00 00 00 00 5d 00 00 00 08 00 00 5d 00 00 00 5d 00 00 5d 00 00 00 5d 00 5d 5d 5d 00 00 00 00 00 00 00 5d 00 00 5d 00 00 00 00 5d 00 00 00 5d 00 00 00 5d 00 5d 00 00 5d 5d 5d 00 00 00 5d 00 00 00 00 00 5d 00 08 00 00 00 00 5d 5d 00 00 00 00 00 00 00 00 00 5d 00 5d 00 00 00 5d 5d 5d 00 00 5d 00 5d 00 00 00 00 00 00 5d 00 5d 00 00 5d 00 00 5d 00 5d 00 00 5d 00 5d 00 00 00 00 00 5d 00 00 5d 00 5d 5d 00 00 5d 00 5d 00 5d 00 00 00 00 00 00 00 5d 00 00 00 00 5d 00 00 5d 00 00 00 5d 5d 00 00 5d 00 00 00 5d 5d 00 00 5d 00 5d 5d 5d 00 00 5d 00 5d 00 00 00 00 08 00 00 00 5d 00 00 00 00 5d 5d 5d 00 00 00 5d 00 08 00 00 00 00 5d 00 00 5d 5d 00 5d 5d 5d 00 5d 00 5d 00 00 00 00 00 00 5d 00 00 00 5d 5d 00 00 00 5d 00 00 5d 00 00 5d 00 5d 00 00 5d 5d 5d 00 5d 00 5d 5d 08 08 08 00 00 08 00 00 08 5d 00 00 08 08 08 00 08 00 08 00 00 08 00 00 00 08 00 08 08 08 00 00 00 08 00 00 08 00 00 08 00 00 08 08 00 08 00 00 00 08 00 00 00 08 00 00 00 00 08 08 08 00 00 00 00 00 00 08 08 00 5d 00 00 08 08 08 00 00 00 00 00 08 08 00 08 00 00 00 08 00 00 00 00 00 00 00 08 00 00 08 00 00 5d 00 00 08 00 08 00 08 00 08 00 00 00 08 08 00 00 00 00 00 00 08 08 00 00 00 08 00 00 08 08 00 08 00 08 09 09 00 00 09 00 00 00 09 00 09 00 00 00 09 09 00 09 00 00 00 09 00 00 00 00 00 00 09 00 09 00 09 09 00 00 00 09 09 00 00 00 09 00 00 00 09 00 00 00 00 00 09 00 00 00 00 00 09 00 09 00 00 09 00 00 00 09 00 00 00 00 00 00 00 00 09 00 00 00 00 09 00 09 00 00 09 09 00 00 00 00 00 00 09 00 00 00 09 00 00 00 09 00 00 00 09 00 00 00 08 00 00 00 09 09 00 00 09 09 00 00 09 00 00 00 00 00 09 09 09 00 00 00 09 09 09 00 00 08 00 00 00 00 09 00 00 09 09 00 00 08 00 00 00 00 00 00 09 00 00 00 09 00 00 09 09 00 00 00 09 00 00 00 00 00 09 00 00 00 00 00 00 00 00 09 00 00 00 00 09 09 00 09 00 09 00 00 09 00 00 00 00 09 00 09 00 00 09 09 09 09 00 00 00 00 09 09 00 00 00 00 00 09 09 00 00 09 00 00 00 00 00 09 09 09 00 00 00 00 00 09 00 00 00 00 09 00 00 00 09 00 00 00 00 00 00 09 00 00 09 00 00 09 09 00 00 09 00 00 00 00 09 09 09 00 00 00 09 00 00 09 09 09 00 00 00 00 00 09 09 00 09 09 09 00 00 00 00 09 00 00 09 09 00 00 00 09 09 00 09 00 00
*/
| 49.571429 | 2,999 | 0.651297 |
19940e64626b9ecbd0d8feb137ff22b50220049b | 4,062 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_909.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_909.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_909.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 %r15
push %r9
push %rbx
push %rdx
lea addresses_A_ht+0x6762, %r9
nop
nop
sub %r15, %r15
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
and $0xffffffffffffffc0, %r9
movntdq %xmm0, (%r9)
nop
nop
nop
nop
add $6507, %rbx
pop %rdx
pop %rbx
pop %r9
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rbx
// Faulty Load
lea addresses_US+0x3382, %r13
sub %rbx, %rbx
mov (%r13), %r15d
lea oracles, %r10
and $0xff, %r15
shlq $12, %r15
mov (%r10,%r15,1), %r15
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': True, 'NT': True}}
{'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
*/
| 65.516129 | 2,999 | 0.663466 |
cf8353e747b7e7230f6d3ac7b888944cd75f4cb6 | 642 | asm | Assembly | oeis/135/A135182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/135/A135182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/135/A135182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A135182: p^5 + p^3 + p^2. Exponents are prime numbers and p = prime(n).
; 44,279,3275,17199,162503,373659,1425059,2483319,6449039,20536379,28659903,69395979,115926803,147089799,229451039,418347179,715133159,844827003,1350430359,1804592303,2073465939,3077555679,3939619319,5584772339,8588262339,10511141003,11593844079,14026753799,15387546459,18425807459,33040433919,38581754903,48264314579,51891549639,73443105899,78506191503,95392887099,115067974359,129896670959,154969099739,183771764279,194270207403,254201906303,267792410499,296716964939,312087521199,418236640503
seq $0,40 ; The prime numbers.
seq $0,133073 ; a(n) = n^5 + n^3 + n^2.
| 107 | 495 | 0.830218 |
621fc9d978d32245f12f463a039c2fc4094d54f4 | 858 | asm | Assembly | programs/oeis/051/A051745.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/051/A051745.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/051/A051745.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A051745: a(n) = n*(n^4 + 10*n^3 + 35*n^2 + 50*n + 144)/120.
; 2,8,24,60,131,258,469,800,1296,2012,3014,4380,6201,8582,11643,15520,20366,26352,33668,42524,53151,65802,80753,98304,118780,142532,169938,201404,237365,278286,324663,377024,435930,501976,575792,658044,749435,850706,962637,1086048,1221800,1370796,1533982,1712348,1906929,2118806,2349107,2599008,2869734,3162560,3478812,3819868,4187159,4582170,5006441,5461568,5949204,6471060,7028906,7624572,8259949,8936990,9657711,10424192,11238578,12103080,13019976,13991612,15020403,16108834,17259461,18474912,19757888,21111164,22537590,24040092,25621673,27285414,29034475,30872096,32801598,34826384,36949940,39175836,41507727,43949354,46504545,49177216,51971372,54891108,57940610,61124156,64446117,67910958,71523239,75287616,79208842,83291768,87541344,91962620
add $0,5
mov $1,$0
bin $0,5
add $0,$1
sub $0,4
| 95.333333 | 747 | 0.815851 |
8f1c9257bb710ef4b304abda2e9f39cce1bb6df1 | 722 | asm | Assembly | programs/oeis/031/A031347.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/031/A031347.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/031/A031347.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A031347: Multiplicative digital root of n (keep multiplying digits of n until reaching a single digit).
; 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,0,2,4,6,8,0,3,6,9,2,5,8,2,8,4,0,4,8,2,6,0,8,6,6,8,0,5,0,5,0,0,0,5,0,0,0,6,2,8,8,0,8,8,6,0,0,7,4,2,6,5,8,8,0,8,0,8,6,8,6,0,6,0,8,4,0,9,8,4,8,0,0,8,4,8,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,0,2,4,6,8,0,3,6,9,2,5,8,2,8,4,0,4,8,2,6,0,8,6,6,8,0,5,0,5,0,0,0,5,0,0,0,6,2,8,8,0,8,8,6,0,0,7,4,2,6,5,8,8,0,8,0,8,6,8,6,0,6,0,8,4,0,9,8,4,8,0,0,8,4,8,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,0,2,4,6,8,0,4,8,2,6,0,8,6,6,8,0,6,2,8,8,0,8,8,6,0,0,8,6,8,6,0,6,0,8,4
lpb $0,1
mov $1,$0
cal $1,7954 ; Product of decimal digits of n.
mov $0,$1
lpe
mul $0,2
mov $1,$0
div $1,2
| 60.166667 | 501 | 0.554017 |
52fd2c883e2fd43460c22c0afefab1ce2e13cbb7 | 2,800 | asm | Assembly | tables/crc32k-table256.asm | dougmasten/crc32-6x09 | e15f25803b10f4c7b845aceb209b249cb0b62da5 | [
"MIT"
] | 6 | 2020-03-24T15:08:02.000Z | 2021-09-12T04:41:13.000Z | tables/crc32k-table256.asm | dougmasten/crc32-6x09 | e15f25803b10f4c7b845aceb209b249cb0b62da5 | [
"MIT"
] | null | null | null | tables/crc32k-table256.asm | dougmasten/crc32-6x09 | e15f25803b10f4c7b845aceb209b249cb0b62da5 | [
"MIT"
] | null | null | null | ; crc32k-table256.asm
; Polynomial - $eb31d82e
fqb $00000000,$9695c4ca,$fb4839c9,$6dddfd03,$20f3c3cf,$b6660705,$dbbbfa06,$4d2e3ecc
fqb $41e7879e,$d7724354,$baafbe57,$2c3a7a9d,$61144451,$f781809b,$9a5c7d98,$0cc9b952
fqb $83cf0f3c,$155acbf6,$788736f5,$ee12f23f,$a33cccf3,$35a90839,$5874f53a,$cee131f0
fqb $c22888a2,$54bd4c68,$3960b16b,$aff575a1,$e2db4b6d,$744e8fa7,$199372a4,$8f06b66e
fqb $d1fdae25,$47686aef,$2ab597ec,$bc205326,$f10e6dea,$679ba920,$0a465423,$9cd390e9
fqb $901a29bb,$068fed71,$6b521072,$fdc7d4b8,$b0e9ea74,$267c2ebe,$4ba1d3bd,$dd341777
fqb $5232a119,$c4a765d3,$a97a98d0,$3fef5c1a,$72c162d6,$e454a61c,$89895b1f,$1f1c9fd5
fqb $13d52687,$8540e24d,$e89d1f4e,$7e08db84,$3326e548,$a5b32182,$c86edc81,$5efb184b
fqb $7598ec17,$e30d28dd,$8ed0d5de,$18451114,$556b2fd8,$c3feeb12,$ae231611,$38b6d2db
fqb $347f6b89,$a2eaaf43,$cf375240,$59a2968a,$148ca846,$82196c8c,$efc4918f,$79515545
fqb $f657e32b,$60c227e1,$0d1fdae2,$9b8a1e28,$d6a420e4,$4031e42e,$2dec192d,$bb79dde7
fqb $b7b064b5,$2125a07f,$4cf85d7c,$da6d99b6,$9743a77a,$01d663b0,$6c0b9eb3,$fa9e5a79
fqb $a4654232,$32f086f8,$5f2d7bfb,$c9b8bf31,$849681fd,$12034537,$7fdeb834,$e94b7cfe
fqb $e582c5ac,$73170166,$1ecafc65,$885f38af,$c5710663,$53e4c2a9,$3e393faa,$a8acfb60
fqb $27aa4d0e,$b13f89c4,$dce274c7,$4a77b00d,$07598ec1,$91cc4a0b,$fc11b708,$6a8473c2
fqb $664dca90,$f0d80e5a,$9d05f359,$0b903793,$46be095f,$d02bcd95,$bdf63096,$2b63f45c
fqb $eb31d82e,$7da41ce4,$1079e1e7,$86ec252d,$cbc21be1,$5d57df2b,$308a2228,$a61fe6e2
fqb $aad65fb0,$3c439b7a,$519e6679,$c70ba2b3,$8a259c7f,$1cb058b5,$716da5b6,$e7f8617c
fqb $68fed712,$fe6b13d8,$93b6eedb,$05232a11,$480d14dd,$de98d017,$b3452d14,$25d0e9de
fqb $2919508c,$bf8c9446,$d2516945,$44c4ad8f,$09ea9343,$9f7f5789,$f2a2aa8a,$64376e40
fqb $3acc760b,$ac59b2c1,$c1844fc2,$57118b08,$1a3fb5c4,$8caa710e,$e1778c0d,$77e248c7
fqb $7b2bf195,$edbe355f,$8063c85c,$16f60c96,$5bd8325a,$cd4df690,$a0900b93,$3605cf59
fqb $b9037937,$2f96bdfd,$424b40fe,$d4de8434,$99f0baf8,$0f657e32,$62b88331,$f42d47fb
fqb $f8e4fea9,$6e713a63,$03acc760,$953903aa,$d8173d66,$4e82f9ac,$235f04af,$b5cac065
fqb $9ea93439,$083cf0f3,$65e10df0,$f374c93a,$be5af7f6,$28cf333c,$4512ce3f,$d3870af5
fqb $df4eb3a7,$49db776d,$24068a6e,$b2934ea4,$ffbd7068,$6928b4a2,$04f549a1,$92608d6b
fqb $1d663b05,$8bf3ffcf,$e62e02cc,$70bbc606,$3d95f8ca,$ab003c00,$c6ddc103,$504805c9
fqb $5c81bc9b,$ca147851,$a7c98552,$315c4198,$7c727f54,$eae7bb9e,$873a469d,$11af8257
fqb $4f549a1c,$d9c15ed6,$b41ca3d5,$2289671f,$6fa759d3,$f9329d19,$94ef601a,$027aa4d0
fqb $0eb31d82,$9826d948,$f5fb244b,$636ee081,$2e40de4d,$b8d51a87,$d508e784,$439d234e
fqb $cc9b9520,$5a0e51ea,$37d3ace9,$a1466823,$ec6856ef,$7afd9225,$17206f26,$81b5abec
fqb $8d7c12be,$1be9d674,$76342b77,$e0a1efbd,$ad8fd171,$3b1a15bb,$56c7e8b8,$c0522c72
| 77.777778 | 85 | 0.778214 |
a4a15de562d2639d5c209bc10ab98dc9254cd9fc | 3,831 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_152_1248.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_152_1248.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_152_1248.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 %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x14b20, %rcx
cmp %r11, %r11
movb (%rcx), %bl
nop
nop
nop
nop
and $10399, %rcx
lea addresses_normal_ht+0x6660, %r8
nop
nop
inc %r12
mov $0x6162636465666768, %r11
movq %r11, (%r8)
add $54973, %r11
lea addresses_WC_ht+0x1760, %rbp
dec %r12
movl $0x61626364, (%rbp)
nop
nop
nop
nop
nop
xor $1083, %r11
lea addresses_normal_ht+0x1e420, %rsi
lea addresses_UC_ht+0x7c60, %rdi
nop
nop
add $8598, %rbx
mov $19, %rcx
rep movsl
nop
nop
nop
cmp $42202, %r8
lea addresses_WT_ht+0x17260, %rcx
nop
nop
add $16580, %rdi
movb $0x61, (%rcx)
nop
nop
nop
nop
nop
xor $40357, %rbx
lea addresses_normal_ht+0x5b60, %r8
clflush (%r8)
xor $46350, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, (%r8)
nop
sub %r11, %r11
lea addresses_D_ht+0x18e30, %rsi
nop
cmp $41080, %rbx
movups (%rsi), %xmm5
vpextrq $0, %xmm5, %r11
nop
nop
nop
nop
nop
dec %rbp
lea addresses_WC_ht+0x16160, %rsi
lea addresses_WC_ht+0xf0a6, %rdi
nop
nop
nop
nop
nop
add $33939, %rbp
mov $86, %rcx
rep movsb
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_normal_ht+0x1a71e, %r12
nop
add %rbx, %rbx
movb (%r12), %cl
nop
xor $19490, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x1a9a0, %r10
and %rsi, %rsi
movw $0x5152, (%r10)
nop
nop
nop
nop
nop
sub %r10, %r10
// Faulty Load
lea addresses_US+0x1ce60, %rbp
and %r14, %r14
mov (%rbp), %esi
lea oracles, %rcx
and $0xff, %rsi
shlq $12, %rsi
mov (%rcx,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 152}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 23.359756 | 455 | 0.65231 |
354dc82932426c4beffb48c3b55cc5c14ed1c428 | 690 | asm | Assembly | oeis/053/A053484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/053/A053484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/053/A053484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A053484: Numerators in expansion of exp(2x)/(1-x).
; Submitted by Christian Krause
; 1,3,5,19,7,109,331,155,2327,20947,34913,164591,691283,14977801,314533829,4718007451,1572669151,16041225341,103122162907,4571749222213,68576238333199,110777000384399,55582845806909,364345554264288511,1093036662792865537,1301234122372458973,355236915407681299637,1918279343201479018043,22379925670683921877171,1947053533349501203313893,29205803000242518049708411,301793297669172686513653591,5173599388614388911662633,29877536469248095964851705579,13023541537877375164166128073
mov $1,1
lpb $0
mov $2,$0
sub $0,1
mul $3,2
add $3,$1
mul $1,$2
lpe
mul $3,2
add $1,$3
gcd $3,$1
div $1,$3
mov $0,$1
| 38.333333 | 476 | 0.818841 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.