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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6230f4d66d505b0a2b0b09a92e327bbd86d010a9 | 12,694 | asm | Assembly | chap18/ex10/avx2_compress.asm | JamesType/optimization-manual | 61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a | [
"0BSD"
] | 374 | 2021-06-08T10:42:01.000Z | 2022-03-29T14:21:45.000Z | chap18/ex10/avx2_compress.asm | JamesType/optimization-manual | 61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a | [
"0BSD"
] | 1 | 2021-06-11T20:24:02.000Z | 2021-06-11T20:24:02.000Z | chap18/ex10/avx2_compress.asm | JamesType/optimization-manual | 61cdcebb16e0768a6ab7e85ed535e64e9d8cc31a | [
"0BSD"
] | 39 | 2021-06-08T11:25:29.000Z | 2022-03-05T05:14:17.000Z | ;
; Copyright (C) 2021 by Intel Corporation
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
;
; .globl avx2_compress
; uint64_t avx2_compress(uint32_t *out, const uint32_t *in, uint64_t len)
; On entry:
; rcx = out
; rdx = in
; r8 = len
; On exit
; rax = out_len
_RDATA SEGMENT READ ALIGN(32) 'DATA'
shuffle_LUT DD 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 00h, 00h, 00h, 00h, 00h, 00h
DD 02h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 00h, 00h, 00h, 00h, 00h
DD 03h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 03h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 00h, 00h, 00h, 00h, 00h
DD 02h, 03h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 03h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 00h, 00h, 00h, 00h
DD 04h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 04h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 00h, 00h, 00h, 00h, 00h
DD 02h, 04h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 04h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 00h, 00h, 00h, 00h
DD 03h, 04h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 00h, 00h, 00h, 00h, 00h
DD 01h, 03h, 04h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 00h, 00h, 00h, 00h
DD 02h, 03h, 04h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 00h, 00h, 00h, 00h
DD 01h, 02h, 03h, 04h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 00h, 00h, 00h
DD 05h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 05h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 05h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 05h, 00h, 00h, 00h, 00h, 00h
DD 02h, 05h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 05h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 05h, 00h, 00h, 00h, 00h
DD 03h, 05h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 05h, 00h, 00h, 00h, 00h, 00h
DD 01h, 03h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 05h, 00h, 00h, 00h, 00h
DD 02h, 03h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 05h, 00h, 00h, 00h, 00h
DD 01h, 02h, 03h, 05h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 05h, 00h, 00h, 00h
DD 04h, 05h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 05h, 00h, 00h, 00h, 00h, 00h
DD 01h, 04h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 05h, 00h, 00h, 00h, 00h
DD 02h, 04h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 05h, 00h, 00h, 00h, 00h
DD 01h, 02h, 04h, 05h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 05h, 00h, 00h, 00h
DD 03h, 04h, 05h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 05h, 00h, 00h, 00h, 00h
DD 01h, 03h, 04h, 05h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 05h, 00h, 00h, 00h
DD 02h, 03h, 04h, 05h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 05h, 00h, 00h, 00h
DD 01h, 02h, 03h, 04h, 05h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 05h, 00h, 00h
DD 06h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 06h, 00h, 00h, 00h, 00h, 00h
DD 02h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 06h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 06h, 00h, 00h, 00h, 00h
DD 03h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 06h, 00h, 00h, 00h, 00h, 00h
DD 01h, 03h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 06h, 00h, 00h, 00h, 00h
DD 02h, 03h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 06h, 00h, 00h, 00h, 00h
DD 01h, 02h, 03h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 06h, 00h, 00h, 00h
DD 04h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 06h, 00h, 00h, 00h, 00h, 00h
DD 01h, 04h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 06h, 00h, 00h, 00h, 00h
DD 02h, 04h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 06h, 00h, 00h, 00h, 00h
DD 01h, 02h, 04h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 06h, 00h, 00h, 00h
DD 03h, 04h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 06h, 00h, 00h, 00h, 00h
DD 01h, 03h, 04h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 06h, 00h, 00h, 00h
DD 02h, 03h, 04h, 06h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 06h, 00h, 00h, 00h
DD 01h, 02h, 03h, 04h, 06h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 06h, 00h, 00h
DD 05h, 06h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 05h, 06h, 00h, 00h, 00h, 00h, 00h
DD 01h, 05h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 05h, 06h, 00h, 00h, 00h, 00h
DD 02h, 05h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 05h, 06h, 00h, 00h, 00h, 00h
DD 01h, 02h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 05h, 06h, 00h, 00h, 00h
DD 03h, 05h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 05h, 06h, 00h, 00h, 00h, 00h
DD 01h, 03h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 05h, 06h, 00h, 00h, 00h
DD 02h, 03h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 05h, 06h, 00h, 00h, 00h
DD 01h, 02h, 03h, 05h, 06h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 05h, 06h, 00h, 00h
DD 04h, 05h, 06h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 05h, 06h, 00h, 00h, 00h, 00h
DD 01h, 04h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 05h, 06h, 00h, 00h, 00h
DD 02h, 04h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 05h, 06h, 00h, 00h, 00h
DD 01h, 02h, 04h, 05h, 06h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 05h, 06h, 00h, 00h
DD 03h, 04h, 05h, 06h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 05h, 06h, 00h, 00h, 00h
DD 01h, 03h, 04h, 05h, 06h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 05h, 06h, 00h, 00h
DD 02h, 03h, 04h, 05h, 06h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 05h, 06h, 00h, 00h
DD 01h, 02h, 03h, 04h, 05h, 06h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 05h, 06h, 00h
DD 07h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 01h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 07h, 00h, 00h, 00h, 00h, 00h
DD 02h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 07h, 00h, 00h, 00h, 00h, 00h
DD 01h, 02h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 07h, 00h, 00h, 00h, 00h
DD 03h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 07h, 00h, 00h, 00h, 00h, 00h
DD 01h, 03h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 07h, 00h, 00h, 00h, 00h
DD 02h, 03h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 07h, 00h, 00h, 00h, 00h
DD 01h, 02h, 03h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 07h, 00h, 00h, 00h
DD 04h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 07h, 00h, 00h, 00h, 00h, 00h
DD 01h, 04h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 07h, 00h, 00h, 00h, 00h
DD 02h, 04h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 07h, 00h, 00h, 00h, 00h
DD 01h, 02h, 04h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 07h, 00h, 00h, 00h
DD 03h, 04h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 07h, 00h, 00h, 00h, 00h
DD 01h, 03h, 04h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 07h, 00h, 00h, 00h
DD 02h, 03h, 04h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 07h, 00h, 00h, 00h
DD 01h, 02h, 03h, 04h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 07h, 00h, 00h
DD 05h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 05h, 07h, 00h, 00h, 00h, 00h, 00h
DD 01h, 05h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 05h, 07h, 00h, 00h, 00h, 00h
DD 02h, 05h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 05h, 07h, 00h, 00h, 00h, 00h
DD 01h, 02h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 05h, 07h, 00h, 00h, 00h
DD 03h, 05h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 05h, 07h, 00h, 00h, 00h, 00h
DD 01h, 03h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 05h, 07h, 00h, 00h, 00h
DD 02h, 03h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 05h, 07h, 00h, 00h, 00h
DD 01h, 02h, 03h, 05h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 05h, 07h, 00h, 00h
DD 04h, 05h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 05h, 07h, 00h, 00h, 00h, 00h
DD 01h, 04h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 05h, 07h, 00h, 00h, 00h
DD 02h, 04h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 05h, 07h, 00h, 00h, 00h
DD 01h, 02h, 04h, 05h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 05h, 07h, 00h, 00h
DD 03h, 04h, 05h, 07h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 05h, 07h, 00h, 00h, 00h
DD 01h, 03h, 04h, 05h, 07h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 05h, 07h, 00h, 00h
DD 02h, 03h, 04h, 05h, 07h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 05h, 07h, 00h, 00h
DD 01h, 02h, 03h, 04h, 05h, 07h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 05h, 07h, 00h
DD 06h, 07h, 00h, 00h, 00h, 00h, 00h, 00h
DD 00h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 01h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 01h, 06h, 07h, 00h, 00h, 00h, 00h
DD 02h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 02h, 06h, 07h, 00h, 00h, 00h, 00h
DD 01h, 02h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 02h, 06h, 07h, 00h, 00h, 00h
DD 03h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 03h, 06h, 07h, 00h, 00h, 00h, 00h
DD 01h, 03h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 03h, 06h, 07h, 00h, 00h, 00h
DD 02h, 03h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 03h, 06h, 07h, 00h, 00h, 00h
DD 01h, 02h, 03h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 03h, 06h, 07h, 00h, 00h
DD 04h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 04h, 06h, 07h, 00h, 00h, 00h, 00h
DD 01h, 04h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 04h, 06h, 07h, 00h, 00h, 00h
DD 02h, 04h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 04h, 06h, 07h, 00h, 00h, 00h
DD 01h, 02h, 04h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 04h, 06h, 07h, 00h, 00h
DD 03h, 04h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 03h, 04h, 06h, 07h, 00h, 00h, 00h
DD 01h, 03h, 04h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 03h, 04h, 06h, 07h, 00h, 00h
DD 02h, 03h, 04h, 06h, 07h, 00h, 00h, 00h
DD 00h, 02h, 03h, 04h, 06h, 07h, 00h, 00h
DD 01h, 02h, 03h, 04h, 06h, 07h, 00h, 00h
DD 00h, 01h, 02h, 03h, 04h, 06h, 07h, 00h
DD 05h, 06h, 07h, 00h, 00h, 00h, 00h, 00h
DD 00h, 05h, 06h, 07h, 00h, 00h, 00h, 00h
DD 01h, 05h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 01h, 05h, 06h, 07h, 00h, 00h, 00h
DD 02h, 05h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 02h, 05h, 06h, 07h, 00h, 00h, 00h
DD 01h, 02h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 02h, 05h, 06h, 07h, 00h, 00h
DD 03h, 05h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 03h, 05h, 06h, 07h, 00h, 00h, 00h
DD 01h, 03h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 03h, 05h, 06h, 07h, 00h, 00h
DD 02h, 03h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 02h, 03h, 05h, 06h, 07h, 00h, 00h
DD 01h, 02h, 03h, 05h, 06h, 07h, 00h, 00h
DD 00h, 01h, 02h, 03h, 05h, 06h, 07h, 00h
DD 04h, 05h, 06h, 07h, 00h, 00h, 00h, 00h
DD 00h, 04h, 05h, 06h, 07h, 00h, 00h, 00h
DD 01h, 04h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 01h, 04h, 05h, 06h, 07h, 00h, 00h
DD 02h, 04h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 02h, 04h, 05h, 06h, 07h, 00h, 00h
DD 01h, 02h, 04h, 05h, 06h, 07h, 00h, 00h
DD 00h, 01h, 02h, 04h, 05h, 06h, 07h, 00h
DD 03h, 04h, 05h, 06h, 07h, 00h, 00h, 00h
DD 00h, 03h, 04h, 05h, 06h, 07h, 00h, 00h
DD 01h, 03h, 04h, 05h, 06h, 07h, 00h, 00h
DD 00h, 01h, 03h, 04h, 05h, 06h, 07h, 00h
DD 02h, 03h, 04h, 05h, 06h, 07h, 00h, 00h
DD 00h, 02h, 03h, 04h, 05h, 06h, 07h, 00h
DD 01h, 02h, 03h, 04h, 05h, 06h, 07h, 00h
DD 00h, 01h, 02h, 03h, 04h, 05h, 06h, 07h
write_mask DD 80000000h, 80000000h, 80000000h, 80000000h
DD 80000000h, 80000000h, 80000000h, 80000000h
DD 00000000h, 00000000h, 00000000h, 00000000h
DD 00000000h, 00000000h, 00000000h, 00000000h
_RDATA ENDS
.code
avx2_compress PROC public
push r13
push r14
push r15
; mov rdx, source
; mov rcx, dest
mov r9, r8 ; mov r9, len
lea r14, shuffle_LUT ; mov r14, shuffle_LUT
lea r15, write_mask ; mov r15, write_mask
xor r8, r8
xor r11, r11
vpxor ymm0, ymm0, ymm0
mainloop:
vmovdqa ymm1, ymmword ptr[rdx+r8*4]
vpcmpgtd ymm2, ymm1, ymm0
mov r10, 8
vmovmskps r13, ymm2
shl r13, 5
vmovdqu ymm3, ymmword ptr[r14+r13]
vpermd ymm2, ymm3, ymm1
popcnt r13, r13
sub r10, r13
vmovdqu ymm3, ymmword ptr[r15+r10*4]
vmaskmovps [rcx+r11*4], ymm3, ymm2
add r11, r13
add r8, 8
cmp r8, r9
jne mainloop
vzeroupper
pop r15
pop r14
pop r13
mov rax, r11
ret
avx2_compress ENDP
end | 37.667656 | 79 | 0.629274 |
4ba8840baa3876938e70017601879dabeebfc6b3 | 12,231 | asm | Assembly | audio/music/rivalbattle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | audio/music/rivalbattle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | audio/music/rivalbattle.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | Music_RivalBattle:
musicheader 3, 1, Music_RivalBattle_Ch1
musicheader 1, 2, Music_RivalBattle_Ch2
musicheader 1, 3, Music_RivalBattle_Ch3
Music_RivalBattle_Ch1:
tempo 102
volume $77
dutycycle $3
tone $0002
vibrato $8, $15
notetype $c, $b2
octave 3
note F#, 2
note A#, 4
intensity $b7
note A#, 10
intensity $b2
note F#, 2
octave 4
note C#, 4
intensity $b7
note C#, 6
note E_, 4
Music_RivalBattle_branch_e9777:
intensity $b2
octave 2
note A#, 6
intensity $b7
octave 3
note C#, 6
intensity $b2
note D#, 4
loopchannel 3, Music_RivalBattle_branch_e9777
intensity $b2
octave 2
note A#, 2
octave 3
note C#, 4
intensity $b7
note C#, 10
Music_RivalBattle_branch_e978f:
intensity $b2
octave 3
note G#, 6
intensity $b7
note B_, 6
intensity $b2
octave 4
note C#, 4
loopchannel 3, Music_RivalBattle_branch_e978f
intensity $b2
octave 3
note G#, 2
note B_, 4
intensity $4d
note B_, 10
Music_RivalBattle_branch_e97a6:
intensity $b7
note A#, 6
note F#, 6
note D#, 4
note F_, 4
note F#, 4
note G#, 2
note A#, 6
intensity $b2
note F_, 1
note D#, 1
note C#, 1
note D#, 1
intensity $b7
note F_, 4
intensity $b2
note G#, 1
note F#, 1
note F_, 1
note F#, 1
intensity $b7
note G#, 4
intensity $b6
note G#, 2
note A#, 2
note B_, 2
note A#, 2
note B_, 2
octave 4
note C#, 2
octave 3
note B_, 2
octave 4
note E_, 2
intensity $b7
octave 3
note A#, 6
note F#, 6
note A#, 4
octave 4
note C#, 4
octave 3
note B_, 4
note A#, 2
note G#, 6
note F_, 6
octave 4
note C#, 6
octave 3
note G#, 4
intensity $b5
note C#, 2
note F_, 2
note G#, 2
octave 4
note C_, 2
note C#, 2
octave 3
note G#, 2
note F_, 2
note G#, 2
intensity $b7
note F#, 10
intensity $b4
octave 2
note B_, 2
octave 3
note D#, 2
note F#, 2
intensity $b7
note F_, 4
note D#, 4
note C#, 2
note D#, 6
intensity $a0
note F_, 8
intensity $a7
note F_, 8
intensity $a0
octave 2
note A#, 8
intensity $a7
note A#, 8
intensity $b7
octave 3
note F#, 10
intensity $b5
octave 2
note B_, 2
octave 3
note D#, 2
note F#, 2
note F_, 2
note D#, 2
note C#, 2
note D#, 2
note G#, 2
note F#, 2
note F_, 2
note G#, 2
intensity $a0
note A#, 16
intensity $a7
note A#, 16
intensity $a0
note B_, 8
intensity $a7
note B_, 4
intensity $b7
note G#, 4
intensity $b5
octave 4
note E_, 2
note D#, 2
note C#, 2
octave 3
note B_, 2
octave 4
note F#, 2
note E_, 2
note D#, 2
note C#, 2
Music_RivalBattle_branch_e9837:
octave 3
note A#, 2
note E_, 2
note A#, 2
octave 4
note D#, 2
note E_, 2
note D#, 2
octave 3
note A#, 2
octave 4
note D#, 2
octave 3
note A#, 2
octave 4
note D#, 2
note E_, 2
note D#, 2
octave 3
note A#, 2
note D#, 2
note A#, 2
octave 4
note D#, 2
loopchannel 2, Music_RivalBattle_branch_e9837
intensity $94
octave 3
note D#, 8
octave 2
note A#, 8
octave 3
note G_, 8
note F_, 8
intensity $96
octave 2
note G#, 8
note A#, 8
note B_, 8
octave 3
note C#, 8
intensity $b7
octave 4
note D#, 8
octave 3
note A#, 8
octave 4
note G_, 8
note F_, 8
octave 3
note G#, 8
note A#, 8
note B_, 8
octave 4
note C#, 8
intensity $a0
note D#, 8
intensity $a7
note D#, 8
intensity $a0
octave 3
note G_, 8
intensity $a7
note G_, 8
intensity $b7
note D#, 8
note C#, 8
note D#, 4
note C#, 4
octave 2
note B_, 4
octave 3
note C#, 4
intensity $c7
octave 2
note A#, 6
octave 3
note C#, 6
note D#, 4
note E_, 6
note D#, 6
note C#, 4
note G#, 6
note E_, 6
note D#, 4
note C#, 6
note D#, 6
note D_, 4
octave 2
note G#, 6
note B_, 6
octave 3
note C#, 4
note D_, 6
note C#, 6
octave 2
note B_, 4
octave 3
note F#, 6
note D_, 6
note C#, 4
octave 2
note B_, 6
octave 3
note C#, 10
loopchannel 0, Music_RivalBattle_branch_e97a6
Music_RivalBattle_Ch2:
dutycycle $3
vibrato $8, $36
tone $0001
notetype $c, $c2
octave 4
note E_, 1
note D#, 1
note D_, 1
note C#, 1
note D_, 1
note C#, 1
note C_, 1
octave 3
note B_, 1
octave 4
note C_, 1
octave 3
note B_, 1
note A#, 1
note A_, 1
note A#, 1
note A_, 1
note G#, 1
note G_, 1
note G#, 1
note G_, 1
note F#, 1
note F_, 1
note F#, 1
note F_, 1
note E_, 1
note D#, 1
note E_, 1
note D#, 1
note D_, 1
note C#, 1
note D_, 1
note C#, 1
note C_, 1
octave 2
note B_, 1
intensity $c2
octave 4
note D#, 6
intensity $c7
octave 3
note F#, 6
intensity $c2
note G#, 4
Music_RivalBattle_branch_e98ea:
intensity $c2
note D#, 6
intensity $c7
note F#, 6
intensity $c2
note G#, 4
loopchannel 2, Music_RivalBattle_branch_e98ea
intensity $c2
note D#, 2
note F#, 4
intensity $c7
note F#, 8
intensity $a2
note B_, 1
octave 4
note C_, 1
Music_RivalBattle_branch_e9903:
intensity $c2
note C#, 6
intensity $c7
note E_, 6
intensity $c2
note F#, 4
loopchannel 3, Music_RivalBattle_branch_e9903
intensity $c2
note C#, 2
note E_, 4
intensity $b0
note E_, 4
intensity $b7
note E_, 6
Music_RivalBattle_branch_e991a:
callchannel Music_RivalBattle_branch_e99e0
intensity $b0
note G#, 8
intensity $b7
note G#, 8
callchannel Music_RivalBattle_branch_e99e0
intensity $4e
note G#, 8
intensity $b7
note G#, 8
intensity $b0
octave 3
note B_, 10
intensity $b7
note B_, 6
intensity $b0
octave 4
note C#, 8
octave 3
note B_, 8
intensity $b0
note A#, 10
intensity $b7
note A#, 6
intensity $2f
note D#, 10
intensity $b7
note D#, 6
intensity $b0
note B_, 10
intensity $b7
note B_, 6
intensity $c7
octave 4
note C#, 8
octave 3
note B_, 8
intensity $b0
octave 4
note D#, 16
intensity $b7
note D#, 16
intensity $b0
note E_, 4
intensity $b7
note E_, 6
intensity $c7
note E_, 2
note G#, 2
note B_, 2
octave 5
note C#, 8
octave 4
note B_, 8
intensity $b0
note A#, 10
intensity $b7
note A#, 6
intensity $b0
note A_, 10
intensity $b7
note A_, 6
intensity $b0
note G#, 10
intensity $b7
note G#, 6
intensity $b0
note G_, 10
intensity $b7
note G_, 6
intensity $a4
octave 3
note G_, 8
note D#, 8
note A#, 8
note G#, 8
intensity $a6
octave 2
note B_, 8
octave 3
note C#, 8
note D#, 8
note F_, 8
intensity $c7
octave 4
note G_, 8
note D#, 8
note A#, 8
note G#, 8
octave 3
note B_, 8
octave 4
note C#, 8
note D#, 8
note F_, 8
intensity $b0
note G_, 16
note D#, 16
octave 3
note B_, 8
note A#, 8
note G#, 8
intensity $c7
note F_, 8
Music_RivalBattle_branch_e99a6:
intensity $c2
octave 3
note A#, 6
intensity $c7
octave 4
note C#, 6
intensity $c2
note D#, 4
loopchannel 3, Music_RivalBattle_branch_e99a6
intensity $c2
octave 3
note A#, 2
octave 4
note C#, 4
intensity $b7
note C#, 6
intensity $9a
note C#, 4
Music_RivalBattle_branch_e99c1:
intensity $c2
octave 3
note G#, 6
intensity $c7
note B_, 6
intensity $c2
octave 4
note C#, 4
loopchannel 3, Music_RivalBattle_branch_e99c1
intensity $c2
octave 3
note G#, 2
note B_, 4
intensity $c7
note B_, 6
intensity $6a
octave 4
note D_, 4
loopchannel 0, Music_RivalBattle_branch_e991a
Music_RivalBattle_branch_e99e0:
intensity $c7
note D#, 10
intensity $c4
octave 3
note A#, 2
octave 4
note D#, 2
note F#, 2
intensity $c5
note F_, 4
note D#, 4
intensity $c2
note C#, 2
intensity $c7
note D#, 6
intensity $b0
note F_, 8
intensity $b7
note F_, 8
endchannel
Music_RivalBattle_Ch3:
notetype $c, $19
octave 3
note F#, 2
note A#, 2
note __, 2
note A#, 10
octave 3
note F#, 2
octave 4
note C#, 2
note __, 2
note C#, 6
octave 3
note C#, 2
note D_, 2
Music_RivalBattle_branch_e9a0c:
note D#, 2
note C#, 2
note D#, 2
note F#, 4
note E_, 2
note D#, 2
note C#, 2
loopchannel 4, Music_RivalBattle_branch_e9a0c
Music_RivalBattle_branch_e9a17:
octave 3
note C#, 2
octave 2
note B_, 2
octave 3
note C#, 2
note E_, 4
note D_, 2
note C#, 2
octave 2
note B_, 2
loopchannel 3, Music_RivalBattle_branch_e9a17
octave 3
note C#, 2
note E_, 2
note C#, 2
octave 2
note B_, 4
octave 3
note C_, 2
note C#, 2
note D_, 2
Music_RivalBattle_branch_e9a30:
callchannel Music_RivalBattle_branch_e9b47
octave 2
note A#, 2
octave 4
note C#, 2
octave 2
note A#, 2
octave 3
note B_, 2
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note G#, 2
callchannel Music_RivalBattle_branch_e9b50
note C#, 2
note G#, 2
octave 4
note C#, 2
octave 3
note G#, 4
note C#, 2
note C_, 2
octave 2
note B_, 2
callchannel Music_RivalBattle_branch_e9b47
octave 2
note A#, 2
octave 3
note A#, 2
octave 2
note A#, 2
octave 3
note G#, 2
octave 2
note A#, 2
octave 3
note F#, 2
octave 2
note A#, 2
octave 3
note F_, 2
callchannel Music_RivalBattle_branch_e9b50
Music_RivalBattle_branch_e9a66:
note C#, 2
note G#, 2
loopchannel 4, Music_RivalBattle_branch_e9a66
callchannel Music_RivalBattle_branch_e9b5c
note G#, 2
note F#, 2
Music_RivalBattle_branch_e9a71:
octave 2
note A#, 2
octave 3
note F_, 2
loopchannel 4, Music_RivalBattle_branch_e9a71
octave 2
note A#, 2
octave 3
note F#, 2
octave 2
note A#, 2
octave 3
note F#, 2
octave 2
note A#, 2
octave 3
note F#, 2
note F_, 2
note D#, 2
callchannel Music_RivalBattle_branch_e9b5c
octave 2
note B_, 2
octave 3
note D_, 2
callchannel Music_RivalBattle_branch_e9b65
octave 3
note D#, 2
octave 4
note D#, 2
callchannel Music_RivalBattle_branch_e9b65
octave 3
note D#, 2
note A#, 2
note E_, 2
note B_, 2
octave 4
note E_, 2
octave 3
note E_, 2
note B_, 2
octave 4
note E_, 2
octave 3
note E_, 2
octave 4
note E_, 2
octave 3
note E_, 2
note B_, 2
octave 4
note E_, 2
octave 3
note E_, 2
note E_, 2
note F#, 2
note G_, 2
note G#, 2
Music_RivalBattle_branch_e9ab3:
note D#, 2
note A#, 2
loopchannel 4, Music_RivalBattle_branch_e9ab3
Music_RivalBattle_branch_e9ab9:
note D#, 2
note A_, 2
loopchannel 4, Music_RivalBattle_branch_e9ab9
Music_RivalBattle_branch_e9abf:
note D#, 2
note G#, 2
loopchannel 4, Music_RivalBattle_branch_e9abf
Music_RivalBattle_branch_e9ac5:
note D#, 2
note G_, 2
loopchannel 12, Music_RivalBattle_branch_e9ac5
Music_RivalBattle_branch_e9acb:
octave 2
note B_, 2
octave 3
note D#, 2
loopchannel 4, Music_RivalBattle_branch_e9acb
Music_RivalBattle_branch_e9ad3:
octave 2
note B_, 2
octave 3
note F#, 2
loopchannel 4, Music_RivalBattle_branch_e9ad3
note D#, 2
note G_, 2
note A#, 2
note D#, 2
note G_, 2
note A#, 2
note D#, 2
note A#, 2
note D#, 2
note G_, 2
note A#, 2
note D#, 2
note G_, 2
note A#, 2
note D#, 2
note A#, 2
octave 2
note B_, 2
octave 3
note G_, 2
note B_, 2
octave 2
note B_, 2
octave 3
note G_, 2
note B_, 2
octave 2
note B_, 2
octave 3
note B_, 2
octave 2
note B_, 2
octave 3
note G#, 2
note B_, 2
octave 2
note B_, 2
octave 4
note D#, 2
note C#, 2
octave 3
note B_, 2
note G#, 2
note G_, 8
note D#, 8
note A#, 8
note G_, 8
octave 2
note B_, 8
octave 3
note C#, 8
note D#, 8
note F_, 8
Music_RivalBattle_branch_e9b10:
octave 2
note A#, 2
octave 3
note D#, 2
loopchannel 7, Music_RivalBattle_branch_e9b10
note E_, 2
note D#, 2
Music_RivalBattle_branch_e9b1a:
octave 2
note A#, 2
octave 3
note D#, 2
loopchannel 6, Music_RivalBattle_branch_e9b1a
octave 2
note A#, 2
octave 3
note F#, 2
note F_, 2
note E_, 2
Music_RivalBattle_branch_e9b28:
octave 2
note G#, 2
octave 3
note C#, 2
loopchannel 7, Music_RivalBattle_branch_e9b28
note D_, 2
note C#, 2
Music_RivalBattle_branch_e9b32:
octave 2
note G#, 2
octave 3
note C#, 2
loopchannel 4, Music_RivalBattle_branch_e9b32
octave 2
note B_, 2
note G#, 2
note B_, 2
octave 3
note F_, 4
note E_, 2
note D#, 2
note D_, 2
loopchannel 0, Music_RivalBattle_branch_e9a30
Music_RivalBattle_branch_e9b47:
octave 2
note A#, 2
octave 3
note D#, 2
loopchannel 4, Music_RivalBattle_branch_e9b47
endchannel
Music_RivalBattle_branch_e9b50:
note C#, 2
note G#, 2
octave 4
note C#, 2
octave 3
note G#, 4
octave 4
note C#, 2
octave 3
note C#, 2
note G#, 2
endchannel
Music_RivalBattle_branch_e9b5c:
octave 2
note B_, 2
octave 3
note F#, 2
loopchannel 7, Music_RivalBattle_branch_e9b5c
endchannel
Music_RivalBattle_branch_e9b65:
octave 3
note D#, 2
note A#, 2
octave 4
note D#, 2
loopchannel 2, Music_RivalBattle_branch_e9b65
endchannel
| 14.205575 | 47 | 0.675333 |
5aa6173a9901fcc3a4ec2747b40ef4677c087417 | 551 | asm | Assembly | Library/Spell/ICS/spellStrings.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Spell/ICS/spellStrings.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Spell/ICS/spellStrings.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1991 -- All Rights Reserved
PROJECT: Spell
FILE: spellStrings.asm
AUTHOR: Andrew Wilson, Apr 18, 1991
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 4/18/91 Initial revision
DESCRIPTION:
This file contains localizable spell library strings.
$Id: spellStrings.asm,v 1.1 97/04/07 11:05:40 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
| 25.045455 | 79 | 0.488203 |
e9ebe7640a5751643915e05e61fb54f45063c757 | 8,847 | asm | Assembly | Appl/Dump/clipboard.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Dump/clipboard.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Dump/clipboard.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Screen Dumps -- Clipboard format
FILE: clipboard.asm
AUTHOR: Adam de Boor, Dec 4, 1989
ROUTINES:
Name Description
---- -----------
ClipboardPrologue Initialize file
ClipboardSlice Write a bitmap slice to the file
ClipboardEpilogue Cleanup
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 12/ 4/89 Initial revision
DESCRIPTION:
Output-dependent routines for creating a scrap in the clipboard.
$Id: clipboard.asm,v 1.1 97/04/04 15:36:40 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include dump.def
include file.def
include vm.def
include graphics.def
include gstring.def
include Objects/clipbrd.def
idata segment
ClipboardProcs DumpProcs <
0, ClipboardPrologue, ClipboardSlice, ClipboardEpilogue, <'scr'>, 0
>
idata ends
MAX_SLICES equ 256 ; max number of slices we can handle
udata segment
clipboardSlices hptr MAX_SLICES dup(?)
clipboardNextSlice nptr.hptr
clipboardDrawSlice nptr.hptr
clipboardGString hptr
clipboardFile hptr
clipboardGStringHead word
clipboardItem word
clipboardStartRow word
clipboardHeight word
udata ends
ClipboardCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ClipboardPrologue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize a clipboard thingummy
CALLED BY: DumpScreen
PASS: si = BMFormat
bp = file handle
cx = dump width
dx = dump height
ds = dgroup
RETURN: Carry set on error
DESTROYED: not bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 12/ 4/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ClipboardPrologue proc far
uses bp
.enter
mov ds:[clipboardHeight], dx
;
; get hold of the clipboard file handle and open the gstring we'll
; use once we've got all the slices.
;
push cx, dx ; save width & height
call ClipboardGetClipboardFile ; bx = file handle
mov ds:[clipboardFile], bx ; save block & handle for later
;
; allocate a GString to write to...
;
mov cx, GST_VMEM ; put it in a VM file
call GrCreateGString ; di = gstring
mov ds:[clipboardGStringHead], si
mov ds:[clipboardGString], di
;
; Allocate the ClipboardItemHeader block now as well
;
mov bx, ds:[clipboardFile]
clr ax ; UID
mov cx, size ClipboardItemHeader
call VMAlloc ;ax = block
mov ds:[clipboardItem], ax
push ds ; save our ds
call VMLock
mov ds, ax ; set ds to new block seg
call GeodeGetProcessHandle
mov ds:[CIH_owner].handle, bx
mov ds:[CIH_owner].chunk, 0
mov ds:[CIH_flags], 0
mov ds:[CIH_formatCount], 1
mov ds:[CIH_formats][0].CIFI_format.CIFID_manufacturer,
MANUFACTURER_ID_GEOWORKS
mov ds:[CIH_formats][0].CIFI_format.CIFID_type,
CIF_GRAPHICS_STRING
mov ax, es:[clipboardGStringHead]
mov ds:[CIH_formats][0].CIFI_vmChain.high, ax
mov ds:[CIH_formats][0].CIFI_vmChain.low, 0
;
; Now set the 2 extra bytes to the width and height
;
pop ax ; ax <- dgroup
pop ds:[CIH_formats][0].CIFI_extra1, ; width
ds:[CIH_formats][0].CIFI_extra2 ; height
push ax ; save it again...
segmov es,ds,di ;es:di - dest of scrap name
mov di, offset CIH_name ;
mov bx, handle Strings ; lock the strings resource
call MemLock
mov ds, ax
assume ds:Strings
mov si, ds:[dumpScrapName] ; Dereference chunk
ChunkSizePtr ds, si, cx
rep movsb ; move it on over...
call MemUnlock ; unlock the strings resource
assume ds:dgroup
pop ds ; restore our ds
call VMDirty
call VMUnlock
;
; Initialize slice array pointer.
;
mov ds:[clipboardNextSlice], offset clipboardSlices
mov ds:[clipboardStartRow], 0
;
; Happiness
;
clc
.leave
ret
ClipboardPrologue endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ClipboardSlice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a single Clipboard slice out to the file
CALLED BY: DumpScreen
PASS: bp = file handle
si = Clipboard block handle
cx = size of bitmap (bytes)
ds, es = dgroup
RETURN: Carry set on error
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 12/ 4/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ClipboardSlice proc far
uses dx, di, ds, es
.enter
;
; Enlarge the Bitmap header to a CBitmap header, for later drawing.
;
mov ax, cx
add ax, size CBitmap - size Bitmap
push cx
mov ch, mask HAF_LOCK
mov bx, si
call MemReAlloc
pop si
push es
mov es, ax
mov ds, ax
dec si ; start move with last byte
mov di, si
add di, size CBitmap - size Bitmap ; make room for extra
; header data
mov cx, si
sub cx, size Bitmap-1 ; cx <- # bytes to move
std
rep movsb
cld
pop es
;
; Initialize the complex bitmap header.
;
mov ax, es:[clipboardStartRow]
mov ds:[CB_startScan], ax
mov ax, es:[clipboardHeight]
xchg ds:[B_height], ax
add es:[clipboardStartRow], ax
mov ds:[CB_numScans], ax
mov ds:[CB_devInfo], 0
mov ds:[CB_data], size CBitmap
mov ds:[CB_palette], 0
mov ds:[CB_xres], 72
mov ds:[CB_yres], 72
or ds:[B_type], mask BMT_COMPLEX
call MemUnlock
segmov ds, es
;
; Just store the handle away in our array.
;
mov di, ds:[clipboardNextSlice]
mov ax, bx
stosw
mov ds:[clipboardNextSlice], di
;
; Return carry set if slice array full (di is ae the end of the array)
;
cmp di, offset clipboardSlices+size clipboardSlices
cmc ; need carry set if ae
.leave
ret
ClipboardSlice endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ClipboardEpilogue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finish off a Clipboard scrap
CALLED BY: DumpScreen
PASS: bp = file handle
ds, es = dgroup
RETURN: Carry set on error
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 12/ 4/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ClipboardEpilogue proc far
uses bp
.enter
;
; Draw the bitmap slices as one big bitmap into the gstring
;
mov di, ds:[clipboardGString]
mov bx, ds:[clipboardSlices][0]
mov ds:[clipboardDrawSlice],
offset clipboardSlices+type clipboardSlices
push ds
call MemLock
mov ds, ax
clr si
mov dx, cs
mov cx, offset ClipboardGetNextSlice
clr ax
mov bx, ax
call GrDrawBitmap
pop ds
;
; Finish off the string.
;
call GrEndGString
mov dl, GSKT_LEAVE_DATA
xchg di, si ; GString => SI, 0 => DI
call GrDestroyGString
;
; Set the result as the normal transfer item.
;
mov bx, ds:[clipboardFile]
mov ax, ds:[clipboardItem]
clr bp ; normal item
call ClipboardRegisterItem
;
; Happiness.
;
clc
.leave
ret
ClipboardEpilogue endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ClipboardGetNextSlice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Fetch the next slice of the bitmap for drawling.
CALLED BY: ClipboardEpilogue via GrDrawBitmap
PASS: ds:si = current slice
dgroup:clipboardDrawSlice set to address of next handle
to use
RETURN: ds:si = new slice
carry set to stop drawing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ClipboardGetNextSlice proc far
uses ax, bx
.enter
segmov ds, dgroup, si
mov si, ds:[clipboardDrawSlice]
;
; Free the previous slice.
;
mov bx, ds:[si-2]
call MemFree
;
; See if that's all she wrote...
;
cmp si, ds:[clipboardNextSlice]
stc
je done
;
; Nope. Lock down the next one.
;
lodsw
mov ds:[clipboardDrawSlice], si
mov bx, ax
call MemLock
mov ds, ax
clr si
done:
.leave
ret
ClipboardGetNextSlice endp
ClipboardCode ends
| 22.626598 | 79 | 0.586187 |
0176cd00d76c475695be9d31f7dee08db212f691 | 8,443 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_806.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_0xca_notsx.log_21829_806.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_0xca_notsx.log_21829_806.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r15
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1be58, %r13
nop
nop
nop
sub $15869, %r9
mov (%r13), %r11d
nop
nop
nop
nop
nop
xor $40231, %r14
lea addresses_WC_ht+0xb298, %rsi
lea addresses_normal_ht+0xbc60, %rdi
cmp %r11, %r11
mov $32, %rcx
rep movsq
nop
and $65045, %rsi
lea addresses_WC_ht+0x1e76c, %r13
nop
nop
add %r9, %r9
mov $0x6162636465666768, %r11
movq %r11, (%r13)
xor $2658, %rsi
lea addresses_normal_ht+0x4c58, %rcx
nop
nop
nop
nop
and %r11, %r11
vmovups (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r14
and $14072, %rsi
lea addresses_D_ht+0x1e8d8, %rdi
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $0x6162636465666768, %r13
movq %r13, %xmm3
movups %xmm3, (%rdi)
nop
nop
inc %rdi
lea addresses_WC_ht+0x12e18, %r14
add $53616, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
vmovups %ymm5, (%r14)
nop
and $5763, %rsi
lea addresses_UC_ht+0x17098, %rsi
lea addresses_A_ht+0x1a518, %rdi
nop
nop
nop
nop
nop
xor %r9, %r9
mov $53, %rcx
rep movsq
nop
dec %r9
lea addresses_WC_ht+0xb154, %rsi
lea addresses_D_ht+0x4ed8, %rdi
nop
nop
nop
nop
and $50814, %r15
mov $52, %rcx
rep movsq
nop
nop
and %rsi, %rsi
lea addresses_WC_ht+0xaa18, %r15
nop
nop
nop
nop
nop
sub $43939, %r14
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%r15)
xor %r11, %r11
lea addresses_D_ht+0x6bdc, %rsi
lea addresses_normal_ht+0x18418, %rdi
nop
inc %r13
mov $53, %rcx
rep movsb
nop
nop
cmp $18282, %r9
lea addresses_normal_ht+0x1ea98, %rdi
nop
nop
nop
add $45525, %r11
mov (%rdi), %r14
nop
nop
nop
nop
lfence
lea addresses_WT_ht+0x108c0, %r9
nop
nop
nop
add $24812, %r15
movl $0x61626364, (%r9)
nop
nop
nop
nop
add $37157, %r11
lea addresses_WT_ht+0x15538, %r14
inc %rcx
movb (%r14), %r13b
nop
nop
xor %r14, %r14
lea addresses_D_ht+0x4f18, %rdi
dec %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm3
vmovups %ymm3, (%rdi)
and $12616, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_D+0xba98, %r8
nop
nop
nop
xor $65255, %rbx
movw $0x5152, (%r8)
nop
nop
nop
nop
cmp $17972, %rax
// Store
lea addresses_normal+0x5b38, %r14
nop
dec %r12
mov $0x5152535455565758, %r8
movq %r8, %xmm2
movups %xmm2, (%r14)
nop
nop
and $56916, %r12
// REPMOV
lea addresses_D+0xd18, %rsi
lea addresses_WT+0xd4a8, %rdi
xor %rax, %rax
mov $34, %rcx
rep movsl
nop
nop
nop
sub %rdi, %rdi
// Faulty Load
lea addresses_D+0xba98, %rbx
nop
nop
sub %r8, %r8
vmovups (%rbx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rcx
lea oracles, %rsi
and $0xff, %rcx
shlq $12, %rcx
mov (%rsi,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WT'}, 'OP': 'REPM'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 5, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'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
*/
| 33.240157 | 2,999 | 0.657349 |
4bf25d2f37ebaebb476f0f5fc3405934ac2072ff | 1,604 | asm | Assembly | programs/oeis/263/A263622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/263/A263622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/263/A263622.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A263622: a(n) = (3^(n+1)-2^(n+2)+2*n+1)/4.
; 0,1,4,14,47,153,486,1516,4669,14255,43268,130818,394491,1187557,3570850,10728920,32219513,96724059,290303232,871171822,2614039735,7843167761,23531600414,70598995524,211805375157,635432902663,1906332262396,5719063896026,17157325905779,51472246152765,154417275329178,463252899729328,1389760846671601,4169286834982067,12507869094880760,37523624464511430,112570907753272623,337712791979294569,1013138513376837142,3039415815008418332,9118247994781068845,27354745083854834271,82064237450587758324,246192716749809786034,738578159045522380267,2215734494728753185173,6647203519370631644306,19941610628480639110536,59824832026179405686889,179474496360013193771275,538423489642989534735088,1615270470054868511047838,4845811412416405346828711,14537434241752815667856577,43612302734265646258310670,130836908220811337284413940,392510724698462808872205733,1177532174167446020654545079,3532596522646453250039491052,10597789568227590126270184842,31793368705259231131113977955,95380106116930614897948780781,286140318353097687703060036234,858420955063904749127607496544,2575262865200937619419677265377,7725788595621259602332741347683,23177365786900672295145643146216,69532097360775803861731767645046,208596292082474985537784979347999,625788876247720104518534290869785,1877366628743750609365961578260998,5632099886232432419718602146086348,16896299658699658442397241260865821,50688898976103697693674593427811087,152066696928320537813989519573860580,456200090784980502907900037302436450
seq $0,36550 ; a(n) = T(0,n) + T(1,n-1) + ... + T(n,0), array T given by A048471.
div $0,2
| 267.333333 | 1,466 | 0.906484 |
3b1b8b4bab07dbc088329507d7008d9b6977eda4 | 485 | asm | Assembly | BigNum/Mod/Io/bnFromBytes.asm | FloydZ/Crypto-Hash | 2635450fb16d4d8dc4578d6539cc25ce599f7e21 | [
"MIT"
] | 11 | 2015-03-17T10:31:23.000Z | 2022-01-21T17:42:43.000Z | BigNum/Mod/Io/bnFromBytes.asm | 0xFF1E071F/Crypto-Hash | 2635450fb16d4d8dc4578d6539cc25ce599f7e21 | [
"MIT"
] | null | null | null | BigNum/Mod/Io/bnFromBytes.asm | 0xFF1E071F/Crypto-Hash | 2635450fb16d4d8dc4578d6539cc25ce599f7e21 | [
"MIT"
] | 6 | 2018-01-29T16:06:36.000Z | 2021-05-08T19:22:24.000Z | .686
.model flat,stdcall
option casemap:none
include .\bnlib.inc
include .\bignum.inc
.code
;;
;; copies sequence of bytes to a bn
;;
;_a_
bnFromBytes proc uses edi esi pBytes:DWORD,dwBytesLen:dword,bn:DWORD,bSigned:dword
invoke bnClear,bn
mov ecx,dwBytesLen
mov edi,bn
mov eax,ecx
mov esi,pBytes
add eax,3
and eax,-4
shr eax,2
mov [edi].BN.dwSize,eax
movzx edx,byte ptr bSigned
mov [edi].BN.bSigned,edx
lea edi,[edi].BN.dwArray[0]
rep movsb
ret
bnFromBytes endp
end
| 15.645161 | 82 | 0.734021 |
4d58af3acb66c9197419ef0f778567c56c8dd9a7 | 8,824 | asm | Assembly | Transynther/x86/_processed/NC/_ht_st_zr_sm_/i7-7700_9_0x48.log_21829_331.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_ht_st_zr_sm_/i7-7700_9_0x48.log_21829_331.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_ht_st_zr_sm_/i7-7700_9_0x48.log_21829_331.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1ac1c, %rsi
lea addresses_normal_ht+0x13b1c, %rdi
nop
xor $9263, %r14
mov $70, %rcx
rep movsw
nop
nop
and %rsi, %rsi
lea addresses_UC_ht+0x434c, %rbp
nop
nop
nop
nop
nop
cmp %r13, %r13
mov (%rbp), %ebx
cmp $35287, %r14
lea addresses_WT_ht+0x1d1dc, %rcx
nop
xor $28826, %rbx
mov (%rcx), %rbp
nop
nop
nop
nop
nop
cmp $64120, %r14
lea addresses_WC_ht+0x1aed4, %rsi
dec %rbp
mov (%rsi), %cx
nop
nop
and %rbx, %rbx
lea addresses_D_ht+0x1b1c, %rsi
nop
and %rbx, %rbx
mov (%rsi), %rdi
nop
nop
nop
xor $47802, %rcx
lea addresses_UC_ht+0x7894, %rdi
nop
xor $44929, %rcx
movb (%rdi), %bl
nop
dec %rcx
lea addresses_A_ht+0x1331c, %r14
nop
nop
nop
sub %r13, %r13
movw $0x6162, (%r14)
nop
nop
nop
nop
nop
sub $41307, %rdi
lea addresses_WT_ht+0x1594e, %rbp
nop
sub %rcx, %rcx
movw $0x6162, (%rbp)
nop
nop
nop
nop
dec %r14
lea addresses_D_ht+0x1441c, %rsi
lea addresses_WC_ht+0x1c31c, %rdi
nop
nop
nop
nop
nop
dec %r15
mov $38, %rcx
rep movsb
nop
xor $31439, %r15
lea addresses_UC_ht+0x571c, %rsi
lea addresses_D_ht+0x1215c, %rdi
nop
nop
nop
nop
xor %rbp, %rbp
mov $33, %rcx
rep movsw
nop
nop
nop
and $36375, %rbp
lea addresses_WT_ht+0x170d0, %rsi
lea addresses_D_ht+0x107dc, %rdi
nop
nop
nop
nop
sub %r14, %r14
mov $87, %rcx
rep movsl
nop
nop
nop
add $41493, %rsi
lea addresses_D_ht+0x1031c, %r14
nop
nop
nop
dec %r13
vmovups (%r14), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rbx
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_normal_ht+0x14dc0, %r13
nop
nop
add $11399, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm3
movups %xmm3, (%r13)
nop
nop
and $63366, %r15
lea addresses_UC_ht+0x11da4, %rsi
lea addresses_WC_ht+0xb91c, %rdi
clflush (%rsi)
nop
nop
nop
nop
inc %r15
mov $51, %rcx
rep movsw
and $56813, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r9
push %rbp
push %rbx
push %rcx
push %rdx
// Store
mov $0x3d42f70000000b1c, %rbp
nop
sub %r13, %r13
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
movups %xmm6, (%rbp)
nop
cmp $6837, %rbx
// Store
mov $0x3d42f70000000b1c, %rdx
nop
nop
nop
nop
nop
xor %r11, %r11
mov $0x5152535455565758, %rbx
movq %rbx, %xmm3
vmovups %ymm3, (%rdx)
nop
add %rcx, %rcx
// Store
mov $0x2f54c00000000d1c, %r9
nop
inc %rbp
movw $0x5152, (%r9)
nop
nop
nop
nop
inc %r11
// Store
lea addresses_UC+0xe330, %rcx
nop
nop
nop
nop
add %rbp, %rbp
mov $0x5152535455565758, %r11
movq %r11, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
nop
dec %r9
// Load
lea addresses_PSE+0x1fb20, %rdx
sub $13375, %r9
mov (%rdx), %bx
nop
nop
nop
nop
nop
add %rbx, %rbx
// Faulty Load
mov $0x3d42f70000000b1c, %r11
clflush (%r11)
nop
nop
nop
nop
and %rdx, %rdx
mov (%r11), %r9d
lea oracles, %r13
and $0xff, %r9
shlq $12, %r9
mov (%r13,%r9,1), %r9
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'58': 20825, '44': 129, '46': 12, '00': 863}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 46 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 44 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 44 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 00 58 58 58 58 58 58 58 44 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 44 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 44 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 44 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58
*/
| 30.961404 | 2,999 | 0.653558 |
7a66563f9837e41485022c23880e8b73e9b0ee45 | 2,346 | asm | Assembly | kernel/source/kernel_early.asm | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 46 | 2019-09-30T18:40:06.000Z | 2022-02-20T12:54:59.000Z | kernel/source/kernel_early.asm | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 11 | 2019-08-18T18:31:11.000Z | 2021-09-14T22:34:16.000Z | kernel/source/kernel_early.asm | thomtl/Sigma | 30da9446a1f1b5cae4eff77bf9917fae1446ce85 | [
"BSD-2-Clause"
] | 1 | 2020-01-20T16:55:13.000Z | 2020-01-20T16:55:13.000Z | [bits 64]
section .text
initialize_sse:
mov eax, 1
cpuid
bt edx, 25
jnc .no_sse
mov rax, cr0
btr eax, 2
bts eax, 1
mov cr0, rax
mov rax, cr4
bts eax, 9
bts eax, 10
mov cr4, rax
ret
.no_sse:
ret
initialize_osxsave:
mov eax, 1
cpuid
bt ecx, 26
jnc .no_osxsave
mov rax, cr4
bts rax, 18 ; Set OSXSAVE bit for access to xgetbv and xsetbv and possibly xsave, xsaveopt and xrestor
mov cr4, rax
ret
.no_osxsave:
ret
initialize_efer:
mov ecx, 0xC0000080 ; IA32_EFER
rdmsr
bts eax, 0 ; Set SCE for the syscall and sysret instructions
bts eax, 11 ; Set NXE for No-Execute-Support
; LME and thus LMA are already set by the bootloader
wrmsr
ret
initialize_cr0:
mov rax, cr0
bts rax, 16 ; Set Write Protect bit so the CPU will enfore the Writable paging bit in kernel mode
mov cr0, rax
ret
initialize_cr4:
xor rax, rax
mov eax, 1
cpuid
bt edx, 13
jnc .no_pge
mov rax, cr4
bts rax, 7 ; Set Page Global Enable
mov cr4, rax
.no_pge:
ret
global _kernel_early
_kernel_early:
cld
cli
mov rsp, bsp_stack_top
and rsp, ~8 ; Make sure rsp + 8 is 16 byte aligned as mandated by the SysV ABI
mov rbp, 0 ; Set to zero to provide stack trace stop
call initialize_sse
call initialize_osxsave
call initialize_efer
call initialize_cr0
call initialize_cr4
extern _init
call _init
extern kernel_main
call kernel_main
extern _fini
call _fini
cli
hlt
global _smp_kernel_early
_smp_kernel_early:
cli
cld
mov rax, qword [trampoline_paging]
mov cr3, rax
mov rsp, qword [trampoline_stack]
and rsp, ~0xF ; Align stack for ABI requirements
mov rbp, 0 ; Set to zero to provide stack trace stop
mov byte [trampoline_booted], 1
call initialize_sse
call initialize_osxsave
call initialize_efer
call initialize_cr0
call initialize_cr4
extern smp_kernel_main
call smp_kernel_main
cli
hlt
section .data
global trampoline_stack
trampoline_stack: dq 0
global trampoline_paging
trampoline_paging: dq 0
global trampoline_booted
trampoline_booted: db 0
section .bss
align 16
bsp_stack_bottom:
resb 0x8000
bsp_stack_top: | 16.638298 | 106 | 0.665388 |
5ce9d93ad5e7d2625288a20e751bf5b645aca23e | 819 | asm | Assembly | oeis/008/A008418.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/008/A008418.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/008/A008418.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A008418: Coordination sequence for 9-dimensional cubic lattice.
; Submitted by Christian Krause
; 1,18,162,978,4482,16722,53154,148626,374274,864146,1854882,3742290,7159170,13079250,22952610,38878482,63821826,101880594,158611106,241419474,360027522,527022162,758497698,1074801042,1501390338,2069818002,2818849698,3795731282,5057616258,6673166802,8724341922,11308386834,14540038146,18553959954,23507426466,29583267282,36993091970,45980811090,56826471330,69850422930,85417838082,103943599506,125897578914,151810325586,182279185794,217974874322,259648519842,308139206418,364382033922,429416720658
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,8419 ; Crystal ball sequence for 9-dimensional cubic lattice.
mov $2,$3
mul $2,$0
add $4,$2
lpe
min $5,1
mul $5,$0
mov $0,$4
sub $0,$5
| 39 | 497 | 0.796093 |
f85f3c245721f1a556ff35000e4b315991aa8f63 | 130 | asm | Assembly | Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/masmx64/inffasx64.asm | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | null | null | null | Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/masmx64/inffasx64.asm | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | null | null | null | Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/masmx64/inffasx64.asm | antholuo/Blob_Traffic | 5d6acf88044e9abc63c0ff356714179eaa4b75bf | [
"MIT"
] | 2 | 2021-08-28T07:14:51.000Z | 2021-09-13T11:18:41.000Z | version https://git-lfs.github.com/spec/v1
oid sha256:2561248b0524141902e224357f34bcff260cebfe862115656c6dbcc64cd272a4
size 10187
| 32.5 | 75 | 0.884615 |
a5e326e456d3f149273d9b988a63d7380f659982 | 1,222 | asm | Assembly | Assembly/CH05N08/CH05N08.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | Assembly/CH05N08/CH05N08.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | Assembly/CH05N08/CH05N08.asm | IceNerd/hogwarts | df1f3e1a94688fd728f6b54653a36a47671293da | [
"Unlicense"
] | null | null | null | TITLE Color Matrix (ch5num3.asm)
; Program Description: This program displays a single character
; in all combinations of foreground and background
; colors.
; Author: Cody Kaiser
; Date Created: 10/17/03
; Last Modification Date: 10/17/03
INCLUDE Irvine32.inc
.DATA
mover DWORD 16 ;variable to multiply background with
.DATA?
count DWORD ? ;variable to store counter
.CODE
main PROC
mov ecx, 16 ;set outer loop counter
mov ebx, 0 ;initialize working regs to 0
mov eax, 0
foreground:
mov count, ecx ;save outer loop counter
mov ecx, 16 ;set inner loop counter
background:
mov esi, eax ;save background color
mul mover ;set eax as background
add eax, ebx ;set eax as back/foreground
call SetTextColor ;set text color and display
mov al, 01h
call WriteChar
mov eax, esi ;restore eax as background
inc eax ;increment background color
loop background ;end background loop
inc ebx ;increment foreground color
mov ecx, count ;restore outer loop count
loop foreground ;end foreground loop
mov eax,lightGray + (black * 16) ;restore default colors
call SetTextColor
call Crlf
call WaitMsg ;wait for user
exit ; exit to operating system
main ENDP
END main
| 21.438596 | 63 | 0.736498 |
8fabe5d57848c97229e4fed0960dbab5e41c1bd0 | 68 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=pwuc1_derefidx_vbuxx_minus_vwum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=pwuc1_derefidx_vbuxx_minus_vwum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=pwuc1_derefidx_vbuxx_minus_vwum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {c1},x
sec
sbc {m2}
sta {m1}
lda {c1}+1,x
sbc {m2}+1
sta {m1}+1
| 8.5 | 12 | 0.558824 |
a7f194217a099858a69a3d09f4c1f44ff8dde858 | 2,295 | asm | Assembly | punkt.asm | edenlandpl/drawing-one-point-in-assembly | 8d6594f8e9cd1eb943240f630fbde8707b79e931 | [
"MIT"
] | null | null | null | punkt.asm | edenlandpl/drawing-one-point-in-assembly | 8d6594f8e9cd1eb943240f630fbde8707b79e931 | [
"MIT"
] | null | null | null | punkt.asm | edenlandpl/drawing-one-point-in-assembly | 8d6594f8e9cd1eb943240f630fbde8707b79e931 | [
"MIT"
] | null | null | null | format MZ
stack stk:256
entry codseg:main
VideoB_Seg EQU 0A000h; Okrelenie segmentu buforu Video
;------------------ Segment danych ---------------------------
segment sdat use16
yg dw 100
xk dw 50
kol db 0Dh
;--------------- Koniec segmentu danych ***
;----------------- Segment stosu -----------------------------
segment stk use16
db 256 dup (?)
;----------------- Koniec segmentu stosu
;----------------- Segment programu -------------------------
segment codseg use16
main: push ds
push bx
mov bx,sdat
mov ds,bx
; Wywoanie funkcji BIOS'u w celu zmiany trybu pracy monitora na graficzny
mov ah,0
mov al,10h; Tryb 640 X 350 ilo kolorw 16
int 10h
petla:
call AA
inc ax
loop petla
pop bx
pop ds
mov ah,1
int 21h
mov ax,0003h
int 10h
mov ah,1
int 21h
mov ax,4c00h
int 21h
ret
AA:
push bp ; Zachowanie wartoci rejestru BP na stosie
; określenie wsprzdnych pixel'a i obliczenie jego adresu
mov ax,[yg]; okrelenie wsprzdnej Y pixel'a (w dół)
mov bx,[xk]; okrelenie wsplrzdnej X pixel'a (w bok)
mov cl,bl ; mniej znaczcy bajt wsprzdnej X do BX
push dx
mov dx,80; wprowadznie do DX iloci blokw pixel'i w jednej linii
mul dx; (dx,ax)<-dx*ax
;przesunicie o AX 1-go bloku potrzebnej linii o wsprzdnej Y
pop dx
shr bx,1;
shr bx,1;
shr bx,1; przesunicie BX o trzy pozycje w prawo
add bx,ax; w BX znajduje si przesunicie bloku,
; który zawiera potrzebny pixel
mov ax,VideoB_Seg; adowanie do AX adresu segmentu buforu Video
mov es,ax; rejestr ES bdzie zawiera adres segmentu buforu Video
and cl,7 ; wyodrbnienie numeru pixel'a w bloku
xor cl,7 ; inwersja bitu
mov ah,1 ; przygotowanie maski bitu
shl ah,cl; przesunicie maski na odpowiedni pozycj
; mov ah,0FFh
; obsuga rejestrw kontrolera graficznego
mov dx,3CEh; zadanie adresu portu kontrolera graficznego
mov al,8 ; okrelenie numeru rejestru bitowej maski
out dx,ax ; zmiana rejestru maski bitowej
mov ax,0005h;
out dx,ax ; zadanie wartoci rejestru trybu
mov ah,0 ;
mov al,3 ;
out dx,ax ; zadanie wartoci rejestru cyklicznego przesunicia
;mov ax,0D00h;
mov al,00h
mov ah,[kol] ;kolor
out dx,ax ; zadanie wartoci rejestru ustawi/resetowa
mov ax,0F01h;
out dx,ax ; zadanie wartoci rejestru ustawi/resetowa
; zmiana wartoci pixel'a
mov cx,51
or [es:bx],al;
pop bp
ret | 27 | 74 | 0.683224 |
ccd49ae34c5c8484b44591b6cf147595f9ca2a0b | 3,503 | asm | Assembly | 7/pwmled_asm.asm | ayandeephazra/Embedded-Systems-Projects | 449d4c99948b8b56b99f10ecdf950179f94edb63 | [
"MIT"
] | 1 | 2021-08-04T19:11:08.000Z | 2021-08-04T19:11:08.000Z | 7/pwmled_asm.asm | ayandeephazra/Embedded-Systems-Projects | 449d4c99948b8b56b99f10ecdf950179f94edb63 | [
"MIT"
] | null | null | null | 7/pwmled_asm.asm | ayandeephazra/Embedded-Systems-Projects | 449d4c99948b8b56b99f10ecdf950179f94edb63 | [
"MIT"
] | null | null | null | ; pwmled.asm: Starter code, assembly PWM-LED functions
; Lab 7, ECE 266, Spring 2021
; Created by Zhao Zhang
; Include C header files
.cdecls "stdint.h","stdbool.h","inc/hw_memmap.h","driverlib/sysctl.h","driverlib/gpio.h","driverlib/pin_map.h","driverlib/timer.h","pwmled.h"
.text
; Field and any other declarations
TIMER0 .field TIMER0_BASE
TIMER1 .field TIMER1_BASE
PORT .field GPIO_PORTF_BASE
PIN_ROUTE_1 .field GPIO_PF1_T0CCP1
PIN_ROUTE_2 .field GPIO_PF2_T1CCP0
PIN_ROUTE_3 .field GPIO_PF3_T1CCP1
;
; void ledPwmSet(int pulsePeriod, int pulseWidthRed, int pulseWidthGreen, int pulseWidthBlue)
;
; Set color of the on-board LED by setting the intensity of the primary colors
;
.asmfunc
ledPwmSet PUSH {lr, r3, r2, r1, r0} ; Save r1-r3 and lr
; Set the period and duty cycle length for the read sub-LED
; call TimerLoadSet(TIMER0, TIMER_B, pulsePeriod)
; call TimerMatchSet(TIMER0, TIMER_B, pulsePeriodRed)
; Note that r0, r1, r2 each holds a pwm_t type, with
LDR r0, TIMER0 ; r0 = TIMER0
MOV r1, #TIMER_B ; r1 = TIMER_B
LDR r2, [sp, #0] ; r2 = pulsePeriod (pushed r0 in stack)
BL TimerLoadSet ; call TimerLoadSet
LDR r0, TIMER0 ; r0 = TIMER0
MOV r1, #TIMER_B ; r1 = TIMER_B
LDR r2, [sp, #4] ; r2 = pulseWidthRed (pushed r1 in stack)
BL TimerMatchSet
; Set the period and duty cycle length for the read sub-LED
; call TimerLoadSet(TIMER1, TIMER_A, pulsePeriod)
; call TimerMatchSet(TIMER1, TIMER_A, pulsePeriodBlue)
LDR r0, TIMER1 ; r0 = TIMER1
MOV r1, #TIMER_A ; r1 = TIMER_A
LDR r2, [sp, #0] ; r2 = pulsePeriod (pushed r0 in stack)
BL TimerLoadSet ; call TimerLoadSet
LDR r0, TIMER0 ; r0 = TIMER0
MOV r1, #TIMER_A ; r1 = TIMER_A
LDR r2, [sp, #8] ; r2 = pulseWidthRed (pushed r2 in stack)
BL TimerMatchSet ; call TimerMatchSet
; Set the period and duty cycle length for the read sub-LED
; call TimerLoadSet(TIMER1, TIMER_B, pulsePeriod)
; call TimerMatchSet(TIMER1, TIMER_B, pulsePeriodGreen)
LDR r0, TIMER1 ; r0 = TIMER1
MOV r1, #TIMER_B ; r1 = TIMER_B
LDR r2, [sp, #0] ; r2 = pulsePeriod (pushed r0 in stack)
BL TimerLoadSet ; call TimerLoadSet
LDR r0, TIMER1 ; r0 = TIMER1
MOV r1, #TIMER_B ; r1 = TIMER_B
LDR r2, [sp, #12] ; r2 = pulseWidthGreen (pushed r3 in stack)
BL TimerMatchSet ; call TimerMatchSet
ADD sp, #16 ; release the stack space for r3, r2, r1, r0
POP {pc}
.endasmfunc
| 50.042857 | 157 | 0.484156 |
fc63503c96a0af05d32cadc8f546cad5dd1c5d09 | 1,310 | asm | Assembly | src/Ninu.Emulator.Tests/Cpu/TestFiles/stores.6502.asm | jorgy343/Ninu | e0fb8b4edeb15eee2199bfb9a8e64bb838d9114c | [
"MIT"
] | null | null | null | src/Ninu.Emulator.Tests/Cpu/TestFiles/stores.6502.asm | jorgy343/Ninu | e0fb8b4edeb15eee2199bfb9a8e64bb838d9114c | [
"MIT"
] | null | null | null | src/Ninu.Emulator.Tests/Cpu/TestFiles/stores.6502.asm | jorgy343/Ninu | e0fb8b4edeb15eee2199bfb9a8e64bb838d9114c | [
"MIT"
] | null | null | null | .include "..\..\..\Cpu\TestFiles\std.6502.asm"
; These tests do not currently purposefully test flags. All tests that have offset addressing modes
; are designed to wrap around to a new page to test buggy wrapping behavior where applicable.
* = $0000
.byte $00 ; Tell the assembler to start assembling at $0000.
; sta indirect zero page with x offset - test 1
* = $72
.addr $2345
; sta indirect zero page with y offset
* = $d0
.addr $44ff
; sta indirect zero page with x offset - test 2
* = $ff
.addr $3456
; Start program at 0x1000 so we can freely store data in zero page.
* = $1000
.init
; Data setup.
lda #$a1
ldx #$a2
ldy #$a3
; sta
sta $d0 ; zero page
sta $d0,x ; zero page with x offset
sta $a0d0 ; absolute
sta $a0d0,x ; absolute with x offset
sta $a0d0,y ; absolute with y offset
sta ($d0,x) ; indirect zero page with x offset - test 1
sta ($5d,x) ; indirect zero page with x offset - test 2
sta ($d0),y ; indirect zero page with y offset
; stx
stx $b0 ; zero page
stx $b0,y ; zero page with x offset
stx $b0e0 ; absolute
; sty
sty $c0 ; zero page
sty $c0,x ; zero page with x offset
sty $c0f0 ; absolute
.done
* = $fff0
rti
* = $fffa
nmiVector .addr $fff0
resetVector .addr $1000
irqVector .addr $fff0 | 22.586207 | 100 | 0.647328 |
52b851d478d1679b2f48d70fbe908a1a444f9882 | 188 | asm | Assembly | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_getMDKeysHeld.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_getMDKeysHeld.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_getMDKeysHeld.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned int SMS_getMDKeysHeld(void)
SECTION code_clib
SECTION code_SMSlib
PUBLIC SMS_getMDKeysHeld
EXTERN asm_SMSlib_getMDKeysHeld
defc SMS_getMDKeysHeld = asm_SMSlib_getMDKeysHeld
| 17.090909 | 49 | 0.87234 |
fe416bb5f9556654f3938a676be50375311191bc | 610 | asm | Assembly | src/core/interrupts.asm | jonasbantunes/tictactoe-gb | 21838bf92219a923cc1c1be8bc078b8adeab144a | [
"MIT"
] | null | null | null | src/core/interrupts.asm | jonasbantunes/tictactoe-gb | 21838bf92219a923cc1c1be8bc078b8adeab144a | [
"MIT"
] | null | null | null | src/core/interrupts.asm | jonasbantunes/tictactoe-gb | 21838bf92219a923cc1c1be8bc078b8adeab144a | [
"MIT"
] | null | null | null | SERIAL_TYPE EQU $0
SECTION "Interruptions", ROM0
SerialInt:
ld a, [rSC]
.if
bit SERIAL_TYPE, a
jp z, .else ; branch if external clock
.then
ld a, 0
ld [serial_turn], a
call ListenData
jp .end
.else
ld a, [rSB]
ld [serial_data], a
ld a, 1
ld [serial_turn], a
.end
ret
VblankInt:
call loadJoypad
ret
TimerInt:
ld a, [counter]
inc a
.if
cp a, $3
jp c, .else
.then
call TurnOffLCD
call ToggleCursor
; call ToggleMarks
call TurnOnLCD
ld a, 0
ld [counter], a
jp .end
.else
ld [counter], a
.end
ret | 13.26087 | 43 | 0.57377 |
3e02781d592ecfb9b30fae20a8f8a9217d2bdd91 | 965 | asm | Assembly | _build/dispatcher/jmp_ippsGFpECGet_d4b9843c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsGFpECGet_d4b9843c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsGFpECGet_d4b9843c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsGFpECGet:function
extern n8_ippsGFpECGet:function
extern y8_ippsGFpECGet:function
extern e9_ippsGFpECGet:function
extern l9_ippsGFpECGet:function
extern n0_ippsGFpECGet:function
extern k0_ippsGFpECGet:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECGet
.Larraddr_ippsGFpECGet:
dq m7_ippsGFpECGet
dq n8_ippsGFpECGet
dq y8_ippsGFpECGet
dq e9_ippsGFpECGet
dq l9_ippsGFpECGet
dq n0_ippsGFpECGet
dq k0_ippsGFpECGet
segment .text
global ippsGFpECGet:function (ippsGFpECGet.LEndippsGFpECGet - ippsGFpECGet)
.Lin_ippsGFpECGet:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECGet:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECGet]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECGet:
| 24.74359 | 75 | 0.772021 |
56175afd861fc443e7a565180129f830695520a8 | 2,037 | asm | Assembly | source/features/upc.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | source/features/upc.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | source/features/upc.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | ; ==================================================================
; MichalOS User Privilege Control
; ==================================================================
UPC:
pusha
cmp byte [0082h], 1
je .cli_upc
mov ax, .uac_name
mov bx, .blank_string
mov cx, 256
call os_draw_background
cmp byte [57002], 0
je .no_password
.password:
mov ax, .buffer
mov bx, .msg_pass
mov byte [0088h], 32
call os_password_dialog
mov byte [0088h], 255
mov si, .buffer
call os_string_encrypt
mov si, .buffer
mov di, 57003
call os_string_compare
jc .success
jnc .fail
.no_password:
xor ax, ax
mov bx, 9999
call os_get_random
mov ax, cx
call os_int_to_string
mov si, ax
mov di, .randomcode
call os_string_copy
mov ax, .buffer
mov bx, .msg_nopass
mov byte [0088h], 4
call os_password_dialog
mov byte [0088h], 255
mov si, .buffer
mov di, .randomcode
call os_string_compare
jc .success
.fail:
popa
stc
ret
.success:
popa
clc
ret
.cli_upc:
call os_print_newline
mov si, .uac_name
call os_print_string
call os_print_newline
cmp byte [57002], 0
je .cli_no_password
.cli_password:
mov si, .msg_pass
call os_print_string
call os_print_newline
mov ax, .buffer
mov bl, 7
call os_input_password
call os_print_newline
call os_print_newline
mov si, .buffer
mov di, 57003
call os_string_compare
jc .success
jnc .fail
.cli_no_password:
xor ax, ax
mov bx, 9999
call os_get_random
mov ax, cx
call os_int_to_string
mov si, ax
mov di, .randomcode
call os_string_copy
mov si, .msg_nopass
call os_print_string
call os_print_newline
mov ax, .buffer
mov bl, 7
call os_input_password
call os_print_newline
call os_print_newline
mov si, .buffer
mov di, .randomcode
call os_string_compare
jc .success
jnc .fail
.uac_name db 'InpyoOS Application Privileger', 0
.blank_string db 0
.msg_nopass db 'Enter the following code: '
.randomcode times 8 db 0
.msg_pass db 'Enter your password to continue: ', 0
.buffer equ 65500
| 14.76087 | 68 | 0.671576 |
792399a08be05661e8af0d4076322462cf796dcf | 3,550 | asm | Assembly | Library/Text/Text/textManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Text/Text/textManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Text/Text/textManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Text
FILE: textManager.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 12-Jun-89 Initial version
DESCRIPTION:
$Id: textManager.asm,v 1.2 98/03/24 23:00:58 gene Exp $
------------------------------------------------------------------------------@
;-----------------------------------------------------------------------------
; Include common definitions
;-----------------------------------------------------------------------------
include textGeode.def
include texttext.def
include textattr.def
include textgr.def
include texttrans.def
include textpen.def
include textssp.def
include textline.def
include textstorage.def
include textregion.def
include textselect.def
include textundo.def
include hwr.def
include Internal/im.def
include Internal/heapInt.def
include Internal/semInt.def
ifdef USE_FEP
include Internal/fepDr.def
include driver.def
endif
include system.def
UseLib spell.def
;-----------------------------------------------------------------------------
; Include definitions for this module
;-----------------------------------------------------------------------------
include tConstant.def
include tVariable.def
;-----------------------------------------------------------------------------
; Include code
;-----------------------------------------------------------------------------
; Resources:
; Text - core calculation and display
; TextInstance - initilization, relocation, setting instance data,
; open/close stuff, obscure methods
; TextAttributes - charAttr and paraAttr related
; TextGraphic - graphics hanndling
; TextBorder - border, background color, tab line related
; TextSearchSpell - search & replace and spell check code
;-----------------------------------------------------------------------------
; Entry Point routines
include textEntry.asm
ifdef USE_FEP
include textFep.asm
endif ; USE_FEP
;==============
; Utility routines
include textUtils.asm
; Core calculation and display code; resource(s): Text, TextInstance
; (init code in TextInstance)
include textCalc.asm
include textCalcObject.asm
include textReplace.asm
;-----------------------------------------------------------------------------
; Selection Code
;-----------------------------------------------------------------------------
include textGState.asm
include textOutput.asm
include textScroll.asm
include textScrollOneLine.asm
include textStuff.asm
include textMethodDraw.asm
;
; Hopefully everything in textMethodManip.asm will migrate to other files and
; we can remove it entirely.
;
include textMethodManip.asm
include textCompatibility.asm
include textMethodSet.asm
include textMethodGet.asm
include textMethodClipboard.asm
include textOptimizedUpdate.asm
include textMethodInput.asm
include textFilter.asm
;==============
; Instance data related code; resource(s): TextInstance
include textInstance.asm
include textMethodGeometry.asm
include textMethodInstance.asm ;except ~20 bytes in Text
;==============
; Border, background color, tab line related code; resource(s): TextBorder
include textBGBorder.asm
;==============
; Suspend/unsuspend; resource(s): TextAttributes
include textSuspend.asm
include textC.asm
| 24.482759 | 80 | 0.550986 |
aa88dd0dabcf7129f032b9eabfb99091aa76385f | 452 | asm | Assembly | programs/oeis/183/A183569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/183/A183569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/183/A183569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A183569: n+floor(sqrt(4n-3)), complement of A024206.
; 2,4,6,7,9,10,12,13,14,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,34,36,37,38,39,40,42,43,44,45,46,47,49,50,51,52,53,54,56,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,116,117,118,119
mov $1,$0
mul $1,2
seq $1,103128 ; a(n) = floor(sqrt(2n-1)).
add $0,$1
add $0,1
| 50.222222 | 315 | 0.65708 |
c2d9b28bd3498fb2ef3cfb7180f8490c40d6abbe | 1,649 | asm | Assembly | books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/9_18.asm | gxw1/review_the_national_post-graduate_entrance_examination | 8812779a7a4ce185a531d120562d5194b697c0c9 | [
"MIT"
] | 640 | 2019-03-30T11:32:43.000Z | 2022-03-31T14:05:18.000Z | books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/9_18.asm | yyzVegst/review_the_national_post-graduate_entrance_examination | 8812779a7a4ce185a531d120562d5194b697c0c9 | [
"MIT"
] | 6 | 2019-07-22T01:57:24.000Z | 2022-01-20T15:03:16.000Z | books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/9_18.asm | yyzVegst/review_the_national_post-graduate_entrance_examination | 8812779a7a4ce185a531d120562d5194b697c0c9 | [
"MIT"
] | 212 | 2019-04-10T02:31:50.000Z | 2022-03-30T02:32:47.000Z | FRAME STRUC
SAVEBP DW ?
SAVECSIP DW 2 DUP(?)
N DW ?
M DW ?
READDR DW ?
FRAME ENDS
DATA SEGMENT
MM DW 10
NN DW 100
RESULT DW ?
DATA ENDS
STACK SEGMENT STACK
DW 100 DUP(?)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,SS:STACK,DS:DATA
START: MOV AX,DATA
MOV DS,AX
LEA SI,RESULT
PUSH SI
MOV AX,MM
PUSH AX
MOV BX,NN
PUSH BX
CALL FAR PTR ACK
MOV AH,4CH
INT 21H
ACK PROC FAR
PUSH BP
MOV BP,SP
MOV SI,[BP].READDR
MOV AX,[BP].M
MOV BX,[BP].N
CMP AX,0
JA TESTN
INC BX
MOV [SI],BX
JMP EXIT2
TESTN: CMP BX,0
JA A1
DEC AX
MOV BX,1
PUSH SI
PUSH AX
PUSH BX
CALL ACK
JMP EXIT2
A1: PUSH SI
PUSH AX
DEC BX
PUSH BX
CALL ACK
PUSH SI
MOV AX,[BP].M
DEC AX
PUSH AX
MOV DX,[SI]
PUSH DX
CALL ACK
EXIT2: POP BP
RET 6
ACK ENDP
CODE ENDS
END START
| 23.557143 | 44 | 0.311704 |
f959d7c5674eaf56a198199658fed6c0af838c90 | 537 | asm | Assembly | oeis/074/A074110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/074/A074110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/074/A074110.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A074110: Largest n-digit squarefree number.
; Submitted by Jon Maiga
; 7,97,998,9998,99998,999997,9999998,99999998,999999998,9999999998,99999999998,999999999998,9999999999998,99999999999998,999999999999998,9999999999999998,99999999999999998,999999999999999998
mov $1,1
mov $2,1
mov $3,$0
add $0,1
mul $3,5
sub $3,1
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
cmp $4,0
mov $5,$0
add $5,$4
div $1,$5
div $2,$5
mov $3,4
lpe
mul $1,2
div $1,$2
mov $6,10
pow $6,$0
add $1,$6
mov $0,$1
sub $0,5
| 16.78125 | 190 | 0.668529 |
e60ab5fd7cb4972b40071a0a005bb0eb4e9b87b2 | 1,606 | asm | Assembly | programs/oeis/138/A138412.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/138/A138412.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/138/A138412.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A138412: a(n) = p^5*(p-1) where p =prime(n).
; 32,486,12500,100842,1610510,4455516,22717712,44569782,141599546,574312172,858874530,2496382452,4634248040,6174354606,10549870322,21746165636,41465609342,50675778060,89108257062,126296054570,149261154696,240010399122,323001332726,491397231512,824384664672,1051010050100,1182459555786,1486704834542,1661713871292,2063527400816,4162834545282,5015333654630,6563594526152,7160660568462,10869086810852,11775408862650,14880682838892,18640305960966,21562069610762,26653789439996,32710347448022,34967564082180,48297031370690,51414755365056,58155019028372,61791760997802,87827712430710,122427023170146,136219011718982,143586053409972,159319006683176,185595081117362,195117604128240,249062656562750,287015652622592,329670459756266,377481953629532,394648283794770,450098874943332,490557173512280,511895469583326,630552066330356,834474949401942,901910906990810,937294959991416,1011540774828812,1311154617514830,1460457023913552,1740698170011422,1801799154308652,1929372972381536,2134790539556042,2436752423418162,2685883052710596,2955887151045822,3148163162058626,3456047734128212,3905239916855772,4147456640800400,4669567989067992,5398168002565382,5554689271362420,6395209946594930,6575415916633776,7141619567715162,7541207668215806,8175413333807552,9089622417289992,9577727104018460,9829850904046866,10350714255871862,12053286057594722,13313157666166602,13983102483290990,15407496256244502,16163806486776986,17356119192466892,19961444249032520,20425793987276046,25025345689698540
seq $0,40 ; The prime numbers.
mov $1,$0
sub $0,1
pow $1,5
mul $0,$1
div $0,2
mul $0,2
| 146 | 1,470 | 0.899751 |
e6fca483bda739569bdf77ad659b5ceb188cf4dd | 1,163 | asm | Assembly | data/maps/scenes.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/maps/scenes.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/maps/scenes.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | scene_var: MACRO
; map, variable
map_id \1
dw \2
ENDM
MapScenes::
scene_var DEBUG_ROOM, wDebugRoomSceneID
scene_var POKECENTER_2F, wPokecenter2FSceneID
scene_var TRADE_CENTER, wTradeCenterSceneID
scene_var COLOSSEUM, wColosseumSceneID
scene_var TIME_CAPSULE, wTimeCapsuleSceneID
scene_var MOBILE_TRADE_ROOM, wMobileTradeRoomSceneID
scene_var MOBILE_BATTLE_ROOM, wMobileBattleRoomSceneID
scene_var PLAYERS_HOUSE_2F, wPlayersHouse2FSceneID
scene_var PLAYERS_HOUSE_1F, wPlayersHouse1FSceneID
scene_var TWINLEAF_TOWN, wTwinleafTownSceneID
scene_var RIVAL_HOUSE_2F, wRivalHouse2FSceneID
scene_var ROUTE_201, wRoute201SceneID
scene_var LAKE_VERITY_LOW, wLakeVerityLowSceneID
scene_var SANDGEM_TOWN, wSandgemTownSceneID
scene_var ROWANS_LAB, wRowansLabSceneID
scene_var ROUTE_202, wRoute202SceneID
scene_var JUBILIFE_CITY, wJubilifeCitySceneID
scene_var ROUTE_203, wRoute203SceneID
scene_var OREBURGH_GATE_1F, wOreburghGate1FSceneID
scene_var OREBURGH_GYM, wOreburghGymSceneID
scene_var OREBURGH_CITY, wOreburghCitySceneID
db -1 ; end
| 38.766667 | 55 | 0.791058 |
3bd15cf746afb5479dde96798a5af47b89a223a2 | 551 | asm | Assembly | oeis/016/A016927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/016/A016927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/016/A016927.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A016927: a(n) = (6*n + 1)^7.
; 1,823543,62748517,893871739,6103515625,27512614111,94931877133,271818611107,678223072849,1522435234375,3142742836021,6060711605323,11047398519097,19203908986159,32057708828125,51676101935731,80798284478113,122987386542487,182803912081669,266001988046875,379749833583241,532875860165503,736141813551277,1002544368429379,1347646586640625,1789940649848551,2351243277537493,3057125241215467,3937376385699289,5026507568359375,6364290927201661,7996339888664083,9974730326005057,12358664279161399
mul $0,6
add $0,1
pow $0,7
| 78.714286 | 491 | 0.878403 |
d622ebb8a152606b5be1904a30e9fcbf1286ff52 | 861 | asm | Assembly | boot/16bit-disk.asm | Soptq/sim-osv2 | 09641c9844d3bbc06c851996fab0569e4698083a | [
"MIT"
] | null | null | null | boot/16bit-disk.asm | Soptq/sim-osv2 | 09641c9844d3bbc06c851996fab0569e4698083a | [
"MIT"
] | null | null | null | boot/16bit-disk.asm | Soptq/sim-osv2 | 09641c9844d3bbc06c851996fab0569e4698083a | [
"MIT"
] | null | null | null | ; read dh sectors from drive dl into es:bx
disk_load:
pusha
push dx ; save parameters
mov ah, 0x02 ; read
mov al, dh ; read dh sectors
mov cl, 0x02 ; read / start from the second sector
mov ch, 0x00 ; read 0x00 cylinder
mov dh, 0x00 ; head number
int 0x13 ; interrupt to start reading
jc disk_error ; if carry == 1, error occurred
pop dx
cmp al, dh ; check if we read dh sectors
jne sectors_error
popa
ret
disk_error:
mov bx, DISK_ERROR
call print
call print_nl
mov dh, ah ; ah = error code, dl = disk drive that dropped the error
call print_hex
jmp disk_loop
sectors_error:
mov bx, SECTORS_ERROR
call print
disk_loop:
jmp $
DISK_ERROR: db "Disk read error", 0
SECTORS_ERROR: db "Incorrect number of sectors read", 0 | 22.076923 | 77 | 0.628339 |
76d5500b3a0fa83c6f2d4aa30a59947853f2269f | 390 | asm | Assembly | programs/oeis/182/A182460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/182/A182460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/182/A182460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A182460: a(n) = (3/5)*2^(4n+1) - (1/5).
; 1,19,307,4915,78643,1258291,20132659,322122547,5153960755,82463372083,1319413953331,21110623253299,337769972052787,5404319552844595,86469112845513523,1383505805528216371,22136092888451461939,354177486215223391027,5666839779443574256435,90669436471097188102963,1450710983537555009647411
mov $1,16
pow $1,$0
div $1,15
mul $1,18
add $1,1
mov $0,$1
| 39 | 287 | 0.807692 |
0e49c0b1ffd4f4965b1a173f0561a22140d70f7c | 455 | asm | Assembly | programs/oeis/047/A047454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/047/A047454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/047/A047454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A047454: Numbers that are congruent to {1, 2, 3, 4} mod 8.
; 1,2,3,4,9,10,11,12,17,18,19,20,25,26,27,28,33,34,35,36,41,42,43,44,49,50,51,52,57,58,59,60,65,66,67,68,73,74,75,76,81,82,83,84,89,90,91,92,97,98,99,100,105,106,107,108,113,114,115,116,121,122,123,124,129,130,131,132,137,138,139,140,145,146,147,148,153,154,155,156,161,162,163,164,169,170,171,172,177,178,179,180,185,186,187,188,193,194,195,196
mov $1,$0
div $1,4
mul $1,4
add $0,$1
add $0,1
| 50.555556 | 345 | 0.679121 |
e5b46ef8532508253aa251d563d241465959b62c | 430 | asm | Assembly | programs/oeis/118/A118609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/118/A118609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/118/A118609.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A118609: Start with 1 and repeatedly reverse the digits and add 23 to get the next term.
; 1,24,65,79,120,44,67,99,122,244,465,587,808,831,161,184,504,428,847,771,200,25,75,80,31,36,86,91,42,47,97,102,224,445,567,788,910,42,47,97,102,224,445,567,788,910,42,47,97,102,224,445,567,788,910,42,47,97,102
mov $2,$0
mov $0,1
lpb $2
seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences).
add $0,23
sub $2,1
lpe
| 39.090909 | 210 | 0.695349 |
0588718c3a1d25fe27f51485f8846cbf8ce58423 | 29,162 | asm | Assembly | snake.6502.asm | cyborgx37/nesnake | 9ff0a94f7801057a834a07e3effd397d6304e356 | [
"MIT"
] | 1 | 2021-11-03T16:27:15.000Z | 2021-11-03T16:27:15.000Z | snake.6502.asm | cyborgx37/nesnake | 9ff0a94f7801057a834a07e3effd397d6304e356 | [
"MIT"
] | null | null | null | snake.6502.asm | cyborgx37/nesnake | 9ff0a94f7801057a834a07e3effd397d6304e356 | [
"MIT"
] | null | null | null | .inesprg 1 ; 1x 16KB PRG code
.ineschr 1 ; 1x 8KB CHR data
.inesmap 0 ; mapper 0 = NROM, no bank swapping
.inesmir 1 ; background mirroring
.bank 0
.org $C000
; **********************************************************************************************************************
; * NESNAKE
; *
; * Classic Snake game, built from scratch for the NES
; *
; * Significant inspiration drawn from the "Nerdy Nights" series of tutorials:
; * http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4147
; *
; * Author: JD Bell
; * Created: Feb 24, 2019
; **********************************************************************************************************************
; * Game Constants:
const_GAME_SPEED EQU 15 ; The frames per movement. 60 is approximately 1 second.
const_GAME_HEIGHT EQU $E8 ; Screen height / 8 (+1)
const_GAME_WIDTH EQU $F8 ; Screen width / 8 (+1)
; **********************************************************************************************************************
; * Special Memory Locations:
; * $00 - Frame Counter / Collision Flag - The frame counter is reset to 0 whenever the snake moves, so we can reuse
; this memory for calculating coliision types
ptr_FRAME_COUNTER EQU $00
ptr_COLLISION_FLAG EQU $00
; * $01 - Snake Tail Pointer - An offset representing the first byte of the snake's tail tile. For a snake that is 3
; * tiles long, the offset would be 2 tiles * 4 bytes per tile = 8
ptr_SNAKE_TAIL EQU $01
; * $02 - Current Snake Direction - A value indicating the snake's current direction:
; * #01 - Up #03 - Left
; * #02 - Down #04 - Right
ptr_SNAKE_DIR_CUR EQU $02
; * $03 - Next Snake Direction - A value indicating the snake's next direction:
; * #01 - Up #03 - Left
; * #02 - Down #04 - Right
ptr_SNAKE_DIR_NXT EQU $03
; * $04-$07 - Temporary Snake Segment Data (TSSD)
; * $04 - X $06 - Tile Index
; * $05 - Y $07 - Tile Attrs
ptr_SNAKE_TSSD_X EQU $04
ptr_SNAKE_TSSD_Y EQU $05
ptr_SNAKE_TSSD_TILE EQU $06
ptr_SNAKE_TSSD_ATTR EQU $07
; * $08 - Game Flags - Various game flags to communicate critical changes in state
; Flag Reference:
; 7 6 5 4 3 2 1 0
; |
; +-------- Grow Bit - If 1, the snake should grow by one segment
ptr_GAME_FLAGS EQU $08
flag_GROW EQU %00000100
; * $09 - Random Number - To keep predictability low, this number is re-generated in the forever loop rather than the
; interrupt. Call GenNextRandom to force it forward
ptr_RAND EQU $09
; * $0A - Score - Basically a count of the number of apples the player has eaten
ptr_SCORE EQU $0A
; * $0200-$0203 - Apple Sprite
; * $0200 - Apple Y
ptr_APPLE_Y EQU $0200
; * $0203 - Apple X
ptr_APPLE_X EQU $0203
; * $0204-$0207 - Snake Head Sprite
; * $0204 - Snake Head Y
ptr_SNAKE_HEAD_Y EQU $0204
; * $0207 - Snake Head X
ptr_SNAKE_HEAD_X EQU $0207
; * $02F8-$02FF - Score Sprites
; * $02F9 - Score Sprite 1 Tile Index
ptr_SCORE1_TILE EQU $02F9
; * $02FD - Score Sprite 2 Tile Index
ptr_SCORE2_TILE EQU $02FD
; * $4016 - Controller Buttons State - Each read will return a button state then adv to next button
ptr_BTN_STATE EQU $4016
; **********************************************************************************************************************
; * Reference:
; * Tile Attribute bits:
; * 7 6 5 43 2 10
; * | | | || ||
; * | | | || ++- Color Palette of sprite. Choose which set of 4 from the 16 colors to use
; * | | | ++------ CUSTOM: The "direction" of the tile (up = 00, down = 01, left = 10, right = 11)
; * | | +--------- Priority (0: in front of background; 1: behind background)
; * | +----------- Flip sprite horizontally
; * +------------- Flip sprite vertically
; **********************************************************************************************************************
RESET:
SEI ; disable IRQs
CLD ; disable decimal mode
LDX #$40
STX $4017 ; disable APU frame IRQ
LDX #$FF
TXS ; Set up stack
INX ; now X = 0
STX $2000 ; disable NMI
STX $2001 ; disable rendering
STX $4010 ; disable DMC IRQs
vblankwait1: ; First wait for vblank to make sure PPU is ready
BIT $2002
BPL vblankwait1
clrmem:
LDA #$00
STA $0000, X
STA $0100, X
STA $0300, X
STA $0400, X
STA $0500, X
STA $0600, X
STA $0700, X
LDA #$FE
STA $0200, X ; move all sprites off screen
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
LoadPalettes:
LDA $2002 ; read PPU status to reset the high/low latch
LDA #$3F
STA $2006 ; write the high byte of $3F00 address
LDA #00
STA $2006 ; write the low byte of $3F00 address
LDX #00
LoadPalettesLoop:
LDA palette, X ; load palette byte
STA $2007 ; write to PPU
INX ; set index to next byte
CPX #$20
BNE LoadPalettesLoop ; if x = $20, 32 bytes copied, all done
LDX #00
LoadSpritesLoop:
LDA sprites, X ; load the next byte of sprite data
STA ptr_APPLE_Y, X ; store the sprite data
INX
CPX #$10
BNE LoadSpritesLoop ; if x = $10, 16 bytes copied, all done
LDA #%10000000 ; enable NMI, sprites from Pattern Table 0
STA $2000
LDA #%00010000 ; enable sprites
STA $2001
InitGame:
LDA #00 ; Reset the frame counter to 0
STA ptr_FRAME_COUNTER
LDA #08 ; The snake starts out at 3 tiles long, so the offset of the tail's first byte is 8
STA ptr_SNAKE_TAIL
LDA #$01
STA ptr_SNAKE_DIR_CUR ; Set the default direction to Up
STA ptr_SNAKE_DIR_NXT ; Set the default direction to Up
LDA #00
STA ptr_GAME_FLAGS ; Set the grow flag to 0
LDA #$E0
STA $02F8 ; Score Sprite 1 Y
STA $02FC ; Score Sprite 2 Y
LDA #$40
STA $02F9 ; Score Sprite 1 Tile Index
STA $02FD ; Score Sprite 2 Tile Index
LDA #$00
STA $02FA ; Score Sprite 1 Tile Attributes
STA $02FE ; Score Sprite 2 Tile Attributes
LDA #$E8
STA $02FB ; Score Sprite 1 X
LDA #$F0
STA $02FF ; Score Sprite 2 X
Forever:
JSR GenNextRandom
JMP Forever ; jump back to Forever, infinite loop
; ----------------------------------------------------------------------------------------------------------------------
; GENERATE NEXT RANDOM
; Generates the next random number and stores it in ptr_RAND
GenNextRandom:
LDA ptr_RAND
ASL A
ASL A
CLC
ADC ptr_RAND
CLC
ADC #03
STA ptr_RAND
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; NMI
; An interrupt that occurs once every screen paint
NMI:
LDA #00
STA $2003 ; set the low byte (00) of the RAM address
LDA #02
STA $4014 ; set the high byte (02) of the RAM address, start the transfer
JSR ReadController ; Read the controller buttons and set the snake direction
LDX ptr_FRAME_COUNTER ; Get the frame counter
CPX #const_GAME_SPEED ; Have enough frames gone by yet?
BNE TickNextFrame ; If not, skip to the next frame
JSR MoveSnake ; If yes, move the snake
LDX #00 ; Then reset the counter to 0
STX ptr_FRAME_COUNTER
TickNextFrame:
; Tick the frame counter
INC ptr_FRAME_COUNTER ; Increment the frame counter
RTI ; return from interrupt
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; READ CONTROLLER
; Read which buttons are currently being pressed and set the snake direction accordingly
ReadController:
LDA #$01 ; Set $4016 (ptr_BTN_STATE) to 01 and then 00 to latch the controller buttons
STA ptr_BTN_STATE
LDA #$00
STA ptr_BTN_STATE ; Finish latching the controller buttons
LDA ptr_BTN_STATE ; We have to burn a few loads to get to the buttons we want: A
LDA ptr_BTN_STATE ; B
LDA ptr_BTN_STATE ; Select
LDA ptr_BTN_STATE ; Start
LDA ptr_BTN_STATE ; Up
AND #%00000001 ; Clear all but the 0 bit
BEQ ReadUpDone ; If the user is not pressing up, then continue to the next button
LDY ptr_SNAKE_DIR_CUR ; Read the current snake direction
CPY #02 ; If the current snake direction is Down, then Up is invalid - ignore and continue
BEQ ReadUpDone
LDY #01 ; Set the snake direction to Up
STY ptr_SNAKE_DIR_NXT
ReadUpDone:
LDA ptr_BTN_STATE ; Down
AND #%00000001 ; Clear all but the 0 bit
BEQ ReadDownDone ; If the user is not pressing down, then continue to the next button
LDY ptr_SNAKE_DIR_CUR ; Read the current snake direction
CPY #01 ; If the current snake direction is Up, then Down is invalid - ignore and continue
BEQ ReadDownDone
LDY #02 ; Set the snake direction to Down
STY ptr_SNAKE_DIR_NXT
ReadDownDone:
LDA ptr_BTN_STATE ; Left
AND #%00000001 ; Clear all but the 0 bit
BEQ ReadLeftDone ; If the user is not pressing left, then continue to the next button
LDY ptr_SNAKE_DIR_CUR ; Read the current snake direction
CPY #04 ; If the current snake direction is Right, then Left is invalid - ignore and continue
BEQ ReadLeftDone
LDY #03 ; Set the snake direction to Left
STY ptr_SNAKE_DIR_NXT
ReadLeftDone:
LDA ptr_BTN_STATE ; Right
AND #%00000001 ; Clear all but the 0 bit
BEQ ReadRightDone ; If the user is not pressing right, then continue to the next button
LDY ptr_SNAKE_DIR_CUR ; Read the current snake direction
CPY #03 ; If the current snake direction is Left, then Right is invalid - ignore and continue
BEQ ReadRightDone
LDY #04 ; Set the snake direction to Right
STY ptr_SNAKE_DIR_NXT
ReadRightDone:
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; MOVE SNAKE
; Begin by calculating the head's new position, then shuffle the head into that position, then the second segment into
; the head's former position, then the third segment into the second's former position, etc.
MoveSnake:
ReadNextSnakeDirection:
LDY ptr_SNAKE_DIR_NXT ; Get the next direction to move the snake
CPY #01 ; 1 = Up
BEQ MoveSnakeUp
CPY #02 ; 2 = Down
BEQ MoveSnakeDown
CPY #03 ; 3 = Left
BEQ MoveSnakeLeft
; Anything else = Right (4 is assumed)
MoveSnakeRight:
LDA ptr_SNAKE_HEAD_X ; Copy the Snake's current X Position into TSSD,
CLC
ADC #08 ; Adding 8 Pixels
STA ptr_SNAKE_TSSD_X
LDA ptr_SNAKE_HEAD_Y ; Copy the Snake's current Y Position into TSSD
STA ptr_SNAKE_TSSD_Y
LDA #$11 ; Use the Left-Right Snake Head
STA ptr_SNAKE_TSSD_TILE
LDA #%01000000 ; Turn the head rightward
STA ptr_SNAKE_TSSD_ATTR
JMP UpdateGameState
MoveSnakeDown:
LDA ptr_SNAKE_HEAD_X ; Copy the Snake's current X Position into TSSD
STA ptr_SNAKE_TSSD_X
LDA ptr_SNAKE_HEAD_Y ; Copy the Snake's current Y Position into TSSD,
CLC
ADC #08 ; Adding 8 Pixels
STA ptr_SNAKE_TSSD_Y
LDA #$10 ; Use the Up-Down Snake Head
STA ptr_SNAKE_TSSD_TILE
LDA #%10000000 ; Turn the head downward
STA ptr_SNAKE_TSSD_ATTR
JMP UpdateGameState
MoveSnakeUp:
LDA ptr_SNAKE_HEAD_X ; Copy the Snake's current X Position into TSSD
STA ptr_SNAKE_TSSD_X
LDA ptr_SNAKE_HEAD_Y ; Copy the Snake's current Y Position into TSSD,
SBC #08 ; Subtracting 8 Pixels
STA ptr_SNAKE_TSSD_Y
LDA #$10 ; Use the Up-Down Snake Head
STA ptr_SNAKE_TSSD_TILE
LDA #%00000000 ; Turn the head upward
STA ptr_SNAKE_TSSD_ATTR
JMP UpdateGameState
MoveSnakeLeft:
LDA ptr_SNAKE_HEAD_X ; Copy the Snake's current X Position into TSSD,
SBC #08 ; Subtracting 8 Pixels
STA ptr_SNAKE_TSSD_X
LDA ptr_SNAKE_HEAD_Y ; Copy the Snake's current Y Position into TSSD
STA ptr_SNAKE_TSSD_Y
LDA #$11 ; Use the Left-Right Snake Head
STA ptr_SNAKE_TSSD_TILE
LDA #%00000000 ; Turn the head leftward
STA ptr_SNAKE_TSSD_ATTR
UpdateGameState: ; Now that we know where the snake is about to move, we can update the game state
JSR DetectCollisions ; Check for collisions
LDA ptr_GAME_FLAGS ; Get the current Game Flags
AND #flag_GROW ; Isolate the Grow Flag
BEQ MoveSnakeInit ; If it's 0, then just continue on with shuffling the snake
PHA ; Store the grow flag value for later
LDA ptr_SNAKE_TSSD_Y ; We need to keep a copy the new head sprite while we work on updating the tail
PHA
LDA ptr_SNAKE_TSSD_TILE
PHA
LDA ptr_SNAKE_TSSD_ATTR
PHA
LDA ptr_SNAKE_TSSD_X
PHA
LDX ptr_SNAKE_TAIL ; Kick off X at the snake tail offset
LDA ptr_SNAKE_HEAD_Y, X ; Copy the tail sprite info to seed the new tail
STA ptr_SNAKE_TSSD_Y
INX
LDA ptr_SNAKE_HEAD_Y, X
STA ptr_SNAKE_TSSD_TILE
INX
LDA ptr_SNAKE_HEAD_Y, X
STA ptr_SNAKE_TSSD_ATTR
INX
LDA ptr_SNAKE_HEAD_Y, X
STA ptr_SNAKE_TSSD_X
INX
LDA ptr_SNAKE_TSSD_Y ; Seed the new tail Y
STA ptr_SNAKE_HEAD_Y, X
INX
LDA #01 ; Seed the new tail Tile
STA ptr_SNAKE_HEAD_Y, X
INX
LDA ptr_SNAKE_TSSD_ATTR ; Seed the new tail Tile Attr
STA ptr_SNAKE_HEAD_Y, X
INX
LDA ptr_SNAKE_TSSD_X ; Seed the new tail X
STA ptr_SNAKE_HEAD_Y, X
PLA ; Now we need to restore the new head sprite before we finish
STA ptr_SNAKE_TSSD_X
PLA
STA ptr_SNAKE_TSSD_ATTR
PLA
STA ptr_SNAKE_TSSD_TILE
PLA
STA ptr_SNAKE_TSSD_Y
PLA ; Retrieve the grow flag value from earlier
CLC
ADC ptr_SNAKE_TAIL ; Add the grow flag value (4) to the snake tail pointer and set tail pointer to the result
STA ptr_SNAKE_TAIL ; This is how we grow the snake's sprite array
; LDA ptr_SNAKE_TAIL
; CLC
; ADC #04 ; Increase the tail pointer offset by 4 bytes (1 new segment sprite) and store the result.
; STA ptr_SNAKE_TAIL ; This is how we grow the snake's sprite array
MoveSnakeInit:
LDX #00 ; Prime the loop counter
MoveSnakeLoop: ; Shuffle the segments
; Update the Y Position:
LDY ptr_SNAKE_HEAD_Y, X ; - Save the old Y Position
LDA ptr_SNAKE_TSSD_Y ; - Get the new Y Position
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Y Position
STY ptr_SNAKE_TSSD_Y ; - Save the old Y Position for the next segment
INX
CPX #$01 ; Updating the tile is tricky. If this segment is NOT the head, then we can just handle it
BNE HandleBodyTile ; like we would the X and Y position. But if it IS the head, then we need to choose the
; appropriate tile and attributes for the next segment
HandleHeadTile:
; Update the Tile:
LDA ptr_SNAKE_TSSD_TILE ; - Get the new Tile Index
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Tile Index
INX
; Update the Tile Attributes:
LDA ptr_SNAKE_TSSD_ATTR ; - Get the new Tile Attrs
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Tile Attrs
INX
JSR ChooseNextBodyTile ; The logic for choosing the next body tile is too complex to include here, so it's been
; moved into its own subroutine
JMP UpdateXPosition
HandleBodyTile:
; Update the Tile:
LDY ptr_SNAKE_HEAD_Y, X ; - Save the old Tile Index
LDA ptr_SNAKE_TSSD_TILE ; - Get the new Tile Index
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Tile Index
STY ptr_SNAKE_TSSD_TILE ; - Save the old Tile Index for the next segment
INX
; Update the Tile Attributes:
LDY ptr_SNAKE_HEAD_Y, X ; - Save the old Tile Attrs
LDA ptr_SNAKE_TSSD_ATTR ; - Get the new Tile Attrs
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Tile Attrs
STY ptr_SNAKE_TSSD_ATTR ; - Save the old Tile Attrs for the next segment
INX
UpdateXPosition:
; Update the X Position:
LDY ptr_SNAKE_HEAD_Y, X ; - Save the old X Position
LDA ptr_SNAKE_TSSD_X ; - Get the new X Position
STA ptr_SNAKE_HEAD_Y, X ; - Set the new X Position
STY ptr_SNAKE_TSSD_X ; - Save the old X Position for the next segment
INX
CPX ptr_SNAKE_TAIL
BNE MoveSnakeLoop
LDA ptr_GAME_FLAGS ; Check the grow bit. If we're not growing (the normal case) then just handle the tail
AND #flag_GROW ; like we would the rest of the body. But, if the grow bit is set, then we've already
BEQ HandleSnakeTail ; added the new body segment and the tail should just stay in place.
; Reset the value of the grow flag to 0
LDA ptr_GAME_FLAGS ; Erase the Grow Bit
EOR #flag_GROW
STA ptr_GAME_FLAGS
HandleSnakeTail:
; Update the Y Position:
LDA ptr_SNAKE_TSSD_Y ; - Get the new Y Position
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Y Position... note that we don't need to store the old position because
; there are no tiles after the tail
INX
TXA ; Start off by assuming that we'll be using the Up-Down Tail Tile
TAY ; But...
LDA #$30 ; We need the "direction" of the old tile to know which tail tile index to use, so store
STA ptr_SNAKE_HEAD_Y, Y ; the current byte offset, check the direction, then backtrack to set the tail tile index
INX
LDA ptr_SNAKE_TSSD_ATTR ; - Get the Tile Attrs
AND #%00011000 ; - Isolate the "direction" of the tile
PHA ; Keep the custom Tile Attrs for later use
LSR A ; - Shift the bits to the right 3 times so that we end up with a number between #00-#03
LSR A
LSR A
BEQ SnakeTailUp ; - 00 - the tile is pointing up
CMP #01
BEQ SnakeTailDown
PHA ; So it turns out that we need the Left-Right Tail Tile. Push the tile direction onto the
LDA #$31 ; the stack, reset the tile to Left-Right using the Y register, then pull the tile
STA ptr_SNAKE_HEAD_Y, Y ; direction back into the accumulator and continue setting the tile attributes
PLA
CMP #02
BEQ SnakeTailLeft
CMP #03
BEQ SnakeTailRight
SnakeTailUp:
SnakeTailLeft:
PLA ; Get the custom attributes. We don't need any others.
JMP SetSnakeTailAttrs
SnakeTailDown:
SnakeTailRight:
PLA ; Get the custom attributes.
ORA #%11000000 ; Merge in the flip bits
JMP SetSnakeTailAttrs
SetSnakeTailAttrs:
STA ptr_SNAKE_HEAD_Y, X ; - Set the new Tile Attrs
INX
UpdateTailXPosition:
; Update the X Position:
LDA ptr_SNAKE_TSSD_X ; - Get the new X Position
STA ptr_SNAKE_HEAD_Y, X ; - Set the new X Position
UpdateSnakeDirection:
LDA ptr_SNAKE_DIR_NXT ; Now that we're done moving the snake, set the snake's new current direction
STA ptr_SNAKE_DIR_CUR
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; DETECT COLLISIONS
; Handles the logic for detecting a collision and then doing something about it.
; Expected Memory State:
; This logic runs before the snake has "actually" moved, so the current Snake Head is not useful. Instead, the snake's
; next head position should be stored in the TSSD. The values in the TSSD will be used to detect a collision with the
; snake's body, the apple or the world edges.
DetectCollisions:
LDA ptr_SNAKE_TSSD_X ; Start by comparing the X Position of the Snake Head and Apple
EOR ptr_APPLE_X
STA ptr_COLLISION_FLAG ; We'll borrow the frame counter because it's reset to 0 once the snake is done moving
LDA ptr_SNAKE_TSSD_Y ; Then compare the Y Position of the Snake Head and Apple
EOR ptr_APPLE_Y
ORA ptr_COLLISION_FLAG ; Then OR them together
BEQ HandleAppleCollision ; If the result is 0, then the snake has eaten the apple
RTS ; No collisions detected: Return from sub-routine
HandleAppleCollision:
LDA ptr_GAME_FLAGS ; Set the Grow Bit
ORA #flag_GROW
STA ptr_GAME_FLAGS
JSR UpdateScore
GetNewAppleX:
JSR GenNextRandom ; Generate a random number
LDA ptr_RAND ; Get the random number
ASL A ; Multiply by 8 to get the Apple's next X Position
ASL A
ASL A
CLC
ADC #08
CLC
CMP #const_GAME_WIDTH
BCC SetNewAppleX ; If the new X position is on-screen, then store it and move on to Y
JMP GetNewAppleX ; Otherwise, try getting another X value
SetNewAppleX:
STA ptr_APPLE_X
GetNewAppleY:
JSR GenNextRandom ; Generate a random number
LDA ptr_RAND ; Get the random number
ASL A ; Multiply by 8 to get the Apple's next Y Position
ASL A
ASL A
CLC
ADC #08
CLC
CMP #const_GAME_HEIGHT
BCC SetNewAppleY ; If the new Y position is on-screen, then store it and finish
JMP GetNewAppleY ; Otherwise, try getting another Y value
SetNewAppleY:
STA ptr_APPLE_Y
RTS ; Return from sub-routine
HandleOtherCollision:
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; CHOOSE NEXT BODY TILE
; There are several different tiles to choose from and different orientations the tiles could take. The following table
; lays out the tiles and (H)orizontal and (V)ertical flip bit
;
; ┌─────────┬─────────┬────────┬────────┬─────────┐
; │ / Next │ Up │ Down │ Left │ Right │
; │ Current │ │ │ │ │
; ├─────────┼─────────┼────────┼────────┼─────────┤
; │ Up │ T$20 │ -- │ T$12 │ T$12 H │
; │ Down │ -- │ T$20 V │ T$12 V │ T$12 HV │
; │ Left │ T$12 HV │ T$12 H │ T$21 │ -- │
; │ Right │ T$12 V │ T$12 │ -- │ T$21 H │
; └─────────┴─────────┴────────┴────────┴─────────┘
;
ChooseNextBodyTile:
LDA ptr_SNAKE_DIR_CUR ; The simplest scenario is travelling in a straight line
CMP ptr_SNAKE_DIR_NXT
BNE NextTileTurn
NextTileStraight:
CMP #01
BEQ NextTileStraight_Up
CMP #02
BEQ NextTileStraight_Down
CMP #03
BEQ NextTileStraight_Left
CMP #04
BEQ NextTileStraight_Right
NextTileStraight_Up:
LDA #$20 ; Use the Up-Down Snake Body
STA ptr_SNAKE_TSSD_TILE
LDA #%00000000 ; Turn body upward
STA ptr_SNAKE_TSSD_ATTR
RTS ; Return from sub-routine
NextTileStraight_Down:
LDA #$20 ; Use the Up-Down Snake Body
STA ptr_SNAKE_TSSD_TILE
LDA #%10001000 ; Turn body downward
STA ptr_SNAKE_TSSD_ATTR
RTS ; Return from sub-routine
NextTileStraight_Left:
LDA #$21 ; Use the Left-Right Snake Body
STA ptr_SNAKE_TSSD_TILE
LDA #%00010000 ; Turn body leftward
STA ptr_SNAKE_TSSD_ATTR
RTS ; Return from sub-routine
NextTileStraight_Right:
LDA #$21 ; Use the Left-Right Snake Body
STA ptr_SNAKE_TSSD_TILE
LDA #%01011000 ; Turn body rightward
STA ptr_SNAKE_TSSD_ATTR
RTS ; Return from sub-routine
NextTileTurn:
LDA #$12 ; All of our turns use the same tile. The real complexity comes in knowing how to flip it.
STA ptr_SNAKE_TSSD_TILE
LDA ptr_SNAKE_DIR_NXT ; Get the next direction
CMP #01
BEQ NextTileTurn_ToUp
CMP #02
BEQ NextTileTurn_ToDown
CMP #03
BEQ NextTileTurn_ToLeft
CMP #04
BEQ NextTileTurn_ToRight
NextTileTurn_ToUp:
LDA #%00000000
LDY ptr_SNAKE_DIR_CUR ; Get the next direction
CPY #03
BEQ NextTileTurn_LeftToUp
CPY #04
BEQ NextTileTurn_RightToUp
NextTileTurn_ToDown:
LDA #%00001000
LDY ptr_SNAKE_DIR_CUR ; Get the next direction
CPY #03
BEQ NextTileTurn_LeftToDown
CPY #04
BEQ NextTileTurn_RightToDown
NextTileTurn_ToLeft:
LDA #%00010000
LDY ptr_SNAKE_DIR_CUR ; Get the next direction
CPY #01
BEQ NextTileTurn_UpToLeft
CPY #02
BEQ NextTileTurn_DownToLeft
NextTileTurn_ToRight:
LDA #%00011000
LDY ptr_SNAKE_DIR_CUR ; Get the next direction
CPY #01
BEQ NextTileTurn_UpToRight
CPY #02
BEQ NextTileTurn_DownToRight
NextTileTurn_UpToLeft:
NextTileTurn_RightToDown:
ORA #%00000000
JMP NextTileTurnDone
NextTileTurn_UpToRight:
NextTileTurn_LeftToDown:
ORA #%01000000
JMP NextTileTurnDone
NextTileTurn_DownToLeft:
NextTileTurn_RightToUp:
ORA #%10000000
JMP NextTileTurnDone
NextTileTurn_DownToRight:
NextTileTurn_LeftToUp:
ORA #%11000000
JMP NextTileTurnDone
NextTileTurnDone:
STA ptr_SNAKE_TSSD_ATTR
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------------------------------------
; UPDATE SCORE
; Print the score on the bottom right corner of the screen
UpdateScore:
INC ptr_SCORE
LDA ptr_SCORE
PHA
AND #%00001111
CLC
ADC #$40
STA ptr_SCORE2_TILE
PLA
AND #%11110000
LSR A
LSR A
LSR A
LSR A
CLC
ADC #$40
STA ptr_SCORE1_TILE
RTS ; Return from sub-routine
; ----------------------------------------------------------------------------------------------------------------------
.bank 1
.org $E000
palette:
.db $0F,$31,$32,$33 ; background palette (00)
.db $0F,$35,$36,$37 ; background palette (01)
.db $0F,$39,$3A,$3B ; background palette (10)
.db $0F,$3D,$3E,$0F ; background palette (11)
.db $0F,$31,$06,$0C ; snake palette (00)
.db $0F,$29,$16,$18 ; apple palette (01)
.db $0F,$1C,$15,$14 ; foreground palette (10)
.db $0F,$02,$38,$3C ; foreground palette (11)
sprites:
;vert tile attr horiz
.db $80, $01, %00000001, $80 ; Apple
.db $68, $10, %00000000, $80 ; Snake Head
.db $70, $20, %00000000, $80 ; Snake Body
.db $78, $30, %00000000, $80 ; Snake Tail
.org $FFFA ; first of the three vectors starts here
.dw NMI ; when an NMI happens (once per frame if enabled) the
; processor will jump to the label NMI:
.dw RESET ; when the processor first turns on or is reset, it will jump
; to the label RESET:
.dw 0 ; external interrupt IRQ is not used in this tutorial
;;;;;;;;;;;;;;
.bank 2
.org $0000
.incbin "snake.chr" ; includes 8KB graphics file from SMB1 | 37.48329 | 121 | 0.568171 |
26663f01daa195e096713c0ed53743540573d6fc | 7,080 | asm | Assembly | KernelParts/IH.asm | Th3Matt/FlameOS-2.0 | 671ec59b2fb94ecc67f49cdc4d60ff6f89b52a49 | [
"MIT"
] | null | null | null | KernelParts/IH.asm | Th3Matt/FlameOS-2.0 | 671ec59b2fb94ecc67f49cdc4d60ff6f89b52a49 | [
"MIT"
] | null | null | null | KernelParts/IH.asm | Th3Matt/FlameOS-2.0 | 671ec59b2fb94ecc67f49cdc4d60ff6f89b52a49 | [
"MIT"
] | null | null | null | Exceptions:
.DE:
xchg bx, bx
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
add esp, 24 ;fd8
pop ebx
pop ecx
pop edx
mov eax, 0xFFFF
push ecx
push ebx
sub esp, 24+4
push word 'DE'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
add esp, 4
push eax
add esp, 4
pop eax
add eax, 3
push eax
sub esp, 4
pop eax
sti
iret
.SS:
xchg bx, bx
xor ebp, ebp
not ebp
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
add esp, 24 ;fd8
pop eax
pop ebx
pop ecx
pop edx
push edx
push ecx
push ebx
sub esp, 24+4
push word 'SS'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
add esp, 4
push eax
add esp, 4
pop eax
add eax, 3
push eax
sub esp, 4
pop eax
sti
iret
.UD:
xchg bx, bx
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
add esp, 24 ;fd8
pop ebx
pop ecx
pop edx
mov eax, 0xFFFF
push ecx
push ebx
sub esp, 24+4
push word 'UD'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
add esp, 4
push eax
add esp, 4
pop eax
add eax, 3
push eax
sub esp, 4
pop eax
sti
iret
.DF:
xchg bx, bx
mov esp, 0x1000
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
xor edx, edx
xor ecx, ecx
xor ebx, ebx
xor eax, eax
sub esp, 24+4
push word 'DF'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
sti
iret
.NP:
xchg bx, bx
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
add esp, 24 ;fd8
pop eax
pop ebx
pop ecx
pop edx
push edx
push ecx
push ebx
sub esp, 24+4
push word 'NP'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
add esp, 4
push eax
add esp, 4
pop eax
add eax, 3
push eax
sub esp, 4
pop eax
sti
iret
.GP:
xchg bx, bx
cli ;ff4
push eax
push ebx
push ecx
push edx
push edi
push esi
add esp, 24 ;fd8
pop eax ; error code
pop ebx ; EIP
pop ecx ; CS
pop edx ; EFLAGS?
push edx
push ecx
push ebx
sub esp, 24+4
push word 'GP'
call .Panic
add esp, 2
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax
add esp, 4
push eax
add esp, 4
pop eax
add eax, 3
push eax
sub esp, 4
pop eax
sti
iret
.Panic:
xchg bx, bx
push edx
push ebx
push eax
push ecx
push ds
mov ebp, esp ; copying the safe stack location for the stack dance
xchg bx, bx
add esp, 20+4
pop cx
sub esp, 20-4+4+2
mov ax, 0x48
mov ds, ax
mov edi, (8*80+14)*2
mov [edi], cl ; setting up exception screen
inc edi
inc edi ; saving bytes as (inc edi inc edi) < (add edi, 2)
mov [edi], ch
add edi, 13*2
xchg bx, bx
pop ecx
pop edx ; pop eax
pop ebx
pop eax ; pop edx
mov esi, 0
xchg ebp, esp ; begining the stack dance (attempting to not overwrite important data on the stack by switching esp to a safe location)
call .HexWrite4 ; ErrCode
xchg ebp, esp
add edi, (80*3-22)*2
add esp, 4+4*6
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; eax
xchg ebp, esp
add edi, 9*2
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; ebx
xchg ebp, esp
add edi, 9*2
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; ecx
xchg ebp, esp
add edi, 9*2
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; edx
xchg ebp, esp
add edi, (81-(8*4+8*3))*2
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; esi
xchg ebp, esp
add edi, 9*2
pop edx
sub esp, 8
xchg ebp, esp
call .HexWrite8 ; edi
xchg ebp, esp
add edi, (81-8*3)*2
mov edx, ecx
xchg ebp, esp
call .HexWrite4 ; cs
xchg ebp, esp
add edi, (4+5)*2
sub esp, 4*(5+1)
pop edx
push edx
call .HexWrite4
add edi, (80*2+10+6)*2
mov edx, ebx
call .HexWrite8 ; eip
mov ax, 0x18
mov ds, ax
xor ecx, ecx
mov ds:[0x10], ecx
call Display.ReDraw
jmp $
.HexWrite2: ; Write whatever is in dl in hex, reqires esi to point to a HexTable with 0s between entries
push ebx
push dx
shr dl, 4
xor ebx, ebx
mov bl, dl
mov esi, 0
add esi, ebx
shl esi, 1
mov dl, [esi]
shr esi, 1
mov [edi], dl
sub esi, ebx
pop dx
and dl, 0x0F
inc edi
inc edi
xor ebx, ebx
mov bl, dl
add esi, ebx
shl esi, 1
mov dl, [esi]
shr esi, 1
mov [edi], dl
pop ebx
ret
.HexWrite4: ; Write whatever is in dx in hex
push dx
xchg dl, dh
call .HexWrite2
xchg dl, dh
inc edi
inc edi
call .HexWrite2
pop dx
ret
.HexWrite8: ; Write whatever is in edx in hex
push edx
ror edx, 16
call .HexWrite4
inc edi
inc edi
ror edx, 16
call .HexWrite4
pop edx
ret
IRQ:
.Timer:
cli
pusha
xor ecx, ecx ; Screen redraw
int 0x30
mov al, 0x20
out 0x20, al
popa
sti
iret
.PS2:
cli
;xchg bx, bx
;ud2
pusha
push ds
mov ax, 0x18
mov ds, ax
mov dl, [0x20]
mov ebx, [0x23]
test dl, 1
je .PS2.1
mov ax, [0x21]
mov ds, ax
.PS2.1:
in al, 0x60
mov [ds:ebx], al
mov al, 0x20
out 0x20, al
pop ds
popa
sti
iret
| 14.075547 | 135 | 0.443362 |
9e76fabb5ca6d8f2b2e0030982c1db2d2b251fb6 | 2,206 | asm | Assembly | programs/oeis/107/A107464.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/107/A107464.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/107/A107464.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A107464: Number of fuzzy subgroups of rank 3 cyclic group of order (p^n)*q*r where p, q and r are three distinct prime.
; 11,51,175,527,1471,3903,9983,24831,60415,144383,339967,790527,1818623,4145151,9371647,21037055,46923775,104071167,229638143,504365055,1103101951,2403336191,5217714175,11291066367,24360517631,52412022783,112474456063,240786604031,514322333695,1096290402303,2332167241727,4952097292287,10496900071423,22213570854911,46935402610687,99024765976575,208632331370495,438980017389567,922490255704063,1936239976513535,4059396929748991,8501423905964031,17785700090904575,37172289111851007,77616724827963391,161918480352804863,337488497076076543,702843016846508031,1462543978988568575,3041055648381927423,6318550277200805887,13118985714530254847,27219756147827277823,56439110530207055871,116949475123557040127,242185573561475792895,501232624127826722815,1036764663017707143167,2143281077064128528383,4428371499194899234815,9144973374541510213631,18875630873423298691071,38941076739600863461375,80298676952857678184447,165504187829322097098751,340969617458447352070143,702156866421680372711423,1445339291663290788216831,2973910292587159073325055,6116645186936907963039743,12575661943881865204072447,25845511760745568254558207,53098288733386290782797823,109048886822425847274668031,223877950219884140290899967,459467369317285000711766015,942659907844507098977140735,1933374617018695707648851967,3964067762516369063861551103,8125190433629922683200208895,16649326387732672994053455871,34106215222967918276810637311,69846898154054815197824024575,143001417350575255817644146687,292695448038537098746461683711,598930865256758044249632538623,1225251153882705127081408200703,2505900124523431021464552210431,5123833822602188957807475163135,10474210672393602505921490059263,21406459159322795713555656081407,43738897468031055872735857082367,89349560275461606721119189991423,182482265310979335562330103611391,372610048304585179702437198430207,760669588299451905235615467175935,1552555072629523959483087250784255,3168175762620402331690635486035967,6463750410563741718231689644212223,13184833892973814004967210039115775
mov $1,$0
add $1,2
lpb $1
add $0,1
sub $1,1
add $2,$0
mul $0,4
sub $0,$2
lpe
| 169.692308 | 1,995 | 0.918404 |
9a69dd3484e6f036e5671a277da88c2b5f4b80d4 | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm/zel_init.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm/zel_init.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm/zel_init.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_init.asm
Type: file
Size: 278969
Last-Modified: '2016-05-13T04:23:03Z'
SHA-1: 92D9090163A6DF317FD38BEDD8750CD2F364BDE1
Description: null
| 21 | 47 | 0.816327 |
c945fdd46cc57986fd946df38142e7f3b2b2a54c | 364 | asm | Assembly | oeis/021/A021426.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021426.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021426.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021426: Decimal expansion of 1/422.
; Submitted by Jamie Morken(m2)
; 0,0,2,3,6,9,6,6,8,2,4,6,4,4,5,4,9,7,6,3,0,3,3,1,7,5,3,5,5,4,5,0,2,3,6,9,6,6,8,2,4,6,4,4,5,4,9,7,6,3,0,3,3,1,7,5,3,5,5,4,5,0,2,3,6,9,6,6,8,2,4,6,4,4,5,4,9,7,6,3,0,3,3,1,7,5,3,5,5,4,5,0,2,3,6,9,6,6,8
seq $0,83811 ; Numbers n such that 2n+1 is the digit reversal of n+1.
div $0,1688
mod $0,10
| 45.5 | 199 | 0.593407 |
e2d6dc07ab20302256392053205710a4e46b81e7 | 198 | asm | Assembly | Some Basic Programs/4.asm | moni-kishore-dhar/Problem-Solving-by-Assembly-Language | eed4d83be549f48e1db5bcb4700296e8e08453b1 | [
"MIT"
] | 1 | 2022-01-13T18:02:00.000Z | 2022-01-13T18:02:00.000Z | Some Basic Programs/4.asm | moni-kishore-dhar/Problem-Solving-by-Assembly-Language | eed4d83be549f48e1db5bcb4700296e8e08453b1 | [
"MIT"
] | null | null | null | Some Basic Programs/4.asm | moni-kishore-dhar/Problem-Solving-by-Assembly-Language | eed4d83be549f48e1db5bcb4700296e8e08453b1 | [
"MIT"
] | null | null | null | ;2*2+6*6+18*18+54*54
mov di,0
mov cx,4
mov si,3
mov bx,2
find_sum:
mov ax,bx
mul bx
add di,ax
mov ax,bx
mul si
mov bx,ax
loop find_sum | 7.333333 | 20 | 0.474747 |
5732a084ae73a7db72521b8fef0100b02bc63661 | 318 | asm | Assembly | programs/oeis/047/A047441.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/047/A047441.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/047/A047441.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A047441: Numbers that are congruent to {0, 2, 5, 6} mod 8.
; 0,2,5,6,8,10,13,14,16,18,21,22,24,26,29,30,32,34,37,38,40,42,45,46,48,50,53,54,56,58,61,62,64,66,69,70,72,74,77,78,80,82,85,86,88,90,93,94,96,98,101,102,104,106,109,110,112,114,117,118,120,122,125
mov $1,$0
add $0,21
mod $0,4
mul $1,6
add $1,$0
div $1,3
| 31.8 | 198 | 0.644654 |
17b0812bc298d6cc9b524c409ed24dd3d341fea3 | 3,205 | asm | Assembly | ntio/doswrite.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | ntio/doswrite.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | ntio/doswrite.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE DO_DOSWRITE - Copyright (C) 1994 SLR Systems
INCLUDE MACROS
INCLUDE IO_STRUC
INCLUDE WIN32DEF
INCLUDE WINMACS
.CODE PASS2_TEXT
externdef _close_handle:proc,_doswrite:proc,_release_io_segment:proc
externdef _dos_fail_move:proc
externdef _dos_fail_seteof:proc
; PUBLIC DO_DOSWRITE_CLEAR
;DO_DOSWRITE_CLEAR LABEL PROC
; ;
; ;EAX IS DEVICE
; ;
; ;WRITE BLOCK, EDX ECX=# OF BYTES
; ;
; ASSUME EAX:PTR MYO_STRUCT
; OR [EAX].MYO_SPEC_FLAGS,MASK F_CLEAR_BLOCK
; JMP _do_doswrite2
; MYO_STRUCT *_do_doswrite(MYO_STRUCT *EAX, unsigned ECX)
public _do_doswrite
_do_doswrite label proc
mov EAX,4[ESP]
mov ECX,8[ESP]
ASSUME EAX:PTR MYO_STRUCT
mov EDX,[EAX].MYO_BLOCK
jmp _do_doswrite2
public _do_doswrite_release
_do_doswrite_release LABEL PROC
mov EAX,4[ESP]
mov ECX,8[ESP]
mov EDX,12[ESP]
OR [EAX].MYO_SPEC_FLAGS,MASK F_RELEASE_BLOCK
jmp _do_doswrite2
public _do_doswrite2
_do_doswrite2 PROC
;
;F_SEEK_FIRST ;DO DOSPOSITION PLEASE
;CX <>0 ;WRITE STUFF
;F_TRUNC_FILE ;TRUNCATE FILE AT THIS POINT
;F_CLEAR_BLOCK ;CLEAR BLOCK USED
;F_RELEASE_BLOCK;RELEASE BLOCK USED
;F_SET_TIME ;SET FILE TIME-DATE STAMP
;F_CLOSE_FILE ;CLOSE FILE NOW
;
; ALLMSG 'DO_DOSWRITE'
PUSH ESI
MOV ESI,EAX
ASSUME ESI:PTR MYO_STRUCT
TEST ECX,ECX
JZ L0$
MOV [ESI].MYO_BLOCK,EDX
L0$:
PUSH EBX
MOV DL,[ESI].MYO_SPEC_FLAGS
MOV [ESI].MYO_BYTES,ECX ;# OF BYTES BEING WRITTEN
AND DL,MASK F_SEEK_FIRST
JZ L1$
;
;FIRST, SEEK TO CORRECT LOCATION IN FILE
;
MOV ECX,[ESI].MYO_DESPOT
MOV EAX,[ESI].MYO_PHYS_ADDR
CMP ECX,EAX
JZ SKIP_POSIT
MOV EAX,[ESI].MYO_HANDLE
PUSH FILE_BEGIN ;DISTANCE FROM BEGINNING OF FILE
MOV [ESI].MYO_PHYS_ADDR,ECX
PUSH 0 ;DISTANCE TO MOVE HIGH
PUSH ECX ;DISTANCE TO MOVE
PUSH EAX ;HANDLE
CALL SetFilePointer
INC EAX
MOV EAX,ESI
JZ DOS_FAIL_MOVE
SKIP_POSIT:
L1$:
MOV ECX,[ESI].MYO_BYTES
MOV EDX,[ESI].MYO_BLOCK
TEST ECX,ECX
JZ L2$
MOV EAX,ESI
push EDX
push ECX
push EAX
call _doswrite
add ESP,12
L2$:
MOV DL,[ESI].MYO_SPEC_FLAGS
MOV EAX,ESI
AND DL,MASK F_TRUNC_FILE
JZ L3$
MOV EAX,[ESI].MYO_HANDLE
PUSH EAX
CALL SetEndOfFile
TEST EAX,EAX
MOV EAX,ESI
JZ DOS_FAIL_SETEOF
L3$:
MOV DL,[ESI].MYO_SPEC_FLAGS
XOR ECX,ECX
AND DL,MASK F_CLEAR_BLOCK +MASK F_RELEASE_BLOCK
JZ L4$
MOV EAX,[ESI].MYO_BLOCK
MOV [ESI].MYO_BLOCK,ECX
AND DL,MASK F_RELEASE_BLOCK
JZ L4$
OR EAX,EAX
JZ L4$
push EAX
call _release_io_segment
add ESP,4
L4$:
; MOV DL,[ESI].MYO_SPEC_FLAGS
; AND DL,MASK F_SET_TIME
; JZ L5$
;
;SET T&D STAMP ON FILE
;
; MOV CX,[ESI].MYO_TIME
; MOV EBX,[ESI].MYO_HANDLE
; MOV DX,[ESI].MYO_DATE
; MOV EAX,5701H
; DOS
;L5$:
MOV DL,[ESI].MYO_SPEC_FLAGS
XOR ECX,ECX
AND DL,MASK F_CLOSE_FILE ;EOF?
JZ L6$
MOV EAX,[ESI].MYO_HANDLE
MOV [ESI].MYO_BUSY,ECX
TEST EAX,EAX
JZ L6$
MOV [ESI].MYO_HANDLE,ECX
push EAX
call _close_handle
add ESP,4
L6$:
XOR ECX,ECX
POP EBX
MOV [ESI].MYO_SPEC_FLAGS,CL
MOV EAX,ESI
POP ESI
RET
DOS_FAIL_MOVE:
push EAX
call _dos_fail_move
DOS_FAIL_SETEOF:
push EAX
call _dos_fail_seteof
_do_doswrite2 ENDP
END
| 15.408654 | 70 | 0.70546 |
fc78db25d9b10133d7d6f69fe62471b90bf619ad | 148 | asm | Assembly | ee/button/name.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ee/button/name.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ee/button/name.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Button name V0.00 1989 Tony Tebby
xdef bt_name
section version
bt_name dc.w 12,'Button Frame'
end
| 16.444444 | 50 | 0.527027 |
35663ca25074aa1c4134fe9331a6c1ffd6dce3e6 | 3,625 | asm | Assembly | ispw/src/test/demo-workspace/rjk2/ASM/TRITSTA.asm | david-kennedy/vscode-ispw | 3d0688ba0038870961879e7dc34c4472d7f7ae72 | [
"MIT"
] | 5 | 2021-03-20T01:09:50.000Z | 2022-01-06T21:51:15.000Z | ispw/src/test/demo-workspace/rjk2/ASM/TRITSTA.asm | david-kennedy/vscode-ispw | 3d0688ba0038870961879e7dc34c4472d7f7ae72 | [
"MIT"
] | null | null | null | ispw/src/test/demo-workspace/rjk2/ASM/TRITSTA.asm | david-kennedy/vscode-ispw | 3d0688ba0038870961879e7dc34c4472d7f7ae72 | [
"MIT"
] | 2 | 2021-11-04T14:45:48.000Z | 2022-02-09T20:04:03.000Z | TRITSTA CSECT
R1 EQU 1
R2 EQU 2
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
USING *,R15
********************************************************
SETUP EQU * *
STM R14,R12,12(R13) * SAVE REGISTERS
LR R12,R15 *
DROP R15 * OPEN UP
USING TRITSTA,R12 *
LA R11,SAVEAREA *
ST R13,4(R11) * CHAIN SAVE AREAS
ST R11,8(R13) *
LR R13,R11 *
********************************************************
********* START INSTRUCTIONS ************************
START EQU *
L R2,0(R1) POINT R2 TO PARAMETER
USING TSTREC,R2 SET ADDRESS FOR DSECT
ZEROIT ZAP ANB,=P'0'
ZAP ANC,=P'0'
ZAP BNC,=P'0'
PACKIT PACK TSTA,SIDEA PACK TRIANGLE SIDE
PACK TSTB,SIDEB "
PACK TSTC,SIDEC "
ADDIT MVC ANB+1(1),TSTA ADD SIDEA TO SIDEB GIVING ANB
AP ANB,TSTB
MVC ANC+1(1),TSTA ADD SIDEA TO SIDEC GIVING ANC
AP ANC,TSTC
MVC BNC+1(1),TSTB ADD SIDEB TO SIDEC GIVING BNC
AP BNC,TSTC
VALIDATE CP BNC,TSTA BNC NOT > A?
BL MOVEIT THEN INVALID; GOTO MOVEIT
CP BNC,TSTA BNC = A?
BE MOVEIT THEN INVALID; GOTO MOVEIT
CP ANC,TSTB ANC NOT > B?
BL MOVEIT THEN INVALID; GOTO MOVEIT
CP ANC,TSTB ANC = B?
BE MOVEIT THEN INVALID; GOTO MOVEIT
CP ANB,TSTC ANB NOT > C?
BL MOVEIT THEN INVALID; GOTO MOVEIT
CP ANB,TSTC ANB = C?
BE MOVEIT THEN INVALID; GOTO MOVEIT
B TRICHK TRIANGLE OK; CONTINUE
MOVEIT MVI TYPE,C'4' SET TYPE TO INVALID TRIANGLE(4)
B ENDIT RETURN TO READIT
TRICHK CP TSTA,TSTB IS A = B?
BE EQUAL IF SO, BRANCH EQUAL
CP TSTB,TSTC OR IS B = C?
BE TYPEII IF SO, BRANCH TYPEII
CP TSTA,TSTC OR IS A = C?
BE TYPEII IF SO, BRANCH TYPEII
B SCALENE OTHERWISE BRANCH SCALENE
EQUAL CP TSTB,TSTC IS B = C?
BNE TYPEII
MVI TYPE,C'1' OTHERWISE SET TYPE TO 1(EQUILATERAL)
B ENDIT RETURN TO READIT
SCALENE MVI TYPE,C'3' SET TYPE TO SCALENE(3)
B ENDIT
TYPEII MVI TYPE,C'2' SET TYPE TO ISOSCELES(2)
********* END INSTRUCTIONS ************************
********************************************************
ENDIT SR R15,R15 *
L R13,4(R13) *
LM R14,R12,12(R13) * CLOSE UP
BR R14 *
********************************************************
********* DEFINITIONS ******************************
********************************************************
SAVEAREA DS 0D
DC 72X'0'
********************************************************
DS 0CL3
TSTA DS PL1
TSTB DS PL1
TSTC DS PL1
DS 0CL6
ANB DS PL2
ANC DS PL2
BNC DS PL2
TSTREC DSECT
TYPE DS ZL1
DS 0CL3
SIDEA DS ZL1
SIDEB DS ZL1
SIDEC DS ZL1
END TRITSTA | 39.402174 | 69 | 0.384 |
ef7c57be15930de49e0a686509e6f5ba894890b2 | 7,605 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_725.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_725.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_725.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 %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xa414, %r13
nop
nop
xor %rbx, %rbx
movw $0x6162, (%r13)
nop
nop
nop
xor %r8, %r8
lea addresses_normal_ht+0xf964, %r13
xor %r12, %r12
movb $0x61, (%r13)
nop
sub %r8, %r8
lea addresses_normal_ht+0xf46c, %r10
nop
nop
nop
xor $30902, %r11
mov (%r10), %rbx
dec %r8
lea addresses_UC_ht+0x18d84, %rbx
nop
nop
cmp $5414, %r11
vmovups (%rbx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r13
nop
nop
add $37074, %r12
lea addresses_A_ht+0x4cf4, %r12
clflush (%r12)
sub $5398, %r8
mov (%r12), %edx
nop
sub %r13, %r13
lea addresses_normal_ht+0xd294, %r12
nop
nop
sub %r10, %r10
movl $0x61626364, (%r12)
inc %rbx
lea addresses_WC_ht+0xe94, %rsi
lea addresses_UC_ht+0x32ec, %rdi
nop
nop
nop
add %r8, %r8
mov $14, %rcx
rep movsw
nop
nop
nop
and $15441, %r10
lea addresses_normal_ht+0xc214, %r11
nop
nop
nop
nop
sub %rbx, %rbx
mov (%r11), %dx
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0x17434, %rdi
nop
nop
nop
cmp %r13, %r13
movl $0x61626364, (%rdi)
dec %r12
lea addresses_UC_ht+0x11f94, %rdi
nop
nop
nop
and %r8, %r8
mov $0x6162636465666768, %rsi
movq %rsi, (%rdi)
nop
nop
nop
nop
xor $62137, %rcx
lea addresses_normal_ht+0x7454, %r8
nop
nop
dec %rsi
movups (%r8), %xmm2
vpextrq $0, %xmm2, %rdx
nop
nop
nop
inc %rdi
lea addresses_A_ht+0x5f18, %rdx
nop
add $14961, %r12
mov $0x6162636465666768, %r13
movq %r13, %xmm3
vmovups %ymm3, (%rdx)
nop
nop
nop
dec %r12
lea addresses_normal_ht+0x4394, %rsi
lea addresses_UC_ht+0x13dd4, %rdi
nop
dec %r11
mov $110, %rcx
rep movsl
nop
nop
nop
nop
nop
xor $46841, %rcx
lea addresses_normal_ht+0x4ad4, %rsi
lea addresses_UC_ht+0x1510c, %rdi
nop
nop
sub %r12, %r12
mov $13, %rcx
rep movsw
nop
and %rsi, %rsi
lea addresses_A_ht+0x1d694, %r11
nop
xor $24180, %rcx
movb (%r11), %dl
sub $30748, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rax
push %rbp
push %rbx
// Faulty Load
lea addresses_RW+0x1f294, %r13
cmp %r8, %r8
mov (%r13), %rbp
lea oracles, %rbx
and $0xff, %rbp
shlq $12, %rbp
mov (%rbx,%rbp,1), %rbp
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_RW', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_RW', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 3}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 5}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 5}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 2}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 8}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 36.5625 | 2,999 | 0.65641 |
9c6f64f18cf270135bebd4a113c35c5c02fb3aa1 | 144 | asm | Assembly | programs/oeis/053/A053408.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/053/A053408.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/053/A053408.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A053408: Numbers n such that A003266(n) + 1 is prime.
; 1,2,3,4,5,6,7,8,22,28
mov $1,$0
lpb $1
pow $0,2
div $0,3
sub $1,8
lpe
add $0,1
| 13.090909 | 55 | 0.576389 |
85ca92f6f844b0d4b3e186eb21ec2d55a64cdbeb | 851 | asm | Assembly | pb2000/quad_eq.asm | wowczarek/pbnet | 5451800ef5dbc6cd05786e26e440aca9f2f8d037 | [
"BSD-2-Clause"
] | 1 | 2021-08-18T02:09:23.000Z | 2021-08-18T02:09:23.000Z | pb2000/quad_eq.asm | wowczarek/pbnet | 5451800ef5dbc6cd05786e26e440aca9f2f8d037 | [
"BSD-2-Clause"
] | null | null | null | pb2000/quad_eq.asm | wowczarek/pbnet | 5451800ef5dbc6cd05786e26e440aca9f2f8d037 | [
"BSD-2-Clause"
] | null | null | null | ; Copyright (c) 2021, Wojciech Owczarek
; All rights reserved.
; BSD 2-clause licence - see LICENSE in the top directory
; base/org are meaningless in inline code, but keep the compiler happy
BASE: EQU &H7000
START here
ORG BASE
here:
; check if two 4-byte sequences are equal. faster and not broken like DL-Pascal's longint comparison
ldm $8, (IX+$31),4 ; load addr a and b into $8..$11
pre IZ,$8 ; iz = a
ldm $0, (IZ+$31),4 ; $0...$3 = a
pre IZ,$10 ; iz = b
ldm $4, (IZ+$31),4; ; $4...$7 = b
ld $10,3 ; constant, IX offset of a boolean return value is -3
xrcm $0,$4,4 ; xor a with b
jr nz,neq ; not equal
ld $0,$30,jr res ; equal, $0=1, set result
neq:
ld $0,$31 ; not equal, $0=0
res:
st $0,(IX-$10) ; store return value
| 35.458333 | 104 | 0.560517 |
d37b67841f34009d8cb7fa4c94d14cf7c2b23bec | 6,858 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_16656_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_16656_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_16656_1362.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1abdb, %rsi
lea addresses_WT_ht+0xc5b, %rdi
nop
nop
nop
nop
and %r11, %r11
mov $79, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $40163, %rsi
lea addresses_A_ht+0x1b4e9, %rcx
nop
nop
nop
nop
nop
inc %r14
mov (%rcx), %rsi
nop
nop
and $27918, %rcx
lea addresses_D_ht+0x166cb, %r13
xor $7829, %r15
movb $0x61, (%r13)
nop
mfence
lea addresses_D_ht+0x759f, %rsi
lea addresses_WC_ht+0x109db, %rdi
nop
nop
inc %r13
mov $16, %rcx
rep movsq
xor %rsi, %rsi
lea addresses_D_ht+0x98c1, %r11
nop
nop
cmp %rcx, %rcx
mov (%r11), %r14d
nop
nop
nop
nop
nop
sub $37904, %rcx
lea addresses_WC_ht+0x14e5b, %r15
nop
nop
nop
nop
sub %r11, %r11
movups (%r15), %xmm4
vpextrq $0, %xmm4, %r14
nop
nop
cmp $17363, %r15
lea addresses_UC_ht+0x6d9b, %rcx
nop
nop
nop
sub $44045, %r11
movb $0x61, (%rcx)
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0x18e9, %rcx
nop
nop
cmp $13836, %r11
mov (%rcx), %rsi
nop
nop
xor $48929, %r13
lea addresses_A_ht+0xd05b, %rcx
nop
add $19047, %r13
mov $0x6162636465666768, %rdi
movq %rdi, (%rcx)
nop
nop
xor $4809, %r14
lea addresses_UC_ht+0x455b, %rsi
nop
sub $6518, %r11
movb (%rsi), %r15b
nop
nop
nop
and $11632, %r13
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r8
push %r9
push %rax
push %rbp
// Store
lea addresses_normal+0x1689b, %r8
nop
nop
nop
nop
nop
cmp $63748, %rbp
mov $0x5152535455565758, %r11
movq %r11, %xmm6
movups %xmm6, (%r8)
nop
nop
nop
nop
nop
add $58354, %r11
// Load
lea addresses_RW+0x1405b, %r10
cmp %rax, %rax
mov (%r10), %r8
nop
nop
dec %r10
// Faulty Load
lea addresses_D+0x145b, %r10
nop
nop
nop
nop
nop
cmp $14960, %r11
vmovups (%r10), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r9
lea oracles, %rax
and $0xff, %r9
shlq $12, %r9
mov (%rax,%r9,1), %r9
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'36': 16656}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 34.989796 | 2,999 | 0.654272 |
207c7b2b92df528abd9ccb4d3ccd005ad064663b | 168 | asm | Assembly | data/pokemon/dex_entries/slaking.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/dex_entries/slaking.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/dex_entries/slaking.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db "LAZY@" ; species name
db "The world's"
next "laziest #MON."
next "It moves to"
page "another spot when"
next "there's no food"
next "within its reach.@"
| 16.8 | 26 | 0.642857 |
51cd4d7cfcd82d7be69ac14dfe70f322811a5d8d | 320 | asm | Assembly | tests/labelalign.asm | jonfoster/customasm | 39457da0c01d3ad734178d6bf74f907c28758707 | [
"Apache-2.0"
] | 1 | 2021-01-02T13:38:01.000Z | 2021-01-02T13:38:01.000Z | tests/labelalign.asm | jonfoster/customasm | 39457da0c01d3ad734178d6bf74f907c28758707 | [
"Apache-2.0"
] | null | null | null | tests/labelalign.asm | jonfoster/customasm | 39457da0c01d3ad734178d6bf74f907c28758707 | [
"Apache-2.0"
] | null | null | null | ; ::: include
#ruledef test
{
ld {x} => 0x55 @ x`8
}
; :::
#labelalign 32
ld $ ; = 0x5500
label: ; = 0x0000
ld $ ; = 0x5504
.sublabel:
ld $ ; = 0x5506
; :::
ld $ ; = 0x5500
label1:
ld $ ; = 0x5502
#labelalign 64
label2: ; = 0x00000000
ld $ ; = 0x5508
; :::
#labelalign 33
ld $
label: ; error: not aligned
ld $ | 10.322581 | 27 | 0.55 |
8e81df6750ad568073d67ad35021c2659b132fb4 | 8,371 | nasm | Assembly | CloverEFI/BootSector/efi32.nasm | crazyinsanejames/CloverBootloader | 799880e95aaa2783f27373e91837fc105352e82f | [
"BSD-2-Clause"
] | 3,861 | 2019-09-04T10:10:11.000Z | 2022-03-31T15:46:28.000Z | CloverEFI/BootSector/efi32.nasm | crazyinsanejames/CloverBootloader | 799880e95aaa2783f27373e91837fc105352e82f | [
"BSD-2-Clause"
] | 461 | 2019-09-24T10:26:56.000Z | 2022-03-26T13:22:32.000Z | CloverEFI/BootSector/efi32.nasm | crazyinsanejames/CloverBootloader | 799880e95aaa2783f27373e91837fc105352e82f | [
"BSD-2-Clause"
] | 654 | 2019-09-05T11:42:37.000Z | 2022-03-30T02:42:32.000Z |
DEFAULT_HANDLER_SIZE: equ 9 ; size of exception/interrupt stub
SYS_CODE_SEL: equ 0x20 ; 32-bit code selector in GDT
PE_OFFSET_IN_MZ_STUB: equ 0x3c ; place in MsDos stub for offset to PE Header
VGA_FB: equ 0x000b8000 ; VGA framebuffer for 80x25 mono mode
VGA_LINE: equ 80 * 2 ; # bytes in one line
BASE_ADDR_32: equ 0x00021000
STACK_TOP: equ 0x001ffff0
SIZE: equ 0x1000
struc EFILDR_IMAGE
.CheckSum: resd 1
.Offset: resd 1
.Length: resd 1
.FileName: resb 52
endstruc
struc EFILDR_HEADER
.Signature: resd 1
.HeaderCheckSum: resd 1
.FileLength: resd 1
.NumberOfImages: resd 1
endstruc
struc PE_HEADER
resb 6
.NumberOfSections: resw 1
resb 12
.SizeOfOptionalHeader: resw 1
resb 2
.Magic: resb 16
.AddressOfEntryPoint: resd 1
resb 8
.ImageBase32: resd 1
endstruc
struc PE_SECTION_HEADER
resb 12
.VirtualAddress: resd 1
.SizeOfRawData: resd 1
.PointerToRawData: resd 1
resb 16
endstruc
%macro StubWithNoCode 1
push 0 ; push error code place holder on the stack
push %1
jmp strict dword commonIdtEntry
%endmacro
%macro StubWithACode 1
times 2 nop
push %1
jmp strict dword commonIdtEntry
%endmacro
%macro PrintReg 2
mov esi, %1
call PrintString
mov eax, [ebp + %2]
call PrintDword
%endmacro
bits 32
org BASE_ADDR_32
global _start
_start:
mov ax, bx
mov ds, eax
mov es, eax
mov fs, eax
mov gs, eax
mov ss, eax
mov esp, STACK_TOP
;
; Populate IDT with meaningful offsets for exception handlers...
;
sidt [Idtr]
mov eax, StubTable
mov ebx, eax ; use bx to copy 15..0 to descriptors
shr eax, 16 ; use ax to copy 31..16 to descriptors
mov ecx, 0x78 ; 78h IDT entries to initialize with unique entry points
mov edi, [Idtr + 2]
.StubLoop: ; loop through all IDT entries exception handlers and initialize to default handler
mov [edi], bx ; write bits 15..0 of offset
mov word [edi + 2], SYS_CODE_SEL ; SYS_CODE_SEL from GDT
mov word [edi + 4], 0x8e00 ; type = 386 interrupt gate, present
mov [edi + 6], ax ; write bits 31..16 of offset
add edi, 8 ; move up to next descriptor
add ebx, DEFAULT_HANDLER_SIZE ; move to next entry point
loop .StubLoop ; loop back through again until all descriptors are initialized
;
; Load EFILDR
;
mov esi, BlockSignature + 2
add esi, [esi + EFILDR_HEADER_size + EFILDR_IMAGE.Offset] ; esi = Base of EFILDR.C
mov ebp, [esi + PE_OFFSET_IN_MZ_STUB]
add ebp, esi ; ebp = PE Image Header for EFILDR.C
mov edi, [ebp + PE_HEADER.ImageBase32] ; edi = ImageBase
mov eax, [ebp + PE_HEADER.AddressOfEntryPoint] ; eax = EntryPoint
add eax, edi ; eax = ImageBase + EntryPoint
mov [.EfiLdrOffset], eax ; Modify jump instruction for correct entry point
movzx ebx, word [ebp + PE_HEADER.NumberOfSections] ; bx = Number of sections
movzx eax, word [ebp + PE_HEADER.SizeOfOptionalHeader]; ax = Optional Header Size
add ebp, eax
add ebp, PE_HEADER.Magic ; ebp = Start of 1st Section
.SectionLoop:
push esi ; Save Base of EFILDR.C
push edi ; Save ImageBase
add esi, [ebp + PE_SECTION_HEADER.PointerToRawData] ; esi = Base of EFILDR.C + PointerToRawData
add edi, [ebp + PE_SECTION_HEADER.VirtualAddress] ; edi = ImageBase + VirtualAddress
mov ecx, [ebp + PE_SECTION_HEADER.SizeOfRawData] ; ecx = SizeOfRawData
cld
shr ecx, 2
rep movsd
pop edi ; Restore ImageBase
pop esi ; Restore Base of EFILDR.C
add ebp, PE_SECTION_HEADER_size ; ebp = Pointer to next section record
dec ebx
jnz .SectionLoop
movzx eax, word [Idtr] ; get size of IDT
inc eax
add eax, [Idtr + 2] ; add to base of IDT to get location of memory map...
push eax ; push memory map location on stack for call to EFILDR...
push eax ; push return address (useless, just for stack balance)
.EfiLdrOffset: equ $ + 1
mov eax, 0x00401000
jmp eax ; jump to entry point
StubTable:
%assign i 0
%rep 8
StubWithNoCode i
%assign i i+1
%endrep
StubWithACode 8 ; Double Fault
StubWithNoCode 9
StubWithACode 10 ; Invalid TSS
StubWithACode 11 ; Segment Not Present
StubWithACode 12 ; Stack Fault
StubWithACode 13 ; GP Fault
StubWithACode 14 ; Page Fault
StubWithNoCode 15
StubWithNoCode 16
StubWithACode 17 ; Alignment Check
%assign i 18
%rep 102
StubWithNoCode i
%assign i i+1
%endrep
commonIdtEntry:
pushad
mov ebp, esp
;
; At this point the stack looks like this:
;
; eflags
; Calling CS
; Calling EIP
; Error code or 0
; Int num or 0ffh for unknown int num
; eax
; ecx
; edx
; ebx
; esp
; ebp
; esi
; edi <------- ESP, EBP
;
; call ClearScreen
mov edi, VGA_FB
mov esi, String1
call PrintString
mov eax, [ebp + 8 * 4] ; move Int number into EAX
cmp eax, 19
ja .PrintDefaultString
mov esi, [eax * 4 + StringTable] ; get offset from StringTable to actual string address
jmp .PrintTheString
.PrintDefaultString:
mov esi, IntUnknownString
; patch Int number
mov edx, eax
call A2C
mov [esi + 1], al
mov eax, edx
shr eax, 4
call A2C
mov [esi], al
.PrintTheString:
call PrintString
PrintReg String2, 11 * 4 ; CS
mov byte [edi], ':'
add edi, 2
mov eax, [ebp + 10 * 4] ; EIP
call PrintDword
mov esi, String3
call PrintString
mov edi, VGA_FB + 2 * VGA_LINE
PrintReg StringEax, 7 * 4
PrintReg StringEbx, 4 * 4
PrintReg StringEcx, 6 * 4
PrintReg StringEdx, 5 * 4
PrintReg StringEcode, 9 * 4
mov edi, VGA_FB + 3 * VGA_LINE
PrintReg StringEsp, 3 * 4
PrintReg StringEbp, 2 * 4
PrintReg StringEsi, 4
PrintReg StringEdi, 0
PrintReg StringEflags, 12 * 4
mov edi, VGA_FB + 5 * VGA_LINE
mov esi, ebp
add esi, 13 * 4 ; stack beyond eflags
mov ecx, 8
.OuterLoop:
push ecx
mov ecx, 8
mov edx, edi
.InnerLoop:
mov eax, [esi]
call PrintDword
add esi, 4
mov byte [edi], ' '
add edi, 2
loop .InnerLoop
pop ecx
add edx, VGA_LINE
mov edi, edx
loop .OuterLoop
mov edi, VGA_FB + 15 * VGA_LINE
mov esi, [ebp + 10 * 4] ; EIP
sub esi, 32 * 4 ; code preceding EIP
mov ecx, 8
.OuterLoop1:
push ecx
mov ecx, 8
mov edx, edi
.InnerLoop1:
mov eax, [esi]
call PrintDword
add esi, 4
mov byte [edi], ' '
add edi, 2
loop .InnerLoop1
pop ecx
add edx, VGA_LINE
mov edi, edx
loop .OuterLoop1
.Halt:
hlt
jmp .Halt
;
; Return
;
mov esp, ebp
popad
add esp, 8 ; error code and INT number
iretd
PrintString:
push eax
.loop:
mov al, [esi]
test al, al
jz .done
mov [edi], al
inc esi
add edi, 2
jmp .loop
.done:
pop eax
ret
; EAX contains dword to print
; EDI contains memory location (screen location) to print it to
PrintDword:
push ecx
push ebx
push eax
mov ecx, 8
.looptop:
rol eax, 4
mov bl, al
and bl, 15
add bl, '0'
cmp bl, '9'
jbe .is_digit
add bl, 7
.is_digit:
mov [edi], bl
add edi, 2
loop .looptop
pop eax
pop ebx
pop ecx
ret
ClearScreen:
push eax
push ecx
mov ax, 0x0c20
mov edi, VGA_FB
mov ecx, 80 * 25
rep stosw
mov edi, VGA_FB
pop ecx
pop eax
ret
A2C:
and al, 15
add al, '0'
cmp al, '9'
jbe .is_digit
add al, 7
.is_digit:
ret
String1: db '*** INT ', 0
Int0String: db '00h Divide by 0 -', 0
Int1String: db '01h Debug exception -', 0
Int2String: db '02h NMI -', 0
Int3String: db '03h Breakpoint -', 0
Int4String: db '04h Overflow -', 0
Int5String: db '05h Bound -', 0
Int6String: db '06h Invalid opcode -', 0
Int7String: db '07h Device not available -', 0
Int8String: db '08h Double fault -', 0
Int9String: db '09h Coprocessor seg overrun (reserved) -', 0
Int10String: db '0Ah Invalid TSS -', 0
Int11String: db '0Bh Segment not present -', 0
Int12String: db '0Ch Stack fault -', 0
Int13String: db '0Dh General protection fault -', 0
Int14String: db '0Eh Page fault -', 0
Int15String: db '0Fh (Intel reserved) -', 0
Int16String: db '10h Floating point error -', 0
Int17String: db '11h Alignment check -', 0
Int18String: db '12h Machine check -', 0
Int19String: db '13h SIMD Floating-Point Exception -', 0
IntUnknownString: db '??h Unknown interrupt -', 0
align 4, db 0
StringTable:
%assign i 0
%rep 20
dd Int%[i]String
%assign i i+1
%endrep
String2: db ' HALT!! *** (', 0
String3: db ')', 0
StringEax: db 'EAX=', 0
StringEbx: db ' EBX=', 0
StringEcx: db ' ECX=', 0
StringEdx: db ' EDX=', 0
StringEcode: db ' ECODE=', 0
StringEsp: db 'ESP=', 0
StringEbp: db ' EBP=', 0
StringEsi: db ' ESI=', 0
StringEdi: db ' EDI=', 0
StringEflags: db ' EFLAGS=', 0
align 2, db 0
Idtr:
times SIZE - 2 - $ + $$ db 0
BlockSignature:
dw 0xaa55
| 20.466993 | 96 | 0.690479 |
e929f9d2d33ca0b0507d12551f94254ced2223a4 | 744 | asm | Assembly | cards/bn4/ModCards/134-A029 PET Screen Color Pink (0F).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | 10 | 2017-12-05T14:25:38.000Z | 2022-02-21T04:28:00.000Z | cards/bn4/ModCards/134-A029 PET Screen Color Pink (0F).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | cards/bn4/ModCards/134-A029 PET Screen Color Pink (0F).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | .include "defaults_mod.asm"
table_file_jp equ "exe4-utf8.tbl"
table_file_en equ "bn4-utf8.tbl"
game_code_len equ 3
game_code equ 0x4234574A // B4WJ
game_code_2 equ 0x42345745 // B4WE
game_code_3 equ 0x42345750 // B4WP
card_type equ 1
card_id equ 29
card_no equ "029"
card_sub equ "Mod Card 029"
card_sub_x equ 64
card_desc_len equ 3
card_desc_1 equ "Address 0F"
card_desc_2 equ "PET Screen Color:"
card_desc_3 equ "Pink"
card_name_jp_full equ "PET画面カラー:ピンク"
card_name_jp_game equ "PET画面カラー:ピンク"
card_name_en_full equ "PET Screen Color: Pink"
card_name_en_game equ "PET Scrn Color: Pink"
card_address equ "0F"
card_address_id equ 5
card_bug equ 0
card_wrote_en equ "PET Scrn Color: Pink"
card_wrote_jp equ "PET画面カラー:ピンク" | 27.555556 | 46 | 0.775538 |
d305cedeed575ff1d7f1746d288db1394c29a149 | 504 | asm | Assembly | tests/roms/simplified_state_changes.asm | AndreaOrru/Gilgamesh | c688dcecd80236d2e62641ee4d157e1ef042c7d9 | [
"BSD-2-Clause"
] | 25 | 2015-11-27T01:47:24.000Z | 2018-09-17T12:57:45.000Z | tests/roms/simplified_state_changes.asm | AndreaOrru/gilgamesh | c688dcecd80236d2e62641ee4d157e1ef042c7d9 | [
"BSD-2-Clause"
] | 122 | 2019-08-11T18:54:09.000Z | 2020-05-31T08:43:44.000Z | tests/roms/simplified_state_changes.asm | AndreaOrru/Gilgamesh | c688dcecd80236d2e62641ee4d157e1ef042c7d9 | [
"BSD-2-Clause"
] | null | null | null | incsrc lorom.asm
org $8000
reset:
rep #$30 ; $008000
jsr double_state_change ; $008002
lda #$FFFF ; $008005
ldx #$FFFF ; $008008
.loop:
jmp .loop ; $00800B
double_state_change:
bcs .return2 ; $00800E
.return1:
rep #$20 ; $008010
rts ; $008012
.return2:
rep #$10 ; $008013
rts ; $008015
| 25.2 | 41 | 0.390873 |
b268ef2bc02fe80ae2209e3a83825f3c36b041cb | 142 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/lam32/z80/asm__dtoa_base10.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/am9511/lam32/z80/asm__dtoa_base10.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/am9511/lam32/z80/asm__dtoa_base10.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_fp_am9511
PUBLIC __dtoa_base10
EXTERN asm_am9511__dtoa_base10
defc __dtoa_base10 = asm_am9511__dtoa_base10
| 14.2 | 44 | 0.880282 |
eddbd228209ea912ffa563b5b2041db5a1ff2d2e | 689 | asm | Assembly | oeis/164/A164055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/164/A164055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/164/A164055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A164055: Triangular numbers that are one plus a perfect square.
; Submitted by Jamie Morken(m4)
; 1,10,325,11026,374545,12723490,432224101,14682895930,498786237505,16944049179226,575598885856165,19553418069930370,664240615491776401,22564627508650467250,766533094678624110085,26039560591564569275626,884578527018516731261185,30049630358038004293604650,1020802853646273629251296901,34677247393615265390250489970,1178005608529272749639265362065,40017513442601658222344771820226,1359417451439927106810082976525605,46180175835514919973320476430050330,1568766560956067351986086115645185601
seq $0,3499 ; a(n) = 6*a(n-1) - a(n-2), with a(0) = 2, a(1) = 6.
pow $0,2
div $0,32
mul $0,9
add $0,1
| 68.9 | 487 | 0.849057 |
a69423d6bb76947713abfdd432847dd89ee26481 | 234 | asm | Assembly | data/mapHeaders/SSAnne1F.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | data/mapHeaders/SSAnne1F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | data/mapHeaders/SSAnne1F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | SSAnne1F_h:
db SHIP ; tileset
db SS_ANNE_1F_HEIGHT, SS_ANNE_1F_WIDTH ; dimensions (y, x)
dw SSAnne1F_Blocks ; blocks
dw SSAnne1F_TextPointers ; texts
dw SSAnne1F_Script ; scripts
db 0 ; connections
dw SSAnne1F_Object ; objects
| 26 | 59 | 0.782051 |
d571d39fd94e4634e05132adda37ffebcaf046bb | 524 | asm | Assembly | programs/oeis/113/A113801.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/113/A113801.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/113/A113801.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A113801: Numbers that are congruent to {1, 13} mod 14.
; 1,13,15,27,29,41,43,55,57,69,71,83,85,97,99,111,113,125,127,139,141,153,155,167,169,181,183,195,197,209,211,223,225,237,239,251,253,265,267,279,281,293,295,307,309,321,323,335,337,349,351,363,365,377,379,391,393,405,407,419,421,433,435,447,449,461,463,475,477,489,491,503,505,517,519,531,533,545,547,559,561,573,575,587,589,601,603,615,617,629,631,643,645,657,659,671,673,685,687,699
mov $1,32
add $1,$0
div $0,2
mul $0,10
mul $1,12
sub $1,$0
sub $1,383
mov $0,$1
| 43.666667 | 385 | 0.704198 |
f18020bbf17ad46faf3bb5778fc79820f43f9d2d | 46,960 | asm | Assembly | echo.asm | PieMyth/cs333 | 85b46a2f677ed49065504aa051f918b3f803e294 | [
"MIT-0"
] | null | null | null | echo.asm | PieMyth/cs333 | 85b46a2f677ed49065504aa051f918b3f803e294 | [
"MIT-0"
] | null | null | null | echo.asm | PieMyth/cs333 | 85b46a2f677ed49065504aa051f918b3f803e294 | [
"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 1c 09 00 00 mov $0x91c,%edx
2c: eb 05 jmp 33 <main+0x33>
2e: ba 1e 09 00 00 mov $0x91e,%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 20 09 00 00 push $0x920
4b: 6a 01 push $0x1
4d: e8 14 05 00 00 call 566 <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 2a 03 00 00 call 38f <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 1a 02 00 00 call 3a7 <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 df 01 00 00 call 3cf <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 d6 01 00 00 call 3e7 <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 95 01 00 00 call 3b7 <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, sign;
n = 0;
230: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s == ' ') s++;
237: eb 04 jmp 23d <atoi+0x13>
239: 83 45 08 01 addl $0x1,0x8(%ebp)
23d: 8b 45 08 mov 0x8(%ebp),%eax
240: 0f b6 00 movzbl (%eax),%eax
243: 3c 20 cmp $0x20,%al
245: 74 f2 je 239 <atoi+0xf>
sign = (*s == '-') ? -1 : 1;
247: 8b 45 08 mov 0x8(%ebp),%eax
24a: 0f b6 00 movzbl (%eax),%eax
24d: 3c 2d cmp $0x2d,%al
24f: 75 07 jne 258 <atoi+0x2e>
251: b8 ff ff ff ff mov $0xffffffff,%eax
256: eb 05 jmp 25d <atoi+0x33>
258: b8 01 00 00 00 mov $0x1,%eax
25d: 89 45 f8 mov %eax,-0x8(%ebp)
if (*s == '+' || *s == '-')
260: 8b 45 08 mov 0x8(%ebp),%eax
263: 0f b6 00 movzbl (%eax),%eax
266: 3c 2b cmp $0x2b,%al
268: 74 0a je 274 <atoi+0x4a>
26a: 8b 45 08 mov 0x8(%ebp),%eax
26d: 0f b6 00 movzbl (%eax),%eax
270: 3c 2d cmp $0x2d,%al
272: 75 2b jne 29f <atoi+0x75>
s++;
274: 83 45 08 01 addl $0x1,0x8(%ebp)
while('0' <= *s && *s <= '9')
278: eb 25 jmp 29f <atoi+0x75>
n = n*10 + *s++ - '0';
27a: 8b 55 fc mov -0x4(%ebp),%edx
27d: 89 d0 mov %edx,%eax
27f: c1 e0 02 shl $0x2,%eax
282: 01 d0 add %edx,%eax
284: 01 c0 add %eax,%eax
286: 89 c1 mov %eax,%ecx
288: 8b 45 08 mov 0x8(%ebp),%eax
28b: 8d 50 01 lea 0x1(%eax),%edx
28e: 89 55 08 mov %edx,0x8(%ebp)
291: 0f b6 00 movzbl (%eax),%eax
294: 0f be c0 movsbl %al,%eax
297: 01 c8 add %ecx,%eax
299: 83 e8 30 sub $0x30,%eax
29c: 89 45 fc mov %eax,-0x4(%ebp)
n = 0;
while (*s == ' ') s++;
sign = (*s == '-') ? -1 : 1;
if (*s == '+' || *s == '-')
s++;
while('0' <= *s && *s <= '9')
29f: 8b 45 08 mov 0x8(%ebp),%eax
2a2: 0f b6 00 movzbl (%eax),%eax
2a5: 3c 2f cmp $0x2f,%al
2a7: 7e 0a jle 2b3 <atoi+0x89>
2a9: 8b 45 08 mov 0x8(%ebp),%eax
2ac: 0f b6 00 movzbl (%eax),%eax
2af: 3c 39 cmp $0x39,%al
2b1: 7e c7 jle 27a <atoi+0x50>
n = n*10 + *s++ - '0';
return sign*n;
2b3: 8b 45 f8 mov -0x8(%ebp),%eax
2b6: 0f af 45 fc imul -0x4(%ebp),%eax
}
2ba: c9 leave
2bb: c3 ret
000002bc <atoo>:
int
atoo(const char *s)
{
2bc: 55 push %ebp
2bd: 89 e5 mov %esp,%ebp
2bf: 83 ec 10 sub $0x10,%esp
int n, sign;
n = 0;
2c2: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s == ' ') s++;
2c9: eb 04 jmp 2cf <atoo+0x13>
2cb: 83 45 08 01 addl $0x1,0x8(%ebp)
2cf: 8b 45 08 mov 0x8(%ebp),%eax
2d2: 0f b6 00 movzbl (%eax),%eax
2d5: 3c 20 cmp $0x20,%al
2d7: 74 f2 je 2cb <atoo+0xf>
sign = (*s == '-') ? -1 : 1;
2d9: 8b 45 08 mov 0x8(%ebp),%eax
2dc: 0f b6 00 movzbl (%eax),%eax
2df: 3c 2d cmp $0x2d,%al
2e1: 75 07 jne 2ea <atoo+0x2e>
2e3: b8 ff ff ff ff mov $0xffffffff,%eax
2e8: eb 05 jmp 2ef <atoo+0x33>
2ea: b8 01 00 00 00 mov $0x1,%eax
2ef: 89 45 f8 mov %eax,-0x8(%ebp)
if (*s == '+' || *s == '-')
2f2: 8b 45 08 mov 0x8(%ebp),%eax
2f5: 0f b6 00 movzbl (%eax),%eax
2f8: 3c 2b cmp $0x2b,%al
2fa: 74 0a je 306 <atoo+0x4a>
2fc: 8b 45 08 mov 0x8(%ebp),%eax
2ff: 0f b6 00 movzbl (%eax),%eax
302: 3c 2d cmp $0x2d,%al
304: 75 27 jne 32d <atoo+0x71>
s++;
306: 83 45 08 01 addl $0x1,0x8(%ebp)
while('0' <= *s && *s <= '7')
30a: eb 21 jmp 32d <atoo+0x71>
n = n*8 + *s++ - '0';
30c: 8b 45 fc mov -0x4(%ebp),%eax
30f: 8d 0c c5 00 00 00 00 lea 0x0(,%eax,8),%ecx
316: 8b 45 08 mov 0x8(%ebp),%eax
319: 8d 50 01 lea 0x1(%eax),%edx
31c: 89 55 08 mov %edx,0x8(%ebp)
31f: 0f b6 00 movzbl (%eax),%eax
322: 0f be c0 movsbl %al,%eax
325: 01 c8 add %ecx,%eax
327: 83 e8 30 sub $0x30,%eax
32a: 89 45 fc mov %eax,-0x4(%ebp)
n = 0;
while (*s == ' ') s++;
sign = (*s == '-') ? -1 : 1;
if (*s == '+' || *s == '-')
s++;
while('0' <= *s && *s <= '7')
32d: 8b 45 08 mov 0x8(%ebp),%eax
330: 0f b6 00 movzbl (%eax),%eax
333: 3c 2f cmp $0x2f,%al
335: 7e 0a jle 341 <atoo+0x85>
337: 8b 45 08 mov 0x8(%ebp),%eax
33a: 0f b6 00 movzbl (%eax),%eax
33d: 3c 37 cmp $0x37,%al
33f: 7e cb jle 30c <atoo+0x50>
n = n*8 + *s++ - '0';
return sign*n;
341: 8b 45 f8 mov -0x8(%ebp),%eax
344: 0f af 45 fc imul -0x4(%ebp),%eax
}
348: c9 leave
349: c3 ret
0000034a <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
34a: 55 push %ebp
34b: 89 e5 mov %esp,%ebp
34d: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
350: 8b 45 08 mov 0x8(%ebp),%eax
353: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
356: 8b 45 0c mov 0xc(%ebp),%eax
359: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
35c: eb 17 jmp 375 <memmove+0x2b>
*dst++ = *src++;
35e: 8b 45 fc mov -0x4(%ebp),%eax
361: 8d 50 01 lea 0x1(%eax),%edx
364: 89 55 fc mov %edx,-0x4(%ebp)
367: 8b 55 f8 mov -0x8(%ebp),%edx
36a: 8d 4a 01 lea 0x1(%edx),%ecx
36d: 89 4d f8 mov %ecx,-0x8(%ebp)
370: 0f b6 12 movzbl (%edx),%edx
373: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
375: 8b 45 10 mov 0x10(%ebp),%eax
378: 8d 50 ff lea -0x1(%eax),%edx
37b: 89 55 10 mov %edx,0x10(%ebp)
37e: 85 c0 test %eax,%eax
380: 7f dc jg 35e <memmove+0x14>
*dst++ = *src++;
return vdst;
382: 8b 45 08 mov 0x8(%ebp),%eax
}
385: c9 leave
386: c3 ret
00000387 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
387: b8 01 00 00 00 mov $0x1,%eax
38c: cd 40 int $0x40
38e: c3 ret
0000038f <exit>:
SYSCALL(exit)
38f: b8 02 00 00 00 mov $0x2,%eax
394: cd 40 int $0x40
396: c3 ret
00000397 <wait>:
SYSCALL(wait)
397: b8 03 00 00 00 mov $0x3,%eax
39c: cd 40 int $0x40
39e: c3 ret
0000039f <pipe>:
SYSCALL(pipe)
39f: b8 04 00 00 00 mov $0x4,%eax
3a4: cd 40 int $0x40
3a6: c3 ret
000003a7 <read>:
SYSCALL(read)
3a7: b8 05 00 00 00 mov $0x5,%eax
3ac: cd 40 int $0x40
3ae: c3 ret
000003af <write>:
SYSCALL(write)
3af: b8 10 00 00 00 mov $0x10,%eax
3b4: cd 40 int $0x40
3b6: c3 ret
000003b7 <close>:
SYSCALL(close)
3b7: b8 15 00 00 00 mov $0x15,%eax
3bc: cd 40 int $0x40
3be: c3 ret
000003bf <kill>:
SYSCALL(kill)
3bf: b8 06 00 00 00 mov $0x6,%eax
3c4: cd 40 int $0x40
3c6: c3 ret
000003c7 <exec>:
SYSCALL(exec)
3c7: b8 07 00 00 00 mov $0x7,%eax
3cc: cd 40 int $0x40
3ce: c3 ret
000003cf <open>:
SYSCALL(open)
3cf: b8 0f 00 00 00 mov $0xf,%eax
3d4: cd 40 int $0x40
3d6: c3 ret
000003d7 <mknod>:
SYSCALL(mknod)
3d7: b8 11 00 00 00 mov $0x11,%eax
3dc: cd 40 int $0x40
3de: c3 ret
000003df <unlink>:
SYSCALL(unlink)
3df: b8 12 00 00 00 mov $0x12,%eax
3e4: cd 40 int $0x40
3e6: c3 ret
000003e7 <fstat>:
SYSCALL(fstat)
3e7: b8 08 00 00 00 mov $0x8,%eax
3ec: cd 40 int $0x40
3ee: c3 ret
000003ef <link>:
SYSCALL(link)
3ef: b8 13 00 00 00 mov $0x13,%eax
3f4: cd 40 int $0x40
3f6: c3 ret
000003f7 <mkdir>:
SYSCALL(mkdir)
3f7: b8 14 00 00 00 mov $0x14,%eax
3fc: cd 40 int $0x40
3fe: c3 ret
000003ff <chdir>:
SYSCALL(chdir)
3ff: b8 09 00 00 00 mov $0x9,%eax
404: cd 40 int $0x40
406: c3 ret
00000407 <dup>:
SYSCALL(dup)
407: b8 0a 00 00 00 mov $0xa,%eax
40c: cd 40 int $0x40
40e: c3 ret
0000040f <getpid>:
SYSCALL(getpid)
40f: b8 0b 00 00 00 mov $0xb,%eax
414: cd 40 int $0x40
416: c3 ret
00000417 <sbrk>:
SYSCALL(sbrk)
417: b8 0c 00 00 00 mov $0xc,%eax
41c: cd 40 int $0x40
41e: c3 ret
0000041f <sleep>:
SYSCALL(sleep)
41f: b8 0d 00 00 00 mov $0xd,%eax
424: cd 40 int $0x40
426: c3 ret
00000427 <uptime>:
SYSCALL(uptime)
427: b8 0e 00 00 00 mov $0xe,%eax
42c: cd 40 int $0x40
42e: c3 ret
0000042f <halt>:
SYSCALL(halt)
42f: b8 16 00 00 00 mov $0x16,%eax
434: cd 40 int $0x40
436: c3 ret
00000437 <date>:
SYSCALL(date)
437: b8 17 00 00 00 mov $0x17,%eax
43c: cd 40 int $0x40
43e: c3 ret
0000043f <getuid>:
SYSCALL(getuid)
43f: b8 18 00 00 00 mov $0x18,%eax
444: cd 40 int $0x40
446: c3 ret
00000447 <getgid>:
SYSCALL(getgid)
447: b8 19 00 00 00 mov $0x19,%eax
44c: cd 40 int $0x40
44e: c3 ret
0000044f <getppid>:
SYSCALL(getppid)
44f: b8 1a 00 00 00 mov $0x1a,%eax
454: cd 40 int $0x40
456: c3 ret
00000457 <setuid>:
SYSCALL(setuid)
457: b8 1b 00 00 00 mov $0x1b,%eax
45c: cd 40 int $0x40
45e: c3 ret
0000045f <setgid>:
SYSCALL(setgid)
45f: b8 1c 00 00 00 mov $0x1c,%eax
464: cd 40 int $0x40
466: c3 ret
00000467 <getprocs>:
SYSCALL(getprocs)
467: b8 1d 00 00 00 mov $0x1d,%eax
46c: cd 40 int $0x40
46e: c3 ret
0000046f <setpriority>:
SYSCALL(setpriority)
46f: b8 1e 00 00 00 mov $0x1e,%eax
474: cd 40 int $0x40
476: c3 ret
00000477 <chmod>:
SYSCALL(chmod)
477: b8 1f 00 00 00 mov $0x1f,%eax
47c: cd 40 int $0x40
47e: c3 ret
0000047f <chown>:
SYSCALL(chown)
47f: b8 20 00 00 00 mov $0x20,%eax
484: cd 40 int $0x40
486: c3 ret
00000487 <chgrp>:
SYSCALL(chgrp)
487: b8 21 00 00 00 mov $0x21,%eax
48c: cd 40 int $0x40
48e: c3 ret
0000048f <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
48f: 55 push %ebp
490: 89 e5 mov %esp,%ebp
492: 83 ec 18 sub $0x18,%esp
495: 8b 45 0c mov 0xc(%ebp),%eax
498: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
49b: 83 ec 04 sub $0x4,%esp
49e: 6a 01 push $0x1
4a0: 8d 45 f4 lea -0xc(%ebp),%eax
4a3: 50 push %eax
4a4: ff 75 08 pushl 0x8(%ebp)
4a7: e8 03 ff ff ff call 3af <write>
4ac: 83 c4 10 add $0x10,%esp
}
4af: 90 nop
4b0: c9 leave
4b1: c3 ret
000004b2 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4b2: 55 push %ebp
4b3: 89 e5 mov %esp,%ebp
4b5: 53 push %ebx
4b6: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
4b9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
4c0: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
4c4: 74 17 je 4dd <printint+0x2b>
4c6: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
4ca: 79 11 jns 4dd <printint+0x2b>
neg = 1;
4cc: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
4d3: 8b 45 0c mov 0xc(%ebp),%eax
4d6: f7 d8 neg %eax
4d8: 89 45 ec mov %eax,-0x14(%ebp)
4db: eb 06 jmp 4e3 <printint+0x31>
} else {
x = xx;
4dd: 8b 45 0c mov 0xc(%ebp),%eax
4e0: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
4e3: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
4ea: 8b 4d f4 mov -0xc(%ebp),%ecx
4ed: 8d 41 01 lea 0x1(%ecx),%eax
4f0: 89 45 f4 mov %eax,-0xc(%ebp)
4f3: 8b 5d 10 mov 0x10(%ebp),%ebx
4f6: 8b 45 ec mov -0x14(%ebp),%eax
4f9: ba 00 00 00 00 mov $0x0,%edx
4fe: f7 f3 div %ebx
500: 89 d0 mov %edx,%eax
502: 0f b6 80 98 0b 00 00 movzbl 0xb98(%eax),%eax
509: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
50d: 8b 5d 10 mov 0x10(%ebp),%ebx
510: 8b 45 ec mov -0x14(%ebp),%eax
513: ba 00 00 00 00 mov $0x0,%edx
518: f7 f3 div %ebx
51a: 89 45 ec mov %eax,-0x14(%ebp)
51d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
521: 75 c7 jne 4ea <printint+0x38>
if(neg)
523: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
527: 74 2d je 556 <printint+0xa4>
buf[i++] = '-';
529: 8b 45 f4 mov -0xc(%ebp),%eax
52c: 8d 50 01 lea 0x1(%eax),%edx
52f: 89 55 f4 mov %edx,-0xc(%ebp)
532: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
537: eb 1d jmp 556 <printint+0xa4>
putc(fd, buf[i]);
539: 8d 55 dc lea -0x24(%ebp),%edx
53c: 8b 45 f4 mov -0xc(%ebp),%eax
53f: 01 d0 add %edx,%eax
541: 0f b6 00 movzbl (%eax),%eax
544: 0f be c0 movsbl %al,%eax
547: 83 ec 08 sub $0x8,%esp
54a: 50 push %eax
54b: ff 75 08 pushl 0x8(%ebp)
54e: e8 3c ff ff ff call 48f <putc>
553: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
556: 83 6d f4 01 subl $0x1,-0xc(%ebp)
55a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
55e: 79 d9 jns 539 <printint+0x87>
putc(fd, buf[i]);
}
560: 90 nop
561: 8b 5d fc mov -0x4(%ebp),%ebx
564: c9 leave
565: c3 ret
00000566 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
566: 55 push %ebp
567: 89 e5 mov %esp,%ebp
569: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
56c: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
573: 8d 45 0c lea 0xc(%ebp),%eax
576: 83 c0 04 add $0x4,%eax
579: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
57c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
583: e9 59 01 00 00 jmp 6e1 <printf+0x17b>
c = fmt[i] & 0xff;
588: 8b 55 0c mov 0xc(%ebp),%edx
58b: 8b 45 f0 mov -0x10(%ebp),%eax
58e: 01 d0 add %edx,%eax
590: 0f b6 00 movzbl (%eax),%eax
593: 0f be c0 movsbl %al,%eax
596: 25 ff 00 00 00 and $0xff,%eax
59b: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
59e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
5a2: 75 2c jne 5d0 <printf+0x6a>
if(c == '%'){
5a4: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
5a8: 75 0c jne 5b6 <printf+0x50>
state = '%';
5aa: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
5b1: e9 27 01 00 00 jmp 6dd <printf+0x177>
} else {
putc(fd, c);
5b6: 8b 45 e4 mov -0x1c(%ebp),%eax
5b9: 0f be c0 movsbl %al,%eax
5bc: 83 ec 08 sub $0x8,%esp
5bf: 50 push %eax
5c0: ff 75 08 pushl 0x8(%ebp)
5c3: e8 c7 fe ff ff call 48f <putc>
5c8: 83 c4 10 add $0x10,%esp
5cb: e9 0d 01 00 00 jmp 6dd <printf+0x177>
}
} else if(state == '%'){
5d0: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
5d4: 0f 85 03 01 00 00 jne 6dd <printf+0x177>
if(c == 'd'){
5da: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
5de: 75 1e jne 5fe <printf+0x98>
printint(fd, *ap, 10, 1);
5e0: 8b 45 e8 mov -0x18(%ebp),%eax
5e3: 8b 00 mov (%eax),%eax
5e5: 6a 01 push $0x1
5e7: 6a 0a push $0xa
5e9: 50 push %eax
5ea: ff 75 08 pushl 0x8(%ebp)
5ed: e8 c0 fe ff ff call 4b2 <printint>
5f2: 83 c4 10 add $0x10,%esp
ap++;
5f5: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5f9: e9 d8 00 00 00 jmp 6d6 <printf+0x170>
} else if(c == 'x' || c == 'p'){
5fe: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
602: 74 06 je 60a <printf+0xa4>
604: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
608: 75 1e jne 628 <printf+0xc2>
printint(fd, *ap, 16, 0);
60a: 8b 45 e8 mov -0x18(%ebp),%eax
60d: 8b 00 mov (%eax),%eax
60f: 6a 00 push $0x0
611: 6a 10 push $0x10
613: 50 push %eax
614: ff 75 08 pushl 0x8(%ebp)
617: e8 96 fe ff ff call 4b2 <printint>
61c: 83 c4 10 add $0x10,%esp
ap++;
61f: 83 45 e8 04 addl $0x4,-0x18(%ebp)
623: e9 ae 00 00 00 jmp 6d6 <printf+0x170>
} else if(c == 's'){
628: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
62c: 75 43 jne 671 <printf+0x10b>
s = (char*)*ap;
62e: 8b 45 e8 mov -0x18(%ebp),%eax
631: 8b 00 mov (%eax),%eax
633: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
636: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
63a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
63e: 75 25 jne 665 <printf+0xff>
s = "(null)";
640: c7 45 f4 25 09 00 00 movl $0x925,-0xc(%ebp)
while(*s != 0){
647: eb 1c jmp 665 <printf+0xff>
putc(fd, *s);
649: 8b 45 f4 mov -0xc(%ebp),%eax
64c: 0f b6 00 movzbl (%eax),%eax
64f: 0f be c0 movsbl %al,%eax
652: 83 ec 08 sub $0x8,%esp
655: 50 push %eax
656: ff 75 08 pushl 0x8(%ebp)
659: e8 31 fe ff ff call 48f <putc>
65e: 83 c4 10 add $0x10,%esp
s++;
661: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
665: 8b 45 f4 mov -0xc(%ebp),%eax
668: 0f b6 00 movzbl (%eax),%eax
66b: 84 c0 test %al,%al
66d: 75 da jne 649 <printf+0xe3>
66f: eb 65 jmp 6d6 <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
671: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
675: 75 1d jne 694 <printf+0x12e>
putc(fd, *ap);
677: 8b 45 e8 mov -0x18(%ebp),%eax
67a: 8b 00 mov (%eax),%eax
67c: 0f be c0 movsbl %al,%eax
67f: 83 ec 08 sub $0x8,%esp
682: 50 push %eax
683: ff 75 08 pushl 0x8(%ebp)
686: e8 04 fe ff ff call 48f <putc>
68b: 83 c4 10 add $0x10,%esp
ap++;
68e: 83 45 e8 04 addl $0x4,-0x18(%ebp)
692: eb 42 jmp 6d6 <printf+0x170>
} else if(c == '%'){
694: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
698: 75 17 jne 6b1 <printf+0x14b>
putc(fd, c);
69a: 8b 45 e4 mov -0x1c(%ebp),%eax
69d: 0f be c0 movsbl %al,%eax
6a0: 83 ec 08 sub $0x8,%esp
6a3: 50 push %eax
6a4: ff 75 08 pushl 0x8(%ebp)
6a7: e8 e3 fd ff ff call 48f <putc>
6ac: 83 c4 10 add $0x10,%esp
6af: eb 25 jmp 6d6 <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
6b1: 83 ec 08 sub $0x8,%esp
6b4: 6a 25 push $0x25
6b6: ff 75 08 pushl 0x8(%ebp)
6b9: e8 d1 fd ff ff call 48f <putc>
6be: 83 c4 10 add $0x10,%esp
putc(fd, c);
6c1: 8b 45 e4 mov -0x1c(%ebp),%eax
6c4: 0f be c0 movsbl %al,%eax
6c7: 83 ec 08 sub $0x8,%esp
6ca: 50 push %eax
6cb: ff 75 08 pushl 0x8(%ebp)
6ce: e8 bc fd ff ff call 48f <putc>
6d3: 83 c4 10 add $0x10,%esp
}
state = 0;
6d6: 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++){
6dd: 83 45 f0 01 addl $0x1,-0x10(%ebp)
6e1: 8b 55 0c mov 0xc(%ebp),%edx
6e4: 8b 45 f0 mov -0x10(%ebp),%eax
6e7: 01 d0 add %edx,%eax
6e9: 0f b6 00 movzbl (%eax),%eax
6ec: 84 c0 test %al,%al
6ee: 0f 85 94 fe ff ff jne 588 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
6f4: 90 nop
6f5: c9 leave
6f6: c3 ret
000006f7 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6f7: 55 push %ebp
6f8: 89 e5 mov %esp,%ebp
6fa: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
6fd: 8b 45 08 mov 0x8(%ebp),%eax
700: 83 e8 08 sub $0x8,%eax
703: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
706: a1 b4 0b 00 00 mov 0xbb4,%eax
70b: 89 45 fc mov %eax,-0x4(%ebp)
70e: eb 24 jmp 734 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
710: 8b 45 fc mov -0x4(%ebp),%eax
713: 8b 00 mov (%eax),%eax
715: 3b 45 fc cmp -0x4(%ebp),%eax
718: 77 12 ja 72c <free+0x35>
71a: 8b 45 f8 mov -0x8(%ebp),%eax
71d: 3b 45 fc cmp -0x4(%ebp),%eax
720: 77 24 ja 746 <free+0x4f>
722: 8b 45 fc mov -0x4(%ebp),%eax
725: 8b 00 mov (%eax),%eax
727: 3b 45 f8 cmp -0x8(%ebp),%eax
72a: 77 1a ja 746 <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)
72c: 8b 45 fc mov -0x4(%ebp),%eax
72f: 8b 00 mov (%eax),%eax
731: 89 45 fc mov %eax,-0x4(%ebp)
734: 8b 45 f8 mov -0x8(%ebp),%eax
737: 3b 45 fc cmp -0x4(%ebp),%eax
73a: 76 d4 jbe 710 <free+0x19>
73c: 8b 45 fc mov -0x4(%ebp),%eax
73f: 8b 00 mov (%eax),%eax
741: 3b 45 f8 cmp -0x8(%ebp),%eax
744: 76 ca jbe 710 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
746: 8b 45 f8 mov -0x8(%ebp),%eax
749: 8b 40 04 mov 0x4(%eax),%eax
74c: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
753: 8b 45 f8 mov -0x8(%ebp),%eax
756: 01 c2 add %eax,%edx
758: 8b 45 fc mov -0x4(%ebp),%eax
75b: 8b 00 mov (%eax),%eax
75d: 39 c2 cmp %eax,%edx
75f: 75 24 jne 785 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
761: 8b 45 f8 mov -0x8(%ebp),%eax
764: 8b 50 04 mov 0x4(%eax),%edx
767: 8b 45 fc mov -0x4(%ebp),%eax
76a: 8b 00 mov (%eax),%eax
76c: 8b 40 04 mov 0x4(%eax),%eax
76f: 01 c2 add %eax,%edx
771: 8b 45 f8 mov -0x8(%ebp),%eax
774: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
777: 8b 45 fc mov -0x4(%ebp),%eax
77a: 8b 00 mov (%eax),%eax
77c: 8b 10 mov (%eax),%edx
77e: 8b 45 f8 mov -0x8(%ebp),%eax
781: 89 10 mov %edx,(%eax)
783: eb 0a jmp 78f <free+0x98>
} else
bp->s.ptr = p->s.ptr;
785: 8b 45 fc mov -0x4(%ebp),%eax
788: 8b 10 mov (%eax),%edx
78a: 8b 45 f8 mov -0x8(%ebp),%eax
78d: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
78f: 8b 45 fc mov -0x4(%ebp),%eax
792: 8b 40 04 mov 0x4(%eax),%eax
795: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
79c: 8b 45 fc mov -0x4(%ebp),%eax
79f: 01 d0 add %edx,%eax
7a1: 3b 45 f8 cmp -0x8(%ebp),%eax
7a4: 75 20 jne 7c6 <free+0xcf>
p->s.size += bp->s.size;
7a6: 8b 45 fc mov -0x4(%ebp),%eax
7a9: 8b 50 04 mov 0x4(%eax),%edx
7ac: 8b 45 f8 mov -0x8(%ebp),%eax
7af: 8b 40 04 mov 0x4(%eax),%eax
7b2: 01 c2 add %eax,%edx
7b4: 8b 45 fc mov -0x4(%ebp),%eax
7b7: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
7ba: 8b 45 f8 mov -0x8(%ebp),%eax
7bd: 8b 10 mov (%eax),%edx
7bf: 8b 45 fc mov -0x4(%ebp),%eax
7c2: 89 10 mov %edx,(%eax)
7c4: eb 08 jmp 7ce <free+0xd7>
} else
p->s.ptr = bp;
7c6: 8b 45 fc mov -0x4(%ebp),%eax
7c9: 8b 55 f8 mov -0x8(%ebp),%edx
7cc: 89 10 mov %edx,(%eax)
freep = p;
7ce: 8b 45 fc mov -0x4(%ebp),%eax
7d1: a3 b4 0b 00 00 mov %eax,0xbb4
}
7d6: 90 nop
7d7: c9 leave
7d8: c3 ret
000007d9 <morecore>:
static Header*
morecore(uint nu)
{
7d9: 55 push %ebp
7da: 89 e5 mov %esp,%ebp
7dc: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
7df: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
7e6: 77 07 ja 7ef <morecore+0x16>
nu = 4096;
7e8: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
7ef: 8b 45 08 mov 0x8(%ebp),%eax
7f2: c1 e0 03 shl $0x3,%eax
7f5: 83 ec 0c sub $0xc,%esp
7f8: 50 push %eax
7f9: e8 19 fc ff ff call 417 <sbrk>
7fe: 83 c4 10 add $0x10,%esp
801: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
804: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
808: 75 07 jne 811 <morecore+0x38>
return 0;
80a: b8 00 00 00 00 mov $0x0,%eax
80f: eb 26 jmp 837 <morecore+0x5e>
hp = (Header*)p;
811: 8b 45 f4 mov -0xc(%ebp),%eax
814: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
817: 8b 45 f0 mov -0x10(%ebp),%eax
81a: 8b 55 08 mov 0x8(%ebp),%edx
81d: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
820: 8b 45 f0 mov -0x10(%ebp),%eax
823: 83 c0 08 add $0x8,%eax
826: 83 ec 0c sub $0xc,%esp
829: 50 push %eax
82a: e8 c8 fe ff ff call 6f7 <free>
82f: 83 c4 10 add $0x10,%esp
return freep;
832: a1 b4 0b 00 00 mov 0xbb4,%eax
}
837: c9 leave
838: c3 ret
00000839 <malloc>:
void*
malloc(uint nbytes)
{
839: 55 push %ebp
83a: 89 e5 mov %esp,%ebp
83c: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
83f: 8b 45 08 mov 0x8(%ebp),%eax
842: 83 c0 07 add $0x7,%eax
845: c1 e8 03 shr $0x3,%eax
848: 83 c0 01 add $0x1,%eax
84b: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
84e: a1 b4 0b 00 00 mov 0xbb4,%eax
853: 89 45 f0 mov %eax,-0x10(%ebp)
856: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
85a: 75 23 jne 87f <malloc+0x46>
base.s.ptr = freep = prevp = &base;
85c: c7 45 f0 ac 0b 00 00 movl $0xbac,-0x10(%ebp)
863: 8b 45 f0 mov -0x10(%ebp),%eax
866: a3 b4 0b 00 00 mov %eax,0xbb4
86b: a1 b4 0b 00 00 mov 0xbb4,%eax
870: a3 ac 0b 00 00 mov %eax,0xbac
base.s.size = 0;
875: c7 05 b0 0b 00 00 00 movl $0x0,0xbb0
87c: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
87f: 8b 45 f0 mov -0x10(%ebp),%eax
882: 8b 00 mov (%eax),%eax
884: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
887: 8b 45 f4 mov -0xc(%ebp),%eax
88a: 8b 40 04 mov 0x4(%eax),%eax
88d: 3b 45 ec cmp -0x14(%ebp),%eax
890: 72 4d jb 8df <malloc+0xa6>
if(p->s.size == nunits)
892: 8b 45 f4 mov -0xc(%ebp),%eax
895: 8b 40 04 mov 0x4(%eax),%eax
898: 3b 45 ec cmp -0x14(%ebp),%eax
89b: 75 0c jne 8a9 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
89d: 8b 45 f4 mov -0xc(%ebp),%eax
8a0: 8b 10 mov (%eax),%edx
8a2: 8b 45 f0 mov -0x10(%ebp),%eax
8a5: 89 10 mov %edx,(%eax)
8a7: eb 26 jmp 8cf <malloc+0x96>
else {
p->s.size -= nunits;
8a9: 8b 45 f4 mov -0xc(%ebp),%eax
8ac: 8b 40 04 mov 0x4(%eax),%eax
8af: 2b 45 ec sub -0x14(%ebp),%eax
8b2: 89 c2 mov %eax,%edx
8b4: 8b 45 f4 mov -0xc(%ebp),%eax
8b7: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
8ba: 8b 45 f4 mov -0xc(%ebp),%eax
8bd: 8b 40 04 mov 0x4(%eax),%eax
8c0: c1 e0 03 shl $0x3,%eax
8c3: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
8c6: 8b 45 f4 mov -0xc(%ebp),%eax
8c9: 8b 55 ec mov -0x14(%ebp),%edx
8cc: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
8cf: 8b 45 f0 mov -0x10(%ebp),%eax
8d2: a3 b4 0b 00 00 mov %eax,0xbb4
return (void*)(p + 1);
8d7: 8b 45 f4 mov -0xc(%ebp),%eax
8da: 83 c0 08 add $0x8,%eax
8dd: eb 3b jmp 91a <malloc+0xe1>
}
if(p == freep)
8df: a1 b4 0b 00 00 mov 0xbb4,%eax
8e4: 39 45 f4 cmp %eax,-0xc(%ebp)
8e7: 75 1e jne 907 <malloc+0xce>
if((p = morecore(nunits)) == 0)
8e9: 83 ec 0c sub $0xc,%esp
8ec: ff 75 ec pushl -0x14(%ebp)
8ef: e8 e5 fe ff ff call 7d9 <morecore>
8f4: 83 c4 10 add $0x10,%esp
8f7: 89 45 f4 mov %eax,-0xc(%ebp)
8fa: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8fe: 75 07 jne 907 <malloc+0xce>
return 0;
900: b8 00 00 00 00 mov $0x0,%eax
905: eb 13 jmp 91a <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){
907: 8b 45 f4 mov -0xc(%ebp),%eax
90a: 89 45 f0 mov %eax,-0x10(%ebp)
90d: 8b 45 f4 mov -0xc(%ebp),%eax
910: 8b 00 mov (%eax),%eax
912: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
915: e9 6d ff ff ff jmp 887 <malloc+0x4e>
}
91a: c9 leave
91b: c3 ret
| 34.302411 | 60 | 0.418931 |
167cea46bbf5f3218bb581d859eba0e5ba30b79e | 322 | asm | Assembly | spectranet/socklib/bind.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 40 | 2021-07-23T21:33:59.000Z | 2022-02-07T19:07:46.000Z | spectranet/socklib/bind.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | null | null | null | spectranet/socklib/bind.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 2 | 2021-08-02T17:49:03.000Z | 2021-10-09T21:53:41.000Z | ; CALLER linkage for bind()
PUBLIC bind
EXTERN bind_callee
EXTERN ASMDISP_BIND_CALLEE
; int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen);
.bind
pop hl ; return addr
pop bc ; addrlen
pop ix ; my_addr
pop af ; sockfd
push af
push ix
push bc
push hl
jp bind_callee + ASMDISP_BIND_CALLEE
| 17.888889 | 74 | 0.745342 |
6fe916bc2a4ee93d38aa9957662bfe0026b4a41d | 2,888 | asm | Assembly | binary16/fwst.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | 12 | 2020-02-17T09:07:02.000Z | 2022-02-09T22:15:34.000Z | binary16/fwst.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | null | null | null | binary16/fwst.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | 1 | 2021-06-21T23:30:28.000Z | 2021-06-21T23:30:28.000Z | if not defined @FWST
include "color_flow_warning.asm"
; Store Word. Convert absolute value of a floating-point number into unsigned 16-bit integer.
; In: HL = floating point to convert
; Out: HL = Word representation, set carry if overflow
; Pollutes: AF, B
@FWST:
if not defined FWST
; *****************************************
FWST ; *
; *****************************************
endif
LD A, H ; 1:4
LD B, H ; 1:4
AND MANT_MASK_HI ; 2:7
OR IMPBIT_MASK ; 2:7
LD H, A ; 1:4
LD A, B ; 1:4
AND EXP_MASK ; 2:7
CP BIAS+16*EXP_PLUS_ONE; 2:7
JR nc, FWST_OVERFLOW ; 2:7/12
SUB BIAS-EXP_PLUS_ONE ; 2:7
JR c, FWST_ZERO ; 2:7/12
RRCA ; 1:4
RRCA ; 1:4
SUB $0B ; 2:7
JR nc, FWST_1024PLUS ; 2:7
DEC HL ; 1:6 rounding ( 0.5000 down => 0.4999 down )
NEG ; 2:8
LD B, A ; 1:4
if 0
SUB $08 ; 2:7
JR c, $+8 ; 2:12/7
LD B, A ; 1:4
ADD HL, HL ; 1:11 rounding
LD L, H ; 1:4
LD H, $00 ; 2:7
INC B ; 1:4
endif
SRL H ; 2:8
RR L ; 2:8
DJNZ $-4 ; 2:13/8 1..7
RET nc ; 1:11/5
INC HL ; 1:6
if carry_flow_warning
OR A ; 1:4
endif
RET ; 1:10
FWST_1024PLUS:
RET z ; 1:5/11
LD B, A ; 1:4
ADD HL, HL ; 1:11
DJNZ $-1 ; 2:13/8
RET ; 1:10
FWST_OVERFLOW:
if color_flow_warning
CALL OVER_COL_WARNING ; 3:17
endif
LD HL, $FFFF ; 3:10
if carry_flow_warning
SCF ; 1:4
endif
RET ; 1:10 RET with carry
FWST_ZERO:
if carry_flow_warning
XOR A ; 1:4
LD H, A ; 1:4
LD L, A ; 1:4
else
LD HL, $0000 ; 3:10
endif
RET ; 1:10 RET with carry
endif
| 32.818182 | 93 | 0.297438 |
6c760c87593c17abc58ceca62d1a5225b8cd0825 | 487 | asm | Assembly | oeis/186/A186299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/186/A186299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/186/A186299.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A186299: (A007521(n)-1)/2.
; Submitted by Jon Maiga
; 2,6,14,18,26,30,50,54,74,78,86,90,98,114,134,138,146,158,174,186,194,198,210,230,254,270,278,306,326,330,338,350,354,366,378,386,398,410,414,426,438,470,498,506,510,530,534,546,554,558,590,606
mov $1,4
mov $2,$0
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 $1,8
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,4
mul $0,2
| 22.136364 | 194 | 0.634497 |
4d33eb851bc920ce6a7b7dc562afc857833b671b | 853 | asm | Assembly | programs/oeis/142/A142062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/142/A142062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/142/A142062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A142062: Primes congruent to 23 mod 33.
; 23,89,353,419,617,683,881,947,1013,1277,1409,1607,1871,2003,2069,2267,2333,2399,2531,2663,2729,2861,2927,3191,3257,3323,3389,3719,3851,3917,4049,4643,4973,5039,5171,5237,5303,5501,5897,6029,6359,6491,6689,7019,7151,7283,7349,7481,7547,7877,8009,8273,8537,8669,8867,8933,8999,9461,9791,9857,9923,10253,10781,10847,10979,11177,11243,11903,11969,12101,12497,12893,12959,13421,13487,13553,13619,13751,13883,14081,14411,14543,14741,14939,15137,15269,15401,15467,15731,15797,16061,16127,16193,16787,17117,17183,17579,17909,18041,18371
mov $2,$0
pow $2,2
add $2,1
pow $2,2
lpb $2
add $1,22
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,11
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
div $1,2
sub $1,22
mul $1,2
add $1,35
mov $0,$1
| 34.12 | 530 | 0.722157 |
85554ffb193c79c689bf4e2cf96b0ad1dec54d86 | 961 | asm | Assembly | collision.asm | laerreal/flyshooter | c4a512b48788647d5cf946bcc39253b724f581c7 | [
"BSD-3-Clause"
] | null | null | null | collision.asm | laerreal/flyshooter | c4a512b48788647d5cf946bcc39253b724f581c7 | [
"BSD-3-Clause"
] | null | null | null | collision.asm | laerreal/flyshooter | c4a512b48788647d5cf946bcc39253b724f581c7 | [
"BSD-3-Clause"
] | null | null | null | ; push 1 - адрес
; push 2 - адрес
collision:
push bp
mov bp,sp
push bx
mov bx,[bp+4]
mov ax,[bx+12]
mov bx,[bp+6]
cmp ax,[bx+12]
pushf
xor ax,ax
popf
je collision_end
mov ax,[bx]
mov [_xp],ax
mov [_xm],ax
mov ax,[bx+2]
mov [_yp],ax
mov [_ym],ax
mov bx,[bx+10]
mov ax,[bx]
shl ax,2
add ax,[bx]
shl ax,1
add ax,2
add bx,ax
mov ax,[bx]
add [_xp],ax
sub [_xm],ax
mov ax,[bx+2]
add [_yp],ax
sub [_ym],ax
mov bx,[bp+4]
mov bx,[bx+10]
mov ax,[bx]
shl ax,2
add ax,[bx]
shl ax,1
add ax,2
add bx,ax
mov ax,[bx]
add [_xp],ax
sub [_xm],ax
mov ax,[bx+2]
add [_yp],ax
sub [_ym],ax
xor ax,ax
mov bx,[bp+4]
mov cx,[bx]
cmp cx,[_xm]
jl collision_end
cmp cx,[_xp]
jg collision_end
mov cx,[bx+2]
cmp cx,[_ym]
jl collision_end
cmp cx,[_yp]
jg collision_end
inc ax
collision_end:
pop bx
mov sp,bp
pop bp
retn 4
_xp dw 12
_xm dw 14
_yp dw 3
_ym dw 8
| 11.045977 | 18 | 0.568158 |
16bf45a6fa06ecdbfb95c7e9d6235fd6bd53b786 | 10,593 | asm | Assembly | roms/virtual-disk/option.asm | teknoman117/ts-3100-kvm-emulator | 782c9440e9d40e536b8fc4c9b017ddd1ddea727f | [
"BSD-3-Clause"
] | 1 | 2020-05-07T19:28:47.000Z | 2020-05-07T19:28:47.000Z | roms/virtual-disk/option.asm | teknoman117/ts-3100-kvm-emulator | 782c9440e9d40e536b8fc4c9b017ddd1ddea727f | [
"BSD-3-Clause"
] | null | null | null | roms/virtual-disk/option.asm | teknoman117/ts-3100-kvm-emulator | 782c9440e9d40e536b8fc4c9b017ddd1ddea727f | [
"BSD-3-Clause"
] | null | null | null | ; virtual disk option rom
bits 16
org 0x0000
section .text
; header
db 0x55
db 0xaa
db 16
jmp rom_init
%include "stringformat.asm"
rom_init:
; backup registers we clobber
push ax
push bx
push cx
push dx
push si
push bp
push ds
push es
; set DS to local data (we cheat and use our internal memory because we are a vm)
mov ax, cs
mov ds, ax
; backup existing int 13h and int 19h vectors
xor ax, ax
mov es, ax
mov ax, WORD [es:13h*4]
mov WORD [ds:bios_int13h_offset], ax
mov ax, WORD [es:13h*4+2]
mov WORD [ds:bios_int13h_segment], ax
mov ax, WORD [es:19h*4]
mov WORD [ds:bios_int19h_offset], ax
mov ax, WORD [es:19h*4+2]
mov WORD [ds:bios_int19h_segment], ax
; overwrite int 19h with our vector
mov WORD [es:13h*4], int13h_handler
mov WORD [es:13h*4+2], cs
mov WORD [es:19h*4], int19h_handler
mov WORD [es:19h*4+2], cs
; up the fixed disk count, get our drive number
mov ax, 0x0040
mov es, ax
mov al, BYTE [es:0x75]
mov bl, al
add bl, 0x80
mov BYTE [ds:vdisk_drivenum], bl
inc al
mov BYTE [es:0x75], al
; select the zero lba
mov dx, 0xD000
mov ax, 0x0000
out dx, ax
add dx, 2
out dx, ax
add dx, 2
out dx, ax
; get the current video mode
mov ah, 0x0F
int 10h
; print messages
mov ah, 0x0E
mov si, rom_message
lodsb
.rom_init_print_message:
int 10h
lodsb
test al, al
jnz .rom_init_print_message
; restore registers
pop es
pop ds
pop bp
pop si
pop dx
pop cx
pop bx
pop ax
retf
; if this chains to another handler, we need to *replace* ourself with the other call
int19h_handler:
sti
; set a stack frame
push bp
mov bp, sp
sub sp, 8
%if 1
; replace call with old bios call, todo: overwrite our stack frame
mov WORD [ss:bp-2], ax
mov WORD [ss:bp-4], bx
mov WORD [ss:bp-6], ds
mov WORD [ss:bp-8], es
xor ax, ax
mov es, ax
mov ax, cs
mov ds, ax
mov ax, WORD [es:13h*4]
mov bx, WORD [es:13h*4+2]
push WORD [ds:bios_int19h_segment]
push WORD [ds:bios_int19h_offset]
mov ax, WORD [ss:bp-2]
mov bx, WORD [ss:bp-4]
mov ds, WORD [ss:bp-6]
mov es, WORD [ss:bp-8]
retf
; this call SHOULD NOT return
%endif
%if 0
; map LBA zero into the virtual disk
mov dx, 0xd000
mov ax, 2048
out dx, ax
add dx, 2
xor ax, ax
out dx, ax
add dx, 2
out dx, ax
; set the data segment to the code segment, extra segment to 0
mov ax, cs
mov ds, ax
xor ax, ax
mov es, ax
; copy the IPL and jump to it
mov si, 0x1000
mov di, 0x7c00
mov cx, 0x100
rep movsw
jmp WORD 0x0000:0x7c00
%endif
int13h_handler:
sti
; set a stack frame
push bp
mov bp, sp
sub sp, 12
; save some registers, setup vars pointer
mov WORD [ss:bp-2], ax
mov WORD [ss:bp-4], ds
mov WORD [ss:bp-6], cx
mov WORD [ss:bp-8], di
mov WORD [ss:bp-10], dx
mov WORD [ss:bp-12], si
mov ax, cs
mov ds, ax
mov ax, WORD [ss:bp-2]
; skip disk reset for now
cmp ah, 0x00
je .BIOSInt13h
; skip if not our disk
cmp dl, BYTE [ds:vdisk_drivenum]
jne .BIOSInt13h
; we only support disk parameter check at the moment
cmp ah, 0x08
je .HandleAH08
cmp ah, 0x02
je .HandleAH02
cmp ah, 0x03
je .HandleAH03
;int 3
jmp .BIOSInt13h
.HandleAH08:
; use 255x63 virtual mappings
; bits [15:8] = head count = 1 (255 heads here)
; bits [7:0] = drive count (1 drive here)
mov dx, 0xfe01
; bits [15:6] = cylinder count - 1 (8 cylinders here)
; bits [5:0] = sectors/track count (63 sectors/track)
mov cx, 0x073f
; no error (clear CF, zero AH)
xor ah, ah
clc
mov WORD [ss:bp-2], ax
mov WORD [ss:bp-6], cx
mov WORD [ss:bp-10], dx
jmp .FinishInt13hHandler
.HandleAH02:
;int 3
cld
; put BX in DI (the destination address)
mov di, bx
; convert chs to lba (dx:ax = 512 bytes/sector lba)
mov al, 255
mul ch
mov dl, dh
xor dh, dh
add ax, dx
mov dx, 63
mul dx
xor ch, ch
sub cl, 1
add ax, cx
adc dx, 0
; check the current lba
push ax
mov bx, ax
mov cx, dx
and bx, 0xFFF8
mov dx, 0xD000
in ax, dx
cmp ax, bx
jne .HandleAH02_OutputLBALowWord
add dx, 2
in ax, dx
cmp ax, cx
jne .HandleAH02_OutputLBAHighWord
jmp .HandleAH02_SkipLBA
; write out the lba (and select it)
.HandleAH02_OutputLBALowWord:
mov ax, bx
out dx, ax
add dx, 2
.HandleAH02_OutputLBAHighWord:
mov ax, cx
out dx, ax
add dx, 2
out dx, ax
.HandleAH02_SkipLBA:
pop ax
; figure out the offset
mov bx, [ss:bp-2] ; get old ax value (bl contains sector count to move)
and ax, 0x0007
je .HandleAH02_SkipAlignment
; get blocks to move
xor cl, cl
mov ch, 8 ; "effective" multiply by 256 (512 bytes, cx is in words)
sub ch, al
cmp ch, bl ; do we terminate early?
jng .HandleAH02_StartCopy
; so we aren't moving a whole block
mov ch, bl
.HandleAH02_StartCopy:
sub bl, ch
; compute offset into memory
mov ah, al ; "effective" multiply by 512
shl ah, 1
xor al, al
mov si, 0x1000
add si, ax
rep movsw
test bl, bl
jz .HandleAH02_FinishCopy
; increment the LBA before continuing to main loop
call IncrementLBA
.HandleAH02_SkipAlignment:
test bl, 0xF8
jz .HandleAH02_LastCopy
mov cx, 2048
mov si, 0x1000
rep movsw
sub bl, 8
jz .HandleAH02_FinishCopy
; increment the LBA before the next block
; can the following be replaced by (push SkipAlignment, jmp IncrementLBA ?)
call IncrementLBA
jmp .HandleAH02_SkipAlignment
.HandleAH02_LastCopy:
xor cl, cl
mov ch, bl
mov si, 0x1000
rep movsw
.HandleAH02_FinishCopy:
; setup results
mov ax, WORD [ss:bp-2]
xor ah, ah
clc
mov WORD [ss:bp-2], ax
jmp .FinishInt13hHandler
.HandleAH03:
;int 3
cld
; put BX in SI (the source address)
mov si, bx
; convert chs to lba (dx:ax = 512 bytes/sector lba)
mov al, 255
mul ch
mov dl, dh
xor dh, dh
add ax, dx
mov dx, 63
mul dx
xor ch, ch
sub cl, 1
add ax, cx
adc dx, 0
; check the current lba
push ax
mov bx, ax
mov cx, dx
and bx, 0xFFF8
mov dx, 0xD000
in ax, dx
cmp ax, bx
jne .HandleAH03_OutputLBALowWord
add dx, 2
in ax, dx
cmp ax, cx
jne .HandleAH03_OutputLBAHighWord
jmp .HandleAH03_SkipLBA
; write out the lba (and select it)
.HandleAH03_OutputLBALowWord:
mov ax, bx
out dx, ax
add dx, 2
.HandleAH03_OutputLBAHighWord:
mov ax, cx
out dx, ax
add dx, 2
out dx, ax
.HandleAH03_SkipLBA:
pop ax
; swap ds, es
mov bx, es
mov dx, ds
mov es, dx
mov ds, bx
; figure out the offset
mov bx, [ss:bp-2] ; get old ax value (bl contains sector count to move)
and ax, 0x0007
je .HandleAH03_SkipAlignment
; get blocks to move
xor cl, cl
mov ch, 8 ; "effective" multiply by 256 (512 bytes, cx is in words)
sub ch, al
cmp ch, bl ; do we terminate early?
jng .HandleAH03_StartCopy
; so we aren't moving a whole block
mov ch, bl
.HandleAH03_StartCopy:
sub bl, ch
; compute offset into memory
mov ah, al ; "effective" multiply by 512
shl ah, 1
xor al, al
mov di, 0x1000
add di, ax
rep movsw
test bl, bl
jz .HandleAH03_FinishCopy
; increment the LBA before continuing to main loop
call IncrementLBA
.HandleAH03_SkipAlignment:
test bl, 0xF8
jz .HandleAH03_LastCopy
mov cx, 2048
mov di, 0x1000
rep movsw
sub bl, 8
jz .HandleAH03_FinishCopy
; increment the LBA before the next block
; can the following be replaced by (push SkipAlignment, jmp IncrementLBA ?)
call IncrementLBA
jmp .HandleAH03_SkipAlignment
.HandleAH03_LastCopy:
xor cl, cl
mov ch, bl
mov di, 0x1000
rep movsw
.HandleAH03_FinishCopy:
; swap ds, es
mov bx, es
mov dx, ds
mov es, dx
mov ds, bx
; setup results
mov ax, WORD [ss:bp-2]
xor ah, ah
clc
mov WORD [ss:bp-2], ax
jmp .FinishInt13hHandler
.BIOSInt13h:
; stack frame looks like
; flags
; segment
; offset
; bp --> bp (caller's)
; call original int 13h call
push bp
; simulate int instruction's return data
push WORD [ss:bp+6] ; flags
push cs ; segment
push .ReturnFromInt13h ; offset
; push old handler and restore variables
push WORD [ds:bios_int13h_segment]
push WORD [ds:bios_int13h_offset]
mov ax, WORD [ss:bp-2]
mov ds, WORD [ss:bp-4]
mov cx, WORD [ss:bp-6]
mov di, WORD [ss:bp-8]
mov dx, WORD [ss:bp-10]
mov bp, WORD [ss:bp]
retf
.ReturnFromInt13h:
;int 3
pop bp
; overwrite registers which store return data from the old int 13h function
mov WORD [ss:bp-2], ax
mov WORD [ss:bp-6], cx
mov WORD [ss:bp-8], di
mov WORD [ss:bp-10], dx
mov WORD [ss:bp-12], si
; setup vars pointer
mov ax, cs
mov ds, ax
.FinishInt13hHandler:
; restore registers
mov ax, WORD [ss:bp-2]
mov ds, WORD [ss:bp-4]
mov cx, WORD [ss:bp-6]
mov di, WORD [ss:bp-8]
mov dx, WORD [ss:bp-10]
mov si, WORD [ss:bp-12]
; restore stack frame
mov sp, bp
pop bp
; we want the current flags to be returned to the caller, but iret
; preserves the caller's flags. we can get around this by using
; a far return with a '2' passed so it skips over the flags entry
; on the stack
retf 2
; clobbers ax, dx
IncrementLBA:
push dx
push ax
mov dx, 0xD000
in ax, dx
add ax, 8
out dx, ax
add dx, 2
in ax, dx
adc ax, 0
out dx, ax
add dx, 2
out dx, ax
pop ax
pop dx
ret
section .data align=4
indicator: dq 0xefcdab8967452301
bios_int13h_segment: dw 0x0000
bios_int13h_offset: dw 0x0000
bios_int19h_segment: dw 0x0000
bios_int19h_offset: dw 0x0000
vdisk_drivenum: db 0x00
rom_message: db 13, 10, "-= Virtual Disk Driver =-", 13, 10
db "v0.0.1 (2020-05-06)", 13, 10
db "Released under GNU GPL v2", 13, 10, 0
;times 8191-($-$$) db 0x00
; db 0x00 ; checksum
| 20.976238 | 89 | 0.604078 |
5b73c88df280ded7d89058bfdcc265ee86eda169 | 910 | asm | Assembly | oeis/139/A139541.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/139/A139541.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/139/A139541.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A139541: There are 4*n players who wish to play bridge at n tables. Each player must have another player as partner and each pair of partners must have another pair as opponents. The choice of partners and opponents can be made in exactly a(n)=(4*n)!/(n!*8^n) different ways.
; Submitted by Jamie Morken(s2)
; 1,3,315,155925,212837625,618718975875,3287253918823875,28845653137679503125,388983632561608099640625,7637693625347175036443671875,209402646126143497974176151796875,7752714167528210725497923667975703125,377130780679409810741846496828678078515625,23561245522946127926096859889371662955263671875,1854387828883474998423453357592996732894027294921875,180852881787518666171244135605972192368955799991845703125,21545546365992461256978827607146285193490811320428554150390625
mov $2,1
mov $3,$0
mul $3,4
lpb $3
mul $2,$3
lpb $3
bin $3,$0
lpe
sub $3,1
lpe
mov $4,8
pow $4,$0
div $2,$4
mov $0,$2
| 47.894737 | 468 | 0.824176 |
5db5d2a178635aadc9f56c144d8b860d533ad36e | 1,517 | asm | Assembly | 8088/cga/flicker_224/audio.asm | reenigne/reenigne | c3eb8b31d7964e78bbe44908987d4be052a74488 | [
"Unlicense"
] | 92 | 2015-04-10T17:45:11.000Z | 2022-03-30T17:58:51.000Z | 8088/cga/flicker_224/audio.asm | MS-DOS-stuff/reenigne | 0a113990aef398550c6f14d1c7a33af1cb091887 | [
"Unlicense"
] | 2 | 2017-11-05T07:21:35.000Z | 2018-11-04T23:36:13.000Z | 8088/cga/flicker_224/audio.asm | MS-DOS-stuff/reenigne | 0a113990aef398550c6f14d1c7a33af1cb091887 | [
"Unlicense"
] | 18 | 2015-04-11T20:32:44.000Z | 2021-11-06T05:19:57.000Z | org 0x100
cpu 8086
PERIOD EQU (76*262/4)
cli
mov ax,cs
mov ds,ax
mov ss,ax
mov sp,0xfffe
; Set up interrupt
xor ax,ax
mov ds,ax
mov bx,[8*4]
mov cx,[8*4+2]
mov word[8*4],interrupt8
mov [8*4+2],cs
mov ax,cs
mov ds,ax
mov [oldInterrupt8],bx
mov [oldInterrupt8+2],cx
; Set up PIT channel 2
mov al,0xb6
out 0x43,al
mov al,2
out 0x42,al
mov al,0
out 0x42,al
; Set up speaker
in al,0x61
mov [originalPortB],al
or al,3
out 0x61,al
; Set up PIT channel 0
mov al,0x34
out 0x43,al
mov al,PERIOD & 0xff
out 0x40,al
mov al,PERIOD >> 8
out 0x40,al
sti
mov si,musicStart
mainLoop:
; Check keyboard
mov ah,1
int 0x16
cmp al,27
je finish
cmp byte[timerFired],1
jne mainLoop
mov byte[timerFired],0
lodsw
test ax,ax
jz finish
test si,si
jz finish
out 0x42,al
mov al,ah
out 0x42,al
jmp mainLoop
finish:
; Restore everything
cli
mov bx,[oldInterrupt8]
mov cx,[oldInterrupt8+2]
xor ax,ax
mov ds,ax
mov [8*4],bx
mov [8*4+2],cx
mov ax,cs
mov ds,ax
mov al,0x36
out 0x43,al
mov al,0
out 0x40,al
out 0x40,al
mov al,[originalPortB]
out 0x61,al
sti
int 0x20
; ret
interrupt8:
push ax
mov byte[cs:timerFired],1
; Restore and chain interrupt
add word[cs:pitCount],PERIOD
jc pitFallback
mov al,0x20
out 0x20,al
pop ax
iret
pitFallback:
pop ax
jmp far [cs:oldInterrupt8]
timerFired: db 0
oldInterrupt8: dw 0,0
pitCount: dw 0
originalPortB: db 0
musicStart:
| 12.53719 | 31 | 0.647989 |
c9da6114759b7c784709a8498b68d69199c9c33f | 851 | asm | Assembly | cards/bn6/ItemCards/137-F005 Iris' Kindness.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | 10 | 2017-12-05T14:25:38.000Z | 2022-02-21T04:28:00.000Z | cards/bn6/ItemCards/137-F005 Iris' Kindness.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | cards/bn6/ItemCards/137-F005 Iris' Kindness.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | .include "defaults_item.asm"
table_file_jp equ "exe6-utf8.tbl"
table_file_en equ "bn6-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252354A // BR5J
game_code_2 equ 0x42523545 // BR5E
game_code_3 equ 0x42523550 // BR5P
card_type equ 0
card_id equ 25
card_no equ "025"
card_sub equ "Item Card 025"
card_sub_x equ 62
card_desc_len equ 1
card_desc_1 equ "Iris' Kindness"
card_desc_2 equ ""
card_desc_3 equ ""
card_name_jp_full equ "アイリスのやさしさ"
card_name_jp_game equ "アイリスのやさしさ"
card_name_en_full equ "Iris' Kindness"
card_name_en_game equ "Iris' Kindness"
card_game_desc_jp_len equ 3
card_game_desc_jp_1 equ "アイリスのやさしさ!"
card_game_desc_jp_2 equ "フォルダパック2 ピンク"
card_game_desc_jp_3 equ "を手に入れた!"
card_game_desc_en_len equ 2
card_game_desc_en_1 equ "Iris' kindness!"
card_game_desc_en_2 equ "Got FldrPak2 Pink!"
card_game_desc_en_3 equ "" | 28.366667 | 44 | 0.79671 |
c604d9d79587d794826b450020e26a4fffe6ae0f | 390 | asm | Assembly | uw1/dontFixHeading.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | uw1/dontFixHeading.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | uw1/dontFixHeading.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | %ifndef EXE_LENGTH
%include "../UltimaPatcher.asm"
%include "include/uw1.asm"
defineAddress 9, 0x0A66, maybeJumpOverAdjustment
defineAddress 9, 0x0AAD, afterAdjustment
%endif
[bits 16]
startPatch EXE_LENGTH, \
dont change player heading when player has moved against an obstacle
startBlockAt addr_maybeJumpOverAdjustment
jmp calcJump(off_afterAdjustment)
endBlock
endPatch
| 21.666667 | 70 | 0.8 |
a06cce5904a032260ceb93014de847b99a10ad6d | 634 | asm | Assembly | oeis/004/A004610.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/004/A004610.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/004/A004610.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A004610: Expansion of sqrt(6) in base 3.
; Submitted by Jamie Morken(s2)
; 2,1,1,0,0,1,0,2,0,0,0,2,2,0,2,1,1,1,1,2,2,1,1,2,2,0,1,2,2,1,2,0,1,0,1,0,0,0,2,1,2,2,1,1,0,0,1,1,1,1,1,2,0,0,1,0,1,1,1,1,2,2,0,0,2,1,0,2,2,1,1,2,1,0,1,0,1,1,0,1,0,0,1,2,0,1,0,2,2,1,0,1,1,0,1,1,2,1,0,2
mov $1,1
mov $2,1
mov $3,$0
add $3,2
mov $4,$0
add $4,2
mov $7,10
pow $7,$4
lpb $3
mov $4,$2
pow $4,2
mul $4,6
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,1
div $1,$8
div $2,$8
sub $3,1
mov $9,3
lpe
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
| 16.25641 | 201 | 0.507886 |
fc336e8f05a3ad210f7bd1fddc940b6811b7b75f | 181 | asm | Assembly | oeis/085/A085621.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/085/A085621.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/085/A085621.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A085621: Mean prime gaps that do not occur in A049036.
; 1,3,5,7,9,10,11,13,15,16,17,19
mul $0,2
mov $2,$0
add $2,$0
lpb $0
div $0,2
add $2,2
lpe
div $2,3
mov $0,$2
add $0,1
| 12.928571 | 56 | 0.60221 |
75db20b9801021a60bd04cfef86c33543bdf7712 | 60 | asm | Assembly | src/main/fragment/mos6502-common/vwsm1=vwsm1_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwsm1=vwsm1_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwsm1=vwsm1_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {m1}
clc
adc {m2}
sta {m1}
lda {m1}+1
adc #0
sta {m1}+1
| 7.5 | 10 | 0.566667 |
65f6e51a7ec0540ab0e7d379dffda85a5189a32a | 32 | asm | Assembly | School Directory Project/test_data/ben.asm | AriaPahlavan/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | 1 | 2016-01-14T05:17:37.000Z | 2016-01-14T05:17:37.000Z | School Directory Project/test_data/ben.asm | apahlavan1/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | null | null | null | School Directory Project/test_data/ben.asm | apahlavan1/Fall-2014-EE-306-Projects-Assembly-Binary | 589bf1e85c1813efa71bfa8ec656ee8701d31a6a | [
"MIT"
] | null | null | null | .ORIG x4050
.STRINGZ "BEN"
.END
| 8 | 14 | 0.6875 |
80d5d706808362ca3dcdef83f449a22c2aff1ede | 824 | asm | Assembly | Find_In_Array.asm | Abhik-Kumar/8085 | 2477833f5f612a8819e1afe1d68f900f0c1e2585 | [
"MIT"
] | null | null | null | Find_In_Array.asm | Abhik-Kumar/8085 | 2477833f5f612a8819e1afe1d68f900f0c1e2585 | [
"MIT"
] | null | null | null | Find_In_Array.asm | Abhik-Kumar/8085 | 2477833f5f612a8819e1afe1d68f900f0c1e2585 | [
"MIT"
] | null | null | null | //2K19/EE/009 Abhik Kumar
// FInd a number in a given array
# ORG 1000
# BEGIN 1000
LXI H,1050 // Address to get array size
MOV C,M // Size of array
INX H // Point to next location of array
MOV B,M // Key value to be searched in array
MOV A,B // Storing key in accumulator
LOOP: INX H // move to next location
CMP M // Compare the memory element with Accumulator
JZ FOUND // Jump If zero
DCR C // decrease the size of array
JNZ LOOP // Jump if not zero
LXI H,FFFF // load FFFF into HL pair if data not found
SHLD 3000 // store the HL pair data at
JMP DONE // Jump to
FOUND: SHLD 3000 // If data found store this adress
DONE: HLT // stop
# ORG 1050H
// Size, Key, Data(1), Data(2), Data(3), ...........Data(size)
#DB 07H, 62H, 12H, 22H, 32H, 42H, 52H, 62H, 72H
| 29.428571 | 62 | 0.634709 |
431d96c45c7cf38bfce60584d12f02987477f68f | 1,970 | asm | Assembly | Asm4Kids/39spritezero.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 17 | 2017-04-18T14:00:14.000Z | 2021-06-07T18:57:02.000Z | Asm4Kids/39spritezero.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | null | null | null | Asm4Kids/39spritezero.asm | jacmoe/c64adventures | c33854a4fa22bf5877ea7cc9a207bc0aebf2a4c7 | [
"BSD-2-Clause"
] | 3 | 2018-04-09T14:34:40.000Z | 2021-04-06T17:02:28.000Z | ;****************************************
;* *
;* Sprite zero *
;* *
;* Moves a big, blocky sprite across *
;* the screen. *
;* *
;****************************************
; 10 SYS (49152)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $34, $39, $31, $35, $32, $29, $00, $00, $00
*=$c000
sprite0 =$7f8 ; 2040
enable =$d015 ; 53269
color0 =$d027 ; 53287
sp0x =$d000 ; 53248
sp0y =$d001 ; 53249
msbx =$d010 ; 53264
shouse =$0340 ; 832
jsr $e544
lda #$0d ; block 13
sta sprite0 ; store it in pointer for sprite 0 (poke 2040,13)
lda #1 ; sprite 0 enable value
sta enable ; store it in the enable register (poke 53269,1)
lda #2 ; color red
sta color0 ; color register for sprite 0 (poke 53287,2)
ldx #0
lda #0
cleanup sta shouse,x ; store zeroes in sprite area
inx
cpx #63
bne cleanup
ldx #0
lda #$ff
build sta shouse,x ; fill up sprite area with $ff or 255
inx ; to make solid block
cpx #63
bne build
lda #0
sta msbx ; store 0 in msbx to locate sprite in horizontal
; locations 0 to 255 only (poke 53264,0)
ldx #0
lda #70 ; vertical location
move stx sp0x ; increment horizontal location by x (poke 53248,x)
sta sp0y ; y register stays constant location of a register (poke 53249,70)
ldy #0 ; delay loop
pause iny
cpy #255
bne pause
inx
cpx #254
bne move
rts
| 32.295082 | 96 | 0.405076 |
63a9c4c4c4aea295e57d08d4657737dfa9a48689 | 5,176 | asm | Assembly | base/mvdm/wow16/mmsystem/hmemcpy.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/wow16/mmsystem/hmemcpy.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/wow16/mmsystem/hmemcpy.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ; mem.asm:
;
; masm -Mx -Zi -DSEGNAME=????? asm.asm
;
TITLE MEM.ASM
;****************************************************************
;* MEM.ASM - Assembly mem-copy routines *
;* for 80286 and 80386 *
;****************************************************************
;
?PLM=1 ; PASCAL Calling convention is DEFAULT
?WIN=0 ; Windows calling convention
.xlist
include cmacros.inc
include windows.inc
.list
externA __WinFlags ; in KERNEL
externA __AHINCR ; in KERNEL
externA __AHSHIFT ; in KERNEL
; The following structure should be used to access high and low
; words of a DWORD. This means that "word ptr foo[2]" -> "foo.hi".
LONG struc
lo dw ?
hi dw ?
LONG ends
FARPOINTER struc
off dw ?
sel dw ?
FARPOINTER ends
; -------------------------------------------------------
; DATA SEGMENT DECLARATIONS
; -------------------------------------------------------
ifndef SEGNAME
SEGNAME equ <_TEXT>
endif
createSeg %SEGNAME, CodeSeg, word, public, CODE
sBegin Data
sEnd Data
sBegin CodeSeg
assumes cs,CodeSeg
assumes ds,DATA
cProc fstrrchr,<NEAR,PASCAL,PUBLIC,NODATA>,<di>
ParmD lsz
ParmB c
cBegin
les di, lsz
xor al, al ; Search for terminating NULL
mov cx, -1 ; Search forever
cld ; Moving forward
repne scasb ; Look for the NULL
not cx ; Negative value minus 1 gives length
dec cx ; CX is always incremented
jcxz fstrrchr_fail ; Zero length string fails
dec di ; DI is one past character found
dec di ; Back up to last character in string
mov al, c ; Get character to search for
std ; Moving backwards
repne scasb ; Look for the character
cld ; Reset direction
jne fstrrchr_fail ; Fail if not found
inc di ; Back up to actual character found
mov ax, di ; Return pointer to that character
mov dx, es
jmp fstrrchr_exit
fstrrchr_fail:
xor ax, ax ; Return NULL on failure
cwd
fstrrchr_exit:
cEnd
;---------------------------Public-Routine------------------------------;
; MemCopy
;
; copy memory, dons *not* handle overlaped copies.
;
; Entry:
; lpSrc HPSTR to copy from
; lpDst HPSTR to copy to
; cbMem DWORD count of bytes to move
;
; Returns:
; destination pointer
; Error Returns:
; None
; Registers Preserved:
; BP,DS,SI,DI
; Registers Destroyed:
; AX,BX,CX,DX,FLAGS
; Calls:
; nothing
; History:
;
; Wed 04-Jan-1990 13:45:58 -by- Todd Laney [ToddLa]
; Created.
; Tue 16-Oct-1990 16:41:00 -by- David Maymudes [DavidMay]
; Modified 286 case to work correctly with cbMem >= 64K.
; Changed name to hmemcpy.
; Changed 386 case to copy by longwords
;-----------------------------------------------------------------------;
cProc MemCopy,<NEAR,PASCAL,PUBLIC,NODATA>,<>
; ParmD lpDst
; ParmD lpSrc
; ParmD cbMem
cBegin <nogen>
mov ax,__WinFlags
test ax,WF_CPU286
jz MemCopy386
jmp NEAR PTR MemCopy286
cEnd <nogen>
cProc MemCopy386,<NEAR,PASCAL,PUBLIC,NODATA>,<ds>
ParmD lpDst
ParmD lpSrc
ParmD cbMem
cBegin
.386
push edi
push esi
cld
mov ecx,cbMem
jecxz mc386_exit
movzx edi,di
movzx esi,si
lds si,lpSrc
les di,lpDst
push ecx
shr ecx,2 ; get count in DWORDs
rep movs dword ptr es:[edi], dword ptr ds:[esi]
db 67H
pop ecx
and ecx,3
rep movs byte ptr es:[edi], byte ptr ds:[esi]
db 67H
nop
mc386_exit:
cld
pop esi
pop edi
mov dx,lpDst.sel ; return destination address
mov ax,lpDst.off
.286
cEnd
cProc MemCopy286,<NEAR,PASCAL,PUBLIC,NODATA>,<ds,si,di>
ParmD lpDst
ParmD lpSrc
ParmD cbMem
cBegin
mov cx,cbMem.lo ; CX holds count
or cx,cbMem.hi ; or with high word
jnz @f
jmp empty_copy
@@:
lds si,lpSrc ; DS:SI = src
les di,lpDst ; ES:DI = dst
next:
mov ax,cx
dec ax
mov ax,di
not ax ; AX = 65535-DI
mov dx,si
not dx ; DX = 65535-SI
sub ax,dx
sbb bx,bx
and ax,bx
add ax,dx ; AX = MIN(AX,DX) = MIN(65535-SI,65535-DI)
; problem: ax might have wrapped to zero
test cbMem.hi,-1
jnz plentytogo ; at least 64k still to copy
dec cx ; this is ok, since high word is zero
sub ax,cx
sbb bx,bx
and ax,bx
add ax,cx ; AX = MIN(AX,CX)
inc cx
plentytogo:
xor bx,bx
add ax,1 ; AX = Num = MIN(count,65536-SI,65536-DI)
; we must check the carry here!
adc bx,0 ; BX could be 1 here, if CX==0 indicating
; exactly 64k to copy
xchg ax,cx
sub ax,cx ; Count -= Num
sbb cbMem.hi,bx
shr bx,1
rcr cx,1 ; if bx==1, then cx ends up 0x8000
rep movsw
jnc @f
movsb ; move last byte, if necessary
@@:
mov cx,ax ; put low word of count back in cx
or ax,cbMem.hi
jz done ; If Count == 0 Then BREAK
or si,si ; if SI wraps, update DS
jnz @f
;
mov ax,ds
add ax,__AHINCR
mov ds,ax ; update DS if appropriate
@@:
or di,di ; if DI wraps, update ES
jnz next
;
mov ax,es
add ax,__AHINCR
mov es,ax ; update ES if appropriate
jmp next
;
; Restore registers and return
;
done:
empty_copy:
mov dx,lpDst.sel ; return destination address
mov ax,lpDst.off
cEnd
sEnd
sEnd CodeSeg
end
| 20.787149 | 74 | 0.600464 |
b78800f4193072dc348e0dbd4967648e9faf5564 | 2,894 | asm | Assembly | repsych.asm | juliusdedekind/REpsych | 13bb518c7dbb4d3580876ca11faa25c4a01b2bc1 | [
"BSD-3-Clause"
] | 733 | 2015-06-22T15:37:47.000Z | 2022-03-27T11:52:25.000Z | repsych.asm | ysrsnmz/REpsych | 13bb518c7dbb4d3580876ca11faa25c4a01b2bc1 | [
"BSD-3-Clause"
] | 1 | 2015-08-09T16:40:03.000Z | 2015-08-12T20:30:14.000Z | repsych.asm | ysrsnmz/REpsych | 13bb518c7dbb4d3580876ca11faa25c4a01b2bc1 | [
"BSD-3-Clause"
] | 82 | 2015-08-14T00:34:16.000Z | 2022-01-16T17:42:58.000Z | ; REpsych
; domas @xoreaxeaxeax
USE32
%include "gen/gen.asm"
%include "gfx/image.asm"
%include "code/code.asm"
global _start
_start:
call code
call main
mov eax, 1
mov edx, 0
int 0x80
; Tie nodes together, or use the newer switch opening,
; which avoids the need for tight tying.
%ifdef TIE
%assign TIED 1
%else
%assign TIED 0
%endif
; max instructions in a node, picked to match width
%assign instructions 26
; insert a wider instructure to make nodes larger to emphasize contrast
%macro widen 0
; any arbitrary long instruction that won't fault
; don't use a long nop, ida will decode the graph differently
; wide+4 prevents instruction from shortening due to existing symbol
vfmaddsub132ps xmm0,xmm1,[cs:edi+esi*4+wide+4]
;mov dword [eax+4*edx+0x11111111], 0x11111111
;lea eax, [eax+4*edx+0x11111111]
;mov dword [edi+4*esi+wide+4], 0x11111111
%endmacro
; widen instruction setup, if necessary
section .data
wide: dd 0, 0, 0
section .text
%macro init_widen 0
xor edi, edi
xor esi, esi
%endmacro
%macro invert 0
%assign pixel 255-pixel
%endmacro
%macro check 2
%assign pixel pixel_%1_%2
%endmacro
%macro block_fill 2
; force column filled to ensure all rows have at least 1 pixel on
%if %2 == 0
%assign pixel 255
%else
; adjust for all on column
%assign T %2 - 1
check T, %1
%endif
widen
%assign lines pixel*instructions/255
; junk code, should not branch or interfere with execution
%rep lines
rand_insn
%endrep
%endmacro
%macro diag 5 ; row, column, width, height, done
%assign r %1
%assign c %2
%assign width %3
%assign height %4
%rep 256 ; max size
%assign nr r+1
%if TIED
%assign nc c+1
%else
%assign nc c
%endif
%if TIED
%if nc >= width
; create orphan jump to node to get right side aligned
widen
jmp e_%+r%+_%+c
%endif
%endif
e_%+r%+_%+c:
%if nr >= height
block_fill r, c
%elif TIED && nc >= width
block_fill r, c
je e_%+nr%+_%+c
%else
%if c == 0
; force unconditional jmp in column 0
block_fill r, c
jmp e_%+nr%+_%+nc
%if TIED
; warning: exitrep doesn't take effect until endrep is reached
%exitrep
%endif
%else
block_fill r, c
%if TIED
je e_%+nr%+_%+nc
%else
jmp e_%+nr%+_%+nc
%endif
%endif
%endif
%assign r r+1
%if TIED
%assign c c-1
%endif
%if r>=height
jmp %5
%exitrep
%endif
%endrep
%endmacro
; table for opening switch
s:
%assign c 0
%rep WIDTH+1
dd e_0_%+c
%assign c c+1
%endrep
global main
main:
init_widen
nop ; prevent ida from thinking this is a thunk, if no code above us
mov eax, 0
jmp [s+eax*4]
; adjust for adding all on column
%assign WIDTH WIDTH+1
%assign CC 0
%rep WIDTH
diag 0, CC, WIDTH, HEIGHT, done
%assign CC CC+1
%endrep
%if TIED
%assign RC 1
%rep HEIGHT-1
diag RC, WIDTH-1, WIDTH, HEIGHT, done
%assign RC RC+1
%endrep
%endif
done:
ret
| 16.632184 | 74 | 0.671735 |
b52fe3156427476d4f3e18a36551493fcf268f7c | 4,761 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_28_2239.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_28_2239.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_28_2239.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 %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x2a1, %r12
nop
nop
nop
nop
nop
add $6548, %rsi
movb (%r12), %r11b
nop
nop
nop
nop
cmp $32583, %rbp
lea addresses_A_ht+0x16a81, %rsi
lea addresses_normal_ht+0x382f, %rdi
nop
nop
nop
add %r15, %r15
mov $126, %rcx
rep movsq
nop
xor $257, %rcx
lea addresses_WC_ht+0x186a1, %r15
nop
nop
and $46765, %r12
movups (%r15), %xmm5
vpextrq $0, %xmm5, %rcx
nop
nop
inc %rcx
lea addresses_normal_ht+0x100a1, %rdi
nop
nop
nop
nop
add %r15, %r15
and $0xffffffffffffffc0, %rdi
vmovaps (%rdi), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %r11
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0x178a1, %rcx
nop
nop
nop
nop
nop
xor $62918, %rbp
movw $0x6162, (%rcx)
nop
nop
nop
and $38420, %r11
lea addresses_normal_ht+0x1e579, %r11
cmp %rcx, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm0
movups %xmm0, (%r11)
nop
and $54984, %rcx
lea addresses_WC_ht+0x3c61, %rsi
lea addresses_UC_ht+0xaba8, %rdi
nop
nop
nop
nop
nop
add %rbp, %rbp
mov $125, %rcx
rep movsq
inc %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x17b9, %rcx
nop
nop
nop
nop
nop
xor %r13, %r13
mov $0x5152535455565758, %rbp
movq %rbp, (%rcx)
nop
nop
nop
nop
add $58480, %rsi
// Store
lea addresses_US+0x1fa11, %r9
nop
nop
nop
cmp %rdi, %rdi
movw $0x5152, (%r9)
nop
nop
nop
and $63270, %rbp
// Store
lea addresses_WC+0x62a1, %rdi
clflush (%rdi)
nop
nop
add %r14, %r14
movw $0x5152, (%rdi)
nop
dec %rbp
// Load
mov $0x5a1, %rbp
nop
nop
nop
and %r14, %r14
mov (%rbp), %si
nop
dec %r13
// Store
mov $0xa75, %rbp
nop
nop
cmp $62571, %r13
movb $0x51, (%rbp)
nop
nop
nop
xor $56064, %r14
// Store
mov $0x91, %rdi
sub %r9, %r9
movb $0x51, (%rdi)
add %rsi, %rsi
// Store
lea addresses_US+0xc1bd, %rsi
clflush (%rsi)
nop
nop
nop
nop
cmp $756, %rbp
movw $0x5152, (%rsi)
nop
nop
cmp $39201, %rbp
// Store
lea addresses_WC+0x1b9a1, %rdi
nop
nop
add %rcx, %rcx
mov $0x5152535455565758, %r9
movq %r9, %xmm2
vmovups %ymm2, (%rdi)
nop
nop
nop
and $61650, %rcx
// Faulty Load
lea addresses_WC+0x62a1, %rbp
nop
nop
nop
nop
nop
sub %rdi, %rdi
movb (%rbp), %r14b
lea oracles, %rcx
and $0xff, %r14
shlq $12, %r14
mov (%rcx,%r14,1), %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'52': 28}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 19.432653 | 151 | 0.640202 |
a0999e01eeb8e83d6bb7ec85836b630e24c821de | 550 | asm | Assembly | oeis/017/A017300.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017300.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017300.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017300: a(n) = (10*n + 2)^8.
; 256,429981696,54875873536,1099511627776,9682651996416,53459728531456,218340105584896,722204136308736,2044140858654976,5132188731375616,11716593810022656,24759631762948096,49077072127303936,92170395205042176,165312903998914816,284936905588473856,474373168346071296,765997893392859136,1203846470694789376,1846757322198614016,2772113166407885056,4080251070798954496,5899616690476974336,8392742123471896576,11763130845074473216,16263137215612256256,22202932088065597696,29960650073923649536
mul $0,10
add $0,2
pow $0,8
| 78.571429 | 488 | 0.889091 |
1d15f261860caf7e7f04e1ca8bde7a56307a046e | 970 | asm | Assembly | ee/hot/tk2.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ee/hot/tk2.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ee/hot/tk2.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; dummy TK2_EXT V2.00 1988 Tony Tebby QJUMP
section hotkey
xdef hot_tk2
xdef hot_tkext
xref hot_thus
xref hot_thfr
xref hot_ptk2
xref ut_reassert
include 'dev8_ee_hk_data'
;+++
; This routine calls the normal TK2_EXT (address saved in thing) and
; then re-asserts its own ALTKEY
;---
hot_tk2
move.l a3,a4 ; find hot
jsr hot_thus
bne.s tk2_rts ; ... oops
move.l hkd_tk2x(a3),a1 ; real tk2_ext routine
jsr hot_thfr
move.l a4,a3 ; restore parameter pointer
move.l a1,d0 ; any tk2_ext?
beq.s tk2_rts ; ... no
jsr (a1) ; do it
hot_tkext
lea hot_ptk2,a1 ; use our TK2 versions
jsr ut_reassert
tk2_rts
rts
end
| 26.944444 | 68 | 0.471134 |
8525898000ee1e7c7dfed6ba377997f5fc1f37c4 | 87 | a51 | Assembly | Class Exercises/Problem 12.a51 | pronoym99/Microcontrollers-and-Applications | b96fbef72ef66999502d32cc7a0cb84bbe8214ed | [
"Unlicense"
] | 1 | 2018-10-28T21:11:08.000Z | 2018-10-28T21:11:08.000Z | Class Exercises/Problem 12.a51 | pronoym99/Microcontrollers-and-Applications | b96fbef72ef66999502d32cc7a0cb84bbe8214ed | [
"Unlicense"
] | null | null | null | Class Exercises/Problem 12.a51 | pronoym99/Microcontrollers-and-Applications | b96fbef72ef66999502d32cc7a0cb84bbe8214ed | [
"Unlicense"
] | null | null | null | ;program to sum the values 79h,F5h and E2h and store the sum in R0(LSB) and R5(MSB)
| 29 | 84 | 0.712644 |
0d24ca0221a19266f26595d26b0241ef66d35ec7 | 231 | asm | Assembly | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_back_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_back_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_vector/c/sdcc_iy/b_vector_back_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int b_vector_back(b_vector_t *v)
SECTION code_adt_b_vector
PUBLIC _b_vector_back_fastcall
EXTERN _b_array_back_fastcall
defc _b_vector_back_fastcall = _b_array_back_fastcall
INCLUDE "adt/b_vector/z80/asm_b_vector_back.asm"
| 17.769231 | 53 | 0.857143 |
2eb400375f4d8cf2fd9983ed6b87b5259b0fb487 | 3,674 | asm | Assembly | python/tests/testprog.asm | irmen/ksim68k | 12b02a70677a4b3e226ef40c0bdfcd25938cd7fd | [
"MIT"
] | 1 | 2022-01-13T22:20:39.000Z | 2022-01-13T22:20:39.000Z | kotlin/src/test/resources/testprog.asm | irmen/ksim68k | 12b02a70677a4b3e226ef40c0bdfcd25938cd7fd | [
"MIT"
] | null | null | null | kotlin/src/test/resources/testprog.asm | irmen/ksim68k | 12b02a70677a4b3e226ef40c0bdfcd25938cd7fd | [
"MIT"
] | null | null | null |
; simple test program
; assemble with vasm: http://sun.hasenbraten.de/vasm/
; $ vasmm68k_mot -Fbin testprog.asm -o testprog.bin
STACK_AREA = $00008000
org $0 ; vector jump table
dc.l STACK_AREA ; 0: SP
dc.l program_start ; 1: PC
dc.l unhandled_exception ; 2: bus error
dc.l unhandled_exception ; 3: address error
dc.l unhandled_exception ; 4: illegal instruction
dc.l unhandled_exception ; 5: zero divide
dc.l unhandled_exception ; 6: chk
dc.l unhandled_exception ; 7: trapv
dc.l unhandled_exception ; 8: privilege violation
dc.l unhandled_exception ; 9: trace
dc.l unhandled_exception ; 10: 1010
dc.l unhandled_exception ; 11: 1111
dc.l unhandled_exception ; 12: -
dc.l unhandled_exception ; 13: coprocessor protocol violation
dc.l unhandled_exception ; 14: format error
dc.l unhandled_exception ; 15: uninitialized interrupt
dc.l unhandled_exception ; 16: -
dc.l unhandled_exception ; 17: -
dc.l unhandled_exception ; 18: -
dc.l unhandled_exception ; 19: -
dc.l unhandled_exception ; 20: -
dc.l unhandled_exception ; 21: -
dc.l unhandled_exception ; 22: -
dc.l unhandled_exception ; 23: -
dc.l unhandled_exception ; 24: spurious interrupt
dc.l unhandled_exception ; 25: l1 irq
dc.l unhandled_exception ; 26: l2 irq
dc.l unhandled_exception ; 27: l3 irq
dc.l unhandled_exception ; 28: l4 irq
dc.l unhandled_exception ; 29: l5 irq
dc.l unhandled_exception ; 30: l6 irq
dc.l unhandled_exception ; 31: l7 irq
dc.l unhandled_exception ; 32: trap 0
dc.l unhandled_exception ; 33: trap 1
dc.l unhandled_exception ; 34: trap 2
dc.l unhandled_exception ; 35: trap 3
dc.l unhandled_exception ; 36: trap 4
dc.l unhandled_exception ; 37: trap 5
dc.l unhandled_exception ; 38: trap 6
dc.l unhandled_exception ; 39: trap 7
dc.l unhandled_exception ; 40: trap 8
dc.l unhandled_exception ; 41: trap 9
dc.l unhandled_exception ; 42: trap 10
dc.l unhandled_exception ; 43: trap 11
dc.l unhandled_exception ; 44: trap 12
dc.l unhandled_exception ; 45: trap 13
dc.l unhandled_exception ; 46: trap 14
dc.l $00 ; 47: trap 15 [ends program]
dc.l unhandled_exception ; 48: (FP) Branch or Set on Unordered Condition */
dc.l unhandled_exception ; 49: (FP) Inexact Result */
dc.l unhandled_exception ; 50: (FP) Divide by Zero */
dc.l unhandled_exception ; 51: (FP) Underflow */
dc.l unhandled_exception ; 52: (FP) Operand Error */
dc.l unhandled_exception ; 53: (FP) Overflow */
dc.l unhandled_exception ; 54: (FP) Signaling NAN */
dc.l unhandled_exception ; 55: (FP) Unimplemented Data Type */
dc.l unhandled_exception ; 56: MMU Configuration Error */
dc.l unhandled_exception ; 57: MMU Illegal Operation Error */
dc.l unhandled_exception ; 58: MMU Access Violation Error */
dc.l unhandled_exception ; 59: Reserved (NOT USED) */
dc.l unhandled_exception ; 60: Reserved (NOT USED) */
dc.l unhandled_exception ; 61: Reserved (NOT USED) */
dc.l unhandled_exception ; 62: Reserved (NOT USED) */
dc.l unhandled_exception ; 63: Reserved (NOT USED) */
; user interrupt vectors follow: $0100-$03ff
blk.l 192, $0
CHROUT = $00fff002 ; note: 68000 only has 24 bits address bus
program_start:
lea.l string,a0
.loop move.b (a0)+,d0
beq.s .stop
move.b d0,CHROUT
bra.s .loop
.stop moveq.l #99,d0
illegal ; forcibly end program
unhandled_exception:
stop #$2700 ; wait for NMI
bra.s unhandled_exception
string:
dc.b "Hello, world! From the 68000 assembly program.",10,0
| 36.376238 | 90 | 0.682635 |
09e6c77e25339850e80627ef4fb7f523cee865bd | 691 | asm | Assembly | oeis/171/A171842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/171/A171842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/171/A171842.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A171842: Binomial transform of 1,0,1,0,2,0,4,0,8,0,16,...
; Submitted by Jamie Morken(s2)
; 1,1,2,4,9,21,50,120,289,697,1682,4060,9801,23661,57122,137904,332929,803761,1940450,4684660,11309769,27304197,65918162,159140520,384199201,927538921,2239277042,5406093004,13051463049,31509019101,76069501250,183648021600,443365544449,1070379110497,2584123765442,6238626641380,15061377048201,36361380737781,87784138523762,211929657785304,511643454094369,1235216565974041,2982076586042450,7199369738058940,17380816062160329,41961001862379597,101302819786919522,244566641436218640,590436102659356801
lpb $0
sub $0,1
mov $2,$1
mov $1,$3
add $1,1
add $2,$3
add $3,$2
lpe
mov $0,$3
add $0,1
| 46.066667 | 497 | 0.804631 |
74c29f520cbc600cdbc27b23bd3df8437c7499d9 | 413 | asm | Assembly | patches/screaming_wings/disasm/patched_screaming_wings_block_3.asm | fcatrin/a8tools | 2792cfbabc9e3fd369550b810f631d62e03c8b90 | [
"MIT"
] | 3 | 2020-07-02T15:11:23.000Z | 2020-07-03T19:59:08.000Z | patches/screaming_wings/disasm/patched_screaming_wings_block_3.asm | fcatrin/a8tools | 2792cfbabc9e3fd369550b810f631d62e03c8b90 | [
"MIT"
] | null | null | null | patches/screaming_wings/disasm/patched_screaming_wings_block_3.asm | fcatrin/a8tools | 2792cfbabc9e3fd369550b810f631d62e03c8b90 | [
"MIT"
] | null | null | null |
; BLOCK 3 patched_screaming_wings.xex
org $B700
L_B700 ldy #$00
tya
clc
tax
L_B705 txa
adc L_B776,y
tax
iny
cpy #$50
bne L_B705
cpx #$5B
beq L_B716
jsr COLDSV
L_B716 jmp $4380
| 20.65 | 37 | 0.324455 |
61152960bc7a0bd1b3d82aa09f489c1e0cd4f065 | 665 | asm | Assembly | programs/oeis/168/A168106.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168106.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168106.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168106: a(n) = sum of natural numbers m such that n - 7 <= m <= n + 7.
; 28,36,45,55,66,78,91,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,405,420,435,450,465,480,495,510,525,540,555,570,585,600,615,630,645,660,675,690,705,720,735,750,765,780,795,810,825,840,855,870,885,900,915,930,945,960,975,990,1005,1020,1035,1050,1065,1080,1095,1110,1125,1140,1155,1170,1185,1200,1215,1230,1245,1260,1275,1290,1305,1320,1335,1350,1365,1380,1395,1410,1425,1440,1455,1470,1485
mov $2,$0
add $2,8
mov $3,1
lpb $2
lpb $3
add $2,1
mov $3,5
add $4,5
add $3,$4
lpe
sub $2,1
add $1,$2
add $3,1
mov $4,5
lpe
mov $0,$1
| 33.25 | 427 | 0.664662 |
eee86f17cbfcfe439f818ef7451395e5b8824618 | 243 | asm | Assembly | programs/oeis/176/A176743.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/176/A176743.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/176/A176743.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A176743: a(n) = gcd(A000217(n+1), A002378(n+2)).
; 1,3,2,10,3,7,4,18,5,11,6,26,7,15,8,34,9,19,10,42,11,23,12,50,13,27,14,58,15,31,16,66,17,35,18,74,19,39,20,82,21,43,22,90,23,47,24,98,25,51,26
add $0,2
mov $1,$0
mul $0,2
bin $1,2
gcd $0,$1
| 27 | 143 | 0.600823 |
be29365add6661bb29efc54c59d39474d9692856 | 1,186 | asm | Assembly | src/util/sprite/cursor.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/sprite/cursor.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | src/util/sprite/cursor.asm | olifink/qspread | d6403d210bdad9966af5d2a0358d4eed3f1e1c02 | [
"MIT"
] | null | null | null | ;Sprite source code generated with EASYSOURCE 1991 Albin Hessler Software
;**************************************************************************
; -> asm_spr_ <- 1992 Jun 13 12:42:56
section sprite
xdef mes_curs
mes_curs
sp1
dc.w $0100,$0000 ;form, time/adaption
dc.w $0006,$000A ;x size, y size
dc.w $0003,$0004 ;x origin, y origin
dc.l cp1-* ;pointer to colour pattern
dc.l pm1-* ;pointer to pattern mask
dc.l 0 ;pointer to next definition
cp1
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
dc.w $FCFC,$0000
pm1
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
dc.w $0000,$0000
;
end
| 29.65 | 75 | 0.425801 |
248d40c04bd83fb9a1daf9ffe7ef13628fb96228 | 691 | asm | Assembly | oeis/238/A238720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/238/A238720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/238/A238720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A238720: Number of nX2 0..2 arrays with no element equal to the sum modulo 3 of elements to its left or elements above it
; 2,4,10,16,42,64,170,256,682,1024,2730,4096,10922,16384,43690,65536,174762,262144,699050,1048576,2796202,4194304,11184810,16777216,44739242,67108864,178956970,268435456,715827882,1073741824,2863311530,4294967296,11453246122,17179869184,45812984490,68719476736,183251937962,274877906944,733007751850,1099511627776,2932031007402,4398046511104,11728124029610,17592186044416,46912496118442,70368744177664,187649984473770,281474976710656,750599937895082,1125899906842624,3002399751580330,4503599627370496
mov $1,2
pow $1,$0
gcd $0,2
add $0,2
mul $0,$1
div $0,3
mul $0,2
| 62.818182 | 500 | 0.835022 |
987b307f1c151d66d7c13dc6f8963f6d62dd2ce2 | 5,832 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_sm_/i3-7100_9_0xca_notsx.log_21829_262.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_sm_/i3-7100_9_0xca_notsx.log_21829_262.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_sm_/i3-7100_9_0xca_notsx.log_21829_262.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 %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x14c28, %r14
cmp %r10, %r10
vmovups (%r14), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %r11
nop
nop
nop
dec %r13
lea addresses_WT_ht+0xfbe8, %r8
nop
nop
nop
sub %r9, %r9
movb $0x61, (%r8)
nop
nop
nop
nop
add %rax, %rax
lea addresses_A_ht+0x11a68, %rsi
lea addresses_WT_ht+0x3428, %rdi
nop
nop
nop
dec %r9
mov $52, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %r9, %r9
lea addresses_WT_ht+0x13478, %rsi
nop
xor %r9, %r9
mov $0x6162636465666768, %r8
movq %r8, %xmm2
movups %xmm2, (%rsi)
nop
nop
nop
nop
cmp %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WT+0xfa28, %rsi
lea addresses_normal+0x16960, %rdi
clflush (%rsi)
nop
nop
nop
add %r13, %r13
mov $127, %rcx
rep movsb
nop
nop
nop
dec %rdi
// Store
mov $0x428, %r12
clflush (%r12)
nop
nop
nop
add $21527, %rdx
movw $0x5152, (%r12)
sub %rsi, %rsi
// Store
mov $0x274790000000428, %rcx
nop
nop
nop
xor $23458, %r8
mov $0x5152535455565758, %r13
movq %r13, %xmm3
vmovntdq %ymm3, (%rcx)
nop
nop
nop
nop
nop
add $8859, %r12
// Faulty Load
mov $0x274790000000428, %rdi
nop
nop
nop
nop
nop
sub $25339, %rcx
mov (%rdi), %r8
lea oracles, %rdi
and $0xff, %r8
shlq $12, %r8
mov (%rdi,%r8,1), %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_P', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}}
{'58': 21549, '39': 137, '00': 135, '52': 8}
58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 39 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 39 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 36.45 | 2,999 | 0.655693 |
21e8869022f8dc7a3e23b499b77dc785565b0f6f | 1,013 | asm | Assembly | MySource/12-jge-100-80-60-40-cmp.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null | MySource/12-jge-100-80-60-40-cmp.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null | MySource/12-jge-100-80-60-40-cmp.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null |
; a number > 100 ? or >= 80 ? > 60 or >= 40 ? or>= 20
;or less then 20
org 100h
include "emu8086.inc"
.model small
.stack 100h
.data
.code
main proc
mov bx,80
cmp bx,100 ;cmp >= 100
jge if1
cmp bx,80
jge if2
cmp bx,60
jge if3
cmp bx,40
jge if4
cmp bx,20 ;cmp >= 100
jge if5
jmp else
if1:
printn "The number is grater or equal 100 "
jmp end_if
if2:
printn "The number is grater or equal 80 "
jmp end_if
if3:
printn "The number is grater or equal 60 "
jmp end_if
if4:
printn "The number is grater or equal 40 "
jmp end_if
if5:
printn "The number is grater or equal 20 "
jmp end_if
else:
printn "The number is less then 20 "
jmp end_if
end_if:
mov ah,4ch
int 21h
main endp
end main
ret
| 13.328947 | 54 | 0.479763 |
e252e2cf173fc2a70f3817a15de6031323d53fae | 391 | asm | Assembly | programs/oeis/036/A036583.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/036/A036583.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/036/A036583.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A036583: Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.
; 1,3,2,1,2,3,1,3,2,3,1,2,1,3,2,1,2,3,1,2,1,3,2,3,1,3,2,1,2,3,1,3,2,3,1,2,1,3,2,3,1,3,2,1,2,3,1,2,1,3,2,1,2,3,1,3,2,3,1,2,1,3,2,1,2,3,1,2,1,3,2,3,1,3,2,1,2,3,1,2,1,3,2,1,2,3,1,3,2,3,1,2,1,3,2,3,1,3,2
cal $0,29883 ; First differences of Thue-Morse sequence A001285.
add $0,11
lpb $0
mod $0,3
lpe
mov $1,$0
add $1,1
| 35.545455 | 199 | 0.585678 |
d0f0ddd62bedd87cfc2b1a980a54e499bf5f05d6 | 577 | asm | Assembly | libsrc/stdio_new/file/vprintf_callee.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/stdio_new/file/vprintf_callee.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/stdio_new/file/vprintf_callee.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ; int __CALLEE__ vprintf_callee(const char *format, void *arg_ptr)
; 05.2008 aralbrec
XLIB vprintf_callee
XDEF ASMDISP_VPRINTF_CALLEE
LIB vfprintf_callee
XREF ASMDISP_VFPRINTF_CALLEE, _stdout
.vprintf_callee
pop hl
pop bc
pop de
push hl
.asmentry
; enter : de = format string
; bc = & parameter list (arg_ptr)
; exit : hl = number of chars output to stream
; carry if stream error: ERRNO set and hl=-1
ld ix,(_stdout)
jp vfprintf_callee + ASMDISP_VFPRINTF_CALLEE
defc ASMDISP_VPRINTF_CALLEE = asmentry - vprintf_callee
| 20.607143 | 66 | 0.712305 |
fd76c2040cfb6e64134282cc327b39e7f8905470 | 628 | asm | Assembly | programs/oeis/331/A331261.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/331/A331261.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/331/A331261.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A331261: List of pairs of numbers having certain properties (see Comments).
; 0,1,4,5,24,25,144,145,840,841,4900,4901,28560,28561,166464,166465,970224,970225,5654884,5654885,32959080,32959081,192099600,192099601,1119638520,1119638521,6525731524,6525731525,38034750624,38034750625,221682772224,221682772225
mov $5,2
mov $6,$0
lpb $5
mov $0,$6
mov $3,0
sub $5,1
add $0,$5
sub $0,1
lpb $0
mov $2,$0
trn $0,2
max $2,0
seq $2,7052 ; Number of order-consecutive partitions of n.
add $3,$2
div $3,2
lpe
mov $4,$5
mul $4,$3
add $1,$4
mov $7,$3
lpe
min $6,1
mul $6,$7
sub $1,$6
mov $0,$1
| 21.655172 | 229 | 0.66242 |
2cdd95b081fd854a7902fcdac6e7ecbc66f5512b | 321 | asm | Assembly | scripts/CeladonHotel.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | scripts/CeladonHotel.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | scripts/CeladonHotel.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | CeladonHotel_Script:
jp EnableAutoTextBoxDrawing
CeladonHotel_TextPointers:
dw CeladonHotelText1
dw CeladonHotelText2
dw CeladonHotelText3
CeladonHotelText1:
text_far _CeladonHotelText1
text_end
CeladonHotelText2:
text_far _CeladonHotelText2
text_end
CeladonHotelText3:
text_far _CeladonHotelText3
text_end
| 16.05 | 28 | 0.872274 |
b21b39b0bcf6bbd386c5a2a3b2ce6e13d2c03cf5 | 876 | asm | Assembly | extras/source/cline.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | extras/source/cline.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | extras/source/cline.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | section none
xref sb_addstt
xref rt_int
include dev8_keys_sbasic
; macro to define keywords where name & name of routine are the same
kwrd macro name
dc.w [name]-*
dc.b [.len(name)]
dc.b '[name]'
endm
debut
MOVE.W $110,A2
LEA procs,A1
JMP (A2) ; link in new keywords
procs DC.W 0,0,2 ; pretend there are 2 keywords as name too long
kwrd CURRENT_LINE
dc.l 0
current_line
moveq #0,d4
tst.b sb_cmdl(a6) ; command line parsing?
bne rt_int ; ... yes, so return line number 0
cmp.l #'SBAS',-4(a6) ; Sbasic ?
beq.s sbas ; ... yes
move.w sb_line(a6),d4 ; ... no, try to get line number
bra rt_int ;
; this is copied from TT's sbas_sttadd_asm
sbas move.l a4,d0
subq.l #2,d0 ; this is in "current" statement
jsr sb_addstt ; find line and statement number
swap d0 ; line number in upper word
move.w d0,d4 ; return it now
bra rt_int
end
| 21.365854 | 68 | 0.681507 |
3c62cb9ed82eb9efbed30025337c64152b5306d6 | 402 | asm | Assembly | Lista2/Lista2/Parte2/Programa20.asm | GustavoLR548/ACII-GLR | 135690945f5e29938ef640a3d5475f8a12dbd76c | [
"MIT"
] | 1 | 2021-11-03T17:22:02.000Z | 2021-11-03T17:22:02.000Z | Lista2/Lista2/Parte2/Programa20.asm | GustavoLR548/ACII-GLR | 135690945f5e29938ef640a3d5475f8a12dbd76c | [
"MIT"
] | null | null | null | Lista2/Lista2/Parte2/Programa20.asm | GustavoLR548/ACII-GLR | 135690945f5e29938ef640a3d5475f8a12dbd76c | [
"MIT"
] | null | null | null | .data
x: .word 10 # Declarando "x" como 10
y: .word 15 # Declarando "y" como 15
k: .word -1 # Declarando "k" como -1
.text
ori $t0,$zero,0x1001 # t0 = 1000
sll $t0,$t0,16 # t0 = 10000000
lw $s0, 0($t0) # s0 = x = 10
lw $s1, 4($t0) # s1 = y = 15
mult $s0,$s1 # Multiplicar o conteudo em s0 com s1
mflo $s2 # Carregar o conteudo em LO em s2
#Salvando o valor de k na mémoria
sw $s2,8($t0)
| 22.333333 | 51 | 0.604478 |
ee02c6799b018ab35500c265dd7caf549a98efeb | 3,728 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_zr_4k_sm_/i7-7700_9_0x48.log_205_1573.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_4k_sm_/i7-7700_9_0x48.log_205_1573.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_zr_4k_sm_/i7-7700_9_0x48.log_205_1573.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %rdi
push %rsi
lea addresses_WT_ht+0x1b733, %r14
nop
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %r13
movq %r13, (%r14)
nop
nop
nop
nop
nop
and $61322, %rsi
pop %rsi
pop %rdi
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %r9
push %rax
push %rbx
push %rcx
// Load
mov $0xa92, %r10
nop
nop
nop
nop
nop
and $44955, %r9
mov (%r10), %bx
nop
nop
nop
nop
nop
sub $42392, %r10
// Store
mov $0x992, %rbx
nop
nop
sub $30035, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm5
vmovups %ymm5, (%rbx)
nop
nop
cmp $49179, %rbx
// Store
lea addresses_PSE+0x1b632, %r9
nop
nop
and $24223, %rcx
movw $0x5152, (%r9)
nop
xor $55891, %r13
// Store
lea addresses_D+0x1a292, %rbx
nop
nop
nop
nop
nop
cmp $51697, %rax
movb $0x51, (%rbx)
// Exception!!!
nop
nop
nop
nop
mov (0), %r9
cmp %rbx, %rbx
// Store
lea addresses_D+0x3992, %r13
nop
and $56117, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%r13)
nop
nop
cmp $16964, %r10
// Store
lea addresses_WC+0x15c32, %rax
nop
nop
nop
and %r9, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm0
movups %xmm0, (%rax)
nop
nop
nop
nop
nop
sub %rax, %rax
// Store
mov $0x992, %r8
sub $41286, %rbx
movw $0x5152, (%r8)
nop
nop
nop
xor $39709, %rcx
// Store
mov $0x3528ae0000000ff6, %rbx
nop
nop
nop
and %r9, %r9
movb $0x51, (%rbx)
nop
nop
nop
dec %r8
// Faulty Load
mov $0x992, %rcx
nop
nop
sub $2773, %rax
vmovaps (%rcx), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %rbx
lea oracles, %r8
and $0xff, %rbx
shlq $12, %rbx
mov (%r8,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'52': 199, '00': 6}
00 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 00 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 20.94382 | 614 | 0.635461 |
02a27b54276a99e4f9d34866294c5971b524b353 | 160 | asm | Assembly | test/assembly/simple.asm | megis7/riscy | e0e41ecfe65941abfd5e72b750f95931af807c0e | [
"BSD-3-Clause"
] | 4 | 2019-04-05T20:18:55.000Z | 2019-04-19T02:32:46.000Z | test/assembly/simple.asm | megis7/riscy | e0e41ecfe65941abfd5e72b750f95931af807c0e | [
"BSD-3-Clause"
] | null | null | null | test/assembly/simple.asm | megis7/riscy | e0e41ecfe65941abfd5e72b750f95931af807c0e | [
"BSD-3-Clause"
] | null | null | null | .text
main:
addi x1, x0, 1
addi x2, x0, 2
addi x3, x0, 3
addi x4, x0, 5
addi x5, x0, 8
addi x6, x0, 12
addi x7, x0, 15
add x8, x1, x2
add x9, x9, x2 | 13.333333 | 16 | 0.56875 |
48b7f274ee5bb9b39a707ca699404d41e6ce4e8d | 43,561 | asm | Assembly | Appl/GeoCalc/Document/documentClass.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/GeoCalc/Document/documentClass.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/GeoCalc/Document/documentClass.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: GeoCalc
FILE: documentClass.asm
AUTHOR: Gene Anderson, Feb 12, 1991
ROUTINES:
Name Description
---- -----------
GLB GeoCalcDocumentClass GeoCalc document
REVISION HISTORY:
Name Date Description
---- ---- -----------
Gene 2/12/91 Initial revision
DESCRIPTION:
This file contains routines to implement the GeoCalcDocument class
$Id: documentClass.asm,v 1.1 97/04/04 15:48:00 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcClassStructures segment resource
GeoCalcDocumentClass ;declare the class record
GeoCalcClassStructures ends
Document segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SendToDocSpreadsheet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a method to the associated spreadsheet object
CALLED BY: UTILITY
PASS: *ds:si - GeoCalcDocumentClass instance
ax - method to send to Spreadsheet
cx, dx, bp - data for method
di - MessageFlags to use
RETURN: none
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SendFileToDocSpreadsheet proc far
uses dx
class GeoCalcDocumentClass
.enter
call GetSpreadsheetFile ;
mov dx, bx ;dx <- file handle of ssheet
call SendToDocSpreadsheet
.leave
ret
SendFileToDocSpreadsheet endp
SendToDocSpreadsheet proc far
uses ax, bx, cx, si
class GeoCalcDocumentClass
.enter
call GetDocSpreadsheet ;^lbx:si <- OD of spreadsheet
call ObjMessage
.leave
ret
SendToDocSpreadsheet endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetDocSpreadsheet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get OD of spreadsheet associated with a document
CALLED BY: SendToDocSpreadsheet()
PASS: *ds:si - GeoCalcDocument object
RETURN: ^lbx:si - OD of associated spreadsheet
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 10/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetDocSpreadsheet proc far
class GeoCalcDocumentClass
.enter
Assert objectPtr dssi GeoCalcDocumentClass
mov si, ds:[si]
add si, ds:[si].GeoCalcDocument_offset
mov bx, ds:[si].GCDI_spreadsheet ;bx <- handle of spreadsheet blk
mov si, offset ContentSpreadsheet ;^lbx:si <- OD of spreadsheet
Assert optr bxsi
.leave
ret
GetDocSpreadsheet endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentDetach
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: save file name for re-opening
CALLED BY: MSG_META_DETACH
PASS: *ds:si = GeoCalcDocumentClass object
ds:di = GeoCalcDocumentClass instance data
ds:bx = GeoCalcDocumentClass object (same as *ds:si)
es = segment of GeoCalcDocumentClass
ax = message #
cx, dx, bp = detach data
RETURN:
DESTROYED:
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 3/10/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if not _SAVE_TO_STATE
InitCode segment resource
GeoCalcDocumentDetach method dynamic GeoCalcDocumentClass,
MSG_META_DETACH
uses ax, cx, dx, bp, es, ds, si
filePath local PathName
.enter
push bp
;
; save path to .ini file
;
push ds, si ; save doc obj
push bp ; save locals
mov dx, ss
lea bp, filePath
mov cx, size PathName ; in bytes!
mov ax, MSG_GEN_PATH_GET
call ObjCallInstanceNoLock ; cx = disk handle
mov bx, cx ; bx = disk handle
segmov es, ss
lea di, filePath ; pass fptr, will be unchanged
mov cx, 0 ; just return size
call DiskSave ; cx = size
sub sp, cx ; make room for DiskSave
mov di, sp ; es:di = stack buffer
call DiskSave
mov bp, cx ; bp = save size
mov cx, cs
mov ds, cx
mov si, offset saveFileCategory
mov dx, offset saveFileDiskKey
call InitFileWriteData ; save disk handle
add sp, bp ; free stack buffer
pop bp ; bp = locals
mov dx, offset saveFilePathKey
segmov es, ss
lea di, filePath ; es:di = path
LocalStrSize includeNull
lea di, filePath
mov bp, cx
mov cx, cs
call InitFileWriteData
pop ds, si ; *ds:si = doc obj
;
; save filename to .ini file
; *ds:si = doc obj
;
segmov es, ds
mov di, ds:[si]
add di, ds:[di].Gen_offset
lea di, ds:[di].GDI_fileName ; es:di = filename
push di
LocalStrSize includeNull
pop di
mov bp, cx
mov cx, cs
mov ds, cx
mov si, offset saveFileCategory
mov dx, offset saveFileNameKey
call InitFileWriteData
pop bp
;
; call super for default handling
;
.leave
mov di, offset GeoCalcDocumentClass
GOTO ObjCallSuperNoLock
GeoCalcDocumentDetach endm
InitCode ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentCreateUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create associated UI for new spreadsheet document
CALLED BY: MSG_GEN_DOCUMENT_CREATE_UI_FOR_DOCUMENT
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN:
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentCreateUI method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_CREATE_UI_FOR_DOCUMENT
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
;
; clear bits for unmanaged geometry
;
mov bx, Vis_offset
call ObjInitializePart
mov di, ds:[si]
add di, ds:[di].Vis_offset
andnf ds:[di].VI_attrs, not (mask VA_MANAGED)
andnf ds:[di].VI_optFlags, not (mask VOF_GEOMETRY_INVALID \
or mask VOF_GEO_UPDATE_PATH)
;
; Duplicate block with spreadsheet object and ruler objects.
;
mov bx, handle ContentSpreadsheet
clr ax ; have current geode own block
mov cx, -1 ; copy running thread from
; template block
call ObjDuplicateResource
;
; Save the handle of the duplicated block
;
mov di, ds:[si]
add di, ds:[di].GeoCalcDocument_offset
mov ds:[di].GCDI_spreadsheet, bx ;save handle of spreadsheet blk
ret
GeoCalcDocumentCreateUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentDestroyUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Destroy UI-related blocks for document
CALLED BY: MSG_GEN_DOCUMENT_DESTROY_UI_FOR_DOCUMENT
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentDestroyUI method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_DESTROY_UI_FOR_DOCUMENT
push ax
;
; Free the spreadsheet block
;
mov ax, MSG_META_BLOCK_FREE
mov di, mask MF_FORCE_QUEUE
call SendToDocSpreadsheet
;
; Let our superclass do its thing (last!)
;
pop ax
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
ret
GeoCalcDocumentDestroyUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentAttachUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Attach UI for new or existing spreadsheet document
CALLED BY: MSG_GEN_DOCUMENT_ATTACH_UI_TO_DOCUMENT
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentAttachUI method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_ATTACH_UI_TO_DOCUMENT
;
; Let our superclass do its thing
;
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
;
; set bits for getting mouse events
;
mov bx, Vis_offset
call ObjInitializePart
mov di, ds:[si]
add di, ds:[di].Vis_offset
ornf ds:[di].VCNI_attrs, mask VCNA_LARGE_DOCUMENT_MODEL \
or mask VCNA_WINDOW_COORDINATE_MOUSE_EVENTS
if _CHARTS
;
; Tell the spreadsheet to attach internal and external UI
;
mov di, ds:[si]
add di, ds:[di].Gen_offset ;ds:si <- gen instance data
;
; Prepare a block with necessary setup data
;
mov ax, (size SpreadsheetSetupData) ;ax <- size
mov cx, ALLOC_DYNAMIC_NO_ERR_LOCK ;cl,ch <- HeapAllocFlags
call MemAlloc
mov es, ax ;es <- seg addr of block
mov ax, ds:[di].GDI_display
;
; Stick the chart/grobj body in the setup data
;
push bx, si
call GetGrObjBodyOD
movdw es:[SSD_chartBody], bxsi
pop bx, si
call MemUnlock
mov cx, bx ;cx <- handle of setup block
mov dx, ds:[di].GDI_fileHandle ;dx <- VM file handle
mov ax, MSG_SPREADSHEET_ATTACH_UI
mov di, mask MF_CALL or mask MF_FIXUP_DS
call SendToDocSpreadsheet
endif
;
; Add the spreadsheet as our child
;
mov di, ds:[si]
add di, ds:[di].GeoCalcDocument_offset
mov cx, ds:[di].GCDI_spreadsheet
push cx ;save ruler handle
mov dx, offset ContentSpreadsheet ;^lcx:dx <- OD of child
clr bp ;bp <- CompChildFlags
mov ax, MSG_VIS_ADD_CHILD
call ObjCallInstanceNoLock
;
; Send the spreadsheet block off to the display for attaching the UI
;
mov di, ds:[si]
add di, ds:[di].GeoCalcDocument_offset
mov cx, ds:[di].GCDI_spreadsheet ; handle of spreadsheet blk
mov di, ds:[si]
add di, ds:[di].Gen_offset ;ds:si <- gen instance data
mov bx, ds:[di].GDI_display ;bx <- handle of display
push si
mov si, offset DisplayDisplay
mov ax, MSG_DISPLAY_ATTACH_UI
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop si
;
; Add graphic body to head and to document
;
if _CHARTS
push si
call GetGrObjBodyOD
pop si
call GeoCalcDocumentAddBodyToDocument
;
; Notify body that document is being opened, passing it head od
;
GetResourceHandleNS GCGrObjHead, cx
mov dx, offset GCGrObjHead ;cx:dx <- head OD
mov ax, MSG_GB_ATTACH_UI
mov di, mask MF_FIXUP_DS
call SendToGrObjBody
endif
pop cx ; cx - handle of content
; (spreadsheet) block
if _CHARTS
;
; Attach rulers to body
;
mov dx, offset GCColumnRuler
mov di,mask MF_FIXUP_DS
mov ax,MSG_GB_ATTACH_RULER
call SendToGrObjBody
endif
if _SPLIT_VIEWS
call GeoCalcDocumentAttachSplitViews
endif
;
; Set the target based on the tool
;
CHART< mov ax, MSG_GEOCALC_DOCUMENT_SET_TARGET_BASED_ON_TOOL >
CHART< GOTO ObjCallInstanceNoLock >
NOCHART<ret >
GeoCalcDocumentAttachUI endm
if _SPLIT_VIEWS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentAttachSplitViews
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Attach all the various views to their contents
CALLED BY: GeoCalcDocumentAttachUI
PASS: cx - handle of content block
*ds:si - GeoCalcDocumentClass object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 8/24/94 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentAttachSplitViews proc near
uses ax,bx,cx,dx,di,si,bp,es
class GeoCalcDocumentClass
.enter
mov bx, cx ; content block
mov cx, ds:[LMBH_handle]
mov dx, si
mov si, offset MidLeftContent
call callSetMaster
mov si, offset MidRightContent
call callSetMaster
mov si, offset BottomLeftContent
call callSetMaster
.leave
ret
callSetMaster:
mov ax, MSG_GEOCALC_CONTENT_SET_MASTER
mov di, mask MF_FIXUP_DS
call ObjMessage
retn
GeoCalcDocumentAttachSplitViews endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentDetachUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Close document by sending message to body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GeoCalcDocumentClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/ 6/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentDetachUI method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_DETACH_UI_FROM_DOCUMENT
.enter
;
; Have superclass do its thang
;
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
;
; Remove the spreadsheet as a child of the document and
; hence as part of the visual tree
;
mov ax, MSG_VIS_REMOVE
mov dl, VUM_MANUAL ;dl <- VisUpdateMode
mov di, mask MF_FIXUP_DS
call SendToDocSpreadsheet
;
; Remove body from and document
;
if _CHARTS
push si
call GetGrObjBodyOD
pop si
call GeoCalcDocumentRemoveBodyFromDocument
endif
.leave
ret
GeoCalcDocumentDetachUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentReadCachedData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Force reading of cached data from file
CALLED BY: MSG_GEN_DOCUMENT_READ_CACHED_DATA_FROM_FILE
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentReadCachedData method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_READ_CACHED_DATA_FROM_FILE
mov ax, MSG_SPREADSHEET_READ_CACHED_DATA
mov di, mask MF_CALL or mask MF_FIXUP_DS
call GetSpreadsheetMap ;dx <- VM handle of map
call SendFileToDocSpreadsheet
;
; In the event this is a revert, we force a redraw of the rulers
; so things like column widths update correctly.
;
mov ax, MSG_VIS_RULER_INVALIDATE_WITH_SLAVES
call GetDocSpreadsheet
mov si, offset GCColumnRuler ;^lbx:si <- OD of master ruler
mov di, mask MF_FIXUP_DS or mask MF_CALL
GOTO ObjMessage
GeoCalcDocumentReadCachedData endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentWriteCachedData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Force writing of cached data to file
CALLED BY: MSG_GEN_DOCUMENT_WRITE_CACHED_DATA_TO_FILE
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentWriteCachedData method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_WRITE_CACHED_DATA_TO_FILE
mov ax, MSG_SPREADSHEET_WRITE_CACHED_DATA
mov di, mask MF_CALL or mask MF_FIXUP_DS
call SendFileToDocSpreadsheet
ret
GeoCalcDocumentWriteCachedData endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentSaveAsCompleted
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle end of "save as": file handle changes
CALLED BY: MSG_GEN_DOCUMENT_SAVE_AS_COMPLETED
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the method
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/29/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentSaveAsCompleted method dynamic GeoCalcDocumentClass, \
MSG_GEN_DOCUMENT_SAVE_AS_COMPLETED
mov ax, MSG_SPREADSHEET_ATTACH_FILE
mov di, mask MF_CALL or mask MF_FIXUP_DS
call GetSpreadsheetMap ;dx <- VM handle of map
call SendFileToDocSpreadsheet
;
; In the event any display formulas include =FILENAME(),
; force a redraw so they update correctly.
;
mov ax, MSG_SPREADSHEET_COMPLETE_REDRAW
call SendToDocSpreadsheet
ret
GeoCalcDocumentSaveAsCompleted endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentUpdateCompatibleDocument
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update a compatible document
CALLED BY: MSG_GEN_DOCUMENT_UPDATE_EARLIER_COMPATIBLE_DOCUMENT
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN: carry - set for error
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 1/25/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentUpdateCompatibleDocument method dynamic GeoCalcDocumentClass,
MSG_GEN_DOCUMENT_UPDATE_EARLIER_COMPATIBLE_DOCUMENT
mov ax, -1 ;ax <- OK to up protocol
clc ;carry <- no error
ret
GeoCalcDocumentUpdateCompatibleDocument endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentUpdateIncompatibleDocument
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update an incompatible document
CALLED BY: MSG_GEN_DOCUMENT_UPDATE_EARLIER_INCOMPATIBLE_DOCUMENT
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN: carry - set for error
ax - non-zero to update documents protocol
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 1/25/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentUpdateIncompatibleDocument method dynamic GeoCalcDocumentClass,
MSG_GEN_DOCUMENT_UPDATE_EARLIER_INCOMPATIBLE_DOCUMENT
clr ax ;ax <- do not up protocol
stc ;carry <- error
ret
GeoCalcDocumentUpdateIncompatibleDocument endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentSendClassedEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Determine where to send this event
PASS: *ds:si = GeoCalcDocumentClass object
ds:di = GeoCalcDocumentClass instance data
es = Segment of GeoCalcDocumentClass.
RETURN: nothing
DESTROYED: ax,cx,dx,bp
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 12/26/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentSendClassedEvent method dynamic GeoCalcDocumentClass,
MSG_META_SEND_CLASSED_EVENT
;
; Get the class of the destination
;
push ax, cx, si
mov bx, cx
call ObjGetMessageInfo
movdw bxdi, cxsi ;bxdi <- class ptr
;
; check specially for PASTE
;
cmp ax, MSG_META_CLIPBOARD_PASTE
pop ax, cx, si
jne checkCharts
push cx ;preserve event handle
call DocumentDoPaste ;branch if paste
pop bx ;restore event handle
;
; Free the event handle (bx).
;
call ObjFreeMessage
ret
checkCharts:
;
; See if this message should go to the GrObjHead
;
if _CHARTS
cmp bx, segment GrObjHeadClass
jne notHead
cmp di, offset GrObjHeadClass
jne notHead
GetResourceHandleNS GCGrObjHead, bx
mov si, offset GCGrObjHead
clr di
GOTO ObjMessage
endif
notHead::
;
; Destined for the VisRuler?
;
cmp bx, segment VisRulerClass
jne notRuler
cmp di, offset VisRulerClass
jne notRuler
;
; this message is destined for the VisRuler
;
mov si, ds:[si]
add si, ds:[si].GeoCalcDocument_offset
mov bx, ds:[si].GCDI_spreadsheet ;bx <- handle of
;spreadsheet block
mov si, offset GCColumnRuler
clr di
GOTO ObjMessage
notRuler:
; check for the attribute manager
if _CHARTS
cmp bx, segment GrObjAttributeManagerClass
jne notAttrMgr
cmp di, offset GrObjAttributeManagerClass
jne notAttrMgr
; this message is destined for the attribute manager
mov ax, MSG_META_SEND_CLASSED_EVENT
clr di
call SendToOAM
ret
endif
notAttrMgr::
; check for grobj class. let the body handle 'em if so
;
if _CHARTS
cmp bx, segment GrObjClass
jne checkBody
cmp di, offset GrObjClass
je toBody
checkBody:
cmp bx, segment GrObjBodyClass
jne notBody
cmp di, offset GrObjBodyClass
jne notBody
; this message is destined for the body -- find it
toBody:
mov ax, MSG_META_SEND_CLASSED_EVENT
clr di
call SendToGrObjBody
ret
endif
notBody::
;
; We don't know where this message is going -- just send it to
; our superclass.
;
mov di, offset GeoCalcDocumentClass
GOTO ObjCallSuperNoLock
GeoCalcDocumentSendClassedEvent endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DocumentDoPaste
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle a paste...
CALLED BY: MSG_META_CLIPBOARD_
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN: none
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 3/17/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DocumentDoPaste proc far
;
; See if transfer contains spreadsheet data
;
clr bp ;bp <- ClipboardItemFlags
call ClipboardQueryItem
tst bp ;any items available?
jz sendToSpreadsheet ;branch if none (why?)
;
; does CIF_SPREADSHEET format exist ?
;
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, CIF_SPREADSHEET ;cx:dx <- format to check
call ClipboardTestItemFormat
jc sendToEditBarOrGrObj ;branch if no spreadsheet data
;
; Spreadsheet data exists -- pass off to the spreadsheet
; unless the grobj is the target, in which case we guess...
;
call getTargetLayer ;grobj target?
jne sendToSpreadsheet ;branch if spreadsheet target
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, CIF_TEXT
call ClipboardTestItemFormat
jnc sendToGrObj ;branch if text data
sendToSpreadsheet:
call ClipboardDoneWithItem
call GetDocSpreadsheet ;^lbx:si <- OD of spreadsheet
mov cl, GCTL_SPREADSHEET
jmp sendToLayer
;
; There is no spreadsheet transfer available. See if we
; should send it to the grobj or the edit bar.
;
sendToEditBarOrGrObj:
call getTargetLayer
je sendToGrObj ;branch if grobj is target
;
; If text exists, send to the edit bar
;
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, CIF_TEXT ;cx:dx <- format to check
call ClipboardTestItemFormat
jnc sendToEditBar ;branch if text exists
;
; If grobj data exists, send it to the grobj
;
clr bp ;bp <- not CIF_QUICK
CHART< call GrObjTestSupportedTransferFormats >
CHART< jc sendToGrObj ;branch if grobj data >
;
; Wheee....grobj data doesn't exist. Spreadsheet data doesn't
; exist. Send it to the edit bar and pray.
;
sendToEditBar:
call ClipboardDoneWithItem
GetResourceHandleNS GCEditBarControl, bx
mov si, offset GCEditBarControl ;^lbx:si <- OD of edit bar
jmp sendPaste
;
; Send the marines to the grobj and switch the target
;
sendToGrObj:
call ClipboardDoneWithItem
CHART< call GetGrObjBodyOD ;^lbx:si <- OD of grobj layer >
CHART< mov cl, GCTL_GROBJ >
;
; Send to one layer or the other and make sure the target
; is appropriate...
;
sendToLayer:
call SetTargetLayerOpt
sendPaste:
mov ax, MSG_META_CLIPBOARD_PASTE
mov di, mask MF_CALL
GOTO ObjMessage
getTargetLayer:
push ax
mov ax, MSG_GEOCALC_APPLICATION_GET_TARGET_LAYER
call UserCallApplication
pop ax
cmp cl, GCTL_GROBJ ;grobj target?
retn
DocumentDoPaste endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MessageToRuler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a message to the ruler
CALLED BY: GeoCalcDocumentSendClassedEvent()
PASS: *ds:si - document object
ax, cx, dx, bp - message data
RETURN: none
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 8/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MessageToRuler proc near
class GeoCalcDocumentClass
uses bx, si, di, es
.enter
mov si, ds:[si]
add si, ds:[si].GeoCalcDocument_offset
mov bx, ds:[si].GCDI_spreadsheet
mov si, offset GCColumnRuler
mov di, mask MF_FIXUP_DS
call ObjMessage
.leave
ret
MessageToRuler endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentGainedTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle GeoCalc document gaining target
CALLED BY: MSG_META_GAINED_TARGET_EXCL
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN:
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 8/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentGainedTargetExcl method dynamic GeoCalcDocumentClass,
MSG_META_GAINED_TARGET_EXCL
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
mov ax, MSG_VIS_RULER_GAINED_SELECTION
mov cx, ds:[LMBH_handle]
mov dx, si
mov bp, MSG_VIS_INVALIDATE
call MessageToRuler
call UpdateDocumentState
;
; Make sure the right layer has the target.
;
mov ax, MSG_GEOCALC_APPLICATION_GET_TARGET_LAYER
call UserCallApplication
cmp cl, GCTL_SPREADSHEET ;spreadsheet target?
je doSpreadsheet ;branch if so
CHART< call GetGrObjBodyOD >
setTarget:
stc ;carry <- no optimization
call SetTargetLayer
ret
doSpreadsheet:
call GetDocSpreadsheet
jmp setTarget
GeoCalcDocumentGainedTargetExcl endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentLostTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle GeoCalc document losing target
CALLED BY: MSG_META_LOST_TARGET_EXCL
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN:
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 8/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentLostTargetExcl method dynamic GeoCalcDocumentClass,
MSG_META_LOST_TARGET_EXCL
mov ax, MSG_VIS_RULER_LOST_SELECTION
call MessageToRuler
mov ax, MSG_META_LOST_TARGET_EXCL
mov di, offset GeoCalcDocumentClass
GOTO ObjCallSuperNoLock
GeoCalcDocumentLostTargetExcl endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentVupCreateGState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle creating a GState and initialize it to our liking
CALLED BY: MSG_VIS_VUP_CREATE_GSTATE
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GeoCalcDocumentClass
ax - the message
RETURN: bp - handle of GState
carry - set for success
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 7/27/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentVupCreateGState method dynamic GeoCalcDocumentClass,
MSG_VIS_VUP_CREATE_GSTATE
;
; Call our superclass to create the GState
;
mov di, offset GeoCalcDocumentClass
call ObjCallSuperNoLock
;
; Initialize the GState to our liking
;
mov di, bp ;di <- GState handle
mov al, ColorMapMode <0, CMT_DITHER>
call GrSetTextColorMap
stc ;carry <- success
ret
GeoCalcDocumentVupCreateGState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentSaveAs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Force the document to be dirty so our last-revision
timestamp gets updated.
CALLED BY: MSG_GEN_DOCUMENT_SAVE_AS, MSG_GEN_DOCUMENT_SAVE_AS_TEMPLATE
PASS: *ds:si = GeoCalcDocument object
ds:di = GeoCalcDocumentInstance
RETURN: what those messages return
DESTROYED: what those messages destroy
SIDE EFFECTS: the document is marked dirty
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/15/93 Initial version
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcDocumentSaveAs method dynamic GeoCalcDocumentClass,
MSG_GEN_DOCUMENT_SAVE_AS,
MSG_GEN_DOCUMENT_SAVE_AS_TEMPLATE
if _SUPER_IMPEX
cmp ax, MSG_GEN_DOCUMENT_SAVE_AS_TEMPLATE
je callSuper
;
; See what kind of document they want to save it as.
;
call GetSelectedFileType ; cx = file type
cmp cx, GCDFT_CALC
je callSuper
;
; If not a native file, do the export
;
call ExportDocTransparently
; clears GDA_CLOSING
mov ax, MSG_GEN_DOCUMENT_GROUP_SAVE_AS_CANCELLED
call GenCallParent
ret
callSuper:
endif
mov di, offset GeoCalcDocumentClass
GOTO ObjCallSuperNoLock
GeoCalcDocumentSaveAs endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcDocumentPhysicalOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Invokes Impex converter for non-GeoGeoCalc files.
CALLED BY: MSG_GEN_DOCUMENT_PHYSICAL_OPEN
PASS: *ds:si = GeoCalcDocumentClass object
ds:di = GeoCalcDocumentClass instance data
ds:bx = GeoCalcDocumentClass object (same as *ds:si)
es = segment of GeoCalcDocumentClass
ss:bp = DocumentCommonParams
RETURN: carry set on error, else clear
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 10/30/98 Initial version
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _SUPER_IMPEX
GeoCalcDocumentOpen method dynamic GeoCalcDocumentClass,
MSG_GEN_DOCUMENT_OPEN
;
; See if it's one of our known DOS file types. If not,
; just let the superclass do its job.
;
call CheckIfNativeFile
jc dosFile
;
; OK, complete the opening of the file
;
mov ax, MSG_GEN_DOCUMENT_OPEN
mov di, offset GeoCalcDocumentClass
GOTO ObjCallSuperNoLock
;
; For DOS files, we flag the document type in instance data.
; We also remember the file name so when we save, we export
; the file back to the original name.
;
dosFile:
mov di, ds:[si]
add di, ds:[di].Gen_offset
lea di, ds:[di].GCDI_dosFileName
segmov es, ds, ax ; es:di = buffer
push ds, si
mov cx, ss
lea dx, ss:[bp].DCP_name
movdw dssi, cxdx ; ds:si = filename
mov cx, size FileLongName
rep movsb ; copy me Jesus
pop ds, si
;
; Set up the Impex control to do the work (behind the scenes).
; Also tell the DocumentControl to just hang around for a bit
; and wait for either an import to be completed or else an
; error to be displayed.
;
push bp, si
mov ax, MSG_GEOCALC_DOC_CTRL_IMPORT_IN_PROGRESS
GetResourceHandleNS GCDocumentControl, bx
mov si, offset GCDocumentControl
mov di, mask MF_FORCE_QUEUE
call ObjMessage
pop bp, si
call ImportDocTransparently
stc ; return error so we don't
; open *another* document
ret
GeoCalcDocumentOpen endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckIfNativeFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks to see if this is a native Writer file
CALLED BY: GeoCalcDocumentOpen()
PASS: ss:bp = DocumentCommonParams
RETURN: carry = clear if it is a native GeoCalc file
- or -
carry = set if it is not (i.e. a DOS file)
DESTROYED: nothing
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 10/29/98 Initial version
Don 2/21/99 Re-wrote
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _SUPER_IMPEX
CheckIfNativeFile proc near
uses ax, bx, cx, dx, bp, si, di, es, ds
.enter
;
; Construct the complete path (sigh)
;
segmov ds, ss, ax
mov es, ax
mov cx, PATH_BUFFER_SIZE + (size GeosFileType)
sub sp, cx
mov dx, sp
mov di, sp ; buffer => ES:DI
mov bx, ss:[bp].DCP_diskHandle
lea si, ss:[bp].DCP_path
push dx
mov dx, 1
call FileConstructFullPath
pop dx
cmc ; invert carry
jnc done ; if error, assume native file
;
; Append the filename onto the path. Ensure that a BACKSLASH
; separates the path from the filename.
;
mov ax, C_BACKSLASH
SBCS < cmp {byte} es:[di-1], al >
DBCS < cmp {word} es:[di-2], ax >
je copyString
LocalPutChar esdi, ax
copyString:
lea si, ss:[bp].DCP_name
LocalCopyString
;
; OK...now see if this is a GEOS file or not. If we get
; ERROR_ATTR_NOT_FOUND, then we don't have a GEOS file.
;
mov ax, FEA_FILE_TYPE
mov di, dx
add di, PATH_BUFFER_SIZE
mov cx, size GeosFileType
call FileGetPathExtAttributes
jnc checkType
cmp ax, ERROR_ATTR_NOT_FOUND
je dosFile
clc ; some other error...assume
jmp done ; native file and we're done
checkType:
cmp {word} es:[di], GFT_NOT_GEOS_FILE
clc ; assume native file
jne done
dosFile:
stc ; DOS file!!!
done:
lahf
add sp, PATH_BUFFER_SIZE + (size GeosFileType)
sahf
.leave
ret
CheckIfNativeFile endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ImportDocTransparently
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Invokes ImportControl to import the document.
CALLED BY: GeoCalcDocumentOpen
PASS: *ds:si = GeoCalcDocument object
ss:bp = DocumentCommonParams
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 11/06/98 Initial version
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _SUPER_IMPEX
ImportDocTransparently proc near
class GeoCalcDocumentClass
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Bring up the dialog (because otherwise it's Unhappy) in the
; background.
;
push bp
mov ax, MSG_GEN_INTERACTION_INITIATE_NO_DISTURB
GetResourceHandleNS GCImportControl, bx
mov si, offset GCImportControl
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
mov ax, MSG_IMPORT_CONTROL_GET_FILE_SELECTOR
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ; ^lcx:dx = file selector
Assert optr, cxdx
movdw bxsi, cxdx ; ^lbx:si = file selector
pop bp ; DocumentCommonParams => SS:BP
;
; Set the path and then the file.
;
push bp
mov ax, MSG_GEN_PATH_SET
mov cx, ss
lea dx, ss:[bp].DCP_path
mov bp, ss:[bp].DCP_diskHandle
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop bp
mov cx, ss
lea dx, ss:[bp].DCP_name
mov ax, MSG_GEN_FILE_SELECTOR_SET_SELECTION
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
;
; Tell it to do the import now (assuming auto-detect will do
; the right thing)
;
mov ax, MSG_GEN_GUP_INTERACTION_COMMAND
GetResourceHandleNS GCImportControl, bx
mov si, offset GCImportControl
mov cx, IC_DISMISS
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
mov ax, MSG_IMPORT_CONTROL_IMPORT
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
.leave
ret
ImportDocTransparently endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetSelectedFileType
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Retrieves the selection from the "save-as" file selector.
CALLED BY: GeoCalcDocumentSave
PASS: nothing
RETURN: cx = GeoCalcDocumentFileType
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 11/12/98 Initial version
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _SUPER_IMPEX
GetSelectedFileType proc near
uses ax,bx,dx,si,di,bp
.enter
GetResourceHandleNS GCDocumentControl, bx
mov si, offset GCDocumentControl
mov ax, MSG_GEOCALC_DOC_CTRL_GET_SELECTED_FILE_TYPE
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
.leave
ret
GetSelectedFileType endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ExportDocTransparently
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Invokes the ExportCtrl to export the document.
CALLED BY: GeoCalcDocumentSaveAs
PASS: cx = GeoCalcDocumentFileType
ss:bp = DocumentCommonParams
RETURN: nothing
DESTROYED: none
SIDE EFFECTS: exports the document
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 11/12/98 Initial version
Don 2/21/99 Ported over from GeoWrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _SUPER_IMPEX
include timer.def
ExportDocTransparently proc near
class GeoCalcDocumentClass
uses ax,bx,cx,dx,si,di,bp
.enter inherit GeoCalcDocumentSaveAs
;
; Bring up the dialog (because otherwise it's Unhappy) in the
; background.
;
push cx ; save file type
push bp ; stack frame
mov ax, MSG_GEN_INTERACTION_INITIATE_NO_DISTURB
GetResourceHandleNS GCExportControl, bx
mov si, offset GCExportControl
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop bp ; stack frame
;
; Get the format-type selector (a GenDynamicList).
;
push bp
GetResourceHandleNS GCExportControl, bx
mov si, offset GCExportControl
mov ax, MSG_EXPORT_CONTROL_GET_FORMAT_LIST
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ; ^lcx:dx = format list
pop bp
;
; Set the output format (hack, hack, hack)
;
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov bx, cx
mov si, dx ; GenItemGroup => BX:SI
pop cx ; GeoCalcDocumentFileType => CX
cmp cx, GCDFT_CSV
mov cx, 0 ; "CSV" is listed first
je setSelection
mov cx, 1 ; "Lotus 123" is second
setSelection:
push bp
clr dx
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
mov ax, MSG_GEN_ITEM_GROUP_SEND_STATUS_MSG
mov cx, 1 ; pretend user clicked on entry
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop bp
mov ax, 10 ; !!!hack!!!
call TimerSleep ; sleep for a bit to make sure
; the Import DB finishes with
; setting the default file name
;
; Set the output path to whatever the user selected in the
; "save-as" dialog (it's in DocumentCommonParams).
;
GetResourceHandleNS GCExportControl, bx
mov si, offset GCExportControl
mov ax, MSG_EXPORT_CONTROL_GET_FILE_SELECTOR
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
movdw bxsi, cxdx ; ^lbx:si = file selector
push bp
mov ax, MSG_GEN_PATH_SET
mov cx, ss
lea dx, ss:[bp].DCP_path
mov bp, ss:[bp].DCP_diskHandle
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop bp
;
; Set the output filename to whatever the user had in the
; "save-as" dialog (it's in DocumentCommonParams).
;
mov ax, MSG_EXPORT_CONTROL_GET_FILE_NAME_FIELD
GetResourceHandleNS GCExportControl, bx
mov si, offset GCExportControl
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ; ^lcx:dx = optr
Assert optr, cxdx
movdw bxsi, cxdx
mov dx, ss
lea bp, ss:[bp].DCP_name ; ss:bp = filename
clr cx ; null-terminated
mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
;
; Tell it to do the export now.
;
mov ax, MSG_GEN_GUP_INTERACTION_COMMAND
GetResourceHandleNS GCExportControl, bx
mov si, offset GCExportControl
mov cx, IC_DISMISS
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
mov ax, MSG_EXPORT_CONTROL_EXPORT
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
.leave
ret
ExportDocTransparently endp
endif
Document ends
| 26.006567 | 79 | 0.616538 |
65b9a2254ba398e3555ee995efe975f80a429bd3 | 1,277 | asm | Assembly | hello64/hello64_libc.asm | P403n1x87/asm | 324cdecab6ea05fb85e53dcdc1c4b86b894597ed | [
"FSFAP"
] | 8 | 2019-05-14T02:16:24.000Z | 2022-02-25T18:06:38.000Z | hello64/hello64_libc.asm | P403n1x87/asm | 324cdecab6ea05fb85e53dcdc1c4b86b894597ed | [
"FSFAP"
] | null | null | null | hello64/hello64_libc.asm | P403n1x87/asm | 324cdecab6ea05fb85e53dcdc1c4b86b894597ed | [
"FSFAP"
] | null | null | null | ; hello64_libc.asm
;
; A simple x86_64 Hello World application that shows how to use the
; Standard C Library
;
; Copyright (C) 2016 Gabriele N. Tornetta <phoenix1987@gmail.com>. All
; rights reserved.
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
default rel
global main
extern printf
;
; Initialised data goes here
;
SECTION .data
hello db "Hello World!", 10, 0 ; const char *
hello_len equ $ - hello - 1 ; size_t
;
; Code goes here
;
SECTION .text
; int main (int argc, char ** argv)
main:
; return printf(hello) - hello_len;
lea rdi, [hello]
xor rax, rax
call printf WRT ..plt
sub rax, hello_len
| 27.76087 | 71 | 0.691464 |
36e2218b14eac672da90edb900dd9f60caf697d1 | 235 | asm | Assembly | test/unittest/input/input_for_parser_GROUP1.asm | Kenta11/micro1-as | 23b09dacb479b9e9a203cc99ac843e5a3504e4aa | [
"MIT"
] | null | null | null | test/unittest/input/input_for_parser_GROUP1.asm | Kenta11/micro1-as | 23b09dacb479b9e9a203cc99ac843e5a3504e4aa | [
"MIT"
] | null | null | null | test/unittest/input/input_for_parser_GROUP1.asm | Kenta11/micro1-as | 23b09dacb479b9e9a203cc99ac843e5a3504e4aa | [
"MIT"
] | null | null | null | TITLE InputForParserGROUP1
ADD 1, 37 (0)
SUB 2, X"B3DF (1)
AND 3, O"314232 (2)
OR 0, B"1010010110100101 (3)
XOR 1, 43
MULT 2, X"B2F2
DIV 3, O"172712
CMP 0, B"1011010011001101
EX 1, (0)
END
| 19.583333 | 34 | 0.553191 |
69412604488eaa8c68c1528384e17bd8ee131990 | 358 | asm | Assembly | programs/oeis/004/A004650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/004/A004650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/004/A004650.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A004650: Prime(n) mod (n+1).
; 0,0,1,2,5,6,1,1,3,7,7,11,13,13,15,2,5,4,7,8,7,10,11,14,19,20,19,20,19,20,31,32,1,34,5,3,5,7,7,9,11,9,15,13,13,11,19,27,27,25,25,27,25,31,33,35,37,35,37,37,35,41,51,51,49,49,59,61,67,65,65,67,71,73,75,75,77,2,1,4,9,6,11,8,9,8,9,12,11,8,7,14,17,16,19,18,19,26,23,36
mov $1,$0
seq $0,40 ; The prime numbers.
add $1,2
mod $0,$1
| 44.75 | 265 | 0.608939 |
483604273f46af301265c4b0f676fa6598e09bd0 | 729 | asm | Assembly | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week2a/week2b/ifelse.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | 1 | 2021-04-11T10:18:55.000Z | 2021-04-11T10:18:55.000Z | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week2a/week2b/ifelse.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | null | null | null | compsci courses/CPSC355 - Computing Machinery/misc/otherresources/week2a/week2b/ifelse.asm | q-omar/UofC | 03ad4cb9145854394c98ccdb6292825d2b3927c6 | [
"MIT"
] | null | null | null | // Define Macros
define(a_r, x19)
define(b_r, x20)
define(c_r, x21)
define(d_r, x22)
//Define register aliases
fp .req x29
lr .req x30
.global main //Make main visible to OS
.balign 4 //Instructions must be word aligned
main:
stp fp, lr, [sp, -16]! //Save FP and LR to stack, pre-increment sp
mov fp, sp //Update FP to current SP
mov a_r, 60
mov b_r, 40
cmp a_r, b_r
b.le next //If a_r<=b_r go to next
add c_r, a_r, b_r //Else execute these instructions
add d_r, c_r, 5
b end //Skip next and go to end
next:
sub c_r, a_r, b_r
sub d_r, c_r, 5
end:
mov w0, 0
ldp fp, lr, [sp], 16 //Restore FP and LR from stack, post-increment SP
ret //Return to caller
| 19.702703 | 82 | 0.625514 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.