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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bc882108db644e87911bd91a20087b6e1572d496
| 440
|
asm
|
Assembly
|
programs/oeis/305/A305412.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/305/A305412.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/305/A305412.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A305412: a(n) = F(n)*F(n+1) + F(n+2), where F = A000045 (Fibonacci numbers).
; 1,3,5,11,23,53,125,307,769,1959,5039,13049,33929,88451,230957,603667,1578823,4130829,10810469,28295411,74067401,193893263,507590495,1328842801,3478880593,9107706243,23844088085,62424315227,163428464759,427860443429,1120151837069
lpb $0
mov $2,$0
sub $0,1
seq $2,33192 ; a(n) = binomial(Fibonacci(n) + 1, 2).
add $1,$2
lpe
mul $1,2
add $1,1
mov $0,$1
| 33.846154
| 230
| 0.709091
|
7ebe8b6e62942430b3ddce081c14376884e6f0e0
| 404
|
asm
|
Assembly
|
oeis/229/A229213.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/229/A229213.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/229/A229213.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A229213: Square array of denominators of t(n,k) = (1+1/(k*n))^n, read by descending antidiagonals.
; Submitted by Simon Strandgaard
; 1,2,4,3,16,27,4,36,216,256,5,64,729,4096,3125,6,100,1728,20736,100000,46656,7,144,3375,65536,759375,2985984,823543,8,196,5832,160000,3200000,34012224,105413504,16777216,9,256
lpb $0
add $1,1
sub $0,$1
lpe
add $0,1
add $1,2
sub $1,$0
mul $1,$0
pow $1,$0
mov $0,$1
| 26.933333
| 176
| 0.69802
|
601bb85caede61e5a643595dbc88cbca460c3ab7
| 147
|
asm
|
Assembly
|
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending1-p.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending1-p.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Ending1-p.asm
|
prismotizm/gigaleak
|
d082854866186a05fec4e2fdf1def0199e7f3098
|
[
"MIT"
] | null | null | null |
Name: Ending1-p.asm
Type: file
Size: 20197
Last-Modified: '1992-07-20T15:00:00Z'
SHA-1: 4EB2C7ADD1C2A861D253492B1ACDE394C19E90B7
Description: null
| 21
| 47
| 0.809524
|
88f9876986973ff4372244fe2138bdfe6d237eb5
| 1,024
|
asm
|
Assembly
|
src/boot.asm
|
morozov/exolon
|
2025e5497fb2c1fbc7f3dd9e82154a9b80753d34
|
[
"MIT"
] | null | null | null |
src/boot.asm
|
morozov/exolon
|
2025e5497fb2c1fbc7f3dd9e82154a9b80753d34
|
[
"MIT"
] | null | null | null |
src/boot.asm
|
morozov/exolon
|
2025e5497fb2c1fbc7f3dd9e82154a9b80753d34
|
[
"MIT"
] | null | null | null |
CLS equ $0d6b ; https://skoolkid.github.io/rom/asm/0D6B.html
BORDCR equ $5c48 ; https://skoolkid.github.io/rom/asm/5C48.html
ATTR_P equ $5c8d ; https://skoolkid.github.io/rom/asm/5C8D.html
dest equ $6d60 ; final destination of the data block
; and the entry point
; Clear screen
ld a, $00
ld (ATTR_P), a
ld (BORDCR), a
xor a
out ($fe), a
call CLS
; Load image
ld de, ($5cf4) ; restore the FDD head position
ld bc, $1405 ; load 20 sectors of compressed image
ld hl, $9c40 ; destination address (40000)
call $3d13 ;
call $9c40 ; decompress the image
; Move stack pointer away form the data
ld sp, dest-2
; Load data
ld de, ($5cf4) ; restore the FDD head position again
ld bc, $9305 ; load 147 sectors of the data
ld hl, dest ; destination address (28000)
call $3d13 ;
; GO!
jp dest
| 30.117647
| 65
| 0.544922
|
d8f4320ee1363293548095a418fb9731dcc98bcd
| 560
|
asm
|
Assembly
|
input/c64/InputSystem.asm
|
puzzud/puzl6502
|
c38fa015d0d25f2c29f79fa41de10f8cc8c39693
|
[
"MIT"
] | null | null | null |
input/c64/InputSystem.asm
|
puzzud/puzl6502
|
c38fa015d0d25f2c29f79fa41de10f8cc8c39693
|
[
"MIT"
] | null | null | null |
input/c64/InputSystem.asm
|
puzzud/puzl6502
|
c38fa015d0d25f2c29f79fa41de10f8cc8c39693
|
[
"MIT"
] | null | null | null |
; InputSystem.asm
; Commodore 64
;------------------------------------------------------------------
!zone UpdateInput
UpdateInput
ldx #0
.joystickLoop
lda joystickButtons,x
sta joystickOldButtons,x
lda CIA1_DDRA,x
sta PARAM1
cli
lda #$00
sta CIA1_DDRA,x
lda CIA1_PRA,x
eor #$ff
and #%00011111
sta joystickButtons,x
lda PARAM1
sta CIA1_DDRA,x
sei
lda joystickOldButtons,x
eor #$ff
and joystickButtons,x
sta joystickPressedButtons,x
inx
cpx #NUMBER_OF_JOYSTICKS
bne .joystickLoop
rts
| 13.658537
| 67
| 0.603571
|
7fbc3c340c86fc2f1d66bc2c3cf2d9661fe3ee9c
| 520
|
asm
|
Assembly
|
programs/oeis/055/A055012.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/055/A055012.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/055/A055012.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A055012: Sum of cubes of the digits of n written in base 10.
; 0,1,8,27,64,125,216,343,512,729,1,2,9,28,65,126,217,344,513,730,8,9,16,35,72,133,224,351,520,737,27,28,35,54,91,152,243,370,539,756,64,65,72,91,128,189,280,407,576,793,125,126,133,152,189,250,341,468,637,854,216,217,224,243,280,341,432,559,728,945,343,344,351,370,407,468,559,686,855,1072,512,513,520,539,576,637,728,855,1024,1241,729,730,737,756,793,854,945,1072,1241,1458
lpb $0
mov $2,$0
div $0,10
mod $2,10
pow $2,3
add $1,$2
lpe
mov $0,$1
| 43.333333
| 375
| 0.690385
|
6d0005caf328d2ed574c8c656247ad0bf0bae80b
| 3,200
|
asm
|
Assembly
|
aom_20170505/aom_dsp/x86/inv_wht_sse2.asm
|
rainliu/aom_analyzer
|
440652d155140c00a2827512a54103be3d6ff7e4
|
[
"MIT"
] | null | null | null |
aom_20170505/aom_dsp/x86/inv_wht_sse2.asm
|
rainliu/aom_analyzer
|
440652d155140c00a2827512a54103be3d6ff7e4
|
[
"MIT"
] | null | null | null |
aom_20170505/aom_dsp/x86/inv_wht_sse2.asm
|
rainliu/aom_analyzer
|
440652d155140c00a2827512a54103be3d6ff7e4
|
[
"MIT"
] | null | null | null |
;
; Copyright (c) 2016, Alliance for Open Media. All rights reserved
;
; This source code is subject to the terms of the BSD 2 Clause License and
; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
; was not distributed with this source code in the LICENSE file, you can
; obtain it at www.aomedia.org/license/software. If the Alliance for Open
; Media Patent License 1.0 was not distributed with this source code in the
; PATENTS file, you can obtain it at www.aomedia.org/license/patent.
;
;
%include "third_party/x86inc/x86inc.asm"
SECTION .text
%macro REORDER_INPUTS 0
; a c d b to a b c d
SWAP 1, 3, 2
%endmacro
%macro TRANSFORM_COLS 0
; input:
; m0 a
; m1 b
; m2 c
; m3 d
paddw m0, m2
psubw m3, m1
; wide subtract
punpcklwd m4, m0
punpcklwd m5, m3
psrad m4, 16
psrad m5, 16
psubd m4, m5
psrad m4, 1
packssdw m4, m4 ; e
psubw m5, m4, m1 ; b
psubw m4, m2 ; c
psubw m0, m5
paddw m3, m4
; m0 a
SWAP 1, 5 ; m1 b
SWAP 2, 4 ; m2 c
; m3 d
%endmacro
%macro TRANSPOSE_4X4 0
punpcklwd m0, m2
punpcklwd m1, m3
mova m2, m0
punpcklwd m0, m1
punpckhwd m2, m1
pshufd m1, m0, 0x0e
pshufd m3, m2, 0x0e
%endmacro
; transpose a 4x4 int16 matrix in xmm0 and xmm1 to the bottom half of xmm0-xmm3
%macro TRANSPOSE_4X4_WIDE 0
mova m3, m0
punpcklwd m0, m1
punpckhwd m3, m1
mova m2, m0
punpcklwd m0, m3
punpckhwd m2, m3
pshufd m1, m0, 0x0e
pshufd m3, m2, 0x0e
%endmacro
%macro ADD_STORE_4P_2X 5 ; src1, src2, tmp1, tmp2, zero
movd m%3, [outputq]
movd m%4, [outputq + strideq]
punpcklbw m%3, m%5
punpcklbw m%4, m%5
paddw m%1, m%3
paddw m%2, m%4
packuswb m%1, m%5
packuswb m%2, m%5
movd [outputq], m%1
movd [outputq + strideq], m%2
%endmacro
INIT_XMM sse2
cglobal iwht4x4_16_add, 3, 3, 7, input, output, stride
%if CONFIG_HIGHBITDEPTH
mova m0, [inputq + 0]
packssdw m0, [inputq + 16]
mova m1, [inputq + 32]
packssdw m1, [inputq + 48]
%else
mova m0, [inputq + 0]
mova m1, [inputq + 16]
%endif
psraw m0, 2
psraw m1, 2
TRANSPOSE_4X4_WIDE
REORDER_INPUTS
TRANSFORM_COLS
TRANSPOSE_4X4
REORDER_INPUTS
TRANSFORM_COLS
pxor m4, m4
ADD_STORE_4P_2X 0, 1, 5, 6, 4
lea outputq, [outputq + 2 * strideq]
ADD_STORE_4P_2X 2, 3, 5, 6, 4
RET
| 28.318584
| 80
| 0.480938
|
c058aa36d37885fe07c00fc8354a2b3c440a4a27
| 412
|
asm
|
Assembly
|
programs/oeis/071/A071026.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/071/A071026.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/071/A071026.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A071026: Triangle read by rows giving successive states of cellular automaton generated by "Rule 188".
; 1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1
mov $2,1
lpb $0
mov $1,$0
sub $0,$2
dif $1,$2
bin $1,3
add $2,1
lpe
add $1,1
mod $1,2
mov $0,$1
| 27.466667
| 199
| 0.570388
|
812c4dbd620a6cb42e49c1b297212e6191052aff
| 479
|
asm
|
Assembly
|
oeis/132/A132375.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/132/A132375.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/132/A132375.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A132375: Expansion of c(8x^2)/(1-xc(8x^2)), where c(x) is the g.f. of A000108 .
; Submitted by Jamie Morken(s4)
; 1,1,9,17,153,353,3177,8113,73017,198401,1785609,5060433,45543897,133071009,1197639081,3581326065,32231934585,98156060225,883404542025,2730108129937,24570973169433,76862217117665,691759954058985
mov $2,1
mov $3,$0
mov $4,1
mov $5,1
lpb $3
mul $2,$3
div $2,$4
sub $3,1
max $3,1
add $4,1
trn $5,$2
mul $5,8
add $5,$2
lpe
mov $0,$5
mul $0,8
sub $0,7
| 21.772727
| 195
| 0.68476
|
eb99d14043205f4c173f0f5464d2ee94f1364948
| 302
|
asm
|
Assembly
|
programs/oeis/116/A116400.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/116/A116400.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/116/A116400.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A116400: E.g.f. Bessel_I(2,2x)+Bessel_I(3,2x)+Bessel_I(4,2x).
; 0,0,1,1,5,5,21,21,84,84,330,330,1287,1287,5005,5005,19448,19448,75582,75582,293930,293930,1144066,1144066,4457400,4457400,17383860,17383860,67863915,67863915,265182525
div $0,2
mov $1,$0
add $0,2
sub $1,1
add $1,$0
bin $1,$0
mov $0,$1
| 27.454545
| 169
| 0.711921
|
f06e13162aeea606c49ecbec8e2dc794dbde5ec7
| 253
|
asm
|
Assembly
|
libsrc/graphics/sv8000/pointxy.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/graphics/sv8000/pointxy.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/graphics/sv8000/pointxy.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_clib
PUBLIC pointxy
EXTERN pointxy_MODE0
EXTERN pointxy_MODE1
EXTERN __sv8000_mode
INCLUDE "target/sv8000/def/sv8000.def"
pointxy:
ld a,(__sv8000_mode)
cp MODE_1
jp z,pointxy_MODE1
and a
ret nz
jp pointxy_MODE0
| 13.315789
| 40
| 0.743083
|
f348b662be97d5ce70f5150a480b111ff582fb63
| 136
|
asm
|
Assembly
|
src/main/fragment/mos6502-common/vdum1_neq_vduc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | 2
|
2022-03-01T02:21:14.000Z
|
2022-03-01T04:33:35.000Z
|
src/main/fragment/mos6502-common/vdum1_neq_vduc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
src/main/fragment/mos6502-common/vdum1_neq_vduc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
lda {m1}+3
cmp #>{c1}>>$10
bne {la1}
lda {m1}+2
cmp #<{c1}>>$10
bne {la1}
lda {m1}+1
cmp #>{c1}
bne {la1}
lda {m1}
cmp #<{c1}
bne {la1}
| 10.461538
| 15
| 0.522059
|
83757fdabefcfb342dc4f6ffcd8396c3e873fd4c
| 6,689
|
asm
|
Assembly
|
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_1686.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_1686.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_1686.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x328, %rdx
nop
nop
nop
nop
add $59424, %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm2
and $0xffffffffffffffc0, %rdx
vmovaps %ymm2, (%rdx)
nop
inc %rbx
lea addresses_normal_ht+0x5128, %rsi
lea addresses_normal_ht+0xda70, %rdi
clflush (%rdi)
nop
add %r15, %r15
mov $55, %rcx
rep movsl
nop
cmp %rcx, %rcx
lea addresses_WC_ht+0x1a2ef, %rsi
lea addresses_D_ht+0x12526, %rdi
dec %rbx
mov $6, %rcx
rep movsq
nop
nop
nop
nop
xor %rdx, %rdx
lea addresses_UC_ht+0x1e4bc, %rdx
nop
nop
nop
add %r9, %r9
movl $0x61626364, (%rdx)
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0x2728, %rsi
nop
nop
nop
nop
xor %rdi, %rdi
movl $0x61626364, (%rsi)
nop
nop
nop
xor $19761, %rbx
lea addresses_D_ht+0xbff8, %rsi
lea addresses_WT_ht+0xb228, %rdi
nop
nop
nop
nop
and %rdx, %rdx
mov $93, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $20164, %rsi
lea addresses_WC_ht+0x1e128, %rsi
lea addresses_A_ht+0x8304, %rdi
and %r10, %r10
mov $19, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r9, %r9
lea addresses_normal_ht+0x1dea8, %r15
xor $40962, %rcx
vmovups (%r15), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %r10
nop
xor %rdx, %rdx
lea addresses_WT_ht+0x16128, %rsi
lea addresses_D_ht+0x186ca, %rdi
nop
nop
nop
nop
nop
xor $23620, %rbx
mov $60, %rcx
rep movsb
nop
sub %r15, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r9
push %rax
push %rbx
push %rcx
push %rdi
// Store
lea addresses_normal+0x96a8, %r10
nop
nop
nop
nop
add %rcx, %rcx
movw $0x5152, (%r10)
nop
nop
nop
dec %rax
// Faulty Load
mov $0x2cb62c0000000128, %rcx
clflush (%rcx)
nop
nop
nop
nop
cmp $15219, %rbx
movups (%rcx), %xmm4
vpextrq $0, %xmm4, %rax
lea oracles, %rbx
and $0xff, %rax
shlq $12, %rax
mov (%rbx,%rax,1), %rax
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': True, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 1}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.156757
| 2,999
| 0.661833
|
cb2c0aee7a4d9fc0d1c938c5e633d4c2d217dea3
| 1,474
|
asm
|
Assembly
|
programs/oeis/053/A053743.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/053/A053743.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/053/A053743.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A053743: Sum of numbers in range 10*n to 10*n+9.
; 45,145,245,345,445,545,645,745,845,945,1045,1145,1245,1345,1445,1545,1645,1745,1845,1945,2045,2145,2245,2345,2445,2545,2645,2745,2845,2945,3045,3145,3245,3345,3445,3545,3645,3745,3845,3945,4045,4145,4245,4345,4445,4545,4645,4745,4845,4945,5045,5145,5245,5345,5445,5545,5645,5745,5845,5945,6045,6145,6245,6345,6445,6545,6645,6745,6845,6945,7045,7145,7245,7345,7445,7545,7645,7745,7845,7945,8045,8145,8245,8345,8445,8545,8645,8745,8845,8945,9045,9145,9245,9345,9445,9545,9645,9745,9845,9945,10045,10145,10245,10345,10445,10545,10645,10745,10845,10945,11045,11145,11245,11345,11445,11545,11645,11745,11845,11945,12045,12145,12245,12345,12445,12545,12645,12745,12845,12945,13045,13145,13245,13345,13445,13545,13645,13745,13845,13945,14045,14145,14245,14345,14445,14545,14645,14745,14845,14945,15045,15145,15245,15345,15445,15545,15645,15745,15845,15945,16045,16145,16245,16345,16445,16545,16645,16745,16845,16945,17045,17145,17245,17345,17445,17545,17645,17745,17845,17945,18045,18145,18245,18345,18445,18545,18645,18745,18845,18945,19045,19145,19245,19345,19445,19545,19645,19745,19845,19945,20045,20145,20245,20345,20445,20545,20645,20745,20845,20945,21045,21145,21245,21345,21445,21545,21645,21745,21845,21945,22045,22145,22245,22345,22445,22545,22645,22745,22845,22945,23045,23145,23245,23345,23445,23545,23645,23745,23845,23945,24045,24145,24245,24345,24445,24545,24645,24745,24845,24945
mov $1,$0
mul $1,100
add $1,45
| 210.571429
| 1,390
| 0.808684
|
7fcb5d65faf8ecebd54a28ec2ebce9660533e9e8
| 924
|
asm
|
Assembly
|
oeis/230/A230701.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/230/A230701.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/230/A230701.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A230701: Number of (n+3) X (1+3) 0..2 white square subarrays x(i,j) with each element diagonally or antidiagonally next to at least one element with value (x(i,j)+1) mod 3, and upper left element zero.
; Submitted by Jon Maiga
; 2,8,30,102,348,1172,3956,13326,44916,151338,509978,1718408,5790456,19511640,65747178,221543696,746521190,2515502046,8476319172,28562083692,96243740012,324306077270,1092792451740,3682309466130,12408031373682,41810511549008,140886078048560,474734373002352,1599680593324818,5390336462063832,18163455439700846,61204178223393686,206235616589902956,694938332395009668,2341687114076439588,7890626095314630878,26588513812026547076,89593532654154799290,301897321159051263498,1017283165681535345496
add $0,1
lpb $0
sub $0,1
add $1,$3
add $3,1
add $4,$2
sub $4,$5
add $4,1
mov $5,$4
mov $4,$2
mov $2,$3
add $4,$1
add $4,$1
add $5,$4
mov $3,$5
add $4,1
lpe
mov $0,$4
mul $0,2
| 38.5
| 490
| 0.767316
|
df6b2ae3f7bbb067cbbc8405ffe609fe263f7a24
| 461
|
asm
|
Assembly
|
oeis/178/A178732.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/178/A178732.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/178/A178732.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A178732: a(n) = n XOR 6n, where XOR is bitwise XOR.
; Submitted by Jon Maiga
; 0,7,14,17,28,27,34,45,56,63,54,73,68,67,90,85,112,119,126,97,108,107,146,157,136,143,134,185,180,179,170,165,224,231,238,241,252,251,194,205,216,223,214,297,292,291,314,309,272,279,286,257,268,267,370,381
mov $5,$0
mul $5,6
mov $2,$5
mov $4,1
lpb $2
mov $2,$5
mov $3,$0
div $0,2
add $3,$5
mod $3,2
mul $3,$4
add $1,$3
sub $2,1
mul $4,2
div $5,2
lpe
mov $0,$1
| 20.954545
| 206
| 0.618221
|
1b87e7e9f972c84e89510c6e0540a724858a5228
| 157
|
asm
|
Assembly
|
src/case/xor.asm
|
dberkerdem/Assebmler
|
b6085fd211ee78c3bd143d7a277f452e2a22eaad
|
[
"MIT"
] | null | null | null |
src/case/xor.asm
|
dberkerdem/Assebmler
|
b6085fd211ee78c3bd143d7a277f452e2a22eaad
|
[
"MIT"
] | null | null | null |
src/case/xor.asm
|
dberkerdem/Assebmler
|
b6085fd211ee78c3bd143d7a277f452e2a22eaad
|
[
"MIT"
] | null | null | null |
LOAD 0F0F
STORE B
LOAD 0064
STORE C
LOAD 0F0F
STORE [C]
LOAD 0F0F
STORE [0384]
LOAD FF00
XOR 0F0F
LOAD FF00
XOR B
LOAD FF00
XOR [C]
LOAD FF00
XOR [0384]
HALT
| 9.235294
| 12
| 0.745223
|
074a535110912fbf7383fded9feb182e4df2dddf
| 748
|
asm
|
Assembly
|
libsrc/video/hd44780/generic_console.asm
|
ahjelm/z88dk
|
c4de367f39a76b41f6390ceeab77737e148178fa
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/video/hd44780/generic_console.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/video/hd44780/generic_console.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_driver
PUBLIC generic_console_cls
PUBLIC generic_console_vpeek
PUBLIC generic_console_scrollup
PUBLIC generic_console_printc
PUBLIC generic_console_ioctl
PUBLIC generic_console_set_ink
PUBLIC generic_console_set_paper
PUBLIC generic_console_set_attribute
INCLUDE "ioctl.def"
PUBLIC CLIB_GENCON_CAPS
defc CLIB_GENCON_CAPS = 0
EXTERN asm_lcd_clear
EXTERN asm_lcd_putchar
EXTERN asm_lcd_vpeek
EXTERN asm_lcd_scrollup
defc generic_console_cls = asm_lcd_clear
defc generic_console_printc = asm_lcd_putchar
defc generic_console_scrollup = asm_lcd_scrollup
defc generic_console_vpeek = asm_lcd_vpeek
generic_console_ioctl:
scf
generic_console_set_attribute:
generic_console_set_ink:
generic_console_set_paper:
ret
| 22
| 48
| 0.871658
|
8c6acba17fac386027424e61d17f588dd76c5503
| 669
|
asm
|
Assembly
|
9 Division.asm
|
jpsxlr8/Microprocessor-Lab
|
76b123612d919ac80619e3da89c95fffd9e2b4d0
|
[
"MIT"
] | null | null | null |
9 Division.asm
|
jpsxlr8/Microprocessor-Lab
|
76b123612d919ac80619e3da89c95fffd9e2b4d0
|
[
"MIT"
] | null | null | null |
9 Division.asm
|
jpsxlr8/Microprocessor-Lab
|
76b123612d919ac80619e3da89c95fffd9e2b4d0
|
[
"MIT"
] | null | null | null |
; Division of two 8-bit numbers
; can be done by repeated subtraction
; First Number: HL : 0250H = 125 = 0111 1101
; Second Number: BC : 0251H = 004 = 0000 0100
; result : 0260H = 031 = 0001 1111
; 0261H = 001 = 0000 0001
MVI C, 00H ;initialise quotient
LDA 0251H
MOV B, A ;taking divisor
LDA 0250H ;taking dividend
LOOP: CMP B ;comparing if the dividend and divisor
JNC NEXT ;if dividend > divisor
JMP END ;if dividend < divisor, break loop, save result
NEXT: SUB B ;repetitive subtraction
INR C ;increase the quotient value
JMP LOOP
END: STA 0261H ; saving remainder
MOV A, C
STA 0260H ; saving quotient
hlt
| 23.892857
| 57
| 0.672646
|
6d7fa3a6021f3f9ea16a8c8d10eb7565c1d28d75
| 405
|
asm
|
Assembly
|
4.0.x/LongVarHUD/HudUpdate_LongHudSupport.asm
|
chronosv2/NESMaker_Public_Code_Repository
|
d0a67b33d673fbff332fa4ae36d3465f73b87bba
|
[
"Unlicense"
] | 6
|
2019-08-09T19:53:33.000Z
|
2021-12-09T03:51:59.000Z
|
4.0.x/LongVarHUD/HudUpdate_LongHudSupport.asm
|
chronosv2/NESMaker_Public_Code_Repository
|
d0a67b33d673fbff332fa4ae36d3465f73b87bba
|
[
"Unlicense"
] | null | null | null |
4.0.x/LongVarHUD/HudUpdate_LongHudSupport.asm
|
chronosv2/NESMaker_Public_Code_Repository
|
d0a67b33d673fbff332fa4ae36d3465f73b87bba
|
[
"Unlicense"
] | null | null | null |
;Addition to support "Long HUD" Items
LDA LongHudVar
STA hudElementTilesToLoad
LDA #$00
STA hudElementTilesMax
;End Addition
;;; So what does this stuff do?
;;; You can only update one HUD item at a time per frame.
;;; If you set both HUD bits to 1 and give this second variable, when the first HUD update completes
;;; it'll update the second one with the value in LongHudVar on the next frame.
| 33.75
| 100
| 0.745679
|
63b57c857fc35c53c06247a8b8cf5bcdbe526e2f
| 860
|
asm
|
Assembly
|
oeis/259/A259661.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/259/A259661.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/259/A259661.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A259661: Binary representation of the middle column of the "Rule 54" elementary cellular automaton starting with a single ON cell.
; Submitted by Jamie Morken(s2)
; 1,11,110,1100,11001,110011,1100110,11001100,110011001,1100110011,11001100110,110011001100,1100110011001,11001100110011,110011001100110,1100110011001100,11001100110011001,110011001100110011,1100110011001100110,11001100110011001100,110011001100110011001,1100110011001100110011,11001100110011001100110,110011001100110011001100,1100110011001100110011001,11001100110011001100110011,110011001100110011001100110,1100110011001100110011001100,11001100110011001100110011001,110011001100110011001100110011
mov $2,$0
add $2,1
mov $4,$0
add $4,6
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
add $0,7
mod $0,4
mul $0,2
mul $1,10
mov $3,6
sub $3,$0
mul $3,$0
div $3,5
add $1,$3
lpe
mov $0,$1
| 35.833333
| 496
| 0.801163
|
3cc80df9a226e66fa0e0ea0453705f1961257c4a
| 938
|
asm
|
Assembly
|
Kernel/src/Arch/x86_64/SMPTrampoline.asm
|
adi-g15/LemonOS
|
47a15ecc0efe47eeebde0b63d668fb70c9e22b57
|
[
"BSD-2-Clause"
] | 685
|
2021-02-21T22:14:22.000Z
|
2022-03-31T18:05:34.000Z
|
Kernel/src/Arch/x86_64/SMPTrampoline.asm
|
adi-g15/LemonOS
|
47a15ecc0efe47eeebde0b63d668fb70c9e22b57
|
[
"BSD-2-Clause"
] | 22
|
2021-02-27T12:40:06.000Z
|
2022-03-28T15:17:24.000Z
|
Kernel/src/Arch/x86_64/SMPTrampoline.asm
|
adi-g15/LemonOS
|
47a15ecc0efe47eeebde0b63d668fb70c9e22b57
|
[
"BSD-2-Clause"
] | 36
|
2021-03-05T08:13:24.000Z
|
2022-03-15T19:51:33.000Z
|
BITS 16
%include "smpdefines.inc"
cli
cld
mov ax, SMP_MAGIC
mov word [SMP_TRAMPOLINE_DATA_START_FLAG], ax
mov eax, cr4
or eax, 1 << 5 ; Set PAE bit
mov cr4, eax
mov eax, dword [SMP_TRAMPOLINE_CR3]
mov cr3, eax
mov ecx, 0xC0000080 ; EFER Model Specific Register
rdmsr ; Read from the MSR
or eax, 1 << 8
wrmsr
mov eax, cr0
or eax, 0x80000001 ; Paging, Protected Mode
mov cr0, eax
lgdt [SMP_TRAMPOLINE_GDT_PTR]
jmp 0x08:(smpentry64 + SMP_TRAMPOLINE_ENTRY)
hlt
BITS 64
smpentry64:
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov rsp, [SMP_TRAMPOLINE_STACK]
mov rax, cr0
and ax, 0xFFFB ; Clear coprocessor emulation
or ax, 0x2 ; Set coprocessor monitoring
mov cr0, rax
;Enable SSE
mov rax, cr4
or ax, 3 << 9 ; Set flags for SSE
mov cr4, rax
xor rbp, rbp
mov rdi, [SMP_TRAMPOLINE_CPU_ID]
call [SMP_TRAMPOLINE_ENTRY2]
cli
hlt
| 15.633333
| 50
| 0.673774
|
f052d5e5fa576f5000ed5e3c1cb5a56290ff00c0
| 336
|
asm
|
Assembly
|
P2/mips(suma impresa vars).asm
|
AdrianPayne/MIPS32
|
8416c39c1bdfd1a1c7e427dbe67f95954fd3c953
|
[
"MIT"
] | null | null | null |
P2/mips(suma impresa vars).asm
|
AdrianPayne/MIPS32
|
8416c39c1bdfd1a1c7e427dbe67f95954fd3c953
|
[
"MIT"
] | null | null | null |
P2/mips(suma impresa vars).asm
|
AdrianPayne/MIPS32
|
8416c39c1bdfd1a1c7e427dbe67f95954fd3c953
|
[
"MIT"
] | null | null | null |
.data
str: .ascii "El resultado es: "
num1: .word 4
num2: .word 5
.text
main:
#1.Leer dos números del usuario
lw $a1, num1($zero)
lw $a2, num2($zero)
#2. Realizar la suma
add $a3, $a1, $a2
#2.5 Añadir texto
la $a0, str
#3.Imprimir el resultado
li $v0, 4
syscall
move $a0, $a3
li $v0, 1
syscall
#4.Salir del programa
li $v0, 10
syscall
| 14.608696
| 31
| 0.672619
|
f60687fb915ed57adf928d0e23bb1e4b6e000a57
| 395
|
asm
|
Assembly
|
oeis/166/A166358.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/166/A166358.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/166/A166358.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A166358: Row sums of exponential Riordan array [1+x*arctanh(x), x], A166357.
; Submitted by Jon Maiga
; 1,1,3,7,21,61,295,1331,10409,65017,694411,5454879,73145149,689074101,11090013103,121652191051,2282132463953,28550033871857,611369381873683,8587415858721079,206626962757626981,3219065122124476717
mov $1,$0
trn $0,1
seq $0,291484 ; Expansion of e.g.f. arctanh(x)*exp(x).
mul $0,$1
add $0,1
| 39.5
| 196
| 0.772152
|
44bb641ce5ad2ffe20144ad41532b7015962315b
| 1,173
|
asm
|
Assembly
|
basic/src/assembler/support.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 13
|
2020-03-31T08:21:22.000Z
|
2021-07-28T20:03:29.000Z
|
basic/src/assembler/support.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 37
|
2020-03-31T06:35:37.000Z
|
2020-09-17T08:56:48.000Z
|
basic/src/assembler/support.asm
|
paulscottrobson/eris
|
cf102530334ed86360deb20f0e41af1e10f5d584
|
[
"MIT"
] | 5
|
2020-05-10T10:23:06.000Z
|
2022-01-14T02:21:02.000Z
|
; *****************************************************************************
; *****************************************************************************
;
; Name: support.asm
; Purpose: Support routines for assembler
; Created: 22nd March 2020
; Reviewed: TODO
; Author: Paul Robson (paul@robsons.org.uk)
;
; *****************************************************************************
; *****************************************************************************
; *****************************************************************************
;
; .<identifier> sets label
;
; *****************************************************************************
.Command_Label ;; [.]
push link
stm r14,#reportUnknownVariable ; permit definitions
jsr #EvaluateExpression ; get a reference.
stm r15,#reportUnknownVariable ; turn permission off
ldm r0,r10,#esReference1 ; check reference
sknz r0
jmp #BadLabelError
ldm r0,r10,#esType1 ; to integer
skz r0
jmp #TypeMismatchError
;
ldm r0,r10,#esValue1 ; reference target
ldm r1,#asmPointer ; set it to current pointer
stm r1,r0,#0
pop link
ret
| 33.514286
| 79
| 0.395567
|
c79086f6dfddfb5c652d354273249e3359a44c7f
| 1,109
|
asm
|
Assembly
|
_build/dispatcher/jmp_ippsSMS4EncryptOFB_697bbdc3.asm
|
zyktrcn/ippcp
|
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
|
[
"Apache-2.0"
] | 1
|
2021-10-04T10:21:54.000Z
|
2021-10-04T10:21:54.000Z
|
_build/dispatcher/jmp_ippsSMS4EncryptOFB_697bbdc3.asm
|
zyktrcn/ippcp
|
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
|
[
"Apache-2.0"
] | null | null | null |
_build/dispatcher/jmp_ippsSMS4EncryptOFB_697bbdc3.asm
|
zyktrcn/ippcp
|
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
|
[
"Apache-2.0"
] | null | null | null |
extern m7_ippsSMS4EncryptOFB:function
extern n8_ippsSMS4EncryptOFB:function
extern y8_ippsSMS4EncryptOFB:function
extern e9_ippsSMS4EncryptOFB:function
extern l9_ippsSMS4EncryptOFB:function
extern n0_ippsSMS4EncryptOFB:function
extern k0_ippsSMS4EncryptOFB:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsSMS4EncryptOFB
.Larraddr_ippsSMS4EncryptOFB:
dq m7_ippsSMS4EncryptOFB
dq n8_ippsSMS4EncryptOFB
dq y8_ippsSMS4EncryptOFB
dq e9_ippsSMS4EncryptOFB
dq l9_ippsSMS4EncryptOFB
dq n0_ippsSMS4EncryptOFB
dq k0_ippsSMS4EncryptOFB
segment .text
global ippsSMS4EncryptOFB:function (ippsSMS4EncryptOFB.LEndippsSMS4EncryptOFB - ippsSMS4EncryptOFB)
.Lin_ippsSMS4EncryptOFB:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsSMS4EncryptOFB:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsSMS4EncryptOFB]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsSMS4EncryptOFB:
| 28.435897
| 99
| 0.801623
|
6b7eefd1c7dffee0eeaab69f364bc1edc2f49ef2
| 9,191
|
asm
|
Assembly
|
Assembly/Project/Macros.asm
|
Myself086/Project-Nested
|
89153325af8e5e2d443994352eae60ad06ed5922
|
[
"MIT"
] | 338
|
2020-07-26T23:26:20.000Z
|
2022-03-31T15:26:49.000Z
|
Assembly/Project/Macros.asm
|
Myself086/Project-Nested
|
89153325af8e5e2d443994352eae60ad06ed5922
|
[
"MIT"
] | 47
|
2020-08-08T10:21:02.000Z
|
2022-03-30T16:28:35.000Z
|
Assembly/Project/Macros.asm
|
Myself086/Project-Nested
|
89153325af8e5e2d443994352eae60ad06ed5922
|
[
"MIT"
] | 8
|
2020-08-10T19:04:09.000Z
|
2021-09-27T07:25:02.000Z
|
// NOTE: There are more macros in other files but macros in this file are global
// ---------------------------------------------------------------------------
// Thread lock/unlock (prevent IRQ)
.macro lock
sei
.endm
.macro unlock
cli
.endm
// ---------------------------------------------------------------------------
// Inc/dec alias macros
.macro ina
inc a
.endm
.macro dea
dec a
.endm
.macro inc16dp
inc $.Zero+{0}
bne $+b_inc16__
inc $.Zero+{0}+1
b_inc16__:
.endm
// ---------------------------------------------------------------------------
// Stack related macros
// 15.33 cycles to change DB based on a local variable, 15.00 is possible but ruins register A
.macro ldb dp
pei ({0}-1)
plb
plb
.endm
// ---------------------------------------------------------------------------
// Breakpoint
// 7e0afe
.macro breakpoint
sta $=Breakpoint
.endm
// ---------------------------------------------------------------------------
// Trap/exception related macros
.macro trap
trap__:
bra $-trap__
.endm
.macro trapcc
trap__:
bcc $-trap__
.endm
.macro trapcs
trap__:
bcs $-trap__
.endm
.macro trapeq
trap__:
beq $-trap__
.endm
.macro trapne
trap__:
bne $-trap__
.endm
.macro trappl
trap__:
bpl $-trap__
.endm
.macro trapmi
trap__:
bmi $-trap__
.endm
// Exception template:
// Exception "Exception name{}{}{}Details.{}{}Solution."
.macro exception Message
Exception "{0}"
.endm
.macro Exception Message
ExceptionStart
.string0 "{0}"
ExceptionEnd
.endm
.macro ExceptionStart
.pushaddr
.addr ExceptionData, ExceptionData|0x7fff
ExceptionStart__:
// Pointer to next element
.data16 0
// PC value of last trap
.data8 3
.data24 trap__
.endm
.macro ExceptionEnd
this__:
// Link this element to the next
.addr ExceptionData, ExceptionData|0x7fff
.data16 this__
.def ExceptionData, this__
.pulladdr
.endm
// ---------------------------------------------------------------------------
// Branch related macros
.macro jcc dest
bcs $+branch__
jmp {0}
branch__:
.endm
.macro jcs dest
bcc $+branch__
jmp {0}
branch__:
.endm
.macro jne dest
beq $+branch__
jmp {0}
branch__:
.endm
.macro jeq dest
bne $+branch__
jmp {0}
branch__:
.endm
.macro jpl dest
bmi $+branch__
jmp {0}
branch__:
.endm
.macro jmi dest
bpl $+branch__
jmp {0}
branch__:
.endm
// ---------------------------------------------------------------------------
// Switch related macros
.macro switch count, defaultDestination, breakDestination
case_value__:
.fill16 {0}, _{1}
.def case_break__ {2}
.endm
.macro case value
case_destination__:
.pushaddr
.addr case_value__+{0}*2
.data16 _case_destination__
.pulladdr
.endm
.macro casex value
.def case_param1__ =Zero+{0}/2
case case_param1__
.endm
.macro cases value1, value2
case_destination__:
.pushaddr
.addr case_value__+{0}*2
.fill16 _Zero+{1}-{0}+1, _case_destination__
.pulladdr
.endm
.macro casesx value1, value2
.def case_param1__ =Zero+{0}/2
.def case_param2__ =Zero+{1}/2
cases case_param1__, case_param2__
.endm
.macro caseat value, destination
.pushaddr
.addr case_value__+{0}*2
.data16 _Zero+{1}
.pulladdr
.endm
.macro break
jmp $_case_break__
.endm
// ---------------------------------------------------------------------------
// Dictionary related macros
.macro Dict_NodeBegin string
Dict_Node__:
// Pointer to next element
.data16 0
// String size
.data8 0
// String data
this__:
.string "{0}"
that__:
// Fix string size
.pushaddr
.addr this__-1
.data8 that__-this__
.pulladdr
.endm
.macro Dict_NodeEnd
This__:
.pushaddr
.addr Dict_Node__
.data16 This__
.pulladdr
.def Dict_Node__ 0
.endm
.macro Dict_Null
.data16 0
.endm
.macro Dict_FakeNull
.pushaddr
.data16 0
.pulladdr
.endm
.macro Dict_Case text
Dict_NodeEnd
Dict_NodeBegin "{0}"
.endm
.macro Dict_EndCase
Dict_NodeEnd
Dict_Null
.endm
// ---------------------------------------------------------------------------
// Memory allocation related macros
.macro Mac_MemoryClear object
.precall Memory__Trim =StackPointer, _Length
lda $.{0}
sta $.Param_StackPointer
lda $.{0}+1
sta $.Param_StackPointer+1
stz $.Param_Length
call
.endm
// ---------------------------------------------------------------------------
// Call management related macros
.macro FakeCall destination
.pushaddr
call {0}
.pulladdr
.endm
// ---------------------------------------------------------------------------
// Mapper related macros
.macro iIOPort_InterfaceSwitch defaultDestination
switch 13, {0}, DP_Zero
.endm
// Load instructions
.def iIOPort_lda 0
.def iIOPort_ldx 1
.def iIOPort_ldy 2
// Load indexed instructions
.def iIOPort_loadindexed 3
.def iIOPort_ldax 3
.def iIOPort_lday 4
.def iIOPort_ldai 5
// Store instructions
.def iIOPort_store 6
.def iIOPort_sta 6
.def iIOPort_stx 7
.def iIOPort_sty 8
.def iIOPort_stax 9
.def iIOPort_stay 10
.def iIOPort_stai 11
// RMW instructions
.def iIOPort_readwrite 12
.def iIOPort_rmw 12
.macro IOPort_Compare value, opcode, destination
cmp #_Zero+{0}
{1} $+b_skip__
ldx #_Zero+{2}
jmp $=Recompiler__GetIOAccess_ReturnMapper
b_skip__:
.endm
.macro IOPort_CompareEnd
jmp $=Recompiler__GetIOAccess_DefaultMapper
.endm
// ---------------------------------------------------------------------------
// Core call related macros
.def CoreCall_COUNT 0
.macro CoreCall_DEFINE name param
// Defines a CoreCall instrutions
.def {0} CoreCall_COUNT
.def CoreCall_COUNT CoreCall_COUNT+1
.macro {0}
.data8 {0}
{1}
.endm
.endm
CoreCall_DEFINE CoreCall_Begin "" // Begin prerequisite instruction for calling core function (must be 0x00)
CoreCall_DEFINE CoreCall_End "" // End prerequisite instruction for calling core function
CoreCall_DEFINE CoreCall_Call ".data16 {0}" // Long call function
CoreCall_DEFINE CoreCall_Lock "" // Surrounds call with SEI+CLI, takes priority over PHP
CoreCall_DEFINE CoreCall_UseA8 "" // Surrounds call with XBA+XBA if A is used
CoreCall_DEFINE CoreCall_UseA16 "" // Surrounds call with PHA+PLA if A is used
CoreCall_DEFINE CoreCall_UseX "" // Surrounds call with PHX+PLX if X is used
CoreCall_DEFINE CoreCall_UseY "" // Surrounds call with PHY+PLY if Y is used
CoreCall_DEFINE CoreCall_UseN "" // Surrounds call with PHP+PLP if P.n is used
CoreCall_DEFINE CoreCall_UseV "" // Surrounds call with PHP+PLP if P.v is used
CoreCall_DEFINE CoreCall_UseZ "" // Surrounds call with PHP+PLP if P.z is used
CoreCall_DEFINE CoreCall_UseC "" // Surrounds call with PHP+PLP if P.c is used
CoreCall_DEFINE CoreCall_Push "" // Push every register used by both caller and callee
CoreCall_DEFINE CoreCall_Pull "" // Pull every register used by both caller and callee
CoreCall_DEFINE CoreCall_IfFreeA ".data8 {0}" // If A is free, goto {0}
CoreCall_DEFINE CoreCall_IfNotFreeA ".data8 {0}" // If A isn't free, goto {0}
CoreCall_DEFINE CoreCall_IfFreeX ".data8 {0}" // If X is free, goto {0}
CoreCall_DEFINE CoreCall_IfNotFreeX ".data8 {0}" // If X isn't free, goto {0}
CoreCall_DEFINE CoreCall_IfFreeY ".data8 {0}" // If Y is free, goto {0}
CoreCall_DEFINE CoreCall_IfNotFreeY ".data8 {0}" // If Y isn't free, goto {0}
CoreCall_DEFINE CoreCall_IfFreeP ".data8 {0}" // If P is free, goto {0}
CoreCall_DEFINE CoreCall_IfNotFreeP ".data8 {0}" // If P isn't free, goto {0}
CoreCall_DEFINE CoreCall_IfJit ".data8 {0}" // If JIT, goto {0}
CoreCall_DEFINE CoreCall_IfAot ".data8 {0}" // If AOT, goto {0}
CoreCall_DEFINE CoreCall_Jump ".data16 {0}" // goto {0}
CoreCall_DEFINE CoreCall_Copy ".data16 {0},{1}" // Copies code from address {0} to {1}-1
CoreCall_DEFINE CoreCall_CopyUpTo ".data8 {0}" // Copies {0} bytes then resume instructions after the last byte
CoreCall_DEFINE CoreCall_Remove ".data8 {0}" // Remove {0} bytes
CoreCall_DEFINE CoreCall_WriteOriginal "" // Writes original instruction
.def CoreCallFlag_PushA 0x0001
.def CoreCallFlag_PushX 0x0002
.def CoreCallFlag_PushY 0x0004
.def CoreCallFlag_PushP 0x0008
.def CoreCallFlag_Xba 0x0010
.def CoreCallFlag_Lock 0x0020
// ---------------------------------------------------------------------------
// Data segmentation related macros
.macro SegmentStart ByteCount
.pushaddr
.def segmentByteCount__ {0}
.align segmentByteCount__
.endm
.macro SegmentEnd
// Workaround for keeping end address
this__:
// Pull address and verify that we haven't gone over the original limit (+1)
.pulladdr
.addrlow this__
.pushaddr
.data8 0
.pulladdr
.endm
.macro Segment
this__:
// Uncap address limit temporarily so we can align to the next segment
.addr this__
.misalign segmentByteCount__
.align segmentByteCount__
this__:
// Lock address range to the new segment
.def temp__ segmentByteCount__-1
.addr this__, this__|temp__
.endm
| 21.988038
| 116
| 0.621913
|
cb360854cd009bd94f92fe8cbae8f1820f582e2a
| 2,454
|
asm
|
Assembly
|
p2/matrix.asm
|
t0ush1/ComputerOrganization
|
8093949bbd3e48678cea832133e9bf8990bbdf27
|
[
"MIT"
] | 2
|
2022-03-06T06:05:24.000Z
|
2022-03-10T09:08:08.000Z
|
p2/matrix.asm
|
t0ush1/ComputerOrganization
|
8093949bbd3e48678cea832133e9bf8990bbdf27
|
[
"MIT"
] | null | null | null |
p2/matrix.asm
|
t0ush1/ComputerOrganization
|
8093949bbd3e48678cea832133e9bf8990bbdf27
|
[
"MIT"
] | null | null | null |
.data
A: .space 256 #int A[8][8]
B: .space 256 #int B[8][8]
C: .space 256 #int C[8][8]
space: .asciiz " "
line: .asciiz "\n"
.macro readInt(%x)
li $v0, 5
syscall
move %x, $v0
.end_macro
.macro writeInt(%x)
move $a0, %x
li $v0, 1
syscall
.end_macro
.macro writeString(%s)
la $a0, %s
li $v0, 4
syscall
.end_macro
.macro getAddr(%addr, %i, %j)
sll %addr, %i, 3
add %addr, %addr, %j
sll %addr, %addr, 2
.end_macro
.text
readInt($s0) #read n -> $s0
li $t0, 0 #for (int i = 0; i < n; i ++) i -> $t0
for_1_begin:
beq $t0, $s0, for_1_end
li $t1, 0 #for (int j = 0; j < n; j ++) j -> $t1
for_2_begin:
beq $t1, $s0, for_2_end
getAddr($t2, $t0, $t1) #read A[i][j]
readInt($t3)
sw $t3, A($t2)
addi $t1, $t1, 1
j for_2_begin
for_2_end:
addi $t0, $t0, 1
j for_1_begin
for_1_end:
li $t0, 0 #for (int i = 0; i < n; i ++) i -> $t0
for_3_begin:
beq $t0, $s0, for_3_end
li $t1, 0 #for (int j = 0; j < n; j ++) j -> $t1
for_4_begin:
beq $t1, $s0, for_4_end
getAddr($t2, $t0, $t1) #read B[i][j]
readInt($t3)
sw $t3, B($t2)
addi $t1, $t1, 1
j for_4_begin
for_4_end:
addi $t0, $t0, 1
j for_3_begin
for_3_end:
li $t0, 0 #for (int i = 0; i < n; i ++) i -> $t0
for_5_begin:
beq $t0, $s0, for_5_end
li $t1, 0 #for (int j = 0; j < n; j ++) j -> $t1
for_6_begin:
beq $t1, $s0, for_6_end
li $t3, 0 #int sum = 0 -> $t3
li $t2, 0 #for (int k = 0; k < n; k ++) k -> $t2
for_7_begin:
beq $t2, $s0, for_7_end
getAddr($t4, $t0, $t2) #sum += A[i][k] * B[k][j]
lw $t5, A($t4)
getAddr($t4, $t2, $t1)
lw $t6, B($t4)
mult $t5, $t6
mflo $t4
add $t3, $t3, $t4
addi $t2, $t2, 1
j for_7_begin
for_7_end:
getAddr($t4, $t0, $t1) #C[i][j] = sum
sw $t3, C($t4)
addi $t1, $t1, 1
j for_6_begin
for_6_end:
addi $t0, $t0, 1
j for_5_begin
for_5_end:
li $t0, 0 #for (int i = 0; i < n; i ++) i -> $t0
for_8_begin:
beq $t0, $s0, for_8_end
li $t1, 0 #for (int j = 0; j < n; j ++) j -> $t1
for_9_begin:
beq $t1, $s0, for_9_end
getAddr($t2, $t0, $t1) #write C[i][j]
lw $t3, C($t2)
writeInt($t3)
writeString(space)
sw $t3, B($t2)
addi $t1, $t1, 1
j for_9_begin
for_9_end:
writeString(line)
addi $t0, $t0, 1
j for_8_begin
for_8_end:
li $v0, 10
syscall
| 20.621849
| 60
| 0.502852
|
3d7a827d180d30a5306c0d9cab07dfa7accd3a44
| 6,427
|
nasm
|
Assembly
|
kernel/ipc/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
kernel/ipc/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
kernel/ipc/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
;*******************************************************************************
; connection.nasm - connection functions and system calls.
; Copyright (c) 2003 RET & COM Research.
;*******************************************************************************
module kernel.ipc.connection
%include "sys.ah"
%include "errors.ah"
%include "pool.ah"
%include "hash.ah"
%include "msg.ah"
%include "thread.ah"
%include "tm/process.ah"
publicproc IPC_ConnInit
publicproc K_CloneConnections
exportproc K_ConnDescAddr, K_CreateSConnDesc
exportdata ?ConnPool, ?ConnHash
publicproc sys_ConnectDetach, sys_ConnectClientInfo
externproc K_PoolInit, K_PoolAllocChunk, K_PoolFreeChunk
externproc K_PoolChunkNumber, K_PoolChunkAddr
externproc K_CreateHashTab, K_HashLookup, K_HashAdd, K_HashRelease
externproc K_SemP, K_SemV
externproc MT_ThreadWakeup
externproc K_AllocateID, BZero
section .bss
?ConnPool RESB tMasterPool_size
?ConnHash RESD 1
section .text
; Initialize connection memory structures.
; Input: none.
; Output: CF=0 - OK;
; CF=1 - error, AX=error code.
proc IPC_ConnInit
xor ecx,ecx
xor edx,edx
mov ebx,?ConnPool
mov cl,tConnDesc_size
mov dl,POOLFL_HIMEM
call K_PoolInit
jc .Ret
call K_CreateHashTab
jc .Ret
mov [?ConnHash],esi
.Ret: ret
endp ;---------------------------------------------------------------
; Get a connection descriptor address.
; Input: EAX=connection ID,
; ESI=process descriptor address.
; Output: CF=0 - OK:
; EDX=hash table slot address,
; EDI=descriptor address;
; CF=1 - error, EAX=errno.
proc K_ConnDescAddr
mpush ebx,esi
mov ebx,esi
mov esi,[?ConnHash]
call K_HashLookup
jc .Invalid
mov edi,[edi+tHashElem.Data]
.Exit: mpop esi,ebx
ret
.Invalid: mov eax,-EBADF
jmp .Exit
endp ;---------------------------------------------------------------
; Create a server connection descriptor.
; Input: EDX=address of channel descriptor,
; EDI=client PCB address,
; ECX=ScoId index (base).
; Output: CF=0 - OK, EAX=SCoID;
; CF=1 - error, EAX=errno.
proc K_CreateSConnDesc
mpush ebx,esi,edi
; Allocate a new descriptor and clear it
mov ebx,?ConnPool
call K_PoolAllocChunk
jc near .Again
mov ebx,esi
push ecx
mov ecx,tConnDesc_size
call BZero
pop ecx
; Allocate an ID from the bitmap, check the index
mov esi,[edx+tChanDesc.PCB]
push ebx
lea ebx,[esi+tProcDesc.MaxConn]
call K_AllocateID
pop ebx
jc near .Again
or ecx,ecx
jz .ScoIndexOK
cmp ecx,SIDE_CHANNEL
jne near .BadIndex
.ScoIndexOK: add eax,ecx
mov [ebx+tConnDesc.ID],eax
mov [ebx+tConnDesc.ClientPCB],edi
mov [ebx+tConnDesc.ChanDesc],edx
; Use connection ID as identifier and PCB address as hash key
mov edi,ebx
mov ebx,esi
mov esi,[?ConnHash]
call K_HashAdd
jc .Again
; Put connection descriptor to the list
.ScoDescFound: mov esi,[edx+tChanDesc.PCB]
inc dword [esi+tProcDesc.ServConnCount]
mLockCB esi, tProcDesc
mEnqueue dword [esi+tProcDesc.ServConnList], Next, Prev, edi, tConnDesc, ebx
mUnlockCB esi, tProcDesc
; Return SCoID
mov eax,[edi+tConnDesc.ID]
clc
.Exit: mpop edi,esi,ebx
ret
.BadIndex: mov eax,-EBADF
jmp .Exit
.Again: mov eax,-EAGAIN
jmp .Exit
endp ;---------------------------------------------------------------
; Copy connection descriptors from one process to another and
; create new server connection descriptors.
; Input: ESI=source PCB address,
; EDI=destination PCB address.
; Output: CF=0 - OK;
; CF=1 - error, AX=error code.
; Note: target connection pool must be already initialized,
; modifies EBX,ECX,EDX,ESI and EDI.
proc K_CloneConnections
mov edx,[esi+tProcDesc.ConnList]
mov ebx,edi
; Allocate a descriptor and copy the data
.Loop: or edx,edx
jz near .Exit
push ebx
mov ebx,?ConnPool
call K_PoolAllocChunk
pop ebx
jc .Exit
mov edi,esi
mov esi,edx
mov ecx,tConnDesc_size
push edi
rep movsb
; Create a corresponding server descriptor
mov ecx,[edx+tConnDesc.ScoID]
and ecx,SIDE_CHANNEL
mov edi,ebx
push edx
mov edx,[edx+tConnDesc.ChanDesc]
call K_CreateSConnDesc
pop edx
pop edi
jc .Exit
mov [edi+tConnDesc.ScoID],eax
; Put it into the list and hash
mEnqueue dword [ebx+tProcDesc.ConnList], Next, Prev, edi, tConnDesc, esi
mov eax,[edi+tConnDesc.ID]
mov esi,[?ConnHash]
call K_HashAdd
jc .Exit
mov eax,edx
mov edx,[edx+tConnDesc.Next]
cmp edx,eax
jne .Loop
.Exit: ret
endp ;---------------------------------------------------------------
; --- System calls -------------------------------------------------------------
; int ConnectDetach(int coid);
proc sys_ConnectDetach
arg coid
locals head
prologue
; Get the connection and channel descriptor addresses
mCurrThread
mov ebx,[eax+tTCB.PCB]
mov eax,[%$coid]
call K_ConnDescAddr
jc .Invalid
mov esi,[edi+tConnDesc.ChanDesc]
; Walk through the list of threads blocked on our connection
; and unblock them with EBADF error
mov ebx,[esi+tChanDesc.SendWaitQ]
mov [%$head],ebx
.Loop: or ebx,ebx
jz .OK
mov edx,[ebx+tTCB.SendReplyNext]
cmp [ebx+tTCB.ConnDesc],edi
jne .Next
mDequeue dword [%$head], SendReplyNext, SendReplyPrev, ebx, tTCB, ecx
; Was the send wait queue head pointing to this thread?
cmp [esi+tChanDesc.SendWaitQ],ebx
jne .ChkReplyQhead
Mov32 esi+tChanDesc.SendWaitQ,%$head
jmp .SetStatus
; Was the reply wait queue head pointing to this thread?
.ChkReplyQhead: cmp [esi+tChanDesc.ReplyWaitQ],ebx
jne .SetStatus
Mov32 esi+tChanDesc.SendWaitQ,%$head
; Set the status and unblock the thread
.SetStatus: mov dword [ebx+tTCB.MsgStatus],-EBADF
call MT_ThreadWakeup
.Next: xchg ebx,edx
cmp ebx,edx
jne .Loop
; Remove this connection from the channel's list and free
; the connection descriptor. Also check if it's a last
; connection to the channel; if so - depending on the
; presence of CHF_DISCONNECT flag either send a pulse
; to the channel or silently free the scoid.
.OK: xor eax,eax
.Exit: epilogue
ret
.Invalid: mov eax,-EINVAL
jmp .Exit
endp ;---------------------------------------------------------------
; int ConnectClientInfo(int scoid, struct _client_info *info,
; int ngroups);
proc sys_ConnectClientInfo
arg scoid, info, ngroups
prologue
MISSINGSYSCALL
epilogue
ret
endp ;---------------------------------------------------------------
| 24.25283
| 80
| 0.65396
|
6dc2aa327fe0503fc610011956e339f5970a87a9
| 2,250
|
asm
|
Assembly
|
util/cv/streq.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
util/cv/streq.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
util/cv/streq.asm
|
olifink/smsqe
|
c546d882b26566a46d71820d1539bed9ea8af108
|
[
"BSD-2-Clause"
] | null | null | null |
; Compare strings for equality v0.00 May 1988 J.R.Oakley QJUMP
section cv
include 'dev8_keys_err'
xref cv_lctab
xdef cv_streq
xdef cv_ssteq
;+++
; Compare two sub strings for equality: no indication of lexical ordering
; is given in the case of inequality. The comparison converts each
; character to lower case before comparing.
;
; Registers:
; Entry Exit
; D0 length to compare 0 or ERR.ITNF
; A0 sub string 0 base preserved
; A1 sub string 1 base preserved
;---
cv_ssteq
steqreg reg d1/d2/a0/a1/a2
movem.l steqreg,-(sp)
lea cv_lctab(pc),a2 ; point to lowercase table
moveq #0,d1 ; make index word OK and set Z
bra.s uce_cmpe
;+++
; Compare two strings for equality: no indication of lexical ordering
; is given in the case of inequality. The comparison converts each
; character to lower case before comparing.
;
; Registers:
; Entry Exit
; D0 0 or ERR.ITNF
; A0 string 0 base preserved
; A1 string 1 base preserved
;---
cv_streq
move.w (a0),d0 ; get length
cmp.w (a1),d0 ; are they the same?
bne.s uce_exnf ; no
movem.l steqreg,-(sp)
lea cv_lctab(pc),a2 ; point to lowercase table
moveq #0,d1 ; make index word OK
cmp.w (a0)+,(a1)+ ; advance to chars and set Z
bra.s uce_cmpe
uce_cmpl
move.b (a0)+,d1
move.b 0(a2,d1.w),d2 ; get lowercased char from string 0
move.b (a1)+,d1
cmp.b 0(a2,d1.w),d2 ; is it same as lowercased string 1?
uce_cmpe
dbne d0,uce_cmpl ; go until NE or done
movem.l (sp)+,steqreg
bne.s uce_exnf
moveq #0,d0 ; equal
uce_exit
rts
uce_exnf
moveq #err.itnf,d0
bra.s uce_exit
end
| 33.088235
| 77
| 0.491111
|
1b5b38454cb7ac3229f04bd68048ec77e7362a22
| 12,109
|
asm
|
Assembly
|
Kingdom.asm
|
mariahassan54/Super-Mario-Game-in-Assembly-Language
|
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
|
[
"MIT"
] | null | null | null |
Kingdom.asm
|
mariahassan54/Super-Mario-Game-in-Assembly-Language
|
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
|
[
"MIT"
] | null | null | null |
Kingdom.asm
|
mariahassan54/Super-Mario-Game-in-Assembly-Language
|
1e037e9acdd9e2bd172c9c2f928a546e5b53a36e
|
[
"MIT"
] | null | null | null |
.model medium, stdcall
.stack 120h
.data
blockBlack byte 00d ;black
blockBrown byte 185d ; brown
comp word 0
gate byte 04d
comp2 word 0
flagWhite byte 15d ;white color
flagGreen byte 02d ;green color
poleWhite byte 15d ;white
.code
drawBlock proc x:word, y:word
push AX
push BX
push CX
push DX
push SI
push DI
mov AX, @data
mov DS, AX
mov CX, x
mov DX, y
push CX
mov ah, 0ch
mov comp, 0
BLOOP:
cmp comp,2
JE Exi
push CX
mov al,blockBlack
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
;row2
pop CX
push CX
dec DX
mov BX,0
BL1:
cmp BX,3
JE BL2
push CX
mov al,blockBrown
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,blockBlack
int 10h
inc CX
mov al,blockBrown
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,blockBlack
int 10h
inc CX
mov al,blockBrown
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
dec DX
inc BX
pop CX
jmp BL1
BL2:
pop CX
push CX
;row5
mov al,blockBlack
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
;row 6
pop CX
push CX
dec DX
mov BX,0
BL3:
cmp BX,3
JE BL4
push CX
mov al,blockBrown
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,blockBlack
int 10h
inc CX
mov al,blockBrown
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,blockBlack
int 10h
dec DX
inc BX
pop CX
jmp BL3
BL4:
pop CX
push CX
mov al,blockBlack
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
dec DX
add comp,1
pop CX
jmp BLOOP
Exi:
pop CX
pop DI
pop SI
pop DX
pop CX
pop BX
pop AX
ret
drawBlock endp
drawFlag proc x:word, y:word
push AX
push BX
push CX
push DX
push SI
push DI
mov AX, @data
mov DS, AX
mov CX, x
mov DX, y
push CX
mov ah, 0ch
add CX,15
mov al,flagWhite
int 10h
pop CX
push CX
dec DX
add CX,14
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,13
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,12
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,11
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,10
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,9
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,8
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,7
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
add CX,6
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
pop CX
push CX
dec DX
add CX,5
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
pop CX
push CX
dec DX
add CX,4
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
pop CX
push CX
dec DX
add CX,3
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
pop CX
push CX
dec DX
add CX,2
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
pop CX
push CX
dec DX
add CX,1
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagGreen
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,flagWhite
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
pop DI
pop SI
pop DX
pop CX
pop BX
pop AX
ret
drawFlag endp
drawKingdom proc X:word,Y:word
push AX
push BX
push CX
push DX
push SI
push DI
mov AX, @data
mov DS, AX
mov CX, X
mov DX, Y
push CX
mov ah, 0ch
invoke drawBlock,X,Y
add CX,16
invoke drawBlock,CX,Y
add CX,16
mov BX,0
mov DX,Y
KL1:
cmp BX,34 ;for height of gate
JE KL2
push CX
mov al,gate
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
inc BX
dec DX
pop CX
jmp KL1
KL2:
add CX,16
mov DX,Y
invoke drawBlock,CX,Y
add CX,16
invoke drawBlock,CX,Y
add CX,16
pop CX ;row 2
push CX
sub DX,16
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
mov al,gate
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
;row 3
pop CX
push CX
sub DX,16
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
invoke drawBlock,CX,DX
add CX,16
;row 4
pop CX
push CX
sub DX,16
invoke drawBlock,CX,DX
add CX,32
invoke drawBlock,CX,DX
add CX,32
invoke drawBlock,CX,DX
;row 5 (pole)
pop CX
push CX
sub DX,18
add CX,39
mov BX,0
KL3:
cmp BX,15
JE KL4
push CX
mov al,poleWhite
int 10h
dec DX
inc BX
pop CX
jmp KL3
KL4:
pop CX
push CX
add CX,24
invoke drawFlag,CX,DX
pop CX
pop DI
pop SI
pop DX
pop CX
pop BX
pop AX
ret
drawKingdom endp
.STARTUP
main proc
mov ah, 0
mov al, 13h
int 10h
mov ah, 06h
mov al, 0
mov cx, 0
mov dh, 80
mov dl, 80
mov bh, 3d
int 10h
; invoke drawBlock,160,100
invoke drawKingdom,100,100
main endp
.EXIT
end
| 12.445015
| 47
| 0.442811
|
0b54a8ac913ea85ea0d8ec56e7654fb8f988cd70
| 244
|
asm
|
Assembly
|
src/test/data/hello-errors.asm
|
pblop/vscode-6x09-assembly
|
416525e435972f237c00fd2e966785301d4884ea
|
[
"MIT"
] | 5
|
2019-07-30T20:11:31.000Z
|
2021-01-07T22:39:14.000Z
|
src/test/data/hello-errors.asm
|
pblop/vscode-6x09-assembly
|
416525e435972f237c00fd2e966785301d4884ea
|
[
"MIT"
] | 3
|
2019-06-30T16:50:19.000Z
|
2022-02-27T01:21:42.000Z
|
src/test/data/hello-errors.asm
|
pblop/vscode-6x09-assembly
|
416525e435972f237c00fd2e966785301d4884ea
|
[
"MIT"
] | 3
|
2019-07-13T23:02:53.000Z
|
2022-02-17T00:28:56.000Z
|
org $3f00
* HELLO WORLD
screen equ #$400
hello ldy #screen
clra
hel010 sta ,y+
cmpy #screen+512
bne hel010
ldx #text
ldy #screen
hel020 lda ,x+
beq loop
sta ,y+++
bra hel020
ldw #1234
loop bra loop
text FCB "HELLO, WORLD!"
FCB 0
END
| 12.842105
| 24
| 0.684426
|
1ba56d47fa1d0a8df99ef28c11227ef29bf8fa48
| 37
|
asm
|
Assembly
|
src/main/fragment/mos6502-common/vboaa=pbuz1_derefidx_vbuyy_eq_vbuaa.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | 2
|
2022-03-01T02:21:14.000Z
|
2022-03-01T04:33:35.000Z
|
src/main/fragment/mos6502-common/vboaa=pbuz1_derefidx_vbuyy_eq_vbuaa.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
src/main/fragment/mos6502-common/vboaa=pbuz1_derefidx_vbuyy_eq_vbuaa.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
eor ({z1}),y
beq !+
lda #1
!:
eor #1
| 6.166667
| 12
| 0.459459
|
aec38bfc067fc9db904a28e976663b1b46bd6dba
| 408
|
asm
|
Assembly
|
Lab2/Lab2 Solution/supporting_files/Solution Programs/fibonacci.asm
|
Smile040501/Processor_Simulator_for_ToyRISC_ISA
|
2f05143a6acc00d54acba5cf9d24119fde284766
|
[
"MIT"
] | 1
|
2021-05-16T14:13:12.000Z
|
2021-05-16T14:13:12.000Z
|
Lab2/Lab2 Solution/supporting_files/Solution Programs/fibonacci.asm
|
Smile040501/Processor_Simulator_for_ToyRISC_ISA
|
2f05143a6acc00d54acba5cf9d24119fde284766
|
[
"MIT"
] | null | null | null |
Lab2/Lab2 Solution/supporting_files/Solution Programs/fibonacci.asm
|
Smile040501/Processor_Simulator_for_ToyRISC_ISA
|
2f05143a6acc00d54acba5cf9d24119fde284766
|
[
"MIT"
] | 1
|
2022-03-19T14:56:20.000Z
|
2022-03-19T14:56:20.000Z
|
.data
n:
10
.text
main:
load %x0, $n, %x3
addi %x0, 65535, %x4
add %x0, %x0, %x5
add %x0, %x0, %x6
beq %x5, %x3, success
store %x6, 0, %x4
subi %x4, 1, %x4
addi %x5, 1, %x5
addi %x0, 1, %x7
beq %x5, %x3, success
store %x7, 0, %x4
loop:
subi %x4, 1, %x4
addi %x5, 1, %x5
beq %x5, %x3, success
add %x6, %x7, %x8
store %x8, 0, %x4
add %x0, %x7, %x6
add %x0, %x8, %x7
jmp loop
success:
end
| 15.111111
| 22
| 0.539216
|
e3e095186d4b6166dc43da88ce321e98d7d5a707
| 156
|
asm
|
Assembly
|
api/api016.asm
|
yosswi414/HariboteOS_USB
|
51746c55d576ac5aa9280d0e7777374d475ccefd
|
[
"Unlicense"
] | null | null | null |
api/api016.asm
|
yosswi414/HariboteOS_USB
|
51746c55d576ac5aa9280d0e7777374d475ccefd
|
[
"Unlicense"
] | null | null | null |
api/api016.asm
|
yosswi414/HariboteOS_USB
|
51746c55d576ac5aa9280d0e7777374d475ccefd
|
[
"Unlicense"
] | 1
|
2021-09-09T01:56:23.000Z
|
2021-09-09T01:56:23.000Z
|
[BITS 32]
GLOBAL api_alloctimer
[SECTION .text]
api_alloctimer: ; int api_alloctimer();
MOV EDX, 16
INT 0x40
RET
| 15.6
| 39
| 0.551282
|
73de77894c7baba09ffc008e069ad1ef15b94a9c
| 363
|
asm
|
Assembly
|
Script/3.asm
|
YeasinArafatPrantik/CSE331L_Section_7_Summer20_NSU_Final
|
79d010069552f0710366cb8bbf1126935230bda7
|
[
"MIT"
] | null | null | null |
Script/3.asm
|
YeasinArafatPrantik/CSE331L_Section_7_Summer20_NSU_Final
|
79d010069552f0710366cb8bbf1126935230bda7
|
[
"MIT"
] | null | null | null |
Script/3.asm
|
YeasinArafatPrantik/CSE331L_Section_7_Summer20_NSU_Final
|
79d010069552f0710366cb8bbf1126935230bda7
|
[
"MIT"
] | null | null | null |
.MODEL SMALL
.STACK 100H
.CODE
.DATA
PROMPT DB
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS,AX
LEA DX,PROMPT
MOV AH,9
INT 21H
MOV CX,26
MOV AH,2
MOV DL,122
@LOOP:
INT 21H
DEC DL
DEC DX
JNZ@LOOP
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
| 11
| 18
| 0.460055
|
9b4c709e4af406d6093a3a2934a48a57a41d3cc6
| 6,456
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_2546.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.log_21829_2546.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.log_21829_2546.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x17902, %r9
nop
nop
nop
nop
nop
xor %rsi, %rsi
mov (%r9), %r12
nop
xor %r13, %r13
lea addresses_normal_ht+0x1e482, %r12
nop
nop
nop
nop
cmp %r11, %r11
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
movups %xmm5, (%r12)
nop
nop
nop
nop
cmp $7635, %r9
lea addresses_D_ht+0x1bc82, %rsi
lea addresses_UC_ht+0x13082, %rdi
cmp %r11, %r11
mov $97, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rbx, %rbx
lea addresses_WT_ht+0xb882, %r11
nop
xor $53551, %r13
movb (%r11), %r9b
add $40578, %r9
lea addresses_A_ht+0x9c82, %rsi
lea addresses_WC_ht+0x4ce2, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
cmp %rbx, %rbx
mov $14, %rcx
rep movsw
xor %r9, %r9
lea addresses_A_ht+0x17622, %r11
nop
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %r12
movq %r12, (%r11)
cmp $61614, %r11
lea addresses_normal_ht+0x16bae, %r13
nop
nop
and %rdi, %rdi
movl $0x61626364, (%r13)
nop
nop
nop
nop
xor $59753, %rbx
lea addresses_WT_ht+0x1c382, %rdi
nop
nop
nop
nop
nop
and $65344, %r13
movw $0x6162, (%rdi)
nop
nop
dec %rdi
lea addresses_D_ht+0xcc82, %rsi
lea addresses_WT_ht+0x16256, %rdi
nop
sub %r9, %r9
mov $67, %rcx
rep movsw
nop
sub %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %r8
push %rsi
// Load
lea addresses_RW+0x10882, %rsi
nop
nop
sub %r10, %r10
movups (%rsi), %xmm3
vpextrq $0, %xmm3, %r13
nop
nop
nop
nop
nop
xor $40943, %r12
// Faulty Load
lea addresses_US+0x9c82, %rsi
nop
nop
nop
nop
nop
sub $42399, %r8
movb (%rsi), %r10b
lea oracles, %r8
and $0xff, %r10
shlq $12, %r10
mov (%r8,%r10,1), %r10
pop %rsi
pop %r8
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 5, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': 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
*/
| 37.317919
| 2,999
| 0.657373
|
c3999ec87226757c02ce1f0e57b98c66880189f0
| 402
|
asm
|
Assembly
|
audio/sfx/battle_29.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | 1
|
2022-02-15T00:19:44.000Z
|
2022-02-15T00:19:44.000Z
|
audio/sfx/battle_29.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
audio/sfx/battle_29.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
SFX_Battle_29_Ch5:
duty_cycle_pattern 3, 0, 2, 1
square_note 11, 15, 3, 288
square_note 9, 13, 3, 336
sound_loop 5, SFX_Battle_29_Ch5
square_note 8, 14, 3, 304
square_note 15, 12, 2, 272
sound_ret
SFX_Battle_29_Ch8:
noise_note 10, 15, 3, 53
noise_note 14, 15, 6, 69
sound_loop 4, SFX_Battle_29_Ch8
noise_note 12, 15, 4, 188
noise_note 12, 15, 5, 156
noise_note 15, 15, 4, 172
sound_ret
| 21.157895
| 32
| 0.726368
|
ad878e70ef1e45d79c7c6cfc477aa39509e62d21
| 129
|
asm
|
Assembly
|
assembler/examples/NOP.asm
|
twystd/GA144
|
741d2f2fca82133d594c51807115bd5121aa5350
|
[
"Unlicense"
] | 9
|
2015-01-31T11:25:01.000Z
|
2021-06-28T19:10:01.000Z
|
assembler/examples/NOP.asm
|
twystd/GA144
|
741d2f2fca82133d594c51807115bd5121aa5350
|
[
"Unlicense"
] | null | null | null |
assembler/examples/NOP.asm
|
twystd/GA144
|
741d2f2fca82133d594c51807115bd5121aa5350
|
[
"Unlicense"
] | null | null | null |
test 0 org # test: nop
main nop ;
nop ;
nop ;
main ;
init main ;
a9 org init ;
| 11.727273
| 46
| 0.379845
|
b0cb495262bfeeb98035603330693ff32849e132
| 6,914
|
asm
|
Assembly
|
Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i7-7700_9_0xca.log_21829_1261.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i7-7700_9_0xca.log_21829_1261.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/AVXALIGN/_st_zr_un_4k_/i7-7700_9_0xca.log_21829_1261.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 %r13
push %r14
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x137, %rsi
lea addresses_A_ht+0x8483, %rdi
nop
nop
nop
sub %rbx, %rbx
mov $88, %rcx
rep movsq
nop
nop
and %r13, %r13
lea addresses_WT_ht+0x1c6b7, %r14
nop
add $52565, %r12
movb (%r14), %cl
nop
nop
add %r14, %r14
lea addresses_WC_ht+0xaf73, %r12
nop
nop
nop
nop
nop
cmp %rbx, %rbx
and $0xffffffffffffffc0, %r12
vmovntdqa (%r12), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rsi
nop
nop
nop
nop
nop
and $34652, %r12
lea addresses_D_ht+0x319f, %rsi
lea addresses_normal_ht+0x153b7, %rdi
nop
nop
nop
nop
sub $9231, %r12
mov $88, %rcx
rep movsw
nop
nop
add %r12, %r12
lea addresses_WT_ht+0x66b7, %rsi
lea addresses_UC_ht+0x180b7, %rdi
nop
nop
nop
nop
xor %r10, %r10
mov $54, %rcx
rep movsl
nop
nop
nop
nop
sub $1902, %r13
lea addresses_WT_ht+0xd2b7, %rsi
nop
inc %rdi
movb (%rsi), %r10b
xor %r14, %r14
lea addresses_normal_ht+0xceb7, %rsi
lea addresses_WT_ht+0x99b7, %rdi
clflush (%rsi)
sub %rbx, %rbx
mov $20, %rcx
rep movsw
cmp %r12, %r12
lea addresses_normal_ht+0xceb7, %r13
nop
nop
nop
nop
sub $21279, %rdi
movups (%r13), %xmm5
vpextrq $1, %xmm5, %r10
nop
xor %r12, %r12
lea addresses_UC_ht+0x4e89, %rsi
lea addresses_normal_ht+0x1925b, %rdi
xor $57166, %r14
mov $61, %rcx
rep movsl
nop
nop
nop
nop
cmp %r12, %r12
lea addresses_normal_ht+0x14937, %r10
clflush (%r10)
nop
nop
nop
nop
nop
cmp %r13, %r13
mov (%r10), %ecx
inc %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %rax
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WC+0x36b7, %r14
nop
xor %rax, %rax
mov $0x5152535455565758, %rcx
movq %rcx, %xmm1
vmovaps %ymm1, (%r14)
nop
xor %rax, %rax
// Faulty Load
mov $0x4c39a600000006b7, %r13
nop
nop
and $59176, %r12
mov (%r13), %rdi
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'79': 2, '00': 3847, '5f': 17735, '58': 245}
5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 00 00 5f 5f 5f 5f 5f 5f 00 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 00 00 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 00 00 5f 5f 00 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 00 00 00 5f 00 00 00 5f 00 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 58 5f 5f 5f 5f 00 5f 5f 5f 00 5f 00 5f 5f 00 00 5f 00 5f 00 00 00 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 00 58 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 00 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 00 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 00 00 5f 5f 5f 5f 5f 00 00 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 00 00 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 00 00 5f 5f 5f 00 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 5f 00 00 5f 5f 5f 5f 5f 5f 5f 5f 00 00 5f 5f 00 5f 5f 5f 5f 00 5f 5f 5f 00 00 5f 5f 5f 00 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 5f 00 5f 5f 58 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 5f 58 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f 5f 00 00 5f 00 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 00 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 00 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 00 5f 5f 00 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 00 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 00 5f 5f 00 5f 5f 5f 5f 5f
*/
| 37.576087
| 2,999
| 0.659242
|
f01fa5fda19ffa3c38505d7926a93486db696f92
| 467
|
asm
|
Assembly
|
oeis/084/A084102.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/084/A084102.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/084/A084102.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A084102: Inverse binomial transform of A084101.
; Submitted by Christian Krause
; 1,2,-2,0,4,-8,8,0,-16,32,-32,0,64,-128,128,0,-256,512,-512,0,1024,-2048,2048,0,-4096,8192,-8192,0,16384,-32768,32768,0,-65536,131072,-131072,0,262144,-524288,524288,0,-1048576,2097152,-2097152,0,4194304,-8388608,8388608,0,-16777216,33554432
mov $1,2
mov $2,2
mov $3,-2
lpb $0
sub $0,1
mov $2,$1
add $2,$1
add $3,$1
sub $1,$3
sub $1,$2
mov $3,$2
lpe
mov $0,$2
div $0,2
| 24.578947
| 242
| 0.655246
|
5026ad57fd89c0fe83ddbdc4a7c2a1987887cea5
| 1,334
|
asm
|
Assembly
|
src/user/loader/loader.asm
|
dgaur/dx
|
701232e4ba67036de7594f33c3f5445d0c49942f
|
[
"MIT"
] | null | null | null |
src/user/loader/loader.asm
|
dgaur/dx
|
701232e4ba67036de7594f33c3f5445d0c49942f
|
[
"MIT"
] | null | null | null |
src/user/loader/loader.asm
|
dgaur/dx
|
701232e4ba67036de7594f33c3f5445d0c49942f
|
[
"MIT"
] | null | null | null |
//
// loader.asm
//
// This is the user-mode loader: embedded in the ramdisk; and responsible for
// loading the rest of the ramdisk + user-mode infrastructure
//
.text
//
// These are the first instructions executed in user mode
//
// On entry, the kernel guarantees that:
// - CS contains a flat 4GB user code selector;
// - DS, ES and SS all contain a flat, 4GB user data selector;
// - ESP contains the base of the stack, as defined by parent thread; and
// points to a valid, mapped page within the current address space
// - All other registers are undefined;
// - The current address space contains views of the .text, .data and .bss
// sections of the user loader image (obviously)
//
// The logic here is similar to the normal user_start.o logic, but is slightly
// different because the loader executes in a stripped-down environment. In
// particular, the loader initially has no heap or environment block; it must
// create and install its own.
//
loader:
nop
nop
// Initialize the user-space environment: the heap, the environment block,
// etc. Normally, the parent thread provides this for its children; but
// since the loader is the initial user thread, it has no such parent
call initialize_environment
// Launch the normal main() logic
call setup_main
// Should never return here
1: jmp 1b
| 29
| 78
| 0.730885
|
607a0fa2d8073a9c99ed643e9590732fdbf2325e
| 346
|
asm
|
Assembly
|
libsrc/math/z88math/c/sccz80/ddiv.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/math/z88math/c/sccz80/ddiv.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/math/z88math/c/sccz80/ddiv.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
;
; Z88dk Z88 Maths Library
;
;
; $Id: ddiv.asm,v 1.4 2016-06-22 19:55:06 dom Exp $
SECTION code_fp
PUBLIC ddiv
EXTERN fsetup
EXTERN stkequ
IF FORz88
INCLUDE "target/z88/def/fpp.def"
ELSE
INCLUDE "fpp.def"
ENDIF
.ddiv
call fsetup
IF FORz88
fpp(FP_DIV)
ELSE
ld a,+(FP_DIV)
call FPP
ENDIF
jp stkequ
| 11.931034
| 57
| 0.632948
|
eb93221f9f1f1cb2f4a1bd08b2bd65248a70a305
| 849
|
asm
|
Assembly
|
oeis/142/A142894.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/142/A142894.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/142/A142894.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A142894: Primes congruent to 10 mod 63.
; Submitted by Christian Krause
; 73,199,577,829,1459,2089,2341,2467,2593,2719,2971,3727,3853,4231,4357,4483,4861,4987,5113,5743,5869,6121,6247,6373,7129,7507,7759,8011,8263,8389,8641,8893,9397,9649,9901,10531,10657,10909,11161,11287,12043,12421,12547,12799,13177,13681,13807,13933,14437,14563,15193,15319,15823,16453,16831,17209,17713,17839,18217,18973,19477,19603,20107,20233,20359,20611,21493,21871,21997,22123,22501,23131,23509,23761,23887,24391,24517,25147,25903,26029,26407,27541,27793,27919,28297,28549,28927,29179,29683,30187
mov $1,12
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
add $1,2
mul $3,6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,19
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,6
sub $0,125
| 33.96
| 501
| 0.727915
|
f6dd397270d3305e50329160406adceb38346a3f
| 4,067
|
asm
|
Assembly
|
savefile/maps/043A_TooMuchWater.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 35
|
2018-04-01T06:55:28.000Z
|
2021-05-09T19:09:42.000Z
|
savefile/maps/043A_TooMuchWater.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 4
|
2018-04-01T15:32:55.000Z
|
2019-02-23T20:46:49.000Z
|
savefile/maps/043A_TooMuchWater.asm
|
stranck/fools2018-1
|
1c506b17343fcdfa708aafaf8e596153e2c63254
|
[
"MIT"
] | 12
|
2018-04-01T15:48:09.000Z
|
2021-01-27T10:22:33.000Z
|
SECTION "Map_043A", ROM0[$B800]
Map_043A_Header:
hdr_tileset 0
hdr_dimensions 12, 9
hdr_pointers_a Map_043A_Blocks, Map_043A_TextPointers
hdr_pointers_b Map_043A_Script, Map_043A_Objects
hdr_pointers_c Map_043A_InitScript, Map_043A_RAMScript
hdr_palette $06
hdr_music MUSIC_ROUTES3, AUDIO_1
hdr_connection NORTH, $0000, 0, 0
hdr_connection SOUTH, $0000, 0, 0
hdr_connection WEST, $0000, 0, 0
hdr_connection EAST, $0327, 1, 8
Map_043A_Objects:
hdr_border $0f
hdr_warp_count 0
hdr_sign_count 4
hdr_signpost 3, 3, $03
hdr_signpost 9, 14, $04
hdr_signpost 4, 12, $05
hdr_signpost 9, 5, $06
hdr_object_count 2
hdr_object SPRITE_BRUNO, 8, 8, STAY, UP, $02
hdr_object SPRITE_DAISY, 19, 10, STAY, NONE, $01
Map_043A_RAMScript:
rs_fill_byte $0a
rs_fill_3 $c787
rs_fill_byte $31
rs_fill_3 $c799
rs_fill_byte $0a
rs_fill_3 $c7ab
rs_end
Map_043A_Blocks:
db $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f
db $0f,$1d,$1f,$1f,$1e,$0b,$0b,$0b,$7a,$0f,$0f,$0f
db $0f,$65,$54,$43,$2d,$1e,$0b,$7a,$7a,$7a,$0f,$0f
db $0f,$65,$54,$43,$43,$2d,$1e,$0f,$74,$7a,$0f,$0f
db $0f,$65,$54,$54,$54,$54,$64,$0f,$0a,$7a,$0f,$0f
db $0f,$65,$78,$78,$78,$54,$64,$0b,$0a,$74,$0a,$0a
db $0f,$65,$43,$43,$64,$0a,$74,$0a,$31,$31,$31,$31
db $0f,$65,$43,$43,$64,$0b,$0b,$0a,$74,$0a,$0a,$0a
db $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f
Map_043A_TextPointers:
dw Map_043A_TX1
dw Map_043A_TX2
dw Map_043A_TX_FoundNuclearThing
dw Map_043A_TX_FoundNuclearThing
dw Map_043A_TX_FoundNuclearThing
dw Map_043A_TX_FoundNuclearThing
Map_043A_InitScript:
ret
Map_043A_Script:
ret
Map_043A_NuclearThingFlag:
db 0
Map_043A_TX1:
db 8
jp EnhancedTextOnly
text "I once went to Eastern"
next "Glitchland and tried to get"
cont "through the Lost Woods."
para "It was awful. I perpetually"
next "kept losing my way."
para "Could it be the reason why"
next "they called this area"
cont "'Lost Woods'?"
done
Map_043A_TX2:
db 8
ld c, EVENT_MICROSCOPIC_NUCLEAR_THINGS
call TestEventFlag
jr c, .questFinished
ld a, [Map_043A_NuclearThingFlag]
cp $04
jr z, .questComplete
ld hl, Map_043A_TX_QuestIntro
call PrintTextEnhanced
jp TextScriptEnd
.questComplete
ld hl, Map_043A_TX_QuestComplete
call PrintTextEnhanced
ld bc, $734a
ld de, $cf0d
call CompleteEvent
jp TextScriptEnd
.questFinished
ld hl, Map_043A_TX_QuestFinished
call PrintTextEnhanced
jp TextScriptEnd
Map_043A_TX_QuestIntro:
text "Oh hey, could you perhaps"
next "help me out?"
para "I had some microscopic"
next "nuclear things in my"
cont "back pocket, and I dropped"
cont "them..."
para "All of them probably fell"
next "in the water."
para "Could you help me in my"
next "search? There's 4 of them"
cont "to find in the waters."
done
Map_043A_TX_QuestComplete:
text "Yes! You found all of my"
next "microscopic nuclear things!"
cont "Thank you!"
wait
Map_043A_TX_QuestFinished:
text "It's good to have all of"
next "my microscopic nuclear"
cont "things back again."
done
Map_043A_TX_FoundNuclearThing:
db 8
ld hl, Map_043A_NuclearThingFlag
inc [hl]
ld hl, Map_043A_TX_NuclearThingGone
ldh a, [$8c]
ld c, a
ld a, PREDEF_ReplaceTextPointer
call PredefCmd
ld hl, .textbox
.textbox
jp EnhancedTextOnly
text "You found a microscopic"
next "nuclear thing."
para "You put it in your back"
next "pocket."
para "You feel warmth. That's"
next "probably because of all"
cont "of the fusion... or fission."
done
Map_043A_TX_NuclearThingGone:
db 8
jp EnhancedTextOnly
text "Nothing to be found here"
next "anymore..."
done
| 26.409091
| 63
| 0.639784
|
5855880322560c73ee8deb71725ab8af0d1fcd20
| 70
|
asm
|
Assembly
|
programs/add.asm
|
ungood/logisim-cpu
|
513051803e9739232650103187e18a1148b084a0
|
[
"MIT"
] | null | null | null |
programs/add.asm
|
ungood/logisim-cpu
|
513051803e9739232650103187e18a1148b084a0
|
[
"MIT"
] | null | null | null |
programs/add.asm
|
ungood/logisim-cpu
|
513051803e9739232650103187e18a1148b084a0
|
[
"MIT"
] | null | null | null |
# Adds x and y and displays the result
LDA x
ADD y
OUT
HLT
x: 28
y: 14
| 10
| 38
| 0.7
|
774044314b273ab08eb52f4c4b58b672f8bbdacb
| 329
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadSpritePaletteHalfBrightness.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadSpritePaletteHalfBrightness.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadSpritePaletteHalfBrightness.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; void SMS_loadSpritePaletteHalfBrightness(void *palette)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_loadSpritePaletteHalfBrightness
EXTERN asm_SMSlib_loadSpritePaletteHalfBrightness
_SMS_loadSpritePaletteHalfBrightness:
pop af
pop hl
push hl
push af
jp asm_SMSlib_loadSpritePaletteHalfBrightness
| 17.315789
| 57
| 0.838906
|
422ec45340df35399bde6e42a852ae40f8a27e67
| 5,506
|
asm
|
Assembly
|
coverage/IN_CTS/0530-COVERAGE-region-info-impl-h-108/work/variant/1_spirv_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | null | null | null |
coverage/IN_CTS/0530-COVERAGE-region-info-impl-h-108/work/variant/1_spirv_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | 47
|
2021-03-11T07:42:51.000Z
|
2022-03-14T06:30:14.000Z
|
coverage/IN_CTS/0530-COVERAGE-region-info-impl-h-108/work/variant/1_spirv_asm/shader.frag.asm
|
asuonpaa/ShaderTests
|
6a3672040dcfa0d164d313224446496d1775a15e
|
[
"Apache-2.0"
] | 4
|
2021-03-09T13:37:19.000Z
|
2022-02-25T07:32:11.000Z
|
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 98
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %33 %92
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %9 "v"
OpName %13 "buf0"
OpMemberName %13 0 "_GLF_uniform_float_values"
OpName %15 ""
OpName %23 "buf1"
OpMemberName %23 0 "two"
OpName %25 ""
OpName %33 "gl_FragCoord"
OpName %52 "i"
OpName %92 "_GLF_color"
OpDecorate %12 ArrayStride 16
OpMemberDecorate %13 0 Offset 0
OpDecorate %13 Block
OpDecorate %15 DescriptorSet 0
OpDecorate %15 Binding 0
OpMemberDecorate %23 0 Offset 0
OpDecorate %23 Block
OpDecorate %25 DescriptorSet 0
OpDecorate %25 Binding 1
OpDecorate %33 BuiltIn FragCoord
OpDecorate %92 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeVector %6 3
%8 = OpTypePointer Function %7
%10 = OpTypeInt 32 0
%11 = OpConstant %10 4
%12 = OpTypeArray %6 %11
%13 = OpTypeStruct %12
%14 = OpTypePointer Uniform %13
%15 = OpVariable %14 Uniform
%16 = OpTypeInt 32 1
%17 = OpConstant %16 0
%18 = OpConstant %16 2
%19 = OpTypePointer Uniform %6
%23 = OpTypeStruct %6
%24 = OpTypePointer Uniform %23
%25 = OpVariable %24 Uniform
%28 = OpConstant %10 1
%29 = OpTypePointer Function %6
%31 = OpTypeVector %6 4
%32 = OpTypePointer Input %31
%33 = OpVariable %32 Input
%34 = OpConstant %10 0
%35 = OpTypePointer Input %6
%38 = OpConstant %16 3
%41 = OpTypeBool
%50 = OpConstantTrue %41
%51 = OpTypePointer Function %16
%53 = OpConstant %16 1
%86 = OpTypeVector %41 3
%91 = OpTypePointer Output %31
%92 = OpVariable %91 Output
%93 = OpConstant %6 1
%94 = OpConstant %6 0
%95 = OpConstantComposite %31 %93 %94 %94 %93
%97 = OpConstantComposite %31 %94 %94 %94 %94
%4 = OpFunction %2 None %3
%5 = OpLabel
%9 = OpVariable %8 Function
%52 = OpVariable %51 Function
%20 = OpAccessChain %19 %15 %17 %18
%21 = OpLoad %6 %20
%22 = OpCompositeConstruct %7 %21 %21 %21
OpStore %9 %22
%26 = OpAccessChain %19 %25 %17
%27 = OpLoad %6 %26
%30 = OpAccessChain %29 %9 %28
OpStore %30 %27
%36 = OpAccessChain %35 %33 %34
%37 = OpLoad %6 %36
%39 = OpAccessChain %19 %15 %17 %38
%40 = OpLoad %6 %39
%42 = OpFOrdLessThan %41 %37 %40
OpSelectionMerge %44 None
OpBranchConditional %42 %43 %44
%43 = OpLabel
OpBranch %45
%45 = OpLabel
OpLoopMerge %47 %48 None
OpBranch %49
%49 = OpLabel
OpBranchConditional %50 %46 %47
%46 = OpLabel
OpBranch %48
%48 = OpLabel
OpBranch %45
%47 = OpLabel
OpBranch %44
%44 = OpLabel
OpStore %52 %53
OpBranch %54
%54 = OpLabel
OpLoopMerge %56 %57 None
OpBranch %58
%58 = OpLabel
%59 = OpLoad %16 %52
%60 = OpSLessThan %41 %59 %38
OpBranchConditional %60 %55 %56
%55 = OpLabel
%61 = OpLoad %16 %52
%62 = OpAccessChain %29 %9 %61
%63 = OpLoad %6 %62
%64 = OpAccessChain %19 %15 %17 %18
%65 = OpLoad %6 %64
%66 = OpFOrdGreaterThanEqual %41 %63 %65
OpSelectionMerge %68 None
OpBranchConditional %66 %67 %68
%67 = OpLabel
%69 = OpLoad %16 %52
%70 = OpAccessChain %29 %9 %28
%71 = OpLoad %6 %70
%72 = OpAccessChain %29 %9 %28
%73 = OpLoad %6 %72
%74 = OpFMul %6 %71 %73
%75 = OpAccessChain %29 %9 %69
OpStore %75 %74
OpBranch %68
%68 = OpLabel
OpBranch %57
%57 = OpLabel
%76 = OpLoad %16 %52
%77 = OpIAdd %16 %76 %53
OpStore %52 %77
OpBranch %54
%56 = OpLabel
%78 = OpLoad %7 %9
%79 = OpAccessChain %19 %15 %17 %18
%80 = OpLoad %6 %79
%81 = OpAccessChain %19 %15 %17 %17
%82 = OpLoad %6 %81
%83 = OpAccessChain %19 %15 %17 %53
%84 = OpLoad %6 %83
%85 = OpCompositeConstruct %7 %80 %82 %84
%87 = OpFOrdEqual %86 %78 %85
%88 = OpAll %41 %87
OpSelectionMerge %90 None
OpBranchConditional %88 %89 %96
%89 = OpLabel
OpStore %92 %95
OpBranch %90
%96 = OpLabel
OpStore %92 %97
OpBranch %90
%90 = OpLabel
OpReturn
OpFunctionEnd
| 34.198758
| 61
| 0.476208
|
3424f6098fbf38ab947e48bcb5772e47b568da8e
| 2,775
|
asm
|
Assembly
|
document/Elf_library_reduced/open_source_tools/ELFkickers/tiny/keepalive.asm
|
unanao/Elfdbs
|
a1cd86f7c604548fa08a8a410b946f50dc544cd8
|
[
"Apache-2.0"
] | null | null | null |
document/Elf_library_reduced/open_source_tools/ELFkickers/tiny/keepalive.asm
|
unanao/Elfdbs
|
a1cd86f7c604548fa08a8a410b946f50dc544cd8
|
[
"Apache-2.0"
] | null | null | null |
document/Elf_library_reduced/open_source_tools/ELFkickers/tiny/keepalive.asm
|
unanao/Elfdbs
|
a1cd86f7c604548fa08a8a410b946f50dc544cd8
|
[
"Apache-2.0"
] | 1
|
2021-08-10T03:53:29.000Z
|
2021-08-10T03:53:29.000Z
|
;; keepalive.asm: Copyright (C) 2000-2001 by Brian Raiter, under the
;; GNU General Public License (version 2 or later). No warranty.
;;
;; To build:
;; nasm -f bin -o keepalive keepalive-2.2.17.asm && chmod +x keepalive
BITS 32
%define origin 0x68070000
org origin
db 0x7F, "ELF" ; timespec begins at the "F"
dd 1 ; specifying 0x146 seconds
dd 0 ; and 0 nanoseconds
dd $$
ding equ $ - 2
dw 2
dw 3
entry equ origin + ($ - $$)
repeat: xor edx, edx ; zero edx
add eax, entry << 8
push dword 4
inc edx ; edx == 1 (length of output)
mov ecx, ding ; ecx points to ASCII BEL
mov ebx, edx ; ebx == 1 (stdout)
pop eax ; eax == 4 (write syscall no.)
int 0x80 ; 1. lather the bell
jmp short skip
db 0
skip: xchg eax, ecx ; move ecx into ebx
xchg eax, ebx ; and set eax < 256
mov al, 162 ; eax == nanosleep syscall no.
mov bl, 3 ; ebx points to timespec
xor ecx, ecx ; ecx == NULL
int 0x80 ; 2. rinse for 326 seconds
jmp short repeat ; 3. repeat
;; This is how the file looks when it is read as an ELF header,
;; beginning at offset 0:
;;
;; e_ident: db 0x7F, "ELF" ; required
;; db 1 ; 1 = ELFCLASS32
;; db 0 ; (garbage)
;; db 0 ; (garbage)
;; db 0x00, 0x00, 0x00, 0x00, 0x00 ; (unused)
;; db 0x00, 0x00, 0x07, 0x68
;; e_type: dw 2 ; 2 = ET_EXE
;; e_machine: dw 3 ; 3 = EM_386
;; e_version: dd 0x0005D231 ; (garbage)
;; e_entry: dd 0x68070014 ; program starts here
;; e_phoff: dd 4 ; phdrs located here
;; e_shoff: dd 0x003AB942 ; (garbage)
;; e_flags: dd 0xD3896800 ; (unused)
;; e_ehsize: dw 0xCD58 ; (garbage)
;; e_phentsize: dw 0xEB80 ; (garbage)
;; e_phnum: dw 1 ; one phdr in the table
;; e_shentsize: dw 0x9391 ; (garbage)
;; e_shnum: dw 0xA2B0 ; (garbage)
;; e_shstrndx: dw 0x03B3 ; (garbage)
;;
;; This is how the file looks when it is read as a program header
;; table, beginning at offset 4:
;;
;; p_type: dd 1 ; 1 = PT_LOAD
;; p_offset: dd 0 ; read from top of file
;; p_vaddr: dd 0x68070000 ; load at this address
;; p_paddr: dd 0x00030002 ; (unused)
;; p_filesz: dd 0x0005D231 ; only slightly off ...
;; p_memsz: dd 0x68070014 ; really off -- oh well
;; p_flags: dd 4 ; 4 = PF_R (no PF_X?)
;; p_align: dd 0xB942 ; (garbage)
;;
;; Note that the top byte of the file's origin (0x68) corresponds to
;; the "push dword" instruction, while the second byte (0x07) is an
;; ASCII BEL.
;;
;; The fields marked as unused are either specifically documented as
;; not being used, or not being used with 386-based implementations.
;; Some of the fields marked as containing garbage are not used when
;; loading and executing programs. Other fields containing garbage are
;; accepted because Linux currently doesn't examine then.
| 33.035714
| 70
| 0.646847
|
5522907bc33fb466380798187d159e592214f5e5
| 1,869
|
asm
|
Assembly
|
work/ff3_bank_switch.asm
|
ypyp-pprn-mnmn/ff3_hack
|
f6b8590de1bd47ff617e56e2813c25305846c002
|
[
"MIT"
] | 4
|
2018-03-29T15:33:26.000Z
|
2022-03-09T13:35:31.000Z
|
work/ff3_bank_switch.asm
|
take-the-bath/ff3_hack
|
f6b8590de1bd47ff617e56e2813c25305846c002
|
[
"MIT"
] | 45
|
2017-11-17T23:46:35.000Z
|
2021-09-27T11:35:47.000Z
|
work/ff3_bank_switch.asm
|
take-the-bath/ff3_hack
|
f6b8590de1bd47ff617e56e2813c25305846c002
|
[
"MIT"
] | null | null | null |
;; encoding: utf-8
;; ff3_bank_switch.asm
;;
;; re-implementation of logics around switching of PRG ROM banks
;;
;; version:
;; 0.1.0
;;=================================================================================================
__FF3_BANK_SWITCH_INCLUDED__
.ifdef _FEATURE_MEMOIZE_BANK_SWITCH
;--------------------------------------------------------------------------------------------------
INIT_PATCH_EX sys.switch_bank, $3f,$ff03,$ff2a,$ff03
sys_x.last_bank.1st = $ce
sys_x.last_bank.2nd = $cf
;; these 3 functions are public endpoints called directly from other codes.
thunk.switch_2banks:
jmp switch_2banks ; FF03 4C 17 FF
thunk.switch_1st_bank:
jmp switch_1st_bank ; FF06 4C 0C FF
thunk.switch_2nd_bank:
jmp switch_2nd_bank ; FF09 4C 1F FF
;; the following functions are NOT directly referred to by codes other than here.
switch_1st_bank:
pha ; FF0C 48
sta <sys_x.last_bank.1st
lda #$06 ; FF0D A9 06
bne sys_x.switch_bank
;sta $8000 ; FF0F 8D 00 80
;pla ; FF12 68
;sta $8001 ; FF13 8D 01 80
;rts ; FF16 60
switch_2banks:
;pha ; FF17 48
jsr switch_1st_bank ; FF18 20 0C FF
;pla ; FF1B 68
clc ; FF1C 18
adc #$01 ; FF1D 69 01
FALL_THROUGH_TO switch_2nd_bank
switch_2nd_bank:
pha ; FF1F 48
sta <sys_x.last_bank.2nd
lda #$07 ; FF20 A9 07
sys_x.switch_bank:
sta $8000 ; FF22 8D 00 80
pla ; FF25 68
sta $8001 ; FF26 8D 01 80
rts ; FF29 60
;==================================================================================================
VERIFY_PC_TO_PATCH_END sys.switch_bank
.endif ;;_FEATURE_MEMOIZE_BANK_SWITCH
| 31.15
| 100
| 0.498127
|
7010789abcc8090e8fccbe388df7dbc486968cc7
| 78
|
asm
|
Assembly
|
software/libs/import_all_libs.asm
|
Arkaeriit/reflet
|
bed632d895989e30bd2d8258ddbabe79cdea2aee
|
[
"MIT"
] | 1
|
2021-12-12T15:05:17.000Z
|
2021-12-12T15:05:17.000Z
|
software/libs/import_all_libs.asm
|
Arkaeriit/reflet
|
bed632d895989e30bd2d8258ddbabe79cdea2aee
|
[
"MIT"
] | null | null | null |
software/libs/import_all_libs.asm
|
Arkaeriit/reflet
|
bed632d895989e30bd2d8258ddbabe79cdea2aee
|
[
"MIT"
] | null | null | null |
@import basicIO.asm
@import math.asm
@import string.asm
@import printing.asm
| 13
| 20
| 0.782051
|
2ca2e7a42557d9fdc9e106b91b35fe12438ba6b4
| 1,903
|
asm
|
Assembly
|
game1/main.asm
|
w84death/arm-assembly
|
6208bd02fa6843b698b646eaf018f13ccb13934c
|
[
"MIT"
] | 3
|
2018-01-26T12:06:36.000Z
|
2020-12-08T14:41:18.000Z
|
game1/main.asm
|
w84death/arm-assembly
|
6208bd02fa6843b698b646eaf018f13ccb13934c
|
[
"MIT"
] | null | null | null |
game1/main.asm
|
w84death/arm-assembly
|
6208bd02fa6843b698b646eaf018f13ccb13934c
|
[
"MIT"
] | null | null | null |
@ ---------------------------------------------------
@
@ Raspberry Pi Assembly GAME#1 by KJ/P1X
@
@ http://p1x.in | http://krzysztofjankowski.com
@ https://github.com/w84death/arm-assembly
@
@ ---------------------------------------------------
.arm
.include "globals.asm"
.data
.balign 4
turn: .word 0
.balign 4
width: .word 80
.balign 4
room_states: .word 0
input: .string "1234567812345678"
intro:
.string "Raspberry Pi / ARM Assembly GAME#1 by KJ/P1X\nVER: beta1\n"
.equ intro_len, .-intro
welcome:
.string "You are in the cave.\nYou only have one torch that is slowly dimming.\nYou need to get out fast! you have 12 moves to get out of the cave.\n"
.equ welcome_len, .-welcome
press_enter:
.string "PRESS ENTER TO START GAME "
.equ press_len, .-press_enter
.text
.global _start
.global _increment_turn
.global _get_turn
.global _get_width
.global _get_room_state
.global _set_room_state
_start:
@ LDR R1, [SP, #8]
@ LDR R2, =width
@ STR R1, [R2]
BL _clear_screen
BL _ui_render_divider
LDR R1, =intro
MOV R2, #intro_len
MOV R3, #ui_white
BL _ui_render_message
BL _ui_render_divider
LDR R1, =welcome
MOV R2, #welcome_len
MOV R3, #ui_white
BL _ui_render_message
BL _ui_render_divider
LDR R1, =press_enter
MOV R2, #press_len
MOV R3, #ui_red
BL _ui_render_message
MOV R0, #0
LDR R1, =input
MOV R2, #128 @ we dont want any garbage in the input
MOV R7, #3
SWI 0
B _room1
_increment_turn:
LDR R1, =turn
LDR R2, [R1]
MOV R3, #1
ADD R2, R3
STR R2, [R1]
BX LR
_get_turn:
LDR R0, =turn
LDR R0, [R0]
BX LR
_get_width:
LDR R0, =width
LDR R0, [R0]
BX LR
_get_room_state:
@ MOV R0, #bit-mask
LDR R1, =room_states
LDR R1, [R1]
AND R2, R1, R0
CMP R2, R0
MOVEQ R0, #1
MOVNE R0, #0
BX LR
_set_room_state:
@ MOV R0, #bit-mask
LDR R1, =room_states
LDR R2, [R1]
EOR R3, R2, R0
STR R3, [R1]
BX LR
| 16.692982
| 151
| 0.638991
|
04263be25384fbf2524061101d00a75b98e9390d
| 574
|
asm
|
Assembly
|
examples/hello_world.ffrisc.asm
|
oshaboy/FFRISC
|
658a2f468f8456697de8f1a5d83da8dacdd1e43b
|
[
"0BSD"
] | 2
|
2021-12-22T14:41:41.000Z
|
2021-12-22T16:46:09.000Z
|
examples/hello_world.ffrisc.asm
|
oshaboy/FFRISC
|
658a2f468f8456697de8f1a5d83da8dacdd1e43b
|
[
"0BSD"
] | null | null | null |
examples/hello_world.ffrisc.asm
|
oshaboy/FFRISC
|
658a2f468f8456697de8f1a5d83da8dacdd1e43b
|
[
"0BSD"
] | 1
|
2021-12-22T14:41:43.000Z
|
2021-12-22T14:41:43.000Z
|
RELOCATE 0
;SET DP to 0x0100
XOR X,X
XOR Y,Y
PUTF Y,0
RESET
YXDP
;get all characters loop
RESET
MEMORY A,[DP+X]
AND A,A ;check if A=0
;halt if A!=0
FLIPF
SKIPF
HALT
;set B to 7
XOR B,B
PUTF B,0
PUTF B,1
PUTF B,2
;set Y to -5
XOR Y,Y
PUTF Y,2
NOT Y
;print loop
ADDF A,A
OUT
SET
DECF B
SKIPF ;if B equals -1
JUMP Y
;done outputting character
INCF X
XOR Y,Y
PUTF Y,3
PUTF Y,4
NOT Y
NOP
JUMP Y
RELOCATE 100
BYTEHEX 48
BYTEHEX 65
BYTEHEX 6C
BYTEHEX 6C
BYTEHEX 6F
BYTEHEX 2C
BYTEHEX 20
BYTEHEX 57
BYTEHEX 6F
BYTEHEX 72
BYTEHEX 6C
BYTEHEX 64
BYTEHEX 21
BYTEHEX 0A
BYTEHEX 00
| 9.258065
| 26
| 0.729965
|
708b3fd4804ab73f2a8562c72d9b682da0aec124
| 645
|
asm
|
Assembly
|
oeis/132/A132787.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/132/A132787.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/132/A132787.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A132787: Triangle read by rows: T(n,k) = 2*A001263(n,k) - 1.
; Submitted by Jamie Morken(w2)
; 1,1,1,1,5,1,1,11,11,1,1,19,39,19,1,1,29,99,99,29,1,1,41,209,349,209,41,1,1,55,391,979,979,391,55,1,1,71,671,2351,3527,2351,671,71,1,1,89,1079,5039,10583,10583,5039,1079,89,1,1,109,1649,9899,27719,38807,27719,9899,1649,109,1,1,131,2419,18149,65339,121967,121967,65339,18149,2419,131,1,1,155,3431,31459,141569,339767,453023,339767,141569,31459,3431,155,1,1,181,4731,52051,286285,858857,1472327,1472327,858857
mov $2,1
lpb $0
add $1,1
sub $0,$1
add $2,1
lpe
bin $1,$0
bin $2,$0
add $0,1
mul $1,$2
div $1,$0
mov $0,$1
sub $0,1
mul $0,2
add $0,1
| 32.25
| 408
| 0.685271
|
b0de5a5f0e484db880ac9fb6c335e0cce0df917e
| 749
|
asm
|
Assembly
|
programs/oeis/205/A205565.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/205/A205565.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/205/A205565.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A205565: Number of ways of writing n = u + v with u <= v, and u,v having in ternary representation no 3.
; 1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,2,4,2,4,8,4,2,4,2,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,2,4,2,4,8,4,2,4,2,1,2,1,2,4,2,1,2,1,2,4,2,4,8,4,2,4,2,4,8,4,8,16,8,4,8,4,2,4,2,4,8,4,2,4,2,1,2,1,2,4,2,1,2,1,2,4,2,4,8,4,2,4,2,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,2,4,2,4,8,4,2,4,2,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,2,4,2,1
cal $0,62756 ; Number of 1's in ternary (base-3) expansion of n.
cal $0,89143 ; a(n) = 9*2^n - 6.
mul $0,11
mov $1,$0
div $1,202
add $1,1
| 74.9
| 502
| 0.544726
|
8468829ce863c26308e2af76edfc309783b59e61
| 1,255
|
asm
|
Assembly
|
programs/oeis/008/A008747.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/008/A008747.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/008/A008747.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A008747: Expansion of (1+x^4)/((1-x)*(1-x^2)*(1-x^3)).
; 1,1,2,3,5,6,9,11,14,17,21,24,29,33,38,43,49,54,61,67,74,81,89,96,105,113,122,131,141,150,161,171,182,193,205,216,229,241,254,267,281,294,309,323,338,353,369,384,401,417,434,451,469,486,505,523,542,561,581,600,621,641,662,683,705,726,749,771,794,817,841,864,889,913,938,963,989,1014,1041,1067,1094,1121,1149,1176,1205,1233,1262,1291,1321,1350,1381,1411,1442,1473,1505,1536,1569,1601,1634,1667,1701,1734,1769,1803,1838,1873,1909,1944,1981,2017,2054,2091,2129,2166,2205,2243,2282,2321,2361,2400,2441,2481,2522,2563,2605,2646,2689,2731,2774,2817,2861,2904,2949,2993,3038,3083,3129,3174,3221,3267,3314,3361,3409,3456,3505,3553,3602,3651,3701,3750,3801,3851,3902,3953,4005,4056,4109,4161,4214,4267,4321,4374,4429,4483,4538,4593,4649,4704,4761,4817,4874,4931,4989,5046,5105,5163,5222,5281,5341,5400,5461,5521,5582,5643,5705,5766,5829,5891,5954,6017,6081,6144,6209,6273,6338,6403,6469,6534,6601,6667,6734,6801,6869,6936,7005,7073,7142,7211,7281,7350,7421,7491,7562,7633,7705,7776,7849,7921,7994,8067,8141,8214,8289,8363,8438,8513,8589,8664,8741,8817,8894,8971,9049,9126,9205,9283,9362,9441,9521,9600,9681,9761,9842,9923,10005,10086,10169,10251,10334,10417
mov $1,$0
add $1,2
mul $1,$0
div $1,6
add $1,1
| 139.444444
| 1,149
| 0.758566
|
8496941e62376e6f875b8564593170fe315b877d
| 5,835
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_137_766.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_137_766.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_137_766.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x10436, %r12
clflush (%r12)
nop
nop
nop
dec %rbp
mov (%r12), %r11w
nop
nop
nop
sub $31055, %r10
lea addresses_WC_ht+0x6a38, %rdi
nop
nop
nop
nop
and $38355, %rcx
mov $0x6162636465666768, %r15
movq %r15, %xmm6
movups %xmm6, (%rdi)
nop
nop
cmp $48921, %r10
lea addresses_UC_ht+0x1edb8, %r15
nop
nop
xor $63855, %rbp
mov $0x6162636465666768, %rcx
movq %rcx, %xmm1
movups %xmm1, (%r15)
nop
nop
nop
xor $15559, %rdi
lea addresses_WT_ht+0x15fb8, %rbp
nop
nop
add $41781, %r10
movw $0x6162, (%rbp)
cmp $25042, %r15
lea addresses_UC_ht+0x11b8, %r10
nop
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%r10)
nop
nop
nop
and $22270, %r15
lea addresses_D_ht+0x14438, %r11
nop
nop
add $53896, %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm1
and $0xffffffffffffffc0, %r11
vmovaps %ymm1, (%r11)
nop
nop
nop
nop
inc %r10
lea addresses_WC_ht+0x8db8, %rsi
lea addresses_WC_ht+0x47b8, %rdi
clflush (%rsi)
nop
nop
add %r12, %r12
mov $21, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r10, %r10
lea addresses_WC_ht+0x18508, %rcx
sub $44468, %r12
mov (%rcx), %di
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_D_ht+0xafdc, %rcx
nop
nop
nop
nop
nop
sub $63486, %r10
mov $0x6162636465666768, %r11
movq %r11, %xmm4
vmovups %ymm4, (%rcx)
nop
cmp $43097, %r10
lea addresses_A_ht+0xb7b8, %r10
clflush (%r10)
nop
nop
nop
nop
and %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
movups %xmm3, (%r10)
nop
nop
nop
nop
nop
dec %rbp
lea addresses_WC_ht+0x11080, %rbp
dec %r15
movl $0x61626364, (%rbp)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x124e8, %rsi
lea addresses_A_ht+0x9c68, %rdi
nop
nop
nop
nop
xor %r15, %r15
mov $24, %rcx
rep movsb
nop
nop
inc %r10
lea addresses_UC_ht+0x160b8, %r11
nop
nop
nop
nop
xor %r15, %r15
mov (%r11), %r10w
nop
nop
nop
dec %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x103b8, %rcx
nop
nop
nop
nop
add %r10, %r10
mov $0x5152535455565758, %rdi
movq %rdi, %xmm5
movups %xmm5, (%rcx)
nop
nop
nop
nop
sub %r12, %r12
// REPMOV
lea addresses_WC+0x1f420, %rsi
lea addresses_WC+0x1f5f8, %rdi
nop
nop
nop
sub %r9, %r9
mov $122, %rcx
rep movsq
inc %rdi
// Load
lea addresses_WC+0x1a138, %r9
nop
inc %r10
movb (%r9), %cl
nop
nop
nop
nop
nop
cmp %r12, %r12
// Store
lea addresses_D+0x1d558, %r9
sub %r12, %r12
mov $0x5152535455565758, %rdi
movq %rdi, (%r9)
nop
nop
nop
nop
nop
sub $21892, %r10
// Faulty Load
lea addresses_US+0x14fb8, %r10
nop
nop
xor %rbx, %rbx
movups (%r10), %xmm2
vpextrq $0, %xmm2, %rdi
lea oracles, %rcx
and $0xff, %rdi
shlq $12, %rdi
mov (%rcx,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}}
{'00': 137}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 21.064982
| 410
| 0.651757
|
94425e6710290356978c76d3c1cc816ba27a366b
| 1,181
|
asm
|
Assembly
|
programs/oeis/213/A213580.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/213/A213580.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/213/A213580.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A213580: Principal diagonal of the convolution array A213579.
; 1,5,15,35,74,146,277,511,925,1651,2916,5108,8889,15385,26507,45491,77806,132678,225645,382835,648121,1095075,1846920,3109800,5228209,8777261,14716167,24643331,41220050,68873786,114964741,191719783,319436629,531789715,884611692,1470419996,2442435561,4054277953,6725539715,11150066195,18474680566,30594069870,50637148125,83768938715,138512205169,228924982851,378187145232,624505924176,1030836822625,1700880296021,2805398420991,4625497568483,7623796143194,12561412716770,20690228018677,34068778899151,56081164240141,92289238625203,151831855673460,249721842592580,410615899367961,675000691356265,1109341741221755,1822730532471155,2994185524083454,4917417406838166,8074217531595597
mov $14,$0
mov $16,$0
add $16,1
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
add $13,1
lpb $13,1
clr $0,11
mov $0,$11
sub $13,1
sub $0,$13
mov $2,$0
mov $3,$0
lpb $2,1
mov $0,$9
sub $0,$3
sub $2,1
mov $3,1
add $8,1
add $3,$8
mov $1,$3
sub $8,$0
lpe
add $1,1
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
| 31.078947
| 678
| 0.716342
|
0c70a1c4fee1f3ab8c120f51b69bb6b98966245f
| 3,340
|
asm
|
Assembly
|
programs/oeis/266/A266733.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/266/A266733.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/266/A266733.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A266733: a(n) = 21*binomial(n+6,7).
; 0,21,168,756,2520,6930,16632,36036,72072,135135,240240,408408,668304,1058148,1627920,2441880,3581424,5148297,7268184,10094700,13813800,18648630,24864840,32776380,42751800,55221075,70682976,89713008,112971936,141214920,175301280,216204912,265025376,322999677,391514760,472120740,566544888,676706394,804731928,952972020,1124018280,1320721479,1546210512,1803912264,2097572400,2431277100,2809475760,3237004680,3719111760,4261482225,4870265400,5552102556,6314155848,7164138366,8110345320,9161686380,10327719192,11618684091,13045540032,14620001760,16354578240,18262612368,20358321984,22656842208,25174269120,27927704805,30935303784,34216320852,37791160344,41681426850,45909977400,50500975140,55479944520,60873828015,66711044400,73021548600,79836893136,87190291188,95116681296,103652793720,112837218480,122710475097,133315084056,144695640012,156898886760,169973793990,183971635848,198946071324,214953226488,232051778595,250303042080,269771056464,290522676192,312627662424,336158776800,361191877200,387806015520,416083537485,446110184520,477975197700,511771423800,547595423466,585547581528,625732219476,668257710120,713236594455,760785700752,811026265896,864084058992,920089507260,979177824240,1041489140328,1107168635664,1176366675393,1249238947320,1325946601980,1406656395144,1491540832782,1580778318504,1674553303500,1773056439000,1876484731275,1985041699200,2098937534400,2218389264000,2343620916000,2474863687296,2612356114368,2756344246656,2907081822645,3064830448680,3229859780532,3402447707736,3582880540722,3771453200760,3968469412740,4174241900808,4389092586879,4613352792048,4847363440920,5091475268880,5346049032324,5611455721872,5888076778584,6176304313200,6476541328425,6789201944280,7114711626540,7453507418280,7806038174550,8172764800200,8554160490876,8950710977208,9362914772211,9791283421920,10236341759280,10698628161312,11178694809576,11677107953952,12194448179760,12731310678240,13288305520413,13866057934344,14465208585828,15086413862520,15730346161530,16397694180504,17089163212212,17805475442664,18547370252775,19315604523600,20110952945160,20934208328880,21786181923660,22667703735600,23579622851400,24522807765456,25498146710673,26506547993016,27548940329820,28626273191880,29739517149342,30889664221416,32077728229932,33304745156760,34571773505115,35879894664768,37230213281184,38623857628608,40061979987120,41545757023680,43076390177184,44655106047552,46283156788869,47961820506600,49692401658900,51476231462040,53314668299970,55209098138040,57160934940900,59171621094600,61242627832911,63375455667888,65571634824696,67832725680720,70160319208980,72556037425872,75021533843256,77558493924912,80168635547385,82853709465240,85615499780748,88455824418024,91376535601638,94379520339720,97466700911580,100640035359864,103901517987267,107253179857824,110697089302800,114235352431200,117870113644920,121603556158560,125437902523920,129375415159200,133418396882925,137569191452616,141830184108228,146203802120376,150692515343370,155298836773080,160025323109652,164874575325096,169849239235767,174952006079760,180185613099240,185552844127728,191056530182364,196699550061168,202484830945320,208415349006480,214494130019169,220724249978232,227108835721404,233651065557000,240354169896750,247221431893800,254256188085900,261461829043800,268841800024875
add $0,6
mov $1,$0
bin $1,7
mul $1,21
| 417.5
| 3,262
| 0.914371
|
4ad3973ecb73505a4956d9ec3eed3232bc9e13b3
| 6,985
|
asm
|
Assembly
|
vp8/common/x86/recon_sse2.asm
|
CM-Archive/android_external_libvpx
|
76e0247ec867fcc232fc79f21e9bf85d3c3a5a3f
|
[
"BSD-3-Clause"
] | 3
|
2015-08-31T15:24:31.000Z
|
2020-04-24T20:31:29.000Z
|
vp8/common/x86/recon_sse2.asm
|
CM-Archive/android_external_libvpx
|
76e0247ec867fcc232fc79f21e9bf85d3c3a5a3f
|
[
"BSD-3-Clause"
] | null | null | null |
vp8/common/x86/recon_sse2.asm
|
CM-Archive/android_external_libvpx
|
76e0247ec867fcc232fc79f21e9bf85d3c3a5a3f
|
[
"BSD-3-Clause"
] | 4
|
2015-09-16T11:40:39.000Z
|
2019-06-10T01:08:46.000Z
|
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
%include "vpx_ports/x86_abi_support.asm"
;void vp8_recon2b_sse2(unsigned char *s, short *q, unsigned char *d, int stride)
global sym(vp8_recon2b_sse2)
sym(vp8_recon2b_sse2):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 4
push rsi
push rdi
; end prolog
mov rsi, arg(0) ;s
mov rdi, arg(2) ;d
mov rdx, arg(1) ;q
movsxd rax, dword ptr arg(3) ;stride
pxor xmm0, xmm0
movq xmm1, MMWORD PTR [rsi]
punpcklbw xmm1, xmm0
paddsw xmm1, XMMWORD PTR [rdx]
packuswb xmm1, xmm0 ; pack and unpack to saturate
movq MMWORD PTR [rdi], xmm1
movq xmm2, MMWORD PTR [rsi+8]
punpcklbw xmm2, xmm0
paddsw xmm2, XMMWORD PTR [rdx+16]
packuswb xmm2, xmm0 ; pack and unpack to saturate
movq MMWORD PTR [rdi+rax], xmm2
movq xmm3, MMWORD PTR [rsi+16]
punpcklbw xmm3, xmm0
paddsw xmm3, XMMWORD PTR [rdx+32]
packuswb xmm3, xmm0 ; pack and unpack to saturate
movq MMWORD PTR [rdi+rax*2], xmm3
add rdi, rax
movq xmm4, MMWORD PTR [rsi+24]
punpcklbw xmm4, xmm0
paddsw xmm4, XMMWORD PTR [rdx+48]
packuswb xmm4, xmm0 ; pack and unpack to saturate
movq MMWORD PTR [rdi+rax*2], xmm4
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
;void vp8_recon4b_sse2(unsigned char *s, short *q, unsigned char *d, int stride)
global sym(vp8_recon4b_sse2)
sym(vp8_recon4b_sse2):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 4
SAVE_XMM
push rsi
push rdi
; end prolog
mov rsi, arg(0) ;s
mov rdi, arg(2) ;d
mov rdx, arg(1) ;q
movsxd rax, dword ptr arg(3) ;stride
pxor xmm0, xmm0
movdqa xmm1, XMMWORD PTR [rsi]
movdqa xmm5, xmm1
punpcklbw xmm1, xmm0
punpckhbw xmm5, xmm0
paddsw xmm1, XMMWORD PTR [rdx]
paddsw xmm5, XMMWORD PTR [rdx+16]
packuswb xmm1, xmm5 ; pack and unpack to saturate
movdqa XMMWORD PTR [rdi], xmm1
movdqa xmm2, XMMWORD PTR [rsi+16]
movdqa xmm6, xmm2
punpcklbw xmm2, xmm0
punpckhbw xmm6, xmm0
paddsw xmm2, XMMWORD PTR [rdx+32]
paddsw xmm6, XMMWORD PTR [rdx+48]
packuswb xmm2, xmm6 ; pack and unpack to saturate
movdqa XMMWORD PTR [rdi+rax], xmm2
movdqa xmm3, XMMWORD PTR [rsi+32]
movdqa xmm7, xmm3
punpcklbw xmm3, xmm0
punpckhbw xmm7, xmm0
paddsw xmm3, XMMWORD PTR [rdx+64]
paddsw xmm7, XMMWORD PTR [rdx+80]
packuswb xmm3, xmm7 ; pack and unpack to saturate
movdqa XMMWORD PTR [rdi+rax*2], xmm3
add rdi, rax
movdqa xmm4, XMMWORD PTR [rsi+48]
movdqa xmm5, xmm4
punpcklbw xmm4, xmm0
punpckhbw xmm5, xmm0
paddsw xmm4, XMMWORD PTR [rdx+96]
paddsw xmm5, XMMWORD PTR [rdx+112]
packuswb xmm4, xmm5 ; pack and unpack to saturate
movdqa XMMWORD PTR [rdi+rax*2], xmm4
; begin epilog
pop rdi
pop rsi
RESTORE_XMM
UNSHADOW_ARGS
pop rbp
ret
;void copy_mem16x16_sse2(
; unsigned char *src,
; int src_stride,
; unsigned char *dst,
; int dst_stride
; )
global sym(vp8_copy_mem16x16_sse2)
sym(vp8_copy_mem16x16_sse2):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 4
push rsi
push rdi
; end prolog
mov rsi, arg(0) ;src;
movdqu xmm0, [rsi]
movsxd rax, dword ptr arg(1) ;src_stride;
mov rdi, arg(2) ;dst;
movdqu xmm1, [rsi+rax]
movdqu xmm2, [rsi+rax*2]
movsxd rcx, dword ptr arg(3) ;dst_stride
lea rsi, [rsi+rax*2]
movdqa [rdi], xmm0
add rsi, rax
movdqa [rdi+rcx], xmm1
movdqa [rdi+rcx*2],xmm2
lea rdi, [rdi+rcx*2]
movdqu xmm3, [rsi]
add rdi, rcx
movdqu xmm4, [rsi+rax]
movdqu xmm5, [rsi+rax*2]
lea rsi, [rsi+rax*2]
movdqa [rdi], xmm3
add rsi, rax
movdqa [rdi+rcx], xmm4
movdqa [rdi+rcx*2],xmm5
lea rdi, [rdi+rcx*2]
movdqu xmm0, [rsi]
add rdi, rcx
movdqu xmm1, [rsi+rax]
movdqu xmm2, [rsi+rax*2]
lea rsi, [rsi+rax*2]
movdqa [rdi], xmm0
add rsi, rax
movdqa [rdi+rcx], xmm1
movdqa [rdi+rcx*2], xmm2
movdqu xmm3, [rsi]
movdqu xmm4, [rsi+rax]
lea rdi, [rdi+rcx*2]
add rdi, rcx
movdqu xmm5, [rsi+rax*2]
lea rsi, [rsi+rax*2]
movdqa [rdi], xmm3
add rsi, rax
movdqa [rdi+rcx], xmm4
movdqa [rdi+rcx*2],xmm5
movdqu xmm0, [rsi]
lea rdi, [rdi+rcx*2]
movdqu xmm1, [rsi+rax]
add rdi, rcx
movdqu xmm2, [rsi+rax*2]
lea rsi, [rsi+rax*2]
movdqa [rdi], xmm0
movdqa [rdi+rcx], xmm1
movdqa [rdi+rcx*2],xmm2
movdqu xmm3, [rsi+rax]
lea rdi, [rdi+rcx*2]
movdqa [rdi+rcx], xmm3
; begin epilog
pop rdi
pop rsi
UNSHADOW_ARGS
pop rbp
ret
| 30.107759
| 80
| 0.458554
|
bd1a84a4e6e688c1e4faf38497609a2ff51ae6d0
| 225
|
asm
|
Assembly
|
libsrc/target/nc100/padoutparallel.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/target/nc100/padoutparallel.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/target/nc100/padoutparallel.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_clib
PUBLIC padoutparallel
PUBLIC _padoutparallel
; fast call
.padoutparallel
._padoutparallel
ld a, l
call 0xb860
jr nc, nochar
ld h, 0
ld l, a
ret
nochar: ld hl, 0xffff
ret
| 13.235294
| 33
| 0.657778
|
4729766750a7075f59c37a6b0d06078579db8942
| 1,131
|
asm
|
Assembly
|
programs/oeis/209/A209725.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/209/A209725.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/209/A209725.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A209725: 1/4 the number of (n+1) X 7 0..2 arrays with every 2 X 2 subblock having distinct clockwise edge differences.
; 12,13,14,16,18,22,26,34,42,58,74,106,138,202,266,394,522,778,1034,1546,2058,3082,4106,6154,8202,12298,16394,24586,32778,49162,65546,98314,131082,196618,262154,393226,524298,786442,1048586,1572874,2097162,3145738,4194314,6291466,8388618,12582922,16777226,25165834,33554442,50331658,67108874,100663306,134217738,201326602,268435466,402653194,536870922,805306378,1073741834,1610612746,2147483658,3221225482,4294967306,6442450954,8589934602,12884901898,17179869194,25769803786,34359738378,51539607562,68719476746,103079215114,137438953482,206158430218,274877906954,412316860426,549755813898,824633720842,1099511627786,1649267441674,2199023255562,3298534883338,4398046511114,6597069766666,8796093022218,13194139533322,17592186044426,26388279066634,35184372088842,52776558133258,70368744177674,105553116266506,140737488355338,211106232533002,281474976710666,422212465065994,562949953421322,844424930131978,1125899906842634,1688849860263946
seq $0,164090 ; a(n) = 2*a(n-2) for n > 2; a(1) = 2, a(2) = 3.
add $0,10
| 188.5
| 935
| 0.846154
|
c4aa9f3e4ccbb3f256224be35b2b8882bdc4361b
| 84,929
|
asm
|
Assembly
|
V2/src/TinyBasic/Standalone/basic.asm
|
anjennings/Tom80
|
99b58b32b923068c26e8781912ad825978b10f37
|
[
"MIT"
] | 55
|
2021-01-16T16:18:45.000Z
|
2022-03-28T17:58:05.000Z
|
V2/src/TinyBasic/Standalone/basic.asm
|
anjennings/Z80-Computer
|
99b58b32b923068c26e8781912ad825978b10f37
|
[
"MIT"
] | 1
|
2021-03-19T13:38:28.000Z
|
2021-03-19T14:04:13.000Z
|
V2/src/TinyBasic/Standalone/basic.asm
|
anjennings/Z80-Computer
|
99b58b32b923068c26e8781912ad825978b10f37
|
[
"MIT"
] | 8
|
2021-02-07T18:52:32.000Z
|
2022-01-18T07:00:45.000Z
|
;*************************************************************
;
; TINY BASIC FOR ZILOG Z80
; VERSION 2.5g
;
; ORIGINAL v2.0
; BY LI-CHEN WANG
;
; MODIFIED AND TRANSLATED
; TO INTEL MNEMONICS
; BY ROGER RAUSKOLB
; 10 OCTOBER,1976
;
; MODIFIED AND TRANSLATED
; TO ZILOG MNEMONICS
; BY DOUG GABBARD
; www.retrodepot.net
;
; RELEASED TO THE PUBLIC
; 10 OCTOBER,2017
; YEAH, 41 YEARS LATER....
;
; UPDATED TO V2.5g
; 9 DECEMBER, 2017
; BY DOUG GABBARD
; www.retrodepot.net
;
; @COPYLEFT
; ALL WRONGS RESERVED
;
;*************************************************************
; This code is derived from the original 8080 Tiny Basic.
; It was first compiled in 8080 Mnemonics, then disassembled
; into Zilog Mnemonics. And then checked against the original
; to ensure accuracy. It was then partially enhanced with z80
; specific code. And once done, it was then modified to work
; with the G80-S Micro Computer. However, that portion of the
; code has been left out in order to make this code a little
; more portable. There are only three routines that one needs
; to write, and specifing the serial port's I/O address, in
; order to make this version work with your own DIY computer.
; Those routines can be found at the end of the source code.
;
; I hope you find good use for this relic. However, I would
; ask that if you do find use for it, please put a reference
; to me in your work. And please, distribute freely.
;*************************************************************
;*************************************************************
; *** ROUTINES TO MODIFY ***
;
; The routines that need modified for this to work with your
; particular computer are at the bottom of this file. They
; are: SERIAL_INIT, RX_RDY, and TX_RDY. SERIAL_INIT is a
; routine to intialize the Serial Port that will be used.
; RX_RDY is a routine to check if the Serial Port has a
; character available. And TX_RDY checks to see if the Serial
; Port is ready to send a character, and then sends it.
;
; You will also need to define the location of your serial
; port. It's is the next line below this block of text.
;*************************************************************
SerialPort EQU UART_DHR ;This is for your I/0
SPACE EQU 020H ; Space
TAB EQU 09H ; HORIZONTAL TAB
CTRLC EQU 03H ; Control "C"
CTRLG EQU 07H ; Control "G"
BKSP EQU 08H ; Back space
LF EQU 0AH ; Line feed
CS EQU 0CH ; Clear screen
CR EQU 0DH ; Carriage return
CTRLO EQU 0FH ; Control "O"
CTRLQ EQU 011H ; Control "Q"
CTRLR EQU 012H ; Control "R"
CTRLS EQU 013H ; Control "S"
CTRLU EQU 015H ; Control "U"
ESC EQU 01BH ; Escape
DEL EQU 07FH ; Delete
STACK EQU 0FFFFH ; STACKB
OCSW EQU 08000H ;SWITCH FOR OUTPUT
CURRNT EQU OCSW+1 ;POINTS FOR OUTPUT
STKGOS EQU OCSW+3 ;SAVES SP IN 'GOSUB'
VARNXT EQU OCSW+5 ;TEMP STORAGE
STKINP EQU OCSW+7 ;SAVES SP IN 'INPUT'
LOPVAR EQU OCSW+9 ;'FOR' LOOP SAVE AREA
LOPINC EQU OCSW+11 ;INCREMENT
LOPLMT EQU OCSW+13 ;LIMIT
LOPLN EQU OCSW+15 ;LINE NUMBER
LOPPT EQU OCSW+17 ;TEXT POINTER
RANPNT EQU OCSW+19 ;RANDOM NUMBER POINTER
TXTUNF EQU OCSW+21 ;->UNFILLED TEXT AREA
TXTBGN EQU OCSW+23 ;TEXT SAVE AREA BEGINS
TXTEND EQU 0FF00H ;TEXT SAVE AREA ENDS
;*************************************************************
; *** ZERO PAGE SUBROUTINES ***
;
; THE Z80 INSTRUCTION SET ALLOWS FOR 8 ROUTINES IN LOW MEMORY
; THAT MAY BE CALLED BY RST 00H, 08H, 10H, 18H, 20H, 28H, 30H,
; AND 38H. THIS IS A ONE BYTE INSTRUCTION, AND IS FUNCTIONALLY
; SIMILAR TO THE THREE BYTE INSTRUCTION 'CALL XXXX'. TINY BASIC
; WILL USE THE RST INSTRUCTION FOR THE 7 MOST FREQUENTLY USED
; SUBROUTINES. TWO OTHER SUBROUTINES (CRLF & TSTNUM) ARE ALSO
; IN THIS SECTION. THEY CAN BE REACHED WITH 'CALL'.
;*************************************************************
DWA MACRO WHERE
DB (WHERE SHR 8) + 128
DB WHERE AND 0FFH
ENDM
ORG 0000H
START:
LD SP,STACK ;*** COLD START ***
LD A,0FFH
JP INIT
RST08: EX (SP),HL ;*** TSTC OR RST 08H ***
RST 28H ;IGNORE BLANKS AND
CP (HL) ;TEST CHARACTER
JP TC1 ;REST OF THIS IS AT TC1
CRLF:
LD A,CR ;*** CRLF ***
RST10: PUSH AF ;*** OUTC OR RST 10H ***
LD A,(OCSW) ;PRINT CHARACTER ONLY
OR A ;IF OCSW SWITCH IS ON
JP OUTC ;REST OF THIS AT OUTC
RST18: CALL EXPR2 ;*** EXPR OR RST 18H ***
PUSH HL ;EVALUATE AN EXPRESSION
JP EXPR1 ;REST OF IT AT EXPR1
DB 'W'
RST20: LD A,H ;*** COMP OR RST 20H ***
CP D ;COMPARE HL WITH DE
RET NZ ;RETURN CORRECT C AND
LD A,L ;Z FLAGS
CP E ;BUT OLD A IS LOST
RET
DB 'AN'
SS1:
RST28: LD A,(DE) ;*** IGNBLK/RST 28H ***
CP 20H ;IGNORE BLANKS
RET NZ ;IN TEXT (WHERE DE->)
INC DE ;AND RETURN THE FIRST
JP SS1 ;NON-BLANK CHAR. IN A
RST30: POP AF ;*** FINISH/RST 30H ***
CALL FIN ;CHECK END OF COMMAND
JP QWHAT ;PRINT "WHAT?" IF WRONG
DB 'G'
RST38: RST 28H ;*** TSTV OR RST 38H ***
SUB 40H ;TEST VARIABLES
RET C ;C:NOT A VARIABLE
JR NZ,TV1 ;NOT "@" ARRAY
INC DE ;IT IS THE "@" ARRAY
CALL PARN ;@ SHOULD BE FOLLOWED
ADD HL,HL ;BY (EXPR) AS ITS INDEX
JR C,QHOW ;IS INDEX TOO BIG?
PUSH DE ;WILL IT OVERWRITE
EX DE,HL ;TEXT?
CALL SIZE ;FIND SIZE OF FREE
RST 20H ;AND CHECK THAT
JP C,ASORRY ;IF SO, SAY "SORRY"
LD HL,VARBGN ;IF NOT GET ADDRESS
CALL SUBDE ;OF @(EXPR) AND PUT IT
POP DE ;IN HL
RET ;C FLAG IS CLEARED
TV1:
CP 1BH ;NOT @, IS IT A TO Z?
CCF ;IF NOT RETURN C FLAG
RET C
INC DE ;IF A THROUGH Z
LD HL,VARBGN ;COMPUTE ADDRESS OF
RLCA ;THAT VARIABLE
ADD A,L ;AND RETURN IT IN HL
LD L,A ;WITH C FLAG CLEARED
LD A,00H
ADC A,H
LD H,A
RET
TC1:
INC HL ;COMPARE THE BYTE THAT
JR Z,TC2 ;FOLLOWS THE RST INST.
PUSH BC ;WITH THE TEXT (DE->)
LD C,(HL) ;IF NOT =, ADD THE 2ND
LD B,00H ;BYTE THAT FOLLOWS THE
ADD HL,BC ;RST TO THE OLD PC
POP BC ;I.E., DO A RELATIVE
DEC DE ;JUMP IF NOT =
TC2:
INC DE ;IF =, SKIP THOSE BYTES
INC HL ;AND CONTINUE
EX (SP),HL
RET
TSTNUM:
LD HL,0000H ;*** TSTNUM ***
LD B,H ;TEST IF THE TEXT IS
RST 28H ;A NUMBER
TN1:
CP 30H ;IF NOT, RETURN 0 IN
RET C ;B AND HL
CP 3AH ;IF NUMBERS, CONVERT
RET NC ;TO BINARY IN HL AND
LD A,0F0H ;SET B TO # OF DIGITS
AND H ;IF H>255, THERE IS NO
JR NZ,QHOW ;ROOM FOR NEXT DIGIT
INC B ;B COUNTS # OF DIGITS
PUSH BC
LD B,H ;HL=10*HL+(NEW DIGIT)
LD C,L
ADD HL,HL ;WHERE 10* IS DONE BY
ADD HL,HL ;SHIFT AND ADD
ADD HL,BC
ADD HL,HL
LD A,(DE) ;AND (DIGIT) IS FROM
INC DE ;STRIPPING THE ASCII
AND 0FH ;CODE
ADD A,L
LD L,A
LD A,00H
ADC A,H
LD H,A
POP BC
LD A,(DE) ;DO THIS DIGIT AFTER
JP P,TN1 ;DIGIT. S SAYS OVERFLOW
QHOW:
PUSH DE ;*** ERROR "HOW?" ***
AHOW:
LD DE,HOW
JP ERROR_ROUTINE
HOW: DB "HOW?",CR
OK: DB "OK",CR
WHAT: DB "WHAT?",CR
SORRY: DB "SORRY",CR
;*************************************************************
;
; *** MAIN ***
;
; THIS IS THE MAIN LOOP THAT COLLECTS THE TINY BASIC PROGRAM
; AND STORES IT IN THE MEMORY.
;
; AT START, IT PRINTS OUT "(CR)OK(CR)", AND INITIALIZES THE
; STACKB AND SOME OTHER INTERNAL VARIABLES. THEN IT PROMPTS
; ">" AND READS A LINE. IF THE LINE STARTS WITH A NON-ZERO
; NUMBER, THIS NUMBER IS THE LINE NUMBER. THE LINE NUMBER
; (IN 16 BIT BINARY) AND THE REST OF THE LINE (INCLUDING CR)
; IS STORED IN THE MEMORY. IF A LINE WITH THE SAME LINE
; NUMBER IS ALREADY THERE, IT IS REPLACED BY THE NEW ONE. IF
; THE REST OF THE LINE CONSISTS OF A CR ONLY, IT IS NOT STORED
; AND ANY EXISTING LINE WITH THE SAME LINE NUMBER IS DELETED.
;
; AFTER A LINE IS INSERTED, REPLACED, OR DELETED, THE PROGRAM
; LOOPS BACK AND ASKS FOR ANOTHER LINE. THIS LOOP WILL BE
; TERMINATED WHEN IT READS A LINE WITH ZERO OR NO LINE
; NUMBER; AND CONTROL IS TRANSFERED TO "DIRECT".
;
; TINY BASIC PROGRAM SAVE AREA STARTS AT THE MEMORY LOCATION
; LABELED "TXTBGN" AND ENDS AT "TXTEND". WE ALWAYS FILL THIS
; AREA STARTING AT "TXTBGN", THE UNFILLED PORTION IS POINTED
; BY THE CONTENT OF A MEMORY LOCATION LABELED "TXTUNF".
;
; THE MEMORY LOCATION "CURRNT" POINTS TO THE LINE NUMBER
; THAT IS CURRENTLY BEING INTERPRETED. WHILE WE ARE IN
; THIS LOOP OR WHILE WE ARE INTERPRETING A DIRECT COMMAND
; (SEE NEXT SECTION). "CURRNT" SHOULD POINT TO A 0.
;*************************************************************
RSTART:
LD SP,STACK
ST1:
CALL CRLF ;AND JUMP TO HERE
LD DE,OK ;DE->STRING
SUB A ;A=0
CALL PRTSTG ;PRINT STRING UNTIL CR
LD HL,ST2+1 ;LITERAL 0
LD (CURRNT),HL ;CURRENT->LINE # = 0
ST2:
LD HL,0000H
LD (LOPVAR),HL
LD (STKGOS),HL
ST3:
LD A,'>' ;PROMPT '>' AND
CALL GETLN ;READ A LINE
PUSH DE ;DE->END OF LINE
LD DE,BUFFER ;DE->BEGINNING OF LINE
CALL TSTNUM ;TEST IF IT IS A NUMBER
RST 28H
LD A,H ;HL=VALUE OF THE # OR
OR L ;0 IF NO # WAS FOUND
POP BC ;BC->END OF LINE
JP Z,DIRECT
DEC DE ;BACKUP DE AND SAVE
LD A,H ;VALUE OF LINE # THERE
LD (DE),A
DEC DE
LD A,L
LD (DE),A
PUSH BC ;BC,DE->BEGIN, END
PUSH DE
LD A,C
SUB E
PUSH AF ;A=# OF BYTES IN LINE
CALL FNDLN ;FIND THIS LINE IN SAVE
PUSH DE ;AREA, DE->SAVE AREA
JR NZ,ST4 ;NZ:NOT FOUND, INSERT
PUSH DE ;Z:FOUND, DELETE IT
CALL FNDNXT ;FIND NEXT LINE
;DE->NEXT LINE
POP BC ;BC->LINE TO BE DELETED
LD HL,(TXTUNF) ;HL->UNFILLED SAVE AREA
CALL MVUP ;MOVE UP TO DELETE
LD H,B ;TXTUNF->UNFILLED ARA
LD L,C
LD (TXTUNF),HL ;UPDATE
ST4:
POP BC ;GET READY TO INSERT
LD HL,(TXTUNF) ;BUT FIRST CHECK IF
POP AF ;THE LENGTH OF NEW LINE
PUSH HL ;IS 3 (LINE # AND CR)
CP 03H ;THEN DO NOT INSERT
JR Z,RSTART ;MUST CLEAR THE STACKB
ADD A,L ;COMPUTE NEW TXTUNF
LD L,A
LD A,00H
ADC A,H
LD H,A ;HL->NEW UNFILLED AREA
LD DE,TXTEND ;CHECK TO SEE IF THERE
RST 20H ;IS ENOUGH SPACE
JP NC,QSORRY ;SORRY, NO ROOM FOR IT
LD (TXTUNF),HL ;OK, UPDATE TXTUNF
POP DE ;DE->OLD UNFILLED AREA
CALL MVDOWN
POP DE ;DE->BEGIN, HL->END
POP HL
CALL MVUP ;MOVE NEW LINE TO SAVE
JR ST3 ;AREA
;*************************************************************
;
; WHAT FOLLOWS IS THE CODE TO EXECUTE DIRECT AND STATEMENT
; COMMANDS. CONTROL IS TRANSFERED TO THESE POINTS VIA THE
; COMMAND TABLE LOOKUP CODE OF 'DIRECT' AND 'EXEC' IN LAST
; SECTION. AFTER THE COMMAND IS EXECUTED, CONTROL IS
; TRANSFERED TO OTHERS SECTIONS AS FOLLOWS:
;
; FOR 'LIST', 'NEW', AND 'STOP': GO BACK TO 'RSTART'
; FOR 'RUN': GO EXECUTE THE FIRST STORED LINE IF ANY, ELSE
; GO BACK TO 'RSTART'.
; FOR 'GOTO' AND 'GOSUB': GO EXECUTE THE TARGET LINE.
; FOR 'RETURN' AND 'NEXT': GO BACK TO SAVED RETURN LINE.
; FOR ALL OTHERS: IF 'CURRENT' -> 0, GO TO 'RSTART', ELSE
; GO EXECUTE NEXT COMMAND. (THIS IS DONE IN 'FINISH'.)
;*************************************************************
;
; *** NEW *** STOP *** RUN (& FRIENDS) *** & GOTO ***
;
; 'NEW(CR)' SETS 'TXTUNF' TO POINT TO 'TXTBGN'
;
; 'STOP(CR)' GOES BACK TO 'RSTART'
;
; 'RUN(CR)' FINDS THE FIRST STORED LINE, STORE ITS ADDRESS (IN
; 'CURRENT'), AND START EXECUTE IT. NOTE THAT ONLY THOSE
; COMMANDS IN TAB2 ARE LEGAL FOR STORED PROGRAM.
;
; THERE ARE 3 MORE ENTRIES IN 'RUN':
; 'RUNNXL' FINDS NEXT LINE, STORES ITS ADDR. AND EXECUTES IT.
; 'RUNTSL' STORES THE ADDRESS OF THIS LINE AND EXECUTES IT.
; 'RUNSML' CONTINUES THE EXECUTION ON SAME LINE.
;
; 'GOTO EXPR(CR)' EVALUATES THE EXPRESSION, FIND THE TARGET
; LINE, AND JUMP TO 'RUNTSL' TO DO IT.
;*************************************************************
NEW:
CALL ENDCHK ;*** NEW(CR) ***
LD HL,TXTBGN
LD (TXTUNF),HL
STOP:
CALL ENDCHK ;*** STOP(CR) ***
JP RSTART
RUN:
CALL ENDCHK ;*** RUN(CR) ***
LD DE,TXTBGN ;FIRST SAVED LINE
RUNNXL:
LD HL,00H ;*** RUNNXL ***
CALL FNDLP ;FIND WHATEVER LINE #
JP C,RSTART ;C:PASSED TXTUNF, QUIT
RUNTSL:
EX DE,HL ;*** RUNTSL ***
LD (CURRNT),HL ;SET 'CURRENT'->LINE #
EX DE,HL
INC DE ;BUMP PASS LINE #
INC DE
RUNSML:
CALL CHKIO ;*** RUNSML ***
LD HL,TAB2-1 ;FIND COMMAND IN TAB2
JP EXEC ;AND EXECUTE IT
GOTO:
RST 18H ;*** GOTO EXPR ***
PUSH DE ;SAVE FOR ERROR ROUTINE
CALL ENDCHK ;MUST FIND A CR
CALL FNDLN ;FIND THE TARGET LINE
JP NZ,AHOW ;NO SUCH LINE #
POP AF ;CLEAR THE PUSH DE
JR RUNTSL ;GO DO IT
;*************************************************************
;
; *** LIST *** & PRINT ***
;
; LIST HAS TWO FORMS:
; 'LIST(CR)' LISTS ALL SAVED LINES
; 'LIST #(CR)' START LIST AT THIS LINE #
; YOU CAN STOP THE LISTING BY CONTROL C KEY
;
; PRINT COMMAND IS 'PRINT ....;' OR 'PRINT ....(CR)'
; WHERE '....' IS A LIST OF EXPRESIONS, FORMATS, BACK-
; ARROWS, AND STRINGS. THESE ITEMS ARE SEPERATED BY COMMAS.
;
; A FORMAT IS A POUND SIGN FOLLOWED BY A NUMBER. IT CONTROLS
; THE NUMBER OF SPACES THE VALUE OF A EXPRESION IS GOING TO
; BE PRINTED. IT STAYS EFFECTIVE FOR THE REST OF THE PRINT
; COMMAND UNLESS CHANGED BY ANOTHER FORMAT. IF NO FORMAT IS
; SPECIFIED, 6 POSITIONS WILL BE USED.
;
; A STRING IS QUOTED IN A PAIR OF SINGLE QUOTES OR A PAIR OF
; DOUBLE QUOTES.
;
; A BACK-ARROW MEANS GENERATE A (CR) WITHOUT (LF)
;
; A (CRLF) IS GENERATED AFTER THE ENTIRE LIST HAS BEEN
; PRINTED OR IF THE LIST IS A NULL LIST. HOWEVER IF THE LIST
; ENDED WITH A COMMA, NO (CRLF) IS GENERATED.
;*************************************************************
LIST:
CALL TSTNUM ;TEST IF THERE IS A #
CALL ENDCHK ;IF NO # WE GET A 0
CALL FNDLN ;FIND THIS OR NEXT LINE
LS1:
JP C,RSTART ;C:PASSED TXTUNF
CALL PRTLN ;PRINT THE LINE
CALL CHKIO ;STOP IF HIT CONTROL-C
CALL FNDLP ;FIND NEXT LINE
JR LS1 ;AND LOOP BACK
PRINT:
LD C,06H ;C = # OF SPACES
RST 08H ;F NULL LIST & ";"
DB 3BH
DB PR2-$-1
CALL CRLF ;GIVE CR-LF AND
JR RUNSML ;CONTINUE SAME LINE
PR2:
RST 08H ;IF NULL LIST (CR)
DB CR
DB PR0-$-1
CALL CRLF ;ALSO GIVE CR-LF AND
JR RUNNXL ;GO TO NEXT LINE
PR0:
RST 08H ;ELSE IS IT FORMAT?
DB '#'
DB PR1-$-1
RST 18H ;YES, EVALUATE EXPR.
LD C,L ;AND SAVE IT IN C
JR PR3 ;LOOK FOR MORE TO PRINT
PR1:
CALL QTSTG ;OR IS IT A STRING?
JR PR8 ;IF NOT, MUST BE EXPR.
PR3:
RST 08H ;IF ",", GO FIND NEXT
DB ','
DB PR6-$-1
CALL FIN ;IN THE LIST.
JR PR0 ;LIST CONTINUES
PR6:
CALL CRLF ;LIST ENDS
RST 30H
PR8:
RST 18H ;EVALUATE THE EXPR
PUSH BC
CALL PRTNUM ;PRINT THE VALUE
POP BC
JR PR3 ;MORE TO PRINT?
;
;*************************************************************
;
; *** GOSUB *** & RETURN ***
;
; 'GOSUB EXPR;' OR 'GOSUB EXPR (CR)' IS LIKE THE 'GOTO'
; COMMAND, EXCEPT THAT THE CURRENT TEXT POINTER, STACKB POINTER
; ETC. ARE SAVE SO THAT EXECUTION CAN BE CONTINUED AFTER THE
; SUBROUTINE 'RETURN'. IN ORDER THAT 'GOSUB' CAN BE NESTED
; (AND EVEN RECURSIVE), THE SAVE AREA MUST BE STACKBED.
; THE STACKB POINTER IS SAVED IN 'STKGOS', THE OLD 'STKGOS' IS
; SAVED IN THE STACKB. IF WE ARE IN THE MAIN ROUTINE, 'STKGOS'
; IS ZERO (THIS WAS DONE BY THE "MAIN" SECTION OF THE CODE),
; BUT WE STILL SAVE IT AS A FLAG FOR NO FURTHER 'RETURN'S.
;
; 'RETURN(CR)' UNDOS EVERYTHING THAT 'GOSUB' DID, AND THUS
; RETURN THE EXECUTION TO THE COMMAND AFTER THE MOST RECENT
; 'GOSUB'. IF 'STKGOS' IS ZERO, IT INDICATES THAT WE
; NEVER HAD A 'GOSUB' AND IS THUS AN ERROR.
;*************************************************************
GOSUB:
CALL PUSHA ;SAVE THE CURRENT "FOR"
RST 18H ;PARAMETERS
PUSH DE ;AND TEXT POINTER
CALL FNDLN ;FIND THE TARGET LINE
JP NZ,AHOW ;NOT THERE. SAY "HOW?"
LD HL,(CURRNT) ;FOUND IT, SAVE OLD.
PUSH HL ;'CURRNT' OLD 'STKGOS'
LD HL,(STKGOS)
PUSH HL
LD HL,0000H ;AND LOAD NEW ONES
LD (LOPVAR),HL
ADD HL,SP
LD (STKGOS),HL
JP RUNTSL ;THEN RUN THAT LINE
RETURN:
CALL ENDCHK ;THERE MUST BE A CR
LD HL,(STKGOS) ;OLD STACKB POINTER
LD A,H ;0 MEANS NOT EXIST
OR L
JP Z,QWHAT ;SO, WE SAY: "WHAT?"
LD SP,HL ;ELSE, RESTORE IT
POP HL
LD (STKGOS),HL ;AND THE OLD "STKGOS"
POP HL
LD (CURRNT),HL ;AND THE OLD 'CURRNT'
POP DE ;OLD TEXT POINTER
CALL POPA ;OLD "FOR" PARAMETERS
RST 30H ;AND WE ARE BACK HOME
;*************************************************************
;
; *** FOR *** & NEXT ***
;
; 'FOR' HAS TWO FORMS:
; 'FOR VAR=EXP1 TO EXP2 STEP EXP3' AND 'FOR VAR=EXP1 TO EXP2'
; THE SECOND FORM MEANS THE SAME THING AS THE FIRST FORM WITH
; EXP3=1. (I.E., WITH A STEP OF +1.)
; TBI WILL FIND THE VARIABLE VAR, AND SET ITS VALUE TO THE
; CURRENT VALUE OF EXP1. IT ALSO EVALUATES EXP2 AND EXP3
; AND SAVE ALL THESE TOGETHER WITH THE TEXT POINTER ETC. IN
; THE 'FOR' SAVE AREA, WHICH CONSISTS OF 'LOPVAR', 'LOPINC',
; 'LOPLMT', 'LOPLN', AND 'LOPPT'. IF THERE IS ALREADY SOME-
; THING IN THE SAVE AREA (THIS IS INDICATED BY A NON-ZERO
; 'LOPVAR'), THEN THE OLD SAVE AREA IS SAVED IN THE STACKB
; BEFORE THE NEW ONE OVERWRITES IT.
; TBI WILL THEN DIG IN THE STACKB AND FIND OUT IF THIS SAME
; VARIABLE WAS USED IN ANOTHER CURRENTLY ACTIVE 'FOR' LOOP.
; IF THAT IS THE CASE, THEN THE OLD 'FOR' LOOP IS DEACTIVATED.
; (PURGED FROM THE STACKB..)
;
; 'NEXT VAR' SERVES AS THE LOGICAL (NOT NECESSARILLY PHYSICAL)
; END OF THE 'FOR' LOOP. THE CONTROL VARIABLE VAR. IS CHECKED
; WITH THE 'LOPVAR'. IF THEY ARE NOT THE SAME, TBI DIGS IN
; THE STACKB TO FIND THE RIGHT ONE AND PURGES ALL THOSE THAT
; DID NOT MATCH. EITHER WAY, TBI THEN ADDS THE 'STEP' TO
; THAT VARIABLE AND CHECK THE RESULT WITH THE LIMIT. IF IT
; IS WITHIN THE LIMIT, CONTROL LOOPS BACK TO THE COMMAND
; FOLLOWING THE 'FOR'. IF OUTSIDE THE LIMIT, THE SAVE AREA
; IS PURGED AND EXECUTION CONTINUES.
;*************************************************************
FOR:
CALL PUSHA ;SAVE THE OLD SAVE AREA
CALL SETVAL ;SET THE CONTROL VAR.
DEC HL ;HL IS ITS ADDRESS
LD (LOPVAR),HL ;SAVE THAT
LD HL,TAB5-1 ;USE 'EXEC' TO LOOK
JP EXEC ;FOR THE WORK 'TO'
FR1:
RST 18H ;EVALUATE THE LIMITE
LD (LOPLMT),HL ;SAVE THAT
LD HL,TAB6-1 ;USE 'EXEC' TO LOOK
JP EXEC ;FOR THE WORD 'STEP'
FR2:
RST 18H ;FOUND IT, GET STEP
JR FR4
FR3:
LD HL,0001H ;NOT FOUND, SET TO 1
FR4:
LD (LOPINC),HL ;SAVE THAT TOO
FR5:
LD HL,(CURRNT) ;SAVE CURRENT LINE #
LD (LOPLN),HL
EX DE,HL ;AND TEXT POINTER
LD (LOPPT),HL
LD BC,0AH ;DIG INTO STACKB TO
LD HL,(LOPVAR) ;FIND 'LOPVAR'
EX DE,HL
LD H,B
LD L,B ;HL=0 NOW
ADD HL,SP ;HERE IS THE STACKB
DB 3EH ;DISASSEMBLY SAID "ld a,09h"
FR7:
ADD HL,BC ;EACH LEVEL IS 10 DEEP - DIS = 09
LD A,(HL) ;GET THAT OLD 'LOPVAR'
INC HL
OR (HL)
JR Z,FR8 ;0 SAYS NO MORE IN IT
LD A,(HL)
DEC HL
CP D ;SAME AS THIS ONE?
JR NZ,FR7
LD A,(HL) ;THE OTHER HALF?
CP E
JR NZ,FR7
EX DE,HL ;YES, FOUND ONE
LD HL,0000H
ADD HL,SP ;TRY TO MOVE SP
LD B,H
LD C,L
LD HL,000AH
ADD HL,DE
CALL MVDOWN ;AND PURGE 10 WORDS
LD SP,HL ;IN THE STACKB
FR8:
LD HL,(LOPPT) ;JOB DONE, RESTORE DE
EX DE,HL
RST 30H ;AND CONTINUE
;
NEXT:
RST 38H ;GET ADDRESS OF VAR.
JP C,QWHAT ;NO VARIABLE, "WHAT?"
LD (VARNXT),HL ;YES, SAVE IT
NX0:
PUSH DE ;SAVE TEXT POINTER
EX DE,HL
LD HL,(LOPVAR) ;GET VAR. IN 'FOR'
LD A,H
OR L ;0 SAYS NEVER HAD ONE
JP Z,AWHAT ;SO WE ASK: "WHAT?"
RST 20H ;ELSE WE CHECK THEM
JR Z,NX3 ;OK, THEY AGREE
POP DE ;NO, LET'S SEE
CALL POPA ;PURGE CURRENT LOOP
LD HL,(VARNXT) ;AND POP ONE LEVEL
JR NX0 ;GO CHECK AGAIN
NX3:
LD E,(HL) ;COME HERE WHEN AGREED
INC HL
LD D,(HL) ;DE=VALUE OF VAR.
LD HL,(LOPINC)
PUSH HL
LD A,H
XOR D
LD A,D
ADD HL,DE ;ADD ONE STEP
JP M,NX4
XOR H
JP M,NX5
NX4:
EX DE,HL
LD HL,(LOPVAR) ;PUT IT BACK
LD (HL),E
INC HL
LD (HL),D
LD HL,(LOPLMT) ;HL->LIMIT
POP AF ;OLD HL
OR A
JP P,NX1 ;STEP > 0
EX DE,HL ;STEP < 0
NX1:
CALL CKHLDE ;COMPARE WITH LIMIT
POP DE ;RESTORE TEXT POINTER
JR C,NX2 ;OUTSIDE LIMIT
LD HL,(LOPLN) ;WITHIN LIMIT, GO
LD (CURRNT),HL ;BACK TO THE SAVED
LD HL,(LOPPT) ;'CURRNT' AND TEXT
EX DE,HL ;POINTER
RST 30H
NX5:
POP HL
POP DE
NX2:
CALL POPA ;PURGE THIS LOOP
RST 30H
;
;*************************************************************
;
; *** REM *** IF *** INPUT *** & LET (& DEFLT) ***
;
; 'REM' CAN BE FOLLOWED BY ANYTHING AND IS IGNORED BY TBI.
; TBI TREATS IT LIKE AN 'IF' WITH A FALSE CONDITION.
;
; 'IF' IS FOLLOWED BY AN EXPR. AS A CONDITION AND ONE OR MORE
; COMMANDS (INCLUDING OTHER 'IF'S) SEPERATED BY SEMI-COLONS.
; NOTE THAT THE WORD 'THEN' IS NOT USED. TBI EVALUATES THE
; EXPR. IF IT IS NON-ZERO, EXECUTION CONTINUES. IF THE
; EXPR. IS ZERO, THE COMMANDS THAT FOLLOWS ARE IGNORED AND
; EXECUTION CONTINUES AT THE NEXT LINE.
;
; 'INPUT' COMMAND IS LIKE THE 'PRINT' COMMAND, AND IS FOLLOWED
; BY A LIST OF ITEMS. IF THE ITEM IS A STRING IN SINGLE OR
; DOUBLE QUOTES, OR IS A BACK-ARROW, IT HAS THE SAME EFFECT AS
; IN 'PRINT'. IF AN ITEM IS A VARIABLE, THIS VARIABLE NAME IS
; PRINTED OUT FOLLOWED BY A COLON. THEN TBI WAITS FOR AN
; EXPR. TO BE TYPED IN. THE VARIABLE IS THEN SET TO THE
; VALUE OF THIS EXPR. IF THE VARIABLE IS PROCEDED BY A STRING
; (AGAIN IN SINGLE OR DOUBLE QUOTES), THE STRING WILL BE
; PRINTED FOLLOWED BY A COLON. TBI THEN WAITS FOR INPUT EXPR.
; AND SET THE VARIABLE TO THE VALUE OF THE EXPR.
;
; IF THE INPUT EXPR. IS INVALID, TBI WILL PRINT "WHAT?",
; "HOW?" OR "SORRY" AND REPRINT THE PROMPT AND REDO THE INPUT.
; THE EXECUTION WILL NOT TERMINATE UNLESS YOU TYPE CONTROL-C.
; THIS IS HANDLED IN 'INPERR'.
;
; 'LET' IS FOLLOWED BY A LIST OF ITEMS SEPERATED BY COMMAS.
; EACH ITEM CONSISTS OF A VARIABLE, AN EQUAL SIGN, AND AN EXPR.
; TBI EVALUATES THE EXPR. AND SET THE VARIABLE TO THAT VALUE.
; TBI WILL ALSO HANDLE 'LET' COMMAND WITHOUT THE WORD 'LET'.
; THIS IS DONE BY 'DEFLT'.
;*************************************************************
REM:
LD HL,0000H ;*** REM ***
DB 3EH ;THIS IS LIKE 'IF 0'
IFF:
RST 18H ;*** IF ***
LD A,H ;IS THE EXPR.=0?
OR L
JP NZ,RUNSML ;NO, CONTINUE
CALL FNDSKP ;YES, SKIP REST OF LINE
JP NC,RUNTSL ;AND RUN THE NEXT LINE
JP RSTART ;IF NO NEXT, RE-START
INPERR:
LD HL,(STKINP) ;*** INPERR ***
LD SP,HL ;RESTORE OLD SP
POP HL ;AND OLD 'CURRNT'
LD (CURRNT),HL
POP DE ;AND OLD TEXT POINTER
POP DE ;REDO INPUT
INPUT: ;*** INPUT ***
IP1:
PUSH DE ;SAVE IN CASE OF ERROR
CALL QTSTG ;IS NEXT ITEM A STRING?
JR IP2 ;NO
RST 38H ;YES, BUT FOLLOWED BY A
JR C,IP4 ;VARIABLE? NO.
JR IP3 ;YES. INPUT VARIABLE
IP2:
PUSH DE ;SAVE FOR 'PRTSTG'
RST 38H ;MUST BE VARIABLE NOW
JP C,QWHAT ;"WHAT?" IT IS NOT?
LD A,(DE) ;GET READY FOR 'PRTSTR'
LD C,A
SUB A
LD (DE),A
POP DE
CALL PRTSTG ;PRINT STRING AS PROMPT
LD A,C ;RESTORE TEXT
DEC DE
LD (DE),A
IP3:
PUSH DE ;SAVE TEXT POINTER
EX DE,HL
LD HL,(CURRNT) ;ALSO SAVE 'CURRNT'
PUSH HL
LD HL,IP1 ;A NEGATIVE NUMBER
LD (CURRNT),HL ;AS A FLAG
LD HL,0000H ;SAVE SP TOO
ADD HL,SP
LD (STKINP),HL
PUSH DE ;OLD HL
LD A,3AH ;PRINT THIS TOO
CALL GETLN ;AND GET A LINE
LD DE,BUFFER ;POINTS TO BUFFER
RST 18H ;EVALUATE INPUT
NOP ;CAN BE 'CALL ENDCHK'
NOP
NOP
POP DE ;OK,GET OLD HL
EX DE,HL
LD (HL),E ;SAVE VALUE IN VAR.
INC HL
LD (HL),D
POP HL ;GET OLD 'CURRNT'
LD (CURRNT),HL
POP DE ;AND OLD TEXT POINTER
IP4:
POP AF ;PURGE JUNK IN STACKB
RST 08H ;IS NEXT CH. ','?
DB ','
DB IP5-$-1
JR IP1 ;YES, MORE ITEMS.
IP5:
RST 30H
DEFLT:
LD A,(DE) ;*** DEFLT ***
CP CR ;EMPTY LINE IS OK
JR Z,LT1 ;ELSE IT IS 'LET'
LET:
CALL SETVAL ;*** LET ***
RST 08H ;SET VALUE TO VAR
DB ',' ;---DISASSEMBLE = INC L
DB LT1-$-1 ;---DISASSEMBLE = INC BC
JR LET ;ITEM BY ITEM
LT1:
RST 30H ;UNTIL FINISH
;*************************************************************
;
; *** EXPR ***
;
; 'EXPR' EVALUATES ARITHMETICAL OR LOGICAL EXPRESSIONS.
; <EXPR>::<EXPR2>
; <EXPR2><REL.OP.><EXPR2>
; WHERE <REL.OP.> IS ONE OF THE OPERATORS IN TAB8 AND THE
; RESULT OF THESE OPERATIONS IS 1 IF TRUE AND 0 IF FALSE.
; <EXPR2>::=(+ OR -)<EXPR3>(+ OR -<EXPR3>)(....)
; WHERE () ARE OPTIONAL AND (....) ARE OPTIONAL REPEATS.
; <EXPR3>::=<EXPR4>(* OR /><EXPR4>)(....)
; <EXPR4>::=<VARIABLE>
; <FUNCTION>
; (<EXPR>)
; <EXPR> IS RECURSIVE SO THAT VARIABLE '@' CAN HAVE AN <EXPR>
; AS INDEX, FUNCTIONS CAN HAVE AN <EXPR> AS ARGUMENTS, AND
; <EXPR4> CAN BE AN <EXPR> IN PARANTHESE.
;*************************************************************
EXPR1:
LD HL,TAB8-1 ;LOOKUP REL.OP.
JP EXEC ;GO DO IT
XP11:
CALL XP18 ;REL.OP.">="
RET C ;NO, RETURN HL=0
LD L,A ;YES, RETURN HL=1
RET
XP12:
CALL XP18 ;REL.OP."#"
RET Z ;FALSE, RETURN HL=0
LD L,A ;TRUE, RETURN HL=1
RET
XP13:
CALL XP18 ;REL.OP.">"
RET Z ;FALSE
RET C ;ALSO FALSE, HL=0
LD L,A ;TRUE, HL=1
RET
XP14:
CALL XP18 ;REL.OP."<="
LD L,A ;SET HL=1
RET Z ;REL. TRUE, RETURN
RET C
LD L,H ;ELSE SET HL=0
RET
XP15:
CALL XP18 ;REL.OP."="
RET NZ ;FALSE, RETURN HL=0
LD L,A ;ELSE SET HL=1
RET
XP16:
CALL XP18 ;REL.OP."<"
RET NC ;FALSE, RETURN HL=0
LD L,A ;ELSE SET HL=1
RET
XP17:
POP HL ;NOT .REL.OP
RET ;RETURN HL=<EXPR2>
XP18:
LD A,C ;SUBROUTINE FOR ALL
POP HL ;REL.OP.'S
POP BC
PUSH HL ;REVERSE TOP OF STACKB
PUSH BC
LD C,A
CALL EXPR2 ;GET 2ND <EXPR2>
EX DE,HL ;VALUE IN DE NOW
EX (SP),HL ;1ST <EXPR2> IN HL
CALL CKHLDE ;COMPARE 1ST WITH 2ND
POP DE ;RESTORE TEXT POINTER
LD HL,0000H ;SET HL=0, A=1
LD A,01H
RET
EXPR2:
RST 08H ;NEGATIVE SIGN?
DB '-'
DB XP21-$-1
LD HL,0000H ;YES, FAKE '0-'
JR XP26 ;TREAT LIKE SUBTRACT
XP21:
RST 08H ;POSITIVE SIGN? IGNORE
DB '+'
DB XP22-$-1
XP22:
CALL EXPR3 ;1ST <EXPR3>
XP23:
RST 08H ;ADD?
DB '+'
DB XP25-$-1
PUSH HL ;YES, SAVE VALUE
CALL EXPR3 ;GET 2ND <EXPR3>
XP24:
EX DE,HL ;2ND IN DE
EX (SP),HL ;1ST IN HL
LD A,H ;COMPARE SIGN
XOR D
LD A,D
ADD HL,DE
POP DE ;RESTORE TEXT POINTER
JP M,XP23 ;1ST AND 2ND SIGN DIFFER
XOR H ;1ST AND 2ND SIGN EQUAL
JP P,XP23 ;SO IS RESULT
JP QHOW ;ELSE WE HAVE OVERFLOW
XP25:
RST 08H ;SUBTRACT?
DB '-'
DB XP42-$-1
XP26:
PUSH HL ;YES, SAVE 1ST <EXPR3>
CALL EXPR3 ;GET 2ND <EXPR3>
CALL CHGSGN ;NEGATE
JR XP24 ;AND ADD THEM
;
EXPR3:
CALL EXPR4 ;GET 1ST <EXPR4>
XP31:
RST 08H ;MULTIPLY?
DB '*'
DB XP34-$-1
PUSH HL ;YES, SAVE 1ST
CALL EXPR4 ;AND GET 2ND <EXPR4>
LD B,00H ;CLEAR B FOR SIGN
CALL CHKSGN ;CHECK SIGN
EX (SP),HL ;1ST IN HL
CALL CHKSGN ;CHECK SIGN OF 1ST
EX DE,HL
EX (SP),HL
LD A,H ;IS HL > 255 ?
OR A
JR Z,XP32 ;NO
LD A,D ;YES, HOW ABOUT DE
OR D
EX DE,HL ;PUT SMALLER IN HL
JP NZ,AHOW ;ALSO >, WILL OVERFLOW
XP32:
LD A,L ;THIS IS DUMB
LD HL,0000H ;CLEAR RESULT
OR A ;ADD AND COUNT
JR Z,XP35
XP33:
ADD HL,DE
JP C,AHOW ;OVERFLOW
DEC A
JR NZ,XP33
JR XP35 ;FINISHED
XP34:
RST 08H ;DIVIDE?
DB '/'
DB XP42-$-1
PUSH HL ;YES, SAVE 1ST <EXPR4>
CALL EXPR4 ;AND GET THE SECOND ONE
LD B,00H ;CLEAR B FOR SIGN
CALL CHKSGN ;CHECK SIGN OF 2ND
EX (SP),HL ;GET 1ST IN HL
CALL CHKSGN ;CHECK SIGN OF 1ST
EX DE,HL
EX (SP),HL
EX DE,HL
LD A,D ;DIVIDE BY 0?
OR E
JP Z,AHOW ;SAY "HOW?"
PUSH BC ;ELSE SAVE SIGN
CALL DIVIDE ;USE SUBROUTINE
LD H,B ;RESULT IN HL NOW
LD L,C
POP BC ;GET SIGN BACK
XP35:
POP DE ;AND TEXT POINTER
LD A,H ;HL MUST BE +
OR A
JP M,QHOW ;ELSE IT IS OVERFLOW
LD A,B
OR A
CALL M,CHGSGN ;CHANGE SIGN IF NEEDED
JR XP31 ;LOOK FOR MORE TERMS
EXPR4:
LD HL,TAB4-1 ;FIND FUNCTION IN TAB4
JP EXEC ;AND GO DO IT
XP40:
RST 38H ;NO, NOT A FUNCTION
JR C,XP41 ;NOR A VARIABLE
LD A,(HL) ;VARIABLE
INC HL
LD H,(HL) ;VALUE IN HL
LD L,A
RET
XP41:
CALL TSTNUM ;OR IS IT A NUMBER
LD A,B ;# OF DIGIT
OR A
RET NZ ;OK
PARN:
RST 08H
DB '('
DB XP43-$-1
RST 18H ;"(EXPR)"
RST 08H
DB ')'
DB XP43-$-1
XP42:
RET
XP43:
JP QWHAT ;ELSE SAY: "WHAT?"
RND:
CALL PARN ;*** RND(EXPR) ***
LD A,H ;EXPR MUST BE +
OR A
JP M,QHOW
OR L ;AND NON-ZERO
JP Z,QHOW
PUSH DE ;SAVE BOTH
PUSH HL
LD HL,(RANPNT) ;GET MEMORY AS RANDOM
LD DE,LSTROM ;NUMBER
RST 20H
JR C,RA1 ;WRAP AROUND IF LAST
LD HL,START
RA1:
LD E,(HL)
INC HL
LD D,(HL)
LD (RANPNT),HL
POP HL
EX DE,HL
PUSH BC
CALL DIVIDE ;RND (N)=MOD(M,N)+1
POP BC
POP DE
INC HL
RET
ABS:
CALL PARN ;*** ABS (EXPR) ***
DEC DE
CALL CHKSGN ;CHECK SIGN
INC DE
RET
SIZE:
LD HL,(TXTUNF) ;*** SIZE ***
PUSH DE ;GET THE NUMBER OF FREE
EX DE,HL ;BYTES BETWEEN 'TXTUNF'
LD HL,VARBGN ;AND 'VARBGN'
CALL SUBDE
POP DE
RET
;*************************************************************
;
; *** DIVIDE *** SUBDE *** CHKSGN *** CHGSGN *** & CKHLDE ***
;
; 'DIVIDE' DIVIDES HL BY DE, RESULT IN BC, REMAINDER IN HL
;
; 'SUBDE' SUBSTRACTS DE FROM HL
;
; 'CHKSGN' CHECKS SIGN OF HL. IF +, NO CHANGE. IF -, CHANGE
; SIGN AND FLIP SIGN OF B.
;
; 'CHGSGN' CHECKS SIGN N OF HL AND B UNCONDITIONALLY.
;
; 'CKHLDE' CHECKS SIGN OF HL AND DE. IF DIFFERENT, HL AND DE
; ARE INTERCHANGED. IF SAME SIGN, NOT INTERCHANGED. EITHER
; CASE, HL DE ARE THEN COMPARED TO SET THE FLAGS.
;*************************************************************
DIVIDE:
PUSH HL ;*** DIVIDE ***
LD L,H ;DIVIDE H BY DE
LD H,00H
CALL DV1
LD B,C ;SAVE RESULT IN B
LD A,L ;(REMAINDER+L)/DE
POP HL
LD H,A
DV1:
LD C,0FFH ;RESULT IN C
DV2:
INC C ;DUMB ROUTINE
CALL SUBDE ;DIVIDE BY SUBTRACT
JR NC,DV2 ;AND COUNT
ADD HL,DE
RET
SUBDE:
LD A,L ;*** SUBDE ***
SUB E ;SUBSTRACT DE FROM
LD L,A ;HL
LD A,H
SBC A,D
LD H,A
RET
CHKSGN:
LD A,H ;*** CHKSGN ***
OR A ;CHECK SIGN OF HL
RET P
CHGSGN:
LD A,H ;*** CHGSGN ***
PUSH AF
CPL ;CHANGE SIGN OF HL
LD H,A
LD A,L
CPL
LD L,A
INC HL
POP AF
XOR H
JP P,QHOW
LD A,B ;AND ALSO FLIP B
XOR 80H
LD B,A
RET
CKHLDE:
LD A,H ;SAME SIGN?
XOR D ;YES, COMPARE
JP P,CK1 ;NO, XCHANGE AND COMP
EX DE,HL
CK1:
RST 20H
RET
;*************************************************************
;
; *** SETVAL *** FIN *** ENDCHK *** & ERROR (& FRIENDS) ***
;
; "SETVAL" EXPECTS A VARIABLE, FOLLOWED BY AN EQUAL SIGN AND
; THEN AN EXPR. IT EVALUATES THE EXPR. AND SET THE VARIABLE
; TO THAT VALUE.
;
; "FIN" CHECKS THE END OF A COMMAND. IF IT ENDED WITH ";",
; EXECUTION CONTINUES. IF IT ENDED WITH A CR, IT FINDS THE
; NEXT LINE AND CONTINUE FROM THERE.
;
; "ENDCHK" CHECKS IF A COMMAND IS ENDED WITH CR. THIS IS
; REQUIRED IN CERTAIN COMMANDS. (GOTO, RETURN, AND STOP ETC.)
;
; "ERROR" PRINTS THE STRING POINTED BY DE (AND ENDS WITH CR).
; IT THEN PRINTS THE LINE POINTED BY 'CURRNT' WITH A "?"
; INSERTED AT WHERE THE OLD TEXT POINTER (SHOULD BE ON TOP
; OF THE STACKB) POINTS TO. EXECUTION OF TB IS STOPPED
; AND TBI IS RESTARTED. HOWEVER, IF 'CURRNT' -> ZERO
; (INDICATING A DIRECT COMMAND), THE DIRECT COMMAND IS NOT
; PRINTED. AND IF 'CURRNT' -> NEGATIVE # (INDICATING 'INPUT'
; COMMAND), THE INPUT LINE IS NOT PRINTED AND EXECUTION IS
; NOT TERMINATED BUT CONTINUED AT 'INPERR'.
;
; RELATED TO 'ERROR' ARE THE FOLLOWING:
; 'QWHAT' SAVES TEXT POINTER IN STACKB AND GET MESSAGE "WHAT?"
; 'AWHAT' JUST GET MESSAGE "WHAT?" AND JUMP TO 'ERROR'.
; 'QSORRY' AND 'ASORRY' DO SAME KIND OF THING.
; 'AHOW' AND 'AHOW' IN THE ZERO PAGE SECTION ALSO DO THIS.
;*************************************************************
SETVAL:
RST 38H ;*** SETVAL ***
JP C,QWHAT ;"WHAT?" NO VARIABLE
PUSH HL ;SAVE ADDRESS OF VAR.
RST 08H ;PASS "=" SIGN
DB '='
DB SV1-$-1
RST 18H ;EVALUATE EXPR.
LD B,H ;VALUE IS IN BC NOW
LD C,L
POP HL ;GET ADDRESS
LD (HL),C ;SAVE VALUE
INC HL
LD (HL),B
RET
SV1:
JP QWHAT ;NO "=" SIGN
FIN:
RST 08H ;*** FIN ***
DB 3BH
DB FI1-$-1
POP AF ;";", PURGE RET. ADDR.
JP RUNSML ;CONTINUE SAME LINE
FI1:
RST 08H ;NOT ";", IS IT CR?
DB CR
DB FI2-$-1
POP AF ;YES, PURGE RET. ADDR.
JP RUNNXL ;RUN NEXT LINE
FI2:
RET ;ELSE RETURN TO CALLER
ENDCHK:
RST 28H ;*** ENDCHK ***
CP CR ;END WITH CR?
RET Z ;OK, ELSE SAY: "WHAT?"
QWHAT:
PUSH DE ;*** QWHAT ***
AWHAT:
LD DE,WHAT ;*** AWHAT ***
ERROR_ROUTINE:
SUB A ;*** ERROR ***
CALL PRTSTG ;PRINT 'WHAT?', 'HOW?'
POP DE ;OR 'SORRY'
LD A,(DE) ;SAVE THE CHARACTER
PUSH AF ;AT WHERE OLD DE ->
SUB A ;AND PUT A 0 THERE
LD (DE),A
LD HL,(CURRNT) ;GET CURRENT LINE #
PUSH HL
LD A,(HL) ;CHECK THE VALUE
INC HL
OR (HL)
POP DE
JP Z,RSTART ;IF ZERO, JUST RESTART
LD A,(HL) ;IF NEGATIVE,
OR A
JP M,INPERR ;REDO INPUT
CALL PRTLN ;ELSE PRINT THE LINE
DEC DE ;UPTO WHERE THE 0 IS
POP AF ;RESTORE THE CHARACTER
LD (DE),A
LD A,3FH ;PRINT A "?"
RST 10H
SUB A ;AND THE REST OF THE
CALL PRTSTG ;LINE
JP RSTART ;THEN RESTART
QSORRY:
PUSH DE ;*** QSORRY ***
ASORRY:
LD DE,SORRY ;*** ASORRY ***
JR ERROR_ROUTINE
;*************************************************************
;
; *** GETLN *** FNDLN (& FRIENDS) ***
;
; 'GETLN' READS A INPUT LINE INTO 'BUFFER'. IT FIRST PROMPT
; THE CHARACTER IN A (GIVEN BY THE CALLER), THEN IT FILLS
; THE BUFFER AND ECHOS. IT IGNORES LF'S AND NULLS, BUT STILL
; ECHOS THEM BACK. RUB-OUT IS USED TO CAUSE IT TO DELETE
; THE LAST CHARACTER (IF THERE IS ONE), AND ALT-MOD IS USED TO
; CAUSE IT TO DELETE THE WHOLE LINE AND START IT ALL OVER.
; CR SIGNALS THE END OF A LINE, AND CAUSE 'GETLN' TO RETURN.
;
; 'FNDLN' FINDS A LINE WITH A GIVEN LINE # (IN HL) IN THE
; TEXT SAVE AREA. DE IS USED AS THE TEXT POINTER. IF THE
; LINE IS FOUND, DE WILL POINT TO THE BEGINNING OF THAT LINE
; (I.E., THE LOW BYTE OF THE LINE #), AND FLAGS ARE NC & Z.
; IF THAT LINE IS NOT THERE AND A LINE WITH A HIGHER LINE #
; IS FOUND, DE POINTS TO THERE AND FLAGS ARE NC & NZ. IF
; WE REACHED THE END OF TEXT SAVE AREA AND CANNOT FIND THE
; LINE, FLAGS ARE C & NZ.
; 'FNDLN' WILL INITIALIZE DE TO THE BEGINNING OF THE TEXT SAVE
; AREA TO START THE SEARCH. SOME OTHER ENTRIES OF THIS
; ROUTINE WILL NOT INITIALIZE DE AND DO THE SEARCH.
; 'FNDLNP' WILL START WITH DE AND SEARCH FOR THE LINE #.
; 'FNDNXT' WILL BUMP DE BY 2, FIND A CR AND THEN START SEARCH.
; 'FNDSKP' USE DE TO FIND A CR, AND THEN START SEARCH.
;*************************************************************
GETLN:
RST 10H ;*** GETLN ***
LD DE,BUFFER ;PROMPT AND INIT.
GL1:
CALL CHKIO ;CHECK KEYBOARD
JR Z,GL1 ;NO INPUT, WAIT
CP 7FH ;DELETE LAST CHARACTER?
JR Z,GL3 ;YES
RST 10H ;INPUT, ECHO BACK
CP 0AH ;IGNORE LF
JR Z,GL1
OR A ;IGNORE NULL
JR Z,GL1
CP 7DH ;DELETE THE WHOLE LINE?
JR Z,GL4 ;YES
LD (DE),A ;ELSE SAVE INPUT
INC DE ;AND BUMP POINTER
CP 0DH ;WAS IT CR
RET Z ;YES, END OF LINE
LD A,E ;ELSE MORE FREE ROOM?
CP BUFEND AND 0FFH
JR NZ,GL1 ;YES, GET NEXT INPUT
GL3:
LD A,E ;DELETE LAST CHARACTER
CP BUFFER AND 0FFH ;BUT DO WE HAVE ANY?
JR Z,GL4 ;NO, REDO WHOLE LINE
DEC DE ;YES, BACKUP POINTER
LD A,5CH ;AND ECHO A BACK-SLASH
RST 10H
JR GL1 ;GO GET NEXT INPUT
GL4:
CALL CRLF ;REDO ENTIRE LINE
LD A,05EH ;CR, LF AND UP-ARROW
JR GETLN
FNDLN:
LD A,H ;*** FNDLN ***
OR A ;CHECK SIGN OF HL
JP M,QHOW ;IT CANNOT BE -
LD DE,TXTBGN ;INIT TEXT POINTER
FNDLP: ;*** FDLNP ***
FL1:
PUSH HL ;SAVE LINE #
LD HL,(TXTUNF) ;CHECK IF WE PASSED END
DEC HL
RST 20H
POP HL ;GET LINE # BACK
RET C ;C,NZ PASSED END
LD A,(DE) ;WE DID NOT, GET BYTE 1
SUB L ;IS THIS THE LINE?
LD B,A ;COMPARE LOW ORDER
INC DE
LD A,(DE) ;GET BYTE 2
SBC A,H ;COMPARE HIGH ORDER
JR C,FL2 ;NO, NOT THERE YET
DEC DE ;ELSE WE EITHER FOUND
OR B ;IT, OR IT IS NOT THERE
RET ;NC,Z;FOUND, NC,NZ:NO
FNDNXT: ;*** FNDNXT ***
INC DE ;FIND NEXT LINE
FL2:
INC DE ;JUST PASSED BYTE 1 & 2
FNDSKP:
LD A,(DE) ;*** FNDSKP ***
CP CR ;TRY TO FIND CR
JR NZ,FL2 ;KEEP LOOKING
INC DE ;FOUND CR, SKIP OVER
JR FL1 ;CHECK IF END OF TEXT
;*************************************************************
;
; *** PRTSTG *** QTSTG *** PRTNUM *** & PRTLN ***
;
; 'PRTSTG' PRINTS A STRING POINTED BY DE. IT STOPS PRINTING
; AND RETURNS TO CALLER WHEN EITHER A CR IS PRINTED OR WHEN
; THE NEXT BYTE IS THE SAME AS WHAT WAS IN A (GIVEN BY THE
; CALLER). OLD A IS STORED IN B, OLD B IS LOST.
;
; 'QTSTG' LOOKS FOR A BACK-ARROW, SINGLE QUOTE, OR DOUBLE
; QUOTE. IF NONE OF THESE, RETURN TO CALLER. IF BACK-ARROW,
; OUTPUT A CR WITHOUT A LF. IF SINGLE OR DOUBLE QUOTE, PRINT
; THE STRING IN THE QUOTE AND DEMANDS A MATCHING UNQUOTE.
; AFTER THE PRINTING THE NEXT 3 BYTES OF THE CALLER IS SKIPPED
; OVER (USUALLY A JUMP INSTRUCTION.
;
; 'PRTNUM' PRINTS THE NUMBER IN HL. LEADING BLANKS ARE ADDED
; IF NEEDED TO PAD THE NUMBER OF SPACES TO THE NUMBER IN C.
; HOWEVER, IF THE NUMBER OF DIGITS IS LARGER THAN THE # IN
; C, ALL DIGITS ARE PRINTED ANYWAY. NEGATIVE SIGN IS ALSO
; PRINTED AND COUNTED IN, POSITIVE SIGN IS NOT.
;
; 'PRTLN' PRINTS A SAVED TEXT LINE WITH LINE # AND ALL.
;*************************************************************
PRTSTG:
LD B,A ;*** PRTSTG ***
PS1:
LD A,(DE) ;GET A CHARACTER
INC DE ;BUMP POINTER
CP B ;SAME AS OLD A?
RET Z ;YES, RETURN
RST 10H ;NO, NEXT
CP CR ;WAS IT A CR?
JR NZ,PS1 ;NO, NEXT
RET ;YES, RETURN
QTSTG:
RST 08H ;*** QTSTG ***
DB '"'
DB QT3-$-1
LD A,22H ;IT IS A "
QT1:
CALL PRTSTG ;PRINT UNTIL ANOTHER
CP CR ;WAS LAST ONE A CR?
POP HL ;RETURN ADDRESS
JP Z,RUNNXL ;WAS CR, RUN NEXT LINE
QT2:
INC HL ;SKIP 3 BYTES ON RETURN
INC HL
;INC HL ;skip due to relative jumps
;suggested by Nick Brok: Fixed
JP (HL) ;RETURN
QT3:
RST 08H ;IS IT A '?
DB 27H
DB QT4-$-1
LD A,27H ;YES, DO THE SAME
JR QT1 ;AS IN "
QT4:
RST 08H ;IS IT BACK-ARROW?
DB 5FH
DB QT5-$-1
LD A,8DH ;YES, CR WITHOUT LF
RST 10H ;DO IT TWICE TO GIVE
RST 10H ;TTY ENOUGH TIME
POP HL ;RETURN ADDRESS
JR QT2
QT5:
RET ;NONE OF ABOVE
;
PRTNUM:
LD B,00H ;*** PRTNUM ***
CALL CHKSGN ;CHECK SIGN
JP P,PN1 ;NO SIGN
LD B,'-' ;B=SIGN
DEC C ;'-' TAKES SPACE
PN1:
PUSH DE ;SAVE
LD DE,000AH ;DECIMAL
PUSH DE ;SAVE AS FLAG
DEC C ;C=SPACES
PUSH BC ;SAVE SIGN & SPACE
PN2:
CALL DIVIDE ;DIVIDE HL BY 10
LD A,B ;RESULT 0?
OR C
JR Z,PN3 ;YES, WE GOT ALL
EX (SP),HL ;NO, SAVE REMAINDER
DEC L ;AND COUNT SPACE
PUSH HL ;HL IS OLD BC
LD H,B ;MOVE RESULT TO BC
LD L,C
JR PN2 ;AND DIVIDE BY 10
PN3:
POP BC ;WE GOT ALL DIGITS IN
PN4:
DEC C ;THE STACKB
LD A,C ;LOOK AT SPACE COUNT
OR A
JP M,PN5 ;NO LEADING BLANKS
LD A,20H ;LEADING BLANKS
RST 10H
JR PN4 ;MORE?
PN5:
LD A,B ;PRINT SIGN
OR A
CALL NZ,0010H
LD E,L ;LAST REMAINDER IN E
PN6:
LD A,E ;CHECK DIGIT IN E
CP 0AH ;10 IS FLAG FOR NO MORE
POP DE
RET Z ;IF SO, RETURN
ADD A,30H ;ELSE, CONVERT TO ASCII
RST 10H ;PRINT THE DIGIT
JR PN6 ;GO BACK FOR MORE
PRTLN:
LD A,(DE) ;*** PRTLN ***
LD L,A ;LOW ORDER LINE #
INC DE
LD A,(DE) ;HIGH ORDER
LD H,A
INC DE
LD C,04H ;PRINT 4 DIGIT LINE #
CALL PRTNUM
LD A,20H ;FOLLOWED BY A BLANK
RST 10H
SUB A ;AND THEN THE NEXT
CALL PRTSTG
RET
;*************************************************************
;
; *** MVUP *** MVDOWN *** POPA *** & PUSHA ***
;
; 'MVUP' MOVES A BLOCK UP FROM WHERE DE-> TO WHERE BC-> UNTIL
; DE = HL
;
; 'MVDOWN' MOVES A BLOCK DOWN FROM WHERE DE-> TO WHERE HL->
; UNTIL DE = BC
;
; 'POPA' RESTORES THE 'FOR' LOOP VARIABLE SAVE AREA FROM THE
; STACKB
;
; 'PUSHA' STACKBS THE 'FOR' LOOP VARIABLE SAVE AREA INTO THE
; STACKB
;*************************************************************
MVUP:
RST 20H ;*** MVUP ***
RET Z ;DE = HL, RETURN
LD A,(DE) ;GET ONE BYTE
LD (BC),A ;MOVE IT
INC DE ;INCREASE BOTH POINTERS
INC BC
JR MVUP ;UNTIL DONE
MVDOWN:
LD A,B ;*** MVDOWN ***
SUB D ;TEST IF DE = BC
JP NZ,MD1 ;NO, GO MOVE
LD A,C ;MAYBE, OTHER BYTE?
SUB E
RET Z ;YES, RETURN
MD1:
DEC DE ;ELSE MOVE A BYTE
DEC HL ;BUT FIRST DECREASE
LD A,(DE) ;BOTH POINTERS AND
LD (HL),A ;THEN DO IT
JR MVDOWN ;LOOP BACK
POPA:
POP BC ;BC = RETURN ADDR.
POP HL ;RESTORE LOPVAR, BUT
LD (LOPVAR),HL ;=0 MEANS NO MORE
LD A,H
OR L
JR Z,PP1 ;YEP, GO RETURN
POP HL ;NOP, RESTORE OTHERS
LD (LOPINC),HL
POP HL
LD (LOPLMT),HL
POP HL
LD (LOPLN),HL
POP HL
LD (LOPPT),HL
PP1:
PUSH BC ;BC = RETURN ADDR.
RET
PUSHA:
LD HL,STKLMT ;*** PUSHA ***
CALL CHGSGN
POP BC ;BC=RETURN ADDRESS
ADD HL,SP ;IS STACKB NEAR THE TOP?
JP NC,QSORRY ;YES, SORRY FOR THAT
LD HL,(LOPVAR) ;ELSE SAVE LOOP VAR'S
LD A,H ;BUT IF LOPVAR IS 0
OR L ;THAT WILL BE ALL
JR Z,PU1
LD HL,(LOPPT) ;ELSE, MORE TO SAVE
PUSH HL
LD HL,(LOPLN)
PUSH HL
LD HL,(LOPLMT)
PUSH HL
LD HL,(LOPINC)
PUSH HL
LD HL,(LOPVAR)
PU1:
PUSH HL
PUSH BC ;BC = RETURN ADDR.
RET
;*************************************************************
;
; *** OUTC *** & CHKIO ***
;
; THESE ARE THE ONLY I/O ROUTINES IN TBI.
; 'OUTC' IS CONTROLLED BY A SOFTWARE SWITCH 'OCSW'. IF OCSW=0
; 'OUTC' WILL JUST RETURN TO THE CALLER. IF OCSW IS NOT 0,
; IT WILL OUTPUT THE BYTE IN A. IF THAT IS A CR, A LF IS ALSO
; SEND OUT. ONLY THE FLAGS MAY BE CHANGED AT RETURN. ALL REG.
; ARE RESTORED.
;
; 'CHKIO' CHECKS THE INPUT. IF NO INPUT, IT WILL RETURN TO
; THE CALLER WITH THE Z FLAG SET. IF THERE IS INPUT, Z FLAG
; IS CLEARED AND THE INPUT BYTE IS IN A. HOWEVER, IF THE
; INPUT IS A CONTROL-O, THE 'OCSW' SWITCH IS COMPLIMENTED, AND
; Z FLAG IS RETURNED. IF A CONTROL-C IS READ, 'CHKIO' WILL
; RESTART TBI AND DO NOT RETURN TO THE CALLER.
;*************************************************************
INIT:
CALL SERIAL_INIT ;INITIALIZE THE SERIAL PORT
LD D,03H ;3X LINE FEEDS
PATLOP:
CALL CRLF
DEC D
JR NZ,PATLOP
SUB A
LD DE,MSG1
CALL PRTSTG
LD DE,MSG2
CALL PRTSTG
LD DE,MSG3
CALL PRTSTG
LD HL,START
LD (RANPNT),HL
LD HL,TXTBGN
LD (TXTUNF),HL
JP RSTART
OUTC:
JR NZ,OUTC2 ;IT IS ON
POP AF ;IT IS OFF
RET ;RESTORE AF AND RETURN
OUTC2:
CALL TX_RDY ;SEE IF TRANSMIT IS AVAILABLE
POP AF ;RESTORE THE REGISTER
OUT (SerialPort),A ;SEND THE BYTE
CP CR
RET NZ
LD A,LF
RST 10H
LD A,CR
RET
CHKIO:
CALL RX_RDY ;CHECK IF CHARACTER AVAILABLE
RET Z ;RETURN IF NO CHARACTER AVAILABLE
PUSH BC ;IF IT'S A LF, IGNORE AND RETURN
LD B,A ; AS IF THERE WAS NO CHARACTER.
SUB LF
JR Z,CHKIO2
LD A,B ;OTHERWISE RESTORE 'A' AND 'BC'
POP BC ; AND CONTINUE ON.
CP 0FH ;IS IT CONTROL-0?
JR NZ,CI1 ;NO, MORE CHECKING
LD A,(OCSW) ;CONTROL-0 FLIPS OCSW
CPL ;ON TO OFF, OFF TO ON
LD (OCSW),A
JR CHKIO ;GET ANOTHER INPUT
CHKIO2:
LD A,00H ;CLEAR A
OR A ;ZET THE Z-FLAG
POP BC ;RESTORE THE 'BC' PAIR
RET ;RETURN WITH 'Z' SET.
CI1:
CP 03H ;IS IT CONTROL-C?
RET NZ ;NO, RETURN "NZ"
JP RSTART ;YES, RESTART TBI
;
MSG1:
DB ESC,"[2J",ESC,"[H"
DB 'Z80 TinyBASIC 2.5g Patch 2',CR
MSG2: DB 'Ported by Doug Gabbard, 2017',CR
MSG3:
DB LF,LF,'HELP - New Instructions',LF,LF,CR
;*************************************************************
;
; *** TABLES *** DIRECT *** & EXEC ***
;
; THIS SECTION OF THE CODE TESTS A STRING AGAINST A TABLE.
; WHEN A MATCH IS FOUND, CONTROL IS TRANSFERED TO THE SECTION
; OF CODE ACCORDING TO THE TABLE.
;
; AT 'EXEC', DE SHOULD POINT TO THE STRING AND HL SHOULD POINT
; TO THE TABLE-1. AT 'DIRECT', DE SHOULD POINT TO THE STRING.
; HL WILL BE SET UP TO POINT TO TAB1-1, WHICH IS THE TABLE OF
; ALL DIRECT AND STATEMENT COMMANDS.
;
; A '.' IN THE STRING WILL TERMINATE THE TEST AND THE PARTIAL
; MATCH WILL BE CONSIDERED AS A MATCH. E.G., 'P.', 'PR.',
; 'PRI.', 'PRIN.', OR 'PRINT' WILL ALL MATCH 'PRINT'.
;
; THE TABLE CONSISTS OF ANY NUMBER OF ITEMS. EACH ITEM
; IS A STRING OF CHARACTERS WITH BIT 7 SET TO 0 AND
; A JUMP ADDRESS STORED HI-LOW WITH BIT 7 OF THE HIGH
; BYTE SET TO 1.
;
; END OF TABLE IS AN ITEM WITH A JUMP ADDRESS ONLY. IF THE
; STRING DOES NOT MATCH ANY OF THE OTHER ITEMS, IT WILL
; MATCH THIS NULL ITEM AS DEFAULT.
;*************************************************************
TAB1: ;DIRECT COMMANDS
DB 'HELP' ;ADDED HELP MENU
DWA HELP_CMDS
DB 'LIST'
DWA LIST
DB 'NEW'
DWA NEW
DB 'RUN'
DWA RUN
TAB2: ;DIRECT/STATEMENT
DB 'CALL'
DWA CALL_MCODE
DB 'CLS' ;ADDED CLS CMD
DWA CLSB
DB 'DELAY' ;ADDED DELAY CMD
DWA DELAYB
DB 'FOR'
DWA FOR
DB 'GOSUB'
DWA GOSUB
DB 'GOTO'
DWA GOTO
DB 'IF'
DWA IFF
DB 'INPUT'
DWA INPUT
DB 'IN' ;ADDED IN CMD
DWA INB
DB 'LET'
DWA LET
DB 'NEXT'
DWA NEXT
DB 'OUT' ;ADDED OUT CMD
DWA OUTB
DB 'PEEK' ;ADDED PEEK
DWA PEEK
DB 'POKE' ;ADDED POKE
DWA POKE
DB 'PRINT'
DWA PRINT
DB 'REM'
DWA REM
DB 'RETURN'
DWA RETURN
DB 'STOP'
DWA STOP
DWA DEFLT
TAB4: ;FUNCTIONS
DB 'ABS'
DWA ABS
DB 'RND'
DWA RND
DB 'SIZE'
DWA SIZE
DWA XP40
TAB5: ;"TO" IN "FOR"
DB 'TO'
DWA FR1
DWA QWHAT
TAB6: ;"STEP" IN "FOR"
DB 'STEP'
DWA FR2
DWA FR3
TAB8: ;RELATION OPERATORS
DB '>='
DWA XP11
DB '#'
DWA XP12
DB '>'
DWA XP13
DB '='
DWA XP15
DB '<='
DWA XP14
DB '<'
DWA XP16
DWA XP17
DIRECT: LD HL,TAB1-1 ;*** DIRECT ***
EXEC: ;*** EXEC ***
EX0: RST 28H ;IGNORE LEADING BLANKS
PUSH DE ;SAVE POINTER
EX1:
LD A,(DE) ;IF FOUND '.' IN STRING
INC DE ;BEFORE ANY MISMATCH
CP 23H ;WE DECLARE A MATCH
JR Z,EX3
INC HL ;HL->TABLE
CP (HL) ;IF MATCH, TEST NEXT
JR Z,EX1
LD A,7FH ;ELSE SEE IF BIT 7
DEC DE ;OF TABLE IS SET, WHICH
CP (HL) ;IS THE JUMP ADDR. (HI)
JR C,EX5 ;C:YES, MATCHED
EX2:
INC HL ;NC:NO, FIND JUMP ADDR.
CP (HL)
JR NC,EX2
INC HL ;BUMP TO NEXT TAB. ITEM
POP DE ;RESTORE STRING POINTER
JR EX0 ;TEST AGAINST NEXT ITEM
EX3:
LD A,7FH ;PARTIAL MATCH, FIND
EX4:
INC HL ;JUMP ADDR., WHICH IS
CP (HL) ;FLAGGED BY BIT 7
JR NC,EX4
EX5:
LD A,(HL) ;LOAD HL WITH THE JUMP
INC HL ;ADDRESS FROM THE TABLE
LD L,(HL)
AND 7FH ;MASK OFF BIT 7
LD H,A
POP AF ;CLEAN UP THE GABAGE
JP (HL) ;AND WE GO DO IT
;*************************************************************
; *** TinyBASIC Expansion ***
;
; *** QUIT *** INB *** OUTB *** CLSB ***
; *** DELAYB *** PEEK *** POKE ***
;
; INB IS THE ROUTINE FOR READING THE VALUE OF A PORT AND
; ASSIGNING IT TO A VARIABLE.
;
; OUTB IS THE ROUTINE FOR READIGN THE VALUE OF A VARIABLE AND
; WRITING IT TO A HARDWARE PORT.
;
; CLSB IS A ROUTINE TO CLEAR THE SCREEN.
;
; DELAYB IS A ROUTINE DESIGNED TO GIVE APPROXIMATELY 2ms DELAY
; AT 6MHZ.
;
; PEEK IS A ROUTINE TO READ THE VALUE OF A MEMORY LOCATION
; AND STORE THAT VALUE IN A VARIABLE.
;
; POKE IS A ROUTINE USED TO READ A VARIABLE, AND WRITE THE
; INFORMATION INTO A MEMORY LOCATION.
;
; CALL_MCODE IS A ROUTINE TO EXECUTE MACHINE CODE, AND CAN
; RETURN A TWO BYTE VARIABLE BACK TO 'HL'.
;*************************************************************
INB: ;'IN' ROUTINE
PUSH AF ;SAVE THE REGISTERS
PUSH BC
INB2:
INC DE
LD A,(DE)
LD B,SPACE
CP B
JR Z,INB2 ;IF IT'S NOT A SPACE GET THE LOCATION
INB3:
CALL GET_HEX
LD C,A ;PORT IS NOW IN 'C'.
INB4:
INC DE
LD A,(DE)
LD B,',' ; COMPARE COMA
CP B
JR Z,INB4
LD B,' ' ; COMPARE SPACE
CP B
JR Z,INB4
LD B,'='
CP B
JR Z,INB4
LD B,40H ;IF NOT IT IS VARIABLE
SUB B ;ADJUST FOR MEMORY LOCATION
LD HL,VARBGN ;COMPUTE ADDRESS OF
RLCA ;THAT VARIABLE
ADD A,L ;AND RETURN IT IN HL
LD L,A ;WITH C FLAG CLEARED
LD A,00H
ADC A,H
LD H,A
IN A,(C) ;GET BYTE
LD (HL),A ;STORE IT IN THE VARIALBLE LOCATION
INC HL ;PAD THE EXTRA MEMORY LOCATION
LD (HL),00H
INC DE
POP BC ;RESTORE THE REGISTERS
POP AF
JP RUNSML ;NEXT LINE
;-------------------------------------------------------------------------------
OUTB: ;'OUT' ROUTINE
PUSH AF
PUSH BC
OUTB2:
INC DE
LD A,(DE)
LD B,SPACE
CP B
JR Z,OUTB2
OUTB3:
CALL GET_HEX
PUSH AF ;PORT IS IN THE STACK
OUTB4:
INC DE
LD A,(DE)
LD B,',' ; COMPARE COMA
CP B
JR Z,OUTB4
LD B,' ' ; COMPARE SPACE
CP B
JR Z,OUTB4
LD B,'='
CP B
JR Z,OUTB4
LD B,40H ;IF NOT IT IS VARIABLE
SUB B ;ADJUST FOR MEMORY LOCATION
LD HL,VARBGN ;COMPUTE ADDRESS OF
RLCA ;THAT VARIABLE
ADD A,L ;AND RETURN IT IN HL
LD L,A ;WITH C FLAG CLEARED
LD A,00H
ADC A,H
LD H,A ;VARIABLE LOCATION IN HL
POP AF ;PORT BACK IN 'A'
LD C,A ;PORT IS NOW IN C
LD A,(HL) ;Load the value from memory into 'A'
OUT (C),A ;WRITE THE BYTE TO THE PORT
POP BC ;RESTORE REGISTERS
POP AF
INC DE
JP RUNSML
;-------------------------------------------------------------------------------
CLSB: ;CLS ROUTINE FOR BASIC
PUSH AF
PUSH BC
PUSH DE
LD DE,CLSB_MSG
CALL PRTSTG
POP DE
POP BC
POP AF
INC DE
JP RUNNXL
CLSB_MSG:
DB ESC,"[2J",ESC,"[H",CR
;-------------------------------------------------------------------------------
DELAYB:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
CALL MILLI_DLY
POP HL
POP DE
POP BC
POP AF
INC DE
JP RUNNXL
;-------------------------------------------------------------------------------
PEEK:
PUSH AF ;SAVE THE REGISTERS
PUSH BC
PEEK2:
INC DE
LD A,(DE)
LD B,SPACE
CP B
JR Z,PEEK2 ;IF IT'S NOT A SPACE GET THE LOCATION
PEEK3:
CALL GET_HEX
LD H,A
INC DE
CALL GET_HEX
LD L,A ;MEMORY LOCATION IN 'HL' NOW.
LD A,(HL) ;GET THE BYTE FROM MEMORY.
PUSH AF ;NOW STORE THE BYTE ON THE STACK.
PEEK4:
INC DE
LD A,(DE)
LD B,',' ; COMPARE COMA
CP B
JR Z,PEEK4
LD B,' ' ; COMPARE SPACE
CP B
JR Z,PEEK4
LD B,'='
CP B
JR Z,PEEK4
LD B,40H ;IF NOT IT IS VARIABLE
SUB B ;ADJUST FOR MEMORY LOCATION
LD HL,VARBGN ;COMPUTE ADDRESS OF
RLCA ;THAT VARIABLE
ADD A,L ;AND RETURN IT IN HL
LD L,A ;WITH C FLAG CLEARED
LD A,00H
ADC A,H
LD H,A
POP AF ;RESTORE THE BYTE FROM THE STACK
LD (HL),A ;STORE IT IN THE VARIALBLE LOCATION
INC HL ;PAD THE EXTRA MEMORY LOCATION
LD (HL),00H
INC DE
POP BC ;RESTORE THE REGISTERS
POP AF
JP RUNSML ;NEXT LINE
;-------------------------------------------------------------------------------
POKE: ;POKE ROUTINE
PUSH AF
PUSH BC
POKE2:
INC DE
LD A,(DE)
LD B,SPACE
CP B
JR Z,POKE2
POKE3:
CALL GET_HEX
LD H,A
INC DE
CALL GET_HEX
LD L,A ;LOCATION NOW 'HL'
PUSH HL ;STORE LOCATION IN STACK.
POKE4:
INC DE
LD A,(DE)
LD B,',' ; COMPARE COMA
CP B
JR Z,POKE4
LD B,' ' ; COMPARE SPACE
CP B
JR Z,POKE4
LD B,'='
CP B
JR Z,POKE4
LD B,'(' ;IS IT HEX?
CP B
JR Z,POKE5
LD B,40H ;IF NOT IT IS VARIABLE
SUB B ;ADJUST FOR MEMORY LOCATION
LD HL,VARBGN ;COMPUTE ADDRESS OF
RLCA ;THAT VARIABLE
ADD A,L ;AND RETURN IT IN HL
LD L,A ;WITH C FLAG CLEARED
LD A,00H
ADC A,H
LD H,A ;VARIABLE LOCATION IN HL
;POP AF ;PORT BACK IN 'A'
;LD C,A ;PORT IS NOW IN C
LD A,(HL) ;Load the value from memory into 'A'
POP HL ;GET THE MEMORY LOCATION BACK
LD (HL),A
;OUT (C),A ;WRITE THE BYTE TO THE PORT
POP BC ;RESTORE REGISTERS
POP AF
INC DE
JP RUNSML
POKE5:
INC DE ;NEXT CHARACTER
LD A,(DE)
LD B,')' ;IS IT THE END OF HEX?
CP B
JR Z,POKE6 ;IF SO, GO TO END
CALL GET_HEX ;IF NOT, GET THE VALUE AND WRITE
POP HL
LD (HL),A
INC HL ;NEXT LOCATION TO WRITE
PUSH HL ;STORE THE LOCATION
JR POKE5 ;NEXT BYTE.
POKE6:
POP BC
POP AF
INC DE
JP RUNSML
;-------------------------------------------------------------------------------
CALL_MCODE:
PUSH AF
PUSH BC
PUSH HL
CALL2:
INC DE
LD A,(DE)
LD B,SPACE
CP B
JR Z,CALL2
CALL3:
LD HL,CALL5 ;SET RETURN VECTOR - I THINK...
PUSH HL ;PLACE IT ON THE STACK FOR RETURN...
CALL GET_HEX
LD H,A
INC DE
CALL GET_HEX
LD L,A ;LOCATION NOW 'HL'
CALL4:
PUSH DE ;SAVE CURRENT DE LOCATION.
JP (HL)
CALL5:
POP HL
POP DE ;KEEPS RETURNING 'WHAT?' ERROR....
POP BC
POP AF
INC DE
JP RUNSML
;-------------------------------------------------------------------------------
GET_HEX:
LD A,(DE)
LD B,A
INC DE
LD A,(DE)
LD C,A
PUSH DE ;SAVE DE LOCATION
LD D,B ;SEND THE ASCII TO CONVERT
LD E,C
CALL ASCIIHEX_TO_BYTE ;BYTE IS RETURNED IN 'A'
POP DE
RET
ASCIIHEX_TO_BYTE:
PUSH BC ;SAVE REGISTERS
LD A,D ;LOAD UPPER CHARACTER
CALL CONVERT_HEX_VAL ;CONVERT THE CHARACTER
RLA
RLA
RLA
RLA
LD B,A ;STORE THE FIRST NIBBLE
LD A,E ;GET SECOND CHARACTER
CALL CONVERT_HEX_VAL ;CONVERT THE CHARACTER
ADD A,B ;ADD THE TWO NIBBLES
POP BC
RET
; CONVERTS THE ASCII CHARACTER IN A TO IT'S HEX VALUE IN A, ERROR RETURNS 0FFH
CONVERT_HEX_VAL:
CP 'G' ;GREATER THAN "F"
JP P,CONVERT_HEX_ERROR ;IF SO, ERROR.
CP '0' ;LESS THAN "ZERO"
JP M,CONVERT_HEX_ERROR ;IF SO, ERROR.
CP 03AH ;LESS THAN OR EQUAL TO "9"
JP M,CONVERT_MASK ;IF SO, CONVERT AND RETURN.
CP 'A' ;LESS THAN "A"
JP M,CONVERT_HEX_ERROR ;IF SO, ERROR.
SUB 037H ;MUST BE "A" TO "F", CONVERT.
RET
CONVERT_MASK:
AND 0FH
RET
CONVERT_HEX_ERROR:
LD A,0FFH ;IF ERROR, RETURN 0FFH
RET
;-------------------------------------------------------------------------------
MILLI_DLY: ;DELAY 1 MILLISECOND @ 6MHZ (ESTIMATED)
PUSH AF ; THERE IS NO WAY TO REALLY CALCULATE
PUSH BC ; THIS, AS THE INTERPRETER TAKES TIME.
LD BC,0073H ; 6006 INSTRUCTIONS
MILLI_DLYL:
DEC BC
LD A,C
OR B
JR NZ,MILLI_DLYL
POP BC
POP AF
RET
;-------------------------------------------------------------------------------
HELP_CMDS:
PUSH AF
PUSH BC
PUSH DE
LD DE,HELP_CMD_MSG1
CALL PRTSTG
LD DE,HELP_CMD_MSG2
CALL PRTSTG
LD DE,HELP_CMD_MSG3
CALL PRTSTG
LD DE,HELP_CMD_MSG4
CALL PRTSTG
LD DE,HELP_CMD_MSG5
CALL PRTSTG
LD DE,HELP_CMD_MSG6
CALL PRTSTG
LD DE,HELP_CMD_MSG7
CALL PRTSTG
LD DE,HELP_CMD_MSG8
CALL PRTSTG
POP DE
POP BC
POP AF
INC DE
;JP RUNSML
JP RUNNXL
HELP_CMD_MSG1:
DB LF,LF,TAB,'TinyBASIC 2.5g Expanded Instructions',LF,LF,CR
HELP_CMD_MSG2:
DB TAB,'OUT PP,V',LF,CR
HELP_CMD_MSG3:
DB TAB,'IN PP,V',LF,CR
HELP_CMD_MSG4:
DB TAB,'POKE AAAA,V',LF,CR
HELP_CMD_MSG5:
DB TAB,'PEEK AAAA,V',LF,CR
HELP_CMD_MSG6:
DB TAB,'DELAY',LF,CR
HELP_CMD_MSG7:
DB TAB,'CLS',LF,LF,LF,CR
HELP_CMD_MSG8:
DB TAB,'PP=HEX PORT AAAA=HEX ADDR V=VARIABLE',LF,LF,CR
;-------------------------------------------------------------------------------
;///////////////////////////////////////////////////////////////////////////////
;-------------------------------------------------------------------------------
;COMPUTER SPECIFIC ROUTINES.
UART_DHR EQU 0x10 ;UART Data R/W register
UART_IER EQU 0x11 ;Interrupt Enable Register
UART_IFR EQU 0x12 ;Interrupt ID Reg (READ), FIFO Control Reg (WRITE)
UART_LCR EQU 0x13 ;Line Control Register
UART_MCR EQU 0x14 ;Modem Control
UART_LSR EQU 0x15 ;Line Status Register
UART_MSR EQU 0x16 ;Modem Status (Unused)
UART_SCR EQU 0x17 ;Arbitrary data can be stored here
;Baud Rate Divisor (115200)
BAUD_DIV_HIGH equ 0
BAUD_DIV_LOW equ 8
;-------------------------------------------------------------------------------
SERIAL_INIT:
PUSH AF
CALL UART_CLEAR_DLAB
CALL UART_DISABLE_FIFO
CALL UART_SET_LINE_CONTROL
CALL UART_TOGGLE_OUT1
CALL UART_TOGGLE_OUT2
CALL UART_CLEAR_LSR
CALL UART_SET_DLAB
CALL UART_SET_BAUD
CALL UART_CLEAR_DLAB
POP AF
RET
UART_CLEAR_DLAB:
PUSH AF
IN A, (UART_LCR)
AND 7Fh
OUT (UART_LCR), A
POP AF
RET
UART_SET_DLAB:
PUSH AF
IN A, (UART_LCR)
OR 80h
OUT (UART_LCR), A
POP AF
RET
UART_SET_LINE_CONTROL:
PUSH AF
LD A, 3h ;8 Bit word, 1 stop, no parity
OUT (UART_LCR), A
POP AF
RET
UART_DISABLE_FIFO:
PUSH AF
LD A, 6h
OUT (UART_IFR), A
POP AF
RET
UART_SET_BAUD:
PUSH AF
;115200
LD A, BAUD_DIV_LOW
OUT (UART_DHR), A
LD A, BAUD_DIV_HIGH
OUT (UART_IER), A
POP AF
RET
UART_CLEAR_LSR:
PUSH AF
;Clear Line Status Reg Errors (Page 21)
IN A, (UART_LSR)
POP AF
RET
UART_TOGGLE_OUT1:
PUSH AF
IN A, (UART_MCR)
XOR 4h
OUT (UART_MCR), A
POP AF
RET
UART_TOGGLE_OUT2:
PUSH AF
IN A, (UART_MCR)
XOR 8h
OUT (UART_MCR), A
POP AF
RET
;-------------------------------------------------------------------------------
TX_RDY:
; This routine is checking if the Serial Port is ready to send
; a character.
PUSH AF
CALL UART_TOGGLE_OUT1
CALL UART_CLEAR_DLAB
PRINTCH_LOOP:
;Read transmit register status in line status register (LSR) See page 22
;Wait if not empty
IN A, (UART_LSR)
AND 60H
CP 60H
JP NZ, PRINTCH_LOOP
POP AF
RET
;-------------------------------------------------------------------------------
RX_RDY:
; This routine is for checkif if a character is available over
; serial. If a character is available, it returns to the calling
; function with the character in 'A' and the Z-flag reset.
; However, if a character is not available, it returns with the
; Z-flag set.
CALL UART_CLEAR_DLAB
;Read Line Status Reg
IN A, (UART_LSR)
;If only bit 1 is set then FIFO has new data
AND 1
CP 0
JP Z, RX_RDY_END
CALL UART_TOGGLE_OUT2
XOR A
CP 1
;Get next char from data holding register
IN A, (UART_DHR)
RX_RDY_END:
RET
;-------------------------------------------------------------------------------
;///////////////////////////////////////////////////////////////////////////////
;-------------------------------------------------------------------------------
;
LSTROM: ;ALL ABOVE CAN BE ROM
; ORG 08000H
; ORG 0FF00H
;VARBGN: DS 55 ;VARIABLE @(0)
;BUFFER: DS 64 ;INPUT BUFFER
;BUFEND: DS 1 ;BUFFER ENDS
;STKLMT: DS 1 ;TOP LIMIT FOR STACKB
VARBGN EQU 0xFF00
BUFFER EQU VARBGN+55
BUFEND EQU BUFFER+64
STKLMT EQU BUFEND+1
ORG 02000H
| 35.925973
| 88
| 0.407517
|
8982e5d1e1e565da3581d3f896fdbba885f6327a
| 433
|
asm
|
Assembly
|
oeis/089/A089154.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/089/A089154.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/089/A089154.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A089154: A palindromic matrix version of the alternating matrix sequence at the X^3 level 3 X 3: BAAB.
; Submitted by Jamie Morken(s4)
; 4,30,190,1176,7252,44694,275422,1697232,10458820,64450158,397159774,2447408808,15081612628,92937084582,572704120126,3529161805344,21747674952196,134015211518526,825838944063358,5089048875898680
mov $3,4
lpb $0
sub $0,1
mov $2,$3
mul $3,6
add $3,$1
mov $1,$2
add $3,6
lpe
mov $0,$3
| 28.866667
| 195
| 0.752887
|
0505621db83daf0499b3cbfc09ae56013267f14f
| 4,603
|
asm
|
Assembly
|
docs/www.playvectrex.com/designit/chrissalo/joystick1.asm
|
mikepea/vectrex-playground
|
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
|
[
"0BSD"
] | 5
|
2018-01-14T10:03:50.000Z
|
2020-01-17T13:53:49.000Z
|
docs/www.playvectrex.com/designit/chrissalo/joystick1.asm
|
mikepea/vectrex-playground
|
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
|
[
"0BSD"
] | null | null | null |
docs/www.playvectrex.com/designit/chrissalo/joystick1.asm
|
mikepea/vectrex-playground
|
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
|
[
"0BSD"
] | null | null | null |
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
INCLUDE "VECTREX.I"
; start of vectrex memory with cartridge name...
ORG 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
DB "g GCE 1998", $80 ; 'g' is copyright sign
DW music1 ; music from the rom
DB $F8, $50, $20, -$55 ; height, width, rel y, rel x
; (from 0,0)
DB "JOYSTICK 1 TEST",$80 ; some game information,
; ending with $80
DB 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
LDD #$FC20 ; HEIGTH, WIDTH (-4, 32)
STD Vec_Text_HW ; store to BIOS RAM location
LDA #1 ; these set up the joystick
STA Vec_Joy_Mux_1_X ; enquiries
LDA #3 ; allowing only all directions
STA Vec_Joy_Mux_1_Y ; for joystick one
LDA #0 ; this setting up saves a few
STA Vec_Joy_Mux_2_X ; hundred cycles
STA Vec_Joy_Mux_2_Y ; don't miss it, if you don't
; need the second joystick!
main:
main_loop:
JSR Wait_Recal ; Vectrex BIOS recalibration
JSR Intensity_5F ; Sets the intensity of the
; vector beam to $5f
JSR Joy_Digital ; read joystick positions
LDA Vec_Joy_1_X ; load joystick 1 position
; X to A
BEQ no_x_movement ; if zero, than no x position
BMI left_move ; if negative, than left
; otherwise right
right_move:
LDU #joypad_right_string ; display right string
BRA x_done ; goto x done
left_move:
LDU #joypad_left_string ; display left string
BRA x_done ; goto x done
no_x_movement:
LDU #no_joypad_x_string ; display no x string
x_done:
JSR Print_Str_yx ; using string function
LDA Vec_Joy_1_Y ; load joystick 1 position
; Y to A
BEQ no_y_movement ; if zero, than no y position
BMI down_move ; if negative, than down
; otherwise up
up_move:
LDU #joypad_up_string ; display up string
BRA y_done ; goto y done
down_move:
LDU #joypad_down_string ; display down string
BRA y_done ; goto y done
no_y_movement:
LDU #no_joypad_y_string ; display no y string
y_done:
JSR Print_Str_yx ; using string function
BRA main_loop ; and repeat forever
;***************************************************************************
no_joypad_x_string:
DB 40,-50,"NO JOYPAD X INPUT", $80
joypad_right_string:
DB 40,-50,"JOYPAD 1 RIGHT", $80
joypad_left_string:
DB 40,-50,"JOYPAD 1 LEFT", $80
no_joypad_y_string:
DB 20,-50,"NO JOYPAD Y INPUT", $80
joypad_up_string:
DB 20,-50,"JOYPAD 1 UP", $80
joypad_down_string:
DB 20,-50,"JOYPAD 1 DOWN", $80
;***************************************************************************
END main
;***************************************************************************
| 54.797619
| 79
| 0.354551
|
d031a0aebd95477dd20cd2d1276ef183c796a784
| 1,504
|
asm
|
Assembly
|
programs/oeis/193/A193433.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/193/A193433.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/193/A193433.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A193433: Sum of the divisors of n^2+1.
; 1,3,6,18,18,42,38,93,84,126,102,186,180,324,198,342,258,540,434,546,402,756,588,972,578,942,678,1332,948,1266,972,1596,1302,1980,1260,1842,1298,2484,1842,2286,1602,2613,2124,3534,2100,3042,2220,4536,2772,3606,2604,3906,3252,5076,2918,4860,3138,6552,4044,5226,3892,5586,4620,7164,4356,6342,4358,8100,5928,7146,5490,7566,6696,10584,5478,8820,5940,10692,7308,9366,6612,10476,8370,13608,7058,10842,7980,13644,9300,12636,8102,12852,10164,16182,8838,13542,9940,16956,12312,16470,10212,15306,12492,19116,11220,17100,11916,21390,14004,19236,12102,18972,16296,23004,13356,21060,13458,25326,17298,21756,14402,21966,19320,29160,15378,25284,15878,29052,20520,25596,16902,25746,23436,33480,17958,29484,18900,33804,24696,28986,20772,29826,25080,38130,21060,31542,21318,38916,28392,35316,22502,36876,27732,42156,24396,37044,24338,50220,29964,37926,25602,41916,32760,47844,28980,40842,29196,50220,35030,42846,28902,43866,36456,55944,34776,45942,30978,60984,38028,49476,32402,49146,42174,64152,33858,52140,35820,68040,42420,54756,38892,61560,45288,70200,38316,57042,39396,69876,47052,59406,45864,60606,48972,80136,41618,63042,42438,79794,55080,65526,44102,67716,55080,88200,46956,71820,52136,90072,58962,71946,50100,73266,59148,89532,50178,80460,55020,92772,64296,84756,52902,80046,66774,100440,57996,84564,55698,104328,67980,92823,57602,88236,81648,109926,61620,90042,61420,109836,73812,96300
pow $0,2
cal $0,325299 ; a(n) = 9 * sigma(n).
mov $1,$0
sub $1,9
div $1,9
add $1,1
| 150.4
| 1,378
| 0.797207
|
d76cf0eab5ecce6ac483187ceb2e3892a8385984
| 1,024
|
asm
|
Assembly
|
pwnlib/shellcraft/templates/amd64/pushstr_array.asm
|
DrKeineLust/pwntools
|
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
|
[
"MIT"
] | 7
|
2017-07-11T01:12:02.000Z
|
2017-09-21T23:39:54.000Z
|
pwnlib/shellcraft/templates/amd64/pushstr_array.asm
|
DrKeineLust/pwntools
|
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
|
[
"MIT"
] | null | null | null |
pwnlib/shellcraft/templates/amd64/pushstr_array.asm
|
DrKeineLust/pwntools
|
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
|
[
"MIT"
] | 6
|
2017-09-07T02:31:11.000Z
|
2021-07-05T16:59:18.000Z
|
<% from pwnlib.shellcraft import amd64 %>
<%docstring>
Pushes an array/envp-style array of pointers onto the stack.
Arguments:
reg(str):
Destination register to hold the pointer.
array(str,list):
Single argument or list of arguments to push.
NULL termination is normalized so that each argument
ends with exactly one NULL byte.
</%docstring>
<%page args="reg, array"/>
<%
if isinstance(array, (str)):
array = [array]
array_str = ''
# Normalize all of the arguments' endings
array = [arg.rstrip('\x00') + '\x00' for arg in array]
array_str = ''.join(array)
word_size = 8
offset = len(array_str) + word_size
%>\
/* push argument array ${repr(array)} */
${amd64.pushstr(array_str)}
${amd64.mov(reg, 0)}
push ${reg} /* null terminate */
% for i,arg in enumerate(reversed(array)):
${amd64.mov(reg, offset + word_size*i - len(arg))}
add ${reg}, rsp
push ${reg} /* ${repr(arg)} */
<% offset -= len(arg) %>\
% endfor
${amd64.mov(reg,'rsp')}
| 26.25641
| 60
| 0.626953
|
286caef46d672610458af55d1c76e9744d338767
| 595
|
asm
|
Assembly
|
programs/oeis/138/A138190.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/138/A138190.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/138/A138190.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A138190: Numerator of (n-1)*n*(n+1)/12.
; 0,1,2,5,10,35,28,42,60,165,110,143,182,455,280,340,408,969,570,665,770,1771,1012,1150,1300,2925,1638,1827,2030,4495,2480,2728,2992,6545,3570,3885,4218,9139,4940,5330,5740,12341,6622,7095,7590,16215,8648,9212,9800,20825,11050,11713,12402,26235,13860,14630,15428,32509,17110,17995,18910,39711,20832,21840,22880,47905,25058,26197,27370,57155,29820,31098,32412,67525,35150,36575,38038,79079,41080,42660,44280,91881,47642,49385,51170,105995,54868,56782,58740,121485,62790,64883,67022,138415,71440,73720,76048,156849,80850,83325
add $0,2
bin $0,3
dif $0,2
| 85
| 524
| 0.778151
|
4bfc69ce10e9cf3760ca8dd4d0879bfdf442b6f0
| 699
|
asm
|
Assembly
|
Overflows/testS/shelltest/helloworld.asm
|
ryanlockman333/UCDenver_School_Projects
|
ea69b8ffb8056aef6ecc017db86191a4edfcddd0
|
[
"FSFAP"
] | null | null | null |
Overflows/testS/shelltest/helloworld.asm
|
ryanlockman333/UCDenver_School_Projects
|
ea69b8ffb8056aef6ecc017db86191a4edfcddd0
|
[
"FSFAP"
] | null | null | null |
Overflows/testS/shelltest/helloworld.asm
|
ryanlockman333/UCDenver_School_Projects
|
ea69b8ffb8056aef6ecc017db86191a4edfcddd0
|
[
"FSFAP"
] | null | null | null |
section .data ; section declaration
msg db "Hello, world!" ; the string
section .text ; section declaration
global _start ; Default entry point for ELF linking
_start:
; write() call
mov eax, 4 ; put 4 into eax, since write is syscall #4
mov ebx, 1 ; put stdout into ebx, since the proper fd is 1
mov ecx, msg ; put the address of the string into ecx
mov edx, 13 ; put 13 into edx, since our string is 13 bytes
int 0x80 ; Call the kernel to make the system call happen
; exit() call
mov eax,1 ; put 1 into eax, since exit is syscall #1
mov ebx,0 ; put 0 into ebx
int 0x80 ; Call the kernel to make the system call happen
| 29.125
| 66
| 0.65093
|
2094bc4188d48366ced5d73e88130abec444f596
| 2,852
|
asm
|
Assembly
|
demos/i2c_test.asm
|
42Bastian/new_bll
|
3ed703f9357aa16f4ff14372ac7856fa32a179d2
|
[
"Apache-2.0"
] | 4
|
2019-10-21T20:56:30.000Z
|
2021-11-25T12:54:24.000Z
|
demos/i2c_test.asm
|
42Bastian/new_bll
|
3ed703f9357aa16f4ff14372ac7856fa32a179d2
|
[
"Apache-2.0"
] | null | null | null |
demos/i2c_test.asm
|
42Bastian/new_bll
|
3ed703f9357aa16f4ff14372ac7856fa32a179d2
|
[
"Apache-2.0"
] | 1
|
2021-01-18T06:47:20.000Z
|
2021-01-18T06:47:20.000Z
|
Baudrate equ 62500
DEBUG set 1
_1000HZ_TIMER set 7
* Macros
include <includes/hardware.inc>
include <macros/help.mac>
include <macros/if_while.mac>
include <macros/font.mac>
include <macros/window.mac>
include <macros/mikey.mac>
include <macros/suzy.mac>
include <macros/irq.mac>
include <macros/key.mac>
include <macros/debug.mac>
include <macros/file.mac>
* Variablen
include <vardefs/debug.var>
include <vardefs/help.var>
include <vardefs/font.var>
include <vardefs/window.var>
include <vardefs/mikey.var>
include <vardefs/suzy.var>
include <vardefs/irq.var>
include <vardefs/key.var>
include <vardefs/file.var>
include <vardefs/serial.var>
include <vardefs/1000Hz.var>
include <vardefs/eeprom.var>
BEGIN_ZP
counter ds 1
address ds 1
END_ZP
BEGIN_MEM
screen0 ds SCREEN.LEN
irq_vektoren ds 16
eeprom ds 128
DefaultSaveGame ds 128
END_MEM
run LOMEM
Start::
sei
CLEAR_MEM
CLEAR_ZP
INITMIKEY
INITSUZY
SETRGB pal
INITIRQ irq_vektoren
INITKEY
INITFONT LITTLEFNT,ROT,WEISS
jsr Init1000Hz
jsr InitComLynx
cli
SCRBASE screen0
CLS #0
SET_MINMAX 0,0,160,102
LDAY hallo
jsr print
.loop00
jsr ReadKey
beq .cont0
lda Button
cmp #_FIREA
bne .cont
ldx #127
.1
stz eeprom,x
dex
bpl .1
LDAY eeprom
jsr WriteSaveGame
bra .cont0
.cont
cmp #_FIREB
bne .cont0
jsr FillEEPROM
.cont0
stz CurrX
lda #6
sta CurrY
lda counter
inc counter
jsr PrintHex
stz CurrX
lda #12
sta CurrY
stz address
stz temp
stz temp+1
ldx #8
.loop01
phx
ldx #8
.loop02
phx
lda address
jsr EE_Read
lda I2Cword
jsr PrintHex
lda I2Cword+1
jsr PrintHex
inc address
lda address
cmp #$40
beq .cont1
clc
lda temp
adc I2Cword
sta temp
lda temp+1
adc I2Cword+1
sta temp+1
.cont1
inc CurrX
inc CurrX
plx
dex
bne .loop02
stz CurrX
clc
lda CurrY
adc #6
sta CurrY
plx
dex
bne .loop01
LDAY checktxt
jsr print
lda temp
jsr PrintHex
lda temp+1
jsr PrintHex
jmp .loop00
hallo
dc.b "TEST-EERPOM : A - clear / B - fill",0
checktxt
dc.b "Checksum:",0
FillEEPROM::
ldx #125
.loop
txa
lsr
;--> lda #$ff
sta eeprom,x
lda counter
dex
;--> lda #$ff
sta eeprom,x
dex
bpl .loop
LDAY eeprom
jmp WriteSaveGame
****************
PrintHex::
phx
pha
lsr
lsr
lsr
lsr
tax
lda digits,x
jsr PrintChar
pla
and #$f
tax
lda digits,x
jsr PrintChar
plx
rts
***************
digits db "0123456789ABCDEF"
* INCLUDES
include <includes/1000Hz.inc>
include <includes/serial.inc>
include <includes/debug.inc>
include <includes/font.inc>
include <includes/window2.inc>
include <includes/irq.inc>
include <includes/font2.hlp>
include <includes/key.inc>
include <includes/eeprom.inc>
include <includes/savegame.inc>
pal STANDARD_PAL
| 14.26
| 44
| 0.683029
|
950d4f52e8348f46b6e1d107ccb4873d969c5d83
| 441
|
asm
|
Assembly
|
oeis/317/A317440.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/317/A317440.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/317/A317440.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A317440: Numbers missing from A317438.
; Submitted by Jamie Morken(s4)
; 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200
add $0,1
mul $0,2
| 63
| 348
| 0.709751
|
e89d484c1e11afcaaf13f1713eabbf3c8dd850c1
| 321
|
asm
|
Assembly
|
src/test/resources/my_tests/addressing_mode.asm
|
int02h/ibm-pc
|
fe50e18b3acb6d340d6f2f70734a1f514591ce4b
|
[
"MIT"
] | 4
|
2021-11-11T13:13:14.000Z
|
2022-01-17T10:50:14.000Z
|
src/test/resources/my_tests/addressing_mode.asm
|
int02h/ibm-pc
|
fe50e18b3acb6d340d6f2f70734a1f514591ce4b
|
[
"MIT"
] | null | null | null |
src/test/resources/my_tests/addressing_mode.asm
|
int02h/ibm-pc
|
fe50e18b3acb6d340d6f2f70734a1f514591ce4b
|
[
"MIT"
] | null | null | null |
use16
start:
mov ax, 1h
mov ds, ax
mov ax, 2h
mov ss, ax
mov bx, 1
mov bp, 2
mov si, 3
mov di, 5
mov byte[bx + si], 1
mov byte[bx + di], 2
mov byte[bp + si], 3
mov byte[bp + di], 4
mov byte[si], 5
mov byte[di], 6
mov byte[10h], 7
mov byte[bx], 8
hlt
times 65520 - ($ - $$) db 0
jmp start
times 65536 - ($ - $$) db 0
| 11.464286
| 27
| 0.58567
|
97b8424f15bfbc45a6a83d7625c7ee74c9de653d
| 433
|
asm
|
Assembly
|
asmtest.asm
|
brice-v/InstructionSetSimulator
|
74a13637b13a892bd4ee8a0a82d59f8fb44018fe
|
[
"MIT"
] | null | null | null |
asmtest.asm
|
brice-v/InstructionSetSimulator
|
74a13637b13a892bd4ee8a0a82d59f8fb44018fe
|
[
"MIT"
] | null | null | null |
asmtest.asm
|
brice-v/InstructionSetSimulator
|
74a13637b13a892bd4ee8a0a82d59f8fb44018fe
|
[
"MIT"
] | null | null | null |
#Assembly Language Test
Start: lda 0x04
adda 0x1F
inva
adda 0x2F
sta 0x4000
jsr [TEST]
ldx 0x400
sta 0x400
inca
sta 0x401
inca
sta 0x402
ldb [X+0]
ldb [X+1]
ldb [x+2]
stb [x+500]
sta [X+501]
End: hlt
TEST: lda 0x06
ldb 0x03
lds 0x5012
psha
pshb
rfs
| 14.433333
| 24
| 0.418014
|
0cd78004133b32ce9212f8e97ab7ce2e3b8be4f2
| 546
|
asm
|
Assembly
|
ffight/lcs/enemy/24.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | 6
|
2020-10-14T15:29:10.000Z
|
2022-02-12T18:58:54.000Z
|
ffight/lcs/enemy/24.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | null | null | null |
ffight/lcs/enemy/24.asm
|
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
|
a4a0c86c200241494b3f1834cd0aef8dc02f7683
|
[
"Apache-2.0"
] | 1
|
2020-12-17T08:59:10.000Z
|
2020-12-17T08:59:10.000Z
|
copyright zengfr site:http://github.com/zengfr/romhack
003A06 movem.l D0-D3, -(A6)
003A0A movem.l D0-D3, -(A6)
003AF4 move.l ($2,A1), ($2a,A6) [1p+24, 1p+26, boss+24, boss+26, container+24, container+26, enemy+24, enemy+26, weapon+24, weapon+26]
003B2E move.l ($2,A1), ($2a,A6) [1p+24, 1p+26, boss+24, boss+26, container+24, container+26, enemy+24, enemy+26, weapon+24, weapon+26]
003B68 move.l ($2,A1), ($2a,A6) [boss+24, boss+26, enemy+24, enemy+26]
009ACA dbra D5, $9ac8
copyright zengfr site:http://github.com/zengfr/romhack
| 49.636364
| 136
| 0.67033
|
b35d662ee83504ac64b1b7d2b2103b09d5979160
| 1,159
|
asm
|
Assembly
|
palette.asm
|
NotExactlySiev/psychofloat
|
4e6ee147e688d43c182f683f760e7a4a03620517
|
[
"CC0-1.0"
] | 1
|
2021-07-06T17:41:36.000Z
|
2021-07-06T17:41:36.000Z
|
palette.asm
|
NotExactlySiev/psychofloat
|
4e6ee147e688d43c182f683f760e7a4a03620517
|
[
"CC0-1.0"
] | null | null | null |
palette.asm
|
NotExactlySiev/psychofloat
|
4e6ee147e688d43c182f683f760e7a4a03620517
|
[
"CC0-1.0"
] | null | null | null |
; x = palette address, darkens and writes to a+$12
LoadPalette: subroutine
ldx #$19
.loop ; first load the base palette
lda CastlePalette,x
sta basepalette,x
dex
bpl .loop
ldx #0
.loop2 ; then darken it step by step
lda basepalette,x
tay
and #$30
bne .ndark
tya
and #$f
tay
lda HueShift,y
bpl .found
.ndark
tya
sec
sbc #$10
.found
sta basepalette+25,x
inx
cpx #100
bne .loop2
rts
; set darkness equal to the value stored in "darkness", 0-5, 5 is black
SetDarkness: subroutine
ldy #$3f
sty PPU_ADDR
ldy darkness
ldx DarkTable,y
ldy #0
sty PPU_ADDR
.loop
lda $100,x ; some voodoo magic shit that skips mirrors in pallete addresses
sta PPU_DATA
inx
iny
tya
and #$3 ; if is divisible by 4, it's a mirror so skip to the next address
bne .loop
lda PPU_DATA
iny
cpy #$21
bne .loop
lda #0
sta PPU_ADDR
sta PPU_ADDR
rts
| 19.982759
| 83
| 0.523727
|
c2b28eb0ee54503d1bd3076d4bf6dad0484fce3b
| 333
|
asm
|
Assembly
|
programs/oeis/196/A196836.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/196/A196836.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/196/A196836.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A196836: (1^n + 2^n +3^n + 4^n)/2.
; 2,5,15,50,177,650,2445,9350,36177,141170,554325,2186750,8656377,34355690,136617405,544061750,2169039777,8654570210,34553579685,138020346350,551499730377,2204254480730,8811785649165,35231447872550,140878711512177,563373614503250
mov $2,4
pow $2,$0
seq $0,173657 ; 2+2^n+3^n.
add $0,$2
div $0,2
| 37
| 229
| 0.75976
|
266c863ddfbba668f87f07f91e09e0767b111125
| 2,702
|
asm
|
Assembly
|
PICStep.asm
|
Mikibits/PIC-bot
|
e8e99c9c0022749b65135a1be4d7681d42cd3400
|
[
"CC0-1.0"
] | null | null | null |
PICStep.asm
|
Mikibits/PIC-bot
|
e8e99c9c0022749b65135a1be4d7681d42cd3400
|
[
"CC0-1.0"
] | null | null | null |
PICStep.asm
|
Mikibits/PIC-bot
|
e8e99c9c0022749b65135a1be4d7681d42cd3400
|
[
"CC0-1.0"
] | null | null | null |
;==========================================================
; PICStep.asm
;----------------------------------------------------------
; Dedicated stepping motor controller, operating two stepper
; motors from input from another (less dedicated) MCU.
;----------------------------------------------------------
; Current capabilities: (See documentation)
;==========================================================
;----------------------------------------------------------
;Compile options
title "PICStep"
list p=16f88
;Include files
include "p16f88.inc"
include "register.inc"
;Turn off annoying messages
ERRORLEVEL -306, -302, -202
;----------------------------------------------------------
;Configuration Bits
__CONFIG _CP_OFF&_WDT_OFF&_BODEN_OFF&_PWRTE_ON&_HS_OSC&_WRT_ENABLE_ON&_LVP_ON&_DEBUG_OFF&_CPD_OFF
;==========================================================
;==========================================================
;PAGE 0 -- The Main Program Page (Reset/power-up vector)
;----------------------------------------------------------
;Reset vector .............................................
ORG h'0000'
;.........................................................;
Reset
clrf STATUS ;Bank0
clrf PCLATH ;Page0
goto MainInit ;Main program
;Interrupt vector .........................................
ORG h'0004'
;..........................................................
Interrupt
movwf SAVINTW ;Save W register
swapf STATUS,W ;Save STATUS register
clrf STATUS ;(Bank 0)
movwf SAVINTSTAT
movfw PCLATH ;Save PCLATH register
movwf SAVINTPCL
movfw FSR ;Save FSR register
movwf SAVINTFSR
movfw SELECT ;Save lookup selection
movwf SAVSELECT
bcf PCLATH,3 ;Page 2 (Interrupts)
bsf PCLATH,4
goto IntHandler ;Handle interrupt
Resume
movfw SAVSELECT ;Restore lookup selection
movwf SELECT
movfw SAVINTFSR ;Restore FSR register
movwf FSR
movfw SAVINTPCL ;Restore PCLATH register
movwf PCLATH
swapf SAVINTSTAT,W ;Restore STATUS/Bank reg.
movwf STATUS
swapf SAVINTW,F ;Get saved W register
swapf SAVINTW,W ;Swap to self (sets status)
retfie ;Return from interrupt
;----------------------------------------------------------
;Main Program
MainInit
SCall Initialize ;Setup PIC
movlw 'P' ;Send "PIC Reset" status
SCall TxPut
movlw 'R'
SCall TxPut
SCall TxCRLF
MainLoop
btfsc RUNSTAT,RXCMD ;Command ready?
call CommandHandler
btfsc RUNSTAT,ERR ;Error logged?
call ErrorHandler
btfsc RUNSTAT,BRK ;User break?
call BreakHandler
goto MainLoop ;Loop
;----------------------------------------------------------
| 28.145833
| 99
| 0.488527
|
086e07920fcc89670f3cbd7cf6dc924c4dde8b43
| 1,931
|
asm
|
Assembly
|
fm/DosChDir.asm
|
osfree-project/FamilyAPI
|
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
|
[
"BSD-3-Clause"
] | null | null | null |
fm/DosChDir.asm
|
osfree-project/FamilyAPI
|
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
|
[
"BSD-3-Clause"
] | null | null | null |
fm/DosChDir.asm
|
osfree-project/FamilyAPI
|
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
|
[
"BSD-3-Clause"
] | null | null | null |
;/*!
; @file
;
; @ingroup fapi
;
; @brief DosChDir DOS wrapper
;
; (c) osFree Project 2018, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author Yuri Prokushev (yuri.prokushev@gmail.com)
;
; Errors:
; 0 NO_ERROR
; 2 ERROR_FILE_NOT_FOUND
; 3 ERROR_PATH_NOT_FOUND
; 5 ERROR_ACCESS_DENIED
; 8 ERROR_NOT_ENOUGH_MEMORY
; 26 ERROR_NOT_DOS_DISK
; 87 ERROR_INVALID_PARAMETER
; 108 ERROR_DRIVE_LOCKED
; 206 ERROR_FILENAME_EXCED_RANGE
;
;--------D-213B-------------------------------
;INT 21 - DOS 2+ - "CHDIR" - SET CURRENT DIRECTORY
; AH = 3Bh
; DS:DX -> ASCIZ pathname to become current directory (max 64 bytes)
;Return: CF clear if successful
; AX destroyed
; CF set on error
; AX = error code (03h) (see #01680 at AH=59h/BX=0000h)
;Notes: if new directory name includes a drive letter, the default drive is
; not changed, only the current directory on that drive
; changing the current directory also changes the directory in which
; FCB file calls operate
; under the FlashTek X-32 DOS extender, the pointer is in DS:EDX
;SeeAlso: AH=47h,AX=713Bh,INT 2F/AX=1105h
;
;
;*/
;
; @todo Add args check and 8.3 filename check
;
.8086
; Helpers
INCLUDE helpers.inc
INCLUDE dos.inc
INCLUDE bseerr.inc
INCLUDE GlobalVars.inc
_TEXT SEGMENT BYTE PUBLIC 'CODE' USE16
@PROLOG DOSCHDIR
DIRNAME DD ?
RESERVED DD ?
@START DOSCHDIR
MOV AX,ERROR_INVALID_PARAMETER
XOR BX, BX
CMP BX, WORD PTR [DS:BP].ARGS.RESERVED
JNZ EXIT
CMP BX, WORD PTR [DS:BP].ARGS.RESERVED+2
JNZ EXIT
CMP LFNAPI, 0FFFFH
JZ LFN
CHANGE_DIR [DS:BP].ARGS.DIRNAME
JMP ERRCHK
LFN:
LFN_CHANGE_DIR [DS:BP].ARGS.DIRNAME
ERRCHK:
JC EXIT ; Error
XOR AX, AX
EXIT:
@EPILOG DOSCHDIR
_TEXT ENDS
END
| 23.26506
| 76
| 0.67478
|
c441a27578205306168cbd67612fc30db5e06ce1
| 15,129
|
asm
|
Assembly
|
eval/sherrloc/easyocaml++/asmrun/amd64nt.asm
|
ucsd-progsys/nate
|
8b1267cd8b10283d8bc239d16a28c654a4cb8942
|
[
"BSD-3-Clause"
] | 9
|
2017-08-30T23:00:52.000Z
|
2021-02-25T23:08:55.000Z
|
eval/sherrloc/easyocaml++/asmrun/amd64nt.asm
|
ucsd-progsys/ml2
|
8b1267cd8b10283d8bc239d16a28c654a4cb8942
|
[
"BSD-3-Clause"
] | null | null | null |
eval/sherrloc/easyocaml++/asmrun/amd64nt.asm
|
ucsd-progsys/ml2
|
8b1267cd8b10283d8bc239d16a28c654a4cb8942
|
[
"BSD-3-Clause"
] | 1
|
2022-03-31T19:50:33.000Z
|
2022-03-31T19:50:33.000Z
|
;*********************************************************************
;
; Objective Caml
;
; Xavier Leroy, projet Gallium, INRIA Rocquencourt
;
; Copyright 2006 Institut National de Recherche en Informatique et
; en Automatique. All rights reserved. This file is distributed
; under the terms of the GNU Library General Public License, with
; the special exception on linking described in file ../LICENSE.
;
;*********************************************************************
; $Id: amd64nt.asm,v 1.5 2007/03/01 10:26:51 xleroy Exp $
; Asm part of the runtime system, AMD64 processor, Intel syntax
; Notes on Win64 calling conventions:
; function arguments in RCX, RDX, R8, R9 / XMM0 - XMM3
; caller must reserve 32 bytes of stack space
; callee must preserve RBX, RBP, RSI, RDI, R12-R15, XMM6-XMM15
EXTRN caml_garbage_collection: NEAR
EXTRN caml_apply2: NEAR
EXTRN caml_apply3: NEAR
EXTRN caml_program: NEAR
EXTRN caml_array_bound_error: NEAR
EXTRN caml_young_limit: QWORD
EXTRN caml_young_ptr: QWORD
EXTRN caml_bottom_of_stack: QWORD
EXTRN caml_last_return_address: QWORD
EXTRN caml_gc_regs: QWORD
EXTRN caml_exception_pointer: QWORD
EXTRN caml_backtrace_active: DWORD
EXTRN caml_stash_backtrace: NEAR
.CODE
; Allocation
PUBLIC caml_call_gc
ALIGN 16
caml_call_gc:
; Record lowest stack address and return address
mov rax, [rsp]
mov caml_last_return_address, rax
lea rax, [rsp+8]
mov caml_bottom_of_stack, rax
L105:
; Save caml_young_ptr, caml_exception_pointer
mov caml_young_ptr, r15
mov caml_exception_pointer, r14
; Build array of registers, save it into caml_gc_regs
push r13
push r12
push rbp
push r11
push r10
push r9
push r8
push rcx
push rdx
push rsi
push rdi
push rbx
push rax
mov caml_gc_regs, rsp
; Save floating-point registers
sub rsp, 16*8
movlpd QWORD PTR [rsp + 0*8], xmm0
movlpd QWORD PTR [rsp + 1*8], xmm1
movlpd QWORD PTR [rsp + 2*8], xmm2
movlpd QWORD PTR [rsp + 3*8], xmm3
movlpd QWORD PTR [rsp + 4*8], xmm4
movlpd QWORD PTR [rsp + 5*8], xmm5
movlpd QWORD PTR [rsp + 6*8], xmm6
movlpd QWORD PTR [rsp + 7*8], xmm7
movlpd QWORD PTR [rsp + 8*8], xmm8
movlpd QWORD PTR [rsp + 9*8], xmm9
movlpd QWORD PTR [rsp + 10*8], xmm10
movlpd QWORD PTR [rsp + 11*8], xmm11
movlpd QWORD PTR [rsp + 12*8], xmm12
movlpd QWORD PTR [rsp + 13*8], xmm13
movlpd QWORD PTR [rsp + 14*8], xmm14
movlpd QWORD PTR [rsp + 15*8], xmm15
; Call the garbage collector
call caml_garbage_collection
; Restore all regs used by the code generator
movlpd xmm0, QWORD PTR [rsp + 0*8]
movlpd xmm1, QWORD PTR [rsp + 1*8]
movlpd xmm2, QWORD PTR [rsp + 2*8]
movlpd xmm3, QWORD PTR [rsp + 3*8]
movlpd xmm4, QWORD PTR [rsp + 4*8]
movlpd xmm5, QWORD PTR [rsp + 5*8]
movlpd xmm6, QWORD PTR [rsp + 6*8]
movlpd xmm7, QWORD PTR [rsp + 7*8]
movlpd xmm8, QWORD PTR [rsp + 8*8]
movlpd xmm9, QWORD PTR [rsp + 9*8]
movlpd xmm10, QWORD PTR [rsp + 10*8]
movlpd xmm11, QWORD PTR [rsp + 11*8]
movlpd xmm12, QWORD PTR [rsp + 12*8]
movlpd xmm13, QWORD PTR [rsp + 13*8]
movlpd xmm14, QWORD PTR [rsp + 14*8]
movlpd xmm15, QWORD PTR [rsp + 15*8]
add rsp, 16*8
pop rax
pop rbx
pop rdi
pop rsi
pop rdx
pop rcx
pop r8
pop r9
pop r10
pop r11
pop rbp
pop r12
pop r13
; Restore caml_young_ptr, caml_exception_pointer
mov r15, caml_young_ptr
mov r14, caml_exception_pointer
; Return to caller
ret
PUBLIC caml_alloc1
ALIGN 16
caml_alloc1:
sub r15, 16
cmp r15, caml_young_limit
jb L100
ret
L100:
mov rax, [rsp + 0]
mov caml_last_return_address, rax
lea rax, [rsp + 8]
mov caml_bottom_of_stack, rax
sub rsp, 8
call L105
add rsp, 8
jmp caml_alloc1
PUBLIC caml_alloc2
ALIGN 16
caml_alloc2:
sub r15, 24
cmp r15, caml_young_limit
jb L101
ret
L101:
mov rax, [rsp + 0]
mov caml_last_return_address, rax
lea rax, [rsp + 8]
mov caml_bottom_of_stack, rax
sub rsp, 8
call L105
add rsp, 8
jmp caml_alloc2
PUBLIC caml_alloc3
ALIGN 16
caml_alloc3:
sub r15, 32
cmp r15, caml_young_limit
jb L102
ret
L102:
mov rax, [rsp + 0]
mov caml_last_return_address, rax
lea rax, [rsp + 8]
mov caml_bottom_of_stack, rax
sub rsp, 8
call L105
add rsp, 8
jmp caml_alloc3
PUBLIC caml_allocN
ALIGN 16
caml_allocN:
sub r15, rax
cmp r15, caml_young_limit
jb L103
ret
L103:
push rax ; save desired size
mov rax, [rsp + 8]
mov caml_last_return_address, rax
lea rax, [rsp + 16]
mov caml_bottom_of_stack, rax
call L105
pop rax ; recover desired size
jmp caml_allocN
; Call a C function from Caml
PUBLIC caml_c_call
ALIGN 16
caml_c_call:
; Record lowest stack address and return address
pop r12
mov caml_last_return_address, r12
mov caml_bottom_of_stack, rsp
; Make the exception handler and alloc ptr available to the C code
mov caml_young_ptr, r15
mov caml_exception_pointer, r14
; Call the function (address in rax)
call rax
; Reload alloc ptr
mov r15, caml_young_ptr
; Return to caller
push r12
ret
; Start the Caml program
PUBLIC caml_start_program
ALIGN 16
caml_start_program:
; Save callee-save registers
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs
movapd OWORD PTR [rsp + 0*16], xmm6
movapd OWORD PTR [rsp + 1*16], xmm7
movapd OWORD PTR [rsp + 2*16], xmm8
movapd OWORD PTR [rsp + 3*16], xmm9
movapd OWORD PTR [rsp + 4*16], xmm10
movapd OWORD PTR [rsp + 5*16], xmm11
movapd OWORD PTR [rsp + 6*16], xmm12
movapd OWORD PTR [rsp + 7*16], xmm13
movapd OWORD PTR [rsp + 8*16], xmm14
movapd OWORD PTR [rsp + 9*16], xmm15
; Initial entry point is caml_program
lea r12, caml_program
; Common code for caml_start_program and caml_callback*
L106:
; Build a callback link
sub rsp, 8 ; stack 16-aligned
push caml_gc_regs
push caml_last_return_address
push caml_bottom_of_stack
; Setup alloc ptr and exception ptr
mov r15, caml_young_ptr
mov r14, caml_exception_pointer
; Build an exception handler
lea r13, L108
push r13
push r14
mov r14, rsp
; Call the Caml code
call r12
L107:
; Pop the exception handler
pop r14
pop r12 ; dummy register
L109:
; Update alloc ptr and exception ptr
mov caml_young_ptr, r15
mov caml_exception_pointer, r14
; Pop the callback restoring, link the global variables
pop caml_bottom_of_stack
pop caml_last_return_address
pop caml_gc_regs
add rsp, 8
; Restore callee-save registers.
movapd xmm6, OWORD PTR [rsp + 0*16]
movapd xmm7, OWORD PTR [rsp + 1*16]
movapd xmm8, OWORD PTR [rsp + 2*16]
movapd xmm9, OWORD PTR [rsp + 3*16]
movapd xmm10, OWORD PTR [rsp + 4*16]
movapd xmm11, OWORD PTR [rsp + 5*16]
movapd xmm12, OWORD PTR [rsp + 6*16]
movapd xmm13, OWORD PTR [rsp + 7*16]
movapd xmm14, OWORD PTR [rsp + 8*16]
movapd xmm15, OWORD PTR [rsp + 9*16]
add rsp, 8+10*16
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
; Return to caller
ret
L108:
; Exception handler
; Mark the bucket as an exception result and return it
or rax, 2
jmp L109
; Raise an exception from Caml
PUBLIC caml_raise_exn
ALIGN 16
caml_raise_exn:
test caml_backtrace_active, 1
jne L110
mov rsp, r14 ; Cut stack
pop r14 ; Recover previous exception handler
ret ; Branch to handler
L110:
mov r12, rax ; Save exception bucket in r12
mov rcx, rax ; Arg 1: exception bucket
mov rdx, [rsp] ; Arg 2: PC of raise
lea r8, [rsp+8] ; Arg 3: SP of raise
mov r9, r14 ; Arg 4: SP of handler
sub rsp, 32 ; Reserve 32 bytes on stack
call caml_stash_backtrace
mov rax, r12 ; Recover exception bucket
mov rsp, r14 ; Cut stack
pop r14 ; Recover previous exception handler
ret ; Branch to handler
; Raise an exception from C
PUBLIC caml_raise_exception
ALIGN 16
caml_raise_exception:
test caml_backtrace_active, 1
jne L111
mov rax, rcx ; First argument is exn bucket
mov rsp, caml_exception_pointer
pop r14 ; Recover previous exception handler
mov r15, caml_young_ptr ; Reload alloc ptr
ret
L111:
mov r12, rcx ; Save exception bucket in r12
; Arg 1: exception bucket
mov rdx, caml_last_return_address ; Arg 2: PC of raise
mov r8, caml_bottom_of_stack ; Arg 3: SP of raise
mov r9, caml_exception_pointer ; Arg 4: SP of handler
sub rsp, 32 ; Reserve 32 bytes on stack
call caml_stash_backtrace
mov rax, r12 ; Recover exception bucket
mov rsp, caml_exception_pointer
pop r14 ; Recover previous exception handler
mov r15, caml_young_ptr ; Reload alloc ptr
ret
; Callback from C to Caml
PUBLIC caml_callback_exn
ALIGN 16
caml_callback_exn:
; Save callee-save registers
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs
movapd OWORD PTR [rsp + 0*16], xmm6
movapd OWORD PTR [rsp + 1*16], xmm7
movapd OWORD PTR [rsp + 2*16], xmm8
movapd OWORD PTR [rsp + 3*16], xmm9
movapd OWORD PTR [rsp + 4*16], xmm10
movapd OWORD PTR [rsp + 5*16], xmm11
movapd OWORD PTR [rsp + 6*16], xmm12
movapd OWORD PTR [rsp + 7*16], xmm13
movapd OWORD PTR [rsp + 8*16], xmm14
movapd OWORD PTR [rsp + 9*16], xmm15
; Initial loading of arguments
mov rbx, rcx ; closure
mov rax, rdx ; argument
mov r12, [rbx] ; code pointer
jmp L106
PUBLIC caml_callback2_exn
ALIGN 16
caml_callback2_exn:
; Save callee-save registers
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs
movapd OWORD PTR [rsp + 0*16], xmm6
movapd OWORD PTR [rsp + 1*16], xmm7
movapd OWORD PTR [rsp + 2*16], xmm8
movapd OWORD PTR [rsp + 3*16], xmm9
movapd OWORD PTR [rsp + 4*16], xmm10
movapd OWORD PTR [rsp + 5*16], xmm11
movapd OWORD PTR [rsp + 6*16], xmm12
movapd OWORD PTR [rsp + 7*16], xmm13
movapd OWORD PTR [rsp + 8*16], xmm14
movapd OWORD PTR [rsp + 9*16], xmm15
; Initial loading of arguments
mov rdi, rcx ; closure
mov rax, rdx ; first argument
mov rbx, r8 ; second argument
lea r12, caml_apply2 ; code pointer
jmp L106
PUBLIC caml_callback3_exn
ALIGN 16
caml_callback3_exn:
; Save callee-save registers
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 8+10*16 ; stack 16-aligned + 10 saved xmm regs
movapd OWORD PTR [rsp + 0*16], xmm6
movapd OWORD PTR [rsp + 1*16], xmm7
movapd OWORD PTR [rsp + 2*16], xmm8
movapd OWORD PTR [rsp + 3*16], xmm9
movapd OWORD PTR [rsp + 4*16], xmm10
movapd OWORD PTR [rsp + 5*16], xmm11
movapd OWORD PTR [rsp + 6*16], xmm12
movapd OWORD PTR [rsp + 7*16], xmm13
movapd OWORD PTR [rsp + 8*16], xmm14
movapd OWORD PTR [rsp + 9*16], xmm15
; Initial loading of arguments
mov rsi, rcx ; closure
mov rax, rdx ; first argument
mov rbx, r8 ; second argument
mov rdi, r9 ; third argument
lea r12, caml_apply3 ; code pointer
jmp L106
PUBLIC caml_ml_array_bound_error
ALIGN 16
caml_ml_array_bound_error:
lea rax, caml_array_bound_error
jmp caml_c_call
.DATA
PUBLIC caml_system__frametable
caml_system__frametable LABEL QWORD
QWORD 1 ; one descriptor
QWORD L107 ; return address into callback
WORD -1 ; negative frame size => use callback link
WORD 0 ; no roots here
ALIGN 8
PUBLIC caml_negf_mask
ALIGN 16
caml_negf_mask LABEL QWORD
QWORD 8000000000000000H, 0
PUBLIC caml_absf_mask
ALIGN 16
caml_absf_mask LABEL QWORD
QWORD 7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH
END
| 32.535484
| 74
| 0.53295
|
f1af4978861b7b82c380d9bdc36b4766a129c778
| 810
|
asm
|
Assembly
|
audio/sfx/level_up.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | 1
|
2022-02-15T00:19:44.000Z
|
2022-02-15T00:19:44.000Z
|
audio/sfx/level_up.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
audio/sfx/level_up.asm
|
opiter09/ASM-Machina
|
75d8e457b3e82cc7a99b8e70ada643ab02863ada
|
[
"CC0-1.0"
] | null | null | null |
SFX_Level_Up_Ch5:
execute_music
tempo 256
volume 7, 7
duty_cycle 2
toggle_perfect_pitch
note_type 6, 11, 4
octave 4
note F_, 4
note_type 4, 11, 2
note C_, 2
note F_, 2
note C_, 2
note_type 6, 11, 3
note D#, 2
note D#, 2
note E_, 2
note_type 6, 11, 4
note F_, 8
sound_ret
SFX_Level_Up_Ch6:
execute_music
vibrato 4, 2, 2
duty_cycle 2
note_type 6, 12, 4
octave 4
note A_, 4
note_type 4, 12, 2
note A_, 2
note A_, 2
note A_, 2
note_type 6, 12, 4
note A#, 2
note A#, 2
note A#, 2
note_type 6, 12, 4
note A_, 8
sound_ret
SFX_Level_Up_Ch7:
execute_music
note_type 6, 1, 0
octave 5
note A_, 4
note_type 4, 1, 0
note F_, 1
rest 1
note F_, 1
rest 1
note F_, 1
rest 1
note_type 6, 1, 0
note G_, 1
rest 1
note D#, 1
rest 1
note G_, 1
rest 1
note A_, 8
sound_ret
| 12.65625
| 21
| 0.660494
|
e8ee858955e765113ec74319c1d1ffbea7b0e584
| 1,438
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/math/float/math32/z80/d32_fsutil.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/math/float/math32/z80/d32_fsutil.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/math/float/math32/z80/d32_fsutil.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
;
; Copyright (c) 2015 Digi International Inc.
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; feilipu, 2019 April
; adapted for z80, z180, and z80n
;
;-------------------------------------------------------------------------
SECTION code_fp_math32
PUBLIC m32_fseexit
PUBLIC m32_fsneg
PUBLIC m32_fszero
PUBLIC m32_fszero_hlde
PUBLIC m32_fsmin
PUBLIC m32_fsmax
PUBLIC m32_fsnan
; here to negate a number in dehl
.m32_fsneg
ld a,d
xor 080h
ld d,a
ret
; here to return a legal zero of sign h in hlde
.m32_fszero_hlde
ex de,hl
; here to return a legal zero of sign d in dehl
.m32_fszero
ld a,d
and 080h
ld d,a
ld e,0
ld h,e
ld l,e
ret
; here to change underflow to a error floating zero
.m32_fsmin
call m32_fszero
.m32_fseexit
scf ; C set for error
ret
; here to change overflow to floating infinity of sign d in dehl
.m32_fsmax
ld a,d
or 07fh ; max exponent
ld d,a
ld e,080h ;floating infinity
ld hl,0
jr m32_fseexit
; here to change error to floating NaN of sign d in dehl
.m32_fsnan
ld a,d
or 07fh ; max exponent
ld d,a
ld e,0ffh ;floating NaN
ld h,e
ld l,e
jr m32_fseexit
| 19.972222
| 74
| 0.606398
|
338c1c304257d1c3608a442aa52c48cad72fe6ee
| 149
|
asm
|
Assembly
|
audio/sfx/teleport_enter2_1.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
audio/sfx/teleport_enter2_1.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
audio/sfx/teleport_enter2_1.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
SFX_Teleport_Enter2_1_Ch1:
unknownnoise0x20 2, 241, 50
unknownnoise0x20 2, 0, 0
unknownnoise0x20 2, 241, 34
unknownnoise0x20 1, 0, 0
endchannel
| 21.285714
| 28
| 0.785235
|
467e2d2fccd1189e5dd5034d18d9d71580575d80
| 871
|
asm
|
Assembly
|
programs/oeis/068/A068236.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/068/A068236.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/068/A068236.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A068236: First differences of (n+1)^5-n^5.
; 30,180,570,1320,2550,4380,6930,10320,14670,20100,26730,34680,44070,55020,67650,82080,98430,116820,137370,160200,185430,213180,243570,276720,312750,351780,393930,439320,488070,540300,596130,655680,719070,786420,857850,933480,1013430,1097820,1186770,1280400,1378830,1482180,1590570,1704120,1822950,1947180,2076930,2212320,2353470,2500500,2653530,2812680,2978070,3149820,3328050,3512880,3704430,3902820,4108170,4320600,4540230,4767180,5001570,5243520,5493150,5750580,6015930,6289320,6570870,6860700,7158930,7465680,7781070,8105220,8438250,8780280,9131430,9491820,9861570,10240800,10629630,11028180,11436570,11854920,12283350,12721980,13170930,13630320,14100270,14580900,15072330,15574680,16088070,16612620,17148450,17695680,18254430,18824820,19406970,20001000
add $0,1
mov $1,$0
pow $0,3
mul $0,2
add $0,$1
div $0,3
mul $0,30
| 79.181818
| 758
| 0.83008
|
7440bf8f54ae928dac0dca3012650911cb93b765
| 1,631
|
asm
|
Assembly
|
Mods/HyruleWarriors_IncreaseDrawDistance/patch_drawDistance.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 1,002
|
2017-01-10T13:10:55.000Z
|
2020-11-20T18:34:19.000Z
|
Mods/HyruleWarriors_IncreaseDrawDistance/patch_drawDistance.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 347
|
2017-01-11T21:13:20.000Z
|
2020-11-27T11:33:05.000Z
|
Mods/HyruleWarriors_IncreaseDrawDistance/patch_drawDistance.asm
|
lilystudent2016/cemu_graphic_packs
|
a7aaa6d07df0d5ca3f6475d741fb8b80fadd1a46
|
[
"CC0-1.0"
] | 850
|
2017-01-10T06:06:43.000Z
|
2020-11-06T21:16:49.000Z
|
[DrawDistance_v208]
moduleMatches = 0xE159AE91
.origin = codecave
##object clip
0x100DD06C = .float 2.5 #3.0
#0x025F0554 = nop #same as setting 0x100DD06C to 0. Fix this when instruction supported.
#0x025F02F4 = nop #
#stage clip
0x100DFEC4 = .float 6.0
#0x100DFEC8 = .float 6.0
##stage clip update
0x100DFECC = .float 6.0
0x100DFED8 = .float 6.0
0x100DFEDC = .float 6.0
0x100DFEE0 = .float 6.0
0x100FF060 = .float 0.99 # force high mip / texture lod
0x100DD8C4 = .float 9900.0 # some smoke / particles
# shadow draw distance (more like boundary)
0x10000B20 = .float 8500.0
0x10000B24 = .float 40000.0
0x100DFF78 = .float 40000.0 #Dyamic object shadows ie rocks, chests etc
#Grass, debris. Mitigates object pop as groups switces between lods.
0x100DFF50 = .float 20000.0
0x100DFF54 = .float 40000.0
0x100DFF58 = .float 150000.0
0x100DFF5C = .float 200000.0
0x100DFF60 = .float 300000.0
0x100DFF64 = .float 500000.0
0x100DFF68 = .float 800000.0
0x100DFF6C = .float 80000.0
#Replace army mid LOD with high LOD
#0x022BD744 = li r12, 0
#fov
#0x10006FD0 = .float 0.015 #fov .float 0.017453292 # DATA XREF: CActFunc::GetViewParameter((PLAYER_ID,S_VIEW_PARAM &,uint))+194o
# scatter light (fog)
#0x1001CA64 = .float 2.5 # 2.0 default, 4.0 dark
#NPC text lod
#0x1009E134 = .float -8.0 #flt_1009E134: .float -1.0 # DATA XREF: CActModuleModelCommon::fGetMipLodBias(const(void))+4Co
#0x1009E138 = .float 0.0 #flt_1009E138: .float 0.0 # DATA XREF: CActModuleModelCommon::fGetMipLodBias(const(void)):loc_22BF3FCo
##dist from link
#0x100962BC = .float 0.25 #flt_100962BC: .float 0.0
| 33.979167
| 135
| 0.717964
|
b1723085b43896c3a5beea6b2a11aa71c5920007
| 497
|
asm
|
Assembly
|
programs/oeis/266/A266957.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/266/A266957.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/266/A266957.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A266957: Numbers m such that 9*m+10 is a square.
; -1,6,10,31,39,74,86,135,151,214,234,311,335,426,454,559,591,710,746,879,919,1066,1110,1271,1319,1494,1546,1735,1791,1994,2054,2271,2335,2566,2634,2879,2951,3210,3286,3559,3639,3926,4010,4311,4399,4714,4806,5135,5231,5574
mov $2,$0
mov $3,$0
mov $7,$0
mov $0,2
add $2,2
div $2,2
mov $4,$2
sub $4,$3
sub $4,1
pow $4,2
mov $5,3
lpb $0,1
mov $0,1
add $5,2
mov $3,$5
mul $3,$4
lpe
mov $1,$3
sub $1,1
add $1,$7
mov $6,$7
mul $6,$7
add $1,$6
| 18.407407
| 222
| 0.641851
|
204595e50c6128aa227daac132ed77674ca95647
| 333
|
asm
|
Assembly
|
programs/oeis/076/A076824.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/076/A076824.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/076/A076824.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A076824: Let a(1)=a(2)=1, a(n)=(2^ceiling(a(n-1)/2)+1)/a(n-2).
; 1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3,1,1,3,5,3
bin $0,2
pow $0,3
mod $0,5
mov $1,$0
mul $1,2
add $1,1
| 33.3
| 211
| 0.504505
|
ee964832c4ec838f95de3f564c3d0b807277ebb3
| 367
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_ftrunc_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640
|
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_ftrunc_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600
|
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_ftrunc_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215
|
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; unsigned char esx_f_ftrunc(unsigned char handle, uint32_t size)
SECTION code_esxdos
PUBLIC esx_f_ftrunc_callee
EXTERN asm_esx_f_ftrunc
esx_f_ftrunc_callee:
pop hl
pop de
pop bc
ex (sp),hl
ld a,l
jp asm_esx_f_ftrunc
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _esx_f_ftrunc_callee
defc _esx_f_ftrunc_callee = esx_f_ftrunc_callee
ENDIF
| 14.68
| 65
| 0.779292
|
c577edc996bb886db34caa208afe5f86bf46d05b
| 451
|
asm
|
Assembly
|
programs/oeis/104/A104344.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/104/A104344.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/104/A104344.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A104344: a(n) = Sum_{k=1..n} k!^2.
; 1,5,41,617,15017,533417,25935017,1651637417,133333531817,13301522971817,1606652445211817,231049185247771817,39006837228880411817,7639061293780877851817,1717651314017980301851817,439480788011413032845851817,126953027293558583218061851817,41117342095090841723228045851817,14838647795569910055266832269851817
add $0,2
lpb $0
mov $2,$0
sub $0,1
pow $2,2
mul $1,$2
add $1,3
lpe
div $1,3
sub $1,1
mov $0,$1
| 30.066667
| 307
| 0.791574
|
d9b6ea47383b8c59d4e9f48949d16e6106fd6e59
| 3,542
|
asm
|
Assembly
|
data/tilesets/radio_tower_collision.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
data/tilesets/radio_tower_collision.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
data/tilesets/radio_tower_collision.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 2
|
2021-08-11T19:47:07.000Z
|
2022-01-01T07:07:56.000Z
|
tilecoll 01, 01, 01, 01 ; 00
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 01
tilecoll FLOOR, FLOOR, FLOOR, WARP_CARPET_DOWN ; 02
tilecoll FLOOR, WALL, WARP_CARPET_DOWN, WALL ; 03
tilecoll WALL, WALL, FLOOR, FLOOR ; 04
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 05
tilecoll WALL, WALL, WALL, WALL ; 06
tilecoll WALL, WALL, WALL, WALL ; 07
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 08
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 09
tilecoll STAIRCASE, WALL, FLOOR, FLOOR ; 0a
tilecoll FLOOR, WALL, FLOOR, WALL ; 0b
tilecoll WALL, WALL, WALL, COUNTER ; 0c
tilecoll WALL, WALL, COUNTER, WALL ; 0d
tilecoll FLOOR, COUNTER, FLOOR, FLOOR ; 0e
tilecoll COUNTER, FLOOR, FLOOR, FLOOR ; 0f
tilecoll COUNTER, COUNTER, FLOOR, FLOOR ; 10
tilecoll WALL, WALL, WALL, WALL ; 11
tilecoll WALL, STAIRCASE, FLOOR, FLOOR ; 12
tilecoll WALL, WALL, FLOOR, FLOOR ; 13
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 14
tilecoll WALL, WALL, FLOOR, FLOOR ; 15
tilecoll FLOOR, WALL, FLOOR, WALL ; 16
tilecoll WALL, WALL, WALL, WALL ; 17
tilecoll WALL, FLOOR, WALL, FLOOR ; 18
tilecoll FLOOR, WALL, FLOOR, WALL ; 19
tilecoll FLOOR, WALL, FLOOR, WALL ; 1a
tilecoll WALL, WALL, WALL, WALL ; 1b
tilecoll WALL, WALL, WALL, WALL ; 1c
tilecoll FLOOR, WALL, FLOOR, WALL ; 1d
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 1e
tilecoll WALL, FLOOR, WALL, FLOOR ; 1f
tilecoll WALL, WALL, FLOOR, FLOOR ; 20
tilecoll WALL, WALL, WALL, WALL ; 21
tilecoll WALL, WALL, WALL, FLOOR ; 22
tilecoll WALL, WALL, WALL, WALL ; 23
tilecoll WALL, WALL, FLOOR, COUNTER ; 24
tilecoll WALL, WALL, COUNTER, FLOOR ; 25
tilecoll WALL, DOOR, FLOOR, FLOOR ; 26
tilecoll WALL, WALL, FLOOR, WALL ; 27
tilecoll WALL, WALL, WALL, WALL ; 28
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 29
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2a
tilecoll WALL, FLOOR, WALL, FLOOR ; 2b
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2c
tilecoll WALL, WALL, WALL, WALL ; 2d
tilecoll FLOOR, WALL, FLOOR, WALL ; 2e
tilecoll WALL, DOOR, FLOOR, FLOOR ; 2f
tilecoll COUNTER, FLOOR, COUNTER, FLOOR ; 30
tilecoll COUNTER, FLOOR, FLOOR, FLOOR ; 31
tilecoll FLOOR, COUNTER, FLOOR, COUNTER ; 32
tilecoll FLOOR, COUNTER, FLOOR, FLOOR ; 33
tilecoll WALL, WALL, WALL, WALL ; 34
tilecoll WALL, WALL, WALL, WALL ; 35
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 36
tilecoll WALL, FLOOR, WALL, WALL ; 37
tilecoll WALL, WALL, WALL, WALL ; 38
tilecoll WALL, WALL, WALL, WALL ; 39
tilecoll WALL, WALL, WALL, WALL ; 3a
tilecoll WALL, WALL, WALL, FLOOR ; 3b
tilecoll WALL, WALL, WALL, WALL ; 3c
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 3d
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 3e
tilecoll WALL, FLOOR, WALL, FLOOR ; 3f
tilecoll WALL, WALL, WALL, WALL ; 40
tilecoll COUNTER, WALL, FLOOR, FLOOR ; 41
tilecoll WALL, WALL, WALL, WALL ; 42
tilecoll WALL, WALL, FLOOR, FLOOR ; 43
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 44
tilecoll WALL, WALL, WALL, WALL ; 45
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 46
tilecoll WALL, WALL, FLOOR, FLOOR ; 47
tilecoll WALL, WALL, WALL, WALL ; 48
tilecoll WALL, WALL, FLOOR, FLOOR ; 49
tilecoll WALL, DOOR, FLOOR, FLOOR ; 4a
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 4b
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 4c
tilecoll WALL, WALL, FLOOR, FLOOR ; 4d
tilecoll WALL, WALL, WALL, WALL ; 4e
tilecoll WALL, WALL, FLOOR, WALL ; 4f
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 50
tilecoll WALL, WALL, FLOOR, WALL ; 51
tilecoll WALL, WALL, FLOOR, FLOOR ; 52
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, FLOOR ; 53
tilecoll WALL, WALL, FLOOR, FLOOR ; 54
tilecoll WALL, WALL, FLOOR, FLOOR ; 55
| 40.712644
| 63
| 0.708639
|
727a59a68f1c420b5585689b1f11c9c444e8900c
| 7,028
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1005.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_1005.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_1005.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xbad7, %r8
nop
nop
nop
nop
nop
cmp $41620, %r12
movl $0x61626364, (%r8)
sub $60706, %r9
lea addresses_D_ht+0xfa9f, %rax
nop
nop
nop
nop
cmp %rbx, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
vmovups %ymm3, (%rax)
nop
nop
nop
nop
dec %r8
lea addresses_WT_ht+0x14d47, %r12
nop
nop
nop
nop
nop
sub %rbx, %rbx
mov (%r12), %rdi
nop
nop
nop
inc %rbx
lea addresses_WT_ht+0x17b67, %r12
nop
nop
and %r13, %r13
movl $0x61626364, (%r12)
nop
nop
nop
nop
nop
and %r8, %r8
lea addresses_UC_ht+0x2017, %rsi
lea addresses_D_ht+0x4587, %rdi
clflush (%rsi)
nop
xor %r8, %r8
mov $42, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0x117a7, %r9
nop
lfence
mov $0x6162636465666768, %r12
movq %r12, (%r9)
nop
xor $46727, %rbx
lea addresses_A_ht+0x17c19, %rsi
nop
cmp %rbx, %rbx
movb (%rsi), %r8b
nop
nop
nop
xor $52553, %r9
lea addresses_WT_ht+0xf1c7, %rbx
nop
nop
nop
nop
sub $45210, %r12
movb $0x61, (%rbx)
nop
nop
nop
cmp $65427, %rbx
lea addresses_WC_ht+0x182a7, %r9
clflush (%r9)
nop
nop
nop
nop
add $29529, %r12
mov $0x6162636465666768, %r13
movq %r13, (%r9)
nop
nop
nop
inc %rsi
lea addresses_D_ht+0x2da7, %rsi
lea addresses_normal_ht+0xe78f, %rdi
nop
xor $28976, %r9
mov $112, %rcx
rep movsl
nop
nop
nop
nop
sub $32663, %rsi
lea addresses_normal_ht+0x1ab17, %rsi
lea addresses_UC_ht+0x1b6a7, %rdi
nop
cmp %r13, %r13
mov $110, %rcx
rep movsb
nop
nop
nop
cmp $18867, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %rbp
push %rbx
push %rcx
push %rdx
// Store
lea addresses_WC+0x158f7, %rbx
and $48076, %rbp
mov $0x5152535455565758, %rcx
movq %rcx, (%rbx)
nop
nop
nop
nop
nop
sub $25981, %rcx
// Faulty Load
lea addresses_D+0x1faa7, %r13
nop
nop
inc %r8
vmovups (%r13), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rbx
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': True, 'type': 'addresses_WC', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 34.282927
| 2,999
| 0.658509
|
a515b2cb31d710fa61a7e9b2eb6580913cd51996
| 3,909
|
asm
|
Assembly
|
LagTest/main_full.asm
|
neogeodev/NGAcidTests
|
73cf5bcda650672872a9fe03a1ab30a650143d6d
|
[
"Unlicense"
] | 6
|
2016-10-12T17:25:44.000Z
|
2020-06-01T16:04:07.000Z
|
LagTest/main_full.asm
|
neogeodev/NGAcidTests
|
73cf5bcda650672872a9fe03a1ab30a650143d6d
|
[
"Unlicense"
] | null | null | null |
LagTest/main_full.asm
|
neogeodev/NGAcidTests
|
73cf5bcda650672872a9fe03a1ab30a650143d6d
|
[
"Unlicense"
] | 2
|
2019-02-08T13:27:56.000Z
|
2020-04-24T11:03:51.000Z
|
cpu 68000
supmode on
INCLUDE "regdefs.asm"
INCLUDE "header.asm"
INCLUDE "ram.asm"
ORG $200
IRQ3:
move.w #1,REG_IRQACK
rte
TMRI:
move.w #2,REG_IRQACK
rte
VBI:
btst #7,BIOS_SYSTEM_MODE
bne .uservbi
jmp BIOSF_SYSTEM_INT1
.uservbi:
move.w #4,REG_IRQACK
move.w #$2000,sr
movem.l d0-d7/a0-a6,-(a7)
move.b d0,REG_DIPSW
jsr BIOSF_SYSTEM_IO
jsr BIOSF_MESS_OUT
addq.b #1,FRAMES
st.b FLAGS
movem.l (a7)+,d0-d7/a0-a6
rte
Start:
lea $10F300,a7
move.w #$4000,REG_LSPCMODE
move.b #2,BIOS_USER_REQUEST ; Game in progress
move.l #($F300/32)-1,d7 ; Clear work RAM
lea RAMSTART,a0
moveq.l #0,d0
.clram:
move.b d0,REG_DIPSW
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a0)+
dbra d7,.clram
move.w #7,REG_IRQACK
move.w #$2000,sr
move.w #BLACK,PALETTES
move.w #WHITE,PALETTES+2
move.w #BLACK,PALETTES+4
move.w #BLACK,BACKDROPCOLOR
jsr BIOSF_FIX_CLEAR
jsr BIOSF_LSP_1ST
; Display menu
bset.b #0,BIOS_MESS_BUSY
movea.l BIOS_MESS_POINT,a0 ; Get current pointer in buffer
move.l #MESS_MENU,(a0)+
move.l a0,BIOS_MESS_POINT ; Update pointer
bclr.b #0,BIOS_MESS_BUSY ; Ready to go
clr.b FLAGS
move.b #1,PREV_CURSOR ; Force refresh
MainLoop:
tst.b FLAGS ; Wait for VBI
beq MainLoop
clr.b FLAGS
move.b BIOS_P1CHANGE,d0
move.b CURSOR,d1
btst #CNT_UP,d0
beq .noup
tst.b d1
beq .noup
subq.b #1,d1
.noup:
btst #CNT_DN,d0
beq .nodn
cmp.b #5-1,d1
beq .nodn
addq.b #1,d1
.nodn:
cmp.b PREV_CURSOR,d1
beq .norefresh
move.b d1,CURSOR
clr.w d0
move.b PREV_CURSOR,d0 ; Clear old cursor
addi.w #$7188,d0
move.w d0,VRAM_ADDR
nop
nop
move.w #$00FF,VRAM_RW
clr.w d0
move.b CURSOR,d0 ; Draw new cursor
addi.w #$7188,d0
move.w d0,VRAM_ADDR
nop
nop
move.w #$0011,VRAM_RW ; >
move.b CURSOR,PREV_CURSOR
.norefresh:
bra MainLoop
btst #CNT_RI,d0
beq .noright ; Right: R/W to REG_LSPCMODE or $3E0000 (range check)
btst #CNT_A,d0
beq .nora ; Right + A : REG_LSPCMODE
move.b #$55,$3C0006
move.b $3C0006,d0
bra MainLoop
.nora:
move.b #$55,$3E0000 ; Only right: $3E0000
move.b $3E0000,d0
bra MainLoop
.noright:
btst #2,d0
beq .noleft ; Left
btst #4,d0
beq .nola ; Left + A: Read from REG_DIPSW = DIPRD0
move.b $300001,d0
bra MainLoop
.nola:
move.b #$55,$400000 ; Only left: R/W to PALETTES
move.b #$AA,$400001
move.b $400000,d0
move.b $400001,d0
bra MainLoop
.noleft:
btst #4,d0
beq .noa ; A: R/W to PORT
move.b #$55,$200000
move.b #$AA,$200001
move.b $200000,d0
move.b $200001,d0
bra MainLoop
.noa:
btst #5,d0
beq .nob ; B: R/W to REG_SOUND (= internal to C1)
move.b #$55,$320000
move.b $320000,d0
bra MainLoop
.nob:
btst #6,d0
beq .noc ; C: R/W to REG_STATUS_A = nDIPRD1
move.b #$55,$320001
move.b $320001,d0
bra MainLoop
.noc:
btst #7,d0
beq .nod ; D: Write to REG_POUTPUT = nBITWD0
move.b #$55,$380001
move.b $380001,d0
bra MainLoop
.nod:
btst #1,d0
beq .nodown ; Down: Write to REG_NOSHADOW = nBITW1
move.b #$55,$3A0001
move.b $3A0001,d0
bra MainLoop
.nodown:
bra MainLoop
INCLUDE "mess.asm"
| 20.792553
| 76
| 0.538757
|
d0c71f7fa5f25355eb099e5b85da617f6b6f632c
| 7,507
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_460.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_460.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_460.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 %r15
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1c813, %rdi
nop
cmp $47626, %rbx
mov $0x6162636465666768, %r15
movq %r15, (%rdi)
nop
nop
xor $29003, %r14
lea addresses_WT_ht+0x1e964, %rcx
nop
dec %rdi
mov (%rcx), %r9d
nop
nop
nop
nop
lfence
lea addresses_UC_ht+0x11c13, %rdi
nop
nop
nop
nop
nop
dec %rbp
mov $0x6162636465666768, %r15
movq %r15, %xmm2
movups %xmm2, (%rdi)
and $65443, %r14
lea addresses_WT_ht+0x15cd3, %rsi
lea addresses_WC_ht+0x813, %rdi
nop
nop
nop
nop
and %r14, %r14
mov $122, %rcx
rep movsb
nop
nop
nop
xor %rbp, %rbp
lea addresses_normal_ht+0x1b383, %rbp
nop
nop
nop
nop
nop
sub %rsi, %rsi
mov (%rbp), %r15d
sub $37166, %r14
lea addresses_A_ht+0x11213, %rsi
lea addresses_WT_ht+0x101d3, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub %r14, %r14
mov $125, %rcx
rep movsw
xor $2971, %rcx
lea addresses_UC_ht+0x1ee13, %r9
nop
nop
nop
nop
inc %rbx
movl $0x61626364, (%r9)
nop
nop
sub %rdi, %rdi
lea addresses_WT_ht+0x1c013, %r14
nop
nop
nop
nop
nop
cmp $40865, %r9
mov (%r14), %edi
nop
nop
nop
nop
nop
sub $62625, %rcx
lea addresses_WC_ht+0x12813, %rsi
lea addresses_WT_ht+0xf813, %rdi
nop
nop
nop
nop
sub $39042, %r14
mov $20, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $17267, %rcx
lea addresses_UC_ht+0x3e13, %rsi
lea addresses_WC_ht+0xf013, %rdi
nop
nop
nop
nop
xor %r9, %r9
mov $85, %rcx
rep movsl
nop
sub $1614, %rbx
lea addresses_WT_ht+0x12093, %rbp
nop
nop
nop
nop
nop
inc %rcx
movups (%rbp), %xmm4
vpextrq $0, %xmm4, %r15
nop
nop
nop
mfence
lea addresses_normal_ht+0x18b03, %rsi
lea addresses_D_ht+0x16b0f, %rdi
sub %r14, %r14
mov $2, %rcx
rep movsl
sub %r14, %r14
lea addresses_UC_ht+0x1ae13, %rcx
cmp %rbx, %rbx
mov (%rcx), %rbp
nop
nop
nop
nop
nop
sub %r9, %r9
lea addresses_WT_ht+0xa713, %rsi
lea addresses_D_ht+0xa813, %rdi
nop
cmp $27029, %r9
mov $27, %rcx
rep movsl
nop
nop
add %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rax
push %rbp
// Faulty Load
lea addresses_WT+0x1d013, %r9
nop
nop
sub $8293, %r10
mov (%r9), %ax
lea oracles, %r9
and $0xff, %rax
shlq $12, %rax
mov (%r9,%rax,1), %rax
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'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
*/
| 34.278539
| 2,999
| 0.658985
|
1f82dffb7a205f1e71df1c1caa2a9f09c2a4b783
| 313,046
|
asm
|
Assembly
|
usertests.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
usertests.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
usertests.asm
|
avivo23/os_ass3
|
9616ffbc3f422b5c8fa872f557b8d4a1eff7f2f3
|
[
"MIT-0"
] | null | null | null |
_usertests: file format elf32-i386
Disassembly of section .text:
00000000 <iputtest>:
int stdout = 1;
// does chdir() call iput(p->cwd) in a transaction?
void
iputtest(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 08 sub $0x8,%esp
printf(stdout, "iput test\n");
6: a1 8c 62 00 00 mov 0x628c,%eax
b: 83 ec 08 sub $0x8,%esp
e: 68 e6 43 00 00 push $0x43e6
13: 50 push %eax
14: e8 00 40 00 00 call 4019 <printf>
19: 83 c4 10 add $0x10,%esp
if(mkdir("iputdir") < 0){
1c: 83 ec 0c sub $0xc,%esp
1f: 68 f1 43 00 00 push $0x43f1
24: e8 e1 3e 00 00 call 3f0a <mkdir>
29: 83 c4 10 add $0x10,%esp
2c: 85 c0 test %eax,%eax
2e: 79 1b jns 4b <iputtest+0x4b>
printf(stdout, "mkdir failed\n");
30: a1 8c 62 00 00 mov 0x628c,%eax
35: 83 ec 08 sub $0x8,%esp
38: 68 f9 43 00 00 push $0x43f9
3d: 50 push %eax
3e: e8 d6 3f 00 00 call 4019 <printf>
43: 83 c4 10 add $0x10,%esp
exit();
46: e8 57 3e 00 00 call 3ea2 <exit>
}
if(chdir("iputdir") < 0){
4b: 83 ec 0c sub $0xc,%esp
4e: 68 f1 43 00 00 push $0x43f1
53: e8 ba 3e 00 00 call 3f12 <chdir>
58: 83 c4 10 add $0x10,%esp
5b: 85 c0 test %eax,%eax
5d: 79 1b jns 7a <iputtest+0x7a>
printf(stdout, "chdir iputdir failed\n");
5f: a1 8c 62 00 00 mov 0x628c,%eax
64: 83 ec 08 sub $0x8,%esp
67: 68 07 44 00 00 push $0x4407
6c: 50 push %eax
6d: e8 a7 3f 00 00 call 4019 <printf>
72: 83 c4 10 add $0x10,%esp
exit();
75: e8 28 3e 00 00 call 3ea2 <exit>
}
if(unlink("../iputdir") < 0){
7a: 83 ec 0c sub $0xc,%esp
7d: 68 1d 44 00 00 push $0x441d
82: e8 6b 3e 00 00 call 3ef2 <unlink>
87: 83 c4 10 add $0x10,%esp
8a: 85 c0 test %eax,%eax
8c: 79 1b jns a9 <iputtest+0xa9>
printf(stdout, "unlink ../iputdir failed\n");
8e: a1 8c 62 00 00 mov 0x628c,%eax
93: 83 ec 08 sub $0x8,%esp
96: 68 28 44 00 00 push $0x4428
9b: 50 push %eax
9c: e8 78 3f 00 00 call 4019 <printf>
a1: 83 c4 10 add $0x10,%esp
exit();
a4: e8 f9 3d 00 00 call 3ea2 <exit>
}
if(chdir("/") < 0){
a9: 83 ec 0c sub $0xc,%esp
ac: 68 42 44 00 00 push $0x4442
b1: e8 5c 3e 00 00 call 3f12 <chdir>
b6: 83 c4 10 add $0x10,%esp
b9: 85 c0 test %eax,%eax
bb: 79 1b jns d8 <iputtest+0xd8>
printf(stdout, "chdir / failed\n");
bd: a1 8c 62 00 00 mov 0x628c,%eax
c2: 83 ec 08 sub $0x8,%esp
c5: 68 44 44 00 00 push $0x4444
ca: 50 push %eax
cb: e8 49 3f 00 00 call 4019 <printf>
d0: 83 c4 10 add $0x10,%esp
exit();
d3: e8 ca 3d 00 00 call 3ea2 <exit>
}
printf(stdout, "iput test ok\n");
d8: a1 8c 62 00 00 mov 0x628c,%eax
dd: 83 ec 08 sub $0x8,%esp
e0: 68 54 44 00 00 push $0x4454
e5: 50 push %eax
e6: e8 2e 3f 00 00 call 4019 <printf>
eb: 83 c4 10 add $0x10,%esp
}
ee: 90 nop
ef: c9 leave
f0: c3 ret
000000f1 <exitiputtest>:
// does exit() call iput(p->cwd) in a transaction?
void
exitiputtest(void)
{
f1: 55 push %ebp
f2: 89 e5 mov %esp,%ebp
f4: 83 ec 18 sub $0x18,%esp
int pid;
printf(stdout, "exitiput test\n");
f7: a1 8c 62 00 00 mov 0x628c,%eax
fc: 83 ec 08 sub $0x8,%esp
ff: 68 62 44 00 00 push $0x4462
104: 50 push %eax
105: e8 0f 3f 00 00 call 4019 <printf>
10a: 83 c4 10 add $0x10,%esp
pid = fork();
10d: e8 88 3d 00 00 call 3e9a <fork>
112: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid < 0){
115: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
119: 79 1b jns 136 <exitiputtest+0x45>
printf(stdout, "fork failed\n");
11b: a1 8c 62 00 00 mov 0x628c,%eax
120: 83 ec 08 sub $0x8,%esp
123: 68 71 44 00 00 push $0x4471
128: 50 push %eax
129: e8 eb 3e 00 00 call 4019 <printf>
12e: 83 c4 10 add $0x10,%esp
exit();
131: e8 6c 3d 00 00 call 3ea2 <exit>
}
if(pid == 0){
136: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
13a: 0f 85 92 00 00 00 jne 1d2 <exitiputtest+0xe1>
if(mkdir("iputdir") < 0){
140: 83 ec 0c sub $0xc,%esp
143: 68 f1 43 00 00 push $0x43f1
148: e8 bd 3d 00 00 call 3f0a <mkdir>
14d: 83 c4 10 add $0x10,%esp
150: 85 c0 test %eax,%eax
152: 79 1b jns 16f <exitiputtest+0x7e>
printf(stdout, "mkdir failed\n");
154: a1 8c 62 00 00 mov 0x628c,%eax
159: 83 ec 08 sub $0x8,%esp
15c: 68 f9 43 00 00 push $0x43f9
161: 50 push %eax
162: e8 b2 3e 00 00 call 4019 <printf>
167: 83 c4 10 add $0x10,%esp
exit();
16a: e8 33 3d 00 00 call 3ea2 <exit>
}
if(chdir("iputdir") < 0){
16f: 83 ec 0c sub $0xc,%esp
172: 68 f1 43 00 00 push $0x43f1
177: e8 96 3d 00 00 call 3f12 <chdir>
17c: 83 c4 10 add $0x10,%esp
17f: 85 c0 test %eax,%eax
181: 79 1b jns 19e <exitiputtest+0xad>
printf(stdout, "child chdir failed\n");
183: a1 8c 62 00 00 mov 0x628c,%eax
188: 83 ec 08 sub $0x8,%esp
18b: 68 7e 44 00 00 push $0x447e
190: 50 push %eax
191: e8 83 3e 00 00 call 4019 <printf>
196: 83 c4 10 add $0x10,%esp
exit();
199: e8 04 3d 00 00 call 3ea2 <exit>
}
if(unlink("../iputdir") < 0){
19e: 83 ec 0c sub $0xc,%esp
1a1: 68 1d 44 00 00 push $0x441d
1a6: e8 47 3d 00 00 call 3ef2 <unlink>
1ab: 83 c4 10 add $0x10,%esp
1ae: 85 c0 test %eax,%eax
1b0: 79 1b jns 1cd <exitiputtest+0xdc>
printf(stdout, "unlink ../iputdir failed\n");
1b2: a1 8c 62 00 00 mov 0x628c,%eax
1b7: 83 ec 08 sub $0x8,%esp
1ba: 68 28 44 00 00 push $0x4428
1bf: 50 push %eax
1c0: e8 54 3e 00 00 call 4019 <printf>
1c5: 83 c4 10 add $0x10,%esp
exit();
1c8: e8 d5 3c 00 00 call 3ea2 <exit>
}
exit();
1cd: e8 d0 3c 00 00 call 3ea2 <exit>
}
wait();
1d2: e8 d3 3c 00 00 call 3eaa <wait>
printf(stdout, "exitiput test ok\n");
1d7: a1 8c 62 00 00 mov 0x628c,%eax
1dc: 83 ec 08 sub $0x8,%esp
1df: 68 92 44 00 00 push $0x4492
1e4: 50 push %eax
1e5: e8 2f 3e 00 00 call 4019 <printf>
1ea: 83 c4 10 add $0x10,%esp
}
1ed: 90 nop
1ee: c9 leave
1ef: c3 ret
000001f0 <openiputtest>:
// for(i = 0; i < 10000; i++)
// yield();
// }
void
openiputtest(void)
{
1f0: 55 push %ebp
1f1: 89 e5 mov %esp,%ebp
1f3: 83 ec 18 sub $0x18,%esp
int pid;
printf(stdout, "openiput test\n");
1f6: a1 8c 62 00 00 mov 0x628c,%eax
1fb: 83 ec 08 sub $0x8,%esp
1fe: 68 a4 44 00 00 push $0x44a4
203: 50 push %eax
204: e8 10 3e 00 00 call 4019 <printf>
209: 83 c4 10 add $0x10,%esp
if(mkdir("oidir") < 0){
20c: 83 ec 0c sub $0xc,%esp
20f: 68 b3 44 00 00 push $0x44b3
214: e8 f1 3c 00 00 call 3f0a <mkdir>
219: 83 c4 10 add $0x10,%esp
21c: 85 c0 test %eax,%eax
21e: 79 1b jns 23b <openiputtest+0x4b>
printf(stdout, "mkdir oidir failed\n");
220: a1 8c 62 00 00 mov 0x628c,%eax
225: 83 ec 08 sub $0x8,%esp
228: 68 b9 44 00 00 push $0x44b9
22d: 50 push %eax
22e: e8 e6 3d 00 00 call 4019 <printf>
233: 83 c4 10 add $0x10,%esp
exit();
236: e8 67 3c 00 00 call 3ea2 <exit>
}
pid = fork();
23b: e8 5a 3c 00 00 call 3e9a <fork>
240: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid < 0){
243: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
247: 79 1b jns 264 <openiputtest+0x74>
printf(stdout, "fork failed\n");
249: a1 8c 62 00 00 mov 0x628c,%eax
24e: 83 ec 08 sub $0x8,%esp
251: 68 71 44 00 00 push $0x4471
256: 50 push %eax
257: e8 bd 3d 00 00 call 4019 <printf>
25c: 83 c4 10 add $0x10,%esp
exit();
25f: e8 3e 3c 00 00 call 3ea2 <exit>
}
if(pid == 0){
264: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
268: 75 3b jne 2a5 <openiputtest+0xb5>
int fd = open("oidir", O_RDWR);
26a: 83 ec 08 sub $0x8,%esp
26d: 6a 02 push $0x2
26f: 68 b3 44 00 00 push $0x44b3
274: e8 69 3c 00 00 call 3ee2 <open>
279: 83 c4 10 add $0x10,%esp
27c: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
27f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
283: 78 1b js 2a0 <openiputtest+0xb0>
printf(stdout, "open directory for write succeeded\n");
285: a1 8c 62 00 00 mov 0x628c,%eax
28a: 83 ec 08 sub $0x8,%esp
28d: 68 d0 44 00 00 push $0x44d0
292: 50 push %eax
293: e8 81 3d 00 00 call 4019 <printf>
298: 83 c4 10 add $0x10,%esp
exit();
29b: e8 02 3c 00 00 call 3ea2 <exit>
}
exit();
2a0: e8 fd 3b 00 00 call 3ea2 <exit>
}
sleep(1);
2a5: 83 ec 0c sub $0xc,%esp
2a8: 6a 01 push $0x1
2aa: e8 83 3c 00 00 call 3f32 <sleep>
2af: 83 c4 10 add $0x10,%esp
if(unlink("oidir") != 0){
2b2: 83 ec 0c sub $0xc,%esp
2b5: 68 b3 44 00 00 push $0x44b3
2ba: e8 33 3c 00 00 call 3ef2 <unlink>
2bf: 83 c4 10 add $0x10,%esp
2c2: 85 c0 test %eax,%eax
2c4: 74 1b je 2e1 <openiputtest+0xf1>
printf(stdout, "unlink failed\n");
2c6: a1 8c 62 00 00 mov 0x628c,%eax
2cb: 83 ec 08 sub $0x8,%esp
2ce: 68 f4 44 00 00 push $0x44f4
2d3: 50 push %eax
2d4: e8 40 3d 00 00 call 4019 <printf>
2d9: 83 c4 10 add $0x10,%esp
exit();
2dc: e8 c1 3b 00 00 call 3ea2 <exit>
}
wait();
2e1: e8 c4 3b 00 00 call 3eaa <wait>
printf(stdout, "openiput test ok\n");
2e6: a1 8c 62 00 00 mov 0x628c,%eax
2eb: 83 ec 08 sub $0x8,%esp
2ee: 68 03 45 00 00 push $0x4503
2f3: 50 push %eax
2f4: e8 20 3d 00 00 call 4019 <printf>
2f9: 83 c4 10 add $0x10,%esp
}
2fc: 90 nop
2fd: c9 leave
2fe: c3 ret
000002ff <opentest>:
// simple file system tests
void
opentest(void)
{
2ff: 55 push %ebp
300: 89 e5 mov %esp,%ebp
302: 83 ec 18 sub $0x18,%esp
int fd;
printf(stdout, "open test\n");
305: a1 8c 62 00 00 mov 0x628c,%eax
30a: 83 ec 08 sub $0x8,%esp
30d: 68 15 45 00 00 push $0x4515
312: 50 push %eax
313: e8 01 3d 00 00 call 4019 <printf>
318: 83 c4 10 add $0x10,%esp
fd = open("echo", 0);
31b: 83 ec 08 sub $0x8,%esp
31e: 6a 00 push $0x0
320: 68 d0 43 00 00 push $0x43d0
325: e8 b8 3b 00 00 call 3ee2 <open>
32a: 83 c4 10 add $0x10,%esp
32d: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
330: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
334: 79 1b jns 351 <opentest+0x52>
printf(stdout, "open echo failed!\n");
336: a1 8c 62 00 00 mov 0x628c,%eax
33b: 83 ec 08 sub $0x8,%esp
33e: 68 20 45 00 00 push $0x4520
343: 50 push %eax
344: e8 d0 3c 00 00 call 4019 <printf>
349: 83 c4 10 add $0x10,%esp
exit();
34c: e8 51 3b 00 00 call 3ea2 <exit>
}
close(fd);
351: 83 ec 0c sub $0xc,%esp
354: ff 75 f4 pushl -0xc(%ebp)
357: e8 6e 3b 00 00 call 3eca <close>
35c: 83 c4 10 add $0x10,%esp
fd = open("doesnotexist", 0);
35f: 83 ec 08 sub $0x8,%esp
362: 6a 00 push $0x0
364: 68 33 45 00 00 push $0x4533
369: e8 74 3b 00 00 call 3ee2 <open>
36e: 83 c4 10 add $0x10,%esp
371: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
374: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
378: 78 1b js 395 <opentest+0x96>
printf(stdout, "open doesnotexist succeeded!\n");
37a: a1 8c 62 00 00 mov 0x628c,%eax
37f: 83 ec 08 sub $0x8,%esp
382: 68 40 45 00 00 push $0x4540
387: 50 push %eax
388: e8 8c 3c 00 00 call 4019 <printf>
38d: 83 c4 10 add $0x10,%esp
exit();
390: e8 0d 3b 00 00 call 3ea2 <exit>
}
printf(stdout, "open test ok\n");
395: a1 8c 62 00 00 mov 0x628c,%eax
39a: 83 ec 08 sub $0x8,%esp
39d: 68 5e 45 00 00 push $0x455e
3a2: 50 push %eax
3a3: e8 71 3c 00 00 call 4019 <printf>
3a8: 83 c4 10 add $0x10,%esp
}
3ab: 90 nop
3ac: c9 leave
3ad: c3 ret
000003ae <writetest>:
void
writetest(void)
{
3ae: 55 push %ebp
3af: 89 e5 mov %esp,%ebp
3b1: 83 ec 18 sub $0x18,%esp
int fd;
int i;
printf(stdout, "small file test\n");
3b4: a1 8c 62 00 00 mov 0x628c,%eax
3b9: 83 ec 08 sub $0x8,%esp
3bc: 68 6c 45 00 00 push $0x456c
3c1: 50 push %eax
3c2: e8 52 3c 00 00 call 4019 <printf>
3c7: 83 c4 10 add $0x10,%esp
fd = open("small", O_CREATE|O_RDWR);
3ca: 83 ec 08 sub $0x8,%esp
3cd: 68 02 02 00 00 push $0x202
3d2: 68 7d 45 00 00 push $0x457d
3d7: e8 06 3b 00 00 call 3ee2 <open>
3dc: 83 c4 10 add $0x10,%esp
3df: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
3e2: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3e6: 78 22 js 40a <writetest+0x5c>
printf(stdout, "creat small succeeded; ok\n");
3e8: a1 8c 62 00 00 mov 0x628c,%eax
3ed: 83 ec 08 sub $0x8,%esp
3f0: 68 83 45 00 00 push $0x4583
3f5: 50 push %eax
3f6: e8 1e 3c 00 00 call 4019 <printf>
3fb: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "error: creat small failed!\n");
exit();
}
for(i = 0; i < 100; i++){
3fe: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
405: e9 8f 00 00 00 jmp 499 <writetest+0xeb>
printf(stdout, "small file test\n");
fd = open("small", O_CREATE|O_RDWR);
if(fd >= 0){
printf(stdout, "creat small succeeded; ok\n");
} else {
printf(stdout, "error: creat small failed!\n");
40a: a1 8c 62 00 00 mov 0x628c,%eax
40f: 83 ec 08 sub $0x8,%esp
412: 68 9e 45 00 00 push $0x459e
417: 50 push %eax
418: e8 fc 3b 00 00 call 4019 <printf>
41d: 83 c4 10 add $0x10,%esp
exit();
420: e8 7d 3a 00 00 call 3ea2 <exit>
}
for(i = 0; i < 100; i++){
if(write(fd, "aaaaaaaaaa", 10) != 10){
425: 83 ec 04 sub $0x4,%esp
428: 6a 0a push $0xa
42a: 68 ba 45 00 00 push $0x45ba
42f: ff 75 f0 pushl -0x10(%ebp)
432: e8 8b 3a 00 00 call 3ec2 <write>
437: 83 c4 10 add $0x10,%esp
43a: 83 f8 0a cmp $0xa,%eax
43d: 74 1e je 45d <writetest+0xaf>
printf(stdout, "error: write aa %d new file failed\n", i);
43f: a1 8c 62 00 00 mov 0x628c,%eax
444: 83 ec 04 sub $0x4,%esp
447: ff 75 f4 pushl -0xc(%ebp)
44a: 68 c8 45 00 00 push $0x45c8
44f: 50 push %eax
450: e8 c4 3b 00 00 call 4019 <printf>
455: 83 c4 10 add $0x10,%esp
exit();
458: e8 45 3a 00 00 call 3ea2 <exit>
}
if(write(fd, "bbbbbbbbbb", 10) != 10){
45d: 83 ec 04 sub $0x4,%esp
460: 6a 0a push $0xa
462: 68 ec 45 00 00 push $0x45ec
467: ff 75 f0 pushl -0x10(%ebp)
46a: e8 53 3a 00 00 call 3ec2 <write>
46f: 83 c4 10 add $0x10,%esp
472: 83 f8 0a cmp $0xa,%eax
475: 74 1e je 495 <writetest+0xe7>
printf(stdout, "error: write bb %d new file failed\n", i);
477: a1 8c 62 00 00 mov 0x628c,%eax
47c: 83 ec 04 sub $0x4,%esp
47f: ff 75 f4 pushl -0xc(%ebp)
482: 68 f8 45 00 00 push $0x45f8
487: 50 push %eax
488: e8 8c 3b 00 00 call 4019 <printf>
48d: 83 c4 10 add $0x10,%esp
exit();
490: e8 0d 3a 00 00 call 3ea2 <exit>
printf(stdout, "creat small succeeded; ok\n");
} else {
printf(stdout, "error: creat small failed!\n");
exit();
}
for(i = 0; i < 100; i++){
495: 83 45 f4 01 addl $0x1,-0xc(%ebp)
499: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
49d: 7e 86 jle 425 <writetest+0x77>
if(write(fd, "bbbbbbbbbb", 10) != 10){
printf(stdout, "error: write bb %d new file failed\n", i);
exit();
}
}
printf(stdout, "writes ok\n");
49f: a1 8c 62 00 00 mov 0x628c,%eax
4a4: 83 ec 08 sub $0x8,%esp
4a7: 68 1c 46 00 00 push $0x461c
4ac: 50 push %eax
4ad: e8 67 3b 00 00 call 4019 <printf>
4b2: 83 c4 10 add $0x10,%esp
close(fd);
4b5: 83 ec 0c sub $0xc,%esp
4b8: ff 75 f0 pushl -0x10(%ebp)
4bb: e8 0a 3a 00 00 call 3eca <close>
4c0: 83 c4 10 add $0x10,%esp
fd = open("small", O_RDONLY);
4c3: 83 ec 08 sub $0x8,%esp
4c6: 6a 00 push $0x0
4c8: 68 7d 45 00 00 push $0x457d
4cd: e8 10 3a 00 00 call 3ee2 <open>
4d2: 83 c4 10 add $0x10,%esp
4d5: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0){
4d8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4dc: 78 3c js 51a <writetest+0x16c>
printf(stdout, "open small succeeded ok\n");
4de: a1 8c 62 00 00 mov 0x628c,%eax
4e3: 83 ec 08 sub $0x8,%esp
4e6: 68 27 46 00 00 push $0x4627
4eb: 50 push %eax
4ec: e8 28 3b 00 00 call 4019 <printf>
4f1: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "error: open small failed!\n");
exit();
}
i = read(fd, buf, 2000);
4f4: 83 ec 04 sub $0x4,%esp
4f7: 68 d0 07 00 00 push $0x7d0
4fc: 68 80 8a 00 00 push $0x8a80
501: ff 75 f0 pushl -0x10(%ebp)
504: e8 b1 39 00 00 call 3eba <read>
509: 83 c4 10 add $0x10,%esp
50c: 89 45 f4 mov %eax,-0xc(%ebp)
if(i == 2000){
50f: 81 7d f4 d0 07 00 00 cmpl $0x7d0,-0xc(%ebp)
516: 75 57 jne 56f <writetest+0x1c1>
518: eb 1b jmp 535 <writetest+0x187>
close(fd);
fd = open("small", O_RDONLY);
if(fd >= 0){
printf(stdout, "open small succeeded ok\n");
} else {
printf(stdout, "error: open small failed!\n");
51a: a1 8c 62 00 00 mov 0x628c,%eax
51f: 83 ec 08 sub $0x8,%esp
522: 68 40 46 00 00 push $0x4640
527: 50 push %eax
528: e8 ec 3a 00 00 call 4019 <printf>
52d: 83 c4 10 add $0x10,%esp
exit();
530: e8 6d 39 00 00 call 3ea2 <exit>
}
i = read(fd, buf, 2000);
if(i == 2000){
printf(stdout, "read succeeded ok\n");
535: a1 8c 62 00 00 mov 0x628c,%eax
53a: 83 ec 08 sub $0x8,%esp
53d: 68 5b 46 00 00 push $0x465b
542: 50 push %eax
543: e8 d1 3a 00 00 call 4019 <printf>
548: 83 c4 10 add $0x10,%esp
} else {
printf(stdout, "read failed\n");
exit();
}
close(fd);
54b: 83 ec 0c sub $0xc,%esp
54e: ff 75 f0 pushl -0x10(%ebp)
551: e8 74 39 00 00 call 3eca <close>
556: 83 c4 10 add $0x10,%esp
if(unlink("small") < 0){
559: 83 ec 0c sub $0xc,%esp
55c: 68 7d 45 00 00 push $0x457d
561: e8 8c 39 00 00 call 3ef2 <unlink>
566: 83 c4 10 add $0x10,%esp
569: 85 c0 test %eax,%eax
56b: 79 38 jns 5a5 <writetest+0x1f7>
56d: eb 1b jmp 58a <writetest+0x1dc>
}
i = read(fd, buf, 2000);
if(i == 2000){
printf(stdout, "read succeeded ok\n");
} else {
printf(stdout, "read failed\n");
56f: a1 8c 62 00 00 mov 0x628c,%eax
574: 83 ec 08 sub $0x8,%esp
577: 68 6e 46 00 00 push $0x466e
57c: 50 push %eax
57d: e8 97 3a 00 00 call 4019 <printf>
582: 83 c4 10 add $0x10,%esp
exit();
585: e8 18 39 00 00 call 3ea2 <exit>
}
close(fd);
if(unlink("small") < 0){
printf(stdout, "unlink small failed\n");
58a: a1 8c 62 00 00 mov 0x628c,%eax
58f: 83 ec 08 sub $0x8,%esp
592: 68 7b 46 00 00 push $0x467b
597: 50 push %eax
598: e8 7c 3a 00 00 call 4019 <printf>
59d: 83 c4 10 add $0x10,%esp
exit();
5a0: e8 fd 38 00 00 call 3ea2 <exit>
}
printf(stdout, "small file test ok\n");
5a5: a1 8c 62 00 00 mov 0x628c,%eax
5aa: 83 ec 08 sub $0x8,%esp
5ad: 68 90 46 00 00 push $0x4690
5b2: 50 push %eax
5b3: e8 61 3a 00 00 call 4019 <printf>
5b8: 83 c4 10 add $0x10,%esp
}
5bb: 90 nop
5bc: c9 leave
5bd: c3 ret
000005be <writetest1>:
void
writetest1(void)
{
5be: 55 push %ebp
5bf: 89 e5 mov %esp,%ebp
5c1: 83 ec 18 sub $0x18,%esp
int i, fd, n;
printf(stdout, "big files test\n");
5c4: a1 8c 62 00 00 mov 0x628c,%eax
5c9: 83 ec 08 sub $0x8,%esp
5cc: 68 a4 46 00 00 push $0x46a4
5d1: 50 push %eax
5d2: e8 42 3a 00 00 call 4019 <printf>
5d7: 83 c4 10 add $0x10,%esp
fd = open("big", O_CREATE|O_RDWR);
5da: 83 ec 08 sub $0x8,%esp
5dd: 68 02 02 00 00 push $0x202
5e2: 68 b4 46 00 00 push $0x46b4
5e7: e8 f6 38 00 00 call 3ee2 <open>
5ec: 83 c4 10 add $0x10,%esp
5ef: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
5f2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
5f6: 79 1b jns 613 <writetest1+0x55>
printf(stdout, "error: creat big failed!\n");
5f8: a1 8c 62 00 00 mov 0x628c,%eax
5fd: 83 ec 08 sub $0x8,%esp
600: 68 b8 46 00 00 push $0x46b8
605: 50 push %eax
606: e8 0e 3a 00 00 call 4019 <printf>
60b: 83 c4 10 add $0x10,%esp
exit();
60e: e8 8f 38 00 00 call 3ea2 <exit>
}
for(i = 0; i < MAXFILE; i++){
613: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
61a: eb 4b jmp 667 <writetest1+0xa9>
((int*)buf)[0] = i;
61c: ba 80 8a 00 00 mov $0x8a80,%edx
621: 8b 45 f4 mov -0xc(%ebp),%eax
624: 89 02 mov %eax,(%edx)
if(write(fd, buf, 512) != 512){
626: 83 ec 04 sub $0x4,%esp
629: 68 00 02 00 00 push $0x200
62e: 68 80 8a 00 00 push $0x8a80
633: ff 75 ec pushl -0x14(%ebp)
636: e8 87 38 00 00 call 3ec2 <write>
63b: 83 c4 10 add $0x10,%esp
63e: 3d 00 02 00 00 cmp $0x200,%eax
643: 74 1e je 663 <writetest1+0xa5>
printf(stdout, "error: write big file failed\n", i);
645: a1 8c 62 00 00 mov 0x628c,%eax
64a: 83 ec 04 sub $0x4,%esp
64d: ff 75 f4 pushl -0xc(%ebp)
650: 68 d2 46 00 00 push $0x46d2
655: 50 push %eax
656: e8 be 39 00 00 call 4019 <printf>
65b: 83 c4 10 add $0x10,%esp
exit();
65e: e8 3f 38 00 00 call 3ea2 <exit>
if(fd < 0){
printf(stdout, "error: creat big failed!\n");
exit();
}
for(i = 0; i < MAXFILE; i++){
663: 83 45 f4 01 addl $0x1,-0xc(%ebp)
667: 8b 45 f4 mov -0xc(%ebp),%eax
66a: 3d 8b 00 00 00 cmp $0x8b,%eax
66f: 76 ab jbe 61c <writetest1+0x5e>
printf(stdout, "error: write big file failed\n", i);
exit();
}
}
close(fd);
671: 83 ec 0c sub $0xc,%esp
674: ff 75 ec pushl -0x14(%ebp)
677: e8 4e 38 00 00 call 3eca <close>
67c: 83 c4 10 add $0x10,%esp
fd = open("big", O_RDONLY);
67f: 83 ec 08 sub $0x8,%esp
682: 6a 00 push $0x0
684: 68 b4 46 00 00 push $0x46b4
689: e8 54 38 00 00 call 3ee2 <open>
68e: 83 c4 10 add $0x10,%esp
691: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
694: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
698: 79 1b jns 6b5 <writetest1+0xf7>
printf(stdout, "error: open big failed!\n");
69a: a1 8c 62 00 00 mov 0x628c,%eax
69f: 83 ec 08 sub $0x8,%esp
6a2: 68 f0 46 00 00 push $0x46f0
6a7: 50 push %eax
6a8: e8 6c 39 00 00 call 4019 <printf>
6ad: 83 c4 10 add $0x10,%esp
exit();
6b0: e8 ed 37 00 00 call 3ea2 <exit>
}
n = 0;
6b5: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(;;){
i = read(fd, buf, 512);
6bc: 83 ec 04 sub $0x4,%esp
6bf: 68 00 02 00 00 push $0x200
6c4: 68 80 8a 00 00 push $0x8a80
6c9: ff 75 ec pushl -0x14(%ebp)
6cc: e8 e9 37 00 00 call 3eba <read>
6d1: 83 c4 10 add $0x10,%esp
6d4: 89 45 f4 mov %eax,-0xc(%ebp)
if(i == 0){
6d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
6db: 75 27 jne 704 <writetest1+0x146>
if(n == MAXFILE - 1){
6dd: 81 7d f0 8b 00 00 00 cmpl $0x8b,-0x10(%ebp)
6e4: 75 7d jne 763 <writetest1+0x1a5>
printf(stdout, "read only %d blocks from big", n);
6e6: a1 8c 62 00 00 mov 0x628c,%eax
6eb: 83 ec 04 sub $0x4,%esp
6ee: ff 75 f0 pushl -0x10(%ebp)
6f1: 68 09 47 00 00 push $0x4709
6f6: 50 push %eax
6f7: e8 1d 39 00 00 call 4019 <printf>
6fc: 83 c4 10 add $0x10,%esp
exit();
6ff: e8 9e 37 00 00 call 3ea2 <exit>
}
break;
} else if(i != 512){
704: 81 7d f4 00 02 00 00 cmpl $0x200,-0xc(%ebp)
70b: 74 1e je 72b <writetest1+0x16d>
printf(stdout, "read failed %d\n", i);
70d: a1 8c 62 00 00 mov 0x628c,%eax
712: 83 ec 04 sub $0x4,%esp
715: ff 75 f4 pushl -0xc(%ebp)
718: 68 26 47 00 00 push $0x4726
71d: 50 push %eax
71e: e8 f6 38 00 00 call 4019 <printf>
723: 83 c4 10 add $0x10,%esp
exit();
726: e8 77 37 00 00 call 3ea2 <exit>
}
if(((int*)buf)[0] != n){
72b: b8 80 8a 00 00 mov $0x8a80,%eax
730: 8b 00 mov (%eax),%eax
732: 3b 45 f0 cmp -0x10(%ebp),%eax
735: 74 23 je 75a <writetest1+0x19c>
printf(stdout, "read content of block %d is %d\n",
n, ((int*)buf)[0]);
737: b8 80 8a 00 00 mov $0x8a80,%eax
} else if(i != 512){
printf(stdout, "read failed %d\n", i);
exit();
}
if(((int*)buf)[0] != n){
printf(stdout, "read content of block %d is %d\n",
73c: 8b 10 mov (%eax),%edx
73e: a1 8c 62 00 00 mov 0x628c,%eax
743: 52 push %edx
744: ff 75 f0 pushl -0x10(%ebp)
747: 68 38 47 00 00 push $0x4738
74c: 50 push %eax
74d: e8 c7 38 00 00 call 4019 <printf>
752: 83 c4 10 add $0x10,%esp
n, ((int*)buf)[0]);
exit();
755: e8 48 37 00 00 call 3ea2 <exit>
}
n++;
75a: 83 45 f0 01 addl $0x1,-0x10(%ebp)
}
75e: e9 59 ff ff ff jmp 6bc <writetest1+0xfe>
if(i == 0){
if(n == MAXFILE - 1){
printf(stdout, "read only %d blocks from big", n);
exit();
}
break;
763: 90 nop
n, ((int*)buf)[0]);
exit();
}
n++;
}
close(fd);
764: 83 ec 0c sub $0xc,%esp
767: ff 75 ec pushl -0x14(%ebp)
76a: e8 5b 37 00 00 call 3eca <close>
76f: 83 c4 10 add $0x10,%esp
if(unlink("big") < 0){
772: 83 ec 0c sub $0xc,%esp
775: 68 b4 46 00 00 push $0x46b4
77a: e8 73 37 00 00 call 3ef2 <unlink>
77f: 83 c4 10 add $0x10,%esp
782: 85 c0 test %eax,%eax
784: 79 1b jns 7a1 <writetest1+0x1e3>
printf(stdout, "unlink big failed\n");
786: a1 8c 62 00 00 mov 0x628c,%eax
78b: 83 ec 08 sub $0x8,%esp
78e: 68 58 47 00 00 push $0x4758
793: 50 push %eax
794: e8 80 38 00 00 call 4019 <printf>
799: 83 c4 10 add $0x10,%esp
exit();
79c: e8 01 37 00 00 call 3ea2 <exit>
}
printf(stdout, "big files ok\n");
7a1: a1 8c 62 00 00 mov 0x628c,%eax
7a6: 83 ec 08 sub $0x8,%esp
7a9: 68 6b 47 00 00 push $0x476b
7ae: 50 push %eax
7af: e8 65 38 00 00 call 4019 <printf>
7b4: 83 c4 10 add $0x10,%esp
}
7b7: 90 nop
7b8: c9 leave
7b9: c3 ret
000007ba <createtest>:
void
createtest(void)
{
7ba: 55 push %ebp
7bb: 89 e5 mov %esp,%ebp
7bd: 83 ec 18 sub $0x18,%esp
int i, fd;
printf(stdout, "many creates, followed by unlink test\n");
7c0: a1 8c 62 00 00 mov 0x628c,%eax
7c5: 83 ec 08 sub $0x8,%esp
7c8: 68 7c 47 00 00 push $0x477c
7cd: 50 push %eax
7ce: e8 46 38 00 00 call 4019 <printf>
7d3: 83 c4 10 add $0x10,%esp
name[0] = 'a';
7d6: c6 05 80 aa 00 00 61 movb $0x61,0xaa80
name[2] = '\0';
7dd: c6 05 82 aa 00 00 00 movb $0x0,0xaa82
for(i = 0; i < 52; i++){
7e4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
7eb: eb 35 jmp 822 <createtest+0x68>
name[1] = '0' + i;
7ed: 8b 45 f4 mov -0xc(%ebp),%eax
7f0: 83 c0 30 add $0x30,%eax
7f3: a2 81 aa 00 00 mov %al,0xaa81
fd = open(name, O_CREATE|O_RDWR);
7f8: 83 ec 08 sub $0x8,%esp
7fb: 68 02 02 00 00 push $0x202
800: 68 80 aa 00 00 push $0xaa80
805: e8 d8 36 00 00 call 3ee2 <open>
80a: 83 c4 10 add $0x10,%esp
80d: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
810: 83 ec 0c sub $0xc,%esp
813: ff 75 f0 pushl -0x10(%ebp)
816: e8 af 36 00 00 call 3eca <close>
81b: 83 c4 10 add $0x10,%esp
printf(stdout, "many creates, followed by unlink test\n");
name[0] = 'a';
name[2] = '\0';
for(i = 0; i < 52; i++){
81e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
822: 83 7d f4 33 cmpl $0x33,-0xc(%ebp)
826: 7e c5 jle 7ed <createtest+0x33>
name[1] = '0' + i;
fd = open(name, O_CREATE|O_RDWR);
close(fd);
}
name[0] = 'a';
828: c6 05 80 aa 00 00 61 movb $0x61,0xaa80
name[2] = '\0';
82f: c6 05 82 aa 00 00 00 movb $0x0,0xaa82
for(i = 0; i < 52; i++){
836: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
83d: eb 1f jmp 85e <createtest+0xa4>
name[1] = '0' + i;
83f: 8b 45 f4 mov -0xc(%ebp),%eax
842: 83 c0 30 add $0x30,%eax
845: a2 81 aa 00 00 mov %al,0xaa81
unlink(name);
84a: 83 ec 0c sub $0xc,%esp
84d: 68 80 aa 00 00 push $0xaa80
852: e8 9b 36 00 00 call 3ef2 <unlink>
857: 83 c4 10 add $0x10,%esp
fd = open(name, O_CREATE|O_RDWR);
close(fd);
}
name[0] = 'a';
name[2] = '\0';
for(i = 0; i < 52; i++){
85a: 83 45 f4 01 addl $0x1,-0xc(%ebp)
85e: 83 7d f4 33 cmpl $0x33,-0xc(%ebp)
862: 7e db jle 83f <createtest+0x85>
name[1] = '0' + i;
unlink(name);
}
printf(stdout, "many creates, followed by unlink; ok\n");
864: a1 8c 62 00 00 mov 0x628c,%eax
869: 83 ec 08 sub $0x8,%esp
86c: 68 a4 47 00 00 push $0x47a4
871: 50 push %eax
872: e8 a2 37 00 00 call 4019 <printf>
877: 83 c4 10 add $0x10,%esp
}
87a: 90 nop
87b: c9 leave
87c: c3 ret
0000087d <dirtest>:
void dirtest(void)
{
87d: 55 push %ebp
87e: 89 e5 mov %esp,%ebp
880: 83 ec 08 sub $0x8,%esp
printf(stdout, "mkdir test\n");
883: a1 8c 62 00 00 mov 0x628c,%eax
888: 83 ec 08 sub $0x8,%esp
88b: 68 ca 47 00 00 push $0x47ca
890: 50 push %eax
891: e8 83 37 00 00 call 4019 <printf>
896: 83 c4 10 add $0x10,%esp
if(mkdir("dir0") < 0){
899: 83 ec 0c sub $0xc,%esp
89c: 68 d6 47 00 00 push $0x47d6
8a1: e8 64 36 00 00 call 3f0a <mkdir>
8a6: 83 c4 10 add $0x10,%esp
8a9: 85 c0 test %eax,%eax
8ab: 79 1b jns 8c8 <dirtest+0x4b>
printf(stdout, "mkdir failed\n");
8ad: a1 8c 62 00 00 mov 0x628c,%eax
8b2: 83 ec 08 sub $0x8,%esp
8b5: 68 f9 43 00 00 push $0x43f9
8ba: 50 push %eax
8bb: e8 59 37 00 00 call 4019 <printf>
8c0: 83 c4 10 add $0x10,%esp
exit();
8c3: e8 da 35 00 00 call 3ea2 <exit>
}
if(chdir("dir0") < 0){
8c8: 83 ec 0c sub $0xc,%esp
8cb: 68 d6 47 00 00 push $0x47d6
8d0: e8 3d 36 00 00 call 3f12 <chdir>
8d5: 83 c4 10 add $0x10,%esp
8d8: 85 c0 test %eax,%eax
8da: 79 1b jns 8f7 <dirtest+0x7a>
printf(stdout, "chdir dir0 failed\n");
8dc: a1 8c 62 00 00 mov 0x628c,%eax
8e1: 83 ec 08 sub $0x8,%esp
8e4: 68 db 47 00 00 push $0x47db
8e9: 50 push %eax
8ea: e8 2a 37 00 00 call 4019 <printf>
8ef: 83 c4 10 add $0x10,%esp
exit();
8f2: e8 ab 35 00 00 call 3ea2 <exit>
}
if(chdir("..") < 0){
8f7: 83 ec 0c sub $0xc,%esp
8fa: 68 ee 47 00 00 push $0x47ee
8ff: e8 0e 36 00 00 call 3f12 <chdir>
904: 83 c4 10 add $0x10,%esp
907: 85 c0 test %eax,%eax
909: 79 1b jns 926 <dirtest+0xa9>
printf(stdout, "chdir .. failed\n");
90b: a1 8c 62 00 00 mov 0x628c,%eax
910: 83 ec 08 sub $0x8,%esp
913: 68 f1 47 00 00 push $0x47f1
918: 50 push %eax
919: e8 fb 36 00 00 call 4019 <printf>
91e: 83 c4 10 add $0x10,%esp
exit();
921: e8 7c 35 00 00 call 3ea2 <exit>
}
if(unlink("dir0") < 0){
926: 83 ec 0c sub $0xc,%esp
929: 68 d6 47 00 00 push $0x47d6
92e: e8 bf 35 00 00 call 3ef2 <unlink>
933: 83 c4 10 add $0x10,%esp
936: 85 c0 test %eax,%eax
938: 79 1b jns 955 <dirtest+0xd8>
printf(stdout, "unlink dir0 failed\n");
93a: a1 8c 62 00 00 mov 0x628c,%eax
93f: 83 ec 08 sub $0x8,%esp
942: 68 02 48 00 00 push $0x4802
947: 50 push %eax
948: e8 cc 36 00 00 call 4019 <printf>
94d: 83 c4 10 add $0x10,%esp
exit();
950: e8 4d 35 00 00 call 3ea2 <exit>
}
printf(stdout, "mkdir test ok\n");
955: a1 8c 62 00 00 mov 0x628c,%eax
95a: 83 ec 08 sub $0x8,%esp
95d: 68 16 48 00 00 push $0x4816
962: 50 push %eax
963: e8 b1 36 00 00 call 4019 <printf>
968: 83 c4 10 add $0x10,%esp
}
96b: 90 nop
96c: c9 leave
96d: c3 ret
0000096e <exectest>:
void
exectest(void)
{
96e: 55 push %ebp
96f: 89 e5 mov %esp,%ebp
971: 83 ec 08 sub $0x8,%esp
printf(stdout, "exec test\n");
974: a1 8c 62 00 00 mov 0x628c,%eax
979: 83 ec 08 sub $0x8,%esp
97c: 68 25 48 00 00 push $0x4825
981: 50 push %eax
982: e8 92 36 00 00 call 4019 <printf>
987: 83 c4 10 add $0x10,%esp
if(exec("echo", echoargv) < 0){
98a: 83 ec 08 sub $0x8,%esp
98d: 68 78 62 00 00 push $0x6278
992: 68 d0 43 00 00 push $0x43d0
997: e8 3e 35 00 00 call 3eda <exec>
99c: 83 c4 10 add $0x10,%esp
99f: 85 c0 test %eax,%eax
9a1: 79 1b jns 9be <exectest+0x50>
printf(stdout, "exec echo failed\n");
9a3: a1 8c 62 00 00 mov 0x628c,%eax
9a8: 83 ec 08 sub $0x8,%esp
9ab: 68 30 48 00 00 push $0x4830
9b0: 50 push %eax
9b1: e8 63 36 00 00 call 4019 <printf>
9b6: 83 c4 10 add $0x10,%esp
exit();
9b9: e8 e4 34 00 00 call 3ea2 <exit>
}
}
9be: 90 nop
9bf: c9 leave
9c0: c3 ret
000009c1 <pipe1>:
// simple fork and pipe read/write
void
pipe1(void)
{
9c1: 55 push %ebp
9c2: 89 e5 mov %esp,%ebp
9c4: 83 ec 28 sub $0x28,%esp
int fds[2], pid;
int seq, i, n, cc, total;
if(pipe(fds) != 0){
9c7: 83 ec 0c sub $0xc,%esp
9ca: 8d 45 d8 lea -0x28(%ebp),%eax
9cd: 50 push %eax
9ce: e8 df 34 00 00 call 3eb2 <pipe>
9d3: 83 c4 10 add $0x10,%esp
9d6: 85 c0 test %eax,%eax
9d8: 74 17 je 9f1 <pipe1+0x30>
printf(1, "pipe() failed\n");
9da: 83 ec 08 sub $0x8,%esp
9dd: 68 42 48 00 00 push $0x4842
9e2: 6a 01 push $0x1
9e4: e8 30 36 00 00 call 4019 <printf>
9e9: 83 c4 10 add $0x10,%esp
exit();
9ec: e8 b1 34 00 00 call 3ea2 <exit>
}
pid = fork();
9f1: e8 a4 34 00 00 call 3e9a <fork>
9f6: 89 45 e0 mov %eax,-0x20(%ebp)
seq = 0;
9f9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if(pid == 0){
a00: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
a04: 0f 85 89 00 00 00 jne a93 <pipe1+0xd2>
close(fds[0]);
a0a: 8b 45 d8 mov -0x28(%ebp),%eax
a0d: 83 ec 0c sub $0xc,%esp
a10: 50 push %eax
a11: e8 b4 34 00 00 call 3eca <close>
a16: 83 c4 10 add $0x10,%esp
for(n = 0; n < 5; n++){
a19: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
a20: eb 66 jmp a88 <pipe1+0xc7>
for(i = 0; i < 1033; i++)
a22: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
a29: eb 19 jmp a44 <pipe1+0x83>
buf[i] = seq++;
a2b: 8b 45 f4 mov -0xc(%ebp),%eax
a2e: 8d 50 01 lea 0x1(%eax),%edx
a31: 89 55 f4 mov %edx,-0xc(%ebp)
a34: 89 c2 mov %eax,%edx
a36: 8b 45 f0 mov -0x10(%ebp),%eax
a39: 05 80 8a 00 00 add $0x8a80,%eax
a3e: 88 10 mov %dl,(%eax)
pid = fork();
seq = 0;
if(pid == 0){
close(fds[0]);
for(n = 0; n < 5; n++){
for(i = 0; i < 1033; i++)
a40: 83 45 f0 01 addl $0x1,-0x10(%ebp)
a44: 81 7d f0 08 04 00 00 cmpl $0x408,-0x10(%ebp)
a4b: 7e de jle a2b <pipe1+0x6a>
buf[i] = seq++;
if(write(fds[1], buf, 1033) != 1033){
a4d: 8b 45 dc mov -0x24(%ebp),%eax
a50: 83 ec 04 sub $0x4,%esp
a53: 68 09 04 00 00 push $0x409
a58: 68 80 8a 00 00 push $0x8a80
a5d: 50 push %eax
a5e: e8 5f 34 00 00 call 3ec2 <write>
a63: 83 c4 10 add $0x10,%esp
a66: 3d 09 04 00 00 cmp $0x409,%eax
a6b: 74 17 je a84 <pipe1+0xc3>
printf(1, "pipe1 oops 1\n");
a6d: 83 ec 08 sub $0x8,%esp
a70: 68 51 48 00 00 push $0x4851
a75: 6a 01 push $0x1
a77: e8 9d 35 00 00 call 4019 <printf>
a7c: 83 c4 10 add $0x10,%esp
exit();
a7f: e8 1e 34 00 00 call 3ea2 <exit>
}
pid = fork();
seq = 0;
if(pid == 0){
close(fds[0]);
for(n = 0; n < 5; n++){
a84: 83 45 ec 01 addl $0x1,-0x14(%ebp)
a88: 83 7d ec 04 cmpl $0x4,-0x14(%ebp)
a8c: 7e 94 jle a22 <pipe1+0x61>
if(write(fds[1], buf, 1033) != 1033){
printf(1, "pipe1 oops 1\n");
exit();
}
}
exit();
a8e: e8 0f 34 00 00 call 3ea2 <exit>
} else if(pid > 0){
a93: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
a97: 0f 8e f4 00 00 00 jle b91 <pipe1+0x1d0>
close(fds[1]);
a9d: 8b 45 dc mov -0x24(%ebp),%eax
aa0: 83 ec 0c sub $0xc,%esp
aa3: 50 push %eax
aa4: e8 21 34 00 00 call 3eca <close>
aa9: 83 c4 10 add $0x10,%esp
total = 0;
aac: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
cc = 1;
ab3: c7 45 e8 01 00 00 00 movl $0x1,-0x18(%ebp)
while((n = read(fds[0], buf, cc)) > 0){
aba: eb 66 jmp b22 <pipe1+0x161>
for(i = 0; i < n; i++){
abc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
ac3: eb 3b jmp b00 <pipe1+0x13f>
if((buf[i] & 0xff) != (seq++ & 0xff)){
ac5: 8b 45 f0 mov -0x10(%ebp),%eax
ac8: 05 80 8a 00 00 add $0x8a80,%eax
acd: 0f b6 00 movzbl (%eax),%eax
ad0: 0f be c8 movsbl %al,%ecx
ad3: 8b 45 f4 mov -0xc(%ebp),%eax
ad6: 8d 50 01 lea 0x1(%eax),%edx
ad9: 89 55 f4 mov %edx,-0xc(%ebp)
adc: 31 c8 xor %ecx,%eax
ade: 0f b6 c0 movzbl %al,%eax
ae1: 85 c0 test %eax,%eax
ae3: 74 17 je afc <pipe1+0x13b>
printf(1, "pipe1 oops 2\n");
ae5: 83 ec 08 sub $0x8,%esp
ae8: 68 5f 48 00 00 push $0x485f
aed: 6a 01 push $0x1
aef: e8 25 35 00 00 call 4019 <printf>
af4: 83 c4 10 add $0x10,%esp
af7: e9 ac 00 00 00 jmp ba8 <pipe1+0x1e7>
} else if(pid > 0){
close(fds[1]);
total = 0;
cc = 1;
while((n = read(fds[0], buf, cc)) > 0){
for(i = 0; i < n; i++){
afc: 83 45 f0 01 addl $0x1,-0x10(%ebp)
b00: 8b 45 f0 mov -0x10(%ebp),%eax
b03: 3b 45 ec cmp -0x14(%ebp),%eax
b06: 7c bd jl ac5 <pipe1+0x104>
if((buf[i] & 0xff) != (seq++ & 0xff)){
printf(1, "pipe1 oops 2\n");
return;
}
}
total += n;
b08: 8b 45 ec mov -0x14(%ebp),%eax
b0b: 01 45 e4 add %eax,-0x1c(%ebp)
cc = cc * 2;
b0e: d1 65 e8 shll -0x18(%ebp)
if(cc > sizeof(buf))
b11: 8b 45 e8 mov -0x18(%ebp),%eax
b14: 3d 00 20 00 00 cmp $0x2000,%eax
b19: 76 07 jbe b22 <pipe1+0x161>
cc = sizeof(buf);
b1b: c7 45 e8 00 20 00 00 movl $0x2000,-0x18(%ebp)
exit();
} else if(pid > 0){
close(fds[1]);
total = 0;
cc = 1;
while((n = read(fds[0], buf, cc)) > 0){
b22: 8b 45 d8 mov -0x28(%ebp),%eax
b25: 83 ec 04 sub $0x4,%esp
b28: ff 75 e8 pushl -0x18(%ebp)
b2b: 68 80 8a 00 00 push $0x8a80
b30: 50 push %eax
b31: e8 84 33 00 00 call 3eba <read>
b36: 83 c4 10 add $0x10,%esp
b39: 89 45 ec mov %eax,-0x14(%ebp)
b3c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
b40: 0f 8f 76 ff ff ff jg abc <pipe1+0xfb>
total += n;
cc = cc * 2;
if(cc > sizeof(buf))
cc = sizeof(buf);
}
if(total != 5 * 1033){
b46: 81 7d e4 2d 14 00 00 cmpl $0x142d,-0x1c(%ebp)
b4d: 74 1a je b69 <pipe1+0x1a8>
printf(1, "pipe1 oops 3 total %d\n", total);
b4f: 83 ec 04 sub $0x4,%esp
b52: ff 75 e4 pushl -0x1c(%ebp)
b55: 68 6d 48 00 00 push $0x486d
b5a: 6a 01 push $0x1
b5c: e8 b8 34 00 00 call 4019 <printf>
b61: 83 c4 10 add $0x10,%esp
exit();
b64: e8 39 33 00 00 call 3ea2 <exit>
}
close(fds[0]);
b69: 8b 45 d8 mov -0x28(%ebp),%eax
b6c: 83 ec 0c sub $0xc,%esp
b6f: 50 push %eax
b70: e8 55 33 00 00 call 3eca <close>
b75: 83 c4 10 add $0x10,%esp
wait();
b78: e8 2d 33 00 00 call 3eaa <wait>
} else {
printf(1, "fork() failed\n");
exit();
}
printf(1, "pipe1 ok\n");
b7d: 83 ec 08 sub $0x8,%esp
b80: 68 93 48 00 00 push $0x4893
b85: 6a 01 push $0x1
b87: e8 8d 34 00 00 call 4019 <printf>
b8c: 83 c4 10 add $0x10,%esp
b8f: eb 17 jmp ba8 <pipe1+0x1e7>
exit();
}
close(fds[0]);
wait();
} else {
printf(1, "fork() failed\n");
b91: 83 ec 08 sub $0x8,%esp
b94: 68 84 48 00 00 push $0x4884
b99: 6a 01 push $0x1
b9b: e8 79 34 00 00 call 4019 <printf>
ba0: 83 c4 10 add $0x10,%esp
exit();
ba3: e8 fa 32 00 00 call 3ea2 <exit>
}
printf(1, "pipe1 ok\n");
}
ba8: c9 leave
ba9: c3 ret
00000baa <preempt>:
// meant to be run w/ at most two CPUs
void
preempt(void)
{
baa: 55 push %ebp
bab: 89 e5 mov %esp,%ebp
bad: 83 ec 28 sub $0x28,%esp
int pid1, pid2, pid3;
int pfds[2];
printf(1, "preempt: ");
bb0: 83 ec 08 sub $0x8,%esp
bb3: 68 9d 48 00 00 push $0x489d
bb8: 6a 01 push $0x1
bba: e8 5a 34 00 00 call 4019 <printf>
bbf: 83 c4 10 add $0x10,%esp
pid1 = fork();
bc2: e8 d3 32 00 00 call 3e9a <fork>
bc7: 89 45 f4 mov %eax,-0xc(%ebp)
if(pid1 == 0)
bca: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
bce: 75 02 jne bd2 <preempt+0x28>
for(;;)
;
bd0: eb fe jmp bd0 <preempt+0x26>
pid2 = fork();
bd2: e8 c3 32 00 00 call 3e9a <fork>
bd7: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid2 == 0)
bda: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
bde: 75 02 jne be2 <preempt+0x38>
for(;;)
;
be0: eb fe jmp be0 <preempt+0x36>
pipe(pfds);
be2: 83 ec 0c sub $0xc,%esp
be5: 8d 45 e4 lea -0x1c(%ebp),%eax
be8: 50 push %eax
be9: e8 c4 32 00 00 call 3eb2 <pipe>
bee: 83 c4 10 add $0x10,%esp
pid3 = fork();
bf1: e8 a4 32 00 00 call 3e9a <fork>
bf6: 89 45 ec mov %eax,-0x14(%ebp)
if(pid3 == 0){
bf9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
bfd: 75 4d jne c4c <preempt+0xa2>
close(pfds[0]);
bff: 8b 45 e4 mov -0x1c(%ebp),%eax
c02: 83 ec 0c sub $0xc,%esp
c05: 50 push %eax
c06: e8 bf 32 00 00 call 3eca <close>
c0b: 83 c4 10 add $0x10,%esp
if(write(pfds[1], "x", 1) != 1)
c0e: 8b 45 e8 mov -0x18(%ebp),%eax
c11: 83 ec 04 sub $0x4,%esp
c14: 6a 01 push $0x1
c16: 68 a7 48 00 00 push $0x48a7
c1b: 50 push %eax
c1c: e8 a1 32 00 00 call 3ec2 <write>
c21: 83 c4 10 add $0x10,%esp
c24: 83 f8 01 cmp $0x1,%eax
c27: 74 12 je c3b <preempt+0x91>
printf(1, "preempt write error");
c29: 83 ec 08 sub $0x8,%esp
c2c: 68 a9 48 00 00 push $0x48a9
c31: 6a 01 push $0x1
c33: e8 e1 33 00 00 call 4019 <printf>
c38: 83 c4 10 add $0x10,%esp
close(pfds[1]);
c3b: 8b 45 e8 mov -0x18(%ebp),%eax
c3e: 83 ec 0c sub $0xc,%esp
c41: 50 push %eax
c42: e8 83 32 00 00 call 3eca <close>
c47: 83 c4 10 add $0x10,%esp
for(;;)
;
c4a: eb fe jmp c4a <preempt+0xa0>
}
close(pfds[1]);
c4c: 8b 45 e8 mov -0x18(%ebp),%eax
c4f: 83 ec 0c sub $0xc,%esp
c52: 50 push %eax
c53: e8 72 32 00 00 call 3eca <close>
c58: 83 c4 10 add $0x10,%esp
if(read(pfds[0], buf, sizeof(buf)) != 1){
c5b: 8b 45 e4 mov -0x1c(%ebp),%eax
c5e: 83 ec 04 sub $0x4,%esp
c61: 68 00 20 00 00 push $0x2000
c66: 68 80 8a 00 00 push $0x8a80
c6b: 50 push %eax
c6c: e8 49 32 00 00 call 3eba <read>
c71: 83 c4 10 add $0x10,%esp
c74: 83 f8 01 cmp $0x1,%eax
c77: 74 14 je c8d <preempt+0xe3>
printf(1, "preempt read error");
c79: 83 ec 08 sub $0x8,%esp
c7c: 68 bd 48 00 00 push $0x48bd
c81: 6a 01 push $0x1
c83: e8 91 33 00 00 call 4019 <printf>
c88: 83 c4 10 add $0x10,%esp
c8b: eb 7e jmp d0b <preempt+0x161>
return;
}
close(pfds[0]);
c8d: 8b 45 e4 mov -0x1c(%ebp),%eax
c90: 83 ec 0c sub $0xc,%esp
c93: 50 push %eax
c94: e8 31 32 00 00 call 3eca <close>
c99: 83 c4 10 add $0x10,%esp
printf(1, "kill... ");
c9c: 83 ec 08 sub $0x8,%esp
c9f: 68 d0 48 00 00 push $0x48d0
ca4: 6a 01 push $0x1
ca6: e8 6e 33 00 00 call 4019 <printf>
cab: 83 c4 10 add $0x10,%esp
kill(pid1);
cae: 83 ec 0c sub $0xc,%esp
cb1: ff 75 f4 pushl -0xc(%ebp)
cb4: e8 19 32 00 00 call 3ed2 <kill>
cb9: 83 c4 10 add $0x10,%esp
kill(pid2);
cbc: 83 ec 0c sub $0xc,%esp
cbf: ff 75 f0 pushl -0x10(%ebp)
cc2: e8 0b 32 00 00 call 3ed2 <kill>
cc7: 83 c4 10 add $0x10,%esp
kill(pid3);
cca: 83 ec 0c sub $0xc,%esp
ccd: ff 75 ec pushl -0x14(%ebp)
cd0: e8 fd 31 00 00 call 3ed2 <kill>
cd5: 83 c4 10 add $0x10,%esp
printf(1, "wait... ");
cd8: 83 ec 08 sub $0x8,%esp
cdb: 68 d9 48 00 00 push $0x48d9
ce0: 6a 01 push $0x1
ce2: e8 32 33 00 00 call 4019 <printf>
ce7: 83 c4 10 add $0x10,%esp
wait();
cea: e8 bb 31 00 00 call 3eaa <wait>
wait();
cef: e8 b6 31 00 00 call 3eaa <wait>
wait();
cf4: e8 b1 31 00 00 call 3eaa <wait>
printf(1, "preempt ok\n");
cf9: 83 ec 08 sub $0x8,%esp
cfc: 68 e2 48 00 00 push $0x48e2
d01: 6a 01 push $0x1
d03: e8 11 33 00 00 call 4019 <printf>
d08: 83 c4 10 add $0x10,%esp
}
d0b: c9 leave
d0c: c3 ret
00000d0d <exitwait>:
// try to find any races between exit and wait
void
exitwait(void)
{
d0d: 55 push %ebp
d0e: 89 e5 mov %esp,%ebp
d10: 83 ec 18 sub $0x18,%esp
int i, pid;
for(i = 0; i < 100; i++){
d13: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
d1a: eb 4f jmp d6b <exitwait+0x5e>
pid = fork();
d1c: e8 79 31 00 00 call 3e9a <fork>
d21: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0){
d24: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
d28: 79 14 jns d3e <exitwait+0x31>
printf(1, "fork failed\n");
d2a: 83 ec 08 sub $0x8,%esp
d2d: 68 71 44 00 00 push $0x4471
d32: 6a 01 push $0x1
d34: e8 e0 32 00 00 call 4019 <printf>
d39: 83 c4 10 add $0x10,%esp
return;
d3c: eb 45 jmp d83 <exitwait+0x76>
}
if(pid){
d3e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
d42: 74 1e je d62 <exitwait+0x55>
if(wait() != pid){
d44: e8 61 31 00 00 call 3eaa <wait>
d49: 3b 45 f0 cmp -0x10(%ebp),%eax
d4c: 74 19 je d67 <exitwait+0x5a>
printf(1, "wait wrong pid\n");
d4e: 83 ec 08 sub $0x8,%esp
d51: 68 ee 48 00 00 push $0x48ee
d56: 6a 01 push $0x1
d58: e8 bc 32 00 00 call 4019 <printf>
d5d: 83 c4 10 add $0x10,%esp
return;
d60: eb 21 jmp d83 <exitwait+0x76>
}
} else {
exit();
d62: e8 3b 31 00 00 call 3ea2 <exit>
void
exitwait(void)
{
int i, pid;
for(i = 0; i < 100; i++){
d67: 83 45 f4 01 addl $0x1,-0xc(%ebp)
d6b: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
d6f: 7e ab jle d1c <exitwait+0xf>
}
} else {
exit();
}
}
printf(1, "exitwait ok\n");
d71: 83 ec 08 sub $0x8,%esp
d74: 68 fe 48 00 00 push $0x48fe
d79: 6a 01 push $0x1
d7b: e8 99 32 00 00 call 4019 <printf>
d80: 83 c4 10 add $0x10,%esp
}
d83: c9 leave
d84: c3 ret
00000d85 <mem>:
void
mem(void)
{
d85: 55 push %ebp
d86: 89 e5 mov %esp,%ebp
d88: 83 ec 18 sub $0x18,%esp
void *m1, *m2;
int pid, ppid;
printf(1, "mem test\n");
d8b: 83 ec 08 sub $0x8,%esp
d8e: 68 0b 49 00 00 push $0x490b
d93: 6a 01 push $0x1
d95: e8 7f 32 00 00 call 4019 <printf>
d9a: 83 c4 10 add $0x10,%esp
ppid = getpid();
d9d: e8 80 31 00 00 call 3f22 <getpid>
da2: 89 45 f0 mov %eax,-0x10(%ebp)
if((pid = fork()) == 0){
da5: e8 f0 30 00 00 call 3e9a <fork>
daa: 89 45 ec mov %eax,-0x14(%ebp)
dad: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
db1: 0f 85 b7 00 00 00 jne e6e <mem+0xe9>
m1 = 0;
db7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while((m2 = malloc(10001)) != 0){
dbe: eb 0e jmp dce <mem+0x49>
*(char**)m2 = m1;
dc0: 8b 45 e8 mov -0x18(%ebp),%eax
dc3: 8b 55 f4 mov -0xc(%ebp),%edx
dc6: 89 10 mov %edx,(%eax)
m1 = m2;
dc8: 8b 45 e8 mov -0x18(%ebp),%eax
dcb: 89 45 f4 mov %eax,-0xc(%ebp)
printf(1, "mem test\n");
ppid = getpid();
if((pid = fork()) == 0){
m1 = 0;
while((m2 = malloc(10001)) != 0){
dce: 83 ec 0c sub $0xc,%esp
dd1: 68 11 27 00 00 push $0x2711
dd6: e8 11 35 00 00 call 42ec <malloc>
ddb: 83 c4 10 add $0x10,%esp
dde: 89 45 e8 mov %eax,-0x18(%ebp)
de1: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
de5: 75 d9 jne dc0 <mem+0x3b>
*(char**)m2 = m1;
m1 = m2;
}
while(m1){
de7: eb 1c jmp e05 <mem+0x80>
m2 = *(char**)m1;
de9: 8b 45 f4 mov -0xc(%ebp),%eax
dec: 8b 00 mov (%eax),%eax
dee: 89 45 e8 mov %eax,-0x18(%ebp)
free(m1);
df1: 83 ec 0c sub $0xc,%esp
df4: ff 75 f4 pushl -0xc(%ebp)
df7: e8 ae 33 00 00 call 41aa <free>
dfc: 83 c4 10 add $0x10,%esp
m1 = m2;
dff: 8b 45 e8 mov -0x18(%ebp),%eax
e02: 89 45 f4 mov %eax,-0xc(%ebp)
m1 = 0;
while((m2 = malloc(10001)) != 0){
*(char**)m2 = m1;
m1 = m2;
}
while(m1){
e05: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
e09: 75 de jne de9 <mem+0x64>
m2 = *(char**)m1;
free(m1);
m1 = m2;
}
m1 = malloc(1024*20);
e0b: 83 ec 0c sub $0xc,%esp
e0e: 68 00 50 00 00 push $0x5000
e13: e8 d4 34 00 00 call 42ec <malloc>
e18: 83 c4 10 add $0x10,%esp
e1b: 89 45 f4 mov %eax,-0xc(%ebp)
if(m1 == 0){
e1e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
e22: 75 25 jne e49 <mem+0xc4>
printf(1, "couldn't allocate mem?!!\n");
e24: 83 ec 08 sub $0x8,%esp
e27: 68 15 49 00 00 push $0x4915
e2c: 6a 01 push $0x1
e2e: e8 e6 31 00 00 call 4019 <printf>
e33: 83 c4 10 add $0x10,%esp
kill(ppid);
e36: 83 ec 0c sub $0xc,%esp
e39: ff 75 f0 pushl -0x10(%ebp)
e3c: e8 91 30 00 00 call 3ed2 <kill>
e41: 83 c4 10 add $0x10,%esp
exit();
e44: e8 59 30 00 00 call 3ea2 <exit>
}
free(m1);
e49: 83 ec 0c sub $0xc,%esp
e4c: ff 75 f4 pushl -0xc(%ebp)
e4f: e8 56 33 00 00 call 41aa <free>
e54: 83 c4 10 add $0x10,%esp
printf(1, "mem ok\n");
e57: 83 ec 08 sub $0x8,%esp
e5a: 68 2f 49 00 00 push $0x492f
e5f: 6a 01 push $0x1
e61: e8 b3 31 00 00 call 4019 <printf>
e66: 83 c4 10 add $0x10,%esp
exit();
e69: e8 34 30 00 00 call 3ea2 <exit>
} else {
wait();
e6e: e8 37 30 00 00 call 3eaa <wait>
}
}
e73: 90 nop
e74: c9 leave
e75: c3 ret
00000e76 <sharedfd>:
// two processes write to the same file descriptor
// is the offset shared? does inode locking work?
void
sharedfd(void)
{
e76: 55 push %ebp
e77: 89 e5 mov %esp,%ebp
e79: 83 ec 38 sub $0x38,%esp
int fd, pid, i, n, nc, np;
char buf[10];
printf(1, "sharedfd test\n");
e7c: 83 ec 08 sub $0x8,%esp
e7f: 68 37 49 00 00 push $0x4937
e84: 6a 01 push $0x1
e86: e8 8e 31 00 00 call 4019 <printf>
e8b: 83 c4 10 add $0x10,%esp
unlink("sharedfd");
e8e: 83 ec 0c sub $0xc,%esp
e91: 68 46 49 00 00 push $0x4946
e96: e8 57 30 00 00 call 3ef2 <unlink>
e9b: 83 c4 10 add $0x10,%esp
fd = open("sharedfd", O_CREATE|O_RDWR);
e9e: 83 ec 08 sub $0x8,%esp
ea1: 68 02 02 00 00 push $0x202
ea6: 68 46 49 00 00 push $0x4946
eab: e8 32 30 00 00 call 3ee2 <open>
eb0: 83 c4 10 add $0x10,%esp
eb3: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
eb6: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
eba: 79 17 jns ed3 <sharedfd+0x5d>
printf(1, "fstests: cannot open sharedfd for writing");
ebc: 83 ec 08 sub $0x8,%esp
ebf: 68 50 49 00 00 push $0x4950
ec4: 6a 01 push $0x1
ec6: e8 4e 31 00 00 call 4019 <printf>
ecb: 83 c4 10 add $0x10,%esp
return;
ece: e9 84 01 00 00 jmp 1057 <sharedfd+0x1e1>
}
pid = fork();
ed3: e8 c2 2f 00 00 call 3e9a <fork>
ed8: 89 45 e4 mov %eax,-0x1c(%ebp)
memset(buf, pid==0?'c':'p', sizeof(buf));
edb: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
edf: 75 07 jne ee8 <sharedfd+0x72>
ee1: b8 63 00 00 00 mov $0x63,%eax
ee6: eb 05 jmp eed <sharedfd+0x77>
ee8: b8 70 00 00 00 mov $0x70,%eax
eed: 83 ec 04 sub $0x4,%esp
ef0: 6a 0a push $0xa
ef2: 50 push %eax
ef3: 8d 45 d6 lea -0x2a(%ebp),%eax
ef6: 50 push %eax
ef7: e8 0b 2e 00 00 call 3d07 <memset>
efc: 83 c4 10 add $0x10,%esp
for(i = 0; i < 1000; i++){
eff: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
f06: eb 31 jmp f39 <sharedfd+0xc3>
if(write(fd, buf, sizeof(buf)) != sizeof(buf)){
f08: 83 ec 04 sub $0x4,%esp
f0b: 6a 0a push $0xa
f0d: 8d 45 d6 lea -0x2a(%ebp),%eax
f10: 50 push %eax
f11: ff 75 e8 pushl -0x18(%ebp)
f14: e8 a9 2f 00 00 call 3ec2 <write>
f19: 83 c4 10 add $0x10,%esp
f1c: 83 f8 0a cmp $0xa,%eax
f1f: 74 14 je f35 <sharedfd+0xbf>
printf(1, "fstests: write sharedfd failed\n");
f21: 83 ec 08 sub $0x8,%esp
f24: 68 7c 49 00 00 push $0x497c
f29: 6a 01 push $0x1
f2b: e8 e9 30 00 00 call 4019 <printf>
f30: 83 c4 10 add $0x10,%esp
break;
f33: eb 0d jmp f42 <sharedfd+0xcc>
printf(1, "fstests: cannot open sharedfd for writing");
return;
}
pid = fork();
memset(buf, pid==0?'c':'p', sizeof(buf));
for(i = 0; i < 1000; i++){
f35: 83 45 f4 01 addl $0x1,-0xc(%ebp)
f39: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
f40: 7e c6 jle f08 <sharedfd+0x92>
if(write(fd, buf, sizeof(buf)) != sizeof(buf)){
printf(1, "fstests: write sharedfd failed\n");
break;
}
}
if(pid == 0)
f42: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
f46: 75 05 jne f4d <sharedfd+0xd7>
exit();
f48: e8 55 2f 00 00 call 3ea2 <exit>
else
wait();
f4d: e8 58 2f 00 00 call 3eaa <wait>
close(fd);
f52: 83 ec 0c sub $0xc,%esp
f55: ff 75 e8 pushl -0x18(%ebp)
f58: e8 6d 2f 00 00 call 3eca <close>
f5d: 83 c4 10 add $0x10,%esp
fd = open("sharedfd", 0);
f60: 83 ec 08 sub $0x8,%esp
f63: 6a 00 push $0x0
f65: 68 46 49 00 00 push $0x4946
f6a: e8 73 2f 00 00 call 3ee2 <open>
f6f: 83 c4 10 add $0x10,%esp
f72: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
f75: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
f79: 79 17 jns f92 <sharedfd+0x11c>
printf(1, "fstests: cannot open sharedfd for reading\n");
f7b: 83 ec 08 sub $0x8,%esp
f7e: 68 9c 49 00 00 push $0x499c
f83: 6a 01 push $0x1
f85: e8 8f 30 00 00 call 4019 <printf>
f8a: 83 c4 10 add $0x10,%esp
return;
f8d: e9 c5 00 00 00 jmp 1057 <sharedfd+0x1e1>
}
nc = np = 0;
f92: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
f99: 8b 45 ec mov -0x14(%ebp),%eax
f9c: 89 45 f0 mov %eax,-0x10(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
f9f: eb 3b jmp fdc <sharedfd+0x166>
for(i = 0; i < sizeof(buf); i++){
fa1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
fa8: eb 2a jmp fd4 <sharedfd+0x15e>
if(buf[i] == 'c')
faa: 8d 55 d6 lea -0x2a(%ebp),%edx
fad: 8b 45 f4 mov -0xc(%ebp),%eax
fb0: 01 d0 add %edx,%eax
fb2: 0f b6 00 movzbl (%eax),%eax
fb5: 3c 63 cmp $0x63,%al
fb7: 75 04 jne fbd <sharedfd+0x147>
nc++;
fb9: 83 45 f0 01 addl $0x1,-0x10(%ebp)
if(buf[i] == 'p')
fbd: 8d 55 d6 lea -0x2a(%ebp),%edx
fc0: 8b 45 f4 mov -0xc(%ebp),%eax
fc3: 01 d0 add %edx,%eax
fc5: 0f b6 00 movzbl (%eax),%eax
fc8: 3c 70 cmp $0x70,%al
fca: 75 04 jne fd0 <sharedfd+0x15a>
np++;
fcc: 83 45 ec 01 addl $0x1,-0x14(%ebp)
printf(1, "fstests: cannot open sharedfd for reading\n");
return;
}
nc = np = 0;
while((n = read(fd, buf, sizeof(buf))) > 0){
for(i = 0; i < sizeof(buf); i++){
fd0: 83 45 f4 01 addl $0x1,-0xc(%ebp)
fd4: 8b 45 f4 mov -0xc(%ebp),%eax
fd7: 83 f8 09 cmp $0x9,%eax
fda: 76 ce jbe faa <sharedfd+0x134>
if(fd < 0){
printf(1, "fstests: cannot open sharedfd for reading\n");
return;
}
nc = np = 0;
while((n = read(fd, buf, sizeof(buf))) > 0){
fdc: 83 ec 04 sub $0x4,%esp
fdf: 6a 0a push $0xa
fe1: 8d 45 d6 lea -0x2a(%ebp),%eax
fe4: 50 push %eax
fe5: ff 75 e8 pushl -0x18(%ebp)
fe8: e8 cd 2e 00 00 call 3eba <read>
fed: 83 c4 10 add $0x10,%esp
ff0: 89 45 e0 mov %eax,-0x20(%ebp)
ff3: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
ff7: 7f a8 jg fa1 <sharedfd+0x12b>
nc++;
if(buf[i] == 'p')
np++;
}
}
close(fd);
ff9: 83 ec 0c sub $0xc,%esp
ffc: ff 75 e8 pushl -0x18(%ebp)
fff: e8 c6 2e 00 00 call 3eca <close>
1004: 83 c4 10 add $0x10,%esp
unlink("sharedfd");
1007: 83 ec 0c sub $0xc,%esp
100a: 68 46 49 00 00 push $0x4946
100f: e8 de 2e 00 00 call 3ef2 <unlink>
1014: 83 c4 10 add $0x10,%esp
if(nc == 10000 && np == 10000){
1017: 81 7d f0 10 27 00 00 cmpl $0x2710,-0x10(%ebp)
101e: 75 1d jne 103d <sharedfd+0x1c7>
1020: 81 7d ec 10 27 00 00 cmpl $0x2710,-0x14(%ebp)
1027: 75 14 jne 103d <sharedfd+0x1c7>
printf(1, "sharedfd ok\n");
1029: 83 ec 08 sub $0x8,%esp
102c: 68 c7 49 00 00 push $0x49c7
1031: 6a 01 push $0x1
1033: e8 e1 2f 00 00 call 4019 <printf>
1038: 83 c4 10 add $0x10,%esp
103b: eb 1a jmp 1057 <sharedfd+0x1e1>
} else {
printf(1, "sharedfd oops %d %d\n", nc, np);
103d: ff 75 ec pushl -0x14(%ebp)
1040: ff 75 f0 pushl -0x10(%ebp)
1043: 68 d4 49 00 00 push $0x49d4
1048: 6a 01 push $0x1
104a: e8 ca 2f 00 00 call 4019 <printf>
104f: 83 c4 10 add $0x10,%esp
exit();
1052: e8 4b 2e 00 00 call 3ea2 <exit>
}
}
1057: c9 leave
1058: c3 ret
00001059 <fourfiles>:
// four processes write different files at the same
// time, to test block allocation.
void
fourfiles(void)
{
1059: 55 push %ebp
105a: 89 e5 mov %esp,%ebp
105c: 83 ec 38 sub $0x38,%esp
int fd, pid, i, j, n, total, pi;
char *names[] = { "f0", "f1", "f2", "f3" };
105f: c7 45 c8 e9 49 00 00 movl $0x49e9,-0x38(%ebp)
1066: c7 45 cc ec 49 00 00 movl $0x49ec,-0x34(%ebp)
106d: c7 45 d0 ef 49 00 00 movl $0x49ef,-0x30(%ebp)
1074: c7 45 d4 f2 49 00 00 movl $0x49f2,-0x2c(%ebp)
char *fname;
printf(1, "fourfiles test\n");
107b: 83 ec 08 sub $0x8,%esp
107e: 68 f5 49 00 00 push $0x49f5
1083: 6a 01 push $0x1
1085: e8 8f 2f 00 00 call 4019 <printf>
108a: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
108d: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
1094: e9 f0 00 00 00 jmp 1189 <fourfiles+0x130>
fname = names[pi];
1099: 8b 45 e8 mov -0x18(%ebp),%eax
109c: 8b 44 85 c8 mov -0x38(%ebp,%eax,4),%eax
10a0: 89 45 e4 mov %eax,-0x1c(%ebp)
unlink(fname);
10a3: 83 ec 0c sub $0xc,%esp
10a6: ff 75 e4 pushl -0x1c(%ebp)
10a9: e8 44 2e 00 00 call 3ef2 <unlink>
10ae: 83 c4 10 add $0x10,%esp
pid = fork();
10b1: e8 e4 2d 00 00 call 3e9a <fork>
10b6: 89 45 e0 mov %eax,-0x20(%ebp)
if(pid < 0){
10b9: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
10bd: 79 17 jns 10d6 <fourfiles+0x7d>
printf(1, "fork failed\n");
10bf: 83 ec 08 sub $0x8,%esp
10c2: 68 71 44 00 00 push $0x4471
10c7: 6a 01 push $0x1
10c9: e8 4b 2f 00 00 call 4019 <printf>
10ce: 83 c4 10 add $0x10,%esp
exit();
10d1: e8 cc 2d 00 00 call 3ea2 <exit>
}
if(pid == 0){
10d6: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
10da: 0f 85 a5 00 00 00 jne 1185 <fourfiles+0x12c>
fd = open(fname, O_CREATE | O_RDWR);
10e0: 83 ec 08 sub $0x8,%esp
10e3: 68 02 02 00 00 push $0x202
10e8: ff 75 e4 pushl -0x1c(%ebp)
10eb: e8 f2 2d 00 00 call 3ee2 <open>
10f0: 83 c4 10 add $0x10,%esp
10f3: 89 45 dc mov %eax,-0x24(%ebp)
if(fd < 0){
10f6: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
10fa: 79 17 jns 1113 <fourfiles+0xba>
printf(1, "create failed\n");
10fc: 83 ec 08 sub $0x8,%esp
10ff: 68 05 4a 00 00 push $0x4a05
1104: 6a 01 push $0x1
1106: e8 0e 2f 00 00 call 4019 <printf>
110b: 83 c4 10 add $0x10,%esp
exit();
110e: e8 8f 2d 00 00 call 3ea2 <exit>
}
memset(buf, '0'+pi, 512);
1113: 8b 45 e8 mov -0x18(%ebp),%eax
1116: 83 c0 30 add $0x30,%eax
1119: 83 ec 04 sub $0x4,%esp
111c: 68 00 02 00 00 push $0x200
1121: 50 push %eax
1122: 68 80 8a 00 00 push $0x8a80
1127: e8 db 2b 00 00 call 3d07 <memset>
112c: 83 c4 10 add $0x10,%esp
for(i = 0; i < 12; i++){
112f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1136: eb 42 jmp 117a <fourfiles+0x121>
if((n = write(fd, buf, 500)) != 500){
1138: 83 ec 04 sub $0x4,%esp
113b: 68 f4 01 00 00 push $0x1f4
1140: 68 80 8a 00 00 push $0x8a80
1145: ff 75 dc pushl -0x24(%ebp)
1148: e8 75 2d 00 00 call 3ec2 <write>
114d: 83 c4 10 add $0x10,%esp
1150: 89 45 d8 mov %eax,-0x28(%ebp)
1153: 81 7d d8 f4 01 00 00 cmpl $0x1f4,-0x28(%ebp)
115a: 74 1a je 1176 <fourfiles+0x11d>
printf(1, "write failed %d\n", n);
115c: 83 ec 04 sub $0x4,%esp
115f: ff 75 d8 pushl -0x28(%ebp)
1162: 68 14 4a 00 00 push $0x4a14
1167: 6a 01 push $0x1
1169: e8 ab 2e 00 00 call 4019 <printf>
116e: 83 c4 10 add $0x10,%esp
exit();
1171: e8 2c 2d 00 00 call 3ea2 <exit>
printf(1, "create failed\n");
exit();
}
memset(buf, '0'+pi, 512);
for(i = 0; i < 12; i++){
1176: 83 45 f4 01 addl $0x1,-0xc(%ebp)
117a: 83 7d f4 0b cmpl $0xb,-0xc(%ebp)
117e: 7e b8 jle 1138 <fourfiles+0xdf>
if((n = write(fd, buf, 500)) != 500){
printf(1, "write failed %d\n", n);
exit();
}
}
exit();
1180: e8 1d 2d 00 00 call 3ea2 <exit>
char *names[] = { "f0", "f1", "f2", "f3" };
char *fname;
printf(1, "fourfiles test\n");
for(pi = 0; pi < 4; pi++){
1185: 83 45 e8 01 addl $0x1,-0x18(%ebp)
1189: 83 7d e8 03 cmpl $0x3,-0x18(%ebp)
118d: 0f 8e 06 ff ff ff jle 1099 <fourfiles+0x40>
}
exit();
}
}
for(pi = 0; pi < 4; pi++){
1193: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
119a: eb 09 jmp 11a5 <fourfiles+0x14c>
wait();
119c: e8 09 2d 00 00 call 3eaa <wait>
}
exit();
}
}
for(pi = 0; pi < 4; pi++){
11a1: 83 45 e8 01 addl $0x1,-0x18(%ebp)
11a5: 83 7d e8 03 cmpl $0x3,-0x18(%ebp)
11a9: 7e f1 jle 119c <fourfiles+0x143>
wait();
}
for(i = 0; i < 2; i++){
11ab: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
11b2: e9 d4 00 00 00 jmp 128b <fourfiles+0x232>
fname = names[i];
11b7: 8b 45 f4 mov -0xc(%ebp),%eax
11ba: 8b 44 85 c8 mov -0x38(%ebp,%eax,4),%eax
11be: 89 45 e4 mov %eax,-0x1c(%ebp)
fd = open(fname, 0);
11c1: 83 ec 08 sub $0x8,%esp
11c4: 6a 00 push $0x0
11c6: ff 75 e4 pushl -0x1c(%ebp)
11c9: e8 14 2d 00 00 call 3ee2 <open>
11ce: 83 c4 10 add $0x10,%esp
11d1: 89 45 dc mov %eax,-0x24(%ebp)
total = 0;
11d4: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
while((n = read(fd, buf, sizeof(buf))) > 0){
11db: eb 4a jmp 1227 <fourfiles+0x1ce>
for(j = 0; j < n; j++){
11dd: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
11e4: eb 33 jmp 1219 <fourfiles+0x1c0>
if(buf[j] != '0'+i){
11e6: 8b 45 f0 mov -0x10(%ebp),%eax
11e9: 05 80 8a 00 00 add $0x8a80,%eax
11ee: 0f b6 00 movzbl (%eax),%eax
11f1: 0f be c0 movsbl %al,%eax
11f4: 8b 55 f4 mov -0xc(%ebp),%edx
11f7: 83 c2 30 add $0x30,%edx
11fa: 39 d0 cmp %edx,%eax
11fc: 74 17 je 1215 <fourfiles+0x1bc>
printf(1, "wrong char\n");
11fe: 83 ec 08 sub $0x8,%esp
1201: 68 25 4a 00 00 push $0x4a25
1206: 6a 01 push $0x1
1208: e8 0c 2e 00 00 call 4019 <printf>
120d: 83 c4 10 add $0x10,%esp
exit();
1210: e8 8d 2c 00 00 call 3ea2 <exit>
for(i = 0; i < 2; i++){
fname = names[i];
fd = open(fname, 0);
total = 0;
while((n = read(fd, buf, sizeof(buf))) > 0){
for(j = 0; j < n; j++){
1215: 83 45 f0 01 addl $0x1,-0x10(%ebp)
1219: 8b 45 f0 mov -0x10(%ebp),%eax
121c: 3b 45 d8 cmp -0x28(%ebp),%eax
121f: 7c c5 jl 11e6 <fourfiles+0x18d>
if(buf[j] != '0'+i){
printf(1, "wrong char\n");
exit();
}
}
total += n;
1221: 8b 45 d8 mov -0x28(%ebp),%eax
1224: 01 45 ec add %eax,-0x14(%ebp)
for(i = 0; i < 2; i++){
fname = names[i];
fd = open(fname, 0);
total = 0;
while((n = read(fd, buf, sizeof(buf))) > 0){
1227: 83 ec 04 sub $0x4,%esp
122a: 68 00 20 00 00 push $0x2000
122f: 68 80 8a 00 00 push $0x8a80
1234: ff 75 dc pushl -0x24(%ebp)
1237: e8 7e 2c 00 00 call 3eba <read>
123c: 83 c4 10 add $0x10,%esp
123f: 89 45 d8 mov %eax,-0x28(%ebp)
1242: 83 7d d8 00 cmpl $0x0,-0x28(%ebp)
1246: 7f 95 jg 11dd <fourfiles+0x184>
exit();
}
}
total += n;
}
close(fd);
1248: 83 ec 0c sub $0xc,%esp
124b: ff 75 dc pushl -0x24(%ebp)
124e: e8 77 2c 00 00 call 3eca <close>
1253: 83 c4 10 add $0x10,%esp
if(total != 12*500){
1256: 81 7d ec 70 17 00 00 cmpl $0x1770,-0x14(%ebp)
125d: 74 1a je 1279 <fourfiles+0x220>
printf(1, "wrong length %d\n", total);
125f: 83 ec 04 sub $0x4,%esp
1262: ff 75 ec pushl -0x14(%ebp)
1265: 68 31 4a 00 00 push $0x4a31
126a: 6a 01 push $0x1
126c: e8 a8 2d 00 00 call 4019 <printf>
1271: 83 c4 10 add $0x10,%esp
exit();
1274: e8 29 2c 00 00 call 3ea2 <exit>
}
unlink(fname);
1279: 83 ec 0c sub $0xc,%esp
127c: ff 75 e4 pushl -0x1c(%ebp)
127f: e8 6e 2c 00 00 call 3ef2 <unlink>
1284: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
wait();
}
for(i = 0; i < 2; i++){
1287: 83 45 f4 01 addl $0x1,-0xc(%ebp)
128b: 83 7d f4 01 cmpl $0x1,-0xc(%ebp)
128f: 0f 8e 22 ff ff ff jle 11b7 <fourfiles+0x15e>
exit();
}
unlink(fname);
}
printf(1, "fourfiles ok\n");
1295: 83 ec 08 sub $0x8,%esp
1298: 68 42 4a 00 00 push $0x4a42
129d: 6a 01 push $0x1
129f: e8 75 2d 00 00 call 4019 <printf>
12a4: 83 c4 10 add $0x10,%esp
}
12a7: 90 nop
12a8: c9 leave
12a9: c3 ret
000012aa <createdelete>:
// four processes create and delete different files in same directory
void
createdelete(void)
{
12aa: 55 push %ebp
12ab: 89 e5 mov %esp,%ebp
12ad: 83 ec 38 sub $0x38,%esp
enum { N = 20 };
int pid, i, fd, pi;
char name[32];
printf(1, "createdelete test\n");
12b0: 83 ec 08 sub $0x8,%esp
12b3: 68 50 4a 00 00 push $0x4a50
12b8: 6a 01 push $0x1
12ba: e8 5a 2d 00 00 call 4019 <printf>
12bf: 83 c4 10 add $0x10,%esp
for(pi = 0; pi < 4; pi++){
12c2: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
12c9: e9 f6 00 00 00 jmp 13c4 <createdelete+0x11a>
pid = fork();
12ce: e8 c7 2b 00 00 call 3e9a <fork>
12d3: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
12d6: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
12da: 79 17 jns 12f3 <createdelete+0x49>
printf(1, "fork failed\n");
12dc: 83 ec 08 sub $0x8,%esp
12df: 68 71 44 00 00 push $0x4471
12e4: 6a 01 push $0x1
12e6: e8 2e 2d 00 00 call 4019 <printf>
12eb: 83 c4 10 add $0x10,%esp
exit();
12ee: e8 af 2b 00 00 call 3ea2 <exit>
}
if(pid == 0){
12f3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
12f7: 0f 85 c3 00 00 00 jne 13c0 <createdelete+0x116>
name[0] = 'p' + pi;
12fd: 8b 45 f0 mov -0x10(%ebp),%eax
1300: 83 c0 70 add $0x70,%eax
1303: 88 45 c8 mov %al,-0x38(%ebp)
name[2] = '\0';
1306: c6 45 ca 00 movb $0x0,-0x36(%ebp)
for(i = 0; i < N; i++){
130a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1311: e9 9b 00 00 00 jmp 13b1 <createdelete+0x107>
name[1] = '0' + i;
1316: 8b 45 f4 mov -0xc(%ebp),%eax
1319: 83 c0 30 add $0x30,%eax
131c: 88 45 c9 mov %al,-0x37(%ebp)
fd = open(name, O_CREATE | O_RDWR);
131f: 83 ec 08 sub $0x8,%esp
1322: 68 02 02 00 00 push $0x202
1327: 8d 45 c8 lea -0x38(%ebp),%eax
132a: 50 push %eax
132b: e8 b2 2b 00 00 call 3ee2 <open>
1330: 83 c4 10 add $0x10,%esp
1333: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
1336: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
133a: 79 17 jns 1353 <createdelete+0xa9>
printf(1, "create failed\n");
133c: 83 ec 08 sub $0x8,%esp
133f: 68 05 4a 00 00 push $0x4a05
1344: 6a 01 push $0x1
1346: e8 ce 2c 00 00 call 4019 <printf>
134b: 83 c4 10 add $0x10,%esp
exit();
134e: e8 4f 2b 00 00 call 3ea2 <exit>
}
close(fd);
1353: 83 ec 0c sub $0xc,%esp
1356: ff 75 e8 pushl -0x18(%ebp)
1359: e8 6c 2b 00 00 call 3eca <close>
135e: 83 c4 10 add $0x10,%esp
if(i > 0 && (i % 2 ) == 0){
1361: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1365: 7e 46 jle 13ad <createdelete+0x103>
1367: 8b 45 f4 mov -0xc(%ebp),%eax
136a: 83 e0 01 and $0x1,%eax
136d: 85 c0 test %eax,%eax
136f: 75 3c jne 13ad <createdelete+0x103>
name[1] = '0' + (i / 2);
1371: 8b 45 f4 mov -0xc(%ebp),%eax
1374: 89 c2 mov %eax,%edx
1376: c1 ea 1f shr $0x1f,%edx
1379: 01 d0 add %edx,%eax
137b: d1 f8 sar %eax
137d: 83 c0 30 add $0x30,%eax
1380: 88 45 c9 mov %al,-0x37(%ebp)
if(unlink(name) < 0){
1383: 83 ec 0c sub $0xc,%esp
1386: 8d 45 c8 lea -0x38(%ebp),%eax
1389: 50 push %eax
138a: e8 63 2b 00 00 call 3ef2 <unlink>
138f: 83 c4 10 add $0x10,%esp
1392: 85 c0 test %eax,%eax
1394: 79 17 jns 13ad <createdelete+0x103>
printf(1, "unlink failed\n");
1396: 83 ec 08 sub $0x8,%esp
1399: 68 f4 44 00 00 push $0x44f4
139e: 6a 01 push $0x1
13a0: e8 74 2c 00 00 call 4019 <printf>
13a5: 83 c4 10 add $0x10,%esp
exit();
13a8: e8 f5 2a 00 00 call 3ea2 <exit>
}
if(pid == 0){
name[0] = 'p' + pi;
name[2] = '\0';
for(i = 0; i < N; i++){
13ad: 83 45 f4 01 addl $0x1,-0xc(%ebp)
13b1: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
13b5: 0f 8e 5b ff ff ff jle 1316 <createdelete+0x6c>
printf(1, "unlink failed\n");
exit();
}
}
}
exit();
13bb: e8 e2 2a 00 00 call 3ea2 <exit>
int pid, i, fd, pi;
char name[32];
printf(1, "createdelete test\n");
for(pi = 0; pi < 4; pi++){
13c0: 83 45 f0 01 addl $0x1,-0x10(%ebp)
13c4: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
13c8: 0f 8e 00 ff ff ff jle 12ce <createdelete+0x24>
}
exit();
}
}
for(pi = 0; pi < 4; pi++){
13ce: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
13d5: eb 09 jmp 13e0 <createdelete+0x136>
wait();
13d7: e8 ce 2a 00 00 call 3eaa <wait>
}
exit();
}
}
for(pi = 0; pi < 4; pi++){
13dc: 83 45 f0 01 addl $0x1,-0x10(%ebp)
13e0: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
13e4: 7e f1 jle 13d7 <createdelete+0x12d>
wait();
}
name[0] = name[1] = name[2] = 0;
13e6: c6 45 ca 00 movb $0x0,-0x36(%ebp)
13ea: 0f b6 45 ca movzbl -0x36(%ebp),%eax
13ee: 88 45 c9 mov %al,-0x37(%ebp)
13f1: 0f b6 45 c9 movzbl -0x37(%ebp),%eax
13f5: 88 45 c8 mov %al,-0x38(%ebp)
for(i = 0; i < N; i++){
13f8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
13ff: e9 b2 00 00 00 jmp 14b6 <createdelete+0x20c>
for(pi = 0; pi < 4; pi++){
1404: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
140b: e9 98 00 00 00 jmp 14a8 <createdelete+0x1fe>
name[0] = 'p' + pi;
1410: 8b 45 f0 mov -0x10(%ebp),%eax
1413: 83 c0 70 add $0x70,%eax
1416: 88 45 c8 mov %al,-0x38(%ebp)
name[1] = '0' + i;
1419: 8b 45 f4 mov -0xc(%ebp),%eax
141c: 83 c0 30 add $0x30,%eax
141f: 88 45 c9 mov %al,-0x37(%ebp)
fd = open(name, 0);
1422: 83 ec 08 sub $0x8,%esp
1425: 6a 00 push $0x0
1427: 8d 45 c8 lea -0x38(%ebp),%eax
142a: 50 push %eax
142b: e8 b2 2a 00 00 call 3ee2 <open>
1430: 83 c4 10 add $0x10,%esp
1433: 89 45 e8 mov %eax,-0x18(%ebp)
if((i == 0 || i >= N/2) && fd < 0){
1436: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
143a: 74 06 je 1442 <createdelete+0x198>
143c: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
1440: 7e 21 jle 1463 <createdelete+0x1b9>
1442: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1446: 79 1b jns 1463 <createdelete+0x1b9>
printf(1, "oops createdelete %s didn't exist\n", name);
1448: 83 ec 04 sub $0x4,%esp
144b: 8d 45 c8 lea -0x38(%ebp),%eax
144e: 50 push %eax
144f: 68 64 4a 00 00 push $0x4a64
1454: 6a 01 push $0x1
1456: e8 be 2b 00 00 call 4019 <printf>
145b: 83 c4 10 add $0x10,%esp
exit();
145e: e8 3f 2a 00 00 call 3ea2 <exit>
} else if((i >= 1 && i < N/2) && fd >= 0){
1463: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1467: 7e 27 jle 1490 <createdelete+0x1e6>
1469: 83 7d f4 09 cmpl $0x9,-0xc(%ebp)
146d: 7f 21 jg 1490 <createdelete+0x1e6>
146f: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1473: 78 1b js 1490 <createdelete+0x1e6>
printf(1, "oops createdelete %s did exist\n", name);
1475: 83 ec 04 sub $0x4,%esp
1478: 8d 45 c8 lea -0x38(%ebp),%eax
147b: 50 push %eax
147c: 68 88 4a 00 00 push $0x4a88
1481: 6a 01 push $0x1
1483: e8 91 2b 00 00 call 4019 <printf>
1488: 83 c4 10 add $0x10,%esp
exit();
148b: e8 12 2a 00 00 call 3ea2 <exit>
}
if(fd >= 0)
1490: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1494: 78 0e js 14a4 <createdelete+0x1fa>
close(fd);
1496: 83 ec 0c sub $0xc,%esp
1499: ff 75 e8 pushl -0x18(%ebp)
149c: e8 29 2a 00 00 call 3eca <close>
14a1: 83 c4 10 add $0x10,%esp
wait();
}
name[0] = name[1] = name[2] = 0;
for(i = 0; i < N; i++){
for(pi = 0; pi < 4; pi++){
14a4: 83 45 f0 01 addl $0x1,-0x10(%ebp)
14a8: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
14ac: 0f 8e 5e ff ff ff jle 1410 <createdelete+0x166>
for(pi = 0; pi < 4; pi++){
wait();
}
name[0] = name[1] = name[2] = 0;
for(i = 0; i < N; i++){
14b2: 83 45 f4 01 addl $0x1,-0xc(%ebp)
14b6: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
14ba: 0f 8e 44 ff ff ff jle 1404 <createdelete+0x15a>
if(fd >= 0)
close(fd);
}
}
for(i = 0; i < N; i++){
14c0: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
14c7: eb 38 jmp 1501 <createdelete+0x257>
for(pi = 0; pi < 4; pi++){
14c9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
14d0: eb 25 jmp 14f7 <createdelete+0x24d>
name[0] = 'p' + i;
14d2: 8b 45 f4 mov -0xc(%ebp),%eax
14d5: 83 c0 70 add $0x70,%eax
14d8: 88 45 c8 mov %al,-0x38(%ebp)
name[1] = '0' + i;
14db: 8b 45 f4 mov -0xc(%ebp),%eax
14de: 83 c0 30 add $0x30,%eax
14e1: 88 45 c9 mov %al,-0x37(%ebp)
unlink(name);
14e4: 83 ec 0c sub $0xc,%esp
14e7: 8d 45 c8 lea -0x38(%ebp),%eax
14ea: 50 push %eax
14eb: e8 02 2a 00 00 call 3ef2 <unlink>
14f0: 83 c4 10 add $0x10,%esp
close(fd);
}
}
for(i = 0; i < N; i++){
for(pi = 0; pi < 4; pi++){
14f3: 83 45 f0 01 addl $0x1,-0x10(%ebp)
14f7: 83 7d f0 03 cmpl $0x3,-0x10(%ebp)
14fb: 7e d5 jle 14d2 <createdelete+0x228>
if(fd >= 0)
close(fd);
}
}
for(i = 0; i < N; i++){
14fd: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1501: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
1505: 7e c2 jle 14c9 <createdelete+0x21f>
name[1] = '0' + i;
unlink(name);
}
}
printf(1, "createdelete ok\n");
1507: 83 ec 08 sub $0x8,%esp
150a: 68 a8 4a 00 00 push $0x4aa8
150f: 6a 01 push $0x1
1511: e8 03 2b 00 00 call 4019 <printf>
1516: 83 c4 10 add $0x10,%esp
}
1519: 90 nop
151a: c9 leave
151b: c3 ret
0000151c <unlinkread>:
// can I unlink a file and still read it?
void
unlinkread(void)
{
151c: 55 push %ebp
151d: 89 e5 mov %esp,%ebp
151f: 83 ec 18 sub $0x18,%esp
int fd, fd1;
printf(1, "unlinkread test\n");
1522: 83 ec 08 sub $0x8,%esp
1525: 68 b9 4a 00 00 push $0x4ab9
152a: 6a 01 push $0x1
152c: e8 e8 2a 00 00 call 4019 <printf>
1531: 83 c4 10 add $0x10,%esp
fd = open("unlinkread", O_CREATE | O_RDWR);
1534: 83 ec 08 sub $0x8,%esp
1537: 68 02 02 00 00 push $0x202
153c: 68 ca 4a 00 00 push $0x4aca
1541: e8 9c 29 00 00 call 3ee2 <open>
1546: 83 c4 10 add $0x10,%esp
1549: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
154c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1550: 79 17 jns 1569 <unlinkread+0x4d>
printf(1, "create unlinkread failed\n");
1552: 83 ec 08 sub $0x8,%esp
1555: 68 d5 4a 00 00 push $0x4ad5
155a: 6a 01 push $0x1
155c: e8 b8 2a 00 00 call 4019 <printf>
1561: 83 c4 10 add $0x10,%esp
exit();
1564: e8 39 29 00 00 call 3ea2 <exit>
}
write(fd, "hello", 5);
1569: 83 ec 04 sub $0x4,%esp
156c: 6a 05 push $0x5
156e: 68 ef 4a 00 00 push $0x4aef
1573: ff 75 f4 pushl -0xc(%ebp)
1576: e8 47 29 00 00 call 3ec2 <write>
157b: 83 c4 10 add $0x10,%esp
close(fd);
157e: 83 ec 0c sub $0xc,%esp
1581: ff 75 f4 pushl -0xc(%ebp)
1584: e8 41 29 00 00 call 3eca <close>
1589: 83 c4 10 add $0x10,%esp
fd = open("unlinkread", O_RDWR);
158c: 83 ec 08 sub $0x8,%esp
158f: 6a 02 push $0x2
1591: 68 ca 4a 00 00 push $0x4aca
1596: e8 47 29 00 00 call 3ee2 <open>
159b: 83 c4 10 add $0x10,%esp
159e: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
15a1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
15a5: 79 17 jns 15be <unlinkread+0xa2>
printf(1, "open unlinkread failed\n");
15a7: 83 ec 08 sub $0x8,%esp
15aa: 68 f5 4a 00 00 push $0x4af5
15af: 6a 01 push $0x1
15b1: e8 63 2a 00 00 call 4019 <printf>
15b6: 83 c4 10 add $0x10,%esp
exit();
15b9: e8 e4 28 00 00 call 3ea2 <exit>
}
if(unlink("unlinkread") != 0){
15be: 83 ec 0c sub $0xc,%esp
15c1: 68 ca 4a 00 00 push $0x4aca
15c6: e8 27 29 00 00 call 3ef2 <unlink>
15cb: 83 c4 10 add $0x10,%esp
15ce: 85 c0 test %eax,%eax
15d0: 74 17 je 15e9 <unlinkread+0xcd>
printf(1, "unlink unlinkread failed\n");
15d2: 83 ec 08 sub $0x8,%esp
15d5: 68 0d 4b 00 00 push $0x4b0d
15da: 6a 01 push $0x1
15dc: e8 38 2a 00 00 call 4019 <printf>
15e1: 83 c4 10 add $0x10,%esp
exit();
15e4: e8 b9 28 00 00 call 3ea2 <exit>
}
fd1 = open("unlinkread", O_CREATE | O_RDWR);
15e9: 83 ec 08 sub $0x8,%esp
15ec: 68 02 02 00 00 push $0x202
15f1: 68 ca 4a 00 00 push $0x4aca
15f6: e8 e7 28 00 00 call 3ee2 <open>
15fb: 83 c4 10 add $0x10,%esp
15fe: 89 45 f0 mov %eax,-0x10(%ebp)
write(fd1, "yyy", 3);
1601: 83 ec 04 sub $0x4,%esp
1604: 6a 03 push $0x3
1606: 68 27 4b 00 00 push $0x4b27
160b: ff 75 f0 pushl -0x10(%ebp)
160e: e8 af 28 00 00 call 3ec2 <write>
1613: 83 c4 10 add $0x10,%esp
close(fd1);
1616: 83 ec 0c sub $0xc,%esp
1619: ff 75 f0 pushl -0x10(%ebp)
161c: e8 a9 28 00 00 call 3eca <close>
1621: 83 c4 10 add $0x10,%esp
if(read(fd, buf, sizeof(buf)) != 5){
1624: 83 ec 04 sub $0x4,%esp
1627: 68 00 20 00 00 push $0x2000
162c: 68 80 8a 00 00 push $0x8a80
1631: ff 75 f4 pushl -0xc(%ebp)
1634: e8 81 28 00 00 call 3eba <read>
1639: 83 c4 10 add $0x10,%esp
163c: 83 f8 05 cmp $0x5,%eax
163f: 74 17 je 1658 <unlinkread+0x13c>
printf(1, "unlinkread read failed");
1641: 83 ec 08 sub $0x8,%esp
1644: 68 2b 4b 00 00 push $0x4b2b
1649: 6a 01 push $0x1
164b: e8 c9 29 00 00 call 4019 <printf>
1650: 83 c4 10 add $0x10,%esp
exit();
1653: e8 4a 28 00 00 call 3ea2 <exit>
}
if(buf[0] != 'h'){
1658: 0f b6 05 80 8a 00 00 movzbl 0x8a80,%eax
165f: 3c 68 cmp $0x68,%al
1661: 74 17 je 167a <unlinkread+0x15e>
printf(1, "unlinkread wrong data\n");
1663: 83 ec 08 sub $0x8,%esp
1666: 68 42 4b 00 00 push $0x4b42
166b: 6a 01 push $0x1
166d: e8 a7 29 00 00 call 4019 <printf>
1672: 83 c4 10 add $0x10,%esp
exit();
1675: e8 28 28 00 00 call 3ea2 <exit>
}
if(write(fd, buf, 10) != 10){
167a: 83 ec 04 sub $0x4,%esp
167d: 6a 0a push $0xa
167f: 68 80 8a 00 00 push $0x8a80
1684: ff 75 f4 pushl -0xc(%ebp)
1687: e8 36 28 00 00 call 3ec2 <write>
168c: 83 c4 10 add $0x10,%esp
168f: 83 f8 0a cmp $0xa,%eax
1692: 74 17 je 16ab <unlinkread+0x18f>
printf(1, "unlinkread write failed\n");
1694: 83 ec 08 sub $0x8,%esp
1697: 68 59 4b 00 00 push $0x4b59
169c: 6a 01 push $0x1
169e: e8 76 29 00 00 call 4019 <printf>
16a3: 83 c4 10 add $0x10,%esp
exit();
16a6: e8 f7 27 00 00 call 3ea2 <exit>
}
close(fd);
16ab: 83 ec 0c sub $0xc,%esp
16ae: ff 75 f4 pushl -0xc(%ebp)
16b1: e8 14 28 00 00 call 3eca <close>
16b6: 83 c4 10 add $0x10,%esp
unlink("unlinkread");
16b9: 83 ec 0c sub $0xc,%esp
16bc: 68 ca 4a 00 00 push $0x4aca
16c1: e8 2c 28 00 00 call 3ef2 <unlink>
16c6: 83 c4 10 add $0x10,%esp
printf(1, "unlinkread ok\n");
16c9: 83 ec 08 sub $0x8,%esp
16cc: 68 72 4b 00 00 push $0x4b72
16d1: 6a 01 push $0x1
16d3: e8 41 29 00 00 call 4019 <printf>
16d8: 83 c4 10 add $0x10,%esp
}
16db: 90 nop
16dc: c9 leave
16dd: c3 ret
000016de <linktest>:
void
linktest(void)
{
16de: 55 push %ebp
16df: 89 e5 mov %esp,%ebp
16e1: 83 ec 18 sub $0x18,%esp
int fd;
printf(1, "linktest\n");
16e4: 83 ec 08 sub $0x8,%esp
16e7: 68 81 4b 00 00 push $0x4b81
16ec: 6a 01 push $0x1
16ee: e8 26 29 00 00 call 4019 <printf>
16f3: 83 c4 10 add $0x10,%esp
unlink("lf1");
16f6: 83 ec 0c sub $0xc,%esp
16f9: 68 8b 4b 00 00 push $0x4b8b
16fe: e8 ef 27 00 00 call 3ef2 <unlink>
1703: 83 c4 10 add $0x10,%esp
unlink("lf2");
1706: 83 ec 0c sub $0xc,%esp
1709: 68 8f 4b 00 00 push $0x4b8f
170e: e8 df 27 00 00 call 3ef2 <unlink>
1713: 83 c4 10 add $0x10,%esp
fd = open("lf1", O_CREATE|O_RDWR);
1716: 83 ec 08 sub $0x8,%esp
1719: 68 02 02 00 00 push $0x202
171e: 68 8b 4b 00 00 push $0x4b8b
1723: e8 ba 27 00 00 call 3ee2 <open>
1728: 83 c4 10 add $0x10,%esp
172b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
172e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1732: 79 17 jns 174b <linktest+0x6d>
printf(1, "create lf1 failed\n");
1734: 83 ec 08 sub $0x8,%esp
1737: 68 93 4b 00 00 push $0x4b93
173c: 6a 01 push $0x1
173e: e8 d6 28 00 00 call 4019 <printf>
1743: 83 c4 10 add $0x10,%esp
exit();
1746: e8 57 27 00 00 call 3ea2 <exit>
}
if(write(fd, "hello", 5) != 5){
174b: 83 ec 04 sub $0x4,%esp
174e: 6a 05 push $0x5
1750: 68 ef 4a 00 00 push $0x4aef
1755: ff 75 f4 pushl -0xc(%ebp)
1758: e8 65 27 00 00 call 3ec2 <write>
175d: 83 c4 10 add $0x10,%esp
1760: 83 f8 05 cmp $0x5,%eax
1763: 74 17 je 177c <linktest+0x9e>
printf(1, "write lf1 failed\n");
1765: 83 ec 08 sub $0x8,%esp
1768: 68 a6 4b 00 00 push $0x4ba6
176d: 6a 01 push $0x1
176f: e8 a5 28 00 00 call 4019 <printf>
1774: 83 c4 10 add $0x10,%esp
exit();
1777: e8 26 27 00 00 call 3ea2 <exit>
}
close(fd);
177c: 83 ec 0c sub $0xc,%esp
177f: ff 75 f4 pushl -0xc(%ebp)
1782: e8 43 27 00 00 call 3eca <close>
1787: 83 c4 10 add $0x10,%esp
if(link("lf1", "lf2") < 0){
178a: 83 ec 08 sub $0x8,%esp
178d: 68 8f 4b 00 00 push $0x4b8f
1792: 68 8b 4b 00 00 push $0x4b8b
1797: e8 66 27 00 00 call 3f02 <link>
179c: 83 c4 10 add $0x10,%esp
179f: 85 c0 test %eax,%eax
17a1: 79 17 jns 17ba <linktest+0xdc>
printf(1, "link lf1 lf2 failed\n");
17a3: 83 ec 08 sub $0x8,%esp
17a6: 68 b8 4b 00 00 push $0x4bb8
17ab: 6a 01 push $0x1
17ad: e8 67 28 00 00 call 4019 <printf>
17b2: 83 c4 10 add $0x10,%esp
exit();
17b5: e8 e8 26 00 00 call 3ea2 <exit>
}
unlink("lf1");
17ba: 83 ec 0c sub $0xc,%esp
17bd: 68 8b 4b 00 00 push $0x4b8b
17c2: e8 2b 27 00 00 call 3ef2 <unlink>
17c7: 83 c4 10 add $0x10,%esp
if(open("lf1", 0) >= 0){
17ca: 83 ec 08 sub $0x8,%esp
17cd: 6a 00 push $0x0
17cf: 68 8b 4b 00 00 push $0x4b8b
17d4: e8 09 27 00 00 call 3ee2 <open>
17d9: 83 c4 10 add $0x10,%esp
17dc: 85 c0 test %eax,%eax
17de: 78 17 js 17f7 <linktest+0x119>
printf(1, "unlinked lf1 but it is still there!\n");
17e0: 83 ec 08 sub $0x8,%esp
17e3: 68 d0 4b 00 00 push $0x4bd0
17e8: 6a 01 push $0x1
17ea: e8 2a 28 00 00 call 4019 <printf>
17ef: 83 c4 10 add $0x10,%esp
exit();
17f2: e8 ab 26 00 00 call 3ea2 <exit>
}
fd = open("lf2", 0);
17f7: 83 ec 08 sub $0x8,%esp
17fa: 6a 00 push $0x0
17fc: 68 8f 4b 00 00 push $0x4b8f
1801: e8 dc 26 00 00 call 3ee2 <open>
1806: 83 c4 10 add $0x10,%esp
1809: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
180c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1810: 79 17 jns 1829 <linktest+0x14b>
printf(1, "open lf2 failed\n");
1812: 83 ec 08 sub $0x8,%esp
1815: 68 f5 4b 00 00 push $0x4bf5
181a: 6a 01 push $0x1
181c: e8 f8 27 00 00 call 4019 <printf>
1821: 83 c4 10 add $0x10,%esp
exit();
1824: e8 79 26 00 00 call 3ea2 <exit>
}
if(read(fd, buf, sizeof(buf)) != 5){
1829: 83 ec 04 sub $0x4,%esp
182c: 68 00 20 00 00 push $0x2000
1831: 68 80 8a 00 00 push $0x8a80
1836: ff 75 f4 pushl -0xc(%ebp)
1839: e8 7c 26 00 00 call 3eba <read>
183e: 83 c4 10 add $0x10,%esp
1841: 83 f8 05 cmp $0x5,%eax
1844: 74 17 je 185d <linktest+0x17f>
printf(1, "read lf2 failed\n");
1846: 83 ec 08 sub $0x8,%esp
1849: 68 06 4c 00 00 push $0x4c06
184e: 6a 01 push $0x1
1850: e8 c4 27 00 00 call 4019 <printf>
1855: 83 c4 10 add $0x10,%esp
exit();
1858: e8 45 26 00 00 call 3ea2 <exit>
}
close(fd);
185d: 83 ec 0c sub $0xc,%esp
1860: ff 75 f4 pushl -0xc(%ebp)
1863: e8 62 26 00 00 call 3eca <close>
1868: 83 c4 10 add $0x10,%esp
if(link("lf2", "lf2") >= 0){
186b: 83 ec 08 sub $0x8,%esp
186e: 68 8f 4b 00 00 push $0x4b8f
1873: 68 8f 4b 00 00 push $0x4b8f
1878: e8 85 26 00 00 call 3f02 <link>
187d: 83 c4 10 add $0x10,%esp
1880: 85 c0 test %eax,%eax
1882: 78 17 js 189b <linktest+0x1bd>
printf(1, "link lf2 lf2 succeeded! oops\n");
1884: 83 ec 08 sub $0x8,%esp
1887: 68 17 4c 00 00 push $0x4c17
188c: 6a 01 push $0x1
188e: e8 86 27 00 00 call 4019 <printf>
1893: 83 c4 10 add $0x10,%esp
exit();
1896: e8 07 26 00 00 call 3ea2 <exit>
}
unlink("lf2");
189b: 83 ec 0c sub $0xc,%esp
189e: 68 8f 4b 00 00 push $0x4b8f
18a3: e8 4a 26 00 00 call 3ef2 <unlink>
18a8: 83 c4 10 add $0x10,%esp
if(link("lf2", "lf1") >= 0){
18ab: 83 ec 08 sub $0x8,%esp
18ae: 68 8b 4b 00 00 push $0x4b8b
18b3: 68 8f 4b 00 00 push $0x4b8f
18b8: e8 45 26 00 00 call 3f02 <link>
18bd: 83 c4 10 add $0x10,%esp
18c0: 85 c0 test %eax,%eax
18c2: 78 17 js 18db <linktest+0x1fd>
printf(1, "link non-existant succeeded! oops\n");
18c4: 83 ec 08 sub $0x8,%esp
18c7: 68 38 4c 00 00 push $0x4c38
18cc: 6a 01 push $0x1
18ce: e8 46 27 00 00 call 4019 <printf>
18d3: 83 c4 10 add $0x10,%esp
exit();
18d6: e8 c7 25 00 00 call 3ea2 <exit>
}
if(link(".", "lf1") >= 0){
18db: 83 ec 08 sub $0x8,%esp
18de: 68 8b 4b 00 00 push $0x4b8b
18e3: 68 5b 4c 00 00 push $0x4c5b
18e8: e8 15 26 00 00 call 3f02 <link>
18ed: 83 c4 10 add $0x10,%esp
18f0: 85 c0 test %eax,%eax
18f2: 78 17 js 190b <linktest+0x22d>
printf(1, "link . lf1 succeeded! oops\n");
18f4: 83 ec 08 sub $0x8,%esp
18f7: 68 5d 4c 00 00 push $0x4c5d
18fc: 6a 01 push $0x1
18fe: e8 16 27 00 00 call 4019 <printf>
1903: 83 c4 10 add $0x10,%esp
exit();
1906: e8 97 25 00 00 call 3ea2 <exit>
}
printf(1, "linktest ok\n");
190b: 83 ec 08 sub $0x8,%esp
190e: 68 79 4c 00 00 push $0x4c79
1913: 6a 01 push $0x1
1915: e8 ff 26 00 00 call 4019 <printf>
191a: 83 c4 10 add $0x10,%esp
}
191d: 90 nop
191e: c9 leave
191f: c3 ret
00001920 <concreate>:
// test concurrent create/link/unlink of the same file
void
concreate(void)
{
1920: 55 push %ebp
1921: 89 e5 mov %esp,%ebp
1923: 83 ec 58 sub $0x58,%esp
struct {
ushort inum;
char name[14];
} de;
printf(1, "concreate test\n");
1926: 83 ec 08 sub $0x8,%esp
1929: 68 86 4c 00 00 push $0x4c86
192e: 6a 01 push $0x1
1930: e8 e4 26 00 00 call 4019 <printf>
1935: 83 c4 10 add $0x10,%esp
file[0] = 'C';
1938: c6 45 e5 43 movb $0x43,-0x1b(%ebp)
file[2] = '\0';
193c: c6 45 e7 00 movb $0x0,-0x19(%ebp)
for(i = 0; i < 40; i++){
1940: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1947: e9 fc 00 00 00 jmp 1a48 <concreate+0x128>
file[1] = '0' + i;
194c: 8b 45 f4 mov -0xc(%ebp),%eax
194f: 83 c0 30 add $0x30,%eax
1952: 88 45 e6 mov %al,-0x1a(%ebp)
unlink(file);
1955: 83 ec 0c sub $0xc,%esp
1958: 8d 45 e5 lea -0x1b(%ebp),%eax
195b: 50 push %eax
195c: e8 91 25 00 00 call 3ef2 <unlink>
1961: 83 c4 10 add $0x10,%esp
pid = fork();
1964: e8 31 25 00 00 call 3e9a <fork>
1969: 89 45 ec mov %eax,-0x14(%ebp)
if(pid && (i % 3) == 1){
196c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1970: 74 3b je 19ad <concreate+0x8d>
1972: 8b 4d f4 mov -0xc(%ebp),%ecx
1975: ba 56 55 55 55 mov $0x55555556,%edx
197a: 89 c8 mov %ecx,%eax
197c: f7 ea imul %edx
197e: 89 c8 mov %ecx,%eax
1980: c1 f8 1f sar $0x1f,%eax
1983: 29 c2 sub %eax,%edx
1985: 89 d0 mov %edx,%eax
1987: 01 c0 add %eax,%eax
1989: 01 d0 add %edx,%eax
198b: 29 c1 sub %eax,%ecx
198d: 89 ca mov %ecx,%edx
198f: 83 fa 01 cmp $0x1,%edx
1992: 75 19 jne 19ad <concreate+0x8d>
link("C0", file);
1994: 83 ec 08 sub $0x8,%esp
1997: 8d 45 e5 lea -0x1b(%ebp),%eax
199a: 50 push %eax
199b: 68 96 4c 00 00 push $0x4c96
19a0: e8 5d 25 00 00 call 3f02 <link>
19a5: 83 c4 10 add $0x10,%esp
19a8: e9 87 00 00 00 jmp 1a34 <concreate+0x114>
} else if(pid == 0 && (i % 5) == 1){
19ad: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
19b1: 75 3b jne 19ee <concreate+0xce>
19b3: 8b 4d f4 mov -0xc(%ebp),%ecx
19b6: ba 67 66 66 66 mov $0x66666667,%edx
19bb: 89 c8 mov %ecx,%eax
19bd: f7 ea imul %edx
19bf: d1 fa sar %edx
19c1: 89 c8 mov %ecx,%eax
19c3: c1 f8 1f sar $0x1f,%eax
19c6: 29 c2 sub %eax,%edx
19c8: 89 d0 mov %edx,%eax
19ca: c1 e0 02 shl $0x2,%eax
19cd: 01 d0 add %edx,%eax
19cf: 29 c1 sub %eax,%ecx
19d1: 89 ca mov %ecx,%edx
19d3: 83 fa 01 cmp $0x1,%edx
19d6: 75 16 jne 19ee <concreate+0xce>
link("C0", file);
19d8: 83 ec 08 sub $0x8,%esp
19db: 8d 45 e5 lea -0x1b(%ebp),%eax
19de: 50 push %eax
19df: 68 96 4c 00 00 push $0x4c96
19e4: e8 19 25 00 00 call 3f02 <link>
19e9: 83 c4 10 add $0x10,%esp
19ec: eb 46 jmp 1a34 <concreate+0x114>
} else {
fd = open(file, O_CREATE | O_RDWR);
19ee: 83 ec 08 sub $0x8,%esp
19f1: 68 02 02 00 00 push $0x202
19f6: 8d 45 e5 lea -0x1b(%ebp),%eax
19f9: 50 push %eax
19fa: e8 e3 24 00 00 call 3ee2 <open>
19ff: 83 c4 10 add $0x10,%esp
1a02: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
1a05: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
1a09: 79 1b jns 1a26 <concreate+0x106>
printf(1, "concreate create %s failed\n", file);
1a0b: 83 ec 04 sub $0x4,%esp
1a0e: 8d 45 e5 lea -0x1b(%ebp),%eax
1a11: 50 push %eax
1a12: 68 99 4c 00 00 push $0x4c99
1a17: 6a 01 push $0x1
1a19: e8 fb 25 00 00 call 4019 <printf>
1a1e: 83 c4 10 add $0x10,%esp
exit();
1a21: e8 7c 24 00 00 call 3ea2 <exit>
}
close(fd);
1a26: 83 ec 0c sub $0xc,%esp
1a29: ff 75 e8 pushl -0x18(%ebp)
1a2c: e8 99 24 00 00 call 3eca <close>
1a31: 83 c4 10 add $0x10,%esp
}
if(pid == 0)
1a34: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1a38: 75 05 jne 1a3f <concreate+0x11f>
exit();
1a3a: e8 63 24 00 00 call 3ea2 <exit>
else
wait();
1a3f: e8 66 24 00 00 call 3eaa <wait>
} de;
printf(1, "concreate test\n");
file[0] = 'C';
file[2] = '\0';
for(i = 0; i < 40; i++){
1a44: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1a48: 83 7d f4 27 cmpl $0x27,-0xc(%ebp)
1a4c: 0f 8e fa fe ff ff jle 194c <concreate+0x2c>
exit();
else
wait();
}
memset(fa, 0, sizeof(fa));
1a52: 83 ec 04 sub $0x4,%esp
1a55: 6a 28 push $0x28
1a57: 6a 00 push $0x0
1a59: 8d 45 bd lea -0x43(%ebp),%eax
1a5c: 50 push %eax
1a5d: e8 a5 22 00 00 call 3d07 <memset>
1a62: 83 c4 10 add $0x10,%esp
fd = open(".", 0);
1a65: 83 ec 08 sub $0x8,%esp
1a68: 6a 00 push $0x0
1a6a: 68 5b 4c 00 00 push $0x4c5b
1a6f: e8 6e 24 00 00 call 3ee2 <open>
1a74: 83 c4 10 add $0x10,%esp
1a77: 89 45 e8 mov %eax,-0x18(%ebp)
n = 0;
1a7a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
while(read(fd, &de, sizeof(de)) > 0){
1a81: e9 93 00 00 00 jmp 1b19 <concreate+0x1f9>
if(de.inum == 0)
1a86: 0f b7 45 ac movzwl -0x54(%ebp),%eax
1a8a: 66 85 c0 test %ax,%ax
1a8d: 75 05 jne 1a94 <concreate+0x174>
continue;
1a8f: e9 85 00 00 00 jmp 1b19 <concreate+0x1f9>
if(de.name[0] == 'C' && de.name[2] == '\0'){
1a94: 0f b6 45 ae movzbl -0x52(%ebp),%eax
1a98: 3c 43 cmp $0x43,%al
1a9a: 75 7d jne 1b19 <concreate+0x1f9>
1a9c: 0f b6 45 b0 movzbl -0x50(%ebp),%eax
1aa0: 84 c0 test %al,%al
1aa2: 75 75 jne 1b19 <concreate+0x1f9>
i = de.name[1] - '0';
1aa4: 0f b6 45 af movzbl -0x51(%ebp),%eax
1aa8: 0f be c0 movsbl %al,%eax
1aab: 83 e8 30 sub $0x30,%eax
1aae: 89 45 f4 mov %eax,-0xc(%ebp)
if(i < 0 || i >= sizeof(fa)){
1ab1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1ab5: 78 08 js 1abf <concreate+0x19f>
1ab7: 8b 45 f4 mov -0xc(%ebp),%eax
1aba: 83 f8 27 cmp $0x27,%eax
1abd: 76 1e jbe 1add <concreate+0x1bd>
printf(1, "concreate weird file %s\n", de.name);
1abf: 83 ec 04 sub $0x4,%esp
1ac2: 8d 45 ac lea -0x54(%ebp),%eax
1ac5: 83 c0 02 add $0x2,%eax
1ac8: 50 push %eax
1ac9: 68 b5 4c 00 00 push $0x4cb5
1ace: 6a 01 push $0x1
1ad0: e8 44 25 00 00 call 4019 <printf>
1ad5: 83 c4 10 add $0x10,%esp
exit();
1ad8: e8 c5 23 00 00 call 3ea2 <exit>
}
if(fa[i]){
1add: 8d 55 bd lea -0x43(%ebp),%edx
1ae0: 8b 45 f4 mov -0xc(%ebp),%eax
1ae3: 01 d0 add %edx,%eax
1ae5: 0f b6 00 movzbl (%eax),%eax
1ae8: 84 c0 test %al,%al
1aea: 74 1e je 1b0a <concreate+0x1ea>
printf(1, "concreate duplicate file %s\n", de.name);
1aec: 83 ec 04 sub $0x4,%esp
1aef: 8d 45 ac lea -0x54(%ebp),%eax
1af2: 83 c0 02 add $0x2,%eax
1af5: 50 push %eax
1af6: 68 ce 4c 00 00 push $0x4cce
1afb: 6a 01 push $0x1
1afd: e8 17 25 00 00 call 4019 <printf>
1b02: 83 c4 10 add $0x10,%esp
exit();
1b05: e8 98 23 00 00 call 3ea2 <exit>
}
fa[i] = 1;
1b0a: 8d 55 bd lea -0x43(%ebp),%edx
1b0d: 8b 45 f4 mov -0xc(%ebp),%eax
1b10: 01 d0 add %edx,%eax
1b12: c6 00 01 movb $0x1,(%eax)
n++;
1b15: 83 45 f0 01 addl $0x1,-0x10(%ebp)
}
memset(fa, 0, sizeof(fa));
fd = open(".", 0);
n = 0;
while(read(fd, &de, sizeof(de)) > 0){
1b19: 83 ec 04 sub $0x4,%esp
1b1c: 6a 10 push $0x10
1b1e: 8d 45 ac lea -0x54(%ebp),%eax
1b21: 50 push %eax
1b22: ff 75 e8 pushl -0x18(%ebp)
1b25: e8 90 23 00 00 call 3eba <read>
1b2a: 83 c4 10 add $0x10,%esp
1b2d: 85 c0 test %eax,%eax
1b2f: 0f 8f 51 ff ff ff jg 1a86 <concreate+0x166>
}
fa[i] = 1;
n++;
}
}
close(fd);
1b35: 83 ec 0c sub $0xc,%esp
1b38: ff 75 e8 pushl -0x18(%ebp)
1b3b: e8 8a 23 00 00 call 3eca <close>
1b40: 83 c4 10 add $0x10,%esp
if(n != 40){
1b43: 83 7d f0 28 cmpl $0x28,-0x10(%ebp)
1b47: 74 17 je 1b60 <concreate+0x240>
printf(1, "concreate not enough files in directory listing\n");
1b49: 83 ec 08 sub $0x8,%esp
1b4c: 68 ec 4c 00 00 push $0x4cec
1b51: 6a 01 push $0x1
1b53: e8 c1 24 00 00 call 4019 <printf>
1b58: 83 c4 10 add $0x10,%esp
exit();
1b5b: e8 42 23 00 00 call 3ea2 <exit>
}
for(i = 0; i < 40; i++){
1b60: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1b67: e9 45 01 00 00 jmp 1cb1 <concreate+0x391>
file[1] = '0' + i;
1b6c: 8b 45 f4 mov -0xc(%ebp),%eax
1b6f: 83 c0 30 add $0x30,%eax
1b72: 88 45 e6 mov %al,-0x1a(%ebp)
pid = fork();
1b75: e8 20 23 00 00 call 3e9a <fork>
1b7a: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
1b7d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1b81: 79 17 jns 1b9a <concreate+0x27a>
printf(1, "fork failed\n");
1b83: 83 ec 08 sub $0x8,%esp
1b86: 68 71 44 00 00 push $0x4471
1b8b: 6a 01 push $0x1
1b8d: e8 87 24 00 00 call 4019 <printf>
1b92: 83 c4 10 add $0x10,%esp
exit();
1b95: e8 08 23 00 00 call 3ea2 <exit>
}
if(((i % 3) == 0 && pid == 0) ||
1b9a: 8b 4d f4 mov -0xc(%ebp),%ecx
1b9d: ba 56 55 55 55 mov $0x55555556,%edx
1ba2: 89 c8 mov %ecx,%eax
1ba4: f7 ea imul %edx
1ba6: 89 c8 mov %ecx,%eax
1ba8: c1 f8 1f sar $0x1f,%eax
1bab: 29 c2 sub %eax,%edx
1bad: 89 d0 mov %edx,%eax
1baf: 89 c2 mov %eax,%edx
1bb1: 01 d2 add %edx,%edx
1bb3: 01 c2 add %eax,%edx
1bb5: 89 c8 mov %ecx,%eax
1bb7: 29 d0 sub %edx,%eax
1bb9: 85 c0 test %eax,%eax
1bbb: 75 06 jne 1bc3 <concreate+0x2a3>
1bbd: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1bc1: 74 28 je 1beb <concreate+0x2cb>
((i % 3) == 1 && pid != 0)){
1bc3: 8b 4d f4 mov -0xc(%ebp),%ecx
1bc6: ba 56 55 55 55 mov $0x55555556,%edx
1bcb: 89 c8 mov %ecx,%eax
1bcd: f7 ea imul %edx
1bcf: 89 c8 mov %ecx,%eax
1bd1: c1 f8 1f sar $0x1f,%eax
1bd4: 29 c2 sub %eax,%edx
1bd6: 89 d0 mov %edx,%eax
1bd8: 01 c0 add %eax,%eax
1bda: 01 d0 add %edx,%eax
1bdc: 29 c1 sub %eax,%ecx
1bde: 89 ca mov %ecx,%edx
pid = fork();
if(pid < 0){
printf(1, "fork failed\n");
exit();
}
if(((i % 3) == 0 && pid == 0) ||
1be0: 83 fa 01 cmp $0x1,%edx
1be3: 75 7c jne 1c61 <concreate+0x341>
((i % 3) == 1 && pid != 0)){
1be5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1be9: 74 76 je 1c61 <concreate+0x341>
close(open(file, 0));
1beb: 83 ec 08 sub $0x8,%esp
1bee: 6a 00 push $0x0
1bf0: 8d 45 e5 lea -0x1b(%ebp),%eax
1bf3: 50 push %eax
1bf4: e8 e9 22 00 00 call 3ee2 <open>
1bf9: 83 c4 10 add $0x10,%esp
1bfc: 83 ec 0c sub $0xc,%esp
1bff: 50 push %eax
1c00: e8 c5 22 00 00 call 3eca <close>
1c05: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c08: 83 ec 08 sub $0x8,%esp
1c0b: 6a 00 push $0x0
1c0d: 8d 45 e5 lea -0x1b(%ebp),%eax
1c10: 50 push %eax
1c11: e8 cc 22 00 00 call 3ee2 <open>
1c16: 83 c4 10 add $0x10,%esp
1c19: 83 ec 0c sub $0xc,%esp
1c1c: 50 push %eax
1c1d: e8 a8 22 00 00 call 3eca <close>
1c22: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c25: 83 ec 08 sub $0x8,%esp
1c28: 6a 00 push $0x0
1c2a: 8d 45 e5 lea -0x1b(%ebp),%eax
1c2d: 50 push %eax
1c2e: e8 af 22 00 00 call 3ee2 <open>
1c33: 83 c4 10 add $0x10,%esp
1c36: 83 ec 0c sub $0xc,%esp
1c39: 50 push %eax
1c3a: e8 8b 22 00 00 call 3eca <close>
1c3f: 83 c4 10 add $0x10,%esp
close(open(file, 0));
1c42: 83 ec 08 sub $0x8,%esp
1c45: 6a 00 push $0x0
1c47: 8d 45 e5 lea -0x1b(%ebp),%eax
1c4a: 50 push %eax
1c4b: e8 92 22 00 00 call 3ee2 <open>
1c50: 83 c4 10 add $0x10,%esp
1c53: 83 ec 0c sub $0xc,%esp
1c56: 50 push %eax
1c57: e8 6e 22 00 00 call 3eca <close>
1c5c: 83 c4 10 add $0x10,%esp
1c5f: eb 3c jmp 1c9d <concreate+0x37d>
} else {
unlink(file);
1c61: 83 ec 0c sub $0xc,%esp
1c64: 8d 45 e5 lea -0x1b(%ebp),%eax
1c67: 50 push %eax
1c68: e8 85 22 00 00 call 3ef2 <unlink>
1c6d: 83 c4 10 add $0x10,%esp
unlink(file);
1c70: 83 ec 0c sub $0xc,%esp
1c73: 8d 45 e5 lea -0x1b(%ebp),%eax
1c76: 50 push %eax
1c77: e8 76 22 00 00 call 3ef2 <unlink>
1c7c: 83 c4 10 add $0x10,%esp
unlink(file);
1c7f: 83 ec 0c sub $0xc,%esp
1c82: 8d 45 e5 lea -0x1b(%ebp),%eax
1c85: 50 push %eax
1c86: e8 67 22 00 00 call 3ef2 <unlink>
1c8b: 83 c4 10 add $0x10,%esp
unlink(file);
1c8e: 83 ec 0c sub $0xc,%esp
1c91: 8d 45 e5 lea -0x1b(%ebp),%eax
1c94: 50 push %eax
1c95: e8 58 22 00 00 call 3ef2 <unlink>
1c9a: 83 c4 10 add $0x10,%esp
}
if(pid == 0)
1c9d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1ca1: 75 05 jne 1ca8 <concreate+0x388>
exit();
1ca3: e8 fa 21 00 00 call 3ea2 <exit>
else
wait();
1ca8: e8 fd 21 00 00 call 3eaa <wait>
if(n != 40){
printf(1, "concreate not enough files in directory listing\n");
exit();
}
for(i = 0; i < 40; i++){
1cad: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1cb1: 83 7d f4 27 cmpl $0x27,-0xc(%ebp)
1cb5: 0f 8e b1 fe ff ff jle 1b6c <concreate+0x24c>
exit();
else
wait();
}
printf(1, "concreate ok\n");
1cbb: 83 ec 08 sub $0x8,%esp
1cbe: 68 1d 4d 00 00 push $0x4d1d
1cc3: 6a 01 push $0x1
1cc5: e8 4f 23 00 00 call 4019 <printf>
1cca: 83 c4 10 add $0x10,%esp
}
1ccd: 90 nop
1cce: c9 leave
1ccf: c3 ret
00001cd0 <linkunlink>:
// another concurrent link/unlink/create test,
// to look for deadlocks.
void
linkunlink()
{
1cd0: 55 push %ebp
1cd1: 89 e5 mov %esp,%ebp
1cd3: 83 ec 18 sub $0x18,%esp
int pid, i;
printf(1, "linkunlink test\n");
1cd6: 83 ec 08 sub $0x8,%esp
1cd9: 68 2b 4d 00 00 push $0x4d2b
1cde: 6a 01 push $0x1
1ce0: e8 34 23 00 00 call 4019 <printf>
1ce5: 83 c4 10 add $0x10,%esp
unlink("x");
1ce8: 83 ec 0c sub $0xc,%esp
1ceb: 68 a7 48 00 00 push $0x48a7
1cf0: e8 fd 21 00 00 call 3ef2 <unlink>
1cf5: 83 c4 10 add $0x10,%esp
pid = fork();
1cf8: e8 9d 21 00 00 call 3e9a <fork>
1cfd: 89 45 ec mov %eax,-0x14(%ebp)
if(pid < 0){
1d00: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1d04: 79 17 jns 1d1d <linkunlink+0x4d>
printf(1, "fork failed\n");
1d06: 83 ec 08 sub $0x8,%esp
1d09: 68 71 44 00 00 push $0x4471
1d0e: 6a 01 push $0x1
1d10: e8 04 23 00 00 call 4019 <printf>
1d15: 83 c4 10 add $0x10,%esp
exit();
1d18: e8 85 21 00 00 call 3ea2 <exit>
}
unsigned int x = (pid ? 1 : 97);
1d1d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1d21: 74 07 je 1d2a <linkunlink+0x5a>
1d23: b8 01 00 00 00 mov $0x1,%eax
1d28: eb 05 jmp 1d2f <linkunlink+0x5f>
1d2a: b8 61 00 00 00 mov $0x61,%eax
1d2f: 89 45 f0 mov %eax,-0x10(%ebp)
for(i = 0; i < 100; i++){
1d32: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1d39: e9 9a 00 00 00 jmp 1dd8 <linkunlink+0x108>
x = x * 1103515245 + 12345;
1d3e: 8b 45 f0 mov -0x10(%ebp),%eax
1d41: 69 c0 6d 4e c6 41 imul $0x41c64e6d,%eax,%eax
1d47: 05 39 30 00 00 add $0x3039,%eax
1d4c: 89 45 f0 mov %eax,-0x10(%ebp)
if((x % 3) == 0){
1d4f: 8b 4d f0 mov -0x10(%ebp),%ecx
1d52: ba ab aa aa aa mov $0xaaaaaaab,%edx
1d57: 89 c8 mov %ecx,%eax
1d59: f7 e2 mul %edx
1d5b: 89 d0 mov %edx,%eax
1d5d: d1 e8 shr %eax
1d5f: 89 c2 mov %eax,%edx
1d61: 01 d2 add %edx,%edx
1d63: 01 c2 add %eax,%edx
1d65: 89 c8 mov %ecx,%eax
1d67: 29 d0 sub %edx,%eax
1d69: 85 c0 test %eax,%eax
1d6b: 75 23 jne 1d90 <linkunlink+0xc0>
close(open("x", O_RDWR | O_CREATE));
1d6d: 83 ec 08 sub $0x8,%esp
1d70: 68 02 02 00 00 push $0x202
1d75: 68 a7 48 00 00 push $0x48a7
1d7a: e8 63 21 00 00 call 3ee2 <open>
1d7f: 83 c4 10 add $0x10,%esp
1d82: 83 ec 0c sub $0xc,%esp
1d85: 50 push %eax
1d86: e8 3f 21 00 00 call 3eca <close>
1d8b: 83 c4 10 add $0x10,%esp
1d8e: eb 44 jmp 1dd4 <linkunlink+0x104>
} else if((x % 3) == 1){
1d90: 8b 4d f0 mov -0x10(%ebp),%ecx
1d93: ba ab aa aa aa mov $0xaaaaaaab,%edx
1d98: 89 c8 mov %ecx,%eax
1d9a: f7 e2 mul %edx
1d9c: d1 ea shr %edx
1d9e: 89 d0 mov %edx,%eax
1da0: 01 c0 add %eax,%eax
1da2: 01 d0 add %edx,%eax
1da4: 29 c1 sub %eax,%ecx
1da6: 89 ca mov %ecx,%edx
1da8: 83 fa 01 cmp $0x1,%edx
1dab: 75 17 jne 1dc4 <linkunlink+0xf4>
link("cat", "x");
1dad: 83 ec 08 sub $0x8,%esp
1db0: 68 a7 48 00 00 push $0x48a7
1db5: 68 3c 4d 00 00 push $0x4d3c
1dba: e8 43 21 00 00 call 3f02 <link>
1dbf: 83 c4 10 add $0x10,%esp
1dc2: eb 10 jmp 1dd4 <linkunlink+0x104>
} else {
unlink("x");
1dc4: 83 ec 0c sub $0xc,%esp
1dc7: 68 a7 48 00 00 push $0x48a7
1dcc: e8 21 21 00 00 call 3ef2 <unlink>
1dd1: 83 c4 10 add $0x10,%esp
printf(1, "fork failed\n");
exit();
}
unsigned int x = (pid ? 1 : 97);
for(i = 0; i < 100; i++){
1dd4: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1dd8: 83 7d f4 63 cmpl $0x63,-0xc(%ebp)
1ddc: 0f 8e 5c ff ff ff jle 1d3e <linkunlink+0x6e>
} else {
unlink("x");
}
}
if(pid)
1de2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1de6: 74 07 je 1def <linkunlink+0x11f>
wait();
1de8: e8 bd 20 00 00 call 3eaa <wait>
1ded: eb 05 jmp 1df4 <linkunlink+0x124>
else
exit();
1def: e8 ae 20 00 00 call 3ea2 <exit>
printf(1, "linkunlink ok\n");
1df4: 83 ec 08 sub $0x8,%esp
1df7: 68 40 4d 00 00 push $0x4d40
1dfc: 6a 01 push $0x1
1dfe: e8 16 22 00 00 call 4019 <printf>
1e03: 83 c4 10 add $0x10,%esp
}
1e06: 90 nop
1e07: c9 leave
1e08: c3 ret
00001e09 <bigdir>:
// directory that uses indirect blocks
void
bigdir(void)
{
1e09: 55 push %ebp
1e0a: 89 e5 mov %esp,%ebp
1e0c: 83 ec 28 sub $0x28,%esp
int i, fd;
char name[10];
printf(1, "bigdir test\n");
1e0f: 83 ec 08 sub $0x8,%esp
1e12: 68 4f 4d 00 00 push $0x4d4f
1e17: 6a 01 push $0x1
1e19: e8 fb 21 00 00 call 4019 <printf>
1e1e: 83 c4 10 add $0x10,%esp
unlink("bd");
1e21: 83 ec 0c sub $0xc,%esp
1e24: 68 5c 4d 00 00 push $0x4d5c
1e29: e8 c4 20 00 00 call 3ef2 <unlink>
1e2e: 83 c4 10 add $0x10,%esp
fd = open("bd", O_CREATE);
1e31: 83 ec 08 sub $0x8,%esp
1e34: 68 00 02 00 00 push $0x200
1e39: 68 5c 4d 00 00 push $0x4d5c
1e3e: e8 9f 20 00 00 call 3ee2 <open>
1e43: 83 c4 10 add $0x10,%esp
1e46: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd < 0){
1e49: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1e4d: 79 17 jns 1e66 <bigdir+0x5d>
printf(1, "bigdir create failed\n");
1e4f: 83 ec 08 sub $0x8,%esp
1e52: 68 5f 4d 00 00 push $0x4d5f
1e57: 6a 01 push $0x1
1e59: e8 bb 21 00 00 call 4019 <printf>
1e5e: 83 c4 10 add $0x10,%esp
exit();
1e61: e8 3c 20 00 00 call 3ea2 <exit>
}
close(fd);
1e66: 83 ec 0c sub $0xc,%esp
1e69: ff 75 f0 pushl -0x10(%ebp)
1e6c: e8 59 20 00 00 call 3eca <close>
1e71: 83 c4 10 add $0x10,%esp
for(i = 0; i < 500; i++){
1e74: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1e7b: eb 63 jmp 1ee0 <bigdir+0xd7>
name[0] = 'x';
1e7d: c6 45 e6 78 movb $0x78,-0x1a(%ebp)
name[1] = '0' + (i / 64);
1e81: 8b 45 f4 mov -0xc(%ebp),%eax
1e84: 8d 50 3f lea 0x3f(%eax),%edx
1e87: 85 c0 test %eax,%eax
1e89: 0f 48 c2 cmovs %edx,%eax
1e8c: c1 f8 06 sar $0x6,%eax
1e8f: 83 c0 30 add $0x30,%eax
1e92: 88 45 e7 mov %al,-0x19(%ebp)
name[2] = '0' + (i % 64);
1e95: 8b 45 f4 mov -0xc(%ebp),%eax
1e98: 99 cltd
1e99: c1 ea 1a shr $0x1a,%edx
1e9c: 01 d0 add %edx,%eax
1e9e: 83 e0 3f and $0x3f,%eax
1ea1: 29 d0 sub %edx,%eax
1ea3: 83 c0 30 add $0x30,%eax
1ea6: 88 45 e8 mov %al,-0x18(%ebp)
name[3] = '\0';
1ea9: c6 45 e9 00 movb $0x0,-0x17(%ebp)
if(link("bd", name) != 0){
1ead: 83 ec 08 sub $0x8,%esp
1eb0: 8d 45 e6 lea -0x1a(%ebp),%eax
1eb3: 50 push %eax
1eb4: 68 5c 4d 00 00 push $0x4d5c
1eb9: e8 44 20 00 00 call 3f02 <link>
1ebe: 83 c4 10 add $0x10,%esp
1ec1: 85 c0 test %eax,%eax
1ec3: 74 17 je 1edc <bigdir+0xd3>
printf(1, "bigdir link failed\n");
1ec5: 83 ec 08 sub $0x8,%esp
1ec8: 68 75 4d 00 00 push $0x4d75
1ecd: 6a 01 push $0x1
1ecf: e8 45 21 00 00 call 4019 <printf>
1ed4: 83 c4 10 add $0x10,%esp
exit();
1ed7: e8 c6 1f 00 00 call 3ea2 <exit>
printf(1, "bigdir create failed\n");
exit();
}
close(fd);
for(i = 0; i < 500; i++){
1edc: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1ee0: 81 7d f4 f3 01 00 00 cmpl $0x1f3,-0xc(%ebp)
1ee7: 7e 94 jle 1e7d <bigdir+0x74>
printf(1, "bigdir link failed\n");
exit();
}
}
unlink("bd");
1ee9: 83 ec 0c sub $0xc,%esp
1eec: 68 5c 4d 00 00 push $0x4d5c
1ef1: e8 fc 1f 00 00 call 3ef2 <unlink>
1ef6: 83 c4 10 add $0x10,%esp
for(i = 0; i < 500; i++){
1ef9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1f00: eb 5e jmp 1f60 <bigdir+0x157>
name[0] = 'x';
1f02: c6 45 e6 78 movb $0x78,-0x1a(%ebp)
name[1] = '0' + (i / 64);
1f06: 8b 45 f4 mov -0xc(%ebp),%eax
1f09: 8d 50 3f lea 0x3f(%eax),%edx
1f0c: 85 c0 test %eax,%eax
1f0e: 0f 48 c2 cmovs %edx,%eax
1f11: c1 f8 06 sar $0x6,%eax
1f14: 83 c0 30 add $0x30,%eax
1f17: 88 45 e7 mov %al,-0x19(%ebp)
name[2] = '0' + (i % 64);
1f1a: 8b 45 f4 mov -0xc(%ebp),%eax
1f1d: 99 cltd
1f1e: c1 ea 1a shr $0x1a,%edx
1f21: 01 d0 add %edx,%eax
1f23: 83 e0 3f and $0x3f,%eax
1f26: 29 d0 sub %edx,%eax
1f28: 83 c0 30 add $0x30,%eax
1f2b: 88 45 e8 mov %al,-0x18(%ebp)
name[3] = '\0';
1f2e: c6 45 e9 00 movb $0x0,-0x17(%ebp)
if(unlink(name) != 0){
1f32: 83 ec 0c sub $0xc,%esp
1f35: 8d 45 e6 lea -0x1a(%ebp),%eax
1f38: 50 push %eax
1f39: e8 b4 1f 00 00 call 3ef2 <unlink>
1f3e: 83 c4 10 add $0x10,%esp
1f41: 85 c0 test %eax,%eax
1f43: 74 17 je 1f5c <bigdir+0x153>
printf(1, "bigdir unlink failed");
1f45: 83 ec 08 sub $0x8,%esp
1f48: 68 89 4d 00 00 push $0x4d89
1f4d: 6a 01 push $0x1
1f4f: e8 c5 20 00 00 call 4019 <printf>
1f54: 83 c4 10 add $0x10,%esp
exit();
1f57: e8 46 1f 00 00 call 3ea2 <exit>
exit();
}
}
unlink("bd");
for(i = 0; i < 500; i++){
1f5c: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1f60: 81 7d f4 f3 01 00 00 cmpl $0x1f3,-0xc(%ebp)
1f67: 7e 99 jle 1f02 <bigdir+0xf9>
printf(1, "bigdir unlink failed");
exit();
}
}
printf(1, "bigdir ok\n");
1f69: 83 ec 08 sub $0x8,%esp
1f6c: 68 9e 4d 00 00 push $0x4d9e
1f71: 6a 01 push $0x1
1f73: e8 a1 20 00 00 call 4019 <printf>
1f78: 83 c4 10 add $0x10,%esp
}
1f7b: 90 nop
1f7c: c9 leave
1f7d: c3 ret
00001f7e <subdir>:
void
subdir(void)
{
1f7e: 55 push %ebp
1f7f: 89 e5 mov %esp,%ebp
1f81: 83 ec 18 sub $0x18,%esp
int fd, cc;
printf(1, "subdir test\n");
1f84: 83 ec 08 sub $0x8,%esp
1f87: 68 a9 4d 00 00 push $0x4da9
1f8c: 6a 01 push $0x1
1f8e: e8 86 20 00 00 call 4019 <printf>
1f93: 83 c4 10 add $0x10,%esp
unlink("ff");
1f96: 83 ec 0c sub $0xc,%esp
1f99: 68 b6 4d 00 00 push $0x4db6
1f9e: e8 4f 1f 00 00 call 3ef2 <unlink>
1fa3: 83 c4 10 add $0x10,%esp
if(mkdir("dd") != 0){
1fa6: 83 ec 0c sub $0xc,%esp
1fa9: 68 b9 4d 00 00 push $0x4db9
1fae: e8 57 1f 00 00 call 3f0a <mkdir>
1fb3: 83 c4 10 add $0x10,%esp
1fb6: 85 c0 test %eax,%eax
1fb8: 74 17 je 1fd1 <subdir+0x53>
printf(1, "subdir mkdir dd failed\n");
1fba: 83 ec 08 sub $0x8,%esp
1fbd: 68 bc 4d 00 00 push $0x4dbc
1fc2: 6a 01 push $0x1
1fc4: e8 50 20 00 00 call 4019 <printf>
1fc9: 83 c4 10 add $0x10,%esp
exit();
1fcc: e8 d1 1e 00 00 call 3ea2 <exit>
}
fd = open("dd/ff", O_CREATE | O_RDWR);
1fd1: 83 ec 08 sub $0x8,%esp
1fd4: 68 02 02 00 00 push $0x202
1fd9: 68 d4 4d 00 00 push $0x4dd4
1fde: e8 ff 1e 00 00 call 3ee2 <open>
1fe3: 83 c4 10 add $0x10,%esp
1fe6: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
1fe9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1fed: 79 17 jns 2006 <subdir+0x88>
printf(1, "create dd/ff failed\n");
1fef: 83 ec 08 sub $0x8,%esp
1ff2: 68 da 4d 00 00 push $0x4dda
1ff7: 6a 01 push $0x1
1ff9: e8 1b 20 00 00 call 4019 <printf>
1ffe: 83 c4 10 add $0x10,%esp
exit();
2001: e8 9c 1e 00 00 call 3ea2 <exit>
}
write(fd, "ff", 2);
2006: 83 ec 04 sub $0x4,%esp
2009: 6a 02 push $0x2
200b: 68 b6 4d 00 00 push $0x4db6
2010: ff 75 f4 pushl -0xc(%ebp)
2013: e8 aa 1e 00 00 call 3ec2 <write>
2018: 83 c4 10 add $0x10,%esp
close(fd);
201b: 83 ec 0c sub $0xc,%esp
201e: ff 75 f4 pushl -0xc(%ebp)
2021: e8 a4 1e 00 00 call 3eca <close>
2026: 83 c4 10 add $0x10,%esp
if(unlink("dd") >= 0){
2029: 83 ec 0c sub $0xc,%esp
202c: 68 b9 4d 00 00 push $0x4db9
2031: e8 bc 1e 00 00 call 3ef2 <unlink>
2036: 83 c4 10 add $0x10,%esp
2039: 85 c0 test %eax,%eax
203b: 78 17 js 2054 <subdir+0xd6>
printf(1, "unlink dd (non-empty dir) succeeded!\n");
203d: 83 ec 08 sub $0x8,%esp
2040: 68 f0 4d 00 00 push $0x4df0
2045: 6a 01 push $0x1
2047: e8 cd 1f 00 00 call 4019 <printf>
204c: 83 c4 10 add $0x10,%esp
exit();
204f: e8 4e 1e 00 00 call 3ea2 <exit>
}
if(mkdir("/dd/dd") != 0){
2054: 83 ec 0c sub $0xc,%esp
2057: 68 16 4e 00 00 push $0x4e16
205c: e8 a9 1e 00 00 call 3f0a <mkdir>
2061: 83 c4 10 add $0x10,%esp
2064: 85 c0 test %eax,%eax
2066: 74 17 je 207f <subdir+0x101>
printf(1, "subdir mkdir dd/dd failed\n");
2068: 83 ec 08 sub $0x8,%esp
206b: 68 1d 4e 00 00 push $0x4e1d
2070: 6a 01 push $0x1
2072: e8 a2 1f 00 00 call 4019 <printf>
2077: 83 c4 10 add $0x10,%esp
exit();
207a: e8 23 1e 00 00 call 3ea2 <exit>
}
fd = open("dd/dd/ff", O_CREATE | O_RDWR);
207f: 83 ec 08 sub $0x8,%esp
2082: 68 02 02 00 00 push $0x202
2087: 68 38 4e 00 00 push $0x4e38
208c: e8 51 1e 00 00 call 3ee2 <open>
2091: 83 c4 10 add $0x10,%esp
2094: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2097: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
209b: 79 17 jns 20b4 <subdir+0x136>
printf(1, "create dd/dd/ff failed\n");
209d: 83 ec 08 sub $0x8,%esp
20a0: 68 41 4e 00 00 push $0x4e41
20a5: 6a 01 push $0x1
20a7: e8 6d 1f 00 00 call 4019 <printf>
20ac: 83 c4 10 add $0x10,%esp
exit();
20af: e8 ee 1d 00 00 call 3ea2 <exit>
}
write(fd, "FF", 2);
20b4: 83 ec 04 sub $0x4,%esp
20b7: 6a 02 push $0x2
20b9: 68 59 4e 00 00 push $0x4e59
20be: ff 75 f4 pushl -0xc(%ebp)
20c1: e8 fc 1d 00 00 call 3ec2 <write>
20c6: 83 c4 10 add $0x10,%esp
close(fd);
20c9: 83 ec 0c sub $0xc,%esp
20cc: ff 75 f4 pushl -0xc(%ebp)
20cf: e8 f6 1d 00 00 call 3eca <close>
20d4: 83 c4 10 add $0x10,%esp
fd = open("dd/dd/../ff", 0);
20d7: 83 ec 08 sub $0x8,%esp
20da: 6a 00 push $0x0
20dc: 68 5c 4e 00 00 push $0x4e5c
20e1: e8 fc 1d 00 00 call 3ee2 <open>
20e6: 83 c4 10 add $0x10,%esp
20e9: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
20ec: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
20f0: 79 17 jns 2109 <subdir+0x18b>
printf(1, "open dd/dd/../ff failed\n");
20f2: 83 ec 08 sub $0x8,%esp
20f5: 68 68 4e 00 00 push $0x4e68
20fa: 6a 01 push $0x1
20fc: e8 18 1f 00 00 call 4019 <printf>
2101: 83 c4 10 add $0x10,%esp
exit();
2104: e8 99 1d 00 00 call 3ea2 <exit>
}
cc = read(fd, buf, sizeof(buf));
2109: 83 ec 04 sub $0x4,%esp
210c: 68 00 20 00 00 push $0x2000
2111: 68 80 8a 00 00 push $0x8a80
2116: ff 75 f4 pushl -0xc(%ebp)
2119: e8 9c 1d 00 00 call 3eba <read>
211e: 83 c4 10 add $0x10,%esp
2121: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc != 2 || buf[0] != 'f'){
2124: 83 7d f0 02 cmpl $0x2,-0x10(%ebp)
2128: 75 0b jne 2135 <subdir+0x1b7>
212a: 0f b6 05 80 8a 00 00 movzbl 0x8a80,%eax
2131: 3c 66 cmp $0x66,%al
2133: 74 17 je 214c <subdir+0x1ce>
printf(1, "dd/dd/../ff wrong content\n");
2135: 83 ec 08 sub $0x8,%esp
2138: 68 81 4e 00 00 push $0x4e81
213d: 6a 01 push $0x1
213f: e8 d5 1e 00 00 call 4019 <printf>
2144: 83 c4 10 add $0x10,%esp
exit();
2147: e8 56 1d 00 00 call 3ea2 <exit>
}
close(fd);
214c: 83 ec 0c sub $0xc,%esp
214f: ff 75 f4 pushl -0xc(%ebp)
2152: e8 73 1d 00 00 call 3eca <close>
2157: 83 c4 10 add $0x10,%esp
if(link("dd/dd/ff", "dd/dd/ffff") != 0){
215a: 83 ec 08 sub $0x8,%esp
215d: 68 9c 4e 00 00 push $0x4e9c
2162: 68 38 4e 00 00 push $0x4e38
2167: e8 96 1d 00 00 call 3f02 <link>
216c: 83 c4 10 add $0x10,%esp
216f: 85 c0 test %eax,%eax
2171: 74 17 je 218a <subdir+0x20c>
printf(1, "link dd/dd/ff dd/dd/ffff failed\n");
2173: 83 ec 08 sub $0x8,%esp
2176: 68 a8 4e 00 00 push $0x4ea8
217b: 6a 01 push $0x1
217d: e8 97 1e 00 00 call 4019 <printf>
2182: 83 c4 10 add $0x10,%esp
exit();
2185: e8 18 1d 00 00 call 3ea2 <exit>
}
if(unlink("dd/dd/ff") != 0){
218a: 83 ec 0c sub $0xc,%esp
218d: 68 38 4e 00 00 push $0x4e38
2192: e8 5b 1d 00 00 call 3ef2 <unlink>
2197: 83 c4 10 add $0x10,%esp
219a: 85 c0 test %eax,%eax
219c: 74 17 je 21b5 <subdir+0x237>
printf(1, "unlink dd/dd/ff failed\n");
219e: 83 ec 08 sub $0x8,%esp
21a1: 68 c9 4e 00 00 push $0x4ec9
21a6: 6a 01 push $0x1
21a8: e8 6c 1e 00 00 call 4019 <printf>
21ad: 83 c4 10 add $0x10,%esp
exit();
21b0: e8 ed 1c 00 00 call 3ea2 <exit>
}
if(open("dd/dd/ff", O_RDONLY) >= 0){
21b5: 83 ec 08 sub $0x8,%esp
21b8: 6a 00 push $0x0
21ba: 68 38 4e 00 00 push $0x4e38
21bf: e8 1e 1d 00 00 call 3ee2 <open>
21c4: 83 c4 10 add $0x10,%esp
21c7: 85 c0 test %eax,%eax
21c9: 78 17 js 21e2 <subdir+0x264>
printf(1, "open (unlinked) dd/dd/ff succeeded\n");
21cb: 83 ec 08 sub $0x8,%esp
21ce: 68 e4 4e 00 00 push $0x4ee4
21d3: 6a 01 push $0x1
21d5: e8 3f 1e 00 00 call 4019 <printf>
21da: 83 c4 10 add $0x10,%esp
exit();
21dd: e8 c0 1c 00 00 call 3ea2 <exit>
}
if(chdir("dd") != 0){
21e2: 83 ec 0c sub $0xc,%esp
21e5: 68 b9 4d 00 00 push $0x4db9
21ea: e8 23 1d 00 00 call 3f12 <chdir>
21ef: 83 c4 10 add $0x10,%esp
21f2: 85 c0 test %eax,%eax
21f4: 74 17 je 220d <subdir+0x28f>
printf(1, "chdir dd failed\n");
21f6: 83 ec 08 sub $0x8,%esp
21f9: 68 08 4f 00 00 push $0x4f08
21fe: 6a 01 push $0x1
2200: e8 14 1e 00 00 call 4019 <printf>
2205: 83 c4 10 add $0x10,%esp
exit();
2208: e8 95 1c 00 00 call 3ea2 <exit>
}
if(chdir("dd/../../dd") != 0){
220d: 83 ec 0c sub $0xc,%esp
2210: 68 19 4f 00 00 push $0x4f19
2215: e8 f8 1c 00 00 call 3f12 <chdir>
221a: 83 c4 10 add $0x10,%esp
221d: 85 c0 test %eax,%eax
221f: 74 17 je 2238 <subdir+0x2ba>
printf(1, "chdir dd/../../dd failed\n");
2221: 83 ec 08 sub $0x8,%esp
2224: 68 25 4f 00 00 push $0x4f25
2229: 6a 01 push $0x1
222b: e8 e9 1d 00 00 call 4019 <printf>
2230: 83 c4 10 add $0x10,%esp
exit();
2233: e8 6a 1c 00 00 call 3ea2 <exit>
}
if(chdir("dd/../../../dd") != 0){
2238: 83 ec 0c sub $0xc,%esp
223b: 68 3f 4f 00 00 push $0x4f3f
2240: e8 cd 1c 00 00 call 3f12 <chdir>
2245: 83 c4 10 add $0x10,%esp
2248: 85 c0 test %eax,%eax
224a: 74 17 je 2263 <subdir+0x2e5>
printf(1, "chdir dd/../../dd failed\n");
224c: 83 ec 08 sub $0x8,%esp
224f: 68 25 4f 00 00 push $0x4f25
2254: 6a 01 push $0x1
2256: e8 be 1d 00 00 call 4019 <printf>
225b: 83 c4 10 add $0x10,%esp
exit();
225e: e8 3f 1c 00 00 call 3ea2 <exit>
}
if(chdir("./..") != 0){
2263: 83 ec 0c sub $0xc,%esp
2266: 68 4e 4f 00 00 push $0x4f4e
226b: e8 a2 1c 00 00 call 3f12 <chdir>
2270: 83 c4 10 add $0x10,%esp
2273: 85 c0 test %eax,%eax
2275: 74 17 je 228e <subdir+0x310>
printf(1, "chdir ./.. failed\n");
2277: 83 ec 08 sub $0x8,%esp
227a: 68 53 4f 00 00 push $0x4f53
227f: 6a 01 push $0x1
2281: e8 93 1d 00 00 call 4019 <printf>
2286: 83 c4 10 add $0x10,%esp
exit();
2289: e8 14 1c 00 00 call 3ea2 <exit>
}
fd = open("dd/dd/ffff", 0);
228e: 83 ec 08 sub $0x8,%esp
2291: 6a 00 push $0x0
2293: 68 9c 4e 00 00 push $0x4e9c
2298: e8 45 1c 00 00 call 3ee2 <open>
229d: 83 c4 10 add $0x10,%esp
22a0: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
22a3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
22a7: 79 17 jns 22c0 <subdir+0x342>
printf(1, "open dd/dd/ffff failed\n");
22a9: 83 ec 08 sub $0x8,%esp
22ac: 68 66 4f 00 00 push $0x4f66
22b1: 6a 01 push $0x1
22b3: e8 61 1d 00 00 call 4019 <printf>
22b8: 83 c4 10 add $0x10,%esp
exit();
22bb: e8 e2 1b 00 00 call 3ea2 <exit>
}
if(read(fd, buf, sizeof(buf)) != 2){
22c0: 83 ec 04 sub $0x4,%esp
22c3: 68 00 20 00 00 push $0x2000
22c8: 68 80 8a 00 00 push $0x8a80
22cd: ff 75 f4 pushl -0xc(%ebp)
22d0: e8 e5 1b 00 00 call 3eba <read>
22d5: 83 c4 10 add $0x10,%esp
22d8: 83 f8 02 cmp $0x2,%eax
22db: 74 17 je 22f4 <subdir+0x376>
printf(1, "read dd/dd/ffff wrong len\n");
22dd: 83 ec 08 sub $0x8,%esp
22e0: 68 7e 4f 00 00 push $0x4f7e
22e5: 6a 01 push $0x1
22e7: e8 2d 1d 00 00 call 4019 <printf>
22ec: 83 c4 10 add $0x10,%esp
exit();
22ef: e8 ae 1b 00 00 call 3ea2 <exit>
}
close(fd);
22f4: 83 ec 0c sub $0xc,%esp
22f7: ff 75 f4 pushl -0xc(%ebp)
22fa: e8 cb 1b 00 00 call 3eca <close>
22ff: 83 c4 10 add $0x10,%esp
if(open("dd/dd/ff", O_RDONLY) >= 0){
2302: 83 ec 08 sub $0x8,%esp
2305: 6a 00 push $0x0
2307: 68 38 4e 00 00 push $0x4e38
230c: e8 d1 1b 00 00 call 3ee2 <open>
2311: 83 c4 10 add $0x10,%esp
2314: 85 c0 test %eax,%eax
2316: 78 17 js 232f <subdir+0x3b1>
printf(1, "open (unlinked) dd/dd/ff succeeded!\n");
2318: 83 ec 08 sub $0x8,%esp
231b: 68 9c 4f 00 00 push $0x4f9c
2320: 6a 01 push $0x1
2322: e8 f2 1c 00 00 call 4019 <printf>
2327: 83 c4 10 add $0x10,%esp
exit();
232a: e8 73 1b 00 00 call 3ea2 <exit>
}
if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){
232f: 83 ec 08 sub $0x8,%esp
2332: 68 02 02 00 00 push $0x202
2337: 68 c1 4f 00 00 push $0x4fc1
233c: e8 a1 1b 00 00 call 3ee2 <open>
2341: 83 c4 10 add $0x10,%esp
2344: 85 c0 test %eax,%eax
2346: 78 17 js 235f <subdir+0x3e1>
printf(1, "create dd/ff/ff succeeded!\n");
2348: 83 ec 08 sub $0x8,%esp
234b: 68 ca 4f 00 00 push $0x4fca
2350: 6a 01 push $0x1
2352: e8 c2 1c 00 00 call 4019 <printf>
2357: 83 c4 10 add $0x10,%esp
exit();
235a: e8 43 1b 00 00 call 3ea2 <exit>
}
if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){
235f: 83 ec 08 sub $0x8,%esp
2362: 68 02 02 00 00 push $0x202
2367: 68 e6 4f 00 00 push $0x4fe6
236c: e8 71 1b 00 00 call 3ee2 <open>
2371: 83 c4 10 add $0x10,%esp
2374: 85 c0 test %eax,%eax
2376: 78 17 js 238f <subdir+0x411>
printf(1, "create dd/xx/ff succeeded!\n");
2378: 83 ec 08 sub $0x8,%esp
237b: 68 ef 4f 00 00 push $0x4fef
2380: 6a 01 push $0x1
2382: e8 92 1c 00 00 call 4019 <printf>
2387: 83 c4 10 add $0x10,%esp
exit();
238a: e8 13 1b 00 00 call 3ea2 <exit>
}
if(open("dd", O_CREATE) >= 0){
238f: 83 ec 08 sub $0x8,%esp
2392: 68 00 02 00 00 push $0x200
2397: 68 b9 4d 00 00 push $0x4db9
239c: e8 41 1b 00 00 call 3ee2 <open>
23a1: 83 c4 10 add $0x10,%esp
23a4: 85 c0 test %eax,%eax
23a6: 78 17 js 23bf <subdir+0x441>
printf(1, "create dd succeeded!\n");
23a8: 83 ec 08 sub $0x8,%esp
23ab: 68 0b 50 00 00 push $0x500b
23b0: 6a 01 push $0x1
23b2: e8 62 1c 00 00 call 4019 <printf>
23b7: 83 c4 10 add $0x10,%esp
exit();
23ba: e8 e3 1a 00 00 call 3ea2 <exit>
}
if(open("dd", O_RDWR) >= 0){
23bf: 83 ec 08 sub $0x8,%esp
23c2: 6a 02 push $0x2
23c4: 68 b9 4d 00 00 push $0x4db9
23c9: e8 14 1b 00 00 call 3ee2 <open>
23ce: 83 c4 10 add $0x10,%esp
23d1: 85 c0 test %eax,%eax
23d3: 78 17 js 23ec <subdir+0x46e>
printf(1, "open dd rdwr succeeded!\n");
23d5: 83 ec 08 sub $0x8,%esp
23d8: 68 21 50 00 00 push $0x5021
23dd: 6a 01 push $0x1
23df: e8 35 1c 00 00 call 4019 <printf>
23e4: 83 c4 10 add $0x10,%esp
exit();
23e7: e8 b6 1a 00 00 call 3ea2 <exit>
}
if(open("dd", O_WRONLY) >= 0){
23ec: 83 ec 08 sub $0x8,%esp
23ef: 6a 01 push $0x1
23f1: 68 b9 4d 00 00 push $0x4db9
23f6: e8 e7 1a 00 00 call 3ee2 <open>
23fb: 83 c4 10 add $0x10,%esp
23fe: 85 c0 test %eax,%eax
2400: 78 17 js 2419 <subdir+0x49b>
printf(1, "open dd wronly succeeded!\n");
2402: 83 ec 08 sub $0x8,%esp
2405: 68 3a 50 00 00 push $0x503a
240a: 6a 01 push $0x1
240c: e8 08 1c 00 00 call 4019 <printf>
2411: 83 c4 10 add $0x10,%esp
exit();
2414: e8 89 1a 00 00 call 3ea2 <exit>
}
if(link("dd/ff/ff", "dd/dd/xx") == 0){
2419: 83 ec 08 sub $0x8,%esp
241c: 68 55 50 00 00 push $0x5055
2421: 68 c1 4f 00 00 push $0x4fc1
2426: e8 d7 1a 00 00 call 3f02 <link>
242b: 83 c4 10 add $0x10,%esp
242e: 85 c0 test %eax,%eax
2430: 75 17 jne 2449 <subdir+0x4cb>
printf(1, "link dd/ff/ff dd/dd/xx succeeded!\n");
2432: 83 ec 08 sub $0x8,%esp
2435: 68 60 50 00 00 push $0x5060
243a: 6a 01 push $0x1
243c: e8 d8 1b 00 00 call 4019 <printf>
2441: 83 c4 10 add $0x10,%esp
exit();
2444: e8 59 1a 00 00 call 3ea2 <exit>
}
if(link("dd/xx/ff", "dd/dd/xx") == 0){
2449: 83 ec 08 sub $0x8,%esp
244c: 68 55 50 00 00 push $0x5055
2451: 68 e6 4f 00 00 push $0x4fe6
2456: e8 a7 1a 00 00 call 3f02 <link>
245b: 83 c4 10 add $0x10,%esp
245e: 85 c0 test %eax,%eax
2460: 75 17 jne 2479 <subdir+0x4fb>
printf(1, "link dd/xx/ff dd/dd/xx succeeded!\n");
2462: 83 ec 08 sub $0x8,%esp
2465: 68 84 50 00 00 push $0x5084
246a: 6a 01 push $0x1
246c: e8 a8 1b 00 00 call 4019 <printf>
2471: 83 c4 10 add $0x10,%esp
exit();
2474: e8 29 1a 00 00 call 3ea2 <exit>
}
if(link("dd/ff", "dd/dd/ffff") == 0){
2479: 83 ec 08 sub $0x8,%esp
247c: 68 9c 4e 00 00 push $0x4e9c
2481: 68 d4 4d 00 00 push $0x4dd4
2486: e8 77 1a 00 00 call 3f02 <link>
248b: 83 c4 10 add $0x10,%esp
248e: 85 c0 test %eax,%eax
2490: 75 17 jne 24a9 <subdir+0x52b>
printf(1, "link dd/ff dd/dd/ffff succeeded!\n");
2492: 83 ec 08 sub $0x8,%esp
2495: 68 a8 50 00 00 push $0x50a8
249a: 6a 01 push $0x1
249c: e8 78 1b 00 00 call 4019 <printf>
24a1: 83 c4 10 add $0x10,%esp
exit();
24a4: e8 f9 19 00 00 call 3ea2 <exit>
}
if(mkdir("dd/ff/ff") == 0){
24a9: 83 ec 0c sub $0xc,%esp
24ac: 68 c1 4f 00 00 push $0x4fc1
24b1: e8 54 1a 00 00 call 3f0a <mkdir>
24b6: 83 c4 10 add $0x10,%esp
24b9: 85 c0 test %eax,%eax
24bb: 75 17 jne 24d4 <subdir+0x556>
printf(1, "mkdir dd/ff/ff succeeded!\n");
24bd: 83 ec 08 sub $0x8,%esp
24c0: 68 ca 50 00 00 push $0x50ca
24c5: 6a 01 push $0x1
24c7: e8 4d 1b 00 00 call 4019 <printf>
24cc: 83 c4 10 add $0x10,%esp
exit();
24cf: e8 ce 19 00 00 call 3ea2 <exit>
}
if(mkdir("dd/xx/ff") == 0){
24d4: 83 ec 0c sub $0xc,%esp
24d7: 68 e6 4f 00 00 push $0x4fe6
24dc: e8 29 1a 00 00 call 3f0a <mkdir>
24e1: 83 c4 10 add $0x10,%esp
24e4: 85 c0 test %eax,%eax
24e6: 75 17 jne 24ff <subdir+0x581>
printf(1, "mkdir dd/xx/ff succeeded!\n");
24e8: 83 ec 08 sub $0x8,%esp
24eb: 68 e5 50 00 00 push $0x50e5
24f0: 6a 01 push $0x1
24f2: e8 22 1b 00 00 call 4019 <printf>
24f7: 83 c4 10 add $0x10,%esp
exit();
24fa: e8 a3 19 00 00 call 3ea2 <exit>
}
if(mkdir("dd/dd/ffff") == 0){
24ff: 83 ec 0c sub $0xc,%esp
2502: 68 9c 4e 00 00 push $0x4e9c
2507: e8 fe 19 00 00 call 3f0a <mkdir>
250c: 83 c4 10 add $0x10,%esp
250f: 85 c0 test %eax,%eax
2511: 75 17 jne 252a <subdir+0x5ac>
printf(1, "mkdir dd/dd/ffff succeeded!\n");
2513: 83 ec 08 sub $0x8,%esp
2516: 68 00 51 00 00 push $0x5100
251b: 6a 01 push $0x1
251d: e8 f7 1a 00 00 call 4019 <printf>
2522: 83 c4 10 add $0x10,%esp
exit();
2525: e8 78 19 00 00 call 3ea2 <exit>
}
if(unlink("dd/xx/ff") == 0){
252a: 83 ec 0c sub $0xc,%esp
252d: 68 e6 4f 00 00 push $0x4fe6
2532: e8 bb 19 00 00 call 3ef2 <unlink>
2537: 83 c4 10 add $0x10,%esp
253a: 85 c0 test %eax,%eax
253c: 75 17 jne 2555 <subdir+0x5d7>
printf(1, "unlink dd/xx/ff succeeded!\n");
253e: 83 ec 08 sub $0x8,%esp
2541: 68 1d 51 00 00 push $0x511d
2546: 6a 01 push $0x1
2548: e8 cc 1a 00 00 call 4019 <printf>
254d: 83 c4 10 add $0x10,%esp
exit();
2550: e8 4d 19 00 00 call 3ea2 <exit>
}
if(unlink("dd/ff/ff") == 0){
2555: 83 ec 0c sub $0xc,%esp
2558: 68 c1 4f 00 00 push $0x4fc1
255d: e8 90 19 00 00 call 3ef2 <unlink>
2562: 83 c4 10 add $0x10,%esp
2565: 85 c0 test %eax,%eax
2567: 75 17 jne 2580 <subdir+0x602>
printf(1, "unlink dd/ff/ff succeeded!\n");
2569: 83 ec 08 sub $0x8,%esp
256c: 68 39 51 00 00 push $0x5139
2571: 6a 01 push $0x1
2573: e8 a1 1a 00 00 call 4019 <printf>
2578: 83 c4 10 add $0x10,%esp
exit();
257b: e8 22 19 00 00 call 3ea2 <exit>
}
if(chdir("dd/ff") == 0){
2580: 83 ec 0c sub $0xc,%esp
2583: 68 d4 4d 00 00 push $0x4dd4
2588: e8 85 19 00 00 call 3f12 <chdir>
258d: 83 c4 10 add $0x10,%esp
2590: 85 c0 test %eax,%eax
2592: 75 17 jne 25ab <subdir+0x62d>
printf(1, "chdir dd/ff succeeded!\n");
2594: 83 ec 08 sub $0x8,%esp
2597: 68 55 51 00 00 push $0x5155
259c: 6a 01 push $0x1
259e: e8 76 1a 00 00 call 4019 <printf>
25a3: 83 c4 10 add $0x10,%esp
exit();
25a6: e8 f7 18 00 00 call 3ea2 <exit>
}
if(chdir("dd/xx") == 0){
25ab: 83 ec 0c sub $0xc,%esp
25ae: 68 6d 51 00 00 push $0x516d
25b3: e8 5a 19 00 00 call 3f12 <chdir>
25b8: 83 c4 10 add $0x10,%esp
25bb: 85 c0 test %eax,%eax
25bd: 75 17 jne 25d6 <subdir+0x658>
printf(1, "chdir dd/xx succeeded!\n");
25bf: 83 ec 08 sub $0x8,%esp
25c2: 68 73 51 00 00 push $0x5173
25c7: 6a 01 push $0x1
25c9: e8 4b 1a 00 00 call 4019 <printf>
25ce: 83 c4 10 add $0x10,%esp
exit();
25d1: e8 cc 18 00 00 call 3ea2 <exit>
}
if(unlink("dd/dd/ffff") != 0){
25d6: 83 ec 0c sub $0xc,%esp
25d9: 68 9c 4e 00 00 push $0x4e9c
25de: e8 0f 19 00 00 call 3ef2 <unlink>
25e3: 83 c4 10 add $0x10,%esp
25e6: 85 c0 test %eax,%eax
25e8: 74 17 je 2601 <subdir+0x683>
printf(1, "unlink dd/dd/ff failed\n");
25ea: 83 ec 08 sub $0x8,%esp
25ed: 68 c9 4e 00 00 push $0x4ec9
25f2: 6a 01 push $0x1
25f4: e8 20 1a 00 00 call 4019 <printf>
25f9: 83 c4 10 add $0x10,%esp
exit();
25fc: e8 a1 18 00 00 call 3ea2 <exit>
}
if(unlink("dd/ff") != 0){
2601: 83 ec 0c sub $0xc,%esp
2604: 68 d4 4d 00 00 push $0x4dd4
2609: e8 e4 18 00 00 call 3ef2 <unlink>
260e: 83 c4 10 add $0x10,%esp
2611: 85 c0 test %eax,%eax
2613: 74 17 je 262c <subdir+0x6ae>
printf(1, "unlink dd/ff failed\n");
2615: 83 ec 08 sub $0x8,%esp
2618: 68 8b 51 00 00 push $0x518b
261d: 6a 01 push $0x1
261f: e8 f5 19 00 00 call 4019 <printf>
2624: 83 c4 10 add $0x10,%esp
exit();
2627: e8 76 18 00 00 call 3ea2 <exit>
}
if(unlink("dd") == 0){
262c: 83 ec 0c sub $0xc,%esp
262f: 68 b9 4d 00 00 push $0x4db9
2634: e8 b9 18 00 00 call 3ef2 <unlink>
2639: 83 c4 10 add $0x10,%esp
263c: 85 c0 test %eax,%eax
263e: 75 17 jne 2657 <subdir+0x6d9>
printf(1, "unlink non-empty dd succeeded!\n");
2640: 83 ec 08 sub $0x8,%esp
2643: 68 a0 51 00 00 push $0x51a0
2648: 6a 01 push $0x1
264a: e8 ca 19 00 00 call 4019 <printf>
264f: 83 c4 10 add $0x10,%esp
exit();
2652: e8 4b 18 00 00 call 3ea2 <exit>
}
if(unlink("dd/dd") < 0){
2657: 83 ec 0c sub $0xc,%esp
265a: 68 c0 51 00 00 push $0x51c0
265f: e8 8e 18 00 00 call 3ef2 <unlink>
2664: 83 c4 10 add $0x10,%esp
2667: 85 c0 test %eax,%eax
2669: 79 17 jns 2682 <subdir+0x704>
printf(1, "unlink dd/dd failed\n");
266b: 83 ec 08 sub $0x8,%esp
266e: 68 c6 51 00 00 push $0x51c6
2673: 6a 01 push $0x1
2675: e8 9f 19 00 00 call 4019 <printf>
267a: 83 c4 10 add $0x10,%esp
exit();
267d: e8 20 18 00 00 call 3ea2 <exit>
}
if(unlink("dd") < 0){
2682: 83 ec 0c sub $0xc,%esp
2685: 68 b9 4d 00 00 push $0x4db9
268a: e8 63 18 00 00 call 3ef2 <unlink>
268f: 83 c4 10 add $0x10,%esp
2692: 85 c0 test %eax,%eax
2694: 79 17 jns 26ad <subdir+0x72f>
printf(1, "unlink dd failed\n");
2696: 83 ec 08 sub $0x8,%esp
2699: 68 db 51 00 00 push $0x51db
269e: 6a 01 push $0x1
26a0: e8 74 19 00 00 call 4019 <printf>
26a5: 83 c4 10 add $0x10,%esp
exit();
26a8: e8 f5 17 00 00 call 3ea2 <exit>
}
printf(1, "subdir ok\n");
26ad: 83 ec 08 sub $0x8,%esp
26b0: 68 ed 51 00 00 push $0x51ed
26b5: 6a 01 push $0x1
26b7: e8 5d 19 00 00 call 4019 <printf>
26bc: 83 c4 10 add $0x10,%esp
}
26bf: 90 nop
26c0: c9 leave
26c1: c3 ret
000026c2 <bigwrite>:
// test writes that are larger than the log.
void
bigwrite(void)
{
26c2: 55 push %ebp
26c3: 89 e5 mov %esp,%ebp
26c5: 83 ec 18 sub $0x18,%esp
int fd, sz;
printf(1, "bigwrite test\n");
26c8: 83 ec 08 sub $0x8,%esp
26cb: 68 f8 51 00 00 push $0x51f8
26d0: 6a 01 push $0x1
26d2: e8 42 19 00 00 call 4019 <printf>
26d7: 83 c4 10 add $0x10,%esp
unlink("bigwrite");
26da: 83 ec 0c sub $0xc,%esp
26dd: 68 07 52 00 00 push $0x5207
26e2: e8 0b 18 00 00 call 3ef2 <unlink>
26e7: 83 c4 10 add $0x10,%esp
for(sz = 499; sz < 12*512; sz += 471){
26ea: c7 45 f4 f3 01 00 00 movl $0x1f3,-0xc(%ebp)
26f1: e9 a8 00 00 00 jmp 279e <bigwrite+0xdc>
fd = open("bigwrite", O_CREATE | O_RDWR);
26f6: 83 ec 08 sub $0x8,%esp
26f9: 68 02 02 00 00 push $0x202
26fe: 68 07 52 00 00 push $0x5207
2703: e8 da 17 00 00 call 3ee2 <open>
2708: 83 c4 10 add $0x10,%esp
270b: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
270e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
2712: 79 17 jns 272b <bigwrite+0x69>
printf(1, "cannot create bigwrite\n");
2714: 83 ec 08 sub $0x8,%esp
2717: 68 10 52 00 00 push $0x5210
271c: 6a 01 push $0x1
271e: e8 f6 18 00 00 call 4019 <printf>
2723: 83 c4 10 add $0x10,%esp
exit();
2726: e8 77 17 00 00 call 3ea2 <exit>
}
int i;
for(i = 0; i < 2; i++){
272b: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
2732: eb 3f jmp 2773 <bigwrite+0xb1>
int cc = write(fd, buf, sz);
2734: 83 ec 04 sub $0x4,%esp
2737: ff 75 f4 pushl -0xc(%ebp)
273a: 68 80 8a 00 00 push $0x8a80
273f: ff 75 ec pushl -0x14(%ebp)
2742: e8 7b 17 00 00 call 3ec2 <write>
2747: 83 c4 10 add $0x10,%esp
274a: 89 45 e8 mov %eax,-0x18(%ebp)
if(cc != sz){
274d: 8b 45 e8 mov -0x18(%ebp),%eax
2750: 3b 45 f4 cmp -0xc(%ebp),%eax
2753: 74 1a je 276f <bigwrite+0xad>
printf(1, "write(%d) ret %d\n", sz, cc);
2755: ff 75 e8 pushl -0x18(%ebp)
2758: ff 75 f4 pushl -0xc(%ebp)
275b: 68 28 52 00 00 push $0x5228
2760: 6a 01 push $0x1
2762: e8 b2 18 00 00 call 4019 <printf>
2767: 83 c4 10 add $0x10,%esp
exit();
276a: e8 33 17 00 00 call 3ea2 <exit>
if(fd < 0){
printf(1, "cannot create bigwrite\n");
exit();
}
int i;
for(i = 0; i < 2; i++){
276f: 83 45 f0 01 addl $0x1,-0x10(%ebp)
2773: 83 7d f0 01 cmpl $0x1,-0x10(%ebp)
2777: 7e bb jle 2734 <bigwrite+0x72>
if(cc != sz){
printf(1, "write(%d) ret %d\n", sz, cc);
exit();
}
}
close(fd);
2779: 83 ec 0c sub $0xc,%esp
277c: ff 75 ec pushl -0x14(%ebp)
277f: e8 46 17 00 00 call 3eca <close>
2784: 83 c4 10 add $0x10,%esp
unlink("bigwrite");
2787: 83 ec 0c sub $0xc,%esp
278a: 68 07 52 00 00 push $0x5207
278f: e8 5e 17 00 00 call 3ef2 <unlink>
2794: 83 c4 10 add $0x10,%esp
int fd, sz;
printf(1, "bigwrite test\n");
unlink("bigwrite");
for(sz = 499; sz < 12*512; sz += 471){
2797: 81 45 f4 d7 01 00 00 addl $0x1d7,-0xc(%ebp)
279e: 81 7d f4 ff 17 00 00 cmpl $0x17ff,-0xc(%ebp)
27a5: 0f 8e 4b ff ff ff jle 26f6 <bigwrite+0x34>
}
close(fd);
unlink("bigwrite");
}
printf(1, "bigwrite ok\n");
27ab: 83 ec 08 sub $0x8,%esp
27ae: 68 3a 52 00 00 push $0x523a
27b3: 6a 01 push $0x1
27b5: e8 5f 18 00 00 call 4019 <printf>
27ba: 83 c4 10 add $0x10,%esp
}
27bd: 90 nop
27be: c9 leave
27bf: c3 ret
000027c0 <bigfile>:
void
bigfile(void)
{
27c0: 55 push %ebp
27c1: 89 e5 mov %esp,%ebp
27c3: 83 ec 18 sub $0x18,%esp
int fd, i, total, cc;
printf(1, "bigfile test\n");
27c6: 83 ec 08 sub $0x8,%esp
27c9: 68 47 52 00 00 push $0x5247
27ce: 6a 01 push $0x1
27d0: e8 44 18 00 00 call 4019 <printf>
27d5: 83 c4 10 add $0x10,%esp
unlink("bigfile");
27d8: 83 ec 0c sub $0xc,%esp
27db: 68 55 52 00 00 push $0x5255
27e0: e8 0d 17 00 00 call 3ef2 <unlink>
27e5: 83 c4 10 add $0x10,%esp
fd = open("bigfile", O_CREATE | O_RDWR);
27e8: 83 ec 08 sub $0x8,%esp
27eb: 68 02 02 00 00 push $0x202
27f0: 68 55 52 00 00 push $0x5255
27f5: e8 e8 16 00 00 call 3ee2 <open>
27fa: 83 c4 10 add $0x10,%esp
27fd: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
2800: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
2804: 79 17 jns 281d <bigfile+0x5d>
printf(1, "cannot create bigfile");
2806: 83 ec 08 sub $0x8,%esp
2809: 68 5d 52 00 00 push $0x525d
280e: 6a 01 push $0x1
2810: e8 04 18 00 00 call 4019 <printf>
2815: 83 c4 10 add $0x10,%esp
exit();
2818: e8 85 16 00 00 call 3ea2 <exit>
}
for(i = 0; i < 20; i++){
281d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
2824: eb 52 jmp 2878 <bigfile+0xb8>
memset(buf, i, 600);
2826: 83 ec 04 sub $0x4,%esp
2829: 68 58 02 00 00 push $0x258
282e: ff 75 f4 pushl -0xc(%ebp)
2831: 68 80 8a 00 00 push $0x8a80
2836: e8 cc 14 00 00 call 3d07 <memset>
283b: 83 c4 10 add $0x10,%esp
if(write(fd, buf, 600) != 600){
283e: 83 ec 04 sub $0x4,%esp
2841: 68 58 02 00 00 push $0x258
2846: 68 80 8a 00 00 push $0x8a80
284b: ff 75 ec pushl -0x14(%ebp)
284e: e8 6f 16 00 00 call 3ec2 <write>
2853: 83 c4 10 add $0x10,%esp
2856: 3d 58 02 00 00 cmp $0x258,%eax
285b: 74 17 je 2874 <bigfile+0xb4>
printf(1, "write bigfile failed\n");
285d: 83 ec 08 sub $0x8,%esp
2860: 68 73 52 00 00 push $0x5273
2865: 6a 01 push $0x1
2867: e8 ad 17 00 00 call 4019 <printf>
286c: 83 c4 10 add $0x10,%esp
exit();
286f: e8 2e 16 00 00 call 3ea2 <exit>
fd = open("bigfile", O_CREATE | O_RDWR);
if(fd < 0){
printf(1, "cannot create bigfile");
exit();
}
for(i = 0; i < 20; i++){
2874: 83 45 f4 01 addl $0x1,-0xc(%ebp)
2878: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
287c: 7e a8 jle 2826 <bigfile+0x66>
if(write(fd, buf, 600) != 600){
printf(1, "write bigfile failed\n");
exit();
}
}
close(fd);
287e: 83 ec 0c sub $0xc,%esp
2881: ff 75 ec pushl -0x14(%ebp)
2884: e8 41 16 00 00 call 3eca <close>
2889: 83 c4 10 add $0x10,%esp
fd = open("bigfile", 0);
288c: 83 ec 08 sub $0x8,%esp
288f: 6a 00 push $0x0
2891: 68 55 52 00 00 push $0x5255
2896: e8 47 16 00 00 call 3ee2 <open>
289b: 83 c4 10 add $0x10,%esp
289e: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
28a1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
28a5: 79 17 jns 28be <bigfile+0xfe>
printf(1, "cannot open bigfile\n");
28a7: 83 ec 08 sub $0x8,%esp
28aa: 68 89 52 00 00 push $0x5289
28af: 6a 01 push $0x1
28b1: e8 63 17 00 00 call 4019 <printf>
28b6: 83 c4 10 add $0x10,%esp
exit();
28b9: e8 e4 15 00 00 call 3ea2 <exit>
}
total = 0;
28be: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
for(i = 0; ; i++){
28c5: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
cc = read(fd, buf, 300);
28cc: 83 ec 04 sub $0x4,%esp
28cf: 68 2c 01 00 00 push $0x12c
28d4: 68 80 8a 00 00 push $0x8a80
28d9: ff 75 ec pushl -0x14(%ebp)
28dc: e8 d9 15 00 00 call 3eba <read>
28e1: 83 c4 10 add $0x10,%esp
28e4: 89 45 e8 mov %eax,-0x18(%ebp)
if(cc < 0){
28e7: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
28eb: 79 17 jns 2904 <bigfile+0x144>
printf(1, "read bigfile failed\n");
28ed: 83 ec 08 sub $0x8,%esp
28f0: 68 9e 52 00 00 push $0x529e
28f5: 6a 01 push $0x1
28f7: e8 1d 17 00 00 call 4019 <printf>
28fc: 83 c4 10 add $0x10,%esp
exit();
28ff: e8 9e 15 00 00 call 3ea2 <exit>
}
if(cc == 0)
2904: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
2908: 74 7a je 2984 <bigfile+0x1c4>
break;
if(cc != 300){
290a: 81 7d e8 2c 01 00 00 cmpl $0x12c,-0x18(%ebp)
2911: 74 17 je 292a <bigfile+0x16a>
printf(1, "short read bigfile\n");
2913: 83 ec 08 sub $0x8,%esp
2916: 68 b3 52 00 00 push $0x52b3
291b: 6a 01 push $0x1
291d: e8 f7 16 00 00 call 4019 <printf>
2922: 83 c4 10 add $0x10,%esp
exit();
2925: e8 78 15 00 00 call 3ea2 <exit>
}
if(buf[0] != i/2 || buf[299] != i/2){
292a: 0f b6 05 80 8a 00 00 movzbl 0x8a80,%eax
2931: 0f be d0 movsbl %al,%edx
2934: 8b 45 f4 mov -0xc(%ebp),%eax
2937: 89 c1 mov %eax,%ecx
2939: c1 e9 1f shr $0x1f,%ecx
293c: 01 c8 add %ecx,%eax
293e: d1 f8 sar %eax
2940: 39 c2 cmp %eax,%edx
2942: 75 1a jne 295e <bigfile+0x19e>
2944: 0f b6 05 ab 8b 00 00 movzbl 0x8bab,%eax
294b: 0f be d0 movsbl %al,%edx
294e: 8b 45 f4 mov -0xc(%ebp),%eax
2951: 89 c1 mov %eax,%ecx
2953: c1 e9 1f shr $0x1f,%ecx
2956: 01 c8 add %ecx,%eax
2958: d1 f8 sar %eax
295a: 39 c2 cmp %eax,%edx
295c: 74 17 je 2975 <bigfile+0x1b5>
printf(1, "read bigfile wrong data\n");
295e: 83 ec 08 sub $0x8,%esp
2961: 68 c7 52 00 00 push $0x52c7
2966: 6a 01 push $0x1
2968: e8 ac 16 00 00 call 4019 <printf>
296d: 83 c4 10 add $0x10,%esp
exit();
2970: e8 2d 15 00 00 call 3ea2 <exit>
}
total += cc;
2975: 8b 45 e8 mov -0x18(%ebp),%eax
2978: 01 45 f0 add %eax,-0x10(%ebp)
if(fd < 0){
printf(1, "cannot open bigfile\n");
exit();
}
total = 0;
for(i = 0; ; i++){
297b: 83 45 f4 01 addl $0x1,-0xc(%ebp)
if(buf[0] != i/2 || buf[299] != i/2){
printf(1, "read bigfile wrong data\n");
exit();
}
total += cc;
}
297f: e9 48 ff ff ff jmp 28cc <bigfile+0x10c>
if(cc < 0){
printf(1, "read bigfile failed\n");
exit();
}
if(cc == 0)
break;
2984: 90 nop
printf(1, "read bigfile wrong data\n");
exit();
}
total += cc;
}
close(fd);
2985: 83 ec 0c sub $0xc,%esp
2988: ff 75 ec pushl -0x14(%ebp)
298b: e8 3a 15 00 00 call 3eca <close>
2990: 83 c4 10 add $0x10,%esp
if(total != 20*600){
2993: 81 7d f0 e0 2e 00 00 cmpl $0x2ee0,-0x10(%ebp)
299a: 74 17 je 29b3 <bigfile+0x1f3>
printf(1, "read bigfile wrong total\n");
299c: 83 ec 08 sub $0x8,%esp
299f: 68 e0 52 00 00 push $0x52e0
29a4: 6a 01 push $0x1
29a6: e8 6e 16 00 00 call 4019 <printf>
29ab: 83 c4 10 add $0x10,%esp
exit();
29ae: e8 ef 14 00 00 call 3ea2 <exit>
}
unlink("bigfile");
29b3: 83 ec 0c sub $0xc,%esp
29b6: 68 55 52 00 00 push $0x5255
29bb: e8 32 15 00 00 call 3ef2 <unlink>
29c0: 83 c4 10 add $0x10,%esp
printf(1, "bigfile test ok\n");
29c3: 83 ec 08 sub $0x8,%esp
29c6: 68 fa 52 00 00 push $0x52fa
29cb: 6a 01 push $0x1
29cd: e8 47 16 00 00 call 4019 <printf>
29d2: 83 c4 10 add $0x10,%esp
}
29d5: 90 nop
29d6: c9 leave
29d7: c3 ret
000029d8 <fourteen>:
void
fourteen(void)
{
29d8: 55 push %ebp
29d9: 89 e5 mov %esp,%ebp
29db: 83 ec 18 sub $0x18,%esp
int fd;
// DIRSIZ is 14.
printf(1, "fourteen test\n");
29de: 83 ec 08 sub $0x8,%esp
29e1: 68 0b 53 00 00 push $0x530b
29e6: 6a 01 push $0x1
29e8: e8 2c 16 00 00 call 4019 <printf>
29ed: 83 c4 10 add $0x10,%esp
if(mkdir("12345678901234") != 0){
29f0: 83 ec 0c sub $0xc,%esp
29f3: 68 1a 53 00 00 push $0x531a
29f8: e8 0d 15 00 00 call 3f0a <mkdir>
29fd: 83 c4 10 add $0x10,%esp
2a00: 85 c0 test %eax,%eax
2a02: 74 17 je 2a1b <fourteen+0x43>
printf(1, "mkdir 12345678901234 failed\n");
2a04: 83 ec 08 sub $0x8,%esp
2a07: 68 29 53 00 00 push $0x5329
2a0c: 6a 01 push $0x1
2a0e: e8 06 16 00 00 call 4019 <printf>
2a13: 83 c4 10 add $0x10,%esp
exit();
2a16: e8 87 14 00 00 call 3ea2 <exit>
}
if(mkdir("12345678901234/123456789012345") != 0){
2a1b: 83 ec 0c sub $0xc,%esp
2a1e: 68 48 53 00 00 push $0x5348
2a23: e8 e2 14 00 00 call 3f0a <mkdir>
2a28: 83 c4 10 add $0x10,%esp
2a2b: 85 c0 test %eax,%eax
2a2d: 74 17 je 2a46 <fourteen+0x6e>
printf(1, "mkdir 12345678901234/123456789012345 failed\n");
2a2f: 83 ec 08 sub $0x8,%esp
2a32: 68 68 53 00 00 push $0x5368
2a37: 6a 01 push $0x1
2a39: e8 db 15 00 00 call 4019 <printf>
2a3e: 83 c4 10 add $0x10,%esp
exit();
2a41: e8 5c 14 00 00 call 3ea2 <exit>
}
fd = open("123456789012345/123456789012345/123456789012345", O_CREATE);
2a46: 83 ec 08 sub $0x8,%esp
2a49: 68 00 02 00 00 push $0x200
2a4e: 68 98 53 00 00 push $0x5398
2a53: e8 8a 14 00 00 call 3ee2 <open>
2a58: 83 c4 10 add $0x10,%esp
2a5b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2a5e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2a62: 79 17 jns 2a7b <fourteen+0xa3>
printf(1, "create 123456789012345/123456789012345/123456789012345 failed\n");
2a64: 83 ec 08 sub $0x8,%esp
2a67: 68 c8 53 00 00 push $0x53c8
2a6c: 6a 01 push $0x1
2a6e: e8 a6 15 00 00 call 4019 <printf>
2a73: 83 c4 10 add $0x10,%esp
exit();
2a76: e8 27 14 00 00 call 3ea2 <exit>
}
close(fd);
2a7b: 83 ec 0c sub $0xc,%esp
2a7e: ff 75 f4 pushl -0xc(%ebp)
2a81: e8 44 14 00 00 call 3eca <close>
2a86: 83 c4 10 add $0x10,%esp
fd = open("12345678901234/12345678901234/12345678901234", 0);
2a89: 83 ec 08 sub $0x8,%esp
2a8c: 6a 00 push $0x0
2a8e: 68 08 54 00 00 push $0x5408
2a93: e8 4a 14 00 00 call 3ee2 <open>
2a98: 83 c4 10 add $0x10,%esp
2a9b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2a9e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2aa2: 79 17 jns 2abb <fourteen+0xe3>
printf(1, "open 12345678901234/12345678901234/12345678901234 failed\n");
2aa4: 83 ec 08 sub $0x8,%esp
2aa7: 68 38 54 00 00 push $0x5438
2aac: 6a 01 push $0x1
2aae: e8 66 15 00 00 call 4019 <printf>
2ab3: 83 c4 10 add $0x10,%esp
exit();
2ab6: e8 e7 13 00 00 call 3ea2 <exit>
}
close(fd);
2abb: 83 ec 0c sub $0xc,%esp
2abe: ff 75 f4 pushl -0xc(%ebp)
2ac1: e8 04 14 00 00 call 3eca <close>
2ac6: 83 c4 10 add $0x10,%esp
if(mkdir("12345678901234/12345678901234") == 0){
2ac9: 83 ec 0c sub $0xc,%esp
2acc: 68 72 54 00 00 push $0x5472
2ad1: e8 34 14 00 00 call 3f0a <mkdir>
2ad6: 83 c4 10 add $0x10,%esp
2ad9: 85 c0 test %eax,%eax
2adb: 75 17 jne 2af4 <fourteen+0x11c>
printf(1, "mkdir 12345678901234/12345678901234 succeeded!\n");
2add: 83 ec 08 sub $0x8,%esp
2ae0: 68 90 54 00 00 push $0x5490
2ae5: 6a 01 push $0x1
2ae7: e8 2d 15 00 00 call 4019 <printf>
2aec: 83 c4 10 add $0x10,%esp
exit();
2aef: e8 ae 13 00 00 call 3ea2 <exit>
}
if(mkdir("123456789012345/12345678901234") == 0){
2af4: 83 ec 0c sub $0xc,%esp
2af7: 68 c0 54 00 00 push $0x54c0
2afc: e8 09 14 00 00 call 3f0a <mkdir>
2b01: 83 c4 10 add $0x10,%esp
2b04: 85 c0 test %eax,%eax
2b06: 75 17 jne 2b1f <fourteen+0x147>
printf(1, "mkdir 12345678901234/123456789012345 succeeded!\n");
2b08: 83 ec 08 sub $0x8,%esp
2b0b: 68 e0 54 00 00 push $0x54e0
2b10: 6a 01 push $0x1
2b12: e8 02 15 00 00 call 4019 <printf>
2b17: 83 c4 10 add $0x10,%esp
exit();
2b1a: e8 83 13 00 00 call 3ea2 <exit>
}
printf(1, "fourteen ok\n");
2b1f: 83 ec 08 sub $0x8,%esp
2b22: 68 11 55 00 00 push $0x5511
2b27: 6a 01 push $0x1
2b29: e8 eb 14 00 00 call 4019 <printf>
2b2e: 83 c4 10 add $0x10,%esp
}
2b31: 90 nop
2b32: c9 leave
2b33: c3 ret
00002b34 <rmdot>:
void
rmdot(void)
{
2b34: 55 push %ebp
2b35: 89 e5 mov %esp,%ebp
2b37: 83 ec 08 sub $0x8,%esp
printf(1, "rmdot test\n");
2b3a: 83 ec 08 sub $0x8,%esp
2b3d: 68 1e 55 00 00 push $0x551e
2b42: 6a 01 push $0x1
2b44: e8 d0 14 00 00 call 4019 <printf>
2b49: 83 c4 10 add $0x10,%esp
if(mkdir("dots") != 0){
2b4c: 83 ec 0c sub $0xc,%esp
2b4f: 68 2a 55 00 00 push $0x552a
2b54: e8 b1 13 00 00 call 3f0a <mkdir>
2b59: 83 c4 10 add $0x10,%esp
2b5c: 85 c0 test %eax,%eax
2b5e: 74 17 je 2b77 <rmdot+0x43>
printf(1, "mkdir dots failed\n");
2b60: 83 ec 08 sub $0x8,%esp
2b63: 68 2f 55 00 00 push $0x552f
2b68: 6a 01 push $0x1
2b6a: e8 aa 14 00 00 call 4019 <printf>
2b6f: 83 c4 10 add $0x10,%esp
exit();
2b72: e8 2b 13 00 00 call 3ea2 <exit>
}
if(chdir("dots") != 0){
2b77: 83 ec 0c sub $0xc,%esp
2b7a: 68 2a 55 00 00 push $0x552a
2b7f: e8 8e 13 00 00 call 3f12 <chdir>
2b84: 83 c4 10 add $0x10,%esp
2b87: 85 c0 test %eax,%eax
2b89: 74 17 je 2ba2 <rmdot+0x6e>
printf(1, "chdir dots failed\n");
2b8b: 83 ec 08 sub $0x8,%esp
2b8e: 68 42 55 00 00 push $0x5542
2b93: 6a 01 push $0x1
2b95: e8 7f 14 00 00 call 4019 <printf>
2b9a: 83 c4 10 add $0x10,%esp
exit();
2b9d: e8 00 13 00 00 call 3ea2 <exit>
}
if(unlink(".") == 0){
2ba2: 83 ec 0c sub $0xc,%esp
2ba5: 68 5b 4c 00 00 push $0x4c5b
2baa: e8 43 13 00 00 call 3ef2 <unlink>
2baf: 83 c4 10 add $0x10,%esp
2bb2: 85 c0 test %eax,%eax
2bb4: 75 17 jne 2bcd <rmdot+0x99>
printf(1, "rm . worked!\n");
2bb6: 83 ec 08 sub $0x8,%esp
2bb9: 68 55 55 00 00 push $0x5555
2bbe: 6a 01 push $0x1
2bc0: e8 54 14 00 00 call 4019 <printf>
2bc5: 83 c4 10 add $0x10,%esp
exit();
2bc8: e8 d5 12 00 00 call 3ea2 <exit>
}
if(unlink("..") == 0){
2bcd: 83 ec 0c sub $0xc,%esp
2bd0: 68 ee 47 00 00 push $0x47ee
2bd5: e8 18 13 00 00 call 3ef2 <unlink>
2bda: 83 c4 10 add $0x10,%esp
2bdd: 85 c0 test %eax,%eax
2bdf: 75 17 jne 2bf8 <rmdot+0xc4>
printf(1, "rm .. worked!\n");
2be1: 83 ec 08 sub $0x8,%esp
2be4: 68 63 55 00 00 push $0x5563
2be9: 6a 01 push $0x1
2beb: e8 29 14 00 00 call 4019 <printf>
2bf0: 83 c4 10 add $0x10,%esp
exit();
2bf3: e8 aa 12 00 00 call 3ea2 <exit>
}
if(chdir("/") != 0){
2bf8: 83 ec 0c sub $0xc,%esp
2bfb: 68 42 44 00 00 push $0x4442
2c00: e8 0d 13 00 00 call 3f12 <chdir>
2c05: 83 c4 10 add $0x10,%esp
2c08: 85 c0 test %eax,%eax
2c0a: 74 17 je 2c23 <rmdot+0xef>
printf(1, "chdir / failed\n");
2c0c: 83 ec 08 sub $0x8,%esp
2c0f: 68 44 44 00 00 push $0x4444
2c14: 6a 01 push $0x1
2c16: e8 fe 13 00 00 call 4019 <printf>
2c1b: 83 c4 10 add $0x10,%esp
exit();
2c1e: e8 7f 12 00 00 call 3ea2 <exit>
}
if(unlink("dots/.") == 0){
2c23: 83 ec 0c sub $0xc,%esp
2c26: 68 72 55 00 00 push $0x5572
2c2b: e8 c2 12 00 00 call 3ef2 <unlink>
2c30: 83 c4 10 add $0x10,%esp
2c33: 85 c0 test %eax,%eax
2c35: 75 17 jne 2c4e <rmdot+0x11a>
printf(1, "unlink dots/. worked!\n");
2c37: 83 ec 08 sub $0x8,%esp
2c3a: 68 79 55 00 00 push $0x5579
2c3f: 6a 01 push $0x1
2c41: e8 d3 13 00 00 call 4019 <printf>
2c46: 83 c4 10 add $0x10,%esp
exit();
2c49: e8 54 12 00 00 call 3ea2 <exit>
}
if(unlink("dots/..") == 0){
2c4e: 83 ec 0c sub $0xc,%esp
2c51: 68 90 55 00 00 push $0x5590
2c56: e8 97 12 00 00 call 3ef2 <unlink>
2c5b: 83 c4 10 add $0x10,%esp
2c5e: 85 c0 test %eax,%eax
2c60: 75 17 jne 2c79 <rmdot+0x145>
printf(1, "unlink dots/.. worked!\n");
2c62: 83 ec 08 sub $0x8,%esp
2c65: 68 98 55 00 00 push $0x5598
2c6a: 6a 01 push $0x1
2c6c: e8 a8 13 00 00 call 4019 <printf>
2c71: 83 c4 10 add $0x10,%esp
exit();
2c74: e8 29 12 00 00 call 3ea2 <exit>
}
if(unlink("dots") != 0){
2c79: 83 ec 0c sub $0xc,%esp
2c7c: 68 2a 55 00 00 push $0x552a
2c81: e8 6c 12 00 00 call 3ef2 <unlink>
2c86: 83 c4 10 add $0x10,%esp
2c89: 85 c0 test %eax,%eax
2c8b: 74 17 je 2ca4 <rmdot+0x170>
printf(1, "unlink dots failed!\n");
2c8d: 83 ec 08 sub $0x8,%esp
2c90: 68 b0 55 00 00 push $0x55b0
2c95: 6a 01 push $0x1
2c97: e8 7d 13 00 00 call 4019 <printf>
2c9c: 83 c4 10 add $0x10,%esp
exit();
2c9f: e8 fe 11 00 00 call 3ea2 <exit>
}
printf(1, "rmdot ok\n");
2ca4: 83 ec 08 sub $0x8,%esp
2ca7: 68 c5 55 00 00 push $0x55c5
2cac: 6a 01 push $0x1
2cae: e8 66 13 00 00 call 4019 <printf>
2cb3: 83 c4 10 add $0x10,%esp
}
2cb6: 90 nop
2cb7: c9 leave
2cb8: c3 ret
00002cb9 <dirfile>:
void
dirfile(void)
{
2cb9: 55 push %ebp
2cba: 89 e5 mov %esp,%ebp
2cbc: 83 ec 18 sub $0x18,%esp
int fd;
printf(1, "dir vs file\n");
2cbf: 83 ec 08 sub $0x8,%esp
2cc2: 68 cf 55 00 00 push $0x55cf
2cc7: 6a 01 push $0x1
2cc9: e8 4b 13 00 00 call 4019 <printf>
2cce: 83 c4 10 add $0x10,%esp
fd = open("dirfile", O_CREATE);
2cd1: 83 ec 08 sub $0x8,%esp
2cd4: 68 00 02 00 00 push $0x200
2cd9: 68 dc 55 00 00 push $0x55dc
2cde: e8 ff 11 00 00 call 3ee2 <open>
2ce3: 83 c4 10 add $0x10,%esp
2ce6: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0){
2ce9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2ced: 79 17 jns 2d06 <dirfile+0x4d>
printf(1, "create dirfile failed\n");
2cef: 83 ec 08 sub $0x8,%esp
2cf2: 68 e4 55 00 00 push $0x55e4
2cf7: 6a 01 push $0x1
2cf9: e8 1b 13 00 00 call 4019 <printf>
2cfe: 83 c4 10 add $0x10,%esp
exit();
2d01: e8 9c 11 00 00 call 3ea2 <exit>
}
close(fd);
2d06: 83 ec 0c sub $0xc,%esp
2d09: ff 75 f4 pushl -0xc(%ebp)
2d0c: e8 b9 11 00 00 call 3eca <close>
2d11: 83 c4 10 add $0x10,%esp
if(chdir("dirfile") == 0){
2d14: 83 ec 0c sub $0xc,%esp
2d17: 68 dc 55 00 00 push $0x55dc
2d1c: e8 f1 11 00 00 call 3f12 <chdir>
2d21: 83 c4 10 add $0x10,%esp
2d24: 85 c0 test %eax,%eax
2d26: 75 17 jne 2d3f <dirfile+0x86>
printf(1, "chdir dirfile succeeded!\n");
2d28: 83 ec 08 sub $0x8,%esp
2d2b: 68 fb 55 00 00 push $0x55fb
2d30: 6a 01 push $0x1
2d32: e8 e2 12 00 00 call 4019 <printf>
2d37: 83 c4 10 add $0x10,%esp
exit();
2d3a: e8 63 11 00 00 call 3ea2 <exit>
}
fd = open("dirfile/xx", 0);
2d3f: 83 ec 08 sub $0x8,%esp
2d42: 6a 00 push $0x0
2d44: 68 15 56 00 00 push $0x5615
2d49: e8 94 11 00 00 call 3ee2 <open>
2d4e: 83 c4 10 add $0x10,%esp
2d51: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2d54: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d58: 78 17 js 2d71 <dirfile+0xb8>
printf(1, "create dirfile/xx succeeded!\n");
2d5a: 83 ec 08 sub $0x8,%esp
2d5d: 68 20 56 00 00 push $0x5620
2d62: 6a 01 push $0x1
2d64: e8 b0 12 00 00 call 4019 <printf>
2d69: 83 c4 10 add $0x10,%esp
exit();
2d6c: e8 31 11 00 00 call 3ea2 <exit>
}
fd = open("dirfile/xx", O_CREATE);
2d71: 83 ec 08 sub $0x8,%esp
2d74: 68 00 02 00 00 push $0x200
2d79: 68 15 56 00 00 push $0x5615
2d7e: e8 5f 11 00 00 call 3ee2 <open>
2d83: 83 c4 10 add $0x10,%esp
2d86: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2d89: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d8d: 78 17 js 2da6 <dirfile+0xed>
printf(1, "create dirfile/xx succeeded!\n");
2d8f: 83 ec 08 sub $0x8,%esp
2d92: 68 20 56 00 00 push $0x5620
2d97: 6a 01 push $0x1
2d99: e8 7b 12 00 00 call 4019 <printf>
2d9e: 83 c4 10 add $0x10,%esp
exit();
2da1: e8 fc 10 00 00 call 3ea2 <exit>
}
if(mkdir("dirfile/xx") == 0){
2da6: 83 ec 0c sub $0xc,%esp
2da9: 68 15 56 00 00 push $0x5615
2dae: e8 57 11 00 00 call 3f0a <mkdir>
2db3: 83 c4 10 add $0x10,%esp
2db6: 85 c0 test %eax,%eax
2db8: 75 17 jne 2dd1 <dirfile+0x118>
printf(1, "mkdir dirfile/xx succeeded!\n");
2dba: 83 ec 08 sub $0x8,%esp
2dbd: 68 3e 56 00 00 push $0x563e
2dc2: 6a 01 push $0x1
2dc4: e8 50 12 00 00 call 4019 <printf>
2dc9: 83 c4 10 add $0x10,%esp
exit();
2dcc: e8 d1 10 00 00 call 3ea2 <exit>
}
if(unlink("dirfile/xx") == 0){
2dd1: 83 ec 0c sub $0xc,%esp
2dd4: 68 15 56 00 00 push $0x5615
2dd9: e8 14 11 00 00 call 3ef2 <unlink>
2dde: 83 c4 10 add $0x10,%esp
2de1: 85 c0 test %eax,%eax
2de3: 75 17 jne 2dfc <dirfile+0x143>
printf(1, "unlink dirfile/xx succeeded!\n");
2de5: 83 ec 08 sub $0x8,%esp
2de8: 68 5b 56 00 00 push $0x565b
2ded: 6a 01 push $0x1
2def: e8 25 12 00 00 call 4019 <printf>
2df4: 83 c4 10 add $0x10,%esp
exit();
2df7: e8 a6 10 00 00 call 3ea2 <exit>
}
if(link("README", "dirfile/xx") == 0){
2dfc: 83 ec 08 sub $0x8,%esp
2dff: 68 15 56 00 00 push $0x5615
2e04: 68 79 56 00 00 push $0x5679
2e09: e8 f4 10 00 00 call 3f02 <link>
2e0e: 83 c4 10 add $0x10,%esp
2e11: 85 c0 test %eax,%eax
2e13: 75 17 jne 2e2c <dirfile+0x173>
printf(1, "link to dirfile/xx succeeded!\n");
2e15: 83 ec 08 sub $0x8,%esp
2e18: 68 80 56 00 00 push $0x5680
2e1d: 6a 01 push $0x1
2e1f: e8 f5 11 00 00 call 4019 <printf>
2e24: 83 c4 10 add $0x10,%esp
exit();
2e27: e8 76 10 00 00 call 3ea2 <exit>
}
if(unlink("dirfile") != 0){
2e2c: 83 ec 0c sub $0xc,%esp
2e2f: 68 dc 55 00 00 push $0x55dc
2e34: e8 b9 10 00 00 call 3ef2 <unlink>
2e39: 83 c4 10 add $0x10,%esp
2e3c: 85 c0 test %eax,%eax
2e3e: 74 17 je 2e57 <dirfile+0x19e>
printf(1, "unlink dirfile failed!\n");
2e40: 83 ec 08 sub $0x8,%esp
2e43: 68 9f 56 00 00 push $0x569f
2e48: 6a 01 push $0x1
2e4a: e8 ca 11 00 00 call 4019 <printf>
2e4f: 83 c4 10 add $0x10,%esp
exit();
2e52: e8 4b 10 00 00 call 3ea2 <exit>
}
fd = open(".", O_RDWR);
2e57: 83 ec 08 sub $0x8,%esp
2e5a: 6a 02 push $0x2
2e5c: 68 5b 4c 00 00 push $0x4c5b
2e61: e8 7c 10 00 00 call 3ee2 <open>
2e66: 83 c4 10 add $0x10,%esp
2e69: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd >= 0){
2e6c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2e70: 78 17 js 2e89 <dirfile+0x1d0>
printf(1, "open . for writing succeeded!\n");
2e72: 83 ec 08 sub $0x8,%esp
2e75: 68 b8 56 00 00 push $0x56b8
2e7a: 6a 01 push $0x1
2e7c: e8 98 11 00 00 call 4019 <printf>
2e81: 83 c4 10 add $0x10,%esp
exit();
2e84: e8 19 10 00 00 call 3ea2 <exit>
}
fd = open(".", 0);
2e89: 83 ec 08 sub $0x8,%esp
2e8c: 6a 00 push $0x0
2e8e: 68 5b 4c 00 00 push $0x4c5b
2e93: e8 4a 10 00 00 call 3ee2 <open>
2e98: 83 c4 10 add $0x10,%esp
2e9b: 89 45 f4 mov %eax,-0xc(%ebp)
if(write(fd, "x", 1) > 0){
2e9e: 83 ec 04 sub $0x4,%esp
2ea1: 6a 01 push $0x1
2ea3: 68 a7 48 00 00 push $0x48a7
2ea8: ff 75 f4 pushl -0xc(%ebp)
2eab: e8 12 10 00 00 call 3ec2 <write>
2eb0: 83 c4 10 add $0x10,%esp
2eb3: 85 c0 test %eax,%eax
2eb5: 7e 17 jle 2ece <dirfile+0x215>
printf(1, "write . succeeded!\n");
2eb7: 83 ec 08 sub $0x8,%esp
2eba: 68 d7 56 00 00 push $0x56d7
2ebf: 6a 01 push $0x1
2ec1: e8 53 11 00 00 call 4019 <printf>
2ec6: 83 c4 10 add $0x10,%esp
exit();
2ec9: e8 d4 0f 00 00 call 3ea2 <exit>
}
close(fd);
2ece: 83 ec 0c sub $0xc,%esp
2ed1: ff 75 f4 pushl -0xc(%ebp)
2ed4: e8 f1 0f 00 00 call 3eca <close>
2ed9: 83 c4 10 add $0x10,%esp
printf(1, "dir vs file OK\n");
2edc: 83 ec 08 sub $0x8,%esp
2edf: 68 eb 56 00 00 push $0x56eb
2ee4: 6a 01 push $0x1
2ee6: e8 2e 11 00 00 call 4019 <printf>
2eeb: 83 c4 10 add $0x10,%esp
}
2eee: 90 nop
2eef: c9 leave
2ef0: c3 ret
00002ef1 <iref>:
// test that iput() is called at the end of _namei()
void
iref(void)
{
2ef1: 55 push %ebp
2ef2: 89 e5 mov %esp,%ebp
2ef4: 83 ec 18 sub $0x18,%esp
int i, fd;
printf(1, "empty file name\n");
2ef7: 83 ec 08 sub $0x8,%esp
2efa: 68 fb 56 00 00 push $0x56fb
2eff: 6a 01 push $0x1
2f01: e8 13 11 00 00 call 4019 <printf>
2f06: 83 c4 10 add $0x10,%esp
// the 50 is NINODE
for(i = 0; i < 50 + 1; i++){
2f09: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
2f10: e9 e7 00 00 00 jmp 2ffc <iref+0x10b>
if(mkdir("irefd") != 0){
2f15: 83 ec 0c sub $0xc,%esp
2f18: 68 0c 57 00 00 push $0x570c
2f1d: e8 e8 0f 00 00 call 3f0a <mkdir>
2f22: 83 c4 10 add $0x10,%esp
2f25: 85 c0 test %eax,%eax
2f27: 74 17 je 2f40 <iref+0x4f>
printf(1, "mkdir irefd failed\n");
2f29: 83 ec 08 sub $0x8,%esp
2f2c: 68 12 57 00 00 push $0x5712
2f31: 6a 01 push $0x1
2f33: e8 e1 10 00 00 call 4019 <printf>
2f38: 83 c4 10 add $0x10,%esp
exit();
2f3b: e8 62 0f 00 00 call 3ea2 <exit>
}
if(chdir("irefd") != 0){
2f40: 83 ec 0c sub $0xc,%esp
2f43: 68 0c 57 00 00 push $0x570c
2f48: e8 c5 0f 00 00 call 3f12 <chdir>
2f4d: 83 c4 10 add $0x10,%esp
2f50: 85 c0 test %eax,%eax
2f52: 74 17 je 2f6b <iref+0x7a>
printf(1, "chdir irefd failed\n");
2f54: 83 ec 08 sub $0x8,%esp
2f57: 68 26 57 00 00 push $0x5726
2f5c: 6a 01 push $0x1
2f5e: e8 b6 10 00 00 call 4019 <printf>
2f63: 83 c4 10 add $0x10,%esp
exit();
2f66: e8 37 0f 00 00 call 3ea2 <exit>
}
mkdir("");
2f6b: 83 ec 0c sub $0xc,%esp
2f6e: 68 3a 57 00 00 push $0x573a
2f73: e8 92 0f 00 00 call 3f0a <mkdir>
2f78: 83 c4 10 add $0x10,%esp
link("README", "");
2f7b: 83 ec 08 sub $0x8,%esp
2f7e: 68 3a 57 00 00 push $0x573a
2f83: 68 79 56 00 00 push $0x5679
2f88: e8 75 0f 00 00 call 3f02 <link>
2f8d: 83 c4 10 add $0x10,%esp
fd = open("", O_CREATE);
2f90: 83 ec 08 sub $0x8,%esp
2f93: 68 00 02 00 00 push $0x200
2f98: 68 3a 57 00 00 push $0x573a
2f9d: e8 40 0f 00 00 call 3ee2 <open>
2fa2: 83 c4 10 add $0x10,%esp
2fa5: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0)
2fa8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
2fac: 78 0e js 2fbc <iref+0xcb>
close(fd);
2fae: 83 ec 0c sub $0xc,%esp
2fb1: ff 75 f0 pushl -0x10(%ebp)
2fb4: e8 11 0f 00 00 call 3eca <close>
2fb9: 83 c4 10 add $0x10,%esp
fd = open("xx", O_CREATE);
2fbc: 83 ec 08 sub $0x8,%esp
2fbf: 68 00 02 00 00 push $0x200
2fc4: 68 3b 57 00 00 push $0x573b
2fc9: e8 14 0f 00 00 call 3ee2 <open>
2fce: 83 c4 10 add $0x10,%esp
2fd1: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd >= 0)
2fd4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
2fd8: 78 0e js 2fe8 <iref+0xf7>
close(fd);
2fda: 83 ec 0c sub $0xc,%esp
2fdd: ff 75 f0 pushl -0x10(%ebp)
2fe0: e8 e5 0e 00 00 call 3eca <close>
2fe5: 83 c4 10 add $0x10,%esp
unlink("xx");
2fe8: 83 ec 0c sub $0xc,%esp
2feb: 68 3b 57 00 00 push $0x573b
2ff0: e8 fd 0e 00 00 call 3ef2 <unlink>
2ff5: 83 c4 10 add $0x10,%esp
int i, fd;
printf(1, "empty file name\n");
// the 50 is NINODE
for(i = 0; i < 50 + 1; i++){
2ff8: 83 45 f4 01 addl $0x1,-0xc(%ebp)
2ffc: 83 7d f4 32 cmpl $0x32,-0xc(%ebp)
3000: 0f 8e 0f ff ff ff jle 2f15 <iref+0x24>
if(fd >= 0)
close(fd);
unlink("xx");
}
chdir("/");
3006: 83 ec 0c sub $0xc,%esp
3009: 68 42 44 00 00 push $0x4442
300e: e8 ff 0e 00 00 call 3f12 <chdir>
3013: 83 c4 10 add $0x10,%esp
printf(1, "empty file name OK\n");
3016: 83 ec 08 sub $0x8,%esp
3019: 68 3e 57 00 00 push $0x573e
301e: 6a 01 push $0x1
3020: e8 f4 0f 00 00 call 4019 <printf>
3025: 83 c4 10 add $0x10,%esp
}
3028: 90 nop
3029: c9 leave
302a: c3 ret
0000302b <forktest>:
// test that fork fails gracefully
// the forktest binary also does this, but it runs out of proc entries first.
// inside the bigger usertests binary, we run out of memory first.
void
forktest(void)
{
302b: 55 push %ebp
302c: 89 e5 mov %esp,%ebp
302e: 83 ec 18 sub $0x18,%esp
int n, pid;
printf(1, "fork test\n");
3031: 83 ec 08 sub $0x8,%esp
3034: 68 52 57 00 00 push $0x5752
3039: 6a 01 push $0x1
303b: e8 d9 0f 00 00 call 4019 <printf>
3040: 83 c4 10 add $0x10,%esp
for(n=0; n<1000; n++){
3043: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
304a: eb 1d jmp 3069 <forktest+0x3e>
pid = fork();
304c: e8 49 0e 00 00 call 3e9a <fork>
3051: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid < 0)
3054: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3058: 78 1a js 3074 <forktest+0x49>
break;
if(pid == 0)
305a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
305e: 75 05 jne 3065 <forktest+0x3a>
exit();
3060: e8 3d 0e 00 00 call 3ea2 <exit>
{
int n, pid;
printf(1, "fork test\n");
for(n=0; n<1000; n++){
3065: 83 45 f4 01 addl $0x1,-0xc(%ebp)
3069: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp)
3070: 7e da jle 304c <forktest+0x21>
3072: eb 01 jmp 3075 <forktest+0x4a>
pid = fork();
if(pid < 0)
break;
3074: 90 nop
if(pid == 0)
exit();
}
if(n == 1000){
3075: 81 7d f4 e8 03 00 00 cmpl $0x3e8,-0xc(%ebp)
307c: 75 3b jne 30b9 <forktest+0x8e>
printf(1, "fork claimed to work 1000 times!\n");
307e: 83 ec 08 sub $0x8,%esp
3081: 68 60 57 00 00 push $0x5760
3086: 6a 01 push $0x1
3088: e8 8c 0f 00 00 call 4019 <printf>
308d: 83 c4 10 add $0x10,%esp
exit();
3090: e8 0d 0e 00 00 call 3ea2 <exit>
}
for(; n > 0; n--){
if(wait() < 0){
3095: e8 10 0e 00 00 call 3eaa <wait>
309a: 85 c0 test %eax,%eax
309c: 79 17 jns 30b5 <forktest+0x8a>
printf(1, "wait stopped early\n");
309e: 83 ec 08 sub $0x8,%esp
30a1: 68 82 57 00 00 push $0x5782
30a6: 6a 01 push $0x1
30a8: e8 6c 0f 00 00 call 4019 <printf>
30ad: 83 c4 10 add $0x10,%esp
exit();
30b0: e8 ed 0d 00 00 call 3ea2 <exit>
if(n == 1000){
printf(1, "fork claimed to work 1000 times!\n");
exit();
}
for(; n > 0; n--){
30b5: 83 6d f4 01 subl $0x1,-0xc(%ebp)
30b9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
30bd: 7f d6 jg 3095 <forktest+0x6a>
printf(1, "wait stopped early\n");
exit();
}
}
if(wait() != -1){
30bf: e8 e6 0d 00 00 call 3eaa <wait>
30c4: 83 f8 ff cmp $0xffffffff,%eax
30c7: 74 17 je 30e0 <forktest+0xb5>
printf(1, "wait got too many\n");
30c9: 83 ec 08 sub $0x8,%esp
30cc: 68 96 57 00 00 push $0x5796
30d1: 6a 01 push $0x1
30d3: e8 41 0f 00 00 call 4019 <printf>
30d8: 83 c4 10 add $0x10,%esp
exit();
30db: e8 c2 0d 00 00 call 3ea2 <exit>
}
printf(1, "fork test OK\n");
30e0: 83 ec 08 sub $0x8,%esp
30e3: 68 a9 57 00 00 push $0x57a9
30e8: 6a 01 push $0x1
30ea: e8 2a 0f 00 00 call 4019 <printf>
30ef: 83 c4 10 add $0x10,%esp
}
30f2: 90 nop
30f3: c9 leave
30f4: c3 ret
000030f5 <sbrktest>:
void
sbrktest(void)
{
30f5: 55 push %ebp
30f6: 89 e5 mov %esp,%ebp
30f8: 53 push %ebx
30f9: 83 ec 64 sub $0x64,%esp
int fds[2], pid, pids[10], ppid;
char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch;
uint amt;
printf(stdout, "sbrk test\n");
30fc: a1 8c 62 00 00 mov 0x628c,%eax
3101: 83 ec 08 sub $0x8,%esp
3104: 68 b7 57 00 00 push $0x57b7
3109: 50 push %eax
310a: e8 0a 0f 00 00 call 4019 <printf>
310f: 83 c4 10 add $0x10,%esp
oldbrk = sbrk(0);
3112: 83 ec 0c sub $0xc,%esp
3115: 6a 00 push $0x0
3117: e8 0e 0e 00 00 call 3f2a <sbrk>
311c: 83 c4 10 add $0x10,%esp
311f: 89 45 ec mov %eax,-0x14(%ebp)
// can one sbrk() less than a page?
a = sbrk(0);
3122: 83 ec 0c sub $0xc,%esp
3125: 6a 00 push $0x0
3127: e8 fe 0d 00 00 call 3f2a <sbrk>
312c: 83 c4 10 add $0x10,%esp
312f: 89 45 f4 mov %eax,-0xc(%ebp)
int i;
for(i = 0; i < 5000; i++){
3132: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
3139: eb 4f jmp 318a <sbrktest+0x95>
b = sbrk(1);
313b: 83 ec 0c sub $0xc,%esp
313e: 6a 01 push $0x1
3140: e8 e5 0d 00 00 call 3f2a <sbrk>
3145: 83 c4 10 add $0x10,%esp
3148: 89 45 e8 mov %eax,-0x18(%ebp)
if(b != a){
314b: 8b 45 e8 mov -0x18(%ebp),%eax
314e: 3b 45 f4 cmp -0xc(%ebp),%eax
3151: 74 24 je 3177 <sbrktest+0x82>
printf(stdout, "sbrk test failed %d %x %x\n", i, a, b);
3153: a1 8c 62 00 00 mov 0x628c,%eax
3158: 83 ec 0c sub $0xc,%esp
315b: ff 75 e8 pushl -0x18(%ebp)
315e: ff 75 f4 pushl -0xc(%ebp)
3161: ff 75 f0 pushl -0x10(%ebp)
3164: 68 c2 57 00 00 push $0x57c2
3169: 50 push %eax
316a: e8 aa 0e 00 00 call 4019 <printf>
316f: 83 c4 20 add $0x20,%esp
exit();
3172: e8 2b 0d 00 00 call 3ea2 <exit>
}
*b = 1;
3177: 8b 45 e8 mov -0x18(%ebp),%eax
317a: c6 00 01 movb $0x1,(%eax)
a = b + 1;
317d: 8b 45 e8 mov -0x18(%ebp),%eax
3180: 83 c0 01 add $0x1,%eax
3183: 89 45 f4 mov %eax,-0xc(%ebp)
oldbrk = sbrk(0);
// can one sbrk() less than a page?
a = sbrk(0);
int i;
for(i = 0; i < 5000; i++){
3186: 83 45 f0 01 addl $0x1,-0x10(%ebp)
318a: 81 7d f0 87 13 00 00 cmpl $0x1387,-0x10(%ebp)
3191: 7e a8 jle 313b <sbrktest+0x46>
exit();
}
*b = 1;
a = b + 1;
}
pid = fork();
3193: e8 02 0d 00 00 call 3e9a <fork>
3198: 89 45 e4 mov %eax,-0x1c(%ebp)
if(pid < 0){
319b: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
319f: 79 1b jns 31bc <sbrktest+0xc7>
printf(stdout, "sbrk test fork failed\n");
31a1: a1 8c 62 00 00 mov 0x628c,%eax
31a6: 83 ec 08 sub $0x8,%esp
31a9: 68 dd 57 00 00 push $0x57dd
31ae: 50 push %eax
31af: e8 65 0e 00 00 call 4019 <printf>
31b4: 83 c4 10 add $0x10,%esp
exit();
31b7: e8 e6 0c 00 00 call 3ea2 <exit>
}
c = sbrk(1);
31bc: 83 ec 0c sub $0xc,%esp
31bf: 6a 01 push $0x1
31c1: e8 64 0d 00 00 call 3f2a <sbrk>
31c6: 83 c4 10 add $0x10,%esp
31c9: 89 45 e0 mov %eax,-0x20(%ebp)
c = sbrk(1);
31cc: 83 ec 0c sub $0xc,%esp
31cf: 6a 01 push $0x1
31d1: e8 54 0d 00 00 call 3f2a <sbrk>
31d6: 83 c4 10 add $0x10,%esp
31d9: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a + 1){
31dc: 8b 45 f4 mov -0xc(%ebp),%eax
31df: 83 c0 01 add $0x1,%eax
31e2: 3b 45 e0 cmp -0x20(%ebp),%eax
31e5: 74 1b je 3202 <sbrktest+0x10d>
printf(stdout, "sbrk test failed post-fork\n");
31e7: a1 8c 62 00 00 mov 0x628c,%eax
31ec: 83 ec 08 sub $0x8,%esp
31ef: 68 f4 57 00 00 push $0x57f4
31f4: 50 push %eax
31f5: e8 1f 0e 00 00 call 4019 <printf>
31fa: 83 c4 10 add $0x10,%esp
exit();
31fd: e8 a0 0c 00 00 call 3ea2 <exit>
}
if(pid == 0)
3202: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
3206: 75 05 jne 320d <sbrktest+0x118>
exit();
3208: e8 95 0c 00 00 call 3ea2 <exit>
wait();
320d: e8 98 0c 00 00 call 3eaa <wait>
// can one grow address space to something big?
#define BIG (100*1024*1024)
a = sbrk(0);
3212: 83 ec 0c sub $0xc,%esp
3215: 6a 00 push $0x0
3217: e8 0e 0d 00 00 call 3f2a <sbrk>
321c: 83 c4 10 add $0x10,%esp
321f: 89 45 f4 mov %eax,-0xc(%ebp)
amt = (BIG) - (uint)a;
3222: 8b 45 f4 mov -0xc(%ebp),%eax
3225: ba 00 00 40 06 mov $0x6400000,%edx
322a: 29 c2 sub %eax,%edx
322c: 89 d0 mov %edx,%eax
322e: 89 45 dc mov %eax,-0x24(%ebp)
p = sbrk(amt);
3231: 8b 45 dc mov -0x24(%ebp),%eax
3234: 83 ec 0c sub $0xc,%esp
3237: 50 push %eax
3238: e8 ed 0c 00 00 call 3f2a <sbrk>
323d: 83 c4 10 add $0x10,%esp
3240: 89 45 d8 mov %eax,-0x28(%ebp)
if (p != a) {
3243: 8b 45 d8 mov -0x28(%ebp),%eax
3246: 3b 45 f4 cmp -0xc(%ebp),%eax
3249: 74 1b je 3266 <sbrktest+0x171>
printf(stdout, "sbrk test failed to grow big address space; enough phys mem?\n");
324b: a1 8c 62 00 00 mov 0x628c,%eax
3250: 83 ec 08 sub $0x8,%esp
3253: 68 10 58 00 00 push $0x5810
3258: 50 push %eax
3259: e8 bb 0d 00 00 call 4019 <printf>
325e: 83 c4 10 add $0x10,%esp
exit();
3261: e8 3c 0c 00 00 call 3ea2 <exit>
}
lastaddr = (char*) (BIG-1);
3266: c7 45 d4 ff ff 3f 06 movl $0x63fffff,-0x2c(%ebp)
*lastaddr = 99;
326d: 8b 45 d4 mov -0x2c(%ebp),%eax
3270: c6 00 63 movb $0x63,(%eax)
// can one de-allocate?
a = sbrk(0);
3273: 83 ec 0c sub $0xc,%esp
3276: 6a 00 push $0x0
3278: e8 ad 0c 00 00 call 3f2a <sbrk>
327d: 83 c4 10 add $0x10,%esp
3280: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(-4096);
3283: 83 ec 0c sub $0xc,%esp
3286: 68 00 f0 ff ff push $0xfffff000
328b: e8 9a 0c 00 00 call 3f2a <sbrk>
3290: 83 c4 10 add $0x10,%esp
3293: 89 45 e0 mov %eax,-0x20(%ebp)
if(c == (char*)0xffffffff){
3296: 83 7d e0 ff cmpl $0xffffffff,-0x20(%ebp)
329a: 75 1b jne 32b7 <sbrktest+0x1c2>
printf(stdout, "sbrk could not deallocate\n");
329c: a1 8c 62 00 00 mov 0x628c,%eax
32a1: 83 ec 08 sub $0x8,%esp
32a4: 68 4e 58 00 00 push $0x584e
32a9: 50 push %eax
32aa: e8 6a 0d 00 00 call 4019 <printf>
32af: 83 c4 10 add $0x10,%esp
exit();
32b2: e8 eb 0b 00 00 call 3ea2 <exit>
}
c = sbrk(0);
32b7: 83 ec 0c sub $0xc,%esp
32ba: 6a 00 push $0x0
32bc: e8 69 0c 00 00 call 3f2a <sbrk>
32c1: 83 c4 10 add $0x10,%esp
32c4: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a - 4096){
32c7: 8b 45 f4 mov -0xc(%ebp),%eax
32ca: 2d 00 10 00 00 sub $0x1000,%eax
32cf: 3b 45 e0 cmp -0x20(%ebp),%eax
32d2: 74 1e je 32f2 <sbrktest+0x1fd>
printf(stdout, "sbrk deallocation produced wrong address, a %x c %x\n", a, c);
32d4: a1 8c 62 00 00 mov 0x628c,%eax
32d9: ff 75 e0 pushl -0x20(%ebp)
32dc: ff 75 f4 pushl -0xc(%ebp)
32df: 68 6c 58 00 00 push $0x586c
32e4: 50 push %eax
32e5: e8 2f 0d 00 00 call 4019 <printf>
32ea: 83 c4 10 add $0x10,%esp
exit();
32ed: e8 b0 0b 00 00 call 3ea2 <exit>
}
// can one re-allocate that page?
a = sbrk(0);
32f2: 83 ec 0c sub $0xc,%esp
32f5: 6a 00 push $0x0
32f7: e8 2e 0c 00 00 call 3f2a <sbrk>
32fc: 83 c4 10 add $0x10,%esp
32ff: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(4096);
3302: 83 ec 0c sub $0xc,%esp
3305: 68 00 10 00 00 push $0x1000
330a: e8 1b 0c 00 00 call 3f2a <sbrk>
330f: 83 c4 10 add $0x10,%esp
3312: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a || sbrk(0) != a + 4096){
3315: 8b 45 e0 mov -0x20(%ebp),%eax
3318: 3b 45 f4 cmp -0xc(%ebp),%eax
331b: 75 1b jne 3338 <sbrktest+0x243>
331d: 83 ec 0c sub $0xc,%esp
3320: 6a 00 push $0x0
3322: e8 03 0c 00 00 call 3f2a <sbrk>
3327: 83 c4 10 add $0x10,%esp
332a: 89 c2 mov %eax,%edx
332c: 8b 45 f4 mov -0xc(%ebp),%eax
332f: 05 00 10 00 00 add $0x1000,%eax
3334: 39 c2 cmp %eax,%edx
3336: 74 1e je 3356 <sbrktest+0x261>
printf(stdout, "sbrk re-allocation failed, a %x c %x\n", a, c);
3338: a1 8c 62 00 00 mov 0x628c,%eax
333d: ff 75 e0 pushl -0x20(%ebp)
3340: ff 75 f4 pushl -0xc(%ebp)
3343: 68 a4 58 00 00 push $0x58a4
3348: 50 push %eax
3349: e8 cb 0c 00 00 call 4019 <printf>
334e: 83 c4 10 add $0x10,%esp
exit();
3351: e8 4c 0b 00 00 call 3ea2 <exit>
}
if(*lastaddr == 99){
3356: 8b 45 d4 mov -0x2c(%ebp),%eax
3359: 0f b6 00 movzbl (%eax),%eax
335c: 3c 63 cmp $0x63,%al
335e: 75 1b jne 337b <sbrktest+0x286>
// should be zero
printf(stdout, "sbrk de-allocation didn't really deallocate\n");
3360: a1 8c 62 00 00 mov 0x628c,%eax
3365: 83 ec 08 sub $0x8,%esp
3368: 68 cc 58 00 00 push $0x58cc
336d: 50 push %eax
336e: e8 a6 0c 00 00 call 4019 <printf>
3373: 83 c4 10 add $0x10,%esp
exit();
3376: e8 27 0b 00 00 call 3ea2 <exit>
}
a = sbrk(0);
337b: 83 ec 0c sub $0xc,%esp
337e: 6a 00 push $0x0
3380: e8 a5 0b 00 00 call 3f2a <sbrk>
3385: 83 c4 10 add $0x10,%esp
3388: 89 45 f4 mov %eax,-0xc(%ebp)
c = sbrk(-(sbrk(0) - oldbrk));
338b: 8b 5d ec mov -0x14(%ebp),%ebx
338e: 83 ec 0c sub $0xc,%esp
3391: 6a 00 push $0x0
3393: e8 92 0b 00 00 call 3f2a <sbrk>
3398: 83 c4 10 add $0x10,%esp
339b: 29 c3 sub %eax,%ebx
339d: 89 d8 mov %ebx,%eax
339f: 83 ec 0c sub $0xc,%esp
33a2: 50 push %eax
33a3: e8 82 0b 00 00 call 3f2a <sbrk>
33a8: 83 c4 10 add $0x10,%esp
33ab: 89 45 e0 mov %eax,-0x20(%ebp)
if(c != a){
33ae: 8b 45 e0 mov -0x20(%ebp),%eax
33b1: 3b 45 f4 cmp -0xc(%ebp),%eax
33b4: 74 1e je 33d4 <sbrktest+0x2df>
printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c);
33b6: a1 8c 62 00 00 mov 0x628c,%eax
33bb: ff 75 e0 pushl -0x20(%ebp)
33be: ff 75 f4 pushl -0xc(%ebp)
33c1: 68 fc 58 00 00 push $0x58fc
33c6: 50 push %eax
33c7: e8 4d 0c 00 00 call 4019 <printf>
33cc: 83 c4 10 add $0x10,%esp
exit();
33cf: e8 ce 0a 00 00 call 3ea2 <exit>
}
// can we read the kernel's memory?
for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){
33d4: c7 45 f4 00 00 00 80 movl $0x80000000,-0xc(%ebp)
33db: eb 76 jmp 3453 <sbrktest+0x35e>
ppid = getpid();
33dd: e8 40 0b 00 00 call 3f22 <getpid>
33e2: 89 45 d0 mov %eax,-0x30(%ebp)
pid = fork();
33e5: e8 b0 0a 00 00 call 3e9a <fork>
33ea: 89 45 e4 mov %eax,-0x1c(%ebp)
if(pid < 0){
33ed: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
33f1: 79 1b jns 340e <sbrktest+0x319>
printf(stdout, "fork failed\n");
33f3: a1 8c 62 00 00 mov 0x628c,%eax
33f8: 83 ec 08 sub $0x8,%esp
33fb: 68 71 44 00 00 push $0x4471
3400: 50 push %eax
3401: e8 13 0c 00 00 call 4019 <printf>
3406: 83 c4 10 add $0x10,%esp
exit();
3409: e8 94 0a 00 00 call 3ea2 <exit>
}
if(pid == 0){
340e: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
3412: 75 33 jne 3447 <sbrktest+0x352>
printf(stdout, "oops could read %x = %x\n", a, *a);
3414: 8b 45 f4 mov -0xc(%ebp),%eax
3417: 0f b6 00 movzbl (%eax),%eax
341a: 0f be d0 movsbl %al,%edx
341d: a1 8c 62 00 00 mov 0x628c,%eax
3422: 52 push %edx
3423: ff 75 f4 pushl -0xc(%ebp)
3426: 68 1d 59 00 00 push $0x591d
342b: 50 push %eax
342c: e8 e8 0b 00 00 call 4019 <printf>
3431: 83 c4 10 add $0x10,%esp
kill(ppid);
3434: 83 ec 0c sub $0xc,%esp
3437: ff 75 d0 pushl -0x30(%ebp)
343a: e8 93 0a 00 00 call 3ed2 <kill>
343f: 83 c4 10 add $0x10,%esp
exit();
3442: e8 5b 0a 00 00 call 3ea2 <exit>
}
wait();
3447: e8 5e 0a 00 00 call 3eaa <wait>
printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c);
exit();
}
// can we read the kernel's memory?
for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){
344c: 81 45 f4 50 c3 00 00 addl $0xc350,-0xc(%ebp)
3453: 81 7d f4 7f 84 1e 80 cmpl $0x801e847f,-0xc(%ebp)
345a: 76 81 jbe 33dd <sbrktest+0x2e8>
wait();
}
// if we run the system out of memory, does it clean up the last
// failed allocation?
if(pipe(fds) != 0){
345c: 83 ec 0c sub $0xc,%esp
345f: 8d 45 c8 lea -0x38(%ebp),%eax
3462: 50 push %eax
3463: e8 4a 0a 00 00 call 3eb2 <pipe>
3468: 83 c4 10 add $0x10,%esp
346b: 85 c0 test %eax,%eax
346d: 74 17 je 3486 <sbrktest+0x391>
printf(1, "pipe() failed\n");
346f: 83 ec 08 sub $0x8,%esp
3472: 68 42 48 00 00 push $0x4842
3477: 6a 01 push $0x1
3479: e8 9b 0b 00 00 call 4019 <printf>
347e: 83 c4 10 add $0x10,%esp
exit();
3481: e8 1c 0a 00 00 call 3ea2 <exit>
}
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3486: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
348d: e9 88 00 00 00 jmp 351a <sbrktest+0x425>
if((pids[i] = fork()) == 0){
3492: e8 03 0a 00 00 call 3e9a <fork>
3497: 89 c2 mov %eax,%edx
3499: 8b 45 f0 mov -0x10(%ebp),%eax
349c: 89 54 85 a0 mov %edx,-0x60(%ebp,%eax,4)
34a0: 8b 45 f0 mov -0x10(%ebp),%eax
34a3: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
34a7: 85 c0 test %eax,%eax
34a9: 75 4a jne 34f5 <sbrktest+0x400>
// allocate a lot of memory
sbrk(BIG - (uint)sbrk(0));
34ab: 83 ec 0c sub $0xc,%esp
34ae: 6a 00 push $0x0
34b0: e8 75 0a 00 00 call 3f2a <sbrk>
34b5: 83 c4 10 add $0x10,%esp
34b8: ba 00 00 40 06 mov $0x6400000,%edx
34bd: 29 c2 sub %eax,%edx
34bf: 89 d0 mov %edx,%eax
34c1: 83 ec 0c sub $0xc,%esp
34c4: 50 push %eax
34c5: e8 60 0a 00 00 call 3f2a <sbrk>
34ca: 83 c4 10 add $0x10,%esp
write(fds[1], "x", 1);
34cd: 8b 45 cc mov -0x34(%ebp),%eax
34d0: 83 ec 04 sub $0x4,%esp
34d3: 6a 01 push $0x1
34d5: 68 a7 48 00 00 push $0x48a7
34da: 50 push %eax
34db: e8 e2 09 00 00 call 3ec2 <write>
34e0: 83 c4 10 add $0x10,%esp
// sit around until killed
for(;;) sleep(1000);
34e3: 83 ec 0c sub $0xc,%esp
34e6: 68 e8 03 00 00 push $0x3e8
34eb: e8 42 0a 00 00 call 3f32 <sleep>
34f0: 83 c4 10 add $0x10,%esp
34f3: eb ee jmp 34e3 <sbrktest+0x3ee>
}
if(pids[i] != -1)
34f5: 8b 45 f0 mov -0x10(%ebp),%eax
34f8: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
34fc: 83 f8 ff cmp $0xffffffff,%eax
34ff: 74 15 je 3516 <sbrktest+0x421>
read(fds[0], &scratch, 1);
3501: 8b 45 c8 mov -0x38(%ebp),%eax
3504: 83 ec 04 sub $0x4,%esp
3507: 6a 01 push $0x1
3509: 8d 55 9f lea -0x61(%ebp),%edx
350c: 52 push %edx
350d: 50 push %eax
350e: e8 a7 09 00 00 call 3eba <read>
3513: 83 c4 10 add $0x10,%esp
// failed allocation?
if(pipe(fds) != 0){
printf(1, "pipe() failed\n");
exit();
}
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3516: 83 45 f0 01 addl $0x1,-0x10(%ebp)
351a: 8b 45 f0 mov -0x10(%ebp),%eax
351d: 83 f8 09 cmp $0x9,%eax
3520: 0f 86 6c ff ff ff jbe 3492 <sbrktest+0x39d>
if(pids[i] != -1)
read(fds[0], &scratch, 1);
}
// if those failed allocations freed up the pages they did allocate,
// we'll be able to allocate here
c = sbrk(4096);
3526: 83 ec 0c sub $0xc,%esp
3529: 68 00 10 00 00 push $0x1000
352e: e8 f7 09 00 00 call 3f2a <sbrk>
3533: 83 c4 10 add $0x10,%esp
3536: 89 45 e0 mov %eax,-0x20(%ebp)
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3539: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
3540: eb 2b jmp 356d <sbrktest+0x478>
if(pids[i] == -1)
3542: 8b 45 f0 mov -0x10(%ebp),%eax
3545: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
3549: 83 f8 ff cmp $0xffffffff,%eax
354c: 74 1a je 3568 <sbrktest+0x473>
continue;
kill(pids[i]);
354e: 8b 45 f0 mov -0x10(%ebp),%eax
3551: 8b 44 85 a0 mov -0x60(%ebp,%eax,4),%eax
3555: 83 ec 0c sub $0xc,%esp
3558: 50 push %eax
3559: e8 74 09 00 00 call 3ed2 <kill>
355e: 83 c4 10 add $0x10,%esp
wait();
3561: e8 44 09 00 00 call 3eaa <wait>
3566: eb 01 jmp 3569 <sbrktest+0x474>
// if those failed allocations freed up the pages they did allocate,
// we'll be able to allocate here
c = sbrk(4096);
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
if(pids[i] == -1)
continue;
3568: 90 nop
read(fds[0], &scratch, 1);
}
// if those failed allocations freed up the pages they did allocate,
// we'll be able to allocate here
c = sbrk(4096);
for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){
3569: 83 45 f0 01 addl $0x1,-0x10(%ebp)
356d: 8b 45 f0 mov -0x10(%ebp),%eax
3570: 83 f8 09 cmp $0x9,%eax
3573: 76 cd jbe 3542 <sbrktest+0x44d>
if(pids[i] == -1)
continue;
kill(pids[i]);
wait();
}
if(c == (char*)0xffffffff){
3575: 83 7d e0 ff cmpl $0xffffffff,-0x20(%ebp)
3579: 75 1b jne 3596 <sbrktest+0x4a1>
printf(stdout, "failed sbrk leaked memory\n");
357b: a1 8c 62 00 00 mov 0x628c,%eax
3580: 83 ec 08 sub $0x8,%esp
3583: 68 36 59 00 00 push $0x5936
3588: 50 push %eax
3589: e8 8b 0a 00 00 call 4019 <printf>
358e: 83 c4 10 add $0x10,%esp
exit();
3591: e8 0c 09 00 00 call 3ea2 <exit>
}
if(sbrk(0) > oldbrk)
3596: 83 ec 0c sub $0xc,%esp
3599: 6a 00 push $0x0
359b: e8 8a 09 00 00 call 3f2a <sbrk>
35a0: 83 c4 10 add $0x10,%esp
35a3: 3b 45 ec cmp -0x14(%ebp),%eax
35a6: 76 20 jbe 35c8 <sbrktest+0x4d3>
sbrk(-(sbrk(0) - oldbrk));
35a8: 8b 5d ec mov -0x14(%ebp),%ebx
35ab: 83 ec 0c sub $0xc,%esp
35ae: 6a 00 push $0x0
35b0: e8 75 09 00 00 call 3f2a <sbrk>
35b5: 83 c4 10 add $0x10,%esp
35b8: 29 c3 sub %eax,%ebx
35ba: 89 d8 mov %ebx,%eax
35bc: 83 ec 0c sub $0xc,%esp
35bf: 50 push %eax
35c0: e8 65 09 00 00 call 3f2a <sbrk>
35c5: 83 c4 10 add $0x10,%esp
printf(stdout, "sbrk test OK\n");
35c8: a1 8c 62 00 00 mov 0x628c,%eax
35cd: 83 ec 08 sub $0x8,%esp
35d0: 68 51 59 00 00 push $0x5951
35d5: 50 push %eax
35d6: e8 3e 0a 00 00 call 4019 <printf>
35db: 83 c4 10 add $0x10,%esp
}
35de: 90 nop
35df: 8b 5d fc mov -0x4(%ebp),%ebx
35e2: c9 leave
35e3: c3 ret
000035e4 <validateint>:
void
validateint(int *p)
{
35e4: 55 push %ebp
35e5: 89 e5 mov %esp,%ebp
35e7: 53 push %ebx
35e8: 83 ec 10 sub $0x10,%esp
int res;
asm("mov %%esp, %%ebx\n\t"
35eb: b8 0d 00 00 00 mov $0xd,%eax
35f0: 8b 55 08 mov 0x8(%ebp),%edx
35f3: 89 d1 mov %edx,%ecx
35f5: 89 e3 mov %esp,%ebx
35f7: 89 cc mov %ecx,%esp
35f9: cd 40 int $0x40
35fb: 89 dc mov %ebx,%esp
35fd: 89 45 f8 mov %eax,-0x8(%ebp)
"int %2\n\t"
"mov %%ebx, %%esp" :
"=a" (res) :
"a" (SYS_sleep), "n" (T_SYSCALL), "c" (p) :
"ebx");
}
3600: 90 nop
3601: 83 c4 10 add $0x10,%esp
3604: 5b pop %ebx
3605: 5d pop %ebp
3606: c3 ret
00003607 <validatetest>:
void
validatetest(void)
{
3607: 55 push %ebp
3608: 89 e5 mov %esp,%ebp
360a: 83 ec 18 sub $0x18,%esp
int hi, pid;
uint p;
printf(stdout, "validate test\n");
360d: a1 8c 62 00 00 mov 0x628c,%eax
3612: 83 ec 08 sub $0x8,%esp
3615: 68 5f 59 00 00 push $0x595f
361a: 50 push %eax
361b: e8 f9 09 00 00 call 4019 <printf>
3620: 83 c4 10 add $0x10,%esp
hi = 1100*1024;
3623: c7 45 f0 00 30 11 00 movl $0x113000,-0x10(%ebp)
for(p = 0; p <= (uint)hi; p += 4096){
362a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3631: e9 8a 00 00 00 jmp 36c0 <validatetest+0xb9>
if((pid = fork()) == 0){
3636: e8 5f 08 00 00 call 3e9a <fork>
363b: 89 45 ec mov %eax,-0x14(%ebp)
363e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3642: 75 14 jne 3658 <validatetest+0x51>
// try to crash the kernel by passing in a badly placed integer
validateint((int*)p);
3644: 8b 45 f4 mov -0xc(%ebp),%eax
3647: 83 ec 0c sub $0xc,%esp
364a: 50 push %eax
364b: e8 94 ff ff ff call 35e4 <validateint>
3650: 83 c4 10 add $0x10,%esp
exit();
3653: e8 4a 08 00 00 call 3ea2 <exit>
}
sleep(0);
3658: 83 ec 0c sub $0xc,%esp
365b: 6a 00 push $0x0
365d: e8 d0 08 00 00 call 3f32 <sleep>
3662: 83 c4 10 add $0x10,%esp
sleep(0);
3665: 83 ec 0c sub $0xc,%esp
3668: 6a 00 push $0x0
366a: e8 c3 08 00 00 call 3f32 <sleep>
366f: 83 c4 10 add $0x10,%esp
kill(pid);
3672: 83 ec 0c sub $0xc,%esp
3675: ff 75 ec pushl -0x14(%ebp)
3678: e8 55 08 00 00 call 3ed2 <kill>
367d: 83 c4 10 add $0x10,%esp
wait();
3680: e8 25 08 00 00 call 3eaa <wait>
// try to crash the kernel by passing in a bad string pointer
if(link("nosuchfile", (char*)p) != -1){
3685: 8b 45 f4 mov -0xc(%ebp),%eax
3688: 83 ec 08 sub $0x8,%esp
368b: 50 push %eax
368c: 68 6e 59 00 00 push $0x596e
3691: e8 6c 08 00 00 call 3f02 <link>
3696: 83 c4 10 add $0x10,%esp
3699: 83 f8 ff cmp $0xffffffff,%eax
369c: 74 1b je 36b9 <validatetest+0xb2>
printf(stdout, "link should not succeed\n");
369e: a1 8c 62 00 00 mov 0x628c,%eax
36a3: 83 ec 08 sub $0x8,%esp
36a6: 68 79 59 00 00 push $0x5979
36ab: 50 push %eax
36ac: e8 68 09 00 00 call 4019 <printf>
36b1: 83 c4 10 add $0x10,%esp
exit();
36b4: e8 e9 07 00 00 call 3ea2 <exit>
uint p;
printf(stdout, "validate test\n");
hi = 1100*1024;
for(p = 0; p <= (uint)hi; p += 4096){
36b9: 81 45 f4 00 10 00 00 addl $0x1000,-0xc(%ebp)
36c0: 8b 45 f0 mov -0x10(%ebp),%eax
36c3: 39 45 f4 cmp %eax,-0xc(%ebp)
36c6: 0f 86 6a ff ff ff jbe 3636 <validatetest+0x2f>
printf(stdout, "link should not succeed\n");
exit();
}
}
printf(stdout, "validate ok\n");
36cc: a1 8c 62 00 00 mov 0x628c,%eax
36d1: 83 ec 08 sub $0x8,%esp
36d4: 68 92 59 00 00 push $0x5992
36d9: 50 push %eax
36da: e8 3a 09 00 00 call 4019 <printf>
36df: 83 c4 10 add $0x10,%esp
}
36e2: 90 nop
36e3: c9 leave
36e4: c3 ret
000036e5 <bsstest>:
// does unintialized data start out zero?
char uninit[10000];
void
bsstest(void)
{
36e5: 55 push %ebp
36e6: 89 e5 mov %esp,%ebp
36e8: 83 ec 18 sub $0x18,%esp
int i;
printf(stdout, "bss test\n");
36eb: a1 8c 62 00 00 mov 0x628c,%eax
36f0: 83 ec 08 sub $0x8,%esp
36f3: 68 9f 59 00 00 push $0x599f
36f8: 50 push %eax
36f9: e8 1b 09 00 00 call 4019 <printf>
36fe: 83 c4 10 add $0x10,%esp
for(i = 0; i < sizeof(uninit); i++){
3701: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3708: eb 2e jmp 3738 <bsstest+0x53>
if(uninit[i] != '\0'){
370a: 8b 45 f4 mov -0xc(%ebp),%eax
370d: 05 60 63 00 00 add $0x6360,%eax
3712: 0f b6 00 movzbl (%eax),%eax
3715: 84 c0 test %al,%al
3717: 74 1b je 3734 <bsstest+0x4f>
printf(stdout, "bss test failed\n");
3719: a1 8c 62 00 00 mov 0x628c,%eax
371e: 83 ec 08 sub $0x8,%esp
3721: 68 a9 59 00 00 push $0x59a9
3726: 50 push %eax
3727: e8 ed 08 00 00 call 4019 <printf>
372c: 83 c4 10 add $0x10,%esp
exit();
372f: e8 6e 07 00 00 call 3ea2 <exit>
bsstest(void)
{
int i;
printf(stdout, "bss test\n");
for(i = 0; i < sizeof(uninit); i++){
3734: 83 45 f4 01 addl $0x1,-0xc(%ebp)
3738: 8b 45 f4 mov -0xc(%ebp),%eax
373b: 3d 0f 27 00 00 cmp $0x270f,%eax
3740: 76 c8 jbe 370a <bsstest+0x25>
if(uninit[i] != '\0'){
printf(stdout, "bss test failed\n");
exit();
}
}
printf(stdout, "bss test ok\n");
3742: a1 8c 62 00 00 mov 0x628c,%eax
3747: 83 ec 08 sub $0x8,%esp
374a: 68 ba 59 00 00 push $0x59ba
374f: 50 push %eax
3750: e8 c4 08 00 00 call 4019 <printf>
3755: 83 c4 10 add $0x10,%esp
}
3758: 90 nop
3759: c9 leave
375a: c3 ret
0000375b <bigargtest>:
// does exec return an error if the arguments
// are larger than a page? or does it write
// below the stack and wreck the instructions/data?
void
bigargtest(void)
{
375b: 55 push %ebp
375c: 89 e5 mov %esp,%ebp
375e: 83 ec 18 sub $0x18,%esp
int pid, fd;
unlink("bigarg-ok");
3761: 83 ec 0c sub $0xc,%esp
3764: 68 c7 59 00 00 push $0x59c7
3769: e8 84 07 00 00 call 3ef2 <unlink>
376e: 83 c4 10 add $0x10,%esp
pid = fork();
3771: e8 24 07 00 00 call 3e9a <fork>
3776: 89 45 f0 mov %eax,-0x10(%ebp)
if(pid == 0){
3779: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
377d: 0f 85 97 00 00 00 jne 381a <bigargtest+0xbf>
static char *args[MAXARG];
int i;
for(i = 0; i < MAXARG-1; i++)
3783: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
378a: eb 12 jmp 379e <bigargtest+0x43>
args[i] = "bigargs test: failed\n ";
378c: 8b 45 f4 mov -0xc(%ebp),%eax
378f: c7 04 85 c0 62 00 00 movl $0x59d4,0x62c0(,%eax,4)
3796: d4 59 00 00
unlink("bigarg-ok");
pid = fork();
if(pid == 0){
static char *args[MAXARG];
int i;
for(i = 0; i < MAXARG-1; i++)
379a: 83 45 f4 01 addl $0x1,-0xc(%ebp)
379e: 83 7d f4 1e cmpl $0x1e,-0xc(%ebp)
37a2: 7e e8 jle 378c <bigargtest+0x31>
args[i] = "bigargs test: failed\n ";
args[MAXARG-1] = 0;
37a4: c7 05 3c 63 00 00 00 movl $0x0,0x633c
37ab: 00 00 00
printf(stdout, "bigarg test\n");
37ae: a1 8c 62 00 00 mov 0x628c,%eax
37b3: 83 ec 08 sub $0x8,%esp
37b6: 68 b1 5a 00 00 push $0x5ab1
37bb: 50 push %eax
37bc: e8 58 08 00 00 call 4019 <printf>
37c1: 83 c4 10 add $0x10,%esp
exec("echo", args);
37c4: 83 ec 08 sub $0x8,%esp
37c7: 68 c0 62 00 00 push $0x62c0
37cc: 68 d0 43 00 00 push $0x43d0
37d1: e8 04 07 00 00 call 3eda <exec>
37d6: 83 c4 10 add $0x10,%esp
printf(stdout, "bigarg test ok\n");
37d9: a1 8c 62 00 00 mov 0x628c,%eax
37de: 83 ec 08 sub $0x8,%esp
37e1: 68 be 5a 00 00 push $0x5abe
37e6: 50 push %eax
37e7: e8 2d 08 00 00 call 4019 <printf>
37ec: 83 c4 10 add $0x10,%esp
fd = open("bigarg-ok", O_CREATE);
37ef: 83 ec 08 sub $0x8,%esp
37f2: 68 00 02 00 00 push $0x200
37f7: 68 c7 59 00 00 push $0x59c7
37fc: e8 e1 06 00 00 call 3ee2 <open>
3801: 83 c4 10 add $0x10,%esp
3804: 89 45 ec mov %eax,-0x14(%ebp)
close(fd);
3807: 83 ec 0c sub $0xc,%esp
380a: ff 75 ec pushl -0x14(%ebp)
380d: e8 b8 06 00 00 call 3eca <close>
3812: 83 c4 10 add $0x10,%esp
exit();
3815: e8 88 06 00 00 call 3ea2 <exit>
} else if(pid < 0){
381a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
381e: 79 1b jns 383b <bigargtest+0xe0>
printf(stdout, "bigargtest: fork failed\n");
3820: a1 8c 62 00 00 mov 0x628c,%eax
3825: 83 ec 08 sub $0x8,%esp
3828: 68 ce 5a 00 00 push $0x5ace
382d: 50 push %eax
382e: e8 e6 07 00 00 call 4019 <printf>
3833: 83 c4 10 add $0x10,%esp
exit();
3836: e8 67 06 00 00 call 3ea2 <exit>
}
wait();
383b: e8 6a 06 00 00 call 3eaa <wait>
fd = open("bigarg-ok", 0);
3840: 83 ec 08 sub $0x8,%esp
3843: 6a 00 push $0x0
3845: 68 c7 59 00 00 push $0x59c7
384a: e8 93 06 00 00 call 3ee2 <open>
384f: 83 c4 10 add $0x10,%esp
3852: 89 45 ec mov %eax,-0x14(%ebp)
if(fd < 0){
3855: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3859: 79 1b jns 3876 <bigargtest+0x11b>
printf(stdout, "bigarg test failed!\n");
385b: a1 8c 62 00 00 mov 0x628c,%eax
3860: 83 ec 08 sub $0x8,%esp
3863: 68 e7 5a 00 00 push $0x5ae7
3868: 50 push %eax
3869: e8 ab 07 00 00 call 4019 <printf>
386e: 83 c4 10 add $0x10,%esp
exit();
3871: e8 2c 06 00 00 call 3ea2 <exit>
}
close(fd);
3876: 83 ec 0c sub $0xc,%esp
3879: ff 75 ec pushl -0x14(%ebp)
387c: e8 49 06 00 00 call 3eca <close>
3881: 83 c4 10 add $0x10,%esp
unlink("bigarg-ok");
3884: 83 ec 0c sub $0xc,%esp
3887: 68 c7 59 00 00 push $0x59c7
388c: e8 61 06 00 00 call 3ef2 <unlink>
3891: 83 c4 10 add $0x10,%esp
}
3894: 90 nop
3895: c9 leave
3896: c3 ret
00003897 <fsfull>:
// what happens when the file system runs out of blocks?
// answer: balloc panics, so this test is not useful.
void
fsfull()
{
3897: 55 push %ebp
3898: 89 e5 mov %esp,%ebp
389a: 53 push %ebx
389b: 83 ec 64 sub $0x64,%esp
int nfiles;
int fsblocks = 0;
389e: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
printf(1, "fsfull test\n");
38a5: 83 ec 08 sub $0x8,%esp
38a8: 68 fc 5a 00 00 push $0x5afc
38ad: 6a 01 push $0x1
38af: e8 65 07 00 00 call 4019 <printf>
38b4: 83 c4 10 add $0x10,%esp
for(nfiles = 0; ; nfiles++){
38b7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
char name[64];
name[0] = 'f';
38be: c6 45 a4 66 movb $0x66,-0x5c(%ebp)
name[1] = '0' + nfiles / 1000;
38c2: 8b 4d f4 mov -0xc(%ebp),%ecx
38c5: ba d3 4d 62 10 mov $0x10624dd3,%edx
38ca: 89 c8 mov %ecx,%eax
38cc: f7 ea imul %edx
38ce: c1 fa 06 sar $0x6,%edx
38d1: 89 c8 mov %ecx,%eax
38d3: c1 f8 1f sar $0x1f,%eax
38d6: 29 c2 sub %eax,%edx
38d8: 89 d0 mov %edx,%eax
38da: 83 c0 30 add $0x30,%eax
38dd: 88 45 a5 mov %al,-0x5b(%ebp)
name[2] = '0' + (nfiles % 1000) / 100;
38e0: 8b 5d f4 mov -0xc(%ebp),%ebx
38e3: ba d3 4d 62 10 mov $0x10624dd3,%edx
38e8: 89 d8 mov %ebx,%eax
38ea: f7 ea imul %edx
38ec: c1 fa 06 sar $0x6,%edx
38ef: 89 d8 mov %ebx,%eax
38f1: c1 f8 1f sar $0x1f,%eax
38f4: 89 d1 mov %edx,%ecx
38f6: 29 c1 sub %eax,%ecx
38f8: 69 c1 e8 03 00 00 imul $0x3e8,%ecx,%eax
38fe: 29 c3 sub %eax,%ebx
3900: 89 d9 mov %ebx,%ecx
3902: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3907: 89 c8 mov %ecx,%eax
3909: f7 ea imul %edx
390b: c1 fa 05 sar $0x5,%edx
390e: 89 c8 mov %ecx,%eax
3910: c1 f8 1f sar $0x1f,%eax
3913: 29 c2 sub %eax,%edx
3915: 89 d0 mov %edx,%eax
3917: 83 c0 30 add $0x30,%eax
391a: 88 45 a6 mov %al,-0x5a(%ebp)
name[3] = '0' + (nfiles % 100) / 10;
391d: 8b 5d f4 mov -0xc(%ebp),%ebx
3920: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3925: 89 d8 mov %ebx,%eax
3927: f7 ea imul %edx
3929: c1 fa 05 sar $0x5,%edx
392c: 89 d8 mov %ebx,%eax
392e: c1 f8 1f sar $0x1f,%eax
3931: 89 d1 mov %edx,%ecx
3933: 29 c1 sub %eax,%ecx
3935: 6b c1 64 imul $0x64,%ecx,%eax
3938: 29 c3 sub %eax,%ebx
393a: 89 d9 mov %ebx,%ecx
393c: ba 67 66 66 66 mov $0x66666667,%edx
3941: 89 c8 mov %ecx,%eax
3943: f7 ea imul %edx
3945: c1 fa 02 sar $0x2,%edx
3948: 89 c8 mov %ecx,%eax
394a: c1 f8 1f sar $0x1f,%eax
394d: 29 c2 sub %eax,%edx
394f: 89 d0 mov %edx,%eax
3951: 83 c0 30 add $0x30,%eax
3954: 88 45 a7 mov %al,-0x59(%ebp)
name[4] = '0' + (nfiles % 10);
3957: 8b 4d f4 mov -0xc(%ebp),%ecx
395a: ba 67 66 66 66 mov $0x66666667,%edx
395f: 89 c8 mov %ecx,%eax
3961: f7 ea imul %edx
3963: c1 fa 02 sar $0x2,%edx
3966: 89 c8 mov %ecx,%eax
3968: c1 f8 1f sar $0x1f,%eax
396b: 29 c2 sub %eax,%edx
396d: 89 d0 mov %edx,%eax
396f: c1 e0 02 shl $0x2,%eax
3972: 01 d0 add %edx,%eax
3974: 01 c0 add %eax,%eax
3976: 29 c1 sub %eax,%ecx
3978: 89 ca mov %ecx,%edx
397a: 89 d0 mov %edx,%eax
397c: 83 c0 30 add $0x30,%eax
397f: 88 45 a8 mov %al,-0x58(%ebp)
name[5] = '\0';
3982: c6 45 a9 00 movb $0x0,-0x57(%ebp)
printf(1, "writing %s\n", name);
3986: 83 ec 04 sub $0x4,%esp
3989: 8d 45 a4 lea -0x5c(%ebp),%eax
398c: 50 push %eax
398d: 68 09 5b 00 00 push $0x5b09
3992: 6a 01 push $0x1
3994: e8 80 06 00 00 call 4019 <printf>
3999: 83 c4 10 add $0x10,%esp
int fd = open(name, O_CREATE|O_RDWR);
399c: 83 ec 08 sub $0x8,%esp
399f: 68 02 02 00 00 push $0x202
39a4: 8d 45 a4 lea -0x5c(%ebp),%eax
39a7: 50 push %eax
39a8: e8 35 05 00 00 call 3ee2 <open>
39ad: 83 c4 10 add $0x10,%esp
39b0: 89 45 e8 mov %eax,-0x18(%ebp)
if(fd < 0){
39b3: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
39b7: 79 18 jns 39d1 <fsfull+0x13a>
printf(1, "open %s failed\n", name);
39b9: 83 ec 04 sub $0x4,%esp
39bc: 8d 45 a4 lea -0x5c(%ebp),%eax
39bf: 50 push %eax
39c0: 68 15 5b 00 00 push $0x5b15
39c5: 6a 01 push $0x1
39c7: e8 4d 06 00 00 call 4019 <printf>
39cc: 83 c4 10 add $0x10,%esp
break;
39cf: eb 6b jmp 3a3c <fsfull+0x1a5>
}
int total = 0;
39d1: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
while(1){
int cc = write(fd, buf, 512);
39d8: 83 ec 04 sub $0x4,%esp
39db: 68 00 02 00 00 push $0x200
39e0: 68 80 8a 00 00 push $0x8a80
39e5: ff 75 e8 pushl -0x18(%ebp)
39e8: e8 d5 04 00 00 call 3ec2 <write>
39ed: 83 c4 10 add $0x10,%esp
39f0: 89 45 e4 mov %eax,-0x1c(%ebp)
if(cc < 512)
39f3: 81 7d e4 ff 01 00 00 cmpl $0x1ff,-0x1c(%ebp)
39fa: 7e 0c jle 3a08 <fsfull+0x171>
break;
total += cc;
39fc: 8b 45 e4 mov -0x1c(%ebp),%eax
39ff: 01 45 ec add %eax,-0x14(%ebp)
fsblocks++;
3a02: 83 45 f0 01 addl $0x1,-0x10(%ebp)
}
3a06: eb d0 jmp 39d8 <fsfull+0x141>
}
int total = 0;
while(1){
int cc = write(fd, buf, 512);
if(cc < 512)
break;
3a08: 90 nop
total += cc;
fsblocks++;
}
printf(1, "wrote %d bytes\n", total);
3a09: 83 ec 04 sub $0x4,%esp
3a0c: ff 75 ec pushl -0x14(%ebp)
3a0f: 68 25 5b 00 00 push $0x5b25
3a14: 6a 01 push $0x1
3a16: e8 fe 05 00 00 call 4019 <printf>
3a1b: 83 c4 10 add $0x10,%esp
close(fd);
3a1e: 83 ec 0c sub $0xc,%esp
3a21: ff 75 e8 pushl -0x18(%ebp)
3a24: e8 a1 04 00 00 call 3eca <close>
3a29: 83 c4 10 add $0x10,%esp
if(total == 0)
3a2c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3a30: 74 09 je 3a3b <fsfull+0x1a4>
int nfiles;
int fsblocks = 0;
printf(1, "fsfull test\n");
for(nfiles = 0; ; nfiles++){
3a32: 83 45 f4 01 addl $0x1,-0xc(%ebp)
}
printf(1, "wrote %d bytes\n", total);
close(fd);
if(total == 0)
break;
}
3a36: e9 83 fe ff ff jmp 38be <fsfull+0x27>
fsblocks++;
}
printf(1, "wrote %d bytes\n", total);
close(fd);
if(total == 0)
break;
3a3b: 90 nop
}
while(nfiles >= 0){
3a3c: e9 db 00 00 00 jmp 3b1c <fsfull+0x285>
char name[64];
name[0] = 'f';
3a41: c6 45 a4 66 movb $0x66,-0x5c(%ebp)
name[1] = '0' + nfiles / 1000;
3a45: 8b 4d f4 mov -0xc(%ebp),%ecx
3a48: ba d3 4d 62 10 mov $0x10624dd3,%edx
3a4d: 89 c8 mov %ecx,%eax
3a4f: f7 ea imul %edx
3a51: c1 fa 06 sar $0x6,%edx
3a54: 89 c8 mov %ecx,%eax
3a56: c1 f8 1f sar $0x1f,%eax
3a59: 29 c2 sub %eax,%edx
3a5b: 89 d0 mov %edx,%eax
3a5d: 83 c0 30 add $0x30,%eax
3a60: 88 45 a5 mov %al,-0x5b(%ebp)
name[2] = '0' + (nfiles % 1000) / 100;
3a63: 8b 5d f4 mov -0xc(%ebp),%ebx
3a66: ba d3 4d 62 10 mov $0x10624dd3,%edx
3a6b: 89 d8 mov %ebx,%eax
3a6d: f7 ea imul %edx
3a6f: c1 fa 06 sar $0x6,%edx
3a72: 89 d8 mov %ebx,%eax
3a74: c1 f8 1f sar $0x1f,%eax
3a77: 89 d1 mov %edx,%ecx
3a79: 29 c1 sub %eax,%ecx
3a7b: 69 c1 e8 03 00 00 imul $0x3e8,%ecx,%eax
3a81: 29 c3 sub %eax,%ebx
3a83: 89 d9 mov %ebx,%ecx
3a85: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3a8a: 89 c8 mov %ecx,%eax
3a8c: f7 ea imul %edx
3a8e: c1 fa 05 sar $0x5,%edx
3a91: 89 c8 mov %ecx,%eax
3a93: c1 f8 1f sar $0x1f,%eax
3a96: 29 c2 sub %eax,%edx
3a98: 89 d0 mov %edx,%eax
3a9a: 83 c0 30 add $0x30,%eax
3a9d: 88 45 a6 mov %al,-0x5a(%ebp)
name[3] = '0' + (nfiles % 100) / 10;
3aa0: 8b 5d f4 mov -0xc(%ebp),%ebx
3aa3: ba 1f 85 eb 51 mov $0x51eb851f,%edx
3aa8: 89 d8 mov %ebx,%eax
3aaa: f7 ea imul %edx
3aac: c1 fa 05 sar $0x5,%edx
3aaf: 89 d8 mov %ebx,%eax
3ab1: c1 f8 1f sar $0x1f,%eax
3ab4: 89 d1 mov %edx,%ecx
3ab6: 29 c1 sub %eax,%ecx
3ab8: 6b c1 64 imul $0x64,%ecx,%eax
3abb: 29 c3 sub %eax,%ebx
3abd: 89 d9 mov %ebx,%ecx
3abf: ba 67 66 66 66 mov $0x66666667,%edx
3ac4: 89 c8 mov %ecx,%eax
3ac6: f7 ea imul %edx
3ac8: c1 fa 02 sar $0x2,%edx
3acb: 89 c8 mov %ecx,%eax
3acd: c1 f8 1f sar $0x1f,%eax
3ad0: 29 c2 sub %eax,%edx
3ad2: 89 d0 mov %edx,%eax
3ad4: 83 c0 30 add $0x30,%eax
3ad7: 88 45 a7 mov %al,-0x59(%ebp)
name[4] = '0' + (nfiles % 10);
3ada: 8b 4d f4 mov -0xc(%ebp),%ecx
3add: ba 67 66 66 66 mov $0x66666667,%edx
3ae2: 89 c8 mov %ecx,%eax
3ae4: f7 ea imul %edx
3ae6: c1 fa 02 sar $0x2,%edx
3ae9: 89 c8 mov %ecx,%eax
3aeb: c1 f8 1f sar $0x1f,%eax
3aee: 29 c2 sub %eax,%edx
3af0: 89 d0 mov %edx,%eax
3af2: c1 e0 02 shl $0x2,%eax
3af5: 01 d0 add %edx,%eax
3af7: 01 c0 add %eax,%eax
3af9: 29 c1 sub %eax,%ecx
3afb: 89 ca mov %ecx,%edx
3afd: 89 d0 mov %edx,%eax
3aff: 83 c0 30 add $0x30,%eax
3b02: 88 45 a8 mov %al,-0x58(%ebp)
name[5] = '\0';
3b05: c6 45 a9 00 movb $0x0,-0x57(%ebp)
unlink(name);
3b09: 83 ec 0c sub $0xc,%esp
3b0c: 8d 45 a4 lea -0x5c(%ebp),%eax
3b0f: 50 push %eax
3b10: e8 dd 03 00 00 call 3ef2 <unlink>
3b15: 83 c4 10 add $0x10,%esp
nfiles--;
3b18: 83 6d f4 01 subl $0x1,-0xc(%ebp)
close(fd);
if(total == 0)
break;
}
while(nfiles >= 0){
3b1c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
3b20: 0f 89 1b ff ff ff jns 3a41 <fsfull+0x1aa>
name[5] = '\0';
unlink(name);
nfiles--;
}
printf(1, "fsfull test finished\n");
3b26: 83 ec 08 sub $0x8,%esp
3b29: 68 35 5b 00 00 push $0x5b35
3b2e: 6a 01 push $0x1
3b30: e8 e4 04 00 00 call 4019 <printf>
3b35: 83 c4 10 add $0x10,%esp
}
3b38: 90 nop
3b39: 8b 5d fc mov -0x4(%ebp),%ebx
3b3c: c9 leave
3b3d: c3 ret
00003b3e <rand>:
unsigned long randstate = 1;
unsigned int
rand()
{
3b3e: 55 push %ebp
3b3f: 89 e5 mov %esp,%ebp
randstate = randstate * 1664525 + 1013904223;
3b41: a1 90 62 00 00 mov 0x6290,%eax
3b46: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
3b4c: 05 5f f3 6e 3c add $0x3c6ef35f,%eax
3b51: a3 90 62 00 00 mov %eax,0x6290
return randstate;
3b56: a1 90 62 00 00 mov 0x6290,%eax
}
3b5b: 5d pop %ebp
3b5c: c3 ret
00003b5d <main>:
int
main(int argc, char *argv[])
{
3b5d: 8d 4c 24 04 lea 0x4(%esp),%ecx
3b61: 83 e4 f0 and $0xfffffff0,%esp
3b64: ff 71 fc pushl -0x4(%ecx)
3b67: 55 push %ebp
3b68: 89 e5 mov %esp,%ebp
3b6a: 51 push %ecx
3b6b: 83 ec 04 sub $0x4,%esp
printf(1, "usertests starting\n");
3b6e: 83 ec 08 sub $0x8,%esp
3b71: 68 4b 5b 00 00 push $0x5b4b
3b76: 6a 01 push $0x1
3b78: e8 9c 04 00 00 call 4019 <printf>
3b7d: 83 c4 10 add $0x10,%esp
if(open("usertests.ran", 0) >= 0){
3b80: 83 ec 08 sub $0x8,%esp
3b83: 6a 00 push $0x0
3b85: 68 5f 5b 00 00 push $0x5b5f
3b8a: e8 53 03 00 00 call 3ee2 <open>
3b8f: 83 c4 10 add $0x10,%esp
3b92: 85 c0 test %eax,%eax
3b94: 78 17 js 3bad <main+0x50>
printf(1, "already ran user tests -- rebuild fs.img\n");
3b96: 83 ec 08 sub $0x8,%esp
3b99: 68 70 5b 00 00 push $0x5b70
3b9e: 6a 01 push $0x1
3ba0: e8 74 04 00 00 call 4019 <printf>
3ba5: 83 c4 10 add $0x10,%esp
exit();
3ba8: e8 f5 02 00 00 call 3ea2 <exit>
}
close(open("usertests.ran", O_CREATE));
3bad: 83 ec 08 sub $0x8,%esp
3bb0: 68 00 02 00 00 push $0x200
3bb5: 68 5f 5b 00 00 push $0x5b5f
3bba: e8 23 03 00 00 call 3ee2 <open>
3bbf: 83 c4 10 add $0x10,%esp
3bc2: 83 ec 0c sub $0xc,%esp
3bc5: 50 push %eax
3bc6: e8 ff 02 00 00 call 3eca <close>
3bcb: 83 c4 10 add $0x10,%esp
bigargtest();
bigwrite();
bigargtest();
bsstest();*/
sbrktest();
3bce: e8 22 f5 ff ff call 30f5 <sbrktest>
validatetest();
3bd3: e8 2f fa ff ff call 3607 <validatetest>
opentest();
3bd8: e8 22 c7 ff ff call 2ff <opentest>
writetest();
3bdd: e8 cc c7 ff ff call 3ae <writetest>
writetest1();
3be2: e8 d7 c9 ff ff call 5be <writetest1>
createtest();
3be7: e8 ce cb ff ff call 7ba <createtest>
openiputtest();
3bec: e8 ff c5 ff ff call 1f0 <openiputtest>
exitiputtest();
3bf1: e8 fb c4 ff ff call f1 <exitiputtest>
iputtest();
3bf6: e8 05 c4 ff ff call 0 <iputtest>
mem();
3bfb: e8 85 d1 ff ff call d85 <mem>
pipe1();
3c00: e8 bc cd ff ff call 9c1 <pipe1>
preempt();
3c05: e8 a0 cf ff ff call baa <preempt>
exitwait();
3c0a: e8 fe d0 ff ff call d0d <exitwait>
rmdot();
3c0f: e8 20 ef ff ff call 2b34 <rmdot>
fourteen();
3c14: e8 bf ed ff ff call 29d8 <fourteen>
bigfile();
3c19: e8 a2 eb ff ff call 27c0 <bigfile>
subdir();
3c1e: e8 5b e3 ff ff call 1f7e <subdir>
linktest();
3c23: e8 b6 da ff ff call 16de <linktest>
unlinkread();
3c28: e8 ef d8 ff ff call 151c <unlinkread>
dirfile();
3c2d: e8 87 f0 ff ff call 2cb9 <dirfile>
iref();
3c32: e8 ba f2 ff ff call 2ef1 <iref>
forktest();
3c37: e8 ef f3 ff ff call 302b <forktest>
bigdir(); // slow
3c3c: e8 c8 e1 ff ff call 1e09 <bigdir>
exectest();
3c41: e8 28 cd ff ff call 96e <exectest>
exit();
3c46: e8 57 02 00 00 call 3ea2 <exit>
00003c4b <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
3c4b: 55 push %ebp
3c4c: 89 e5 mov %esp,%ebp
3c4e: 57 push %edi
3c4f: 53 push %ebx
asm volatile("cld; rep stosb" :
3c50: 8b 4d 08 mov 0x8(%ebp),%ecx
3c53: 8b 55 10 mov 0x10(%ebp),%edx
3c56: 8b 45 0c mov 0xc(%ebp),%eax
3c59: 89 cb mov %ecx,%ebx
3c5b: 89 df mov %ebx,%edi
3c5d: 89 d1 mov %edx,%ecx
3c5f: fc cld
3c60: f3 aa rep stos %al,%es:(%edi)
3c62: 89 ca mov %ecx,%edx
3c64: 89 fb mov %edi,%ebx
3c66: 89 5d 08 mov %ebx,0x8(%ebp)
3c69: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
3c6c: 90 nop
3c6d: 5b pop %ebx
3c6e: 5f pop %edi
3c6f: 5d pop %ebp
3c70: c3 ret
00003c71 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
3c71: 55 push %ebp
3c72: 89 e5 mov %esp,%ebp
3c74: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
3c77: 8b 45 08 mov 0x8(%ebp),%eax
3c7a: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
3c7d: 90 nop
3c7e: 8b 45 08 mov 0x8(%ebp),%eax
3c81: 8d 50 01 lea 0x1(%eax),%edx
3c84: 89 55 08 mov %edx,0x8(%ebp)
3c87: 8b 55 0c mov 0xc(%ebp),%edx
3c8a: 8d 4a 01 lea 0x1(%edx),%ecx
3c8d: 89 4d 0c mov %ecx,0xc(%ebp)
3c90: 0f b6 12 movzbl (%edx),%edx
3c93: 88 10 mov %dl,(%eax)
3c95: 0f b6 00 movzbl (%eax),%eax
3c98: 84 c0 test %al,%al
3c9a: 75 e2 jne 3c7e <strcpy+0xd>
;
return os;
3c9c: 8b 45 fc mov -0x4(%ebp),%eax
}
3c9f: c9 leave
3ca0: c3 ret
00003ca1 <strcmp>:
int
strcmp(const char *p, const char *q)
{
3ca1: 55 push %ebp
3ca2: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
3ca4: eb 08 jmp 3cae <strcmp+0xd>
p++, q++;
3ca6: 83 45 08 01 addl $0x1,0x8(%ebp)
3caa: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
3cae: 8b 45 08 mov 0x8(%ebp),%eax
3cb1: 0f b6 00 movzbl (%eax),%eax
3cb4: 84 c0 test %al,%al
3cb6: 74 10 je 3cc8 <strcmp+0x27>
3cb8: 8b 45 08 mov 0x8(%ebp),%eax
3cbb: 0f b6 10 movzbl (%eax),%edx
3cbe: 8b 45 0c mov 0xc(%ebp),%eax
3cc1: 0f b6 00 movzbl (%eax),%eax
3cc4: 38 c2 cmp %al,%dl
3cc6: 74 de je 3ca6 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
3cc8: 8b 45 08 mov 0x8(%ebp),%eax
3ccb: 0f b6 00 movzbl (%eax),%eax
3cce: 0f b6 d0 movzbl %al,%edx
3cd1: 8b 45 0c mov 0xc(%ebp),%eax
3cd4: 0f b6 00 movzbl (%eax),%eax
3cd7: 0f b6 c0 movzbl %al,%eax
3cda: 29 c2 sub %eax,%edx
3cdc: 89 d0 mov %edx,%eax
}
3cde: 5d pop %ebp
3cdf: c3 ret
00003ce0 <strlen>:
uint
strlen(char *s)
{
3ce0: 55 push %ebp
3ce1: 89 e5 mov %esp,%ebp
3ce3: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
3ce6: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
3ced: eb 04 jmp 3cf3 <strlen+0x13>
3cef: 83 45 fc 01 addl $0x1,-0x4(%ebp)
3cf3: 8b 55 fc mov -0x4(%ebp),%edx
3cf6: 8b 45 08 mov 0x8(%ebp),%eax
3cf9: 01 d0 add %edx,%eax
3cfb: 0f b6 00 movzbl (%eax),%eax
3cfe: 84 c0 test %al,%al
3d00: 75 ed jne 3cef <strlen+0xf>
;
return n;
3d02: 8b 45 fc mov -0x4(%ebp),%eax
}
3d05: c9 leave
3d06: c3 ret
00003d07 <memset>:
void*
memset(void *dst, int c, uint n)
{
3d07: 55 push %ebp
3d08: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
3d0a: 8b 45 10 mov 0x10(%ebp),%eax
3d0d: 50 push %eax
3d0e: ff 75 0c pushl 0xc(%ebp)
3d11: ff 75 08 pushl 0x8(%ebp)
3d14: e8 32 ff ff ff call 3c4b <stosb>
3d19: 83 c4 0c add $0xc,%esp
return dst;
3d1c: 8b 45 08 mov 0x8(%ebp),%eax
}
3d1f: c9 leave
3d20: c3 ret
00003d21 <strchr>:
char*
strchr(const char *s, char c)
{
3d21: 55 push %ebp
3d22: 89 e5 mov %esp,%ebp
3d24: 83 ec 04 sub $0x4,%esp
3d27: 8b 45 0c mov 0xc(%ebp),%eax
3d2a: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
3d2d: eb 14 jmp 3d43 <strchr+0x22>
if(*s == c)
3d2f: 8b 45 08 mov 0x8(%ebp),%eax
3d32: 0f b6 00 movzbl (%eax),%eax
3d35: 3a 45 fc cmp -0x4(%ebp),%al
3d38: 75 05 jne 3d3f <strchr+0x1e>
return (char*)s;
3d3a: 8b 45 08 mov 0x8(%ebp),%eax
3d3d: eb 13 jmp 3d52 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
3d3f: 83 45 08 01 addl $0x1,0x8(%ebp)
3d43: 8b 45 08 mov 0x8(%ebp),%eax
3d46: 0f b6 00 movzbl (%eax),%eax
3d49: 84 c0 test %al,%al
3d4b: 75 e2 jne 3d2f <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
3d4d: b8 00 00 00 00 mov $0x0,%eax
}
3d52: c9 leave
3d53: c3 ret
00003d54 <gets>:
char*
gets(char *buf, int max)
{
3d54: 55 push %ebp
3d55: 89 e5 mov %esp,%ebp
3d57: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
3d5a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
3d61: eb 42 jmp 3da5 <gets+0x51>
cc = read(0, &c, 1);
3d63: 83 ec 04 sub $0x4,%esp
3d66: 6a 01 push $0x1
3d68: 8d 45 ef lea -0x11(%ebp),%eax
3d6b: 50 push %eax
3d6c: 6a 00 push $0x0
3d6e: e8 47 01 00 00 call 3eba <read>
3d73: 83 c4 10 add $0x10,%esp
3d76: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
3d79: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3d7d: 7e 33 jle 3db2 <gets+0x5e>
break;
buf[i++] = c;
3d7f: 8b 45 f4 mov -0xc(%ebp),%eax
3d82: 8d 50 01 lea 0x1(%eax),%edx
3d85: 89 55 f4 mov %edx,-0xc(%ebp)
3d88: 89 c2 mov %eax,%edx
3d8a: 8b 45 08 mov 0x8(%ebp),%eax
3d8d: 01 c2 add %eax,%edx
3d8f: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3d93: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
3d95: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3d99: 3c 0a cmp $0xa,%al
3d9b: 74 16 je 3db3 <gets+0x5f>
3d9d: 0f b6 45 ef movzbl -0x11(%ebp),%eax
3da1: 3c 0d cmp $0xd,%al
3da3: 74 0e je 3db3 <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
3da5: 8b 45 f4 mov -0xc(%ebp),%eax
3da8: 83 c0 01 add $0x1,%eax
3dab: 3b 45 0c cmp 0xc(%ebp),%eax
3dae: 7c b3 jl 3d63 <gets+0xf>
3db0: eb 01 jmp 3db3 <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
3db2: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
3db3: 8b 55 f4 mov -0xc(%ebp),%edx
3db6: 8b 45 08 mov 0x8(%ebp),%eax
3db9: 01 d0 add %edx,%eax
3dbb: c6 00 00 movb $0x0,(%eax)
return buf;
3dbe: 8b 45 08 mov 0x8(%ebp),%eax
}
3dc1: c9 leave
3dc2: c3 ret
00003dc3 <stat>:
int
stat(char *n, struct stat *st)
{
3dc3: 55 push %ebp
3dc4: 89 e5 mov %esp,%ebp
3dc6: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
3dc9: 83 ec 08 sub $0x8,%esp
3dcc: 6a 00 push $0x0
3dce: ff 75 08 pushl 0x8(%ebp)
3dd1: e8 0c 01 00 00 call 3ee2 <open>
3dd6: 83 c4 10 add $0x10,%esp
3dd9: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
3ddc: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
3de0: 79 07 jns 3de9 <stat+0x26>
return -1;
3de2: b8 ff ff ff ff mov $0xffffffff,%eax
3de7: eb 25 jmp 3e0e <stat+0x4b>
r = fstat(fd, st);
3de9: 83 ec 08 sub $0x8,%esp
3dec: ff 75 0c pushl 0xc(%ebp)
3def: ff 75 f4 pushl -0xc(%ebp)
3df2: e8 03 01 00 00 call 3efa <fstat>
3df7: 83 c4 10 add $0x10,%esp
3dfa: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
3dfd: 83 ec 0c sub $0xc,%esp
3e00: ff 75 f4 pushl -0xc(%ebp)
3e03: e8 c2 00 00 00 call 3eca <close>
3e08: 83 c4 10 add $0x10,%esp
return r;
3e0b: 8b 45 f0 mov -0x10(%ebp),%eax
}
3e0e: c9 leave
3e0f: c3 ret
00003e10 <atoi>:
int
atoi(const char *s)
{
3e10: 55 push %ebp
3e11: 89 e5 mov %esp,%ebp
3e13: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
3e16: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
3e1d: eb 25 jmp 3e44 <atoi+0x34>
n = n*10 + *s++ - '0';
3e1f: 8b 55 fc mov -0x4(%ebp),%edx
3e22: 89 d0 mov %edx,%eax
3e24: c1 e0 02 shl $0x2,%eax
3e27: 01 d0 add %edx,%eax
3e29: 01 c0 add %eax,%eax
3e2b: 89 c1 mov %eax,%ecx
3e2d: 8b 45 08 mov 0x8(%ebp),%eax
3e30: 8d 50 01 lea 0x1(%eax),%edx
3e33: 89 55 08 mov %edx,0x8(%ebp)
3e36: 0f b6 00 movzbl (%eax),%eax
3e39: 0f be c0 movsbl %al,%eax
3e3c: 01 c8 add %ecx,%eax
3e3e: 83 e8 30 sub $0x30,%eax
3e41: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
3e44: 8b 45 08 mov 0x8(%ebp),%eax
3e47: 0f b6 00 movzbl (%eax),%eax
3e4a: 3c 2f cmp $0x2f,%al
3e4c: 7e 0a jle 3e58 <atoi+0x48>
3e4e: 8b 45 08 mov 0x8(%ebp),%eax
3e51: 0f b6 00 movzbl (%eax),%eax
3e54: 3c 39 cmp $0x39,%al
3e56: 7e c7 jle 3e1f <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
3e58: 8b 45 fc mov -0x4(%ebp),%eax
}
3e5b: c9 leave
3e5c: c3 ret
00003e5d <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
3e5d: 55 push %ebp
3e5e: 89 e5 mov %esp,%ebp
3e60: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
3e63: 8b 45 08 mov 0x8(%ebp),%eax
3e66: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
3e69: 8b 45 0c mov 0xc(%ebp),%eax
3e6c: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
3e6f: eb 17 jmp 3e88 <memmove+0x2b>
*dst++ = *src++;
3e71: 8b 45 fc mov -0x4(%ebp),%eax
3e74: 8d 50 01 lea 0x1(%eax),%edx
3e77: 89 55 fc mov %edx,-0x4(%ebp)
3e7a: 8b 55 f8 mov -0x8(%ebp),%edx
3e7d: 8d 4a 01 lea 0x1(%edx),%ecx
3e80: 89 4d f8 mov %ecx,-0x8(%ebp)
3e83: 0f b6 12 movzbl (%edx),%edx
3e86: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
3e88: 8b 45 10 mov 0x10(%ebp),%eax
3e8b: 8d 50 ff lea -0x1(%eax),%edx
3e8e: 89 55 10 mov %edx,0x10(%ebp)
3e91: 85 c0 test %eax,%eax
3e93: 7f dc jg 3e71 <memmove+0x14>
*dst++ = *src++;
return vdst;
3e95: 8b 45 08 mov 0x8(%ebp),%eax
}
3e98: c9 leave
3e99: c3 ret
00003e9a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
3e9a: b8 01 00 00 00 mov $0x1,%eax
3e9f: cd 40 int $0x40
3ea1: c3 ret
00003ea2 <exit>:
SYSCALL(exit)
3ea2: b8 02 00 00 00 mov $0x2,%eax
3ea7: cd 40 int $0x40
3ea9: c3 ret
00003eaa <wait>:
SYSCALL(wait)
3eaa: b8 03 00 00 00 mov $0x3,%eax
3eaf: cd 40 int $0x40
3eb1: c3 ret
00003eb2 <pipe>:
SYSCALL(pipe)
3eb2: b8 04 00 00 00 mov $0x4,%eax
3eb7: cd 40 int $0x40
3eb9: c3 ret
00003eba <read>:
SYSCALL(read)
3eba: b8 05 00 00 00 mov $0x5,%eax
3ebf: cd 40 int $0x40
3ec1: c3 ret
00003ec2 <write>:
SYSCALL(write)
3ec2: b8 10 00 00 00 mov $0x10,%eax
3ec7: cd 40 int $0x40
3ec9: c3 ret
00003eca <close>:
SYSCALL(close)
3eca: b8 15 00 00 00 mov $0x15,%eax
3ecf: cd 40 int $0x40
3ed1: c3 ret
00003ed2 <kill>:
SYSCALL(kill)
3ed2: b8 06 00 00 00 mov $0x6,%eax
3ed7: cd 40 int $0x40
3ed9: c3 ret
00003eda <exec>:
SYSCALL(exec)
3eda: b8 07 00 00 00 mov $0x7,%eax
3edf: cd 40 int $0x40
3ee1: c3 ret
00003ee2 <open>:
SYSCALL(open)
3ee2: b8 0f 00 00 00 mov $0xf,%eax
3ee7: cd 40 int $0x40
3ee9: c3 ret
00003eea <mknod>:
SYSCALL(mknod)
3eea: b8 11 00 00 00 mov $0x11,%eax
3eef: cd 40 int $0x40
3ef1: c3 ret
00003ef2 <unlink>:
SYSCALL(unlink)
3ef2: b8 12 00 00 00 mov $0x12,%eax
3ef7: cd 40 int $0x40
3ef9: c3 ret
00003efa <fstat>:
SYSCALL(fstat)
3efa: b8 08 00 00 00 mov $0x8,%eax
3eff: cd 40 int $0x40
3f01: c3 ret
00003f02 <link>:
SYSCALL(link)
3f02: b8 13 00 00 00 mov $0x13,%eax
3f07: cd 40 int $0x40
3f09: c3 ret
00003f0a <mkdir>:
SYSCALL(mkdir)
3f0a: b8 14 00 00 00 mov $0x14,%eax
3f0f: cd 40 int $0x40
3f11: c3 ret
00003f12 <chdir>:
SYSCALL(chdir)
3f12: b8 09 00 00 00 mov $0x9,%eax
3f17: cd 40 int $0x40
3f19: c3 ret
00003f1a <dup>:
SYSCALL(dup)
3f1a: b8 0a 00 00 00 mov $0xa,%eax
3f1f: cd 40 int $0x40
3f21: c3 ret
00003f22 <getpid>:
SYSCALL(getpid)
3f22: b8 0b 00 00 00 mov $0xb,%eax
3f27: cd 40 int $0x40
3f29: c3 ret
00003f2a <sbrk>:
SYSCALL(sbrk)
3f2a: b8 0c 00 00 00 mov $0xc,%eax
3f2f: cd 40 int $0x40
3f31: c3 ret
00003f32 <sleep>:
SYSCALL(sleep)
3f32: b8 0d 00 00 00 mov $0xd,%eax
3f37: cd 40 int $0x40
3f39: c3 ret
00003f3a <uptime>:
SYSCALL(uptime)
3f3a: b8 0e 00 00 00 mov $0xe,%eax
3f3f: cd 40 int $0x40
3f41: c3 ret
00003f42 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3f42: 55 push %ebp
3f43: 89 e5 mov %esp,%ebp
3f45: 83 ec 18 sub $0x18,%esp
3f48: 8b 45 0c mov 0xc(%ebp),%eax
3f4b: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3f4e: 83 ec 04 sub $0x4,%esp
3f51: 6a 01 push $0x1
3f53: 8d 45 f4 lea -0xc(%ebp),%eax
3f56: 50 push %eax
3f57: ff 75 08 pushl 0x8(%ebp)
3f5a: e8 63 ff ff ff call 3ec2 <write>
3f5f: 83 c4 10 add $0x10,%esp
}
3f62: 90 nop
3f63: c9 leave
3f64: c3 ret
00003f65 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3f65: 55 push %ebp
3f66: 89 e5 mov %esp,%ebp
3f68: 53 push %ebx
3f69: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
3f6c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
3f73: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
3f77: 74 17 je 3f90 <printint+0x2b>
3f79: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
3f7d: 79 11 jns 3f90 <printint+0x2b>
neg = 1;
3f7f: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
3f86: 8b 45 0c mov 0xc(%ebp),%eax
3f89: f7 d8 neg %eax
3f8b: 89 45 ec mov %eax,-0x14(%ebp)
3f8e: eb 06 jmp 3f96 <printint+0x31>
} else {
x = xx;
3f90: 8b 45 0c mov 0xc(%ebp),%eax
3f93: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
3f96: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
3f9d: 8b 4d f4 mov -0xc(%ebp),%ecx
3fa0: 8d 41 01 lea 0x1(%ecx),%eax
3fa3: 89 45 f4 mov %eax,-0xc(%ebp)
3fa6: 8b 5d 10 mov 0x10(%ebp),%ebx
3fa9: 8b 45 ec mov -0x14(%ebp),%eax
3fac: ba 00 00 00 00 mov $0x0,%edx
3fb1: f7 f3 div %ebx
3fb3: 89 d0 mov %edx,%eax
3fb5: 0f b6 80 94 62 00 00 movzbl 0x6294(%eax),%eax
3fbc: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
3fc0: 8b 5d 10 mov 0x10(%ebp),%ebx
3fc3: 8b 45 ec mov -0x14(%ebp),%eax
3fc6: ba 00 00 00 00 mov $0x0,%edx
3fcb: f7 f3 div %ebx
3fcd: 89 45 ec mov %eax,-0x14(%ebp)
3fd0: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3fd4: 75 c7 jne 3f9d <printint+0x38>
if(neg)
3fd6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3fda: 74 2d je 4009 <printint+0xa4>
buf[i++] = '-';
3fdc: 8b 45 f4 mov -0xc(%ebp),%eax
3fdf: 8d 50 01 lea 0x1(%eax),%edx
3fe2: 89 55 f4 mov %edx,-0xc(%ebp)
3fe5: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
3fea: eb 1d jmp 4009 <printint+0xa4>
putc(fd, buf[i]);
3fec: 8d 55 dc lea -0x24(%ebp),%edx
3fef: 8b 45 f4 mov -0xc(%ebp),%eax
3ff2: 01 d0 add %edx,%eax
3ff4: 0f b6 00 movzbl (%eax),%eax
3ff7: 0f be c0 movsbl %al,%eax
3ffa: 83 ec 08 sub $0x8,%esp
3ffd: 50 push %eax
3ffe: ff 75 08 pushl 0x8(%ebp)
4001: e8 3c ff ff ff call 3f42 <putc>
4006: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4009: 83 6d f4 01 subl $0x1,-0xc(%ebp)
400d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
4011: 79 d9 jns 3fec <printint+0x87>
putc(fd, buf[i]);
}
4013: 90 nop
4014: 8b 5d fc mov -0x4(%ebp),%ebx
4017: c9 leave
4018: c3 ret
00004019 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4019: 55 push %ebp
401a: 89 e5 mov %esp,%ebp
401c: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
401f: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4026: 8d 45 0c lea 0xc(%ebp),%eax
4029: 83 c0 04 add $0x4,%eax
402c: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
402f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4036: e9 59 01 00 00 jmp 4194 <printf+0x17b>
c = fmt[i] & 0xff;
403b: 8b 55 0c mov 0xc(%ebp),%edx
403e: 8b 45 f0 mov -0x10(%ebp),%eax
4041: 01 d0 add %edx,%eax
4043: 0f b6 00 movzbl (%eax),%eax
4046: 0f be c0 movsbl %al,%eax
4049: 25 ff 00 00 00 and $0xff,%eax
404e: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
4051: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4055: 75 2c jne 4083 <printf+0x6a>
if(c == '%'){
4057: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
405b: 75 0c jne 4069 <printf+0x50>
state = '%';
405d: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
4064: e9 27 01 00 00 jmp 4190 <printf+0x177>
} else {
putc(fd, c);
4069: 8b 45 e4 mov -0x1c(%ebp),%eax
406c: 0f be c0 movsbl %al,%eax
406f: 83 ec 08 sub $0x8,%esp
4072: 50 push %eax
4073: ff 75 08 pushl 0x8(%ebp)
4076: e8 c7 fe ff ff call 3f42 <putc>
407b: 83 c4 10 add $0x10,%esp
407e: e9 0d 01 00 00 jmp 4190 <printf+0x177>
}
} else if(state == '%'){
4083: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
4087: 0f 85 03 01 00 00 jne 4190 <printf+0x177>
if(c == 'd'){
408d: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
4091: 75 1e jne 40b1 <printf+0x98>
printint(fd, *ap, 10, 1);
4093: 8b 45 e8 mov -0x18(%ebp),%eax
4096: 8b 00 mov (%eax),%eax
4098: 6a 01 push $0x1
409a: 6a 0a push $0xa
409c: 50 push %eax
409d: ff 75 08 pushl 0x8(%ebp)
40a0: e8 c0 fe ff ff call 3f65 <printint>
40a5: 83 c4 10 add $0x10,%esp
ap++;
40a8: 83 45 e8 04 addl $0x4,-0x18(%ebp)
40ac: e9 d8 00 00 00 jmp 4189 <printf+0x170>
} else if(c == 'x' || c == 'p'){
40b1: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
40b5: 74 06 je 40bd <printf+0xa4>
40b7: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
40bb: 75 1e jne 40db <printf+0xc2>
printint(fd, *ap, 16, 0);
40bd: 8b 45 e8 mov -0x18(%ebp),%eax
40c0: 8b 00 mov (%eax),%eax
40c2: 6a 00 push $0x0
40c4: 6a 10 push $0x10
40c6: 50 push %eax
40c7: ff 75 08 pushl 0x8(%ebp)
40ca: e8 96 fe ff ff call 3f65 <printint>
40cf: 83 c4 10 add $0x10,%esp
ap++;
40d2: 83 45 e8 04 addl $0x4,-0x18(%ebp)
40d6: e9 ae 00 00 00 jmp 4189 <printf+0x170>
} else if(c == 's'){
40db: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
40df: 75 43 jne 4124 <printf+0x10b>
s = (char*)*ap;
40e1: 8b 45 e8 mov -0x18(%ebp),%eax
40e4: 8b 00 mov (%eax),%eax
40e6: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
40e9: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
40ed: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
40f1: 75 25 jne 4118 <printf+0xff>
s = "(null)";
40f3: c7 45 f4 9a 5b 00 00 movl $0x5b9a,-0xc(%ebp)
while(*s != 0){
40fa: eb 1c jmp 4118 <printf+0xff>
putc(fd, *s);
40fc: 8b 45 f4 mov -0xc(%ebp),%eax
40ff: 0f b6 00 movzbl (%eax),%eax
4102: 0f be c0 movsbl %al,%eax
4105: 83 ec 08 sub $0x8,%esp
4108: 50 push %eax
4109: ff 75 08 pushl 0x8(%ebp)
410c: e8 31 fe ff ff call 3f42 <putc>
4111: 83 c4 10 add $0x10,%esp
s++;
4114: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
4118: 8b 45 f4 mov -0xc(%ebp),%eax
411b: 0f b6 00 movzbl (%eax),%eax
411e: 84 c0 test %al,%al
4120: 75 da jne 40fc <printf+0xe3>
4122: eb 65 jmp 4189 <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4124: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
4128: 75 1d jne 4147 <printf+0x12e>
putc(fd, *ap);
412a: 8b 45 e8 mov -0x18(%ebp),%eax
412d: 8b 00 mov (%eax),%eax
412f: 0f be c0 movsbl %al,%eax
4132: 83 ec 08 sub $0x8,%esp
4135: 50 push %eax
4136: ff 75 08 pushl 0x8(%ebp)
4139: e8 04 fe ff ff call 3f42 <putc>
413e: 83 c4 10 add $0x10,%esp
ap++;
4141: 83 45 e8 04 addl $0x4,-0x18(%ebp)
4145: eb 42 jmp 4189 <printf+0x170>
} else if(c == '%'){
4147: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
414b: 75 17 jne 4164 <printf+0x14b>
putc(fd, c);
414d: 8b 45 e4 mov -0x1c(%ebp),%eax
4150: 0f be c0 movsbl %al,%eax
4153: 83 ec 08 sub $0x8,%esp
4156: 50 push %eax
4157: ff 75 08 pushl 0x8(%ebp)
415a: e8 e3 fd ff ff call 3f42 <putc>
415f: 83 c4 10 add $0x10,%esp
4162: eb 25 jmp 4189 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
4164: 83 ec 08 sub $0x8,%esp
4167: 6a 25 push $0x25
4169: ff 75 08 pushl 0x8(%ebp)
416c: e8 d1 fd ff ff call 3f42 <putc>
4171: 83 c4 10 add $0x10,%esp
putc(fd, c);
4174: 8b 45 e4 mov -0x1c(%ebp),%eax
4177: 0f be c0 movsbl %al,%eax
417a: 83 ec 08 sub $0x8,%esp
417d: 50 push %eax
417e: ff 75 08 pushl 0x8(%ebp)
4181: e8 bc fd ff ff call 3f42 <putc>
4186: 83 c4 10 add $0x10,%esp
}
state = 0;
4189: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4190: 83 45 f0 01 addl $0x1,-0x10(%ebp)
4194: 8b 55 0c mov 0xc(%ebp),%edx
4197: 8b 45 f0 mov -0x10(%ebp),%eax
419a: 01 d0 add %edx,%eax
419c: 0f b6 00 movzbl (%eax),%eax
419f: 84 c0 test %al,%al
41a1: 0f 85 94 fe ff ff jne 403b <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
41a7: 90 nop
41a8: c9 leave
41a9: c3 ret
000041aa <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
41aa: 55 push %ebp
41ab: 89 e5 mov %esp,%ebp
41ad: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
41b0: 8b 45 08 mov 0x8(%ebp),%eax
41b3: 83 e8 08 sub $0x8,%eax
41b6: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
41b9: a1 48 63 00 00 mov 0x6348,%eax
41be: 89 45 fc mov %eax,-0x4(%ebp)
41c1: eb 24 jmp 41e7 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
41c3: 8b 45 fc mov -0x4(%ebp),%eax
41c6: 8b 00 mov (%eax),%eax
41c8: 3b 45 fc cmp -0x4(%ebp),%eax
41cb: 77 12 ja 41df <free+0x35>
41cd: 8b 45 f8 mov -0x8(%ebp),%eax
41d0: 3b 45 fc cmp -0x4(%ebp),%eax
41d3: 77 24 ja 41f9 <free+0x4f>
41d5: 8b 45 fc mov -0x4(%ebp),%eax
41d8: 8b 00 mov (%eax),%eax
41da: 3b 45 f8 cmp -0x8(%ebp),%eax
41dd: 77 1a ja 41f9 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
41df: 8b 45 fc mov -0x4(%ebp),%eax
41e2: 8b 00 mov (%eax),%eax
41e4: 89 45 fc mov %eax,-0x4(%ebp)
41e7: 8b 45 f8 mov -0x8(%ebp),%eax
41ea: 3b 45 fc cmp -0x4(%ebp),%eax
41ed: 76 d4 jbe 41c3 <free+0x19>
41ef: 8b 45 fc mov -0x4(%ebp),%eax
41f2: 8b 00 mov (%eax),%eax
41f4: 3b 45 f8 cmp -0x8(%ebp),%eax
41f7: 76 ca jbe 41c3 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
41f9: 8b 45 f8 mov -0x8(%ebp),%eax
41fc: 8b 40 04 mov 0x4(%eax),%eax
41ff: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
4206: 8b 45 f8 mov -0x8(%ebp),%eax
4209: 01 c2 add %eax,%edx
420b: 8b 45 fc mov -0x4(%ebp),%eax
420e: 8b 00 mov (%eax),%eax
4210: 39 c2 cmp %eax,%edx
4212: 75 24 jne 4238 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
4214: 8b 45 f8 mov -0x8(%ebp),%eax
4217: 8b 50 04 mov 0x4(%eax),%edx
421a: 8b 45 fc mov -0x4(%ebp),%eax
421d: 8b 00 mov (%eax),%eax
421f: 8b 40 04 mov 0x4(%eax),%eax
4222: 01 c2 add %eax,%edx
4224: 8b 45 f8 mov -0x8(%ebp),%eax
4227: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
422a: 8b 45 fc mov -0x4(%ebp),%eax
422d: 8b 00 mov (%eax),%eax
422f: 8b 10 mov (%eax),%edx
4231: 8b 45 f8 mov -0x8(%ebp),%eax
4234: 89 10 mov %edx,(%eax)
4236: eb 0a jmp 4242 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
4238: 8b 45 fc mov -0x4(%ebp),%eax
423b: 8b 10 mov (%eax),%edx
423d: 8b 45 f8 mov -0x8(%ebp),%eax
4240: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
4242: 8b 45 fc mov -0x4(%ebp),%eax
4245: 8b 40 04 mov 0x4(%eax),%eax
4248: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
424f: 8b 45 fc mov -0x4(%ebp),%eax
4252: 01 d0 add %edx,%eax
4254: 3b 45 f8 cmp -0x8(%ebp),%eax
4257: 75 20 jne 4279 <free+0xcf>
p->s.size += bp->s.size;
4259: 8b 45 fc mov -0x4(%ebp),%eax
425c: 8b 50 04 mov 0x4(%eax),%edx
425f: 8b 45 f8 mov -0x8(%ebp),%eax
4262: 8b 40 04 mov 0x4(%eax),%eax
4265: 01 c2 add %eax,%edx
4267: 8b 45 fc mov -0x4(%ebp),%eax
426a: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
426d: 8b 45 f8 mov -0x8(%ebp),%eax
4270: 8b 10 mov (%eax),%edx
4272: 8b 45 fc mov -0x4(%ebp),%eax
4275: 89 10 mov %edx,(%eax)
4277: eb 08 jmp 4281 <free+0xd7>
} else
p->s.ptr = bp;
4279: 8b 45 fc mov -0x4(%ebp),%eax
427c: 8b 55 f8 mov -0x8(%ebp),%edx
427f: 89 10 mov %edx,(%eax)
freep = p;
4281: 8b 45 fc mov -0x4(%ebp),%eax
4284: a3 48 63 00 00 mov %eax,0x6348
}
4289: 90 nop
428a: c9 leave
428b: c3 ret
0000428c <morecore>:
static Header*
morecore(uint nu)
{
428c: 55 push %ebp
428d: 89 e5 mov %esp,%ebp
428f: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
4292: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
4299: 77 07 ja 42a2 <morecore+0x16>
nu = 4096;
429b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
42a2: 8b 45 08 mov 0x8(%ebp),%eax
42a5: c1 e0 03 shl $0x3,%eax
42a8: 83 ec 0c sub $0xc,%esp
42ab: 50 push %eax
42ac: e8 79 fc ff ff call 3f2a <sbrk>
42b1: 83 c4 10 add $0x10,%esp
42b4: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
42b7: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
42bb: 75 07 jne 42c4 <morecore+0x38>
return 0;
42bd: b8 00 00 00 00 mov $0x0,%eax
42c2: eb 26 jmp 42ea <morecore+0x5e>
hp = (Header*)p;
42c4: 8b 45 f4 mov -0xc(%ebp),%eax
42c7: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
42ca: 8b 45 f0 mov -0x10(%ebp),%eax
42cd: 8b 55 08 mov 0x8(%ebp),%edx
42d0: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
42d3: 8b 45 f0 mov -0x10(%ebp),%eax
42d6: 83 c0 08 add $0x8,%eax
42d9: 83 ec 0c sub $0xc,%esp
42dc: 50 push %eax
42dd: e8 c8 fe ff ff call 41aa <free>
42e2: 83 c4 10 add $0x10,%esp
return freep;
42e5: a1 48 63 00 00 mov 0x6348,%eax
}
42ea: c9 leave
42eb: c3 ret
000042ec <malloc>:
void*
malloc(uint nbytes)
{
42ec: 55 push %ebp
42ed: 89 e5 mov %esp,%ebp
42ef: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
42f2: 8b 45 08 mov 0x8(%ebp),%eax
42f5: 83 c0 07 add $0x7,%eax
42f8: c1 e8 03 shr $0x3,%eax
42fb: 83 c0 01 add $0x1,%eax
42fe: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
4301: a1 48 63 00 00 mov 0x6348,%eax
4306: 89 45 f0 mov %eax,-0x10(%ebp)
4309: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
430d: 75 23 jne 4332 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
430f: c7 45 f0 40 63 00 00 movl $0x6340,-0x10(%ebp)
4316: 8b 45 f0 mov -0x10(%ebp),%eax
4319: a3 48 63 00 00 mov %eax,0x6348
431e: a1 48 63 00 00 mov 0x6348,%eax
4323: a3 40 63 00 00 mov %eax,0x6340
base.s.size = 0;
4328: c7 05 44 63 00 00 00 movl $0x0,0x6344
432f: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
4332: 8b 45 f0 mov -0x10(%ebp),%eax
4335: 8b 00 mov (%eax),%eax
4337: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
433a: 8b 45 f4 mov -0xc(%ebp),%eax
433d: 8b 40 04 mov 0x4(%eax),%eax
4340: 3b 45 ec cmp -0x14(%ebp),%eax
4343: 72 4d jb 4392 <malloc+0xa6>
if(p->s.size == nunits)
4345: 8b 45 f4 mov -0xc(%ebp),%eax
4348: 8b 40 04 mov 0x4(%eax),%eax
434b: 3b 45 ec cmp -0x14(%ebp),%eax
434e: 75 0c jne 435c <malloc+0x70>
prevp->s.ptr = p->s.ptr;
4350: 8b 45 f4 mov -0xc(%ebp),%eax
4353: 8b 10 mov (%eax),%edx
4355: 8b 45 f0 mov -0x10(%ebp),%eax
4358: 89 10 mov %edx,(%eax)
435a: eb 26 jmp 4382 <malloc+0x96>
else {
p->s.size -= nunits;
435c: 8b 45 f4 mov -0xc(%ebp),%eax
435f: 8b 40 04 mov 0x4(%eax),%eax
4362: 2b 45 ec sub -0x14(%ebp),%eax
4365: 89 c2 mov %eax,%edx
4367: 8b 45 f4 mov -0xc(%ebp),%eax
436a: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
436d: 8b 45 f4 mov -0xc(%ebp),%eax
4370: 8b 40 04 mov 0x4(%eax),%eax
4373: c1 e0 03 shl $0x3,%eax
4376: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
4379: 8b 45 f4 mov -0xc(%ebp),%eax
437c: 8b 55 ec mov -0x14(%ebp),%edx
437f: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
4382: 8b 45 f0 mov -0x10(%ebp),%eax
4385: a3 48 63 00 00 mov %eax,0x6348
return (void*)(p + 1);
438a: 8b 45 f4 mov -0xc(%ebp),%eax
438d: 83 c0 08 add $0x8,%eax
4390: eb 3b jmp 43cd <malloc+0xe1>
}
if(p == freep)
4392: a1 48 63 00 00 mov 0x6348,%eax
4397: 39 45 f4 cmp %eax,-0xc(%ebp)
439a: 75 1e jne 43ba <malloc+0xce>
if((p = morecore(nunits)) == 0)
439c: 83 ec 0c sub $0xc,%esp
439f: ff 75 ec pushl -0x14(%ebp)
43a2: e8 e5 fe ff ff call 428c <morecore>
43a7: 83 c4 10 add $0x10,%esp
43aa: 89 45 f4 mov %eax,-0xc(%ebp)
43ad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
43b1: 75 07 jne 43ba <malloc+0xce>
return 0;
43b3: b8 00 00 00 00 mov $0x0,%eax
43b8: eb 13 jmp 43cd <malloc+0xe1>
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){
43ba: 8b 45 f4 mov -0xc(%ebp),%eax
43bd: 89 45 f0 mov %eax,-0x10(%ebp)
43c0: 8b 45 f4 mov -0xc(%ebp),%eax
43c3: 8b 00 mov (%eax),%eax
43c5: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
43c8: e9 6d ff ff ff jmp 433a <malloc+0x4e>
}
43cd: c9 leave
43ce: c3 ret
| 39.506058
| 240
| 0.436262
|
1685668a9fbdba16a46575d61cf725cdd83c20c0
| 247
|
asm
|
Assembly
|
base/common/recmove.asm
|
zbyti/Mad-Pascal
|
546cae9724828f93047080109488be7d0d07d47e
|
[
"MIT"
] | null | null | null |
base/common/recmove.asm
|
zbyti/Mad-Pascal
|
546cae9724828f93047080109488be7d0d07d47e
|
[
"MIT"
] | null | null | null |
base/common/recmove.asm
|
zbyti/Mad-Pascal
|
546cae9724828f93047080109488be7d0d07d47e
|
[
"MIT"
] | null | null | null |
; Record move
/*
@moveRECORD
*/
.proc @moveRECORD (.word ya) .reg
sta :bp2
sty :bp2+1
ldy #1
lop lda @buf-1,y
cmp #eol
beq exit
sta (:bp2),y
iny
bne lop
exit dey
tya
ldy #0
sta (:bp2),y
rts
.endp
| 8.233333
| 34
| 0.518219
|
760a5aa4f7c458b3dc01057cf32275f3668a1ac6
| 149
|
asm
|
Assembly
|
src/stars/tests/tests/pseudoOps/not_test.asm
|
kevintmcdonnell/stars
|
ce0df570c546a8490ef4f9ceeb84c8e1132b2791
|
[
"MIT"
] | 9
|
2020-11-05T21:26:09.000Z
|
2022-03-04T15:24:40.000Z
|
src/stars/tests/tests/pseudoOps/not_test.asm
|
kevintmcdonnell/stars
|
ce0df570c546a8490ef4f9ceeb84c8e1132b2791
|
[
"MIT"
] | 7
|
2020-11-06T15:59:40.000Z
|
2021-08-31T16:36:43.000Z
|
src/stars/tests/tests/pseudoOps/not_test.asm
|
kevintmcdonnell/stars
|
ce0df570c546a8490ef4f9ceeb84c8e1132b2791
|
[
"MIT"
] | 1
|
2021-07-13T21:55:02.000Z
|
2021-07-13T21:55:02.000Z
|
.text
main:
li $t0, 0x0f0f0f0f
not $a0, $t0
li $v0, 34
syscall
li $a0, ' '
li $v0, 11
syscall
li $t0, 0xf0f0f0f0
not $a0, $t0
li $v0, 34
syscall
| 8.277778
| 18
| 0.624161
|
c2a1b57e802cea9d4e11284e82ca8175205aa816
| 354
|
asm
|
Assembly
|
kernel/src/interrupts/syscall.asm
|
Tangent-Project/Tangent-OS
|
102c1a32b2ab7e676c6721f0aa831c0d7dd942be
|
[
"MIT"
] | 6
|
2022-01-06T11:12:35.000Z
|
2022-01-12T17:43:40.000Z
|
kernel/src/interrupts/syscall.asm
|
Tangent-Project/Tangent-OS
|
102c1a32b2ab7e676c6721f0aa831c0d7dd942be
|
[
"MIT"
] | null | null | null |
kernel/src/interrupts/syscall.asm
|
Tangent-Project/Tangent-OS
|
102c1a32b2ab7e676c6721f0aa831c0d7dd942be
|
[
"MIT"
] | null | null | null |
extern syscall_handler
global syscall_gate
%macro pushall 0
push eax
push ecx
push ebx
push edx
push edi
push esi
push ebp
%endmacro
%macro popall 0
pop ebp
pop esi
pop edi
pop edx
pop ebx
pop ecx
pop eax
%endmacro
syscall_gate:
cli
pushall
push esp
call syscall_handler
pop esp
popall
sti
iret
| 10.727273
| 23
| 0.672316
|
227d32af9b8fcc7d70a01545ef9c2d6c294ecf9b
| 737
|
asm
|
Assembly
|
mc-sema/validator/x86/tests/PADDQrm.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | 2
|
2021-08-07T16:21:29.000Z
|
2021-11-17T10:58:37.000Z
|
mc-sema/validator/x86/tests/PADDQrm.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
mc-sema/validator/x86/tests/PADDQrm.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_OF|FLAG_SF|FLAG_ZF|FLAG_AF|FLAG_PF|FLAG_CF
;TEST_FILE_META_END
; allocate 16 byte aligned stack space for the packed values
lea ecx, [esp-17]
and ecx, 0xfffffff0
; load 128 bit value into xmm0
mov DWORD [ecx], 0x12345678
mov DWORD [ecx+4], 0x55555555
mov DWORD [ecx+8], 0xdeadbeef
mov DWORD [ecx+12], 0x1f311c47
movaps xmm0, [ecx]
lea ecx, [ecx+16]
;TEST_BEGIN_RECORDING
lea ecx, [esp-17]
and ecx, 0xfffffff0 ; using this requires us to ignore ALU flags
mov DWORD [ecx], 0xabcdef12
mov DWORD [ecx+4], 0xaaaaaaaa
mov DWORD [ecx+8], 0xdeadbeef
mov DWORD [ecx+12], 0xfeeb1e01
paddq xmm0, [ecx]
mov ecx, [ecx]
mov ecx, 0
;TEST_END_RECORDING
cvtsi2sd xmm0, ecx
| 21.676471
| 65
| 0.75848
|
6994d07b373c21002c0aaa577e2f4a494b983beb
| 655
|
asm
|
Assembly
|
programs/oeis/026/A026915.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/026/A026915.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/026/A026915.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A026915: a(n) = T(n,0) + T(n,1) + ... + T(n,n), T given by A026907.
; 1,26,100,272,640,1400,2944,6056,12304,24824,49888,100040,200368,401048,802432,1605224,3210832,6422072,12844576,25689608,51379696,102759896,205520320,411041192,822082960,1644166520,3288333664,6576667976,13153336624,26306673944,52613348608,105226697960,210453396688,420906794168,841813589152,1683627179144,3367254359152,6734508719192,13469017439296,26938034879528,53876069760016,107752139521016,215504279043040,431008558087112,862017116175280,1724034232351640,3448068464704384,6896136929409896
lpb $0,1
sub $0,1
add $2,6
add $1,$2
add $1,$2
mul $1,2
add $1,1
lpe
add $1,1
| 50.384615
| 493
| 0.793893
|
e82b796d13c8d9cf68b4e3b388577fdef01de5e6
| 1,654
|
asm
|
Assembly
|
Appl/Art/Decks/GeoDeck/CGADiamond5.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Art/Decks/GeoDeck/CGADiamond5.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Art/Decks/GeoDeck/CGADiamond5.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
CGADiamond5 label byte
word C_BLACK
Bitmap <67,41,BMC_PACKBITS,BMF_MONO>
db 0xf8, 0x00
db 0xf8, 0x00
db 0x08, 0x1f, 0xf0, 0x1c, 0x00, 0x00, 0x07, 0x00,
0x1c, 0x00
db 0x08, 0x18, 0x00, 0x6b, 0x00, 0x00, 0x1a, 0xc0,
0x6b, 0x00
db 0x08, 0x1f, 0xe0, 0xd5, 0x80, 0x00, 0x35, 0x60,
0xd5, 0x80
db 0x08, 0x00, 0x31, 0xaa, 0xc0, 0x00, 0x6a, 0xb0,
0x6b, 0x00
db 0x08, 0x00, 0x30, 0xd5, 0x80, 0x00, 0x35, 0x60,
0x1c, 0x00
db 0x08, 0x18, 0x30, 0x6b, 0x00, 0x00, 0x1a, 0xc0,
0x00, 0x00
db 0x05, 0x0f, 0xe0, 0x1c, 0x00, 0x00, 0x07, 0xfe,
0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xfd, 0x00, 0x00, 0xe0, 0xfd, 0x00
db 0xfe, 0x00, 0x01, 0x03, 0x58, 0xfd, 0x00
db 0xfe, 0x00, 0x01, 0x06, 0xac, 0xfd, 0x00
db 0xfe, 0x00, 0x01, 0x0d, 0x56, 0xfd, 0x00
db 0xfe, 0x00, 0x01, 0x06, 0xac, 0xfd, 0x00
db 0xfe, 0x00, 0x01, 0x03, 0x58, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0xe0, 0xfd, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x07, 0x00,
0xfe, 0x00
db 0x08, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x1a, 0xc1,
0x83, 0x00
db 0x08, 0x07, 0x00, 0xd5, 0x80, 0x00, 0x35, 0x61,
0x80, 0x00
db 0x08, 0x1a, 0xc1, 0xaa, 0xc0, 0x00, 0x6a, 0xb1,
0x80, 0x00
db 0x08, 0x35, 0x60, 0xd5, 0x80, 0x00, 0x35, 0x60,
0xff, 0x00
db 0x08, 0x1a, 0xc0, 0x6b, 0x00, 0x00, 0x1a, 0xc0,
0x03, 0x00
db 0x08, 0x07, 0x00, 0x1c, 0x00, 0x00, 0x07, 0x01,
0xff, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
| 28.033898
| 53
| 0.633011
|
d04396e3c24ab281a315b246aa30f0ae8c28d84b
| 76,177
|
asm
|
Assembly
|
sw/example/hex_viewer/main.asm
|
matejpolj/neorv32
|
369415dac1111cb9b1faba732476d759dc7405c1
|
[
"BSD-3-Clause"
] | null | null | null |
sw/example/hex_viewer/main.asm
|
matejpolj/neorv32
|
369415dac1111cb9b1faba732476d759dc7405c1
|
[
"BSD-3-Clause"
] | null | null | null |
sw/example/hex_viewer/main.asm
|
matejpolj/neorv32
|
369415dac1111cb9b1faba732476d759dc7405c1
|
[
"BSD-3-Clause"
] | null | null | null |
main.elf: file format elf32-littleriscv
Disassembly of section .text:
00000000 <_start>:
0: 00000037 lui zero,0x0
00000004 <__crt0_pointer_init>:
4: 80002117 auipc sp,0x80002
8: ff810113 addi sp,sp,-8 # 80001ffc <__ctr0_io_space_begin+0x800021fc>
c: 80000197 auipc gp,0x80000
10: 7f418193 addi gp,gp,2036 # 80000800 <__ctr0_io_space_begin+0x80000a00>
00000014 <__crt0_cpu_csr_init>:
14: 00000517 auipc a0,0x0
18: 12050513 addi a0,a0,288 # 134 <__crt0_dummy_trap_handler>
1c: 30551073 csrw mtvec,a0
20: 34151073 csrw mepc,a0
24: 30001073 csrw mstatus,zero
28: 30401073 csrw mie,zero
2c: 30601073 csrw mcounteren,zero
30: ffa00593 li a1,-6
34: 32059073 csrw mcountinhibit,a1
38: b0001073 csrw mcycle,zero
3c: b8001073 csrw mcycleh,zero
40: b0201073 csrw minstret,zero
44: b8201073 csrw minstreth,zero
00000048 <__crt0_reg_file_clear>:
48: 00000093 li ra,0
4c: 00000213 li tp,0
50: 00000293 li t0,0
54: 00000313 li t1,0
58: 00000393 li t2,0
5c: 00000713 li a4,0
60: 00000793 li a5,0
64: 00000813 li a6,0
68: 00000893 li a7,0
6c: 00000913 li s2,0
70: 00000993 li s3,0
74: 00000a13 li s4,0
78: 00000a93 li s5,0
7c: 00000b13 li s6,0
80: 00000b93 li s7,0
84: 00000c13 li s8,0
88: 00000c93 li s9,0
8c: 00000d13 li s10,0
90: 00000d93 li s11,0
94: 00000e13 li t3,0
98: 00000e93 li t4,0
9c: 00000f13 li t5,0
a0: 00000f93 li t6,0
000000a4 <__crt0_reset_io>:
a4: 00000417 auipc s0,0x0
a8: d5c40413 addi s0,s0,-676 # fffffe00 <__ctr0_io_space_begin+0x0>
ac: 00000497 auipc s1,0x0
b0: f5448493 addi s1,s1,-172 # 0 <_start>
000000b4 <__crt0_reset_io_loop>:
b4: 00042023 sw zero,0(s0)
b8: 00440413 addi s0,s0,4
bc: fe941ce3 bne s0,s1,b4 <__crt0_reset_io_loop>
000000c0 <__crt0_clear_bss>:
c0: 80000597 auipc a1,0x80000
c4: f4058593 addi a1,a1,-192 # 80000000 <__ctr0_io_space_begin+0x80000200>
c8: 87818613 addi a2,gp,-1928 # 80000078 <__BSS_END__>
000000cc <__crt0_clear_bss_loop>:
cc: 00c5d863 bge a1,a2,dc <__crt0_clear_bss_loop_end>
d0: 00058023 sb zero,0(a1)
d4: 00158593 addi a1,a1,1
d8: ff5ff06f j cc <__crt0_clear_bss_loop>
000000dc <__crt0_clear_bss_loop_end>:
dc: 00002597 auipc a1,0x2
e0: ec458593 addi a1,a1,-316 # 1fa0 <__crt0_copy_data_src_begin>
e4: 80000617 auipc a2,0x80000
e8: f1c60613 addi a2,a2,-228 # 80000000 <__ctr0_io_space_begin+0x80000200>
ec: 80000697 auipc a3,0x80000
f0: f1468693 addi a3,a3,-236 # 80000000 <__ctr0_io_space_begin+0x80000200>
000000f4 <__crt0_copy_data_loop>:
f4: 00d65c63 bge a2,a3,10c <__crt0_copy_data_loop_end>
f8: 00058703 lb a4,0(a1)
fc: 00e60023 sb a4,0(a2)
100: 00158593 addi a1,a1,1
104: 00160613 addi a2,a2,1
108: fedff06f j f4 <__crt0_copy_data_loop>
0000010c <__crt0_copy_data_loop_end>:
10c: 00000513 li a0,0
110: 00000593 li a1,0
114: 06c000ef jal ra,180 <main>
00000118 <__crt0_main_aftermath>:
118: 34051073 csrw mscratch,a0
11c: 00000093 li ra,0
120: 00008463 beqz ra,128 <__crt0_main_aftermath_end>
124: 000080e7 jalr ra
00000128 <__crt0_main_aftermath_end>:
128: 30047073 csrci mstatus,8
0000012c <__crt0_main_aftermath_end_loop>:
12c: 10500073 wfi
130: ffdff06f j 12c <__crt0_main_aftermath_end_loop>
00000134 <__crt0_dummy_trap_handler>:
134: ff810113 addi sp,sp,-8
138: 00812023 sw s0,0(sp)
13c: 00912223 sw s1,4(sp)
140: 34202473 csrr s0,mcause
144: 02044663 bltz s0,170 <__crt0_dummy_trap_handler_irq>
148: 34102473 csrr s0,mepc
0000014c <__crt0_dummy_trap_handler_exc_c_check>:
14c: 00041483 lh s1,0(s0)
150: 0034f493 andi s1,s1,3
154: 00240413 addi s0,s0,2
158: 34141073 csrw mepc,s0
15c: 00300413 li s0,3
160: 00941863 bne s0,s1,170 <__crt0_dummy_trap_handler_irq>
00000164 <__crt0_dummy_trap_handler_exc_uncrompressed>:
164: 34102473 csrr s0,mepc
168: 00240413 addi s0,s0,2
16c: 34141073 csrw mepc,s0
00000170 <__crt0_dummy_trap_handler_irq>:
170: 00012403 lw s0,0(sp)
174: 00412483 lw s1,4(sp)
178: 00810113 addi sp,sp,8
17c: 30200073 mret
00000180 <main>:
180: fc010113 addi sp,sp,-64
184: 800007b7 lui a5,0x80000
188: 02112e23 sw ra,60(sp)
18c: 02812c23 sw s0,56(sp)
190: 02912a23 sw s1,52(sp)
194: 03212823 sw s2,48(sp)
198: 03312623 sw s3,44(sp)
19c: 03412423 sw s4,40(sp)
1a0: 03512223 sw s5,36(sp)
1a4: 03612023 sw s6,32(sp)
1a8: 01712e23 sw s7,28(sp)
1ac: 01812c23 sw s8,24(sp)
1b0: 00078023 sb zero,0(a5) # 80000000 <__ctr0_io_space_begin+0x80000200>
1b4: 219000ef jal ra,bcc <neorv32_uart0_available>
1b8: 12050a63 beqz a0,2ec <main+0x16c>
1bc: 27c010ef jal ra,1438 <neorv32_rte_setup>
1c0: 30047073 csrci mstatus,8
1c4: 00000013 nop
1c8: 00000013 nop
1cc: 00005537 lui a0,0x5
1d0: 00000613 li a2,0
1d4: 00000593 li a1,0
1d8: b0050513 addi a0,a0,-1280 # 4b00 <__crt0_copy_data_src_begin+0x2b60>
1dc: 201000ef jal ra,bdc <neorv32_uart0_setup>
1e0: 00000513 li a0,0
1e4: 2a0010ef jal ra,1484 <neorv32_rte_check_isa>
1e8: 00002537 lui a0,0x2
1ec: a1850513 addi a0,a0,-1512 # 1a18 <__etext+0x278>
1f0: 331000ef jal ra,d20 <neorv32_uart0_printf>
1f4: 00002537 lui a0,0x2
1f8: a3050513 addi a0,a0,-1488 # 1a30 <__etext+0x290>
1fc: 325000ef jal ra,d20 <neorv32_uart0_printf>
200: 000024b7 lui s1,0x2
204: 00002937 lui s2,0x2
208: 000029b7 lui s3,0x2
20c: 00002a37 lui s4,0x2
210: 00002ab7 lui s5,0x2
214: 00002b37 lui s6,0x2
218: 00002bb7 lui s7,0x2
21c: 00002c37 lui s8,0x2
220: a9848513 addi a0,s1,-1384 # 1a98 <__etext+0x2f8>
224: 2fd000ef jal ra,d20 <neorv32_uart0_printf>
228: 00100613 li a2,1
22c: 00800593 li a1,8
230: 00810513 addi a0,sp,8
234: 485000ef jal ra,eb8 <neorv32_uart0_scan>
238: 00050413 mv s0,a0
23c: a2c90513 addi a0,s2,-1492 # 1a2c <__etext+0x28c>
240: 2e1000ef jal ra,d20 <neorv32_uart0_printf>
244: fc040ee3 beqz s0,220 <main+0xa0>
248: aa898593 addi a1,s3,-1368 # 1aa8 <__etext+0x308>
24c: 00810513 addi a0,sp,8
250: 348010ef jal ra,1598 <strcmp>
254: 00051a63 bnez a0,268 <main+0xe8>
258: 00002537 lui a0,0x2
25c: ab050513 addi a0,a0,-1360 # 1ab0 <__etext+0x310>
260: 2c1000ef jal ra,d20 <neorv32_uart0_printf>
264: fbdff06f j 220 <main+0xa0>
268: be0a0593 addi a1,s4,-1056 # 1be0 <__etext+0x440>
26c: 00810513 addi a0,sp,8
270: 328010ef jal ra,1598 <strcmp>
274: 00051663 bnez a0,280 <main+0x100>
278: 0a8000ef jal ra,320 <setup_access>
27c: fa5ff06f j 220 <main+0xa0>
280: be8a8593 addi a1,s5,-1048 # 1be8 <__etext+0x448>
284: 00810513 addi a0,sp,8
288: 310010ef jal ra,1598 <strcmp>
28c: 00051663 bnez a0,298 <main+0x118>
290: 444000ef jal ra,6d4 <read_memory>
294: f8dff06f j 220 <main+0xa0>
298: bf0b0593 addi a1,s6,-1040 # 1bf0 <__etext+0x450>
29c: 00810513 addi a0,sp,8
2a0: 2f8010ef jal ra,1598 <strcmp>
2a4: 00051663 bnez a0,2b0 <main+0x130>
2a8: 33c000ef jal ra,5e4 <atomic_cas>
2ac: f75ff06f j 220 <main+0xa0>
2b0: bf8b8593 addi a1,s7,-1032 # 1bf8 <__etext+0x458>
2b4: 00810513 addi a0,sp,8
2b8: 2e0010ef jal ra,1598 <strcmp>
2bc: 00051663 bnez a0,2c8 <main+0x148>
2c0: 180000ef jal ra,440 <write_memory>
2c4: f5dff06f j 220 <main+0xa0>
2c8: c00c0593 addi a1,s8,-1024 # 1c00 <__etext+0x460>
2cc: 00810513 addi a0,sp,8
2d0: 2c8010ef jal ra,1598 <strcmp>
2d4: 00051663 bnez a0,2e0 <main+0x160>
2d8: 58c000ef jal ra,864 <dump_memory>
2dc: f45ff06f j 220 <main+0xa0>
2e0: 00002537 lui a0,0x2
2e4: c0850513 addi a0,a0,-1016 # 1c08 <__etext+0x468>
2e8: f79ff06f j 260 <main+0xe0>
2ec: 03c12083 lw ra,60(sp)
2f0: 03812403 lw s0,56(sp)
2f4: 03412483 lw s1,52(sp)
2f8: 03012903 lw s2,48(sp)
2fc: 02c12983 lw s3,44(sp)
300: 02812a03 lw s4,40(sp)
304: 02412a83 lw s5,36(sp)
308: 02012b03 lw s6,32(sp)
30c: 01c12b83 lw s7,28(sp)
310: 01812c03 lw s8,24(sp)
314: 00100513 li a0,1
318: 04010113 addi sp,sp,64
31c: 00008067 ret
00000320 <setup_access>:
320: 00001537 lui a0,0x1
324: fe010113 addi sp,sp,-32
328: 7a050513 addi a0,a0,1952 # 17a0 <__etext>
32c: 00912a23 sw s1,20(sp)
330: 01212823 sw s2,16(sp)
334: 01312623 sw s3,12(sp)
338: 01412423 sw s4,8(sp)
33c: 01512223 sw s5,4(sp)
340: 01612023 sw s6,0(sp)
344: 00112e23 sw ra,28(sp)
348: 00812c23 sw s0,24(sp)
34c: 00002937 lui s2,0x2
350: 1d1000ef jal ra,d20 <neorv32_uart0_printf>
354: 06200993 li s3,98
358: 06800a13 li s4,104
35c: 07700a93 li s5,119
360: 07800b13 li s6,120
364: 000024b7 lui s1,0x2
368: 82890513 addi a0,s2,-2008 # 1828 <__etext+0x88>
36c: 1b5000ef jal ra,d20 <neorv32_uart0_printf>
370: 131000ef jal ra,ca0 <neorv32_uart0_getc>
374: 00050413 mv s0,a0
378: 111000ef jal ra,c88 <neorv32_uart0_putc>
37c: 01340663 beq s0,s3,388 <setup_access+0x68>
380: 01440463 beq s0,s4,388 <setup_access+0x68>
384: 03541e63 bne s0,s5,3c0 <setup_access+0xa0>
388: 800007b7 lui a5,0x80000
38c: 00878023 sb s0,0(a5) # 80000000 <__ctr0_io_space_begin+0x80000200>
390: 01812403 lw s0,24(sp)
394: 01c12083 lw ra,28(sp)
398: 01412483 lw s1,20(sp)
39c: 01012903 lw s2,16(sp)
3a0: 00c12983 lw s3,12(sp)
3a4: 00812a03 lw s4,8(sp)
3a8: 00412a83 lw s5,4(sp)
3ac: 00012b03 lw s6,0(sp)
3b0: 00002537 lui a0,0x2
3b4: a2c50513 addi a0,a0,-1492 # 1a2c <__etext+0x28c>
3b8: 02010113 addi sp,sp,32
3bc: 1650006f j d20 <neorv32_uart0_printf>
3c0: fd6408e3 beq s0,s6,390 <setup_access+0x70>
3c4: 83448513 addi a0,s1,-1996 # 1834 <__etext+0x94>
3c8: 159000ef jal ra,d20 <neorv32_uart0_printf>
3cc: f9dff06f j 368 <setup_access+0x48>
000003d0 <hexstr_to_uint>:
3d0: 00050713 mv a4,a0
3d4: 0ff00893 li a7,255
3d8: 00000513 li a0,0
3dc: 00900313 li t1,9
3e0: 00500813 li a6,5
3e4: fff58593 addi a1,a1,-1
3e8: 0ff5f593 andi a1,a1,255
3ec: 01159463 bne a1,a7,3f4 <hexstr_to_uint+0x24>
3f0: 00008067 ret
3f4: 00074683 lbu a3,0(a4)
3f8: fd068793 addi a5,a3,-48
3fc: 0ff7f613 andi a2,a5,255
400: 00c37a63 bgeu t1,a2,414 <hexstr_to_uint+0x44>
404: f9f68793 addi a5,a3,-97
408: 0ff7f793 andi a5,a5,255
40c: 00f86e63 bltu a6,a5,428 <hexstr_to_uint+0x58>
410: fa968793 addi a5,a3,-87
414: 00259693 slli a3,a1,0x2
418: 00d797b3 sll a5,a5,a3
41c: 00f50533 add a0,a0,a5
420: 00170713 addi a4,a4,1
424: fc1ff06f j 3e4 <hexstr_to_uint+0x14>
428: fbf68613 addi a2,a3,-65
42c: 0ff67613 andi a2,a2,255
430: 00000793 li a5,0
434: fec860e3 bltu a6,a2,414 <hexstr_to_uint+0x44>
438: fc968793 addi a5,a3,-55
43c: fd9ff06f j 414 <hexstr_to_uint+0x44>
00000440 <write_memory>:
440: fd010113 addi sp,sp,-48
444: 02812423 sw s0,40(sp)
448: 80000437 lui s0,0x80000
44c: 00044783 lbu a5,0(s0) # 80000000 <__ctr0_io_space_begin+0x80000200>
450: 02112623 sw ra,44(sp)
454: 02912223 sw s1,36(sp)
458: 03212023 sw s2,32(sp)
45c: 01312e23 sw s3,28(sp)
460: 02079463 bnez a5,488 <write_memory+0x48>
464: 02812403 lw s0,40(sp)
468: 02c12083 lw ra,44(sp)
46c: 02412483 lw s1,36(sp)
470: 02012903 lw s2,32(sp)
474: 01c12983 lw s3,28(sp)
478: 00002537 lui a0,0x2
47c: 84850513 addi a0,a0,-1976 # 1848 <__etext+0xa8>
480: 03010113 addi sp,sp,48
484: 09d0006f j d20 <neorv32_uart0_printf>
488: 00002537 lui a0,0x2
48c: 87450513 addi a0,a0,-1932 # 1874 <__etext+0xd4>
490: 091000ef jal ra,d20 <neorv32_uart0_printf>
494: 00100613 li a2,1
498: 00900593 li a1,9
49c: 00010513 mv a0,sp
4a0: 219000ef jal ra,eb8 <neorv32_uart0_scan>
4a4: 00010513 mv a0,sp
4a8: 26c010ef jal ra,1714 <strlen>
4ac: 0ff57593 andi a1,a0,255
4b0: 00010513 mv a0,sp
4b4: f1dff0ef jal ra,3d0 <hexstr_to_uint>
4b8: 00040413 mv s0,s0
4bc: 00044703 lbu a4,0(s0)
4c0: 06200793 li a5,98
4c4: 00050913 mv s2,a0
4c8: 00000993 li s3,0
4cc: 02f71c63 bne a4,a5,504 <write_memory+0xc4>
4d0: 00002537 lui a0,0x2
4d4: 89450513 addi a0,a0,-1900 # 1894 <__etext+0xf4>
4d8: 049000ef jal ra,d20 <neorv32_uart0_printf>
4dc: 00100613 li a2,1
4e0: 00300593 li a1,3
4e4: 00010513 mv a0,sp
4e8: 1d1000ef jal ra,eb8 <neorv32_uart0_scan>
4ec: 00010513 mv a0,sp
4f0: 224010ef jal ra,1714 <strlen>
4f4: 0ff57593 andi a1,a0,255
4f8: 00010513 mv a0,sp
4fc: ed5ff0ef jal ra,3d0 <hexstr_to_uint>
500: 0ff57993 andi s3,a0,255
504: 00044703 lbu a4,0(s0)
508: 06800793 li a5,104
50c: 00000493 li s1,0
510: 02f71e63 bne a4,a5,54c <write_memory+0x10c>
514: 00002537 lui a0,0x2
518: 8b450513 addi a0,a0,-1868 # 18b4 <__etext+0x114>
51c: 005000ef jal ra,d20 <neorv32_uart0_printf>
520: 00100613 li a2,1
524: 00500593 li a1,5
528: 00010513 mv a0,sp
52c: 18d000ef jal ra,eb8 <neorv32_uart0_scan>
530: 00010513 mv a0,sp
534: 1e0010ef jal ra,1714 <strlen>
538: 0ff57593 andi a1,a0,255
53c: 00010513 mv a0,sp
540: e91ff0ef jal ra,3d0 <hexstr_to_uint>
544: 01051493 slli s1,a0,0x10
548: 0104d493 srli s1,s1,0x10
54c: 00044703 lbu a4,0(s0)
550: 07700793 li a5,119
554: 00000513 li a0,0
558: 02f71a63 bne a4,a5,58c <write_memory+0x14c>
55c: 00002537 lui a0,0x2
560: 8d450513 addi a0,a0,-1836 # 18d4 <__etext+0x134>
564: 7bc000ef jal ra,d20 <neorv32_uart0_printf>
568: 00900593 li a1,9
56c: 00100613 li a2,1
570: 00010513 mv a0,sp
574: 145000ef jal ra,eb8 <neorv32_uart0_scan>
578: 00010513 mv a0,sp
57c: 198010ef jal ra,1714 <strlen>
580: 0ff57593 andi a1,a0,255
584: 00010513 mv a0,sp
588: e49ff0ef jal ra,3d0 <hexstr_to_uint>
58c: 00044783 lbu a5,0(s0)
590: 06200713 li a4,98
594: 02e79863 bne a5,a4,5c4 <write_memory+0x184>
598: 01390023 sb s3,0(s2)
59c: 00002537 lui a0,0x2
5a0: a2c50513 addi a0,a0,-1492 # 1a2c <__etext+0x28c>
5a4: 77c000ef jal ra,d20 <neorv32_uart0_printf>
5a8: 02c12083 lw ra,44(sp)
5ac: 02812403 lw s0,40(sp)
5b0: 02412483 lw s1,36(sp)
5b4: 02012903 lw s2,32(sp)
5b8: 01c12983 lw s3,28(sp)
5bc: 03010113 addi sp,sp,48
5c0: 00008067 ret
5c4: 06800713 li a4,104
5c8: 00e79663 bne a5,a4,5d4 <write_memory+0x194>
5cc: 00991023 sh s1,0(s2)
5d0: fcdff06f j 59c <write_memory+0x15c>
5d4: 07700713 li a4,119
5d8: fce792e3 bne a5,a4,59c <write_memory+0x15c>
5dc: 00a92023 sw a0,0(s2)
5e0: fbdff06f j 59c <write_memory+0x15c>
000005e4 <atomic_cas>:
5e4: 301027f3 csrr a5,misa
5e8: 0017f793 andi a5,a5,1
5ec: 08078863 beqz a5,67c <atomic_cas+0x98>
5f0: 00002537 lui a0,0x2
5f4: fe010113 addi sp,sp,-32
5f8: 8f450513 addi a0,a0,-1804 # 18f4 <__etext+0x154>
5fc: 00112e23 sw ra,28(sp)
600: 00812c23 sw s0,24(sp)
604: 71c000ef jal ra,d20 <neorv32_uart0_printf>
608: 00100613 li a2,1
60c: 00900593 li a1,9
610: 00010513 mv a0,sp
614: 0a5000ef jal ra,eb8 <neorv32_uart0_scan>
618: 00010513 mv a0,sp
61c: 0f8010ef jal ra,1714 <strlen>
620: 0ff57593 andi a1,a0,255
624: 00010513 mv a0,sp
628: da9ff0ef jal ra,3d0 <hexstr_to_uint>
62c: 00050593 mv a1,a0
630: 00050413 mv s0,a0
634: 00002537 lui a0,0x2
638: 91c50513 addi a0,a0,-1764 # 191c <__etext+0x17c>
63c: 6e4000ef jal ra,d20 <neorv32_uart0_printf>
640: 00100613 li a2,1
644: 00900593 li a1,9
648: 00010513 mv a0,sp
64c: 06d000ef jal ra,eb8 <neorv32_uart0_scan>
650: 00042583 lw a1,0(s0)
654: 00002537 lui a0,0x2
658: 94850513 addi a0,a0,-1720 # 1948 <__etext+0x1a8>
65c: 6c4000ef jal ra,d20 <neorv32_uart0_printf>
660: 00002537 lui a0,0x2
664: 95c50513 addi a0,a0,-1700 # 195c <__etext+0x1bc>
668: 6b8000ef jal ra,d20 <neorv32_uart0_printf>
66c: 01c12083 lw ra,28(sp)
670: 01812403 lw s0,24(sp)
674: 02010113 addi sp,sp,32
678: 00008067 ret
67c: 00002537 lui a0,0x2
680: 97450513 addi a0,a0,-1676 # 1974 <__etext+0x1d4>
684: 69c0006f j d20 <neorv32_uart0_printf>
00000688 <aux_print_hex_byte>:
688: ff010113 addi sp,sp,-16
68c: 00812423 sw s0,8(sp)
690: 00002437 lui s0,0x2
694: c3c40413 addi s0,s0,-964 # 1c3c <symbols.0>
698: 00455793 srli a5,a0,0x4
69c: 00f407b3 add a5,s0,a5
6a0: 00912223 sw s1,4(sp)
6a4: 00050493 mv s1,a0
6a8: 0007c503 lbu a0,0(a5)
6ac: 00f4f493 andi s1,s1,15
6b0: 00112623 sw ra,12(sp)
6b4: 00940433 add s0,s0,s1
6b8: 5d0000ef jal ra,c88 <neorv32_uart0_putc>
6bc: 00044503 lbu a0,0(s0)
6c0: 00812403 lw s0,8(sp)
6c4: 00c12083 lw ra,12(sp)
6c8: 00412483 lw s1,4(sp)
6cc: 01010113 addi sp,sp,16
6d0: 5b80006f j c88 <neorv32_uart0_putc>
000006d4 <read_memory>:
6d4: fd010113 addi sp,sp,-48
6d8: 03212023 sw s2,32(sp)
6dc: 80000937 lui s2,0x80000
6e0: 00094783 lbu a5,0(s2) # 80000000 <__ctr0_io_space_begin+0x80000200>
6e4: 02112623 sw ra,44(sp)
6e8: 02812423 sw s0,40(sp)
6ec: 02912223 sw s1,36(sp)
6f0: 01312e23 sw s3,28(sp)
6f4: 02079463 bnez a5,71c <read_memory+0x48>
6f8: 02812403 lw s0,40(sp)
6fc: 02c12083 lw ra,44(sp)
700: 02412483 lw s1,36(sp)
704: 02012903 lw s2,32(sp)
708: 01c12983 lw s3,28(sp)
70c: 00002537 lui a0,0x2
710: 84850513 addi a0,a0,-1976 # 1848 <__etext+0xa8>
714: 03010113 addi sp,sp,48
718: 6080006f j d20 <neorv32_uart0_printf>
71c: 00002537 lui a0,0x2
720: 87450513 addi a0,a0,-1932 # 1874 <__etext+0xd4>
724: 5fc000ef jal ra,d20 <neorv32_uart0_printf>
728: 00100613 li a2,1
72c: 00900593 li a1,9
730: 00010513 mv a0,sp
734: 784000ef jal ra,eb8 <neorv32_uart0_scan>
738: 00010513 mv a0,sp
73c: 7d9000ef jal ra,1714 <strlen>
740: 0ff57593 andi a1,a0,255
744: 00010513 mv a0,sp
748: c89ff0ef jal ra,3d0 <hexstr_to_uint>
74c: 00050593 mv a1,a0
750: 00050413 mv s0,a0
754: 00002537 lui a0,0x2
758: 9a050513 addi a0,a0,-1632 # 19a0 <__etext+0x200>
75c: 5c4000ef jal ra,d20 <neorv32_uart0_printf>
760: 00090913 mv s2,s2
764: 00000793 li a5,0
768: 34279073 csrw mcause,a5
76c: 00094783 lbu a5,0(s2)
770: 06200713 li a4,98
774: 0ae79a63 bne a5,a4,828 <read_memory+0x154>
778: 00044403 lbu s0,0(s0)
77c: 0ff47993 andi s3,s0,255
780: 00000413 li s0,0
784: 00000493 li s1,0
788: 342027f3 csrr a5,mcause
78c: 06079a63 bnez a5,800 <read_memory+0x12c>
790: 00002537 lui a0,0x2
794: 91850513 addi a0,a0,-1768 # 1918 <__etext+0x178>
798: 588000ef jal ra,d20 <neorv32_uart0_printf>
79c: 00094703 lbu a4,0(s2)
7a0: 06200793 li a5,98
7a4: 00f71663 bne a4,a5,7b0 <read_memory+0xdc>
7a8: 00098513 mv a0,s3
7ac: eddff0ef jal ra,688 <aux_print_hex_byte>
7b0: 00094703 lbu a4,0(s2)
7b4: 06800793 li a5,104
7b8: 00f71a63 bne a4,a5,7cc <read_memory+0xf8>
7bc: 00845513 srli a0,s0,0x8
7c0: ec9ff0ef jal ra,688 <aux_print_hex_byte>
7c4: 0ff47513 andi a0,s0,255
7c8: ec1ff0ef jal ra,688 <aux_print_hex_byte>
7cc: 00094703 lbu a4,0(s2)
7d0: 07700793 li a5,119
7d4: 02f71663 bne a4,a5,800 <read_memory+0x12c>
7d8: 0184d513 srli a0,s1,0x18
7dc: eadff0ef jal ra,688 <aux_print_hex_byte>
7e0: 0104d513 srli a0,s1,0x10
7e4: 0ff57513 andi a0,a0,255
7e8: ea1ff0ef jal ra,688 <aux_print_hex_byte>
7ec: 0084d513 srli a0,s1,0x8
7f0: 0ff57513 andi a0,a0,255
7f4: e95ff0ef jal ra,688 <aux_print_hex_byte>
7f8: 0ff4f513 andi a0,s1,255
7fc: e8dff0ef jal ra,688 <aux_print_hex_byte>
800: 00002537 lui a0,0x2
804: a2c50513 addi a0,a0,-1492 # 1a2c <__etext+0x28c>
808: 518000ef jal ra,d20 <neorv32_uart0_printf>
80c: 02c12083 lw ra,44(sp)
810: 02812403 lw s0,40(sp)
814: 02412483 lw s1,36(sp)
818: 02012903 lw s2,32(sp)
81c: 01c12983 lw s3,28(sp)
820: 03010113 addi sp,sp,48
824: 00008067 ret
828: 06800713 li a4,104
82c: 00e78c63 beq a5,a4,844 <read_memory+0x170>
830: 07700713 li a4,119
834: 02e78063 beq a5,a4,854 <read_memory+0x180>
838: 00000413 li s0,0
83c: 00000993 li s3,0
840: f45ff06f j 784 <read_memory+0xb0>
844: 00045403 lhu s0,0(s0)
848: 01041413 slli s0,s0,0x10
84c: 01045413 srli s0,s0,0x10
850: fedff06f j 83c <read_memory+0x168>
854: 00042483 lw s1,0(s0)
858: 00000413 li s0,0
85c: 00000993 li s3,0
860: f29ff06f j 788 <read_memory+0xb4>
00000864 <dump_memory>:
864: fc010113 addi sp,sp,-64
868: 02912a23 sw s1,52(sp)
86c: 800004b7 lui s1,0x80000
870: 0004c783 lbu a5,0(s1) # 80000000 <__ctr0_io_space_begin+0x80000200>
874: 02112e23 sw ra,60(sp)
878: 02812c23 sw s0,56(sp)
87c: 03212823 sw s2,48(sp)
880: 03312623 sw s3,44(sp)
884: 03412423 sw s4,40(sp)
888: 03512223 sw s5,36(sp)
88c: 03612023 sw s6,32(sp)
890: 01712e23 sw s7,28(sp)
894: 01812c23 sw s8,24(sp)
898: 01912a23 sw s9,20(sp)
89c: 01a12823 sw s10,16(sp)
8a0: 04079263 bnez a5,8e4 <dump_memory+0x80>
8a4: 03812403 lw s0,56(sp)
8a8: 03c12083 lw ra,60(sp)
8ac: 03412483 lw s1,52(sp)
8b0: 03012903 lw s2,48(sp)
8b4: 02c12983 lw s3,44(sp)
8b8: 02812a03 lw s4,40(sp)
8bc: 02412a83 lw s5,36(sp)
8c0: 02012b03 lw s6,32(sp)
8c4: 01c12b83 lw s7,28(sp)
8c8: 01812c03 lw s8,24(sp)
8cc: 01412c83 lw s9,20(sp)
8d0: 01012d03 lw s10,16(sp)
8d4: 00002537 lui a0,0x2
8d8: 84850513 addi a0,a0,-1976 # 1848 <__etext+0xa8>
8dc: 04010113 addi sp,sp,64
8e0: 4400006f j d20 <neorv32_uart0_printf>
8e4: 00002537 lui a0,0x2
8e8: 9ac50513 addi a0,a0,-1620 # 19ac <__etext+0x20c>
8ec: 434000ef jal ra,d20 <neorv32_uart0_printf>
8f0: 00100613 li a2,1
8f4: 00900593 li a1,9
8f8: 00010513 mv a0,sp
8fc: 5bc000ef jal ra,eb8 <neorv32_uart0_scan>
900: 00010513 mv a0,sp
904: 611000ef jal ra,1714 <strlen>
908: 0ff57593 andi a1,a0,255
90c: 00010513 mv a0,sp
910: ac1ff0ef jal ra,3d0 <hexstr_to_uint>
914: 00050413 mv s0,a0
918: 00002537 lui a0,0x2
91c: 9d450513 addi a0,a0,-1580 # 19d4 <__etext+0x234>
920: 400000ef jal ra,d20 <neorv32_uart0_printf>
924: 00048493 mv s1,s1
928: 378000ef jal ra,ca0 <neorv32_uart0_getc>
92c: 00002c37 lui s8,0x2
930: 00002cb7 lui s9,0x2
934: 06200a93 li s5,98
938: 06800b13 li s6,104
93c: 07700b93 li s7,119
940: 00002d37 lui s10,0x2
944: 36c000ef jal ra,cb0 <neorv32_uart0_char_received>
948: 00050913 mv s2,a0
94c: 02051a63 bnez a0,980 <dump_memory+0x11c>
950: 00040593 mv a1,s0
954: a0cc8513 addi a0,s9,-1524 # 1a0c <__etext+0x26c>
958: 3c8000ef jal ra,d20 <neorv32_uart0_printf>
95c: 34291073 csrw mcause,s2
960: 0004c783 lbu a5,0(s1)
964: 07579063 bne a5,s5,9c4 <dump_memory+0x160>
968: 00044a03 lbu s4,0(s0)
96c: 00000993 li s3,0
970: 0ffa7a13 andi s4,s4,255
974: 00000913 li s2,0
978: 342027f3 csrr a5,mcause
97c: 06078e63 beqz a5,9f8 <dump_memory+0x194>
980: 33c000ef jal ra,cbc <neorv32_uart0_char_received_get>
984: a2cc0513 addi a0,s8,-1492 # 1a2c <__etext+0x28c>
988: 398000ef jal ra,d20 <neorv32_uart0_printf>
98c: 03c12083 lw ra,60(sp)
990: 03812403 lw s0,56(sp)
994: 03412483 lw s1,52(sp)
998: 03012903 lw s2,48(sp)
99c: 02c12983 lw s3,44(sp)
9a0: 02812a03 lw s4,40(sp)
9a4: 02412a83 lw s5,36(sp)
9a8: 02012b03 lw s6,32(sp)
9ac: 01c12b83 lw s7,28(sp)
9b0: 01812c03 lw s8,24(sp)
9b4: 01412c83 lw s9,20(sp)
9b8: 01012d03 lw s10,16(sp)
9bc: 04010113 addi sp,sp,64
9c0: 00008067 ret
9c4: 01678a63 beq a5,s6,9d8 <dump_memory+0x174>
9c8: 03778063 beq a5,s7,9e8 <dump_memory+0x184>
9cc: 00000993 li s3,0
9d0: 00000a13 li s4,0
9d4: fa1ff06f j 974 <dump_memory+0x110>
9d8: 00045983 lhu s3,0(s0)
9dc: 01099993 slli s3,s3,0x10
9e0: 0109d993 srli s3,s3,0x10
9e4: fedff06f j 9d0 <dump_memory+0x16c>
9e8: 00042903 lw s2,0(s0)
9ec: 00000993 li s3,0
9f0: 00000a13 li s4,0
9f4: f85ff06f j 978 <dump_memory+0x114>
9f8: 918d0513 addi a0,s10,-1768 # 1918 <__etext+0x178>
9fc: 324000ef jal ra,d20 <neorv32_uart0_printf>
a00: 0004c783 lbu a5,0(s1)
a04: 01579663 bne a5,s5,a10 <dump_memory+0x1ac>
a08: 000a0513 mv a0,s4
a0c: c7dff0ef jal ra,688 <aux_print_hex_byte>
a10: 0004c783 lbu a5,0(s1)
a14: 01679a63 bne a5,s6,a28 <dump_memory+0x1c4>
a18: 0089d513 srli a0,s3,0x8
a1c: c6dff0ef jal ra,688 <aux_print_hex_byte>
a20: 0ff9f513 andi a0,s3,255
a24: c65ff0ef jal ra,688 <aux_print_hex_byte>
a28: 0004c783 lbu a5,0(s1)
a2c: 03779663 bne a5,s7,a58 <dump_memory+0x1f4>
a30: 01895513 srli a0,s2,0x18
a34: c55ff0ef jal ra,688 <aux_print_hex_byte>
a38: 01095513 srli a0,s2,0x10
a3c: 0ff57513 andi a0,a0,255
a40: c49ff0ef jal ra,688 <aux_print_hex_byte>
a44: 00895513 srli a0,s2,0x8
a48: 0ff57513 andi a0,a0,255
a4c: c3dff0ef jal ra,688 <aux_print_hex_byte>
a50: 0ff97513 andi a0,s2,255
a54: c35ff0ef jal ra,688 <aux_print_hex_byte>
a58: a2cc0513 addi a0,s8,-1492
a5c: 2c4000ef jal ra,d20 <neorv32_uart0_printf>
a60: 0004c783 lbu a5,0(s1)
a64: 01579663 bne a5,s5,a70 <dump_memory+0x20c>
a68: 00140413 addi s0,s0,1
a6c: ed9ff06f j 944 <dump_memory+0xe0>
a70: 01679663 bne a5,s6,a7c <dump_memory+0x218>
a74: 00240413 addi s0,s0,2
a78: ecdff06f j 944 <dump_memory+0xe0>
a7c: ed7794e3 bne a5,s7,944 <dump_memory+0xe0>
a80: 00440413 addi s0,s0,4
a84: ec1ff06f j 944 <dump_memory+0xe0>
00000a88 <__neorv32_uart_itoa>:
a88: fd010113 addi sp,sp,-48
a8c: 02812423 sw s0,40(sp)
a90: 02912223 sw s1,36(sp)
a94: 03212023 sw s2,32(sp)
a98: 01312e23 sw s3,28(sp)
a9c: 01412c23 sw s4,24(sp)
aa0: 02112623 sw ra,44(sp)
aa4: 01512a23 sw s5,20(sp)
aa8: 00002a37 lui s4,0x2
aac: 00050493 mv s1,a0
ab0: 00058413 mv s0,a1
ab4: 00058523 sb zero,10(a1)
ab8: 00000993 li s3,0
abc: 00410913 addi s2,sp,4
ac0: c54a0a13 addi s4,s4,-940 # 1c54 <numbers.1>
ac4: 00a00593 li a1,10
ac8: 00048513 mv a0,s1
acc: 269000ef jal ra,1534 <__umodsi3>
ad0: 00aa0533 add a0,s4,a0
ad4: 00054783 lbu a5,0(a0)
ad8: 01390ab3 add s5,s2,s3
adc: 00048513 mv a0,s1
ae0: 00fa8023 sb a5,0(s5)
ae4: 00a00593 li a1,10
ae8: 205000ef jal ra,14ec <__udivsi3>
aec: 00198993 addi s3,s3,1
af0: 00a00793 li a5,10
af4: 00050493 mv s1,a0
af8: fcf996e3 bne s3,a5,ac4 <__neorv32_uart_itoa+0x3c>
afc: 00090693 mv a3,s2
b00: 00900713 li a4,9
b04: 03000613 li a2,48
b08: 0096c583 lbu a1,9(a3)
b0c: 00070793 mv a5,a4
b10: fff70713 addi a4,a4,-1
b14: 01071713 slli a4,a4,0x10
b18: 01075713 srli a4,a4,0x10
b1c: 00c59a63 bne a1,a2,b30 <__neorv32_uart_itoa+0xa8>
b20: 000684a3 sb zero,9(a3)
b24: fff68693 addi a3,a3,-1
b28: fe0710e3 bnez a4,b08 <__neorv32_uart_itoa+0x80>
b2c: 00000793 li a5,0
b30: 00f907b3 add a5,s2,a5
b34: 00000593 li a1,0
b38: 0007c703 lbu a4,0(a5)
b3c: 00070c63 beqz a4,b54 <__neorv32_uart_itoa+0xcc>
b40: 00158693 addi a3,a1,1
b44: 00b405b3 add a1,s0,a1
b48: 00e58023 sb a4,0(a1)
b4c: 01069593 slli a1,a3,0x10
b50: 0105d593 srli a1,a1,0x10
b54: fff78713 addi a4,a5,-1
b58: 02f91863 bne s2,a5,b88 <__neorv32_uart_itoa+0x100>
b5c: 00b40433 add s0,s0,a1
b60: 00040023 sb zero,0(s0)
b64: 02c12083 lw ra,44(sp)
b68: 02812403 lw s0,40(sp)
b6c: 02412483 lw s1,36(sp)
b70: 02012903 lw s2,32(sp)
b74: 01c12983 lw s3,28(sp)
b78: 01812a03 lw s4,24(sp)
b7c: 01412a83 lw s5,20(sp)
b80: 03010113 addi sp,sp,48
b84: 00008067 ret
b88: 00070793 mv a5,a4
b8c: fadff06f j b38 <__neorv32_uart_itoa+0xb0>
00000b90 <__neorv32_uart_tohex>:
b90: 00002637 lui a2,0x2
b94: 00758693 addi a3,a1,7
b98: 00000713 li a4,0
b9c: c6060613 addi a2,a2,-928 # 1c60 <symbols.0>
ba0: 02000813 li a6,32
ba4: 00e557b3 srl a5,a0,a4
ba8: 00f7f793 andi a5,a5,15
bac: 00f607b3 add a5,a2,a5
bb0: 0007c783 lbu a5,0(a5)
bb4: 00470713 addi a4,a4,4
bb8: fff68693 addi a3,a3,-1
bbc: 00f680a3 sb a5,1(a3)
bc0: ff0712e3 bne a4,a6,ba4 <__neorv32_uart_tohex+0x14>
bc4: 00058423 sb zero,8(a1)
bc8: 00008067 ret
00000bcc <neorv32_uart0_available>:
bcc: fe802503 lw a0,-24(zero) # ffffffe8 <__ctr0_io_space_begin+0x1e8>
bd0: 01255513 srli a0,a0,0x12
bd4: 00157513 andi a0,a0,1
bd8: 00008067 ret
00000bdc <neorv32_uart0_setup>:
bdc: ff010113 addi sp,sp,-16
be0: 00812423 sw s0,8(sp)
be4: 00912223 sw s1,4(sp)
be8: 00112623 sw ra,12(sp)
bec: fa002023 sw zero,-96(zero) # ffffffa0 <__ctr0_io_space_begin+0x1a0>
bf0: fe002783 lw a5,-32(zero) # ffffffe0 <__ctr0_io_space_begin+0x1e0>
bf4: 00058413 mv s0,a1
bf8: 00151593 slli a1,a0,0x1
bfc: 00078513 mv a0,a5
c00: 00060493 mv s1,a2
c04: 0e9000ef jal ra,14ec <__udivsi3>
c08: 01051513 slli a0,a0,0x10
c0c: 000017b7 lui a5,0x1
c10: 01055513 srli a0,a0,0x10
c14: 00000713 li a4,0
c18: ffe78793 addi a5,a5,-2 # ffe <__neorv32_rte_core+0x6e>
c1c: 04a7e463 bltu a5,a0,c64 <neorv32_uart0_setup+0x88>
c20: 0034f793 andi a5,s1,3
c24: 00347413 andi s0,s0,3
c28: fff50513 addi a0,a0,-1
c2c: 01479793 slli a5,a5,0x14
c30: 01641413 slli s0,s0,0x16
c34: 00f567b3 or a5,a0,a5
c38: 0087e7b3 or a5,a5,s0
c3c: 01871713 slli a4,a4,0x18
c40: 00c12083 lw ra,12(sp)
c44: 00812403 lw s0,8(sp)
c48: 00e7e7b3 or a5,a5,a4
c4c: 10000737 lui a4,0x10000
c50: 00e7e7b3 or a5,a5,a4
c54: faf02023 sw a5,-96(zero) # ffffffa0 <__ctr0_io_space_begin+0x1a0>
c58: 00412483 lw s1,4(sp)
c5c: 01010113 addi sp,sp,16
c60: 00008067 ret
c64: ffe70693 addi a3,a4,-2 # ffffffe <__crt0_copy_data_src_begin+0xfffe05e>
c68: 0fd6f693 andi a3,a3,253
c6c: 00069a63 bnez a3,c80 <neorv32_uart0_setup+0xa4>
c70: 00355513 srli a0,a0,0x3
c74: 00170713 addi a4,a4,1
c78: 0ff77713 andi a4,a4,255
c7c: fa1ff06f j c1c <neorv32_uart0_setup+0x40>
c80: 00155513 srli a0,a0,0x1
c84: ff1ff06f j c74 <neorv32_uart0_setup+0x98>
00000c88 <neorv32_uart0_putc>:
c88: 00040737 lui a4,0x40
c8c: fa002783 lw a5,-96(zero) # ffffffa0 <__ctr0_io_space_begin+0x1a0>
c90: 00e7f7b3 and a5,a5,a4
c94: fe079ce3 bnez a5,c8c <neorv32_uart0_putc+0x4>
c98: faa02223 sw a0,-92(zero) # ffffffa4 <__ctr0_io_space_begin+0x1a4>
c9c: 00008067 ret
00000ca0 <neorv32_uart0_getc>:
ca0: fa402503 lw a0,-92(zero) # ffffffa4 <__ctr0_io_space_begin+0x1a4>
ca4: fe055ee3 bgez a0,ca0 <neorv32_uart0_getc>
ca8: 0ff57513 andi a0,a0,255
cac: 00008067 ret
00000cb0 <neorv32_uart0_char_received>:
cb0: fa402503 lw a0,-92(zero) # ffffffa4 <__ctr0_io_space_begin+0x1a4>
cb4: 01f55513 srli a0,a0,0x1f
cb8: 00008067 ret
00000cbc <neorv32_uart0_char_received_get>:
cbc: fa402503 lw a0,-92(zero) # ffffffa4 <__ctr0_io_space_begin+0x1a4>
cc0: 0ff57513 andi a0,a0,255
cc4: 00008067 ret
00000cc8 <neorv32_uart0_print>:
cc8: ff010113 addi sp,sp,-16
ccc: 00812423 sw s0,8(sp)
cd0: 01212023 sw s2,0(sp)
cd4: 00112623 sw ra,12(sp)
cd8: 00912223 sw s1,4(sp)
cdc: 00050413 mv s0,a0
ce0: 00a00913 li s2,10
ce4: 00044483 lbu s1,0(s0)
ce8: 00140413 addi s0,s0,1
cec: 00049e63 bnez s1,d08 <neorv32_uart0_print+0x40>
cf0: 00c12083 lw ra,12(sp)
cf4: 00812403 lw s0,8(sp)
cf8: 00412483 lw s1,4(sp)
cfc: 00012903 lw s2,0(sp)
d00: 01010113 addi sp,sp,16
d04: 00008067 ret
d08: 01249663 bne s1,s2,d14 <neorv32_uart0_print+0x4c>
d0c: 00d00513 li a0,13
d10: f79ff0ef jal ra,c88 <neorv32_uart0_putc>
d14: 00048513 mv a0,s1
d18: f71ff0ef jal ra,c88 <neorv32_uart0_putc>
d1c: fc9ff06f j ce4 <neorv32_uart0_print+0x1c>
00000d20 <neorv32_uart0_printf>:
d20: fa010113 addi sp,sp,-96
d24: 04f12a23 sw a5,84(sp)
d28: 04410793 addi a5,sp,68
d2c: 02812c23 sw s0,56(sp)
d30: 03212823 sw s2,48(sp)
d34: 03412423 sw s4,40(sp)
d38: 03512223 sw s5,36(sp)
d3c: 03612023 sw s6,32(sp)
d40: 01712e23 sw s7,28(sp)
d44: 01812c23 sw s8,24(sp)
d48: 01912a23 sw s9,20(sp)
d4c: 02112e23 sw ra,60(sp)
d50: 02912a23 sw s1,52(sp)
d54: 03312623 sw s3,44(sp)
d58: 00050413 mv s0,a0
d5c: 04b12223 sw a1,68(sp)
d60: 04c12423 sw a2,72(sp)
d64: 04d12623 sw a3,76(sp)
d68: 04e12823 sw a4,80(sp)
d6c: 05012c23 sw a6,88(sp)
d70: 05112e23 sw a7,92(sp)
d74: 00f12023 sw a5,0(sp)
d78: 02500a13 li s4,37
d7c: 00a00a93 li s5,10
d80: 07300913 li s2,115
d84: 07500b13 li s6,117
d88: 07800b93 li s7,120
d8c: 06300c13 li s8,99
d90: 06900c93 li s9,105
d94: 00044483 lbu s1,0(s0)
d98: 02049c63 bnez s1,dd0 <neorv32_uart0_printf+0xb0>
d9c: 03c12083 lw ra,60(sp)
da0: 03812403 lw s0,56(sp)
da4: 03412483 lw s1,52(sp)
da8: 03012903 lw s2,48(sp)
dac: 02c12983 lw s3,44(sp)
db0: 02812a03 lw s4,40(sp)
db4: 02412a83 lw s5,36(sp)
db8: 02012b03 lw s6,32(sp)
dbc: 01c12b83 lw s7,28(sp)
dc0: 01812c03 lw s8,24(sp)
dc4: 01412c83 lw s9,20(sp)
dc8: 06010113 addi sp,sp,96
dcc: 00008067 ret
dd0: 0d449863 bne s1,s4,ea0 <neorv32_uart0_printf+0x180>
dd4: 00240993 addi s3,s0,2
dd8: 00144403 lbu s0,1(s0)
ddc: 05240263 beq s0,s2,e20 <neorv32_uart0_printf+0x100>
de0: 00896e63 bltu s2,s0,dfc <neorv32_uart0_printf+0xdc>
de4: 05840c63 beq s0,s8,e3c <neorv32_uart0_printf+0x11c>
de8: 07940663 beq s0,s9,e54 <neorv32_uart0_printf+0x134>
dec: 02500513 li a0,37
df0: e99ff0ef jal ra,c88 <neorv32_uart0_putc>
df4: 00040513 mv a0,s0
df8: 0540006f j e4c <neorv32_uart0_printf+0x12c>
dfc: 09640663 beq s0,s6,e88 <neorv32_uart0_printf+0x168>
e00: ff7416e3 bne s0,s7,dec <neorv32_uart0_printf+0xcc>
e04: 00012783 lw a5,0(sp)
e08: 00410593 addi a1,sp,4
e0c: 0007a503 lw a0,0(a5)
e10: 00478713 addi a4,a5,4
e14: 00e12023 sw a4,0(sp)
e18: d79ff0ef jal ra,b90 <__neorv32_uart_tohex>
e1c: 0640006f j e80 <neorv32_uart0_printf+0x160>
e20: 00012783 lw a5,0(sp)
e24: 0007a503 lw a0,0(a5)
e28: 00478713 addi a4,a5,4
e2c: 00e12023 sw a4,0(sp)
e30: e99ff0ef jal ra,cc8 <neorv32_uart0_print>
e34: 00098413 mv s0,s3
e38: f5dff06f j d94 <neorv32_uart0_printf+0x74>
e3c: 00012783 lw a5,0(sp)
e40: 0007c503 lbu a0,0(a5)
e44: 00478713 addi a4,a5,4
e48: 00e12023 sw a4,0(sp)
e4c: e3dff0ef jal ra,c88 <neorv32_uart0_putc>
e50: fe5ff06f j e34 <neorv32_uart0_printf+0x114>
e54: 00012783 lw a5,0(sp)
e58: 0007a403 lw s0,0(a5)
e5c: 00478713 addi a4,a5,4
e60: 00e12023 sw a4,0(sp)
e64: 00045863 bgez s0,e74 <neorv32_uart0_printf+0x154>
e68: 02d00513 li a0,45
e6c: 40800433 neg s0,s0
e70: e19ff0ef jal ra,c88 <neorv32_uart0_putc>
e74: 00410593 addi a1,sp,4
e78: 00040513 mv a0,s0
e7c: c0dff0ef jal ra,a88 <__neorv32_uart_itoa>
e80: 00410513 addi a0,sp,4
e84: fadff06f j e30 <neorv32_uart0_printf+0x110>
e88: 00012783 lw a5,0(sp)
e8c: 00410593 addi a1,sp,4
e90: 00478713 addi a4,a5,4
e94: 0007a503 lw a0,0(a5)
e98: 00e12023 sw a4,0(sp)
e9c: fe1ff06f j e7c <neorv32_uart0_printf+0x15c>
ea0: 01549663 bne s1,s5,eac <neorv32_uart0_printf+0x18c>
ea4: 00d00513 li a0,13
ea8: de1ff0ef jal ra,c88 <neorv32_uart0_putc>
eac: 00140993 addi s3,s0,1
eb0: 00048513 mv a0,s1
eb4: f99ff06f j e4c <neorv32_uart0_printf+0x12c>
00000eb8 <neorv32_uart0_scan>:
eb8: fd010113 addi sp,sp,-48
ebc: 02812423 sw s0,40(sp)
ec0: 02912223 sw s1,36(sp)
ec4: 01312e23 sw s3,28(sp)
ec8: 01412c23 sw s4,24(sp)
ecc: 01512a23 sw s5,20(sp)
ed0: 01612823 sw s6,16(sp)
ed4: 01712623 sw s7,12(sp)
ed8: 01812423 sw s8,8(sp)
edc: 02112623 sw ra,44(sp)
ee0: 03212023 sw s2,32(sp)
ee4: 00050413 mv s0,a0
ee8: 00060993 mv s3,a2
eec: 00000493 li s1,0
ef0: 00800a93 li s5,8
ef4: 00d00b13 li s6,13
ef8: 05e00b93 li s7,94
efc: fff58a13 addi s4,a1,-1
f00: 00002c37 lui s8,0x2
f04: d9dff0ef jal ra,ca0 <neorv32_uart0_getc>
f08: 00050913 mv s2,a0
f0c: 03551063 bne a0,s5,f2c <neorv32_uart0_scan+0x74>
f10: fe048ae3 beqz s1,f04 <neorv32_uart0_scan+0x4c>
f14: 00098663 beqz s3,f20 <neorv32_uart0_scan+0x68>
f18: c50c0513 addi a0,s8,-944 # 1c50 <symbols.0+0x14>
f1c: dadff0ef jal ra,cc8 <neorv32_uart0_print>
f20: fff40413 addi s0,s0,-1
f24: fff48493 addi s1,s1,-1
f28: fddff06f j f04 <neorv32_uart0_scan+0x4c>
f2c: 03650663 beq a0,s6,f58 <neorv32_uart0_scan+0xa0>
f30: fe050793 addi a5,a0,-32
f34: 0ff7f793 andi a5,a5,255
f38: fcfbe6e3 bltu s7,a5,f04 <neorv32_uart0_scan+0x4c>
f3c: fd44d4e3 bge s1,s4,f04 <neorv32_uart0_scan+0x4c>
f40: 00098463 beqz s3,f48 <neorv32_uart0_scan+0x90>
f44: d45ff0ef jal ra,c88 <neorv32_uart0_putc>
f48: 01240023 sb s2,0(s0)
f4c: 00148493 addi s1,s1,1
f50: 00140413 addi s0,s0,1
f54: fb1ff06f j f04 <neorv32_uart0_scan+0x4c>
f58: 02c12083 lw ra,44(sp)
f5c: 00040023 sb zero,0(s0)
f60: 02812403 lw s0,40(sp)
f64: 02012903 lw s2,32(sp)
f68: 01c12983 lw s3,28(sp)
f6c: 01812a03 lw s4,24(sp)
f70: 01412a83 lw s5,20(sp)
f74: 01012b03 lw s6,16(sp)
f78: 00c12b83 lw s7,12(sp)
f7c: 00812c03 lw s8,8(sp)
f80: 00048513 mv a0,s1
f84: 02412483 lw s1,36(sp)
f88: 03010113 addi sp,sp,48
f8c: 00008067 ret
00000f90 <__neorv32_rte_core>:
f90: fc010113 addi sp,sp,-64
f94: 02112e23 sw ra,60(sp)
f98: 02512c23 sw t0,56(sp)
f9c: 02612a23 sw t1,52(sp)
fa0: 02712823 sw t2,48(sp)
fa4: 02a12623 sw a0,44(sp)
fa8: 02b12423 sw a1,40(sp)
fac: 02c12223 sw a2,36(sp)
fb0: 02d12023 sw a3,32(sp)
fb4: 00e12e23 sw a4,28(sp)
fb8: 00f12c23 sw a5,24(sp)
fbc: 01012a23 sw a6,20(sp)
fc0: 01112823 sw a7,16(sp)
fc4: 01c12623 sw t3,12(sp)
fc8: 01d12423 sw t4,8(sp)
fcc: 01e12223 sw t5,4(sp)
fd0: 01f12023 sw t6,0(sp)
fd4: 34102773 csrr a4,mepc
fd8: 34071073 csrw mscratch,a4
fdc: 342027f3 csrr a5,mcause
fe0: 0807ca63 bltz a5,1074 <__neorv32_rte_core+0xe4>
fe4: 00071683 lh a3,0(a4) # 40000 <__crt0_copy_data_src_begin+0x3e060>
fe8: 00300593 li a1,3
fec: 0036f693 andi a3,a3,3
ff0: 00270613 addi a2,a4,2
ff4: 00b69463 bne a3,a1,ffc <__neorv32_rte_core+0x6c>
ff8: 00470613 addi a2,a4,4
ffc: 34161073 csrw mepc,a2
1000: 00b00713 li a4,11
1004: 04f77c63 bgeu a4,a5,105c <__neorv32_rte_core+0xcc>
1008: 000017b7 lui a5,0x1
100c: 20c78793 addi a5,a5,524 # 120c <__neorv32_rte_debug_exc_handler>
1010: 000780e7 jalr a5
1014: 03c12083 lw ra,60(sp)
1018: 03812283 lw t0,56(sp)
101c: 03412303 lw t1,52(sp)
1020: 03012383 lw t2,48(sp)
1024: 02c12503 lw a0,44(sp)
1028: 02812583 lw a1,40(sp)
102c: 02412603 lw a2,36(sp)
1030: 02012683 lw a3,32(sp)
1034: 01c12703 lw a4,28(sp)
1038: 01812783 lw a5,24(sp)
103c: 01412803 lw a6,20(sp)
1040: 01012883 lw a7,16(sp)
1044: 00c12e03 lw t3,12(sp)
1048: 00812e83 lw t4,8(sp)
104c: 00412f03 lw t5,4(sp)
1050: 00012f83 lw t6,0(sp)
1054: 04010113 addi sp,sp,64
1058: 30200073 mret
105c: 00002737 lui a4,0x2
1060: 00279793 slli a5,a5,0x2
1064: c7470713 addi a4,a4,-908 # 1c74 <symbols.0+0x14>
1068: 00e787b3 add a5,a5,a4
106c: 0007a783 lw a5,0(a5)
1070: 00078067 jr a5
1074: 80000737 lui a4,0x80000
1078: ffd74713 xori a4,a4,-3
107c: 00e787b3 add a5,a5,a4
1080: 01c00713 li a4,28
1084: f8f762e3 bltu a4,a5,1008 <__neorv32_rte_core+0x78>
1088: 00002737 lui a4,0x2
108c: 00279793 slli a5,a5,0x2
1090: ca470713 addi a4,a4,-860 # 1ca4 <symbols.0+0x44>
1094: 00e787b3 add a5,a5,a4
1098: 0007a783 lw a5,0(a5)
109c: 00078067 jr a5
10a0: 800007b7 lui a5,0x80000
10a4: 0047a783 lw a5,4(a5) # 80000004 <__ctr0_io_space_begin+0x80000204>
10a8: f69ff06f j 1010 <__neorv32_rte_core+0x80>
10ac: 800007b7 lui a5,0x80000
10b0: 0087a783 lw a5,8(a5) # 80000008 <__ctr0_io_space_begin+0x80000208>
10b4: f5dff06f j 1010 <__neorv32_rte_core+0x80>
10b8: 800007b7 lui a5,0x80000
10bc: 00c7a783 lw a5,12(a5) # 8000000c <__ctr0_io_space_begin+0x8000020c>
10c0: f51ff06f j 1010 <__neorv32_rte_core+0x80>
10c4: 8101a783 lw a5,-2032(gp) # 80000010 <__neorv32_rte_vector_lut+0xc>
10c8: f49ff06f j 1010 <__neorv32_rte_core+0x80>
10cc: 8141a783 lw a5,-2028(gp) # 80000014 <__neorv32_rte_vector_lut+0x10>
10d0: f41ff06f j 1010 <__neorv32_rte_core+0x80>
10d4: 8181a783 lw a5,-2024(gp) # 80000018 <__neorv32_rte_vector_lut+0x14>
10d8: f39ff06f j 1010 <__neorv32_rte_core+0x80>
10dc: 81c1a783 lw a5,-2020(gp) # 8000001c <__neorv32_rte_vector_lut+0x18>
10e0: f31ff06f j 1010 <__neorv32_rte_core+0x80>
10e4: 8201a783 lw a5,-2016(gp) # 80000020 <__neorv32_rte_vector_lut+0x1c>
10e8: f29ff06f j 1010 <__neorv32_rte_core+0x80>
10ec: 8241a783 lw a5,-2012(gp) # 80000024 <__neorv32_rte_vector_lut+0x20>
10f0: f21ff06f j 1010 <__neorv32_rte_core+0x80>
10f4: 8281a783 lw a5,-2008(gp) # 80000028 <__neorv32_rte_vector_lut+0x24>
10f8: f19ff06f j 1010 <__neorv32_rte_core+0x80>
10fc: 82c1a783 lw a5,-2004(gp) # 8000002c <__neorv32_rte_vector_lut+0x28>
1100: f11ff06f j 1010 <__neorv32_rte_core+0x80>
1104: 8301a783 lw a5,-2000(gp) # 80000030 <__neorv32_rte_vector_lut+0x2c>
1108: f09ff06f j 1010 <__neorv32_rte_core+0x80>
110c: 8341a783 lw a5,-1996(gp) # 80000034 <__neorv32_rte_vector_lut+0x30>
1110: f01ff06f j 1010 <__neorv32_rte_core+0x80>
1114: 8381a783 lw a5,-1992(gp) # 80000038 <__neorv32_rte_vector_lut+0x34>
1118: ef9ff06f j 1010 <__neorv32_rte_core+0x80>
111c: 83c1a783 lw a5,-1988(gp) # 8000003c <__neorv32_rte_vector_lut+0x38>
1120: ef1ff06f j 1010 <__neorv32_rte_core+0x80>
1124: 8401a783 lw a5,-1984(gp) # 80000040 <__neorv32_rte_vector_lut+0x3c>
1128: ee9ff06f j 1010 <__neorv32_rte_core+0x80>
112c: 8441a783 lw a5,-1980(gp) # 80000044 <__neorv32_rte_vector_lut+0x40>
1130: ee1ff06f j 1010 <__neorv32_rte_core+0x80>
1134: 8481a783 lw a5,-1976(gp) # 80000048 <__neorv32_rte_vector_lut+0x44>
1138: ed9ff06f j 1010 <__neorv32_rte_core+0x80>
113c: 84c1a783 lw a5,-1972(gp) # 8000004c <__neorv32_rte_vector_lut+0x48>
1140: ed1ff06f j 1010 <__neorv32_rte_core+0x80>
1144: 8501a783 lw a5,-1968(gp) # 80000050 <__neorv32_rte_vector_lut+0x4c>
1148: ec9ff06f j 1010 <__neorv32_rte_core+0x80>
114c: 8541a783 lw a5,-1964(gp) # 80000054 <__neorv32_rte_vector_lut+0x50>
1150: ec1ff06f j 1010 <__neorv32_rte_core+0x80>
1154: 8581a783 lw a5,-1960(gp) # 80000058 <__neorv32_rte_vector_lut+0x54>
1158: eb9ff06f j 1010 <__neorv32_rte_core+0x80>
115c: 85c1a783 lw a5,-1956(gp) # 8000005c <__neorv32_rte_vector_lut+0x58>
1160: eb1ff06f j 1010 <__neorv32_rte_core+0x80>
1164: 8601a783 lw a5,-1952(gp) # 80000060 <__neorv32_rte_vector_lut+0x5c>
1168: ea9ff06f j 1010 <__neorv32_rte_core+0x80>
116c: 8641a783 lw a5,-1948(gp) # 80000064 <__neorv32_rte_vector_lut+0x60>
1170: ea1ff06f j 1010 <__neorv32_rte_core+0x80>
1174: 8681a783 lw a5,-1944(gp) # 80000068 <__neorv32_rte_vector_lut+0x64>
1178: e99ff06f j 1010 <__neorv32_rte_core+0x80>
117c: 86c1a783 lw a5,-1940(gp) # 8000006c <__neorv32_rte_vector_lut+0x68>
1180: e91ff06f j 1010 <__neorv32_rte_core+0x80>
1184: 8701a783 lw a5,-1936(gp) # 80000070 <__neorv32_rte_vector_lut+0x6c>
1188: e89ff06f j 1010 <__neorv32_rte_core+0x80>
118c: 8741a783 lw a5,-1932(gp) # 80000074 <__neorv32_rte_vector_lut+0x70>
1190: e81ff06f j 1010 <__neorv32_rte_core+0x80>
1194: 0000 unimp
1196: 0000 unimp
1198: 0000 unimp
119a: 0000 unimp
0000119c <__neorv32_rte_print_hex_word>:
119c: fe010113 addi sp,sp,-32
11a0: 01212823 sw s2,16(sp)
11a4: 00050913 mv s2,a0
11a8: 00002537 lui a0,0x2
11ac: 00912a23 sw s1,20(sp)
11b0: 91850513 addi a0,a0,-1768 # 1918 <__etext+0x178>
11b4: 000024b7 lui s1,0x2
11b8: 00812c23 sw s0,24(sp)
11bc: 01312623 sw s3,12(sp)
11c0: 00112e23 sw ra,28(sp)
11c4: 01c00413 li s0,28
11c8: b01ff0ef jal ra,cc8 <neorv32_uart0_print>
11cc: f9048493 addi s1,s1,-112 # 1f90 <hex_symbols.0>
11d0: ffc00993 li s3,-4
11d4: 008957b3 srl a5,s2,s0
11d8: 00f7f793 andi a5,a5,15
11dc: 00f487b3 add a5,s1,a5
11e0: 0007c503 lbu a0,0(a5)
11e4: ffc40413 addi s0,s0,-4
11e8: aa1ff0ef jal ra,c88 <neorv32_uart0_putc>
11ec: ff3414e3 bne s0,s3,11d4 <__neorv32_rte_print_hex_word+0x38>
11f0: 01c12083 lw ra,28(sp)
11f4: 01812403 lw s0,24(sp)
11f8: 01412483 lw s1,20(sp)
11fc: 01012903 lw s2,16(sp)
1200: 00c12983 lw s3,12(sp)
1204: 02010113 addi sp,sp,32
1208: 00008067 ret
0000120c <__neorv32_rte_debug_exc_handler>:
120c: ff010113 addi sp,sp,-16
1210: 00112623 sw ra,12(sp)
1214: 00812423 sw s0,8(sp)
1218: 00912223 sw s1,4(sp)
121c: 9b1ff0ef jal ra,bcc <neorv32_uart0_available>
1220: 1c050863 beqz a0,13f0 <__neorv32_rte_debug_exc_handler+0x1e4>
1224: 00002537 lui a0,0x2
1228: d1850513 addi a0,a0,-744 # 1d18 <symbols.0+0xb8>
122c: a9dff0ef jal ra,cc8 <neorv32_uart0_print>
1230: 34202473 csrr s0,mcause
1234: 00900713 li a4,9
1238: 00f47793 andi a5,s0,15
123c: 03078493 addi s1,a5,48
1240: 00f77463 bgeu a4,a5,1248 <__neorv32_rte_debug_exc_handler+0x3c>
1244: 05778493 addi s1,a5,87
1248: 00b00793 li a5,11
124c: 0087ee63 bltu a5,s0,1268 <__neorv32_rte_debug_exc_handler+0x5c>
1250: 00002737 lui a4,0x2
1254: 00241793 slli a5,s0,0x2
1258: ed870713 addi a4,a4,-296 # 1ed8 <symbols.0+0x278>
125c: 00e787b3 add a5,a5,a4
1260: 0007a783 lw a5,0(a5)
1264: 00078067 jr a5
1268: 800007b7 lui a5,0x80000
126c: 00b78713 addi a4,a5,11 # 8000000b <__ctr0_io_space_begin+0x8000020b>
1270: 14e40e63 beq s0,a4,13cc <__neorv32_rte_debug_exc_handler+0x1c0>
1274: 02876a63 bltu a4,s0,12a8 <__neorv32_rte_debug_exc_handler+0x9c>
1278: 00378713 addi a4,a5,3
127c: 12e40c63 beq s0,a4,13b4 <__neorv32_rte_debug_exc_handler+0x1a8>
1280: 00778793 addi a5,a5,7
1284: 12f40e63 beq s0,a5,13c0 <__neorv32_rte_debug_exc_handler+0x1b4>
1288: 00002537 lui a0,0x2
128c: e7850513 addi a0,a0,-392 # 1e78 <symbols.0+0x218>
1290: a39ff0ef jal ra,cc8 <neorv32_uart0_print>
1294: 00040513 mv a0,s0
1298: f05ff0ef jal ra,119c <__neorv32_rte_print_hex_word>
129c: 00100793 li a5,1
12a0: 08f40c63 beq s0,a5,1338 <__neorv32_rte_debug_exc_handler+0x12c>
12a4: 0280006f j 12cc <__neorv32_rte_debug_exc_handler+0xc0>
12a8: ff07c793 xori a5,a5,-16
12ac: 00f407b3 add a5,s0,a5
12b0: 00f00713 li a4,15
12b4: fcf76ae3 bltu a4,a5,1288 <__neorv32_rte_debug_exc_handler+0x7c>
12b8: 00002537 lui a0,0x2
12bc: e6850513 addi a0,a0,-408 # 1e68 <symbols.0+0x208>
12c0: a09ff0ef jal ra,cc8 <neorv32_uart0_print>
12c4: 00048513 mv a0,s1
12c8: 9c1ff0ef jal ra,c88 <neorv32_uart0_putc>
12cc: ffd47413 andi s0,s0,-3
12d0: 00500793 li a5,5
12d4: 06f40263 beq s0,a5,1338 <__neorv32_rte_debug_exc_handler+0x12c>
12d8: 00002537 lui a0,0x2
12dc: ebc50513 addi a0,a0,-324 # 1ebc <symbols.0+0x25c>
12e0: 9e9ff0ef jal ra,cc8 <neorv32_uart0_print>
12e4: 34002573 csrr a0,mscratch
12e8: eb5ff0ef jal ra,119c <__neorv32_rte_print_hex_word>
12ec: 00002537 lui a0,0x2
12f0: ec450513 addi a0,a0,-316 # 1ec4 <symbols.0+0x264>
12f4: 9d5ff0ef jal ra,cc8 <neorv32_uart0_print>
12f8: 34302573 csrr a0,mtval
12fc: ea1ff0ef jal ra,119c <__neorv32_rte_print_hex_word>
1300: 00812403 lw s0,8(sp)
1304: 00c12083 lw ra,12(sp)
1308: 00412483 lw s1,4(sp)
130c: 00002537 lui a0,0x2
1310: ed050513 addi a0,a0,-304 # 1ed0 <symbols.0+0x270>
1314: 01010113 addi sp,sp,16
1318: 9b1ff06f j cc8 <neorv32_uart0_print>
131c: 00002537 lui a0,0x2
1320: d2050513 addi a0,a0,-736 # 1d20 <symbols.0+0xc0>
1324: 9a5ff0ef jal ra,cc8 <neorv32_uart0_print>
1328: fb1ff06f j 12d8 <__neorv32_rte_debug_exc_handler+0xcc>
132c: 00002537 lui a0,0x2
1330: d4050513 addi a0,a0,-704 # 1d40 <symbols.0+0xe0>
1334: 995ff0ef jal ra,cc8 <neorv32_uart0_print>
1338: f7c02783 lw a5,-132(zero) # ffffff7c <__ctr0_io_space_begin+0x17c>
133c: 0a07d463 bgez a5,13e4 <__neorv32_rte_debug_exc_handler+0x1d8>
1340: 0017f793 andi a5,a5,1
1344: 08078a63 beqz a5,13d8 <__neorv32_rte_debug_exc_handler+0x1cc>
1348: 00002537 lui a0,0x2
134c: e9050513 addi a0,a0,-368 # 1e90 <symbols.0+0x230>
1350: fd5ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
1354: 00002537 lui a0,0x2
1358: d5c50513 addi a0,a0,-676 # 1d5c <symbols.0+0xfc>
135c: fc9ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
1360: 00002537 lui a0,0x2
1364: d7050513 addi a0,a0,-656 # 1d70 <symbols.0+0x110>
1368: fbdff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
136c: 00002537 lui a0,0x2
1370: d7c50513 addi a0,a0,-644 # 1d7c <symbols.0+0x11c>
1374: fb1ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
1378: 00002537 lui a0,0x2
137c: d9450513 addi a0,a0,-620 # 1d94 <symbols.0+0x134>
1380: fb5ff06f j 1334 <__neorv32_rte_debug_exc_handler+0x128>
1384: 00002537 lui a0,0x2
1388: da850513 addi a0,a0,-600 # 1da8 <symbols.0+0x148>
138c: f99ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
1390: 00002537 lui a0,0x2
1394: dc450513 addi a0,a0,-572 # 1dc4 <symbols.0+0x164>
1398: f9dff06f j 1334 <__neorv32_rte_debug_exc_handler+0x128>
139c: 00002537 lui a0,0x2
13a0: dd850513 addi a0,a0,-552 # 1dd8 <symbols.0+0x178>
13a4: f81ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13a8: 00002537 lui a0,0x2
13ac: df850513 addi a0,a0,-520 # 1df8 <symbols.0+0x198>
13b0: f75ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13b4: 00002537 lui a0,0x2
13b8: e1850513 addi a0,a0,-488 # 1e18 <symbols.0+0x1b8>
13bc: f69ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13c0: 00002537 lui a0,0x2
13c4: e3450513 addi a0,a0,-460 # 1e34 <symbols.0+0x1d4>
13c8: f5dff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13cc: 00002537 lui a0,0x2
13d0: e4c50513 addi a0,a0,-436 # 1e4c <symbols.0+0x1ec>
13d4: f51ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13d8: 00002537 lui a0,0x2
13dc: ea050513 addi a0,a0,-352 # 1ea0 <symbols.0+0x240>
13e0: f45ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13e4: 00002537 lui a0,0x2
13e8: eb050513 addi a0,a0,-336 # 1eb0 <symbols.0+0x250>
13ec: f39ff06f j 1324 <__neorv32_rte_debug_exc_handler+0x118>
13f0: 00c12083 lw ra,12(sp)
13f4: 00812403 lw s0,8(sp)
13f8: 00412483 lw s1,4(sp)
13fc: 01010113 addi sp,sp,16
1400: 00008067 ret
00001404 <neorv32_rte_exception_uninstall>:
1404: 01f00793 li a5,31
1408: 02a7e463 bltu a5,a0,1430 <neorv32_rte_exception_uninstall+0x2c>
140c: 800007b7 lui a5,0x80000
1410: 00478793 addi a5,a5,4 # 80000004 <__ctr0_io_space_begin+0x80000204>
1414: 00251513 slli a0,a0,0x2
1418: 00a78533 add a0,a5,a0
141c: 000017b7 lui a5,0x1
1420: 20c78793 addi a5,a5,524 # 120c <__neorv32_rte_debug_exc_handler>
1424: 00f52023 sw a5,0(a0)
1428: 00000513 li a0,0
142c: 00008067 ret
1430: 00100513 li a0,1
1434: 00008067 ret
00001438 <neorv32_rte_setup>:
1438: ff010113 addi sp,sp,-16
143c: 000017b7 lui a5,0x1
1440: 00112623 sw ra,12(sp)
1444: 00812423 sw s0,8(sp)
1448: 00912223 sw s1,4(sp)
144c: f9078793 addi a5,a5,-112 # f90 <__neorv32_rte_core>
1450: 30579073 csrw mtvec,a5
1454: 00000413 li s0,0
1458: 01d00493 li s1,29
145c: 00040513 mv a0,s0
1460: 00140413 addi s0,s0,1
1464: 0ff47413 andi s0,s0,255
1468: f9dff0ef jal ra,1404 <neorv32_rte_exception_uninstall>
146c: fe9418e3 bne s0,s1,145c <neorv32_rte_setup+0x24>
1470: 00c12083 lw ra,12(sp)
1474: 00812403 lw s0,8(sp)
1478: 00412483 lw s1,4(sp)
147c: 01010113 addi sp,sp,16
1480: 00008067 ret
00001484 <neorv32_rte_check_isa>:
1484: 30102673 csrr a2,misa
1488: 400007b7 lui a5,0x40000
148c: 10078793 addi a5,a5,256 # 40000100 <__crt0_copy_data_src_begin+0x3fffe160>
1490: 00f67733 and a4,a2,a5
1494: 04f70463 beq a4,a5,14dc <neorv32_rte_check_isa+0x58>
1498: fe010113 addi sp,sp,-32
149c: 00112e23 sw ra,28(sp)
14a0: 02051463 bnez a0,14c8 <neorv32_rte_check_isa+0x44>
14a4: 400005b7 lui a1,0x40000
14a8: 00002537 lui a0,0x2
14ac: 10058593 addi a1,a1,256 # 40000100 <__crt0_copy_data_src_begin+0x3fffe160>
14b0: f0850513 addi a0,a0,-248 # 1f08 <symbols.0+0x2a8>
14b4: 86dff0ef jal ra,d20 <neorv32_uart0_printf>
14b8: 01c12083 lw ra,28(sp)
14bc: 00100513 li a0,1
14c0: 02010113 addi sp,sp,32
14c4: 00008067 ret
14c8: 00c12623 sw a2,12(sp)
14cc: f00ff0ef jal ra,bcc <neorv32_uart0_available>
14d0: 00c12603 lw a2,12(sp)
14d4: fc0508e3 beqz a0,14a4 <neorv32_rte_check_isa+0x20>
14d8: fe1ff06f j 14b8 <neorv32_rte_check_isa+0x34>
14dc: 00000513 li a0,0
14e0: 00008067 ret
000014e4 <__divsi3>:
14e4: 06054063 bltz a0,1544 <__umodsi3+0x10>
14e8: 0605c663 bltz a1,1554 <__umodsi3+0x20>
000014ec <__udivsi3>:
14ec: 00058613 mv a2,a1
14f0: 00050593 mv a1,a0
14f4: fff00513 li a0,-1
14f8: 02060c63 beqz a2,1530 <__udivsi3+0x44>
14fc: 00100693 li a3,1
1500: 00b67a63 bgeu a2,a1,1514 <__udivsi3+0x28>
1504: 00c05863 blez a2,1514 <__udivsi3+0x28>
1508: 00161613 slli a2,a2,0x1
150c: 00169693 slli a3,a3,0x1
1510: feb66ae3 bltu a2,a1,1504 <__udivsi3+0x18>
1514: 00000513 li a0,0
1518: 00c5e663 bltu a1,a2,1524 <__udivsi3+0x38>
151c: 40c585b3 sub a1,a1,a2
1520: 00d56533 or a0,a0,a3
1524: 0016d693 srli a3,a3,0x1
1528: 00165613 srli a2,a2,0x1
152c: fe0696e3 bnez a3,1518 <__udivsi3+0x2c>
1530: 00008067 ret
00001534 <__umodsi3>:
1534: 00008293 mv t0,ra
1538: fb5ff0ef jal ra,14ec <__udivsi3>
153c: 00058513 mv a0,a1
1540: 00028067 jr t0
1544: 40a00533 neg a0,a0
1548: 00b04863 bgtz a1,1558 <__umodsi3+0x24>
154c: 40b005b3 neg a1,a1
1550: f9dff06f j 14ec <__udivsi3>
1554: 40b005b3 neg a1,a1
1558: 00008293 mv t0,ra
155c: f91ff0ef jal ra,14ec <__udivsi3>
1560: 40a00533 neg a0,a0
1564: 00028067 jr t0
00001568 <__modsi3>:
1568: 00008293 mv t0,ra
156c: 0005ca63 bltz a1,1580 <__modsi3+0x18>
1570: 00054c63 bltz a0,1588 <__modsi3+0x20>
1574: f79ff0ef jal ra,14ec <__udivsi3>
1578: 00058513 mv a0,a1
157c: 00028067 jr t0
1580: 40b005b3 neg a1,a1
1584: fe0558e3 bgez a0,1574 <__modsi3+0xc>
1588: 40a00533 neg a0,a0
158c: f61ff0ef jal ra,14ec <__udivsi3>
1590: 40b00533 neg a0,a1
1594: 00028067 jr t0
00001598 <strcmp>:
1598: 00b56733 or a4,a0,a1
159c: fff00393 li t2,-1
15a0: 00377713 andi a4,a4,3
15a4: 10071063 bnez a4,16a4 <strcmp+0x10c>
15a8: 7f7f87b7 lui a5,0x7f7f8
15ac: f7f78793 addi a5,a5,-129 # 7f7f7f7f <__crt0_copy_data_src_begin+0x7f7f5fdf>
15b0: 00052603 lw a2,0(a0)
15b4: 0005a683 lw a3,0(a1)
15b8: 00f672b3 and t0,a2,a5
15bc: 00f66333 or t1,a2,a5
15c0: 00f282b3 add t0,t0,a5
15c4: 0062e2b3 or t0,t0,t1
15c8: 10729263 bne t0,t2,16cc <strcmp+0x134>
15cc: 08d61663 bne a2,a3,1658 <strcmp+0xc0>
15d0: 00452603 lw a2,4(a0)
15d4: 0045a683 lw a3,4(a1)
15d8: 00f672b3 and t0,a2,a5
15dc: 00f66333 or t1,a2,a5
15e0: 00f282b3 add t0,t0,a5
15e4: 0062e2b3 or t0,t0,t1
15e8: 0c729e63 bne t0,t2,16c4 <strcmp+0x12c>
15ec: 06d61663 bne a2,a3,1658 <strcmp+0xc0>
15f0: 00852603 lw a2,8(a0)
15f4: 0085a683 lw a3,8(a1)
15f8: 00f672b3 and t0,a2,a5
15fc: 00f66333 or t1,a2,a5
1600: 00f282b3 add t0,t0,a5
1604: 0062e2b3 or t0,t0,t1
1608: 0c729863 bne t0,t2,16d8 <strcmp+0x140>
160c: 04d61663 bne a2,a3,1658 <strcmp+0xc0>
1610: 00c52603 lw a2,12(a0)
1614: 00c5a683 lw a3,12(a1)
1618: 00f672b3 and t0,a2,a5
161c: 00f66333 or t1,a2,a5
1620: 00f282b3 add t0,t0,a5
1624: 0062e2b3 or t0,t0,t1
1628: 0c729263 bne t0,t2,16ec <strcmp+0x154>
162c: 02d61663 bne a2,a3,1658 <strcmp+0xc0>
1630: 01052603 lw a2,16(a0)
1634: 0105a683 lw a3,16(a1)
1638: 00f672b3 and t0,a2,a5
163c: 00f66333 or t1,a2,a5
1640: 00f282b3 add t0,t0,a5
1644: 0062e2b3 or t0,t0,t1
1648: 0a729c63 bne t0,t2,1700 <strcmp+0x168>
164c: 01450513 addi a0,a0,20
1650: 01458593 addi a1,a1,20
1654: f4d60ee3 beq a2,a3,15b0 <strcmp+0x18>
1658: 01061713 slli a4,a2,0x10
165c: 01069793 slli a5,a3,0x10
1660: 00f71e63 bne a4,a5,167c <strcmp+0xe4>
1664: 01065713 srli a4,a2,0x10
1668: 0106d793 srli a5,a3,0x10
166c: 40f70533 sub a0,a4,a5
1670: 0ff57593 andi a1,a0,255
1674: 02059063 bnez a1,1694 <strcmp+0xfc>
1678: 00008067 ret
167c: 01075713 srli a4,a4,0x10
1680: 0107d793 srli a5,a5,0x10
1684: 40f70533 sub a0,a4,a5
1688: 0ff57593 andi a1,a0,255
168c: 00059463 bnez a1,1694 <strcmp+0xfc>
1690: 00008067 ret
1694: 0ff77713 andi a4,a4,255
1698: 0ff7f793 andi a5,a5,255
169c: 40f70533 sub a0,a4,a5
16a0: 00008067 ret
16a4: 00054603 lbu a2,0(a0)
16a8: 0005c683 lbu a3,0(a1)
16ac: 00150513 addi a0,a0,1
16b0: 00158593 addi a1,a1,1
16b4: 00d61463 bne a2,a3,16bc <strcmp+0x124>
16b8: fe0616e3 bnez a2,16a4 <strcmp+0x10c>
16bc: 40d60533 sub a0,a2,a3
16c0: 00008067 ret
16c4: 00450513 addi a0,a0,4
16c8: 00458593 addi a1,a1,4
16cc: fcd61ce3 bne a2,a3,16a4 <strcmp+0x10c>
16d0: 00000513 li a0,0
16d4: 00008067 ret
16d8: 00850513 addi a0,a0,8
16dc: 00858593 addi a1,a1,8
16e0: fcd612e3 bne a2,a3,16a4 <strcmp+0x10c>
16e4: 00000513 li a0,0
16e8: 00008067 ret
16ec: 00c50513 addi a0,a0,12
16f0: 00c58593 addi a1,a1,12
16f4: fad618e3 bne a2,a3,16a4 <strcmp+0x10c>
16f8: 00000513 li a0,0
16fc: 00008067 ret
1700: 01050513 addi a0,a0,16
1704: 01058593 addi a1,a1,16
1708: f8d61ee3 bne a2,a3,16a4 <strcmp+0x10c>
170c: 00000513 li a0,0
1710: 00008067 ret
00001714 <strlen>:
1714: 00357793 andi a5,a0,3
1718: 00050713 mv a4,a0
171c: 04079c63 bnez a5,1774 <strlen+0x60>
1720: 7f7f86b7 lui a3,0x7f7f8
1724: f7f68693 addi a3,a3,-129 # 7f7f7f7f <__crt0_copy_data_src_begin+0x7f7f5fdf>
1728: fff00593 li a1,-1
172c: 00072603 lw a2,0(a4)
1730: 00470713 addi a4,a4,4
1734: 00d677b3 and a5,a2,a3
1738: 00d787b3 add a5,a5,a3
173c: 00c7e7b3 or a5,a5,a2
1740: 00d7e7b3 or a5,a5,a3
1744: feb784e3 beq a5,a1,172c <strlen+0x18>
1748: ffc74683 lbu a3,-4(a4)
174c: ffd74603 lbu a2,-3(a4)
1750: ffe74783 lbu a5,-2(a4)
1754: 40a70733 sub a4,a4,a0
1758: 04068063 beqz a3,1798 <strlen+0x84>
175c: 02060a63 beqz a2,1790 <strlen+0x7c>
1760: 00f03533 snez a0,a5
1764: 00e50533 add a0,a0,a4
1768: ffe50513 addi a0,a0,-2
176c: 00008067 ret
1770: fa0688e3 beqz a3,1720 <strlen+0xc>
1774: 00074783 lbu a5,0(a4)
1778: 00170713 addi a4,a4,1
177c: 00377693 andi a3,a4,3
1780: fe0798e3 bnez a5,1770 <strlen+0x5c>
1784: 40a70733 sub a4,a4,a0
1788: fff70513 addi a0,a4,-1
178c: 00008067 ret
1790: ffd70513 addi a0,a4,-3
1794: 00008067 ret
1798: ffc70513 addi a0,a4,-4
179c: 00008067 ret
| 47.080964
| 95
| 0.538548
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.