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
04daa72cc6cfaefb039c7ea7ab4771355babec93
6,745
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_860.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_860.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_860.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 %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x4591, %r12 nop nop nop nop nop cmp $8700, %r13 mov $0x6162636465666768, %rcx movq %rcx, %xmm4 vmovups %ymm4, (%r12) nop xor $57663, %r8 lea addresses_WC_ht+0xa6d1, %rsi lea addresses_normal_ht+0x14c89, %rdi nop nop cmp %r13, %r13 mov $32, %rcx rep movsq nop lfence lea addresses_normal_ht+0x18791, %rsi nop nop nop nop nop add $7328, %r8 mov $0x6162636465666768, %rdi movq %rdi, (%rsi) nop nop nop nop nop lfence lea addresses_WT_ht+0x1fe7, %rsi lea addresses_WT_ht+0x11861, %rdi nop xor $29317, %r8 mov $108, %rcx rep movsw nop nop nop nop nop inc %rsi lea addresses_WT_ht+0x1df31, %rsi lea addresses_WC_ht+0x8191, %rdi nop nop nop cmp $15722, %r8 mov $75, %rcx rep movsb nop nop inc %r8 lea addresses_WC_ht+0xf911, %r12 nop nop xor %rax, %rax mov $0x6162636465666768, %r13 movq %r13, (%r12) nop nop nop nop sub $12308, %r8 lea addresses_WT_ht+0x12491, %rdi clflush (%rdi) nop sub %rax, %rax mov (%rdi), %cx cmp %rdi, %rdi lea addresses_WT_ht+0x1e991, %rax clflush (%rax) nop nop sub $44155, %rcx mov (%rax), %r8w nop xor %rcx, %rcx lea addresses_normal_ht+0x153f1, %rax nop nop cmp %r13, %r13 mov (%rax), %di nop nop nop nop nop sub %rcx, %rcx lea addresses_WT_ht+0x1e191, %r8 nop nop nop nop sub $39, %rax vmovups (%r8), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rcx nop nop nop nop nop xor $64096, %r13 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r8 push %rdx // Store lea addresses_WT+0x1f191, %r11 nop nop nop nop and %r8, %r8 movw $0x5152, (%r11) nop nop nop nop dec %r11 // Faulty Load lea addresses_WT+0x1f191, %r10 nop nop nop nop nop xor %r11, %r11 mov (%r10), %dx lea oracles, %r8 and $0xff, %rdx shlq $12, %rdx mov (%r8,%rdx,1), %rdx pop %rdx pop %r8 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT', 'congruent': 0}} {'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 0}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 6}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 11}} {'52': 21829} 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 */
34.768041
2,999
0.659007
4cf4fa675dee6bf5989022f9f5439f7f58ddb98b
184
asm
Assembly
oeis/018/A018489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/018/A018489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/018/A018489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A018489: Divisors of 500. ; Submitted by Christian Krause ; 1,2,4,5,10,20,25,50,100,125,250,500 add $0,1 mov $3,1 lpb $0 sub $0,1 dif $2,4 add $2,$3 mov $3,$2 lpe mov $0,$2
13.142857
37
0.608696
2d451f5f17811d3ffa000fb7e8b3d12821726e2b
410
asm
Assembly
asm/stackPsuh.asm
CarlosSoPe6/HanoiMIPS
5102d42a03b23ac97a68d735590d4acd56ad2277
[ "Unlicense" ]
null
null
null
asm/stackPsuh.asm
CarlosSoPe6/HanoiMIPS
5102d42a03b23ac97a68d735590d4acd56ad2277
[ "Unlicense" ]
null
null
null
asm/stackPsuh.asm
CarlosSoPe6/HanoiMIPS
5102d42a03b23ac97a68d735590d4acd56ad2277
[ "Unlicense" ]
1
2019-02-23T17:34:18.000Z
2019-02-23T17:34:18.000Z
# ------ [ stackPush ] ---------------------- # # Adds a element to the stack # param $a0: Stack ref # param $a1: Data to push stackPush: lw $t0, 0($s0) # Load the stack's reference sw $a1, 0($t0) # Store at stack's reference addi $t0, $t0, -4 # $t0 = $t0 + -4 sw $t0, 0($s0) # Store the new stack reference jr $ra # jump to $ra
34.166667
63
0.458537
807c3fafa5412bf004ac57bccd52868d9b7e87dc
1,893
asm
Assembly
08/SimpleFunction.asm
tthero/tthero-nand2tetris
fa65c171c3cf4d74dbee765dfd44de1d8dcef6a0
[ "Unlicense" ]
null
null
null
08/SimpleFunction.asm
tthero/tthero-nand2tetris
fa65c171c3cf4d74dbee765dfd44de1d8dcef6a0
[ "Unlicense" ]
null
null
null
08/SimpleFunction.asm
tthero/tthero-nand2tetris
fa65c171c3cf4d74dbee765dfd44de1d8dcef6a0
[ "Unlicense" ]
null
null
null
// function SimpleFunction.test#$ 0 (SimpleFunction.test#$) // push local 0 @LCL D=M @0 A=A+D D=M @SP A=M M=D @SP M=M+1 // push local 1 @LCL D=M @1 A=A+D D=M @SP A=M M=D @SP M=M+1 // add @SP AM=M-1 D=M A=A-1 M=M+D // neg @SP A=M-1 M=!M M=M+1 // push argument 0 @ARG D=M @0 A=A+D D=M @SP A=M M=D @SP M=M+1 // add @SP AM=M-1 D=M A=A-1 M=M+D // push argument 1 @ARG D=M @1 A=A+D D=M @SP A=M M=D @SP M=M+1 // sub @SP AM=M-1 D=M A=A-1 M=M-D // call test.test 2 @SimpleFunction.test#$$RET$0 D=A @SP A=M M=D @SP M=M+1 @LCL D=M @SP A=M M=D @SP M=M+1 @ARG D=M @SP A=M M=D @SP M=M+1 @THIS D=M @SP A=M M=D @SP M=M+1 @THAT D=M @SP A=M M=D @SP M=M+1 @5 D=A @2 D=A+D @SP D=M-D @ARG M=D @SP D=M @LCL M=D @test.test 0;JMP (SimpleFunction.test#$$RET$0) // goto END @SimpleFunction.test#$$END 0;JMP // label END (SimpleFunction.test#$$END) // return @LCL D=M @R13 M=D @R14 D=A @SP A=M M=D @SP AM=M-1 D=M @SP A=M+1 A=M M=D @ARG D=M @SP M=D @R13 D=M @1 A=D-A D=M @THAT M=D @R13 D=M @2 A=D-A D=M @THIS M=D @R13 D=M @3 A=D-A D=M @ARG M=D @R13 D=M @4 A=D-A D=M @LCL M=D @R13 D=M @5 A=D-A D=M @R13 M=D @R14 D=M @SP A=M M=D @SP M=M+1 @R13 A=M 0;JMP // function test.test 2 (test.test) @0 D=A @SP A=M M=D @SP M=M+1 @0 D=A @SP A=M M=D @SP M=M+1 // push local 0 @LCL D=M @0 A=A+D D=M @SP A=M M=D @SP M=M+1 // push local 1 @LCL D=M @1 A=A+D D=M @SP A=M M=D @SP M=M+1 // add @SP AM=M-1 D=M A=A-1 M=M+D // not @SP A=M-1 M=!M // push argument 0 @ARG D=M @0 A=A+D D=M @SP A=M M=D @SP M=M+1 // add @SP AM=M-1 D=M A=A-1 M=M+D // push argument 1 @ARG D=M @1 A=A+D D=M @SP A=M M=D @SP M=M+1 // sub @SP AM=M-1 D=M A=A-1 M=M-D // return @LCL D=M @R13 M=D @R14 D=A @SP A=M M=D @SP AM=M-1 D=M @SP A=M+1 A=M M=D @ARG D=M @SP M=D @R13 D=M @1 A=D-A D=M @THAT M=D @R13 D=M @2 A=D-A D=M @THIS M=D @R13 D=M @3 A=D-A D=M @ARG M=D @R13 D=M @4 A=D-A D=M @LCL M=D @R13 D=M @5 A=D-A D=M @R13 M=D @R14 D=M @SP A=M M=D @SP M=M+1 @R13 A=M 0;JMP
5.51895
35
0.552562
118a97a3b14ff53b4cf20982433bb320cc500c80
683
asm
Assembly
oeis/189/A189749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/189/A189749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/189/A189749.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A189749: a(1)=5, a(2)=5, a(n)=5*a(n-1) + 5*a(n-2). ; Submitted by Jamie Morken(s4) ; 5,5,50,275,1625,9500,55625,325625,1906250,11159375,65328125,382437500,2238828125,13106328125,76725781250,449160546875,2629431640625,15392960937500,90111962890625,527524619140625,3088182910156250,18078537646484375,105833602783203125,619560702148437500,3626971524658203125,21232661134033203125,124298163293457031250,727654122137451171875,4259761427154541015625,24937077746459960937500,145984195868072509765625,854606368072662353515625,5002952819703674316406250,29287795938881683349609375 lpb $0 sub $0,1 add $1,1 mov $2,$3 add $3,$1 mov $1,$2 mul $3,5 lpe mov $0,$1 mul $0,9 add $0,5
42.6875
487
0.806735
0f733d459579f4d3d32628a809aa883d188229cc
608
asm
Assembly
lab5/Lab0005-1/HW_Mult.asm
Inscrupulous/MSP430
b752776fca3829318da30b1b96809b61f9309289
[ "BSD-3-Clause" ]
null
null
null
lab5/Lab0005-1/HW_Mult.asm
Inscrupulous/MSP430
b752776fca3829318da30b1b96809b61f9309289
[ "BSD-3-Clause" ]
null
null
null
lab5/Lab0005-1/HW_Mult.asm
Inscrupulous/MSP430
b752776fca3829318da30b1b96809b61f9309289
[ "BSD-3-Clause" ]
null
null
null
;------------------------------------------------------------------------------- ; File: HW_Mult.asm (CPE 325 Lab 5) ; Function: Uses Hardware multiplier to multiply numbers ; Input: base and base^n-1 ; Output: base^n ; Author: Tyler Phillips ; Date: 09/22/20 ;------------------------------------------------------------------------------- .cdecls C,LIST,"msp430.h" ; Include device header file .def hw_mult .text hw_mult: mov 10(SP), &MPY ;move SP+10 to R5 mov 2(SP), &OP2 ;move SP+2 to R6 nop ;3 clock cycles nop nop mov RESLO, R7 ret .end
25.333333
81
0.444079
7721c6d5d9ca287827a26050f29b73e8dca37a30
106,619
asm
Assembly
base/mvdm/dos/v86/cmd/append/append.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/mvdm/dos/v86/cmd/append/append.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/mvdm/dos/v86/cmd/append/append.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
page 60,120 ;/* ; * Microsoft Confidential ; * Copyright (C) Microsoft Corporation 1991 ; * All Rights Reserved. ; */ ; .sall title APPEND include sysmsg.inc include version.inc msg_utilname<APPEND> ;----------------------------------------------------------------------------- ; ; Title: APPEND ; ; Author: G. G. A. Network version ; B. A. F.` DOS changes ; ; Syntax: From the DOS command line: ; ; APPEND [d:]path[[;[d:]path]...] ; - Used to specify the directories to be ; searched after the working directory. ; ; APPEND ; ; - Used to release all appended directories. ; ; APPEND ; - Used to show appended directories. ; ; First time only: ; ; APPEND [[d:]path | | /X | /E | /X /E] ; - [d:]path Normal support and Set path ; - Normal support ; - /X Extended support, SEARCH, FIND and EXEC ; - /E Use DOS Environment for path(s) ; ; Revision History: ; @@01 07/11/86 Fix hang in TopView start PTM P00000?? ; @@02 07/28/86 Fix APPEND size problem PTM P0000045 ; @@03 07/29/86 Fix APPEND status with /E problem PTM P00000?? ; @@04 07/30/86 Fix second APPEND hang PTM P0000053 ; @@05 08/13/86 Fix parameter error PTM P0000125 ; @@06 08/20/86 Fix APPEND xxx fails in TopView PTM P0000217 ; @@07 08/21/86 Resurrect APPEND version message PTM P0000252 ; @@08 08/21/86 APPEND=path first time hangs PTM P0000254 ; @@09 08/22/86 APPEND gets wrong path under nested COMMAND PTM P0000276 ; @@10 08/28/86 Change message for @@05 PTM P0000291 ; @@11 09/10/86 Support message profile and make ; msg length variable. R.G. PTM P0000479 ; @@12 09/25/86 Allow second external append call. (RG) PTM P0000515 ; @@13 09/30/86 APPEND gets wrong path under nested COMMAND PTM P0000600 ; Again. Fix in COMMAND now, so remove @@09 changes ; @@14 10/01/86 Lower case drive in path files PTM P0000600 ; @@15 10/06/86 Include "," and "=" in skip leading of ; argument area parsing. PTM P0000677 ; @@16 10/06/86 Fix not using full APPEND path PTM P0000794 ; @@17 12/03/86 When searching for "APPEND=" string in ; environment, make sure delimiter precedes.(RG) PTM P0000893 ; ;------------------------------------------------------------------- ; ; AN000 3.30 changes, GGA 6/87 new code. P000 ; AN001 Support DRIVE and PATH modes D043 ; AN002 Add truename function P1276 ; AN003 Add extended handle open function D250 ; AN005 ; AN006 Add DBCS support ; AN007 Release Environmental Vector space P2666 ; AN008 Allow equal symbol with append - APPEND=A:/1; P2901 ; AN009 Release Environmental Vector on only the P3333 ; first invocation of APPEND ; AN010 display invalid parm from command line P3908 ; ; ;----------------------------------------------------------------------------- ;Date Rev Comments ;----------------------------------------------------------------------------- ;06-02-86 0.0 Begin conversion to PC/DOS version ;06-20-86 0.0 End conversion to PC/DOS version ; page cseg segment public para 'CODE' assume cs:cseg assume ds:nothing,es:nothing ;----------------------------------------------------------------------------- ; Equates ;----------------------------------------------------------------------------- .xlist ;include fsi.lib NETSYSUTIL EQU 0C2H ; SYSTEM UTILITIES NETENQ EQU 07H ; ENQ RESOURCE NETDEQ EQU 08H ; DEQ RESOURCE ;include task.lib TCBR_APPEND EQU 001H ; APPEND ACTIVE ;include DOS.lib DOSSERVER EQU 5DH ; SERVER OPERATION DOSSETERROR EQU 0AH ; SET EXTENDED ERROR ;include server.lib DPL STRUC DPL_AX DW 0 ;AX REG DPL_BX DW 0 ;BX REG DPL_CX DW 0 ;CX REG DPL_DX DW 0 ;DX REG DPL_SI DW 0 ;SI REG DPL_DI DW 0 ;DI REG DPL_DS DW 0 ;DS REG DPL_ES DW 0 ;ES REG DPL_XID DW 0 ;RESERVED DPL_UID DW 0 ;SERVER USER ID DPL_PID DW 0 ;REDIRECTOR PROCESS ID DPL ENDS include sysmac.lib include versiona.inc include appendp.inc ; parseing stuff for append ;AN004; .list ; extrn end_address:near ; end of stay resident stuff ; extrn bad_append_msg:byte ; messages ; extrn path_error_msg:byte ; extrn parm_error_msg:byte ; extrn path_parm_error_msg:byte ; extrn no_append_msg:byte ; @@05 ; extrn append_assign_msg:byte ; extrn append_TV_msg:byte ; @@01 ; extrn bad_DOS_msg:byte ; extrn second_APPEND_msg:byte ; @@04 ; extrn len_bad_append_msg:word ;@@11 ; extrn len_path_error_msg:word ;@@11 ; extrn len_parm_error_msg:word ;@@11 ; extrn len_path_parm_error_msg:word ;@@11 ; extrn len_no_append_msg:word ;@@11 ; extrn len_append_assign_msg:word ;@@11 ; extrn len_append_TV_msg:word ;@@11 ; extrn len_bad_DOS_msg:word ;@@11 ; extrn len_second_APPEND_msg:word ;@@11 ; Environmental Vector PSP_Env equ 2ch ;Environmental vector segment in PSP ;an007; dms; ; Interrupts DOS_function equ 21h ; DOS function call interrupt int_function equ 2fh ; DOS internal function interrupt, used ; to verify APPEND presence termpgm equ 20h ; @@05 resident equ 27h ; Function calls get_vector equ 3521h ; DOS function call to get INT 21 vector set_vector equ 2521h ; DOS function call to set INT 21 vector get_intfcn equ 352fh ; DOS function call to get INT 2f vector set_intfcn equ 252fh ; DOS function call to set INT 2f vector get_version equ 30h ; DOS function call to get DOS version number get_DTA equ 2fh ; DOS function get DTA set_DTA equ 1ah ; DOS function set DTA get_crit_err equ 3524h ; DOS function call to get INT 24 vector set_crit_err equ 2524h ; DOS function call to set INT 24 vector get_PSP equ 62h ; DOS function call to get PSP address Free_Alloc_Mem equ 49h ; DOS function call to free alloc. mem. ;an007; dms; print_string equ 09h ; DOS function call to get print a string ctrl_break equ 33h ; DOS function call to get/set ctrl-break awrite equ 40h ; write function get_dir equ 47h ; get current dir change_dir equ 3bh ; change dir get_disk equ 19h ; get current disk change_disk equ 0eh ; change disk term_stay equ 31h ; terminate a process and stay resident term_proc equ 4ch ; terminate a process redir_flag equ 0000000000001000B ; redir flag for net installation check ; DOS INT 2f function for APPEND presence append_2f equ 0b7h ; int 2f function code for append applic_2f equ 0aeh ; int 2f function code for applications COMMAND_2f equ -1 ; int 2f subfunction code for COMMAND call append_inst equ 0ffh ; flag means append is there ; INT 2f sub-function codes ;AN000; are_you_there equ 0 ; function code for presence check old_dir_ptr equ 1 ; means APPEND 1.0 is trying to run get_app_version equ 2 ; fun code for get ver request tv_vector equ 3 ; fun code for set TV vector dir_ptr equ 4 ; function code to return dirlist ptr get_state equ 6 ; function code to return append ;AN001; ; state ;AN001; set_state equ 7 ; function code to set append ;AN001; ; state ;AN001; DOS_version equ 10h ; function call to get DOS version true_name equ 11h ; one-shot truename fcn for ASCIIZ ops ;AN002; ; DOS INT 21 function calls that APPEND traps FCB_opn equ 0fh file_sz equ 23h handle_opn equ 3dh dat_tim equ 57h FCB_sch1 equ 11h handle_fnd1 equ 4eh exec_proc equ 4bh ext_handle_opn equ 6ch ;AN003; break macro ; this is a dummy break macro so PDB.INC endm ; won't blow up in the build ; define some things for PDB (PSP) ;AN002; ;AN002; include pdb.inc ;AN002; ;AN002; true_name_flag equ 01h ; flag for true name function ;AN002; eo_create equ 00f0h ; mask to check extended opens for create ;AN003; ; Error codes that don't mean stop looking FCB_failed equ 0ffh ; FCB open failed FCB_file_not_found equ 2 ; file not found on FCB open handle_file_not_found equ 2 ; file not found on handle open handle_path_not_found equ 3 ; path not found on handle open FCB_no_more_files equ 18 ; no more matching files handle_no_more_files equ 18 ; no more matching files ; Equates for TOPVIEW barrier TV_TRUE equ -1 ; this was changed from TRUE ;AN000; ; because 3.30 parser uses TRUE ;AN000; false equ 0 ; ; Message equates tab_char equ 9 cr equ 13 lf equ 10 beep equ 7 STDOUT equ 0001h ; standard output file STDERR equ 0002h ; standard error file null equ 0 MSG_OPTIONS_FIRST equ 300 MSG_OPTIONS_LAST equ 316 page ;----------------------------------------------------------------------------- ; Resident data area ;----------------------------------------------------------------------------- version_loc: ; version number db major_version,minor_version ; dw message_list ; pointer to message table even vector_offset dw 0 ; save pointer to old int 21 here vector_segment dw 0 crit_vector_offset dw 0 ; save pointer to old int 24 here crit_vector_segment dw 0 intfcn_offset dw 0 ; save pointer to old int 2f here intfcn_segment dw 0 dirlst_offset dw 0 ; save pointer to dir list here dirlst_segment dw 0 tv_vec_off dw 0 ; save TV vector here tv_vec_seg dw 0 pars_off dd cseg: SysParse ; save pointer to parser here ;pars_off dw offset SysParse ; save pointer to parser here ;pars_seg dw 0 app_dirs_seg dw 0 ; save ES here during FCB FCB_ptr dd 0 ; save pointer to FCB here handle_ptr dd 0 ; save pointer to ASCIIZ string here stack_offset dw 0 stack_segment dw 0 ; Calling process stack incoming_AX dw 0 ; AX saved at entry to interrupt handler incoming_CX dw 0 ; CX saved at entry to interrupt handler ; must be together incoming_BX dw 0 ; BX saved at entry to interrupt handler incoming_ES dw 0 ; ES saved at entry to interrupt handler ; must be together ax_after_21 dw 0 ; AX saved after call to real INT 21 ; temp_DS_save dw 0 ; DS saved during stack ops temp_CS_save dw 0 ; CS saved during stack ops (set_return_flags) temp_IP_save dw 0 ; IP saved during stack ops (set_return_flags) FCB_drive_id db 0 ; save the drive id for FCB opens here ;------------------------ ; DBCS stuff here ;AN006; ;AN006; DBCSEV_OFF DW 0 ; OFFSET OF DBCS EV ;AN006; DBCSEV_SEG DW 0 ; SEGMENT OF DBCS EV ;AN006; ;AN006; ;DEFAULT DBCS ENVIRONMENTAL VECTOR ;AN006; EVEV DB 00H,00H ;AN006; DB 00H,00H ;AN006; DB 00H,00H ;AN006; ;AN006; dbcs_fb dw 0 ; offset of DBCS first byte chars found ;------------------------ initial_pass dw 0 ; flag used to indicate inital APPEND ;AN007; incoming_DX dw 0 ; used for saves for extended open ;AN003; incoming_SI dw 0 ; used for saves for extended open ;AN003; incoming_DI dw 0 ; used for saves for extended open ;AN003; incoming_DS dw 0 ; used for saves for extended open ;AN003; true_name_count dw 0 ; used to save number of chars in true_name dir ;AN003; int_save_ip dw 0 ; save registers here during critical int_save_cs dw 0 ; error handler stack ops work_disk db "?:\" ; user's working disk work_dir db 64 dup(" ") ; user's working dir app_disk db "?:\" ; user's working disk app_dir db 64 dup(" ") ; user's append disk's working dir ctrl_break_state db 0 ; save the old ctrl-break state here end_search db 0 ; end search flag try_dir db 128 dup (0) ; try this dir fname db 15 dup (0) ; 8.3 filename stripped from original ; ASCIIZ string app_dirs_ptr dw 0 ; pointer to appended dir to try set_name db "SET " ; SET command ; must be together setappend_name db "SET " ; SET command append_id db "APPEND=" ; display from here for user ; must be together app_dirs db ";" db 128 dup (0) ; area for storing appended dirs db 0 ; just to insure that the last dir is null terminated semicolon db ";",0 ; null list ; Flags / barriers added for TopView tv_flag db 0 ; flag to indicate re-entr from TopView parse_flag db 0 ; flag used by APPEND parsing FCB_ext_err db 0 ; flag used to indicate that FCB ; open failed and ext err was done crit_err_flag db 0 ; flag used to indicate that a critical ; error happened ext_err_flag db 0 ; flag used to indicate that ext err ; must be set 0 = don't set, 1 = do set in_middle db 0 ; flag used to tell if we made it to ; middle of string before finding a space equal_found db 0 ; multiple = check ;crit_sect_flag db 0 ; critical section flag stack_area dw 99 dup(0) ; stack area for append append_stack dw 0 net_config dw 0 ; flag word for what (if any) network ; config we are running under ; as long as this word is zero, a clear determination ; has not been made about the configuration even ext_err_dpl DPL <> ; reserve a DPL for get/set extended error code save_ext_err DPL <> ; reserve a DPL for first extended ; error code ;------------------------------------------------------------------- ;AN001; ; ;AN001; ; mode_flags This status word is used to control the various ;AN001; ; APPEND functions and modes. ;AN001; ; ;AN001; ;------------------------------------------------------------------- ;AN001; mode_flags dw Path_mode + Drive_mode + Enabled ;AN001; ; mode control flags ;AN001; ; initially - path, drive and ;AN001; ; enabled ;AN001; ; equates for mode_flags follow: ;AN001; X_mode equ 8000h ; in /X mode E_mode equ 4000h ; in /E mode Path_mode equ 2000h ; PATH in string OK ;AN001; Drive_mode equ 1000h ; DRIVE in string OK ;AN001; Enabled equ 0001h ; APPEND enabled ;AN001; ;------------------------------------------------------------------- cmd_name@ dd ? ; internal name string expected_error dw ? ; error to do append scan expected_ext_error dw ? ; error to do append scan cmd_env dw ? ; pointer to COMMANDs environment cmd_buf dw ? ; CMDBUF offset (in SS) incoming_DTA dd ? ; user's DTA (on EXEC) exec_DTA db 21+1+2+2+2+2+13 dup(0) ; find DTA for exec emulation old_syntax db 0 ; using network syntax res_append db 0 ; resident append call ; @@05 abort_sp dw ? ; sp to restore on errors ; @@05 crlf label byte db CR,LF crlf_len equ $ - crlf ;******************************************************************* ;an010;bgb ; parser message display area ;an010;bgb ;******************************************************************* ;an010;bgb inv_parm db 0bh ;length ;an010;bgb db 0 ;reserved ;an010;bgb si_off dw 0 ;put offset of command line here ;an010;bgb si_seg dw 0 ;put segment of command line here ;an010;bgb db 0 ;use percent zero ;an010;bgb db Left_Align+Char_Field_ASCIIZ ;type of data ;an010;bgb db 128 ;max width ;an010;bgb db 1 ;min width ;an010;bgb db ' ' ;pad char ;an010;bgb ;------------------------------------------------------------------- ; ; resident message area ; ;------------------------------------------------------------------- MSG_SERVICES <MSGDATA> MSG_SERVICES <DISPLAYmsg,CHARmsg> ;an010;bgb MSG_SERVICES <APPEND.CLA,APPEND.CL1,APPEND.CTL> .xlist ;----------------------------------------------------------------------------- ; macros ;----------------------------------------------------------------------------- ;----------------------------- ; save and restore register macros save_regs macro push bx push cx push dx push di push si push ds push es endm restore_regs macro pop es pop ds pop si pop di pop dx pop cx pop bx endm ;----------------------------- ; this macro is used instead of the normal POPF instruction to help ; prevent a 286 bug from occurring popff macro local myret jmp $+3 myret label near iret push cs call myret endm ;----------------------------- ; @@12 ; check character ; @@12 ; ; @@12 chkchar macro char ; @@12 lodsb ; @@12 and al,0dfh ; @@12 cmp al,char ; @@12 jne ccn_ret ; @@12 endm ; @@12 .list page ;----------------------------------------------------------------------------- ; resident routine - control transferred here on INT 21 ; check to see if this call has a function code we are interested in ;----------------------------------------------------------------------------- tv_entry: pushf ; @@01 jmp SHORT check_fcb_open ; @@01 interrupt_hook: resident_routine: pushf ; save the user's flags (old stack) cmp tv_flag,TV_TRUE ; see if in TV ;AN000; je use_old ; yes, old_vect check_fcb_open: ; @@01 ;------------------------------------------------------------------- ;AN001; ; first, check to see if APPEND disabled, if so, skip everything ;AN001; ; and go to real INT 21 handler ;AN001; ;------------------------------------------------------------------- ;AN001; test mode_flags,Enabled ; APPEND disabled? ;AN001; jz real_jump ; yes, skip all other checks ;AN001; cmp ah,FCB_opn ; FCB open? jump E,FCB_open ; yes, do the APPEND cmp ah,handle_opn ; handle open? jump E,handle_open ; yes, do the APPEND cmp ah,ext_handle_opn ; extended handle open? ;AN003; jump E,ext_handle_open ; yes, do the APPEND ;AN003; ;AN003; cmp ah,file_sz ; file size? je FCB_open ; yes, do the APPEND test mode_flags,X_mode ; /X mode not selected jz real_jump call IsItFCB_FindFirst? je FCB_search1 ;------ following two lines replaced by the above to lines of code Bug #121 ; cmp ah,FCB_sch1 ; search? ; jump E,FCB_search1 ; yes, do the APPEND ;-------------------------------------------------------------------------- call IsItHandle_FindFirst? jump E, handle_find1 ;------ following two lines replaced by the above to lines of code Bug #121 ; cmp ah,handle_fnd1 ; find? ; jump E,handle_find1 ; yes, do the APPEND ;-------------------------------------------------------------------------- cmp tv_flag,TV_TRUE ; cant do in TopView ;AN000; je skip_exec cmp ax,exec_proc*256+0 ; EXEC? jump E,exec_pgm ; yes, do the APPEND skip_exec: cmp ax,exec_proc*256+3 ; EXEC? jump E,exec_pgm ; yes, do the APPEND page ;----------------------------------------------------------------------------- ; By here, we know that the call was not one we are interested in, ; pass through to old INT 21. ; Since this is done with a jmp, control will pass back to original caller ; after DOS is finished. ;----------------------------------------------------------------------------- real_jump: cmp tv_flag,TV_TRUE ; see if called by TV ;AN000; jne use_old ; yes, use old vect popff ; restore user's flags jmp dword ptr tv_vec_off ; pass through to TV use_old: popff ; restore user's flags (old stack) jmp dword ptr Vector_Offset ; jump to old INT 21 page ;----------------------------------------------------------------------------- ; New functions added to resolve Bug #121 ; IsItFCB_FindFirst? ; IsItHandle_FindFirst? ;----------------------------------------------------------------------------- VOL_LABEL equ 08h IsItFCB_FindFirst? proc near cmp ah, FCB_sch1 ; search? jne not_FCB_FindFirst push bx mov bx, dx ; ds:bx == ptr to FCB cmp byte ptr [bx], 0ffh ; extended FCB ? jne FCB_FindFirst test byte ptr [bx+6], VOL_LABEL ; search for label ? pop bx ret FCB_FindFirst: pop bx ; restore BX (bug #1027) cmp al, al not_FCB_FindFirst: ret IsItFCB_FindFirst? endp ; ;----------------- This routine can be made in line MOHAN ; IsItHandle_FindFirst? proc near cmp ah, handle_fnd1 ; handle find ? jne not_Handle_FindFirst test cl, VOL_LABEL not_Handle_FindFirst: ret IsItHandle_FindFirst? endp ; page ;----------------------------------------------------------------------------- ; FCB_search1 - this routine handles FCB search first calls ;----------------------------------------------------------------------------- FCB_search1: mov expected_ext_error,fcb_no_more_files jmp short FCB_openx1 ;----------------------------------------------------------------------------- ; FCB_open - this routine handles FCB open calls ;----------------------------------------------------------------------------- FCB_open: mov expected_ext_error,fcb_file_not_found FCB_openx1: call check_config ; check the config flags call crit_sect_set ; set critical section flag call tv_barrier mov incoming_AX,ax ; save user's AX mov word ptr FCB_ptr+0,dx ; save FCB pointer mov word ptr FCB_ptr+2,ds popff ; restore user's flags call int_21 ; try the open cli mov AX_after_21,ax ; save AX as it came back from INT pushf ; save flags from operation cmp al,FCB_failed ; open failed ? je check_error ; yes, lets check extended error jmp set_return_flags ; no, fix the stack, then ret to caller check_error: call get_ext_err_code ; get the extended error code mov FCB_ext_err,1 ; set FCB ext error call save_first_ext_err ; save first extended error code mov ax,ext_err_dpl.DPL_AX ; get error in ax cmp ax,expected_ext_error ; file not found? je FCB_openx2 ; yes, lets look around for file lea dx,save_ext_err ; call set_ext_err_code ; set the extended error code jmp set_return_flags ; no, fix the stack, then return FCB_openx2: ; set up APPEND's stack popff ; get rid of the flags from the ; real operation ; mov temp_DS_save,ds ; Save DS reg mov stack_segment,ss ; Save it mov stack_offset,sp ; Save it mov ax,cs ; Get current segment mov ss,ax ; and point stack seg here lea sp,append_stack ; set up new stack save_regs ; save registers push cs ; establish addressability pop ds call ctrl_break_set ; set ctrl-break handler call crit_err_set ; set crit err handler mov ext_err_flag,1 ; flag for setting critical error ; fix FCB drive spec les bx,dword ptr FCB_ptr ; ES:BX points to FCB mov ah,ES:byte ptr [bx] ; get FCB drive spec cmp ah,-1 ; extended FCB? jne not_ext_FCB1 add bx,1+5+1 ; point to real drive letter mov ah,ES:byte ptr [bx] ; get FCB drive spec not_ext_FCB1: mov FCB_drive_id,ah ; save it for later mov ES:byte ptr [bx],0 ; zero the drive field out to ; use default drive mov ah,get_disk ; get disk call int_21 ; call DOS INT 21 handler add al,"A" ; make it a character mov work_disk,al ; save it mov ah,get_dir ; get directory xor dx,dx ; default drive lea si,work_dir ; save area call int_21 ; call DOS INT 21 handler call address_path ; get address of path cmp es: byte ptr [di],";" ; is the append list null? jump E,null_list ; exit append mov app_dirs_seg,es ; save app dirs segment mov si,di ; source try_another1: lea di,try_dir ; destination call get_app_dir ; copy dir to try into try_dir mov app_dirs_ptr,si ; save updated pointer ;----------------------------- try_app_dir1: mov app_disk,0 ; zero for current dir cmp try_dir+1,":" ; see if we have a drive jne no_drive ; char should be a colon ; yes, there was a drive specified, must do the change disk function call mov ah,change_disk ; change disk mov dl,try_dir ; get the char representation of the drive mov app_disk,dl ; save it away for later use call cap_dl sub dl,"A" ; convert from char to drive spec call int_21 ; call DOS INT 21 handler ; jc check_end_dir_list ; there was an error, see if there is ; another to try cmp crit_err_flag,0 ; did we experience a critical error jne set_err_code ; yes, fake a file_not_found no_drive: mov ah,get_dir ; get directory xor dx,dx ; default drive lea si,app_dir ; save area call int_21 ; call DOS INT 21 handler ; check to see if there was a critical error cmp crit_err_flag,0 ; did we experience a critical error je cd_worked ; no, the cd worked jmp short set_err_code save_regs_and_set: pushf ; save everything again save_regs push cs ; re-establish addressability pop ds ; ds = cs set_err_code: xor ah,ah ; make ax look like open failed mov al,FCB_failed mov ax_after_21,ax ; save it away so we can restore it below jmp no_more_to_try cd_worked: lea dx,try_dir ; point dx to dir to try mov ah,change_dir ; change dir to appended directory call int_21 ; call DOS INT 21 handler ; try the open in this dir restore_regs ; make regs look like when user mov ax,incoming_AX ; called us call int_21 ; call DOS INT 21 handler mov ax_after_21,ax ; save AX cmp crit_err_flag,0 ; did we get critical error? jne save_regs_and_set ; yes, fake a file_not_found cmp al,FCB_failed ; did open work? jne open_ok call get_ext_err_code ; get the extended error code open_ok: pushf ; save everything again save_regs push cs ; re-establish addressability pop ds ; ds = cs ; restore user's working disk and restore the dir on the appended drive mov ah,change_disk ; change disk back to our original mov dl,work_disk call cap_dl sub dl,"A" ; convert from char to drive spec call int_21 ; call DOS INT 21 handler mov ah,change_dir ; change dir lea dx,app_disk ; save area (this time include drive) call int_21 ; call DOS INT 21 handler ; this is for ..\dirname ptr mov ah,change_dir ; change dir lea dx,work_disk ; save area (this time include drive) call int_21 ; call DOS INT 21 handler mov ax,ax_after_21 ; restore AX cmp al,FCB_failed ; did open work? jne FCB_open_worked mov ax,ext_err_dpl.DPL_AX cmp ax,expected_ext_error jne no_more_to_try ; not file not found check_end_dir_list: mov es,app_dirs_seg ; restore es mov si,app_dirs_ptr cmp si,null ; should we try again? je no_more_to_try ; no jmp try_another1 ; yes FCB_open_worked: mov byte ptr ext_err_flag,0 ; the open worked, no need to set ext err code jmp short set_disk no_more_to_try: ; restore user's working disk and dir ; The following code up to label "null_list" which ; restores the user's drive and path was moved in front ; of the code to restore the drive spec in FCB. ; mov ah,change_disk ; change disk mov dl,work_disk call cap_dl sub dl,"A" ; convert from char to drive spec call int_21 ; call DOS INT 21 handler mov ah,change_dir ; change dir lea dx,work_disk ; save area (this time include drive) call int_21 ; call DOS INT 21 handler null_list: mov ah,FCB_drive_id ; get FCB drive spec ; cmp ah,0 ; did they ask for default drive? ; je fix_drive_spec ; yes, leave it alone jmp short fix_drive_spec set_disk: ; set drive number in FCB mov ah,work_disk ; no, give them the found drive spec sub ah,"A"-1 ; convert from char to drive spec ; ah has proper drive spec to put into FCB, do it fix_drive_spec: les bx,dword ptr FCB_ptr ; ES:BX points to FCB cmp ES:byte ptr[bx],-1 ; extended FCB jne not_ext_FCB2 ; put in the proper drive spec add bx,1+5+1 ; point to real drive letter not_ext_FCB2: mov ES:byte ptr [bx],ah call ctrl_break_restore call crit_err_restore ; find out if there is a need to set the extended error code cmp ext_err_flag,0 ; do we need to set the extended error code? je no_ext_err ; no, finish up lea dx,ext_err_dpl cmp FCB_ext_err,0 je handle_ext_err lea dx,save_ext_err handle_ext_err: call set_ext_err_code ; yes, go set the ext error info ; all done with append, clean things back up for the user no_ext_err: restore_regs ; restore registers jmp reset_stack ; fix stack, ret to caller page ;----------------------------------------------------------------------------- ; handle_find - APPEND handle find function ;----------------------------------------------------------------------------- handle_find1: mov incoming_CX,cx ; save user's CX mov expected_error,handle_no_more_files ; mov expected_ext_error,handle_no_more_files jmp short handle_openx ;----------------------------------------------------------------------------- ; exec_pgm - APPEND exec program function ;----------------------------------------------------------------------------- exec_pgm: mov incoming_BX,bx ; save user's ES:BX mov incoming_ES,es mov expected_error,handle_file_not_found ; mov expected_ext_error,handle_no_more_files jmp short handle_openx ;----------------------------------------------------------------------------- ;AN003; ; ext_handle_open - APPEND extended handle open function ;AN003; ;----------------------------------------------------------------------------- ;AN003; ext_handle_open: ;AN003; test dx,eo_create ; does this call specify create? ;AN003; jz no_eo_create ; no, we can continue ;AN003; ;AN003; jmp real_jump ; yes, do nothing but pass on to real ;AN003; ; INT 21 handler ;AN003; ;AN003; ; getting here means the caller did not specify the create option ;AN003; ;AN003; no_eo_create: ;AN003; ;AN003; mov incoming_BX,bx ; save user's registers ;AN003; mov incoming_CX,cx ; extended open sure does use a lot ;AN003; mov incoming_DX,dx ; of registers ;AN003; mov incoming_SI,si ;AN003; mov incoming_DI,di ;AN003; mov incoming_ES,es ;AN003; mov incoming_DS,ds ;AN003; ;AN003; mov expected_error,handle_file_not_found ;AN003; jmp short handle_openx ; for now ... ;AN003; ;AN003; ;----------------------------------------------------------------------------- ; handle_open - APPEND handle open function ;----------------------------------------------------------------------------- handle_open: mov expected_error,handle_file_not_found ; mov expected_ext_error,handle_file_not_found handle_openx: call check_config ; check the config flags call crit_sect_set ; set critical section flag call tv_barrier ; no op on exec mov incoming_AX,ax ; save user's AX mov word ptr handle_ptr+0,dx ; save path pointer mov word ptr handle_ptr+2,ds popff ; restore user's flags call int_21 ; try the open cli mov AX_after_21,ax ; save AX as it came back from INT pushf ; save flags from operation ; find out if we had an error, and if so was it the one we were ; looking for jc what_happened ; yes, lets find out what happened mov incoming_AX,-1 ; insure no exec done later jmp set_return_flags ; no, fix the stack, then ret to caller ; this means that the real call worked, ; APPEND does not need to do anything what_happened: ; cmp ax,handle_path_not_found ; normal errors ; je handle_search ; yes, look for the file cmp ax,expected_error ; was the error file not found? je handle_search ; yes, look for the file jmp set_return_flags ; no, fix the stack, then ret to caller handle_search: call get_ext_err_code ; get the extended error code information ; set up APPEND's stack popff ; get rid of the flags from the ; real operation ; mov temp_DS_save,ds ; Save DS reg mov stack_segment,ss ; Save it mov stack_offset,sp ; Save it mov ax,cs ; Get current segment mov ss,ax ; and point stack seg here lea sp,append_stack ; set up new stack save_regs ; save registers pushf ; push cs ; establish addressability pop ds call crit_err_set call ctrl_break_set ; all done with the prep stuff, let's get down to business ;------------------------------------------------------------------- ;AN001; ; ;AN001; ; before doing anything else, check DRIVE and PATH modes ;AN001; ; ;AN001; ;------------------------------------------------------------------- ;AN001; ; ;AN001; pushf ; save flags ;AN001; push ax ; save AX ;AN001; ;AN001; cmp incoming_AX,exec_proc*256 ; is this call an exec? je drive_and_path_ok ;------------------------------------------------------------------- ; Set up ES:SI to point to incoming string ;------------------------------------------------------------------- cmp incoming_AX,ext_handle_opn*256+0 ;is this call an ext open? ;AN003; jne no_eo13 ;AN003; mov si,incoming_SI ; DS:SI points to original name for ex open ;AN003; mov es,incoming_DS ; but this code wants ES:SI to point to it ;AN003; lea di,fname ; DS:DI points to fname area ;AN003; jmp SHORT eo_skip3 ; skip the old stuff ;AN003; ;AN003; no_eo13: ;AN003; les si,dword ptr handle_ptr ; ES:SI points to original handle lea di,fname ; DS:DI points to fname area eo_skip3: ;------------------------------------------------------------------- test mode_flags,Drive_mode ; Drive_mode enabled? jnz check_path_mode ; yes, go check path mode call check_for_drive ; no, find out if there is a drive ; specified cmp ax,0 ; was there a drive letter? je check_path_mode ; no, go check path mode ;------------------------------------------------------------------- ; getting here means that Drive_mode is disabled and that a drive letter ; was found. This means we give up on this APPEND operation jmp SHORT drive_or_path_conflict check_path_mode: test mode_flags,Path_mode ; Path_mode enabled? jnz drive_and_path_ok ; yes, go do the APPEND function call check_for_path ; no, find out if there is a path ; specified cmp ax,0 ; was there a path? jne drive_or_path_conflict ; no, go do the APPEND function call check_for_drive ; no, find out if there is a drive ; specified cmp ax,0 ; was there a drive letter? je drive_and_path_ok ; no, everything is OK ; yes, fall through and exit w/error ;------------------------------------------------------------------- ;AN001; ; getting here means that Drive_mode is disabled and that a drive ;AN001; ; letter was found. This means we give up on this APPEND operatio ;AN001; n drive_or_path_conflict: pop ax ; clean up stack popff ; restore_regs ; restore some regs ;AN002; ; pop ax mov ext_err_flag,1 ; we need to set extended error info mov ax,expected_error ; make ax look like we got file not found mov ax_after_21,ax ; save it away so we can restore it below popff ; get flags from stack stc ; set the carry flag pushf ; put 'em back jmp no_more_to_try2 drive_and_path_ok: ;AN001; pop ax ; restore AX ;AN001; popff ; restore flags ;AN001; ;AN001; ;------------------------------------------------------------------- ;AN001; ; end of code to check DRIVE and PATH modes ;AN001; ;------------------------------------------------------------------- ;AN001; cmp incoming_AX,ext_handle_opn*256+0 ;is this call an ext open? ;AN003; jne no_eo1 ;AN003; mov si,incoming_SI ; DS:SI points to original name for ex open ;AN003; mov es,incoming_DS ; but this code wants ES:SI to point to it ;AN003; lea di,fname ; DS:DI points to fname area ;AN003; jmp SHORT eo_skip1 ; skip the old stuff ;AN003; ;AN003; no_eo1: ;AN003; les si,dword ptr handle_ptr ; ES:SI points to original handle lea di,fname ; DS:DI points to fname area eo_skip1: ;AN003; call get_fname ; strip just the 8.3 filename from ; the original ASCIIZ string call address_path ; address the path cmp es: byte ptr [di],";" ; is append list null ? jump E,no_more_to_try2 ; exit append popff ; mov si,di ; pointer to list of appended directories pushf ; push flags onto stack just for the ; popff below try_another2: popff lea di,try_dir ; buffer to be filled with dir name ; to try push cx ; save CX call get_app_dir ; this routine will return with a dir ; to try in try_dir mov true_name_count,cx ; save number of chars for later us ;AN003; pop cx mov app_dirs_ptr,si ; save updated pointer ;----------------------------- try_app_dir2: call append_fname ; glue the filename onto the end of the dir to try ; we now have an ASCIIZ string that includes the original 8.3 filename ; and one of the appended dir paths mov ax,incoming_AX mov cx,incoming_CX lea dx,try_dir ; point to new ASCIIZ string cmp incoming_AX,ext_handle_opn*256+0 ; extended open? ;AN003; jne not_eo1 ;AN003; ;AN003; ; this is an extended open call ;AN003; ;AN003; save_regs ;AN003; ;AN003; mov si,dx ; ext open wants DS:SI -> filename ;AN003; push cs ;AN003; pop ds ;AN003; ;AN003; mov ax,incoming_AX ; function code ;AN003; mov bx,incoming_BX ; mode word ;AN003; mov cx,incoming_CX ; attributes ;AN003; mov dx,incoming_DX ; flags ;AN003; mov es,incoming_ES ; ES:DI parm_list pointer ;AN003; mov di,incoming_DI ;AN003; ;AN003; call int_21 ; try the extended open ;AN003; ;AN003; restore_regs ;AN003; pushf ; save flags ;AN003; ; mov es,incoming_ES ; restore es as it was ;AN003; jmp SHORT not_exec2 ; go find out what happened ;AN003; ;AN003; ;AN003; not_eo1: ;AN003; cmp incoming_AX,exec_proc*256+0 ; exec pgm call jne not_exec1 ; this is an exec call ;AN003; push es push bx mov ah,get_DTA call int_21 mov word ptr incoming_DTA+0,bx ; save callers DTA mov word ptr incoming_DTA+2,es pop bx pop es push ds push dx mov ah,set_DTA lea dx,exec_DTA ; set for fake exec search push cs pop ds call int_21 pop dx pop ds mov ah,handle_fnd1 ; precess search by finds mov expected_error,handle_no_more_files not_exec1: push es ; save append's ES push bx ; save append's BX mov es,incoming_ES ; must restore ES before doing the call ; fix for P37, GGA 9/10/87 mov bx,incoming_BX ; must resatore user's ES:BX call int_21 ; try the open pop bx ; restore append's BX pop es ; restore append's es pushf ; save flags cmp incoming_AX,exec_proc*256+0 ; exec pgm call jne not_exec2 push ds push dx push ax mov ah,set_DTA mov dx,word ptr incoming_DTA+0 ; restore callers DTA mov ds,word ptr incoming_DTA+2 call int_21 pop ax pop dx pop ds not_exec2: popff pushf jnc found_it_remote ; all done cmp crit_err_flag,0 ; process critical errors jne check_crit_err cmp ax,handle_path_not_found ; normal errors je should_we_look_more cmp ax,expected_error ; was the error we found file not found? je should_we_look_more ; yes, look some more jmp no_more_to_try2 ; no, any other error, we pack it in should_we_look_more: mov si,app_dirs_ptr ; yes, see if we should look more cmp si,null ; should we try again? je no_more_to_tryx jmp try_another2 ; yes no_more_to_tryx: jmp no_more_to_try2 check_crit_err: mov ext_err_flag,1 ; we need to set extended error info mov ax,expected_error ; make ax look like we got file not found mov ax_after_21,ax ; save it away so we can restore it below popff ; get clags from stack stc ; set the carry flag pushf ; put 'em back jmp no_more_to_try2 found_it_remote: ; come here only if the file was found in ; an appended directory mov ax_after_21,ax ; save AX ; ;AN002; ; Find out if this process has the true_name flag set in thier PSP. ;AN002; ; At this point, DS:DX points to the true name of the found file ;AN002; ; ;AN002; ;AN002; push ax ; save some regs ;AN002; save_regs ;AN002; mov ah,get_PSP ; function code for get PSP operation ;AN002; call int_21 ; get the PSP, segment returned in BX ;AN002; mov es,bx ; need to use it as a segment ;AN002; mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002; ;AN002; mov ax,es:[di] ; get APPEND flag into AX ;AN002; test ax,true_name_flag ; is true name flag armed? ;AN002; jz no_true_name ; no, don't copy true name ;AN002; ;AN002; sub ax,true_name_flag ; clear true name flag ;AN002; mov es:[di],ax ; save it in PSP ;AN002; ;AN002; mov di,word ptr handle_ptr+0 ; get user's buffer pointer ES:DI ;AN002; mov es,word ptr handle_ptr+2 ;AN002; ; find out if this is a handle find or an open or an exec cmp incoming_AX,exec_proc*256+0 ; exec? je no_true_name ; yes, do nothing with true name ;AN002; cmp incoming_AX,handle_fnd1*256+0 ; handle find? jne not_hf ; no, go do the easy stuff ;AN002; ; function we are doing is a handle find, must get part of true_name ; string from append path, part from DTA. Messy! lea si,try_dir ; buffer that has last APPEND path tried mov cx,true_name_count ; get number of chars in true_name dir ;AN002; copy_true_name_loop2: mov ah,ds:[si] ; get byte of append dir path ;AN002; mov es:[di],ah ; copy it to user's buffer ;AN002; inc si ; in this loop, the null is not copied ;AN002; inc di ;AN002; loop copy_true_name_loop2 ;AN002; ; put in the "\" mov ah,"\" ; get a \ mov es:[di],ah ; copy it inc di ; increment pointer ; we have copied the first part of the string, now get the real filename ; from the DTA push es push bx mov ah,get_DTA call int_21 push es pop ds mov si,bx pop bx pop es copy_true_name_loop3: mov ah,ds:[si+30] ; get byte of actual filename ;AN002; mov es:[di],ah ; copy it to user's buffer ;AN002; cmp ah,null ; is it a null? ;AN002; je true_name_copied ; yes, all done ;AN002; inc si ; in this loop the null is copied ;AN002; inc di ;AN002; jmp copy_true_name_loop3 ;AN002; not_hf: mov si,dx ; make DS:SI point to true name copy_true_name_loop: ;AN002; mov ah,ds:[si] ; get byte of true name ;AN002; mov es:[di],ah ; copy it to user's buffer ;AN002; cmp ah,null ; is it a null? ;AN002; je true_name_copied ; yes, all done ;AN002; inc si ;AN002; inc di ;AN002; jmp copy_true_name_loop ;AN002; ;AN002; true_name_copied: ;AN002; ;AN002; no_true_name: ;AN002; restore_regs ; restore some regs ;AN002; pop ax ;AN002; ;AN002; no_more_to_try2: call ctrl_break_restore ; restore normal control break address call crit_err_restore ; restore normal critical error address ; find out if there is a need to set the extended error code cmp ext_err_flag,0 ; do we need to set the extended error code? je no_ext_err2 ; no, finish up lea dx,ext_err_dpl call set_ext_err_code ; yes, go set the ext error info ; reset flags, and pack it in no_ext_err2: popff restore_regs ; restore registers pushf ; put the real flags on the stack jmp reset_stack ; fix stack, ret to caller page ;------------------------------------------------------------------- ; ; support routines for drive and path mode checking ; ; ;------------------------------------------------------------------- check_for_drive: ; input: ES:SI -> original string ; output: AX = 0 no drive present ; output: AX = -1 drive present xor ax,ax ; assume no drive letter present cmp es: byte ptr [si+1],':' ; is the second char a ":"? jne exit_check_for_drive ; no, skip setting the flag mov ax,-1 ; yes, set the flag exit_check_for_drive: ret ;------------------------------------------------------------------- check_for_path: ; input: ES:SI -> original string ; output: AX = 0 no path present ; output: AX = -1 path present push si ; save pointer xor ax,ax ; assume no path present ; walk the string and look for "/", or "\". Any of these mean that a ; path is present walk_handle_string: push ax ;AN006; mov al,es: byte ptr [si] ; is this a dbcs char? ;AN006; call Chk_DBCS ;AN006; pop ax ;AN006; ;AN006; jnc no_dbcs1 ; no, keep looking ;AN006; add si,2 ; yes, skip it and the next char ;AN006; jmp walk_handle_string ; the next char could be a "\", but ;AN006; ; would not mean a path was found ;AN006; ;AN006; no_dbcs1: ;AN006; cmp es: byte ptr [si],"\" ; is the char a "\"? je found_path ; yes, set flag and return cmp es: byte ptr [si],"/" ; is the char a "/"? je found_path ; yes, set flag and return cmp es: byte ptr [si],0 ; is the char a null je exit_check_for_path ; yes, got to the end of the ; handle string inc si ; point to next char jmp walk_handle_string ; and look again found_path: mov ax,-1 ; yes, set the flag exit_check_for_path: pop si ; restore si ret page ;----------------------------------------------------------------------------- ; Entry point for interrupt 2f handler ;----------------------------------------------------------------------------- intfcn_hook: cmp ah,append_2f ; is this function call for append? ;;;;;; je do_appends ; @@12 jne ih_10 ; @@12 jmp do_appends ; @@12 ih_10: ; @@12 cmp ah,applic_2f ; is this function call for applications je do_applic jmp pass_it_on do_applic: cmp dx,-1 ; not COMMAND call jump NE,pass_it_on cmp al,0 ; match name request jne ck01 mov cmd_buf,bx ; save CMDBUF offset call check_cmd_name jne no_internal1 mov al,append_inst ; inidicate I want this command no_internal1: iret ck01: cmp al,1 ; match name request jne ck02 ; save pointer to parser mov word ptr pars_off+0,di ; ES:DI points to COMMAND.COM's parser mov word ptr pars_off+2,es ; save it for later mov cmd_env,bx ; save env pointer address call check_cmd_name jne no_internal2 call COMMAND_begin ; process internal command no_internal2: iret ck02: ; cmp al,2 ; set COMMAND active ; @@13; @@09 ; jne ck03 ; @@13; @@09 ; mov cmd_active,1 ; @@13; @@09 ; iret ; @@13; @@09 ck03: ; @@13; @@09 ; cmp al,3 ; set COMMAND in active ; @@13; @@09 ; jne ck04 ; @@13; @@09 ; mov cmd_active,0 ; @@13; @@09 ; iret ; @@13; @@09 ck04: ; @@13; @@09 jmp pass_it_on ;******************************************************************************* ; The following old code is commented out. @@12 ;******************************************************************************* ;check_cmd_name: ; see if internal APPEND ; push es ; push cs ; pop es ; push di ; push cx ; push si ; cmp ds:byte ptr[si],6 ; length must match ; jne skip_comp ; comp append_id,6,[si+1] ; see if APPEND is command ;skip_comp: ; pop si ; pop cx ; pop di ; pop es ; ret ;********************************************************************* check_cmd_name: ; See if APPEND @@12 push ax ; @@12 push si ; @@12 push cx ; @@12 push di ; @@12 push es ; @@12 mov si,cmd_buf ; DS:SI -> cmd buf ended with cr @@12 add si,2 ; 1st 2 bytes garbage @@12 ; @@12 ccn_skip_leading: ; @@12 lodsb ; skip leading stuff @@12 call Chk_DBCS ; find out if this is DBCS ;AN006; jnc no_dbcs2 ; no, keep looking ;AN006; lodsb ; yes, skip it and the next byte ;AN006; jmp ccn_skip_leading ; the second byte will be skipper when ;AN006; ; we go back through ;AN006; no_dbcs2: ;AN006; cmp al," " ; blank @@12 je ccn_skip_leading ; @@12 cmp al,tab_char ; tab @@12 je ccn_skip_leading ; @@12 cmp al,"," ; comma @@12 je ccn_skip_leading ; @@12 cmp al,"=" ; equal @@12 je ccn_skip_leading ; @@12 cmp al,";" ; semi-colon @@12 je ccn_skip_leading ; @@12 cmp al,"\" ; back slash @@12 je ccn_skip_leading ; @@12 cmp al,cr ; bad ret for early terminate @@12 jne ccn_02 ; @@12 cmp al,0 ; reset z for no match @@12 jmp SHORT ccn_ret ; @@12 ccn_02: ; @@12 mov di,si ; di -> beginning of possible @@12 dec di ; "APPEND " string @@12 lodsb ; @@12 cmp al,":" ; @@12 jne ccn_cont ; @@12 mov di,si ; @@12 lodsb ; @@12 ccn_cont: ; @@12 call Chk_DBCS ;AN006; jnc no_dbcs3 ; no, carry on ;AN006; add si,2 ; yes, skip it and the next byte ;AN006; jmp SHORT ccn_20 ;AN006; ;AN006; no_dbcs3: ;AN006; cmp al,"\" ; move di up upon "\" @@12 jne ccn_20 ; @@12 mov di,si ; @@12 ccn_10: ; @@12 lodsb ; @@12 jmp ccn_cont ; @@12 ccn_20: ; @@12 cmp al," " ; look for separator @@12 je ccn_30 ; if found, then have command @@12 cmp al,"=" ; @@12 je ccn_30 ; @@12 cmp al,cr ; @@12 je ccn_30 ; @@12 cmp al,tab_char ; @@12 je ccn_30 ; @@12 cmp al,"," ; @@12 je ccn_30 ; @@12 cmp al,";" ; @@12 jne ccn_10 ; @@12 ccn_30: ; @@12 sub si,di ; @@12 cmp si,7 ; @@12 jne ccn_ret ; no match @@12 ; @@12 mov si,di ; @@12 chkchar "A" ; look for "APPEND" string @@12 chkchar "P" ; @@12 chkchar "P" ; @@12 chkchar "E" ; @@12 chkchar "N" ; @@12 chkchar "D" ; @@12 ; exit with z set for match @@12 ccn_ret: ; @@12 pop es ; @@12 pop di ; @@12 pop cx ; @@12 pop si ; @@12 pop ax ; @@12 ret ; @@12 page ;------------------------------------------------------------------- ;AN000; ; ;AN000; ; do_appends ;AN000; ; ;AN000; ; This is the INT 2F handler for the APPEND ;AN000; ; subfunction ;AN000; ; ;AN000; ; New functions added for 3.30: ;AN000; ; ;AN000; ; ;AN000; ; ;AN000; ; Get /X status ;AN000; ; ;AN000; ; Input: AX = B706 ;AN000; ; ;AN000; ; Output: BX = 0000 /X not active ;AN000; ; = 0001 /X active ;AN000; ; ;AN000; ; ;AN000; ; ;AN000; ; Set /X status ;AN000; ; ;AN000; ; Input: AX = B707 ;AN000; ; ;AN000; ; BX = 0000 turn /X off ;AN000; ; BX = 0001 turn /X on (active) ;AN000; ; ;AN000; ;------------------------------------------------------------------- ;AN000; ; do_appends: cmp al,are_you_there ; is the function request for presence? jne ck1 mov al,-1 ; set flag to indicate we are here iret ; return to user ck1: cmp al,dir_ptr ; is the function request for pointer? jne ck2 les di,dword ptr dirlst_offset ; return dirlist pointer to caller iret ck2: cmp al,get_app_version ; is the function request for version? jne ck3 ; no, check for next function mov ax,-1 ; yes, set NOT NETWORK version iret ck3: cmp al,tv_vector ; is the function request for TV vector? jne ck4 ; no, check for old dir ptr mov tv_vec_seg,es ; yes, save the TV vector mov tv_vec_off,di push cs ; set ES:DI to tv ent pnt pop es ; lea di,tv_entry xor byte ptr tv_flag,TV_TRUE ; set flag ;AN000; iret ck4: ; cmp al,old_dir_ptr ; is it the old dir ptr jne ck5 ; no, pass it on push ds push cs pop ds call sysloadmsg ;AN000; ;AN000; mov ax,1 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; pop ds mov al,1 call terminate ; exit to DOS ; @@05 ck5: ; cmp al,DOS_version ; is it the new version check jne ck6 ; no, pass it on mov ax,mode_flags ; set mode bits xor bx,bx ; destroy registers xor cx,cx mov dl,byte ptr version_loc ; major version num mov dh,byte ptr version_loc+1 ; minor version num iret ck6: ;AN000; cmp al,get_state ; is it get state call? ;AN001; jne ck7 ; no, look some more ;AN000; ;AN000; mov bx,mode_flags ; get mode bits ;AN000; iret ; return to user ;AN000; ;AN000; ck7: ;AN000; cmp al,set_state ; is it set state call? ;AN001; jne ck8 ; no, look some more ;AN000; ;AN000; mov mode_flags,bx ; save the new state ;AN001; iret ;AN000; ;AN000; ck8: ;AN000; cmp al,true_name ; is it the set true name function? ;AN002; jne ck9 ; no, look some more ;AN002; ;AN002; push ax ; save some regs ;AN002; push bx ;AN002; push es ;AN002; push di ;AN002; ;AN002; ;AN002; ; get the PSP and then get the APPEND flags byte mov ah,get_PSP ; function code to get PSP address ;AN002; call int_21 ; get the PSP address ;AN002; mov es,bx ; need to use it as a segment ;AN002; mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002; ;AN002; ; is the flag already set? mov ax,es:[di] ; get APPEND flag into AX ;AN002; test ax,true_name_flag ; is it set? ;AN002; jnz no_set_true_name ; yes, do nothing ;AN002; ;AN002; ; set the true_name flag set_true_name: ;AN002; add ax,true_name_flag ; set true name flag ;AN002; mov es:[di],ax ; save in PSP ;AN002; ;AN002; no_set_true_name: pop di ; restore some regs ;AN002; pop es ;AN002; pop bx ;AN002; pop ax ;AN002; ;AN002; iret ; return ;AN002; ;AN002; ck9: ;AN002; ;------------------------------------------------------------------- ; fill in additional 2F functions here ;------------------------------------------------------------------- pass_it_on: ; the function call (ah) was not for append jmp dword ptr intfcn_Offset ; jump to old INT 2f page ;----------------------------------------------------------------------------- ; Entry point for interrupt 24 handler ;----------------------------------------------------------------------------- crit_err_handler: mov crit_err_flag,0ffh ; set critical error flag mov al,3 ; fail int 21h iret page ;----------------------------------------------------------------------------- ; miscellaneous routines ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; tv_barrier ;----------------------------------------------------------------------------- tv_barrier: cmp tv_flag,TV_TRUE ; in Topview ;AN000; jne no_barrier push ax mov ax,2002h ; wait on DOS barrier int 2Ah pop ax no_barrier: ret ;----------------------------- ; check_config - this routine is called by both the FCB and handle open ; code. I checks the net_config flag to see if it is zero, if so it ; does an installation check. If it is non-zero, nothing is done. check_config: push ax ; save a few registers push bx ; examine the config flag to see if we already know what config we have cmp net_config,0 jne do_not_look ; we know config already ; the flag word has not been set before, go find out what config we have mov ax,0b800h ; installation code function code int 2fh ; do the installation check mov net_config,bx ; save flag word for later do_not_look: pop bx ;restore regs and leave pop ax ret ;*( Chk_DBCS ) ************************************************************* ;* * ;* Function: Check if a specified byte is in ranges of the DBCS lead bytes* ;* Attention: If your code is resident, comment out the lines marked * ;* ;** . * ;* * ;* Input: * ;* AL = Code to be examined * ;* * ;* * ;* Output: * ;* If CF is on then a lead byte of DBCS * ;* * ;* Register: * ;* FL is used for the output, others are unchanged. * ;* * ;*************************************************************************** Chk_DBCS PROC PUSH DS PUSH SI ; CMP CS:DBCSEV_SEG,0 ; ALREADY SET ? ;** ; JNE DBCS00 ;** MOV SI,OFFSET EVEV ; SET DEFAULT OFFSET ;** PUSH CS ;** POP DS ; SET DEFAULT SEGMENT ;** PUSH AX MOV AX,6300H ; GET DBCS EV CALL INT 21H MOV CS:DBCSEV_OFF,SI ;** MOV CS:DBCSEV_SEG,DS ;** POP AX DBCS00: MOV SI,CS:DBCSEV_OFF ;** MOV DS,CS:DBCSEV_SEG ;** DBCS_LOOP: CMP WORD PTR [SI],0 JE NON_DBCS CMP AL,[SI] JB DBCS01 CMP AL,[SI+1] JA DBCS01 STC JMP SHORT DBCS_EXIT DBCS01: ADD SI,2 JMP DBCS_LOOP NON_DBCS: CLC DBCS_EXIT: POP SI POP DS RET Chk_DBCS ENDP ;----------------------------- ; append_fname - glues the fname onto the end of the dir to try append_fname: push es push ds pop es lea di,try_dir ; destination, sort of (dir name) lea si,fname ; source (filename) ; find the end of the dir name mov dbcs_fb,-1 ; set flag for no dbcs first byte chars ;AN006; walk_dir_name: mov al,byte ptr [di] ; get a char from dir name cmp al,null ; are we at the end? je end_of_dir ; yes, add on the fname call Chk_DBCS ; char is in al ;AN006; jnc no_dbcs4 ; no, keep looking ;AN006; mov dbcs_fb,di ; save offset ;AN006; inc di ; skip second byte no_dbcs4: inc di ; no, keep stepping jmp walk_dir_name ; now it is time to append the filename end_of_dir: mov al,byte ptr [di-1] ; get last char of dir name cmp al,"\" ; is it a dir seperator? jne check_next_dir_sep ; no, check the next dir sep char ;AN006; ;AN006; sub di,2 ; yes, must find out if real dir sep ;AN006; ; or DBCS second byte ;AN006; cmp dbcs_fb,di ; is the char before our dir sep a DBCS ;AN006; ; first byte? ;AN006; jne no_dbcs4a ; no, must check for the next dir sep ;AN006; ; yes, this means we must put in a dir sep ;AN006; add di,2 ; restore di ;AN006; jmp SHORT put_in_dir_sep ; put int the dir sep char ;AN006; ;AN006; no_dbcs4a: ;AN006; add di,1 ; restore di, then check next dir sep ;AN006; check_next_dir_sep: cmp al,"/" ; is it the other dir seperator? je add_fname ; yes, no need to add one put_in_dir_sep: ;AN006; mov al,"\" ; get dir seperator stosb ; add to end of dir add_fname: lodsb ; get a char from fname stosb ; copy the char cmp al,null ; are we at the and of the filename? je eo_name ; yes, all done! jmp add_fname eo_name: pop es ret ;----------------------------- ; get_fname strips out the 8.3 filename from the original ASCIIZ string ; ; INPUT: ES:SI points to original string ; DS:DI points to area for filename get_fname: mov bx,si ; save the pointer mov dbcs_fb,-1 ; set the dbcs flag off ;AN006; gfn1: mov ah,ES:byte ptr [si] ; get a char from the source cmp ah,null ; is it a null? je got_the_end ; yes, we found the end call chk_dbcs ; is this char a DBCS first byte? ;AN006; jnc no_dbcs5 ; no, carry on mov dbcs_fb,si ; yes, save pointer inc si ; skip second byte no_dbcs5: inc si ; no, point to next char jmp gfn1 ; loop till end found got_the_end: mov ah,ES:byte ptr [si] ; get a char cmp ah,"/" ; did we find a / je went_too_far ; yes, we found the start cmp ah,"\" ; did we find a \ je found_bslash ; yes, we found the start ;AN006; cmp ah,":" ; did we find a : je went_too_far ; yes, we found the start cmp si,bx ; are we back to the original start? je got_the_beg ; yes, we found the start of the fname dec si ; step back a char, then look some more jmp got_the_end found_bslash: ; found a backslash, must figure out if ;AN006; ; is second byte of DBCS ;AN006; dec si ; point to next char ;AN006; cmp si,dbcs_fb ; do they match? jne no_dbcs5a ; no, fix up si and carry on ;AN006; dec si ; skip dbcs byte and loop some more ;AN006; jmp got_the_end ;AN006; no_dbcs5a: ;AN006; inc si ; went too far by one extra ;AN006; ;AN006; went_too_far: inc si ; went one char too far back ; ES:SI now points to the beginning of the filename got_the_beg: mov ah,ES:byte ptr [si] ; get a char from the source mov byte ptr [di],ah ; copy to dest cmp ah,null ; did we just copy the end? je done_with_fname ; yes, all done inc si ; no, get the next char inc di cmp di,offset app_dirs_ptr ; make sure we dont try to copy past the je done_with_fname ; area jmp got_the_beg done_with_fname: ret ;----------------------------- ; this code executed to return to caller after APPEND's stack has been ; initialized reset_stack: ; reset the stack ;AN002; popff ; restore flags from real open mov ss,Stack_Segment ; Get original stack segment mov sp,Stack_Offset ; Get original stack pointer pushf ; put the flags on the old stack ;----------------------------- ; before jumping to this routine, SS:SP must point to the caller's stack, ; and the flags from the real INT 21 operation must have been pushed set_return_flags: ; must be sure to clear the true_name flag before leaving ;AN002; ;AN002; push ax ; save some regs ;AN002; push bx ;AN002; push es ;AN002; push di ;AN002; ;AN002; mov ah,get_PSP ; function code for get PSP operation ;AN002; call int_21 ; get the PSP, segment returned in BX ;AN002; mov es,bx ; need to use it as a segment ;AN002; mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002; ;AN002; mov ax,es:[di] ; get APPEND flag into AX ;AN002; test ax,true_name_flag ; is true name flag armed? ;AN002; jz reset_stack2 ; no, don't copy true name ;AN002; ;AN002; sub ax,true_name_flag ; clear true name flag ;AN002; mov es:[di],ax ; save it in PSP ;AN002; ;AN002; ;AN002; reset_stack2: ;AN002; ;AN002; pop di ; restore ;AN002; pop es ;AN002; pop bx ;AN002; pop ax ;AN002; ;AN002; cmp tv_flag,TV_TRUE ;AN000; jne tv_flag_not_set mov ax,2003h ; clear open barrier int 2Ah ; pop down to the old flags on the user's stack tv_flag_not_set: cmp incoming_AX,exec_proc*256+0 ; need to do exec jne not_exec3 popff ; discard bad flags mov ax,incoming_AX ; set exec parms push ds ; save DS, this must be done ;an005; ; to pervent DS from being trashed on return to caller ;an005; push cs pop ds lea dx,try_dir mov bx,incoming_BX mov es,incoming_ES call int_21 ; issue the exec pop ds ; restore DS ; an005; pushf not_exec3: popff ; get flags from real int 21 (old stack) pop temp_IP_save ; save IP, CS pop temp_CS_save lahf ; save flags in AH popff ; pop old flags off stack sahf ; replace old with new ; push the new flags onto the stack, then fix CS and IP on stack pushf ; push new flags onto stack push temp_CS_save ; restore IP, CS push temp_IP_save mov ax,AX_after_21 ; Set AX as it was after open call crit_sect_reset ; clear the critical section flag iret ; return to the calling routine ;----------------------------- ; This routine is used to extract an appended dir from the dir list ; On entry, DS:DI points to an area for the appended dir ; and ES:SI points to the source string get_app_dir: xor cx,cx ; keep a count of chars in cx ;AN003; copy_dir: mov ah,es:byte ptr [si] ; get the char, and copy it into dest cmp ah,null ; find a null? je no_more_dirs ; yes, inform caller that this is the last one cmp ah,";" ; check to see if we are at the end of a dir je update_pointer ; yes, mov byte ptr [di],ah ; if not null or semi-colon, then copy it inc si ; increment both pointers inc di inc cx ; count of chars ;AN003; jmp copy_dir ; do it some more update_pointer: inc si ; point to next char mov ah,es:byte ptr [si] ; get char ; @@16 cmp ah,null ; did we reach the end of the dir list? je no_more_dirs ; cmp ah,";" ; is is a semi-colon je update_pointer jmp SHORT all_done no_more_dirs: xor si,si ; set end search flag all_done: mov byte ptr [di],null ; null terminate destination ret ; return to caller ;----------------------------- ; set ctrl-break check off ; first, save the old state so we can restore it later, ; then turn ctrl-break checking off ctrl_break_set: mov ah,ctrl_break ; function code for ctrl-break check xor al,al ; 0 = get current state call int_21 ; call DOS INT 21 handler mov ctrl_break_state,dl ; save the old ctrl-break state mov ah,ctrl_break ; function code for ctrl-break check mov al,01 ; set current state xor dl,dl ; 0 = off call int_21 ; call DOS INT 21 handler ret ;----------------------------- ; restore ctrl-break checking flag to the way it was ctrl_break_restore: mov ah,ctrl_break ; function code for ctrl-break check mov al,01 ; set current state mov dl,ctrl_break_state ; get the way is was before we messed with it call int_21 ; call DOS INT 21 handler ret ;----------------------------- ; restore ctrl-break checking flag to the way it was ctrl_break_rest: mov ah,ctrl_break ; function code for ctrl-break check mov al,01 ; set current state mov dl,ctrl_break_state ; get the way is was before we messed with it call int_21 ret ;----------------------------- ; crit_err_set: mov crit_err_flag,0 ; clear the critical error flag mov ax,get_crit_err ; Get INT 24h vector call int_21 ; call DOS INT 21 handler mov crit_vector_offset,bx ; Save it mov ax,es ; es hase segment for resident code mov crit_vector_segment,ax lea dx,crit_err_handler ; DS:DX = New INT 21h vector mov ax,set_crit_err ; function code for setting critical error vector call int_21 ; call DOS INT 21 handler ret ; go back to the caller ;----------------------------- ; crit_err_restore: push ds ; save ds for this function mov ax,set_crit_err ; function code for setting critical error vector mov dx,crit_vector_offset ; get old int 24 offset mov ds,crit_vector_segment ; get old int 24 segment call int_21 ; call INT 21 pop ds ret ;----------------------------- ; crit_sect_set - issues an enque request to the server to protect ; against reentry. This request is issued only if the network is started, ; and then, only for RCV, MSG, and SRV configurations crit_sect_set: push ax push bx push di push es mov ax,net_config ; check the server config flag cmp ax,0 ; is it zero? je dont_set_crit_sect ; yes, skip it cmp ax,redir_flag ; is it a redir? je dont_set_crit_sect ; yes, skip it ; otherwise, issue the request ; the config flag was not zero or redir, so set crit section mov ah,NETSYSUTIL mov al,NETENQ mov bx,TCBR_APPEND int 2Ah dont_set_crit_sect: ; because of the config we don't want pop es ; to set critical section pop di pop bx pop ax ret ;----------------------------- ; crit_sect_reset: push ax push bx mov ax,net_config ; check the server config flag cmp ax,0 ; is it zero? je not_set ; yes, skip it cmp ax,redir_flag ; is it a redir? je not_set ; yes, skip it mov ah,NETSYSUTIL ; turn critical section off mov al,NETDEQ mov bx,TCBR_APPEND int 2Ah not_set: pop bx pop ax ret ;----------------------------- ; save_first_ext_err - this routine is used to save the extended ; error info after the first FCB open. save_first_ext_err: push ax mov ax,ext_err_dpl.DPL_AX ; copy all registers mov save_ext_err.DPL_AX,ax mov ax,ext_err_dpl.DPL_BX mov save_ext_err.DPL_BX,ax mov ax,ext_err_dpl.DPL_CX mov save_ext_err.DPL_CX,ax mov ax,ext_err_dpl.DPL_DX mov save_ext_err.DPL_DX,ax mov ax,ext_err_dpl.DPL_SI mov save_ext_err.DPL_SI,ax mov ax,ext_err_dpl.DPL_DI mov save_ext_err.DPL_DI,ax mov ax,ext_err_dpl.DPL_DS mov save_ext_err.DPL_DS,ax mov ax,ext_err_dpl.DPL_ES mov save_ext_err.DPL_ES,ax pop ax ret ;----------------------------- ; get_ext_err_code - this routine is used to get the extended error ; info for the error that cause append to start its search get_ext_err_code: push ax ; save register that are changed by this push bx ; DOS function push cx push di push si push es push ds ; get the extended error information mov ah,59h ; function code for get extended error xor bx,bx ; version number call int_21 ; get the extended error ; save it away in a DPL for set_ext_error_code ; all fields in the DPL will be filled in except the last three, ; which will be left at zero mov ext_err_dpl.DPL_AX,ax mov ext_err_dpl.DPL_BX,bx mov ext_err_dpl.DPL_CX,cx mov ext_err_dpl.DPL_DX,dx mov ext_err_dpl.DPL_SI,si mov ext_err_dpl.DPL_DI,di mov ext_err_dpl.DPL_DS,ds mov ext_err_dpl.DPL_ES,es ; restore regs and return pop ds pop es ; restore registers pop si pop di pop cx pop bx pop ax ret ;----------------------------- ; set_ext_err_code - this routine is used to get the extended error ; info for the error that cause append to start its search ; CS:DX points to return list set_ext_err_code: push ax ; save register that are changed by this push ds ; DOS function ; get the extended error information mov ah,DOSSERVER ; function code for DOSSERVER call mov al,DOSSETERROR ; sub-function code for set extended error push cs pop ds call int_21 ; set the extended error ; restore regs and return pop ds ; restore registers pop ax ret page ;----------------------------- ; This routine is used to initiate DOS calls from within the APPEND interrupt ; handlers. An INT instruction can not be used because it would cause APPEND ; to be re-entered. ; ; SS, SP saved incase call is EXEC which blows them away int_21: ; cmp tv_flag,TV_TRUE ; see if being re-entered ;AN000; jne use_old_vec ; yes, pass through to DOS pushf ; to comp for iret pops call dword ptr tv_vec_off ; Call INT 21h ret ; use_old_vec: cmp vector_segment,0 ; not installed yet je use_int pushf ; to comp for iret pops call dword ptr vector_offset ; Call INT 21h ret ; use_int: int DOS_function ret page ;----------------------------- ; This routine is used to locate the current APPEND path string ; result to ES:DI address_path: address_status: ; @@13 test mode_flags,E_mode jnz get_env_mode address_pathx: mov ax,append_2f*256+dir_ptr ; get from buffer int int_function clc ret get_env_mode: ; get from environment ; cmp cmd_active,0 ; different logic ; @@13; @@09 ; jne use_cmd_env ; if in COMMAND ; @@13; @@09 push bx mov ah,get_PSP call int_21 ; get the PSP mov es,bx mov bx,002ch ; address environment mov ax,es:word ptr[bx] mov es,ax pop bx cmp ax,0 ; PSP pointer is set je address_pathx ; @@13 use_cmd_env: ; @@13 ; cmp cmd_env,0 ; have not set my pointer yet ; je address_pathx ; @@13 ; mov es,cmd_env ; @@13 env_mode1: mov di,0 ; start at start cmp es:byte ptr[di],0 ; no environment je no_appendeq find_append: cmp es:word ptr[di],0 ; at environment end je no_appendeq push di push si push cx push ds push cs pop ds comp ,6+1,append_id ; string = "APPEND=" pop ds pop cx pop si pop di je at_appendeq inc di jmp find_append at_appendeq: ; must insure this is @@17 cmp di,0 ; genuine "APPEND=" string @@17 je at_appendeq_genuine ; if start of environ ok @@17 dec di ; else check that 0 @@17 cmp es:byte ptr[di],0 ; precedes string @@17 je at_appendeq_10 ; jmp if ok @@17 add di,8 ; else cont.search after @@17 jmp find_append ; "=" @@17 at_appendeq_10: ; @@17 inc di ; @@17 at_appendeq_genuine: ; @@17 add di,6+1 ; skip APPEND= cmp es:byte ptr[di],0 ; null value je no_appendeq ; treat as not found cmp es:byte ptr[di]," " je no_appendeq cmp es:byte ptr[di],";" je no_appendeq clc ; set ok ret no_appendeq: ; not found, use default lea di,semicolon ; null list push cs pop es stc ; set error ret ;----------------------------- ; @@03 ; This routine is used to locate the current APPEND path string ; @@03 ; result to ES:DI. Used by APPEND status. ; @@03 ;address_status: ; @@13; @@03 ; test mode_flags,E_mode ; @@13; @@03 ; jump Z,address_pathx ; @@13; @@03 ; jmp use_cmd_env ; @@13; @@03 cap_dl: ; convert dl to uppercase cmp dl,"a" ; find out if we have a lower case; @@14 jb cap_dlx ; char ; @@14 cmp dl,"z" ; @@14 ja cap_dlx ; @@14 sub dl,"a"-"A" ; convert char to upper case ; @@14 cap_dlx: ret ; end_address: ; this is the end of the TSR stuff ;AN002; page ;----------------------------------------------------------------------------- ; Main routine. Used to determine if APPEND has been loaded ; before. If not, load resident portion of APPEND. Then handle setting ; or displaying appended directory list. ;----------------------------------------------------------------------------- main_begin: ; DOS entry point mov ax,seg mystack ; set up stack mov ss,ax lea sp,mystack cld mov res_append,0 ; set external copy ; @@05 push cs ; make DS point to CS pop ds push cs ; make ES point to CS pop es ; find out if append has been loaded ; @@04 ; @@04 mov ah,append_2f ; int 2f function code for append ; @@04 mov al,are_you_there ; function code to ask if append ; @@04 ; has been loaded ; @@04 int int_function ; @@04 ; @@04 cmp al,append_inst ; is append there? ; @@04 jne not_there_yet ; no ; @@04 mov dx,0 ; set for network version ; @@07 mov ah,append_2f ; int 2F function code for append ; @@07 mov al,DOS_version ; function code for get version ; @@07 int int_function ; @@07 cmp dx,word ptr version_loc ; does the version match? ; @@07 jne bad_append_ver ; no, cough up an error messsage ; @@07 call sysloadmsg ;AN000; ;AN000; mov ax,9 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; mov cx,len_second_APPEND_msg; length of string ;AN000; ; @@04 ; lea dx,second_APPEND_msg ; second load message ;AN000; ; @@04 ; call print_STDERR ; display error message ;AN000; ; @@04 ; lea dx,crlf ; carriage return, line feed ; @@04 ; mov cx,crlf_len ; length of string ; @@04 ; call print_STDERR ; @@04 ; @@04 mov al,0fch ; second load ; @@05 call terminate ; exit to DOS ; @@05 bad_append_ver: ; append version mismatch ; @@07 call sysloadmsg ;AN000; ;AN000; mov ax,1 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; mov cx,len_bad_append_msg ;AN000; ; @@07 ; lea dx,bad_append_msg ; bad app message ;AN000; ; @@07 ; call print_STDERR ;AN000; ; @@07 ; lea dx,crlf ; carriage return, line feed ; @@07 ; mov cx,crlf_len ; length of string ; @@07 ; call print_STDERR ; @@07 mov ax,0feh ; bad APPEND version ; @@05 call terminate ; exit to DOS ; @@05 not_there_yet: ; @@04 mov cs:initial_pass,-1 ; set a flag for initial pass ;AN007; call do_command ; do actual APPEND mov bx,4 ; close all standard files do_closes: mov ah,3eh ; close file handle call int_21 dec bx jns do_closes call set_vectors ; set append vectors on success ; @@05 call Release_Environment ; release the environmental vector space ;an007; dms; lea dx,end_address+15 ; normal end mov cl,4 ; calc end address in paragraphs shr dx,cl mov ah,get_PSP ; calc space from PSP to my code ; @@02 call int_21 ; @@02 mov ax,cs ; @@02 sub ax,bx ; @@02 add dx,ax ; calc length to keep ; @@02 mov al,0 ; exit with no error mov ah,term_stay call int_21 page COMMAND_begin: ; COMMAND entry point save_regs mov word ptr cmd_name@+0,si ; save internal command buffer @ mov word ptr cmd_name@+2,ds cld mov abort_sp,sp ; save sp for aborts ; @@05 mov res_append,1 ; set resident copy ; @@05 call do_command ; do actual APPEND abort_exit: ; exit to abort append ; @@05 mov sp,abort_sp ; @@05 push es push di les di,cmd_name@ mov es:byte ptr[di],0 ; set no command now pop di pop es cmp ax,0 ; error jne no_E_mode_via test mode_flags,E_mode ; no /E processing jz no_E_mode_via mov ax,append_2f*256+dir_ptr; int 2f function code for append int int_function push es pop ds mov si,di ; mov ah,get_PSP ; set new command ; call int_21 mov bx,ss mov es,bx mov bx,cmd_buf ; command line iput buffer inc bx ; skip max length mov es:byte ptr[bx],3+1+6+1 mov di,bx ; address command line buffer inc di ; skip current length push ds push si push cs pop ds move ,3+1+6+1,setappend_name ; set in "SET APPEND=" pop si pop ds cmp ds:byte ptr[si],";" ; null list is special case jne copy_path append_blank: mov al," " stosb inc es:byte ptr[bx] jmp short copy_path_done no_E_mode_via: jmp short no_E_mode copy_path: mov dl, byte ptr es:[bx-1] ; get max len of command buffer sub dl, 3+1+6+1 ; take care of 'SET APPEND=' ; ;------ now find the strlen of path string pointed by ds:si ; ; REPLACE WITH BETTER CODE LATER --- mohan ; push si ; save ptr to paths xor cx, cx count_next_char: lodsb or al, al jz check_len inc cx jmp count_next_char null_path: pop si jmp append_blank check_len: pop si ; ;------ check whether the length is ok ; cmp cl, dl ; len < maxlen ? jb copy_it push si add si, cx ; point to end of path str next_char: jcxz null_path ; null str ? dec cl dec si cmp byte ptr ds:[si], ';' jne next_char cmp cl, dl ; found ';' but is len ok? jae next_char pop si add byte ptr es:[bx], cl copy_it: rep movsb ; ;------ The code in this box replaced by code below copy_path:------------ ; lodsb ; ; cmp al,0 ; ; je copy_path_done ; ; stosb ; ; inc es:byte ptr[bx] ; ; jmp copy_path ; ;-------------------------------------------------------------------------- copy_path_done: mov es:byte ptr[di],cr ; set end delimiter les di,cmd_name@ mov al,3 ; SET length stosb push cs ; @@06 pop ds ; @@06 move ,8,set_name ; set up "SET" command mov ax,0 ; set to do SET no_E_mode: restore_regs ret page do_command: ; APPEND process ; set ctrl-break check off ; first, save the old state so we can restore it later, ; then turn ctrl-break checking off mov ah,ctrl_break ; function code for ctrl-break check xor al,al ; 0 = get current state call int_21 mov ctrl_break_state,dl ; save the old ctrl-break state mov ah,ctrl_break ; function code for ctrl-break check mov al,01 ; set current state xor dl,dl ; 0 = off call int_21 ; find out if append has been loaded mov ah,append_2f ; int 2f function code for append mov al,are_you_there ; function code to ask if append ; has been loaded int int_function cmp al,append_inst ; is append there? jne not_already_there ; yes, don't try to put it jmp already_there ; yes, don't try to put it ; there again ; get DOS version and decide if it is in the allowed range for ; APPEND not_already_there: mov ah,get_version ; lets find out if we should do it call int_21 ; try the open cmp ax,expected_version ; compare with DOS version jne bad_DOS jmp SHORT check_assign ; valid range ; lets see if assign has been loaded ; Break it to the user that he's trying to do an APPEND with ; the wrong DOS version bad_DOS: call sysloadmsg ;AN000; ;AN000; mov ax,8 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; mov cx,len_bad_DOS_msg ; length of string ;AN000; ; lea dx,bad_DOS_msg ; bad DOS message ;AN000; ; call print_STDERR ; display error message ;AN000; call ctrl_break_rest mov al,0ffh ; bad DOS version ; @@05 call terminate ; exit to DOS ; @@05 check_assign: mov ax,0600h int 2fh or al,al jnz assign_there jmp SHORT check_TopView ; ASSIGN has not been loaded, ; @@01 ; ASSIGN has been loaded before APPEND, bad news! assign_there: call sysloadmsg ;AN000; ;AN000; mov ax,6 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; mov cx,len_append_assign_msg; length of string ; lea dx,append_assign_msg ; call print_STDERR ; display error message jmp SHORT conflict_exit ; @@01 ; @@01 check_Topview: ; @@01 mov bx,0 ; incase not there ; @@01 if not MSVER ; MSKK02 07/14/89 mov ax,10h*256+34 ; TopView version check ; @@01 int 15h ; @@01 endif cmp bx,0 ; @@01 jnz TopView_there ; @@01 jmp replace_vector ; TopView has not been loaded, ; @@01 ; @@01 ; TopView has been loaded before APPEND, bad news! ; @@01 ; @@01 TopView_there: ; @@01 ; mov cx,len_append_TV_msg ; length of string ; @@01 ; lea dx,append_TV_msg ; @@01 ; call print_STDERR ; display error message ; @@01 call sysloadmsg ;AN000; ;AN000; mov ax,7 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; @@01 conflict_exit: ; @@01 call ctrl_break_rest mov al,0fdh ; @@05 call terminate ; exit to DOS ; @@05 ; get pointer to dir list, on return ES:DI points to buffer already_there: ; This code has been moved to main_begin ; @@07 ; ; @@07 ; make sure the right version of APPEND has been loaded ; @@07 ; ; mov dx,0 ; set for network version ; @@07 ; mov ah,append_2f ; int 2F function code for append ; @@07 ; mov al,DOS_version ; function code for get version ; @@07 ; int int_function ; @@07 ; cmp dx,word ptr version_loc ; does the version match? ; @@07 ; jump NE,bad_append_ver ; no, cough up an error messsage ; @@07 process_args: ; process all arguments ;------------------------------------------------------------------- mov si,0081h ; DS:SI points to argument area mov cs:byte ptr e_switch+9,0 ; turn /E switch off process_argsx: ; process all arguments ; ; make sure that the /PATH and /X switches are re-enabled, and ; various flags are cleared xor cx,cx ; ordinal value, must start as 0 xor dx,dx ; these regs must be 0 for call to Scan_For_Equal mov ah,"/" mov cs:byte ptr x_switch+9,ah ; re-enable /X switch mov cs:byte ptr path_switch+9,ah ; re-enable /PATH switch mov cs:byte ptr x_result.$P_Type,cl ; clear flag mov cs:byte ptr path_result.$P_Type,cl ; clear flag mov cs:byte ptr dirs_result.$P_Type,cl ; clear flag mov cs:parse_flag,cl ; clear parse flag ; set up things to call PARSER push cs ; make sure ES points to segment where pop es ; parm block info is lea di,cs:p_block2 ; ES:DI points to parm block, for secondary parsing ; ; Note CX and DX, cleared above, must stay cleared for this call call Scan_For_Equal ; yes - let's see if we have "=" symbol ;an008; dms; ; parse past it if we do get_pars_info: call dword ptr pars_off ; call to COMMAND.COM's parser or ax,ax ; end of line? -1 if yes jns not_end_of_line ; no, carry on jmp end_of_line_reached ; yes, go figure out what we got not_end_of_line: or ax,ax ; no, find out if there an error je not_parse_error ; no, carry on jmp parse_error ; yes, go display the error message ; got here without any errors, set the proper bits in mode_flags not_parse_error: mov cs: parse_flag,0ffh ; set parse flag check_e: cmp e_result.$P_Type,3 ; was there a /E in this pass? jne check_? ; no, look for an ? mov byte ptr e_switch+9,0 ; turn this off so we don't allow another mov e_result.$P_Type,0 ; clear this so we don't get fooled later or mode_flags,E_mode ; set E mode on jmp get_pars_info ; go get another argument check_?: cmp qu_result.$P_Type,3 jne check_x mov qu_result.$P_Type,0 ; clear this so we don't get fooled later call sysloadmsg mov ax,MSG_OPTIONS_FIRST p_n: cmp ax,MSG_OPTIONS_LAST jg end_? mov bx,STDOUT ; no handle xor cx,cx ; sub count xor dl,dl ; no input mov dh,-1 ; message class call sysdispmsg inc ax ; sysdispmsg does NOT trash ax jmp short p_n end_?: xor ax,ax ; return normal exit code call ctrl_break_rest call terminate check_x: cmp x_result.$P_Type,3 ; was there a /X on this pass? list index je set_x ; yes, and it was /X w/o ON or OFF cmp x_result.$P_Type,2 ; was there a /X on this pass? list index jne check_path mov byte ptr x_switch+9,0 ; turn this off so we don't allow another mov x_result.$P_Type,0 ; clear this so we don't get fooled later cmp x_result.$P_Item_Tag,1 ; was /X or /X:ON specified? je set_x ; yes, set X mode on and mode_flags,NOT x_mode ; no, clear it jmp get_pars_info set_x: or mode_flags,x_mode jmp get_pars_info check_path: cmp path_result.$P_Type,2 ; was there a /path on this pass? list index jne check_dirs xor ah,ah ; turn this off so we don't allow mov byte ptr path_switch+9,ah ; another mov path_result.$P_Type,0 ; clear this so we don't get fooled later cmp path_result.$P_Item_Tag,1 ; was /PATH:ON specified? je set_path ; yes, set PATH mode and mode_flags,NOT path_mode ; no, clear it jmp get_pars_info set_path: or mode_flags,path_mode ; set PATH mode on jmp get_pars_info ; find out if dirs specified check_dirs: cmp dirs_result.$P_Type,3 ; was a simple string returned? je check_dirs2 ; yes, carry on jmp get_pars_info ; no, all done for now ; set up stuff to do the dirs copy check_dirs2: push es push ds push si push di lds si,dword ptr dirs_result.$P_Picked_Val ; get pointer to dirs string mov dirs_result.$P_Type,0 ; clear this so we don't get fooled later mov di,0 ; set incase int 2f not installed ; @@08 mov es,di ; @@08 mov ax,append_2f*256+dir_ptr ; es:di -> internal result area ; @@08 int int_function ; @@08 mov ax,es ; see if active yet ; @@08 or ax,di ; @@08 jnz copy_dirs_loop ; ok, do the copy ; @@08 push cs ; not active, set myself ; @@08 pop es ; @@08 lea di,app_dirs ; @@08 copy_dirs_loop: movs es: byte ptr[di],ds:[si]; copy char cmp byte ptr ds:[si-1],0 ; is char a null je done_copy_dirs jmp copy_dirs_loop done_copy_dirs: pop di pop si pop ds pop es jmp get_pars_info ; no error yet, loop till done end_of_line_reached: mov old_syntax,0 ; process old format operands cmp cs:initial_pass,-1 ; is this the first APPEND ;AN006; je first_one ; yes, clear flag and exit ;AN006; cmp cs:parse_flag,0 ; if this flag is off, means null command line ; was nothing on the command line je display_dirs ; go display the dirs first_one: ;AN006; mov cs:initial_pass,0 ; clear first pass flag ;AN006; done_for_now: normal_exit: call ctrl_break_rest ; reset control break checking mov ax,0 ; set string ret ; exit to COMMAND parse_error: push ax ;save parser error code ;an010;bgb call sysloadmsg ;AN000; pop ax ;restore parser error coed ;an010;bgb call do_parse_err ;an010;bgb jmp SHORT bad_parmx ; display message and get out ;------------------------------------------------------------------- ; mov si,0081h ; point si to argument area ; mov bx,ss ; mov ds,bx ; ;process_argsx: ; process all arguments ; mov di,0 ; set incase int 2f not installed ; @@08 ; mov es,di ; @@08 ; mov ax,append_2f*256+dir_ptr ; es:di -> internal result area ; @@08 ; int int_function ; @@08 ; mov ax,es ; see if active yet ; @@08 ; or ax,di ; @@08 ; jnz have_ptr ; @@08 ; push cs ; not active, set myself ; @@08 ; pop es ; @@08 ; lea di,app_dirs ; @@08 ;have_ptr: ; @@08 ; ;; step through the DOS command line argument area, and copy the new dir ;; list to the proper place in APPEND. This requires some parsing for ;; spaces, tabs chars, equal signs, as well as conversion to upper case ; ; cmp byte ptr[si],"=" ; APPEND=path is OK syntax ; jne skip_leading ; inc si ;skip_leading: ; skip leading spaces ; lodsb ; cmp al," " ; je skip_leading ; cmp al,tab_char ; je skip_leading ; cmp al,"," ; @@15 ; je skip_leading ; @@15 ; cmp al,"=" ; @@15 ; je skip_leading ; @@15 ; cmp al,cr ; did we have command line arguments? ; jump E,display_dirs ; no, display the dirs currently appended ; cmp al,"/" ; is it a parm starter? ; @@05 ; jump E,bad_path_parm ; yes, it's an error ; @@05 ; dec si ; ;copy_args: ; lodsb ; get char from command line area ; cmp al,cr ; are we at the end? ; jump E,found_end ; yes, display the currently appended dirs ; cmp al," " ; is it a space? ; je found_space ; yes, at end ; cmp al,tab_char ; is it a tab? ; je found_space ; yes, treat it like a space ; cmp al,"/" ; is it a parm starter? ; je bad_path_parm ; yes, it's an error ; @@05 ; cmp al,"a" ; find out if we have a lower case char ; jb copy_char ; @@14 ; cmp al,"z" ; ja copy_char ; @@14 ; sub al,"a"-"A" ; convert char to upper case ; @@14 ; ;copy_char: ; mov in_middle,-1 ; say that we made it to the middle ; stosb ; no, copy char into resident storage area ; jmp copy_args ; do it some more ; ;found_space: ; cmp in_middle,0 ; set the space flag then go through ; jump E,copy_args ; loop some more ; ;found_end: ; cmp in_middle,0 ; if I found the end of string but not ; jump E,display_dirs ; in the middle, go display some dirs ; ; mov es:byte ptr [di],0 ; null terminate the string ; mov in_middle,0 ; cmp al,cr ; je past_trailing ; ;skip_trailing: ; skip end spaces ; lodsb ; cmp al," " ; je skip_trailing ; cmp al,tab_char ; je skip_trailing ; cmp al,"/" ; path and parm not together ; @@05 ; je bad_path_parm ; @@05 ; cmp al,cr ; only white space allowed at end ; jne bad_path ;past_trailing: ; ; cmp old_syntax,0 ; go back to normal mode ; je normal_exit ; jmp exit_append2 ;normal_exit: ; call ctrl_break_rest ; reset control break checking ; mov ax,0 ; set string ; ret ; exit to COMMAND bad_path: ; bad paath operand ; mov cx,len_path_error_msg ; length of string ; lea dx,path_error_msg call sysloadmsg ;AN000; ;AN000; mov ax,3 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; ;gga call sysdispmsg ;AN000; jmp short bad_parmx bad_path_parm: ; bad parameter ; @@05 ; mov cx,len_path_parm_error_msg ; length of string ; @@05 ; lea dx,path_parm_error_msg ; @@05 call sysloadmsg ;AN000; mov ax,3 ; message number ;AN000; mov bx,STDERR ; standard error ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; jmp short bad_parmx ; @@05 bad_parm: ; bad parameter ; mov cx,len_parm_error_msg ; length of string ; lea dx,parm_error_msg call sysloadmsg ;AN000; ;AN000; mov ax,3 ; message number ;AN000; mov bx,STDERR ; standard error ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; bad_parmx: ; bad parameter push ds push cs pop ds ; call print_STDERR ; display error message lea si,inv_parm ; point to msg parm ;an010;bgb call sysdispmsg ;AN000; pop ds call ctrl_break_rest mov al,1 ; @@05 call terminate ; exit to DOS ; @@05 ; This code has been moved to main_begin ; @@07 ;bad_append_ver: ; append version mismatch ; @@07 ; push ds ; @@07 ; push cs ; @@07 ; pop ds ; @@07 ; mov cx,len_bad_append_msg ; @@07 ; lea dx,bad_append_msg ; bad app message ; @@07 ; call print_STDERR ; @@07 ; lea dx,crlf ; carriage return, line feed ; @@07 ; mov cx,crlf_len ; length of string ; @@07 ; call print_STDERR ; @@07 ; pop ds ; @@07 ; call ctrl_break_rest ; @@07 ; mov ax,0feh ; bad APPEND version ; @@05 ; call terminate ; exit to DOS ; @@05 ; Display currently appended directories display_dirs: call address_status ; get working path ; @@03 push ds push es pop ds cmp es:byte ptr[di],";" ; no append now je no_dirs_appended ; count the chars in the dir list, cx will hold the count mov si,di sub si,6+1 ; move pointer to APPEND mov dx,si ; save pointer to string xor cx,cx scanit: lodsb ; get character cmp al,null ; are we at end? je print_it ; yes, print it inc cx ; look at the next character jmp scanit ; loop till we find the end print_it: call print_STDOUT ; display appended dirs push cs pop ds lea dx,crlf ; carriage return, line feed mov cx,crlf_len ; length of string call print_STDOUT pop ds exit_append: cmp old_syntax,0 ; process old format operands je exit_append2 mov si,0081h ; set up rescan mov ah,get_PSP call int_21 mov ds,bx jmp process_argsx exit_append2: mov old_syntax,0 ; after first time this must be off call ctrl_break_rest ; reset control break checking mov ax,-1 ; no action ret ; exit to COMMAND no_dirs_appended: push cs pop ds call sysloadmsg ;AN000; ;AN000; mov ax,5 ; message number ;AN000; mov bx,STDERR ; handle ;AN000; xor cx,cx ; sub count ;AN000; xor dl,dl ; no input ;AN000; mov dh,-1 ; message class ;AN000; call sysdispmsg ;AN000; ; lea dx,no_append_msg ; no dirs message ;AN000; ; mov cx,len_no_append_msg ; length of string ;AN000; ; call print_STDOUT ;AN000; pop ds jmp exit_append2 ; APPEND = = fix ;GGA page ;------------------------------------------------------------------- ; Getting here means that APPEND has not been loaded yet. Get the ; old vector, save it, and point the vector to the new routine. ;------------------------------------------------------------------- replace_vector: push ds mov si,0081h ; point si to argument area mov ah,get_PSP call int_21 mov ds,bx ; Process /X and /E parameters skip_leading2: ; skip leading spaces ; lodsb ; cmp al," " ; je skip_leading2 ; cmp al,tab_char ; je skip_leading2 ; cmp al,cr ; at end ; jump E,parms_done ; cmp al,"/" ; jne set_old_syntax found_slash: ; lodsb ; cmp al,"e" ; je slash_E ; cmp al,"E" ; je slash_E ; cmp al,"x" ; je slash_X ; cmp al,"X" ; je slash_X bad_parmy: ; pop ds ; jmp bad_parm bad_path_parmy: ; pop ds ; jmp bad_path_parm slash_X: ; test mode_flags,X_mode ; no duplicates allowed ; jnz bad_parmy ; or mode_flags,X_mode ; jmp short slashx slash_E: ; test mode_flags,E_mode ; no duplicates allowed ; jnz bad_parmy ; or mode_flags,E_mode slashx: ; jmp skip_leading2 ; loop some more set_old_syntax: ;; test mode_flags,0 ; no /? switches on old mode ;; jne bad_path_parmy mov old_syntax,1 parms_done: pop ds jmp exit_append page set_vectors: ; set append hooks ; @@05 push es ; Get INT 2f vector. Save to call older 2f handlers mov ax,get_intfcn ; Get INT 2fh vector call int_21 mov intfcn_offset,bx ; Save it mov intfcn_segment,es ; get int 21 vector mov ax,get_vector ; Get INT 21h vector call int_21 mov vector_offset,bx ; Save it mov vector_segment,es pop es push ds ; @@08 push cs ; @@08 pop ds ; @@08 lea dx,intfcn_hook ; DS:DX = New INT 2fh vector mov ax,set_intfcn ; Hook the interrupt call int_21 lea dx,interrupt_hook ; DS:DX = New INT 21h vector mov ax,set_vector ; Hook the interrupt call int_21 mov dirlst_segment,cs ; save the address of the dirlist lea dx,app_dirs mov dirlst_offset,dx pop ds ; @@08 ret ; @@05 terminate: ; terminate to dos or return ; @@05 cmp res_append,0 ; @@05 jne is_res ; @@05 call Release_Environment ; release environmental vector ;ac009; dms; mov ah,term_proc ; return to DOS on first time ; @@05 call int_21 ; @@05 is_res: ; @@05 mov ax,-1 ; set abort requested ; @@05 jmp abort_exit ; must go back to COMMAND ; @@05 print_STDOUT: mov bx,STDOUT ; Standard output device handle mov ah,awrite ; function code for write call int_21 ret print_STDERR: mov bx,STDERR ; Standard output device handle mov ah,awrite call int_21 ret Release_Environment: ;an007; dms; push ax ;save regs ;an007; dms; push bx ; ;an007; dms; push es ; ;an007; dms; mov ah,Get_PSP ; get the PSP segment ;an007; dms; call int_21 ; invoke INT 21h ;an007; dms; mov es,bx ; BX contains PSP segment - put in ES ;an007; dms; mov bx,word ptr es:[PSP_Env]; get segment of environmental vector ;an007; dms; mov es,bx ; place segment in ES for Free Memory ;an007; dms; mov ah,Free_Alloc_Mem ; Free Allocated Memory ;an007; dms; int 21h ; invoke INT 21h ;an007; dms; pop es ; restore regs ;an007; dms; pop bx ; ;an007; dms; pop ax ; ;an007; dms; ret ; return to caller ;an007; dms; ;========================================================================= ; Scan_For_Equal : This routine scans the command line from the ; beginning until it encounters anything other ; than the equal, tab, or space characters. ; Register SI is sent back to the caller pointing ; to the character that does not meet the match ; criteria. ; ; Inputs : DS:SI - pointer to next parm ; ; Outputs : SI - adjusted to byte not matching the following: ; "=" ; " " ; TAB ; ; Author : David M. Sewell ; Date : 1/27/88 ; Version : DOS 3.4 ;========================================================================= Scan_For_Equal: push ax ; save regs ;an008; dms; push cx ; ;an008; dms; xor cx,cx ; clear cx ;an008; dms; mov cl,byte ptr ds:[80h] ; get length of command line ;an008; dms; Scan_For_Equal_Loop: cmp cx,0 ; at end? ;an008; dms; jbe Scan_For_Equal_Exit ; exit loop ;an008; dms; mov al,byte ptr ds:[si] ; get 1st. character ;an008; dms; call Chk_DBCS ; DBCS lead byte? ;an008; dms; jnc Scan_For_Equal_No_DBCS ; no ;an008; dms; cmp byte ptr ds:[si],DB_SP_HI ; blank lead byte ;an008; dms; jne Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms; cmp byte ptr ds:[si+1],DB_SP_LO ; DBCS blank ;an008; dms; jne Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms; add si,2 ; yes - DBCS lead byte ;an008; dms; sub dx,2 ; decrease counter ;an008; dms; jmp Scan_For_Equal_Loop Scan_For_Equal_No_DBCS: cmp al,"=" ; = found? ;an008; dms; je Scan_For_Equal_Next ; next character ;an008; dms; cmp al,20h ; space? ;an008; dms; je Scan_For_Equal_Next ; next character ;an008; dms; cmp al,09h ; tab? ;an008; dms; je Scan_For_Equal_Next ; next character ;an008; dms; jmp SHORT Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms; Scan_For_Equal_Next: inc si ; adjust ptr ;an008; dms; dec cx ; decrease counter ;an008; dms; jmp Scan_For_Equal_Loop ; continue loop ;an008; dms; Scan_For_Equal_Exit: pop cx ; ;an008; dms; pop ax ; ;an008; dms; ret ; return to caller ;an008; dms; ;========================================================================= ;an010;bgb ; do_parse_err : This routine sets up for the display of a parse ;an010;bgb ; error, and displays the offending parameter. ;an010;bgb ; ;an010;bgb ; Inputs : DS:SI - points just past offending parm in command line ;an010;bgb ; ;an010;bgb ; Outputs : si_off- parm for msg ret. ;an010;bgb ; si_seg- parm for msg ret. ;an010;bgb ; command line - hex zero at end of offending parm ;an010;bgb ; ;an010;bgb ; Date : 3/29/88 ;an010;bgb ; Version : DOS 4.0 (wow!) ;an010;bgb ;========================================================================= ;an010;bgb do_parse_err PROC ;an010;bgb ;;;;;;;;mov ax,3 ;removed- parser handles this ;an010;bgb mov bx,STDERR ; handle ;an010;bgb ;;;;;;;;xor cx,cx ; sub count ;an010;bgb mov cx,1 ;display invalid parm ;an010;bgb xor dl,dl ; no input ;an010;bgb mov dh,02 ; message class of parse error ;an010;bgb ;;;;;;;;mov cs:si_off,81h ;initialize pointer ;an010;bgb ;an010;bgb dec si ;point to last byte of invalid parm ;an010;bgb public decsi ;an010;bgb decsi: cmp byte ptr [si],' ' ;are we pointing to a space? ;an010;bgb ; $IF E,OR ;if so, we dont want to do that ;an010;bgb JE $$LL1 cmp byte ptr [si],0dh ;are we pointing to CR? ;an010;bgb ; $IF E ;if so, we dont want to do that ;an010;bgb JNE $$IF1 $$LL1: dec si ;find the last byte of parm ;an010;bgb jmp decsi ;an010;bgb ; $ENDIF ;an010;bgb $$IF1: mov byte ptr [si+1],00 ;zero terminate display string ;an010;bgb nextsi: ;an010;bgb public nextsi ;an010;bgb dec si ;look at previous char ;an010;bgb cmp byte ptr [si],' ' ;find parm separator ;an010;bgb jnz nextsi ;loop until begin of parm found ;an010;bgb ;an010;bgb mov cs:si_off,si ;mov si into display parms ;an010;bgb mov cs:si_seg,ds ;initialize pointer ;an010;bgb ret ; return to caller ;an010;bgb do_parse_err ENDP ;an010;bgb ;------------------------------------------------------------------- ; ;------------------------------------------------------------------- MSG_SERVICES <LOADmsg> MSG_SERVICES <APPEND.CLB,APPEND.CL2,APPEND.CTL> end_address: ; this is the end of the TSR stuff ;AN004; include parse.asm ; include the parser code include msgdcl.inc cseg ends sseg segment para stack 'STACK' assume ss:sseg dw 512 dup(0) mystack dw 0 sseg ends end main_begin 
29.907153
90
0.595316
883ab68149eca3bcb4bccbdbc9c1c54b348c5af1
1,905
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_12_1347.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_12_1347.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca_notsx.log_12_1347.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %r9 push %rax push %rbx push %rdi // Load mov $0x927, %r8 nop and %rdi, %rdi mov (%r8), %bx nop nop nop nop cmp %r9, %r9 // Store mov $0x267, %r15 nop cmp $23340, %rbx movb $0x51, (%r15) nop sub %rax, %rax // Load lea addresses_US+0xb4a7, %rax and $24699, %r14 movb (%rax), %r9b nop nop nop nop sub %r8, %r8 // Store lea addresses_PSE+0x192c7, %r15 clflush (%r15) nop nop xor $51702, %r8 movb $0x51, (%r15) nop nop nop nop and %rdi, %rdi // Load lea addresses_A+0xcca7, %rdi sub %rax, %rax mov (%rdi), %r9w cmp $64104, %rax // Faulty Load lea addresses_A+0xcca7, %r15 nop nop nop add $25048, %r14 vmovups (%r15), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rax lea oracles, %rbx and $0xff, %rax shlq $12, %rax mov (%rbx,%rax,1), %rax pop %rdi pop %rbx pop %rax pop %r9 pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'00': 12} 00 00 00 00 00 00 00 00 00 00 00 00 */
19.05
122
0.621522
bc4fbdcc5eef709924053bdd477ac43e1c847a93
547
asm
Assembly
Arrays.asm
WilsenHernandez/MIPS-Tutorial
9d6fe9c4a0db6013c65288f20e1471ea77466171
[ "MIT" ]
null
null
null
Arrays.asm
WilsenHernandez/MIPS-Tutorial
9d6fe9c4a0db6013c65288f20e1471ea77466171
[ "MIT" ]
null
null
null
Arrays.asm
WilsenHernandez/MIPS-Tutorial
9d6fe9c4a0db6013c65288f20e1471ea77466171
[ "MIT" ]
null
null
null
.data array: .space 12 .text main: addi $s0, $zero, 4 addi $s1, $zero, 10 addi $s2, $zero, 12 # Index = $t0 addi $t0, $zero, 0 # Index = 0 sw $s0, array($t0) # Array[0] = $s0 addi $t0, $t0, 4 # Index++ sw $s1, array($t0) # Array[1] = $s1 add $t0, $t0, 4 # Index++ sw $s2, array($t0) # Array[2] = $s2 addi $t0, $zero, 0 while: beq $t0, 12, exit lw $t1, array($t0) jal print addi $t0, $t0, 4 j while exit: li $v0, 10 syscall print: li $v0, 1 add $a0, $zero, $t1 syscall jr $ra
14.783784
37
0.506399
63f44ed607af56c501f161d48b8f12b6f801eea1
1,563
asm
Assembly
function/binarysearch.asm
zaoad/assembly-
09b282351ae46efe746bf647ccf2834433f9b177
[ "MIT" ]
null
null
null
function/binarysearch.asm
zaoad/assembly-
09b282351ae46efe746bf647ccf2834433f9b177
[ "MIT" ]
null
null
null
function/binarysearch.asm
zaoad/assembly-
09b282351ae46efe746bf647ccf2834433f9b177
[ "MIT" ]
null
null
null
segment .data scfmt : dq "%lld" ,0 newline : dq "" ,10, 0 prfmt: dq "%lld" ,10, 0 printindex: dq "index is %lld" ,10, 0 printnoelementexist: dq "%lld is not exist in index",10,0 segment .bss a: resq 1 b: resq 1 cnt: resq 1 val: resq 1 array resq 21 segment .text global main extern scanf extern printf main: push rbp mov rbp ,rsp xor rax ,rax mov rdi , scfmt mov rsi ,cnt call scanf mov rax ,[cnt] inc rax mov [cnt] ,rax mov rcx ,1 INPUT: mov rbx,[cnt] cmp RCX, rbx jge init push RCX mov RAX, 0 mov RDI, scfmt mov RSI, a call scanf mov RAX, [a] pop rcx mov [array+RCX*8], RAX inc RCX jmp INPUT init: mov rax ,0 mov rdi ,scfmt mov rsi , val call scanf mov rax, 1 push rax mov rax ,[cnt] dec rax push rax call binarysearch leave ret binarysearch: push rbp mov rbp, rsp mov rax ,[rbp+24] mov rbx ,[rbp+16] cmp rax,rbx jg printnosuchelement add rax,rbx mov rdx ,0 mov rbx ,2 div rbx mov rdx ,[array+rax*8] mov rbx,[val] cmp rbx,rdx je printexist cmp rbx,rdx jl binaryless cmp rbx ,rdx jg binarygreater callfunc: call binarysearch leave ret binaryless: mov rbx ,[rbp+24] push rbx dec rax push rax jmp callfunc binarygreater: inc rax push rax mov rbx,[rbp+16] push rbx jmp callfunc printnosuchelement: mov rax,0 mov rdi ,printnoelementexist mov rsi ,[val] call printf mov rax ,0 mov rdi ,newline call printf leave ret printexist: mov rbx ,rax mov rax ,0 mov rdi ,printindex mov rsi ,rbx call printf mov rax ,0 mov rdi ,newline call printf leave ret
12.917355
58
0.674344
a710cc548d00b7b271fb7ef3959e6ee0267a71e5
123
asm
Assembly
tools-src/gnu/binutils/gas/testsuite/gasp/crash.asm
enfoTek/tomato.linksys.e2000.nvram-mod
2ce3a5217def49d6df7348522e2bfda702b56029
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/binutils/gas/testsuite/gasp/crash.asm
unforgiven512/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/binutils/gas/testsuite/gasp/crash.asm
unforgiven512/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
Stuff to try and crash it foo: .MACRO HI bar: .MACRO THERE bar .ENDM .ENDM foo foo foo foo foo bar
5.347826
26
0.585366
827a00e315793df79aa0cc1ca1b2e5225ad83cfa
4,556
asm
Assembly
24_ANNULLA_SPAZI.asm
aleattene/lc2-exams
516ca7ea7979898238267af0bf095fc4538dac1a
[ "MIT" ]
null
null
null
24_ANNULLA_SPAZI.asm
aleattene/lc2-exams
516ca7ea7979898238267af0bf095fc4538dac1a
[ "MIT" ]
null
null
null
24_ANNULLA_SPAZI.asm
aleattene/lc2-exams
516ca7ea7979898238267af0bf095fc4538dac1a
[ "MIT" ]
null
null
null
; ************ DESCRIZIONE SOTTOPROGRAMMA ************ Il seguente sottoprogramma denominato ANNULLA_SPAZI riceve: - nel registro R0 l’indirizzo della prima cella di una zona di memoria contenente una stringa di caratteri codificati ASCII (un carattere per cella). La stringa è terminata dal valore 0 (corrispondente al carattere NUL); - nel registro R1 l’indirizzo della prima cella di una zona di memoria libera, di dimensioni sufficienti per contenere la stringa di caratteri di cui sopra. Il sottoprogramma inoltre: - trascrive la stringa dalla zona di memoria puntata da R0 a quella puntata da R1, facendo in modo che non esistano spazi doppi o multipli fra le parole, né spazi iniziali o finali (cioè prima della prima parola o dopo l’ultima parola). La stringa trascritta deve essere terminata dal valore 0 (carattere NUL); - restituisce nel registro R2 il numero totale di spazi eliminati. Si ricorda che nel codice ASCII il carattere spazio ha codifica decimale 32 (esadecimale x20). Nonostante l'utilizzo di altri registri della CPU, il sottoprogramma restituisce il controllo al programma chiamante senza che tali registri risultino alterati. ; ************ ESEMPIO FUNZIONAMENTO SOTTOPROGRAMMA ************ INPUT R0 punta alla zona di memoria contenente la stringa “ Un esempio di frase con spazi multipli tra le parole e spazi iniziali e finali inutili ” R1 punta all’inizio di una zona di memoria libera OUTPUT R1 punta all’inizio della zona di memoria prima libera, che ora contiene la stringa “Un esempio di frase con spazi multipli tra le parole e spazi iniziali e finali inutili” R2 contiene il valore 12 ; ********* PROGRAMMA TEST ************* .orig x3000 LEA R0, stringaS ; in R0 <- indirizzo inizio stringaS (array) LEA R1, stringaR ; in R1 <- indirizzo inizio stringaR (vuota) ; ********* SOTTOPROGRAMMA ************* ; ANNULLA_SPAZI ; nome sottoprogramma ST R3, store3 ; contenuto R3 -> in cella indirizzo store3 ST R4, store4 ; contenuto R4 -> in cella indirizzo store4 ST R5, store5 ; contenuto R5 -> in cella indirizzo store5 ST R6, store6 ; contenuto R6 -> in cella indirizzo store6 LD R2, spazio ; in R2 <- decimanele opposto ASCII "spazio" AND R5,R5,#0 ; azzero contatore spazi inutili (da eliminare) AND R6,R6,#0 ; contatore "spazio_init" e "ASCII null (/0)" ciclo LDR R3,R0,#0 ; in R3 <- ASCII carat puntato da R0 (stringaS) BRZ fine ; se zero sequenza (stringaS) finita -> fine ; altrimenti.... ADD R4,R3,R2 ; confronto carattere stringa con spazio BRZ ver_spazio ; se trovo uno spazio "analizzo" la tipologia ; altrimenti..... scrivi STR R3,R1,#0 ; scrivo carattere cella stringaS in stringaR ADD R0,R0,#1 ; incremento cella puntata da R0 (stringa S) ADD R1,R1,#1 ; incremento cella puntata da R1 (stringa R) BRNZP ciclo ; continuo scansione stringa sino fine (/0) ver_spazio AND R6,R6,R6 ; verifico check spazio inziale BRZ el_spazio ; se spazio inizio stringa lo elimino LDR R4,R0,#1 ; leggo carattere successivo stringaS BRZ el_spazio ; se fine stringa (null /0) elimino spazio ADD R4,R4,R2 ; altrimenti confronto carattere - spazio BRZ el_spazio ; se trovo un altro spazio lo elimino BRNP scrivi ; altrimenti è uno spazio da lasciare... el_spazio ADD R6,R6,#1 ; incremento check spazio init (init stringaS) ADD R5,R5,#1 ; incremento contatore spazi inutili ADD R0,R0,#1 ; incremento cella puntata da R0 (stringaS) BRNZP ciclo ; continuo scansione stringa sino fine (/0) fine AND R6,R6,#0 ; azzero contatore R6 -> per ASCII /0 stringaR STR R6,R1,#0 ; contenuto R6 -> in cella puntata da R1 (/0) ADD R2,R5,#0 ; in R2 <- valore R5 (contatore spazi inutili) LD R3, store3 ; contenuto cella indirizzo store3 -> in R3 LD R4, store4 ; contenuto cella indirizzo store4 -> in R4 LD R5, store5 ; contenuto cella indirizzo store5 -> in R5 LD R6, store6 ; contenuto cella indirizzo store6 -> in R6 ; RET ; ritorno da sottoprogramma ; ********* VAR / COST ************* store3 .blkw 1 ; riservo una cella di memora per contenuto R3 store4 .blkw 1 ; riservo una cella di memora per contenuto R4 store5 .blkw 1 ; riservo una cella di memora per contenuto R5 store6 .blkw 1 ; riservo una cella di memora per contenuto R6 stringaS .stringz " Un esempio di frase con spazi multipli tra le parole e spazi inizliali e finali inutili " stringaR .blkw 88 ; riservo 88 celle memoria per stringaR spazio .fill #-32 ; valore decimale opposto carat ASCII "spazio" .end ; fine programma
44.666667
120
0.724759
d86db9764617b61302ea838aa3815bc6d24ef52a
496
asm
Assembly
examples/lib/settings.asm
michielvoo/snes
17addd20de4a78d4287618c212e7dce82351c5fc
[ "MIT" ]
51
2015-04-29T04:44:56.000Z
2019-12-04T05:59:35.000Z
examples/lib/settings.asm
michielvoo/super
17addd20de4a78d4287618c212e7dce82351c5fc
[ "MIT" ]
6
2015-07-29T04:35:33.000Z
2015-07-29T04:36:49.000Z
examples/lib/settings.asm
michielvoo/super
17addd20de4a78d4287618c212e7dce82351c5fc
[ "MIT" ]
5
2015-08-20T09:03:29.000Z
2019-02-08T00:10:26.000Z
; Register settings ; Auto-increment VMADD after reading from VMDATAL or writing to VMDATAREADL .DEFINE VMAINC_INC_L $00 ; Auto-increment VMADD after reading from VMDATAH or writing to VMDATAREADH .DEFINE VMAINC_INC_H $80 ; Enable joypad auto-read .DEFINE NMITIMEN_JOY_ENABLE $01 ; Enable NMI after H counter == HTIME .DEFINE NMITIMEN_IRQ_ENABLE_HTIME %00010000 ; Enable IRQ after V counter == VTIME .DEFINE NMITIMEN_IRQ_ENABLE_VTIME %00100000 ; Enable IRQ .DEFINE NMITIMEN_NMI_ENABLE $80
24.8
75
0.800403
0dd6ede4d29f8fa5d61ea7660970500015611b15
868
asm
Assembly
oeis/084/A084253.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/084/A084253.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/084/A084253.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A084253: a(n) is the denominator of the coefficient of z^(2n-1) in the Maclaurin expansion of Sqrt[Pi]Erfi[z]. ; 1,3,5,21,108,660,4680,37800,342720,3447360,38102400,459043200,5987520000,84064780800,1264085222400,20268952704000,345226033152000,6224529991680000,118443913555968000,2372079457972224000,49874491167621120000,1098455256691752960000,25290016374996172800000,607522393363796951040000,15200985842464366264320000,395535856104940142592000000,10687223719855049342976000000,299443909886504684421120000000,8689317821433845024292864000000,260831978815321207659036672000000,8090212224271827288407408640000000 lpb $0 mov $2,$0 lpb $0 add $1,1 add $3,1 lpb $0 lpb $3 sub $0,$3 div $3,9 lpe sub $3,$1 add $1,$0 lpe lpe lpe mul $1,2 add $1,1 add $3,$0 mov $0,$1 lpb $3 mul $0,$2 sub $2,1 sub $3,1 lpe
31
497
0.752304
0df31cbb42f4fff9df64a014c0dfe89d438493da
300
asm
Assembly
libsrc/stdio/rcmx000/getk.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/stdio/rcmx000/getk.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/stdio/rcmx000/getk.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; ; RCM2/3000 Stdio ; ; $Id: getk.asm,v 1.2 2015/01/21 08:09:27 stefano Exp $ ; PUBLIC getk EXTERN rcmx000_cnvtab EXTERN __recvchar .getk ; extern int __LIB__ fgetc(FILE *fp); ; return result in HL, when done ; We ignore FILE* fp (in BC) for now call __recvchar ld h,0 ld l,a ret
12.5
55
0.663333
a78ff3bce62b9ce2774c8f344f26f4062054a666
2,636
asm
Assembly
dbi_clients_src/pin/pin-3.6-97554-g31f0a167d-gcc-linux/source/tools/Probes/do_nothing_intel64.asm
DigitalAlchemist/fuzzwatch
32517e7b80b680dd658e833ed2dfdd88744e6694
[ "Apache-2.0" ]
326
2019-08-10T21:17:22.000Z
2022-03-22T08:40:47.000Z
dbi_clients_src/pin/pin-3.6-97554-g31f0a167d-gcc-linux/source/tools/Probes/do_nothing_intel64.asm
DigitalAlchemist/fuzzwatch
32517e7b80b680dd658e833ed2dfdd88744e6694
[ "Apache-2.0" ]
42
2019-08-13T12:48:19.000Z
2021-11-03T12:57:59.000Z
dbi_clients_src/pin/pin-3.6-97554-g31f0a167d-gcc-linux/source/tools/Probes/do_nothing_intel64.asm
DigitalAlchemist/fuzzwatch
32517e7b80b680dd658e833ed2dfdd88744e6694
[ "Apache-2.0" ]
66
2019-08-10T21:41:38.000Z
2022-03-17T13:03:42.000Z
; BEGIN_LEGAL ; Intel Open Source License ; ; Copyright (c) 2002-2017 Intel Corporation. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are ; met: ; ; Redistributions of source code must retain the above copyright notice, ; this list of conditions and the following disclaimer. Redistributions ; in binary form must reproduce the above copyright notice, this list of ; conditions and the following disclaimer in the documentation and/or ; other materials provided with the distribution. Neither the name of ; the Intel Corporation nor the names of its contributors may be used to ; endorse or promote products derived from this software without ; specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ; ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; END_LEGAL COMMENT // contains important code patterns COMMENT // doesn't actually do anything COMMENT // make sure the relocated entry will copy more than one basic block. .code PUBLIC do_nothing do_nothing PROC test rax, rax je lab1 xor rax, rax xor rax, rax lab1: xor rax, rax xor rax, rax ret do_nothing ENDP COMMENT // make sure the relocated entry will correctly handle a jump as the last COMMENT // instruction in the basic block. PUBLIC nothing_doing nothing_doing PROC test rax, rax test rax, rax je lab2 xor rax, rax xor rax, rax lab2: xor rax, rax xor rax, rax ret nothing_doing ENDP COMMENT // call should be replaced with a push/jmp when relocated. PUBLIC call_function call_function PROC push rbx call do_nothing pop rbx ret call_function ENDP COMMENT // make sure this code pattern works PUBLIC call_nothing call_nothing PROC push rax mov rax, rax push rbx call do_nothing pop rbx pop rax ret call_nothing ENDP END
27.175258
81
0.752656
132e54e1cee6cf06888521e1a4b107609247edb1
800
asm
Assembly
programs/oeis/086/A086945.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/086/A086945.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/086/A086945.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A086945: a(n) = 7*10^n - 9. ; 61,691,6991,69991,699991,6999991,69999991,699999991,6999999991,69999999991,699999999991,6999999999991,69999999999991,699999999999991,6999999999999991,69999999999999991,699999999999999991,6999999999999999991,69999999999999999991,699999999999999999991,6999999999999999999991,69999999999999999999991,699999999999999999999991,6999999999999999999999991,69999999999999999999999991,699999999999999999999999991,6999999999999999999999999991,69999999999999999999999999991,699999999999999999999999999991,6999999999999999999999999999991,69999999999999999999999999999991,699999999999999999999999999999991,6999999999999999999999999999999991,69999999999999999999999999999999991,699999999999999999999999999999999991 mov $1,10 mov $2,$0 add $2,1 pow $1,$2 mul $1,7 sub $1,9 mov $0,$1
72.727273
701
0.89375
b0244aad9ae4365c37ab6d4cc805e091f944ba90
2,309
asm
Assembly
engine/battle/link_result.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
engine/battle/link_result.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
engine/battle/link_result.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
DetermineLinkBattleResult: farcall UpdateEnemyMonInParty ld hl, wPartyMon1HP call .CountMonsRemaining push bc ld hl, wOTPartyMon1HP call .CountMonsRemaining ld a, c pop bc cp c jr z, .even_number_of_mons_remaining jr c, .defeat jr .victory .even_number_of_mons_remaining call .BothSides_CheckNumberMonsAtFullHealth jr z, .drawn ld a, e cp $1 jr z, .victory cp $2 jr z, .defeat ld hl, wPartyMon1HP call .CalcPercentHPRemaining push de ld hl, wOTPartyMon1HP call .CalcPercentHPRemaining pop hl ld a, d cp h jr c, .victory jr z, .compare_lo jr .defeat .compare_lo ld a, e cp l jr z, .drawn jr nc, .defeat .victory ld a, [wBattleResult] and $f0 ld [wBattleResult], a ; WIN ret .defeat ld a, [wBattleResult] and $f0 add LOSE ld [wBattleResult], a ret .drawn ld a, [wBattleResult] and $f0 add DRAW ld [wBattleResult], a ret .CountMonsRemaining: ld c, 0 ld b, 3 ld de, PARTYMON_STRUCT_LENGTH - 1 .loop ld a, [hli] or [hl] jr nz, .not_fainted inc c .not_fainted add hl, de dec b jr nz, .loop ret .CalcPercentHPRemaining: ld de, 0 ld c, $3 .loop2 ld a, [hli] or [hl] jr z, .next dec hl xor a ldh [hDividend + 0], a ld a, [hli] ldh [hDividend + 1], a ld a, [hli] ldh [hDividend + 2], a xor a ldh [hDividend + 3], a ld a, [hli] ld b, a ld a, [hld] srl b rr a srl b rr a ldh [hDivisor], a ld b, $4 call Divide ldh a, [hQuotient + 3] add e ld e, a ldh a, [hQuotient + 2] adc d ld d, a dec hl .next push de ld de, $2f add hl, de pop de dec c jr nz, .loop2 ret .BothSides_CheckNumberMonsAtFullHealth: ld hl, wPartyMon1HP call .CheckFaintedOrFullHealth jr nz, .finish ; we have a pokemon that's neither fainted nor at full health ld hl, wOTPartyMon1HP call .CheckFaintedOrFullHealth ld e, $1 ; victory ret .finish ld hl, wOTPartyMon1HP call .CheckFaintedOrFullHealth ld e, $0 ; drawn ret nz ; we both have pokemon that are neither fainted nor at full health ld e, $2 ; defeat ld a, $1 ; not drawn and a ret .CheckFaintedOrFullHealth: ld d, 3 .loop3 ld a, [hli] ld b, a ld a, [hli] ld c, a or b jr z, .fainted_or_full_health ld a, [hli] cp b ret nz ld a, [hld] cp c ret nz .fainted_or_full_health push de ld de, PARTYMON_STRUCT_LENGTH - 2 add hl, de pop de dec d jr nz, .loop3 ret
14.165644
77
0.680814
eb7b064515e40644e2a68947f8805b94a55f96cc
941
asm
Assembly
OS/disk.asm
logictech31/myprojects
95e92802ff0f713e13c11c541a5e5c4473e1a3e2
[ "MIT" ]
1
2021-06-12T08:08:08.000Z
2021-06-12T08:08:08.000Z
OS/disk.asm
logictech31/myprojects
95e92802ff0f713e13c11c541a5e5c4473e1a3e2
[ "MIT" ]
null
null
null
OS/disk.asm
logictech31/myprojects
95e92802ff0f713e13c11c541a5e5c4473e1a3e2
[ "MIT" ]
null
null
null
disk_load: pusha ; pushes all the flags push dx ; pushes data register mov ah, 0x02 ; read data from disk mov al, dh ; mov cl, 0x02 ; setting and starting from sector 2 ; as sector 1 is our boot sector mov ch, 0x00 ; setting cylinder 0 mov dh, 0x00 ; setting head 0 mov dl, 0x00 ; to read from floppy where we are going to compile the code ; dl = drive number is set as input to disk_load ; es:bx = buffer pointer is set as input as well int 0x13 ; BIOS interrupt jc disk_error ; check carry bit for error pop dx ; get back original number of sectors to read cmp al, dh ; BIOS sets 'al' to the # of sectors actually read ; compare it to 'dh' and error out if they are not equal jne sectors_error popa ret disk_error: jmp disk_loop sectors_error: jmp disk_loop disk_loop: jmp $
28.515152
78
0.618491
66b42b9e4386c62d923ec8fc0c1b13e00af6aebc
2,489
asm
Assembly
pi.asm
msiemens/rust-tinyasm
1549d75260b9d523d4ecebd2033b098ef5e5f156
[ "MIT", "Unlicense" ]
14
2015-02-24T01:39:42.000Z
2022-03-30T10:55:55.000Z
pi.asm
msiemens/rust-tinyasm
1549d75260b9d523d4ecebd2033b098ef5e5f156
[ "MIT", "Unlicense" ]
null
null
null
pi.asm
msiemens/rust-tinyasm
1549d75260b9d523d4ecebd2033b098ef5e5f156
[ "MIT", "Unlicense" ]
2
2021-01-19T20:52:32.000Z
2022-03-30T10:55:56.000Z
; Approximate PI ; -------------- ; ; by Markus Siemens <markus@es-netze.de> ; Define constants $max_rand_square = 144 ; (RAND_MAX/2) ** 2 ; Approximate PI $pi_iterations = 100 ; Iteration count $pi_rand_divider = 2 ; Divide the RANDOM numbers by this, so we don't overflow $pi_counter = [_] ; Loop counter $pi_rand0 = [_] ; First RANDOM number $pi_rand1 = [_] ; Second RANDOM number $pi_rand_sum = [_] $pi_inside = [_] ; Number of dots inside the circle ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; main: MOV $pi_counter 0 ; Initialize memory main_loop: ; The main loop ; Loop break condition: $pi_counter == $pi_iterations JEQ :print $pi_counter $pi_iterations APRINT '.' MOV $pi_rand_sum 0 ; Reset sum of rand0^2 and rand1^2 ; Get random numbers RANDOM $pi_rand0 @call(divide, $pi_rand0, $pi_rand_divider) ; $pi_rand0 ^ 2 would overflow otherwise MOV $pi_rand0 $return RANDOM $pi_rand1 @call(divide, $pi_rand1, $pi_rand_divider) ; $pi_rand1 ^ 2 would overflow otherwise MOV $pi_rand1 $return @call(multiply, $pi_rand0, $pi_rand0) MOV $pi_rand0 $return @call(multiply, $pi_rand1, $pi_rand1) MOV $pi_rand1 $return ADD $pi_rand_sum $pi_rand0 ; Add $pi_rand0^2 and $pi_rand1^2 ADD $pi_rand_sum $pi_rand1 ; If $pi_rand_sum > $MAX_RAND_SQUARE, GOTO FI JGT :pi_fi_indot $pi_rand_sum $max_rand_square ADD $pi_inside 1 pi_fi_indot: ; If pi_counter_0 == 255 ADD $pi_counter 1 JMP :main_loop ; Next loop iteration print: ; SUBROUTINE ; Calculate PI using 'inside / total * 4' as float APRINT '\n' DPRINT $pi_inside APRINT '/' DPRINT $pi_iterations APRINT '*' DPRINT 4 JMP :end end: ; SUBROUTINE ; End the programm execution HALT #import <lib/math/multiply.asm> #import <lib/math/divide.asm>
33.186667
94
0.485737
02e7f483c57432ffc2e4d96a5c7973a8ae759479
20,633
asm
Assembly
kernel.asm
ggml1/Bootloader
61dc8947143ee549104bedc55156901a5efb3438
[ "MIT" ]
null
null
null
kernel.asm
ggml1/Bootloader
61dc8947143ee549104bedc55156901a5efb3438
[ "MIT" ]
null
null
null
kernel.asm
ggml1/Bootloader
61dc8947143ee549104bedc55156901a5efb3438
[ "MIT" ]
null
null
null
org 0x7e00 jmp 0x0000:START %macro random 1 mov word [modulo], %1 call RAND %endmacro modulo dw 0 RAND: mov ah, 00h ; interrupt to get system time int 1ah ; CX:DX has number of clock ticks since midnight (00:00) mov ax, dx xor dx, dx mov cx, word [modulo] div cx mov cx, 1 ret START: xor ax, ax mov ds, ax mov es, ax mov bl, 15 mov al, 10h int 10h call RESET_CURSOR call PRINT_LOGO mov ah, 2 mov bh, 0 mov dh, 14 mov dl, 17 int 10h mov si, login call PRINT mov di, username ; READ occurs in di call READ call CLEAR_SCREEN startBegin: mov si, startHeader1 call PRINT_COLOR mov si, startHeader2 call PRINT_COLOR mov si, startHeader3 call PRINT mov si, startHeader4 call PRINT_COLOR mov si, startHeader5 call PRINT_COLOR .while: mov si, username call PRINT_COLOR mov si, aux call PRINT mov di, command call READ call ANALYZE_COMMAND jmp .while jmp end STRCMP: lodsb ; getting current char pointed by SI and putting it on AL ;;;;;; ; mov ah, 0xe ; mov bh, 0 ; int 10h ;;debug cmp byte[di], al ;comparing loaded byte from [ES:SI] with [ES:DI] jne .false ; if different, then strings aren't equal cmp al, 0 ; string end? then analyze if it is also the end of the other one je .si_end cmp byte[di], 0 ; same as above je .di_end inc di jmp STRCMP .si_end: cmp byte[di], 0 je .true jmp .false .di_end: cmp al, 0 je .true jmp .false .true: mov cx, 1 ret .false: mov cx, 0 ret RESET_CURSOR: mov ah, 2 mov bh, 0 mov dh, 0 mov dl, 0 int 10h ret GENERATE_RANDOM_NUMBER: random 1000 mov dh, 0 mov ax, dx ret ANALYZE_COMMAND: .help: mov di, command mov si, help xor cx, cx call STRCMP cmp cl, 0 je .clear ; if its not help, try exit mov si, menu1 call PRINT mov si, menu2 call PRINT mov si, getHelpChoice call PRINT mov di, temp call READ mov di, temp mov si, choice1 ; comparing with '1' call STRCMP cmp cl, 1 je .help.choice1 mov di, temp mov si, choice2 ; comparing with '2' call STRCMP cmp cl, 1 je .help.choice2 jmp .error .help.choice1: mov si, availableCommands1 call PRINT mov si, availableCommands2 call PRINT mov si, availableCommands3 call PRINT mov si, availableCommands4 call PRINT mov si, availableCommands5 call PRINT mov si, availableCommands6 call PRINT mov si, availableCommands7 call PRINT mov si, availableCommands8 call PRINT jmp .done .help.choice2: mov si, creditsHelp call PRINT jmp .done .clear: mov di, command mov si, clearCommand call STRCMP cmp cl, 0 je .game ; if command is not clear, try game call CLEAR_SCREEN jmp .done .game: mov di, command mov si, gameCommand call STRCMP cmp cl, 0 je .exit ; if command is not game, try exit mov si, gamePresentation1 call PRINT mov si, gamePresentation2 call PRINT mov si, gamePresentation3 call PRINT mov si, gamePresentation4 call PRINT mov si, gamePresentation5 call PRINT mov si, gamePresentation6 call PRINT mov si, gamePresentation7 call PRINT mov si, gamePresentation8 call PRINT mov si, gamePresentation9 call PRINT mov si, gamePresentation10 call PRINT mov si, gamePresentation11 call PRINT mov si, gamePresentation12 call PRINT mov si, gamePresentation13 call PRINT mov di, temp call READ mov di, temp mov si, y call STRCMP cmp cl, 0 je .done call GENERATE_RANDOM_NUMBER push ax xor dx, dx .game.while: cmp dl, 10 je .game.tooManyTries inc dl mov si, askInput call PRINT mov di, guess call READ mov di, guessNumber mov si, guess call transform mov di, guessNumber mov ah, byte[di] inc di mov al, byte[di] dec di mov bx, ax pop ax cmp ax, bx jg .game.high cmp ax, bx jl .game.low mov si, correctAnswer1 call PRINT_COLOR mov si, correctAnswer2 call PRINT mov si, correctAnswer3 call PRINT_COLOR jmp .game.done .game.high: push ax mov si, numberIsHigher call PRINT_COLOR jmp .game.while .game.low: push ax mov si, numberIsLower call PRINT_COLOR jmp .game.while .game.tooManyTries: mov si, wrongAnswer1 call PRINT_COLOR mov si, wrongAnswer2 call PRINT mov si, wrongAnswer3 call PRINT_COLOR pop ax jmp .game.done .game.done: jmp .done .exit: mov di, command mov si, exit xor cx, cx call STRCMP cmp cl, 0 je .credits ; if its not exit, try credits mov si, ctz call PRINT mov di, temp call READ mov di, temp mov si, y call STRCMP cmp cl, 1 je end jmp .done .credits: mov di, command mov si, creditsCommand xor cx, cx call STRCMP cmp cl, 0 je .add ; if not credits, try add mov si, credits0 call PRINT mov si, credits1 call PRINT mov si, credits2 call PRINT mov si, credits3 call PRINT mov si, credits4 call PRINT mov si, credits5 call PRINT jmp .done .add: mov di, command mov si, addCommand xor cx, cx call STRCMP cmp cl, 0 je .sub ; if its not add, try sub mov si, escolha call PRINT call READ_NUMBER add ax, bx mov di, valuef mov byte[di], ah inc di mov byte[di], al dec di mov si, valuef mov di, numf call transform2 mov si, numf call inverte_str mov si, numf call PRINT ; continue addition jmp .done .sub: mov di, command mov si, subCommand xor cx, cx call STRCMP cmp cl, 0 je .mult ; if its not sub, try mult mov si, escolhaSub call PRINT call READ_NUMBER mov cx, 0 cmp ax, bx jge .positivo mov cx, 1 xor ax, bx xor bx, ax ; swap xor ax, bx .positivo: sub ax, bx cmp cx, 0 je .certo mov si, menos push ax call PRINT pop ax .certo: mov di, valuef mov byte[di], ah inc di mov byte[di], al dec di mov si, valuef mov di, numf call transform2 mov si, numf call inverte_str mov si, numf call PRINT ; work sub jmp .done .mult: mov di, command mov si, multCommand xor cx, cx call STRCMP cmp cl, 0 je .div ; if its not mult, try div mov si, escolhaMult call PRINT call READ_NUMBER mul bx mov di, valuef mov byte[di], ah inc di mov byte[di], al dec di mov si, valuef mov di, numf call transform2 mov si, numf call inverte_str mov si, numf call PRINT ; work mult jmp .done .div: mov di, command mov si, divCommand xor cx, cx call STRCMP cmp cl, 0 je .error ; if its not sub, then its error mov si, escolhaDiv call PRINT call READ_NUMBER mov si, value2 mov di, zeroString call STRCMP cmp cl, 0 je .div.byZero mov si, quotientResult call PRINT mov si, value1 mov ah, byte[si] inc si mov al, byte[si] mov si, value2 mov bh, byte[si] inc si mov bl, byte[si] dec si xor dx, dx cmp bx, 0 je .div.byZero div bx mov di, valuef mov byte[di], ah inc di mov byte[di], al dec di mov si, valuef mov di, numf call transform2 mov si, numf call inverte_str mov si, numf call PRINT mov si, remainderResult call PRINT mov si, value1 mov ah, byte[si] inc si mov al, byte[si] mov si, value2 mov bh, byte[si] inc si mov bl, byte[si] dec si xor dx, dx div bx mov ax, dx mov di, valuef mov byte[di], ah inc di mov byte[di], al dec di mov si, valuef mov di, numf call transform2 mov si, numf call inverte_str mov si, numf call PRINT ; work div jmp .done .div.byZero: mov si, divByZero call PRINT jmp .done .error: mov di, command mov si, unknownCommand call PRINT jmp .done .done: ret READ_NUMBER: mov di, num1 call READ mov di, value1 mov si, num1 call transform mov di, num2 call READ mov di, value2 mov si, num2 call transform mov di, value1 mov ah, byte[di] inc di mov al, byte[di] dec di mov di, value2 mov bh, byte[di] inc di mov bl, byte[di] dec di ret transform2: mov bh, byte[si] inc si mov bl, byte[si] dec si cmp bx, 0 je .end2 mov ch, 0 mov cl, 10 .for1: cmp bx, 0 je .end mov ax, bx mov dx, 0 div cx mov bx, ax mov ax, dx add al, '0' stosb jmp .for1 .end: mov al, 0 stosb ret .end2: mov al, '0' stosb mov al, 0 stosb ret transform: xor ax, ax xor bx, bx xor cl, cl .for1: push si mov ch, 0 add si, cx mov ch, byte[si] cmp ch, 0 je .end sub ch, '0' mov ax, 0 mov al, 10 mul bl mov bx, ax add bl, ch inc cl pop si jmp .for1 .end: mov byte[di], bh inc di mov byte[di], bl dec di pop si ret inverte_str: xor cx, cx .for1: mov dx, si add si, cx cmp byte[si], 0 je .endfor1 movzx bx, byte[si] push bx mov si, dx inc cx jmp .for1 .endfor1: mov si, dx xor ax, ax .for2: cmp ax, cx je .end mov dx, si add si, ax pop bx mov byte[si], bl inc ax mov si, dx jmp .for2 .end: mov si, dx add si, cx mov byte[si], 10 mov si, dx add si, cx add si, 1 mov byte[si], 13 add si, 1 mov byte[si], 0 ret READ: xor cx, cx mov bl, 15 .for1: mov ah, 0 int 16h cmp al, 0x0d ;string end je .end cmp al, 0x08 je .backspace mov ah, 0x0e int 10h inc cx stosb jmp .for1 .backspace: cmp cl, 0 ; goes back if theres nothing to erase je .for1 ; removing last character dec cx dec di mov ah, 0x0e mov al, 0x08 ;;printing backspace int 10h mov al, 0x20 ;;printing space int 10h mov al, 0x08 ;printing backspace again int 10h jmp .for1 .end: mov al, 0 stosb mov ah, 0x0e mov al, 10 int 10h mov al, 13 int 10h ret PRINT_COLOR: lodsb cmp al, 0 je .done mov ah, 0xe mov bl, 2 int 10h jmp PRINT_COLOR .done: ret PRINT: lodsb cmp al, 0 je .done mov ah, 0xe mov bl, 15 int 10h jmp PRINT .done: ret CLEAR_SCREEN: mov dx, 4500 xor cx, cx .while: mov ah, 0x0e mov al, 0x20 ;print space int 10h dec dx cmp dx, 0 je .end jmp .while .end: mov ah, 2 mov bh, 0 mov dh, 0 mov dl, 0 int 10h jmp startBegin PRINT_LOGO: mov ah, 2 mov bh, 0 mov dh, 2 mov dl, 7 int 10h mov si, line1 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 3 mov dl, 7 int 10h mov si, line2 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 4 mov dl, 7 int 10h mov si, line3 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 5 mov dl, 7 int 10h mov si, line4 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 6 mov dl, 7 int 10h mov si, line5 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 7 mov dl, 7 int 10h mov si, line6 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 8 mov dl, 7 int 10h mov si, line7 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 9 mov dl, 7 int 10h mov si, line8 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 10 mov dl, 7 int 10h mov si, line9 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 11 mov dl, 7 int 10h mov si, line10 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 12 mov dl, 7 int 10h mov si, line11 call PRINT_COLOR mov ah, 2 mov bh, 0 mov dh, 13 mov dl, 7 int 10h ret end: jmp $ var: menos db '-', 0 login db 'Type your login: ', 0 aux db '@cin:~$ ', 0 line1 db ' .----------------. .----------------. .----------------. ', 10, 13, 0 line2 db '| .--------------. | | .--------------. | | .--------------. |', 10, 13, 0 line3 db '| | _____ | | | | _______ | | | | ____ ____ | |', 10, 13, 0 line4 db '| | |_ _| | | | | / ____ | | | | ||_ \ / _|| |', 10, 13, 0 line5 db '| | | | | | | | / / \_| | | | | | \/ | | |', 10, 13, 0 line6 db '| | | | _ | | | | | | | | | | | |\ /| | | |', 10, 13, 0 line7 db '| | _| |__/ | | | | | \ \_____/\ | | | | _| |_\/_| |_ | |', 10, 13, 0 line8 db '| | |________| | | | | \_______/ | | | ||_____||_____|| |', 10, 13, 0 line9 db '| | | | | | | | | | | |', 10, 13, 0 line10 db '| |--------------| | | |--------------| | | |--------------| |', 10, 13, 0 line11 db ' ------------------ ------------------ ------------------ ', 10, 13, 0 username: times 20 db 0 command: times 20 db 0 num1: times 10 db 0 num2: times 10 db 0 numf: times 10 db 0 value1: times 4 db 0 value2: times 4 db 0 valuef: times 4 db 0 temp: times 10 db 0 guess: times 10 db 0 generated: times 6 db 0 answer: times 6 db 0 guessNumber: times 20 db 0 startHeader1 db 'LCM Terminal - Version 16.23.49.1', 10, 13, 0 startHeader2 db 'Type ', 0 startHeader3 db '"help" ', 0 startHeader4 db 'for more information.', 10, 13, 0 startHeader5 db '---------------------------------', 10, 13, 0 askInput db 'Enter your guess: (positive integer): ', 0 numberIsLower db '---- The answer is lower than your input ----', 10, 13, 0 numberIsHigher db '---- The answer is higher than your input ----', 10, 13, 0 correctAnswer1 db 10, '******************************************************', 10, 13, 0 correctAnswer2 db '****** You guessed the number! Congratulations! ******', 10, 13, 0 correctAnswer3 db '******************************************************', 10, 10, 13, 0 wrongAnswer1 db 10, '**************************************************************', 10, 13, 0 wrongAnswer2 db '****** You took too long to find the number. Try again! ******', 10, 13, 0 wrongAnswer3 db '**************************************************************', 10, 10, 13, 0 gamePresentation1 db 10, '********************* SMART GUESSING *********************', 10, 13, 0 gamePresentation2 db '** This games objective is to correctly guess which **', 10, 13, 0 gamePresentation3 db '** number the computer has randomly generated, ranging **', 10, 13, 0 gamePresentation4 db '** from 0 to 999 (inclusive). On each round, you will **', 10, 13, 0 gamePresentation5 db '** enter a number you think is the right one. If your **', 10, 13, 0 gamePresentation6 db '** number is higher than the answer, the computer will **', 10, 13, 0 gamePresentation7 db '** output LOWER, and HIGHER if it is lower. If you get **', 10, 13, 0 gamePresentation8 db '** a congratulation message, it means you chose the **', 10, 13, 0 gamePresentation9 db '** correct number and the game is terminated. **', 10, 13, 0 gamePresentation10 db '** **', 10, 13, 0 gamePresentation11 db '** BE CAREFUL: YOU ONLY HAVE 10 TRIES. If you do not **', 10, 13, 0 gamePresentation12 db '** answer correctly in 10 tries, you will lose the game **', 10, 13, 0 gamePresentation13 db '******************* INPUT "Y" TO BEGIN ******************', 10, 13, 0 debug db 'debug', 10, 13, 0 help db 'help', 0 exit db 'exit', 0 menu1 db '(op) Operations', 10, 13, 0 menu2 db '(cr) Credits', 10, 13, 0 getHelpChoice db 10, 'Your choice: ', 0 choice1 db 'op', 0 choice2 db 'cr', 0 creditsHelp db 10, 13, 'Type credits on the terminal to see that section.', 10, 13, 0 creditsCommand db 'credits', 0 addCommand db 'add', 0 subCommand db 'sub', 0 multCommand db 'mult', 0 divCommand db 'div', 0 gameCommand db 'play game', 0 quotientResult db 'Quotient: ', 0 remainderResult db 'Remainder: ', 0 clearCommand db 'clear', 0 availableCommands1 db 10, 13, 'There are 7 commands you can use: ', 10, 13, 0 availableCommands2 db 'Addition: type "add" for more info.', 10, 13, 0 availableCommands3 db 'Subtraction: type "sub" for more info.', 10, 13, 0 availableCommands4 db 'Multiplication: type "mult" for more info.', 10, 13, 0 availableCommands5 db 'Division: type "div" for more info.', 10, 13, 0 availableCommands6 db 'Clear screen: type "clear".', 10, 13, 0 availableCommands7 db 'Guessing game: type "play game".', 10, 13, 0 availableCommands8 db 'Exit terminal: type "exit".', 10, 13, 0 unknownCommand db 'Unknown command. Type help for more information.', 10, 13, 0 ctz db 'Are you sure you want to exit the program?', 10, 13, '[Y/N]', 10, 13, 0 escolha db 'Input two numbers to be added, one on each line: ', 10, 13, 0 escolhaMult db 'Input two numbers to be multiplied, one on each line: ', 10, 13, 0 escolhaDiv db 'Input two numbers to be divided, one on each line: ', 10, 13, 0 escolhaSub db 'Input two numbers to be subtracted, one on each line: ', 10, 13, 0 divByZero db 'You cant divide by zero. Choose another number and try again.', 10, 13, 0 y db 'Y', 0 zeroString db '0', 0 credits0 db 10, '-----------------------------------------', 10, 13, 0 credits1 db '------- Bootloader created by: --------', 10, 13, 0 credits2 db '------- Gabriel Mendes - @ggml --------', 10, 13, 0 credits3 db '------- Matheus Leon - @mlan --------', 10, 13, 0 credits4 db '------- Clodes Fernando - @cfms3 --------', 10, 13, 0 credits5 db '-----------------------------------------', 10, 10, 13, 0 ; 10 is \n ; 13 is tab to go back to line begin
19.373709
103
0.493821
4ce0e7955d19480f77719e93c82b0c2207e0fcfa
1,849
asm
Assembly
Library/Spreadsheet/Spreadsheet/spreadsheetVariable.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetVariable.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetVariable.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: GeoCalc FILE: spreadsheetVariable.def AUTHOR: Gene Anderson, Feb 27, 1991 REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/27/91 Initial revision DESCRIPTION: Global varibles for the spreadsheet object. $Id: spreadsheetVariable.asm,v 1.1 97/04/07 11:13:35 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ idata segment ; ; Never ever add anything here that isn't read-only. ; ; Having buffers that you can write to in a library isn't cool unless you ; have a semaphore to control access to them. ; ; ; Table of function tokens. ; ; Make sure the order of this table matches that of funcNameTable. ; funcIDTable word FUNCTION_ID_SPREADSHEET_CELL ; @CELL function ; ; One entry for each function. Contains the flags to or in with the ; PP_flags when the function is parsed. ; funcFlagsTable word mask PF_CONTAINS_DISPLAY_FUNC ; ; A list of offsets into dgroup where the names of the functions are ; ; Make sure the order of this table matches that of funcIDTable. ; funcNameTable word offset dgroup:cellName ; ; Table of function names. ; First byte = Length of the name ; Next bytes = Text of the name ; cellName byte 4, "CELL" ; ; formatCount: ; variable that is incremented so that it can be used in the ; NotifyFloatFormatChange structure to force a notification to be sent. ; formatCount word 0 ; ; The variable is used to tell whether we should center the selected cell. ; if it is 0, that means we don't have to center it. If it is non-zero, then ; we need to center the selected cell. ; centerFlag byte 0 idata ends
24.012987
79
0.651704
8b5e85f55a221a118cf34eaa986a50ad3d054215
77
asm
Assembly
bdshemu_test/basic/test_64_basic01.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
1
2020-11-18T21:57:38.000Z
2020-11-18T21:57:38.000Z
bdshemu_test/basic/test_64_basic01.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
null
null
null
bdshemu_test/basic/test_64_basic01.asm
andreaswimmer/bddisasm
960e9eaeee4f87d8269095031cd6cfb8aabb998b
[ "Apache-2.0" ]
1
2020-08-20T15:22:02.000Z
2020-08-20T15:22:02.000Z
bits 64 mov eax, 0x7FFD0000 mov dword [eax], 0 retn
12.833333
27
0.493506
cd66f672422c168e9aa4e67fdc6bf3bff04f9244
839
asm
Assembly
programs/oeis/100/A100156.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/100/A100156.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/100/A100156.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A100156: Structured truncated tetrahedral numbers. ; 1,12,44,108,215,376,602,904,1293,1780,2376,3092,3939,4928,6070,7376,8857,10524,12388,14460,16751,19272,22034,25048,28325,31876,35712,39844,44283,49040,54126,59552,65329,71468,77980,84876,92167,99864,107978,116520,125501,134932,144824,155188,166035,177376,189222,201584,214473,227900,241876,256412,271519,287208,303490,320376,337877,356004,374768,394180,414251,434992,456414,478528,501345,524876,549132,574124,599863,626360,653626,681672,710509,740148,770600,801876,833987,866944,900758,935440,971001,1007452,1044804,1083068,1122255,1162376,1203442,1245464,1288453,1332420,1377376,1423332,1470299,1518288,1567310,1617376,1668497,1720684,1773948,1828300 mov $2,1 lpb $0 add $2,5 trn $3,$0 add $4,5 add $2,$4 add $3,1 sub $0,$3 add $1,$2 add $4,6 lpe add $1,1 mov $0,$1
49.352941
653
0.784267
be13337e8a78bdf8b486350e6a1eb18f278fd1ef
7,597
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1164_2295.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1164_2295.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_1164_2295.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 %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x82e0, %rsi lea addresses_normal_ht+0x33d0, %rdi clflush (%rsi) clflush (%rdi) nop nop nop nop nop add %rax, %rax mov $96, %rcx rep movsl nop nop nop xor $64479, %r10 lea addresses_UC_ht+0x12368, %rax nop nop nop nop nop xor $39195, %rbp movw $0x6162, (%rax) nop xor %rsi, %rsi lea addresses_WT_ht+0xa686, %rcx nop add %rax, %rax mov (%rcx), %edi nop nop xor %r10, %r10 lea addresses_WC_ht+0x10025, %rax nop cmp %r15, %r15 mov $0x6162636465666768, %rcx movq %rcx, %xmm7 and $0xffffffffffffffc0, %rax vmovntdq %ymm7, (%rax) nop nop nop nop nop inc %rbp lea addresses_D_ht+0x13f50, %rbp nop nop nop nop nop xor %r10, %r10 mov $0x6162636465666768, %rdi movq %rdi, %xmm3 movups %xmm3, (%rbp) inc %rax pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %r9 push %rax push %rbx push %rdi push %rdx // Load lea addresses_WT+0x15d0, %rbx nop inc %rdx mov (%rbx), %r8w add %r8, %r8 // Store lea addresses_PSE+0x7e70, %r10 nop inc %rax mov $0x5152535455565758, %r9 movq %r9, (%r10) nop nop add %rbx, %rbx // Store mov $0x994, %rax nop nop nop nop nop and %r9, %r9 mov $0x5152535455565758, %rdx movq %rdx, %xmm3 movups %xmm3, (%rax) nop nop cmp %r8, %r8 // Load lea addresses_PSE+0x188fc, %r9 and $29546, %rbx mov (%r9), %r8w nop nop nop nop sub $65001, %r8 // Store lea addresses_A+0xa5d0, %r10 nop nop nop and %rax, %rax movb $0x51, (%r10) nop nop xor %rax, %rax // Store lea addresses_WT+0x1c5d0, %r9 nop sub %rdi, %rdi movl $0x51525354, (%r9) nop and $24468, %r9 // Store lea addresses_US+0xe080, %r8 nop nop nop nop nop and %rax, %rax mov $0x5152535455565758, %rdx movq %rdx, (%r8) nop and $33776, %r10 // Store lea addresses_normal+0x197d0, %r9 nop and $8880, %rdi mov $0x5152535455565758, %r8 movq %r8, %xmm2 vmovntdq %ymm2, (%r9) nop inc %r8 // Store mov $0xdd0, %rdx xor %rax, %rax movb $0x51, (%rdx) nop and $38542, %rax // Store lea addresses_D+0xc850, %rdi nop nop nop nop nop and %rax, %rax mov $0x5152535455565758, %r9 movq %r9, (%rdi) nop nop inc %r8 // Faulty Load lea addresses_A+0xa5d0, %rbx nop nop nop add %rdx, %rdx mov (%rbx), %r9d lea oracles, %rax and $0xff, %r9 shlq $12, %r9 mov (%rax,%r9,1), %r9 pop %rdx pop %rdi pop %rbx pop %rax pop %r9 pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 7, 'NT': True, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A', 'same': True, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_US', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'54': 1164} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
32.190678
2,999
0.648545
c81f9991f32a74946d0e3e9a431dcda852f421a6
3,701
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1964.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1964.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1964.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %rax push %rbx push %rcx push %rsi // Faulty Load lea addresses_WC+0xebe1, %rbx nop nop nop nop xor $39072, %r12 mov (%rbx), %rsi lea oracles, %rbx and $0xff, %rsi shlq $12, %rsi mov (%rbx,%rsi,1), %rsi pop %rsi pop %rcx pop %rbx pop %rax pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
84.113636
2,999
0.663875
2c96c0c7cc3351a147311d1c2b7f64a99aa7bc1b
372
asm
Assembly
oeis/022/A022165.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/022/A022165.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/022/A022165.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A022165: First row of spectral array W(sqrt(5)-1). ; Submitted by Jon Maiga ; 1,5,6,26,32,136,168,712,880,3728,4608,19520,24128,102208,126336,535168,661504,2802176,3463680,14672384,18136064,76825600,94961664,402264064,497225728,2106281984,2603507712 mov $1,4 mov $2,1 lpb $0 sub $0,2 add $1,$2 add $2,$1 mul $1,4 lpe lpb $0 bin $0,3 add $2,$1 lpe mov $0,$2
20.666667
173
0.698925
fd326f32bc6c41e6ebc906fd2c3e98c5df22eb5c
310
asm
Assembly
src/firmware-tests/Platform/PowerManagement/PowerManagementDummies.asm
pete-restall/Cluck2Sesame-Prototype
99119b6748847a7b6aeadc4bee42cbed726f7fdc
[ "MIT" ]
1
2019-12-12T09:07:08.000Z
2019-12-12T09:07:08.000Z
src/firmware-tests/Platform/PowerManagement/PowerManagementDummies.asm
pete-restall/Cluck2Sesame-Prototype
99119b6748847a7b6aeadc4bee42cbed726f7fdc
[ "MIT" ]
null
null
null
src/firmware-tests/Platform/PowerManagement/PowerManagementDummies.asm
pete-restall/Cluck2Sesame-Prototype
99119b6748847a7b6aeadc4bee42cbed726f7fdc
[ "MIT" ]
null
null
null
#include "Platform.inc" radix decimal PowerManagementDummies code global initialisePowerManagement global pollPowerManagement global preventSleep global ensureFastClock global allowSlowClock initialisePowerManagement: pollPowerManagement: preventSleep: ensureFastClock: allowSlowClock: return end
15.5
33
0.854839
2d275deb21c0a6397d6450c3ebcaddcfb8a17f1b
659
asm
Assembly
oeis/006/A006228.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/006/A006228.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/006/A006228.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A006228: Expansion of exp(arcsin(x)). ; Submitted by Jon Maiga ; 1,1,1,2,5,20,85,520,3145,26000,204425,2132000,20646925,260104000,2993804125,44217680000,589779412625,9993195680000,151573309044625,2898026747200000,49261325439503125,1049085682486400000,19753791501240753125,463695871658988800000,9580588878101765265625,245758811979264064000000,5527999782664718558265625,153845016299019304064000000,3742455852864014463945828125,112306861898284091966720000000,2937827844498251354197475078125,94562377718355205435978240000000,2646982887892924470131925045390625 lpb $0 sub $0,2 mov $1,1 add $1,$2 mul $1,$0 mul $1,$0 add $2,$1 lpe mov $0,$2 add $0,1
43.933333
492
0.837633
3145de5d6a5933235a7c1d402453e9f6efa1f3f6
748
asm
Assembly
programs/oeis/167/A167342.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/167/A167342.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/167/A167342.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A167342: Totally multiplicative sequence with a(p) = p*(p+3) = p^2+3p for prime p. ; 1,10,18,100,40,180,70,1000,324,400,154,1800,208,700,720,10000,340,3240,418,4000,1260,1540,598,18000,1600,2080,5832,7000,928,7200,1054,100000,2772,3400,2800,32400,1480,4180,3744,40000,1804,12600,1978,15400,12960,5980,2350,180000,4900,16000,6120,20800,2968,58320,6160,70000,7524,9280,3658,72000,3904,10540,22680,1000000,8320,27720,4690,34000,10764,28000,5254,324000,5548,14800,28800,41800,10780,37440,6478,400000,104976,18040,7138,126000,13600,19780,16704,154000,8188,129600,14560,59800,18972,23500,16720,1800000,9700,49000,49896,160000 mov $1,$0 seq $1,166591 ; Totally multiplicative sequence with a(p) = p+3 for prime p. mul $0,$1 add $0,1 add $0,$1 sub $0,1
74.8
536
0.76738
7c189d540af3a65fff2570125edbd95fd361f92e
1,191
asm
Assembly
programs/oeis/164/A164611.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/164/A164611.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/164/A164611.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A164611: Expansion of (1 + x + 2*x^2 - x^3)/(1 - 2*x + 3*x^2 - 2*x^3 + x^4). ; 1,3,5,2,-6,-11,-5,9,17,8,-12,-23,-11,15,29,14,-18,-35,-17,21,41,20,-24,-47,-23,27,53,26,-30,-59,-29,33,65,32,-36,-71,-35,39,77,38,-42,-83,-41,45,89,44,-48,-95,-47,51,101,50,-54,-107,-53,57,113,56,-60,-119,-59,63,125,62,-66,-131,-65,69,137,68,-72,-143,-71,75,149,74,-78,-155,-77,81,161,80,-84,-167,-83,87,173,86,-90,-179,-89,93,185,92,-96,-191,-95,99,197,98,-102,-203,-101,105,209,104,-108,-215,-107,111,221,110,-114,-227,-113,117,233,116,-120,-239,-119,123,245,122,-126,-251,-125,129,257,128,-132,-263,-131,135,269,134,-138,-275,-137,141,281,140,-144,-287,-143,147,293,146,-150,-299,-149,153,305,152,-156,-311,-155,159,317,158,-162,-323,-161,165,329,164,-168,-335,-167,171,341,170,-174,-347,-173,177,353,176,-180,-359,-179,183,365,182,-186,-371,-185,189,377,188,-192,-383,-191,195,389,194,-198,-395,-197,201,401,200,-204,-407,-203,207,413,206,-210,-419,-209,213,425,212,-216,-431,-215,219,437,218,-222,-443,-221,225,449,224,-228,-455,-227,231,461,230,-234,-467,-233,237,473,236,-240,-479,-239,243,485,242,-246,-491,-245,249,497,248 mov $1,1 mov $2,$0 lpb $2,1 add $1,$0 sub $0,$1 sub $2,1 lpe sub $1,$0
99.25
1,033
0.615449
04f4a80d2b2f40981aea7b4830d9007605bcf5a8
608
asm
Assembly
oeis/162/A162886.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
null
null
null
oeis/162/A162886.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
null
null
null
oeis/162/A162886.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
null
null
null
; A162886: Even numbers in an alternating 1-based sum up to some odd nonprime. ; Submitted by Jamie Morken(w2) ; 24,42,54,60,78,84,96,114,132,138,144,150,168,174,180,186,204,216,222,234,240,258,264,276,282,294,306,312,324,330,348,354,366,372,384,390,402,414,420,432,438,444,450,456,474,480,486,492,504,510,516,528,534,546,558,564 mov $1,6 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,4 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. add $0,$3 sub $0,1 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 sub $0,14 div $0,4 mul $0,6 add $0,24
23.384615
218
0.657895
cb2b505df108a0b0336d3feeec73b98dbc551995
5,136
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_297.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_297.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_297.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x7134, %r8 nop nop nop nop add $22738, %rbx mov (%r8), %r14 sub %rbx, %rbx lea addresses_A_ht+0xd89c, %rsi lea addresses_A_ht+0x10814, %rdi nop nop mfence mov $90, %rcx rep movsw nop nop nop nop dec %r8 lea addresses_WT_ht+0x173d4, %rsi lea addresses_D_ht+0x11f14, %rdi nop add %r10, %r10 mov $105, %rcx rep movsw nop nop dec %r8 lea addresses_WC_ht+0x82f4, %rsi nop nop nop nop cmp $40219, %r14 vmovups (%rsi), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rdi and $22608, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi // Store mov $0x4fe, %r14 nop nop add $4832, %r9 movl $0x51525354, (%r14) nop nop xor %rsi, %rsi // Faulty Load lea addresses_WT+0x6a14, %r9 nop nop nop nop xor $58592, %r8 mov (%r9), %rdx lea oracles, %r14 and $0xff, %rdx shlq $12, %rdx mov (%r14,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': True, 'congruent': 1}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
44.275862
2,999
0.658489
009637bef62be2eb27d9ec3a767e06a6c93a37c7
1,847
asm
Assembly
programs/oeis/183/A183983.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/183/A183983.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/183/A183983.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A183983: 1/4 the number of (n+1) X 7 binary arrays with all 2 X 2 subblock sums the same. ; 45,47,50,56,66,86,122,194,330,602,1130,2186,4266,8426,16682,33194,66090,131882,263210,525866,1050666,2100266,4198442,8394794,16785450,33566762,67125290,134242346,268468266,536920106,1073807402,2147581994,4295098410,8590131242,17180131370,34360131626,68720001066,137439739946,274878955562,549757386794,1099513724970,2199026401322,4398050705450,8796099313706,17592194433066,35184384671786,70368760954922,140737513521194,281475010265130,562950003753002,1125899973951530,2251799914348586,4503599761588266,9007199456067626,18014398777917482,36028797421617194,72057594574798890,144115188881162282,288230377225453610,576460753914036266,1152921506754330666,2305843012434919466,4611686022722355242,9223372043297226794,18446744082299486250,36893488160304005162,73786976312018075690,147573952615446216746,295147905213712564266,590295810410245259306,1180591620786130780202,2361183241537901821994,4722366483007084167210,9444732965945448857642,18889465931753458761770,37778931863369478570026,75557863726464079233066,151115727452653280559146,302231454904756805304362,604462909808963854794794,1208925819616828197961770,2417851639232556884295722,4835703278462914745335850,9671406556923630467416106,19342813113842862888321066,38685626227681327730130986,77371252455353859367239722,154742504910698922641457194,309485009821380253096869930,618970019642742914007695402,1237940039285450643643301930,2475880078570866102914514986,4951760157141661837084852266,9903520314283253305425526826,19807040628566365873362698282,39614081257132591009237041194,79228162514264900543497371690,158456325028529519612018032682,316912650057058476274082644010,633825300114116389598211866666 mov $1,2 mov $2,$0 lpb $0 mul $1,2 add $1,$2 sub $1,$0 sub $0,1 trn $2,2 lpe add $1,43 mov $0,$1
123.133333
1,646
0.900379
0209b2ae21c329242d619da283fb9db078709d97
1,676
asm
Assembly
data/phone/text/dana_caller.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
data/phone/text/dana_caller.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
data/phone/text/dana_caller.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
UnknownText_0x64f74: text "My @" text_ram wStringBuffer4 text " is" line "getting prettier!" para "I've been taking" line "photos galore!" done UnknownText_0x64fb2: text "It took only an" line "instant to KO a" cont "wild @" text_ram wStringBuffer4 text "." para "It must be because" line "you gave me some" para "battling tips last" line "time." done UnknownText_0x6501c: text "You know what?" line "A wild @" text_ram wStringBuffer4 text_start para "got away from me" line "again." para "It was so close!" line "Really, just a" para "little bit more," line "and I would've…" done UnknownText_0x65091: text "Right now, I'm on" line "@" text_ram wStringBuffer5 text "." para "If you're close" line "by, let's battle!" para "I'll be waiting" line "for you!" done UnknownText_0x650e2: text "See you!" done UnknownText_0x650ec: text "You know what?" line "I got a good gift!" para "As I promised," line "it's yours!" para "I'm sure you'd" line "like it. Come get" para "it! I'm waiting on" line "@" text_ram wStringBuffer5 text "!" done UnknownText_0x65161: text "Oh! You wanted a" line "gift, right?" para "I got one, but I" line "want to keep this." para "Can you wait a bit" line "longer?" done UnknownText_0x651bf: text "Hi! You haven't" line "forgotten about" para "your promise to" line "battle me?" para "I'm waiting on" line "@" text_ram wStringBuffer5 text "!" done UnknownText_0x6520f: text "Hello?" para "If you don't come" line "get your present" para "soon, I'll give it" line "to someone else." para "I'm waiting on" line "@" text_ram wStringBuffer5 text "!" done
15.099099
26
0.679594
9b71f41712d1950e64df7a2efd3c1e2cdfb00c80
72,755
asm
Assembly
kill.asm
yarneo/alonandyarden-os-ass2
90e89402145d3fa51ef082cc48b9a803fbcab7d1
[ "Xnet", "X11" ]
null
null
null
kill.asm
yarneo/alonandyarden-os-ass2
90e89402145d3fa51ef082cc48b9a803fbcab7d1
[ "Xnet", "X11" ]
null
null
null
kill.asm
yarneo/alonandyarden-os-ass2
90e89402145d3fa51ef082cc48b9a803fbcab7d1
[ "Xnet", "X11" ]
null
null
null
_kill: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char **argv) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 57 push %edi 7: 56 push %esi 8: 53 push %ebx 9: 83 ec 14 sub $0x14,%esp c: 8b 75 08 mov 0x8(%ebp),%esi f: 8b 7d 0c mov 0xc(%ebp),%edi int i; if(argc < 1){ 12: 85 f6 test %esi,%esi 14: 7e 2a jle 40 <main+0x40> printf(2, "usage: kill pid...\n"); exit(); } for(i=1; i<argc; i++) 16: 83 fe 01 cmp $0x1,%esi { int i; if(argc < 1){ printf(2, "usage: kill pid...\n"); exit(); 19: bb 01 00 00 00 mov $0x1,%ebx } for(i=1; i<argc; i++) 1e: 74 1a je 3a <main+0x3a> kill(atoi(argv[i])); 20: 8b 04 9f mov (%edi,%ebx,4),%eax if(argc < 1){ printf(2, "usage: kill pid...\n"); exit(); } for(i=1; i<argc; i++) 23: 83 c3 01 add $0x1,%ebx kill(atoi(argv[i])); 26: 89 04 24 mov %eax,(%esp) 29: e8 32 01 00 00 call 160 <atoi> 2e: 89 04 24 mov %eax,(%esp) 31: e8 82 02 00 00 call 2b8 <kill> if(argc < 1){ printf(2, "usage: kill pid...\n"); exit(); } for(i=1; i<argc; i++) 36: 39 de cmp %ebx,%esi 38: 7f e6 jg 20 <main+0x20> kill(atoi(argv[i])); exit(); 3a: e8 49 02 00 00 call 288 <exit> 3f: 90 nop main(int argc, char **argv) { int i; if(argc < 1){ printf(2, "usage: kill pid...\n"); 40: c7 44 24 04 3c 0c 00 movl $0xc3c,0x4(%esp) 47: 00 48: c7 04 24 02 00 00 00 movl $0x2,(%esp) 4f: e8 cc 03 00 00 call 420 <printf> exit(); 54: e8 2f 02 00 00 call 288 <exit> 59: 90 nop 5a: 90 nop 5b: 90 nop 5c: 90 nop 5d: 90 nop 5e: 90 nop 5f: 90 nop 00000060 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 60: 55 push %ebp 61: 31 d2 xor %edx,%edx 63: 89 e5 mov %esp,%ebp 65: 8b 45 08 mov 0x8(%ebp),%eax 68: 53 push %ebx 69: 8b 5d 0c mov 0xc(%ebp),%ebx 6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi char *os; os = s; while((*s++ = *t++) != 0) 70: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 74: 88 0c 10 mov %cl,(%eax,%edx,1) 77: 83 c2 01 add $0x1,%edx 7a: 84 c9 test %cl,%cl 7c: 75 f2 jne 70 <strcpy+0x10> ; return os; } 7e: 5b pop %ebx 7f: 5d pop %ebp 80: c3 ret 81: eb 0d jmp 90 <strcmp> 83: 90 nop 84: 90 nop 85: 90 nop 86: 90 nop 87: 90 nop 88: 90 nop 89: 90 nop 8a: 90 nop 8b: 90 nop 8c: 90 nop 8d: 90 nop 8e: 90 nop 8f: 90 nop 00000090 <strcmp>: int strcmp(const char *p, const char *q) { 90: 55 push %ebp 91: 89 e5 mov %esp,%ebp 93: 53 push %ebx 94: 8b 4d 08 mov 0x8(%ebp),%ecx 97: 8b 55 0c mov 0xc(%ebp),%edx while(*p && *p == *q) 9a: 0f b6 01 movzbl (%ecx),%eax 9d: 84 c0 test %al,%al 9f: 75 14 jne b5 <strcmp+0x25> a1: eb 25 jmp c8 <strcmp+0x38> a3: 90 nop a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p++, q++; a8: 83 c1 01 add $0x1,%ecx ab: 83 c2 01 add $0x1,%edx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) ae: 0f b6 01 movzbl (%ecx),%eax b1: 84 c0 test %al,%al b3: 74 13 je c8 <strcmp+0x38> b5: 0f b6 1a movzbl (%edx),%ebx b8: 38 d8 cmp %bl,%al ba: 74 ec je a8 <strcmp+0x18> bc: 0f b6 db movzbl %bl,%ebx bf: 0f b6 c0 movzbl %al,%eax c2: 29 d8 sub %ebx,%eax p++, q++; return (uchar)*p - (uchar)*q; } c4: 5b pop %ebx c5: 5d pop %ebp c6: c3 ret c7: 90 nop } int strcmp(const char *p, const char *q) { while(*p && *p == *q) c8: 0f b6 1a movzbl (%edx),%ebx cb: 31 c0 xor %eax,%eax cd: 0f b6 db movzbl %bl,%ebx d0: 29 d8 sub %ebx,%eax p++, q++; return (uchar)*p - (uchar)*q; } d2: 5b pop %ebx d3: 5d pop %ebp d4: c3 ret d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000000e0 <strlen>: uint strlen(char *s) { e0: 55 push %ebp int n; for(n = 0; s[n]; n++) e1: 31 d2 xor %edx,%edx return (uchar)*p - (uchar)*q; } uint strlen(char *s) { e3: 89 e5 mov %esp,%ebp int n; for(n = 0; s[n]; n++) e5: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; } uint strlen(char *s) { e7: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) ea: 80 39 00 cmpb $0x0,(%ecx) ed: 74 0c je fb <strlen+0x1b> ef: 90 nop f0: 83 c2 01 add $0x1,%edx f3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) f7: 89 d0 mov %edx,%eax f9: 75 f5 jne f0 <strlen+0x10> ; return n; } fb: 5d pop %ebp fc: c3 ret fd: 8d 76 00 lea 0x0(%esi),%esi 00000100 <memset>: void* memset(void *dst, int c, uint n) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 8b 55 08 mov 0x8(%ebp),%edx 106: 57 push %edi } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 107: 8b 4d 10 mov 0x10(%ebp),%ecx 10a: 8b 45 0c mov 0xc(%ebp),%eax 10d: 89 d7 mov %edx,%edi 10f: fc cld 110: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 112: 89 d0 mov %edx,%eax 114: 5f pop %edi 115: 5d pop %ebp 116: c3 ret 117: 89 f6 mov %esi,%esi 119: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000120 <strchr>: char* strchr(const char *s, char c) { 120: 55 push %ebp 121: 89 e5 mov %esp,%ebp 123: 8b 45 08 mov 0x8(%ebp),%eax 126: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for(; *s; s++) 12a: 0f b6 10 movzbl (%eax),%edx 12d: 84 d2 test %dl,%dl 12f: 75 11 jne 142 <strchr+0x22> 131: eb 15 jmp 148 <strchr+0x28> 133: 90 nop 134: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 138: 83 c0 01 add $0x1,%eax 13b: 0f b6 10 movzbl (%eax),%edx 13e: 84 d2 test %dl,%dl 140: 74 06 je 148 <strchr+0x28> if(*s == c) 142: 38 ca cmp %cl,%dl 144: 75 f2 jne 138 <strchr+0x18> return (char*) s; return 0; } 146: 5d pop %ebp 147: c3 ret } char* strchr(const char *s, char c) { for(; *s; s++) 148: 31 c0 xor %eax,%eax if(*s == c) return (char*) s; return 0; } 14a: 5d pop %ebp 14b: 90 nop 14c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 150: c3 ret 151: eb 0d jmp 160 <atoi> 153: 90 nop 154: 90 nop 155: 90 nop 156: 90 nop 157: 90 nop 158: 90 nop 159: 90 nop 15a: 90 nop 15b: 90 nop 15c: 90 nop 15d: 90 nop 15e: 90 nop 15f: 90 nop 00000160 <atoi>: return r; } int atoi(const char *s) { 160: 55 push %ebp int n; n = 0; while('0' <= *s && *s <= '9') 161: 31 c0 xor %eax,%eax return r; } int atoi(const char *s) { 163: 89 e5 mov %esp,%ebp 165: 8b 4d 08 mov 0x8(%ebp),%ecx 168: 53 push %ebx int n; n = 0; while('0' <= *s && *s <= '9') 169: 0f b6 11 movzbl (%ecx),%edx 16c: 8d 5a d0 lea -0x30(%edx),%ebx 16f: 80 fb 09 cmp $0x9,%bl 172: 77 1c ja 190 <atoi+0x30> 174: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n = n*10 + *s++ - '0'; 178: 0f be d2 movsbl %dl,%edx 17b: 83 c1 01 add $0x1,%ecx 17e: 8d 04 80 lea (%eax,%eax,4),%eax 181: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 185: 0f b6 11 movzbl (%ecx),%edx 188: 8d 5a d0 lea -0x30(%edx),%ebx 18b: 80 fb 09 cmp $0x9,%bl 18e: 76 e8 jbe 178 <atoi+0x18> n = n*10 + *s++ - '0'; return n; } 190: 5b pop %ebx 191: 5d pop %ebp 192: c3 ret 193: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000001a0 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 1a0: 55 push %ebp 1a1: 89 e5 mov %esp,%ebp 1a3: 56 push %esi 1a4: 8b 45 08 mov 0x8(%ebp),%eax 1a7: 53 push %ebx 1a8: 8b 5d 10 mov 0x10(%ebp),%ebx 1ab: 8b 75 0c mov 0xc(%ebp),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 1ae: 85 db test %ebx,%ebx 1b0: 7e 14 jle 1c6 <memmove+0x26> n = n*10 + *s++ - '0'; return n; } void* memmove(void *vdst, void *vsrc, int n) 1b2: 31 d2 xor %edx,%edx 1b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) *dst++ = *src++; 1b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 1bc: 88 0c 10 mov %cl,(%eax,%edx,1) 1bf: 83 c2 01 add $0x1,%edx { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 1c2: 39 da cmp %ebx,%edx 1c4: 75 f2 jne 1b8 <memmove+0x18> *dst++ = *src++; return vdst; } 1c6: 5b pop %ebx 1c7: 5e pop %esi 1c8: 5d pop %ebp 1c9: c3 ret 1ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 000001d0 <stat>: return buf; } int stat(char *n, struct stat *st) { 1d0: 55 push %ebp 1d1: 89 e5 mov %esp,%ebp 1d3: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 1d6: 8b 45 08 mov 0x8(%ebp),%eax return buf; } int stat(char *n, struct stat *st) { 1d9: 89 5d f8 mov %ebx,-0x8(%ebp) 1dc: 89 75 fc mov %esi,-0x4(%ebp) int fd; int r; fd = open(n, O_RDONLY); if(fd < 0) 1df: be ff ff ff ff mov $0xffffffff,%esi stat(char *n, struct stat *st) { int fd; int r; fd = open(n, O_RDONLY); 1e4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1eb: 00 1ec: 89 04 24 mov %eax,(%esp) 1ef: e8 d4 00 00 00 call 2c8 <open> if(fd < 0) 1f4: 85 c0 test %eax,%eax stat(char *n, struct stat *st) { int fd; int r; fd = open(n, O_RDONLY); 1f6: 89 c3 mov %eax,%ebx if(fd < 0) 1f8: 78 19 js 213 <stat+0x43> return -1; r = fstat(fd, st); 1fa: 8b 45 0c mov 0xc(%ebp),%eax 1fd: 89 1c 24 mov %ebx,(%esp) 200: 89 44 24 04 mov %eax,0x4(%esp) 204: e8 d7 00 00 00 call 2e0 <fstat> close(fd); 209: 89 1c 24 mov %ebx,(%esp) int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; r = fstat(fd, st); 20c: 89 c6 mov %eax,%esi close(fd); 20e: e8 9d 00 00 00 call 2b0 <close> return r; } 213: 89 f0 mov %esi,%eax 215: 8b 5d f8 mov -0x8(%ebp),%ebx 218: 8b 75 fc mov -0x4(%ebp),%esi 21b: 89 ec mov %ebp,%esp 21d: 5d pop %ebp 21e: c3 ret 21f: 90 nop 00000220 <gets>: return 0; } char* gets(char *buf, int max) { 220: 55 push %ebp 221: 89 e5 mov %esp,%ebp 223: 57 push %edi 224: 56 push %esi 225: 31 f6 xor %esi,%esi 227: 53 push %ebx 228: 83 ec 2c sub $0x2c,%esp 22b: 8b 7d 08 mov 0x8(%ebp),%edi int i, cc; char c; for(i=0; i+1 < max; ){ 22e: eb 06 jmp 236 <gets+0x16> cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 230: 3c 0a cmp $0xa,%al 232: 74 39 je 26d <gets+0x4d> 234: 89 de mov %ebx,%esi gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 236: 8d 5e 01 lea 0x1(%esi),%ebx 239: 3b 5d 0c cmp 0xc(%ebp),%ebx 23c: 7d 31 jge 26f <gets+0x4f> cc = read(0, &c, 1); 23e: 8d 45 e7 lea -0x19(%ebp),%eax 241: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 248: 00 249: 89 44 24 04 mov %eax,0x4(%esp) 24d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 254: e8 47 00 00 00 call 2a0 <read> if(cc < 1) 259: 85 c0 test %eax,%eax 25b: 7e 12 jle 26f <gets+0x4f> break; buf[i++] = c; 25d: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 261: 88 44 1f ff mov %al,-0x1(%edi,%ebx,1) if(c == '\n' || c == '\r') 265: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 269: 3c 0d cmp $0xd,%al 26b: 75 c3 jne 230 <gets+0x10> 26d: 89 de mov %ebx,%esi break; } buf[i] = '\0'; 26f: c6 04 37 00 movb $0x0,(%edi,%esi,1) return buf; } 273: 89 f8 mov %edi,%eax 275: 83 c4 2c add $0x2c,%esp 278: 5b pop %ebx 279: 5e pop %esi 27a: 5f pop %edi 27b: 5d pop %ebp 27c: c3 ret 27d: 90 nop 27e: 90 nop 27f: 90 nop 00000280 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 280: b8 01 00 00 00 mov $0x1,%eax 285: cd 40 int $0x40 287: c3 ret 00000288 <exit>: SYSCALL(exit) 288: b8 02 00 00 00 mov $0x2,%eax 28d: cd 40 int $0x40 28f: c3 ret 00000290 <wait>: SYSCALL(wait) 290: b8 03 00 00 00 mov $0x3,%eax 295: cd 40 int $0x40 297: c3 ret 00000298 <pipe>: SYSCALL(pipe) 298: b8 04 00 00 00 mov $0x4,%eax 29d: cd 40 int $0x40 29f: c3 ret 000002a0 <read>: SYSCALL(read) 2a0: b8 06 00 00 00 mov $0x6,%eax 2a5: cd 40 int $0x40 2a7: c3 ret 000002a8 <write>: SYSCALL(write) 2a8: b8 05 00 00 00 mov $0x5,%eax 2ad: cd 40 int $0x40 2af: c3 ret 000002b0 <close>: SYSCALL(close) 2b0: b8 07 00 00 00 mov $0x7,%eax 2b5: cd 40 int $0x40 2b7: c3 ret 000002b8 <kill>: SYSCALL(kill) 2b8: b8 08 00 00 00 mov $0x8,%eax 2bd: cd 40 int $0x40 2bf: c3 ret 000002c0 <exec>: SYSCALL(exec) 2c0: b8 09 00 00 00 mov $0x9,%eax 2c5: cd 40 int $0x40 2c7: c3 ret 000002c8 <open>: SYSCALL(open) 2c8: b8 0a 00 00 00 mov $0xa,%eax 2cd: cd 40 int $0x40 2cf: c3 ret 000002d0 <mknod>: SYSCALL(mknod) 2d0: b8 0b 00 00 00 mov $0xb,%eax 2d5: cd 40 int $0x40 2d7: c3 ret 000002d8 <unlink>: SYSCALL(unlink) 2d8: b8 0c 00 00 00 mov $0xc,%eax 2dd: cd 40 int $0x40 2df: c3 ret 000002e0 <fstat>: SYSCALL(fstat) 2e0: b8 0d 00 00 00 mov $0xd,%eax 2e5: cd 40 int $0x40 2e7: c3 ret 000002e8 <link>: SYSCALL(link) 2e8: b8 0e 00 00 00 mov $0xe,%eax 2ed: cd 40 int $0x40 2ef: c3 ret 000002f0 <mkdir>: SYSCALL(mkdir) 2f0: b8 0f 00 00 00 mov $0xf,%eax 2f5: cd 40 int $0x40 2f7: c3 ret 000002f8 <chdir>: SYSCALL(chdir) 2f8: b8 10 00 00 00 mov $0x10,%eax 2fd: cd 40 int $0x40 2ff: c3 ret 00000300 <dup>: SYSCALL(dup) 300: b8 11 00 00 00 mov $0x11,%eax 305: cd 40 int $0x40 307: c3 ret 00000308 <getpid>: SYSCALL(getpid) 308: b8 12 00 00 00 mov $0x12,%eax 30d: cd 40 int $0x40 30f: c3 ret 00000310 <sbrk>: SYSCALL(sbrk) 310: b8 13 00 00 00 mov $0x13,%eax 315: cd 40 int $0x40 317: c3 ret 00000318 <sleep>: SYSCALL(sleep) 318: b8 14 00 00 00 mov $0x14,%eax 31d: cd 40 int $0x40 31f: c3 ret 00000320 <uptime>: SYSCALL(uptime) 320: b8 15 00 00 00 mov $0x15,%eax 325: cd 40 int $0x40 327: c3 ret 00000328 <thread_create>: SYSCALL(thread_create) 328: b8 16 00 00 00 mov $0x16,%eax 32d: cd 40 int $0x40 32f: c3 ret 00000330 <thread_getid>: SYSCALL(thread_getid) 330: b8 17 00 00 00 mov $0x17,%eax 335: cd 40 int $0x40 337: c3 ret 00000338 <thread_getProcId>: SYSCALL(thread_getProcId) 338: b8 18 00 00 00 mov $0x18,%eax 33d: cd 40 int $0x40 33f: c3 ret 00000340 <thread_exit>: SYSCALL(thread_exit) 340: b8 1a 00 00 00 mov $0x1a,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <thread_join>: SYSCALL(thread_join) 348: b8 19 00 00 00 mov $0x19,%eax 34d: cd 40 int $0x40 34f: c3 ret 00000350 <binary_sem_create>: SYSCALL(binary_sem_create) 350: b8 1b 00 00 00 mov $0x1b,%eax 355: cd 40 int $0x40 357: c3 ret 00000358 <binary_sem_down>: SYSCALL(binary_sem_down) 358: b8 1c 00 00 00 mov $0x1c,%eax 35d: cd 40 int $0x40 35f: c3 ret 00000360 <binary_sem_up>: SYSCALL(binary_sem_up) 360: b8 1d 00 00 00 mov $0x1d,%eax 365: cd 40 int $0x40 367: c3 ret 00000368 <binary_sem_clear>: SYSCALL(binary_sem_clear) 368: b8 1e 00 00 00 mov $0x1e,%eax 36d: cd 40 int $0x40 36f: c3 ret 00000370 <exit_all_threads>: 370: b8 1f 00 00 00 mov $0x1f,%eax 375: cd 40 int $0x40 377: c3 ret 378: 90 nop 379: 90 nop 37a: 90 nop 37b: 90 nop 37c: 90 nop 37d: 90 nop 37e: 90 nop 37f: 90 nop 00000380 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 380: 55 push %ebp 381: 89 e5 mov %esp,%ebp 383: 57 push %edi 384: 89 cf mov %ecx,%edi 386: 56 push %esi 387: 89 c6 mov %eax,%esi 389: 53 push %ebx 38a: 83 ec 4c sub $0x4c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 38d: 8b 4d 08 mov 0x8(%ebp),%ecx 390: 85 c9 test %ecx,%ecx 392: 74 04 je 398 <printint+0x18> 394: 85 d2 test %edx,%edx 396: 78 70 js 408 <printint+0x88> neg = 1; x = -xx; } else { x = xx; 398: 89 d0 mov %edx,%eax 39a: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 3a1: 31 c9 xor %ecx,%ecx 3a3: 8d 5d d7 lea -0x29(%ebp),%ebx 3a6: 66 90 xchg %ax,%ax } i = 0; do{ buf[i++] = digits[x % base]; 3a8: 31 d2 xor %edx,%edx 3aa: f7 f7 div %edi 3ac: 0f b6 92 57 0c 00 00 movzbl 0xc57(%edx),%edx 3b3: 88 14 0b mov %dl,(%ebx,%ecx,1) 3b6: 83 c1 01 add $0x1,%ecx }while((x /= base) != 0); 3b9: 85 c0 test %eax,%eax 3bb: 75 eb jne 3a8 <printint+0x28> if(neg) 3bd: 8b 45 c4 mov -0x3c(%ebp),%eax 3c0: 85 c0 test %eax,%eax 3c2: 74 08 je 3cc <printint+0x4c> buf[i++] = '-'; 3c4: c6 44 0d d7 2d movb $0x2d,-0x29(%ebp,%ecx,1) 3c9: 83 c1 01 add $0x1,%ecx while(--i >= 0) 3cc: 8d 79 ff lea -0x1(%ecx),%edi 3cf: 01 fb add %edi,%ebx 3d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 3d8: 0f b6 03 movzbl (%ebx),%eax 3db: 83 ef 01 sub $0x1,%edi 3de: 83 eb 01 sub $0x1,%ebx int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 3e1: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 3e8: 00 3e9: 89 34 24 mov %esi,(%esp) buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 3ec: 88 45 e7 mov %al,-0x19(%ebp) int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 3ef: 8d 45 e7 lea -0x19(%ebp),%eax 3f2: 89 44 24 04 mov %eax,0x4(%esp) 3f6: e8 ad fe ff ff call 2a8 <write> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 3fb: 83 ff ff cmp $0xffffffff,%edi 3fe: 75 d8 jne 3d8 <printint+0x58> putc(fd, buf[i]); } 400: 83 c4 4c add $0x4c,%esp 403: 5b pop %ebx 404: 5e pop %esi 405: 5f pop %edi 406: 5d pop %ebp 407: c3 ret uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 408: 89 d0 mov %edx,%eax 40a: f7 d8 neg %eax 40c: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) 413: eb 8c jmp 3a1 <printint+0x21> 415: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000420 <printf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 420: 55 push %ebp 421: 89 e5 mov %esp,%ebp 423: 57 push %edi 424: 56 push %esi 425: 53 push %ebx 426: 83 ec 3c sub $0x3c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 429: 8b 45 0c mov 0xc(%ebp),%eax 42c: 0f b6 10 movzbl (%eax),%edx 42f: 84 d2 test %dl,%dl 431: 0f 84 c9 00 00 00 je 500 <printf+0xe0> char *s; int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; 437: 8d 4d 10 lea 0x10(%ebp),%ecx 43a: 31 ff xor %edi,%edi 43c: 89 4d d4 mov %ecx,-0x2c(%ebp) 43f: 31 db xor %ebx,%ebx int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 441: 8d 75 e7 lea -0x19(%ebp),%esi 444: eb 1e jmp 464 <printf+0x44> 446: 66 90 xchg %ax,%ax state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 448: 83 fa 25 cmp $0x25,%edx 44b: 0f 85 b7 00 00 00 jne 508 <printf+0xe8> 451: 66 bf 25 00 mov $0x25,%di int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 455: 83 c3 01 add $0x1,%ebx 458: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx 45c: 84 d2 test %dl,%dl 45e: 0f 84 9c 00 00 00 je 500 <printf+0xe0> c = fmt[i] & 0xff; if(state == 0){ 464: 85 ff test %edi,%edi uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; 466: 0f b6 d2 movzbl %dl,%edx if(state == 0){ 469: 74 dd je 448 <printf+0x28> if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 46b: 83 ff 25 cmp $0x25,%edi 46e: 75 e5 jne 455 <printf+0x35> if(c == 'd'){ 470: 83 fa 64 cmp $0x64,%edx 473: 0f 84 57 01 00 00 je 5d0 <printf+0x1b0> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 479: 83 fa 70 cmp $0x70,%edx 47c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 480: 0f 84 aa 00 00 00 je 530 <printf+0x110> 486: 83 fa 78 cmp $0x78,%edx 489: 0f 84 a1 00 00 00 je 530 <printf+0x110> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 48f: 83 fa 73 cmp $0x73,%edx 492: 0f 84 c0 00 00 00 je 558 <printf+0x138> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 498: 83 fa 63 cmp $0x63,%edx 49b: 90 nop 49c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4a0: 0f 84 52 01 00 00 je 5f8 <printf+0x1d8> putc(fd, *ap); ap++; } else if(c == '%'){ 4a6: 83 fa 25 cmp $0x25,%edx 4a9: 0f 84 f9 00 00 00 je 5a8 <printf+0x188> int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 4af: 8b 4d 08 mov 0x8(%ebp),%ecx int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4b2: 83 c3 01 add $0x1,%ebx int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 4b5: 31 ff xor %edi,%edi 4b7: 89 55 cc mov %edx,-0x34(%ebp) 4ba: c6 45 e7 25 movb $0x25,-0x19(%ebp) 4be: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 4c5: 00 4c6: 89 0c 24 mov %ecx,(%esp) 4c9: 89 74 24 04 mov %esi,0x4(%esp) 4cd: e8 d6 fd ff ff call 2a8 <write> 4d2: 8b 55 cc mov -0x34(%ebp),%edx 4d5: 8b 45 08 mov 0x8(%ebp),%eax 4d8: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 4df: 00 4e0: 89 74 24 04 mov %esi,0x4(%esp) 4e4: 88 55 e7 mov %dl,-0x19(%ebp) 4e7: 89 04 24 mov %eax,(%esp) 4ea: e8 b9 fd ff ff call 2a8 <write> 4ef: 8b 45 0c mov 0xc(%ebp),%eax int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4f2: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx 4f6: 84 d2 test %dl,%dl 4f8: 0f 85 66 ff ff ff jne 464 <printf+0x44> 4fe: 66 90 xchg %ax,%ax putc(fd, c); } state = 0; } } } 500: 83 c4 3c add $0x3c,%esp 503: 5b pop %ebx 504: 5e pop %esi 505: 5f pop %edi 506: 5d pop %ebp 507: c3 ret int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 508: 8b 45 08 mov 0x8(%ebp),%eax state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 50b: 88 55 e7 mov %dl,-0x19(%ebp) int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 50e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 515: 00 516: 89 74 24 04 mov %esi,0x4(%esp) 51a: 89 04 24 mov %eax,(%esp) 51d: e8 86 fd ff ff call 2a8 <write> 522: 8b 45 0c mov 0xc(%ebp),%eax 525: e9 2b ff ff ff jmp 455 <printf+0x35> 52a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 530: 8b 45 d4 mov -0x2c(%ebp),%eax 533: b9 10 00 00 00 mov $0x10,%ecx ap++; 538: 31 ff xor %edi,%edi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 53a: c7 04 24 00 00 00 00 movl $0x0,(%esp) 541: 8b 10 mov (%eax),%edx 543: 8b 45 08 mov 0x8(%ebp),%eax 546: e8 35 fe ff ff call 380 <printint> 54b: 8b 45 0c mov 0xc(%ebp),%eax ap++; 54e: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 552: e9 fe fe ff ff jmp 455 <printf+0x35> 557: 90 nop } else if(c == 's'){ s = (char*)*ap; 558: 8b 55 d4 mov -0x2c(%ebp),%edx 55b: 8b 3a mov (%edx),%edi ap++; 55d: 83 c2 04 add $0x4,%edx 560: 89 55 d4 mov %edx,-0x2c(%ebp) if(s == 0) 563: 85 ff test %edi,%edi 565: 0f 84 ba 00 00 00 je 625 <printf+0x205> s = "(null)"; while(*s != 0){ 56b: 0f b6 17 movzbl (%edi),%edx 56e: 84 d2 test %dl,%dl 570: 74 2d je 59f <printf+0x17f> 572: 89 5d d0 mov %ebx,-0x30(%ebp) 575: 8b 5d 08 mov 0x8(%ebp),%ebx putc(fd, *s); s++; 578: 83 c7 01 add $0x1,%edi } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 57b: 88 55 e7 mov %dl,-0x19(%ebp) int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 57e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 585: 00 586: 89 74 24 04 mov %esi,0x4(%esp) 58a: 89 1c 24 mov %ebx,(%esp) 58d: e8 16 fd ff ff call 2a8 <write> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 592: 0f b6 17 movzbl (%edi),%edx 595: 84 d2 test %dl,%dl 597: 75 df jne 578 <printf+0x158> 599: 8b 5d d0 mov -0x30(%ebp),%ebx 59c: 8b 45 0c mov 0xc(%ebp),%eax int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 59f: 31 ff xor %edi,%edi 5a1: e9 af fe ff ff jmp 455 <printf+0x35> 5a6: 66 90 xchg %ax,%ax 5a8: 8b 55 08 mov 0x8(%ebp),%edx 5ab: 31 ff xor %edi,%edi s++; } } else if(c == 'c'){ putc(fd, *ap); ap++; } else if(c == '%'){ 5ad: c6 45 e7 25 movb $0x25,-0x19(%ebp) int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 5b1: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 5b8: 00 5b9: 89 74 24 04 mov %esi,0x4(%esp) 5bd: 89 14 24 mov %edx,(%esp) 5c0: e8 e3 fc ff ff call 2a8 <write> 5c5: 8b 45 0c mov 0xc(%ebp),%eax 5c8: e9 88 fe ff ff jmp 455 <printf+0x35> 5cd: 8d 76 00 lea 0x0(%esi),%esi } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 5d0: 8b 45 d4 mov -0x2c(%ebp),%eax 5d3: b9 0a 00 00 00 mov $0xa,%ecx ap++; 5d8: 66 31 ff xor %di,%di } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 5db: c7 04 24 01 00 00 00 movl $0x1,(%esp) 5e2: 8b 10 mov (%eax),%edx 5e4: 8b 45 08 mov 0x8(%ebp),%eax 5e7: e8 94 fd ff ff call 380 <printint> 5ec: 8b 45 0c mov 0xc(%ebp),%eax ap++; 5ef: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 5f3: e9 5d fe ff ff jmp 455 <printf+0x35> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 5f8: 8b 4d d4 mov -0x2c(%ebp),%ecx putc(fd, *ap); ap++; 5fb: 31 ff xor %edi,%edi s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 5fd: 8b 01 mov (%ecx),%eax int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 5ff: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 606: 00 607: 89 74 24 04 mov %esi,0x4(%esp) s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 60b: 88 45 e7 mov %al,-0x19(%ebp) int binsem_sync_print; static void putc(int fd, char c) { write(fd, &c, 1); 60e: 8b 45 08 mov 0x8(%ebp),%eax 611: 89 04 24 mov %eax,(%esp) 614: e8 8f fc ff ff call 2a8 <write> 619: 8b 45 0c mov 0xc(%ebp),%eax putc(fd, *s); s++; } } else if(c == 'c'){ putc(fd, *ap); ap++; 61c: 83 45 d4 04 addl $0x4,-0x2c(%ebp) 620: e9 30 fe ff ff jmp 455 <printf+0x35> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) 625: bf 50 0c 00 00 mov $0xc50,%edi 62a: e9 3c ff ff ff jmp 56b <printf+0x14b> 62f: 90 nop 00000630 <free>: static Header base; static Header *freep; void free(void *ap) { 630: 55 push %ebp Header *bp, *p; bp = (Header*) ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 631: a1 20 0d 00 00 mov 0xd20,%eax static Header base; static Header *freep; void free(void *ap) { 636: 89 e5 mov %esp,%ebp 638: 57 push %edi 639: 56 push %esi 63a: 53 push %ebx 63b: 8b 5d 08 mov 0x8(%ebp),%ebx Header *bp, *p; bp = (Header*) ap - 1; 63e: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 641: 39 c8 cmp %ecx,%eax 643: 73 1d jae 662 <free+0x32> 645: 8d 76 00 lea 0x0(%esi),%esi 648: 8b 10 mov (%eax),%edx 64a: 39 d1 cmp %edx,%ecx 64c: 72 1a jb 668 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 64e: 39 d0 cmp %edx,%eax 650: 72 08 jb 65a <free+0x2a> 652: 39 c8 cmp %ecx,%eax 654: 72 12 jb 668 <free+0x38> 656: 39 d1 cmp %edx,%ecx 658: 72 0e jb 668 <free+0x38> 65a: 89 d0 mov %edx,%eax free(void *ap) { Header *bp, *p; bp = (Header*) ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 65c: 39 c8 cmp %ecx,%eax 65e: 66 90 xchg %ax,%ax 660: 72 e6 jb 648 <free+0x18> 662: 8b 10 mov (%eax),%edx 664: eb e8 jmp 64e <free+0x1e> 666: 66 90 xchg %ax,%ax if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 668: 8b 71 04 mov 0x4(%ecx),%esi 66b: 8d 3c f1 lea (%ecx,%esi,8),%edi 66e: 39 d7 cmp %edx,%edi 670: 74 19 je 68b <free+0x5b> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 672: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 675: 8b 50 04 mov 0x4(%eax),%edx 678: 8d 34 d0 lea (%eax,%edx,8),%esi 67b: 39 ce cmp %ecx,%esi 67d: 74 23 je 6a2 <free+0x72> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 67f: 89 08 mov %ecx,(%eax) freep = p; 681: a3 20 0d 00 00 mov %eax,0xd20 } 686: 5b pop %ebx 687: 5e pop %esi 688: 5f pop %edi 689: 5d pop %ebp 68a: c3 ret bp = (Header*) ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 68b: 03 72 04 add 0x4(%edx),%esi 68e: 89 71 04 mov %esi,0x4(%ecx) bp->s.ptr = p->s.ptr->s.ptr; 691: 8b 10 mov (%eax),%edx 693: 8b 12 mov (%edx),%edx 695: 89 53 f8 mov %edx,-0x8(%ebx) } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ 698: 8b 50 04 mov 0x4(%eax),%edx 69b: 8d 34 d0 lea (%eax,%edx,8),%esi 69e: 39 ce cmp %ecx,%esi 6a0: 75 dd jne 67f <free+0x4f> p->s.size += bp->s.size; 6a2: 03 51 04 add 0x4(%ecx),%edx 6a5: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6a8: 8b 53 f8 mov -0x8(%ebx),%edx 6ab: 89 10 mov %edx,(%eax) } else p->s.ptr = bp; freep = p; 6ad: a3 20 0d 00 00 mov %eax,0xd20 } 6b2: 5b pop %ebx 6b3: 5e pop %esi 6b4: 5f pop %edi 6b5: 5d pop %ebp 6b6: c3 ret 6b7: 89 f6 mov %esi,%esi 6b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000006c0 <malloc>: return freep; } void* malloc(uint nbytes) { 6c0: 55 push %ebp 6c1: 89 e5 mov %esp,%ebp 6c3: 57 push %edi 6c4: 56 push %esi 6c5: 53 push %ebx 6c6: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6c9: 8b 5d 08 mov 0x8(%ebp),%ebx if((prevp = freep) == 0){ 6cc: 8b 0d 20 0d 00 00 mov 0xd20,%ecx malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6d2: 83 c3 07 add $0x7,%ebx 6d5: c1 eb 03 shr $0x3,%ebx 6d8: 83 c3 01 add $0x1,%ebx if((prevp = freep) == 0){ 6db: 85 c9 test %ecx,%ecx 6dd: 0f 84 93 00 00 00 je 776 <malloc+0xb6> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6e3: 8b 01 mov (%ecx),%eax if(p->s.size >= nunits){ 6e5: 8b 50 04 mov 0x4(%eax),%edx 6e8: 39 d3 cmp %edx,%ebx 6ea: 76 1f jbe 70b <malloc+0x4b> p->s.size -= nunits; p += p->s.size; p->s.size = nunits; } freep = prevp; return (void*) (p + 1); 6ec: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 6f3: 90 nop 6f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } if(p == freep) 6f8: 3b 05 20 0d 00 00 cmp 0xd20,%eax 6fe: 74 30 je 730 <malloc+0x70> 700: 89 c1 mov %eax,%ecx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 702: 8b 01 mov (%ecx),%eax if(p->s.size >= nunits){ 704: 8b 50 04 mov 0x4(%eax),%edx 707: 39 d3 cmp %edx,%ebx 709: 77 ed ja 6f8 <malloc+0x38> if(p->s.size == nunits) 70b: 39 d3 cmp %edx,%ebx 70d: 74 61 je 770 <malloc+0xb0> prevp->s.ptr = p->s.ptr; else { p->s.size -= nunits; 70f: 29 da sub %ebx,%edx 711: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 714: 8d 04 d0 lea (%eax,%edx,8),%eax p->s.size = nunits; 717: 89 58 04 mov %ebx,0x4(%eax) } freep = prevp; 71a: 89 0d 20 0d 00 00 mov %ecx,0xd20 return (void*) (p + 1); 720: 83 c0 08 add $0x8,%eax } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } } 723: 83 c4 1c add $0x1c,%esp 726: 5b pop %ebx 727: 5e pop %esi 728: 5f pop %edi 729: 5d pop %ebp 72a: c3 ret 72b: 90 nop 72c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi morecore(uint nu) { char *p; Header *hp; if(nu < 4096) 730: 81 fb ff 0f 00 00 cmp $0xfff,%ebx 736: b8 00 80 00 00 mov $0x8000,%eax 73b: bf 00 10 00 00 mov $0x1000,%edi 740: 76 04 jbe 746 <malloc+0x86> 742: 89 f0 mov %esi,%eax 744: 89 df mov %ebx,%edi nu = 4096; p = sbrk(nu * sizeof(Header)); 746: 89 04 24 mov %eax,(%esp) 749: e8 c2 fb ff ff call 310 <sbrk> if(p == (char*) -1) 74e: 83 f8 ff cmp $0xffffffff,%eax 751: 74 18 je 76b <malloc+0xab> return 0; hp = (Header*)p; hp->s.size = nu; 753: 89 78 04 mov %edi,0x4(%eax) free((void*)(hp + 1)); 756: 83 c0 08 add $0x8,%eax 759: 89 04 24 mov %eax,(%esp) 75c: e8 cf fe ff ff call 630 <free> return freep; 761: 8b 0d 20 0d 00 00 mov 0xd20,%ecx } freep = prevp; return (void*) (p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) 767: 85 c9 test %ecx,%ecx 769: 75 97 jne 702 <malloc+0x42> if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 76b: 31 c0 xor %eax,%eax 76d: eb b4 jmp 723 <malloc+0x63> 76f: 90 nop if(p->s.size == nunits) prevp->s.ptr = p->s.ptr; 770: 8b 10 mov (%eax),%edx 772: 89 11 mov %edx,(%ecx) 774: eb a4 jmp 71a <malloc+0x5a> Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 776: c7 05 20 0d 00 00 18 movl $0xd18,0xd20 77d: 0d 00 00 base.s.size = 0; 780: b9 18 0d 00 00 mov $0xd18,%ecx Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 785: c7 05 18 0d 00 00 18 movl $0xd18,0xd18 78c: 0d 00 00 base.s.size = 0; 78f: c7 05 1c 0d 00 00 00 movl $0x0,0xd1c 796: 00 00 00 799: e9 45 ff ff ff jmp 6e3 <malloc+0x23> 79e: 90 nop 79f: 90 nop 000007a0 <sem_clear>: } binary_sem_up(sem->S1); } void sem_clear(struct semaphore* sem ) { 7a0: 55 push %ebp 7a1: 89 e5 mov %esp,%ebp 7a3: 53 push %ebx 7a4: 83 ec 14 sub $0x14,%esp 7a7: 8b 5d 08 mov 0x8(%ebp),%ebx binary_sem_clear(sem->S1); 7aa: 8b 03 mov (%ebx),%eax 7ac: 89 04 24 mov %eax,(%esp) 7af: e8 b4 fb ff ff call 368 <binary_sem_clear> binary_sem_clear(sem->S2); 7b4: 8b 43 04 mov 0x4(%ebx),%eax 7b7: 89 04 24 mov %eax,(%esp) 7ba: e8 a9 fb ff ff call 368 <binary_sem_clear> free(sem); 7bf: 89 5d 08 mov %ebx,0x8(%ebp) } 7c2: 83 c4 14 add $0x14,%esp 7c5: 5b pop %ebx 7c6: 5d pop %ebp void sem_clear(struct semaphore* sem ) { binary_sem_clear(sem->S1); binary_sem_clear(sem->S2); free(sem); 7c7: e9 64 fe ff ff jmp 630 <free> 7cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000007d0 <sem_downs>: } binary_sem_up(sem->S1); } void sem_downs(struct semaphore* sem, int num ) { 7d0: 55 push %ebp 7d1: 89 e5 mov %esp,%ebp 7d3: 83 ec 18 sub $0x18,%esp 7d6: 89 5d f8 mov %ebx,-0x8(%ebp) 7d9: 8b 5d 08 mov 0x8(%ebp),%ebx 7dc: 89 75 fc mov %esi,-0x4(%ebp) 7df: 8b 75 0c mov 0xc(%ebp),%esi binary_sem_down(sem->S2); 7e2: 8b 43 04 mov 0x4(%ebx),%eax 7e5: 89 04 24 mov %eax,(%esp) 7e8: e8 6b fb ff ff call 358 <binary_sem_down> binary_sem_down(sem->S1); 7ed: 8b 03 mov (%ebx),%eax 7ef: 89 04 24 mov %eax,(%esp) 7f2: e8 61 fb ff ff call 358 <binary_sem_down> sem->value -= num; 7f7: 8b 43 08 mov 0x8(%ebx),%eax 7fa: 29 f0 sub %esi,%eax if(sem->value > 0) { 7fc: 85 c0 test %eax,%eax void sem_downs(struct semaphore* sem, int num ) { binary_sem_down(sem->S2); binary_sem_down(sem->S1); sem->value -= num; 7fe: 89 43 08 mov %eax,0x8(%ebx) if(sem->value > 0) { 801: 74 0b je 80e <sem_downs+0x3e> binary_sem_up(sem->S2); 803: 8b 43 04 mov 0x4(%ebx),%eax 806: 89 04 24 mov %eax,(%esp) 809: e8 52 fb ff ff call 360 <binary_sem_up> } binary_sem_up(sem->S1); 80e: 8b 03 mov (%ebx),%eax } 810: 8b 75 fc mov -0x4(%ebp),%esi 813: 8b 5d f8 mov -0x8(%ebp),%ebx binary_sem_down(sem->S1); sem->value -= num; if(sem->value > 0) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 816: 89 45 08 mov %eax,0x8(%ebp) } 819: 89 ec mov %ebp,%esp 81b: 5d pop %ebp binary_sem_down(sem->S1); sem->value -= num; if(sem->value > 0) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 81c: e9 3f fb ff ff jmp 360 <binary_sem_up> 821: eb 0d jmp 830 <sem_down> 823: 90 nop 824: 90 nop 825: 90 nop 826: 90 nop 827: 90 nop 828: 90 nop 829: 90 nop 82a: 90 nop 82b: 90 nop 82c: 90 nop 82d: 90 nop 82e: 90 nop 82f: 90 nop 00000830 <sem_down>: } binary_sem_up(sem->S1); } void sem_down(struct semaphore* sem ) { 830: 55 push %ebp 831: 89 e5 mov %esp,%ebp 833: 53 push %ebx 834: 83 ec 14 sub $0x14,%esp 837: 8b 5d 08 mov 0x8(%ebp),%ebx binary_sem_down(sem->S2); 83a: 8b 43 04 mov 0x4(%ebx),%eax 83d: 89 04 24 mov %eax,(%esp) 840: e8 13 fb ff ff call 358 <binary_sem_down> binary_sem_down(sem->S1); 845: 8b 03 mov (%ebx),%eax 847: 89 04 24 mov %eax,(%esp) 84a: e8 09 fb ff ff call 358 <binary_sem_down> sem->value--; 84f: 8b 43 08 mov 0x8(%ebx),%eax 852: 83 e8 01 sub $0x1,%eax if(sem->value > 0) { 855: 85 c0 test %eax,%eax void sem_down(struct semaphore* sem ) { binary_sem_down(sem->S2); binary_sem_down(sem->S1); sem->value--; 857: 89 43 08 mov %eax,0x8(%ebx) if(sem->value > 0) { 85a: 74 0b je 867 <sem_down+0x37> binary_sem_up(sem->S2); 85c: 8b 43 04 mov 0x4(%ebx),%eax 85f: 89 04 24 mov %eax,(%esp) 862: e8 f9 fa ff ff call 360 <binary_sem_up> } binary_sem_up(sem->S1); 867: 8b 03 mov (%ebx),%eax 869: 89 45 08 mov %eax,0x8(%ebp) } 86c: 83 c4 14 add $0x14,%esp 86f: 5b pop %ebx 870: 5d pop %ebp binary_sem_down(sem->S1); sem->value--; if(sem->value > 0) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 871: e9 ea fa ff ff jmp 360 <binary_sem_up> 876: 8d 76 00 lea 0x0(%esi),%esi 879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000880 <sem_ups>: } binary_sem_up(sem->S1); } void sem_ups(struct semaphore* sem, int num ) { 880: 55 push %ebp 881: 89 e5 mov %esp,%ebp 883: 83 ec 18 sub $0x18,%esp 886: 89 5d f8 mov %ebx,-0x8(%ebp) 889: 8b 5d 08 mov 0x8(%ebp),%ebx 88c: 89 75 fc mov %esi,-0x4(%ebp) 88f: 8b 75 0c mov 0xc(%ebp),%esi binary_sem_down(sem->S1); 892: 8b 03 mov (%ebx),%eax 894: 89 04 24 mov %eax,(%esp) 897: e8 bc fa ff ff call 358 <binary_sem_down> sem->value+= num; 89c: 03 73 08 add 0x8(%ebx),%esi if(sem->value == 1) { 89f: 83 fe 01 cmp $0x1,%esi } void sem_ups(struct semaphore* sem, int num ) { binary_sem_down(sem->S1); sem->value+= num; 8a2: 89 73 08 mov %esi,0x8(%ebx) if(sem->value == 1) { 8a5: 74 19 je 8c0 <sem_ups+0x40> binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 8a7: 8b 03 mov (%ebx),%eax } 8a9: 8b 75 fc mov -0x4(%ebp),%esi 8ac: 8b 5d f8 mov -0x8(%ebp),%ebx binary_sem_down(sem->S1); sem->value+= num; if(sem->value == 1) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 8af: 89 45 08 mov %eax,0x8(%ebp) } 8b2: 89 ec mov %ebp,%esp 8b4: 5d pop %ebp binary_sem_down(sem->S1); sem->value+= num; if(sem->value == 1) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 8b5: e9 a6 fa ff ff jmp 360 <binary_sem_up> 8ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi void sem_ups(struct semaphore* sem, int num ) { binary_sem_down(sem->S1); sem->value+= num; if(sem->value == 1) { binary_sem_up(sem->S2); 8c0: 8b 43 04 mov 0x4(%ebx),%eax 8c3: 89 04 24 mov %eax,(%esp) 8c6: e8 95 fa ff ff call 360 <binary_sem_up> 8cb: eb da jmp 8a7 <sem_ups+0x27> 8cd: 8d 76 00 lea 0x0(%esi),%esi 000008d0 <sem_up>: } return ret; } void sem_up(struct semaphore* sem ) { 8d0: 55 push %ebp 8d1: 89 e5 mov %esp,%ebp 8d3: 53 push %ebx 8d4: 83 ec 14 sub $0x14,%esp 8d7: 8b 5d 08 mov 0x8(%ebp),%ebx binary_sem_down(sem->S1); 8da: 8b 03 mov (%ebx),%eax 8dc: 89 04 24 mov %eax,(%esp) 8df: e8 74 fa ff ff call 358 <binary_sem_down> sem->value++; 8e4: 8b 43 08 mov 0x8(%ebx),%eax 8e7: 83 c0 01 add $0x1,%eax if(sem->value == 1) { 8ea: 83 f8 01 cmp $0x1,%eax } void sem_up(struct semaphore* sem ) { binary_sem_down(sem->S1); sem->value++; 8ed: 89 43 08 mov %eax,0x8(%ebx) if(sem->value == 1) { 8f0: 74 16 je 908 <sem_up+0x38> binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 8f2: 8b 03 mov (%ebx),%eax 8f4: 89 45 08 mov %eax,0x8(%ebp) } 8f7: 83 c4 14 add $0x14,%esp 8fa: 5b pop %ebx 8fb: 5d pop %ebp binary_sem_down(sem->S1); sem->value++; if(sem->value == 1) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 8fc: e9 5f fa ff ff jmp 360 <binary_sem_up> 901: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi void sem_up(struct semaphore* sem ) { binary_sem_down(sem->S1); sem->value++; if(sem->value == 1) { binary_sem_up(sem->S2); 908: 8b 43 04 mov 0x4(%ebx),%eax 90b: 89 04 24 mov %eax,(%esp) 90e: e8 4d fa ff ff call 360 <binary_sem_up> } binary_sem_up(sem->S1); 913: 8b 03 mov (%ebx),%eax 915: 89 45 08 mov %eax,0x8(%ebp) } 918: 83 c4 14 add $0x14,%esp 91b: 5b pop %ebx 91c: 5d pop %ebp binary_sem_down(sem->S1); sem->value++; if(sem->value == 1) { binary_sem_up(sem->S2); } binary_sem_up(sem->S1); 91d: e9 3e fa ff ff jmp 360 <binary_sem_up> 922: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000930 <semaphore_create>: #include "stat.h" #include "user.h" #include "semaphore.h" struct semaphore* semaphore_create(int initial_semaphore_value) { 930: 55 push %ebp 931: 89 e5 mov %esp,%ebp 933: 83 ec 28 sub $0x28,%esp struct semaphore* ret; ret = malloc(sizeof(*ret)); 936: c7 04 24 0c 00 00 00 movl $0xc,(%esp) #include "stat.h" #include "user.h" #include "semaphore.h" struct semaphore* semaphore_create(int initial_semaphore_value) { 93d: 89 5d f4 mov %ebx,-0xc(%ebp) 940: 89 75 f8 mov %esi,-0x8(%ebp) 943: 89 7d fc mov %edi,-0x4(%ebp) 946: 8b 7d 08 mov 0x8(%ebp),%edi struct semaphore* ret; ret = malloc(sizeof(*ret)); 949: e8 72 fd ff ff call 6c0 <malloc> ret->value = initial_semaphore_value; 94e: 89 78 08 mov %edi,0x8(%eax) #include "semaphore.h" struct semaphore* semaphore_create(int initial_semaphore_value) { struct semaphore* ret; ret = malloc(sizeof(*ret)); 951: 89 c3 mov %eax,%ebx ret->value = initial_semaphore_value; if(((ret->S1 = binary_sem_create()) + (ret->S2 = binary_sem_create())) < 0) { 953: e8 f8 f9 ff ff call 350 <binary_sem_create> 958: 89 03 mov %eax,(%ebx) 95a: 89 c6 mov %eax,%esi 95c: e8 ef f9 ff ff call 350 <binary_sem_create> 961: 01 c6 add %eax,%esi 963: 89 43 04 mov %eax,0x4(%ebx) 966: 78 20 js 988 <semaphore_create+0x58> printf(2,"couldnt create the 2 binary semaphores"); return 0; } if(initial_semaphore_value == 0) { 968: 85 ff test %edi,%edi 96a: 75 08 jne 974 <semaphore_create+0x44> binary_sem_down(ret->S2); 96c: 89 04 24 mov %eax,(%esp) 96f: e8 e4 f9 ff ff call 358 <binary_sem_down> } return ret; } 974: 89 d8 mov %ebx,%eax 976: 8b 75 f8 mov -0x8(%ebp),%esi 979: 8b 5d f4 mov -0xc(%ebp),%ebx 97c: 8b 7d fc mov -0x4(%ebp),%edi 97f: 89 ec mov %ebp,%esp 981: 5d pop %ebp 982: c3 ret 983: 90 nop 984: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi { struct semaphore* ret; ret = malloc(sizeof(*ret)); ret->value = initial_semaphore_value; if(((ret->S1 = binary_sem_create()) + (ret->S2 = binary_sem_create())) < 0) { printf(2,"couldnt create the 2 binary semaphores"); 988: c7 44 24 04 68 0c 00 movl $0xc68,0x4(%esp) 98f: 00 990: 31 db xor %ebx,%ebx 992: c7 04 24 02 00 00 00 movl $0x2,(%esp) 999: e8 82 fa ff ff call 420 <printf> return 0; 99e: eb d4 jmp 974 <semaphore_create+0x44> 000009a0 <semaphore_clear>: binary_sem_up(bb->mutex); sem_up(bb->empty); return element; } void semaphore_clear(struct BB* bb) { 9a0: 55 push %ebp 9a1: 89 e5 mov %esp,%ebp 9a3: 53 push %ebx 9a4: 83 ec 14 sub $0x14,%esp 9a7: 8b 5d 08 mov 0x8(%ebp),%ebx free(bb->buffer); 9aa: 8b 43 0c mov 0xc(%ebx),%eax 9ad: 89 04 24 mov %eax,(%esp) 9b0: e8 7b fc ff ff call 630 <free> sem_clear(bb->empty); 9b5: 8b 43 04 mov 0x4(%ebx),%eax 9b8: 89 04 24 mov %eax,(%esp) 9bb: e8 e0 fd ff ff call 7a0 <sem_clear> sem_clear(bb->full); 9c0: 8b 43 08 mov 0x8(%ebx),%eax 9c3: 89 04 24 mov %eax,(%esp) 9c6: e8 d5 fd ff ff call 7a0 <sem_clear> binary_sem_clear(bb->mutex); 9cb: 8b 03 mov (%ebx),%eax 9cd: 89 04 24 mov %eax,(%esp) 9d0: e8 93 f9 ff ff call 368 <binary_sem_clear> free(bb); 9d5: 89 5d 08 mov %ebx,0x8(%ebp) } 9d8: 83 c4 14 add $0x14,%esp 9db: 5b pop %ebx 9dc: 5d pop %ebp void semaphore_clear(struct BB* bb) { free(bb->buffer); sem_clear(bb->empty); sem_clear(bb->full); binary_sem_clear(bb->mutex); free(bb); 9dd: e9 4e fc ff ff jmp 630 <free> 9e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 9e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000009f0 <semaphore_release_atomic>: } sem_up(bb->full); } void semaphore_release_atomic(struct BB* bb) { 9f0: 55 push %ebp 9f1: 89 e5 mov %esp,%ebp 9f3: 83 ec 08 sub $0x8,%esp binary_sem_up(bb->mutex); 9f6: 8b 45 08 mov 0x8(%ebp),%eax 9f9: 8b 00 mov (%eax),%eax 9fb: 89 45 08 mov %eax,0x8(%ebp) } 9fe: c9 leave sem_up(bb->full); } void semaphore_release_atomic(struct BB* bb) { binary_sem_up(bb->mutex); 9ff: e9 5c f9 ff ff jmp 360 <binary_sem_up> a04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi a0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000a10 <semaphore_pop>: } void* semaphore_pop(struct BB* bb) { a10: 55 push %ebp a11: 89 e5 mov %esp,%ebp a13: 56 push %esi a14: 53 push %ebx a15: 83 ec 10 sub $0x10,%esp a18: 8b 5d 08 mov 0x8(%ebp),%ebx void* element = 0; sem_down(bb->full); a1b: 8b 43 08 mov 0x8(%ebx),%eax a1e: 89 04 24 mov %eax,(%esp) a21: e8 0a fe ff ff call 830 <sem_down> binary_sem_down(bb->mutex); a26: 8b 03 mov (%ebx),%eax a28: 89 04 24 mov %eax,(%esp) a2b: e8 28 f9 ff ff call 358 <binary_sem_down> if(bb->buffer[bb->consume] == 0) { a30: 8b 43 14 mov 0x14(%ebx),%eax a33: c1 e0 02 shl $0x2,%eax a36: 03 43 0c add 0xc(%ebx),%eax a39: 8b 30 mov (%eax),%esi a3b: 85 f6 test %esi,%esi a3d: 74 42 je a81 <semaphore_pop+0x71> printf(2,"something went wrong! buffer is empty and we are trying to consume\n"); } else { element = bb->buffer[bb->consume]; bb->buffer[bb->consume] = 0; a3f: c7 00 00 00 00 00 movl $0x0,(%eax) if(bb->consume == (bb->capacity - 1)) { a45: 8b 53 18 mov 0x18(%ebx),%edx a48: 8b 43 14 mov 0x14(%ebx),%eax a4b: 83 ea 01 sub $0x1,%edx a4e: 39 d0 cmp %edx,%eax a50: 74 26 je a78 <semaphore_pop+0x68> bb->consume = 0; } else { bb->consume++; a52: 83 c0 01 add $0x1,%eax a55: 89 43 14 mov %eax,0x14(%ebx) } } binary_sem_up(bb->mutex); a58: 8b 03 mov (%ebx),%eax a5a: 89 04 24 mov %eax,(%esp) a5d: e8 fe f8 ff ff call 360 <binary_sem_up> sem_up(bb->empty); a62: 8b 43 04 mov 0x4(%ebx),%eax a65: 89 04 24 mov %eax,(%esp) a68: e8 63 fe ff ff call 8d0 <sem_up> return element; } a6d: 83 c4 10 add $0x10,%esp a70: 89 f0 mov %esi,%eax a72: 5b pop %ebx a73: 5e pop %esi a74: 5d pop %ebp a75: c3 ret a76: 66 90 xchg %ax,%ax } else { element = bb->buffer[bb->consume]; bb->buffer[bb->consume] = 0; if(bb->consume == (bb->capacity - 1)) { bb->consume = 0; a78: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) a7f: eb d7 jmp a58 <semaphore_pop+0x48> { void* element = 0; sem_down(bb->full); binary_sem_down(bb->mutex); if(bb->buffer[bb->consume] == 0) { printf(2,"something went wrong! buffer is empty and we are trying to consume\n"); a81: c7 44 24 04 90 0c 00 movl $0xc90,0x4(%esp) a88: 00 a89: c7 04 24 02 00 00 00 movl $0x2,(%esp) a90: e8 8b f9 ff ff call 420 <printf> a95: eb c1 jmp a58 <semaphore_pop+0x48> a97: 89 f6 mov %esi,%esi a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000aa0 <semaphore_put_atomic>: binary_sem_up(bb->mutex); sem_up(bb->full); } void semaphore_put_atomic(struct BB* bb, void* element) { aa0: 55 push %ebp aa1: 89 e5 mov %esp,%ebp aa3: 56 push %esi aa4: 53 push %ebx aa5: 83 ec 10 sub $0x10,%esp aa8: 8b 5d 08 mov 0x8(%ebp),%ebx aab: 8b 75 0c mov 0xc(%ebp),%esi sem_down(bb->empty); aae: 8b 43 04 mov 0x4(%ebx),%eax ab1: 89 04 24 mov %eax,(%esp) ab4: e8 77 fd ff ff call 830 <sem_down> binary_sem_down(bb->mutex); ab9: 8b 03 mov (%ebx),%eax abb: 89 04 24 mov %eax,(%esp) abe: e8 95 f8 ff ff call 358 <binary_sem_down> if(bb->buffer[bb->produce] != 0) { ac3: 8b 43 10 mov 0x10(%ebx),%eax ac6: c1 e0 02 shl $0x2,%eax ac9: 03 43 0c add 0xc(%ebx),%eax acc: 8b 10 mov (%eax),%edx ace: 85 d2 test %edx,%edx ad0: 74 26 je af8 <semaphore_put_atomic+0x58> printf(2,"something went wrong! buffer is full and we are trying to produce\n"); ad2: c7 44 24 04 d4 0c 00 movl $0xcd4,0x4(%esp) ad9: 00 ada: c7 04 24 02 00 00 00 movl $0x2,(%esp) ae1: e8 3a f9 ff ff call 420 <printf> } else { bb->produce++; } } sem_up(bb->full); ae6: 8b 43 08 mov 0x8(%ebx),%eax ae9: 89 45 08 mov %eax,0x8(%ebp) } aec: 83 c4 10 add $0x10,%esp aef: 5b pop %ebx af0: 5e pop %esi af1: 5d pop %ebp } else { bb->produce++; } } sem_up(bb->full); af2: e9 d9 fd ff ff jmp 8d0 <sem_up> af7: 90 nop binary_sem_down(bb->mutex); if(bb->buffer[bb->produce] != 0) { printf(2,"something went wrong! buffer is full and we are trying to produce\n"); } else { bb->buffer[bb->produce] = element; af8: 89 30 mov %esi,(%eax) if(bb->produce == (bb->capacity - 1)) { afa: 8b 53 18 mov 0x18(%ebx),%edx afd: 8b 43 10 mov 0x10(%ebx),%eax b00: 83 ea 01 sub $0x1,%edx b03: 39 d0 cmp %edx,%eax b05: 74 09 je b10 <semaphore_put_atomic+0x70> bb->produce = 0; } else { bb->produce++; b07: 83 c0 01 add $0x1,%eax b0a: 89 43 10 mov %eax,0x10(%ebx) b0d: eb d7 jmp ae6 <semaphore_put_atomic+0x46> b0f: 90 nop printf(2,"something went wrong! buffer is full and we are trying to produce\n"); } else { bb->buffer[bb->produce] = element; if(bb->produce == (bb->capacity - 1)) { bb->produce = 0; b10: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) b17: eb cd jmp ae6 <semaphore_put_atomic+0x46> b19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000b20 <semaphore_put>: ret->capacity = max_capacity; return ret; } void semaphore_put(struct BB* bb, void* element) { b20: 55 push %ebp b21: 89 e5 mov %esp,%ebp b23: 56 push %esi b24: 53 push %ebx b25: 83 ec 10 sub $0x10,%esp b28: 8b 5d 08 mov 0x8(%ebp),%ebx b2b: 8b 75 0c mov 0xc(%ebp),%esi sem_down(bb->empty); b2e: 8b 43 04 mov 0x4(%ebx),%eax b31: 89 04 24 mov %eax,(%esp) b34: e8 f7 fc ff ff call 830 <sem_down> binary_sem_down(bb->mutex); b39: 8b 03 mov (%ebx),%eax b3b: 89 04 24 mov %eax,(%esp) b3e: e8 15 f8 ff ff call 358 <binary_sem_down> if(bb->buffer[bb->produce] != 0) { b43: 8b 43 10 mov 0x10(%ebx),%eax b46: c1 e0 02 shl $0x2,%eax b49: 03 43 0c add 0xc(%ebx),%eax b4c: 8b 08 mov (%eax),%ecx b4e: 85 c9 test %ecx,%ecx b50: 74 36 je b88 <semaphore_put+0x68> printf(2,"something went wrong! buffer is full and we are trying to produce\n"); b52: c7 44 24 04 d4 0c 00 movl $0xcd4,0x4(%esp) b59: 00 b5a: c7 04 24 02 00 00 00 movl $0x2,(%esp) b61: e8 ba f8 ff ff call 420 <printf> } else { bb->produce++; } } binary_sem_up(bb->mutex); b66: 8b 03 mov (%ebx),%eax b68: 89 04 24 mov %eax,(%esp) b6b: e8 f0 f7 ff ff call 360 <binary_sem_up> sem_up(bb->full); b70: 8b 43 08 mov 0x8(%ebx),%eax b73: 89 45 08 mov %eax,0x8(%ebp) } b76: 83 c4 10 add $0x10,%esp b79: 5b pop %ebx b7a: 5e pop %esi b7b: 5d pop %ebp else { bb->produce++; } } binary_sem_up(bb->mutex); sem_up(bb->full); b7c: e9 4f fd ff ff jmp 8d0 <sem_up> b81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi binary_sem_down(bb->mutex); if(bb->buffer[bb->produce] != 0) { printf(2,"something went wrong! buffer is full and we are trying to produce\n"); } else { bb->buffer[bb->produce] = element; b88: 89 30 mov %esi,(%eax) if(bb->produce == (bb->capacity - 1)) { b8a: 8b 53 18 mov 0x18(%ebx),%edx b8d: 8b 43 10 mov 0x10(%ebx),%eax b90: 83 ea 01 sub $0x1,%edx b93: 39 d0 cmp %edx,%eax b95: 74 09 je ba0 <semaphore_put+0x80> bb->produce = 0; } else { bb->produce++; b97: 83 c0 01 add $0x1,%eax b9a: 89 43 10 mov %eax,0x10(%ebx) b9d: eb c7 jmp b66 <semaphore_put+0x46> b9f: 90 nop printf(2,"something went wrong! buffer is full and we are trying to produce\n"); } else { bb->buffer[bb->produce] = element; if(bb->produce == (bb->capacity - 1)) { bb->produce = 0; ba0: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) ba7: eb bd jmp b66 <semaphore_put+0x46> ba9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000bb0 <BB_create>: #include "user.h" #include "semaphore.h" #include "boundedbuffer.h" struct BB* BB_create(int max_capacity) { bb0: 55 push %ebp bb1: 89 e5 mov %esp,%ebp bb3: 83 ec 18 sub $0x18,%esp bb6: 89 75 fc mov %esi,-0x4(%ebp) bb9: 8b 75 08 mov 0x8(%ebp),%esi bbc: 89 5d f8 mov %ebx,-0x8(%ebp) struct BB* ret; if(max_capacity < 0) bbf: 85 f6 test %esi,%esi bc1: 79 15 jns bd8 <BB_create+0x28> return 0; ret->mutex = binary_sem_create(); ret->produce = 0; ret->consume = 0; ret->capacity = max_capacity; return ret; bc3: 31 db xor %ebx,%ebx } bc5: 89 d8 mov %ebx,%eax bc7: 8b 75 fc mov -0x4(%ebp),%esi bca: 8b 5d f8 mov -0x8(%ebp),%ebx bcd: 89 ec mov %ebp,%esp bcf: 5d pop %ebp bd0: c3 ret bd1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct BB* BB_create(int max_capacity) { struct BB* ret; if(max_capacity < 0) return 0; if((ret = malloc(sizeof(*ret))) <=0) bd8: c7 04 24 1c 00 00 00 movl $0x1c,(%esp) bdf: e8 dc fa ff ff call 6c0 <malloc> be4: 85 c0 test %eax,%eax be6: 89 c3 mov %eax,%ebx be8: 74 db je bc5 <BB_create+0x15> return 0; if((ret->buffer = malloc(sizeof(void*) * max_capacity)) <=0) bea: 8d 04 b5 00 00 00 00 lea 0x0(,%esi,4),%eax bf1: 89 04 24 mov %eax,(%esp) bf4: e8 c7 fa ff ff call 6c0 <malloc> bf9: 85 c0 test %eax,%eax bfb: 89 43 0c mov %eax,0xc(%ebx) bfe: 74 c3 je bc3 <BB_create+0x13> return 0; if((ret->empty = semaphore_create(max_capacity)) <=0) c00: 89 34 24 mov %esi,(%esp) c03: e8 28 fd ff ff call 930 <semaphore_create> c08: 85 c0 test %eax,%eax c0a: 89 43 04 mov %eax,0x4(%ebx) c0d: 74 b4 je bc3 <BB_create+0x13> return 0; if((ret->full = semaphore_create(0)) <=0) c0f: c7 04 24 00 00 00 00 movl $0x0,(%esp) c16: e8 15 fd ff ff call 930 <semaphore_create> c1b: 85 c0 test %eax,%eax c1d: 89 43 08 mov %eax,0x8(%ebx) c20: 74 a1 je bc3 <BB_create+0x13> return 0; ret->mutex = binary_sem_create(); c22: e8 29 f7 ff ff call 350 <binary_sem_create> ret->produce = 0; c27: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) ret->consume = 0; c2e: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) ret->capacity = max_capacity; c35: 89 73 18 mov %esi,0x18(%ebx) return 0; if((ret->empty = semaphore_create(max_capacity)) <=0) return 0; if((ret->full = semaphore_create(0)) <=0) return 0; ret->mutex = binary_sem_create(); c38: 89 03 mov %eax,(%ebx) ret->produce = 0; ret->consume = 0; ret->capacity = max_capacity; return ret; c3a: eb 89 jmp bc5 <BB_create+0x15>
30.39056
83
0.451749
81bfa3340dd0fa606a4d212a41f1a3f582469c26
4,737
nasm
Assembly
Projetos/src/F-Assembly/src/nasm/quadrado.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
null
null
null
Projetos/src/F-Assembly/src/nasm/quadrado.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
91
2018-08-24T11:41:28.000Z
2018-12-09T15:09:02.000Z
Projetos/src/F-Assembly/src/nasm/quadrado.nasm
Fogelman/Z01.1
5a40e721a6bf000ba1016c2addad579a25618d49
[ "Unlicense" ]
1
2018-12-05T19:22:27.000Z
2018-12-05T19:22:27.000Z
leaw $16649,%A movw $-1,(%A) leaw $16650,%A movw $-1,(%A) leaw $16651,%A movw $-1,(%A) leaw $16669,%A movw $-1,(%A) leaw $16670,%A movw $-1,(%A) leaw $16671,%A movw $-1,(%A) leaw $16689,%A movw $-1,(%A) leaw $16690,%A movw $-1,(%A) leaw $16691,%A movw $-1,(%A) leaw $16709,%A movw $-1,(%A) leaw $16710,%A movw $-1,(%A) leaw $16711,%A movw $-1,(%A) leaw $16729,%A movw $-1,(%A) leaw $16730,%A movw $-1,(%A) leaw $16731,%A movw $-1,(%A) leaw $16749,%A movw $-1,(%A) leaw $16750,%A movw $-1,(%A) leaw $16751,%A movw $-1,(%A) leaw $16769,%A movw $-1,(%A) leaw $16770,%A movw $-1,(%A) leaw $16771,%A movw $-1,(%A) leaw $16789,%A movw $-1,(%A) leaw $16790,%A movw $-1,(%A) leaw $16791,%A movw $-1,(%A) leaw $16809,%A movw $-1,(%A) leaw $16810,%A movw $-1,(%A) leaw $16811,%A movw $-1,(%A) leaw $16829,%A movw $-1,(%A) leaw $16830,%A movw $-1,(%A) leaw $16831,%A movw $-1,(%A) leaw $16849,%A movw $-1,(%A) leaw $16850,%A movw $-1,(%A) leaw $16851,%A movw $-1,(%A) leaw $16869,%A movw $-1,(%A) leaw $16870,%A movw $-1,(%A) leaw $16871,%A movw $-1,(%A) leaw $16889,%A movw $-1,(%A) leaw $16890,%A movw $-1,(%A) leaw $16891,%A movw $-1,(%A) leaw $16909,%A movw $-1,(%A) leaw $16910,%A movw $-1,(%A) leaw $16911,%A movw $-1,(%A) leaw $16929,%A movw $-1,(%A) leaw $16930,%A movw $-1,(%A) leaw $16931,%A movw $-1,(%A) leaw $16949,%A movw $-1,(%A) leaw $16950,%A movw $-1,(%A) leaw $16951,%A movw $-1,(%A) leaw $16969,%A movw $-1,(%A) leaw $16970,%A movw $-1,(%A) leaw $16971,%A movw $-1,(%A) leaw $16989,%A movw $-1,(%A) leaw $16990,%A movw $-1,(%A) leaw $16991,%A movw $-1,(%A) leaw $17009,%A movw $-1,(%A) leaw $17010,%A movw $-1,(%A) leaw $17011,%A movw $-1,(%A) leaw $17029,%A movw $-1,(%A) leaw $17030,%A movw $-1,(%A) leaw $17031,%A movw $-1,(%A) leaw $17049,%A movw $-1,(%A) leaw $17050,%A movw $-1,(%A) leaw $17051,%A movw $-1,(%A) leaw $17069,%A movw $-1,(%A) leaw $17070,%A movw $-1,(%A) leaw $17071,%A movw $-1,(%A) leaw $17089,%A movw $-1,(%A) leaw $17090,%A movw $-1,(%A) leaw $17091,%A movw $-1,(%A) leaw $17109,%A movw $-1,(%A) leaw $17110,%A movw $-1,(%A) leaw $17111,%A movw $-1,(%A) leaw $17129,%A movw $-1,(%A) leaw $17130,%A movw $-1,(%A) leaw $17131,%A movw $-1,(%A) leaw $17149,%A movw $-1,(%A) leaw $17150,%A movw $-1,(%A) leaw $17151,%A movw $-1,(%A) leaw $17169,%A movw $-1,(%A) leaw $17170,%A movw $-1,(%A) leaw $17171,%A movw $-1,(%A) leaw $17189,%A movw $-1,(%A) leaw $17190,%A movw $-1,(%A) leaw $17191,%A movw $-1,(%A) leaw $17209,%A movw $-1,(%A) leaw $17210,%A movw $-1,(%A) leaw $17211,%A movw $-1,(%A) leaw $17229,%A movw $-1,(%A) leaw $17230,%A movw $-1,(%A) leaw $17231,%A movw $-1,(%A) leaw $17249,%A movw $-1,(%A) leaw $17250,%A movw $-1,(%A) leaw $17251,%A movw $-1,(%A) leaw $17269,%A movw $-1,(%A) leaw $17270,%A movw $-1,(%A) leaw $17271,%A movw $-1,(%A) leaw $17289,%A movw $-1,(%A) leaw $17290,%A movw $-1,(%A) leaw $17291,%A movw $-1,(%A) leaw $17309,%A movw $-1,(%A) leaw $17310,%A movw $-1,(%A) leaw $17311,%A movw $-1,(%A) leaw $17329,%A movw $-1,(%A) leaw $17330,%A movw $-1,(%A) leaw $17331,%A movw $-1,(%A) leaw $17349,%A movw $-1,(%A) leaw $17350,%A movw $-1,(%A) leaw $17351,%A movw $-1,(%A) leaw $17369,%A movw $-1,(%A) leaw $17370,%A movw $-1,(%A) leaw $17371,%A movw $-1,(%A) leaw $17389,%A movw $-1,(%A) leaw $17390,%A movw $-1,(%A) leaw $17391,%A movw $-1,(%A) leaw $17409,%A movw $-1,(%A) leaw $17410,%A movw $-1,(%A) leaw $17411,%A movw $-1,(%A) leaw $17429,%A movw $-1,(%A) leaw $17430,%A movw $-1,(%A) leaw $17431,%A movw $-1,(%A) leaw $17449,%A movw $-1,(%A) leaw $17450,%A movw $-1,(%A) leaw $17451,%A movw $-1,(%A) leaw $17469,%A movw $-1,(%A) leaw $17470,%A movw $-1,(%A) leaw $17471,%A movw $-1,(%A) leaw $17489,%A movw $-1,(%A) leaw $17490,%A movw $-1,(%A) leaw $17491,%A movw $-1,(%A) leaw $17509,%A movw $-1,(%A) leaw $17510,%A movw $-1,(%A) leaw $17511,%A movw $-1,(%A) leaw $17529,%A movw $-1,(%A) leaw $17530,%A movw $-1,(%A) leaw $17531,%A movw $-1,(%A) leaw $17549,%A movw $-1,(%A) leaw $17550,%A movw $-1,(%A) leaw $17551,%A movw $-1,(%A) leaw $17569,%A movw $-1,(%A) leaw $17570,%A movw $-1,(%A) leaw $17571,%A movw $-1,(%A) leaw $17589,%A movw $-1,(%A) leaw $17590,%A movw $-1,(%A) leaw $17591,%A movw $-1,(%A) leaw $17609,%A movw $-1,(%A) leaw $17610,%A movw $-1,(%A) leaw $17611,%A movw $-1,(%A) LOOP: leaw $LOOP, %A jmp nop
10.621076
15
0.500528
b9f4d0e7702d57ab3464ccdf4a06bdac74e688ae
41,306
asm
Assembly
echo.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
echo.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
echo.asm
briansrls/xv6
a239977076a9bd2ede261e8d8bffd09a25d43598
[ "MIT-0" ]
null
null
null
_echo: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 20 sub $0x20,%esp int i; for(i = 1; i < argc; i++) 9: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp) 10: 00 11: eb 48 jmp 5b <main+0x5b> printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n"); 13: 8b 44 24 1c mov 0x1c(%esp),%eax 17: 40 inc %eax 18: 3b 45 08 cmp 0x8(%ebp),%eax 1b: 7d 07 jge 24 <main+0x24> 1d: b8 3f 08 00 00 mov $0x83f,%eax 22: eb 05 jmp 29 <main+0x29> 24: b8 41 08 00 00 mov $0x841,%eax 29: 8b 54 24 1c mov 0x1c(%esp),%edx 2d: 8d 0c 95 00 00 00 00 lea 0x0(,%edx,4),%ecx 34: 8b 55 0c mov 0xc(%ebp),%edx 37: 01 ca add %ecx,%edx 39: 8b 12 mov (%edx),%edx 3b: 89 44 24 0c mov %eax,0xc(%esp) 3f: 89 54 24 08 mov %edx,0x8(%esp) 43: c7 44 24 04 43 08 00 movl $0x843,0x4(%esp) 4a: 00 4b: c7 04 24 01 00 00 00 movl $0x1,(%esp) 52: e8 21 04 00 00 call 478 <printf> int main(int argc, char *argv[]) { int i; for(i = 1; i < argc; i++) 57: ff 44 24 1c incl 0x1c(%esp) 5b: 8b 44 24 1c mov 0x1c(%esp),%eax 5f: 3b 45 08 cmp 0x8(%ebp),%eax 62: 7c af jl 13 <main+0x13> printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n"); exit(); 64: e8 7f 02 00 00 call 2e8 <exit> 69: 66 90 xchg %ax,%ax 6b: 90 nop 0000006c <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 6c: 55 push %ebp 6d: 89 e5 mov %esp,%ebp 6f: 57 push %edi 70: 53 push %ebx asm volatile("cld; rep stosb" : 71: 8b 4d 08 mov 0x8(%ebp),%ecx 74: 8b 55 10 mov 0x10(%ebp),%edx 77: 8b 45 0c mov 0xc(%ebp),%eax 7a: 89 cb mov %ecx,%ebx 7c: 89 df mov %ebx,%edi 7e: 89 d1 mov %edx,%ecx 80: fc cld 81: f3 aa rep stos %al,%es:(%edi) 83: 89 ca mov %ecx,%edx 85: 89 fb mov %edi,%ebx 87: 89 5d 08 mov %ebx,0x8(%ebp) 8a: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 8d: 5b pop %ebx 8e: 5f pop %edi 8f: 5d pop %ebp 90: c3 ret 00000091 <strcpy>: #include "x86.h" #include "signal.h" char* strcpy(char *s, char *t) { 91: 55 push %ebp 92: 89 e5 mov %esp,%ebp 94: 83 ec 10 sub $0x10,%esp char *os; os = s; 97: 8b 45 08 mov 0x8(%ebp),%eax 9a: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 9d: 90 nop 9e: 8b 45 0c mov 0xc(%ebp),%eax a1: 8a 10 mov (%eax),%dl a3: 8b 45 08 mov 0x8(%ebp),%eax a6: 88 10 mov %dl,(%eax) a8: 8b 45 08 mov 0x8(%ebp),%eax ab: 8a 00 mov (%eax),%al ad: 84 c0 test %al,%al af: 0f 95 c0 setne %al b2: ff 45 08 incl 0x8(%ebp) b5: ff 45 0c incl 0xc(%ebp) b8: 84 c0 test %al,%al ba: 75 e2 jne 9e <strcpy+0xd> ; return os; bc: 8b 45 fc mov -0x4(%ebp),%eax } bf: c9 leave c0: c3 ret 000000c1 <strcmp>: int strcmp(const char *p, const char *q) { c1: 55 push %ebp c2: 89 e5 mov %esp,%ebp while(*p && *p == *q) c4: eb 06 jmp cc <strcmp+0xb> p++, q++; c6: ff 45 08 incl 0x8(%ebp) c9: ff 45 0c incl 0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) cc: 8b 45 08 mov 0x8(%ebp),%eax cf: 8a 00 mov (%eax),%al d1: 84 c0 test %al,%al d3: 74 0e je e3 <strcmp+0x22> d5: 8b 45 08 mov 0x8(%ebp),%eax d8: 8a 10 mov (%eax),%dl da: 8b 45 0c mov 0xc(%ebp),%eax dd: 8a 00 mov (%eax),%al df: 38 c2 cmp %al,%dl e1: 74 e3 je c6 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; e3: 8b 45 08 mov 0x8(%ebp),%eax e6: 8a 00 mov (%eax),%al e8: 0f b6 d0 movzbl %al,%edx eb: 8b 45 0c mov 0xc(%ebp),%eax ee: 8a 00 mov (%eax),%al f0: 0f b6 c0 movzbl %al,%eax f3: 89 d1 mov %edx,%ecx f5: 29 c1 sub %eax,%ecx f7: 89 c8 mov %ecx,%eax } f9: 5d pop %ebp fa: c3 ret 000000fb <strlen>: uint strlen(char *s) { fb: 55 push %ebp fc: 89 e5 mov %esp,%ebp fe: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 101: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 108: eb 03 jmp 10d <strlen+0x12> 10a: ff 45 fc incl -0x4(%ebp) 10d: 8b 55 fc mov -0x4(%ebp),%edx 110: 8b 45 08 mov 0x8(%ebp),%eax 113: 01 d0 add %edx,%eax 115: 8a 00 mov (%eax),%al 117: 84 c0 test %al,%al 119: 75 ef jne 10a <strlen+0xf> ; return n; 11b: 8b 45 fc mov -0x4(%ebp),%eax } 11e: c9 leave 11f: c3 ret 00000120 <memset>: void* memset(void *dst, int c, uint n) { 120: 55 push %ebp 121: 89 e5 mov %esp,%ebp 123: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 126: 8b 45 10 mov 0x10(%ebp),%eax 129: 89 44 24 08 mov %eax,0x8(%esp) 12d: 8b 45 0c mov 0xc(%ebp),%eax 130: 89 44 24 04 mov %eax,0x4(%esp) 134: 8b 45 08 mov 0x8(%ebp),%eax 137: 89 04 24 mov %eax,(%esp) 13a: e8 2d ff ff ff call 6c <stosb> return dst; 13f: 8b 45 08 mov 0x8(%ebp),%eax } 142: c9 leave 143: c3 ret 00000144 <strchr>: char* strchr(const char *s, char c) { 144: 55 push %ebp 145: 89 e5 mov %esp,%ebp 147: 83 ec 04 sub $0x4,%esp 14a: 8b 45 0c mov 0xc(%ebp),%eax 14d: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 150: eb 12 jmp 164 <strchr+0x20> if(*s == c) 152: 8b 45 08 mov 0x8(%ebp),%eax 155: 8a 00 mov (%eax),%al 157: 3a 45 fc cmp -0x4(%ebp),%al 15a: 75 05 jne 161 <strchr+0x1d> return (char*)s; 15c: 8b 45 08 mov 0x8(%ebp),%eax 15f: eb 11 jmp 172 <strchr+0x2e> } char* strchr(const char *s, char c) { for(; *s; s++) 161: ff 45 08 incl 0x8(%ebp) 164: 8b 45 08 mov 0x8(%ebp),%eax 167: 8a 00 mov (%eax),%al 169: 84 c0 test %al,%al 16b: 75 e5 jne 152 <strchr+0xe> if(*s == c) return (char*)s; return 0; 16d: b8 00 00 00 00 mov $0x0,%eax } 172: c9 leave 173: c3 ret 00000174 <gets>: char* gets(char *buf, int max) { 174: 55 push %ebp 175: 89 e5 mov %esp,%ebp 177: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 17a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 181: eb 42 jmp 1c5 <gets+0x51> cc = read(0, &c, 1); 183: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 18a: 00 18b: 8d 45 ef lea -0x11(%ebp),%eax 18e: 89 44 24 04 mov %eax,0x4(%esp) 192: c7 04 24 00 00 00 00 movl $0x0,(%esp) 199: e8 62 01 00 00 call 300 <read> 19e: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 1a1: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1a5: 7e 29 jle 1d0 <gets+0x5c> break; buf[i++] = c; 1a7: 8b 55 f4 mov -0xc(%ebp),%edx 1aa: 8b 45 08 mov 0x8(%ebp),%eax 1ad: 01 c2 add %eax,%edx 1af: 8a 45 ef mov -0x11(%ebp),%al 1b2: 88 02 mov %al,(%edx) 1b4: ff 45 f4 incl -0xc(%ebp) if(c == '\n' || c == '\r') 1b7: 8a 45 ef mov -0x11(%ebp),%al 1ba: 3c 0a cmp $0xa,%al 1bc: 74 13 je 1d1 <gets+0x5d> 1be: 8a 45 ef mov -0x11(%ebp),%al 1c1: 3c 0d cmp $0xd,%al 1c3: 74 0c je 1d1 <gets+0x5d> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 1c5: 8b 45 f4 mov -0xc(%ebp),%eax 1c8: 40 inc %eax 1c9: 3b 45 0c cmp 0xc(%ebp),%eax 1cc: 7c b5 jl 183 <gets+0xf> 1ce: eb 01 jmp 1d1 <gets+0x5d> cc = read(0, &c, 1); if(cc < 1) break; 1d0: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 1d1: 8b 55 f4 mov -0xc(%ebp),%edx 1d4: 8b 45 08 mov 0x8(%ebp),%eax 1d7: 01 d0 add %edx,%eax 1d9: c6 00 00 movb $0x0,(%eax) return buf; 1dc: 8b 45 08 mov 0x8(%ebp),%eax } 1df: c9 leave 1e0: c3 ret 000001e1 <stat>: int stat(char *n, struct stat *st) { 1e1: 55 push %ebp 1e2: 89 e5 mov %esp,%ebp 1e4: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 1e7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1ee: 00 1ef: 8b 45 08 mov 0x8(%ebp),%eax 1f2: 89 04 24 mov %eax,(%esp) 1f5: e8 2e 01 00 00 call 328 <open> 1fa: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 1fd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 201: 79 07 jns 20a <stat+0x29> return -1; 203: b8 ff ff ff ff mov $0xffffffff,%eax 208: eb 23 jmp 22d <stat+0x4c> r = fstat(fd, st); 20a: 8b 45 0c mov 0xc(%ebp),%eax 20d: 89 44 24 04 mov %eax,0x4(%esp) 211: 8b 45 f4 mov -0xc(%ebp),%eax 214: 89 04 24 mov %eax,(%esp) 217: e8 24 01 00 00 call 340 <fstat> 21c: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 21f: 8b 45 f4 mov -0xc(%ebp),%eax 222: 89 04 24 mov %eax,(%esp) 225: e8 e6 00 00 00 call 310 <close> return r; 22a: 8b 45 f0 mov -0x10(%ebp),%eax } 22d: c9 leave 22e: c3 ret 0000022f <atoi>: int atoi(const char *s) { 22f: 55 push %ebp 230: 89 e5 mov %esp,%ebp 232: 83 ec 10 sub $0x10,%esp int n; n = 0; 235: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 23c: eb 21 jmp 25f <atoi+0x30> n = n*10 + *s++ - '0'; 23e: 8b 55 fc mov -0x4(%ebp),%edx 241: 89 d0 mov %edx,%eax 243: c1 e0 02 shl $0x2,%eax 246: 01 d0 add %edx,%eax 248: d1 e0 shl %eax 24a: 89 c2 mov %eax,%edx 24c: 8b 45 08 mov 0x8(%ebp),%eax 24f: 8a 00 mov (%eax),%al 251: 0f be c0 movsbl %al,%eax 254: 01 d0 add %edx,%eax 256: 83 e8 30 sub $0x30,%eax 259: 89 45 fc mov %eax,-0x4(%ebp) 25c: ff 45 08 incl 0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 25f: 8b 45 08 mov 0x8(%ebp),%eax 262: 8a 00 mov (%eax),%al 264: 3c 2f cmp $0x2f,%al 266: 7e 09 jle 271 <atoi+0x42> 268: 8b 45 08 mov 0x8(%ebp),%eax 26b: 8a 00 mov (%eax),%al 26d: 3c 39 cmp $0x39,%al 26f: 7e cd jle 23e <atoi+0xf> n = n*10 + *s++ - '0'; return n; 271: 8b 45 fc mov -0x4(%ebp),%eax } 274: c9 leave 275: c3 ret 00000276 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 276: 55 push %ebp 277: 89 e5 mov %esp,%ebp 279: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 27c: 8b 45 08 mov 0x8(%ebp),%eax 27f: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 282: 8b 45 0c mov 0xc(%ebp),%eax 285: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 288: eb 10 jmp 29a <memmove+0x24> *dst++ = *src++; 28a: 8b 45 f8 mov -0x8(%ebp),%eax 28d: 8a 10 mov (%eax),%dl 28f: 8b 45 fc mov -0x4(%ebp),%eax 292: 88 10 mov %dl,(%eax) 294: ff 45 fc incl -0x4(%ebp) 297: ff 45 f8 incl -0x8(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 29a: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 29e: 0f 9f c0 setg %al 2a1: ff 4d 10 decl 0x10(%ebp) 2a4: 84 c0 test %al,%al 2a6: 75 e2 jne 28a <memmove+0x14> *dst++ = *src++; return vdst; 2a8: 8b 45 08 mov 0x8(%ebp),%eax } 2ab: c9 leave 2ac: c3 ret 000002ad <trampoline>: 2ad: 5a pop %edx 2ae: 59 pop %ecx 2af: 58 pop %eax 2b0: 03 25 04 00 00 00 add 0x4,%esp 2b6: c9 leave 2b7: c3 ret 000002b8 <signal>: "addl 4, %esp\n\t" "leave\n\t" "ret\n\t" ); int signal(int signum, sighandler_t handler) { 2b8: 55 push %ebp 2b9: 89 e5 mov %esp,%ebp 2bb: 83 ec 18 sub $0x18,%esp register_signal_handler(signum, handler, trampoline); 2be: c7 44 24 08 ad 02 00 movl $0x2ad,0x8(%esp) 2c5: 00 2c6: 8b 45 0c mov 0xc(%ebp),%eax 2c9: 89 44 24 04 mov %eax,0x4(%esp) 2cd: 8b 45 08 mov 0x8(%ebp),%eax 2d0: 89 04 24 mov %eax,(%esp) 2d3: e8 b8 00 00 00 call 390 <register_signal_handler> return 0; 2d8: b8 00 00 00 00 mov $0x0,%eax } 2dd: c9 leave 2de: c3 ret 2df: 90 nop 000002e0 <fork>: 2e0: b8 01 00 00 00 mov $0x1,%eax 2e5: cd 40 int $0x40 2e7: c3 ret 000002e8 <exit>: 2e8: b8 02 00 00 00 mov $0x2,%eax 2ed: cd 40 int $0x40 2ef: c3 ret 000002f0 <wait>: 2f0: b8 03 00 00 00 mov $0x3,%eax 2f5: cd 40 int $0x40 2f7: c3 ret 000002f8 <pipe>: 2f8: b8 04 00 00 00 mov $0x4,%eax 2fd: cd 40 int $0x40 2ff: c3 ret 00000300 <read>: 300: b8 05 00 00 00 mov $0x5,%eax 305: cd 40 int $0x40 307: c3 ret 00000308 <write>: 308: b8 10 00 00 00 mov $0x10,%eax 30d: cd 40 int $0x40 30f: c3 ret 00000310 <close>: 310: b8 15 00 00 00 mov $0x15,%eax 315: cd 40 int $0x40 317: c3 ret 00000318 <kill>: 318: b8 06 00 00 00 mov $0x6,%eax 31d: cd 40 int $0x40 31f: c3 ret 00000320 <exec>: 320: b8 07 00 00 00 mov $0x7,%eax 325: cd 40 int $0x40 327: c3 ret 00000328 <open>: 328: b8 0f 00 00 00 mov $0xf,%eax 32d: cd 40 int $0x40 32f: c3 ret 00000330 <mknod>: 330: b8 11 00 00 00 mov $0x11,%eax 335: cd 40 int $0x40 337: c3 ret 00000338 <unlink>: 338: b8 12 00 00 00 mov $0x12,%eax 33d: cd 40 int $0x40 33f: c3 ret 00000340 <fstat>: 340: b8 08 00 00 00 mov $0x8,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <link>: 348: b8 13 00 00 00 mov $0x13,%eax 34d: cd 40 int $0x40 34f: c3 ret 00000350 <mkdir>: 350: b8 14 00 00 00 mov $0x14,%eax 355: cd 40 int $0x40 357: c3 ret 00000358 <chdir>: 358: b8 09 00 00 00 mov $0x9,%eax 35d: cd 40 int $0x40 35f: c3 ret 00000360 <dup>: 360: b8 0a 00 00 00 mov $0xa,%eax 365: cd 40 int $0x40 367: c3 ret 00000368 <getpid>: 368: b8 0b 00 00 00 mov $0xb,%eax 36d: cd 40 int $0x40 36f: c3 ret 00000370 <sbrk>: 370: b8 0c 00 00 00 mov $0xc,%eax 375: cd 40 int $0x40 377: c3 ret 00000378 <sleep>: 378: b8 0d 00 00 00 mov $0xd,%eax 37d: cd 40 int $0x40 37f: c3 ret 00000380 <uptime>: 380: b8 0e 00 00 00 mov $0xe,%eax 385: cd 40 int $0x40 387: c3 ret 00000388 <halt>: 388: b8 16 00 00 00 mov $0x16,%eax 38d: cd 40 int $0x40 38f: c3 ret 00000390 <register_signal_handler>: 390: b8 17 00 00 00 mov $0x17,%eax 395: cd 40 int $0x40 397: c3 ret 00000398 <alarm>: 398: b8 18 00 00 00 mov $0x18,%eax 39d: cd 40 int $0x40 39f: c3 ret 000003a0 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 3a0: 55 push %ebp 3a1: 89 e5 mov %esp,%ebp 3a3: 83 ec 28 sub $0x28,%esp 3a6: 8b 45 0c mov 0xc(%ebp),%eax 3a9: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 3ac: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 3b3: 00 3b4: 8d 45 f4 lea -0xc(%ebp),%eax 3b7: 89 44 24 04 mov %eax,0x4(%esp) 3bb: 8b 45 08 mov 0x8(%ebp),%eax 3be: 89 04 24 mov %eax,(%esp) 3c1: e8 42 ff ff ff call 308 <write> } 3c6: c9 leave 3c7: c3 ret 000003c8 <printint>: static void printint(int fd, int xx, int base, int sgn) { 3c8: 55 push %ebp 3c9: 89 e5 mov %esp,%ebp 3cb: 83 ec 48 sub $0x48,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 3ce: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 3d5: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 3d9: 74 17 je 3f2 <printint+0x2a> 3db: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 3df: 79 11 jns 3f2 <printint+0x2a> neg = 1; 3e1: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 3e8: 8b 45 0c mov 0xc(%ebp),%eax 3eb: f7 d8 neg %eax 3ed: 89 45 ec mov %eax,-0x14(%ebp) 3f0: eb 06 jmp 3f8 <printint+0x30> } else { x = xx; 3f2: 8b 45 0c mov 0xc(%ebp),%eax 3f5: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 3f8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 3ff: 8b 4d 10 mov 0x10(%ebp),%ecx 402: 8b 45 ec mov -0x14(%ebp),%eax 405: ba 00 00 00 00 mov $0x0,%edx 40a: f7 f1 div %ecx 40c: 89 d0 mov %edx,%eax 40e: 8a 80 ac 0a 00 00 mov 0xaac(%eax),%al 414: 8d 4d dc lea -0x24(%ebp),%ecx 417: 8b 55 f4 mov -0xc(%ebp),%edx 41a: 01 ca add %ecx,%edx 41c: 88 02 mov %al,(%edx) 41e: ff 45 f4 incl -0xc(%ebp) }while((x /= base) != 0); 421: 8b 55 10 mov 0x10(%ebp),%edx 424: 89 55 d4 mov %edx,-0x2c(%ebp) 427: 8b 45 ec mov -0x14(%ebp),%eax 42a: ba 00 00 00 00 mov $0x0,%edx 42f: f7 75 d4 divl -0x2c(%ebp) 432: 89 45 ec mov %eax,-0x14(%ebp) 435: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 439: 75 c4 jne 3ff <printint+0x37> if(neg) 43b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 43f: 74 2c je 46d <printint+0xa5> buf[i++] = '-'; 441: 8d 55 dc lea -0x24(%ebp),%edx 444: 8b 45 f4 mov -0xc(%ebp),%eax 447: 01 d0 add %edx,%eax 449: c6 00 2d movb $0x2d,(%eax) 44c: ff 45 f4 incl -0xc(%ebp) while(--i >= 0) 44f: eb 1c jmp 46d <printint+0xa5> putc(fd, buf[i]); 451: 8d 55 dc lea -0x24(%ebp),%edx 454: 8b 45 f4 mov -0xc(%ebp),%eax 457: 01 d0 add %edx,%eax 459: 8a 00 mov (%eax),%al 45b: 0f be c0 movsbl %al,%eax 45e: 89 44 24 04 mov %eax,0x4(%esp) 462: 8b 45 08 mov 0x8(%ebp),%eax 465: 89 04 24 mov %eax,(%esp) 468: e8 33 ff ff ff call 3a0 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 46d: ff 4d f4 decl -0xc(%ebp) 470: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 474: 79 db jns 451 <printint+0x89> putc(fd, buf[i]); } 476: c9 leave 477: c3 ret 00000478 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 478: 55 push %ebp 479: 89 e5 mov %esp,%ebp 47b: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 47e: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 485: 8d 45 0c lea 0xc(%ebp),%eax 488: 83 c0 04 add $0x4,%eax 48b: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 48e: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 495: e9 78 01 00 00 jmp 612 <printf+0x19a> c = fmt[i] & 0xff; 49a: 8b 55 0c mov 0xc(%ebp),%edx 49d: 8b 45 f0 mov -0x10(%ebp),%eax 4a0: 01 d0 add %edx,%eax 4a2: 8a 00 mov (%eax),%al 4a4: 0f be c0 movsbl %al,%eax 4a7: 25 ff 00 00 00 and $0xff,%eax 4ac: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 4af: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4b3: 75 2c jne 4e1 <printf+0x69> if(c == '%'){ 4b5: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 4b9: 75 0c jne 4c7 <printf+0x4f> state = '%'; 4bb: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 4c2: e9 48 01 00 00 jmp 60f <printf+0x197> } else { putc(fd, c); 4c7: 8b 45 e4 mov -0x1c(%ebp),%eax 4ca: 0f be c0 movsbl %al,%eax 4cd: 89 44 24 04 mov %eax,0x4(%esp) 4d1: 8b 45 08 mov 0x8(%ebp),%eax 4d4: 89 04 24 mov %eax,(%esp) 4d7: e8 c4 fe ff ff call 3a0 <putc> 4dc: e9 2e 01 00 00 jmp 60f <printf+0x197> } } else if(state == '%'){ 4e1: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 4e5: 0f 85 24 01 00 00 jne 60f <printf+0x197> if(c == 'd'){ 4eb: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 4ef: 75 2d jne 51e <printf+0xa6> printint(fd, *ap, 10, 1); 4f1: 8b 45 e8 mov -0x18(%ebp),%eax 4f4: 8b 00 mov (%eax),%eax 4f6: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 4fd: 00 4fe: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 505: 00 506: 89 44 24 04 mov %eax,0x4(%esp) 50a: 8b 45 08 mov 0x8(%ebp),%eax 50d: 89 04 24 mov %eax,(%esp) 510: e8 b3 fe ff ff call 3c8 <printint> ap++; 515: 83 45 e8 04 addl $0x4,-0x18(%ebp) 519: e9 ea 00 00 00 jmp 608 <printf+0x190> } else if(c == 'x' || c == 'p'){ 51e: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 522: 74 06 je 52a <printf+0xb2> 524: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 528: 75 2d jne 557 <printf+0xdf> printint(fd, *ap, 16, 0); 52a: 8b 45 e8 mov -0x18(%ebp),%eax 52d: 8b 00 mov (%eax),%eax 52f: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 536: 00 537: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 53e: 00 53f: 89 44 24 04 mov %eax,0x4(%esp) 543: 8b 45 08 mov 0x8(%ebp),%eax 546: 89 04 24 mov %eax,(%esp) 549: e8 7a fe ff ff call 3c8 <printint> ap++; 54e: 83 45 e8 04 addl $0x4,-0x18(%ebp) 552: e9 b1 00 00 00 jmp 608 <printf+0x190> } else if(c == 's'){ 557: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 55b: 75 43 jne 5a0 <printf+0x128> s = (char*)*ap; 55d: 8b 45 e8 mov -0x18(%ebp),%eax 560: 8b 00 mov (%eax),%eax 562: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 565: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 569: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 56d: 75 25 jne 594 <printf+0x11c> s = "(null)"; 56f: c7 45 f4 48 08 00 00 movl $0x848,-0xc(%ebp) while(*s != 0){ 576: eb 1c jmp 594 <printf+0x11c> putc(fd, *s); 578: 8b 45 f4 mov -0xc(%ebp),%eax 57b: 8a 00 mov (%eax),%al 57d: 0f be c0 movsbl %al,%eax 580: 89 44 24 04 mov %eax,0x4(%esp) 584: 8b 45 08 mov 0x8(%ebp),%eax 587: 89 04 24 mov %eax,(%esp) 58a: e8 11 fe ff ff call 3a0 <putc> s++; 58f: ff 45 f4 incl -0xc(%ebp) 592: eb 01 jmp 595 <printf+0x11d> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 594: 90 nop 595: 8b 45 f4 mov -0xc(%ebp),%eax 598: 8a 00 mov (%eax),%al 59a: 84 c0 test %al,%al 59c: 75 da jne 578 <printf+0x100> 59e: eb 68 jmp 608 <printf+0x190> putc(fd, *s); s++; } } else if(c == 'c'){ 5a0: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 5a4: 75 1d jne 5c3 <printf+0x14b> putc(fd, *ap); 5a6: 8b 45 e8 mov -0x18(%ebp),%eax 5a9: 8b 00 mov (%eax),%eax 5ab: 0f be c0 movsbl %al,%eax 5ae: 89 44 24 04 mov %eax,0x4(%esp) 5b2: 8b 45 08 mov 0x8(%ebp),%eax 5b5: 89 04 24 mov %eax,(%esp) 5b8: e8 e3 fd ff ff call 3a0 <putc> ap++; 5bd: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5c1: eb 45 jmp 608 <printf+0x190> } else if(c == '%'){ 5c3: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 5c7: 75 17 jne 5e0 <printf+0x168> putc(fd, c); 5c9: 8b 45 e4 mov -0x1c(%ebp),%eax 5cc: 0f be c0 movsbl %al,%eax 5cf: 89 44 24 04 mov %eax,0x4(%esp) 5d3: 8b 45 08 mov 0x8(%ebp),%eax 5d6: 89 04 24 mov %eax,(%esp) 5d9: e8 c2 fd ff ff call 3a0 <putc> 5de: eb 28 jmp 608 <printf+0x190> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 5e0: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 5e7: 00 5e8: 8b 45 08 mov 0x8(%ebp),%eax 5eb: 89 04 24 mov %eax,(%esp) 5ee: e8 ad fd ff ff call 3a0 <putc> putc(fd, c); 5f3: 8b 45 e4 mov -0x1c(%ebp),%eax 5f6: 0f be c0 movsbl %al,%eax 5f9: 89 44 24 04 mov %eax,0x4(%esp) 5fd: 8b 45 08 mov 0x8(%ebp),%eax 600: 89 04 24 mov %eax,(%esp) 603: e8 98 fd ff ff call 3a0 <putc> } state = 0; 608: 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++){ 60f: ff 45 f0 incl -0x10(%ebp) 612: 8b 55 0c mov 0xc(%ebp),%edx 615: 8b 45 f0 mov -0x10(%ebp),%eax 618: 01 d0 add %edx,%eax 61a: 8a 00 mov (%eax),%al 61c: 84 c0 test %al,%al 61e: 0f 85 76 fe ff ff jne 49a <printf+0x22> putc(fd, c); } state = 0; } } } 624: c9 leave 625: c3 ret 626: 66 90 xchg %ax,%ax 00000628 <free>: static Header base; static Header *freep; void free(void *ap) { 628: 55 push %ebp 629: 89 e5 mov %esp,%ebp 62b: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 62e: 8b 45 08 mov 0x8(%ebp),%eax 631: 83 e8 08 sub $0x8,%eax 634: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 637: a1 c8 0a 00 00 mov 0xac8,%eax 63c: 89 45 fc mov %eax,-0x4(%ebp) 63f: eb 24 jmp 665 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 641: 8b 45 fc mov -0x4(%ebp),%eax 644: 8b 00 mov (%eax),%eax 646: 3b 45 fc cmp -0x4(%ebp),%eax 649: 77 12 ja 65d <free+0x35> 64b: 8b 45 f8 mov -0x8(%ebp),%eax 64e: 3b 45 fc cmp -0x4(%ebp),%eax 651: 77 24 ja 677 <free+0x4f> 653: 8b 45 fc mov -0x4(%ebp),%eax 656: 8b 00 mov (%eax),%eax 658: 3b 45 f8 cmp -0x8(%ebp),%eax 65b: 77 1a ja 677 <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) 65d: 8b 45 fc mov -0x4(%ebp),%eax 660: 8b 00 mov (%eax),%eax 662: 89 45 fc mov %eax,-0x4(%ebp) 665: 8b 45 f8 mov -0x8(%ebp),%eax 668: 3b 45 fc cmp -0x4(%ebp),%eax 66b: 76 d4 jbe 641 <free+0x19> 66d: 8b 45 fc mov -0x4(%ebp),%eax 670: 8b 00 mov (%eax),%eax 672: 3b 45 f8 cmp -0x8(%ebp),%eax 675: 76 ca jbe 641 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 677: 8b 45 f8 mov -0x8(%ebp),%eax 67a: 8b 40 04 mov 0x4(%eax),%eax 67d: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 684: 8b 45 f8 mov -0x8(%ebp),%eax 687: 01 c2 add %eax,%edx 689: 8b 45 fc mov -0x4(%ebp),%eax 68c: 8b 00 mov (%eax),%eax 68e: 39 c2 cmp %eax,%edx 690: 75 24 jne 6b6 <free+0x8e> bp->s.size += p->s.ptr->s.size; 692: 8b 45 f8 mov -0x8(%ebp),%eax 695: 8b 50 04 mov 0x4(%eax),%edx 698: 8b 45 fc mov -0x4(%ebp),%eax 69b: 8b 00 mov (%eax),%eax 69d: 8b 40 04 mov 0x4(%eax),%eax 6a0: 01 c2 add %eax,%edx 6a2: 8b 45 f8 mov -0x8(%ebp),%eax 6a5: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 6a8: 8b 45 fc mov -0x4(%ebp),%eax 6ab: 8b 00 mov (%eax),%eax 6ad: 8b 10 mov (%eax),%edx 6af: 8b 45 f8 mov -0x8(%ebp),%eax 6b2: 89 10 mov %edx,(%eax) 6b4: eb 0a jmp 6c0 <free+0x98> } else bp->s.ptr = p->s.ptr; 6b6: 8b 45 fc mov -0x4(%ebp),%eax 6b9: 8b 10 mov (%eax),%edx 6bb: 8b 45 f8 mov -0x8(%ebp),%eax 6be: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 6c0: 8b 45 fc mov -0x4(%ebp),%eax 6c3: 8b 40 04 mov 0x4(%eax),%eax 6c6: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 6cd: 8b 45 fc mov -0x4(%ebp),%eax 6d0: 01 d0 add %edx,%eax 6d2: 3b 45 f8 cmp -0x8(%ebp),%eax 6d5: 75 20 jne 6f7 <free+0xcf> p->s.size += bp->s.size; 6d7: 8b 45 fc mov -0x4(%ebp),%eax 6da: 8b 50 04 mov 0x4(%eax),%edx 6dd: 8b 45 f8 mov -0x8(%ebp),%eax 6e0: 8b 40 04 mov 0x4(%eax),%eax 6e3: 01 c2 add %eax,%edx 6e5: 8b 45 fc mov -0x4(%ebp),%eax 6e8: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6eb: 8b 45 f8 mov -0x8(%ebp),%eax 6ee: 8b 10 mov (%eax),%edx 6f0: 8b 45 fc mov -0x4(%ebp),%eax 6f3: 89 10 mov %edx,(%eax) 6f5: eb 08 jmp 6ff <free+0xd7> } else p->s.ptr = bp; 6f7: 8b 45 fc mov -0x4(%ebp),%eax 6fa: 8b 55 f8 mov -0x8(%ebp),%edx 6fd: 89 10 mov %edx,(%eax) freep = p; 6ff: 8b 45 fc mov -0x4(%ebp),%eax 702: a3 c8 0a 00 00 mov %eax,0xac8 } 707: c9 leave 708: c3 ret 00000709 <morecore>: static Header* morecore(uint nu) { 709: 55 push %ebp 70a: 89 e5 mov %esp,%ebp 70c: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 70f: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 716: 77 07 ja 71f <morecore+0x16> nu = 4096; 718: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 71f: 8b 45 08 mov 0x8(%ebp),%eax 722: c1 e0 03 shl $0x3,%eax 725: 89 04 24 mov %eax,(%esp) 728: e8 43 fc ff ff call 370 <sbrk> 72d: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 730: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 734: 75 07 jne 73d <morecore+0x34> return 0; 736: b8 00 00 00 00 mov $0x0,%eax 73b: eb 22 jmp 75f <morecore+0x56> hp = (Header*)p; 73d: 8b 45 f4 mov -0xc(%ebp),%eax 740: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 743: 8b 45 f0 mov -0x10(%ebp),%eax 746: 8b 55 08 mov 0x8(%ebp),%edx 749: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 74c: 8b 45 f0 mov -0x10(%ebp),%eax 74f: 83 c0 08 add $0x8,%eax 752: 89 04 24 mov %eax,(%esp) 755: e8 ce fe ff ff call 628 <free> return freep; 75a: a1 c8 0a 00 00 mov 0xac8,%eax } 75f: c9 leave 760: c3 ret 00000761 <malloc>: void* malloc(uint nbytes) { 761: 55 push %ebp 762: 89 e5 mov %esp,%ebp 764: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 767: 8b 45 08 mov 0x8(%ebp),%eax 76a: 83 c0 07 add $0x7,%eax 76d: c1 e8 03 shr $0x3,%eax 770: 40 inc %eax 771: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 774: a1 c8 0a 00 00 mov 0xac8,%eax 779: 89 45 f0 mov %eax,-0x10(%ebp) 77c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 780: 75 23 jne 7a5 <malloc+0x44> base.s.ptr = freep = prevp = &base; 782: c7 45 f0 c0 0a 00 00 movl $0xac0,-0x10(%ebp) 789: 8b 45 f0 mov -0x10(%ebp),%eax 78c: a3 c8 0a 00 00 mov %eax,0xac8 791: a1 c8 0a 00 00 mov 0xac8,%eax 796: a3 c0 0a 00 00 mov %eax,0xac0 base.s.size = 0; 79b: c7 05 c4 0a 00 00 00 movl $0x0,0xac4 7a2: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7a5: 8b 45 f0 mov -0x10(%ebp),%eax 7a8: 8b 00 mov (%eax),%eax 7aa: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 7ad: 8b 45 f4 mov -0xc(%ebp),%eax 7b0: 8b 40 04 mov 0x4(%eax),%eax 7b3: 3b 45 ec cmp -0x14(%ebp),%eax 7b6: 72 4d jb 805 <malloc+0xa4> if(p->s.size == nunits) 7b8: 8b 45 f4 mov -0xc(%ebp),%eax 7bb: 8b 40 04 mov 0x4(%eax),%eax 7be: 3b 45 ec cmp -0x14(%ebp),%eax 7c1: 75 0c jne 7cf <malloc+0x6e> prevp->s.ptr = p->s.ptr; 7c3: 8b 45 f4 mov -0xc(%ebp),%eax 7c6: 8b 10 mov (%eax),%edx 7c8: 8b 45 f0 mov -0x10(%ebp),%eax 7cb: 89 10 mov %edx,(%eax) 7cd: eb 26 jmp 7f5 <malloc+0x94> else { p->s.size -= nunits; 7cf: 8b 45 f4 mov -0xc(%ebp),%eax 7d2: 8b 40 04 mov 0x4(%eax),%eax 7d5: 89 c2 mov %eax,%edx 7d7: 2b 55 ec sub -0x14(%ebp),%edx 7da: 8b 45 f4 mov -0xc(%ebp),%eax 7dd: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 7e0: 8b 45 f4 mov -0xc(%ebp),%eax 7e3: 8b 40 04 mov 0x4(%eax),%eax 7e6: c1 e0 03 shl $0x3,%eax 7e9: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 7ec: 8b 45 f4 mov -0xc(%ebp),%eax 7ef: 8b 55 ec mov -0x14(%ebp),%edx 7f2: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 7f5: 8b 45 f0 mov -0x10(%ebp),%eax 7f8: a3 c8 0a 00 00 mov %eax,0xac8 return (void*)(p + 1); 7fd: 8b 45 f4 mov -0xc(%ebp),%eax 800: 83 c0 08 add $0x8,%eax 803: eb 38 jmp 83d <malloc+0xdc> } if(p == freep) 805: a1 c8 0a 00 00 mov 0xac8,%eax 80a: 39 45 f4 cmp %eax,-0xc(%ebp) 80d: 75 1b jne 82a <malloc+0xc9> if((p = morecore(nunits)) == 0) 80f: 8b 45 ec mov -0x14(%ebp),%eax 812: 89 04 24 mov %eax,(%esp) 815: e8 ef fe ff ff call 709 <morecore> 81a: 89 45 f4 mov %eax,-0xc(%ebp) 81d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 821: 75 07 jne 82a <malloc+0xc9> return 0; 823: b8 00 00 00 00 mov $0x0,%eax 828: eb 13 jmp 83d <malloc+0xdc> 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){ 82a: 8b 45 f4 mov -0xc(%ebp),%eax 82d: 89 45 f0 mov %eax,-0x10(%ebp) 830: 8b 45 f4 mov -0xc(%ebp),%eax 833: 8b 00 mov (%eax),%eax 835: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 838: e9 70 ff ff ff jmp 7ad <malloc+0x4c> } 83d: c9 leave 83e: c3 ret
34.335827
64
0.419406
d870c079abf84bbf16aba0330b15b60b63a8d8a1
922
asm
Assembly
wtfx/samples/whitenoise-v2.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
59
2015-02-28T14:15:56.000Z
2022-03-26T12:06:01.000Z
wtfx/samples/whitenoise-v2.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
1
2016-08-22T05:32:43.000Z
2016-08-22T09:33:28.000Z
wtfx/samples/whitenoise-v2.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
9
2015-02-28T14:16:31.000Z
2022-01-18T17:52:48.000Z
db 136,136,0,204,136,204,204,204,0,136,0,204,204,0,0,0 db 204,204,204,204,204,0,0,0,0,204,0,204,204,204,0,0 db 136,136,136,204,204,136,204,0,0,0,0,0,204,204,204,204 db 204,204,204,136,0,0,136,136,0,204,136,136,204,0,204,136 db 0,136,204,0,0,204,204,204,0,0,0,0,136,0,0,204 db 0,0,204,136,204,136,0,0,204,136,136,204,136,136,204,136 db 0,136,136,204,136,204,204,136,0,0,136,136,204,136,136,0 db 136,136,204,136,204,0,136,136,204,204,136,0,0,204,136,204 db 204,0,204,0,0,136,136,204,136,0,0,204,136,0,136,0 db 136,0,136,136,204,0,0,136,0,204,136,204,204,204,204,204 db 0,136,0,204,0,0,136,136,204,0,204,0,204,136,204,136 db 0,0,0,0,136,204,0,204,204,136,204,204,136,204,204,0 db 204,0,0,0,136,136,136,136,136,136,136,0,204,0,136,136 db 204,136,136,0,0,136,136,136,0,204,136,204,204,204,0,136 db 0,204,136,136,204,0,204,136,136,136,0,136,136,136,204,0 db 0,0,136,136,204,204,204,0,204,136,0,136,136,136,0,136
54.235294
61
0.687636
06ca3d0ca9c12ff20e415ffcbc08faee935c0261
1,031
asm
Assembly
EjerciciosMIPS/ejercicio6.asm
PauloBarrantes/Niark
7032e1cd0989a7d1cc8415fef878ffa9d3a56548
[ "MIT" ]
1
2018-06-15T23:54:28.000Z
2018-06-15T23:54:28.000Z
EjerciciosMIPS/ejercicio6.asm
PauloBarrantes/Niark
7032e1cd0989a7d1cc8415fef878ffa9d3a56548
[ "MIT" ]
null
null
null
EjerciciosMIPS/ejercicio6.asm
PauloBarrantes/Niark
7032e1cd0989a7d1cc8415fef878ffa9d3a56548
[ "MIT" ]
null
null
null
.data prompt1: .asciiz "Digite el primer numero: " prompt2: .asciiz "Digite el segundo numero: " prompt3: .asciiz "Digite el tercer numero: " string1: .asciiz "Promedio: " saltolinea: .asciiz "\n" .text .globl main main: ##Pedimos el primer numero li $v0, 4 la $a0, prompt1 syscall li $v0, 5 syscall move $t0, $v0 ##Pedimos el segundo numero li $v0, 4 la $a0, prompt2 syscall li $v0, 5 syscall move $t1, $v0 ##Pedimos el tercer numero li $v0, 4 la $a0, prompt3 syscall li $v0, 5 syscall move $t2, $v0 ## Calculamos el promedio add $t0, $t0, $t1 add $t0, $t0,$t2 li $t4, 3 div $t0, $t4 mflo $t0 li $v0, 4 la $a0, string1 syscall li $v0, 1 move $a0, $t0 syscall ### Exit System Call ### li $v0,10 syscall
19.092593
54
0.463628
0fd1c9304a24f8ce783444ba382855945993e48b
550
asm
Assembly
programs/oeis/024/A024678.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/024/A024678.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/024/A024678.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A024678: a(n) is the position of (prime(n+1) + prime(n+2))/2 in the ordered nonprimes. ; 2,3,5,7,9,11,13,17,20,23,27,29,31,35,40,43,46,50,52,55,59,63,69,74,76,78,80,82,90,98,102,105,110,115,118,123,127,131,136,139,144,149,151,153,159,170,177,179,181,185,188,193,200,205,210,213,216,220,222,227,238,246,248,250,258,267,274,279,281,285,291,297,302,306,310,316,321,326,334,339,344,349,352,356,360,366,371,373,375,382,391,396,401,406,410,418,424,433,444,451 sub $1,$0 seq $0,24675 ; Average of two consecutive odd primes. add $1,$0 sub $1,2 mov $0,$1
61.111111
366
0.701818
00c51a7fe6c7fc20c525650614fb5406e9dcf0f0
8,934
asm
Assembly
coverage/PENDING_SUBMIT/amdvlk/0618-COVERAGE-instruction-simplify-4172/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
null
null
null
coverage/PENDING_SUBMIT/amdvlk/0618-COVERAGE-instruction-simplify-4172/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/PENDING_SUBMIT/amdvlk/0618-COVERAGE-instruction-simplify-4172/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: 170 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %74 %151 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %7 "S" OpMemberName %7 0 "data" OpName %11 "func0(struct-S-i11;" OpName %10 "s" OpName %14 "func1(" OpName %20 "arr" OpName %43 "a" OpName %46 "buf1" OpMemberName %46 0 "_GLF_uniform_int_values" OpName %48 "" OpName %53 "i" OpName %66 "s" OpName %74 "gl_FragCoord" OpName %81 "buf0" OpMemberName %81 0 "_GLF_uniform_float_values" OpName %83 "" OpName %92 "buf_push" OpMemberName %92 0 "injectionSwitch" OpName %94 "" OpName %138 "param" OpName %151 "_GLF_color" OpDecorate %45 ArrayStride 16 OpMemberDecorate %46 0 Offset 0 OpDecorate %46 Block OpDecorate %48 DescriptorSet 0 OpDecorate %48 Binding 1 OpDecorate %74 BuiltIn FragCoord OpDecorate %80 ArrayStride 16 OpMemberDecorate %81 0 Offset 0 OpDecorate %81 Block OpDecorate %83 DescriptorSet 0 OpDecorate %83 Binding 0 OpMemberDecorate %92 0 Offset 0 OpDecorate %92 Block OpDecorate %151 Location 0 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeInt 32 1 %7 = OpTypeStruct %6 %8 = OpTypePointer Function %7 %9 = OpTypeFunction %2 %8 %13 = OpTypeFunction %6 %16 = OpTypeInt 32 0 %17 = OpConstant %16 10 %18 = OpTypeArray %7 %17 %19 = OpTypePointer Private %18 %20 = OpVariable %19 Private %21 = OpConstant %6 1 %22 = OpConstantComposite %7 %21 %23 = OpConstant %6 2 %24 = OpConstantComposite %7 %23 %25 = OpConstant %6 3 %26 = OpConstantComposite %7 %25 %27 = OpConstant %6 4 %28 = OpConstantComposite %7 %27 %29 = OpConstant %6 5 %30 = OpConstantComposite %7 %29 %31 = OpConstant %6 6 %32 = OpConstantComposite %7 %31 %33 = OpConstant %6 7 %34 = OpConstantComposite %7 %33 %35 = OpConstant %6 8 %36 = OpConstantComposite %7 %35 %37 = OpConstant %6 9 %38 = OpConstantComposite %7 %37 %39 = OpConstant %6 10 %40 = OpConstantComposite %7 %39 %41 = OpConstantComposite %18 %22 %24 %26 %28 %30 %32 %34 %36 %38 %40 %42 = OpTypePointer Function %6 %44 = OpConstant %16 4 %45 = OpTypeArray %6 %44 %46 = OpTypeStruct %45 %47 = OpTypePointer Uniform %46 %48 = OpVariable %47 Uniform %49 = OpConstant %6 0 %50 = OpTypePointer Uniform %6 %64 = OpTypeBool %68 = OpTypePointer Private %7 %71 = OpTypeFloat 32 %72 = OpTypeVector %71 4 %73 = OpTypePointer Input %72 %74 = OpVariable %73 Input %75 = OpConstant %16 0 %76 = OpTypePointer Input %71 %79 = OpConstant %16 1 %80 = OpTypeArray %71 %79 %81 = OpTypeStruct %80 %82 = OpTypePointer Uniform %81 %83 = OpVariable %82 Uniform %84 = OpTypePointer Uniform %71 %91 = OpTypeVector %71 2 %92 = OpTypeStruct %91 %93 = OpTypePointer PushConstant %92 %94 = OpVariable %93 PushConstant %95 = OpTypePointer PushConstant %71 %111 = OpConstant %6 -1 %150 = OpTypePointer Output %72 %151 = OpVariable %150 Output %4 = OpFunction %2 None %3 %5 = OpLabel %138 = OpVariable %8 Function OpStore %20 %41 %136 = OpAccessChain %50 %48 %49 %25 %137 = OpLoad %6 %136 %139 = OpAccessChain %68 %20 %137 %140 = OpLoad %7 %139 OpStore %138 %140 %141 = OpFunctionCall %2 %11 %138 %142 = OpLoad %7 %138 %143 = OpAccessChain %68 %20 %137 OpStore %143 %142 %144 = OpFunctionCall %6 %14 %145 = OpAccessChain %50 %48 %49 %49 %146 = OpLoad %6 %145 %147 = OpIEqual %64 %144 %146 OpSelectionMerge %149 None OpBranchConditional %147 %148 %165 %148 = OpLabel %152 = OpAccessChain %50 %48 %49 %25 %153 = OpLoad %6 %152 %154 = OpConvertSToF %71 %153 %155 = OpAccessChain %50 %48 %49 %21 %156 = OpLoad %6 %155 %157 = OpConvertSToF %71 %156 %158 = OpAccessChain %50 %48 %49 %21 %159 = OpLoad %6 %158 %160 = OpConvertSToF %71 %159 %161 = OpAccessChain %50 %48 %49 %25 %162 = OpLoad %6 %161 %163 = OpConvertSToF %71 %162 %164 = OpCompositeConstruct %72 %154 %157 %160 %163 OpStore %151 %164 OpBranch %149 %165 = OpLabel %166 = OpAccessChain %50 %48 %49 %21 %167 = OpLoad %6 %166 %168 = OpConvertSToF %71 %167 %169 = OpCompositeConstruct %72 %168 %168 %168 %168 OpStore %151 %169 OpBranch %149 %149 = OpLabel OpReturn OpFunctionEnd %11 = OpFunction %2 None %9 %10 = OpFunctionParameter %8 %12 = OpLabel OpReturn OpFunctionEnd %14 = OpFunction %6 None %13 %15 = OpLabel %43 = OpVariable %42 Function %53 = OpVariable %42 Function %66 = OpVariable %8 Function %51 = OpAccessChain %50 %48 %49 %21 %52 = OpLoad %6 %51 OpStore %43 %52 %54 = OpAccessChain %50 %48 %49 %21 %55 = OpLoad %6 %54 OpStore %53 %55 OpBranch %56 %56 = OpLabel OpLoopMerge %58 %59 None OpBranch %60 %60 = OpLabel %61 = OpLoad %6 %53 %62 = OpAccessChain %50 %48 %49 %49 %63 = OpLoad %6 %62 %65 = OpSLessThan %64 %61 %63 OpBranchConditional %65 %57 %58 %57 = OpLabel %67 = OpLoad %6 %43 %69 = OpAccessChain %68 %20 %67 %70 = OpLoad %7 %69 OpStore %66 %70 %77 = OpAccessChain %76 %74 %75 %78 = OpLoad %71 %77 %85 = OpAccessChain %84 %83 %49 %49 %86 = OpLoad %71 %85 %87 = OpFOrdLessThan %64 %78 %86 OpSelectionMerge %89 None OpBranchConditional %87 %88 %89 %88 = OpLabel OpBranch %59 %89 = OpLabel %96 = OpAccessChain %95 %94 %49 %75 %97 = OpLoad %71 %96 %98 = OpAccessChain %95 %94 %49 %79 %99 = OpLoad %71 %98 %100 = OpFOrdGreaterThan %64 %97 %99 OpSelectionMerge %102 None OpBranchConditional %100 %101 %102 %101 = OpLabel OpBranch %59 %102 = OpLabel %104 = OpAccessChain %42 %66 %49 %105 = OpLoad %6 %104 %106 = OpAccessChain %50 %48 %49 %23 %107 = OpLoad %6 %106 %108 = OpIEqual %64 %105 %107 OpSelectionMerge %110 None OpBranchConditional %108 %109 %110 %109 = OpLabel OpReturnValue %111 %110 = OpLabel %113 = OpAccessChain %95 %94 %49 %75 %114 = OpLoad %71 %113 %115 = OpAccessChain %95 %94 %49 %79 %116 = OpLoad %71 %115 %117 = OpFOrdGreaterThan %64 %114 %116 OpSelectionMerge %119 None OpBranchConditional %117 %118 %119 %118 = OpLabel OpBranch %58 %119 = OpLabel %121 = OpAccessChain %76 %74 %75 %122 = OpLoad %71 %121 %123 = OpAccessChain %84 %83 %49 %49 %124 = OpLoad %71 %123 %125 = OpFOrdLessThan %64 %122 %124 OpSelectionMerge %127 None OpBranchConditional %125 %126 %127 %126 = OpLabel OpReturnValue %111 %127 = OpLabel %129 = OpAccessChain %42 %66 %49 %130 = OpLoad %6 %129 OpStore %43 %130 OpBranch %59 %59 = OpLabel %131 = OpLoad %6 %53 %132 = OpIAdd %6 %131 %21 OpStore %53 %132 OpBranch %56 %58 = OpLabel %133 = OpLoad %6 %43 OpReturnValue %133 OpFunctionEnd
35.736
78
0.495523
c72fa684705e4095d57d94ddbafccf57fc56d1c6
7,192
asm
Assembly
Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0xca.log_21829_100.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0xca.log_21829_100.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_ht_zr_/i7-7700_9_0xca.log_21829_100.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 %r14 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1e4ba, %rdi nop nop nop nop nop xor %rbx, %rbx movb (%rdi), %r10b nop nop nop nop add %rcx, %rcx lea addresses_A_ht+0x15aba, %r9 nop nop and %rbp, %rbp mov (%r9), %r14w nop nop nop and $3353, %rbp lea addresses_normal_ht+0x34ba, %r9 nop nop nop sub %rcx, %rcx mov (%r9), %r10 nop nop cmp %rbx, %rbx lea addresses_WC_ht+0x146ba, %rsi lea addresses_WC_ht+0xe93b, %rdi nop nop add %r14, %r14 mov $68, %rcx rep movsq nop nop nop nop xor %rsi, %rsi lea addresses_WC_ht+0x1d6ba, %rbp nop nop nop inc %r9 mov $0x6162636465666768, %rdi movq %rdi, %xmm0 vmovups %ymm0, (%rbp) nop nop nop nop nop cmp $56980, %rdi lea addresses_A_ht+0x1dc7a, %rbp add %rcx, %rcx movw $0x6162, (%rbp) nop nop nop nop nop mfence lea addresses_WC_ht+0xcdba, %rcx nop nop nop nop and $10940, %r10 mov $0x6162636465666768, %rdi movq %rdi, %xmm3 movups %xmm3, (%rcx) nop nop cmp %r14, %r14 lea addresses_A_ht+0x17ffa, %r14 nop dec %rdi movw $0x6162, (%r14) nop nop nop inc %r14 lea addresses_WC_ht+0x35ba, %r9 nop nop nop nop nop and $37875, %r10 movups (%r9), %xmm0 vpextrq $0, %xmm0, %r14 nop nop xor %rbx, %rbx lea addresses_A_ht+0x13752, %rsi lea addresses_D_ht+0x439a, %rdi sub %r10, %r10 mov $115, %rcx rep movsw inc %r10 lea addresses_UC_ht+0x19018, %rsi lea addresses_D_ht+0x1d4fa, %rdi cmp $38982, %r9 mov $16, %rcx rep movsl nop nop nop nop nop dec %rbp lea addresses_WT_ht+0xc8ba, %rsi lea addresses_normal_ht+0x50f0, %rdi nop nop nop cmp $25623, %rbx mov $57, %rcx rep movsl nop add $27123, %rcx lea addresses_UC_ht+0x106ba, %rcx nop inc %r9 movb (%rcx), %r10b nop nop cmp %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %rax push %rbp push %rcx push %rdi // Faulty Load lea addresses_US+0x146ba, %rcx add $27643, %rax movups (%rcx), %xmm3 vpextrq $1, %xmm3, %r12 lea oracles, %rbp and $0xff, %r12 shlq $12, %r12 mov (%rbp,%r12,1), %r12 pop %rdi pop %rcx pop %rbp pop %rax pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}} {'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 11, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'45': 707, '48': 9920, '00': 6824, '49': 4378} 48 49 00 00 00 49 48 48 00 49 48 48 48 49 48 48 00 49 48 48 00 49 00 48 00 45 48 48 49 00 48 48 49 00 48 49 48 48 49 00 00 48 49 00 48 00 49 00 48 49 48 48 49 49 48 48 48 48 49 48 48 49 48 48 48 48 00 48 48 00 00 48 00 49 48 48 00 49 48 48 00 49 48 48 00 49 48 48 48 49 00 48 48 00 48 48 49 00 48 00 49 00 48 00 49 48 48 48 00 00 48 48 49 48 48 48 48 00 48 48 00 49 48 48 49 48 48 00 45 00 00 45 48 00 48 48 48 00 00 48 00 49 48 48 48 49 00 00 49 00 48 00 49 00 48 49 48 00 49 48 48 48 00 48 48 49 00 48 49 48 48 48 49 48 48 48 00 00 48 00 49 48 48 48 49 48 48 00 49 45 00 48 00 45 48 48 00 00 48 48 00 00 00 48 49 48 48 48 48 00 00 00 00 00 49 00 48 48 48 00 00 48 49 48 48 48 49 00 48 49 49 00 48 49 00 00 00 00 48 48 49 48 48 48 48 49 48 48 00 00 00 00 48 48 00 00 48 00 48 49 48 48 48 00 48 48 48 00 48 00 00 48 48 00 49 00 48 00 45 48 00 49 48 48 48 48 48 49 45 48 48 49 48 49 45 00 48 00 00 48 00 48 00 00 48 48 49 48 48 49 00 48 49 00 48 00 48 00 49 48 48 00 00 48 48 48 48 49 48 48 48 49 48 48 49 00 48 48 49 48 48 49 48 48 49 45 00 48 49 00 48 48 00 48 00 49 48 00 00 00 48 00 49 00 48 48 48 48 48 48 48 00 49 48 48 49 48 48 49 00 48 00 49 00 48 49 48 48 48 00 48 00 49 00 48 00 49 48 00 49 45 48 48 49 48 48 48 00 00 00 49 48 48 00 00 49 00 48 00 49 00 48 00 45 00 00 49 48 48 00 49 48 48 00 49 48 48 49 00 00 48 45 00 48 49 49 00 48 48 49 48 00 48 00 49 48 00 49 00 48 48 49 00 48 00 48 48 49 00 48 00 49 48 48 49 00 48 49 49 00 00 48 49 48 48 00 45 00 48 45 48 48 48 49 48 48 48 49 00 48 00 48 00 48 48 00 48 48 49 48 48 49 48 48 00 00 48 48 00 49 48 48 49 48 48 00 49 00 48 00 49 48 00 48 49 00 48 00 49 00 48 00 45 48 48 49 00 48 00 45 00 00 48 48 48 00 48 48 48 49 48 48 49 48 48 00 49 48 00 49 00 48 49 49 48 48 49 45 00 48 49 48 00 48 48 49 00 48 48 49 00 48 00 48 00 49 00 48 49 48 48 48 00 00 49 00 48 49 48 48 00 49 00 48 49 48 48 00 48 48 48 00 48 48 48 49 48 48 49 48 00 48 49 45 00 00 49 00 48 00 00 48 48 48 49 48 48 48 49 48 48 00 49 48 48 49 00 00 48 48 48 00 00 48 00 49 49 00 48 00 48 48 00 45 48 48 48 49 00 48 00 45 48 00 49 48 48 48 48 45 48 48 49 48 00 49 00 48 00 45 48 00 48 48 49 48 48 48 49 48 00 49 45 00 48 45 48 48 00 49 48 48 00 00 48 48 00 45 48 48 49 48 48 00 45 00 48 49 00 48 49 48 00 49 00 48 48 49 00 00 00 45 00 48 00 48 00 49 48 48 49 48 00 49 45 48 00 00 48 48 49 00 48 48 00 49 48 48 48 49 48 00 49 00 48 48 49 00 00 49 48 00 49 49 00 48 00 49 48 00 49 00 48 49 48 48 00 00 48 48 00 45 48 48 49 00 00 49 00 00 49 48 00 00 48 48 49 48 00 48 49 48 48 48 49 48 48 00 49 00 00 48 00 49 00 48 49 48 00 49 48 48 00 49 00 48 00 00 45 48 48 48 00 48 00 00 48 48 48 49 48 48 48 00 48 00 49 00 48 48 00 00 48 48 49 48 00 48 49 00 48 00 00 48 00 49 00 00 49 00 48 48 49 48 48 49 00 48 48 00 49 00 48 49 48 48 00 48 48 48 48 49 48 48 00 45 48 00 49 48 00 49 00 00 00 48 48 00 49 45 00 00 00 48 48 48 49 00 48 49 48 48 00 00 00 48 48 48 49 48 00 00 00 48 48 00 48 48 49 49 00 48 48 49 48 48 48 49 48 48 49 48 00 48 48 48 49 00 48 48 49 00 00 49 00 48 49 00 48 48 */
35.96
2,999
0.656702
634bc01db7e20142ca15890b1b46470f856bf053
676
asm
Assembly
src/dynamic_print.asm
MarioSieg/Utilitiy-Routines
f685cfc5cb472c295c697235d89fb391e8693654
[ "MIT" ]
1
2021-03-09T17:05:28.000Z
2021-03-09T17:05:28.000Z
src/dynamic_print.asm
MarioSieg/Utilitiy-Routines
f685cfc5cb472c295c697235d89fb391e8693654
[ "MIT" ]
null
null
null
src/dynamic_print.asm
MarioSieg/Utilitiy-Routines
f685cfc5cb472c295c697235d89fb391e8693654
[ "MIT" ]
null
null
null
.data msg1: .asciz "Ohohohohohohohooh!\n" .equ msg1_len, .-msg1-1 # . = current address - address of msg1 minus 1 for null terminator .text .globl main main: push %rbp # prologue movq %rsp, %rbp # prologue movq $1, %rax # 1 = write movq $1, %rdi # 1 = to stdout movq $msg1, %rsi # string ptr movq $msg1_len, %rdx # length syscall pop %rbp # epilogue movq %rbp, %rsp # epilogue movq $60, %rax # 60 = exit xorl %edi, %edi # 0 = success exit code syscall # call kernel
28.166667
91
0.467456
e0b406f444e981470f4d42f95461c4aca68c5167
13,720
asm
Assembly
src/presets/cm_presets_defeatvitreous.asm
spannerisms/lttphack
8309fecd1b73db4d81616ec500253ae1aa52b399
[ "MIT" ]
6
2020-02-14T17:14:52.000Z
2021-12-06T19:51:25.000Z
src/presets/cm_presets_defeatvitreous.asm
spannerisms/lttphack
8309fecd1b73db4d81616ec500253ae1aa52b399
[ "MIT" ]
1
2020-09-26T07:40:33.000Z
2020-09-26T07:40:33.000Z
src/presets/cm_presets_defeatvitreous.asm
spannerisms/lttphack
8309fecd1b73db4d81616ec500253ae1aa52b399
[ "MIT" ]
7
2019-12-02T21:51:51.000Z
2021-07-03T17:53:04.000Z
;=================================================================================================== ; PRESET DATA HEADER ;=================================================================================================== presetheader_defeatvitreous: dw presetSRAM_defeatvitreous ; location of SRAM dw presetpersistent_defeatvitreous ; location of persistent data ;=================================================================================================== %menu_header("Defeat Vitreous", 16) ;=================================================================================================== ;--------------------------------------------------------------------------------------------------- ; VITREOUS ;--------------------------------------------------------------------------------------------------- ;=================================================================================================== ;--------------------------------------------------------------------------------------------------- %preset_UW("Link's Bed", "defeatvitreous", "vitreous", "links_bed") dw $0104 ; Screen ID dw $0940, $215A ; Link Coords dw $0900, $2110 ; Camera HV db $00 ; Item db $02 ; Direction ;----------------------------- db $00 ; Entrance db $20 ; Room layout db $00 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Courtyard", "defeatvitreous", "vitreous", "courtyard") dw $0055 ; Screen ID dw $0A78, $0BE1 ; Link Coords dw $0A00, $0B10 ; Camera HV db $00 ; Item db $02 ; Direction ;----------------------------- db $7D ; Entrance db $AF ; Room layout db $01 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_OW("Lobby Quadrant Glitch", "defeatvitreous", "vitreous", "lobby_quadrant_glitch") dw $001B ; Screen ID dw $07F8, $06FA ; Link Coords dw $0784, $069C ; Camera HV db $00 ; Item db $00 ; Direction ;----------------------------- dw $0803, $0709 ; Scroll X,Y dw $0530 ; Tilemap position ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Ice Chair", "defeatvitreous", "vitreous", "ice_chair") dw $004F ; Screen ID dw $FFC8, $0E04 ; Link Coords dw $FF02, $0C00 ; Camera HV db $00 ; Item db $00 ; Direction ;----------------------------- db $04 ; Entrance db $10 ; Room layout db $0C ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write16_enable() %write16($7E0600, $0C00) ; Camera boundaries %write16($7E0602, $0A00) ; Camera boundaries %write16($7E0604, $0C10) ; Camera boundaries %write16($7E0606, $0B10) ; Camera boundaries %write16($7E0608, $FF00) ; Camera boundaries %write16($7E060A, $FE00) ; Camera boundaries %write16($7E060C, $FF00) ; Camera boundaries %write16($7E060E, $FF00) ; Camera boundaries %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Supply Run", "defeatvitreous", "vitreous", "supply_run") dw $002F ; Screen ID dw $FF78, $0BE1 ; Link Coords dw $FE98, $0910 ; Camera HV db $00 ; Item db $02 ; Direction ;----------------------------- db $04 ; Entrance db $B0 ; Room layout db $01 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write16_enable() %write16($7E0600, $0900) ; Camera boundaries %write16($7E0602, $0600) ; Camera boundaries %write16($7E0604, $0910) ; Camera boundaries %write16($7E0606, $0710) ; Camera boundaries %write_end() ;--------------------------------------------------------------------------------------------------- %preset_OW("Leaving Kakariko", "defeatvitreous", "vitreous", "leaving_kakariko") dw $0018 ; Screen ID dw $0346, $0605 ; Link Coords dw $02C4, $0600 ; Camera HV db $01 ; Item db $00 ; Direction ;----------------------------- dw $0351, $066D ; Scroll X,Y dw $0058 ; Tilemap position ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_OW("Bridge to Witch Hut", "defeatvitreous", "vitreous", "bridge_to_witch_hut") dw $0015 ; Screen ID dw $0AA4, $05E2 ; Link Coords dw $0A32, $051E ; Camera HV db $01 ; Item db $02 ; Direction ;----------------------------- dw $0AAF, $058D ; Scroll X,Y dw $0906 ; Tilemap position ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_OW("Trudge to PoD", "defeatvitreous", "vitreous", "trudge_to_pod") dw $0015 ; Screen ID dw $0AA8, $0459 ; Link Coords dw $0A2E, $0400 ; Camera HV db $01 ; Item db $00 ; Direction ;----------------------------- dw $0AB3, $046F ; Scroll X,Y dw $0084 ; Tilemap position ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Beetle Colosseum", "defeatvitreous", "vitreous", "beetle_colosseum") dw $002B ; Screen ID dw $160A, $04F8 ; Link Coords dw $1600, $048B ; Camera HV db $00 ; Item db $04 ; Direction ;----------------------------- db $38 ; Entrance db $4F ; Room layout db $4A ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_OW("PoD Entrance", "defeatvitreous", "vitreous", "pod_entrance") dw $005E ; Screen ID dw $0F50, $063B ; Link Coords dw $0ED6, $0600 ; Camera HV db $00 ; Item db $02 ; Direction ;----------------------------- dw $0F5B, $066D ; Scroll X,Y dw $005A ; Tilemap position ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Death Hole", "defeatvitreous", "vitreous", "death_hole") dw $004A ; Screen ID dw $14F8, $0814 ; Link Coords dw $1480, $0800 ; Camera HV db $00 ; Item db $00 ; Direction ;----------------------------- db $26 ; Entrance db $80 ; Room layout db $01 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Trudge to Catwalk", "defeatvitreous", "vitreous", "trudge_to_catwalk") dw $00FA ; Screen ID dw $14C0, $FF30 ; Link Coords dw $1448, $FEC5 ; Camera HV db $01 ; Item db $00 ; Direction ;----------------------------- db $26 ; Entrance db $E0 ; Room layout db $00 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Sewers to Throne Room", "defeatvitreous", "vitreous", "sewers_to_throne_room") dw $0040 ; Screen ID dw $21E8, $060C ; Link Coords dw $2100, $0602 ; Camera HV db $01 ; Item db $06 ; Direction ;----------------------------- db $26 ; Entrance db $50 ; Room layout db $0C ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Reload Enemies", "defeatvitreous", "vitreous", "reload_enemies") dw $0051 ; Screen ID dw $22F8, $0814 ; Link Coords dw $2280, $0800 ; Camera HV db $01 ; Item db $00 ; Direction ;----------------------------- db $26 ; Entrance db $C0 ; Room layout db $01 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("East Hall YBA", "defeatvitreous", "vitreous", "east_hall_yba") dw $0001 ; Screen ID dw $03E8, $0078 ; Link Coords dw $0300, $000B ; Camera HV db $01 ; Item db $06 ; Direction ;----------------------------- db $26 ; Entrance db $90 ; Room layout db $0E ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write_end() ;--------------------------------------------------------------------------------------------------- %preset_UW("Vitreous", "defeatvitreous", "vitreous", "vitreous") dw $F080 ; Screen ID dw $01C8, $11DB ; Link Coords dw $0102, $10EC ; Camera HV db $0B ; Item db $02 ; Direction ;----------------------------- db $26 ; Entrance db $B0 ; Room layout db $00 ; Door / Peg state / Layer dw $0000 ; Dead sprites ;----------------------------- %write16_enable() %write16($7E0600, $1100) ; Camera boundaries %write16($7E0602, $091E) ; Camera boundaries %write16($7E0604, $1110) ; Camera boundaries %write16($7E0606, $0F00) ; Camera boundaries %write16($7E0608, $0100) ; Camera boundaries %write16($7E060A, $0000) ; Camera boundaries %write16($7E060C, $0100) ; Camera boundaries %write16($7E060E, $0100) ; Camera boundaries %write_end() ;=================================================================================================== presetpersistent_defeatvitreous: ;=================================================================================================== presetpersistent_defeatvitreous_vitreous: ;----------------------------- .links_bed %write_sq() %write8($7E044A, $00) ; EG strength %write8($7E047A, $00) ; Armed EG ..end ;----------------------------- .courtyard %write8($7E044A, $02) ; EG strength ..end ;----------------------------- .lobby_quadrant_glitch ..end ;----------------------------- .ice_chair %write8($7E044A, $01) ; EG strength ..end ;----------------------------- .supply_run %write8($7E047A, $01) ; Armed EG ..end ;----------------------------- .leaving_kakariko ..end ;----------------------------- .bridge_to_witch_hut ..end ;----------------------------- .trudge_to_pod ..end ;----------------------------- .beetle_colosseum %write8($7E044A, $02) ; EG strength %write8($7E047A, $00) ; Armed EG ..end ;----------------------------- .pod_entrance ..end ;----------------------------- .death_hole ..end ;----------------------------- .trudge_to_catwalk %write8($7E044A, $01) ; EG strength ..end ;----------------------------- .sewers_to_throne_room %write8($7E047A, $01) ; Armed EG ..end ;----------------------------- .reload_enemies ..end ;----------------------------- .east_hall_yba %write8($7E047A, $00) ; Armed EG ..end ;----------------------------- .vitreous ..end ;=================================================================================================== presetSRAM_defeatvitreous: ;----------------------------- .vitreous ;----------------------------- ..links_bed %write8($7EF36F, $FF) ; Keys %writeroom($104, $0002) ...end ;----------------------------- ..courtyard %write8($7EF359, $01) ; Sword %write8($7EF35A, $01) ; Shield %write8($7EF3C5, $01) ; Game state %write8($7EF3C6, $11) ; Game flags A %write8($7EF3C8, $03) ; Spawn point %writeroom($055, $000F) ...end ;----------------------------- ..lobby_quadrant_glitch ...end ;----------------------------- ..ice_chair %write8($7EF36F, $00) ; Keys %writeroom($04F, $0004) %writeroom($050, $000F) %writeroom($060, $0005) %writeroom($061, $000F) ...end ;----------------------------- ..supply_run %write8($7EF36D, $10) ; Health %writeroom($02F, $0003) %writeroom($03F, $0005) %writeroom($040, $000F) ...end ;----------------------------- ..leaving_kakariko %write8($7EF343, $01) ; Bombs %write8($7EF35C, $02) ; Bottle 1 %write8($7EF36F, $FF) ; Keys %write16sram($7EF360, $003C) ; Rupees %writeroom($103, $001A) %writeroom($119, $0003) %writeroom($11D, $01A3) ...end ;----------------------------- ..bridge_to_witch_hut ...end ;----------------------------- ..trudge_to_pod %write8($7EF35C, $04) ; Bottle 1 %write16sram($7EF360, $0000) ; Rupees %writeroom($109, $0002) ...end ;----------------------------- ..beetle_colosseum %write8($7EF343, $02) ; Bombs %write8($7EF36D, $08) ; Health %writeroom($008, $0001) %writeroom($009, $0003) %writeroom($00A, $000F) %writeroom($01A, $000F) %writeroom($01B, $0002) %writeroom($02B, $000A) ...end ;----------------------------- ..pod_entrance %write8($7EF343, $04) ; Bombs %writeroom($02A, $000F) %writeroom($03A, $800F) %writeroom($04A, $200F) ...end ;----------------------------- ..death_hole %write8($7EF343, $06) ; Bombs %write8($7EF36F, $00) ; Keys ...end ;----------------------------- ..trudge_to_catwalk %write8($7EF343, $04) ; Bombs %write8($7EF34F, $01) ; Bottles %write8($7EF36D, $18) ; Health %writeroom($00A, $800F) %writeroom($0FA, $000F) ...end ;----------------------------- ..sewers_to_throne_room %write8($7EF36D, $10) ; Health %writeroom($00F, $0004) %writeroom($010, $000A) %writeroom($020, $000A) %writeroom($030, $000A) %writeroom($0FB, $000F) %writeroom($0FC, $000C) %writeroom($0FD, $000F) %writeroom($0FE, $000F) %writeroom($0FF, $000B) ...end ;----------------------------- ..reload_enemies %writeroom($041, $000F) %writeroom($051, $000F) ...end ;----------------------------- ..east_hall_yba %write8($7EF343, $03) ; Bombs %write8($7EF36D, $08) ; Health %writeroom($001, $000C) %writeroom($052, $000F) ...end ;----------------------------- ..vitreous %write8($7EF35C, $02) ; Bottle 1 %write8($7EF36D, $10) ; Health %writeroom($062, $000F) %writeroom($063, $0002) %writeroom($070, $0005) %writeroom($071, $000C) %writeroom($072, $000C) %writeroom($073, $0008) %writeroom($080, $000F) ...end ;=================================================================================================== presetend_defeatvitreous: print "defeatvitreous size: $", hex(presetend_defeatvitreous-presetheader_defeatvitreous)
29.826087
100
0.453571
83851a24b1c7197dea0257e2d7799875cda84289
5,129
asm
Assembly
engine/battle/ai/move.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
engine/battle/ai/move.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
engine/battle/ai/move.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
AIChooseMove: ; Score each move in wEnemyMonMoves starting from wBuffer1. Lower is better. ; Pick the move with the lowest score. ; Wildmons attack at random. ld a, [wBattleMode] dec a ret z ld a, [wLinkMode] and a ret nz ; No use picking a move if there's no choice. farcall CheckEnemyLockedIn ret nz ; The default score is 20. Unusable moves are given a score of 80. ld a, 20 ld hl, wBuffer1 ld [hli], a ld [hli], a ld [hli], a ld [hl], a ; Don't pick disabled moves. ld a, [wEnemyDisabledMove] and a jr z, .CheckTaunt ld hl, wEnemyMonMoves ld c, 0 .CheckDisabledMove: cp [hl] jr z, .ScoreDisabledMove inc c inc hl jr .CheckDisabledMove .ScoreDisabledMove: ld hl, wBuffer1 ld b, 0 add hl, bc ld [hl], 80 ; Don't pick taunted moves .CheckTaunt ld a, [wEnemySubStatus6] bit SUBSTATUS_TAUNT, a jr z, .CheckTorment ld hl, wEnemyMonMoves ld c, 0 .CheckTauntMove: ld a, c cp 4 jr z, .CheckTorment ld a, [hli] and a jr z, .CheckTorment inc c call IsStatusMove jr nc, .CheckTauntMove .ScoreTauntedMove: push hl ld hl, wBuffer1 ld b, 0 dec c add hl, bc inc c ld [hl], 80 pop hl inc c jr .CheckTauntMove .CheckTorment ld a, [wEnemySubStatus5] bit SUBSTATUS_TORMENT, a jr z, .CheckImprison ld hl, wEnemyMonMoves ld c, 0 .CheckTormentMove: ld a, c cp 4 jr z, .CheckImprison ld a, [hli] and a jr z, .CheckImprison ld b, a ld a, [wLastEnemyCounterMove] inc c cp b jr nz, .CheckTormentMove .ScoreTormentMove: push hl ld hl, wBuffer1 ld b, 0 dec c add hl, bc inc c ld [hl], 80 pop hl inc c jr .CheckTormentMove .CheckImprison ld a, [wPlayerSubStatus2] bit SUBSTATUS_IMPRISON, a jr z, .CheckPP ld hl, wEnemyMonMoves ld c, 0 .CheckImprisonMove: ld a, c cp 4 jr z, .CheckPP ld a, [hli] and a jr z, .CheckPP inc c call CheckEnemyMoveImprisoned jr nc, .CheckImprisonMove .ScoreImprisonMove: push hl ld hl, wBuffer1 ld b, 0 dec c add hl, bc inc c ld [hl], 80 pop hl inc c jr .CheckImprisonMove ; Don't pick moves with 0 PP. .CheckPP: ld hl, wBuffer1 - 1 ld de, wEnemyMonPP ld b, 0 .CheckMovePP: inc b ld a, b cp wEnemyMonMovesEnd - wEnemyMonMoves + 1 jr z, .ApplyLayers inc hl ld a, [de] inc de and PP_MASK jr nz, .CheckMovePP ld [hl], 80 jr .CheckMovePP ; Apply AI scoring layers depending on the trainer class. .ApplyLayers: ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS ; If we have a battle in BattleTower just load the Attributes of the first trainer class in wTrainerClass (Falkner) ; so we have always the same AI, regardless of the loaded class of trainer ld a, [wInBattleTowerBattle] bit 0, a jr nz, .battle_tower_skip ld a, [wTrainerClass] dec a ld bc, 7 ; Trainer2AI - Trainer1AI call AddNTimes .battle_tower_skip lb bc, CHECK_FLAG, 0 push bc push hl .CheckLayer: pop hl pop bc ld a, c cp 16 ; up to 16 scoring layers jr z, .DecrementScores push bc ld d, BANK(TrainerClassAttributes) predef SmallFarFlagAction ld d, c pop bc inc c push bc push hl ld a, d and a jr z, .CheckLayer ld hl, AIScoringPointers dec c ld b, 0 add hl, bc add hl, bc ld a, [hli] ld h, [hl] ld l, a ld a, BANK(AIScoring) call FarCall_hl jr .CheckLayer ; Decrement the scores of all moves one by one until one reaches 0. .DecrementScores: ld hl, wBuffer1 ld de, wEnemyMonMoves ld c, wEnemyMonMovesEnd - wEnemyMonMoves .DecrementNextScore: ; If the enemy has no moves, this will infinite. ld a, [de] inc de and a jr z, .DecrementScores ; We are done whenever a score reaches 0 dec [hl] jr z, .PickLowestScoreMoves ; If we just decremented the fourth move's score, go back to the first move inc hl dec c jr z, .DecrementScores jr .DecrementNextScore ; In order to avoid bias towards the moves located first in memory, increment the scores ; that were decremented one more time than the rest (in case there was a tie). ; This means that the minimum score will be 1. .PickLowestScoreMoves: ld a, c .move_loop inc [hl] dec hl inc a cp NUM_MOVES + 1 jr nz, .move_loop ld hl, wBuffer1 ld de, wEnemyMonMoves ld c, NUM_MOVES ; Give a score of 0 to a blank move .loop2 ld a, [de] and a jr nz, .skip_load ld [hl], a ; Disregard the move if its score is not 1 .skip_load ld a, [hl] dec a jr z, .keep xor a ld [hli], a jr .after_toss .keep ld a, [de] ld [hli], a .after_toss inc de dec c jr nz, .loop2 ; Randomly choose one of the moves with a score of 1 .ChooseMove: ld hl, wBuffer1 call Random maskbits NUM_MOVES ld c, a ld b, 0 add hl, bc ld a, [hl] and a jr z, .ChooseMove ld [wCurEnemyMove], a ld a, c ld [wCurEnemyMoveNum], a ret AIScoringPointers: ; entries correspond to AI_* constants dw AI_Basic dw AI_Setup dw AI_Types dw AI_Offensive dw AI_Smart dw AI_Opportunist dw AI_Aggressive dw AI_Cautious dw AI_Status dw AI_Risky dw AI_None dw AI_None dw AI_None dw AI_None dw AI_None dw AI_None CheckEnemyMoveImprisoned: push hl push bc ld b, a ld c, 4 ld hl, wBattleMonMoves .loop ld a, [hli] cp b jr z, .hit dec c jr nz, .loop pop bc pop hl and a ret .hit pop bc pop hl scf ret
15.356287
116
0.702671
880f3368b888b4485c80f9d99ffb2fb7458d850d
2,287
asm
Assembly
programs/oeis/268/A268945.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/268/A268945.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/268/A268945.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A268945: Number of length-4 0..n arrays with no repeated value unequal to the previous repeated value plus one mod n+1. ; 10,63,220,565,1206,2275,3928,6345,9730,14311,20340,28093,37870,49995,64816,82705,104058,129295,158860,193221,232870,278323,330120,388825,455026,529335,612388,704845,807390,920731,1045600,1182753,1332970,1497055,1675836,1870165,2080918,2308995,2555320,2820841,3106530,3413383,3742420,4094685,4471246,4873195,5301648,5757745,6242650,6757551,7303660,7882213,8494470,9141715,9825256,10546425,11306578,12107095,12949380,13834861,14764990,15741243,16765120,17838145,18961866,20137855,21367708,22653045,23995510,25396771,26858520,28382473,29970370,31623975,33345076,35135485,36997038,38931595,40941040,43027281,45192250,47437903,49766220,52179205,54678886,57267315,59946568,62718745,65585970,68550391,71614180,74779533,78048670,81423835,84907296,88501345,92208298,96030495,99970300,104030101,108212310,112519363,116953720,121517865,126214306,131045575,136014228,141122845,146374030,151770411,157314640,163009393,168857370,174861295,181023916,187348005,193836358,200491795,207317160,214315321,221489170,228841623,236375620,244094125,252000126,260096635,268386688,276873345,285559690,294448831,303543900,312848053,322364470,332096355,342046936,352219465,362617218,373243495,384101620,395194941,406526830,418100683,429919920,441987985,454308346,466884495,479719948,492818245,506182950,519817651,533725960,547911513,562377970,577129015,592168356,607499725,623126878,639053595,655283680,671820961,688669290,705832543,723314620,741119445,759250966,777713155,796510008,815645545,835123810,854948871,875124820,895655773,916545870,937799275,959420176,981412785,1003781338,1026530095,1049663340,1073185381,1097100550,1121413203,1146127720,1171248505,1196779986,1222726615,1249092868,1275883245,1303102270,1330754491,1358844480,1387376833,1416356170,1445787135,1475674396,1506022645,1536836598,1568120995,1599880600,1632120201,1664844610,1698058663,1731767220,1765975165,1800687406,1835908875,1871644528,1907899345,1944678330,1981986511 mov $5,$0 add $0,2 mov $2,$0 mov $3,$0 lpb $3,1 lpb $2,1 sub $2,1 add $4,$0 lpe add $2,$4 add $2,$4 sub $4,3 lpb $2,1 sub $2,2 trn $3,$4 add $6,$4 lpe lpe mov $1,$6 lpb $5,1 add $1,3 sub $5,1 lpe add $1,6
81.678571
1,920
0.837341
004c2ab0be0626fc1f84e8929f319f9f10a571f1
146
asm
Assembly
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/k-select.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/k-select.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/k-select.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: k-select.asm Type: file Size: 34164 Last-Modified: '1992-06-30T06:23:15Z' SHA-1: 0C1590DFD82CF5FF3D167FD49F987CE7B939DD13 Description: null
20.857143
47
0.808219
f3b4d1e436a5acee5ca5c8f1a70446a20c4d3eae
524
asm
Assembly
oeis/168/A168221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/168/A168221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/168/A168221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A168221: a(n) = A006368(A006368(n)). ; Submitted by Simon Strandgaard ; 0,1,2,3,9,6,7,4,18,5,11,12,27,15,16,8,36,10,20,21,45,24,25,13,54,14,29,30,63,33,34,17,72,19,38,39,81,42,43,22,90,23,47,48,99,51,52,26,108,28,56,57,117,60,61,31,126,32,65,66,135,69,70,35,144,37,74,75,153,78,79,40,162,41,83,84,171,87,88,44,180,46,92,93,189,96,97,49,198,50,101,102,207,105,106,53,216,55,110,111 mov $2,8 lpb $2 seq $0,6368 ; The "amusical permutation" of the nonnegative numbers: a(2n)=3n, a(4n+1)=3n+1, a(4n-1)=3n-1. div $2,6 lpe
52.4
310
0.666031
dcd1e92c5fc90579ec8950f7862229aa72982e4e
591
asm
Assembly
a/assembler_6502.asm
zackarhino/hello-world
808b9fc845263d48e0df6062f21fd1e396e618a1
[ "MIT" ]
3
2016-04-03T03:41:18.000Z
2016-04-18T20:29:10.000Z
a/assembler_6502.asm
zackarhino/hello-world
808b9fc845263d48e0df6062f21fd1e396e618a1
[ "MIT" ]
6
2019-01-27T06:06:31.000Z
2019-02-22T04:30:12.000Z
a/assembler_6502.asm
zackarhino/hello-world
808b9fc845263d48e0df6062f21fd1e396e618a1
[ "MIT" ]
1
2020-02-06T14:05:28.000Z
2020-02-06T14:05:28.000Z
; goodbyeworld.s for C= 8-bit machines, ca65 assembler format. ; String printing limited to strings of 256 characters or less. a_cr = $0d ; Carriage return. bsout = $ffd2 ; KERNAL ROM, output a character to current device. .code ldx #0 ; Starting index 0 in X register. printnext: lda text,x ; Get character from string. beq done ; If we read a 0 we're done. jsr bsout ; Output character. inx ; Increment index to next character. bne printnext ; Repeat if index doesn't overflow to 0. done: rts ; Return from subroutine. .rodata text: .byte "Hello world!", a_cr, 0
25.695652
66
0.707276
2b7156482d0d9059785e149007a965c91c280cb4
566
asm
Assembly
oeis/270/A270302.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/270/A270302.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/270/A270302.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A270302: Numbers which are representable as a sum of seventeen but no fewer consecutive nonnegative integers. ; Submitted by Christian Krause ; 272,544,1088,2176,4352,4624,5168,6256,7888,8432,8704,9248,10064,10336,11152,11696,12512,12784,14416,15776,16048,16592,16864,17408,18224,18496,19312,19856,20128,20672,21488,22304,22576,23392,24208,25024,25568,26384,27472 mov $2,1 lpb $0 lpb $3 add $2,1 mov $4,$1 mul $1,13 gcd $4,$2 cmp $4,1 cmp $4,0 sub $3,$4 lpe sub $0,1 mov $1,1155 add $2,1 add $3,22 lpe mov $0,$2 mul $0,272
24.608696
221
0.689046
41d61bd7b63e86bc766cdb033823ee5aba7e6b78
659
asm
Assembly
oeis/289/A289900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/289/A289900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/289/A289900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A289900: Number of maximal matchings in the n-triangular honeycomb rook graph. ; Submitted by Jon Maiga ; 1,1,3,9,135,2025,212625,22325625,21097715625,19937341265625,207248662456171875,2154349846231906640625,291128066470548703880859375,39341591262497599098939931640625,79746389028864195813528714933837890625,161647924221233446518918043388762750244140625,5570294521107277357810167397301815834831695556640625,191949146278007141065657627664767125124195200656890869140625,125674686989639308313312532827647389922973583845525551128387451171875 add $0,1 mov $1,1 mov $2,1 lpb $0 sub $0,2 add $2,2 mov $3,$2 pow $2,$0 mul $1,$2 mov $2,$3 lpe mov $0,$1
38.764706
433
0.840668
ab56f74a0aa81e550940444c0ed2ed5177b52c19
1,613
asm
Assembly
_build/dispatcher/jmp_ippsGFpECSetPointHashBackCompatible_rmf_d4f25f5b.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
1
2021-10-04T10:21:54.000Z
2021-10-04T10:21:54.000Z
_build/dispatcher/jmp_ippsGFpECSetPointHashBackCompatible_rmf_d4f25f5b.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
_build/dispatcher/jmp_ippsGFpECSetPointHashBackCompatible_rmf_d4f25f5b.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
extern m7_ippsGFpECSetPointHashBackCompatible_rmf:function extern n8_ippsGFpECSetPointHashBackCompatible_rmf:function extern y8_ippsGFpECSetPointHashBackCompatible_rmf:function extern e9_ippsGFpECSetPointHashBackCompatible_rmf:function extern l9_ippsGFpECSetPointHashBackCompatible_rmf:function extern n0_ippsGFpECSetPointHashBackCompatible_rmf:function extern k0_ippsGFpECSetPointHashBackCompatible_rmf:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsGFpECSetPointHashBackCompatible_rmf .Larraddr_ippsGFpECSetPointHashBackCompatible_rmf: dq m7_ippsGFpECSetPointHashBackCompatible_rmf dq n8_ippsGFpECSetPointHashBackCompatible_rmf dq y8_ippsGFpECSetPointHashBackCompatible_rmf dq e9_ippsGFpECSetPointHashBackCompatible_rmf dq l9_ippsGFpECSetPointHashBackCompatible_rmf dq n0_ippsGFpECSetPointHashBackCompatible_rmf dq k0_ippsGFpECSetPointHashBackCompatible_rmf segment .text global ippsGFpECSetPointHashBackCompatible_rmf:function (ippsGFpECSetPointHashBackCompatible_rmf.LEndippsGFpECSetPointHashBackCompatible_rmf - ippsGFpECSetPointHashBackCompatible_rmf) .Lin_ippsGFpECSetPointHashBackCompatible_rmf: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsGFpECSetPointHashBackCompatible_rmf: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsGFpECSetPointHashBackCompatible_rmf] mov r11, qword [r11+rax*8] jmp r11 .LEndippsGFpECSetPointHashBackCompatible_rmf:
41.358974
183
0.863608
280d1e110855930d03232ef9c5a06454923679de
711
asm
Assembly
programs/oeis/245/A245288.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/245/A245288.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/245/A245288.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A245288: a(n) = (4*n^2 - 2*n - 1 + (2*n^2 - 2*n + 1)*(-1)^n)/16. ; 0,0,1,1,5,3,12,6,22,10,35,15,51,21,70,28,92,36,117,45,145,55,176,66,210,78,247,91,287,105,330,120,376,136,425,153,477,171,532,190,590,210,651,231,715,253,782,276,852,300,925,325,1001,351,1080,378,1162,406,1247,435,1335,465,1426,496,1520,528,1617,561,1717,595,1820,630,1926,666,2035,703,2147,741,2262,780,2380,820,2501,861,2625,903,2752,946,2882,990,3015,1035,3151,1081,3290,1128,3432,1176,3577,1225 mov $4,2 mov $6,$0 lpb $4 mov $0,$6 mov $2,0 sub $4,1 add $0,$4 sub $0,1 mov $5,0 lpb $0 sub $0,1 add $2,$0 sub $0,1 add $5,$2 lpe mov $3,$4 mul $3,$5 add $1,$3 lpe min $6,1 mul $6,$5 sub $1,$6 mov $0,$1
26.333333
400
0.609001
da5f02ce085047bf4b3b1aaf5f0c3476d2284a6f
532
asm
Assembly
programs/oeis/293/A293006.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/293/A293006.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/293/A293006.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A293006: Expansion of 2*x^2*(x+1) / (2*x^3-3*x+1). ; 0,0,2,8,24,68,188,516,1412,3860,10548,28820,78740,215124,587732,1605716,4386900,11985236,32744276,89459028,244406612,667731284,1824275796,4984014164,13616579924,37201188180,101635536212,277673448788,758617970004,2072582837588,5662401615188,15469968905556,42264741041492,115469419894100,315468321871188,861875483530580,2354687610803540,6433126188668244 mov $3,3 lpb $0 sub $0,1 add $2,4 add $4,$3 mul $3,2 trn $4,$2 mov $1,$4 mov $2,$4 add $3,$4 mov $4,0 lpe
33.25
353
0.75188
f1797169d7c5b1c47239eb55c9d35cf12fa1fc06
247
asm
Assembly
Mid-Term/Solution/N5/5.asm
TasneemMahmud1731893642/CSE331
3732592389ecc602fa9aea7434c885968b5fb1fd
[ "MIT" ]
null
null
null
Mid-Term/Solution/N5/5.asm
TasneemMahmud1731893642/CSE331
3732592389ecc602fa9aea7434c885968b5fb1fd
[ "MIT" ]
null
null
null
Mid-Term/Solution/N5/5.asm
TasneemMahmud1731893642/CSE331
3732592389ecc602fa9aea7434c885968b5fb1fd
[ "MIT" ]
null
null
null
; You may customize this and other start-up templates; ; The location of this template is c:\emu8086\inc\0_com_template.txt org 100h A DB 1,2,3,4,5,6,7,8,9,10 B DB 10 DUP(0) MOV AH,4CH INT 21H CODE ENDS END START ret
10.73913
68
0.651822
7141f382258336f38acf69935733a65ab92bfa75
2,597
asm
Assembly
kernel/a20.asm
jpbottaro/minios
7fb159438f5ab5d19cdf35ef6d99f12ed4f2a09d
[ "MIT" ]
2
2016-12-06T23:45:43.000Z
2018-10-12T10:47:11.000Z
kernel/a20.asm
jpbottaro/minios
7fb159438f5ab5d19cdf35ef6d99f12ed4f2a09d
[ "MIT" ]
null
null
null
kernel/a20.asm
jpbottaro/minios
7fb159438f5ab5d19cdf35ef6d99f12ed4f2a09d
[ "MIT" ]
null
null
null
BITS 16 %include "macrosmodoreal.mac" section .text habilitando: db 'Habilitando A20........' habilitando_len equ $ - habilitando deshabilitando: db 'Desabilitando A20......' deshabilitando_len equ $ - deshabilitando checkeando: db 'Checkeando A20.........' checkeando_len equ $ - checkeando mensajeOK: db 'OK!' mensajeOK_len equ $ - mensajeOK mensajeFAIL: db 'FALLO!' mensajeFAIL_len equ $ - mensajeFAIL disable_A20: pushf pusha ;IMPRIMIR_MODO_REAL deshabilitando, deshabilitando_len, 0x07, 0, 0 call a20wait mov al,0xAD out 0x64,al call a20wait mov al,0xD0 out 0x64,al call a20wait2 in al,0x60 push ax call a20wait mov al,0xD1 out 0x64,al call a20wait pop ax and al,0xFD ; disabling out 0x60,al call a20wait mov al,0xAE out 0x64,al call a20wait ;IMPRIMIR_MODO_REAL mensajeOK, mensajeOK_len, 0x0A, 0xFFFF, 23 popa popf ret enable_A20: pushf pusha ;IMPRIMIR_MODO_REAL habilitando, habilitando_len, 0x07, 0, 0 call a20wait mov al,0xAD out 0x64,al call a20wait mov al,0xD0 out 0x64,al call a20wait2 in al,0x60 push ax call a20wait mov al,0xD1 out 0x64,al call a20wait pop ax or al,2 out 0x60,al call a20wait mov al,0xAE out 0x64,al call a20wait ;IMPRIMIR_MODO_REAL mensajeOK, mensajeOK_len, 0x0A, 0xFFFF, 23 popa popf ret a20wait: in al,0x64 test al,2 jnz a20wait ret a20wait2: in al,0x64 test al,1 jz a20wait2 ret check_A20: pushf push fs push gs push di push si ;IMPRIMIR_MODO_REAL checkeando, checkeando_len, 0x07, 0, 0 xor ax, ax ; ax = 0 mov fs, ax not ax ; ax = 0xFFFF mov gs, ax mov di, 0x0500 mov si, 0x0510 mov al, byte [fs:di] push ax mov al, byte [gs:si] push ax mov byte [fs:di], 0x00 mov byte [gs:si], 0xFF cmp byte [fs:di], 0xFF je .fail ;IMPRIMIR_MODO_REAL mensajeOK, mensajeOK_len, 0x0A, 0xFFFF, 23 jmp .ok .fail: ;IMPRIMIR_MODO_REAL mensajeFAIL, mensajeFAIL_len, 0x0C, 0xFFFF, 23 .ok: pop ax mov byte [gs:si], al pop ax mov byte [fs:di], al mov ax, 0 je check_a20__exit mov ax, 1 check_a20__exit: pop si pop di pop gs pop fs popf ret
19.526316
70
0.571429
790e3d9142c8112f4a1d7ad0529fddad3b3d9916
601
asm
Assembly
oeis/083/A083318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/083/A083318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/083/A083318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A083318: a(0) = 1; for n>0, a(n) = 2^n + 1. ; 1,3,5,9,17,33,65,129,257,513,1025,2049,4097,8193,16385,32769,65537,131073,262145,524289,1048577,2097153,4194305,8388609,16777217,33554433,67108865,134217729,268435457,536870913,1073741825,2147483649,4294967297,8589934593,17179869185,34359738369,68719476737,137438953473,274877906945,549755813889,1099511627777,2199023255553,4398046511105,8796093022209,17592186044417,35184372088833,70368744177665,140737488355329,281474976710657,562949953421313,1125899906842625,2251799813685249,4503599627370497 mov $1,2 pow $1,$0 div $1,2 mul $1,2 add $1,1 mov $0,$1
60.1
497
0.8203
d6de2de9d3d1190d9af68d167bd77b1339d8db82
171
asm
Assembly
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_getHCount.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_getHCount.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_getHCount.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; unsigned char SMS_getHCount(void) SECTION code_clib SECTION code_SMSlib PUBLIC _SMS_getHCount EXTERN asm_SMSlib_getHCount defc _SMS_getHCount = asm_SMSlib_getHCount
15.545455
42
0.859649
d5f5fb862980e4badc4dc030181f370d53a49a26
760
asm
Assembly
oeis/278/A278670.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/278/A278670.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/278/A278670.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A278670: Number of n X 2 0..1 arrays with rows in nondecreasing lexicographic order and columns in nonincreasing lexicographic order, but with exactly one mistake. ; Submitted by Jamie Morken(s2.) ; 1,8,33,99,245,532,1050,1926,3333,5500,8723,13377,19929,28952,41140,57324,78489,105792,140581,184415,239085,306636,389390,489970,611325,756756,929943,1134973,1376369,1659120,1988712,2371160,2813041,3321528,3904425,4570203,5328037,6187844,7160322,8256990,9490229,10873324,12420507,14147001,16069065,18204040,20570396,23187780,26077065,29260400,32761261,36604503,40816413,45424764,50458870,55949642,61929645,68433156,75496223,83156725,91454433,100431072,110130384,120598192,131882465,144033384 sub $1,$0 bin $1,4 mov $2,$0 add $2,6 bin $2,6 add $1,$2 mov $0,$1
63.333333
492
0.813158
da6c7876a5cd5d0c0dbb590a24a7208026c78020
520
asm
Assembly
oeis/033/A033980.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/033/A033980.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/033/A033980.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A033980: Trajectory of 1 under map n->49n+1 if n odd, n->n/2 if n even ; Submitted by Jon Maiga ; 1,50,25,1226,613,30038,15019,735932,367966,183983,9015168,4507584,2253792,1126896,563448,281724,140862,70431,3451120,1725560,862780,431390,215695,10569056,5284528,2642264 add $0,1 mov $1,$0 mov $0,3 lpb $1 mov $2,$0 mod $2,2 add $3,1 sub $3,$2 mov $4,$0 lpb $2 mul $0,7 add $0,1 mul $0,7 sub $0,4 sub $2,1 lpe lpb $3 div $0,2 sub $3,1 lpe sub $1,1 lpe mov $0,$4 div $0,3
17.931034
172
0.623077
764b542158fd44eee72b4cb84bf7865522bb3f70
2,401
asm
Assembly
dino/lcs/123p/10A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
dino/lcs/123p/10A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
dino/lcs/123p/10A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 004D94 move.l D1, (A1)+ 004D96 dbra D0, $4d94 004DB2 move.b #$33, ($10a,A0) [123p+ 24] 004DB8 lea (A0), A3 [123p+10A] 0154EE cmpi.b #$a, ($10a,A6) 0154F4 bhi $15506 [123p+10A] 01597C move.b ($10a,A6), D0 015980 moveq #$0, D1 [123p+10A] 015A30 move.b ($10a,A6), D0 015A34 subq.b #2, D0 [123p+10A] 015A4C subq.b #1, ($10a,A6) 015A50 bra $15a2e [123p+10A] 015A70 cmpi.b #$32, ($10a,A6) 015A76 bgt $15a7c [123p+10A] 015A78 addq.b #1, ($10a,A6) 015A7C movea.l (A1)+, A2 [123p+10A] 015A8A cmpi.b #$32, ($10a,A6) 015A90 bgt $15a96 [123p+10A] 015A92 addq.b #1, ($10a,A6) 015A96 rts [123p+10A] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
63.184211
350
0.649729
564ba40d234ac76f82e3bfa8572f3b5550f6c6f4
1,658
asm
Assembly
0x08.asm
0xdea/xorpd-solutions
f6b13d8f4c3a66c75599404707e0c30a180d9df0
[ "MIT" ]
53
2017-09-06T02:37:25.000Z
2022-03-10T05:17:06.000Z
0x08.asm
uf0o/xorpd-solutions
3a84172f615533ffbd40124594db6d36baa6260a
[ "MIT" ]
2
2019-04-03T12:51:42.000Z
2020-12-10T13:58:14.000Z
0x08.asm
uf0o/xorpd-solutions
3a84172f615533ffbd40124594db6d36baa6260a
[ "MIT" ]
21
2017-09-06T02:37:33.000Z
2022-03-10T05:17:09.000Z
; ; $Id: 0x08.asm,v 1.1.1.1 2016/03/27 08:40:12 raptor Exp $ ; ; 0x08 explanation - from xchg rax,rax by xorpd@xorpd.net ; Copyright (c) 2016 Marco Ivaldi <raptor@0xdeadbeef.info> ; ; For positive values of rax and rdx, this snippet performs ; an Euclidean (integer) division by two of the sum of the ; rax and rdx registers. In C: ; ; rax = rax + rdx; ; rax = (int)rax / 2; ; ; In other words, it computes the average of two positive ; numbers. ; ; This also works when both rax and rdx have a negative ; value, because of the clever use of the rcr instruction ; (right rotate with carry) that uses the carry flag (cf): ; it shifts cf into the most-significant bit and shifts ; the least-significant bit into cf. When one of the input ; values is positive and the other is negative and their ; sum is also negative, however, we get another result: ; ; $ ./rappel ; > mov rax,1 ; > mov rdx,-2 ; rax: 0x0000000000000001 rbx: 0x0000000000000000 ; rcx: 0x0000000000000000 rdx: 0xfffffffffffffffe ; > add rax,rdx ; rax: 0xffffffffffffffff rbx: 0x0000000000000000 ; rcx: 0x0000000000000000 rdx: 0xfffffffffffffffe ; flags: 0x0000000000000286 [cf:0, zf:0, of:0, sf:1, pf:0, af:0] ; > rcr rax,1 ; rax: 0x7fffffffffffffff rbx: 0x0000000000000000 ; rcx: 0x0000000000000000 rdx: 0xfffffffffffffffe ; flags: 0x0000000000000a87 [cf:1, zf:0, of:0, sf:1, pf:0, af:0] ; ; For this reason, this explanation might be incomplete. ; ; This analysis was facilitated by the assembly REPL rappel ; by yrp604@yahoo.com: ; ; https://github.com/yrp604/rappel/ ; BITS 64 SECTION .text global main main: add rax,rdx ; rax = rax + rdx rcr rax,1 ; right rotate with carry
30.703704
64
0.721954
ab05aa3564370641420df6150eab4e71493bbb0d
299
asm
Assembly
oeis/131/A131901.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/131/A131901.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/131/A131901.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A131901: 2*A002024 - A131821. ; Submitted by Jon Maiga ; 1,2,2,3,5,3,4,7,7,4,5,9,9,9,5,6,11,11,11,11,6,7,13,13,13,13,13,7,8,15,15,15,15,15,15,8,9,17,17,17,17,17,17,17,9,10,19,19,19,19,19,19,19,19,10 lpb $0 add $2,1 sub $0,$2 lpe add $0,$2 lpb $0 mul $2,2 gcd $0,$2 lpe mov $0,$2 add $0,1
18.6875
143
0.591973
25e8494ab06a7dd80a17e40051c548d0012da1ec
162
asm
Assembly
TurtleTools/Examples/count_up.asm
foxostro/TurtleTTL
7d2163b11b91ae04ad69d38c0354194b9c306ed0
[ "MIT" ]
1
2021-08-18T22:30:11.000Z
2021-08-18T22:30:11.000Z
TurtleTools/Examples/old/count_up.asm
foxostro/Turtle16
67e6d2afa02f2bc07711f8e8d756e5b891ea8df5
[ "MIT" ]
null
null
null
TurtleTools/Examples/old/count_up.asm
foxostro/Turtle16
67e6d2afa02f2bc07711f8e8d756e5b891ea8df5
[ "MIT" ]
null
null
null
LI D, 0xaa LI A, 0 LXY beginning beginning: LI B, 1 ADD U # We ned to discard the result of the first one. ADD A LI B, 255 CMP CMP NOP JNE NOP NOP LI D, 0xff HLT
9.529412
54
0.703704
cea87d9df008f832cfc91c2cf21c85a19d02bd8f
1,960
asm
Assembly
bootloader/loader/memory.asm
ETroll/TrollOS
eb313717d2f8efc5e3756d14e7dffbdd487ca37b
[ "MIT" ]
10
2015-07-19T22:52:06.000Z
2022-01-09T23:41:26.000Z
bootloader/loader/memory.asm
ETroll/TrollOS
eb313717d2f8efc5e3756d14e7dffbdd487ca37b
[ "MIT" ]
12
2016-12-16T12:25:10.000Z
2020-06-26T07:48:13.000Z
bootloader/loader/memory.asm
ETroll/TrollOS
eb313717d2f8efc5e3756d14e7dffbdd487ca37b
[ "MIT" ]
null
null
null
%ifndef __memory_asm %define __memory_asm bits 16 struc MemoryMapEntry .baseAddress resq 1 .length resq 1 .type resd 1 .acpi_null resd 1 endstruc ; Returns memory size for >64M configuations ; return: ax - KB between 1MB and 16MB ; bx - Number of 64K blocks above 16MB ; On error: bx - 0 ; ax - -1 BIOS_MEMORY_GET_64: push ecx push edx xor ecx, ecx xor edx, edx mov ax, 0xe801 int 0x15 jc .error cmp ah, 0x86 ;unsupported function je .error cmp ah, 0x80 ;invalid command je .error jcxz .use_ax ;bios may have stored it in ax,bx or cx,dx. test if cx is 0 mov ax, cx ;its not, so it should contain mem size; store it mov bx, dx .use_ax: pop edx ;mem size is in ax and bx already, return it pop ecx ret .error: mov ax, -1 mov bx, 0 pop edx pop ecx ret ; Creates and stores a memory map structure at given address ; ES:DI Buffer pointer (Where to store the map, eg the sruct) ; return: bp - number of entries... BIOS_MEMORY_CREATE_MAP: pushad xor ebx, ebx xor bp, bp mov edx, 'PAMS' ; 'SMAP', remember.. little endian.. mov eax, 0xe820 mov ecx, 24 int 0x15 jc .error cmp eax, 'PAMS' jne .error test ebx, ebx je .error jmp .start .next_entry: mov edx, 'PAMS' mov ecx, 24 mov eax, 0xe820 int 0x15 .start: jcxz .skip_entry .notext: mov ecx, [es:di + MemoryMapEntry.length] test ecx, ecx jne short .good_entry mov ecx, [es:di + MemoryMapEntry.length + 4] jecxz .skip_entry .good_entry: inc bp add di, 24 .skip_entry: cmp ebx, 0 jne .next_entry jmp .done .error: stc .done: popad ret %endif
18.666667
83
0.553061
e221aebbb9e64962a1e6472b7f8e806ecb556eb6
880
asm
Assembly
programs/oeis/117/A117818.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/117/A117818.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/117/A117818.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A117818: a(n) = n if n is 1 or a prime, otherwise a(n) = n divided by the least prime factor of n (A032742(n)). ; Coded manually 2021-03-01 by Simon Strandgaard, https://github.com/neoneye ; 1,2,3,2,5,3,7,4,3,5,11,6,13,7,5,8,17,9,19,10,7,11,23,12,5,13,9,14,29,15,31,16,11,17,7,18,37,19,13,20,41,21,43,22,15,23,47,24,7,25,17,26,53,27,11,28,19,29,59,30,61,31,21,32,13,33,67,34,23,35,71,36,73,37,25,38 mov $1,$0 cal $1,20639 ; $1 contains A020639 ; Data A: 1,2,3,2,5,2,7,2,3,2 add $0,1 div $0,$1 ; Check $0 divide by A020639($0) ; Data B: 1,1,1,2,1,3,1,4,3,5,1 mov $2,$0 cmp $2,1 ; $2: If n divide by A020639(n) then 1 else 0 ; Mask A: 1,1,1,0,1,0,1,0,0,0 mov $3,1 sub $3,$2 ; $3 contains the inverted $2 ; Mask B: 0,0,0,1,0,1,0,1,1,1 ; Combine the 2 datasets mul $1,$2 ; Data A * Mask A, 1,2,3,0,5,0,7,0,0,0 mul $0,$3 ; Data B * Mask B, 0,0,0,2,0,3,0,4,3,5 add $1,$0
30.344828
209
0.607955
ec88085e6b11adde99775a8bc387cea31748794c
4,942
asm
Assembly
audio/music/vermilioncity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
audio/music/vermilioncity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
audio/music/vermilioncity.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
Music_VermilionCity: musicheader 3, 1, Music_VermilionCity_Ch1 musicheader 1, 2, Music_VermilionCity_Ch2 musicheader 1, 3, Music_VermilionCity_Ch3 db $3 Music_VermilionCity_Ch1: stereopanning $f tempo 176 volume $77 dutycycle $2 notetype $c, $65 octave 4 note B_, 4 note G#, 4 note F#, 4 note E_, 4 note D_, 4 octave 3 note B_, 4 note A_, 2 note B_, 1 octave 4 note D_, 1 note E_, 1 note G#, 1 note B_, 1 octave 5 note D_, 1 vibrato $10, $23 Music_VermilionCity_branch_eb6a0: dutycycle $1 notetype $c, $85 callchannel Music_VermilionCity_branch_eb6f9 note F_, 4 octave 4 note D_, 4 note C#, 4 note E_, 4 callchannel Music_VermilionCity_branch_eb6f9 callchannel Music_VermilionCity_branch_eb701 dutycycle $2 notetype $c, $85 callchannel Music_VermilionCity_branch_eb6f9 note F_, 4 octave 4 note D_, 4 note E_, 1 note C#, 1 octave 3 note A_, 1 note E_, 1 octave 4 note C#, 1 octave 3 note A_, 1 note E_, 1 note C_, 1 callchannel Music_VermilionCity_branch_eb6f9 callchannel Music_VermilionCity_branch_eb701 intensity $93 dutycycle $0 note __, 2 note F#, 2 note __, 2 note F#, 2 note __, 2 note F#, 2 note __, 2 note F#, 2 callchannel Music_VermilionCity_branch_eb70c callchannel Music_VermilionCity_branch_eb70c intensity $87 dutycycle $2 octave 4 note D_, 8 octave 3 note G#, 8 note E_, 8 note B_, 8 note A_, 4 note G#, 4 note F#, 4 note E_, 4 octave 2 note B_, 4 note G#, 4 note B_, 4 octave 3 note D_, 4 loopchannel 0, Music_VermilionCity_branch_eb6a0 Music_VermilionCity_branch_eb6f9: octave 3 note C#, 4 note E_, 4 note F#, 2 note A_, 2 note E_, 2 note G#, 2 endchannel Music_VermilionCity_branch_eb701: note D_, 2 note F_, 2 note A_, 2 octave 4 note D_, 2 note E_, 2 note C#, 2 octave 3 note A_, 2 note E_, 2 endchannel Music_VermilionCity_branch_eb70c: note __, 2 note F#, 2 note A_, 2 note F#, 2 octave 4 note D_, 2 octave 3 note F#, 2 note A_, 2 note F#, 2 note __, 2 note G#, 2 note B_, 2 note G#, 2 octave 4 note E_, 2 octave 3 note G#, 2 note B_, 2 note G#, 2 endchannel Music_VermilionCity_Ch2: stereopanning $ff dutycycle $3 notetype $c, $77 vibrato $10, $23 octave 5 note E_, 4 note D_, 4 octave 4 note B_, 4 note G#, 4 note F#, 4 note E_, 4 note F#, 4 note G#, 4 Music_VermilionCity_branch_eb735: notetype $c, $97 callchannel Music_VermilionCity_branch_eb768 note G#, 2 callchannel Music_VermilionCity_branch_eb768 note E_, 2 intensity $b7 octave 3 note B_, 4 octave 4 note C#, 4 note D_, 4 note E_, 4 callchannel Music_VermilionCity_branch_eb77e callchannel Music_VermilionCity_branch_eb77e note F#, 6 note E_, 1 note F#, 1 note E_, 8 note A_, 6 note G#, 1 note A_, 1 note G#, 8 note G#, 14 notetype $6, $57 note __, 1 octave 4 note E_, 1 note G#, 1 note B_, 1 notetype $c, $87 octave 5 note E_, 16 loopchannel 0, Music_VermilionCity_branch_eb735 Music_VermilionCity_branch_eb768: octave 1 note A_, 8 octave 2 note F#, 4 note E_, 4 note D_, 6 note C#, 1 note D_, 1 note E_, 8 octave 1 note A_, 8 octave 2 note F#, 4 note E_, 4 note D_, 6 note E_, 1 note D_, 1 note C#, 2 note E_, 2 octave 1 note A_, 2 endchannel Music_VermilionCity_branch_eb77e: note F#, 8 note B_, 8 note A_, 4 note G#, 4 note F#, 4 note E_, 4 endchannel Music_VermilionCity_Ch3: stereopanning $f0 vibrato $22, $23 notetype $c, $25 octave 2 note E_, 4 note B_, 4 octave 3 note E_, 4 note B_, 4 note D_, 4 note E_, 4 note D_, 2 octave 3 note B_, 1 note G#, 1 note F#, 1 note E_, 1 note D_, 1 octave 2 note B_, 1 Music_VermilionCity_branch_eb79e: notetype $c, $22 callchannel Music_VermilionCity_branch_eb7de octave 5 note A_, 6 intensity $24 note E_, 1 note G#, 1 callchannel Music_VermilionCity_branch_eb7de note A_, 8 intensity $14 octave 3 note D_, 4 note C#, 4 octave 2 note B_, 4 note A_, 4 octave 3 note D_, 2 note __, 4 note D_, 1 note D_, 1 callchannel Music_VermilionCity_branch_eb7f5 octave 4 note D_, 2 octave 3 note D_, 2 note __, 2 note D_, 2 callchannel Music_VermilionCity_branch_eb7f5 intensity $25 octave 3 note E_, 8 octave 4 note E_, 8 octave 3 note B_, 8 octave 4 note E_, 8 octave 2 note E_, 16 octave 3 note E_, 14 intensity $22 octave 5 note E_, 1 note G#, 1 loopchannel 0, Music_VermilionCity_branch_eb79e Music_VermilionCity_branch_eb7de: octave 5 note A_, 8 octave 6 note D_, 4 note C#, 4 octave 5 note B_, 6 note A_, 1 note B_, 1 octave 6 note C#, 8 octave 5 note A_, 8 octave 6 note D_, 4 note C#, 4 octave 5 note B_, 6 octave 6 note C#, 1 octave 5 note B_, 1 endchannel Music_VermilionCity_branch_eb7f5: note A_, 1 note __, 1 note A_, 2 note __, 2 note F#, 2 note E_, 2 note __, 4 note E_, 1 note E_, 1 octave 4 note E_, 1 note __, 1 note D_, 2 note __, 2 octave 3 note B_, 1 octave 4 note C#, 1 endchannel
14.621302
48
0.698098
75a0522acb89b47ce0ee06282bb121aeb8a3f6c9
511
asm
Assembly
src/test/ref/npe-problem-0.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/ref/npe-problem-0.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/ref/npe-problem-0.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Commodore 64 PRG executable file .file [name="npe-problem-0.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .label SCREEN = $400 .segment Code main: { // SCREEN[0] = *bram_base++ lda bram sta SCREEN // SCREEN[1] = *bram_base++ lda bram+1 sta SCREEN+1 // } rts } .segment Data bram: .fill $64, 0
22.217391
64
0.649706
5a4032fc0980c0c6cf8c8f9491cf666f9310f4eb
25,828
asm
Assembly
Source/HBIOS/ppp.asm
vipoo/RomWBW
e463959fee431da2de3da962bd70cb0c556ffaed
[ "DOC", "MIT" ]
null
null
null
Source/HBIOS/ppp.asm
vipoo/RomWBW
e463959fee431da2de3da962bd70cb0c556ffaed
[ "DOC", "MIT" ]
null
null
null
Source/HBIOS/ppp.asm
vipoo/RomWBW
e463959fee431da2de3da962bd70cb0c556ffaed
[ "DOC", "MIT" ]
null
null
null
; ;================================================================================================== ; PARPORTPROP DRIVER ;================================================================================================== ; ; TODO: ; 1) ADD SUPPORT FOR DSKY ; PPP_IO .EQU PPIBASE + 0 ; PPP DATA I/O (PPI PORT A) PPP_CTL .EQU PPIBASE + 2 ; PPP CTL LINES (PPI PORT C) PPP_PPICTL .EQU PPIBASE + 3 ; PPI CONTROL PORT ; ; COMMAND BYTES ; PPP_CMDNOP .EQU $00 ; DO NOTHING PPP_CMDECHOBYTE .EQU $01 ; RECEIVE A BYTE, INVERT IT, SEND IT BACK PPP_CMDECHOBUF .EQU $02 ; RECEIVE 512 BYTE BUFFER, SEND IT BACK ; PPP_CMDDSKRES .EQU $10 ; RESTART SD CARD SUPPORT PPP_CMDDSKSTAT .EQU $11 ; SEND LAST SD CARD STATUS (4 BYTES) PPP_CMDDSKPUT .EQU $12 ; PPI -> SECTOR BUFFER -> PPP PPP_CMDDSKGET .EQU $13 ; PPP -> SECTOR BUFFER -> PPI PPP_CMDDSKRD .EQU $14 ; READ SCTOR FROM SD CARD INTO PPP BUFFER, RETURN 1 BYTE STATUS PPP_CMDDSKWR .EQU $15 ; WRITE SECTOR TO SD CARD FROM PPP BUFFER, RETURN 1 BYTE STATUS PPP_CMDDSKTYPE .EQU $16 ; GET SD CARD TYPE PPP_CMDDSKCAP .EQU $17 ; GET CURRENT DISK CAPACITY PPP_CMDDSKCSD .EQU $18 ; GET CURRENT SD CARD CSD REGISTER ; PPP_CMDVIDOUT .EQU $20 ; WRITE A BYTE TO THE TERMINAL EMULATOR ; PPP_CMDKBDSTAT .EQU $30 ; RETURN A BYTE WITH NUMBER OF CHARACTERS IN BUFFER PPP_CMDKBDRD .EQU $31 ; RETURN A CHARACTER, WAIT IF NECESSARY ; PPP_CMDSPKTONE .EQU $40 ; EMIT SPEAKER TONE AT SPECIFIED FREQUENCY AND DURATION ; PPP_CMDSIOINIT .EQU $50 ; RESET SERIAL PORT AND ESTABLISH A NEW BAUD RATE (4 BYTE BAUD RATE) PPP_CMDSIORX .EQU $51 ; RECEIVE A BYTE IN FROM SERIAL PORT PPP_CMDSIOTX .EQU $52 ; TRANSMIT A BYTE OUT OF THE SERIAL PORT PPP_CMDSIORXST .EQU $53 ; SERIAL PORT RECEIVE STATUS (RETURNS # BYTES OF RX BUFFER USED) PPP_CMDSIOTXST .EQU $54 ; SERIAL PORT TRANSMIT STATUS (RETURNS # BYTES OF TX BUFFER SPACE AVAILABLE) PPP_CMDSIORXFL .EQU $55 ; SERIAL PORT RECEIVE BUFFER FLUSH PPP_CMDSIOTXFL .EQU $56 ; SERIAL PORT TRANSMIT BUFFER FLUSH (NOT IMPLEMENTED) ; PPP_CMDRESET .EQU $F0 ; SOFT RESET PROPELLER PPP_CMDVER .EQU $F1 ; SEND FIRMWARE VERSION ; ; GLOBAL PARPORTPROP INITIALIZATION ; PPP_INIT: CALL NEWLINE ; FORMATTING PRTS("PPP: IO=0x$") LD A,PPIBASE CALL PRTHEXBYTE ; CALL PPP_INITPPP ; INIT PPP BOARD RET NZ ; BAIL OUT ON ERROR ; CALL PPP_DETECT ; DETECT PPP PRESENCE ;CALL PC_SPACE ; *DEBUG* ;CALL PRTHEXWORD ; *DEBUG* LD DE,PPP_STR_NOHW ; PREPARE FOR NOT PRESENT JP NZ,WRITESTR ; BAIL OUT WITH NZ IF NOT DETECTED ; CALL PPP_GETVER ; GET F/W VERSION RET NZ ; ABORT ON FAILURE ; ; PRINT FIRMWARE VERSION PRTS(" F/W=$") LD HL,PPP_FWVER CALL LD32 LD A,D CALL PRTDECB CALL PC_PERIOD LD A,E CALL PRTDECB CALL PC_PERIOD CALL PRTDEC ; ; CHECK F/W VERSION & NOTIFY USER IF UPGRADE REQUIRED LD HL,PPP_FWVER CALL LD32 XOR A CP D JR NZ,PPP_INIT1 CP E JR NZ,PPP_INIT1 LD DE,PPP_STR_UPGRADE CALL WRITESTR ; PPP_INIT1: CALL PPPCON_INIT ; CONSOLE INITIALIZATION CALL PPPSD_INIT ; SD CARD INITIALIZATION ; RET ; ; ; PPP_INITPPP: ; SETUP PARALLEL PORT (8255) LD A,%11000010 ; PPI MODE 2 (BI HANDSHAKE), PC0-2 OUT, PB IN OUT (PPP_PPICTL),A ; NOTE: ALL OUTPUTS SET TO LOGIC ZERO ON MODE CHANGE CALL DELAY ; PROBABLY NOT NEEDED ; RESET PROPELLER LD A,%00000101 ; SET PC2 (ASSERT PROP RESET LINE) OUT (PPP_PPICTL),A CALL DELAY ; PROBABLY NOT NEEDED IN A,(PPP_IO) ; CLEAR GARBAGE??? CALL DELAY ; PROBABLY NOT NEEDED LD A,%00000001 ; SET PC0 (CMD FLAG) OUT (PPP_PPICTL),A ; DO IT LD A,PPP_CMDRESET ; RESET COMMAND CALL PPP_PUTBYTE ; SEND IT CALL DELAY ; DELAY FOR PPP TO PROCESS COMMAND LD A,%00000000 ; CLEAR PC0 (CMD FLAG) OUT (PPP_PPICTL),A ; DO IT LD A,%00000100 ; CLEAR PC2 (DEASSERT PROP RESET LINE) OUT (PPP_PPICTL),A ; DO IT ;CALL DELAY ; PROBABLY NOT NEEDED LD DE,1024 ; ONE SECOND CALL VDELAY ; ... DELAY XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_DETECT: LD BC,4096 ; TRY FOR ABOUT 4 SECONDS PPP_DETECT1: LD DE,64 ; 1 MS CALL VDELAY IN A,(PPP_CTL) BIT 5,A JR Z,PPP_DETECT2 IN A,(PPP_IO) ;CALL PC_SPACE ;CALL PRTHEXBYTE CP $AA RET Z ; RETURN IF MATCH ; PPP_DETECT2: DEC BC LD A,B OR C JR NZ,PPP_DETECT1 OR $FF ; SIGNAL FAILURE RET ; ; ; PPP_GETVER: #IF (PPPSDTRACE >= 3) CALL PPP_PRTPREFIX PRTS(" VER$") #ENDIF LD D,PPP_CMDVER ; COMMAND = GET VERSION CALL PPP_SNDCMD ; SEND COMMAND RET NZ LD B,4 ; GET 4 BYTES LD HL,PPP_FWVER PPP_GETVER1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPP_GETVER1 ; #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD HL,PPP_FWVER CALL LD32 CALL PRTHEX32 #ENDIF ; XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_SNDCMD: IN A,(PPP_IO) ; DISCARD ANYTHING PENDING ; WAIT FOR OBF HIGH (OUTPUT BUFFER TO BE EMPTY) IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD LD A,%00000001 ; SET CMD FLAG OUT (PPP_PPICTL),A ; SEND IT PPP_SNDCMD0: IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD0 LD A,D OUT (PPP_IO),A PPP_SNDCMD1: ; WAIT FOR OBF HIGH (BYTE HAS BEEN RECEIVED) IN A,(PPP_CTL) BIT 7,A JR Z,PPP_SNDCMD1 ; TURN OFF CMD LD A,%00000000 ; CLEAR CMD FLAG OUT (PPP_PPICTL),A XOR A ; SIGNAL SUCCESS RET ; ; ; PPP_PUTBYTE: PUSH AF PPP_PUTBYTE1: IN A,(PPP_CTL) BIT 7,A JR Z,PPP_PUTBYTE1 POP AF OUT (PPP_IO),A RET ; ; ; PPP_GETBYTE: IN A,(PPP_CTL) BIT 5,A JR Z,PPP_GETBYTE IN A,(PPP_IO) RET ; ; PRINT DIAGNONSTIC PREFIX ; PPP_PRTPREFIX: CALL NEWLINE PRTS("PPP:$") RET ; ; ; PPP_STR_NOHW .TEXT " NOT PRESENT$" PPP_STR_UPGRADE .TEXT " !!!UPGRADE REQUIRED!!!$" ; PPP_FWVER .DB $00, $00, $00, $00 ; MMNNBBB (M=MAJOR, N=MINOR, B=BUILD) ; ;================================================================================================== ; PARPORTPROP CONSOLE DRIVER ;================================================================================================== ; PPPCON_ROWS .EQU 37 ; PROPELLER VGA DISPLAY ROWS (40 - 3 STATUS LINES) PPPCON_COLS .EQU 80 ; PROPELLER VGA DISPLAY COLS ; PPPCON_INIT: CALL NEWLINE PRTS("PPPCON:$") ; ; DISPLAY CONSOLE DIMENSIONS CALL PC_SPACE LD A,PPPCON_COLS CALL PRTDECB LD A,'X' CALL COUT LD A,PPPCON_ROWS CALL PRTDECB CALL PRTSTRD .TEXT " TEXT (ANSI)$" ; ; ADD OURSELVES TO CIO DISPATCH TABLE ; LD D,0 ; PHYSICAL UNIT IS ZERO LD E,CIODEV_PPPCON ; DEVICE TYPE LD BC,PPPCON_FNTBL ; BC := FUNCTION TABLE ADDRESS CALL CIO_ADDENT ; ADD ENTRY, A := UNIT ASSIGNED LD (HCB + HCB_CRTDEV),A ; SET OURSELVES AS THE CRT DEVICE ; XOR A RET ; ; DRIVER FUNCTION TABLE ; PPPCON_FNTBL: .DW PPPCON_IN .DW PPPCON_OUT .DW PPPCON_IST .DW PPPCON_OST .DW PPPCON_INITDEV .DW PPPCON_QUERY .DW PPPCON_DEVICE #IF (($ - PPPCON_FNTBL) != (CIO_FNCNT * 2)) .ECHO "*** INVALID PPPCON FUNCTION TABLE ***\n" #ENDIF ; ; CHARACTER INPUT ; WAIT FOR A CHARACTER AND RETURN IT IN E ; PPPCON_IN: CALL PPPCON_IST ; CHECK FOR CHAR PENDING JR Z,PPPCON_IN ; WAIT FOR IT IF NECESSARY LD D,PPP_CMDKBDRD ; CMD = KEYBOARD READ CALL PPP_SNDCMD ; SEND COMMAND CALL PPP_GETBYTE ; GET CHARACTER READ LD E,A ; PUT IN E XOR A ; CLEAR A (SUCCESS) RET ; AND RETURN ; ; CHARACTER INPUT STATUS ; RETURN STATUS IN A, 0 = NOTHING PENDING, > 0 CHAR PENDING ; PPPCON_IST: LD D,PPP_CMDKBDSTAT ; CMD = KEYBOARD STATUS CALL PPP_SNDCMD ; SEND COMMAND CALL PPP_GETBYTE ; GET RESPONSE OR A ; SET FLAGS RET NZ ; A <> 0, CHAR(S) PENDING JP CIO_IDLE ; OTHERWISE RET VIA IDLE PROCESSING ; ; CHARACTER OUTPUT ; WRITE CHARACTER IN E ; PPPCON_OUT: CALL PPPCON_OST ; CHECK FOR OUTPUT READY JR Z,PPPCON_OUT ; WAIT IF NECESSARY LD D,PPP_CMDVIDOUT ; CMD = VIDEO OUTPUT CALL PPP_SNDCMD ; SEND COMMAND LD A,E ; MOVE TO A CALL PPP_PUTBYTE ; SEND IT RET ; RETURN ; ; CHARACTER OUTPUT STATUS ; RETURN STATUS IN A, 0 = NOT READY, > 0 READY TO SEND ; CONSOLE IS ALWAYS READY TO SEND (SYNCHRONOUS OUTPUT) ; PPPCON_OST: XOR A ; SET A=$01 TO SIGNAL READY INC A RET ; ; ; PPPCON_INITDEV: CALL SYSCHK LD A,ERR_NOTIMPL OR A RET ; ; ; PPPCON_QUERY: LD DE,0 LD HL,0 XOR A RET ; ; ; PPPCON_DEVICE: LD D,CIODEV_PPPCON ; D := DEVICE TYPE LD E,0 ; E := DEVICE NUM, ALWAYS 0 LD C,$BF ; C := DEVICE TYPE, 0xBF IS PROP TERM LD H,0 ; H := 0, DRIVER HAS NO MODES LD L,PPIBASE ; L := BASE I/O ADDRESS XOR A ; SIGNAL SUCCESS RET ; ;================================================================================================== ; PARPORTPROP SD CARD DRIVER ;================================================================================================== ; ; SD CARD TYPE ; PPPSD_TYPEUNK .EQU 0 ; CARD TYPE UNKNOWN/UNDETERMINED PPPSD_TYPEMMC .EQU 1 ; MULTIMEDIA CARD (MMC STANDARD) PPPSD_TYPESDSC .EQU 2 ; SDSC CARD (V1) PPPSD_TYPESDHC .EQU 3 ; SDHC CARD (V2) PPPSD_TYPESDXC .EQU 4 ; SDXC CARD (V3) ; ; SD CARD STATUS (PPPSD_STAT) ; PPPSD_STOK .EQU 0 ; OK PPPSD_STINVUNIT .EQU -1 ; INVALID UNIT PPPSD_STRDYTO .EQU -2 ; TIMEOUT WAITING FOR CARD TO BE READY PPPSD_STINITTO .EQU -3 ; INITIALIZATOIN TIMEOUT PPPSD_STCMDTO .EQU -4 ; TIMEOUT WAITING FOR COMMAND RESPONSE PPPSD_STCMDERR .EQU -5 ; COMMAND ERROR OCCURRED (REF SD_RC) PPPSD_STDATAERR .EQU -6 ; DATA ERROR OCCURRED (REF SD_TOK) PPPSD_STDATATO .EQU -7 ; DATA TRANSFER TIMEOUT PPPSD_STCRCERR .EQU -8 ; CRC ERROR ON RECEIVED DATA PACKET PPPSD_STNOMEDIA .EQU -9 ; NO MEDIA IN CONNECTOR PPPSD_STWRTPROT .EQU -10 ; ATTEMPT TO WRITE TO WRITE PROTECTED MEDIA ; ; PPPSD DEVICE CONFIGURATION ; PPPSD_DEVCNT .EQU 1 ; ONE DEVICE SUPPORTED PPPSD_CFGSIZ .EQU 12 ; SIZE OF CFG TBL ENTRIES ; ; PER DEVICE DATA OFFSETS ; PPPSD_DEV .EQU 0 ; OFFSET OF DEVICE NUMBER (BYTE) PPPSD_STAT .EQU 1 ; LAST STATUS (BYTE) PPPSD_TYPE .EQU 2 ; DEVICE TYPE (BYTE) PPPSD_FLAGS .EQU 3 ; FLAG BITS BIT 0=CF, 1=LBA (BYTE) PPPSD_MEDCAP .EQU 4 ; MEDIA CAPACITY (DWORD) PPPSD_LBA .EQU 8 ; OFFSET OF LBA (DWORD) ; PPPSD_CFGTBL: ; DEVICE 0 .DB 0 ; DRIVER DEVICE NUMBER .DB 0 ; DEVICE STATUS .DB 0 ; DEVICE TYPE .DB 0 ; FLAGS BYTE .DW 0,0 ; DEVICE CAPACITY .DW 0,0 ; CURRENT LBA ; #IF ($ - PPPSD_CFGTBL) != (PPPSD_DEVCNT * PPPSD_CFGSIZ) .ECHO "*** INVALID PPPSD CONFIG TABLE ***\n" #ENDIF ; .DB $FF ; END MARKER ; ; SD CARD INITIALIZATION ; PPPSD_INIT: ; ; SETUP THE DISPATCH TABLE ENTRIES ; LD B,PPPSD_DEVCNT ; LOOP CONTROL LD IY,PPPSD_CFGTBL ; START OF CFG TABLE PPPSD_INIT0: PUSH BC ; SAVE LOOP CONTROL LD BC,PPPSD_FNTBL ; BC := FUNC TABLE ADR PUSH IY ; CFG ENTRY POINTER POP DE ; COPY TO DE CALL DIO_ADDENT ; ADD ENTRY, BC IS NOT DESTROYED LD BC,PPPSD_CFGSIZ ; SIZE OF CFG ENTRY ADD IY,BC ; BUMP IY TO NEXT ENTRY POP BC ; RESTORE BC DJNZ PPPSD_INIT0 ; LOOP AS NEEDED ; ; INITIALIZE INDIVIDUAL UNIT(S) AND DISPLAY DEVICE INVENTORY LD B,PPPSD_DEVCNT ; INIT LOOP COUNTER TO DEVICE COUNT LD IY,PPPSD_CFGTBL ; START OF CFG TABLE PPPSD_INIT1: PUSH BC ; SAVE LOOP COUNTER/INDEX CALL PPPSD_INITUNIT ; INITIALIZE IT #IF (PPPSDTRACE < 2) CALL NZ,PPPSD_PRTSTAT ; IF ERROR, SHOW IT #ENDIF LD BC,PPPSD_CFGSIZ ; SIZE OF CFG ENTRY ADD IY,BC ; BUMP IY TO NEXT ENTRY POP BC ; RESTORE LOOP CONTROL DJNZ PPPSD_INIT1 ; DECREMENT LOOP COUNTER AND LOOP AS NEEDED ; RET ; DONE ; ; ; PPPSD_INITUNIT: ; REINITIALIZE THE CARD HERE CALL PPPSD_INITCARD RET NZ ; CALL PPPSD_PRTPREFIX ; ; PRINT CARD TYPE PRTS(" TYPE=$") CALL PPPSD_PRTTYPE ; ; PRINT STORAGE CAPACITY (BLOCK COUNT) PRTS(" BLOCKS=0x$") ; PRINT FIELD LABEL LD A,PPPSD_MEDCAP ; OFFSET TO CAPACITY FIELD CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 ; GET THE CAPACITY VALUE CALL PRTHEX32 ; PRINT HEX VALUE ; ; PRINT STORAGE SIZE IN MB PRTS(" SIZE=$") ; PRINT FIELD LABEL LD B,11 ; 11 BIT SHIFT TO CONVERT BLOCKS --> MB CALL SRL32 ; RIGHT SHIFT CALL PRTDEC ; PRINT LOW WORD IN DECIMAL (HIGH WORD DISCARDED) PRTS("MB$") ; PRINT SUFFIX ; XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_FNTBL: .DW PPPSD_STATUS .DW PPPSD_RESET .DW PPPSD_SEEK .DW PPPSD_READ .DW PPPSD_WRITE .DW PPPSD_VERIFY .DW PPPSD_FORMAT .DW PPPSD_DEVICE .DW PPPSD_MEDIA .DW PPPSD_DEFMED .DW PPPSD_CAP .DW PPPSD_GEOM #IF (($ - PPPSD_FNTBL) != (DIO_FNCNT * 2)) .ECHO "*** INVALID PPPSD FUNCTION TABLE ***\n" #ENDIF ; PPPSD_VERIFY: PPPSD_FORMAT: PPPSD_DEFMED: CALL SYSCHK ; INVALID SUB-FUNCTION LD A,ERR_NOTIMPL OR A RET ; ; ; PPPSD_READ: CALL HB_DSKREAD ; HOOK HBIOS DISK READ SUPERVISOR LD BC,PPPSD_RDSEC ; GET ADR OF SECTOR READ FUNC LD (PPPSD_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC JR PPPSD_IO ; CONTINUE TO GENERIC IO ROUTINE ; ; ; PPPSD_WRITE: CALL HB_DSKWRITE ; HOOK HBIOS DISK WRITE SUPERVISOR LD BC,PPPSD_WRSEC ; GET ADR OF SECTOR READ FUNC LD (PPPSD_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC JR PPPSD_IO ; CONTINUE TO GENERIC IO ROUTINE ; ; ; PPPSD_IO: LD (PPPSD_DSKBUF),HL ; SAVE DISK BUFFER ADDRESS LD A,E ; BLOCK COUNT TO A OR A ; SET FLAGS RET Z ; ZERO SECTOR I/O, RETURN W/ E=0 & A=0 LD B,A ; INIT SECTOR DOWNCOUNTER LD C,0 ; INIT SECTOR R/W COUNTER #IF (PPPSDTRACE == 1) LD HL,PPPSD_PRTERR ; SET UP PPPSD_PRTERR PUSH HL ; ... TO FILTER ALL EXITS #ENDIF PUSH BC ; SAVE COUNTERS CALL PPPSD_CHKCARD ; CHECK / REINIT CARD AS NEEDED POP BC ; RESTORE COUNTERS JR NZ,PPPSD_IO3 ; BAIL OUT ON ERROR PPPSD_IO1: PUSH BC ; SAVE COUNTERS #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX #ENDIF LD HL,(PPPSD_IOFNADR) ; GET PENDING IO FUNCTION ADDRESS CALL JPHL ; ... AND CALL IT JR NZ,PPPSD_IO2 ; BAIL OUT ON ERROR ; INCREMENT LBA LD A,PPPSD_LBA ; LBA OFFSET CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL INC32HL ; INCREMENT THE VALUE ; INCREMENT DMA LD HL,PPPSD_DSKBUF+1 ; POINT TO MSB OF BUFFER ADR INC (HL) ; BUMP DMA BY INC (HL) ; ... 512 BYTES XOR A ; SIGNAL SUCCESS PPPSD_IO2: POP BC ; RECOVER COUNTERS JR NZ,PPPSD_IO3 ; IF ERROR PENDING, BAIL OUT INC C ; BUMP COUNT OF SECTORS READ DJNZ PPPSD_IO1 ; LOOP AS NEEDED PPPSD_IO3: LD E,C ; SECTOR READ COUNT TO E LD HL,(PPPSD_DSKBUF) ; CURRENT BUF ADR TO HL OR A ; SET FLAGS BASED ON RETURN CODE RET Z ; RETURN IF SUCCESS LD A,ERR_IO ; SIGNAL IO ERROR OR A ; SET FLAGS RET ; AND DONE ; ; ; PPPSD_RDSEC: ; #IF (PPPSDTRACE >= 3) PRTS(" READ$") #ENDIF LD D,PPP_CMDDSKRD ; READ COMMAND CALL PPP_SNDCMD ; ... AND SEND COMMAND RET NZ ; BAIL OUT ON ERROR CALL PPPSD_SENDBLK ; SEND THE LBA BLOCK NUMBER CALL PPP_GETBYTE ; GET READ RESULT LD (PPPSD_DSKSTAT),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A ; SET FLAGS JR Z,PPPSD_RDSEC1 ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE JP PPPSD_ERRCMD ; RETURN VIA ERROR HANDLER PPPSD_RDSEC1: ; GET THE SECTOR DATA LD D,PPP_CMDDSKGET ; COMMAND = DSKGET CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; BAIL OUT ON ERROR ; READ THE SECTOR DATA LD BC,512 LD HL,(PPPSD_DSKBUF) PPPSD_RDSEC2: CALL PPP_GETBYTE LD (HL),A INC HL DEC BC LD A,B OR C JP NZ,PPPSD_RDSEC2 XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_WRSEC: ; #IF (PPPSDTRACE >= 3) PRTS(" WRITE$") #ENDIF ; PUT THE SECTOR DATA LD D,PPP_CMDDSKPUT ; COMMAND = DSKPUT CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; SEND OVER THE SECTOR CONTENTS LD BC,512 LD HL,(PPPSD_DSKBUF) PPPSD_WRSEC1: LD A,(HL) INC HL CALL PPP_PUTBYTE DEC BC LD A,B OR C JP NZ,PPPSD_WRSEC1 ; WRITE THE SECTOR LD D,PPP_CMDDSKWR ; COMMAND = DSKWR CALL PPP_SNDCMD RET NZ CALL PPPSD_SENDBLK ; SEND THE LBA BLOCK NUMBER CALL PPP_GETBYTE LD (PPPSD_DSKSTAT),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A ; SET FLAGS RET Z ; DONE IF NO ERRORS ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE JP PPPSD_ERRCMD ; EXIT VIA ERROR HANDLER ; ; REPORT SD CARD READY STATE ; PPPSD_STATUS: LD A,(IY+PPPSD_STAT) ; GET THE CURRENT READY STATUS OR A RET ; ; ; PPPSD_RESET: XOR A ; ALWAYS OK RET ; ; ; PPPSD_DEVICE: LD D,DIODEV_PPPSD ; D := DEVICE TYPE LD E,(IY+PPPSD_DEV) ; E := PHYSICAL DEVICE NUMBER LD C,%01010000 ; C := ATTRIBUTES, REMOVABLE, SD CARD LD H,0 ; H := 0, DRIVER HAS NO MODES LD L,PPIBASE ; L := BASE I/O ADDRESS XOR A ; SIGNAL SUCCESS RET ; ; SETUP FOR SUBSEQUENT ACCESS ; INIT CARD IF NOT READY OR ON DRIVE LOG IN ; PPPSD_MEDIA: ; REINITIALIZE THE CARD HERE TO DETERMINE PRESENCE CALL PPPSD_INITCARD #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTERR ; PRINT ANY ERRORS #ENDIF LD E,MID_HD ; ASSUME WE ARE OK RET Z ; RETURN IF GOOD INIT LD E,MID_NONE ; SIGNAL NO MEDA LD A,ERR_NOMEDIA ; NO MEDIA ERROR OR A ; SET FLAGS RET ; AND RETURN ; ; ; PPPSD_SEEK: BIT 7,D ; CHECK FOR LBA FLAG CALL Z,HB_CHS2LBA ; CLEAR MEANS CHS, CONVERT TO LBA RES 7,D ; CLEAR FLAG REGARDLESS (DOES NO HARM IF ALREADY LBA) LD (IY+PPPSD_LBA+0),L ; SAVE NEW LBA LD (IY+PPPSD_LBA+1),H ; ... LD (IY+PPPSD_LBA+2),E ; ... LD (IY+PPPSD_LBA+3),D ; ... XOR A ; SIGNAL SUCCESS RET ; AND RETURN ; ; ; PPPSD_CAP: LD A,PPPSD_MEDCAP ; OFFSET TO CAPACITY FIELD CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 ; GET THE CURRENT CAPACITY INTO DE:HL LD BC,512 ; 512 BYTES PER BLOCK LD A,(IY+PPPSD_STAT) ; GET CURRENT STATUS OR A ; SET FLAGS RET ; ; ; PPPSD_GEOM: ; FOR LBA, WE SIMULATE CHS ACCESS USING 16 HEADS AND 16 SECTORS ; RETURN HS:CC -> DE:HL, SET HIGH BIT OF D TO INDICATE LBA CAPABLE CALL PPPSD_CAP ; GET TOTAL BLOCKS IN DE:HL, BLOCK SIZE TO BC LD L,H ; DIVIDE BY 256 FOR # TRACKS LD H,E ; ... HIGH BYTE DISCARDED, RESULT IN HL LD D,16 | $80 ; HEADS / CYL = 16, SET LBA CAPABILITY BIT LD E,16 ; SECTORS / TRACK = 16 RET ; DONE, A STILL HAS PPPSD_CAP STATUS ; ; REINITIALIZE THE SD CARD ; PPPSD_INITCARD: ;; CLEAR ALL STATUS DATA ;LD HL,PPPSD_UNITDATA ;LD BC,PPPSD_UNITDATALEN ;XOR A ;CALL FILL ; ; RESET INTERFACE, RETURN WITH NZ ON FAILURE #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" RESET$") #ENDIF ; RESET & STATUS DISK LD D,PPP_CMDDSKRES ; COMMAND = DSKRESET CALL PPP_SNDCMD RET NZ CALL PPP_GETBYTE ; GET STATUS LD (PPPSD_DSKSTAT),A ; SAVE STATUS #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF OR A JR Z,PPPSD_INITCARD1 ; HANDLE ERROR CALL PPPSD_GETDSKSTAT ; GET FULL ERROR CODE ;JP PPPSD_ERRCMD ; HANDLE ERRORS JP PPPSD_NOMEDIA ; RETURN W/ NO MEDIA ERROR PPPSD_INITCARD1: #IF (PPPSDTRACE >= 3) ; GET CSD IF DEBUGGING CALL PPPSD_GETCSD RET NZ #ENDIF ; GET CARD TYPE CALL PPPSD_GETTYPE RET NZ ; GET CAPACITY CALL PPPSD_GETCAP RET NZ RET ; ; CHECK THE SD CARD, ATTEMPT TO REINITIALIZE IF NEEDED ; PPPSD_CHKCARD: LD A,(IY+PPPSD_STAT) ; GET STATUS OR A ; SET FLAGS RET Z ; IF ALL GOOD, DONE JP PPPSD_INITCARD ; OTHERWISE, REINIT ; ; ; PPPSD_GETDSKSTAT: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" STAT$") #ENDIF LD D,PPP_CMDDSKSTAT ; COMMAND = GET DISK STATUS CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD B,4 ; GET 4 BYTES LD HL,PPPSD_ERRCODE ; TO ERROR CODE PPPSD_GETDSKSTAT1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETDSKSTAT1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD HL,PPPSD_ERRCODE CALL LD32 CALL PRTHEX32 #ENDIF XOR A RET ; ; ; PPPSD_GETTYPE: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" TYPE$") #ENDIF LD D,PPP_CMDDSKTYPE ; COMMAND = GET DISK TYPE CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR CALL PPP_GETBYTE ; GET DISK TYPE VALUE LD (IY+PPPSD_TYPE),A ; SAVE IT #IF (PPPSDTRACE >= 3) CALL PC_SPACE CALL PRTHEXBYTE #ENDIF XOR A ; SIGNAL SUCCESS RET ; ; ; PPPSD_GETCAP: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" CAP$") #ENDIF LD D,PPP_CMDDSKCAP ; COMMAND = GET CAPACITY CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD A,PPPSD_MEDCAP ; OFFSET OF CAPACITY CALL LDHLIYA ; HL := IY + A, REG A TRASHED LD B,4 ; GET 4 BYTES PPPSD_GETCAP1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETCAP1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD A,PPPSD_MEDCAP ; OFFSET OF CAPACITY CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 CALL PRTHEX32 #ENDIF XOR A RET ; ; ; PPPSD_GETCSD: #IF (PPPSDTRACE >= 3) CALL PPPSD_PRTPREFIX PRTS(" CSD$") #ENDIF LD D,PPP_CMDDSKCSD ; COMMAND = GET CAPACITY CALL PPP_SNDCMD ; SEND COMMAND RET NZ ; ABORT ON ERROR LD B,16 ; GET 4 BYTES LD HL,PPPSD_CSDBUF PPPSD_GETCSD1: CALL PPP_GETBYTE LD (HL),A INC HL DJNZ PPPSD_GETCSD1 #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD DE,PPPSD_CSDBUF LD A,16 CALL PRTHEXBUF #ENDIF XOR A RET ; ; SEND INDEX OF BLOCK TO READ FROM SD CARD ; 32 BIT VALUE (4 BYTES) ; NOTE THAT BYTES ARE SENT REVERSED, PROPELLER IS LITTLE ENDIAN ; PPPSD_SENDBLK: #IF (PPPSDTRACE >= 3) PRTS(" BLK$") #ENDIF #IF (PPPSDTRACE >= 3) CALL PC_SPACE LD A,PPPSD_LBA ; OFFSET OF LBA CALL LDHLIYA ; HL := IY + A, REG A TRASHED CALL LD32 CALL PRTHEX32 #ENDIF LD A,PPPSD_LBA ; OFFSET OF LBA CALL LDHLIYA ; HL := IY + A, REG A TRASHED LD B,4 PPPSD_SENDBLK1: LD A,(HL) ;CALL PC_SPACE ;CALL PRTHEXBYTE INC HL CALL PPP_PUTBYTE DJNZ PPPSD_SENDBLK1 RET ; ;============================================================================= ; ERROR HANDLING AND DIAGNOSTICS ;============================================================================= ; ; ERROR HANDLERS ; PPPSD_INVUNIT: LD A,PPPSD_STINVUNIT JR PPPSD_ERR2 ; SPECIAL CASE FOR INVALID UNIT ; PPPSD_ERRRDYTO: LD A,PPPSD_STRDYTO JR PPPSD_ERR ; PPPSD_ERRINITTO: LD A,PPPSD_STINITTO JR PPPSD_ERR ; PPPSD_ERRCMDTO: LD A,PPPSD_STCMDTO JR PPPSD_ERR ; PPPSD_ERRCMD: LD A,PPPSD_STCMDERR JR PPPSD_ERR ; PPPSD_ERRDATA: LD A,PPPSD_STDATAERR JR PPPSD_ERR ; PPPSD_ERRDATATO: LD A,PPPSD_STDATATO JR PPPSD_ERR ; PPPSD_ERRCRC: LD A,PPPSD_STCRCERR JR PPPSD_ERR ; PPPSD_NOMEDIA: LD A,PPPSD_STNOMEDIA JR PPPSD_ERR ; PPPSD_WRTPROT: LD A,PPPSD_STWRTPROT JR PPPSD_ERR2 ; DO NOT UPDATE UNIT STATUS! ; PPPSD_ERR: LD (IY+PPPSD_STAT),A ; UPDATE STATUS ; PPPSD_ERR2: #IF (PPPSDTRACE >= 2) CALL PPPSD_PRTSTAT #ENDIF OR A ; SET FLAGS RET ; ; ; PPPSD_PRTERR: RET Z ; DONE IF NO ERRORS ; FALL THRU TO PPPSD_PRTSTAT ; ; PRINT STATUS STRING ; PPPSD_PRTSTAT: PUSH AF PUSH DE PUSH HL LD A,(IY+PPPSD_STAT) OR A LD DE,PPPSD_STR_STOK JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STINVUNIT JR Z,PPPSD_PRTSTAT1 ; INVALID UNIT IS SPECIAL CASE INC A LD DE,PPPSD_STR_STRDYTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STINITTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCMDTO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCMDERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STDATAERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STDATATO JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STCRCERR JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STNOMEDIA JR Z,PPPSD_PRTSTAT1 INC A LD DE,PPPSD_STR_STWRTPROT JR Z,PPPSD_PRTSTAT1 LD DE,PPPSD_STR_STUNK PPPSD_PRTSTAT1: CALL PPPSD_PRTPREFIX ; PRINT UNIT PREFIX CALL PC_SPACE ; FORMATTING CALL WRITESTR LD A,(IY+PPPSD_STAT) CP PPPSD_STCMDERR CALL Z,PPPSD_PRTSTAT2 POP HL POP DE POP AF RET PPPSD_PRTSTAT2: CALL PC_SPACE LD A,(PPPSD_DSKSTAT) CALL PRTHEXBYTE CALL PC_SPACE JP PPPSD_PRTERRCODE RET ; ; ; PPPSD_PRTERRCODE: PUSH HL PUSH DE LD HL,PPPSD_ERRCODE CALL LD32 CALL PRTHEX32 POP DE POP HL RET ; ; PRINT DIAGNONSTIC PREFIX ; PPPSD_PRTPREFIX: PUSH AF CALL NEWLINE PRTS("PPPSD$") LD A,(IY+PPPSD_DEV) ; GET CURRENT DEVICE NUM ADD A,'0' CALL COUT CALL PC_COLON POP AF RET ; ; PRINT THE CARD TYPE ; PPPSD_PRTTYPE: LD A,(IY+PPPSD_TYPE) LD DE,PPPSD_STR_TYPEMMC CP PPPSD_TYPEMMC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDSC CP PPPSD_TYPESDSC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDHC CP PPPSD_TYPESDHC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPESDXC CP PPPSD_TYPESDXC JR Z,PPPSD_PRTTYPE1 LD DE,PPPSD_STR_TYPEUNK PPPSD_PRTTYPE1: JP WRITESTR ; ;============================================================================= ; STRING DATA ;============================================================================= ; ; PPPSD_STR_STOK .TEXT "OK$" PPPSD_STR_STINVUNIT .TEXT "INVALID UNIT$" PPPSD_STR_STRDYTO .TEXT "READY TIMEOUT$" PPPSD_STR_STINITTO .TEXT "INITIALIZATION TIMEOUT$" PPPSD_STR_STCMDTO .TEXT "COMMAND TIMEOUT$" PPPSD_STR_STCMDERR .TEXT "COMMAND ERROR$" PPPSD_STR_STDATAERR .TEXT "DATA ERROR$" PPPSD_STR_STDATATO .TEXT "DATA TIMEOUT$" PPPSD_STR_STCRCERR .TEXT "CRC ERROR$" PPPSD_STR_STNOMEDIA .TEXT "NO MEDIA$" PPPSD_STR_STWRTPROT .TEXT "WRITE PROTECTED$" PPPSD_STR_STUNK .TEXT "UNKNOWN$" ; PPPSD_STR_TYPEUNK .TEXT "UNK$" PPPSD_STR_TYPEMMC .TEXT "MMC$" PPPSD_STR_TYPESDSC .TEXT "SDSC$" PPPSD_STR_TYPESDHC .TEXT "SDHC$" PPPSD_STR_TYPESDXC .TEXT "SDXC$" ; ;============================================================================= ; DATA STORAGE ;============================================================================= ; PPPSD_IOFNADR .DW 0 ; PENDING IO FUNCTION ADDRESS ; PPPSD_DSKBUF .DW 0 ; PPPSD_DSKSTAT .DB 0 PPPSD_ERRCODE .DW 0,0 PPPSD_CSDBUF .FILL 16,0
22.227194
102
0.646275
8a94564eedb6a8da3c8b9ff4a76b37ef189ba5c4
7,172
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_251.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_251.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_251.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x58fa, %r14 nop nop nop xor %rdi, %rdi movb (%r14), %r12b nop nop nop inc %r10 lea addresses_WC_ht+0x7ec6, %rbx nop and $33842, %rcx movw $0x6162, (%rbx) nop nop nop nop xor %r10, %r10 lea addresses_WT_ht+0x134c6, %r14 nop nop nop sub $58896, %rbx mov $0x6162636465666768, %r12 movq %r12, %xmm7 movups %xmm7, (%r14) nop nop nop nop nop xor %r14, %r14 lea addresses_WC_ht+0x946, %rcx nop xor %r12, %r12 mov (%rcx), %r10d nop nop nop nop and $30393, %rdi lea addresses_A_ht+0x1792, %r12 nop nop add %rcx, %rcx mov (%r12), %r10d nop nop nop cmp %r14, %r14 lea addresses_WT_ht+0x173f6, %rsi lea addresses_WT_ht+0x1ca46, %rdi nop nop nop dec %r12 mov $101, %rcx rep movsb nop nop nop nop xor %rax, %rax lea addresses_normal_ht+0xe48d, %rbx nop nop xor %rdi, %rdi movb $0x61, (%rbx) nop nop nop nop and $25864, %r10 lea addresses_WC_ht+0x12646, %rsi lea addresses_WT_ht+0x8a6, %rdi clflush (%rdi) xor $54120, %rbx mov $95, %rcx rep movsb nop nop nop nop dec %rbx lea addresses_WT_ht+0xbc86, %rax nop nop nop nop nop inc %rdi movl $0x61626364, (%rax) nop nop cmp %r14, %r14 lea addresses_D_ht+0xc146, %rsi lea addresses_D_ht+0xf946, %rdi sub %rbx, %rbx mov $17, %rcx rep movsl nop cmp $64389, %rcx lea addresses_WT_ht+0xd77a, %rdi nop nop nop add %r12, %r12 movups (%rdi), %xmm2 vpextrq $0, %xmm2, %r10 cmp %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r15 push %rcx push %rdx // Load lea addresses_UC+0x1df39, %r10 nop nop nop nop nop add $53140, %r13 movb (%r10), %r11b nop add %r11, %r11 // Store lea addresses_WC+0x16d46, %r10 clflush (%r10) and $39539, %r14 mov $0x5152535455565758, %r15 movq %r15, (%r10) nop nop and %r15, %r15 // Faulty Load lea addresses_WC+0x17546, %r11 nop inc %rcx movups (%r11), %xmm4 vpextrq $1, %xmm4, %r14 lea oracles, %rcx and $0xff, %r14 shlq $12, %r14 mov (%rcx,%r14,1), %r14 pop %rdx pop %rcx pop %r15 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.815534
2,999
0.655605
7272afd133f6315322f03d4d8a01af458962699c
6,145
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1370.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1370.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1370.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 %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xeea8, %rsi nop nop dec %r9 vmovups (%rsi), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r13 nop nop nop and %r13, %r13 lea addresses_normal_ht+0x7858, %rsi lea addresses_WC_ht+0x19b1d, %rdi nop and %r9, %r9 mov $45, %rcx rep movsw nop nop nop nop nop xor %rcx, %rcx lea addresses_WT_ht+0x1c06a, %r12 nop nop nop inc %rdx mov (%r12), %r9d nop nop and %rdx, %rdx lea addresses_WC_ht+0x13ea8, %rdi and $56064, %r9 movw $0x6162, (%rdi) nop nop nop and $25123, %rdx lea addresses_D_ht+0x106a8, %rsi lea addresses_WC_ht+0x7ea8, %rdi nop nop inc %r11 mov $89, %rcx rep movsl nop and $53630, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %rbp push %rcx push %rdi push %rsi // REPMOV lea addresses_US+0x14728, %rsi lea addresses_UC+0x11ea8, %rdi nop nop cmp %rbp, %rbp mov $65, %rcx rep movsb nop nop dec %rsi // Store lea addresses_normal+0x146a8, %r13 sub $49599, %rbp movw $0x5152, (%r13) nop cmp $34944, %rdi // Store lea addresses_normal+0x8478, %rbp xor %rcx, %rcx movl $0x51525354, (%rbp) nop cmp $26180, %r14 // Store lea addresses_WC+0x9ba6, %r14 clflush (%r14) nop nop nop cmp $6280, %rsi movb $0x51, (%r14) nop cmp $51039, %rbp // Faulty Load lea addresses_PSE+0xe6a8, %r13 nop nop xor $2680, %r14 mov (%r13), %cx lea oracles, %rdi and $0xff, %rcx shlq $12, %rcx mov (%rdi,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_US', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
39.902597
2,999
0.656306
25baf0be088b87550280c6e74a17340c328138e9
449
asm
Assembly
programs/oeis/317/A317326.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/317/A317326.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/317/A317326.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A317326: Multiples of 26 and odd numbers interleaved. ; 0,1,26,3,52,5,78,7,104,9,130,11,156,13,182,15,208,17,234,19,260,21,286,23,312,25,338,27,364,29,390,31,416,33,442,35,468,37,494,39,520,41,546,43,572,45,598,47,624,49,650,51,676,53,702,55,728,57,754,59,780,61,806,63,832,65,858,67,884,69,910,71,936,73,962,75,988,77,1014,79,1040,81,1066,83,1092,85,1118,87,1144,89,1170,91,1196,93,1222,95,1248,97,1274,99 mov $1,$0 mod $1,2 gcd $1,13 mul $0,$1
56.125
352
0.703786
3be9bc4fd7472257399bcf3b1bf4bad816febabd
1,643
asm
Assembly
programs/oeis/224/A224039.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/224/A224039.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/224/A224039.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A224039: Number of 3 X n 0..1 arrays with antidiagonals unimodal and rows and diagonals nondecreasing. ; 8,21,37,58,85,119,161,212,273,345,429,526,637,763,905,1064,1241,1437,1653,1890,2149,2431,2737,3068,3425,3809,4221,4662,5133,5635,6169,6736,7337,7973,8645,9354,10101,10887,11713,12580,13489,14441,15437,16478,17565,18699,19881,21112,22393,23725,25109,26546,28037,29583,31185,32844,34561,36337,38173,40070,42029,44051,46137,48288,50505,52789,55141,57562,60053,62615,65249,67956,70737,73593,76525,79534,82621,85787,89033,92360,95769,99261,102837,106498,110245,114079,118001,122012,126113,130305,134589,138966,143437,148003,152665,157424,162281,167237,172293,177450,182709,188071,193537,199108,204785,210569,216461,222462,228573,234795,241129,247576,254137,260813,267605,274514,281541,288687,295953,303340,310849,318481,326237,334118,342125,350259,358521,366912,375433,384085,392869,401786,410837,420023,429345,438804,448401,458137,468013,478030,488189,498491,508937,519528,530265,541149,552181,563362,574693,586175,597809,609596,621537,633633,645885,658294,670861,683587,696473,709520,722729,736101,749637,763338,777205,791239,805441,819812,834353,849065,863949,879006,894237,909643,925225,940984,956921,973037,989333,1005810,1022469,1039311,1056337,1073548,1090945,1108529,1126301,1144262,1162413,1180755,1199289,1218016,1236937,1256053,1275365,1294874,1314581,1334487,1354593,1374900,1395409,1416121,1437037,1458158,1479485,1501019,1522761,1544712,1566873,1589245 mov $1,2 mov $2,$0 mov $3,3 mov $4,3 lpb $0,1 sub $0,1 trn $1,3 add $1,3 add $3,1 add $4,$3 sub $4,1 add $1,$4 lpe lpb $2,1 add $1,6 sub $2,1 lpe add $1,6
74.681818
1,363
0.804017
1fffda8942021c93ed51540f5b2de4f9bac3383c
2,711
asm
Assembly
6502EMU/main.asm
austinbentley/6502toAVR
98f43db3554741e6e25c0ab5acd394120a121c0d
[ "BSD-3-Clause" ]
null
null
null
6502EMU/main.asm
austinbentley/6502toAVR
98f43db3554741e6e25c0ab5acd394120a121c0d
[ "BSD-3-Clause" ]
null
null
null
6502EMU/main.asm
austinbentley/6502toAVR
98f43db3554741e6e25c0ab5acd394120a121c0d
[ "BSD-3-Clause" ]
null
null
null
; ; 6502EMU.asm ; ; Created: 5/12/2018 8:00:12 AM ; Author : ROTP ; start: ;to avoid overwriting the interrupt table with our includes! jmp init .DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 .include "programcode.asm" .include "definitions.asm" .include "general_macros.asm" .include "memorymap.asm" .include "dereferencer.asm" .include "Instructions/unimplemented_instructions.asm" .include "Instructions/BRK.asm" .include "Instructions/CLC.asm" .include "Instructions/CLD.asm" .include "Instructions/CLI.asm" .include "Instructions/CLV.asm" .include "Instructions/CMP.asm" .include "Instructions/CPX.asm" .include "Instructions/CPY.asm" .include "Instructions/INX.asm" .include "Instructions/INY.asm" .include "Instructions/JMP.asm" .include "Instructions/LDA.asm" .include "Instructions/LDX.asm" .include "Instructions/LDY.asm" .include "Instructions/NOP.asm" .include "Instructions/SEC.asm" .include "Instructions/SED.asm" .include "Instructions/SEI.asm" .include "Instructions/STA.asm" .include "Instructions/STX.asm" .include "Instructions/STY.asm" .include "Instructions/TAX.asm" .include "Instructions/TAY.asm" .include "Instructions/TXA.asm" .include "Instructions/TYA.asm" .include "instruction_mappings.asm" init: ; TODO: Copy RAMcode to SRAM ldi ZH, HIGH(RAMcodeUNLOADED) ldi ZL, LOW(RAMcodeUNLOADED) ldi XH, HIGH(SRAM_START) ldi XL, LOW(SRAM_START) ldi YH, HIGH(SRAM_END) ldi YL, LOW(SRAM_END) LSL ZL ROL ZH ram_copy_loop: lpm r0, Z+ st X+, r0 cp XH, YH brne ram_copy_loop cp XL, YL brne ram_copy_loop ram_copy_done: jmp _start _start: clr AR ; clear A register clr XR ; clear X register clr YR ; clear Y register clr SR ; clear status register clr ZH ; clear PC HIGH register clr ZL ; clear PC LOW register CLR XH CLR XL CLR YH CLR YL CLR R0 ; 1. Fetch instruction from PC ; 2. Decode instruction ; 3. Execute instruction (updating PC if necessary.) ; a. Ensure mappings are correct. ; 4. Come back here to execute the next instruction. ; inc r1 ; sts instructionTable, r1 fetch_setup: ;we want the code to start in ROM. LDI ZH, HIGH(ROM_START_EMU) LDI ZL, LOW(ROM_START_EMU) LDI TEMPPCH, HIGH(ROM_START_EMU) LDI TEMPPCL, LOW(ROM_START_EMU) fetch: dereferencer INSTRUCTION ldi r16, 2 mul INSTRUCTION, r16 ;we have the pointer to the instruction. ;preserve the old pc ;we need to add to Z for the offset. mov TEMPPCL, ZL mov TEMPPCH, ZH ;calcutate the pointer for getting the instruction's address. LDI ZL, LOW(instructionMapping*2) LDI ZH, HIGH(instructionMapping*2) add zl, r0 adc zh, r1 ;grab the instruction address and store it in Z lpm R0, Z+ lpm r1, z mov zl, r0 mov zh, r1 icall rjmp fetch
19.364286
67
0.73294
287246a29f3d93341bae810281458092549ab291
492
asm
Assembly
oeis/316/A316137.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/316/A316137.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/316/A316137.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A316137: Decimal expansion of the least x such that 1/x + 1/(x+2) + 1/(x+4) = 1. ; Submitted by Jon Maiga ; 3,4,8,9,2,8,8,5,7,1,8,1,0,0,7,8,7,6,2,7,9,2,9,3,6,5,3,0,4,5,4,8,4,9,2,4,1,1,6,8,0,6,5,8,3,9,4,8,2,9,9,3,1,1,5,5,3,6,5,6,6,4,5,5,1,7,0,6,7,4,9,3,4,1,4,2,6,1,6,4,1,9,3,4,3,4 mov $2,7 mov $3,$0 mul $3,4 add $3,2 mov $6,2 lpb $3 add $1,$2 div $2,$6 add $5,$2 add $1,$5 add $2,$1 mul $1,2 sub $3,1 lpe mul $1,$6 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
18.923077
173
0.528455
8ab5c46dcbb6d672ced46dccf325d60167ca1074
3,877
asm
Assembly
macros/scripts/maps.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
macros/scripts/maps.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
macros/scripts/maps.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
def_objects: MACRO REDEF _NUM_OBJECTS EQUS "_NUM_OBJECTS_\@" db {_NUM_OBJECTS} {_NUM_OBJECTS} = 0 ENDM ;\1 sprite id ;\2 x position ;\3 y position ;\4 movement (WALK/STAY) ;\5 range or direction ;\6 text id ;\7 items only: item id ;\7 trainers only: trainer class/pokemon id ;\8 trainers only: trainer number/pokemon level object: MACRO db \1 db \3 + 4 db \2 + 4 db \4 db \5 IF _NARG > 7 db TRAINER | \6 db \7 db \8 ELIF _NARG > 6 db ITEM | \6 db \7 ELSE db \6 ENDC {_NUM_OBJECTS} = {_NUM_OBJECTS} + 1 ENDM def_warps: MACRO REDEF _NUM_WARPS EQUS "_NUM_WARPS_\@" db {_NUM_WARPS} {_NUM_WARPS} = 0 ENDM ;\1 x position ;\2 y position ;\3 destination warp id ;\4 destination map (-1 = wLastMap) warp: MACRO db \2, \1, \3, \4 _WARP_{d:{_NUM_WARPS}}_X = \1 _WARP_{d:{_NUM_WARPS}}_Y = \2 {_NUM_WARPS} = {_NUM_WARPS} + 1 ENDM def_signs: MACRO REDEF _NUM_SIGNS EQUS "_NUM_SIGNS_\@" db {_NUM_SIGNS} {_NUM_SIGNS} = 0 ENDM ;\1 x position ;\2 y position ;\3 sign id sign: MACRO db \2, \1, \3 {_NUM_SIGNS} = {_NUM_SIGNS} + 1 ENDM ;\1 source map def_warps_to: MACRO FOR n, _NUM_WARPS warp_to _WARP_{d:n}_X, _WARP_{d:n}_Y, \1_WIDTH ENDR ENDM ;\1 x position ;\2 y position ;\3 map width warp_to: MACRO event_displacement \3, \1, \2 ENDM ;\1 first bit offset / first object id def_trainers: MACRO IF _NARG == 1 CURRENT_TRAINER_BIT = \1 ELSE CURRENT_TRAINER_BIT = 1 ENDC ENDM ;\1 event flag ;\2 view range ;\3 TextBeforeBattle ;\4 TextAfterBattle ;\5 TextEndBattle trainer: MACRO _ev_bit = \1 % 8 _cur_bit = CURRENT_TRAINER_BIT % 8 ASSERT _ev_bit == _cur_bit, \ "Expected \1 to be bit {d:_cur_bit}, got {d:_ev_bit}" db CURRENT_TRAINER_BIT db \2 << 4 dw wEventFlags + (\1 - CURRENT_TRAINER_BIT) / 8 dw \3, \5, \4, \4 CURRENT_TRAINER_BIT = CURRENT_TRAINER_BIT + 1 ENDM ;\1 x position ;\2 y position ;\3 movement data map_coord_movement: MACRO dbmapcoord \1, \2 dw \3 ENDM ;\1 map name ;\2 map id ;\3 tileset ;\4 connections: combo of NORTH, SOUTH, WEST, and/or EAST, or 0 for none map_header: MACRO CURRENT_MAP_WIDTH = \2_WIDTH CURRENT_MAP_HEIGHT = \2_HEIGHT CURRENT_MAP_OBJECT EQUS "\1_Object" \1_h:: db \3 db CURRENT_MAP_HEIGHT, CURRENT_MAP_WIDTH dw \1_Blocks dw \1_TextPointers dw \1_Script db \4 ENDM ; Comes after map_header and connection macros end_map_header: MACRO dw {CURRENT_MAP_OBJECT} PURGE CURRENT_MAP_WIDTH, CURRENT_MAP_HEIGHT, CURRENT_MAP_OBJECT ENDM ; Connections go in order: north, south, west, east ;\1 direction ;\2 map name ;\3 map id ;\4 offset of the target map relative to the current map ; (x offset for east/west, y offset for north/south) connection: MACRO ; Calculate tile offsets for source (current) and target maps _src = 0 _tgt = (\4) + 3 IF _tgt < 2 _src = -_tgt _tgt = 0 ENDC IF !STRCMP("\1", "north") _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src _map = _tgt _win = (\3_WIDTH + 6) * \3_HEIGHT + 1 _y = \3_HEIGHT * 2 - 1 _x = (\4) * -2 _len = CURRENT_MAP_WIDTH + 3 - (\4) IF _len > \3_WIDTH _len = \3_WIDTH ENDC ELIF !STRCMP("\1", "south") _blk = _src _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt _win = \3_WIDTH + 7 _y = 0 _x = (\4) * -2 _len = CURRENT_MAP_WIDTH + 3 - (\4) IF _len > \3_WIDTH _len = \3_WIDTH ENDC ELIF !STRCMP("\1", "west") _blk = (\3_WIDTH * _src) + \3_WIDTH - 3 _map = (CURRENT_MAP_WIDTH + 6) * _tgt _win = (\3_WIDTH + 6) * 2 - 6 _y = (\4) * -2 _x = \3_WIDTH * 2 - 1 _len = CURRENT_MAP_HEIGHT + 3 - (\4) IF _len > \3_HEIGHT _len = \3_HEIGHT ENDC ELIF !STRCMP("\1", "east") _blk = (\3_WIDTH * _src) _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3 _win = \3_WIDTH + 7 _y = (\4) * -2 _x = 0 _len = CURRENT_MAP_HEIGHT + 3 - (\4) IF _len > \3_HEIGHT _len = \3_HEIGHT ENDC ELSE fail "Invalid direction for 'connection'." ENDC db \3 dw \2_Blocks + _blk dw wOverworldMap + _map db _len - _src db \3_WIDTH db _y, _x dw wOverworldMap + _win ENDM
18.374408
72
0.681197
fb89cd259ab72df26093e46c17450ed38e96960e
5,217
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_207_164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_207_164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_207_164.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0xdbf2, %rbp clflush (%rbp) nop nop sub %r14, %r14 movb (%rbp), %r8b nop nop xor $3687, %rdi lea addresses_normal_ht+0x956a, %rbx clflush (%rbx) nop nop xor $5805, %rcx movl $0x61626364, (%rbx) nop nop inc %rbx lea addresses_WT_ht+0x93fa, %rcx clflush (%rcx) nop nop nop nop xor $1038, %rbp movb (%rcx), %bl nop nop nop nop add %rbp, %rbp lea addresses_D_ht+0xf6da, %r8 nop nop nop nop sub %rbx, %rbx vmovups (%r8), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %rdi nop nop nop and $61978, %r8 lea addresses_WT_ht+0xd07a, %rsi lea addresses_A_ht+0x1d332, %rdi clflush (%rsi) nop nop lfence mov $42, %rcx rep movsl and %rdi, %rdi lea addresses_WT_ht+0xa86a, %rcx nop nop nop nop nop xor $26010, %rsi movb (%rcx), %r8b nop nop nop xor $19240, %r14 lea addresses_WC_ht+0x1c6fa, %rbp nop nop nop nop nop cmp $56259, %r8 mov (%rbp), %di nop nop nop nop xor %rcx, %rcx lea addresses_WT_ht+0xa412, %r8 nop nop nop nop nop add %rdi, %rdi movb (%r8), %r14b xor $54427, %rbx lea addresses_WT_ht+0x10fa, %r14 nop nop nop nop nop and %rcx, %rcx mov $0x6162636465666768, %r8 movq %r8, %xmm2 vmovups %ymm2, (%r14) nop inc %rsi lea addresses_D_ht+0x7afa, %r9 add $40804, %r14 and $0xffffffffffffffc0, %r9 vmovntdqa (%r9), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rsi nop nop nop nop nop and $64453, %rdi lea addresses_D_ht+0xb9da, %rsi nop nop nop nop nop sub %rdi, %rdi movb (%rsi), %r9b nop nop dec %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r14 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbp push %rdi push %rdx push %rsi // Load lea addresses_A+0x1d81a, %r14 clflush (%r14) nop nop nop nop nop sub %rsi, %rsi movups (%r14), %xmm3 vpextrq $1, %xmm3, %rdx nop nop nop nop nop cmp $48083, %rdx // Store lea addresses_WT+0x405a, %rbp nop nop nop nop xor $11381, %r12 mov $0x5152535455565758, %rdx movq %rdx, %xmm4 vmovntdq %ymm4, (%rbp) nop nop nop nop nop xor $60553, %rbp // Store lea addresses_PSE+0x1daa, %rdi nop nop nop and %rdx, %rdx mov $0x5152535455565758, %rbp movq %rbp, %xmm7 vmovntdq %ymm7, (%rdi) add %rsi, %rsi // Faulty Load lea addresses_D+0x130fa, %r12 nop nop and %r11, %r11 movups (%r12), %xmm6 vpextrq $0, %xmm6, %rbp lea oracles, %r11 and $0xff, %rbp shlq $12, %rbp mov (%r11,%rbp,1), %rbp pop %rsi pop %rdx pop %rdi pop %rbp pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'36': 207} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
21.469136
620
0.64884
6f7810d2bf60f18e697d15910ecc873598622967
405
asm
Assembly
programs/oeis/164/A164549.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/164/A164549.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/164/A164549.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A164549: a(n) = 4*a(n-1)+2*a(n-2) for n > 1; a(0) = 1, a(1) = 6. ; 1,6,26,116,516,2296,10216,45456,202256,899936,4004256,17816896,79276096,352738176,1569504896,6983495936,31072993536,138258966016,615181851136,2737245336576,12179345048576,54191870867456,241126173566976,1072888436002816,4773806091145216 mov $1,1 mov $3,2 lpb $0 sub $0,1 mov $2,$1 add $1,$3 mul $1,2 mov $3,$2 add $3,$1 lpe
28.928571
237
0.706173
41aa4e033291711c6f297b947c429a70c949df36
367
asm
Assembly
L1/TPs/0204-ASM/tp3/binaire1.asm
Tehcam/Studies
69477a211d8c686473b171ad2fa4298ead2ee60d
[ "MIT" ]
null
null
null
L1/TPs/0204-ASM/tp3/binaire1.asm
Tehcam/Studies
69477a211d8c686473b171ad2fa4298ead2ee60d
[ "MIT" ]
null
null
null
L1/TPs/0204-ASM/tp3/binaire1.asm
Tehcam/Studies
69477a211d8c686473b171ad2fa4298ead2ee60d
[ "MIT" ]
null
null
null
; Initialisation In ; (0) Store Mem[0] ; x (1) Load 0 ; (2) Store Mem[1] ; i (3) ; Si 7<i ? CMP 7 ; (4) JC 15 ; alors aller à la fin du programme (5) ; sinon continuer Load Mem[0] ; (6) Mod 2 ; (7) Out ; afficher x%2 (8) Load Mem[0] ; (9) Div 2 ; (10) Store Mem[0] ; (11) Load Mem[1] ; (12) Add 1 ; (13) JMP 3 ; retour au test (14) ; Fin du programme End ; (15)
14.68
45
0.564033
e56a86945cc0d41ef3e81f746bce2107ea9ae1f0
1,011
asm
Assembly
maps/SilverCaveRoom3.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
maps/SilverCaveRoom3.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
maps/SilverCaveRoom3.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
object_const_def ; object_event constants const SILVERCAVEROOM3_RED SilverCaveRoom3_MapScripts: db 0 ; scene scripts db 0 ; callbacks Red: special FadeOutMusic faceplayer opentext writetext .Text1 waitbutton closetext winlosstext .Text2, .Text2 loadtrainer RED, RED1 startbattle dontrestartmapmusic reloadmapafterbattle special FadeOutMusic opentext writetext .Text3 waitbutton closetext special FadeBlackQuickly special ReloadSpritesNoPalettes disappear SILVERCAVEROOM3_RED pause 15 special FadeInQuickly pause 30 special HealParty refreshscreen credits end .Text1: text "<……>" line "<……>" done .Text2: text "…" done .Text3: text "<……>" line "<……>" done SilverCaveRoom3_MapEvents: db 0, 0 ; filler db 1 ; warp events warp_event 9, 33, SILVER_CAVE_ROOM_2, 2 db 0 ; coord events db 0 ; bg events db 1 ; object events object_event 9, 10, SPRITE_RED, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, Red, EVENT_RED_IN_MT_SILVER
16.047619
138
0.757666
f46f840aa4220722749d30b7a53e026318cd6f90
15,638
asm
Assembly
Driver/Video/VidCom/vidcomEntry.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Video/VidCom/vidcomEntry.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Video/VidCom/vidcomEntry.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: Video drivers FILE: vidcomEntry.asm AUTHOR: Jim DeFrisco ROUTINES: Name Description ---- ----------- DriverStrategy entry point to driver VidStartExclusive Enter into exclusive use VidEndExclusive Finished with exclusive use VidInfo Return address of info block VidEscape Generalized escape function REVISION HISTORY: Name Date Description ---- ---- ----------- jim 5/88 initial verison DESCRIPTION: This file contains the entry point routine for the video drivers, the driver jump table and local driver variables $Id: vidcomEntry.asm,v 1.1 97/04/18 11:41:51 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} NT <include Internal/winnt.def> COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DriverStrategy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Entry point for all video display driver calls CALLED BY: KERNEL PASS: [di] - offset into driver function table RETURN: see individual routines DESTROYED: ax,bx,cx,dx,di PSEUDO CODE/STRATEGY: call function thru the jump table KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 10/88... Initial version of strategy routine Jim 10/88 Modified for video drivers Jim 5/89 Modified to add escape capability %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} DriverStrategy proc far ; if no device has been set, just exit, but allow standard ; extended-driver calls through... cmp di, first VidFunction jb haveDevEnum ; ; Don't do anything if not yet initialized ; cmp cs:[DriverTable].VDI_device, 0xffff je exit haveDevEnum: cmp di, DR_VID_LAST_NON_SEMAPHORE jbe noSemaphoreRequired ; branch seldom taken... ; check if we need to obey the exclusive flag... cmp di,DR_VID_LAST_NON_EXCLUSIVE jbe callFunctionWithSemaphore ; no, continue cmp di, DR_VID_LAST_FUNCTION ; escape code? ja callFunctionWithSemaphore ; yes, no excl ; ; If the exclusive flag is our life, first see if any exclusive ; has been set (exclusiveGstate is non-zero). Only if it is do we ; compare it against ds:[LMBH_handle]. (don't use cx here, though ; a jcxz is tempting, as we can recover ax and interrupts easily ; and do a jnz in both cases to deal with either there being no ; exclusive or the gstate being the one with the exclusive). ; push ax INT_OFF mov ax, cs:[exclusiveGstate] tst ax jz noExclusive cmp ax, ds:[GS_header].LMBH_handle je noExclusive mov cs:[exclusiveCausedAbort], TRUE pop ax push ds segmov ds, cs ; ds -> vars call VidExclBounds ; in Exclusive module pop ds INT_ON cmp di, DR_VID_PUTSTRING jne exit ; ; XXX: Gross hack for DR_VID_PUTSTRING, being the only output ; operation that returns something. ; mov bp, cx ; must return font segment in bp jmp exit noExclusive: INT_ON pop ax callFunctionWithSemaphore: ; check for VID_ESCAPE codes or di, di ; is it an escape ? js DS_escape ; yes, do escape function FastPSem1 cs, videoSem, DS_P3, DS_P4 call cs:[driverJumpTable][di] ; dispatch the function FastVSem1 cs, videoSem, DS_V3, DS_V4 exit: ret ;**************************************************** ; don't need any semaphore, just call the darn thing noSemaphoreRequired: call cs:[driverJumpTable][di] ; dispatch the function ret ; escape code DS_escape: call VidEscape ret ;---------------------------- FastPSem2 cs, videoSem, DS_P3, DS_P4 FastVSem2 cs, videoSem, DS_V3, DS_V4 DriverStrategy endp public DriverStrategy COMMENT @----------------------------------------------------------------------- FUNCTION: VidStartExclusive DESCRIPTION: Start exclusive access to the driver CALLED BY: INTERNAL DriverStrategy PASS: bx - graphics state handle RETURN: nothing DESTROYED: bx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/89 Initial version -------------------------------------------------------------------------------@ VidStartExclusive proc near INT_OFF ; ensure atomic update of bounds... -- ardeb 4/27/93 mov cs:[exclusiveGstate], bx mov cs:[exclBound].R_left, MAX_COORD mov cs:[exclBound].R_right, MIN_COORD mov cs:[exclBound].R_top, MAX_COORD mov cs:[exclBound].R_bottom, MIN_COORD INT_ON ret VidStartExclusive endp public VidStartExclusive COMMENT @----------------------------------------------------------------------- FUNCTION: VidEndExclusive DESCRIPTION: End exclusive access to the driver CALLED BY: INTERNAL DriverStrategy PASS: bx = gstate that supposedly had the exclusive RETURN: ax = non-zero if some output operation was aborted during that gstate's tenure as the exclusive si,di,cx,dx - bounds of rectangle to invalidate, if ax != 0 DESTROYED: REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/89 Initial version -------------------------------------------------------------------------------@ VidEndExclusive proc near INT_OFF clr ax ; assume wasn't exclusive => ; couldn't have caused an ; abort cmp cs:[exclusiveGstate], bx ; is this the exclusive? jne done ; no => do nothing mov cs:[exclusiveGstate], ax ; set exclusive to 0 xchg cs:[exclusiveCausedAbort], ax ; fetch abort flag and reset tst ax ; if there was an abort, done jz done mov si, cs:[exclBound].R_left mov di, cs:[exclBound].R_top mov cx, cs:[exclBound].R_right mov dx, cs:[exclBound].R_bottom done: INT_ON ret VidEndExclusive endp public VidEndExclusive COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VidGetExclusive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the handle of the GState with the current exclusive CALLED BY: GLOBAL PASS: nothing RETURN: bx - GState handle for GState with exclusive, or zero if nothing has exclusive access DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jim 6/23/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VidGetExclusive proc near .enter mov bx, cs:[exclusiveGstate] .leave ret VidGetExclusive endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VidInfo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Return a pointer to the driver info block CALLED BY: GLOBAL PASS: nothing RETURN: dx:si - pointer to DriverInfo block DESTROYED: nothing PSEUDO CODE/STRATEGY: just stuff the table address; KNOWN BUGS/SIDE EFFECTS/IDEAS: The memory driver may want to do something special, since it may keep a separate table for each user; REVISION HISTORY: Name Date Description ---- ---- ----------- Jim 05/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ public VidInfo VidInfo proc near mov dx, cs ; set segment to current code seg mov si, offset dgroup:DriverTable ; get offset ret VidInfo endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VidEscape %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Execute some escape function CALLED BY: GLOBAL PASS: di - escape code (ORed with 8000h) RETURN: di - set to 0 if escape not supported - return unchanged if handled DESTROYED: see individual functions PSEUDO CODE/STRATEGY: scan through the table, find the code, call the handler. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Jim 05/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ public VidEscape VidEscape proc near push di ; save a few regs push cx push ax push es segmov es, cs, cx ; es -> driver segment mov ax, di ; setup match value mov di, offset dgroup:escCodes ; si -> esc code tab mov cx, NUM_ESC_ENTRIES ; init rep count repne scasw ; find the right one pop es pop ax jne VE_notFound ; not in table, quit ; function is supported, call through vector pop cx call cs:[di+((offset escRoutines)-(offset escCodes)-2)] pop di ret ; function not supported, return di==0 VE_notFound: pop cx ; restore stack pop di clr di ; set return value ret VidEscape endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VidCallMod %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Prepare to call into another module CALLED BY: INTERNAL DriverStrategy PASS: di - function number RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: switch stacks, save necc variables, call into other module. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Jim 10/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; dash fill module also needs polygon code dashfillLocks: push ax mov bx, vseg VideoPolygon call MemLockFixedOrMovable EC < ERROR_C LOCK_RETURNED_ERROR ;can't happen :) > pop ax jmp modsLocked ; calling VidPutLine. Need to lock both the bitmap and ; line modules as well putlineLocks: push ax ; save Putline segment mov bx, vseg VideoBitmap call MemLockFixedOrMovable ; lock the block EC < ERROR_C LOCK_RETURNED_ERROR ;can't happen :) > mov bx, vseg VideoLine call MemLockFixedOrMovable EC < ERROR_C LOCK_RETURNED_ERROR ;can't happen :) > pop ax jmp modsLocked ; need to lock more modules, maybe. lockAdditional label near je putlineLocks cmp di, DR_VID_DASH_FILL*2 je dashfillLocks cmp di, DR_VID_POLYGON*2 jne modsLocked ; polygon code needs line module push ax mov bx, vseg VideoLine call MemLockFixedOrMovable EC < ERROR_C LOCK_RETURNED_ERROR ;can't happen :) > pop ax jmp modsLocked VidCallMod proc near ; give up the videoSem, while we try and lock the block. ; This will allow SysNotify to work if we happen to fault ; while loading in the module we are calling. VSem cs, videoSem ; before we switch stacks or write to any ThreadPrivateData ; or any dgroup variables we need to have the videoSem. So ; locking the block is the first order of business. Lock ; the main one, then check for the case where two (or three) ; modules need to be locked (yuck). ; ; The functions that need extra modules locked are: ; PutLine - also needs Bitmap, Line ; DashFill - also needs Polygon ; Polygon - also needs Line push ax push bx ; save regs we trash shl di, 1 ; function# * 2 mov bx, cs:[moduleTable][di].segment ; load virtual seg call MemLockFixedOrMovable EC < ERROR_C LOCK_RETURNED_ERROR ;can't happen :) > cmp di, DR_VID_PUTLINE*2 ; check for extra... jae lockAdditional ; now that the modules are safely locked, re-P the semaphore ; and continue. modsLocked label near PSem cs, videoSem ; restore the original values of ax,bx where we will be able ; to use them later. pop cs:[TPD_dataBX] pop cs:[TPD_dataAX] ; trashed by CallMod ; next, switch stacks so we still have access to dgroup ; NOTE: the loading of ss *must* be followed by the loading ; of sp. mov cs:[saveSS], ss ; save caller's stack mov cs:[saveSP], sp mov bx, ss:[TPD_threadHandle] mov cs:[TPD_threadHandle], bx mov bx, {word}ss:[TPD_exclFSIRLocks] mov {word}cs:[TPD_exclFSIRLocks], bx mov bx, dgroup ; setup new stack mov ss, bx mov sp, offset dgroup:endVidStack ; done with setup. ax holds the segment of the routine to ; call. Push a return address and the calling address and ; fire away... push di ; save function number push cs ; push return address mov bx, offset restoreStack push bx push ax ; push segment of routine push cs:[moduleTable][di].offset ; push routine offset mov ax, cs:[TPD_dataAX] mov bx, cs:[TPD_dataBX] retf ; call routine ; done with operation. unlock modules. restoreStack: pop di ; restore function number mov bx, cs:[moduleTable][di].segment call MemUnlockFixedOrMovable ; unlock module we called cmp di, DR_VID_PUTLINE*2 ; check for extra... jae unlockAdditional modsUnlocked: mov ss, cs:[saveSS] ; restore old stack mov sp, cs:[saveSP] ret ; need the same type of code to unlock the extra mods. unlockAdditional: je putlineUnlocks cmp di, DR_VID_DASH_FILL*2 je dashfillUnlocks cmp di, DR_VID_POLYGON*2 jne modsUnlocked ; polygon code needs line module polygonUnlocks: mov bx, vseg VideoLine call MemUnlockFixedOrMovable jmp modsUnlocked dashfillUnlocks: mov bx, vseg VideoPolygon call MemUnlockFixedOrMovable jmp modsUnlocked putlineUnlocks: mov bx, vseg VideoBitmap call MemUnlockFixedOrMovable jmp polygonUnlocks VidCallMod endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VidCallModNoSem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Same as VidCallMod, but videoSem not down CALLED BY: INTERNAL DriverStrategy PASS: di - VidFunction RETURN: depends on routine called DESTROYED: depends on routine called PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jim 11/24/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VidCallModNoSem proc near ; first, save away ax/bx since they are trashed by CallMod mov cs:[TPD_dataAX], ax ; trashed by CallMod mov cs:[TPD_dataBX], bx ; next, switch stacks so we still have access to dgroup ; NOTE: the loading of ss *must* be followed by the loading ; of sp. mov cs:[saveSS], ss ; save caller's stack mov cs:[saveSP], sp mov bx, ss:[TPD_threadHandle] mov cs:[TPD_threadHandle], bx mov bx, {word}ss:[TPD_exclFSIRLocks] mov {word}cs:[TPD_exclFSIRLocks], bx NT < mov bx, ss:[TPD_curPath] > NT < mov cs:[TPD_curPath], bx > mov ax, dgroup ; setup new stack mov ss, ax mov sp, offset dgroup:endVidStack ; done with setup. Load up ax/bx to call ProcCallModule... shl di, 1 ; into word table mov ax, cs:[moduleTable][di].offset ; grab offset mov bx, cs:[moduleTable][di].segment call ProcCallFixedOrMovable ; done with operation, restore stack and exit mov ss, cs:[saveSS] ; restore old stack mov sp, cs:[saveSP] ret VidCallModNoSem endp
25.847934
81
0.603338
391d8921e33b2e0d87e74cfdf859b3d1730b660f
2,351
asm
Assembly
lib/src/virq.asm
Faselei/SeniorProject68k
45cf46d5ad2795f00a5fa2398bc3a3947e75941d
[ "MIT" ]
null
null
null
lib/src/virq.asm
Faselei/SeniorProject68k
45cf46d5ad2795f00a5fa2398bc3a3947e75941d
[ "MIT" ]
null
null
null
lib/src/virq.asm
Faselei/SeniorProject68k
45cf46d5ad2795f00a5fa2398bc3a3947e75941d
[ "MIT" ]
null
null
null
;=============================================================================== ;virq.asm ;=============================================================================== ;virtucal blank IRQ, happens at 60hz (NTSC) or 50hz (PAL) ;this is the only constant source of time on the system that does not require ;some wizard to work with us. ;------------------------------------------------------------------------------- include "vdpAbstraction.inc" ;/////////////////////////////////////////////////////////////////////////////// section "BSS",bss public _clock _clock ds.l 1 virqSavedReg ds.l 15 ;/////////////////////////////////////////////////////////////////////////////// section "DATA",data ;/////////////////////////////////////////////////////////////////////////////// section "CODE",code ;--------------------------------------- ;Function Name ; ;Description ; ;Calling Convention ; ;--------------------------------------- public v_interrupt v_interrupt: ;push all registers movem.l d0-d7/a0-a6,virqSavedReg ;refresh VDP tst.w (VDP_CTRL) ;DMA colors? tst.b (vdpCommitColorBufferFlag) beq .noColorDMA bsr VDP_DMAColorBuffer move.b #0,vdpCommitColorBufferFlag .noColorDMA: ;DMA vsram? tst.b (vdpCommitVSRAMBufferFlag) beq .noVSRAMDAM bsr VDP_DMAVSRAMBuffer move.b #0,vdpCommitVSRAMBufferFlag .noVSRAMDAM: ;DMA sprite buffer? tst.b (vdpCommitSpriteBufferFlag) beq .noSpriteDMA bsr VDP_DMASpriteBuffer move.b #0,vdpCommitSpriteBufferFlag .noSpriteDMA: ;Anything in the DMA queue? tst.b _processDMAQueue ; == 0: NO, != 0: YES beq .noDMA ;No: skip bsr _DMA_ProcessQueue ;Yes: do them move.b #0,_processDMAQueue ;then set to false .noDMA: ;commit shadow registers bsr _VDP_CommitShadowRegisters ;commit horizontal scrolling register move.l #VRAM_WRITE_CMD,-(sp) move.l #$0000B800,-(sp) bsr _VDP_WriteCommand addq.w #8,sp move.l d0,(VDP_CTRL) move.w _hScroll,d0 neg d0 move.w d0,(VDP_DATA) ;update controllers bsr _updateControllerInputs ;mark that time has passed add.l #1,_clock ;restore all registers and return movem.l virqSavedReg,d0-d7/a0-a6 rte ;--------------------------------------- ;Function Name ; ;Description ; ;Calling Convention ; ;---------------------------------------
23.04902
81
0.516801
3959913b606ef629a8654083b8ac8ec8a473b5d5
3,890
asm
Assembly
asm/getFibonnaci.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
asm/getFibonnaci.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
asm/getFibonnaci.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
global @ASM_getFibonacci@4 extern _getInstructionSet segment .data align=16 actualASM_getFibonacciPtr dd actualASM_getFibonacciGetPtr segment .rodata align=16 owordOne dq 1 dq 0 segment .text align=16 %define number ecx %define loResult eax %define hiResult edx %define loopCnt ebp %define loTemp ecx %define hiTemp ebx %define loTemp2 esi %define hiTemp2 edi actualASM_getFibonacci386: push loopCnt push hiTemp2 push loTemp2 push hiTemp sub esp, 12 mov dword [esp + 4], number cmp number, 1 jbe .return1 mov loopCnt, 1 mov loTemp, 1 xor hiTemp, hiTemp xor loTemp2, loTemp2 xor hiTemp2, hiTemp2 .loop: mov loResult, loTemp2 mov hiResult, hiTemp2 add loResult, loTemp adc hiResult, hiTemp inc loopCnt mov loTemp2, loTemp mov hiTemp2, hiTemp mov loTemp, loResult mov hiTemp, hiResult cmp dword [esp + 4], loopCnt jne .loop add esp, 12 pop hiTemp pop loTemp2 pop hiTemp2 pop loopCnt ret .return1: mov loResult, 1 xor hiResult, hiResult add esp, 12 pop hiTemp pop loTemp2 pop hiTemp2 pop loopCnt ret align 16 %define loopCnt ebx %define loResult eax %define hiResult edx actualASM_getFibonacciSSSE3: cmp number, 1 jbe .return1 push loopCnt mov loopCnt, 1 movdqa xmm1, oword [owordOne] pxor xmm0, xmm0 .loop: movdqa xmm3, xmm0 paddq xmm3, xmm1 movdqa xmm0, xmm3 movd loResult, xmm3 psrlq xmm0, 32 movd hiResult, xmm0 inc loopCnt movdqa xmm0, xmm1 movdqa xmm1, xmm3 cmp number, loopCnt jne .loop pop loopCnt ret align 16 .return1: mov loResult, 1 xor hiResult, hiResult ret align 16 %define loopCnt ebx actualASM_getFibonacciSSE42: cmp number, 1 jbe .return1 push loopCnt mov loopCnt, 1 movdqa xmm1, oword [owordOne] pxor xmm2, xmm2 .loop: movdqa xmm3, xmm2 paddq xmm3, xmm1 movd loResult, xmm3 pextrd hiResult, xmm3, 1 inc loopCnt movdqa xmm2, xmm1 movdqa xmm1, xmm3 cmp number, loopCnt jne .loop pop loopCnt ret .return1: mov loResult, 1 xor hiResult, hiResult ret align 16 %define loopCnt ebx actualASM_getFibonacciAVX: cmp number, 1 jbe .return1 push loopCnt mov loopCnt, 1 vmovdqa xmm1, oword [owordOne] vpxor xmm2, xmm2, xmm2 .loop: vpaddq xmm0, xmm2, xmm1 vmovd loResult, xmm0 vpextrd hiResult, xmm0, 1 inc loopCnt vmovdqa xmm2, xmm1 vmovdqa xmm1, xmm0 cmp number, loopCnt jne .loop pop loopCnt ret .return1: vmovdqa xmm0, oword [owordOne] vmovd loResult, xmm0 vpextrd hiResult, xmm0, 1 ret align 16 %define SSSE3Supported 6 %define SSE42Supported 10 %define AVXSupported 11 @ASM_getFibonacci@4: jmp dword [actualASM_getFibonacciPtr] align 16 actualASM_getFibonacciGetPtr: sub esp, 28 mov dword [esp + 12], number call _getInstructionSet cmp eax, SSSE3Supported - 1 mov number, dword [esp + 12] jg .not386 mov dword [actualASM_getFibonacciPtr], actualASM_getFibonacci386 jmp .doJmp .not386: cmp eax, SSE42Supported - 1 jg .notSSSE3 mov dword [actualASM_getFibonacciPtr], actualASM_getFibonacciSSSE3 jmp .doJmp .notSSSE3: cmp eax, AVXSupported - 1 jg .notSSE42 mov dword [actualASM_getFibonacciPtr], actualASM_getFibonacciSSE42 jmp .doJmp .notSSE42: mov dword [actualASM_getFibonacciPtr], actualASM_getFibonacciAVX .doJmp: add esp, 28 jmp dword [actualASM_getFibonacciPtr]
16.839827
71
0.630591
9dace6d09eaed1e3947611102dcbcb00cc51c512
489
asm
Assembly
programs/oeis/330/A330173.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/330/A330173.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/330/A330173.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A330173: a(n) = n + floor(ns/r) + floor(nt/r), where r = sqrt(2), s = sqrt(2) + 1, t = sqrt(2) + 2. ; 4,9,15,19,25,30,34,40,45,51,55,60,66,70,76,81,87,91,96,102,106,112,117,121,127,132,138,142,148,153,157,163,168,174,178,183,189,193,199,204,208,214,219,225,229,235,240,244,250,255,261,265,270,276,280,286 mov $5,$0 add $0,7 pow $0,2 mov $1,1 mov $2,1 mov $3,1 lpb $0,1 sub $0,$1 trn $0,1 add $1,$2 add $3,3 lpe mov $1,$3 sub $1,14 mov $4,$5 mul $4,6 add $1,$4 sub $1,5 div $1,2
21.26087
204
0.597137
c228310d48a3a921935866604fac91f00e19fc77
279
asm
Assembly
InjectRuntimeELF/example/__libc_dlopen_mode.asm
zysyyz/evilELF
d5fdbc27ccd27b6e994e333a8a26f31fc9d33cd0
[ "MIT" ]
57
2017-02-20T07:39:03.000Z
2021-10-15T01:45:15.000Z
InjectRuntimeELF/example/__libc_dlopen_mode.asm
zysyyz/evilELF
d5fdbc27ccd27b6e994e333a8a26f31fc9d33cd0
[ "MIT" ]
1
2017-06-22T22:53:42.000Z
2017-06-22T22:53:42.000Z
InjectRuntimeELF/example/__libc_dlopen_mode.asm
jmpews/evilELF
d5fdbc27ccd27b6e994e333a8a26f31fc9d33cd0
[ "MIT" ]
35
2017-01-08T02:20:57.000Z
2021-12-20T05:05:45.000Z
nop _start: jmp string begin: pop eax ; char *file mov edx, 0x1 ; int mode push edx ; push eax ; mov ebx, 0x12345678 ; addr __libc_dlopen_mode() call ebx ; call __libc_dlopen_mode() add esp, 0x8 ; resotre stack int3 ; breakpoint string: call begin db "/tmp/ourlibby.so",0x00
19.928571
49
0.727599
93954b2123b6f67451586ffa2e1e6d90c43e456f
4,549
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_119.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_119.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_119.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 %rax push %rbp push %rbx push %rdx lea addresses_A_ht+0x1c3a6, %r14 nop and %rbx, %rbx mov $0x6162636465666768, %rax movq %rax, %xmm5 and $0xffffffffffffffc0, %r14 movntdq %xmm5, (%r14) nop nop nop nop nop dec %r15 lea addresses_A_ht+0x182a6, %rdx nop nop inc %r9 movw $0x6162, (%rdx) add $34243, %r9 lea addresses_UC_ht+0x14d20, %rdx nop nop nop nop inc %rbp mov (%rdx), %r14w xor %rdx, %rdx pop %rdx pop %rbx pop %rbp pop %rax pop %r9 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r15 push %r8 push %rdi push %rdx // Faulty Load lea addresses_D+0xd0a6, %r10 nop nop xor %rdi, %rdi movb (%r10), %r15b lea oracles, %rdx and $0xff, %r15 shlq $12, %r15 mov (%rdx,%r15,1), %r15 pop %rdx pop %rdi pop %r8 pop %r15 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
52.895349
2,999
0.661024
3acbe0c66080393b5d4c90d3b6559a687c84afdd
432
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/derror_erange_infc.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/derror_erange_infc.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/derror_erange_infc.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC derror_erange_infc, derror_erange_pinfc, derror_erange_minfc, derror_erange_infxc EXTERN am48_derror_erange_infc, am48_derror_erange_pinfc, am48_derror_erange_minfc, am48_derror_erange_infxc defc derror_erange_infc = am48_derror_erange_infc defc derror_erange_pinfc = am48_derror_erange_pinfc defc derror_erange_minfc = am48_derror_erange_minfc defc derror_erange_infxc = am48_derror_erange_infxc
36
108
0.900463
a0608455af157a67cebeb993f1d7574e4b94c400
1,998
asm
Assembly
ts2060/display.asm
nagydani/zx-rom-mods
a06cfb2e936c145025c4f3d6f3282cce15ad5f56
[ "MIT" ]
15
2018-09-07T15:49:44.000Z
2021-09-21T20:47:14.000Z
ts2060/display.asm
nagydani/zx-rom-mods
a06cfb2e936c145025c4f3d6f3282cce15ad5f56
[ "MIT" ]
6
2020-05-24T08:43:07.000Z
2020-05-26T22:02:36.000Z
ts2060/display.asm
nagydani/zx-rom-mods
a06cfb2e936c145025c4f3d6f3282cce15ad5f56
[ "MIT" ]
3
2020-08-03T06:28:34.000Z
2021-12-29T00:27:50.000Z
DISPLAY:CALL STACKSWAP RST $30 DEFW L1E94 ; FIND_INT1 CP $03 JP NC,ERROR_B DISP: IN A,($FF) AND 7 RRA CP 2 ADC A, $FF ; A = current video mode CP C RET Z CCF SBC A,0 RRA RL C LD B,0 LD HL,DISPTAB ADD HL,BC LD C,(HL) ADD HL,BC JP (HL) DISPTAB:DEFB DISP10 - $ DEFB DISP20 - $ DEFB DISP01 - $ DEFB DISP21 - $ DEFB DISP02 - $ DEFB DISP12 - $ DISP02: CALL DISPALLOC DISP12: LD HL,$6000 LD DE,$6001 LD BC,$17FF LD (HL),L LDIR LD HL,S_POSN SLA (HL) DEC (HL) INC HL INC HL SLA (HL) DEC (HL) LD A,(BORDCR) CPL AND $38 OR $86 JR DISPC2 DISP01: CALL DISPALLOC CALL DISP01A DISPC1: LD A,$82 DISPC2: OUT ($FF),A RET DISP10: LD HL,$6000 LD DE,$5800 LD BC,$0100 LDIR INC B LD H,$68 LDIR INC B LD H,$70 LDIR CALL DISPFREE DISPC0: LD A,$80 JR DISPC2 DISP20: CALL DISPFREE LD HL,$5800 LD BC,$02FF CALL DISP2X JR DISPC0 DISP21: LD HL,$6000 LD BC,$17FF CALL DISP2X JR DISPC1 DISP2X: LD D,H LD A,(BORDCR) AND $38 LD E,A RRCA RRCA RRCA OUT ($FE),A XOR $07 OR E LD E,1 LD (BORDCR),A LD (HL),A LDIR RET DISP01A:LD HL,$5800 LD DE,$6000 CALL DISPATT CALL DISPATT DISPATT:LD A,8 LD B,L LD C,L DISPAL: INC B LDIR DEC H DEC A JR NZ,DISPAL INC H RET DISPALLOC: LD DE,(CHANS) LD HL,$7800 AND A SBC HL,DE EX DE,HL LD C,E LD B,D RST $30 DEFW L1655 ; MAKE-ROOM INC DE LD (CHANS),DE ; Copy straight line drawing LINE12: EQU $5D00 LD HL,L24B7 LD DE,LINE12 PUSH DE LD BC,L24F9 + 2 - L24B7 LDIR POP HL LD (HL),$F7 ; RST $30 ; Copy circle drawing CRCLE12:EQU $5E00 LD HL,DCRCLE LD DE,CRCLE12 LD BC,L2382 - DCRCLE LDIR EX DE,HL LD (HL),$C9 ; RET DEC HL DEC HL DEC HL LD (HL),$F7 ; RST $30 LD HL,CRCLE12 - DCRCLE + L233B LD (HL),$F7 ; RST $30 INC HL INC HL INC HL INC HL LD (HL),$F7 ; RST $30 ; Replace PLOT-SUB LD HL,PLOTSUB LD (LINE12 + L24EC + 3 - L24B7),HL LD (CRCLE12 + CIRCLE_PLOT + 1 - DCRCLE),HL RET DISPFREE: LD HL,(CHANS) LD DE,CHINFO RST $30 DEFW L19E5 ; RECLAIM-1 LD (CHANS),HL RET
12.109091
43
0.636637
e694f0fcc833d5ce478b6c9d51922703fa79a505
460
asm
Assembly
programs/oeis/241/A241271.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/241/A241271.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/241/A241271.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A241271: a(n) = 6*a(n-1) + 3*(2^(n-2)-1) for n > 2, a(0)=a(1)=a(2)=0. ; 0,0,0,3,27,183,1143,6951,41895,251751,1511271,9069159,54418023,326514279,1959097959,11754612327,70527723111,423166436967,2538998818407,15233993303655,91403960608359,548423765223015,3290542594483815,19743255573194343 mov $2,$0 lpb $2,1 lpb $5,1 mul $4,6 sub $4,1 add $1,$4 mov $5,$3 lpe trn $1,5 mul $1,2 sub $2,1 add $4,1 mov $5,$0 lpe div $1,60 mul $1,3
23
217
0.65
1ff4041d4de62c228f9650982e39504a45bc6ed0
22,032
asm
Assembly
Driver/Printer/DotMatrix/Escp2/escp2Graphics.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Printer/DotMatrix/Escp2/escp2Graphics.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Printer/DotMatrix/Escp2/escp2Graphics.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: Epson Escape P2 24-pin print driver FILE: escp2Graphics.asm AUTHOR: Dave Durran ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 3/1/90 Initial revision DESCRIPTION: This file contains most of the code to implement the escp2 print driver graphics mode support $Id: escp2Graphics.asm,v 1.1 97/04/18 11:54:23 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrintSwath %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Print a page-wide bitmap CALLED BY: GLOBAL PASS: bp - PState segment dx:si - Start of bitmap structure. RETURN: carry - set if some transmission error DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrintSwath proc far uses ax,cx,ds,bx,dx,si,di,ds bandSize local word push es ; save segreg mov es, bp ; es -> PState .enter ; save the bitmap pointer push si ;save source of bitmap. push dx ; ; load up the band width and height call PrLoadPstateVars ;set up the pstate band Vars. ;--------------------------------------------------------------------- ;Hack to get the spooler to build out 48 lines high, but the ESCP2 ;printer can only take 24 at a time. ;--------------------------------------------------------------------- ;begin hack cmp es:PS_mode,PM_GRAPHICS_HI_RES ;if in hires mode, jne endHack mov es:PS_bandHeight,HI_RES_BAND_HEIGHT ;send 24 bits high. endHack: ; restore the bitmap pointer pop ds ; ds:si -> bitmap pop si ; get width, and calculate byte width of bitmap mov ax,ds:[si][BM_width] add ax, 7 ; round up to next byte boundary and ax,0xfff8 mov es:[PS_bandWidth],ax ;load the dot width. mov cl,3 ;divide by 8.... shr ax,cl ;to obtain the byte width. mov es:[PS_bandBWidth],ax ; size and allocate a graphics data buffer call PrMakeGraphicBuffer ;allocate the print buffer. ; calculate size of band of data mov ax, es:[PS_bandBWidth] ; get byte width of data mul es:[PS_bandHeight] ; ax = size mov bandSize, ax ; save it for the loop ; calculate the #bands mov ax,ds:[si][BM_height] ;get the height of bitmap. clr dx ; dx:ax = divisor div es:[PS_bandHeight] ;get number of bands in this mov cx,ax ;swath for counter. ; dx has remainder of division ; this is the #scans ; adjust pointer to data test ds:[si][BM_type],mask BM_COMPLEX jz addSimple mov si, ds:[si].BM_data ; get offset to data bandLoop: jcxz printLastBand call PrPrintABand ;print a band from this swath. jc exitErr DoPush ax,dx,bp ; save band count mov ax,HI_RES_BAND_HEIGHT call AdjustForResolution ;get into 1/360" mov dx,ax mov bp, es ; bp -> PState call PrLineFeed ;send control code for hi res. DoPopRV ax,dx,bp jc exitErr add si, bandSize ;for the next starting index. loop bandLoop ; if any remainder, then we need to send it, plus a shorter ; line feed printLastBand: tst dx ; any remainder ? jz destroyBuffer call PrPrintABand ; print last band jc exitErr mov ax, dx ; amount to line feed (in hires) call AdjustForResolution ;get into 1/360" mov dx,ax sendLastLineFeed: push bp mov bp, es ; bp -> PState call PrLineFeed ; pop bp jc exitErr ; all done, kill the buffer and leave destroyBuffer: call PrDestroyGraphicBuffer ;get rid of print buffer space. clc ; no errors exit: .leave pop es ; restore es ret ; add overhead for simple bitmap addSimple: add si,size Bitmap ;add to index to get by info jmp bandLoop ; some transmission error. cleanup and exit. exitErr: call PrDestroyGraphicBuffer ;get rid of print buffer space. stc jmp exit PrintSwath endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrPrintABand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: PASS: ds:si = fptr to bitmap structure (pointer to data) es = PState segment RETURN: carry - set if some transmission error DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: In all the routines below this one, we assume the following in the registers: es - points to output buffer bp - points to PState ds:si - pointer into bitmap data (input buffer) REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrPrintABand proc near uses bx,cx,dx,ds,si,bp .enter ; rearrange segments so that ds -> PState and es -> our buffer mov bp, es ; bp -> PState mov cl, es:[PS_mode] ; get the mode while we still have PStae mov es, es:[PS_bufSeg] ; es -> our buffer call PrScanBuffer ;get the width of this buffer. tst dx ;see if there is anything to print. jz done ;just do line feed if not. cmp cl, PM_GRAPHICS_LOW_RES ;see if the lores bit is set. ja checkMedRes ;if anything other than low res or mov es:GB_columns,dx ;load the column count for printer. call PrPrintLoBuffer ;non scaling, skip to call hires rout. jmp done ; all done, send a line feed checkMedRes: EC< cmp cl,PM_GRAPHICS_HI_RES > EC< ERROR_A INVALID_MODE > call PrSendRasterGraphics ;must be hires graphics. done: mov es, bp ; es -> PState exit: .leave ret PrPrintABand endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrSendRasterGraphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Prints a Raster Graphics band. CALLED BY: PrPrintABand PASS: bx = number of bytes wide to print. dx = number of columns wide to print. ds:si = pointer into bitmap data bp = segment of PState PS_bandHeight = number of dots high to print. RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/01/90 Initial version Dave 03/20/90 combined some routines. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrSendRasterGraphics proc near uses ax,bx,cx,dx,si,di,es .enter mov es,bp ;es------>PState ;SEND GRAPHICS CONTROL CODE GOES HERE. push si mov si,offset cs:pr_codes_SetMedGraphics cmp es:PS_mode,PM_GRAPHICS_MED_RES je modeOK mov si,offset cs:pr_codes_SetHiGraphics modeOK: call SendCodeOut pop si mov cx,dx ;load cx, with the column count from PrScan.. jc exit ;pass any error out. call PrintStreamWriteByte jc exit ;pass any error out. mov cl,ch call PrintStreamWriteByte jc exit ;negate the bitmap. ; ds:si - input bitmap data source (beginning of bitmap) ; bx - number of leading zero bytes. push si ;save start of live print area. mov cx,es:PS_bandHeight ;number of lines to negate. negOuterLoop: DoPush cx,si,es mov cx,bx ;get live print width. segmov es,ds,di ;copy ds into es. mov di,si ;get source and destination to the same byte. negLoop: lodsb ;get data, not al ;invert data, stosb ;and put back in string. loop negLoop DoPopRV cx,si,es add si,es:PS_bandBWidth ;get to next line beginning of data. loop negOuterLoop pop si ;si --> start of live print area. ;send the negated bitmap out ; ds:si - input bitmap data source (beginning of live print area) mov es, bp ;get es --> PSTATE mov cx,es:PS_bandHeight ;number of lines to send. sendOuterLoop: DoPush cx,si mov cx,bx ;get live print width. call PrintStreamWrite ;send them out. DoPopRV cx,si jc exit add si,es:PS_bandBWidth ;get to next line beginning of data. loop sendOuterLoop ;------------------------------------------------------------------------------ ; Do not do vertical cursor movement for the start of next bitmap (swath) ;------------------------------------------------------------------------------ ; mov ax,es:PS_bandHeight ;adjust ax for the resolution, add it to the cursor position for next time. ; call AdjustForResolution ; mov dx,ax ; call PrLineFeed ;------------------------------------------------------------------------------ ; some transmission error. cleanup and exit exit: .leave ret PrSendRasterGraphics endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrSendRasterGraphicsOld %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Prints a Raster Graphics band. CALLED BY: PrPrintABand PASS: ds:si = pointer into bitmap data bp = segment of PState RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/01/90 Initial version Dave 03/20/90 combined some routines. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrSendRasterGraphicsOld proc near uses ax,bx,cx,dx,si,di,es .enter mov es,bp ;es------>PState ; ;------------------------------------------------------------------------------ ; scan the left to see where we can start sending stuff. ;------------------------------------------------------------------------------ clr dx ;init the live print width to zero. mov cx,es:PS_bandHeight ;use height as counter. push si forwardScanLoop: DoPush cx,es,ds segmov es,ds,di mov ds,bp ;direction is assumed to be forward. mov di,si ;load index for compare. mov al,0ffh ;compare inverted zero. mov cx,ds:PS_bandBWidth ;width of input bitmap (swath) repe scasb ;test the byte for "zero" jz aroundInc1 inc cx ;cx has # of non-zero bytes. aroundInc1: cmp cx,dx ;see if less than previous line. jle dxIsOK mov dx,cx ;if not, load dx (new width) dxIsOK: DoPopRV cx,es,ds add si,es:PS_bandBWidth ;add for the start of the next line. loop forwardScanLoop ;do # lines times. pop si ;dx now = # bytes to right of leading blank bytes. test dx,dx ;see if zero. jz exit ;done if no data. mov ax,es:PS_bandBWidth ;width of input bitmap (swath) mov es:PS_intWidth,dx ;save width of data. sub ax,dx ;get width of leading blank bytes. mov cl,3 ;x8 for bit width. sal ax,cl ;set the CAP to the correct place in X to start picture. call AdjustForResolution ;get into 1/360" call PrLinePos ;set the printhead there. carryStage: jc carryStage2 ;pass error out. ;------------------------------------------------------------------------------ ; scan the right to see where we can stop sending stuff. ;------------------------------------------------------------------------------ push si clr dx ;initialize the width to zero. mov cx,es:PS_bandHeight ;use height as counter. add si,es:PS_bandBWidth ;width of input bitmap (swath) dec si ;start from right side. std ;go backwards. backwardScanLoop: DoPush cx,es,ds segmov es,ds,di mov ds,bp ;direction is assumed to be forward. mov di,si ;load index for compare. mov al,0ffh ;compare inverted zero. mov cx,ds:PS_intWidth ;width of live data repe scasb ;test the byte for "zero" inc cx ;cx has # of non-zero bytes. ;there has to be at least 1. cmp cx,dx ;see if less than previous line. jle dxIsOTay mov dx,cx ;if not, load dx (new width) dxIsOTay: DoPopRV cx,es,ds add si,es:PS_bandBWidth ;add for the start of the next line. loop backwardScanLoop ;do # lines times. cld pop si ;dx now = # bytes of live print area. mov bx,es:PS_bandBWidth sub bx,es:PS_intWidth ;bx now = # of leading blank bytes. mov es:PS_intWidth,dx ;intWidth now = live print width. ;------------------------------------------------------------------------------ ; Send a bitmap (swath) ; dx - number of bytes wide to send. ; bx - number of leading zero bytes. ;------------------------------------------------------------------------------ ;send control code to send graphics. mov ax,dx mov cl,3 sal ax,cl ;8 bits/byte. mov cx,ax ;get in cx for counter later. ;SEND GRAPHICS CONTROL CODE GOES HERE. push si mov si,offset cs:pr_codes_SetMedGraphics cmp es:PS_mode,PM_GRAPHICS_MED_RES je modeOK mov si,offset cs:pr_codes_SetHiGraphics modeOK: call SendCodeOut pop si jc carryStage2 ;pass any error out. call PrintStreamWriteByte jc carryStage2 ;pass any error out. mov cl,ch call PrintStreamWriteByte carryStage2: jc exit ;negate the bitmap. ; ds:si - input bitmap data source (beginning of bitmap) ; bx - number of leading zero bytes. add si,bx ;get start of bitmap to start of live area. push si ;save start of live print area. mov cx,es:PS_bandHeight ;number of lines to negate. negOuterLoop: DoPush cx,si,es mov cx,es:PS_intWidth ;get live print width. segmov es,ds,di ;copy ds into es. mov di,si ;get source and destination to the same byte. negLoop: lodsb ;get data, not al ;invert data, stosb ;and put back in string. loop negLoop DoPopRV cx,si,es add si,es:PS_bandBWidth ;get to next line beginning of data. loop negOuterLoop pop si ;si --> start of live print area. ;send the negated bitmap out ; ds:si - input bitmap data source (beginning of live print area) mov es, bp ;get es --> PSTATE mov cx,es:PS_bandHeight ;number of lines to negate. sendOuterLoop: DoPush cx,si mov cx,es:PS_intWidth ;get live print width. call PrintStreamWrite ;send them out. DoPopRV cx,si jc exit add si,es:PS_bandBWidth ;get to next line beginning of data. loop sendOuterLoop ;------------------------------------------------------------------------------ ; Do not do vertical cursor movement for the start of next bitmap (swath) ;------------------------------------------------------------------------------ ; mov ax,es:PS_bandHeight ;adjust ax for the resolution, add it to the cursor position for next time. ; call AdjustForResolution ; mov dx,ax ; call PrLineFeed ;------------------------------------------------------------------------------ ; some transmission error. cleanup and exit exit: .leave ret PrSendRasterGraphicsOld endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AdjustForResolution %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: adjust ax from whatever resolution we're in to dots (1/360"). CALLED BY: GLOBAL PASS: es - PState segment ax - number to be adjusted. RETURN: ax adjusted for the resolution. DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AdjustForResolution proc near push cx mov cl,es:[PS_mode] EC< cmp cl,PM_GRAPHICS_HI_RES > EC< ERROR_A INVALID_MODE > cmp cl,PM_GRAPHICS_HI_RES je adjustedForRes sal ax,1 ;x2 dots for 180dpi cmp cl,PM_GRAPHICS_MED_RES je adjustedForRes mov cx,ax ;x2 + x4 for 60 dpi sal ax,1 add ax,cx adjustedForRes: pop cx ret AdjustForResolution endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrPrintLoBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Prints a lo resolution band. CALLED BY: PrPrintABand PASS: dx - number of columns to print. ds:si - pointer to bitmap data bp - PState segment es - output buffer RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 02/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrPrintLoBuffer proc near mov cx,ds ;save input seg. mov ds,bp ;get PSTATE seg. mov bx,ds:PS_bandBWidth ;and the total possible. mov ds,cx ;recover the input seg. mov cl,3 ;divide by 8 shr dx,cl sub bx,dx ;subtract number of full bytes wide ;from total bytes wide. ; loop on one 8-scan line high band of the input bitmap mov cl,LO_RES_BAND_HEIGHT ;8 scan lines high. xor ch,ch bandHeightLoop: push cx mov cx,dx ;get printed byte width. mov di,offset GB_printBuffer ; loop on one scan line width of the input bitmap scanLineLoop: push cx ;save the byte width. lodsb ;get a horizontal byte. not al ;switch 1s and 0s. xor ch,ch ; loop on a single byte of the input bitmap mov cl,8 scanByteLoop: rcl al,1 ;get a bit off the source byte. rcl {byte} es:[di],1 ;rotate into the output buffer. inc di ;point at next byte. loop scanByteLoop ;do 8 bytes. pop cx ;recover the byte width of scanline. loop scanLineLoop ;do Columns>>3 times. add si,bx ;add to get to beginning of next line. pop cx ;recover this count. loop bandHeightLoop ;do 8 scan lines. mov si,offset pr_codes_SetLoGraphics mov di,offset GB_printBuffer ;beginning of buffer. call PrOutPrintBuffer ;send this line. exit: ret PrPrintLoBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrOutPrintBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sends the output buffer to the port. tests the buffer again for blank trailing space. CALLED BY: PrPrintABand PASS: bp - PState segment si - pointer to set graphics control codes. di - pointer to the data to send. es - output buffer GB_columns - number of columns that we are going to print. RETURN: carry - set if some transmission error DESTROYED: ax,cx,si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrOutPrintBuffer proc near uses ax,bx,cx,di,es,ds .enter mov bx,di ;save the pointer to the beginning of the buffer. ;si must be preserved to this point. call SendCodeOut ;send the graphics controlcode. jc exit ;pass out any error. segmov ds,es,cx mov cx,es:GB_columns mov es, bp ;at this point cx should have the scanned column count. mov di,cx call PrintStreamWriteByte jc exit ;pass out any error. mov cl,ch ;get hi byte of data length call PrintStreamWriteByte jc exit ;pass out any error. mov cx,di ;buffer length. cmp es:[PS_mode],PM_GRAPHICS_LOW_RES ;see if lo res. printing. je cxOK ;if so, skip. shl cx,1 ;x2 add cx,di ;+1 = (x3) cxOK: mov si,bx ;recover the pointer to beginning. call PrintStreamWrite ;send them out. jc exit justreturn: mov es, bp mov cl,C_CR ;do carriage return call PrintStreamWriteByte ;send it out. exit: .leave ret PrOutPrintBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrMakeGraphicBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Looks at the PSTATE to find out what graphics resolution this document is printing at. The routine then allocates a chunk of memory for a output buffer for the graphic print routines. CALLED BY: StartPrint PASS: ds:si - Start of bitmap structure. es - Segment of PSTATE RETURN: PSTATE loaded with handle and segment of buffer DESTROYED: ax,bx,cx,si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrMakeGraphicBuffer proc near cmp es:PS_mode,PM_GRAPHICS_LOW_RES jne exit mov ax,es:[PS_bandWidth] ;get the x dimension of the bitmap. mov cl, es:[PS_byteColumn] ;get #bytes/column for band height clr ch mul cx ; ax = buffer size needed add ax,ADDITIONAL_BUFFER_BYTES ;add the column count word to size mov cx,ALLOC_DYNAMIC_NO_ERR_LOCK or mask HF_SHARABLE ;mem flags call MemAlloc ;allocate a buffer in memory. mov es:[PS_bufHan],bx ;store handle in PSTATE. mov es:[PS_bufSeg],ax ;store the segment in PSTATE. exit: ret PrMakeGraphicBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrDestroyGraphicBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get rid of the buffer space used for the print buffer. CALLED BY: PrintSwath PASS: es - Segment of PSTATE RETURN: nothing DESTROYED: bx,es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrDestroyGraphicBuffer proc near cmp es:PS_mode,PM_GRAPHICS_LOW_RES jne exit mov bx,es:[PS_bufHan] ;get handle from PSTATE. call MemFree ;discard the block of memory. exit: ret PrDestroyGraphicBuffer endp
26.835566
80
0.58701
6576dc4899af57d4e80b7734e3296101f037413f
586
asm
Assembly
oeis/083/A083086.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/083/A083086.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/083/A083086.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A083086: a(n) (2*2^n + (-4)^n)/3. ; 1,0,8,-16,96,-320,1408,-5376,22016,-87040,350208,-1396736,5595136,-22364160,89489408,-357892096,1431699456,-5726535680,22906667008,-91625619456,366504574976,-1466014105600,5864064811008,-23456242466816,93825003421696,-375299946577920,1501199920529408,-6004799413682176,24019198191599616,-96076791692656640,384307168918110208,-1537228671377473536,6148914694099828736,-24595658759219445760,98382635071237521408,-393530540216230608896,1574122161002361389056,-6296488643734567649280 mov $2,-2 pow $2,$0 gcd $1,$2 add $2,2 mul $1,$2 div $1,3 mov $0,$1
53.272727
480
0.807167
5157fe26de61113b9a4a13e82013e463667a3e44
243
asm
Assembly
programs/oeis/033/A033382.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/033/A033382.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/033/A033382.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A033382: [ 62/n ]. ; 62,31,20,15,12,10,8,7,6,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 add $0,1 mov $1,62 div $1,$0
34.714286
191
0.510288
bb50f1ca392b779cbd82672ebf46dc6369182a9a
4,619
asm
Assembly
SpriteVideo/main.asm
peteri/stm8ldiscovery
535f1fb5a8e21e2d120f46d6a996bf2f0a3b328b
[ "Unlicense" ]
null
null
null
SpriteVideo/main.asm
peteri/stm8ldiscovery
535f1fb5a8e21e2d120f46d6a996bf2f0a3b328b
[ "Unlicense" ]
null
null
null
SpriteVideo/main.asm
peteri/stm8ldiscovery
535f1fb5a8e21e2d120f46d6a996bf2f0a3b328b
[ "Unlicense" ]
null
null
null
stm8/ .tab 0,8,16,60 #include "mapping.inc" #include "constants.inc" #include "stm8l152c6.inc" #include "boardsetup.inc" #include "variables.inc" #include "videosync.inc" #include "linerender.inc" #include "demovideo.inc" stack_start.w EQU $stack_segment_start stack_end.w EQU $stack_segment_end segment 'rom' main.l ; initialize SP ldw X,#stack_end ldw SP,X ; clear stack ldw X,#stack_start clear_stack.l clr (X) incw X cpw X,#stack_end jrule clear_stack ; we have clear stack ; time for more setup call init_cpu ; speed up the cpu and turn on stuff call clear_memory ; Clear rest of ram call init_gpio ; setup the gpio pins call init_spi1 ; setup the SPI call init_dma ; setup dma channels call init_timers ; setup the timers. ; Lets do it rim ; interrupts on call demo_video infinite_loop.l jra infinite_loop ;============================================== ; Interrupt handler for DMA channel ; transaction complete. ;============================================== interrupt DMAChannel23Int DMAChannel23Int.l btjt DMA1_GCSR,#2,dmachan2 ;Channel2? ; Channel 3 DMA bres DMA1_C3CR,#0 ;turn off channel bres DMA1_C3SPR,#1 ;clear transcation completed ldw x,syncdma ;Current value to DMA src ldw DMA1_C3M0ARH,x ld a,#$80 ;How many bytes to transfer addw x,#$0100 ;Next buffer cpw x,#synccompend ;gone off end? jrule syncnowrap ld a,#$62 ;Only do $62 bytes ldw x,#synccomp ;Set us up wrapped for next syncnowrap ldw syncdma,x ld DMA1_C3NDTR,a ;128 or (625*2) mod 128 bset DMA1_C3CR,#0 ;turn back on channel iret ; Channel 2 DMA dmachan2 bres DMA1_C2SPR,#1 ;clear transaction completed iret ;============================================== ; Interrupt handler for timer 3 comparator ; Kicks off rendering the frame and outputting ; data for screen via SPI. ;============================================== interrupt Timer3CompareInt Timer3CompareInt.l mov TIM3_SR1,#%00000000 ;Clear frame interrupts mov TIM1_DER,#%00001100 ;Turn on CC3 DMA mov linenumber,#$00 renderloop ;Setup DMA and SPI ready for enable mov SPI1_ICR,#0 ;Turn of DMA TX mov DMA1_C2CR,#%00101000 ; Disable DMA mov DMA1_C2NDTR,#{ScrWidth+2} ; btjf linenumber,#0,oddline mov DMA1_C2M0ARL,#{low linebuffer1} ldw y,#linebuffer2 jra turnonDMA2 oddline mov DMA1_C2M0ARL,#{low linebuffer2} ldw y,#linebuffer1 turnonDMA2 mov DMA1_C2CR,#%00101001 ; Incrementing mem to periph ;save away the current scan line (0..640) ld a,TIM3_CNTRH ;Save current line counter ld xh,a ld a,TIM3_CNTRL ld xl,a ldw tim3cntr,x call renderline waitforcounterchange ld a,TIM3_CNTRH ;Read current line counter ld xh,a ld a,TIM3_CNTRL ld xl,a cpw x,tim3cntr ; Wait for line counter to change jreq waitforcounterchange inc linenumber ;Increment number of lines ld a,linenumber cp a,#{ScrLines + 2} jrule renderloop ;Not done yet mov SPI1_ICR,#0 ;Turn of DMA TX mov TIM1_DER,#%00000100 ;Turn off CC3 DMA mov DMA1_C2CR,#%00101000 ; Disable DMA ; call the demo 50Hz tick bcpl PC_ODR,#7 ;toggle led call demo_video_frame iret interrupt NonHandledInterrupt NonHandledInterrupt.l iret segment 'vectit' dc.l {$82000000+main} ; reset dc.l {$82000000+NonHandledInterrupt} ; trap dc.l {$82000000+NonHandledInterrupt} ; irq0 dc.l {$82000000+NonHandledInterrupt} ; irq1 dc.l {$82000000+NonHandledInterrupt} ; irq2 dc.l {$82000000+DMAChannel23Int} ; irq3 dc.l {$82000000+NonHandledInterrupt} ; irq4 dc.l {$82000000+NonHandledInterrupt} ; irq5 dc.l {$82000000+NonHandledInterrupt} ; irq6 dc.l {$82000000+NonHandledInterrupt} ; irq7 dc.l {$82000000+NonHandledInterrupt} ; irq8 dc.l {$82000000+NonHandledInterrupt} ; irq9 dc.l {$82000000+NonHandledInterrupt} ; irq10 dc.l {$82000000+NonHandledInterrupt} ; irq11 dc.l {$82000000+NonHandledInterrupt} ; irq12 dc.l {$82000000+NonHandledInterrupt} ; irq13 dc.l {$82000000+NonHandledInterrupt} ; irq14 dc.l {$82000000+NonHandledInterrupt} ; irq15 dc.l {$82000000+NonHandledInterrupt} ; irq16 dc.l {$82000000+NonHandledInterrupt} ; irq17 dc.l {$82000000+NonHandledInterrupt} ; irq18 dc.l {$82000000+NonHandledInterrupt} ; irq19 dc.l {$82000000+NonHandledInterrupt} ; irq20 dc.l {$82000000+NonHandledInterrupt} ; irq21 dc.l {$82000000+Timer3CompareInt} ; Timer 3 capture/compare dc.l {$82000000+NonHandledInterrupt} ; irq23 dc.l {$82000000+NonHandledInterrupt} ; irq24 dc.l {$82000000+NonHandledInterrupt} ; irq25 dc.l {$82000000+NonHandledInterrupt} ; irq26 dc.l {$82000000+NonHandledInterrupt} ; irq27 dc.l {$82000000+NonHandledInterrupt} ; irq28 dc.l {$82000000+NonHandledInterrupt} ; irq29 end
29.993506
60
0.721152
db92be4aeadf44cbf12359a18f7a11570162a3c9
790
asm
Assembly
unittests/arch/x86/insn/cyrix.asm
path64/assembler
32ade96bc087d3a3e015e03d69fa48c41a7071a6
[ "BSD-2-Clause" ]
1
2016-06-03T20:02:45.000Z
2016-06-03T20:02:45.000Z
unittests/arch/x86/insn/cyrix.asm
path64/assembler
32ade96bc087d3a3e015e03d69fa48c41a7071a6
[ "BSD-2-Clause" ]
null
null
null
unittests/arch/x86/insn/cyrix.asm
path64/assembler
32ade96bc087d3a3e015e03d69fa48c41a7071a6
[ "BSD-2-Clause" ]
null
null
null
[bits 32] svdc tword [2*eax+esi+12345678h],cs ; 0f 78 8c 46 78 56 34 12 svdc tword [2*eax+esi+12345678h],ds ; 0f 78 9c 46 78 56 34 12 svdc [2*eax+esi+12345678h],es ; 0f 78 84 46 78 56 34 12 rsdc cs,tword [2*eax+esi+12345678h] ; 0f 79 8c 46 78 56 34 12 rsdc ds,tword [2*eax+esi+12345678h] ; 0f 79 9c 46 78 56 34 12 rsdc es,[2*eax+esi+12345678h] ; 0f 79 84 46 78 56 34 12 wrshr eax ; 0f 37 c0 wrshr dword [4*edx+esi+12345678h] ; 0f 37 84 96 78 56 34 12 wrshr [4*edx+esi+12345678h] ; 0f 37 84 96 78 56 34 12 rdshr eax ; 0f 36 c0 rdshr dword [4*edx+esi+12345678h] ; 0f 36 84 96 78 56 34 12 rdshr [4*edx+esi+12345678h] ; 0f 36 84 96 78 56 34 12
43.888889
73
0.556962
314315d6af58e139716b58cf171ca8c4f72941ab
668
asm
Assembly
programs/oeis/013/A013777.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/013/A013777.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/013/A013777.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A013777: a(n) = 2^(4*n + 3). ; 8,128,2048,32768,524288,8388608,134217728,2147483648,34359738368,549755813888,8796093022208,140737488355328,2251799813685248,36028797018963968,576460752303423488,9223372036854775808,147573952589676412928,2361183241434822606848,37778931862957161709568,604462909807314587353088,9671406556917033397649408,154742504910672534362390528,2475880078570760549798248448,39614081257132168796771975168,633825300114114700748351602688,10141204801825835211973625643008,162259276829213363391578010288128,2596148429267413814265248164610048,41538374868278621028243970633760768,664613997892457936451903530140172288 mov $1,16 pow $1,$0 mul $1,8 mov $0,$1
83.5
596
0.896707
fefcae05195bf07a8cb1705ee745accf2aff9d06
7,317
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_7501_246.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_7501_246.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_7501_246.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 %r14 push %r15 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xa894, %rsi lea addresses_WC_ht+0x17094, %rdi clflush (%rsi) nop nop nop nop nop add %rdx, %rdx mov $108, %rcx rep movsw nop nop cmp $17228, %r10 lea addresses_WC_ht+0x1ab34, %rdx nop nop inc %r14 movb $0x61, (%rdx) nop nop nop sub %r14, %r14 lea addresses_UC_ht+0xc0f4, %r10 nop nop nop nop sub %r15, %r15 movw $0x6162, (%r10) nop nop nop nop nop xor $48389, %r14 lea addresses_WC_ht+0x16294, %rdx nop nop add %rsi, %rsi mov (%rdx), %rcx add $36151, %rsi lea addresses_A_ht+0x13a94, %rsi lea addresses_D_ht+0xd694, %rdi nop nop nop cmp $54716, %rbx mov $63, %rcx rep movsq sub %r15, %r15 lea addresses_WC_ht+0x13914, %rsi clflush (%rsi) and $23239, %rcx mov $0x6162636465666768, %rdx movq %rdx, %xmm7 vmovups %ymm7, (%rsi) nop nop nop nop nop add %rsi, %rsi lea addresses_D_ht+0x294, %rcx clflush (%rcx) nop nop nop nop and $49022, %r15 movw $0x6162, (%rcx) nop nop nop nop nop add $7402, %rcx lea addresses_normal_ht+0x12238, %rsi lea addresses_A_ht+0xdef0, %rdi nop nop cmp $34412, %r15 mov $41, %rcx rep movsl nop nop nop nop nop inc %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r8 push %rbp push %rbx push %rcx push %rdx // Store lea addresses_US+0x10d14, %rdx clflush (%rdx) nop nop nop nop nop sub %r8, %r8 movl $0x51525354, (%rdx) nop nop nop and %rdx, %rdx // Store mov $0x6371420000000714, %rdx nop nop nop nop nop and %rbp, %rbp mov $0x5152535455565758, %r8 movq %r8, %xmm5 movups %xmm5, (%rdx) // Exception!!! mov (0), %r12 nop nop xor $12952, %rdx // Load lea addresses_normal+0x11294, %r12 nop nop nop nop nop xor $44784, %rdx mov (%r12), %r13 nop nop nop nop dec %r8 // Store lea addresses_normal+0x1231a, %r8 inc %rcx mov $0x5152535455565758, %r12 movq %r12, %xmm7 movntdq %xmm7, (%r8) nop nop nop dec %rdx // Store lea addresses_US+0x1baf9, %r12 dec %rcx movw $0x5152, (%r12) nop nop cmp $31611, %rdx // Faulty Load lea addresses_WC+0x9a94, %rbx nop nop nop sub %rbp, %rbp mov (%rbx), %r13w lea oracles, %rbx and $0xff, %r13 shlq $12, %r13 mov (%rbx,%r13,1), %r13 pop %rdx pop %rcx pop %rbx pop %rbp pop %r8 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_NC', 'AVXalign': False, 'size': 16}} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 5, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 2}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}} {'00': 7501} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
31.675325
2,999
0.655597
a5cca0be7fa2227f8a06514f515a0c1e2a8c676b
625
asm
Assembly
oeis/098/A098021.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/098/A098021.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/098/A098021.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A098021: Positions of 0's in the zero-one sequence [nr+2r]-[nr]-[2r], where r=sqrt(2) and [ ]=floor; see A187967. ; 5,10,17,22,29,34,39,46,51,58,63,68,75,80,87,92,99,104,109,116,121,128,133,138,145,150,157,162,169,174,179,186,191,198,203,208,215,220,227,232,237,244,249,256,261,268,273,278,285,290,297,302,307,314,319,326,331,338,343,348,355,360,367,372,377,384,389,396,401,406,413,418,425,430,437,442,447,454,459,466,471,476,483,488,495,500,507,512,517,524,529,536,541,546,553,558,565,570,577,582 max $2,$0 mov $3,$0 seq $0,87057 ; Smallest number whose square is larger than 2*n^2. add $0,$2 mul $0,2 add $0,$3 add $0,1
56.818182
383
0.7008
ef0449d6b6cbf9c01f544926b927d2d7692df697
439
asm
Assembly
programs/oeis/024/A024925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/024/A024925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/024/A024925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A024925: Sum of remainders of n mod prime(k), for k = 1,2,3,...,n. ; 1,2,4,9,13,19,25,38,52,64,74,92,104,122,143,172,188,218,236,268,299,329,351,393,437,473,523,569,597,646,676,737,788,836,893,959,995,1049,1110,1182,1222,1293,1335,1409,1490,1556,1602,1692,1782,1874,1955,2043,2095,2197,2290 lpb $0 add $1,$0 mov $2,$0 sub $0,1 seq $2,76694 ; a(n) = n - sum of the distinct prime factors of n. add $1,$2 lpe add $1,1 mov $0,$1
33.769231
223
0.658314
39fe5f70b73527c66076499cc5d55f37621236fd
5,125
asm
Assembly
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_816.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_0xca.log_21829_816.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_0xca.log_21829_816.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0x1dee2, %rsi lea addresses_UC_ht+0x15f6, %rdi nop nop nop nop xor $64565, %r15 mov $58, %rcx rep movsl nop nop cmp %r12, %r12 lea addresses_D_ht+0xf7b8, %r8 nop nop nop nop nop add %rsi, %rsi movb (%r8), %r15b nop nop sub $40548, %r15 lea addresses_WC_ht+0x18a53, %rcx nop dec %rax movw $0x6162, (%rcx) nop nop nop inc %r15 lea addresses_UC_ht+0xd0b6, %rcx nop nop nop nop cmp $26847, %r15 mov $0x6162636465666768, %rsi movq %rsi, %xmm4 vmovups %ymm4, (%rcx) nop add %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r8 push %rax push %rbx push %rcx push %rdx // Store lea addresses_normal+0x7c56, %rdx inc %rax movw $0x5152, (%rdx) nop nop dec %r14 // Faulty Load lea addresses_US+0x18716, %r8 add $5735, %rbx vmovups (%r8), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %rax lea oracles, %rdx and $0xff, %rax shlq $12, %rax mov (%rdx,%rax,1), %rax pop %rdx pop %rcx pop %rbx pop %rax pop %r8 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
45.353982
2,999
0.659707