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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b05a5812903078ccceb75f3f66935e9e29d1193 | 5,700 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_1923.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_1923.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_1923.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 %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x5dae, %rsi
lea addresses_D_ht+0x9c4e, %rdi
clflush (%rsi)
nop
nop
cmp $42318, %rbx
mov $49, %rcx
rep movsl
nop
nop
nop
dec %r15
lea addresses_normal_ht+0x1a12e, %rsi
lea addresses_UC_ht+0x1bfae, %rdi
nop
nop
nop
nop
sub $32892, %r8
mov $77, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $46414, %r15
lea addresses_normal_ht+0xc282, %r15
add $897, %rax
mov (%r15), %r8
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WT_ht+0x132e, %r8
nop
nop
and $15287, %rbx
movb $0x61, (%r8)
nop
nop
nop
nop
nop
add $62403, %r8
lea addresses_D_ht+0x1211e, %rax
clflush (%rax)
nop
nop
cmp $27506, %rcx
movb $0x61, (%rax)
cmp %rax, %rax
lea addresses_WC_ht+0x1c9ae, %rsi
lea addresses_A_ht+0x131ae, %rdi
nop
nop
nop
nop
and %r11, %r11
mov $104, %rcx
rep movsq
nop
nop
nop
xor $57903, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %r8
push %rcx
push %rsi
// Store
lea addresses_UC+0xbbae, %r8
nop
nop
nop
nop
nop
dec %rsi
movw $0x5152, (%r8)
nop
add %r15, %r15
// Faulty Load
lea addresses_UC+0xbbae, %r8
nop
nop
nop
cmp $20498, %r12
movb (%r8), %cl
lea oracles, %rsi
and $0xff, %rcx
shlq $12, %rcx
mov (%rsi,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}}
{'52': 21829}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 38.77551 | 2,999 | 0.659298 |
05b9a203eaa024c408a79fa19ab94fa27e3e2dc5 | 181 | asm | Assembly | test/br3028880.asm | bitwiseworks/nasm-os2 | ef78e4ee1ca3220ac3b60a61b084a693b8032ab6 | [
"BSD-2-Clause"
] | 3 | 2015-03-21T07:35:15.000Z | 2018-01-12T01:24:02.000Z | 3rdParties/src/nasm/nasm-2.15.02/test/br3028880.asm | blue3k/StormForge | 1557e699a673ae9adcc8f987868139f601ec0887 | [
"Apache-2.0"
] | 1 | 2020-03-26T19:58:54.000Z | 2020-04-24T08:58:04.000Z | test/br3028880.asm | bitwiseworks/nasm-os2 | ef78e4ee1ca3220ac3b60a61b084a693b8032ab6 | [
"BSD-2-Clause"
] | 5 | 2015-03-21T07:35:21.000Z | 2021-01-14T10:54:46.000Z | ;Testname=br3028880; Arguments=-Ox -fbin -obr3028880.o; Files=stdout stderr br3028880.o
%macro import 1
%define %%incfile %!PROJECTBASEDIR/%{1}.inc
%endmacro
import foo
| 20.111111 | 88 | 0.718232 |
3fc9fbb4a41b5a69f33c4a6dee7200c4d416d953 | 210 | asm | Assembly | assembly_tests/testBss.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | assembly_tests/testBss.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | assembly_tests/testBss.asm | znjRoLS/ss | a99a1e6039c19bf5c2ef656fbc5e7a6a5bf9a7b8 | [
"MIT"
] | null | null | null | .public main
.data
a: .word 0x12345678
.text
main:
ldch r1, 0
ldcl r1, 0
add r1, 0x1234
sub r1, 0x1230
call r4, 0
add r1, 345
halt
.bss
aa: .skip 4
bb: .skip 2
.align | 13.125 | 23 | 0.542857 |
01e64cfe993658436eb8d70b872194b26b295a61 | 780 | asm | Assembly | programs/oeis/127/A127513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/127/A127513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/127/A127513.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A127513: Partial sums of A127511.
; 1,-1,-5,-5,-21,11,-53,-53,-53,459,-565,-565,-4661,3531,19915,19915,-45621,-45621,-307765,-307765,740811,2837963,-1356341,-1356341,-1356341,32198091,32198091,32198091,-236237365,-773108277,-1846850101,-1846850101,2448117195,11038051787,28217920971,28217920971,-40501555765,96937397707,371815304651,371815304651,-727696323125,-2926719578677,-7324766089781,-7324766089781,-7324766089781,27859605999051,-42509138178613,-42509138178613,-42509138178613,-42509138178613,1083390768664011,1083390768664011,-3420208858706485,-3420208858706485
lpb $0
mov $2,$0
cal $2,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.
sub $0,1
add $1,$2
mul $1,2
lpe
add $1,1
| 65 | 534 | 0.761538 |
71c333a38802d64373d35fd2f8dd2dc7fe0645b7 | 1,010 | asm | Assembly | Graphics/VGAColor.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | Graphics/VGAColor.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | Graphics/VGAColor.asm | ahmedhussiien/AssemblyLibrary | ecfa060b673af1f7d9c329cf2e16d914902b050c | [
"MIT"
] | null | null | null | ;===========================================================================
; VGAColor.asm
;---------------------------------------------------------------------------
; Assembly x86 library
;
;
; Author: Ahmed Hussein
; Created:
;
;
; This file provide a dictionary for VGA graphics mode color palette
;
;===========================================================================
;-------------------- Palette --------------------
COLOR_BLACK EQU 00H
COLOR_BLUE EQU 01H
COLOR_GREEN EQU 02H
COLOR_CYAN EQU 03H
COLOR_RED EQU 04H
COLOR_MAGENTA EQU 05H
COLOR_BROWN EQU 06H
COLOR_LIGHTGREY EQU 07H
COLOR_DARKGREY EQU 08H
COLOR_LIGHTBLUE EQU 09H
COLOR_LIGHTGREEN EQU 0AH
COLOR_LIGHTCYAN EQU 0BH
COLOR_LIGHTRED EQU 0CH
COLOR_LIGHTMAGENTA EQU 0DH
COLOR_YELLOW EQU 0EH
COLOR_WHITE EQU 0FH | 31.5625 | 77 | 0.413861 |
2d582101e2b051eed24d1c9464b76b7c8ce57264 | 3,432 | asm | Assembly | sec05/mirrored/mirrored.asm | skout23/LALBMG6502 | c576da35b0c03056aec9b840efe8bacd255caaf4 | [
"MIT"
] | null | null | null | sec05/mirrored/mirrored.asm | skout23/LALBMG6502 | c576da35b0c03056aec9b840efe8bacd255caaf4 | [
"MIT"
] | null | null | null | sec05/mirrored/mirrored.asm | skout23/LALBMG6502 | c576da35b0c03056aec9b840efe8bacd255caaf4 | [
"MIT"
] | null | null | null | processor 6502
include "vcs.h"
include "macro.h"
seg code
org $F000 ; defines the origin of the ROM at $F000
Reset:
CLEAN_START ; Macro to safely clear the memory
ldx #$80 ; blue background color
stx COLUBK
lda #$1C ; yellow playfield
sta COLUPF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Start a new frame by configuring VBLANK and VSYNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
StartFrame:
lda #02 ; same as binary value %00000010
sta VBLANK ; turn on VBLANK
sta VSYNC ; turn on VSYNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Generate 3 lines of VSYNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
REPEAT 3
sta WSYNC ; generate scanline
REPEND
lda #0
sta VSYNC ; turn off VSYNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Generate the TIA recommended 37 lines of VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
REPEAT 37
sta WSYNC ; hit WSYNC anc wait for the next scanline
REPEND
lda #0
sta VBLANK ; turn off VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set the CTRLPF register to allow playfield reflection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ldx #%00000001 ; CTRLPF register (D0 means reflect the PF)
stx CTRLPF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Draw 192 visible scanlines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Skip the 7 scanlines with no PF set
ldx #0 ; same as #%00000000
stx PF0
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
; Set the PF0 to 1110 (LSB first) and PF1-PF2 as 1111 1111
ldx #%11100000
stx PF0
ldx #%11111111
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
; Set the next 164 lines only with PF0 third bit enabled
ldx #%01100000
stx PF0
ldx #%00000000
stx PF1
ldx #%10000000
stx PF2
REPEAT 164
sta WSYNC
REPEND
; Set the PF0 to 1110 (LSB first) and PF1-PF2 as 1111 1111
ldx #%11100000
stx PF0
ldx #%11111111
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
; Skip the 7 scanlines with no PF set
ldx #0 ; same as #%00000000
stx PF0
stx PF1
stx PF2
REPEAT 7
sta WSYNC
REPEND
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Draw 30 invisible scanlines (Overscan)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lda #2 ; hit and turn on VBLANK for overscan
sta VBLANK
REPEAT 30
sta WSYNC ; hit WSYNC anc wait for the next scanline
REPEND
lda #0
sta VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Lopp to the next frame
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
jmp StartFrame
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fill ROM size to exactly 4KB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $FFFC
.word Reset ; reset vector at $FFFC (where program starts)
.word Reset ; interrupt vector at $FFFE (unused in VCS) | 27.677419 | 67 | 0.412005 |
68493cf792f3efed527621304b60e2e39144838a | 4,764 | asm | Assembly | source/libMusic.asm | lvcabral/retaliate64 | 3f7e48c7c38ea5aea118514c1dbb23b41856bbcd | [
"MIT"
] | 65 | 2017-12-28T18:00:07.000Z | 2022-02-02T18:48:05.000Z | source/libMusic.asm | lvcabral/retaliate64 | 3f7e48c7c38ea5aea118514c1dbb23b41856bbcd | [
"MIT"
] | 3 | 2018-01-21T19:12:26.000Z | 2022-03-31T07:23:36.000Z | source/libMusic.asm | lvcabral/retaliate64 | 3f7e48c7c38ea5aea118514c1dbb23b41856bbcd | [
"MIT"
] | 4 | 2018-01-01T17:52:42.000Z | 2022-01-26T20:09:14.000Z | ;===============================================================================
; libMusic.asm - Macros and subroutines to play SID music files.
; Plays nicely with the sound effects from libSound!
;
; Copyright (C) 2018 Dion Olsthoorn - <http://www.dionoidgames.com>
; Copyright (C) 2018 Marcelo Lv Cabral - <https://lvcabral.com>
;
; Distributed under the MIT software license, see the accompanying
; file LICENSE or https://opensource.org/licenses/MIT
;
;==============================================================================
; Constants
SIDFILTERREG = 23
SIDVOLUMEREG = 24
SIDREGSTART = FRELO1
; Note: you need to swap around the voice-numbers of the sound effects so they
; interfere less with the music's lead voice
;===============================================================================
; Variables
vicMode byte 0 ; 0=NTSC 1=PAL (set on game startup)
sidCounter byte 5 ; Counter to adjust PAL songs timing on NTSC
sidRegisterBuffer dcb 25, 0 ; SID register buffer
sidFilterCtrlMask byte %11111000 ; mask for the SID's filter control register
sidDisabled byte 0 ; Flag to disable Music
;===============================================================================
; Macros/Subroutines
libMusicInit
; Push current ROM/RAM setup to stack
lda $01
pha
; Switch to I/O ROM only mode
lda #$35
sta $01
; Call SID init subroutine
lda #SIDSONG
tax
tay
jsr SIDINIT
; Switch back to previous RAM/ROM setup
pla
sta $01
rts
;===============================================================================
libMusicUpdate
; Only play song during game play
lda playerActive
beq @sidReturn
; Skip counter in PAL machines
lda vicMode
bne sidPlayStart
; Decrease play rate in 20% for NTSC
lda sidCounter
beq @sidSkip
dec sidCounter
jmp sidPlayStart
@sidSkip
lda #5
sta sidCounter
@sidReturn
rts
sidPlayStart
; Push current ROM/RAM setup to stack
lda $01
pha
; Switch to RAM only
lda #$34
sta $01
; Call SID play subroutine
; This results in shadow RAM at $d400-$d418 getting modified
jsr SIDPLAY
; Copy $d400-$d418 to sidRegisterBuffer
ldy #$18
@copyLoop
lda SIDREGSTART,Y
sta sidRegisterBuffer,Y
dey
bpl @copyLoop
; Switch back to previous RAM/ROM setup
pla
sta $01
; check soundVoiceActive (libSound) to see which SID voices are active
; only write registers from sidRegisterBuffer back to $d400-$d418
; for voices that aren't already playing a sound effect
lda #%11111000
sta sidFilterCtrlMask
checkvoice1
lda soundVoiceActive
bne checkvoice2
LIBMUSIC_RESTORE_REGISTERS_VVA 0, 6, sidRegisterBuffer
LIBMUSIC_UNMASK_VOICE_FILTER_VA %00000001, sidFilterCtrlMask
checkvoice2
lda soundVoiceActive + 1
bne checkvoice3
LIBMUSIC_RESTORE_REGISTERS_VVA 7, 13, sidRegisterBuffer
LIBMUSIC_UNMASK_VOICE_FILTER_VA %00000010, sidFilterCtrlMask
checkvoice3
lda soundVoiceActive + 2
bne checkvoicedone
LIBMUSIC_RESTORE_REGISTERS_VVA 14, 20, sidRegisterBuffer
LIBMUSIC_UNMASK_VOICE_FILTER_VA %00000100, sidFilterCtrlMask
checkvoicedone
; set filter voice mask
lda sidFilterCtrlMask
and sidRegisterBuffer + SIDFILTERREG
sta sidRegisterBuffer + SIDFILTERREG
; change volume to lowest (this might be different from the original SID music)
lda sidRegisterBuffer + SIDVOLUMEREG
and #%11110000
ora #%00000111
sta sidRegisterBuffer + SIDVOLUMEREG
; copy Filter and Volume registers
LIBMUSIC_RESTORE_REGISTERS_VVA 21, 24, sidRegisterBuffer
rts
;===============================================================================
defm LIBMUSIC_RESTORE_REGISTERS_VVA ; /1 = Start index (Value)
; /2 = End index (Value)
; /3 = RegisterBuffer (Address)
ldx #/1
@restoreLoop
lda /3,X
sta SIDREGSTART,X
inx
cpx #/2 + 1
bne @restoreLoop
endm
;===============================================================================
defm LIBMUSIC_UNMASK_VOICE_FILTER_VA ; /1 = VoiceBitMask (Value)
; /2 = VoiceFilterMask (Address)
lda /2
ora #/1 ; unmask filter for specific voice
sta /2
endm
| 30.151899 | 87 | 0.550378 |
8ebe6c2af2a9c2568acc559c1f5399e5aa68502a | 532 | asm | Assembly | oeis/113/A113935.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/113/A113935.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/113/A113935.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A113935: a(n) = prime(n) + 3.
; Submitted by Jamie Morken(s3)
; 5,6,8,10,14,16,20,22,26,32,34,40,44,46,50,56,62,64,70,74,76,82,86,92,100,104,106,110,112,116,130,134,140,142,152,154,160,166,170,176,182,184,194,196,200,202,214,226,230,232,236,242,244,254,260,266,272,274,280,284,286,296,310,314,316,320,334,340,350,352,356,362,370,376,382,386,392,400,404,412,422,424,434,436,442,446,452,460,464,466,470,482,490,494,502,506,512,524,526,544
mul $0,2
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
add $0,3
| 59.111111 | 374 | 0.706767 |
cc9a586d5d230dcb7bce9ae7102b169f22e84dc5 | 575 | asm | Assembly | oeis/097/A097321.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/097/A097321.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/097/A097321.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A097321: a(n) = (3*n-1) * 3*n * (3*n+1).
; 24,210,720,1716,3360,5814,9240,13800,19656,26970,35904,46620,59280,74046,91080,110544,132600,157410,185136,215940,249984,287430,328440,373176,421800,474474,531360,592620,658416,728910,804264,884640,970200,1061106,1157520,1259604,1367520,1481430,1601496,1727880,1860744,2000250,2146560,2299836,2460240,2627934,2803080,2985840,3176376,3374850,3581424,3796260,4019520,4251366,4491960,4741464,5000040,5267850,5545056,5831820,6128304,6434670,6751080,7077696,7414680,7762194,8120400,8489460,8869536
mul $0,3
add $0,4
bin $0,3
mul $0,6
| 71.875 | 494 | 0.801739 |
3e3b680b4074479f5c9d8e1bd6c089193d9421a7 | 33,940 | asm | Assembly | Library/Kernel/Graphics/graphicsMath.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/Graphics/graphicsMath.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/Graphics/graphicsMath.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Kernel Graphics
FILE: Graphics/graphicsMath.asm
AUTHOR: Jim DeFrisco
ROUTINES:
Name Description
---- -----------
GBL GrMulWWFixed same as GrMul32, but global
GBL GrSDivWWFixed same as GrSDiv32, but global
GBL GrUDivWWFixed same as GrUDiv32, but global
GBL GrSqrWWFixed same as GrSqr32, but global
GBL GrSqrRootWWFixed same as GrSqrRoot32, but global
GBL GrQuickSine same as GrFastSine, but global
GBL GrQuickCosine same as GrFastCosine, but global
GBL GrQuickTangent divide the FastSine by the FastCosine
GBL GrQuickArcSine same as GrFastArcSine, but global
INT GrFastSine Do table lookup for calculating sine
INT GrFastCosine Do table lookup for calculating cosine
INT GrMul32 32-bit signed multiply, assuming 16 bits frac
INT GrRegMul32 same as GrMul32 but takes register args
INT GrRegMul32ToDDF same as GrRegMul32 but returns DDFixed number
INT GrReciprocal32 Take recprocal of signed 32-bit number/frac
INT GrSDiv32 32-bit signed divide, assuming 16 bits frac
INT GrUDiv32 32-bit unsigned divide, assuming 16 bits frac
INT GrMatrixMul Full matrix multiply for transformation matrix
INT GrSqrRoot32 32 bit square root, assuming 16 bits frac
INT GrSqr32 Squares a 32 bit number
INT GrFastArcSine Do table search for calculating arcsine
INT BinarySearch Do a binary search on a table of words
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 3/89 initial version
jim 8/89 added global versions to some routines for kernel lib
DESCRIPTION:
This file contains routines to some fast pseudo-real math.
$Id: graphicsMath.asm,v 1.1 97/04/05 01:12:58 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GraphicsObscure segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrFastCosine GrQuickCosine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate the cosine of an angle
CALLED BY: INTERNAL (GrFastCosine)
GLOBAL (GrQuickCosine)
PASS: dx.ax - 32-bit number representing angle * 65536
(dx holds high word, ax holds low word)
RETURN: dx.ax - 32-bit number representing cosine * 65536
(dx holds high word, ax holds low word)
DESTROYED: bx, cx (GrFastCosine)
Nothing (GrQuickCoSine)
PSEUDO CODE/STRATEGY:
if (angle < 0)
negate angle;
while (angle >= 360)
angle -= 360;
if (angle > 270)
angle = 360 - angle;
else if (angle > 180)
angle -= 180;
toggle negative flag;
else if (angle > 90)
angle = 180-angle;
toggle negative flag;
angle = 90 - angle;
return(sine(angle));
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; a few constants to represent bit positions if flag
GFC_NEG_RESULT equ 80h ; mask for flag
GrQuickCosine proc far
push bx, cx
call GrFastCosine
pop bx, cx
ret
GrQuickCosine endp
GrFastCosine proc near
; if angle < 0...
clr ch ; clear negate flags
tst dx ; see if negative ( 3)
js GFC_neg ; (4/16)
; normalize angle to 0 - 360
GFC_pos:
cmp dx, 360 ; normalize to 0-360 ( 4)
jge GFC_normalize ; (4/16)
; angle normalized, get 0 - 90
GFC_normal:
cmp dx, 90 ; see if 0<=angle<90 ( 4)
jge GFC_quad ; no, in another quad (4/16)
; in 0-90, so subtract from 90
GFC_0to90:
Neg32 ax, dx ; negate angle
add dx, 90 ; angle = 90 - angle
; use sine function to calculate value
push cx ; save neg flag
call GrFastSine ; get sine of angle
pop cx ; restore flags
; negate result if neccesary
tst ch ; test falgs
jns GFC_done
Neg32 ax, dx ; negate result
GFC_done:
ret
;-------------------------------------------------------
; special case: negative angle
GFC_neg:
Neg32 ax, dx ; negate 32-bit quantity
jmp short GFC_pos
; special case: angle >= 360
GFC_normalize:
sub dx, 360
jge GFC_normalize
add dx, 360
jmp GFC_normal
; special case: 90 <= angle < 360
GFC_quad:
cmp dx, 270 ; see if in 4th quad
jl GFC_chk3 ; no, check for 3rd quad
Neg32 ax, dx ; yes, angle=-angle
add dx, 360 ; angle=360-angle
jmp short GFC_0to90
GFC_chk3:
cmp dx, 180 ; check for 3rd quad
jl GFC_do2 ; no, must be 2nd
sub dx, 180 ; yes, angle-=180
xor ch, GFC_NEG_RESULT ; toggle both flags
jmp short GFC_0to90
GFC_do2:
Neg32 ax, dx ; 2nd quadrant
add dx, 180 ; angle=180-angle
xor ch, GFC_NEG_RESULT ; toggle both flags
jmp short GFC_0to90
GrFastCosine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrFastSine GrQuickSine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate the sine of an angle
CALLED BY: INTERNAL (GrFastSine)
GLOBAL (GrQuickSine)
PASS: dx.ax - 32-bit number representing angle * 65536
(dx holds high word, ax holds low word)
RETURN: dx.ax - 32-bit number representing sine * 65536
(dx holds high word, ax holds low word)
DESTROYED: bx, cx (GrFastSine)
Nothing (GrQuickSine)
PSEUDO CODE/STRATEGY:
if (angle < 0)
negate angle;
toggle negative flag;
while (angle >= 360)
angle -= 360;
if (angle > 270)
angle = 360 - angle;
toggle negative flag;
else if (angle > 180)
angle -= 180;
toggle negative flag;
else if (angle > 90)
angle = 180-angle;
lookup sine in table;
if (negative flag set)
value *= -1;
There are two flags kept in ch, one to indicate if the result
should be negated, the other to indicate how the fractional
portion of the sin interpolation should be calculated.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
TIMINGS (8088)
--------------
minimum 67 cycles (0<=angle< 90, frac= 0)
typical ~175 cycles (0<=angle<360, frac= 0, avg)
fraction ~425 cycles (0<=angle<360, frac!=0, avg)
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; a few constants to represent bit positions if flag
GFS_NEG_RESULT equ 80h ; mask for flag
GrQuickSine proc far
push bx, cx
call GrFastSine
pop bx, cx
ret
GrQuickSine endp
; special case: interpolate fractional angle. We'll use
; the additional sinFracTable to help us calculate a
; more accurate (but fast) result.
haveFraction:
mov dx, ds:[sinFracTable][bx]
cmp ax, 8000h
je doneFraction
jb lessThanHalf
cmp bx, 89 * 2 ; if ceiling is 90 degress
mov bx, ds:[sinIntTable][bx+2]
xchg bx, dx ; bx = floor, dx = ceiling
jne doInterpolation ; ...not, so do nothing
dec bx ; ...account for sinIntTable[90]
; dx = ceiling value
; bx = floor value
; ax = fraction
doInterpolation:
sub dx, bx ; start interpolation
shl ax, 1 ; double the fraction, as the
; difference is .5 degrees
mul dx ; dx:ax = diff * frac
shl ax, 1
adc dx, 0 ; round result
add dx, bx ; dx = final result
jmp doneFraction
lessThanHalf:
mov bx, ds:[sinIntTable][bx]
jmp doInterpolation
;-------------------------------
GrFastSine proc near ; CYCLES
uses ds
.enter
segmov ds, cs ; ds = segment for sine tables
clr ch ; use ch for toggle flag ( 3)
; if angle < 0...
tst dx ; see if negative ( 3)
js negativeAngle ; (4/16)
; determine which quadrant angle resides; fixup angle,flags
havePositiveAngle:
cmp dx, 360 ; normalize to 0-360 ( 4)
jge normalizeAngle ; (4/16)
haveNormalAngle:
cmp dx, 90 ; see if 0<=angle<90 ( 4)
jge checkQuadrant ; no, in another quad (4/16)
; use table to lookup angle
lookup:
mov bx, dx ; prepare to do lookup ( 2)
shl bx, 1 ; index into word table ( 2)
mov dx, ds:sinIntTable[bx] ; lookup floor (angle) (21)
tst ax ; see if non-zero fraction( 3)
jnz haveFraction ; yes, do it (4/16)
doneFraction label near
mov ax, dx ; copy fraction to result ( 2)
clr dx ; fraction, no int ( 3)
; apply negation , if necc
negateMaybe:
tst ch ; see if we need to neg ( 3)
js negateResult ; yes, do it (4/16)
done:
.leave
ret
;-------------------------------------------------------
; special case: negate result
negateResult:
negwwf dxax ; negate result
jmp done
; special case: negative angle
negativeAngle:
xor ch, GFS_NEG_RESULT ; toggle both flags
negwwf dxax ; negate 32-bit quantity
jmp havePositiveAngle
; special case: angle >= 360
normalizeAngle:
sub dx, 360
jge normalizeAngle
add dx, 360
jmp haveNormalAngle
; special case: 90 <= angle < 360
checkQuadrant:
cmp dx, 270 ; see if in 4th quad
jl checkQuadrant3 ; no, check for 3rd quad
negwwf dxax ; yes, angle=-angle
add dx, 360 ; angle=360-angle
xor ch, GFS_NEG_RESULT ; toggle negate flag
jmp check90Degrees
checkQuadrant3:
cmp dx, 180 ; check for 3rd quad
jl doQuadrant2 ; no, must be 2nd
sub dx, 180 ; yes, angle-=180
xor ch, GFS_NEG_RESULT ; toggle both flags
jmp check90Degrees
doQuadrant2:
negwwf dxax ; 2nd quadrant
add dx, 180 ; angle=180-angle
check90Degrees:
cmp dx, 90
jne lookup
mov ax, 0 ; just stuff value for 90 deg
mov dx, 1
jmp negateMaybe
GrFastSine endp
GraphicsObscure ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrMulWWFixedPtr GrMul32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Multiply two 32-bit signed integers, where lower 16-bits of
each is considered a fraction.
CALLED BY: GLOBAL (GrMulWWFixed, GrMulWWFixedPtr)
INTERNAL (GrRegMul32, GrMul32)
PASS: ds:si - points to multiplicand (GrMul32, GrMulWWFixedPtr)
es:di - points to multiplier (GrMul32, GrMulWWFixedPtr)
dx.cx - multiplier (GrRegMul32, GrMulWWFixed)
bx.ax - multiplicand (GrRegMul32, GrMulWWFixed)
RETURN: dx.cx - dx holds high word, cx holds low word
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
do the right thing
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
Joon 12/92 Optimized
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrMulWWFixedPtr proc far
uses ax,bx
.enter
if FULL_EXECUTE_IN_PLACE
EC < push ds, si >
EC < call ECCheckBounds >
EC < segmov ds, es, si >
EC < mov si, di ; ds:si = multiplier >
EC < call ECCheckBounds >
EC < pop ds, si >
endif
movdw dxcx, ds:[si]
movdw bxax, es:[di]
call GrRegMul32ToDDF
.leave
ret
GrMulWWFixedPtr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrMulWWFixed GrRegMul32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Multiplies two fixed point numbers
dx.cx = dx.cx * bx.ax
CALLED BY: GLOBAL
PASS: dx.cx multiplicand
bx.ax multiplier
RETURN: dx.cx result
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/20/89 Initial version
JS 6/9/92 Optimized
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrRegMul32 label far
GrMulWWFixed proc far
uses ax, bx
.enter
call GrRegMul32ToDDF
.leave
ret
GrMulWWFixed endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrRegMul32ToDDF
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Multiply 2 WWFixed numbers and return a DDFixed number
CALLED BY: GLOBAL
PASS: dx.cx = multiplicand
bx.ax = multiplier
RETURN: bxdx.cxax = result
dx.cx = same as result from old GrMul32
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY: D.C dx.cx
B.A bx.ax
----------- -----
A*D + (A*C >> 16) bxdx.cxax
(B*D << 16) + B*C
-------------------------------------
(B*D << 16) + A*D + B*C + (A*C >> 16)
REVISION HISTORY:
Name Date Description
---- ---- -----------
Joon 1/12/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrRegMul32ToDDF proc near
uses bp, si, di
.enter
mov si, dx ;si.cx = multiplicand
mov di, ax ;bx.di = multiplier
mov ax, si
xor ax, bx ;if signs are different then SFlag will be set
pushf ;save flags
tst si
js neg_sicx ;if signed, negate operand
after_sicx:
tst bx
js neg_bxdi ;if signed, negate operand
after_bxdi:
mov ax, cx
mul di ;0.dxax = C*A
mov bp, dx ;0.bp = C*A
push ax ;save lowest word
mov ax, si
mul bx ;dxax.0 = D*B
push dx ;save highest word
xchg ax, cx ;cx.0 = D*B, ax = C
mul bx ;dx.ax = C*B
add bp, ax
adc cx, dx ;cx.bp = D*B + C*B + C*A
mov ax, si
mul di ;dx.ax = D*A
add ax, bp
adc dx, cx ;dx.ax = middle two words of answer
pop bx ;bx <= highest word
adc bx, 0 ;add carry to highest word
pop cx ;cx <= lowest word
xchg ax, cx ;answer = bxdx.cxax
popf
js neg_bxdxcxax ;if signs of operands are different,
done: ; negate result
.leave
ret
neg_sicx:
negdw sicx ;make multiplicand
jmp short after_sicx
neg_bxdi:
negdw bxdi ;make multiplier positive
jmp short after_bxdi
neg_bxdxcxax:
neg ax
cmc
not cx
adc cx, 0
not dx
adc dx, 0
not bx
adc bx, 0
jmp short done
GrRegMul32ToDDF endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrReciprocal32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculates the reciprocal of a 32-bit integer, where 16-bits
are considered the integer part, and 16-bits are fraction.
CALLED BY: INTERNAL
PASS: bx.ax - number to take reciprocal
This notation is meant to represent a 32-bit quantity
as HighWord:LowWord -- not a far pointer.
RETURN: bx.ax - reciprocal
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
uses GrUDiv32, below
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrReciprocal32Far proc far
call GrReciprocal32
ret
GrReciprocal32Far endp
GrReciprocal32 proc near
push cx, dx ; save regs
; set up 1.0 as dividend
clr cx ; no fraction
mov dx, 1 ; sets up 1.0
call GrSDiv32 ; do 32-bit divide
mov bx, dx ; set up result
mov ax, cx
pop cx, dx ; restore regs
ret
GrReciprocal32 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrSDiv32 GrSDivWWFixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: signed divide, 32-bit dividend and divisor
CALLED BY: INTERNAL (GrSDiv32)
GLOBAL (GrSDivWWFixed)
PASS: dx.cx - 32-bit dividend
bx.ax - 32-bit divisor
This notation is meant to describe dx:cx as a 32-bit quantity,
RETURN: dx.cx - 32-bit quotient (dx=integer part, cx=fractional part)
bx.ax - unchanged
carry - set if overflow occurred, else clear
- quotient is undefined if overflow occurred.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
This uses the unsigned divide routine, and fixes up the
signs of result.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrSDivWWFixed proc far
push ax, bx
call GrSDiv32
pop ax, bx
ret
GrSDivWWFixed endp
GrSDiv32 proc near
uses si
.enter
mov si, dx ; calc sign of result
xor si, bx ; positive if both same sign
; change sign of operands, if necc
tst dx ; test dividend
jns GSD_numfixed ; negative ?
negdw dxcx ; yes, negate dividend
GSD_numfixed:
tst bx ; test divisor
jns GSD_denfixed ; negative ?
negdw bxax ; yes, negate divisor
GSD_denfixed:
call GrUDiv32 ; do unsigned divide
pushf ;save overflow status
; restore sign of result, do the right thing
tst si ; test sign of result
js changeSign ; negative, so change sign
popfDone:
popf
.leave
ret
changeSign:
negdw dxcx ; negate result
jmp popfDone
GrSDiv32 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrUDiv32 GrUDivWWFixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: unsigned divide, 32-bit dividend and divisor
CALLED BY: INTERNAL (GrUDiv32)
GLOBAL (GrUDivWWFixed)
PASS: dx.cx - 32-bit dividend
bx.ax - 32-bit divisor
This notation is meant to describe dx:cx as a 32-bit quantity,
RETURN: dx.cx - 32-bit quotient (WWFixed format)
bx.ax - unchanged
carry - set if overflow occurred, else clear
- quotient is undefined if overflow occurred.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
All integer divide algorithms (that I could find) produce a
quotient and a remainder. Unfortunately, we want a quotient
that is part integer and part fraction. To get around this
problem, we shift the dividend left 16-bits which will produce
a 48-bit quotient that is also multiplied by 2^16. This makes
the low 16-bits of the result a fraction, just what we want.
Since the 8088 div instruction divides a 32-bit number
by a 16-bit divisor, we can't use it (we have a 32-bit
divisor). Therefore we go back to basics and write our
own divide routine. The basic algorithm is:
partial_dividend = 0;
for (count=48; count>0; count--)
shift dividend left;
shift partial_dividend left;
if (divisor <= partial_dividend)
partial_dividend -= divisor;
dividend++;
quotient = dividend;
remainder=partial_dividend;
register/stack usage:
dx:cx:di - 48-bit divident/quotient
bx:ax - 32-bit partial dividend/remainder
si - count
[bp-4] - 32-bit divisor
Believe it or not, this algorithm was adapted from one I found
in "6502 Software Design", by Leo Scanlon.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrUDivWWFixed proc far
call GrUDiv32
ret
GrUDivWWFixed endp
GrUDiv32 proc near
;
; This "if" contains the trivial reject and simple-case analysis code
;
if 1
;
; Check for dividend == 0 (dx = cx = 0)
;
tst_clc dx
jnz nonZeroDividend
jcxz exit
;
; Check for division by 1:0 (bx = 1, ax = 0)
;
nonZeroDividend:
tst ax
jnz axNonZero
cmp bx, 1
je exit ;carry clear from = comparison
jcxz bothInts
axNonZero:
tst bx
jnz divisorBig
cmp ax, dx ;if dividend is too big, error
ja divisorSmall
error:
stc
ret
;
; A quick divide for the case where
; divisor is 16 bits (bx = 0)
;
divisorSmall:
xchg ax, cx ; dx:ax = dividend,
; cx = divisor
jcxz error ; error on divide by zero
div cx ; ax <- quotient
; dx <- remainder
xchg bx, ax ; ax <- 0
; bx <- quotient
div cx ; ax <- frac quotient
; dx <- frac remainder (we toss this)
mov dx, bx ;dx <- quotient
xchg cx, ax ;cx <- fraction,
;ax <- divisor
xor bx, bx ;return bx to its original state (= 0),
;and clear the carry
exit:
ret ; all done
bothInts:
;
; Both passed #'s are integers (ax = cx = 0)
;
xchg ax, dx ;dx <- 0, ax <- int
tst bx
jz error ;error on divide by zero
div bx ;ax <- quotient int, dx <- remainder
tst_clc dx
jz intIntInt
xchg ax, cx ;ax <- 0, cx <- quotient int
div bx ;ax <- quotient frac, dx <- toss
mov dx, cx ;dx <- quotient int
mov_tr cx, ax ;cx <- quotient frac
xor ax, ax ;return ax to its original state (= 0),
;and clear the carry
ret
;
; Both args ints, result int
;
intIntInt:
xchg dx, ax ;dx <- quotient int
ret ;carry clear from tst_clc
divisorBig:
endif
push si, di, bp ; save registers trashed
; set up regs as we like
mov bp, sp ; allocate some scratch space
push bx ;ss:[bp-2] <- divisor int
push ax ;ss:[bp-4] <- divisor frac
; sub sp, 4 ; need space for divisor
; mov [bp-2], bx ; move divisor to stack
; mov [bp-4], ax
clr ax, bx, di ; clear partial dividend, low word
mov si, cx
mov cx, 49 ; bit counter (loop count)
; loop through all bits, doing that funky divide thing
GUD_topNext:
dec cx
jz GUD_afterLoop
GUD_loop:
sal di, 1 ; shift partial dividend/dividend
rcl si, 1
rcl dx, 1
rcl ax, 1
rcl bx, 1
cmp [bp-2], bx ; divisor > partial dividend ?
ja GUD_topNext ; no, continue with next loop
jne GUD_work ; yes, need to do some more work
cmp [bp-4], ax ; can't tell yet, check low word
ja GUD_topNext ; no, continue next loop
; divisor <= partial dividend, do some work
GUD_work:
; this code has been replaced
; add di, 1 ; increment quotient
; adc si, 0
; adc dx, 0
inc di
jz GUD_rippleCarry
GUD_afterRipple:
sub ax, [bp-4] ; partial divident -= divisor
sbb bx, [bp-2]
;GUD_next:
loop GUD_loop ; continue with next iteration
GUD_afterLoop:
; test for overflow, set up results
pop ax ; restore divisor frac
pop bx ; restore divisor int
tst_clc dx ; should be zero if no overflow
jnz GUD_overflow ; error, signal and quit
mov dx, si ; move integer over
mov cx, di ; move fraction over
GUD_done:
pop si, di, bp ; restore trashed regs
ret ; all done
GUD_overflow:
stc ; set carry flag to indicate overflow
jmp short GUD_done ; all done
GUD_rippleCarry:
inc si
jnz GUD_afterRipple
inc dx
jmp GUD_afterRipple
GrUDiv32 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrSqr32 GrSqrWWFixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculates the square of a 32 bit number.
CALLED BY: GLOBAL (GrSqrWWFixed)
INTERNAL (GrSqr32)
PASS: dx.cx - dx = hi, cx = lo
RETURN: dx.cx
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Sets up parameters for GrRegMul32 and calls it
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/20/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrSqrWWFixed proc far
call GrSqr32
ret
GrSqrWWFixed endp
GrSqr32 proc near
push ax,bx
mov ax,cx
mov bx,dx
call GrRegMul32ToDDF
pop ax,bx
ret
GrSqr32 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrSqrRoot32 GrSqrRootWWFixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate the square root of a 32 bit number. The first
16 bits are integer and the second 16 bits are fractional.
Numbers less than 1 return with the value 1. So Sorry.
CALLED BY:
CalcButtCap
PASS:
dx.cx - WWFixed number to take square root of
RETURN:
dx.cx - WWFixed square root
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
MaNewton Bols formula says if you have an approximation A then
(N/A +A) /2 is a better approximation ( N is the number whose square
root we wish to know)
For speed sake I choose an initial approx that is a
power of two. I choose the power of two by determining the highest
bit set in the integer portion of the number.
highest bit set init approx
15 256
14 128
13 128
12 64
11 64
10 32 and so on
To determine the highest bit I basically shift the integer portion
to the left until the carry is set. I then use this formula
x=(17-#ofShifts)/2. x is the postion of the bit to set to create my
approx and it is also the number of times to shift the original
number to the right for the divide in Newtons formula.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/28/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrSqrRootWWFixed proc far
call GrSqrRoot32
ret
GrSqrRootWWFixed endp
GSR32__10: ;number is less than or equal to 1 so return 1
mov dx,1
clr cx
jmp short GSR32_99
GrSqrRoot32 proc near
push ax,bx,si,di ;don't destroy
cmp dx,1
jna GSR32__10 ;bra if number less than or equal 1
mov si,cx ;save fractional
mov cx,17
mov al,dh
cmp dh,0
ja GSR32_20 ;bra if something in high byte of integer
sub cl,8 ;pretend we have already done 8 shifts
mov al,dl ;search for highest set bit in low byte
GSR32_20:
shl al,1 ;find highest bit
dec cl
jnc GSR32_20
shr cl,1 ; now cl = magic number for right shift approx
mov bx,dx ;get original number in bx:ax
mov ax,si
mov di,1 ;di will equal approx so it can be subtracted
GSR32_30: ;calculate second approximation
shr bx,1 ;this gives number/approx in bx:ax
rcr ax,1
shl di,1 ;and approx in di
loopnz GSR32_30
add bx,di ;add approx from num/approx
shr bx,1 ;divide result by 2
rcr ax,1 ;to get next approx in bx:ax
push dx ;save original number
push cx
call GrUDiv32 ;divide number/approx
add ax,cx ;add fractional of quotient to approx
adc bx,dx ;add integer of quotient to approx
shr bx,1 ;divide result of addition by 2
rcr ax,1 ;to get next approx in bx:ax
pop cx ;retrieve original number
pop dx
;calc final approx
call GrUDiv32 ;divide number/approx
add cx,ax ;add fractional of quotient to approx
adc dx,bx ;add integer of quotient to approx
shr dx,1 ;divide result of addition by 2
rcr cx,1 ;to get final approx in dx:cx
GSR32_99 label near
pop ax,bx,si,di
ret
GrSqrRoot32 endp
GraphicsObscure segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrFastArcSine GrQuickArcSine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculates the inverse sign. In general you would pass
-(delta y / radius) in dx and delta x in cx and the routine
will return the correct angle for that quadrant. The minus
on the (delta y / radius) is because the graphics coordinate
system's origin is in the upper left, when usually it
should be in the lower left.
CALLED BY:
PASS:
bx - orig delta x value (only sign matters)
dx.cx - value to get inverse sign for (delta y/ distance )
(WWFixed format)
-1 <= dx.cx <= 1
RETURN:
dx.cx - angle
DESTROYED:
ax,bx
PSEUDO CODE/STRATEGY:
Do a binary search on the sine table
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine currently routines largest integer angle with a sine
less than the passed value. Linear Interpolation could be done
but it wasn't necessary for my purposes.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 4/26/89 Initial version
jim 1/19/93 added interpolation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrQuickArcSine proc far
call GrFastArcSine
ret
GrQuickArcSine endp
GrFastArcSine proc near
uses di, bp, ds
.enter
push bx, dx ; save passed int
tst dx ; force dx:cx to be positive
jns haveAbs
negwwf dxcx
; have absolute value of sine. Limit search to first quadrant.
haveAbs:
cmp dx, 1 ; check for 90 degrees
je angleIs90 ; binary search won't handle 1
; OK, so it isn't the trivial case. Do a binary search on
; the sine table to find the angle.
clr bx ; lower search position
mov dx, 90 ; upper table search position
segmov ds, cs ; sineIntTable is in our code segment
mov di, offset GraphicsObscure:sinIntTable
call BinarySearch ; ax = value, bp = table offset
jnc interpolate ; not exact, need to interpolate result
mov cx, 0 ; don't use CLR, (assuming exact)
calcInteger:
mov dx, bp ; if exact, use table index for angle
shr dx, 1
; We have an angle value between 0 and 90. Adjust for the
; right quadrant, based on the passed deltaX value and the
; sine value. The breakdown is as follows:
; deltaX sine quadrant action
; ------ ---- -------- ------
; + + 0-90 angle' = angle
; - + 90-180 angle' = 180-angle
; - - 180-270 angle' = 180+angle
; + - 270-360 angle' = 360-angle
adjustForQuad:
pop bx, ax ; ax = sine, bx = deltaX
tst ax ; check sine first
js sineNegative ; jmp if in quadrants 3 or 4
tst bx ; check deltaX
js quadrant2 ; if positive, in quadrant 1
done:
.leave
ret
; angle is 90 degrees. No need for a search.
angleIs90:
mov dx, 90 ; dx = +-1 so angle = 90 before
clr cx ; adjust for quadrant
jmp adjustForQuad
; we're in quadrant 2. angle = 180-result
quadrant2:
sub dx, 180 ; calc 180-angle for quad 2
neg dx ; dxcx = new
jmp done
; the original sine value was negative, so we're in quad 3 or 4
sineNegative:
tst bx ; check deltaX
jns quadrant4 ; in last quadrant
; we're in quadrant three, angle is 180+result
add dx,180 ;otherwise must be in quad 3,so add 180
jmp done
; quadrant 4. angle is 360-result
quadrant4:
sub dx, 360
neg dx
jmp done
; the search yielded that we're not on an integer angle.
; Interpolate between the two values in the table. Result
; should be: angleInt =bp>>1
; angleFrac=(origAng-tab[bp])/(tab[bp+2]-tab[bp])
interpolate:
mov dx, cx
sub dx, ax ; subtract tab[bp] from origAng
clr cx ; dxcx = numerator
mov bx, ds:[di][bp+2] ; bx = tab[bp+2]
sub bx, ax
clr ax
call GrUDivWWFixed
jmp calcInteger ; integer calculation same
GrFastArcSine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BinarySearch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do a binary search on a table of words
CALLED BY:
PASS: ds:di - segment and offset to table
bx - lowest table position to search
dx - highest table position to search
cx - value to find
RETURN:
ax <= cx
bp - offset into table to value in ax
stc - ax = cx
clc - ax < cx
DESTROYED:
dx,bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 4/26/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BinarySearch proc near
mov bp, bx ;bp <- lower to avoid segment override on
; table fetch and to shrink size of AND
; instruction (need only mask BL, not all of
; BP)
BS_0:
add bx, dx ;bx = table offset = (lower+upper/2)*2
BS_1:
andnf bx,not 1 ; just need to clear low bit
mov ax,ds:[di][bx] ;get value now so we have it if we stop
cmp dx,bp
jb done ;stop, upper < lower
shr bx,1 ;make bx into table position again
cmp ax,cx ;compare table to desired
jb truncateLowEnd ;jmp if table < hunted
je match ;BINGO
;table > hunted
dec bx ;truncate high end
mov dx, bx
add bx, bp
jmp short BS_1
truncateLowEnd: ;table < hunted
inc bx
mov bp,bx
jmp short BS_0
match:
shl bx,1 ;make bx offset into table to exact answer
; (must clear carry b/c bp was shifted right
; above, clearing the high bit. A clear carry
; is what we want so we can return carry set
; to indicate the value was actually found)
done:
cmc ;set carry properly. If we ran out of table,
; carry is set (upper is below lower) but
; we want it clear. If we found the thing, the
; carry is clear (see above) but we want it set.
mov bp, bx ; return table offset in bp
ret
BinarySearch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrQuickTangent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculates a tangent of the passed angle (uses table lookup)
CALLED BY: GLOBAL
PASS: DX.AX = Angle (WWFixed)
RETURN: DX.AX = Tangent
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 9/20/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrQuickTangent proc far
uses bx, cx
.enter
; Tangent = Sine / Cosine
;
movwwf bxcx, dxax ; angle to => BX.CX
call GrQuickCosine ; cosine => DX.AX
xchgwwf bxcx, dxax
call GrQuickSine ; sine => DX.AX
xchg ax, cx ; sine => DX.CX, cosine => BX.AX
call GrSDivWWFixed ; tangent => DX.CX
mov_tr ax, cx ; tangent => DX.AX
.leave
ret
GrQuickTangent endp
GraphicsObscure ends
| 25.653817 | 79 | 0.590748 |
5777db4b1d1d8e9f851216b597f3337c570afe62 | 68 | asm | Assembly | data/maps/headers/VermilionMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/VermilionMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/VermilionMart.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header VermilionMart, VERMILION_MART, MART, 0
end_map_header
| 17 | 50 | 0.823529 |
5dff3abbe2868899259d86aa38c0b063f1e1031c | 619 | asm | Assembly | oeis/010/A010545.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/010/A010545.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/010/A010545.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A010545: Decimal expansion of square root of 94.
; 9,6,9,5,3,5,9,7,1,4,8,3,2,6,5,8,0,2,8,1,4,8,8,8,1,1,5,0,8,4,5,3,1,3,3,9,3,6,5,2,1,5,0,9,8,7,9,5,4,6,7,9,5,9,0,5,3,9,7,1,7,4,8,6,2,3,3,0,3,9,8,6,7,5,7,3,3,0,0,7,2,8,4,8,3,2,5,8,6,7,8,4,7,6,9,1,7,4,9,6
mov $1,1
mov $2,1
mov $3,$0
add $3,8
mov $4,$0
add $4,3
mul $4,2
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,94
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,2
div $1,$8
div $2,$8
sub $3,1
lpe
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
| 15.871795 | 201 | 0.50727 |
1b9b2d59476f3bf4fc35d16386e0d6ed8c5f57d1 | 572 | asm | Assembly | programs/oeis/133/A133263.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/133/A133263.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/133/A133263.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A133263: Binomial transform of (1, 2, 0, 1, -1, 1, -1, 1, ...).
; 1,3,5,8,12,17,23,30,38,47,57,68,80,93,107,122,138,155,173,192,212,233,255,278,302,327,353,380,408,437,467,498,530,563,597,632,668,705,743,782,822,863,905,948,992,1037,1083,1130,1178,1227,1277,1328,1380,1433,1487,1542,1598,1655,1713,1772,1832,1893,1955,2018,2082,2147,2213,2280,2348,2417,2487,2558,2630,2703,2777,2852,2928,3005,3083,3162,3242,3323,3405,3488,3572,3657,3743,3830,3918,4007,4097,4188,4280,4373,4467,4562,4658,4755,4853,4952
mov $1,$0
trn $0,1
bin $0,2
mul $1,2
add $1,1
add $1,$0
mov $0,$1
| 52 | 438 | 0.70979 |
4405e6ed110eaf59d4088c4e2739d60e83467343 | 6,450 | asm | Assembly | int.asm | kevinsa5/KevinOS | 857cb171fbb4de54906f1e4c924164738f34290a | [
"Unlicense"
] | 6 | 2015-01-08T04:18:36.000Z | 2017-08-22T10:31:17.000Z | int.asm | kevinsa5/KevinOS | 857cb171fbb4de54906f1e4c924164738f34290a | [
"Unlicense"
] | 1 | 2015-03-10T04:30:14.000Z | 2015-03-10T04:30:14.000Z | int.asm | kevinsa5/KevinOS | 857cb171fbb4de54906f1e4c924164738f34290a | [
"Unlicense"
] | null | null | null |
[global int_general]
[global int_0]
[global int_1]
[global int_2]
[global int_3]
[global int_4]
[global int_5]
[global int_6]
[global int_7]
[global int_8]
[global int_9]
[global int_10]
[global int_11]
[global int_12]
[global int_13]
[global int_14]
[global int_15]
[global int_16]
[global int_17]
[global int_18]
[global int_19]
[global int_20]
[global int_21]
[global int_22]
[global int_23]
[global int_24]
[global int_25]
[global int_26]
[global int_27]
[global int_28]
[global int_29]
[global int_30]
[global int_31]
[global int_32]
[global int_33]
[global int_34]
[global int_35]
[global int_36]
[global int_37]
[global int_38]
[global int_39]
[global int_40]
[global int_41]
[global int_42]
[global int_43]
[global int_44]
[global int_45]
[global int_46]
[global int_47]
[extern isr_general]
[extern isr_0]
[extern isr_1]
[extern isr_2]
[extern isr_3]
[extern isr_4]
[extern isr_5]
[extern isr_6]
[extern isr_7]
[extern isr_8]
[extern isr_9]
[extern isr_10]
[extern isr_11]
[extern isr_12]
[extern isr_13]
[extern isr_14]
[extern isr_15]
[extern isr_16]
[extern isr_17]
[extern isr_18]
[extern isr_19]
[extern isr_20]
[extern isr_21]
[extern isr_22]
[extern isr_23]
[extern isr_24]
[extern isr_25]
[extern isr_26]
[extern isr_27]
[extern isr_28]
[extern isr_29]
[extern isr_30]
[extern isr_31]
[extern isr_32]
[extern isr_33]
[extern isr_34]
[extern isr_35]
[extern isr_36]
[extern isr_37]
[extern isr_38]
[extern isr_39]
[extern isr_40]
[extern isr_41]
[extern isr_42]
[extern isr_43]
[extern isr_44]
[extern isr_45]
[extern isr_46]
[extern isr_47]
int_general:
pusha
push ds
push es
push fs
push gs
call isr_general
pop gs
pop fs
pop es
pop ds
popa
iret
int_0:
pusha
push ds
push es
push fs
push gs
call isr_0
pop gs
pop fs
pop es
pop ds
popa
iret
int_1:
pusha
push ds
push es
push fs
push gs
call isr_1
pop gs
pop fs
pop es
pop ds
popa
iret
int_2:
pusha
push ds
push es
push fs
push gs
call isr_2
pop gs
pop fs
pop es
pop ds
popa
iret
int_3:
pusha
push ds
push es
push fs
push gs
call isr_3
pop gs
pop fs
pop es
pop ds
popa
iret
int_4:
pusha
push ds
push es
push fs
push gs
call isr_4
pop gs
pop fs
pop es
pop ds
popa
iret
int_5:
pusha
push ds
push es
push fs
push gs
call isr_5
pop gs
pop fs
pop es
pop ds
popa
iret
int_6:
pusha
push ds
push es
push fs
push gs
call isr_6
pop gs
pop fs
pop es
pop ds
popa
iret
int_7:
pusha
push ds
push es
push fs
push gs
call isr_7
pop gs
pop fs
pop es
pop ds
popa
iret
int_8:
pusha
push ds
push es
push fs
push gs
call isr_8
pop gs
pop fs
pop es
pop ds
popa
iret
int_9:
pusha
push ds
push es
push fs
push gs
call isr_9
pop gs
pop fs
pop es
pop ds
popa
iret
int_10:
pusha
push ds
push es
push fs
push gs
call isr_10
pop gs
pop fs
pop es
pop ds
popa
iret
int_11:
pusha
push ds
push es
push fs
push gs
call isr_11
pop gs
pop fs
pop es
pop ds
popa
iret
int_12:
pusha
push ds
push es
push fs
push gs
call isr_12
pop gs
pop fs
pop es
pop ds
popa
iret
int_13:
pusha
push ds
push es
push fs
push gs
call isr_13
pop gs
pop fs
pop es
pop ds
popa
iret
int_14:
pusha
push ds
push es
push fs
push gs
call isr_14
pop gs
pop fs
pop es
pop ds
popa
iret
int_15:
pusha
push ds
push es
push fs
push gs
call isr_15
pop gs
pop fs
pop es
pop ds
popa
iret
int_16:
pusha
push ds
push es
push fs
push gs
call isr_16
pop gs
pop fs
pop es
pop ds
popa
iret
int_17:
pusha
push ds
push es
push fs
push gs
call isr_17
pop gs
pop fs
pop es
pop ds
popa
iret
int_18:
pusha
push ds
push es
push fs
push gs
call isr_18
pop gs
pop fs
pop es
pop ds
popa
iret
int_19:
pusha
push ds
push es
push fs
push gs
call isr_19
pop gs
pop fs
pop es
pop ds
popa
iret
int_20:
pusha
push ds
push es
push fs
push gs
call isr_20
pop gs
pop fs
pop es
pop ds
popa
iret
int_21:
pusha
push ds
push es
push fs
push gs
call isr_21
pop gs
pop fs
pop es
pop ds
popa
iret
int_22:
pusha
push ds
push es
push fs
push gs
call isr_22
pop gs
pop fs
pop es
pop ds
popa
iret
int_23:
pusha
push ds
push es
push fs
push gs
call isr_23
pop gs
pop fs
pop es
pop ds
popa
iret
int_24:
pusha
push ds
push es
push fs
push gs
call isr_24
pop gs
pop fs
pop es
pop ds
popa
iret
int_25:
pusha
push ds
push es
push fs
push gs
call isr_25
pop gs
pop fs
pop es
pop ds
popa
iret
int_26:
pusha
push ds
push es
push fs
push gs
call isr_26
pop gs
pop fs
pop es
pop ds
popa
iret
int_27:
pusha
push ds
push es
push fs
push gs
call isr_27
pop gs
pop fs
pop es
pop ds
popa
iret
int_28:
pusha
push ds
push es
push fs
push gs
call isr_28
pop gs
pop fs
pop es
pop ds
popa
iret
int_29:
pusha
push ds
push es
push fs
push gs
call isr_29
pop gs
pop fs
pop es
pop ds
popa
iret
int_30:
pusha
push ds
push es
push fs
push gs
call isr_30
pop gs
pop fs
pop es
pop ds
popa
iret
int_31:
pusha
push ds
push es
push fs
push gs
call isr_31
pop gs
pop fs
pop es
pop ds
popa
iret
int_32:
pusha
push ds
push es
push fs
push gs
call isr_32
pop gs
pop fs
pop es
pop ds
popa
iret
int_33:
pusha
push ds
push es
push fs
push gs
call isr_33
pop gs
pop fs
pop es
pop ds
popa
iret
int_34:
pusha
push ds
push es
push fs
push gs
call isr_34
pop gs
pop fs
pop es
pop ds
popa
iret
int_35:
pusha
push ds
push es
push fs
push gs
call isr_35
pop gs
pop fs
pop es
pop ds
popa
int_36:
pusha
push ds
push es
push fs
push gs
call isr_36
pop gs
pop fs
pop es
pop ds
popa
iret
int_37:
pusha
push ds
push es
push fs
push gs
call isr_37
pop gs
pop fs
pop es
pop ds
popa
iret
int_38:
pusha
push ds
push es
push fs
push gs
call isr_38
pop gs
pop fs
pop es
pop ds
popa
int_39:
pusha
push ds
push es
push fs
push gs
call isr_39
pop gs
pop fs
pop es
pop ds
popa
iret
int_40:
pusha
push ds
push es
push fs
push gs
call isr_40
pop gs
pop fs
pop es
pop ds
popa
iret
int_41:
pusha
push ds
push es
push fs
push gs
call isr_41
pop gs
pop fs
pop es
pop ds
popa
iret
int_42:
pusha
push ds
push es
push fs
push gs
call isr_42
pop gs
pop fs
pop es
pop ds
popa
iret
int_43:
pusha
push ds
push es
push fs
push gs
call isr_43
pop gs
pop fs
pop es
pop ds
popa
iret
int_44:
pusha
push ds
push es
push fs
push gs
call isr_44
pop gs
pop fs
pop es
pop ds
popa
iret
int_45:
pusha
push ds
push es
push fs
push gs
call isr_45
pop gs
pop fs
pop es
pop ds
popa
iret
int_46:
pusha
push ds
push es
push fs
push gs
call isr_46
pop gs
pop fs
pop es
pop ds
popa
iret
int_47:
pusha
push ds
push es
push fs
push gs
call isr_47
pop gs
pop fs
pop es
pop ds
popa
iret
iret
iret
| 7.29638 | 20 | 0.733798 |
271422793ea3694c253cd1d2e28deea3f80bc8be | 3,786 | asm | Assembly | app/prelude1/trashcan/player-3.asm | ern0/549notes | e39e0c721de6116a937be86352a2c33f107852c1 | [
"MIT"
] | 2 | 2020-12-24T14:41:06.000Z | 2021-07-04T20:37:00.000Z | app/prelude1/trashcan/player-3.asm | ern0/549notes | e39e0c721de6116a937be86352a2c33f107852c1 | [
"MIT"
] | null | null | null | app/prelude1/trashcan/player-3.asm | ern0/549notes | e39e0c721de6116a937be86352a2c33f107852c1 | [
"MIT"
] | null | null | null | ;-----------------------------------------------------------------------
; Prelude1 - PC-DOS 256-byte intro by ern0 & TomCat
; Prototype-2: raw-diff-5 nctab nutab
;
; Target: 80386 real mode, assembler: FASM
;
;-----------------------------------------------------------------------
; Register allocation:
;
; AL - local, bit counter (SHL until carry) + result
; AH - local, data sub correction
; BX - global, delay
; DX - free
; CL - local, line counter, note counter
; CH - global, constant zero
; SI - local, 5-byte rotation, used in 5+3 repeat
; DI - global, 5-byte rotation
; BP - global, load bit pointer
; ES - DS=CS
;
;-----------------------------------------------------------------------
TEST_MODE = 1
if TEST_MODE > 0
display "----[ test mode ]------------"
end if
;-----------------------------------------------------------------------
org 100H
DB 3FH
MOV DX,331H
OUTSB
MOV BP,(data_notes-data_start)*8
MOV BL,2
@next_line:
MOV SI,data_start
MOV DI,snapshot_start
pusha
call eight_of_eight
popa
XCHG SI,DI
call eight_of_eight
SUB DX,331H/32+1
JNC @next_line
INC BX ; next_simple
MOV CL,5+16+16-1
@next:
CMP CL,5+16-1
JA @set_delay
MOV BL,7 ; next_last
CMP CL,5-1
JA @set_delay
MOV BL,1 ; next_finish
@set_delay:
call load_play_note
LOOP @next
if TEST_MODE > 0
call test_summary
end if
; RETN
;-----------------------------------------------------------------------
load_play_note:
MOV DI,data_start
MOV AX,256*DATA_CSUB+32;AH:DATA_CSUB, AL:%xx10'0000: 3 SHL to carry
@read_bit:
BT [DI],BP
INC BP
RCL AL,1
JNC @read_bit
;word_read:
SUB AL,AH ; adjust_word
CMP AL,3 ; check for %011 special value
JNE @rotate_notes
;load_uncompressed:
MOV AH,128+DATA_USUB;AH:DATA_USUB, AL:%xxxx'xx11: 7 SHL to carry
JMP @read_bit
@rotate_notes:
if TEST_MODE > 0
call test_diff
end if
add al,[di]
lea si,[di + 1]
movsw
movsw
stosb
; fall play_note
;-----------------------------------------------------------------------
play_note:
if TEST_MODE > 0
jmp test_note
end if
pusha
PUSH AX
INT 29H
MOV DX,330H
MOV AL,90H
OUT DX,AL
POP AX
OUT DX,AL
MOV AL,7FH
OUT DX,AL
; fall wait
;-----------------------------------------------------------------------
;wait:
@wait_some:
mov ah,2cH
int 21H
MOV SI,DX
@wait_tick:
int 21H
CMP SI,DX
je @wait_tick
DEC BX
jne @wait_some
popa
ret
;-----------------------------------------------------------------------
eight_of_eight:
MOVSW
MOVSW
MOVSB
MOV CL,5
@five_of_eight:
call load_play_note
LOOP @five_of_eight
MOV CL,3
SUB SI,CX ; SI is from rotate_notes
@three_of_eight:
LODSB
call play_note
LOOP @three_of_eight
ret
;-----------------------------------------------------------------------
include "data-3.inc"
include "test.asm"
snapshot_start:
| 22.402367 | 79 | 0.392235 |
b6772f389f03d6b3bb339d8ac717b60ef21fb5bc | 304 | asm | Assembly | programs/oeis/040/A040232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040232.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040232: Continued fraction for sqrt(248).
; 15,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1,30,1,2,1
seq $0,10197 ; Continued fraction for sqrt(138).
mul $0,7
div $0,5
| 43.428571 | 190 | 0.608553 |
3f7545be7c55f6f4cd49905adb41466fc8d0df7a | 221 | asm | Assembly | lang/english/jobn.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | lang/english/jobn.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | lang/english/jobn.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | * Text strings for jobs menu V0.01 1988 Tony Tebby QJUMP
*
section language
*
include 'dev8_mac_text'
*
mktext anon,{*** Anon ***}
mktext sbas,{SuperBASIC}
*
end
| 20.090909 | 73 | 0.524887 |
ee01a974558cbe42353acc63eead50ed43a03884 | 1,100 | asm | Assembly | popkcel/winx64.asm | popkc/popkcel | 0cf609fec34d2e5ee3a9f40c7ff8501b757fc2d8 | [
"MIT"
] | null | null | null | popkcel/winx64.asm | popkc/popkcel | 0cf609fec34d2e5ee3a9f40c7ff8501b757fc2d8 | [
"MIT"
] | 1 | 2020-08-06T14:10:43.000Z | 2020-08-06T14:10:43.000Z | popkcel/winx64.asm | popkc/popkcel | 0cf609fec34d2e5ee3a9f40c7ff8501b757fc2d8 | [
"MIT"
] | null | null | null | .CODE
PUBLIC popkcSetjmp
PUBLIC popkcLongjmp
popkcSetjmp PROC
mov [rcx],rbx
mov [rcx+8h],rsi
mov [rcx+10h],rdi
mov [rcx+18h],rbp
mov [rcx+20h],r12
mov [rcx+28h],r13
mov [rcx+30h],r14
mov [rcx+38h],r15
movdqu [rcx+40h],xmm6
movdqu [rcx+50h],xmm7
movdqu [rcx+60h],xmm8
movdqu [rcx+70h],xmm9
movdqu [rcx+80h],xmm10
movdqu [rcx+90h],xmm11
movdqu [rcx+0a0h],xmm12
movdqu [rcx+0b0h],xmm13
movdqu [rcx+0c0h],xmm14
movdqu [rcx+0d0h],xmm15
mov rdx,[rsp]
mov [rcx+0e0h],rdx
lea rdx,[rsp+8h]
mov [rcx+0e8h],rdx
xor rax,rax
ret
popkcSetjmp ENDP
popkcLongjmp PROC
mov rax,rdx
test rax,rax
jnz bwl
inc rax
bwl:
mov rbx,[rcx]
mov rsi,[rcx+8h]
mov rdi,[rcx+10h]
mov rbp,[rcx+18h]
mov r12,[rcx+20h]
mov r13,[rcx+28h]
mov r14,[rcx+30h]
mov r15,[rcx+38h]
movdqu xmm6,[rcx+40h]
movdqu xmm7,[rcx+50h]
movdqu xmm8,[rcx+60h]
movdqu xmm9,[rcx+70h]
movdqu xmm10,[rcx+80h]
movdqu xmm11,[rcx+90h]
movdqu xmm12,[rcx+0a0h]
movdqu xmm13,[rcx+0b0h]
movdqu xmm14,[rcx+0c0h]
movdqu xmm15,[rcx+0d0h]
mov rdx,[rcx+0e0h]
mov rsp,[rcx+0e8h]
jmp rdx
popkcLongjmp ENDP
END
| 17.460317 | 24 | 0.683636 |
683b73969ddd074835a2068fd14b6391864eba90 | 480 | asm | Assembly | PRG/objects/Unused1.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/objects/Unused1.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | PRG/objects/Unused1.asm | narfman0/smb3_pp1 | 38a58adafff67a403591e38875e9fae943a5fe76 | [
"Unlicense"
] | null | null | null | .byte $01 ; Unknown purpose
.byte OBJ_SPINY, $0C, $19
.byte OBJ_SPINY, $10, $19
.byte OBJ_SPINY, $12, $19
.byte OBJ_GOOMBAINSHOE, $1C, $09
.byte OBJ_GOOMBAINSHOE, $23, $18
.byte OBJ_SPINY, $2F, $19
.byte OBJ_SPINY, $32, $19
.byte OBJ_SPINY, $35, $19
.byte OBJ_SPINY, $38, $19
.byte OBJ_SPINY, $4F, $19
.byte OBJ_SPINY, $51, $19
.byte OBJ_SPINY, $53, $19
.byte OBJ_SPINY, $55, $19
.byte OBJ_GOOMBAINSHOE, $5F, $18
.byte OBJ_SPINY, $6C, $19
.byte $FF ; Terminator
| 25.263158 | 33 | 0.65 |
788fe6bdfd692abd0dd8e6b5acacc66cfc0bb7f4 | 1,682 | asm | Assembly | pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce3.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce3.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/objfmts/win64/tests/sce3.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | PROC_FRAME sample
db 048h; emit a REX prefix, to enable hot-patching
push rbp
[pushreg rbp]
sub rsp, 040h
[allocstack 040h]
lea rbp, [rsp+020h]
[setframe rbp, 020h]
movdqa [rbp], xmm7
[savexmm128 xmm7, 020h];the offset is from the base of the frame
;not the scaled offset of the frame
mov [rbp+018h], rsi
[savereg rsi, 018h]
mov [rsp+010h], rdi
[savereg rdi, 010h]; you can still use RSP as the base of the frame
; or any other register you choose
END_PROLOGUE
; you can modify the stack pointer outside of the prologue (similar to alloca)
; because we have a frame pointer.
; if we didn't have a frame pointer, this would be illegal
; if we didn't make this modification,
; there would be no need for a frame pointer
sub rsp, 060h
; we can unwind from the following AV because of the frame pointer
mov rax, 0
mov rax, [rax] ; AV!
; restore the registers that weren't saved with a push
; this isn't part of the official epilog, as described in section 2.5
movdqa xmm7, [rbp]
mov rsi, [rbp+018h]
mov rdi, [rbp-010h]
; Here's the official epilog
lea rsp, [rbp-020h]
pop rbp
ret
ENDPROC_FRAME
struc kFrame
.Fill resq 1 ; fill to 8 mod 16
.SavedRdi resq 1 ; saved register RDI
.SavedRsi resq 1 ; saved register RSI
endstruc
struc sampleFrame
.Fill resq 1 ; fill to 8 mod 16
.SavedRdi resq 1 ; Saved Register RDI
.SavedRsi resq 1 ; Saved Register RSI
endstruc
PROC_FRAME sample2
alloc_stack sampleFrame_size
save_reg rdi, sampleFrame.SavedRdi
save_reg rsi, sampleFrame.SavedRsi
END_PROLOGUE
; function body
mov rsi, [rsp+sampleFrame.SavedRsi]
mov rdi, [rsp+sampleFrame.SavedRdi]
; Here's the official epilog
add rsp, sampleFrame_size
ret
ENDPROC_FRAME
| 22.72973 | 78 | 0.747325 |
e64b519eae36107cc03614dc593c9582aaaf9f00 | 7,886 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_/i3-7100_9_0x84_notsx.log_21829_2915.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_/i3-7100_9_0x84_notsx.log_21829_2915.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_/i3-7100_9_0x84_notsx.log_21829_2915.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 %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xb5ca, %rsi
lea addresses_WC_ht+0xfae6, %rdi
nop
nop
nop
sub %r9, %r9
mov $95, %rcx
rep movsw
sub $29525, %rsi
lea addresses_WT_ht+0x9246, %rsi
lea addresses_UC_ht+0x153b6, %rdi
nop
nop
nop
nop
nop
inc %r15
mov $94, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x14e3e, %rsi
lea addresses_A_ht+0x53e6, %rdi
nop
nop
sub %rax, %rax
mov $125, %rcx
rep movsw
nop
nop
and $53424, %rdi
lea addresses_WT_ht+0xa98c, %r9
nop
nop
nop
nop
nop
and $34347, %r11
mov (%r9), %r15d
nop
nop
nop
nop
and %r9, %r9
lea addresses_WT_ht+0x1efa6, %rax
nop
nop
nop
nop
xor $25377, %r15
movb $0x61, (%rax)
dec %r11
lea addresses_A_ht+0x114c8, %rsi
lea addresses_A_ht+0x17b2a, %rdi
nop
nop
nop
sub $41139, %rbp
mov $56, %rcx
rep movsl
sub %r9, %r9
lea addresses_normal_ht+0x1de6, %rsi
lea addresses_A_ht+0xce80, %rdi
cmp %rax, %rax
mov $66, %rcx
rep movsb
nop
nop
xor %r9, %r9
lea addresses_D_ht+0x2036, %rax
nop
nop
nop
nop
add $38330, %rdi
movw $0x6162, (%rax)
nop
nop
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x185e6, %rsi
lea addresses_WC_ht+0x16d2e, %rdi
nop
nop
nop
nop
inc %r11
mov $75, %rcx
rep movsl
nop
nop
nop
add $18577, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_normal+0x115e6, %rcx
nop
nop
cmp $61688, %r13
movl $0x51525354, (%rcx)
nop
nop
nop
cmp $2392, %r13
// Faulty Load
mov $0x63de9500000005e6, %r13
nop
nop
nop
sub %rdx, %rdx
movb (%r13), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'e6': 93, '1a': 108, '54': 8211, '1e': 107, 'd8': 72, '1c': 114, 'fe': 119, '4e': 99, '80': 104, '46': 94, '8a': 108, 'c4': 118, '0e': 117, 'de': 101, '32': 97, 'dc': 106, '76': 103, '5a': 105, 'e2': 93, '68': 71, '04': 121, 'd6': 104, '9c': 80, 'bc': 103, '34': 110, 'c6': 85, 'ee': 115, '5e': 91, '28': 69, 'f2': 76, '22': 118, '14': 137, 'f0': 102, 'a6': 110, '18': 79, '94': 123, '62': 85, '6e': 97, 'ea': 107, '60': 93, 'a2': 120, '0c': 149, '12': 101, 'ac': 111, '2e': 96, '9a': 72, '38': 73, 'f6': 93, 'd2': 76, '5c': 121, 'b4': 99, '2a': 97, 'ba': 91, 'a8': 71, 'b0': 105, '48': 66, 'fa': 103, 'da': 120, '72': 91, '2c': 105, 'ec': 89, 'f8': 67, 'e4': 103, '9e': 121, '44': 131, 'cc': 101, '66': 99, '82': 103, '08': 104, '3c': 94, '4a': 114, '98': 57, '36': 90, '56': 116, '24': 119, 'ce': 91, '42': 100, '58': 73, '3e': 121, '20': 118, 'c2': 95, '84': 101, '26': 88, '74': 106, '50': 103, '0a': 105, '30': 111, '3a': 87, 'be': 103, '90': 127, '88': 73, '8e': 108, '7e': 115, '6c': 116, '40': 122, '7a': 103, 'f4': 97, '52': 95, '6a': 114, 'fc': 110, '86': 102, 'ca': 95, 'e0': 116, 'ae': 78, '16': 101, '02': 119, 'd0': 112, '92': 116, '00': 955, '10': 116, 'c0': 96, '7c': 112, '96': 109, 'aa': 106, '4c': 113, 'c8': 77, 'b2': 99, '06': 94, '78': 48, '8c': 89, 'b6': 113, 'a4': 103, 'b8': 73, '70': 101, 'e8': 71, 'a0': 100, 'd4': 102, '64': 118}
1c 82 44 54 dc 6e 54 1e 54 54 54 54 9c 08 58 94 54 32 00 4e 00 54 46 54 54 54 54 80 c2 36 c8 32 54 ba 54 54 62 1c 9e b0 56 54 f4 54 58 54 54 aa ea 54 56 5e 52 34 7a 40 54 e0 c6 f4 f2 ba 00 06 0a b8 aa 54 54 c4 8a c8 54 54 84 a0 54 54 54 54 00 c2 40 54 9c 92 b0 54 3c c2 a6 d0 f8 10 1e 54 d8 64 30 c2 58 54 0a 54 20 1e 1e 54 9e 44 54 cc ee 54 b4 4e f2 9a 54 54 54 3a e4 54 54 54 54 54 54 30 54 54 90 54 ee 00 8e 54 54 54 08 54 54 96 c8 54 54 54 54 1e 54 9a ac b8 54 54 54 8e aa 54 54 f6 02 ba 38 72 26 5c 7a c6 8a 54 f0 54 e4 e8 52 c2 8a 54 cc 74 5e 54 12 bc 04 54 56 8a 2e 1a 84 ea 54 e8 ba 54 d8 54 30 c0 aa b4 2a d0 54 a2 54 54 54 54 54 54 54 b4 54 54 54 00 f2 00 0c 54 64 90 d6 94 54 54 78 24 3c 6a aa 54 54 54 54 54 d0 0e 4c f4 3e d2 14 54 54 54 54 68 54 54 54 00 16 82 56 4e 68 46 f2 1c d8 20 90 5a 5e 30 70 90 82 08 54 84 6a e0 b2 56 22 9a 54 00 92 74 2c aa da 54 00 54 54 2a a8 da e2 54 54 54 54 3a 54 18 82 54 54 ac e2 54 54 54 e4 54 54 6a f0 2e 54 3e 54 7e 2e 22 ac 9c 34 be 54 54 54 54 c8 36 54 24 54 54 00 96 54 36 6a 6e b2 fa 54 c2 6e 54 54 72 18 3e 54 34 c4 54 2a 54 a4 54 54 cc 54 54 1a 54 28 02 7a ea 54 00 f6 54 94 58 54 9e 1e 54 d6 54 54 54 54 d6 16 bc 54 54 d8 90 d8 0c 54 54 54 00 ee 54 54 00 d6 6c 26 54 bc 68 f4 54 e0 54 4c b8 56 54 9e 54 16 54 54 82 7a 08 54 54 54 72 ea 54 ea ee 54 54 54 54 54 ac 42 6a 8a 1a ea 54 54 54 54 a4 86 54 3a 54 a6 54 7c 54 54 54 54 54 54 54 84 54 8e 54 d0 64 54 50 ee 54 54 54 92 5e 00 18 0c 7c a4 3e 62 04 80 2e 32 54 0a 54 d2 54 54 54 3e 54 ac 54 54 8c 54 d6 00 54 c4 5c 54 54 54 2c 54 54 54 c2 80 54 aa be 54 90 3e 54 94 54 6a 4c 14 90 54 54 54 54 3a 54 30 68 54 a0 54 0c 9c 7a 54 54 00 58 a6 e0 54 54 00 74 54 82 be 90 54 d6 4c 54 80 a0 22 54 0c 52 bc 54 54 54 54 d0 54 cc 54 54 8a 94 66 e8 44 d2 54 60 54 56 d0 50 08 54 12 54 de 6a b2 a8 68 ec 54 54 8a 90 54 b4 54 36 06 5e b6 3e fe 7c 54 54 54 80 64 de fe 18 64 d6 c0 10 54 34 54 b6 ce 8e 54 54 a6 ac e6 54 5e 54 ee 54 0a 54 6e de 8e 54 54 54 44 00 e6 5c 64 0e b2 6c 1e 0c dc 38 30 4c 88 54 54 54 4c 0c d6 a0 e2 2c b4 36 16 1a 2a 38 54 16 54 54 52 00 04 b0 54 54 7c 14 54 a0 54 54 70 52 e8 e2 66 00 54 24 54 0e 54 d4 c0 54 a4 54 00 ee 46 54 92 46 54 54 54 e8 54 de 54 b6 54 d0 84 54 40 42 14 54 56 54 54 e2 ce 54 54 5e 7e 2a 54 78 9c ce 74 00 54 1c c0 be 78 54 54 54 72 f6 50 d0 c6 8e 54 54 54 d2 66 54 04 ba 4c 00 e2 54 54 54 54 ba bc 1e b0 54 54 a2 54 54 ee 54 54 50 54 10 54 cc d8 5c 5a d4 76 54 54 54 2a b2 c6 54 54 54 54 54 3e ee 00 54 7c 44 dc 54 54 24 54 60 3e e2 54 3e 40 54 12 54 8a 96 94 ac ae e4 16 54 36 54 f4 54 54 c4 54 88 54 54 54 14 08 54 54 4e 54 54 c8 54 54 54 5c ba 54 9e c8 d0 54 b2 46 6e 54 16 54 54 0e 54 ee 54 96 54 00 b8 54 54 54 54 54 02 54 54 54 c4 54 0c 8c 64 d8 54 54 30 54 54 54 1c ea a8 54 26 a2 30 54 32 54 e6 54 8a 92 54 62 4a 1c 46 ce 54 36 54 54 e0 00 32 ee 54 54 2a 54 04 34 6a ea 9e 48 54 a8 00 54 6a 54 46 e8 54 54 3e 70 80 54 54 54 c6 54 54 c4 54 54 d0 54 54 54 88 22 54 54 54 54 54 54 54 54 54 1e 00 54 40 50 50 54 54 2c 54 bc 54 54 3e ac a0 54 54 54 d4
*/
| 44.055866 | 2,999 | 0.621735 |
894f29d57266f1f09f5be55e2a16a69853490b0e | 431 | asm | Assembly | programs/oeis/168/A168281.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168281.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168281.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168281: Triangle T(n,m) = 2*(min(n+m-1,m))^2 read by rows.
; 2,2,2,2,8,2,2,8,8,2,2,8,18,8,2,2,8,18,18,8,2,2,8,18,32,18,8,2,2,8,18,32,32,18,8,2,2,8,18,32,50,32,18,8,2,2,8,18,32,50,50,32,18,8,2,2,8,18,32,50,72,50,32,18,8,2,2,8,18,32,50,72,72,50,32,18,8,2,2,8,18,32,50,72,98,72,50,32,18,8,2,2,8,18,32,50,72,98,98,72
seq $0,157454 ; Triangle read by rows: T(n, m) = min(2*m - 1, 2*(n - m) + 1).
div $0,2
add $0,1
pow $0,2
mul $0,2
| 47.888889 | 253 | 0.580046 |
ef57758f739f85e7a44b6b22572ab902f149d11d | 1,085 | asm | Assembly | _build/dispatcher/jmp_ippsGFpECNegPoint_13185926.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsGFpECNegPoint_13185926.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsGFpECNegPoint_13185926.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsGFpECNegPoint:function
extern n8_ippsGFpECNegPoint:function
extern y8_ippsGFpECNegPoint:function
extern e9_ippsGFpECNegPoint:function
extern l9_ippsGFpECNegPoint:function
extern n0_ippsGFpECNegPoint:function
extern k0_ippsGFpECNegPoint:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECNegPoint
.Larraddr_ippsGFpECNegPoint:
dq m7_ippsGFpECNegPoint
dq n8_ippsGFpECNegPoint
dq y8_ippsGFpECNegPoint
dq e9_ippsGFpECNegPoint
dq l9_ippsGFpECNegPoint
dq n0_ippsGFpECNegPoint
dq k0_ippsGFpECNegPoint
segment .text
global ippsGFpECNegPoint:function (ippsGFpECNegPoint.LEndippsGFpECNegPoint - ippsGFpECNegPoint)
.Lin_ippsGFpECNegPoint:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECNegPoint:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECNegPoint]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECNegPoint:
| 27.820513 | 95 | 0.797235 |
cbf7f669d798ec44b7d12444af07fe011554462e | 638 | asm | Assembly | programs/oeis/278/A278169.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/278/A278169.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/278/A278169.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A278169: Characteristic function for A000960.
; 1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,100617 ; There are n people in a room. The first half (i.e., floor(n/2)) of them leave, then 1/3 (i.e., floor of 1/3) of those remaining leave, then 1/4, then 1/5, etc.; sequence gives number who remain at the end.
mov $2,$3
mul $2,$0
add $1,$2
mov $4,$0
lpe
min $5,1
mul $5,$4
sub $1,$5
mov $0,$1
| 30.380952 | 223 | 0.57837 |
df53865ccc42bdde433e09b547c4d6bc5cb565e5 | 583 | asm | Assembly | programs/oeis/072/A072702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/072/A072702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/072/A072702.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A072702: Last digit of F(n) is 4 where F(n) is the n-th Fibonacci number.
; 9,12,18,51,69,72,78,111,129,132,138,171,189,192,198,231,249,252,258,291,309,312,318,351,369,372,378,411,429,432,438,471,489,492,498,531,549,552,558,591,609,612,618,651,669,672,678,711,729,732,738,771,789,792,798,831,849,852,858,891,909,912,918,951,969,972,978,1011,1029,1032,1038,1071,1089,1092,1098,1131,1149,1152,1158,1191,1209,1212,1218,1251,1269,1272,1278,1311,1329,1332,1338,1371,1389,1392,1398,1431,1449,1452,1458,1491
add $0,2
seq $0,72682 ; Numbers congruent to {3, 36, 54, 57} mod 60.
sub $0,45
| 83.285714 | 426 | 0.734134 |
a25449d39150689aae702b9f43de4d49f77d4312 | 253 | asm | Assembly | libsrc/stdio/sprinter/conio_vars.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/sprinter/conio_vars.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/sprinter/conio_vars.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Shared variables between the VT100 and VT52 engines
MODULE conio_vars
SECTION data_clib
PUBLIC __sprinter_attr
.__sprinter_attr defb @00001111 ;bright white on black
.inverse_attr defb @01111000 ;grey on white
| 21.083333 | 69 | 0.699605 |
5e218b8c1da52425143550a0f1e99cde30782407 | 45,748 | asm | Assembly | echo.asm | LongLeonardoLe/xv6 | b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5 | [
"MIT-0"
] | null | null | null | echo.asm | LongLeonardoLe/xv6 | b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5 | [
"MIT-0"
] | null | null | null | echo.asm | LongLeonardoLe/xv6 | b10f1ad3bce4c3c264fc9746cd6efe1a78d606c5 | [
"MIT-0"
] | null | null | null |
_echo: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 53 push %ebx
e: 51 push %ecx
f: 83 ec 10 sub $0x10,%esp
12: 89 cb mov %ecx,%ebx
int i;
for(i = 1; i < argc; i++)
14: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp)
1b: eb 3c jmp 59 <main+0x59>
printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
1d: 8b 45 f4 mov -0xc(%ebp),%eax
20: 83 c0 01 add $0x1,%eax
23: 3b 03 cmp (%ebx),%eax
25: 7d 07 jge 2e <main+0x2e>
27: ba d7 08 00 00 mov $0x8d7,%edx
2c: eb 05 jmp 33 <main+0x33>
2e: ba d9 08 00 00 mov $0x8d9,%edx
33: 8b 45 f4 mov -0xc(%ebp),%eax
36: 8d 0c 85 00 00 00 00 lea 0x0(,%eax,4),%ecx
3d: 8b 43 04 mov 0x4(%ebx),%eax
40: 01 c8 add %ecx,%eax
42: 8b 00 mov (%eax),%eax
44: 52 push %edx
45: 50 push %eax
46: 68 db 08 00 00 push $0x8db
4b: 6a 01 push $0x1
4d: e8 cf 04 00 00 call 521 <printf>
52: 83 c4 10 add $0x10,%esp
int
main(int argc, char *argv[])
{
int i;
for(i = 1; i < argc; i++)
55: 83 45 f4 01 addl $0x1,-0xc(%ebp)
59: 8b 45 f4 mov -0xc(%ebp),%eax
5c: 3b 03 cmp (%ebx),%eax
5e: 7c bd jl 1d <main+0x1d>
printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
exit();
60: e8 e5 02 00 00 call 34a <exit>
00000065 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
65: 55 push %ebp
66: 89 e5 mov %esp,%ebp
68: 57 push %edi
69: 53 push %ebx
asm volatile("cld; rep stosb" :
6a: 8b 4d 08 mov 0x8(%ebp),%ecx
6d: 8b 55 10 mov 0x10(%ebp),%edx
70: 8b 45 0c mov 0xc(%ebp),%eax
73: 89 cb mov %ecx,%ebx
75: 89 df mov %ebx,%edi
77: 89 d1 mov %edx,%ecx
79: fc cld
7a: f3 aa rep stos %al,%es:(%edi)
7c: 89 ca mov %ecx,%edx
7e: 89 fb mov %edi,%ebx
80: 89 5d 08 mov %ebx,0x8(%ebp)
83: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
86: 90 nop
87: 5b pop %ebx
88: 5f pop %edi
89: 5d pop %ebp
8a: c3 ret
0000008b <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
8b: 55 push %ebp
8c: 89 e5 mov %esp,%ebp
8e: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
91: 8b 45 08 mov 0x8(%ebp),%eax
94: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
97: 90 nop
98: 8b 45 08 mov 0x8(%ebp),%eax
9b: 8d 50 01 lea 0x1(%eax),%edx
9e: 89 55 08 mov %edx,0x8(%ebp)
a1: 8b 55 0c mov 0xc(%ebp),%edx
a4: 8d 4a 01 lea 0x1(%edx),%ecx
a7: 89 4d 0c mov %ecx,0xc(%ebp)
aa: 0f b6 12 movzbl (%edx),%edx
ad: 88 10 mov %dl,(%eax)
af: 0f b6 00 movzbl (%eax),%eax
b2: 84 c0 test %al,%al
b4: 75 e2 jne 98 <strcpy+0xd>
;
return os;
b6: 8b 45 fc mov -0x4(%ebp),%eax
}
b9: c9 leave
ba: c3 ret
000000bb <strcmp>:
int
strcmp(const char *p, const char *q)
{
bb: 55 push %ebp
bc: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
be: eb 08 jmp c8 <strcmp+0xd>
p++, q++;
c0: 83 45 08 01 addl $0x1,0x8(%ebp)
c4: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
c8: 8b 45 08 mov 0x8(%ebp),%eax
cb: 0f b6 00 movzbl (%eax),%eax
ce: 84 c0 test %al,%al
d0: 74 10 je e2 <strcmp+0x27>
d2: 8b 45 08 mov 0x8(%ebp),%eax
d5: 0f b6 10 movzbl (%eax),%edx
d8: 8b 45 0c mov 0xc(%ebp),%eax
db: 0f b6 00 movzbl (%eax),%eax
de: 38 c2 cmp %al,%dl
e0: 74 de je c0 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
e2: 8b 45 08 mov 0x8(%ebp),%eax
e5: 0f b6 00 movzbl (%eax),%eax
e8: 0f b6 d0 movzbl %al,%edx
eb: 8b 45 0c mov 0xc(%ebp),%eax
ee: 0f b6 00 movzbl (%eax),%eax
f1: 0f b6 c0 movzbl %al,%eax
f4: 29 c2 sub %eax,%edx
f6: 89 d0 mov %edx,%eax
}
f8: 5d pop %ebp
f9: c3 ret
000000fa <strlen>:
uint
strlen(char *s)
{
fa: 55 push %ebp
fb: 89 e5 mov %esp,%ebp
fd: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
100: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
107: eb 04 jmp 10d <strlen+0x13>
109: 83 45 fc 01 addl $0x1,-0x4(%ebp)
10d: 8b 55 fc mov -0x4(%ebp),%edx
110: 8b 45 08 mov 0x8(%ebp),%eax
113: 01 d0 add %edx,%eax
115: 0f b6 00 movzbl (%eax),%eax
118: 84 c0 test %al,%al
11a: 75 ed jne 109 <strlen+0xf>
;
return n;
11c: 8b 45 fc mov -0x4(%ebp),%eax
}
11f: c9 leave
120: c3 ret
00000121 <memset>:
void*
memset(void *dst, int c, uint n)
{
121: 55 push %ebp
122: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
124: 8b 45 10 mov 0x10(%ebp),%eax
127: 50 push %eax
128: ff 75 0c pushl 0xc(%ebp)
12b: ff 75 08 pushl 0x8(%ebp)
12e: e8 32 ff ff ff call 65 <stosb>
133: 83 c4 0c add $0xc,%esp
return dst;
136: 8b 45 08 mov 0x8(%ebp),%eax
}
139: c9 leave
13a: c3 ret
0000013b <strchr>:
char*
strchr(const char *s, char c)
{
13b: 55 push %ebp
13c: 89 e5 mov %esp,%ebp
13e: 83 ec 04 sub $0x4,%esp
141: 8b 45 0c mov 0xc(%ebp),%eax
144: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
147: eb 14 jmp 15d <strchr+0x22>
if(*s == c)
149: 8b 45 08 mov 0x8(%ebp),%eax
14c: 0f b6 00 movzbl (%eax),%eax
14f: 3a 45 fc cmp -0x4(%ebp),%al
152: 75 05 jne 159 <strchr+0x1e>
return (char*)s;
154: 8b 45 08 mov 0x8(%ebp),%eax
157: eb 13 jmp 16c <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
159: 83 45 08 01 addl $0x1,0x8(%ebp)
15d: 8b 45 08 mov 0x8(%ebp),%eax
160: 0f b6 00 movzbl (%eax),%eax
163: 84 c0 test %al,%al
165: 75 e2 jne 149 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
167: b8 00 00 00 00 mov $0x0,%eax
}
16c: c9 leave
16d: c3 ret
0000016e <gets>:
char*
gets(char *buf, int max)
{
16e: 55 push %ebp
16f: 89 e5 mov %esp,%ebp
171: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
174: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
17b: eb 42 jmp 1bf <gets+0x51>
cc = read(0, &c, 1);
17d: 83 ec 04 sub $0x4,%esp
180: 6a 01 push $0x1
182: 8d 45 ef lea -0x11(%ebp),%eax
185: 50 push %eax
186: 6a 00 push $0x0
188: e8 d5 01 00 00 call 362 <read>
18d: 83 c4 10 add $0x10,%esp
190: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
193: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
197: 7e 33 jle 1cc <gets+0x5e>
break;
buf[i++] = c;
199: 8b 45 f4 mov -0xc(%ebp),%eax
19c: 8d 50 01 lea 0x1(%eax),%edx
19f: 89 55 f4 mov %edx,-0xc(%ebp)
1a2: 89 c2 mov %eax,%edx
1a4: 8b 45 08 mov 0x8(%ebp),%eax
1a7: 01 c2 add %eax,%edx
1a9: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1ad: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
1af: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1b3: 3c 0a cmp $0xa,%al
1b5: 74 16 je 1cd <gets+0x5f>
1b7: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1bb: 3c 0d cmp $0xd,%al
1bd: 74 0e je 1cd <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
1bf: 8b 45 f4 mov -0xc(%ebp),%eax
1c2: 83 c0 01 add $0x1,%eax
1c5: 3b 45 0c cmp 0xc(%ebp),%eax
1c8: 7c b3 jl 17d <gets+0xf>
1ca: eb 01 jmp 1cd <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
1cc: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1cd: 8b 55 f4 mov -0xc(%ebp),%edx
1d0: 8b 45 08 mov 0x8(%ebp),%eax
1d3: 01 d0 add %edx,%eax
1d5: c6 00 00 movb $0x0,(%eax)
return buf;
1d8: 8b 45 08 mov 0x8(%ebp),%eax
}
1db: c9 leave
1dc: c3 ret
000001dd <stat>:
int
stat(char *n, struct stat *st)
{
1dd: 55 push %ebp
1de: 89 e5 mov %esp,%ebp
1e0: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1e3: 83 ec 08 sub $0x8,%esp
1e6: 6a 00 push $0x0
1e8: ff 75 08 pushl 0x8(%ebp)
1eb: e8 9a 01 00 00 call 38a <open>
1f0: 83 c4 10 add $0x10,%esp
1f3: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
1f6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1fa: 79 07 jns 203 <stat+0x26>
return -1;
1fc: b8 ff ff ff ff mov $0xffffffff,%eax
201: eb 25 jmp 228 <stat+0x4b>
r = fstat(fd, st);
203: 83 ec 08 sub $0x8,%esp
206: ff 75 0c pushl 0xc(%ebp)
209: ff 75 f4 pushl -0xc(%ebp)
20c: e8 91 01 00 00 call 3a2 <fstat>
211: 83 c4 10 add $0x10,%esp
214: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
217: 83 ec 0c sub $0xc,%esp
21a: ff 75 f4 pushl -0xc(%ebp)
21d: e8 50 01 00 00 call 372 <close>
222: 83 c4 10 add $0x10,%esp
return r;
225: 8b 45 f0 mov -0x10(%ebp),%eax
}
228: c9 leave
229: c3 ret
0000022a <atoi>:
int
atoi(const char *s)
{
22a: 55 push %ebp
22b: 89 e5 mov %esp,%ebp
22d: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
230: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
237: eb 25 jmp 25e <atoi+0x34>
n = n*10 + *s++ - '0';
239: 8b 55 fc mov -0x4(%ebp),%edx
23c: 89 d0 mov %edx,%eax
23e: c1 e0 02 shl $0x2,%eax
241: 01 d0 add %edx,%eax
243: 01 c0 add %eax,%eax
245: 89 c1 mov %eax,%ecx
247: 8b 45 08 mov 0x8(%ebp),%eax
24a: 8d 50 01 lea 0x1(%eax),%edx
24d: 89 55 08 mov %edx,0x8(%ebp)
250: 0f b6 00 movzbl (%eax),%eax
253: 0f be c0 movsbl %al,%eax
256: 01 c8 add %ecx,%eax
258: 83 e8 30 sub $0x30,%eax
25b: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
25e: 8b 45 08 mov 0x8(%ebp),%eax
261: 0f b6 00 movzbl (%eax),%eax
264: 3c 2f cmp $0x2f,%al
266: 7e 0a jle 272 <atoi+0x48>
268: 8b 45 08 mov 0x8(%ebp),%eax
26b: 0f b6 00 movzbl (%eax),%eax
26e: 3c 39 cmp $0x39,%al
270: 7e c7 jle 239 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
272: 8b 45 fc mov -0x4(%ebp),%eax
}
275: c9 leave
276: c3 ret
00000277 <atoo>:
int
atoo(const char *s)
{
277: 55 push %ebp
278: 89 e5 mov %esp,%ebp
27a: 83 ec 10 sub $0x10,%esp
int n, sign;
n = 0;
27d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s == ' ')
284: eb 04 jmp 28a <atoo+0x13>
s++;
286: 83 45 08 01 addl $0x1,0x8(%ebp)
int
atoo(const char *s)
{
int n, sign;
n = 0;
while (*s == ' ')
28a: 8b 45 08 mov 0x8(%ebp),%eax
28d: 0f b6 00 movzbl (%eax),%eax
290: 3c 20 cmp $0x20,%al
292: 74 f2 je 286 <atoo+0xf>
s++;
sign = (*s == '-') ? -1 : 1;
294: 8b 45 08 mov 0x8(%ebp),%eax
297: 0f b6 00 movzbl (%eax),%eax
29a: 3c 2d cmp $0x2d,%al
29c: 75 07 jne 2a5 <atoo+0x2e>
29e: b8 ff ff ff ff mov $0xffffffff,%eax
2a3: eb 05 jmp 2aa <atoo+0x33>
2a5: b8 01 00 00 00 mov $0x1,%eax
2aa: 89 45 f8 mov %eax,-0x8(%ebp)
if (*s == '+' || *s == '-')
2ad: 8b 45 08 mov 0x8(%ebp),%eax
2b0: 0f b6 00 movzbl (%eax),%eax
2b3: 3c 2b cmp $0x2b,%al
2b5: 74 0a je 2c1 <atoo+0x4a>
2b7: 8b 45 08 mov 0x8(%ebp),%eax
2ba: 0f b6 00 movzbl (%eax),%eax
2bd: 3c 2d cmp $0x2d,%al
2bf: 75 27 jne 2e8 <atoo+0x71>
s++;
2c1: 83 45 08 01 addl $0x1,0x8(%ebp)
while ('0' <= *s && *s <= '7')
2c5: eb 21 jmp 2e8 <atoo+0x71>
n = n*8 + *s++ - '0';
2c7: 8b 45 fc mov -0x4(%ebp),%eax
2ca: 8d 0c c5 00 00 00 00 lea 0x0(,%eax,8),%ecx
2d1: 8b 45 08 mov 0x8(%ebp),%eax
2d4: 8d 50 01 lea 0x1(%eax),%edx
2d7: 89 55 08 mov %edx,0x8(%ebp)
2da: 0f b6 00 movzbl (%eax),%eax
2dd: 0f be c0 movsbl %al,%eax
2e0: 01 c8 add %ecx,%eax
2e2: 83 e8 30 sub $0x30,%eax
2e5: 89 45 fc mov %eax,-0x4(%ebp)
while (*s == ' ')
s++;
sign = (*s == '-') ? -1 : 1;
if (*s == '+' || *s == '-')
s++;
while ('0' <= *s && *s <= '7')
2e8: 8b 45 08 mov 0x8(%ebp),%eax
2eb: 0f b6 00 movzbl (%eax),%eax
2ee: 3c 2f cmp $0x2f,%al
2f0: 7e 0a jle 2fc <atoo+0x85>
2f2: 8b 45 08 mov 0x8(%ebp),%eax
2f5: 0f b6 00 movzbl (%eax),%eax
2f8: 3c 37 cmp $0x37,%al
2fa: 7e cb jle 2c7 <atoo+0x50>
n = n*8 + *s++ - '0';
return sign*n;
2fc: 8b 45 f8 mov -0x8(%ebp),%eax
2ff: 0f af 45 fc imul -0x4(%ebp),%eax
}
303: c9 leave
304: c3 ret
00000305 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
305: 55 push %ebp
306: 89 e5 mov %esp,%ebp
308: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
30b: 8b 45 08 mov 0x8(%ebp),%eax
30e: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
311: 8b 45 0c mov 0xc(%ebp),%eax
314: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
317: eb 17 jmp 330 <memmove+0x2b>
*dst++ = *src++;
319: 8b 45 fc mov -0x4(%ebp),%eax
31c: 8d 50 01 lea 0x1(%eax),%edx
31f: 89 55 fc mov %edx,-0x4(%ebp)
322: 8b 55 f8 mov -0x8(%ebp),%edx
325: 8d 4a 01 lea 0x1(%edx),%ecx
328: 89 4d f8 mov %ecx,-0x8(%ebp)
32b: 0f b6 12 movzbl (%edx),%edx
32e: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
330: 8b 45 10 mov 0x10(%ebp),%eax
333: 8d 50 ff lea -0x1(%eax),%edx
336: 89 55 10 mov %edx,0x10(%ebp)
339: 85 c0 test %eax,%eax
33b: 7f dc jg 319 <memmove+0x14>
*dst++ = *src++;
return vdst;
33d: 8b 45 08 mov 0x8(%ebp),%eax
}
340: c9 leave
341: c3 ret
00000342 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
342: b8 01 00 00 00 mov $0x1,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <exit>:
SYSCALL(exit)
34a: b8 02 00 00 00 mov $0x2,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <wait>:
SYSCALL(wait)
352: b8 03 00 00 00 mov $0x3,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <pipe>:
SYSCALL(pipe)
35a: b8 04 00 00 00 mov $0x4,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <read>:
SYSCALL(read)
362: b8 05 00 00 00 mov $0x5,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <write>:
SYSCALL(write)
36a: b8 10 00 00 00 mov $0x10,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <close>:
SYSCALL(close)
372: b8 15 00 00 00 mov $0x15,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <kill>:
SYSCALL(kill)
37a: b8 06 00 00 00 mov $0x6,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <exec>:
SYSCALL(exec)
382: b8 07 00 00 00 mov $0x7,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <open>:
SYSCALL(open)
38a: b8 0f 00 00 00 mov $0xf,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <mknod>:
SYSCALL(mknod)
392: b8 11 00 00 00 mov $0x11,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <unlink>:
SYSCALL(unlink)
39a: b8 12 00 00 00 mov $0x12,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <fstat>:
SYSCALL(fstat)
3a2: b8 08 00 00 00 mov $0x8,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <link>:
SYSCALL(link)
3aa: b8 13 00 00 00 mov $0x13,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <mkdir>:
SYSCALL(mkdir)
3b2: b8 14 00 00 00 mov $0x14,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <chdir>:
SYSCALL(chdir)
3ba: b8 09 00 00 00 mov $0x9,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <dup>:
SYSCALL(dup)
3c2: b8 0a 00 00 00 mov $0xa,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <getpid>:
SYSCALL(getpid)
3ca: b8 0b 00 00 00 mov $0xb,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <sbrk>:
SYSCALL(sbrk)
3d2: b8 0c 00 00 00 mov $0xc,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <sleep>:
SYSCALL(sleep)
3da: b8 0d 00 00 00 mov $0xd,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <uptime>:
SYSCALL(uptime)
3e2: b8 0e 00 00 00 mov $0xe,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <halt>:
SYSCALL(halt)
3ea: b8 16 00 00 00 mov $0x16,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <date>:
SYSCALL(date)
3f2: b8 17 00 00 00 mov $0x17,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <getuid>:
SYSCALL(getuid)
3fa: b8 18 00 00 00 mov $0x18,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <getgid>:
SYSCALL(getgid)
402: b8 19 00 00 00 mov $0x19,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <getppid>:
SYSCALL(getppid)
40a: b8 1a 00 00 00 mov $0x1a,%eax
40f: cd 40 int $0x40
411: c3 ret
00000412 <setuid>:
SYSCALL(setuid)
412: b8 1b 00 00 00 mov $0x1b,%eax
417: cd 40 int $0x40
419: c3 ret
0000041a <setgid>:
SYSCALL(setgid)
41a: b8 1c 00 00 00 mov $0x1c,%eax
41f: cd 40 int $0x40
421: c3 ret
00000422 <getprocs>:
SYSCALL(getprocs)
422: b8 1d 00 00 00 mov $0x1d,%eax
427: cd 40 int $0x40
429: c3 ret
0000042a <setpriority>:
SYSCALL(setpriority)
42a: b8 1e 00 00 00 mov $0x1e,%eax
42f: cd 40 int $0x40
431: c3 ret
00000432 <chmod>:
SYSCALL(chmod)
432: b8 1f 00 00 00 mov $0x1f,%eax
437: cd 40 int $0x40
439: c3 ret
0000043a <chown>:
SYSCALL(chown)
43a: b8 20 00 00 00 mov $0x20,%eax
43f: cd 40 int $0x40
441: c3 ret
00000442 <chgrp>:
SYSCALL(chgrp)
442: b8 21 00 00 00 mov $0x21,%eax
447: cd 40 int $0x40
449: c3 ret
0000044a <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
44a: 55 push %ebp
44b: 89 e5 mov %esp,%ebp
44d: 83 ec 18 sub $0x18,%esp
450: 8b 45 0c mov 0xc(%ebp),%eax
453: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
456: 83 ec 04 sub $0x4,%esp
459: 6a 01 push $0x1
45b: 8d 45 f4 lea -0xc(%ebp),%eax
45e: 50 push %eax
45f: ff 75 08 pushl 0x8(%ebp)
462: e8 03 ff ff ff call 36a <write>
467: 83 c4 10 add $0x10,%esp
}
46a: 90 nop
46b: c9 leave
46c: c3 ret
0000046d <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
46d: 55 push %ebp
46e: 89 e5 mov %esp,%ebp
470: 53 push %ebx
471: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
474: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
47b: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
47f: 74 17 je 498 <printint+0x2b>
481: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
485: 79 11 jns 498 <printint+0x2b>
neg = 1;
487: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
48e: 8b 45 0c mov 0xc(%ebp),%eax
491: f7 d8 neg %eax
493: 89 45 ec mov %eax,-0x14(%ebp)
496: eb 06 jmp 49e <printint+0x31>
} else {
x = xx;
498: 8b 45 0c mov 0xc(%ebp),%eax
49b: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
49e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
4a5: 8b 4d f4 mov -0xc(%ebp),%ecx
4a8: 8d 41 01 lea 0x1(%ecx),%eax
4ab: 89 45 f4 mov %eax,-0xc(%ebp)
4ae: 8b 5d 10 mov 0x10(%ebp),%ebx
4b1: 8b 45 ec mov -0x14(%ebp),%eax
4b4: ba 00 00 00 00 mov $0x0,%edx
4b9: f7 f3 div %ebx
4bb: 89 d0 mov %edx,%eax
4bd: 0f b6 80 54 0b 00 00 movzbl 0xb54(%eax),%eax
4c4: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
4c8: 8b 5d 10 mov 0x10(%ebp),%ebx
4cb: 8b 45 ec mov -0x14(%ebp),%eax
4ce: ba 00 00 00 00 mov $0x0,%edx
4d3: f7 f3 div %ebx
4d5: 89 45 ec mov %eax,-0x14(%ebp)
4d8: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4dc: 75 c7 jne 4a5 <printint+0x38>
if(neg)
4de: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4e2: 74 2d je 511 <printint+0xa4>
buf[i++] = '-';
4e4: 8b 45 f4 mov -0xc(%ebp),%eax
4e7: 8d 50 01 lea 0x1(%eax),%edx
4ea: 89 55 f4 mov %edx,-0xc(%ebp)
4ed: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4f2: eb 1d jmp 511 <printint+0xa4>
putc(fd, buf[i]);
4f4: 8d 55 dc lea -0x24(%ebp),%edx
4f7: 8b 45 f4 mov -0xc(%ebp),%eax
4fa: 01 d0 add %edx,%eax
4fc: 0f b6 00 movzbl (%eax),%eax
4ff: 0f be c0 movsbl %al,%eax
502: 83 ec 08 sub $0x8,%esp
505: 50 push %eax
506: ff 75 08 pushl 0x8(%ebp)
509: e8 3c ff ff ff call 44a <putc>
50e: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
511: 83 6d f4 01 subl $0x1,-0xc(%ebp)
515: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
519: 79 d9 jns 4f4 <printint+0x87>
putc(fd, buf[i]);
}
51b: 90 nop
51c: 8b 5d fc mov -0x4(%ebp),%ebx
51f: c9 leave
520: c3 ret
00000521 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
521: 55 push %ebp
522: 89 e5 mov %esp,%ebp
524: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
527: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
52e: 8d 45 0c lea 0xc(%ebp),%eax
531: 83 c0 04 add $0x4,%eax
534: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
537: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
53e: e9 59 01 00 00 jmp 69c <printf+0x17b>
c = fmt[i] & 0xff;
543: 8b 55 0c mov 0xc(%ebp),%edx
546: 8b 45 f0 mov -0x10(%ebp),%eax
549: 01 d0 add %edx,%eax
54b: 0f b6 00 movzbl (%eax),%eax
54e: 0f be c0 movsbl %al,%eax
551: 25 ff 00 00 00 and $0xff,%eax
556: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
559: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
55d: 75 2c jne 58b <printf+0x6a>
if(c == '%'){
55f: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
563: 75 0c jne 571 <printf+0x50>
state = '%';
565: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
56c: e9 27 01 00 00 jmp 698 <printf+0x177>
} else {
putc(fd, c);
571: 8b 45 e4 mov -0x1c(%ebp),%eax
574: 0f be c0 movsbl %al,%eax
577: 83 ec 08 sub $0x8,%esp
57a: 50 push %eax
57b: ff 75 08 pushl 0x8(%ebp)
57e: e8 c7 fe ff ff call 44a <putc>
583: 83 c4 10 add $0x10,%esp
586: e9 0d 01 00 00 jmp 698 <printf+0x177>
}
} else if(state == '%'){
58b: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
58f: 0f 85 03 01 00 00 jne 698 <printf+0x177>
if(c == 'd'){
595: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
599: 75 1e jne 5b9 <printf+0x98>
printint(fd, *ap, 10, 1);
59b: 8b 45 e8 mov -0x18(%ebp),%eax
59e: 8b 00 mov (%eax),%eax
5a0: 6a 01 push $0x1
5a2: 6a 0a push $0xa
5a4: 50 push %eax
5a5: ff 75 08 pushl 0x8(%ebp)
5a8: e8 c0 fe ff ff call 46d <printint>
5ad: 83 c4 10 add $0x10,%esp
ap++;
5b0: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5b4: e9 d8 00 00 00 jmp 691 <printf+0x170>
} else if(c == 'x' || c == 'p'){
5b9: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
5bd: 74 06 je 5c5 <printf+0xa4>
5bf: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
5c3: 75 1e jne 5e3 <printf+0xc2>
printint(fd, *ap, 16, 0);
5c5: 8b 45 e8 mov -0x18(%ebp),%eax
5c8: 8b 00 mov (%eax),%eax
5ca: 6a 00 push $0x0
5cc: 6a 10 push $0x10
5ce: 50 push %eax
5cf: ff 75 08 pushl 0x8(%ebp)
5d2: e8 96 fe ff ff call 46d <printint>
5d7: 83 c4 10 add $0x10,%esp
ap++;
5da: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5de: e9 ae 00 00 00 jmp 691 <printf+0x170>
} else if(c == 's'){
5e3: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
5e7: 75 43 jne 62c <printf+0x10b>
s = (char*)*ap;
5e9: 8b 45 e8 mov -0x18(%ebp),%eax
5ec: 8b 00 mov (%eax),%eax
5ee: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5f1: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5f5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5f9: 75 25 jne 620 <printf+0xff>
s = "(null)";
5fb: c7 45 f4 e0 08 00 00 movl $0x8e0,-0xc(%ebp)
while(*s != 0){
602: eb 1c jmp 620 <printf+0xff>
putc(fd, *s);
604: 8b 45 f4 mov -0xc(%ebp),%eax
607: 0f b6 00 movzbl (%eax),%eax
60a: 0f be c0 movsbl %al,%eax
60d: 83 ec 08 sub $0x8,%esp
610: 50 push %eax
611: ff 75 08 pushl 0x8(%ebp)
614: e8 31 fe ff ff call 44a <putc>
619: 83 c4 10 add $0x10,%esp
s++;
61c: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
620: 8b 45 f4 mov -0xc(%ebp),%eax
623: 0f b6 00 movzbl (%eax),%eax
626: 84 c0 test %al,%al
628: 75 da jne 604 <printf+0xe3>
62a: eb 65 jmp 691 <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
62c: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
630: 75 1d jne 64f <printf+0x12e>
putc(fd, *ap);
632: 8b 45 e8 mov -0x18(%ebp),%eax
635: 8b 00 mov (%eax),%eax
637: 0f be c0 movsbl %al,%eax
63a: 83 ec 08 sub $0x8,%esp
63d: 50 push %eax
63e: ff 75 08 pushl 0x8(%ebp)
641: e8 04 fe ff ff call 44a <putc>
646: 83 c4 10 add $0x10,%esp
ap++;
649: 83 45 e8 04 addl $0x4,-0x18(%ebp)
64d: eb 42 jmp 691 <printf+0x170>
} else if(c == '%'){
64f: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
653: 75 17 jne 66c <printf+0x14b>
putc(fd, c);
655: 8b 45 e4 mov -0x1c(%ebp),%eax
658: 0f be c0 movsbl %al,%eax
65b: 83 ec 08 sub $0x8,%esp
65e: 50 push %eax
65f: ff 75 08 pushl 0x8(%ebp)
662: e8 e3 fd ff ff call 44a <putc>
667: 83 c4 10 add $0x10,%esp
66a: eb 25 jmp 691 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
66c: 83 ec 08 sub $0x8,%esp
66f: 6a 25 push $0x25
671: ff 75 08 pushl 0x8(%ebp)
674: e8 d1 fd ff ff call 44a <putc>
679: 83 c4 10 add $0x10,%esp
putc(fd, c);
67c: 8b 45 e4 mov -0x1c(%ebp),%eax
67f: 0f be c0 movsbl %al,%eax
682: 83 ec 08 sub $0x8,%esp
685: 50 push %eax
686: ff 75 08 pushl 0x8(%ebp)
689: e8 bc fd ff ff call 44a <putc>
68e: 83 c4 10 add $0x10,%esp
}
state = 0;
691: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
698: 83 45 f0 01 addl $0x1,-0x10(%ebp)
69c: 8b 55 0c mov 0xc(%ebp),%edx
69f: 8b 45 f0 mov -0x10(%ebp),%eax
6a2: 01 d0 add %edx,%eax
6a4: 0f b6 00 movzbl (%eax),%eax
6a7: 84 c0 test %al,%al
6a9: 0f 85 94 fe ff ff jne 543 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
6af: 90 nop
6b0: c9 leave
6b1: c3 ret
000006b2 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6b2: 55 push %ebp
6b3: 89 e5 mov %esp,%ebp
6b5: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
6b8: 8b 45 08 mov 0x8(%ebp),%eax
6bb: 83 e8 08 sub $0x8,%eax
6be: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6c1: a1 70 0b 00 00 mov 0xb70,%eax
6c6: 89 45 fc mov %eax,-0x4(%ebp)
6c9: eb 24 jmp 6ef <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6cb: 8b 45 fc mov -0x4(%ebp),%eax
6ce: 8b 00 mov (%eax),%eax
6d0: 3b 45 fc cmp -0x4(%ebp),%eax
6d3: 77 12 ja 6e7 <free+0x35>
6d5: 8b 45 f8 mov -0x8(%ebp),%eax
6d8: 3b 45 fc cmp -0x4(%ebp),%eax
6db: 77 24 ja 701 <free+0x4f>
6dd: 8b 45 fc mov -0x4(%ebp),%eax
6e0: 8b 00 mov (%eax),%eax
6e2: 3b 45 f8 cmp -0x8(%ebp),%eax
6e5: 77 1a ja 701 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6e7: 8b 45 fc mov -0x4(%ebp),%eax
6ea: 8b 00 mov (%eax),%eax
6ec: 89 45 fc mov %eax,-0x4(%ebp)
6ef: 8b 45 f8 mov -0x8(%ebp),%eax
6f2: 3b 45 fc cmp -0x4(%ebp),%eax
6f5: 76 d4 jbe 6cb <free+0x19>
6f7: 8b 45 fc mov -0x4(%ebp),%eax
6fa: 8b 00 mov (%eax),%eax
6fc: 3b 45 f8 cmp -0x8(%ebp),%eax
6ff: 76 ca jbe 6cb <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
701: 8b 45 f8 mov -0x8(%ebp),%eax
704: 8b 40 04 mov 0x4(%eax),%eax
707: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
70e: 8b 45 f8 mov -0x8(%ebp),%eax
711: 01 c2 add %eax,%edx
713: 8b 45 fc mov -0x4(%ebp),%eax
716: 8b 00 mov (%eax),%eax
718: 39 c2 cmp %eax,%edx
71a: 75 24 jne 740 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
71c: 8b 45 f8 mov -0x8(%ebp),%eax
71f: 8b 50 04 mov 0x4(%eax),%edx
722: 8b 45 fc mov -0x4(%ebp),%eax
725: 8b 00 mov (%eax),%eax
727: 8b 40 04 mov 0x4(%eax),%eax
72a: 01 c2 add %eax,%edx
72c: 8b 45 f8 mov -0x8(%ebp),%eax
72f: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
732: 8b 45 fc mov -0x4(%ebp),%eax
735: 8b 00 mov (%eax),%eax
737: 8b 10 mov (%eax),%edx
739: 8b 45 f8 mov -0x8(%ebp),%eax
73c: 89 10 mov %edx,(%eax)
73e: eb 0a jmp 74a <free+0x98>
} else
bp->s.ptr = p->s.ptr;
740: 8b 45 fc mov -0x4(%ebp),%eax
743: 8b 10 mov (%eax),%edx
745: 8b 45 f8 mov -0x8(%ebp),%eax
748: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
74a: 8b 45 fc mov -0x4(%ebp),%eax
74d: 8b 40 04 mov 0x4(%eax),%eax
750: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
757: 8b 45 fc mov -0x4(%ebp),%eax
75a: 01 d0 add %edx,%eax
75c: 3b 45 f8 cmp -0x8(%ebp),%eax
75f: 75 20 jne 781 <free+0xcf>
p->s.size += bp->s.size;
761: 8b 45 fc mov -0x4(%ebp),%eax
764: 8b 50 04 mov 0x4(%eax),%edx
767: 8b 45 f8 mov -0x8(%ebp),%eax
76a: 8b 40 04 mov 0x4(%eax),%eax
76d: 01 c2 add %eax,%edx
76f: 8b 45 fc mov -0x4(%ebp),%eax
772: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
775: 8b 45 f8 mov -0x8(%ebp),%eax
778: 8b 10 mov (%eax),%edx
77a: 8b 45 fc mov -0x4(%ebp),%eax
77d: 89 10 mov %edx,(%eax)
77f: eb 08 jmp 789 <free+0xd7>
} else
p->s.ptr = bp;
781: 8b 45 fc mov -0x4(%ebp),%eax
784: 8b 55 f8 mov -0x8(%ebp),%edx
787: 89 10 mov %edx,(%eax)
freep = p;
789: 8b 45 fc mov -0x4(%ebp),%eax
78c: a3 70 0b 00 00 mov %eax,0xb70
}
791: 90 nop
792: c9 leave
793: c3 ret
00000794 <morecore>:
static Header*
morecore(uint nu)
{
794: 55 push %ebp
795: 89 e5 mov %esp,%ebp
797: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
79a: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
7a1: 77 07 ja 7aa <morecore+0x16>
nu = 4096;
7a3: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
7aa: 8b 45 08 mov 0x8(%ebp),%eax
7ad: c1 e0 03 shl $0x3,%eax
7b0: 83 ec 0c sub $0xc,%esp
7b3: 50 push %eax
7b4: e8 19 fc ff ff call 3d2 <sbrk>
7b9: 83 c4 10 add $0x10,%esp
7bc: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
7bf: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
7c3: 75 07 jne 7cc <morecore+0x38>
return 0;
7c5: b8 00 00 00 00 mov $0x0,%eax
7ca: eb 26 jmp 7f2 <morecore+0x5e>
hp = (Header*)p;
7cc: 8b 45 f4 mov -0xc(%ebp),%eax
7cf: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
7d2: 8b 45 f0 mov -0x10(%ebp),%eax
7d5: 8b 55 08 mov 0x8(%ebp),%edx
7d8: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
7db: 8b 45 f0 mov -0x10(%ebp),%eax
7de: 83 c0 08 add $0x8,%eax
7e1: 83 ec 0c sub $0xc,%esp
7e4: 50 push %eax
7e5: e8 c8 fe ff ff call 6b2 <free>
7ea: 83 c4 10 add $0x10,%esp
return freep;
7ed: a1 70 0b 00 00 mov 0xb70,%eax
}
7f2: c9 leave
7f3: c3 ret
000007f4 <malloc>:
void*
malloc(uint nbytes)
{
7f4: 55 push %ebp
7f5: 89 e5 mov %esp,%ebp
7f7: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7fa: 8b 45 08 mov 0x8(%ebp),%eax
7fd: 83 c0 07 add $0x7,%eax
800: c1 e8 03 shr $0x3,%eax
803: 83 c0 01 add $0x1,%eax
806: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
809: a1 70 0b 00 00 mov 0xb70,%eax
80e: 89 45 f0 mov %eax,-0x10(%ebp)
811: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
815: 75 23 jne 83a <malloc+0x46>
base.s.ptr = freep = prevp = &base;
817: c7 45 f0 68 0b 00 00 movl $0xb68,-0x10(%ebp)
81e: 8b 45 f0 mov -0x10(%ebp),%eax
821: a3 70 0b 00 00 mov %eax,0xb70
826: a1 70 0b 00 00 mov 0xb70,%eax
82b: a3 68 0b 00 00 mov %eax,0xb68
base.s.size = 0;
830: c7 05 6c 0b 00 00 00 movl $0x0,0xb6c
837: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
83a: 8b 45 f0 mov -0x10(%ebp),%eax
83d: 8b 00 mov (%eax),%eax
83f: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
842: 8b 45 f4 mov -0xc(%ebp),%eax
845: 8b 40 04 mov 0x4(%eax),%eax
848: 3b 45 ec cmp -0x14(%ebp),%eax
84b: 72 4d jb 89a <malloc+0xa6>
if(p->s.size == nunits)
84d: 8b 45 f4 mov -0xc(%ebp),%eax
850: 8b 40 04 mov 0x4(%eax),%eax
853: 3b 45 ec cmp -0x14(%ebp),%eax
856: 75 0c jne 864 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
858: 8b 45 f4 mov -0xc(%ebp),%eax
85b: 8b 10 mov (%eax),%edx
85d: 8b 45 f0 mov -0x10(%ebp),%eax
860: 89 10 mov %edx,(%eax)
862: eb 26 jmp 88a <malloc+0x96>
else {
p->s.size -= nunits;
864: 8b 45 f4 mov -0xc(%ebp),%eax
867: 8b 40 04 mov 0x4(%eax),%eax
86a: 2b 45 ec sub -0x14(%ebp),%eax
86d: 89 c2 mov %eax,%edx
86f: 8b 45 f4 mov -0xc(%ebp),%eax
872: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
875: 8b 45 f4 mov -0xc(%ebp),%eax
878: 8b 40 04 mov 0x4(%eax),%eax
87b: c1 e0 03 shl $0x3,%eax
87e: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
881: 8b 45 f4 mov -0xc(%ebp),%eax
884: 8b 55 ec mov -0x14(%ebp),%edx
887: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
88a: 8b 45 f0 mov -0x10(%ebp),%eax
88d: a3 70 0b 00 00 mov %eax,0xb70
return (void*)(p + 1);
892: 8b 45 f4 mov -0xc(%ebp),%eax
895: 83 c0 08 add $0x8,%eax
898: eb 3b jmp 8d5 <malloc+0xe1>
}
if(p == freep)
89a: a1 70 0b 00 00 mov 0xb70,%eax
89f: 39 45 f4 cmp %eax,-0xc(%ebp)
8a2: 75 1e jne 8c2 <malloc+0xce>
if((p = morecore(nunits)) == 0)
8a4: 83 ec 0c sub $0xc,%esp
8a7: ff 75 ec pushl -0x14(%ebp)
8aa: e8 e5 fe ff ff call 794 <morecore>
8af: 83 c4 10 add $0x10,%esp
8b2: 89 45 f4 mov %eax,-0xc(%ebp)
8b5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8b9: 75 07 jne 8c2 <malloc+0xce>
return 0;
8bb: b8 00 00 00 00 mov $0x0,%eax
8c0: eb 13 jmp 8d5 <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
8c2: 8b 45 f4 mov -0xc(%ebp),%eax
8c5: 89 45 f0 mov %eax,-0x10(%ebp)
8c8: 8b 45 f4 mov -0xc(%ebp),%eax
8cb: 8b 00 mov (%eax),%eax
8cd: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
8d0: e9 6d ff ff ff jmp 842 <malloc+0x4e>
}
8d5: c9 leave
8d6: c3 ret
| 33.96288 | 60 | 0.419188 |
7aeaaeb303ae6d7d2fc249098cd637d7280ee20b | 1,568 | asm | Assembly | programs/oeis/056/A056107.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/056/A056107.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/056/A056107.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A056107: Third spoke of a hexagonal spiral.
; 1,4,13,28,49,76,109,148,193,244,301,364,433,508,589,676,769,868,973,1084,1201,1324,1453,1588,1729,1876,2029,2188,2353,2524,2701,2884,3073,3268,3469,3676,3889,4108,4333,4564,4801,5044,5293,5548,5809,6076,6349,6628,6913,7204,7501,7804,8113,8428,8749,9076,9409,9748,10093,10444,10801,11164,11533,11908,12289,12676,13069,13468,13873,14284,14701,15124,15553,15988,16429,16876,17329,17788,18253,18724,19201,19684,20173,20668,21169,21676,22189,22708,23233,23764,24301,24844,25393,25948,26509,27076,27649,28228,28813,29404,30001,30604,31213,31828,32449,33076,33709,34348,34993,35644,36301,36964,37633,38308,38989,39676,40369,41068,41773,42484,43201,43924,44653,45388,46129,46876,47629,48388,49153,49924,50701,51484,52273,53068,53869,54676,55489,56308,57133,57964,58801,59644,60493,61348,62209,63076,63949,64828,65713,66604,67501,68404,69313,70228,71149,72076,73009,73948,74893,75844,76801,77764,78733,79708,80689,81676,82669,83668,84673,85684,86701,87724,88753,89788,90829,91876,92929,93988,95053,96124,97201,98284,99373,100468,101569,102676,103789,104908,106033,107164,108301,109444,110593,111748,112909,114076,115249,116428,117613,118804,120001,121204,122413,123628,124849,126076,127309,128548,129793,131044,132301,133564,134833,136108,137389,138676,139969,141268,142573,143884,145201,146524,147853,149188,150529,151876,153229,154588,155953,157324,158701,160084,161473,162868,164269,165676,167089,168508,169933,171364,172801,174244,175693,177148,178609,180076,181549,183028,184513,186004
mov $1,$0
pow $1,2
mul $1,3
add $1,1
| 196 | 1,483 | 0.820791 |
0ae174a88a87f6ce6c8a2aef3a259c56716ecfd9 | 498 | asm | Assembly | oeis/315/A315470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/315/A315470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/315/A315470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A315470: Coordination sequence Gal.6.253.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Jamie Morken(s1)
; 1,6,11,16,21,26,32,37,42,47,52,58,64,69,74,79,84,90,95,100,105,110,116,122,127,132,137,142,148,153,158,163,168,174,180,185,190,195,200,206,211,216,221,226,232,238,243,248,253,258
mul $0,4
mov $3,$0
mul $0,3
sub $0,1
div $0,11
add $0,1
mov $2,$3
mul $2,23
div $2,22
add $2,$0
mov $0,$2
| 31.125 | 180 | 0.704819 |
77873dc220aba1d4c16348ec4ec78ae55d658edd | 3,452 | asm | Assembly | dino/lcs/enemy/7B.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/7B.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/enemy/7B.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
010A7A move.b D0, ($7b,A3)
010A7E move.b D0, ($6,A3) [enemy+7B]
0110FA move.b D0, ($7b,A3)
0110FE move.b D0, ($6,A3) [enemy+7B]
0111E8 move.b D0, ($7b,A3)
0111EC move.b D0, ($6,A3) [enemy+7B]
011448 move.b D0, ($7b,A3)
01144C lea ($876,PC) ; ($11cc4), A6 [enemy+7B]
011520 move.b D0, ($7b,A3)
011524 lea ($79e,PC) ; ($11cc4), A6 [enemy+7B]
011BE8 move.b D0, ($7b,A3)
011BEC lea ($d6,PC) ; ($11cc4), A6 [enemy+7B]
011F4A move.b D0, ($7b,A3)
011F4E move.b D0, ($6,A3) [enemy+7B]
012296 move.b D0, ($7b,A3)
01229A move.b D0, ($6,A3) [enemy+7B]
012402 move.b D0, ($7b,A3)
012406 lea (-$744,PC) ; ($11cc4), A6 [enemy+7B]
012596 move.b D0, ($7b,A3)
01259A move.b D0, ($6,A3) [enemy+7B]
02A772 move.b #$4, ($7b,A6) [enemy+83]
02A778 move.b #$a, ($78,A6) [enemy+7B]
02A8FC move.b #$4, ($7b,A6) [enemy+83]
02A902 move.b #$a, ($78,A6) [enemy+7B]
02A9E6 move.b #$4, ($7b,A6)
02A9EC move.b #$a, ($78,A6) [enemy+7B]
02AC38 cmpi.b #$c, ($7b,A6)
02AC3E bne $2ac6e [enemy+7B]
02AD0A move.b #$4, ($7b,A6) [enemy+83]
02AD10 move.b #$a, ($78,A6) [enemy+7B]
02B204 move.b #$30, ($7b,A6)
02B20A cmpi.w #$48, ($20,A6) [enemy+7B]
02B46E move.b #$20, ($7b,A6)
02B474 bra $2b54e [enemy+7B]
033936 move.b D0, ($7b,A6)
03393A move.b D0, ($7d,A6)
033D38 move.b #$4, ($7b,A6) [enemy+51]
033D3E move.b #$a, ($78,A6) [enemy+7B]
033F5C cmpi.b #$4, ($7b,A6)
033F62 move.b #$0, ($7d,A6) [enemy+7B]
035A04 move.b D0, ($7b,A6)
035A08 move.b D0, ($7d,A6)
035D72 cmpi.b #$4, ($7b,A6)
035D78 bne $360c6 [enemy+7B]
03B886 move.b D0, ($7b,A6)
03B88A move.b D0, ($7d,A6)
03BC78 cmpi.b #$20, ($7b,A6)
03BC7E beq $3bff2 [enemy+7B]
03BFF2 clr.b ($7b,A6)
03BFF6 move.l #$2000800, ($4,A6) [enemy+7B]
03DEA8 move.b D0, ($7b,A6)
03DEAC move.b D0, ($7d,A6)
04036E move.b D0, ($7b,A6)
040372 move.b D0, ($7d,A6)
040908 cmpi.b #$4, ($7b,A6) [enemy+B8]
04090E bne $40938 [enemy+7B]
042642 move.b D0, ($7b,A6)
042646 move.b D0, ($7d,A6)
04295A cmpi.b #$4, ($7b,A6)
042960 bne $429aa [enemy+7B]
044EBA cmpi.b #$4, ($7b,A6)
044EC0 bne $44ee8 [enemy+7B]
045840 move.b D0, ($7b,A6)
045844 move.b D0, ($7d,A6)
0483DE move.b D0, ($7b,A6)
0483E2 move.b D0, ($a4,A6)
04D94E move.b D0, ($7b,A6)
04D952 move.b D0, ($7d,A6)
04DD58 move.b D0, ($7b,A6)
04DD5C move.b D0, ($7d,A6)
04FDB4 move.b D0, ($7b,A6)
04FDB8 move.b D0, ($7d,A6)
050450 move.b #$4, ($7b,A6) [enemy+51]
050456 move.b #$a, ($78,A6) [enemy+7B]
050FF8 move.b D0, ($7b,A6)
050FFC move.b D0, ($7d,A6)
05346C move.b D0, ($7b,A6)
053470 move.b #$c8, ($72,A6)
0578E6 move.b D0, ($7b,A6)
0578EA move.b D0, ($7d,A6)
058518 move.b D0, ($7b,A6)
05851C move.b #$ff, ($7d,A6)
058D68 cmpi.b #$4, ($7b,A6)
058D6E bne $5a186 [enemy+7B]
05AB0E move.b D0, ($7b,A6)
05AB12 move.b D0, ($7d,A6)
05B0D0 move.b D0, ($7b,A6)
05B0D4 move.b D0, ($7d,A6)
05B2CC cmpi.b #$4, ($7b,A6) [enemy+ 4, enemy+ 6]
05B2D2 beq $5b54a [enemy+7B]
05B2D6 cmpi.b #$30, ($7b,A6)
05B2DC beq $5b54a [enemy+7B]
05EFB2 cmpi.b #$4, ($7b,A0)
05EFB8 bne $5efe4 [enemy+7B]
05F3FC cmpi.b #$30, ($7b,A1)
05F402 beq $5f436 [enemy+7B]
05F636 move.b D0, ($7b,A6)
05F63A move.b D0, ($7d,A6)
copyright zengfr site:http://github.com/zengfr/romhack
| 33.514563 | 54 | 0.573291 |
ac20555c89f8fdbcb599f327c4090ee6e20b8039 | 262 | asm | Assembly | src/ch5/eatsyscall.asm | Moguf/AsmApp | f2de7adcd9872e2588974767f59738f5f4513413 | [
"MIT"
] | null | null | null | src/ch5/eatsyscall.asm | Moguf/AsmApp | f2de7adcd9872e2588974767f59738f5f4513413 | [
"MIT"
] | null | null | null | src/ch5/eatsyscall.asm | Moguf/AsmApp | f2de7adcd9872e2588974767f59738f5f4513413 | [
"MIT"
] | null | null | null | SECTION .data
EatMsg: db "Eat at Joe's",10
EatLen: equ $-EatMsg
SECTION .bss
SECTION .text
global _start
_start:
nop
mov eax,4
mov ebx,1
mov ecx,EatMsg
mov edx,EatLen
int 80H
mov eax,1
mov ebx,0
int 80H
| 14.555556 | 29 | 0.576336 |
1552a5c1b676fbd7aa298c9f64e65c5bb1b2f284 | 700 | asm | Assembly | oeis/027/A027861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/027/A027861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/027/A027861.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A027861: Numbers k such that k^2 + (k+1)^2 is prime.
; Submitted by Jon Maiga
; 1,2,4,5,7,9,12,14,17,19,22,24,25,29,30,32,34,35,39,42,47,50,60,65,69,70,72,79,82,84,85,87,90,97,99,100,102,104,109,110,115,122,130,135,137,139,144,149,154,157,160,162,164,167,172,174,185,187,189,195,199,202,204,207,212,217,220,222,224,225,229,230,235,259,260,264,267,272,279,284,285,287,289,290,297,304,315,319,320,324,330,334,342,344,347,349,355,357,369,372
mov $2,$0
add $2,2
pow $2,2
lpb $2
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $5,4
add $1,$5
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$5
sub $0,4
div $0,4
add $0,1
| 29.166667 | 360 | 0.65 |
b3747cfb7ea85ae4107af3b85a55122e6121b641 | 3,660 | asm | Assembly | main.asm | TobiasKaiser/ahci_sbe | 1d3ed6080077ac4cb85b1eba747f3ffac83e44f3 | [
"BSD-2-Clause"
] | 2 | 2022-01-05T01:59:24.000Z | 2022-01-05T02:10:46.000Z | main.asm | TobiasKaiser/ahci_sbe | 1d3ed6080077ac4cb85b1eba747f3ffac83e44f3 | [
"BSD-2-Clause"
] | null | null | null | main.asm | TobiasKaiser/ahci_sbe | 1d3ed6080077ac4cb85b1eba747f3ffac83e44f3 | [
"BSD-2-Clause"
] | 1 | 2022-01-05T01:59:26.000Z | 2022-01-05T01:59:26.000Z | ; main.asm -- ahci_sbe main file generating PCI option ROM header structures,
; performing basic initialization, %includes all other asm source files
; Copyright (C) 2014, 2016 Tobias Kaiser <mail@tb-kaiser.de>
org 0
rom_size_multiple_of equ 512
bits 16
; PCI Expansion Rom Header
; ------------------------
db 0x55, 0xAA ; signature
db rom_size/512; initialization size in 512 byte blocks
entry_point: jmp start
times 21 - ($ - entry_point) db 0
dw pci_data_structure
; PCI Data Structure
; ------------------
pci_data_structure:
db 'P', 'C', 'I', 'R'
dw PCI_VENDOR_ID
dw PCI_DEVICE_ID
dw 0 ; reserved
dw pci_data_structure_end - pci_data_structure
db 0 ; revision
db 0x02, 0x00, 0x00 ; class code: ethernet
dw rom_size/512
dw 0 ; revision level of code / data
db 0 ; code type => Intel x86 PC-AT compatible
db (1<<7) ; this is the last image
dw 0 ; reserved
pci_data_structure_end:
start:
push CS
pop DS
mov [sp_orig], SP
call cls
call pmm_detect_and_alloc
loop_over_multiple_ahci_controllers:
mov AX, [cur_ahci_index]
call find_ahci
cmp AX, 0
jnz loop_over_multiple_ahci_controllers_end
call ahci_main
mov AX, [cur_ahci_index]
inc AX
mov [cur_ahci_index], AX
jmp loop_over_multiple_ahci_controllers
loop_over_multiple_ahci_controllers_end:
mov AL, [needs_reboot]
cmp AL, 0
jz no_reboot
call clear_last_password
call cls_blank
jmp 0xFFFF:0x0000 ; <-- reboot (so many possibilities)
fatal_error:
push AX
mov AX, fatal_error_msg
call puts
pop AX
call puts
call pause
mov SP, [sp_orig]
no_reboot:
call clear_last_password
call cls_blank
retf ; <-- continue boot
; ----
%include "pmm.asm"
%include "ahci.asm"
%include "io.asm"
; memclear function
; -----------------
memclear: ; set AX bytes starting at ES:ECX to 0x00
push AX
push ECX
memclear_loop:
mov [ES:ECX], byte 0
inc ECX
dec AX
jnz memclear_loop
pop ECX
pop AX
ret
; Strings
; -------
version_str db `ahci_sbe v. 0.9\0`
fatal_error_msg db `Fatal error: \0`
pause_msg db `Press any key to continue...\n\0`
pw_dialog_msg db `Enter password to unlock device:\0`
pw_dialog_prompt db `Password: \0`
pw_dialog_usage_msg db `ENTER=Unlock Shift+ENTER=Unlock multiple ESC=Skip\0`
wrong_password_msg db `Wrong password. Press return to try again.\0`
; Error messages
; --------------
err_no_pci db `PCI not present\n\0`
err_no_ahci db `AHCI not present\n\0`
err_abar db `Failed to read ABAR\n\0`
err_no_pmm db `PMM not present\n\0`
err_pmm_alloc db `PMM alloc failed\n\0`
err_pmm_chksum db `PMM checksum mismatch\n\0`
; Global Variables
; ----------------
abar dd 0x00000000 ; save ABAR here
sp_orig dw 0x0000 ; original stack pointer for returning in case of an error
pmm_entry_point dw 0x0000, 0x0000 ; save PMM entry point here
needs_reboot db 0 ; set to 1 if we need reboot
cur_style db 0x07 ; grey on black = default
cur_ahci_index dw 0x0000 ; start with achi controll #0, then try #1, ...
unlock_multiple db 0x00 ; 0=unlock single, else=unlock multiple
last_password_length dd 0x00000000
last_password dd 0, 0, 0, 0, 0, 0, 0, 0
horiz_line_left db 0
horiz_line_middle db 0
horiz_line_right db 0
; ROM padding, checksum needs to be added separately
; --------------------------------------------------
db 0 ; reserve at least one byte for checksum
rom_end equ $-$$
rom_size equ (((rom_end-1)/rom_size_multiple_of)+1)*rom_size_multiple_of
times rom_size - rom_end db 0 ; padding
| 24.563758 | 78 | 0.672131 |
9742f5f96f84228552b14c5e09bbb1ce03ef8233 | 5,341 | asm | Assembly | source/inventory.asm | evanbowman/Red | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | 5 | 2021-08-30T16:18:55.000Z | 2021-10-30T20:23:32.000Z | source/inventory.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | source/inventory.asm | evanbowman/gbc-project | 85735269a46757305a81ad39f47034bc6cd97846 | [
"BSD-2-Clause"
] | null | null | null | ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;;
;;; ASM Source code for Red GBC, by Evan Bowman, 2021
;;;
;;;
;;; The following licence covers the source code included in this file. The
;;; game's characters and artwork belong to Evan Bowman, and should not be used
;;; without permission.
;;;
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; 1. Redistributions of source code must retain the above copyright notice,
;;; this list of conditions and the following disclaimer.
;;;
;;; 2. Redistributions in binary form must reproduce the above copyright notice,
;;; this list of conditions and the following disclaimer in the documentation
;;; and/or other materials provided with the distribution.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;;; SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;;; POSSIBILITY OF SUCH DAMAGE.
;;;
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
InventoryGetItem:
;;; b - slot
;;; trashes hl
;;; return b - item type
;;; return c - count
ld hl, var_inventory
ld c, b
sla c
ld b, 0
add hl, bc
ld b, [hl]
inc hl
ld c, [hl]
ret
;;; ----------------------------------------------------------------------------
InventoryRemoveItem:
;;; c - slot
;;; trashes hl
ld hl, var_inventory
ld b, 0
sla c ; two bytes per item
add hl, bc
ld a, (INVENTORY_COUNT - 1) * ITEM_SIZE
sub c
ld c, a
or a
jr Z, .removeLastEntry
ld d, h
ld e, l
inc hl ; memmove source at next item index
inc hl
fcall MemmoveLeft
.removeLastEntry:
ld hl, var_inventory_last_item
ld a, 0
ld [hl], a
ret
;;; ----------------------------------------------------------------------------
InventoryAddItem:
;;; b - item
;;; trashes hl, c
;;; TODO: coallesce identical items, using second "count" byte?
ld hl, var_inventory
ld c, 0
.loop:
ld a, INVENTORY_COUNT
cp c
jr Z, .done
ld a, [hl]
or a
jr NZ, .next
ld [hl], b
jr .done
.next:
inc hl
inc hl
inc c
jr .loop
.done:
ret
;;; ----------------------------------------------------------------------------
InventoryCountOccurrences:
;;; b - item
;;; trashes hl, c
;;; d - result
ld hl, var_inventory
ld c, 0
ld d, 0
.loop:
ld a, INVENTORY_COUNT
cp c
jr Z, .done
ld a, [hl]
cp b
jr Z, .inc
jr .next
.inc:
inc d
.next:
inc hl
inc hl
inc c
jr .loop
.done:
ret
;;; ----------------------------------------------------------------------------
InventoryConsumeItem:
;;; b - item
;;; trashes hl, c
ld hl, var_inventory
ld c, 0
.loop:
ld a, INVENTORY_COUNT
cp c
ret Z
ld a, [hl]
cp b
jr NZ, .next
fcall InventoryRemoveItem
ret
.next:
inc hl
inc hl
inc c
jr .loop
;;; ----------------------------------------------------------------------------
InventoryIsFull:
;;; trashes hl, c
;;; return a - true / false
ld hl, var_inventory
ld c, 0
.loop:
ld a, INVENTORY_COUNT
cp c
jr Z, .full
ld a, [hl]
or a
jr NZ, .next
jr .hasSlots
.next:
inc hl
inc hl
inc c
jr .loop
.hasSlots:
ld a, 0
ret
.full:
ld a, 1
ret
;;; ----------------------------------------------------------------------------
InventorySize:
;;; trashes hl
;;; return c - inventory slots used
ld hl, var_inventory
ld c, 0
.loop:
ld a, INVENTORY_COUNT
cp c
ret Z
ld a, [hl]
or a
ret Z
.next:
inc hl
inc hl
inc c
jr .loop
;;; ----------------------------------------------------------------------------
| 23.528634 | 80 | 0.441303 |
d04e0cfd0c61d1f3725b461a7dfe09dde4c9af3c | 68 | asm | Assembly | data/maps/headers/AgathasRoom.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/maps/headers/AgathasRoom.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/maps/headers/AgathasRoom.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null |
map_header AgathasRoom, AGATHAS_ROOM, CEMETERY, 0
end_map_header
| 17 | 50 | 0.823529 |
19c5a12e67dbf5848ec6b25177c890ae5a334456 | 662 | asm | Assembly | oeis/020/A020717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/020/A020717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/020/A020717.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A020717: Pisot sequences L(6,9), E(6,9).
; Submitted by Jon Maiga
; 6,9,14,22,35,56,90,145,234,378,611,988,1598,2585,4182,6766,10947,17712,28658,46369,75026,121394,196419,317812,514230,832041,1346270,2178310,3524579,5702888,9227466,14930353,24157818,39088170,63245987,102334156,165580142,267914297,433494438,701408734,1134903171,1836311904,2971215074,4807526977,7778742050,12586269026,20365011075,32951280100,53316291174,86267571273,139583862446,225851433718,365435296163,591286729880,956722026042,1548008755921,2504730781962,4052739537882,6557470319843
mov $1,2
mov $3,3
lpb $0
sub $0,1
mov $2,$3
add $3,$1
mov $1,$2
lpe
add $3,$1
mov $0,$3
add $0,1
| 41.375 | 487 | 0.793051 |
390ea3f528c263fecd858fe4c56ec3b5f84c2bb5 | 754 | asm | Assembly | oeis/275/A275505.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/275/A275505.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/275/A275505.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A275505: Number of 5 X n 0..2 arrays with no element equal to any value at offset (-2,-1) (-2,0) or (-1,-1) and new values introduced in order 0..2.
; Submitted by Jamie Morken
; 12,56,232,988,4180,17712,75024,317812,1346268,5702888,24157816,102334156,433494436,1836311904,7778742048,32951280100,139583862444,591286729880,2504730781960,10610209857724,44945570212852,190392490709136,806515533049392,3416454622906708,14472334024676220,61305790721611592,259695496911122584,1100087778366101932,4660046610375530308,19740274219868223168,83621143489848422976,354224848179261915076,1500520536206896083276,6356306993006846248184,26925748508234281076008,114059301025943970552220
mul $0,3
add $0,6
seq $0,71 ; a(n) = Fibonacci(n) - 1.
add $0,2
div $0,4
mul $0,4
| 68.545455 | 491 | 0.823607 |
1c2185964848ab76cba23494bffe28ddc02e8559 | 450 | asm | Assembly | oeis/015/A015515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/015/A015515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/015/A015515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A015515: a(1)=1, a(n) = sum_{k=1}^{k=n-1} (12^k-1)/11 a(k).
; Submitted by Christian Krause
; 1,1,14,2212,4171832,94375183504,25618521062894816,83450744014073963641408,3262026661649164626974053098368,1530121919008888925087797696409496422656,8612828743790947623482719127044813092555596516864
lpb $0
lpb $0
mov $0,10
lpe
add $0,3
lpe
sub $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
mul $2,12
add $2,2
mul $1,$2
sub $2,1
lpe
mov $0,$1
| 20.454545 | 198 | 0.708889 |
6c1bcbbb4c874b53ff971ddda3c62fac036f98ad | 148 | asm | Assembly | libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_getc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_getc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_getc.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | SECTION code_driver
PUBLIC _asci0_getc
EXTERN asm_asci0_getc
defc _asci0_getc = asm_asci0_getc
EXTERN asm_asci0_need
defc NEED = asm_asci0_need
| 13.454545 | 33 | 0.851351 |
cd7b8a12ef4ed649384f87edf328ff0017e1f559 | 1,060 | asm | Assembly | programs/oeis/157/A157786.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/157/A157786.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/157/A157786.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A157786: a(n) = 27225*n^2 - 15248*n + 2135.
; 14112,80539,201416,376743,606520,890747,1229424,1622551,2070128,2572155,3128632,3739559,4404936,5124763,5899040,6727767,7610944,8548571,9540648,10587175,11688152,12843579,14053456,15317783,16636560,18009787,19437464,20919591,22456168,24047195,25692672,27392599,29146976,30955803,32819080,34736807,36708984,38735611,40816688,42952215,45142192,47386619,49685496,52038823,54446600,56908827,59425504,61996631,64622208,67302235,70036712,72825639,75669016,78566843,81519120,84525847,87587024,90702651,93872728,97097255,100376232,103709659,107097536,110539863,114036640,117587867,121193544,124853671,128568248,132337275,136160752,140038679,143971056,147957883,151999160,156094887,160245064,164449691,168708768,173022295,177390272,181812699,186289576,190820903,195406680,200046907,204741584,209490711,214294288,219152315,224064792,229031719,234053096,239128923,244259200,249443927,254683104,259976731,265324808,270727335
seq $0,157787 ; 8984250n - 2515920.
pow $0,2
sub $0,41839292988900
div $0,2964802500
add $0,14112
| 117.777778 | 914 | 0.858491 |
df9b164fb49beed86380eebf16b0214e84f175ae | 786 | asm | Assembly | programs/oeis/024/A024118.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/024/A024118.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/024/A024118.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A024118: a(n) = 10^n - n^4.
; 1,9,84,919,9744,99375,998704,9997599,99995904,999993439,9999990000,99999985359,999999979264,9999999971439,99999999961584,999999999949375,9999999999934464,99999999999916479,999999999999895024,9999999999999869679,99999999999999840000,999999999999999805519,9999999999999999765744,99999999999999999720159,999999999999999999668224,9999999999999999999609375,99999999999999999999543024,999999999999999999999468559,9999999999999999999999385344,99999999999999999999999292719,999999999999999999999999190000,9999999999999999999999999076479,99999999999999999999999998951424,999999999999999999999999998814079,9999999999999999999999999998663664,99999999999999999999999999998499375,999999999999999999999999999998320384
mov $1,10
pow $1,$0
pow $0,4
sub $1,$0
mov $0,$1
| 87.333333 | 705 | 0.899491 |
8b53338e592d441e62f8841af0c10b57b0bd39ef | 643 | asm | Assembly | oeis/096/A096000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/096/A096000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/096/A096000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A096000: Cupolar numbers: a(n) = (n+1)*(5*n^2+7*n+3)/3.
; 1,10,37,92,185,326,525,792,1137,1570,2101,2740,3497,4382,5405,6576,7905,9402,11077,12940,15001,17270,19757,22472,25425,28626,32085,35812,39817,44110,48701,53600,58817,64362,70245,76476,83065,90022,97357,105080,113201,121730,130677,140052,149865,160126,170845,182032,193697,205850,218501,231660,245337,259542,274285,289576,305425,321842,338837,356420,374601,393390,412797,432832,453505,474826,496805,519452,542777,566790,591501,616920,643057,669922,697525,725876,754985,784862,815517,846960,879201
mul $0,5
mov $1,$0
add $0,4
pow $0,3
mul $1,2
add $1,$0
mov $0,$1
div $0,75
add $0,1
| 49.461538 | 498 | 0.768274 |
4138fa61727c11d7d17acddc53fa70d6ea75a8c0 | 920 | asm | Assembly | text2_request.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | 10 | 2017-12-05T14:25:38.000Z | 2022-02-21T04:28:00.000Z | text2_request.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | text2_request.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | .db 0xE8,0x0A
.db 0xF1,0x00,0x00
.db 0xF7,0x02,0x33,0x6C,0x03
.db 0xF1,0x00,0x00
// Script handler exploit
.db 0xF9,0x01,0x00,0x05 + (@@asm & 1b)
.db 0xF9,0x01,0x01,0x34
.db 0xF9,0x01,0x02,0x20
.db 0xF9,0x01,0x03,0x47
.db 0xFC,0x03,0x5A,0x00 // BN6
@@asm:
.align 2
add r4,@@japanese-.-5
// Check region
ldr r1,=80000A0h
ldrb r0,[r1,0Fh]
cmp r0,4Ah
bne @@setEnglish
// Detect EXE6 fan translation
ldr r1,=87FF4FCh
ldr r0,[r1]
ldr r2,=52414345h // ECAR
cmp r0,r2
bne @@end
ldr r0,[r1,4h]
ldr r2,=4E455F44h // D_EN
cmp r0,r2
bne @@end
@@setEnglish:
add r4,@@english-@@japanese
@@end:
mov r15,r14
.pool
@@japanese:
.table table_file_jp
.strn "いらいイベント"
.db 0xE9
.strn card_name_jp_game
.db 0xE9
.strn "が ついかされた!"
.db 0xE7,0x00
.db 0xEE,0xFF,0x00,0x00
@@english:
.table table_file_en
.strn "Request event"
.db 0xE9
.strn card_name_en_game
.db 0xE9
.strn "has been added!"
.db 0xE7,0x00
.db 0xEE,0xFF,0x00,0x00
| 13.939394 | 38 | 0.701087 |
41f70ea0dfb7db0c293bfea5b92883825753a9af | 204 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_31.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_31.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_31.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; BeepFX sound effect by shiru
; http://shiru.untergrund.net
SECTION rodata_clib
SECTION rodata_sound_bit
PUBLIC _bfx_31
_bfx_31:
; Item_4
defb 1 ;tone
defw 4,1000,1000,65136,128
defb 0
| 12 | 30 | 0.72549 |
0d182e423f893329b7e755522223938ba1531b9e | 2,042 | asm | Assembly | Borland/CBuilder5/Source/RTL/source/math/sqrtl.asm | TrevorDArcyEvans/DivingMagpieSoftware | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | 1 | 2021-05-27T10:27:25.000Z | 2021-05-27T10:27:25.000Z | Borland/CBuilder5/Source/RTL/source/math/sqrtl.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | Borland/CBuilder5/Source/RTL/source/math/sqrtl.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | ;[]-----------------------------------------------------------------[]
;| SQRTL.ASM -- long double square root function |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
;----------------------------------------------------------------------
; function(s)
; sqrtl - calculates square root (long double)
;----------------------------------------------------------------------
include RULES.ASI
include _MATH.INC
; Segments Definitions
Header@
;----------------------------------------------------------------------
; External and local variables
Data_Seg@
NANSQRTL dw 0,0,0,0C001H,07FFFH
Data_EndS@
;--------------------------------------------------------------------------
;
;Name sqrtl - calculates square root of long double
;
;Usage long double sqrtl (long double x);
;
;Prototype in math.h
;
;Description sqrtl calculates the square root of input value.
;
;Return value sqrtl returns the square root of input value.
; If the input value is less than 0, sqrtl returns 0 and sets
; errno to
; EDOM Domain error
;--------------------------------------------------------------------------
Code_Seg@
Func@ sqrtl, _EXPFUNC, _RTLENTRY, <longdouble x>
Link@
FLD x.longdouble
mov ax, x [8]
shl ax, 1
jz sqrt_zero
jc sqrt_imaginary
FSQRT
sqrt_zero: ; zero = sqrtl (zero)
sqrt_end:
Unlink@
Return@
sqrt_imaginary:
FSTP st (0) ; pop x from stack
; return __matherrl (DOMAIN, "sqrtl", &x, NULL, *((long double *) NANSQRTL));
matherrl DOMAIN, sqrtl, x, NULL, NANSQRTL
jmp sqrt_end
EndFunc@ sqrtl
Code_Ends@
end
| 24.60241 | 84 | 0.415769 |
6019e6952b94e98aa08ae1438c636dc30c7a9e9a | 4,641 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_86_52.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_86_52.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_86_52.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 %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xcb6c, %rax
nop
nop
nop
nop
nop
and %r10, %r10
mov $0x6162636465666768, %r11
movq %r11, %xmm4
movups %xmm4, (%rax)
nop
add $30438, %rax
lea addresses_A_ht+0x1cd6c, %rsi
nop
nop
nop
cmp $52324, %rdx
vmovups (%rsi), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %rbx
nop
nop
nop
nop
inc %r11
lea addresses_normal_ht+0x1296c, %rdx
add $54078, %r11
movb $0x61, (%rdx)
nop
nop
dec %rdx
lea addresses_A_ht+0xad6c, %r10
nop
nop
xor %rdx, %rdx
mov (%r10), %si
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_A_ht+0x1e32c, %r10
nop
and $28168, %rdx
movl $0x61626364, (%r10)
nop
nop
nop
nop
nop
sub $37180, %rax
lea addresses_A_ht+0x16b6c, %r11
nop
nop
nop
dec %r8
movups (%r11), %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WT_ht+0x1705c, %rsi
lea addresses_UC_ht+0xe56c, %rdi
nop
nop
nop
xor $48420, %rax
mov $29, %rcx
rep movsq
nop
nop
nop
nop
xor $34485, %rax
lea addresses_WC_ht+0x43ec, %rdx
clflush (%rdx)
nop
xor $22304, %rdi
movb $0x61, (%rdx)
xor $31860, %r10
lea addresses_WC_ht+0xbd6c, %r10
nop
nop
xor %r8, %r8
movb (%r10), %r11b
nop
dec %rsi
lea addresses_WT_ht+0xed6c, %rax
nop
nop
dec %rsi
mov $0x6162636465666768, %r11
movq %r11, (%rax)
nop
nop
nop
add $53272, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %rax
push %rcx
push %rdi
// Load
mov $0x7c04b2000000036c, %rcx
nop
add $63471, %rax
mov (%rcx), %r15
nop
nop
add %r12, %r12
// Store
mov $0x41dedf0000000cec, %r13
nop
nop
nop
nop
nop
xor %r11, %r11
movw $0x5152, (%r13)
nop
nop
nop
xor $54803, %r12
// Store
lea addresses_PSE+0xfcec, %rdi
nop
nop
cmp $42409, %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm4
movups %xmm4, (%rdi)
nop
nop
nop
cmp $39461, %r11
// Store
lea addresses_A+0xab0c, %r11
nop
nop
nop
sub %rax, %rax
movl $0x51525354, (%r11)
nop
nop
nop
and %r12, %r12
// Faulty Load
lea addresses_normal+0x1dd6c, %r15
sub %r11, %r11
mov (%r15), %di
lea oracles, %r11
and $0xff, %rdi
shlq $12, %rdi
mov (%r11,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_NC', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_NC', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'34': 86}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 21.095455 | 257 | 0.645766 |
883202e8fb54bbf43bf6b0b28b8aac613eff3b60 | 387 | asm | Assembly | programs/oeis/140/A140716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/140/A140716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/140/A140716.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A140716: Blocky integers, i.e., integers n > 1 such that there is a run of n consecutive integer squares the average of which is a square.
; 7,25,31,49,55,73,79,97,103,121,127,145,151,169,175,193,199,217,223,241,247,265,271,289,295,313,319,337,343,361,367,385,391,409,415,433,439,457,463,481,487,505,511,529,535,553,559,577,583
mov $1,$0
mod $0,2
mul $1,2
add $0,$1
mul $0,6
add $0,7
| 38.7 | 188 | 0.70801 |
d57e808ee2dc19610ee90d6106d3379f449f43e4 | 4,413 | asm | Assembly | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0.log_9_1386.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0.log_9_1386.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0.log_9_1386.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x17d6f, %rcx
nop
inc %r10
movb $0x61, (%rcx)
and %rbp, %rbp
lea addresses_normal_ht+0x19299, %r13
nop
nop
nop
nop
nop
add $57877, %r8
mov $0x6162636465666768, %r14
movq %r14, %xmm3
vmovups %ymm3, (%r13)
nop
nop
nop
nop
sub %r12, %r12
lea addresses_WC_ht+0x35c1, %rsi
lea addresses_WC_ht+0x1bf99, %rdi
nop
nop
nop
nop
sub $19537, %r10
mov $39, %rcx
rep movsq
nop
nop
nop
cmp $58953, %rdi
lea addresses_WC_ht+0x1ddb1, %rbp
nop
nop
nop
nop
nop
inc %r14
mov $0x6162636465666768, %rdi
movq %rdi, (%rbp)
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x16819, %r14
nop
nop
nop
sub %r8, %r8
movb $0x61, (%r14)
nop
nop
mfence
lea addresses_UC_ht+0x1ad61, %rcx
dec %r10
movups (%rcx), %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
and $63277, %rbp
lea addresses_WT_ht+0x3354, %rdi
nop
nop
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %r10
movq %r10, (%rdi)
nop
nop
sub $33094, %rcx
lea addresses_D_ht+0x19d99, %rcx
nop
nop
add %rdi, %rdi
mov (%rcx), %r8d
inc %r8
lea addresses_UC_ht+0xb017, %rdi
nop
nop
nop
nop
nop
and %r13, %r13
mov $0x6162636465666768, %r14
movq %r14, %xmm6
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm6, (%rdi)
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_WT_ht+0x37d9, %r14
nop
sub $36602, %rdi
mov (%r14), %r12d
nop
nop
nop
nop
cmp %r13, %r13
lea addresses_WC_ht+0x199, %r8
nop
nop
nop
nop
nop
sub %rbp, %rbp
mov (%r8), %r13
nop
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_A_ht+0x7799, %r8
nop
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %r13
movq %r13, %xmm5
movups %xmm5, (%r8)
nop
nop
nop
nop
nop
inc %r13
lea addresses_WT_ht+0xc339, %r10
nop
nop
nop
nop
sub $19776, %rcx
movups (%r10), %xmm3
vpextrq $1, %xmm3, %r13
nop
nop
nop
nop
cmp $21276, %rbp
lea addresses_WT_ht+0x9399, %r14
lfence
mov (%r14), %rbp
nop
nop
nop
nop
nop
sub %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rax
push %rbx
push %rsi
// Faulty Load
mov $0xd99, %rsi
nop
xor $42636, %rax
mov (%rsi), %ebx
lea oracles, %r9
and $0xff, %rbx
shlq $12, %rbx
mov (%r9,%rbx,1), %rbx
pop %rsi
pop %rbx
pop %rax
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_P', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_P', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'00': 9}
00 00 00 00 00 00 00 00 00
*/
| 19.526549 | 148 | 0.648538 |
485af6a020b9949c58519bcbfea2dc3369d0bfec | 2,344 | asm | Assembly | msutest.asm | RobertTheSable/fe3-voice-poc | 2b9537ac653667d996a44092303575ab8f71c387 | [
"MIT"
] | null | null | null | msutest.asm | RobertTheSable/fe3-voice-poc | 2b9537ac653667d996a44092303575ab8f71c387 | [
"MIT"
] | null | null | null | msutest.asm | RobertTheSable/fe3-voice-poc | 2b9537ac653667d996a44092303575ab8f71c387 | [
"MIT"
] | null | null | null | lorom
!INDEX_FLAG = $10
!MEMORY_FLAG = $20
MSU_STATUS = $2000
MSU_READ = $2001
MSU_ID = $2002
MSU_SEEK = $2000
MSU_TRACK = $2004
MSU_VOLUME = $2006
MSU_CONTROL = $2007
MSU_STATE_NOT_FOUND = %00001000
MSU_STATE_PLAYING = %00010000
MSU_STATE_BUSY = %01000000
TRACK_INDEX = $06C0
TRACK_STATUS = $06C2
; original algorithm for queueing text sfx
GOTO_SFX = $87c998
;
incsrc hooks.asm
ORG $87ed00
msu1StatusCheck:
db "S-MSU1"
playMSU:
pha
phx
phy
php
rep #(!MEMORY_FLAG|!INDEX_FLAG)
lda TRACK_INDEX
beq originalOperation ; if no track number is stored, use normal sound effects.
dec
tax
sep #!MEMORY_FLAG
ldy #$0005
availabilityCheckLoop:
; check that MSU1 is set up and available.
lda.w MSU_ID,y
cmp msu1StatusCheck,y
bne originalOperation
dey
bpl availabilityCheckLoop
loadTrack:
; if Track status is not zero, another track was played.
lda TRACK_STATUS
bne end
; I thought checking the audio busy flag was required
; but it looks like audio is always busy and it can be ignored.
; lda.w MSU_STATUS
; bit.b #MSU_STATE_BUSY
; bne end
lda.b #$00
sta.w MSU_CONTROL
lda.b #$FF
sta.w MSU_VOLUME
stx.w MSU_TRACK
lda.b #$01
sta.w MSU_CONTROL
lda.w MSU_STATUS
bit.b #MSU_STATE_NOT_FOUND
bne originalOperation
inc.w TRACK_INDEX
lda.b #$01
sta.w TRACK_STATUS
end:
plp
ply
plx
pla
rts
originalOperation:
plp
ply
plx
pla
jmp normalTextSFX
storeTrackHook:
; use the dialogue table index to load the track number as well.
lda [$0f],y
pha
phx
php
rep #$10
asl
tax
lda.w trackIndexes,x
sta $06C0
plp
plx
pla
asl
rts
trackIndexes:
incsrc trackindexes.asm
forceStopTrack:
; set the track status to zero after text is unpaused so that the next track can be played.
php
sep #!MEMORY_FLAG
lda.w TRACK_STATUS
beq nothingPlaying
stz.w TRACK_STATUS
nothingPlaying:
plp
jml $87b0ff
endTextHook:
; once text is done, we need to 0 out the memory locations used for track info
phx
php
sep #(!MEMORY_FLAG|!INDEX_FLAG)
ldx #$02
resetTrackInfo:
stz.w TRACK_INDEX,x
dex
bpl resetTrackInfo
plp
plx
jmp endText
| 19.056911 | 95 | 0.65785 |
cdfb0bbd1a809b95634ff394f358cc66b9aa96d2 | 105 | asm | Assembly | scripts/code_dasm.asm | aamatevosyan/ispras_cpp_cpu | 6a7c828a355d3ab479bafcb5a60c955cb4250209 | [
"MIT"
] | null | null | null | scripts/code_dasm.asm | aamatevosyan/ispras_cpp_cpu | 6a7c828a355d3ab479bafcb5a60c955cb4250209 | [
"MIT"
] | null | null | null | scripts/code_dasm.asm | aamatevosyan/ispras_cpp_cpu | 6a7c828a355d3ab479bafcb5a60c955cb4250209 | [
"MIT"
] | null | null | null | in
pop ax
in
in
in
call label_51
push ax
ja label_39
out
hlt
label_39:
in
sqrt
hlt
label_51:
add
add
ret
| 5.526316 | 13 | 0.771429 |
12aa5d020bbcdec3be61b4071f13463ba29a2882 | 6,413 | asm | Assembly | tests/miaf/valid-clli-mdcv.asm | y-guyon/ComplianceWarden | 7315f1266b083a1cd958eae9ce7c8f07a8a6ad2d | [
"BSD-3-Clause"
] | 3 | 2020-01-02T17:30:16.000Z | 2021-09-27T18:32:18.000Z | tests/miaf/valid-clli-mdcv.asm | y-guyon/ComplianceWarden | 7315f1266b083a1cd958eae9ce7c8f07a8a6ad2d | [
"BSD-3-Clause"
] | 34 | 2020-01-22T01:41:22.000Z | 2021-12-09T13:20:33.000Z | tests/miaf/valid-clli-mdcv.asm | y-guyon/ComplianceWarden | 7315f1266b083a1cd958eae9ce7c8f07a8a6ad2d | [
"BSD-3-Clause"
] | 2 | 2020-11-05T01:41:08.000Z | 2021-11-19T13:12:35.000Z | %define BE(a) ( ((((a)>>24)&0xFF) << 0) + ((((a)>>16)&0xFF) << 8) + ((((a)>>8)&0xFF) << 16) + ((((a)>>0)&0xFF) << 24))
%define fourcc(a) db a
ftyp_start:
dd BE(ftyp_end - ftyp_start)
db "ftyp"
db "isom"
dd BE(0x00)
db "mif1", "miaf"
ftyp_end:
meta_start:
dd BE(meta_end - meta_start)
db "meta"
dd BE(0)
hdlr_start:
dd BE(hdlr_end - hdlr_start)
db "hdlr"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x00 ; pre_defined(32)
db 0x70, 0x69, 0x63, 0x74 ; handler_type(32) ('pict')
db 0x00, 0x00, 0x00, 0x00 ; reserved1(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved2(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved3(32)
db 0x00 ; name(8)
hdlr_end:
pitm_start:
dd BE(pitm_end - pitm_start)
db "pitm"
dd BE(0)
db 0x00, 0x01
pitm_end:
iinf_start:
dd BE(iinf_end - iinf_start)
dd "iinf"
db 0x00 ; "version(8)"
db 0x00, 0x00, 0x00 ; "flags(24)"
db 0x00, 0x01 ; "entry_count(16)"
infe_start:
dd BE(infe_end - infe_start)
dd "infe"
db 0x02 ; "version(8)"
db 0x00, 0x00, 0x00 ; "flags(24)"
db 0x00, 0x01 ; "item_ID(16)"
db 0x00, 0x00 ; "item_protection_index(16)"
db 0x61, 0x76, 0x30, 0x31 ; "item_type(32)" ('av01')
db 0x00 ; "item_name(8)"
infe_end:
iinf_end:
iprp_start:
dd BE(iprp_end - iprp_start)
db "iprp"
ipco_start:
dd BE(ipco_end - ipco_start)
db "ipco"
ispe_start:
dd BE(ispe_end - ispe_start)
db "ispe"
dd 0, 0, 0
ispe_end:
pixi_start:
dd BE(pixi_end - pixi_start)
dd "pixi"
pixi_end:
ipco_end:
ipma_start:
dd BE(ipma_end - ipma_start)
dd "ipma"
db 0x00 ; "version(8)"
db 0x00, 0x00, 0x00 ; "flags(24)"
db 0x00, 0x00, 0x00, 0x01 ; "entry_count(32)"
db 0x00, 0x01 ; "item_ID(16)"
db 0x02 ; "association_count(8)"
db 0x81 ; "essential(1)" "property_index(7)"
db 0x82 ; "essential(1)" "property_index(7)"
ipma_end:
iprp_end:
meta_end:
moov_start:
dd BE(moov_end - moov_start)
fourcc("moov")
mvhd_start:
dd BE(mvhd_end - mvhd_start)
dd "mvhd"
mvhd_end:
trak_start:
dd BE(trak_end - trak_start)
fourcc("trak")
tkhd_start:
dd BE(tkhd_end - tkhd_start)
dd "tkhd"
db 0x00 ; version(8)
db 0x00, 0x00, 0x01 ; flags(24)
db 0xD7, 0xAE, 0x43, 0xC0 ; creation_time(32)
db 0xD8, 0x7E, 0xD7, 0x51 ; modification_time(32)
db 0x00, 0x00, 0x00, 0x02 ; track_ID(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved(32)
db 0x00, 0x00, 0x09, 0x49 ; duration(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved(32)
db 0x00, 0x00 ; layer(16)
db 0x00, 0x00 ; alternate_group(16)
db 0x00, 0x00 ; volume(16)
db 0x00, 0x00 ; reserved(16)
db 0x00, 0x01, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x00, 0x01, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x00, 0x00, 0x00, 0x00 ; matrix(32)
db 0x40, 0x00, 0x00, 0x00 ; matrix(32)
db 0x01, 0xE0, 0x00, 0x00 ; width(32)
db 0x01, 0x0E, 0x00, 0x00 ; height(32)
tkhd_end:
mdia_start:
dd BE(mdia_end - mdia_start)
fourcc("mdia")
hdlr2_start:
dd BE(hdlr2_end - hdlr2_start)
db "hdlr"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x00 ; pre_defined(32)
db 0x70, 0x69, 0x63, 0x74 ; handler_type(32) ('pict')
db 0x00, 0x00, 0x00, 0x00 ; reserved1(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved2(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved3(32)
db 0x00 ; name(8)
hdlr2_end:
mdhd_start:
dd BE(mdhd_end - mdhd_start)
dd "mdhd"
mdhd_end:
minf_start:
dd BE(minf_end - minf_start)
fourcc("minf")
vmhd_start:
dd BE(vmhd_end - vmhd_start)
dd "vmhd"
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x01 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
vmhd_end:
dinf_start:
dd BE(dinf_end - dinf_start)
dd "dinf"
dref_start:
dd BE(dref_end - dref_start)
dd "dref"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x01 ; entry_count(32)
url_start:
dd BE(url_end - url_start)
dd "url "
db 0x00 ; version(8)
db 0x00, 0x00, 0x01 ; flags(24)
url_end:
dref_end:
dinf_end:
stbl2_start:
dd BE(stbl2_end - stbl2_start)
fourcc("stbl")
stsd2_start:
dd BE(stsd2_end - stsd2_start)
fourcc("stsd")
dd BE(0)
dd BE(1) ; entry_count
avc1_start:
dd BE(avc1_end - avc1_start)
fourcc("avc1")
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0) ; width, height
dd BE(0) ; horizresolution
dd BE(0) ; vertresolution
dd BE(0)
db 0x00, 0x00
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
dd BE(0)
clli_start:
dd BE(clli_end - clli_start)
fourcc("clli")
dd BE(0)
clli_end:
mdcv_start:
dd BE(mdcv_end - mdcv_start)
fourcc("mdcv")
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
dd BE(0)
mdcv_end:
ccst_start:
dd BE(ccst_end - ccst_start)
dd "ccst"
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x7C ; (8) ('|')
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
ccst_end:
avc1_end:
stsd2_end:
stts_start:
dd BE(stts_end - stts_start)
dd "stts"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x01 ; entry_count(32)
db 0x00, 0x00, 0x00, 0x01 ; sample_count(32)
db 0x00, 0x00, 0x00, 0x01 ; sample_delta(32)
stts_end:
stsc_start:
dd BE(stsc_end - stsc_start)
dd "stsc"
db 0x00, 0x00, 0x00, 0x00
db 0x00, 0x00, 0x00, 0x00
db 0x00, 0x00, 0x00, 0x00
stsc_end:
stsz_start:
dd BE(stsz_end - stsz_start)
dd "stsz"
db 0x00, 0x00, 0x00, 0x01
db 0x00, 0x00, 0x00, 0x01
stsz_end:
stco_start:
dd BE(stco_end - stco_start)
dd "stco"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x01 ; entry_count(32)
dd BE(mdat_start - ftyp_start + 8) ; chunk_offset(32)
stco_end:
stbl2_end:
minf_end:
mdia_end:
trak_end:
moov_end:
mdat_start:
dd BE(mdat_end - mdat_start)
db "mdat"
db 0x00
mdat_end:
; vim: syntax=nasm
| 22.423077 | 193 | 0.618431 |
06bb08387401728135a18fe3e6bc5673ed5006cd | 7,691 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_987.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_0xca_notsx.log_21829_987.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_0xca_notsx.log_21829_987.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xc830, %rsi
lea addresses_WT_ht+0x1875e, %rdi
nop
cmp %r12, %r12
mov $44, %rcx
rep movsq
nop
nop
nop
add $6684, %rdx
lea addresses_normal_ht+0x1c75e, %r10
nop
nop
add $49088, %r11
movl $0x61626364, (%r10)
nop
xor $56779, %rdx
lea addresses_normal_ht+0x18080, %rsi
lea addresses_normal_ht+0x5c3e, %rdi
nop
nop
nop
cmp $23439, %r11
mov $70, %rcx
rep movsb
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0xe76, %rsi
nop
nop
nop
nop
cmp %r10, %r10
movups (%rsi), %xmm3
vpextrq $0, %xmm3, %r12
nop
nop
nop
lfence
lea addresses_UC_ht+0x65fe, %r10
clflush (%r10)
nop
nop
nop
add $18739, %rsi
mov $0x6162636465666768, %r11
movq %r11, (%r10)
xor $60161, %rcx
lea addresses_UC_ht+0x1b0e, %rdi
add $60855, %rsi
mov (%rdi), %r11d
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x3ee, %rdx
nop
sub $37069, %r11
mov $0x6162636465666768, %rdi
movq %rdi, (%rdx)
nop
nop
nop
dec %rdx
lea addresses_WC_ht+0x1e29e, %rsi
lea addresses_A_ht+0x1095e, %rdi
clflush (%rdi)
sub %r13, %r13
mov $87, %rcx
rep movsw
nop
sub %r11, %r11
lea addresses_normal_ht+0xd0ae, %rsi
lea addresses_D_ht+0x690e, %rdi
clflush (%rsi)
nop
nop
nop
add $24592, %r12
mov $61, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_normal_ht+0x1ef5e, %rsi
lea addresses_normal_ht+0x1695e, %rdi
clflush (%rsi)
nop
nop
xor %r12, %r12
mov $117, %rcx
rep movsw
nop
nop
nop
nop
cmp $27329, %r11
lea addresses_WT_ht+0x625e, %rsi
lea addresses_WC_ht+0x1745e, %rdi
nop
nop
nop
nop
sub $24482, %r11
mov $17, %rcx
rep movsb
cmp $39907, %rdi
lea addresses_D_ht+0x4d5e, %rsi
clflush (%rsi)
nop
nop
nop
cmp %r10, %r10
movb (%rsi), %r13b
nop
nop
nop
nop
xor $45330, %rdx
lea addresses_WC_ht+0x543, %rsi
lea addresses_WT_ht+0x630e, %rdi
nop
nop
nop
xor %r10, %r10
mov $108, %rcx
rep movsl
nop
nop
nop
nop
add %r11, %r11
lea addresses_WT_ht+0xc81e, %rsi
lea addresses_UC_ht+0x378e, %rdi
nop
nop
nop
and %rdx, %rdx
mov $76, %rcx
rep movsl
cmp %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r8
// Faulty Load
lea addresses_D+0x6f5e, %r13
nop
sub $14107, %r11
mov (%r13), %r12
lea oracles, %r13
and $0xff, %r12
shlq $12, %r12
mov (%r13,%r12,1), %r12
pop %r8
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': True, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 3, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'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.278302 | 2,999 | 0.661682 |
6166b444a89062e9457e943fd245fd57f8057edb | 1,283 | asm | Assembly | programs/oeis/069/A069241.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/069/A069241.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/069/A069241.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A069241: Number of Hamiltonian paths in the graph on n vertices {1,...,n}, with i adjacent to j iff |i-j|<=2.
; 1,1,1,3,6,10,17,28,44,68,104,157,235,350,519,767,1131,1665,2448,3596,5279,7746,11362,16662,24430,35815,52501,76956,112797,165325,242309,355135,520490,762830,1117997,1638520,2401384,3519416,5157972,7559393,11078847,16236858,23796291,34875179,51112079,74908413,109783636,160895760,235804219,345587902,506483710,742287978,1087875930,1594359691,2336647721,3424523704,5018883449,7355531225,10780054985,15798938491,23154469774,33934524818,49733463369,72887933204,106822458084,156555921516,229443854784,336266312933,492822234515,722266089366,1058532402367,1551354636951,2273620726387,3332153128825,4883507765848,7157128492308,10489281621207,15372789387130,22529917879514,33019199500798,48391988888006,70921906767599,103941106268477,152333095156564,223255001924245,327196108192805,479529203349453,702784205273783,1029980313466674,1509509516816214,2212293722090085,3242274035556848,4751783552373152,6964077274463328,10206351310020268,14958134862393513,21922212136856935,32128563446877298,47086698309270907,69008910446127939
mov $2,$0
add $0,1
seq $0,288429 ; a(n) = 2*a(n-1) - a(n-2) + a(n-3) - a(n-4), where a(0) = 2, a(1) = 4, a(2) = 5, a(3) = 6.
sub $0,1
sub $0,$2
sub $0,2
| 128.3 | 1,016 | 0.82463 |
c3eb53569de9e6ec9097b0a6a2a5397cc6803785 | 393 | asm | Assembly | oeis/160/A160596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/160/A160596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/160/A160596.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A160596: Denominator of resilience R(n) = phi(n)/(n-1).
; 1,1,3,1,5,1,7,4,9,1,11,1,13,7,15,1,17,1,19,5,21,1,23,6,25,13,9,1,29,1,31,8,33,17,35,1,37,19,39,1,41,1,43,11,45,1,47,8,49,25,17,1,53,27,55,14,57,1,59,1,61,31,63,4,13,1,67,17,23,1,71,1,73,37,25,19,77,1,79,40,81,1,83,21,85,43,87,1,89,5,91,23,93,47,95,1,97,49,99,1
add $0,1
mov $1,$0
seq $1,49559 ; a(n) = gcd(n - 1, phi(n)).
div $0,$1
| 49.125 | 262 | 0.59542 |
ade92a9ad727afe697af007a8cc3bc5738e33b48 | 2,742 | asm | Assembly | programs/oeis/017/A017254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017254: a(n) = (9*n + 7)^10.
; 282475249,1099511627776,95367431640625,2064377754059776,21611482313284249,144555105949057024,713342911662882601,2824752490000000000,9468276082626847201,27850097600940212224,73742412689492826049,179084769654285362176,404555773570791015625,859442550649180389376,1731874467807835667449,3333369396234118349824,6162677950336718514001,10995116277760000000000,19004963774880799438801,31930081208285372007424,52289689788971837545849,83668255425284801560576,131080657325707041015625,201436298986451489022976,304122555034158459939649,451730952053751361306624,660952768068482275874401,953674316406250000000000,1358306067936240628319401,1911383973745667813146624,2659485890900719634874649,3661510899651594831102976,4991374543951576181640625,6741178641117286368280576,9024920303514444856660849,11982811207963436516967424,15786284949774657045043801,20643777540597760000000000,26807373765254438673009001,34580420215074076278989824,44326214376618333352652449,56477888187717354967269376,71549613990099615712890625,90149270822232320504882176,112992719519952587477991049,140919846138714198689972224,174912544792453358346502201,216114823132842490000000000,265855226381706476903427601,325671789091273746650497024,397339737654378065640319249,482902181032368684001739776,584704042224979400634765625,705429498686404044207947776,848143216207979632525690249,1016335677752841922882561024,1213972926354344043087129601,1445551059490570240000000000,1716155831334586342923895201,2031527738966799156242228224,2398132989034601512560915049,2823240762468010977500594176,3315007216720921043447265625,3882566687618526925232997376,4536130576265116619119118449,5287094430615384550826573824,6148153756249382761936206001,7133429116628826010000000000,8258601109663365229397131801,9541055834792291360570343424,11000041493002581448023079849,12656836791270903975580312576,14534931852847813494150390625,16660222365609538545805950976,19061217732399154541663235649,21769264019877187453015450624,24818782535914467768701411401,28247524900000000000000000000,32096845506516383920668257401,36411992317067572557320602624,41242416955341131537413053649,46642105116262327601883774976,52669928340462973740244140625,59390018245356647350847128576,66872164345396328911416601849,75192236636403334707936231424,84432634162210291056904825801,94682760826268472010000000000,106039529756343750594588792001,118607897576978348061516365824,132501429992040159226426676449,147842900128430337645756261376,164764921141885694906728515625,183410614636807956575395250176,203934316504189676181259377049,226502321834999290864501556224,251293670620848060815558929201,278500976009402122240000000000,308331296938836253127540655601,341007057033664855435886593024
mul $0,9
add $0,7
pow $0,10
| 391.714286 | 2,680 | 0.951495 |
0851b49919b7ea469e7eef534ef0293c1776a55a | 465 | asm | Assembly | programs/oeis/085/A085296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/085/A085296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/085/A085296.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A085296: Runs of zeros in Catalan sequence modulo 3: consecutive occurrences of binomial(2*k,k)/(k+1) == 0 (mod 3).
; 3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,363,3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,1092,3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,363,3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,3279,3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,363,3,12,3,39,3,12,3,120,3,12,3,39,3,12,3,1092,3,12,3,39
add $0,1
mov $1,3
lpb $0
dif $0,2
mul $1,3
lpe
div $1,2
mul $1,3
mov $0,$1
| 35.769231 | 266 | 0.625806 |
52e238775214548b1604dc1adf4f7308faa553cd | 36,261 | asm | Assembly | ASCrIIble/main.asm | hasherezade/asm16_projects | e6624e30068550b0a776e108cca09b60f8242a36 | [
"CC-BY-2.0"
] | 25 | 2015-01-14T07:30:18.000Z | 2021-12-05T09:39:21.000Z | ASCrIIble/main.asm | hasherezade/asm16_projects | e6624e30068550b0a776e108cca09b60f8242a36 | [
"CC-BY-2.0"
] | 1 | 2020-04-10T07:18:38.000Z | 2020-04-10T07:18:38.000Z | ASCrIIble/main.asm | hasherezade/asm16_projects | e6624e30068550b0a776e108cca09b60f8242a36 | [
"CC-BY-2.0"
] | 20 | 2015-05-06T15:09:15.000Z | 2022-02-24T06:26:58.000Z | ; the code published under Creative Commons (CC-BY-NC) license
; author: hasherezade (hshrzd.wordpress.com)
; contact: hasherezade@gmail.com
; compile with tasm (16-bit)
.model tiny
.stack 100h
.data
main db ' ###',13,10,' ## ##',13,10,' ## ##',13,10,' ## # ##### ###',13,10,' ########## ##### ## # # ###',13,10,' ## # ## # # #',13,10,' ## # ### # 00000 # # 0 0 0000',13,10,' ## # ## ## 0 0 # # 0 0 0 00',13,10,' ## # ## ###### 00000 ### # 00000 0 000000 ',13,10,' ## # # 0 00 ### 0 0 0 0',13,10,' ## ##### 0 00 00000 000 000000','$'
main1 db '100% asm ASCII painter$'
main2 db 'by: hasherezade, 2004$'
main3 db '[PRESS SPACE]$'
napis db "ASCrIIble$"
menu db ' Quit | Open | Save | Clear | cUt | Replace | unDo | Pen $'
menu1 db ' | Background $'
cmd_quit db 'q'
cmd_open db 'o'
cmd_save db 's'
cmd_clear db 'c'
cmd_cut db 'u'
cmd_undo db 'd'
cmd_replace db 'r'
cmd_pen db 'p'
cmd_background db 'b'
ans_yes db 'y'
ans_no db 'n'
pendzel db '*'
tlo db ' '
zapisztx db 'SAVE$'
otworztx db 'OPEN$'
zmientx db 'CHANGE$'
zamien_natx db 'REPLACE$'
uwagatx db 'WARNING!$'
wytnijtxt db 'CUT$'
wcisniety db 0
opcje_flag db 0
mycha_flag db 0
podaj_nazwe db 'Input file name .txt:$'
nie_ma_pliku db 'File with this name do not exits!$'
nie_ma_pliku2 db 'Try again?$'
plik_istnieje db 'File with this name already exist!$'
plik_istnieje2 db 'Do you want to save the file?$'
nie_podano db 'You supplied no filename!$'
nie_zapisano db 'Could not save the file!$'
nie_zapisano2 db 'Check the reason and retry!$'
tylko_odczyt db 'Saving to this file was not possible:$'
tylko_odczyt2 db 'read only file!$'
zmien_pendzel db 'New value of the Pen:$'
zmien_tlo db 'New value of the background:$'
zamien_na db 'Replace char by char:$'
znaleziono1 db 'the preview contains$'
znaleziono2 db 'file$'
nie_znaleziono1 db 'No files with ext .txt!$'
wyt_opcje1 db 'Choose the option:$'
wyt_opcje2 db '[ ] transparent background$'
wyt_opcje3 db '[ ] copy$'
wyt_opcje4 db '[ ] mirror$'
wyt_opcje5 db '[ ] delete selection$'
pwyt_x dw 0
pwyt_x2 dw 0
pwyt_y dw 0
pwyt_y2 dw 0
button_tak db '[YES]$'
button_nie db '[NO!]$'
button_enter db '[ENTER]$'
handle dw ?
znak db ?
plik db 20 dup(0)
stop_wysw_znal db 0
myData db 43 dup(0)
znajdz db '????????.txt',0
nazwa db 8 dup(' '),'$'
ile_znaleziono dw 0
ile_wyswietlono dw 0
reverse dw 0
.code
assume DS:@data
kopiuj_do_bufora:
push ax
push cx
push ds
push si
push es
push di
mov ax,09000h
mov es,ax
mov di,320
mov ax,0b800h
mov ds,ax
mov si,320
mov cx,2000
rep movsw
pop di
pop es
pop si
pop ds
pop cx
pop ax
ret
rysuj_ramke:
push ax
push cx
push dx
push es
push di
mov cx,20
mov dx,5
call wylicz_punkt
mov ax,0b800h
mov es,ax
mov ah,00010111b
mov al,' '
mov cx,10
rysuj_petla:
push cx
mov cx,40
rep stosw
add di,160
sub di,80
pop cx
loop rysuj_petla
pop di
pop es
pop dx
pop cx
pop ax
ret
rysuj_ramke_wytnij:
push ax
push cx
push dx
push es
push di
mov cx,22
mov dx,5
call wylicz_punkt
mov ax,0b800h
mov es,ax
mov ah,00010111b
mov al,' '
mov cx,12
rysuj_petla_wyt:
push cx
mov cx,36
rep stosw
add di,160
sub di,72
pop cx
loop rysuj_petla_wyt
pop di
pop es
pop dx
pop cx
pop ax
ret
ramka_wytnij_opcje:
push cx
push dx
lea si,wytnijtxt
call naglowek
mov cx,25
mov dx,8
call wylicz_punkt
lea si,wyt_opcje1
call wczytuj_napis
mov cx,30
mov dx,10
call wylicz_punkt
lea si,wyt_opcje2
call wczytuj_napis
mov cx,30
mov dx,11
call wylicz_punkt
lea si,wyt_opcje3
call wczytuj_napis
mov cx,30
mov dx,12
call wylicz_punkt
lea si,wyt_opcje4
call wczytuj_napis
mov cx,30
mov dx,13
call wylicz_punkt
lea si,wyt_opcje5
call wczytuj_napis
mov cx,37
mov dx,15
call rysuj_przycisk_enter
pop dx
pop cx
ret
czy_opcja_kasuj:
push ax
push di
mov ax,di
mov cx,31
mov dx,13
call wylicz_punkt
cmp ax,di
jne nie_opcja_kasuj
cmp byte ptr es:[di],'*'
je zgas_inne_opcje
jmp zapal_inne_opcje
nie_opcja_kasuj:
pop di
pop ax
ret
zgas_inne_opcje:
push di
push ax
push bx
push cx
push dx
mov cx,30
mov dx,10
call wylicz_punkt
inc di
mov bl,00011000b
mov cx,21
call tlo_pod_linia
inc di
mov byte ptr es:[di],' '
mov cx,30
mov dx,11
call wylicz_punkt
inc di
mov cx,10
call tlo_pod_linia
inc di
mov byte ptr es:[di],' '
mov cx,30
mov dx,12
call wylicz_punkt
inc di
mov cx,2
call tlo_pod_linia
inc di
mov byte ptr es:[di],' '
pop dx
pop cx
pop bx
pop ax
pop di
jmp nie_opcja_kasuj
zapal_inne_opcje:
push di
push ax
push bx
push cx
push dx
mov cx,30
mov dx,10
call wylicz_punkt
inc di
mov bl,00010111b
mov cx,21
call tlo_pod_linia
mov cx,30
mov dx,11
call wylicz_punkt
inc di
mov cx,10
call tlo_pod_linia
mov cx,30
mov dx,12
call wylicz_punkt
inc di
mov cx,21
call tlo_pod_linia
pop dx
pop cx
pop bx
pop ax
pop di
jmp nie_opcja_kasuj
kontrola_mychy_opcjewyt:
push cx
push dx
push di
push es
push ds
mov ax,0003h
int 33h
test bx,1
jz nielewy_kontrola_mychy_opcjewyt
cmp byte ptr mycha_flag,0
jne koniec_kontrola_mychy_opcjewyt
shr cx,3
shr dx,3
call wylicz_punkt
cmp byte ptr es:[di-2],'['
jne koniec_kontrola_mychy_opcjewyt
cmp byte ptr es:[di+2],']'
jne koniec_kontrola_mychy_opcjewyt
cmp byte ptr es:[di-1],00010111b
jne koniec_kontrola_mychy_opcjewyt
cmp byte ptr es:[di],'*'
je checked
call ukryj_mysz
mov byte ptr es:[di],'*'
mov byte ptr mycha_flag,1
jmp koniec_kontrola_mychy_opcjewyt
checked:
call ukryj_mysz
mov byte ptr es:[di],' '
mov byte ptr mycha_flag,1
jmp koniec_kontrola_mychy_opcjewyt
nielewy_kontrola_mychy_opcjewyt:
mov byte ptr mycha_flag,0
koniec_kontrola_mychy_opcjewyt:
call czy_opcja_kasuj
call pokaz_mysz
pop ds
pop es
pop di
pop dx
pop cx
ret
ustaw_opcje:
push dx
push cx
mov cx,31
mov dx,10
call wylicz_punkt
cmp byte ptr es:[di],'*'
jne dalej_sprawdzaj_opcje1
or byte ptr opcje_flag,1
dalej_sprawdzaj_opcje1:
inc dx
call wylicz_punkt
cmp byte ptr es:[di],'*'
jne dalej_sprawdzaj_opcje2
or byte ptr opcje_flag,2
dalej_sprawdzaj_opcje2:
inc dx
call wylicz_punkt
cmp byte ptr es:[di],'*'
jne dalej_sprawdzaj_opcje3
or byte ptr opcje_flag,4
dalej_sprawdzaj_opcje3:
inc dx
call wylicz_punkt
cmp byte ptr es:[di],'*'
jne koniec_ustaw_opcje
or byte ptr opcje_flag,8
koniec_ustaw_opcje:
pop cx
pop dx
ret
zaznacz_opcje:
push ax
petla_zaznacz_opcje:
call kontrola_mychy_opcjewyt
mov ah,6
mov dl,0ffh
int 21h
cmp al,13
jne petla_zaznacz_opcje
call ustaw_opcje
pop ax
ret
rysuj_ramke_oz:
push ax
push cx
push dx
push es
push di
mov cx,19
mov dx,5
call wylicz_punkt
mov ax,0b800h
mov es,ax
mov ah,00010111b
mov al,' '
mov cx,17
rysuj_petla_oz:
push cx
mov cx,43
rep stosw
add di,160
sub di,86
pop cx
loop rysuj_petla_oz
call rysuj_pole_na_pliki
pop di
pop es
pop dx
pop cx
pop ax
ret
zacznij_szukac_plikow:
push ax
push dx
push ds
mov ax,seg myData
mov ds,ax
lea dx,myData
mov ah,1ah
int 21h
mov ax,seg znajdz
mov ds,ax
lea dx,znajdz
mov ah,4eh
int 21h
pop ds
pop dx
pop ax
ret
czysc_nazwe:
push ax
push cx
push di
push es
mov ax,seg nazwa
mov es,ax
mov di,offset nazwa
mov al,' '
mov ah,' '
mov cx,4
rep stosw
pop es
pop di
pop cx
pop ax
ret
kopiuj_znaleziony:
push ax
push cx
push ds
push si
push es
push di
mov ax,seg myData
mov ds,ax
lea si,myData+30
mov ax,seg nazwa
mov es,ax
mov di,offset nazwa
cld
mov cx,8
petla_znalezione:
cmp byte ptr ds:[si],'.'
je koniec_znalezione
movsb
loop petla_znalezione
koniec_znalezione:
pop di
pop es
pop si
pop ds
pop cx
pop ax
ret
petla1_rysuj_pole:
inc di
inc di
mov byte ptr es:[di],0c4h
loop petla1_rysuj_pole
ret
srodek_rysuj_pole:
mov cx,25
inc dx
call wylicz_punkt
mov byte ptr es:[di],0b3h
add cx,15
call wylicz_punkt
mov byte ptr es:[di],0b3h
add cx,16
call wylicz_punkt
inc di
mov byte ptr es:[di],01110000b
ret
rysuj_pole_na_pliki:
push ax
push cx
push dx
push es
push di
mov ax,0b800h
mov es,ax
mov cx,25
mov dx,9
call wylicz_punkt
mov byte ptr es:[di],0dah
mov cx,15
call petla1_rysuj_pole
mov byte ptr es:[di],0c2h
mov cx,15
call petla1_rysuj_pole
inc di
inc di
mov byte ptr es:[di],0bfh
call srodek_rysuj_pole
dec di
mov byte ptr es:[di],18h
mov cx,5
petla2_rysuj_pole:
push cx
call srodek_rysuj_pole
pop cx
loop petla2_rysuj_pole
call srodek_rysuj_pole
dec di
mov byte ptr es:[di],19h
mov cx,25
mov dx,17
call wylicz_punkt
mov byte ptr es:[di],0c0h
mov cx,15
call petla1_rysuj_pole
mov byte ptr es:[di],0c1h
mov cx,15
call petla1_rysuj_pole
inc di
inc di
mov byte ptr es:[di],0d9h
pop di
pop es
pop dx
pop cx
pop ax
ret
wpisuj_do_bufora_znaleziony:
push si
push cx
lea si,nazwa
mov cx,8
rep movsb
pop cx
pop si
ret
buforuj_znalezione:
push es
push di
push cx
push ax
mov cl,2
mov word ptr ile_znaleziono,0
mov ax,09000h
mov es,ax
mov di,4002
call zacznij_szukac_plikow
jc koniec_buforuj_znalezione
call czysc_nazwe
call kopiuj_znaleziony
call wpisuj_do_bufora_znaleziony
add word ptr ile_znaleziono,1
mov cx,699
buforuj_kolejne:
mov ah,4fh
int 21h
jc koniec_buforuj_znalezione
call czysc_nazwe
call kopiuj_znaleziony
call wpisuj_do_bufora_znaleziony
add word ptr ile_znaleziono,1
loop buforuj_kolejne
koniec_buforuj_znalezione:
call czysc_nazwe
call wpisuj_do_bufora_znaleziony
pop ax
pop cx
pop di
pop es
ret
znaleziony_z_bufora_do_nazwa:
push ds
push es
push di
push ax
push cx
mov ax,09000h
mov ds,ax
mov ax,seg nazwa
mov es,ax
lea di,nazwa
mov cx,8
rep movsb
pop cx
pop ax
pop di
pop es
pop ds
ret
sprawdz_czy_nazwa:
cmp byte ptr nazwa,' '
jne koniec_sprawdz_czy_nazwa
mov byte ptr stop_wysw_znal,1
koniec_sprawdz_czy_nazwa:
ret
pisz_kolumne_plikow:
push ax
push bx
push cx
mov bx,cx
mov cx,7
petla_wyswietlaj_kol:
cmp byte ptr stop_wysw_znal,1
je koniec_pisz_kolumne_plikow
call czysc_nazwe
call znaleziony_z_bufora_do_nazwa
push si
lea si, nazwa
call sprawdz_czy_nazwa
call wczytuj_napis
pop si
push cx
mov cx,bx
inc dx
call wylicz_punkt
pop cx
loop petla_wyswietlaj_kol
koniec_pisz_kolumne_plikow:
pop cx
pop bx
pop ax
ret
int_to_str:
push ax
push bx
push di
mov bl,10
petla_itos:
dec di
dec di
div bl
add ah,30h
mov byte ptr es:[di],ah
xor ah,ah
cmp al,0
jne petla_itos
pop di
pop ax
pop bx
ret
ile_plikow:
xor ax,ax
mov ax,word ptr ile_znaleziono
add di,4
cmp ax,100
jb mniejsze_od_100
add di,2
mniejsze_od_100:
cmp ax,10
jb mniejsze_od_10
add di,2
mniejsze_od_10:
call int_to_str
inc di
inc di
lea si,znaleziono2
call wczytuj_napis
cmp word ptr ile_znaleziono,5
jb mniej_niz_5
mov byte ptr es:[di],'o'
inc di
inc di
mov byte ptr es:[di],'w'
ret
mniej_niz_5:
cmp word ptr ile_znaleziono,2
jb koniec_ile_plikow
mov byte ptr es:[di],'i'
koniec_ile_plikow:
ret
wypisz_ile_znaleziono:
push dx
push cx
push si
push es
push di
mov dx,8
mov cx,25
call wylicz_punkt
cmp word ptr ile_znaleziono,0
jne dalej_wypisuj_znalezione
lea si,nie_znaleziono1
call wczytuj_napis
jmp koniec_wypisuj_znalezione
dalej_wypisuj_znalezione:
lea si,znaleziono1
call wczytuj_napis
call ile_plikow
koniec_wypisuj_znalezione:
pop di
pop es
pop si
pop cx
pop dx
ret
wyswietl_znalezione:
push ax
push bx
push cx
push dx
call wypisz_ile_znaleziono
mov byte ptr stop_wysw_znal,0
cmp word ptr ile_znaleziono,0
je koniec_wyswietl_znalezione
mov dx,10
mov cx,27
call wylicz_punkt
call pisz_kolumne_plikow
mov dx,10
mov cx,42
call wylicz_punkt
call pisz_kolumne_plikow
koniec_wyswietl_znalezione:
pop dx
pop cx
pop bx
pop ax
ret
czysc_pole_plikow:
push ax
push bx
push cx
push dx
mov dx,10
mov cx,27
call wylicz_punkt
mov cx,7
petla_czysc_kol1:
call czysc_nazwe
push si
lea si, nazwa
call wczytuj_napis
pop si
push cx
inc dx
mov cx,27
call wylicz_punkt
pop cx
loop petla_czysc_kol1
mov dx,10
mov cx,42
call wylicz_punkt
mov cx,7
petla_czysc_kol2:
call czysc_nazwe
push si
lea si, nazwa
call wczytuj_napis
pop si
push cx
inc dx
mov cx,42
call wylicz_punkt
pop cx
loop petla_czysc_kol2
pop dx
pop cx
pop bx
pop ax
ret
odtwarzaj_z_bufora:
push ax
push cx
push es
push di
push ds
push si
mov ax,0b800h
mov es,ax
mov di,320
mov ax,09000h
mov ds,ax
mov si,320
mov cx,2000
rep movsw
pop si
pop ds
pop di
pop es
pop cx
pop ax
ret
ramka_oz:
push cx
push dx
call naglowek
mov cx,25
mov dx,18
call wylicz_punkt
lea si,podaj_nazwe
call wczytuj_napis
call pole_wpisu
mov cx,37
mov dx,20
call rysuj_przycisk_enter
pop dx
pop cx
ret
ramka_zmien:
push cx
push dx
mov cx,25
mov dx,8
call wylicz_punkt
call wczytuj_napis
lea si,zmientx
call naglowek
mov cx,25
mov dx,10
call pole_wpisu_zamien
mov cx,36
mov dx,12
call rysuj_przycisk_enter
pop dx
pop cx
ret
ramka_zamien_na:
push cx
push dx
mov cx,25
mov dx,8
call wylicz_punkt
lea si, zamien_na
call wczytuj_napis
lea si,zamien_natx
call naglowek
mov cx,25
mov dx,10
call pole_wpisu_zamien
mov cx,27
mov dx,10
call wylicz_punkt
mov byte ptr es:[di],'-'
add di,2
mov byte ptr es:[di],'>'
mov cx,30
mov dx,10
call pole_wpisu_zamien
mov cx,36
mov dx,12
call rysuj_przycisk_enter
pop dx
pop cx
ret
ramka_pobierz_znak_na_znak:
push ax
push cx
push dx
push di
push es
mov cx,25
mov dx,10
call wylicz_punkt
mov cx,2
petla_pobierz_znz:
mov ah,8
int 21h
cmp al,13
je koniec_pobierania_znz
cmp al,8
jne pobierz_znz_d2
backspace_znz:
cmp cx,2
je nie_backspace_znz
sub di,10
mov byte ptr es:[di],' '
inc cx
nie_backspace_znz:
jmp petla_pobierz_znz
pobierz_znz_d2:
cmp al,20h
jb petla_pobierz_znz
cmp al,7eh
ja petla_pobierz_znz
mov es:[di],al
add di,10
loop petla_pobierz_znz
akceptuj_znz:
mov ah,8
int 21h
cmp al,8
je backspace_znz
cmp al,13
jne akceptuj_znz
koniec_pobierania_znz:
pop es
pop di
pop dx
pop cx
pop ax
ret
zamien_znak_na_znak:
mov dx,2
znzpetla_y:
mov cx,0 ;cx=x
znzpetla_x:
push cx
push dx
call wylicz_punkt
mov al,byte ptr es:[di]
cmp al,bh
jne znz_d1
mov byte ptr es:[di],bl
znz_d1:
pop dx
pop cx
inc cx
cmp cx,80
jb znzpetla_x
inc dx
cmp dx,25
jb znzpetla_y
ret
pole_wpisu:
push bx
push di
mov cx,49
mov dx,18
call wylicz_punkt
inc di
mov bl,00111111b
mov cx,8
call tlo_pod_linia
pop di
pop bx
ret
pole_wpisu_zamien:
push bx
push di
call wylicz_punkt
inc di
mov bl,00111111b
mov cx,1
call tlo_pod_linia
pop di
pop bx
ret
odswierz_liste_plikow:
push si
push di
push ax
mov byte ptr mycha_flag,1
mov ax,2
int 33h
call czysc_pole_plikow
call wyswietl_znalezione
mov ax,1
int 33h
pop ax
pop di
pop si
ret
kontrola_mychy_pobierzn:
push cx
push dx
push di
push es
push ds
mov ax,0003h
int 33h
test bx,1
jz nielewy_kontrola_mychy_pobierzn
cmp byte ptr mycha_flag,0
jne koniec_kontrola_mychy_pobierzn
shr cx,3
shr dx,3
call wylicz_punkt
cmp byte ptr es:[di],19h ;down
jne sprawdz_up
mov ax,word ptr ile_wyswietlono
cmp ax,word ptr ile_znaleziono
jae koniec_kontrola_mychy_pobierzn
cmp byte ptr stop_wysw_znal,1
je koniec_kontrola_mychy_pobierzn
add si,112
add word ptr ile_wyswietlono,14
call odswierz_liste_plikow
jmp koniec_kontrola_mychy_pobierzn
sprawdz_up:
cmp byte ptr es:[di],18h ;up
jne dalej_mycha_pobierzn
cmp si,4002
jbe koniec_kontrola_mychy_pobierzn
sub si,112
sub word ptr ile_wyswietlono,14
call odswierz_liste_plikow
jmp koniec_kontrola_mychy_pobierzn
nielewy_kontrola_mychy_pobierzn:
mov byte ptr mycha_flag,0
dalej_mycha_pobierzn:
call czy_kliknieto_nazwe
koniec_kontrola_mychy_pobierzn:
pop ds
pop es
pop di
pop dx
pop cx
ret
czy_kliknieto_nazwe:
cmp byte ptr es:[di],' '
je nie_nazwa
cmp byte ptr es:[di],18h
je nie_nazwa
cmp byte ptr es:[di],19h
je nie_nazwa
cmp byte ptr es:[di],0dah
je nie_nazwa
cmp byte ptr es:[di],0c2h
je nie_nazwa
cmp byte ptr es:[di],0c4h
je nie_nazwa
cmp byte ptr es:[di],0bfh
je nie_nazwa
cmp byte ptr es:[di],0c0h
je nie_nazwa
cmp byte ptr es:[di],0c1h
je nie_nazwa
cmp byte ptr es:[di],0b3h
je nie_nazwa
cmp byte ptr es:[di],0d9h
je nie_nazwa
mov ax,9
call przechwyc_nazwe
ret
nie_nazwa:
mov ax,0
ret
przewin_do_poczatku_nazwy:
petla_przew_do_pocz:
cmp byte ptr es:[di],' '
je przewiniete
dec di
dec di
jmp petla_przew_do_pocz
przewiniete:
inc di
inc di
ret
przechwyc_nazwe:
push si
push es
push di
push ax
mov ax,0b800h
mov es,ax
call przewin_do_poczatku_nazwy
mov si,di
mov cx,49
mov dx,18
call wylicz_punkt
mov cx,8
przekopiuj_nazwe_w_pole:
mov al,byte ptr es:[si]
mov byte ptr es:[di],al
inc di
inc di
inc si
inc si
loop przekopiuj_nazwe_w_pole
pop ax
pop di
pop es
pop si
ret
przewin_do_konca_nazwy:
petla_przew_do_konca:
cmp byte ptr es:[di],' '
je przewiniete_konc
inc di
inc di
dec cx
jmp petla_przew_do_konca
przewiniete_konc:
ret
nazwa_wskazana_mysza:
push ax
push dx
cmp cx,9
jb koniec_nazwa_wskazana
mov ax,di
push cx
mov cx,49
mov dx,18
call wylicz_punkt
pop cx
cmp byte ptr es:[di],' '
je nie_wskazana
call przewin_do_konca_nazwy
jmp koniec_nazwa_wskazana
nie_wskazana:
mov di,ax
koniec_nazwa_wskazana:
pop dx
pop ax
ret
ramka_pobierz_nazwe:
push ax
push cx
push dx
push di
push es
push si
mov cx,49
mov dx,18
call wylicz_punkt
mov cx,9
mov si,4002
petla_pobierz:
call kontrola_mychy_pobierzn
cmp ax,9
jne pobierz_d4
mov cx,49
mov dx,18
call wylicz_punkt
mov cx,ax
pobierz_d4:
call nazwa_wskazana_mysza
mov dl,0ffh
mov ah,6
int 21h
cmp al,13
je koniec_pobierania
cmp al,' '
jne pobierz_d1
mov al,'_'
pobierz_d1:
cmp al,8
jne pobierz_d2
backspace:
cmp byte ptr es:[di-2],' '
je nie_backspace
dec di
dec di
mov byte ptr es:[di],' '
inc cx
nie_backspace:
jmp petla_pobierz
pobierz_d2:
cmp al,'_'
je ok1
cmp al,30h
jb petla_pobierz
cmp al,3ah
jb ok1
cmp al,40h
jb petla_pobierz
cmp al,5ah
jb ok1
cmp al,61h
jb petla_pobierz
cmp al,7ah
ja petla_pobierz
ok1:
cmp cx,2
jb petla_pobierz
mov byte ptr es:[di],al
inc di
inc di
loop petla_pobierz
akceptuj:
mov ah,8
int 21h
cmp al,8
je backspace
cmp al,13
jne akceptuj
koniec_pobierania:
pop si
pop es
pop di
pop dx
pop cx
pop ax
ret
ramka_bufwczytaj_nazwe:
push ax
push cx
push dx
push si
push di
mov cx,49
mov dx,18
call wylicz_punkt
lea dx,plik
petla_bufwczytaj:
mov al,byte ptr es:[di]
cmp al,' '
je koniec_bufwczytaj
mov si,dx
mov byte ptr ds:[si],al
inc di
inc di
inc dx
jmp petla_bufwczytaj
koniec_bufwczytaj:
mov si,dx
mov byte ptr ds:[si],'.'
inc si
mov byte ptr ds:[si],'t'
inc si
mov byte ptr ds:[si],'x'
inc si
mov byte ptr ds:[si],'t'
inc si
mov byte ptr ds:[si],0
pop di
pop si
pop dx
pop cx
pop ax
ret
ramka_pobierz_pendzel:
push ax
push cx
push dx
push di
push es
mov cx,25
mov dx,10
call wylicz_punkt
mov cx,1
petla_pobierzp:
mov ah,8
int 21h
cmp al,13
je koniec_pobieraniap
cmp al,8
jne pobierzp_d2
backspacep:
cmp cx,1
je nie_backspacep
dec di
dec di
mov byte ptr es:[di],' '
inc cx
nie_backspacep:
jmp petla_pobierzp
pobierzp_d2:
cmp al,20h
jb petla_pobierzp
cmp al,7eh
ja petla_pobierzp
mov es:[di],al
inc di
inc di
loop petla_pobierzp
akceptujp:
mov ah,8
int 21h
cmp al,8
je backspacep
cmp al,13
jne akceptujp
koniec_pobieraniap:
pop es
pop di
pop dx
pop cx
pop ax
ret
ukryj_mysz:
push ax
mov ax,02h
int 33h
pop ax
ret
pokaz_mysz:
push ax
mov ax,01h
int 33h
pop ax
ret
ramka_plik_już_istnieje:
push cx
push dx
push si
call odtwarzaj_z_bufora
call rysuj_ramke
lea si,uwagatx
call naglowek
mov cx,23
mov dx,8
call wylicz_punkt
lea si,plik_istnieje
call wczytuj_napis
mov cx,23
mov dx,9
call wylicz_punkt
lea si,plik_istnieje2
call wczytuj_napis
call ramka_sprawdz_klawiature
pop si
pop dx
pop cx
ret
ramka_nie_ma_pliku:
push cx
push dx
push si
call odtwarzaj_z_bufora
call rysuj_ramke
lea si,uwagatx
call naglowek
mov cx,23
mov dx,8
call wylicz_punkt
lea si,nie_ma_pliku
call wczytuj_napis
mov cx,23
mov dx,9
call wylicz_punkt
lea si,nie_ma_pliku2
call wczytuj_napis
call ramka_sprawdz_klawiature
pop si
pop dx
pop cx
ret
ramka_nie_podano_nazwy:
push cx
push dx
push si
call odtwarzaj_z_bufora
call rysuj_ramke
lea si,uwagatx
call naglowek
mov cx,23
mov dx,8
call wylicz_punkt
lea si,nie_podano
call wczytuj_napis
mov cx,23
mov dx,9
call wylicz_punkt
lea si,nie_ma_pliku2
call wczytuj_napis
call ramka_sprawdz_klawiature
pop si
pop dx
pop cx
ret
ramka_nie_zapisano:
push ax
push cx
push dx
push si
mov ax,02h
int 33h
call odtwarzaj_z_bufora
call rysuj_ramke
lea si,uwagatx
call naglowek
mov cx,22
mov dx,8
call wylicz_punkt
lea si,nie_zapisano
call wczytuj_napis
mov cx,22
mov dx,9
call wylicz_punkt
lea si,nie_zapisano2
call wczytuj_napis
call rs_button_enter
mov ax,01h
int 33h
pop si
pop dx
pop cx
pop ax
ret
ramka_tylko_odczyt:
push ax
push cx
push dx
push si
mov ax,02h
int 33h
call odtwarzaj_z_bufora
call rysuj_ramke
lea si,uwagatx
call naglowek
mov cx,22
mov dx,8
call wylicz_punkt
lea si,tylko_odczyt
call wczytuj_napis
mov cx,22
mov dx,9
call wylicz_punkt
lea si,tylko_odczyt2
call wczytuj_napis
call rs_button_enter
mov ax,01h
int 33h
pop si
pop dx
pop cx
pop ax
ret
naglowek:
mov cx,37
mov dx,6
call wylicz_punkt
push bx
inc di
mov bl,00011111b
mov cx,6
call tlo_pod_linia
dec di
pop bx
call wczytuj_napis
ret
ramka_sprawdz_klawiature:
mov cx,25
mov dx,12
call wylicz_punkt
add di,3
mov byte ptr es:[di],00011111b
sub di,3
lea si,button_tak
call wczytuj_napis
mov cx,48
mov dx,12
call wylicz_punkt
add di,3
mov byte ptr es:[di],00011111b
sub di,3
lea si,button_nie
call wczytuj_napis
mov ah,8
petla_rs_klawiature:
int 21h
cmp al, ans_yes
jne rs_klawiature_d1
jmp rs_klawiature_koniec
rs_klawiature_d1:
cmp al, ans_no
jne rs_klawiature_d2
jmp rs_klawiature_koniec
rs_klawiature_d2:
jmp petla_rs_klawiature
rs_klawiature_koniec:
ret
rysuj_przycisk_enter:
call wylicz_punkt
push bx
push di
add di,3
mov bl,00011111b
mov cx,5
call tlo_pod_linia
pop di
pop bx
lea si,button_enter
call wczytuj_napis
ret
rs_button_enter:
push ax
mov cx,36
mov dx,12
call rysuj_przycisk_enter
mov ah,8
petla_button_enter:
int 21h
cmp al,13
jne petla_button_enter
pop ax
ret
wczytuj_napis:
cmp byte ptr ds:[si],'$'
je dalej
mov al,byte ptr ds:[si]
mov byte ptr es:[di],al
add di,2
inc si
jmp wczytuj_napis
dalej:
ret
tlo_pod_linia:
push cx
push di
petla:
mov byte ptr es:[di],bl
add di,2
loop petla
pop di
pop cx
ret
zapal_cofnij:
push di
push ax
push bx
push cx
push dx
mov cx,45
mov dx,1
call wylicz_punkt
inc di
mov bl,00011111b
mov cx,7
call tlo_pod_linia
pop dx
pop cx
pop bx
pop ax
pop di
ret
zgas_cofnij:
push di
push ax
push bx
push cx
push dx
mov cx,45
mov dx,1
call wylicz_punkt
inc di
mov bl,00010111b
mov cx,7
call tlo_pod_linia
pop dx
pop cx
pop bx
pop ax
pop di
ret
plansza_startowa:
push di
push ax
push bx
push cx
push dx
;ustawiam kursor
mov bh,0
mov dh,4
mov dl,0
mov ah,2
int 10h
;wypisuje logo
lea dx,main
mov ah,9
int 21h
;maluje tło
mov di,1
mov cx,2000
petla_plansza:
cmp byte ptr es:[di-1],'#'
jne niehasz
mov bl,01110010b
jmp dhasz
niehasz:
cmp byte ptr es:[di-1],'0'
jne nieznak2
mov bl,01111110b
jmp dhasz
nieznak2:
mov bl,00011001b
dhasz:
mov byte ptr es:[di],bl
inc di
inc di
loop petla_plansza
;ustawiam kursor
mov bh,0
mov dh,17
mov dl,35
mov ah,2
int 10h
;wypisuje by
lea dx,main2
mov ah,9
int 21h
;ustawiam kursor
mov bh,0
mov dh,16
mov dl,30
mov ah,2
int 10h
;wypisuje ascii painter
lea dx,main1
mov ah,9
int 21h
;ustawiam kursor
mov bh,0
mov dh,23
mov dl,35
mov ah,2
int 10h
;wypisuje press space
lea dx,main3
mov ah,9
int 21h
mov cx,35
mov dx,23
call wylicz_punkt
push bx
inc di
mov bl,10011111b
mov cx,13
call tlo_pod_linia
dec di
pop bx
;czekaj na start
mov ah,8
czekaj_na_start:
int 21h
cmp al,' '
jne czekaj_na_start
call wyczysc
pop dx
pop cx
pop bx
pop ax
pop di
ret
tlo_pod_menu:
mov di,1
mov bl,00011110b
mov cx,80
call tlo_pod_linia
mov di,161
mov bl,00011111b
call tlo_pod_linia
;na zielono ASCII
mov di,75
mov bl,00011010b
mov cx,3
call tlo_pod_linia
mov di,83
mov cx,2
call tlo_pod_linia
ret
start:
mov ax,@data
mov ds,ax
;robimy fullscreena :)
;mov ax,0013h
;int 10h
mov ax,0003h
int 10h
;chowaj kursor
mov ah,1
mov ch,15h
int 10h
mov ax,0b800h
mov es,ax
call plansza_startowa
call tlo_pod_menu
call pisz_menu
call zgas_cofnij
mov ax,0000h
int 33h
or ax,ax
jz koniec
mov ax,0001h
int 33h
call kursor_w_polu_rysowania
mov ax,0b800h
mov es,ax
petla2:
mov ax,0003h
int 33h
cmp dx,16
jb petla2
shr cx,3
shr dx,3
call wylicz_punkt
jmp main_command_loop
kontynuuj:
call kontrola_mychy
jmp petla2
czy_wcisniety1:
push ax
cmp byte ptr wcisniety,0
jne pomin
call ukryj_mysz
call kopiuj_do_bufora
call zapal_cofnij
mov byte ptr es:[di],al
call pokaz_mysz
mov byte ptr wcisniety,1
pomin:
pop ax
ret
koniec:
call pokaz_kursor
call sprzataj_ekran
mov ah,4ch
int 21h
main_command_loop:
mov ah,06h
mov dl,0ffh
int 21h
cmp al, cmd_save
jne nie_zapisuj
call modul_zapisz
jmp kontynuuj
nie_zapisuj:
cmp al, cmd_quit
je koniec
cmp al, cmd_clear
jne nie_wyczysc
mov ax,2
int 33h
call kopiuj_do_bufora
call wyczysc
call zapal_cofnij
mov ax,1
int 33h
jmp kontynuuj
nie_wyczysc:
cmp al, cmd_pen
jne nie_zmienp
call modul_zmienp
jmp kontynuuj
nie_zmienp:
cmp al, cmd_background
jne nie_zmient
call modul_zmient
jmp kontynuuj
nie_zmient:
cmp al, cmd_open
jne nie_otwieraj
call modul_otworz
jmp kontynuuj
nie_otwieraj:
cmp al, cmd_undo
jne nie_cofaj
mov ax,2
int 33h
call odtwarzaj_z_bufora
mov ax,1
int 33h
call zgas_cofnij
jmp kontynuuj
nie_cofaj:
cmp al, cmd_replace
jne nie_zamieniaj_znakow
call modul_znz
jmp kontynuuj
nie_zamieniaj_znakow:
cmp al, cmd_cut
jne nie_wycinaj
call modul_wycinaj
jmp kontynuuj
nie_wycinaj:
jmp kontynuuj
modul_wycinaj:
push ax
push bx
mov byte ptr opcje_flag,0
call ukryj_mysz
call kopiuj_do_bufora
call rysuj_ramke_wytnij
call ramka_wytnij_opcje
call pokaz_mysz
call zaznacz_opcje
pop bx
pop ax
call ukryj_mysz
call odtwarzaj_z_bufora
call pokaz_mysz
mov byte ptr mycha_flag,0
call zaznacz
call zaznacz2
call zaznacz3
call zapal_cofnij
ret
zaznacz:
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
petla_zaznacz:
mov ax,03h
int 33h
cmp dx,16
jb za_male_y
shr dx,3
shr cx,3
call wylicz_punkt
mov word ptr pwyt_x,cx
mov word ptr pwyt_y,dx
test bx,1
jz nie_kliknieto_lewym
inc di
mov ax,2
int 33h
mov byte ptr es:[di],01010000b
mov ax,1
int 33h
jmp koniec_zaznacz
za_male_y:
jmp petla_zaznacz
nie_kliknieto_lewym:
jmp petla_zaznacz
koniec_zaznacz:
mov byte ptr mycha_flag,1
POP SI
pop dx
POP CX
POP bx
POP ax
ret
zaznacz2:
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
petla_zaznacz2:
mov ax,03h
int 33h
cmp dx,16
jb za_male_y2
shr dx,3
shr cx,3
call wylicz_punkt
test bx,1
jz nie_kliknieto_lewym2
cmp byte ptr mycha_flag,1
je petla_zaznacz2
mov ax,0b800h
mov es,ax
inc di
mov ax,2
int 33h
mov byte ptr es:[di],01110000b
call porzadkuj_wspolrzedne
call maluj_zaznaczone
mov ax,1
int 33h
jmp koniec_zaznacz2
za_male_y2:
jmp petla_zaznacz2
nie_kliknieto_lewym2:
mov byte ptr mycha_flag,0
jmp petla_zaznacz2
koniec_zaznacz2:
mov byte ptr mycha_flag,1
POP SI
pop dx
POP CX
POP bx
POP ax
ret
porzadkuj_wspolrzedne:
push ax
cmp cx,word ptr pwyt_x
jae x2_wiekszerowne_x1
mov ax,word ptr pwyt_x
mov word ptr pwyt_x,cx
mov word ptr pwyt_x2,ax
jmp porzadkuj_y
x2_wiekszerowne_x1:
mov word ptr pwyt_x2,cx
porzadkuj_y:
cmp dx,word ptr pwyt_y
jae y2_wiekszerowne_y1
mov ax,word ptr pwyt_y
mov word ptr pwyt_y,dx
mov word ptr pwyt_y2,ax
jmp koniec_porzadkuj
y2_wiekszerowne_y1:
mov word ptr pwyt_y2,dx
koniec_porzadkuj:
pop ax
ret
maluj_zaznaczone:
push ax
push bx
push cx
push dx
mov cx,word ptr pwyt_x
mov dx,word ptr pwyt_y
call wylicz_punkt
inc di
mov ax,word ptr pwyt_x2
inc ax
sub ax,cx
petla_maluj:
push cx
mov cx,ax
mov bl,00000111b
call tlo_pod_linia
mov cx,word ptr pwyt_x
inc dx
call wylicz_punkt
pop cx
inc di
cmp dx,word ptr pwyt_y2
jna petla_maluj
pop dx
pop cx
pop bx
pop ax
ret
zaznacz3:
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
petla_zaznacz3:
mov ax,03h
int 33h
cmp dx,16
jb za_male_y3
shr dx,3
shr cx,3
call wylicz_punkt
test bx,1
jz nie_kliknieto_lewym3
cmp byte ptr mycha_flag,1
je petla_zaznacz3
inc di
mov ax,2
int 33h
call czysc_wklejone
test byte ptr opcje_flag,8
jnz bez_wklejania
call wklejaj_w_miejsce
bez_wklejania:
mov ax,1
int 33h
jmp koniec_zaznacz3
za_male_y3:
jmp petla_zaznacz3
nie_kliknieto_lewym3:
mov byte ptr mycha_flag,0
jmp petla_zaznacz3
koniec_zaznacz3:
mov byte ptr mycha_flag,1
POP SI
pop dx
POP CX
POP bx
POP ax
ret
odwracaj_parzyste:
cmp bl,'>'
jne odwracaj_parzyste_d1
mov bl,'<'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d1:
cmp bl,'<'
jne odwracaj_parzyste_d2
mov bl,'>'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d2:
cmp bl,'}'
jne odwracaj_parzyste_d3
mov bl,'{'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d3:
cmp bl,'{'
jne odwracaj_parzyste_d4
mov bl,'}'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d4:
cmp bl,')'
jne odwracaj_parzyste_d5
mov bl,'('
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d5:
cmp bl,'('
jne odwracaj_parzyste_d6
mov bl,')'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d6:
cmp bl,'/'
jne odwracaj_parzyste_d7
mov bl,'\'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d7:
cmp bl,'\'
jne odwracaj_parzyste_d8
mov bl,'/'
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d8:
cmp bl,']'
jne odwracaj_parzyste_d9
mov bl,'['
jmp koniec_odwracaj_parzyste
odwracaj_parzyste_d9:
cmp bl,'['
jne koniec_odwracaj_parzyste
mov bl,']'
koniec_odwracaj_parzyste:
ret
licz_szerokosc_zaznaczonego:
mov cx,word ptr pwyt_x
mov bx,word ptr pwyt_x2
sub bx,cx
inc bx
mov word ptr reverse,bx
ret
wklejaj_w_miejsce:
push bx
push si
call wylicz_punkt
mov si,di
call licz_szerokosc_zaznaczonego
mov dx,word ptr pwyt_y
mov cx,word ptr pwyt_x
call wylicz_punkt
petla_wklejaj_y:
petla_wklejaj_x:
call wylicz_punkt
push ax
push es
push di
mov ax,09000h
mov es,ax
test byte ptr opcje_flag,4
jz nie_odwracaj
add di,word ptr reverse
sub word ptr reverse,2
add di,word ptr reverse
nie_odwracaj:
mov bl,byte ptr es:[di]
test byte ptr opcje_flag,4
jz nie_odwracaj2
call odwracaj_parzyste
nie_odwracaj2:
pop di
pop es
pop ax
test byte ptr opcje_flag,1
jz nie_przezroczyste
cmp bl,byte ptr tlo
je tla_nie_rysuj
nie_przezroczyste:
mov byte ptr es:[si],bl
tla_nie_rysuj:
inc cx
inc si
inc si
cmp cx,word ptr pwyt_x2
jna petla_wklejaj_x
call licz_szerokosc_zaznaczonego
add si,160
shl bx,1
sub si,bx
inc dx
cmp dx,word ptr pwyt_y2
jna petla_wklejaj_y
pop si
pop bx
ret
czysc_wklejone:
push cx
push dx
mov dx,word ptr pwyt_y
mov cx,word ptr pwyt_x
call wylicz_punkt
petla_czyscw_y:
petla_czyscw_x:
call wylicz_punkt
test opcje_flag,2
jnz nie_zamazuj
mov al,byte ptr tlo
mov byte ptr es:[di],al
nie_zamazuj:
inc di
mov byte ptr es:[di],01110000b
inc cx
cmp cx,word ptr pwyt_x2
jna petla_czyscw_x
mov cx,word ptr pwyt_x
inc dx
cmp dx,word ptr pwyt_y2
jna petla_czyscw_y
pop dx
pop cx
ret
modul_znz:
mov ax,2
int 33h
call kopiuj_do_bufora
call rysuj_ramke
call ramka_zamien_na
call ramka_pobierz_znak_na_znak
push ax
push bx
mov ax,0b800h
mov es,ax
mov cx,25
mov dx,10
call wylicz_punkt
mov bh,byte ptr es:[di]
add di,10
mov bl,byte ptr es:[di]
call odtwarzaj_z_bufora
call zamien_znak_na_znak
pop bx
pop ax
call pokaz_mysz
call zapal_cofnij
ret
czy_otworzyc_menu:
ret
kontrola_mychy:
lea dx,pendzel
test bx,1
jz nie_lewy
cmp byte ptr mycha_flag,1
jne rysuj_pendzlem
mov byte ptr wcisniety,1
jmp koniec_mychy
rysuj_pendzlem:
mov al,byte ptr pendzel
call czy_wcisniety1
mov byte ptr es:[di],al
jmp koniec_mychy
nie_lewy:
test bx,2
jnz p_prawy
push dx
push ax
cmp byte ptr wcisniety,1
jne pomin2
mov byte ptr wcisniety,0
mov byte ptr mycha_flag,0
pomin2:
pop ax
pop dx
jmp koniec_mychy
p_prawy:
mov al,byte ptr tlo
call czy_wcisniety1
mov byte ptr es:[di],al
koniec_mychy:
ret
wylicz_punkt:
push ax
mov ax,dx
shl ax,2
add ax,dx
shl ax,4
add ax,cx
shl ax,1
mov di,ax
pop ax
ret
modul_zmienp:
mov ax,2
int 33h
call kopiuj_do_bufora
call rysuj_ramke
push si
lea si,zmien_pendzel
call ramka_zmien
pop si
call ramka_pobierz_pendzel
push si
lea si,pendzel
call zmien
pop si
call odtwarzaj_z_bufora
mov ax,1
int 33h
ret
modul_zmient:
mov ax,2
int 33h
call kopiuj_do_bufora
call rysuj_ramke
push si
lea si,zmien_tlo
call ramka_zmien
pop si
call ramka_pobierz_pendzel
push si
lea si,tlo
call zmien
pop si
call odtwarzaj_z_bufora
mov ax,1
int 33h
ret
utworz_plik:
mov cx,0
mov ax,seg plik
mov ds,ax
mov dx,offset plik
mov ah,3ch
int 21h
ret
zamknij_plik:
mov ah,3eh
lea dx,handle
mov bx,word ptr handle
int 21h
ret
zapisz:
lea dx,plik
mov ah,3dh
mov al,1
int 21h
jnc plik_otwarto
call utworz_plik
jc quitz
plik_otwarto:
lea dx,handle
mov word ptr handle,ax
mov ah,42h
mov al,2
xor dx,dx
xor cx,cx
int 21h
mov ax,0b800h
mov es,ax
mov dx,2 ;dx=y
petla_y:
mov cx,0 ;cx=x
petla_x:
push cx
push dx
call wylicz_punkt
lea dx,znak
mov al,byte ptr es:[di]
mov byte ptr znak,al
mov bx,word ptr handle
mov ah,40h
mov cx,1
int 21h
pop dx
pop cx
inc cx
cmp cx,80
jb petla_x
inc dx
push dx
lea dx,znak
mov al,13
mov byte ptr znak,al
mov bx,word ptr handle
mov ah,40h
mov cx,1
int 21h
lea dx,znak
mov al,10
mov byte ptr znak,al
mov bx,word ptr handle
mov ah,40h
mov cx,1
int 21h
pop dx
cmp dx,25
jb petla_y
quitz:
call zamknij_plik
ret
info_o_pliku:
lea dx,plik
mov ax,4300h
int 21h
jnc info_d1
cmp ax,5
jne info_d2
call ramka_nie_zapisano ;dostep nie możliwy
call odtwarzaj_z_bufora
jmp mzapisz_d3
info_d2:
jmp mzapisz_d1 ;nie ma pliku (jeszcze)
info_d1:
and cx,01h
cmp cx,00h
jne info_nie_zywkly
call ramka_plik_już_istnieje
call odtwarzaj_z_bufora
cmp al,'n'
je petla_mzapisz
jmp mzapisz_d1
info_nie_zywkly:
cmp cx,02h
jne info_nie_ukryty
call ramka_plik_już_istnieje ;ukryty
call odtwarzaj_z_bufora
cmp al,'n'
je petla_mzapisz
jmp mzapisz_d1
info_nie_ukryty:
call ramka_tylko_odczyt ;tylko do odczytu
call odtwarzaj_z_bufora
jmp mzapisz_d3
modul_zapisz:
push ax
push bx
call kursor_w_polu_plikow
call ukryj_mysz
call kopiuj_do_bufora
petla_mzapisz:
mov word ptr ile_wyswietlono,14
call rysuj_ramke_oz
call buforuj_znalezione
mov si,4002
call wyswietl_znalezione
push si
lea si,zapisztx
call ramka_oz
pop si
call pokaz_mysz
call ramka_pobierz_nazwe
call ramka_bufwczytaj_nazwe
lea dx,plik
push di
mov di,dx
cmp byte ptr ds:[di],'.'
pop di
jne mzapisz_d2
call ukryj_mysz
call ramka_nie_podano_nazwy
cmp al,'n'
jne petla_mzapisz
call odtwarzaj_z_bufora
call pokaz_mysz
jmp mzapisz_d3
mzapisz_d2:
call ukryj_mysz
jmp info_o_pliku
mzapisz_d1:
call odtwarzaj_z_bufora
call zapisz
mzapisz_d3:
call kursor_w_polu_rysowania
call pokaz_mysz
pop bx
pop ax
ret
otworz:
lea dx,plik
mov ah,3dh
mov al,0
int 21h
jnc next
ret
next:
lea dx,handle
mov word ptr handle,ax
mov ah,42h
mov al,0
xor dx,dx
xor cx,cx
int 21h
mov ax,0b800h
mov es,ax
mov dx,2 ;dx=y
push cx
push dx
opetla_y:
pop dx
pop cx
mov cx,0 ;cx=x
opetla_x:
push cx
push dx
call wylicz_punkt
lea dx,znak
mov bx,word ptr handle
mov cx,1
mov ah,3fh
int 21h
cmp ax,cx
jne quit
mov al,byte ptr znak
cmp al,13
je d1
cmp al,10
je d3
mov byte ptr es:[di],al
pop dx
pop cx
inc cx
push cx
push dx
d1:
pop dx
pop cx
cmp cx,80
jbe opetla_x
push cx
push dx
d3:
pop dx
pop cx
inc dx
push cx
push dx
cmp dx,25
jbe opetla_y
quit:
pop dx
pop cx
call zamknij_plik
ret
kursor_W_polu_plikow:
mov ax,08h
mov cx,72
mov dx,140
int 33h
mov ax,07h
mov cx,200
mov dx,448
int 33h
ret
kursor_w_polu_rysowania:
mov ax,08h
mov cx,16
mov dx,199
int 33h
mov ax,07h
mov cx,0
mov dx,632
int 33h
ret
modul_otworz:
push ax
push bx
call kursor_w_polu_plikow
call ukryj_mysz
call kopiuj_do_bufora
petla_otworz:
mov byte ptr mycha_flag,1
mov word ptr ile_wyswietlono,14
call rysuj_ramke_oz
call buforuj_znalezione
mov si,4002
call wyswietl_znalezione
push si
lea si,otworztx
call ramka_oz
pop si
call pokaz_mysz
call ramka_pobierz_nazwe
call ramka_bufwczytaj_nazwe
push di
lea di,plik
cmp byte ptr ds:[di],'.'
pop di
jne motworz_d2
call ukryj_mysz
call ramka_nie_podano_nazwy
cmp al,'n'
jne petla_otworz
call odtwarzaj_z_bufora
call pokaz_mysz
jmp motworz_d1
motworz_d2:
call ukryj_mysz
call wyczysc
call otworz
call pokaz_mysz
jnc motworz_d1
call ukryj_mysz
call ramka_nie_ma_pliku
cmp al, ans_yes
je petla_otworz
call ukryj_mysz
call odtwarzaj_z_bufora
call pokaz_mysz
motworz_d1:
call zapal_cofnij
call kursor_w_polu_rysowania
call pokaz_mysz
pop bx
pop ax
ret
wyczysc:
mov ax,02h
int 33h
mov ax,0b800h
mov es,ax
mov dx,2
mov cx,0
call wylicz_punkt
lea dx,tlo
mov al,byte ptr tlo
mov ah,01110000b
mov cx,1840
rep stosw
mov ax,01h
int 33h
ret
pisz_menu:
mov di,74
lea si,napis
call wczytuj_napis
mov di,162
lea si,menu
call wczytuj_napis
mov di,280
lea dx,pendzel
mov al,byte ptr pendzel
mov byte ptr es:[di],al
mov al,10111110b
mov byte ptr es:[di+1],al
mov di,284
lea si,menu1
call wczytuj_napis
mov di,314
lea dx,tlo
mov al,byte ptr tlo
mov byte ptr es:[di],al
mov al,10111110b
mov byte ptr es:[di+1],al
ret
zmien:
push ax
push cx
push dx
push di
mov cx,25
mov dx,10
call wylicz_punkt
mov al,byte ptr es:[di]
mov byte ptr ds:[si],al
call pisz_menu
pop di
pop dx
pop cx
pop ax
ret
pokaz_kursor:
mov ah,1
mov ch,6
mov cl,7
int 10h
ret
sprzataj_ekran:
mov ax,2
int 33h
mov ax,0b800h
mov es,ax
mov di,0
mov al,' '
mov ah,00000111b
mov cx,2000
rep stosw
ret
END start
| 13.565657 | 650 | 0.782025 |
3170a7c2f8e31a56fc6d28ed685c5c4adeaf66b1 | 4,061 | asm | Assembly | src/tty.asm | InsaneMiner/tinyvale | 16f1a29c1e0efed4f3317c3b9a782a59b32157c0 | [
"BSD-3-Clause"
] | 11 | 2021-04-25T13:17:25.000Z | 2021-06-10T13:22:54.000Z | src/tty.asm | InsaneMiner/tinyvale | 16f1a29c1e0efed4f3317c3b9a782a59b32157c0 | [
"BSD-3-Clause"
] | null | null | null | src/tty.asm | InsaneMiner/tinyvale | 16f1a29c1e0efed4f3317c3b9a782a59b32157c0 | [
"BSD-3-Clause"
] | 1 | 2021-05-19T23:43:37.000Z | 2021-05-19T23:43:37.000Z | ; BSD 3-Clause License
; Copyright (c) 2021, AtieP
; All rights reserved.
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; 1. Redistributions of source code must retain the above copyright notice, this
; list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; 3. Neither the name of the copyright holder nor the names of its
; contributors may be used to endorse or promote products derived from
; this software without specific prior written permission.
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
; WARNING: VERY BAD CODE ALERT, THIS CAN BE DONE A LOT BETTER
; Terminal for both kernel use and bootloader use
tty_gfx: db 0 ; 1 if using VBE
tty_pos_x: dw 0
tty_pos_y: dw 0
; Default textmode VGA cols and rows, can be changed later
tty_cols: dw 80
tty_rows: dw 25
tty_pitch: dw 0 ; unused in VGA mode
; Matches 16 bit VGA colors to VBE colors
tty_color_hasmap:
dd 0x000000 ; Black
dd 0 ; Blue
dd 0 ; Green
dd 0 ; Cyan
dd 0 ; Red
dd 0 ; Magenta
dd 0 ; Brown
dd 0 ; Light gray
dd 0 ; Dark gray
dd 0 ; Light blue
dd 0 ; Light green
dd 0 ; Light cyan
dd 0 ; Light red
dd 0 ; Light magenta
dd 0 ; Yellow
dd 0 ; White
; Prints a char into the TTY
; IN: BX = char, CL = 4-bit foreground and background colors
tty_putc:
push eax
push ebx
push edx
pushf
%ifdef __QEMU__
push ax
mov al, bl
out 0xe9, al
pop ax
%endif
mov al, [tty_gfx]
jz .vga
.vga:
cmp bx, 0x0a
je .newline
; get position
mov ax, [tty_pos_y]
mul word [tty_cols]
add ax, [tty_pos_x]
shl ax, 1 ; mul by two
and eax, 0xffff ; clear highest 16 bits
xchg ax, bx
or ah, cl
mov [0xb8000+ebx], ax
inc word [tty_pos_x]
mov ax, [tty_cols]
cmp [tty_pos_x], word ax
je .newline
.check_scroll:
mov ax, [tty_rows]
cmp [tty_pos_y], word ax
je .scroll
jmp .return
.scroll:
jmp .return
.newline:
mov [tty_pos_x], word 0
inc word [tty_pos_y]
jmp .check_scroll
.return:
popf
pop edx
pop ebx
pop eax
ret
; Prints a string into the TTY
; IN: EBX = string, CL = 4-bit foreground and background colors
tty_puts:
push eax
push ebx
push esi
pushf
mov esi, ebx
.loop:
lodsb
test al, al
jz .end
movzx bx, al
call tty_putc
jmp .loop
.end:
popf
pop esi
pop ebx
pop eax
ret
; Clears the TTY screen
; IN: BL = 4-bit foreground and background colors
tty_cls:
push eax
push ebx
push ecx
push edx
pushf
push bx
movzx eax, word [tty_cols]
movzx ebx, word [tty_rows]
mul ebx
mov ecx, eax
mov dl, [tty_gfx]
jz .vga
.vga:
pop bx
mov al, ' ' ; NULL doesn't seem to work
or ah, bl
xor ebx, ebx
.vga.loop:
mov [0xb8000+ebx], ax
add ebx, 2
loop .vga.loop
jmp .return
.return:
mov [tty_pos_x], word 0
mov [tty_pos_y], word 0
popf
pop edx
pop ecx
pop ebx
pop eax
ret
| 21.601064 | 80 | 0.66954 |
cf73e37ef54504365160054ec334a2302131c3c5 | 3,994 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1978.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_1978.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_1978.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 %r12
push %r14
push %rbp
push %rbx
push %rdx
push %rsi
// Store
mov $0x1261a80000000543, %r10
nop
nop
nop
nop
sub $30833, %rsi
mov $0x5152535455565758, %r12
movq %r12, %xmm1
movups %xmm1, (%r10)
nop
nop
add $19807, %r10
// Faulty Load
lea addresses_UC+0xcfd3, %rbp
cmp %rbx, %rbx
movb (%rbp), %r12b
lea oracles, %rbx
and $0xff, %r12
shlq $12, %r12
mov (%rbx,%r12,1), %r12
pop %rsi
pop %rdx
pop %rbx
pop %rbp
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'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
*/
| 70.070175 | 2,999 | 0.662494 |
f533e0fda71421708ce06d77ca13ac80354f2132 | 1,082 | asm | Assembly | Multiply-Two-Digit.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | 1 | 2022-01-13T07:29:30.000Z | 2022-01-13T07:29:30.000Z | Multiply-Two-Digit.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | null | null | null | Multiply-Two-Digit.asm | MahmoudAbusaqer/Assembly-Language-Course-Assignments | 1c77d3e650102ea8d0232c5e4d5d0274bbce0c76 | [
"Apache-2.0"
] | null | null | null | name 'multiply-two-digit'
.model small
.data
msg1 db "Enter First Number: $"
msg2 db 0ah,0dh ,"Enter second Number: $ "
msg3 db 0ah,0dh ,"Result of multiply is: $ "
num1 db ?
num2 db ?
result db ?
.code
mov ax ,DATA;move data to data segment
mov ds,ax
;print msg1
mov ah,09h
lea dx,msg1
int 21h
;read character 1
mov ah,01h
int 21h
;store char to num1
mov num1,al
;print msg2
mov ah,09h
lea dx,msg2
int 21h
;read character2
mov ah,01h
int 21h
;store char to num2
mov num2,al
;multiply
mov al,num1
sub al,30h ;convert to decimal
mov bl,num2
sub bl,30h ;convert to decimal
mul bl
add al,30h ;convert to ascii code
mov result,al
;print msg3
mov ah,09h
lea dx,msg3
int 21h
;print result
mov ah,02h
mov dl,result
int 21h
EXIT:
mov ah,4ch
int 21h
end | 16.393939 | 49 | 0.507394 |
4cfcfb0af414c9a76d6119c2f9ba6f40233e7753 | 409 | asm | Assembly | oeis/143/A143198.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/143/A143198.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/143/A143198.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A143198: Triangle t(n,m) = n +(n+1)*(m-1)*(m+2)/2 read by rows, 0<=m<=n.
; Submitted by Christian Krause
; -1,-1,1,-1,2,8,-1,3,11,23,-1,4,14,29,49,-1,5,17,35,59,89,-1,6,20,41,69,104,146,-1,7,23,47,79,119,167,223,-1,8,26,53,89,134,188,251,323,-1,9,29,59,99,149,209,279,359,449,-1,10,32,65,109,164,230,307,395,494,604
lpb $0
add $1,1
sub $0,$1
lpe
add $0,1
bin $0,2
add $1,1
mul $1,$0
sub $1,1
mov $0,$1
| 27.266667 | 210 | 0.596577 |
06a91181010df894bfc4bd4d75216985564561ff | 531 | asm | Assembly | tests/x87_f.asm | notaz/ia32rtools | 75b4a70dafd7faf3c27b963fa8e67462538f91d4 | [
"BSD-3-Clause"
] | 55 | 2015-01-27T01:10:27.000Z | 2022-03-27T05:35:08.000Z | tests/x87_f.asm | notaz/ia32rtools | 75b4a70dafd7faf3c27b963fa8e67462538f91d4 | [
"BSD-3-Clause"
] | null | null | null | tests/x87_f.asm | notaz/ia32rtools | 75b4a70dafd7faf3c27b963fa8e67462538f91d4 | [
"BSD-3-Clause"
] | 9 | 2015-08-16T03:27:24.000Z | 2020-10-28T05:14:52.000Z |
_text segment para public 'CODE' use32
sub_test proc near
var_4 = dword ptr -4
push ebp
mov ebp, esp
sub esp, 4
mov [ebp+var_4], 4
fild [ebp+var_4]
fild [ebp+var_4]
fsqrt
fpatan
call __ftol
mov esp, ebp
pop ebp
retn
sub_test endp
_text ends
; vim:expandtab
| 21.24 | 48 | 0.363465 |
2becc06e708f3efb37a7feb2dc0ab76200df387e | 1,110 | asm | Assembly | programs/oeis/131/A131466.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/131/A131466.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/131/A131466.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A131466: a(n) = 5n^4 - 4n^3 + 3n^2 - 2n + 1.
; 1,3,57,319,1065,2691,5713,10767,18609,30115,46281,68223,97177,134499,181665,240271,312033,398787,502489,625215,769161,936643,1130097,1352079,1605265,1892451,2216553,2580607,2987769,3441315,3944641,4501263,5114817,5789059,6527865,7335231,8215273,9172227,10210449,11334415,12548721,13858083,15267337,16781439,18405465,20144611,22004193,23989647,26106529,28360515,30757401,33303103,36003657,38865219,41894065,45096591,48479313,52048867,55812009,59775615,63946681,68332323,72939777,77776399,82849665,88167171,93736633,99565887,105662889,112035715,118692561,125641743,132891697,140450979,148328265,156532351,165072153,173956707,183195169,192796815,202771041,213127363,223875417,235024959,246585865,258568131,270981873,283837327,297144849,310914915,325158121,339885183,355106937,370834339,387078465,403850511,421161793,439023747,457447929,476446015
mov $4,$0
bin $0,2
mov $3,$0
mul $0,4
mov $1,2
mov $2,8
sub $4,$3
pow $3,2
add $4,$0
div $0,2
add $0,1
add $2,$0
sub $3,2
pow $4,2
add $3,$4
add $3,$2
mul $3,9
add $1,$3
sub $1,65
div $1,9
mul $1,2
add $1,1
mov $0,$1
| 41.111111 | 844 | 0.792793 |
5c90f8bd29eda4feaf448dce624c7b29878ec236 | 3,140 | asm | Assembly | programs/oeis/192/A192832.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/192/A192832.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/192/A192832.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A192832: Molecular topological indices of the lattice graphs.
; 0,48,576,2880,9600,25200,56448,112896,207360,356400,580800,906048,1362816,1987440,2822400,3916800,5326848,7116336,9357120,12129600,15523200,19636848,24579456,30470400,37440000,45630000,55194048,66298176,79121280,93855600,110707200,129896448,151658496,176243760,203918400,234964800,269682048,308386416,351411840,399110400,451852800,510028848,574047936,644339520,721353600,805561200,897454848,997549056,1106380800,1224510000,1352520000,1491018048,1640635776,1802029680,1975881600,2162899200,2363816448,2579394096,2810420160,3057710400,3322108800,3604488048,3905750016,4226826240,4568678400,4932298800,5318710848,5728969536,6164161920,6625407600,7113859200,7630702848,8177158656,8754481200,9363960000,10006920000,10684722048,11398763376,12150478080,12941337600,13772851200,14646566448,15564069696,16526986560,17536982400,18595762800,19705074048,20866703616,22082480640,23354276400,24684004800,26073622848,27525131136,29040574320,30622041600,32271667200,33991630848,35784158256,37651521600,39596040000,41620080000,43726056048,45916430976,48193716480,50560473600,53019313200,55572896448,58223935296,60975192960,63829484400,66789676800,69858690048,73039497216,76335125040,79748654400,83283220800,86942014848,90728282736,94645326720,98696505600,102885235200,107214988848,111689297856,116311752000,121086000000,126015750000,131104770048,136356888576,141775994880,147366039600,153131035200,159075056448,165202240896,171516789360,178022966400,184725100800,191627586048,198734880816,206051509440,213582062400,221331196800,229303636848,237504174336,245937669120,254609049600,263523313200,272685526848,282100827456,291774422400,301711590000,311917680000,322398114048,333158386176,344204063280,355540785600,367174267200,379110296448,391354736496,403913525760,416792678400,429998284800,443536512048,457413604416,471635883840,486209750400,501141682800,516438238848,532106055936,548151851520,564582423600,581404651200,598625494848,616251997056,634291282800,652750560000,671637120000,690958338048,710721673776,730934671680,751604961600,772740259200,794348366448,816437172096,839014652160,862088870400,885667978800,909760218048,934373918016,959517498240,985199468400,1011428428800,1038213070848,1065562177536,1093484623920,1121989377600,1151085499200,1180782142848,1211088556656,1242014083200,1273568160000,1305760320000,1338600192048,1372097501376,1406262070080,1441103817600,1476632761200,1512859016448,1549792797696,1587444418560,1625824292400,1664942932800,1704810954048,1745439071616,1786838102640,1829018966400,1871992684800,1915770382848,1960363289136,2005782736320,2052040161600,2099147107200,2147115220848,2195956256256,2245682073600,2296304640000,2347836030000,2400288426048,2453674118976,2508005508480,2563295103600,2619555523200,2676799496448,2735039863296,2794289574960,2854561694400,2915869396800,2978225970048,3041644815216,3106139447040,3171723494400,3238410700800,3306214924848,3375150140736,3445230438720,3516470025600,3588883225200,3662484478848,3737288345856,3813309504000,3890562750000
add $0,1
mov $2,$0
pow $0,2
bin $0,2
sub $2,1
mul $0,$2
mov $1,$0
div $1,6
mul $1,48
| 241.538462 | 2,989 | 0.903185 |
66a7857dbe29bbb3d261982474282a2037c1b8fc | 4,142 | asm | Assembly | old/tst1.asm | Jaxartes/vtj1 | be3104979af26f9a9b92eced120987aaf9151c7e | [
"BSD-2-Clause-NetBSD"
] | null | null | null | old/tst1.asm | Jaxartes/vtj1 | be3104979af26f9a9b92eced120987aaf9151c7e | [
"BSD-2-Clause-NetBSD"
] | null | null | null | old/tst1.asm | Jaxartes/vtj1 | be3104979af26f9a9b92eced120987aaf9151c7e | [
"BSD-2-Clause-NetBSD"
] | null | null | null | ; Copyright (c) 2015 Jeremy Dilatush
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; 1. Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY JEREMY DILATUSH AND CONTRIBUTORS
; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JEREMY DILATUSH OR CONTRIBUTORS
; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
; First test program for the "VTJ-1" system running on FPGA. See system
; documentation. This test is quite minimal: It sets LEDs and tries to
; write characters to the serial port. All without interrupts.
cpu 6502
code
; Basic system info
RAMBASE = $0000 ; start of general purpose RAM
RAMTOP = $0800 ; byte after the last one of general purpose RAM
ROMBASE = $c000 ; start of ROM
LEDOUT = $b280 ; write LED state
SER_BASE = $b800 ; base of serial port registers
SER_INFO = $0 ; offset of serial port information byte
SER_TX = $1 ; register to transmit a byte
SER_RX = $2 ; register to receive a byte
SER_ST = $3 ; register to query device status
SER_TA = $4 ; transmit control byte A
SER_TB = $5 ; transmit control byte B
SER_RA = $6 ; receive control byte A
SER_RB = $7 ; receive control byte B
SER_LBL = $10 ; start of an ASCIIZ label
ICTL_ENA0 = $b000 ; interrupt control: enable slot 0-7 alpha IRQs
ICTL_ENA1 = $b001 ; interrupt control: enable slot 8-15 alpha IRQs
ICTL_ENB0 = $b008 ; interrupt control: enable slot 0-7 beta IRQs
ICTL_ENB1 = $b009 ; interrupt control: enable slot 8-15 beta IRQs
ICTL_PEA0 = $b040 ; interrupt control: pending slot 0-7 alpha IRQs
ICTL_PEA1 = $b041 ; interrupt control: pending slot 8-15 alpha IRQs
ICTL_PEB0 = $b048 ; interrupt control: pending slot 0-7 beta IRQs
ICTL_PEB1 = $b049 ; interrupt control: pending slot 8-15 beta IRQs
; Addresses we use for particular things
ledreg = $10 ; keep track of LED state
chareg = $11 ; keep track of output character
* = ROMBASE
start = *
; Here's where the code will be when reset is done.
; disable interrupts; this program doesn't use them
sei
; Update the LED state variable, which may be retained across resets.
; Updated by adding 23 each time.
lda ledreg
clc
adc #23
sta ledreg
; And put that out on the LEDs
and #$1f
sta LEDOUT
; Set up the serial port for output.
lda #$15 ; 9600 baud
sta SER_BASE+SER_TA
lda #$30 ; 8n2
sta SER_BASE+SER_TB
char_init = *
; Initialize the character we'll output
lda #33
sta chareg
; Main loop: output characters
main_loop = *
; Check for readiness: slot 8's beta IRQ
lda ICTL_PEB1 ; beta IRQs of slots 8-15
and #1 ; select slot 8
beq main_loop ; not ready
; It's ready; write the character
lda chareg
sta SER_BASE+SER_TX
; Pick the next character and repeat
clc
adc #1
cmp #127
sta chareg
bne main_loop ; ok to repeat with next byte value
beq char_init ; repeat after starting the character sequence
* = $fffa
dw start ; NMI vector (shouldn't run - no sources of NMI)
dw start ; reset vector
dw start ; IRQ/BRK vector (shouldn't run - no BRK, interrupts never enabled)
| 36.654867 | 80 | 0.718976 |
45a7310c6cb155f55f53c381ac3e62a7c21ac460 | 1,850 | asm | Assembly | programs/oeis/157/A157324.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/157/A157324.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/157/A157324.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A157324: a(n) = 36*n^2 + n.
; 37,146,327,580,905,1302,1771,2312,2925,3610,4367,5196,6097,7070,8115,9232,10421,11682,13015,14420,15897,17446,19067,20760,22525,24362,26271,28252,30305,32430,34627,36896,39237,41650,44135,46692,49321,52022,54795,57640,60557,63546,66607,69740,72945,76222,79571,82992,86485,90050,93687,97396,101177,105030,108955,112952,117021,121162,125375,129660,134017,138446,142947,147520,152165,156882,161671,166532,171465,176470,181547,186696,191917,197210,202575,208012,213521,219102,224755,230480,236277,242146,248087,254100,260185,266342,272571,278872,285245,291690,298207,304796,311457,318190,324995,331872,338821,345842,352935,360100,367337,374646,382027,389480,397005,404602,412271,420012,427825,435710,443667,451696,459797,467970,476215,484532,492921,501382,509915,518520,527197,535946,544767,553660,562625,571662,580771,589952,599205,608530,617927,627396,636937,646550,656235,665992,675821,685722,695695,705740,715857,726046,736307,746640,757045,767522,778071,788692,799385,810150,820987,831896,842877,853930,865055,876252,887521,898862,910275,921760,933317,944946,956647,968420,980265,992182,1004171,1016232,1028365,1040570,1052847,1065196,1077617,1090110,1102675,1115312,1128021,1140802,1153655,1166580,1179577,1192646,1205787,1219000,1232285,1245642,1259071,1272572,1286145,1299790,1313507,1327296,1341157,1355090,1369095,1383172,1397321,1411542,1425835,1440200,1454637,1469146,1483727,1498380,1513105,1527902,1542771,1557712,1572725,1587810,1602967,1618196,1633497,1648870,1664315,1679832,1695421,1711082,1726815,1742620,1758497,1774446,1790467,1806560,1822725,1838962,1855271,1871652,1888105,1904630,1921227,1937896,1954637,1971450,1988335,2005292,2022321,2039422,2056595,2073840,2091157,2108546,2126007,2143540,2161145,2178822,2196571,2214392,2232285,2250250
add $0,1
mov $1,$0
mov $2,6
mul $2,$0
pow $2,2
add $1,$2
| 185 | 1,761 | 0.84 |
4edcfd1367c4ad484769b0be1fcaa646c3836790 | 322 | asm | Assembly | programs/oeis/226/A226238.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/226/A226238.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/226/A226238.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A226238: a(n) = (n^n - n)/(n - 1).
; 2,12,84,780,9330,137256,2396744,48427560,1111111110,28531167060,810554586204,25239592216020,854769755812154,31278135027204240,1229782938247303440,51702516367896047760,2314494592664502210318,109912203092239643840220
add $0,2
mov $1,$0
pow $1,$0
sub $0,1
sub $1,2
div $1,$0
mov $0,$1
| 29.272727 | 216 | 0.763975 |
eea6a69fbea239ad82b34dfd1710d347efc923ac | 786 | asm | Assembly | MIPS_CPU/P7/test_asm/mips3.asm | CPUmaker/ComputerOrganizationDesign | 30c078a4f284845c68899be417028d704293a52b | [
"MIT"
] | 55 | 2021-09-06T12:12:47.000Z | 2022-01-15T04:30:53.000Z | MIPS_CPU/P7/test_asm/mips3.asm | CPUmaker/ComputerOrganizationDesign | 30c078a4f284845c68899be417028d704293a52b | [
"MIT"
] | null | null | null | MIPS_CPU/P7/test_asm/mips3.asm | CPUmaker/ComputerOrganizationDesign | 30c078a4f284845c68899be417028d704293a52b | [
"MIT"
] | null | null | null | .text 0x00003000
li $s0, 0x00007f00
li $t0, 0x00000010
li $t1, 0x00000009
sw $t0, 4($s0)
sw $t1, 0($s0)
li $s0, 0x00007f10
li $t0, 0x00000111
li $t1, 0x0000000b
sw $t0, 4($s0)
sw $t1, 0($s0)
ori $v0, $0, 0xff11
mtc0 $v0, $12
go:
beq $0, $0, go
nop
.ktext 0x00004180
mfc0 $k0, $13
mfc0 $k1, $14
srl $k0, $k0, 2
andi $k0, $k0, 0x001f
beq $k0, $0, return
nop
addiu $k1, $k1, 4
mtc0 $k1, $14
eret
return:
mfc0 $k0, $13
srl $k0, $k0, 10
andi $k0, $k0, 0x003f
li $t0, 1
li $t1, 2
li $t2, 4
or $v0, $t0, $k0
beq $v0, $0, pass1
nop
pass1:
or $v0, $t0, $k0
beq $v0, $0, pass2
nop
li $s0, 0x00007f00
lw $t0, 0($s0)
ori $t0, $t0, 0x0001
sw $t0, 0($s0)
j pass3
pass2:
or $v0, $t0, $k0
beq $v0, $0, pass3
nop
lw $a0, 0($0)
addiu $a0, $a0, 1
sw $a0, 0($0)
j pass3
pass3:
eret
ori $s0, $0, 0xffff | 12.885246 | 21 | 0.600509 |
0f5266c89b5b5cfa03a48f0958e6cf7ef66fc316 | 636 | asm | Assembly | oeis/006/A006675.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/006/A006675.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/006/A006675.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A006675: Number of paths through an array.
; Submitted by Jamie Morken(s2)
; 0,0,2,15,104,770,6264,56196,554112,5973264,69998400,886897440,12089295360,176484597120,2748022986240,45472329504000,796983880089600,14751208762214400,287543058350284800,5888480881767321600,126400920571699200000,2838231240777676800000,66538473134272634880000,1625799848012986060800000,41336131551971499048960000,1091972969209255440384000000,29930240548544872743567360000,850086767907695745624637440000,24988889309042582918639124480000,759400901597482996046525890560000
sub $2,$0
sub $3,$0
lpb $0
mul $2,$0
sub $2,$3
mul $3,$0
sub $0,1
lpe
mov $0,$2
| 45.428571 | 469 | 0.845912 |
88ef154bd435c3120b9ea2ee8779287eb5804034 | 87,548 | asm | Assembly | obj/user/buggyhello2.asm | SongBiu/JOS | ab9a797ce65b963bd46df8eaa3eb43bd7cc85863 | [
"Apache-2.0"
] | null | null | null | obj/user/buggyhello2.asm | SongBiu/JOS | ab9a797ce65b963bd46df8eaa3eb43bd7cc85863 | [
"Apache-2.0"
] | null | null | null | obj/user/buggyhello2.asm | SongBiu/JOS | ab9a797ce65b963bd46df8eaa3eb43bd7cc85863 | [
"Apache-2.0"
] | null | null | null |
obj/user/buggyhello2: file format elf32-i386
Disassembly of section .text:
00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
// See if we were started with arguments on the stack
cmpl $USTACKTOP, %esp
800020: 81 fc 00 e0 bf ee cmp $0xeebfe000,%esp
jne args_exist
800026: 75 04 jne 80002c <args_exist>
// If not, push dummy argc/argv arguments.
// This happens when we are loaded by the kernel,
// because the kernel does not know about passing arguments.
pushl $0
800028: 6a 00 push $0x0
pushl $0
80002a: 6a 00 push $0x0
0080002c <args_exist>:
args_exist:
call libmain
80002c: e8 30 00 00 00 call 800061 <libmain>
1: jmp 1b
800031: eb fe jmp 800031 <args_exist+0x5>
00800033 <umain>:
const char *hello = "hello, world\n";
void
umain(int argc, char **argv)
{
800033: 55 push %ebp
800034: 89 e5 mov %esp,%ebp
800036: 53 push %ebx
800037: 83 ec 0c sub $0xc,%esp
80003a: e8 1e 00 00 00 call 80005d <__x86.get_pc_thunk.bx>
80003f: 81 c3 c1 1f 00 00 add $0x1fc1,%ebx
sys_cputs(hello, 1024*1024);
800045: 68 00 00 10 00 push $0x100000
80004a: ff b3 0c 00 00 00 pushl 0xc(%ebx)
800050: e8 8b 00 00 00 call 8000e0 <sys_cputs>
}
800055: 83 c4 10 add $0x10,%esp
800058: 8b 5d fc mov -0x4(%ebp),%ebx
80005b: c9 leave
80005c: c3 ret
0080005d <__x86.get_pc_thunk.bx>:
80005d: 8b 1c 24 mov (%esp),%ebx
800060: c3 ret
00800061 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";
void
libmain(int argc, char **argv)
{
800061: 55 push %ebp
800062: 89 e5 mov %esp,%ebp
800064: 57 push %edi
800065: 56 push %esi
800066: 53 push %ebx
800067: 83 ec 0c sub $0xc,%esp
80006a: e8 ee ff ff ff call 80005d <__x86.get_pc_thunk.bx>
80006f: 81 c3 91 1f 00 00 add $0x1f91,%ebx
800075: 8b 75 08 mov 0x8(%ebp),%esi
800078: 8b 7d 0c mov 0xc(%ebp),%edi
// set thisenv to point at our Env structure in envs[].
// LAB 3: Your code here.
thisenv = &envs[ENVX(sys_getenvid())];
80007b: e8 f2 00 00 00 call 800172 <sys_getenvid>
800080: 25 ff 03 00 00 and $0x3ff,%eax
800085: 8d 04 40 lea (%eax,%eax,2),%eax
800088: c1 e0 05 shl $0x5,%eax
80008b: 81 c0 00 00 c0 ee add $0xeec00000,%eax
800091: c7 c2 30 20 80 00 mov $0x802030,%edx
800097: 89 02 mov %eax,(%edx)
// save the name of the program so that panic() can use it
if (argc > 0)
800099: 85 f6 test %esi,%esi
80009b: 7e 08 jle 8000a5 <libmain+0x44>
binaryname = argv[0];
80009d: 8b 07 mov (%edi),%eax
80009f: 89 83 10 00 00 00 mov %eax,0x10(%ebx)
// call user main routine
umain(argc, argv);
8000a5: 83 ec 08 sub $0x8,%esp
8000a8: 57 push %edi
8000a9: 56 push %esi
8000aa: e8 84 ff ff ff call 800033 <umain>
// exit gracefully
exit();
8000af: e8 0b 00 00 00 call 8000bf <exit>
}
8000b4: 83 c4 10 add $0x10,%esp
8000b7: 8d 65 f4 lea -0xc(%ebp),%esp
8000ba: 5b pop %ebx
8000bb: 5e pop %esi
8000bc: 5f pop %edi
8000bd: 5d pop %ebp
8000be: c3 ret
008000bf <exit>:
#include <inc/lib.h>
void
exit(void)
{
8000bf: 55 push %ebp
8000c0: 89 e5 mov %esp,%ebp
8000c2: 53 push %ebx
8000c3: 83 ec 10 sub $0x10,%esp
8000c6: e8 92 ff ff ff call 80005d <__x86.get_pc_thunk.bx>
8000cb: 81 c3 35 1f 00 00 add $0x1f35,%ebx
sys_env_destroy(0);
8000d1: 6a 00 push $0x0
8000d3: e8 45 00 00 00 call 80011d <sys_env_destroy>
}
8000d8: 83 c4 10 add $0x10,%esp
8000db: 8b 5d fc mov -0x4(%ebp),%ebx
8000de: c9 leave
8000df: c3 ret
008000e0 <sys_cputs>:
return ret;
}
void
sys_cputs(const char *s, size_t len)
{
8000e0: 55 push %ebp
8000e1: 89 e5 mov %esp,%ebp
8000e3: 57 push %edi
8000e4: 56 push %esi
8000e5: 53 push %ebx
asm volatile("int %1\n"
8000e6: b8 00 00 00 00 mov $0x0,%eax
8000eb: 8b 55 08 mov 0x8(%ebp),%edx
8000ee: 8b 4d 0c mov 0xc(%ebp),%ecx
8000f1: 89 c3 mov %eax,%ebx
8000f3: 89 c7 mov %eax,%edi
8000f5: 89 c6 mov %eax,%esi
8000f7: cd 30 int $0x30
syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
8000f9: 5b pop %ebx
8000fa: 5e pop %esi
8000fb: 5f pop %edi
8000fc: 5d pop %ebp
8000fd: c3 ret
008000fe <sys_cgetc>:
int
sys_cgetc(void)
{
8000fe: 55 push %ebp
8000ff: 89 e5 mov %esp,%ebp
800101: 57 push %edi
800102: 56 push %esi
800103: 53 push %ebx
asm volatile("int %1\n"
800104: ba 00 00 00 00 mov $0x0,%edx
800109: b8 01 00 00 00 mov $0x1,%eax
80010e: 89 d1 mov %edx,%ecx
800110: 89 d3 mov %edx,%ebx
800112: 89 d7 mov %edx,%edi
800114: 89 d6 mov %edx,%esi
800116: cd 30 int $0x30
return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
800118: 5b pop %ebx
800119: 5e pop %esi
80011a: 5f pop %edi
80011b: 5d pop %ebp
80011c: c3 ret
0080011d <sys_env_destroy>:
int
sys_env_destroy(envid_t envid)
{
80011d: 55 push %ebp
80011e: 89 e5 mov %esp,%ebp
800120: 57 push %edi
800121: 56 push %esi
800122: 53 push %ebx
800123: 83 ec 1c sub $0x1c,%esp
800126: e8 66 00 00 00 call 800191 <__x86.get_pc_thunk.ax>
80012b: 05 d5 1e 00 00 add $0x1ed5,%eax
800130: 89 45 e4 mov %eax,-0x1c(%ebp)
asm volatile("int %1\n"
800133: b9 00 00 00 00 mov $0x0,%ecx
800138: 8b 55 08 mov 0x8(%ebp),%edx
80013b: b8 03 00 00 00 mov $0x3,%eax
800140: 89 cb mov %ecx,%ebx
800142: 89 cf mov %ecx,%edi
800144: 89 ce mov %ecx,%esi
800146: cd 30 int $0x30
if(check && ret > 0)
800148: 85 c0 test %eax,%eax
80014a: 7f 08 jg 800154 <sys_env_destroy+0x37>
return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
80014c: 8d 65 f4 lea -0xc(%ebp),%esp
80014f: 5b pop %ebx
800150: 5e pop %esi
800151: 5f pop %edi
800152: 5d pop %ebp
800153: c3 ret
panic("syscall %d returned %d (> 0)", num, ret);
800154: 83 ec 0c sub $0xc,%esp
800157: 50 push %eax
800158: 6a 03 push $0x3
80015a: 8b 5d e4 mov -0x1c(%ebp),%ebx
80015d: 8d 83 f4 ee ff ff lea -0x110c(%ebx),%eax
800163: 50 push %eax
800164: 6a 26 push $0x26
800166: 8d 83 11 ef ff ff lea -0x10ef(%ebx),%eax
80016c: 50 push %eax
80016d: e8 23 00 00 00 call 800195 <_panic>
00800172 <sys_getenvid>:
envid_t
sys_getenvid(void)
{
800172: 55 push %ebp
800173: 89 e5 mov %esp,%ebp
800175: 57 push %edi
800176: 56 push %esi
800177: 53 push %ebx
asm volatile("int %1\n"
800178: ba 00 00 00 00 mov $0x0,%edx
80017d: b8 02 00 00 00 mov $0x2,%eax
800182: 89 d1 mov %edx,%ecx
800184: 89 d3 mov %edx,%ebx
800186: 89 d7 mov %edx,%edi
800188: 89 d6 mov %edx,%esi
80018a: cd 30 int $0x30
return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
80018c: 5b pop %ebx
80018d: 5e pop %esi
80018e: 5f pop %edi
80018f: 5d pop %ebp
800190: c3 ret
00800191 <__x86.get_pc_thunk.ax>:
800191: 8b 04 24 mov (%esp),%eax
800194: c3 ret
00800195 <_panic>:
* It prints "panic: <message>", then causes a breakpoint exception,
* which causes JOS to enter the JOS kernel monitor.
*/
void
_panic(const char *file, int line, const char *fmt, ...)
{
800195: 55 push %ebp
800196: 89 e5 mov %esp,%ebp
800198: 57 push %edi
800199: 56 push %esi
80019a: 53 push %ebx
80019b: 83 ec 0c sub $0xc,%esp
80019e: e8 ba fe ff ff call 80005d <__x86.get_pc_thunk.bx>
8001a3: 81 c3 5d 1e 00 00 add $0x1e5d,%ebx
va_list ap;
va_start(ap, fmt);
8001a9: 8d 75 14 lea 0x14(%ebp),%esi
// Print the panic message
cprintf("[%08x] user panic in %s at %s:%d: ",
8001ac: c7 c0 10 20 80 00 mov $0x802010,%eax
8001b2: 8b 38 mov (%eax),%edi
8001b4: e8 b9 ff ff ff call 800172 <sys_getenvid>
8001b9: 83 ec 0c sub $0xc,%esp
8001bc: ff 75 0c pushl 0xc(%ebp)
8001bf: ff 75 08 pushl 0x8(%ebp)
8001c2: 57 push %edi
8001c3: 50 push %eax
8001c4: 8d 83 20 ef ff ff lea -0x10e0(%ebx),%eax
8001ca: 50 push %eax
8001cb: e8 d1 00 00 00 call 8002a1 <cprintf>
sys_getenvid(), binaryname, file, line);
vcprintf(fmt, ap);
8001d0: 83 c4 18 add $0x18,%esp
8001d3: 56 push %esi
8001d4: ff 75 10 pushl 0x10(%ebp)
8001d7: e8 63 00 00 00 call 80023f <vcprintf>
cprintf("\n");
8001dc: 8d 83 e8 ee ff ff lea -0x1118(%ebx),%eax
8001e2: 89 04 24 mov %eax,(%esp)
8001e5: e8 b7 00 00 00 call 8002a1 <cprintf>
8001ea: 83 c4 10 add $0x10,%esp
// Cause a breakpoint exception
while (1)
asm volatile("int3");
8001ed: cc int3
8001ee: eb fd jmp 8001ed <_panic+0x58>
008001f0 <putch>:
};
static void
putch(int ch, struct printbuf *b)
{
8001f0: 55 push %ebp
8001f1: 89 e5 mov %esp,%ebp
8001f3: 56 push %esi
8001f4: 53 push %ebx
8001f5: e8 63 fe ff ff call 80005d <__x86.get_pc_thunk.bx>
8001fa: 81 c3 06 1e 00 00 add $0x1e06,%ebx
800200: 8b 75 0c mov 0xc(%ebp),%esi
b->buf[b->idx++] = ch;
800203: 8b 16 mov (%esi),%edx
800205: 8d 42 01 lea 0x1(%edx),%eax
800208: 89 06 mov %eax,(%esi)
80020a: 8b 4d 08 mov 0x8(%ebp),%ecx
80020d: 88 4c 16 08 mov %cl,0x8(%esi,%edx,1)
if (b->idx == 256-1) {
800211: 3d ff 00 00 00 cmp $0xff,%eax
800216: 74 0b je 800223 <putch+0x33>
sys_cputs(b->buf, b->idx);
b->idx = 0;
}
b->cnt++;
800218: 83 46 04 01 addl $0x1,0x4(%esi)
}
80021c: 8d 65 f8 lea -0x8(%ebp),%esp
80021f: 5b pop %ebx
800220: 5e pop %esi
800221: 5d pop %ebp
800222: c3 ret
sys_cputs(b->buf, b->idx);
800223: 83 ec 08 sub $0x8,%esp
800226: 68 ff 00 00 00 push $0xff
80022b: 8d 46 08 lea 0x8(%esi),%eax
80022e: 50 push %eax
80022f: e8 ac fe ff ff call 8000e0 <sys_cputs>
b->idx = 0;
800234: c7 06 00 00 00 00 movl $0x0,(%esi)
80023a: 83 c4 10 add $0x10,%esp
80023d: eb d9 jmp 800218 <putch+0x28>
0080023f <vcprintf>:
int
vcprintf(const char *fmt, va_list ap)
{
80023f: 55 push %ebp
800240: 89 e5 mov %esp,%ebp
800242: 53 push %ebx
800243: 81 ec 14 01 00 00 sub $0x114,%esp
800249: e8 0f fe ff ff call 80005d <__x86.get_pc_thunk.bx>
80024e: 81 c3 b2 1d 00 00 add $0x1db2,%ebx
struct printbuf b;
b.idx = 0;
800254: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp)
80025b: 00 00 00
b.cnt = 0;
80025e: c7 85 f4 fe ff ff 00 movl $0x0,-0x10c(%ebp)
800265: 00 00 00
vprintfmt((void*)putch, &b, fmt, ap);
800268: ff 75 0c pushl 0xc(%ebp)
80026b: ff 75 08 pushl 0x8(%ebp)
80026e: 8d 85 f0 fe ff ff lea -0x110(%ebp),%eax
800274: 50 push %eax
800275: 8d 83 f0 e1 ff ff lea -0x1e10(%ebx),%eax
80027b: 50 push %eax
80027c: e8 38 01 00 00 call 8003b9 <vprintfmt>
sys_cputs(b.buf, b.idx);
800281: 83 c4 08 add $0x8,%esp
800284: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80028a: 8d 85 f8 fe ff ff lea -0x108(%ebp),%eax
800290: 50 push %eax
800291: e8 4a fe ff ff call 8000e0 <sys_cputs>
return b.cnt;
}
800296: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax
80029c: 8b 5d fc mov -0x4(%ebp),%ebx
80029f: c9 leave
8002a0: c3 ret
008002a1 <cprintf>:
int
cprintf(const char *fmt, ...)
{
8002a1: 55 push %ebp
8002a2: 89 e5 mov %esp,%ebp
8002a4: 83 ec 10 sub $0x10,%esp
va_list ap;
int cnt;
va_start(ap, fmt);
8002a7: 8d 45 0c lea 0xc(%ebp),%eax
cnt = vcprintf(fmt, ap);
8002aa: 50 push %eax
8002ab: ff 75 08 pushl 0x8(%ebp)
8002ae: e8 8c ff ff ff call 80023f <vcprintf>
va_end(ap);
return cnt;
}
8002b3: c9 leave
8002b4: c3 ret
008002b5 <printnum>:
* using specified putch function and associated pointer putdat.
*/
static void
printnum(void (*putch)(int, void*), void *putdat,
unsigned long long num, unsigned base, int width, int padc)
{
8002b5: 55 push %ebp
8002b6: 89 e5 mov %esp,%ebp
8002b8: 57 push %edi
8002b9: 56 push %esi
8002ba: 53 push %ebx
8002bb: 83 ec 2c sub $0x2c,%esp
8002be: e8 63 06 00 00 call 800926 <__x86.get_pc_thunk.cx>
8002c3: 81 c1 3d 1d 00 00 add $0x1d3d,%ecx
8002c9: 89 4d e4 mov %ecx,-0x1c(%ebp)
8002cc: 89 c7 mov %eax,%edi
8002ce: 89 d6 mov %edx,%esi
8002d0: 8b 45 08 mov 0x8(%ebp),%eax
8002d3: 8b 55 0c mov 0xc(%ebp),%edx
8002d6: 89 45 d0 mov %eax,-0x30(%ebp)
8002d9: 89 55 d4 mov %edx,-0x2c(%ebp)
// first recursively print all preceding (more significant) digits
if (num >= base) {
8002dc: 8b 4d 10 mov 0x10(%ebp),%ecx
8002df: bb 00 00 00 00 mov $0x0,%ebx
8002e4: 89 4d d8 mov %ecx,-0x28(%ebp)
8002e7: 89 5d dc mov %ebx,-0x24(%ebp)
8002ea: 39 d3 cmp %edx,%ebx
8002ec: 72 09 jb 8002f7 <printnum+0x42>
8002ee: 39 45 10 cmp %eax,0x10(%ebp)
8002f1: 0f 87 83 00 00 00 ja 80037a <printnum+0xc5>
printnum(putch, putdat, num / base, base, width - 1, padc);
8002f7: 83 ec 0c sub $0xc,%esp
8002fa: ff 75 18 pushl 0x18(%ebp)
8002fd: 8b 45 14 mov 0x14(%ebp),%eax
800300: 8d 58 ff lea -0x1(%eax),%ebx
800303: 53 push %ebx
800304: ff 75 10 pushl 0x10(%ebp)
800307: 83 ec 08 sub $0x8,%esp
80030a: ff 75 dc pushl -0x24(%ebp)
80030d: ff 75 d8 pushl -0x28(%ebp)
800310: ff 75 d4 pushl -0x2c(%ebp)
800313: ff 75 d0 pushl -0x30(%ebp)
800316: 8b 5d e4 mov -0x1c(%ebp),%ebx
800319: e8 82 09 00 00 call 800ca0 <__udivdi3>
80031e: 83 c4 18 add $0x18,%esp
800321: 52 push %edx
800322: 50 push %eax
800323: 89 f2 mov %esi,%edx
800325: 89 f8 mov %edi,%eax
800327: e8 89 ff ff ff call 8002b5 <printnum>
80032c: 83 c4 20 add $0x20,%esp
80032f: eb 13 jmp 800344 <printnum+0x8f>
} else {
// print any needed pad characters before first digit
while (--width > 0)
putch(padc, putdat);
800331: 83 ec 08 sub $0x8,%esp
800334: 56 push %esi
800335: ff 75 18 pushl 0x18(%ebp)
800338: ff d7 call *%edi
80033a: 83 c4 10 add $0x10,%esp
while (--width > 0)
80033d: 83 eb 01 sub $0x1,%ebx
800340: 85 db test %ebx,%ebx
800342: 7f ed jg 800331 <printnum+0x7c>
}
// then print this (the least significant) digit
putch("0123456789abcdef"[num % base], putdat);
800344: 83 ec 08 sub $0x8,%esp
800347: 56 push %esi
800348: 83 ec 04 sub $0x4,%esp
80034b: ff 75 dc pushl -0x24(%ebp)
80034e: ff 75 d8 pushl -0x28(%ebp)
800351: ff 75 d4 pushl -0x2c(%ebp)
800354: ff 75 d0 pushl -0x30(%ebp)
800357: 8b 75 e4 mov -0x1c(%ebp),%esi
80035a: 89 f3 mov %esi,%ebx
80035c: e8 5f 0a 00 00 call 800dc0 <__umoddi3>
800361: 83 c4 14 add $0x14,%esp
800364: 0f be 84 06 44 ef ff movsbl -0x10bc(%esi,%eax,1),%eax
80036b: ff
80036c: 50 push %eax
80036d: ff d7 call *%edi
}
80036f: 83 c4 10 add $0x10,%esp
800372: 8d 65 f4 lea -0xc(%ebp),%esp
800375: 5b pop %ebx
800376: 5e pop %esi
800377: 5f pop %edi
800378: 5d pop %ebp
800379: c3 ret
80037a: 8b 5d 14 mov 0x14(%ebp),%ebx
80037d: eb be jmp 80033d <printnum+0x88>
0080037f <sprintputch>:
int cnt;
};
static void
sprintputch(int ch, struct sprintbuf *b)
{
80037f: 55 push %ebp
800380: 89 e5 mov %esp,%ebp
800382: 8b 45 0c mov 0xc(%ebp),%eax
b->cnt++;
800385: 83 40 08 01 addl $0x1,0x8(%eax)
if (b->buf < b->ebuf)
800389: 8b 10 mov (%eax),%edx
80038b: 3b 50 04 cmp 0x4(%eax),%edx
80038e: 73 0a jae 80039a <sprintputch+0x1b>
*b->buf++ = ch;
800390: 8d 4a 01 lea 0x1(%edx),%ecx
800393: 89 08 mov %ecx,(%eax)
800395: 8b 45 08 mov 0x8(%ebp),%eax
800398: 88 02 mov %al,(%edx)
}
80039a: 5d pop %ebp
80039b: c3 ret
0080039c <printfmt>:
{
80039c: 55 push %ebp
80039d: 89 e5 mov %esp,%ebp
80039f: 83 ec 08 sub $0x8,%esp
va_start(ap, fmt);
8003a2: 8d 45 14 lea 0x14(%ebp),%eax
vprintfmt(putch, putdat, fmt, ap);
8003a5: 50 push %eax
8003a6: ff 75 10 pushl 0x10(%ebp)
8003a9: ff 75 0c pushl 0xc(%ebp)
8003ac: ff 75 08 pushl 0x8(%ebp)
8003af: e8 05 00 00 00 call 8003b9 <vprintfmt>
}
8003b4: 83 c4 10 add $0x10,%esp
8003b7: c9 leave
8003b8: c3 ret
008003b9 <vprintfmt>:
{
8003b9: 55 push %ebp
8003ba: 89 e5 mov %esp,%ebp
8003bc: 57 push %edi
8003bd: 56 push %esi
8003be: 53 push %ebx
8003bf: 83 ec 2c sub $0x2c,%esp
8003c2: e8 96 fc ff ff call 80005d <__x86.get_pc_thunk.bx>
8003c7: 81 c3 39 1c 00 00 add $0x1c39,%ebx
8003cd: 8b 75 10 mov 0x10(%ebp),%esi
int textcolor = 0x0700;
8003d0: c7 45 e4 00 07 00 00 movl $0x700,-0x1c(%ebp)
8003d7: 89 f7 mov %esi,%edi
while ((ch = *(unsigned char *) fmt++) != '%') {
8003d9: 8d 77 01 lea 0x1(%edi),%esi
8003dc: 0f b6 07 movzbl (%edi),%eax
8003df: 83 f8 25 cmp $0x25,%eax
8003e2: 74 1c je 800400 <vprintfmt+0x47>
if (ch == '\0')
8003e4: 85 c0 test %eax,%eax
8003e6: 0f 84 b9 04 00 00 je 8008a5 <.L21+0x20>
putch(ch, putdat);
8003ec: 83 ec 08 sub $0x8,%esp
8003ef: ff 75 0c pushl 0xc(%ebp)
ch |= textcolor;
8003f2: 0b 45 e4 or -0x1c(%ebp),%eax
putch(ch, putdat);
8003f5: 50 push %eax
8003f6: ff 55 08 call *0x8(%ebp)
8003f9: 83 c4 10 add $0x10,%esp
while ((ch = *(unsigned char *) fmt++) != '%') {
8003fc: 89 f7 mov %esi,%edi
8003fe: eb d9 jmp 8003d9 <vprintfmt+0x20>
padc = ' ';
800400: c6 45 d0 20 movb $0x20,-0x30(%ebp)
altflag = 0;
800404: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp)
precision = -1;
80040b: c7 45 cc ff ff ff ff movl $0xffffffff,-0x34(%ebp)
width = -1;
800412: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp)
lflag = 0;
800419: b9 00 00 00 00 mov $0x0,%ecx
80041e: 89 4d d4 mov %ecx,-0x2c(%ebp)
switch (ch = *(unsigned char *) fmt++) {
800421: 8d 7e 01 lea 0x1(%esi),%edi
800424: 0f b6 16 movzbl (%esi),%edx
800427: 8d 42 dd lea -0x23(%edx),%eax
80042a: 3c 55 cmp $0x55,%al
80042c: 0f 87 53 04 00 00 ja 800885 <.L21>
800432: 0f b6 c0 movzbl %al,%eax
800435: 89 d9 mov %ebx,%ecx
800437: 03 8c 83 d4 ef ff ff add -0x102c(%ebx,%eax,4),%ecx
80043e: ff e1 jmp *%ecx
00800440 <.L73>:
800440: 89 fe mov %edi,%esi
padc = '-';
800442: c6 45 d0 2d movb $0x2d,-0x30(%ebp)
800446: eb d9 jmp 800421 <vprintfmt+0x68>
00800448 <.L27>:
switch (ch = *(unsigned char *) fmt++) {
800448: 89 fe mov %edi,%esi
padc = '0';
80044a: c6 45 d0 30 movb $0x30,-0x30(%ebp)
80044e: eb d1 jmp 800421 <vprintfmt+0x68>
00800450 <.L28>:
switch (ch = *(unsigned char *) fmt++) {
800450: 0f b6 d2 movzbl %dl,%edx
800453: 89 fe mov %edi,%esi
for (precision = 0; ; ++fmt) {
800455: b8 00 00 00 00 mov $0x0,%eax
80045a: 8b 4d d4 mov -0x2c(%ebp),%ecx
precision = precision * 10 + ch - '0';
80045d: 8d 04 80 lea (%eax,%eax,4),%eax
800460: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
ch = *fmt;
800464: 0f be 16 movsbl (%esi),%edx
if (ch < '0' || ch > '9')
800467: 8d 7a d0 lea -0x30(%edx),%edi
80046a: 83 ff 09 cmp $0x9,%edi
80046d: 0f 87 94 00 00 00 ja 800507 <.L33+0x42>
for (precision = 0; ; ++fmt) {
800473: 83 c6 01 add $0x1,%esi
precision = precision * 10 + ch - '0';
800476: eb e5 jmp 80045d <.L28+0xd>
00800478 <.L25>:
precision = va_arg(ap, int);
800478: 8b 45 14 mov 0x14(%ebp),%eax
80047b: 8b 00 mov (%eax),%eax
80047d: 89 45 cc mov %eax,-0x34(%ebp)
800480: 8b 45 14 mov 0x14(%ebp),%eax
800483: 8d 40 04 lea 0x4(%eax),%eax
800486: 89 45 14 mov %eax,0x14(%ebp)
switch (ch = *(unsigned char *) fmt++) {
800489: 89 fe mov %edi,%esi
if (width < 0)
80048b: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
80048f: 79 90 jns 800421 <vprintfmt+0x68>
width = precision, precision = -1;
800491: 8b 45 cc mov -0x34(%ebp),%eax
800494: 89 45 e0 mov %eax,-0x20(%ebp)
800497: c7 45 cc ff ff ff ff movl $0xffffffff,-0x34(%ebp)
80049e: eb 81 jmp 800421 <vprintfmt+0x68>
008004a0 <.L26>:
8004a0: 8b 45 e0 mov -0x20(%ebp),%eax
8004a3: 85 c0 test %eax,%eax
8004a5: ba 00 00 00 00 mov $0x0,%edx
8004aa: 0f 49 d0 cmovns %eax,%edx
8004ad: 89 55 e0 mov %edx,-0x20(%ebp)
switch (ch = *(unsigned char *) fmt++) {
8004b0: 89 fe mov %edi,%esi
8004b2: e9 6a ff ff ff jmp 800421 <vprintfmt+0x68>
008004b7 <.L22>:
8004b7: 89 fe mov %edi,%esi
altflag = 1;
8004b9: c7 45 d8 01 00 00 00 movl $0x1,-0x28(%ebp)
goto reswitch;
8004c0: e9 5c ff ff ff jmp 800421 <vprintfmt+0x68>
008004c5 <.L33>:
8004c5: 8b 4d d4 mov -0x2c(%ebp),%ecx
if (lflag >= 2)
8004c8: 83 f9 01 cmp $0x1,%ecx
8004cb: 7e 16 jle 8004e3 <.L33+0x1e>
return va_arg(*ap, long long);
8004cd: 8b 45 14 mov 0x14(%ebp),%eax
8004d0: 8b 00 mov (%eax),%eax
8004d2: 8b 4d 14 mov 0x14(%ebp),%ecx
8004d5: 8d 49 08 lea 0x8(%ecx),%ecx
8004d8: 89 4d 14 mov %ecx,0x14(%ebp)
textcolor = getint(&ap, lflag);
8004db: 89 45 e4 mov %eax,-0x1c(%ebp)
break;
8004de: e9 f6 fe ff ff jmp 8003d9 <vprintfmt+0x20>
else if (lflag)
8004e3: 85 c9 test %ecx,%ecx
8004e5: 75 10 jne 8004f7 <.L33+0x32>
return va_arg(*ap, int);
8004e7: 8b 45 14 mov 0x14(%ebp),%eax
8004ea: 8b 00 mov (%eax),%eax
8004ec: 8b 4d 14 mov 0x14(%ebp),%ecx
8004ef: 8d 49 04 lea 0x4(%ecx),%ecx
8004f2: 89 4d 14 mov %ecx,0x14(%ebp)
8004f5: eb e4 jmp 8004db <.L33+0x16>
return va_arg(*ap, long);
8004f7: 8b 45 14 mov 0x14(%ebp),%eax
8004fa: 8b 00 mov (%eax),%eax
8004fc: 8b 4d 14 mov 0x14(%ebp),%ecx
8004ff: 8d 49 04 lea 0x4(%ecx),%ecx
800502: 89 4d 14 mov %ecx,0x14(%ebp)
800505: eb d4 jmp 8004db <.L33+0x16>
800507: 89 4d d4 mov %ecx,-0x2c(%ebp)
80050a: 89 45 cc mov %eax,-0x34(%ebp)
80050d: e9 79 ff ff ff jmp 80048b <.L25+0x13>
00800512 <.L32>:
lflag++;
800512: 83 45 d4 01 addl $0x1,-0x2c(%ebp)
switch (ch = *(unsigned char *) fmt++) {
800516: 89 fe mov %edi,%esi
goto reswitch;
800518: e9 04 ff ff ff jmp 800421 <vprintfmt+0x68>
0080051d <.L29>:
putch(va_arg(ap, int), putdat);
80051d: 8b 45 14 mov 0x14(%ebp),%eax
800520: 8d 70 04 lea 0x4(%eax),%esi
800523: 83 ec 08 sub $0x8,%esp
800526: ff 75 0c pushl 0xc(%ebp)
800529: ff 30 pushl (%eax)
80052b: ff 55 08 call *0x8(%ebp)
break;
80052e: 83 c4 10 add $0x10,%esp
putch(va_arg(ap, int), putdat);
800531: 89 75 14 mov %esi,0x14(%ebp)
break;
800534: e9 a0 fe ff ff jmp 8003d9 <vprintfmt+0x20>
00800539 <.L31>:
err = va_arg(ap, int);
800539: 8b 45 14 mov 0x14(%ebp),%eax
80053c: 8d 70 04 lea 0x4(%eax),%esi
80053f: 8b 00 mov (%eax),%eax
800541: 99 cltd
800542: 31 d0 xor %edx,%eax
800544: 29 d0 sub %edx,%eax
if (err >= MAXERROR || (p = error_string[err]) == NULL)
800546: 83 f8 06 cmp $0x6,%eax
800549: 7f 29 jg 800574 <.L31+0x3b>
80054b: 8b 94 83 14 00 00 00 mov 0x14(%ebx,%eax,4),%edx
800552: 85 d2 test %edx,%edx
800554: 74 1e je 800574 <.L31+0x3b>
printfmt(putch, putdat, "%s", p);
800556: 52 push %edx
800557: 8d 83 65 ef ff ff lea -0x109b(%ebx),%eax
80055d: 50 push %eax
80055e: ff 75 0c pushl 0xc(%ebp)
800561: ff 75 08 pushl 0x8(%ebp)
800564: e8 33 fe ff ff call 80039c <printfmt>
800569: 83 c4 10 add $0x10,%esp
err = va_arg(ap, int);
80056c: 89 75 14 mov %esi,0x14(%ebp)
80056f: e9 65 fe ff ff jmp 8003d9 <vprintfmt+0x20>
printfmt(putch, putdat, "error %d", err);
800574: 50 push %eax
800575: 8d 83 5c ef ff ff lea -0x10a4(%ebx),%eax
80057b: 50 push %eax
80057c: ff 75 0c pushl 0xc(%ebp)
80057f: ff 75 08 pushl 0x8(%ebp)
800582: e8 15 fe ff ff call 80039c <printfmt>
800587: 83 c4 10 add $0x10,%esp
err = va_arg(ap, int);
80058a: 89 75 14 mov %esi,0x14(%ebp)
printfmt(putch, putdat, "error %d", err);
80058d: e9 47 fe ff ff jmp 8003d9 <vprintfmt+0x20>
00800592 <.L36>:
if ((p = va_arg(ap, char *)) == NULL)
800592: 8b 45 14 mov 0x14(%ebp),%eax
800595: 83 c0 04 add $0x4,%eax
800598: 89 45 d4 mov %eax,-0x2c(%ebp)
80059b: 8b 45 14 mov 0x14(%ebp),%eax
80059e: 8b 30 mov (%eax),%esi
p = "(null)";
8005a0: 85 f6 test %esi,%esi
8005a2: 8d 83 55 ef ff ff lea -0x10ab(%ebx),%eax
8005a8: 0f 44 f0 cmove %eax,%esi
if (width > 0 && padc != '-')
8005ab: 83 7d e0 00 cmpl $0x0,-0x20(%ebp)
8005af: 0f 8e b4 00 00 00 jle 800669 <.L36+0xd7>
8005b5: 80 7d d0 2d cmpb $0x2d,-0x30(%ebp)
8005b9: 75 08 jne 8005c3 <.L36+0x31>
8005bb: 89 7d 10 mov %edi,0x10(%ebp)
8005be: 8b 7d cc mov -0x34(%ebp),%edi
8005c1: eb 6c jmp 80062f <.L36+0x9d>
for (width -= strnlen(p, precision); width > 0; width--)
8005c3: 83 ec 08 sub $0x8,%esp
8005c6: ff 75 cc pushl -0x34(%ebp)
8005c9: 56 push %esi
8005ca: e8 73 03 00 00 call 800942 <strnlen>
8005cf: 8b 55 e0 mov -0x20(%ebp),%edx
8005d2: 29 c2 sub %eax,%edx
8005d4: 89 55 e0 mov %edx,-0x20(%ebp)
8005d7: 83 c4 10 add $0x10,%esp
putch(padc, putdat);
8005da: 0f be 45 d0 movsbl -0x30(%ebp),%eax
8005de: 89 75 d0 mov %esi,-0x30(%ebp)
8005e1: 89 d6 mov %edx,%esi
8005e3: 89 7d 10 mov %edi,0x10(%ebp)
8005e6: 89 c7 mov %eax,%edi
for (width -= strnlen(p, precision); width > 0; width--)
8005e8: eb 10 jmp 8005fa <.L36+0x68>
putch(padc, putdat);
8005ea: 83 ec 08 sub $0x8,%esp
8005ed: ff 75 0c pushl 0xc(%ebp)
8005f0: 57 push %edi
8005f1: ff 55 08 call *0x8(%ebp)
for (width -= strnlen(p, precision); width > 0; width--)
8005f4: 83 ee 01 sub $0x1,%esi
8005f7: 83 c4 10 add $0x10,%esp
8005fa: 85 f6 test %esi,%esi
8005fc: 7f ec jg 8005ea <.L36+0x58>
8005fe: 8b 75 d0 mov -0x30(%ebp),%esi
800601: 8b 55 e0 mov -0x20(%ebp),%edx
800604: 85 d2 test %edx,%edx
800606: b8 00 00 00 00 mov $0x0,%eax
80060b: 0f 49 c2 cmovns %edx,%eax
80060e: 29 c2 sub %eax,%edx
800610: 89 55 e0 mov %edx,-0x20(%ebp)
800613: 8b 7d cc mov -0x34(%ebp),%edi
800616: eb 17 jmp 80062f <.L36+0x9d>
if (altflag && (ch < ' ' || ch > '~'))
800618: 83 7d d8 00 cmpl $0x0,-0x28(%ebp)
80061c: 75 30 jne 80064e <.L36+0xbc>
putch(ch, putdat);
80061e: 83 ec 08 sub $0x8,%esp
800621: ff 75 0c pushl 0xc(%ebp)
800624: 50 push %eax
800625: ff 55 08 call *0x8(%ebp)
800628: 83 c4 10 add $0x10,%esp
for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
80062b: 83 6d e0 01 subl $0x1,-0x20(%ebp)
80062f: 83 c6 01 add $0x1,%esi
800632: 0f b6 56 ff movzbl -0x1(%esi),%edx
800636: 0f be c2 movsbl %dl,%eax
800639: 85 c0 test %eax,%eax
80063b: 74 58 je 800695 <.L36+0x103>
80063d: 85 ff test %edi,%edi
80063f: 78 d7 js 800618 <.L36+0x86>
800641: 83 ef 01 sub $0x1,%edi
800644: 79 d2 jns 800618 <.L36+0x86>
800646: 8b 75 e0 mov -0x20(%ebp),%esi
800649: 8b 7d 0c mov 0xc(%ebp),%edi
80064c: eb 32 jmp 800680 <.L36+0xee>
if (altflag && (ch < ' ' || ch > '~'))
80064e: 0f be d2 movsbl %dl,%edx
800651: 83 ea 20 sub $0x20,%edx
800654: 83 fa 5e cmp $0x5e,%edx
800657: 76 c5 jbe 80061e <.L36+0x8c>
putch('?', putdat);
800659: 83 ec 08 sub $0x8,%esp
80065c: ff 75 0c pushl 0xc(%ebp)
80065f: 6a 3f push $0x3f
800661: ff 55 08 call *0x8(%ebp)
800664: 83 c4 10 add $0x10,%esp
800667: eb c2 jmp 80062b <.L36+0x99>
800669: 89 7d 10 mov %edi,0x10(%ebp)
80066c: 8b 7d cc mov -0x34(%ebp),%edi
80066f: eb be jmp 80062f <.L36+0x9d>
putch(' ', putdat);
800671: 83 ec 08 sub $0x8,%esp
800674: 57 push %edi
800675: 6a 20 push $0x20
800677: ff 55 08 call *0x8(%ebp)
for (; width > 0; width--)
80067a: 83 ee 01 sub $0x1,%esi
80067d: 83 c4 10 add $0x10,%esp
800680: 85 f6 test %esi,%esi
800682: 7f ed jg 800671 <.L36+0xdf>
800684: 89 7d 0c mov %edi,0xc(%ebp)
800687: 8b 7d 10 mov 0x10(%ebp),%edi
if ((p = va_arg(ap, char *)) == NULL)
80068a: 8b 45 d4 mov -0x2c(%ebp),%eax
80068d: 89 45 14 mov %eax,0x14(%ebp)
800690: e9 44 fd ff ff jmp 8003d9 <vprintfmt+0x20>
800695: 8b 75 e0 mov -0x20(%ebp),%esi
800698: 8b 7d 0c mov 0xc(%ebp),%edi
80069b: eb e3 jmp 800680 <.L36+0xee>
0080069d <.L30>:
80069d: 8b 4d d4 mov -0x2c(%ebp),%ecx
if (lflag >= 2)
8006a0: 83 f9 01 cmp $0x1,%ecx
8006a3: 7e 42 jle 8006e7 <.L30+0x4a>
return va_arg(*ap, long long);
8006a5: 8b 45 14 mov 0x14(%ebp),%eax
8006a8: 8b 50 04 mov 0x4(%eax),%edx
8006ab: 8b 00 mov (%eax),%eax
8006ad: 89 45 d8 mov %eax,-0x28(%ebp)
8006b0: 89 55 dc mov %edx,-0x24(%ebp)
8006b3: 8b 45 14 mov 0x14(%ebp),%eax
8006b6: 8d 40 08 lea 0x8(%eax),%eax
8006b9: 89 45 14 mov %eax,0x14(%ebp)
if ((long long) num < 0) {
8006bc: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
8006c0: 79 5f jns 800721 <.L30+0x84>
putch('-', putdat);
8006c2: 83 ec 08 sub $0x8,%esp
8006c5: ff 75 0c pushl 0xc(%ebp)
8006c8: 6a 2d push $0x2d
8006ca: ff 55 08 call *0x8(%ebp)
num = -(long long) num;
8006cd: 8b 55 d8 mov -0x28(%ebp),%edx
8006d0: 8b 4d dc mov -0x24(%ebp),%ecx
8006d3: f7 da neg %edx
8006d5: 83 d1 00 adc $0x0,%ecx
8006d8: f7 d9 neg %ecx
8006da: 83 c4 10 add $0x10,%esp
base = 10;
8006dd: b8 0a 00 00 00 mov $0xa,%eax
8006e2: e9 b8 00 00 00 jmp 80079f <.L34+0x22>
else if (lflag)
8006e7: 85 c9 test %ecx,%ecx
8006e9: 75 1b jne 800706 <.L30+0x69>
return va_arg(*ap, int);
8006eb: 8b 45 14 mov 0x14(%ebp),%eax
8006ee: 8b 30 mov (%eax),%esi
8006f0: 89 75 d8 mov %esi,-0x28(%ebp)
8006f3: 89 f0 mov %esi,%eax
8006f5: c1 f8 1f sar $0x1f,%eax
8006f8: 89 45 dc mov %eax,-0x24(%ebp)
8006fb: 8b 45 14 mov 0x14(%ebp),%eax
8006fe: 8d 40 04 lea 0x4(%eax),%eax
800701: 89 45 14 mov %eax,0x14(%ebp)
800704: eb b6 jmp 8006bc <.L30+0x1f>
return va_arg(*ap, long);
800706: 8b 45 14 mov 0x14(%ebp),%eax
800709: 8b 30 mov (%eax),%esi
80070b: 89 75 d8 mov %esi,-0x28(%ebp)
80070e: 89 f0 mov %esi,%eax
800710: c1 f8 1f sar $0x1f,%eax
800713: 89 45 dc mov %eax,-0x24(%ebp)
800716: 8b 45 14 mov 0x14(%ebp),%eax
800719: 8d 40 04 lea 0x4(%eax),%eax
80071c: 89 45 14 mov %eax,0x14(%ebp)
80071f: eb 9b jmp 8006bc <.L30+0x1f>
num = getint(&ap, lflag);
800721: 8b 55 d8 mov -0x28(%ebp),%edx
800724: 8b 4d dc mov -0x24(%ebp),%ecx
base = 10;
800727: b8 0a 00 00 00 mov $0xa,%eax
80072c: eb 71 jmp 80079f <.L34+0x22>
0080072e <.L37>:
80072e: 8b 4d d4 mov -0x2c(%ebp),%ecx
if (lflag >= 2)
800731: 83 f9 01 cmp $0x1,%ecx
800734: 7e 15 jle 80074b <.L37+0x1d>
return va_arg(*ap, unsigned long long);
800736: 8b 45 14 mov 0x14(%ebp),%eax
800739: 8b 10 mov (%eax),%edx
80073b: 8b 48 04 mov 0x4(%eax),%ecx
80073e: 8d 40 08 lea 0x8(%eax),%eax
800741: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
800744: b8 0a 00 00 00 mov $0xa,%eax
800749: eb 54 jmp 80079f <.L34+0x22>
else if (lflag)
80074b: 85 c9 test %ecx,%ecx
80074d: 75 17 jne 800766 <.L37+0x38>
return va_arg(*ap, unsigned int);
80074f: 8b 45 14 mov 0x14(%ebp),%eax
800752: 8b 10 mov (%eax),%edx
800754: b9 00 00 00 00 mov $0x0,%ecx
800759: 8d 40 04 lea 0x4(%eax),%eax
80075c: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
80075f: b8 0a 00 00 00 mov $0xa,%eax
800764: eb 39 jmp 80079f <.L34+0x22>
return va_arg(*ap, unsigned long);
800766: 8b 45 14 mov 0x14(%ebp),%eax
800769: 8b 10 mov (%eax),%edx
80076b: b9 00 00 00 00 mov $0x0,%ecx
800770: 8d 40 04 lea 0x4(%eax),%eax
800773: 89 45 14 mov %eax,0x14(%ebp)
base = 10;
800776: b8 0a 00 00 00 mov $0xa,%eax
80077b: eb 22 jmp 80079f <.L34+0x22>
0080077d <.L34>:
80077d: 8b 4d d4 mov -0x2c(%ebp),%ecx
if (lflag >= 2)
800780: 83 f9 01 cmp $0x1,%ecx
800783: 7e 3b jle 8007c0 <.L34+0x43>
return va_arg(*ap, long long);
800785: 8b 45 14 mov 0x14(%ebp),%eax
800788: 8b 50 04 mov 0x4(%eax),%edx
80078b: 8b 00 mov (%eax),%eax
80078d: 8b 4d 14 mov 0x14(%ebp),%ecx
800790: 8d 49 08 lea 0x8(%ecx),%ecx
800793: 89 4d 14 mov %ecx,0x14(%ebp)
num = getint(&ap, lflag);
800796: 89 d1 mov %edx,%ecx
800798: 89 c2 mov %eax,%edx
base = 8;
80079a: b8 08 00 00 00 mov $0x8,%eax
printnum(putch, putdat, num, base, width, padc);
80079f: 83 ec 0c sub $0xc,%esp
8007a2: 0f be 75 d0 movsbl -0x30(%ebp),%esi
8007a6: 56 push %esi
8007a7: ff 75 e0 pushl -0x20(%ebp)
8007aa: 50 push %eax
8007ab: 51 push %ecx
8007ac: 52 push %edx
8007ad: 8b 55 0c mov 0xc(%ebp),%edx
8007b0: 8b 45 08 mov 0x8(%ebp),%eax
8007b3: e8 fd fa ff ff call 8002b5 <printnum>
break;
8007b8: 83 c4 20 add $0x20,%esp
8007bb: e9 19 fc ff ff jmp 8003d9 <vprintfmt+0x20>
else if (lflag)
8007c0: 85 c9 test %ecx,%ecx
8007c2: 75 13 jne 8007d7 <.L34+0x5a>
return va_arg(*ap, int);
8007c4: 8b 45 14 mov 0x14(%ebp),%eax
8007c7: 8b 10 mov (%eax),%edx
8007c9: 89 d0 mov %edx,%eax
8007cb: 99 cltd
8007cc: 8b 4d 14 mov 0x14(%ebp),%ecx
8007cf: 8d 49 04 lea 0x4(%ecx),%ecx
8007d2: 89 4d 14 mov %ecx,0x14(%ebp)
8007d5: eb bf jmp 800796 <.L34+0x19>
return va_arg(*ap, long);
8007d7: 8b 45 14 mov 0x14(%ebp),%eax
8007da: 8b 10 mov (%eax),%edx
8007dc: 89 d0 mov %edx,%eax
8007de: 99 cltd
8007df: 8b 4d 14 mov 0x14(%ebp),%ecx
8007e2: 8d 49 04 lea 0x4(%ecx),%ecx
8007e5: 89 4d 14 mov %ecx,0x14(%ebp)
8007e8: eb ac jmp 800796 <.L34+0x19>
008007ea <.L35>:
putch('0', putdat);
8007ea: 83 ec 08 sub $0x8,%esp
8007ed: ff 75 0c pushl 0xc(%ebp)
8007f0: 6a 30 push $0x30
8007f2: ff 55 08 call *0x8(%ebp)
putch('x', putdat);
8007f5: 83 c4 08 add $0x8,%esp
8007f8: ff 75 0c pushl 0xc(%ebp)
8007fb: 6a 78 push $0x78
8007fd: ff 55 08 call *0x8(%ebp)
num = (unsigned long long)
800800: 8b 45 14 mov 0x14(%ebp),%eax
800803: 8b 10 mov (%eax),%edx
800805: b9 00 00 00 00 mov $0x0,%ecx
goto number;
80080a: 83 c4 10 add $0x10,%esp
(uintptr_t) va_arg(ap, void *);
80080d: 8d 40 04 lea 0x4(%eax),%eax
800810: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
800813: b8 10 00 00 00 mov $0x10,%eax
goto number;
800818: eb 85 jmp 80079f <.L34+0x22>
0080081a <.L38>:
80081a: 8b 4d d4 mov -0x2c(%ebp),%ecx
if (lflag >= 2)
80081d: 83 f9 01 cmp $0x1,%ecx
800820: 7e 18 jle 80083a <.L38+0x20>
return va_arg(*ap, unsigned long long);
800822: 8b 45 14 mov 0x14(%ebp),%eax
800825: 8b 10 mov (%eax),%edx
800827: 8b 48 04 mov 0x4(%eax),%ecx
80082a: 8d 40 08 lea 0x8(%eax),%eax
80082d: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
800830: b8 10 00 00 00 mov $0x10,%eax
800835: e9 65 ff ff ff jmp 80079f <.L34+0x22>
else if (lflag)
80083a: 85 c9 test %ecx,%ecx
80083c: 75 1a jne 800858 <.L38+0x3e>
return va_arg(*ap, unsigned int);
80083e: 8b 45 14 mov 0x14(%ebp),%eax
800841: 8b 10 mov (%eax),%edx
800843: b9 00 00 00 00 mov $0x0,%ecx
800848: 8d 40 04 lea 0x4(%eax),%eax
80084b: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
80084e: b8 10 00 00 00 mov $0x10,%eax
800853: e9 47 ff ff ff jmp 80079f <.L34+0x22>
return va_arg(*ap, unsigned long);
800858: 8b 45 14 mov 0x14(%ebp),%eax
80085b: 8b 10 mov (%eax),%edx
80085d: b9 00 00 00 00 mov $0x0,%ecx
800862: 8d 40 04 lea 0x4(%eax),%eax
800865: 89 45 14 mov %eax,0x14(%ebp)
base = 16;
800868: b8 10 00 00 00 mov $0x10,%eax
80086d: e9 2d ff ff ff jmp 80079f <.L34+0x22>
00800872 <.L24>:
putch(ch, putdat);
800872: 83 ec 08 sub $0x8,%esp
800875: ff 75 0c pushl 0xc(%ebp)
800878: 6a 25 push $0x25
80087a: ff 55 08 call *0x8(%ebp)
break;
80087d: 83 c4 10 add $0x10,%esp
800880: e9 54 fb ff ff jmp 8003d9 <vprintfmt+0x20>
00800885 <.L21>:
putch('%', putdat);
800885: 83 ec 08 sub $0x8,%esp
800888: ff 75 0c pushl 0xc(%ebp)
80088b: 6a 25 push $0x25
80088d: ff 55 08 call *0x8(%ebp)
for (fmt--; fmt[-1] != '%'; fmt--)
800890: 83 c4 10 add $0x10,%esp
800893: 89 f7 mov %esi,%edi
800895: eb 03 jmp 80089a <.L21+0x15>
800897: 83 ef 01 sub $0x1,%edi
80089a: 80 7f ff 25 cmpb $0x25,-0x1(%edi)
80089e: 75 f7 jne 800897 <.L21+0x12>
8008a0: e9 34 fb ff ff jmp 8003d9 <vprintfmt+0x20>
}
8008a5: 8d 65 f4 lea -0xc(%ebp),%esp
8008a8: 5b pop %ebx
8008a9: 5e pop %esi
8008aa: 5f pop %edi
8008ab: 5d pop %ebp
8008ac: c3 ret
008008ad <vsnprintf>:
int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
8008ad: 55 push %ebp
8008ae: 89 e5 mov %esp,%ebp
8008b0: 53 push %ebx
8008b1: 83 ec 14 sub $0x14,%esp
8008b4: e8 a4 f7 ff ff call 80005d <__x86.get_pc_thunk.bx>
8008b9: 81 c3 47 17 00 00 add $0x1747,%ebx
8008bf: 8b 45 08 mov 0x8(%ebp),%eax
8008c2: 8b 55 0c mov 0xc(%ebp),%edx
struct sprintbuf b = {buf, buf+n-1, 0};
8008c5: 89 45 ec mov %eax,-0x14(%ebp)
8008c8: 8d 4c 10 ff lea -0x1(%eax,%edx,1),%ecx
8008cc: 89 4d f0 mov %ecx,-0x10(%ebp)
8008cf: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if (buf == NULL || n < 1)
8008d6: 85 c0 test %eax,%eax
8008d8: 74 2b je 800905 <vsnprintf+0x58>
8008da: 85 d2 test %edx,%edx
8008dc: 7e 27 jle 800905 <vsnprintf+0x58>
return -E_INVAL;
// print the string to the buffer
vprintfmt((void*)sprintputch, &b, fmt, ap);
8008de: ff 75 14 pushl 0x14(%ebp)
8008e1: ff 75 10 pushl 0x10(%ebp)
8008e4: 8d 45 ec lea -0x14(%ebp),%eax
8008e7: 50 push %eax
8008e8: 8d 83 7f e3 ff ff lea -0x1c81(%ebx),%eax
8008ee: 50 push %eax
8008ef: e8 c5 fa ff ff call 8003b9 <vprintfmt>
// null terminate the buffer
*b.buf = '\0';
8008f4: 8b 45 ec mov -0x14(%ebp),%eax
8008f7: c6 00 00 movb $0x0,(%eax)
return b.cnt;
8008fa: 8b 45 f4 mov -0xc(%ebp),%eax
8008fd: 83 c4 10 add $0x10,%esp
}
800900: 8b 5d fc mov -0x4(%ebp),%ebx
800903: c9 leave
800904: c3 ret
return -E_INVAL;
800905: b8 fd ff ff ff mov $0xfffffffd,%eax
80090a: eb f4 jmp 800900 <vsnprintf+0x53>
0080090c <snprintf>:
int
snprintf(char *buf, int n, const char *fmt, ...)
{
80090c: 55 push %ebp
80090d: 89 e5 mov %esp,%ebp
80090f: 83 ec 08 sub $0x8,%esp
va_list ap;
int rc;
va_start(ap, fmt);
800912: 8d 45 14 lea 0x14(%ebp),%eax
rc = vsnprintf(buf, n, fmt, ap);
800915: 50 push %eax
800916: ff 75 10 pushl 0x10(%ebp)
800919: ff 75 0c pushl 0xc(%ebp)
80091c: ff 75 08 pushl 0x8(%ebp)
80091f: e8 89 ff ff ff call 8008ad <vsnprintf>
va_end(ap);
return rc;
}
800924: c9 leave
800925: c3 ret
00800926 <__x86.get_pc_thunk.cx>:
800926: 8b 0c 24 mov (%esp),%ecx
800929: c3 ret
0080092a <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1
int
strlen(const char *s)
{
80092a: 55 push %ebp
80092b: 89 e5 mov %esp,%ebp
80092d: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for (n = 0; *s != '\0'; s++)
800930: b8 00 00 00 00 mov $0x0,%eax
800935: eb 03 jmp 80093a <strlen+0x10>
n++;
800937: 83 c0 01 add $0x1,%eax
for (n = 0; *s != '\0'; s++)
80093a: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80093e: 75 f7 jne 800937 <strlen+0xd>
return n;
}
800940: 5d pop %ebp
800941: c3 ret
00800942 <strnlen>:
int
strnlen(const char *s, size_t size)
{
800942: 55 push %ebp
800943: 89 e5 mov %esp,%ebp
800945: 8b 4d 08 mov 0x8(%ebp),%ecx
800948: 8b 55 0c mov 0xc(%ebp),%edx
int n;
for (n = 0; size > 0 && *s != '\0'; s++, size--)
80094b: b8 00 00 00 00 mov $0x0,%eax
800950: eb 03 jmp 800955 <strnlen+0x13>
n++;
800952: 83 c0 01 add $0x1,%eax
for (n = 0; size > 0 && *s != '\0'; s++, size--)
800955: 39 d0 cmp %edx,%eax
800957: 74 06 je 80095f <strnlen+0x1d>
800959: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
80095d: 75 f3 jne 800952 <strnlen+0x10>
return n;
}
80095f: 5d pop %ebp
800960: c3 ret
00800961 <strcpy>:
char *
strcpy(char *dst, const char *src)
{
800961: 55 push %ebp
800962: 89 e5 mov %esp,%ebp
800964: 53 push %ebx
800965: 8b 45 08 mov 0x8(%ebp),%eax
800968: 8b 4d 0c mov 0xc(%ebp),%ecx
char *ret;
ret = dst;
while ((*dst++ = *src++) != '\0')
80096b: 89 c2 mov %eax,%edx
80096d: 83 c1 01 add $0x1,%ecx
800970: 83 c2 01 add $0x1,%edx
800973: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
800977: 88 5a ff mov %bl,-0x1(%edx)
80097a: 84 db test %bl,%bl
80097c: 75 ef jne 80096d <strcpy+0xc>
/* do nothing */;
return ret;
}
80097e: 5b pop %ebx
80097f: 5d pop %ebp
800980: c3 ret
00800981 <strcat>:
char *
strcat(char *dst, const char *src)
{
800981: 55 push %ebp
800982: 89 e5 mov %esp,%ebp
800984: 53 push %ebx
800985: 8b 5d 08 mov 0x8(%ebp),%ebx
int len = strlen(dst);
800988: 53 push %ebx
800989: e8 9c ff ff ff call 80092a <strlen>
80098e: 83 c4 04 add $0x4,%esp
strcpy(dst + len, src);
800991: ff 75 0c pushl 0xc(%ebp)
800994: 01 d8 add %ebx,%eax
800996: 50 push %eax
800997: e8 c5 ff ff ff call 800961 <strcpy>
return dst;
}
80099c: 89 d8 mov %ebx,%eax
80099e: 8b 5d fc mov -0x4(%ebp),%ebx
8009a1: c9 leave
8009a2: c3 ret
008009a3 <strncpy>:
char *
strncpy(char *dst, const char *src, size_t size) {
8009a3: 55 push %ebp
8009a4: 89 e5 mov %esp,%ebp
8009a6: 56 push %esi
8009a7: 53 push %ebx
8009a8: 8b 75 08 mov 0x8(%ebp),%esi
8009ab: 8b 4d 0c mov 0xc(%ebp),%ecx
8009ae: 89 f3 mov %esi,%ebx
8009b0: 03 5d 10 add 0x10(%ebp),%ebx
size_t i;
char *ret;
ret = dst;
for (i = 0; i < size; i++) {
8009b3: 89 f2 mov %esi,%edx
8009b5: eb 0f jmp 8009c6 <strncpy+0x23>
*dst++ = *src;
8009b7: 83 c2 01 add $0x1,%edx
8009ba: 0f b6 01 movzbl (%ecx),%eax
8009bd: 88 42 ff mov %al,-0x1(%edx)
// If strlen(src) < size, null-pad 'dst' out to 'size' chars
if (*src != '\0')
src++;
8009c0: 80 39 01 cmpb $0x1,(%ecx)
8009c3: 83 d9 ff sbb $0xffffffff,%ecx
for (i = 0; i < size; i++) {
8009c6: 39 da cmp %ebx,%edx
8009c8: 75 ed jne 8009b7 <strncpy+0x14>
}
return ret;
}
8009ca: 89 f0 mov %esi,%eax
8009cc: 5b pop %ebx
8009cd: 5e pop %esi
8009ce: 5d pop %ebp
8009cf: c3 ret
008009d0 <strlcpy>:
size_t
strlcpy(char *dst, const char *src, size_t size)
{
8009d0: 55 push %ebp
8009d1: 89 e5 mov %esp,%ebp
8009d3: 56 push %esi
8009d4: 53 push %ebx
8009d5: 8b 75 08 mov 0x8(%ebp),%esi
8009d8: 8b 55 0c mov 0xc(%ebp),%edx
8009db: 8b 4d 10 mov 0x10(%ebp),%ecx
8009de: 89 f0 mov %esi,%eax
8009e0: 8d 5c 0e ff lea -0x1(%esi,%ecx,1),%ebx
char *dst_in;
dst_in = dst;
if (size > 0) {
8009e4: 85 c9 test %ecx,%ecx
8009e6: 75 0b jne 8009f3 <strlcpy+0x23>
8009e8: eb 17 jmp 800a01 <strlcpy+0x31>
while (--size > 0 && *src != '\0')
*dst++ = *src++;
8009ea: 83 c2 01 add $0x1,%edx
8009ed: 83 c0 01 add $0x1,%eax
8009f0: 88 48 ff mov %cl,-0x1(%eax)
while (--size > 0 && *src != '\0')
8009f3: 39 d8 cmp %ebx,%eax
8009f5: 74 07 je 8009fe <strlcpy+0x2e>
8009f7: 0f b6 0a movzbl (%edx),%ecx
8009fa: 84 c9 test %cl,%cl
8009fc: 75 ec jne 8009ea <strlcpy+0x1a>
*dst = '\0';
8009fe: c6 00 00 movb $0x0,(%eax)
}
return dst - dst_in;
800a01: 29 f0 sub %esi,%eax
}
800a03: 5b pop %ebx
800a04: 5e pop %esi
800a05: 5d pop %ebp
800a06: c3 ret
00800a07 <strcmp>:
int
strcmp(const char *p, const char *q)
{
800a07: 55 push %ebp
800a08: 89 e5 mov %esp,%ebp
800a0a: 8b 4d 08 mov 0x8(%ebp),%ecx
800a0d: 8b 55 0c mov 0xc(%ebp),%edx
while (*p && *p == *q)
800a10: eb 06 jmp 800a18 <strcmp+0x11>
p++, q++;
800a12: 83 c1 01 add $0x1,%ecx
800a15: 83 c2 01 add $0x1,%edx
while (*p && *p == *q)
800a18: 0f b6 01 movzbl (%ecx),%eax
800a1b: 84 c0 test %al,%al
800a1d: 74 04 je 800a23 <strcmp+0x1c>
800a1f: 3a 02 cmp (%edx),%al
800a21: 74 ef je 800a12 <strcmp+0xb>
return (int) ((unsigned char) *p - (unsigned char) *q);
800a23: 0f b6 c0 movzbl %al,%eax
800a26: 0f b6 12 movzbl (%edx),%edx
800a29: 29 d0 sub %edx,%eax
}
800a2b: 5d pop %ebp
800a2c: c3 ret
00800a2d <strncmp>:
int
strncmp(const char *p, const char *q, size_t n)
{
800a2d: 55 push %ebp
800a2e: 89 e5 mov %esp,%ebp
800a30: 53 push %ebx
800a31: 8b 45 08 mov 0x8(%ebp),%eax
800a34: 8b 55 0c mov 0xc(%ebp),%edx
800a37: 89 c3 mov %eax,%ebx
800a39: 03 5d 10 add 0x10(%ebp),%ebx
while (n > 0 && *p && *p == *q)
800a3c: eb 06 jmp 800a44 <strncmp+0x17>
n--, p++, q++;
800a3e: 83 c0 01 add $0x1,%eax
800a41: 83 c2 01 add $0x1,%edx
while (n > 0 && *p && *p == *q)
800a44: 39 d8 cmp %ebx,%eax
800a46: 74 16 je 800a5e <strncmp+0x31>
800a48: 0f b6 08 movzbl (%eax),%ecx
800a4b: 84 c9 test %cl,%cl
800a4d: 74 04 je 800a53 <strncmp+0x26>
800a4f: 3a 0a cmp (%edx),%cl
800a51: 74 eb je 800a3e <strncmp+0x11>
if (n == 0)
return 0;
else
return (int) ((unsigned char) *p - (unsigned char) *q);
800a53: 0f b6 00 movzbl (%eax),%eax
800a56: 0f b6 12 movzbl (%edx),%edx
800a59: 29 d0 sub %edx,%eax
}
800a5b: 5b pop %ebx
800a5c: 5d pop %ebp
800a5d: c3 ret
return 0;
800a5e: b8 00 00 00 00 mov $0x0,%eax
800a63: eb f6 jmp 800a5b <strncmp+0x2e>
00800a65 <strchr>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
800a65: 55 push %ebp
800a66: 89 e5 mov %esp,%ebp
800a68: 8b 45 08 mov 0x8(%ebp),%eax
800a6b: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
800a6f: 0f b6 10 movzbl (%eax),%edx
800a72: 84 d2 test %dl,%dl
800a74: 74 09 je 800a7f <strchr+0x1a>
if (*s == c)
800a76: 38 ca cmp %cl,%dl
800a78: 74 0a je 800a84 <strchr+0x1f>
for (; *s; s++)
800a7a: 83 c0 01 add $0x1,%eax
800a7d: eb f0 jmp 800a6f <strchr+0xa>
return (char *) s;
return 0;
800a7f: b8 00 00 00 00 mov $0x0,%eax
}
800a84: 5d pop %ebp
800a85: c3 ret
00800a86 <strfind>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
800a86: 55 push %ebp
800a87: 89 e5 mov %esp,%ebp
800a89: 8b 45 08 mov 0x8(%ebp),%eax
800a8c: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
800a90: eb 03 jmp 800a95 <strfind+0xf>
800a92: 83 c0 01 add $0x1,%eax
800a95: 0f b6 10 movzbl (%eax),%edx
if (*s == c)
800a98: 38 ca cmp %cl,%dl
800a9a: 74 04 je 800aa0 <strfind+0x1a>
800a9c: 84 d2 test %dl,%dl
800a9e: 75 f2 jne 800a92 <strfind+0xc>
break;
return (char *) s;
}
800aa0: 5d pop %ebp
800aa1: c3 ret
00800aa2 <memset>:
#if ASM
void *
memset(void *v, int c, size_t n)
{
800aa2: 55 push %ebp
800aa3: 89 e5 mov %esp,%ebp
800aa5: 57 push %edi
800aa6: 56 push %esi
800aa7: 53 push %ebx
800aa8: 8b 7d 08 mov 0x8(%ebp),%edi
800aab: 8b 4d 10 mov 0x10(%ebp),%ecx
char *p;
if (n == 0)
800aae: 85 c9 test %ecx,%ecx
800ab0: 74 13 je 800ac5 <memset+0x23>
return v;
if ((int)v%4 == 0 && n%4 == 0) {
800ab2: f7 c7 03 00 00 00 test $0x3,%edi
800ab8: 75 05 jne 800abf <memset+0x1d>
800aba: f6 c1 03 test $0x3,%cl
800abd: 74 0d je 800acc <memset+0x2a>
c = (c<<24)|(c<<16)|(c<<8)|c;
asm volatile("cld; rep stosl\n"
:: "D" (v), "a" (c), "c" (n/4)
: "cc", "memory");
} else
asm volatile("cld; rep stosb\n"
800abf: 8b 45 0c mov 0xc(%ebp),%eax
800ac2: fc cld
800ac3: f3 aa rep stos %al,%es:(%edi)
:: "D" (v), "a" (c), "c" (n)
: "cc", "memory");
return v;
}
800ac5: 89 f8 mov %edi,%eax
800ac7: 5b pop %ebx
800ac8: 5e pop %esi
800ac9: 5f pop %edi
800aca: 5d pop %ebp
800acb: c3 ret
c &= 0xFF;
800acc: 0f b6 55 0c movzbl 0xc(%ebp),%edx
c = (c<<24)|(c<<16)|(c<<8)|c;
800ad0: 89 d3 mov %edx,%ebx
800ad2: c1 e3 08 shl $0x8,%ebx
800ad5: 89 d0 mov %edx,%eax
800ad7: c1 e0 18 shl $0x18,%eax
800ada: 89 d6 mov %edx,%esi
800adc: c1 e6 10 shl $0x10,%esi
800adf: 09 f0 or %esi,%eax
800ae1: 09 c2 or %eax,%edx
800ae3: 09 da or %ebx,%edx
:: "D" (v), "a" (c), "c" (n/4)
800ae5: c1 e9 02 shr $0x2,%ecx
asm volatile("cld; rep stosl\n"
800ae8: 89 d0 mov %edx,%eax
800aea: fc cld
800aeb: f3 ab rep stos %eax,%es:(%edi)
800aed: eb d6 jmp 800ac5 <memset+0x23>
00800aef <memmove>:
void *
memmove(void *dst, const void *src, size_t n)
{
800aef: 55 push %ebp
800af0: 89 e5 mov %esp,%ebp
800af2: 57 push %edi
800af3: 56 push %esi
800af4: 8b 45 08 mov 0x8(%ebp),%eax
800af7: 8b 75 0c mov 0xc(%ebp),%esi
800afa: 8b 4d 10 mov 0x10(%ebp),%ecx
const char *s;
char *d;
s = src;
d = dst;
if (s < d && s + n > d) {
800afd: 39 c6 cmp %eax,%esi
800aff: 73 35 jae 800b36 <memmove+0x47>
800b01: 8d 14 0e lea (%esi,%ecx,1),%edx
800b04: 39 c2 cmp %eax,%edx
800b06: 76 2e jbe 800b36 <memmove+0x47>
s += n;
d += n;
800b08: 8d 3c 08 lea (%eax,%ecx,1),%edi
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800b0b: 89 d6 mov %edx,%esi
800b0d: 09 fe or %edi,%esi
800b0f: f7 c6 03 00 00 00 test $0x3,%esi
800b15: 74 0c je 800b23 <memmove+0x34>
asm volatile("std; rep movsl\n"
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
else
asm volatile("std; rep movsb\n"
:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
800b17: 83 ef 01 sub $0x1,%edi
800b1a: 8d 72 ff lea -0x1(%edx),%esi
asm volatile("std; rep movsb\n"
800b1d: fd std
800b1e: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
// Some versions of GCC rely on DF being clear
asm volatile("cld" ::: "cc");
800b20: fc cld
800b21: eb 21 jmp 800b44 <memmove+0x55>
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800b23: f6 c1 03 test $0x3,%cl
800b26: 75 ef jne 800b17 <memmove+0x28>
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
800b28: 83 ef 04 sub $0x4,%edi
800b2b: 8d 72 fc lea -0x4(%edx),%esi
800b2e: c1 e9 02 shr $0x2,%ecx
asm volatile("std; rep movsl\n"
800b31: fd std
800b32: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
800b34: eb ea jmp 800b20 <memmove+0x31>
} else {
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800b36: 89 f2 mov %esi,%edx
800b38: 09 c2 or %eax,%edx
800b3a: f6 c2 03 test $0x3,%dl
800b3d: 74 09 je 800b48 <memmove+0x59>
asm volatile("cld; rep movsl\n"
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
else
asm volatile("cld; rep movsb\n"
800b3f: 89 c7 mov %eax,%edi
800b41: fc cld
800b42: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
}
return dst;
}
800b44: 5e pop %esi
800b45: 5f pop %edi
800b46: 5d pop %ebp
800b47: c3 ret
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
800b48: f6 c1 03 test $0x3,%cl
800b4b: 75 f2 jne 800b3f <memmove+0x50>
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
800b4d: c1 e9 02 shr $0x2,%ecx
asm volatile("cld; rep movsl\n"
800b50: 89 c7 mov %eax,%edi
800b52: fc cld
800b53: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
800b55: eb ed jmp 800b44 <memmove+0x55>
00800b57 <memcpy>:
}
#endif
void *
memcpy(void *dst, const void *src, size_t n)
{
800b57: 55 push %ebp
800b58: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
800b5a: ff 75 10 pushl 0x10(%ebp)
800b5d: ff 75 0c pushl 0xc(%ebp)
800b60: ff 75 08 pushl 0x8(%ebp)
800b63: e8 87 ff ff ff call 800aef <memmove>
}
800b68: c9 leave
800b69: c3 ret
00800b6a <memcmp>:
int
memcmp(const void *v1, const void *v2, size_t n)
{
800b6a: 55 push %ebp
800b6b: 89 e5 mov %esp,%ebp
800b6d: 56 push %esi
800b6e: 53 push %ebx
800b6f: 8b 45 08 mov 0x8(%ebp),%eax
800b72: 8b 55 0c mov 0xc(%ebp),%edx
800b75: 89 c6 mov %eax,%esi
800b77: 03 75 10 add 0x10(%ebp),%esi
const uint8_t *s1 = (const uint8_t *) v1;
const uint8_t *s2 = (const uint8_t *) v2;
while (n-- > 0) {
800b7a: 39 f0 cmp %esi,%eax
800b7c: 74 1c je 800b9a <memcmp+0x30>
if (*s1 != *s2)
800b7e: 0f b6 08 movzbl (%eax),%ecx
800b81: 0f b6 1a movzbl (%edx),%ebx
800b84: 38 d9 cmp %bl,%cl
800b86: 75 08 jne 800b90 <memcmp+0x26>
return (int) *s1 - (int) *s2;
s1++, s2++;
800b88: 83 c0 01 add $0x1,%eax
800b8b: 83 c2 01 add $0x1,%edx
800b8e: eb ea jmp 800b7a <memcmp+0x10>
return (int) *s1 - (int) *s2;
800b90: 0f b6 c1 movzbl %cl,%eax
800b93: 0f b6 db movzbl %bl,%ebx
800b96: 29 d8 sub %ebx,%eax
800b98: eb 05 jmp 800b9f <memcmp+0x35>
}
return 0;
800b9a: b8 00 00 00 00 mov $0x0,%eax
}
800b9f: 5b pop %ebx
800ba0: 5e pop %esi
800ba1: 5d pop %ebp
800ba2: c3 ret
00800ba3 <memfind>:
void *
memfind(const void *s, int c, size_t n)
{
800ba3: 55 push %ebp
800ba4: 89 e5 mov %esp,%ebp
800ba6: 8b 45 08 mov 0x8(%ebp),%eax
800ba9: 8b 4d 0c mov 0xc(%ebp),%ecx
const void *ends = (const char *) s + n;
800bac: 89 c2 mov %eax,%edx
800bae: 03 55 10 add 0x10(%ebp),%edx
for (; s < ends; s++)
800bb1: 39 d0 cmp %edx,%eax
800bb3: 73 09 jae 800bbe <memfind+0x1b>
if (*(const unsigned char *) s == (unsigned char) c)
800bb5: 38 08 cmp %cl,(%eax)
800bb7: 74 05 je 800bbe <memfind+0x1b>
for (; s < ends; s++)
800bb9: 83 c0 01 add $0x1,%eax
800bbc: eb f3 jmp 800bb1 <memfind+0xe>
break;
return (void *) s;
}
800bbe: 5d pop %ebp
800bbf: c3 ret
00800bc0 <strtol>:
long
strtol(const char *s, char **endptr, int base)
{
800bc0: 55 push %ebp
800bc1: 89 e5 mov %esp,%ebp
800bc3: 57 push %edi
800bc4: 56 push %esi
800bc5: 53 push %ebx
800bc6: 8b 4d 08 mov 0x8(%ebp),%ecx
800bc9: 8b 5d 10 mov 0x10(%ebp),%ebx
int neg = 0;
long val = 0;
// gobble initial whitespace
while (*s == ' ' || *s == '\t')
800bcc: eb 03 jmp 800bd1 <strtol+0x11>
s++;
800bce: 83 c1 01 add $0x1,%ecx
while (*s == ' ' || *s == '\t')
800bd1: 0f b6 01 movzbl (%ecx),%eax
800bd4: 3c 20 cmp $0x20,%al
800bd6: 74 f6 je 800bce <strtol+0xe>
800bd8: 3c 09 cmp $0x9,%al
800bda: 74 f2 je 800bce <strtol+0xe>
// plus/minus sign
if (*s == '+')
800bdc: 3c 2b cmp $0x2b,%al
800bde: 74 2e je 800c0e <strtol+0x4e>
int neg = 0;
800be0: bf 00 00 00 00 mov $0x0,%edi
s++;
else if (*s == '-')
800be5: 3c 2d cmp $0x2d,%al
800be7: 74 2f je 800c18 <strtol+0x58>
s++, neg = 1;
// hex or octal base prefix
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
800be9: f7 c3 ef ff ff ff test $0xffffffef,%ebx
800bef: 75 05 jne 800bf6 <strtol+0x36>
800bf1: 80 39 30 cmpb $0x30,(%ecx)
800bf4: 74 2c je 800c22 <strtol+0x62>
s += 2, base = 16;
else if (base == 0 && s[0] == '0')
800bf6: 85 db test %ebx,%ebx
800bf8: 75 0a jne 800c04 <strtol+0x44>
s++, base = 8;
else if (base == 0)
base = 10;
800bfa: bb 0a 00 00 00 mov $0xa,%ebx
else if (base == 0 && s[0] == '0')
800bff: 80 39 30 cmpb $0x30,(%ecx)
800c02: 74 28 je 800c2c <strtol+0x6c>
base = 10;
800c04: b8 00 00 00 00 mov $0x0,%eax
800c09: 89 5d 10 mov %ebx,0x10(%ebp)
800c0c: eb 50 jmp 800c5e <strtol+0x9e>
s++;
800c0e: 83 c1 01 add $0x1,%ecx
int neg = 0;
800c11: bf 00 00 00 00 mov $0x0,%edi
800c16: eb d1 jmp 800be9 <strtol+0x29>
s++, neg = 1;
800c18: 83 c1 01 add $0x1,%ecx
800c1b: bf 01 00 00 00 mov $0x1,%edi
800c20: eb c7 jmp 800be9 <strtol+0x29>
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
800c22: 80 79 01 78 cmpb $0x78,0x1(%ecx)
800c26: 74 0e je 800c36 <strtol+0x76>
else if (base == 0 && s[0] == '0')
800c28: 85 db test %ebx,%ebx
800c2a: 75 d8 jne 800c04 <strtol+0x44>
s++, base = 8;
800c2c: 83 c1 01 add $0x1,%ecx
800c2f: bb 08 00 00 00 mov $0x8,%ebx
800c34: eb ce jmp 800c04 <strtol+0x44>
s += 2, base = 16;
800c36: 83 c1 02 add $0x2,%ecx
800c39: bb 10 00 00 00 mov $0x10,%ebx
800c3e: eb c4 jmp 800c04 <strtol+0x44>
while (1) {
int dig;
if (*s >= '0' && *s <= '9')
dig = *s - '0';
else if (*s >= 'a' && *s <= 'z')
800c40: 8d 72 9f lea -0x61(%edx),%esi
800c43: 89 f3 mov %esi,%ebx
800c45: 80 fb 19 cmp $0x19,%bl
800c48: 77 29 ja 800c73 <strtol+0xb3>
dig = *s - 'a' + 10;
800c4a: 0f be d2 movsbl %dl,%edx
800c4d: 83 ea 57 sub $0x57,%edx
else if (*s >= 'A' && *s <= 'Z')
dig = *s - 'A' + 10;
else
break;
if (dig >= base)
800c50: 3b 55 10 cmp 0x10(%ebp),%edx
800c53: 7d 30 jge 800c85 <strtol+0xc5>
break;
s++, val = (val * base) + dig;
800c55: 83 c1 01 add $0x1,%ecx
800c58: 0f af 45 10 imul 0x10(%ebp),%eax
800c5c: 01 d0 add %edx,%eax
if (*s >= '0' && *s <= '9')
800c5e: 0f b6 11 movzbl (%ecx),%edx
800c61: 8d 72 d0 lea -0x30(%edx),%esi
800c64: 89 f3 mov %esi,%ebx
800c66: 80 fb 09 cmp $0x9,%bl
800c69: 77 d5 ja 800c40 <strtol+0x80>
dig = *s - '0';
800c6b: 0f be d2 movsbl %dl,%edx
800c6e: 83 ea 30 sub $0x30,%edx
800c71: eb dd jmp 800c50 <strtol+0x90>
else if (*s >= 'A' && *s <= 'Z')
800c73: 8d 72 bf lea -0x41(%edx),%esi
800c76: 89 f3 mov %esi,%ebx
800c78: 80 fb 19 cmp $0x19,%bl
800c7b: 77 08 ja 800c85 <strtol+0xc5>
dig = *s - 'A' + 10;
800c7d: 0f be d2 movsbl %dl,%edx
800c80: 83 ea 37 sub $0x37,%edx
800c83: eb cb jmp 800c50 <strtol+0x90>
// we don't properly detect overflow!
}
if (endptr)
800c85: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
800c89: 74 05 je 800c90 <strtol+0xd0>
*endptr = (char *) s;
800c8b: 8b 75 0c mov 0xc(%ebp),%esi
800c8e: 89 0e mov %ecx,(%esi)
return (neg ? -val : val);
800c90: 89 c2 mov %eax,%edx
800c92: f7 da neg %edx
800c94: 85 ff test %edi,%edi
800c96: 0f 45 c2 cmovne %edx,%eax
}
800c99: 5b pop %ebx
800c9a: 5e pop %esi
800c9b: 5f pop %edi
800c9c: 5d pop %ebp
800c9d: c3 ret
800c9e: 66 90 xchg %ax,%ax
00800ca0 <__udivdi3>:
800ca0: 55 push %ebp
800ca1: 57 push %edi
800ca2: 56 push %esi
800ca3: 53 push %ebx
800ca4: 83 ec 1c sub $0x1c,%esp
800ca7: 8b 54 24 3c mov 0x3c(%esp),%edx
800cab: 8b 6c 24 30 mov 0x30(%esp),%ebp
800caf: 8b 74 24 34 mov 0x34(%esp),%esi
800cb3: 8b 5c 24 38 mov 0x38(%esp),%ebx
800cb7: 85 d2 test %edx,%edx
800cb9: 75 35 jne 800cf0 <__udivdi3+0x50>
800cbb: 39 f3 cmp %esi,%ebx
800cbd: 0f 87 bd 00 00 00 ja 800d80 <__udivdi3+0xe0>
800cc3: 85 db test %ebx,%ebx
800cc5: 89 d9 mov %ebx,%ecx
800cc7: 75 0b jne 800cd4 <__udivdi3+0x34>
800cc9: b8 01 00 00 00 mov $0x1,%eax
800cce: 31 d2 xor %edx,%edx
800cd0: f7 f3 div %ebx
800cd2: 89 c1 mov %eax,%ecx
800cd4: 31 d2 xor %edx,%edx
800cd6: 89 f0 mov %esi,%eax
800cd8: f7 f1 div %ecx
800cda: 89 c6 mov %eax,%esi
800cdc: 89 e8 mov %ebp,%eax
800cde: 89 f7 mov %esi,%edi
800ce0: f7 f1 div %ecx
800ce2: 89 fa mov %edi,%edx
800ce4: 83 c4 1c add $0x1c,%esp
800ce7: 5b pop %ebx
800ce8: 5e pop %esi
800ce9: 5f pop %edi
800cea: 5d pop %ebp
800ceb: c3 ret
800cec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
800cf0: 39 f2 cmp %esi,%edx
800cf2: 77 7c ja 800d70 <__udivdi3+0xd0>
800cf4: 0f bd fa bsr %edx,%edi
800cf7: 83 f7 1f xor $0x1f,%edi
800cfa: 0f 84 98 00 00 00 je 800d98 <__udivdi3+0xf8>
800d00: 89 f9 mov %edi,%ecx
800d02: b8 20 00 00 00 mov $0x20,%eax
800d07: 29 f8 sub %edi,%eax
800d09: d3 e2 shl %cl,%edx
800d0b: 89 54 24 08 mov %edx,0x8(%esp)
800d0f: 89 c1 mov %eax,%ecx
800d11: 89 da mov %ebx,%edx
800d13: d3 ea shr %cl,%edx
800d15: 8b 4c 24 08 mov 0x8(%esp),%ecx
800d19: 09 d1 or %edx,%ecx
800d1b: 89 f2 mov %esi,%edx
800d1d: 89 4c 24 08 mov %ecx,0x8(%esp)
800d21: 89 f9 mov %edi,%ecx
800d23: d3 e3 shl %cl,%ebx
800d25: 89 c1 mov %eax,%ecx
800d27: d3 ea shr %cl,%edx
800d29: 89 f9 mov %edi,%ecx
800d2b: 89 5c 24 0c mov %ebx,0xc(%esp)
800d2f: d3 e6 shl %cl,%esi
800d31: 89 eb mov %ebp,%ebx
800d33: 89 c1 mov %eax,%ecx
800d35: d3 eb shr %cl,%ebx
800d37: 09 de or %ebx,%esi
800d39: 89 f0 mov %esi,%eax
800d3b: f7 74 24 08 divl 0x8(%esp)
800d3f: 89 d6 mov %edx,%esi
800d41: 89 c3 mov %eax,%ebx
800d43: f7 64 24 0c mull 0xc(%esp)
800d47: 39 d6 cmp %edx,%esi
800d49: 72 0c jb 800d57 <__udivdi3+0xb7>
800d4b: 89 f9 mov %edi,%ecx
800d4d: d3 e5 shl %cl,%ebp
800d4f: 39 c5 cmp %eax,%ebp
800d51: 73 5d jae 800db0 <__udivdi3+0x110>
800d53: 39 d6 cmp %edx,%esi
800d55: 75 59 jne 800db0 <__udivdi3+0x110>
800d57: 8d 43 ff lea -0x1(%ebx),%eax
800d5a: 31 ff xor %edi,%edi
800d5c: 89 fa mov %edi,%edx
800d5e: 83 c4 1c add $0x1c,%esp
800d61: 5b pop %ebx
800d62: 5e pop %esi
800d63: 5f pop %edi
800d64: 5d pop %ebp
800d65: c3 ret
800d66: 8d 76 00 lea 0x0(%esi),%esi
800d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
800d70: 31 ff xor %edi,%edi
800d72: 31 c0 xor %eax,%eax
800d74: 89 fa mov %edi,%edx
800d76: 83 c4 1c add $0x1c,%esp
800d79: 5b pop %ebx
800d7a: 5e pop %esi
800d7b: 5f pop %edi
800d7c: 5d pop %ebp
800d7d: c3 ret
800d7e: 66 90 xchg %ax,%ax
800d80: 31 ff xor %edi,%edi
800d82: 89 e8 mov %ebp,%eax
800d84: 89 f2 mov %esi,%edx
800d86: f7 f3 div %ebx
800d88: 89 fa mov %edi,%edx
800d8a: 83 c4 1c add $0x1c,%esp
800d8d: 5b pop %ebx
800d8e: 5e pop %esi
800d8f: 5f pop %edi
800d90: 5d pop %ebp
800d91: c3 ret
800d92: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
800d98: 39 f2 cmp %esi,%edx
800d9a: 72 06 jb 800da2 <__udivdi3+0x102>
800d9c: 31 c0 xor %eax,%eax
800d9e: 39 eb cmp %ebp,%ebx
800da0: 77 d2 ja 800d74 <__udivdi3+0xd4>
800da2: b8 01 00 00 00 mov $0x1,%eax
800da7: eb cb jmp 800d74 <__udivdi3+0xd4>
800da9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
800db0: 89 d8 mov %ebx,%eax
800db2: 31 ff xor %edi,%edi
800db4: eb be jmp 800d74 <__udivdi3+0xd4>
800db6: 66 90 xchg %ax,%ax
800db8: 66 90 xchg %ax,%ax
800dba: 66 90 xchg %ax,%ax
800dbc: 66 90 xchg %ax,%ax
800dbe: 66 90 xchg %ax,%ax
00800dc0 <__umoddi3>:
800dc0: 55 push %ebp
800dc1: 57 push %edi
800dc2: 56 push %esi
800dc3: 53 push %ebx
800dc4: 83 ec 1c sub $0x1c,%esp
800dc7: 8b 6c 24 3c mov 0x3c(%esp),%ebp
800dcb: 8b 74 24 30 mov 0x30(%esp),%esi
800dcf: 8b 5c 24 34 mov 0x34(%esp),%ebx
800dd3: 8b 7c 24 38 mov 0x38(%esp),%edi
800dd7: 85 ed test %ebp,%ebp
800dd9: 89 f0 mov %esi,%eax
800ddb: 89 da mov %ebx,%edx
800ddd: 75 19 jne 800df8 <__umoddi3+0x38>
800ddf: 39 df cmp %ebx,%edi
800de1: 0f 86 b1 00 00 00 jbe 800e98 <__umoddi3+0xd8>
800de7: f7 f7 div %edi
800de9: 89 d0 mov %edx,%eax
800deb: 31 d2 xor %edx,%edx
800ded: 83 c4 1c add $0x1c,%esp
800df0: 5b pop %ebx
800df1: 5e pop %esi
800df2: 5f pop %edi
800df3: 5d pop %ebp
800df4: c3 ret
800df5: 8d 76 00 lea 0x0(%esi),%esi
800df8: 39 dd cmp %ebx,%ebp
800dfa: 77 f1 ja 800ded <__umoddi3+0x2d>
800dfc: 0f bd cd bsr %ebp,%ecx
800dff: 83 f1 1f xor $0x1f,%ecx
800e02: 89 4c 24 04 mov %ecx,0x4(%esp)
800e06: 0f 84 b4 00 00 00 je 800ec0 <__umoddi3+0x100>
800e0c: b8 20 00 00 00 mov $0x20,%eax
800e11: 89 c2 mov %eax,%edx
800e13: 8b 44 24 04 mov 0x4(%esp),%eax
800e17: 29 c2 sub %eax,%edx
800e19: 89 c1 mov %eax,%ecx
800e1b: 89 f8 mov %edi,%eax
800e1d: d3 e5 shl %cl,%ebp
800e1f: 89 d1 mov %edx,%ecx
800e21: 89 54 24 0c mov %edx,0xc(%esp)
800e25: d3 e8 shr %cl,%eax
800e27: 09 c5 or %eax,%ebp
800e29: 8b 44 24 04 mov 0x4(%esp),%eax
800e2d: 89 c1 mov %eax,%ecx
800e2f: d3 e7 shl %cl,%edi
800e31: 89 d1 mov %edx,%ecx
800e33: 89 7c 24 08 mov %edi,0x8(%esp)
800e37: 89 df mov %ebx,%edi
800e39: d3 ef shr %cl,%edi
800e3b: 89 c1 mov %eax,%ecx
800e3d: 89 f0 mov %esi,%eax
800e3f: d3 e3 shl %cl,%ebx
800e41: 89 d1 mov %edx,%ecx
800e43: 89 fa mov %edi,%edx
800e45: d3 e8 shr %cl,%eax
800e47: 0f b6 4c 24 04 movzbl 0x4(%esp),%ecx
800e4c: 09 d8 or %ebx,%eax
800e4e: f7 f5 div %ebp
800e50: d3 e6 shl %cl,%esi
800e52: 89 d1 mov %edx,%ecx
800e54: f7 64 24 08 mull 0x8(%esp)
800e58: 39 d1 cmp %edx,%ecx
800e5a: 89 c3 mov %eax,%ebx
800e5c: 89 d7 mov %edx,%edi
800e5e: 72 06 jb 800e66 <__umoddi3+0xa6>
800e60: 75 0e jne 800e70 <__umoddi3+0xb0>
800e62: 39 c6 cmp %eax,%esi
800e64: 73 0a jae 800e70 <__umoddi3+0xb0>
800e66: 2b 44 24 08 sub 0x8(%esp),%eax
800e6a: 19 ea sbb %ebp,%edx
800e6c: 89 d7 mov %edx,%edi
800e6e: 89 c3 mov %eax,%ebx
800e70: 89 ca mov %ecx,%edx
800e72: 0f b6 4c 24 0c movzbl 0xc(%esp),%ecx
800e77: 29 de sub %ebx,%esi
800e79: 19 fa sbb %edi,%edx
800e7b: 8b 5c 24 04 mov 0x4(%esp),%ebx
800e7f: 89 d0 mov %edx,%eax
800e81: d3 e0 shl %cl,%eax
800e83: 89 d9 mov %ebx,%ecx
800e85: d3 ee shr %cl,%esi
800e87: d3 ea shr %cl,%edx
800e89: 09 f0 or %esi,%eax
800e8b: 83 c4 1c add $0x1c,%esp
800e8e: 5b pop %ebx
800e8f: 5e pop %esi
800e90: 5f pop %edi
800e91: 5d pop %ebp
800e92: c3 ret
800e93: 90 nop
800e94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
800e98: 85 ff test %edi,%edi
800e9a: 89 f9 mov %edi,%ecx
800e9c: 75 0b jne 800ea9 <__umoddi3+0xe9>
800e9e: b8 01 00 00 00 mov $0x1,%eax
800ea3: 31 d2 xor %edx,%edx
800ea5: f7 f7 div %edi
800ea7: 89 c1 mov %eax,%ecx
800ea9: 89 d8 mov %ebx,%eax
800eab: 31 d2 xor %edx,%edx
800ead: f7 f1 div %ecx
800eaf: 89 f0 mov %esi,%eax
800eb1: f7 f1 div %ecx
800eb3: e9 31 ff ff ff jmp 800de9 <__umoddi3+0x29>
800eb8: 90 nop
800eb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
800ec0: 39 dd cmp %ebx,%ebp
800ec2: 72 08 jb 800ecc <__umoddi3+0x10c>
800ec4: 39 f7 cmp %esi,%edi
800ec6: 0f 87 21 ff ff ff ja 800ded <__umoddi3+0x2d>
800ecc: 89 da mov %ebx,%edx
800ece: 89 f0 mov %esi,%eax
800ed0: 29 f8 sub %edi,%eax
800ed2: 19 ea sbb %ebp,%edx
800ed4: e9 14 ff ff ff jmp 800ded <__umoddi3+0x2d>
| 40.307551 | 78 | 0.454356 |
5328e674a4f00cc8d24f03dd1ba068216a71b5b1 | 357 | asm | Assembly | programs/oeis/242/A242601.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/242/A242601.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/242/A242601.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A242601: Integers repeated twice in a canonical order.
; 0,0,1,1,-1,-1,2,2,-2,-2,3,3,-3,-3,4,4,-4,-4,5,5,-5,-5,6,6,-6,-6,7,7,-7,-7,8,8,-8,-8,9,9,-9,-9,10,10,-10,-10,11,11,-11,-11,12,12,-12,-12,13,13,-13,-13,14,14,-14,-14,15,15,-15,-15,16,16,-16,-16,17,17,-17,-17,18,18,-18,-18,19,19,-19,-19,20,20,-20,-20
div $0,2
mov $1,-2
bin $1,$0
div $1,-2
mov $0,$1
| 39.666667 | 249 | 0.54902 |
d83c0e27ad1c7ae1e73a849abaef06ff7dab50dd | 469 | asm | Assembly | programs/oeis/267/A267778.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/267/A267778.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/267/A267778.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A267778: Triangle read by rows giving successive states of cellular automaton generated by "Rule 211" initiated with a single ON (black) cell.
; 1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1
add $0,2
mov $1,1
mov $2,3
mov $3,$0
lpb $0
sub $0,$2
add $1,$2
add $2,2
lpe
bin $1,$3
add $1,1
mod $1,2
mov $0,$1
| 27.588235 | 201 | 0.590618 |
9f8df483aa22000dad90e8e7eed28425c7f76431 | 152 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___h2schar_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___h2schar_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/___h2schar_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math16
PUBLIC ___h2schar_callee
EXTERN cm16_sdcc___h2schar_callee
defc ___h2schar_callee = cm16_sdcc___h2schar_callee
| 21.714286 | 55 | 0.809211 |
7f95e78a4aaf8785ec4981e366d924ded6c3cbe7 | 6,439 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1704.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1704.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1704.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x121bf, %rsi
lea addresses_D_ht+0x58bf, %rdi
nop
nop
cmp $11756, %rbx
mov $35, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $34773, %rax
lea addresses_D_ht+0x50bf, %rsi
lea addresses_WT_ht+0x94bf, %rdi
clflush (%rdi)
nop
nop
nop
nop
and $55609, %r14
mov $125, %rcx
rep movsw
sub $13181, %rax
lea addresses_D_ht+0x192ff, %rsi
lea addresses_normal_ht+0x180bf, %rdi
clflush (%rsi)
nop
sub $22495, %r10
mov $36, %rcx
rep movsl
nop
nop
nop
sub $44355, %r14
lea addresses_normal_ht+0xd01a, %r10
nop
xor %rbx, %rbx
movw $0x6162, (%r10)
nop
inc %rdi
lea addresses_D_ht+0x30bf, %rsi
lea addresses_A_ht+0x6d97, %rdi
nop
nop
nop
nop
xor $15570, %r12
mov $31, %rcx
rep movsw
dec %rcx
lea addresses_D_ht+0x17b7b, %rdi
inc %rsi
mov (%rdi), %ax
and $57401, %r14
lea addresses_D_ht+0x198bf, %rdi
nop
cmp %rax, %rax
movl $0x61626364, (%rdi)
nop
sub $14998, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rdx
// Store
mov $0x71f, %r9
nop
nop
nop
nop
nop
inc %r8
mov $0x5152535455565758, %r13
movq %r13, %xmm7
vmovups %ymm7, (%r9)
nop
dec %r13
// Store
mov $0x2b114100000002df, %r10
inc %rcx
movl $0x51525354, (%r10)
nop
nop
nop
xor $47607, %r13
// Store
lea addresses_RW+0x240e, %r8
nop
nop
nop
nop
and %rbp, %rbp
mov $0x5152535455565758, %rcx
movq %rcx, (%r8)
nop
nop
nop
nop
nop
xor %rcx, %rcx
// Faulty Load
lea addresses_A+0xb8bf, %r13
nop
add $9325, %rcx
movb (%r13), %r8b
lea oracles, %r10
and $0xff, %r8
shlq $12, %r8
mov (%r10,%r8,1), %r8
pop %rdx
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 38.100592 | 2,999 | 0.657245 |
32ed3d26a4668d870ca1e02f3e06af3124858855 | 1,070 | asm | Assembly | src/test/ref/library-constructor-3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/library-constructor-3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/library-constructor-3.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Demonstrates Library Constructor Functionality
// Multiple #pragma constructor_for() constructors
// Commodore 64 PRG executable file
.file [name="library-constructor-3.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(__start)
.label sym = 4
.label SCREEN = 2
.segment Code
__start: {
// volatile char sym
lda #0
sta.z sym
// char * volatile SCREEN
sta.z SCREEN
sta.z SCREEN+1
// #pragma constructor_for(init_1, print)
jsr init_1
// #pragma constructor_for(init_2, print)
jsr init_2
jsr main
rts
}
init_2: {
// SCREEN = (char*)0x0400
lda #<$400
sta.z SCREEN
lda #>$400
sta.z SCREEN+1
// }
rts
}
init_1: {
// sym = '*'
lda #'*'
sta.z sym
// }
rts
}
main: {
// print()
jsr print
// }
rts
}
print: {
// *SCREEN = sym
lda.z sym
ldy #0
sta (SCREEN),y
// }
rts
}
| 18.448276 | 72 | 0.599065 |
a1beb2c8fb63279a0c68b9a773c5d36e6488874f | 1,739 | asm | Assembly | programs/oeis/153/A153783.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/153/A153783.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/153/A153783.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A153783: 3 times 11-gonal (or hendecagonal) numbers: 3*n*(9*n-7)/2.
; 0,3,33,90,174,285,423,588,780,999,1245,1518,1818,2145,2499,2880,3288,3723,4185,4674,5190,5733,6303,6900,7524,8175,8853,9558,10290,11049,11835,12648,13488,14355,15249,16170,17118,18093,19095,20124,21180,22263,23373,24510,25674,26865,28083,29328,30600,31899,33225,34578,35958,37365,38799,40260,41748,43263,44805,46374,47970,49593,51243,52920,54624,56355,58113,59898,61710,63549,65415,67308,69228,71175,73149,75150,77178,79233,81315,83424,85560,87723,89913,92130,94374,96645,98943,101268,103620,105999,108405,110838,113298,115785,118299,120840,123408,126003,128625,131274,133950,136653,139383,142140,144924,147735,150573,153438,156330,159249,162195,165168,168168,171195,174249,177330,180438,183573,186735,189924,193140,196383,199653,202950,206274,209625,213003,216408,219840,223299,226785,230298,233838,237405,240999,244620,248268,251943,255645,259374,263130,266913,270723,274560,278424,282315,286233,290178,294150,298149,302175,306228,310308,314415,318549,322710,326898,331113,335355,339624,343920,348243,352593,356970,361374,365805,370263,374748,379260,383799,388365,392958,397578,402225,406899,411600,416328,421083,425865,430674,435510,440373,445263,450180,455124,460095,465093,470118,475170,480249,485355,490488,495648,500835,506049,511290,516558,521853,527175,532524,537900,543303,548733,554190,559674,565185,570723,576288,581880,587499,593145,598818,604518,610245,615999,621780,627588,633423,639285,645174,651090,657033,663003,669000,675024,681075,687153,693258,699390,705549,711735,717948,724188,730455,736749,743070,749418,755793,762195,768624,775080,781563,788073,794610,801174,807765,814383,821028,827700,834399
mov $1,$0
bin $0,2
mul $0,9
add $1,$0
mul $1,3
| 193.222222 | 1,620 | 0.828637 |
34ca4cf40a21bb47146c80ff2f8fd266920a576e | 6,892 | asm | Assembly | Library/Saver/saverRandom.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Saver/saverRandom.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Saver/saverRandom.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT:
MODULE:
FILE: saverRandom.asm
AUTHOR: Adam de Boor, Dec 8, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 12/ 8/92 Initial revision
DESCRIPTION:
Functions to generate random numbers.
$Id: saverRandom.asm,v 1.1 97/04/07 10:44:27 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaverRandomTemplate segment resource
;
; State for the random-number generator. This beast comes from the
; BSD random-number generator, which is supposed to be random in all 31
; bits it produces...
;
RAND_DEG equ 31
RAND_SEP equ 3
RAND_MULT equ 1103515245
RAND_ADD equ 12345
frontPtr nptr.dword randTbl[(RAND_SEP+1)*dword]
rearPtr nptr.dword randTbl[1*dword]
endPtr nptr.dword randTbl[(RAND_DEG+1)*dword]
randTbl dword 3, ; generator type
0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb,
0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86,
0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7,
0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b,
0xf5ad9d0e, 0x8999220b, 0x27fb47b9
SaverRandomTemplate ends
SaverRandomCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SaverRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return a random number
CALLED BY: GLOBAL
PASS: dx = max for returned value
bx = token for random number generator
RETURN: dx = number between 0 and max-1
DESTROYED: ax
PSEUDO CODE/STRATEGY:
We assume we're using a type 3 random number generator here,
so the code looks like this:
*frontPtr += *rearPtr;
i = (*frontPtr >> 1)&0x7fffffff;
if (++frontPtr >= endPtr) {
frontPtr = state;
rearPtr += 1;
} else if (++rearPtr >= endPtr) {
rearPtr = state;
}
return(i % DL);
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 3/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaverRandom proc far
uses ds, cx, si, di
.enter
call MemLock
mov ds, ax
assume ds:SaverRandomTemplate
mov si, ds:[frontPtr]
mov di, ds:[rearPtr]
mov ax, ({dword}ds:[di]).low
mov cx, ({dword}ds:[di]).high
add ax, ({dword}ds:[si]).low
adc cx, ({dword}ds:[si]).high
mov ({dword}ds:[si]).low, ax
mov ({dword}ds:[si]).high, cx
shr cx
rcr ax
add si, size dword
add di, size dword
cmp si, ds:[endPtr]
jb adjustRear
mov si, offset (randTbl[1*dword])
jmp storePtrs
adjustRear:
cmp di, ds:[endPtr]
jb storePtrs
mov di, offset (randTbl[1*dword])
storePtrs:
mov ds:[frontPtr], si
mov ds:[rearPtr], di
mov cx, dx ; ignore high word, to avoid painful
; divide. Since all the bits are
; random, we just make do with the
; low sixteen, thereby avoiding
; quotient-too-large faults
clr dx
div cx
call MemUnlock
assume ds:nothing
.leave
ret
SaverRandom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SaverSeedRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Seed the random number generator, using 128 bytes of state
CALLED BY: (GLOBAL)
PASS: dx:ax = initial seed
bx = generator to change, or 0 to create new one
RETURN: bx = token to pass to SaverRandom
DESTROYED: dx, ax
PSEUDO CODE/STRATEGY:
state[0] = seed;
for (i = 1; i < RAND_DEG; i++) {
state[i] = 1103515245*state[i-1] + 12345;
}
frontPtr = &state[RAND_SEP];
rearPtr = &state[0];
for (i = 0; i < 10*RAND_DEG; i++) {
SaverRandom();
}
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaverSeedRandom proc far
uses si, di, cx, ds, es
.enter
tst bx
jnz haveGenerator
mov bx, handle SaverRandomTemplate
call GeodeDuplicateResource
haveGenerator:
push ax
call MemLock
mov ds, ax
mov es, ax
pop ax
assume ds:SaverRandomTemplate
mov di, offset (randTbl[1*dword])
mov cx, RAND_DEG-1
push bx
seedLoop:
mov ({dword}ds:[di]).low, ax
mov ({dword}ds:[di]).high, dx
add di, size dword
;
; Perform a 32-bit unsigned multiply by RAND_MULT, leaving the result
; in si:bx:
;
; h mh ml l
;ax*low(RAND_MULT) x x
;dx*low(RAND_MULT) x x
;ax*high(RAND_MULT) x x
;dx*high(RAND_MULT) x x
;
; The highest two words are discarded, which means we don't even have
; to multiply dx by high(RAND_MULT).
;
push ax
push dx
mov dx, RAND_MULT AND 0xffff
mul dx
xchg bx, ax ; bx <- low(result)
mov si, dx ; si <- partial high(result)
pop ax ; ax <- original dx
mov dx, RAND_MULT AND 0xffff
mul dx
add si, ax ; high(result) += low(dx*low(RAND_MULT))
pop ax ; ax <- original ax
mov dx, RAND_MULT / 65536
mul dx
add si, ax ; high(result)+=low(high(RAND_MULT)*ax)
;
; Place result in the proper registers and add in the additive factor.
;
mov dx, si
mov ax, bx
add ax, RAND_ADD
adc dx, 0
loop seedLoop
pop bx
;
; Store the final result.
;
mov ({dword}ds:[di]).low, ax
mov ({dword}ds:[di]).high, dx
;
; Initialize the pointers.
;
mov ds:[frontPtr], offset (randTbl[(RAND_SEP+1)*dword])
mov ds:[rearPtr], offset (randTbl[1*dword])
;
; Now randomize the state according to the degree of the
; polynomial we're using.
;
mov cx, 10*RAND_DEG
initLoop:
mov dx, 0xffff
call SaverRandom
loop initLoop
call MemUnlock
.leave
ret
SaverSeedRandom endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SaverEndRandom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finish using a random-number generator.
CALLED BY: (GLOBAL)
PASS: bx = token returned by SaverSeedRandom
RETURN: nothing
DESTROYED: bx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 12/ 8/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaverEndRandom proc far
.enter
call MemFree
.leave
ret
SaverEndRandom endp
SaverRandomCode ends
| 23.442177 | 79 | 0.565438 |
06067a25eaf4e2af27e4ebb16686b92b90e803ea | 41,108 | asm | Assembly | kill.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null | kill.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null | kill.asm | avabe/Operating_Systems_Assignment1 | 3f2c5de3767fadf16e7feb054a37fc9543b38b0f | [
"MIT-0"
] | null | null | null |
_kill: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char **argv)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 56 push %esi
4: 53 push %ebx
5: 83 e4 f0 and $0xfffffff0,%esp
8: 83 ec 10 sub $0x10,%esp
b: 8b 45 08 mov 0x8(%ebp),%eax
e: 8b 55 0c mov 0xc(%ebp),%edx
int i;
if(argc < 2){
11: 83 f8 01 cmp $0x1,%eax
14: 7e 2f jle 45 <main+0x45>
16: 8d 5a 04 lea 0x4(%edx),%ebx
19: 8d 34 82 lea (%edx,%eax,4),%esi
1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printf(2, "usage: kill pid...\n");
exit(0);
}
for(i=1; i<argc; i++)
kill(atoi(argv[i]));
20: 8b 03 mov (%ebx),%eax
22: 83 c3 04 add $0x4,%ebx
25: 89 04 24 mov %eax,(%esp)
28: e8 23 02 00 00 call 250 <atoi>
2d: 89 04 24 mov %eax,(%esp)
30: e8 c3 02 00 00 call 2f8 <kill>
for(i=1; i<argc; i++)
35: 39 f3 cmp %esi,%ebx
37: 75 e7 jne 20 <main+0x20>
exit(0);
39: c7 04 24 00 00 00 00 movl $0x0,(%esp)
40: e8 83 02 00 00 call 2c8 <exit>
printf(2, "usage: kill pid...\n");
45: c7 44 24 04 a8 07 00 movl $0x7a8,0x4(%esp)
4c: 00
4d: c7 04 24 02 00 00 00 movl $0x2,(%esp)
54: e8 d7 03 00 00 call 430 <printf>
exit(0);
59: c7 04 24 00 00 00 00 movl $0x0,(%esp)
60: e8 63 02 00 00 call 2c8 <exit>
65: 66 90 xchg %ax,%ax
67: 66 90 xchg %ax,%ax
69: 66 90 xchg %ax,%ax
6b: 66 90 xchg %ax,%ax
6d: 66 90 xchg %ax,%ax
6f: 90 nop
00000070 <strcpy>:
#include "fcntl.h"
#include "user.h"
#include "x86.h"
char *
strcpy(char *s, const char *t) {
70: 55 push %ebp
71: 89 e5 mov %esp,%ebp
73: 8b 45 08 mov 0x8(%ebp),%eax
76: 8b 4d 0c mov 0xc(%ebp),%ecx
79: 53 push %ebx
char *os;
os = s;
while ((*s++ = *t++) != 0);
7a: 89 c2 mov %eax,%edx
7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80: 41 inc %ecx
81: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
85: 42 inc %edx
86: 84 db test %bl,%bl
88: 88 5a ff mov %bl,-0x1(%edx)
8b: 75 f3 jne 80 <strcpy+0x10>
return os;
}
8d: 5b pop %ebx
8e: 5d pop %ebp
8f: c3 ret
00000090 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
90: 55 push %ebp
char *os;
os = s;
while((n--) > 0 && ((*s++ = *t++) != 0));
91: 31 d2 xor %edx,%edx
{
93: 89 e5 mov %esp,%ebp
95: 56 push %esi
96: 8b 45 08 mov 0x8(%ebp),%eax
99: 53 push %ebx
9a: 8b 75 0c mov 0xc(%ebp),%esi
9d: 8b 5d 10 mov 0x10(%ebp),%ebx
while((n--) > 0 && ((*s++ = *t++) != 0));
a0: eb 12 jmp b4 <strncpy+0x24>
a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
a8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
ac: 88 0c 10 mov %cl,(%eax,%edx,1)
af: 42 inc %edx
b0: 84 c9 test %cl,%cl
b2: 74 08 je bc <strncpy+0x2c>
b4: 89 d9 mov %ebx,%ecx
b6: 29 d1 sub %edx,%ecx
b8: 85 c9 test %ecx,%ecx
ba: 7f ec jg a8 <strncpy+0x18>
return os;
}
bc: 5b pop %ebx
bd: 5e pop %esi
be: 5d pop %ebp
bf: c3 ret
000000c0 <strcmp>:
int
strcmp(const char *p, const char *q) {
c0: 55 push %ebp
c1: 89 e5 mov %esp,%ebp
c3: 8b 4d 08 mov 0x8(%ebp),%ecx
c6: 53 push %ebx
c7: 8b 5d 0c mov 0xc(%ebp),%ebx
while (*p && *p == *q)
ca: 0f b6 01 movzbl (%ecx),%eax
cd: 0f b6 13 movzbl (%ebx),%edx
d0: 84 c0 test %al,%al
d2: 75 18 jne ec <strcmp+0x2c>
d4: eb 22 jmp f8 <strcmp+0x38>
d6: 8d 76 00 lea 0x0(%esi),%esi
d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
e0: 41 inc %ecx
while (*p && *p == *q)
e1: 0f b6 01 movzbl (%ecx),%eax
p++, q++;
e4: 43 inc %ebx
e5: 0f b6 13 movzbl (%ebx),%edx
while (*p && *p == *q)
e8: 84 c0 test %al,%al
ea: 74 0c je f8 <strcmp+0x38>
ec: 38 d0 cmp %dl,%al
ee: 74 f0 je e0 <strcmp+0x20>
return (uchar) *p - (uchar) *q;
}
f0: 5b pop %ebx
return (uchar) *p - (uchar) *q;
f1: 29 d0 sub %edx,%eax
}
f3: 5d pop %ebp
f4: c3 ret
f5: 8d 76 00 lea 0x0(%esi),%esi
f8: 5b pop %ebx
f9: 31 c0 xor %eax,%eax
return (uchar) *p - (uchar) *q;
fb: 29 d0 sub %edx,%eax
}
fd: 5d pop %ebp
fe: c3 ret
ff: 90 nop
00000100 <strlen>:
uint
strlen(const char *s) {
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for (n = 0; s[n]; n++);
106: 80 39 00 cmpb $0x0,(%ecx)
109: 74 15 je 120 <strlen+0x20>
10b: 31 d2 xor %edx,%edx
10d: 8d 76 00 lea 0x0(%esi),%esi
110: 42 inc %edx
111: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
115: 89 d0 mov %edx,%eax
117: 75 f7 jne 110 <strlen+0x10>
return n;
}
119: 5d pop %ebp
11a: c3 ret
11b: 90 nop
11c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (n = 0; s[n]; n++);
120: 31 c0 xor %eax,%eax
}
122: 5d pop %ebp
123: c3 ret
124: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
12a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000130 <memset>:
void *
memset(void *dst, int c, uint n) {
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 8b 55 08 mov 0x8(%ebp),%edx
136: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
137: 8b 4d 10 mov 0x10(%ebp),%ecx
13a: 8b 45 0c mov 0xc(%ebp),%eax
13d: 89 d7 mov %edx,%edi
13f: fc cld
140: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
142: 5f pop %edi
143: 89 d0 mov %edx,%eax
145: 5d pop %ebp
146: c3 ret
147: 89 f6 mov %esi,%esi
149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000150 <strchr>:
char *
strchr(const char *s, char c) {
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 8b 45 08 mov 0x8(%ebp),%eax
156: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for (; *s; s++)
15a: 0f b6 10 movzbl (%eax),%edx
15d: 84 d2 test %dl,%dl
15f: 74 1b je 17c <strchr+0x2c>
if (*s == c)
161: 38 d1 cmp %dl,%cl
163: 75 0f jne 174 <strchr+0x24>
165: eb 17 jmp 17e <strchr+0x2e>
167: 89 f6 mov %esi,%esi
169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
170: 38 ca cmp %cl,%dl
172: 74 0a je 17e <strchr+0x2e>
for (; *s; s++)
174: 40 inc %eax
175: 0f b6 10 movzbl (%eax),%edx
178: 84 d2 test %dl,%dl
17a: 75 f4 jne 170 <strchr+0x20>
return (char *) s;
return 0;
17c: 31 c0 xor %eax,%eax
}
17e: 5d pop %ebp
17f: c3 ret
00000180 <gets>:
char *
gets(char *buf, int max) {
180: 55 push %ebp
181: 89 e5 mov %esp,%ebp
183: 57 push %edi
184: 56 push %esi
int i, cc;
char c;
for (i = 0; i + 1 < max;) {
185: 31 f6 xor %esi,%esi
gets(char *buf, int max) {
187: 53 push %ebx
188: 83 ec 3c sub $0x3c,%esp
18b: 8b 5d 08 mov 0x8(%ebp),%ebx
cc = read(0, &c, 1);
18e: 8d 7d e7 lea -0x19(%ebp),%edi
for (i = 0; i + 1 < max;) {
191: eb 32 jmp 1c5 <gets+0x45>
193: 90 nop
194: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cc = read(0, &c, 1);
198: ba 01 00 00 00 mov $0x1,%edx
19d: 89 54 24 08 mov %edx,0x8(%esp)
1a1: 89 7c 24 04 mov %edi,0x4(%esp)
1a5: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1ac: e8 2f 01 00 00 call 2e0 <read>
if (cc < 1)
1b1: 85 c0 test %eax,%eax
1b3: 7e 19 jle 1ce <gets+0x4e>
break;
buf[i++] = c;
1b5: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
1b9: 43 inc %ebx
1ba: 88 43 ff mov %al,-0x1(%ebx)
if (c == '\n' || c == '\r')
1bd: 3c 0a cmp $0xa,%al
1bf: 74 1f je 1e0 <gets+0x60>
1c1: 3c 0d cmp $0xd,%al
1c3: 74 1b je 1e0 <gets+0x60>
for (i = 0; i + 1 < max;) {
1c5: 46 inc %esi
1c6: 3b 75 0c cmp 0xc(%ebp),%esi
1c9: 89 5d d4 mov %ebx,-0x2c(%ebp)
1cc: 7c ca jl 198 <gets+0x18>
break;
}
buf[i] = '\0';
1ce: 8b 45 d4 mov -0x2c(%ebp),%eax
1d1: c6 00 00 movb $0x0,(%eax)
return buf;
}
1d4: 8b 45 08 mov 0x8(%ebp),%eax
1d7: 83 c4 3c add $0x3c,%esp
1da: 5b pop %ebx
1db: 5e pop %esi
1dc: 5f pop %edi
1dd: 5d pop %ebp
1de: c3 ret
1df: 90 nop
1e0: 8b 45 08 mov 0x8(%ebp),%eax
1e3: 01 c6 add %eax,%esi
1e5: 89 75 d4 mov %esi,-0x2c(%ebp)
1e8: eb e4 jmp 1ce <gets+0x4e>
1ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000001f0 <stat>:
int
stat(const char *n, struct stat *st) {
1f0: 55 push %ebp
int fd;
int r;
fd = open(n, O_RDONLY);
1f1: 31 c0 xor %eax,%eax
stat(const char *n, struct stat *st) {
1f3: 89 e5 mov %esp,%ebp
1f5: 83 ec 18 sub $0x18,%esp
fd = open(n, O_RDONLY);
1f8: 89 44 24 04 mov %eax,0x4(%esp)
1fc: 8b 45 08 mov 0x8(%ebp),%eax
stat(const char *n, struct stat *st) {
1ff: 89 5d f8 mov %ebx,-0x8(%ebp)
202: 89 75 fc mov %esi,-0x4(%ebp)
fd = open(n, O_RDONLY);
205: 89 04 24 mov %eax,(%esp)
208: e8 fb 00 00 00 call 308 <open>
if (fd < 0)
20d: 85 c0 test %eax,%eax
20f: 78 2f js 240 <stat+0x50>
211: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
213: 8b 45 0c mov 0xc(%ebp),%eax
216: 89 1c 24 mov %ebx,(%esp)
219: 89 44 24 04 mov %eax,0x4(%esp)
21d: e8 fe 00 00 00 call 320 <fstat>
close(fd);
222: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
225: 89 c6 mov %eax,%esi
close(fd);
227: e8 c4 00 00 00 call 2f0 <close>
return r;
}
22c: 89 f0 mov %esi,%eax
22e: 8b 5d f8 mov -0x8(%ebp),%ebx
231: 8b 75 fc mov -0x4(%ebp),%esi
234: 89 ec mov %ebp,%esp
236: 5d pop %ebp
237: c3 ret
238: 90 nop
239: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
240: be ff ff ff ff mov $0xffffffff,%esi
245: eb e5 jmp 22c <stat+0x3c>
247: 89 f6 mov %esi,%esi
249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000250 <atoi>:
int
atoi(const char *s) {
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 8b 4d 08 mov 0x8(%ebp),%ecx
256: 53 push %ebx
int n;
n = 0;
while ('0' <= *s && *s <= '9')
257: 0f be 11 movsbl (%ecx),%edx
25a: 88 d0 mov %dl,%al
25c: 2c 30 sub $0x30,%al
25e: 3c 09 cmp $0x9,%al
n = 0;
260: b8 00 00 00 00 mov $0x0,%eax
while ('0' <= *s && *s <= '9')
265: 77 1e ja 285 <atoi+0x35>
267: 89 f6 mov %esi,%esi
269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n * 10 + *s++ - '0';
270: 41 inc %ecx
271: 8d 04 80 lea (%eax,%eax,4),%eax
274: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while ('0' <= *s && *s <= '9')
278: 0f be 11 movsbl (%ecx),%edx
27b: 88 d3 mov %dl,%bl
27d: 80 eb 30 sub $0x30,%bl
280: 80 fb 09 cmp $0x9,%bl
283: 76 eb jbe 270 <atoi+0x20>
return n;
}
285: 5b pop %ebx
286: 5d pop %ebp
287: c3 ret
288: 90 nop
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000290 <memmove>:
void *
memmove(void *vdst, const void *vsrc, int n) {
290: 55 push %ebp
291: 89 e5 mov %esp,%ebp
293: 56 push %esi
294: 8b 45 08 mov 0x8(%ebp),%eax
297: 53 push %ebx
298: 8b 5d 10 mov 0x10(%ebp),%ebx
29b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while (n-- > 0)
29e: 85 db test %ebx,%ebx
2a0: 7e 1a jle 2bc <memmove+0x2c>
2a2: 31 d2 xor %edx,%edx
2a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
2aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
*dst++ = *src++;
2b0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
2b4: 88 0c 10 mov %cl,(%eax,%edx,1)
2b7: 42 inc %edx
while (n-- > 0)
2b8: 39 d3 cmp %edx,%ebx
2ba: 75 f4 jne 2b0 <memmove+0x20>
return vdst;
}
2bc: 5b pop %ebx
2bd: 5e pop %esi
2be: 5d pop %ebp
2bf: c3 ret
000002c0 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2c0: b8 01 00 00 00 mov $0x1,%eax
2c5: cd 40 int $0x40
2c7: c3 ret
000002c8 <exit>:
SYSCALL(exit)
2c8: b8 02 00 00 00 mov $0x2,%eax
2cd: cd 40 int $0x40
2cf: c3 ret
000002d0 <wait>:
SYSCALL(wait)
2d0: b8 03 00 00 00 mov $0x3,%eax
2d5: cd 40 int $0x40
2d7: c3 ret
000002d8 <pipe>:
SYSCALL(pipe)
2d8: b8 04 00 00 00 mov $0x4,%eax
2dd: cd 40 int $0x40
2df: c3 ret
000002e0 <read>:
SYSCALL(read)
2e0: b8 05 00 00 00 mov $0x5,%eax
2e5: cd 40 int $0x40
2e7: c3 ret
000002e8 <write>:
SYSCALL(write)
2e8: b8 10 00 00 00 mov $0x10,%eax
2ed: cd 40 int $0x40
2ef: c3 ret
000002f0 <close>:
SYSCALL(close)
2f0: b8 15 00 00 00 mov $0x15,%eax
2f5: cd 40 int $0x40
2f7: c3 ret
000002f8 <kill>:
SYSCALL(kill)
2f8: b8 06 00 00 00 mov $0x6,%eax
2fd: cd 40 int $0x40
2ff: c3 ret
00000300 <exec>:
SYSCALL(exec)
300: b8 07 00 00 00 mov $0x7,%eax
305: cd 40 int $0x40
307: c3 ret
00000308 <open>:
SYSCALL(open)
308: b8 0f 00 00 00 mov $0xf,%eax
30d: cd 40 int $0x40
30f: c3 ret
00000310 <mknod>:
SYSCALL(mknod)
310: b8 11 00 00 00 mov $0x11,%eax
315: cd 40 int $0x40
317: c3 ret
00000318 <unlink>:
SYSCALL(unlink)
318: b8 12 00 00 00 mov $0x12,%eax
31d: cd 40 int $0x40
31f: c3 ret
00000320 <fstat>:
SYSCALL(fstat)
320: b8 08 00 00 00 mov $0x8,%eax
325: cd 40 int $0x40
327: c3 ret
00000328 <link>:
SYSCALL(link)
328: b8 13 00 00 00 mov $0x13,%eax
32d: cd 40 int $0x40
32f: c3 ret
00000330 <mkdir>:
SYSCALL(mkdir)
330: b8 14 00 00 00 mov $0x14,%eax
335: cd 40 int $0x40
337: c3 ret
00000338 <chdir>:
SYSCALL(chdir)
338: b8 09 00 00 00 mov $0x9,%eax
33d: cd 40 int $0x40
33f: c3 ret
00000340 <dup>:
SYSCALL(dup)
340: b8 0a 00 00 00 mov $0xa,%eax
345: cd 40 int $0x40
347: c3 ret
00000348 <getpid>:
SYSCALL(getpid)
348: b8 0b 00 00 00 mov $0xb,%eax
34d: cd 40 int $0x40
34f: c3 ret
00000350 <sbrk>:
SYSCALL(sbrk)
350: b8 0c 00 00 00 mov $0xc,%eax
355: cd 40 int $0x40
357: c3 ret
00000358 <sleep>:
SYSCALL(sleep)
358: b8 0d 00 00 00 mov $0xd,%eax
35d: cd 40 int $0x40
35f: c3 ret
00000360 <uptime>:
SYSCALL(uptime)
360: b8 0e 00 00 00 mov $0xe,%eax
365: cd 40 int $0x40
367: c3 ret
00000368 <detach>:
SYSCALL(detach)
368: b8 16 00 00 00 mov $0x16,%eax
36d: cd 40 int $0x40
36f: c3 ret
00000370 <priority>:
SYSCALL(priority)
370: b8 17 00 00 00 mov $0x17,%eax
375: cd 40 int $0x40
377: c3 ret
00000378 <policy>:
SYSCALL(policy)
378: b8 18 00 00 00 mov $0x18,%eax
37d: cd 40 int $0x40
37f: c3 ret
00000380 <wait_stat>:
SYSCALL(wait_stat)
380: b8 19 00 00 00 mov $0x19,%eax
385: cd 40 int $0x40
387: c3 ret
388: 66 90 xchg %ax,%ax
38a: 66 90 xchg %ax,%ax
38c: 66 90 xchg %ax,%ax
38e: 66 90 xchg %ax,%ax
00000390 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
390: 55 push %ebp
391: 89 e5 mov %esp,%ebp
393: 57 push %edi
394: 56 push %esi
395: 53 push %ebx
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
396: 89 d3 mov %edx,%ebx
398: c1 eb 1f shr $0x1f,%ebx
{
39b: 83 ec 4c sub $0x4c,%esp
if(sgn && xx < 0){
39e: 84 db test %bl,%bl
{
3a0: 89 45 c0 mov %eax,-0x40(%ebp)
3a3: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
3a5: 74 79 je 420 <printint+0x90>
3a7: f6 45 08 01 testb $0x1,0x8(%ebp)
3ab: 74 73 je 420 <printint+0x90>
neg = 1;
x = -xx;
3ad: f7 d8 neg %eax
neg = 1;
3af: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
3b6: 31 f6 xor %esi,%esi
3b8: 8d 5d d7 lea -0x29(%ebp),%ebx
3bb: eb 05 jmp 3c2 <printint+0x32>
3bd: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
3c0: 89 fe mov %edi,%esi
3c2: 31 d2 xor %edx,%edx
3c4: f7 f1 div %ecx
3c6: 8d 7e 01 lea 0x1(%esi),%edi
3c9: 0f b6 92 c4 07 00 00 movzbl 0x7c4(%edx),%edx
}while((x /= base) != 0);
3d0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
3d2: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
3d5: 75 e9 jne 3c0 <printint+0x30>
if(neg)
3d7: 8b 55 c4 mov -0x3c(%ebp),%edx
3da: 85 d2 test %edx,%edx
3dc: 74 08 je 3e6 <printint+0x56>
buf[i++] = '-';
3de: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
3e3: 8d 7e 02 lea 0x2(%esi),%edi
3e6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
3ea: 8b 7d c0 mov -0x40(%ebp),%edi
3ed: 8d 76 00 lea 0x0(%esi),%esi
3f0: 0f b6 06 movzbl (%esi),%eax
3f3: 4e dec %esi
write(fd, &c, 1);
3f4: 89 5c 24 04 mov %ebx,0x4(%esp)
3f8: 89 3c 24 mov %edi,(%esp)
3fb: 88 45 d7 mov %al,-0x29(%ebp)
3fe: b8 01 00 00 00 mov $0x1,%eax
403: 89 44 24 08 mov %eax,0x8(%esp)
407: e8 dc fe ff ff call 2e8 <write>
while(--i >= 0)
40c: 39 de cmp %ebx,%esi
40e: 75 e0 jne 3f0 <printint+0x60>
putc(fd, buf[i]);
}
410: 83 c4 4c add $0x4c,%esp
413: 5b pop %ebx
414: 5e pop %esi
415: 5f pop %edi
416: 5d pop %ebp
417: c3 ret
418: 90 nop
419: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
420: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
427: eb 8d jmp 3b6 <printint+0x26>
429: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000430 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 57 push %edi
434: 56 push %esi
435: 53 push %ebx
436: 83 ec 3c sub $0x3c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
439: 8b 75 0c mov 0xc(%ebp),%esi
43c: 0f b6 1e movzbl (%esi),%ebx
43f: 84 db test %bl,%bl
441: 0f 84 d1 00 00 00 je 518 <printf+0xe8>
state = 0;
447: 31 ff xor %edi,%edi
449: 46 inc %esi
ap = (uint*)(void*)&fmt + 1;
44a: 8d 45 10 lea 0x10(%ebp),%eax
write(fd, &c, 1);
44d: 89 fa mov %edi,%edx
44f: 8b 7d 08 mov 0x8(%ebp),%edi
ap = (uint*)(void*)&fmt + 1;
452: 89 45 d0 mov %eax,-0x30(%ebp)
455: eb 41 jmp 498 <printf+0x68>
457: 89 f6 mov %esi,%esi
459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
460: 83 f8 25 cmp $0x25,%eax
463: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
466: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
46b: 74 1e je 48b <printf+0x5b>
write(fd, &c, 1);
46d: b8 01 00 00 00 mov $0x1,%eax
472: 89 44 24 08 mov %eax,0x8(%esp)
476: 8d 45 e2 lea -0x1e(%ebp),%eax
479: 89 44 24 04 mov %eax,0x4(%esp)
47d: 89 3c 24 mov %edi,(%esp)
480: 88 5d e2 mov %bl,-0x1e(%ebp)
483: e8 60 fe ff ff call 2e8 <write>
488: 8b 55 d4 mov -0x2c(%ebp),%edx
48b: 46 inc %esi
for(i = 0; fmt[i]; i++){
48c: 0f b6 5e ff movzbl -0x1(%esi),%ebx
490: 84 db test %bl,%bl
492: 0f 84 80 00 00 00 je 518 <printf+0xe8>
if(state == 0){
498: 85 d2 test %edx,%edx
c = fmt[i] & 0xff;
49a: 0f be cb movsbl %bl,%ecx
49d: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
4a0: 74 be je 460 <printf+0x30>
} else {
putc(fd, c);
}
} else if(state == '%'){
4a2: 83 fa 25 cmp $0x25,%edx
4a5: 75 e4 jne 48b <printf+0x5b>
if(c == 'd'){
4a7: 83 f8 64 cmp $0x64,%eax
4aa: 0f 84 f0 00 00 00 je 5a0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
4b0: 81 e1 f7 00 00 00 and $0xf7,%ecx
4b6: 83 f9 70 cmp $0x70,%ecx
4b9: 74 65 je 520 <printf+0xf0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
4bb: 83 f8 73 cmp $0x73,%eax
4be: 0f 84 8c 00 00 00 je 550 <printf+0x120>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4c4: 83 f8 63 cmp $0x63,%eax
4c7: 0f 84 13 01 00 00 je 5e0 <printf+0x1b0>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4cd: 83 f8 25 cmp $0x25,%eax
4d0: 0f 84 e2 00 00 00 je 5b8 <printf+0x188>
write(fd, &c, 1);
4d6: b8 01 00 00 00 mov $0x1,%eax
4db: 46 inc %esi
4dc: 89 44 24 08 mov %eax,0x8(%esp)
4e0: 8d 45 e7 lea -0x19(%ebp),%eax
4e3: 89 44 24 04 mov %eax,0x4(%esp)
4e7: 89 3c 24 mov %edi,(%esp)
4ea: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4ee: e8 f5 fd ff ff call 2e8 <write>
4f3: ba 01 00 00 00 mov $0x1,%edx
4f8: 8d 45 e6 lea -0x1a(%ebp),%eax
4fb: 89 54 24 08 mov %edx,0x8(%esp)
4ff: 89 44 24 04 mov %eax,0x4(%esp)
503: 89 3c 24 mov %edi,(%esp)
506: 88 5d e6 mov %bl,-0x1a(%ebp)
509: e8 da fd ff ff call 2e8 <write>
for(i = 0; fmt[i]; i++){
50e: 0f b6 5e ff movzbl -0x1(%esi),%ebx
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
512: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
514: 84 db test %bl,%bl
516: 75 80 jne 498 <printf+0x68>
}
}
}
518: 83 c4 3c add $0x3c,%esp
51b: 5b pop %ebx
51c: 5e pop %esi
51d: 5f pop %edi
51e: 5d pop %ebp
51f: c3 ret
printint(fd, *ap, 16, 0);
520: c7 04 24 00 00 00 00 movl $0x0,(%esp)
527: b9 10 00 00 00 mov $0x10,%ecx
52c: 8b 5d d0 mov -0x30(%ebp),%ebx
52f: 89 f8 mov %edi,%eax
531: 8b 13 mov (%ebx),%edx
533: e8 58 fe ff ff call 390 <printint>
ap++;
538: 89 d8 mov %ebx,%eax
state = 0;
53a: 31 d2 xor %edx,%edx
ap++;
53c: 83 c0 04 add $0x4,%eax
53f: 89 45 d0 mov %eax,-0x30(%ebp)
542: e9 44 ff ff ff jmp 48b <printf+0x5b>
547: 89 f6 mov %esi,%esi
549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
s = (char*)*ap;
550: 8b 45 d0 mov -0x30(%ebp),%eax
553: 8b 10 mov (%eax),%edx
ap++;
555: 83 c0 04 add $0x4,%eax
558: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
55b: 85 d2 test %edx,%edx
55d: 0f 84 aa 00 00 00 je 60d <printf+0x1dd>
while(*s != 0){
563: 0f b6 02 movzbl (%edx),%eax
s = (char*)*ap;
566: 89 d3 mov %edx,%ebx
while(*s != 0){
568: 84 c0 test %al,%al
56a: 74 27 je 593 <printf+0x163>
56c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
570: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
573: b8 01 00 00 00 mov $0x1,%eax
s++;
578: 43 inc %ebx
write(fd, &c, 1);
579: 89 44 24 08 mov %eax,0x8(%esp)
57d: 8d 45 e3 lea -0x1d(%ebp),%eax
580: 89 44 24 04 mov %eax,0x4(%esp)
584: 89 3c 24 mov %edi,(%esp)
587: e8 5c fd ff ff call 2e8 <write>
while(*s != 0){
58c: 0f b6 03 movzbl (%ebx),%eax
58f: 84 c0 test %al,%al
591: 75 dd jne 570 <printf+0x140>
state = 0;
593: 31 d2 xor %edx,%edx
595: e9 f1 fe ff ff jmp 48b <printf+0x5b>
59a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
5a0: c7 04 24 01 00 00 00 movl $0x1,(%esp)
5a7: b9 0a 00 00 00 mov $0xa,%ecx
5ac: e9 7b ff ff ff jmp 52c <printf+0xfc>
5b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
5b8: b9 01 00 00 00 mov $0x1,%ecx
5bd: 8d 45 e5 lea -0x1b(%ebp),%eax
5c0: 89 4c 24 08 mov %ecx,0x8(%esp)
5c4: 89 44 24 04 mov %eax,0x4(%esp)
5c8: 89 3c 24 mov %edi,(%esp)
5cb: 88 5d e5 mov %bl,-0x1b(%ebp)
5ce: e8 15 fd ff ff call 2e8 <write>
state = 0;
5d3: 31 d2 xor %edx,%edx
5d5: e9 b1 fe ff ff jmp 48b <printf+0x5b>
5da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
putc(fd, *ap);
5e0: 8b 5d d0 mov -0x30(%ebp),%ebx
5e3: 8b 03 mov (%ebx),%eax
ap++;
5e5: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
5e8: 89 3c 24 mov %edi,(%esp)
putc(fd, *ap);
5eb: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
5ee: b8 01 00 00 00 mov $0x1,%eax
5f3: 89 44 24 08 mov %eax,0x8(%esp)
5f7: 8d 45 e4 lea -0x1c(%ebp),%eax
5fa: 89 44 24 04 mov %eax,0x4(%esp)
5fe: e8 e5 fc ff ff call 2e8 <write>
state = 0;
603: 31 d2 xor %edx,%edx
ap++;
605: 89 5d d0 mov %ebx,-0x30(%ebp)
608: e9 7e fe ff ff jmp 48b <printf+0x5b>
s = "(null)";
60d: bb bc 07 00 00 mov $0x7bc,%ebx
while(*s != 0){
612: b0 28 mov $0x28,%al
614: e9 57 ff ff ff jmp 570 <printf+0x140>
619: 66 90 xchg %ax,%ax
61b: 66 90 xchg %ax,%ax
61d: 66 90 xchg %ax,%ax
61f: 90 nop
00000620 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
620: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
621: a1 7c 0a 00 00 mov 0xa7c,%eax
{
626: 89 e5 mov %esp,%ebp
628: 57 push %edi
629: 56 push %esi
62a: 53 push %ebx
62b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
62e: 8d 4b f8 lea -0x8(%ebx),%ecx
631: eb 0d jmp 640 <free+0x20>
633: 90 nop
634: 90 nop
635: 90 nop
636: 90 nop
637: 90 nop
638: 90 nop
639: 90 nop
63a: 90 nop
63b: 90 nop
63c: 90 nop
63d: 90 nop
63e: 90 nop
63f: 90 nop
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
640: 39 c8 cmp %ecx,%eax
642: 8b 10 mov (%eax),%edx
644: 73 32 jae 678 <free+0x58>
646: 39 d1 cmp %edx,%ecx
648: 72 04 jb 64e <free+0x2e>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
64a: 39 d0 cmp %edx,%eax
64c: 72 32 jb 680 <free+0x60>
break;
if(bp + bp->s.size == p->s.ptr){
64e: 8b 73 fc mov -0x4(%ebx),%esi
651: 8d 3c f1 lea (%ecx,%esi,8),%edi
654: 39 fa cmp %edi,%edx
656: 74 30 je 688 <free+0x68>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
658: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
65b: 8b 50 04 mov 0x4(%eax),%edx
65e: 8d 34 d0 lea (%eax,%edx,8),%esi
661: 39 f1 cmp %esi,%ecx
663: 74 3c je 6a1 <free+0x81>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
665: 89 08 mov %ecx,(%eax)
freep = p;
}
667: 5b pop %ebx
freep = p;
668: a3 7c 0a 00 00 mov %eax,0xa7c
}
66d: 5e pop %esi
66e: 5f pop %edi
66f: 5d pop %ebp
670: c3 ret
671: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
678: 39 d0 cmp %edx,%eax
67a: 72 04 jb 680 <free+0x60>
67c: 39 d1 cmp %edx,%ecx
67e: 72 ce jb 64e <free+0x2e>
{
680: 89 d0 mov %edx,%eax
682: eb bc jmp 640 <free+0x20>
684: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
688: 8b 7a 04 mov 0x4(%edx),%edi
68b: 01 fe add %edi,%esi
68d: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
690: 8b 10 mov (%eax),%edx
692: 8b 12 mov (%edx),%edx
694: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
697: 8b 50 04 mov 0x4(%eax),%edx
69a: 8d 34 d0 lea (%eax,%edx,8),%esi
69d: 39 f1 cmp %esi,%ecx
69f: 75 c4 jne 665 <free+0x45>
p->s.size += bp->s.size;
6a1: 8b 4b fc mov -0x4(%ebx),%ecx
freep = p;
6a4: a3 7c 0a 00 00 mov %eax,0xa7c
p->s.size += bp->s.size;
6a9: 01 ca add %ecx,%edx
6ab: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6ae: 8b 53 f8 mov -0x8(%ebx),%edx
6b1: 89 10 mov %edx,(%eax)
}
6b3: 5b pop %ebx
6b4: 5e pop %esi
6b5: 5f pop %edi
6b6: 5d pop %ebp
6b7: c3 ret
6b8: 90 nop
6b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000006c0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
6c0: 55 push %ebp
6c1: 89 e5 mov %esp,%ebp
6c3: 57 push %edi
6c4: 56 push %esi
6c5: 53 push %ebx
6c6: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6c9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
6cc: 8b 15 7c 0a 00 00 mov 0xa7c,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6d2: 8d 78 07 lea 0x7(%eax),%edi
6d5: c1 ef 03 shr $0x3,%edi
6d8: 47 inc %edi
if((prevp = freep) == 0){
6d9: 85 d2 test %edx,%edx
6db: 0f 84 8f 00 00 00 je 770 <malloc+0xb0>
6e1: 8b 02 mov (%edx),%eax
6e3: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
6e6: 39 cf cmp %ecx,%edi
6e8: 76 66 jbe 750 <malloc+0x90>
6ea: 81 ff 00 10 00 00 cmp $0x1000,%edi
6f0: bb 00 10 00 00 mov $0x1000,%ebx
6f5: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
6f8: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
6ff: eb 10 jmp 711 <malloc+0x51>
701: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
708: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
70a: 8b 48 04 mov 0x4(%eax),%ecx
70d: 39 f9 cmp %edi,%ecx
70f: 73 3f jae 750 <malloc+0x90>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
711: 39 05 7c 0a 00 00 cmp %eax,0xa7c
717: 89 c2 mov %eax,%edx
719: 75 ed jne 708 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
71b: 89 34 24 mov %esi,(%esp)
71e: e8 2d fc ff ff call 350 <sbrk>
if(p == (char*)-1)
723: 83 f8 ff cmp $0xffffffff,%eax
726: 74 18 je 740 <malloc+0x80>
hp->s.size = nu;
728: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
72b: 83 c0 08 add $0x8,%eax
72e: 89 04 24 mov %eax,(%esp)
731: e8 ea fe ff ff call 620 <free>
return freep;
736: 8b 15 7c 0a 00 00 mov 0xa7c,%edx
if((p = morecore(nunits)) == 0)
73c: 85 d2 test %edx,%edx
73e: 75 c8 jne 708 <malloc+0x48>
return 0;
}
}
740: 83 c4 1c add $0x1c,%esp
return 0;
743: 31 c0 xor %eax,%eax
}
745: 5b pop %ebx
746: 5e pop %esi
747: 5f pop %edi
748: 5d pop %ebp
749: c3 ret
74a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
750: 39 cf cmp %ecx,%edi
752: 74 4c je 7a0 <malloc+0xe0>
p->s.size -= nunits;
754: 29 f9 sub %edi,%ecx
756: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
759: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
75c: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
75f: 89 15 7c 0a 00 00 mov %edx,0xa7c
}
765: 83 c4 1c add $0x1c,%esp
return (void*)(p + 1);
768: 83 c0 08 add $0x8,%eax
}
76b: 5b pop %ebx
76c: 5e pop %esi
76d: 5f pop %edi
76e: 5d pop %ebp
76f: c3 ret
base.s.ptr = freep = prevp = &base;
770: b8 80 0a 00 00 mov $0xa80,%eax
775: ba 80 0a 00 00 mov $0xa80,%edx
base.s.size = 0;
77a: 31 c9 xor %ecx,%ecx
base.s.ptr = freep = prevp = &base;
77c: a3 7c 0a 00 00 mov %eax,0xa7c
base.s.size = 0;
781: b8 80 0a 00 00 mov $0xa80,%eax
base.s.ptr = freep = prevp = &base;
786: 89 15 80 0a 00 00 mov %edx,0xa80
base.s.size = 0;
78c: 89 0d 84 0a 00 00 mov %ecx,0xa84
792: e9 53 ff ff ff jmp 6ea <malloc+0x2a>
797: 89 f6 mov %esi,%esi
799: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
prevp->s.ptr = p->s.ptr;
7a0: 8b 08 mov (%eax),%ecx
7a2: 89 0a mov %ecx,(%edx)
7a4: eb b9 jmp 75f <malloc+0x9f>
| 34.142857 | 60 | 0.41009 |
b44b9f98a1399af4e170fcb993da7cecdddbd2a2 | 434 | asm | Assembly | scripts/RedsHouse2F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | scripts/RedsHouse2F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | scripts/RedsHouse2F.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | RedsHouse2F_Script:
call EnableAutoTextBoxDrawing
ld hl, RedsHouse2F_ScriptPointers
ld a, [wRedsHouse2FCurScript]
jp CallFunctionInTable
RedsHouse2F_ScriptPointers:
dw RedsHouse2FScript0
dw RedsHouse2FScript1
RedsHouse2FScript0:
xor a
ldh [hJoyHeld], a
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
ld a, 1
ld [wRedsHouse2FCurScript], a
ret
RedsHouse2FScript1:
ret
RedsHouse2F_TextPointers:
text_end ; unused
| 16.692308 | 34 | 0.81106 |
31d2fb685fe2dcc6aba4a77247f4418d5daa6495 | 456 | asm | Assembly | programs/oeis/168/A168587.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168587.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168587.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168587: Smallest digit sum of an n-digit prime with only digits 0 add 1 (or 0, if no such prime exists).
; 0,2,2,0,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
mov $2,$0
sub $0,2
mov $3,2
lpb $0
div $2,2
add $2,$0
mov $0,$2
div $0,2
sub $0,2
lpe
mul $0,$2
sub $3,$0
add $3,$2
mov $0,$3
sub $0,2
| 24 | 201 | 0.550439 |
664f4460274f4ea1c44e8c08e7843ffa8174fcea | 999 | asm | Assembly | _maps/Springs.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 9 | 2021-01-15T13:47:53.000Z | 2022-01-17T15:33:55.000Z | _maps/Springs.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 7 | 2021-01-14T02:18:48.000Z | 2021-03-24T15:44:30.000Z | _maps/Springs.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 2 | 2021-01-14T13:14:26.000Z | 2021-01-29T17:46:04.000Z | ; ---------------------------------------------------------------------------
; Sprite mappings - springs
; ---------------------------------------------------------------------------
Map_Spring_internal:
dc.w M_Spg_Up-Map_Spring_internal
dc.w M_Spg_UpFlat-Map_Spring_internal
dc.w M_Spg_UpExt-Map_Spring_internal
dc.w M_Spg_Left-Map_Spring_internal
dc.w M_Spg_LeftFlat-Map_Spring_internal
dc.w M_Spg_LeftExt-Map_Spring_internal
M_Spg_Up: dc.b 2 ; facing up
dc.b $F8, $C, 0, 0, $F0
dc.b 0, $C, 0, 4, $F0
M_Spg_UpFlat: dc.b 1 ; facing up, flattened
dc.b 0, $C, 0, 0, $F0
M_Spg_UpExt: dc.b 3 ; facing up, extended
dc.b $E8, $C, 0, 0, $F0
dc.b $F0, 5, 0, 8, $F8
dc.b 0, $C, 0, $C, $F0
M_Spg_Left: dc.b 1 ; facing left
dc.b $F0, 7, 0, 0, $F8
M_Spg_LeftFlat: dc.b 1 ; facing left, flattened
dc.b $F0, 3, 0, 4, $F8
M_Spg_LeftExt: dc.b 4 ; facing left, extended
dc.b $F0, 3, 0, 4, $10
dc.b $F8, 9, 0, 8, $F8
dc.b $F0, 0, 0, 0, $F8
dc.b 8, 0, 0, 3, $F8
even | 34.448276 | 77 | 0.540541 |
baa68e3e6c88580fff2e22a3f7ca71574a5f29f3 | 328 | asm | Assembly | u7bg/call-eop-processSliderInput.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | u7bg/call-eop-processSliderInput.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | u7bg/call-eop-processSliderInput.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | %include "include/u7bg-all-includes.asm"
defineAddress 340, 0x1C31, doSlider_switchToKeyMouseMode
defineAddress 340, 0x1C38, doSlider_switchToKeyMouseMode_end
defineAddress 340, 0x1C44, doSlider_haveMouseState
defineAddress 340, 0x1C71, doSlider_afterProcessInput
%include "../u7-common/patch-call-eop-processSliderInput.asm"
| 36.444444 | 61 | 0.85061 |
f8a6bbc5bb88f852e39a78fcbc481303cdd60abc | 473 | asm | Assembly | oeis/125/A125026.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/125/A125026.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/125/A125026.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A125026: Triangle read by rows: T(n,k) = k*binomial(n,k) + binomial(n-1,k) (1 <= k <= n).
; Submitted by Christian Krause
; 1,3,2,5,7,3,7,15,13,4,9,26,34,21,5,11,40,70,65,31,6,13,57,125,155,111,43,7,15,77,203,315,301,175,57,8,17,100,308,574,686,532,260,73,9,19,126,444,966,1386,1344,876,369,91,10,21,155,615,1530,2562,2982,2430,1365
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
bin $1,$0
add $0,1
mul $2,$1
mul $1,$0
add $1,$2
div $2,$0
add $2,$1
mov $0,$2
| 24.894737 | 210 | 0.617336 |
5cdc512a9c20a0d700f2d562744b8beb91cd35e2 | 733 | asm | Assembly | libsrc/z80_crt0s/8080/sccz80/l_long_asr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/z80_crt0s/8080/sccz80/l_long_asr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/z80_crt0s/8080/sccz80/l_long_asr.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ;
; Z88 Small C+ Run Time Library
; Long support functions
;
SECTION code_crt0_sccz80
PUBLIC l_long_asr
PUBLIC l_long_asro
; Entry: dehl = long
; c = shift couter
.l_long_asro
ld a,c
jp entry
; Entry: l = counter
; sp + 2 = long to shift
.l_long_asr
pop bc
ld a,l ;temporary store for counter
pop hl
pop de
push bc
.entry
and 31
ret z
ld b,a
IF __CPU_GBZ80__
ld a,e ; primary = dahl
ENDIF
.loop
IF __CPU_GBZ80__
sra d
rra
rr h
rr l
ELSE
ld a,d
rla
ld a,d
rra
ld d,a
ld a,e
rra
ld e,a
ld a,h
rra
ld h,a
ld a,l
rra
ld l,a
ENDIF
dec b
jp nz,loop
IF __CPU_GBZ80__
ld e,a
ENDIF
ret
| 11.276923 | 52 | 0.567531 |
2d29f46ac3c49956fd76222db6d86c12395c80a7 | 8,337 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_un_4k_/i7-8650U_0xd2_notsx.log_891_805.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_un_4k_/i7-8650U_0xd2_notsx.log_891_805.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_un_4k_/i7-8650U_0xd2_notsx.log_891_805.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x16b6, %r13
nop
nop
nop
nop
cmp %r12, %r12
mov (%r13), %rbp
sub $58639, %r12
lea addresses_normal_ht+0xb9c6, %r15
nop
nop
nop
nop
xor %rdx, %rdx
mov $0x6162636465666768, %r12
movq %r12, %xmm6
movups %xmm6, (%r15)
and $47743, %r13
lea addresses_D_ht+0xb4f6, %rsi
lea addresses_WC_ht+0x164b6, %rdi
clflush (%rsi)
nop
nop
dec %rdx
mov $47, %rcx
rep movsl
nop
xor $41790, %r15
lea addresses_D_ht+0x562e, %r12
xor $57719, %r15
movl $0x61626364, (%r12)
cmp $17035, %rdi
lea addresses_normal_ht+0xe2b6, %rsi
lea addresses_UC_ht+0xfcb6, %rdi
nop
nop
nop
nop
and %rbp, %rbp
mov $72, %rcx
rep movsw
nop
nop
nop
nop
sub $26258, %rcx
lea addresses_A_ht+0xcb6, %r12
sub %rdx, %rdx
movb $0x61, (%r12)
xor %r15, %r15
lea addresses_A_ht+0xaf66, %r13
cmp %rcx, %rcx
movl $0x61626364, (%r13)
nop
nop
nop
xor $26474, %r15
lea addresses_UC_ht+0x2cb6, %rcx
nop
nop
sub %rbp, %rbp
movl $0x61626364, (%rcx)
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WT_ht+0x1a8b6, %r15
nop
nop
nop
nop
nop
cmp $26081, %r13
mov (%r15), %bp
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0xb5b6, %rbp
nop
nop
sub $54821, %r13
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %r15
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0xa8b6, %rsi
nop
add $24194, %rbp
movb $0x61, (%rsi)
inc %r12
lea addresses_WC_ht+0x160a6, %rsi
lea addresses_A_ht+0x1c276, %rdi
add %rdx, %rdx
mov $82, %rcx
rep movsw
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_WC_ht+0x19bd8, %rbp
clflush (%rbp)
nop
nop
nop
nop
inc %r13
movw $0x6162, (%rbp)
nop
nop
nop
inc %r13
lea addresses_normal_ht+0x1ccb6, %rdi
nop
nop
nop
nop
add %rbp, %rbp
mov (%rdi), %r12d
nop
sub $22447, %rdi
lea addresses_A_ht+0xc37e, %r13
clflush (%r13)
nop
nop
nop
nop
nop
xor %rsi, %rsi
mov (%r13), %cx
nop
add $60229, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %rbp
push %rbx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_US+0x8ab6, %rbp
nop
nop
xor $15623, %rsi
mov (%rbp), %r11d
nop
sub $8286, %r8
// Store
lea addresses_UC+0x8166, %rbp
dec %rdx
mov $0x5152535455565758, %r8
movq %r8, %xmm0
and $0xffffffffffffffc0, %rbp
vmovaps %ymm0, (%rbp)
nop
nop
nop
nop
and $45330, %rdx
// Load
lea addresses_normal+0x172b6, %rdx
xor $12452, %rbx
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %rdi
nop
nop
nop
nop
dec %r8
// Store
lea addresses_normal+0x6cb6, %rbp
nop
nop
nop
add $54887, %r11
movl $0x51525354, (%rbp)
nop
nop
nop
nop
nop
add %rbx, %rbx
// Faulty Load
mov $0x7eeee90000000cb6, %rbx
nop
nop
nop
xor %rdx, %rdx
mov (%rbx), %r11w
lea oracles, %rdx
and $0xff, %r11
shlq $12, %r11
mov (%rdx,%r11,1), %r11
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'54': 875, '00': 15, '24': 1}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 24 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 31.224719 | 2,672 | 0.651793 |
3c2dba3de158b9cbe88ed3869b4c0ee9a8d7b9d3 | 6,401 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1633.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1633.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1633.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 %r13
push %r14
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x4478, %rsi
lea addresses_D_ht+0x166b8, %rdi
clflush (%rdi)
nop
add %rax, %rax
mov $42, %rcx
rep movsb
nop
nop
nop
nop
and $20164, %rsi
lea addresses_WT_ht+0x77c8, %r14
nop
nop
nop
nop
xor $32880, %rdx
mov $0x6162636465666768, %r13
movq %r13, (%r14)
lfence
lea addresses_normal_ht+0x1a03c, %rsi
lea addresses_A_ht+0x11c78, %rdi
nop
and $40023, %r10
mov $121, %rcx
rep movsl
nop
nop
nop
nop
and $2361, %r13
lea addresses_normal_ht+0x1bfb8, %r13
nop
nop
nop
nop
nop
cmp %rax, %rax
movw $0x6162, (%r13)
cmp %rdx, %rdx
lea addresses_WT_ht+0x7038, %rsi
nop
nop
nop
and %rdi, %rdi
mov $0x6162636465666768, %rax
movq %rax, %xmm5
movups %xmm5, (%rsi)
nop
inc %r10
lea addresses_WC_ht+0xec78, %rsi
nop
sub %rax, %rax
movb (%rsi), %r14b
nop
nop
nop
nop
nop
xor $5080, %rax
lea addresses_A_ht+0xa938, %rdx
nop
nop
add $36067, %rdi
movw $0x6162, (%rdx)
nop
nop
nop
nop
nop
xor $30888, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r9
push %rcx
push %rdx
// Store
lea addresses_A+0x4b78, %r10
nop
nop
nop
xor $20449, %r12
movw $0x5152, (%r10)
nop
nop
nop
nop
nop
dec %rcx
// Store
lea addresses_UC+0xd098, %r14
xor %r9, %r9
movl $0x51525354, (%r14)
nop
dec %rdx
// Store
lea addresses_PSE+0x3a78, %rcx
nop
nop
nop
nop
xor $9775, %r9
mov $0x5152535455565758, %r13
movq %r13, (%rcx)
dec %rdx
// Faulty Load
lea addresses_PSE+0x18078, %r14
nop
nop
nop
sub $54635, %r9
mov (%r14), %ecx
lea oracles, %r10
and $0xff, %rcx
shlq $12, %rcx
mov (%r10,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 36.577143 | 2,999 | 0.65771 |
54629aa166fa6b17c80a818ec4027eaabd408039 | 1,422 | asm | Assembly | emulator/mz800/XCTests/assets/TestMZ700Write.asm | gunterhager/mz-800-emulator | 342914123e85408e09d35e2f50d7fc64cdec99ae | [
"MIT"
] | 8 | 2018-07-20T21:00:40.000Z | 2022-02-21T08:35:51.000Z | emulator/mz800/XCTests/assets/TestMZ700Write.asm | gunterhager/mz-800-emulator | 342914123e85408e09d35e2f50d7fc64cdec99ae | [
"MIT"
] | null | null | null | emulator/mz800/XCTests/assets/TestMZ700Write.asm | gunterhager/mz-800-emulator | 342914123e85408e09d35e2f50d7fc64cdec99ae | [
"MIT"
] | null | null | null | ; Test writing too much into VRAM in MZ-700 mode
;
; Use z80asm from the z88dk project to build binary file.
; Command line:
; z80asm -b TestMZ700VRAMOverwrite.asm
include "MZ800.inc"
org 02000h
ld a, 01
ld hl, 01000h
ld (hl), a
halt
; Program features
define ClearColor
defc DisplayMode = DisplayMode40x25_8ColorMZ700
; Set display mode
ld a, DisplayMode
out (PortDisplayModeRegister), a
; Bank in VRAM
out (PortBank_ROM1_CGROM_VRAM_ROM2), a ; contents of a don't matter
; Set VRAM write format
ld a, WriteFormatMZ700
out (PortWriteFormatRegister), a
; Set VRAM read format
ld a, ReadFormatMZ700
out (PortReadFormatRegister), a
ifdef ClearColor
; Setup memory addresses for color VRAM
ld hl, MemoryMZ700VRAMColorStart
ld de, MemoryMZ700VRAMColorStart + 1
ld bc, 0ffffh ; load maximum number into byte counter
; Clear VRAM
ld (hl), 071h ; clear first byte of VRAM with white foreground, blue background
ldir ; clear the rest of the VRAM in one loop
endif
; Put character on screen
ld hl, MemoryMZ700VRAMStart
ld de, 40 ; characters per line
ld a, 01h ; character code
ld b, 14
characterLoop:
ld (hl), a
add a, 1
add hl, de
djnz characterLoop
; Put color on screen
ld hl, MemoryMZ700VRAMColorStart
ld de, 40 ; characters per line
ld a, 71h ; color code
ld b, 14
colorLoop:
ld (hl), a
add a, 1
add hl, de
djnz colorLoop
halt
| 19.479452 | 81 | 0.71519 |
f544c002c38e361add1f932af225a3ef6c2ed9e1 | 89 | asm | Assembly | session_01/01-storesum/storesum.asm | DigiOhhh/LabArchitettura2-2017-2018 | da34b9a75ab2945ac70d5cbf69395d0db5172f6f | [
"MIT"
] | 1 | 2019-03-06T13:26:10.000Z | 2019-03-06T13:26:10.000Z | session_01/01-storesum/storesum.asm | DigiOhhh/LabArchitettura2-2017-2018 | da34b9a75ab2945ac70d5cbf69395d0db5172f6f | [
"MIT"
] | null | null | null | session_01/01-storesum/storesum.asm | DigiOhhh/LabArchitettura2-2017-2018 | da34b9a75ab2945ac70d5cbf69395d0db5172f6f | [
"MIT"
] | 1 | 2019-03-06T13:25:28.000Z | 2019-03-06T13:25:28.000Z | .text
.globl main
main:
addi $s1, $zero, 5
addi $s2, $zero, 7
add $s0, $s1, $s2 | 14.833333 | 20 | 0.539326 |
96ff8b492800ff9253002cdfe0839882d6e1abcd | 6,937 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_832.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_832.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_832.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 %r13
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xda30, %rbx
nop
nop
add $2572, %r11
mov (%rbx), %rsi
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WT_ht+0x8f18, %r13
nop
mfence
movw $0x6162, (%r13)
nop
nop
nop
cmp %r13, %r13
lea addresses_WC_ht+0x68f0, %rsi
nop
and $28783, %r10
vmovups (%rsi), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rbx
nop
nop
add $28938, %rsi
lea addresses_normal_ht+0x103a0, %rsi
lea addresses_WC_ht+0xe4f0, %rdi
nop
lfence
mov $71, %rcx
rep movsl
nop
nop
nop
xor $51272, %r11
lea addresses_UC_ht+0x1c154, %r11
nop
nop
inc %r9
mov (%r11), %rbx
nop
nop
nop
add $55124, %rsi
lea addresses_UC_ht+0x1376c, %rsi
lea addresses_normal_ht+0x19270, %rdi
clflush (%rsi)
nop
add %r9, %r9
mov $76, %rcx
rep movsw
nop
and %r13, %r13
lea addresses_normal_ht+0x1e594, %rsi
lea addresses_A_ht+0x117b0, %rdi
nop
xor %r13, %r13
mov $117, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp $3228, %rcx
lea addresses_normal_ht+0x1bbc0, %r13
nop
nop
sub %rcx, %rcx
mov (%r13), %rsi
xor $36879, %r13
lea addresses_D_ht+0xb8ec, %r13
nop
nop
nop
nop
inc %r10
movb (%r13), %r11b
nop
nop
nop
sub $44114, %r9
lea addresses_UC_ht+0xadf0, %rsi
lea addresses_D_ht+0x1d8f0, %rdi
clflush (%rdi)
inc %r9
mov $23, %rcx
rep movsb
dec %r10
lea addresses_normal_ht+0x1e5d3, %rcx
nop
nop
sub %rdi, %rdi
mov $0x6162636465666768, %r11
movq %r11, %xmm7
movups %xmm7, (%rcx)
nop
nop
nop
and $55328, %r11
lea addresses_WC_ht+0x13570, %r11
nop
inc %r9
movw $0x6162, (%r11)
nop
nop
nop
nop
nop
cmp $35304, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %r9
push %rcx
push %rsi
// Faulty Load
lea addresses_normal+0x28f0, %r15
clflush (%r15)
nop
nop
nop
inc %r8
mov (%r15), %si
lea oracles, %r15
and $0xff, %rsi
shlq $12, %rsi
mov (%r15,%rsi,1), %rsi
pop %rsi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, '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': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': 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
*/
| 37.497297 | 2,999 | 0.659363 |
779efdf11f47dc4e19300a94780edd362c0448e5 | 2,735 | asm | Assembly | src/urlutils.asm | poletaevvlad/http-asm | 353d90b4e61f37041e4a8dda2547d0aeef7dc9bb | [
"MIT"
] | 7 | 2018-10-12T19:41:55.000Z | 2022-01-29T08:37:04.000Z | src/urlutils.asm | poletaevvlad/http-asm | 353d90b4e61f37041e4a8dda2547d0aeef7dc9bb | [
"MIT"
] | null | null | null | src/urlutils.asm | poletaevvlad/http-asm | 353d90b4e61f37041e4a8dda2547d0aeef7dc9bb | [
"MIT"
] | 2 | 2021-02-06T08:36:22.000Z | 2022-01-26T05:14:12.000Z | section .text
; input: al - hex digit
; output: al - numeric value or 10h on error
; mutates: al
; breaks calling convention
_hex_to_digit:
cmp al, '0'
jb .error
cmp al, '9'
ja .not_number
sub al, '0'
ret
.not_number:
cmp al, 'A'
jb .error
cmp al, 'F'
ja .not_uppercase
sub al, 'A'
add al, 10
ret
.not_uppercase:
cmp al, 'a'
jb .error
cmp al, 'f'
ja .error
sub al, 'a'
add al, 10
ret
.error:
mov al, 10h
ret
; input: rdi - pointer to the first char of hex number
; output: al - value
; ah - 1 on success, 0 otherwise
; rdi - pointer to the second char of hex number
; mutates: rax, rdi
_parse_codepoint:
mov al, [rdi]
call _hex_to_digit
cmp al, 10h
jz .error
mov ah, al
inc rdi
mov al, [rdi]
call _hex_to_digit
cmp al, 10h
jz .error
xchg al, ah
shl al, 4
or al, ah
mov ah, 1
ret
.error:
xor ah, ah
ret
; input: rdi - pointer to url string
; output: rax - 1 if valid url, 0 otherwise
; mutates: rdi, rax
_url_decode:
push rsi
mov rsi, rdi
.loop:
mov al, [rdi]
test al, al
jz .done
cmp al, '+'
jne .skip_plus
; plus
mov al, ' '
jmp .loop_end
.skip_plus:
cmp al, '%'
jne .skip_percent
; percent
inc rdi
call _parse_codepoint
test ah, ah
jz .error
.skip_percent:
.loop_end:
mov [rsi], al
inc rdi
inc rsi
jmp .loop
.done:
mov [rsi], BYTE 0
mov rax, 1
jmp .end
.error:
mov rax, 0
.end:
pop rsi
ret
; input: rdi - zero-terminated url
; output: rax - contains 0 if URL is invalid, non-zero otherwise
; mutates: rdi
_check_dot_segments:
push rcx
mov cl, [rdi]
test cl, cl
jz .end
cmp cl, '/'
jne .loop_over_segments
inc rdi
.loop_over_segments:
xor rax, rax
.counting_dots:
mov cl, [rdi]
cmp cl, '.'
jne .dots_end
inc rdi
inc rax
jmp .counting_dots
.dots_end:
test cl, cl
jz .segment_end
cmp cl, '/'
je .segment_end
xor rax, rax
inc rdi
mov cl, [rdi]
jmp .dots_end
.segment_end:
cmp rax, 2
je .fail
test cl, cl
jz .end
inc rdi
jmp .loop_over_segments
.fail:
mov rax, 0
jmp .post
.end:
mov rax, 1
.post:
pop rcx
ret
| 17.310127 | 64 | 0.484826 |
df6caaf5f6a08e01c55a63c8c952caa22de146a8 | 8,141 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_17599_129.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_17599_129.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_17599_129.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1942b, %rsi
lea addresses_A_ht+0x10c2b, %rdi
nop
add $50825, %r13
mov $107, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $58595, %rbx
lea addresses_WC_ht+0x1232b, %rbp
add %r12, %r12
vmovups (%rbp), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbx
inc %rbx
lea addresses_D_ht+0x1494b, %rbp
nop
nop
xor %r13, %r13
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
movups %xmm0, (%rbp)
nop
nop
nop
nop
nop
cmp $63039, %r13
lea addresses_WT_ht+0x1c70b, %rsi
nop
nop
nop
nop
xor $22012, %rbx
movw $0x6162, (%rsi)
nop
nop
nop
cmp $58151, %rbx
lea addresses_UC_ht+0x1682b, %rcx
nop
nop
nop
sub $60084, %rsi
movw $0x6162, (%rcx)
nop
nop
nop
xor $12298, %rsi
lea addresses_A_ht+0x11ce6, %rsi
lea addresses_A_ht+0x10b6b, %rdi
cmp %rbx, %rbx
mov $123, %rcx
rep movsb
add %r13, %r13
lea addresses_A_ht+0x4f2b, %rdi
nop
nop
nop
nop
nop
xor $4064, %r13
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm2, (%rdi)
add $60, %rcx
lea addresses_UC_ht+0x390b, %rbx
add %r12, %r12
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%rbx)
nop
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x1502b, %rdi
clflush (%rdi)
cmp %rbp, %rbp
mov (%rdi), %bx
nop
nop
nop
sub %rbp, %rbp
lea addresses_D_ht+0xb12b, %rsi
lea addresses_normal_ht+0x1010b, %rdi
sub %r10, %r10
mov $92, %rcx
rep movsw
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0xf1eb, %r13
nop
nop
nop
cmp %rdi, %rdi
movb (%r13), %r10b
nop
nop
and $34355, %rcx
lea addresses_normal_ht+0x10e7b, %rsi
lea addresses_WC_ht+0x5e2b, %rdi
nop
nop
add $24361, %rbx
mov $37, %rcx
rep movsq
nop
nop
nop
add %rbx, %rbx
lea addresses_WT_ht+0x1982b, %rsi
lea addresses_A_ht+0x2dcb, %rdi
nop
and %r13, %r13
mov $6, %rcx
rep movsl
nop
nop
nop
cmp %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x4c2b, %rdi
nop
add $46919, %r14
mov $0x5152535455565758, %rax
movq %rax, (%rdi)
nop
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_US+0x7e2b, %rsi
nop
nop
nop
nop
add $46246, %r12
movb $0x51, (%rsi)
sub $45511, %r14
// Store
lea addresses_D+0x942b, %rbx
nop
nop
nop
nop
cmp $38698, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm0
vmovups %ymm0, (%rbx)
nop
nop
and $15492, %r12
// Faulty Load
lea addresses_WT+0x1d82b, %rbx
nop
nop
nop
xor $34584, %r14
mov (%rbx), %r12
lea oracles, %rax
and $0xff, %r12
shlq $12, %r12
mov (%rax,%r12,1), %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'00': 17599}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 33.920833 | 2,999 | 0.65729 |
ca465ab621c6cb3dd39ea1e64d20427935586999 | 5,992 | asm | Assembly | src/int_handlers/serial.asm | pwk4m1/TinyBIOS | f9f0ec8b725717cac1756836cf68267e0ed77114 | [
"BSD-3-Clause"
] | 23 | 2019-09-28T17:33:32.000Z | 2022-03-26T20:30:22.000Z | src/int_handlers/serial.asm | pwk4m1/TinyBIOS | f9f0ec8b725717cac1756836cf68267e0ed77114 | [
"BSD-3-Clause"
] | null | null | null | src/int_handlers/serial.asm | pwk4m1/TinyBIOS | f9f0ec8b725717cac1756836cf68267e0ed77114 | [
"BSD-3-Clause"
] | 1 | 2022-03-24T13:12:04.000Z | 2022-03-24T13:12:04.000Z | ; BSD 3-Clause License
;
; Copyright (c) 2020, k4m1 <k4m1@protonmail.com>
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; * Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
;
; * Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; * Neither the name of the copyright holder nor the names of its
; contributors may be used to endorse or promote products derived from
; this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; ======================================================================== ;
; Set ivt entry for serial interface
;
set_serial_ivt_entry:
pusha
mov eax, serial_service_int_handler
and eax, 0x0000ffff
mov bx, cs
mov di, (0x14 * 4)
call set_ivt_entry
popa
ret
; ======================================================================== ;
; Handler for serial port related services
;
serial_service_int_handler:
cli
cmp ah, 1
jl serial_service_init_device
je serial_service_putchar
cmp ah, 3
jl serial_service_getchar
je serial_service_get_status
.done:
; We get here by software interrupt by CPU, not by
; PIC generated int, so don't send EOI !
iret
; ======================================================================== ;
; Helper function to get port to use based on DX value 0 - 3 (device
; number)
;
__get_serial_by_id:
cmp dx, 1
jl .port1
je .port2
cmp dx, 3
je .port3
mov dx, 0x02e8
ret
.port1:
mov dx, 0x03f8
ret
.port2:
mov dx, 0x02f8
ret
.port3:
mov dx, 0x03e8
ret
; ======================================================================== ;
; Serial port init service (AH = 00)
; This function should only be called by serial_service_handler
;
; AH = 00
; AL = parms for initialization (see tables below)
; DX = zero based serial port number (0-1) (0-3 for AT)
;
; |7|6|5|4|3|2|1|0| AL Parity (bits 4 & 3)
; | | | | | | `------ word length bits 00 = none
; | | | | | `------- stop bits flag 01 = odd
; | | | `---------- parity bits 10 = none
; `--------------- baud rate bits 11 = even
;
; Word length (bits 1 & 0) Stop bit count (bit 2)
;
; 10 = 7 bits 0 = 1 stop bit
; 11 = 8 bits 1 = 2 stop bits
;
; Baud rate (bits 7, 6 & 5)
;
; 000 = 110 baud 100 = 1200 baud
; 001 = 150 baud 101 = 2400 baud
; 010 = 300 baud 110 = 4800 baud
; 011 = 600 baud 111 = 9600 baud (4800 on PCjr)
;
;
; on return:
; AH = port status
; AL = modem status
;
serial_service_init_device:
push cx
push bx
; first, let's get the port we want to use
call __get_serial_by_id
; next, get byte count per "packet", and setup line control
; bits according to user desires and wishes
; we set AX as our line control register, and BX as baud rate
; divisor
mov cl, al
and cl, 11100000b
and al, 00011111b ; clear baudrate bits out of al
test cl, cl
jz .baudrate_110
mov bx, 1536
.loop:
shr bx, 1 ; we want baudrate *divisor*, not baudrate.
loop .loop
.done:
; now dx = port, bx = baudrate divisor, al = line reg
call serial_init
pop bx
pop cx
jmp serial_service_int_handler.done
.baudrate_110:
mov bx, 1047
jmp .done
; ======================================================================== ;
; Serial write character (AH = 01) is used to put single character out
; of serial port.
;
; Parameters:
; AL = byte to write
; DX = Port to write to (0 - 3)
;
; Returns:
; AH bit 7 clear on success, set on error,
; bits 0 - 6 port status
;
serial_service_putchar:
; get port again
call __get_serial_by_id
; check that serial tx is empty
call serial_wait_tx_empty
jc .error
; write char to put to serial line
out dx, al
; get port status to ah
call serial_get_line_status
; return back to handler
jmp serial_service_int_handler.done
.error:
call serial_get_line_status
or ah, 10000000b
jmp serial_service_int_handler.done
; ======================================================================== ;
; Serial read character (AH = 02) is.. as the name suggests, a function
; that reads 1 byte from serial line.
;
; Parameters:
; DX = port to read from (0 - 3)
;
; Returns:
; AL = Byte read
; AH = Line status
;
serial_service_getchar:
; get port
call __get_serial_by_id
in al, dx
; exchanges so we don't overwrite what was read from serial line
xchg ah, al
call serial_get_line_status
xchg ah, al
jmp serial_service_int_handler.done
; ======================================================================== ;
; Serial get status (AH = 03)
;
; Parameters:
; DX = port to read from (0 - 3)
;
; Returns:
; AL = modem status
; AH = Line status
;
serial_service_get_status:
call __get_serial_by_id ; get port by id
call serial_get_line_status ; get line status
xchg ah, al ; ah = line status
call serial_get_modem_status ; get modem status to al
jmp serial_service_int_handler.done
| 26.990991 | 77 | 0.637684 |
a8be53bc5a84eb8b858cc7d0fa374cb84b6cf62c | 7,192 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3146.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_3146.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_3146.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1c6aa, %rsi
lea addresses_UC_ht+0xb15a, %rdi
nop
add %r9, %r9
mov $3, %rcx
rep movsl
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_D_ht+0x365a, %rbp
nop
nop
nop
and $42192, %r14
vmovups (%rbp), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
nop
cmp $12877, %r11
lea addresses_A_ht+0xee5a, %rdi
nop
inc %rbp
movb $0x61, (%rdi)
nop
and $65105, %rdi
lea addresses_normal_ht+0x1441a, %rsi
lea addresses_WT_ht+0x12d5a, %rdi
nop
nop
nop
nop
sub $33587, %r12
mov $122, %rcx
rep movsl
nop
nop
nop
cmp $46424, %r12
lea addresses_normal_ht+0x141ca, %rdi
nop
nop
nop
cmp $61321, %r14
mov (%rdi), %rcx
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_WT_ht+0x634a, %r12
nop
nop
sub $50485, %r14
movb $0x61, (%r12)
nop
inc %rcx
lea addresses_WC_ht+0x1ce7a, %rsi
lea addresses_WT_ht+0x1bab7, %rdi
clflush (%rdi)
nop
nop
cmp %rbp, %rbp
mov $76, %rcx
rep movsb
nop
nop
nop
xor $65359, %rsi
lea addresses_WC_ht+0x19bda, %r11
clflush (%r11)
nop
cmp $19456, %r14
mov (%r11), %r9
nop
nop
nop
xor $35157, %r14
lea addresses_WT_ht+0xb25a, %r11
nop
nop
nop
nop
dec %rbp
mov (%r11), %rdi
nop
sub %rsi, %rsi
lea addresses_UC_ht+0x18c5a, %r9
nop
cmp $2285, %rcx
mov (%r9), %r12d
nop
nop
nop
add %rcx, %rcx
lea addresses_WC_ht+0xb8da, %rsi
lea addresses_UC_ht+0x12b5a, %rdi
nop
nop
nop
xor %r11, %r11
mov $32, %rcx
rep movsb
nop
nop
nop
sub $47014, %rbp
lea addresses_UC_ht+0x1ae5a, %rsi
lea addresses_WC_ht+0x10e5a, %rdi
nop
cmp $21272, %rbp
mov $35, %rcx
rep movsb
nop
add %rsi, %rsi
lea addresses_normal_ht+0x17f3a, %r14
nop
nop
nop
inc %r9
mov (%r14), %ecx
nop
nop
inc %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %r9
push %rbx
push %rdx
// Faulty Load
lea addresses_normal+0xe5a, %r15
nop
nop
nop
nop
add %r9, %r9
mov (%r15), %bx
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'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
*/
| 36.323232 | 2,999 | 0.657814 |
70758b5382ebd3846319a5965331dfd4ec225938 | 922 | asm | Assembly | programs/oeis/160/A160747.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/160/A160747.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/160/A160747.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A160747: Expansion of (1+10*x+20*x^2+10*x^3+x^4)/(1-x)^5.
; 1,15,85,295,771,1681,3235,5685,9325,14491,21561,30955,43135,58605,77911,101641,130425,164935,205885,254031,310171,375145,449835,535165,632101,741651,864865,1002835,1156695,1327621,1516831,1725585,1955185,2206975,2482341,2782711,3109555,3464385,3848755,4264261,4712541,5195275,5714185,6271035,6867631,7505821,8187495,8914585,9689065,10512951,11388301,12317215,13301835,14344345,15446971,16611981,17841685,19138435,20504625,21942691,23455111,25044405,26713135,28463905,30299361,32222191,34235125,36340935,38542435,40842481,43243971,45749845,48363085,51086715,53923801,56877451,59950815,63147085,66469495,69921321,73505881,77226535,81086685,85089775,89239291,93538761,97991755,102601885,107372805,112308211,117411841,122687475,128138935,133770085,139584831,145587121,151780945,158170335,164759365,171552151
add $0,1
bin $0,2
add $0,1
bin $0,2
mul $0,14
add $0,1
| 92.2 | 805 | 0.835141 |
ae1a39d6cbe364637c5a341e5cdf18d491461467 | 724 | asm | Assembly | 02_input/main.asm | christopher-besch/assembly_reference | d7a3aadaf20d08a713936f2d51546dc59330cedc | [
"MIT"
] | 2 | 2021-06-03T12:42:35.000Z | 2021-10-29T18:58:46.000Z | 02_input/main.asm | christopher-besch/assembly_reference | d7a3aadaf20d08a713936f2d51546dc59330cedc | [
"MIT"
] | null | null | null | 02_input/main.asm | christopher-besch/assembly_reference | d7a3aadaf20d08a713936f2d51546dc59330cedc | [
"MIT"
] | null | null | null | section .data
text1 db "What is your name? "
text2 db "Hello, "
section .bss
; reserve bytes
stored_name resb 16
section .text
global _start
_start:
call _print_text1
call _get_name
call _print_text2
call _print_name
mov rax, 60
mov rdi, 0
syscall
_get_name:
; get input
mov rax, 0
mov rdi, 0
mov rsi, stored_name
mov rdx, 16
syscall
ret
_print_text1:
mov rax, 1
mov rdi, 1
mov rsi, text1
mov rdx, 19
syscall
ret
_print_text2:
mov rax, 1
mov rdi, 1
mov rsi, text2
mov rdx, 7
syscall
ret
_print_name:
mov rax, 1
mov rdi, 1
mov rsi, stored_name
mov rdx, 16
syscall
ret
| 13.163636 | 34 | 0.592541 |
7df96252f86ee26c21be84b2079a08f6eccf9bf3 | 578 | asm | Assembly | oeis/310/A310375.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/310/A310375.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/310/A310375.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A310375: Coordination sequence Gal.5.82.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Jon Maiga
; 1,4,10,14,18,23,28,32,36,42,46,50,56,60,64,69,74,78,82,88,92,96,102,106,110,115,120,124,128,134,138,142,148,152,156,161,166,170,174,180,184,188,194,198,202,207,212,216,220,226
mov $1,1
mov $4,$0
mov $5,$0
lpb $0
mov $0,6
mul $0,$4
add $4,4
add $4,$0
mov $2,$4
mod $2,10
add $0,$2
div $0,10
mov $1,$0
mul $0,$3
lpe
mov $3,$5
mul $3,4
add $1,$3
mov $0,$1
| 24.083333 | 177 | 0.653979 |
82128c61742a759f82779c63c6f812f9a66a895c | 69 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=vwuc1_minus_vbuxx.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=vwuc1_minus_vbuxx.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=vwuc1_minus_vbuxx.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | stx $ff
lda #<{c1}
sec
sbc $ff
sta {m1}
lda #>{c1}
sbc #00
sta {m1}+1 | 8.625 | 10 | 0.565217 |
8cea4894d2e4f1026ea9aa19ae7abbf7648da62b | 270 | asm | Assembly | programs/oeis/239/A239890.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/239/A239890.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/239/A239890.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A239890: Number of terms in consolidated series for normal reflectance of a three-layer thin film system of path length n.
; 1,1,2,4,8,15,27,45,72,110,162,231,321,435,578,754
pow $0,2
mov $1,$0
lpb $0
sub $0,1
add $1,$0
trn $0,5
lpe
mov $0,$1
div $0,6
add $0,1
| 19.285714 | 124 | 0.67037 |
2bfcb0d4701ab7c447206f10c05f91dfdaad3249 | 2,811 | asm | Assembly | Part 8 - How To Do Magic With Hypervisor!/Hypervisor From Scratch/MyHypervisorDriver/AsmVmexitHandler.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 808 | 2018-09-04T01:45:15.000Z | 2022-03-29T19:29:55.000Z | Part 8 - How To Do Magic With Hypervisor!/Hypervisor From Scratch/MyHypervisorDriver/AsmVmexitHandler.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 14 | 2019-02-24T21:33:37.000Z | 2022-01-18T11:50:28.000Z | Part 8 - How To Do Magic With Hypervisor!/Hypervisor From Scratch/MyHypervisorDriver/AsmVmexitHandler.asm | avboy1337/Hypervisor-From-Scratch | 10acaf5496d0a4e88b058aa91dbf36ba05ab98e0 | [
"MIT"
] | 182 | 2018-09-04T01:45:21.000Z | 2022-03-30T21:39:18.000Z | PUBLIC AsmVmexitHandler
EXTERN VmxVmexitHandler:PROC
EXTERN VmxVmresume:PROC
EXTERN HvReturnStackPointerForVmxoff:PROC
EXTERN HvReturnInstructionPointerForVmxoff:PROC
.code _text
;------------------------------------------------------------------------
AsmVmexitHandler PROC
push 0 ; we might be in an unaligned stack state, so the memory before stack might cause
; irql less or equal as it doesn't exist, so we just put some extra space avoid
; these kind of erros
pushfq
push r15
push r14
push r13
push r12
push r11
push r10
push r9
push r8
push rdi
push rsi
push rbp
push rbp ; rsp
push rbx
push rdx
push rcx
push rax
mov rcx, rsp ; Fast call argument to PGUEST_REGS
sub rsp, 28h ; Free some space for Shadow Section
call VmxVmexitHandler
add rsp, 28h ; Restore the state
cmp al, 1 ; Check whether we have to turn off VMX or Not (the result is in RAX)
je AsmVmxoffHandler
RestoreState:
pop rax
pop rcx
pop rdx
pop rbx
pop rbp ; rsp
pop rbp
pop rsi
pop rdi
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
popfq
sub rsp, 0100h ; to avoid error in future functions
jmp VmxVmresume
AsmVmexitHandler ENDP
;------------------------------------------------------------------------
AsmVmxoffHandler PROC
sub rsp, 020h ; shadow space
call HvReturnStackPointerForVmxoff
add rsp, 020h ; remove for shadow space
mov [rsp+088h], rax ; now, rax contains rsp
sub rsp, 020h ; shadow space
call HvReturnInstructionPointerForVmxoff
add rsp, 020h ; remove for shadow space
mov rdx, rsp ; save current rsp
mov rbx, [rsp+088h] ; read rsp again
mov rsp, rbx
push rax ; push the return address as we changed the stack, we push
; it to the new stack
mov rsp, rdx ; restore previous rsp
sub rbx,08h ; we push sth, so we have to add (sub) +8 from previous stack
; also rbx already contains the rsp
mov [rsp+088h], rbx ; move the new pointer to the current stack
RestoreState:
pop rax
pop rcx
pop rdx
pop rbx
pop rbp ; rsp
pop rbp
pop rsi
pop rdi
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
popfq
pop rsp ; restore rsp
ret ; jump back to where we called Vmcall
AsmVmxoffHandler ENDP
;------------------------------------------------------------------------
END
| 21.790698 | 95 | 0.53931 |
9ef145d3a1a1f212c12f665b4a94e3ecb397a4ea | 388 | asm | Assembly | oeis/091/A091949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/091/A091949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/091/A091949.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A091949: a(n) = A087659(n) mod 2.
; Submitted by Jamie Morken(s4)
; 1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,0,1,1
mov $3,$0
add $0,3
bin $0,3
mov $2,2
add $3,1
lpb $0
dif $0,2
add $3,$2
lpe
mov $0,$3
div $0,2
add $0,1
mod $0,2
| 21.555556 | 201 | 0.533505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.