Datasets:

Modalities:
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
Dask
License:
source
stringclasses
1 value
id
stringlengths
40
40
language
stringclasses
2 values
date
stringclasses
1 value
author
stringclasses
1 value
url
stringclasses
1 value
title
stringclasses
1 value
extra
stringlengths
528
1.53k
quality_signals
stringlengths
139
178
text
stringlengths
6
1.05M
TheStack
3a7ff00f2df847ac9c37afa81dea24afa8736a61
Assemblycode:Assembly
{"size": 271, "ext": "asm", "max_stars_repo_path": "libsrc/strings/rindex.asm", "max_stars_repo_name": "grancier/z180", "max_stars_repo_stars_event_min_datetime": "2017-01-18T12:02:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-12T09:40:28.000Z", "max_issues_repo_path": "libsrc/strings/rindex.asm", "max_issues_repo_name": "grancier/z180", "max_issues_repo_issues_event_min_datetime": "2017-03-06T07:41:56.000Z", "max_issues_repo_issues_event_max_datetime": "2017-03-06T07:41:56.000Z", "max_forks_repo_path": "libsrc/strings/rindex.asm", "max_forks_repo_name": "RC2014Z80/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-03-07T03:19:40.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-15T17:59:19.000Z"}
{"max_stars_count": 8, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 13.55, "max_line_length": 45, "alphanum_fraction": 0.7564575646}
; CALLER linkage for function pointers SECTION code_clib PUBLIC rindex PUBLIC _rindex EXTERN strrchr_callee EXTERN ASMDISP_STRRCHR_CALLEE .rindex ._rindex pop hl pop bc pop de push de push bc push hl jp strrchr_callee + ASMDISP_STRRCHR_CALLEE
TheStack
d76dca06c9026aab14553230eaba741d6c854c9b
Assemblycode:Assembly
{"size": 471, "ext": "asm", "max_stars_repo_path": "oeis/176/A176213.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/176/A176213.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/176/A176213.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 18.84, "max_line_length": 201, "alphanum_fraction": 0.5307855626}
; A176213: Decimal expansion of 2+sqrt(6). ; Submitted by Jon Maiga ; 4,4,4,9,4,8,9,7,4,2,7,8,3,1,7,8,0,9,8,1,9,7,2,8,4,0,7,4,7,0,5,8,9,1,3,9,1,9,6,5,9,4,7,4,8,0,6,5,6,6,7,0,1,2,8,4,3,2,6,9,2,5,6,7,2,5,0,9,6,0,3,7,7,4,5,7,3,1,5,0,2,6,5,3,9,8,5,9,4,3,3,1,0,4,6,4,0,2,3,4 mov $2,4 mov $3,$0 mul $3,4 mov $5,56 lpb $3 add $1,$5 mov $5,$1 add $5,$2 mov $2,$1 mul $1,2 sub $3,1 mul $5,2 lpe add $1,$5 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
TheStack
900b0d26e496e01e442a6f0421212991ad19fd39
Assemblycode:Assembly
{"size": 794, "ext": "asm", "max_stars_repo_path": "oeis/141/A141974.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/141/A141974.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/141/A141974.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 36.0909090909, "max_line_length": 486, "alphanum_fraction": 0.7166246851}
; A141974: Primes congruent to 23 mod 28. ; Submitted by Jon Maiga ; 23,79,107,163,191,331,359,443,499,751,863,919,947,1031,1087,1171,1283,1367,1423,1451,1619,1759,1787,1871,2011,2039,2179,2207,2347,2459,2543,2683,2711,2767,2851,2879,2963,3019,3187,3271,3299,3467,3607,3691,3719,3803,3943,4027,4111,4139,4363,4391,4447,4643,4783,4951,5119,5147,5231,5399,5483,5623,5651,5791,5903,5987,6043,6211,6323,6379,6491,6547,6659,6827,6883,6911,6967,7079,7219,7247,7331,7499,7583,7639,7723,7919,8059,8087,8171,8311,8423,8563,8647,8731,9011,9067,9151,9319,9403,9431 mov $2,$0 add $2,6 pow $2,2 mov $4,22 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,28 lpe mov $0,$4 add $0,1
TheStack
2f27f192ea51831ed5cbaec6059195d389b87cf9
Assemblycode:Assembly
{"size": 3967, "ext": "asm", "max_stars_repo_path": "buildTools/win32-x64/gbdk/libc/reverse.asm", "max_stars_repo_name": "asiekierka/gb-studio", "max_stars_repo_stars_event_min_datetime": "2019-04-17T14:58:27.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T08:41:22.000Z", "max_issues_repo_path": "buildTools/win32-x64/gbdk/libc/reverse.asm", "max_issues_repo_name": "asiekierka/gb-studio", "max_issues_repo_issues_event_min_datetime": "2019-04-18T18:57:48.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T19:42:20.000Z", "max_forks_repo_path": "buildTools/win32-x64/gbdk/libc/reverse.asm", "max_forks_repo_name": "asiekierka/gb-studio", "max_forks_repo_forks_event_min_datetime": "2019-04-18T18:10:50.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T21:30:57.000Z"}
{"max_stars_count": 6433, "max_issues_count": 878, "max_forks_count": 440, "avg_line_length": 21.2139037433, "max_line_length": 69, "alphanum_fraction": 0.4373582052}
;-------------------------------------------------------- ; File Created by SDCC : FreeWare ANSI-C Compiler ; Version 2.3.1 Wed Sep 04 21:56:18 2019 ;-------------------------------------------------------- .module reverse ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _reverse ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area _DATA ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- .area _OVERLAY ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area _ISEG ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area _BSEG ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area _XSEG ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area _GSINIT .area _GSFINAL .area _GSINIT ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area _HOME .area _CODE ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area _CODE ; reverse.c 5 ; genLabel ; genFunction ; --------------------------------- ; Function reverse ; --------------------------------- ___reverse_start: _reverse: lda sp,-5(sp) ; reverse.c 11 ; genIpush ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 ; AOP_STK for lda hl,7(sp) ld a,(hl+) ld h,(hl) ld l,a push hl ; genCall call _strlen ld b,d ld c,e lda sp,2(sp) ; genMinus dec bc ; genCast ; Removed redundent load ; reverse.c 12 ; genAssign ; AOP_STK for _reverse_i_1_1 lda hl,4(sp) ld (hl),#0x00 ; genAssign ; AOP_STK for _reverse_j_1_1 dec hl ld (hl),c ; genLabel 00101$: ; genCmpLt ; AOP_STK for _reverse_i_1_1 ; AOP_STK for _reverse_j_1_1 lda hl,4(sp) ld a,(hl) dec hl sub a,(hl) jp nc,00103$ ; reverse.c 13 ; genPlus ; AOP_STK for ; AOP_STK for _reverse_i_1_1 ; AOP_STK for _reverse_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way lda hl,7(sp) ld e,(hl) inc hl ld d,(hl) lda hl,4(sp) ld l,(hl) ld h,#0x00 add hl,de ld a,l ld d,h lda hl,0(sp) ; genPointerGet ; AOP_STK for _reverse_sloc0_1_0 ld (hl+),a ld (hl),d ld e,a ld a,(de) ld c,a ; genAssign ; AOP_STK for _reverse_c_1_1 inc hl ld (hl),c ; reverse.c 14 ; genPlus ; AOP_STK for ; AOP_STK for _reverse_j_1_1 ; Can't optimise plus by inc, falling back to the normal way lda hl,7(sp) ld e,(hl) inc hl ld d,(hl) lda hl,3(sp) ld l,(hl) ld h,#0x00 add hl,de ld c,l ld b,h ; genPointerGet ld a,(bc) ; genAssign (pointer) ; AOP_STK for _reverse_sloc0_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld (de),a ; reverse.c 15 ; genAssign (pointer) ; AOP_STK for _reverse_c_1_1 inc hl ld a,(hl) ld (bc),a ; reverse.c 16 ; genPlus ; AOP_STK for _reverse_i_1_1 ; genPlusIncr inc hl inc hl inc (hl) ; reverse.c 17 ; genMinus ; AOP_STK for _reverse_j_1_1 dec hl dec (hl) ; genGoto jp 00101$ ; genLabel 00103$: ; reverse.c 19 ; genRet ; AOP_STK for lda hl,7(sp) ld e,(hl) inc hl ld d,(hl) ; genLabel 00104$: ; genEndFunction lda sp,5(sp) ret ___reverse_end: .area _CODE
TheStack
bfebca80ad9e33117cd51d822b17c4b5c5d04c0c
Assemblycode:Assembly
{"size": 269, "ext": "asm", "max_stars_repo_path": "mc-sema/validator/x86_64/tests/FBLD.asm", "max_stars_repo_name": "randolphwong/mcsema", "max_stars_repo_stars_event_min_datetime": "2021-08-07T16:21:29.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-17T10:58:37.000Z", "max_issues_repo_path": "mc-sema/validator/x86_64/tests/FBLD.asm", "max_issues_repo_name": "randolphwong/mcsema", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "mc-sema/validator/x86_64/tests/FBLD.asm", "max_forks_repo_name": "randolphwong/mcsema", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.8125, "max_line_length": 30, "alphanum_fraction": 0.7881040892}
BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ;TEST_BEGIN_RECORDING lea rdi, [rsp-0x10] mov dword [rdi], 0x12345678 mov dword [rdi+04], 0x12345678 mov dword [rdi+08], 0x00001234 FBLD tword [rdi] mov edi, 0 ;TEST_END_RECORDING
TheStack
9086dea7203608990e748357372925eb4a1a50c3
Assemblycode:Assembly
{"size": 237, "ext": "asm", "max_stars_repo_path": "libsrc/gfx/common/cclg.asm", "max_stars_repo_name": "ahjelm/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/gfx/common/cclg.asm", "max_issues_repo_name": "C-Chads/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/gfx/common/cclg.asm", "max_forks_repo_name": "C-Chads/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"}
{"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 10.7727272727, "max_line_length": 31, "alphanum_fraction": 0.5358649789}
; ; Colour graphics routines ; ; cls () -- clear screen ; ; Stefano Bodrato - 2018 ; ; ; $Id: cclg.asm $ ; SECTION code_graphics PUBLIC cclg PUBLIC _cclg EXTERN clg .cclg ._cclg jp clg
TheStack
d34da9eeaa98d55ffc4e50b97e9fd9dcce4db933
Assemblycode:Assembly
{"size": 5093, "ext": "asm", "max_stars_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2908.asm", "max_stars_repo_name": "ljhsiun2/medusa", "max_stars_repo_stars_event_min_datetime": "2020-08-13T19:41:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:22:51.000Z", "max_issues_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2908.asm", "max_issues_repo_name": "ljhsiun2/medusa", "max_issues_repo_issues_event_min_datetime": "2021-04-29T06:29:35.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-13T21:02:30.000Z", "max_forks_repo_path": "Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2908.asm", "max_forks_repo_name": "ljhsiun2/medusa", "max_forks_repo_forks_event_min_datetime": "2020-07-14T17:07:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T01:12:22.000Z"}
{"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 43.9051724138, "max_line_length": 2999, "alphanum_fraction": 0.6614961712}
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xfc17, %rsi lea addresses_normal_ht+0x16e2f, %rdi nop nop nop nop dec %r10 mov $1, %rcx rep movsw mfence lea addresses_D_ht+0x129ff, %rdx sub $32043, %r13 mov (%rdx), %rcx nop nop nop nop nop inc %rsi lea addresses_normal_ht+0x14e7f, %rdx nop nop nop nop add %r10, %r10 movb $0x61, (%rdx) nop nop dec %rcx lea addresses_WC_ht+0x12f2b, %rdx nop nop nop xor %rdi, %rdi movw $0x6162, (%rdx) nop nop nop nop sub $30459, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %rax push %rbp push %rdx push %rsi // Store lea addresses_normal+0x1d67f, %r11 clflush (%r11) nop nop dec %r10 movl $0x51525354, (%r11) nop nop nop cmp $48320, %rax // Faulty Load lea addresses_RW+0xa67f, %rdx nop nop nop nop add $24736, %rbp movups (%rdx), %xmm1 vpextrq $0, %xmm1, %rax lea oracles, %rdx and $0xff, %rax shlq $12, %rax mov (%rdx,%rax,1), %rax pop %rsi pop %rdx pop %rbp pop %rax pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': True, 'NT': True}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
TheStack
f90db332e1912816e7b2d946adc741dbd4795343
Assemblycode:Assembly
{"size": 1215, "ext": "asm", "max_stars_repo_path": "Testcases/Own Testcases/sum_sq/sum_sq20.asm", "max_stars_repo_name": "swapnil96/Cache_simulator", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Testcases/Own Testcases/sum_sq/sum_sq20.asm", "max_issues_repo_name": "swapnil96/Cache_simulator", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Testcases/Own Testcases/sum_sq/sum_sq20.asm", "max_forks_repo_name": "swapnil96/Cache_simulator", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.8181818182, "max_line_length": 73, "alphanum_fraction": 0.4502057613}
lui $1, 0x00000000 ori $t4,$1,0x00000014 # t4(Input register) is initialized to 10. and $t0, $0, $0 # i = 0 lui $1, 0x00001001 # Address of a ori $t1,$1,0x00000010 loop1: sll $t2, $t0, 2 # byte offset for ith element add $t2, $t2, $t1 # address of a[i] sw $t0, 0($t2) # put i into a[i] addi $t0, $t0, 1 # increment i slt $t5, $t0, $t4 # is $t0 < $t4 ? bne $t5, $0, loop1 # branch if so # Sum the array values and $s0, $0, $0 # sum = 0, Result Register and $t0, $0, $0 # i = 0 add $t2, $t1, $0 # address of a[i] loop2: lw $t3, 0($t2) # load a[i] mult $t3, $t3 # multiply a[i] with a[i] mflo $t3 # move product to $t3 add $s0, $s0, $t3 # increment sum addi $t0, $t0, 1 # increment i addi $t2, $t2, 4 # increment address of a[i] slt $t5, $t0, $t4 # is $t0 < $t4 ? bne $t5, $0, loop2 # branch if so # Output Sum li $v0, 1 # Load 1=print_int into $v0 add $a0, $s0, $zero # Load first number into $a0 jr $ra
TheStack
0cedde06287f35085eb8846a6b7a35c69fa2ed1f
Assemblycode:Assembly
{"size": 6524, "ext": "asm", "max_stars_repo_path": "src/test/ref/examples/cx16/cx16-rasterbars.asm", "max_stars_repo_name": "jbrandwood/kickc", "max_stars_repo_stars_event_min_datetime": "2022-03-01T02:21:14.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-01T04:33:35.000Z", "max_issues_repo_path": "src/test/ref/examples/cx16/cx16-rasterbars.asm", "max_issues_repo_name": "jbrandwood/kickc", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/test/ref/examples/cx16/cx16-rasterbars.asm", "max_forks_repo_name": "jbrandwood/kickc", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.134751773, "max_line_length": 171, "alphanum_fraction": 0.5889025138}
// Example program for the Commander X16 // Displays raster bars in the border .cpu _65c02 // Commodore 64 PRG executable file .file [name="cx16-rasterbars.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(__start) .const VERA_DCSEL = 2 .const VERA_LINE = 2 .const SIZEOF_CHAR = 1 /// $9F25 CTRL Control /// Bit 7: Reset /// Bit 1: DCSEL /// Bit 2: ADDRSEL .label VERA_CTRL = $9f25 /// $9F26 IEN Interrupt Enable /// Bit 7: IRQ line (8) /// Bit 3: AFLOW /// Bit 2: SPRCOL /// Bit 1: LINE /// Bit 0: VSYNC .label VERA_IEN = $9f26 /// $9F27 ISR Interrupt Status /// Interrupts will be generated for the interrupt sources set in the lower 4 bits of IEN. ISR will indicate the interrupts that have occurred. /// Writing a 1 to one of the lower 3 bits in ISR will clear that interrupt status. AFLOW can only be cleared by filling the audio FIFO for at least 1/4. /// Bit 4-7: Sprite Collisions. This field indicates which groups of sprites have collided. /// Bit 3: AFLOW /// Bit 2: SPRCOL /// Bit 1: LINE /// Bit 0: VSYNC .label VERA_ISR = $9f27 /// $9F28 IRQLINE_L IRQ line (7:0) /// IRQ_LINE specifies at which line the LINE interrupt will be generated. /// Note that bit 8 of this value is present in the IEN register. /// For interlaced modes the interrupt will be generated each field and the bit 0 of IRQ_LINE is ignored. .label VERA_IRQLINE_L = $9f28 /// $9F2C DC_BORDER (DCSEL=0) Border Color .label VERA_DC_BORDER = $9f2c /// $9F29 DC_HSTART (DCSEL=1) Active Display H-Start (9:2) .label VERA_DC_HSTART = $9f29 /// $9F2A DC_HSTOP (DCSEL=1) Active Display H-Stop (9:2) .label VERA_DC_HSTOP = $9f2a /// $9F2B DC_VSTART (DCSEL=1) Active Display V-Start (8:1) .label VERA_DC_VSTART = $9f2b /// $9F2C DC_VSTOP (DCSEL=1) Active Display V-Stop (8:1) .label VERA_DC_VSTOP = $9f2c /// $0314 (RAM) IRQ vector - The vector used when the KERNAL serves IRQ interrupts .label KERNEL_IRQ = $314 // The horizontal start .label hstart = 6 // The horizontal stop .label hstop = 7 // The vertical start .label vstart = 8 // The vertical stop .label vstop = 9 // The countdown .label cnt = 5 // The sin idx .label sin_idx = $a .segment Code __start: { // volatile char hstart = 0/4 lda #0 sta.z hstart // volatile char hstop = 640/4 lda #$280/4 sta.z hstop // volatile char vstart = 0/2 lda #0 sta.z vstart // volatile char vstop = 480/2 lda #$1e0/2 sta.z vstop // volatile char cnt = 2 lda #2 sta.z cnt // volatile char sin_idx = 100 lda #$64 sta.z sin_idx jsr main rts } // LINE Interrupt Routine irq_line: { .label idx = 4 .label bar = 2 // *VERA_CTRL |= VERA_DCSEL // Update the border lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_HSTART = hstart lda.z hstart sta VERA_DC_HSTART // *VERA_DC_HSTOP = hstop lda.z hstop sta VERA_DC_HSTOP // *VERA_DC_VSTART = vstart lda.z vstart sta VERA_DC_VSTART // *VERA_DC_VSTOP = vstop lda.z vstop sta VERA_DC_VSTOP // *VERA_CTRL &= ~VERA_DCSEL // Show color raster bars in the border lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL ldx #0 __b2: // for(char l=0;l!=230;l++) cpx #$e6 bne __b3 // if(--cnt==0) dec.z cnt lda.z cnt bne __b1 // cnt = 2 lda #2 sta.z cnt // if(hstart<=320/4) lda.z hstart cmp #$140/4+1 bcs __b1 // hstart++; inc.z hstart // hstop--; dec.z hstop // vstart++; inc.z vstart // vstop--; dec.z vstop __b1: // memset(BARS, 0, sizeof(BARS)) // Animate the bars jsr memset // char idx = sin_idx-- lda.z sin_idx sta.z idx dec.z sin_idx ldx #0 __b13: // for(char b=0;b<8;b++) cpx #8 bcc __b14 // *VERA_ISR = VERA_LINE // Reset the LINE interrupt lda #VERA_LINE sta VERA_ISR // } jmp $e049 __b14: // char * bar = BARS + SIN[idx] ldy.z idx lda SIN,y clc adc #<BARS sta.z bar lda #>BARS adc #0 sta.z bar+1 ldy #0 __b16: // for(char i=0;i<sizeof(BAR);i++) cpy #$20*SIZEOF_CHAR bcc __b17 // idx += 13 lda #$d clc adc.z idx sta.z idx // for(char b=0;b<8;b++) inx jmp __b13 __b17: // bar[i] = BAR[i] lda BAR,y sta (bar),y // for(char i=0;i<sizeof(BAR);i++) iny jmp __b16 __b3: // *VERA_DC_BORDER = BARS[l] lda BARS,x sta VERA_DC_BORDER lda #0 __b5: // for(char i=0;i<24;i++) cmp #$18 bcc __b6 // *VERA_DC_BORDER = 0 // Wait exactly long enough to go to the next raster line lda #0 sta VERA_DC_BORDER __b8: // for(char i=0;i<23;i++) cmp #$17 bcc __b9 // asm // Wait exactly long enough to go to the next raster line nop nop // for(char l=0;l!=230;l++) inx jmp __b2 __b9: // for(char i=0;i<23;i++) inc jmp __b8 __b6: // for(char i=0;i<24;i++) inc jmp __b5 } main: { // asm sei // *KERNEL_IRQ = &irq_line lda #<irq_line sta KERNEL_IRQ lda #>irq_line sta KERNEL_IRQ+1 // *VERA_IEN = VERA_LINE lda #VERA_LINE sta VERA_IEN // *VERA_IRQLINE_L = 5 lda #5 sta VERA_IRQLINE_L // asm cli __b1: jmp __b1 } // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // void * memset(void *str, char c, unsigned int num) memset: { .const num = $e6*SIZEOF_CHAR .const c = 0 .label str = BARS .label end = str+num .label dst = 2 lda #<str sta.z dst lda #>str sta.z dst+1 __b1: // for(char* dst = str; dst!=end; dst++) lda.z dst+1 cmp #>end bne __b2 lda.z dst cmp #<end bne __b2 // } rts __b2: // *dst = c lda #c ldy #0 sta (dst),y // for(char* dst = str; dst!=end; dst++) inc.z dst bne !+ inc.z dst+1 !: jmp __b1 } .segment Data .align $100 SIN: .fill 256, 99+99*sin(i*2*PI/256) .align $100 BARS: .fill $e6, 0 .align $100 BAR: .byte $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1a, $1b, $1c, $1d, $1e, $1f, $1f, $1e, $1d, $1c, $1b, $1a, $19, $18, $17, $16, $15, $14, $13, $12, $11, $10
TheStack
8aa31d160c1801f247f038ae3fcdb58140c449c3
Assemblycode:Assembly
{"size": 1039, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm", "max_stars_repo_name": "jpoikela/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm", "max_issues_repo_name": "jpoikela/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/math/integer/small/l_small_divu_64_64x8.asm", "max_forks_repo_name": "jpoikela/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"}
{"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 13.6710526316, "max_line_length": 43, "alphanum_fraction": 0.5553416747}
; 2016 aralbrec SECTION code_clib SECTION code_math PUBLIC l_small_divu_64_64x8 PUBLIC l0_small_divu_64_64x8 EXTERN error_llmc, error_divide_by_zero_mc l_small_divu_64_64x8: ; unsigned division of a 64-bit number ; by an 8-bit number ; ; enter : dehl'dehl = 64-bit dividend ; c = 8-bit divisor ; ; exit : success ; ; dehl'dehl = 64-bit quotient ; a = remainder ; carry reset ; ; divide by zero ; ; dehl'dehl = ULLONG_MAX ; (dividend is lost) ; carry set, errno = EDOM ; ; uses : af, b, de, hl, de', hl' ld a,c or a jr z, divide_by_zero l0_small_divu_64_64x8: xor a ld b,64 loop_11: add hl,hl rl e rl d exx adc hl,hl rl e rl d exx rla jr c, loop_02 cp c jr c, loop_03 loop_02: sub c inc l loop_03: djnz loop_11 or a ret divide_by_zero: call error_llmc jp error_divide_by_zero_mc
TheStack
5e586cf9a8d440f37d3ca53023b0fa6153a62496
Assemblycode:Assembly
{"size": 659, "ext": "asm", "max_stars_repo_path": "oeis/102/A102370.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/102/A102370.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/102/A102370.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 29.9545454545, "max_line_length": 300, "alphanum_fraction": 0.6494688923}
; A102370: "Sloping binary numbers": write numbers in binary under each other (right-justified), read diagonals in upward direction, convert to decimal. ; Submitted by Christian Krause ; 0,3,6,5,4,15,10,9,8,11,14,13,28,23,18,17,16,19,22,21,20,31,26,25,24,27,30,61,44,39,34,33,32,35,38,37,36,47,42,41,40,43,46,45,60,55,50,49,48,51,54,53,52,63,58,57,56,59,126,93,76,71,66,65,64,67,70,69,68,79,74,73,72,75,78,77,92,87,82,81,80,83,86,85,84,95,90,89,88,91,94,125,108,103,98,97,96,99,102,101 add $0,1 mov $1,$0 mov $2,$0 mov $4,1 lpb $2 mul $4,2 mov $3,$4 mov $5,$0 add $0,1 mod $5,$4 cmp $5,0 mul $3,$5 add $1,$3 div $2,2 lpe mov $0,$1 sub $0,1
TheStack
c5b4688b2e3e8b4ddf027cc1f70fb0b039041469
Assemblycode:Assembly
{"size": 57166, "ext": "asm", "max_stars_repo_path": "grep.asm", "max_stars_repo_name": "Tookerton21/Xv6_OS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "grep.asm", "max_issues_repo_name": "Tookerton21/Xv6_OS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "grep.asm", "max_forks_repo_name": "Tookerton21/Xv6_OS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.0281862745, "max_line_length": 63, "alphanum_fraction": 0.4238358465}
_grep: file format elf32-i386 Disassembly of section .text: 00000000 <grep>: char buf[1024]; int match(char*, char*); void grep(char *pattern, int fd) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 18 sub $0x18,%esp int n, m; char *p, *q; m = 0; 6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ d: e9 b6 00 00 00 jmp c8 <grep+0xc8> m += n; 12: 8b 45 ec mov -0x14(%ebp),%eax 15: 01 45 f4 add %eax,-0xc(%ebp) buf[m] = '\0'; 18: 8b 45 f4 mov -0xc(%ebp),%eax 1b: 05 80 0e 00 00 add $0xe80,%eax 20: c6 00 00 movb $0x0,(%eax) p = buf; 23: c7 45 f0 80 0e 00 00 movl $0xe80,-0x10(%ebp) while((q = strchr(p, '\n')) != 0){ 2a: eb 4a jmp 76 <grep+0x76> *q = 0; 2c: 8b 45 e8 mov -0x18(%ebp),%eax 2f: c6 00 00 movb $0x0,(%eax) if(match(pattern, p)){ 32: 83 ec 08 sub $0x8,%esp 35: ff 75 f0 pushl -0x10(%ebp) 38: ff 75 08 pushl 0x8(%ebp) 3b: e8 9a 01 00 00 call 1da <match> 40: 83 c4 10 add $0x10,%esp 43: 85 c0 test %eax,%eax 45: 74 26 je 6d <grep+0x6d> *q = '\n'; 47: 8b 45 e8 mov -0x18(%ebp),%eax 4a: c6 00 0a movb $0xa,(%eax) write(1, p, q+1 - p); 4d: 8b 45 e8 mov -0x18(%ebp),%eax 50: 83 c0 01 add $0x1,%eax 53: 89 c2 mov %eax,%edx 55: 8b 45 f0 mov -0x10(%ebp),%eax 58: 29 c2 sub %eax,%edx 5a: 89 d0 mov %edx,%eax 5c: 83 ec 04 sub $0x4,%esp 5f: 50 push %eax 60: ff 75 f0 pushl -0x10(%ebp) 63: 6a 01 push $0x1 65: e8 88 05 00 00 call 5f2 <write> 6a: 83 c4 10 add $0x10,%esp } p = q+1; 6d: 8b 45 e8 mov -0x18(%ebp),%eax 70: 83 c0 01 add $0x1,%eax 73: 89 45 f0 mov %eax,-0x10(%ebp) m = 0; while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ m += n; buf[m] = '\0'; p = buf; while((q = strchr(p, '\n')) != 0){ 76: 83 ec 08 sub $0x8,%esp 79: 6a 0a push $0xa 7b: ff 75 f0 pushl -0x10(%ebp) 7e: e8 89 03 00 00 call 40c <strchr> 83: 83 c4 10 add $0x10,%esp 86: 89 45 e8 mov %eax,-0x18(%ebp) 89: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) 8d: 75 9d jne 2c <grep+0x2c> *q = '\n'; write(1, p, q+1 - p); } p = q+1; } if(p == buf) 8f: 81 7d f0 80 0e 00 00 cmpl $0xe80,-0x10(%ebp) 96: 75 07 jne 9f <grep+0x9f> m = 0; 98: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) if(m > 0){ 9f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) a3: 7e 23 jle c8 <grep+0xc8> m -= p - buf; a5: 8b 45 f0 mov -0x10(%ebp),%eax a8: ba 80 0e 00 00 mov $0xe80,%edx ad: 29 d0 sub %edx,%eax af: 29 45 f4 sub %eax,-0xc(%ebp) memmove(buf, p, m); b2: 83 ec 04 sub $0x4,%esp b5: ff 75 f4 pushl -0xc(%ebp) b8: ff 75 f0 pushl -0x10(%ebp) bb: 68 80 0e 00 00 push $0xe80 c0: e8 c8 04 00 00 call 58d <memmove> c5: 83 c4 10 add $0x10,%esp { int n, m; char *p, *q; m = 0; while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ c8: 8b 45 f4 mov -0xc(%ebp),%eax cb: ba ff 03 00 00 mov $0x3ff,%edx d0: 29 c2 sub %eax,%edx d2: 89 d0 mov %edx,%eax d4: 89 c2 mov %eax,%edx d6: 8b 45 f4 mov -0xc(%ebp),%eax d9: 05 80 0e 00 00 add $0xe80,%eax de: 83 ec 04 sub $0x4,%esp e1: 52 push %edx e2: 50 push %eax e3: ff 75 0c pushl 0xc(%ebp) e6: e8 ff 04 00 00 call 5ea <read> eb: 83 c4 10 add $0x10,%esp ee: 89 45 ec mov %eax,-0x14(%ebp) f1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) f5: 0f 8f 17 ff ff ff jg 12 <grep+0x12> if(m > 0){ m -= p - buf; memmove(buf, p, m); } } } fb: 90 nop fc: c9 leave fd: c3 ret 000000fe <main>: int main(int argc, char *argv[]) { fe: 8d 4c 24 04 lea 0x4(%esp),%ecx 102: 83 e4 f0 and $0xfffffff0,%esp 105: ff 71 fc pushl -0x4(%ecx) 108: 55 push %ebp 109: 89 e5 mov %esp,%ebp 10b: 53 push %ebx 10c: 51 push %ecx 10d: 83 ec 10 sub $0x10,%esp 110: 89 cb mov %ecx,%ebx int fd, i; char *pattern; if(argc <= 1){ 112: 83 3b 01 cmpl $0x1,(%ebx) 115: 7f 17 jg 12e <main+0x30> printf(2, "usage: grep pattern [file ...]\n"); 117: 83 ec 08 sub $0x8,%esp 11a: 68 40 0b 00 00 push $0xb40 11f: 6a 02 push $0x2 121: e8 63 06 00 00 call 789 <printf> 126: 83 c4 10 add $0x10,%esp exit(); 129: e8 a4 04 00 00 call 5d2 <exit> } pattern = argv[1]; 12e: 8b 43 04 mov 0x4(%ebx),%eax 131: 8b 40 04 mov 0x4(%eax),%eax 134: 89 45 f0 mov %eax,-0x10(%ebp) if(argc <= 2){ 137: 83 3b 02 cmpl $0x2,(%ebx) 13a: 7f 15 jg 151 <main+0x53> grep(pattern, 0); 13c: 83 ec 08 sub $0x8,%esp 13f: 6a 00 push $0x0 141: ff 75 f0 pushl -0x10(%ebp) 144: e8 b7 fe ff ff call 0 <grep> 149: 83 c4 10 add $0x10,%esp exit(); 14c: e8 81 04 00 00 call 5d2 <exit> } for(i = 2; i < argc; i++){ 151: c7 45 f4 02 00 00 00 movl $0x2,-0xc(%ebp) 158: eb 74 jmp 1ce <main+0xd0> if((fd = open(argv[i], 0)) < 0){ 15a: 8b 45 f4 mov -0xc(%ebp),%eax 15d: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 164: 8b 43 04 mov 0x4(%ebx),%eax 167: 01 d0 add %edx,%eax 169: 8b 00 mov (%eax),%eax 16b: 83 ec 08 sub $0x8,%esp 16e: 6a 00 push $0x0 170: 50 push %eax 171: e8 9c 04 00 00 call 612 <open> 176: 83 c4 10 add $0x10,%esp 179: 89 45 ec mov %eax,-0x14(%ebp) 17c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 180: 79 29 jns 1ab <main+0xad> printf(1, "grep: cannot open %s\n", argv[i]); 182: 8b 45 f4 mov -0xc(%ebp),%eax 185: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 18c: 8b 43 04 mov 0x4(%ebx),%eax 18f: 01 d0 add %edx,%eax 191: 8b 00 mov (%eax),%eax 193: 83 ec 04 sub $0x4,%esp 196: 50 push %eax 197: 68 60 0b 00 00 push $0xb60 19c: 6a 01 push $0x1 19e: e8 e6 05 00 00 call 789 <printf> 1a3: 83 c4 10 add $0x10,%esp exit(); 1a6: e8 27 04 00 00 call 5d2 <exit> } grep(pattern, fd); 1ab: 83 ec 08 sub $0x8,%esp 1ae: ff 75 ec pushl -0x14(%ebp) 1b1: ff 75 f0 pushl -0x10(%ebp) 1b4: e8 47 fe ff ff call 0 <grep> 1b9: 83 c4 10 add $0x10,%esp close(fd); 1bc: 83 ec 0c sub $0xc,%esp 1bf: ff 75 ec pushl -0x14(%ebp) 1c2: e8 33 04 00 00 call 5fa <close> 1c7: 83 c4 10 add $0x10,%esp if(argc <= 2){ grep(pattern, 0); exit(); } for(i = 2; i < argc; i++){ 1ca: 83 45 f4 01 addl $0x1,-0xc(%ebp) 1ce: 8b 45 f4 mov -0xc(%ebp),%eax 1d1: 3b 03 cmp (%ebx),%eax 1d3: 7c 85 jl 15a <main+0x5c> exit(); } grep(pattern, fd); close(fd); } exit(); 1d5: e8 f8 03 00 00 call 5d2 <exit> 000001da <match>: int matchhere(char*, char*); int matchstar(int, char*, char*); int match(char *re, char *text) { 1da: 55 push %ebp 1db: 89 e5 mov %esp,%ebp 1dd: 83 ec 08 sub $0x8,%esp if(re[0] == '^') 1e0: 8b 45 08 mov 0x8(%ebp),%eax 1e3: 0f b6 00 movzbl (%eax),%eax 1e6: 3c 5e cmp $0x5e,%al 1e8: 75 17 jne 201 <match+0x27> return matchhere(re+1, text); 1ea: 8b 45 08 mov 0x8(%ebp),%eax 1ed: 83 c0 01 add $0x1,%eax 1f0: 83 ec 08 sub $0x8,%esp 1f3: ff 75 0c pushl 0xc(%ebp) 1f6: 50 push %eax 1f7: e8 38 00 00 00 call 234 <matchhere> 1fc: 83 c4 10 add $0x10,%esp 1ff: eb 31 jmp 232 <match+0x58> do{ // must look at empty string if(matchhere(re, text)) 201: 83 ec 08 sub $0x8,%esp 204: ff 75 0c pushl 0xc(%ebp) 207: ff 75 08 pushl 0x8(%ebp) 20a: e8 25 00 00 00 call 234 <matchhere> 20f: 83 c4 10 add $0x10,%esp 212: 85 c0 test %eax,%eax 214: 74 07 je 21d <match+0x43> return 1; 216: b8 01 00 00 00 mov $0x1,%eax 21b: eb 15 jmp 232 <match+0x58> }while(*text++ != '\0'); 21d: 8b 45 0c mov 0xc(%ebp),%eax 220: 8d 50 01 lea 0x1(%eax),%edx 223: 89 55 0c mov %edx,0xc(%ebp) 226: 0f b6 00 movzbl (%eax),%eax 229: 84 c0 test %al,%al 22b: 75 d4 jne 201 <match+0x27> return 0; 22d: b8 00 00 00 00 mov $0x0,%eax } 232: c9 leave 233: c3 ret 00000234 <matchhere>: // matchhere: search for re at beginning of text int matchhere(char *re, char *text) { 234: 55 push %ebp 235: 89 e5 mov %esp,%ebp 237: 83 ec 08 sub $0x8,%esp if(re[0] == '\0') 23a: 8b 45 08 mov 0x8(%ebp),%eax 23d: 0f b6 00 movzbl (%eax),%eax 240: 84 c0 test %al,%al 242: 75 0a jne 24e <matchhere+0x1a> return 1; 244: b8 01 00 00 00 mov $0x1,%eax 249: e9 99 00 00 00 jmp 2e7 <matchhere+0xb3> if(re[1] == '*') 24e: 8b 45 08 mov 0x8(%ebp),%eax 251: 83 c0 01 add $0x1,%eax 254: 0f b6 00 movzbl (%eax),%eax 257: 3c 2a cmp $0x2a,%al 259: 75 21 jne 27c <matchhere+0x48> return matchstar(re[0], re+2, text); 25b: 8b 45 08 mov 0x8(%ebp),%eax 25e: 8d 50 02 lea 0x2(%eax),%edx 261: 8b 45 08 mov 0x8(%ebp),%eax 264: 0f b6 00 movzbl (%eax),%eax 267: 0f be c0 movsbl %al,%eax 26a: 83 ec 04 sub $0x4,%esp 26d: ff 75 0c pushl 0xc(%ebp) 270: 52 push %edx 271: 50 push %eax 272: e8 72 00 00 00 call 2e9 <matchstar> 277: 83 c4 10 add $0x10,%esp 27a: eb 6b jmp 2e7 <matchhere+0xb3> if(re[0] == '$' && re[1] == '\0') 27c: 8b 45 08 mov 0x8(%ebp),%eax 27f: 0f b6 00 movzbl (%eax),%eax 282: 3c 24 cmp $0x24,%al 284: 75 1d jne 2a3 <matchhere+0x6f> 286: 8b 45 08 mov 0x8(%ebp),%eax 289: 83 c0 01 add $0x1,%eax 28c: 0f b6 00 movzbl (%eax),%eax 28f: 84 c0 test %al,%al 291: 75 10 jne 2a3 <matchhere+0x6f> return *text == '\0'; 293: 8b 45 0c mov 0xc(%ebp),%eax 296: 0f b6 00 movzbl (%eax),%eax 299: 84 c0 test %al,%al 29b: 0f 94 c0 sete %al 29e: 0f b6 c0 movzbl %al,%eax 2a1: eb 44 jmp 2e7 <matchhere+0xb3> if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 2a3: 8b 45 0c mov 0xc(%ebp),%eax 2a6: 0f b6 00 movzbl (%eax),%eax 2a9: 84 c0 test %al,%al 2ab: 74 35 je 2e2 <matchhere+0xae> 2ad: 8b 45 08 mov 0x8(%ebp),%eax 2b0: 0f b6 00 movzbl (%eax),%eax 2b3: 3c 2e cmp $0x2e,%al 2b5: 74 10 je 2c7 <matchhere+0x93> 2b7: 8b 45 08 mov 0x8(%ebp),%eax 2ba: 0f b6 10 movzbl (%eax),%edx 2bd: 8b 45 0c mov 0xc(%ebp),%eax 2c0: 0f b6 00 movzbl (%eax),%eax 2c3: 38 c2 cmp %al,%dl 2c5: 75 1b jne 2e2 <matchhere+0xae> return matchhere(re+1, text+1); 2c7: 8b 45 0c mov 0xc(%ebp),%eax 2ca: 8d 50 01 lea 0x1(%eax),%edx 2cd: 8b 45 08 mov 0x8(%ebp),%eax 2d0: 83 c0 01 add $0x1,%eax 2d3: 83 ec 08 sub $0x8,%esp 2d6: 52 push %edx 2d7: 50 push %eax 2d8: e8 57 ff ff ff call 234 <matchhere> 2dd: 83 c4 10 add $0x10,%esp 2e0: eb 05 jmp 2e7 <matchhere+0xb3> return 0; 2e2: b8 00 00 00 00 mov $0x0,%eax } 2e7: c9 leave 2e8: c3 ret 000002e9 <matchstar>: // matchstar: search for c*re at beginning of text int matchstar(int c, char *re, char *text) { 2e9: 55 push %ebp 2ea: 89 e5 mov %esp,%ebp 2ec: 83 ec 08 sub $0x8,%esp do{ // a * matches zero or more instances if(matchhere(re, text)) 2ef: 83 ec 08 sub $0x8,%esp 2f2: ff 75 10 pushl 0x10(%ebp) 2f5: ff 75 0c pushl 0xc(%ebp) 2f8: e8 37 ff ff ff call 234 <matchhere> 2fd: 83 c4 10 add $0x10,%esp 300: 85 c0 test %eax,%eax 302: 74 07 je 30b <matchstar+0x22> return 1; 304: b8 01 00 00 00 mov $0x1,%eax 309: eb 29 jmp 334 <matchstar+0x4b> }while(*text!='\0' && (*text++==c || c=='.')); 30b: 8b 45 10 mov 0x10(%ebp),%eax 30e: 0f b6 00 movzbl (%eax),%eax 311: 84 c0 test %al,%al 313: 74 1a je 32f <matchstar+0x46> 315: 8b 45 10 mov 0x10(%ebp),%eax 318: 8d 50 01 lea 0x1(%eax),%edx 31b: 89 55 10 mov %edx,0x10(%ebp) 31e: 0f b6 00 movzbl (%eax),%eax 321: 0f be c0 movsbl %al,%eax 324: 3b 45 08 cmp 0x8(%ebp),%eax 327: 74 c6 je 2ef <matchstar+0x6> 329: 83 7d 08 2e cmpl $0x2e,0x8(%ebp) 32d: 74 c0 je 2ef <matchstar+0x6> return 0; 32f: b8 00 00 00 00 mov $0x0,%eax } 334: c9 leave 335: c3 ret 00000336 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 336: 55 push %ebp 337: 89 e5 mov %esp,%ebp 339: 57 push %edi 33a: 53 push %ebx asm volatile("cld; rep stosb" : 33b: 8b 4d 08 mov 0x8(%ebp),%ecx 33e: 8b 55 10 mov 0x10(%ebp),%edx 341: 8b 45 0c mov 0xc(%ebp),%eax 344: 89 cb mov %ecx,%ebx 346: 89 df mov %ebx,%edi 348: 89 d1 mov %edx,%ecx 34a: fc cld 34b: f3 aa rep stos %al,%es:(%edi) 34d: 89 ca mov %ecx,%edx 34f: 89 fb mov %edi,%ebx 351: 89 5d 08 mov %ebx,0x8(%ebp) 354: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 357: 90 nop 358: 5b pop %ebx 359: 5f pop %edi 35a: 5d pop %ebp 35b: c3 ret 0000035c <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 35c: 55 push %ebp 35d: 89 e5 mov %esp,%ebp 35f: 83 ec 10 sub $0x10,%esp char *os; os = s; 362: 8b 45 08 mov 0x8(%ebp),%eax 365: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 368: 90 nop 369: 8b 45 08 mov 0x8(%ebp),%eax 36c: 8d 50 01 lea 0x1(%eax),%edx 36f: 89 55 08 mov %edx,0x8(%ebp) 372: 8b 55 0c mov 0xc(%ebp),%edx 375: 8d 4a 01 lea 0x1(%edx),%ecx 378: 89 4d 0c mov %ecx,0xc(%ebp) 37b: 0f b6 12 movzbl (%edx),%edx 37e: 88 10 mov %dl,(%eax) 380: 0f b6 00 movzbl (%eax),%eax 383: 84 c0 test %al,%al 385: 75 e2 jne 369 <strcpy+0xd> ; return os; 387: 8b 45 fc mov -0x4(%ebp),%eax } 38a: c9 leave 38b: c3 ret 0000038c <strcmp>: int strcmp(const char *p, const char *q) { 38c: 55 push %ebp 38d: 89 e5 mov %esp,%ebp while(*p && *p == *q) 38f: eb 08 jmp 399 <strcmp+0xd> p++, q++; 391: 83 45 08 01 addl $0x1,0x8(%ebp) 395: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 399: 8b 45 08 mov 0x8(%ebp),%eax 39c: 0f b6 00 movzbl (%eax),%eax 39f: 84 c0 test %al,%al 3a1: 74 10 je 3b3 <strcmp+0x27> 3a3: 8b 45 08 mov 0x8(%ebp),%eax 3a6: 0f b6 10 movzbl (%eax),%edx 3a9: 8b 45 0c mov 0xc(%ebp),%eax 3ac: 0f b6 00 movzbl (%eax),%eax 3af: 38 c2 cmp %al,%dl 3b1: 74 de je 391 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 3b3: 8b 45 08 mov 0x8(%ebp),%eax 3b6: 0f b6 00 movzbl (%eax),%eax 3b9: 0f b6 d0 movzbl %al,%edx 3bc: 8b 45 0c mov 0xc(%ebp),%eax 3bf: 0f b6 00 movzbl (%eax),%eax 3c2: 0f b6 c0 movzbl %al,%eax 3c5: 29 c2 sub %eax,%edx 3c7: 89 d0 mov %edx,%eax } 3c9: 5d pop %ebp 3ca: c3 ret 000003cb <strlen>: uint strlen(char *s) { 3cb: 55 push %ebp 3cc: 89 e5 mov %esp,%ebp 3ce: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 3d1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 3d8: eb 04 jmp 3de <strlen+0x13> 3da: 83 45 fc 01 addl $0x1,-0x4(%ebp) 3de: 8b 55 fc mov -0x4(%ebp),%edx 3e1: 8b 45 08 mov 0x8(%ebp),%eax 3e4: 01 d0 add %edx,%eax 3e6: 0f b6 00 movzbl (%eax),%eax 3e9: 84 c0 test %al,%al 3eb: 75 ed jne 3da <strlen+0xf> ; return n; 3ed: 8b 45 fc mov -0x4(%ebp),%eax } 3f0: c9 leave 3f1: c3 ret 000003f2 <memset>: void* memset(void *dst, int c, uint n) { 3f2: 55 push %ebp 3f3: 89 e5 mov %esp,%ebp stosb(dst, c, n); 3f5: 8b 45 10 mov 0x10(%ebp),%eax 3f8: 50 push %eax 3f9: ff 75 0c pushl 0xc(%ebp) 3fc: ff 75 08 pushl 0x8(%ebp) 3ff: e8 32 ff ff ff call 336 <stosb> 404: 83 c4 0c add $0xc,%esp return dst; 407: 8b 45 08 mov 0x8(%ebp),%eax } 40a: c9 leave 40b: c3 ret 0000040c <strchr>: char* strchr(const char *s, char c) { 40c: 55 push %ebp 40d: 89 e5 mov %esp,%ebp 40f: 83 ec 04 sub $0x4,%esp 412: 8b 45 0c mov 0xc(%ebp),%eax 415: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 418: eb 14 jmp 42e <strchr+0x22> if(*s == c) 41a: 8b 45 08 mov 0x8(%ebp),%eax 41d: 0f b6 00 movzbl (%eax),%eax 420: 3a 45 fc cmp -0x4(%ebp),%al 423: 75 05 jne 42a <strchr+0x1e> return (char*)s; 425: 8b 45 08 mov 0x8(%ebp),%eax 428: eb 13 jmp 43d <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 42a: 83 45 08 01 addl $0x1,0x8(%ebp) 42e: 8b 45 08 mov 0x8(%ebp),%eax 431: 0f b6 00 movzbl (%eax),%eax 434: 84 c0 test %al,%al 436: 75 e2 jne 41a <strchr+0xe> if(*s == c) return (char*)s; return 0; 438: b8 00 00 00 00 mov $0x0,%eax } 43d: c9 leave 43e: c3 ret 0000043f <gets>: char* gets(char *buf, int max) { 43f: 55 push %ebp 440: 89 e5 mov %esp,%ebp 442: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 445: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 44c: eb 42 jmp 490 <gets+0x51> cc = read(0, &c, 1); 44e: 83 ec 04 sub $0x4,%esp 451: 6a 01 push $0x1 453: 8d 45 ef lea -0x11(%ebp),%eax 456: 50 push %eax 457: 6a 00 push $0x0 459: e8 8c 01 00 00 call 5ea <read> 45e: 83 c4 10 add $0x10,%esp 461: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 464: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 468: 7e 33 jle 49d <gets+0x5e> break; buf[i++] = c; 46a: 8b 45 f4 mov -0xc(%ebp),%eax 46d: 8d 50 01 lea 0x1(%eax),%edx 470: 89 55 f4 mov %edx,-0xc(%ebp) 473: 89 c2 mov %eax,%edx 475: 8b 45 08 mov 0x8(%ebp),%eax 478: 01 c2 add %eax,%edx 47a: 0f b6 45 ef movzbl -0x11(%ebp),%eax 47e: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 480: 0f b6 45 ef movzbl -0x11(%ebp),%eax 484: 3c 0a cmp $0xa,%al 486: 74 16 je 49e <gets+0x5f> 488: 0f b6 45 ef movzbl -0x11(%ebp),%eax 48c: 3c 0d cmp $0xd,%al 48e: 74 0e je 49e <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 490: 8b 45 f4 mov -0xc(%ebp),%eax 493: 83 c0 01 add $0x1,%eax 496: 3b 45 0c cmp 0xc(%ebp),%eax 499: 7c b3 jl 44e <gets+0xf> 49b: eb 01 jmp 49e <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 49d: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 49e: 8b 55 f4 mov -0xc(%ebp),%edx 4a1: 8b 45 08 mov 0x8(%ebp),%eax 4a4: 01 d0 add %edx,%eax 4a6: c6 00 00 movb $0x0,(%eax) return buf; 4a9: 8b 45 08 mov 0x8(%ebp),%eax } 4ac: c9 leave 4ad: c3 ret 000004ae <stat>: int stat(char *n, struct stat *st) { 4ae: 55 push %ebp 4af: 89 e5 mov %esp,%ebp 4b1: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 4b4: 83 ec 08 sub $0x8,%esp 4b7: 6a 00 push $0x0 4b9: ff 75 08 pushl 0x8(%ebp) 4bc: e8 51 01 00 00 call 612 <open> 4c1: 83 c4 10 add $0x10,%esp 4c4: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 4c7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4cb: 79 07 jns 4d4 <stat+0x26> return -1; 4cd: b8 ff ff ff ff mov $0xffffffff,%eax 4d2: eb 25 jmp 4f9 <stat+0x4b> r = fstat(fd, st); 4d4: 83 ec 08 sub $0x8,%esp 4d7: ff 75 0c pushl 0xc(%ebp) 4da: ff 75 f4 pushl -0xc(%ebp) 4dd: e8 48 01 00 00 call 62a <fstat> 4e2: 83 c4 10 add $0x10,%esp 4e5: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 4e8: 83 ec 0c sub $0xc,%esp 4eb: ff 75 f4 pushl -0xc(%ebp) 4ee: e8 07 01 00 00 call 5fa <close> 4f3: 83 c4 10 add $0x10,%esp return r; 4f6: 8b 45 f0 mov -0x10(%ebp),%eax } 4f9: c9 leave 4fa: c3 ret 000004fb <atoi>: // new atoi added 4/22/17 to be able to handle negative numbers int atoi(const char *s) { 4fb: 55 push %ebp 4fc: 89 e5 mov %esp,%ebp 4fe: 83 ec 10 sub $0x10,%esp int n, sign; n=0; 501: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while(*s==' ')s++;//Remove leading spaces 508: eb 04 jmp 50e <atoi+0x13> 50a: 83 45 08 01 addl $0x1,0x8(%ebp) 50e: 8b 45 08 mov 0x8(%ebp),%eax 511: 0f b6 00 movzbl (%eax),%eax 514: 3c 20 cmp $0x20,%al 516: 74 f2 je 50a <atoi+0xf> sign =(*s=='-')?-1 : 1; 518: 8b 45 08 mov 0x8(%ebp),%eax 51b: 0f b6 00 movzbl (%eax),%eax 51e: 3c 2d cmp $0x2d,%al 520: 75 07 jne 529 <atoi+0x2e> 522: b8 ff ff ff ff mov $0xffffffff,%eax 527: eb 05 jmp 52e <atoi+0x33> 529: b8 01 00 00 00 mov $0x1,%eax 52e: 89 45 f8 mov %eax,-0x8(%ebp) if(*s=='+' || *s=='-') 531: 8b 45 08 mov 0x8(%ebp),%eax 534: 0f b6 00 movzbl (%eax),%eax 537: 3c 2b cmp $0x2b,%al 539: 74 0a je 545 <atoi+0x4a> 53b: 8b 45 08 mov 0x8(%ebp),%eax 53e: 0f b6 00 movzbl (%eax),%eax 541: 3c 2d cmp $0x2d,%al 543: 75 2b jne 570 <atoi+0x75> s++; 545: 83 45 08 01 addl $0x1,0x8(%ebp) while('0' <= *s&&*s<='9') 549: eb 25 jmp 570 <atoi+0x75> n = n*10 + *s++ - '0'; 54b: 8b 55 fc mov -0x4(%ebp),%edx 54e: 89 d0 mov %edx,%eax 550: c1 e0 02 shl $0x2,%eax 553: 01 d0 add %edx,%eax 555: 01 c0 add %eax,%eax 557: 89 c1 mov %eax,%ecx 559: 8b 45 08 mov 0x8(%ebp),%eax 55c: 8d 50 01 lea 0x1(%eax),%edx 55f: 89 55 08 mov %edx,0x8(%ebp) 562: 0f b6 00 movzbl (%eax),%eax 565: 0f be c0 movsbl %al,%eax 568: 01 c8 add %ecx,%eax 56a: 83 e8 30 sub $0x30,%eax 56d: 89 45 fc mov %eax,-0x4(%ebp) n=0; while(*s==' ')s++;//Remove leading spaces sign =(*s=='-')?-1 : 1; if(*s=='+' || *s=='-') s++; while('0' <= *s&&*s<='9') 570: 8b 45 08 mov 0x8(%ebp),%eax 573: 0f b6 00 movzbl (%eax),%eax 576: 3c 2f cmp $0x2f,%al 578: 7e 0a jle 584 <atoi+0x89> 57a: 8b 45 08 mov 0x8(%ebp),%eax 57d: 0f b6 00 movzbl (%eax),%eax 580: 3c 39 cmp $0x39,%al 582: 7e c7 jle 54b <atoi+0x50> n = n*10 + *s++ - '0'; return sign*n; 584: 8b 45 f8 mov -0x8(%ebp),%eax 587: 0f af 45 fc imul -0x4(%ebp),%eax } 58b: c9 leave 58c: c3 ret 0000058d <memmove>: return n; } */ void* memmove(void *vdst, void *vsrc, int n) { 58d: 55 push %ebp 58e: 89 e5 mov %esp,%ebp 590: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 593: 8b 45 08 mov 0x8(%ebp),%eax 596: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 599: 8b 45 0c mov 0xc(%ebp),%eax 59c: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 59f: eb 17 jmp 5b8 <memmove+0x2b> *dst++ = *src++; 5a1: 8b 45 fc mov -0x4(%ebp),%eax 5a4: 8d 50 01 lea 0x1(%eax),%edx 5a7: 89 55 fc mov %edx,-0x4(%ebp) 5aa: 8b 55 f8 mov -0x8(%ebp),%edx 5ad: 8d 4a 01 lea 0x1(%edx),%ecx 5b0: 89 4d f8 mov %ecx,-0x8(%ebp) 5b3: 0f b6 12 movzbl (%edx),%edx 5b6: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 5b8: 8b 45 10 mov 0x10(%ebp),%eax 5bb: 8d 50 ff lea -0x1(%eax),%edx 5be: 89 55 10 mov %edx,0x10(%ebp) 5c1: 85 c0 test %eax,%eax 5c3: 7f dc jg 5a1 <memmove+0x14> *dst++ = *src++; return vdst; 5c5: 8b 45 08 mov 0x8(%ebp),%eax } 5c8: c9 leave 5c9: c3 ret 000005ca <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 5ca: b8 01 00 00 00 mov $0x1,%eax 5cf: cd 40 int $0x40 5d1: c3 ret 000005d2 <exit>: SYSCALL(exit) 5d2: b8 02 00 00 00 mov $0x2,%eax 5d7: cd 40 int $0x40 5d9: c3 ret 000005da <wait>: SYSCALL(wait) 5da: b8 03 00 00 00 mov $0x3,%eax 5df: cd 40 int $0x40 5e1: c3 ret 000005e2 <pipe>: SYSCALL(pipe) 5e2: b8 04 00 00 00 mov $0x4,%eax 5e7: cd 40 int $0x40 5e9: c3 ret 000005ea <read>: SYSCALL(read) 5ea: b8 05 00 00 00 mov $0x5,%eax 5ef: cd 40 int $0x40 5f1: c3 ret 000005f2 <write>: SYSCALL(write) 5f2: b8 10 00 00 00 mov $0x10,%eax 5f7: cd 40 int $0x40 5f9: c3 ret 000005fa <close>: SYSCALL(close) 5fa: b8 15 00 00 00 mov $0x15,%eax 5ff: cd 40 int $0x40 601: c3 ret 00000602 <kill>: SYSCALL(kill) 602: b8 06 00 00 00 mov $0x6,%eax 607: cd 40 int $0x40 609: c3 ret 0000060a <exec>: SYSCALL(exec) 60a: b8 07 00 00 00 mov $0x7,%eax 60f: cd 40 int $0x40 611: c3 ret 00000612 <open>: SYSCALL(open) 612: b8 0f 00 00 00 mov $0xf,%eax 617: cd 40 int $0x40 619: c3 ret 0000061a <mknod>: SYSCALL(mknod) 61a: b8 11 00 00 00 mov $0x11,%eax 61f: cd 40 int $0x40 621: c3 ret 00000622 <unlink>: SYSCALL(unlink) 622: b8 12 00 00 00 mov $0x12,%eax 627: cd 40 int $0x40 629: c3 ret 0000062a <fstat>: SYSCALL(fstat) 62a: b8 08 00 00 00 mov $0x8,%eax 62f: cd 40 int $0x40 631: c3 ret 00000632 <link>: SYSCALL(link) 632: b8 13 00 00 00 mov $0x13,%eax 637: cd 40 int $0x40 639: c3 ret 0000063a <mkdir>: SYSCALL(mkdir) 63a: b8 14 00 00 00 mov $0x14,%eax 63f: cd 40 int $0x40 641: c3 ret 00000642 <chdir>: SYSCALL(chdir) 642: b8 09 00 00 00 mov $0x9,%eax 647: cd 40 int $0x40 649: c3 ret 0000064a <dup>: SYSCALL(dup) 64a: b8 0a 00 00 00 mov $0xa,%eax 64f: cd 40 int $0x40 651: c3 ret 00000652 <getpid>: SYSCALL(getpid) 652: b8 0b 00 00 00 mov $0xb,%eax 657: cd 40 int $0x40 659: c3 ret 0000065a <sbrk>: SYSCALL(sbrk) 65a: b8 0c 00 00 00 mov $0xc,%eax 65f: cd 40 int $0x40 661: c3 ret 00000662 <sleep>: SYSCALL(sleep) 662: b8 0d 00 00 00 mov $0xd,%eax 667: cd 40 int $0x40 669: c3 ret 0000066a <uptime>: SYSCALL(uptime) 66a: b8 0e 00 00 00 mov $0xe,%eax 66f: cd 40 int $0x40 671: c3 ret 00000672 <halt>: SYSCALL(halt) 672: b8 16 00 00 00 mov $0x16,%eax 677: cd 40 int $0x40 679: c3 ret 0000067a <date>: //Project additions SYSCALL(date) 67a: b8 17 00 00 00 mov $0x17,%eax 67f: cd 40 int $0x40 681: c3 ret 00000682 <getuid>: SYSCALL(getuid) 682: b8 18 00 00 00 mov $0x18,%eax 687: cd 40 int $0x40 689: c3 ret 0000068a <getgid>: SYSCALL(getgid) 68a: b8 19 00 00 00 mov $0x19,%eax 68f: cd 40 int $0x40 691: c3 ret 00000692 <getppid>: SYSCALL(getppid) 692: b8 1a 00 00 00 mov $0x1a,%eax 697: cd 40 int $0x40 699: c3 ret 0000069a <setuid>: SYSCALL(setuid) 69a: b8 1b 00 00 00 mov $0x1b,%eax 69f: cd 40 int $0x40 6a1: c3 ret 000006a2 <setgid>: SYSCALL(setgid) 6a2: b8 1c 00 00 00 mov $0x1c,%eax 6a7: cd 40 int $0x40 6a9: c3 ret 000006aa <getprocs>: SYSCALL(getprocs) 6aa: b8 1d 00 00 00 mov $0x1d,%eax 6af: cd 40 int $0x40 6b1: c3 ret 000006b2 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 6b2: 55 push %ebp 6b3: 89 e5 mov %esp,%ebp 6b5: 83 ec 18 sub $0x18,%esp 6b8: 8b 45 0c mov 0xc(%ebp),%eax 6bb: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 6be: 83 ec 04 sub $0x4,%esp 6c1: 6a 01 push $0x1 6c3: 8d 45 f4 lea -0xc(%ebp),%eax 6c6: 50 push %eax 6c7: ff 75 08 pushl 0x8(%ebp) 6ca: e8 23 ff ff ff call 5f2 <write> 6cf: 83 c4 10 add $0x10,%esp } 6d2: 90 nop 6d3: c9 leave 6d4: c3 ret 000006d5 <printint>: static void printint(int fd, int xx, int base, int sgn) { 6d5: 55 push %ebp 6d6: 89 e5 mov %esp,%ebp 6d8: 53 push %ebx 6d9: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 6dc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 6e3: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 6e7: 74 17 je 700 <printint+0x2b> 6e9: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 6ed: 79 11 jns 700 <printint+0x2b> neg = 1; 6ef: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 6f6: 8b 45 0c mov 0xc(%ebp),%eax 6f9: f7 d8 neg %eax 6fb: 89 45 ec mov %eax,-0x14(%ebp) 6fe: eb 06 jmp 706 <printint+0x31> } else { x = xx; 700: 8b 45 0c mov 0xc(%ebp),%eax 703: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 706: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 70d: 8b 4d f4 mov -0xc(%ebp),%ecx 710: 8d 41 01 lea 0x1(%ecx),%eax 713: 89 45 f4 mov %eax,-0xc(%ebp) 716: 8b 5d 10 mov 0x10(%ebp),%ebx 719: 8b 45 ec mov -0x14(%ebp),%eax 71c: ba 00 00 00 00 mov $0x0,%edx 721: f7 f3 div %ebx 723: 89 d0 mov %edx,%eax 725: 0f b6 80 4c 0e 00 00 movzbl 0xe4c(%eax),%eax 72c: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 730: 8b 5d 10 mov 0x10(%ebp),%ebx 733: 8b 45 ec mov -0x14(%ebp),%eax 736: ba 00 00 00 00 mov $0x0,%edx 73b: f7 f3 div %ebx 73d: 89 45 ec mov %eax,-0x14(%ebp) 740: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 744: 75 c7 jne 70d <printint+0x38> if(neg) 746: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 74a: 74 2d je 779 <printint+0xa4> buf[i++] = '-'; 74c: 8b 45 f4 mov -0xc(%ebp),%eax 74f: 8d 50 01 lea 0x1(%eax),%edx 752: 89 55 f4 mov %edx,-0xc(%ebp) 755: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 75a: eb 1d jmp 779 <printint+0xa4> putc(fd, buf[i]); 75c: 8d 55 dc lea -0x24(%ebp),%edx 75f: 8b 45 f4 mov -0xc(%ebp),%eax 762: 01 d0 add %edx,%eax 764: 0f b6 00 movzbl (%eax),%eax 767: 0f be c0 movsbl %al,%eax 76a: 83 ec 08 sub $0x8,%esp 76d: 50 push %eax 76e: ff 75 08 pushl 0x8(%ebp) 771: e8 3c ff ff ff call 6b2 <putc> 776: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 779: 83 6d f4 01 subl $0x1,-0xc(%ebp) 77d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 781: 79 d9 jns 75c <printint+0x87> putc(fd, buf[i]); } 783: 90 nop 784: 8b 5d fc mov -0x4(%ebp),%ebx 787: c9 leave 788: c3 ret 00000789 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 789: 55 push %ebp 78a: 89 e5 mov %esp,%ebp 78c: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 78f: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 796: 8d 45 0c lea 0xc(%ebp),%eax 799: 83 c0 04 add $0x4,%eax 79c: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 79f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 7a6: e9 59 01 00 00 jmp 904 <printf+0x17b> c = fmt[i] & 0xff; 7ab: 8b 55 0c mov 0xc(%ebp),%edx 7ae: 8b 45 f0 mov -0x10(%ebp),%eax 7b1: 01 d0 add %edx,%eax 7b3: 0f b6 00 movzbl (%eax),%eax 7b6: 0f be c0 movsbl %al,%eax 7b9: 25 ff 00 00 00 and $0xff,%eax 7be: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 7c1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 7c5: 75 2c jne 7f3 <printf+0x6a> if(c == '%'){ 7c7: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 7cb: 75 0c jne 7d9 <printf+0x50> state = '%'; 7cd: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 7d4: e9 27 01 00 00 jmp 900 <printf+0x177> } else { putc(fd, c); 7d9: 8b 45 e4 mov -0x1c(%ebp),%eax 7dc: 0f be c0 movsbl %al,%eax 7df: 83 ec 08 sub $0x8,%esp 7e2: 50 push %eax 7e3: ff 75 08 pushl 0x8(%ebp) 7e6: e8 c7 fe ff ff call 6b2 <putc> 7eb: 83 c4 10 add $0x10,%esp 7ee: e9 0d 01 00 00 jmp 900 <printf+0x177> } } else if(state == '%'){ 7f3: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 7f7: 0f 85 03 01 00 00 jne 900 <printf+0x177> if(c == 'd'){ 7fd: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 801: 75 1e jne 821 <printf+0x98> printint(fd, *ap, 10, 1); 803: 8b 45 e8 mov -0x18(%ebp),%eax 806: 8b 00 mov (%eax),%eax 808: 6a 01 push $0x1 80a: 6a 0a push $0xa 80c: 50 push %eax 80d: ff 75 08 pushl 0x8(%ebp) 810: e8 c0 fe ff ff call 6d5 <printint> 815: 83 c4 10 add $0x10,%esp ap++; 818: 83 45 e8 04 addl $0x4,-0x18(%ebp) 81c: e9 d8 00 00 00 jmp 8f9 <printf+0x170> } else if(c == 'x' || c == 'p'){ 821: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 825: 74 06 je 82d <printf+0xa4> 827: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 82b: 75 1e jne 84b <printf+0xc2> printint(fd, *ap, 16, 0); 82d: 8b 45 e8 mov -0x18(%ebp),%eax 830: 8b 00 mov (%eax),%eax 832: 6a 00 push $0x0 834: 6a 10 push $0x10 836: 50 push %eax 837: ff 75 08 pushl 0x8(%ebp) 83a: e8 96 fe ff ff call 6d5 <printint> 83f: 83 c4 10 add $0x10,%esp ap++; 842: 83 45 e8 04 addl $0x4,-0x18(%ebp) 846: e9 ae 00 00 00 jmp 8f9 <printf+0x170> } else if(c == 's'){ 84b: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 84f: 75 43 jne 894 <printf+0x10b> s = (char*)*ap; 851: 8b 45 e8 mov -0x18(%ebp),%eax 854: 8b 00 mov (%eax),%eax 856: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 859: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 85d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 861: 75 25 jne 888 <printf+0xff> s = "(null)"; 863: c7 45 f4 76 0b 00 00 movl $0xb76,-0xc(%ebp) while(*s != 0){ 86a: eb 1c jmp 888 <printf+0xff> putc(fd, *s); 86c: 8b 45 f4 mov -0xc(%ebp),%eax 86f: 0f b6 00 movzbl (%eax),%eax 872: 0f be c0 movsbl %al,%eax 875: 83 ec 08 sub $0x8,%esp 878: 50 push %eax 879: ff 75 08 pushl 0x8(%ebp) 87c: e8 31 fe ff ff call 6b2 <putc> 881: 83 c4 10 add $0x10,%esp s++; 884: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 888: 8b 45 f4 mov -0xc(%ebp),%eax 88b: 0f b6 00 movzbl (%eax),%eax 88e: 84 c0 test %al,%al 890: 75 da jne 86c <printf+0xe3> 892: eb 65 jmp 8f9 <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ 894: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 898: 75 1d jne 8b7 <printf+0x12e> putc(fd, *ap); 89a: 8b 45 e8 mov -0x18(%ebp),%eax 89d: 8b 00 mov (%eax),%eax 89f: 0f be c0 movsbl %al,%eax 8a2: 83 ec 08 sub $0x8,%esp 8a5: 50 push %eax 8a6: ff 75 08 pushl 0x8(%ebp) 8a9: e8 04 fe ff ff call 6b2 <putc> 8ae: 83 c4 10 add $0x10,%esp ap++; 8b1: 83 45 e8 04 addl $0x4,-0x18(%ebp) 8b5: eb 42 jmp 8f9 <printf+0x170> } else if(c == '%'){ 8b7: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 8bb: 75 17 jne 8d4 <printf+0x14b> putc(fd, c); 8bd: 8b 45 e4 mov -0x1c(%ebp),%eax 8c0: 0f be c0 movsbl %al,%eax 8c3: 83 ec 08 sub $0x8,%esp 8c6: 50 push %eax 8c7: ff 75 08 pushl 0x8(%ebp) 8ca: e8 e3 fd ff ff call 6b2 <putc> 8cf: 83 c4 10 add $0x10,%esp 8d2: eb 25 jmp 8f9 <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 8d4: 83 ec 08 sub $0x8,%esp 8d7: 6a 25 push $0x25 8d9: ff 75 08 pushl 0x8(%ebp) 8dc: e8 d1 fd ff ff call 6b2 <putc> 8e1: 83 c4 10 add $0x10,%esp putc(fd, c); 8e4: 8b 45 e4 mov -0x1c(%ebp),%eax 8e7: 0f be c0 movsbl %al,%eax 8ea: 83 ec 08 sub $0x8,%esp 8ed: 50 push %eax 8ee: ff 75 08 pushl 0x8(%ebp) 8f1: e8 bc fd ff ff call 6b2 <putc> 8f6: 83 c4 10 add $0x10,%esp } state = 0; 8f9: 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++){ 900: 83 45 f0 01 addl $0x1,-0x10(%ebp) 904: 8b 55 0c mov 0xc(%ebp),%edx 907: 8b 45 f0 mov -0x10(%ebp),%eax 90a: 01 d0 add %edx,%eax 90c: 0f b6 00 movzbl (%eax),%eax 90f: 84 c0 test %al,%al 911: 0f 85 94 fe ff ff jne 7ab <printf+0x22> putc(fd, c); } state = 0; } } } 917: 90 nop 918: c9 leave 919: c3 ret 0000091a <free>: static Header base; static Header *freep; void free(void *ap) { 91a: 55 push %ebp 91b: 89 e5 mov %esp,%ebp 91d: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 920: 8b 45 08 mov 0x8(%ebp),%eax 923: 83 e8 08 sub $0x8,%eax 926: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 929: a1 68 0e 00 00 mov 0xe68,%eax 92e: 89 45 fc mov %eax,-0x4(%ebp) 931: eb 24 jmp 957 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 933: 8b 45 fc mov -0x4(%ebp),%eax 936: 8b 00 mov (%eax),%eax 938: 3b 45 fc cmp -0x4(%ebp),%eax 93b: 77 12 ja 94f <free+0x35> 93d: 8b 45 f8 mov -0x8(%ebp),%eax 940: 3b 45 fc cmp -0x4(%ebp),%eax 943: 77 24 ja 969 <free+0x4f> 945: 8b 45 fc mov -0x4(%ebp),%eax 948: 8b 00 mov (%eax),%eax 94a: 3b 45 f8 cmp -0x8(%ebp),%eax 94d: 77 1a ja 969 <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) 94f: 8b 45 fc mov -0x4(%ebp),%eax 952: 8b 00 mov (%eax),%eax 954: 89 45 fc mov %eax,-0x4(%ebp) 957: 8b 45 f8 mov -0x8(%ebp),%eax 95a: 3b 45 fc cmp -0x4(%ebp),%eax 95d: 76 d4 jbe 933 <free+0x19> 95f: 8b 45 fc mov -0x4(%ebp),%eax 962: 8b 00 mov (%eax),%eax 964: 3b 45 f8 cmp -0x8(%ebp),%eax 967: 76 ca jbe 933 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 969: 8b 45 f8 mov -0x8(%ebp),%eax 96c: 8b 40 04 mov 0x4(%eax),%eax 96f: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 976: 8b 45 f8 mov -0x8(%ebp),%eax 979: 01 c2 add %eax,%edx 97b: 8b 45 fc mov -0x4(%ebp),%eax 97e: 8b 00 mov (%eax),%eax 980: 39 c2 cmp %eax,%edx 982: 75 24 jne 9a8 <free+0x8e> bp->s.size += p->s.ptr->s.size; 984: 8b 45 f8 mov -0x8(%ebp),%eax 987: 8b 50 04 mov 0x4(%eax),%edx 98a: 8b 45 fc mov -0x4(%ebp),%eax 98d: 8b 00 mov (%eax),%eax 98f: 8b 40 04 mov 0x4(%eax),%eax 992: 01 c2 add %eax,%edx 994: 8b 45 f8 mov -0x8(%ebp),%eax 997: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 99a: 8b 45 fc mov -0x4(%ebp),%eax 99d: 8b 00 mov (%eax),%eax 99f: 8b 10 mov (%eax),%edx 9a1: 8b 45 f8 mov -0x8(%ebp),%eax 9a4: 89 10 mov %edx,(%eax) 9a6: eb 0a jmp 9b2 <free+0x98> } else bp->s.ptr = p->s.ptr; 9a8: 8b 45 fc mov -0x4(%ebp),%eax 9ab: 8b 10 mov (%eax),%edx 9ad: 8b 45 f8 mov -0x8(%ebp),%eax 9b0: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 9b2: 8b 45 fc mov -0x4(%ebp),%eax 9b5: 8b 40 04 mov 0x4(%eax),%eax 9b8: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 9bf: 8b 45 fc mov -0x4(%ebp),%eax 9c2: 01 d0 add %edx,%eax 9c4: 3b 45 f8 cmp -0x8(%ebp),%eax 9c7: 75 20 jne 9e9 <free+0xcf> p->s.size += bp->s.size; 9c9: 8b 45 fc mov -0x4(%ebp),%eax 9cc: 8b 50 04 mov 0x4(%eax),%edx 9cf: 8b 45 f8 mov -0x8(%ebp),%eax 9d2: 8b 40 04 mov 0x4(%eax),%eax 9d5: 01 c2 add %eax,%edx 9d7: 8b 45 fc mov -0x4(%ebp),%eax 9da: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 9dd: 8b 45 f8 mov -0x8(%ebp),%eax 9e0: 8b 10 mov (%eax),%edx 9e2: 8b 45 fc mov -0x4(%ebp),%eax 9e5: 89 10 mov %edx,(%eax) 9e7: eb 08 jmp 9f1 <free+0xd7> } else p->s.ptr = bp; 9e9: 8b 45 fc mov -0x4(%ebp),%eax 9ec: 8b 55 f8 mov -0x8(%ebp),%edx 9ef: 89 10 mov %edx,(%eax) freep = p; 9f1: 8b 45 fc mov -0x4(%ebp),%eax 9f4: a3 68 0e 00 00 mov %eax,0xe68 } 9f9: 90 nop 9fa: c9 leave 9fb: c3 ret 000009fc <morecore>: static Header* morecore(uint nu) { 9fc: 55 push %ebp 9fd: 89 e5 mov %esp,%ebp 9ff: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) a02: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) a09: 77 07 ja a12 <morecore+0x16> nu = 4096; a0b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); a12: 8b 45 08 mov 0x8(%ebp),%eax a15: c1 e0 03 shl $0x3,%eax a18: 83 ec 0c sub $0xc,%esp a1b: 50 push %eax a1c: e8 39 fc ff ff call 65a <sbrk> a21: 83 c4 10 add $0x10,%esp a24: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) a27: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) a2b: 75 07 jne a34 <morecore+0x38> return 0; a2d: b8 00 00 00 00 mov $0x0,%eax a32: eb 26 jmp a5a <morecore+0x5e> hp = (Header*)p; a34: 8b 45 f4 mov -0xc(%ebp),%eax a37: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; a3a: 8b 45 f0 mov -0x10(%ebp),%eax a3d: 8b 55 08 mov 0x8(%ebp),%edx a40: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); a43: 8b 45 f0 mov -0x10(%ebp),%eax a46: 83 c0 08 add $0x8,%eax a49: 83 ec 0c sub $0xc,%esp a4c: 50 push %eax a4d: e8 c8 fe ff ff call 91a <free> a52: 83 c4 10 add $0x10,%esp return freep; a55: a1 68 0e 00 00 mov 0xe68,%eax } a5a: c9 leave a5b: c3 ret 00000a5c <malloc>: void* malloc(uint nbytes) { a5c: 55 push %ebp a5d: 89 e5 mov %esp,%ebp a5f: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; a62: 8b 45 08 mov 0x8(%ebp),%eax a65: 83 c0 07 add $0x7,%eax a68: c1 e8 03 shr $0x3,%eax a6b: 83 c0 01 add $0x1,%eax a6e: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ a71: a1 68 0e 00 00 mov 0xe68,%eax a76: 89 45 f0 mov %eax,-0x10(%ebp) a79: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) a7d: 75 23 jne aa2 <malloc+0x46> base.s.ptr = freep = prevp = &base; a7f: c7 45 f0 60 0e 00 00 movl $0xe60,-0x10(%ebp) a86: 8b 45 f0 mov -0x10(%ebp),%eax a89: a3 68 0e 00 00 mov %eax,0xe68 a8e: a1 68 0e 00 00 mov 0xe68,%eax a93: a3 60 0e 00 00 mov %eax,0xe60 base.s.size = 0; a98: c7 05 64 0e 00 00 00 movl $0x0,0xe64 a9f: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ aa2: 8b 45 f0 mov -0x10(%ebp),%eax aa5: 8b 00 mov (%eax),%eax aa7: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ aaa: 8b 45 f4 mov -0xc(%ebp),%eax aad: 8b 40 04 mov 0x4(%eax),%eax ab0: 3b 45 ec cmp -0x14(%ebp),%eax ab3: 72 4d jb b02 <malloc+0xa6> if(p->s.size == nunits) ab5: 8b 45 f4 mov -0xc(%ebp),%eax ab8: 8b 40 04 mov 0x4(%eax),%eax abb: 3b 45 ec cmp -0x14(%ebp),%eax abe: 75 0c jne acc <malloc+0x70> prevp->s.ptr = p->s.ptr; ac0: 8b 45 f4 mov -0xc(%ebp),%eax ac3: 8b 10 mov (%eax),%edx ac5: 8b 45 f0 mov -0x10(%ebp),%eax ac8: 89 10 mov %edx,(%eax) aca: eb 26 jmp af2 <malloc+0x96> else { p->s.size -= nunits; acc: 8b 45 f4 mov -0xc(%ebp),%eax acf: 8b 40 04 mov 0x4(%eax),%eax ad2: 2b 45 ec sub -0x14(%ebp),%eax ad5: 89 c2 mov %eax,%edx ad7: 8b 45 f4 mov -0xc(%ebp),%eax ada: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; add: 8b 45 f4 mov -0xc(%ebp),%eax ae0: 8b 40 04 mov 0x4(%eax),%eax ae3: c1 e0 03 shl $0x3,%eax ae6: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; ae9: 8b 45 f4 mov -0xc(%ebp),%eax aec: 8b 55 ec mov -0x14(%ebp),%edx aef: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; af2: 8b 45 f0 mov -0x10(%ebp),%eax af5: a3 68 0e 00 00 mov %eax,0xe68 return (void*)(p + 1); afa: 8b 45 f4 mov -0xc(%ebp),%eax afd: 83 c0 08 add $0x8,%eax b00: eb 3b jmp b3d <malloc+0xe1> } if(p == freep) b02: a1 68 0e 00 00 mov 0xe68,%eax b07: 39 45 f4 cmp %eax,-0xc(%ebp) b0a: 75 1e jne b2a <malloc+0xce> if((p = morecore(nunits)) == 0) b0c: 83 ec 0c sub $0xc,%esp b0f: ff 75 ec pushl -0x14(%ebp) b12: e8 e5 fe ff ff call 9fc <morecore> b17: 83 c4 10 add $0x10,%esp b1a: 89 45 f4 mov %eax,-0xc(%ebp) b1d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) b21: 75 07 jne b2a <malloc+0xce> return 0; b23: b8 00 00 00 00 mov $0x0,%eax b28: eb 13 jmp b3d <malloc+0xe1> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ b2a: 8b 45 f4 mov -0xc(%ebp),%eax b2d: 89 45 f0 mov %eax,-0x10(%ebp) b30: 8b 45 f4 mov -0xc(%ebp),%eax b33: 8b 00 mov (%eax),%eax b35: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } b38: e9 6d ff ff ff jmp aaa <malloc+0x4e> } b3d: c9 leave b3e: c3 ret
TheStack
512005be8b5d0b3a284ce22254e49f4c0ad7815c
Assemblycode:Assembly
{"size": 561, "ext": "asm", "max_stars_repo_path": "oeis/313/A313778.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/313/A313778.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/313/A313778.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 62.3333333333, "max_line_length": 182, "alphanum_fraction": 0.752228164}
; A313778: Coordination sequence Gal.6.203.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Simon Strandgaard ; 1,5,10,15,21,26,30,34,39,45,50,55,60,65,70,75,81,86,90,94,99,105,110,115,120,125,130,135,141,146,150,154,159,165,170,175,180,185,190,195 seq $0,315768 ; Coordination sequence Gal.6.628.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. mul $0,6 add $0,3 div $0,7
TheStack
f72e800b2c700b1ab59b99e9bf7b068e6bc7c80a
Assemblycode:Assembly
{"size": 13665, "ext": "asm", "max_stars_repo_path": "crd2consl/crd2consl.asm", "max_stars_repo_name": "s390guy/simh_tests", "max_stars_repo_stars_event_min_datetime": "2021-12-01T01:32:22.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-01T01:32:22.000Z", "max_issues_repo_path": "crd2consl/crd2consl.asm", "max_issues_repo_name": "s390guy/simh_tests", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "crd2consl/crd2consl.asm", "max_forks_repo_name": "s390guy/simh_tests", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 51.9581749049, "max_line_length": 81, "alphanum_fraction": 0.68723015}
* Copyright 2021 Harold Grovesteen * * MIT License: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. TITLE 'CRD2CONSL - SEND CARD CONTENTS TO CONSOLE' * Program Description: * * CRD2CONSL is a bare-metal program. It requires input/output commands to * the IPL card stream to read a card's contents and then send the card's * contents to the consolde device. * * The program is executed by means of an IPL from a card deck containing as * the last card the one that is sent to the console. The card contains * EBCDIC data and is part of the IPL deck. * * Target Architecture: S/360 * * Devices Used: * 10C - IPL card reader * 01F - Console device * * Program Register Usage: * * R0 Base register for access to the ASA. Required by DSECT usage * R1 Device Channel and Unit Address for I/O instructions * R11 Contains zero for STATUS clearing (zero from CPU reset). * R12 The program base register * R15 Subroutine return register * * Disabled Wait State PSW's address field values used by the program: * X'000000' - Successful execution of the program * X'000008' - Unexpected Restart interruption occurred. Old Restart PSW at * address X'8' * X'000018' - Unexpected External interruption occurred. Old External PSW at * address X'18' * X'000020' - Unexpected Supervisor interruption occurred. Old Supervisor * PSW at address X'20' * X'000028' - Unexpected Program interruption occurred. Old Program PSW at * address X'28' * X'000030' - Unexpected Machine Check interruption occurred. Old Machine * Check PSW at address X'30' * X'000038' - Unexpected Input/Output interruption occurred. Old Input/Output * PSW at address X'38' * X'010004' - Console Device X'01F' or channel not operational * X'010008' - Console Device X'01F' or channel busy * X'01000C' - Console Device X'01F' or channel had a problem. See CSW. * X'010010' - Unexpected interruption from some other device. See ASA X'BA' * X'010014' - Console channel error occurred * X'010018' - Console device did not complete the I/O without a problem * X'020004' - Reader Device X'00C' or channel not operational * X'020008' - Reader Device X'00C' or channel busy * X'02000C' - Reader Device X'00C' or channel had a problem. See CSW. * X'020010' - Not used * X'020014' - Reader channel error occurred * X'020018' - Reader device did not complete the I/O without a problem EJECT * See all object data and macro generated model statements in the listing PRINT DATA,GEN SPACE 1 * Inform the SATK macros of the architecture being targeted. Inferred from * the ASMA -t command-line argument. ARCHLVL * Ensure interrupt traps are loaded by iplasma.py before program execution * begins. This macro will create the memory region that will also contain * the IPL PSW. The region name defaults to ASAREGN. iplasma.py knows how * to deal with this situation. ASASECT ASALOAD ASAIPL IA=PGMSTART Define the bare-metal program's IPL PSW SPACE 2 * * The Bare-Metal Hello World Program * SPACE 1 PGMSECT START X'2000',CRD2CSL Start a second region for the program itself * This results in CRD2CSL.bin being created in the list directed IPL directory USING ASA,0 Give me instruction access to the ASA CSECT PGMSTART BALR 12,0 Establish my base register USING *,12 Tell the assembler SPACE 1 LH 1,2 Get the card reader device address (stored by IPL) * Do this before bytes 2 and 3 are overlayed by the restart trap PSW. SPACE 1 * Ensure program is not re-entered by a Hercules console initiated restart. * Address 0 changed from its absolute storage role (IPL PSW) to its real * storage role (Restart New PSW) after the IPL. * Change from the IPL PSW at address 0 to Restart New PSW trap MVC RSTNPSW,PGMRS SPACE 3 * Most systems pass control to the CPU following receipt of CE and DE from * the IPL device. On some systems, the transfer occurs upon receipt of * CE allowing the device to later supply the DE. The following code is * used to effect the same wait for DE that usually happens by the hardware * executing the IPL function. IPLWAIT TIO 0(1) Request the IPL device status BC B'0001',RNOAVL If CC=3, device unavailable. Tell someone. * IF CC=2 or 1, busy or CSW stored, wait until the device is available. * The assumption is that the CSW contains the DE that the program is waiting * to see. The program does not really care about the received status. * It is just looking for the IPL device to be available. BC B'0110',IPLWAIT * CC=0, available, allows the program to continue. SPACE 1 * Note: For systems the do NOT transfer control to the CPU until DE IS * received, the above sequence will return CC=0 on the first TIO and proceed * into the program as it would normally. SPACE 3 * Read a card from the IPL device * No need to validate that the IPL device is present. The fact that this * program got loaded and is executing proves the reader device is present and * working. MVC CAW(4),RCCWADDR Identify the IPL device CCW to be executed SIO 0(1) Request the reader channel program to start, did it? BC B'0001',RNOAVL ..No, CC=3 don't know why, but tell someone. BC B'0010',RBUSY ..No, CC=2 console device or channel is busy BC B'0100',RCSW ..No, CC=1 CSW stored in ASA at X'40' * Reader device is now sending the card's contents (CC=0) * Wait for an I/O interruption RDRWAIT BAL 15,DOWAIT WAIT FOR I/O interrupt SPACE 1 * I/O results can now be checked. * Yes, check the CSW conditions to determine if the console I/O worked OC STATUS,CSW+4 Accummulate Device and Channel status CLI STATUS+1,X'00' Did the channel have, a problem? BNE RCHLERR ..Yes, end with a reader channel error TM STATUS,X'F3' Did the unit encounter a problem? BNZ RUNTERR ..No, end with a unit error TM STATUS,X'0C' Did both channel and unit end? BNO RDRWAIT Wait again for both to be done * CARD HAS BEEN SUCCESSFULLY READ! SPACE 3 * Determine if the console device, subchannel and channel are ready for use. LH 1,CONDEV Set up I/O device address in I/O instruction register TIO 0(1) Determine if the console is there BC B'0001',DEVNOAVL ..No, CC=3 might have a different config address BC B'0010',DEVBUSY ..No, CC=2 console device or channel is busy BC B'0100',DEVCSW ..No, CC=1 CSW stored in ASA at X'40' * Console device is available (CC=0)! SPACE 1 * Prepare for I/O to console STH 11,STATUS Clear status for console I/O operation MVC CAW(4),CCWADDR Identify in ASA where first CCW resides SPACE 1 * Send the Hello World message to the console SIO 0(1) Request console channel program to start, did it? BC B'0001',DEVNOAVL ..No, CC=3 don't know why, but tell someone. BC B'0010',DEVBUSY ..No, CC=2 console device or channel is busy BC B'0100',DEVCSW ..No, CC=1 CSW stored in ASA at X'40' * Console device is now receiving the card contents (CC=0) SPACE 1 * Wait for an I/O interruption CONWAIT BAL 15,DOWAIT SPACE 1 * I/O results can now be checked. * Yes, check the CSW conditions to determine if the console I/O worked OC STATUS,CSW+4 Accummulate Device and Channel status CLI STATUS+1,X'00' Did the channel have, a problem? BNE CHNLERR ..Yes, end with a channel error TM STATUS,X'F3' Did the unit encounter a problem? BNZ UNITERR ..No, end with a unit error TM STATUS,X'0C' Did both channel and unit end? BNO CONWAIT Wait again for both to be done * Both channel and unit have ended SPACE 1 * HURRAY! CARD CONTENTS HAVE BEEN SENT TO THE CONSOLE! LPSW DONE Normal program termination SPACE 3 * * I/O WAIT SUBROUTINE * DOWAIT MVC IONPSW(8),CONT Set up continuation PSW for after I/O interrupt LPSW WAIT Wait for I/O interruption and CSW from channel IODONE EQU * The bare-metal program continues here after I/O MVC IONPSW(8),IOTRAP Restore I/O trap PSW * Did the interruption come from the expected device? CH 1,IOOPSW+2 Is the interrupt from the expected device? BER 15 ..Yes, return to caller B DEVUNKN ..No, end program with an error SPACE 3 * End the bare-metal program with an error indicated in PSW DEVNOAVL LPSW NODEV Code 004 End console device is not available DEVBUSY LPSW BUSYDEV Code 008 End because device is busy (no wait) DEVCSW LPSW CSWSTR Code 00C End because CSW stored in ASA DEVUNKN LPSW NOTCON Code 010 End unexpected device caused I/O interruption CHNLERR LPSW CHERROR Code 014 End because console channel error occurred UNITERR LPSW DVERROR Code 018 End because console device error occurred RNOAVL LPSW RNODEV Code 004 End reader device is not available RBUSY LPSW RBUSYDEV Code 008 End because reader device is busy (no wait) RCSW LPSW RCSWSTR Code 00C End because CSW stored in ASA for reader *RUNKN LPSW RNOTCON Code 010 End unexpected device caused I/O interruption RCHLERR LPSW RCHERROR Code 014 End because reader channel error occurred RUNTERR LPSW RDVERROR Code 018 End because reader device error occurred SPACE 1 * I/O related information CCWADDR DC A(CONCCW) Address of first CCW to be executed by console device. RCCWADDR DC A(RDRCCW) Address of first CCW to be executed by reader device. CONDEV DC XL2'001F' Console device address STATUS DC XL2'0000' Used to accumulate unit and channel status SPACE 1 * CCW used by the program to write the card contents to the console CONCCW CCW0 X'09',RIOAREA,0,L'RIOAREA Write card to console with CR * CCW0 X'03',0,0,1 ..then a NOP. * If the preceding NOP CCW command is enabled, then the CONCCW must set * command chaining in the flag byte, setting the third operand to X'40' SPACE 1 * CCW used to read the card from the IPL device stream on X'00C' RDRCCW CCW X'02',RIOAREA,0,L'RIOAREA Read the card into memory * CCW0 X'03',0,0,1 ..then a NOP. * If the preceding NOP CCW command is enabled, then the RDRCW must set * command chaining in the flag byte, setting the third operand to X'40' SPACE 1 * PSW's used by the bare-metal program PGMRS DWAIT CODE=008 Restart New PSW trap. Points to Restart Old PSW WAIT PSW360 X'F8',0,2,0,0 Causes CPU to wait for I/O interruption CONT PSW360 0,0,0,0,IODONE Causes the CPU to continue after waiting IOTRAP PSW360 0,0,2,0,X'38' I/O trap New PSW (restored after I/O) SPACE 1 * PSW's terminating program execution DONE DWAITEND Successful execution of the program NODEV DWAIT PGM=01,CMP=0,CODE=004 Console device not available BUSYDEV DWAIT PGM=01,CMP=0,CODE=008 Console device busy CSWSTR DWAIT PGM=01,CMP=0,CODE=00C CSW stored in ASA NOTCON DWAIT PGM=01,CMP=0,CODE=010 Unexpected interruption from other device CHERROR DWAIT PGM=01,CMP=0,CODE=014 Console channel error occurred DVERROR DWAIT PGM=01,CMP=0,CODE=018 Console device error occurred RNODEV DWAIT PGM=02,CMP=0,CODE=004 Reader device not available RBUSYDEV DWAIT PGM=02,CMP=0,CODE=008 Reader device busy RCSWSTR DWAIT PGM=02,CMP=0,CODE=00C CSW stored in ASA *RNOTCON DWAIT PGM=02,CMP=0,CODE=010 Unexpected interruption from other device RCHERROR DWAIT PGM=02,CMP=0,CODE=014 Reader channel error occurred RDVERROR DWAIT PGM=02,CMP=0,CODE=018 Reader device error occurred SPACE 3 * No constants should be placed below this area. Base register not needed * because this area is only referenced by CCW's RIOAREA DS 0CL80 * Note: the 0 ensures no space is reserved in IPL deck for this area. SPACE 3 * * Hardware Assigned Storage Locations * SPACE 1 * This DSECT allows symbolic access to these locations. The DSECT created is * named ASA. ASA ASAREA DSECT=YES END
TheStack
0ac6e7bb3d515be8f1d37c2103f54f4b4fe038fb
Assemblycode:Assembly
{"size": 382, "ext": "asm", "max_stars_repo_path": "oeis/246/A246146.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/246/A246146.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/246/A246146.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 25.4666666667, "max_line_length": 173, "alphanum_fraction": 0.5811518325}
; A246146: Limiting block extension of A010060 (Thue-Morse sequence) with first term as initial block. ; 0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0 add $0,180 lpb $0 sub $0,1 sub $1,$0 add $0,1 div $0,2 lpe mov $0,$1 mod $0,2 add $0,2 mod $0,2
TheStack
f8efa029234348b0453513352a4e4ef983257edb
Assemblycode:Assembly
{"size": 1090, "ext": "asm", "max_stars_repo_path": "micro/assembler/sub_test.asm", "max_stars_repo_name": "andrewparlane/fiuba6633_lab_de_sistemas_digitales", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "micro/assembler/sub_test.asm", "max_issues_repo_name": "andrewparlane/fiuba6633_lab_de_sistemas_digitales", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "micro/assembler/sub_test.asm", "max_forks_repo_name": "andrewparlane/fiuba6633_lab_de_sistemas_digitales", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.5853658537, "max_line_length": 72, "alphanum_fraction": 0.4311926606}
# ---------------------------------------------------------------------- # Test_name: sub_test # ---------------------------------------------------------------------- # # RAM memory will be structured in the following manner: # # +---------+----------+ # | Address | Variable | # +---------+----------+ # | RAM[00] | A | # | RAM[01] | B | # | RAM[02] | Y | # +---------+----------+ # # Where: # - Y = A - B # # # ROM Memory will be loaded with the following program: # ---------------------------------------------------------------------- $begin: LOAD A,0; # Load A operand SUB A,1; # ALU Operation to be tested. STORE A,2; # Save result LOAD A,0; # Load A operand ADDI A,1; # Add +1 to A operand STORE A,0; # Save A operand JZ $incb; # Jump to increase B operand if A operand is 0 JUMP $begin; # Start again the operation $incb: LOAD A,1; # Load B operand ADDI A,1; # Add +1 to B operand STORE A,1; # Save B operand JZ $end; # Go to end JUMP $begin; # Start again the operation $end: JUMP $end; # End, Finish test
TheStack
c18a95064a8e7b93bacb8d725fecf4dfcbdbe291
Assemblycode:Assembly
{"size": 228, "ext": "asm", "max_stars_repo_path": "wof/lcs/base/1F8.asm", "max_stars_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_stars_repo_stars_event_min_datetime": "2020-10-14T15:29:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-12T18:58:54.000Z", "max_issues_repo_path": "wof/lcs/base/1F8.asm", "max_issues_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "wof/lcs/base/1F8.asm", "max_forks_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_forks_repo_forks_event_min_datetime": "2020-12-17T08:59:10.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-17T08:59:10.000Z"}
{"max_stars_count": 6, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.3333333333, "max_line_length": 54, "alphanum_fraction": 0.6929824561}
copyright zengfr site:http://github.com/zengfr/romhack 012A70 clr.b ($1f8,A5) [base+1DC] 012A74 clr.b ($200,A5) 012B0E bne $12b30 01A610 dbra D1, $1a60e copyright zengfr site:http://github.com/zengfr/romhack
TheStack
67d8b2c0ec8fdae8a4677ed22b1d2422be8ad89b
Assemblycode:Assembly
{"size": 502, "ext": "asm", "max_stars_repo_path": "oeis/097/A097075.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/097/A097075.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/097/A097075.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 21.8260869565, "max_line_length": 208, "alphanum_fraction": 0.6533864542}
; A097075: Expansion of (1-x-x^2)/(1-x-3*x^2-x^3). ; Submitted by Jon Maiga ; 1,0,2,3,9,20,50,119,289,696,1682,4059,9801,23660,57122,137903,332929,803760,1940450,4684659,11309769,27304196,65918162,159140519,384199201,927538920,2239277042,5406093003,13051463049,31509019100,76069501250 mov $2,$0 mov $4,2 lpb $4 mov $0,$2 sub $4,1 add $0,$4 trn $0,1 seq $0,133654 ; a(n) = 2*A000129(n) - 1. div $0,4 add $0,1 mov $5,$4 mul $5,$0 add $3,$5 lpe min $2,1 mul $2,$0 mov $0,$3 sub $0,$2
TheStack
a00904b5f0f8baff56953c73492c8a9399892b56
Assemblycode:Assembly
{"size": 9238, "ext": "asm", "max_stars_repo_path": "src/game_of_life_graphics.asm", "max_stars_repo_name": "Kippiii/Assembly-Game-Of-Life", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/game_of_life_graphics.asm", "max_issues_repo_name": "Kippiii/Assembly-Game-Of-Life", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/game_of_life_graphics.asm", "max_forks_repo_name": "Kippiii/Assembly-Game-Of-Life", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.1534772182, "max_line_length": 152, "alphanum_fraction": 0.6667027495}
; main PROC for Game of Life ; prompts user for input ; displays current board ; IDEAS ; Nicer cursor? ; Random boards include Irvine32.inc include backend.inc .data MAXIMUM_HEIGHT BYTE 255 MAXIMUM_WIDTH BYTE 255 carriage_X_pos BYTE 0 carriage_Y_pos BYTE 0 prev_map DWORD ? world_map DWORD ? board_size DWORD ? current_key_stroke BYTE ?, 0 array_position WORD 0 hHeap DWORD ? WELCOME_PROMPT BYTE "<-> John Conway's Game of Life <->", 0AH, 0DH, 0 MAIN_MENU BYTE "<->.......Controls......<->", 0AH, 0DH, 0 PROMPT_1 BYTE "w Shift carriage up.....<->", 0AH, 0DH, 0 PROMPT_2 BYTE "a Shift carriage left...<->", 0AH, 0DH, 0 PROMPT_3 BYTE "s Shift carriage down...<->", 0AH, 0DH, 0 PROMPT_4 BYTE "d Shift carriage right..<->", 0AH, 0DH, 0 PROMPT_5 BYTE "q Quit Game.............<->", 0AH, 0DH, 0 PROMPT_6 BYTE "p Toggle pause/continue.<->", 0AH, 0DH, 0 PROMPT_7 BYTE "f Step one frame........<->", 0AH, 0DH, 0 PROMPT_8 BYTE "x Flip Cell.............<->", 0AH, 0DH, 0 PROMPT_9 BYTE "c Clear all cells.......<->", 0AH, 0DH, 0 PROMPT_10 BYTE "r Randomize the grid....<->", 0AH, 0DH, 0 BOTTOM_FRAME BYTE "<->.....................<->", 0AH, 0DH, 0 P_CHAR BYTE "p", 0 F_CHAR BYTE "f", 0 Q_CHAR BYTE "q", 0 X_CHAR BYTE "x", 0 W_CHAR BYTE "w", 0 A_CHAR BYTE "a", 0 S_CHAR BYTE "s", 0 D_CHAR BYTE "d", 0 C_CHAR BYTE "c", 0 R_CHAR BYTE "r", 0 SPACE_CHAR BYTE " ", 0 LEAVING_SET_CELL BYTE "LEAVING set_cell", 0 .code display_WELCOME PROC ; INPUT: NONE mov EDX, OFFSET WELCOME_PROMPT call WriteString ; Print WELCOME_PROMPT call WaitMsg ; Stop program, Print "Press any key to continue..." call Clrscr ret ; OUTPUT: NONE display_WELCOME ENDP .code display_MAIN_MENU PROC ; INPUT: NONE mov EDX, OFFSET MAIN_MENU call WriteString ; Print MAIN_MENU mov EDX, OFFSET PROMPT_1 call WriteString ; Print PROMPT_1 mov EDX, OFFSET PROMPT_2 call WriteString ; Print PROMPT_2 mov EDX, OFFSET PROMPT_3 call WriteString ; Print PROMPT_3 mov EDX, OFFSET PROMPT_4 call WriteString ; Print PROMPT_4 mov EDX, OFFSET PROMPT_5 call WriteString ; Print PROMPT_5 mov EDX, OFFSET PROMPT_6 call WriteString ; Print PROMPT_6 mov EDX, OFFSET PROMPT_7 call WriteString ; Print PROMPT_7 mov EDX, OFFSET PROMPT_8 call WriteString ; Print PROMPT_8 mov EDX, OFFSET PROMPT_9 call WriteString ; Print PROMPT_9 mov EDX, OFFSET PROMPT_10 call WriteString ; Print PROMPT_10 mov EDX, OFFSET BOTTOM_FRAME call WriteString ; Print BOTTOM_FRAME call WaitMsg call Clrscr ret ; OUTPUT: NONE display_MAIN_MENU ENDP .code set_cell PROC ; INPUT: NONE mov EAX, 0 mov AL, carriage_Y_pos mul MAXIMUM_WIDTH mov BX, 0 mov BL, carriage_X_pos add AX, BX mov ESI, world_map add ESI, EAX xor BYTE PTR [ESI], 1 ret ; OUTPUT: NONE set_cell ENDP .code initialize_world_map PROC ; INPUT: NONE call Randomize mov ESI, 0 mov ECX, board_size L1: mov EDI, world_map add EDI, ESI mov AL, BYTE PTR [EDI] mov EAX, 2d ; generate random integers call RandomRange ; 0 or 1 in EAX mov BYTE PTR [EDI], BYTE PTR AL ; store in the array add ESI, 1 ; next array position loop L1 ret ; OUTPUT: NONE initialize_world_map ENDP .code display_board PROC ; INPUT: NONE and edx, 0 ; Set the values for Gotoxy at the origin, DL, DH call Gotoxy mov esi, 0 ; Start counter mov ecx, board_size ; Maximum loops cld L1: ; Only updating when the value has been updating mov edi, world_map add edi, esi mov al, byte ptr [edi] mov edi, prev_map add edi, esi cmp al, byte ptr [edi] jz CONTINUE_L1 mov eax, esi mov bl, MAXIMUM_WIDTH div bl mov dl, ah mov dh, al call Gotoxy FIRST_RUN: mov edi, world_map add edi, esi mov al, BYTE PTR [edi] cmp al, 1 jz PRINT_X_CHAR_LABEL jnz PRINT_SPACE_CHAR_LABEL CONTINUE_L1: add ESI, 1 cmp ECX, 1 jz RET_LABEL loop L1 PRINT_X_CHAR_LABEL: mov EAX, black + (white * 16) call SetTextColor mov EDX, OFFSET SPACE_CHAR call WriteString jmp CONTINUE_L1 PRINT_SPACE_CHAR_LABEL: mov EAX, white + (black * 16) call SetTextColor mov EDX, OFFSET SPACE_CHAR call WriteString jmp CONTINUE_L1 RET_LABEL: mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy push world_map push prev_map push board_size call copy_array ret ; OUTPUT: NONE display_board ENDP ; MAIN PROGRAM game_of_life_main PROC ; Initializing the heap TODO (Handle errors?) invoke GetProcessHeap mov hHeap, eax ; get board measurements call GetMaxXY mov MAXIMUM_HEIGHT, AL mov MAXIMUM_WIDTH, DL mov eax, 0 mov al, MAXIMUM_HEIGHT mul MAXIMUM_WIDTH mov board_size, eax invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, board_size mov world_map, eax invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, board_size mov prev_map, eax mov esi, prev_map mov ecx, board_size PREV_ARR_MAP: mov byte ptr [esi], 2 inc esi loop PREV_ARR_MAP ; display WELCOME_PROMPT call display_WELCOME ; display MAIN_MENU call display_MAIN_MENU mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy ; while user doesnt press "q" MAIN_LABEL: mov EAX, white + (blue * 16) call SetTextColor call Clrscr call display_board jmp PAUSE_LABEL INPUT_LABEL: mov ESI, world_map mov EAX, 0 mov AL, MAXIMUM_HEIGHT mov EBX, 0 mov BL, MAXIMUM_WIDTH push ESI push EAX push EBX call update_board call display_board mov EAX, 50 call Delay call ReadKey ; Get keyboard input jz INPUT_LABEL ; If no input was given, repeat INPUT_LABEL mov current_key_stroke, AL ; current_key_stroke = ReadKey() ; check if p mov AL, P_CHAR cmp AL, current_key_stroke jz PAUSE_LABEL ; if current_key_stroke == 'p' ; check if q mov AL, Q_CHAR cmp AL, current_key_stroke jz EXIT_LABEL ; if current_key_stroke == 'q' ; check if w, a, s, OR d jnz INPUT_LABEL ; if no match to p, f, q, w, a, s, d, jump to INPUT_LABEL PAUSE_LABEL: mov EAX, 10 call Delay call ReadKey ; Get keyboard input jz PAUSE_LABEL ; If no input was given, repeat PAUSE_LABEL mov current_key_stroke, AL ; current_key_stroke = ReadKey() mov AL, Q_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'q' jz EXIT_LABEL mov AL, P_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'p' jz INPUT_LABEL mov AL, F_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'f' jz FRAME_LABEL mov AL, X_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'x' jz CALL_SET_CELL_LABEL mov AL, W_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'w' jz MOVE_CELL_UP_LABEL mov AL, A_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'a' jz MOVE_CELL_LEFT_LABEL mov AL, S_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 's' jz MOVE_CELL_DOWN_LABEL mov AL, D_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'd' jz MOVE_CELL_RIGHT_LABEL mov AL, C_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'c' jz CLEAR_MAP mov AL, R_CHAR cmp AL, current_key_stroke ; if current_key_stroke == 'r' jz RANDOM_MAP jmp PAUSE_LABEL MOVE_CELL_UP_LABEL: cmp carriage_Y_pos, 0 je PAUSE_LABEL sub carriage_Y_pos, 1 mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy jmp PAUSE_LABEL MOVE_CELL_LEFT_LABEL: cmp carriage_X_pos, 0 je PAUSE_LABEL sub carriage_X_pos, 1 mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy jmp PAUSE_LABEL MOVE_CELL_DOWN_LABEL: mov AL, MAXIMUM_HEIGHT sub AL, 1 cmp carriage_Y_pos, AL je PAUSE_LABEL add carriage_Y_pos, 1 mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy jmp PAUSE_LABEL MOVE_CELL_RIGHT_LABEL: mov AL, MAXIMUM_WIDTH sub AL, 1 cmp carriage_X_pos, AL je PAUSE_LABEL add carriage_X_pos, 1 mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy jmp PAUSE_LABEL CALL_SET_CELL_LABEL: call set_cell call display_board jmp PAUSE_LABEL FRAME_LABEL: mov ESI, world_map mov EAX, 0 mov AL, MAXIMUM_HEIGHT mov EBX, 0 mov BL, MAXIMUM_WIDTH push ESI push EAX push EBX call update_board call display_board mov DL, carriage_X_pos mov DH, carriage_Y_pos call Gotoxy jmp PAUSE_LABEL CLEAR_MAP: mov ecx, board_size mov esi, world_map CLEAR_MAP_LOOP: mov byte ptr [esi], 0 inc esi loop CLEAR_MAP_LOOP call display_board jmp PAUSE_LABEL RANDOM_MAP: call initialize_world_map ; initialize a random board call display_board jmp PAUSE_LABEL EXIT_LABEL: INVOKE HeapFree, hHeap, 0, world_map exit game_of_life_main ENDP END game_of_life_main
TheStack
f4294ea9bf5123d636a3145fc7e1ae75a65ea05f
Assemblycode:Assembly
{"size": 381, "ext": "asm", "max_stars_repo_path": "libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm", "max_stars_repo_name": "ahjelm/z88dk", "max_stars_repo_stars_event_min_datetime": "2017-01-14T23:33:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T11:28:42.000Z", "max_issues_repo_path": "libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm", "max_issues_repo_name": "C-Chads/z88dk", "max_issues_repo_issues_event_min_datetime": "2017-01-15T16:12:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:11:12.000Z", "max_forks_repo_path": "libsrc/_DEVELOPMENT/sound/sn76489/c/sccz80/PSGSFXPlayLoop_callee.asm", "max_forks_repo_name": "C-Chads/z88dk", "max_forks_repo_forks_event_min_datetime": "2017-01-17T10:43:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T17:25:02.000Z"}
{"max_stars_count": 640, "max_issues_count": 1600, "max_forks_count": 215, "avg_line_length": 15.24, "max_line_length": 55, "alphanum_fraction": 0.8162729659}
; void PSGSFXPlayLoop(void *sfx,unsigned char channels) SECTION code_clib SECTION code_PSGlib PUBLIC PSGSFXPlayLoop_callee EXTERN asm_PSGlib_SFXPlayLoop PSGSFXPlayLoop_callee: pop af pop bc pop de push af jp asm_PSGlib_SFXPlayLoop ; SDCC bridge for Classic IF __CLASSIC PUBLIC _PSGSFXPlayLoop_callee defc _PSGSFXPlayLoop_callee = PSGSFXPlayLoop_callee ENDIF
TheStack
761b5ecd9784a325fd60dff471b254339fabd126
Assemblycode:Assembly
{"size": 453, "ext": "asm", "max_stars_repo_path": "oeis/296/A296081.asm", "max_stars_repo_name": "neoneye/loda-programs", "max_stars_repo_stars_event_min_datetime": "2021-08-22T19:44:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T16:47:57.000Z", "max_issues_repo_path": "oeis/296/A296081.asm", "max_issues_repo_name": "neoneye/loda-programs", "max_issues_repo_issues_event_min_datetime": "2021-08-29T13:15:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-09T19:52:31.000Z", "max_forks_repo_path": "oeis/296/A296081.asm", "max_forks_repo_name": "neoneye/loda-programs", "max_forks_repo_forks_event_min_datetime": "2021-08-22T20:56:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-29T06:26:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 25.1666666667, "max_line_length": 201, "alphanum_fraction": 0.5342163355}
; A296081: a(n) = gcd(tau(n)-1, sigma(n)-1), where tau = A000005 and sigma = A000203. ; Submitted by Christian Krause ; 0,1,1,2,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,3,5,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,3,2,1,1,1,1,7,1,7,1,1,1,1,1,1,1,6,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,5,5,8 add $0,1 mov $2,$0 lpb $0 add $1,$4 mov $3,$2 dif $3,$0 sub $0,1 cmp $3,$2 cmp $3,0 add $4,$3 lpe gcd $1,$4 mov $0,$1
TheStack
57a8c7a10f61f1e915362fc3dc12e408e7aef965
Assemblycode:Assembly
{"size": 1085, "ext": "asm", "max_stars_repo_path": "chap18/ex33/double_div_26.asm", "max_stars_repo_name": "JamesType/optimization-manual", "max_stars_repo_stars_event_min_datetime": "2021-06-08T10:42:01.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T14:21:45.000Z", "max_issues_repo_path": "chap18/ex33/double_div_26.asm", "max_issues_repo_name": "JamesType/optimization-manual", "max_issues_repo_issues_event_min_datetime": "2021-06-11T20:24:02.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-11T20:24:02.000Z", "max_forks_repo_path": "chap18/ex33/double_div_26.asm", "max_forks_repo_name": "JamesType/optimization-manual", "max_forks_repo_forks_event_min_datetime": "2021-06-08T11:25:29.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-05T05:14:17.000Z"}
{"max_stars_count": 374, "max_issues_count": 1, "max_forks_count": 39, "avg_line_length": 24.1111111111, "max_line_length": 79, "alphanum_fraction": 0.7373271889}
; ; Copyright (C) 2021 by Intel Corporation ; ; Permission to use, copy, modify, and/or distribute this software for any ; purpose with or without fee is hereby granted. ; ; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH ; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, ; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR ; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ; PERFORMANCE OF THIS SOFTWARE. ; ; .globl double_div_26 ; void double_div_26(double *a, double *b, double *out); ; On entry: ; rcx = a ; rdx = b ; r8 = out .code double_div_26 PROC public vmovupd zmm0, [rcx] vmovupd zmm1, [rdx] vrcp14pd zmm2, zmm1 vmulpd zmm3, zmm0, zmm2 vmovapd zmm4, zmm0 vfnmadd231pd zmm4, zmm3, zmm1 vfmadd231pd zmm3, zmm4, zmm2 vmovupd [r8], zmm3 vzeroupper ret double_div_26 ENDP end
TheStack
75ada34c4e5bb2790373e03a113a8e68c333ca7c
Assemblycode:Assembly
{"size": 720, "ext": "asm", "max_stars_repo_path": "sse/main.asm", "max_stars_repo_name": "DaveAxiom/simd", "max_stars_repo_stars_event_min_datetime": "2020-07-09T04:06:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-07T17:40:46.000Z", "max_issues_repo_path": "sse/main.asm", "max_issues_repo_name": "DaveAxiom/simd", "max_issues_repo_issues_event_min_datetime": "2020-10-05T12:23:51.000Z", "max_issues_repo_issues_event_max_datetime": "2020-10-05T12:23:51.000Z", "max_forks_repo_path": "sse/main.asm", "max_forks_repo_name": "DaveAxiom/simd", "max_forks_repo_forks_event_min_datetime": "2020-10-02T00:26:40.000Z", "max_forks_repo_forks_event_max_datetime": "2020-10-02T00:26:40.000Z"}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 18.9473684211, "max_line_length": 73, "alphanum_fraction": 0.5722222222}
%define SYS_EXIT 60 segment .data src: db 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15 shift: db 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 cap: db 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 cap0: db 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26 segment .text global _start rot13_16b: movaps xmm0, [rax] movaps xmm1, [shift] paddb xmm0, xmm1 movaps xmm2, xmm0 movaps xmm1, [cap] pcmpgtb xmm0, xmm1 movaps xmm1, [cap0] pand xmm0, xmm1 psubb xmm2, xmm0 movaps [rax], xmm2 ret _start: mov rax, src call rot13_16b call rot13_16b mov rax, SYS_EXIT mov rdi, 0 syscall ret
TheStack
fb674e1a1c9afb2ea3af6183edf20073e2ce64ac
Assemblycode:Assembly
{"size": 195, "ext": "asm", "max_stars_repo_path": "gfx/pokemon/sentret/anim.asm", "max_stars_repo_name": "pokeachromicdevs/pokeoctober", "max_stars_repo_stars_event_min_datetime": "2021-07-05T23:48:37.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-05T23:48:37.000Z", "max_issues_repo_path": "gfx/pokemon/sentret/anim.asm", "max_issues_repo_name": "AtmaBuster/pokeoctober", "max_issues_repo_issues_event_min_datetime": "2020-12-16T01:11:20.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-16T22:53:56.000Z", "max_forks_repo_path": "gfx/pokemon/sentret/anim.asm", "max_forks_repo_name": "AtmaBuster/pokeoctober", "max_forks_repo_forks_event_min_datetime": "2021-07-05T23:33:22.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-05T23:33:22.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 15.0, "max_line_length": 15, "alphanum_fraction": 0.5025641026}
frame 0, 15 frame 1, 15 frame 2, 15 frame 1, 15 frame 2, 15 frame 1, 15 frame 3, 7 frame 1, 7 frame 3, 7 frame 1, 7 frame 3, 7 frame 0, 15 endanim
TheStack
1f7755ab598ce970f2d484b806c28e8bbd3e9930
Assemblycode:Assembly
{"size": 2636, "ext": "asm", "max_stars_repo_path": "sys.asm", "max_stars_repo_name": "lybrown/edfries-chess-xasm", "max_stars_repo_stars_event_min_datetime": "2021-08-12T08:52:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-12T08:52:52.000Z", "max_issues_repo_path": "sys.asm", "max_issues_repo_name": "lybrown/edfries-chess-xasm", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sys.asm", "max_forks_repo_name": "lybrown/edfries-chess-xasm", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 40.5538461538, "max_line_length": 65, "alphanum_fraction": 0.502276176}
; SCREEN ROWCRS equ $54 COLCRS equ $55 TEMP1 equ $312+1 ;TEMP LOCATIONS ; IOCB OFFSETS IOCB equ $340 ;I/O CONTROL BLOCKS ICHID equ $340 ;HANDLER INDEX ($FF = FREE) ICDNO equ $341 ;DEVICE NUMBER (DRIVE NUMBER) ICCOM equ $342 ;COMMAND CODE ICSTA equ $343 ;STATUS ICBAL equ $344 ;BUFFER ADDRESS ICBAH equ $345 ; ... ICPTL equ $346 ;PUT BYTE ROUTINE ADDRESS - 1 ICPTH equ $347 ; ... ICBLL equ $348 ;BUFFER LENGTH ICBLH equ $349 ; ... ICAX1 equ $34A ;AUXILLARY INFO ICAX2 equ $34B ; ... ICSPR equ $34C ;4 SPARE BYTES ; JUMP VECTOR TABLE DISKIV equ $E450 ;DISK INITIALIZATION DSKINV equ $E453 ;DISK INTERFACE CIOV equ $E456 ;CIO ROUTINE SIOV equ $E459 ;SIO ROUTINE SETVBV equ $E45C ;SET VERTICAL BLANK VECTORS SYSVBV equ $E45F ;SYSTEM VERTICAL BLANK ROUTINE XITVBV equ $E462 ;EXIT VERTICAL BLANK ROUTINE SIOINV equ $E465 ;SIO INIT SENDEV equ $E468 ;SEND ENABLE ROUTINE INTINV equ $E46B ;INTERRUPT HANDLER INIT CIOINV equ $E46E ;CIO INIT BLKBDV equ $E471 ;BLACKBOARD MODE WARMSV equ $E474 ;WARM START ENTRY POINT COLDSV equ $E477 ;COLD START ENTRY POINT RBLOKV equ $E47A ;CASSETTE READ BLOCK VECTOR CSOPIV equ $E47D ;CASSETTE OPEN VECTOR DSOPIV equ $E480 ;CASSETTE OPEN FOR INPUT VECTOR ; COMMAND CODES FOR IOCB OPEN equ $03 ;OPEN FOR INPUT/OUTPUT GETREC equ $05 ;GET RECORD (TEXT) GETCHR equ $07 ;GET CHARACTER(S) PUTREC equ $09 ;PUT RECORD (TEXT) PUTCHR equ $0B ;PUT CHARACTER(S) CLOSE equ $0C ;CLOSE DEVICE STATIS equ $0D ;STATUS REQUEST SPECIL equ $0E ;SPECIAL ENTRY COMMANDS ; AUX1 VALUES FOR OPEN APPEND equ $01 ;OPEN FOR APPEND DIRECT equ $02 ;OPEN FOR DIRECTORY ACCESS OPNIN equ $04 ;OPEN FOR INPUT OPNOT equ $08 ;OPEN FOR OUTPUT OPNINO equ [OPNIN|OPNOT] ;OPEN FOR INPUT/OUTPUT MXDMOD equ $10 ;OPEN FOR MIXED MODE INSCLR equ $20 ;OPEN WITHOUT CLEARING SCREEN
TheStack
9d25fbb6d979cbaf26cd495924726880fca6841d
Assemblycode:Assembly
{"size": 387, "ext": "asm", "max_stars_repo_path": "programs/oeis/047/A047599.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "programs/oeis/047/A047599.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/047/A047599.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.7647058824, "max_line_length": 198, "alphanum_fraction": 0.6149870801}
; A047599: Numbers that are congruent to {0, 3, 4, 5} mod 8. ; 0,3,4,5,8,11,12,13,16,19,20,21,24,27,28,29,32,35,36,37,40,43,44,45,48,51,52,53,56,59,60,61,64,67,68,69,72,75,76,77,80,83,84,85,88,91,92,93,96,99,100,101,104,107,108,109,112,115,116,117,120,123,124 add $0,7 mov $1,$0 div $1,4 mul $1,2 mov $2,$0 lpb $2,1 mov $3,$0 add $3,2 mov $0,$3 sub $2,4 lpe add $1,$0 sub $1,13
TheStack
1fcc712012fb0238c0e9b515833df948f4b76a83
Assemblycode:Assembly
{"size": 748, "ext": "asm", "max_stars_repo_path": "base/atari/putchar.asm", "max_stars_repo_name": "zbyti/Mad-Pascal", "max_stars_repo_stars_event_min_datetime": "2020-05-02T15:37:57.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-17T01:59:41.000Z", "max_issues_repo_path": "base/atari/putchar.asm", "max_issues_repo_name": "michalkolodziejski/Mad-Pascal", "max_issues_repo_issues_event_min_datetime": "2020-05-03T02:02:35.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-10T08:41:19.000Z", "max_forks_repo_path": "base/atari/putchar.asm", "max_forks_repo_name": "michalkolodziejski/Mad-Pascal", "max_forks_repo_forks_event_min_datetime": "2020-06-02T18:34:14.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-09T18:13:44.000Z"}
{"max_stars_count": 7, "max_issues_count": 14, "max_forks_count": 5, "avg_line_length": 19.6842105263, "max_line_length": 97, "alphanum_fraction": 0.6844919786}
; unit GRAPH: InitGraph, PutPixel, LineTo ; unit S2: SetGraphMode /* PUT CHAR Procedura wyprowadza znak na ekran na pozycji X/Y kursora okreslonej przez zmienne odpowiednio COLCRS ($55-$56) i ROWCRS ($54). Zaklada sie, ze obowiazuja przy tym domyslne ustawienia OS-u, to jest ekran jest w trybie Graphics 0, a kanal IOCB 0 jest otwarty dla edytora ekranowego. Wyprowadzenie znaku polega na zaladowaniu jego kodu ATASCII do akumulatora i wykonaniu rozkazu JSR PUTCHR. */ .proc @putchar (.byte a) .reg vbxe bit * ; jsr vbxe_cmap ldx #$00 ; $60 -> S2: chn equ *-1 .ifdef MAIN.CRT.TextAttr ora MAIN.CRT.TextAttr .endif main tay lda icputb+1,x pha lda icputb,x pha tya rts .endp
TheStack
d3ac540def68d91aaff88dab8bd58061dff2eb7b
Assemblycode:Assembly
{"size": 223, "ext": "asm", "max_stars_repo_path": "Assembler/AssemblyCode/NOT.asm", "max_stars_repo_name": "KPU-RISC/KPU", "max_stars_repo_stars_event_min_datetime": "2017-04-16T16:53:03.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-14T22:29:28.000Z", "max_issues_repo_path": "Assembler/AssemblyCode/TTL/NOT.asm", "max_issues_repo_name": "KPU-RISC/KPU", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Assembler/AssemblyCode/TTL/NOT.asm", "max_forks_repo_name": "KPU-RISC/KPU", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 8, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 6.3714285714, "max_line_length": 37, "alphanum_fraction": 0.6771300448}
; Write register D to the Output Port MOV D, 11110000b MOV E, 00001111b NOT D NOT D SHR D NOT E NOT E SHL E NOT D NOT D SHR D NOT E NOT E SHL E NOT D NOT D SHR D NOT E NOT E SHL E NOT D NOT D SHR D NOT E NOT E SHL E
TheStack
6c48a7c6898bacfc2853935b4027acb2dce936c3
Assemblycode:Assembly
{"size": 526, "ext": "asm", "max_stars_repo_path": "src/asm/define_music.asm", "max_stars_repo_name": "h1romas4/z88dk-msx-template", "max_stars_repo_stars_event_min_datetime": "2021-09-06T15:25:33.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-24T06:38:12.000Z", "max_issues_repo_path": "src/asm/define_music.asm", "max_issues_repo_name": "h1romas4/z88dk-msx-template", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/asm/define_music.asm", "max_forks_repo_name": "h1romas4/z88dk-msx-template", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.875, "max_line_length": 86, "alphanum_fraction": 0.7908745247}
; license:MIT License ; copyright-holders:Hiromasa Tanaka ; rodata_user ; https://github.com/z88dk/z88dk/blob/master/doc/overview.md#a-quick-note-for-asm-code ; rodata_user if for constant data ; kept in rom if program is in rom SECTION rodata_user PUBLIC _music_title, _music_main, _music_game_over, _sound_extend, _sound_get include "../resources/music_title.asm" include "../resources/music_main.asm" include "../resources/music_game_over.asm" include "../resources/sound_extend.asm" include "../resources/sound_get.asm"
TheStack
b1fa223bb51f0b628f775f515ebb0de3a7e5fc29
Assemblycode:Assembly
{"size": 13807, "ext": "asm", "max_stars_repo_path": "2001-fall/mp4/mp4.asm", "max_stars_repo_name": "ece291/machine-problems", "max_stars_repo_stars_event_min_datetime": "2016-07-16T04:33:49.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-13T16:18:17.000Z", "max_issues_repo_path": "2001-fall/mp4/mp4.asm", "max_issues_repo_name": "ece291/machine-problems", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "2001-fall/mp4/mp4.asm", "max_forks_repo_name": "ece291/machine-problems", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.0018832392, "max_line_length": 200, "alphanum_fraction": 0.5237198522}
; ECE 291 Fall 2001 MP4 ; -- Paint291 -- ; ; Completed By: ; Your Name ; ; Josh Potts ; Guest Author - Ryan Chmiel ; University of Illinois Urbana Champaign ; Dept. of Electrical & Computer Engineering ; ; Ver 1.0 %include "lib291.inc" %include "libmp4.inc" BITS 32 GLOBAL _main ; Define functions and variables used by main() EXTERN _LoadPNG _LoadPNG_arglen EQU 18 ; Define Contstants DOWNARROW EQU 80 RIGHTARROW EQU 77 LEFTARROW EQU 75 UPARROW EQU 72 CANVAS_X EQU 20 CANVAS_Y EQU 20 NUM_MENU_ITEMS EQU 11 BKSP EQU 8 ESC EQU 1 ENTERKEY EQU 13 SPACE EQU 57 LSHIFT EQU 42 RSHIFT EQU 54 SECTION .bss _GraphicsMode resw 1 ; Graphics mode # _kbINT resb 1 ; Keyboard interrupt # _kbIRQ resb 1 ; Keyboard IRQ _kbPort resw 1 ; Keyboard port _MouseSeg resw 1 ; real mode segment for MouseCallback _MouseOff resw 1 ; real mode offset for MouseCallback _MouseX resw 1 ; X coordinate position of mouse on screen _MouseY resw 1 ; Y coordinate position of mouse on screen _ScreenOff resd 1 ; Screen image offset _CanvasOff resd 1 ; Canvas image offset _OverlayOff resd 1 ; Overlay image offset _FontOff resd 1 ; Font image offset _MenuOff resd 1 ; Menu image offset _TitleOff resd 1 ; Title Bar image offset _MPFlags resb 1 ; program flags ; Bit 0 - Exit program ; Bit 1 - Left mouse button (LMB) status: set if down, cleared if up ; Bit 2 - Change in LMB status: set if button status ; moves from pressed->released or vice-versa ; Bit 3 - Right shift key status: set if down, cleared if up ; Bit 4 - Left shift key status: set if down, cleared if up ; Bit 5 - Key other than shift was pressed ; Bit 6 - Not Used Anymore ; Bit 7 - Status of chosen color: set if obtained with user input, ; cleared if obtained with eyedrop (you do not have to deal ; with this - the library code uses it) _MenuItem resb 1 ; selected menu item ; line algorithm variables _x resw 1 _y resw 1 _dx resw 1 _dy resw 1 _lineerror resw 1 _xhorizinc resw 1 _xdiaginc resw 1 _yvertinc resw 1 _ydiaginc resw 1 _errordiaginc resw 1 _errornodiaginc resw 1 ; circle algorithm variables _radius resw 1 _circleerror resw 1 _xdist resw 1 _ydist resw 1 ; flood fill variables _PointQueue resd 1 _QueueHead resd 1 _QueueTail resd 1 _key resb 1 SECTION .data ; Required image files _FontFN db 'font.png',0 _MenuFN db 'menu.png',0 _TitleFN db 'title.png',0 ; Defined color values _CurrentColor dd 0ffff0000h ; current color _ColorBlue dd 0ff0033ffh _ColorWhite dd 0ffffffffh _ColorBlack dd 0ff000000h _ColorHalfBlack dd 0cc000000h _buffer db ' ','$' _ColorString1 db 'Enter numerical values for','$' _ColorString2 db 'each channel (ARGB), and','$' _ColorString3 db 'separate each number by a','$' _ColorString4 db 'space (ex. 127 255 255 0).','$' _QwertyNames db 0 ; filler db 0,'1','2','3','4','5','6','7','8','9','0','-','=',BKSP db 0, 'q','w','e','r','t','y','u','i','o','p','[',']',ENTERKEY db 0,'a','s','d','f','g','h','j','k','l',';',"'","`" db 0,'\','z','x','c','v','b','n','m',",",'.','/',0,'*' db 0, ' ', 0, 0,0,0,0,0,0,0,0,0,0 ; F1-F10 db 0,0 ; numlock, scroll lock db 0, 0, 0, '-' db 0, 0, 0, '+' db 0, 0, 0, 0 db 0, 0; sysrq _QwertyNames_end resb 0 _QwertyShift db 0 ; filler db 0,'!','@','#','$','%','^','&','*','(',')','_','+',BKSP db 0, 'Q','W','E','R','T','Y','U','I','O','P','{','}',ENTERKEY db 0,'A','S','D','F','G','H','J','K','L',':','"','~' db 0,'|','Z','X','C','V','B','N','M',"<",'>','?',0,'*' db 0, ' ', 0, 0,0,0,0,0,0,0,0,0,0 ; F1-F10 db 0,0 ; numlock, scroll lock db 0, 0, 0, '-' db 0, 0, 0, '+' db 0, 0, 0, 0 db 0, 0; sysrq _QwertyShift_end resb 0 _TextInputString times 80 db 0,'$' _ColorInputString times 15 db 0,'$' _RoundingFactor dd 000800080h, 00000080h SECTION .text _main call _LibInit ; Allocate Screen Image buffer invoke _AllocMem, dword 640*480*4 cmp eax, -1 je near .memerror mov [_ScreenOff], eax ; Allocate Canvas Image buffer invoke _AllocMem, dword 480*400*4 cmp eax, -1 je near .memerror mov [_CanvasOff], eax ; Allocate Overlay Image buffer invoke _AllocMem, dword 480*400*4 cmp eax, -1 je near .memerror mov [_OverlayOff], eax ; Allocate Font Image buffer invoke _AllocMem, dword 2048*16*4 cmp eax, -1 je near .memerror mov [_FontOff], eax ; Allocate Menu Image buffer invoke _AllocMem, dword 400*100*4 cmp eax, -1 je near .memerror mov [_MenuOff], eax ; Allocate Title Bar Image buffer invoke _AllocMem, dword 640*20*4 cmp eax, -1 je near .memerror mov [_TitleOff], eax ; Allocate Point Queue invoke _AllocMem, dword 480*400*4*40 cmp eax, -1 je near .memerror mov [_PointQueue], eax ; Load image files invoke _LoadPNG, dword _FontFN, ds, dword [_FontOff], dword 0, dword 0 invoke _LoadPNG, dword _MenuFN, ds, dword [_MenuOff], dword 0, dword 0 invoke _LoadPNG, dword _TitleFN, ds, dword [_TitleOff], dword 0, dword 0 ; Graphics init invoke _InitGraphics, dword _kbINT, dword _kbIRQ, dword _kbPort test eax, eax jnz near .graphicserror ; Find graphics mode: 640x480x32, allow driver-emulated modes invoke _FindGraphicsMode, word 640, word 480, word 32, dword 1 mov [_GraphicsMode], ax ; Keyboard/Mouse init call _InstallKeyboard test eax, eax jnz near .keyboarderror invoke _SetGraphicsMode, word [_GraphicsMode] test eax, eax jnz .setgraphicserror call _InstallMouse test eax, eax jnz .mouseerror ; Show mouse cursor mov dword [DPMI_EAX], 01h mov bx, 33h call DPMI_Int call _MP4Main ; Shutdown and cleanup .mouseerror call _RemoveMouse .setgraphicserror call _UnsetGraphicsMode .keyboarderror call _RemoveKeyboard .graphicserror call _ExitGraphics .memerror call _MP4LibExit call _LibExit ret ;-------------------------------------------------------------- ;-- Replace Library Calls with your Code! -- ;-- Do not forget to add Function Headers -- ;-------------------------------------------------------------- ;-------------------------------------------------------------- ;-- PointInBox() -- ;-------------------------------------------------------------- proc _PointInBox .X arg 2 .Y arg 2 .BoxULCornerX arg 2 .BoxULCornerY arg 2 .BoxLRCornerX arg 2 .BoxLRCornerY arg 2 invoke _libPointInBox, word [ebp+.X], word [ebp+.Y], word [ebp+.BoxULCornerX], word [ebp+.BoxULCornerY], word [ebp+.BoxLRCornerX], word [ebp+.BoxLRCornerY] ret endproc _PointInBox_arglen EQU 12 ;-------------------------------------------------------------- ;-- GetPixel() -- ;-------------------------------------------------------------- proc _GetPixel .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 invoke _libGetPixel, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y] ret endproc _GetPixel_arglen EQU 12 ;-------------------------------------------------------------- ;-- DrawPixel() -- ;-------------------------------------------------------------- proc _DrawPixel .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 .Color arg 4 invoke _libDrawPixel, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color] ret endproc _DrawPixel_arglen EQU 16 ;-------------------------------------------------------------- ;-- DrawLine() -- ;-------------------------------------------------------------- proc _DrawLine .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X1 arg 2 .Y1 arg 2 .X2 arg 2 .Y2 arg 2 .Color arg 4 invoke _libDrawLine, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X1], word [ebp+.Y1], word [ebp+.X2], word [ebp+.Y2], dword [ebp+.Color] ret endproc _DrawLine_arglen EQU 20 ;-------------------------------------------------------------- ;-- DrawRect() -- ;-------------------------------------------------------------- proc _DrawRect .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X1 arg 2 .Y1 arg 2 .X2 arg 2 .Y2 arg 2 .Color arg 4 .FillRectFlag arg 4 invoke _libDrawRect, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X1], word [ebp+.Y1], word [ebp+.X2], word [ebp+.Y2], dword [ebp+.Color], dword [ebp+.FillRectFlag] ret endproc _DrawRect_arglen EQU 24 ;-------------------------------------------------------------- ;-- DrawCircle() -- ;-------------------------------------------------------------- proc _DrawCircle .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 .Radius arg 2 .Color arg 4 .FillCircleFlag arg 4 invoke _libDrawCircle, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], word [ebp+.Radius], dword [ebp+.Color], dword [ebp+.FillCircleFlag] ret endproc _DrawCircle_arglen EQU 22 ;-------------------------------------------------------------- ;-- DrawText() -- ;-------------------------------------------------------------- proc _DrawText .StringOff arg 4 .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 .Color arg 4 invoke _libDrawText, dword [ebp+.StringOff], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color] ret endproc _DrawText_arglen EQU 20 ;-------------------------------------------------------------- ;-- ClearBuffer() -- ;-------------------------------------------------------------- proc _ClearBuffer .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .Color arg 4 invoke _libClearBuffer, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], dword [ebp+.Color] ret endproc _ClearBuffer_arglen EQU 12 ;-------------------------------------------------------------- ;-- CopyBuffer() -- ;-------------------------------------------------------------- proc _CopyBuffer .SrcOff arg 4 .SrcWidth arg 2 .SrcHeight arg 2 .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 invoke _libCopyBuffer, dword [ebp+.SrcOff], word [ebp+.SrcWidth], word [ebp+.SrcHeight], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y] ret endproc _CopyBuffer_arglen EQU 20 ;-------------------------------------------------------------- ;-- ComposeBuffers() -- ;-------------------------------------------------------------- proc _ComposeBuffers .SrcOff arg 4 .SrcWidth arg 2 .SrcHeight arg 2 .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 invoke _libComposeBuffers, dword [ebp+.SrcOff], word [ebp+.SrcWidth], word [ebp+.SrcHeight], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y] ret endproc _ComposeBuffers_arglen EQU 20 ;-------------------------------------------------------------- ;-- BlurBuffer() -- ;-------------------------------------------------------------- proc _BlurBuffer .SrcOff arg 4 .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 invoke _libBlurBuffer, dword [ebp+.SrcOff], dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight] ret endproc _BlurBuffer_arglen EQU 12 ;-------------------------------------------------------------- ;-- FloodFill() -- ;-------------------------------------------------------------- proc _FloodFill .DestOff arg 4 .DestWidth arg 2 .DestHeight arg 2 .X arg 2 .Y arg 2 .Color arg 4 .ComposeFlag arg 4 invoke _libFloodFill, dword [ebp+.DestOff], word [ebp+.DestWidth], word [ebp+.DestHeight], word [ebp+.X], word [ebp+.Y], dword [ebp+.Color], dword [ebp+.ComposeFlag] ret endproc _FloodFill_arglen EQU 20 ;-------------------------------------------------------------- ;-- InstallKeyboard() -- ;-------------------------------------------------------------- _InstallKeyboard call _libInstallKeyboard ret ;-------------------------------------------------------------- ;-- RemoveKeyboard() -- ;-------------------------------------------------------------- _RemoveKeyboard call _libRemoveKeyboard ret ;-------------------------------------------------------------- ;-- KeyboardISR() -- ;-------------------------------------------------------------- _KeyboardISR call _libKeyboardISR ret _KeyboardISR_end ;-------------------------------------------------------------- ;-- InstallMouse() -- ;-------------------------------------------------------------- _InstallMouse call _libInstallMouse ret ;-------------------------------------------------------------- ;-- RemoveMouse() -- ;-------------------------------------------------------------- _RemoveMouse call _libRemoveMouse ret ;-------------------------------------------------------------- ;-- MouseCallback() -- ;-------------------------------------------------------------- proc _MouseCallback .DPMIRegsPtr arg 4 invoke _libMouseCallback, dword [ebp+.DPMIRegsPtr] ret endproc _MouseCallback_end _MouseCallback_arglen EQU 4
TheStack
af9f1c6db7a11c385cb38a878d3339adc633b565
Assemblycode:Assembly
{"size": 241, "ext": "asm", "max_stars_repo_path": "ffight/lcs/boss/9A.asm", "max_stars_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_stars_repo_stars_event_min_datetime": "2020-10-14T15:29:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-12T18:58:54.000Z", "max_issues_repo_path": "ffight/lcs/boss/9A.asm", "max_issues_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ffight/lcs/boss/9A.asm", "max_forks_repo_name": "zengfr/arcade_game_romhacking_sourcecode_top_secret_data", "max_forks_repo_forks_event_min_datetime": "2020-12-17T08:59:10.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-17T08:59:10.000Z"}
{"max_stars_count": 6, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 30.125, "max_line_length": 54, "alphanum_fraction": 0.6887966805}
copyright zengfr site:http://github.com/zengfr/romhack 03DB86 move.b #$1, ($95,A6) [boss+9A, boss+9C] 03DD02 move.l A0, ($9a,A6) [boss+4] 03DD06 bra $40b46 [boss+9A, boss+9C] copyright zengfr site:http://github.com/zengfr/romhack
TheStack
9ca186f3f118ea2b7ce949d9bcb364e08d61823a
Assemblycode:Assembly
{"size": 8681, "ext": "asm", "max_stars_repo_path": "asm/msvc/ax.asm", "max_stars_repo_name": "awesie/aes_dust", "max_stars_repo_stars_event_min_datetime": "2018-10-01T12:14:08.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-17T02:58:34.000Z", "max_issues_repo_path": "asm/msvc/ax.asm", "max_issues_repo_name": "awesie/aes_dust", "max_issues_repo_issues_event_min_datetime": "2020-11-17T17:47:35.000Z", "max_issues_repo_issues_event_max_datetime": "2020-11-17T17:47:35.000Z", "max_forks_repo_path": "asm/msvc/ax.asm", "max_forks_repo_name": "awesie/aes_dust", "max_forks_repo_forks_event_min_datetime": "2019-01-25T01:18:27.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-07T10:32:04.000Z"}
{"max_stars_count": 46, "max_issues_count": 1, "max_forks_count": 20, "avg_line_length": 29.3277027027, "max_line_length": 73, "alphanum_fraction": 0.4784011059}
; ; This is free and unencumbered software released into the public domain. ; ; Anyone is free to copy, modify, publish, use, compile, sell, or ; distribute this software, either in source code form or as a compiled ; binary, for any purpose, commercial or non-commercial, and by any ; means. ; In jurisdictions that recognize copyright laws, the author or authors ; of this software dedicate any and all copyright interest in the ; software to the public domain. We make this dedication for the benefit ; of the public at large and to the detriment of our heirs and ; successors. We intend this dedication to be an overt act of ; relinquishment in perpetuity of all present and future rights to this ; software under copyright law. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR ; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ; OTHER DEALINGS IN THE SOFTWARE. ; ; For more information, please refer to <http://unlicense.org/> ; ; ----------------------------------------------- ; AES-128 Encryption in x86 assembly ; ; size: 188 bytes for ECB, 255 for CTR ; ; global calls use cdecl convention ; ; ----------------------------------------------- bits 32 %ifndef BIN global _aes_ecb_asm global aes_ecb_asm %endif ; ***************************** ; void aes_ecb_asm(void *s); ; ***************************** _aes_ecb_asm: aes_ecb_asm: pusha xor ecx, ecx ; ecx = 0 mul ecx ; eax = 0, edx = 0 inc eax ; c = 1 mov cl, 4 pusha ; alloca(32) ; F(8)x[i]=((W*)s)[i] mov esi, [esp+64+4] ; esi = s mov edi, esp pusha add ecx, ecx ; copy state + master key to stack rep movsd popa ; ***************************** ; Multiplication over GF(2**8) ; ***************************** call $+21 ; save address push ecx ; save ecx mov cl, 4 ; 4 bytes add al, al ; al <<= 1 jnc $+4 ; xor al, 27 ; ror eax, 8 ; rotate for next byte loop $-9 ; pop ecx ; restore ecx ret pop ebp enc_main: ; ***************************** ; AddRoundKey, AddRoundConstant, ExpandRoundKey ; ***************************** ; w=k[3]; F(4)w=(w&-256)|S(w),w=R(w,8),((W*)s)[i]=x[i]^k[i]; ; w=R(w,8)^c;F(4)w=k[i]^=w; pusha xchg eax, edx xchg esi, edi mov eax, [esi+16+12] ; w=R(k[3],8) ror eax, 8 xor_key: mov ebx, [esi+16] ; t=k[i] xor [esi], ebx ; x[i]^=t movsd ; s[i]=x[i] ; w=(w&-256)|S(w) call S ; al=S(al) ror eax, 8 ; w=R(w,8) loop xor_key ; w=R(w,8)^c xor eax, edx ; w^=c ; F(4)w=k[i]^=w mov cl, 4 exp_key: xor [esi], eax ; k[i]^=w lodsd ; w=k[i] loop exp_key popa ; **************************** ; if(c==108) break; cmp al, 108 jne upd_con popa popa ret upd_con: call ebp ; *************************** ; ShiftRows and SubBytes ; *************************** ; F(16)((u8*)x)[w]=S(((u8*)s)[i]), w=(w-3)&15; pusha shift_rows: lodsb ; al = S(s[i]) call S mov [edi+edx], al sub edx, 3 and edx, 15 jnz shift_rows popa ; ***************************** ; if(c!=108){ cmp al, 108 je enc_main ; ***************************** ; MixColumns ; ***************************** ; F(4)w=x[i],x[i]=R(w,8)^R(w,16)^R(w,24)^M(R(w, 8)^w); pusha mix_cols: mov eax, [edi] ; w = x[i] mov edx, eax ; t = R(w, 8) ror edx, 8 ; xor eax, edx ; w ^= t call ebp ; xor eax, edx ror edx, 8 xor eax, edx ror edx, 8 xor eax, edx stosd loop mix_cols popa jmp enc_main ; ***************************** ; B SubByte(B x) ; ***************************** S: %ifndef DYNAMIC push ebx call init_sbox db 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5 db 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 db 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0 db 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 db 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc db 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 db 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a db 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 db 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0 db 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 db 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b db 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf db 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85 db 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 db 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5 db 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 db 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17 db 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 db 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88 db 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb db 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c db 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 db 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9 db 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 db 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6 db 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a db 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e db 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e db 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94 db 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf db 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68 db 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 init_sbox: pop ebx xlatb pop ebx %else pusha test al, al ; if(x){ jz sb_l6 xchg eax, edx mov cl, -1 ; i=255 ; for(c=i=0,y=1;--i;y=(!c&&y==x)?c=1:y,y^=M(y)) sb_l0: mov al, 1 ; y=1 sb_l1: test ah, ah ; !c jnz sb_l2 cmp al, dl ; y!=x setz ah jz sb_l0 sb_l2: mov dh, al ; y^=M(y) call ebp ; xor al, dh loop sb_l1 ; --i ; F(4)x^=y=(y<<1)|(y>>7); mov dl, al ; dl=y mov cl, 4 ; i=4 sb_l5: rol dl, 1 ; y=R(y,1) xor al, dl ; x^=y loop sb_l5 ; i-- sb_l6: xor al, 99 ; return x^99 mov [esp+28], al popa %endif ret %ifdef CTR global aes_ctr global _aes_ctr ; void aes_ctr(W len, B *ctr, B *in, B *key) _aes_ctr: aes_ctr: pusha lea esi,[esp+32+4] lodsd xchg eax, ecx ; ecx = len lodsd xchg eax, ebp ; ebp = ctr lodsd xchg eax, edx ; edx = in lodsd xchg esi, eax ; esi = key pusha ; alloca(32) ; copy master key to local buffer ; F(16)t[i+16]=key[i] lea edi, [esp+16] ; edi = &t[16] movsd movsd movsd movsd aes_l0: xor eax, eax jecxz aes_l3 ; while(len){ ; copy counter+nonce to local buffer ; F(16)t[i]=ctr[i] mov edi, esp ; edi = t mov esi, ebp ; esi = ctr push edi movsd movsd movsd movsd ; encrypt t call aes_ecb_asm ; E(t) pop edi aes_l1: ; xor plaintext with ciphertext ; r=len>16?16:len ; F(r)in[i]^=t[i] mov bl, [edi+eax] ; xor [edx], bl ; *in++^=t[i] inc edx ; inc eax ; i++ cmp al, 16 ; loopne aes_l1 ; while(i!=16 && --ecx!=0) ; update counter xchg eax, ecx ; mov cl, 16 aes_l2: inc byte[ebp+ecx-1] ; loopz aes_l2 ; while(++c[i]==0 && --ecx!=0) xchg eax, ecx jmp aes_l0 aes_l3: popa popa ret %endif
TheStack
5da987fae3e5ebcef8b516a52a85165c469c7bbe
Assemblycode:Assembly
{"size": 1357, "ext": "asm", "max_stars_repo_path": "libsrc/zx81/tape/tape_load_block_callee.asm", "max_stars_repo_name": "teknoplop/z88dk", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "libsrc/zx81/tape/tape_load_block_callee.asm", "max_issues_repo_name": "teknoplop/z88dk", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "libsrc/zx81/tape/tape_load_block_callee.asm", "max_forks_repo_name": "teknoplop/z88dk", "max_forks_repo_forks_event_min_datetime": "2019-12-03T23:57:48.000Z", "max_forks_repo_forks_event_max_datetime": "2019-12-03T23:57:48.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 14.4361702128, "max_line_length": 88, "alphanum_fraction": 0.675018423}
; ; Tape load routine ; ; ; int __CALLEE__ tape_load_block_callee(void *addr, size_t len, unsigned char type) ; ; ; $Id: tape_load_block_callee.asm,v 1.6 2015/08/11 07:16:36 stefano Exp $ ; PUBLIC tape_load_block_callee PUBLIC ASMDISP_TAPE_LOAD_BLOCK_CALLEE EXTERN zx_fast EXTERN zx_slow ; Very simple header, only check the 'type' byte in a Spectrum-ish way. ; For design reasons, we test a whole word.. ;----- .header defw 0 ; LEN defw 0 ; LOC .header2 defw 0 ; file type (2 bytes) ;----- EXTERN musamy_load .tape_load_block_callee pop de pop bc ld a,c pop bc pop hl push de .asmentry LD (header+2),hl ; LOC LD (header),bc ; LEN ld e,a .ld_retry push de ld hl,rethere push hl LD HL,header PUSH HL LD BC,2 ; file type len PUSH BC LD HL,header2 PUSH HL call zx_fast ;LD L,40h ; VERIFY MODE LD L,0 ; LOAD MODE jp musamy_load .rethere push hl call zx_slow IF FORlambda call $1C28 ; BREAK-1 on Lambda ELSE call $f46 ; BREAK-1 on ZX81 ENDIF pop hl pop de ret nc ; if BREAK is pressed, return; timeout error code is valid for BREAK too ld a,3 cp l ; timeout ? jr z,ld_retry xor a or l ret nz ; other errors ld a,(header2) cp e ret z ; all OK ld l,4 ; file type error ret DEFC ASMDISP_TAPE_LOAD_BLOCK_CALLEE = # asmentry - tape_load_block_callee
TheStack
676e0978ab335d8f1859aa7f48a8138e79620249
Assemblycode:Assembly
{"size": 1076, "ext": "asm", "max_stars_repo_path": "programs/oeis/060/A060264.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/060/A060264.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/060/A060264.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 153.7142857143, "max_line_length": 948, "alphanum_fraction": 0.7267657993}
; A060264: First prime after 2n. ; 2,3,5,7,11,11,13,17,17,19,23,23,29,29,29,31,37,37,37,41,41,43,47,47,53,53,53,59,59,59,61,67,67,67,71,71,73,79,79,79,83,83,89,89,89,97,97,97,97,101,101,103,107,107,109,113,113,127,127,127,127,127,127,127,131,131,137,137,137,139,149,149,149,149,149,151,157,157,157,163,163,163,167,167,173,173,173,179,179,179,181,191,191,191,191,191,193,197,197,199,211,211,211,211,211,211,223,223,223,223,223,223,227,227,229,233,233,239,239,239,241,251,251,251,251,251,257,257,257,263,263,263,269,269,269,271,277,277,277,281,281,283,293,293,293,293,293,307,307,307,307,307,307,307,311,311,313,317,317,331,331,331,331,331,331,331,337,337,337,347,347,347,347,347,349,353,353,359,359,359,367,367,367,367,373,373,373,379,379,379,383,383,389,389,389,397,397,397,397,401,401,409,409,409,409,419,419,419,419,419,421,431,431,431,431,431,433,439,439,439,443,443,449,449,449,457,457,457,457,461,461,463,467,467,479,479,479,479,479,479,487,487,487,487,491,491,499,499,499,499 mul $0,2 cal $0,151800 ; Least prime > n (version 2 of the "next prime" function). mov $1,$0
TheStack
16f16ba03179ef64e96ec11c8ed6ddf70e4e73aa
Assemblycode:Assembly
{"size": 420, "ext": "asm", "max_stars_repo_path": "programs/oeis/159/A159721.asm", "max_stars_repo_name": "karttu/loda", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "programs/oeis/159/A159721.asm", "max_issues_repo_name": "karttu/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/159/A159721.asm", "max_forks_repo_name": "karttu/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 42.0, "max_line_length": 238, "alphanum_fraction": 0.8119047619}
; A159721: Number of permutations of 3 indistinguishable copies of 1..n arranged in a circle with exactly 1 local maximum. ; 6,36,192,960,4608,21504,98304,442368,1966080,8650752,37748736,163577856,704643072,3019898880,12884901888,54760833024,231928233984,979252543488,4123168604160,17317308137472,72567767433216,303465209266176,1266637395197952,5277655813324800 mov $1,$0 add $1,2 mov $2,4 pow $2,$0 mul $1,$2 mul $1,3
TheStack
af42318f112a2de87c03243b68c2f0f99a93c224
Assemblycode:Assembly
{"size": 4826, "ext": "asm", "max_stars_repo_path": "10a-interrupts/boot.asm", "max_stars_repo_name": "starsheriff/train-os", "max_stars_repo_stars_event_min_datetime": "2019-10-23T06:21:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-25T13:00:02.000Z", "max_issues_repo_path": "10a-interrupts/boot.asm", "max_issues_repo_name": "starsheriff/train-os", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "10a-interrupts/boot.asm", "max_forks_repo_name": "starsheriff/train-os", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.8917748918, "max_line_length": 88, "alphanum_fraction": 0.636344799}
; boot.asm ; The label start is our entry point. We have to make it ; public so that the linker can use it. global start extern c_start extern init_idt extern print_interrupt global flush_idt ; we are still in 32-bit protected mode so we have to use ; 32-bit wide instructions bits 32 ; PTE_PRESENT equ 1 << 7 ; Flags for _large_ p2 aka. PDE page table entries PDE_PRESENT equ 1 << 0 PDE_WRITABLE equ 1 << 1 PDE_LARGE equ 1 << 7 ; number of entries in IDT_ENTRIES equ 32 ; GDT Flags start: ; Set stack pointer mov esp, stack_top ; Switching to long mode ; ; Step 1: Disable paging ; ; to disable paging set `CR0.PG` to `0`. mov eax, cr0 and eax, ~(1 << 31) mov cr0, eax ; Step 2: Enable Physical Address Extension mov eax, cr4 or eax, (1 << 5) mov cr4, eax ; Step 3: Set `cr3` register mov eax, p4_table mov cr3, eax ; Step 4: Set the p2[1] entry to point to the _second_ 2 MiB frame mov eax, (0x20_0000 | PDE_PRESENT | PDE_WRITABLE | PDE_LARGE) mov [p2_table + 8], eax ; point the 0th entry to the first frame ; TODO: explain mov eax, (0x00_0000 | PDE_PRESENT | PDE_WRITABLE | PDE_LARGE) mov [p2_table], eax ; Step 5: Set the 0th entry of p3 to point to our p2 table mov eax, p2_table ; load the address of the p2 table or eax, (PDE_PRESENT | PDE_WRITABLE) mov [p3_table], eax ; Step 6: Set the 0th entry of p4 to point to our p3 table mov eax, p3_table or eax, (PDE_PRESENT | PDE_WRITABLE) mov [p4_table], eax ; Step 7: Set EFER.LME to 1 to enable the long mode mov ecx, 0xC0000080 rdmsr or eax, 1 << 8 wrmsr ; Step 8: enable paging mov eax, cr0 or eax, 1 << 31 mov cr0, eax ; Now we set up the IDT ; Step 9: Disable Interrupts lgdt [gdt64.pointer] ; Step 11: Enable Interrupts ; cli ; disable interrupts jmp gdt64.code:longstart section .text bits 64 longstart: mov rsp, stack_top ; not sure if we have to reload the lgdt once we are in 64-bit mode. lgdt [gdt64.pointer] ; load the interrupt descriptor table register. This allows the cpu to find the ; interrupt descriptor table (IDT). lidt [idt.idtr] ; call populate_idt ; asm code call init_idt ; c code ;mov word [0xb8000], 0x0e4f ; 'O', yellow on black ;mov word [0xb8002], 0x0e4b ; 'K', yellow on black ; sti ; immediately clear interupts to avoid reboots ; cli ; uncomment the next line and you will have a page fault ;mov eax, [0xFF_FFFF] call c_start ; dummy handler that does _nothing_ global idt_handler idt_handler: ; jmp $ call print_interrupt iretq global disable_interrupts disable_interrupts: cli ret global trigger_interrupt trigger_interrupt: int 0x03 ret ; *************************************** IDT ********************* FLAG_INTERRUPT equ 0xe FLAG_R0 equ (0 << 5) ;Rings 0 - 3 FLAG_P equ (1 << 7) CODE_SEL equ 0x08 GLOBAL populate_idt populate_idt: mov eax, idt mov ebx, idt_handler ; or ebx, (VIRT_BASE & 0xFFFFFFFF) idt_init_one: ; /* Target Low (word) */ mov ecx, ebx mov word [eax], cx add eax, 2 ; /* Code Selector (word) */ mov word[eax], CODE_SEL add eax, 2 ; /* IST (byte) */ mov byte[eax], 0 add eax, 1 ; /* Flags (byte) */ mov byte[eax], (FLAG_P|FLAG_R0|FLAG_INTERRUPT) add eax, 1 ; /* Target High (word) */ shr ecx, 16 mov word[eax], cx add eax, 2 ; /* Long Mode Target High 32 */ shr ecx, 16 mov dword[eax], ecx ;(idt_handler >> 32) add eax, 4 mov dword[eax], 0 add eax, 4 cmp eax, idt.idtend jl idt_init_one ; lidt[IDTR] ret flush_idt: ; changed from +8 to +16, that did the trick! mov rax, [rsp+16] lidt[rax] ret section .bss ; must be page aligned align 4096 p4_table: resb 4096 p3_table: resb 4096 p2_table: resb 4096 stack_bottom: resb 4096 stack_top: section .rodata gdt64: dq 0 .code: equ $ - gdt64 dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53) .pointer: dw $ - gdt64 - 1 ; length of the gdt64 table dq gdt64 ; address of the gdt64 table section .data ; bits 64 ; ; the IDT table contains 256 64-bit entries. ; Hence, we reserve 256 double quad words (64-bit) entries. ; ; The IDT must be 16-bit aligned. align 16 ; global idt idt: times IDT_ENTRIES dq 0 ; a double quad per entry times IDT_ENTRIES dq 0 ; a double quad per entry ; Figure 4-8 shows the format of the `IDTR` in long-mode. The format is identical to the ; format in protected mode, except the size of the base address. .idtr: dw $ - idt - 1 ; two bytes (word), declaring the size of the IDT in bytes dq idt ; 64-bit (double quad word) base address of the idt .idtend:
TheStack
fc275a25bcd0a969f9293a34dc5d2cebdf8410a5
Assemblycode:Assembly
{"size": 747, "ext": "asm", "max_stars_repo_path": "programs/oeis/204/A204267.asm", "max_stars_repo_name": "jmorken/loda", "max_stars_repo_stars_event_min_datetime": "2021-03-15T11:38:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-15T11:38:20.000Z", "max_issues_repo_path": "programs/oeis/204/A204267.asm", "max_issues_repo_name": "jmorken/loda", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "programs/oeis/204/A204267.asm", "max_forks_repo_name": "jmorken/loda", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.5714285714, "max_line_length": 501, "alphanum_fraction": 0.499330656}
; A204267: Symmetric matrix: f(i,j)=(i+j+1 mod 3), by antidiagonals. ; 0,1,1,2,2,2,0,0,0,0,1,1,1,1,1,2,2,2,2,2,2,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 mov $2,$0 mov $4,$0 lpb $2 add $3,1 lpb $4 add $3,1 trn $4,$3 add $5,$4 lpe lpb $5 sub $3,3 sub $5,$3 lpe mov $1,$3 sub $1,1 sub $2,$2 lpe
TheStack
1d7db4f6c2b073fef562bdaf12842ec62b79e6bd
Assemblycode:Assembly
{"size": 3650, "ext": "asm", "max_stars_repo_path": "agent/io/memory.asm", "max_stars_repo_name": "jephthai/EvilVM", "max_stars_repo_stars_event_min_datetime": "2019-05-18T20:46:47.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-28T05:10:43.000Z", "max_issues_repo_path": "agent/io/memory.asm", "max_issues_repo_name": "jephthai/EvilVM", "max_issues_repo_issues_event_min_datetime": "2019-06-04T15:33:21.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-07T15:27:58.000Z", "max_forks_repo_path": "agent/io/memory.asm", "max_forks_repo_name": "jephthai/EvilVM", "max_forks_repo_forks_event_min_datetime": "2019-05-22T02:48:30.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-03T05:34:48.000Z"}
{"max_stars_count": 141, "max_issues_count": 6, "max_forks_count": 21, "avg_line_length": 23.5483870968, "max_line_length": 84, "alphanum_fraction": 0.7104109589}
;;; memory.asm ;;; ;;; An IO stream layer implemented around shared memory. It should make sense ;;; in both inter-process and same-process shared memory regions. ;;; Put a number on the stack identifying which IO engine this is. Each IO layer ;;; needs to have its own unique ID. This allows payloads to make decisions ;;; based on the configured IO. start_def ASM, engine, "engine" pushthing 4 end_def engine ;;; This function will be called before any IO is performed. This can be used to ;;; set up streams, initialize IO layer global variables, make network connections, ;;; etc. ;;; ;;; In the case of the memory I/O layer, we should have received a pointer to the ;;; memory buffer used for transfer in the first argument to the compiler's entry ;;; point. This has been saved in the arbitrary data pointer in the TEB. start_def ASM, initio, "initio" mov rbp, rsp sub rsp, 0x20 and rsp, -16 xor ebx, ebx AddGlobal G_IOVAL, rbx mov bl, 0x28 mov rcx, [gs:rbx] AddGlobal G_IOBUF, rcx xor ecx, ecx ; clear the ADP so later code won't try to use it mov [gs:rbx], rcx ;; Get function pointers for WinINet interface InlineString "api-ms-win-core-synch-l1-2-0.dll", rcx, rax call W32_LoadLibraryA AddGlobal G_SYNCHDLL, rax mov rsi, W32_GetProcAddress mov rdi, G_SYNCHDLL GetProcAddress "WaitOnAddress", W32_WaitOnAddress mov rsp, rbp end_def initio %assign dbgoffset1 code_initio - main %warning Initio is at dbgoffset1 bytes ;;; Take a value from the stack and emit it to the output stream as a single byte. start_def ASM, emit, "emit" mov rbp, rsp sub rsp, 0x20 and rsp, -16 mov rbx, G_IOBUF ; get pointer to IO buffer .lp: mov al, [rbx+0] ; get flag for outbound byte waiting and al, al ; test it jz .continue ; no data waitin to be read by upstream mov rax, [rbx] mov G_IOVAL, rax mov rcx, rbx lea rdx, [r15 + G_IOVAL_OFF] mov r8, 1 mov r9, 100 call W32_WaitOnAddress jmp .lp .continue: mov al, dil ; byte to send mov ah, 255 ; set flag xchg ah, al mov [rbx+0], ax ; send the byte popthing rsp mov rsp, rbp end_def emit %assign where code_emit - main %warning Emit is at byte where ;;; Read a single byte from the input stream and put its value on top of the stkack. start_def ASM, key, "key" mov rbp, rsp sub rsp, 0x20 and rsp, -16 mov rbx, G_IOBUF .lp: mov al, [rbx+2] ; get flag for byte available and al, al ; test it jnz .continue ; there's a byte available to read mov rax, [rbx + 2] mov G_IOVAL, rax lea rcx, [rbx + 2] lea rdx, [r15 + G_IOVAL_OFF] mov r8, 1 mov r9, 100 call W32_WaitOnAddress jmp .lp .continue: xor eax, eax ; blank the A register mov al, [rbx+3] ; get the byte pushthing rax ; put it on the stack xor ax, ax ; get 16 bits of zero mov [rbx+2], ax ; clear the flag mov rsp, rbp end_def key ;;; Given a buffer and length, send multiple bytes to the output stream. This is ;;; largely provided as a convenience for situations where IO can be optimized ;;; for block communications. start_def ASM, type, "type" popthing rcx popthing rsi .loop: pushthing [rsi] and rdi, 0xff push rcx push rsi call code_emit pop rsi pop rcx inc rsi loop .loop end_def type ;;; Enable and disable echoing of input to the output stream. Some IO ;;; layers may prefer to allow this to be configurable. Leave them empty ;;; if they don't make sense for your IO layer. start_def ASM, echooff, "-echo" end_def echooff start_def ASM, echoon, "+echo" end_def echoon start_def ASM, setecho, "!echo" end_def setecho start_def ASM, keyq, "key?" pushthing G_IOBUF mov rdi, [rdi] and rdi, 0xff0000 end_def keyq

Lucie Training Dataset Card

The Lucie Training Dataset is a curated collection of text data in English, French, German, Spanish and Italian culled from a variety of sources including: web data, video subtitles, academic papers, digital books, newspapers, and magazines, some of which were processed by Optical Character Recognition (OCR). It also contains samples of diverse programming languages.

The Lucie Training Dataset was used to pretrain Lucie-7B, a foundation LLM with strong capabilities in French and English. Code for data preparation can be found in the training respository for Lucie-7B. Due to the licenses of a few subcorpora, the Lucie Training Dataset is released under a CC BY-NC-SA 4.0. A subset available for commercial use will be released soon.

Table of Contents:

Dataset Description

This dataset is intended to provide extensive and diverse multilingual data for training Large Language Models (LLMs). Here are some of the principal features of the corpus:

  • Data mix:
    • The dataset contains more French than English data -- it is in fact one of the biggest collections of French text data that has been preprocessed for LLM training -- with the aim of minimizing anglo-centric cultural biases.
    • German, Spanish and Italian are also represented in small amounts.
    • Code is included to boost the reasoning capabilities of LLMs.
  • Data filtering and deduplication:
    • The dataset has been cleaned in an effort to remove very low-quality data.
    • Duplicate data samples have been removed to some extent, following best practices.
    • Web data has been filtered to minimize potentially toxic content and personally identifying information.
  • Ethics:
    • Special care has been taken to respect copyright laws and individual privacy. All newspapers, monographies, magazines and legislative documents, as well as most books, are in the public domain (which depends on the author's date of death and the country of publication). Other data are published with permissive licenses (e.g., CC BY or CC BY-SA) or, in very rare cases, CC BY-NC-SA.
    • All web data in the dataset come from sites with robots.txt files that do not forbid crawling.

Sample Metadata

In addition to the text field, which provides the content of the sample, each training sample in the corpus contains the following metadata when available:

  • language: the language of the text sample (note that this information is taken from the original data source and may be incorrect).
    Possible values:
    • the ISO 639-1 code for a given natural language ("en", "fr", "de", "es", or "it"),
    • the name of a programming language prefixed by "code:" ("code:python", "code:c++", …), or
    • a list of ISO 639-1 codes separated by commas for data containing parallel translations ("fr,en", "de,fr", "es,en", "it,en", or one of those pairs in the opposite order if the languages appear in the opposite order in the text).
  • source: an identifier for the source(s) of the text sample (Wikipedia, RedPajama, Gutenberg, …). All sources are described in detail below.
  • id: an identifier that is unique among documents from the same source.
  • url (optional): the URL of the original text sample on the web, if available.
  • title (optional): the title of the original text sample, if available.
  • author (optional): the author of the original text sample, if available.
    Note: The author name is given in plain text, except in the case of Gutenberg books, where it is the JSON serialized object of the author metadata.
  • date (optional): the publication date of the original text sample, if available.
    Note: The text format of the date depends on the source.
  • quality_signals (optional): a list of quality signals for the text sample in JSON format (which could be used for further filtering or sample weighting).
    Note: It can include indicators computed by `fasttext` and `CCNet`, statistics about occurrences of characters, words, special characters, etc.
  • extra (optional): extra information about the text sample, in JSON format. This can include metadata about the source subset, the rights, etc.

The list of metadata available for each source is provided (without the text field) in metadata_examples.json.

Dataset Composition

The following figure shows the distribution of the dataset by language (colors) and category (hatch patterns).

Dataset composition

The following table provides an overview of the dataset composition, broken down by source and language. Sources are grouped by category. The table provides the numbers of documents, words, tokens, and characters for each subset. All numbers in this table are available in the CSV file dataset_composition.csv. Token counts are computed using the tokenizer for Lucie-7B.

Subset Language M docs B words B tokens B chars
TOTAL 2186.562 1356.021 2314.862 8842.200
French (fr) 653.812 583.687 928.618 3619.672 composition details
English (en) 554.289 412.202 611.894 2553.541 composition details
code 125.769 51.306 228.954 630.749 composition details
German (de) 165.915 105.609 206.610 764.779 composition details
Spanish (es) 171.651 123.857 200.825 759.457 composition details
Italian (it) 99.440 62.051 112.031 404.454 composition details
fr-en 410.032 17.016 25.494 107.658 composition details
it-en 1.901 0.100 0.151 0.638
es-en 1.961 0.103 0.143 0.631
de-fr 1.792 0.0908 0.141 0.621

Category: Web

RedPajama French (fr) 640.770 477.758 741.023 2974.596 composition details
German (de) 162.779 103.078 201.371 747.631 composition details
Spanish (es) 169.447 121.751 197.125 746.984 composition details
Italian (it) 97.324 60.194 108.416 393.012 composition details
FineWebEdu English (en) 421.209 327.453 467.837 2018.215 composition details

Category: Newspaper

GallicaPress French (fr) 3.205 67.496 121.606 408.882
AmericanStories English (en) 59.420 8.902 14.313 50.844 composition details

Category: Technical

PeS2o English (en) 38.972 42.296 65.365 268.963
HAL French (fr) 0.349 9.356 16.224 58.308
Theses French (fr) 0.102 7.547 14.060 47.758
Pile (USPTO_Backgrounds) English (en) 5.139 3.492 5.105 22.309
OpenEdition French (fr) 0.939 2.225 3.604 14.459
Pile (PhilPapers) English (en) 0.0308 0.363 0.618 2.304
Pile (NIH_ExPorter) English (en) 0.914 0.288 0.431 1.979

Category: Book

GallicaMonographies French (fr) 0.278 15.106 25.169 90.456
Gutenberg English (en) 0.0563 3.544 5.516 20.579
French (fr) 0.00345 0.227 0.383 1.392
German (de) 0.00188 0.0987 0.193 0.654
Italian (it) 0.000958 0.0657 0.129 0.414
Spanish (es) 0.000735 0.0512 0.0920 0.303

Category: Legislative Texts

Pile (FreeLaw) English (en) 3.415 8.204 14.011 52.580
Eurovoc English (en) 0.272 1.523 2.571 9.468
Italian (it) 0.245 0.731 1.527 4.867
German (de) 0.247 0.678 1.497 4.915
Spanish (es) 0.246 0.757 1.411 4.684
OpenData French (fr) 1.169 0.755 1.209 4.638
QuestionsEcritesParlement French (fr) 0.189 0.108 0.156 0.705
LEGI French (fr) 0.621 0.0878 0.145 0.563
AmendementsParlement French (fr) 0.673 0.0452 0.0738 0.274

Category: Legislative Transcripts

Europarl German (de) 0.0102 0.0451 0.0734 0.327
Spanish (es) 0.0103 0.0524 0.0733 0.325
French (fr) 0.0103 0.0528 0.0717 0.339
English (en) 0.0111 0.0563 0.0690 0.339
DiscoursPublics French (fr) 0.110 0.163 0.238 1.025
InterventionsParlement French (fr) 1.832 0.104 0.157 0.654

Category: Wiki

Wikipedia English (en) 6.893 4.708 7.898 26.616
German (de) 2.877 1.709 3.476 11.252
French (fr) 2.648 1.726 2.940 9.879
Spanish (es) 1.947 1.245 2.124 7.161
Italian (it) 1.870 1.060 1.959 6.161
wikisource French (fr) 0.186 0.523 0.795 3.080
wiktionary French (fr) 0.650 0.0531 0.117 0.347

Category: Math

MathPile English (en) 0.737 3.408 9.637 27.290
Pile (DM_Mathematics) English (en) 0.992 1.746 4.928 8.127

Category: Forum

Pile (StackExchange) English (en) 15.269 4.534 10.275 33.609
Pile (Ubuntu_IRC) English (en) 0.0104 0.867 2.159 5.610

Category: Dialogue

Claire English (en) 0.949 0.818 1.161 4.709 composition details
French (fr) 0.0393 0.210 0.311 1.314 composition details
YouTube French (fr) 0.0375 0.145 0.336 1.003
STAC English (en) 0.0000450 0.0000529 0.000121 0.000327

Category: Multilingual Parallel Corpora

CroissantAligned fr-en 408.029 16.911 25.351 107.003
EuroparlAligned it-en 1.901 0.100 0.151 0.638
fr-en 2.003 0.105 0.143 0.655
es-en 1.961 0.103 0.143 0.631
de-fr 1.792 0.0908 0.141 0.621

Category: Programming

TheStack JAVASCRIPT 21.109 8.526 58.609 141.647
JAVA 20.152 7.421 27.680 89.297
C 8.626 5.916 24.092 57.428
PHP 15.905 4.865 22.883 66.844
PYTHON 12.962 5.434 21.683 64.304
C++ 6.378 4.584 18.835 50.892
C# 10.839 3.574 13.381 46.286
GO 4.730 2.735 10.262 25.738
TYPESCRIPT 10.637 2.617 9.836 28.815
RUST 1.387 0.872 3.241 9.529
RUBY 3.405 0.646 2.392 7.139
SWIFT 1.756 0.553 1.876 6.134
KOTLIN 2.243 0.454 1.758 5.769
SCALA 1.362 0.457 1.587 4.862
TEX 0.398 0.394 1.507 3.805
LUA 0.559 0.318 1.367 3.279
DART 0.933 0.308 1.242 3.864
PERL 0.392 0.297 1.149 2.634
MATHEMATICA 0.0269 0.120 1.117 1.720
ASSEMBLY 0.248 0.209 0.867 1.575
HASKELL 0.545 0.307 0.807 2.364
FORTRAN 0.165 0.192 0.780 1.843
JULIA 0.299 0.152 0.660 1.539
OCAML 0.160 0.130 0.430 1.107
ERLANG 0.0994 0.0657 0.260 0.726
ELIXIR 0.282 0.0731 0.258 0.737
CLOJURE 0.126 0.0448 0.179 0.492
R 0.0392 0.0278 0.158 0.305
MATLAB 0.000967 0.00865 0.0427 0.0372
RACKET 0.00420 0.00479 0.0153 0.0378

Configurable Subsets and Versions

As the Lucie Training Dataset is a collection of multilingual corpora from different sources, it can be divided into subsets based on the source and language of its constituent corpora.
The list of possible configurations is available in the YAML header of this README file. Each configuration corresponds to a pathname pattern in the data subdirectory.

The dataset is also available in the following versions:

  • v1.1 / main (default): The data used for the first (main) pretraining phase of Lucie-7B, which contains approximately 2.3T tokens. The statistics above apply to this version.
  • v1.2: An improved version of the main dataset, where
    • GallicaMonographies and GallicaPress have been fltered aggressively to remove documents with low OCR quality.
    • The Ubuntu_IRC and PhilPapers subsets of Pile have been refined by fixing encoding issues and removing documents in languages other than English, French, Spanish, German and Italian.
  • v1.2-recent-web : The data used for the second pretraining phase (context extension) of Lucie-7B. This version is identical to v1.2 with the exception that older snapshots of web data (before 2023 for RedPajama and before 2024 for FineWebEdu) have been excluded. All data from v1.1 that were not filtered out remain unchanged in v1.2 and v1.2-recent-web.

Except from v1.1, which is a git tag, all versions are git branches in the dataset repository (e.g. v1.2).

The Example use in Python section contains example Python code for loading and iterating over the dataset with different configurations, including source, language and version.

Details on Data Sources

AmendementsParlement

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: Regards citoyens. License: CC BY-SA.
  • Description: A collection of proposed amendments by the French parliament. Documents contain the text of the proposed amendment, the name of the associated law as well as information on who voted on the amendment and what was decided.

AmericanStories

  • Source: dell-research-harvard/AmericanStories. License: CC BY 4.0.
  • Extracted from: Chronicling America. License: Open.
  • Description: "The American Stories dataset is a collection of full article texts extracted from historical U.S. newspaper images. It includes nearly 20 million scans from the public domain Chronicling America collection maintained by the Library of Congress. The dataset is designed to address the challenges posed by complex layouts and low OCR quality in existing newspaper datasets" (from the dataset card). See the dataset composition details for statistics on documents by year. Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Filtering: To filter out documents with excessive OCR errors, the dataset was refined by discarding texts with a perplexity higher than 2310, measured using a CCNET model in English (see code details). The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
  • Citation: Melissa Dell, Jacob Carlson, Tom Bryan, Emily Silcock, Abhishek Arora, Zejiang Shen, Luca D'Amico-Wong, Quan Le, Pablo Querubin and Leander Heldring (2023). "American Stories: A Large-Scale Structured Text Dataset of Historical U.S. Newspapers," arxiv:2308.12477.

Claire (French and English)

  • Sources:
  • Extracted from: see the datacards for the French and English datasets.
  • Description: The Claire datasets are composed of transcripts of spoken conversations -- including parliamentary proceedings, interviews, debates, meetings, and free conversations -- as well as some written conversations from theater plays and written chats. The dataset is designed to help downstream performance of models fine-tuned for tasks requiring the comprehension of spontaneous spoken conversation, such as meeting summarization. Each dialogue is split into speech turns, and each speech turn is labeled with the name of the speaker or a unique identifier. See the composition details for the French dataset and the English dataset for a high-level view of the distribution of different types of documents in each dataset.
  • Citation: Julie Hunter, Jérôme Louradour, Virgile Rennard, Ismaïl Harrando, Guokan Shang, Jean-Pierre Lorré (2023). The Claire French Dialogue Dataset. arXiv:2311.16840.

CroissantAligned

  • Source: croissantllm/croissant_dataset_no_web_data (subset: aligned_36b). License: not specified.
  • Extracted from:
    • Translation pairs: OPUS (99.6% of the data in CroissantAligned). Pairs extracted from OPUS are labeled as "UnbabelFrEn".
    • Thesis abstracts: French thesis abstract pairs. License: ETALAB-Licence-Ouverte-v2.0.
    • Song lyrics: lacoccinelle.
  • Description: CroissantAligned contains samples of parallel French/English (or English/French) data. Data extracted from OPUS takes the form of sentences pairs, where one sentence is in French and the other is in English. OPUS pairs were passed through a custom pipeline designed to select the highest quality translation examples. Selected pairs are labeled "UnbabelFrEn" in the CroissantAligned dataset. The thesis abstract subset contains thesis abstracts paired with translations written by the thesis authors. The song lyrics are translated by contributors to www.lacoccinelle.net. Parallel data are used to boost the multilingual capabilities of models trained on them (Faysse et al.,2024).
  • Pre-processing:
    • Language separation and tagging: The original text field of the Croissant dataset contains a sentence or passage in French or English immediately followed by its translation without any indication of which passage is in which language. The first step was thus to split each text into separate, monolingual passages and tag each passage with the appropriate language code, identified automatically using the langid library (see code details). In the Lucie Training Dataset, the extra metadata field for CroissantAligned contains separate keys, text_fr for French and text_en for English, that stores the texts separately.
    • Random combination of texts prefixed by language: To create the text values, each monolingual text was repaired with its translation, but random separators and various methods of prefixing the text with the language (name or code) were added. This was done as a precaution to prevent models trained on this data from switching languages when generating text and can be seen as a very basic instruction to translate the source (first) text into the target (second) text (see code details).
  • Citation: Manuel Faysse, Patrick Fernandes, Nuno M. Guerreiro, António Loison, Duarte M. Alves, Caio Corro, Nicolas Boizard, João Alves, Ricardo Rei, Pedro H. Martins, Antoni Bigata Casademunt, François Yvon, André F.T. Martins, Gautier Viaud, Céline Hudelot, Pierre Colombo (2024). "CroissantLLM: A Truly Bilingual French-English Language Model," arXiv:2402.00786.

DiscoursPublics

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: Vie Publique. License: ETALAB-Licence-Ouverte-v2.0.
  • Description: A collection of public speeches from the principal public actors in France including speeches from the French President starting from 1974 and from the Prime Minister and members of the government starting from 1980.
  • Pre-processing:
    • Text cleaning: the mention of the source url and the number of views were removed from the text.

Europarl and EuroparlAligned

  • Sources:
  • Description: "The Europarl parallel corpus is extracted from the proceedings of the European Parliament. It includes versions in 21 European languages: Romanic (French, Italian, Spanish, Portuguese, Romanian), Germanic (English, Dutch, German, Danish, Swedish), Slavik (Bulgarian, Czech, Polish, Slovak, Slovene), Finni-Ugric (Finnish, Hungarian, Estonian), Baltic (Latvian, Lithuanian), and Greek. The goal of the extraction and processing was to generate sentence aligned text for statistical machine translation systems" (www.statmt.org).
  • Pre-processing:
    • Random combination of aligned texts prefixed by language: The same process as used for the CroissantAligned dataset was applied to the EuroparlAligned dataset (see code details). In the Lucie Training Dataset, the extra field in the metadata for EuroparlAligned provides texts in the two languages under the sub-fields text_1 and text_2, and the corresponding language codes under lang_1 and lang_2.
  • Citation: Philipp Koehn (2005). "Europarl: A Parallel Corpus for Statistical Machine Translation," MT Summit.

Eurovoc

  • Source: EuropeanParliament/Eurovoc. License: EUPL 1.1.
  • Extracted from: Cellar. License: CC BY-4.0.
  • Description: A collection of mutlilingual documents from the data repository of the Publications Office of the European Union annotated with Eurovoc labels. The corpus contains legal, policy-related, historical and organizational information about the EU. Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Filtering: To filter out documents with excessive OCR errors, the dataset was refined by discarding texts with a perplexity higher than 1500, measured using a CCNET model in English (see code details). The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
    • Text cleaning: Mentions of Credit Institutions Directives (CID) that appears in the raw texts such as (cid:146) were removed.
  • Citations:

FineWebEdu

  • Source: HuggingFaceFW/fineweb-edu. License: ODC-BY.
  • Extracted from: FineWeb. License: ODC-BY.
  • Description: A 1.3 trillion token selection from FineWeb, which contains 15 trillion tokens of curated data from 96 Common Crawl dumps. Content in FineWebEdu has been selected by a custom designed classifier for its high-quality, educational content. Most recent crawl: 2024-10 (see composition details for information about the crawls included in this dataset.)
  • Pre-processing:
    • Removing duplicate urls: urls were removed if their base domain overlapped with a dataset already in the Lucie Training Dataset (e.g., "philpapers.org") in order to increase diversity of content (see code details)
    • Filtering by robots.txt files: we collect robots.txt and remove all documents for which CCBot is disallowed or for which we failed to collect information as of July 2024 in an effort to select data free from opt-out evidence according to the 4th article of the copyright European directive (2019).
  • Citation: Guilherme Penedo, Hynek Kydlíček, Loubna Ben allal, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von Werra, Thomas Wolf (2024). "The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale," arXiv:2406.17557.

GallicaMonographies

  • Source: Corpus contributed by OpenLLM partners. A version is also published here: PleIAs/French-PD-Books. License: Public domain.
  • Extracted from: Gallicagram.
  • Description: A large collection of French monographies in the public domain made available through the French National Library (Gallica). Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Text cleaning for v1.1: To filter out documents with excessive OCR errors, the dataset was split into chunks and chunks were kept if the source language was detected as French by FastText with a confidence score of 0.65 or above, and the perplexity score, as measured using a CCNET model in French, was between 10 and 1000. The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
    • Filtering for v1.2: Using OCR scores provided in the metadata of the source corpus, documents with an OCR score of less than 90 out of 100 were filtered out.

GallicaPress

  • Source: Corpus contributed by OpenLLM partners. A version is also published here: PleIAs/French-PD-Newspapers. License: Public domain.
  • Extracted from: Gallicagram.
  • Description: A large collection of French newspapers and periodicals in the public domain made available through the French National Library (Gallica). Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Text cleaning for v1.1: To filter out documents with excessive OCR errors, the dataset was split into chunks and chunks were kept if the source language was detected as French by FastText with a confidence score of 0.65 or above, and the perplexity score, as measured using a CCNET model in French, was between 10 and 1000 (see code details). The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
    • Filtering for v1.2: Using OCR scores provided in the metadata of the source corpus, documents with an OCR score of less than 90 out of 100 were filtered out.

Gutenberg

  • Source: Corpus compiled by OpenLLM partners.
  • Extracted from:
  • Description: A collection of free eBooks, manually prepared by human annotators.
  • Pre-processing:
    • Filtering: The dataset was filtered based on the author date of death, so that only texts from authors who died more than 70 years ago are included (80 years for French authors). See code details here. This filtering was done to ensure that the texts are in the public domain.
    • Text cleaning: Headers and footers containing information about Project Gutenberg were removed (see code details).

HAL

  • Source: bigscience-data/roots_fr_hal_archives_ouvertes. License: Roots dataset.
  • Extracted from: HAL (Open access).
  • Description: A collection of scientific papers and manuscripts distributed through the open science platform HAL. Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Filtering: To filter out documents with excessive OCR errors, the dataset was refined by discarding texts with a perplexity higher than 930, measured using a CCNET model in French (see code details). The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
  • Citation: Hugo Laurençon, Lucile Saulnier, Thomas Wang, Christopher Akiki, Albert Villanova del Moral, Teven Le Scao, Leandro Von Werra, Chenghao Mou, Eduardo González Ponferrada, Huu Nguyen, Jörg Frohberg, Mario Šaško, Quentin Lhoest, Angelina McMillan-Major, Gerard Dupont, Stella Biderman, Anna Rogers, Loubna Ben allal, Francesco De Toni, Giada Pistilli, Olivier Nguyen, Somaieh Nikpoor, Maraim Masoud, Pierre Colombo, Javier de la Rosa, Paulo Villegas, Tristan Thrush, Shayne Longpre, Sebastian Nagel, Leon Weber, Manuel Muñoz, Jian Zhu, Daniel Van Strien, Zaid Alyafeai, Khalid Almubarak, Minh Chien Vu, Itziar Gonzalez-Dios, Aitor Soroa, Kyle Lo, Manan Dey, Pedro Ortiz Suarez, Aaron Gokaslan, Shamik Bose, David Adelani, Long Phan, Hieu Tran, Ian Yu, Suhas Pai, Jenny Chim, Violette Lepercq, Suzana Ilic, Margaret Mitchell, Sasha Alexandra Luccioni, Yacine Jernite (2022). "The BigScience ROOTS Corpus: A 1.6TB Composite Multilingual Dataset," Advances in Neural Information Processing Systems (NeurIPS), 35, 31809-31826.

InterventionsParlement

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: Regards citoyens. License: CC BY-SA.
  • Description: Transcripts of remarks made during French parlementary debates. Each text contains a continuous remark by a single speaker.

LEGI

  • Source: Corpus contributed by OpenLLM partners. A version is also published here: Nicolas-BZRD/DILA_OPENDATA_FR_2023.
  • Extracted from: OpenData (Data collection date: October, 2023).
  • Description: "The French Government Open Data (DILA) Dataset is a collection of text data extracted from various sources provided by the French government, specifically the Direction de l'information légale et administrative (DILA). This dataset contains a wide range of legal, administrative, and legislative documents. The data has been organized into several categories for easy access and analysis" (from the dataset card).

MathPile (Commercial)

  • Source: GAIR/MathPile_Commercial. License: CC BY-SA 4.0.
  • Extracted from: MathPile. License: CC BY-SA-NC 4.0.
  • Description: A preprocessed collection of documents focused on math, including Textbooks, arXiv, Wikipedia, ProofWiki, StackExchange, and web pages from Common Crawl. The content targets a range of levels, from kindergarten through postgraduate level. MathPile_Commercial was obtained by removing documents from MathPile that do not allow commercial use.
  • Pre-processing:
    • Formatting: Converted the content of StackExchange questions and answers to match the {"text": value} format, using the following formula:
    text = sample["question"]["Body"] + "\n\n".join([answer["Body"] for answer in sample["answers"]])
    
  • Citation: Zengzhi Wang, Rui Xia and Pengfei Liu (2023). "Generative AI for Math: Part I -- MathPile: A Billion-Token-Scale Pretraining Corpus for Math," arXiv:2312.17120.

OpenData

  • Source: Nicolas-BZRD/DILA_OPENDATA_FR_2023 (balo, dole, inca, kali, and sarde subsets). License: ODC-BY.
  • Extracted from: OpenData (Data collection date: October, 2023).
  • Description: "The French Government Open Data (DILA) Dataset is a collection of text data extracted from various sources provided by the French government, specifically the Direction de l'information légale et administrative (DILA). This dataset contains a wide range of legal, administrative, and legislative documents. The data has been organized into several categories for easy access and analysis" (from the dataset card).

OpenEdition

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: Open Edition. License: Open Edition Books.
  • Description: A collection of scientific books, journal articles, blog entries and event descriptions.

PeS2o (v2)

  • Source: allenai/peS2o version v2. License: ODC BY-v1.0.
  • Extracted from: S2ORC (see aclanthology). License: ODC BY-v1.0.
  • Description: A preprocessed collection of academic papers designed for pre-training of language models. PeS2o is composed of two subsets: one containing full papers and one containing only paper titles and abstracts. Dataset containing (some) text retrieved through OCR. Knowledge cutoff: 2023-01-03.
  • Citation: Luca Soldaini and Kyle Lo (2023). "peS2o (Pretraining Efficiently on S2ORC) Dataset," Allen Institute for AI. GitHub.

Pile (Uncopyrighted)

  • Source: monology/pile-uncopyrighted. License: Other.
  • Extracted from: FreeLaw, StackExchange, USPTO Backgrounds, DM Mathematics, Ubuntu IRC, PhilPapers, NIH ExPorter from The Pile. License: MIT.
  • Description (from the Datasheet):
    • FreeLaw: "The Free Law Project is US registered non-profit that provide access to millions of legal opinions and analytical tools for academic studies in the legal realm."
    • StackExchange: "The StackExchange dataset is a dump of anonymized user-contributed content on the Stack Exchange network, a popular collection of websites centered around user-contributed questions and answers."
    • USPTO Backgrounds: "The USPTO Backgrounds dataset is a set of background sections from patents granted by the United States Patent and Trademark Office, derived from its published bulk archives."
    • DM Mathematics: "The DeepMind Mathematics dataset consists of a collection of mathematical problems such as algebra, arithmetic, calculus, number theory, and probability, formatted as natural language prompts Saxton et al., 2019."
    • Ubuntu IRC: "The Ubuntu IRC dataset is derived from the publicly available chatlogs of all Ubunturelated channels on the Freenode IRC chat server."
    • PhilPapers: a dataset of open access philosophy publications from an international database maintained by the Center for Digital Philosophy at the University of Western Ontario.
    • NIH ExPORTER: "The NIH Grant abstracts provides a bulk-data repository for awarded applications through the ExPORTER4 service covering the fiscal years 1985-present."
  • Pre-processing (v1.2 only):
    • Filtering of PhilPapers: Papers were removed if their language, detected using Stanza, was not classified as English, French, German, Spanish or Italian.
    • Filtering and text cleaning of Ubuntu IRC: Texts from some channels were excluded to avoid data from languages other than English, French, German, Spanish or Italian and certain encoding errors were fixed (see code details here).
  • Citations:
    • Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, Connor Leahy (2020). "The Pile: An 800GB Dataset of Diverse Text for Language Modeling," arXiv:2101.00027.
    • Stella Biderman, Kieran Bicheno, Leo Gao (2022). "Datasheet for the Pile," arXiv:2201.07311.

QuestionsEcritesParlement

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: Regards citoyens. License: CC BY-SA.
  • Description: Collection of long written questions, read during a session at the French National Assembly. Questions are asked by a member of the French parliament and addressed to a minister (who is given two months to respond).

RedPajama (v2)

  • Source: togethercomputer/RedPajama-Data-V2. License: Apache 2.0 (data preparation code), Not specified (data) but see Common Crawl terms of use.

  • Extracted from: Common Crawl.

  • Description: "RedPajama-V2 is an open dataset for training large language models. The dataset includes over 100B text documents coming from 84 CommonCrawl snapshots and processed using the CCNet pipeline. Out of these, there are 30B documents in the corpus that additionally come with quality signals, and 20B documents that are deduplicated" (from GitHub). Most recent crawl for French data in the Lucie Training Dataset v1.1: 2023-14. (For more details on the time periods covered by crawls in this dataset see the composition details for French, German, Italian and Spanish.)

  • Pre-processing and deduplication:

    • Url filtering:
      • Removing duplicate urls: urls were removed if their base domain overlapped with a dataset already in the Lucie Training Dataset (e.g., "theses.fr") in order to increase diversity of content (see code details).
      • Filtering certain toxic content: urls from a list of blacklisted content were removed (see code details).
      • Filtering by robots.txt files: we collect robots.txt and remove all documents for which CCBot is disallowed or for which we failed to collect information as of July 2024 in an effort to select data free from opt-out evidence according to the 4th article of the copyright European directive (2019).
    • Filtering: A series of filters were applied using quality signals already available in the dataset. This includes (see code details):
      • CCnet perplexity below 10 or above 1000
      • C4 filtering (including removal of documents that contain toxic words)
      • Gopher filtering and repetition removal
      • Redpajama document deduplication
    • Removal of personally identifying information (PII): email addresses and ip addresses were replaced with random addresses (see code details).
    • MinHash deduplication was performed on each snapshot and language independantly as proposed in FineWeb. For minhash configuration see code details.

    The Datatrove library was used to perform both filtering and deduplication stages.

  • Citation: Together Computer (2023). "RedPajama-Data-v2: an Open Dataset with 30 Trillion Tokens for Training Large Language Models," GitHub.

STAC

  • Source: STAC. License: CC BY-SA-NC 4.0.
  • Description: A collection of multiparty chats from an online version of the game Settlers of Catan. The full STAC corpus contains annotations for discourse structure. We use only the text of the chats.
  • Citation: Nicholas Asher, Julie Hunter, Mathieu Morey, Farah Benamara and Stergos Afantenos (2016). "Discourse structure and dialogue acts in multiparty dialogue: the STAC corpus," The Tenth International Conference on Language Resources and Evaluation (LREC 2016). European Language Resources Association, pp. 2721-2727.

TheStack (v1.2)

  • Source: bigcode/the-stack-dedup. License: Other (mixture of copyleft licenses).
  • Extracted from: GitHub via GHarchive. Mixed licenses for source.
  • Description: "The Stack contains over 6TB of permissively-licensed source code files covering 358 programming languages. The dataset was created as part of the BigCode Project, an open scientific collaboration working on the responsible development of Large Language Models for Code (Code LLMs). The Stack serves as a pre-training dataset for Code LLMs, i.e., code-generating AI systems which enable the synthesis of programs from natural language descriptions as well as other from code snippets. This is the near-deduplicated version with 3TB data" (from the dataset card).
  • Citation: Denis Kocetkov, Raymond Li, Loubna Ben Allal, Jia Li, Chenghao Mou, Carlos Muñoz Ferrandis, Yacine Jernite, Margaret Mitchell, Sean Hughes, Thomas Wolf, Dzmitry Bahdanau, Leandro von Werra and Harm de Vries (2022). "The Stack: 3 TB of permissively licensed source code," arxiv:2211.15533.

Theses

  • Source: Corpus contributed by OpenLLM partners.
  • Extracted from: theses.fr (License: Licence Ouverte / Open Licence version 2.0) and HAL (Open access).
  • Description: A collection of doctoral theses published in France. Dataset containing text retrieved through OCR.
  • Pre-processing:
    • Text cleaning:
      • Title pages about HAL, pages containing a significant fraction of control characters, and duplicate lines were removed (see code details).
      • Because the results of OCR on tables and graphics can give rise to garbage text, the text was cleaned by removing the most suspicious chunks. In particular, a chunk was removed if it was not detected as being written in French, English, Spanish, German or Italian, or if the perplexity of a CCNet Language Model on the chunk was higher than 2000 (see code details). The code to compute CCNET perplexity, parallelizing on parquet files, is available here.
    • Filtering: Texts with fewer than 1000 words or 10000 characters were removed (see code details).

Wikipedia, Wikisource, Wiktionary

YouTube

  • Source: Corpus contributed by LINAGORA Labs (OpenLLM-France) and LeVoiceLab.
  • Extracted from: YouTube.
  • Description: French subtitles from videos published with permissive licenses on YouTube.

Example use in Python

Load the dataset

Load and iterate over the full dataset using the datasets library:

from datasets import load_dataset

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", split="train", streaming=True)

for sample in dataset:
   
   text = sample["text"]

   # … do something with the text

Iterate over a subset

Several configurations are available to select a language, a source, or both, illustrated in the following examples.

The list of possible configurations can be obtained programmatically:

from datasets import load_dataset_builder

config_names = list(load_dataset_builder("OpenLLM-France/Lucie-Training-Dataset").builder_configs)

print(config_names)
['default', 'en', 'fr', 'de', 'es', 'it', 'de,fr', 'es,en', 'fr,en', 'it,en', 'natural', 'code', 'code-assembly', 'code-c', 'code-c#', 'code-c++', 'code-clojure', 'code-dart', 'code-elixir', 'code-erlang', 'code-fortran', 'code-go', 'code-haskell', 'code-java', 'code-javascript', 'code-julia', 'code-kotlin', 'code-lua', 'code-mathematica', 'code-matlab', 'code-ocaml', 'code-perl', 'code-php', 'code-python', 'code-r', 'code-racket', 'code-ruby', 'code-rust', 'code-scala', 'code-swift', 'code-tex', 'code-typescript', 'AmendementsParlement', 'AmericanStories', 'Claire', 'Claire-en', 'Claire-fr', 'CroissantAligned', 'DiscoursPublics', 'Europarl', 'Europarl-de', 'Europarl-en', 'Europarl-es', 'Europarl-fr', 'EuroparlAligned', 'EuroparlAligned-de,fr', 'EuroparlAligned-es,en', 'EuroparlAligned-fr,en', 'EuroparlAligned-it,en', 'Eurovoc', 'Eurovoc-de', 'Eurovoc-en', 'Eurovoc-es', 'Eurovoc-it', 'FineWebEdu', 'GallicaMonographies', 'GallicaPress', 'Gutenberg', 'Gutenberg-de', 'Gutenberg-en', 'Gutenberg-es', 'Gutenberg-fr', 'Gutenberg-it', 'HAL', 'InterventionsParlement', 'LEGI', 'MathPile', 'OpenData', 'OpenEdition', 'PeS2o', 'PeS2o-s2ag', 'PeS2o-s2orc', 'Pile', 'Pile-DM_Mathematics', 'Pile-FreeLaw', 'Pile-NIH_ExPorter', 'Pile-PhilPapers', 'Pile-StackExchange', 'Pile-USPTO_Backgrounds', 'Pile-Ubuntu_IRC', 'QuestionsEcritesParlement', 'RedPajama', 'RedPajama-de', 'RedPajama-es', 'RedPajama-fr', 'RedPajama-it', 'Stac', 'TheStack', 'Theses', 'Wikipedia', 'Wikipedia-de', 'Wikipedia-en', 'Wikipedia-es', 'Wikipedia-fr', 'Wikipedia-it', 'Wikisource', 'Wiktionary', 'YouTube']

Below are some examples of how to load data from different sources and in different languages.

Load data in French:

from datasets import load_dataset

kwargs = dict(split="train", streaming=True)

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "fr", **kwargs)

Load data where French and English are aligned:

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "fr,en", **kwargs)

Load data corresponding to files with programming languages:

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "code", **kwargs)

Load data in Python:

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "code-python", **kwargs)

Load data from Wikipedia (in all available languages):

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "Wikipedia", **kwargs)

Load data from French pages of Wikipedia (wikipedia.fr):

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "Wikipedia-fr", **kwargs)

Load the Pile dataset:

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "Pile", **kwargs)

Load the subset "PhilPapers" from the Pile dataset:

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", "Pile-PhilPapers", **kwargs)

Load a specific version

You can load a specific version with the datasets Python package using the revision parameter of load_dataset(…):

from datasets import load_dataset

kwargs = dict(split="train", streaming=True)

name = None # or a configuration (e.g. "fr", "code-python", "Wikipedia-fr", "Pile-PhilPapers")

dataset = load_dataset("OpenLLM-France/Lucie-Training-Dataset", name, revision="v1.2", **kwargs)

Citation

When using the Lucie Training Dataset, please cite the following paper:

✍ Olivier Gouvert, Julie Hunter, Jérôme Louradour, Evan Dufraisse, Yaya Sy, Pierre-Carl Langlais, Anastasia Stasenko, Laura Rivière, Christophe Cerisara, Jean-Pierre Lorré (2025) Lucie-7B LLM and its training dataset

@misc{openllm2023claire,
      title={The Lucie-7B LLM and the Lucie Training Dataset:
      open resources for multilingual language generation}, 
      author={Olivier Gouvert and Julie Hunter and Jérôme Louradour and Evan Dufraisse and Yaya Sy and Pierre-Carl Langlais and Anastasia Stasenko and Laura Rivière and Christophe Cerisara and Jean-Pierre Lorré},
      year={2025},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Acknowledgements

The Lucie Training Dataset was created by members of LINAGORA and the OpenLLM-France community, including in alphabetical order: Evan Dufraisse (CEA), Olivier Gouvert (LINAGORA), Julie Hunter (LINAGORA), Pierre-Carl Langlais (OpSci/Pleias), Jean-Pierre Lorré (LINAGORA), Jérôme Louradour (LINAGORA), Michel-Marie Maudet (LINAGORA), Laura Rivière (LINAGORA), and Anastasia Stasenko (OpSci/Pleias).

We thank Rachel Bawden (INRIA), Clément Bénesse (Opsci), Christophe Cérisara (LORIA), Olivier Ferret (CEA), Joöl Gombin (Opsci), Ismaïl Harrando (LINAGORA), Jordan Ricker (Opsci), Guokan Shang (MBZUAI), and Yaya Sy (LORIA) for their helpful input.

Data storage and significant parts of the data processing were made possible through the HPC resources from GENCI–IDRIS (Grant 2024-GC011015444).

Contact

[email protected]
Downloads last month
569

Models trained or fine-tuned on OpenLLM-France/Lucie-Training-Dataset

Collections including OpenLLM-France/Lucie-Training-Dataset