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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4bd6dfb5af7cbab527d19eb2f34d6c7f52dd57db | 662 | asm | Assembly | oeis/233/A233667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/233/A233667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/233/A233667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A233667: a(n) = 5*binomial(4*n+10,n)/(2*n+5).
; Submitted by Christian Krause
; 1,10,85,700,5750,47502,395560,3321120,28102425,239503550,2054455634,17726454200,153757722300,1340045361750,11729338225200,103068670351552,908923976461140,8041606944709800,71359997110169625,634978885837495500,5664526697522326590,50650682962892576850,453889854796712054760,4075612302712951476000,36665093717625587236750,330427650970414928938644,2982735815480579151578340,26966442653529787471341040,244153291438657127277935800,2213577099571833514391083750,20094910405422184431525748960
mov $1,$0
mul $0,4
add $0,10
bin $0,$1
mul $0,10
mul $1,2
mov $2,5
add $2,$1
div $0,$2
div $0,2
| 44.133333 | 484 | 0.839879 |
6c9e38d1f18db1b950720e144a36fc0ecaed87ae | 307 | asm | Assembly | examples/mix-c-asm/sources/mynum-rh850.asm | JohnHau/cmake-tutorial | 7ba24e39927fd506ba65fe5387e0b847906030cd | [
"MIT"
] | null | null | null | examples/mix-c-asm/sources/mynum-rh850.asm | JohnHau/cmake-tutorial | 7ba24e39927fd506ba65fe5387e0b847906030cd | [
"MIT"
] | null | null | null | examples/mix-c-asm/sources/mynum-rh850.asm | JohnHau/cmake-tutorial | 7ba24e39927fd506ba65fe5387e0b847906030cd | [
"MIT"
] | null | null | null |
#define SHT_PROGBITS 0x1
PUBLIC _mynum
SECTION `.text`:CODE:NOROOT(2)
CODE
_mynum:
MOV 42,r10
JMP [lp]
SECTION `.iar_vfe_header`:DATA:NOALLOC:NOROOT(2)
SECTION_TYPE SHT_PROGBITS, 0
DATA
DC32 0
END
| 16.157895 | 56 | 0.501629 |
8fa536992e23f7b4f932687be25207b9a16e1313 | 1,852 | asm | Assembly | src/math/pow_double/test/_start.asm | nikAizuddin/lib80386 | 198a5a3490c5ad968dcf13630cafe4d2f22ab2b0 | [
"MIT"
] | 4 | 2015-01-25T13:47:33.000Z | 2021-11-25T12:45:02.000Z | src/math/pow_double/test/_start.asm | nikAizuddin/lib80386 | 198a5a3490c5ad968dcf13630cafe4d2f22ab2b0 | [
"MIT"
] | null | null | null | src/math/pow_double/test/_start.asm | nikAizuddin/lib80386 | 198a5a3490c5ad968dcf13630cafe4d2f22ab2b0 | [
"MIT"
] | 1 | 2021-11-25T12:45:14.000Z | 2021-11-25T12:45:14.000Z | ; 1 2 3 4 5 6 7
;234567890123456789012345678901234567890123456789012345678901234567890
;=====================================================================
;
; *** TEST ***
;
;---------------------------------------------------------------------
;
; AUTHOR: Nik Mohamad Aizuddin bin Nik Azmi
; DATE CREATED: 10-JAN-2015
;
; TEST PURPOSE: Make sure pow_double have no errors.
;
; LANGUAGE: x86 Assembly Language
; SYNTAX: Intel
; ASSEMBLER: NASM
; ARCHITECTURE: i386
; KERNEL: Linux 32-bit
; FORMAT: elf32
;
; EXTERNAL FILES: pow_double.asm
;
;=====================================================================
extern pow_double
global _start
section .bss
t0001_result: resq 1
section .data
t0001_base: dq 9.12
t0001_power: dq 6.73
section .text
_start:
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
; TEST 0001
; Given,
; t0001_base = 9.12,
; t0001_power = 6.73, after calculations
; the t0001_result should be 2889117.879533143
;
; t0001_result = pow_double( t0001_base, t0001_power );
;
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub esp, 16 ;reserve 16 bytes
mov eax, [t0001_base ]
mov ebx, [t0001_base + 4]
mov ecx, [t0001_power ]
mov edx, [t0001_power + 4]
mov [esp ], eax
mov [esp + 4], ebx
mov [esp + 8], ecx
mov [esp + 12], edx
call pow_double
add esp, 16 ;restore 16 bytes
fst qword [t0001_result] ;save return value
exit:
mov eax, 0x01 ;systemcall exit
xor ebx, ebx ;return 0
int 0x80
| 26.084507 | 70 | 0.431965 |
893875fdeb1fc445bf17a025246f2333c36f3e78 | 3,261 | asm | Assembly | pwnlib/shellcraft/templates/i386/linux/syscall.asm | paran0ids0ul/binjitsu | c5a92cdfb6c63e314f4d66994b3fc1646b52a7f7 | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/i386/linux/syscall.asm | paran0ids0ul/binjitsu | c5a92cdfb6c63e314f4d66994b3fc1646b52a7f7 | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/i386/linux/syscall.asm | paran0ids0ul/binjitsu | c5a92cdfb6c63e314f4d66994b3fc1646b52a7f7 | [
"MIT"
] | 1 | 2020-02-26T03:00:40.000Z | 2020-02-26T03:00:40.000Z | <%
from pwnlib.shellcraft import i386
from pwnlib.constants import Constant
from pwnlib.abi import linux_i386_syscall as abi
%>
<%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/>
<%docstring>
Args: [syscall_number, \*args]
Does a syscall
Any of the arguments can be expressions to be evaluated by :func:`pwnlib.constants.eval`.
Example:
>>> print pwnlib.shellcraft.i386.linux.syscall('SYS_execve', 1, 'esp', 2, 0).rstrip()
/* call execve(1, 'esp', 2, 0) */
push (SYS_execve) /* 0xb */
pop eax
push 0x1
pop ebx
mov ecx, esp
push 0x2
pop edx
xor esi, esi
int 0x80
>>> print pwnlib.shellcraft.i386.linux.syscall('SYS_execve', 2, 1, 0, 20).rstrip()
/* call execve(2, 1, 0, 20) */
push (SYS_execve) /* 0xb */
pop eax
push 0x2
pop ebx
push 0x1
pop ecx
push 0x14
pop esi
cdq /* edx=0 */
int 0x80
>>> print pwnlib.shellcraft.i386.linux.syscall().rstrip()
/* call syscall() */
int 0x80
>>> print pwnlib.shellcraft.i386.linux.syscall('eax', 'ebx', 'ecx').rstrip()
/* call syscall('eax', 'ebx', 'ecx') */
/* setregs noop */
int 0x80
>>> print pwnlib.shellcraft.i386.linux.syscall('ebp', None, None, 1).rstrip()
/* call syscall('ebp', ?, ?, 1) */
mov eax, ebp
push 0x1
pop edx
int 0x80
>>> print pwnlib.shellcraft.i386.linux.syscall(
... 'SYS_mmap2', 0, 0x1000,
... 'PROT_READ | PROT_WRITE | PROT_EXEC',
... 'MAP_PRIVATE | MAP_ANONYMOUS',
... -1, 0).rstrip()
/* call mmap2(0, 4096, 'PROT_READ | PROT_WRITE | PROT_EXEC', 'MAP_PRIVATE | MAP_ANONYMOUS', -1, 0) */
xor eax, eax
mov al, 0xc0
xor ebp, ebp
xor ebx, ebx
xor ecx, ecx
mov ch, 0x1000 >> 8
push -1
pop edi
push (PROT_READ | PROT_WRITE | PROT_EXEC) /* 0x7 */
pop edx
push (MAP_PRIVATE | MAP_ANONYMOUS) /* 0x22 */
pop esi
int 0x80
</%docstring>
<%
append_cdq = False
if isinstance(syscall, (str, unicode, Constant)) and str(syscall).startswith('SYS_'):
syscall_repr = str(syscall)[4:] + "(%s)"
args = []
else:
syscall_repr = 'syscall(%s)'
if syscall == None:
args = ['?']
else:
args = [repr(syscall)]
for arg in [arg0, arg1, arg2, arg3, arg4, arg5]:
if arg == None:
args.append('?')
else:
args.append(repr(arg))
while args and args[-1] == '?':
args.pop()
syscall_repr = syscall_repr % ', '.join(args)
registers = abi.register_arguments
arguments = [syscall, arg0, arg1, arg2, arg3, arg4, arg5]
regctx = dict(zip(registers, arguments))
%>\
/* call ${syscall_repr} */
%if any(a is not None for a in arguments):
${i386.setregs(regctx)}
%endif
int 0x80
| 32.287129 | 113 | 0.508126 |
f4d5bd97a834aad05393560e6000c0625e0d25bd | 693 | asm | Assembly | programs/oeis/243/A243887.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/243/A243887.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/243/A243887.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A243887: (p^2 - 3)/2 for odd primes p.
; 3,11,23,59,83,143,179,263,419,479,683,839,923,1103,1403,1739,1859,2243,2519,2663,3119,3443,3959,4703,5099,5303,5723,5939,6383,8063,8579,9383,9659,11099,11399,12323,13283,13943,14963,16019,16379,18239,18623,19403,19799,22259,24863,25763,26219,27143,28559,29039,31499,33023,34583,36179,36719,38363,39479,40043,42923,47123,48359,48983,50243,54779,56783,60203,60899,62303,64439,67343,69563,71819,73343,75659,78803,80399,83639,87779,88619,92879,93743,96359,98123,100799,104423,106259,107183,109043,114719,118583,120539,124499,126503,129539,135719,136763,146339,149603
seq $0,98090 ; Numbers k such that 2k-3 is prime.
sub $0,1
bin $0,2
mul $0,4
sub $0,1
| 77 | 564 | 0.782107 |
c527658227e34dc7f71725d1a05f11b3bc1f68ad | 7,757 | asm | Assembly | src/vectors.asm | rondnelson99/bomb-golf | 34c5fdd360086d415b9487d5a321c451997c7cba | [
"MIT"
] | 1 | 2021-12-04T14:24:34.000Z | 2021-12-04T14:24:34.000Z | src/vectors.asm | rondnelson99/bomb-golf | 34c5fdd360086d415b9487d5a321c451997c7cba | [
"MIT"
] | null | null | null | src/vectors.asm | rondnelson99/bomb-golf | 34c5fdd360086d415b9487d5a321c451997c7cba | [
"MIT"
] | null | null | null |
INCLUDE "defines.asm"
SECTION "Rst $00", ROM0[$00]
NULL::
; This traps jumps to $0000, which is a common "default" pointer
; $FFFF is another one, but reads rIE as the instruction byte
; Thus, we put two `nop`s that may serve as operands, before soft-crashing
; The operand will always be 0, so even jumps will work fine. Nice!
nop
nop
rst Crash
SECTION "Rst $08", ROM0[$08]
; Waits for the next VBlank beginning
; Requires the VBlank handler to be able to trigger, otherwise will loop infinitely
; This means IME should be set, the VBlank interrupt should be selected in IE,
; and the LCD should be turned on.
; WARNING: Be careful if calling this with IME reset (`di`), if this was compiled
; with the `-h` flag, then a hardware bug is very likely to cause this routine to
; go horribly wrong.
; Note: the VBlank handler recognizes being called from this function (through `hVBlankFlag`),
; and does not try to save registers if so. To be safe, consider all registers to be destroyed.
; @destroy Possibly every register. The VBlank handler stops preserving anything when executed from this function
WaitVBlank::
ld a, 1
ldh [hVBlankFlag], a
.wait
halt
jr .wait
SECTION "Rst $10", ROM0[$10 - 1]
MemsetLoop:
ld a, d
assert @ == $10
; You probably don't want to use this for writing to VRAM while the LCD is on. See LCDMemset.
Memset::
ld [hli], a
ld d, a
dec bc
ld a, b
or c
jr nz, MemsetLoop
ret
SECTION "Rst $18", ROM0[$18]
MemcpySmall::
ld a, [de]
ld [hli], a
inc de
dec c
jr nz, MemcpySmall
ret
SECTION "Rst $20", ROM0[$20]
MemsetSmall::
ld [hli], a
dec c
jr nz, MemsetSmall
ret
SECTION "Rst $28", ROM0[$28 - 3]
; Dereferences `hl` and jumps there
; All other registers are passed to the called code intact, except Z is reset
; Soft-crashes if the jump target is in RAM
; @param hl Pointer to an address to jump to
JumpToPtr::
ld a, [hli]
ld h, [hl]
ld l, a
assert @ == $28
; Jump to some address
; All registers are passed to the called code intact, except Z is reset
; (`jp CallHL` is equivalent to `jp hl`, but with the extra error checking on top)
; Soft-crashes if attempting to jump to RAM
; @param hl The address of the code to jump to
CallHL::
bit 7, h
error nz
jp hl
SECTION "Rst $30", ROM0[$30]
; Jumps to some address
; All registers are passed to the target code intact, except Z is reset
; (`jp CallDE` would be equivalent to `jp de` if that instruction existed)
; Soft-crashes if attempting to jump to RAM
; @param de The address of the code to jump to
CallDE::
bit 7, d
push de
ret z ; No jumping to RAM, boy!
rst Crash
SECTION "Rst $38", ROM0[$38]
; Perform a soft-crash. Prints debug info on-screen
Crash::
di ; Doing this as soon as possible to avoid interrupts messing up
jp HandleCrash
SECTION "Handlers", ROM0[$40]
; VBlank handler
push af
ldh a, [hLCDC]
ldh [rLCDC], a
jp VBlankHandler
ds $48 - @
; STAT handler
push af
push hl
jp STATHandler
ds $50 - @
; Timer handler
rst $38
ds $58 - @
; Serial handler
rst $38
ds $60 - @
; Joypad handler (useless)
rst $38
SECTION "STAT Handler", ROM0
STATHandler: ;this handler processes a table full of LYC values and things to write to LCDC.
;the format is like this:
; 1: *NEXT* scaline number minus 1 for handling time
; 2: value to write to LCDC on the *CURRENT* LYC scanline
; this can repeat up to 128 times, but the table must start on a page boundary
; at the end of the table, the next scanline number should be 1 for the music update on the next frame
LYC_TABLE_END equ 1
EXPORT LYC_TABLE_END
;to avoid breaking VRAM writes, the LYC handler must take between 87 and 109 cycles,
;and should only mess with PPU registers after cycle 87 (which is guaranteed to me mode 0 or mode 2)
;we've already used 12 cycles
ldh a, [rLYC] ;check if LYC=1, because I'll use that for music drivers and resetting the LYC table index
dec a
jr z, STATHandlerLYOne ;now we've used 18 cycles
;we have this table full of values to write to rLCDC and line numbers for the next interrupt
ldh a, [hLYCTableHigh]
ld h, a
ldh a, [hLYCTableLow]
ld l, a ;so now we've got the pointer to the table
;we've used 26 cycles now
ld a, [hl+] ;this is the line number when the next LYC should fire
ldh [rLYC], a
ld a, [hl+] ;and this is the value we should write to rLCDC once the PPU reaches the end of the line
ld h, a ;we're done with h now, so we may as well store the value here instead of pushing bc or de.
;we've used 34 cycles now
ld a, l ;now we store the LYC table pointer
ldh [hLYCTableLow], a
ld a, h ;get the pop done ahead of time
pop hl
;and that's 42 cycles. now we have to sleep for 43 more cycles, then do the write and get out of there.
;calling a ret takes 10 cycles
call UncoditionalRet
call UncoditionalRet
call UncoditionalRet
call UncoditionalRet
;now sleep for 3 cycles
nop
nop
nop
;do the write. The actual write happends on the third cycle, which will be the 88th cycle when we're guaranteed to be in Hblank.
ldh [rLCDC], a
;and finish up
pop af
reti
STATHandlerLYOne: ;this special case will handle music updates and resetting the LYC table
xor a ;reset the LYC table pointer
ldh [hLYCTableLow], a
ld l, a
ldh a, [hLYCTableHigh]
ld h, a ;now hl points to the start of the table
ld a, [hl+]
ldh [rLYC], a ;prepare the next LYC
inc l ;skip the argument for LYC=0
ld a, l
ldh [hLYCTableLow], a
ei
;now update music
;busy-loop for the start of Hblank so we can return safely without messing up any VRAM accesses
ld hl, rSTAT
; Wait until Mode is -NOT- 0 or 1
.waitNotBlank
bit 1, [hl]
jr z, .waitNotBlank
; Wait until Mode 0 or 1 -BEGINS- (but we know that Mode 0 is what will begin)
.waitBlank
bit 1, [hl]
jr nz, .waitBlank
pop hl
pop af
ret
SECTION "STAT HRAM", HRAM
hLYCTableLow: ;this is overwritten after every LYC as we advance through this table
ds 1
hLYCTableHigh:: ;the high byte is not written, so we assume that the whole table is on one page, but we can use this to point the handler to multiple tables.
ds 1
SECTION "VBlank handler", ROM0
VBlankHandler:
ldh a, [hSCY]
ldh [rSCY], a
ldh a, [hSCX]
ldh [rSCX], a
ldh a, [hBGP]
ldh [rBGP], a
ldh a, [hOBP0]
ldh [rOBP0], a
ldh a, [hOBP1]
ldh [rOBP1], a
; OAM DMA can occur late in the handler, because it will still work even
; outside of VBlank. Sprites just will not appear on the scanline(s)
; during which it's running.
ldh a, [hOAMHigh]
and a
jr z, .noOAMTransfer
call hOAMDMA
xor a
ldh [hOAMHigh], a
.noOAMTransfer
; Put all operations that cannot be interrupted above this line
; For example, OAM DMA (can't jump to ROM in the middle of it),
; VRAM accesses (can't screw up timing), etc
ei
ldh a, [hVBlankFlag]
and a
jr z, .lagFrame
xor a
ldh [hVBlankFlag], a
pop af ; Pop off return address as well to exit infinite loop
.lagFrame
pop af
ret
SECTION "VBlank HRAM", HRAM
; DO NOT TOUCH THIS
; When this flag is set, the VBlank handler will assume the caller is `WaitVBlank`,
; and attempt to exit it. You don't want that to happen outside of that function.
hVBlankFlag:: db
; High byte of the address of the OAM buffer to use.
; When this is non-zero, the VBlank handler will write that value to rDMA, and
; reset it.
hOAMHigh:: db
; Shadow registers for a bunch of hardware regs.
; Writing to these causes them to take effect more or less immediately, so these
; are copied to the hardware regs by the VBlank handler, taking effect between frames.
; They also come in handy for "resetting" them if modifying them mid-frame for raster FX.
hLCDC:: db
hSCY:: db
hSCX:: db
hBGP:: db
hOBP0:: db
hOBP1:: db
; If this is 0, pressing SsAB at the same time will not reset the game
hCanSoftReset:: db
| 26.384354 | 157 | 0.714838 |
221bfe90e9129eb19b025b95d566de1b0e7d3864 | 1,097 | asm | Assembly | src/1_cleanmemory/cleanmem.asm | redconfetti/atari-asm | bff5c0dc5c7437a7d73f1b7b733b661b36aee9b0 | [
"MIT"
] | null | null | null | src/1_cleanmemory/cleanmem.asm | redconfetti/atari-asm | bff5c0dc5c7437a7d73f1b7b733b661b36aee9b0 | [
"MIT"
] | null | null | null | src/1_cleanmemory/cleanmem.asm | redconfetti/atari-asm | bff5c0dc5c7437a7d73f1b7b733b661b36aee9b0 | [
"MIT"
] | null | null | null | processor 6502
seg code
org $F000 ; define the code origin at $F000
Start:
sei ; disable interrupts
cld ; disable the BCD decimal math mode
ldx #$FF ; loads the X register with #$FF
txs ; transfer X register to S(tack) register
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clear the Zero Page region ($00 to $FF)
; Meaning the entire TIA register space and also RAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lda #0 ; A = 0
ldx #$FF ; X = #$FF
sta $FF ; make sure $FF is zeroed before the loop starts
MemLoop:
dex ; x--
sta $0,X ; store zero at address $0 + X
bne MemLoop ; loop until X==0 (z-flag set)
; z-flag is only set if decrement reaches zero
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Fill ROM size to exactly 4KB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $FFFC ; force to 4 bytes before end position
.word Start ; reset vector at $FFFC (where program starts)
.word Start ; interrupt vector at $FFFE (unused in Atari VCS)
| 35.387097 | 63 | 0.499544 |
7945b043f6d51516d6de5a7ce88f01a43eaafc79 | 6,498 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_994.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_994.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_994.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x73b3, %r11
nop
nop
nop
nop
and %r10, %r10
movb $0x61, (%r11)
nop
nop
nop
nop
nop
add $50784, %r8
lea addresses_normal_ht+0x1acbf, %r14
nop
nop
nop
nop
nop
inc %r9
movw $0x6162, (%r14)
nop
nop
nop
nop
lfence
lea addresses_WT_ht+0xf5f, %r9
sub %r14, %r14
mov $0x6162636465666768, %r8
movq %r8, (%r9)
nop
nop
inc %r9
lea addresses_A_ht+0x8f5f, %r15
nop
nop
nop
nop
nop
dec %r10
movw $0x6162, (%r15)
nop
nop
nop
nop
nop
inc %r9
lea addresses_WC_ht+0xb25f, %rsi
nop
nop
nop
nop
sub $16459, %r9
movups (%rsi), %xmm7
vpextrq $0, %xmm7, %r11
add %r15, %r15
lea addresses_WT_ht+0x435f, %rsi
lea addresses_D_ht+0x26af, %rdi
inc %r10
mov $108, %rcx
rep movsq
nop
nop
nop
and $49037, %r10
lea addresses_WT_ht+0x1d1df, %r9
nop
nop
and $37413, %r14
vmovups (%r9), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rcx
nop
nop
nop
inc %r9
lea addresses_WT_ht+0x16f5f, %rsi
and %r8, %r8
mov (%rsi), %r10
nop
sub %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_normal+0xf75f, %rsi
lea addresses_normal+0x8adf, %rdi
nop
xor %r14, %r14
mov $18, %rcx
rep movsq
nop
cmp $46271, %rcx
// REPMOV
lea addresses_UC+0x183ef, %rsi
lea addresses_PSE+0x1575f, %rdi
clflush (%rdi)
add $6417, %r13
mov $14, %rcx
rep movsl
nop
nop
nop
add %r13, %r13
// Faulty Load
lea addresses_UC+0xdf5f, %r10
nop
cmp $41946, %r14
vmovups (%r10), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rsi
lea oracles, %rdx
and $0xff, %rsi
shlq $12, %rsi
mov (%rdx,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_PSE', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 36.920455 | 2,999 | 0.657741 |
db7ec795baac20e57d134eb3b0888263e57a41bb | 309 | asm | Assembly | programs/oeis/280/A280560.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/280/A280560.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/280/A280560.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A280560: a(n) = (-1)^n * 2 if n!=0, with a(0) = 1.
; 1,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2
sub $0,1
mod $0,2
mul $0,12
add $0,1
pow $0,2
sub $0,79
div $0,39
| 28.090909 | 188 | 0.440129 |
cc04d320b0ad1f2cbfcc05ab96c11c4622c9848d | 737 | asm | Assembly | oeis/055/A055494.asm | loda-lang/loda-programs | 773fe0baed2ca30c72b7faf16c0801749f2e6f9a | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/055/A055494.asm | loda-lang/loda-programs | 773fe0baed2ca30c72b7faf16c0801749f2e6f9a | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/055/A055494.asm | loda-lang/loda-programs | 773fe0baed2ca30c72b7faf16c0801749f2e6f9a | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A055494: Numbers k such that k^2 - k + 1 is prime.
; Submitted by Jon Maiga
; 2,3,4,6,7,9,13,15,16,18,21,22,25,28,34,39,42,51,55,58,60,63,67,70,72,76,78,79,81,90,91,100,102,106,111,112,118,120,132,139,142,144,148,151,154,156,162,163,165,168,169,174,177,189,190,193,195,204,207,210,216,219,232,237,246,247,267,273,279,280,288,289,291,294,310,315,330,333,337,343,345,349,352,358,370,379,382,384,393,396,399,403,405,406,415,417,427,435,436,448
mov $2,$0
pow $2,2
add $2,1
mov $6,1
lpb $2
mov $3,$1
add $5,$1
add $3,$5
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,$6
add $1,1
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
sub $5,2
lpe
div $1,2
mov $0,$1
add $0,1
| 27.296296 | 364 | 0.641791 |
f2b1ac70733ea0b7f5d5b3e50f7c23aded186ac7 | 17,607 | asm | Assembly | Snake/Snake.asm | samyvic/Snake | c1ad2f32ab73ca538db3f70cc2dbc3e587cdd1d5 | [
"Apache-2.0"
] | null | null | null | Snake/Snake.asm | samyvic/Snake | c1ad2f32ab73ca538db3f70cc2dbc3e587cdd1d5 | [
"Apache-2.0"
] | null | null | null | Snake/Snake.asm | samyvic/Snake | c1ad2f32ab73ca538db3f70cc2dbc3e587cdd1d5 | [
"Apache-2.0"
] | null | null | null | TITLE Snake V1 (Snake.asm)
;Authors :
;Mostafa Abobakr
;Ahmed Samy
;Mostafa Ramzy
;Mahmoud Diab
;Mohamed Mahmoud Omar
;This project is built by 32 assembly using Ivrine32 library
;Github
;Repo Link : https://github.com/samyvic/Snake
; ReadMe Link : https://github.com/samyvic/Snake/blob/main/README.md
;LICENSE Link : https://github.com/samyvic/Snake/blob/main/LICENSE
; Files:
INCLUDE Irvine32.inc ; GoToXY, Random32, Randomize
INCLUDELIB user32.lib ; GetKeyState
; Macros:
mGotoxy MACRO X:REQ, Y:REQ ; make the cursor going to x,y coordinates
PUSH EDX
MOV DH, Y
MOV DL, X
CALL Gotoxy
POP EDX
ENDM
mWrite MACRO text:REQ ; Write string literals.
LOCAL string
.data
string BYTE text, 0
.code
PUSH EDX
MOV EDX, OFFSET string
CALL WriteString
POP EDX
ENDM
mWriteString MACRO buffer:REQ ; Write string variables
PUSH EDX
MOV EDX, OFFSET buffer
CALL WriteString
POP EDX
ENDM
mReadString MACRO var:REQ ; Read string from console
PUSH ECX
PUSH EDX
MOV EDX, OFFSET var
MOV ECX, SIZEOF var
CALL ReadString
POP EDX
POP ECX
ENDM
; Structs:
AXIS STRUCT ; Struct used to put the seed of food and keep track of snake body.
x BYTE 0
y BYTE 0
AXIS ENDS
; KeyCodes:
VK_LEFT EQU 25h ; key code for left arrow
VK_UP EQU 26h ; key code for up arrow
VK_RIGHT EQU 27h ; key code for right arrow
VK_DOWN EQU 28h ; key code for down arrow
;Some vars
; Game "Window" Setup:
maxX EQU 79 ; Fits standard console size
maxY EQU 23
wallHor EQU "--------------------------------------------------------------------------------"
wallVert EQU '|'
maxSize EQU 255
; Prototypes:
GetKeyState PROTO STDCALL, nVirtKey:DWORD
;data
.data
speed DWORD 100 ; How fast we update the sleep function in ms
playerName BYTE 13 + 1 DUP (?)
choice BYTE 0 ; menu selection variable
score DWORD 0
foodChar BYTE '0'
snakeChar BYTE 'O'
FsnakeChar BYTE '#'
foodPoint AXIS <0,0>
SnakeBody AXIS maxSize DUP(<0,0>)
currentX BYTE 40 ; X of headsnake
currentY BYTE 10 ; Y of headsnake
headIndex BYTE 3 ; index of headsnake in array of 255 elements
headIndextest BYTE 3 ; index of headsnake in array of 255 elements
tailIndex BYTE 0 ; index of headsnake in array of 255 elements
RIGHT BYTE 1 ; Initialize with snake moving right
LEFT BYTE 0
UP BYTE 0
DOWN BYTE 0
lives BYTE 3
;Begin of the code
.code
main PROC
; our main process that handles all the logics and functions
CALL DrawTitleScreen ; Load Title Screen(first of all)
CALL DrawMainMenu ; entering name and level(starting the game)
CALL ClrScr
CALL PrintWalls ; printing the walls of the game
CALL GenerateFood ; using randomize to produce a food seed
X00:
CALL Grow ; Checking a the snake ate the food, produce a new one
CALL KeySync ; Getting directions from the player
X01:
CALL IsCollision ; check if the snake collides with the wall
CMP EAX, 1 ; EAX holds whether game is over or not
JNE X02 ; Continue if there is no collision
JMP X03 ; If the snake hit the wall, jump to GameOver
X02:
CALL MoveSnake ; Keep the snake moving
CALL ScoureInfo ; updating the score
JMP X00 ; loop to get a new direction from keySync
X03:
INVOKE Sleep, 100
CALL DrawGameOver
RET
main ENDP
;This function used to draw the window walls in all game windows
PrintWalls PROC ; Draw Walls to screen
mGotoxy 0, 1
mWrite wallHor
mGotoxy 0, maxY ; Draw top and bottom walls
mWrite wallHor
MOV CL, maxY - 1 ; Prepare CL for vertical wall placement
X00:
CMP CL, 1 ; WHILE CL != 0
JE X01 ; IF it does, exit WHILE loop
mGotoxy 0, CL ; Write left wall piece
mWrite wallVert
mGotoxy maxX, CL
mWrite wallVert ; Write right wall piece
DEC CL ; travel up the screen until all are placed
JMP X00 ; Jump to top of WHILE loop
X01:
RET
PrintWalls ENDP
;Start game window
DrawTitleScreen PROC ; Writes the title screen stuff, nothing special
CALL ClrScr
CALL PrintWalls
MOV EAX, cyan+ (black * 16) ;make ASCII Title "Snake" cyan
CALL SetTextColor
mGotoxy 22, 3 ; Draw ASCII Title "Snake"
mWrite " _____ _ "
mGotoxy 22, 4
mWrite "/ ___| | | "
mGotoxy 22, 5
mWrite "\ `--. _ __ __ _ | | __ ___ "
mGotoxy 22, 6
mWrite " `--. \| '_ \ / _` || |/ // _ \"
mGotoxy 22, 7
mWrite "/\__/ /| | | || (_| || <| __/"
mGotoxy 22, 8
mWrite "\____/ |_| |_| \__,_||_|\_\\___|"
MOV EAX, white + (black * 16) ;make our names white
CALL SetTextColor
mGotoxy 32, 10 ; the project name and our names
mWrite "Snake's team"
mGotoxy 29, 12
mWrite "1-Mostafa abo bakr"
mGotoxy 29, 13
mWrite "2-Ahmed Samy"
mGotoxy 29, 14
mWrite "3-Mahmoud diab"
mGotoxy 29, 15
mWrite "4-Mostafa ramzy"
mGotoxy 29, 16
mWrite "5-Mohamed Mahmoud Omar"
MOV EAX, red + (black * 16) ; make the waiting msg red color
CALL SetTextColor
mGotoxy 26,18 ; waiting msg "press any key to containue..."
CALL WaitMsg
mGotoxy 0,0
MOV EAX, white + (black * 16) ; reset color to white
CALL SetTextColor
RET
DrawTitleScreen ENDP
;This function display main menu to make user able to choose game Levels and type his name
DrawMainMenu PROC
CALL ClrScr
CALL PrintWalls
MOV EAX, cyan + (black * 16) ; make the next text cyan
CALL SetTextColor
mGotoxy 26, 7
mWrite "Enter Name to continue: " ; ask the playes to input his name
mReadString playerName
mGotoxy 30, 10
mWrite "Select level you want..." ; ask the player to select the level
MOV EAX, Red + (black * 16) ; make the list of level red color
CALL SetTextColor
mGotoxy 30, 12 ; We have three level(Easy-Normal-Hard)
mWrite "0) Easy" ;the speed of the game is differant in each level
mGotoxy 30, 13 ;the initial speed in the first level is 100 and dec by 25 ms in each level
mWrite "1) Normal"
mGotoxy 30, 14
mWrite "2) Hard"
mGotoxy 30, 15
mWrite "Selection: "
CALL ReadChar
MOV choice, AL ; get the level choice
CALL WriteChar
; if the choice is "0"
CMP choice, '0' ; that means this is the first level
JNE X00 ; if the choice isn't "0" check the other cases
MOV speed, 100 ; if the is "0" set the speed 100ms
JMP X02
X00:
CMP choice, '1' ; Same as above case
JNE X01
MOV speed, 75
JMP X02
X01:
CMP choice, '2' ; Same as above case
JNE X02
MOV speed, 50
JMP X02
X02:
INVOKE Sleep, 100
mGotoxy 0, 0 ; Reset cursor, clear screen
CALL ClrScr ; Exit main menu
MOV EAX, cyan + (black * 16) ; make the color cyan
CALL SetTextColor
RET
DrawMainMenu ENDP
ScoureInfo PROC ; Display scoure and player name
MOV EAX, green + (black * 16) ; scoure color green
CALL SetTextColor
mGotoxy 2, 0
mWrite "Score: "
MOV EAX, score ; Displays all info on top of the screen
CALL WriteInt
MOV EAX, green + (black * 16) ; name color green
CALL SetTextColor
mGotoxy 18, 0
mWrite "Name: "
mWriteString OFFSET playerName
MOV EAX, green + (black * 16) ; time delay color green
CALL SetTextColor
mGotoxy 34, 0
mWrite "Time Delay: "
MOV EAX, speed ; Displays time delay
CALL WriteInt
MOV EAX, green + (black * 16) ; lives color green
CALL SetTextColor
mGotoxy 56, 0
mWrite "Lives: "
MOV al, lives ; Displays lives
CALL WriteInt
MOV EAX, cyan + (black * 16) ; reset the color to cyan
CALL SetTextColor
RET
ScoureInfo ENDP
GenerateFood PROC ; Put food on a random point
CALL Randomize ; Produce new random seed
; Random X Coordinate
CALL Random32 ; Generates a random value between 0 and FFFFFFFFh
XOR EDX, EDX ; Quickly clears EDX (faster than moving a zero to edx)
MOV ECX, maxX - 3
DIV ECX ; DIV EAX by ECX, then store EAX=Quotient, EDX=Remainder
INC DL
INC DL ; Fixing a bug (printing the food in the wall)
MOV foodPoint.x, DL ; Get the x coordinates of the food and store it infoodPoint.x
; Random Y Coordinate, same deal
CALL Random32
XOR EDX, EDX
MOV ECX, maxY - 3
DIV ECX
INC DL
INC DL
MOV foodPoint.y, DL
mGotoxy foodPoint.x, foodPoint.y ; Move cursor to the calculated random coordinate
MOV AL, foodChar
CALL WriteChar ; print food character on screen
RET
GenerateFood ENDP
Grow PROC ; Check if snake ate the food
MOV AH, currentX
MOV AL, currentY
CMP AH, FoodPoint.x ; If the snake X is equal to food X
JNE X00 ; IF not, Exit PROC
CMP AL, FoodPoint.y ; If the snake Y is equal to food Y
JNE X00
CALL GenerateFood ; IF the snake is "colliding" with Food
INC headIndex ; Move head index for new growth
ADD score, 1 ; Score is incremented after eating by +1
X00:
RET
Grow ENDP
SetDirection PROC, R:BYTE, L:BYTE, U:BYTE, D:BYTE
MOV DL, R ; When the right arrow is pressed, then set the direction to move right
MOV RIGHT, DL
MOV DL, L ; same logic for the other arrows
MOV LEFT, DL
MOV DL, U
MOV UP, DL
MOV DL, D
MOV DOWN, DL
RET
SetDirection ENDP
KeySync PROC ; Handles arrow key presses
X00:
MOV AH, 0 ; Make AH equal zero to work on it
INVOKE GetKeyState, VK_DOWN ; getting states of key was pressed
CMP AH, 0 ; if the key Pressed? so AH is 1 --> Key Is Pressed
JE X01 ; id not pressed, jump to next logic
CMP currentY, maxY ; Are our snake in bounds?
JNL X08 ; if not within bounds jump to X08 which just retrn
CMP UP, 1 ; checking current direction of the snake
JE X08 ; return if we clicked in opposite direction of snake
INC currentY ; if all above conditions are true , Increment y index
INVOKE SetDirection, 0, 0, 0, 1 ; Travel in -y direction, DOWN is set
RET
;note that the next three logics works as same as the previous one so no need to add comments
X01:
MOV AH, 0
INVOKE GetKeyState, VK_UP
CMP AH, 0
JE X02
CMP currentY, 0
JNG X08
CMP DOWN, 1
JE X08
DEC currentY
INVOKE SetDirection, 0, 0, 1, 0
RET
X02:
MOV AH, 0
INVOKE GetKeyState, VK_LEFT
CMP AH, 0
JE X03
CMP currentX, 0
JNG X08
CMP RIGHT, 1
JE X08
DEC currentX
INVOKE SetDirection, 0, 1, 0, 0
RET
X03:
MOV AH, 0
INVOKE GetKeyState, VK_RIGHT
CMP AH, 0
JE X04
CMP currentX, maxX
JNL X08
CMP LEFT, 1
JE X08
INC currentX
INVOKE SetDirection, 1, 0, 0, 0
RET
; the next logics to make the snake in contionous moving if we didnt changed the direction!
X04:
CMP RIGHT, 0 ; have we changed our direction?
JE X05 ; if RIGHT has been changed jump to next logic
CMP currentX, maxX ; Are we out of bounds?
JNL X08 ; if out of bounds, just return
INC currentX ; if above conditions are true , travel x direction
ret
;the next three logics as same as the previous one!
X05:
CMP LEFT, 0
JE X06
CMP currentX, 0
JNG X08
DEC currentX
ret
X06:
CMP UP, 0
JE X07
CMP currentY, 0
JNG X08
DEC currentY
ret
X07:
CMP DOWN, 0
JE X08
CMP currentY, maxY
JNL X08
INC currentY
ret
X08:
RET
KeySync ENDP
MoveSnake PROC
MOV ECX, 0
MOV CL, headIndex ; Head index in the snakebody array
MOV AL, currentX ; new (updated) current X and Y coordinates of the snake head
MOV AH, currentY ; moving them to AL and Ah
MOV SnakeBody[2 * ECX].x, AL ; moving the snake body to the new position
MOV SnakeBody[2 * ECX].y, AH ; [2*ECX] --> each array element is 2 bytes
mGotoxy SnakeBody[2 * ECX].x, SnakeBody[2 * ECX].y ; moving the cursor to the new postion
MOV AL, snakeChar
CALL WriteChar ; printing a snakechar to the screen
INVOKE Sleep, speed ; Suspends execution, for a specified interval equals to the interval of speed
MOV ECX, 0
MOV CL, tailIndex ; Tail index in the snakebody array
mGotoxy SnakeBody[2 * ECX].x, SnakeBody[2 * ECX].y ; Go to the coordinates of the old tail
mWrite " " ; Delete the old tail
INC tailIndex ; Update the tail index (moving one step)
INC headIndex ; Udpate the head index (moving one step)
CMP headIndex, maxSize ; If the head reaches the end of the array
JNE X01
MOV headIndex, 0 ; make the head index start again from the begining
X00:
CMP tailIndex, maxSize ; If the tail reaches the end of the array
JNE X01
MOV tailIndex, 0 ; make the tail index start again from the begining
X01:
RET
MoveSnake ENDP
;this proc check that the snake hits the border to enter it on "game over"
;This figure shows the boundaries that if the snake hits it, it gets game over
;------(1 1 1 1)-------
;| |
;| |
;(0 0 0) (maxX)
;| |
;| |
;| |
;|-----(maxY)---------|
;1---> top
;0--->left
;(maxX)---> Right
;(maxY)---> Bottom
IsCollision PROc
CMP currentX, 0 ; Did the snake hit the left side??
JE X00
CMP currentY, 1 ; Did the snake hit the top side??
JE X00
CMP currentX, maxX ; Did the snake hit the right side..??
JE X00
CMP currentY, maxY ; Did the snake hit the bottom side..??
JE X00
JMP X01 ; if the snake didn't hit any walls ...jamp
X00:
DEC lives ;when the snake hit the wall decrease one live
MOV cl, lives
CMP cl,0
JNE X02 ;IF CL > 0 , reset the snake position and continue playing
MOV EAX, 1 ;when EAX is equal 1 , then go to game over
RET
X02:
CALL ClrScr
call printwalls
call ScoureInfo
call generateFood
call grow
call ResetData
jmp X01
X01:
MOV EAX, 0 ; 0 means that the game is not over .
RET
IsCollision ENDP
DrawGameOver PROC ; Draw game over screen with showing score
CALL Clrscr
CALL PrintWalls
MOV EAX, Red+ (black * 16) ;make ASCII Title "Game Over" Red
CALL SetTextColor
mGotoxy 7, 3 ; Draw ASCII Title "Game Over"
mWrite " ________ ________ "
mGotoxy 7, 4
mWrite " / _____/_____ _____ ____ \_____ \___ __ ___________ "
mGotoxy 7, 5
mWrite "/ \ ___\__ \ / \_/ __ \ / | \ \/ // __ \_ __ \"
mGotoxy 7, 6
mWrite "\ \_\ \/ __ \| Y Y \ ___/ / | \ /\ ___/| | \/"
mGotoxy 7, 7
mWrite " \______ (____ /__|_| /\___ > \_______ /\_/ \___ >__| "
mGotoxy 7, 8
mWrite " \/ \/ \/ \/ \/ \/ "
mGotoxy 30, 13
mWrite "Final Score:"
mGotoxy 42, 13
MOV EAX, score ; Reset screen and display score
CALL WriteInt
INVOKE Sleep, 5000
mGotoxy 30, 16 ; waiting msg "press any key to containue..."
CALL WaitMsg
mGotoxy 0,0
MOV EAX, white + (black * 16) ; reset color to white
MOV lives,3
CALL ResetData
CALL main ; Load Title Screen again
RET
DrawGameOver ENDP
ResetData PROC
MOV currentX, 40
MOV currentY, 10
MOV headIndex, 3
MOV tailIndex, 0
INVOKE SetDirection, 1,0,0,0
RET
ResetData ENDP
END main | 27.553991 | 135 | 0.556597 |
1ec7aaa4f6d9596f15420e0cfb95c4b1fdf5e613 | 5,671 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_252.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_252.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_252.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 %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x165de, %rsi
lea addresses_A_ht+0x9d5e, %rdi
nop
and $46537, %r9
mov $92, %rcx
rep movsq
add %r8, %r8
lea addresses_normal_ht+0x71de, %rsi
lea addresses_WT_ht+0x79c7, %rdi
nop
nop
nop
lfence
mov $40, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $33444, %rdi
lea addresses_WC_ht+0x17a4e, %r9
nop
xor %rax, %rax
movl $0x61626364, (%r9)
nop
nop
dec %rdi
lea addresses_A_ht+0xc31e, %rsi
add %rax, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
add %rsi, %rsi
lea addresses_D_ht+0x1cbae, %rsi
lea addresses_A_ht+0x18de, %rdi
dec %r13
mov $71, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $52889, %rbx
lea addresses_WC_ht+0xe9de, %rsi
nop
nop
nop
nop
cmp %rcx, %rcx
mov $0x6162636465666768, %r9
movq %r9, (%rsi)
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0xac1e, %rbx
nop
nop
dec %r13
movw $0x6162, (%rbx)
nop
nop
nop
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rax
push %rdi
// Faulty Load
lea addresses_WT+0x75de, %rax
nop
nop
nop
nop
nop
cmp %r10, %r10
movb (%rax), %r15b
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rdi
pop %rax
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 41.394161 | 2,999 | 0.66073 |
8afcef2903e6cdbc364e033ed5a8bccd1cb5321b | 7,175 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1816.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1816.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca_notsx.log_21829_1816.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xea33, %r13
dec %r8
movl $0x61626364, (%r13)
and $23289, %rdx
lea addresses_A_ht+0x1ecab, %r15
and $15113, %r11
movw $0x6162, (%r15)
nop
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_normal_ht+0xd7d3, %rsi
nop
nop
sub %r15, %r15
movl $0x61626364, (%rsi)
nop
nop
nop
nop
nop
and %r13, %r13
lea addresses_normal_ht+0x11f33, %rsi
lea addresses_A_ht+0x17593, %rdi
nop
dec %rdx
mov $101, %rcx
rep movsw
nop
sub %r8, %r8
lea addresses_D_ht+0xac33, %r8
nop
nop
nop
nop
nop
dec %r11
mov $0x6162636465666768, %rbx
movq %rbx, %xmm6
vmovups %ymm6, (%r8)
nop
nop
xor $47876, %rdx
lea addresses_WT_ht+0x18033, %rdx
add %r11, %r11
movb $0x61, (%rdx)
nop
nop
nop
nop
nop
mfence
lea addresses_WT_ht+0x9c33, %rsi
lea addresses_A_ht+0x1e833, %rdi
nop
nop
nop
nop
sub %r15, %r15
mov $29, %rcx
rep movsq
nop
nop
nop
cmp $15424, %rcx
lea addresses_WT_ht+0x3633, %rsi
lea addresses_WC_ht+0x3b6f, %rdi
cmp %r11, %r11
mov $100, %rcx
rep movsw
nop
nop
nop
nop
dec %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
// Store
lea addresses_RW+0x13d2a, %r12
clflush (%r12)
nop
and %rbx, %rbx
movw $0x5152, (%r12)
nop
nop
nop
xor $50421, %r12
// Store
lea addresses_normal+0x10c6f, %rcx
clflush (%rcx)
nop
nop
nop
nop
cmp %r12, %r12
movb $0x51, (%rcx)
nop
nop
nop
nop
add %r14, %r14
// Store
lea addresses_PSE+0x1ffb3, %rbx
and $52899, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm2
movntdq %xmm2, (%rbx)
nop
nop
inc %r14
// Store
lea addresses_PSE+0x15b1a, %rbp
clflush (%rbp)
nop
nop
nop
xor %rcx, %rcx
movw $0x5152, (%rbp)
nop
nop
xor $56552, %r11
// Load
lea addresses_PSE+0x6433, %r12
dec %rcx
mov (%r12), %r11d
nop
nop
nop
nop
nop
sub $4026, %r14
// Faulty Load
mov $0x1464b30000000433, %rdi
add $44072, %r14
mov (%rdi), %rbx
lea oracles, %rbp
and $0xff, %rbx
shlq $12, %rbx
mov (%rbp,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.330144 | 2,999 | 0.65561 |
8a82a0ba4c788090a638093f7ad6bfbd92715dde | 646 | asm | Assembly | oeis/238/A238340.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/238/A238340.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/238/A238340.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A238340: Number of partitions of 4n into 4 parts.
; 1,5,15,34,64,108,169,249,351,478,632,816,1033,1285,1575,1906,2280,2700,3169,3689,4263,4894,5584,6336,7153,8037,8991,10018,11120,12300,13561,14905,16335,17854,19464,21168,22969,24869,26871,28978,31192,33516,35953,38505,41175,43966,46880,49920,53089,56389,59823,63394,67104,70956,74953,79097,83391,87838,92440,97200,102121,107205,112455,117874,123464,129228,135169,141289,147591,154078,160752,167616,174673,181925,189375,197026,204880,212940,221209,229689,238383,247294,256424,265776,275353,285157
mul $0,2
add $0,3
mov $1,$0
mul $0,2
sub $0,3
mul $0,$1
mul $0,$1
mul $0,8
div $0,288
add $0,1
| 46.142857 | 497 | 0.775542 |
25aa0832e6d885f55fbd1e06d5b09d6005dba1a5 | 1,890 | asm | Assembly | programs/oeis/116/A116796.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/116/A116796.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/116/A116796.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A116796: Number of permutations of length n which avoid the patterns 2314, 3241, 4132.
; 1,2,6,21,72,236,745,2286,6866,20285,59156,170712,488401,1387226,3916062,10996581,30737760,85573316,237387961,656451270,1810142186,4978643597,13661617196,37409025456,102238082977,278920277426,759695287350,2066068144821,5611044289656,15218767591580,41227831944841,111560745754782,301559884395266,814339327146461,2197013877114692,5922149224693896,15950218778385265,42925415134220426,115435965714133326,310215391253992965,833098996695428496,2235915055529227892,5997257751335478361,16076859486109941366,43073712988449325082,115344455035970237741,308719786508203020380,825895132098131516256,2208446158225927974721,5902804760289369054050,15770571827331592679526,42117360418063932814677,112436254811246363762856,300047190472475108638796,800417930592192654649897,2134488656805343982635086,5690181592341548982731570,15164174722271190906664061,40399564828109977871097716,107598067920920717167035960,286488061157600142877393681,762582834061861644746888762,2029317174334982621961120126,5398822170354097779648270501,14359453047653347561921240512,38182994623973043882416299556,101507600067441044169292654585,269790555656508769901055804966,716898247893386049276692186186,1904555980919393047881878890445,5058690892560723320484701469836,13433628496954823921966638336272,35666608801183959244482695005921,94677328715045639200289478265106,251274355566418503723742353073302,666761541843157922684199389222901,1768948703317433871101284626115800,4692284064313331460223679115417596,12444563544880745211609397787495881,32999187239899270511119424822853630,87489680128269980629253963341056866,231922118335699047962642814604508957,614696788497739378709170442025054116
mov $2,$0
mov $3,9
lpb $2
lpb $3
mov $1,$2
mul $1,3
mov $3,0
lpe
add $0,$2
add $1,$0
add $0,$1
sub $2,1
lpe
div $1,5
add $1,1
mov $0,$1
| 94.5 | 1,639 | 0.898413 |
594b5c5f440cf4fe6518063c1968838507d79ff4 | 4,838 | asm | Assembly | externals/mpir-3.0.0/mpn/x86_64/netburst/karaadd.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 12 | 2021-09-29T14:50:06.000Z | 2022-03-31T15:01:21.000Z | externals/mpir-3.0.0/mpn/x86_64/netburst/karaadd.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 15 | 2021-12-24T22:53:49.000Z | 2021-12-25T10:03:13.000Z | LibSource/mpir/mpn/x86_64/netburst/karaadd.asm | ekzyis/CrypTool-2 | 1af234b4f74486fbfeb3b3c49228cc36533a8c89 | [
"Apache-2.0"
] | 10 | 2021-10-17T19:46:51.000Z | 2022-03-18T02:57:57.000Z | dnl mpn_karaadd
dnl Copyright 2011 The Code Cavern
dnl This file is part of the MPIR Library.
dnl The MPIR Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 2.1 of the License, or (at
dnl your option) any later version.
dnl The MPIR Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the MPIR Library; see the file COPYING.LIB. If not, write
dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
include(`../config.m4')
ASM_START()
PROLOGUE(mpn_karaadd)
# requires n>=8
mov %rbx,-8(%rsp)
mov %rbp,-16(%rsp)
mov %r12,-24(%rsp)
mov %r13,-32(%rsp)
mov %r14,-40(%rsp)
mov %r15,-48(%rsp)
mov %rdx,-56(%rsp)
#rp is rdi
#tp is rsi
#n is rdx and put it on the stack
shr $1,%rdx
#n2 is rdx
lea (%rdx,%rdx,1),%rcx
# 2*n2 is rcx
# L is rdi
# H is rbp
# tp is rsi
lea (%rdi,%rcx,8),%rbp
xor %rax,%rax
xor %rbx,%rbx
# rax rbx are the carrys
lea -24(%rdi,%rdx,8),%rdi
lea -24(%rsi,%rdx,8),%rsi
lea -24(%rbp,%rdx,8),%rbp
mov $3,%ecx
sub %rdx,%rcx
mov $3,%edx
.align 16
lp: bt $2,%rbx
mov (%rdi,%rdx,8),%r8
adc (%rbp,%rcx,8),%r8
mov %r8,%r12
mov 8(%rdi,%rdx,8),%r9
adc 8(%rbp,%rcx,8),%r9
mov 16(%rdi,%rdx,8),%r10
adc 16(%rbp,%rcx,8),%r10
mov 24(%rdi,%rdx,8),%r11
adc 24(%rbp,%rcx,8),%r11
rcl $1,%rbx
bt $1,%rax
mov %r11,%r15
adc (%rdi,%rcx,8),%r8
mov %r9,%r13
adc 8(%rdi,%rcx,8),%r9
mov %r10,%r14
adc 16(%rdi,%rcx,8),%r10
adc 24(%rdi,%rcx,8),%r11
rcl $1,%rax
bt $2,%rbx
adc (%rbp,%rdx,8),%r12
adc 8(%rbp,%rdx,8),%r13
adc 16(%rbp,%rdx,8),%r14
adc 24(%rbp,%rdx,8),%r15
rcl $1,%rbx
bt $1,%rax
adc (%rsi,%rcx,8),%r8
adc 8(%rsi,%rcx,8),%r9
adc 16(%rsi,%rcx,8),%r10
adc 24(%rsi,%rcx,8),%r11
mov %r10,16(%rdi,%rdx,8)
mov %r11,24(%rdi,%rdx,8)
rcl $1,%rax
bt $2,%rbx
mov %r8,(%rdi,%rdx,8)
mov %r9,8(%rdi,%rdx,8)
adc (%rsi,%rdx,8),%r12
adc 8(%rsi,%rdx,8),%r13
adc 16(%rsi,%rdx,8),%r14
adc 24(%rsi,%rdx,8),%r15
rcl $1,%rbx
add $4,%rdx
mov %r12,(%rbp,%rcx,8)
mov %r13,8(%rbp,%rcx,8)
mov %r14,16(%rbp,%rcx,8)
mov %r15,24(%rbp,%rcx,8)
add $4,%rcx
jnc lp
cmp $2,%rcx
jg case0
jz case1
jp case2
case3: #rcx=0
bt $2,%rbx
mov (%rdi,%rdx,8),%r8
adc (%rbp),%r8
mov %r8,%r12
mov 8(%rdi,%rdx,8),%r9
adc 8(%rbp),%r9
mov 16(%rdi,%rdx,8),%r10
adc 16(%rbp),%r10
rcl $1,%rbx
bt $1,%rax
adc (%rdi),%r8
mov %r9,%r13
adc 8(%rdi),%r9
mov %r10,%r14
adc 16(%rdi),%r10
rcl $1,%rax
bt $2,%rbx
adc (%rbp,%rdx,8),%r12
adc 8(%rbp,%rdx,8),%r13
adc 16(%rbp,%rdx,8),%r14
rcl $1,%rbx
bt $1,%rax
adc (%rsi),%r8
adc 8(%rsi),%r9
adc 16(%rsi),%r10
mov %r10,16(%rdi,%rdx,8)
rcl $1,%rax
bt $2,%rbx
mov %r8,(%rdi,%rdx,8)
mov %r9,8(%rdi,%rdx,8)
adc (%rsi,%rdx,8),%r12
adc 8(%rsi,%rdx,8),%r13
adc 16(%rsi,%rdx,8),%r14
rcl $1,%rbx
add $3,%rdx
mov %r12,(%rbp)
mov %r13,8(%rbp)
mov %r14,16(%rbp)
jmp fin
case2: #rcx=1
bt $2,%rbx
mov (%rdi,%rdx,8),%r8
adc 8(%rbp),%r8
mov %r8,%r12
mov 8(%rdi,%rdx,8),%r9
adc 16(%rbp),%r9
rcl $1,%rbx
bt $1,%rax
adc 8(%rdi),%r8
mov %r9,%r13
adc 16(%rdi),%r9
rcl $1,%rax
bt $2,%rbx
adc (%rbp,%rdx,8),%r12
adc 8(%rbp,%rdx,8),%r13
rcl $1,%rbx
bt $1,%rax
adc 8(%rsi),%r8
adc 16(%rsi),%r9
rcl $1,%rax
bt $2,%rbx
mov %r8,(%rdi,%rdx,8)
mov %r9,8(%rdi,%rdx,8)
adc (%rsi,%rdx,8),%r12
adc 8(%rsi,%rdx,8),%r13
rcl $1,%rbx
add $2,%rdx
mov %r12,8(%rbp)
mov %r13,16(%rbp)
jmp fin
case1: #rcx=2
bt $2,%rbx
mov (%rdi,%rdx,8),%r8
adc 16(%rbp),%r8
mov %r8,%r12
rcl $1,%rbx
bt $1,%rax
adc 16(%rdi),%r8
rcl $1,%rax
bt $2,%rbx
adc (%rbp,%rdx,8),%r12
rcl $1,%rbx
bt $1,%rax
adc 16(%rsi),%r8
rcl $1,%rax
bt $2,%rbx
mov %r8,(%rdi,%rdx,8)
adc (%rsi,%rdx,8),%r12
rcl $1,%rbx
inc %rdx
mov %r12,(%rbp,%rcx,8)
fin: mov $3,%rcx
case0: #rcx=3
mov -56(%rsp),%r8
bt $0,%r8
jnc notodd
xor %r10,%r10
mov (%rbp,%rdx,8),%r8
mov 8(%rbp,%rdx,8),%r9
add (%rsi,%rdx,8),%r8
adc 8(%rsi,%rdx,8),%r9
rcl $1,%r10
add %r8,24(%rbp)
adc %r9,32(%rbp)
adc %r10,40(%rbp)
l7: adcq $0,24(%rbp,%rcx,8)
inc %rcx
jc l7
mov $3,%rcx
notodd: xor %r8,%r8
shr $1,%rax
adc %r8,%r8
shr $1,%rax
adc $0,%r8
bt $2,%rbx
adc $0,%r8
adc %r8,(%rdi,%rdx,8)
l1: adcq $0,8(%rdi,%rdx,8)
inc %rdx
jc l1
xor %r8,%r8
shr $1,%rbx
adc %r8,%r8
shr $1,%rbx
adc $0,%r8
shr $1,%rbx
adc $0,%r8
add %r8,24(%rbp)
l2: adcq $0,8(%rbp,%rcx,8)
inc %rcx
jc l2
mov -8(%rsp),%rbx
mov -16(%rsp),%rbp
mov -24(%rsp),%r12
mov -32(%rsp),%r13
mov -40(%rsp),%r14
mov -48(%rsp),%r15
ret
EPILOGUE()
| 19.508065 | 79 | 0.603142 |
1ccd057d1519d8366c45232bff787166d42b9d24 | 869 | asm | Assembly | Part 7 - Using EPT & Page-level Monitoring Features/MyHypervisorDriver/MyHypervisorDriver/AsmVmxOperation.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 808 | 2018-09-04T01:45:15.000Z | 2022-03-29T19:29:55.000Z | Part 7 - Using EPT & Page-level Monitoring Features/MyHypervisorDriver/MyHypervisorDriver/AsmVmxOperation.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 14 | 2019-02-24T21:33:37.000Z | 2022-01-18T11:50:28.000Z | Part 7 - Using EPT & Page-level Monitoring Features/MyHypervisorDriver/MyHypervisorDriver/AsmVmxOperation.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 182 | 2018-09-04T01:45:21.000Z | 2022-03-30T21:39:18.000Z | PUBLIC AsmEnableVmxOperation
PUBLIC AsmVmxVmcall
.code _text
;------------------------------------------------------------------------
AsmEnableVmxOperation PROC PUBLIC
push rax ; Save the state
xor rax,rax ; Clear the RAX
mov rax,cr4
or rax,02000h ; Set the 14th bit
mov cr4,rax
pop rax ; Restore the state
ret
AsmEnableVmxOperation ENDP
;------------------------------------------------------------------------
AsmVmxVmcall PROC
vmcall ; VmxVmcallHandler(UINT64 VmcallNumber, UINT64 OptionalParam1, UINT64 OptionalParam2, UINT64 OptionalParam3)
ret ; Return type is NTSTATUS and it's on RAX from the previous function, no need to change anything
AsmVmxVmcall ENDP
;------------------------------------------------------------------------
END | 26.333333 | 137 | 0.493671 |
1cbf70376eb55387f355ec6a3a7da4cc41a28a16 | 263 | asm | Assembly | pwnlib/shellcraft/templates/aarch64/linux/dup2.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/aarch64/linux/dup2.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/aarch64/linux/dup2.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.aarch64.linux import syscall
%>
<%page args="fd, fd2"/>
<%docstring>
Invokes the syscall dup2. See 'man 2 dup2' for more information.
Arguments:
fd(int): fd
fd2(int): fd2
</%docstring>
${syscall('SYS_dup2', fd, fd2)}
| 17.533333 | 65 | 0.65019 |
b3dcd388f4d0219cc7fbd64f113cdb164933ee19 | 551 | asm | Assembly | oeis/017/A017647.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017647.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017647.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017647: (12n+10)^7.
; 10000000,2494357888,52523350144,435817657216,2207984167552,8235430000000,24928547056768,64847759419264,150363025899136,318547390056832,627485170000000,1164175380274048,2054210978157184,3473414526672256,5661610866627712,8938717390000000,13723332506969728,20554002898923904,30113350149736576,43255237347640192,61035156250000000,84744015603303808,115945511210679424,156517258339252096,208695867059654272,275126141110000000,358914580876636288,463687371083983744,593653033785778816,753669927250029952
mul $0,12
add $0,10
pow $0,7
| 78.714286 | 497 | 0.900181 |
1f3ae8b6dfb0d6e2858a6de3c361fe4cdbfbe2aa | 436 | asm | Assembly | programs/oeis/017/A017233.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017233.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017233.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017233: a(n) = 9*n + 6.
; 6,15,24,33,42,51,60,69,78,87,96,105,114,123,132,141,150,159,168,177,186,195,204,213,222,231,240,249,258,267,276,285,294,303,312,321,330,339,348,357,366,375,384,393,402,411,420,429,438,447,456,465,474,483,492,501,510,519,528,537,546,555,564,573,582,591,600,609,618,627,636,645,654,663,672,681,690,699,708,717,726,735,744,753,762,771,780,789,798,807,816,825,834,843,852,861,870,879,888,897
mul $0,9
add $0,6
| 72.666667 | 389 | 0.711009 |
fffc7934b61dcba1b50793a4969d20935524330c | 1,712 | asm | Assembly | programs/oeis/153/A153794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/153/A153794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/153/A153794.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A153794: 4 times octagonal numbers: a(n) = 4*n*(3*n-2).
; 0,4,32,84,160,260,384,532,704,900,1120,1364,1632,1924,2240,2580,2944,3332,3744,4180,4640,5124,5632,6164,6720,7300,7904,8532,9184,9860,10560,11284,12032,12804,13600,14420,15264,16132,17024,17940,18880,19844,20832,21844,22880,23940,25024,26132,27264,28420,29600,30804,32032,33284,34560,35860,37184,38532,39904,41300,42720,44164,45632,47124,48640,50180,51744,53332,54944,56580,58240,59924,61632,63364,65120,66900,68704,70532,72384,74260,76160,78084,80032,82004,84000,86020,88064,90132,92224,94340,96480,98644,100832,103044,105280,107540,109824,112132,114464,116820,119200,121604,124032,126484,128960,131460,133984,136532,139104,141700,144320,146964,149632,152324,155040,157780,160544,163332,166144,168980,171840,174724,177632,180564,183520,186500,189504,192532,195584,198660,201760,204884,208032,211204,214400,217620,220864,224132,227424,230740,234080,237444,240832,244244,247680,251140,254624,258132,261664,265220,268800,272404,276032,279684,283360,287060,290784,294532,298304,302100,305920,309764,313632,317524,321440,325380,329344,333332,337344,341380,345440,349524,353632,357764,361920,366100,370304,374532,378784,383060,387360,391684,396032,400404,404800,409220,413664,418132,422624,427140,431680,436244,440832,445444,450080,454740,459424,464132,468864,473620,478400,483204,488032,492884,497760,502660,507584,512532,517504,522500,527520,532564,537632,542724,547840,552980,558144,563332,568544,573780,579040,584324,589632,594964,600320,605700,611104,616532,621984,627460,632960,638484,644032,649604,655200,660820,666464,672132,677824,683540,689280,695044,700832,706644,712480,718340,724224,730132,736064,742020
mov $1,12
mul $1,$0
sub $1,8
mul $1,$0
| 214 | 1,613 | 0.828855 |
91b2b2737faa5f413ab9e5adc6152600e48f512a | 336 | asm | Assembly | programs/oeis/125/A125687.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/125/A125687.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/125/A125687.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A125687: The base 6 numbers 4 44 444 4444 44444 ... converted to base 10.
; 4,28,172,1036,6220,37324,223948,1343692,8062156,48372940,290237644,1741425868,10448555212,62691331276,376147987660,2256887925964,13541327555788,81247965334732,487487792008396,2924926752050380,17549560512302284
mov $1,6
pow $1,$0
div $1,5
mul $1,24
add $1,4
| 37.333333 | 211 | 0.800595 |
ec9d385f811ace4156903bb58370ef975f64fe24 | 6,099 | asm | Assembly | Transynther/x86/_processed/NC/_ht_zr_/i7-8650U_0xd2.log_955_1831.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_ht_zr_/i7-8650U_0xd2.log_955_1831.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_ht_zr_/i7-8650U_0xd2.log_955_1831.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 %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1988, %rsi
lea addresses_D_ht+0x1c2ce, %rdi
nop
nop
nop
dec %r10
mov $76, %rcx
rep movsl
nop
and $46386, %rsi
lea addresses_WC_ht+0x137ce, %rbp
nop
nop
nop
and %rsi, %rsi
movb $0x61, (%rbp)
nop
nop
nop
dec %r10
lea addresses_UC_ht+0x223a, %rsi
nop
nop
nop
nop
nop
cmp %r15, %r15
mov $0x6162636465666768, %r10
movq %r10, (%rsi)
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0xcace, %r10
nop
and $43852, %r15
movb $0x61, (%r10)
nop
add $462, %rcx
lea addresses_D_ht+0x16590, %rsi
lea addresses_WT_ht+0x7ace, %rdi
add $3095, %rbx
mov $20, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $18776, %r10
lea addresses_D_ht+0x1c03f, %rdi
nop
nop
nop
dec %r15
mov $0x6162636465666768, %rbp
movq %rbp, %xmm2
vmovups %ymm2, (%rdi)
nop
nop
nop
nop
dec %rbx
lea addresses_D_ht+0xd4cf, %rsi
lea addresses_normal_ht+0xb22e, %rdi
nop
nop
nop
nop
xor %rdx, %rdx
mov $73, %rcx
rep movsb
nop
nop
and %rbp, %rbp
lea addresses_WT_ht+0x8fce, %r15
nop
cmp %rbp, %rbp
mov (%r15), %di
nop
nop
nop
nop
xor %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %r9
push %rbx
// Store
lea addresses_D+0x1ac8e, %r10
nop
add $11965, %rbx
movl $0x51525354, (%r10)
nop
nop
nop
sub $44494, %r14
// Faulty Load
mov $0x524d3100000002ce, %r10
clflush (%r10)
nop
nop
nop
cmp %r13, %r13
movups (%r10), %xmm3
vpextrq $1, %xmm3, %rbx
lea oracles, %r11
and $0xff, %rbx
shlq $12, %rbx
mov (%r11,%rbx,1), %rbx
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'46': 912, '00': 43}
46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 00 00 00 00 00 00 46 46 46 00 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 00 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46
*/
| 36.520958 | 2,864 | 0.658305 |
17a32b52018e49b0c3cb4db440599f0d6011572e | 329 | asm | Assembly | programs/oeis/084/A084054.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084054.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084054.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A084054: 5*n digit-reversed mod 5.
; 1,1,2,2,3,3,4,4,0,0,1,1,2,2,3,3,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0
add $0,2
div $0,2
lpb $0,1
mov $1,$0
div $0,10
lpe
lpb $1,1
mod $1,5
lpe
| 25.307692 | 211 | 0.525836 |
e9547f2ae598ccf4ea65f44faf185fdb6b4fb356 | 746 | asm | Assembly | programs/oeis/199/A199764.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/199/A199764.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/199/A199764.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A199764: 10*11^n+1.
; 11,111,1211,13311,146411,1610511,17715611,194871711,2143588811,23579476911,259374246011,2853116706111,31384283767211,345227121439311,3797498335832411,41772481694156511,459497298635721611,5054470284992937711,55599173134922314811,611590904484145462911,6727499949325600092011,74002499442581601012111,814027493868397611133211,8954302432552373722465311,98497326758076110947118411,1083470594338837220418302511,11918176537727209424601327611,131099941914999303670614603711,1442099361064992340376760640811,15863092971714915744144367048911,174494022688864073185588037538011,1919434249577504805041468412918111,21113776745352552855456152542099211,232251544198878081410017677963091311
mov $1,11
pow $1,$0
mul $1,10
add $1,1
mov $0,$1
| 82.888889 | 673 | 0.908847 |
e9c889d76d47d941faa71cebc5c0d46e55e5d1e9 | 403 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/z80/f32_fsceil.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math32/z80/f32_fsceil.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math32/z80/f32_fsceil.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math32
EXTERN m32_fsadd_callee
EXTERN m32_discardfraction
PUBLIC m32_ceil_fastcall
PUBLIC _m32_ceilf
; float ceilf(float f) __z88dk_fastcall;
._m32_ceilf
; Entry: dehl = floating point number
.m32_ceil_fastcall
call m32_discardfraction
bit 7,d
ret NZ
.was_positive
; Add 1
push de
push hl
ld de,$3f80
ld hl,$0000
call m32_fsadd_callee
ret
| 13.896552 | 40 | 0.729529 |
9c2bdfad1a3a579cf0f5efe5873ab4960b505be0 | 137 | asm | Assembly | oeis/152/A152424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/152/A152424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/152/A152424.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A152424: a[n_]:=IntegerPart[Prime[n^n]^(1/n)];
; 2,2,4,6,7,9,10,11,12,13,14
mov $1,10
sub $1,$0
add $0,2
div $1,$0
trn $0,$1
add $0,2
| 13.7 | 48 | 0.562044 |
c54168bb6d80cf9f03d5417bc814d0737068e9fa | 1,321 | nasm | Assembly | shellcode/writebytes.nasm | JS-Burns/CVE-2016-6366 | 0ba7426a9bf2a01c807608b7e1b63f87fe2699a5 | [
"MIT"
] | 171 | 2016-09-22T23:35:35.000Z | 2021-12-21T21:56:17.000Z | shellcode/writebytes.nasm | FDlucifer/CVE-2016-6366 | 0ba7426a9bf2a01c807608b7e1b63f87fe2699a5 | [
"MIT"
] | 3 | 2016-09-27T01:05:07.000Z | 2016-11-02T03:12:21.000Z | shellcode/writebytes.nasm | FDlucifer/CVE-2016-6366 | 0ba7426a9bf2a01c807608b7e1b63f87fe2699a5 | [
"MIT"
] | 79 | 2016-09-22T23:16:29.000Z | 2021-05-07T16:17:13.000Z | BITS 32
SAFERET_OFFSET equ 0x9277386 ; where to continue execution
; we need to fix the function frame to continue normal operation
; eax = 0x0
; esi = 0x0
; edi = 0x0b
; ebx = 0x10
; ebp = [esp - 0x4 (ret)] + 0x??
FIX_EBP equ 0x48 ; this is 0x58 in versions before 8.4(1)
FIX_EDI equ 0x0f0f0f0b ; seems static?
FIX_EBX equ 0x10 ; seems static?
_start:
; these are registers we have to clean up, so we can null them before save
xor ebx, ebx
xor esi, esi
xor ecx, ecx ; ecx is volatile register
xor eax, eax
; we can just take stack offset instead of jmp/call/pop/rep
mov esi, esp ; lea esi, [esp + _bytes_to_write - 4]
add esi, 0xff ; change 0xff to distance of _bytes_to_write - 4
add cl, 0xff ; change 0xff to 82 - shellcode_size
mov edi, 0xffffffff ; destination for this round
rep movsb ; write until ecx == 0
; these registers are pre-xored
add bl, FIX_EBX
mov edi, FIX_EDI
lea ebp, [esp + FIX_EBP - 4]
jmp SAFERET_OFFSET ; return to safe address
_bytes_to_write:
; store patch bytes here
| 30.72093 | 88 | 0.552612 |
a45c0d1eace7ef0abdb988d6e67f9db8a12d1b05 | 20 | asm | Assembly | src/main/fragment/mos6502-common/vbuaa=_deref_pbuz1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vbuaa=_deref_pbuz1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vbuaa=_deref_pbuz1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | ldy #0
lda ({z1}),y
| 6.666667 | 12 | 0.5 |
1c2813b7bf8db5d93d11146e8ff78ec07391b4b5 | 665 | asm | Assembly | oeis/038/A038765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/038/A038765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/038/A038765.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A038765: Next-to-last diagonal of A024462.
; 1,2,7,24,81,270,891,2916,9477,30618,98415,314928,1003833,3188646,10097379,31886460,100442349,315675954,990074583,3099363912,9685512225,30218798142,94143178827,292889889684,910050728661,2824295364810,8755315630911,27113235502176,83881572334857,259270314489558,800687735923635,2470693585135788,7617971887502013,23471589058789986,72267787365221799,222362422662220920,683764449686329329,2101324894157987694,6454069317770962203,19812491859203883972,60788327295284644005,186417537038872908282
mov $1,$0
sub $1,1
mov $2,$0
lpb $1
add $0,1
sub $1,1
add $2,$0
mov $0,$2
add $0,1
sub $0,$1
add $2,$0
lpe
add $0,1
| 39.117647 | 488 | 0.813534 |
6928bfb4e7c9b2756cef79c68a45381e071157d3 | 516 | asm | Assembly | programs/oeis/236/A236967.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236967.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236967.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A236967: Expansion of (1+3*x)^2/(1-3*x)^2.
; 1,12,72,324,1296,4860,17496,61236,209952,708588,2361960,7794468,25509168,82904796,267846264,860934420,2754990144,8781531084,27894275208,88331871492,278942752080,878669669052,2761533245592,8661172452084,27113235502176,84728860944300
add $0,1
mov $3,$0
mov $5,3
lpb $0,1
sub $0,1
add $1,5
mov $2,$3
add $2,$5
sub $2,1
add $2,$0
sub $3,1
mov $4,$0
add $4,$3
add $2,$4
sub $2,1
add $3,1
add $3,$2
sub $2,1
trn $5,$1
mov $1,$5
lpe
add $1,$2
| 19.846154 | 233 | 0.658915 |
158421ab2a361ecd98be61a3ca966e515528ee84 | 621 | asm | Assembly | programs/oeis/309/A309075.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/309/A309075.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/309/A309075.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A309075: Total number of black cells after n iterations of Langton's ant with two ants on the grid placed side-by-side on neighboring squares and initially looking in the same direction.
; 0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2,4,6,6,8,8,8,6,6,4,2,2,0,2,2
seq $0,279313 ; Period 14 zigzag sequence: repeat [0,1,2,3,4,5,6,7,6,5,4,3,2,1].
mov $1,$0
seq $1,259626 ; List of numbers L and L + 1, where L = A000032, the Lucas numbers, sorted into increasing order and duplicates removed.
div $1,3
sub $0,$1
mul $0,2
| 62.1 | 188 | 0.665056 |
8a2758572db47775c6469ddd7f081eabbc142256 | 468 | asm | Assembly | oeis/172/A172171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/172/A172171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/172/A172171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A172171: (1,9) Pascal Triangle read by horizontal rows. Same as A093644, but mirrored and without the additional row/column (1,9,9,9,9,..).
; Submitted by Simon Strandgaard
; 1,1,10,1,11,19,1,12,30,28,1,13,42,58,37,1,14,55,100,95,46,1,15,69,155,195,141,55,1,16,84,224,350,336,196,64,1,17,100,308,574,686,532,260,73,1,18,117,408,882,1260,1218,792,333,82
mov $1,1
lpb $0
add $2,1
sub $0,$2
add $1,1
lpe
bin $1,$0
sub $0,1
bin $2,$0
mul $2,8
add $2,$1
mov $0,$2
| 27.529412 | 179 | 0.66453 |
5165aa94e524189efa8a7e69163216686728a6c0 | 6,033 | asm | Assembly | FlipStandMar.asm | mariahassan54/Super-Mario-Game-in-Assembly-Language | 1e037e9acdd9e2bd172c9c2f928a546e5b53a36e | [
"MIT"
] | null | null | null | FlipStandMar.asm | mariahassan54/Super-Mario-Game-in-Assembly-Language | 1e037e9acdd9e2bd172c9c2f928a546e5b53a36e | [
"MIT"
] | null | null | null | FlipStandMar.asm | mariahassan54/Super-Mario-Game-in-Assembly-Language | 1e037e9acdd9e2bd172c9c2f928a546e5b53a36e | [
"MIT"
] | null | null | null | .model small
.stack 120h
.data
skin DB 14d
clothes1 byte 06d
clothes2 byte 04d
unique byte 13d
.code
main proc
mov AX, @data
mov DS, AX
mov AX, 0
mov ah, 0
mov al, 13H
int 10h
mov CX, 160d
mov DX, 100d
push CX
mov ah, 0ch
mov al,clothes1 ;row 1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
add CX,5
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 2
push CX
dec DX
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
add CX,5
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 3
push CX
dec DX
add CX,2
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
add CX,3
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 4
push CX
dec DX
mov al,skin
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
pop CX ;row 5
push CX
dec DX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX ;row 6
push CX
dec DX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
mov al,skin
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
mov al,skin
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
pop CX ;row 7
push CX
dec DX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 8
push CX
dec DX
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 9
push CX
dec DX
add CX,4
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes2
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
pop CX ;row 10
push CX
dec DX
add CX,2
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 11
push CX
dec DX
add CX,1
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
pop CX ;row 12
push CX
dec DX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
mov al,skin
int 10h
inc CX
mov al,clothes1
int 10h
pop CX ;row 13
push CX
dec DX
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,skin
int 10h
inc CX
mov al,clothes1
int 10h
pop CX ;row 13
push CX
dec DX
add CX,3
mov al,skin
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
mov al,skin
int 10h
inc CX
int 10h
inc CX
mov al,clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX ;row 14
push CX
dec DX
add CX,1
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX ;row 15
push CX
dec DX
add CX,4
mov al,clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
Exit:
mov ah, 04ch
int 21h
main endp
end | 12.237323 | 43 | 0.435936 |
da6aaf174939e81589032e206c924a86be37fe32 | 9,330 | asm | Assembly | transformy/tables/gen/0006.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 3 | 2019-09-18T05:34:22.000Z | 2020-12-04T17:46:52.000Z | transformy/tables/gen/0006.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | null | null | null | transformy/tables/gen/0006.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 1 | 2020-01-17T01:04:24.000Z | 2020-01-17T01:04:24.000Z | xor a
ld hl, basescradr + #00d4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0875
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0876
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a4f
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a50
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a51
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a52
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a53
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a54
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a55
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a56
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a6f
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a70
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a71
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a72
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a73
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a74
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #00cb
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #01cb
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #06ab
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #07ab
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #084c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #086d
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld d,a
ld e,a
ld (basescradr + #0994), de
ld hl, basescradr + #0b2c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0b4c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0b6d), de
ld hl, basescradr + #0c2c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0c4c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0c6d), de
ld hl, basescradr + #0e2e
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0e4f
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0f2c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0f4d
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #04eb), a
ld (basescradr + #04f5), a
ld (basescradr + #05f5), a
ld (basescradr + #082c), a
ld (basescradr + #09b3), a
ld (basescradr + #0b0c), a
ld (basescradr + #0b8d), a
ld (basescradr + #0bae), a
ld (basescradr + #0c0c), a
ld (basescradr + #0d94), a
ld (basescradr + #0db2), a
ld (basescradr + #0f0c), a
ld (basescradr + #0f6d), a
ld (basescradr + #0f8e), a
ld (basescradr + #0fae), a
ld a, 15
ld (basescradr + #00eb), a
ld (basescradr + #02ca), a
ld (basescradr + #080c), a
ld (basescradr + #0f0d), a
ld a, 255
ld hl, basescradr + #02cb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0835
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0c15
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 224
ld (basescradr + #01f4), a
ld (basescradr + #02d3), a
ld (basescradr + #0815), a
ld (basescradr + #0f16), a
ld a, 3
ld (basescradr + #03ca), a
ld a, 240
ld (basescradr + #02f4), a
ld (basescradr + #03d3), a
ld (basescradr + #0836), a
ld (basescradr + #0915), a
ld a, 1
ld (basescradr + #03eb), a
ld (basescradr + #04ca), a
ld a, 248
ld (basescradr + #04d3), a
ld (basescradr + #0936), a
ld (basescradr + #0a15), a
ld a, 2
ld (basescradr + #05ca), a
ld (basescradr + #06ca), a
ld (basescradr + #0d0b), a
ld (basescradr + #0e0b), a
ld (basescradr + #0e4c), a
ld (basescradr + #0e8d), a
ld a, 254
ld (basescradr + #04f4), a
ld (basescradr + #05d3), a
ld a, 127
ld hl, basescradr + #0c0d
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #05ec), a
ld (basescradr + #06cb), a
ld (basescradr + #06ec), a
ld a, 63
ld (basescradr + #07cb), a
ld a, 128
ld (basescradr + #06f5), a
ld (basescradr + #07d4), a
ld (basescradr + #0a36), a
ld (basescradr + #0d16), a
ld a, 192
ld (basescradr + #00f4), a
ld (basescradr + #0e16), a
ld a, 103
ld (basescradr + #01eb), a
ld (basescradr + #02eb), a
ld (basescradr + #090c), a
ld (basescradr + #092d), a
ld (basescradr + #0a0c), a
ld a, 252
ld (basescradr + #03f4), a
ld (basescradr + #0b15), a
ld a, 38
ld (basescradr + #05eb), a
ld (basescradr + #06eb), a
ld (basescradr + #0e2c), a
ld (basescradr + #0e6d), a
ld (basescradr + #0eae), a
ld a, 31
ld (basescradr + #07ec), a
ld a, 6
ld (basescradr + #090b), a
ld (basescradr + #094c), a
ld (basescradr + #098d), a
ld (basescradr + #09ce), a
ld (basescradr + #0a0b), a
ld (basescradr + #0a4c), a
ld (basescradr + #0a8d), a
ld (basescradr + #0ace), a
ld (basescradr + #0d4c), a
ld (basescradr + #0d8d), a
ld (basescradr + #0dce), a
ld (basescradr + #0ece), a
ld a, 102
ld d,a
ld e,a
ld (basescradr + #0a2c), de
ld (basescradr + #0d2c), de
ld (basescradr + #092c), a
ld (basescradr + #094d), a
ld (basescradr + #096d), a
ld (basescradr + #0a4d), a
ld (basescradr + #0a6d), a
ld (basescradr + #0d0c), a
ld (basescradr + #0d4d), a
ld (basescradr + #0d6d), a
ld (basescradr + #0dae), a
ld (basescradr + #0e0c), a
ld (basescradr + #0e2d), a
ld (basescradr + #0e4d), a
ld a, 7
ld (basescradr + #082d), a
ld a, 68
ld hl, basescradr + #094e
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #096f
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0d2e
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0d4e
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0d6f
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0dd0), a
ld (basescradr + #0def), a
ld a, 64
ld (basescradr + #09f0), a
ld (basescradr + #0a4e), a
ld (basescradr + #0d36), a
ld (basescradr + #0d55), a
ld (basescradr + #0d74), a
ld (basescradr + #0d93), a
ld (basescradr + #0e4e), a
ld (basescradr + #0eef), a
ld a, 100
ld (basescradr + #096e), a
ld (basescradr + #098e), a
ld (basescradr + #09ae), a
ld (basescradr + #0aae), a
ld (basescradr + #0d6e), a
ld (basescradr + #0d8e), a
ld a, 96
ld (basescradr + #0a6e), a
ld (basescradr + #0a8e), a
ld (basescradr + #0e6e), a
ld (basescradr + #0e8e), a
ret
| 15.57596 | 29 | 0.517363 |
7a8a2c8d7ec68b1a06829084790431e023a9c317 | 933 | asm | Assembly | sk/sfx/86.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | sk/sfx/86.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | sk/sfx/86.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | Sound_86_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_86_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_86_FM5, $D0, $06
; FM5 Data
Sound_86_FM5:
smpsSetvoice $00
smpsModSet $01, $01, $09, $F6
dc.b nC0, $37
smpsStop
Sound_86_Voices:
; Voice $00
; $E4
; $1F, $31, $16, $30, $14, $1A, $1F, $1F, $00, $01, $09, $02
; $01, $05, $03, $05, $14, $0F, $0F, $0F, $0D, $8C, $03, $80
smpsVcAlgorithm $04
smpsVcFeedback $04
smpsVcUnusedBits $03
smpsVcDetune $03, $01, $03, $01
smpsVcCoarseFreq $00, $06, $01, $0F
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1A, $14
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $02, $09, $01, $00
smpsVcDecayRate2 $05, $03, $05, $01
smpsVcDecayLevel $00, $00, $00, $01
smpsVcReleaseRate $0F, $0F, $0F, $04
smpsVcTotalLevel $00, $03, $0C, $0D
| 26.657143 | 62 | 0.606645 |
21e633c38265c34bdb4fad595ab788b0531356d4 | 646 | asm | Assembly | programs/oeis/023/A023889.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/023/A023889.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/023/A023889.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A023889: Sum of the prime power divisors of n (not including 1).
; 0,2,3,6,5,5,7,14,12,7,11,9,13,9,8,30,17,14,19,11,10,13,23,17,30,15,39,13,29,10,31,62,14,19,12,18,37,21,16,19,41,12,43,17,17,25,47,33,56,32,20,19,53,41,16,21,22,31,59,14,61,33,19,126,18,16,67,23,26,14,71,26,73,39,33,25,18,18,79,35,120,43,83,16,22,45,32,25,89,19,20,29,34,49,24,65,97,58,23,36
add $0,1
mov $2,2
mov $3,$0
mov $4,$0
mov $8,1
lpb $3
mov $5,$4
mov $6,0
lpb $5
sub $3,$8
add $6,1
mul $6,$2
mov $7,$0
div $0,$2
mod $7,$2
cmp $7,0
sub $5,$7
lpe
add $1,$6
add $2,1
mov $7,$0
cmp $7,1
cmp $7,0
sub $3,$7
lpe
mov $0,$1
| 21.533333 | 292 | 0.563467 |
39766dac0b344df60022165105af34c4de05a0f7 | 7,710 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1158.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1158.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1158.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 %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x8dd, %rbx
nop
nop
nop
nop
nop
cmp $51617, %rcx
mov $0x6162636465666768, %r9
movq %r9, %xmm6
and $0xffffffffffffffc0, %rbx
movaps %xmm6, (%rbx)
nop
nop
sub $52508, %rdx
lea addresses_WC_ht+0x1a23d, %r10
and $36213, %r9
movl $0x61626364, (%r10)
nop
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_normal_ht+0x1d9dd, %rdi
cmp $31902, %rax
vmovups (%rdi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdx
nop
xor $56223, %rbx
lea addresses_WT_ht+0x16f3d, %rsi
lea addresses_UC_ht+0xf91d, %rdi
nop
sub $53632, %rbx
mov $48, %rcx
rep movsb
nop
nop
dec %rdx
lea addresses_WC_ht+0x76dd, %rsi
lea addresses_D_ht+0x86dd, %rdi
clflush (%rsi)
nop
and %rax, %rax
mov $126, %rcx
rep movsl
nop
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0xaf3, %r9
clflush (%r9)
nop
dec %rdi
vmovups (%r9), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rbx
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_D_ht+0x4437, %rsi
lea addresses_D_ht+0x1eb8d, %rdi
nop
nop
nop
inc %rbx
mov $51, %rcx
rep movsl
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_WC_ht+0x1cfbd, %rsi
lea addresses_normal_ht+0xf93d, %rdi
nop
nop
inc %rdx
mov $56, %rcx
rep movsb
nop
nop
add $9190, %rax
lea addresses_D_ht+0x8c75, %rsi
lea addresses_WT_ht+0x1021d, %rdi
nop
and %rbx, %rbx
mov $44, %rcx
rep movsl
nop
nop
nop
nop
nop
and $7517, %rbx
lea addresses_WC_ht+0x18165, %r9
dec %rsi
mov $0x6162636465666768, %r10
movq %r10, (%r9)
nop
nop
nop
nop
nop
and $56543, %r9
lea addresses_A_ht+0xa6dd, %rdi
nop
nop
nop
nop
nop
and $56106, %rdx
movb $0x61, (%rdi)
nop
dec %rax
lea addresses_WT_ht+0x5f9d, %rdx
nop
nop
nop
nop
nop
lfence
mov (%rdx), %r10
nop
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_A_ht+0x10111, %rsi
lea addresses_WC_ht+0x1a449, %rdi
nop
nop
nop
add %rax, %rax
mov $52, %rcx
rep movsl
sub %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_WC+0x15add, %rsi
lea addresses_WT+0x30dd, %rdi
cmp %r11, %r11
mov $125, %rcx
rep movsb
xor %rsi, %rsi
// Faulty Load
lea addresses_PSE+0xc2dd, %r15
nop
nop
nop
nop
cmp $43097, %rsi
movb (%r15), %r11b
lea oracles, %rdi
and $0xff, %r11
shlq $12, %r11
mov (%rdi,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 8, 'same': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 34.266667 | 2,999 | 0.660052 |
3e8f7d79aaf6517c0d14652ab7f27f358b3d6ac5 | 3,951 | asm | Assembly | demos/win32/DEMO2/demo2.asm | gbmaster/nasmx | 299fac2950cb10df2afef149da6e075b3ff3cdde | [
"BSD-2-Clause"
] | 18 | 2015-06-22T07:26:13.000Z | 2021-09-09T19:47:44.000Z | demos/win32/DEMO2/demo2.asm | gbmaster/nasmx | 299fac2950cb10df2afef149da6e075b3ff3cdde | [
"BSD-2-Clause"
] | null | null | null | demos/win32/DEMO2/demo2.asm | gbmaster/nasmx | 299fac2950cb10df2afef149da6e075b3ff3cdde | [
"BSD-2-Clause"
] | 5 | 2015-09-22T14:47:09.000Z | 2021-11-08T18:53:11.000Z | ;// DEMO2.ASM
;//
;// Copyright (C)2005-2011 The NASMX Project
;//
;// This is a fully UNICODE aware, typedefined demo that demonstrates
;// using NASMX typedef system to make your code truly portable between
;// 32 and 64-bit systems using either ASCII or UNICODE
;//
;// Contributors:
;// Bryant Keller
;// Rob Neff
;//
%include '..\..\windemos.inc'
entry demo2
[section .text]
proc WndProc, ptrdiff_t hwnd, dword umsg, ptrdiff_t wparam, ptrdiff_t lparam
locals none
.wm_create:
cmp dword [argv(.umsg)], WM_CREATE
jnz .wm_destroy
invoke GetClientRect, size_t [argv(.hwnd)], rct
invoke CreateWindowEx, NULL, szStatic, szTitle, WS_CHILD + WS_VISIBLE + SS_CENTER, 0, 0, dword [rct + RECT.right], dword [rct + RECT.bottom], size_t [argv(.hwnd)], 500, size_t [wc + WNDCLASSEX.hInstance], NULL
return 0
.wm_destroy:
cmp dword [argv(.umsg)], WM_DESTROY
jnz .wm_default
invoke PostQuitMessage, NULL
return 0
.wm_default:
invoke DefWindowProc, size_t [argv(.hwnd)], dword [argv(.umsg)], size_t [argv(.wparam)], size_t [argv(.lparam)]
endproc
proc WinMain, ptrdiff_t hinst, ptrdiff_t hpinst, ptrdiff_t cmdln, dword dwshow
locals none
invoke LoadIcon, NULL, IDI_APPLICATION
mov ptrdiff_t [wc + WNDCLASSEX.hIcon], __AX
mov ptrdiff_t [wc + WNDCLASSEX.hIconSm], __AX
mov ptrdiff_t [wc + WNDCLASSEX.lpszClassName], szClass
mov ptrdiff_t [wc + WNDCLASSEX.lpfnWndProc], WndProc
mov __AX, ptrdiff_t [argv(.hinst)]
mov ptrdiff_t [wc + WNDCLASSEX.hInstance], __AX
invoke RegisterClassEx, wc
invoke CreateWindowEx, WS_EX_TOOLWINDOW, szClass, szTitle, WS_CAPTION + WS_SYSMENU + WS_VISIBLE, 100, 120, 200, 100, NULL, NULL, size_t [wc + WNDCLASSEX.hInstance], NULL
mov ptrdiff_t [hWnd], __AX
invoke ShowWindow, hWnd, size_t [argv(.dwshow)]
invoke UpdateWindow, hWnd
.msgloop:
invoke GetMessage, message, NULL, NULL, NULL
cmp eax, dword 0
je .exit
invoke TranslateMessage, message
invoke DispatchMessage, message
jmp .msgloop
.exit:
mov eax, dword [message + MSG.wParam]
endproc
proc demo2, ptrdiff_t argcount, ptrdiff_t cmdline
locals none
invoke GetModuleHandle, NULL
mov size_t [hInstance], __AX
invoke WinMain, hInstance, NULL, NULL, SW_SHOWNORMAL
invoke ExitProcess, NULL
endproc
[section .bss]
hInstance: reserve(ptrdiff_t) 1
hWnd: reserve(ptrdiff_t) 1
[section .data]
szStatic: declare(NASMX_TCHAR) NASMX_TEXT("STATIC"), 0x0
szTitle: declare(NASMX_TCHAR) NASMX_TEXT("Demo2"), 0x0
szClass: declare(NASMX_TCHAR) NASMX_TEXT("Demo2Class"), 0x0
NASMX_ISTRUC wc, WNDCLASSEX
NASMX_AT cbSize, sizeof(WNDCLASSEX)
NASMX_AT style, CS_VREDRAW + CS_HREDRAW
NASMX_AT lpfnWndProc, NULL
NASMX_AT cbClsExtra, NULL
NASMX_AT cbWndExtra, NULL
NASMX_AT hInstance, NULL
NASMX_AT hIcon, NULL
NASMX_AT hCursor, NULL
NASMX_AT hbrBackground, COLOR_BTNFACE + 1
NASMX_AT lpszMenuName, NULL
NASMX_AT lpszClassName, NULL
NASMX_AT hIconSm, NULL
NASMX_IENDSTRUC
NASMX_ISTRUC message, MSG
NASMX_AT hwnd, NULL
NASMX_AT message, NULL
NASMX_AT wParam, NULL
NASMX_AT lParam, NULL
NASMX_AT time, NULL
NASMX_ISTRUC pt, POINT
NASMX_AT x, NULL
NASMX_AT y, NULL
NASMX_IENDSTRUC
NASMX_IENDSTRUC
NASMX_ISTRUC rct, RECT
NASMX_AT left, NULL
NASMX_AT top, NULL
NASMX_AT right, NULL
NASMX_AT bottom, NULL
NASMX_IENDSTRUC
| 31.357143 | 216 | 0.623386 |
3567e4f40d49edb44b8e9428f12dc5ab834fbb29 | 264 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_dpush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_dpush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/z80/am48_dpush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC am48_dpush
am48_dpush:
; push AC' onto the stack
;
; enter : stack = ret
;
; exit : stack = double
;
; uses : af
exx
pop af
push bc
push de
push hl
push af
exx
ret
| 9.428571 | 28 | 0.518939 |
08c4c9d2c0780b0844f98c542a63804fcd4a7ba9 | 109 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___sint2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___sint2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___sint2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math32
PUBLIC ___sint2fs
EXTERN cm32_sdcc___sint2fs
defc ___sint2fs = cm32_sdcc___sint2fs
| 13.625 | 37 | 0.87156 |
9155ae212c938f710dfd3967db9b8bd70b0a6900 | 127 | asm | Assembly | Micro/Tests/beq/beq.asm | JavierOramas/CP_AC | d2f38823c6c2fce5acab1908a6912a7c18a0dd2b | [
"MIT"
] | null | null | null | Micro/Tests/beq/beq.asm | JavierOramas/CP_AC | d2f38823c6c2fce5acab1908a6912a7c18a0dd2b | [
"MIT"
] | null | null | null | Micro/Tests/beq/beq.asm | JavierOramas/CP_AC | d2f38823c6c2fce5acab1908a6912a7c18a0dd2b | [
"MIT"
] | null | null | null | addi r1 r0 13
addi r2 r0 12
beq r1 r2 end
addi r1 r0 7
beq r1 r1 print
halt
print:
addi r10 r0 65
tty r10
end:
halt
#prints A | 9.071429 | 15 | 0.716535 |
2f0802d59c9436727bbc895d5d842455ae313903 | 364 | asm | Assembly | libsrc/msx/svi_ldirmv.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/msx/svi_ldirmv.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/msx/svi_ldirmv.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ;
; Spectravideo SVI specific routines
; by Stefano Bodrato
; MSX emulation layer
;
; LIDRMV
;
;
; $Id: svi_ldirmv.asm,v 1.4 2016-06-16 19:30:25 dom Exp $
;
SECTION code_clib
PUBLIC LIDRMV
INCLUDE "svi.def"
LIDRMV:
call $3747 ;SETRD
ex (sp),hl
ex (sp),hl
loop:
in a,(VDP_DATAIN)
ld (de),a
inc de
dec bc
ld a,b
or c
jr nz,loop
ret
| 11.741935 | 57 | 0.631868 |
3340817997b58039414d8bc2f578b250c180af90 | 710 | asm | Assembly | programs/oeis/254/A254527.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/254/A254527.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/254/A254527.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A254527: Total number of points on a sphere when both poles are on an x by x grid where x=8*n+1.
; 6,26,62,114,182,266,366,482,614,762,926,1106,1302,1514,1742,1986,2246,2522,2814,3122,3446,3786,4142,4514,4902,5306,5726,6162,6614,7082,7566,8066,8582,9114,9662,10226,10806,11402,12014,12642,13286,13946,14622,15314,16022,16746,17486,18242,19014,19802,20606,21426,22262,23114,23982,24866,25766,26682,27614,28562,29526,30506,31502,32514,33542,34586,35646,36722,37814,38922,40046,41186,42342,43514,44702,45906,47126,48362,49614,50882,52166,53466,54782,56114,57462,58826,60206,61602,63014,64442,65886,67346,68822,70314,71822,73346,74886,76442,78014,79602
mov $1,8
mul $1,$0
add $1,12
mul $1,$0
add $1,6
mov $0,$1
| 71 | 551 | 0.778873 |
05a3da8c135fd6646604716d542e68298eb36fe2 | 124 | asm | Assembly | Working Disassembly/Levels/LRZ/Misc Object Data/Map - Falling Spike.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/Levels/LRZ/Misc Object Data/Map - Falling Spike.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/LRZ/Misc Object Data/Map - Falling Spike.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | dc.w word_42922-Map_LRZFallingSpike
word_42922: dc.w 1 ; DATA XREF: ROM:00042920o
dc.b $F0, 7, 0, $2F, $FF, $F8
| 31 | 48 | 0.637097 |
1fe77d4f7981dcc657b447f514178339858b2e56 | 346 | asm | Assembly | programs/oeis/038/A038154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/038/A038154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/038/A038154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A038154: a(n) = n! * Sum_{k=0..n-2} 1/k!.
; 0,0,2,12,60,320,1950,13692,109592,986400,9864090,108505100,1302061332,16926797472,236975164790,3554627472060,56874039553200,966858672404672,17403456103284402,330665665962403980,6613313319248079980,138879579704209680000
lpb $0
sub $0,1
add $1,$0
add $2,$0
mul $2,$0
add $1,$2
lpe
mov $0,$1
| 28.833333 | 220 | 0.734104 |
957ccc33e036e3da8ad9edb22933a3b51565e1f9 | 7,632 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_840_109.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_840_109.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_840_109.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xc17e, %r8
nop
nop
nop
sub %r14, %r14
mov (%r8), %r11d
sub %rdi, %rdi
lea addresses_UC_ht+0xb37e, %rsi
lea addresses_A_ht+0x37e, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
cmp $18606, %r10
mov $67, %rcx
rep movsq
nop
nop
nop
nop
dec %rcx
lea addresses_A_ht+0x2c0e, %rdi
nop
nop
nop
nop
nop
and %r10, %r10
movb $0x61, (%rdi)
nop
nop
nop
add $43495, %r11
lea addresses_UC_ht+0xa06, %rsi
lea addresses_WC_ht+0xb7be, %rdi
nop
nop
nop
xor $24078, %rbx
mov $1, %rcx
rep movsl
nop
nop
add $46150, %rdi
lea addresses_WT_ht+0x1d7e, %rsi
cmp %rcx, %rcx
mov (%rsi), %r11
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_normal_ht+0x1397e, %rsi
lea addresses_D_ht+0x47ae, %rdi
nop
nop
inc %r14
mov $20, %rcx
rep movsb
nop
xor $19744, %r14
lea addresses_WT_ht+0x15f0e, %rsi
nop
xor $61481, %r11
vmovups (%rsi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r10
nop
nop
inc %r10
lea addresses_WT_ht+0xd72e, %rsi
lea addresses_WT_ht+0x1313e, %rdi
nop
nop
sub %r10, %r10
mov $116, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x1377e, %rsi
lea addresses_A_ht+0x1537e, %rdi
nop
nop
nop
nop
nop
xor $51703, %r11
mov $23, %rcx
rep movsl
nop
nop
nop
nop
nop
and $17112, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
// Load
lea addresses_WT+0x15f97, %r12
nop
nop
add $13551, %rbx
mov (%r12), %cx
nop
add $23653, %rdi
// Store
lea addresses_WT+0xf37e, %rcx
nop
dec %r9
movl $0x51525354, (%rcx)
and $2092, %rbx
// Store
lea addresses_UC+0x123f8, %rbx
nop
nop
nop
xor $13084, %r15
mov $0x5152535455565758, %r9
movq %r9, %xmm6
vmovntdq %ymm6, (%rbx)
nop
nop
nop
sub $15609, %r15
// Store
lea addresses_WT+0x447e, %rbx
add $42588, %r15
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
movaps %xmm5, (%rbx)
nop
nop
nop
nop
add %rdi, %rdi
// Store
lea addresses_WT+0x1775e, %rbx
nop
add $58059, %r9
mov $0x5152535455565758, %rdi
movq %rdi, (%rbx)
nop
nop
nop
nop
nop
xor %rcx, %rcx
// Load
lea addresses_WT+0x657e, %r9
clflush (%r9)
cmp %rbx, %rbx
movups (%r9), %xmm2
vpextrq $0, %xmm2, %rdi
xor %rdx, %rdx
// Store
lea addresses_WC+0x6e1e, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
dec %r9
mov $0x5152535455565758, %rbx
movq %rbx, (%rdi)
nop
nop
nop
nop
dec %rdx
// Faulty Load
lea addresses_US+0xeb7e, %r12
nop
xor $18787, %r15
mov (%r12), %rdi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_UC'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': True, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'49': 77, '00': 763}
00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 49 00 00 00 00 00 00 00 00 49 00 49 00 49 00 00 00 00 00 00 00 00 00 00 00 00 49 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 49 00 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 49 00 49 00 00 00 00 49 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 49 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 49 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 49 00 00 00 00 00 00 00 00 49 49 49 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 49 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 49 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 49 00 00 00 00 00 49 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00
*/
| 29.696498 | 2,519 | 0.652516 |
333e8e7a2b8d73ddebe20edd8d4580a5a0fa91ae | 598 | asm | Assembly | oeis/069/A069074.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/069/A069074.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/069/A069074.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A069074: a(n) = (2*n+2)*(2*n+3)*(2*n+4) = 24*A000330(n+1).
; 24,120,336,720,1320,2184,3360,4896,6840,9240,12144,15600,19656,24360,29760,35904,42840,50616,59280,68880,79464,91080,103776,117600,132600,148824,166320,185136,205320,226920,249984,274560,300696,328440,357840,388944,421800,456456,492960,531360,571704,614040,658416,704880,753480,804264,857280,912576,970200,1030200,1092624,1157520,1224936,1294920,1367520,1442784,1520760,1601496,1685040,1771440,1860744,1953000,2048256,2146560,2247960,2352504,2460240,2571216,2685480,2803080,2924064,3048480,3176376
mul $0,2
add $0,4
bin $0,3
mul $0,6
| 74.75 | 499 | 0.792642 |
05de1cb0bfafeda40c01e07fd85ea1a3a5beebb9 | 925 | asm | Assembly | sys6.asm | codebur/_a2-chemi-gs-1993 | 23d03a7a6727e37650288303ffa86474982a1dfe | [
"MIT"
] | 1 | 2019-10-05T10:04:12.000Z | 2019-10-05T10:04:12.000Z | sys6.asm | codebur/_a2-chemi-gs-1993 | 23d03a7a6727e37650288303ffa86474982a1dfe | [
"MIT"
] | null | null | null | sys6.asm | codebur/_a2-chemi-gs-1993 | 23d03a7a6727e37650288303ffa86474982a1dfe | [
"MIT"
] | null | null | null | keep SYS6
****************************************************************
* ChemiGS *
****************************************************************
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module Sys6: System 6 specific calls
mcopy Sys6.macros
CheckSystem start test for system 6
using Globals
clc
lda fSys5
beq isSys6
sec
pla return to previous caller if sys5
isSys6 anop
rts
end
HndlDiskInsert start
jsr CheckSystem
pha
pha
~HandleDiskInsert #$C000,#0
pla
pla
rts
end
*SetMinGrow start
* using Globals
* jsr CheckSystem
* ph4 #0
* ~GetAuxWindInfo gDataWin
* sta gToolErr
* pl4 WInfoPtr
* jsr Error
* move4 WInfoPtr,0
* ldy #$14
* lda #68
* sta [0],y
* iny
* iny
* lda #204
* sta [0],y
* rts
*WInfoPtr ds 4
* end
| 925 | 925 | 0.501622 |
bb5908c851fb89eb390f24e07158b8132e9faca0 | 469 | asm | Assembly | data/pokemon/base_stats/sinnoh/floatzel.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/sinnoh/floatzel.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/sinnoh/floatzel.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | db 0 ; 419 DEX NO
db 85, 105, 55, 115, 85, 50
; hp atk def spd sat sdf
db WATER, WATER ; type
db 75 ; catch rate
db 178 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/sinnoh/floatzel/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_WATER_1, EGG_GROUND ; egg groups
; tm/hm learnset
tmhm
; end
| 21.318182 | 54 | 0.667377 |
8e0fb6f8ce9f745d839c5926eddedd1644673f8a | 1,701 | asm | Assembly | Codes/Chapter07/P04/P07-04.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | 8 | 2021-03-04T18:31:42.000Z | 2021-11-03T04:41:25.000Z | Codes/Chapter07/P04/P07-04.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | null | null | null | Codes/Chapter07/P04/P07-04.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | 1 | 2021-11-09T09:49:00.000Z | 2021-11-09T09:49:00.000Z |
; the method used in the original PutInt8 is quite general and could be used with integers of any size
; this method on the other hand, is quite simple and straight-forward, but is not general at all
global _start
extern ExitProcess
%include "lib.h"
section .data
newline db 10, 0
negative_sign db "-", 0
section .bss
outBuffer resb 10
section .code
_start:
mov AL, -72 ;enter your number here to test the procedure
call PutInt8
push 0
call ExitProcess
;-----------------------------------------------------------
;PutInt8 procedure displays a signed 8-bit integer that is
;in AL register. All registers are preserved.
;-----------------------------------------------------------
PutInt8:
push EAX
push EBX
push ECX
xor AH, AH
test AL, 80H
jz print_first_digit
negative_num:
puts negative_sign
neg AL
print_first_digit:
mov BL, 100
div BL
xor EBX, EBX
mov BL, AL
cmp BL, 0
je skip
i2a EBX, outBuffer
puts outBuffer
jmp print_rest
skip:
mov CL, 1 ;set flag for not displaying beginning 0's
print_rest:
mov BL, AH
xor EAX, EAX
mov AL, BL
mov BL, 10
div BL
print_second_digit:
xor EBX, EBX
mov BL, AL
cmp BL, 0
je check_and_skip
i2a EBX, outBuffer
puts outBuffer
jmp print_third_digit
check_and_skip:
cmp CL, 1
je print_third_digit ;if previous digit was 0, skip this 0 as well
i2a EBX, outBuffer
puts outBuffer
print_third_digit:
xor EBX, EBX
mov BL, AH
i2a EBX, outBuffer
puts outBuffer
puts newline
finish_proc:
pop ECX
pop EBX
pop EAX
ret | 21.807692 | 102 | 0.606114 |
716c95b4cbccbd23456c83688b53dbea5e312053 | 472 | asm | Assembly | programs/oeis/292/A292598.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/292/A292598.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/292/A292598.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A292598: a(n) is the number of odd primes in the sequence [n, floor(n/2), floor(n/4), ..., 1].
; 0,0,1,0,1,1,2,0,0,1,2,1,2,2,2,0,1,0,1,1,1,2,3,1,1,2,2,2,3,2,3,0,0,1,1,0,1,1,1,1,2,1,2,2,2,3,4,1,1,1,1,2,3,2,2,2,2,3,4,2,3,3,3,0,0,0,1,1,1,1,2,0,1,1,1,1,1,1,2,1,1,2,3,1,1,2,2,2,3,2,2,3,3,4,4,1,2,1,1,1
lpb $0
mov $2,$0
sub $0,1
div $0,2
seq $2,80545 ; Characteristic function of {1} union {odd primes}: 1 if n is 1 or an odd prime, else 0.
add $1,$2
lpe
mov $0,$1
| 39.333333 | 201 | 0.559322 |
c027e64869789522a31e659fa24169a04a6d2672 | 940 | asm | Assembly | programs/oeis/007/A007495.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/007/A007495.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/007/A007495.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A007495: Josephus problem: survivors.
; 1,1,2,2,2,4,5,4,8,8,7,11,8,13,4,11,12,8,12,2,13,7,22,2,8,13,26,4,26,29,17,27,26,7,33,20,16,22,29,4,13,22,25,14,22,37,18,46,42,46,9,41,12,7,26,42,24,5,44,53,52,58,29,22,12,48,27,30,58,52,49,57,13,14,32,24,75,8,67,56,40,61,51,77,35,57,74,63,75,12,72,89,11,32,32,59,61,62,89,22,31,67,33,101,101,34,74,90,89,61,73,18,26,72,96,25,53,93,42,11,80,42,94,32,80,12,7,97,22,82,119,94,88,60,123,88,119,76,128,34,116,57,140,103,133,107,44,100,53,20,51,12,74,59,146,111,13,119,39,9,142,31,154,99,26,5,99,110,135,155,99,86,2,8,49,16,126,149,76,123,101,168,128,94,51,38,107,119,70,64,149,4,62,94,99,61,2,39,164,149,73,109,83,81,169,26,181,166,109,140,89,64,62,94,30,168,27,31,192,82,215,7,184,199,158,198,215,62,157,58,18,51,200,57,226,2,236,50,106,188,22,128,149,162,206,228,150,26,205,18
mov $1,1
mov $2,$0
lpb $2,1
add $3,1
mov $4,$1
add $4,$2
lpb $4,1
mov $1,$4
trn $4,$3
lpe
sub $2,1
lpe
| 58.75 | 775 | 0.65 |
28a79f495623b200e863dd4b636bc1066d87f26f | 225 | asm | Assembly | examples/random/random.asm | nrkn/hrm-draw | 277de64b6cd8476e9e416f309e85bcf6c34e24f0 | [
"MIT"
] | 2 | 2015-11-04T07:48:32.000Z | 2018-09-17T05:07:26.000Z | examples/random/random.asm | nrkn/hrm-draw | 277de64b6cd8476e9e416f309e85bcf6c34e24f0 | [
"MIT"
] | 3 | 2015-11-02T23:15:39.000Z | 2015-11-04T05:25:59.000Z | examples/random/random.asm | nrkn/hrm-draw | 277de64b6cd8476e9e416f309e85bcf6c34e24f0 | [
"MIT"
] | null | null | null | COMMENT 0
DEFINE COMMENT 0
eJxTYWBg0JfRMAZSDPGWT9aBaN0rD96D6Cn1K5o9lk6Tf3u4ja1q+ZJZP/d1+qdfnygCkvNNk4vjjZaL
yw39l5cbum8Cb/S8hb5p8xaC5G6n8thbJ4BwT9Pt1J4mkJiXlUwEl75MRJamjXuWZo0ql/4cES+rOSKv
7GtUX9mfsVtlAsJvdBlGwSgYBXQFAEEjMOw; | 45 | 80 | 0.937778 |
413aed07f2483196c75a8045b9cd4ea5c2f855f2 | 1,323 | asm | Assembly | maps/FuchsiaMart.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | maps/FuchsiaMart.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | maps/FuchsiaMart.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | object_const_def ; object_event constants
const FUCHSIAMART_CLERK
const FUCHSIAMART_FISHER
const FUCHSIAMART_COOLTRAINER_F
FuchsiaMart_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
FuchsiaMartClerkScript:
opentext
pokemart MARTTYPE_STANDARD, MART_FUCHSIA
closetext
end
FuchsiaMartFisherScript:
jumptextfaceplayer FuchsiaMartFisherText
FuchsiaMartCooltrainerFScript:
jumptextfaceplayer FuchsiaMartCooltrainerFText
FuchsiaMartFisherText:
text "I was hoping to"
line "buy some SAFARI"
para "ZONE souvenirs,"
line "but it's closed…"
done
FuchsiaMartCooltrainerFText:
text "The SAFARI ZONE"
line "WARDEN's grand-"
cont "daughter lives in"
cont "town."
done
FuchsiaMart_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 7, FUCHSIA_CITY, 1
warp_event 3, 7, FUCHSIA_CITY, 1
db 0 ; coord events
db 0 ; bg events
db 3 ; object events
object_event 1, 3, SPRITE_CLERK, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, FuchsiaMartClerkScript, -1
object_event 3, 2, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, FuchsiaMartFisherScript, -1
object_event 7, 6, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 2, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, FuchsiaMartCooltrainerFScript, -1
| 24.962264 | 160 | 0.781557 |
ff8bd976064c94b963a1dad7b84d09e631c17b38 | 4,291 | asm | Assembly | Working Disassembly/Levels/FBZ/Debug/Act 1.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/FBZ/Debug/Act 1.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/FBZ/Debug/Act 1.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | ; Object Mappings Subtype Frame Arttile
dbglistobj Obj_Ring, Map_Ring, 0, 0, make_art_tile($6BC,1,1)
dbglistobj Obj_Monitor, Map_Monitor, 6, 0, make_art_tile($4C4,0,0)
dbglistobj Obj_PathSwap, Map_PathSwap, 9, 1, make_art_tile($6BC,1,0)
dbglistobj Obj_PathSwap, Map_PathSwap, $D, 5, make_art_tile($6BC,1,0)
dbglistobj Obj_Spring, Map_Spring, $81, 0, make_art_tile($4A4,0,0)
dbglistobj Obj_Spring, Map_Spring, $90, 3, make_art_tile($4B4,0,0)
dbglistobj Obj_Spring, Map_Spring, $A0, 6, make_art_tile($4A4,0,0)
dbglistobj Obj_Spikes, Map_Spikes, 3, 0, make_art_tile($200,0,0)
dbglistobj Obj_Blaster, Map_Blaster, $80, 0, make_art_tile($506,1,0)
dbglistobj Obj_TechnoSqueek, Map_TechnoSqueek, 0, 0, make_art_tile($52E,1,0)
dbglistobj Obj_TechnoSqueek, Map_TechnoSqueek, 2, 0, make_art_tile($52E,1,0)
dbglistobj Obj_TechnoSqueek, Map_TechnoSqueek, 4, 0, make_art_tile($52E,1,0)
dbglistobj Obj_FBZSpringPlunger, Map_FBZEggCapsule, 0, 5, make_art_tile($000,0,0)
dbglistobj Obj_FBZEggPrison, Map_FBZEggCapsule, 0, 0, make_art_tile($000,0,0)
dbglistobj Obj_FBZEggPrison, Map_FBZEggCapsule, 1, 0, make_art_tile($000,0,0)
dbglistobj Obj_FBZEggPrison, Map_FBZEggCapsule, 2, 0, make_art_tile($000,0,0)
dbglistobj Obj_FBZFloatingPlatform, Map_FBZFloatingPlatform, $10, 0, make_art_tile($383,1,0)
dbglistobj Obj_FBZFloatingPlatform, Map_FBZFloatingPlatform, $30, 0, make_art_tile($383,1,0)
dbglistobj Obj_FBZFloatingPlatform, Map_FBZFloatingPlatform, $40, 0, make_art_tile($383,1,0)
dbglistobj Obj_FBZ_ChainLink, Map_FBZChainLink, $1A, 0, make_art_tile($379,2,0)
dbglistobj Obj_StillSprite, Map_StillSprites, $27, $27, make_art_tile($379,2,0)
dbglistobj Obj_StillSprite, Map_StillSprites, $28, $28, make_art_tile($379,2,0)
dbglistobj Obj_StillSprite, Map_StillSprites, $29, $29, make_art_tile($379,2,0)
dbglistobj Obj_StillSprite, Map_StillSprites, $2A, $2A, make_art_tile($379,2,0)
dbglistobj Obj_StillSprite, Map_StillSprites, $2B, $2B, make_art_tile($443,1,0)
dbglistobj Obj_FBZMagneticSpikeBall, Map_FBZMagneticSpikeBall, 0, 0, make_art_tile($443,1,0)
dbglistobj Obj_FBZMagneticSpikeBall, Map_FBZMagneticSpikeBall, $80, 1, make_art_tile($443,1,1)
dbglistobj Obj_FBZMagneticSpikeBall, Map_FBZMagneticSpikeBall, $81, 5, make_art_tile($442,1,1)
dbglistobj Obj_FBZMagneticPlatform, Map_FBZMagneticPlatform, $10, 4, make_art_tile($443,1,0)
dbglistobj Obj_CorkFloor, Map_FBZCorkFloor, 1, 0, make_art_tile($43A,1,0)
dbglistobj Obj_FBZBentPipe, Map_FBZBentPipe, 0, 0, make_art_tile($46B,1,0)
dbglistobj Obj_FBZBentPipe, Map_FBZBentPipe, 1, 1, make_art_tile($46B,1,0)
dbglistobj Obj_FBZBentPipe, Map_FBZBentPipe, 2, 2, make_art_tile($46B,1,0)
dbglistobj Obj_FBZRotatingPlatform, Map_FBZRotatingPlatform, 0, 0, make_art_tile($46B,1,0)
dbglistobj Obj_FBZDEZPlayerLauncher, Map_FBZDEZPlayerLauncher, 0, 0, make_art_tile($3B5,1,0)
dbglistobj Obj_FBZDisappearingPlatform, Map_FBZDisappearingPlatform, 0, 0, make_art_tile($3BA,1,0)
dbglistobj Obj_FBZScrewDoor, Map_FBZScrewDoor, 0, 0, make_art_tile($3D2,1,0)
dbglistobj Obj_FBZScrewDoor, Map_FBZScrewDoor, $20, 4, make_art_tile($3D2,1,0)
dbglistobj Obj_FBZScrewDoor, Map_FBZScrewDoor, $40, 8, make_art_tile($3D2,1,0)
dbglistobj Obj_Button, Map_Button, 0, 2, make_art_tile($500,0,0)
dbglistobj Obj_FBZPropeller, Map_FBZPropeller, 0, 0, make_art_tile($2E5,1,0)
dbglistobj Obj_FBZPiston, Map_FBZPiston, $34, 0, make_art_tile($31B,1,0)
dbglistobj Obj_FBZPlatformBlocks, Map_FBZPlatformBlocks, $14, 1, make_art_tile($40D,2,0)
dbglistobj Obj_FBZMissileLauncher, Map_FBZMissileLauncher, 2, 0, make_art_tile($32B,1,1)
dbglistobj Obj_FBZWallMissile, Map_FBZMissileLauncher, $10, 4, make_art_tile($32B,1,0)
dbglistobj Obj_CollapsingBridge, Map_FBZCollapsingBridge, 8, 0, make_art_tile($001,2,0)
dbglistobj Obj_FBZMine, Map_FBZMine, 0, 0, make_art_tile($40A,0,0)
dbglistobj Obj_FBZFlamethrower, Map_FBZFlameThrower, 0, 1, make_art_tile($41D,0,0)
dbglistobj Obj_FBZFlamethrower, Map_FBZFlameThrower, $C0, 3, make_art_tile($41D,0,0)
| 84.137255 | 104 | 0.739688 |
1633bde81209b803f9f4e403fc3a5941718bb8f7 | 259 | asm | Assembly | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/_strtoi_.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/_strtoi_.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/_strtoi_.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; int _strtoi_(const char *nptr, char **endptr, int base)
SECTION code_clib
SECTION code_stdlib
PUBLIC __strtoi_
EXTERN asm__strtoi
__strtoi_:
pop af
pop hl
pop de
pop bc
push bc
push de
push hl
push af
jp asm__strtoi
| 10.791667 | 57 | 0.667954 |
49f87b348fd017307fdde0a35bd82be17d1ee126 | 7,250 | asm | Assembly | Transynther/x86/_processed/US/_st_4k_sm_/i7-8650U_0xd2_notsx.log_330_779.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_st_4k_sm_/i7-8650U_0xd2_notsx.log_330_779.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_st_4k_sm_/i7-8650U_0xd2_notsx.log_330_779.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 %r14
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x13b8c, %rdi
nop
nop
nop
and $11599, %r9
mov (%rdi), %r14
nop
nop
nop
dec %rax
lea addresses_D_ht+0x70c, %rdx
nop
xor %r11, %r11
movl $0x61626364, (%rdx)
sub %rax, %rax
lea addresses_WC_ht+0x15fbc, %rsi
lea addresses_D_ht+0x136bc, %rdi
nop
nop
nop
and $4148, %rax
mov $86, %rcx
rep movsb
nop
nop
nop
xor %rsi, %rsi
lea addresses_UC_ht+0xd13c, %rsi
lea addresses_D_ht+0x537c, %rdi
nop
nop
xor $44928, %rax
mov $70, %rcx
rep movsb
nop
cmp $27814, %r14
lea addresses_WT_ht+0x15fbc, %rsi
lea addresses_WT_ht+0x10bc, %rdi
xor $21243, %r9
mov $11, %rcx
rep movsb
nop
nop
xor %rdi, %rdi
lea addresses_UC_ht+0x6dbc, %rsi
lea addresses_WT_ht+0xce4, %rdi
nop
sub $49400, %r11
mov $101, %rcx
rep movsq
nop
nop
sub $64916, %rdi
lea addresses_WC_ht+0x7ebc, %rdi
inc %r9
mov (%rdi), %r14d
nop
nop
nop
nop
nop
sub %r9, %r9
lea addresses_WC_ht+0x2ebc, %rsi
lea addresses_D_ht+0x1dcbc, %rdi
nop
sub $38702, %rax
mov $41, %rcx
rep movsw
nop
add %rdi, %rdi
lea addresses_UC_ht+0x67bc, %r9
clflush (%r9)
nop
nop
nop
nop
nop
sub %r11, %r11
movups (%r9), %xmm6
vpextrq $0, %xmm6, %rdi
add $37733, %rdx
lea addresses_UC_ht+0xb00c, %rdx
nop
nop
nop
nop
add $44500, %rsi
movb $0x61, (%rdx)
nop
nop
add $63099, %rdx
lea addresses_A_ht+0xeebc, %rsi
lea addresses_WT_ht+0x1cd34, %rdi
clflush (%rdi)
nop
nop
nop
inc %r9
mov $5, %rcx
rep movsq
nop
add $59796, %rdi
lea addresses_UC_ht+0x176bc, %rsi
inc %rdx
movups (%rsi), %xmm5
vpextrq $1, %xmm5, %r14
nop
nop
nop
nop
nop
and $20252, %r14
lea addresses_WC_ht+0xcebc, %rsi
lea addresses_WT_ht+0x156bc, %rdi
nop
nop
nop
nop
dec %r9
mov $55, %rcx
rep movsb
and $45432, %rsi
lea addresses_D_ht+0x17ffc, %r14
nop
nop
nop
nop
xor $30548, %rsi
mov (%r14), %r11
nop
xor $21691, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_RW+0xe48c, %r9
nop
nop
nop
nop
sub %r13, %r13
movb $0x51, (%r9)
nop
nop
sub %r14, %r14
// Store
mov $0x284, %rdi
nop
nop
nop
cmp %r13, %r13
movw $0x5152, (%rdi)
add $51347, %r10
// Store
lea addresses_PSE+0x1ebc, %r13
nop
nop
nop
nop
nop
sub %rcx, %rcx
movb $0x51, (%r13)
nop
xor %r9, %r9
// Store
lea addresses_US+0x1c412, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov $0x5152535455565758, %r9
movq %r9, %xmm0
movaps %xmm0, (%rcx)
sub %r14, %r14
// Load
lea addresses_UC+0x1a6bc, %r10
nop
nop
nop
nop
add $53908, %r13
mov (%r10), %r9w
nop
nop
nop
nop
add $17151, %r14
// Store
lea addresses_US+0x1e6bc, %r9
nop
nop
nop
sub %r10, %r10
movl $0x51525354, (%r9)
nop
nop
inc %r13
// Store
lea addresses_UC+0x1febc, %r9
clflush (%r9)
nop
nop
nop
cmp %r14, %r14
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
vmovups %ymm0, (%r9)
sub $62107, %rsi
// Faulty Load
lea addresses_US+0x1e6bc, %r13
sub %r10, %r10
movups (%r13), %xmm0
vpextrq $0, %xmm0, %r14
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'54': 330}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 24.576271 | 989 | 0.646621 |
56cb19f4883965f045acbc2928eec2b4e4330777 | 596 | asm | Assembly | oeis/058/A058182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/058/A058182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/058/A058182.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A058182: a(n) = a(n-1)^2 + a(n-2) for n >= 2 with a(0) = 1 and a(1) = 0.
; Submitted by Christian Krause
; 1,0,1,1,2,5,27,734,538783,290287121823,84266613096281243382112,7100862082718357559748563880517486086728702367,50422242317787290639189291009890702507917377925161079229314384058371278254659634544914784801,2542402520353659447255836322014832373480442725597137048401938458888136467968523098505000150062722948351009708561995178835544955851791068846430550001251771967995534035485848806869311968
mov $1,-1
mov $3,1
lpb $0
sub $0,1
mov $2,$3
pow $3,2
add $3,$1
mov $1,$2
lpe
mov $0,$3
| 39.733333 | 389 | 0.807047 |
29a981c3e3ae312ae22bf50be3896646e4af9753 | 602 | asm | Assembly | oeis/173/A173322.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/173/A173322.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/173/A173322.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A173322: 4*n! + 1.
; Submitted by Jon Maiga
; 5,5,9,25,97,481,2881,20161,161281,1451521,14515201,159667201,1916006401,24908083201,348713164801,5230697472001,83691159552001,1422749712384001,25609494822912001,486580401635328001,9731608032706560001,204363768686837760001,4496002911110430720001,103408066955539906560001,2481793606932957757440001,62044840173323943936000001,1613165844506422542336000001,43555477801673408643072000001,1219553378446855442006016000001,35367047974958807818174464000001,1061011439248764234545233920000001
mov $2,2
lpb $0
mul $2,$0
sub $0,1
lpe
mov $0,$2
mul $0,2
add $0,1
| 46.307692 | 483 | 0.858804 |
20357601cf3991ae38d9416f0148b21e0c93b6b9 | 270 | asm | Assembly | libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_max_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_max_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_max_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; size_t wv_priority_queue_max_size(wv_priority_queue_t *q)
SECTION code_adt_wv_priority_queue
PUBLIC wv_priority_queue_max_size
defc wv_priority_queue_max_size = asm_wv_priority_queue_max_size
INCLUDE "adt/wv_priority_queue/z80/asm_wv_priority_queue_max_size.asm"
| 24.545455 | 70 | 0.888889 |
6a9b97a744317c828fd2b0e5b0e9186bbb15bb34 | 928 | asm | Assembly | libsrc/sprites/software/sp1/spectrum/tiles/sp1_SetPrintPos_callee.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/sprites/software/sp1/spectrum/tiles/sp1_SetPrintPos_callee.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/sprites/software/sp1/spectrum/tiles/sp1_SetPrintPos_callee.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void __CALLEE__ sp1_SetPrintPos_callee(struct sp1_pss *ps, uchar row, uchar col)
; 05.2006 aralbrec, Sprite Pack v3.0
; Sinclair Spectrum version
SECTION code_sprite_sp1
PUBLIC sp1_SetPrintPos_callee
PUBLIC ASMDISP_SP1_SETPRINTPOS_CALLEE
EXTERN sp1_GetUpdateStruct_callee
EXTERN ASMDISP_SP1_GETUPDATESTRUCT_CALLEE
.sp1_SetPrintPos_callee
pop af
pop de
pop hl
ld d,l
pop hl
push af
.asmentry
; e = col
; d = row
; hl = struct sp1_pss *ps
ld c,(hl)
inc hl
ld b,(hl) ; bc = & bounds rectangle
inc hl
inc hl
ld (hl),e
inc hl
ld (hl),d
inc hl
inc hl
inc hl
push hl
ld a,(bc)
add a,d
ld d,a
inc bc
ld a,(bc)
add a,e
ld e,a
call sp1_GetUpdateStruct_callee + ASMDISP_SP1_GETUPDATESTRUCT_CALLEE
pop de
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ret
DEFC ASMDISP_SP1_SETPRINTPOS_CALLEE = asmentry - sp1_SetPrintPos_callee
| 16.571429 | 82 | 0.676724 |
ac49df4096a853542648b2b3eea22d3413a59fdf | 1,693 | asm | Assembly | libsrc/_DEVELOPMENT/target/rc2014/driver/ide/ide_write_sector.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/target/rc2014/driver/ide/ide_write_sector.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/target/rc2014/driver/ide/ide_write_sector.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_driver
PUBLIC ide_write_sector
EXTERN __IO_IDE_SEC_CNT, __IO_IDE_COMMAND
EXTERN __IDE_CMD_WRITE, __IDE_CMD_CACHE_FLUSH
EXTERN ide_wait_ready, ide_wait_drq
EXTERN ide_test_error, ide_setup_lba
EXTERN ide_write_byte
EXTERN ide_write_block
;------------------------------------------------------------------------------
; Routines that talk with the IDE drive, these should be called by
; the main program.
; write a sector
; specified by the 4 bytes in BCDE
; the address of the origin buffer is in HL
; HL is left incremented by 512 bytes
; return carry on success, no carry for an error
ide_write_sector:
push af
push bc
push de
call ide_wait_ready ;make sure drive is ready
jr nc, error
call ide_setup_lba ;tell it which sector we want in BCDE
ld e, $1
ld a, __IO_IDE_SEC_CNT
call ide_write_byte ;set sector count to 1
ld e, __IDE_CMD_WRITE
ld a, __IO_IDE_COMMAND
call ide_write_byte ;instruct drive to write a sector
call ide_wait_ready ;make sure drive is ready to proceed
jr nc, error
call ide_wait_drq ;wait until it wants the data
jr nc, error
call ide_write_block ;send the data to the drive from (HL++)
call ide_wait_ready
jr nc, error
; ld e, __IDE_CMD_CACHE_FLUSH
; ld a, __IO_IDE_COMMAND
; call ide_write_byte ;tell drive to flush its hardware cache
; call ide_wait_ready ;wait until the write is complete
; jr nc, error
pop de
pop bc
pop af
scf ;carry = 1 on return = operation ok
ret
error:
pop de
pop bc
pop af
jp ide_test_error ;carry = 0 on return = operation failed
| 26.873016 | 79 | 0.668045 |
090cb0913903f6831b0b9b7ec43f2bd4841bb7ad | 2,705 | asm | Assembly | Driver/Printer/PrintCom/Styles/stylesTest.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/PrintCom/Styles/stylesTest.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/PrintCom/Styles/stylesTest.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Printer Drivers
FILE: stylesTest.asm
AUTHOR: Dave Durran
ROUTINES:
Name Description
---- -----------
PrintTestStyles Test legality of printer text style word
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 3/1/90 Initial revision
Dave 3/92 Moved in a bunch of common test routines
Dave 5/92 Parsed from printcomText.asm
Dave 7/92 changed to new 1 word style test mode.
DESCRIPTION:
$Id: stylesTest.asm,v 1.1 97/04/18 11:51:49 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintTestStyles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gets rid of illegal style combinations in the passed style word.
CALLED BY: GLOBAL
PASS: bp - Segment of PSTATE
dx - style word to check for illegal combinations
RETURN: bp - Segment of PSTATE
dx - legalized style word
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
the passed style word is anded with the legal styles word,
and ored to set any mandatory bits a font may need.
NLQ is stuffed in before if the mode is hi text.
CONDENSED compatability bit b15 Highest Priority
SUBSCRIPT compatability bit b14 |
SUPERSCRIPT compatability bit b13 |
NLQ compatability bit b12 |
BOLD compatability bit b11 |
ITALIC compatability bit b10 |
UNDERLINE compatability bit b9 |
STRIKE-THRU compatability bit b8 |
SHADOW compatability bit b7 |
OUTLINE compatability bit b6 |
REVERSED OUT compatability bit b5 |
DOUBLE WIDTH compatability bit b4 |
DOUBLE HEIGHT compatability bit b3 |
QUAD HEIGHT compatability bit b2 |
FUTURE USE compatability bit b1 \|/
FUTURE USE compatability bit b0 Lowest Priority
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 02/90 Initial version
Dave 07/92 Initial 2.0 version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintTestStyles proc far
uses es
.enter
; make sure the NLQ bit is set if we need it.
mov es, bp
cmp es:[PS_mode], PM_TEXT_NLQ
jne testEm
or dx, mask PTS_NLQ
testEm:
;get rid of illegal style bits
and dx,es:[PS_curFont].[FE_styles]
;add in any necessary style bits for this font.
or dx,es:[PS_curFont].[FE_stylesSet]
.leave
ret
PrintTestStyles endp
| 25.761905 | 79 | 0.589279 |
464f2bfc48d0b932c25f3e5b4371fe40d7fde3e6 | 657 | asm | Assembly | libsrc/_DEVELOPMENT/target/scz180/device/csio/z180/csio_sd_cs_lower.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/target/scz180/device/csio/z180/csio_sd_cs_lower.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/target/scz180/device/csio/z180/csio_sd_cs_lower.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
INCLUDE "config_private.inc"
SECTION code_driver
PUBLIC asm_sd_cs_lower
;Lower the SC130 SD card CS using the GPIO address
;
;input (H)L = SD CS selector of 0 or 1
;uses AF
.asm_sd_cs_lower
in0 a,(CNTR) ;check the CSIO is not enabled
and CNTR_TE|CNTR_RE
jr NZ,asm_sd_cs_lower
ld a,l
and $01 ;isolate SD CS 0 and 1 (to prevent bad input).
inc a ;convert input 0/1 to SD1/2 CS
xor $03 ;invert bits to lower correct I/O bit.
rlca
rlca ;SC130 SD1 CS is on Bit 2 (SC126 SD2 is on Bit 3).
out (__IO_SYSTEM),a
ret
| 25.269231 | 78 | 0.576865 |
05e3e73bfeb07a16a5b82536c726285382b95e6a | 5,463 | asm | Assembly | asm/patches/make_items_progressive.asm | fig02/wwrando | 0b02757bf1c24b0b90c7018d77776d6caf398162 | [
"MIT"
] | 284 | 2018-07-05T15:18:18.000Z | 2022-03-28T19:59:03.000Z | asm/patches/make_items_progressive.asm | fig02/wwrando | 0b02757bf1c24b0b90c7018d77776d6caf398162 | [
"MIT"
] | 235 | 2018-07-06T18:39:36.000Z | 2022-03-29T21:09:46.000Z | asm/patches/make_items_progressive.asm | fig02/wwrando | 0b02757bf1c24b0b90c7018d77776d6caf398162 | [
"MIT"
] | 96 | 2018-07-12T02:33:40.000Z | 2022-03-22T05:08:02.000Z |
; This patch modifies the game's code to make certain items progressive, so even if you get them out of order, they will always be upgraded, never downgraded.
; (Note that most of the modifications for this are in the make_items_progressive function of tweaks.py, not here.)
; Swap out the item ID of progressive items for item get events as well as for field items so that their model and item get text change depending on what the next progressive tier of that item you should get is.
.open "sys/main.dol"
.org 0x80026A24 ; In createDemoItem (for item get events)
; Convert progressive item ID before storing in params
bl convert_progressive_item_id_for_createDemoItem
.org @NextFreeSpace
.global convert_progressive_item_id_for_createDemoItem
convert_progressive_item_id_for_createDemoItem:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
mr r3, r26 ; createDemoItem keeps the item ID in r26
bl convert_progressive_item_id ; Get the correct item ID
mr r26, r3 ; Put it back where createDemoItem expects it, in r26
li r3, 259 ; And then simply replace the line of code in createDemoItem that we overwrote to call this function
lwz r0, 0x14 (sp)
mtlr r0
addi sp, sp, 0x10
blr
.org 0x800F5550 ; In daItem_create
; Read params, convert progressive item ID, and store back
bl convert_progressive_item_id_for_daItem_create
.org @NextFreeSpace
.global convert_progressive_item_id_for_daItem_create
convert_progressive_item_id_for_daItem_create:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
lbz r3, 0xB3 (r31) ; Read this field item's item ID from its params (params are at 0xB0, the item ID is has the mask 0x000000FF)
bl convert_progressive_item_id ; Get the correct item ID
stb r3, 0xB3 (r31) ; Store the corrected item ID back into the field item's params
; Then we return the item ID in r0 so that the next few lines in daItem_create can use it.
mr r0, r3
lwz r3, 0x14 (sp)
mtlr r3
addi sp, sp, 0x10
blr
.org 0x8012E7B8 ; In dProcGetItem_init__9daPy_lk_cFv
; Read item ID property for this event action and convert progressive item ID
bl convert_progressive_item_id_for_dProcGetItem_init_1
.org @NextFreeSpace
.global convert_progressive_item_id_for_dProcGetItem_init_1
convert_progressive_item_id_for_dProcGetItem_init_1:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
lwz r3, 0x30C (r28) ; Read the item ID property for this event action
bl convert_progressive_item_id ; Get the correct item ID
; Then we return the item ID in r0 so that the next few lines in dProcGetItem_init can use it.
mr r0, r3
lwz r3, 0x14 (sp)
mtlr r3
addi sp, sp, 0x10
blr
.org 0x8012E7DC ; In dProcGetItem_init__9daPy_lk_cFv
bl convert_progressive_item_id_for_dProcGetItem_init_2
.org @NextFreeSpace
.global convert_progressive_item_id_for_dProcGetItem_init_2
convert_progressive_item_id_for_dProcGetItem_init_2:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
lbz r3, 0x52AC (r3) ; Read the item ID from 803C9EB4
bl convert_progressive_item_id ; Get the correct item ID
; Then we return the item ID in r27 so that the next few lines in dProcGetItem_init can use it.
mr r27, r3
lwz r0, 0x14 (sp)
mtlr r0
addi sp, sp, 0x10
blr
.close
.open "files/rels/d_a_shop_item.rel"
.org 0x9C0
; This is where the shop item would originally read its item ID from its params & 0x000000FF and store them to shop item entity+0x63A.
; We need to call a custom function to make the item look progressive, but because this is in a relocatable object file, we can't easily add a new function call to the main executable where there was no function call originally.
; So instead we first remove this original code.
nop
nop
.org 0x8B8
bl convert_progressive_item_id_for_shop_item
.org @NextFreeSpace
.global convert_progressive_item_id_for_shop_item
convert_progressive_item_id_for_shop_item:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
; Replace the call to savegpr we overwrote to call this custom function
bl _savegpr_28
mr r30, r3 ; Preserve the shop item entity pointer
lbz r3, 0xB3 (r30)
bl convert_progressive_item_id ; Get the correct item ID
stb r3, 0x63A (r30) ; Store the item ID to shop item entity+0x63A
mr r3, r30 ; Put the shop item entity pointer back into r3, because that's where the function that called this one expects it to be
lwz r0, 0x14 (sp)
mtlr r0
addi sp, sp, 0x10
blr
.close
; Fix a big where buying a progressive item from the shop would not show the item get animation if it's the tier 2+ item.
.open "files/rels/d_a_npc_bs1.rel"
.org 0x1D00
; For the Bait Bag slot.
bl custom_getSelectItemNo_progressive
.org 0x1F3C
; For the 3 Rock Spire Shop Ship slots.
bl custom_getSelectItemNo_progressive
; Acts as a replacement to getSelectItemNo, but should only be called when the shopkeeper is checking if the item get animation should play or not, in order to have that properly show for progressive items past the first tier.
; If this was used all the time as a replacement for getSelectItemNo it would cause the shop to be buggy since it uses the item ID to know what slot it's on.
.org @NextFreeSpace
.global custom_getSelectItemNo_progressive
custom_getSelectItemNo_progressive:
stwu sp, -0x10 (sp)
mflr r0
stw r0, 0x14 (sp)
bl getSelectItemNo__11ShopItems_cFv
bl convert_progressive_item_id
lwz r0, 0x14 (sp)
mtlr r0
addi sp, sp, 0x10
blr
.close
| 36.66443 | 230 | 0.76588 |
7aeb8bb7cf883d3915c669efa83bda2688de82dc | 593 | asm | Assembly | arch/lib/math/power.asm | Mosseridan/Compiler-Principles | 6c72a462b90ca6c6db380976c2aa60471fa65325 | [
"MIT"
] | null | null | null | arch/lib/math/power.asm | Mosseridan/Compiler-Principles | 6c72a462b90ca6c6db380976c2aa60471fa65325 | [
"MIT"
] | null | null | null | arch/lib/math/power.asm | Mosseridan/Compiler-Principles | 6c72a462b90ca6c6db380976c2aa60471fa65325 | [
"MIT"
] | null | null | null | /* power.asm
* Computes the integer power: R0 <- ARG[0] ^ ARG[1]
*
* Programmer: Mayer Goldberg, 2010
*/
POWER:
MOV(R1, STARG(0)); /* A */
MOV(R2, STARG(1)); /* B */
CMP(R2, IMM(0));
JUMP_EQ(L_POWER_A_0);
MOV(R3, R2);
AND(R3, IMM(1));
CMP(R3, IMM(0));
JUMP_EQ(L_POWER_A_EVEN);
SHR(R2, IMM(1));
PUSH(R2);
PUSH(R1);
CALL(POWER);
POP(R1);
POP(R1);
MUL(R0, R0);
MUL(R0, STARG(0));
RETURN;
L_POWER_A_0:
MOV(R0, IMM(1));
RETURN;
L_POWER_A_EVEN:
SHR(R2, IMM(1));
PUSH(R2);
PUSH(R1);
CALL(POWER);
POP(R1);
POP(R1);
MUL(R0, R0);
RETURN;
| 15.205128 | 52 | 0.551433 |
c2525a392bac249482e6cfffe7373b5eb6ec1fa7 | 200 | asm | Assembly | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/_DEVELOPMENT/adt/bv_stack/c/sccz80/bv_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z |
; int bv_stack_push(bv_stack_t *s, int c)
SECTION code_clib
SECTION code_adt_bv_stack
PUBLIC bv_stack_push_callee
EXTERN b_vector_append_callee
defc bv_stack_push_callee = b_vector_append_callee
| 16.666667 | 50 | 0.855 |
463b13e6ddd7cba337874a1fc6eb7af83338b2d1 | 1,580 | asm | Assembly | text/maps/bills_house.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 1 | 2022-01-09T05:28:52.000Z | 2022-01-09T05:28:52.000Z | text/maps/bills_house.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | text/maps/bills_house.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | _BillsHouseText_1e865::
text "Hiya! I'm a"
line "#MON..."
cont "...No I'm not!"
para "Call me BILL!"
line "I'm a true blue"
cont "#MANIAC! Hey!"
cont "What's with that"
cont "skeptical look?"
para "I'm not joshing"
line "you, I screwed up"
cont "an experiment and"
cont "got combined with"
cont "a #MON!"
para "So, how about it?"
line "Help me out here!"
done
_BillsHouseText_1e86a::
text "When I'm in the"
line "TELEPORTER, go to"
cont "my PC and run the"
cont "Cell Separation"
cont "System!"
done
_BillsHouseText_1e86f::
text "No!? Come on, you"
line "gotta help a guy"
cont "in deep trouble!"
para "What do you say,"
line "chief? Please?"
cont "OK? All right!"
prompt
_BillThankYouText::
text "BILL: Yeehah!"
line "Thanks, bud! I"
cont "owe you one!"
para "So, did you come"
line "to see my #MON"
cont "collection?"
cont "You didn't?"
cont "That's a bummer."
para "I've got to thank"
line "you... Oh here,"
cont "maybe this'll do."
prompt
_SSTicketReceivedText::
text $52, " received"
line "an @"
TX_RAM wcf4b
text "!@@"
_SSTicketNoRoomText::
text "You've got too"
line "much stuff, bud!"
done
_BillsHouseText_1e8cb::
text "That cruise ship,"
line "S.S.ANNE, is in"
cont "VERMILION CITY."
cont "Its passengers"
cont "are all trainers!"
para "They invited me"
line "to their party,"
cont "but I can't stand"
cont "fancy do's. Why"
cont "don't you go"
cont "instead of me?"
done
_BillsHouseText_1e8da::
text "BILL: Look, bud,"
line "just check out"
cont "some of my rare"
cont "#MON on my PC!"
done
| 17.954545 | 25 | 0.662025 |
4176ac10928a5097fd8fbc39180a82578031779a | 1,252 | asm | Assembly | base/mvdm/wow16/commdlg/commdlg.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/wow16/commdlg/commdlg.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/wow16/commdlg/commdlg.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | TITLE commdlg.ASM
PAGE ,132
;
; WOW v1.0
;
; Copyright (c) 1993, Microsoft Corporation
;
; COMMDLG.ASM
; Thunks in 16-bit space to route commdlg API calls to WOW32
;
; History:
; John Vert (jvert) 30-Dec-1992
; Created.
;
.286p
include wow.inc
include wowcmdlg.inc
include cmacros.inc
__acrtused = 0
public __acrtused ;satisfy external C ref.
createSeg _TEXT,CODE,WORD,PUBLIC,CODE
createSeg _DATA,DATA,WORD,PUBLIC,DATA,DGROUP
defgrp DGROUP,DATA
externFP SetWowCommDlg
externFP WOW16Call
sBegin DATA
Reserved db 16 dup (0) ;reserved for Windows //!!!!! what is this
commdlg_Identifier db 'commdlg16 Data Segment'
extrn dwExtError:dword
sEnd
sEnd DATA
sBegin CODE
assumes CS,CODE
assumes DS,DATA
assumes ES,NOTHING
CommdlgThunk GETOPENFILENAME
CommdlgThunk GETSAVEFILENAME
CommdlgThunk FINDTEXT
CommdlgThunk REPLACETEXT
CommdlgThunk CHOOSECOLOR
CommdlgThunk CHOOSEFONT
CommdlgThunk PRINTDLG
CommdlgThunk WOWCOMMDLGEXTENDEDERROR
sEnd CODE
end
| 20.866667 | 80 | 0.609425 |
79202155fc7d93521b1d60e111614ce21378a133 | 3,204 | asm | Assembly | programs/oeis/169/A169712.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/169/A169712.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/169/A169712.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A169712: The function W_n(8) (see Borwein et al. reference for definition).
; 1,70,639,2716,7885,18306,36715,66424,111321,175870,265111,384660,540709,740026,989955,1298416,1673905,2125494,2662831,3296140,4036221,4894450,5882779,7013736,8300425,9756526,11396295,13234564,15286741,17568810,20097331,22889440,25962849,29335846,33027295,37056636,41443885,46209634,51375051,56961880,62992441,69489630,76476919,83978356,92018565,100622746,109816675,119626704,130079761,141203350,153025551,165575020,178880989,192973266,207882235,223638856,240274665,257821774,276312871,295781220,316260661,337785610,360391059,384112576,408986305,435048966,462337855,490890844,520746381,551943490,584521771,618521400,653983129,690948286,729458775,769557076,811286245,854689914,899812291,946698160,995392881,1045942390,1098393199,1152792396,1209187645,1267627186,1328159835,1390834984,1455702601,1522813230,1592217991,1663968580,1738117269,1814716906,1893820915,1975483296,2059758625,2146702054,2236369311,2328816700,2424101101,2522279970,2623411339,2727553816,2834766585,2945109406,3058642615,3175427124,3295524421,3418996570,3545906211,3676316560,3810291409,3947895126,4089192655,4234249516,4383131805,4535906194,4692639931,4853400840,5018257321,5187278350,5360533479,5538092836,5720027125,5906407626,6097306195,6292795264,6492947841,6697837510,6907538431,7122125340,7341673549,7566258946,7795957995,8030847736,8271005785,8516510334,8767440151,9023874580,9285893541,9553577530,9827007619,10106265456,10391433265,10682593846,10979830575,11283227404,11592868861,11908840050,12231226651,12560114920,12895591689,13237744366,13586660935,13942429956,14305140565,14674882474,15051745971,15435821920,15827201761,16225977510,16632241759,17046087676,17467609005,17896900066,18334055755,18779171544,19232343481,19693668190,20163242871,20641165300,21127533829,21622447386,22126005475,22638308176,23159456145,23689550614,24228693391,24776986860,25334533981,25901438290,26477803899,27063735496,27659338345,28264718286,28879981735,29505235684,30140587701,30786145930,31442019091,32108316480,32785147969,33472624006,34170855615,34879954396,35600032525,36331202754,37073578411,37827273400,38592402201,39369079870,40157422039,40957544916,41769565285,42593600506,43429768515,44278187824,45138977521,46012257270,46898147311,47796768460,48708242109,49632690226,50570235355,51521000616,52485109705,53462686894,54453857031,55458745540,56477478421,57510182250,58556984179,59618011936,60693393825,61783258726,62887736095,64006955964,65141048941,66290146210,67454379531,68633881240,69828784249,71039222046,72265328695,73507238836,74765087685,76039011034,77329145251,78635627280,79958594641,81298185430,82654538319,84027792556,85418087965,86825564946,88250364475,89692628104,91152497961,92630116750
mov $1,$0
mov $3,$0
lpb $0,1
add $1,$0
sub $0,1
lpe
mul $1,2
add $1,1
mov $2,8
mov $4,$3
lpb $2,1
add $1,$4
sub $2,1
lpe
mov $6,$3
lpb $6,1
add $5,$4
sub $6,1
lpe
mov $2,9
mov $4,$5
lpb $2,1
add $1,$4
sub $2,1
lpe
mov $5,0
mov $6,$3
lpb $6,1
add $5,$4
sub $6,1
lpe
mov $2,24
mov $4,$5
lpb $2,1
add $1,$4
sub $2,1
lpe
mov $5,0
mov $6,$3
lpb $6,1
add $5,$4
sub $6,1
lpe
mov $2,24
mov $4,$5
lpb $2,1
add $1,$4
sub $2,1
lpe
| 60.45283 | 2,672 | 0.845818 |
15e9058540524b458f29abc42fb1e018946065d0 | 712 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_aaddrcright.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_aaddrcright.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/_DEVELOPMENT/arch/zx/display/z80/asm_zx_aaddrcright.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z |
; ===============================================================
; Jun 2007
; ===============================================================
;
; void *zx_aaddrcright(void *attraddr)
;
; Modify attribute address to move right one character square.
; Movement wraps from column 31 to column 0 of next row.
;
; ===============================================================
SECTION code_clib
SECTION code_arch
PUBLIC asm_zx_aaddrcright
asm_zx_aaddrcright:
; enter : hl = valid attribute address
;
; exit : hl = new attribute address moved right one char square
; carry set if new attribute address is off screen
;
; uses : af, hl
inc hl
ld a,$5a
cp h
ret
| 21.575758 | 67 | 0.484551 |
413bf601c555f3e043654a2fb7a0eb76840dd736 | 4,925 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_323_1234.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_323_1234.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_323_1234.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 %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x16df0, %r15
clflush (%r15)
nop
nop
nop
sub %r8, %r8
mov (%r15), %ecx
nop
nop
sub $54662, %r10
lea addresses_D_ht+0x1ac60, %rsi
lea addresses_normal_ht+0xdcd8, %rdi
nop
nop
nop
nop
dec %r8
mov $23, %rcx
rep movsw
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0x510, %rsi
nop
nop
nop
nop
inc %r10
mov (%rsi), %r15w
nop
nop
and %r8, %r8
lea addresses_D_ht+0x17990, %rdi
nop
nop
nop
nop
and $61632, %rcx
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
add $49778, %rdi
lea addresses_normal_ht+0x14810, %rsi
nop
nop
nop
nop
nop
and $59605, %rdi
mov (%rsi), %r15
nop
nop
nop
nop
dec %r15
lea addresses_WT_ht+0x3a30, %r10
nop
nop
nop
cmp $3324, %rbx
and $0xffffffffffffffc0, %r10
movaps (%r10), %xmm1
vpextrq $1, %xmm1, %r8
nop
sub $42212, %r10
lea addresses_normal_ht+0xa10, %r10
nop
nop
nop
nop
nop
and %rsi, %rsi
mov $0x6162636465666768, %r15
movq %r15, (%r10)
nop
and $48346, %r15
lea addresses_UC_ht+0xf510, %rsi
lea addresses_UC_ht+0xe5f0, %rdi
nop
nop
and $20144, %rbp
mov $76, %rcx
rep movsb
nop
nop
nop
nop
cmp %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %r9
push %rbx
push %rcx
push %rdx
push %rsi
// Load
lea addresses_US+0x3790, %r9
nop
nop
nop
nop
add $8772, %r12
mov (%r9), %rsi
nop
sub %rdx, %rdx
// Load
mov $0x2908910000000cc0, %rbx
cmp $46189, %r8
mov (%rbx), %dx
nop
nop
cmp %r12, %r12
// Store
lea addresses_D+0x11a90, %rcx
nop
nop
nop
nop
nop
and %r12, %r12
mov $0x5152535455565758, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%rcx)
nop
nop
nop
nop
nop
cmp %r12, %r12
// Store
lea addresses_UC+0x19e70, %rcx
nop
nop
nop
nop
and %rdx, %rdx
movw $0x5152, (%rcx)
nop
add %rbx, %rbx
// Faulty Load
lea addresses_D+0x11a90, %r9
nop
nop
nop
nop
add $12253, %r12
movups (%r9), %xmm6
vpextrq $1, %xmm6, %rcx
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_US', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': True, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'00': 323}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 22.906977 | 968 | 0.649543 |
47b7867da55d62fac251c7b7eea766cb9487b67e | 21,996 | asm | Assembly | custom.asm | bplaat/win32asm | 1d0941a1e328b7aac0a0aba3d2dcbbe20aa9a970 | [
"MIT"
] | 2 | 2021-01-24T13:34:45.000Z | 2021-03-26T07:16:23.000Z | custom.asm | bplaat/win32asm | 1d0941a1e328b7aac0a0aba3d2dcbbe20aa9a970 | [
"MIT"
] | null | null | null | custom.asm | bplaat/win32asm | 1d0941a1e328b7aac0a0aba3d2dcbbe20aa9a970 | [
"MIT"
] | 1 | 2022-03-25T15:16:10.000Z | 2022-03-25T15:16:10.000Z | ; custom.asm - An pure 32-bit and 64-bit win32 assembly custom UI program
; Made by Bastiaan van der Plaat (https://bastiaan.ml/)
; 32-bit: nasm -f bin custom.asm -o custom-x86.exe && ./custom-x86
; 64-bit: nasm -DWIN64 -f bin custom.asm -o custom-x64.exe && ./custom-x64
; This programma shows that it is possible to create object oriented widgets
; library in assembly with custom drawing. If it is a super plessend experience
; is another question. But he it works 🎉
%include "libwindows.inc"
header
code_section
; ### Some stdlib like Win32 wrappers ###
function malloc, size
invoke GetProcessHeap
invoke HeapAlloc, _ax, 0, [size]
return
function free, ptr
invoke GetProcessHeap
invoke HeapFree, _ax, 0, [ptr]
return
function strlen, string
mov _si, [string]
loop
mov al, [_si]
test al, al
je %$end_loop
inc _si
end_loop
sub _si, [string]
return _si
; ### Widget object ###
struct Widget, \
rect, Rect_size, \
background_color, DWORD_size, \
draw_function, POINTER_size, \
free_function, POINTER_size
function widget_new, rect, background_color
local widget, POINTER_size
fcall malloc, Widget_size
mov [widget], _ax
fcall widget_init, _ax, [rect], [background_color]
end_local
return [widget]
%undef rect
%undef background_color
%undef widget
function widget_init, widget, rect, background_color
mov _di, [widget]
mov _si, [rect]
mov eax, [_si + Rect.x]
mov [_di + Widget.rect + Rect.x], eax
mov eax, [_si + Rect.y]
mov [_di + Widget.rect + Rect.y], eax
mov eax, [_si + Rect.width]
mov [_di + Widget.rect + Rect.width], eax
mov eax, [_si + Rect.height]
mov [_di + Widget.rect + Rect.height], eax
mov eax, [background_color]
mov [_di + Widget.background_color], eax
mov pointer [_di + Widget.draw_function], widget_draw
mov pointer [_di + Widget.free_function], widget_free
return
%undef widget
%undef rect
%undef background_color
function widget_set_x, widget, x
mov _di, [widget]
mov eax, [x]
mov [_di + Widget.rect + Rect.x], eax
return
%undef widget
%undef x
function widget_set_y, widget, y
mov _di, [widget]
mov eax, [y]
mov [_di + Widget.rect + Rect.y], eax
return
%undef widget
%undef y
function widget_set_width, widget, width
mov _di, [widget]
mov eax, [width]
mov [_di + Widget.rect + Rect.width], eax
return
%undef widget
%undef width
function widget_set_height, widget, height
mov _di, [widget]
mov eax, [height]
mov [_di + Widget.rect + Rect.height], eax
return
%undef widget
%undef height
function widget_draw, widget, hdc
local brush, POINTER_size, \
rect, RECT_size
; Create background color solid brush
mov _si, [widget]
invoke CreateSolidBrush, [_si + Widget.background_color]
mov [brush], _ax
; Draw widget background color
mov _si, [widget]
mov eax, [_si + Widget.rect + Rect.x]
mov [rect + RECT.left], eax
mov eax, [_si + Widget.rect + Rect.y]
mov [rect + RECT.top], eax
mov eax, [_si + Widget.rect + Rect.x]
add eax, [_si + Widget.rect + Rect.width]
mov [rect + RECT.right], eax
mov eax, [_si + Widget.rect + Rect.y]
add eax, [_si + Widget.rect + Rect.height]
mov [rect + RECT.bottom], eax
invoke FillRect, [hdc], addr rect, [brush]
; Delete brush object
invoke DeleteObject, [brush]
end_local
return
%undef widget
%undef hdc
%undef brush
%undef rect
function widget_free, widget
fcall free, [widget]
return
%undef widget
; ### Font object ###
%define FONT_STYLE_NORMAL 0
%define FONT_STYLE_ITALIC 1
struct Font, \
font_name, POINTER_size, \
font_weight, DWORD_size, \
font_style, DWORD_size
function font_new, font_name, font_weight, font_style
local font, POINTER_size
fcall malloc, Font_size
mov [font], _ax
fcall font_init, _ax, [font_name], [font_weight], [font_style]
end_local
return [font]
%undef font_name
%undef font_weight
%undef font_style
%undef font
function font_init, font, font_name, font_weight, font_style
mov _di, [font]
mov _ax, [font_name]
mov [_di + Font.font_name], _ax
mov eax, [font_weight]
mov [_di + Font.font_weight], eax
mov eax, [font_style]
mov [_di + Font.font_style], eax
return
%undef font
%undef font_name
%undef font_weight
%undef font_style
function font_free, font
fcall free, [font]
return
%undef font
; Label object
struct Label, \
widget, Widget_size, \
text, POINTER_size, \
font, POINTER_size, \
text_size, DWORD_size, \
text_color, DWORD_size
function label_new, rect, background_color, text, font, text_size, text_color
local label, POINTER_size
fcall malloc, Label_size
mov [label], _ax
fcall label_init, _ax, [rect], [background_color], [text], [font], [text_size], [text_color]
end_local
return [label]
%undef rect
%undef background_color
%undef text
%undef font
%undef text_size
%undef text_color
%undef label
function label_init, label, rect, background_color, text, font, text_size, text_color
fcall widget_init, [label], [rect], [background_color]
mov _di, [label]
mov pointer [_di + Widget.draw_function], label_draw
mov pointer [_di + Widget.free_function], label_free
mov _ax, [text]
mov [_di + Label.text], _ax
mov _ax, [font]
mov [_di + Label.font], _ax
mov eax, [text_size]
mov [_di + Label.text_size], eax
mov eax, [text_color]
mov [_di + Label.text_color], eax
return
%undef label
%undef rect
%undef background_color
%undef text
%undef font
%undef text_size
%undef text_color
function label_draw, label, hdc
local font, POINTER_size, \
rect, Rect_size
; Draw parent widget object
fcall widget_draw, [label], [hdc]
; Create font object
mov _si, [label]
mov _di, [_si + Label.font]
invoke CreateFontA, [_si + Label.text_size], 0, 0, 0, [_di + Font.font_weight], [_di + Font.font_style], FALSE, FALSE, \
ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, DEFAULT_PITCH | FF_DONTCARE, [_di + Font.font_name]
mov [font], _ax
; Draw label
invoke SelectObject, [hdc], [font]
invoke SetBkMode, [hdc], TRANSPARENT
mov _si, [label]
invoke SetTextColor, [hdc], [_si + Label.text_color]
invoke SetTextAlign, [hdc], TA_CENTER
mov _si, [label]
fcall strlen, [_si + Label.text]
mov _si, [label]
mov edx, [_si + Widget.rect + Rect.width]
shr edx, 1
add edx, [_si + Widget.rect + Rect.x]
mov edi, [_si + Widget.rect + Rect.height]
sub edi, [_si + Label.text_size]
shr edi, 1
add edi, [_si + Widget.rect + Rect.y]
invoke TextOutA, [hdc], _dx, _di, [_si + Label.text], _ax
; Free font object
invoke DeleteObject, [font]
end_local
return
%undef label
%undef hdc
%undef font
function label_free, label
fcall free, [label]
return
%undef label
; ### Window Code ###
struct WindowData, \
background_color, DWORD_size, \
header_font, POINTER_size, \
footer_font, POINTER_size, \
widgets, 64 * POINTER_size, \
widgets_size, DWORD_size
; Function to add widget to window data
function window_add_widget, window_data, widget
mov _di, [window_data]
mov ecx, [_di + WindowData.widgets_size]
mov _ax, [widget]
mov [_di + WindowData.widgets + _cx * POINTER_size], _ax
inc ecx
mov [_di + WindowData.widgets_size], ecx
return
%undef window_data
%undef widget
; Window procedure function
function WindowProc, hwnd, uMsg, wParam, lParam
mov eax, [uMsg]
cmp eax, WM_CREATE
je .wm_create
cmp eax, WM_SIZE
je .wm_size
cmp eax, WM_GETMINMAXINFO
je .wm_getminmaxinfo
cmp eax, WM_ERASEBKGND
je .wm_erasebkgnd
cmp eax, WM_PAINT
je .wm_paint
cmp eax, WM_DESTROY
je .wm_destroy
jmp .default
.wm_create:
local window_data, POINTER_size, \
window_rect, RECT_size, \
new_window_rect, Rect_size
; Create window data
fcall malloc, WindowData_size
mov [window_data], _ax
invoke SetWindowLongPtrA, [hwnd], GWLP_USERDATA, _ax
; Set background color
mov _di, [window_data]
mov dword [_di + WindowData.background_color], 0x00ffffff
; Creat fonts
fcall font_new, header_font_name, 700, FONT_STYLE_ITALIC
mov _di, [window_data]
mov [_di + WindowData.header_font], _ax
fcall font_new, footer_font_name, 400, FONT_STYLE_NORMAL
mov _di, [window_data]
mov [_di + WindowData.footer_font], _ax
; Create widgets
mov _di, [window_data]
mov dword [_di + WindowData.widgets_size], 0
; Create header label widget
mov dword [new_window_rect + Rect.x], 0
mov dword [new_window_rect + Rect.y], 0
mov dword [new_window_rect + Rect.height], 64
mov _si, [window_data]
fcall label_new, addr new_window_rect, 0x00222222, window_title, [_si + WindowData.header_font], 24, 0x00ffffff
fcall window_add_widget, [window_data], _ax
; Create red rect
mov dword [new_window_rect + Rect.x], 100
mov dword [new_window_rect + Rect.y], 100
mov dword [new_window_rect + Rect.width], 320
mov dword [new_window_rect + Rect.height], 240
fcall widget_new, addr new_window_rect, 0x000000ff
fcall window_add_widget, [window_data], _ax
; Create green rect
mov dword [new_window_rect + Rect.x], 200
mov dword [new_window_rect + Rect.y], 200
fcall widget_new, addr new_window_rect, 0x0000ff00
fcall window_add_widget, [window_data], _ax
; Create blue rect
mov dword [new_window_rect + Rect.x], 300
mov dword [new_window_rect + Rect.y], 300
fcall widget_new, addr new_window_rect, 0x00ff0000
fcall window_add_widget, [window_data], _ax
; Create footer label widget
mov dword [new_window_rect + Rect.x], 16
mov dword [new_window_rect + Rect.height], 32
mov _si, [window_data]
fcall label_new, addr new_window_rect, 0x00eeeeee, about_label, [_si + WindowData.footer_font], 24, 0x00111111
fcall window_add_widget, [window_data], _ax
; Center window
invoke GetClientRect, [hwnd], addr window_rect
mov eax, [window_width]
shl eax, 1
sub eax, [window_rect + RECT.right]
mov [new_window_rect + Rect.width], eax
mov eax, [window_height]
shl eax, 1
sub eax, [window_rect + RECT.bottom]
mov [new_window_rect + Rect.height], eax
invoke GetSystemMetrics, SM_CXSCREEN
sub eax, [new_window_rect + Rect.width]
shr eax, 1
mov [new_window_rect + Rect.x], eax
invoke GetSystemMetrics, SM_CYSCREEN
sub eax, [new_window_rect + Rect.height]
shr eax, 1
mov [new_window_rect + Rect.y], eax
invoke SetWindowPos, [hwnd], HWND_TOP, [new_window_rect + Rect.x], [new_window_rect + Rect.y], [new_window_rect + Rect.width], [new_window_rect + Rect.height], SWP_NOZORDER
end_local
return 0
%undef window_data
.wm_size:
local window_data, POINTER_size
; Get window data
invoke GetWindowLongPtrA, [hwnd], GWLP_USERDATA
mov [window_data], _ax
; Save new window size
movzx eax, word [lParam]
mov [window_width], eax
mov eax, [lParam]
shr eax, 16
mov [window_height], eax
; Change header label width
mov _si, [window_data]
mov _si, [_si + WindowData.widgets + 0 * POINTER_size]
fcall widget_set_width, _si, [window_width]
; Change footer label y and width
mov _si, [window_data]
mov _si, [_si + WindowData.widgets + 4 * POINTER_size]
mov eax, [window_height]
sub eax, 32 + 16
fcall widget_set_y, _si, _ax
mov eax, [window_width]
sub eax, 32
fcall widget_set_width, _si, _ax
end_local
return 0
%undef window_data
.wm_getminmaxinfo:
; Set window min size
mov _di, [lParam]
mov dword [_di + MINMAXINFO.ptMinTrackSize + POINT.x], 320
mov dword [_di + MINMAXINFO.ptMinTrackSize + POINT.y], 240
return 0
.wm_erasebkgnd:
; Draw no background
return TRUE
.wm_paint:
local window_data, POINTER_size, \
paint_struct, PAINTSTRUCT_size, \
hdc_buffer, POINTER_size, \
bitmap_buffer, POINTER_size, \
brush, POINTER_size, \
index, DWORD_size
; Get window data
invoke GetWindowLongPtrA, [hwnd], GWLP_USERDATA
mov [window_data], _ax
; Begin paint
invoke BeginPaint, [hwnd], addr paint_struct
; Create back buffer
invoke CreateCompatibleDC, [paint_struct + PAINTSTRUCT.hdc]
mov [hdc_buffer], _ax
invoke CreateCompatibleBitmap, [paint_struct + PAINTSTRUCT.hdc], [window_width], [window_height]
mov [bitmap_buffer], _ax
invoke SelectObject, [hdc_buffer], [bitmap_buffer]
; Draw background color
mov _si, [window_data]
invoke CreateSolidBrush, [_si + WindowData.background_color]
mov [brush], _ax
mov dword [rect + RECT.left], 0
mov dword [rect + RECT.top], 0
mov eax, [window_width]
mov [rect + RECT.right], eax
mov eax, [window_height]
mov [rect + RECT.bottom], eax
invoke FillRect, [hdc_buffer], addr rect, [brush]
invoke DeleteObject, [brush]
; Draw widgets
mov dword [index], 0
mov ecx, [index]
mov _si, [window_data]
while ecx, "!=", [_si + WindowData.widgets_size]
mov _si, [_si + WindowData.widgets + _cx * POINTER_size]
fcall [_si + Widget.draw_function], _si, [hdc_buffer]
inc dword [index]
mov ecx, [index]
mov _si, [window_data]
end_while
; Draw and delete back buffer
invoke BitBlt, [paint_struct + PAINTSTRUCT.hdc], 0, 0, [window_width], [window_height], [hdc_buffer], 0, 0, SRCCOPY
invoke DeleteObject, [bitmap_buffer]
invoke DeleteDC, [hdc_buffer]
; End paint
invoke EndPaint, [hwnd], addr paint_struct
end_local
return 0
%undef window_data
%undef index
.wm_destroy:
local window_data, POINTER_size, \
index, DWORD_size
; Get window data
invoke GetWindowLongPtrA, [hwnd], GWLP_USERDATA
mov [window_data], _ax
; Free fonts
mov _si, [window_data]
fcall font_free, [_si + WindowData.header_font]
mov _si, [window_data]
fcall font_free, [_si + WindowData.footer_font]
; Free widgets
mov dword [index], 0
mov ecx, [index]
mov _si, [window_data]
while ecx, "!=", [_si + WindowData.widgets_size]
mov _si, [_si + WindowData.widgets + _cx * POINTER_size]
fcall [_si + Widget.free_function], _si
inc dword [index]
mov ecx, [index]
mov _si, [window_data]
end_while
; Free window data
fcall free, [window_data]
; Close process
invoke PostQuitMessage, 0
end_local
return 0
.default:
invoke DefWindowProcA, [hwnd], [uMsg], [wParam], [lParam]
return
%undef hwnd
; Main entry point
entrypoint
local window_class, WNDCLASSEX_size, \
hwnd, POINTER_size, \
message, MSG_size
; Register the window class
mov dword [window_class + WNDCLASSEX.cbSize], WNDCLASSEX_size
mov dword [window_class + WNDCLASSEX.style], CS_HREDRAW | CS_VREDRAW
mov pointer [window_class + WNDCLASSEX.lpfnWndProc], WindowProc
mov dword [window_class + WNDCLASSEX.cbClsExtra], 0
mov dword [window_class + WNDCLASSEX.cbWndExtra], 0
invoke GetModuleHandleA, NULL
mov [window_class + WNDCLASSEX.hInstance], _ax
invoke LoadIconA, NULL, IDI_APPLICATION
mov [window_class + WNDCLASSEX.hIcon], _ax
mov [window_class + WNDCLASSEX.hIconSm], _ax
invoke LoadCursorA, NULL, IDC_ARROW
mov [window_class + WNDCLASSEX.hCursor], _ax
mov pointer [window_class + WNDCLASSEX.hbrBackground], NULL
mov pointer [window_class + WNDCLASSEX.lpszMenuName], NULL
mov pointer [window_class + WNDCLASSEX.lpszClassName], window_class_name
invoke RegisterClassExA, addr window_class
; Create the window
invoke CreateWindowExA, 0, window_class_name, window_title, WS_OVERLAPPEDWINDOW, \
CW_USEDEFAULT, CW_USEDEFAULT, [window_width], [window_height], \
HWND_DESKTOP, NULL, [window_class + WNDCLASSEX.hInstance], NULL
mov [hwnd], _ax
invoke ShowWindow, [hwnd], SW_SHOWDEFAULT
invoke UpdateWindow, [hwnd]
; Message loop
loop
invoke GetMessageA, addr message, NULL, 0, 0
test _ax, _ax
jle %$end_loop
invoke TranslateMessage, addr message
invoke DispatchMessageA, addr message
end_loop
invoke ExitProcess, [message + MSG.wParam]
end_local
end_code_section
data_section
; String constants
window_class_name db "custom-test", 0
%ifdef WIN64
window_title db "This is a custom UI window (64-bit)", 0
%else
window_title db "This is a custom UI window (32-bit)", 0
%endif
header_font_name db "Georgia", 0
footer_font_name db "Comic Sans MS", 0
about_label db "Made by Bastiaan van der Plaat", 0
; Global variables
window_width dd 800
window_height dd 600
; Import table
import_table
library gdi_table, "GDI32.DLL", \
kernel_table, "KERNEL32.DLL", \
user_table, "USER32.DLL"
import gdi_table, \
BitBlt, "BitBlt", \
CreateCompatibleBitmap, "CreateCompatibleBitmap", \
CreateCompatibleDC, "CreateCompatibleDC", \
CreateFontA, "CreateFontA", \
CreateSolidBrush, "CreateSolidBrush", \
DeleteDC, "DeleteDC", \
DeleteObject, "DeleteObject", \
SelectObject, "SelectObject", \
SetBkMode, "SetBkMode", \
SetTextAlign, "SetTextAlign", \
SetTextColor, "SetTextColor", \
TextOutA, "TextOutA"
import kernel_table, \
ExitProcess, "ExitProcess", \
HeapAlloc, "HeapAlloc", \
HeapFree, "HeapFree", \
GetModuleHandleA, "GetModuleHandleA", \
GetProcessHeap, "GetProcessHeap"
import user_table, \
BeginPaint, "BeginPaint", \
CreateWindowExA, "CreateWindowExA", \
DefWindowProcA, "DefWindowProcA", \
DispatchMessageA, "DispatchMessageA", \
EndPaint, "EndPaint", \
FillRect, "FillRect", \
GetClientRect, "GetClientRect", \
GetMessageA, "GetMessageA", \
GetSystemMetrics, "GetSystemMetrics", \
GetWindowLongPtrA, GetWindowLongPtrAString, \
LoadCursorA, "LoadCursorA", \
LoadIconA, "LoadIconA", \
PostQuitMessage, "PostQuitMessage", \
RegisterClassExA, "RegisterClassExA", \
SetWindowLongPtrA, SetWindowLongPtrAString, \
SetWindowPos, "SetWindowPos", \
ShowWindow, "ShowWindow", \
TranslateMessage, "TranslateMessage", \
UpdateWindow, "UpdateWindow"
end_import_table
end_data_section
| 29.564516 | 184 | 0.573695 |
7af9123fee07e46754959fc9ae2eb98bee78d3e0 | 1,434 | asm | Assembly | programs/oeis/230/A230584.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/230/A230584.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/230/A230584.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A230584: Either two less than a square or two more than a square.
; 2,3,6,7,11,14,18,23,27,34,38,47,51,62,66,79,83,98,102,119,123,142,146,167,171,194,198,223,227,254,258,287,291,322,326,359,363,398,402,439,443,482,486,527,531,574,578,623,627,674,678,727,731,782,786,839,843,898,902,959,963,1022,1026,1087,1091,1154,1158,1223,1227,1294,1298,1367,1371,1442,1446,1519,1523,1598,1602,1679,1683,1762,1766,1847,1851,1934,1938,2023,2027,2114,2118,2207,2211,2302,2306,2399,2403,2498,2502,2599,2603,2702,2706,2807,2811,2914,2918,3023,3027,3134,3138,3247,3251,3362,3366,3479,3483,3598,3602,3719,3723,3842,3846,3967,3971,4094,4098,4223,4227,4354,4358,4487,4491,4622,4626,4759,4763,4898,4902,5039,5043,5182,5186,5327,5331,5474,5478,5623,5627,5774,5778,5927,5931,6082,6086,6239,6243,6398,6402,6559,6563,6722,6726,6887,6891,7054,7058,7223,7227,7394,7398,7567,7571,7742,7746,7919,7923,8098,8102,8279,8283,8462,8466,8647,8651,8834,8838,9023,9027,9214,9218,9407,9411,9602,9606,9799,9803,9998,10002,10199,10203,10402,10406,10607,10611,10814,10818,11023,11027,11234,11238,11447,11451,11662,11666,11879,11883,12098,12102,12319,12323,12542,12546,12767,12771,12994,12998,13223,13227,13454,13458,13687,13691,13922,13926,14159,14163,14398,14402,14639,14643,14882,14886,15127,15131,15374,15378,15623,15627,15874
add $0,3
mov $2,1
lpb $0,1
add $1,$0
add $2,$0
sub $0,1
mov $3,$2
add $2,4
sub $3,5
trn $3,$1
mov $1,$3
sub $2,5
lpe
add $1,2
| 79.666667 | 1,220 | 0.758717 |
85147663727a8e096c1943cd6d81649f0d954b2b | 413 | asm | Assembly | programs/oeis/008/A008062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | ; A008062: a(n) = maximal value of m such that an n X m radar array exists. (A (0,1) matrix A such that any horizontal shift of A overlaps A in at most a single 1.)
; 2,4,7,10,12,15,18,21,24,26,29,32,35,37,40,43
mov $1,$0
mul $0,5
mov $2,1
lpb $0
mul $2,$0
add $0,$1
sub $0,1
mov $4,$1
add $1,3
cmp $3,0
add $2,$3
mod $4,$2
mov $3,$4
cmp $3,0
add $4,$3
sub $0,$4
div $2,$4
lpe
add $0,2
| 17.956522 | 164 | 0.576271 |
be995b56baded914a72dcb6ecb50c102ba08b203 | 4,104 | asm | Assembly | src/arch/x86_64/boot.asm | spratt/argOS | cb5e2f8d4c1e44b530cb334f759ed7a2c4f9d1c4 | [
"MIT"
] | 4 | 2016-04-21T23:48:51.000Z | 2019-08-08T02:27:11.000Z | src/arch/x86_64/boot.asm | spratt/argOS | cb5e2f8d4c1e44b530cb334f759ed7a2c4f9d1c4 | [
"MIT"
] | null | null | null | src/arch/x86_64/boot.asm | spratt/argOS | cb5e2f8d4c1e44b530cb334f759ed7a2c4f9d1c4 | [
"MIT"
] | null | null | null | global start
;;; Resources:
;;; http://cs.lmu.edu/~ray/notes/nasmtutorial/
;;; http://nasmcodeasy.blogspot.ca/2014/04/
;;; https://en.wikibooks.org/wiki/X86_Assembly/Shift_and_Rotate
;;; https://en.wikipedia.org/wiki/VGA-compatible_text_mode#Text_buffer
;;; https://en.wikipedia.org/wiki/Video_Graphics_Array#Color_palette
;;; stackoverflow.com/questions/12063840/
section .text
bits 32
start:
mov eax, 0xdead3210
call error
hlt
;;; error: print an error code, then halt!
;;; input:
;;; eax: error code
error:
mov dword [0xb8000], 0x4f524f45 ; RE
mov dword [0xb8004], 0x4f3a4f52 ; :R
mov dword [0xb8008], 0x4f204f20 ;
mov ch, 0x4f
mov ebx, 0xa
call print_dword
hlt
;;; print_qword: prints 8 bytes of hex as ascii
;;; input:
;;; eax: bytes to print
;;; ebx: offset at which to print
;;; ch: vga color
;;; stomps:
;;; edx
print_qword:
;;; Only compiles in 64-bit
;; mov rdx, rax
;; shr rdx, 0x38
;; call print_byte
;; mov rdx, rax
;; shr rdx, 0x30
;; call print_byte
;; mov rdx, rax
;; shr rdx, 0x28
;; call print_byte
;; mov rdx, rax
;; shr rdx, 0x20
;; call print_byte
;; call print_dword
ret
;;; print_dword: prints 4 bytes of hex as ascii
;;; input:
;;; eax: bytes to print
;;; ebx: offset at which to print
;;; ch: vga color
;;; stomps:
;;; edx
print_dword:
mov edx, eax
shr edx, 0x18
call print_byte
mov edx, eax
shr edx, 0x10
call print_byte
call print_word
ret
;;; print_word: prints 2 bytes of hex as ascii
;;; input:
;;; ax: bytes to print
;;; ebx: offset at which to print
;;; ch: vga color
;;; stomps:
;;; edx
print_word:
mov dh, ah
shr dx, 8
call print_byte
mov dl, al
call print_byte
ret
;;; print_byte: prints a single byte of hex as ascii
;;; input:
;;; dl: byte to print
;;; ebx: offset at which to print
;;; ch: vga color
print_byte:
ror dl, 4
call hex_to_ascii
call put_char
add ebx, 2
ror dl, 4
call hex_to_ascii
call put_char
add ebx, 2
ret
;;; vga_test: prints all the colors of the vga palette
;;; stomps:
;;; eax
;;; ebx
;;; ecx
;;; edx
vga_test:
mov eax, 0
mov ebx, 0
.loop:
;;; Print first nibble
mov dl, al
shr dl, 4
call hex_to_ascii
mov ch, al
call put_char
;;; Print second nibble
add ebx, 2
mov dl, al
call hex_to_ascii
mov ch, al
call put_char
;;; finally, increment and loop
add ebx, 2
inc al
cmp al, 0x80
jne .loop
ret
;;; hex_to_ascii: convert a nibble from hex to ascii
;;; e.g., 0x0 -> 0x30, 0x1 -> 0x31, ...
;;; 0xa -> 0x61, 0xb -> 0x62, ...
;;; input:
;;; dl (the lower nibble)
;;;
;;; output:
;;; cl
hex_to_ascii:
mov cl, dl
and cl, 0xf ; get rid of the upper nibble
cmp cl, 0x9
jbe .small
add cl, 0x27
.small:
add cl, 0x30
ret
;;; put_char: put a single character on the screen
;;; input:
;;; ch: vga color
;;; cl: ascii character
;;; ebx: offset from the top left
;;;
;;; The screen output buffer is located at memory address 0xb8000
;;; Each word is a (color,character) pair, where:
;;; color: 1 byte (2 hex digits) vga color (see next note)
;;; character: 1 byte ascii character
;;;
;;; e.g., 0030 is:
;;; 00: color
;;; 30: ascii 0
;;; So this prints 0 colored according to the following palette:
;;;
;;; Background & foreground:
;;; 0: black
;;; 1: blue
;;; 2: green
;;; 3: cyan
;;; 4: red
;;; 5: magenta
;;; 6: brown
;;; 7: gray
;;; Foreground only, since background uses 1000 bit to flash:
;;; 8: dark gray
;;; 9: bright blue
;;; a: bright green
;;; b: bright cyan
;;; c: bright red
;;; d: bright magenta
;;; e: yellow
;;; f: white
put_char:
mov word [0xb8000 + ebx], cx
ret
| 22.183784 | 71 | 0.56116 |
78222071289874c92f9189c1dd1d188f969d8053 | 1,988 | asm | Assembly | Libraries/source/c/ftok.asm | agguro/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | 6 | 2020-07-19T18:34:43.000Z | 2022-03-26T10:21:09.000Z | Libraries/source/c/ftok.asm | NrdyBhu1/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | null | null | null | Libraries/source/c/ftok.asm | NrdyBhu1/linux-nasm | 3e72083c3db6d7118eb2aa430b73e0d20e88456b | [
"Unlicense"
] | 3 | 2020-07-19T18:35:10.000Z | 2021-07-25T17:34:50.000Z | ;name: ftok.asm
;
;description: This is the assembler version of the c/c++ function ftok.
; the type key_t is actually just a long, you can use any number you want. But what if you hard-code the number and some other unrelated
; program hardcodes the same number but wants another queue? The solution is to use the ftok() function which generates a key from two arguments:
; key_t ftok(const char *path, int id);
;
;source: http://beej.us/guide/bgipc/output/html/multipage/mq.html
bits 64
%include "../functions/functions.inc"
section .text
global ftok
ftok:
; entry: RDI has the path/file string to the file
; RSI has an 'project id' arbitrary choosen.
; on return: RAX has a unique key
; on failure: RAX = a negative number containing the error
;
; the ftok function is defined in c/c++ as follows:
; key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((proj_id & 0xff) << 24));
; save used registers
push rbx
push rdi
push rsi
push r8
; save the project id in R8 (will remain after syscalls)
mov r8,rsi
; open the file
syscall open,rdi, O_RDONLY
and rax,rax
js .done ; something wrong, errno in rax and return
syscall fstat,rax, stat ; get filestatus
and rax,rax
js .done ; something wrong, errno in rax and return
mov rax,qword [stat.st_ino] ; get the file size
and rax,0xFFFF
mov rbx,qword [stat.st_dev] ; ID of device containing file
and rbx,0xFF
shl rbx,16
or rax,rbx
and r8,0xFF ; R8 = proj_id
shl r8,24
or rax,r8
.done:
; rax now contains a key which uniquely identifies the file.
; restore used registers
pop r8
pop rsi
pop rdi
pop rbx
ret
| 34.275862 | 157 | 0.577968 |
787f2c5b6aa7317c2871133b02616c193358726d | 193 | asm | Assembly | libsrc/_DEVELOPMENT/font/font_8x10/_font_8x10_zx_system.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/font/font_8x10/_font_8x10_zx_system.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/font/font_8x10/_font_8x10_zx_system.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | SECTION rodata_font
SECTION rodata_font_8x10
PUBLIC _font_8x10_zx_system
PUBLIC _font_8x10_zx_system_end
_font_8x10_zx_system:
BINARY "font_8x10_zx_system.bin"
_font_8x10_zx_system_end:
| 16.083333 | 35 | 0.875648 |
34393af7771abd822255f74facf6bb8b60d3e317 | 18,876 | asm | Assembly | third_party/boringssl/win-x86/crypto/chacha/chacha-x86.asm | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | third_party/boringssl/win-x86/crypto/chacha/chacha-x86.asm | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 250 | 2018-02-02T23:16:57.000Z | 2022-03-21T06:09:53.000Z | third_party/boringssl/win-x86/crypto/chacha/chacha-x86.asm | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | ; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
%ifidn __OUTPUT_FORMAT__,obj
section code use32 class=code align=64
%elifidn __OUTPUT_FORMAT__,win32
$@feat.00 equ 1
section .text code align=64
%else
section .text code
%endif
global _ChaCha20_ctr32
align 16
_ChaCha20_ctr32:
L$_ChaCha20_ctr32_begin:
push ebp
push ebx
push esi
push edi
xor eax,eax
cmp eax,DWORD [28+esp]
je NEAR L$000no_data
call L$pic_point
L$pic_point:
pop eax
lea ebp,[_OPENSSL_ia32cap_P]
test DWORD [ebp],16777216
jz NEAR L$001x86
test DWORD [4+ebp],512
jz NEAR L$001x86
jmp NEAR L$ssse3_shortcut
L$001x86:
mov esi,DWORD [32+esp]
mov edi,DWORD [36+esp]
sub esp,132
mov eax,DWORD [esi]
mov ebx,DWORD [4+esi]
mov ecx,DWORD [8+esi]
mov edx,DWORD [12+esi]
mov DWORD [80+esp],eax
mov DWORD [84+esp],ebx
mov DWORD [88+esp],ecx
mov DWORD [92+esp],edx
mov eax,DWORD [16+esi]
mov ebx,DWORD [20+esi]
mov ecx,DWORD [24+esi]
mov edx,DWORD [28+esi]
mov DWORD [96+esp],eax
mov DWORD [100+esp],ebx
mov DWORD [104+esp],ecx
mov DWORD [108+esp],edx
mov eax,DWORD [edi]
mov ebx,DWORD [4+edi]
mov ecx,DWORD [8+edi]
mov edx,DWORD [12+edi]
sub eax,1
mov DWORD [112+esp],eax
mov DWORD [116+esp],ebx
mov DWORD [120+esp],ecx
mov DWORD [124+esp],edx
jmp NEAR L$002entry
align 16
L$003outer_loop:
mov DWORD [156+esp],ebx
mov DWORD [152+esp],eax
mov DWORD [160+esp],ecx
L$002entry:
mov eax,1634760805
mov DWORD [4+esp],857760878
mov DWORD [8+esp],2036477234
mov DWORD [12+esp],1797285236
mov ebx,DWORD [84+esp]
mov ebp,DWORD [88+esp]
mov ecx,DWORD [104+esp]
mov esi,DWORD [108+esp]
mov edx,DWORD [116+esp]
mov edi,DWORD [120+esp]
mov DWORD [20+esp],ebx
mov DWORD [24+esp],ebp
mov DWORD [40+esp],ecx
mov DWORD [44+esp],esi
mov DWORD [52+esp],edx
mov DWORD [56+esp],edi
mov ebx,DWORD [92+esp]
mov edi,DWORD [124+esp]
mov edx,DWORD [112+esp]
mov ebp,DWORD [80+esp]
mov ecx,DWORD [96+esp]
mov esi,DWORD [100+esp]
add edx,1
mov DWORD [28+esp],ebx
mov DWORD [60+esp],edi
mov DWORD [112+esp],edx
mov ebx,10
jmp NEAR L$004loop
align 16
L$004loop:
add eax,ebp
mov DWORD [128+esp],ebx
mov ebx,ebp
xor edx,eax
rol edx,16
add ecx,edx
xor ebx,ecx
mov edi,DWORD [52+esp]
rol ebx,12
mov ebp,DWORD [20+esp]
add eax,ebx
xor edx,eax
mov DWORD [esp],eax
rol edx,8
mov eax,DWORD [4+esp]
add ecx,edx
mov DWORD [48+esp],edx
xor ebx,ecx
add eax,ebp
rol ebx,7
xor edi,eax
mov DWORD [32+esp],ecx
rol edi,16
mov DWORD [16+esp],ebx
add esi,edi
mov ecx,DWORD [40+esp]
xor ebp,esi
mov edx,DWORD [56+esp]
rol ebp,12
mov ebx,DWORD [24+esp]
add eax,ebp
xor edi,eax
mov DWORD [4+esp],eax
rol edi,8
mov eax,DWORD [8+esp]
add esi,edi
mov DWORD [52+esp],edi
xor ebp,esi
add eax,ebx
rol ebp,7
xor edx,eax
mov DWORD [36+esp],esi
rol edx,16
mov DWORD [20+esp],ebp
add ecx,edx
mov esi,DWORD [44+esp]
xor ebx,ecx
mov edi,DWORD [60+esp]
rol ebx,12
mov ebp,DWORD [28+esp]
add eax,ebx
xor edx,eax
mov DWORD [8+esp],eax
rol edx,8
mov eax,DWORD [12+esp]
add ecx,edx
mov DWORD [56+esp],edx
xor ebx,ecx
add eax,ebp
rol ebx,7
xor edi,eax
rol edi,16
mov DWORD [24+esp],ebx
add esi,edi
xor ebp,esi
rol ebp,12
mov ebx,DWORD [20+esp]
add eax,ebp
xor edi,eax
mov DWORD [12+esp],eax
rol edi,8
mov eax,DWORD [esp]
add esi,edi
mov edx,edi
xor ebp,esi
add eax,ebx
rol ebp,7
xor edx,eax
rol edx,16
mov DWORD [28+esp],ebp
add ecx,edx
xor ebx,ecx
mov edi,DWORD [48+esp]
rol ebx,12
mov ebp,DWORD [24+esp]
add eax,ebx
xor edx,eax
mov DWORD [esp],eax
rol edx,8
mov eax,DWORD [4+esp]
add ecx,edx
mov DWORD [60+esp],edx
xor ebx,ecx
add eax,ebp
rol ebx,7
xor edi,eax
mov DWORD [40+esp],ecx
rol edi,16
mov DWORD [20+esp],ebx
add esi,edi
mov ecx,DWORD [32+esp]
xor ebp,esi
mov edx,DWORD [52+esp]
rol ebp,12
mov ebx,DWORD [28+esp]
add eax,ebp
xor edi,eax
mov DWORD [4+esp],eax
rol edi,8
mov eax,DWORD [8+esp]
add esi,edi
mov DWORD [48+esp],edi
xor ebp,esi
add eax,ebx
rol ebp,7
xor edx,eax
mov DWORD [44+esp],esi
rol edx,16
mov DWORD [24+esp],ebp
add ecx,edx
mov esi,DWORD [36+esp]
xor ebx,ecx
mov edi,DWORD [56+esp]
rol ebx,12
mov ebp,DWORD [16+esp]
add eax,ebx
xor edx,eax
mov DWORD [8+esp],eax
rol edx,8
mov eax,DWORD [12+esp]
add ecx,edx
mov DWORD [52+esp],edx
xor ebx,ecx
add eax,ebp
rol ebx,7
xor edi,eax
rol edi,16
mov DWORD [28+esp],ebx
add esi,edi
xor ebp,esi
mov edx,DWORD [48+esp]
rol ebp,12
mov ebx,DWORD [128+esp]
add eax,ebp
xor edi,eax
mov DWORD [12+esp],eax
rol edi,8
mov eax,DWORD [esp]
add esi,edi
mov DWORD [56+esp],edi
xor ebp,esi
rol ebp,7
dec ebx
jnz NEAR L$004loop
mov ebx,DWORD [160+esp]
add eax,1634760805
add ebp,DWORD [80+esp]
add ecx,DWORD [96+esp]
add esi,DWORD [100+esp]
cmp ebx,64
jb NEAR L$005tail
mov ebx,DWORD [156+esp]
add edx,DWORD [112+esp]
add edi,DWORD [120+esp]
xor eax,DWORD [ebx]
xor ebp,DWORD [16+ebx]
mov DWORD [esp],eax
mov eax,DWORD [152+esp]
xor ecx,DWORD [32+ebx]
xor esi,DWORD [36+ebx]
xor edx,DWORD [48+ebx]
xor edi,DWORD [56+ebx]
mov DWORD [16+eax],ebp
mov DWORD [32+eax],ecx
mov DWORD [36+eax],esi
mov DWORD [48+eax],edx
mov DWORD [56+eax],edi
mov ebp,DWORD [4+esp]
mov ecx,DWORD [8+esp]
mov esi,DWORD [12+esp]
mov edx,DWORD [20+esp]
mov edi,DWORD [24+esp]
add ebp,857760878
add ecx,2036477234
add esi,1797285236
add edx,DWORD [84+esp]
add edi,DWORD [88+esp]
xor ebp,DWORD [4+ebx]
xor ecx,DWORD [8+ebx]
xor esi,DWORD [12+ebx]
xor edx,DWORD [20+ebx]
xor edi,DWORD [24+ebx]
mov DWORD [4+eax],ebp
mov DWORD [8+eax],ecx
mov DWORD [12+eax],esi
mov DWORD [20+eax],edx
mov DWORD [24+eax],edi
mov ebp,DWORD [28+esp]
mov ecx,DWORD [40+esp]
mov esi,DWORD [44+esp]
mov edx,DWORD [52+esp]
mov edi,DWORD [60+esp]
add ebp,DWORD [92+esp]
add ecx,DWORD [104+esp]
add esi,DWORD [108+esp]
add edx,DWORD [116+esp]
add edi,DWORD [124+esp]
xor ebp,DWORD [28+ebx]
xor ecx,DWORD [40+ebx]
xor esi,DWORD [44+ebx]
xor edx,DWORD [52+ebx]
xor edi,DWORD [60+ebx]
lea ebx,[64+ebx]
mov DWORD [28+eax],ebp
mov ebp,DWORD [esp]
mov DWORD [40+eax],ecx
mov ecx,DWORD [160+esp]
mov DWORD [44+eax],esi
mov DWORD [52+eax],edx
mov DWORD [60+eax],edi
mov DWORD [eax],ebp
lea eax,[64+eax]
sub ecx,64
jnz NEAR L$003outer_loop
jmp NEAR L$006done
L$005tail:
add edx,DWORD [112+esp]
add edi,DWORD [120+esp]
mov DWORD [esp],eax
mov DWORD [16+esp],ebp
mov DWORD [32+esp],ecx
mov DWORD [36+esp],esi
mov DWORD [48+esp],edx
mov DWORD [56+esp],edi
mov ebp,DWORD [4+esp]
mov ecx,DWORD [8+esp]
mov esi,DWORD [12+esp]
mov edx,DWORD [20+esp]
mov edi,DWORD [24+esp]
add ebp,857760878
add ecx,2036477234
add esi,1797285236
add edx,DWORD [84+esp]
add edi,DWORD [88+esp]
mov DWORD [4+esp],ebp
mov DWORD [8+esp],ecx
mov DWORD [12+esp],esi
mov DWORD [20+esp],edx
mov DWORD [24+esp],edi
mov ebp,DWORD [28+esp]
mov ecx,DWORD [40+esp]
mov esi,DWORD [44+esp]
mov edx,DWORD [52+esp]
mov edi,DWORD [60+esp]
add ebp,DWORD [92+esp]
add ecx,DWORD [104+esp]
add esi,DWORD [108+esp]
add edx,DWORD [116+esp]
add edi,DWORD [124+esp]
mov DWORD [28+esp],ebp
mov ebp,DWORD [156+esp]
mov DWORD [40+esp],ecx
mov ecx,DWORD [152+esp]
mov DWORD [44+esp],esi
xor esi,esi
mov DWORD [52+esp],edx
mov DWORD [60+esp],edi
xor eax,eax
xor edx,edx
L$007tail_loop:
mov al,BYTE [ebp*1+esi]
mov dl,BYTE [esi*1+esp]
lea esi,[1+esi]
xor al,dl
mov BYTE [esi*1+ecx-1],al
dec ebx
jnz NEAR L$007tail_loop
L$006done:
add esp,132
L$000no_data:
pop edi
pop esi
pop ebx
pop ebp
ret
global _ChaCha20_ssse3
align 16
_ChaCha20_ssse3:
L$_ChaCha20_ssse3_begin:
push ebp
push ebx
push esi
push edi
L$ssse3_shortcut:
mov edi,DWORD [20+esp]
mov esi,DWORD [24+esp]
mov ecx,DWORD [28+esp]
mov edx,DWORD [32+esp]
mov ebx,DWORD [36+esp]
mov ebp,esp
sub esp,524
and esp,-64
mov DWORD [512+esp],ebp
lea eax,[(L$ssse3_data-L$pic_point)+eax]
movdqu xmm3,[ebx]
cmp ecx,256
jb NEAR L$0081x
mov DWORD [516+esp],edx
mov DWORD [520+esp],ebx
sub ecx,256
lea ebp,[384+esp]
movdqu xmm7,[edx]
pshufd xmm0,xmm3,0
pshufd xmm1,xmm3,85
pshufd xmm2,xmm3,170
pshufd xmm3,xmm3,255
paddd xmm0,[48+eax]
pshufd xmm4,xmm7,0
pshufd xmm5,xmm7,85
psubd xmm0,[64+eax]
pshufd xmm6,xmm7,170
pshufd xmm7,xmm7,255
movdqa [64+ebp],xmm0
movdqa [80+ebp],xmm1
movdqa [96+ebp],xmm2
movdqa [112+ebp],xmm3
movdqu xmm3,[16+edx]
movdqa [ebp-64],xmm4
movdqa [ebp-48],xmm5
movdqa [ebp-32],xmm6
movdqa [ebp-16],xmm7
movdqa xmm7,[32+eax]
lea ebx,[128+esp]
pshufd xmm0,xmm3,0
pshufd xmm1,xmm3,85
pshufd xmm2,xmm3,170
pshufd xmm3,xmm3,255
pshufd xmm4,xmm7,0
pshufd xmm5,xmm7,85
pshufd xmm6,xmm7,170
pshufd xmm7,xmm7,255
movdqa [ebp],xmm0
movdqa [16+ebp],xmm1
movdqa [32+ebp],xmm2
movdqa [48+ebp],xmm3
movdqa [ebp-128],xmm4
movdqa [ebp-112],xmm5
movdqa [ebp-96],xmm6
movdqa [ebp-80],xmm7
lea esi,[128+esi]
lea edi,[128+edi]
jmp NEAR L$009outer_loop
align 16
L$009outer_loop:
movdqa xmm1,[ebp-112]
movdqa xmm2,[ebp-96]
movdqa xmm3,[ebp-80]
movdqa xmm5,[ebp-48]
movdqa xmm6,[ebp-32]
movdqa xmm7,[ebp-16]
movdqa [ebx-112],xmm1
movdqa [ebx-96],xmm2
movdqa [ebx-80],xmm3
movdqa [ebx-48],xmm5
movdqa [ebx-32],xmm6
movdqa [ebx-16],xmm7
movdqa xmm2,[32+ebp]
movdqa xmm3,[48+ebp]
movdqa xmm4,[64+ebp]
movdqa xmm5,[80+ebp]
movdqa xmm6,[96+ebp]
movdqa xmm7,[112+ebp]
paddd xmm4,[64+eax]
movdqa [32+ebx],xmm2
movdqa [48+ebx],xmm3
movdqa [64+ebx],xmm4
movdqa [80+ebx],xmm5
movdqa [96+ebx],xmm6
movdqa [112+ebx],xmm7
movdqa [64+ebp],xmm4
movdqa xmm0,[ebp-128]
movdqa xmm6,xmm4
movdqa xmm3,[ebp-64]
movdqa xmm4,[ebp]
movdqa xmm5,[16+ebp]
mov edx,10
nop
align 16
L$010loop:
paddd xmm0,xmm3
movdqa xmm2,xmm3
pxor xmm6,xmm0
pshufb xmm6,[eax]
paddd xmm4,xmm6
pxor xmm2,xmm4
movdqa xmm3,[ebx-48]
movdqa xmm1,xmm2
pslld xmm2,12
psrld xmm1,20
por xmm2,xmm1
movdqa xmm1,[ebx-112]
paddd xmm0,xmm2
movdqa xmm7,[80+ebx]
pxor xmm6,xmm0
movdqa [ebx-128],xmm0
pshufb xmm6,[16+eax]
paddd xmm4,xmm6
movdqa [64+ebx],xmm6
pxor xmm2,xmm4
paddd xmm1,xmm3
movdqa xmm0,xmm2
pslld xmm2,7
psrld xmm0,25
pxor xmm7,xmm1
por xmm2,xmm0
movdqa [ebx],xmm4
pshufb xmm7,[eax]
movdqa [ebx-64],xmm2
paddd xmm5,xmm7
movdqa xmm4,[32+ebx]
pxor xmm3,xmm5
movdqa xmm2,[ebx-32]
movdqa xmm0,xmm3
pslld xmm3,12
psrld xmm0,20
por xmm3,xmm0
movdqa xmm0,[ebx-96]
paddd xmm1,xmm3
movdqa xmm6,[96+ebx]
pxor xmm7,xmm1
movdqa [ebx-112],xmm1
pshufb xmm7,[16+eax]
paddd xmm5,xmm7
movdqa [80+ebx],xmm7
pxor xmm3,xmm5
paddd xmm0,xmm2
movdqa xmm1,xmm3
pslld xmm3,7
psrld xmm1,25
pxor xmm6,xmm0
por xmm3,xmm1
movdqa [16+ebx],xmm5
pshufb xmm6,[eax]
movdqa [ebx-48],xmm3
paddd xmm4,xmm6
movdqa xmm5,[48+ebx]
pxor xmm2,xmm4
movdqa xmm3,[ebx-16]
movdqa xmm1,xmm2
pslld xmm2,12
psrld xmm1,20
por xmm2,xmm1
movdqa xmm1,[ebx-80]
paddd xmm0,xmm2
movdqa xmm7,[112+ebx]
pxor xmm6,xmm0
movdqa [ebx-96],xmm0
pshufb xmm6,[16+eax]
paddd xmm4,xmm6
movdqa [96+ebx],xmm6
pxor xmm2,xmm4
paddd xmm1,xmm3
movdqa xmm0,xmm2
pslld xmm2,7
psrld xmm0,25
pxor xmm7,xmm1
por xmm2,xmm0
pshufb xmm7,[eax]
movdqa [ebx-32],xmm2
paddd xmm5,xmm7
pxor xmm3,xmm5
movdqa xmm2,[ebx-48]
movdqa xmm0,xmm3
pslld xmm3,12
psrld xmm0,20
por xmm3,xmm0
movdqa xmm0,[ebx-128]
paddd xmm1,xmm3
pxor xmm7,xmm1
movdqa [ebx-80],xmm1
pshufb xmm7,[16+eax]
paddd xmm5,xmm7
movdqa xmm6,xmm7
pxor xmm3,xmm5
paddd xmm0,xmm2
movdqa xmm1,xmm3
pslld xmm3,7
psrld xmm1,25
pxor xmm6,xmm0
por xmm3,xmm1
pshufb xmm6,[eax]
movdqa [ebx-16],xmm3
paddd xmm4,xmm6
pxor xmm2,xmm4
movdqa xmm3,[ebx-32]
movdqa xmm1,xmm2
pslld xmm2,12
psrld xmm1,20
por xmm2,xmm1
movdqa xmm1,[ebx-112]
paddd xmm0,xmm2
movdqa xmm7,[64+ebx]
pxor xmm6,xmm0
movdqa [ebx-128],xmm0
pshufb xmm6,[16+eax]
paddd xmm4,xmm6
movdqa [112+ebx],xmm6
pxor xmm2,xmm4
paddd xmm1,xmm3
movdqa xmm0,xmm2
pslld xmm2,7
psrld xmm0,25
pxor xmm7,xmm1
por xmm2,xmm0
movdqa [32+ebx],xmm4
pshufb xmm7,[eax]
movdqa [ebx-48],xmm2
paddd xmm5,xmm7
movdqa xmm4,[ebx]
pxor xmm3,xmm5
movdqa xmm2,[ebx-16]
movdqa xmm0,xmm3
pslld xmm3,12
psrld xmm0,20
por xmm3,xmm0
movdqa xmm0,[ebx-96]
paddd xmm1,xmm3
movdqa xmm6,[80+ebx]
pxor xmm7,xmm1
movdqa [ebx-112],xmm1
pshufb xmm7,[16+eax]
paddd xmm5,xmm7
movdqa [64+ebx],xmm7
pxor xmm3,xmm5
paddd xmm0,xmm2
movdqa xmm1,xmm3
pslld xmm3,7
psrld xmm1,25
pxor xmm6,xmm0
por xmm3,xmm1
movdqa [48+ebx],xmm5
pshufb xmm6,[eax]
movdqa [ebx-32],xmm3
paddd xmm4,xmm6
movdqa xmm5,[16+ebx]
pxor xmm2,xmm4
movdqa xmm3,[ebx-64]
movdqa xmm1,xmm2
pslld xmm2,12
psrld xmm1,20
por xmm2,xmm1
movdqa xmm1,[ebx-80]
paddd xmm0,xmm2
movdqa xmm7,[96+ebx]
pxor xmm6,xmm0
movdqa [ebx-96],xmm0
pshufb xmm6,[16+eax]
paddd xmm4,xmm6
movdqa [80+ebx],xmm6
pxor xmm2,xmm4
paddd xmm1,xmm3
movdqa xmm0,xmm2
pslld xmm2,7
psrld xmm0,25
pxor xmm7,xmm1
por xmm2,xmm0
pshufb xmm7,[eax]
movdqa [ebx-16],xmm2
paddd xmm5,xmm7
pxor xmm3,xmm5
movdqa xmm0,xmm3
pslld xmm3,12
psrld xmm0,20
por xmm3,xmm0
movdqa xmm0,[ebx-128]
paddd xmm1,xmm3
movdqa xmm6,[64+ebx]
pxor xmm7,xmm1
movdqa [ebx-80],xmm1
pshufb xmm7,[16+eax]
paddd xmm5,xmm7
movdqa [96+ebx],xmm7
pxor xmm3,xmm5
movdqa xmm1,xmm3
pslld xmm3,7
psrld xmm1,25
por xmm3,xmm1
dec edx
jnz NEAR L$010loop
movdqa [ebx-64],xmm3
movdqa [ebx],xmm4
movdqa [16+ebx],xmm5
movdqa [64+ebx],xmm6
movdqa [96+ebx],xmm7
movdqa xmm1,[ebx-112]
movdqa xmm2,[ebx-96]
movdqa xmm3,[ebx-80]
paddd xmm0,[ebp-128]
paddd xmm1,[ebp-112]
paddd xmm2,[ebp-96]
paddd xmm3,[ebp-80]
movdqa xmm6,xmm0
punpckldq xmm0,xmm1
movdqa xmm7,xmm2
punpckldq xmm2,xmm3
punpckhdq xmm6,xmm1
punpckhdq xmm7,xmm3
movdqa xmm1,xmm0
punpcklqdq xmm0,xmm2
movdqa xmm3,xmm6
punpcklqdq xmm6,xmm7
punpckhqdq xmm1,xmm2
punpckhqdq xmm3,xmm7
movdqu xmm4,[esi-128]
movdqu xmm5,[esi-64]
movdqu xmm2,[esi]
movdqu xmm7,[64+esi]
lea esi,[16+esi]
pxor xmm4,xmm0
movdqa xmm0,[ebx-64]
pxor xmm5,xmm1
movdqa xmm1,[ebx-48]
pxor xmm6,xmm2
movdqa xmm2,[ebx-32]
pxor xmm7,xmm3
movdqa xmm3,[ebx-16]
movdqu [edi-128],xmm4
movdqu [edi-64],xmm5
movdqu [edi],xmm6
movdqu [64+edi],xmm7
lea edi,[16+edi]
paddd xmm0,[ebp-64]
paddd xmm1,[ebp-48]
paddd xmm2,[ebp-32]
paddd xmm3,[ebp-16]
movdqa xmm6,xmm0
punpckldq xmm0,xmm1
movdqa xmm7,xmm2
punpckldq xmm2,xmm3
punpckhdq xmm6,xmm1
punpckhdq xmm7,xmm3
movdqa xmm1,xmm0
punpcklqdq xmm0,xmm2
movdqa xmm3,xmm6
punpcklqdq xmm6,xmm7
punpckhqdq xmm1,xmm2
punpckhqdq xmm3,xmm7
movdqu xmm4,[esi-128]
movdqu xmm5,[esi-64]
movdqu xmm2,[esi]
movdqu xmm7,[64+esi]
lea esi,[16+esi]
pxor xmm4,xmm0
movdqa xmm0,[ebx]
pxor xmm5,xmm1
movdqa xmm1,[16+ebx]
pxor xmm6,xmm2
movdqa xmm2,[32+ebx]
pxor xmm7,xmm3
movdqa xmm3,[48+ebx]
movdqu [edi-128],xmm4
movdqu [edi-64],xmm5
movdqu [edi],xmm6
movdqu [64+edi],xmm7
lea edi,[16+edi]
paddd xmm0,[ebp]
paddd xmm1,[16+ebp]
paddd xmm2,[32+ebp]
paddd xmm3,[48+ebp]
movdqa xmm6,xmm0
punpckldq xmm0,xmm1
movdqa xmm7,xmm2
punpckldq xmm2,xmm3
punpckhdq xmm6,xmm1
punpckhdq xmm7,xmm3
movdqa xmm1,xmm0
punpcklqdq xmm0,xmm2
movdqa xmm3,xmm6
punpcklqdq xmm6,xmm7
punpckhqdq xmm1,xmm2
punpckhqdq xmm3,xmm7
movdqu xmm4,[esi-128]
movdqu xmm5,[esi-64]
movdqu xmm2,[esi]
movdqu xmm7,[64+esi]
lea esi,[16+esi]
pxor xmm4,xmm0
movdqa xmm0,[64+ebx]
pxor xmm5,xmm1
movdqa xmm1,[80+ebx]
pxor xmm6,xmm2
movdqa xmm2,[96+ebx]
pxor xmm7,xmm3
movdqa xmm3,[112+ebx]
movdqu [edi-128],xmm4
movdqu [edi-64],xmm5
movdqu [edi],xmm6
movdqu [64+edi],xmm7
lea edi,[16+edi]
paddd xmm0,[64+ebp]
paddd xmm1,[80+ebp]
paddd xmm2,[96+ebp]
paddd xmm3,[112+ebp]
movdqa xmm6,xmm0
punpckldq xmm0,xmm1
movdqa xmm7,xmm2
punpckldq xmm2,xmm3
punpckhdq xmm6,xmm1
punpckhdq xmm7,xmm3
movdqa xmm1,xmm0
punpcklqdq xmm0,xmm2
movdqa xmm3,xmm6
punpcklqdq xmm6,xmm7
punpckhqdq xmm1,xmm2
punpckhqdq xmm3,xmm7
movdqu xmm4,[esi-128]
movdqu xmm5,[esi-64]
movdqu xmm2,[esi]
movdqu xmm7,[64+esi]
lea esi,[208+esi]
pxor xmm4,xmm0
pxor xmm5,xmm1
pxor xmm6,xmm2
pxor xmm7,xmm3
movdqu [edi-128],xmm4
movdqu [edi-64],xmm5
movdqu [edi],xmm6
movdqu [64+edi],xmm7
lea edi,[208+edi]
sub ecx,256
jnc NEAR L$009outer_loop
add ecx,256
jz NEAR L$011done
mov ebx,DWORD [520+esp]
lea esi,[esi-128]
mov edx,DWORD [516+esp]
lea edi,[edi-128]
movd xmm2,DWORD [64+ebp]
movdqu xmm3,[ebx]
paddd xmm2,[96+eax]
pand xmm3,[112+eax]
por xmm3,xmm2
L$0081x:
movdqa xmm0,[32+eax]
movdqu xmm1,[edx]
movdqu xmm2,[16+edx]
movdqa xmm6,[eax]
movdqa xmm7,[16+eax]
mov DWORD [48+esp],ebp
movdqa [esp],xmm0
movdqa [16+esp],xmm1
movdqa [32+esp],xmm2
movdqa [48+esp],xmm3
mov edx,10
jmp NEAR L$012loop1x
align 16
L$013outer1x:
movdqa xmm3,[80+eax]
movdqa xmm0,[esp]
movdqa xmm1,[16+esp]
movdqa xmm2,[32+esp]
paddd xmm3,[48+esp]
mov edx,10
movdqa [48+esp],xmm3
jmp NEAR L$012loop1x
align 16
L$012loop1x:
paddd xmm0,xmm1
pxor xmm3,xmm0
db 102,15,56,0,222
paddd xmm2,xmm3
pxor xmm1,xmm2
movdqa xmm4,xmm1
psrld xmm1,20
pslld xmm4,12
por xmm1,xmm4
paddd xmm0,xmm1
pxor xmm3,xmm0
db 102,15,56,0,223
paddd xmm2,xmm3
pxor xmm1,xmm2
movdqa xmm4,xmm1
psrld xmm1,25
pslld xmm4,7
por xmm1,xmm4
pshufd xmm2,xmm2,78
pshufd xmm1,xmm1,57
pshufd xmm3,xmm3,147
nop
paddd xmm0,xmm1
pxor xmm3,xmm0
db 102,15,56,0,222
paddd xmm2,xmm3
pxor xmm1,xmm2
movdqa xmm4,xmm1
psrld xmm1,20
pslld xmm4,12
por xmm1,xmm4
paddd xmm0,xmm1
pxor xmm3,xmm0
db 102,15,56,0,223
paddd xmm2,xmm3
pxor xmm1,xmm2
movdqa xmm4,xmm1
psrld xmm1,25
pslld xmm4,7
por xmm1,xmm4
pshufd xmm2,xmm2,78
pshufd xmm1,xmm1,147
pshufd xmm3,xmm3,57
dec edx
jnz NEAR L$012loop1x
paddd xmm0,[esp]
paddd xmm1,[16+esp]
paddd xmm2,[32+esp]
paddd xmm3,[48+esp]
cmp ecx,64
jb NEAR L$014tail
movdqu xmm4,[esi]
movdqu xmm5,[16+esi]
pxor xmm0,xmm4
movdqu xmm4,[32+esi]
pxor xmm1,xmm5
movdqu xmm5,[48+esi]
pxor xmm2,xmm4
pxor xmm3,xmm5
lea esi,[64+esi]
movdqu [edi],xmm0
movdqu [16+edi],xmm1
movdqu [32+edi],xmm2
movdqu [48+edi],xmm3
lea edi,[64+edi]
sub ecx,64
jnz NEAR L$013outer1x
jmp NEAR L$011done
L$014tail:
movdqa [esp],xmm0
movdqa [16+esp],xmm1
movdqa [32+esp],xmm2
movdqa [48+esp],xmm3
xor eax,eax
xor edx,edx
xor ebp,ebp
L$015tail_loop:
mov al,BYTE [ebp*1+esp]
mov dl,BYTE [ebp*1+esi]
lea ebp,[1+ebp]
xor al,dl
mov BYTE [ebp*1+edi-1],al
dec ecx
jnz NEAR L$015tail_loop
L$011done:
mov esp,DWORD [512+esp]
pop edi
pop esi
pop ebx
pop ebp
ret
align 64
L$ssse3_data:
db 2,3,0,1,6,7,4,5,10,11,8,9,14,15,12,13
db 3,0,1,2,7,4,5,6,11,8,9,10,15,12,13,14
dd 1634760805,857760878,2036477234,1797285236
dd 0,1,2,3
dd 4,4,4,4
dd 1,0,0,0
dd 4,0,0,0
dd 0,-1,-1,-1
align 64
db 67,104,97,67,104,97,50,48,32,102,111,114,32,120,56,54
db 44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32
db 60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111
db 114,103,62,0
segment .bss
common _OPENSSL_ia32cap_P 16
| 19.340164 | 76 | 0.705075 |
b19aa490382c5bc3010d70e178e1d4eeffa04ae3 | 718 | asm | Assembly | oeis/045/A045348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/045/A045348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/045/A045348.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A045348: Primes congruent to {0, 1, 2, 4} mod 5.
; Submitted by Jon Maiga
; 2,5,7,11,17,19,29,31,37,41,47,59,61,67,71,79,89,97,101,107,109,127,131,137,139,149,151,157,167,179,181,191,197,199,211,227,229,239,241,251,257,269,271,277,281,307,311,317,331,337,347,349,359,367,379,389,397,401,409,419,421,431,439,449,457,461,467,479,487,491,499,509,521,541,547,557,569,571,577,587,599,601,607,617,619,631,641,647,659,661,677,691,701,709,719,727,739,751,757,761
mov $1,4
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,10
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
div $5,8
mov $6,$5
lpe
mov $0,$5
add $0,1
| 31.217391 | 380 | 0.660167 |
0c2ccd336dd7cfad12dcba425c01cad303be9575 | 676 | asm | Assembly | malban/Release/VRelease/Release.History/VRelease_2017_04_15/Song/track_02_10.asm | mikepea/vectrex-playground | 0de7d2d6db0914d915f4334402f747ab3bcdc7e6 | [
"0BSD"
] | 5 | 2018-01-14T10:03:50.000Z | 2020-01-17T13:53:49.000Z | malban/Release/VRelease/Release.History/VRelease_2017_04_23/Song/track_02_10.asm | mikepea/vectrex-playground | 0de7d2d6db0914d915f4334402f747ab3bcdc7e6 | [
"0BSD"
] | null | null | null | malban/Release/VRelease/Release.History/VRelease_2017_04_23/Song/track_02_10.asm | mikepea/vectrex-playground | 0de7d2d6db0914d915f4334402f747ab3bcdc7e6 | [
"0BSD"
] | null | null | null | dw $0080
track_02_10:
db $E3, $3C, $86, $F7, $B1, $C0, $D7, $76, $F7, $B1
db $AE, $EC, $00, $E7, $EF, $71, $9E, $37, $BD, $C0
db $C0, $E8, $72, $9E, $37, $BD, $C0, $C0, $EA, $73
db $9E, $37, $BD, $C0, $C0, $EC, $74, $9E, $37, $BD
db $C0, $C0, $EE, $75, $9E, $37, $BD, $C0, $C0, $E2
db $70, $9E, $37, $BD, $80, $EF, $3C, $6F, $7B, $1D
db $8E, $B7, $77, $4F, $7B, $99, $C2, $EE, $E5, $3C
db $6F, $7B, $1C, $4E, $17, $76, $F7, $B1, $AE, $EF
db $3E, $F7, $79, $E3, $7B, $DC, $0C, $0F, $47, $89
db $E3, $7B, $DC, $0C, $0F, $67, $99, $E3, $7B, $DC
db $0C, $0F, $67, $99, $E3, $7B, $DC, $0C, $0F, $67
db $99, $E3, $7B, $DC, $0C, $0E, $A7, $39, $E3, $7B
db $DC, $0C, $00 | 45.066667 | 52 | 0.427515 |
561611dd1d8e94be24bc943bd190e5fe111ba69d | 984 | asm | Assembly | programs/oeis/185/A185714.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/185/A185714.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/185/A185714.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A185714: a(n) = number of primes <= n that end in 7.
; 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
mov $6,$0
mov $8,$0
lpb $8,1
clr $0,6
mov $0,$6
sub $8,1
sub $0,$8
cal $0,185708 ; Characteristic function of positive numbers that are primes ending in 7.
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
add $0,6
add $3,1
add $0,$3
mov $1,$0
sub $1,8
add $7,$1
lpe
mov $1,$7
| 46.857143 | 595 | 0.58435 |
56408789cf60ac042d3d0e34db5551e5de76c5e3 | 449 | asm | Assembly | programs/oeis/337/A337909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/337/A337909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/337/A337909.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A337909: Distinct terms of A080079 in the order in which they appear.
; 1,2,4,3,8,7,6,5,16,15,14,13,12,11,10,9,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,128
mul $0,2
add $0,1
mov $2,$0
sub $2,2
mov $0,$2
mov $3,$2
add $2,1
mov $4,$3
mov $5,$0
mov $0,$2
mov $1,3
add $4,$5
lpb $0,1
div $0,2
mul $1,2
lpe
sub $1,$4
sub $1,6
div $1,4
add $1,1
| 18.708333 | 188 | 0.614699 |
fb11a401544a21da6be05574bad657e8a843aa02 | 4,150 | asm | Assembly | tp_01_15/include/debug_registers.asm | mjFer/TDIII-UTN-FRBA-TPS-2014 | 1b57b52fa8233c78297b0e5471d1c82e4c85451b | [
"MIT"
] | 2 | 2020-04-01T14:45:17.000Z | 2020-04-01T14:45:23.000Z | tp_01_15/include/debug_registers.asm | mjFer/TDIII-UTN-FRBA-TPS-2014 | 1b57b52fa8233c78297b0e5471d1c82e4c85451b | [
"MIT"
] | null | null | null | tp_01_15/include/debug_registers.asm | mjFer/TDIII-UTN-FRBA-TPS-2014 | 1b57b52fa8233c78297b0e5471d1c82e4c85451b | [
"MIT"
] | null | null | null |
%include "include/debug_registers.mac"
;***********************************DEBUG REGISTERS ***************************************
[BITS 64]
D0_ON_txt: db "BP0 - Activado", 00h
D0_OFF_txt: db "BP0 - Desact ", 00h
D1_ON_txt: db "BP1 - Activado", 00h
D1_OFF_txt: db "BP1 - Desact ", 00h
D2_ON_txt: db "BP2 - Activado", 00h
D2_OFF_txt: db "BP2 - Desact ", 00h
D3_ON_txt: db "BP3 - Activado", 00h
D3_OFF_txt: db "BP3 - Desact ", 00h
;-----------------------------------------------------------
; init DebugRegister
; Recibe: Nada
; Devuelve: Nada
;------------------------------------------------------------
Init_Debug_Registers:
push rax
xor rax,rax
mov rax, DEBUG_DR0
mov dr0, rax
mov rax, DEBUG_DR1
mov dr1, rax
mov rax, DEBUG_DR2
mov dr2, rax
mov rax, DEBUG_DR3
mov dr3, rax
xor rax,rax
or rax,D_LOCAL_EXACT_BP ;todavia no habilito en si los registros
or rax,D_GLOBAL_EXACT_BP
mov dr7, rax
pop rax
ret
toggle_F5_D0:
; xchg bx,bx
push rax
push rdi
push rsi
push rdx
push rcx
xor rax,rax
mov rax,dr7
xor rax,D_DB0_LOCAL
xor rax,D_DB0_GLOBAL
mov dr7,rax
and rax,D_DB0_LOCAL
cmp rax,D_DB0_LOCAL
je D0_Activo
mov rdi,D0_OFF_txt
mov rsi,4 ; esi (segundo argumento) char columna
mov rdx,24 ; edx (tercer argumento) char fila
mov rcx,111b ; ECX (cuarto arguemto) char color
call Print_64
jmp D0_T_ret
D0_Activo:
mov rdi,D0_ON_txt
mov rsi,4 ; esi (segundo argumento) char columna
mov rdx,24 ; edx (tercer argumento) char fila
mov rcx,110b ; ECX (cuarto arguemto) char color
call Print_64
D0_T_ret:
pop rcx
pop rdx
pop rsi
pop rdi
pop rax
ret
toggle_F6_D1:
push rax
xor rax,rax
mov rax,dr7
xor rax,D_DB1_LOCAL
xor rax,D_DB1_GLOBAL
mov dr7,rax
and rax,D_DB1_LOCAL
cmp rax,D_DB1_LOCAL
je D1_Activo
mov edi,D1_OFF_txt
mov esi,20 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,111b ; ECX (cuarto arguemto) char color
call Print_64
jmp D1_T_ret
D1_Activo:
mov edi,D1_ON_txt
mov esi,20 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,110b ; ECX (cuarto arguemto) char color
call Print_64
D1_T_ret:
pop rax
ret
toggle_F7_D2:
push rax
xor rax,rax
mov rax,dr7
xor rax,D_DB2_LOCAL
xor rax,D_DB2_GLOBAL
mov dr7,rax
and rax,D_DB2_LOCAL
cmp rax,D_DB2_LOCAL
je D2_Activo
mov edi,D2_OFF_txt
mov esi,40 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,111b ; ECX (cuarto arguemto) char color
call Print_64
jmp D2_T_ret
D2_Activo:
mov edi,D2_ON_txt
mov esi,40 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,110b ; ECX (cuarto arguemto) char color
call Print_64
D2_T_ret:
pop rax
ret
toggle_F8_D3:
push rax
xor rax,rax
mov rax,dr7
xor rax,D_DB3_LOCAL
xor rax,D_DB3_GLOBAL
mov dr7,rax
and rax,D_DB3_LOCAL
cmp rax,D_DB3_LOCAL
je D3_Activo
mov edi,D3_OFF_txt
mov esi,60 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,111b ; ECX (cuarto arguemto) char color
call Print_64
jmp D3_T_ret
D3_Activo:
mov edi,D3_ON_txt
mov esi,60 ; esi (segundo argumento) char columna
mov edx,24 ; edx (tercer argumento) char fila
mov ecx,110b ; ECX (cuarto arguemto) char color
call Print_64
D3_T_ret:
pop rax
ret
;-----------------------------------------------------------
; Handler de Debug
; Recibe: Nada
; Devuelve: Nada
;-----------------------------------------------------------
ex3_BPHandler:
push rax
push rbx
mov rbx,DR6
xor rax,rax
mov DR6,rax
xchg bx,bx
mov qword rax, [rsp + 0x20] ;modifico la info del eflags sin popear
or rax,EFLAGS_RF
mov qword[rsp +0x20],rax
pop rbx
pop rax
iretq
;*********************************************************************************************** | 21.282051 | 96 | 0.605542 |
60082d5aa7653223f0e235f7f21a110397482417 | 834 | asm | Assembly | programs/oeis/016/A016142.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/016/A016142.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/016/A016142.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A016142: Expansion of 1/((1-3x)(1-9x)).
; 1,12,117,1080,9801,88452,796797,7173360,64566801,581120892,5230147077,47071500840,423644039001,3812797945332,34315186290957,308836690967520,2779530261754401,25015772484929772,225141952751788437,2026277575928357400,18236498186842001001,164128483692038362212,1477156353259726319517,13294407179431680054480,119649664615167550026801,1076846981537355238850652,9691622833838739015484197,87224605504556276736842760,785021449541029367424039801,7065193045869332937193723092,63586737412824202325875602477,572280636715418438606276706240,5150525730438767800476679208001,46354731573948915763350679427532,417192584165540258547337814514357,3754733257489862376957585429628920,33792599317408761542712904163659401,304133393856678854334700043363931972
add $0,1
mov $1,3
pow $1,$0
bin $1,2
div $1,3
mov $0,$1
| 83.4 | 734 | 0.899281 |
2ad8383b74ec1abe7744862797d6fbda3bc8c548 | 494 | asm | Assembly | programs/oeis/014/A014068.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/014/A014068.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/014/A014068.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A014068: a(n) = binomial(n*(n+1)/2, n).
; 1,1,3,20,210,3003,54264,1184040,30260340,886163135,29248649430,1074082795968,43430966148115,1917283000904460,91748617512913200,4730523156632595024,261429178502421685800,15415916972482007401455,966121413245991846673830,64123483527473864490450300,4493328435856148676833725680,331488223958251318888250434410,25681474500876263139852989106900,2084633151901356196159615812153600,176926190348085904875214147177736550
sub $1,$0
bin $1,2
bin $1,$0
mov $0,$1
| 61.75 | 411 | 0.864372 |
45d3724f850d27572ad08f61ebfb70f1606171a2 | 252 | asm | Assembly | samples/div.asm | SohamMalakar/Intel-8085 | 85b759c6c9a85691146270be920350ff45c0ea48 | [
"MIT"
] | null | null | null | samples/div.asm | SohamMalakar/Intel-8085 | 85b759c6c9a85691146270be920350ff45c0ea48 | [
"MIT"
] | null | null | null | samples/div.asm | SohamMalakar/Intel-8085 | 85b759c6c9a85691146270be920350ff45c0ea48 | [
"MIT"
] | null | null | null | // Divide two numbers
LDA F100H // Divisor
MOV B, A
LDA F200H // Dividend
MVI C, 00H // Clear quotient
LOOP:
CMP B // Compare result
JC END
SUB B // Subtract divisor from dividend
INR C // Increment quotient
JMP LOOP
END: HLT
| 13.263158 | 43 | 0.646825 |
0cf00adadfa80ceda0b2d6f4160e5d5a68f5ddd9 | 354 | asm | Assembly | pwnlib/shellcraft/templates/i386/linux/ppoll.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 325 | 2016-01-25T08:38:06.000Z | 2022-03-30T14:31:50.000Z | pwnlib/shellcraft/templates/i386/linux/ppoll.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 8 | 2016-08-23T10:15:27.000Z | 2019-01-16T02:49:34.000Z | pwnlib/shellcraft/templates/i386/linux/ppoll.asm | IMULMUL/python3-pwntools | 61210a68cd88e9084c72292d3119c38c44f07966 | [
"MIT"
] | 71 | 2016-07-13T10:03:52.000Z | 2022-01-10T11:57:34.000Z | <%
from pwnlib.shellcraft.i386.linux import syscall
%>
<%page args="fds, nfds, timeout, ss"/>
<%docstring>
Invokes the syscall ppoll. See 'man 2 ppoll' for more information.
Arguments:
fds(pollfd): fds
nfds(nfds_t): nfds
timeout(timespec): timeout
ss(sigset_t): ss
</%docstring>
${syscall('SYS_ppoll', fds, nfds, timeout, ss)}
| 22.125 | 67 | 0.669492 |
892060f834172303f6c85a86000ea6ef6ff6ba40 | 713 | asm | Assembly | oeis/163/A163412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/163/A163412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/163/A163412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A163412: a(n) = 12*a(n-1) - 34*a(n-2) for n>1, a(0)=1, a(1)=10.
; Submitted by Jon Maiga
; 1,10,86,692,5380,41032,309464,2318480,17299984,128771488,957058400,7106470208,52737656896,391231895680,2901702413696,21518544511232,159564652069120,1183145311447552,8772545567020544,65043606215029760,482256725301658624,3575598092308891648,26510448447450306560,196555046230901362688,1457305307557505929216,10804792118839424819200,80109124969117896237056,593946567588874310991872,4403648562116483259842560,32649599447376072544387072,242071142256552439697997824,1794767325867842809866813440
mov $1,1
mov $3,2
lpb $0
sub $0,1
mov $2,$3
sub $2,$1
mul $2,2
mul $3,6
add $3,$1
mul $1,8
add $1,$2
lpe
mov $0,$1
| 39.611111 | 489 | 0.796634 |
c8f5ebfd2957df733498673e3537362ec6c62ee4 | 1,313 | asm | Assembly | arm9.asm | Prof9/MMZX-Slot2-Patch | 8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 | [
"Unlicense"
] | 10 | 2019-08-20T04:41:44.000Z | 2021-12-16T15:40:59.000Z | arm9.asm | Prof9/MMZX-Slot2-Patch | 8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 | [
"Unlicense"
] | null | null | null | arm9.asm | Prof9/MMZX-Slot2-Patch | 8161d431b83f96b87bb5c8a04bcc365be1d9e6e2 | [
"Unlicense"
] | 1 | 2021-07-03T19:17:48.000Z | 2021-07-03T19:17:48.000Z | // ARM9 binary
.nds
.thumb
.open "temp\arm9.dec",0x02000000
// Zero 3 always inserted
.org IsZero3Inserted
.area 0x38
mov r0,0x1
bx lr
.endarea
// Zero 4 always inserted
.org IsZero4Inserted
.area 0x38
mov r0,0x1
bx lr
.endarea
// Load data from GBA
.org LoadGbaFile
.area 0x528
push r4,lr
sub sp,(0xC+0x4C) // Header, FSFile
mov r4,r3
// Build filename
add r1,=fileName
add r0,0x31 // '1'
strb r0,[r1,0x2]
lsr r0,r2,0x4
cmp r0,0xA
blt @@num1
add r0,0x57 // 'a'-0xA
b @@set1
@@num1:
add r0,0x30 // '0'
@@set1:
strb r0,[r1,0x4]
lsl r0,r2,0x1C
lsr r0,r0,0x1C
cmp r0,0xA
blt @@num2
add r0,0x57 // 'a'-0xA
b @@set2
@@num2:
add r0,0x30 // '0'
@@set2:
strb r0,[r1,0x5]
// Initialize file
add r0,sp,0xC
blx FS_InitFile
// Open file with filename
add r0,sp,0xC
add r1,=fileName
blx FS_OpenFile
// Read header
add r0,sp,0xC
mov r1,sp
mov r2,0xC
blx FS_ReadFile
// Set destination offsets
ldr r1,[sp,(0x8+0xC+0x4C)]
str r4,[r1]
ldr r0,[sp]
add r0,r4,r0
str r0,[r1,0x4]
ldr r0,[sp,0x4]
add r0,r4,r0
str r0,[r1,0x8]
// Read file
add r0,sp,0xC
mov r1,r4
ldr r2,[sp,0x8]
blx FS_ReadFile
// Close file
add r0,sp,0xC
blx FS_CloseFile
// Return filesize
ldr r0,[sp,0x8]
add sp,(0xC+0x4C)
pop r4,pc
.pool
fileName:
.asciiz "w00_00.bin"
.endarea
.close
| 12.872549 | 36 | 0.654989 |
44178fe956b7a3e46b527e98479a3a35db4381d7 | 7,501 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_70.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_70.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_70.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x11e19, %r14
nop
nop
nop
sub $8169, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
movups %xmm0, (%r14)
nop
nop
sub $49217, %rax
lea addresses_WT_ht+0x10a71, %rsi
lea addresses_D_ht+0x6c71, %rdi
nop
nop
nop
nop
nop
and $46832, %rbp
mov $30, %rcx
rep movsl
nop
and $58729, %rdi
lea addresses_normal_ht+0x113f1, %rsi
nop
nop
nop
xor %r8, %r8
mov (%rsi), %edi
nop
nop
nop
and $14581, %rcx
lea addresses_normal_ht+0x7729, %rsi
lea addresses_D_ht+0x181a1, %rdi
nop
nop
dec %r9
mov $30, %rcx
rep movsb
nop
nop
nop
nop
sub $49454, %r14
lea addresses_A_ht+0x129f1, %rsi
lea addresses_normal_ht+0xb4f1, %rdi
nop
nop
nop
nop
dec %r8
mov $96, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x155b1, %r8
nop
nop
nop
nop
nop
cmp $51796, %rax
movl $0x61626364, (%r8)
xor %rax, %rax
lea addresses_WC_ht+0x1da91, %rcx
nop
nop
nop
nop
sub $27897, %rax
mov (%rcx), %r9d
nop
sub %rsi, %rsi
lea addresses_UC_ht+0xd671, %rsi
lea addresses_A_ht+0x19f1, %rdi
nop
add %rbp, %rbp
mov $103, %rcx
rep movsl
sub $41413, %rcx
lea addresses_A_ht+0x1ab81, %rbp
nop
nop
nop
nop
and $20551, %rdi
mov $0x6162636465666768, %r14
movq %r14, (%rbp)
nop
cmp $37690, %rdi
lea addresses_normal_ht+0xb9f1, %rsi
lea addresses_WT_ht+0xa151, %rdi
nop
nop
nop
nop
sub %r8, %r8
mov $87, %rcx
rep movsw
nop
nop
nop
add $41612, %r9
lea addresses_WT_ht+0x15a51, %r9
cmp %rbp, %rbp
movl $0x61626364, (%r9)
nop
cmp $21221, %rax
lea addresses_WT_ht+0x1e891, %r14
and %rcx, %rcx
movl $0x61626364, (%r14)
nop
xor $61526, %rax
lea addresses_UC_ht+0xf899, %r8
nop
nop
cmp %rbp, %rbp
mov (%r8), %ax
nop
nop
nop
nop
add $56435, %rbp
lea addresses_normal_ht+0x1e9f1, %rsi
lea addresses_D_ht+0x28f1, %rdi
xor $26869, %r14
mov $48, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %rax
push %rbx
// Faulty Load
lea addresses_WC+0x1b1f1, %r12
nop
nop
nop
and %r15, %r15
movb (%r12), %bl
lea oracles, %r12
and $0xff, %rbx
shlq $12, %rbx
mov (%r12,%rbx,1), %rbx
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'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.719048 | 2,999 | 0.659779 |
bc425aaa3616b036066b312f6478919a25fdead2 | 146 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/FZERO/FZERO/Game/en-check.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | 46 | 2020-08-02T08:00:14.000Z | 2022-03-07T02:25:47.000Z | other.7z/SFC.7z/SFC/ソースデータ/FZERO/FZERO/Game/en-check.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/FZERO/FZERO/Game/en-check.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | 12 | 2020-07-29T05:00:28.000Z | 2021-12-11T20:30:28.000Z | Name: en-check.asm
Type: file
Size: 15855
Last-Modified: '2000-11-08T02:03:12Z'
SHA-1: 302659F3795A4DCB730F9818531DA3F6F5201A96
Description: null
| 20.857143 | 47 | 0.808219 |
2750507644f9c79c37ad50999733a5e6d6f3aed2 | 7,933 | asm | Assembly | constants/pokemon_data_constants.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | constants/pokemon_data_constants.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | constants/pokemon_data_constants.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | ; base data struct members (see data/pokemon/base_stats/*.asm)
BASE_SPECIES EQUS "(wBaseSpecies - wCurBaseData)"
BASE_STATS EQUS "(wBaseStats - wCurBaseData)"
BASE_HP EQUS "(wBaseHP - wCurBaseData)"
BASE_ATK EQUS "(wBaseAttack - wCurBaseData)"
BASE_SPD EQUS "(wBaseSpeed - wCurBaseData)"
BASE_SAT EQUS "(wBaseSpecialAttack - wCurBaseData)"
BASE_SDF EQUS "(wBaseSpecialDefense - wCurBaseData)"
BASE_TYPES EQUS "(wBaseType - wCurBaseData)"
BASE_TYPE_1 EQUS "(wBaseType1 - wCurBaseData)"
BASE_TYPE_2 EQUS "(wBaseType2 - wCurBaseData)"
BASE_CATCH_RATE EQUS "(wBaseCatchRate - wCurBaseData)"
BASE_EXP EQUS "(wBaseExp - wCurBaseData)"
BASE_ITEMS EQUS "(wBaseItems - wCurBaseData)"
BASE_ITEM_1 EQUS "(wBaseItem1 - wCurBaseData)"
BASE_ITEM_2 EQUS "(wBaseItem2 - wCurBaseData)"
BASE_GENDER EQUS "(wBaseGender - wCurBaseData)"
BASE_EGG_STEPS EQUS "(wBaseEggSteps - wCurBaseData)"
BASE_PIC_SIZE EQUS "(wBasePicSize - wCurBaseData)"
BASE_PADDING EQUS "(wBasePadding - wCurBaseData)"
BASE_GROWTH_RATE EQUS "(wBaseGrowthRate - wCurBaseData)"
BASE_EGG_GROUPS EQUS "(wBaseEggGroups - wCurBaseData)"
BASE_HAPPINESS EQUS "(wBaseHappiness - wCurBaseData)"
BASE_TMHM EQUS "(wBaseTMHM - wCurBaseData)"
BASE_DATA_SIZE EQUS "(wCurBaseDataEnd - wCurBaseData)"
; gender ratio constants
GENDER_F0 EQU 0 percent
GENDER_F12_5 EQU 12 percent + 1
GENDER_F25 EQU 25 percent
GENDER_F50 EQU 50 percent
GENDER_F75 EQU 75 percent
GENDER_F100 EQU 100 percent - 1
GENDER_UNKNOWN EQU -1
; wBaseGrowthRate values
; GrowthRates indexes (see data/growth_rates.asm)
const_def
const GROWTH_MEDIUM_FAST
const GROWTH_SLIGHTLY_FAST
const GROWTH_SLIGHTLY_SLOW
const GROWTH_MEDIUM_SLOW
const GROWTH_FAST
const GROWTH_SLOW
const GROWTH_ERRATIC
const GROWTH_FLUCTUATING
; wBaseEggGroups values
const_def 1
const EGG_MONSTER ; 1
const EGG_WATER_1 ; 2 (Amphibian)
const EGG_BUG ; 3
const EGG_FLYING ; 4
const EGG_GROUND ; 5 (Field)
const EGG_FAIRY ; 6
const EGG_PLANT ; 7 (Grass)
const EGG_HUMANSHAPE ; 8 (Human-Like)
const EGG_WATER_3 ; 9 (Invertebrate)
const EGG_MINERAL ; a
const EGG_INDETERMINATE ; b (Amorphous)
const EGG_WATER_2 ; c (Fish)
const EGG_DITTO ; d
const EGG_DRAGON ; e
const EGG_NONE ; f (Undiscovered)
; party_struct members (see macros/wram.asm)
MON_SPECIES EQUS "(wPartyMon1Species - wPartyMon1)"
MON_ITEM EQUS "(wPartyMon1Item - wPartyMon1)"
MON_MOVES EQUS "(wPartyMon1Moves - wPartyMon1)"
MON_ID EQUS "(wPartyMon1ID - wPartyMon1)"
MON_EXP EQUS "(wPartyMon1Exp - wPartyMon1)"
MON_STAT_EXP EQUS "(wPartyMon1StatExp - wPartyMon1)"
MON_HP_EXP EQUS "(wPartyMon1HPExp - wPartyMon1)"
MON_ATK_EXP EQUS "(wPartyMon1AtkExp - wPartyMon1)"
MON_DEF_EXP EQUS "(wPartyMon1DefExp - wPartyMon1)"
MON_SPD_EXP EQUS "(wPartyMon1SpdExp - wPartyMon1)"
MON_SPC_EXP EQUS "(wPartyMon1SpcExp - wPartyMon1)"
MON_DVS EQUS "(wPartyMon1DVs - wPartyMon1)"
MON_PP EQUS "(wPartyMon1PP - wPartyMon1)"
MON_HAPPINESS EQUS "(wPartyMon1Happiness - wPartyMon1)"
MON_PKRUS EQUS "(wPartyMon1PokerusStatus - wPartyMon1)"
MON_CAUGHTDATA EQUS "(wPartyMon1CaughtData - wPartyMon1)"
MON_CAUGHTLEVEL EQUS "(wPartyMon1CaughtLevel - wPartyMon1)"
MON_CAUGHTTIME EQUS "(wPartyMon1CaughtTime - wPartyMon1)"
MON_CAUGHTGENDER EQUS "(wPartyMon1CaughtGender - wPartyMon1)"
MON_CAUGHTLOCATION EQUS "(wPartyMon1CaughtLocation - wPartyMon1)"
MON_LEVEL EQUS "(wPartyMon1Level - wPartyMon1)"
MON_STATUS EQUS "(wPartyMon1Status - wPartyMon1)"
MON_HP EQUS "(wPartyMon1HP - wPartyMon1)"
MON_MAXHP EQUS "(wPartyMon1MaxHP - wPartyMon1)"
MON_ATK EQUS "(wPartyMon1Attack - wPartyMon1)"
MON_DEF EQUS "(wPartyMon1Defense - wPartyMon1)"
MON_SPD EQUS "(wPartyMon1Speed - wPartyMon1)"
MON_SAT EQUS "(wPartyMon1SpclAtk - wPartyMon1)"
MON_SDF EQUS "(wPartyMon1SpclDef - wPartyMon1)"
BOXMON_STRUCT_LENGTH EQUS "(wPartyMon1End - wPartyMon1)"
PARTYMON_STRUCT_LENGTH EQUS "(wPartyMon1StatsEnd - wPartyMon1)"
NICKNAMED_MON_STRUCT_LENGTH EQUS "(PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH)"
REDMON_STRUCT_LENGTH EQU 44
; caught data
CAUGHT_TIME_MASK EQU %11000000
CAUGHT_LEVEL_MASK EQU %00111111
CAUGHT_GENDER_MASK EQU %10000000
CAUGHT_LOCATION_MASK EQU %01111111
CAUGHT_BY_UNKNOWN EQU 0
CAUGHT_BY_GIRL EQU 1
CAUGHT_BY_BOY EQU 2
CAUGHT_EGG_LEVEL EQU 1
; maximum number of party pokemon
PARTY_LENGTH EQU 6
; boxes
MONS_PER_BOX EQU 20
NUM_BOXES EQU 28
; hall of fame
HOF_MON_LENGTH EQU 2 + 2 + 2 + 1 + (MON_NAME_LENGTH + -1) ; species, id, dvs, level, nick
HOF_LENGTH EQU 1 + HOF_MON_LENGTH * PARTY_LENGTH + 2 ; win count, party, terminator
NUM_HOF_TEAMS EQU 30
; evolution types (used in data/pokemon/evos_attacks.asm)
const_def 1
const EVOLVE_ITEM
const EVOLVE_TRADE
const EVOLVE_HAPPINESS
const EVOLVE_STAT
const EVOLVE_ITEM_MALE
const EVOLVE_ITEM_FEMALE
EVOLVE_LEVEL_AND EQU $80
const_def EVOLVE_LEVEL_AND
const EVOLVE_LEVEL
const EVOLVE_LEVEL_WITH_MOVE
const EVOLVE_LEVEL_IN_LOCATION
const EVOLVE_LEVEL_WITH_ITEM
const EVOLVE_LEVEL_WITH_ITEM_DAY
const EVOLVE_LEVEL_WITH_ITEM_NIGHT
const EVOLVE_LEVEL_AND_MALE
const EVOLVE_LEVEL_AND_FEMALE
const EVOLVE_LEVEL_PARTY_MON
const EVOLVE_LEVEL_ADD_MON
const EVOLVE_LEVEL_EXTRA_MON
const EVOLVE_LEVEL_RAND_HIGH
const EVOLVE_LEVEL_RAND_LOW
; EVOLVE_HAPPINESS triggers
const_def 1
const TR_ANYTIME
const TR_MORNDAY
const TR_NITE
; EVOLVE_STAT triggers
const_def 1
const ATK_GT_DEF
const ATK_LT_DEF
const ATK_EQ_DEF
; EVOLVE_LEVEL_IN_LOCATION triggers
const_def
const MOSSY_ROCK
const ICY_ROCK
const MAGNETIC_FIELD
; wild data
NUM_GRASSMON EQU 12 ; data/wild/*_grass.asm table size
NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size
GRASS_WILDDATA_LENGTH EQU 2 + (1 + NUM_GRASSMON * 3) * 3
WATER_WILDDATA_LENGTH EQU 2 + (1 + NUM_WATERMON * 3) * 1
FISHGROUP_DATA_LENGTH EQU 1 + 2 * 3
NUM_ROAMMON_MAPS EQU 16 ; RoamMaps table size (see data/wild/roammon_maps.asm)
; treemon sets
; TreeMons indexes (see data/wild/treemons.asm)
const_def
const TREEMON_SET_CITY
const TREEMON_SET_CANYON
const TREEMON_SET_TOWN
const TREEMON_SET_ROUTE
const TREEMON_SET_KANTO
const TREEMON_SET_LAKE
const TREEMON_SET_FOREST
const TREEMON_SET_ROCK
NUM_TREEMON_SETS EQU const_value
; treemon scores
const_def
const TREEMON_SCORE_BAD ; 0
const TREEMON_SCORE_GOOD ; 1
const TREEMON_SCORE_RARE ; 2
; ChangeHappiness arguments (see data/happiness_changes.asm)
const_value = 1
const HAPPINESS_GAINLEVEL ; 01
const HAPPINESS_USEDITEM ; 02
const HAPPINESS_USEDXITEM ; 03
const HAPPINESS_GYMBATTLE ; 04
const HAPPINESS_LEARNMOVE ; 05
const HAPPINESS_FAINTED ; 06
const HAPPINESS_POISONFAINT ; 07
const HAPPINESS_BEATENBYSTRONGFOE ; 08
const HAPPINESS_OLDERCUT1 ; 09
const HAPPINESS_OLDERCUT2 ; 0a
const HAPPINESS_OLDERCUT3 ; 0b
const HAPPINESS_YOUNGCUT1 ; 0c
const HAPPINESS_YOUNGCUT2 ; 0d
const HAPPINESS_YOUNGCUT3 ; 0e
const HAPPINESS_BITTERPOWDER ; 0f
const HAPPINESS_ENERGYROOT ; 10
const HAPPINESS_REVIVALHERB ; 11
const HAPPINESS_GROOMING ; 12
const HAPPINESS_GAINLEVELATHOME ; 13
; significant happiness values
BASE_FRIENDSHIP EQU 70 ; BASE_HAPPINESS replaces this
FRIEND_BALL_HAPPINESS EQU 200
HAPPINESS_TO_EVOLVE EQU 220
HAPPINESS_THRESHOLD_1 EQU 100
HAPPINESS_THRESHOLD_2 EQU 200
; PP
PP_UP_MASK EQU %11000000
PP_UP_ONE EQU %01000000
PP_MASK EQU %00111111
| 33.901709 | 89 | 0.732132 |
b38571e25f88e994a53a3bab163c03e397e5a67a | 347 | asm | Assembly | src/z80asm/dev/z80asm_lib/sbc_hl_hl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | src/z80asm/dev/z80asm_lib/sbc_hl_hl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | src/z80asm/dev/z80asm_lib/sbc_hl_hl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; Substitute for the z80 sbc hl,hl instruction
; CPU Min T Max T
; 8080 38 47
; 8085 40 50
; gbz80 32 48
; r2ka 4 4
; z180 10 10
; z80 15 15
; z80n 15 15
SECTION code_l_sccz80
PUBLIC __z80asm__sbc_hl_hl
__z80asm__sbc_hl_hl:
ld hl, 0
ret nc
dec hl
ret
| 18.263158 | 46 | 0.530259 |
df4bc7a34b1b26bf94d49b88596c2c69be24ec2a | 7,199 | asm | Assembly | source/command/time.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/command/time.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | source/command/time.asm | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | ; ********************************************************************************************
; ********************************************************************************************
;
; Name : time.asm
; Purpose : ..
; Created : 15th Nov 1991
; Updated : 4th Jan 2021
; Authors : Fred Bowen
;
; ********************************************************************************************
; ********************************************************************************************
; TI$="hh:mm:ss.t" Allows optional colons to delimit parameters and
; allows input to be abbrieviated (eg., TI$="h:mm" or
; even TI$=""), defaulting to "00" for unspecified
; parameters. 24-hour clock (00:00:00.0 to 23:59:59.9).
; 901010 F.Bowen
Set_TI_String
jsr frefac ; we won't need it
sta count ; save length
ldy #0 ; our pointer into TI$ assignment
sty time ; default time to zero, in case it's not fully specified
sty time+1
sty time+2
sty time+3
ldx #3 ; parameter pointer (3=hr,2=min,1=sec,0=tenths)
l131_1 jsr GetTimeDigit ; get first digit, convert to BCD
bcs l131_2 ; colon or eos
sta time,x
jsr GetTimeDigit ; get second digit, convert to BCD
bcs l131_2 ; colon or eos
asl time,x ; move first digit to msd
asl time,x
asl time,x
asl time,x
ora time,x ; combine with second digit
sta time,x ; now we have a time element of packed BCD
l131_2 lda time,x
cmp MaxTimeValues,x ; check for parameter too big
+lbcs fcerr ; hr>23, min>59, sec>59, tenths>9
dex ; check if done
bmi l131_4 ; yes- all parameters accounted for
cpy count
bcs l131_5 ; yes- end of string
jsr indin1_ram1 ; check for optional colon (or period) [910103]
cmp #':'
beq l131_3
cmp #'.'
bne l131_1 ; not there
l131_3 iny ; it's there- skip over it
bra l131_1 ; loop until done
l131_4 cpy count ; done
+lbcc errlen ; error if string too long
l131_5 ldz time ; tenths 0-9
lda time+1 ; seconds 0-59
ldx time+2 ; minutes 0-59
ldy time+3 ; hours 0-23
jmp _SetTime ; Go set time & exit
; Get an ASCII digit, make sure it's in range 0-9 or a colon.
; if no digit to get, default to '0'
;
; exit with .c=0 if okay (.A contains BCD)
; .c=1 if colon or eos (.A invalid)
GetTimeDigit
lda #0 ; default to '0'
cpy count
bcs l132_1 ; exit if at end of string (carry set)
jsr indin1_ram1 ; else get a character from string
iny ; point to next character
cmp #'.' ; [910103]
beq l132_1 ; terminator (period) (carry set)
cmp #'0' ; check character, only 0-9 allowed
+lbcc fcerr ; too small
cmp #':'
bcc l132_1 ; just right (carry clear)
+lbne fcerr ; too big
; falls through if colon (carry set)
l132_1 and #$0f ; make BCD
rts
MaxTimeValues
!text $10,$60,$60,$24 ; t,s,m,h in packed BCD
; x$=TI$ Return a string of the form "hh:mm:ss.t", including colons.
Get_TI_String
jsr ReadSystemClock ; get time as packed BCD
lda #10 ; get string space for 10 characters
jsr strspa
tay ; length
dey ; index
lda time ; build TI$ string in 'fbuffr'
ora #'0' ; (build string backwards, from last chr to first)
ldx #dsctmp+1
jsr sta_far_ram1 ; put tenths (special case- only 1 digit)
dey
lda #'.'
jsr sta_far_ram1 ; put period (special case) [910103]
dey
ldx #1
bra l133_2
l133_1 phx ; element pointer (1=secs, 2=mins, 3=hrs)
ldx #dsctmp+1
lda #':'
jsr sta_far_ram1 ; put colon
dey
plx
l133_2 lda time,x
taz
and #$0f ; do lsd first, since we're working backwards
ora #'0'
phx
ldx #dsctmp+1
jsr sta_far_ram1 ; put lsd
dey
tza ; then do msd
lsr
lsr
lsr
lsr
ora #'0'
jsr sta_far_ram1 ; put msd
plx
inx ; next packed element
dey
bpl l133_1 ; loop until done
lda #10 ; length
jsr mvdone ; update frespc ????
+lbra putnew ; make descriptor in dsctmp real
; ********************************************************************************************
;
; Date Changes
; ==== =======
;
; ********************************************************************************************
| 43.630303 | 112 | 0.319489 |
2e2a70ec2413d3e99c06e62afea9837250ad136f | 73,350 | asm | Assembly | Library/Kernel/LMem/lmemChunkArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/LMem/lmemChunkArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/LMem/lmemChunkArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Kernel/LMem
FILE: lmChunkArray.asm
AUTHOR: Doug Fults
GLOBAL ROUTINES:
Name Description
---- -----------
LOCAL ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 3/90 Moved here from Write
IMPLEMENTATION:
DESCRIPTION:
This file contains the front-end routines for calling the ChunkArray
routines in KLib.
$Id: lmemChunkArray.asm,v 1.1 97/04/05 01:14:20 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
kcode segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayElementToPtr
DESCRIPTION: Return a pointer to a given element
CALLED BY: GLOBAL
PASS:
*ds:si - array
ax - element number to find
RETURN:
carry - set if element number out of bounds (ds:di will be the last
element in the array)
cx - element size (if variable sized elements)
ds:di - element
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
EC version fatal-errors if an element number of
CA_NULL_ELEMENT (0xffff) is passed in ax.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
------------------------------------------------------------------------------@
ChunkArrayElementToPtr proc far uses ax, dx
.enter
EC < call ECCheckChunkArray >
EC < cmp ax, CA_NULL_ELEMENT >
EC < ERROR_Z NULL_ELEMENT_PASSED_TO_CHUNK_ARRAY_ROUTINE >
; make sure that element number is in range
mov di, ds:[si] ;ds:di = array
mov dx, ds:[di].CAH_elementSize
cmp ax, ds:[di].CAH_count
cmc
jae common ;really a "jb", but inverted so that
;we branch with the carry set
; carry is clear
mov ax, ds:[di].CAH_count
dec ax
stc
jns common ;=> elements in the array, so ok
; element size is 0, return CAH_offset (done specially so that it
; works for variable sized elements)
add di, ds:[di].CAH_offset ;ds:di = first element
tst dx
jnz emptyDone
clr cx
emptyDone:
stc
jmp done
common:
pushf
tst dx
jz var
mul dx
add di, ds:[di].CAH_offset ;ds:di = first element
add di, ax
donePop:
popf
done:
EC < call ECCheckChunkArray >
.leave
ret
; variable sized elements
var:
push bx
mov bx, ax
shl bx
add bx, ds:[di].CAH_offset ;ds:bx = offset to element
add bx, di
inc ax
cmp ax, ds:[di].CAH_count
jz lastElement
mov cx, ds:[bx][2] ;cx = offset of next element
jmp varCommon
; last element - use size of chunk as offset to next
lastElement:
ChunkSizePtr ds, di, cx
varCommon:
sub cx, ds:[bx] ;cx = size
add di, ds:[bx]
pop bx
jmp donePop
ChunkArrayElementToPtr endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayGetCount
DESCRIPTION: Get the number of elements in an array
CALLED BY: GLOBAL
PASS:
*ds:si - array
RETURN:
cx - number of elements
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
Doug 3/90 Converted for KLib use
------------------------------------------------------------------------------@
ChunkArrayGetCount proc far uses si
.enter
EC < call ECCheckChunkArray >
mov si, ds:[si]
mov cx, ds:[si].CAH_count
.leave
ret
ChunkArrayGetCount endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayEnumRange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate elements in a chunk-array, starting with a
given element.
CALLED BY: Global
PASS: *ds:si = Chunk array
bx:di = fptr to Callback routine
See ChunkArrayEnumCommon for details.
Can be vfptr for XIP'ed geode.
ax = Element to start calling back for
cx = Number of elements to process (-1 for all)
dx, bp, es = Data to pass to callback
RETURN: ax, cx, dx, bp, es = Set by callback
carry set if callback aborted
DESTROYED: bx
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/ 1/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayEnumRange proc far
pushdw bxdi ; Pass callback on stack
push ax ; Pass starting element on stack
push cx
call ChunkArrayEnumCommon
ret
ChunkArrayEnumRange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayEnum
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate all elements in a chunk-array.
CALLED BY: Global
PASS: *ds:si = Chunk array
bx:di = fptr to Callback routine
See ChunkArrayEnumCommon for details
Can be vfptr for XIP'ed geodes
fixed size elements:
ax, cx, dx, bp, es = Data to pass to callback
variable sized elements:
cx, dx, bp, es = Data to pass to callback
RETURN: ax, cx, dx, bp, es = Set by callback
carry set if callback aborted
DESTROYED: bx
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/ 1/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayEnum proc far
pushdw bxdi ; Pass callback on stack
clr bx ; Start at the first element
push bx ; Pass starting element on stack
dec bx
push bx ; Process all elements
call ChunkArrayEnumCommon
ret
ChunkArrayEnum endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayEnumCommon
DESCRIPTION: Enumerate all elements in a general array
CALLED BY: GLOBAL
PASS:
*ds:si - array
On stack:
Pushed 1st: Callback routine dword
Starting element word
Number of elements to do word
ax, cx, dx, bp, es - data to pass to callback
RETURN:
ax, cx, dx, bp, es - modified by callbacks
carry - set if the callback returned the carry set
DESTROYED:
bx
** WARNING
If you are resizing elements larger as part of your callback
then chunks on the lmem heap may move. This means that all
direct pointers into the lmem heap are not valid after a call
to this routine.
In addition to this, if you are resizing an element larger
then the lmem-heap itself may move on the global heap. This
means that any segment registers or stored segments which
refer to the heap are not valid after a call to this routine.
If you are resizing the element smaller then all pointers
and segments are still valid after the call.
Callback:
Pass:
*ds:si - array
ds:di - array element being enumerated
fixed size elements:
ax, cx, dx, bp, es - data passed to GArrayEnum
variable sized elements:
ax - element size
cx, dx, bp, es - data passed to GArrayEnum
Return:
carry - set to end enumeration
ax, cx, dx, bp, es - data to pass to next
Destroyed:
bx, si, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
The way ChunkArrayEnum() handles nested calls, inserting or
deleting is by saving a linked list of stack frames that
show where each call is in the enumeration. Insert and delete
operations walk down this list to fix things up if necessary.
Previously, this linked list was done as a local variable.
This runs into problems with ThreadBorrowStackSpace(), as
any given item of the list may have be in a borrowed block.
This can happen if a callback function does borrows space or
calls something that does.
The way it is handled now is by using the bottom of the stack
in a way similar to how ResourceCallInt() uses it as a secondary
stack that isn't part of the stack that is borrowed or otherwise
mutilated by normal operations. -- eca 11/16/92
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
The following operations can be used in the callback routine to
modify the array while enumerating (but see below for warning):
ChunkArrayInsertAt (also covers ChunkArrayAppend)
ChunkArrayDelete
ChunkArrayEnum (nested)
ChunkArrayEnum will ensure that no item in the array is missed
and that no item in the array will be enumerated more than once
because of these operations.
* If you insert an item before the current element,
it WILL NOT be enumerated.
* If you insert an item at or after the current element,
it WILL be enumerated.
* If you append an item (ie. an insert after the last
element), it WILL be enumerated.
* If you remove the current element and put a new element in
its place, the new element WILL be enumerated (this is a delete
followed by an insert at the current element).
WARNING: Simultaneous calls to ChunkArrayInsert, ChunkArrayDelete,
or ChunkArrayEnum on multiple threads are not allowed, because
of this shared data structure. Even if both ChunkArrayEnum's
are non-destructive, they will still both try to manipulate
this ChunkArrayEnum nested call chain.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
Doug 3/90 Converted for KLib use
------------------------------------------------------------------------------@
ChunkArrayEnumCommon proc near \
elementCount:word,
startElement:word,
callback:dword
uses di
;
; NOTE: passedBP is the real passed bp -- not a separate copy.
; Normally this would be a bad thing, except in this
; case, we want to return the modified bp from whatever
; the callback did to it.
;
passedBP local word push bp
curSavedOffset local nptr.SaveCurOffsetStruct ;offset of saved struct
.enter
EC < call ECCheckChunkArray >
EC < push ds, si >
if FULL_EXECUTE_IN_PLACE
EC < ; Since ECCheckBounds blows up when passed a vseg and >
EC < ; "ec segment" is on, we have to check vseg separately. >
EC < movdw bxsi, ss:[callback] >
EC < cmp bh, high MAX_SEGMENT >
EC < jae checkVfptr ; jump if bx is vseg >
EC < mov ds, bx ; ds:si = fptr >
EC < call ECCheckBounds ; check fptr >
EC < jmp EC_done >
EC <checkVfptr: >
EC < call ECAssertValidFarPointerXIP ; check vfptr >
EC <EC_done: >
else
EC < lds si, callback >
EC < call ECCheckBounds >
endif
EC < pop ds, si >
; Make sure the start element is LESS THAN the array count.
; Also, prevent enumeration of an empty array.
mov bx, ds:[si]
push bx
mov bx, ds:[bx].CAH_count
cmp startElement, bx
pop bx
jb ok
jmp done ; carry is clear
ok:
; ds:bx - array header
;
; Initialize things for saving the chain of SaveCurOffsetStruct
; elements on the bottom of the stack.
;
mov di, ss:[TPD_stackBot] ;di <- current stack bottom
add ss:[TPD_stackBot], (size SaveCurOffsetStruct)
mov ss:curSavedOffset, di
;
; SCOS_curOffset holds different values depending on what sort
; of chunk-array we are processing.
;
; For fixed-size element arrays, SCOS_curOffset holds the offset to
; the current element. It is adjusted at the bottom of the loop by
; adding in the element size.
;
; For variable-sized element arrays, SCOS_curOffset holds the offset
; into the "size list" and is used to grab the size of the current
; element.
;
; We initialize the value differently depending on the type.
;
tst ds:[bx].CAH_elementSize ;variable or fixed?
jz variableSized
;
; It's fixed size. We need to compute the offset to the current element
;
;
push ax, cx ; Save passed values
mov ax, startElement ; ax <- first element
call ChunkArrayElementToPtr ; ds:di <- ptr to 1st element
; cx <- size
sub di, bx ; di <- offset to element
mov bx, ss:curSavedOffset ; ss:bx <- saved frame
mov ss:[bx].SCOS_curOffset, di
pop ax, cx ; Restore passed values
jmp enumLoop
variableSized:
;
; For variable sized elements we want SCOS_curOffset to hold the
; offset to the size for the current element.
;
push ax
mov ax, startElement ; ax <- start element
shl ax, 1 ; ax <- offset in table
add ax, ds:[bx].CAH_offset ; ax <- offset to entry
mov bx, ss:curSavedOffset ; ss:bx <- saved frame
mov ss:[bx].SCOS_curOffset, ax
pop ax
enumLoop:
;
; loop: *ds:si = array,
; savedOffsetInfo.SCOS_curOffset = offset into array
;
tst elementCount ; Clears the carry
LONG jz donePop ; Branch if no more
;
; before calling the callback routine, add our GAE_curOffset to
; the front of the CAH_curOffset linked list, in case ChunkArray
; operations are done by the callback routine
;
push ax, si
EC < call ECCheckCurOffsetChain >
mov si, ds:[si]
mov ax, ds:[si].CAH_curOffset ; ax = head of list
mov bx, ss:curSavedOffset
EC < push ss:[TPD_threadHandle] >
EC < pop ss:[bx].SCOS_thread >
mov ss:[bx].SCOS_next, ax ; attach at end
mov ds:[si].CAH_curOffset, bx ; make us the list head
pop ax, si
mov di, ds:[si] ; ds:di = array
mov bx, ss:curSavedOffset ; ss:bx <- saved frame
cmp ds:[di].CAH_elementSize, 0
jnz notVarSized
mov bx, ss:[bx].SCOS_curOffset ; bx <- current offset
call GetVarElementSize ;ds:bx = offset to element
add di, ds:[bx]
jmp enumCommon
notVarSized:
add di, ss:[bx].SCOS_curOffset ; di = element
enumCommon:
push si, bp
;-----------------------------------
EC < ; >
EC < ; if LMF_IS_VM is set we do not want to check the handle, as the>
EC < ; block could be unlocked during the callback, discarded and >
EC < ; locked again before the callback returns, in which case the >
EC < ; handle likely will have changed, but DS will be correct >
EC < ; >
EC < clr bx >
EC < test ds:[LMBH_flags], mask LMF_IS_VM >
EC < jnz haveTestValue >
EC < mov bx, ds:[LMBH_handle] >
EC < haveTestValue: >
EC < push bx >
lea bx, callback ; ss:bx <- callback
mov bp, passedBP ; bp <- bp to pass
FXIP < cmp ss:[bx].segment.high, high MAX_SEGMENT >
FXIP < ja callMovable >
caeCallCallback::
call {dword} ss:[bx] ; call routine
afterCall::
mov bx, bp ; bx <- returned bp
EC < pop bp >
EC < pushf >
EC < ; >
EC < ; if bp is 0, make sure LMF_IS_VM is still set >
EC < ; otherwise check that the handle is the same >
EC < ; >
EC < tst bp >
EC < jz checkFlags >
EC < >
EC < cmp bp, ds:[LMBH_handle] >
EC < je noHandleError >
EC < ERROR CHUNK_ARRAY_ENUM_CALLBACK_TRASHED_DS >
EC < >
EC < checkFlags: >
EC < test ds:[LMBH_flags], mask LMF_IS_VM >
EC < ERROR_Z CHUNK_ARRAY_ENUM_CALLBACK_TRASHED_DS >
EC < >
EC < noHandleError: >
EC < popf >
;-----------------------------------
pop si, bp
mov passedBP, bx ; Save returned value
;
; after calling the callback routine, remove our GAE_curOffset from
; the front of the CAH_curOffset linked list
;
push ax, si
mov bx, ss:curSavedOffset
mov ax, ss:[bx].SCOS_next ; ax = previous head
EC < call ECCheckCurOffsetChain >
mov si, ds:[si]
mov ds:[si].CAH_curOffset, ax ; restore prev. head
pop ax, si
jc donePop ; if carry returned set, then
; done
push ax, cx
mov di, ds:[si] ; ds:di = array
ChunkSizePtr ds, di, cx ; cx = end offset
mov ax, ds:[di].CAH_elementSize
tst ax
jnz notZero
mov cx, ds:[di].CAH_count
shl cx
add cx, ds:[di].CAH_offset ;cx = end offset
mov ax, 2
notZero:
; (if we deleted first item in callback routine,
; this may go from negative to positive here)
dec elementCount
mov bx, ss:curSavedOffset
add ss:[bx].SCOS_curOffset, ax
cmp cx, ss:[bx].SCOS_curOffset
pop ax, cx
LONG ja enumLoop
EC < call ECCheckChunkArray >
clc
;
; Clean up our private stack allocation
;
donePop:
pushf
sub ss:TPD_stackBot, (size SaveCurOffsetStruct)
popf
done:
EC < call ECCheckChunkArray >
.leave
ret @ArgSize
if FULL_EXECUTE_IN_PLACE
callMovable:
pushdw ss:[bx]
call PROCCALLFIXEDORMOVABLE_PASCAL
jmp afterCall
endif
ChunkArrayEnumCommon endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GetVarElementSize
DESCRIPTION: Get the size of a variable sized element
CALLED BY: GLOBAL
PASS:
ds:di - array
ds:bx - element (offset from start of chunk)
(This is actually the offset from the start of the
chunk into the array of offsets to the elements, NOT
an offset to the element itself)
RETURN:
ds:bx - element (offset in block)
ax - element size
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 7/17/91 Initial version
------------------------------------------------------------------------------@
GetVarElementSize proc near uses cx
.enter
mov cx, ds:[di].CAH_count
dec cx
shl cx
add cx, ds:[di].CAH_offset
cmp bx, cx
jnz notLastElement
ChunkSizePtr ds, di, ax ;ax = chunk size
add bx, di
jmp varCommon
notLastElement:
add bx, di
mov ax, ds:[bx][2]
varCommon:
sub ax, ds:[bx]
.leave
ret
GetVarElementSize endp
kcode ends
;-------------------------------------------------------------------------
ChunkCommon segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayAppend
DESCRIPTION: Append an element to an array
CALLED BY: GLOBAL
PASS:
*ds:si - array
ax - element size (if variable)
RETURN:
carry set if LMF_RETURN_ERRORS & couldn't append
di - destroyed
carry clear if appended:
ds:di - new element, all zeroed (block possibly moved)
DESTROYED:
none
WARNING: This routine MAY resize the LMem block, moving it on the
heap and invalidating stored segment pointers and current
register or stored offsets to it.
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
Doug 3/90 Converted for KLib use
------------------------------------------------------------------------------@
ChunkArrayAppend proc far
; calculate position to add
push ax
mov di, ds:[si]
ChunkSizePtr ds, di, ax ;position to insert
add di, ax
pop ax
FALL_THRU ChunkArrayInsertAt
ChunkArrayAppend endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayInsertAt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Insert an element at a position in the array.
CALLED BY:
PASS: *ds:si = array.
ds:di = element to insert before.
ax = element size to insert (if variable)
RETURN: carry set if LMF_RETURN_ERRORS and couldn't insert:
di = destroyed
carry clear if element inserted:
ds:di = points to new element, all zeroed (block
may move).
DESTROYED: nothing
WARNING: This routine MAY resize the LMem block, moving it on the
heap and invalidating stored segment pointers and current
register or stored offsets to it.
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 9/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayInsertAt proc far uses ax, bx, cx, dx, bp
.enter
InsertGenericProfileEntry PET_LMEM, 1, PMF_LMEM, ax ;
EC < call ECCheckChunkArray >
mov bx, di
mov di, ds:[si]
sub bx, di ;bx = offset to add at
mov bp, bx ;bp = offset for enum check
mov cx, ds:[di].CAH_elementSize ;# bytes to insert
mov dx, cx ;dx = # bytes to adjust by
tst cx
jnz notVariableSized
; variable sized element -- insert an offset word
push bx ;save element offset
push ax, di
add di, bx ;ds:di = element
call ChunkArrayPtrToElement ;ax = element number
mov_trash bx, ax ;bx = element number
pop ax, di
shl bx
add bx, ds:[di].CAH_offset ;bx = offset to add word
mov cx, 2
xchg ax, si ;ax = chunk, si = element size
call LMemInsertAt
xchg ax, si ;ax = element size, si = chunk
pop bp ;bp = offset for new element
jc done
inc bp
inc bp ;adjust for word added
mov di, ds:[si]
add bx, di ;ds:bx = new word
mov ds:[bx], bp ;save offset to new element
; ds:di - array
; bx - offset of element being worked on
; dx - amount to update all offsets by
; ax - amount to update offsets after bx by
inc ds:[di].CAH_count ;so that UpdateVarOffsets sees
;the correct number of elements
mov dx, 2
call UpdateVarOffsets
mov_trash cx, ax ;cx = size
xchg bx, bp ;bx = offset to insert element
sub bp, di ;bp = offset for Enum check
jmp common
notVariableSized:
inc ds:[di].CAH_count
common:
; *ds:si = ds:di = array, bx = offset to insert at
; cx = # bytes to insert, bp = offset for ChunkEnumArray check (offset
; in *chunk* where element will be inserted or where variable offset
; was inserted)
; dx = # bytes to adjust Enum data by (enum data tracks the variable
; offset or the actual element offset, so this is either 2 or the
; size of an element)
; If we are inserting from a ChunkArrayEnum callback routine, we want
; to adjust the CAH_curOffset list so that we don't process an element
; twice. We need to do this if the insertion point is at or before the
; current position. This means that adding an item at the position
; currently being processed will result in the new item not being
; processed. To have a new item processed, it must be added after the
; current item. If we are not in a ChunkArrayEnum, this does nothing
; as CAH_curOffset will be empty.
;
EC < call ECCheckCurOffsetChain >
mov di, ds:[di].CAH_curOffset ; ss:di = first SaveCurOffset
xchg di, bp ; ss:bp = first SaveCurOffset
; di = offset to check
adjustLoop:
tst bp
jz finishAdjustment ; none to do
cmp di, ss:[bp].SCOS_curOffset ; need adjustment?
ja noAdjustment ; nope
add ss:[bp].SCOS_curOffset, dx ; update curOffset
noAdjustment:
mov bp, ss:[bp].SCOS_next ; bp = next curOffset
jmp adjustLoop
finishAdjustment:
; note that we don't need to update the CAH_curOffset list as we are
; adding an element at the end and the new item is guaranteed to be
; enum'ed
; insert the bytes (and zero them)
mov ax, si
call LMemInsertAt
jc removeVarOff
; return the offset
mov di, ds:[si]
add di, bx ; (can't carry)
done:
EC < call ECCheckChunkArray >
InsertGenericProfileEntry PET_LMEM, 0, PMF_LMEM, ax ;
.leave
ret
removeVarOff:
;
; Failed to insert the bytes for the element itself, so we need to
; (a) undo the insertion of the offset, (b) remove the variable offset
; we added for the element, (c) undo the adjustment of the Enum
; things, and (d) reduce the element count by one.
;
; *ds:si = array
; di = offset for enum check (also offset of inserted var off, if v.
; size)
; dx = adjustment size for enum
; cx = element size
;
mov bx, ds:[si]
tst ds:[bx].CAH_elementSize
jnz reduceEltCount ; => not v. sized, so no
; adjustment needed
mov bx, di
add bx, ds:[si] ; ds:bx <- var offset for aborted
; element
mov dx, -2 ; reduce all var offsets by 2, for
; the size word we're going to biff
mov ax, cx
neg ax ; ax <- negative of element size for
; subtraction from all var offsets
; after ds:bx
call UpdateVarOffsets
sub bx, ds:[si] ; bx <- offset for word deletion
mov ax, si ; ax <- chunk
mov cx, 2 ; cx <- # bytes to delete
call LMemDeleteAt
neg dx ; dx <- enum adjustment (1 word)
reduceEltCount:
mov bx, ds:[si]
dec ds:[bx].CAH_count
EC < call ECCheckCurOffsetChain >
mov bp, ds:[bx].CAH_curOffset ; ss:bp = first SaveCurOffset
readjustLoop:
tst bp
jz finishReadjustment ; none to do
cmp di, ss:[bp].SCOS_curOffset ; need adjustment?
ja noReadjustment ; nope
sub ss:[bp].SCOS_curOffset, dx ; update curOffset
noReadjustment:
mov bp, ss:[bp].SCOS_next ; bp = next curOffset
jmp readjustLoop
finishReadjustment:
stc
jmp done
ChunkArrayInsertAt endp
COMMENT @----------------------------------------------------------------------
FUNCTION: UpdateVarOffsets
DESCRIPTION: Update all offsets to elements for a variabled sized chunk
array
CALLED BY: ChunkArrayInsertAt, ChunkArrayDelete
PASS:
ds:di - array
bx - offset of element being worked on (offset in block [not chunk] of
var ptr)
dx - amount to update all offsets by
ax - amount to update offsets after bx by
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 7/17/91 Initial version
------------------------------------------------------------------------------@
UpdateVarOffsets proc far uses cx, di
.enter
; we must update all the offsets to reflect the two bytes that
; we have added and all the offsets after the one being inserted
; reflect the element size being inserted
mov cx, ds:[di].CAH_count
jcxz done ; nothing to do if no
; elements in the array...
add di, ds:[di].CAH_offset
updateLoop:
cmp di, bx
jz updateNext ;this one is already correct
jb notBefore
add ds:[di], ax
notBefore:
add ds:[di], dx
updateNext:
inc di
inc di
loop updateLoop
done:
.leave
ret
UpdateVarOffsets endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayDelete
DESCRIPTION: Delete an element from an array
CALLED BY: GLOBAL
PASS:
*ds:si - array
ds:di - element
RETURN:
ds:di - pointing at the same element (if it still exists) Note that
this will be a different value for variable sized arrays
DESTROYED:
none
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
jcw 3/90 Converted for KLib use
------------------------------------------------------------------------------@
ChunkArrayDelete proc far
uses ax, cx
.enter
call ChunkArrayPtrToElement ; ax <- element number
mov cx, 1 ; cx <- number to nuke
call ChunkArrayDeleteRange ; Nuke that range
call ChunkArrayElementToPtr ; Restore ds:di
.leave
ret
ChunkArrayDelete endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayDeleteRange
DESCRIPTION: Delete a range of elements from an array
CALLED BY: GLOBAL
PASS:
*ds:si - Array
ax - First element to nuke
cx - Number of elements to nuke (-1 to delete to end of
array)
RETURN:
nothing
DESTROYED:
none
WARNING: The following operations MAY NOT be run simultaneously
on the same ChunkArray in different threads:
ChunkArrayEnum (even if callback
ChunkArrayEnumRange is non-destructive)
ChunkArrayAppend
ChunkArrayInsertAt
ChunkArrayDelete
ChunkArrayDeleteRange
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Figure offset to element first
Figure offset to element first+count
Use LMemDeleteAt to nuke the range of data
For variable sized elements
Figure offset to <offset> entry for that element
Nuke count*2 bytes after that point
amountNuked = (count*2) + (end.offset-start.offset)
Update offsets from first->end by -1*amountNuked
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/ 4/92 First version
cdb 5/27/92 added ability to delete to end of array.
------------------------------------------------------------------------------@
ChunkArrayDeleteRange proc far
uses ax, bx, cx, dx, di, bp
.enter
EC < call ECCheckChunkArray >
; check if first element is beyond end of list
mov di, ds:[si]
mov bx, ds:[di].CAH_count
cmp bx, ax
LONG jbe done
; adjust number of elements so that we update CAH_count
; properly...
sub bx, ax ; bx <- max # nukeable elements
cmp cx, bx
jbe gotNumElements
mov cx, bx
gotNumElements:
; ax - first element to remove
; cx - number of elements to remove
;
; Compute offset to first element
;
push ax ; first element
push cx ; count
call ChunkArrayElementToPtr ; ds:di <- offset to first
; cx <- size of element
EC < ERROR_C ELEMENT_ARRAY_BAD_TOKEN >
mov bx, di ; ds:bx <- offset to first
pop cx ; Restore count
;
; Compute offset to last element
;
push cx ; Save count
add ax, cx ; ax <- past last element
call ChunkArrayElementToPtr ; ds:di <- offset to
; last
jnc gotOffset
;
; The element is beyond the end of the chunk. Use the chunk-size to get
; a pointer past the end of the data.
;
mov di, ds:[si]
ChunkSizePtr ds, di, di ; di <- offset past end
add di, ds:[si] ; di <- ptr past end
gotOffset:
mov cx, di ; cx <- Number of bytes to nuke
sub cx, bx
sub bx, ds:[si] ; bx <- offset to delete at
mov ax, si ; ax <- chunk of array
;
; ds = Segment of heap
; ax = Chunk
; bx = Offset to delete at
; cx = Number of bytes to nuke
;
mov bp, cx ; bp <- space nuked
call LMemDeleteAt ; Nuke the space
pop cx ; Restore count
pop ax ; Restore first
;
; Update the count of the number of elements in the array
;
mov di, ds:[si] ; ds:di <- ChunkArrayHeader
sub ds:[di].CAH_count, cx ; Update the count
;
; Now update the array of offsets for variable sized elements
;
mov dx, ds:[di].CAH_elementSize ; dx = element size
tst dx
jnz fixCurOffsets
;
; Update the offsets to the fixed size elements.
;
add di, ds:[di].CAH_offset ; ds:di <- ptr to list of
; offsets
;
; First nuke the offsets starting with the one to the first element
; we nuked.
;
push ax ; Save first entry
shl cx, 1 ; cx <- # of bytes to nuke
shl ax, 1 ; ax <- offset to first one
add di, ax ; ds:di <- place to nuke
mov bx, di ; bx <- place to nuke
sub bx, ds:[si] ; bx <- offset into chunk
mov ax, si ; ax <- chunk
;
; ds = Segment of heap
; ax = Chunk
; bx = Offset to delete at
; cx = Number of bytes to nuke
;
call LMemDeleteAt ; Nuke unused entries
pop ax ; ax <- number of entries nuked
;
; Now update the offsets for all elements after the place we nuked.
;
; Offsets to elements before the ones we nuked need to be adjusted by
; -1 * the amount of space nuked from the offset table. This value
; is in cx right now.
;
; The offset to elements at and after where we did the nuking need to
; be adjusted by the same amount, and also by -1 * the amount of
; space we nuked from the buffer.
;
; The problem is that UpdateVarOffsets is designed to do nothing
; at the position in bx (which is where we did the nuking). What
; we do is decrement bx. Since the entries are words this will
; result in all entries getting updated correctly.
;
add bx, ds:[si] ; bx <- ptr into offsets
dec bx
mov di, ds:[si] ; ds:di <- ChunkArrayHeader
mov ax, bp ; ax <- update for after bx
neg ax
mov dx, cx ; dx <- update for before bx
neg dx
call UpdateVarOffsets
inc bx ; bx = offset in offset-list
; we deleted at
sub bx, ds:[si] ; convert to chunk offset
neg dx ; dx = # bytes we deleted from
; offset-list
fixCurOffsets:
; *ds:si = ds:di = array
; bx = offset for ChunkArrayEnum check
; dx = # bytes to adjust by
; If we are deleting from a ChunkArrayEnum callback routine, we want
; to adjust the CAH_curOffset list so that we don't skip processing an
; element. We need to do this if the deletion point is at or before
; the current position. If we are not in a ChunkArrayEnum, this does
; nothing as CAH_curOffset will be empty.
;
EC < call ECCheckCurOffsetChain >
mov di, ds:[di].CAH_curOffset ; ss:di = first SaveCurOffset
mov bp, di ; ss:bp = first SaveCurOffset
; bx = offset to check
adjustLoop:
tst bp
jz done ; none to do
cmp bx, ss:[bp].SCOS_curOffset ; need adjustment?
ja noAdjustment ; nope
; (if we delete the first item, this may go
; from position to negative here)
sub ss:[bp].SCOS_curOffset,dx ; update curOffset
noAdjustment:
mov bp, ss:[bp].SCOS_next ; bp = next curOffset
jmp adjustLoop
done:
EC < call ECCheckChunkArray >
.leave
ret
ChunkArrayDeleteRange endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayPtrToElement
DESCRIPTION: Return a pointer to a given element
CALLED BY: GLOBAL
PASS:
*ds:si - array
ds:di - element
RETURN:
ax - element number. (from 0).
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
John 3/90 Converted for KLib use
------------------------------------------------------------------------------@
ChunkArrayPtrToElement proc far uses dx, di
.enter
EC < call ECCheckChunkArray >
mov_trash ax, di ; ax = offset in to array
mov di, ds:[si] ; ds:di <- ptr to array.
sub ax, di ; ax <- offset into chunk.
mov dx, ds:[di].CAH_elementSize ; dx <- size of an element
tst dx
jz var
sub ax, ds:[di].CAH_offset ;ax = offset from base of array
mov di, dx
clr dx ; dx.ax <- offset into array.
div di ; ax <- element #.
EC < tst dx ; >
EC < ERROR_NZ PTR_IS_NOT_POINTING_AT_AN_ELEMENT >
done:
EC < call ECCheckChunkArray >
.leave
ret
; variable sized elements
var:
push cx, es
; OK, the element is variable sized. This routine can be called with
; a bogus pointer (one that is past the end of the chunk).
; ChunkArrayAppend does this, and expects an element number that is
; one greater than the last element in the chunk. The pointer in this
; case (which is an offset into the chunk) is the same as the size of
; the chunk itself. There is another case that makes this a little
; more difficult check for. The ChunkArray code lets you insert an
; element of size zero (for variable sized element arrays). If a
; zero-sized element is the last element in a chunk array, it would
; have the same offset into the chunk as a bogus element that was
; described above. SOOOO, we need to check for a valid element first,
; if the search fails, *then* we check to see if the offset is the
; same as the chunk size. Got that ?
push di
mov cx, ds:[di].CAH_count
mov dx, cx
add di, ds:[di].CAH_offset
segmov es, ds ;es:di = offset table
repne scasw
pop di
jnz checkBogusElement
; found a matching offset. That means it's a valid element.
inc cx
mov_trash ax, dx
sub ax, cx
varDone:
pop cx, es
jmp done
; the offset that we're looking for is not in the offset array. This
; means that either ChunkArrayAppend is screwing with our mind, or the
; pointer passed is REALLY bad.
checkBogusElement:
ChunkSizePtr ds, di, cx
cmp ax, cx
EC < ERROR_NZ PTR_IS_NOT_POINTING_AT_AN_ELEMENT >
mov ax, ds:[di].CAH_count
jmp varDone
ChunkArrayPtrToElement endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayCreate
DESCRIPTION: Create a new general array with 0 elements.
CALLED BY: GLOBAL
PASS:
ds - block for new array
bx - element size (0 for variable sized elements)
cx - size for ChunkArrayHeader (this allows for reserving extra
space) 0 = default. Extra space is initialized to zero's.
si - chunk handle to use (or 0 if you want to alloc one)
al - ObjChunkFlags to pass to LMemAlloc
RETURN:
carry set if LMF_RETURN_ERRORS and couldn't allocate new chunk or
enlarge existing chunk
carry clear if array allocated:
*ds:si - array (block possibly moved)
DESTROYED:
none
WARNING: This routine MAY resize the LMem block, moving it on the
heap and invalidating stored segment pointers and current
register or stored offsets to it.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
Doug 3/90 Converted for KLib use
------------------------------------------------------------------------------@
SBCS < MAX_CHUNK_ARRAY_HEADER_SIZE equ 1000 >
DBCS < MAX_CHUNK_ARRAY_HEADER_SIZE equ 2000 >
ChunkArrayCreate proc far uses ax, cx
.enter
InsertGenericProfileEntry PET_LMEM, 1, PMF_LMEM, ax ;
EC < call ECLMemValidateHeapFar >
EC < cmp bx, 8000 >
EC < WARNING_A CHUNK_ARRAY_ELEMENT_SIZE_PROBABLY_TOO_LARGE >
EC < cmp cx, MAX_CHUNK_ARRAY_HEADER_SIZE >
EC < ERROR_A CHUNK_ARRAY_HEADER_SIZE_PROBABLY_TOO_LARGE >
tst cx
jnz notZero
mov cx, size ChunkArrayHeader
notZero:
EC < cmp cx, size ChunkArrayHeader ; check size to be sure >
EC < ERROR_B CHUNK_ARRAY_HEADER_SIZE_TOO_SMALL >
tst si
jnz doReAlloc
call LMemAlloc
jc exit
mov_tr si, ax ;si = new array
afterAlloc:
push si
mov si, ds:[si]
mov ds:[si].CAH_count, 0
mov ds:[si].CAH_curOffset, 0
mov ds:[si].CAH_offset, cx
mov ds:[si].CAH_elementSize, bx
pop si
; Zero-initialize space after ChunkArrayHeader, if any
sub cx, size ChunkArrayHeader
jz done ;(carry clear)
push es, di
mov di, ds:[si]
add di, size ChunkArrayHeader
segmov es, ds
clr al ;(carry clear)
rep stosb
pop es, di
done:
EC < call ECCheckChunkArray >
exit:
InsertGenericProfileEntry PET_LMEM, 0, PMF_LMEM, ax ;
.leave
ret
doReAlloc:
mov ax, si
call LMemReAlloc
jc exit
jmp afterAlloc
ChunkArrayCreate endp
ChunkCommon ends
;---------------
ChunkArray segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayZero
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Zero a chunk array (i.e. free all elements and resize).
CALLED BY: GLOBAL.
PASS: *ds:si = chunk array.
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/27/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayZero proc far uses cx, ax, si
.enter
EC < call ECCheckChunkArray >
mov ax, si
mov si, ds:[si]
mov cx, ds:[si].CAH_offset
mov ds:[si].CAH_count, 0
call LMemReAlloc
.leave
EC < call ECCheckChunkArray >
ret
ChunkArrayZero endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayGetElement
DESCRIPTION: Get an element given its element number
CALLED BY: GLOBAL
PASS:
*ds:si - chunk array
ax - element number
cx:dx - buffer for element
RETURN:
ax - element size
buffer - filled
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 7/91 Initial version
AY 7/22/93 use movsw and merge GetElementLow into here
------------------------------------------------------------------------------@
ChunkArrayGetElement proc far uses cx, si, di, es
.enter
EC < call ECCheckChunkArray >
EC < cmp ax, CA_NULL_ELEMENT >
EC < ERROR_Z NULL_ELEMENT_PASSED_TO_CHUNK_ARRAY_ROUTINE >
mov es, cx
mov di, ds:[si]
mov cx, ds:[di].CAH_elementSize
call ChunkArrayElementToPtr ;ds:di = element, cx = size
EC < ERROR_C ELEMENT_ARRAY_BAD_TOKEN >
mov si, di ;ds:si = element
mov di, dx ;es:di = buffer
mov ax, cx ;ax returns size
shr cx
rep movsw
jnc notOdd
movsb
notOdd:
.leave
ret
ChunkArrayGetElement endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ChunkArrayElementResize
DESCRIPTION: Resize an element in a variable sized element array
CALLED BY: GLOBAL
PASS:
*ds:si - array
ax - element number
cx - new size
RETURN:
carry set if LMF_RETURN_ERRORS and resize could not be performed
carry clear if ok
DESTROYED:
none
** WARNING
If you are resizing the element larger then chunks on the
lmem heap may move. This means that all direct pointers
into the lmem heap are not valid after a call to this
routine.
In addition to this, if you are resizing an element larger
then the lmem-heap itself may move on the global heap. This
means that any segment registers or stored segments which
refer to the heap are not valid after a call to this routine.
If you are resizing the element smaller then all pointers
and segments are still valid after the call.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 7/91 Initial version
------------------------------------------------------------------------------@
ChunkArrayElementResize proc far uses ax, bx, cx, dx, di, bp
.enter
EC < mov bx, ds:[si] >
EC < cmp ds:[bx].CAH_elementSize, 0 >
EC < ERROR_NZ CANNOT_RESIZE_FIXED_SIZE_ELEMENT >
EC < call ECCheckChunkArray >
EC < cmp ax, CA_NULL_ELEMENT >
EC < ERROR_Z NULL_ELEMENT_PASSED_TO_CHUNK_ARRAY_ROUTINE >
mov bx, cx ;bx = new size
call ChunkArrayElementToPtr ;cx = old size
EC < ERROR_C BAD_ELEMENT_PASSED_TO_CHUNK_ARRAY_RESIZE >
NEC < jc done ;return C set >
mov di, ds:[si]
xchg ax, bx ;ax = new size,
;bx = element number
shl bx
add bx, ds:[di].CAH_offset
mov bp, bx ;save in case insert fails
add bx, di ;ds:bx = offset to element
sub ax, cx ;ax = size change
clr dx ;no change in var offset table
; size
call UpdateVarOffsets
mov bx, ds:[bx] ;bx = offset of element
add bx, cx ;bx points at end of element
tst ax
jns bigger
; making chunk smaller -- delete bytes at the end
add bx, ax
mov_tr cx, ax
neg cx
mov ax, si
call LMemDeleteAt
clc ;just to be sure
jmp done
bigger:
mov_tr cx, ax
mov ax, si
call LMemInsertAt
jnc done
; insert failed, so readjust var offsets before we return the error
mov bx, bp
add bx, ds:[si] ;ds:bx <- block offset of
; pivotal var offset
mov_tr ax, cx
neg ax ;ax <- adjustment for var
; offsets after ds:bx
;(dx still 0)
call UpdateVarOffsets
stc
done:
EC < call ECCheckChunkArray >
.leave
ret
ChunkArrayElementResize endp
ChunkArray ends
;----------------------------
Sort segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArraySort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sort an array into ascending order
CALLED BY: GLOBAL
PASS: *ds:si = array to sort
bx = value to pass to callback (in bx)
cx:dx = fptr to callback routine
must be vfptr in XIP'ed geodes
PASS: bx = value passed to ChunkArraySort
ds:si = first array element
es:di = second array element
RETURN: flags set so routine can jl, je or jg
depending as the first element is less-than,
equal-to, or greater-than the second.
DESTROYED: ax, bx, cx, dx, si, di
RETURN: nothing
DESTROYED: cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/ 3/90 Initial version
don 3/27/91 Added quicksort
john 8/14/91 Added parameter block
todd 4/23/94 XIP'ed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArraySort proc far
uses ax, bx, di, si, es
params local QuickSortParameters
.enter
;
; Check Array for irregularities.
EC< call ECCheckChunkArray >
;
; Initialize the stack frame.
;
mov params.QSP_compareCallback.segment, cx
mov params.QSP_compareCallback.offset, dx
mov params.QSP_lockCallback.segment, 0
mov params.QSP_unlockCallback.segment, 0
mov params.QSP_insertLimit, DEFAULT_INSERTION_SORT_LIMIT
mov params.QSP_medianLimit, DEFAULT_MEDIAN_LIMIT
;
; Set up for sorting by getting a pointer to the array base.
;
mov si, ds:[si] ; ds:si <- ptr to array header
mov ax, ds:[si].CAH_elementSize ; ax <- size of elements
EC < tst ax >
EC < ERROR_Z CANNOT_SORT_VARIABLE_SIZED_CHUNK_ARRAYS >
mov cx, ds:[si].CAH_count ; cx <- # of elements
cmp cx, 1 ; 1 or less is already sorted
jbe done
add si, ds:[si].CAH_offset ; ds:si <- ptr to array base
segmov es, ds ; es <- array segment
;
; Because we reside in a movable code resource, we must verify
; that the fptrs to the callbacks are not in the XIP area.
if FULL_EXECUTE_IN_PLACE
EC < call ECCheckParamBlock >
endif
;
; ds,es = Segment of the chunk array
; si = Offset to first elemet in the array
; ax = Size of each element
; cx = Number of elements
; ss:bp = Inheritable QuickSortParameters
; bx = Value to pass to callback
;
call ChunkArrayQuickSort ; Sort the array
done:
.leave
EC < call ECCheckChunkArray >
ret
ChunkArraySort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ArrayQuickSort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sorts the passed array using a modified quicksort algorithm.
CALLED BY: GLOBAL
PASS: ds:si = Start of array
ax = Size of each element
cx = Number of elements in the array
ss:bp = Inheritable QuickSortParameters (see chunkarr.def)
bx = Value to pass to callback (in bx)
RETURN: Nothing
DESTROYED: ax, cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 3/30/91 Initial version
John 8/14/91 Changed to pass parameter structure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ArrayQuickSort proc far
uses bx, di, si, es
.enter
segmov es, ds ; ES points at array also
call ChunkArrayQuickSort ; perform the sort
.leave
ret
ArrayQuickSort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayQuickSort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Implement quicksort for chunk arrays. The array is sorted
in ascending order. That is, the first element will be the
smallest in the array. This code isn't actually specific
to ChunkArray's. It actually works with any array.
CALLED BY: Internal
PASS: ds, es = Segment of chunk array
si = First array element to sort
ax = Size of each element
cx = Number of elements to sort
ss:bp = Inheritable QuickSortParameters (see chunkarr.def)
bx = Value to pass to callback (in bx)
RETURN: Nothing
DESTROYED: BX, CX, DX, DI, SI
PSEUDO CODE/STRATEGY:
Quicksort is outlined pretty thoroughly in Knuth Volume 3, pp 114-123.
The implementation here is fairly straightforward with the following
additions:
1 - In order to avoid the worst case (n^2) behavior associated
with a sorted list the routine begins by choosing the
median of the first, middle, and last elements of the list.
Knuth says on page 123:
The worst case is still of order n^2, but such slow
behavior will hardly ever occur.
2 - In order to minimize the amount of stack space, which can
be of order N in a worst case scenario, the smaller part
of the partitioned list is processed first. This ensures
that the amount of stack space is of order log2(n) and
never worse. This is mentioned by Knuth on page 115.
A basic idea behind Quicksort is to generate a list that looks like
this:
l = left edge of the list
r = right edge of the list
R(l)...R(k-1) R(k) R(k+1)...R(r)
such that:
R(l...k-1) < R(k) < R(k+1...r)
The first element in the list is designated as the key. To move a
key into it's final position we do the following:
key = l
partition = l
for (i = l; i < r; i++) do
if R(key) < R(i) then
/* Do nothing, R(i) is in the proper part of the list */
else
/* R(i) is in the wrong part of the list */
Swap( i, partition )
parition += 1
endif
end
Swap( key, partition-1 )
The 'partition' tells us where we will be finally positioning the
key. At any given point we know:
R(l...partition-1) < R(key) < R(partition...i)
When we are done we swap the key with the entry before the parition to
generate the final ordering we want.
Then we make two recursive calls to sort the lists on the left and
right of the correctly positioned item.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 3/27/91 Initial version
John 8/8/91 Added documentation and enhancement #2 above
John 8/14/91 Added parameter block
todd 4/23/94 XIP'ed
AY 4/29/96 "call" -> "jmp" to make enhancement #2 work
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayQuickSort proc near
params local QuickSortParameters
.enter inherit
EC< call ECCheckParamBlock >
EC< jcxz emptyArray >
EC< push ax, dx, si >
EC< call ECCheckBounds >
EC< mul cx >
EC< tst dx >
EC< ERROR_NZ ADDRESS_OUT_OF_BOUNDS >
EC< dec ax ; make sure checks are for the actual last byte >
EC< ; not the first byte of the first non-existent >
EC< ; element -- ardeb 4/14/94 >
EC< add si, ax >
EC< ERROR_C ADDRESS_OUT_OF_BOUNDS >
EC< call ECCheckBounds >
EC< pop ax, dx, si >
EC< emptyArray: >
;
; Check to see if we should use just simple insertion sort
; Else find median element to use as key - this evidently leads
; to a more efficient algorithm than using the first element as
; the key.
;
; ax = Size of each element
; cx = # of elements in the list
; ds,es = Segment address of the array
; si = Offset of first element in the array
; bp = QuickSortParameters
; bx = Value to pass to callback
;
; dx, di unused
;
; Check to see if the list is already sorted.
;
cmp cx, 1 ; A single element is sorted
LONG jbe done ; Branch if sorted
;
; Check to see if we want to be using the insertion sort instead
; of quicksort. It turns out to be faster for smaller arrays.
;
cmp cx, params.QSP_insertLimit ; Check count against limit
ja checkMedian ; Branch to use quicksort
;
; Use the insertion sort algorithm. The list is small enough.
;
call ChunkArrayInsertionSort
jmp done
checkMedian:
;
; Check to see if the caller wants us to use the median of three values
; in choosing the key to sort. In some cases it may take more time to
; locate the median than it would to just sort the elements. This is
; only true for very small lists where the cost of a comparison is high.
;
cmp cx, params.QSP_medianLimit ; Check count against limit
jb quicksort ; Branch if below limit
;
; Quicksort has a horrible worst case performance if the list is
; sorted. In order to avoid this case we find the median of 3 values
; The first, middle, and last elements
;
; ds:si = Pointer to first element
; es = Same as ds
; ax = Element size
; cx = # of elements
; bp = QuickSortParameters
; bx = Value to pass to callback (in bx)
;
push si, ax ; first element, element size
push ax ; Save element size again
;
; Compute the position of the middle:
; middlePos = (elementSize * numEntries/2) + startPos
;
mov dx, cx ; dx <- numEntries
shr dx, 1 ; dx <- numEntries / 2
pushf ; save carry flag (indicates odd #)
mul dx ; ax <- elementSize * numEntries/2
EC < ERROR_C CHUNK_ARRAY_QUICK_SORT_OVERFLOW >
mov di, ax ; di <- offset to middle
xchg dx, ax ; dx <- offset to middle
; ax <- numEntries / 2
add di, dx ; di <- offset to last entry
popf ; Restore carry flag (odd # entries)
pop ax ; Restore element size
;
; ds,es = Segment address of the array
; si = Offset to first element
; di = Offset to the last element
; dx = Offset to the middle
;
; ax = Size of the elements
; cx = # of entries in the list
;
; bp = QuickSortParameters
; bx = Value to pass to callback (in bx)
;
; On stack:
; Element size
; Pointer to first element
;
; Carry set if the number of elements is an odd number.
;
; If it's an even count (carry clear) then we want to move di backwards
; one element.
;
; The reason for this is that the array is zero based. That means that
; the offset to the middle element that we've computed for an even
; sized array will actually refer to the first entry in the second
; half of the list. If we just multiply this by two (as we've done
; already) we will have the offset past the end of the array.
;
jc firstTest ; Branch if odd sized array.
sub di, ax ; Even count, move back one entry.
firstTest:
;
; Since di and dx are offsets from the start of the array we need to
; add the base of the array to generate the pointers we need.
;
add di, si ; di <- ptr to last element
add dx, si ; dx <- ptr to middle element
;
; Compare the first element (si) to the last element (di).
; What we want to do is to put the smaller of *si and *di into si.
;
call CallCallback ; compare DS:SI and ES:DI
jl secondTest
xchg di, si ; smaller => DS:SI
secondTest:
;
; ds:si = Pointer to the smaller from first comparison
; es:di = Pointer to the larger from first comparison
; dx = Pointer to the next element to check (middle element)
;
; We compare *si to *dx. If si is larger then we know that si points
; to the median value (since dx < si < di).
;
xchg dx, di ; dx <- larger of first comparison
; di <- middle element
call CallCallback ; Compare DS:SI and ES:DI
jg partition ; Branch if median is already in si
;
; We've swapped a few things around, but here's what we have:
; si = Pointer to the smaller of the second comparison
; and the smaller of the first comparison.
; dx = Pointer to the larger of the first comparison
; di = Pointer to the larger of the second comparison
; (*si < *di) and (*si < *dx)
; It should be clear that si does not point to the median. The smaller
; of *dx and *di contains the median.
;
mov si, dx ; si <- larger of 1st computation
call CallCallback ; compare two winners
jl partition ; if less, median is in SI
mov si, di ; si <- pointer to median
partition:
;
; ds,es = Segment address of the array.
; si = Offset to the median (key to use for this sort).
; On stack:
; Element size
; Pointer to first element
;
; We want to swap median to first position so that we can sort it.
;
mov di, si ; di <- offset to the median
pop si, ax ; Restore ptr to 1st element, size
call ChunkArraySwapSIDI ; swap key to 1st
quicksort:
;
; Keeping ds:si as the key whose position we want to find, we now
; setup di as the pointer to the "current" entry. That entry falls
; right after the key.
;
; ds,es = Segment address of the array
; si = Key to sort
; ax = Size of each element
; cx = Number of elements to sort
; bp = QuickSortParameters
; bx = Value to pass to callback (in bx)
;
; di will hold the "current" entry.
;
; dx unused
;
mov di, si ; di <- pointer to array start
add di, ax ; di <- pointer to 2nd element
mov dx, di ; dx <- current partition spot
dec cx ; cx <- # of entries left in list
;
; Initialize the count which tells us how many items in the list
; fall below the current partition and how many fall above.
;
mov params.QSP_nLesser, 0
mov params.QSP_nGreater, 0
;
; Before starting the loop which finds the position for the element
; pointed at by ds:si we call the 'locking' callback to lock the
; element down. For data where the cost of accessing the element
; is expensive this allows the application to do any preliminary
; work necessary to make accessing this same element faster in the
; heart of the loop.
;
tst params.QSP_lockCallback.segment
jz locked ; Branch if no callback
if FULL_EXECUTE_IN_PLACE
;
; In XIP system, need to do PCFOM if movable...
cmp params.QSP_lockCallback.segment, 0f000h
jb regularLock
mov ss:[TPD_dataAX], ax
mov ss:[TPD_dataBX], bx
movdw bxax, params.QSP_lockCallback
call ProcCallFixedOrMovable
jmp locked
regularLock:
endif
call params.QSP_lockCallback
locked:
partitionLoop:
;
; Now we start the partitioning process, with key in SI
;
; ds,es = Segment address of the array.
; si = Base of the array (discriminator)
; di = Current entry to check
; ax = Size of the elements.
; dx = Current partitioning position
; cx = # of iterations left
; bp = QuickSortParameters
; bx = Value to pass to callback (in bx)
;
call CallCallback ; Compare key with current element
jle next ; Branch if element in right spot
;
; The element isn't in the right part of the list. We want to swap
; it with the element at the partition position in order to put it
; in the right part of the list.
;
xchg dx, si ; si <- partition position
; dx <- key
call ChunkArraySwapSIDI ; Swap current element with partition
xchg dx, si ; si <- key
; dx <- partition position
;
; Since we've shifted an element which belongs at the lower end of the
; list we now advance the partition position to reflect that all the
; elements before the partition are less than the key.
;
add dx, ax ; Advance the partition
;
; Since the current element is smaller than the key we increment
; that counter. Since the default action after we fall thru is to
; increment the number of elements that is greater than the key
; we want to compensate here by decrementing that counter.
;
inc params.QSP_nLesser
dec params.QSP_nGreater
next:
;
; Move to consider the next element in the list. At this point
; either the current entry is known to be greater than the key
; or else we've compensated for the fact that it is less.
;
inc params.QSP_nGreater
add di, ax ; Advance current entry
loop partitionLoop ; Loop to process next entry
;
; We have successfully determined the position for the key, before
; proceeding we unlock the element whose position we have determined
; before we actually move it.
;
tst params.QSP_unlockCallback.segment
jz unlocked ; Branch if no callback
if FULL_EXECUTE_IN_PLACE
; In XIP system, need to do PCFOM if movable...
cmp params.QSP_lockCallback.segment, 0f000h
jb regularUnlock
mov ss:[TPD_dataAX], ax
mov ss:[TPD_dataBX], bx
movdw bxax, params.QSP_unlockCallback
call ProcCallFixedOrMovable
jmp unlocked
regularUnlock:
endif
call params.QSP_unlockCallback
unlocked:
;
; We swap the key with the element before the current partition
; position to generate a list with the upper half greater than
; the key and the lower half less.
;
mov di, dx
sub di, ax ; Swap partition with key
call ChunkArraySwapSIDI
;
; Now process the two sub-lists recursively.
;
; ds,es = Segment address of the list
; ax = Element size
; cx will be used to hold the # of elements in the lists
; bp = QuickSortParameters
; bx = Value to pass to callback (in bx)
;
; si = Pointer to the start of the lesser list
; dx = Offset to the start of the greater list
;
; di unused
;
mov cx, params.QSP_nLesser
mov di, params.QSP_nGreater
;
; ds,es = Segment address of the list
; ax = Element size
; bp = QuickSortParameters
;
; si/cx = Pointer/size for lesser list
; dx/di = Pointer/size for upper list
;
; We want to process the smaller list first. This will ensure that
; the amount of stack space we use will be no worse than log2(n)
; stack frames.
;
cmp cx, di ; Find smaller
jle gotSmaller
xchg si, dx ; Swap first/last list ptrs
xchg cx, di ; Swap first/last list sizes
gotSmaller:
;
; si/cx = Pointer/size for first list to do
; dx/di = Pointer/size for second list to do
;
push dx, di ; Save start & count of 2nd list
call ChunkArrayQuickSort ; Sort first list
pop si, cx ; si <- ptr, cx <- size of 2nd list
;
; Use "jmp" rather than "call" here, so that the stack space
; optimization actually works. Of course it is possible only because
; we don't have ".uses" and all local variables are inherited from our
; caller. --- AY 4/29/96
;
jmp ChunkArrayQuickSort ; sort second partition
done:
.leave
ret
ChunkArrayQuickSort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call the sorting comparison routine.
CALLED BY: ChunkArrayQuickSort, ChunkArrayInsertionSort
PASS: ds:si = First element
es:di = Second element
ss:bp = Inheritable QuickSortParameters
bx = Value to pass to callback (in bx)
RETURN: Flags set so routine can jl, je or jg depending as the
first element is less-than, equal-to, or greater-than
the second.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Determine if we are calling a regular routine, or
one which resides in an XIP geode. If the segment
of the callback is a vseg, that means we are calling
and XIP geode, and must use ProcCallFixedOrMovable
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
don 8/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CallCallback proc near
uses ax, bx, cx, dx, di, si
params local QuickSortParameters
.enter inherit
;
; See if segment of callback is a vseg.
FXIP< cmp {byte}params.QSP_compareCallback.high+1, 0f0h >
FXIP< jae doProcCall ; => It is a vseg >
call params.QSP_compareCallback
done::
.leave
ret
if FULL_EXECUTE_IN_PLACE
doProcCall:
;
; Set up call to ProcCallFixedOrMovable and call the
; XIP resource.
mov ss:[TPD_dataAX], ax
mov ss:[TPD_dataBX], bx
movdw bxax, params.QSP_compareCallback
call ProcCallFixedOrMovable
jmp short done
endif
CallCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArrayInsertionSort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sort the passed chunk array using insertion sort
CALLED BY: ChunkArrayQuickSort
PASS: ds, es = Segment of chunk array
si = First array element to sort
ax = Size of each element
cx = Number of elements to sort
bp = Inheritable QuickSortParameters (see chunkarr.def)
bx = Value to pass to callback (in bx)
RETURN: Nothing
DESTROYED: BX, CX, DX, DI, SI
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 10/ 3/90 Inital version
Don 3/27/91 Moved to different routine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArrayInsertionSort proc near
.enter
;
; ds:si is now the element that we want to replace with the smallest
; item in the array.
;
jcxz done ; if no elements, don't sort
sortLoop:
mov dx, si ; assume first is smallest
push cx ; save # elements left to sort
mov di, si
searchNext:
add di, ax ; advance to next
loop searchLoop
jmp haveSmallest
searchLoop:
push si
mov si, dx ; si <- current smallest
call CallCallback ; compare ds:si and es:di
pop si
jle searchNext ; ds:dx still smaller
mov dx, di ; record di as new smallest
jmp searchNext
haveSmallest:
;
; We've located the current smallest element in the array, so swap
; it with the first element (unless, of course, the first *is* the
; smallest)
;
mov di, dx
call ChunkArraySwapSIDI
add si, ax ; go to next element
pop cx ; restore # elements left to sort
loop sortLoop
done:
.leave
ret
ChunkArrayInsertionSort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ChunkArraySwapSIDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Swap chunk array elements
CALLED BY: INTERNAL (ChunkArrayQuickSort, ChunkArrayInsertionSort)
PASS: DS, ES = Segment of chunk array
AX = Size of each element
SI = 1st element offset
DI = 2nd element offset
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Should this be a macro, to speed things up ??
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 3/27/91 Stolen from original ChunkArraySort (Adam)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ChunkArraySwapSIDI proc near
uses ax, cx, di, si
.enter
cmp di, si
je done
xchg cx, ax ; cx <- element size
shr cx ; convert to words
jnc swapWords ; => even so can start swapping words
mov al, ds:[di] ; swap initial byte
xchg al, ds:[si]
stosb
inc si
jcxz done ; => swapping is done
swapWords:
mov ax, ds:[di]
xchg ax, ds:[si]
stosw
inc si
inc si
loop swapWords
done:
.leave
ret
ChunkArraySwapSIDI endp
Sort ends
;=============================================================================
; Error checking
;=============================================================================
kcode segment
COMMENT @----------------------------------------------------------------------
FUNCTION: ECCheckChunkArray
DESCRIPTION: Check a general array structure for validity
CALLED BY: INTERNAL
PASS:
*ds:si - array
RETURN:
non
DESTROYED:
non
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 1/90 Initial version
------------------------------------------------------------------------------@
if ERROR_CHECK
ECCheckChunkArray proc far uses ax, bx, cx, dx, si
.enter
pushf
call ECLMemValidateHeapFar
xchg ax, si
call ECLMemExists
xchg ax, si
mov si, ds:[si]
ChunkSizePtr ds, si, cx ;cx = size
mov ax, ds:[si].CAH_elementSize
tst ax
jz var
mul ds:[si].CAH_count
tst dx
ERROR_NZ CORRUPT_CHUNK_ARRAY
add ax, ds:[si].CAH_offset
ERROR_C CORRUPT_CHUNK_ARRAY
cmp ax, cx
ERROR_NZ CORRUPT_CHUNK_ARRAY
jmp done
var:
mov dx, cx ;dx = chunk size
mov cx, ds:[si].CAH_count
add si, ds:[si].CAH_offset
jcxz done
dec cx
jcxz lastElement
varLoop:
mov ax, ds:[si][2]
cmp ax, ds:[si]
ERROR_B CORRUPT_CHUNK_ARRAY
add si, 2
loop varLoop
lastElement:
cmp dx, ds:[si]
ERROR_B CORRUPT_CHUNK_ARRAY
done:
popf
.leave
ret
ECCheckChunkArray endp
else
ECCheckChunkArray proc far
ret
ECCheckChunkArray endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECCheckParamBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verify that the QuickSortParameter block has valid entries
CALLED BY: INTERNAL
PASS: ss:bp -> ptr to QSP to check
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
Fatal Errors if something messed up
PSEUDO CODE/STRATEGY:
When running under full XIP, we want to make sure that
the fptrs being passed in as callbacks are valid.
Since much of the code is in movable resources, this
means that they can not point to routines in the XIP
segment itself, since it can be swapped out.
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 3/18/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ERROR_CHECK
ECCheckParamBlock proc far
if FULL_EXECUTE_IN_PLACE
uses bx, si
.enter inherit ChunkArrayQuickSort
;
; Because we are in a movable code segment, we need to assert
; that the fptrs we are passed do not lie in the XIP
; segment.
movdw bxsi, params.QSP_compareCallback
call ECAssertValidFarPointerXIP
movdw bxsi, ss:[params].QSP_lockCallback
tst bx
jz checkUnlock
call ECAssertValidFarPointerXIP
checkUnlock:
movdw bxsi, ss:[params].QSP_unlockCallback
tst bx
jz popAndGo
call ECAssertValidFarPointerXIP
popAndGo:
.leave
endif
ret
ECCheckParamBlock endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECCheckCurOffsetChain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks the SavedCurOffsetStruct chain for validity.
It could get messed up if two threads try to perform
an operation on the chunkArray that uses this structure
(ChunkArrayEnum, ChunkArrayInsertAt, ChunkArrayDeleteRange)
CALLED BY: INTERNAL
ChunkArrayEnum
ChunkArrayInsertAt
ChunkArrayDeleteRange
PASS: *ds:si = ChunkArray
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CT 3/21/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ERROR_CHECK
ECCheckCurOffsetChain proc far
uses bp, bx, ax
pushf
.enter
mov bp, ds:[si]
mov bp, ds:[bp].CAH_curOffset
;
; SavedCurOffset chain is stored below stackBot
;
mov bx, ss:[TPD_stackBot]
offsetLoop:
tst bp
jz done ; none to do
;
; Since there can be only one of these chains per ChunkArray,
; it had better only be manipulated by one thread at a time.
;
mov ax, ss:[bp].SCOS_thread
cmp ax, ss:[TPD_threadHandle]
WARNING_NE CHUNK_ARRAY_ENUM_INSERT_OR_DELETE_RUN_BY_MULTIPLE_THREADS
;
; This SavedCurOffsetStruct must be lower on the stack segment
; than the last one.
;
cmp bp, bx
WARNING_NB CHUNK_ARRAY_ENUM_INSERT_OR_DELETE_RUN_BY_MULTIPLE_THREADS
mov bx, bp
mov bp, ss:[bp].SCOS_next ; bp = next curOffset
jmp offsetLoop
done:
.leave
popf
ret
ECCheckCurOffsetChain endp
endif
kcode ends
| 25.955414 | 80 | 0.62983 |
824a5644dd507185b5b27eb596c2c66cf3fd36b5 | 383 | asm | Assembly | programs/oeis/029/A029011.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/029/A029011.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/029/A029011.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A029011: Expansion of 1/((1-x)(1-x^2)(1-x^5)(1-x^6)).
; 1,1,2,2,3,4,6,7,9,10,13,15,19,21,25,28,33,37,43,47,54,59,67,73,82,89,99,107,118,127,140,150,164,175,190,203,220,234,252,267,287,304,326,344,367,387,412,434,461,484,513,538,569,596,629,658,693,724,761,794
lpb $0
mov $2,$0
sub $0,2
seq $2,25776 ; Expansion of 1/((1-x)(1-x^5)(1-x^6)).
add $1,$2
lpe
add $1,1
mov $0,$1
| 31.916667 | 205 | 0.613577 |
ecff4b5876328f6ec552132cf850256b608fe495 | 5,086 | asm | Assembly | dev/smartdrv/stacker.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dev/smartdrv/stacker.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dev/smartdrv/stacker.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | ;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
include bambi.inc
public detect_stacker
public detect_stacker_volume
public stacker_dd_pointer
zseg segment public 'CODE'
assume cs:zseg
assume ds:nothing
st_ptr DD 0 ;pointer to Stacker (0-->not there)
stacker_tested db 0 ;havent tested for stacker yet
stacker_version dw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
; Input: None
; Output:AX=0 --> Stacker not installed
; AX<>0 --> Stacker version*100 (e.g. 1.00 --> 0064H)
;
; Stacker is detected by making an INT 25H call with invalid
; parameters.
;
detect_stacker proc
cmp cs:stacker_tested,0
je do_stacker_test
mov ax,cs:stacker_version
ret
do_stacker_test:
push bp
push si
push di
sub sp,1024 ;use the stack as a temp buffer
mov ax,0cdcdh ;invalid drive #
mov bx,sp ;DS:BX --> buffer for INT 25H
mov cx,1
xor dx,dx ;read boot sector of invalid drive
mov word ptr [bx],dx ;clear the "return" value
push ds ;(set ES:BP to fix DOS 3 INT 25H bug)
pop es
mov bp,bx
int 25H
pop cx ;get rid of flags
xor ax,ax ;default is No stacker
mov bx,sp ;point at result
cmp word ptr [bx],0CDCDH ;Stacker INT 25 fills in some fields.
jnz gotres ;Make sure they all match
cmp word ptr 2[bx],1
jnz gotres
les di,4[bx] ;pointer into Stacker
cmp word ptr es:[di],0A55AH ;must find signature
jnz gotres
mov word ptr st_ptr ,di ;save pointer to show it's found
mov word ptr st_ptr+2,es
mov ax,es:[di+2] ;stacker version * 100
gotres:
add sp,1024
pop di ;restore regs
pop si
pop bp
mov stacker_tested,1
mov stacker_version,ax
ret
detect_stacker endp
;
; Input: dx->driveno: 0=A, 1=B, 2=C, etc.
;
; Output:AX=1 --> Is a Stacker volume
; AX=0 --> Is not a Stacker volume
; BL = Stacker unit number if AX=1
;
; Notes: If a multitasking environment is present (such as Windows), you
; must make this a critical section of code!
;
; This method uses the removeable media ioctl call to detect
; Stacker volumes. It does NOT work under DR DOS 5.0, since that
; version of DOS does NOT pass these calls through to the Stacker
; device driver.
;
UNIT_OFFS equ 3EH ;offset with Stacker of
driveno dw ?
detect_stacker_volume proc
mov cs:driveno,dx
cmp word ptr st_ptr+2,0 ;already found Stacker?
jnz stacker_fnd
call detect_stacker ;is not, try again
xor ax,ax ;return 0 if not found
cmp ax,word ptr st_ptr+2 ;is it ther
jz retOp
; Here if Stacker IS installed.
stacker_fnd:
mov ah,30h ;treat DR DOS special
int 21h ;(it doesn't pass 4408H through)
cmp ax,1F03H
mov ax,4408H ;do an ioctl call
jnz use08
mov al,0EH ;(DR DOS, Compaq 3.31: 440EH)
use08: les di,st_ptr
mov byte ptr es:UNIT_OFFS[di],0FFH ;set Stacker unit #
mov bx,driveno
inc bx ;adjust for default
int 21h ;if Stacker drive, will return
mov ax,0
jc retOp ;no ioctl support --> not Stacker
les di,st_ptr ;see if unit # changed
mov bl,byte ptr es:UNIT_OFFS[di]
cmp bl,0FFH
jz retOp
inc ax ;if so, we have a Stacker volume
retOp: ret
detect_stacker_volume endp
;
; This data structure is part of the Stacker internal data structure
; maintained for each Stacker drive. A pointer to this structure can be
; obtained from the routine stacker_dd_pointer() below. See ST.C for
; an example. Assuming that nothing else has "stolen" the DPB for a drive,
; you can perform a sanity check by comparing the strategy and interrupt
; pointers found here with those found in another DPB (or in the device
; chain). As a quick check, you could also make sure that the segment
; part of dv_strategy is the same as that for dv_interrupt.
;
; To force Stacker to call a different device driver, the following
; fields must be modified: dv_strategy, dv_interrupt, and dv_unit.
;
;
STACKER_DD struc
dv_strategy dd 1 dup(?) ;physical device driver strategy addr
dv_interrupt dd 1 dup(?) ;physical device driver interrupt addr
dv_att dw 1 dup(?) ;device driver header attributes
dv_cluster0 dw 1 dup(?) ;first file cluster of
dv_log2 db 1 dup(?) ;LOG base 2 of physical bytes/sector
dv_unit db 1 dup(?) ;physical device driver unit number
STACKER_DD ends
STACKER_UNIT_DD_OFFSET equ 015CH
;
; C declaration: STACKER_DD far *stacker_dd_pointer(int driveno);
;
; Input: dx->driveno: 0=A, 1=B, 2=C, etc.
;
; Output:DX:AX = far pointer to the STACKER_DD struc (0:0 if error)
;
; Notes: If a multitasking environment is present (such as Windows), you
; must make this a critical section of code!
stacker_dd_pointer proc
mov cs:driveno,dx
push driveno
call detect_stacker_volume
pop cx ;get rid of driveNo on stack
cwd
or ax,ax
jnz isStacker
ret
isStacker:
les di,st_ptr
mov di,es:4[di] ;get unit table pointer
xor bh,bh
add bx,bx ;multiply unit # by two
mov ax,es:[di+bx] ;dx:ax = per unit pointer
add ax,STACKER_UNIT_DD_OFFSET
mov dx,es ;return pointer
ret
stacker_dd_pointer endp
zseg ends
end
| 22.405286 | 75 | 0.702123 |
7aababf1ef14fd18b72d807a8c93e409b0741159 | 1,342 | asm | Assembly | FictionTools/z88dk/libsrc/target/zx/stdio/generic_console_ioctl.asm | polluks/Puddle-BuildTools | c1762d53a33002b62d8cffe3db129505a387bec3 | [
"BSD-2-Clause"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/target/zx/stdio/generic_console_ioctl.asm | andydansby/z88dk | baa862001ded239b449e964783d6ab87bc44ddae | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/target/zx/stdio/generic_console_ioctl.asm | andydansby/z88dk | baa862001ded239b449e964783d6ab87bc44ddae | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z |
MODULE generic_console_ioctl
PUBLIC generic_console_ioctl
SECTION code_clib
INCLUDE "ioctl.def"
EXTERN generic_console_cls
EXTERN __zx_32col_font
EXTERN __zx_64col_font
EXTERN __zx_32col_udgs
EXTERN __ts2068_hrgmode
EXTERN __console_w
PUBLIC CLIB_GENCON_CAPS
defc CLIB_GENCON_CAPS = CAP_GENCON_INVERSE | CAP_GENCON_BOLD | CAP_GENCON_UNDERLINE | CAP_GENCON_CUSTOM_FONT | CAP_GENCON_UDGS | CAP_GENCON_FG_COLOUR | CAP_GENCON_BG_COLOUR
; a = ioctl
; de = arg
generic_console_ioctl:
ex de,hl
ld c,(hl) ;bc = where we point to
inc hl
ld b,(hl)
cp IOCTL_GENCON_SET_FONT32
jr nz,check_set_font64
ld (__zx_32col_font),bc
success:
and a
ret
check_set_font64:
cp IOCTL_GENCON_SET_FONT64
jr nz,check_set_udg
ld (__zx_64col_font),bc
jr success
check_set_udg:
cp IOCTL_GENCON_SET_UDGS
jr nz,check_mode
ld (__zx_32col_udgs),bc
jr success
check_mode:
IF FORts2068
cp IOCTL_GENCON_SET_MODE
jr nz,failure
ld a,c
and 7
; 0 = screen 0
; 1 = screen 1
; 2 = high colour
; 6 = hires
ld l,64
cp 0
jr z,set_mode
cp 1
jr z,set_mode
cp 2
jr z,set_mode
cp 6
jr nz,failure
ld l,128
set_mode:
ld (__ts2068_hrgmode),a
ld a,l
ld (__console_w),a
in a,($ff)
and @1100000
ld b,a
ld a,c
and @00111111
or b
out ($ff),a
call generic_console_cls
jr success
ENDIF
failure:
scf
ret
| 16.987342 | 191 | 0.742176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.