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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d2e8b76c3f5cb845d016b03dba1707f0f86ca928 | 2,964 | asm | Assembly | defines/elf.asm | Ge0/okita-poc | 2cf1230361fe507cf31f94ba1a11b6e5e5a4361e | [
"MIT"
] | 18 | 2015-08-06T02:20:06.000Z | 2021-05-20T09:43:31.000Z | defines/elf.asm | Ge0/okita-poc | 2cf1230361fe507cf31f94ba1a11b6e5e5a4361e | [
"MIT"
] | null | null | null | defines/elf.asm | Ge0/okita-poc | 2cf1230361fe507cf31f94ba1a11b6e5e5a4361e | [
"MIT"
] | 1 | 2016-12-04T04:50:48.000Z | 2016-12-04T04:50:48.000Z | ; These constants are for the segment types stored in the image headers
%define PT_NULL 0
%define PT_LOAD 1
%define PT_DYNAMIC 2
%define PT_INTERP 3
%define PT_NOTE 4
%define PT_SHLIB 5
%define PT_PHDR 6
%define PT_TLS 7 /* Thread local storage segment */
%define PT_LOOS 0x60000000 /* OS-specific */
%define PT_HIOS 0x6fffffff /* OS-specific */
%define PT_LOPROC 0x70000000
%define PT_HIPROC 0x7fffffff
%define PT_GNU_EH_FRAME 0x6474e550
%define PT_GNU_STACK (PT_LOOS + 0x474e551)
; These constants define the different elf file types
%define ET_NONE 0
%define ET_REL 1
%define ET_EXEC 2
%define ET_DYN 3
%define ET_CORE 4
%define ET_LOPROC 0xff00
%define ET_HIPROC 0xffff
; These constants define the various ELF target machines
%define EM_NONE 0
%define EM_M32 1
%define EM_SPARC 2
%define EM_386 3
%define EM_68K 4
%define EM_88K 5
%define EM_860 6
%define EM_MIPS 7
%define EM_PARISC 8
%define EM_SPARC32PLUS 9
%define EM_PPC 10
%define EM_PPC64 11
%define EM_S390 12
%define EM_ARM 13
%define EM_SH 14
%define EM_SPARCV9 15
%define EM_IA_64 16
%define EM_X86_64 17
%define EM_VAX 18
%define EI_NIDENT 16
struc Elf32_Ehdr
.e_ident: resb 16
.e_type: resw 1
.e_machine: resw 1
.e_version: resd 1
.e_entry: resd 1
.e_phoff: resd 1
.e_shoff: resd 1
.e_flags: resd 1
.e_ehsize: resw 1
.e_phentsize: resw 1
.e_phnum: resw 1
.e_shentsize: resw 1
.e_shnum: resw 1
.e_shstrndx: resw 1
.size:
endstruc
; These constants define the permissions on sections in the program
; header, p_flags.
%define PF_R 0x4
%define PF_W 0x2
%define PF_X 0x1
struc Elf32_Phdr
.p_type: resd 1
.p_offset: resd 1
.p_vaddr: resd 1
.p_paddr: resd 1
.p_filesz: resd 1
.p_memsz: resd 1
.p_flags: resd 1
.p_align: resd 1
.size:
endstruc
%define EI_MAG0 0 ; e_ident[] indexes
%define EI_MAG1 1
%define EI_MAG2 2
%define EI_MAG3 3
%define EI_CLASS 4
%define EI_DATA 5
%define EI_VERSION 6
%define EI_OSABI 7
%define EI_PAD 8
%define ELFMAG0 0x7f ; EI_MAG
%define ELFMAG1 'E'
%define ELFMAG2 'L'
%define ELFMAG3 'F'
%define ELFMAG `\177ELF`
%define SELFMAG 4
%define ELFCLASSNONE 0 ; EI_CLASS
%define ELFCLASS32 1
%define ELFCLASS64 2
%define ELFCLASSNUM 3
%define ELFDATANONE 0 ; e_ident[EI_DATA]
%define ELFDATA2LSB 1
%define ELFDATA2MSB 2
%define EV_NONE 0 ; e_version, EI_VERSION
%define EV_CURRENT 1
%define EV_NUM 2
%define ELFOSABI_NONE 0
%define ELFOSABI_LINUX 3
| 24.295082 | 71 | 0.612686 |
883532517a5117a12a03cc856f4e7ca4db8d7854 | 2,894 | asm | Assembly | externals/mpir-3.0.0/mpn/x86/pentium/copyd.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 1 | 2018-08-14T03:52:21.000Z | 2018-08-14T03:52:21.000Z | externals/mpir-3.0.0/mpn/x86/pentium/copyd.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | null | null | null | externals/mpir-3.0.0/mpn/x86/pentium/copyd.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | null | null | null | dnl Intel Pentium mpn_copyd -- copy limb vector, decrementing.
dnl Copyright 1996, 2001, 2002, 2006 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 2.1 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with the GNU MP Library; see the file COPYING.LIB. If
dnl not, write to the Free Software Foundation, Inc., 51 Franklin Street,
dnl Fifth Floor, Boston, MA 02110-1301, USA.
include(`../config.m4')
C P5: 1.25 cycles/limb
C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
C
C See comments in copyi.asm.
defframe(PARAM_SIZE,12)
defframe(PARAM_SRC, 8)
defframe(PARAM_DST, 4)
TEXT
ALIGN(8)
PROLOGUE(mpn_copyd)
deflit(`FRAME',0)
movl PARAM_SRC, %eax
movl PARAM_SIZE, %ecx
pushl %esi FRAME_pushl()
pushl %edi FRAME_pushl()
leal -4(%eax,%ecx,4), %eax C &src[size-1]
movl PARAM_DST, %edx
subl $7, %ecx C size-7
jle L(end)
movl 28-4(%edx,%ecx,4), %esi C prefetch cache, dst[size-1]
nop
L(top):
C eax src, decrementing
C ebx
C ecx counter, limbs
C edx dst
C esi scratch
C edi scratch
C ebp
movl 28-32(%edx,%ecx,4), %esi C prefetch dst cache line
subl $8, %ecx
movl (%eax), %esi C read words pairwise
movl -4(%eax), %edi
movl %esi, 56(%edx,%ecx,4) C store words pairwise
movl %edi, 52(%edx,%ecx,4)
movl -8(%eax), %esi
movl -12(%eax), %edi
movl %esi, 48(%edx,%ecx,4)
movl %edi, 44(%edx,%ecx,4)
movl -16(%eax), %esi
movl -20(%eax), %edi
movl %esi, 40(%edx,%ecx,4)
movl %edi, 36(%edx,%ecx,4)
movl -24(%eax), %esi
movl -28(%eax), %edi
movl %esi, 32(%edx,%ecx,4)
movl %edi, 28(%edx,%ecx,4)
leal -32(%eax), %eax
jg L(top)
L(end):
C ecx -7 to 0, representing respectively 0 to 7 limbs remaining
C eax src end
C edx dst, next location to store
addl $4, %ecx
jle L(no4)
movl (%eax), %esi
movl -4(%eax), %edi
movl %esi, 8(%edx,%ecx,4)
movl %edi, 4(%edx,%ecx,4)
movl -8(%eax), %esi
movl -12(%eax), %edi
movl %esi, (%edx,%ecx,4)
movl %edi, -4(%edx,%ecx,4)
subl $16, %eax
subl $4, %ecx
L(no4):
addl $2, %ecx
jle L(no2)
movl (%eax), %esi
movl -4(%eax), %edi
movl %esi, (%edx,%ecx,4)
movl %edi, -4(%edx,%ecx,4)
subl $8, %eax
subl $2, %ecx
L(no2):
jnz L(done)
movl (%eax), %ecx
movl %ecx, (%edx) C risk of cache bank clash here
L(done):
popl %edi
popl %esi
ret
EPILOGUE()
| 20.971014 | 74 | 0.67208 |
0d89d24bdf3ae2ed2181e3d7226cc8103370ac0d | 312 | asm | Assembly | libsrc/games/z88/bit_close.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | 1 | 2018-09-04T23:07:24.000Z | 2018-09-04T23:07:24.000Z | libsrc/games/z88/bit_close.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/games/z88/bit_close.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; $Id: bit_close.asm,v 1.2 2002/04/17 21:30:24 dom Exp $
;
; Z88 1 bit sound functions
;
; void bit_close();
;
; Stefano Bodrato - 28/9/2001
; Based on the Dominic Morris' code
;
XLIB bit_close
INCLUDE "#interrpt.def"
XREF snd_asave
.bit_close
ld a,(snd_asave)
ret
| 15.6 | 56 | 0.599359 |
7decabf2e366d02a3f7c95ab6e1a7337207b7f65 | 18,722 | asm | Assembly | derzforth.asm | aw/derzforth | 4542c4c43388e8b647fd5183f89eb65c12a17fac | [
"MIT"
] | 21 | 2020-01-14T00:10:27.000Z | 2021-12-03T19:40:57.000Z | derzforth.asm | aw/derzforth | 4542c4c43388e8b647fd5183f89eb65c12a17fac | [
"MIT"
] | 14 | 2021-05-11T02:59:46.000Z | 2021-11-21T06:32:09.000Z | derzforth.asm | aw/derzforth | 4542c4c43388e8b647fd5183f89eb65c12a17fac | [
"MIT"
] | 5 | 2020-01-24T01:57:40.000Z | 2021-11-08T01:43:34.000Z | # jump to "main" since programs execute top to bottom
# we do this to enable writing helper funcs at the top
tail main
# pull in the necessary defs / funcs for a given board
# (based on the assembler's search path)
#
# this file should define:
# RAM_BASE_ADDR
# RAM_SIZE
# ROM_BASE_ADDR
# ROM_SIZE
#
# and implement:
# serial_init(a0: baud_rate)
# serial_getc() -> a0: char
# serial_putc(a0: char)
include board.asm
# 16KB Memory Map
# 0x0000 |----------------|
# | |
# | |
# | |
# | Interpreter |
# | + | 12KB
# | Dictionary |
# | |
# | |
# | |
# 0x3000 |----------------|
# | TIB | 1KB
# 0x3400 |----------------|
# | Return Stack | 1KB (256 calls deep)
# 0x3800 |----------------|
# | |
# | Data Stack | 2KB (512 elements)
# | |
# 0x4000 |----------------|
INTERPRETER_BASE_ADDR = 0x0000
TIB_BASE_ADDR = 0x3000
RETURN_STACK_BASE_ADDR = 0x3400
DATA_STACK_BASE_ADDR = 0x3800
INTERPRETER_SIZE = 0x3000 # 12KB
TIB_SIZE = 0x0400 # 1KB
RETURN_STACK_SIZE = 0x0400 # 1KB
DATA_STACK_SIZE = 0x0800 # 2KB
DERZFORTH_SIZE = 0x4000 # 16KB
HEAP_BASE_ADDR = RAM_BASE_ADDR + DERZFORTH_SIZE
HEAP_SIZE = RAM_SIZE - DERZFORTH_SIZE
SERIAL_BAUD_RATE = 115200
# word flags (top 2 bits of hash)
FLAGS_MASK = 0xc0000000
F_IMMEDIATE = 0x80000000
F_HIDDEN = 0x40000000
# "The Classical Forth Registers"
W = s0 # working register
IP = gp # interpreter pointer
DSP = sp # data stack pointer
RSP = tp # return stack pointer
# variable registers
STATE = s1 # 0 = execute, 1 = compile
TIB = s2 # text input buffer addr
TBUF = s3 # text buffer addr
TLEN = s4 # text buffer length
TPOS = s5 # text buffer current position
HERE = s6 # next dict entry addr
LATEST = s7 # latest dict entry addr
# extra saved regs (use for whatever)
# use one of these for heap size tracking?
SAVED0 = s8
SAVED1 = s9
SAVED2 = s10
SAVED3 = s11
# Func: memclr
# Arg: a0 = buffer addr
# Arg: a1 = buffer size
# Ret: none
memclr:
beqz a1, memclr_done # loop til size == 0
sb 0, 0(a0) # 0 -> [addr]
addi a0, a0, 1 # addr += 1
addi a1, a1, -1 # size -= 1
j memclr # repeat
memclr_done:
ret
# Func: memcpy
# Arg: a0 = src buffer addr
# Arg: a1 = dst buffer addr
# Arg: a2 = buffer size
# Ret: none
memcpy:
beqz a2, memcpy_done # loop til size == 0
lb t0, 0(a0) # t0 <- [src]
sb t0, 0(a1) # t0 -> [dst]
addi a0, a0, 1 # src += 1
addi a1, a1, 1 # dst += 1
addi a2, a2, -1 # size -= 1
j memcpy # repeat
memcpy_done:
ret
# Func: strtok
# Arg: a0 = buffer addr
# Arg: a1 = buffer size
# Ret: a0 = token addr (0 if not found)
# Ret: a1 = token size (0 if not found)
# Ret: a2 = total bytes consumed (0 if not found)
strtok:
addi t0, zero, ' ' # t0 = whitespace threshold
mv t2, a0 # save buffer's start addr for later
strtok_skip_whitespace:
beqz a1, strtok_not_found # not found if we run out of chars
lbu t1, 0(a0) # pull the next char
bgtu t1, t0, strtok_scan # if not whitespace, start the scan
addi a0, a0, 1 # else advance ptr by one char
addi a1, a1, -1 # and reduce size by 1
j strtok_skip_whitespace # repeat
strtok_scan:
mv t3, a0 # save the token's start addr for later
strtok_scan_loop:
beqz a1, strtok_not_found # early exit if reached EOB
lbu t1, 0(a0) # grab the next char
bleu t1, t0, strtok_found # if found whitespace, we are done
addi a0, a0, 1 # else advance ptr by one char
addi a1, a1, -1 # and reduce size by 1
j strtok_scan_loop # repeat
strtok_found:
sub a2, a0, t2 # a2 = (end - buffer) = bytes consumed
addi a2, a2, 1 # add one to include the delimiter
sub a1, a0, t3 # a1 = (end - start) = token size
mv a0, t3 # a0 = start = token addr
ret
strtok_not_found:
addi a0, zero, 0 # a0 = 0 (not found)
addi a1, zero, 0 # a1 = 0 (not found)
addi a2, zero, 0 # a2 = 0 (not found)
ret
# Func: lookup
# Arg: a0 = addr of latest entry in word dict
# Arg: a1 = hash of word name to lookup
# Ret: a0 = addr of found word (0 if not found)
lookup:
beqz a0, lookup_not_found # not found if next word addr is 0 (end of dict)
lw t0, 4(a0) # t0 = hash of word name
# skip if the word is hidden
li t1, F_HIDDEN # load hidden flag into t1
and t1, t0, t1 # isolate hidden bit in word hash
bnez t1, lookup_next # if hidden, skip this word and try the next one
li t1, ~FLAGS_MASK # t1 = inverted FLAGS_MASK
and t0, t0, t1 # ignore flags when comparing hashes
beq t0, a1, lookup_found # done if hash (dict) matches hash (lookup)
lookup_next:
lw a0, 0(a0) # follow link to next word in dict
j lookup # repeat
lookup_found:
# a0 is already pointing at the current dict entry
ret
lookup_not_found:
addi a0, zero, 0 # a0 = 0 (not found)
ret
# Func: djb2_hash
# Arg: a0 = buffer addr
# Arg: a1 = buffer size
# Ret: a0 = hash value
djb2_hash:
li t0, 5381 # t0 = hash value
li t1, 33 # t1 = multiplier
djb2_hash_loop:
beqz a1, djb2_hash_done
lbu t2, 0(a0) # c <- [addr]
mul t0, t0, t1 # h = h * 33
add t0, t0, t2 # h = h + c
addi a0, a0, 1 # addr += 1
addi a1, a1, -1 # size -= 1
j djb2_hash_loop # repeat
djb2_hash_done:
li t1, ~FLAGS_MASK # clear the top two bits (used for word flags)
and a0, t0, t1 # a0 = final hash value
ret
###
### interpreter
###
main:
li a0, SERIAL_BAUD_RATE
call serial_init
# setup HERE and LATEST vars (will be in RAM)
li HERE, %position(here, RAM_BASE_ADDR)
li LATEST, %position(latest, RAM_BASE_ADDR)
# copy program from ROM to RAM
li a0, ROM_BASE_ADDR
li a1, RAM_BASE_ADDR
li a2, %position(here, 0)
call memcpy
# jump to reset (in RAM now)
li t0, %position(reset, RAM_BASE_ADDR)
jr t0
error:
# print " ?" and fall into reset
li a0, ' '
call serial_putc
li a0, '?'
call serial_putc
li a0, '\n'
call serial_putc
reset:
# set working reg to zero
li W, 0
# set interpreter state reg to 0 (execute)
li STATE, 0
# setup data stack ptr
li DSP, RAM_BASE_ADDR + DATA_STACK_BASE_ADDR
# setup return stack ptr
li RSP, RAM_BASE_ADDR + RETURN_STACK_BASE_ADDR
# setup text input buffer addr
li TIB, RAM_BASE_ADDR + TIB_BASE_ADDR
j interpreter
interpreter_ok:
# print "ok" and fall into interpreter
li a0, ' '
call serial_putc
li a0, 'o'
call serial_putc
li a0, 'k'
call serial_putc
li a0, '\n'
call serial_putc
interpreter:
tib_clear:
mv a0, TIB # a0 = buffer addr
li a1, TIB_SIZE # a1 = buffer size
call memclr # clear out the text input buffer
tib_init:
mv TBUF, TIB # set TBUF to TIB
li TLEN, 0 # set TLEN to 0
li TPOS, 0 # set TPOS to 0
interpreter_repl:
# read and echo a single char
call serial_getc
call serial_putc
# check for single-line comment
li t0, '\\' # comments start with \ char
beq a0, t0, interpreter_skip_comment # skip the comment if \ is found
# check for bounded comments (parens)
li t0, 0x28 # bounded comments start with ( char
beq a0, t0, interpreter_skip_parens # skip the comment if ( is found
# check for backspace
li t0, '\b'
bne a0, t0, interpreter_repl_char
beqz TLEN, interpreter_repl # ignore BS if TLEN is zero
# if backspace, dec TLEN and send a space and another backspace
# this simulates clearing the char on the client side
addi TLEN, TLEN, -1
li a0, ' '
call serial_putc
li a0, '\b'
call serial_putc
j interpreter_repl
interpreter_skip_comment:
# read and echo a single char
call serial_getc
call serial_putc
# skip char until newline is found
li t0, '\n' # newlines start with \n
bne a0, t0, interpreter_skip_comment # loop back to SKIP comment unless newline
j interpreter_repl
interpreter_skip_parens:
# read and echo a single char
call serial_getc
call serial_putc
# skip char until closing parens is found
li t0, 0x29 # closing parens start with )
bne a0, t0, interpreter_skip_parens # loop back to SKIP parens unless closing parens
j interpreter_repl
interpreter_repl_char:
add t0, TBUF, TLEN # t0 = dest addr for this char in TBUF
li t1, TIB_SIZE # t1 = buffer size
bge TLEN, t1, error # bounds check on TBUF
sb a0, 0(t0) # write char into TBUF
addi TLEN, TLEN, 1 # TLEN += 1
addi t0, zero, '\n' # t0 = newline char
beq a0, t0, interpreter_interpret # interpret the input upon newline
j interpreter_repl
# TODO: allow multiline word defs
interpreter_interpret:
# grab the next token
add a0, TBUF, TPOS # a0 = buffer addr
sub a1, TLEN, TPOS # a1 = buffer size
call strtok # a0 = str addr, a1 = str size, a2 = bytes consumed
beqz a0, interpreter_ok # loop back to REPL if input is used up
add TPOS, TPOS, a2 # update TPOS based on strtok bytes consumed
# hash the current token
call djb2_hash # a0 = str hash
# lookup the hash in the word dict
mv a1, a0 # a1 = hash of word name
mv a0, LATEST # a0 = addr of latest word
call lookup # a0 = addr of found word (0 if not found)
beqz a0, error # check for error from lookup
# load and isolate the immediate flag
lw t0, 4(a0) # load word hash into t0
li t1, F_IMMEDIATE # load immediate flag into t1
and t0, t0, t1 # isolate immediate bit in word hash
# decide whether to compile or execute the word
bnez t0, interpreter_execute # execute if word is immediate...
beqz STATE, interpreter_execute # or if STATE is 0 (execute)
interpreter_compile:
addi t0, a0, 8 # t0 = addr of word's code field
sw t0, 0(HERE) # write addr of word's code field to current definition
addi HERE, HERE, 4 # HERE += 4
j interpreter_interpret
interpreter_execute:
# setup double-indirect addr back to interpreter loop
li IP, %position(interpreter_addr_addr, RAM_BASE_ADDR)
addi W, a0, 8 # W = addr of word's code field
lw t0, 0(W) # t0 = addr of word's body
jr t0 # execute the word
align 4
interpreter_addr:
dw %position(interpreter_interpret, RAM_BASE_ADDR)
interpreter_addr_addr:
dw %position(interpreter_addr, RAM_BASE_ADDR)
# standard forth routine: next
next:
lw W, 0(IP) # W <- [IP]
addi IP, IP, 4 # IP += 4
lw t0, 0(W) # t0 <- [W]
jr t0
# standard forth routine: enter
enter:
sw IP, 0(RSP) # IP -> [RSP]
addi RSP, RSP, 4 # RSP += 4
addi IP, W, 4 # IP = W + 4 (skip code field)
j next
###
### dictionary
###
align 4
word_exit:
dw 0
dw 0x3c967e3f # djb2_hash('exit')
code_exit:
dw %position(body_exit, RAM_BASE_ADDR)
body_exit:
addi RSP, RSP, -4 # dec return stack ptr
lw IP, 0(RSP) # load next addr into IP
j next
align 4
word_colon:
dw %position(word_exit, RAM_BASE_ADDR)
dw 0x0002b5df # djb2_hash(':')
code_colon:
dw %position(body_colon, RAM_BASE_ADDR)
body_colon:
# grab the next token
add a0, TBUF, TPOS # a0 = buffer addr
sub a1, TLEN, TPOS # a1 = buffer size
call strtok # a0 = str addr, a1 = str size
beqz a0, error # error and reset if strtok fails
add TPOS, TPOS, a2 # update TPOS based on strtok bytes consumed
# hash the current token
call djb2_hash # a0 = str hash
# set the hidden flag
li t0, F_HIDDEN # load hidden flag into t0
or a0, a0, t0 # hide the word
# write the word's link and hash
sw LATEST, 0(HERE) # write link to prev word (LATEST -> [HERE])
sw a0, 4(HERE) # write word name hash (hash -> [HERE + 4])
mv LATEST, HERE # set LATEST = HERE (before HERE gets modified)
addi HERE, HERE, 8 # move HERE past link and hash (to start of code)
# set word's code field to "enter"
li t0, %position(enter, RAM_BASE_ADDR)
sw t0, 0(HERE) # write addr of "enter" to word definition
addi HERE, HERE, 4 # HERE += 4
addi STATE, zero, 1 # STATE = 1 (compile)
j next
align 4
word_semi:
dw %position(word_colon, RAM_BASE_ADDR)
dw 0x0002b5e0 | F_IMMEDIATE # djb2_hash(';') or'd w/ F_IMMEDIATE flag
code_semi:
dw %position(body_semi, RAM_BASE_ADDR)
body_semi:
# clear the hidden flag
lw t0, 4(LATEST) # load word name hash (t0 <- [LATEST+4])
li t1, ~F_HIDDEN # load hidden flag mask into t1
and t0, t0, t1 # reveal the word
sw t0, 4(LATEST) # write word name hash (t0 -> [LATEST+4])
li t0, %position(code_exit, RAM_BASE_ADDR)
sw t0, 0(HERE) # write addr of "code_exit" to word definition
addi HERE, HERE, 4 # HERE += 4
addi STATE, zero, 0 # STATE = 0 (execute)
j next
align 4
word_at:
dw %position(word_semi, RAM_BASE_ADDR)
dw 0x0002b5e5 # djb2_hash('@')
code_at:
dw %position(body_at, RAM_BASE_ADDR)
body_at:
addi DSP, DSP, -4 # dec data stack ptr
lw t0, 0(DSP) # pop addr into t0
lw t0, 0(t0) # load value from addr
sw t0, 0(DSP) # push value onto stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
word_ex:
dw %position(word_at, RAM_BASE_ADDR)
dw 0x0002b5c6 # djb2_hash('!')
code_ex:
dw %position(body_ex, RAM_BASE_ADDR)
body_ex:
addi DSP, DSP, -8 # dec data stack ptr
lw t0, 4(DSP) # pop addr into t0
lw t1, 0(DSP) # pop value into t1
sw t1, 0(t0) # store value at addr
j next
align 4
word_spat:
dw %position(word_ex, RAM_BASE_ADDR)
dw 0x0b88aac8 # djb2_hash('sp@')
code_spat:
dw %position(body_spat, RAM_BASE_ADDR)
body_spat:
mv t0, DSP # copy next DSP addr
addi t0, t0, -4 # dec to reach current DSP addr
sw t0 0(DSP) # push addr onto data stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
word_rpat:
dw %position(word_spat, RAM_BASE_ADDR)
dw 0x0b88a687 # djb2_hash('rp@')
code_rpat:
dw %position(body_rpat, RAM_BASE_ADDR)
body_rpat:
mv t0, RSP # copy next RSP addr
addi t0, t0, -4 # dec to reach current RSP addr
sw t0 0(DSP) # push addr onto data stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
word_zeroeq:
dw %position(word_rpat, RAM_BASE_ADDR)
dw 0x005970b2 # djb2_hash('0=')
code_zeroeq:
dw %position(body_zeroeq, RAM_BASE_ADDR)
body_zeroeq:
addi DSP, DSP, -4 # dec data stack ptr
lw t0, 0(DSP) # pop value into t0
addi t1, zero, 0 # setup initial result as 0
bnez t0, notzero # 0 if not zero
addi t1, t1, -1 # -1 if zero
notzero:
sw t1, 0(DSP) # push value onto stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
word_plus:
dw %position(word_zeroeq, RAM_BASE_ADDR)
dw 0x0002b5d0 # djb2_hash('+')
code_plus:
dw %position(body_plus, RAM_BASE_ADDR)
body_plus:
addi DSP, DSP, -8 # dec data stack ptr
lw t0, 4(DSP) # pop first value into t0
lw t1, 0(DSP) # pop second value into t1
add t0, t0, t1 # ADD the values together into t0
sw t0, 0(DSP) # push value onto stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
word_nand:
dw %position(word_plus, RAM_BASE_ADDR)
dw 0x3c9b0c66 # djb2_hash('nand')
code_nand:
dw %position(body_nand, RAM_BASE_ADDR)
body_nand:
addi DSP, DSP, -8 # dec data stack ptr
lw t0, 4(DSP) # pop first value into t0
lw t1, 0(DSP) # pop second value into t1
and t0, t0, t1 # AND the values together into t0
not t0, t0 # NOT t0 (invert the bits)
sw t0, 0(DSP) # push value onto stack
addi DSP, DSP, 4 # inc data stack ptr
j next
#STATE = s1 # 0 = execute, 1 = compile
#TIB = s2 # text input buffer addr
#TBUF = s3 # text buffer addr
#TLEN = s4 # text buffer length
#TPOS = s5 # text buffer current position
#HERE = s6 # next dict entry addr
#LATEST = s7 # latest dict entry addr
align 4
word_state:
dw %position(word_nand, RAM_BASE_ADDR)
dw 0x10614a06 # djb2_hash('state')
code_state:
dw %position(body_state, RAM_BASE_ADDR)
body_state:
sw STATE, 0(DSP)
addi DSP, DSP, 4
j next
align 4
word_tib:
dw %position(word_state, RAM_BASE_ADDR)
dw 0x0b88ae44 # djb2_hash('tib')
code_tib:
dw %position(body_tib, RAM_BASE_ADDR)
body_tib:
sw TIB, 0(DSP)
addi DSP, DSP, 4
j next
align 4
word_toin:
dw %position(word_tib, RAM_BASE_ADDR)
dw 0x0b87c89a # djb2_hash('>in')
code_toin:
dw %position(body_toin, RAM_BASE_ADDR)
body_toin:
sw TPOS, 0(DSP)
addi DSP, DSP, 4
j next
align 4
word_here:
dw %position(word_toin, RAM_BASE_ADDR)
dw 0x3c97d3a9 # djb2_hash('here')
code_here:
dw %position(body_here, RAM_BASE_ADDR)
body_here:
sw HERE, 0(DSP)
addi DSP, DSP, 4
j next
align 4
word_latest:
dw %position(word_here, RAM_BASE_ADDR)
dw 0x0ae8ca72 # djb2_hash('latest')
code_latest:
dw %position(body_latest, RAM_BASE_ADDR)
body_latest:
sw LATEST, 0(DSP)
addi DSP, DSP, 4
j next
align 4
word_key:
dw %position(word_latest, RAM_BASE_ADDR)
dw 0x0b88878e # djb2_hash('key')
code_key:
dw %position(body_key, RAM_BASE_ADDR)
body_key:
call serial_getc # read char into a0 via serial_getc
sw a0, 0(DSP) # push char onto stack
addi DSP, DSP, 4 # inc data stack ptr
j next
align 4
latest: # mark the latest builtin word
word_emit:
dw %position(word_key, RAM_BASE_ADDR)
dw 0x3c964f74 # djb2_hash('emit')
code_emit:
dw %position(body_emit, RAM_BASE_ADDR)
body_emit:
addi DSP, DSP, -4 # dec data stack ptr
lw a0, 0(DSP) # pop char into a1
call serial_putc # emit the char via serial_putc
j next
align 4
here: # next new word will go here
| 28.626911 | 90 | 0.608589 |
8173bb205594f22aa6943a62f3cdefd130eb35cf | 199 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_m_tapein_flags_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_m_tapein_flags_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_m_tapein_flags_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned char esx_m_tapein_flags(uint8_t flags)
SECTION code_esxdos
PUBLIC _esx_m_tapein_flags_fastcall
EXTERN asm_esx_m_tapein_flags
defc _esx_m_tapein_flags_fastcall = asm_esx_m_tapein_flags
| 19.9 | 58 | 0.884422 |
d8cd6f63c74b0dc8691b1fa89881bfc9afb0f24c | 371 | asm | Assembly | oeis/074/A074766.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/074/A074766.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/074/A074766.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A074766: a(n) = prime(2n) - 2*prime(n) - n.
; Submitted by Christian Krause
; -2,-1,0,1,2,5,2,7,6,3,6,3,6,7,4,9,4,11,10,11,14,13,10,21,10,11,18,21,24,25,8,17,10,25,16,21,22,19,24,23,22,29,18,27,24,35,22,9,18,33,40,39,42,37,32,31,24,41,34,37,46,35,24,33,42,43,28,27,24,41,44,37,32,37,30,39,32
mov $1,$0
seq $0,66066 ; a(n) = prime(2*n) - 2*prime(n).
sub $0,$1
sub $0,1
| 41.222222 | 215 | 0.606469 |
07d6497deddbb6c8c163ae0bd1dc4ce9502b6293 | 254 | asm | Assembly | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_scroll_up_pix_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_scroll_up_pix_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_scroll_up_pix_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ; void tshr_scroll_up_pix(uchar prows, uchar pix)
SECTION code_clib
SECTION code_arch
PUBLIC tshr_scroll_up_pix_callee
EXTERN asm0_tshr_scroll_up_pix
tshr_scroll_up_pix_callee:
pop af
pop hl
pop de
push af
jp asm0_tshr_scroll_up_pix
| 14.111111 | 49 | 0.799213 |
111aa2f49beabbd7a4f4fa40db3ed734ebf77a35 | 1,012 | asm | Assembly | main.asm | wyznaga/cis-336-assn-6 | a89a6f3c269e4495f1c26d54d24e62d70f14913d | [
"Unlicense"
] | null | null | null | main.asm | wyznaga/cis-336-assn-6 | a89a6f3c269e4495f1c26d54d24e62d70f14913d | [
"Unlicense"
] | 4 | 2018-04-18T07:06:21.000Z | 2018-04-18T19:17:03.000Z | main.asm | wyznaga/cis-336-assn-6 | a89a6f3c269e4495f1c26d54d24e62d70f14913d | [
"Unlicense"
] | null | null | null | ;this is a comment
COPY START 0
FIRST MOV RETADR,%RL ; save Return Address
MOV %RB,#LENGTH
BASE LENGTH
CLOOP +JSUB RDREC
MOV %RA,LENGTH
COMP #0
JEQ ENDFIL
+JSUB WRREC
J CLOOP
ENDFIL MOV %RA,EOF
MOV BUFFER,%RA
MOV %RA,#3
MOV LENGTH,%RA
+JSUB WRREC
J @RETADR ; Return back to the caller
EOF BYTE C'EOF'
RETADR RESW 1
LENGTH RESW 1
BUFFER RESB 4096
RDREC CLEAR %RX
CLEAR %RA
CLEAR %RS
+MOV %RT,#4096
RLOOP TD INPUT
JEQ RLOOP
RD INPUT
COMPR %RA,%RS
JEQ EXIT
STCH BUFFER[%RX]
TIXR %RT
JLT RLOOP
EXIT MOV LENGTH,%RX
RSUB
INPUT BYTE X'F3'
WRREC CLEAR %RX
MOV %RT,LENGTH
WLOOP TD OUTPUT
JEQ WLOOP
LDCH BUFFER[%RX]
WD OUTPUT
TIXR %RT
JLT WLOOP
RSUB
OUTPUT BYTE X'05'
END FIRST
| 21.083333 | 51 | 0.490119 |
bc0d4ff9fe07dabb688e789affddb070c9e781a7 | 624 | asm | Assembly | oeis/053/A053110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/053/A053110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/053/A053110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A053110: Expansion of (-1 + 1/(1-7*x)^7)/(49*x); related to A036226.
; 1,28,588,10290,158466,2218524,28840812,353299947,4121832715,46164526408,499416240232,5243870522436,53648829191076,536488291910760,5257585260725448,50604258134482437,479252091744216021,4473019522946016196,41198864027134359700,374909662646922673270,3374186963822304059430,30060938404962345256740,265320456356841569005140,2321553993122363728794975,20151088660302117165940383,173609379227218240198870992,1485324688943978277257007376,12625259856023815356684562696,106661678093994302151300615880
add $0,1
seq $0,36226 ; Expansion of 1/(1-7*x)^7.
div $0,49
| 89.142857 | 491 | 0.865385 |
6cdc974503b3876abb307581ef1dacff26e0fa3b | 475 | asm | Assembly | debug_server/src/execute_instruction_hook.asm | SpaceManiac/auxtools | 21c7b18b21344709c06eeb807b5f60edefe0c326 | [
"MIT"
] | null | null | null | debug_server/src/execute_instruction_hook.asm | SpaceManiac/auxtools | 21c7b18b21344709c06eeb807b5f60edefe0c326 | [
"MIT"
] | null | null | null | debug_server/src/execute_instruction_hook.asm | SpaceManiac/auxtools | 21c7b18b21344709c06eeb807b5f60edefe0c326 | [
"MIT"
] | null | null | null | .MODEL FLAT, C
.CODE
EXTERN execute_instruction_original : PTR
handle_instruction PROTO, opcode: DWORD
; EAX = [CURRENT_EXECUTION_CONTEXT]
execute_instruction_hook PROC PUBLIC
; Give rust a chance to handle the instruction. Leaves [CURRENT_EXECUTION_CONTEXT] in EAX.
PUSH ECX
PUSH EDX
INVOKE handle_instruction, EAX
POP EDX
POP ECX
; Jump to BYOND's default do_instruction.
MOV ECX, execute_instruction_original
JMP ECX
execute_instruction_hook ENDP
END | 22.619048 | 92 | 0.793684 |
c010902f7ad675a760ccbc4ab6487eae198bf429 | 561 | asm | Assembly | programs/oeis/224/A224613.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/224/A224613.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/224/A224613.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A224613: a(n) = sigma(6*n).
; 12,28,39,60,72,91,96,124,120,168,144,195,168,224,234,252,216,280,240,360,312,336,288,403,372,392,363,480,360,546,384,508,468,504,576,600,456,560,546,744,504,728,528,720,720,672,576,819,684,868,702,840,648,847,864,992,780,840,720,1170,744,896,960,1020,1008,1092,816,1080,936,1344,864,1240,888,1064,1209,1200,1152,1274,960,1512,1092,1176,1008,1560,1296,1232,1170,1488,1080,1680,1344,1440,1248,1344,1440,1651,1176,1596,1440,1860
mul $0,6
add $0,5
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
| 80.142857 | 427 | 0.72549 |
f39dc178694283f31462d58855c7ec1021678847 | 141 | asm | Assembly | engine/engine/pads/implementation/start-poll.asm | neomura/atmega328p-cartridge | e7152425e5253cd4e513cad41dc03d306003e91e | [
"MIT"
] | null | null | null | engine/engine/pads/implementation/start-poll.asm | neomura/atmega328p-cartridge | e7152425e5253cd4e513cad41dc03d306003e91e | [
"MIT"
] | 2 | 2021-04-17T09:31:24.000Z | 2021-04-17T09:31:53.000Z | engine/engine/pads/implementation/start-poll.asm | neomura/atmega328p-cartridge | e7152425e5253cd4e513cad41dc03d306003e91e | [
"MIT"
] | null | null | null | ; The main loop should be finished with pad state now, so lower the pad latch line before we start polling it on a future line.
cbi PORTC, 5
| 47 | 127 | 0.765957 |
bcdd9b8eef2b21509b2daecea50f45a2cf61c4d2 | 4,979 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1380.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1380.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1380.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 %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x16433, %rsi
lea addresses_A_ht+0x1dd33, %rdi
nop
nop
sub $20070, %r11
mov $57, %rcx
rep movsb
nop
dec %r15
lea addresses_WC_ht+0x72cd, %rsi
lea addresses_WC_ht+0x13833, %rdi
nop
nop
nop
nop
add %r8, %r8
mov $73, %rcx
rep movsb
nop
sub $18966, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %rax
push %rbp
push %rbx
// Load
lea addresses_WC+0x19c4d, %r15
clflush (%r15)
nop
nop
nop
cmp $12064, %r8
movntdqa (%r15), %xmm1
vpextrq $1, %xmm1, %rbp
nop
nop
nop
nop
nop
and $9828, %r8
// Load
lea addresses_UC+0x4433, %r13
nop
nop
nop
nop
nop
dec %rax
movups (%r13), %xmm2
vpextrq $0, %xmm2, %r15
nop
nop
nop
cmp $61711, %rax
// Faulty Load
lea addresses_normal+0x18833, %r12
clflush (%r12)
nop
nop
nop
nop
nop
xor $42620, %r15
mov (%r12), %ax
lea oracles, %rbx
and $0xff, %rax
shlq $12, %rax
mov (%rbx,%rax,1), %rax
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 43.295652 | 2,999 | 0.661177 |
8b973ee0fb1ce1fff65b43aff388ceab50ff20e6 | 3,867 | asm | Assembly | Data/ships/Coriolis.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 9 | 2021-09-29T22:08:15.000Z | 2022-03-23T05:35:43.000Z | Data/ships/Coriolis.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-21T12:35:42.000Z | 2022-01-21T17:47:24.000Z | Data/ships/Coriolis.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-15T10:13:49.000Z | 2022-01-15T10:13:49.000Z | Coriolis: DB $00
DW $6400
DW CoriolisEdges
DB CoriolisEdgesSize
DB $00, $36
DB CoriolisVertSize /6
DB CoriolisVertSize
DB CoriolisEdgesCnt
DB $00, $00
DB CoriolisNormalsSize
DB $78, $F0, $00
DW CoriolisNormals
DB $00, $06
DW CoriolisVertices
DB ShipTypeStation,0 ; Type and Tactics
DB 0 ; can't anger arbitrarily needs to see innocent bystander shot
CoriolisVertices: DB $A0, $00, $A0, $1F, $10, $62
DB $00, $A0, $A0, $1F, $20, $83
DB $A0, $00, $A0, $9F, $30, $74
DB $00, $A0, $A0, $5F, $10, $54
DB $A0, $A0, $00, $5F, $51, $A6
DB $A0, $A0, $00, $1F, $62, $B8
DB $A0, $A0, $00, $9F, $73, $C8
DB $A0, $A0, $00, $DF, $54, $97
DB $A0, $00, $A0, $3F, $A6, $DB
DB $00, $A0, $A0, $3F, $B8, $DC
DB $A0, $00, $A0, $BF, $97, $DC
DB $00, $A0, $A0, $7F, $95, $DA
DB $0A, $1E, $A0, $5E, $00, $00
DB $0A, $1E, $A0, $1E, $00, $00
DB $0A, $1E, $A0, $9E, $00, $00
DB $0A, $1E, $A0, $DE, $00, $00
CoriolisVertSize: equ $ - CoriolisVertices
CoriolisEdges: DB $1F, $10, $00, $0C
DB $1F, $20, $00, $04
DB $1F, $30, $04, $08
DB $1F, $40, $08, $0C
DB $1F, $51, $0C, $10
DB $1F, $61, $00, $10
DB $1F, $62, $00, $14
DB $1F, $82, $14, $04
DB $1F, $83, $04, $18
DB $1F, $73, $08, $18
DB $1F, $74, $08, $1C
DB $1F, $54, $0C, $1C
DB $1F, $DA, $20, $2C
DB $1F, $DB, $20, $24
DB $1F, $DC, $24, $28
DB $1F, $D9, $28, $2C
DB $1F, $A5, $10, $2C
DB $1F, $A6, $10, $20
DB $1F, $B6, $14, $20
DB $1F, $B8, $14, $24
DB $1F, $C8, $18, $24
DB $1F, $C7, $18, $28
DB $1F, $97, $1C, $28
DB $1F, $95, $1C, $2C
DB $1E, $00, $30, $34
DB $1E, $00, $34, $38
DB $1E, $00, $38, $3C
DB $1E, $00, $3C, $30
CoriolisEdgesSize: equ $ - CoriolisEdges
CoriolisEdgesCnt: equ CoriolisEdgesSize/4
CoriolisNormals: DB $1F, $00, $00, $A0
DB $5F, $6B, $6B, $6B
DB $1F, $6B, $6B, $6B
DB $9F, $6B, $6B, $6B
DB $DF, $6B, $6B, $6B
DB $5F, $00, $A0, $00
DB $1F, $A0, $00, $00
DB $9F, $A0, $00, $00
DB $1F, $00, $A0, $00
DB $FF, $6B, $6B, $6B
DB $7F, $6B, $6B, $6B
DB $3F, $6B, $6B, $6B
DB $BF, $6B, $6B, $6B
DB $3F, $00, $00, $A0
CoriolisNormalsSize: equ $ - CoriolisNormals
CoriolisLen: equ $ - Coriolis
| 48.3375 | 130 | 0.29144 |
58577596999822490e979c4382c7d037ee63e3c5 | 732 | asm | Assembly | oeis/135/A135749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/135/A135749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/135/A135749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A135749: a(n) = Sum_{k=0..n} binomial(n,k)*(n-k)^k*k^k.
; Submitted by Christian Krause
; 1,1,3,19,217,3821,95761,3214975,137501505,7226764921,455941716481,33983083953611,2954163633223969,296027886705639973,33823026186790043841,4363561123325076879991,630392564294402819207041,101274793853629975032332657,17986188141203634890768065537,3512806897624880484355074389251,750898566084302946305926035292641,174910707209276283875281238448838621,44219043494204257999272396012046898113,12088258348666313365728324586063039238639,3561483035832999708208577265350989607626561
mov $1,1
mov $4,$0
lpb $0
sub $0,1
mov $2,$4
sub $2,$1
mul $2,$1
pow $2,$1
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
add $5,$3
lpe
mov $0,$5
add $0,1
| 34.857143 | 473 | 0.793716 |
96a3058400b719cfdddb4f95c93714862227d889 | 78 | asm | Assembly | asm/8085/tests/jumptest.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | 1 | 2017-02-02T12:48:33.000Z | 2017-02-02T12:48:33.000Z | asm/8085/tests/jumptest.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | null | null | null | asm/8085/tests/jumptest.asm | TomRegan/synedoche | b7e46089c8702d473853e118d3465b5b7038a639 | [
"Apache-2.0"
] | null | null | null | start:
ADI 10
JC middle
MOV B, A
NOP
NOP
NOP
middle:
JMP start
| 7.8 | 12 | 0.589744 |
ea52bdd12616a3881d66913e0bf2f03472ad201d | 319 | asm | Assembly | programs/oeis/070/A070448.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070448.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070448.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070448: a(n) = n^2 mod 26.
; 0,1,4,9,16,25,10,23,12,3,22,17,14,13,14,17,22,3,12,23,10,25,16,9,4,1,0,1,4,9,16,25,10,23,12,3,22,17,14,13,14,17,22,3,12,23,10,25,16,9,4,1,0,1,4,9,16,25,10,23,12,3,22,17,14,13,14,17,22,3,12,23,10,25,16,9,4,1,0,1,4,9,16,25,10,23,12,3,22,17,14,13,14,17,22,3,12,23,10,25
pow $0,2
mod $0,26
| 53.166667 | 268 | 0.60815 |
32b9bfd305967618147e05e99c54bf9b60f764db | 50 | asm | Assembly | libsrc/nc100/heapmaxfree.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/nc100/heapmaxfree.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/nc100/heapmaxfree.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | PUBLIC heapmaxfree
.heapmaxfree
jp 0xb88a
| 6.25 | 20 | 0.72 |
2427f2d05aa2e610f5b2427a3b1a234f1a6f30ef | 710 | asm | Assembly | oeis/085/A085110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/085/A085110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/085/A085110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A085110: a(1)=1, then add 1 multiply by 2 to get a(2), subtract 1 and multiply by 3 to get a(3), add 1 and multiply by 4 to get a(4) and so on.
; Submitted by Jon Maiga
; 1,4,9,40,195,1176,8225,65808,592263,5922640,65149029,781788360,10163248667,142285481352,2134282220265,34148515524256,580524763912335,10449445750422048,198539469258018893,3970789385160377880,83386577088367935459,1834504695944094580120,42193608006714175342737,1012646592161140208225712,25316164804028505205642775,658220284904741135346712176,17771947692428010654361228725,497614535387984298322114404328,14430821526251544651341317725483,432924645787546339540239531764520
mov $1,$0
seq $0,3048 ; a(n+1) = n*a(n) - (-1)^n.
add $1,1
mul $0,$1
| 78.888889 | 468 | 0.823944 |
a1590ded334b183b2683b3ef37726ac650b0247f | 985 | asm | Assembly | data/mapObjects/route10.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | data/mapObjects/route10.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | data/mapObjects/route10.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | Route10Object:
db $2c ; border block
db $4 ; warps
db $13, $b, $0, ROCK_TUNNEL_POKECENTER
db $11, $8, $0, ROCK_TUNNEL_1
db $35, $8, $2, ROCK_TUNNEL_1
db $27, $6, $0, POWER_PLANT
db $4 ; signs
db $13, $7, $7 ; Route10Text7
db $13, $c, $8 ; PokeCenterSignText
db $37, $9, $9 ; Route10Text9
db $29, $5, $a ; Route10Text10
db $6 ; objects
object SPRITE_BLACK_HAIR_BOY_2, $a, $2c, STAY, LEFT, $1, OPP_POKEMANIAC, $1
object SPRITE_HIKER, $3, $39, STAY, UP, $2, OPP_HIKER, $7
object SPRITE_BLACK_HAIR_BOY_2, $e, $40, STAY, LEFT, $3, OPP_POKEMANIAC, $2
object SPRITE_LASS, $7, $19, STAY, LEFT, $4, OPP_JR_TRAINER_F, $7
object SPRITE_HIKER, $3, $3d, STAY, DOWN, $5, OPP_HIKER, $8
object SPRITE_LASS, $7, $36, STAY, DOWN, $6, OPP_JR_TRAINER_F, $8
; warp-to
EVENT_DISP ROUTE_10_WIDTH, $13, $b ; ROCK_TUNNEL_POKECENTER
EVENT_DISP ROUTE_10_WIDTH, $11, $8 ; ROCK_TUNNEL_1
EVENT_DISP ROUTE_10_WIDTH, $35, $8 ; ROCK_TUNNEL_1
EVENT_DISP ROUTE_10_WIDTH, $27, $6 ; POWER_PLANT
| 33.965517 | 76 | 0.681218 |
027746b33233094c35059bc583c2c490eb22a890 | 133 | asm | Assembly | libsrc/stdlib/wpeek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdlib/wpeek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdlib/wpeek.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ; uint __FASTCALL__ wpeek(void *addr)
; 11.2006 aralbrec
PUBLIC wpeek
.wpeek
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ret
| 10.230769 | 37 | 0.609023 |
d238582e17dad81181ae0b6e867213d9dc4cab98 | 670 | asm | Assembly | oeis/265/A265103.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/265/A265103.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/265/A265103.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A265103: a(n) = binomial(10*n + 7, 5*n + 1)/(10*n + 7).
; Submitted by Christian Krause
; 1,728,482885,347993910,267058714626,214401560777712,177957899774070416,151516957974714281810,131614194900668669130060,116186564091895720987588128,103938666796148178180041038716,94020887900502277905668153549928,85855382816448334044679630209920925,79036904977718925909155287497750955800,73273701772429245251472017016776799518760,68350915606614806405694298154168496822754570,64107158187373735318999464042127881320814953860,60419077294823061345607113137232620913100101826400
mul $0,5
mov $2,$0
add $0,1
add $2,5
add $0,$2
bin $0,$2
mul $0,12
mov $1,$2
add $1,1
div $0,$1
div $0,12
| 41.875 | 472 | 0.841791 |
c8e9195fa4084c18039e3d4e35ec34c4a6abfe71 | 139 | asm | Assembly | libsrc/target/rc2014/stdio/fgetc_cons_basic.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/rc2014/stdio/fgetc_cons_basic.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/rc2014/stdio/fgetc_cons_basic.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_driver
PUBLIC fgetc_cons_basic
.fgetc_cons_basic
rst $10 ; input a character in A
ld l,a
ld h,0
ret
| 11.583333 | 41 | 0.647482 |
13770d709d5a3c0dd1bcdc2b835f54d24804c428 | 2,410 | asm | Assembly | examples/png2snes/hello-world/Hello.asm | fabiosoaza/snes-dev-tools-examples | 599f8575655848c82722b8fff75f55835bc11a32 | [
"MIT"
] | 1 | 2021-03-30T00:09:14.000Z | 2021-03-30T00:09:14.000Z | examples/png2snes/hello-world/Hello.asm | fabiosoaza/snes-dev-tools-examples | 599f8575655848c82722b8fff75f55835bc11a32 | [
"MIT"
] | null | null | null | examples/png2snes/hello-world/Hello.asm | fabiosoaza/snes-dev-tools-examples | 599f8575655848c82722b8fff75f55835bc11a32 | [
"MIT"
] | null | null | null | .include "Header.inc"
.include "Snes_Init.asm"
VBlank: ; Needed to satisfy interrupt definition in "header.inc"
rti
Start:
; Initialize the SNES.
Snes_Init
sep #$20 ; Set the A register to 8-bit.
rep #$10 ; Set the X and Y registers to 16-bit
jsr DMAPalette ; Load Palette in CGRAM
jsr DMATiles ; Load Tiles in VRAM
stz $2105 ; Set Video Mode 0, 8x8 tiles, 4 color BG1/BG2/BG3/BG4
lda #$04 ; Set BG1's Tile Map offset to $0400 (Word address)
sta $2107 ; And the Tile Map size to 32x32
stz $210B ; Set BG1's Character VRAM offset to $0000 (word address)
lda #$01 ; Enable BG1
sta $212C
stz $210E
stz $210E
CLEARTILEMAP:
lda #$80
sta $2115 ; Set Word Write mode to VRAM (increment after $2119)
ldx #$0400
stx $2116
lda #$09
sta $4300 ; Set DMA Mode (word, no increment)
lda #$18
sta $4301 ; Write to VRAM ($2118)
ldx #ZERO ; Load Zero Address
stx $4302 ; Write DMA Source Address
stz $4304 ; Take it from bank 0
ldx #1024
stx $4305 ; 1024 Bytes to transfer
lda #$01
sta $420B ; Initiate VRAM DMA Transfer
; Now, load up some data into our tile map
ldx #$0400 + (15*32) + 10
stx $2116
ldx #0
GETNEXTCHAR:
lda TEXT.W,X ; Load next character
beq TURNON ; If it's a 0, quit
tay
sty $2118 ; Store result in next OAM table
inx ; Go to next character
jmp GETNEXTCHAR
TURNON:
lda #15
sta $2100 ; Set brightness to 15 (100%)
; Loop forever.
Forever:
wai
jmp Forever
DMAPalette:
stz $2121 ; Set CGRAM Address to 0
stz $4300 ; Set DMA Mode (byte, increment)
lda #$22
sta $4301 ; Write to CGRAM ($2122)
ldx #PALETTE
stx $4302 ; Write Source Address
stz $4304 ; Take from Bank 0
ldx #4
stx $4305 ; 4 Bytes to transfer (2 colors)
lda #$01
sta $420B ; Initiate CGRAM DMA Transfer
rts
DMATiles:
lda #$80
sta $2115 ; Set Word Write mode to VRAM (increment after $2119)
stz $2116
stz $2117 ; Set VRAM Address to 0
lda #$01
sta $4300 ; Set DMA Mode (word, increment)
lda #$18
sta $4301 ; Write to VRAM ($2118)
ldx #TILES ; Load Tile Address
stx $4302 ; Write DMA Source Address
stz $4304 ; Take it from bank 0
ldx #2048
stx $4305 ; 2048 Bytes to transfer
lda #$01
sta $420B ; Initiate VRAM DMA Transfer
rts
TEXT:
.db "Hello World!"
ZERO:
.db 0
PALETTE:
.incbin "font.cgr"
TILES:
.incbin "font.vra"
| 20.775862 | 79 | 0.643154 |
9b34b67fe48684907482e6ae490e0bce233c6d87 | 262 | asm | Assembly | u7bg/eop-toggleMouseHand.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | u7bg/eop-toggleMouseHand.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | u7bg/eop-toggleMouseHand.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | %include "include/u7bg-all-includes.asm"
%macro getRightHandedStringPnInAx 0
mov ax, dseg_rightHandedMouseString
%endmacro
%macro getLeftHandedStringPnInAx 0
mov ax, dseg_leftHandedMouseString
%endmacro
%include "../u7-common/patch-eop-toggleMouseHand.asm"
| 21.833333 | 53 | 0.820611 |
faab1bf7bb3b6ccb34c1328d337494c080db865b | 3,046 | asm | Assembly | dino/lcs/enemy/34.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/enemy/34.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/enemy/34.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
004D3A move.l D0, (A4)+
004D3C move.l D0, (A4)+
048442 move.w ($2c,A6), ($34,A6)
048448 move.b #$18, ($22,A6)
04855C move.w ($2c,A6), ($34,A6)
048562 move.b #$1e, ($80,A6)
048860 move.w ($2c,A6), ($34,A6)
048866 jsr $121e.l [enemy+34]
048B6C move.w ($2c,A6), ($34,A6)
048B72 move.b #$3, ($81,A6)
048C34 move.w ($2c,A6), ($34,A6)
048C3A jmp $a09e.l
048C8A move.w ($2c,A6), ($34,A6)
048C90 rts
048CC2 move.w ($2c,A6), ($34,A6)
048CC8 jsr $121e.l [enemy+34]
049354 move.w ($2c,A6), ($34,A6)
04935A rts [enemy+34]
04DFFE move.w ($2c,A6), ($34,A6)
04E004 move.b #$18, ($22,A6) [enemy+34]
04E6AE move.w ($2c,A6), ($34,A6)
04E6B4 jsr $121e.l [enemy+34]
04E808 move.w ($2c,A6), ($34,A6)
04E80E jmp $121e.l
04E824 move.w ($2c,A6), ($34,A6)
04E82A clr.b ($6,A6)
04E944 move.w ($2c,A6), ($34,A6)
04E94A move.b #$21, ($58,A6)
04E968 move.w ($2c,A6), ($34,A6)
04E96E jsr $121e.l
04EA4C move.w ($2c,A6), ($34,A6)
04EA52 jsr $32032.l
04EA62 move.w ($2c,A6), ($34,A6)
04EA68 jsr $121e.l
04EC38 move.w ($2c,A6), ($34,A6)
04EC3E addq.b #2, ($6,A6) [enemy+34]
04EC92 move.w ($2c,A6), ($34,A6)
04EC98 jsr $121e.l [enemy+34]
04F36C move.w ($2c,A6), ($34,A6)
04F372 rts [enemy+34]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 52.517241 | 350 | 0.621471 |
09b75d3a852db43155a92c0e8a18130059b474f5 | 1,577 | asm | Assembly | programs/oeis/222/A222001.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/222/A222001.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/222/A222001.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A222001: Number of n X 3 arrays with each row a permutation of 1..3 having at least as many downsteps as the preceding row, with rows in lexicographically nonincreasing order.
; 6,12,22,37,58,86,122,167,222,288,366,457,562,682,818,971,1142,1332,1542,1773,2026,2302,2602,2927,3278,3656,4062,4497,4962,5458,5986,6547,7142,7772,8438,9141,9882,10662,11482,12343,13246,14192,15182,16217,17298,18426,19602,20827,22102,23428,24806,26237,27722,29262,30858,32511,34222,35992,37822,39713,41666,43682,45762,47907,50118,52396,54742,57157,59642,62198,64826,67527,70302,73152,76078,79081,82162,85322,88562,91883,95286,98772,102342,105997,109738,113566,117482,121487,125582,129768,134046,138417,142882,147442,152098,156851,161702,166652,171702,176853,182106,187462,192922,198487,204158,209936,215822,221817,227922,234138,240466,246907,253462,260132,266918,273821,280842,287982,295242,302623,310126,317752,325502,333377,341378,349506,357762,366147,374662,383308,392086,400997,410042,419222,428538,437991,447582,457312,467182,477193,487346,497642,508082,518667,529398,540276,551302,562477,573802,585278,596906,608687,620622,632712,644958,657361,669922,682642,695522,708563,721766,735132,748662,762357,776218,790246,804442,818807,833342,848048,862926,877977,893202,908602,924178,939931,955862,971972,988262,1004733,1021386,1038222,1055242,1072447,1089838,1107416,1125182,1143137,1161282,1179618,1198146,1216867,1235782,1254892,1274198,1293701,1313402,1333302,1353402,1373703,1394206,1414912,1435822,1456937,1478258,1499786,1521522,1543467,1565622,1587988
mov $1,$0
add $1,4
bin $1,3
add $1,2
| 197.125 | 1,360 | 0.830691 |
5d4e4f9d7ad39aaf2a76a330dfd7a2441ccaab94 | 6,374 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_4073_947.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_4073_947.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_4073_947.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 %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xa62d, %rsi
lea addresses_D_ht+0x163c5, %rdi
xor $36741, %r14
mov $84, %rcx
rep movsw
cmp $4250, %r14
lea addresses_WT_ht+0xb3ad, %r15
nop
nop
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r15)
and %rsi, %rsi
lea addresses_UC_ht+0xec9f, %rsi
nop
nop
nop
nop
nop
cmp $19415, %r15
movups (%rsi), %xmm2
vpextrq $0, %xmm2, %r14
add $63355, %rdi
lea addresses_A_ht+0x23dd, %r11
nop
nop
nop
nop
xor %r15, %r15
movups (%r11), %xmm7
vpextrq $0, %xmm7, %rsi
sub %r15, %r15
lea addresses_normal_ht+0x9f2d, %rsi
lea addresses_WC_ht+0xae40, %rdi
clflush (%rdi)
inc %rax
mov $88, %rcx
rep movsb
nop
nop
nop
cmp %r15, %r15
lea addresses_A_ht+0x65ad, %r14
nop
nop
nop
nop
nop
dec %rsi
movb $0x61, (%r14)
nop
nop
nop
nop
add %rdx, %rdx
lea addresses_WT_ht+0x1ea2d, %r14
nop
nop
nop
inc %r11
vmovups (%r14), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
add %r15, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r8
push %rbx
// Store
mov $0x72d, %r8
add %r13, %r13
mov $0x5152535455565758, %rbx
movq %rbx, (%r8)
cmp %r11, %r11
// Store
lea addresses_PSE+0xa880, %r12
nop
add $61429, %r11
movw $0x5152, (%r12)
nop
xor $53941, %r14
// Store
mov $0x22d, %r12
nop
nop
nop
nop
nop
add %r8, %r8
movb $0x51, (%r12)
nop
nop
add $7924, %r12
// Faulty Load
mov $0x456b0c0000000f2d, %r8
nop
inc %r13
movb (%r8), %r11b
lea oracles, %r14
and $0xff, %r11
shlq $12, %r11
mov (%r14,%r11,1), %r11
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'00': 4073}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 38.39759 | 2,999 | 0.653279 |
be304c881eff1d7e3a77d3ea349d15f9fdc6640e | 853 | asm | Assembly | coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/source/sys_intvecs.asm | daeroro/IntegrationProject | 3b37f31e172cf4411ad0c2481e154e5facfb4d1e | [
"MIT"
] | null | null | null | coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/source/sys_intvecs.asm | daeroro/IntegrationProject | 3b37f31e172cf4411ad0c2481e154e5facfb4d1e | [
"MIT"
] | null | null | null | coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/source/sys_intvecs.asm | daeroro/IntegrationProject | 3b37f31e172cf4411ad0c2481e154e5facfb4d1e | [
"MIT"
] | 2 | 2019-04-29T01:05:25.000Z | 2019-04-29T02:45:44.000Z | ;-------------------------------------------------------------------------------
; sys_intvecs.asm
;
; (c) Texas Instruments 2009-2013, All rights reserved.
;
.sect ".intvecs"
.arm
;-------------------------------------------------------------------------------
; import reference for interrupt routines
.ref _c_int00
.ref _dabort
.def resetEntry
;-------------------------------------------------------------------------------
; interrupt vectors
resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
b _dabort
reservedEntry
b reservedEntry
ldr pc,[pc,#-0x1b0]
ldr pc,[pc,#-0x1b0]
;-------------------------------------------------------------------------------
| 23.054054 | 81 | 0.349355 |
c7b842b39024aeae24c50c148c5ad017f48ad1f7 | 341 | asm | Assembly | CPU/cpu_test/test_storage/test2_addu_I.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | 55 | 2021-09-06T12:12:47.000Z | 2022-01-15T04:30:53.000Z | CPU/cpu_test/test_storage/test2_addu_I.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | null | null | null | CPU/cpu_test/test_storage/test2_addu_I.asm | SilenceX12138/MIPS-Microsystems | d389b706b0930151a710b544db436c2883af958b | [
"MIT"
] | null | null | null | ori $1,$0,20
ori $2,$0,24
addu $3,$1,$2
nop
nop
nop
ori $4,$0,30
ori $5,$0,78
addu $6,$5,$4
nop
nop
nop
ori $7,$0,93
ori $8,$0,23
nop
addu $9,$7,$8
nop
nop
nop
ori $10,$0,11
ori $11,$0,99
nop
addu $12,$11,$10
nop
nop
nop
ori $13,$0,41
ori $14,$0,72
nop
nop
addu $15,$13,$14
nop
nop
nop
ori $16,$0,40
ori $17,$0,88
nop
nop
addu $18,$17,$16
| 8.119048 | 16 | 0.59824 |
ddbd12fb785f10788f8854320f3dfb80967adb95 | 579 | asm | Assembly | programs/oeis/011/A011895.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/011/A011895.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/011/A011895.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A011895: a(n) = floor(n*(n-1)*(n-2)/13).
; 0,0,0,0,1,4,9,16,25,38,55,76,101,132,168,210,258,313,376,447,526,613,710,817,934,1061,1200,1350,1512,1686,1873,2074,2289,2518,2761,3020,3295,3586,3893,4218,4560,4920,5298,5695,6112,6549,7006,7483,7982,8503,9046,9611,10200,10812,11448,12108,12793,13504,14241,15004,15793,16610,17455,18328,19229,20160,21120,22110,23130,24181,25264,26379,27526,28705,29918,31165,32446,33761,35112,36498,37920,39378,40873,42406,43977,45586,47233,48920,50647,52414,54221,56070,57960,59892,61866,63883,65944,68049,70198,72391
bin $0,3
mul $0,36
div $0,78
| 82.714286 | 505 | 0.763385 |
31cad98c08a19d99e69904a4e369eab38fbe89dc | 224 | asm | Assembly | mc-sema/validator/x86/tests/SUBR_F32m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/SUBR_F32m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/SUBR_F32m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_FPU_PE|FLAG_FPU_C1
;TEST_FILE_META_END
FLDPI
;TEST_BEGIN_RECORDING
lea edi, [esp-0xc]
FST dword [edi]
FSUBR dword [edi]
mov edi, 0
;TEST_END_RECORDING
| 14.933333 | 41 | 0.816964 |
248ee4b7441aafe1e4748f00f3388f83036471df | 171 | asm | Assembly | oeis/305/A305395.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/305/A305395.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/305/A305395.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A305395: Records in A073053.
; 11,101,112,202,213,303,314,404,415,505
mov $2,$0
add $2,1
lpb $2
mod $0,2
mul $0,79
add $0,11
sub $2,1
add $3,$0
lpe
mov $0,$3
| 12.214286 | 40 | 0.590643 |
a81e5f578d1526aa74a4e25151e142fb16067952 | 299 | asm | Assembly | src/c-tests/_nzcmp.asm | jwse2/MijnOS | eaa280a5673604439a16575febc0ce342ba55f2e | [
"MIT"
] | null | null | null | src/c-tests/_nzcmp.asm | jwse2/MijnOS | eaa280a5673604439a16575febc0ce342ba55f2e | [
"MIT"
] | null | null | null | src/c-tests/_nzcmp.asm | jwse2/MijnOS | eaa280a5673604439a16575febc0ce342ba55f2e | [
"MIT"
] | null | null | null | ; MASM x86
.MODEL FLAT,C
.CONST
.CODE
public nzcmp
nzcmp:
push ebp
mov ebp,esp
sub esp,4
xor eax,eax
mov ecx,dword ptr [ebp+8]
mov edx,dword ptr [ebp+0Ch]
cmp ecx,edx
setnz al
return:
mov esp,ebp
pop ebp
ret
END
| 11.5 | 35 | 0.518395 |
00e364f6fdbf66e8a7ae72efe1d3c3dfa0fa89fd | 303 | asm | Assembly | programs/oeis/004/A004929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/004/A004929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/004/A004929.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A004929: Floor of n*phi^14, where phi is the golden ratio, A001622.
; 0,842,1685,2528,3371,4214,5057,5900,6743,7586,8429,9272,10115,10958,11801,12644,13487,14330,15173,16016,16859,17702,18545,19388,20231,21074,21917,22760,23603,24446
mov $1,$0
trn $1,1
mov $2,$0
lpb $2,1
add $1,842
sub $2,1
lpe
| 27.545455 | 165 | 0.726073 |
2a82d3c167daab5186467cedd55179e042ae1576 | 3,708 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3120.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_3120.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_3120.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %r8
push %rbx
// Faulty Load
lea addresses_D+0x9864, %r12
sub %r15, %r15
movups (%r12), %xmm2
vpextrq $0, %xmm2, %r13
lea oracles, %r15
and $0xff, %r13
shlq $12, %r13
mov (%r15,%r13,1), %r13
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 90.439024 | 2,999 | 0.663161 |
07870f26543aa6c7520c51dcce6d55019eb01ae6 | 594 | asm | Assembly | data/battle/held_stat_up.asm | pokeachromicdevs/pokeoctober | db74bb68bbfceac07eec6d64674bc24fd4c0b67f | [
"blessing"
] | 1 | 2021-07-05T23:48:37.000Z | 2021-07-05T23:48:37.000Z | data/battle/held_stat_up.asm | pokeachromicdevs/pokeoctober | db74bb68bbfceac07eec6d64674bc24fd4c0b67f | [
"blessing"
] | 1 | 2020-12-16T01:11:20.000Z | 2020-12-16T22:53:56.000Z | data/battle/held_stat_up.asm | pokeachromicdevs/pokeoctober | db74bb68bbfceac07eec6d64674bc24fd4c0b67f | [
"blessing"
] | 1 | 2021-07-05T23:33:22.000Z | 2021-07-05T23:33:22.000Z | HeldStatUpItems:
dbw HELD_ATTACK_UP, BattleCommand_AttackUp
dbw HELD_DEFENSE_UP, BattleCommand_DefenseUp
dbw HELD_SPEED_UP, BattleCommand_SpeedUp
dbw HELD_SP_ATTACK_UP, BattleCommand_SpecialAttackUp
dbw HELD_SP_DEFENSE_UP, BattleCommand_SpecialDefenseUp
dbw HELD_ACCURACY_UP, BattleCommand_AccuracyUp
dbw HELD_EVASION_UP, BattleCommand_EvasionUp
dbw HELD_WISDOM_ORB, BattleCommand_SpecialDefenseUp2
dbw HELD_SHARP_HORN, BattleCommand_AttackUp2
dbw HELD_THUNDER_WING, BattleCommand_SpeedUp2
dbw HELD_FIRE_WING, BattleCommand_SpecialAttackUp2
db -1 ; end
| 42.428571 | 56 | 0.843434 |
869563c1def92ff1384f5dd5112ad5f57c8ffb72 | 4,047 | asm | Assembly | lib/src/os/w95/startup/xstart.asm | zanud/xds-2.60 | b4a32b9c9c91fe513fa5ff78ec87bb44102a3b72 | [
"Apache-2.0"
] | 53 | 2019-06-10T18:19:44.000Z | 2021-12-28T18:56:00.000Z | Sources/Lib/src/os/w95/startup/xstart.asm | undecidedzogvisvitalispotent8stars360/xds | cfd20e209193c9cfcee94ad2ca30d8c32ead48c9 | [
"Apache-2.0"
] | 5 | 2020-07-10T16:06:48.000Z | 2021-07-30T07:17:50.000Z | Sources/Lib/src/os/w95/startup/xstart.asm | undecidedzogvisvitalispotent8stars360/xds | cfd20e209193c9cfcee94ad2ca30d8c32ead48c9 | [
"Apache-2.0"
] | 20 | 2019-06-10T18:09:16.000Z | 2021-10-02T19:46:42.000Z | ; COPYRIGHT (c) 1995 xTech Ltd. All Rights Reserved.
; COPYRIGHT (c) 2002, 2003 Excelsior LLC. All Rights Reserved.
;
cpu 386
bits 32
section .data use32 public align=4 public 'DATA'
myHandle: dd 0
string: db "QuQu",10,12
nbytes: dd 0
section .text use32 public align=4 public 'CODE'
;EXPORT
;------
global xStart
global X2C_INIT_HISTORY
global X2C_FINALLY
global X2C_MODULE
global X2C_GetMyHandle
;//////////////////////// Entry point /////////////////////////////
extern X2C_xStart
extern X2C_EstablishMain
extern main
;PROCEDURE ["StdCall"] GetModuleHandleA ( lpszModule :ARRAY OF CHAR );
extern GetModuleHandleA
..start:
xStart:
push dword 0 ;NULL - GetMyHandle
call GetModuleHandleA ;->eax
mov [myHandle], eax
push main
call X2C_EstablishMain
sub esp,-04H
push xFilter
xor eax, eax
push dword [fs:eax]
mov [fs:eax], esp
jmp X2C_xStart
;xStart endp
extern X2C_xFilter
xFilter:
mov eax, [esp+4] ; exception_record *
mov edx, [esp+12] ; context_record *
push edx
push eax
test dword [eax+4], 6
jnz Unhandled
mov eax, esp
push eax
call X2C_xFilter
test eax, eax
jge Unhandled
add esp, 8
xor eax, eax
ret
Unhandled: xor eax, eax
mov ecx, [fs:eax]
mov ecx, [ecx]
mov [fs:eax], ecx
add esp, 8
inc eax
ret
;xFilter endp
;////////////////////////// Finalization //////////////////////////
;PROCEDURE ["C"] X2C_FINALEXE ( proc :PROC );
extern X2C_FINALEXE
;PROCEDURE ["C"] X2C_FINALLY ( p :PROC );
X2C_FINALLY:
jmp X2C_FINALEXE
;X2C_FINALLY endp
;///////////////////////////// History ///////////////////////////////
;PROCEDURE ["C"] X2C_HISTORY_REG (hmod, someAddr :ADDRESS);
extern X2C_HISTORY_REG
;PROCEDURE ["C"] X2C_HISTORY_ON ();
extern X2C_HISTORY_ON
;PROCEDURE ["C"] X2C_INIT_HISTORY();
X2C_INIT_HISTORY:
push dword xStart ;arbitrary addr from this code segment
push dword [myHandle]
call X2C_HISTORY_REG
call X2C_HISTORY_ON ; to make showable
sub esp,-08H
ret
;X2C_INIT_HISTORY endp
;////////////////////// O2 modules unloading support /////////////////////
extern X2C_MODULEXE
;PROCEDURE ["C"] X2C_MODULEXE ( md :xmRTS.X2C_MD; hmod :ADDRESS );
;PROCEDURE ["C"] X2C_MODULE ( md :xmRTS.X2C_MD );
X2C_MODULE:
push dword [myHandle]
mov eax,[esp+8] ;md
push eax
call X2C_MODULEXE
sub esp,-08H
ret
;X2C_MODULE endp
;////////////////////// DLLRTS support ///////////////////////////////////
;PROCEDURE ["C"] / X2C_GetMyHandle(): ADDRESS;
X2C_GetMyHandle:
mov eax, [myHandle]
ret
;X2C_GetMyHandle endp
; end xStart
| 25.45283 | 80 | 0.402026 |
9856d5cad51fe037e098b82528036a914e5b86a9 | 4,195 | asm | Assembly | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/debug.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2019-11-04T07:11:25.000Z | 2019-11-04T07:11:25.000Z | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/debug.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 13 | 2018-10-12T21:29:09.000Z | 2018-10-25T20:06:51.000Z | firmware/coreboot/3rdparty/blobs/cpu/amd/geode_lx/gplvsa_ii/sysmgr/debug.asm | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | ;
; Copyright (c) 2006-2008 Advanced Micro Devices,Inc. ("AMD").
;
; This library is free software; you can redistribute it and/or modify
; it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation; either version 2.1 of the
; License, or (at your option) any later version.
;
; This code is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General
; Public License along with this library; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place, Suite 330,
; Boston, MA 02111-1307 USA
;
;* Function: *
;* Debug routines for GX2-based systems
include vsa2.inc
include vr.inc
include sysmgr.inc
.model tiny,c
.586p
.CODE
CR equ 0Dh
LF equ 0Ah
externdef SMM_Header: SmiHeader
;***********************************************************************
; Hex dump routines
;***********************************************************************
Hex_32 proc pascal Num:dword
pushad
mov ebx, Num
mov cx, 8
@@: rol ebx, 4
call Hex_4
loop @b
call Space
popad
ret
Hex_32 endp
Hex_16 proc pascal Num:word
pusha
mov cx, 4
mov bx, Num
@@: rol bx, 4
call Hex_4
loop @b
call Space
popa
ret
Hex_16 endp
Hex_8 proc pascal Num:byte
pusha
mov cx, 2
mov bl, Num
@@: rol bl, 4
call Hex_4
loop @b
call Space
popa
ret
Hex_8 endp
Hex_4: mov al, bl
and al, 0Fh
add al, '0' ; Convert to ASCII
cmp al, '9'
jbe @f
add al, 7 ; 'A'-'F'
@@: mov dx, DBG_PORT
jmp Char
Space: mov al, ' '
Char: out dx, al
in al, 80h
ret
;***********************************************************************
; Displays SMI source(s)
;
; On Entry:
; ECX = SMI source(s)
;***********************************************************************
Show_SMI_Source proc
pushad
cld
mov dx, DBG_PORT
lea bx, SMI_Source_Strings-2
MsgLoop:jecxz Exit
add bx, 2
shr ecx, 1
jnc MsgLoop
mov si, [bx] ; Get message ptr
cmp si, OFFSET Msg_DescrHit
jne short CharLoop
mov ax, [SMM_Header].IO_addr
cmp ax, VRC_INDEX
je IsVirtualReg
cmp ax, VRC_DATA
jne CharLoop
IsVirtualReg:
lea si, [Msg_VirtReg]
CharLoop:
lodsb
or al, al ; End of string ?
jz Blank
out dx, al ; No, display next character
jmp CharLoop
Blank: mov al, ' ' ; Yes, display trailing blank
out dx, al
jmp MsgLoop
Exit: popad
ret
Show_SMI_Source endp
SMI_Source_Strings:
dw OFFSET Msg_PM
dw OFFSET Msg_Audio
dw OFFSET Msg_ACPI
dw OFFSET Msg_VG
dw OFFSET Msg_Reserved
dw OFFSET Msg_Retrace
dw OFFSET Msg_VGA_Timer
dw OFFSET Msg_A20
dw OFFSET Msg_SW_SMI
dw OFFSET Msg_GTT
dw OFFSET Msg_Reserved
dw OFFSET Msg_MFGPT
dw OFFSET Msg_NMI
dw OFFSET Msg_Reset
dw OFFSET Msg_USB
dw OFFSET Msg_Graphics
dw OFFSET Msg_GT1
dw OFFSET Msg_GT2
dw OFFSET Msg_USR_DEF_1
dw OFFSET Msg_VirtReg
dw OFFSET Msg_USR_DEF_3
dw OFFSET Msg_PCI_Trap
dw OFFSET Msg_Reserved
dw OFFSET Msg_Reserved
dw OFFSET Msg_MPCI
dw OFFSET Msg_DescrHit
dw OFFSET Msg_Stat_Hit
dw OFFSET Msg_PIC
dw OFFSET Msg_KEL
dw OFFSET Msg_PME
dw OFFSET Msg_BlockIO
dw OFFSET Msg_Reserved
Msg_Reserved db '???',0
Msg_VG db 'VG',0
Msg_PM db 'PM',0
Msg_Audio db 'Audio',0
Msg_ACPI db 'ACPI',0
Msg_Retrace db 'Vsync',0
Msg_VGA_Timer db 'Vga',0
Msg_SW_SMI db 'S/W',0
Msg_A20 db 'A20',0
Msg_GTT db 'GTT',0
Msg_MFGPT db 'MFGPT',0
Msg_NMI db 'NMI',0
Msg_GT1 db 'GT1',0
Msg_GT2 db 'Timer',0
Msg_USB db 'USB',0
Msg_Reset db 'Reset',0
Msg_Graphics db 'VGA',0
Msg_USR_DEF_1 db 'PIC',0
Msg_VirtReg db 'VR',0
Msg_USR_DEF_3 db 'UDef3',0
Msg_PCI_Trap db 'PCI',0
Msg_MPCI db 'MPCI',0
Msg_DescrHit db 'I/O',0
Msg_Stat_Hit db 'StatHit',0
Msg_PIC db 'PIC',0
Msg_KEL db 'KEL',0
Msg_PME db 'PME',0
Msg_BlockIO db 'BlockIO',0
end
| 18.9819 | 73 | 0.624553 |
f3b52971a719aac220636ec9c568be250987d8f3 | 221 | asm | Assembly | libsrc/stdio/__cons_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/__cons_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/__cons_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE __cons_state
SECTION bss_clib
PUBLIC __cons_state
__cons_state:
defb 0 ; state var for console editing in gets() and fgets_cons()
; non-zero = capslock on
| 20.090909 | 89 | 0.58371 |
660d20bb43ec5b0e1591e06904a16d61c96034de | 727 | asm | Assembly | oeis/212/A212514.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/212/A212514.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/212/A212514.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A212514: Number of (w,x,y,z) with all terms in {1,...,n} and w<=2x and y>3z.
; Submitted by Christian Krause
; 0,0,0,0,14,42,90,200,364,585,960,1440,2052,2926,4004,5280,7000,9000,11340,14280,17670,21483,26180,31416,37296,44252,52000,60480,70434,81270,93150,106720,121520,137445,155584,175032,196020,219450,244644,271440,301340,333060,366912,404096,443674,485415,531300,579600,630720,686200,744800,806208,872950,942786,1016226,1095192,1178100,1264545,1357664,1454640,1556100,1664390,1777540,1895040,2020704,2151072,2286900,2431000,2580974,2736195,2901220,3071880,3249072,3436116,3630144,3830400,4042250,4260750
mov $2,$0
seq $0,238410 ; a(n) = floor((3(n-1)^2 + 1)/2).
add $0,$2
div $0,2
sub $2,1
bin $2,2
div $2,3
mul $0,$2
| 55.923077 | 500 | 0.759285 |
ca24b6fed7ce9640ffef1879a56a86a04d158f39 | 727 | asm | Assembly | oeis/077/A077981.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/077/A077981.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/077/A077981.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A077981: Expansion of 1/(1+2*x-2*x^2-2*x^3).
; Submitted by Christian Krause
; 1,-2,6,-14,36,-88,220,-544,1352,-3352,8320,-20640,51216,-127072,315296,-782304,1941056,-4816128,11949760,-29649664,73566592,-182532992,452899840,-1123732480,2788198656,-6918062592,17165057536,-42589842944,105673675776,-262196922368,650561510400,-1614169513984,4005068204032,-9937352415232,24656502210560,-61177572843520,151793445277696,-376629031821312,934489808510976,-2318650790109184,5753023133597696,-14274368230391808,35417481147760640,-87877652489109504,218041530812956672,-541003404308611072
mov $1,1
mov $3,-1
lpb $0
sub $0,1
mul $2,2
sub $3,$1
add $1,$3
add $2,$3
add $1,$2
sub $2,$1
add $1,$2
sub $2,$1
lpe
mov $0,$1
| 38.263158 | 500 | 0.757909 |
9b8618fa2dd1b6ada0cfc9f9e383328485b1b66b | 86 | asm | Assembly | newitems/ancilla/main.asm | fcard/z3randomizer | f2d0c2e58512e9c4c7f37996b52f6a0dc828f3ec | [
"MIT"
] | null | null | null | newitems/ancilla/main.asm | fcard/z3randomizer | f2d0c2e58512e9c4c7f37996b52f6a0dc828f3ec | [
"MIT"
] | null | null | null | newitems/ancilla/main.asm | fcard/z3randomizer | f2d0c2e58512e9c4c7f37996b52f6a0dc828f3ec | [
"MIT"
] | null | null | null | incsrc ./tables.asm
incsrc ./routines.asm
incsrc ./example.asm
incsrc ./lightspin.asm
| 17.2 | 22 | 0.767442 |
dd722ed1204714a500edf6710e034460bf1747dd | 321 | asm | Assembly | programs/oeis/073/A073835.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/073/A073835.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/073/A073835.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A073835: Replace 10^k with (-10)^k in decimal expansion of n.
; 0,1,2,3,4,5,6,7,8,9,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-60
mov $1,$0
mul $0,2
mod $0,20
sub $0,$1
| 40.125 | 216 | 0.52648 |
989ad5d8af36c6299322b6bfefe917f0e65a1326 | 719 | asm | Assembly | oeis/213/A213684.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/213/A213684.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/213/A213684.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A213684: Logarithmic derivative of A001002.
; Submitted by Jon Maiga
; 1,5,22,105,511,2534,12720,64449,328900,1688115,8705060,45064110,234054198,1219053680,6364813192,33302104593,174570695175,916628799380,4820160541350,25381091113455,133808636072595,706211862466500,3730964595817680,19729042153581150,104413710859275636,553028288576365854,2931232367685208720,15546897887473250928,82510210276390868920,438151161809293743624,2327963711827843400256,12375124877254273947505,65815873984051915233356,350192726517418285678275,1864093878750380660341140,9926641818355954663613460
mov $4,$0
add $0,2
lpb $0
sub $0,1
mov $2,$1
bin $2,$0
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
add $4,1
add $5,$3
lpe
mov $0,$5
| 37.842105 | 501 | 0.816412 |
c37c77e3d0e677f235b40c983c6bb275fdaa2e3e | 412 | asm | Assembly | programs/oeis/174/A174605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/174/A174605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/174/A174605.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A174605: Partial sums of A011371.
; 0,0,1,2,5,8,12,16,23,30,38,46,56,66,77,88,103,118,134,150,168,186,205,224,246,268,291,314,339,364,390,416,447,478,510,542,576,610,645,680,718,756,795,834,875,916,958,1000,1046,1092,1139,1186,1235,1284,1334
lpb $0
mov $2,$0
sub $0,1
seq $2,11371 ; a(n) = n minus (number of 1's in binary expansion of n). Also highest power of 2 dividing n!.
add $1,$2
lpe
mov $0,$1
| 37.454545 | 207 | 0.679612 |
43ba871179b94b1b10611b45f89851f2f52752cc | 573 | asm | Assembly | programs/oeis/225/A225018.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/225/A225018.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/225/A225018.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A225018: Number of cusps in a class of degree-3n complex algebraic surfaces.
; 3,30,127,301,647,1100,1851,2715,4027,5434,7463,9545,12447,15336,19267,23095,28211,33110,39567,45669,53623,61060,70667,79571,90987,101490,114871,127105,142607,156704,174483,190575,210787,229006,251807,272285,297831,320700
mov $5,$0
add $0,1
mov $3,$0
mov $4,$0
mul $0,9
div $3,2
mul $4,$0
add $4,3
mul $3,$4
div $4,6
lpb $0,1
mov $0,1
gcd $4,$3
mov $1,$4
lpe
add $1,1
mov $2,$5
mul $2,8
add $1,$2
mov $6,$5
mul $6,$5
mov $2,$6
mul $2,12
add $1,$2
mul $6,$5
mov $2,$6
mul $2,6
add $1,$2
| 17.90625 | 222 | 0.670157 |
583534d77f9e7bf3b2b6b240ee6a56214f8c516b | 670 | asm | Assembly | programs/oeis/256/A256137.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/256/A256137.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/256/A256137.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A256137: a(2) = 1; a(3) = 4; for n >= 4, a(n) = 2 + Sum_{i=4..n} d(i), where d(i) = i for even i, d(i) = i-3 for odd i.
; 1,4,6,8,14,18,26,32,42,50,62,72,86,98,114,128,146,162,182,200,222,242,266,288,314,338,366,392,422,450,482,512,546,578,614,648,686,722,762,800,842,882,926,968,1014,1058,1106,1152,1202,1250,1302,1352,1406,1458,1514,1568,1626,1682,1742,1800,1862,1922,1986,2048,2114,2178,2246,2312,2382,2450,2522,2592,2666,2738,2814,2888,2966,3042,3122,3200,3282,3362,3446,3528,3614,3698,3786,3872,3962,4050,4142,4232,4326,4418,4514,4608,4706,4802,4902,5000
mul $0,2
lpb $0
add $1,$0
sub $0,1
trn $0,4
add $0,$2
add $1,1
mov $2,1
lpe
add $1,1
mov $0,$1
| 44.666667 | 439 | 0.667164 |
a41d9fbcc3bbbb46c7bce02448a9b9721638b32d | 682 | asm | Assembly | oeis/036/A036101.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/036/A036101.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/036/A036101.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A036101: Centered cube numbers: (n+1)^23 + n^23.
; Submitted by Christian Krause
; 1,8388609,94151567435,70462887356491,11991297699255789,801651152008680941,28158477563134519159,617664557698786568055,9453233930011206747641,108862938119652501095929,995430243255237372246531,7520167510204474383366659,48378642680362353378165925,271339598300394611849266341,1351859839288863667113079919,6074034303543403271227356271,24919329058001044902155562609,94315282514881451715877842545,332177341559329655161544844091,1096690427945307727248226067259,3415441675108218291929075869661
add $0,1
lpb $0
mov $3,$2
mov $2,$1
cmp $3,0
mul $3,$0
sub $0,1
pow $3,23
add $1,$3
lpe
mov $0,$1
| 42.625 | 485 | 0.843109 |
c461185015418107837d7ae105eaf88c649597be | 422 | asm | Assembly | oeis/099/A099840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/099/A099840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/099/A099840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A099840: Expansion of (1-6*x)/(1-20*x^2).
; Submitted by Jon Maiga
; 1,-6,20,-120,400,-2400,8000,-48000,160000,-960000,3200000,-19200000,64000000,-384000000,1280000000,-7680000000,25600000000,-153600000000,512000000000,-3072000000000,10240000000000,-61440000000000,204800000000000,-1228800000000000
add $0,1
mov $2,-6
mov $3,1
lpb $0
sub $0,1
add $1,$2
mov $2,$3
mov $3,$1
mov $1,$2
mul $2,19
lpe
mov $0,$1
| 24.823529 | 231 | 0.703791 |
b74f9670b5a619bc838f6a73509c6e0bf86bbf12 | 1,023 | asm | Assembly | tests/syntax_test_macros.asm | dougmasten/dougmasten-sublime-assembly-6809 | 60aca36483d6a33bbcc3d8880c8ce274cb6302a9 | [
"MIT"
] | 5 | 2018-11-10T02:09:16.000Z | 2021-09-12T04:39:08.000Z | tests/syntax_test_macros.asm | dougmasten/dougmasten-sublime-assembly-6809 | 60aca36483d6a33bbcc3d8880c8ce274cb6302a9 | [
"MIT"
] | 1 | 2018-12-18T09:44:42.000Z | 2018-12-23T06:14:12.000Z | tests/syntax_test_macros.asm | dougmasten/dougmasten-sublime-assembly-6809 | 60aca36483d6a33bbcc3d8880c8ce274cb6302a9 | [
"MIT"
] | 2 | 2021-01-31T03:09:12.000Z | 2021-02-10T13:55:11.000Z | # SYNTAX TEST "Packages/Assembly-6809/Assembly-6809.sublime-syntax"
# <- source.mc6809
label1 macro comment
# <- entity.name.type.constant
#^^^^^ entity.name.type.constant
# ^^^^^ support.function.directive.macro
endm
# ^^^^ support.function.directive.macro
label2 macro noexpand comment
# <- entity.name.type.constant
#^^^^^ entity.name.type.constant
# ^^^^^ support.function.directive.macro
# ^^^^^^^^ support.function.directive.macro
endm
# ^^^^ support.function.directive.macro
; no prefix label
; macro
;^^^^^ invalid.keyword.operator
label3 macro
lda #\1*2
# ^ punctuation.definition.macro
# ^ variable.language.macro
# ^ keyword.operator.arithmetic
# ^ constant.numeric.decimal
label1 ; comment
# ^^^^^^ constant.other
# ^ punctuation.definition.comment
# ^^^^^^^^^ comment.line
| 26.921053 | 67 | 0.554252 |
b767650fe87a06482e447330444748ef9d481788 | 432 | asm | Assembly | programs/oeis/316/A316344.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/316/A316344.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/316/A316344.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A316344: An example of a word that is uniform morphic, but neither pure morphic, primitive morphic, nor recurrent.
; 2,2,0,2,0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,1,2,1,0,2
lpb $0
bin $0,2
mul $0,13
lpe
seq $0,36577 ; Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.
| 48 | 201 | 0.608796 |
05e8a105fcd6dd6682a7a8bc9b76ddd36e753ede | 434 | asm | Assembly | libsrc/target/vector06c/graphics/w_pixladdr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/vector06c/graphics/w_pixladdr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/vector06c/graphics/w_pixladdr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_driver
PUBLIC w_pixeladdress
EXTERN __vector06c_scroll
; Entry hl = x
; de = y
; Exit: hl = de = address
; a = pixel number
; Uses: a, c, de, hl
.w_pixeladdress
; Display is 256/512 pixels wide, 256 pixels high
ld c,l ;Save for later
ld a,l
rrca
rrca
rrca
and 31
add $e0
ld h,a
ld a,e
cpl
inc a
ld l,a
ld a,(__vector06c_scroll)
add l
ld l,a
ld d,h
ld e,l
ld a,c
and 7
xor 7
ret
| 11.72973 | 50 | 0.633641 |
e47c899e01b9503d505877b7b62592b07d85e3e8 | 719 | asm | Assembly | oeis/064/A064142.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/064/A064142.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/064/A064142.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A064142: Sum of all distinct primes dividing central binomial coefficient C(n, floor(n/2)).
; Submitted by Christian Krause
; 0,2,3,5,7,7,12,14,12,12,23,23,29,29,32,34,48,48,62,62,61,61,81,81,73,73,69,69,98,98,127,129,123,123,130,130,148,148,161,161,195,195,227,227,204,204,251,251,253,253,257,257,307,307,323,323,316,316,367,367,397,397,398,400,407,407,457,457,475,475,543,543,579,579,568,568,563,563,642,642,604,604,687,687,661,661,679,679,768,768,758,758,742,742,761,761,851,851,857,857
add $0,1
mov $1,$0
div $1,2
bin $0,$1
mov $1,0
mov $2,2
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
lpb $0
dif $0,$2
lpe
add $1,$2
lpe
mov $0,$1
| 26.62963 | 365 | 0.64395 |
b677ae5466ffcf805d77548e82b05d0e0eb7550b | 567 | asm | Assembly | kernel/16bit/idt.asm | gniuk/BOS | 5e144deaab35e84b572c5374dcda25490dd5c737 | [
"Unlicense"
] | 16 | 2015-01-21T18:19:25.000Z | 2022-02-10T02:56:59.000Z | kernel/16bit/idt.asm | gniuk/BOS | 5e144deaab35e84b572c5374dcda25490dd5c737 | [
"Unlicense"
] | 1 | 2018-12-27T20:57:54.000Z | 2018-12-31T20:00:09.000Z | kernel/16bit/idt.asm | gniuk/BOS | 5e144deaab35e84b572c5374dcda25490dd5c737 | [
"Unlicense"
] | 5 | 2015-01-16T13:31:14.000Z | 2019-07-01T15:17:44.000Z | ;----------------------------------------------------------;
; BOS kernel Christoffer Bubach, 2003-2005. ;
;----------------------------------------------------------;
; ;
; pointer to IDT (Interrupt Description Table) ;
; ;
;----------------------------------------------------------;
;-----------------;
; IDT pointer ;
;-----------------;
idtr:
.size dw 0x800
.address dd 0x6C00 | 35.4375 | 61 | 0.195767 |
16c5821b8ab63d92d31dd18eb6ed3c3f22b21621 | 852 | asm | Assembly | 04/fill/Fill.asm | BartlomiejRasztabiga/nand2tetris | 8826ac0b446027a825b0449397b3d92a349d12be | [
"Apache-2.0"
] | null | null | null | 04/fill/Fill.asm | BartlomiejRasztabiga/nand2tetris | 8826ac0b446027a825b0449397b3d92a349d12be | [
"Apache-2.0"
] | null | null | null | 04/fill/Fill.asm | BartlomiejRasztabiga/nand2tetris | 8826ac0b446027a825b0449397b3d92a349d12be | [
"Apache-2.0"
] | null | null | null | (RESTART)
@SCREEN
D=A
@0
M=D //PUT SCREEN START LOCATION IN RAM0
(KBDCHECK)
@KBD
D=M
@BLACK
D;JGT //JUMP IF ANY KBD KEYS ARE PRESSED
@WHITE
D;JEQ //ELSE JUMP TO WHITEN
@KBDCHECK
0;JMP
(BLACK)
@1
M=-1 //WHAT TO FILL SCREEN WITH (-1=11111111111111)
@CHANGE
0;JMP
(WHITE)
@1
M=0 //WHAT TO FILL SCREEN WITH
@CHANGE
0;JMP
(CHANGE)
@1 //CHECK WHAT TO FILL SCREEN WITH
D=M //D CONTAINS BLACK OR WHITE
@0
A=M //GET ADRESS OF SCREEN PIXEL TO FILL
M=D //FILL IT
@0
D=M+1 //INC TO NEXT PIXEL
@KBD
D=A-D //KBD-SCREEN=A
@0
M=M+1 //INC TO NEXT PIXEL
A=M
@CHANGE
D;JGT //IF A=0 EXIT AS THE WHOLE SCREEN IS BLACK
/////////////////////////
@RESTART
0;JMP | 16.705882 | 56 | 0.495305 |
38aab30c2c456ff5b5da03474ab09bd038b3e9a1 | 6,942 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1200.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1200.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1200.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x2f58, %rsi
lea addresses_WT_ht+0x8198, %rdi
nop
nop
dec %rbx
mov $124, %rcx
rep movsw
nop
xor $17283, %rax
lea addresses_normal_ht+0x1cc08, %r15
nop
cmp %r10, %r10
movl $0x61626364, (%r15)
nop
nop
nop
nop
nop
add $34757, %r10
lea addresses_WT_ht+0x9218, %rsi
lea addresses_A_ht+0x1ebd8, %rdi
nop
nop
nop
sub %r10, %r10
mov $96, %rcx
rep movsl
nop
inc %rdi
lea addresses_A_ht+0x6d24, %rsi
lea addresses_A_ht+0x241e, %rdi
nop
and %r12, %r12
mov $66, %rcx
rep movsw
nop
nop
inc %r12
lea addresses_D_ht+0x11718, %rbx
nop
nop
nop
nop
nop
xor %rsi, %rsi
vmovups (%rbx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rdi
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0xb98, %rsi
lea addresses_A_ht+0xd9e8, %rdi
nop
nop
nop
nop
and %r12, %r12
mov $68, %rcx
rep movsb
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_A_ht+0x5398, %rsi
lea addresses_normal_ht+0x9218, %rdi
nop
nop
cmp %rbx, %rbx
mov $66, %rcx
rep movsl
nop
nop
nop
xor %rdi, %rdi
lea addresses_WC_ht+0x1daf8, %rsi
lea addresses_UC_ht+0xf050, %rdi
nop
nop
nop
nop
add $6779, %r12
mov $10, %rcx
rep movsb
nop
nop
cmp %rsi, %rsi
lea addresses_normal_ht+0x15a18, %rsi
lea addresses_normal_ht+0x1b518, %rdi
nop
nop
nop
cmp $50249, %r12
mov $77, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x1ece3, %rsi
lea addresses_WT_ht+0xcae8, %rdi
dec %r10
mov $121, %rcx
rep movsb
cmp $32160, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r8
push %rbx
push %rdx
// Load
lea addresses_A+0x3da0, %rbx
clflush (%rbx)
nop
nop
cmp $15783, %rdx
mov (%rbx), %r12w
nop
sub %rbx, %rbx
// Faulty Load
lea addresses_D+0x14b98, %r12
nop
nop
cmp %r10, %r10
mov (%r12), %ebx
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': True}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': True}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 36.730159 | 2,999 | 0.662057 |
90473d8e0a9be26ad63471ba955924823c307c35 | 466 | asm | Assembly | oeis/144/A144470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/144/A144470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/144/A144470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A144470: Triangle t(n,m) read by rows: t(n,m) = binomial(n,m)*3^m if m <= n/2, else t(n,m) = t(n,n-m).
; Submitted by Christian Krause
; 1,1,1,1,6,1,1,9,9,1,1,12,54,12,1,1,15,90,90,15,1,1,18,135,540,135,18,1,1,21,189,945,945,189,21,1,1,24,252,1512,5670,1512,252,24,1,1,27,324,2268,10206,10206,2268,324,27,1,1,30,405,3240,17010,61236,17010,3240
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
min $2,$0
lpe
bin $1,$0
mov $0,3
pow $0,$2
mul $1,$0
mov $0,$1
| 27.411765 | 208 | 0.613734 |
a06b98176118dc766887ce595e1bb09f14ae1e65 | 70 | asm | Assembly | 13-ilinux-paging/boot/kernel.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | 13-ilinux-paging/boot/kernel.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | 13-ilinux-paging/boot/kernel.asm | weimanzhou/ilinux | b65cb77510e5a28f6342c373dea156125a8b1d42 | [
"Apache-2.0"
] | null | null | null | ; 1
; 2
; 3
; 4
; 5
org 0x100
jmp LABEL_START
LABEL_START:
jmp $
| 5 | 15 | 0.585714 |
713fbcc4dfa75964c6ac18e89c50f88f471414bd | 4,269 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_10.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_10.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_10.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 %rsi
lea addresses_normal_ht+0x13f79, %rsi
nop
nop
nop
and $28257, %r10
movups (%rsi), %xmm7
vpextrq $0, %xmm7, %r15
xor %r10, %r10
pop %rsi
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r9
push %rax
push %rbx
push %rcx
push %rsi
// Load
lea addresses_RW+0x1f679, %rsi
and %rax, %rax
movups (%rsi), %xmm6
vpextrq $1, %xmm6, %rcx
nop
nop
nop
nop
nop
cmp $54480, %r9
// Faulty Load
lea addresses_RW+0x1f679, %rbx
sub $13916, %r11
mov (%rbx), %r9
lea oracles, %rsi
and $0xff, %r9
shlq $12, %r9
mov (%rsi,%r9,1), %r9
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 60.985714 | 2,999 | 0.659639 |
48e5e09e64b68499f26d75363cc0100f669d2799 | 768 | asm | Assembly | PA5/samples/pa9-max.asm | atomic/CSE131 | 9d60c16f65fbd5cb91840643cbe6c4c9f5fdd2b4 | [
"MIT"
] | 1 | 2019-04-22T07:40:24.000Z | 2019-04-22T07:40:24.000Z | PA5/samples/pa9-max.asm | atomic/CSE131 | 9d60c16f65fbd5cb91840643cbe6c4c9f5fdd2b4 | [
"MIT"
] | null | null | null | PA5/samples/pa9-max.asm | atomic/CSE131 | 9d60c16f65fbd5cb91840643cbe6c4c9f5fdd2b4 | [
"MIT"
] | null | null | null | .data
text: .asciiz "Enter a number: "
.text
main:
# Printing out the text
li $v0, 4
la $a0, text
syscall
# Getting user input
li $v0, 5
syscall
# Moving the integer input to another register
move $t0, $v0
# Printing out the text
li $v0, 4
la $a0, text
syscall
# Getting user input
li $v0, 5
syscall
# Moving the integer input to another register
move $t1, $v0
slt $t2, $t0, $t1
bne $t2, $zero, L0
j L1
L0:
# Printing out the number $t1 ($t0 < $t1)
li $v0, 1
move $a0, $t1
syscall
j exit
L1:
# Printing out the number $t0 ($t1 < $t0)
li $v0, 1
move $a0, $t0
syscall
j exit
L2:
# End Program
li $v0, 10
syscall
| 13.963636 | 50 | 0.536458 |
189b8b852d32ff2ee9a980295b1cfee42e24056f | 361 | asm | Assembly | programs/oeis/032/A032378.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/032/A032378.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/032/A032378.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A032378: Noncubes such that n is divisible by floor(n^(1/3)).
; 2,3,4,5,6,7,10,12,14,16,18,20,22,24,26,30,33,36,39,42,45,48,51,54,57,60,63,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,222,228,234,240
add $0,1
lpb $0,1
add $1,$0
sub $0,3
add $1,1
add $2,3
trn $0,$2
lpe
| 30.083333 | 216 | 0.648199 |
bd114b4504733938eb148266d518fbf4861ba1df | 4,286 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_206.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_206.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_206.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rdi
// Store
lea addresses_WC+0x4e4c, %rcx
nop
nop
nop
nop
nop
xor %rbp, %rbp
movb $0x51, (%rcx)
nop
cmp $47208, %r9
// Store
lea addresses_UC+0xeebc, %r8
nop
nop
nop
nop
nop
xor $29059, %rdi
mov $0x5152535455565758, %r13
movq %r13, %xmm6
vmovups %ymm6, (%r8)
nop
nop
nop
nop
dec %r9
// Faulty Load
lea addresses_A+0x19cbc, %rcx
nop
cmp %r9, %r9
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r10
lea oracles, %rdi
and $0xff, %r10
shlq $12, %r10
mov (%rdi,%r10,1), %r10
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 56.394737 | 2,999 | 0.660056 |
7a95c4c8c3270399f4de2af5101b1485acb4c89b | 3,725 | asm | Assembly | src/mappers/mapper9.asm | DigiDwrf/neon64v2-easybuild | 94fa46fbc8ddb2af593cb42162df58f65a03ebc4 | [
"0BSD"
] | 36 | 2020-07-08T11:27:17.000Z | 2022-03-15T08:38:52.000Z | src/mappers/mapper9.asm | DigiDwrf/neon64v2-easybuild | 94fa46fbc8ddb2af593cb42162df58f65a03ebc4 | [
"0BSD"
] | 19 | 2020-07-12T23:14:03.000Z | 2021-12-14T07:57:40.000Z | src/mappers/mapper9.asm | DigiDwrf/neon64v2-easybuild | 94fa46fbc8ddb2af593cb42162df58f65a03ebc4 | [
"0BSD"
] | 6 | 2021-07-17T09:57:46.000Z | 2022-03-13T07:50:25.000Z | // Mapper 9: PxROM, MMC2
scope Mapper9 {
Init:
addi sp, 8
sw ra, -8 (sp)
lli t0, 6-1
add t1, gp, t0
-
sb r0, mapper9_regs - gp_base (t1)
addi t1, -1
bnez t0,-
addi t0, -1
ls_gp(sh r0, mapper9_latch0)
// 0x8000, 8K
jal TLB.AllocateVaddr
lli a0, 0x4000 // align 16K
ls_gp(sw a0, mapper9_prgrom_vaddr + 0*4)
ls_gp(sb a1, mapper9_prgrom_tlb_idx + 0)
// 0xa000, 8K
jal TLB.AllocateVaddr
lli a0, 0x4000 // align 16K
ls_gp(sw a0, mapper9_prgrom_vaddr + 1*4)
ls_gp(sb a1, mapper9_prgrom_tlb_idx + 1)
// 0xc000, 16K
jal TLB.AllocateVaddr
lli a0, 0x8000 // align 32K
ls_gp(sw a0, mapper9_prgrom_vaddr + 2*4)
ls_gp(sb a1, mapper9_prgrom_tlb_idx + 2)
// 4 banks 0x8000, 0xa000, and 0xc000+0xe000 are together
ls_gp(lw a2, mapper9_prgrom_vaddr + 0*4)
ls_gp(lw a3, mapper9_prgrom_vaddr + 1*4)
addi a2, -0x8000
lli t0, 0xa000
sub a3, t0
lli t0, 0xc000
sub t0, a0, t0
la_gp(t1, Write)
lli t2, 0
lli t3, 0x20
-
sw a2, cpu_read_map + 0x80*4 (t2)
sw a3, cpu_read_map + 0xa0*4 (t2)
sw t0, cpu_read_map + 0xc0*4 (t2)
sw t0, cpu_read_map + 0xe0*4 (t2)
// Registers starting from 0xa000
sw t1, cpu_write_map + 0xa0*4 (t2)
sw t1, cpu_write_map + 0xc0*4 (t2)
sw t1, cpu_write_map + 0xe0*4 (t2)
addi t3, -1
bnez t3,-
addi t2, 4
// 0xc000 and 0xe000 are fixed to the last pages
// a0,a1 still have the vaddr, index
mtc0 a1, Index
jal TLB.Map16K
ls_gp(lw a1, prgrom_last_page_phys)
// 0xa000 is fixed to the 3rd from last page
ls_gp(lw a1, prgrom_last_page_phys)
ls_gp(lw a0, mapper9_prgrom_vaddr + 1*4)
ls_gp(lbu t0, mapper9_prgrom_tlb_idx + 1)
addi a1, -0x2000 // 8K
jal TLB.Map8K
mtc0 t0, Index
// Initial bank setup
lli cpu_t0, 0
jal Write
lli cpu_t1, 0xa000
jal Latch0
lli t0, 0x0fd0
jal Latch1
lli t0, 0xfd
// Load our hooked PPU
load_overlay_from_rom(ppu_overlay, mmc2)
la a0, 0
la_gp(a1, ppu_mmc2.FrameLoop)
jal Scheduler.ScheduleTaskFromNow
lli a2, ppu_task
lw ra, -8 (sp)
jr ra
addi ra, -8
Write:
// cpu_t0: value
// cpu_t1: address
srl t0, cpu_t1, 12
subi t0, 0xa
sll t1, t0, 2
add t1, gp
lw t1, jump_table - gp_base (t1)
add t2, gp, t0
jr t1
sb cpu_t0, mapper9_regs - gp_base (t2)
jump_table:
dw prgrom_select, chrrom_fd_0, chrrom_fe_0, chrrom_fd_1, chrrom_fe_1, mirroring
prgrom_select:
ls_gp(lbu t0, mapper9_prgrom_tlb_idx + 0)
ls_gp(lw t1, prgrom_start_phys)
ls_gp(lw t2, prgrom_mask)
ls_gp(lw a0, mapper9_prgrom_vaddr + 0*4)
sll a1, cpu_t0, 13 // 8K
and a1, t2
add a1, t1
// Tail call
j TLB.Map8K
mtc0 t0, Index
mirroring:
andi cpu_t0, 1
// Tail calls
la_gp(a0, ppu_ram)
bnez cpu_t0, HorizontalMirroring
la_gp(a1, ppu_ram + 0x400)
j VerticalMirroring
nop
chrrom_fd_0:
chrrom_fe_0:
chrrom_fd_1:
chrrom_fe_1:
// TODO PPU catchup?
jr ra
nop
Latch0:
// t0: Matching pattern addr, -8
ls_gp(lw t1, chrrom_start)
lli t2, 0x0fd0
beq t0, t2,+
ls_gp(lbu t2, mapper9_regs + 1)
ls_gp(lbu t2, mapper9_regs + 2)
+
ls_gp(lw t3, chrrom_mask)
sll t2, 12 // 4K
and t2, t3
add t2, t1
sw t2, ppu_map + 0*4 (r0)
sw t2, ppu_map + 1*4 (r0)
sw t2, ppu_map + 2*4 (r0)
jr ra
sw t2, ppu_map + 3*4 (r0)
Latch1:
// t0: The tile idx
ls_gp(lw t1, chrrom_start)
lli t2, 0xfd
beq t0, t2,+
ls_gp(lbu t2, mapper9_regs + 3)
ls_gp(lbu t2, mapper9_regs + 4)
+
ls_gp(lw t3, chrrom_mask)
sll t2, 12 // 4K
and t2, t3
add t2, t1
addi t2, -0x1000
sw t2, ppu_map + 4*4 (r0)
sw t2, ppu_map + 5*4 (r0)
sw t2, ppu_map + 6*4 (r0)
jr ra
sw t2, ppu_map + 7*4 (r0)
}
begin_bss()
mapper9_prgrom_vaddr:; dw 0,0,0
mapper9_latch0:; dh 0
mapper9_regs:; fill 6
mapper9_prgrom_tlb_idx:; db 0,0,0
align(4)
end_bss()
| 18.718593 | 81 | 0.66443 |
f8136391c9c303d16407865a23c2157812fd2862 | 697 | asm | Assembly | oeis/220/A220892.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/220/A220892.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/220/A220892.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A220892: G.f.: (1+8*x+22*x^2+8*x^3+x^4)/(1-x)^6.
; Submitted by Jon Maiga
; 1,14,91,364,1085,2666,5719,11096,19929,33670,54131,83524,124501,180194,254255,350896,474929,631806,827659,1069340,1364461,1721434,2149511,2658824,3260425,3966326,4789539,5744116,6845189,8109010,9552991,11195744,13057121,15158254,17521595,20170956,23131549,26430026,30094519,34154680,38641721,43588454,49029331,55000484,61539765,68686786,76482959,84971536,94197649,104208350,115052651,126781564,139448141,153107514,167816935,183635816,200625769,218850646,238376579,259272020,281607781,305457074
add $0,1
mov $2,$0
pow $0,2
mov $1,$2
mul $1,$0
add $2,1
add $2,$1
mul $1,$0
add $2,$1
mov $0,$2
sub $0,4
div $0,3
add $0,1
| 38.722222 | 495 | 0.774749 |
9ca756021ceb939e234a30892f0263a701f50dff | 1,517 | asm | Assembly | src/util/strg/split.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/strg/split.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/strg/split.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | ; Split a string 06/01-92 O.Fink
section string
include win1_keys_err
xdef st_splta ; split string after position
;+++
; split a standard string after a position
; abcdef -> split after 2 -> 1st=ab ; 2nd=cdef
;
; Entry Exit
; a0 ptr to string preserved
; a1 ptr to 1st new string (or 0) preserved
; a2 ptr to 2nd new string (or 0) preserved
; d1.w split after this position preserved
;
; error codes: err.orng split position not in string boundaries
; condition codes set
;---
r_splta reg d1/d2/a0-a2
st_splta
movem.l r_splta,-(sp)
moveq #err.orng,d0
move.w (a0)+,d2
sub.w d1,d2
bmi.s spt_exit ; split position orng
move.l a1,d0
beq.s no_1st
move.w d1,(a1)+ ; copy first string
bra.s spt_end
spt_lp
move.b (a0)+,(a1)+
spt_end
dbra d1,spt_lp
bra.s st1_ok
no_1st adda.w d1,a0
st1_ok move.l a2,d0
beq.s no_2nd
move.w d2,(a2)+ ; copy 2nd string
bra.s spt_end2
spt_lp2
move.b (a0)+,(a2)+
spt_end2
dbra d2,spt_lp2
no_2nd
moveq #0,d0 ; no errors
spt_exit
movem.l (sp)+,r_splta
tst.l d0
rts
end
| 27.089286 | 69 | 0.472643 |
1d017fad3e27d8634e8de6a45b49e41c7846b46d | 758 | asm | Assembly | programs/oeis/286/A286679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/286/A286679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/286/A286679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A286679: Numbers of the form (2*prime(n)^2 + 1)/3.
; 17,33,81,113,193,241,353,561,641,913,1121,1233,1473,1873,2321,2481,2993,3361,3553,4161,4593,5281,6273,6801,7073,7633,7921,8513,10753,11441,12513,12881,14801,15201,16433,17713,18593,19953,21361,21841,24321,24833,25873,26401,29681,33153,34353,34961,36193,38081,38721,42001,44033,46113,48241,48961,51153,52641,53393,57233,62833,64481,65313,66993,73041,75713,80273,81201,83073,85921,89793,92753,95761,97793,100881,105073,107201,111521,117041,118161,123841,124993,128481,130833,134401,139233,141681,142913,145393,152961,158113,160721,166001,168673,172721,180961,182353,195121,199473,206833
add $0,1
seq $0,98090 ; Numbers k such that 2k-3 is prime.
mov $2,$0
sub $2,3
mul $0,$2
div $0,6
mul $0,16
add $0,17
| 63.166667 | 586 | 0.778364 |
1ff72152598cf75619b5a77cbee19d057284c2f4 | 1,403 | asm | Assembly | programs/oeis/209/A209505.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/209/A209505.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/209/A209505.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A209505: Half the number of (n+1) X 3 0..2 arrays with every 2 X 2 subblock having two or four distinct clockwise edge differences.
; 27,123,561,2559,11673,53247,242889,1107951,5053977,23053983,105161961,479701839,2188185273,9981522687,45531242889,207693169071,947403359577,4321630459743,19713345579561,89923466978319,410190643732473,1871106284705727,8535150136063689,38933538110906991,177597390282407577,810119875190223903,3695404595386304361,16856783226551073999,76893106941982761273,350751968256811658367,1599973627400092769289,7298364200486840529711,33291873747634017109977,151862640337196404490463,692729454190713988232361,3159921990279177132180879,14414151043014457684439673,65750911234513934157836607,299926254086540755420303689,1368129447963675908785845231,6240794731645298033088618777,28467714762299138347871403423,129856984348205095673179779561,592349492216427201670156090959,2702033492385725817004420895673,12325468477495774681681792296447,56223275402707421774400119690889,256465440058545559508637013861551,1169880649487312953994384829925977,5336472367319473650954650121906783,24342600537622742346784480949681961,111040057953474764432013104504596239,506515088692128337466496560623617273
seq $0,205312 ; Number of (n+1) X 3 0..1 arrays with every 2 X 2 subblock having the same number of equal edges, and new values 0..1 introduced in row major order.
sub $0,20
div $0,4
mul $0,6
add $0,27
| 155.888889 | 1,065 | 0.893799 |
fcde6c6af5cf84cd38cb9beed0fc117e8e39b916 | 12,922 | asm | Assembly | ugbc/src/hw/6847/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 10 | 2021-10-03T13:44:25.000Z | 2022-03-10T23:53:32.000Z | ugbc/src/hw/6847/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 379 | 2021-08-12T09:46:09.000Z | 2022-03-27T11:29:12.000Z | ugbc/src/hw/6847/plot.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 2 | 2021-11-08T19:37:50.000Z | 2021-11-20T22:27:12.000Z | ; /*****************************************************************************
; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
; *****************************************************************************
; * Copyright 2021-2022 Marco Spedaletti (asimov@mclink.it)
; *
; * Licensed under the Apache License, Version 2.0 (the "License");
; * you may not use this file except in compliance with the License.
; * You may obtain a copy of the License at
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS,
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; * See the License for the specific language governing permissions and
; * limitations under the License.
; *----------------------------------------------------------------------------
; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
; * (la "Licenza"); è proibito usare questo file se non in conformità alla
; * Licenza. Una copia della Licenza è disponibile all'indirizzo:
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Se non richiesto dalla legislazione vigente o concordato per iscritto,
; * il software distribuito nei termini della Licenza è distribuito
; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
; * implicite. Consultare la Licenza per il testo specifico che regola le
; * autorizzazioni e le limitazioni previste dalla medesima.
; ****************************************************************************/
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* PLOT ROUTINE FOR 6847 *
;* *
;* by Marco Spedaletti *
;* *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PLOTX EQU $41 ; $42
PLOTY EQU $43
PLOTM EQU $45
PLOTOMA EQU $46
PLOTAMA EQU $47
;--------------
PLOT
LDD PLOTY
CMPD CLIPY2
BLE PLOTCLIP2
JMP PLOTP
PLOTCLIP2
CMPD CLIPY1
BGE PLOTCLIP3
JMP PLOTP
PLOTCLIP3
LDD PLOTX
CMPD CLIPX2
BLE PLOTCLIP4
JMP PLOTP
PLOTCLIP4
CMPD CLIPX1
BGE PLOTCLIP5
JMP PLOTP
PLOTCLIP5
PLOTMODE
LDA CURRENTMODE
CMPA #0
BNE PLOT0X
JMP PLOT0
PLOT0X
CMPA #1
BNE PLOT1X
JMP PLOT1
PLOT1X
CMPA #2
BNE PLOT2X
JMP PLOT2
PLOT2X
CMPA #3
BNE PLOT3X
JMP PLOT3
PLOT3X
CMPA #4
BNE PLOT4X
JMP PLOT4
PLOT4X
CMPA #5
BNE PLOT5X
JMP PLOT5
PLOT5X
CMPA #6
BNE PLOT6X
JMP PLOT6
PLOT6X
CMPA #7
BNE PLOT7X
JMP PLOT7
PLOT7X
CMPA #8
BNE PLOT8X
JMP PLOT8
PLOT8X
CMPA #9
BNE PLOT9X
JMP PLOT9
PLOT9X
CMPA #10
BNE PLOT10X
JMP PLOT10
PLOT10X
CMPA #11
BNE PLOT11X
JMP PLOT11
PLOT11X
CMPA #12
BNE PLOT12X
JMP PLOT12
PLOT12X
CMPA #13
BNE PLOT13X
JMP PLOT13
PLOT13X
CMPA #14
BNE PLOT14X
JMP PLOT14
PLOT14X
RTS
PLOT0
PLOT1
RTS
; The ALPHA SEMIGRAPHICS – 4 mode translates bits 0 through 3 into a 4 x 6 dot
; element in the standard 8 x 12 dot box. Three data bits may be used to select
; one of eight colors for the entire character box. The extra bit is used to
; switch to alphanumeric. A 512 byte display memory is required. A density of
; 64 x 32 elements is available in the display area. The element area is four
; dot-clocks wide by six lines high.
PLOT2
RTS
; The ALPHA SEMIGRAPHICS – 6 mode maps six 4 x 4 dot elements into the standard
; 8 x 12 dot alphanumeric box, a screen density of 64 x 48 elements is available.
; Six bits are used to generate this map and two data bits may be used to select
; one of four colors in the display box. A 512 byte display memory is required.
; The element area is four dot-clocks wide by four lines high.
PLOT3
RTS
; The ALPHA SEMIGRAPHICS – 8 mode maps eight 4 x 3 dot elements into the
; standard 8 x 12 dot box. This mode requires four memory locations per box
; and each memory location may specify one of eight colors or black.
; A 2048 byte display memory is required. A density of 64 x 64 elements is
; available in the display area. The element area is four dot-clocks wide
; by three lines high.
PLOT4
RTS
; The ALPHA SEMIGRAPHICS – 12 mode maps twelve 4 x 2 dot elements into the
; standard 8 x 12 dot box. This mode requires six memory locations per box and
; each memory location may specify one of eight colors or black. A 3072 byte
; display memory is required. A density of 64 x 96 elements is available in the
; display area. The element area is four dot-clocks wide by two lineshigh.
PLOT5
RTS
; The ALPHA SEMIGRAPHICS – 24 mode maps twenty-four 4 x 1 dot elements into
; the standard 8 x 12 dot box. This mode requires twelve memory locations
; per box and each memory location may specify one of eight colors or black.
; A 6144 byte display memory is required. A density of 64 x 192
; elements is available in the display are. The element area is four
; dot-clocks wide by one line high.
PLOT6
RTS
; The 64 x 64 Color Graphics mode generates a display matrix of 64
; elements wide by 64 elements high. Each element may be one of four
; colors. A 1K x 8 display memory is required. Each pixel equals
; four dot-clocks by three scan lines.
PLOT7
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT40
LDB _PEN
ANDB #$03
LSLB
LSLB
LEAY B, Y
LDB PLOTX+1
ANDB #$03
LEAY B, Y
LDU #PLOTANDBIT4
LEAU B, U
JMP PLOTCOMMON
; The 128 x 64 Graphics Mode generates a matrix 128 elements wide
; by 64 elements high. Each element may be either ON or OFF. However,
; the entire display may be one of two colors, selected by using the
; color set select pin. A 1K x 8 display memory is required. Each
; pixel equals two dotclocks by three scan lines.
PLOT8
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT
LDB PLOTX+1
ANDB #$07
LEAY B, Y
LDU #PLOTANDBIT
LEAU B, U
JMP PLOTCOMMON
; The 128 x 64 Color Graphics mode generates a display matrix 128
; elements wide by 64 elements high. Each element may be one of four
; colors. A 2K x 8 display memory is required. Each pixel equals
; two dot-clocks by three scan lines.
PLOT9
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT40
LDB _PEN
ANDB #$03
LSLB
LSLB
LEAY B, Y
LDB PLOTX+1
ANDB #$03
LEAY B, Y
LDU #PLOTANDBIT4
LEAU B, U
JMP PLOTCOMMON
; The 128 x 96 Graphics mode generates a display matrix 128
; elements wide by 96 elements high. Each element may be either
; ON or OFF. However, the entire display may be one of two colors
; selected by using the color select pin. A 2K x 8 display memory
; is required. Each pixel equals two dot-clocks by two scan lines.
PLOT10
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT
LDB PLOTX+1
ANDB #$07
LEAY B, Y
LDU #PLOTANDBIT
LEAU B, U
JMP PLOTCOMMON
; The 128 x 96 Color Graphics mode generates a display 128 elements
; wide by 96 elements high. Each element may be one of four colors.
; A 3K x 8 display memory is required. Each pixel equals two
; dot-clocks by two scan lines.
PLOT11
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT40
LDB _PEN
ANDB #$03
LSLB
LSLB
LEAY B, Y
LDB PLOTX+1
ANDB #$03
LEAY B, Y
LDU #PLOTANDBIT4
LEAU B, U
JMP PLOTCOMMON
; The 128 x 192 Graphics mode generates a display matrix 128 elements
; wide by 192 elements high. Each element may be either ON or OFF,
; but the ON elements may be one of two colors selected with color
; set select pin. A 3K x 8 display memory is required. Each pixel
; equals two dot-clocks by one scan line.
PLOT12
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT
LDB PLOTX+1
ANDB #$07
LEAY B, Y
LDU #PLOTANDBIT
LEAU B, U
JMP PLOTCOMMON
; The 128 x 192 Color Graphics mode generates a display 128 elements
; wide by 192 elements high. Each element may be one of four colors.
; A 6K x 8 display memory is required. Each pixel equals two dot-clocks
; by one scan line.
PLOT13
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT40
LDB _PEN
ANDB #$03
LSLB
LSLB
LEAY B, Y
LDB PLOTX+1
ANDB #$03
LEAY B, Y
LDU #PLOTANDBIT4
LEAU B, U
JMP PLOTCOMMON
; The 256 x 192 Graphics mode generates a display 256 elements wide by
; 192 elements high. Each element may be either ON or OFF, but the ON
; element may be one of two colors selected with the color set select pin.
; A 6K x 8 display memory is required. Each pixel equals one
; dot-clock by one scan line.
PLOT14
LDX BITMAPADDRESS
LDD PLOTY
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LSLB
ROLA
LEAX D, X
LDD PLOTX
LSRA
RORB
LSRA
RORB
LSRA
RORB
LEAX D, X
LDY #PLOTORBIT
LDB PLOTX+1
ANDB #$07
LEAY B, Y
LDU #PLOTANDBIT
LEAU B, U
JMP PLOTCOMMON
RTS
PLOTCOMMON
;----------------------------------------------
;depending on PLOTM, routine draws or erases
;----------------------------------------------
LDA PLOTM ;(0 = erase, 1 = set, 2 = get pixel, 3 = get color)
CMPA #0
BEQ PLOTE ;if = 0 then branch to clear the point
CMPA #1
BEQ PLOTD ;if = 1 then branch to draw the point
CMPA #2
BEQ PLOTG ;if = 2 then branch to get the point (0/1)
CMPA #3
BEQ PLOTC ;if = 3 then branch to get the color index (0...15)
JMP PLOTP
PLOTD
;---------
;set point
;---------
LDA , X ;get row with point in it
ANDA , U
ORA , Y ;isolate AND set the point
STA , X ;write back to $A000
JMP PLOTP ;skip the erase-point section
;-----------
;erase point
;-----------
PLOTE ;handled same way as setting a point
LDA , X ;get row with point in it
ANDA , U
STA , X ;write back to $A000
JMP PLOTP ;skip the erase-point section
PLOTG
LDA , X ;get row with point in it
ANDA , U
CMPA #0
BEQ PLOTG0
PLOTG1
LDA #$ff
STA PLOTM
JMP PLOTP
PLOTG0
LDA #$0
STA PLOTM
JMP PLOTP
PLOTC
LDA , X ;get row with point in it
STA PLOTM
JMP PLOTP
PLOTP
RTS
;----------------------------------------------------------------
PLOTORBIT
fcb %10000000
fcb %01000000
fcb %00100000
fcb %00010000
fcb %00001000
fcb %00000100
fcb %00000010
fcb %00000001
PLOTANDBIT
fcb %01111111
fcb %10111111
fcb %11011111
fcb %11101111
fcb %11110111
fcb %11111011
fcb %11111101
fcb %11111110
PLOTORBIT40
fcb %00000000
fcb %00000000
fcb %00000000
fcb %00000000
PLOTORBIT41
fcb %01000000
fcb %00010000
fcb %00000100
fcb %00000001
PLOTORBIT42
fcb %10000000
fcb %00100000
fcb %00001000
fcb %00000010
PLOTORBIT43
fcb %11000000
fcb %00110000
fcb %00001100
fcb %00000011
PLOTANDBIT4
fcb %00111111
fcb %11001111
fcb %11110011
fcb %11111100
| 21.288303 | 82 | 0.586287 |
c1cf1880980b9d05f5035b29ae336e3c25fb6ead | 14,654 | asm | Assembly | repeater/simplebus2-repeater.asm | plusvic/simplebus2-intercom | 3839053ac9e2873434345242bca67080197bbab5 | [
"CC0-1.0"
] | 12 | 2021-06-18T19:50:36.000Z | 2022-03-18T08:38:47.000Z | repeater/simplebus2-repeater.asm | plusvic/simplebus2-intercom | 3839053ac9e2873434345242bca67080197bbab5 | [
"CC0-1.0"
] | 3 | 2021-11-05T05:51:18.000Z | 2022-03-30T15:59:20.000Z | repeater/simplebus2-repeater.asm | plusvic/simplebus2-intercom | 3839053ac9e2873434345242bca67080197bbab5 | [
"CC0-1.0"
] | 1 | 2022-03-23T20:08:45.000Z | 2022-03-23T20:08:45.000Z | #include "p12f508.inc"
; CONFIG
; __config 0xFEA
__CONFIG _OSC_IntRC & _WDT_OFF & _CP_OFF & _MCLRE_OFF
#define BUS_RX GP3
#define BUS_TX GP4
#define UART_RX GP1
#define UART_TX GP2
_A equ 07h
_B equ 08h
_C equ 09h
_D equ 0Ah
GPIO_BCKP equ 0Bh
BIT_COUNT equ 0Ch
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Message structure.
;
; 18 12 4 0
; +-----------------------+-------------------------------+---------------+
; | message id | address | checksum |
; +-----------------------+-------------------------------+---------------+
;
; MESSAGE_0[0:4] -> checksum
; MESSAGE_0[4:8] -> address (low bits)
; MESSAGE_1[0:4] -> address (high bits)
; MESSAGE_1[4:8] -> message id (low bits)
; MESSAGE_2[0:2] -> message id (high bits)
;
MESSAGE equ 10h
MESSAGE_0 equ 10h
MESSAGE_1 equ 11h
MESSAGE_2 equ 12h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro for waiting the specified numer of microseconds. The argument must be
; 765 at most.
;
; Registers used: _C
;
wait_us MACRO us
movlw us/.3
movwf _C
decfsz _C, f
goto $-1
ENDM
_sleep MACRO
movfw GPIO
movwf GPIO_BCKP
sleep
ENDM
RES_VECT CODE 0x0000
movwf OSCCAL
goto START
MAIN_PROG CODE
START
; GP1 and GP3 are inputs, the rest are outputs.
movlw b'0001010'
tris GPIO
; Set options.
;
; bit 7 GPWU = 0 Enable wake-up on pin change bit (GP0, GP1, GP3).
; bit 6 GPPU = 0 Enable weak pull-ups bit (GP0, GP1, GP3).
; bit 5 T0CS = 0 Timer0 use internal instruction cycle clock (FOSC/4).
; bit 4 T0SE = 0
; bit 3 PSA = 0 Pre-scaler assigned to Timer0.
; bit 2-0 PS = 111 Pre-scaler rate 1 : 256.
;
movlw b'00000111'
option
bcf GPIO, BUS_TX ; Set BUT_TX low.
btfsc STATUS, GPWUF ; GPWUF is set if the microcontroller has been reset
goto pin_changed ; due to a pin change, if that's the case go ahead
; and see which pin changed, if not go to sleep.
_sleep
pin_changed:
movfw GPIO ; After xoring GPIO with GPIO_BCKP the bits set to
xorwf GPIO_BCKP, f ; 1 correspond to pins that changed.
btfsc GPIO_BCKP, BUS_RX ; If change was in BUS_RX go to bus_rx.
goto bus_rx
btfsc GPIO_BCKP, UART_RX ; If change was in UART_RX go to uart_rx.
goto uart_rx
_sleep
bus_rx:
btfsc GPIO, BUS_RX ; Wait for BUS_RX to go low.
goto $-1
clrf TMR0 ; Now UART_RX is low, reset timer to 0.
btfsc GPIO, BUS_RX ; Wait for BUS_RX to go high. When BUS_RX goes high
goto pulse_detected ; the pulse has finished, go to pulse_detected.
movlw D'250' ; If TMR0 > 250 then 64ms has elapsed without any
subwf TMR0, w ; change in BUS_RX, in that case go to sleep. While
btfss STATUS, C ; in sleep state a change in BUS_RX will wake-up
goto $-5 ; the MCU and execution will start at the entry
; point.
_sleep
pulse_detected:
movf TMR0, w ; TMR0 now contains the amount of time that BUS_RX
movwf _A ; remained in low state, store it in _A.
movlw D'8' ; If it was less than ~2ms ignore the pulse by
subwf _A, w ; going back to bus_rx. TMR0 is incremented
btfss STATUS, C ; every 256 instruction cycles, each cycle is 1us,
goto bus_rx ; 8 x 256us = 2048us -> ~2ms.
movlw D'16' ; BUS_RX in low state during 3ms is a zero bit, we
subwf _A, w ; leave room for inacuracies and consider a zero
btfss STATUS, C ; every pulse between 2048us and 4096us (16 x 256).
goto bit_is_zero ; Go and store the bit, at this point carry is 0.
movlw D'27' ; 6ms means a one, every pulse between 4096us and
subwf _A, w ; 6912us (27 x 256) is considered a one.
btfss STATUS, C
goto bit_is_one
movlw D'61' ; A 17ms pulse indicates the start of a 18-bit
subwf _A, w ; message, lets check if the pulse's length is
btfss STATUS, C ; between 15616us (61 x 256) ....
goto bus_rx
movlw D'71' ; ... and 18176us (71 x 256). If the pulse's length
subwf _A, w ; is not in that range ignore the pulse and go wait
btfsc STATUS, C ; for the next one.
goto bus_rx
clrf MESSAGE_0 ; If this point is reached the pulse is the 17ms
clrf MESSAGE_1 ; preamble indicating the start of a message, lets
clrf MESSAGE_2 ; clear the variables used for storing the message.
clrf BIT_COUNT ; The bit count is also set to 0.
goto bus_rx ; Wait for next pulse.
bit_is_one:
bsf STATUS, C ; Set carry indicating that the received bit is a
; one and add the bit to MESSAGE. When the bit is
; zero we jump directly to bit_is_zero with carry
; cleared.
bit_is_zero: ; At this point the carry holds the value of the
rlf MESSAGE_0, f ; received bit, rotate the message one bit to the
rlf MESSAGE_1, f ; left, with the carry being added as the least
rlf MESSAGE_2, f ; significant bit of MESSAGE_0.
incf BIT_COUNT, f ; Increment BIT_COUNT.
movlw D'18' ; If BIT_COUNT == 18 the whole message has been
subwf BIT_COUNT, w ; read and we can proceed to verify its checksum,
btfss STATUS, Z ; if not, go and wait for next pulse.
goto bus_rx
clrf _C ; Set _C = 0, _C will contain the actual checksum,
; which will be compared later with the expected
; checksum received in the message.
movlw 0xF0 ; Ignore the leftmost 4 bits from the message,
andwf MESSAGE_0, w ; which contain the expected checksum, those bit
call count_ones ; are not included in the checksum.
movf MESSAGE_1, w ; The checksum is the number of bits that are set
call count_ones ; to 1.
movlw 0x03 ; From MESSAGE_2 only the 2 most significant bits
andwf MESSAGE_2, w ; are taken into account.
call count_ones
movlw 0x0F ; Compare the 4 least significant bits of MESSAGE_0
andwf MESSAGE_0, w ; (expected checksum) with _C (actual checksum). The
call reverse_bits ; checksum bits in MESSAGE_0 are reversed, so they
; must be reversed before comparing them with _C.
xorwf _C, w ;
btfsc STATUS, Z ; If they are equal the message is valid and will
goto uart_tx ; be re-transmitted over UART, else go to sleep.
_sleep
uart_tx: ; Transmit the content of message over UART, the
; bits are sent in reverse order as they were
; received from the bus.
call wait_3ms
movfw MESSAGE_2
call uart_tx_byte
movfw MESSAGE_1
call uart_tx_byte
movfw MESSAGE_0
call uart_tx_byte
_sleep
uart_rx:
clrf MESSAGE_0 ; Clear message.
clrf MESSAGE_1
clrf MESSAGE_2
movlw 3 ; Read 3 bytes from UART, the message is only 18
movwf _A ; bits, but we need 3 bytes.
uart_rx_next_byte:
movlw 8 ; Each byte is composed of 8 bits.
movwf BIT_COUNT
wait_us .207 ; Skip start bit (which is always 0 and doesn't
; contain actual data) and half the first bit so
; that we sample UART_RX at the middle of each
; bit. Each bit takes 208us at 4800 bauds.
uart_rx_next_bit:
bcf STATUS, C ; Clear carry....
btfsc GPIO, UART_RX ; and set it only if UART_RX is high, which
bsf STATUS, C ; indicates a 1 being transmitted.
rlf MESSAGE_0, f ; The carry contains the currently transmitted bit,
rlf MESSAGE_1, f ; rotate the message one bit to the left and add
rlf MESSAGE_2, f ; this new bit as the least significant bit.
wait_us .201 ; Wait for the next bit.
decfsz BIT_COUNT, f ; When BIT_COUNT is 0 we have read 8 bits.
goto uart_rx_next_bit
wait_us .204 ; Skip the stop bit.
decfsz _A, f
goto uart_rx_next_byte ; If the 3 bytes has been read, re-transmit the
; the message over the bus.
bus_tx:
call pulse_train ; Transmit preamble. The preamble should be 17ms
call wait_3ms ; and we are waiting 18ms, but this doesn't make
call wait_3ms ; a big difference.
call wait_3ms
call wait_3ms
call wait_3ms
call wait_3ms
call pulse_train
movlw b'00000010'
movwf _C
movfw MESSAGE_2
call bus_tx_bits
movlw b'10000000'
movwf _C
movfw MESSAGE_1
call bus_tx_bits
movlw b'10000000'
movwf _C
movfw MESSAGE_0
call bus_tx_bits
_sleep
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine for counting the number of ones in a byte.
;
; This is the Brian Kerninghan's bit counting algorithm:
; https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
;
; The byte is received in the W register, _C is incremented in the number
; of ones found in W, the caller must initialize _C accordingly. When the
; function exits _A is zero.
;
; Registers used: _A, _C.
;
count_ones:
movwf _A ; _A = W
iorlw 0
btfsc STATUS, Z ; If W is 0.....
retlw 0 ; ...nothing more to do
next_bit:
incf _C, f ; _C = _C + 1
decf _A, w ; W = _A - 1
andwf _A, f ; _A = _A & W
btfss STATUS, Z ; If A is not zero ...
goto next_bit ; ... repeat
retlw 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine that outputs a burst of pulses at 25 kHz during 3ms.
;
; Registers used: _A, _B.
;
pulse_train:
movlw D'75' ; 75 pulses of 40us each -> 25 kHZ during 3ms.
movwf _A
next_pulse:
movlw D'6'
movwf _B
bsf GPIO, BUS_TX ; Set BUS_TX to high.
decfsz _B, f ; Remain 20us in high state. 6 loop iterations
goto $-1 ; take 18 instruction cycles (goto takes 2 cycles).
movlw D'5' ; Plus 2 more instruction cycles.
movwf _B
bcf GPIO, BUS_TX ; Set BUS_TX to low.
decfsz _B, f ; Remain 20us in low state. 5 loop iterations
goto $-1 ; take 15 instruction cyles (goto takes 2 cycles).
decfsz _A, f ; Plus 5 more instruction cyles, 3 here and 2
goto next_pulse ; due to the mov instructions after jumping to
; next_pulse.
retlw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine that waits 3ms.
;
; Registers used: _A, _B.
;
wait_3ms:
movlw D'5'
movwf _A
movlw D'195'
movwf _B
decfsz _B, f
goto $-1
decfsz _A, f
goto $-5
retlw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine that transmits the byte in W over the bus. Only the bits indicated
; by _C are transmitted. For example, for transmitting all the bits in W, _C
; must be initialized with b'10000000', for the 7 least significant bits, _C
; must be b'01000000', and so on. _C must have exactly one bit set, if it's the
; N-th bit, the N least significant bits in W are transmitted.
;
; Registers used: _A (indirectly), _B (indirectly), _C, _D.
;
bus_tx_bits:
movwf _D ; _D = W
movfw _C
bus_tx_next_bit:
andwf _D, w
btfss STATUS, Z ; If bit is zero the first call to wait_3ms is
call wait_3ms ; skipped, resulting in a 3ms low pulse. If bit is
call wait_3ms ; one the low pulse is 6ms long.
call pulse_train
bcf STATUS, C
rrf _C, f
movf _C, w
btfss STATUS, Z
goto bus_tx_next_bit ; When _C is zero there's no more bits to send.
retlw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine that transmits the byte in W at 4800 baud, 8 bits, no parity, via
; the UART_TX pin.
;
; Registers used: _A, _B, _C.
;
uart_tx_byte:
movwf _A ; _A = W
movlw D'8'
movwf _B ; _B = 8, the number of data bits being transmitted.
bcf GPIO, UART_TX ; Transmit start bit.
wait_us .204 ; The duration of each bit at 4800 baud is 208us,
; wait for 204us, the next few instructions before
; take the remaining 4us.
uart_tx_next_bit:
rlf _A, f ; Move the most significant bit of _A to carry
btfss STATUS, C ; If carry is 1 the next instruction is skipped and
goto $+3 ; TX is set high, if carry is 0 TX is set low.
bsf GPIO, UART_TX
goto $+2
bcf GPIO, UART_TX
wait_us .201 ; Wait for 201us.
decfsz _B, f ; When _B is 0 all bits have been transmitted.
goto uart_tx_next_bit
bsf GPIO, UART_TX ; Transmit stop bit.
wait_us .208
retlw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Subroutine that reverses a nibble stored in W. It accepts values from 0x00
; to 0x0F. If input is 0b0001, output will be 0b1000.
;
reverse_bits:
addwf PCL
retlw 0x00 ; 00
retlw 0x08 ; 01
retlw 0x04 ; 02
retlw 0x0C ; 03
retlw 0x02 ; 04
retlw 0x0A ; 05
retlw 0x06 ; 06
retlw 0x0E ; 07
retlw 0x01 ; 08
retlw 0x09 ; 09
retlw 0x05 ; 0A
retlw 0x0D ; 0B
retlw 0x03 ; 0C
retlw 0x0B ; 0D
retlw 0x07 ; 0E
retlw 0x0F ; 0F
END
| 31.04661 | 81 | 0.546335 |
79d943ade20dc45479f38b3b0233a95d23d4d822 | 657 | asm | Assembly | programs/oeis/048/A048777.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/048/A048777.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/048/A048777.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A048777: First partial sums of A005409; second partial sums of A001333.
; 1,5,16,44,113,281,688,1672,4049,9789,23648,57108,137889,332913,803744,1940432,4684641,11309749,27304176,65918140,159140497,384199177,927538896,2239277016,5406092977,13051463021,31509019072,76069501220,183648021569,443365544417
mov $10,$0
mov $12,$0
add $12,1
lpb $12,1
clr $0,10
mov $0,$10
sub $12,1
sub $0,$12
mov $7,$0
mov $9,$0
add $9,1
lpb $9,1
mov $0,$7
sub $9,1
sub $0,$9
mov $4,2
mov $6,1
lpb $0,1
sub $0,1
mov $1,$4
mov $4,$6
add $6,$1
add $4,$6
lpe
add $8,$6
lpe
add $11,$8
lpe
mov $1,$11
| 19.909091 | 228 | 0.614916 |
62b42ca84bad3333afda40eb83666a567e80fe37 | 6,004 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_4233_1483.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_4233_1483.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_4233_1483.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r8
push %rax
push %rbx
push %rcx
// Store
lea addresses_A+0x1ba87, %r10
nop
nop
nop
nop
and %rbx, %rbx
mov $0x5152535455565758, %r11
movq %r11, (%r10)
nop
nop
nop
nop
nop
add $50268, %r10
// Store
lea addresses_D+0x14c27, %rax
nop
nop
nop
nop
and %rcx, %rcx
movw $0x5152, (%rax)
and %r10, %r10
// Store
lea addresses_A+0x1f7, %r12
nop
nop
nop
nop
cmp $46481, %rax
mov $0x5152535455565758, %r8
movq %r8, %xmm3
movups %xmm3, (%r12)
nop
nop
nop
and $47146, %r11
// Store
lea addresses_PSE+0x155c7, %r8
nop
nop
add %r11, %r11
mov $0x5152535455565758, %rax
movq %rax, %xmm5
vmovups %ymm5, (%r8)
nop
nop
nop
nop
dec %r8
// Store
lea addresses_WT+0x15347, %rbx
nop
sub $59272, %rax
movw $0x5152, (%rbx)
nop
nop
nop
nop
xor %rax, %rax
// Store
lea addresses_UC+0x14dc7, %r10
nop
nop
xor %r11, %r11
mov $0x5152535455565758, %rbx
movq %rbx, (%r10)
// Exception!!!
nop
mov (0), %r12
nop
nop
nop
sub $23123, %r11
// Store
lea addresses_A+0xb087, %r8
cmp %rax, %rax
movw $0x5152, (%r8)
nop
nop
nop
and %rbx, %rbx
// Store
mov $0xfb3, %r12
dec %rax
movw $0x5152, (%r12)
nop
nop
nop
nop
dec %rax
// Store
lea addresses_PSE+0x2a87, %r11
nop
dec %r12
mov $0x5152535455565758, %r10
movq %r10, %xmm7
vmovups %ymm7, (%r11)
nop
nop
and $42600, %r8
// Faulty Load
lea addresses_A+0x1ba87, %rcx
nop
sub $9588, %rax
mov (%rcx), %r12d
lea oracles, %rbx
and $0xff, %r12
shlq $12, %r12
mov (%rbx,%r12,1), %r12
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'58': 4233}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 36.609756 | 2,999 | 0.650067 |
5e9bd2183e5022f57c23982afdad9ac4af6bb6fa | 11,276 | asm | Assembly | validation.asm | XlogicX/Validation | d1ef89a8654361c99a8377a0aecc1335db100e7a | [
"MIT"
] | null | null | null | validation.asm | XlogicX/Validation | d1ef89a8654361c99a8377a0aecc1335db100e7a | [
"MIT"
] | null | null | null | validation.asm | XlogicX/Validation | d1ef89a8654361c99a8377a0aecc1335db100e7a | [
"MIT"
] | null | null | null | ; Validation
[ORG 0x7c00]
;Init the environment
xor ax, ax ; make it zero
mov ds, ax ; DS=0
mov ss, ax ; stack starts at 0
mov sp, 0x9c00 ; 200h past code start
mov ah, 0xb8 ; text video memory
mov es, ax ; ES=0xB800
mov al, 0x03
int 0x10
mov ah, 1
mov ch, 0x26
int 0x10
;Fill in all black
mov ch, 0x8 ; whole screens worth
;cbw ; clear ax (black on black with null char)
mov ah, 0x88 ; Fill screen with dark grey color
xor di, di ; first coordinate of video mem
rep stosw ; push it to video memory
mov bp, 0x100 ; initialize validation to 100
mov [0x046C], cx ; initilize timer to zero (cx already is 0 at this point)
waitkey:
; Print the Score
push di ; don't interfere with current video location
mov di, 12 ; video location to print score
call score ; Update validation score
pop di ; restore old video location
; IRL Bonus Check
push bp ; keep a backup of the score
mov bp, [0x046C] ; get current time
mov ax, bp ; get a copy of the time
cmp al, 0x42 ; compare the last byte with 0x42 (will occur up to 38 times in gameplay assuming no user interaction)
jne no_irl ; If it wasn't 0x42, skip the 'IRL' bonus
pop bp ; Get our score back for a second
inc bp ; Add a point to it
push bp ; put score back on the stack (because it's going to get popped in a few instructions)
inc word [0x046c] ; Also increment the clock by a tic, otherwise the score will climb unrestrained.
no_irl:
push di ; Keep back up of old video location
mov di, 2 ; video location of life-timer
call score ; Display the timer on screen
pop di ; restore old video location
cmp bp, 0x25FF ; Almost 9 minutes (8:55)...and 2600!
ja win ; If times up, die
pop bp ; Restore actual score (was being used in conjuction with time before this)
; Key-Press checking
mov ah, 1 ; Is there a key
int 0x16 ; ""
jz waitkey ; If not wait for a key
cbw ; clear ax (Get the key)
int 0x16 ; ""
call pull_lever ; If there was a key press, pull the lever
jmp waitkey ; 'Infinite Loop'
pull_lever:
mov di, 160 * 9 + 20 ; Coordinate of first slot peice (upper left)
; Routine for entire column (slot), this will run 3 times
column_spin:
cmp di, 160 * 9 + 74 ; Check to see if it is trying for the 4th time
je results ; If so, it's now time to see if player won validation
mov si, retweet - 9 ; Get address of ghost sprite before the first one
in al,(0x40) ; Get random
and al, 0x07 ; Mask with 7 possibilities
mov bl, 9 ; We want to multiply by 9 (for sprite size offset)
mul bl
cbw ; clear upper part of ax
add si, ax ; add random offset to base sprite offset
add di, 18 ; Go to the next column
mov dl, 2; Initialize delay (starts fast, gets slower)
spin:
; Delay Loop
mov bx, [0x046C] ; Get timer
add bx,dx ; Add deley
delay:
cmp [0x046C], bx ; Is it there yet
jne delay ; If not, check again
; First Row
add si, 9 ; Go to next sprite
sub di, 1280 ; Go down to next row
call drawsprite ; Draw the sprite
; Rotating - Draw the next two sprites.
; I hate this algorithm. Make sure rotate effect appears from top to bottom
; and that there is out of bounds detection and correction.
; Second Row
cmp si, retweet ; Is the second row the first sprite
jne next_item_a ; If not, don't worry
add si, 63 ; If so, correct next row for last sprite
next_item_a:
sub si, 9 ; Go back another sprite
call drawsprite ; Draw the sprite
; Third Row
cmp si, retweet ; Is the third row the first sprite
jne next_item_b ; If not, don't worry
add si, 63 ; If so, correct next row for last sprite
next_item_b:
sub si, 9 ; Go back another sprite
call drawsprite ; Draw the sprite
; Cleanup
add si, 18 ; Adjust for next rotation
cmp si, bus + 9 ; First Bounds check
jne next_item_c ; Skip if within
mov si, retweet ; Correct
next_item_c:
cmp si, bus + 18 ; Second Bounds check
jne next_item_d ; Skip if within
mov si, fbthumb ; Correct
next_item_d:
sub di, 2560 ; Vertical Adjust graphic coordinate
add dl, 1 ; Get a little slower of spin (0xb4)
cmp dl, 18 ; Check if spinning is done
je column_spin ; If so start to spin the next slot
cmp si, retweet + 54 ; Normal out of bounds check
jne spin ; if not out of bounds, then keep rotating
mov si, retweet - 9 ; if so, reset back to first sprite
jmp spin
results:
; Note that there are some es:addresses being checked, these are a selected pixel
; from one of each of the 3 middle row images. The pixel color happens to be unique
; for each of the 7 image types. So checking for matches can actually work accurately
xor bx,bx ; init amount
mov ax, [es:0x5cb]
cmp ax, [es:0x5dd] ; compare 1 and 2
jne next_slot_a
inc bx ; there was a match
next_slot_a:
cmp ax, [es:0x5ef] ; compare 1 and 3
jne next_slot_b
inc bx ; there was a match
next_slot_b:
mov ax, [es:0x5dd]
cmp ax, [es:0x5ef] ; compare 2 and 3
jne last_slot
inc bx ; there was a match
last_slot:
; At this point, if any two match, bx will have 1. If all 3 match, bx will have 3.
; Now, adjust points won
xchg ax,bx
cbw
mov bl, 10 ; multiply score by 10
mul bl
add al, 5 ; add 5 to the results
cmp al, 5 ; (0*10) + 5 = 5, in other words, no matches, so:
je results_done ; skip to results_done
; In other words, if there was a match of any 2, then 10 points are awarded, otherwise, 30 points
add bp, ax ; add to score
; Now check for penalties, cyberbullying/bus. Note that these checks only happen after the
; checking for matches of two or more
cmp byte [es:0x5cb], 0x99 ; is cyberbully?
jne next_accident_a ; if not, check next image
sub bp, 73 ; if so, subtract 73 points
next_accident_a: cmp byte [es:0x5dd], 0x99 ; is cyberbully?
jne next_accident_b ; if not, check next image
sub bp, 73 ; if so, subtract 73 points
next_accident_b: cmp byte [es:0x5ef], 0x99 ; is cyberbully?
jne bus_check ; if not, then start checking for busses
sub bp, 73 ; if so, subtract 73 points
bus_check: cmp byte [es:0x5cb], 0x66 ; is it a bus?
jne results_done ; if not, then not all 3 were busses, results are done
cmp byte [es:0x5dd], 0x66 ; is it a bus?
jne results_done ; if not, then not all 3 were busses, results are done
cmp byte [es:0x5ef], 0x66 ; is it a bus?
jne results_done ; if not, then not all 3 were busses, results are done
jmp ded ; all 3 were busses, you ded
results_done:
; Subtract a point just for checking your status
sub bp, 5
; Check for suicide death
test bp, bp
js ded
ret
win:
mov ah, 0x22 ; Color for Green
pop bp ; Get score from the stack
cmp bp, 0x126 ; Compare it to the minimum winning score
jae ded_win ; If it's sufficient, stay green and die
ded:
mov ah, 0x44 ; Otherwise, dishonorable death
ded_win:
; Fill in color with everything exept top score line and middle slot row, this way you
; can see time of death, validation at death, and last slot roll
mov di, 160 ; start at 2nd row of screen (so timer and score is still visible)
mov cx, 640 ; fill until 2nd slot row
push cx
rep stosw ; push it to video memory
add di, 1280 ; start again at 3rd slot row
pop cx
rep stosw
halt: jmp halt
drawsprite:
; Gets and unpacks bits that define changes in color for 2 color sprite
xor ax, ax ; ax, must be cleared
mov al, byte [si] ; get the packed colors
shl ax, 4 ; get upper color into ah
shr al, 4 ; restore lower color nibble in al
mov bx, 0x0011 ; have color doubles in each register (xxyy)
push dx ; mul mangles dx, so save it
mul bx ;
pop dx ; restore dx
; Check color and print it
mov bl, 1 ; init index to 2nd byte in sprite data structure
columns:
mov cl, 8 ; 8 pixels a row
row:
pixel_check: bt word [si + bx], 7 ; test bit at row (bx)
jnc noswitch ; see if we need to switch colors
xchg ah, al ; switch the colors
noswitch:
stosw ; paint the color
dec byte [pixel_check + 3] ; next pixel
loop row
; Next column
mov byte [pixel_check + 3], 7 ; reset bit test location
inc bl ; next column (memory)
add di, 144 ; adjust horizontal screen area
cmp bl, 9 ; are we done with rows
jne columns
ret
score:
; Most of this routine is some magic from Peter Ferrie
mov ax, bp
push ax
xchg ah,al
call hex2asc
pop ax ;<----------;
hex2asc: ;
aam 16 ;
call hex2nib ;
hex2nib: ;<------; |
xchg ah,al ; |
cmp al,0ah ; |
sbb al,69h ; |
das ; | Caller
stosb ; | ^
mov al,7 ; | |
stosb ; | |
ret ; -------------1-2-----3
; =========== SPRITE DATA ==========
; 63 bytes total
; 9 bytes per sprite
; Sprite Data structure:
; 1st byte is color data, first nibble is color 1, and 2nd nibble is color 2
; Each byte after is a full row of pixels, however, a 1 or 0 does not correspond
; to a color, it corresponds to if there is a change in color. This makes for a
; more space optimized drawing routine
retweet: db 0x82, 0x00, 0x69, 0x93, 0x63, 0x63, 0x64, 0xcb, 0x00
fbthumb: db 0xf1, 0x06, 0x0a, 0x14, 0x10, 0x30, 0x31, 0xb1, 0xa0
pow: db 0x9e, 0x00, 0x7b, 0x36, 0x17, 0x74, 0x36, 0x6f, 0x00
heart: db 0x04, 0x00, 0x2d, 0x40, 0xc0, 0xa1, 0x12, 0x0c, 0x00
plusone: db 0x4f, 0x00, 0x03, 0x35, 0x4b, 0x33, 0x03, 0x00, 0x00
igheart: db 0xfd, 0x41, 0xbf, 0x27, 0x1b, 0x00, 0xc1, 0x14, 0x00
bus: db 0x6e, 0x00, 0x18, 0x30, 0x60, 0x00, 0x21, 0x41, 0x36
;BIOS sig and padding
times 510-($-$$) db 0
dw 0xAA55
| 40.561151 | 125 | 0.572277 |
5d0371d82dfa1d8d4888c118d973b34d0bfc16f3 | 749 | asm | Assembly | smsq/q40/driver/dv3.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/q40/driver/dv3.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/q40/driver/dv3.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; SMSQ Q40 DV3 Main Routine
section header
xref smsq_end
xref.l dv3_vers
header_base
dc.l dv3_base-header_base ; length of header
dc.l 0 ; module length unknown
dc.l smsq_end-dv3_base ; loaded length
dc.l 0 ; checksum
dc.l 0 ; always select
dc.b 1 ; 1 level down
dc.b 0
dc.w smsq_name-*
smsq_name
dc.w 12,'SMSQ Q40 DV3'
dc.l dv3_vers
dc.w $200a
section base
xref dv3_init
xref fd_init
xref hd_init
xref dv3_addfd
xref qlf_table
; include 'dev8_keys_qdos_sms'
; include 'dev8_keys_sys'
; include 'dev8_smsq_smsq_config_keys'
; include 'dev8_smsq_smsq_base_keys'
dv3_base
bra.l d3r_init
section init
d3r_init
jsr dv3_init ; initialise
lea qlf_table,a1
jsr dv3_addfd
jsr fd_init
jmp hd_init
end
| 15.604167 | 46 | 0.732977 |
3ebe2d7fbbc6cefb30598790116238ecca9a3dd8 | 363 | asm | Assembly | programs/oeis/085/A085062.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/085/A085062.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/085/A085062.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A085062: A085060(n)/9 - 1/3.
; 0,1,1,4,2,4,3,13,4,7,5,13,6,10,7,40,8,13,9,22,10,16,11,40,12,19,13,31,14,22,15,121,16,25,17,40,18,28,19,67,20,31,21,49,22,34,23,121,24,37,25,58,26,40,27,94,28,43,29,67,30,46,31,364,32,49,33,76,34,52,35,121,36,55
mov $1,$0
add $1,4
lpb $0
sub $0,1
mov $2,$1
div $1,2
sub $2,1
gcd $1,$2
add $1,$2
lpe
sub $1,4
div $1,2
| 22.6875 | 213 | 0.586777 |
79e8287dc2067031dec0c660c28557d42fcbc2c7 | 390 | asm | Assembly | oeis/090/A090133.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/090/A090133.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/090/A090133.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A090133: Expansion of (1+4x)/(1+4x+5x^2).
; Submitted by Jon Maiga
; 1,0,-5,20,-55,120,-205,220,145,-1680,5995,-15580,32345,-51480,44195,80620,-543455,1770720,-4365605,8608820,-12607255,7384920,33496595,-170910980,516160945,-1210088880,2259550795,-2987758780,653281145,12325669320
mul $0,2
mov $1,1
mov $2,1
lpb $0
sub $0,2
sub $1,$2
sub $1,$2
add $2,$1
mul $2,5
lpe
mov $0,$2
| 24.375 | 213 | 0.687179 |
fc3663a0f674ae8d216546f04bb3ec4ca4d07dbf | 9,777 | asm | Assembly | transformy/tables/gen/0020.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 3 | 2019-09-18T05:34:22.000Z | 2020-12-04T17:46:52.000Z | transformy/tables/gen/0020.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | null | null | null | transformy/tables/gen/0020.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 1 | 2020-01-17T01:04:24.000Z | 2020-01-17T01:04:24.000Z | ld a, 192
ld hl, basescradr + #09b5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #01f4), a
ld (basescradr + #0b95), a
ld a, 1
ld (basescradr + #02f3), a
ld (basescradr + #08ac), a
ld (basescradr + #0a4e), a
ld a, 224
ld hl, basescradr + #02f4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08d5
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
inc h
ld (hl), a
ld hl, basescradr + #08f5
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 (basescradr + #0eb5), a
ld (basescradr + #0fb5), a
ld a, 2
ld (basescradr + #03f3), a
ld (basescradr + #0930), a
ld (basescradr + #098b), a
ld (basescradr + #0b4e), a
ld (basescradr + #0bd0), a
ld (basescradr + #0bf3), a
ld (basescradr + #0f4d), a
ld a, 31
ld (basescradr + #04f3), a
ld (basescradr + #0ad0), a
ld (basescradr + #0c4e), a
ld (basescradr + #0cae), a
ld (basescradr + #0e11), a
ld (basescradr + #0e6c), a
ld a, 46
ld (basescradr + #05f3), a
ld (basescradr + #09ad), a
ld (basescradr + #0d4e), a
ld (basescradr + #0df4), a
ld a, 240
ld (basescradr + #05f4), a
ld (basescradr + #06f4), a
ld a, 255
ld d,a
ld e,a
ld (basescradr + #0831), de
ld (basescradr + #0c12), de
ld (basescradr + #0c8c), de
ld (basescradr + #0e12), de
ld (basescradr + #06f3), a
ld (basescradr + #0813), a
ld (basescradr + #088c), a
ld (basescradr + #08ad), a
ld (basescradr + #08f4), a
ld (basescradr + #0a13), a
ld (basescradr + #0a31), a
ld (basescradr + #0a8c), a
ld (basescradr + #0aae), a
ld (basescradr + #0af4), a
ld (basescradr + #0cd4), a
ld (basescradr + #0cf4), a
ld (basescradr + #0e30), a
ld (basescradr + #0e8d), a
ld (basescradr + #0ed4), a
ld a, 170
ld d,a
ld e,a
ld (basescradr + #0b12), de
ld hl, basescradr + #0b31
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0b4f
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 + #0b6d
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 + #0b8c
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 + #0bae
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 + #0bd1
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0f12), de
ld hl, basescradr + #0f30
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0f4e
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 + #0f6d
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 + #0f8d
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 + #0fb0
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0fd3), de
ld (basescradr + #07f3), a
ld (basescradr + #0bf4), a
ld a, 248
ld hl, basescradr + #0814
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #07f4), a
ld a, 7
ld (basescradr + #0812), a
ld (basescradr + #086d), a
ld (basescradr + #08cf), a
ld (basescradr + #0a8b), a
ld (basescradr + #0aad), a
ld (basescradr + #0ef4), a
ld a, 14
ld (basescradr + #0912), a
ld (basescradr + #096d), a
ld (basescradr + #0d6c), a
ld (basescradr + #0dd1), a
ld a, 238
ld hl, basescradr + #0931
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0950
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #096e
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 + #098c
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 + #09ae
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 + #09d0
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 + #09f3), de
ld (basescradr + #0d12), de
ld hl, basescradr + #0d30
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #0d4f
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 + #0d6d
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 + #0d8c
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 + #0daf
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 + #0dd2), de
ld (basescradr + #0913), a
ld a, 63
ld (basescradr + #084f), a
ld (basescradr + #0a12), a
ld (basescradr + #0af3), a
ld (basescradr + #0e8c), a
ld a, 252
ld hl, basescradr + #0b14
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 3
ld (basescradr + #0c11), a
ld (basescradr + #0c6c), a
ld (basescradr + #0c8b), a
ld (basescradr + #0e2f), a
ld (basescradr + #0ed1), a
xor a
ld hl, basescradr + #0835
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
inc h
ld (hl), a
ld hl, basescradr + #0855
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
inc h
ld (hl), a
ld hl, basescradr + #086c
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08f1
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 + #096b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #09f2
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 + #0c15
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0cd0
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0cf3
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #1012
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #1013
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
inc h
ld (hl), a
ld hl, basescradr + #1014
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
inc h
ld (hl), a
ld (basescradr + #0875), a
ld (basescradr + #08f0), a
ld (basescradr + #09cf), a
ld (basescradr + #0acf), a
ld (basescradr + #0d4d), a
ld (basescradr + #0e4d), a
ld (basescradr + #0f4c), a
ld (basescradr + #0fd1), a
ld (basescradr + #0ff4), a
ld (basescradr + #1033), a
ld a, 6
ld (basescradr + #0d11), a
ld (basescradr + #0dae), a
ld a, 42
ld (basescradr + #0f11), a
ld (basescradr + #0f6c), a
ld (basescradr + #0fd2), a
ld a, 188
ld (basescradr + #0f14), a
ld a, 254
ld hl, basescradr + #0834
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0c34
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 15
ld (basescradr + #08f2), a
ld (basescradr + #0a30), a
ld a, 10
ld (basescradr + #0b30), a
ld (basescradr + #0b8b), a
ld (basescradr + #0f2f), a
ld (basescradr + #0f8c), a
ld (basescradr + #0faf), a
ld a, 190
ld (basescradr + #0b34), a
ld a, 127
ld (basescradr + #0a6d), a
ld (basescradr + #0c30), a
ld a, 191
ld (basescradr + #0b54), a
ld (basescradr + #0b74), a
ld (basescradr + #0f34), a
ld (basescradr + #0f54), a
ld a, 110
ld (basescradr + #094f), a
ld a, 128
ld hl, basescradr + #0895
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0975
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 a, 239
ld (basescradr + #0994), a
ld (basescradr + #09b4), a
ld (basescradr + #09d4), a
ld (basescradr + #0d74), a
ld (basescradr + #0d94), a
ld (basescradr + #0db4), a
ld (basescradr + #0dd4), a
ld a, 175
ld (basescradr + #0b94), a
ld (basescradr + #0f74), a
ld (basescradr + #0f94), a
ld a, 171
ld (basescradr + #0bb4), a
ld (basescradr + #0bd4), a
ld (basescradr + #0fb4), a
ret
| 15.54372 | 29 | 0.516314 |
d59a3489bc6846d2b22626f0cfbfe181d236ecb0 | 6,695 | asm | Assembly | Transynther/x86/_processed/NONE/_ht_st_zr_/i7-7700_9_0xca.log_19490_1638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_ht_st_zr_/i7-7700_9_0xca.log_19490_1638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_ht_st_zr_/i7-7700_9_0xca.log_19490_1638.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x262, %r15
nop
nop
nop
cmp %rbp, %rbp
movups (%r15), %xmm1
vpextrq $1, %xmm1, %r9
nop
nop
nop
nop
and $41484, %rcx
lea addresses_WT_ht+0x14a62, %rsi
nop
sub %rcx, %rcx
mov (%rsi), %r13w
and $50549, %rsi
lea addresses_UC_ht+0x7de2, %rsi
lea addresses_WT_ht+0x2362, %rdi
nop
nop
nop
nop
cmp $35768, %r9
mov $121, %rcx
rep movsw
nop
dec %rbp
lea addresses_A_ht+0xf262, %rsi
lea addresses_WT_ht+0x7fd2, %rdi
clflush (%rsi)
nop
nop
nop
add %r9, %r9
mov $24, %rcx
rep movsw
nop
nop
nop
nop
nop
and $56854, %r15
lea addresses_UC_ht+0x12e62, %rdi
nop
nop
nop
nop
nop
cmp %r15, %r15
movb (%rdi), %cl
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x16082, %r15
nop
nop
nop
nop
dec %rsi
vmovups (%r15), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %r9
nop
sub $51105, %rbp
lea addresses_UC_ht+0x2262, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub $41248, %r15
movl $0x61626364, (%rdi)
nop
dec %rdi
lea addresses_A_ht+0xaa22, %r13
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%r13), %r9d
nop
nop
nop
cmp $29133, %rbp
lea addresses_WC_ht+0x12de2, %r9
nop
sub %rbp, %rbp
mov (%r9), %r15d
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x133b2, %r13
sub $39045, %rsi
mov (%r13), %r15w
nop
nop
nop
and %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_normal+0x1a262, %rsi
lea addresses_A+0xb45a, %rdi
nop
sub %r9, %r9
mov $73, %rcx
rep movsb
dec %rbx
// Faulty Load
lea addresses_UC+0xd262, %rcx
nop
nop
xor $64753, %rbx
vmovups (%rcx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rsi
lea oracles, %r14
and $0xff, %rsi
shlq $12, %rsi
mov (%r14,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_normal'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'45': 1, '00': 5944, '34': 13545}
00 00 34 34 00 00 34 34 34 00 34 34 34 34 34 34 34 34 34 00 34 34 00 34 34 00 34 34 00 34 00 34 00 00 34 34 34 34 00 34 34 00 34 34 00 34 34 34 34 34 34 34 34 00 34 34 00 34 00 34 34 00 34 34 34 00 00 34 34 34 34 34 34 34 00 34 34 34 34 34 34 34 00 34 00 34 34 34 34 00 00 34 00 34 34 00 00 00 00 34 34 00 34 34 34 34 34 34 00 34 34 00 34 34 34 34 34 34 34 34 00 34 00 00 34 34 34 34 00 34 34 00 00 34 34 34 34 00 34 00 34 34 34 00 34 34 34 34 00 00 00 34 00 34 34 34 00 34 00 34 34 34 00 34 34 34 00 00 34 34 34 34 34 34 34 34 00 34 00 34 00 34 34 34 34 34 34 00 34 34 34 34 34 34 34 34 00 34 34 34 34 34 34 34 34 34 00 34 34 34 34 00 34 34 34 00 34 00 34 34 34 00 34 00 34 00 34 34 00 34 00 34 34 34 34 34 34 34 00 00 34 34 34 34 00 34 34 34 34 00 34 34 34 34 00 00 00 34 34 00 34 34 34 34 34 34 34 00 34 00 00 00 34 34 34 34 00 34 00 00 34 00 00 34 34 00 34 34 34 00 00 34 34 34 34 34 34 34 34 34 34 00 00 34 34 34 34 34 00 34 34 34 34 34 34 34 34 34 00 34 34 34 34 34 00 34 34 34 00 34 00 34 34 00 34 34 00 00 34 00 34 00 34 34 34 00 34 00 34 34 34 00 34 34 34 00 34 00 34 34 34 34 34 34 34 34 34 00 34 34 00 34 00 00 34 34 34 34 34 34 34 34 34 34 34 00 34 34 34 34 00 34 34 00 34 34 00 34 34 34 34 34 00 34 34 00 34 34 00 34 34 34 34 00 34 34 34 00 34 34 00 00 00 34 00 34 34 00 34 00 00 34 34 34 34 34 34 34 34 00 34 34 00 34 34 34 34 34 34 00 00 34 34 34 00 34 00 34 34 00 34 00 00 34 34 34 00 34 00 00 34 34 34 34 34 34 34 34 00 34 34 34 00 00 00 34 34 00 34 34 34 34 34 34 00 34 34 34 00 34 34 00 00 00 34 34 34 34 34 34 00 34 34 34 00 00 34 34 34 00 34 34 00 00 34 34 00 00 34 00 00 34 34 34 34 34 34 34 34 34 34 34 00 34 34 00 34 34 00 34 34 34 00 34 00 00 34 34 00 34 34 34 34 34 34 00 34 34 00 34 00 34 34 00 34 00 34 00 00 34 34 34 00 34 34 34 34 34 00 34 34 00 00 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 00 34 34 34 00 00 00 34 34 34 00 34 00 00 34 34 00 00 00 34 00 00 00 34 00 00 00 34 00 34 00 34 00 34 34 34 34 34 34 00 34 34 34 34 34 34 34 34 34 34 00 34 34 34 34 00 34 34 34 34 34 34 00 00 34 34 34 34 34 34 34 00 00 34 34 34 00 00 00 34 34 34 34 00 34 00 00 34 34 34 00 34 00 34 34 00 34 34 34 34 34 00 00 34 00 34 34 34 34 00 00 34 34 34 34 00 34 34 34 00 34 00 00 00 34 00 34 00 00 34 00 34 00 00 34 34 00 00 00 00 34 00 34 34 00 00 34 34 34 34 34 34 00 34 34 00 34 34 00 34 00 00 34 34 34 34 34 34 34 34 34 00 00 00 00 00 34 34 34 34 34 34 34 00 00 34 00 34 34 00 34 00 34 00 34 34 34 34 00 34 34 34 00 34 34 34 00 34 34 00 34 00 34 34 00 34 00 34 00 34 34 34 00 34 34 00 00 34 34 34 00 00 00 34 00 34 34 34 34 34 34 00 34 34 00 34 34 00 34 00 00 34 34 34 34 00 34 34 34 00 34 34 34 34 00 34 34 00 34 34 34 34 00 00 34 34 00 00 34 00 00 34 34 00 34 34 00 00 34 34 34 34 34 34 00 34 34 34 34 34 34 34 34 00 34 00 34 34 34 00 34 34 00 00 34 34 34 34 34 34 00 00 34 34 34 00 34 34 34 34 34 00 34 00 34 34 34 34 34 34 34 00 34 34 34 00 34 34 34 34 34 34 34 34 34 00 34 34 00 34 00 34 34 34 34 00 34 34 34 34 34 00 00 00 34 34 00 34 00 00 34 00 34 34 34 34 34 34 00 34
*/
| 36.785714 | 2,999 | 0.654817 |
e0cb9e652c1f1166eac8de2dbac6d976267b5848 | 584 | asm | Assembly | programs/oeis/282/A282600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/282/A282600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/282/A282600.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A282600: a(n) = Sum_(k=1..phi(n)) floor(d_k/2) where d_k are the totatives of n.
; 0,0,1,1,4,2,9,6,12,8,25,10,36,18,28,28,64,24,81,36,60,50,121,44,120,72,117,78,196,56,225,120,160,128,204,102,324,162,228,152,400,120,441,210,264,242,529,184,504,240,400,300,676,234,540,324,504,392,841,232,900,450,558,496,768,320,1089,528,748,408,1225,420,1296,648,740,666,1140,456,1521,624,1080,800,1681,492,1344,882,1204,860,1936,528,1620,990,1380,1058,1692,752,2304,1008,1470,980
mov $1,$0
div $0,2
seq $1,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mul $0,$1
div $0,2
| 64.888889 | 383 | 0.702055 |
2d6dc4373150df736d00296e93f7959074b13802 | 499 | asm | Assembly | source/lli_iterate.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | 5 | 2019-07-12T11:30:22.000Z | 2022-03-07T18:39:52.000Z | source/lli_iterate.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | 6 | 2019-07-22T21:34:01.000Z | 2020-02-09T15:09:10.000Z | source/lli_iterate.asm | mateuszstompor/Linked-List-x86-64-ASM | 0652d03458ef65e93a6cad4586dacbd5893c5ed6 | [
"MIT"
] | null | null | null | ;
; Created by Mateusz Stompór on 30/06/2019.
;
%include "source/offsets.asm"
%include "source/iterator.asm"
%include "source/constants.asm"
global LLI_ITERATE
section .text
LLI_ITERATE:
; About
; Gets a pointer to an iterator. Advances it by one
; Takes
; rdi - pointer to an iterator
cmp dword [rdi], NULL_PTR
je finish
mov rax, [rdi]
mov [rdi + LL_ITERATOR_PREVIOUS_OFFSET], rax
mov rax, [rax + LL_NODE_NEXT_OFFSET]
mov [rdi], rax
finish:
ret
| 18.481481 | 55 | 0.667335 |
913345a921332df2cee76963127d4a9602cd06ed | 4,670 | asm | Assembly | Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_21829_960.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_21829_960.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_21829_960.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 %r8
push %r9
push %rbp
push %rbx
push %rdx
lea addresses_UC_ht+0x1ef70, %r8
nop
sub %r9, %r9
vmovups (%r8), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r11
nop
nop
sub $13133, %rbp
lea addresses_normal_ht+0xbe84, %rbp
nop
nop
nop
cmp $54436, %rbx
mov $0x6162636465666768, %r13
movq %r13, %xmm0
and $0xffffffffffffffc0, %rbp
movaps %xmm0, (%rbp)
nop
nop
nop
inc %r9
lea addresses_WT_ht+0x6fb0, %r8
clflush (%r8)
nop
nop
add $24857, %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm4
vmovups %ymm4, (%r8)
nop
nop
nop
nop
nop
and %r11, %r11
pop %rdx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %rbp
push %rcx
push %rsi
// Faulty Load
mov $0x7b0, %r12
and $40767, %rcx
mov (%r12), %r15d
lea oracles, %rbp
and $0xff, %r15
shlq $12, %r15
mov (%rbp,%r15,1), %r15
pop %rsi
pop %rcx
pop %rbp
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 51.318681 | 2,999 | 0.661884 |
19e61ab4e42e0c2d427d7b510c7d4654e99d4844 | 6,909 | asm | Assembly | bootmgr/stage2/echfs.asm | avdgrinten/windozz | 9804e43ad52dcb717463c0f44594d62b00b3601b | [
"MIT"
] | 1 | 2021-01-17T22:10:32.000Z | 2021-01-17T22:10:32.000Z | bootmgr/stage2/echfs.asm | avdgrinten/windozz | 9804e43ad52dcb717463c0f44594d62b00b3601b | [
"MIT"
] | null | null | null | bootmgr/stage2/echfs.asm | avdgrinten/windozz | 9804e43ad52dcb717463c0f44594d62b00b3601b | [
"MIT"
] | null | null | null |
; The Windozz Project
; Copyright (C) 2018-2019 by the Windozz authors.
bits 16
DISK_BUFFER equ 0x8000
DISK_BUFFER_SEGMENT equ 0x800
align 8
echfs_directory_size dq 0 ; in blocks
echfs_allocation_size dd 0 ; in blocks
echfs_directory dd 0 ; starting block
echfs_block_size dw 0 ; in 512-byte sectors
echfs_alloc_per_block dw 0 ; allocation table entries per one block
echfs_entries_per_block db 0 ; directory entries per one block of directory
align 4
dap:
.size dw 16
.sectors dw 0
.offset dw 0
.segment dw 0
.lba dq 0
; Read sectors into high memory
; in: eax = lba
; in: ecx = count
; in: edi = 32-bit absolute address
; out: flags.cf = 0 on success
hdd_read_sector:
mov [.lba], eax
mov [.count], ecx
mov [.address], edi
xor ax, ax
mov dl, [boot_info.bootdisk]
int 0x13
jc .error
.loop:
mov eax, [.lba]
mov dword[dap.lba], eax
mov ecx, [.count]
cmp ecx, 16
jle .final_read
.shrink_size:
mov ecx, 16
.final_read:
pusha
.dot_loop:
push cx
mov ah, 0x0E
mov al, '.'
int 0x10
pop cx
loop .dot_loop
popa
mov [dap.sectors], cx
mov [.current_count], ecx
sub [.count], ecx
add [.lba], ecx
mov word[dap.offset], 0
mov word[dap.segment], DISK_BUFFER_SEGMENT
mov ah, 0x42
mov dl, [boot_info.bootdisk]
mov si, dap
int 0x13
jc .error
call go32
bits 32
mov esi, DISK_BUFFER
mov edi, [.address]
mov ecx, [.current_count]
shl ecx, 9 ; mul 512
add [.address], ecx
cld
rep movsb
call go16
bits 16
cmp dword[.count], 0
jne .loop
; done
clc
ret
.error:
stc
ret
.lba dd 0
.count dd 0
.address dd 0
.current_count dd 0
; Load one block
; in: eax = block number
; in: edi = absolute address to load
; out: eflags.cf = 0 on success
echfs_read_block:
mov [.block], eax
mov [.address], edi
mov eax, [.block]
movzx ebx, word[echfs_block_size]
mul ebx
add eax, [partition.lba]
mov edi, [.address]
movzx ecx, word[echfs_block_size]
call hdd_read_sector
jc .error
ret
.error:
stc
ret
align 4
.block dd 0
.address dd 0
; Detect the next block in the EchFS chain
; in: eax = block number
; out: eflags.cf = 0 on success
; out: eax = next block number
echfs_next_block:
mov [.block], eax
xor edx, edx
movzx ebx, word[echfs_alloc_per_block]
div ebx
add eax, 16
mov [.alloc], eax
shl edx, 3
mov [.entry], edx
mov eax, [.alloc]
mov edi, DISK_BUFFER
call echfs_read_block
jc .error
mov ebp, [.entry]
mov eax, [ds:DISK_BUFFER+bp]
ret
.error:
stc
ret
align 4
.block dd 0
.alloc dd 0
.return dd 0
.entry dd 0
; Load file from echfs volume into high memory
; in: ds:si = filename
; in: edi = absolute address to load at
; out: only returns on success
echfs_load:
mov [.filename], si
mov [.address], edi
mov si, .loading_msg
call print
mov si, [.filename]
call print
mov si, .loading_msg2
call print
mov cx, 0
.count_filename_size:
lodsb
cmp al, 0
je .filename_size_done
inc cx
jmp .count_filename_size
.filename_size_done:
inc cx
mov [.filename_size], cx
; read the boot sector
mov eax, [partition.lba]
mov ecx, 1
mov edi, DISK_BUFFER
call hdd_read_sector
mov si, .disk_msg
jc error
mov si, DISK_BUFFER
add si, 4
mov di, .echfs_signature
mov cx, 8
rep cmpsb
mov si, .bad_fs
jne error
mov si, DISK_BUFFER
mov eax, [si+20] ; directory size
mov dword[echfs_directory_size], eax
mov eax, [si+24]
mov dword[echfs_directory_size+4], eax
mov eax, [si+28]
shr eax, 9 ; div 512
mov word[echfs_block_size], ax
mov eax, [si+12] ; total block count, low qword
mov edx, [si+16] ; high dword
shl edx, 3
mov ecx, eax
shr ecx, 28
or edx, ecx
shl eax, 3
mov ebx, [si+28] ; block size
div ebx
cmp edx, 0 ; remainder
je .read_directory
inc eax
.read_directory:
mov dword[echfs_allocation_size], eax
add eax, 16
mov dword[echfs_directory], eax
mov ax, word[echfs_block_size]
shl ax, 1 ; mul 2 (mul 512, div 256)
mov [echfs_entries_per_block], al
.scan_loop:
; read the directory to find the file
mov eax, dword[echfs_directory]
mov edi, DISK_BUFFER
call echfs_read_block
mov si, .disk_msg
jc error
movzx ecx, byte[echfs_entries_per_block]
mov si, DISK_BUFFER
.scan_block_loop:
xor eax, eax
not eax ; eax = 0xFFFFFFFF
cmp dword[si], eax
jne .next_entry
cmp dword[si+4], eax
jne .next_entry
push si
push cx
add si, 9
mov di, [.filename]
mov cx, [.filename_size]
cld
rep cmpsb
je .found
pop cx
pop si
.next_entry:
add si, 256
loop .scan_block_loop
.end_of_block:
; next block
inc dword[echfs_directory]
inc dword[.block_count]
mov eax, [.block_count]
cmp eax, dword[echfs_directory_size]
mov si, .not_found_msg
jge error
jmp .scan_loop
.found:
; okay, we've found the entry
pop cx
pop si ; si = echfs directory entry
; make sure it's a file, not a directory
cmp byte[si+8], 0x00
push si
mov si, .not_found_msg
jne error
pop si
; okay, safe to load
mov eax, [si+240] ; starting block
mov [.block], eax
mov dword[.block_count], 0
movzx eax, word[echfs_block_size]
shl eax, 6 ; mul 512, div 8
mov [echfs_alloc_per_block], ax
.read_file_loop:
mov eax, [.block]
mov edi, [.address]
call echfs_read_block
mov si, .disk_msg
jc error
mov eax, [.block]
call echfs_next_block
mov si, .disk_msg
jc error
mov [.block], eax
movzx eax, word[echfs_block_size]
shl eax, 9 ; mul 512
add [.address], eax
xor eax, eax
not eax
cmp [.block], eax
jne .read_file_loop
; done!
mov si, newline
call print
ret
align 4
.block dd 0
.block_count dd 0
.filename dw 0
.address dd 0
.filename_size dw 0
.loading_msg db "loading ", 0
.loading_msg2 db "...", 0
.disk_msg db "disk I/O error.", 0
.not_found_msg db "kernel binary is missing.", 0
.echfs_signature db "_ECH_FS_"
.bad_fs db "echfs volume is corrupt.", 0
| 18.473262 | 93 | 0.577797 |
2f7c471509e1da4daf85c514f4dc79d4d6d8749b | 5,540 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_678.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_678.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_678.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xba2, %rsi
lea addresses_UC_ht+0x44c2, %rdi
clflush (%rsi)
xor %r14, %r14
mov $73, %rcx
rep movsl
nop
nop
nop
nop
lfence
lea addresses_UC_ht+0x1bda2, %rdx
nop
nop
nop
and $30537, %r15
vmovups (%rdx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %r8
nop
nop
nop
inc %r8
lea addresses_A_ht+0x16863, %rsi
lea addresses_WC_ht+0xa6bc, %rdi
nop
xor $50065, %r8
mov $118, %rcx
rep movsw
nop
nop
nop
nop
nop
and %r15, %r15
lea addresses_normal_ht+0x49c2, %rsi
lea addresses_D_ht+0x11cc2, %rdi
nop
nop
nop
nop
nop
and $53031, %rax
mov $91, %rcx
rep movsw
nop
nop
nop
dec %rsi
lea addresses_UC_ht+0x6842, %rcx
nop
nop
nop
cmp %rsi, %rsi
movw $0x6162, (%rcx)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_UC+0x12e92, %rcx
nop
nop
xor $17671, %r11
mov $0x5152535455565758, %rbx
movq %rbx, (%rcx)
nop
xor $1864, %rdx
// Faulty Load
lea addresses_normal+0x3ac2, %r11
nop
nop
xor $6331, %r12
mov (%r11), %esi
lea oracles, %r12
and $0xff, %rsi
shlq $12, %rsi
mov (%r12,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_UC', 'congruent': 3}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': True, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 5}}
{'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 3}, 'OP': 'STOR'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 40.437956 | 2,999 | 0.662455 |
f47590a74635d83848f5b1b78b34adafbb0b76a1 | 1,208 | asm | Assembly | Working Disassembly/General/Sprites/Snail Blaster/Map - Snail Blaster.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | 5 | 2021-07-09T08:17:56.000Z | 2022-02-27T19:57:47.000Z | Working Disassembly/General/Sprites/Snail Blaster/Map - Snail Blaster.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/General/Sprites/Snail Blaster/Map - Snail Blaster.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Map_360400: dc.w Frame_360416-Map_360400 ; ...
dc.w Frame_36042A-Map_360400
dc.w Frame_36043E-Map_360400
dc.w Frame_360452-Map_360400
dc.w Frame_360466-Map_360400
dc.w Frame_36047A-Map_360400
dc.w Frame_360482-Map_360400
dc.w Frame_36048A-Map_360400
dc.w Frame_360492-Map_360400
dc.w Frame_36049A-Map_360400
dc.w Frame_3604A2-Map_360400
Frame_360416: dc.w 3
dc.b $F0, 5, 0, 7,$FF,$FC
dc.b $F8, 0, 0, 0,$FF,$F4
dc.b 0, 9, 0, 1,$FF,$F4
Frame_36042A: dc.w 3
dc.b $F0, 5, 0, $B,$FF,$FC
dc.b $F8, 0, 0, 0,$FF,$F4
dc.b 0, 9, 0, 1,$FF,$F4
Frame_36043E: dc.w 3
dc.b $F0, 5, 0, $F,$FF,$FC
dc.b $F8, 0, 0, 0,$FF,$F4
dc.b 0, 9, 0, 1,$FF,$F4
Frame_360452: dc.w 3
dc.b $F0, 5, 0,$13,$FF,$FC
dc.b $F8, 0, 0, 0,$FF,$F4
dc.b 0, 9, 0, 1,$FF,$F4
Frame_360466: dc.w 3
dc.b $F0, 5, 0,$17,$FF,$FC
dc.b $F8, 0, 0, 0,$FF,$F4
dc.b 0, 9, 0, 1,$FF,$F4
Frame_36047A: dc.w 1
dc.b $F4, 2, 0,$1B,$FF,$FC
Frame_360482: dc.w 1
dc.b $FC, 1, 0,$1E,$FF,$FC
Frame_36048A: dc.w 1
dc.b $FC, 0, 0,$21,$FF,$FC
Frame_360492: dc.w 1
dc.b $FC, 0, 0,$22,$FF,$FC
Frame_36049A: dc.w 1
dc.b $FC, 0, 0,$20,$FF,$FC
Frame_3604A2: dc.w 0
| 28.093023 | 46 | 0.581954 |
39fe892120f43d4fd9263ce88d17bd10cdf3592a | 631 | asm | Assembly | oeis/001/A001075.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/001/A001075.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/001/A001075.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A001075: a(0) = 1, a(1) = 2, a(n) = 4*a(n-1) - a(n-2).
; 1,2,7,26,97,362,1351,5042,18817,70226,262087,978122,3650401,13623482,50843527,189750626,708158977,2642885282,9863382151,36810643322,137379191137,512706121226,1913445293767,7141075053842,26650854921601,99462344632562,371198523608647,1385331749802026,5170128475599457,19295182152595802,72010600134783751,268747218386539202,1002978273411373057,3743165875258953026,13969685227624439047,52135575035238803162,194572614913330773601,726154884618084291242,2710046923559006391367,10114032809617941274226
mov $1,1
lpb $0
sub $0,1
add $2,$1
add $1,$2
add $2,$1
lpe
mov $0,$1
| 52.583333 | 495 | 0.812995 |
1dd1d2a9645552d73fa0dd4acd6aa9c6a5e5f16f | 276 | asm | Assembly | programs/oeis/117/A117197.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/117/A117197.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/117/A117197.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A117197: a(n) = (n^3 - 1)^3.
; 0,343,17576,250047,1906624,9938375,40001688,133432831,385828352,997002999,2352637000,5150827583,10590025536,20638466407,38409197624,68669157375,118515478528,198257271191,322546580712,511808023999
mov $1,$0
add $1,1
pow $1,3
sub $1,1
pow $1,3
| 30.666667 | 197 | 0.775362 |
0596ea8976f9cee610652434965b00561d60c311 | 579 | asm | Assembly | programs/oeis/249/A249824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/249/A249824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/249/A249824.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A249824: Permutation of natural numbers: a(n) = A078898(A003961(A003961(2*n))).
; 1,2,3,9,4,12,5,42,17,19,6,59,7,22,26,209,8,82,10,92,31,29,11,292,41,32,115,109,13,129,14,1042,40,39,48,409,15,49,45,459,16,152,18,142,180,52,20,1459,57,202,54,159,21,572,63,542,68,62,23,642,24,69,213,5209,70,199,25,192,73,239,27,2042,28,72,283,242,74,222,30,2292,801,79,33,759,85,89,87,709,34,899,83,259,96,99,107,7292,35,282,278,1009
seq $0,253885 ; Permutation of even numbers: a(n) = A003961(n+1) - 1.
seq $0,3961 ; Completely multiplicative with a(prime(k)) = prime(k+1).
div $0,3
add $0,1
| 72.375 | 336 | 0.690846 |
e45e40b756acbbe43f91f4a926999ba6cd34e215 | 5,768 | asm | Assembly | final/FinalExam.asm | jay3ss/co-sci-917 | 1f6e0536c944286000dc74cf05a266667409312d | [
"BSD-3-Clause"
] | null | null | null | final/FinalExam.asm | jay3ss/co-sci-917 | 1f6e0536c944286000dc74cf05a266667409312d | [
"BSD-3-Clause"
] | null | null | null | final/FinalExam.asm | jay3ss/co-sci-917 | 1f6e0536c944286000dc74cf05a266667409312d | [
"BSD-3-Clause"
] | null | null | null | ; Joshua Saunders
; CO SCI 917
; Final Exam Project:
; FinalExam.asm
;
; Prompt:
;
; Write an assembly language program to input a string from the user. Your
; program should do these two things:
;
; 1. Count and display the number of words in the user input string.
; 2. Flip the case of each character from upper to lower or lower to upper.
;
; For example if the user types in: "Hello thEre. How aRe yOu?"
; Your output should be:
; The number of words in the input string is: 5
; The output string is : hELLO THeRE. hOW ArE YoU?
; .386
.model flat,stdcall
.stack 4096
; Function prototypes
ExitProcess PROTO, dwExitCode:DWORD
CountWords PROTO, sentencePtr:PTR BYTE, numChars:DWORD
InvertSentenceCase PROTO, sourcePtr:PTR BYTE, destPtr:PTR BYTE, strLen:DWORD
InvertLetterCase PROTO
IsSpaceOrPunct PROTO
BUFF_MAX = 128 ; the maximum buffer size
INCLUDE Irvine32.inc
; Data segment
.data
; Input
inputStr BYTE BUFF_MAX DUP(0) ; string input by the user
numWords BYTE 0
; Returned data
invertedStr BYTE BUFF_MAX DUP(0) ; input string with case reversed
inputSize DWORD ?
; Messages
ENTER_STR_PROMPT BYTE "Please enter a string: ",0
NUM_WORDS_MSG BYTE "The number of words in the input string is: ",0
OUTPUT_STRING_MSG BYTE "The output string is: ",0
; Bit mask for case inversion
CASE_INV_BIT_MASK DWORD 20h
; Code segment
.code
main PROC
; Prompt the user for input
mov edx, OFFSET ENTER_STR_PROMPT
call WriteString
mov ecx, BUFF_MAX
mov edx, OFFSET inputStr
call ReadString
mov inputSize, eax
; Count the number of words in the string
INVOKE CountWords,
ADDR inputStr,
inputSize
; Display a message stating the number of words in the string
call Crlf
mov edx, OFFSET NUM_WORDS_MSG
call WriteString
call WriteInt
call Crlf
; Invert the capitalization of the alphabetic characters in the string
INVOKE InvertSentenceCase,
ADDR inputStr,
ADDR invertedStr,
inputSize
; Display a message and the string with the alphabetic characters inverted
mov edx, OFFSET OUTPUT_STRING_MSG
call WriteString
mov edx, OFFSET invertedStr
call WriteString
call Crlf
call WaitMsg
exit
main ENDP
;------------------------------------------------------------------------------
CountWords PROC USES edi ebx ecx edx,
sentencePtr:PTR BYTE,
numChars:DWORD,
; Counts the number of words in a sentence
; Receives:
; sentencePtr: The sentence to count the number of words
; numChars: The number of characters in the sentence
; Returns: EAX = The number of words in the sentence
;------------------------------------------------------------------------------
mov eax,0
; There are no words if the string has a length of zero
.IF(numChars > 0)
mov edi,sentencePtr
mov ebx,0 ; is the current character a space or punctuation?
mov ecx,0 ; is the previous character a space or punctuation?
.WHILE(numChars > 0)
mov bl,[edi]
call IsSpaceOrPunct
.IF(ebx == 1 && ecx == 0) ; don't double count words
inc eax
.ENDIF
mov ecx,ebx ; keep previous state
inc edi
dec numChars
.ENDW
.ENDIF
; We've reached the end of the string. Did it end with a sapce or
; punctuation? We're going to have to check and if it did we're ok, the
; number of words is correct. Otherwise, if the sentence didn't end with a
; space or punctuation then we'll need to add one to the count because the
; last word didn't get counted.
.IF(ebx == 0)
inc eax
.ENDIF
; EAX holds the number of words in the sentence
ret
CountWords ENDP
;------------------------------------------------------------------------------
InvertSentenceCase PROC USES edi esi eax,
sourcePtr:PTR BYTE,
destPtr:PTR BYTE,
strLen:DWORD
; Inverts the case of an entire sentence
; Receives:
; sentencePtr: Pointer to the source sentence
; destPtr: Pointer to the destination sentence
; strLen: Length of the string
;------------------------------------------------------------------------------
mov eax, 0
mov edi, destPtr
mov esi, sourcePtr
.WHILE(strLen > 0)
mov al, [esi]
call InvertLetterCase
mov [edi], al
inc edi
inc esi
dec strLen
.ENDW
ret
InvertSentenceCase ENDP
;------------------------------------------------------------------------------
InvertLetterCase PROC USES ebx ecx
; Inverts the case of a letter. I.e., an uppercase letter is converted to a
; lowercase one and vice versa.
; Receives:
; EAX: The letter to invert
; Returns:
; EAX: The letter with the inverted case
;------------------------------------------------------------------------------
; Don't try to invert the case of a digit!
call IsDigit
jz RETURN
mov ebx, eax
call IsSpaceOrPunct
; If the letter isn't a space or punctuation, then invert its case
.IF(ebx == 0)
xor eax, CASE_INV_BIT_MASK
.ENDIF
RETURN:
ret
InvertLetterCase ENDP
;------------------------------------------------------------------------------
IsSpaceOrPunct PROC
; Determines if a character is in the the following set of characters
; {' ', ',', '.', '!', '?', ';'}
; which are space and some punctuation characters. Will destroy the Zero flag
; Receives:
; EBX: The character to compare
; Returns:
; EBX: 1 if the character is a space or punctuation mark, 0 otherwise
;------------------------------------------------------------------------------
; Note that 59 is the semicolon ASCII value
.IF(ebx == " " || ebx == "," || ebx == "." || ebx == "!" || ebx == "?" || ebx == 59)
mov ebx,1
.ELSE
mov ebx,0
.ENDIF
ret
IsSpaceOrPunct ENDP
END main
| 28.84 | 88 | 0.611477 |
a04bbef7ebb3c98f643fc38d003e385e772df0e1 | 169 | asm | Assembly | text/maps/digletts_cave_route_2_entrance.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | text/maps/DiglettsCaveRoute2.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | text/maps/DiglettsCaveRoute2.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | _DiglettsCaveRoute2Text1::
text "I went to ROCK"
line "TUNNEL, but it's"
cont "dark and scary."
para "If a #MON's"
line "FLASH could light"
cont "it up..."
done
| 16.9 | 26 | 0.668639 |
59d54b128f38e2f4871322511ba9924a804947e2 | 2,136 | asm | Assembly | Transynther/x86/_processed/P/_st_un_/i7-7700_9_0xca_notsx.log_7_1597.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/P/_st_un_/i7-7700_9_0xca_notsx.log_7_1597.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/P/_st_un_/i7-7700_9_0xca_notsx.log_7_1597.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 %r9
push %rax
push %rcx
push %rdx
lea addresses_A_ht+0x1729d, %rcx
nop
and $24866, %rax
mov $0x6162636465666768, %r11
movq %r11, %xmm4
vmovups %ymm4, (%rcx)
nop
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_A_ht+0x5776, %r9
cmp %r11, %r11
movw $0x6162, (%r9)
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_WC_ht+0x19776, %rax
nop
nop
nop
nop
sub $52624, %r14
movb (%rax), %r11b
nop
nop
nop
nop
inc %rdx
lea addresses_normal_ht+0x5c76, %rax
clflush (%rax)
nop
nop
nop
nop
and %r9, %r9
movb (%rax), %r14b
xor %r10, %r10
lea addresses_WC_ht+0xde26, %r11
nop
nop
nop
add $48792, %r9
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%r11)
add %r9, %r9
pop %rdx
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r9
push %rax
// Faulty Load
mov $0xf76, %r12
nop
nop
nop
nop
nop
sub $21119, %r13
movups (%r12), %xmm3
vpextrq $0, %xmm3, %rax
lea oracles, %r10
and $0xff, %rax
shlq $12, %rax
mov (%r10,%rax,1), %rax
pop %rax
pop %r9
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_P'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'e0': 2, 'de': 1, '3c': 4}
de e0 3c e0 3c 3c 3c
*/
| 18.573913 | 127 | 0.643727 |
8f9766ffc2052b5ec5593c10bf74449d2a4eddfe | 5,412 | asm | Assembly | Transynther/x86/_processed/NC/_st_sm_/i7-7700_9_0xca.log_25_1452.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_sm_/i7-7700_9_0xca.log_25_1452.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_sm_/i7-7700_9_0xca.log_25_1452.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 %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1e618, %rsi
lea addresses_A_ht+0x19418, %rdi
nop
sub $34398, %rax
mov $21, %rcx
rep movsl
sub %r11, %r11
lea addresses_WC_ht+0x1405b, %rsi
lea addresses_normal_ht+0x5c18, %rdi
nop
cmp $60487, %r15
mov $99, %rcx
rep movsb
nop
inc %rdi
lea addresses_WT_ht+0x2418, %rcx
add %r8, %r8
movw $0x6162, (%rcx)
nop
nop
add $48776, %rax
lea addresses_WT_ht+0x1c020, %rsi
nop
nop
nop
nop
cmp $50409, %rdi
mov (%rsi), %r11w
nop
nop
nop
nop
and $11231, %rsi
lea addresses_UC_ht+0x14cb0, %rsi
lea addresses_WC_ht+0x126e4, %rdi
nop
nop
nop
nop
add %r10, %r10
mov $52, %rcx
rep movsb
nop
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0x12218, %rax
nop
nop
nop
cmp $34870, %r10
mov $0x6162636465666768, %r8
movq %r8, (%rax)
nop
nop
and %rsi, %rsi
lea addresses_UC_ht+0x1b418, %rax
clflush (%rax)
nop
nop
nop
nop
xor %r8, %r8
mov (%rax), %rdi
nop
nop
nop
and $32261, %r11
lea addresses_UC_ht+0xcdec, %r11
clflush (%r11)
nop
nop
nop
nop
sub $61651, %r10
mov (%r11), %edi
sub %rcx, %rcx
lea addresses_D_ht+0xde18, %r10
cmp %r15, %r15
mov (%r10), %edi
nop
and %rax, %rax
lea addresses_D_ht+0x17c18, %r8
xor %r11, %r11
mov $0x6162636465666768, %rsi
movq %rsi, (%r8)
nop
nop
cmp $20766, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r9
push %rbp
push %rdi
// Store
lea addresses_A+0x14618, %r12
nop
nop
nop
nop
inc %r9
movb $0x51, (%r12)
nop
sub %r12, %r12
// Load
mov $0x7f23780000000c18, %r13
sub %r9, %r9
mov (%r13), %r12d
nop
nop
nop
nop
nop
cmp %r9, %r9
// Store
lea addresses_WT+0x12ca0, %rdi
nop
xor $53362, %rbp
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%rdi)
nop
inc %r12
// Store
lea addresses_D+0x1e572, %rdi
nop
nop
inc %r13
movb $0x51, (%rdi)
nop
nop
sub %rbp, %rbp
// Store
mov $0x7f23780000000c18, %r9
cmp $31259, %r13
mov $0x5152535455565758, %rdi
movq %rdi, (%r9)
nop
nop
and %r14, %r14
// Store
lea addresses_RW+0x6818, %rbp
nop
nop
add $45977, %r11
mov $0x5152535455565758, %r12
movq %r12, (%rbp)
nop
nop
nop
nop
xor %rdi, %rdi
// Store
mov $0x7f23780000000c18, %r9
sub $22990, %rdi
movl $0x51525354, (%r9)
nop
nop
nop
nop
add %r14, %r14
// Store
lea addresses_US+0xe018, %r13
sub $7016, %r14
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%r13)
and %r12, %r12
// Faulty Load
mov $0x7f23780000000c18, %r9
nop
nop
nop
nop
cmp $15500, %r11
movups (%r9), %xmm0
vpextrq $0, %xmm0, %r13
lea oracles, %r14
and $0xff, %r13
shlq $12, %r13
mov (%r14,%r13,1), %r13
pop %rdi
pop %rbp
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_A'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': True, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': True, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}}
{'54': 25}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 21.47619 | 152 | 0.639874 |
bd60ab0519f00f44f9bda1d20287b7c53fdd77b5 | 2,002 | asm | Assembly | savefile/maps/0A32_StrangeBush.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 35 | 2018-04-01T06:55:28.000Z | 2021-05-09T19:09:42.000Z | savefile/maps/0A32_StrangeBush.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 4 | 2018-04-01T15:32:55.000Z | 2019-02-23T20:46:49.000Z | savefile/maps/0A32_StrangeBush.asm | stranck/fools2018-1 | 1c506b17343fcdfa708aafaf8e596153e2c63254 | [
"MIT"
] | 12 | 2018-04-01T15:48:09.000Z | 2021-01-27T10:22:33.000Z | SECTION "Map_0A32", ROM0[$B800]
Map_0A32_Header:
hdr_tileset 0
hdr_dimensions 5, 5
hdr_pointers_a Map_0A32_Blocks, Map_0A32_TextPointers
hdr_pointers_b Map_0A32_Script, Map_0A32_Objects
hdr_pointers_c Map_0A32_InitScript, Map_0A32_RAMScript
hdr_palette $06
hdr_music MUSIC_ROUTES2, AUDIO_1
hdr_connection NORTH, $0932, 6, 18
hdr_connection SOUTH, $0000, 0, 0
hdr_connection WEST, $0000, 0, 0
hdr_connection EAST, $0000, 0, 0
Map_0A32_Objects:
hdr_border $0f
hdr_warp_count 0
hdr_sign_count 1
hdr_signpost 2, 5, $01
hdr_object_count 0
Map_0A32_RAMScript:
rs_write_2 $c6f9, $0a, $4d
rs_write_2 $c704, $0a, $4d
rs_end
Map_0A32_Blocks:
db $0f,$0f,$0f,$0a,$4d
db $62,$51,$51,$0a,$4d
db $4e,$4c,$0a,$0a,$4d
db $50,$52,$52,$52,$4f
db $0f,$0f,$0f,$0f,$0f
Map_0A32_TextPointers:
dw Map_0A32_TX1
Map_0A32_InitScript:
ret
Map_0A32_Script:
ldh a, [$f5]
and SELECT
ret z
ld hl, MapScriptGeneralPurpose
set 0, [hl]
call OpenTextboxInOverworld
ld hl, Map_0A32_YouDidIt
call PrintTextEnhanced
ld a, [MapScriptGeneralPurpose]
cp $07
jr z, .final
call CloseTextboxInOverworld
ret
.final
ld hl, Map_0A32_Finished
call PrintTextEnhanced
call CloseTextboxInOverworld
ld a, SFX_CUT
call PlaySound
call WaitForSoundToFinish
ld a, $8a
ld [MapWarpTargetIDL], a
ld a, $09
ld [MapWarpTargetIDH], a
ld a, 5
ld [MapWarpTargetX], a
ld [MapWarpTargetY], a
jp StartLoadingMap
Map_0A32_TX1:
TX_ASM
jp EnhancedTextOnly
tx_braille
text "PRESS_SELECT"
done
Map_0A32_YouDidIt:
text "It sounded as if a door"
next "opened somewhere far away."
tx_snd SFX_GO_INSIDE
wait
Map_0A32_Finished:
text "You fall into a cave, as the"
next "ground beneath you crumbles."
wait
| 22.75 | 63 | 0.644855 |
7b8a7e0e4e374e8069a5748d64d4ab9b49aed9d3 | 872 | asm | Assembly | Laboratorio/Relatorio_08/Resposta Rel_08/prog23.asm | 0Augusto/hello-world | 9fd2c7b00a6c3cbe696f7eff8db4e89a8d7b4ae2 | [
"Apache-2.0"
] | 1 | 2022-03-03T17:22:30.000Z | 2022-03-03T17:22:30.000Z | Laboratorio/Relatorio_08/Resposta Rel_08/prog23.asm | 0Augusto/hello-world | 9fd2c7b00a6c3cbe696f7eff8db4e89a8d7b4ae2 | [
"Apache-2.0"
] | null | null | null | Laboratorio/Relatorio_08/Resposta Rel_08/prog23.asm | 0Augusto/hello-world | 9fd2c7b00a6c3cbe696f7eff8db4e89a8d7b4ae2 | [
"Apache-2.0"
] | null | null | null | # Variaveis associadas aos registradores:
# endBase -> $16
# k -> $17
# x -> $18
# y -> $19
.data
x: .word 3
y: .word 4
.text
.globl main
main:
addi $8, $0, 0x1001 # t0 = 0x00001001
sll $16, $8, 0x10 # t0 = 0x10010000
lw $18, 0x0($16) # x = mem[0 + endBase]
lw $19, 0x4($16) # y = mem[4 + endBase]
add $17, $0, $10 # k = x^y
add $8, $0, $18 # t0 = x
add $10, $0, $19 # t2 = y
add $10, $10, -1 # t2 = y - 1
doExterno:
add $9, $0, $18 # t1 = x
add $11, $0, $0 # t3 = 0
doInterno:
add $11, $11, $8 # t3 = t3 + t0
addi $9, $9, -1 # t1 = t1 - 1
bne $9, $0, doInterno # if (t1 != 0) goto doInterno
add $8, $0, $11 # t0 = t3
addi $10, $10, -1 # t2 = t2 - 1
bne $10, $0, doExterno # if (t2 != 0) goto doExterno
add $17, $0, $11 # k = x^y
sw $17, 0x8($16) # mem[8 + endBase] = k
| 23.567568 | 56 | 0.463303 |
566ae83b025c90bd3d83cdb04121dbad166ffbee | 1,792 | asm | Assembly | SrcAll/BCD.asm | mytechnotalent/c64-assembly | a733cf03ca295562f12027a02c63b39cf3d15725 | [
"Apache-2.0"
] | 2 | 2020-07-28T18:29:54.000Z | 2020-07-29T14:23:11.000Z | SrcAll/BCD.asm | mytechnotalent/c64-assembly | a733cf03ca295562f12027a02c63b39cf3d15725 | [
"Apache-2.0"
] | null | null | null | SrcAll/BCD.asm | mytechnotalent/c64-assembly | a733cf03ca295562f12027a02c63b39cf3d15725 | [
"Apache-2.0"
] | 1 | 2021-08-04T20:27:35.000Z | 2021-08-04T20:27:35.000Z |
BCD_Show:
ldy #0
BCD_ShowDirect:
tya
pha
pushpair z_de
lda (z_de),y
jsr PrintBCDChar
pullpair z_de
pla
tay
iny
dex
bne BCD_ShowDirect
rts
BCD_Add:
txa
tay
dey
php
sed ;Set Decimal
clc
BCD_Add_Again:
lda (z_de),y
adc (z_hl),y
ifdef BuildNES
jsr NesBCD_ADC
endif
sta (z_de),y
dex
beq BCD_Add_Done
dey
jmp BCD_Add_Again
BCD_Add_Done:
plp
rts
BCD_Subtract:
txa
tay
dey
php
sed ;Set Decimal
sec
BCD_Subtract_Again:
lda (z_de),y
sbc (z_hl),y
ifdef BuildNES
jsr NesBCD_SBC
endif
sta (z_de),y
dex
beq BCD_Subtract_Done
dey
jmp BCD_Subtract_Again
BCD_Subtract_Done:
plp
rts
PrintBCDChar:
pha
and #$F0
jsr SwapNibbles
jsr PrintBCDCharOne
pla
and #$0F
PrintBCDCharOne:
clc
adc #'0'
jmp PrintChar
BCD_Cp:
txa
tay
dey
sed ;Set Decimal
BCD_Cp_Again:
lda (z_hl),y
cmp (z_de),y
bne BCD_Cp_Done
dex
beq BCD_Cp_Done
dey
jmp BCD_Cp_Again
BCD_Cp_Done:
cld ;decimal off
rts
ifdef BuildNES
NesBCD_ADC: ;Nes has no BCD, so make some fixup routines
pha
and #$0F
cmp #$0A
bcc NesBCD_ADC_NoOverflow
pla
sec
sbc #$0A
clc
adc #$10
pha
NesBCD_ADC_NoOverflow:
pla
pha
and #$F0
cmp #$A0
bcc NesBCD_ADC_NoOverflow2
pla
sec
sbc #$A0
sec
rts
NesBCD_ADC_NoOverflow2:
clc
pla
rts
NesBCD_SBC: ;Nes has no BCD, so make some fixup routines
pha
and #$0F
cmp #$0A
bcc NesBCD_SBC_NoOverflow
pla
sec
sbc #$06
;sec
;sbc #$10
pha
NesBCD_SBC_NoOverflow:
pla
pha
and #$F0
cmp #$A0
bcc NesBCD_SBC_NoOverflow2
pla
sec
sbc #$60
clc
rts
NesBCD_SBC_NoOverflow2:
sec
pla
rts
endif
| 11.86755 | 58 | 0.626116 |
f81126e9d2ba57a396e33ebf3674bcde235a6c7a | 5,784 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2413.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2413.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2413.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 %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1e390, %r11
nop
nop
nop
and $32655, %r8
mov $0x6162636465666768, %rax
movq %rax, (%r11)
nop
nop
nop
and %r14, %r14
lea addresses_D_ht+0xb90, %rbx
nop
nop
nop
dec %rdx
movb (%rbx), %al
nop
nop
add $51908, %rdx
lea addresses_WT_ht+0x1e378, %rsi
lea addresses_normal_ht+0x2810, %rdi
nop
nop
nop
nop
and $61460, %rax
mov $55, %rcx
rep movsw
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_normal_ht+0xc090, %rax
nop
nop
nop
nop
nop
and $50083, %rbx
movb (%rax), %dl
nop
nop
nop
nop
nop
cmp %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r9
push %rbp
push %rbx
push %rsi
// Load
lea addresses_A+0x16760, %r13
nop
nop
nop
cmp %rbx, %rbx
vmovups (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rsi
nop
sub %r9, %r9
// Store
lea addresses_PSE+0x3550, %rbp
nop
nop
nop
nop
nop
inc %r14
mov $0x5152535455565758, %rbx
movq %rbx, (%rbp)
nop
nop
nop
nop
nop
and %r13, %r13
// Load
lea addresses_RW+0x4f9e, %r13
nop
nop
nop
nop
cmp $37346, %r10
vmovups (%r13), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rbx
nop
nop
nop
nop
nop
add $34852, %r10
// Faulty Load
lea addresses_WT+0x4c10, %rsi
nop
sub %rbx, %rbx
mov (%rsi), %r13d
lea oracles, %rbx
and $0xff, %r13
shlq $12, %r13
mov (%rbx,%r13,1), %r13
pop %rsi
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 35.703704 | 2,999 | 0.658195 |
08facbd1ccde4c386fbdcaa1dfcec2236d696dc9 | 4,856 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/mod_1_4.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/mod_1_4.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/mod_1_4.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl SPARC T3/T4/T5 mpn_mod_1s_4p.
dnl Contributed to the GNU project by Torbjörn Granlund.
dnl Copyright 2013 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP 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 General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C UltraSPARC T3: 30
C UltraSPARC T4/T5: 4
C INPUT PARAMETERS
define(`ap', `%o0')
define(`n', `%o1')
define(`d', `%o2')
define(`cps', `%o3')
ASM_START()
REGISTER(%g2,#scratch)
REGISTER(%g3,#scratch)
PROLOGUE(mpn_mod_1s_4p)
save %sp, -176, %sp
ldx [%i3+16], %o4
ldx [%i3+24], %o3
ldx [%i3+32], %o2
ldx [%i3+40], %o1
ldx [%i3+48], %o0
and %i1, 3, %g3
sllx %i1, 3, %g1
add %i0, %g1, %i0
brz %g3, L(b00)
cmp %g3, 2
bcs %xcc, L(b01)
nop
be %xcc, L(b10)
nop
L(b11): ldx [%i0-16], %g2
mulx %g2, %o4, %g5
umulxhi(%g2, %o4, %g3)
ldx [%i0-24], %g4
addcc %g5, %g4, %g5
addxc( %g3, %g0, %g4)
ldx [%i0-8], %g2
mulx %g2, %o3, %g1
umulxhi(%g2, %o3, %g3)
addcc %g1, %g5, %g1
addxc( %g3, %g4, %g2)
ba,pt %xcc, .L8
add %i0, -32, %i0
L(b00): ldx [%i0-24], %g3
mulx %g3, %o4, %g2
umulxhi(%g3, %o4, %g5)
ldx [%i0-32], %g4
addcc %g2, %g4, %g2
addxc( %g5, %g0, %g3)
ldx [%i0-16], %g4
mulx %g4, %o3, %g5
umulxhi(%g4, %o3, %i5)
addcc %g2, %g5, %g5
addxc( %g3, %i5, %g4)
ldx [%i0-8], %g2
mulx %g2, %o2, %g1
umulxhi(%g2, %o2, %g3)
addcc %g1, %g5, %g1
addxc( %g3, %g4, %g2)
ba,pt %xcc, .L8
add %i0, -40, %i0
L(b01): ldx [%i0-8], %g1
mov 0, %g2
ba,pt %xcc, .L8
add %i0, -16, %i0
L(b10): ldx [%i0-8], %g2
ldx [%i0-16], %g1
add %i0, -24, %i0
.L8: add %i1, -5, %g3
brlz,pn %g3, L(end)
nop
L(top): ldx [%i0-16], %i4
mulx %i4, %o4, %o5
umulxhi(%i4, %o4, %i1)
ldx [%i0-24], %i5
addcc %o5, %i5, %o5
addxc( %i1, %g0, %i4)
ldx [%i0-8], %i5
mulx %i5, %o3, %o7
umulxhi(%i5, %o3, %i1)
addcc %o5, %o7, %o7
addxc( %i4, %i1, %i5)
ldx [%i0+0], %g4
mulx %g4, %o2, %i1
umulxhi(%g4, %o2, %i4)
addcc %o7, %i1, %i1
addxc( %i5, %i4, %g4)
mulx %g1, %o1, %i5
umulxhi(%g1, %o1, %i4)
addcc %i1, %i5, %i5
addxc( %g4, %i4, %g5)
mulx %g2, %o0, %g1
umulxhi(%g2, %o0, %g4)
addcc %g1, %i5, %g1
addxc( %g4, %g5, %g2)
add %g3, -4, %g3
brgez,pt %g3, L(top)
add %i0, -32, %i0
L(end): mulx %g2, %o4, %g5
umulxhi(%g2, %o4, %g3)
addcc %g1, %g5, %g5
addxc( %g3, %g0, %g2)
ldx [%i3+8], %i0
ldx [%i3], %g4
sub %g0, %i0, %i5
srlx %g5, %i5, %i5
sllx %g2, %i0, %g2
or %i5, %g2, %g1
mulx %g1, %g4, %l7
umulxhi(%g1, %g4, %g3)
sllx %g5, %i0, %g2
add %g1, 1, %g1
addcc %l7, %g2, %g5
addxc( %g3, %g1, %g1)
mulx %g1, %i2, %g1
sub %g2, %g1, %g2
cmp %g2, %g5
add %i2, %g2, %g1
movlu %xcc, %g2, %g1
subcc %g1, %i2, %g2
movgeu %xcc, %g2, %g1
return %i7+8
srlx %g1, %o0, %o0
EPILOGUE()
PROLOGUE(mpn_mod_1s_4p_cps)
save %sp, -176, %sp
lzcnt( %i1, %i5)
sllx %i1, %i5, %i1
call mpn_invert_limb, 0
mov %i1, %o0
stx %o0, [%i0]
sra %i5, 0, %g1
stx %g1, [%i0+8]
sub %g0, %i5, %g2
srlx %o0, %g2, %g2
mov 1, %g1
sllx %g1, %i5, %g1
or %g2, %g1, %g2
sub %g0, %i1, %g1
mulx %g2, %g1, %g2
srlx %g2, %i5, %g1
stx %g1, [%i0+16]
umulxhi(%o0, %g2, %g3)
add %g2, %g3, %g3
xnor %g0, %g3, %g3
mulx %g3, %i1, %g3
mulx %g2, %o0, %g2
cmp %g2, %g3
add %i1, %g3, %g1
movgeu %xcc, %g3, %g1
srlx %g1, %i5, %g2
stx %g2, [%i0+24]
umulxhi(%o0, %g1, %g3)
add %g1, %g3, %g3
xnor %g0, %g3, %g3
mulx %g3, %i1, %g3
mulx %g1, %o0, %g1
cmp %g1, %g3
add %i1, %g3, %g2
movgeu %xcc, %g3, %g2
srlx %g2, %i5, %g1
stx %g1, [%i0+32]
umulxhi(%o0, %g2, %g3)
add %g2, %g3, %g3
xnor %g0, %g3, %g3
mulx %g3, %i1, %g3
mulx %g2, %o0, %g2
cmp %g2, %g3
add %i1, %g3, %g1
movgeu %xcc, %g3, %g1
srlx %g1, %i5, %g2
stx %g2, [%i0+40]
umulxhi(%o0, %g1, %g2)
add %g1, %g2, %g2
xnor %g0, %g2, %g2
mulx %g2, %i1, %g2
mulx %g1, %o0, %o0
cmp %o0, %g2
add %i1, %g2, %g3
movgeu %xcc, %g2, %g3
srlx %g3, %i5, %i5
stx %i5, [%i0+48]
return %i7+8
nop
EPILOGUE()
| 20.752137 | 79 | 0.574753 |
3b30db4c02558402a308c86d1916d59f8e673985 | 1,499 | asm | Assembly | Borland/CBuilder5/Source/RTL/source/cstrings/wmemchr.asm | TrevorDArcyEvans/DivingMagpieSoftware | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | 1 | 2021-05-27T10:27:25.000Z | 2021-05-27T10:27:25.000Z | Borland/CBuilder5/Source/RTL/source/cstrings/wmemchr.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | Borland/CBuilder5/Source/RTL/source/cstrings/wmemchr.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | ;[]-----------------------------------------------------------------[]
;| WMEMCHR.ASM -- search for a wide character |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1996, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include RULES.ASI
; Segments Definitions
Header@
;-----------------------------------------------------------------------
;
;Name _wmemchr - search for a wide character
;
;Usage void *_wmemchr(const void *s, int val, size_t n);
;
;Prototype in mem.h & string.h
;
;Description _wmemchr scans up to n words at the memory location s
; looking for a match to val.
;
;Return value If val was matched then the return value is a
; pointer to the first matching position, otherwise it
; is NULL.
;
;-----------------------------------------------------------------------
Code_seg@
Func@ _wmemchr, _EXPFUNC, _RTLENTRY, <pointer s>, <int val>, <int n>
Link@ edi
mov edi, s
mov ecx, n
jecxz notfound
mov ax, val
cld
repne scasw
jne notfound
lea eax,[edi-2]
return:
Unlink@ edi
Return@
notfound:
xor eax, eax ; not found, return NULL
jmp return
EndFunc@ _wmemchr
Code_EndS@
end | 24.57377 | 72 | 0.437625 |
3b7a13b626a233aea78d53d0c955b99aac6a2495 | 1,333 | asm | Assembly | CISP 310/Midterm 1.asm | gb-camera/college-hw | e36d275ed7fad0a0fdb711a2a4abc82860bc3fcd | [
"Unlicense"
] | null | null | null | CISP 310/Midterm 1.asm | gb-camera/college-hw | e36d275ed7fad0a0fdb711a2a4abc82860bc3fcd | [
"Unlicense"
] | null | null | null | CISP 310/Midterm 1.asm | gb-camera/college-hw | e36d275ed7fad0a0fdb711a2a4abc82860bc3fcd | [
"Unlicense"
] | null | null | null | ; CISP 310 - Michael Dinh
; Midterm 1 - Question 7
; 11/01/2020
INCLUDE io.h
.DATA
; program variables
prompt BYTE "Enter a number.", 0
string BYTE 40 DUP (?)
resultLb BYTE "The largest value was", 0
largest BYTE 11 DUP (?)
.CODE
MainProc PROC
; reserve stack space
sub rsp, 120
; since we need to loop for ten numbers,
; compare values on the fly and loop the same input 10 times
mov ebx, 0 ; keep largest value in ebx
mov ecx, 0 ; keep a tally in ecx
whileN: cmp ecx, 10 ; escape condition if tally is 10
je endWhileN
input prompt, string, 40 ; get user input
atod string ; convert it
cmp eax, ebx ; compare the values in eax and ebx
jl lesser ; jump if eax is less than ebx
; if we didn't jump, eax is greater
mov ebx, eax ; move the value in eax to ebx
; if we did jump, ebx is greater (and thus we don't do anything)
lesser: inc ecx ; increment the counter
jmp whileN ; loop again
endWhileN:
; now we need to output the value we got
dtoa largest, ebx
output resultLb, largest
; program end
add rsp, 120 ; restore stack
mov rax, 0 ; value to return (0)
ret
MainProc ENDP
END
| 25.150943 | 72 | 0.591898 |
9d249e384dbe369e0e0a070cd0459f04c1b1ef76 | 908 | asm | Assembly | programs/oeis/266/A266732.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/266/A266732.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/266/A266732.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A266732: a(n) = 10*binomial(n+4, 5).
; 0,10,60,210,560,1260,2520,4620,7920,12870,20020,30030,43680,61880,85680,116280,155040,203490,263340,336490,425040,531300,657800,807300,982800,1187550,1425060,1699110,2013760,2373360,2782560,3246320,3769920,4358970,5019420,5757570,6580080,7493980,8506680,9625980,10860080,12217590,13707540,15339390,17123040,19068840,21187600,23490600,25989600,28696850,31625100,34787610,38198160,41871060,45821160,50063860,54615120,59491470,64710020,70288470,76245120,82598880,89369280,96576480,104241280,112385130,121030140,130199090,139915440,150203340,161087640,172593900,184748400,197578150,211110900,225375150,240400160,256215960,272853360,290343960,308720160,328015170,348263020,369498570,391757520,415076420,439492680,465044580,491771280,519712830,548910180,579405190,611240640,644460240,679108640,715231440,752875200,792087450,832916700,875412450
add $0,4
bin $0,5
mul $0,10
| 129.714286 | 839 | 0.854626 |
2ffd8fdf881190129aa6abc4304db15cbf8fdf83 | 513 | asm | Assembly | brokenthorn os dev test 2 os-phil/dng.pgm/osdev/osdev3-boot1.asm | kwccoin/bare_metal | 455c3cc7be9df56453fa145cc4862a1cc91646b9 | [
"BSD-2-Clause"
] | null | null | null | brokenthorn os dev test 2 os-phil/dng.pgm/osdev/osdev3-boot1.asm | kwccoin/bare_metal | 455c3cc7be9df56453fa145cc4862a1cc91646b9 | [
"BSD-2-Clause"
] | null | null | null | brokenthorn os dev test 2 os-phil/dng.pgm/osdev/osdev3-boot1.asm | kwccoin/bare_metal | 455c3cc7be9df56453fa145cc4862a1cc91646b9 | [
"BSD-2-Clause"
] | null | null | null | ;*********************************************
; Boot1.asm
; - A Simple Bootloader
;
; Operating Systems Development Tutorial
;*********************************************
org 0x7c00 ; We are loaded by BIOS at 0x7C00
bits 16 ; We are still in 16 bit Real Mode
Start:
xchg bx, bx
cli ; Clear all Interrupts
xchg bx, bx
hlt ; halt the system
times 510 - ($-$$) db 0 ; We have to be 512 bytes. Clear the rest of the bytes with 0
dw 0xAA55 ; Boot Signiture | 24.428571 | 89 | 0.506823 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.