max_stars_repo_path stringlengths 4 261 | max_stars_repo_name stringlengths 6 106 | max_stars_count int64 0 38.8k | id stringlengths 1 6 | text stringlengths 7 1.05M |
|---|---|---|---|---|
programs/oeis/143/A143292.asm | neoneye/loda | 22 | 90734 | <reponame>neoneye/loda
; A143292: Gray code of prime(n) (decimal representation).
; 3,2,7,4,14,11,25,26,28,19,16,55,61,62,56,47,38,35,98,100,109,104,122,117,81,87,84,94,91,73,64,194,205,206,223,220,211,242,244,251,234,239,224,161,167,164,186,176,146,151,157,152,137,134,385,388,395,392,415
seq $0,40 ; The prime numbers.
seq $0,3188 ; Decimal equivalent of Gray code for n.
|
Perl6 Parser/grammar/Perl6.g4 | Itay2805/Perl6-Native-Compiler | 1 | 3168 | <gh_stars>1-10
grammar Perl6;
@lexer::header {
package com.itay.perl6.parser;
}
@parser::header {
package com.itay.perl6.parser;
}
program
: stmt_list EOF
;
stmt_list
: stmt*
;
stmt
: expr ';'
| expr
// FIXME: From some reason it does not work when given newline
;
expr
: temp
| varExpr
| literalExpr
//| subs
| addingExpression
;
temp
: name=('print'|'say') '('? value1=expr (',' value2=expr)* ')'? #say
| block #codeBlock
| 'use' 'v6' ';' #use
;
literalExpr
: ('\'' num=NUMBER '\'' | num=NUMBER) #numberLiteral
| ( str=CHARSEQUENSE
| str=CHARSEQUENSE_Q
| str=CHARSEQUENSE_2
) #stringLiteral
;
varExpr
: 'my' '$' name=ID #createVar
| 'my' '$' name=ID '=' value=expr #createVar
| 'my' type=ID '$' name=ID #createVar
| 'my' type=ID '$' name=ID '=' value=expr #createVar
| '$' name=ID '=' value=expr #assignVar
| '$' name=ID #loadVar
;
mathExpr
: temp
| varExpr
| literalExpr
//| subs
| '(' addingExpression ')'
;
// For right now w are limiting the number of parameters to 10 because we are using only registers and we have 10 which are able to be used for params
/*subs
: 'sub' name=ID '(' p1=ID? (',' p2=ID)? (',' p3=ID)? (',' p4=ID)? (',' p5=ID)? (',' p6=ID)? (',' p7=ID)? (',' p8=ID)? (',' p9=ID)? (',' p10=ID)? ')' code=block #subCreate
| name=ID '('? p1=ID? (',' p2=ID)? (',' p3=ID)? (',' p4=ID)? (',' p5=ID)? (',' p6=ID)? (',' p7=ID)? (',' p8=ID)? (',' p9=ID)? (',' p10=ID)? ')'? #subCall
;*/
multiplyingExpression
: mathExpr ('*' mathExpr)* #mul
| mathExpr ('/' mathExpr)* #div
;
addingExpression
: multiplyingExpression ('+' multiplyingExpression)* #add
| multiplyingExpression ('-' multiplyingExpression)* #sub
;
block
: '{' stmt_list '}'
;
CHARSEQUENSE
: '\'' ~[\'\r\n]* '\''
;
CHARSEQUENSE_2
: '"' ~[\"\r\n]* '"'
;
CHARSEQUENSE_Q
: 'q' '{' ~['}']* '}'
;
NUMBER
: DECIMAL_NUM
| OCTA_NUMBER
| HEX_NUMBER
| BINARY_NUM
;
fragment
DECIMAL_NUM
: (('0'..'9')('0'..'9'|'_')*)
| '0' 'd' ('0'..'9'|'_')+
;
fragment
OCTA_NUMBER
: '0' 'o' ('0'..'7'|'_')+
;
fragment
HEX_NUMBER
: '0' 'x' ('0'..'9'|'a'..'f'|'_')+
;
fragment
BINARY_NUM
: '0' 'b' ('0'..'1'|'_')+
;
ID
: ('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
;
LINE_COMMENT
: '#' ~('\n'|'\r')* { skip(); }
;
SPACE
: (' ' | '\t' | '\n' | '\r')+ { skip(); }
; |
proj.asm | dz1domin/TM_Proj | 0 | 168754 | .PORT uart0_int_mask, 0x62
.PORT uart0_status, 0x61
.PORT uart0_tx, 0x60
.PORT uart0_rx, 0x60
.PORT int_status, 0xE0
.PORT int_mask, 0xE1
.PORT lcd_value, 0x30
.PORT lcd_control, 0x31
.PORT uart1_int_mask, 0x6A
.PORT uart1_status, 0x69
.PORT uart1_tx, 0x68
.PORT uart1_rx, 0x68
.PORT leds, 0
.PORT ram_page, 0xF0
.PORT switches_port, 0x10
.CONST incoming_string_page, 1
.CONST coordinate_string_page, 2
.CONST is_storing_enabled, 0b00000001
.CONST LF_ascii_code, 0x0A
.CONST numeric_record_len, 9
.CONST time_record_pos, 6
.CONST latitude_record_pos, time_record_pos + numeric_record_len + 2
.CONST latitude_indicator_pos, latitude_record_pos + numeric_record_len + 1
.CONST longitude_record_pos, latitude_indicator_pos + 3
.CONST longitude_indicator_pos, longitude_record_pos + numeric_record_len + 1
.CONST time_record_len, 6
.CONST time_pos_in_memory, 0
.CONST latitude_pos_in_memory, time_pos_in_memory + time_record_pos
.CONST latitude_indicator_pos_in_memory, latitude_pos_in_memory + numeric_record_len
.CONST longitude_pos_in_memory, latitude_indicator_pos_in_memory + 1
.CONST longitude_indicator_pos_in_memory, longitude_pos_in_memory + numeric_record_len
.CONST end_pos_in_memory, longitude_indicator_pos + 1
.REG sF, control
.REG sE, value
.REG sD, char_to_write
.REG sC, coursor_pos
.REG sB, recv_char
.REG sA, flow_control_flags
.REG s9, current_ram_pos
.DSEG
mesg_id: .DB "GPGGA"
mesg_time: .DB "TIME: "
mesg_lati: .DB "LATI: "
mesg_longi: .DB "LONG: "
.CSEG 0x3FF
JUMP handle_irq
.MACRO nop
LOAD s0, s0
LOAD s0, s0
.ENDM
.CSEG
LOAD control, 0
OUT control, lcd_control
main:
CALL init_lcd
CALL init_irq
JUMP loop
handle_irq:
CALL recv_and_send
LOAD s0, 0
OUT s0, int_status
RETI
recv_and_send:
CALL recv
CALL send
RET
recv:
IN recv_char, uart1_rx
TEST flow_control_flags, is_storing_enabled
CALL NZ, store_incoming_char
TEST flow_control_flags, is_storing_enabled
JUMP NZ, end_recv_func
COMP recv_char, '$'
JUMP NZ, end_recv_func
OR flow_control_flags, is_storing_enabled
LOAD current_ram_pos, 0
end_recv_func:
RET
store_incoming_char:
LOAD s5, incoming_string_page
OUT s5, ram_page
STORE recv_char, current_ram_pos
ADD current_ram_pos, 1
COMP recv_char, LF_ascii_code
JUMP NZ, end_store_incoming_char_func
XOR flow_control_flags, is_storing_enabled
CALL parse_string
end_store_incoming_char_func:
RET
parse_string:
LOAD s5, 0
loop_parse_string:
LOAD s6, incoming_string_page
OUT s6, ram_page
FETCH s6, s5
LOAD s7, 0
OUT s7, ram_page
LOAD s7, mesg_id
ADD s7, s5
FETCH s0, s7
COMP s0, s6
JUMP NZ, end_parse_string_func
ADD s5, 1
COMP s5, 5
JUMP NZ, loop_parse_string
CALL extract_data_from_string
end_parse_string_func:
RET
extract_data_from_string:
LOAD s5, time_record_pos
LOAD s6, 0
LOAD s1, 0
; time
loop_extract_time_from_string:
LOAD s7, incoming_string_page
OUT s7, ram_page
FETCH s0, s5
LOAD s7, coordinate_string_page
OUT s7, ram_page
STORE s0, s6
ADD s6, 1
ADD s1, 1
ADD s5, 1
COMP s1, time_record_len
JUMP NZ, loop_extract_time_from_string
;latitude
LOAD s5, latitude_record_pos
LOAD s1, 0
loop_extract_latitude_from_string:
LOAD s7, incoming_string_page
OUT s7, ram_page
FETCH s0, s5
LOAD s7, coordinate_string_page
OUT s7, ram_page
STORE s0, s6
ADD s6, 1
ADD s5, 1
ADD s1, 1
COMP s1, numeric_record_len
JUMP NZ, loop_extract_latitude_from_string
;latitude indicator
LOAD s5, latitude_indicator_pos
LOAD s7, incoming_string_page
OUT s7, ram_page
FETCH s0, s5
LOAD s7, coordinate_string_page
OUT s7, ram_page
STORE s0, s6
ADD s6, 1
;longitude
LOAD s5, longitude_record_pos
LOAD s1, 0
loop_extract_longitude_from_string:
LOAD s7, incoming_string_page
OUT s7, ram_page
FETCH s0, s5
LOAD s7, coordinate_string_page
OUT s7, ram_page
STORE s0, s6
ADD s6, 1
ADD s5, 1
ADD s1, 1
COMP s1, numeric_record_len
JUMP NZ, loop_extract_longitude_from_string
;longitude indicator
LOAD s5, longitude_indicator_pos
LOAD s7, incoming_string_page
OUT s7, ram_page
FETCH s0, s5
LOAD s7, coordinate_string_page
OUT s7, ram_page
STORE s0, s6
CALL write_memory_content_to_lcd
RET
write_memory_content_to_lcd:
/; mesg_time: .DB "TIME: "
mesg_lati: .DB "LATI: "
mesg_longi: .DB "LONG: "
;/
/;
.CONST time_pos_in_memory, 0
.CONST latitude_pos_in_memory, time_pos_in_memory + time_record_pos
.CONST latitude_indicator_pos_in_memory, latitude_pos_in_memory + numeric_record_len
.CONST longitude_pos_in_memory, latitude_indicator_pos_in_memory + 1
.CONST longitude_indicator_pos, longitude_pos_in_memory + numeric_record_len
.CONST end_pos_in_memory, longitude_indicator_pos + 1
;/
LOAD coursor_pos, 0x80
CALL set_coursor
; IN s5, switches_port
; TEST s5, 1
;JUMP Z, write_time
write_coords:
;;;;;;;;latitude mesg
LOAD s5, 0
OUT s5, ram_page
LOAD s6, mesg_lati
FETCH char_to_write, s6
write_memory_content_to_lcd_lati_mesg_loop:
CALL write_to_lcd
ADD s6, 1
FETCH char_to_write, s6
COMP char_to_write, 0
JUMP NZ, write_memory_content_to_lcd_lati_mesg_loop
;;;;;;;;end of latitude mesg
;;;;;;;;latitude content
LOAD s5, coordinate_string_page
OUT s5, ram_page
LOAD s6, latitude_pos_in_memory
write_memory_content_to_lcd_lati_content_loop:
FETCH char_to_write, s6
CALL write_to_lcd
ADD s6, 1
COMP s6, latitude_indicator_pos_in_memory
JUMP NZ, write_memory_content_to_lcd_lati_content_loop
;;;;;;;;end latitude content
;;;;;;; indicator
FETCH char_to_write, s6
CALL write_to_lcd
ADD s6, 1
;;;;;;; end of indicator
LOAD coursor_pos, 0xC0
CALL set_coursor
;;;;;;;;longitude mesg
LOAD s5, 0
OUT s5, ram_page
LOAD s6, mesg_longi
FETCH char_to_write, s6
write_memory_content_to_lcd_longi_mesg_loop:
CALL write_to_lcd
ADD s6, 1
FETCH char_to_write, s6
COMP char_to_write, 0
JUMP NZ, write_memory_content_to_lcd_longi_mesg_loop
;;;;;;;;end of longitude mesg
;;;;;;;;longitude content
LOAD s5, coordinate_string_page
OUT s5, ram_page
LOAD s6, longitude_pos_in_memory
write_memory_content_to_lcd_longi_content_loop:
FETCH char_to_write, s6
CALL write_to_lcd
ADD s6, 1
COMP s6, longitude_indicator_pos_in_memory
JUMP NZ, write_memory_content_to_lcd_longi_content_loop
;;;;;;;;end latitude content
;;;;;;; indicator
FETCH char_to_write, s6
CALL write_to_lcd
ADD s6, 1
;;;;;;; end of indicator
JUMP end_write_memory_content_to_lcd_func
write_time:
LOAD s5, 0
OUT s5, ram_page
LOAD s6, mesg_time
FETCH char_to_write, s6
write_memory_content_to_lcd_time_mesg_loop:
CALL write_to_lcd
ADD s6, 1
FETCH char_to_write, s6
COMP char_to_write, 0
JUMP NZ, write_memory_content_to_lcd_time_mesg_loop
LOAD s5, coordinate_string_page
OUT s5, ram_page
LOAD s6, time_pos_in_memory
write_memory_content_to_lcd_time_content_loop:
FETCH char_to_write, s6
CALL write_to_lcd
ADD s6, 1
COMP s6, latitude_pos_in_memory
JUMP NZ, write_memory_content_to_lcd_time_content_loop
end_write_memory_content_to_lcd_func:
RET
send:
OUT recv_char, uart0_tx
RET
init_irq:
EINT
LOAD s0, 0b00001000
OUT s0, int_mask
LOAD s0, 0b00010000
OUT s0, uart1_int_mask
RET
init_lcd:
LOAD s4, 4
CALL reset_seq
LOAD control, 0x1
LOAD value, 0x06
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
CALL opoznij_5m
LOAD control, 0x1
LOAD value, 0x0E
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
CALL opoznij_5m
LOAD control, 0x1
LOAD value, 0x01
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
CALL opoznij_5m
LOAD control, 0x1
LOAD value, 0x80
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
CALL opoznij_5m
RET
write_to_lcd:
LOAD control, 0x3
LOAD value, char_to_write
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x2
OUT control, lcd_control
CALL opoznij_40u
RET
set_coursor:
LOAD control, 0x1
LOAD value, coursor_pos
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
CALL opoznij_40u
RET
reset_seq:
CALL send_reset
CALL opoznij_5m
SUB s4, 1
JUMP NZ, reset_seq
RET
send_reset:
LOAD control, 0x1
LOAD value, 0x38
OUT value, lcd_value
OUT control, lcd_control
_nop
LOAD control, 0x0
OUT control, lcd_control
RET
opoznij_1u: LOAD s0,23
czekaj_1u: SUB s0,1
JUMP NZ,czekaj_1u
LOAD s0,s0 ;NOP
LOAD s0,s0 ;NOP
RET
opoznij_40u: LOAD s1,38
czekaj_40u: CALL opoznij_1u
SUB s1,1
JUMP NZ,czekaj_40u
RET
opoznij_1m: LOAD s2,25
czekaj_1m: CALL opoznij_40u
SUB s2,1
JUMP NZ,czekaj_1m
RET
opoznij_5m: LOAD s3,5
czekaj_5m: CALL opoznij_1m
SUB s3,1
JUMP NZ,czekaj_1m
RET
loop:
JUMP loop |
libsrc/math/z88math/c/sccz80/deq.asm | jpoikela/z88dk | 640 | 243201 | ;
; Z88dk Z88 Maths Library
;
;
; $Id: deq.asm,v 1.4 2016-06-22 19:55:06 dom Exp $
SECTION code_fp
PUBLIC deq
EXTERN fsetup
EXTERN stkequcmp
IF FORz88
INCLUDE "target/z88/def/fpp.def"
ELSE
INCLUDE "fpp.def"
ENDIF
; TOS != FA?
.deq
call fsetup
IF FORz88
fpp(FP_EQ)
ELSE
ld a,+(FP_EQ)
call FPP
ENDIF
jp stkequcmp
|
04/mult/mult.asm | JSchneidler/nand2tetris | 0 | 26794 | <filename>04/mult/mult.asm
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by <NAME> Schocken, MIT Press.
// File name: projects/04/Mult.asm
// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)
// Put your code here.
@sum
M=0 //sum=0
@i
M=1 //i=1
(LOOP)
@i
D=M //D=i
@R0
D=D-M //D=i-R0
@END
D;JGT // if(i-R0) > 0 goto END
@R1
D=M //D=R1
@sum
M=D+M //sum+=R1
@i
M=M+1 //i=i+1
@LOOP
0;JMP //Goto LOOP
(END)
@sum
D=M
@R2
M=D |
sha2-256.asm | idleice/sha2-256 | 2 | 96402 | <gh_stars>1-10
section .data
;; Usage message
msg_usage db 'usage: sha2-256 <string to hash>', 0xa
msg_usage_len equ $ - msg_usage
;; Initialize hash values
i dd 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
;; Initialize round constants
k dd 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
section .bss
chk resd 64 ; current chunk in message iteration
stt resd 8 ; state of compression function (begins as copy of i)
section .text
global _start ; entrypoint for the linker
_start:
;; Get first argument argv[1]
pop eax ; get number of program arguments
cmp eax, 2 ; test if one argument
jne help ; if not equal, show usage message and exit
pop esi ; store program name argv[0] in esi
pop esi ; overwrite esi with first argument argv[1]
;; Compute length of argv[1]
mov edi, esi ; set edi to string argv[1]
mov ecx, -1 ; set the max size of the string
mov eax, 0 ; initialize eax with ascii NUL character
cld
repne scasb ; scan bytes in the string until we find the NUL character
not ecx ; get length of string
dec ecx ; decrement to account for read NUL character
;; Pad message
call pad
;; Extend and compress
shr ecx, 4 ; number of chunks (each 16 dwords) to loop over
xor ebx, ebx ; initiate loop counter
a0:
call extend
call compress
inc ebx
cmp ebx, ecx
jne a0
;; Print digest and exit
mov esi, i
mov ecx, 8
call print_memd
jmp exit
pad:
;; Padding function
;; Append a single 1 bit to original message of length l bits
;; Append k 0 bits where k is the minimum number >= 0 such that (l + 1 + k + 64) % 512 = 0
;; Append l as a 64-bit big-endian integer
;; Expects:
;; ecx: length of program argument string in bytes
;; esi: pointer to program argument string
;; Returns:
;; ecx: length of padded message in dwords
;; esi: pointer to padded message
;; Calculate length of k and save to edx
mov eax, ecx
and eax, 0x3f ; calculate length of program argument string % 64
cmp eax, 56
jb m0
mov edx, 119 ; k / 8 = 119 - r if result r of modulo operation is >= 56
jmp m1
m0:
mov edx, 55 ; else k / 8 = 55 - r
m1:
sub edx, eax
;; Dynamically allocate memory
mov ebx, 0 ; get pointer to the first block we are allocating
mov eax, 45 ; system call number (brk)
int 0x80
mov edi, eax ; save pointer in edi
mov ebx, eax ; copy pointer in ebx
add ebx, ecx ; add number of bytes we want to allocate to pointer value
add ebx, edx
add ebx, 9
mov eax, 45
int 0x80
;; Copy argument string to newly allocated memory while changing endianness
xor ebx, ebx ; init counter
m2:
xor eax, eax ; set eax to zero
mov al, [esi+ebx] ; load next byte
shl eax, 8 ; shift to change endianness
inc ebx
cmp ecx, ebx ; check for end of argument string
jz m3
mov al, [esi+ebx] ; load next byte
shl eax, 8
inc ebx
cmp ecx, ebx
jz m4
mov al, [esi+ebx] ; load next byte
shl eax, 8
inc ebx
cmp ecx, ebx
jz m5
mov al, [esi+ebx] ; load next byte
inc ebx
mov [edi+ebx-4], eax ; copy eax to allocated memory
cmp ecx, ebx
jnz m2
;; Append a single 1 bit to argument string
mov al, byte 0x80 ; append bit
shl eax, 24 ; shift to change endianness
add ebx, 4 ; update counter
jmp m6
m3:
mov al, byte 0x80 ; append bit
shl eax, 16
add ebx, 3
jmp m6
m4:
mov al, byte 0x80 ; append bit
shl eax, 8
add ebx, 2
jmp m6
m5:
mov al, byte 0x80 ; append bit
inc ebx
m6:
mov [edi+ebx-4], eax ; copy eax to allocated memory
mov esi, edi ; copy pointer to copied string
add edi, ebx ; compute pointer to the end of copied string
;; Pad message with zeros
mov ebx, ecx ; copy argument string length
mov ecx, edx ; copy number of zero pad bytes to ecx
shr ecx, 2 ; transform count from bytes to double words (rounding down)
xor eax, eax ; save what to copy in eax
cld
rep stosd ; zero padding
;; save argument string length in bit as 64-bit value to the end
shl ebx, 3
mov [edi], eax ; set the first 32 bit to 0 by default
mov [edi+4], ebx ; save argument string length in bit as 32-bit value to the end
add edi, 8
mov ecx, edi
sub ecx, esi
shr ecx, 2
ret
extend:
;; Extends message chunk from 16 dwords to 64 dwords, saved in chk
;; Expects:
;; ebx: counter in iteration of padded message (0 for 1. chunk, 1 for 2. chunk, ...)
;; esi: pointer to padded message
pusha
;; Copy 16 dwords from padded message to beginning of chunk
mov ecx, 16 ; number of dwords to copy
shl ebx, 6
add esi, ebx ; pointer to padded message
mov edi, chk ; pointer to destination
cld
rep movsd
;; Extend copied dwords to fill all 64 dwords of chunk
s0:
mov eax, [chk+ecx*4+4] ; calculate s0 in eax
mov ebx, eax
mov edx, eax
ror eax, 7
ror ebx, 18
shr edx, 3
xor eax, ebx
xor eax, edx
mov ebx, [chk+ecx*4+56] ; calculate s1 in ebx
mov edx, ebx
mov esi, ebx
ror ebx, 17
ror edx, 19
shr esi, 10
xor ebx, edx
xor ebx, esi
add eax, ebx ; add up to next extension dword
add eax, [chk+ecx*4]
add eax, [chk+ecx*4+36]
mov [chk+ecx*4+64], eax
inc ecx
cmp ecx, 48 ; counter runs from 0 to 47
jnz s0
popa
ret
compress:
;; Compression function
pusha
;; Copy i to stt as initial state of compression function
mov ecx, 8
mov esi, i
mov edi, stt
cld
rep movsd
;; Loop 64 times
xor ecx, ecx
p0:
;; Calculate major
mov eax, [stt] ; load a
mov esi, eax
mov ebx, [stt+4] ; load b
mov edx, [stt+8] ; load c
and eax, ebx
and ebx, edx
and edx, esi
xor eax, ebx
xor eax, edx ; store in eax
;; Calculate sigma 0
mov ebx, esi ; remark that a is still in esi
mov edx, esi
ror ebx, 2
ror edx, 13
ror esi, 22
xor ebx, edx
xor ebx, esi ; store in ebx
;; Calculate t2
add eax, ebx ; store in eax
;; Calculate sigma 1
mov ebx, [stt+16] ; load e
mov edx, ebx
mov esi, ebx
mov edi, ebx
ror ebx, 6
ror edx, 11
ror esi, 25
xor ebx, edx
xor ebx, esi ; store in ebx
;; Calculate ch
mov edx, edi ; remark that e is still in edi
not edx
and edi, [stt+20] ; load f
mov esi, [stt+24] ; load g
and edx, esi
xor edx, edi ; store in edx
;; Calculate t1
add ebx, edx
add ebx, [stt+28] ; load h
add ebx, [chk+ecx*4]
add ebx, [k+ecx*4] ; store in ebx
;; Store new state
mov [stt+28], esi ; remark that g is still in esi
mov edi, [stt+20]
mov [stt+24], edi
mov edx, [stt+16]
mov [stt+20], edx
mov edx, [stt+12]
add edx, ebx
mov [stt+16], edx
mov edx, [stt+8]
mov [stt+12], edx
mov edx, [stt+4]
mov [stt+8], edx
add eax, ebx
mov ebx, [stt]
mov [stt+4], ebx
mov [stt], eax
inc ecx
cmp ecx, 64
jl p0
;; Compute final digest of this round
add [i], eax
add [i+4], ebx
mov edx, [stt+8]
add [i+8], edx
mov edx, [stt+12]
add [i+12], edx
mov edx, [stt+16]
add [i+16], edx
mov edx, [stt+20]
add [i+20], edx ; reuse values saved in registers
add [i+24], edi
add [i+28], esi
popa
ret
print_memd:
;; Prints out memory segment as hex value (dword-wise, note little-endianness)
;; Expects:
;; ecx: length of memory segment in dwords
;; esi: pointer to memory segment
pusha
;; Dynamically allocate memory
mov ebx, 0 ; get pointer to the first block we are allocating
mov eax, 45 ; system call number (brk)
int 0x80
mov edi, eax ; save pointer in edi
mov ebx, eax ; copy pointer in ebx
shl ecx, 2
add ebx, ecx ; add number of bytes we want to allocate to pointer value
add ebx, 1 ; add one byte for new line character
mov eax, 45
int 0x80 ; call kernel
;; Build hex string
mov [edi+ecx*2], byte 0xa ; move new line character into last byte of buffer
shl ecx, 1
inc ecx
push ecx ; push buffer length to stack
shr ecx, 3
g0:
dec ecx
mov eax, [esi+ecx*4] ; move next value from memory to eax
mov edx, 8 ; set counter that loops over next 32-bit value to 8
g1:
dec edx ; decrement inner loop counter
mov ebx, eax ; move eax to ebx to be able to work on it
and ebx, 0xf ; get only last digit of hex value (last 4 bits)
cmp ebx, 10 ; is value >= 9 ?
jb g2
add ebx, 0x27 ; if yes, add 0x57 to [10-15] to get byte value of ascii 'a'
g2:
add ebx, 0x30 ; if not, add 0x30 to [0-9] to get byte value of ascii '0'
add edi, edx
mov [edi+ecx*8], bl ; copy next ascii byte value from ebx to buffer
sub edi, edx
shr eax, 4 ; get next digit to be printed to the right of eax
cmp edx, 0 ; iterate 8 times
ja g1
test ecx, ecx ; iterate over dwords
jnz g0
;; Print buffer
pop edx ; buffer length to edx
mov ecx, edi ; pointer to ecx
mov ebx, 1 ; file descriptor (std_out) to ebx
mov eax, 4 ; system call number (sys_write) to eax
int 0x80 ; call kernel
popa
ret ; return
help:
;; Prints usage message and exits
mov edx, msg_usage_len ; message length to edx
mov ecx, msg_usage ; message to write to ecx
mov ebx, 1 ; file descriptor (std_out) to ebx
mov eax, 4 ; system call number (sys_write) to eax
int 0x80 ; call kernel
jmp exit ; jump to exit label
exit:
;; Exit routine
mov ebx, 0 ; exit status to ebx
mov eax, 1 ; system call number (sys_exit) to eax
int 0x80 ; call kernel
|
tests/sjasmplus_regressions/custom/trd.asm | fengjixuchui/sjasmplus | 220 | 169707 | ;Note: the sjasmplus now supports the unofficial 3 letter extensions as described by Dart_Alver
;A TR-DOS filename is max. 8 characters, with a single-character extension. http://zx-modules.de/fileformats/hobetaformat.html
device zxspectrum128
org #8000
label1 db 'text1'
org #8100
label2 db 'text2'
org #8200
label3 db 'text3'
end
EMPTYTRD trd.trd
SAVETRD "trd.trd","label1.txt",label1,5 ; new warnings about 3-letter extension
SAVETRD "trd.trd","label2.txt",label2,5
SAVETRD "trd.trd","label3.txt",label3,5
SAVETRD "trd.trd","label4.txt",label2,5 ; trdext3-ok ; warning suppressed
; test the "invalid extension warning" and if it can be suppressed
SAVETRD "trd.trd","label2.B",label2,5 ; no warning
SAVETRD "trd.trd","label2.J",label2,5 ; warning
SAVETRD "trd.trd","label3.J",label2,5 ; trdext-ok ; warning suppressed
; test the new warning about saving same file second time (v1.15.1+)
SAVETRD "trd.trd","label2.B",label2,5 ; warning
SAVETRD "trd.trd","label2.B",label2,5 ; trddup-ok ; warning suppressed
; test the new warnings about "B" extension allowing only single letter
SAVETRD "trd.trd","label2.BAS",label1,5 ; 3x warning (3 letter ext, ".B" enforces 1 letter, duplicate file)
SAVETRD "trd.trd","label2.BAS",label1,5 ; trdext3-ok, trdextb-ok, trddup-ok ; warnings suppressed
; test deletion of duplicate files when in replace/add modes
SAVETRD "trd.trd",|"label2.B",label2,5
SAVETRD "trd.trd","label3.J",label2,5 ; trdext-ok, trddup-ok
SAVETRD "trd.trd",&"label3.J",label2,5
SAVEHOB "trd.$t","labels.txt",label1,end-label1
; TODO add some check to validate resulting files
; some more syntax error tests for better code coverage
SAVEHOB "trd.$t"
SAVEHOB "trd.$t",
SAVEHOB "trd.$t",,
DEVICE NONE
SAVEHOB "trd.$t","labels.txt",label1,end-label1
EMPTYTRD
SAVETRD "trd.trd","label1.txt",label1,5
|
software/firmware/lib/src/register_magic.asm | orgua/shepherd | 0 | 26012 | <reponame>orgua/shepherd<filename>software/firmware/lib/src/register_magic.asm
.global get_num_size_as_bits
get_num_size_as_bits:
LMBD r14, r14, 1 ; returns bit-position of highest valued 1, returns 32 if only 0s found
ADD r14, r14, 1 ; turn bit-position into bit-size
QBNE finished, r14, 33 ; handle empty number
AND r14, r14, 0 ; (32+1 -> 0 bit size)
finished:
JMP r3.w2
.global msb_position
msb_position:
LMBD r14, r14, 1 ; returns bit-position of highest valued 1, returns 32 if only 0s found
JMP r3.w2
.global max_value
max_value:
MAX r14, r14, r15 ; r14 is output and first input, r15 is second input
JMP r3.w2
.global min_value
min_value:
MIN r14, r14, r15 ; r14 is output and first input, r15 is second input
JMP r3.w2
|
tests/natools-chunked_strings-tests-bugfixes.adb | faelys/natools | 0 | 29185 | ------------------------------------------------------------------------------
-- Copyright (c) 2013, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Strings.Maps;
procedure Natools.Chunked_Strings.Tests.Bugfixes
(Report : in out Natools.Tests.Reporter'Class)
is
package NT renames Natools.Tests;
begin
Report.Section ("Tests for known bugs");
declare
Name : constant String := "Overreach of Index";
CS : Chunked_String := To_Chunked_String ("abcd0123");
N : Natural;
begin
CS.Head (4);
N := CS.Index (Ada.Strings.Maps.To_Set ("0123456789"));
if N /= 0 then
Report.Item (Name, NT.Fail);
Report.Info ("Index of digit" & Natural'Image (N) & ", expected 0.");
else
Report.Item (Name, NT.Success);
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
Report.End_Section;
end Natools.Chunked_Strings.Tests.Bugfixes;
|
src/main/fragment/mos6502-common/vwum1=vwum1_rol_4.asm | jbrandwood/kickc | 2 | 27787 | asl {m1}
rol {m1}+1
asl {m1}
rol {m1}+1
asl {m1}
rol {m1}+1
asl {m1}
rol {m1}+1
|
dino/lcs/enemy/48.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 176050 | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
001240 move.w (A0)+, ($48,A6)
001244 andi.b #$7f, D2 [enemy+48, etc+48, item+48]
001290 move.w (A0)+, ($48,A6)
001294 andi.b #$7f, D2 [enemy+48, etc+48, item+48]
004D3C move.l D0, (A4)+
004D3E move.l D0, (A4)+
010880 move.b ($48,A3), D1
010884 beq $10896 [enemy+48]
010938 move.b ($48,A3), D1
01093C beq $1095a [enemy+48]
010994 move.b ($48,A3), D1
010998 beq $109aa [enemy+48]
011014 move.b ($48,A3), D1
011018 beq $111aa [enemy+48]
0113A2 move.b ($48,A3), D1
0113A6 beq $114f2 [enemy+48]
01189E move.b ($48,A2), D0
0118A2 beq $118be [enemy+48]
0118A8 move.b ($48,A3), D1
0118AC beq $118be [enemy+48]
011B0A move.b ($48,A3), D1
011B0E beq $11b20 [enemy+48]
011EB4 move.b ($48,A3), D1
011EB8 beq $11eca [enemy+48]
011FBA move.b ($48,A2), D0
011FBE beq $1201a [123p+ 48, enemy+48]
01220A move.b ($48,A3), D1
01220E beq $12220 [enemy+48]
012374 move.b ($48,A3), D1
012378 beq $1238a [enemy+48]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
|
src/main/antlr4/org/hiromats3/Sample.g4 | hiromats3/antlr4-parser-rest-api | 0 | 5054 | <gh_stars>0
grammar Sample;
prog: expr;
expr: term (('+'|'-') term)*;
term: factor (('*'|'/') factor)*;
factor: INT
| '(' expr ')'
;
INT : [0-9]+ ; |
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/discriminant.adb | ouankou/rose | 488 | 27810 | with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
procedure Discrim1 is
type SQUARE is array(INTEGER range <>,
INTEGER range <>) of INTEGER;
type LINEAR_TYPE is array(INTEGER range <>) of POSITIVE;
type STUFF(List_Size : POSITIVE) is
record
Matrix : SQUARE(1..List_Size, 1..List_Size);
Elements : INTEGER := List_Size * List_Size;
Linear : LINEAR_TYPE(1..List_Size);
Number : INTEGER := List_Size;
end record;
type ANOTHER_STUFF is new STUFF;
subtype STUFF_5 is STUFF(5);
Data_Store : STUFF(5);
Big_Store : STUFF(12);
Extra_Store : ANOTHER_STUFF(5);
More_Store : STUFF(5);
Five_Store : STUFF_5;
Name_Store : STUFF(List_Size => 5);
begin
for Index1 in Data_Store.Matrix'RANGE(1) loop
Data_Store.Linear(Index1) := Index1;
for Index2 in Data_Store.Matrix'RANGE(2) loop
Data_Store.Matrix(Index1, Index2) := Index1 * Index2;
end loop;
end loop;
Five_Store := Data_Store;
More_Store := Five_Store;
Put("The number of elements in More_Store.Matrix is");
Put(More_Store.Elements, 5);
New_Line;
end Discrim1;
|
test/br3392442.asm | bitwiseworks/nasm-os2 | 1 | 6452 | <gh_stars>1-10
;; Bug report 3392442: invalid warning
and byte [0], ~80h
and byte [0], 0xfff
and byte [0], -256
and byte [0], -257
|
asmTests/datadup.asm | SimpleTease/asm2c | 154 | 176434 | .386p
dubsize EQU 13
testEqu EQU 1
_DATA segment use32 dword public 'DATA' ;IGNORE
var0 db 10 dup (?)
var db 4 dup (5)
var2 db 5 dup (0)
var3 db 5*5 dup (0,testEqu*2,2*2,3)
_DATA ends ;IGNORE
_TEXT segment use32 dword public 'CODE' ;IGNORE
assume cs:_TEXT,ds:_DATA
start: ;IGNORE
cmp [var],5
jne failure
cmp [var2],0
jne failure
cmp [var+3],5
jne failure
cmp [var+4],0
jne failure
cmp [var2-1],5
jne failure
cmp [var0+5],0
jne failure
cmp [var-1],0
jne failure
MOV al,0
JMP exitLabel
failure:
mov al,1
exitLabel:
mov ah,4ch ; AH=4Ch - Exit To DOS
int 21h ; DOS INT 21h
_TEXT ends ;IGNORE
stackseg segment para stack 'STACK' ;IGNORE
db 1000h dup(?)
stackseg ends ;IGNORE
end start ;IGNORE
|
oeis/308/A308814.asm | neoneye/loda-programs | 11 | 14806 | ; A308814: a(n) = Sum_{d|n} n^(d-1).
; 1,3,10,69,626,7819,117650,2097673,43046803,1000010011,25937424602,743008621405,23298085122482,793714780783695,29192926025441476,1152921504875286545,48661191875666868482,2185911559749718382455,104127350297911241532842,5242880000000512000168021,278218429446951548722962964,15519448971100915532497642519,907846434775996175406740561330,55572324035428506707064132319321,3552713678800500929355621338281251,236773830007967588972224121600151579,16423203268260658146231468083138792500
add $0,1
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,1
add $0,$4
dif $3,$0
mul $3,$0
sub $0,1
cmp $3,$2
add $5,$3
mul $5,$2
lpe
mov $0,$5
add $0,1
|
Step4/Little.g4 | alken2/COP4620 | 0 | 4523 | <reponame>alken2/COP4620
grammar Little;
KEYWORD: 'PROGRAM'|'BEGIN'|'END'|'FUNCTION'|'READ'|'WRITE'|'IF'|'ELSE'|'ENDIF'|'WHILE'|'ENDWHILE'|'CONTINUE'|'BREAK'|
'RETURN'|'INT'|'VOID'|'STRING'|'FLOAT';
OPERATOR: ':=' | '+' | '-' | '*' | '/' | '=' | '!=' | '<' | '>' | '(' | ')' | ';' | ',' | '<=' | '>=';
COMMENT: '--'[ -~\t]*[\r\n] -> skip;
WS: [ \t\r\n]+ -> skip;
IDENTIFIER: [a-zA-Z][a-zA-Z0-9]*;
INTLITERAL: [0-9]+;
FLOATLITERAL: [0-9]*'.'[0-9]+;
STRINGLITERAL: '"'[ -!#-~]*'"';
/*
CAPS : CAPS is a token (terminal) made up of one or more characters.
small case symbols are non-terminals.
*/
/* Program */
program: 'PROGRAM' id 'BEGIN' pgm_body 'END';
id: IDENTIFIER;
pgm_body: decl func_declarations;
decl: string_decl decl | var_decl decl | ;
/* Global String Declaration */
string_decl: 'STRING' id ':=' str ';';
str: STRINGLITERAL;
/* Variable Declaration */
var_decl: var_type id_list ';';
var_type: 'FLOAT' | 'INT';
any_type: var_type | 'VOID';
id_list: id id_tail;
id_tail: ',' id id_tail | ;
/* Function Paramater List */
param_decl_list: param_decl param_decl_tail | ;
param_decl: var_type id;
param_decl_tail: ',' param_decl param_decl_tail | ;
/* Function Declarations */
func_declarations: func_decl func_declarations | ;
func_decl: 'FUNCTION' any_type id '('param_decl_list')' 'BEGIN' func_body 'END';
func_body: decl stmt_list;
/* Statement List */
stmt_list: stmt stmt_list | ;
stmt: base_stmt | if_stmt | while_stmt;
base_stmt: assign_stmt | read_stmt | write_stmt | return_stmt;
/* Basic Statements */
assign_stmt: assign_expr ';';
assign_expr: id ':=' expr;
read_stmt: 'READ' '(' id_list ')'';';
write_stmt: 'WRITE' '(' id_list ')'';';
return_stmt: 'RETURN' expr ';';
/* Expressions */
expr: expr_prefix factor;
expr_prefix: expr_prefix factor addop | ;
factor: factor_prefix postfix_expr;
factor_prefix: factor_prefix postfix_expr mulop | ;
postfix_expr: primary | call_expr;
call_expr: id '(' expr_list ')';
expr_list: expr expr_list_tail | ;
expr_list_tail: ',' expr expr_list_tail | ;
primary: '(' expr ')' | id | INTLITERAL | FLOATLITERAL;
addop: '+' | '-';
mulop: '*' | '/';
/* Complex Statements and Condition */
if_stmt: 'IF' '(' cond ')' decl stmt_list else_part 'ENDIF';
else_part: 'ELSE' decl stmt_list | ;
cond: expr compop expr;
compop: '<' | '>' | '=' | '!=' | '<=' | '>=';
/* While statements */
while_stmt: 'WHILE' '(' cond ')' decl stmt_list 'ENDWHILE';
|
pe64-no-imports-normal-teb.asm | dzik143/minimal-pe64 | 1 | 28221 | ;###############################################################################
;# #
;# Copyright (C) 2020 by <NAME> <<EMAIL>> #
;# #
;# Permission to use, copy, modify, and/or distribute this software for any #
;# purpose with or without fee is hereby granted. #
;# #
;# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES #
;# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF #
;# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR #
;# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES #
;# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN #
;# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR #
;# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #
;# #
;###############################################################################
; Created on: 2020-10-12
; Last modified on: 2020-10-15
; PE32+ withouts imports table (TEB version)
; ==========================================
; Standard PE32+ file (64-bit) showing how to get address to LoadLibraryA()
; and GetProcAddress() *WITHOUT* imports table.
; - 1536 bytes,
; - 2 sections (code and data),
; - *NO* imports table and other data directories,
; - uses *THREAD ENVIRONMENT BLOCK* (TEB) to get kernel32.dll base,
; - reads entry point of GetAddressProc() directly in kernel32 exports,
; - then call it to get entry of LoadLibraryA() routine.
; Based on code from posts:
; -------------------------
; - https://stackoverflow.com/a/32820799
; - https://hero.handmade.network/forums/code-discussion/t/129-howto_-_building_without_import_libraries
; - https://stackoverflow.com/a/45528159
; Below code does:
; ----------------
; 1. Find KERNEL32.DLL base via return address,
; 2. Find ExportTable in KERNEL32.DLL module,
; 3. Find GetProcAddress entry in kernel32!ExportTable,
; 4. Get entry point of GetProcAddress directly (from kernel32 exports),
; 5. Use GetProcAddress to find entry of LoadLibraryA routine,
; 6. Import user32!MessageBoxA routine,
; 7. Call MessageBoxA() to show it works.
; How does it work:
; ----------------
; - GS register points to the Thread Environment Block (TEB) on x86-64 Windows
; (https://en.wikipedia.org/wiki/Win32_Thread_Information_Block),
;
; - We search TEB.PEB.LoaderData.Modules for 'kernel32.dll' entry.
; Possible improvements:
; ----------------------
; - match full '%WINDIR%\SYSTEM32\KERNEL32.DLL' path for security (?)
; (we search for kernel32.dll string only).
; Limitations:
; - Code works on x86-64 only (PE32+).
; Build by command:
; -----------------
; fasm pe64-no-imports-normal-teb.asm
format PE64
entry __entryPoint
; ##############################################################################
; #
; # Code section
; #
; ##############################################################################
__entryPoint:
; ##########################################################################
; #
; # Step 1: Find KERNEL32.DLL base via Thread Environment Block
; #
; ##########################################################################
; ----------------------------------------
; Fetch TEB.PEB.LoaderData.Modules[] array
mov rbx, qword [gs:0x30] ; rbx = TEB = Thread Environment Block
mov rbx, qword [rbx + 0x60] ; rbx = TEB.PEB = Process Environment Block
mov rbx, qword [rbx + 0x18] ; rbx = TEB.PEB.LoaderData
mov rbx, qword [rbx + 0x20] ; rbx = TEB.PEB.LoaderData.Modules
; ------------------------------
; Search for kernel32.dll module
; One loader entry is:
; struct win32_ldr_data_entry
; {
; LIST_ENTRY LinkedList; ; 0 8
; LIST_ENTRY UnusedList; ; 8 8
; PVOID BaseAddress; ; 16 8
; PVOID Reserved2[1]; ; 24 8
; PVOID DllBase; ; 32 8
; PVOID EntryPoint; ; 40 8
; PVOID Reserved3; ; 48 8
; USHORT DllNameLength; ; 56 2
; USHORT DllNameMaximumLength; ; 58 2
; USHORT Reserver4[2] ; 60 4
; PWSTR DllNameBuffer; ; 64 8
; }
.scanNextLdrModule:
mov rbx, [rbx] ; rbx = next module in linked list
; -------------------
; Fetch next DllName
mov esi, [rbx + 56] ; si = DllNameLength (int16)
and esi, 0xff ; rsi = DllNameLength (int64)
add rsi, qword [rbx + 64] ; rsi = DllNameBuffer + DllNameLength =
; = the end of DllNameLength buffer
; --------------------------------------------------------------------------
; Match KERNEL32.DLL from backward, because
; entries contain full module paths e.g.
; C:\WINDOWS\SYSTEM32\KERNEL32.DLL
; ^^^^^^^^^^^^
; We match this part only (last 12*2 bytes)
; --------------------------------------------------------------------------
mov ecx, 12 ; rcx = 12 = len('kernel32.dll') in chars
sub rsi, 26 ; rsi = &DllName[len(DllName) - 12 - 1]
.compareLoop:
mov al, [rsi + rcx*2] ; al = fetch next char
or al, 32 ; al = lowercase
cmp al, [__name_kernel32 + rcx - 1]
; are characters equal?
jne .scanNextLdrModule ; go to next module if not matched
dec ecx ; compare up to 12 characters (24 bytes)
jnz .compareLoop
.kernel32_found:
mov rbx, [rbx + 32] ; rbx = base of kernel32 module
; ##########################################################################
; #
; # Step 2: Find ExportTable in KERNEL32.DLL module
; #
; ##########################################################################
mov edx, [rbx + 60] ; rdx = offset of the PE header in file (RVA)
add rdx, rbx ; rdx = BASE + PE header RVA =
; = addres of PE header in memory
mov edx, [rdx + 24 + 112] ; rdx = offset to OptionalHeader (+24)
; + ExportTable (+112)
; = OptionalHeader.ExportTable RVA
add rdx, rbx ; rdx = BASE + ExportTable RVA =
; = address of export table in memory
; ##########################################################################
; #
; # Step 3: Find GetProcAddress entry in kernel32!ExportTable
; #
; ##########################################################################
mov esi, [rdx + 32] ; esi = RVA(NamePointerTable)
add rsi, rbx ; rsi = BASE + RVA(NamePointerTable)
; = address of NamePointerTable in memory
push -1
pop rcx ; rcx = procIdx = index in export table
.scanNextProc:
; ----------------------------
; Fetch next proc entry
inc ecx ; rcx = procIdx + 1 = go to next proc entry
mov eax, [rsi + rcx*4] ; rax = RVA(NamePointerTable[procIdx])
add rax, rbx ; rax = BASE + RVA(NamePointerTable[procIdx])
; = address of NamePointerTable[procIdx]
; in memory
; -------------------------------------------
; Match 'GetProcAddress\0
; Possible improvement: Match zero terminator
mov rdi, 'GetProcA' ; Compare first 8 bytes
cmp rdi, qword [rax] ;
jnz .scanNextProc ;
mov rdi, 'Address' ; Compare last 8 bytes including zero
cmp rdi, qword [rax + 7] ; terminator. 7-th byte is compared twice
jnz .scanNextProc ; to make code shorter.
; ##########################################################################
; #
; # Step 4: Get entry point of GetProcAddress directly
; #
; ##########################################################################
; --------------------------------------------------------------------------
; At this place:
; rbx = kernel32 base (HMODULE),
; rcx = procIdx = index of GetProcAddress in exports table,
; rdx = export table of kernel32.
; ------------------------------------------
; Fetch GetProcAddress ordinal
; ... = ExportTable.OrdinalTable[procIdx]
mov eax, [rdx + 36] ; eax = RVA(ExportTable.OrdinalTable)
add rax, rbx ; rax = ExportTable.OrdinalTable
movzx ecx, word [rax + rcx*2] ; ecx = ExportTable.OrdinalTable[procIdx]
; = GetProcAddress ordinal number
; -------------------------------------------------------
; Fetch GetProcAddress entry point
; ... = BASE + ExportTable.ExportAddressTable[ordinal]
mov eax, [rdx + 28] ; edx = RVA(ExportTable.ExportAddressTable)
add rax, rbx ; rax = ExportTable.ExportAddressTable
mov edi, [rax + rcx*4] ; edi = RVA(GetProcAddress)
add rdi, rbx ; rdi = BASE + RVA(GetProcAddress)
; = GetProcAddress entry point
mov qword [__imp_GetProcAddress], rdi
; Save entry GetProcAddress
; ##########################################################################
; #
; # Step 5: Use GetProcAddress to find entry of LoadLibraryA routine.
; #
; ##########################################################################
; ----------------------------------------------
; ... = GetProcAddress(kernel32, 'LoadLibraryA')
sub rsp, 32 + 8 ; Make shadow space (+32) and align stack
; to 16-bytes before system calls (+8)
mov rcx, rbx ; rcx = rbx = moduleBase = kernel32
lea rdx, [__name_LoadLibraryA]
; rdx = 'LoadLibraryA'
call [__imp_GetProcAddress] ; rax = GetProcAddress(kernel32,
; 'LoadLibrary')
mov [__imp_LoadLibraryA], rax
; Save entry to LoadLibraryA
; ##########################################################################
; #
; # Step 6: Import user32!MessageBoxA routine.
; #
; ##########################################################################
; --------------------------------
; Import user32.dll
; ... = LoadLibraryA('user32.dll')
lea rcx, [__name_user32] ; rcx = 'user32.dll'
call rax ; rax = LoadLibrary('user32.dll')
mov [__imp_User32], rax ; save user32 module base
; -------------------------------------------
; Import user32!MessageBoxA routine
; ... = GetProcAddress(user32, 'MessageBoxA')
mov rcx, rax ; rcx = moduleBase = user32
lea rdx, [__name_MessageBoxA] ; rdx = 'MessageBoxA'
call [__imp_GetProcAddress] ; rax = GetProcAddress(msvcrt,
; 'MessageBoxA')
; ##########################################################################
; #
; # Step 7: Call MessageBoxA() to show it's work
; #
; ##########################################################################
; ---------------------------------------
; Call MessageBoxA(NULL, msg, caption, 0)
xor ecx, ecx ; rcx = hWnd = NULL = desktop
lea rdx, [__messageText] ; rdx = message text
lea r8, [__messageCaption] ; r8 = message caption
xor r9d, r9d ; r9 = uType = 0 = MB_OK
call rax ; rax = result of MessageBoxA(...)
.done:
add rsp, 32 + 8 ; Clean stack frame
ret ;
; ##############################################################################
; #
; # Data section
; #
; ##############################################################################
section '.data' writeable readable
__name_kernel32 db 'kernel32.dll', 0
__name_user32 db 'user32.dll', 0
__name_LoadLibraryA db 'LoadLibraryA', 0
__name_MessageBoxA db 'MessageBoxA', 0
__messageCaption db 'PE32+ without imports table (TEB version).', 0
__messageText db 'This executable has no imports table.', 13, 10
db 'We found kernel32 base via Thread Environment Block (TEB).', 0
__imp_Kernel32 dq ?
__imp_User32 dq ?
__imp_LoadLibraryA dq ?
__imp_GetProcAddress dq ?
|
oeis/294/A294120.asm | neoneye/loda-programs | 11 | 14851 | <filename>oeis/294/A294120.asm
; A294120: E.g.f.: exp(3*((1+x)^3 - 1)).
; Submitted by <NAME>
; 1,9,99,1233,16929,251829,4012011,67876461,1211592897,22700600001,444567396051,9068604811209,192115381719969,4216003141209453,95631348748295259,2237799925576748709,53928909429116324481,1336410276724468307961,34008072993641690902467,887589803169289307522241,23732540024106975508247841,649432798996161513168674469,18170884776057803943069825099,519393252807236998865718038493,15154802539181583353192513469249,451044063632815803677893704944049,13683781280486134535912551813520691
mov $2,1
lpb $0
sub $0,1
mov $1,$4
mul $1,$0
mul $2,9
add $3,$4
mov $4,$2
add $2,$3
mov $3,$1
div $3,2
mul $4,$0
mul $4,2
lpe
mov $0,$2
|
arch/ARM/NXP/drivers/nxp-pint.adb | morbos/Ada_Drivers_Library | 2 | 29172 | with HAL; use HAL;
with NXP.Device; use NXP.Device;
with NXP_SVD; use NXP_SVD;
with NXP_SVD.SYSCON; use NXP_SVD.SYSCON;
with NXP_SVD.PINT; use NXP_SVD.PINT;
with System; use System;
package body NXP.Pint is
PINT : aliased PINT_Peripheral
with Import, Address => S_NS_Periph (PINT_Base);
procedure Enable_Pint
is
begin
SYSCON_Periph.AHBCLKCTRL0.PINT := Enable;
end Enable_Pint;
procedure Disable_Pint
is
begin
SYSCON_Periph.AHBCLKCTRL0.PINT := Disable;
end Disable_Pint;
function Pint_Interrupt_Pending (IntNum : Pint_PinInt) return Boolean
is
Mask : UInt8 := (2 ** IntNum'Enum_Rep);
begin
return (PINT.IST.PSTAT and Mask) = Mask;
end Pint_Interrupt_Pending;
procedure Pint_Clear_Interrupt (IntNum : Pint_PinInt)
is
Mask : UInt8 := (2 ** IntNum'Enum_Rep);
begin
PINT.IST.PSTAT := Mask;
end Pint_Clear_Interrupt;
-- PINT_PinInterruptConfig(PINT, kPINT_PinInt2, kPINT_PinIntEnableFallEdge, pint_intr_callback);
-- /* Enable callbacks for PINT2 by Index */
-- PINT_EnableCallbackByIndex(PINT, kPINT_PinInt2);
end NXP.Pint;
|
AppleScript/Extras/XHTML/20)Inline Elements/35)<img>.applescript | rightontron/coteditor-SampleScripts | 24 | 3860 | <filename>AppleScript/Extras/XHTML/20)Inline Elements/35)<img>.applescript
(*
<img>.applescript
Sample Script for CotEditor
Description:
Wrap the selection with <img> and </img> tags.
written by nakamuxu on 2005-03-14
modified by 1024jp on 2015
*)
--
property beginStr : "<img src=\"\" alt =\"\" title=\"\" width=\"\" height=\"\"/>"
property endStr : ""
property preMargin : 10
--
tell application "CotEditor"
if not (exists front document) then return
tell front document
set {loc, len} to range of selection
if (len = 0) then
set newStr to beginStr & endStr
if (preMargin = 0) then
set numOfMove to count of character of beginStr
else
set numOfMove to preMargin
end if
else if (len > 0) then
set curStr to contents of selection
set newStr to beginStr & curStr & endStr
if (preMargin = 0) then
set numOfMove to count of character of newStr
else
set numOfMove to preMargin
end if
else
return
end if
set contents of selection to newStr
set range of selection to {loc + numOfMove, 0}
end tell
end tell
|
third-party/gmp/gmp-src/mpn/powerpc64/mode64/bdiv_q_1.asm | jhh67/chapel | 1,602 | 104880 | dnl PowerPC-64 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb
dnl divisor.
dnl Copyright 2006, 2010, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C norm unorm
C POWER3/PPC630 13-19
C POWER4/PPC970 16
C POWER5 16 16
C POWER6 37 46
C POWER7 12 12
C POWER8 12 12
C INPUT PARAMETERS
define(`rp', `r3')
define(`up', `r4')
define(`n', `r5')
define(`d', `r6')
define(`di', `r7')
define(`cnt',`r8')
define(`tnc',`r10')
ASM_START()
EXTERN(binvert_limb_table)
PROLOGUE(mpn_bdiv_q_1,toc)
addi r7, n, -1
cmpdi cr1, n, 1
ld r12, 0(up)
li cnt, 0
neg r0, d
and r0, d, r0
cntlzd r0, r0
subfic cnt, r0, 63
srd d, d, cnt
L(7):
mtctr r7
LEA( r10, binvert_limb_table)
rldicl r11, d, 63, 57
lbzx r0, r10, r11
mulld r9, r0, r0
sldi r0, r0, 1
mulld r9, d, r9
subf r0, r9, r0
mulld r10, r0, r0
sldi r0, r0, 1
mulld r10, d, r10
subf r0, r10, r0
mulld r9, r0, r0
sldi r0, r0, 1
mulld r9, d, r9
subf di, r9, r0 C di = 1/d mod 2^64
ifdef(`AIX',
` C For AIX it is not clear how to jump into another function.
b .mpn_pi1_bdiv_q_1
',`
C For non-AIX, dispatch into the pi1 variant.
bne cr0, L(norm)
b L(unorm)
')
EPILOGUE()
PROLOGUE(mpn_pi1_bdiv_q_1)
cmpdi cr0, cnt, 0
ld r12, 0(up)
addic r0, n, -1 C set carry as side effect
cmpdi cr1, n, 1
mtctr r0
beq cr0, L(norm)
L(unorm):
subfic tnc, cnt, 64 C set carry as side effect
li r5, 0
srd r11, r12, cnt
beq cr1, L(ed1)
ALIGN(16)
L(tpu): ld r12, 8(up)
nop
addi up, up, 8
sld r0, r12, tnc
or r11, r11, r0
subfe r9, r5, r11
srd r11, r12, cnt
mulld r0, di, r9
mulhdu r5, r0, d
std r0, 0(rp)
addi rp, rp, 8
bdnz L(tpu)
subfe r11, r5, r11
L(ed1): mulld r0, di, r11
std r0, 0(rp)
blr
ALIGN(16)
L(norm):
mulld r11, r12, di
mulhdu r5, r11, d
std r11, 0(rp)
beqlr cr1
ALIGN(16)
L(tpn): ld r9, 8(up)
addi up, up, 8
subfe r5, r5, r9
mulld r11, di, r5
mulhdu r5, r11, d C result not used in last iteration
std r11, 8(rp)
addi rp, rp, 8
bdnz L(tpn)
blr
EPILOGUE()
ASM_END()
|
tools-src/gnu/gcc/gcc/ada/mdllfile.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 27372 | <gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M D L L . F I L E S --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Simple services used by GNATDLL to deal with Filename extension
package MDLL.Files is
No_Ext : constant String := "";
-- Used to mark the absence of an extension
function Get_Ext (Filename : String) return String;
-- Return extension of Filename
function Is_Ali (Filename : String) return Boolean;
-- Test if Filename is an Ada library file (.ali).
function Is_Obj (Filename : String) return Boolean;
-- Test if Filename is an object file (.o or .obj)
function Ext_To
(Filename : String;
New_Ext : String := No_Ext)
return String;
-- Return Filename with the extension change to New_Ext
end MDLL.Files;
|
audio.asm | unlink2/nesrpg | 5 | 13155 | <filename>audio.asm
; this sub routine inits audio
; side effects:
; overwrites a register
init_audio_channels:
; Init $4000-4013
ldy #$13
@loop: lda @regs,y
sta $4000,y
dey
bpl @loop
; We have to skip over $4014 (OAMDMA)
; enable Square 1, Square 2, Triangle and Noise channels. Disable DMC.
lda #$0F
sta $4015
lda #$40
sta $4017
jsr stop_audio
rts
@regs:
.db $30,$08,$00,$00
.db $30,$08,$00,$00
.db $80,$00,$00,$00
.db $30,$00,$00,$00
.db $00,$00,$00,$00
; stops all sounds on all channels
stop_audio:
; set up audio pointers
lda #<no_audio
sta pulse_ptr_1
sta pulse_ptr_2
sta triangle_ptr
sta noise_ptr
lda #>no_audio
sta pulse_ptr_1+1
sta pulse_ptr_2+1
sta triangle_ptr+1
sta noise_ptr+1
rts
; this sub routine update all audio playback
; inputs:
; pulse, triangle and noise_ptrs
; side effects:
; updates audio timer and registers
; user register a, x, y
update_audio:
; pulse 1 code
ldy #$00
lda (pulse_ptr_1), y
cmp #$FF
beq @not_pulse_1 ; no update
ldx pulse_timer_1
dex
stx pulse_timer_1
bne @not_pulse_1 ; if timer is not 0 do not play yet
ldx pulse_periode_1
stx pulse_timer_1 ; store periode again
; skip update
cmp #$FE
beq @skip_note_pulse1
sta $4000 ; store channel settings
iny
lda (pulse_ptr_1), y
tax ; note offset
lda period_table_hi, x
sta $4003
lda period_table_lo, x
sta $4002
lda pulse_sweep_1
sta $4001
@skip_note_pulse1:
lda pulse_ptr_1
clc
adc #$02 ; add 2 for next pair
sta pulse_ptr_1
lda pulse_ptr_1+1
adc #$00
sta pulse_ptr_1+1
@not_pulse_1:
; pulse 2 code
ldy #$00
lda (pulse_ptr_2), y
cmp #$FF
beq @not_pulse_2 ; no update
ldx pulse_timer_2
dex
stx pulse_timer_2
bne @not_pulse_2 ; if timer is not 0 do not play yet
ldx pulse_periode_2
stx pulse_timer_2 ; store periode again
; skip update
cmp #$FE
beq @skip_note_pulse2:
sta $4004 ; store channel settings
iny
lda (pulse_ptr_2), y
tax ; note offset
lda period_table_hi, x
sta $4007
lda period_table_lo, x
sta $4006
lda pulse_sweep_2
sta $4005
@skip_note_pulse2:
lda pulse_ptr_2
clc
adc #$02 ; add 2 for next pair
sta pulse_ptr_2
lda pulse_ptr_2+1
adc #$00
sta pulse_ptr_2+1
@not_pulse_2:
; triangle code
ldy #$00
lda (triangle_ptr), y
cmp #$FF
beq @not_triangle ; no update
ldx triangle_timer
dex
stx triangle_timer
bne @not_triangle ; if timer is not 0 do not play yet
ldx triangle_periode
stx triangle_timer ; store periode again
cmp #$FE
beq @skip_note_triangle:
sta $4008 ; store channel settings
sta $4017
iny
lda (triangle_ptr), y
tax ; note offset
lda period_table_hi+12, x
sta $400B
lda period_table_lo+12, x
sta $400A
@skip_note_triangle:
lda triangle_ptr
clc
adc #$02 ; add 2 for next pair
sta triangle_ptr
lda triangle_ptr+1
adc #$00
sta triangle_ptr+1
@not_triangle:
; triangle code
ldy #$00
lda (noise_ptr), y
cmp #$FF
beq @not_noise ; no update
ldx noise_timer
dex
stx noise_timer
bne @not_noise ; if timer is not 0 do not play yet
ldx noise_periode
stx noise_timer ; store periode again
cmp #$FE
beq @skip_note_noise ; skip note if FE
sta $400C ; store channel settings
iny
lda (noise_ptr), y
sta $400E
iny
lda (noise_ptr), y
sta $400F
@skip_note_noise:
lda noise_ptr
clc
adc #$03 ; add 3 for next pair
sta noise_ptr
lda noise_ptr+1
adc #$00
sta noise_ptr+1
@not_noise:
rts
; this sub routine plays a cursor beep
; noise
; side effects:
; uses a register
; loads sound into noise channel
init_cursor_beep:
lda #<cursor_noise
sta noise_ptr
lda #>cursor_noise
sta noise_ptr+1
lda #10
sta noise_periode ; 10 frames per periode
lda #$01
sta noise_timer
rts
; this sub routine sets up
; the jump sound
; side effects:
; uses A register
; loads sound into noise channel
init_sword_noise:
init_jump_noise:
lda #<jump_noise
sta noise_ptr
lda #>jump_noise
sta noise_ptr+1
lda #$30
sta noise_periode
lda #$01
sta noise_timer
rts
init_hit_noise:
lda #<hit_noise
sta noise_ptr
lda #>hit_noise
sta noise_ptr+1
lda #$30
sta noise_periode
lda #$01
sta noise_timer
rts
init_push_noise:
lda #<push_noise
sta noise_ptr
lda #>push_noise
sta noise_ptr+1
lda #$20
sta noise_periode
lda #$01
sta noise_timer
rts
init_coin_noise:
lda #<coin_noise
sta noise_ptr
lda #>coin_noise
sta noise_ptr+1
lda #$20
sta noise_periode
lda #$01
sta noise_timer
rts
; this sub routine inits the test song
; side effects:
; uses A register
; loads sound into both square wave channels
; and the triangle channel
init_test_song:
lda #$1F ; periode
sta pulse_periode_1
sta pulse_periode_2
sta triangle_periode
lda #$01
sta pulse_timer_1
sta pulse_timer_2
sta triangle_timer
lda #<test_song_square_1
sta pulse_ptr_1
lda #>test_song_square_1
sta pulse_ptr_1+1
lda #<test_song_square_2
sta pulse_ptr_2
lda #>test_song_square_2
sta pulse_ptr_2+1
lda #<test_song_triangle
sta triangle_ptr
lda #>test_song_triangle
sta triangle_ptr+1
lda #%1000000
sta pulse_sweep_1
sta pulse_sweep_2
rts
|
programs/oeis/083/A083705.asm | neoneye/loda | 22 | 247081 | ; A083705: a(n) = 2*a(n-1) - 1 with a(0)=10.
; 10,19,37,73,145,289,577,1153,2305,4609,9217,18433,36865,73729,147457,294913,589825,1179649,2359297,4718593,9437185,18874369,37748737,75497473,150994945,301989889,603979777,1207959553,2415919105,4831838209,9663676417,19327352833,38654705665,77309411329,154618822657,309237645313,618475290625,1236950581249,2473901162497,4947802324993,9895604649985,19791209299969,39582418599937,79164837199873,158329674399745,316659348799489,633318697598977,1266637395197953,2533274790395905,5066549580791809,10133099161583617,20266198323167233,40532396646334465,81064793292668929,162129586585337857,324259173170675713,648518346341351425,1297036692682702849,2594073385365405697,5188146770730811393,10376293541461622785,20752587082923245569,41505174165846491137,83010348331692982273,166020696663385964545,332041393326771929089,664082786653543858177,1328165573307087716353,2656331146614175432705,5312662293228350865409,10625324586456701730817,21250649172913403461633,42501298345826806923265,85002596691653613846529,170005193383307227693057,340010386766614455386113,680020773533228910772225,1360041547066457821544449,2720083094132915643088897,5440166188265831286177793,10880332376531662572355585,21760664753063325144711169,43521329506126650289422337,87042659012253300578844673,174085318024506601157689345,348170636049013202315378689,696341272098026404630757377,1392682544196052809261514753,2785365088392105618523029505,5570730176784211237046059009,11141460353568422474092118017,22282920707136844948184236033,44565841414273689896368472065,89131682828547379792736944129,178263365657094759585473888257,356526731314189519170947776513,713053462628379038341895553025,1426106925256758076683791106049,2852213850513516153367582212097,5704427701027032306735164424193
mov $1,2
pow $1,$0
mul $1,9
add $1,1
mov $0,$1
|
programs/oeis/014/A014016.asm | neoneye/loda | 22 | 167499 | <filename>programs/oeis/014/A014016.asm
; A014016: Expansion of inverse of 7th cyclotomic polynomial; period 7: repeat [1, -1, 0, 0, 0, 0, 0].
; 1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1,0,0,0,0,0,1,-1
sub $1,$0
mod $1,7
pow $1,$1
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1982.asm | ljhsiun2/medusa | 9 | 88252 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1a796, %rbx
cmp $59099, %rax
mov $0x6162636465666768, %r11
movq %r11, %xmm7
movups %xmm7, (%rbx)
nop
nop
nop
add %r11, %r11
lea addresses_WT_ht+0x1e2c6, %r14
inc %r12
movb $0x61, (%r14)
dec %rax
lea addresses_D_ht+0x6ec6, %r14
nop
nop
dec %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm1
movups %xmm1, (%r14)
inc %r12
lea addresses_WT_ht+0x1ce, %rsi
lea addresses_UC_ht+0xdd46, %rdi
and %r12, %r12
mov $9, %rcx
rep movsq
nop
nop
nop
dec %rbx
lea addresses_UC_ht+0x10406, %rbx
nop
nop
nop
cmp %rdi, %rdi
movb (%rbx), %r12b
nop
nop
nop
nop
nop
inc %rbx
lea addresses_A_ht+0xc14e, %rsi
lea addresses_UC_ht+0x1c1c6, %rdi
xor %rbx, %rbx
mov $39, %rcx
rep movsl
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_normal_ht+0x5766, %rbp
add %rdi, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, (%rbp)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_D_ht+0x59c6, %rbx
clflush (%rbx)
nop
nop
nop
dec %r12
mov (%rbx), %r11
nop
nop
nop
nop
nop
inc %rdi
lea addresses_normal_ht+0x1366e, %r12
clflush (%r12)
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
movups %xmm4, (%r12)
nop
inc %rbp
lea addresses_normal_ht+0x111c6, %r14
nop
nop
and %rbp, %rbp
movw $0x6162, (%r14)
nop
nop
nop
nop
sub $41148, %rax
lea addresses_WT_ht+0x1b446, %rsi
lea addresses_A_ht+0x147ee, %rdi
nop
nop
nop
dec %r12
mov $126, %rcx
rep movsb
nop
xor $54313, %rdi
lea addresses_D_ht+0x128a6, %rsi
lea addresses_D_ht+0x413a, %rdi
nop
cmp $6313, %rax
mov $97, %rcx
rep movsb
nop
dec %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_UC+0x195c6, %rsi
lea addresses_PSE+0x69c6, %rdi
nop
dec %rbp
mov $75, %rcx
rep movsq
nop
and $21160, %rsi
// Faulty Load
lea addresses_WC+0x9c6, %rcx
nop
nop
nop
and $61477, %rsi
mov (%rcx), %di
lea oracles, %rbp
and $0xff, %rdi
shlq $12, %rdi
mov (%rbp,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 11, 'same': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': True}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
Cubical/Data/FinType/Properties.agda | thomas-lamiaux/cubical | 1 | 15384 | <reponame>thomas-lamiaux/cubical
{-
This file contains:
- Some basic properties of Rijke finite types.
-}
{-# OPTIONS --safe #-}
module Cubical.Data.FinType.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.Properties
open import Cubical.HITs.SetTruncation
open import Cubical.Data.Nat
open import Cubical.Data.FinSet
open import Cubical.Data.FinSet.Constructors
open import Cubical.Data.FinType.Base
private
variable
ℓ ℓ' : Level
n : ℕ
X : Type ℓ
Y : Type ℓ'
EquivPresIsFinType : (n : ℕ) → X ≃ Y → isFinType n X → isFinType n Y
EquivPresIsFinType 0 e = EquivPresIsFinSet (isoToEquiv (setTruncIso (equivToIso e)))
EquivPresIsFinType (suc n) e (p , q) .fst = EquivPresIsFinType 0 e p
EquivPresIsFinType (suc n) e (p , q) .snd a b =
EquivPresIsFinType n (invEquiv (congEquiv (invEquiv e))) (q _ _)
isFinSet→isFinType : (n : ℕ) → isFinSet X → isFinType n X
isFinSet→isFinType 0 p = EquivPresIsFinSet (invEquiv (setTruncIdempotent≃ (isFinSet→isSet p))) p
isFinSet→isFinType (suc n) p .fst = isFinSet→isFinType 0 p
isFinSet→isFinType (suc n) p .snd a b = isFinSet→isFinType n (isFinSet≡ (_ , p) _ _)
isPathConnected→isFinType0 : isContr ∥ X ∥₂ → isFinType 0 X
isPathConnected→isFinType0 p = isContr→isFinSet p
|
oeis/158/A158440.asm | neoneye/loda-programs | 11 | 23316 | ; A158440: Triangle T(n,k) read by rows: row n contains n times n+1 followed by n 1's.
; Submitted by <NAME>
; 2,1,3,3,1,1,4,4,4,1,1,1,5,5,5,5,1,1,1,1,6,6,6,6,6,1,1,1,1,1,7,7,7,7,7,7,1,1,1,1,1,1,8,8,8,8,8,8,8,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,1,1,1,1,1,1,1,1,10,10,10,10,10,10,10,10,10,1,1,1,1,1,1,1,1,1,11,11,11,11,11,11,11
mov $2,$0
lpb $0
mov $0,$2
add $3,1
div $0,$3
sub $0,$3
mov $1,4
add $1,$0
lpe
lpb $1
mul $1,2
add $1,1
dif $1,3
mov $3,-1
lpe
mov $0,$3
add $0,2
|
firehog/ncurses/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb | KipodAfterFree/KAF-2019-FireHog | 1 | 7861 | <reponame>KipodAfterFree/KAF-2019-FireHog
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Panels.User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- 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, distribute with modifications, 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 ABOVE 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. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: <NAME> <<EMAIL>> 1996
-- Version Control:
-- $Revision: 1.7 $
-- Binding Version 00.93
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
use Terminal_Interface.Curses.Aux;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
package body Terminal_Interface.Curses.Panels.User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Pan : in Panel;
Data : in User_Access)
is
function Set_Panel_Userptr (Pan : Panel;
Addr : User_Access) return C_Int;
pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
begin
if Set_Panel_Userptr (Pan, Data) = Curses_Err then
raise Panel_Exception;
end if;
end Set_User_Data;
function Get_User_Data (Pan : in Panel) return User_Access
is
function Panel_Userptr (Pan : Panel) return User_Access;
pragma Import (C, Panel_Userptr, "panel_userptr");
begin
return Panel_Userptr (Pan);
end Get_User_Data;
procedure Get_User_Data (Pan : in Panel;
Data : out User_Access)
is
begin
Data := Get_User_Data (Pan);
end Get_User_Data;
end Terminal_Interface.Curses.Panels.User_Data;
|
programs/oeis/017/A017003.asm | neoneye/loda | 22 | 18635 | ; A017003: a(n) = (7*n + 1)^11.
; 1,8589934592,8649755859375,584318301411328,12200509765705829,131621703842267136,929293739471222707,4882812500000000000,20635899893042801193,73786976294838206464,231122292121701565271,650190514836423555072,1673432436896142578125,3996373778857415671808,8953382542587164451099,18982985583354248390656,38358611506121121577937,74300837068800000000000,138624799340320978519423,250122512189374498985984,437935588474487527439541,746240592700077928087552,1240648285957267138671875,2016810807672035804940288,3211838877954855105157369,5019255990031848807858176,7708359963113024511280167,11649025889821900000000000,17343170265605241347130653,25464305835922478547861504,36906852424971083485992811,52847132780654751438252032,74818276426792144775390625,104801580876470315823136768,145337240630172360933794639,199657752537985561759389696,271847743804884990713499397,367034448698777600000000000,491613584498601037846604883,653515949089146258317953024,862520684644188385040795081,1130621826892669783231168512,1472455490465714973583984375,1905795830785729527017781248,2452128774972233608245132909,3137313431470823142080905216,3992342073809083968859805627,5054210651372681700000000000,6366912912781415703444512113,7982572438812891719395180544,9962728175433694563518616351,12379790436996519307878356992,15318685818767563885595703125,18878711020461444446161993728,23175617242259741753050742179,28343948575831725778577524736,34539659679198468283732168857,41943040000000000000000000000,50761973901033889039170022343,61235568249106027885106264064,73638181357622863863877426621,88283889629390066997077737472,105531430833275902825341796875,125789665671337497908806494208,149523602156362812588586992449,177261030328297458104329568256,209599817996529430739834959087,247215921508401230300000000000,290872169017591458452425905573,341427877364219557396646723584,399849367486819482609834395891,467221447269921365272965629952,544759934895174099174853515625,633825300114114700748351602688,735937505402299585294763053719,852792133693094851836500555776,986277894330592476397946946317,1138495604030571110400000000000,1311778745001927027370820531803,1508715707964414645985848879104,1732173833607787897772353894161,1985325372078533349421908754432,2271675486359422206878662109375,2595092431930248824098639239168,2959840051871614745048248895989,3370612733603785183127505207296,3832572980745893676320153300547,4351391761143583866100000000000,4933291799952117279127519871033,5585093994783683917276589850624,6314267138338848586317495491431,7128981142649549347984776230912,8038163968071713324068798828125,9051562469486326303036064923648,10179807381805722116509203289259,11434482676844060410283537442816,12828199533904631006539357591777,14374675177069032243200000000000,16088816843151771114214119493263,17986811155615855280690839558144
mul $0,7
add $0,1
pow $0,11
|
3-mid/impact/source/3d/dynamics/impact-d3-object-rigid.adb | charlie5/lace | 20 | 30759 | with impact.d3.Vector; use impact.d3.Vector;
with impact.d3.Transform;
with impact.d3.Matrix,
impact.d3.min_max;
with impact.d3.Transform_Util;
package body impact.d3.Object.rigid
is
use math.Algebra.linear.d3;
function to_ConstructionInfo (mass : in Real;
motionState : access impact.d3.motion_State.Item'Class;
collisionShape : access impact.d3.Shape.Item'Class;
localInertia : in Vector_3)
return ConstructionInfo is
Self : ConstructionInfo;
begin
Self.m_mass := mass;
Self.m_motionState := motionState;
Self.m_collisionShape := collisionShape;
Self.m_localInertia := localInertia;
Self.m_linearDamping := Real (0.0);
Self.m_angularDamping := Real (0.0);
Self.m_friction := Real (0.5);
Self.m_restitution := Real (0.0);
Self.m_linearSleepingThreshold := Real (0.8);
Self.m_angularSleepingThreshold := Real (1.0);
Self.m_additionalDamping := False;
Self.m_additionalDampingFactor := Real (0.005);
Self.m_additionalLinearDampingThresholdSqr := Real (0.01);
Self.m_additionalAngularDampingThresholdSqr := Real (0.01);
Self.m_additionalDampingFactor := Real (0.01);
Self.m_startWorldTransform := impact.d3.Transform.getIdentity;
return Self;
end to_ConstructionInfo;
-- impact.d3.Object.rigidConstructionInfo( impact.d3.Scalar mass, impact.d3.motion_State* motionState, impact.d3.Shape* collisionShape, const impact.d3.Vector& localInertia=impact.d3.Vector(0,0,0)):
-- m_mass(mass),
-- m_motionState(motionState),
-- m_collisionShape(collisionShape),
-- m_localInertia(localInertia),
-- m_linearDamping(impact.d3.Scalar(0.)),
-- m_angularDamping(impact.d3.Scalar(0.)),
-- m_friction(impact.d3.Scalar(0.5)),
-- m_restitution(impact.d3.Scalar(0.)),
-- m_linearSleepingThreshold(impact.d3.Scalar(0.8)),
-- m_angularSleepingThreshold(impact.d3.Scalar(1.f)),
-- m_additionalDamping(false),
-- m_additionalDampingFactor(impact.d3.Scalar(0.005)),
-- m_additionalLinearDampingThresholdSqr(impact.d3.Scalar(0.01)),
-- m_additionalAngularDampingThresholdSqr(impact.d3.Scalar(0.01)),
-- m_additionalAngularDampingFactor(impact.d3.Scalar(0.01))
-- {
-- m_startWorldTransform.setIdentity();
-- }
package body Forge
is
function to_rigid_Object (mass : in math.Real;
motionState : access impact.d3.motion_State.Item'Class;
collisionShape : access impact.d3.Shape.Item'Class;
localInertia : in math.Vector_3 := (0.0, 0.0, 0.0)) return Item
is
Self : Item;
cinfo : constant ConstructionInfo := to_ConstructionInfo (mass, motionState, collisionShape, localInertia);
begin
Self.setupRigidBody (cinfo);
return Self;
end to_rigid_Object;
-- impact.d3.Object.rigidConstructionInfo cinfo(mass,motionState,collisionShape,localInertia);
-- setupRigidBody(cinfo);
end Forge;
----------------
--- Atttributes
--
--- Dynamics
--
function Site (Self : in Item) return Vector_3
is
the_Transform : Transform_3d;
begin
Self.getMotionState.getWorldTransform (the_Transform);
return the_Transform.Translation;
end Site;
procedure Site_is (Self : in out Item; Now : in Vector_3)
is
the_Transform : Transform_3d;
begin
Self.getMotionState.getWorldTransform (the_Transform);
the_Transform.Translation := Now;
Self.getMotionState.setWorldTransform (the_Transform);
Self.getWorldTransform.Translation := Now;
Self.activate (True);
end Site_is;
-- btTransform& trans = getWorldTransform ();
-- btTransform trans2; // = getWorldTransform ();
--
-- getMotionState()->getWorldTransform (trans2);
--
-- trans.setOrigin (btVector3 (Now.x, Now.y, Now.z));
-- trans2.setOrigin (btVector3 (Now.x, Now.y, Now.z));
--
-- // setActivationState (1);
-- activate();
-- getMotionState()->setWorldTransform (trans2);
function Spin (Self : in Item) return math.Matrix_3x3
is
trans : constant Transform_3d := Self.WorldTransform;
begin
return trans.Rotation; -- tbd: check that no transpose is required (check others below also)
end Spin;
-- btTransform& trans = as_btCollisionObject().getWorldTransform ();
-- btMatrix3x3 the_Spin = trans.getBasis();
--
-- btVector3& R1 = the_Spin [0];
-- btVector3& R2 = the_Spin [1];
-- btVector3& R3 = the_Spin [2];
--
-- return c_physics::Matrix_3x3 (R1 [0], R1 [1], R1 [2],
-- R2 [0], R2 [1], R2 [2],
-- R3 [0], R3 [1], R3 [2]);
--
procedure Spin_is (Self : in out Item; Now : in math.Matrix_3x3)
is
trans : Transform_3d := Self.WorldTransform;
begin
trans.Rotation := Now;
Self.setWorldTransform (trans);
-- declare
-- trans2 : Transform_3d := Self.WorldTransform;
-- begin
-- Self.getMotionState.getWorldTransform (trans2);
-- trans2.Rotation := Now;
-- Self.activate;
-- Self.getMotionState.setWorldTransform (trans2);
-- end;
end Spin_is;
function xy_Spin (Self : in Item) return math.Radians
is
begin
raise Program_Error with "TBD";
return 0.0;
end xy_Spin;
procedure xy_Spin_is (Self : in out Item; Now : in math.Radians)
is
begin
raise Program_Error with "TBD";
end xy_Spin_is;
-- for object ...
-- btTransform& trans = as_btCollisionObject().getWorldTransform ();
--
-- trans.setBasis (btMatrix3x3 (Now.m00, Now.m01, Now.m02,
-- Now.m10, Now.m11, Now.m12,
-- Now.m20, Now.m21, Now.m22));
-- for rigid ...
-- btTransform& trans = as_btCollisionObject().getWorldTransform ();
--
-- trans.setBasis (btMatrix3x3 (Now.m00, Now.m01, Now.m02,
-- Now.m10, Now.m11, Now.m12,
-- Now.m20, Now.m21, Now.m22));
--
--
-- btTransform trans2; // = getWorldTransform ();
--
-- getMotionState()->getWorldTransform (trans2);
--
-- trans2.setBasis (btMatrix3x3 (Now.m00, Now.m01, Now.m02,
-- Now.m10, Now.m11, Now.m12,
-- Now.m20, Now.m21, Now.m22));
-- // setActivationState (1);
-- activate();
-- getMotionState()->setWorldTransform (trans2);
function Transform (Self : in Item) return math.Matrix_4x4
is
begin
return to_transform_Matrix (Self.WorldTransform);
end Transform;
-- btTransform& trans = as_btCollisionObject().getWorldTransform ();
-- btScalar gl_Matrix [16];
--
-- trans.getOpenGLMatrix (gl_Matrix);
--
-- return c_physics::Matrix_4x4 (gl_Matrix);
procedure Transform_is (Self : in out Item; Now : in math.Matrix_4x4)
is
the_Transform : constant Transform_3d := to_Transform (Now);
begin
Self.getWorldTransform.all := the_Transform;
Self.getMotionState.setWorldTransform (the_Transform);
end Transform_is;
-- void
-- Rigid::
-- Transform_is (c_physics::Matrix_4x4& Now)
-- {
-- btTransform& trans = getWorldTransform ();
--
-- trans.setFromOpenGLMatrix (&Now.m00);
-- activate();
--
-- getMotionState()->setWorldTransform (trans);
-- }
function Speed (Self : in Item) return math.Vector_3
is
begin
return Self.getLinearVelocity;
end Speed;
-- c_physics::Vector_3
-- Rigid::
-- Speed ()
-- {
-- btVector3 the_Speed = getLinearVelocity ();
--
-- return c_physics::Vector_3 (the_Speed [0], the_Speed [1], the_Speed [2]);
-- }
procedure Speed_is (Self : in out Item; Now : in math.Vector_3)
is
begin
Self.setLinearVelocity (Now);
if Now (1) = 0.0
and then Now (2) = 0.0
and then Now (3) = 0.0
then
Self.setActivationState (0);
else
Self.activate;
end if;
end Speed_is;
function Gyre (Self : in Item) return math.Vector_3
is
begin
return Self.getAngularVelocity;
end Gyre;
procedure Gyre_is (Self : in out Item; Now : in math.Vector_3)
is
begin
Self.setAngularVelocity (Now);
Self.activate;
end Gyre_is;
--- Forces
--
procedure apply_Torque (Self : in out Item; Torque : in math.Vector_3)
is
begin
Self.applyTorque (Torque);
Self.activate;
end apply_Torque;
procedure apply_Torque_impulse (Self : in out Item; Torque : in math.Vector_3)
is
begin
Self.applyTorqueImpulse (Torque);
Self.activate;
end apply_Torque_impulse;
procedure apply_Force (Self : in out Item; Force : in math.Vector_3)
is
begin
Self.applyCentralImpulse (Force);
Self.activate;
end apply_Force;
--- old ...
procedure RigidBody_Assert (Self : in Item) is
use ada.containers;
pragma Assert (Self.m_constraintRefs.Length = 0);
begin
null;
end RigidBody_Assert;
-- virtual ~impact.d3.Object.rigid()
-- {
-- //No constraints should point to this rigidbody
-- //Remove constraints from the dynamics world before you delete the related rigidbodies.
-- btAssert(m_constraintRefs.size()==0);
-- }
function new_rigid_Object (constructionInfo : in rigid.ConstructionInfo) return View
is
Self : constant View := new Item;
begin
setupRigidBody (Self.all, constructionInfo);
return Self;
-- return Self : Item
-- do
-- setupRigidBody (Self, constructionInfo);
--
-- end return;
end new_rigid_Object;
procedure delete (Self : in Item)
is
begin
null;
end delete;
procedure setupRigidBody (Self : in out Item;
constructionInfo : in rigid.ConstructionInfo)
is
begin
impact.d3.Object.define (impact.d3.Object.item (Self));
Self.setInternalType (impact.d3.Object.CO_RIGID_BODY);
Self.m_linearVelocity := (0.0, 0.0, 0.0);
Self.m_angularVelocity := (0.0, 0.0, 0.0);
Self.m_angularFactor := (1.0, 1.0, 1.0);
Self.m_linearFactor := (1.0, 1.0, 1.0);
Self.m_gravity := (0.0, 0.0, 0.0);
Self.m_gravity_acceleration := (0.0, 0.0, 0.0);
Self.m_totalForce := (0.0, 0.0, 0.0);
Self.m_totalTorque := (0.0, 0.0, 0.0);
setDamping (Self, constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
Self.m_linearSleepingThreshold := constructionInfo.m_linearSleepingThreshold;
Self.m_angularSleepingThreshold := constructionInfo.m_angularSleepingThreshold;
Self.m_optionalMotionState := constructionInfo.m_motionState;
Self.m_contactSolverType := 0;
Self.m_frictionSolverType := 0;
Self.m_additionalDamping := constructionInfo.m_additionalDamping;
Self.m_additionalDampingFactor := constructionInfo.m_additionalDampingFactor;
Self.m_additionalLinearDampingThresholdSqr := constructionInfo.m_additionalLinearDampingThresholdSqr;
Self.m_additionalAngularDampingThresholdSqr := constructionInfo.m_additionalAngularDampingThresholdSqr;
Self.m_additionalAngularDampingFactor := constructionInfo.m_additionalAngularDampingFactor;
if Self.m_optionalMotionState /= null then
Self.m_optionalMotionState.getWorldTransform (Self.getWorldTransform.all);
else
Self.getWorldTransform.all := constructionInfo.m_startWorldTransform;
end if;
Self.setInterpolationWorldTransform (Self.getworldTransform.all);
Self.setInterpolationLinearVelocity ((0.0, 0.0, 0.0));
Self.setInterpolationAngularVelocity ((0.0, 0.0, 0.0));
-- moved to impact.d3.Object
Self.setFriction (constructionInfo.m_friction);
Self.setRestitution (constructionInfo.m_restitution);
Self.setCollisionShape (constructionInfo.m_collisionShape);
Self.setMassProps (constructionInfo.m_mass, constructionInfo.m_localInertia);
updateInertiaTensor (Self);
Self.m_rigidbodyFlags := 0;
setZero (Self.m_deltaLinearVelocity);
setZero (Self.m_deltaAngularVelocity);
Self.m_invMass := Self.m_inverseMass * Self.m_linearFactor;
setZero (Self.m_pushVelocity);
setZero (Self.m_turnVelocity);
end setupRigidBody;
-- void impact.d3.Object.rigid::setupRigidBody(const impact.d3.Object.rigid::impact.d3.Object.rigidConstructionInfo& constructionInfo)
-- {
-- m_internalType=CO_RIGID_BODY;
-- m_linearVelocity.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- m_angularVelocity.setValue(impact.d3.Scalar(0.),impact.d3.Scalar(0.),impact.d3.Scalar(0.));
-- m_angularFactor.setValue(1,1,1);
-- m_linearFactor.setValue(1,1,1);
-- m_gravity.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- m_gravity_acceleration.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- m_totalForce.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- m_totalTorque.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0)),
-- setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
-- m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold;
-- m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold;
-- m_optionalMotionState = constructionInfo.m_motionState;
-- m_contactSolverType = 0;
-- m_frictionSolverType = 0;
-- m_additionalDamping = constructionInfo.m_additionalDamping;
-- m_additionalDampingFactor = constructionInfo.m_additionalDampingFactor;
-- m_additionalLinearDampingThresholdSqr = constructionInfo.m_additionalLinearDampingThresholdSqr;
-- m_additionalAngularDampingThresholdSqr = constructionInfo.m_additionalAngularDampingThresholdSqr;
-- m_additionalAngularDampingFactor = constructionInfo.m_additionalAngularDampingFactor;
-- if (m_optionalMotionState)
-- {
-- m_optionalMotionState->getWorldTransform(m_worldTransform);
-- } else
-- {
-- m_worldTransform = constructionInfo.m_startWorldTransform;
-- }
-- m_interpolationWorldTransform = m_worldTransform;
-- m_interpolationLinearVelocity.setValue(0,0,0);
-- m_interpolationAngularVelocity.setValue(0,0,0);
-- //moved to impact.d3.Object
-- m_friction = constructionInfo.m_friction;
-- m_restitution = constructionInfo.m_restitution;
-- setCollisionShape( constructionInfo.m_collisionShape );
-- m_debugBodyId = uniqueId++;
-- setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia);
-- updateInertiaTensor();
-- m_rigidbodyFlags = 0;
-- m_deltaLinearVelocity.setZero();
-- m_deltaAngularVelocity.setZero();
-- m_invMass = m_inverseMass*m_linearFactor;
-- m_pushVelocity.setZero();
-- m_turnVelocity.setZero();
-- }
procedure proceedToTransform (Self : in out Item;
newTrans : in Transform_3d)
is
begin
setCenterOfMassTransform (Self, newTrans);
end proceedToTransform;
-- void impact.d3.Object.rigid::proceedToTransform(const impact.d3.Transform& newTrans)
-- {
-- setCenterOfMassTransform( newTrans );
-- }
procedure predictIntegratedTransform (Self : in out Item;
timeStep : in Real;
predictedTransform : out Transform_3d)
is
begin
impact.d3.transform_Util.integrateTransform (Self.getWorldTransform.all,
Self.m_linearVelocity,
Self.m_angularVelocity,
timeStep,
predictedTransform);
end predictIntegratedTransform;
-- void impact.d3.Object.rigid::predictIntegratedTransform(impact.d3.Scalar timeStep,impact.d3.Transform& predictedTransform)
-- {
-- impact.d3.TransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform);
-- }
procedure saveKinematicState (Self : in out Item;
timeStep : in Real)
is
use impact.d3.motion_State;
begin
if timeStep /= 0.0 then
if Self.getMotionState /= null then
Self.getMotionState.getWorldTransform (Self.getWorldTransform.all);
end if;
impact.d3.transform_Util.calculateVelocity (Self.getInterpolationWorldTransform,
Self.getWorldTransform.all,
timeStep,
Self.m_linearVelocity,
Self.m_angularVelocity);
Self.SetInterpolationLinearVelocity (Self.m_linearVelocity);
Self.SetInterpolationAngularVelocity (Self.m_angularVelocity);
Self.SetInterpolationWorldTransform (Self.getWorldTransform.all);
end if;
end saveKinematicState;
-- void impact.d3.Object.rigid::saveKinematicState(impact.d3.Scalar timeStep)
-- {
-- //todo: clamp to some (user definable) safe minimum timestep, to limit maximum angular/linear velocities
-- if (timeStep != impact.d3.Scalar(0.))
-- {
-- //if we use motionstate to synchronize world transforms, get the new kinematic/animated world transform
-- if (getMotionState())
-- getMotionState()->getWorldTransform(m_worldTransform);
-- impact.d3.Vector linVel,angVel;
-- impact.d3.TransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,timeStep,m_linearVelocity,m_angularVelocity);
-- m_interpolationLinearVelocity = m_linearVelocity;
-- m_interpolationAngularVelocity = m_angularVelocity;
-- m_interpolationWorldTransform = m_worldTransform;
-- //printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
-- }
-- }
procedure applyGravity (Self : in out Item)
is
begin
if isStaticOrKinematicObject (Self) then
null;
else
applyCentralForce (Self, Self.m_gravity);
end if;
end applyGravity;
-- void impact.d3.Object.rigid::applyGravity()
-- {
-- if (isStaticOrKinematicObject())
-- return;
-- applyCentralForce(m_gravity);
-- }
procedure setGravity (Self : in out Item;
acceleration : in Vector_3)
is
begin
if Self.m_inverseMass /= 0.0 then
Self.m_gravity := acceleration * (1.0 / Self.m_inverseMass);
end if;
Self.m_gravity_acceleration := acceleration;
end setGravity;
-- void impact.d3.Object.rigid::setGravity(const impact.d3.Vector& acceleration)
-- {
-- if (m_inverseMass != impact.d3.Scalar(0.0))
-- {
-- m_gravity = acceleration * (impact.d3.Scalar(1.0) / m_inverseMass);
-- }
-- m_gravity_acceleration = acceleration;
-- }
function getGravity (Self : in Item) return Vector_3
is
begin
return Self.m_gravity_acceleration;
end getGravity;
-- const impact.d3.Vector& getGravity() const
-- {
-- return m_gravity_acceleration;
-- }
procedure setDamping (Self : in out Item;
lin_damping : in Real;
ang_damping : in Real)
is
use impact.d3.min_max;
begin
Self.m_linearDamping := btClamped (lin_damping, 0.0, 1.0);
Self.m_angularDamping := btClamped (ang_damping, 0.0, 1.0);
end setDamping;
-- void impact.d3.Object.rigid::setDamping(impact.d3.Scalar lin_damping, impact.d3.Scalar ang_damping)
-- {
-- m_linearDamping = btClamped(lin_damping, (impact.d3.Scalar)impact.d3.Scalar(0.0), (impact.d3.Scalar)impact.d3.Scalar(1.0));
-- m_angularDamping = btClamped(ang_damping, (impact.d3.Scalar)impact.d3.Scalar(0.0), (impact.d3.Scalar)impact.d3.Scalar(1.0));
-- }
function getLinearDamping (Self : in Item) return Real
is
begin
return Self.m_linearDamping;
end getLinearDamping;
-- impact.d3.Scalar getLinearDamping() const
-- {
-- return m_linearDamping;
-- }
function getAngularDamping (Self : in Item) return Real
is
begin
return Self.m_angularDamping;
end getAngularDamping;
-- impact.d3.Scalar getAngularDamping() const
-- {
-- return m_angularDamping;
-- }
function getLinearSleepingThreshold (Self : in Item) return Real
is
begin
return Self.m_linearSleepingThreshold;
end getLinearSleepingThreshold;
-- impact.d3.Scalar getLinearSleepingThreshold() const
-- {
-- return m_linearSleepingThreshold;
-- }
function getAngularSleepingThreshold (Self : in Item) return Real
is
begin
return Self.m_angularSleepingThreshold;
end getAngularSleepingThreshold;
-- impact.d3.Scalar getAngularSleepingThreshold() const
-- {
-- return m_angularSleepingThreshold;
-- }
procedure applyDamping (Self : in out Item;
timeStep : in Real)
is
use math.Functions;
begin
Self.m_linearVelocity := Self.m_linearVelocity * (1.0 - Self.m_linearDamping)**timeStep;
Self.m_angularVelocity := Self.m_angularVelocity * (1.0 - Self.m_angularDamping)**timeStep;
if Self.m_additionalDamping then
if length2 (Self.m_angularVelocity) < Self.m_additionalAngularDampingThresholdSqr
and then length2 (Self.m_linearVelocity) < Self.m_additionalLinearDampingThresholdSqr
then
Self.m_angularVelocity := Self.m_angularVelocity * Self.m_additionalDampingFactor;
Self.m_linearVelocity := Self.m_linearVelocity * Self.m_additionalDampingFactor;
end if;
declare
speed : constant Real := length (Self.m_linearVelocity);
dampVel : constant Real := 0.005;
dir : constant Vector_3 := normalized (Self.m_linearVelocity);
begin
if speed < Self.m_linearDamping then
if speed > dampVel then
Self.m_linearVelocity := Self.m_linearVelocity - dir * dampVel;
else
Self.m_linearVelocity := (0.0, 0.0, 0.0);
end if;
end if;
end;
declare
angSpeed : constant Real := length (Self.m_angularVelocity);
angDampVel : constant Real := 0.005;
dir : constant Vector_3 := normalized (Self.m_angularVelocity);
begin
if angSpeed < Self.m_angularDamping then
if angSpeed > angDampVel then
Self.m_angularVelocity := Self.m_angularVelocity - dir * angDampVel;
else
Self.m_angularVelocity := (0.0, 0.0, 0.0);
end if;
end if;
end;
end if;
end applyDamping;
-- ///applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping
-- void impact.d3.Object.rigid::applyDamping(impact.d3.Scalar timeStep)
-- {
-- //On new damping: see discussion/issue report here: http://code.google.com/p/bullet/issues/detail?id=74
-- //todo: do some performance comparisons (but other parts of the engine are probably bottleneck anyway
-- //#define USE_OLD_DAMPING_METHOD 1
-- #ifdef USE_OLD_DAMPING_METHOD
-- m_linearVelocity *= GEN_clamped((impact.d3.Scalar(1.) - timeStep * m_linearDamping), (impact.d3.Scalar)impact.d3.Scalar(0.0), (impact.d3.Scalar)impact.d3.Scalar(1.0));
-- m_angularVelocity *= GEN_clamped((impact.d3.Scalar(1.) - timeStep * m_angularDamping), (impact.d3.Scalar)impact.d3.Scalar(0.0), (impact.d3.Scalar)impact.d3.Scalar(1.0));
-- #else
-- m_linearVelocity *= btPow(impact.d3.Scalar(1)-m_linearDamping, timeStep);
-- m_angularVelocity *= btPow(impact.d3.Scalar(1)-m_angularDamping, timeStep);
-- #endif
-- if (m_additionalDamping)
-- {
-- //Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
-- //Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
-- if ((m_angularVelocity.length2() < m_additionalAngularDampingThresholdSqr) &&
-- (m_linearVelocity.length2() < m_additionalLinearDampingThresholdSqr))
-- {
-- m_angularVelocity *= m_additionalDampingFactor;
-- m_linearVelocity *= m_additionalDampingFactor;
-- }
-- impact.d3.Scalar speed = m_linearVelocity.length();
-- if (speed < m_linearDamping)
-- {
-- impact.d3.Scalar dampVel = impact.d3.Scalar(0.005);
-- if (speed > dampVel)
-- {
-- impact.d3.Vector dir = m_linearVelocity.normalized();
-- m_linearVelocity -= dir * dampVel;
-- } else
-- {
-- m_linearVelocity.setValue(impact.d3.Scalar(0.),impact.d3.Scalar(0.),impact.d3.Scalar(0.));
-- }
-- }
-- impact.d3.Scalar angSpeed = m_angularVelocity.length();
-- if (angSpeed < m_angularDamping)
-- {
-- impact.d3.Scalar angDampVel = impact.d3.Scalar(0.005);
-- if (angSpeed > angDampVel)
-- {
-- impact.d3.Vector dir = m_angularVelocity.normalized();
-- m_angularVelocity -= dir * angDampVel;
-- } else
-- {
-- m_angularVelocity.setValue(impact.d3.Scalar(0.),impact.d3.Scalar(0.),impact.d3.Scalar(0.));
-- }
-- }
-- }
-- }
-- function getCollisionShape (Self : in Item) return access impact.d3.Shape.item'Class
-- is
-- begin
-- return Self.m_collisionShape;
-- end getCollisionShape;
-- SIMD_FORCE_INLINE const impact.d3.Shape* getCollisionShape() const {
-- return m_collisionShape;
-- }
--
-- SIMD_FORCE_INLINE impact.d3.Shape* getCollisionShape() {
-- return m_collisionShape;
-- }
procedure setMassProps (Self : in out Item;
mass : in Real;
inertia : in Vector_3)
is
begin
if mass = 0.0 then
Self.setCollisionFlags (Self.getCollisionFlags or impact.d3.Object.CF_STATIC_OBJECT);
Self.m_inverseMass := 0.0;
else
Self.setCollisionFlags (Self.getCollisionFlags and (not impact.d3.Object.CF_STATIC_OBJECT));
Self.m_inverseMass := 1.0 / mass;
end if;
Self.m_gravity := mass * Self.m_gravity_acceleration;
declare
A, B, C : Real;
begin
if inertia (1) /= 0.0 then
A := 1.0 / inertia (1);
else
A := 0.0;
end if;
if inertia (2) /= 0.0 then
B := 1.0 / inertia (2);
else
B := 0.0;
end if;
if inertia (3) /= 0.0 then
C := 1.0 / inertia (3);
else
C := 0.0;
end if;
Self.m_invInertiaLocal := (A, B, C);
Self.m_invMass := Self.m_linearFactor * Self.m_inverseMass;
end;
Self.m_invMass := Self.m_linearFactor * Self.m_inverseMass;
end setMassProps;
-- void impact.d3.Object.rigid::setMassProps(impact.d3.Scalar mass, const impact.d3.Vector& inertia)
-- {
-- if (mass == impact.d3.Scalar(0.))
-- {
-- m_collisionFlags |= impact.d3.Object::CF_STATIC_OBJECT;
-- m_inverseMass = impact.d3.Scalar(0.);
-- } else
-- {
-- m_collisionFlags &= (~impact.d3.Object::CF_STATIC_OBJECT);
-- m_inverseMass = impact.d3.Scalar(1.0) / mass;
-- }
-- //Fg = m * a
-- m_gravity = mass * m_gravity_acceleration;
-- m_invInertiaLocal.setValue(inertia.x() != impact.d3.Scalar(0.0) ? impact.d3.Scalar(1.0) / inertia.x(): impact.d3.Scalar(0.0),
-- inertia.y() != impact.d3.Scalar(0.0) ? impact.d3.Scalar(1.0) / inertia.y(): impact.d3.Scalar(0.0),
-- inertia.z() != impact.d3.Scalar(0.0) ? impact.d3.Scalar(1.0) / inertia.z(): impact.d3.Scalar(0.0));
-- m_invMass = m_linearFactor*m_inverseMass;
-- }
function getLinearFactor (Self : in Item) return Vector_3
is
begin
return Self.m_linearFactor;
end getLinearFactor;
-- const impact.d3.Vector& getLinearFactor() const
-- {
-- return m_linearFactor;
-- }
procedure setLinearFactor (Self : in out Item;
linearFactor : in Vector_3)
is
begin
Self.m_linearFactor := linearFactor;
Self.m_invMass := Self.m_linearFactor * Self.m_inverseMass;
end setLinearFactor;
-- void setLinearFactor(const impact.d3.Vector& linearFactor)
-- {
-- m_linearFactor = linearFactor;
-- m_invMass = m_linearFactor*m_inverseMass;
-- }
function getInvMass (Self : in Item) return Real
is
begin
return Self.m_inverseMass;
end getInvMass;
-- impact.d3.Scalar getInvMass() const { return m_inverseMass; }
function getInvInertiaTensorWorld (Self : in Item) return Matrix_3x3
is
begin
return Self.m_invInertiaTensorWorld;
end getInvInertiaTensorWorld;
-- const impact.d3.Matrix& getInvInertiaTensorWorld() const {
-- return m_invInertiaTensorWorld;
-- }
procedure integrateVelocities (Self : in out Item;
step : in Real)
is
MAX_ANGVEL : constant math.Real := math.Pi / 2.0;
angvel : math.Real;
begin
if isStaticOrKinematicObject (Self) then
return;
end if;
Self.m_linearVelocity := Self.m_linearVelocity + Self.m_totalForce * (Self.m_inverseMass * step);
Self.m_angularVelocity := Self.m_angularVelocity + Self.m_invInertiaTensorWorld * (Self.m_totalTorque * step);
-- Clamp angular velocity. collision calculations will fail on higher angular velocities.
--
angvel := Length (Self.m_angularVelocity);
if angvel * step > MAX_ANGVEL then
Self.m_angularVelocity := Self.m_angularVelocity * (MAX_ANGVEL / step) / angvel;
end if;
end integrateVelocities;
procedure setCenterOfMassTransform (Self : in out Item;
xform : Transform_3d)
is
begin
if isStaticOrKinematicObject (Self) then
Self.setInterpolationWorldTransform (Self.getWorldTransform.all);
else
Self.setInterpolationWorldTransform (xform);
end if;
Self.setInterpolationLinearVelocity (Self.getLinearVelocity);
Self.setInterpolationAngularVelocity (Self.getAngularVelocity);
Self.getWorldTransform.all := xform;
updateInertiaTensor (Self);
end setCenterOfMassTransform;
-- void impact.d3.Object.rigid::setCenterOfMassTransform(const impact.d3.Transform& xform)
-- {
-- if (isStaticOrKinematicObject())
-- {
-- m_interpolationWorldTransform = m_worldTransform;
-- } else
-- {
-- m_interpolationWorldTransform = xform;
-- }
-- m_interpolationLinearVelocity = getLinearVelocity();
-- m_interpolationAngularVelocity = getAngularVelocity();
-- m_worldTransform = xform;
-- updateInertiaTensor();
-- }
procedure applyCentralForce (Self : in out Item;
force : in Vector_3)
is
begin
Self.m_totalForce := Self.m_totalForce + Scaled (force, by => Self.m_linearFactor);
end applyCentralForce;
-- void applyCentralForce(const impact.d3.Vector& force)
-- {
-- m_totalForce += force*m_linearFactor;
-- }
function getTotalForce (Self : in Item) return Vector_3
is
begin
return Self.m_totalForce;
end getTotalForce;
-- const impact.d3.Vector& getTotalForce() const
-- {
-- return m_totalForce;
-- };
function getTotalTorque (Self : in Item) return Vector_3
is
begin
return Self.m_totalTorque;
end getTotalTorque;
-- const impact.d3.Vector& getTotalTorque() const
-- {
-- return m_totalTorque;
-- };
function getInvInertiaDiagLocal (Self : in Item) return Vector_3
is
begin
return Self.m_invInertiaLocal;
end getInvInertiaDiagLocal;
-- const impact.d3.Vector& getInvInertiaDiagLocal() const
-- {
-- return m_invInertiaLocal;
-- };
procedure setInvInertiaDiagLocal (Self : in out Item;
diagInvInertia : in Vector_3)
is
begin
Self.m_invInertiaLocal := diagInvInertia;
end setInvInertiaDiagLocal;
-- void setInvInertiaDiagLocal(const impact.d3.Vector& diagInvInertia)
-- {
-- m_invInertiaLocal = diagInvInertia;
-- }
procedure setSleepingThresholds (Self : in out Item;
linear : in Real;
angular : in Real)
is
begin
Self.m_linearSleepingThreshold := linear;
Self.m_angularSleepingThreshold := angular;
end setSleepingThresholds;
-- void setSleepingThresholds(impact.d3.Scalar linear,impact.d3.Scalar angular)
-- {
-- m_linearSleepingThreshold = linear;
-- m_angularSleepingThreshold = angular;
-- }
procedure applyTorque (Self : in out Item;
torque : in Vector_3)
is
begin
Self.m_totalTorque := Scaled (torque, by => Self.m_angularFactor);
end applyTorque;
-- void applyTorque(const impact.d3.Vector& torque)
-- {
-- m_totalTorque += torque*m_angularFactor;
-- }
procedure applyForce (Self : in out Item;
force : in Vector_3;
rel_pos : in Vector_3)
is
begin
applyCentralForce (Self, force);
Self.applyTorque (cross (rel_pos, Scaled (force, by => Self.m_linearFactor)));
end applyForce;
-- void applyForce(const impact.d3.Vector& force, const impact.d3.Vector& rel_pos)
-- {
-- applyCentralForce(force);
-- applyTorque(rel_pos.cross(force*m_linearFactor));
-- }
procedure applyCentralImpulse (Self : in out Item;
impulse : in Vector_3)
is
begin
Self.m_linearVelocity := Self.m_linearVelocity + Scaled (impulse, by => Self.m_linearFactor * Self.m_inverseMass);
end applyCentralImpulse;
-- void applyCentralImpulse(const impact.d3.Vector& impulse)
-- {
-- m_linearVelocity += impulse *m_linearFactor * m_inverseMass;
-- }
procedure applyTorqueImpulse (Self : in out Item;
torque : in Vector_3)
is
begin
Self.m_angularVelocity := Self.m_angularVelocity + Self.m_invInertiaTensorWorld * Scaled (torque, by => Self.m_angularFactor);
end applyTorqueImpulse;
-- void applyTorqueImpulse(const impact.d3.Vector& torque)
-- {
-- m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
-- }
procedure applyImpulse (Self : in out Item;
impulse : in Vector_3;
rel_pos : in Vector_3)
is
use Math.Vectors;
begin
if Self.m_inverseMass /= 0.0 then
applyCentralImpulse (Self, impulse);
if Self.m_angularFactor /= math.Origin_3d then -- tbd: ok ?
Self.applyTorqueImpulse (cross (rel_pos, Scaled (impulse, by => Self.m_linearFactor)));
end if;
end if;
end applyImpulse;
-- void applyImpulse(const impact.d3.Vector& impulse, const impact.d3.Vector& rel_pos)
-- {
-- if (m_inverseMass != impact.d3.Scalar(0.))
-- {
-- applyCentralImpulse(impulse);
-- if (m_angularFactor)
-- {
-- applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
-- }
-- }
-- }
procedure clearForces (Self : in out Item)
is
begin
Self.m_totalForce := (0.0, 0.0, 0.0);
Self.m_totalTorque := (0.0, 0.0, 0.0);
end clearForces;
-- void clearForces()
-- {
-- m_totalForce.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- m_totalTorque.setValue(impact.d3.Scalar(0.0), impact.d3.Scalar(0.0), impact.d3.Scalar(0.0));
-- }
procedure updateInertiaTensor (Self : in out Item)
is
use impact.d3.Matrix, math.Vectors;
begin
Self.m_invInertiaTensorWorld := scaled (Self.getWorldTransform.Rotation, Self.m_invInertiaLocal) * Transpose (Self.GetWorldTransform.Rotation);
-- for row in 1..3 loop
-- for col in 1..3 loop
-- if not Self.m_invInertiaTensorWorld (row, col)'Valid then
-- raise Constraint_Error;
-- end if;
-- end loop;
-- end loop;
end updateInertiaTensor;
-- void impact.d3.Object.rigid::updateInertiaTensor()
-- {
-- m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose();
-- }
function getCenterOfMassPosition (Self : in Item) return Vector_3
is
begin
return Self.WorldTransform.Translation;
end getCenterOfMassPosition;
-- const impact.d3.Vector& getCenterOfMassPosition() const {
-- return m_worldTransform.getOrigin();
-- }
function getOrientation (Self : access Item) return Quaternion
is
use impact.d3.Matrix;
orn : Quaternion;
begin
getRotation (Self.getWorldTransform.Rotation, orn);
return orn;
end getOrientation;
-- impact.d3.Quaternion impact.d3.Object.rigid::getOrientation() const
-- {
-- impact.d3.Quaternion orn;
-- m_worldTransform.getBasis().getRotation(orn);
-- return orn;
-- }
function getCenterOfMassTransform (Self : in Item) return Transform_3d
is
begin
return Self.WorldTransform;
end getCenterOfMassTransform;
-- const impact.d3.Transform& getCenterOfMassTransform() const {
-- return m_worldTransform;
-- }
function getLinearVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_linearVelocity;
end getLinearVelocity;
-- const impact.d3.Vector& getLinearVelocity() const {
-- return m_linearVelocity;
-- }
function getAngularVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_angularVelocity;
end getAngularVelocity;
-- const impact.d3.Vector& getAngularVelocity() const {
-- return m_angularVelocity;
-- }
procedure setLinearVelocity (Self : in out Item;
lin_vel : in Vector_3)
is
begin
Self.m_linearVelocity := lin_vel;
end setLinearVelocity;
-- inline void setLinearVelocity(const impact.d3.Vector& lin_vel)
-- {
-- m_linearVelocity = lin_vel;
-- }
procedure setAngularVelocity (Self : in out Item;
ang_vel : in Vector_3)
is
begin
Self.m_angularVelocity := ang_vel;
end setAngularVelocity;
-- inline void setAngularVelocity(const impact.d3.Vector& ang_vel)
-- {
-- m_angularVelocity = ang_vel;
-- }
function getVelocityInLocalPoint (Self : in Item;
rel_pos : in Vector_3) return Vector_3
is
begin
return Self.m_linearVelocity + cross (Self.m_angularVelocity, rel_pos);
end getVelocityInLocalPoint;
-- impact.d3.Vector getVelocityInLocalPoint(const impact.d3.Vector& rel_pos) const
-- {
-- //we also calculate lin/ang velocity for kinematic objects
-- return m_linearVelocity + m_angularVelocity.cross(rel_pos);
--
-- //for kinematic objects, we could also use use:
-- // return (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
-- }
procedure translate (Self : in out Item;
v : in Vector_3)
is
begin
Self.getWorldTransform.Translation := Self.getWorldTransform.Translation + v;
end translate;
-- void translate(const impact.d3.Vector& v)
-- {
-- m_worldTransform.getOrigin() += v;
-- }
procedure getAabb (Self : in out Item;
aabbMin : out Vector_3;
aabbMax : out Vector_3)
is
begin
Self.getCollisionShape.getAabb (Self.getWorldTransform.all, aabbMin, aabbMax);
end getAabb;
function computeImpulseDenominator (Self : in Item;
pos : in Vector_3;
normal : in Vector_3) return Real
is
r0 : constant Vector_3 := pos - getCenterOfMassPosition (Self);
c0 : constant Vector_3 := cross (r0, normal);
vec : constant Vector_3 := cross (c0 * getInvInertiaTensorWorld (Self), r0);
begin
return Self.m_inverseMass + dot (normal, vec);
end computeImpulseDenominator;
-- SIMD_FORCE_INLINE impact.d3.Scalar computeImpulseDenominator(const impact.d3.Vector& pos, const impact.d3.Vector& normal) const
-- {
-- impact.d3.Vector r0 = pos - getCenterOfMassPosition();
--
-- impact.d3.Vector c0 = (r0).cross(normal);
--
-- impact.d3.Vector vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
--
-- return m_inverseMass + normal.dot(vec);
--
-- }
function computeAngularImpulseDenominator (Self : in Item;
axis : in Vector_3) return Real
is
vec : constant Vector_3 := axis * getInvInertiaTensorWorld (Self);
begin
return dot (axis, vec);
end computeAngularImpulseDenominator;
-- SIMD_FORCE_INLINE impact.d3.Scalar computeAngularImpulseDenominator(const impact.d3.Vector& axis) const
-- {
-- impact.d3.Vector vec = axis * getInvInertiaTensorWorld();
-- return axis.dot(vec);
-- }
procedure UpdateDeactivation (Self : in out Item;
TimeStep : in Real)
is
begin
if Self.getActivationState = impact.d3.Object.ISLAND_SLEEPING
or else Self.getActivationState = impact.d3.Object.DISABLE_DEACTIVATION
then
null;
elsif length2 (Self.getLinearVelocity) < Self.m_linearSleepingThreshold * Self.m_linearSleepingThreshold
and then length2 (Self.getAngularVelocity) < Self.m_angularSleepingThreshold * Self.m_angularSleepingThreshold
then
Self.setDeactivationTime (Self.getDeactivationTime + timeStep);
else
Self.setDeactivationTime (0.0);
Self.setActivationState (0);
end if;
end UpdateDeactivation;
-- SIMD_FORCE_INLINE void updateDeactivation(impact.d3.Scalar timeStep)
-- {
-- if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == DISABLE_DEACTIVATION))
-- return;
--
-- if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) &&
-- (getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold))
-- {
-- m_deactivationTime += timeStep;
-- } else
-- {
-- m_deactivationTime=impact.d3.Scalar(0.);
-- setActivationState(0);
-- }
--
-- }
function wantsSleeping (Self : in Item) return Boolean
is
begin
if getActivationState (Self) = impact.d3.Object.DISABLE_DEACTIVATION then
return False;
end if;
if gDisableDeactivation
or else gDeactivationTime = 0.0
then
return False;
end if;
if getActivationState (Self) = impact.d3.Object.ISLAND_SLEEPING
or else getActivationState (Self) = impact.d3.Object.WANTS_DEACTIVATION
then
return True;
end if;
if Self.getDeactivationTime > gDeactivationTime then
return True;
end if;
return False;
end wantsSleeping;
-- SIMD_FORCE_INLINE bool wantsSleeping()
-- {
--
-- if (getActivationState() == DISABLE_DEACTIVATION)
-- return false;
--
-- //disable deactivation
-- if (gDisableDeactivation || (gDeactivationTime == impact.d3.Scalar(0.)))
-- return false;
--
-- if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION))
-- return true;
--
-- if (m_deactivationTime> gDeactivationTime)
-- {
-- return true;
-- }
-- return false;
-- }
function getBroadphaseProxy (Self : access Item) return access impact.d3.collision.Proxy.item
is
begin
return Self.getBroadphaseHandle;
end getBroadphaseProxy;
-- impact.d3.collision.Proxy* getBroadphaseProxy()
-- {
-- return m_broadphaseHandle;
-- }
procedure setNewBroadphaseProxy (Self : in out Item;
broadphaseProxy : access impact.d3.collision.Proxy.item)
is
begin
Self.setBroadphaseHandle (broadphaseProxy);
end setNewBroadphaseProxy;
-- void setNewBroadphaseProxy(impact.d3.collision.Proxy* broadphaseProxy)
-- {
-- m_broadphaseHandle = broadphaseProxy;
-- }
-- function getMotionState (Self : in Item) return impact.d3.motion_State.Item'Class is
-- begin
-- return Self.m_OptionalMotionState.all;
-- end getMotionState;
function getMotionState (Self : in Item) return access impact.d3.motion_State.Item'Class is
begin
return Self.m_OptionalMotionState;
end getMotionState;
-- impact.d3.motion_State* getMotionState()
-- {
-- return m_optionalMotionState;
-- }
procedure setMotionState (Self : in out Item;
motionState : access impact.d3.motion_State.Item'Class) is
begin
Self.m_optionalMotionState := motionState;
if Self.m_optionalMotionState /= null then
motionState.getWorldTransform (Self.getWorldTransform.all);
end if;
end setMotionState;
-- void setMotionState(impact.d3.motion_State* motionState)
-- {
-- m_optionalMotionState = motionState;
-- if (m_optionalMotionState)
-- motionState->getWorldTransform(m_worldTransform);
-- }
procedure setAngularFactor (Self : in out Item;
angFac : in Vector_3)
is
begin
Self.m_angularFactor := angFac;
end setAngularFactor;
-- void setAngularFactor(const impact.d3.Vector& angFac)
-- {
-- m_angularFactor = angFac;
-- }
procedure setAngularFactor (Self : in out Item;
angFac : in Real)
is
begin
Self.m_angularFactor := (angFac, angFac, angFac);
end setAngularFactor;
-- void setAngularFactor(impact.d3.Scalar angFac)
-- {
-- m_angularFactor.setValue(angFac,angFac,angFac);
-- }
function getAngularFactor (Self : in Item) return Vector_3
is
begin
return Self.m_angularFactor;
end getAngularFactor;
-- const impact.d3.Vector& getAngularFactor() const
-- {
-- return m_angularFactor;
-- }
function isInWorld (Self : access Item) return Boolean
is
use impact.d3.collision.Proxy;
begin
return Self.getBroadphaseProxy /= null;
end isInWorld;
-- //is this rigidbody added to a impact.d3.Space/impact.d3.Space.dynamic/btBroadphase?
-- bool isInWorld() const
-- {
-- return (getBroadphaseProxy() != 0);
-- }
overriding function checkCollideWithOverride (Self : in Item;
co : access impact.d3.Object.item'Class) return Boolean
is
type rigid_Object_view is access all impact.d3.Object.rigid.item'Class;
otherRb : constant access impact.d3.Object.rigid .item'Class := impact.d3.Object.rigid.view (co);
c : access impact.d3.Joint.Item'Class;
begin
if otherRb = null then
return True;
end if;
for i in 1 .. Integer (Self.m_constraintRefs.Length)
loop
c := Self.m_constraintRefs.Element (i);
if c.getRigidBodyA = otherRb
or else c.getRigidBodyB = otherRb
then
return False;
end if;
end loop;
return True;
end checkCollideWithOverride;
-- bool impact.d3.Object.rigid::checkCollideWithOverride(impact.d3.Object* co)
-- {
-- impact.d3.Object.rigid* otherRb = impact.d3.Object.rigid::upcast(co);
-- if (!otherRb)
-- return true;
-- for (int i = 0; i < m_constraintRefs.size(); ++i)
-- {
-- impact.d3.Joint* c = m_constraintRefs[i];
-- if (&c->getRigidBodyA() == otherRb || &c->getRigidBodyB() == otherRb)
-- return false;
-- }
-- return true;
-- }
procedure addConstraintRef (Self : in out Item;
c : access impact.d3.Joint.Item'Class)
is
use impact.d3.Joint.Vectors;
index : constant Integer := Self.m_constraintRefs.find_Index (c.all'Access);
begin
if index = 0 then -- Integer (Self.m_constraintRefs.Length) then
Self.m_constraintRefs.append (c.all'Access);
end if;
Self.setCheckCollideWith (True);
end addConstraintRef;
-- void impact.d3.Object.rigid::addConstraintRef(impact.d3.Joint* c)
-- {
-- int index = m_constraintRefs.findLinearSearch(c);
-- if (index == m_constraintRefs.size())
-- m_constraintRefs.push_back(c);
-- m_checkCollideWith = true;
-- }
procedure removeConstraintRef (Self : in out Item;
c : access impact.d3.Joint.item'Class)
is
use type ada.Containers.Count_Type;
begin
Self.m_constraintRefs.delete (Self.m_constraintRefs.find_Index (c.all'Access));
Self.setCheckCollideWith (Self.m_constraintRefs.Length > 0);
end removeConstraintRef;
function getConstraintRef (Self : in Item;
index : in Integer) return access impact.d3.Joint.Item'Class
is
begin
return Self.m_constraintRefs.Element (index);
end getConstraintRef;
-- impact.d3.Joint* getConstraintRef(int index)
-- {
-- return m_constraintRefs[index];
-- }
function getNumConstraintRefs (Self : in Item) return Ada.Containers.Count_Type
is
begin
return Self.m_constraintRefs.Length;
end getNumConstraintRefs;
-- int getNumConstraintRefs() const
-- {
-- return m_constraintRefs.size();
-- }
procedure setFlags (Self : in out Item;
flags : in d3.Flags)
is
begin
Self.m_rigidbodyFlags := flags;
end setFlags;
-- void setFlags(int flags)
-- {
-- m_rigidbodyFlags = flags;
-- }
function getFlags (Self : in Item) return Flags
is
begin
return Self.m_rigidbodyFlags;
end getFlags;
-- int getFlags() const
-- {
-- return m_rigidbodyFlags;
-- }
function getDeltaLinearVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_deltaLinearVelocity;
end getDeltaLinearVelocity;
-- const impact.d3.Vector& getDeltaLinearVelocity() const
-- {
-- return m_deltaLinearVelocity;
-- }
function getDeltaAngularVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_deltaAngularVelocity;
end getDeltaAngularVelocity;
-- const impact.d3.Vector& getDeltaAngularVelocity() const
-- {
-- return m_deltaAngularVelocity;
-- }
function getPushVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_pushVelocity;
end getPushVelocity;
-- const impact.d3.Vector& getPushVelocity() const
-- {
-- return m_pushVelocity;
-- }
function getTurnVelocity (Self : in Item) return Vector_3
is
begin
return Self.m_turnVelocity;
end getTurnVelocity;
-- const impact.d3.Vector& getTurnVelocity() const
-- {
-- return m_turnVelocity;
-- }
function internalGetDeltaLinearVelocity (Self : access Item) return access Vector_3
is
begin
return Self.m_deltaLinearVelocity'Access;
end internalGetDeltaLinearVelocity;
-- impact.d3.Vector& internalGetDeltaLinearVelocity()
-- {
-- return m_deltaLinearVelocity;
-- }
function internalGetDeltaAngularVelocity (Self : access Item) return access Vector_3
is
begin
return Self.m_deltaAngularVelocity'Access;
end internalGetDeltaAngularVelocity;
-- impact.d3.Vector& internalGetDeltaAngularVelocity()
-- {
-- return m_deltaAngularVelocity;
-- }
function internalGetAngularFactor (Self : in Item) return Vector_3
is
begin
return Self.m_angularFactor;
end internalGetAngularFactor;
-- const impact.d3.Vector& internalGetAngularFactor() const
-- {
-- return m_angularFactor;
-- }
function internalGetInvMass (Self : in Item) return Vector_3
is
begin
return Self.m_invMass;
end internalGetInvMass;
-- const impact.d3.Vector& internalGetInvMass() const
-- {
-- return m_invMass;
-- }
function internalGetPushVelocity (Self : access Item) return access Vector_3
is
begin
return Self.m_pushVelocity'Access;
end internalGetPushVelocity;
-- impact.d3.Vector& internalGetPushVelocity()
-- {
-- return m_pushVelocity;
-- }
function internalGetTurnVelocity (Self : access Item) return access Vector_3
is
begin
return Self.m_turnVelocity'Access;
end internalGetTurnVelocity;
-- impact.d3.Vector& internalGetTurnVelocity()
-- {
-- return m_turnVelocity;
-- }
procedure internalGetVelocityInLocalPointObsolete
(Self : in Item;
rel_pos : in Vector_3;
velocity : out Vector_3)
is
begin
velocity := getLinearVelocity (Self)
+ Self.m_deltaLinearVelocity
+ cross (getAngularVelocity (Self) + Self.m_deltaAngularVelocity,
rel_pos);
end InternalGetVelocityInLocalPointObsolete;
-- SIMD_FORCE_INLINE void internalGetVelocityInLocalPointObsolete(const impact.d3.Vector& rel_pos, impact.d3.Vector& velocity ) const
-- {
-- velocity = getLinearVelocity()+m_deltaLinearVelocity + (getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
-- }
procedure internalGetAngularVelocity (Self : in Item;
angVel : out Vector_3)
is
begin
angVel := getAngularVelocity (Self) + Self.m_deltaAngularVelocity;
end internalGetAngularVelocity;
-- SIMD_FORCE_INLINE void internalGetAngularVelocity(impact.d3.Vector& angVel) const
-- {
-- angVel = getAngularVelocity()+m_deltaAngularVelocity;
-- }
procedure internalApplyImpulse
(Self : in out Item;
linearComponent : in Vector_3;
angularComponent : in Vector_3;
impulseMagnitude : in Real)
is
--- These vector functions are for performance ('ada.numerics.generic_real_arrays' appears slow).
--
function "+" (L, R : in Vector_3) return Vector_3
is
begin
return (L (1) + R (1),
L (2) + R (2),
L (3) + R (3));
end;
function "*" (L : in Vector_3; R : in Real) return Vector_3
is
begin
return (L (1) * R,
L (2) * R,
L (3) * R);
end;
pragma Inline_Always ("+");
pragma Inline_Always ("*");
begin
if Self.m_inverseMass /= 0.0 then
Self.m_deltaLinearVelocity :=
Self.m_deltaLinearVelocity + linearComponent * impulseMagnitude;
-- put_Line ("Self.m_deltaLinearVelocity => " & Image (Self.m_deltaLinearVelocity, 9));
Self.m_deltaAngularVelocity :=
Self.m_deltaAngularVelocity + Scaled (angularComponent, by => (Self.m_angularFactor * impulseMagnitude));
end if;
end InternalApplyImpulse;
-- //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
-- SIMD_FORCE_INLINE void internalApplyImpulse(const impact.d3.Vector& linearComponent, const impact.d3.Vector& angularComponent,const impact.d3.Scalar impulseMagnitude)
-- {
-- if (m_inverseMass)
-- {
-- m_deltaLinearVelocity += linearComponent*impulseMagnitude;
-- m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-- }
-- }
procedure internalApplyPushImpulse
(Self : in out Item;
linearComponent : in Vector_3;
angularComponent : in Vector_3;
impulseMagnitude : in Real)
is
begin
if Self.m_inverseMass /= 0.0 then
Self.m_pushVelocity :=
Self.m_pushVelocity + linearComponent * impulseMagnitude;
Self.m_turnVelocity :=
Self.m_turnVelocity + Scaled (angularComponent, by => (impulseMagnitude * Self.m_angularFactor));
end if;
end InternalApplyPushImpulse;
-- SIMD_FORCE_INLINE void internalApplyPushImpulse(const impact.d3.Vector& linearComponent, const impact.d3.Vector& angularComponent,impact.d3.Scalar impulseMagnitude)
-- {
-- if (m_inverseMass)
-- {
-- m_pushVelocity += linearComponent*impulseMagnitude;
-- m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-- }
-- }
procedure internalWritebackVelocity (Self : in out Item)
is
begin
if Self.m_inverseMass /= 0.0 then
setLinearVelocity (Self, getLinearVelocity (Self) + Self.m_deltaLinearVelocity);
setAngularVelocity (Self, getAngularVelocity (Self) + Self.m_deltaAngularVelocity);
end if;
end internalWritebackVelocity;
-- void internalWritebackVelocity()
-- {
-- if (m_inverseMass)
-- {
-- setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
-- setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
-- //m_deltaLinearVelocity.setZero();
-- //m_deltaAngularVelocity .setZero();
-- //TranslationalBody->setCompanionId(-1);
-- }
-- }
procedure internalWritebackVelocity (Self : in out Item;
timeStep : in Real)
is
use impact.d3.transform_Util;
begin
if Self.m_inverseMass /= 0.0 then
setLinearVelocity (Self, getLinearVelocity (Self) + Self.m_deltaLinearVelocity);
setAngularVelocity (Self, getAngularVelocity (Self) + Self.m_deltaAngularVelocity);
declare
newTransform : Transform_3d;
begin
integrateTransform (Self.getWorldTransform.all,
Self.m_pushVelocity,
Self.m_turnVelocity,
timeStep,
newTransform);
setWorldTransform (Self, newTransform);
end;
end if;
end internalWritebackVelocity;
-- void impact.d3.Object.rigid::internalWritebackVelocity(impact.d3.Scalar timeStep)
-- {
-- (void) timeStep;
-- if (m_inverseMass)
-- {
-- setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
-- setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
-- //correct the position/orientation based on push/turn recovery
-- impact.d3.Transform newTransform;
-- impact.d3.TransformUtil::integrateTransform(getWorldTransform(),m_pushVelocity,m_turnVelocity,timeStep,newTransform);
-- setWorldTransform(newTransform);
-- //TranslationalBody->setCompanionId(-1);
-- }
-- // m_deltaLinearVelocity.setZero();
-- // m_deltaAngularVelocity .setZero();
-- // m_pushVelocity.setZero();
-- // m_turnVelocity.setZero();
-- }
end impact.d3.Object.rigid;
|
src/index.applescript | Hayamiosukei/Discord-C2T | 0 | 128 | on pathExists(thePath)
if thePath starts with "~" then set thePath to POSIX path of (path to home folder) & text 3 thru -1 of (get thePath)
try
POSIX file thePath as alias
return true
on error
return false
end try
end pathExists
display dialog "Do you want to remove the Discord cache?" with icon note buttons {"Cancel", "Continue"} default button "Continue"
set homeFolder to path to home folder as string
set canaryDirectory to homeFolder & "Library:Application Support:discordcanary:Cache"
set stableDirectory to homeFolder & "Library:Application Support:discord:Cache"
set ptbDirectory to homeFolder & "Library:Application Support:discordptb:Cache"
if pathExists("~/Library/Application Support/discordcanary/Cache/") = true then
tell application "Finder"
delete (every item of folder canaryDirectory)
end tell
end if
if pathExists("~/Library/Application Support/discord/Cache/") = true then
tell application "Finder"
delete (every item of folder stableDirectory)
end tell
end if
if pathExists("~/Library/Application Support/discordptb/Cache/") = true then
tell application "Finder"
delete (every item of folder ptbDirectory)
end tell
end if
|
data/pokemon/characteristics.asm | AtmaBuster/pokeplat-gen2-old | 2 | 4614 | CharacteristicStrings:
dw .HP0
dw .HP1
dw .HP2
dw .HP3
dw .HP4
dw .Atk0
dw .Atk1
dw .Atk2
dw .Atk3
dw .Atk4
dw .Def0
dw .Def1
dw .Def2
dw .Def3
dw .Def4
dw .Spd0
dw .Spd1
dw .Spd2
dw .Spd3
dw .Spd4
dw .Spc0
dw .Spc1
dw .Spc2
dw .Spc3
dw .Spc4
.HP0: db "Loves to eat@"
.HP1: db "Often dozes off@"
.HP2: db "Scatters things@"
.HP3: db "Scatters around@"
.HP4: db "Likes to relax@"
.Atk0: db "Proud of its power@"
.Atk1: db "Thrashes about@"
.Atk2: db "Quick tempered@"
.Atk3: db "Likes to fight@"
.Atk4: db "Quick tempered@"
.Def0: db "Sturdy body@"
.Def1: db "Can take some hits@"
.Def2: db "Highly persistent@"
.Def3: db "Good endurance@"
.Def4: db "Good perseverance@"
.Spd0: db "Likes to run@"
.Spd1: db "Alert to sounds@"
.Spd2: db "Carelss and silly@"
.Spd3: db "A bit of a clown@"
.Spd4: db "Quick to flee@"
.Spc0: db "Highly curious@"
.Spc1: db "Mischievous@"
.Spc2: db "Strongly defiant@"
.Spc3: db "Hates to lose@"
.Spc4: db "Very finicky@"
|
OpenRobertaParent/RobotWeDo/src/main/antlr4/de/fhg/iais/roberta/ev3Configuration/generated/Ev3Configuration.g4 | WGraterol64/robertalab | 0 | 4821 | grammar WeDoConfiguration;
conf : 'robot' 'wedo' NAME '{' sizes? sensors? actors? '}'
;
sizes : 'size' '{' 'wheel' 'diameter' RATIONAL 'cm' ';'? 'track' 'width' RATIONAL 'cm' ';'? '}' ';'?
;
sensors : 'sensor' 'port' '{' sdecl* '}' ';'?
;
actors : 'actor' 'port' '{' adecl* '}' ';'?
;
sdecl : SENSORPORT ':' SENSOR ';'?
;
adecl : ACTORPORT ':' actor ';'?
;
actor : MOTORKIND 'motor' ','? motorSpec
;
motorSpec : REGULATION ','? ROTATION (','? LEFTORRIGHT)?
;
SENSORPORT : [1234];
SENSOR : 'color' | 'touch' | 'ultrasonic' | 'infrared' | 'gyro'
;
ACTORPORT : [ABCD];
MOTORKIND : 'large' | 'middle';
ROTATION : 'forward' | 'backward';
LEFTORRIGHT : 'left'| 'right';
REGULATION : 'regulated' | 'unregulated';
NAME : [a-zA-Z][a-zA-Z0-9_-]*;
RATIONAL : '+'?[0-9]+('.'[0-9])?
;
NEWLINE : '\r'? '\n' -> skip;
WS : (' '|'\t')+ -> skip; |
blinker01/entry.asm | kjaleshire/raspberry-pi-rs | 0 | 2087 | .globl _start
_start:
mov sp, #0x8000
bl rust_main
hang:
b hang
.globl dummy
dummy:
// just do some work to waste cycles
push {r4, r5, r6, r7, r8, lr}
mov r4, #0x0
mov r5, #0x1
mov r6, #0x2
mov r7, #0x3
mov r8, #0x4
mov lr, #0x5
pop {r4, r5, r6, r7, r8, pc}
|
src/test/ref/switch-4.asm | jbrandwood/kickc | 2 | 86377 | // Tests simple switch()-statement - switch without default
// Expected output " 1 4 "
// Commodore 64 PRG executable file
.file [name="switch-4.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)
.segment Code
main: {
.label SCREEN = $400
ldx #0
__b1:
// case 1:
cpx #1
beq __b2
// case 4:
// SCREEN[i] = '0'+i;
// break;
cpx #4
bne __b3
__b2:
// '0'+i
txa
clc
adc #'0'
// SCREEN[i] = '0'+i
sta SCREEN,x
__b3:
// for(char i:0..5)
inx
cpx #6
bne __b1
// }
rts
}
|
oeis/222/A222739.asm | neoneye/loda-programs | 11 | 9941 | <reponame>neoneye/loda-programs
; A222739: Partial sums of the first 10^n terms in A181482.
; Submitted by <NAME>
; 76,57256,55722556,55572225556,55557222255556,55555722222555556,55555572222225555556,55555557222222255555556,55555555722222222555555556,55555555572222222225555555556,55555555557222222222255555555556,55555555555722222222222555555555556,55555555555572222222222225555555555556,55555555555557222222222222255555555555556,55555555555555722222222222222555555555555556,55555555555555572222222222222225555555555555556,55555555555555557222222222222222255555555555555556
mov $1,10
pow $1,$0
mul $1,10
mov $0,$1
add $0,4
bin $1,2
div $1,5
add $1,1
mul $1,$0
mov $0,$1
sub $0,140
div $0,108
mul $0,60
add $0,76
|
alloy4fun_models/trashltl/models/7/fa6RcSPX3ubicLo3y.als | Kaixi26/org.alloytools.alloy | 0 | 2662 | <gh_stars>0
open main
pred idfa6RcSPX3ubicLo3y_prop8 {
always (all f:File| some f &f.^link implies eventually f.*link in Trash)
}
pred __repair { idfa6RcSPX3ubicLo3y_prop8 }
check __repair { idfa6RcSPX3ubicLo3y_prop8 <=> prop8o } |
libsrc/cpc/sprites/cpc_PutSpXOR_callee.asm | jpoikela/z88dk | 640 | 83297 | ;
; Amstrad CPC library
;
; ******************************************************
; ** Librería de rutinas para Amstrad CPC **
; ** <NAME>, Artaburu 2009 **
; ******************************************************
;
; void cpc_PutSpXOR(int *sprite, char *alto, char *ancho, int *posicion);
;
; $Id: cpc_PutSpXOR_callee.asm $
;
SECTION code_clib
PUBLIC cpc_PutSpXOR_callee
PUBLIC _cpc_PutSpXOR_callee
EXTERN cpc_PutSp0
EXTERN ancho0
EXTERN suma_siguiente_linea0
EXTERN PutSp0_xormode
.cpc_PutSpXOR_callee
._cpc_PutSpXOR_callee
; dibujar en pantalla el sprite
; Entradas bc-> Alto Ancho
; de-> origen
; hl-> destino
; Se alteran hl, bc, de, af
ld a,$AE ; XOR (HL)
ld (PutSp0_xormode),a
pop hl ; ret addr
pop de
pop bc ; ancho
ld a,c
ld (ancho0+1),a ;actualizo rutina de captura
dec a
cpl
ld (suma_siguiente_linea0+1),a ;comparten los 2 los mismos valores.
pop bc ; alto
ld a,c
ex (sp),hl ; display addr <> ret addr
ex de,hl
jp cpc_PutSp0
|
UNIT_TESTS/test.adb | io7m/coreland-openal-ada | 1 | 14286 | with Ada.Strings.Fixed;
with Ada.Directories;
package body Test is
package Text_IO renames Ada.Text_IO;
package Result_IO is new Ada.Text_IO.Enumeration_IO (Result_t);
package Fixed_Strings renames Ada.Strings.Fixed;
package Strings renames Ada.Strings;
package Directories renames Ada.Directories;
use type UB_Strings.Unbounded_String;
--
-- Check
--
procedure Check
(Test_Context : in Context_t;
Test : in Test_t;
Condition : in Boolean;
Statement : in String := "")
is
Result : Valid_Result_t;
begin
if Condition then
Result := Pass;
else
Result := Fail;
end if;
Satisfy
(Test_Context => Test_Context,
Test => Test,
Result => Result,
Statement => Statement);
end Check;
--
-- Check_Program
--
procedure Check_Program
(Test_Context : in Context_t;
Base : in UB_Strings.Unbounded_String)
is
Want_Program : UB_Strings.Unbounded_String;
Path : UB_Strings.Unbounded_String;
File : Text_IO.File_Type;
begin
UB_Strings.Append (Path, Test_Context.Test_DB);
UB_Strings.Append (Path, Base);
UB_Strings.Append (Path, "/program");
Text_IO.Open
(File => File,
Mode => Text_IO.In_File,
Name => UB_Strings.To_String (Path));
Want_Program := UB_Strings.To_Unbounded_String (Text_IO.Get_Line (File));
if Want_Program /= Test_Context.Program then
raise Program_Error with "program does not match test database";
end if;
end Check_Program;
--
-- Initialize
--
procedure Initialize
(Test_Context : out Context_t;
Program : in String;
Test_DB : in String;
Test_Results : in String) is
begin
Test_Context.Program := UB_Strings.To_Unbounded_String (Program);
Test_Context.Test_DB := UB_Strings.To_Unbounded_String (Test_DB);
Test_Context.Test_Results := UB_Strings.To_Unbounded_String (Test_Results);
Text_IO.Create
(File => Test_Context.Output_File,
Name => Program & ".log_out",
Mode => Text_IO.Out_File);
Text_IO.Create
(File => Test_Context.Error_File,
Name => Program & ".log_error",
Mode => Text_IO.Out_File);
Text_IO.Set_Output (Test_Context.Output_File);
Text_IO.Set_Error (Test_Context.Error_File);
end Initialize;
--
-- Satisfy
--
procedure Satisfy
(Test_Context : in Context_t;
Test : in Test_t;
Result : in Valid_Result_t;
Statement : in String := "")
is
File : Text_IO.File_Type;
Base : UB_Strings.Unbounded_String;
Path : UB_Strings.Unbounded_String;
begin
-- Build path to test entry.
UB_Strings.Set_Unbounded_String (Base, "");
UB_Strings.Append (Base, "/tests/");
UB_Strings.Append (Base, Fixed_Strings.Trim (Test_t'Image (Test), Strings.Left));
-- Check database entry exists.
UB_Strings.Set_Unbounded_String (Path, "");
UB_Strings.Append (Path, Test_Context.Test_DB);
UB_Strings.Append (Path, Base);
if Directories.Exists (UB_Strings.To_String (Path)) = False then
raise Program_Error with
"test " & Fixed_Strings.Trim (Test_t'Image (Test), Strings.Left) & " not defined";
end if;
-- Check the current program is the one that should be satisfying the test.
Check_Program (Test_Context, Base);
-- Build path to state file.
UB_Strings.Set_Unbounded_String (Path, "");
UB_Strings.Append (Path, Test_Context.Test_Results);
UB_Strings.Append (Path, Base);
UB_Strings.Append (Path, "/statement");
-- Yes, Ada has race conditions built in!
Text_IO.Create (File, Name => UB_Strings.To_String (Path));
Text_IO.Put (File, Statement);
Text_IO.New_Line (File);
Text_IO.Close (File);
-- Build path to state file.
UB_Strings.Set_Unbounded_String (Path, "");
UB_Strings.Append (Path, Test_Context.Test_Results);
UB_Strings.Append (Path, Base);
UB_Strings.Append (Path, "/state");
-- Yes, Ada has race conditions built in!
Text_IO.Create (File, Name => UB_Strings.To_String (Path));
Result_IO.Put (File, Result);
Text_IO.New_Line (File);
end Satisfy;
end Test;
|
SLAE_assignments/assignment2/reverse_shell.nasm | RomainLanglois/SLAE_x86 | 0 | 168422 | <reponame>RomainLanglois/SLAE_x86
;ASM (x86) reverse shell for 127.1.1.1 on port 5555
global _start
_start:
;This part initialize the registers and the stack
mov ebp, esp ;Initialize the stack frame
xor eax, eax ;Initialize eax to NULL
xor ebx, ebx ;Initialize ebx to NULL
xor ecx, ecx ;Initialize ecx to NULL
xor edx, edx ;Initialize edx to NULL
;This part push the structure "sockaddr_in" on the stack
;C code representation:
; struct sockaddr_in struct
; addr.sin_family = AF_INET;
; addr.sin_port = htons(5555);
; addr.sin_addr.s_addr = inet_addr("127.1.1.1");
push eax
push eax ;Fill the end of the structure with 2 NULL Bytes
push 0x0101017f ;Initialize the variable "addr.sin_addr.s_addr" to connect to 127.1.1.1
push word 0xb315 ;Initialize the variable "addr.sin_port" to connect on port 5555
push word 0x02 ;Initialize the variable "addr.sin_family" to IPV4 (AF_INET)
;This part initialize and call the "socket" systemcall
mov ax, 0x167 ;Move the "socket" systemcall number inside ax
mov bl, 0x02 ;Move the "AF_INET" value (which means IPV4) inside bl
mov cl, 0x01 ;Move the "SOCK_STREAM" value (which means TCP) inside cl
;C code representation of the systemcall:
; --> s = socket(AF_INET, SOCK_STREAM, 0);
int 0x80 ;Execute the systemcall
mov esi, eax ;Move the return value from the "socket" systemcall into esi
;This part initialize and call the "bind" systemcall
xor eax, eax ;Initialize eax to NULL
mov ax, 0x16a ;Move the "connect" systemcall number inside ax
mov ebx, esi ;Move the return value of "socket" inside ebx
mov ecx, esp ;Point ecx to the structure
;Get the structure size
mov edx, ebp
sub edx, esp ;Use the stack pointers (esp and ebp to calculate the size of the structure)
;C code representation of the systemcall:
; --> connect(s, (struct sockaddr *)&sa, sizeof(sa));
int 0x80 ;Execute systemcall
;This part redirect the STDIN, STDOUT and STDERR into the socket
xor ecx, ecx ;Initialize ecx to NULL
mov cl, 3 ;Initialize cl to 3
boucle:
xor eax, eax ;Initialize eax to NULL
mov al, 0x3f ;Move the "dup2" systemcall number inside al
mov ebx, esi ;Move the return value of "socket" in ebx
dec cl ;Decrement cl to 1
;C code representation of the systemcall:
;for (int i = 0; i < 3; i++)
;{
; dup2(s, i);
;}
int 0x80 ;Execute systemcall
inc cl ;Increment cl to 1
loop boucle ;Loop three times until cl is equal to 0
;This part initialize and call the "execve" systemcall
xor eax, eax ;Initialize eax to NULL
push eax ;Push a NULL Byte on the stack
push 0x68732f2f
push 0x6e69622f ;push "/bin//sh" on the stack
mov ebx, esp ;Initialize ebx to "/bin//sh%00"
xor ecx, ecx ;Initialize ecx to NULL
xor edx, edx ;Initialize edx to NULL
mov al, 0xb ;Move the "execve" systemcall number inside al
;C code representation of the systemcall:
; --> execve("/bin/sh", NULL, NULL);
int 0x80 ;Execute systemcall
|
data/mapHeaders/ViridianNicknameHouse.asm | AmateurPanda92/pokemon-rby-dx | 9 | 10685 | <gh_stars>1-10
ViridianNicknameHouse_h:
db HOUSE ; tileset
db VIRIDIAN_NICKNAME_HOUSE_HEIGHT, VIRIDIAN_NICKNAME_HOUSE_WIDTH ; dimensions (y, x)
dw ViridianNicknameHouse_Blocks ; blocks
dw ViridianNicknameHouse_TextPointers ; texts
dw ViridianNicknameHouse_Script ; scripts
db 0 ; connections
dw ViridianNicknameHouse_Object ; objects
|
src/mods/to/logger.asm | mvdhout1992/ts-patches | 33 | 171346 | <filename>src/mods/to/logger.asm
%include "macros/patch.inc"
%include "macros/datatypes.inc"
%include "TiberianSun.inc"
%include "ini.inc"
@LJMP 0x004082D0, WriteToLog
@LJMP 0x004735C0, WriteToLog
;@LJMP 0x005BE38C, ExtraLogging ;file logging
section .bss
log_data resb 4
log_data2 resb 4
extra_log_data resd 1
extra_log_byte resb 0
section .text
sstring str_a, "a"
sstring str_DTALog, "TO.LOG"
sstring str_OK, "OK?\n"
sstring str_Error, "ERROR!\n"
sstring str_LoadFile, "Loading file %s|"
WriteToLog:
push str_a
push str_DTALog
call 0x006B6A2E ; _fopen
add esp, 8
mov [log_data], eax
test eax, eax
jz .Ret
mov eax, [esp+0]
mov [log_data2], eax
mov eax, [log_data]
mov [esp+0], eax
call 0x006B69C1 ; _fprintf
mov eax, [log_data2]
mov [esp+0], eax
mov eax, [log_data]
push eax
call 0x06B6944 ; _fclose
add esp, 4
.Ret:
retn
ExtraLogging:
mov [esi+14h], eax
cmp dword [extra_log_data], 1
jz ExtraLog_2
push ebx
mov ebx, eax
push eax
push ebx
push str_LoadFile
lea ebx, [extra_log_byte]
push ebx
call 0x006B52EE ; _sprintf
add esp, 0Ch
push extra_log_byte
call 0x004082D0 ; Redirects to WriteToLog
add esp, 4
pop eax
pop ebx
ExtraLog_2:
test eax,eax
jnz ExtraLog_OK
cmp dword [extra_log_data], 1
jnz Skip_Error_Logging
push str_Error
call 0x004082D0 ; Redirects to WriteToLog
add esp, 4
Skip_Error_Logging:
mov eax, [esi]
push edi
push 0
push 0Ch
mov ecx, esi
call dword [eax+40h]
xor eax,eax
jmp Finish
ExtraLog_OK:
cmp dword [extra_log_data], 1
jnz Skip_Writing
push str_OK
call 0x004082D0 ; Redirects to WriteToLog
add esp, 4
Skip_Writing:
mov byte [esi+1Ch], 1
Finish:
pop edi
pop esi
retn 4
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1424.asm | ljhsiun2/medusa | 9 | 4137 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1d69c, %rsi
lea addresses_A_ht+0x104e4, %rdi
clflush (%rdi)
nop
nop
cmp %rbp, %rbp
mov $95, %rcx
rep movsq
nop
nop
and %rax, %rax
lea addresses_A_ht+0x1654a, %rsi
lea addresses_A_ht+0x18afe, %rdi
nop
nop
nop
nop
add %r15, %r15
mov $37, %rcx
rep movsb
nop
nop
and $41167, %rcx
lea addresses_WC_ht+0x18ae4, %rdi
nop
xor $10181, %rax
movb $0x61, (%rdi)
nop
nop
add $22822, %rdi
lea addresses_WT_ht+0x158a4, %rsi
lea addresses_normal_ht+0x7444, %rdi
nop
nop
nop
sub $20634, %r9
mov $46, %rcx
rep movsl
nop
nop
nop
add %r15, %r15
lea addresses_normal_ht+0x1ae9e, %rsi
lea addresses_UC_ht+0x3484, %rdi
nop
dec %r14
mov $111, %rcx
rep movsw
dec %rcx
lea addresses_A_ht+0x7a19, %rbp
nop
nop
cmp %r9, %r9
vmovups (%rbp), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rsi
nop
xor %r14, %r14
lea addresses_normal_ht+0xeca4, %rcx
nop
nop
nop
dec %rax
mov $0x6162636465666768, %rsi
movq %rsi, (%rcx)
sub %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %rbx
push %rdx
push %rsi
// Store
lea addresses_RW+0x14da4, %r13
nop
nop
nop
nop
nop
add $55383, %r14
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r13)
nop
nop
nop
cmp $5119, %r11
// Faulty Load
lea addresses_D+0xa7a4, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
and $21615, %rbx
mov (%rsi), %r13
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rdx
pop %rbx
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
data/mapHeaders/route11gate.asm | adhi-thirumala/EvoYellow | 16 | 20794 | Route11Gate_h:
db GATE ; tileset
db ROUTE_11_GATE_1F_HEIGHT, ROUTE_11_GATE_1F_WIDTH ; dimensions (y, x)
dw Route11GateBlocks, Route11GateTextPointers, Route11GateScript ; blocks, texts, scripts
db $00 ; connections
dw Route11GateObject ; objects
|
src/applescript/menu.applescript | elijahmanor/recording | 2 | 1569 | -- Toggle Autohide of the Menu Bar
tell application "System Preferences" to reveal pane "com.apple.preference.general"
delay 0.1
tell application "System Events" to tell process "System Preferences"
tell checkbox "Automatically hide and show the menu bar" of window "General"
if state = "start" then
if value is 0 then click
else
if value is 1 then click
end if
end tell
end tell
delay 0.1
tell application "System Preferences" to quit
|
programs/oeis/022/A022330.asm | karttu/loda | 0 | 4516 | ; A022330: Index of 3^n within sequence of numbers of form 2^i*3^j.
; 1,3,7,12,19,27,37,49,62,77,93,111,131,152,175,199,225,252,281,312,344,378,413,450,489,529,571,614,659,705,753,803,854,907,961,1017,1075,1134,1195,1257,1321,1386,1453,1522,1592,1664,1737,1812,1889,1967,2047,2128,2211,2296,2382,2470,2559,2650,2742,2836,2932,3029,3128,3228,3330,3434,3539,3646,3754,3864,3975,4088,4203,4319,4437,4556,4677,4800,4924,5050,5177,5306,5436,5568,5702,5837,5974,6112,6252,6394,6537,6682,6828,6976,7125,7276,7429,7583,7739,7896,8055,8216,8378,8542,8707,8874,9043,9213,9385,9558,9733,9909,10087,10267,10448,10631,10815,11001,11189,11378,11569,11761,11955,12150,12347,12546,12746,12948,13151,13356,13563,13771,13981,14192,14405,14619,14835,15053,15272,15493,15715,15939,16165,16392,16621,16851,17083,17316,17551,17788,18026,18266,18507,18750,18995,19241,19489,19738,19989,20242,20496,20752,21009,21268,21528,21790,22054,22319,22586,22854,23124,23396,23669,23944,24220,24498,24777,25058,25341,25625,25911,26198,26487,26778,27070,27364,27659,27956,28254,28554,28856,29159,29464,29770,30078,30388,30699,31012,31326,31642,31959,32278,32599,32921,33245,33570,33897,34226,34556,34888,35221,35556,35893,36231,36571,36912,37255,37599,37945,38293,38642,38993,39345,39699,40055,40412,40771,41131,41493,41856,42221,42588,42956,43326,43697,44070,44445,44821,45199,45578,45959,46341,46725,47111,47498,47887,48277,48669,49063,49458
mov $11,$0
mov $13,$0
add $13,1
lpb $13,1
clr $0,11
mov $0,$11
sub $13,1
sub $0,$13
mov $8,$0
mov $10,$0
add $10,1
lpb $10,1
mov $0,$8
sub $10,1
sub $0,$10
mov $4,$0
mov $6,2
lpb $6,1
mov $0,$4
sub $6,1
add $0,$6
sub $0,1
mul $0,31
div $0,53
mov $1,$0
mov $7,$6
lpb $7,1
mov $5,$1
sub $7,1
lpe
lpe
lpb $4,1
mov $4,0
sub $5,$1
lpe
mov $1,$5
add $1,1
add $9,$1
lpe
add $12,$9
lpe
mov $1,$12
|
src/VMTranslator/fixtures/FunctionCalls/SimpleFunction/SimpleFunction.raw.asm | tuzmusic/HackManager | 1 | 12572 | @SP // ** 1: function SimpleFunction.test 2 **
D=M // store SP value
@LCL
M=D // store stack address in LCL
@SP // >>> push "0" to top of stack
A=M // move to top of stack
M=0
@SP // increment stack pointer
M=M+1
@SP // >>> push "0" to top of stack
A=M // move to top of stack
M=0
@SP // increment stack pointer
M=M+1 -
@LCL // ** 2: push local 0 ** (move to local)
D=M // store the "local" base address
@0 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1 -
@LCL // ** 3: push local 1 ** (move to local)
D=M // store the "local" base address
@1 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location -
@SP // ** 4: add ** (PREPARE Y (pop Y into D) (SP decremented above))
A=M // move to top of stack
D=M // store the top stack value into D
@SP // "pop" X
M=M-1
A=M // PREPARE X (prep X "into" M)
M=M+D // perform binary operation: add -
@SP // ** 5: not ** ("pop" X (SP decremented above))
A=M // PREPARE X (prep X "into" M)
M=!M // perform unary operation: not
@SP // increment stack pointer
M=M+1 -
@ARG // ** 6: push argument 0 ** (move to argument)
D=M // store the "argument" base address
@0 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location -
@SP // ** 7: add ** (PREPARE Y (pop Y into D) (SP decremented above))
A=M // move to top of stack
D=M // store the top stack value into D
@SP // "pop" X
M=M-1
A=M // PREPARE X (prep X "into" M)
M=M+D // perform binary operation: add
@SP // increment stack pointer
M=M+1 -
@ARG // ** 8: push argument 1 ** (move to argument)
D=M // store the "argument" base address
@1 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location -
@SP // ** 9: sub ** (PREPARE Y (pop Y into D) (SP decremented above))
A=M // move to top of stack
D=M // store the top stack value into D
@SP // "pop" X
M=M-1
A=M // PREPARE X (prep X "into" M)
M=M-D // perform binary operation: sub
@SP // increment stack pointer
M=M+1 -
@LCL // ** 10: return ** (>>> store LCL as FRAME)
D=M // store current memory value
@FRAME // go to "FRAME"
M=D // save the stored value in "FRAME"
@5 // >>> save RET
A=D-A // move to location of retAddr (RET=FRAME-5)
D=M // store current memory value
@RET // go to "RET"
M=D // save the stored value in "RET"
@SP // >> pop stack to *ARG <<
M=M-1
A=M // move to top of stack
D=M // store the top stack value into D
@ARG
A=M // move to "ARG"
M=D // write value of D to current location
D=A // >>> restore caller's SP. (in prev step, A=ARG)
@SP
M=D+1 // point SP to ARG+1 (one past returned value)
@LCL // >>> restoring saved "THAT"
A=M-1 // move to LCL-1: saved "THAT"
D=M // store saved "THAT"
@THAT
M=D // restore saved "THAT"
@LCL // >>> restoring saved "THIS"
A=M-1 // move to LCL-2: saved "THIS"
A=A-1
D=M // store saved "THIS"
@THIS
M=D // restore saved "THIS"
@LCL // >>> restoring saved "ARG"
A=M-1 // move to LCL-3: saved "ARG"
A=A-1
A=A-1
D=M // store saved "ARG"
@ARG
M=D // restore saved "ARG"
@LCL // >>> restoring saved "LCL"
A=M-1 // move to LCL-4: saved "LCL"
A=A-1
A=A-1
A=A-1
D=M // store saved "LCL"
@LCL
M=D // restore saved "LCL"
@RET // >>> move to the return address, to restore control to caller
A=M // prepare to jump to address stored in RET |
src/stm32-iwdg.ads | damaki/EVB1000 | 0 | 9976 | -- This spec has been automatically generated from STM32F105xx.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with System;
package STM32.IWDG is
pragma Preelaborate;
---------------
-- Registers --
---------------
-----------------
-- KR_Register --
-----------------
subtype KR_KEY_Field is STM32.Short;
-- Key register (IWDG_KR)
type KR_Register is record
-- Write-only. Key value
KEY : KR_KEY_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for KR_Register use record
KEY at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-----------------
-- PR_Register --
-----------------
subtype PR_PR_Field is STM32.UInt3;
-- Prescaler register (IWDG_PR)
type PR_Register is record
-- Prescaler divider
PR : PR_PR_Field := 16#0#;
-- unspecified
Reserved_3_31 : STM32.UInt29 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PR_Register use record
PR at 0 range 0 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
------------------
-- RLR_Register --
------------------
subtype RLR_RL_Field is STM32.UInt12;
-- Reload register (IWDG_RLR)
type RLR_Register is record
-- Watchdog counter reload value
RL : RLR_RL_Field := 16#FFF#;
-- unspecified
Reserved_12_31 : STM32.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RLR_Register use record
RL at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-----------------
-- SR_Register --
-----------------
subtype SR_PVU_Field is STM32.Bit;
subtype SR_RVU_Field is STM32.Bit;
-- Status register (IWDG_SR)
type SR_Register is record
-- Read-only. Watchdog prescaler value update
PVU : SR_PVU_Field;
-- Read-only. Watchdog counter reload value update
RVU : SR_RVU_Field;
-- unspecified
Reserved_2_31 : STM32.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
PVU at 0 range 0 .. 0;
RVU at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Independent watchdog
type IWDG_Peripheral is record
-- Key register (IWDG_KR)
KR : KR_Register;
-- Prescaler register (IWDG_PR)
PR : PR_Register;
-- Reload register (IWDG_RLR)
RLR : RLR_Register;
-- Status register (IWDG_SR)
SR : SR_Register;
end record
with Volatile;
for IWDG_Peripheral use record
KR at 0 range 0 .. 31;
PR at 4 range 0 .. 31;
RLR at 8 range 0 .. 31;
SR at 12 range 0 .. 31;
end record;
-- Independent watchdog
IWDG_Periph : aliased IWDG_Peripheral
with Import, Address => IWDG_Base;
end STM32.IWDG;
|
oeis/126/A126360.asm | neoneye/loda-programs | 11 | 21812 | ; A126360: Number of base 6 n-digit numbers with adjacent digits differing by one or less.
; Submitted by <NAME>
; 1,6,16,44,122,340,950,2658,7442,20844,58392,163594,458356,1284250,3598338,10082246,28249720,79153804,221783810,621424108,1741191198,4878708658,13669836930,38302030548,107319902744,300703682402,842552990828,2360781013362,6614761398562,18534149563334,51931533044288,145508922088588,407706939658154,1142369459322564,3200848096227206,8968577067282978,25129394521127730,70410998786434780,197287234515072952,552786547179859738,1548873486387785316,4339847069496489098,12159981271642740706
mov $1,1
lpb $0
sub $0,1
add $2,5
add $3,$1
mov $1,$3
sub $1,$4
add $1,$3
add $1,4
sub $2,4
add $4,1
add $2,$4
mov $4,$2
mov $2,$3
add $2,1
lpe
mov $0,$1
|
test/Fail/Issue3032-termination.agda | cruhland/agda | 1,989 | 14915 | <reponame>cruhland/agda
-- Andreas, 2018-04-16, inspired by issue #3032 reported by sattlerc
-- A termination issue without visible recursion.
postulate
A : Set
B : Set
t : B
mutual
data C : (b : B) → Set where
c : (x : C t) → C (foo t bar)
postulate
bar : C t
foo : (b : B) → C b → B
foo y (c x) = y
-- Should not termination check.
-- y is actually "foo t bar" here, a potentially non-terminating recursive call.
|
programs/oeis/102/A102572.asm | jmorken/loda | 1 | 242642 | <reponame>jmorken/loda
; A102572: a(n) = floor(log_4(n)).
; 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
add $0,1
lpb $0,$0
div $0,4
add $2,1
lpe
mov $1,$2
|
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_aaddrcright.asm | Frodevan/z88dk | 640 | 98775 |
; void *zx_aaddrcright(void *attraddr)
SECTION code_clib
SECTION code_arch
PUBLIC zx_aaddrcright
EXTERN asm_zx_aaddrcright
defc zx_aaddrcright = asm_zx_aaddrcright
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _zx_aaddrcright
defc _zx_aaddrcright = zx_aaddrcright
ENDIF
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_237.asm | ljhsiun2/medusa | 9 | 93276 | <filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_237.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xd30d, %rsi
lea addresses_A_ht+0x1945d, %rdi
nop
nop
nop
add %r13, %r13
mov $113, %rcx
rep movsq
nop
nop
nop
dec %rcx
lea addresses_D_ht+0x134fd, %rax
nop
nop
cmp %r12, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%rax)
nop
nop
sub $30791, %rax
lea addresses_WT_ht+0x13e2d, %rcx
nop
nop
sub $8614, %r13
movb (%rcx), %al
nop
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0x1c959, %rsi
lea addresses_normal_ht+0xb941, %rdi
nop
nop
nop
nop
cmp %r10, %r10
mov $62, %rcx
rep movsb
nop
nop
nop
nop
cmp $26498, %r13
lea addresses_D_ht+0x1995d, %rax
nop
nop
nop
sub $10490, %rsi
movl $0x61626364, (%rax)
add $50103, %rdi
lea addresses_WT_ht+0x1c05d, %rsi
add %rax, %rax
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
dec %rcx
lea addresses_UC_ht+0x17c9d, %r12
nop
nop
sub $11906, %rax
movl $0x61626364, (%r12)
nop
nop
dec %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r15
push %rax
push %rsi
// Faulty Load
lea addresses_RW+0x315d, %rax
clflush (%rax)
nop
nop
nop
cmp %r13, %r13
movups (%rax), %xmm3
vpextrq $0, %xmm3, %r14
lea oracles, %r15
and $0xff, %r14
shlq $12, %r14
mov (%r15,%r14,1), %r14
pop %rsi
pop %rax
pop %r15
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_RW', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 6}}
{'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
*/
|
Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_150_2677.asm | ljhsiun2/medusa | 9 | 102633 | <filename>Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_150_2677.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %rbx
push %rcx
// Faulty Load
mov $0x1b0, %rbx
nop
nop
sub %r14, %r14
mov (%rbx), %rcx
lea oracles, %r15
and $0xff, %rcx
shlq $12, %rcx
mov (%r15,%rcx,1), %rcx
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'00': 150}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
src/natools-smaz-original.ads | faelys/natools | 0 | 591 | <reponame>faelys/natools
------------------------------------------------------------------------------
-- Copyright (c) 2016, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Characters.Latin_1;
with Natools.Smaz.Original_Hash;
package Natools.Smaz.Original is
pragma Pure (Natools.Smaz.Original);
LF : constant Character := Ada.Characters.Latin_1.LF;
CR : constant Character := Ada.Characters.Latin_1.CR;
Dictionary : constant Natools.Smaz.Dictionary
:= (Dict_Last => 253,
String_Size => 593,
Variable_Length_Verbatim => True,
Max_Word_Length => 7,
Offsets => (1, 2, 5, 6, 7, 8, 10, 11, 14, 15, 16, 17, 19, 20, 23, 25,
27, 29, 31, 32, 35, 37, 39, 40, 42, 43, 45, 47, 49, 50, 52, 54, 56,
59, 61, 64, 66, 68, 70, 71, 73, 76, 78, 80, 85, 86, 87, 89, 91, 95,
96, 99, 101, 103, 105, 107, 110, 112, 113, 115, 116, 117, 119, 121,
124, 127, 128, 130, 137, 140, 142, 145, 147, 150, 152, 154, 156,
159, 161, 164, 166, 168, 169, 172, 173, 175, 177, 181, 183, 185,
188, 189, 191, 193, 197, 199, 201, 203, 206, 208, 211, 216, 217,
219, 223, 225, 228, 230, 233, 235, 236, 237, 239, 242, 245, 247,
249, 252, 254, 257, 260, 262, 264, 267, 269, 272, 274, 277, 279,
283, 285, 287, 289, 292, 295, 298, 301, 303, 305, 307, 309, 312,
315, 318, 321, 323, 325, 328, 330, 333, 336, 338, 340, 342, 344,
347, 351, 354, 356, 359, 362, 365, 368, 371, 373, 375, 377, 379,
382, 385, 387, 390, 392, 395, 397, 400, 403, 406, 409, 411, 413,
415, 418, 420, 422, 425, 428, 430, 432, 435, 437, 440, 443, 445,
448, 450, 452, 454, 455, 459, 462, 464, 467, 470, 473, 474, 476,
479, 482, 484, 487, 492, 495, 497, 500, 502, 504, 507, 510, 513,
514, 516, 518, 519, 521, 523, 524, 526, 529, 531, 534, 536, 539,
541, 544, 546, 548, 550, 552, 555, 557, 559, 561, 563, 566, 569,
572, 575, 578, 581, 583, 584, 587, 590),
Values => " theetaofoandinse r th tinhethhhe to" & CR & LF & "ls d a"
& "anerc od on ofreof t , isuat n orwhichfmasitthat" & LF & "wa"
& "sen wes an i" & CR & "f gpnd snd ed wedhttp://forteingy The "
& "ctir hisst inarnt, toyng hwithlealto boubewere bseo enthang th"
& "eir""hifrom fin deionmev.veallre rirois cof tareea. her mer p"
& "es bytheydiraicnots, d tat celah neas tioon n tiowe a om, as o"
& "urlillchhadthise tg e" & CR & LF & " where coe oa us dss" & LF
& CR & LF & CR & LF & CR & "="" be es amaonet tor butelsol e ss,n"
& "oter waivhoe a rhats tnsch whtrut/havely ta ha ontha- latien p"
& "e rethereasssi fowaecourwhoitszfors>otun<imth ncate><verad wel"
& "yee nid clacil</rt widive, itwhi magexe cmen.com",
Hash => Natools.Smaz.Original_Hash.Hash'Access);
-- Dictionary built by filtering the S-expression below in the `smaz` tool
-- The S-expression itslef comes for the original `smaz.c`, after removing
-- the commas.
-- ((
-- )" " "the" "e" "t" "a" "of" "o" "and" "i" "n" "s" "e " "r" " th" (
-- )" t" "in" "he" "th" "h" "he " "to" "\r\n" "l" "s " "d" " a" "an" (
-- )"er" "c" " o" "d " "on" " of" "re" "of " "t " ", " "is" "u" "at" (
-- )" " "n " "or" "which" "f" "m" "as" "it" "that" "\n" "was" "en" (
-- )" " " w" "es" " an" " i" "\r" "f " "g" "p" "nd" " s" "nd " "ed " (
-- )"w" "ed" "http://" "for" "te" "ing" "y " "The" " c" "ti" "r " "his" (
-- )"st" " in" "ar" "nt" "," " to" "y" "ng" " h" "with" "le" "al" "to " (
-- )"b" "ou" "be" "were" " b" "se" "o " "ent" "ha" "ng " "their" "\"" (
-- )"hi" "from" " f" "in " "de" "ion" "me" "v" "." "ve" "all" "re " (
-- )"ri" "ro" "is " "co" "f t" "are" "ea" ". " "her" " m" "er " " p" (
-- )"es " "by" "they" "di" "ra" "ic" "not" "s, " "d t" "at " "ce" "la" (
-- )"h " "ne" "as " "tio" "on " "n t" "io" "we" " a " "om" ", a" "s o" (
-- )"ur" "li" "ll" "ch" "had" "this" "e t" "g " "e\r\n" " wh" "ere" (
-- )" co" "e o" "a " "us" " d" "ss" "\n\r\n" "\r\n\r" "=\"" " be" " e" (
-- )"s a" "ma" "one" "t t" "or " "but" "el" "so" "l " "e s" "s," "no" (
-- )"ter" " wa" "iv" "ho" "e a" " r" "hat" "s t" "ns" "ch " "wh" "tr" (
-- )"ut" "/" "have" "ly " "ta" " ha" " on" "tha" "-" " l" "ati" "en " (
-- )"pe" " re" "there" "ass" "si" " fo" "wa" "ec" "our" "who" "its" "z" (
-- )"fo" "rs" ">" "ot" "un" "<" "im" "th " "nc" "ate" "><" "ver" "ad" (
-- )" we" "ly" "ee" " n" "id" " cl" "ac" "il" "</" "rt" " wi" "div" (
-- )"e, " " it" "whi" " ma" "ge" "x" "e c" "men" ".com")
end Natools.Smaz.Original;
|
Src/session_logger.adb | SMerrony/dashera | 23 | 11765 | <gh_stars>10-100
-- Copyright ©2021,2022 <NAME>
-- 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.
with Logging; use Logging;
package body Session_Logger is
function Start_Logging (Filename : in String) return Boolean is
begin
Create (Log_File, Out_File, Filename);
Logging := True;
return True;
exception
when others =>
Log (WARNING, "Could not open file for logging - " & Filename);
return False;
end Start_Logging;
procedure Stop_Logging is
begin
Logging := False;
Close (Log_File);
end Stop_Logging;
procedure Log_Char (Char : in Character) is
begin
Put (Log_File, Char);
end Log_Char;
end Session_Logger;
|
ThirdParty/webrtc/src/third_party/libvpx/source/libvpx/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm | JokeJoe8806/licode-windows | 8 | 179795 | <filename>ThirdParty/webrtc/src/third_party/libvpx/source/libvpx/vp9/common/arm/neon/vp9_reconintra_neon_asm.asm
;
; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp9_v_predictor_4x4_neon|
EXPORT |vp9_v_predictor_8x8_neon|
EXPORT |vp9_v_predictor_16x16_neon|
EXPORT |vp9_v_predictor_32x32_neon|
EXPORT |vp9_h_predictor_4x4_neon|
EXPORT |vp9_h_predictor_8x8_neon|
EXPORT |vp9_h_predictor_16x16_neon|
EXPORT |vp9_h_predictor_32x32_neon|
EXPORT |vp9_tm_predictor_4x4_neon|
EXPORT |vp9_tm_predictor_8x8_neon|
EXPORT |vp9_tm_predictor_16x16_neon|
EXPORT |vp9_tm_predictor_32x32_neon|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
;void vp9_v_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_v_predictor_4x4_neon| PROC
vld1.32 {d0[0]}, [r2]
vst1.32 {d0[0]}, [r0], r1
vst1.32 {d0[0]}, [r0], r1
vst1.32 {d0[0]}, [r0], r1
vst1.32 {d0[0]}, [r0], r1
bx lr
ENDP ; |vp9_v_predictor_4x4_neon|
;void vp9_v_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_v_predictor_8x8_neon| PROC
vld1.8 {d0}, [r2]
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
vst1.8 {d0}, [r0], r1
bx lr
ENDP ; |vp9_v_predictor_8x8_neon|
;void vp9_v_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_v_predictor_16x16_neon| PROC
vld1.8 {q0}, [r2]
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
vst1.8 {q0}, [r0], r1
bx lr
ENDP ; |vp9_v_predictor_16x16_neon|
;void vp9_v_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_v_predictor_32x32_neon| PROC
vld1.8 {q0, q1}, [r2]
mov r2, #2
loop_v
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
vst1.8 {q0, q1}, [r0], r1
subs r2, r2, #1
bgt loop_v
bx lr
ENDP ; |vp9_v_predictor_32x32_neon|
;void vp9_h_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_h_predictor_4x4_neon| PROC
vld1.32 {d1[0]}, [r3]
vdup.8 d0, d1[0]
vst1.32 {d0[0]}, [r0], r1
vdup.8 d0, d1[1]
vst1.32 {d0[0]}, [r0], r1
vdup.8 d0, d1[2]
vst1.32 {d0[0]}, [r0], r1
vdup.8 d0, d1[3]
vst1.32 {d0[0]}, [r0], r1
bx lr
ENDP ; |vp9_h_predictor_4x4_neon|
;void vp9_h_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_h_predictor_8x8_neon| PROC
vld1.64 {d1}, [r3]
vdup.8 d0, d1[0]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[1]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[2]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[3]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[4]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[5]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[6]
vst1.64 {d0}, [r0], r1
vdup.8 d0, d1[7]
vst1.64 {d0}, [r0], r1
bx lr
ENDP ; |vp9_h_predictor_8x8_neon|
;void vp9_h_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_h_predictor_16x16_neon| PROC
vld1.8 {q1}, [r3]
vdup.8 q0, d2[0]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[1]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[2]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[3]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[4]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[5]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[6]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[7]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[0]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[1]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[2]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[3]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[4]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[5]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[6]
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[7]
vst1.8 {q0}, [r0], r1
bx lr
ENDP ; |vp9_h_predictor_16x16_neon|
;void vp9_h_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_h_predictor_32x32_neon| PROC
sub r1, r1, #16
mov r2, #2
loop_h
vld1.8 {q1}, [r3]!
vdup.8 q0, d2[0]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[1]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[2]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[3]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[4]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[5]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[6]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d2[7]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[0]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[1]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[2]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[3]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[4]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[5]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[6]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
vdup.8 q0, d3[7]
vst1.8 {q0}, [r0]!
vst1.8 {q0}, [r0], r1
subs r2, r2, #1
bgt loop_h
bx lr
ENDP ; |vp9_h_predictor_32x32_neon|
;void vp9_tm_predictor_4x4_neon (uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_tm_predictor_4x4_neon| PROC
; Load ytop_left = above[-1];
sub r12, r2, #1
vld1.u8 {d0[]}, [r12]
; Load above 4 pixels
vld1.32 {d2[0]}, [r2]
; Compute above - ytop_left
vsubl.u8 q3, d2, d0
; Load left row by row and compute left + (above - ytop_left)
; 1st row and 2nd row
vld1.u8 {d2[]}, [r3]!
vld1.u8 {d4[]}, [r3]!
vmovl.u8 q1, d2
vmovl.u8 q2, d4
vadd.s16 q1, q1, q3
vadd.s16 q2, q2, q3
vqmovun.s16 d0, q1
vqmovun.s16 d1, q2
vst1.32 {d0[0]}, [r0], r1
vst1.32 {d1[0]}, [r0], r1
; 3rd row and 4th row
vld1.u8 {d2[]}, [r3]!
vld1.u8 {d4[]}, [r3]
vmovl.u8 q1, d2
vmovl.u8 q2, d4
vadd.s16 q1, q1, q3
vadd.s16 q2, q2, q3
vqmovun.s16 d0, q1
vqmovun.s16 d1, q2
vst1.32 {d0[0]}, [r0], r1
vst1.32 {d1[0]}, [r0], r1
bx lr
ENDP ; |vp9_tm_predictor_4x4_neon|
;void vp9_tm_predictor_8x8_neon (uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_tm_predictor_8x8_neon| PROC
; Load ytop_left = above[-1];
sub r12, r2, #1
vld1.8 {d0[]}, [r12]
; preload 8 left
vld1.8 {d30}, [r3]
; Load above 8 pixels
vld1.64 {d2}, [r2]
vmovl.u8 q10, d30
; Compute above - ytop_left
vsubl.u8 q3, d2, d0
; Load left row by row and compute left + (above - ytop_left)
; 1st row and 2nd row
vdup.16 q0, d20[0]
vdup.16 q1, d20[1]
vadd.s16 q0, q3, q0
vadd.s16 q1, q3, q1
; 3rd row and 4th row
vdup.16 q8, d20[2]
vdup.16 q9, d20[3]
vadd.s16 q8, q3, q8
vadd.s16 q9, q3, q9
vqmovun.s16 d0, q0
vqmovun.s16 d1, q1
vqmovun.s16 d2, q8
vqmovun.s16 d3, q9
vst1.64 {d0}, [r0], r1
vst1.64 {d1}, [r0], r1
vst1.64 {d2}, [r0], r1
vst1.64 {d3}, [r0], r1
; 5th row and 6th row
vdup.16 q0, d21[0]
vdup.16 q1, d21[1]
vadd.s16 q0, q3, q0
vadd.s16 q1, q3, q1
; 7th row and 8th row
vdup.16 q8, d21[2]
vdup.16 q9, d21[3]
vadd.s16 q8, q3, q8
vadd.s16 q9, q3, q9
vqmovun.s16 d0, q0
vqmovun.s16 d1, q1
vqmovun.s16 d2, q8
vqmovun.s16 d3, q9
vst1.64 {d0}, [r0], r1
vst1.64 {d1}, [r0], r1
vst1.64 {d2}, [r0], r1
vst1.64 {d3}, [r0], r1
bx lr
ENDP ; |vp9_tm_predictor_8x8_neon|
;void vp9_tm_predictor_16x16_neon (uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_tm_predictor_16x16_neon| PROC
; Load ytop_left = above[-1];
sub r12, r2, #1
vld1.8 {d0[]}, [r12]
; Load above 8 pixels
vld1.8 {q1}, [r2]
; preload 8 left into r12
vld1.8 {d18}, [r3]!
; Compute above - ytop_left
vsubl.u8 q2, d2, d0
vsubl.u8 q3, d3, d0
vmovl.u8 q10, d18
; Load left row by row and compute left + (above - ytop_left)
; Process 8 rows in each single loop and loop 2 times to process 16 rows.
mov r2, #2
loop_16x16_neon
; Process two rows.
vdup.16 q0, d20[0]
vdup.16 q8, d20[1]
vadd.s16 q1, q0, q2
vadd.s16 q0, q0, q3
vadd.s16 q11, q8, q2
vadd.s16 q8, q8, q3
vqmovun.s16 d2, q1
vqmovun.s16 d3, q0
vqmovun.s16 d22, q11
vqmovun.s16 d23, q8
vdup.16 q0, d20[2] ; proload next 2 rows data
vdup.16 q8, d20[3]
vst1.64 {d2,d3}, [r0], r1
vst1.64 {d22,d23}, [r0], r1
; Process two rows.
vadd.s16 q1, q0, q2
vadd.s16 q0, q0, q3
vadd.s16 q11, q8, q2
vadd.s16 q8, q8, q3
vqmovun.s16 d2, q1
vqmovun.s16 d3, q0
vqmovun.s16 d22, q11
vqmovun.s16 d23, q8
vdup.16 q0, d21[0] ; proload next 2 rows data
vdup.16 q8, d21[1]
vst1.64 {d2,d3}, [r0], r1
vst1.64 {d22,d23}, [r0], r1
vadd.s16 q1, q0, q2
vadd.s16 q0, q0, q3
vadd.s16 q11, q8, q2
vadd.s16 q8, q8, q3
vqmovun.s16 d2, q1
vqmovun.s16 d3, q0
vqmovun.s16 d22, q11
vqmovun.s16 d23, q8
vdup.16 q0, d21[2] ; proload next 2 rows data
vdup.16 q8, d21[3]
vst1.64 {d2,d3}, [r0], r1
vst1.64 {d22,d23}, [r0], r1
vadd.s16 q1, q0, q2
vadd.s16 q0, q0, q3
vadd.s16 q11, q8, q2
vadd.s16 q8, q8, q3
vqmovun.s16 d2, q1
vqmovun.s16 d3, q0
vqmovun.s16 d22, q11
vqmovun.s16 d23, q8
vld1.8 {d18}, [r3]! ; preload 8 left into r12
vmovl.u8 q10, d18
vst1.64 {d2,d3}, [r0], r1
vst1.64 {d22,d23}, [r0], r1
subs r2, r2, #1
bgt loop_16x16_neon
bx lr
ENDP ; |vp9_tm_predictor_16x16_neon|
;void vp9_tm_predictor_32x32_neon (uint8_t *dst, ptrdiff_t y_stride,
; const uint8_t *above,
; const uint8_t *left)
; r0 uint8_t *dst
; r1 ptrdiff_t y_stride
; r2 const uint8_t *above
; r3 const uint8_t *left
|vp9_tm_predictor_32x32_neon| PROC
; Load ytop_left = above[-1];
sub r12, r2, #1
vld1.8 {d0[]}, [r12]
; Load above 32 pixels
vld1.8 {q1}, [r2]!
vld1.8 {q2}, [r2]
; preload 8 left pixels
vld1.8 {d26}, [r3]!
; Compute above - ytop_left
vsubl.u8 q8, d2, d0
vsubl.u8 q9, d3, d0
vsubl.u8 q10, d4, d0
vsubl.u8 q11, d5, d0
vmovl.u8 q3, d26
; Load left row by row and compute left + (above - ytop_left)
; Process 8 rows in each single loop and loop 4 times to process 32 rows.
mov r2, #4
loop_32x32_neon
; Process two rows.
vdup.16 q0, d6[0]
vdup.16 q2, d6[1]
vadd.s16 q12, q0, q8
vadd.s16 q13, q0, q9
vadd.s16 q14, q0, q10
vadd.s16 q15, q0, q11
vqmovun.s16 d0, q12
vqmovun.s16 d1, q13
vadd.s16 q12, q2, q8
vadd.s16 q13, q2, q9
vqmovun.s16 d2, q14
vqmovun.s16 d3, q15
vadd.s16 q14, q2, q10
vadd.s16 q15, q2, q11
vst1.64 {d0-d3}, [r0], r1
vqmovun.s16 d24, q12
vqmovun.s16 d25, q13
vqmovun.s16 d26, q14
vqmovun.s16 d27, q15
vdup.16 q1, d6[2]
vdup.16 q2, d6[3]
vst1.64 {d24-d27}, [r0], r1
; Process two rows.
vadd.s16 q12, q1, q8
vadd.s16 q13, q1, q9
vadd.s16 q14, q1, q10
vadd.s16 q15, q1, q11
vqmovun.s16 d0, q12
vqmovun.s16 d1, q13
vadd.s16 q12, q2, q8
vadd.s16 q13, q2, q9
vqmovun.s16 d2, q14
vqmovun.s16 d3, q15
vadd.s16 q14, q2, q10
vadd.s16 q15, q2, q11
vst1.64 {d0-d3}, [r0], r1
vqmovun.s16 d24, q12
vqmovun.s16 d25, q13
vqmovun.s16 d26, q14
vqmovun.s16 d27, q15
vdup.16 q0, d7[0]
vdup.16 q2, d7[1]
vst1.64 {d24-d27}, [r0], r1
; Process two rows.
vadd.s16 q12, q0, q8
vadd.s16 q13, q0, q9
vadd.s16 q14, q0, q10
vadd.s16 q15, q0, q11
vqmovun.s16 d0, q12
vqmovun.s16 d1, q13
vadd.s16 q12, q2, q8
vadd.s16 q13, q2, q9
vqmovun.s16 d2, q14
vqmovun.s16 d3, q15
vadd.s16 q14, q2, q10
vadd.s16 q15, q2, q11
vst1.64 {d0-d3}, [r0], r1
vqmovun.s16 d24, q12
vqmovun.s16 d25, q13
vqmovun.s16 d26, q14
vqmovun.s16 d27, q15
vdup.16 q0, d7[2]
vdup.16 q2, d7[3]
vst1.64 {d24-d27}, [r0], r1
; Process two rows.
vadd.s16 q12, q0, q8
vadd.s16 q13, q0, q9
vadd.s16 q14, q0, q10
vadd.s16 q15, q0, q11
vqmovun.s16 d0, q12
vqmovun.s16 d1, q13
vadd.s16 q12, q2, q8
vadd.s16 q13, q2, q9
vqmovun.s16 d2, q14
vqmovun.s16 d3, q15
vadd.s16 q14, q2, q10
vadd.s16 q15, q2, q11
vst1.64 {d0-d3}, [r0], r1
vqmovun.s16 d24, q12
vqmovun.s16 d25, q13
vld1.8 {d0}, [r3]! ; preload 8 left pixels
vqmovun.s16 d26, q14
vqmovun.s16 d27, q15
vmovl.u8 q3, d0
vst1.64 {d24-d27}, [r0], r1
subs r2, r2, #1
bgt loop_32x32_neon
bx lr
ENDP ; |vp9_tm_predictor_32x32_neon|
END
|
libsrc/_DEVELOPMENT/math/float/math48/lm/z80/asm_fabs.asm | jpoikela/z88dk | 640 | 89047 |
SECTION code_clib
SECTION code_fp_math48
PUBLIC asm_fabs
EXTERN am48_fabs
defc asm_fabs = am48_fabs
|
programs/oeis/050/A050441.asm | jmorken/loda | 1 | 98244 | ; A050441: Partial sums of A051865.
; 0,1,14,50,120,235,406,644,960,1365,1870,2486,3224,4095,5110,6280,7616,9129,10830,12730,14840,17171,19734,22540,25600,28925,32526,36414,40600,45095,49910,55056,60544,66385,72590,79170,86136,93499,101270,109460,118080,127141,136654,146630,157080,168015,179446,191384,203840,216825,230350,244426,259064,274275,290070,306460,323456,341069,359310,378190,397720,417911,438774,460320,482560,505505,529166,553554,578680,604555,631190,658596,686784,715765,745550,776150,807576,839839,872950,906920,941760,977481,1014094,1051610,1090040,1129395,1169686,1210924,1253120,1296285,1340430,1385566,1431704,1478855,1527030,1576240,1626496,1677809,1730190,1783650,1838200,1893851,1950614,2008500,2067520,2127685,2189006,2251494,2315160,2380015,2446070,2513336,2581824,2651545,2722510,2794730,2868216,2942979,3019030,3096380,3175040,3255021,3336334,3418990,3503000,3588375,3675126,3763264,3852800,3943745,4036110,4129906,4225144,4321835,4419990,4519620,4620736,4723349,4827470,4933110,5040280,5148991,5259254,5371080,5484480,5599465,5716046,5834234,5954040,6075475,6198550,6323276,6449664,6577725,6707470,6838910,6972056,7106919,7243510,7381840,7521920,7663761,7807374,7952770,8099960,8248955,8399766,8552404,8706880,8863205,9021390,9181446,9343384,9507215,9672950,9840600,10010176,10181689,10355150,10530570,10707960,10887331,11068694,11252060,11437440,11624845,11814286,12005774,12199320,12394935,12592630,12792416,12994304,13198305,13404430,13612690,13823096,14035659,14250390,14467300,14686400,14907701,15131214,15356950,15584920,15815135,16047606,16282344,16519360,16758665,17000270,17244186,17490424,17738995,17989910,18243180,18498816,18756829,19017230,19280030,19545240,19812871,20082934,20355440,20630400,20907825,21187726,21470114,21755000,22042395,22332310,22624756,22919744,23217285,23517390,23820070,24125336,24433199,24743670,25056760,25372480,25690841,26011854,26335530,26661880,26990915,27322646,27657084,27994240,28334125
lpb $0
sub $0,1
add $2,1
add $1,$2
add $3,11
add $2,$3
lpe
|
source/RStudioRun/RStudioRun.applescript | uribo/popclip-extentions | 1 | 1704 | <filename>source/RStudioRun/RStudioRun.applescript
tell application "RStudio"
activate
tell application "System Events"
keystroke "c" using command down
key code 19 using control down
keystroke "v" using command down
key code 36
end tell
end tell
|
gnoga_bar_codes_test.adb | jrcarter/Gnoga_Bar_Codes | 0 | 30899 | -- Test program for Gnoga_Bar_Codes
--
-- Copyright (C) 2018 by PragmAda Software Engineering
--
-- Released under the terms of the 3-Clause BSD License. See https://opensource.org/licenses/BSD-3-Clause
with Bar_Codes;
with Gnoga.Application.Singleton;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Common;
with Gnoga.Gui.Element.Form;
with Gnoga.Gui.Window;
with Gnoga_Bar_Codes;
with Gnoga_Extra;
procedure Gnoga_Bar_Codes_Test is
Window : Gnoga.Gui.Window.Window_Type;
View : Gnoga.Gui.Element.Form.Form_Type;
Code_1D : Gnoga_Bar_Codes.Bar_Code;
Code_2D : Gnoga_Bar_Codes.Bar_Code;
Input : Gnoga_Extra.Text_Info;
Gen : Gnoga.Gui.Element.Common.Button_Type;
Quit : Gnoga.Gui.Element.Common.Button_Type;
procedure Generate (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
-- Empty
begin -- Generate
Code_2D.Generate (Kind => Bar_Codes.Code_QR_Low, Text => Input.Box.Value);
Code_1D.Generate (Kind => Bar_Codes.Code_128, Text => Input.Box.Value);
exception -- Generate
when Bar_Codes.Cannot_Encode =>
Code_1D.Generate (Kind => Bar_Codes.Code_128, Text => "");
end Generate;
procedure Quit_Now (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
-- Empty;
begin -- Quit_Now
Gnoga.Application.Singleton.End_Application;
end Quit_Now;
Box_1D : constant Bar_Codes.Module_Box := Bar_Codes.Fitting (Kind => Bar_Codes.Code_128, Text => (1 .. 50 => 'a') );
Box_2D : constant Bar_Codes.Module_Box := Bar_Codes.Fitting (Kind => Bar_Codes.Code_QR_Low, Text => (1 .. 50 => 'a') );
Code_Width : constant Positive := 2 * Box_1D.Width;
Code_Height : constant Positive := Code_Width / 4;
begin -- Gnoga_Bar_Codes_Test
Gnoga.Application.Title ("Gnoga Bar-Codes Test");
Gnoga.Application.HTML_On_Close ("Gnoga Bar-Codes Test ended.");
Gnoga.Application.Open_URL;
Gnoga.Application.Singleton.Initialize (Main_Window => Window);
View.Create (Parent => Window);
View.Text_Alignment (Value => Gnoga.Gui.Element.Center);
View.New_Line;
Code_1D.Create (Parent => View, Width => Code_Width, Height => Code_Height);
View.New_Line;
Code_2D.Create (Parent => View, Width => 8 * Box_2D.Width, Height => 8 * Box_2D.Width);
View.New_Line;
Input.Create (Form => View, Label => "Text :", Width => 20);
Gen.Create (Parent => View, Content => "Generate");
Gen.On_Click_Handler (Handler => Generate'Unrestricted_Access);
View.On_Submit_Handler (Handler => Generate'Unrestricted_Access);
View.New_Line;
Quit.Create (Parent => View, Content => "Quit");
Quit.On_Click_Handler (Handler => Quit_Now'Unrestricted_Access);
Gnoga.Application.Singleton.Message_Loop;
end Gnoga_Bar_Codes_Test;
|
clock-2-0.asm | politechnik/pic-clock | 0 | 1616 | <gh_stars>0
;***************************************************************************;
; Digital clock listing, v 2.0 ;
; Author: <NAME> ;
;***************************************************************************;
; MCU Ports connecting: ;
;***************************************************************************;
; PORTA,0 2nd pin hour decads common ;
; PORTA,1 3rd pin hour units common ;
; PORTA,2 4th pin minute decads common ;
; PORTA,3 5th pin minute units common ;
; PORTA,4 6th pin low second point ;
; PORTA,5 7th pin high second point ;
; PORTC,0 11th pin non connected ;
; PORTC,1 12th pin non connected ;
; PORTC,2 13th pin non connected ;
; PORTC,3 14th pin minute setting button, active low ;
; PORTC,4 15th pin non connected ;
; PORTC,5 16th pin non connected ;
; PORTC,6 17th pin non connected ;
; PORTC,7 18th pin non connected ;
; PORTB,0 21th pin hour setting button, active low ;
; PORTB,1 22rd pin c segments ;
; PORTB,2 23th pin d segments ;
; PORTB,3 24th pin a segments ;
; PORTB,4 25th pin b segments ;
; PORTB,5 26th pin f segments ;
; PORTB,6 27th pin e segments ;
; PORTB,7 28th pin g segments ;
;***************************************************************************;
list p=pic16f873
include <pic16f873.inc>
__config _CP_ALL &_DEBUG_OFF &_CPD_OFF &_LVP_OFF &_BODEN_ON &_PWRTE_ON &_WDT_OFF &_HS_OSC
cblock 21h
HOUR10
HOUR
MIN10
MIN
SEC10
SEC
FLAGS
DEBOUNCE
MODE
OLD_MODE
; list of modes:
; MODE=xx000000 - normal, <HH_MM>
; MODE=xx000010 - edit hour decads counter, <_H:MM>
; MODE=xx000100 - edit hour units counter, <H_:MM>
; MODE=xx001000 - edit minute decads counter, <HH:_M>
; MODE=xx010000 - edit minute units counter, <HH:M_>
; MODE=xx100000 - show seconds, <MM:SS>
; *note: '_' means blinking
COUNTER
BLINKING_DIV
POINTER
AKKU
endc
constant _KEY_DEBOUNCE = D'10'; &*RTC
constant _ACCURACY = 0x3E
#define SHIFT STATUS,RP0 ; bank select bit
#define M_F FLAGS,0 ; mode key flag
#define S_F FLAGS,1 ; set key flag
#define CHANGE FLAGS,2 ; counters changing flag
#define PT_F FLAGS,3 ;
#define PT_L PORTA,4 ; low second point
#define PT_H PORTA,5 ; high second point
#define M_BTN PORTB,0 ; mode button press bit
#define S_BTN PORTC,3 ; set button press bit
org 0x000
BSF SHIFT ; bank 1
MOVLW B'11000000'
MOVWF OPTION_REG
MOVLW B'00000000'
MOVWF TRISA
MOVLW B'00000001'
MOVWF TRISB
MOVLW B'00001000'
MOVWF TRISC
CLRF PIE1
CLRF PIE2
MOVLW D'7'
MOVWF ADCON1
BCF SHIFT ; bank 0
CLRF STATUS
CLRF PORTA
CLRF PORTB
CLRF PORTC
CLRF INTCON
CLRF PIR1
CLRF PIR2
MOVLW B'00000001'
MOVWF T1CON
CLRF CCP1CON
CLRF CCP2CON
CLRF ADCON0
CLRF TMR1H
CLRF TMR1L
;
CLRF HOUR10
CLRF HOUR
CLRF MIN10
CLRF MIN
CLRF SEC10
CLRF SEC
CLRF FLAGS
CLRF DEBOUNCE
CLRF MODE
MOVLW B'00000001'
MOVWF OLD_MODE
CLRF COUNTER
CLRF BLINKING_DIV
CLRF POINTER
;
;======================== MAIN PROGRAM LOOP ========================
;
LOOP MOVLW 0xF6 ;RTC=2,5msec
ADDWF TMR1H,F
MOVLW _ACCURACY
ADDWF TMR1L,F
MOVLW B'00110000' ;mask of digit commons
ANDWF PORTA,F
CALL POINT ;set common
CALL DECODE
MOVWF PORTB ;set symbol
;
INCF POINTER,F
MOVLW D'4'
XORWF POINTER,W
BTFSC STATUS,Z
CLRF POINTER
;
INCF COUNTER,F
MOVLW D'200'
XORWF COUNTER,W
BTFSS STATUS,Z
GOTO MODE_5_CHECK
CLRF COUNTER
;
BCF PT_L
BCF PT_H
BTFSS PT_F
GOTO $+.4
BCF PT_F
CALL INCR
GOTO MODE_5_CHECK
;
BSF PT_F
BTFSC MODE,5 ; in MM:SS mode dots blinking are disabled
GOTO MODE_5_CHECK
BSF PT_L
BSF PT_H
;
MODE_5_CHECK
BTFSS MODE,5
GOTO MODE_0_CHECK
;
MOVF OLD_MODE,W
XORWF MODE,W
BTFSC STATUS,Z
GOTO BUTTONS
;
CLRF BLINKING_DIV
BSF SHIFT ; bank 1
CLRF TRISA
BCF SHIFT ; bank 0
;
MOVF MODE,W
MOVWF OLD_MODE
GOTO BUTTONS
;
MODE_0_CHECK
MOVF MODE,F
BTFSS STATUS,Z
GOTO MODE_BLINKING
;
MOVF OLD_MODE,W
XORWF MODE,W
BTFSC STATUS,Z
GOTO BUTTONS
;
CLRF BLINKING_DIV
MOVF HOUR10,F ;check to useless null
BTFSS STATUS,Z
GOTO $+.6
BSF SHIFT ; bank 1
MOVLW B'00000001'
MOVWF TRISA
BCF SHIFT ; bank 0
GOTO $+.4
BSF SHIFT ; bank 1
CLRF TRISA
BCF SHIFT ; bank 0
;
MOVF MODE,W
MOVWF OLD_MODE
;
GOTO BUTTONS
;
MODE_BLINKING
MOVF OLD_MODE,W
XORWF MODE,W
BTFSC STATUS,Z
GOTO $+.6
CLRF BLINKING_DIV
BSF SHIFT ; bank 1
CLRF TRISA
BCF SHIFT ; bank 0
GOTO $+.7
;
INCF BLINKING_DIV,F
MOVLW D'50'
XORWF BLINKING_DIV,W
BTFSS STATUS,Z
GOTO BUTTONS
CLRF BLINKING_DIV
;
RRF MODE,W
MOVWF AKKU
BSF SHIFT ; bank 1
COMF TRISA,W
BCF SHIFT ; bank 0
ANDWF AKKU,W
;
BSF SHIFT ; bank 1
MOVWF TRISA
BCF SHIFT ; bank 0
;
MOVF MODE,W
MOVWF OLD_MODE
BUTTONS
;
BTFSC M_F
GOTO M_PRESS
;
BTFSC S_F
GOTO S_PRESS
;
NEXT_M BTFSC M_BTN ;mode button press check
GOTO $+.3
BSF M_F
GOTO M_PRESS
;
NEXT_S BTFSC S_BTN ;setting button press check
GOTO $+.3
BSF S_F
GOTO S_PRESS
;
MAIN BTFSS PIR1,TMR1IF
GOTO $-1
BCF PIR1,TMR1IF
GOTO LOOP
;
;====================== END MAIN PROGRAM LOOP ======================
;
DECODE ADDWF PCL,1 ;digit symbols table
RETLW B'10000000' ;0
RETLW B'11101100' ;1
RETLW B'00100010' ;2
RETLW B'01100000' ;3
RETLW B'01001100' ;4
RETLW B'01010000' ;5
RETLW B'00010000' ;6
RETLW B'11100100' ;7
RETLW B'00000000' ;8
RETLW B'01000000' ;9
;
POINT BTFSC MODE,5
GOTO MM_SS
;
MOVF POINTER,W
ADDWF PCL,1
;
goto $+.4
goto $+.6
goto $+.8
goto $+.10
;
BSF PORTA,0
MOVF HOUR10,0
RETURN
;
BSF PORTA,1
MOVF HOUR,0
RETURN
;
BSF PORTA,2
MOVF MIN10,0
RETURN
;
BSF PORTA,3
MOVF MIN,0
RETURN
;
MM_SS BCF PT_L
BCF PT_H
MOVF POINTER,W
ADDWF PCL,1
;
goto $+.4
goto $+.6
goto $+.8
goto $+.10
;
BSF PORTA,0
MOVF MIN10,0
RETURN
;
BSF PORTA,1
MOVF MIN,0
RETURN
;
BSF PORTA,2
MOVF SEC10,0
RETURN
;
BSF PORTA,3
MOVF SEC,0
RETURN
;
M_PRESS MOVLW _KEY_DEBOUNCE
SUBWF DEBOUNCE,W
BTFSC STATUS,C ;
GOTO $+.3
;
INCF DEBOUNCE,F
GOTO MAIN
;
BTFSS M_BTN
GOTO $+.4
;
BCF M_F
CLRF DEBOUNCE
GOTO NEXT_S
;
BTFSS STATUS,Z
GOTO $+.3
;
CALL M_EVENT
INCF DEBOUNCE,F
GOTO MAIN
;
M_EVENT MOVF MODE,F
BTFSS STATUS,Z
GOTO $+.3
BSF MODE,1
RETURN
;
MOVLW B'00010000'
SUBWF MODE,W
BTFSC STATUS,C ;
GOTO $+.3
RLF MODE,F
RETURN
;
BTFSC MODE,5
GOTO $+.3
CLRF MODE
RETURN
;
MOVLW D'3'
SUBWF SEC10,W
BTFSC STATUS,C ;@@
CALL INC_M
CLRF SEC10
CLRF SEC
CLRF COUNTER
RETURN
;
S_PRESS MOVLW _KEY_DEBOUNCE
SUBWF DEBOUNCE,W
BTFSC STATUS,C ;
GOTO $+.3
;
INCF DEBOUNCE,F
GOTO MAIN
;
BTFSS S_BTN
GOTO $+.4
;
BCF S_F
CLRF DEBOUNCE
GOTO NEXT_S
;
BTFSS STATUS,Z
GOTO $+.3
;
CALL S_EVENT
INCF DEBOUNCE,F
GOTO MAIN
;
S_EVENT MOVF MODE,F
BTFSS STATUS,Z
GOTO $+.3
BSF MODE,5
RETURN
;
BTFSS MODE,1
GOTO $+.5
;
BSF CHANGE
CALL INC_H10
BCF CHANGE
RETURN
;
BTFSS MODE,2
GOTO $+.5
;
BSF CHANGE
CALL INC_H
BCF CHANGE
RETURN
;
BTFSS MODE,3
GOTO $+.5
;
BSF CHANGE
CALL INC_M10
BCF CHANGE
RETURN
;
BTFSS MODE,4
GOTO $+.5
;
BSF CHANGE
CALL INC_M
BCF CHANGE
RETURN
;
CLRF MODE
RETURN
;
INCR MOVLW D'9' ;increment second units counter
SUBWF SEC,W
BTFSC STATUS,C
GOTO $+.3
INCF SEC,F
RETURN
CLRF SEC
;
MOVLW D'5' ;increment second decads counter
SUBWF SEC10,W
BTFSC STATUS,C
GOTO $+.3
INCF SEC10,F
RETURN
CLRF SEC10
;
INC_M MOVLW D'9' ;increment minute units counter
SUBWF MIN,W
BTFSC STATUS,C
GOTO $+.3
INCF MIN,F
RETURN
CLRF MIN
;
BTFSS MODE,4
GOTO $+.3
BTFSC CHANGE
RETURN
;
INC_M10 MOVLW D'5' ;increment minute decads counter
SUBWF MIN10,W
BTFSC STATUS,C
GOTO $+.3
INCF MIN10,F
RETURN
CLRF MIN10
;
BTFSS MODE,3
GOTO $+.3
BTFSC CHANGE
RETURN
;
INC_H MOVLW D'2' ;if HOUR10=2, max HOUR=3
SUBWF HOUR10,W
BTFSS STATUS,C
GOTO $+.3
MOVLW D'3'
GOTO $+.2
;
MOVLW D'9' ;increment hour units counter
SUBWF HOUR,W
BTFSC STATUS,C
GOTO $+.3
INCF HOUR,F
RETURN
CLRF HOUR
;
BTFSS MODE,2
GOTO $+.3
BTFSC CHANGE
RETURN
;
INC_H10 MOVLW D'2' ;increment hour decads counter
SUBWF HOUR10,W
BTFSC STATUS,C
GOTO $+.6
INCF HOUR10,F
BSF SHIFT ; bank 1
BCF TRISA,0
BCF SHIFT ; bank 0
RETURN
;
CLRF HOUR10
BSF SHIFT ; bank 1
BSF TRISA,0
BCF SHIFT ; bank 0
RETURN
;
END
|
test/Test.agda | flupe/agda2hs | 0 | 11839 | module _ where
open import Haskell.Prelude
open import Agda.Builtin.Equality
-- ** Foreign HS code
-- language extensions
{-# FOREIGN AGDA2HS
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE FlexibleInstances #-}
#-}
-- imports
{-# FOREIGN AGDA2HS
import Data.Monoid
#-}
-- ** Datatypes & functions
data Exp (v : Set) : Set where
Plus : Exp v → Exp v → Exp v
Lit : Nat → Exp v
Var : v → Exp v
{-# COMPILE AGDA2HS Exp deriving (Show,Eq) #-}
eval : (a → Nat) → Exp a → Nat
eval env (Plus a b) = eval env a + eval env b
eval env (Lit n) = n
eval env (Var x) = env x
{-# COMPILE AGDA2HS eval #-}
-- ** Natural numbers
listSum : List Int → Int
listSum [] = 0
listSum (x ∷ xs) = x + sum xs
{-# COMPILE AGDA2HS listSum #-}
monoSum : List Integer → Integer
monoSum xs = sum xs
{-# COMPILE AGDA2HS monoSum #-}
polySum : ⦃ iNum : Num a ⦄ → List a → a
polySum xs = sum xs
{-# COMPILE AGDA2HS polySum #-}
{-# FOREIGN AGDA2HS
-- comment
-- another comment
bla :: Int -> Int
bla n = n * 4
{- multi
line
comment
-}
#-}
-- ** Extra builtins
ex_float : Double
ex_float = 0.0
{-# COMPILE AGDA2HS ex_float #-}
postulate
toInteger : Word → Integer
ex_word : Word
ex_word = fromInteger 0
{-# COMPILE AGDA2HS ex_word #-}
ex_char : Char
ex_char = 'a'
{-# COMPILE AGDA2HS ex_char #-}
char_d : Char
char_d = toEnum 100
{-# COMPILE AGDA2HS char_d #-}
-- ** Polymorphic functions
_+++_ : List a → List a → List a
[] +++ ys = ys
(x ∷ xs) +++ ys = x ∷ (xs +++ ys)
{-# COMPILE AGDA2HS _+++_ #-}
listMap : (a → b) → List a → List b
listMap f [] = []
listMap f (x ∷ xs) = f x ∷ listMap f xs
{-# COMPILE AGDA2HS listMap #-}
mapTest : List Nat → List Nat
mapTest = map (id ∘ _+_ 5)
{-# COMPILE AGDA2HS mapTest #-}
-- ** Lambdas
plus3 : List Nat → List Nat
plus3 = map (λ n → n + 3)
{-# COMPILE AGDA2HS plus3 #-}
doubleLambda : Nat → Nat → Nat
doubleLambda = λ a b → a + 2 * b
{-# COMPILE AGDA2HS doubleLambda #-}
cnst : a → b → a
cnst = λ x _ → x
{-# COMPILE AGDA2HS cnst #-}
-- ** Constraints
second : (b → c) → a × b → a × c
second f (x , y) = x , f y
{-# COMPILE AGDA2HS second #-}
doubleTake : (n m : Int) → ⦃ IsNonNegativeInt n ⦄ → ⦃ IsNonNegativeInt m ⦄ → List a → List a × List a
doubleTake n m = second (take m) ∘ splitAt n
{-# COMPILE AGDA2HS doubleTake #-}
initLast : (xs : List a) → ⦃ NonEmpty xs ⦄ → List a × a
initLast xs = init xs , last xs
{-# COMPILE AGDA2HS initLast #-}
-- ** Proofs
assoc : (a b c : Nat) → a + (b + c) ≡ (a + b) + c
assoc zero b c = refl
assoc (suc a) b c rewrite assoc a b c = refl
thm : (xs ys : List Nat) → sum (xs ++ ys) ≡ sum xs + sum ys
thm [] ys = refl
thm (x ∷ xs) ys rewrite thm xs ys | assoc x (sum xs) (sum ys) = refl
-- (custom) Monoid class
record MonoidX (a : Set) : Set where
field memptyX : a
mappendX : a → a → a
open MonoidX {{...}} public
{-# COMPILE AGDA2HS MonoidX #-}
instance
MonoidNat : MonoidX Nat
memptyX {{MonoidNat}} = 0
mappendX {{MonoidNat}} i j = i + j
{-# COMPILE AGDA2HS MonoidNat #-}
instance
MonoidFunNat : {a : Set} → MonoidX (a → Nat)
memptyX {{MonoidFunNat}} _ = memptyX
mappendX {{MonoidFunNat}} f g x = mappendX (f x) (g x)
{-# COMPILE AGDA2HS MonoidFunNat #-}
instance
MonoidFun : {a b : Set} → {{MonoidX b}} → MonoidX (a → b)
memptyX {{MonoidFun}} _ = memptyX
mappendX {{MonoidFun}} f g x = mappendX (f x) (g x)
{-# COMPILE AGDA2HS MonoidFun #-}
sumMonX : ∀{a} → {{MonoidX a}} → List a → a
sumMonX [] = memptyX
sumMonX (x ∷ xs) = mappendX x (sumMonX xs)
{-# COMPILE AGDA2HS sumMonX #-}
sumMon : ∀{a} → {{Monoid a}} → List a → a
sumMon [] = mempty
sumMon (x ∷ xs) = x <> sumMon xs
{-# COMPILE AGDA2HS sumMon #-}
-- Using the Monoid class from the Prelude
data NatSum : Set where
MkSum : Nat → NatSum
{-# COMPILE AGDA2HS NatSum #-}
instance
SemigroupNatSum : Semigroup NatSum
SemigroupNatSum ._<>_ (MkSum a) (MkSum b) = MkSum (a + b)
MonoidNatSum : Monoid NatSum
MonoidNatSum .mempty = MkSum 0
double : ⦃ Monoid a ⦄ → a → a
double x = x <> x
doubleSum : NatSum → NatSum
doubleSum = double
{-# COMPILE AGDA2HS SemigroupNatSum #-}
{-# COMPILE AGDA2HS MonoidNatSum #-}
{-# COMPILE AGDA2HS double #-}
{-# COMPILE AGDA2HS doubleSum #-}
-- Instance argument proof obligation that should not turn into a class constraint
hd : (xs : List a) → ⦃ NonEmpty xs ⦄ → a
hd [] = error "hd: empty list"
hd (x ∷ _) = x
{-# COMPILE AGDA2HS hd #-}
five : Int
five = hd (5 ∷ 3 ∷ [])
{-# COMPILE AGDA2HS five #-}
-- ** Booleans
ex_bool : Bool
ex_bool = true
{-# COMPILE AGDA2HS ex_bool #-}
ex_if : Nat
ex_if = if true then 1 else 0
{-# COMPILE AGDA2HS ex_if #-}
if_over : Nat
if_over = (if true then (λ x → x) else (λ x → x + 1)) 0
{-# COMPILE AGDA2HS if_over #-}
if_partial₁ : List Nat → List Nat
if_partial₁ = map (if true then 1 else_)
{-# COMPILE AGDA2HS if_partial₁ #-}
if_partial₂ : List Nat → List (Nat → Nat)
if_partial₂ = map (if true then_else_)
{-# COMPILE AGDA2HS if_partial₂ #-}
if_partial₃ : List Bool → List (Nat → Nat → Nat)
if_partial₃ = map if_then_else_
{-# COMPILE AGDA2HS if_partial₃ #-}
if_partial₄ : List Bool → List (Nat → Nat)
if_partial₄ = map (if_then 1 else_)
{-# COMPILE AGDA2HS if_partial₄ #-}
if_partial₅ : Bool → Nat → List Nat → List Nat
if_partial₅ b f = map (if b then f else_)
{-# COMPILE AGDA2HS if_partial₅ #-}
|
programs/oeis/139/A139756.asm | karttu/loda | 1 | 95873 | <filename>programs/oeis/139/A139756.asm
; A139756: Binomial transform of A004526.
; 0,0,1,4,12,32,80,192,448,1024,2304,5120,11264,24576,53248,114688,245760,524288,1114112,2359296,4980736,10485760,22020096,46137344,96468992,201326592,419430400,872415232,1811939328,3758096384,7784628224,16106127360,33285996544,68719476736,141733920768,292057776128,601295421440,1236950581248,2542620639232,5222680231936,10720238370816,21990232555520,45079976738816,92358976733184,189115999977472,387028092977152,791648371998720,1618481116086272,3307330976350208,6755399441055744
sub $0,1
mov $1,2
pow $1,$0
mul $1,$0
div $1,2
|
04/Mult.asm | sin9yt/nand2tetris | 0 | 20258 | <reponame>sin9yt/nand2tetris
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by <NAME> Schocken, MIT Press.
// File name: projects/04/Mult.asm
// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)
(BEGIN)
@R2
M = 0 // Initialize R2 to 0
(LOOP)
@R1
D = M - 1
@NULL
D; JLT
@R0
D = M
@R2
D = D + M
M = D
@R1
M = M - 1
D = M
@LOOP
D; JGE
(NULL)
@R0
M = 0 |
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_139.asm | ljhsiun2/medusa | 9 | 89073 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x13a55, %r9
nop
nop
xor %rax, %rax
movw $0x6162, (%r9)
sub %rcx, %rcx
lea addresses_WC_ht+0x14555, %rsi
lea addresses_A_ht+0x11e55, %rdi
nop
nop
and $15730, %r9
mov $91, %rcx
rep movsl
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0xf655, %rsi
lea addresses_D_ht+0x1e05d, %rdi
nop
nop
nop
nop
nop
cmp $42418, %r13
mov $71, %rcx
rep movsl
nop
add $6363, %rsi
lea addresses_UC_ht+0x1ab55, %r13
nop
xor %r11, %r11
movl $0x61626364, (%r13)
nop
add $65294, %r9
lea addresses_WT_ht+0x120ac, %rax
clflush (%rax)
nop
nop
cmp $10673, %rdi
mov $0x6162636465666768, %r11
movq %r11, %xmm3
vmovups %ymm3, (%rax)
nop
nop
nop
add $49282, %r9
lea addresses_normal_ht+0x13575, %r11
nop
nop
sub $22375, %rdi
movw $0x6162, (%r11)
nop
xor %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r8
push %r9
push %rdi
// Load
lea addresses_PSE+0xabf5, %r8
nop
nop
sub $1059, %r12
mov (%r8), %r9d
nop
nop
nop
inc %r14
// Load
mov $0x18d, %r9
nop
nop
nop
sub %r14, %r14
mov (%r9), %r13
nop
nop
nop
nop
nop
xor %r12, %r12
// Faulty Load
lea addresses_D+0xea55, %rdi
inc %r11
mov (%rdi), %r12
lea oracles, %r11
and $0xff, %r12
shlq $12, %r12
mov (%r11,%r12,1), %r12
pop %rdi
pop %r9
pop %r8
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 5}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
dump-commented.asm | orrinjelo/synacor_challenge | 0 | 169482 | <filename>dump-commented.asm
0x0 noop
0x1 noop
0x2 out W
0x4 out e
0x6 out l
0x8 out c
0xa out o
0xc out m
0xe out e
0x10 out
0x12 out t
0x14 out o
0x16 out
0x18 out t
0x1a out h
0x1c out e
0x1e out
0x20 out S
0x22 out y
0x24 out n
0x26 out a
0x28 out c
0x2a out o
0x2c out r
0x2e out
0x30 out C
0x32 out h
0x34 out a
0x36 out l
0x38 out l
0x3a out e
0x3c out n
0x3e out g
0x40 out e
0x42 out !
0x44 out \n
0x46 out P
0x48 out l
0x4a out e
0x4c out a
0x4e out s
0x50 out e
0x52 out
0x54 out r
0x56 out e
0x58 out c
0x5a out o
0x5c out r
0x5e out d
0x60 out
0x62 out y
0x64 out o
0x66 out u
0x68 out r
0x6a out
0x6c out p
0x6e out r
0x70 out o
0x72 out g
0x74 out r
0x76 out e
0x78 out s
0x7a out s
0x7c out
0x7e out b
0x80 out y
0x82 out
0x84 out p
0x86 out u
0x88 out t
0x8a out t
0x8c out i
0x8e out n
0x90 out g
0x92 out
0x94 out c
0x96 out o
0x98 out d
0x9a out e
0x9c out s
0x9e out
0xa0 out l
0xa2 out i
0xa4 out k
0xa6 out e
0xa8 out \n
0xaa out t
0xac out h
0xae out i
0xb0 out s
0xb2 out
0xb4 out o
0xb6 out n
0xb8 out e
0xba out
0xbc out i
0xbe out n
0xc0 out t
0xc2 out o
0xc4 out
0xc6 out t
0xc8 out h
0xca out e
0xcc out
0xce out c
0xd0 out h
0xd2 out a
0xd4 out l
0xd6 out l
0xd8 out e
0xda out n
0xdc out g
0xde out e
0xe0 out
0xe2 out w
0xe4 out e
0xe6 out b
0xe8 out s
0xea out i
0xec out t
0xee out e
0xf0 out :
0xf2 out
0xf4 out j
0xf6 out H
0xf8 out r
0xfa out k
0xfc out I
0xfe out w
0x100 out B
0x102 out R
0x104 out Z
0x106 out W
0x108 out e
0x10a out G
0x10c out \n
0x10e out \n
0x110 out E
0x112 out x
0x114 out e
0x116 out c
0x118 out u
0x11a out t
0x11c out i
0x11e out n
0x120 out g
0x122 out
0x124 out s
0x126 out e
0x128 out l
0x12a out f
0x12c out -
0x12e out t
0x130 out e
0x132 out s
0x134 out t
0x136 out .
0x138 out .
0x13a out .
0x13c out \n
0x13e out \n
0x140 jmp 0x15b
0x142 out j
0x144 out m
0x146 out p
0x148 out
0x14a out f
0x14c out a
0x14e out i
0x150 out l
0x152 out s
0x154 out \n
0x156 halt
0x157 noop
0x158 noop
0x159 noop
0x15a noop
0x15b noop
0x15c noop
0x15d noop
0x15e noop
0x15f noop
0x160 jmp 0x166
0x162 jmp 0x170
0x164 jmp 0x18d
0x166 jmp 0x1e4
0x168 jmp 0x1a8
0x16a jmp 0x1c5
0x16c noop
0x16d noop
0x16e noop
0x16f noop
0x170 out j
0x172 out m
0x174 out p
0x176 out
0x178 out l
0x17a out a
0x17c out n
0x17e out d
0x180 out s
0x182 out
0x184 out -
0x186 out 2
0x188 out \n
0x18a halt
0x18b noop
0x18c noop
0x18d out j
0x18f out m
0x191 out p
0x193 out
0x195 out l
0x197 out a
0x199 out n
0x19b out d
0x19d out s
0x19f out
0x1a1 out -
0x1a3 out 1
0x1a5 out \n
0x1a7 halt
0x1a8 noop
0x1a9 noop
0x1aa out j
0x1ac out m
0x1ae out p
0x1b0 out
0x1b2 out l
0x1b4 out a
0x1b6 out n
0x1b8 out d
0x1ba out s
0x1bc out
0x1be out +
0x1c0 out 1
0x1c2 out \n
0x1c4 halt
0x1c5 noop
0x1c6 noop
0x1c7 noop
0x1c8 noop
0x1c9 out j
0x1cb out m
0x1cd out p
0x1cf out
0x1d1 out l
0x1d3 out a
0x1d5 out n
0x1d7 out d
0x1d9 out s
0x1db out
0x1dd out +
0x1df out 2
0x1e1 out \n
0x1e3 halt
0x1e4 jt 0x0 0x432
0x1e7 jf 0x1 0x432
0x1ea jt 0x1 0x1ef
0x1ed jmp 0x432
0x1ef jf 0x0 0x1f4
0x1f2 jmp 0x432
0x1f4 jt R0 0x445
0x1f7 jt R1 0x445
0x1fa jt R2 0x445
0x1fd jt R3 0x445
0x200 jt R4 0x445
0x203 jt R5 0x445
0x206 jt R6 0x445
0x209 jt R7 0x445
0x20c set R0 0x1
0x20f jf R0 0x45e
0x212 set R0 0x0
0x215 jt R0 0x45e
0x218 add R0 0x1 0x1
0x21c jt R0 0x234
0x21f out n
0x221 out o
0x223 out
0x225 out a
0x227 out d
0x229 out d
0x22b out
0x22d out o
0x22f out p
0x231 out \n
0x233 halt
0x234 eq R1 R0 0x2
0x238 jt R1 0x24e
0x23b out n
0x23d out o
0x23f out
0x241 out e
0x243 out q
0x245 out
0x247 out o
0x249 out p
0x24b out \n
0x24d halt
0x24e push R0
0x250 push R1
0x252 pop R0
0x254 pop R1
0x256 eq R2 R1 0x2
0x25a jf R2 0x486
0x25d eq R2 R0 0x1
0x261 jf R2 0x486
0x264 gt R2 R1 R0
0x268 jf R2 0x473
0x26b gt R2 R0 R1
0x26f jt R2 0x473
0x272 gt R2 0x2a 0x2a
0x276 jt R2 0x473
0x279 andb R0 0x70f0 0x4caa
0x27d eq R1 R0 0x40a0
0x281 jf R1 0x499
0x284 orb R1 0x70f0 0x4caa
0x288 eq R0 R1 0x7cfa
0x28c jt R0 0x2ac
0x28f out n
0x291 out o
0x293 out
0x295 out b
0x297 out i
0x299 out t
0x29b out w
0x29d out i
0x29f out s
0x2a1 out e
0x2a3 out
0x2a5 out o
0x2a7 out r
0x2a9 out \n
0x2ab halt
0x2ac notb R0 0x0
0x2af eq R1 R0 0x7fff
0x2b3 jf R1 0x4b8
0x2b6 notb R0 0x5555
0x2b9 eq R1 R0 0x2aaa
0x2bd jf R1 0x4b8
0x2c0 call 0x505
0x2c2 jmp 0x509
0x2c4 pop R0
0x2c6 eq R1 R0 0x2c4
0x2ca jt R1 0x509
0x2cd eq R1 R0 0x2c2
0x2d1 jf R1 0x509
0x2d4 set R0 0x507
0x2d7 call R0
0x2d9 jmp 0x509
0x2db pop R0
0x2dd eq R1 R0 0x2db
0x2e1 jt R1 0x509
0x2e4 eq R1 R0 0x2d9
0x2e8 jf R1 0x509
0x2eb add R0 0x7fff 0x7fff
0x2ef eq R1 R0 0x7ffe
0x2f3 jf R1 0x520
0x2f6 eq R1 0x7ffe R0
0x2fa jf R1 0x520
0x2fd add R0 0x4000 0x4000
0x301 jt R0 0x520
0x304 add R0 0x4000 0x4000
0x308 jt R0 0x520
0x30b mult R0 0x6 0x9
0x30f eq R1 R0 0x2a
0x313 jt R1 0x565
0x316 eq R1 R0 0x36
0x31a jf R1 0x586
0x31d mult R0 0x3039 0x7d7b
0x321 eq R1 R0 0x63
0x325 jf R1 0x520
0x328 mod R0 0x6 0x3
0x32c eq R1 R0 0x0
0x330 jf R1 0x59d
0x333 mod R0 0x46 0x6
0x337 eq R1 R0 0x4
0x33b jf R1 0x59d
0x33e mult R0 0x7ffe 0xf
0x342 eq R1 R0 0x7fe2
0x346 jf R1 0x520
0x349 jmp 0x34d
0x34d rmem R0 0x34b
0x350 eq R1 R0 0x4e20
0x354 jf R1 0x4d7
0x357 add R2 0x34b 0x1
0x35b rmem R0 R2
0x35e eq R1 R0 0x2710
0x362 jf R1 0x4d7
0x365 set R0 0x34b
0x368 wmem R0 0x7530
0x36b rmem R2 R0
0x36e eq R1 R2 0x7530
0x372 jf R1 0x4ee
0x375 call 0x6bb
0x377 rmem R0 0x17b4
0x37a eq R1 R0 0xb
0x37e jf R1 0x4d7
0x381 add R2 0x17b4 0x1
0x385 rmem R0 R2
0x388 eq R1 R0 0x74
0x38c jf R1 0x4d7
0x38f wmem R2 0x54
0x392 rmem R0 R2
0x395 eq R1 R0 0x74
0x399 jt R1 0x4ee
0x39c eq R1 R0 0x54
0x3a0 jf R1 0x4ee
0x3a3 wmem 0x3a9 0x15
0x3a6 wmem 0x3aa 0x7
0x3a9 noop
0x3aa jt 0x13 0x3d2
0x3ad out w
0x3af out m
0x3b1 out e
0x3b3 out m
0x3b5 out
0x3b7 out o
0x3b9 out p
0x3bb out w
0x3bd out r
0x3bf out i
0x3c1 out t
0x3c3 out e
0x3c5 out
0x3c7 out f
0x3c9 out a
0x3cb out i
0x3cd out l
0x3cf out \n
0x3d1 halt
0x3d2 add R1 0xa 0x17c0
0x3d6 add R1 R1 0x1
0x3da rmem R2 0x17e4
0x3dd add R2 R2 0x17e4
0x3e1 set R0 0x17e4
0x3e4 add R0 R0 0x1
0x3e8 gt R3 R0 R2
0x3ec jt R3 0x3ff
0x3ef rmem R4 R0
0x3f2 wmem R1 R4
0x3f5 add R0 R0 0x1
0x3f9 add R1 R1 0x1
0x3fd jmp 0x3e8
0x3ff rmem R0 0x17c0
0x402 rmem R1 0x17d3
0x405 add R0 R0 R1
0x409 add R0 R0 0x1
0x40d wmem 0x17c0 R0
0x410 wmem 0x17d3 0x2c
0x413 set R0 0x17c0
0x416 call 0x5ee
0x418 push R0
0x41a push R1
0x41c push R2
0x41e set R0 0x68e3
0x421 set R1 0x5fb
0x424 add R2 0x10ca 0x5a9e
0x428 call 0x5b2
0x42a pop R2
0x42c pop R1
0x42e pop R0
0x430 jmp 0xaae
0x432 out n
0x434 out o
0x436 out
0x438 out j
0x43a out t
0x43c out /
0x43e out j
0x440 out f
0x442 out \n
0x444 halt
0x445 out n
0x447 out o
0x449 out n
0x44b out z
0x44d out e
0x44f out r
0x451 out o
0x453 out
0x455 out r
0x457 out e
0x459 out g
0x45b out \n
0x45d halt
0x45e out n
0x460 out o
0x462 out
0x464 out s
0x466 out e
0x468 out t
0x46a out
0x46c out o
0x46e out p
0x470 out \n
0x472 halt
0x473 out n
0x475 out o
0x477 out
0x479 out g
0x47b out t
0x47d out
0x47f out o
0x481 out p
0x483 out \n
0x485 halt
0x486 out n
0x488 out o
0x48a out
0x48c out s
0x48e out t
0x490 out a
0x492 out c
0x494 out k
0x496 out \n
0x498 halt
0x499 out n
0x49b out o
0x49d out
0x49f out b
0x4a1 out i
0x4a3 out t
0x4a5 out w
0x4a7 out i
0x4a9 out s
0x4ab out e
0x4ad out
0x4af out a
0x4b1 out n
0x4b3 out d
0x4b5 out \n
0x4b7 halt
0x4b8 out n
0x4ba out o
0x4bc out
0x4be out b
0x4c0 out i
0x4c2 out t
0x4c4 out w
0x4c6 out i
0x4c8 out s
0x4ca out e
0x4cc out
0x4ce out n
0x4d0 out o
0x4d2 out t
0x4d4 out \n
0x4d6 halt
0x4d7 out n
0x4d9 out o
0x4db out
0x4dd out r
0x4df out m
0x4e1 out e
0x4e3 out m
0x4e5 out
0x4e7 out o
0x4e9 out p
0x4eb out \n
0x4ed halt
0x4ee out n
0x4f0 out o
0x4f2 out
0x4f4 out w
0x4f6 out m
0x4f8 out e
0x4fa out m
0x4fc out
0x4fe out o
0x500 out p
0x502 out \n
0x504 halt
0x505 jmp 0x2c4
0x507 jmp 0x2db
0x509 out n
0x50b out o
0x50d out
0x50f out c
0x511 out a
0x513 out l
0x515 out l
0x517 out
0x519 out o
0x51b out p
0x51d out \n
0x51f halt
0x520 out n
0x522 out o
0x524 out
0x526 out m
0x528 out o
0x52a out d
0x52c out u
0x52e out l
0x530 out o
0x532 out
0x534 out m
0x536 out a
0x538 out t
0x53a out h
0x53c out
0x53e out d
0x540 out u
0x542 out r
0x544 out i
0x546 out n
0x548 out g
0x54a out
0x54c out a
0x54e out d
0x550 out d
0x552 out
0x554 out o
0x556 out r
0x558 out
0x55a out m
0x55c out u
0x55e out l
0x560 out t
0x562 out \n
0x564 halt
0x565 out n
0x567 out o
0x569 out t
0x56b out
0x56d out h
0x56f out i
0x571 out t
0x573 out c
0x575 out h
0x577 out h
0x579 out i
0x57b out k
0x57d out i
0x57f out n
0x581 out g
0x583 out \n
0x585 halt
0x586 out n
0x588 out o
0x58a out
0x58c out m
0x58e out u
0x590 out l
0x592 out t
0x594 out
0x596 out o
0x598 out p
0x59a out \n
0x59c halt
0x59d out n
0x59f out o
0x5a1 out
0x5a3 out m
0x5a5 out o
0x5a7 out d
0x5a9 out
0x5ab out o
0x5ad out p
0x5af out \n
0x5b1 halt
0x5b2 push R0
0x5b4 push R3
0x5b6 push R4
0x5b8 push R5
0x5ba push R6
0x5bc set R6 R0
0x5bf set R5 R1
0x5c2 rmem R4 R0
0x5c5 set R1 0x0
0x5c8 add R3 0x1 R1
0x5cc gt R0 R3 R4
0x5d0 jt R0 0x5e3
0x5d3 add R3 R3 R6
0x5d7 rmem R0 R3
0x5da call R5
0x5dc add R1 R1 0x1
0x5e0 jt R1 0x5c8
0x5e3 pop R6
0x5e5 pop R5
0x5e7 pop R4
0x5e9 pop R3
0x5eb pop R0
0x5ed ret
0x5ee push R1
0x5f0 set R1 0x5f8
0x5f3 call 0x5b2
0x5f5 pop R1
0x5f7 ret
0x5f8 out 耀
0x5fa ret
0x5fb push R1
0x5fd set R1 R2
0x600 call 0x84d
0x602 out 耀
0x604 pop R1
0x606 ret
0x607 push R1
0x609 push R3
0x60b rmem R3 R0
0x60e jf R3 0x61b
0x611 call 0x5b2
0x613 jt R1 0x61b
0x616 set R0 R2
0x619 jmp 0x61e
0x61b set R0 0x7fff
0x61e pop R3
0x620 pop R1
0x622 ret
0x623 push R1
0x625 push R2
0x627 set R2 R1
0x62a set R1 0x645
0x62d call 0x607
0x62f pop R2
0x631 pop R1
0x633 ret
0x634 push R1
0x636 push R2
0x638 set R2 R1
0x63b set R1 0x670
0x63e call 0x607
0x640 pop R2
0x642 pop R1
0x644 ret
0x645 eq R0 R0 R2
0x649 jf R0 0x652
0x64c set R2 R1
0x64f set R1 0x7fff
0x652 ret
0x653 push R3
0x655 add R3 R2 0x1
0x659 add R3 R3 R1
0x65d rmem R3 R3
0x660 eq R3 R0 R3
0x664 jt R3 0x66d
0x667 set R2 R1
0x66a set R1 0x7fff
0x66d pop R3
0x66f ret
0x670 push R1
0x672 set R1 R2
0x675 call 0x683
0x677 pop R1
0x679 jf R0 0x682
0x67c set R2 R1
0x67f set R1 0x7fff
0x682 ret
0x683 push R1
0x685 push R2
0x687 push R3
0x689 push R4
0x68b rmem R3 R0
0x68e rmem R4 R1
0x691 eq R2 R3 R4
0x695 jf R2 0x6af
0x698 orb R2 R3 R4
0x69c jf R2 0x6aa
0x69f set R2 R1
0x6a2 set R1 0x653
0x6a5 call 0x5b2
0x6a7 jf R1 0x6af
0x6aa set R0 0x1
0x6ad jmp 0x6b2
0x6af set R0 0x0
0x6b2 pop R4
0x6b4 pop R3
0x6b6 pop R2
0x6b8 pop R1
0x6ba ret
0x6bb push R0
0x6bd push R1
0x6bf set R1 0x17b4
0x6c2 rmem R0 R1
0x6c5 push R1
0x6c7 mult R1 R1 R1
0x6cb call 0x84d
0x6cd set R1 0x4154
0x6d0 call 0x84d
0x6d2 pop R1
0x6d4 wmem R1 R0
0x6d7 add R1 R1 0x1
0x6db eq R0 0x7562 R1
0x6df jf R0 0x6c2
0x6e2 pop R1
0x6e4 pop R0
0x6e6 ret
0x6e7 push R0
0x6e9 push R2
0x6eb push R3
0x6ed push R4
0x6ef push R5
0x6f1 add R2 R1 R0
0x6f5 set R0 R1
0x6f8 set R5 0x0
0x6fb add R0 R0 0x1
0x6ff gt R3 R0 R2
0x703 jt R3 0x718
0x706 inp R4
0x708 eq R3 R4 0xa
0x70c jt R3 0x718
0x70f wmem R0 R4
0x712 add R5 R5 0x1
0x716 jmp 0x6fb
0x718 wmem R1 R5
0x71b eq R3 R4 0xa
0x71f jt R3 0x726
0x722 inp R4
0x724 jmp 0x71b
0x726 pop R5
0x728 pop R4
0x72a pop R3
0x72c pop R2
0x72e pop R0
0x730 ret
0x731 push R3
0x733 push R4
0x735 push R5
0x737 push R6
0x739 set R6 0x1
0x73c add R4 R3 R6
0x740 rmem R4 R4
0x743 add R5 0x17ed R6
0x747 wmem R5 R4
0x74a add R6 R6 0x1
0x74e rmem R5 0x17ed
0x751 gt R4 R6 R5
0x755 jf R4 0x73c
0x758 set R3 0x0
0x75b set R4 0x0
0x75e rmem R5 0x17ed
0x761 mod R5 R4 R5
0x765 add R5 R5 0x17ed
0x769 add R5 R5 0x1
0x76d rmem R6 R5
0x770 mult R6 R6 0x1481
0x774 add R6 R6 0x3039
0x778 wmem R5 R6
0x77b push R0
0x77d push R1
0x77f set R1 R6
0x782 call 0x84d
0x784 set R6 R0
0x787 pop R1
0x789 pop R0
0x78b rmem R5 R1
0x78e mod R6 R6 R5
0x792 add R6 R6 0x1
0x796 gt R5 R6 R2
0x79a jt R5 0x7a0
0x79d set R3 0x1
0x7a0 add R6 R6 R1
0x7a4 rmem R6 R6
0x7a7 add R4 R4 0x1
0x7ab add R5 R4 0x17f1
0x7af wmem R5 R6
0x7b2 rmem R5 0x17f1
0x7b5 eq R5 R4 R5
0x7b9 jf R5 0x75e
0x7bc jf R3 0x758
0x7bf push R0
0x7c1 set R0 0x17f1
0x7c4 call 0x5ee
0x7c6 pop R0
0x7c8 pop R6
0x7ca pop R5
0x7cc pop R4
0x7ce pop R3
0x7d0 ret
0x7d1 push R0
0x7d3 push R1
0x7d5 push R2
0x7d7 push R3
0x7d9 push R4
0x7db push R5
0x7dd set R2 0x1
0x7e0 set R5 0x0
0x7e3 jf R0 0x82c
0x7e6 eq R4 R2 0x2710
0x7ea set R3 R0
0x7ed jt R4 0x7f8
0x7f0 mult R1 R2 0xa
0x7f4 mod R3 R0 R1
0x7f8 set R4 0x0
0x7fb mult R2 R2 0x7fff
0x7ff jf R3 0x80c
0x802 add R4 R4 0x1
0x806 add R3 R3 R2
0x80a jmp 0x7ff
0x80c mult R2 R2 0x7fff
0x810 mult R3 R4 R2
0x814 mult R3 R3 0x7fff
0x818 add R0 R0 R3
0x81c add R4 R4 0x30
0x820 mult R2 R2 0xa
0x824 add R5 R5 0x1
0x828 push R4
0x82a jmp 0x7e3
0x82c jt R5 0x833
0x82f out 0
0x831 jmp 0x840
0x833 jf R5 0x840
0x836 pop R0
0x838 out 耀
0x83a add R5 R5 0x7fff
0x83e jmp 0x833
0x840 pop R5
0x842 pop R4
0x844 pop R3
0x846 pop R2
0x848 pop R1
0x84a pop R0
0x84c ret
0x84d push R1
0x84f push R2
0x851 andb R2 R0 R1
0x855 notb R2 R2
0x858 orb R0 R0 R1
0x85c andb R0 R0 R2
0x860 pop R2
0x862 pop R1
0x864 ret
0x865 add R0 R0 R1
0x869 gt R1 R1 R0
0x86d ret
0x86e push R2
0x870 gt R2 R1 R0
0x874 mult R1 R1 0x7fff
0x878 add R0 R0 R1
0x87c set R1 R2
0x87f pop R2
0x881 ret
0x882 jf R0 0x8c1
0x885 jf R1 0x8c1
0x888 push R2
0x88a push R3
0x88c gt R2 R1 R0
0x890 jt R2 0x89c
0x893 set R2 R0
0x896 set R0 R1
0x899 set R1 R2
0x89c set R2 R0
0x89f set R0 0x0
0x8a2 add R0 R0 R1
0x8a6 gt R3 R1 R0
0x8aa jt R3 0x8b9
0x8ad add R2 R2 0x7fff
0x8b1 jt R2 0x8a2
0x8b4 set R1 0x0
0x8b7 jmp 0x8bc
0x8b9 set R1 0x1
0x8bc pop R3
0x8be pop R2
0x8c0 ret
0x8c1 set R0 0x0
0x8c4 set R1 0x0
0x8c7 ret
0x8c8 push R1
0x8ca push R2
0x8cc jf R1 0x8e4
0x8cf add R1 R1 0x7fff
0x8d3 andb R2 R0 0x4000
0x8d7 mult R0 R0 0x2
0x8db jf R2 0x8cc
0x8de orb R0 R0 0x1
0x8e2 jmp 0x8cc
0x8e4 pop R2
0x8e6 pop R1
0x8e8 ret
0x8e9 push R1
0x8eb gt R1 R0 0xe
0x8ef jt R1 0x905
0x8f2 set R1 R0
0x8f5 set R0 0x1
0x8f8 jf R1 0x908
0x8fb add R1 R1 0x7fff
0x8ff mult R0 R0 0x2
0x903 jmp 0x8f8
0x905 set R0 0x7fff
0x908 pop R1
0x90a ret
0x90b jmp 0xaae
0x911 halt
0x916 halt
0x91b halt
0x920 halt
0x925 halt
0x92a halt
0x92f halt
0x934 halt
0x939 halt
0x93e halt
0x943 halt
0x948 halt
0x975 halt
0x993 halt
0x998 halt
0x99d halt
0x99e gt 0x28b9 0x28bf 0x69e3
0x9a8 halt
0x9ad halt
0x9b2 halt
0x9b7 halt
0x9bc halt
0x9c1 halt
0x9c6 halt
0x9cb halt
0x9d0 halt
0x9d5 halt
0x9da halt
0x9df halt
0x9e4 halt
0x9e9 halt
0x9ee halt
0x9f3 halt
0x9f8 halt
0x9fd halt
0xa5c halt
0xa61 halt
0xa66 halt
0xa6e halt
0xa73 halt
0xa7a halt
0xa96 halt
0xa9a halt
0xa9b halt
0xa9f halt
0xaa6 halt
0xaa7 halt
0xaab halt
0xaae push R0
0xab0 push R1
0xab2 push R2
0xab4 push R3
0xab6 rmem R1 0xaac
0xab9 rmem R0 0xaad
0xabc eq R0 R0 R1
0xac0 jt R0 0xad2
0xac3 rmem R0 0xaac
0xac6 add R0 R0 0x4
0xaca rmem R0 R0
0xacd jf R0 0xad2
0xad0 call R0
0xad2 rmem R1 0xaac
0xad5 rmem R0 0xaad
0xad8 eq R0 R0 R1
0xadc jt R0 0xae7
0xadf set R0 0x6576
0xae2 wmem R0 0x0
0xae5 call 0xb94
0xae7 wmem 0xaad R1
0xaea push R0
0xaec push R1
0xaee push R2
0xaf0 set R0 0x6b16
0xaf3 set R1 0x5fb
0xaf6 add R2 0x58e3 0x1d95
0xafa call 0x5b2
0xafc pop R2
0xafe pop R1
0xb00 pop R0
0xb02 set R0 0x20
0xb05 set R1 0x6576
0xb08 call 0x6e7
0xb0a out \n
0xb0c out \n
0xb0e set R0 0x6576
0xb11 set R1 0x20
0xb14 call 0x623
0xb16 eq R1 R0 0x7fff
0xb1a jf R1 0xb20
0xb1d rmem R0 0x6576
0xb20 set R2 R0
0xb23 rmem R1 0x6576
0xb26 push R1
0xb28 wmem 0x6576 R2
0xb2b set R0 0x6b06
0xb2e set R1 0x6576
0xb31 call 0x634
0xb33 pop R1
0xb35 wmem 0x6576 R1
0xb38 eq R1 R0 0x7fff
0xb3c jf R1 0xb45
0xb3f set R0 0x0
0xb42 set R2 0x0
0xb45 add R1 0x6b0e 0x1
0xb49 add R1 R1 R0
0xb4d rmem R1 R1
0xb50 rmem R3 0x6576
0xb53 eq R3 R3 R2
0xb57 jt R3 0xb80
0xb5a mult R0 R2 0x7fff
0xb5e rmem R3 0x6576
0xb61 add R3 R0 R3
0xb65 jf R2 0xb6c
0xb68 add R3 R3 0x7fff
0xb6c mod R3 R3 0x20
0xb70 add R0 0x6576 R2
0xb74 jf R2 0xb7b
0xb77 add R0 R0 0x1
0xb7b wmem R0 R3
0xb7e jmp 0xb86
0xb80 set R0 0x6576
0xb83 wmem R0 0x0
0xb86 call R1
0xb88 jt R1 0xab6
0xb8b pop R3
0xb8d pop R2
0xb8f pop R1
0xb91 pop R0
0xb93 ret
0xb94 push R0
0xb96 push R1
0xb98 push R2
0xb9a rmem R1 R0
0xb9d jf R1 0xbd8
0xba0 call 0x1721
0xba2 jf R0 0xbbe
0xba5 push R0
0xba7 call 0x1766
0xba9 set R1 R0
0xbac pop R0
0xbae jf R1 0xbbe
0xbb1 add R1 R0 0x1
0xbb5 rmem R0 R1
0xbb8 call 0x5ee
0xbba out \n
0xbbc jmp 0xca6
0xbbe push R0
0xbc0 push R1
0xbc2 push R2
0xbc4 set R0 0x6b28
0xbc7 set R1 0x5fb
0xbca add R2 0x72 0xa74
0xbce call 0x5b2
0xbd0 pop R2
0xbd2 pop R1
0xbd4 pop R0
0xbd6 jmp 0xca6
0xbd8 rmem R0 0xaac
0xbdb push R0
0xbdd out =
0xbdf out =
0xbe1 out
0xbe3 add R0 R0 0x0
0xbe7 rmem R0 R0
0xbea call 0x5ee
0xbec out
0xbee out =
0xbf0 out =
0xbf2 out \n
0xbf4 pop R0
0xbf6 push R0
0xbf8 add R0 R0 0x1
0xbfc rmem R0 R0
0xbff rmem R1 R0
0xc02 eq R1 R1 0x2
0xc06 jf R1 0xc20
0xc09 push R0
0xc0b set R0 0xa78
0xc0e call 0x1766
0xc10 set R1 R0
0xc13 pop R0
0xc15 add R0 R0 0x1
0xc19 add R0 R0 R1
0xc1d rmem R0 R0
0xc20 call 0x5ee
0xc22 out \n
0xc24 pop R0
0xc26 push R0
0xc28 call 0x16bf
0xc2a jf R0 0xc4a
0xc2d push R0
0xc2f push R1
0xc31 push R2
0xc33 set R0 0x6b3f
0xc36 set R1 0x5fb
0xc39 add R2 0x512 0x1d6b
0xc3d call 0x5b2
0xc3f pop R2
0xc41 pop R1
0xc43 pop R0
0xc45 rmem R2 0xaac
0xc48 call 0x16f4
0xc4a pop R0
0xc4c push R0
0xc4e add R0 R0 0x2
0xc52 rmem R0 R0
0xc55 rmem R0 R0
0xc58 eq R2 R0 0x1
0xc5c out \n
0xc5e out T
0xc60 out h
0xc62 out e
0xc64 out r
0xc66 out e
0xc68 out
0xc6a jt R2 0xc75
0xc6d out a
0xc6f out r
0xc71 out e
0xc73 jmp 0xc79
0xc75 out i
0xc77 out s
0xc79 out
0xc7b call 0x7d1
0xc7d out
0xc7f out e
0xc81 out x
0xc83 out i
0xc85 out t
0xc87 eq R2 R0 0x1
0xc8b jt R2 0xc90
0xc8e out s
0xc90 out :
0xc92 out \n
0xc94 pop R0
0xc96 push R0
0xc98 add R0 R0 0x2
0xc9c rmem R0 R0
0xc9f set R1 0x16b6
0xca2 call 0x5b2
0xca4 pop R0
0xca6 pop R2
0xca8 pop R1
0xcaa pop R0
0xcac ret
0xcad push R0
0xcaf push R1
0xcb1 push R2
0xcb3 set R1 R0
0xcb6 rmem R0 0xaac
0xcb9 add R0 R0 0x2
0xcbd rmem R0 R0
0xcc0 call 0x634
0xcc2 eq R2 R0 0x7fff
0xcc6 jt R2 0xce6
0xcc9 rmem R2 0xaac
0xccc add R2 R2 0x3
0xcd0 rmem R2 R2
0xcd3 add R2 R2 0x1
0xcd7 add R2 R2 R0
0xcdb rmem R2 R2
0xcde wmem 0xaac R2
0xce1 wmem 0xaad 0x0
0xce4 jmp 0xcfe
0xce6 push R0
0xce8 push R1
0xcea push R2
0xcec set R0 0x6b5a
0xcef set R1 0x5fb
0xcf2 add R2 0x219 0x5b
0xcf6 call 0x5b2
0xcf8 pop R2
0xcfa pop R1
0xcfc pop R0
0xcfe pop R2
0xd00 pop R1
0xd02 pop R0
0xd04 ret
0xd05 push R0
0xd07 push R0
0xd09 push R1
0xd0b push R2
0xd0d set R0 0x6b8c
0xd10 set R1 0x5fb
0xd13 add R2 0x3456 0x1b95
0xd17 call 0x5b2
0xd19 pop R2
0xd1b pop R1
0xd1d pop R0
0xd1f pop R0
0xd21 ret
0xd22 push R0
0xd24 push R2
0xd26 push R0
0xd28 push R1
0xd2a push R2
0xd2c set R0 0x6d85
0xd2f set R1 0x5fb
0xd32 add R2 0x422e 0x37cb
0xd36 call 0x5b2
0xd38 pop R2
0xd3a pop R1
0xd3c pop R0
0xd3e set R2 0x0
0xd41 call 0x16f4
0xd43 pop R2
0xd45 pop R0
0xd47 ret
0xd48 push R0
0xd4a push R1
0xd4c push R2
0xd4e call 0x1721
0xd50 jf R0 0xd81
0xd53 add R1 R0 0x2
0xd57 rmem R0 R1
0xd5a rmem R2 0xaac
0xd5d eq R2 R0 R2
0xd61 jf R2 0xd81
0xd64 wmem R1 0x0
0xd67 push R0
0xd69 push R1
0xd6b push R2
0xd6d set R0 0x6d96
0xd70 set R1 0x5fb
0xd73 add R2 0x491 0x175d
0xd77 call 0x5b2
0xd79 pop R2
0xd7b pop R1
0xd7d pop R0
0xd7f jmp 0xd99
0xd81 push R0
0xd83 push R1
0xd85 push R2
0xd87 set R0 0x6d9e
0xd8a set R1 0x5fb
0xd8d add R2 0x139c 0x664a
0xd91 call 0x5b2
0xd93 pop R2
0xd95 pop R1
0xd97 pop R0
0xd99 pop R2
0xd9b pop R1
0xd9d pop R0
0xd9f ret
0xda0 push R0
0xda2 push R1
0xda4 call 0x1721
0xda6 jf R0 0xdd3
0xda9 add R1 R0 0x2
0xdad rmem R0 R1
0xdb0 jt R0 0xdd3
0xdb3 rmem R0 0xaac
0xdb6 wmem R1 R0
0xdb9 push R0
0xdbb push R1
0xdbd push R2
0xdbf set R0 0x6dba
0xdc2 set R1 0x5fb
0xdc5 add R2 0x112 0x1e4
0xdc9 call 0x5b2
0xdcb pop R2
0xdcd pop R1
0xdcf pop R0
0xdd1 jmp 0xdeb
0xdd3 push R0
0xdd5 push R1
0xdd7 push R2
0xdd9 set R0 0x6dc4
0xddc set R1 0x5fb
0xddf add R2 0x13e 0x122e
0xde3 call 0x5b2
0xde5 pop R2
0xde7 pop R1
0xde9 pop R0
0xdeb pop R1
0xded pop R0
0xdef ret
0xdf0 push R0
0xdf2 push R1
0xdf4 call 0x1721
0xdf6 jf R0 0xe11
0xdf9 add R1 R0 0x2
0xdfd rmem R1 R1
0xe00 jt R1 0xe11
0xe03 add R1 R0 0x3
0xe07 rmem R1 R1
0xe0a jf R1 0xe2b
0xe0d call R1
0xe0f jmp 0xe43
0xe11 push R0
0xe13 push R1
0xe15 push R2
0xe17 set R0 0x6de7
0xe1a set R1 0x5fb
0xe1d add R2 0xda5 0x15c1
0xe21 call 0x5b2
0xe23 pop R2
0xe25 pop R1
0xe27 pop R0
0xe29 jmp 0xe43
0xe2b push R0
0xe2d push R1
0xe2f push R2
0xe31 set R0 0x6e0a
0xe34 set R1 0x5fb
0xe37 add R2 0x49bf 0x23b7
0xe3b call 0x5b2
0xe3d pop R2
0xe3f pop R1
0xe41 pop R0
0xe43 pop R1
0xe45 pop R0
0xe47 ret
0xe48 push R0
0xe4a push R1
0xe4c push R2
0xe4e set R0 0xa78
0xe51 call 0x1766
0xe53 jt R0 0xe6e
0xe56 add R0 0xa74 0x2
0xe5a wmem R0 0x7fff
0xe5d add R0 0xa78 0x2
0xe61 wmem R0 0x7fff
0xe64 add R0 0xa70 0x2
0xe68 wmem R0 0x7fff
0xe6b wmem 0xaac 0xa58
0xe6e pop R2
0xe70 pop R1
0xe72 pop R0
0xe74 ret
0xe75 push R0
0xe77 push R1
0xe79 push R2
0xe7b set R0 0x6e2c
0xe7e set R1 0x5fb
0xe81 add R2 0x1cc8 0x10a2
0xe85 call 0x5b2
0xe87 pop R2
0xe89 pop R1
0xe8b pop R0
0xe8d halt
0xe8e halt
0xe8f push R1
0xe91 rmem R1 0xe8e
0xe94 orb R1 R1 R0
0xe98 wmem 0xe8e R1
0xe9b pop R1
0xe9d ret
0xe9e wmem 0xe8e 0x0
0xea1 ret
0xea2 push R0
0xea4 set R0 0x1
0xea7 call 0xe8f
0xea9 pop R0
0xeab ret
0xeac push R0
0xeae set R0 0x2
0xeb1 call 0xe8f
0xeb3 pop R0
0xeb5 ret
0xeb6 push R0
0xeb8 set R0 0x4
0xebb call 0xe8f
0xebd pop R0
0xebf ret
0xec0 push R0
0xec2 set R0 0x8
0xec5 call 0xe8f
0xec7 pop R0
0xec9 ret
0xeca push R0
0xecc set R0 0x10
0xecf call 0xe8f
0xed1 pop R0
0xed3 ret
0xed4 push R0
0xed6 set R0 0x20
0xed9 call 0xe8f
0xedb pop R0
0xedd ret
0xede push R0
0xee0 push R1
0xee2 push R2
0xee4 push R3
0xee6 set R0 0x40
0xee9 call 0xe8f
0xeeb push R0
0xeed push R1
0xeef push R2
0xef1 set R0 0x6e4c
0xef4 set R1 0x5fb
0xef7 add R2 0x393 0x30e8
0xefb call 0x5b2
0xefd pop R2
0xeff pop R1
0xf01 pop R0
0xf03 rmem R0 0xe8e
0xf06 set R1 0x650a
0xf09 set R2 0x7fff
0xf0c set R3 0x6e8b
0xf0f call 0x731
0xf11 push R0
0xf13 push R1
0xf15 push R2
0xf17 set R0 0x6e8f
0xf1a set R1 0x5fb
0xf1d add R2 0x2227 0x144d
0xf21 call 0x5b2
0xf23 pop R2
0xf25 pop R1
0xf27 pop R0
0xf29 wmem 0xaac 0x971
0xf2c pop R3
0xf2e pop R2
0xf30 pop R1
0xf32 pop R0
0xf34 ret
0xf35 push R0
0xf37 push R1
0xf39 rmem R0 0x99e
0xf3c rmem R1 0x69dd
0xf3f eq R0 R0 R1
0xf43 jt R0 0xf64
0xf46 push R0
0xf48 push R1
0xf4a push R2
0xf4c set R0 0x6ebb
0xf4f set R1 0x5fb
0xf52 add R2 0x67 0x96
0xf56 call 0x5b2
0xf58 pop R2
0xf5a pop R1
0xf5c pop R0
0xf5e wmem 0xaac 0x999
0xf61 wmem 0xaad 0x999
0xf64 pop R1
0xf66 pop R0
0xf68 ret
0xf6f halt
0xf71 halt
0xf72 halt
0xf73 halt
0xf74 halt
0xf75 halt
0xf76 push R0
0xf78 push R1
0xf7a set R0 0x2
0xf7d set R1 0x0
0xf80 call 0x107a
0xf82 pop R1
0xf84 pop R0
0xf86 ret
0xf87 push R0
0xf89 push R1
0xf8b set R0 0x8
0xf8e set R1 0x1
0xf91 call 0x10b7
0xf93 pop R1
0xf95 pop R0
0xf97 ret
0xf98 push R0
0xf9a push R1
0xf9c set R0 0x1
0xf9f set R1 0x2
0xfa2 call 0x107a
0xfa4 pop R1
0xfa6 pop R0
0xfa8 ret
0xfa9 push R0
0xfab push R1
0xfad set R0 0x1
0xfb0 set R1 0x3
0xfb3 call 0x10b7
0xfb5 call 0x11b5
0xfb7 pop R1
0xfb9 pop R0
0xfbb ret
0xfbc push R0
0xfbe push R1
0xfc0 set R0 0x4
0xfc3 set R1 0x4
0xfc6 call 0x10b7
0xfc8 pop R1
0xfca pop R0
0xfcc ret
0xfcd push R0
0xfcf push R1
0xfd1 set R0 0x2
0xfd4 set R1 0x5
0xfd7 call 0x107a
0xfd9 pop R1
0xfdb pop R0
0xfdd ret
0xfde push R0
0xfe0 push R1
0xfe2 set R0 0xb
0xfe5 set R1 0x6
0xfe8 call 0x10b7
0xfea pop R1
0xfec pop R0
0xfee ret
0xfef push R0
0xff1 push R1
0xff3 set R0 0x2
0xff6 set R1 0x7
0xff9 call 0x107a
0xffb pop R1
0xffd pop R0
0xfff ret
0x1000 push R0
0x1002 push R1
0x1004 set R0 0x0
0x1007 set R1 0x8
0x100a call 0x107a
0x100c pop R1
0x100e pop R0
0x1010 ret
0x1011 push R0
0x1013 push R1
0x1015 set R0 0x4
0x1018 set R1 0x9
0x101b call 0x10b7
0x101d pop R1
0x101f pop R0
0x1021 ret
0x1022 push R0
0x1024 push R1
0x1026 set R0 0x1
0x1029 set R1 0xa
0x102c call 0x107a
0x102e pop R1
0x1030 pop R0
0x1032 ret
0x1033 push R0
0x1035 push R1
0x1037 set R0 0x12
0x103a set R1 0xb
0x103d call 0x10b7
0x103f pop R1
0x1041 pop R0
0x1043 ret
0x1044 call 0x1203
0x1046 ret
0x1047 push R0
0x1049 push R1
0x104b set R0 0x1
0x104e set R1 0xc
0x1051 call 0x107a
0x1053 pop R1
0x1055 pop R0
0x1057 ret
0x1058 push R0
0x105a push R1
0x105c set R0 0x9
0x105f set R1 0xd
0x1062 call 0x10b7
0x1064 pop R1
0x1066 pop R0
0x1068 ret
0x1069 push R0
0x106b push R1
0x106d set R0 0x2
0x1070 set R1 0xe
0x1073 call 0x107a
0x1075 pop R1
0x1077 pop R0
0x1079 ret
0x107a push R0
0x107c push R1
0x107e push R2
0x1080 add R2 0xa9c 0x2
0x1084 rmem R2 R2
0x1087 jt R2 0x10b0
0x108a call 0x1135
0x108c wmem 0xf6f R0
0x108f add R1 R0 0xf69
0x1093 rmem R1 R1
0x1096 set R0 0x65a8
0x1099 call 0x5ee
0x109b set R0 R1
0x109e call 0x5ee
0x10a0 set R0 0x65e8
0x10a3 call 0x5ee
0x10a5 set R0 R1
0x10a8 call 0x5ee
0x10aa out .
0x10ac out \n
0x10ae out \n
0x10b0 pop R2
0x10b2 pop R1
0x10b4 pop R0
0x10b6 ret
0x10b7 push R0
0x10b9 push R1
0x10bb push R2
0x10bd add R2 0xa9c 0x2
0x10c1 rmem R2 R2
0x10c4 jt R2 0x112e
0x10c7 call 0x1135
0x10c9 push R0
0x10cb rmem R0 0xf6f
0x10ce add R1 R0 0xf69
0x10d2 rmem R1 R1
0x10d5 set R0 0x660a
0x10d8 call 0x5ee
0x10da set R0 R1
0x10dd call 0x5ee
0x10df set R0 0x663a
0x10e2 call 0x5ee
0x10e4 pop R0
0x10e6 set R1 R0
0x10e9 rmem R0 0xf70
0x10ec rmem R2 0xf6f
0x10ef add R2 R2 0xf6c
0x10f3 rmem R2 R2
0x10f6 call R2
0x10f8 jt R1 0x1127
0x10fb rmem R1 0xf70
0x10fe wmem 0xf70 R0
0x1101 gt R2 R0 R1
0x1105 jf R2 0x1111
0x1108 push R0
0x110a set R0 0x667b
0x110d call 0x5ee
0x110f pop R0
0x1111 gt R2 R1 R0
0x1115 jf R2 0x1121
0x1118 push R0
0x111a set R0 0x669b
0x111d call 0x5ee
0x111f pop R0
0x1121 out \n
0x1123 out \n
0x1125 jmp 0x112e
0x1127 call 0x1234
0x1129 set R0 0x66bb
0x112c call 0x5ee
0x112e pop R2
0x1130 pop R1
0x1132 pop R0
0x1134 ret
0x1135 push R0
0x1137 push R1
0x1139 push R2
0x113b push R3
0x113d push R4
0x113f push R5
0x1141 rmem R5 0xf71
0x1144 gt R3 R5 0x752f
0x1148 jt R3 0x1152
0x114b add R5 R5 0x1
0x114f wmem 0xf71 R5
0x1152 set R3 R0
0x1155 set R4 R1
0x1158 add R0 R5 0x2
0x115c call 0x8e9
0x115e rmem R1 0xf72
0x1161 orb R0 R1 R0
0x1165 set R1 R4
0x1168 call 0x8c8
0x116a wmem 0xf72 R0
0x116d set R0 0xf73
0x1170 add R1 R5 0x2
0x1174 set R2 R4
0x1177 call 0x11a3
0x1179 set R0 0xf74
0x117c mult R1 R5 R5
0x1180 mult R2 R4 R4
0x1184 call 0x11a3
0x1186 set R0 0xf75
0x1189 set R1 0xd
0x118c mult R2 R3 0x9
0x1190 mult R2 R2 R2
0x1194 call 0x11a3
0x1196 pop R5
0x1198 pop R4
0x119a pop R3
0x119c pop R2
0x119e pop R1
0x11a0 pop R0
0x11a2 ret
0x11a3 push R0
0x11a5 rmem R0 R0
0x11a8 call 0x8c8
0x11aa set R1 R2
0x11ad call 0x84d
0x11af pop R1
0x11b1 wmem R1 R0
0x11b4 ret
0x11b5 push R0
0x11b7 add R0 0xa9c 0x2
0x11bb rmem R0 R0
0x11be jt R0 0x1200
0x11c1 set R0 0x66d1
0x11c4 call 0x5ee
0x11c6 rmem R0 0xf70
0x11c9 eq R0 R0 0x1e
0x11cd jt R0 0x11de
0x11d0 set R0 0x66f2
0x11d3 call 0x5ee
0x11d5 set R0 0x671e
0x11d8 call 0x5ee
0x11da call 0x1234
0x11dc jmp 0x1200
0x11de set R0 0x6748
0x11e1 call 0x5ee
0x11e3 rmem R0 0xf72
0x11e6 add R0 R0 0x1
0x11ea jt R0 0x11f4
0x11ed set R0 0x6774
0x11f0 call 0x5ee
0x11f2 jmp 0x11d5
0x11f4 set R0 0x67d8
0x11f7 call 0x5ee
0x11f9 add R0 0xa9c 0x2
0x11fd wmem R0 0x7fff
0x1200 pop R0
0x1202 ret
0x1203 push R0
0x1205 add R0 0xa9c 0x2
0x1209 rmem R0 R0
0x120c jt R0 0x1231
0x120f set R0 0x685d
0x1212 call 0x5ee
0x1214 rmem R0 0xaac
0x1217 eq R0 R0 0xa3f
0x121b jt R0 0x1225
0x121e set R0 0x6865
0x1221 call 0x5ee
0x1223 jmp 0x122a
0x1225 set R0 0x686b
0x1228 call 0x5ee
0x122a set R0 0x6871
0x122d call 0x5ee
0x122f call 0x1234
0x1231 pop R0
0x1233 ret
0x1234 push R0
0x1236 wmem 0xf70 0x16
0x1239 wmem 0xf71 0x0
0x123c wmem 0xf72 0x0
0x123f wmem 0xf73 0x0
0x1242 wmem 0xf74 0x0
0x1245 wmem 0xf75 0x0
0x1248 add R0 0xa9c 0x2
0x124c wmem R0 0xa3f
0x124f pop R0
0x1251 ret
0x1252 push R0
0x1254 add R0 0xa9c 0x2
0x1258 rmem R0 R0
0x125b eq R0 R0 0x7fff
0x125f jt R0 0x126d
0x1262 set R0 0x68c8
0x1265 call 0x5ee
0x1267 wmem 0xaac 0xa12
0x126a wmem 0xaad 0xa12
0x126d pop R0
0x126f ret
0x1270 push R0
0x1272 push R1
0x1274 push R2
0x1276 push R3
0x1278 push R0
0x127a push R1
0x127c push R2
0x127e set R0 0x6ed1
0x1281 set R1 0x5fb
0x1284 add R2 0x17 0x149
0x1288 call 0x5b2
0x128a pop R2
0x128c pop R1
0x128e pop R0
0x1290 set R0 0x1092
0x1293 set R1 0x650a
0x1296 set R2 0x7fff
0x1299 set R3 0x6eed
0x129c call 0x731
0x129e push R0
0x12a0 push R1
0x12a2 push R2
0x12a4 set R0 0x6ef1
0x12a7 set R1 0x5fb
0x12aa add R2 0x37a9 0x33c1
0x12ae call 0x5b2
0x12b0 pop R2
0x12b2 pop R1
0x12b4 pop R0
0x12b6 pop R3
0x12b8 pop R2
0x12ba pop R1
0x12bc pop R0
0x12be ret
0x12bf push R0
0x12c1 add R0 0xa70 0x2
0x12c5 rmem R0 R0
0x12c8 jt R0 0x12fa
0x12cb add R0 0xa7c 0x2
0x12cf wmem R0 0x7fff
0x12d2 add R0 0xa70 0x2
0x12d6 wmem R0 0x7fff
0x12d9 add R0 0xa74 0x2
0x12dd wmem R0 0x0
0x12e0 push R0
0x12e2 push R1
0x12e4 push R2
0x12e6 set R0 0x6f25
0x12e9 set R1 0x5fb
0x12ec add R2 0x4675 0x5fa
0x12f0 call 0x5b2
0x12f2 pop R2
0x12f4 pop R1
0x12f6 pop R0
0x12f8 jmp 0x1312
0x12fa push R0
0x12fc push R1
0x12fe push R2
0x1300 set R0 0x6f5e
0x1303 set R1 0x5fb
0x1306 add R2 0x24e0 0x4f0a
0x130a call 0x5b2
0x130c pop R2
0x130e pop R1
0x1310 pop R0
0x1312 pop R0
0x1314 ret
0x1315 push R0
0x1317 add R0 0xa74 0x2
0x131b wmem R0 0x7fff
0x131e add R0 0xa78 0x2
0x1322 wmem R0 0x0
0x1325 push R0
0x1327 push R1
0x1329 push R2
0x132b set R0 0x6f99
0x132e set R1 0x5fb
0x1331 add R2 0x790 0xc55
0x1335 call 0x5b2
0x1337 pop R2
0x1339 pop R1
0x133b pop R0
0x133d wmem 0xaad 0x0
0x1340 pop R0
0x1342 ret
0x1343 push R0
0x1345 add R0 0xa74 0x2
0x1349 wmem R0 0x0
0x134c add R0 0xa78 0x2
0x1350 wmem R0 0x7fff
0x1353 push R0
0x1355 push R1
0x1357 push R2
0x1359 set R0 0x6fb3
0x135c set R1 0x5fb
0x135f add R2 0x5712 0x5a
0x1363 call 0x5b2
0x1365 pop R2
0x1367 pop R1
0x1369 pop R0
0x136b wmem 0xaad 0x0
0x136e pop R0
0x1370 ret
0x1371 push R2
0x1373 push R3
0x1375 rmem R2 0xaac
0x1378 eq R2 R2 0x999
0x137c jt R2 0x1399
0x137f push R0
0x1381 push R1
0x1383 push R2
0x1385 set R0 0x6fcd
0x1388 set R1 0x5fb
0x138b add R2 0x37 0x133
0x138f call 0x5b2
0x1391 pop R2
0x1393 pop R1
0x1395 pop R0
0x1397 jmp 0x14d8
0x1399 add R2 R0 0x2
0x139d wmem R2 0x7fff
0x13a0 rmem R2 0x99e
0x13a3 add R2 R2 0x69d7
0x13a7 add R2 R2 0x1
0x13ab rmem R2 R2
0x13ae add R3 0x999 0x1
0x13b2 rmem R3 R3
0x13b5 add R3 R3 R2
0x13b9 add R2 R1 0x30
0x13bd wmem R3 R2
0x13c0 rmem R2 0x99e
0x13c3 add R2 R2 0x69dd
0x13c7 add R2 R2 0x1
0x13cb wmem R2 R1
0x13ce push R0
0x13d0 push R0
0x13d2 push R1
0x13d4 push R2
0x13d6 set R0 0x6ff8
0x13d9 set R1 0x5fb
0x13dc add R2 0x15ed 0xa7f
0x13e0 call 0x5b2
0x13e2 pop R2
0x13e4 pop R1
0x13e6 pop R0
0x13e8 pop R0
0x13ea push R0
0x13ec add R2 R0 0x0
0x13f0 rmem R0 R2
0x13f3 call 0x5ee
0x13f5 pop R0
0x13f7 push R0
0x13f9 push R0
0x13fb push R1
0x13fd push R2
0x13ff set R0 0x7007
0x1402 set R1 0x5fb
0x1405 add R2 0x4432 0x24b9
0x1409 call 0x5b2
0x140b pop R2
0x140d pop R1
0x140f pop R0
0x1411 pop R0
0x1413 rmem R2 0x99e
0x1416 add R2 R2 0x1
0x141a wmem 0x99e R2
0x141d rmem R3 0x69dd
0x1420 eq R3 R2 R3
0x1424 jf R3 0x14d8
0x1427 set R0 0x0
0x142a add R1 0x69dd 0x1
0x142e rmem R1 R1
0x1431 add R0 R0 R1
0x1435 add R1 0x69dd 0x2
0x1439 rmem R1 R1
0x143c add R2 0x69dd 0x3
0x1440 rmem R2 R2
0x1443 mult R2 R2 R2
0x1447 mult R1 R1 R2
0x144b add R0 R0 R1
0x144f add R1 0x69dd 0x4
0x1453 rmem R1 R1
0x1456 mult R2 R1 R1
0x145a mult R2 R2 R1
0x145e add R0 R0 R2
0x1462 add R1 0x69dd 0x5
0x1466 rmem R1 R1
0x1469 mult R1 R1 0x7fff
0x146d add R0 R0 R1
0x1471 eq R1 R0 0x18f
0x1475 jt R1 0x14c0
0x1478 add R2 0xa80 0x2
0x147c wmem R2 0x999
0x147f add R2 0xa84 0x2
0x1483 wmem R2 0x999
0x1486 add R2 0xa88 0x2
0x148a wmem R2 0x999
0x148d add R2 0xa8c 0x2
0x1491 wmem R2 0x999
0x1494 add R2 0xa90 0x2
0x1498 wmem R2 0x999
0x149b wmem 0x99e 0x0
0x149e set R0 0x69d7
0x14a1 set R1 0x14dd
0x14a4 call 0x5b2
0x14a6 push R0
0x14a8 push R1
0x14aa push R2
0x14ac set R0 0x7026
0x14af set R1 0x5fb
0x14b2 add R2 0x2b28 0x4c3b
0x14b6 call 0x5b2
0x14b8 pop R2
0x14ba pop R1
0x14bc pop R0
0x14be jmp 0x14d8
0x14c0 push R0
0x14c2 push R1
0x14c4 push R2
0x14c6 set R0 0x7069
0x14c9 set R1 0x5fb
0x14cc add R2 0x749 0x27b5
0x14d0 call 0x5b2
0x14d2 pop R2
0x14d4 pop R1
0x14d6 pop R0
0x14d8 pop R3
0x14da pop R2
0x14dc ret
0x14dd push R2
0x14df add R2 0x999 0x1
0x14e3 rmem R2 R2
0x14e6 add R2 R2 R0
0x14ea wmem R2 0x5f
0x14ed pop R2
0x14ef ret
0x14f0 push R0
0x14f2 push R1
0x14f4 set R0 0xa80
0x14f7 set R1 0x2
0x14fa call 0x1371
0x14fc pop R1
0x14fe pop R0
0x1500 ret
0x1501 push R0
0x1503 push R1
0x1505 set R0 0xa84
0x1508 set R1 0x3
0x150b call 0x1371
0x150d pop R1
0x150f pop R0
0x1511 ret
0x1512 push R0
0x1514 push R1
0x1516 set R0 0xa88
0x1519 set R1 0x5
0x151c call 0x1371
0x151e pop R1
0x1520 pop R0
0x1522 ret
0x1523 push R0
0x1525 push R1
0x1527 set R0 0xa8c
0x152a set R1 0x7
0x152d call 0x1371
0x152f pop R1
0x1531 pop R0
0x1533 ret
0x1534 push R0
0x1536 push R1
0x1538 set R0 0xa90
0x153b set R1 0x9
0x153e call 0x1371
0x1540 pop R1
0x1542 pop R0
0x1544 ret
0x1545 push R0
0x1547 push R1
0x1549 push R2
0x154b jf R7 0x15e5
0x154e push R0
0x1550 push R1
0x1552 push R2
0x1554 set R0 0x70ac
0x1557 set R1 0x5fb
0x155a add R2 0x2098 0x5462
0x155e call 0x5b2
0x1560 pop R2
0x1562 pop R1
0x1564 pop R0
0x1566 noop
0x1567 noop
0x1568 noop
0x1569 noop
0x156a noop
0x156b set R0 0x4
0x156e set R1 0x1
0x1571 call 0x178b
0x1573 eq R1 R0 0x6
0x1577 jf R1 0x15cb
0x157a push R0
0x157c push R1
0x157e push R2
0x1580 set R0 0x7156
0x1583 set R1 0x5fb
0x1586 add R2 0x921 0xf5c
0x158a call 0x5b2
0x158c pop R2
0x158e pop R1
0x1590 pop R0
0x1592 set R0 R7
0x1595 set R1 0x650a
0x1598 set R2 0x7fff
0x159b push R3
0x159d set R3 0x7239
0x15a0 call 0x731
0x15a2 pop R3
0x15a4 push R0
0x15a6 push R1
0x15a8 push R2
0x15aa set R0 0x723d
0x15ad set R1 0x5fb
0x15b0 add R2 0x99d 0x45f
0x15b4 call 0x5b2
0x15b6 pop R2
0x15b8 pop R1
0x15ba pop R0
0x15bc wmem 0xaac 0x9c2
0x15bf wmem 0xaad 0x0
0x15c2 add R1 0xa94 0x2
0x15c6 wmem R1 0x7fff
0x15c9 jmp 0x1652
0x15cb push R0
0x15cd push R1
0x15cf push R2
0x15d1 set R0 0x72d8
0x15d4 set R1 0x5fb
0x15d7 add R2 0x127c 0x1efd
0x15db call 0x5b2
0x15dd pop R2
0x15df pop R1
0x15e1 pop R0
0x15e3 jmp 0x1652
0x15e5 push R0
0x15e7 push R1
0x15e9 push R2
0x15eb set R0 0x7369
0x15ee set R1 0x5fb
0x15f1 add R2 0x1359 0x5d09
0x15f5 call 0x5b2
0x15f7 pop R2
0x15f9 pop R1
0x15fb pop R0
0x15fd set R0 0x0
0x1600 add R2 0x1 0x69dd
0x1604 rmem R1 R2
0x1607 add R0 R0 R1
0x160b mult R0 R0 0x7bac
0x160f call 0x84d
0x1611 rmem R1 0x69dd
0x1614 add R1 R1 0x69dd
0x1618 add R2 R2 0x1
0x161c gt R1 R2 R1
0x1620 jf R1 0x1604
0x1623 set R1 0x650a
0x1626 set R2 0x7fff
0x1629 push R3
0x162b set R3 0x73df
0x162e call 0x731
0x1630 pop R3
0x1632 push R0
0x1634 push R1
0x1636 push R2
0x1638 set R0 0x73e3
0x163b set R1 0x5fb
0x163e add R2 0x5a3 0x4c42
0x1642 call 0x5b2
0x1644 pop R2
0x1646 pop R1
0x1648 pop R0
0x164a wmem 0xaac 0x9b8
0x164d wmem 0xaad 0x0
0x1650 jmp 0x1652
0x1652 pop R2
0x1654 pop R1
0x1656 pop R0
0x1658 ret
0x1659 push R0
0x165b push R1
0x165d push R2
0x165f push R3
0x1661 push R0
0x1663 push R1
0x1665 push R2
0x1667 set R0 0x743d
0x166a set R1 0x5fb
0x166d add R2 0x1f4f 0x2515
0x1671 call 0x5b2
0x1673 pop R2
0x1675 pop R1
0x1677 pop R0
0x1679 rmem R0 0xf73
0x167c rmem R1 0xf74
0x167f call 0x84d
0x1681 rmem R1 0xf75
0x1684 call 0x84d
0x1686 set R1 0x653f
0x1689 set R2 0x4
0x168c push R3
0x168e set R3 0x74f6
0x1691 call 0x731
0x1693 pop R3
0x1695 push R0
0x1697 push R1
0x1699 push R2
0x169b set R0 0x74fa
0x169e set R1 0x5fb
0x16a1 add R2 0x6eb3 0xab1
0x16a5 call 0x5b2
0x16a7 pop R2
0x16a9 pop R1
0x16ab pop R0
0x16ad pop R3
0x16af pop R2
0x16b1 pop R1
0x16b3 pop R0
0x16b5 ret
0x16b6 out -
0x16b8 out
0x16ba call 0x5ee
0x16bc out \n
0x16be ret
0x16bf push R1
0x16c1 push R2
0x16c3 set R0 0x6af5
0x16c6 set R1 0x16d6
0x16c9 set R2 0x0
0x16cc call 0x5b2
0x16ce set R0 R2
0x16d1 pop R2
0x16d3 pop R1
0x16d5 ret
0x16d6 push R3
0x16d8 push R4
0x16da rmem R3 0xaac
0x16dd add R4 R0 0x2
0x16e1 rmem R4 R4
0x16e4 eq R3 R3 R4
0x16e8 jf R3 0x16ef
0x16eb add R2 R2 0x1
0x16ef pop R4
0x16f1 pop R3
0x16f3 ret
0x16f4 push R0
0x16f6 push R1
0x16f8 set R0 0x6af5
0x16fb set R1 0x1705
0x16fe call 0x5b2
0x1700 pop R1
0x1702 pop R0
0x1704 ret
0x1705 push R3
0x1707 add R3 R0 0x2
0x170b rmem R3 R3
0x170e eq R3 R2 R3
0x1712 jf R3 0x171e
0x1715 add R0 R0 0x0
0x1719 rmem R0 R0
0x171c call 0x16b6
0x171e pop R3
0x1720 ret
0x1721 push R1
0x1723 push R2
0x1725 set R2 R0
0x1728 set R0 0x6af5
0x172b set R1 0x174c
0x172e call 0x607
0x1730 eq R1 R0 0x7fff
0x1734 jt R1 0x1744
0x1737 add R1 0x6af5 R0
0x173b add R1 R1 0x1
0x173f rmem R0 R1
0x1742 jmp 0x1747
0x1744 set R0 0x0
0x1747 pop R2
0x1749 pop R1
0x174b ret
0x174c push R1
0x174e set R1 R2
0x1751 add R0 R0 0x0
0x1755 rmem R0 R0
0x1758 call 0x683
0x175a pop R1
0x175c jf R0 0x1765
0x175f set R2 R1
0x1762 set R1 0x7fff
0x1765 ret
0x1766 push R1
0x1768 push R2
0x176a add R0 R0 0x2
0x176e rmem R0 R0
0x1771 jf R0 0x1783
0x1774 rmem R1 0xaac
0x1777 eq R1 R0 R1
0x177b jt R1 0x1783
0x177e set R0 0x0
0x1781 jmp 0x1786
0x1783 set R0 0x1
0x1786 pop R2
0x1788 pop R1
0x178a ret
0x178b jt R0 0x1793
0x178e add R0 R1 0x1
0x1792 ret
0x1793 jt R1 0x17a0
0x1796 add R0 R0 0x7fff
0x179a set R1 R7
0x179d call 0x178b
0x179f ret
0x17a0 push R0
0x17a2 add R1 R1 0x7fff
0x17a6 call 0x178b
0x17a8 set R1 R0
0x17ab pop R0
0x17ad add R0 R0 0x7fff
0x17b1 call 0x178b
0x17b3 ret
0x17b4 mod 0x54 0x65 0x73
0x17e3 mult 0x8 0x63 0x6f
0x17ed pop 0xd3
0x17f1 andb 0x4a 0x42 0x53
0x17fe add 0x46 0x6f 0x6f
0x18c0 jt 0x64 0x6f
0x18c8 gt 0x73 0x6f 0x75
0x18ce add 0x46 0x6f 0x6f
0x1923 gt 0x6e 0x6f 0x72
0x1929 add 0x44 0x61 0x72
0x19b9 gt 0x6e 0x6f 0x72
0x19bf gt 0x73 0x6f 0x75
0x19c5 add 0x44 0x61 0x72
0x1a2b gt 0x6e 0x6f 0x72
0x1a31 gt 0x73 0x6f 0x75
0x1a37 add 0x44 0x61 0x72
0x1afd jmp 0x62
0x1b04 gt 0x73 0x6f 0x75
0x1b0a mod 0x52 0x6f 0x70
0x1b90 jf 0x63 0x6f
0x1b99 eq 0x62 0x61 0x63
0x1c61 eq 0x64 0x6f 0x77
0x1c66 mod 0x4d 0x6f 0x73
0x1d44 eq 0x77 0x65 0x73
0x1d49 eq 0x65 0x61 0x73
0x1d4e mod 0x4d 0x6f 0x73
0x1dbb eq 0x77 0x65 0x73
0x1dc0 mod 0x4d 0x6f 0x73
0x1e6a eq 0x65 0x61 0x73
0x1e6f jt 0x70 0x61
0x1e77 jt 0x50 0x61
0x1f30 jmp 0x63
0x1f37 jmp 0x6c
0x1f3e jf 0x64 0x61
0x1f47 jt 0x50 0x61
0x1fd5 jf 0x63 0x6f
0x1fde eq 0x62 0x61 0x63
0x1fe3 rmem 0x54 0x77
0x206f jmp 0x6c
0x2076 gt 0x6e 0x6f 0x72
0x207c gt 0x73 0x6f 0x75
0x2082 eq 0x65 0x61 0x73
0x2087 eq 0x77 0x65 0x73
0x208c rmem 0x54 0x77
0x20d4 gt 0x6e 0x6f 0x72
0x20da gt 0x73 0x6f 0x75
0x20e0 eq 0x77 0x65 0x73
0x20e5 rmem 0x54 0x77
0x212d gt 0x6e 0x6f 0x72
0x2133 gt 0x73 0x6f 0x75
0x2139 eq 0x65 0x61 0x73
0x213e rmem 0x54 0x77
0x2186 mult 0xa 0x54 0x68
0x21cb gt 0x6e 0x6f 0x72
0x21d1 gt 0x73 0x6f 0x75
0x21d7 eq 0x77 0x65 0x73
0x21dc eq 0x65 0x61 0x73
0x21e1 rmem 0x54 0x77
0x2229 gt 0x6e 0x6f 0x72
0x222f gt 0x73 0x6f 0x75
0x2235 eq 0x65 0x61 0x73
0x223a rmem 0x54 0x77
0x2282 mult 0xa 0x54 0x68
0x22ce gt 0x6e 0x6f 0x72
0x22d4 gt 0x73 0x6f 0x75
0x22da eq 0x77 0x65 0x73
0x22df eq 0x65 0x61 0x73
0x22e4 rmem 0x54 0x77
0x232c gt 0x6e 0x6f 0x72
0x2332 eq 0x65 0x61 0x73
0x2337 gt 0x73 0x6f 0x75
0x233d rmem 0x54 0x77
0x2385 eq 0x77 0x65 0x73
0x238a rmem 0x54 0x77
0x23d2 eq 0x77 0x65 0x73
0x23d7 rmem 0x54 0x77
0x241f gt 0x6e 0x6f 0x72
0x2425 gt 0x73 0x6f 0x75
0x242b andb 0x44 0x61 0x72
0x24ab eq 0x77 0x65 0x73
0x24b0 eq 0x65 0x61 0x73
0x24b5 andb 0x44 0x61 0x72
0x24e5 eq 0x65 0x61 0x73
0x24ea eq 0x77 0x65 0x73
0x24ef andb 0x44 0x61 0x72
0x251f eq 0x65 0x61 0x73
0x2524 eq 0x77 0x65 0x73
0x2529 andb 0x44 0x61 0x72
0x259b eq 0x65 0x61 0x73
0x25a0 eq 0x77 0x65 0x73
0x25a5 gt 0x52 0x75 0x69
0x26a4 eq 0x65 0x61 0x73
0x26a9 gt 0x6e 0x6f 0x72
0x26af gt 0x52 0x75 0x69
0x276b gt 0x6e 0x6f 0x72
0x2771 gt 0x73 0x6f 0x75
0x2777 gt 0x52 0x75 0x69
0x2886 mult 0xa 0x39 0x20
0x28a3 gt 0x6e 0x6f 0x72
0x28a9 gt 0x73 0x6f 0x75
0x28af eq 0x65 0x61 0x73
0x28b4 eq 0x77 0x65 0x73
0x28b9 gt 0x52 0x75 0x69
0x2967 gt 0x73 0x6f 0x75
0x296d gt 0x52 0x75 0x69
0x29fe eq 0x64 0x6f 0x77
0x2a03 eq 0x77 0x65 0x73
0x2a08 gt 0x52 0x75 0x69
0x2a89 push 0x75
0x2a8c gt 0x52 0x75 0x69
0x2b46 push 0x75
0x2b49 eq 0x65 0x61 0x73
0x2b4e gt 0x52 0x75 0x69
0x2bfe eq 0x64 0x6f 0x77
0x2c03 inp 0x53
0x2d18 jt 0x6f 0x75
0x2d20 inp 0x53
0x2dc7 jmp 0x69
0x2dce gt 0x42 0x65 0x61
0x2e7f eq 0x77 0x65 0x73
0x2e84 eq 0x65 0x61 0x73
0x2e89 gt 0x6e 0x6f 0x72
0x2e8f gt 0x42 0x65 0x61
0x2f9c eq 0x65 0x61 0x73
0x2fa1 gt 0x6e 0x6f 0x72
0x2fa7 gt 0x42 0x65 0x61
0x30a0 eq 0x77 0x65 0x73
0x30a5 gt 0x6e 0x6f 0x72
0x30ab rmem 0x54 0x72
0x3182 gt 0x6e 0x6f 0x72
0x3188 gt 0x73 0x6f 0x75
0x318e eq 0x65 0x61 0x73
0x3193 rmem 0x54 0x72
0x321e gt 0x6e 0x6f 0x72
0x3224 gt 0x73 0x6f 0x75
0x322a eq 0x77 0x65 0x73
0x322f rmem 0x54 0x72
0x3326 gt 0x6e 0x6f 0x72
0x332c gt 0x73 0x6f 0x75
0x3332 rmem 0x54 0x72
0x3460 gt 0x6e 0x6f 0x72
0x3466 gt 0x73 0x6f 0x75
0x346c rmem 0x54 0x72
0x3572 gt 0x6e 0x6f 0x72
0x3578 gt 0x73 0x6f 0x75
0x357e orb 0x54 0x72 0x6f
0x3669 gt 0x6e 0x6f 0x72
0x366f gt 0x73 0x6f 0x75
0x3675 orb 0x54 0x72 0x6f
0x36fe gt 0x6e 0x6f 0x72
0x3704 gt 0x73 0x6f 0x75
0x370a orb 0x54 0x72 0x6f
0x385b gt 0x6e 0x6f 0x72
0x3861 gt 0x73 0x6f 0x75
0x3867 eq 0x65 0x61 0x73
0x386c inp 0x54
0x3925 eq 0x77 0x65 0x73
0x392a orb 0x54 0x72 0x6f
0x39a1 gt 0x6e 0x6f 0x72
0x39a7 gt 0x73 0x6f 0x75
0x39ad mult 0x56 0x61 0x75
0x39f7 mult 0xa 0x54 0x68
0x3a39 eq 0x65 0x61 0x73
0x3a3e gt 0x73 0x6f 0x75
0x3a44 mult 0x56 0x61 0x75
0x3a8e mult 0xa 0x54 0x68
0x3ad2 eq 0x65 0x61 0x73
0x3ad7 gt 0x73 0x6f 0x75
0x3add eq 0x77 0x65 0x73
0x3ae2 mult 0x56 0x61 0x75
0x3b2c mult 0xa 0x54 0x68
0x3b6e eq 0x65 0x61 0x73
0x3b73 gt 0x73 0x6f 0x75
0x3b79 eq 0x77 0x65 0x73
0x3b7e mult 0x56 0x61 0x75
0x3c3c mult 0xa 0x54 0x68
0x3c80 gt 0x73 0x6f 0x75
0x3c86 eq 0x77 0x65 0x73
0x3c8b gt 0x76 0x61 0x75
0x3c91 mult 0x56 0x61 0x75
0x3cdb mult 0xa 0x54 0x68
0x3d1f gt 0x6e 0x6f 0x72
0x3d25 eq 0x65 0x61 0x73
0x3d2a gt 0x73 0x6f 0x75
0x3d30 mult 0x56 0x61 0x75
0x3d7a mult 0xa 0x54 0x68
0x3dbc gt 0x6e 0x6f 0x72
0x3dc2 eq 0x65 0x61 0x73
0x3dc7 gt 0x73 0x6f 0x75
0x3dcd eq 0x77 0x65 0x73
0x3dd2 mult 0x56 0x61 0x75
0x3e1c mult 0xa 0x54 0x68
0x3e61 gt 0x6e 0x6f 0x72
0x3e67 eq 0x65 0x61 0x73
0x3e6c gt 0x73 0x6f 0x75
0x3e72 eq 0x77 0x65 0x73
0x3e77 mult 0x56 0x61 0x75
0x3ec1 mult 0xa 0x54 0x68
0x3f03 gt 0x6e 0x6f 0x72
0x3f09 gt 0x73 0x6f 0x75
0x3f0f eq 0x77 0x65 0x73
0x3f14 mult 0x56 0x61 0x75
0x3f5e mult 0xa 0x54 0x68
0x3fa0 gt 0x6e 0x6f 0x72
0x3fa6 eq 0x65 0x61 0x73
0x3fab gt 0x73 0x6f 0x75
0x3fb1 mult 0x56 0x61 0x75
0x3ffb mult 0xa 0x54 0x68
0x403f gt 0x6e 0x6f 0x72
0x4045 eq 0x65 0x61 0x73
0x404a gt 0x73 0x6f 0x75
0x4050 eq 0x77 0x65 0x73
0x4055 mult 0x56 0x61 0x75
0x409f mult 0xa 0x54 0x68
0x40e1 gt 0x6e 0x6f 0x72
0x40e7 eq 0x65 0x61 0x73
0x40ec gt 0x73 0x6f 0x75
0x40f2 eq 0x77 0x65 0x73
0x40f7 mult 0x56 0x61 0x75
0x4141 mult 0xa 0x54 0x68
0x4186 gt 0x6e 0x6f 0x72
0x418c gt 0x73 0x6f 0x75
0x4192 eq 0x77 0x65 0x73
0x4197 call 0x56
0x423a gt 0x6e 0x6f 0x72
0x4240 eq 0x65 0x61 0x73
0x4245 gt 0x73 0x6f 0x75
0x424b mult 0x56 0x61 0x75
0x4295 mult 0xa 0x54 0x68
0x42d7 gt 0x6e 0x6f 0x72
0x42dd eq 0x65 0x61 0x73
0x42e2 eq 0x77 0x65 0x73
0x42e7 mult 0x56 0x61 0x75
0x4331 mult 0xa 0x54 0x68
0x4375 gt 0x6e 0x6f 0x72
0x437b eq 0x65 0x61 0x73
0x4380 eq 0x77 0x65 0x73
0x4385 mult 0x56 0x61 0x75
0x43cf mult 0xa 0x54 0x68
0x4411 gt 0x6e 0x6f 0x72
0x4417 eq 0x77 0x65 0x73
0x441c gt 0x56 0x61 0x75
0x44f7 gt 0x6c 0x65 0x61
0x4581 jt 0x66 0x6f
0x4589 eq 0x62 0x61 0x63
0x460d pop 0x72
0x4611 mod 0x69 0x6e 0x76
0x461d call 0x50
0x4679 pop 0x72
0x467d eq 0x77 0x61 0x69
0x4682 eq 0x68 0x69 0x64
0x4687 gt 0x65 0x61 0x74
0x468d halt
0x468e jmp 0x74
0x471e orb 0x65 0x6d 0x70
0x47a8 jt 0x6c 0x61
0x4824 mod 0x6c 0x69 0x74
0x4888 pop 0x63
0x48ba jf 0x72 0x65
0x4903 orb 0x63 0x6f 0x72
0x4951 mult 0x73 0x68 0x69
0x49a4 andb 0x63 0x6f 0x6e
0x4a09 add 0x62 0x6c 0x75
0x4a55 mult 0x74 0x65 0x6c
0x4aa9 orb 0x62 0x75 0x73
0x4af8 pop 0x6f
0x4b3a jmp 0x6d
0x4bb8 andb 0x73 0x74 0x72
0x4c44 mult 0xa 0x52 0x65
0x4c8b mult 0x70 0x72 0x65
0x4ccd mult 0x69 0x6e 0x74
0x4d1c mult 0x70 0x75 0x72
0x4d61 mult 0x69 0x6e 0x74
0x4da2 mult 0x46 0x75 0x72
0x4df1 mult 0x74 0x68 0x69
0x4e3a mult 0x72 0x65 0x67
0x4e87 mult 0xa 0x41 0x20
0x4ed5 mult 0x64 0x65 0x73
0x4f25 mult 0x6d 0x69 0x6e
0x4f72 mult 0x68 0x61 0x73
0x4fc0 mult 0x73 0x68 0x6f
0x5004 mult 0xa 0x54 0x68
0x504e mult 0x65 0x6e 0x65
0x509b mult 0x63 0x6f 0x6e
0x50ea mult 0x49 0x66 0x20
0x5136 mult 0x6c 0x6f 0x63
0x5180 mult 0x69 0x74 0x73
0x51d1 mult 0x74 0x68 0x65
0x521e mult 0x65 0x78 0x61
0x522f mult 0xa 0x54 0x68
0x527e mult 0x63 0x6f 0x6d
0x52cd mult 0x73 0x63 0x61
0x531b mult 0x79 0x65 0x61
0x5368 mult 0xa 0x49 0x66
0x53b3 mult 0x68 0x61 0x6e
0x53fe mult 0x72 0x65 0x69
0x544e mult 0x76 0x65 0x72
0x549e mult 0x68 0x61 0x76
0x54dd mult 0xa 0x54 0x68
0x5528 mult 0x62 0x79 0x70
0x5578 mult 0x61 0x6e 0x6f
0x55c4 mult 0x6e 0x6f 0x77
0x55fe mult 0xa 0x4f 0x66
0x564d jt 0x6a 0x6f
0x56b9 mult 0xa 0x44 0x61
0x5784 mult 0xa 0x44 0x61
0x57dc mult 0xa 0x44 0x61
0x58cf mult 0xa 0x44 0x61
0x59e5 mult 0xa 0x44 0x61
0x5b88 mult 0xa 0x44 0x61
0x5c95 mult 0xa 0x44 0x61
0x5dbb mult 0xa 0x44 0x61
0x5f03 mult 0xa 0x44 0x61
0x609a mult 0xa 0x44 0x61
0x62bf mult 0xa 0x44 0x61
0x6437 mult 0xa 0x44 0x61
0x6557 push 0x67
0x655a eq 0x6c 0x6f 0x6f
0x655f eq 0x68 0x65 0x6c
0x6564 pop 0x69
0x6568 eq 0x74 0x61 0x6b
0x656d eq 0x64 0x72 0x6f
0x6572 pop 0x75
0x6576 halt
0x658f halt
0x6590 halt
0x6591 halt
0x6592 halt
0x6593 halt
0x6594 halt
0x6595 halt
0x6596 halt
0x6597 gt 0x67 0x72 0x65
0x659d pop 0x72
0x65a1 jmp 0x79
0x66bb noop
0x66cf mult 0xa 0x20 0x41
0x6746 mult 0xa 0x2b 0x74
0x685b mult 0xa 0x7 0x41
0x6865 gt 0x6c 0x65 0x61
0x686b gt 0x65 0x6e 0x74
0x68c6 mult 0xa 0x1a 0x54
0x68e2 mult 0x30 0x6b3c 0x6b00
0x6914 push 0x18c0
0x6917 push 0x917
0x691a set 0x1923 0x1
0x691e push 0x19b9
0x6921 push 0x91c
0x6924 push 0x1a2b
0x6927 push 0x921
0x692a push 0x1afd
0x692d push 0x926
0x6930 push 0x1b90
0x6933 push 0x92b
0x6936 set 0x1c61 0x1
0x693a push 0x1d44
0x693d push 0x93a
0x6940 set 0x1dbb 0x1
0x6944 push 0x1e6a
0x6947 push 0x930
0x694a pop 0x1f30
0x694e pop 0x93a
0x6952 push 0x1f4f
0x6955 push 0x1fd5
0x6958 push 0x97b
0x695b gt 0x206f 0x2076 0x207c
0x6961 gt 0x93f 0x94e 0x953
0x6967 pop 0x20d4
0x696b pop 0x953
0x696f pop 0x212d
0x6973 pop 0x949
0x6977 eq 0x21cb 0x21d1 0x21d7
0x697c eq 0x967 0x958 0x949
0x6981 pop 0x2229
0x6985 pop 0x95d
0x6989 eq 0x22ce 0x22d4 0x22da
0x698e eq 0x96c 0x94e 0x953
0x6993 pop 0x232c
0x6997 pop 0x953
0x699b set 0x2385 0x1
0x699f set 0x23d2 0x1
0x69a3 push 0x241f
0x69a6 push 0x953
0x69a9 push 0x24ab
0x69ac push 0x980
0x69af push 0x24e5
0x69b2 push 0x97b
0x69b5 push 0x251f
0x69b8 push 0x980
0x69bb push 0x259b
0x69be push 0x985
0x69c1 push 0x26a4
0x69c4 push 0x98a
0x69c7 push 0x276b
0x69ca push 0x999
0x69cd eq 0x28a3 0x28a9 0x28af
0x69d2 eq 0x99f 0x994 0x9a4
0x69d7 gt 0x10b 0x10f 0x113
0x69dd gt 0x9 0x2 0x5
0x69e1 jt 0x3 0x1
0x69e5 set 0x999 0x2
0x69ea push 0x9a9
0x69ed set 0x2a89 0x1
0x69f1 push 0x2b46
0x69f4 push 0x9b3
0x69f7 set 0x2bfe 0x1
0x69fb set 0x2d18 0x1
0x69ff set 0x2dc7 0x1
0x6a03 pop 0x2e7f
0x6a07 pop 0x9c7
0x6a0b push 0x2f9c
0x6a0e push 0x9c2
0x6a11 push 0x30a0
0x6a14 push 0x9c2
0x6a17 pop 0x3182
0x6a1b pop 0x9db
0x6a1f pop 0x321e
0x6a23 pop 0x9db
0x6a27 push 0x3326
0x6a2a push 0x9e0
0x6a2d push 0x3460
0x6a30 push 0x9e5
0x6a33 push 0x3572
0x6a36 push 0x9ea
0x6a39 push 0x3669
0x6a3c push 0x9ef
0x6a3f push 0x36fe
0x6a42 push 0x9f4
0x6a45 pop 0x385b
0x6a49 pop 0x9fe
0x6a4d set 0x3925 0x1
0x6a51 push 0x39a1
0x6a54 push 0xa3f
0x6a57 push 0x3a39
0x6a5a push 0xa08
0x6a5d pop 0x3ad2
0x6a61 pop 0xa0d
0x6a65 pop 0x3b6e
0x6a69 pop 0xa12
0x6a6d pop 0x3c80
0x6a71 pop 0xa26
0x6a75 pop 0x3d1f
0x6a79 pop 0xa03
0x6a7d eq 0x3dbc 0x3dc2 0x3dc7
0x6a82 eq 0xa08 0xa21 0xa30
0x6a87 eq 0x3e61 0x3e67 0x3e6c
0x6a8c eq 0xa0d 0xa26 0xa35
0x6a91 pop 0x3f03
0x6a95 pop 0xa12
0x6a99 pop 0x3fa0
0x6a9d pop 0xa17
0x6aa1 eq 0x403f 0x4045 0x404a
0x6aa6 eq 0xa1c 0xa35 0xa44
0x6aab eq 0x40e1 0x40e7 0x40ec
0x6ab0 eq 0xa21 0xa3a 0xa49
0x6ab5 pop 0x4186
0x6ab9 pop 0xa26
0x6abd pop 0x423a
0x6ac1 pop 0xa2b
0x6ac5 pop 0x42d7
0x6ac9 pop 0xa30
0x6acd pop 0x4375
0x6ad1 pop 0xa35
0x6ad5 push 0x4411
0x6ad8 push 0xa3a
0x6adb set 0x44f7 0x1
0x6adf push 0x4581
0x6ae2 push 0xa5d
0x6ae5 push 0x460d
0x6ae8 push 0xa62
0x6aeb pop 0x4679
0x6aef pop 0xa67
0x6af3 halt
0x6af4 halt
0x6af5 wmem 0xa6c 0xa70
0x6b06 jt 0x6557 0x655a
0x6b0e jt 0xcad 0xb94
0x6b16 call 0x7672
0x6d85 wmem 0x79a0 0x7996
0x6d96 jt 0x1bba 0x1b8f
0x6dba add 0x2b2 0x284 0x299
0x6e8b pop 0x49da
0x6ebb noop
0x6eed pop 0x1572
0x6ff8 notb 0x2035 0x2003
0x7239 pop 0x1e6c
0x73df pop 0x4eef
0x74f6 pop 0x5e43
0x7562 halt |
source/hash/a-szuzha.ads | ytomino/drake | 33 | 13009 | <reponame>ytomino/drake
pragma License (Unrestricted);
with Ada.Strings.Generic_Unbounded.Generic_Hash;
with Ada.Strings.Wide_Wide_Hash;
function Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash is
new Unbounded_Wide_Wide_Strings.Generic_Hash (Wide_Wide_Hash);
pragma Preelaborate (Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash);
|
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-bg.asm | prismotizm/gigaleak | 0 | 168508 | <reponame>prismotizm/gigaleak
Name: kart-bg.asm
Type: file
Size: 17694
Last-Modified: '1992-08-06T07:16:31Z'
SHA-1: 341A00E2392B46A91FB5249CFC847F89F27DF2B3
Description: null
|
Project4/Sandbox/TestSimpleActivationRecord.asm | orrinjelo/virtual-machine | 0 | 96975 | <filename>Project4/Sandbox/TestSimpleActivationRecord.asm
A .BYT 'A'
JMP START
FN1 MOV R1 FP
ADI R1 -8
LDB R3 (R1)
;LDB R3 A
TRP 3
MOV SP FP ; Test for underflow
MOV R5 SP
CMP R5 SB
BGT R5 UNDERFLOW
MOV R5 FP ; Return address pointed to by FP
ADI R5 -4
LDR R5 (R5)
JMR R5
START MOV R1 SP ; Test for overflow
ADI R1 -8 ; Adjust for Rtn address & PFP
CMP R1 SL
BLT R1 OVERFLOW
MOV R1 FP ; Save FP in R1, this will be PFP
MOV FP SP ; Point at current activation record
ADI SP -8 ; Adjust SP for ret address
STR R1 (SP) ; PFP to top of stack
MOV R0 PC ; PC incremented by 1 instruction
ADI R0 120 ; Compute return address ; 20 * lines below
ADI R1 -4 ; FP - 4
STR R0 (R1) ; Return address to the beginning of the frame
; Add any other vars you need here
ADI R1 -4
LDB R0 A
STR R0 (R1)
JMP FN1
MOV R1 SP ; Test for overflow
ADI R1 -8 ; Adjust for Rtn address & PFP
CMP R1 SL
BLT R1 OVERFLOW
MOV R1 FP ; Save FP in R1, this will be PFP
MOV FP SP ; Point at current activation record
ADI SP -8 ; Adjust SP for ret address
STR R1 (SP) ; PFP to top of stack
MOV R0 PC ; PC incremented by 1 instruction
ADI R0 120 ; Compute return address
ADI R1 -4 ; FP - 4
STR R0 (R1) ; Return address to the beginning of the frame
; Add any other vars you need here
ADI R1 -4
LDB R0 A
ADI R0 2
STR R0 (R1)
JMP FN1
MOV R1 SP ; Test for overflow
ADI R1 -8 ; Adjust for Rtn address & PFP
CMP R1 SL
BLT R1 OVERFLOW
MOV R1 FP ; Save FP in R1, this will be PFP
MOV FP SP ; Point at current activation record
ADI SP -8 ; Adjust SP for ret address
STR R1 (SP) ; PFP to top of stack
MOV R0 PC ; PC incremented by 1 instruction
ADI R0 120 ; Compute return address
ADI R1 -4 ; FP - 4
STR R0 (R1) ; Return address to the beginning of the frame
; Add any other vars you need here
ADI R1 -4
LDB R0 A
ADI R0 3
STR R0 (R1)
JMP FN1
OVERFLOW TRP 0
UNDERFLOW TRP 0
|
programs/oeis/246/A246262.asm | jmorken/loda | 1 | 2294 | <reponame>jmorken/loda<gh_stars>1-10
; A246262: Inverse function to injection A246261, partial sums of A246260.
; 0,1,1,2,3,3,3,3,3,4,5,6,7,8,9,9,10,10,10,10,10,10,10,11,11,12,12,13,13,13,14,15,15,16,17,18,19,20,21,22,23,23,24,24,25,25,25,26,27,28,28,28,29,29,29,29,30,30,31,32,32,32,32,32,33,33,33,33,33,34,34,35,35,35,35,36,36,36,36,36,36,37,38,39,39,40,41,41,41,42,43,43,44,45,45,46,46,47,47,48,49,49,50,50,50,51,52,53,54,55,56,57,57,57,58,58,58,59,59,60,61,62,63,63,64,64,65,65,65,65,66,67,68,69,70,70,71,71,71,72,73,74,74,75,76,77,78,79,80,80,80,81,82,82,83,83,84,84,85,85,86,86,86,86,86,86,86,87,88,89,89,89,89,89,90,90,91,92,92,93,93,93,94,94,94,94,94,94,95,95,95,96,97,98,98,98,99,99,99,99,99,99,100,101,101,102,103,104,105,105,105,105,105,106,106,107,107,107,107,107,107,107,107,107,108,109,110,111,111,112,113,113,114,114,114,114,115,115,115,116,116,116,116,117,117,117,118,118,118,119
mov $1,$0
cal $0,246264 ; Inverse function for injection A246263.
mul $0,5
add $1,1
mov $2,5
mul $2,$1
sub $0,$2
gcd $0,0
mov $1,$0
sub $1,5
div $1,5
|
library/01_raw_disassembly/06_section_reloc.asm | SamantazFox/dds140-reverse-engineering | 1 | 175280 | <gh_stars>1-10
10018000 <.reloc>:
10018000: 00 10 add BYTE PTR [eax],dl
10018002: 00 00 add BYTE PTR [eax],al
10018004: 28 01 sub BYTE PTR [ecx],al
10018006: 00 00 add BYTE PTR [eax],al
10018008: 10 30 adc BYTE PTR [eax],dh
1001800a: 25 30 2c 30 39 and eax,0x39302c30
1001800f: 30 42 30 xor BYTE PTR [edx+0x30],al
10018012: 50 push eax
10018013: 30 62 30 xor BYTE PTR [edx+0x30],ah
10018016: 68 30 85 30 90 push 0x90308530
1001801b: 30 a7 30 ae 30 c3 xor BYTE PTR [edi-0x3ccf51d0],ah
10018021: 30 ca xor dl,cl
10018023: 30 cf xor bh,cl
10018025: 30 db xor bl,bl
10018027: 30 e0 xor al,ah
10018029: 30 f2 xor dl,dh
1001802b: 30 05 31 19 31 2e xor BYTE PTR ds:0x2e311931,al
10018031: 31 3b xor DWORD PTR [ebx],edi
10018033: 31 41 31 xor DWORD PTR [ecx+0x31],eax
10018036: 4b dec ebx
10018037: 31 51 31 xor DWORD PTR [ecx+0x31],edx
1001803a: 56 push esi
1001803b: 31 61 31 xor DWORD PTR [ecx+0x31],esp
1001803e: 7d 31 jge 0x10018071
10018040: 83 31 89 xor DWORD PTR [ecx],0xffffff89
10018043: 31 a9 31 b1 31 b9 xor DWORD PTR [ecx-0x46ce4ecf],ebp
10018049: 31 d4 xor esp,edx
1001804b: 31 da xor edx,ebx
1001804d: 31 e4 xor esp,esp
1001804f: 31 ed xor ebp,ebp
10018051: 31 06 xor DWORD PTR [esi],eax
10018053: 32 0d 32 31 32 3c xor cl,BYTE PTR ds:0x3c323132
10018059: 32 42 32 xor al,BYTE PTR [edx+0x32]
1001805c: 48 dec eax
1001805d: 32 60 32 xor ah,BYTE PTR [eax+0x32]
10018060: 8f (bad)
10018061: 32 99 32 b1 32 f0 xor bl,BYTE PTR [ecx-0xfcd4ece]
10018067: 32 f6 xor dh,dh
10018069: 32 16 xor dl,BYTE PTR [esi]
1001806b: 33 43 33 xor eax,DWORD PTR [ebx+0x33]
1001806e: 4b dec ebx
1001806f: 33 53 33 xor edx,DWORD PTR [ebx+0x33]
10018072: 5a pop edx
10018073: 33 62 33 xor esp,DWORD PTR [edx+0x33]
10018076: 7b 33 jnp 0x100180ab
10018078: a6 cmps BYTE PTR ds:[esi],BYTE PTR es:[edi]
10018079: 33 fb xor edi,ebx
1001807b: 33 15 34 84 34 a7 xor edx,DWORD PTR ds:0xa7348434
10018081: 34 c1 xor al,0xc1
10018083: 34 f4 xor al,0xf4
10018085: 34 12 xor al,0x12
10018087: 35 29 35 30 35 xor eax,0x35303529
1001808c: 57 push edi
1001808d: 35 62 35 8a 35 xor eax,0x358a3562
10018092: 0b 36 or esi,DWORD PTR [esi]
10018094: 2d 36 66 36 85 sub eax,0x85366636
10018099: 36 90 ss nop
1001809b: 36 97 ss xchg edi,eax
1001809d: 36 a2 36 bb 36 dd mov ss:0xdd36bb36,al
100180a3: 36 e8 36 fe 36 3c ss call 0x4c387edf
100180a9: 37 aaa
100180aa: 42 inc edx
100180ab: 37 aaa
100180ac: 4b dec ebx
100180ad: 37 aaa
100180ae: 54 push esp
100180af: 37 aaa
100180b0: 6a 37 push 0x37
100180b2: 7c 37 jl 0x100180eb
100180b4: a5 movs DWORD PTR es:[edi],DWORD PTR ds:[esi]
100180b5: 37 aaa
100180b6: e9 37 03 38 36 jmp 0x463983f2
100180bb: 38 4b 38 cmp BYTE PTR [ebx+0x38],cl
100180be: 54 push esp
100180bf: 38 72 38 cmp BYTE PTR [edx+0x38],dh
100180c2: a1 38 b2 38 ef mov eax,ds:0xef38b238
100180c7: 38 03 cmp BYTE PTR [ebx],al
100180c9: 39 1e cmp DWORD PTR [esi],ebx
100180cb: 39 31 cmp DWORD PTR [ecx],esi
100180cd: 39 4b 39 cmp DWORD PTR [ebx+0x39],ecx
100180d0: 6f outs dx,DWORD PTR ds:[esi]
100180d1: 39 a8 39 b1 39 c6 cmp DWORD PTR [eax-0x39c64ec7],ebp
100180d7: 39 e0 cmp eax,esp
100180d9: 39 22 cmp DWORD PTR [edx],esp
100180db: 3a 28 cmp ch,BYTE PTR [eax]
100180dd: 3a 35 3a 3e 3a 6c cmp dh,BYTE PTR ds:0x6c3a3e3a
100180e3: 3a 99 3a f2 3a 0c cmp bl,BYTE PTR [ecx+0xc3af23a]
100180e9: 3b 8d 3b ad 3b c7 cmp ecx,DWORD PTR [ebp-0x38c452c5]
100180ef: 3b 00 cmp eax,DWORD PTR [eax]
100180f1: 3c 23 cmp al,0x23
100180f3: 3c 38 cmp al,0x38
100180f5: 3c 3f cmp al,0x3f
100180f7: 3c 64 cmp al,0x64
100180f9: 3c a5 cmp al,0xa5
100180fb: 3c bf cmp al,0xbf
100180fd: 3c 01 cmp al,0x1
100180ff: 3d 09 3d 34 3d cmp eax,0x3d343d09
10018104: 5d pop ebp
10018105: 3d b0 3d ca 3d cmp eax,0x3dca3db0
1001810a: 3d 3e 5c 3e 76 cmp eax,0x763e5c3e
1001810f: 3e a9 3e c7 3e dc ds test eax,0xdc3ec73e
10018115: 3e e3 3e ds jecxz 0x10018156
10018118: 03 3f add edi,DWORD PTR [edi]
1001811a: 42 inc edx
1001811b: 3f aas
1001811c: 59 pop ecx
1001811d: 3f aas
1001811e: 97 xchg edi,eax
1001811f: 3f aas
10018120: a4 movs BYTE PTR es:[edi],BYTE PTR ds:[esi]
10018121: 3f aas
10018122: f2 3f repnz aas
10018124: fa cli
10018125: 3f aas
10018126: 00 00 add BYTE PTR [eax],al
10018128: 00 20 add BYTE PTR [eax],ah
1001812a: 00 00 add BYTE PTR [eax],al
1001812c: 74 01 je 0x1001812f
1001812e: 00 00 add BYTE PTR [eax],al
10018130: 04 30 add al,0x30
10018132: 18 30 sbb BYTE PTR [eax],dh
10018134: 2c 30 sub al,0x30
10018136: 40 inc eax
10018137: 30 55 30 xor BYTE PTR [ebp+0x30],dl
1001813a: 5f pop edi
1001813b: 30 73 30 xor BYTE PTR [ebx+0x30],dh
1001813e: 87 30 xchg DWORD PTR [eax],esi
10018140: 9b fwait
10018141: 30 b0 30 bb 30 c6 xor BYTE PTR [eax-0x39cf44d0],dh
10018147: 30 d1 xor cl,dl
10018149: 30 dc xor ah,bl
1001814b: 30 e7 xor bh,ah
1001814d: 30 f2 xor dl,dh
1001814f: 30 fd xor ch,bh
10018151: 30 08 xor BYTE PTR [eax],cl
10018153: 31 13 xor DWORD PTR [ebx],edx
10018155: 31 1c 31 xor DWORD PTR [ecx+esi*1],ebx
10018158: 20 31 and BYTE PTR [ecx],dh
1001815a: 24 31 and al,0x31
1001815c: 28 31 sub BYTE PTR [ecx],dh
1001815e: 2c 31 sub al,0x31
10018160: 30 31 xor BYTE PTR [ecx],dh
10018162: 34 31 xor al,0x31
10018164: 38 31 cmp BYTE PTR [ecx],dh
10018166: 3c 31 cmp al,0x31
10018168: 40 inc eax
10018169: 31 44 31 48 xor DWORD PTR [ecx+esi*1+0x48],eax
1001816d: 31 4c 31 50 xor DWORD PTR [ecx+esi*1+0x50],ecx
10018171: 31 54 31 58 xor DWORD PTR [ecx+esi*1+0x58],edx
10018175: 31 5c 31 60 xor DWORD PTR [ecx+esi*1+0x60],ebx
10018179: 31 64 31 68 xor DWORD PTR [ecx+esi*1+0x68],esp
1001817d: 31 80 31 8a 31 b4 xor DWORD PTR [eax-0x4bce75cf],eax
10018183: 31 e3 xor ebx,esp
10018185: 31 12 xor DWORD PTR [edx],edx
10018187: 32 40 32 xor al,BYTE PTR [eax+0x32]
1001818a: 51 push ecx
1001818b: 32 7c 32 ab xor bh,BYTE PTR [edx+esi*1-0x55]
1001818f: 32 d9 xor bl,cl
10018191: 32 08 xor cl,BYTE PTR [eax]
10018193: 33 14 33 xor edx,DWORD PTR [ebx+esi*1]
10018196: 18 33 sbb BYTE PTR [ebx],dh
10018198: 1c 33 sbb al,0x33
1001819a: 20 33 and BYTE PTR [ebx],dh
1001819c: 24 33 and al,0x33
1001819e: 28 33 sub BYTE PTR [ebx],dh
100181a0: 2c 33 sub al,0x33
100181a2: 30 33 xor BYTE PTR [ebx],dh
100181a4: 34 33 xor al,0x33
100181a6: 38 33 cmp BYTE PTR [ebx],dh
100181a8: 4e dec esi
100181a9: 33 55 33 xor edx,DWORD PTR [ebp+0x33]
100181ac: 97 xchg edi,eax
100181ad: 33 ce xor ecx,esi
100181af: 33 dd xor ebx,ebp
100181b1: 33 04 34 xor eax,DWORD PTR [esp+esi*1]
100181b4: 0a 34 28 or dh,BYTE PTR [eax+ebp*1]
100181b7: 34 39 xor al,0x39
100181b9: 34 4c xor al,0x4c
100181bb: 34 63 xor al,0x63
100181bd: 34 6a xor al,0x6a
100181bf: 34 8d xor al,0x8d
100181c1: 34 94 xor al,0x94
100181c3: 34 ba xor al,0xba
100181c5: 34 c1 xor al,0xc1
100181c7: 34 e7 xor al,0xe7
100181c9: 34 ee xor al,0xee
100181cb: 34 1f xor al,0x1f
100181cd: 35 35 35 45 35 xor eax,0x35453535
100181d2: 4d dec ebp
100181d3: 35 70 35 b5 35 xor eax,0x35b53570
100181d8: e9 35 0f 36 1a jmp 0x2a379112
100181dd: 36 24 36 ss and al,0x36
100181e0: 4f dec edi
100181e1: 36 a3 36 af 36 bf mov ss:0xbf36af36,eax
100181e7: 36 d2 36 shl BYTE PTR ss:[esi],cl
100181ea: e2 36 loop 0x10018222
100181ec: 0c 37 or al,0x37
100181ee: 16 push ss
100181ef: 37 aaa
100181f0: 1e push ds
100181f1: 37 aaa
100181f2: 2e 37 cs aaa
100181f4: 34 37 xor al,0x37
100181f6: 3e 37 ds aaa
100181f8: 4d dec ebp
100181f9: 37 aaa
100181fa: 55 push ebp
100181fb: 37 aaa
100181fc: 7a 37 jp 0x10018235
100181fe: 80 37 8a xor BYTE PTR [edi],0x8a
10018201: 37 aaa
10018202: bf 37 52 38 58 mov edi,0x58385237
10018207: 38 5e 38 cmp BYTE PTR [esi+0x38],bl
1001820a: 76 38 jbe 0x10018244
1001820c: 7c 38 jl 0x10018246
1001820e: 84 38 test BYTE PTR [eax],bh
10018210: 8a 38 mov bh,BYTE PTR [eax]
10018212: 92 xchg edx,eax
10018213: 38 c5 cmp ch,al
10018215: 38 d5 cmp ch,dl
10018217: 38 3f cmp BYTE PTR [edi],bh
10018219: 39 45 39 cmp DWORD PTR [ebp+0x39],eax
1001821c: 4b dec ebx
1001821d: 39 bf 39 c5 39 d1 cmp DWORD PTR [edi-0x2ec63ac7],edi
10018223: 39 d7 cmp edi,edx
10018225: 39 dd cmp ebp,ebx
10018227: 39 e3 cmp ebx,esp
10018229: 39 e9 cmp ecx,ebp
1001822b: 39 10 cmp DWORD PTR [eax],edx
1001822d: 3a 16 cmp dl,BYTE PTR [esi]
1001822f: 3a 35 3a 43 3a 60 cmp dh,BYTE PTR ds:0x603a433a
10018235: 3a 73 3a cmp dh,BYTE PTR [ebx+0x3a]
10018238: 7a 3a jp 0x10018274
1001823a: 9d popf
1001823b: 3a a4 3a ca 3a d1 3a cmp ah,BYTE PTR [edx+edi*1+0x3ad13aca]
10018242: f7 3a idiv DWORD PTR [edx]
10018244: fe (bad)
10018245: 3a 33 cmp dh,BYTE PTR [ebx]
10018247: 3b 49 3b cmp ecx,DWORD PTR [ecx+0x3b]
1001824a: 59 pop ecx
1001824b: 3b 61 3b cmp esp,DWORD PTR [ecx+0x3b]
1001824e: 88 3b mov BYTE PTR [ebx],bh
10018250: cc int3
10018251: 3b 02 cmp eax,DWORD PTR [edx]
10018253: 3c 28 cmp al,0x28
10018255: 3c 33 cmp al,0x33
10018257: 3c 3d cmp al,0x3d
10018259: 3c 9a cmp al,0x9a
1001825b: 3c 06 cmp al,0x6
1001825d: 3d 0e 3d 33 3d cmp eax,0x3d333d0e
10018262: 39 3d 43 3d 78 3d cmp DWORD PTR ds:0x3d783d43,edi
10018268: 03 3e add edi,DWORD PTR [esi]
1001826a: 09 3e or DWORD PTR [esi],edi
1001826c: 0f 3e (bad)
1001826e: 23 3e and edi,DWORD PTR [esi]
10018270: 29 3e sub DWORD PTR [esi],edi
10018272: 31 3e xor DWORD PTR [esi],edi
10018274: 37 aaa
10018275: 3e 41 ds inc ecx
10018277: 3e 6e outs dx,BYTE PTR ds:[esi]
10018279: 3e 7e 3e ds jle 0x100182ba
1001827c: e8 3e ee 3e f4 call 0x44070bf
10018281: 3e 60 ds pusha
10018283: 3f aas
10018284: 76 3f jbe 0x100182c5
10018286: 7c 3f jl 0x100182c7
10018288: 90 nop
10018289: 3f aas
1001828a: 96 xchg esi,eax
1001828b: 3f aas
1001828c: 9c pushf
1001828d: 3f aas
1001828e: a2 3f c2 3f cd mov ds:0xcd3fc23f,al
10018293: 3f aas
10018294: e2 3f loop 0x100182d5
10018296: ef out dx,eax
10018297: 3f aas
10018298: f8 clc
10018299: 3f aas
1001829a: 00 00 add BYTE PTR [eax],al
1001829c: 00 30 add BYTE PTR [eax],dh
1001829e: 00 00 add BYTE PTR [eax],al
100182a0: 38 01 cmp BYTE PTR [ecx],al
100182a2: 00 00 add BYTE PTR [eax],al
100182a4: 46 inc esi
100182a5: 30 50 30 xor BYTE PTR [eax+0x30],dl
100182a8: 60 pusha
100182a9: 30 79 30 xor BYTE PTR [ecx+0x30],bh
100182ac: 88 30 mov BYTE PTR [eax],dh
100182ae: 95 xchg ebp,eax
100182af: 30 a8 30 b4 30 c2 xor BYTE PTR [eax-0x3dcf4bd0],ch
100182b5: 30 ce xor dh,cl
100182b7: 30 e4 xor ah,ah
100182b9: 30 ec xor ah,ch
100182bb: 30 fd xor ch,bh
100182bd: 30 a6 31 ae 31 45 xor BYTE PTR [esi+0x4531ae31],ah
100182c3: 32 5e 32 xor bl,BYTE PTR [esi+0x32]
100182c6: 78 32 js 0x100182fa
100182c8: 80 32 23 xor BYTE PTR [edx],0x23
100182cb: 33 2b xor ebp,DWORD PTR [ebx]
100182cd: 33 b3 33 bd 33 d7 xor esi,DWORD PTR [ebx-0x28cc42cd]
100182d3: 33 02 xor eax,DWORD PTR [edx]
100182d5: 34 35 xor al,0x35
100182d7: 34 70 xor al,0x70
100182d9: 34 a5 xor al,0xa5
100182db: 34 ae xor al,0xae
100182dd: 34 b6 xor al,0xb6
100182df: 34 bb xor al,0xbb
100182e1: 34 e2 xor al,0xe2
100182e3: 34 f2 xor al,0xf2
100182e5: 34 00 xor al,0x0
100182e7: 35 13 35 1b 35 xor eax,0x351b3513
100182ec: 22 35 44 35 56 35 and dh,BYTE PTR ds:0x35563544
100182f2: 64 35 77 35 8c 35 fs xor eax,0x358c3577
100182f8: 95 xchg ebp,eax
100182f9: 35 e9 35 07 36 xor eax,0x360735e9
100182fe: 0c 36 or al,0x36
10018300: 13 36 adc esi,DWORD PTR [esi]
10018302: 1f pop ds
10018303: 36 31 36 xor DWORD PTR ss:[esi],esi
10018306: 41 inc ecx
10018307: 36 4f ss dec edi
10018309: 36 54 ss push esp
1001830b: 36 72 36 ss jb 0x10018344
1001830e: 9e sahf
1001830f: 36 b9 36 cb 36 e4 ss mov ecx,0xe436cb36
10018315: 36 e9 36 f8 36 03 ss jmp 0x13387b51
1001831b: 37 aaa
1001831c: 0d 37 15 37 22 or eax,0x22371537
10018321: 37 aaa
10018322: 28 37 sub BYTE PTR [edi],dh
10018324: 51 push ecx
10018325: 37 aaa
10018326: 66 37 data16 aaa
10018328: 79 37 jns 0x10018361
1001832a: 89 37 mov DWORD PTR [edi],esi
1001832c: 90 nop
1001832d: 37 aaa
1001832e: 96 xchg esi,eax
1001832f: 37 aaa
10018330: ac lods al,BYTE PTR ds:[esi]
10018331: 37 aaa
10018332: b1 37 mov cl,0x37
10018334: c2 37 d1 ret 0xd137
10018337: 37 aaa
10018338: d6 (bad)
10018339: 37 aaa
1001833a: f4 hlt
1001833b: 37 aaa
1001833c: fb sti
1001833d: 37 aaa
1001833e: 04 38 add al,0x38
10018340: 18 38 sbb BYTE PTR [eax],bh
10018342: 1e push ds
10018343: 38 24 38 cmp BYTE PTR [eax+edi*1],ah
10018346: 2a 38 sub bh,BYTE PTR [eax]
10018348: 30 38 xor BYTE PTR [eax],bh
1001834a: 36 38 3c 38 cmp BYTE PTR ss:[eax+edi*1],bh
1001834e: 42 inc edx
1001834f: 38 48 38 cmp BYTE PTR [eax+0x38],cl
10018352: 4e dec esi
10018353: 38 53 38 cmp BYTE PTR [ebx+0x38],dl
10018356: 59 pop ecx
10018357: 38 5d 38 cmp BYTE PTR [ebp+0x38],bl
1001835a: 63 38 arpl WORD PTR [eax],di
1001835c: 67 38 6d 38 cmp BYTE PTR [di+0x38],ch
10018360: 71 38 jno 0x1001839a
10018362: 77 38 ja 0x1001839c
10018364: 7b 38 jnp 0x1001839e
10018366: 80 38 86 cmp BYTE PTR [eax],0x86
10018369: 38 8a 38 90 38 94 cmp BYTE PTR [edx-0x6bc76fc8],cl
1001836f: 38 9a 38 9e 38 a4 cmp BYTE PTR [edx-0x5bc761c8],bl
10018375: 38 a8 38 bd 38 d2 cmp BYTE PTR [eax-0x2dc742c8],ch
1001837b: 38 ee cmp dh,ch
1001837d: 38 7e 39 cmp BYTE PTR [esi+0x39],bh
10018380: 90 nop
10018381: 39 df cmp edi,ebx
10018383: 39 e5 cmp ebp,esp
10018385: 39 f6 cmp esi,esi
10018387: 39 0c 3a cmp DWORD PTR [edx+edi*1],ecx
1001838a: 1e push ds
1001838b: 3a 69 3a cmp ch,BYTE PTR [ecx+0x3a]
1001838e: 73 3a jae 0x100183ca
10018390: 94 xchg esp,eax
10018391: 3a cc cmp cl,ah
10018393: 3a da cmp bl,dl
10018395: 3a 1d 3b 3f 3b 50 cmp bl,BYTE PTR ds:0x503b3f3b
1001839b: 3b 66 3b cmp esp,DWORD PTR [esi+0x3b]
1001839e: 76 3b jbe 0x100183db
100183a0: 9c pushf
100183a1: 3b b2 3b c4 3b c9 cmp esi,DWORD PTR [edx-0x36c43bc5]
100183a7: 3b cf cmp ecx,edi
100183a9: 3b d5 cmp edx,ebp
100183ab: 3b 01 cmp eax,DWORD PTR [ecx]
100183ad: 3c 06 cmp al,0x6
100183af: 3c 10 cmp al,0x10
100183b1: 3c 44 cmp al,0x44
100183b3: 3c 5c cmp al,0x5c
100183b5: 3c 68 cmp al,0x68
100183b7: 3c 6e cmp al,0x6e
100183b9: 3c b4 cmp al,0xb4
100183bb: 3c ba cmp al,0xba
100183bd: 3c d5 cmp al,0xd5
100183bf: 3c 06 cmp al,0x6
100183c1: 3d 22 3d 3a 3d cmp eax,0x3d3a3d22
100183c6: 8d 3d ba 3d 40 3e lea edi,ds:0x3e403dba
100183cc: 48 dec eax
100183cd: 3e 5d ds pop ebp
100183cf: 3e 68 3e 00 00 00 ds push 0x3e
100183d5: 40 inc eax
100183d6: 00 00 add BYTE PTR [eax],al
100183d8: 90 nop
100183d9: 00 00 add BYTE PTR [eax],al
100183db: 00 0c 31 add BYTE PTR [ecx+esi*1],cl
100183de: 71 31 jno 0x10018411
100183e0: a7 cmps DWORD PTR ds:[esi],DWORD PTR es:[edi]
100183e1: 31 f9 xor ecx,edi
100183e3: 36 b2 37 ss mov dl,0x37
100183e6: 50 push eax
100183e7: 39 9a 39 a3 39 cf cmp DWORD PTR [edx-0x30c65cc7],ebx
100183ed: 39 d5 cmp ebp,edx
100183ef: 39 de cmp esi,ebx
100183f1: 39 e5 cmp ebp,esp
100183f3: 39 f9 cmp ecx,edi
100183f5: 39 04 3a cmp DWORD PTR [edx+edi*1],eax
100183f8: 14 3a adc al,0x3a
100183fa: 2f das
100183fb: 3a 50 3a cmp dl,BYTE PTR [eax+0x3a]
100183fe: c7 (bad)
100183ff: 3a ce cmp cl,dh
10018401: 3a e0 cmp ah,al
10018403: 3a f7 cmp dh,bh
10018405: 3a fd cmp bh,ch
10018407: 3a 03 cmp al,BYTE PTR [ebx]
10018409: 3b 13 cmp edx,DWORD PTR [ebx]
1001840b: 3b 1d 3b 26 3b 2f cmp ebx,DWORD PTR ds:0x2f3b263b
10018411: 3b 41 3b cmp eax,DWORD PTR [ecx+0x3b]
10018414: 4a dec edx
10018415: 3b 56 3b cmp edx,DWORD PTR [esi+0x3b]
10018418: 5f pop edi
10018419: 3b 66 3b cmp esp,DWORD PTR [esi+0x3b]
1001841c: 70 3b jo 0x10018459
1001841e: 76 3b jbe 0x1001845b
10018420: 7c 3b jl 0x1001845d
10018422: 87 3b xchg DWORD PTR [ebx],edi
10018424: 8e 3b mov ?,WORD PTR [ebx]
10018426: 98 cwde
10018427: 3b c2 cmp eax,edx
10018429: 3b ce cmp ecx,esi
1001842b: 3b d4 cmp edx,esp
1001842d: 3b f7 cmp esi,edi
1001842f: 3b fe cmp edi,esi
10018431: 3b 17 cmp edx,DWORD PTR [edi]
10018433: 3c 29 cmp al,0x29
10018435: 3c 2f cmp al,0x2f
10018437: 3c 38 cmp al,0x38
10018439: 3c 4b cmp al,0x4b
1001843b: 3c 6f cmp al,0x6f
1001843d: 3c 02 cmp al,0x2
1001843f: 3d 22 3d 32 3d cmp eax,0x3d323d22
10018444: 38 3d 3f 3d 4c 3d cmp BYTE PTR ds:0x3d4c3d3f,bh
1001844a: 53 push ebx
1001844b: 3d 59 3d 61 3d cmp eax,0x3d613d59
10018450: 67 3d 73 3d 78 3d addr16 cmp eax,0x3d783d73
10018456: b9 3f c7 3f cd mov ecx,0xcd3fc73f
1001845b: 3f aas
1001845c: e7 3f out 0x3f,eax
1001845e: ec in al,dx
1001845f: 3f aas
10018460: fb sti
10018461: 3f aas
10018462: 00 00 add BYTE PTR [eax],al
10018464: 00 50 00 add BYTE PTR [eax+0x0],dl
10018467: 00 08 add BYTE PTR [eax],cl
10018469: 01 00 add DWORD PTR [eax],eax
1001846b: 00 04 30 add BYTE PTR [eax+esi*1],al
1001846e: 11 30 adc DWORD PTR [eax],esi
10018470: 1c 30 sbb al,0x30
10018472: 2e 30 41 30 xor BYTE PTR cs:[ecx+0x30],al
10018476: 4c dec esp
10018477: 30 52 30 xor BYTE PTR [edx+0x30],dl
1001847a: 58 pop eax
1001847b: 30 5d 30 xor BYTE PTR [ebp+0x30],bl
1001847e: 66 30 83 30 89 30 94 data16 xor BYTE PTR [ebx-0x6bcf76d0],al
10018485: 30 99 30 a1 30 a7 xor BYTE PTR [ecx-0x58cf5ed0],bl
1001848b: 30 b1 30 b8 30 cc xor BYTE PTR [ecx-0x33cf47d0],dh
10018491: 30 d3 xor bl,dl
10018493: 30 d9 xor cl,bl
10018495: 30 e7 xor bh,ah
10018497: 30 ee xor dh,ch
10018499: 30 f3 xor bl,dh
1001849b: 30 fc xor ah,bh
1001849d: 30 09 xor BYTE PTR [ecx],cl
1001849f: 31 0f xor DWORD PTR [edi],ecx
100184a1: 31 29 xor DWORD PTR [ecx],ebp
100184a3: 31 3a xor DWORD PTR [edx],edi
100184a5: 31 40 31 xor DWORD PTR [eax+0x31],eax
100184a8: 51 push ecx
100184a9: 31 b4 31 4c 35 58 35 xor DWORD PTR [ecx+esi*1+0x3558354c],esi
100184b0: 8b 35 b1 35 eb 35 mov esi,DWORD PTR ds:0x35eb35b1
100184b6: 30 36 xor BYTE PTR [esi],dh
100184b8: 03 38 add edi,DWORD PTR [eax]
100184ba: 0e push cs
100184bb: 38 16 cmp BYTE PTR [esi],dl
100184bd: 38 29 cmp BYTE PTR [ecx],ch
100184bf: 38 46 38 cmp BYTE PTR [esi+0x38],al
100184c2: 9f lahf
100184c3: 38 83 39 8b 39 a4 cmp BYTE PTR [ebx-0x5bc674c7],al
100184c9: 39 be 39 10 3a 36 cmp DWORD PTR [esi+0x363a1039],edi
100184cf: 3a 4b 3a cmp cl,BYTE PTR [ebx+0x3a]
100184d2: 51 push ecx
100184d3: 3a 5a 3a cmp bl,BYTE PTR [edx+0x3a]
100184d6: 61 popa
100184d7: 3a 80 3a f8 3a 30 cmp al,BYTE PTR [eax+0x303af83a]
100184dd: 3b 38 cmp edi,DWORD PTR [eax]
100184df: 3b 44 3b 4c cmp eax,DWORD PTR [ebx+edi*1+0x4c]
100184e3: 3b 60 3b cmp esp,DWORD PTR [eax+0x3b]
100184e6: 6b 3b 70 imul edi,DWORD PTR [ebx],0x70
100184e9: 3b 82 3b 8c 3b 93 cmp eax,DWORD PTR [edx-0x6cc473c5]
100184ef: 3b ad 3b b7 3b cd cmp ebp,DWORD PTR [ebp-0x32c448c5]
100184f5: 3b d7 cmp edx,edi
100184f7: 3b f2 cmp esi,edx
100184f9: 3b fa cmp edi,edx
100184fb: 3b 02 cmp eax,DWORD PTR [edx]
100184fd: 3c 0d cmp al,0xd
100184ff: 3c 1b cmp al,0x1b
10018501: 3c 57 cmp al,0x57
10018503: 3c 5c cmp al,0x5c
10018505: 3c 67 cmp al,0x67
10018507: 3c 6c cmp al,0x6c
10018509: 3c 8a cmp al,0x8a
1001850b: 3c 0f cmp al,0xf
1001850d: 3d 1c 3d 31 3d cmp eax,0x3d313d1c
10018512: 66 3d 7e 3d cmp ax,0x3d7e
10018516: 89 3d ad 3d b6 3d mov DWORD PTR ds:0x3db63dad,edi
1001851c: bd 3d c6 3d 06 mov ebp,0x63dc63d
10018521: 3e 0b 3e or edi,DWORD PTR ds:[esi]
10018524: 33 3e xor edi,DWORD PTR [esi]
10018526: 55 push ebp
10018527: 3e 7a 3e ds jp 0x10018568
1001852a: 8d 3e lea edi,[esi]
1001852c: a6 cmps BYTE PTR ds:[esi],BYTE PTR es:[edi]
1001852d: 3e b8 3e dd 3e 00 ds mov eax,0x3edd3e
10018533: 3f aas
10018534: 07 pop es
10018535: 3f aas
10018536: 31 3f xor DWORD PTR [edi],edi
10018538: 37 aaa
10018539: 3f aas
1001853a: 3d 3f 43 3f 49 cmp eax,0x493f433f
1001853f: 3f aas
10018540: 4f dec edi
10018541: 3f aas
10018542: 56 push esi
10018543: 3f aas
10018544: 5d pop ebp
10018545: 3f aas
10018546: 64 3f fs aas
10018548: 6b 3f 72 imul edi,DWORD PTR [edi],0x72
1001854b: 3f aas
1001854c: 79 3f jns 0x1001858d
1001854e: 80 3f 88 cmp BYTE PTR [edi],0x88
10018551: 3f aas
10018552: 90 nop
10018553: 3f aas
10018554: 98 cwde
10018555: 3f aas
10018556: a4 movs BYTE PTR es:[edi],BYTE PTR ds:[esi]
10018557: 3f aas
10018558: ad lods eax,DWORD PTR ds:[esi]
10018559: 3f aas
1001855a: b2 3f mov dl,0x3f
1001855c: b8 3f c2 3f cb mov eax,0xcb3fc23f
10018561: 3f aas
10018562: d6 (bad)
10018563: 3f aas
10018564: e2 3f loop 0x100185a5
10018566: e7 3f out 0x3f,eax
10018568: f7 3f idiv DWORD PTR [edi]
1001856a: fc cld
1001856b: 3f aas
1001856c: 00 60 00 add BYTE PTR [eax+0x0],ah
1001856f: 00 5c 01 00 add BYTE PTR [ecx+eax*1+0x0],bl
10018573: 00 02 add BYTE PTR [edx],al
10018575: 30 08 xor BYTE PTR [eax],cl
10018577: 30 1e xor BYTE PTR [esi],bl
10018579: 30 25 30 55 30 6e xor BYTE PTR ds:0x6e305530,ah
1001857f: 30 9a 30 a0 30 ab xor BYTE PTR [edx-0x54cf5fd0],bl
10018585: 30 b7 30 cc 30 d2 xor BYTE PTR [edi-0x2dcf33d0],dh
1001858b: 30 e6 xor dh,ah
1001858d: 30 ed xor ch,ch
1001858f: 30 11 xor BYTE PTR [ecx],dl
10018591: 31 17 xor DWORD PTR [edi],edx
10018593: 31 22 xor DWORD PTR [edx],esp
10018595: 31 2e xor DWORD PTR [esi],ebp
10018597: 31 43 31 xor DWORD PTR [ebx+0x31],eax
1001859a: 49 dec ecx
1001859b: 31 5d 31 xor DWORD PTR [ebp+0x31],ebx
1001859e: 64 31 7e 31 xor DWORD PTR fs:[esi+0x31],edi
100185a2: 88 31 mov BYTE PTR [ecx],dh
100185a4: 8e 31 mov ?,WORD PTR [ecx]
100185a6: 9a 31 a9 31 af 31 b8 call 0xb831:0xaf31a931
100185ad: 31 c4 xor esp,eax
100185af: 31 d2 xor edx,edx
100185b1: 31 d8 xor eax,ebx
100185b3: 31 e4 xor esp,esp
100185b5: 31 ea xor edx,ebp
100185b7: 31 f7 xor edi,esi
100185b9: 31 01 xor DWORD PTR [ecx],eax
100185bb: 32 07 xor al,BYTE PTR [edi]
100185bd: 32 14 32 xor dl,BYTE PTR [edx+esi*1]
100185c0: 2c 32 sub al,0x32
100185c2: 35 32 42 32 63 xor eax,0x63324232
100185c7: 32 6d 32 xor ch,BYTE PTR [ebp+0x32]
100185ca: 88 32 mov BYTE PTR [edx],dh
100185cc: b7 32 mov bh,0x32
100185ce: bd 32 e7 32 ed mov ebp,0xed32e732
100185d3: 32 09 xor cl,BYTE PTR [ecx]
100185d5: 33 21 xor esp,DWORD PTR [ecx]
100185d7: 33 45 33 xor eax,DWORD PTR [ebp+0x33]
100185da: b1 33 mov cl,0x33
100185dc: d4 33 aam 0x33
100185de: de 33 fidiv WORD PTR [ebx]
100185e0: 16 push ss
100185e1: 34 1e xor al,0x1e
100185e3: 34 65 xor al,0x65
100185e5: 34 78 xor al,0x78
100185e7: 34 7e xor al,0x7e
100185e9: 34 8a xor al,0x8a
100185eb: 34 90 xor al,0x90
100185ed: 34 9f xor al,0x9f
100185ef: 34 a5 xor al,0xa5
100185f1: 34 b9 xor al,0xb9
100185f3: 34 c7 xor al,0xc7
100185f5: 34 ce xor al,0xce
100185f7: 34 d4 xor al,0xd4
100185f9: 34 ea xor al,0xea
100185fb: 34 ef xor al,0xef
100185fd: 34 f7 xor al,0xf7
100185ff: 34 fd xor al,0xfd
10018601: 34 04 xor al,0x4
10018603: 35 0a 35 11 35 xor eax,0x3511350a
10018608: 17 pop ss
10018609: 35 1f 35 26 35 xor eax,0x3526351f
1001860e: 2b 35 33 35 3c 35 sub esi,DWORD PTR ds:0x353c3533
10018614: 48 dec eax
10018615: 35 4d 35 52 35 xor eax,0x3552354d
1001861a: 58 pop eax
1001861b: 35 5c 35 62 35 xor eax,0x3562355c
10018620: 67 35 6d 35 75 35 addr16 xor eax,0x3575356d
10018626: 81 35 97 35 a2 35 a7 xor DWORD PTR ds:0x35a23597,0x35b235a7
1001862d: 35 b2 35
10018630: b7 35 mov bh,0x35
10018632: c2 35 c7 ret 0xc735
10018635: 35 d4 35 e2 35 xor eax,0x35e235d4
1001863a: e8 35 f8 35 15 call 0x25377e74
1001863f: 36 1b 36 sbb esi,DWORD PTR ss:[esi]
10018642: 37 aaa
10018643: 36 66 36 6f ss outs dx,WORD PTR ss:[esi]
10018647: 36 7b 36 ss jnp 0x10018680
1001864a: ae scas al,BYTE PTR es:[edi]
1001864b: 36 b7 36 ss mov bh,0x36
1001864e: c3 ret
1001864f: 36 f9 ss stc
10018651: 36 02 37 add dh,BYTE PTR ss:[edi]
10018654: 0e push cs
10018655: 37 aaa
10018656: 26 37 es aaa
10018658: 3a 37 cmp dh,BYTE PTR [edi]
1001865a: 5b pop ebx
1001865b: 37 aaa
1001865c: 61 popa
1001865d: 37 aaa
1001865e: 93 xchg ebx,eax
1001865f: 37 aaa
10018660: ea 37 f2 37 32 38 3c jmp 0x3c38:0x3237f237
10018667: 38 64 38 7d cmp BYTE PTR [eax+edi*1+0x7d],ah
1001866b: 38 be 38 ee 38 00 cmp BYTE PTR [esi+0x38ee38],bh
10018671: 39 52 39 cmp DWORD PTR [edx+0x39],edx
10018674: 58 pop eax
10018675: 39 7a 39 cmp DWORD PTR [edx+0x39],edi
10018678: 98 cwde
10018679: 39 ba 39 c8 39 d7 cmp DWORD PTR [edx-0x28c637c7],edi
1001867f: 39 10 cmp DWORD PTR [eax],edx
10018681: 3a 18 cmp bl,BYTE PTR [eax]
10018683: 3a 65 3a cmp ah,BYTE PTR [ebp+0x3a]
10018686: 70 3a jo 0x100186c2
10018688: 78 3a js 0x100186c4
1001868a: 8a 3a mov bh,BYTE PTR [edx]
1001868c: 95 xchg ebp,eax
1001868d: 3a 41 3c cmp al,BYTE PTR [ecx+0x3c]
10018690: 54 push esp
10018691: 3c 5c cmp al,0x5c
10018693: 3c 62 cmp al,0x62
10018695: 3c 67 cmp al,0x67
10018697: 3c 6f cmp al,0x6f
10018699: 3c d9 cmp al,0xd9
1001869b: 3c df cmp al,0xdf
1001869d: 3c f2 cmp al,0xf2
1001869f: 3c fc cmp al,0xfc
100186a1: 3c 15 cmp al,0x15
100186a3: 3d 21 3d 2d 3d cmp eax,0x3d2d3d21
100186a8: 34 3d xor al,0x3d
100186aa: 6b 3d bd 3d cf 3d 00 imul edi,DWORD PTR ds:0x3dcf3dbd,0x0
100186b1: 3e 17 ds pop ss
100186b3: 3e 27 ds daa
100186b5: 3e 2c 3e ds sub al,0x3e
100186b8: 4b dec ebx
100186b9: 3e 50 ds push eax
100186bb: 3e 85 3e test DWORD PTR ds:[esi],edi
100186be: fe (bad)
100186bf: 3e 04 3f ds add al,0x3f
100186c2: 1d 3f 23 3f ec sbb eax,0xec3f233f
100186c7: 3f aas
100186c8: 00 70 00 add BYTE PTR [eax+0x0],dh
100186cb: 00 c8 add al,cl
100186cd: 00 00 add BYTE PTR [eax],al
100186cf: 00 0f add BYTE PTR [edi],cl
100186d1: 30 1c 30 xor BYTE PTR [eax+esi*1],bl
100186d4: 28 30 sub BYTE PTR [eax],dh
100186d6: 30 30 xor BYTE PTR [eax],dh
100186d8: 38 30 cmp BYTE PTR [eax],dh
100186da: 44 inc esp
100186db: 30 68 30 xor BYTE PTR [eax+0x30],ch
100186de: 70 30 jo 0x10018710
100186e0: 06 push es
100186e1: 31 40 31 xor DWORD PTR [eax+0x31],eax
100186e4: 57 push edi
100186e5: 31 be 32 cf 32 09 xor DWORD PTR [esi+0x932cf32],edi
100186eb: 33 16 xor edx,DWORD PTR [esi]
100186ed: 33 20 xor esp,DWORD PTR [eax]
100186ef: 33 2e xor ebp,DWORD PTR [esi]
100186f1: 33 37 xor esi,DWORD PTR [edi]
100186f3: 33 41 33 xor eax,DWORD PTR [ecx+0x33]
100186f6: 76 33 jbe 0x1001872b
100186f8: 7e 33 jle 0x1001872d
100186fa: 88 33 mov BYTE PTR [ebx],dh
100186fc: a1 33 ab 33 be mov eax,ds:0xbe33ab33
10018701: 33 e0 xor esp,eax
10018703: 33 17 xor edx,DWORD PTR [edi]
10018705: 34 4c xor al,0x4c
10018707: 34 5f xor al,0x5f
10018709: 34 cf xor al,0xcf
1001870b: 34 ec xor al,0xec
1001870d: 34 34 xor al,0x34
1001870f: 35 96 35 b5 35 xor eax,0x35b53596
10018714: 2a 36 sub dh,BYTE PTR [esi]
10018716: 36 36 49 ss ss dec ecx
10018719: 36 5b ss pop ebx
1001871b: 36 76 36 ss jbe 0x10018754
1001871e: 7e 36 jle 0x10018756
10018720: 86 36 xchg BYTE PTR [esi],dh
10018722: 9d popf
10018723: 36 b6 36 ss mov dh,0x36
10018726: d2 36 shl BYTE PTR [esi],cl
10018728: db 36 (bad) [esi]
1001872a: e1 36 loope 0x10018762
1001872c: ea 36 ef 36 fe 36 25 jmp 0x2536:0xfe36ef36
10018733: 37 aaa
10018734: 4e dec esi
10018735: 37 aaa
10018736: 5f pop edi
10018737: 37 aaa
10018738: 7f 37 jg 0x10018771
1001873a: 44 inc esp
1001873b: 38 6a 38 cmp BYTE PTR [edx+0x38],ch
1001873e: b4 38 mov ah,0x38
10018740: f8 clc
10018741: 38 3e cmp BYTE PTR [esi],bh
10018743: 39 82 39 e6 39 fd cmp DWORD PTR [edx-0x2c619c7],eax
10018749: 39 0e cmp DWORD PTR [esi],ecx
1001874b: 3a 4a 3a cmp cl,BYTE PTR [edx+0x3a]
1001874e: 75 3a jne 0x1001878a
10018750: 89 3a mov DWORD PTR [edx],edi
10018752: 26 3b 30 cmp esi,DWORD PTR es:[eax]
10018755: 3b 3a cmp edi,DWORD PTR [edx]
10018757: 3b 55 3b cmp edx,DWORD PTR [ebp+0x3b]
1001875a: 5c pop esp
1001875b: 3b 7b 3b cmp edi,DWORD PTR [ebx+0x3b]
1001875e: eb 3b jmp 0x1001879b
10018760: f8 clc
10018761: 3b 2b cmp ebp,DWORD PTR [ebx]
10018763: 3d 57 3d fd 3d cmp eax,0x3dfd3d57
10018768: ca 3e ff retf 0xff3e
1001876b: 3e 18 3f sbb BYTE PTR ds:[edi],bh
1001876e: 1f pop ds
1001876f: 3f aas
10018770: 27 daa
10018771: 3f aas
10018772: 2c 3f sub al,0x3f
10018774: 30 3f xor BYTE PTR [edi],bh
10018776: 34 3f xor al,0x3f
10018778: 5d pop ebp
10018779: 3f aas
1001877a: 83 3f a1 cmp DWORD PTR [edi],0xffffffa1
1001877d: 3f aas
1001877e: a8 3f test al,0x3f
10018780: ac lods al,BYTE PTR ds:[esi]
10018781: 3f aas
10018782: b0 3f mov al,0x3f
10018784: b4 3f mov ah,0x3f
10018786: b8 3f bc 3f c0 mov eax,0xc03fbc3f
1001878b: 3f aas
1001878c: c4 3f les edi,FWORD PTR [edi]
1001878e: 00 00 add BYTE PTR [eax],al
10018790: 00 80 00 00 d0 00 add BYTE PTR [eax+0xd00000],al
10018796: 00 00 add BYTE PTR [eax],al
10018798: 0e push cs
10018799: 30 14 30 xor BYTE PTR [eax+esi*1],dl
1001879c: 18 30 sbb BYTE PTR [eax],dh
1001879e: 1c 30 sbb al,0x30
100187a0: 20 30 and BYTE PTR [eax],dh
100187a2: 86 30 xchg BYTE PTR [eax],dh
100187a4: 91 xchg ecx,eax
100187a5: 30 ac 30 b3 30 b8 30 xor BYTE PTR [eax+esi*1+0x30b830b3],ch
100187ac: bc 30 c0 30 e1 mov esp,0xe130c030
100187b1: 30 0b xor BYTE PTR [ebx],cl
100187b3: 31 3d 31 44 31 48 xor DWORD PTR ds:0x48314431,edi
100187b9: 31 4c 31 50 xor DWORD PTR [ecx+esi*1+0x50],ecx
100187bd: 31 54 31 58 xor DWORD PTR [ecx+esi*1+0x58],edx
100187c1: 31 5c 31 60 xor DWORD PTR [ecx+esi*1+0x60],ebx
100187c5: 31 aa 31 b0 31 b4 xor DWORD PTR [edx-0x4bce4fcf],ebp
100187cb: 31 b8 31 bc 31 7f xor DWORD PTR [eax+0x7f31bc31],edi
100187d1: 34 10 xor al,0x10
100187d3: 36 05 37 b8 37 c4 ss add eax,0xc437b837
100187d9: 37 aaa
100187da: cf iret
100187db: 37 aaa
100187dc: dc 37 fdiv QWORD PTR [edi]
100187de: ec in al,dx
100187df: 37 aaa
100187e0: 1e push ds
100187e1: 38 24 38 cmp BYTE PTR [eax+edi*1],ah
100187e4: 2d 38 34 38 3f sub eax,0x3f383438
100187e9: 38 4b 38 cmp BYTE PTR [ebx+0x38],cl
100187ec: 86 38 xchg BYTE PTR [eax],bh
100187ee: b5 38 mov ch,0x38
100187f0: c1 38 cd sar DWORD PTR [eax],0xcd
100187f3: 39 86 3a 8b 3a 9d cmp DWORD PTR [esi-0x62c574c6],eax
100187f9: 3a bb 3a cf 3a d5 cmp bh,BYTE PTR [ebx-0x2ac530c6]
100187ff: 3a 42 3b cmp al,BYTE PTR [edx+0x3b]
10018802: 4d dec ebp
10018803: 3b c7 cmp eax,edi
10018805: 3b e1 cmp esp,ecx
10018807: 3b 0c 3c cmp ecx,DWORD PTR [esp+edi*1]
1001880a: 11 3c 26 adc DWORD PTR [esi+eiz*1],edi
1001880d: 3c 74 cmp al,0x74
1001880f: 3c ab cmp al,0xab
10018811: 3c b6 cmp al,0xb6
10018813: 3c c0 cmp al,0xc0
10018815: 3c c5 cmp al,0xc5
10018817: 3c ca cmp al,0xca
10018819: 3c cf cmp al,0xcf
1001881b: 3c da cmp al,0xda
1001881d: 3c 0a cmp al,0xa
1001881f: 3d 18 3d 5f 3d cmp eax,0x3d5f3d18
10018824: 64 3d a9 3d ae 3d fs cmp eax,0x3dae3da9
1001882a: b5 3d mov ch,0x3d
1001882c: ba 3d c1 3d c6 mov edx,0xc63dc13d
10018831: 3d 35 3e 3e 3e cmp eax,0x3e3e3e35
10018836: 44 inc esp
10018837: 3e ca 3e d4 ds retf 0xd43e
1001883b: 3e eb 3e ds jmp 0x1001887c
1001883e: 02 3f add bh,BYTE PTR [edi]
10018840: 08 3f or BYTE PTR [edi],bh
10018842: 18 3f sbb BYTE PTR [edi],bh
10018844: 1d 3f 35 3f 3b sbb eax,0x3b3f353f
10018849: 3f aas
1001884a: 4a dec edx
1001884b: 3f aas
1001884c: 50 push eax
1001884d: 3f aas
1001884e: 5d pop ebp
1001884f: 3f aas
10018850: 84 3f test BYTE PTR [edi],bh
10018852: 95 xchg ebp,eax
10018853: 3f aas
10018854: 9c pushf
10018855: 3f aas
10018856: ab stos DWORD PTR es:[edi],eax
10018857: 3f aas
10018858: b0 3f mov al,0x3f
1001885a: bd 3f cb 3f 00 mov ebp,0x3fcb3f
1001885f: 00 00 add BYTE PTR [eax],al
10018861: 90 nop
10018862: 00 00 add BYTE PTR [eax],al
10018864: cc int3
10018865: 00 00 add BYTE PTR [eax],al
10018867: 00 35 30 53 30 71 add BYTE PTR ds:0x71305330,dh
1001886d: 30 d0 xor al,dl
1001886f: 31 d7 xor edi,edx
10018871: 31 dd xor ebp,ebx
10018873: 31 02 xor DWORD PTR [edx],eax
10018875: 32 9b 32 f7 32 0c xor bl,BYTE PTR [ebx+0xc32f732]
1001887b: 33 52 33 xor edx,DWORD PTR [edx+0x33]
1001887e: 58 pop eax
1001887f: 33 64 33 b9 xor esp,DWORD PTR [ebx+esi*1-0x47]
10018883: 33 ec xor ebp,esp
10018885: 33 24 34 xor esp,DWORD PTR [esp+esi*1]
10018888: 8f (bad)
10018889: 34 95 xor al,0x95
1001888b: 34 e6 xor al,0xe6
1001888d: 34 ec xor al,0xec
1001888f: 34 10 xor al,0x10
10018891: 35 33 35 67 35 xor eax,0x35673533
10018896: 6d ins DWORD PTR es:[edi],dx
10018897: 35 79 35 c0 35 xor eax,0x35c03579
1001889c: 6a 36 push 0x36
1001889e: 9f lahf
1001889f: 36 b8 36 bf 36 c7 ss mov eax,0xc736bf36
100188a5: 36 cc ss int3
100188a7: 36 d0 36 shl BYTE PTR ss:[esi],1
100188aa: d4 36 aam 0x36
100188ac: fd std
100188ad: 36 23 37 and esi,DWORD PTR ss:[edi]
100188b0: 41 inc ecx
100188b1: 37 aaa
100188b2: 48 dec eax
100188b3: 37 aaa
100188b4: 4c dec esp
100188b5: 37 aaa
100188b6: 50 push eax
100188b7: 37 aaa
100188b8: 54 push esp
100188b9: 37 aaa
100188ba: 58 pop eax
100188bb: 37 aaa
100188bc: 5c pop esp
100188bd: 37 aaa
100188be: 60 pusha
100188bf: 37 aaa
100188c0: 64 37 fs aaa
100188c2: ae scas al,BYTE PTR es:[edi]
100188c3: 37 aaa
100188c4: b4 37 mov ah,0x37
100188c6: b8 37 bc 37 c0 mov eax,0xc037bc37
100188cb: 37 aaa
100188cc: 26 38 31 cmp BYTE PTR es:[ecx],dh
100188cf: 38 4c 38 53 cmp BYTE PTR [eax+edi*1+0x53],cl
100188d3: 38 58 38 cmp BYTE PTR [eax+0x38],bl
100188d6: 5c pop esp
100188d7: 38 60 38 cmp BYTE PTR [eax+0x38],ah
100188da: 81 38 ab 38 dd 38 cmp DWORD PTR [eax],0x38dd38ab
100188e0: e4 38 in al,0x38
100188e2: e8 38 ec 38 f0 call 0x3a751f
100188e7: 38 f4 cmp ah,dh
100188e9: 38 f8 cmp al,bh
100188eb: 38 fc cmp ah,bh
100188ed: 38 00 cmp BYTE PTR [eax],al
100188ef: 39 4a 39 cmp DWORD PTR [edx+0x39],ecx
100188f2: 50 push eax
100188f3: 39 54 39 58 cmp DWORD PTR [ecx+edi*1+0x58],edx
100188f7: 39 5c 39 c7 cmp DWORD PTR [ecx+edi*1-0x39],ebx
100188fb: 39 d6 cmp esi,edx
100188fd: 39 e6 cmp esi,esp
100188ff: 39 f2 cmp edx,esi
10018901: 39 fc cmp esp,edi
10018903: 39 04 3a cmp DWORD PTR [edx+edi*1],eax
10018906: 0f 3a 3f (bad)
10018909: 3a 6f 3a cmp ch,BYTE PTR [edi+0x3a]
1001890c: 06 push es
1001890d: 3b b5 3b d8 3b 56 cmp esi,DWORD PTR [ebp+0x563bd83b]
10018913: 3c 27 cmp al,0x27
10018915: 3d ab 3d b5 3d cmp eax,0x3db53dab
1001891a: cd 3d int 0x3d
1001891c: d4 3d aam 0x3d
1001891e: de 3d e6 3d f3 3d fidivr WORD PTR ds:0x3df33de6
10018924: fa cli
10018925: 3d 2a 3e c3 3e cmp eax,0x3ec33e2a
1001892a: 38 3f cmp BYTE PTR [edi],bh
1001892c: 00 a0 00 00 50 00 add BYTE PTR [eax+0x500000],ah
10018932: 00 00 add BYTE PTR [eax],al
10018934: 3a 31 cmp dh,BYTE PTR [ecx]
10018936: 4c dec esp
10018937: 31 5e 31 xor DWORD PTR [esi+0x31],ebx
1001893a: 7b 31 jnp 0x1001896d
1001893c: 8d 31 lea esi,[ecx]
1001893e: 9f lahf
1001893f: 31 b1 31 c3 31 d5 xor DWORD PTR [ecx-0x2ace3ccf],esi
10018945: 31 e7 xor edi,esp
10018947: 31 f6 xor esi,esi
10018949: 33 ec xor ebp,esp
1001894b: 34 f4 xor al,0xf4
1001894d: 34 a7 xor al,0xa7
1001894f: 35 89 36 22 37 xor eax,0x37223689
10018954: 28 37 sub BYTE PTR [edi],dh
10018956: ca 37 d0 retf 0xd037
10018959: 37 aaa
1001895a: e0 37 loopne 0x10018993
1001895c: 80 38 97 cmp BYTE PTR [eax],0x97
1001895f: 38 38 cmp BYTE PTR [eax],bh
10018961: 39 2e cmp DWORD PTR [esi],ebp
10018963: 3a 36 cmp dh,BYTE PTR [esi]
10018965: 3a e9 cmp ch,cl
10018967: 3a cb cmp cl,bl
10018969: 3b 64 3c 6a cmp esp,DWORD PTR [esp+edi*1+0x6a]
1001896d: 3c 0c cmp al,0xc
1001896f: 3d 12 3d 22 3d cmp eax,0x3d223d12
10018974: c2 3d d9 ret 0xd93d
10018977: 3d 07 3e 94 3e cmp eax,0x3e943e07
1001897c: 00 b0 00 00 34 00 add BYTE PTR [eax+0x340000],dh
10018982: 00 00 add BYTE PTR [eax],al
10018984: 64 31 7b 31 xor DWORD PTR fs:[ebx+0x31],edi
10018988: 90 nop
10018989: 34 94 xor al,0x94
1001898b: 34 98 xor al,0x98
1001898d: 34 9c xor al,0x9c
1001898f: 34 a0 xor al,0xa0
10018991: 34 a4 xor al,0xa4
10018993: 34 a8 xor al,0xa8
10018995: 34 ac xor al,0xac
10018997: 34 b0 xor al,0xb0
10018999: 34 b4 xor al,0xb4
1001899b: 34 b8 xor al,0xb8
1001899d: 34 bc xor al,0xbc
1001899f: 34 31 xor al,0x31
100189a1: 36 07 ss pop es
100189a3: 37 aaa
100189a4: 1f pop ds
100189a5: 37 aaa
100189a6: 2e 37 cs aaa
100189a8: 5a pop edx
100189a9: 37 aaa
100189aa: b9 37 de 37 00 mov ecx,0x37de37
100189af: 00 00 add BYTE PTR [eax],al
100189b1: c0 00 00 rol BYTE PTR [eax],0x0
100189b4: 48 dec eax
100189b5: 00 00 add BYTE PTR [eax],al
100189b7: 00 6e 32 add BYTE PTR [esi+0x32],ch
100189ba: 14 34 adc al,0x34
100189bc: 79 34 jns 0x100189f2
100189be: 85 34 fd 34 17 35 20 test DWORD PTR [edi*8+0x20351734],esi
100189c5: 35 42 35 7a 35 xor eax,0x357a3542
100189ca: bd 35 c3 35 f1 mov ebp,0xf135c335
100189cf: 35 ff 35 22 36 xor eax,0x362235ff
100189d4: bf 36 c9 36 dc mov edi,0xdc36c936
100189d9: 36 f9 ss stc
100189db: 36 23 37 and esi,DWORD PTR ss:[edi]
100189de: 5c pop esp
100189df: 37 aaa
100189e0: 6b 37 48 imul esi,DWORD PTR [edi],0x48
100189e3: 38 5a 38 cmp BYTE PTR [edx+0x38],bl
100189e6: 14 39 adc al,0x39
100189e8: dc 3a fdivr QWORD PTR [edx]
100189ea: e9 3a f7 3a 27 jmp 0x373c8129
100189ef: 3b ad 3d be 3d f0 cmp ebp,DWORD PTR [ebp-0xfc241c3]
100189f5: 3f aas
100189f6: 00 00 add BYTE PTR [eax],al
100189f8: 00 d0 add al,dl
100189fa: 00 00 add BYTE PTR [eax],al
100189fc: 1c 00 sbb al,0x0
100189fe: 00 00 add BYTE PTR [eax],al
10018a00: 4c dec esp
10018a01: 31 50 31 xor DWORD PTR [eax+0x31],edx
10018a04: 54 push esp
10018a05: 31 58 31 xor DWORD PTR [eax+0x31],ebx
10018a08: f0 31 f4 lock xor esp,esi
10018a0b: 31 f8 xor eax,edi
10018a0d: 31 1c 38 xor DWORD PTR [eax+edi*1],ebx
10018a10: 20 38 and BYTE PTR [eax],bh
10018a12: 00 00 add BYTE PTR [eax],al
10018a14: 00 e0 add al,ah
10018a16: 00 00 add BYTE PTR [eax],al
10018a18: 48 dec eax
10018a19: 00 00 add BYTE PTR [eax],al
10018a1b: 00 8c 33 90 33 d8 33 add BYTE PTR [ebx+esi*1+0x33d83390],cl
10018a22: f8 clc
10018a23: 33 14 34 xor edx,DWORD PTR [esp+esi*1]
10018a26: 18 34 38 sbb BYTE PTR [eax+edi*1],dh
10018a29: 34 58 xor al,0x58
10018a2b: 34 78 xor al,0x78
10018a2d: 34 98 xor al,0x98
10018a2f: 34 a4 xor al,0xa4
10018a31: 34 bc xor al,0xbc
10018a33: 34 c0 xor al,0xc0
10018a35: 34 e0 xor al,0xe0
10018a37: 34 00 xor al,0x0
10018a39: 35 20 35 3c 35 xor eax,0x353c3520
10018a3e: 40 inc eax
10018a3f: 35 5c 35 60 35 xor eax,0x3560355c
10018a44: 7c 35 jl 0x10018a7b
10018a46: 80 35 a0 35 bc 35 c0 xor BYTE PTR ds:0x35bc35a0,0xc0
10018a4d: 35 e0 35 00 36 xor eax,0x360035e0
10018a52: 20 36 and BYTE PTR [esi],dh
10018a54: 40 inc eax
10018a55: 36 5c ss pop esp
10018a57: 36 60 ss pusha
10018a59: 36 00 00 add BYTE PTR ss:[eax],al
10018a5c: 00 00 add BYTE PTR [eax],al
10018a5e: 01 00 add DWORD PTR [eax],eax
10018a60: e0 00 loopne 0x10018a62
10018a62: 00 00 add BYTE PTR [eax],al
10018a64: 18 30 sbb BYTE PTR [eax],dh
10018a66: 1c 30 sbb al,0x30
10018a68: 20 30 and BYTE PTR [eax],dh
10018a6a: 24 30 and al,0x30
10018a6c: 28 30 sub BYTE PTR [eax],dh
10018a6e: 2c 30 sub al,0x30
10018a70: 30 30 xor BYTE PTR [eax],dh
10018a72: 34 30 xor al,0x30
10018a74: 38 30 cmp BYTE PTR [eax],dh
10018a76: 3c 30 cmp al,0x30
10018a78: d8 32 fdiv DWORD PTR [edx]
10018a7a: e4 32 in al,0x32
10018a7c: ec in al,dx
10018a7d: 32 f4 xor dh,ah
10018a7f: 32 fc xor bh,ah
10018a81: 32 04 33 xor al,BYTE PTR [ebx+esi*1]
10018a84: 0c 33 or al,0x33
10018a86: 14 33 adc al,0x33
10018a88: 1c 33 sbb al,0x33
10018a8a: 24 33 and al,0x33
10018a8c: 2c 33 sub al,0x33
10018a8e: 34 33 xor al,0x33
10018a90: 3c 33 cmp al,0x33
10018a92: 44 inc esp
10018a93: 33 4c 33 54 xor ecx,DWORD PTR [ebx+esi*1+0x54]
10018a97: 33 5c 33 64 xor ebx,DWORD PTR [ebx+esi*1+0x64]
10018a9b: 33 6c 33 74 xor ebp,DWORD PTR [ebx+esi*1+0x74]
10018a9f: 33 7c 33 84 xor edi,DWORD PTR [ebx+esi*1-0x7c]
10018aa3: 33 8c 33 94 33 98 38 xor ecx,DWORD PTR [ebx+esi*1+0x38983394]
10018aaa: 90 nop
10018aab: 39 f8 cmp eax,edi
10018aad: 39 08 cmp DWORD PTR [eax],ecx
10018aaf: 3a 18 cmp bl,BYTE PTR [eax]
10018ab1: 3a 28 cmp ch,BYTE PTR [eax]
10018ab3: 3a 38 cmp bh,BYTE PTR [eax]
10018ab5: 3a 5c 3a 68 cmp bl,BYTE PTR [edx+edi*1+0x68]
10018ab9: 3a 6c 3a 70 cmp ch,BYTE PTR [edx+edi*1+0x70]
10018abd: 3a 74 3a 78 cmp dh,BYTE PTR [edx+edi*1+0x78]
10018ac1: 3a 80 3a 84 3a 90 cmp al,BYTE PTR [eax-0x6fc57bc6]
10018ac7: 3a 94 3a 98 3a 9c 3a cmp dl,BYTE PTR [edx+edi*1+0x3a9c3a98]
10018ace: a0 3a a4 3a a8 mov al,ds:0xa83aa43a
10018ad3: 3a ac 3a b0 3a b4 3a cmp ch,BYTE PTR [edx+edi*1+0x3ab43ab0]
10018ada: b8 3a bc 3a c0 mov eax,0xc03abc3a
10018adf: 3a c4 cmp al,ah
10018ae1: 3a c8 cmp cl,al
10018ae3: 3a cc cmp cl,ah
10018ae5: 3a d0 cmp dl,al
10018ae7: 3a d4 cmp dl,ah
10018ae9: 3a d8 cmp bl,al
10018aeb: 3a dc cmp bl,ah
10018aed: 3a e0 cmp ah,al
10018aef: 3a e4 cmp ah,ah
10018af1: 3a e8 cmp ch,al
10018af3: 3a ec cmp ch,ah
10018af5: 3a f0 cmp dh,al
10018af7: 3a f4 cmp dh,ah
10018af9: 3a f8 cmp bh,al
10018afb: 3a fc cmp bh,ah
10018afd: 3a 00 cmp al,BYTE PTR [eax]
10018aff: 3b 04 3b cmp eax,DWORD PTR [ebx+edi*1]
10018b02: 08 3b or BYTE PTR [ebx],bh
10018b04: 0c 3b or al,0x3b
10018b06: 10 3b adc BYTE PTR [ebx],bh
10018b08: 14 3b adc al,0x3b
10018b0a: 18 3b sbb BYTE PTR [ebx],bh
10018b0c: 1c 3b sbb al,0x3b
10018b0e: 20 3b and BYTE PTR [ebx],bh
10018b10: 24 3b and al,0x3b
10018b12: 28 3b sub BYTE PTR [ebx],bh
10018b14: 2c 3b sub al,0x3b
10018b16: 30 3b xor BYTE PTR [ebx],bh
10018b18: 34 3b xor al,0x3b
10018b1a: 38 3b cmp BYTE PTR [ebx],bh
10018b1c: 3c 3b cmp al,0x3b
10018b1e: 40 inc eax
10018b1f: 3b 50 3b cmp edx,DWORD PTR [eax+0x3b]
10018b22: 58 pop eax
10018b23: 3b 5c 3b 60 cmp ebx,DWORD PTR [ebx+edi*1+0x60]
10018b27: 3b 64 3b 68 cmp esp,DWORD PTR [ebx+edi*1+0x68]
10018b2b: 3b 6c 3b 70 cmp ebp,DWORD PTR [ebx+edi*1+0x70]
10018b2f: 3b 74 3b 78 cmp esi,DWORD PTR [ebx+edi*1+0x78]
10018b33: 3b 7c 3b 88 cmp edi,DWORD PTR [ebx+edi*1-0x78]
10018b37: 3b 80 3c 84 3c 00 cmp eax,DWORD PTR [eax+0x3c843c]
...
|
programs/oeis/022/A022534.asm | neoneye/loda | 22 | 84092 | <filename>programs/oeis/022/A022534.asm
; A022534: Nexus numbers (n+1)^18 - n^18.
; 1,262143,387158345,68332056247,3745977788889,97745259402791,1526853641242033,16385984911571535,132080236787517137,849905364703000879,4559917313492231481,21063415967393012423,85832073671072149225,314423447258679349527,1051013025824763647969,3244474602834244823071,9340717969198079777313,25283323623228812584415,64780942222614703957417,158016649702088758467159,368736792396715529789561,826618171831391999565703,1786651945667140755945105,3734996169689133092669807,7572768148782470428670449,14927594971647067057767951,28670226803026140825981593,53753993355153098576424295,98553554006978962063490697,176963204634827879669694839,311633130999045038539170241,538886419286335236359953983,916085845107346343171089985,1532527326210115081972849087,2525351688652716313872952329,4102519899234977532255933431,6575629012072765203781486873,10406306305932343750431635175,16271168635525688252817348977,25151947983978667246797579919,38459454231531784356353269521,58202683474512811484801409263,87217719131453464970666127865,129475274905114959363485519367,190490986373831136471422189609,277869101271135809855051415511,402018319703643125146363125153,577088516203344980298470761055,822189313829085399832409564257,1162966419765346528220976618399,1633629789643375077134227383401,2279549666604073669657294363543,3160563039910465071931101602745,4355164895142019588755017112647,5965796715954977942772603678289,8125490118138275930445566710191,11006177479672881592554558928433,14829045381932611438617146345935,19877382201409276448651632968537,26512460114383043239480850906279,35193096172132005895349735207881,46499659320481656687462508448823,61163432930013349962153546058625,80102408567383714238190230860927,104464779745951756527543442314369,135681628033868443256698770713471,175530552418533129649682784128713,226212290983491278399007766933815,290442727061140694851391685193817,371563066009036970532519530139559,473671420219172311776010144838961,601779556245881638439689268497103,761999147173604253867773172039505,961762544567198707712320922796207,1210083847544126486523450876593849,1517866912718201833589699694721351,1898267930169848223774591737157993,2367121300621397797571959393068695,2943438802410891329020875624672097,3649993449901212417723629165614239,4514001035457190411840147874772641,5567914134613477666471723610540383,6850345359940515312511525752089385,8407138896802171141360254877750487,10292611869260863368332857894612729,12570989894734873752937443528429831,15318064322075961774079713455648273,18623102142650494133301834533294575,22591043453824823941586273426635377,27345025678156765497578225046226319,33029278542121536539940631629904921,39812439141499089198701966637810663,47891342316630461625226582154752265,57495348083761361773141632925355767,68891275077206972087266682990067009,82389016914402694428095636195934911,98347927170419742675901662772431553,117184068313992020377765510040155455,139378430593054614710038319839115657,165486238549912385583921374814471799
sub $2,$0
add $0,1
pow $0,18
pow $2,18
sub $0,$2
|
Lab_Task/Lab_1/1621418042_Lab_task1.asm | maliha-mamtaz/CSE331L_Section_7_Summer_2020_NSU | 0 | 5052 | <filename>Lab_Task/Lab_1/1621418042_Lab_task1.asm
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
#include <stdio.h>
a DB 10;int a=10
b DW 15;int b=15
mov ax,k
add ax,k1
k equ 10
k1 equ 15
a DB 10;variable
a DB 10h,15h,11h,12h;array,int a[10]
b DB 10 DUP(?);int a[10]={}
int a[n]
c DB 5 DUP(1,2);1,2,1,2,1
mov bx ,10
mov bx,5
inc bx;c++
dec bx;c--
mov bx,35h
mov di,12h
lea si,[bx=di]
a db 0h,2h,0h,4h,0h,6h
ret
|
oeis/295/A295735.asm | neoneye/loda-programs | 11 | 11046 | ; A295735: a(n) = a(n-1) + 3*a(n-2) -2*a(n-3) - 2*a(n-4), where a(0) = 0, a(1) = -1, a(2) = 0, a(3) = 1.
; Submitted by <NAME>
; 0,-1,0,1,3,8,15,31,54,101,171,304,507,875,1446,2449,4023,6728,11007,18247,29766,49037,79827,130912,212787,347795,564678,920665,1493535,2430584,3940503,6403855,10377126,16846517,27289179,44266768,71687019,116215931,188165094,304905313,493594695,799548584,1294191855,2095837591,3392126598,5492158493,8888479395,14389026496,23285894499,37691698211,60994369926,98719622569,159747546927,258534278360,418348934151,677017430239,1095500582118,1772786447813,2868555465387,4641878784112,7510971120411
mov $1,1
mov $2,1
mov $5,-1
mov $6,-1
lpb $0
mov $3,1
lpb $3
add $2,1
sub $2,$3
mod $2,2
cmp $4,3
cmp $4,0
sub $3,$4
add $7,$1
lpe
sub $0,1
add $2,1
mul $1,$2
mul $7,$5
sub $6,$7
add $7,$6
lpe
mov $0,$7
|
alloy4fun_models/trashltl/models/4/cuDe5eXjzHxtyJTCj.als | Kaixi26/org.alloytools.alloy | 0 | 2169 | <filename>alloy4fun_models/trashltl/models/4/cuDe5eXjzHxtyJTCj.als
open main
pred idcuDe5eXjzHxtyJTCj_prop5 {
all f : File | f in Trash => eventually f not in File
}
pred __repair { idcuDe5eXjzHxtyJTCj_prop5 }
check __repair { idcuDe5eXjzHxtyJTCj_prop5 <=> prop5o } |
programs/oeis/309/A309873.asm | karttu/loda | 1 | 241231 | <reponame>karttu/loda
; A309873: Period-doubling turn sequence, +1 when the 2-adic valuation of n is even or -1 when odd.
; 1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1
add $0,1
gcd $0,1024
mul $0,2
mod $0,3
mov $1,$0
mul $1,2
sub $1,3
|
Source/Api/EtAlii.Ubigia.Api.Functional.Antlr/SchemaParser.g4 | vrenken/EtAlii.Ubigia | 2 | 4556 | parser grammar SchemaParser;
@header {
#pragma warning disable CS0115 // CS0115: no suitable method found to override
#pragma warning disable CS3021 // CS3021: The CLSCompliant attribute is not needed because the assembly does not have a CLSCompliant attribute
// ReSharper disable InvalidXmlDocComment
// ReSharper disable all
}
options {
language = CSharp;
tokenVocab = UbigiaLexer;
}
import Primitives, PathParser, ScriptParser;
schema : (comment | WHITESPACE | NEWLINE)* header_option_namespace? structure_fragment? (comment | WHITESPACE | NEWLINE)* EOF ;
namespace : schema_key (DOT schema_key)* ;
header_option_namespace : WHITESPACE* LBRACK WHITESPACE* HEADER_OPTION_NAMESPACE WHITESPACE* EQUALS WHITESPACE* namespace WHITESPACE* RBRACK NEWLINE;
//header_option_context : WHITESPACE* LBRACK WHITESPACE* HEADER_OPTION_CONTEXT WHITESPACE* EQUALS WHITESPACE* identity WHITESPACE* RBRACK NEWLINE;
requirement : EXCLAMATION | QUESTION ;
structure_fragment_body_entry
: structure_fragment
| value_mutation_fragment
| value_query_fragment
| comment WHITESPACE* NEWLINE+ (WHITESPACE | NEWLINE)*
;
structure_plurality : LBRACK RBRACK ;
structure_fragment : WHITESPACE* requirement? schema_key structure_plurality? WHITESPACE* (EQUALS WHITESPACE* node_annotation)? WHITESPACE* (WHITESPACE | NEWLINE)* LBRACE (WHITESPACE | NEWLINE)* structure_fragment_body? (WHITESPACE | NEWLINE)* RBRACE;
value_query_fragment : WHITESPACE* schema_key_prefix? schema_key WHITESPACE* (EQUALS WHITESPACE* value_annotation)? WHITESPACE* ;
value_mutation_fragment : WHITESPACE* schema_key_prefix? schema_key WHITESPACE* EQUALS WHITESPACE* primitive_value WHITESPACE* ;
schema_key_prefix_type_and_requirement_1 : value_type WHITESPACE* requirement ;
schema_key_prefix_type_and_requirement_2 : value_type requirement WHITESPACE* ;
schema_key_prefix_type_only : value_type WHITESPACE* ;
schema_key_prefix_requirement : requirement ;
schema_key_prefix
: schema_key_prefix_type_and_requirement_1
| schema_key_prefix_type_and_requirement_2
| schema_key_prefix_type_only
| schema_key_prefix_requirement
;
value_type
: VALUE_TYPE_OBJECT
| VALUE_TYPE_STRING
| VALUE_TYPE_BOOL
| VALUE_TYPE_FLOAT
| VALUE_TYPE_INT
| VALUE_TYPE_DATETIME
;
structure_fragment_body_newline_separated : (structure_fragment_body_entry WHITESPACE* comment? NEWLINE+)* structure_fragment_body_entry comment? (WHITESPACE | NEWLINE)* ;
structure_fragment_body_comma_separated : (structure_fragment_body_entry WHITESPACE* COMMA WHITESPACE* comment? NEWLINE?)* structure_fragment_body_entry comment? (WHITESPACE | NEWLINE)* ;
structure_fragment_body
: structure_fragment_body_newline_separated
| structure_fragment_body_comma_separated
;
// @node-set(SOURCE, VALUE)
value_annotation_assign_and_select_with_key : WHITESPACE+ ATSIGN ANNOTATION_NODE_SET WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @node-set(SOURCE)
value_annotation_assign_and_select_without_key : WHITESPACE+ ATSIGN ANNOTATION_NODE_SET WHITESPACE* LPAREN WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @value-clear(SOURCE)
value_annotation_clear_and_select_with_key : WHITESPACE+ ATSIGN ANNOTATION_NODE_CLEAR WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @value-clear()
value_annotation_clear_and_select_without_key : WHITESPACE+ ATSIGN ANNOTATION_NODE_CLEAR WHITESPACE* LPAREN WHITESPACE* RPAREN ;
// @value-clear(SOURCE)
value_annotation_clear_and_select : WHITESPACE+ ATSIGN ANNOTATION_NODE_CLEAR WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* RPAREN ;
// @value(SOURCE) or @value()
value_annotation_select : WHITESPACE+ ATSIGN ANNOTATION_NODE WHITESPACE* LPAREN WHITESPACE* schema_path? WHITESPACE* RPAREN ;
value_annotation_select_current_node
: ATSIGN // @
| ATSIGN ANNOTATION_NODE WHITESPACE* LPAREN WHITESPACE* RPAREN // @node()
;
// Structure.
value_annotation_map_sequence : WHITESPACE+ sequence ;
value_annotation
: value_annotation_assign_and_select_with_key
| value_annotation_assign_and_select_without_key
| value_annotation_clear_and_select_with_key
| value_annotation_clear_and_select_without_key
| value_annotation_clear_and_select
| value_annotation_select
| value_annotation_select_current_node
| value_annotation_map_sequence
;
// @node-link(SOURCE, TARGET, TARGET_LINK)
node_annotation_link_and_select_single_node : ATSIGN ANNOTATION_NODE_LINK WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* RPAREN;
// @nodes-remove(SOURCE, NAME)
node_annotation_remove_and_select_multiple_nodes : ATSIGN ANNOTATION_NODES_REMOVE WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @node-remove(SOURCE, NAME)
node_annotation_remove_and_select_single_node : ATSIGN ANNOTATION_NODE_REMOVE WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @nodes-unlink(SOURCE, TARGET, TARGET_LINK)
node_annotation_unlink_and_select_multiple_nodes : ATSIGN ANNOTATION_NODES_UNLINK WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* RPAREN ;
// @node-unlink(SOURCE, TARGET, TARGET_LINK)
node_annotation_unlink_and_select_single_node : ATSIGN ANNOTATION_NODE_UNLINK WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* RPAREN ;
// @nodes-add(PATH, NAME)
node_annotation_add_and_select_multiple_nodes : ATSIGN ANNOTATION_NODES_ADD WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @node-add(PATH, NAME)
node_annotation_add_and_select_single_node : ATSIGN ANNOTATION_NODE_ADD WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_key WHITESPACE* RPAREN ;
// @nodes-link(SOURCE, TARGET, TARGET_LINK)
node_annotation_link_and_select_multiple_nodes : ATSIGN ANNOTATION_NODES_LINK WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* COMMA WHITESPACE* schema_path WHITESPACE* RPAREN ;
// @nodes(SOURCE)
node_annotation_select_multiple_nodes : ATSIGN ANNOTATION_NODES WHITESPACE* LPAREN WHITESPACE* schema_path? WHITESPACE* RPAREN ;
// @node(SOURCE)
node_annotation_select_single_node : ATSIGN ANNOTATION_NODE WHITESPACE* LPAREN WHITESPACE* schema_path WHITESPACE* RPAREN ;
node_annotation_select_current_node
: ATSIGN // @
| ATSIGN ANNOTATION_NODE WHITESPACE* LPAREN WHITESPACE* RPAREN // @node()
;
// Structure.
node_annotation_map_sequence : WHITESPACE+ sequence ;
node_annotation
: node_annotation_add_and_select_multiple_nodes
| node_annotation_add_and_select_single_node
| node_annotation_link_and_select_multiple_nodes
| node_annotation_link_and_select_single_node
| node_annotation_remove_and_select_multiple_nodes
| node_annotation_remove_and_select_single_node
| node_annotation_select_multiple_nodes
| node_annotation_select_current_node
| node_annotation_select_single_node
| node_annotation_unlink_and_select_multiple_nodes
| node_annotation_unlink_and_select_single_node
| node_annotation_map_sequence
;
schema_key : identifier | string_quoted_non_empty | reserved_words;
schema_path : rooted_path | non_rooted_path ;
comment : WHITESPACE* COMMENT ;
|
Task/Nth-root/Ada/nth-root.ada | LaudateCorpus1/RosettaCodeData | 1 | 8708 | with Ada.Text_IO; use Ada.Text_IO;
procedure Test_Nth_Root is
generic
type Real is digits <>;
function Nth_Root (Value : Real; N : Positive) return Real;
function Nth_Root (Value : Real; N : Positive) return Real is
type Index is mod 2;
X : array (Index) of Real := (Value, Value);
K : Index := 0;
begin
loop
X (K + 1) := ( (Real (N) - 1.0) * X (K) + Value / X (K) ** (N-1) ) / Real (N);
exit when X (K + 1) >= X (K);
K := K + 1;
end loop;
return X (K + 1);
end Nth_Root;
function Long_Nth_Root is new Nth_Root (Long_Float);
begin
Put_Line ("1024.0 10th =" & Long_Float'Image (Long_Nth_Root (1024.0, 10)));
Put_Line (" 27.0 3rd =" & Long_Float'Image (Long_Nth_Root (27.0, 3)));
Put_Line (" 2.0 2nd =" & Long_Float'Image (Long_Nth_Root (2.0, 2)));
Put_Line ("5642.0 125th =" & Long_Float'Image (Long_Nth_Root (5642.0, 125)));
end Test_Nth_Root;
|
source/amf/mof/cmof/amf-internals-cmof_parameters.adb | svn2github/matreshka | 24 | 20014 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings.Internals;
with Matreshka.Internals.Strings;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.CMOF_Attributes;
with AMF.Visitors.CMOF_Iterators;
with AMF.Visitors.CMOF_Visitors;
package body AMF.Internals.CMOF_Parameters is
use AMF.Internals.Tables.CMOF_Attributes;
use type Matreshka.Internals.Strings.Shared_String_Access;
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant CMOF_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then
AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class
(Visitor).Enter_Parameter
(AMF.CMOF.Parameters.CMOF_Parameter_Access (Self),
Control);
end if;
end Enter_Element;
-----------------
-- Get_Default --
-----------------
overriding function Get_Default
(Self : not null access constant CMOF_Parameter_Proxy)
return Optional_String
is
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= Internal_Get_Default (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end Get_Default;
-------------------
-- Get_Direction --
-------------------
overriding function Get_Direction
(Self : not null access constant CMOF_Parameter_Proxy)
return CMOF.CMOF_Parameter_Direction_Kind is
begin
return Internal_Get_Direction (Self.Element);
end Get_Direction;
-------------------
-- Get_Operation --
-------------------
overriding function Get_Operation
(Self : not null access constant CMOF_Parameter_Proxy)
return AMF.CMOF.Operations.CMOF_Operation_Access is
begin
return
AMF.CMOF.Operations.CMOF_Operation_Access
(AMF.Internals.Helpers.To_Element (Internal_Get_Operation (Self.Element)));
end Get_Operation;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant CMOF_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then
AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class
(Visitor).Leave_Parameter
(AMF.CMOF.Parameters.CMOF_Parameter_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Set_Direction --
-------------------
overriding procedure Set_Direction
(Self : not null access CMOF_Parameter_Proxy;
To : CMOF.CMOF_Parameter_Direction_Kind) is
begin
Internal_Set_Direction (Self.Element, To);
end Set_Direction;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant CMOF_Parameter_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class then
AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class
(Iterator).Visit_Parameter
(Visitor,
AMF.CMOF.Parameters.CMOF_Parameter_Access (Self),
Control);
end if;
end Visit_Element;
------------------------
-- All_Owned_Elements --
------------------------
overriding function All_Owned_Elements
(Self : not null access constant CMOF_Parameter_Proxy)
return AMF.CMOF.Elements.Collections.Set_Of_CMOF_Element
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owned_Elements unimplemented");
raise Program_Error;
return All_Owned_Elements (Self);
end All_Owned_Elements;
-------------------
-- Set_Is_Unique --
-------------------
overriding procedure Set_Is_Unique
(Self : not null access CMOF_Parameter_Proxy;
To : Boolean)
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Set_Is_Unique unimplemented");
raise Program_Error;
end Set_Is_Unique;
---------------------------
-- Includes_Multiplicity --
---------------------------
overriding function Includes_Multiplicity
(Self : not null access constant CMOF_Parameter_Proxy;
M : AMF.CMOF.Multiplicity_Elements.CMOF_Multiplicity_Element_Access)
return Boolean
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Includes_Multiplicity unimplemented");
raise Program_Error;
return Includes_Multiplicity (Self, M);
end Includes_Multiplicity;
--------------------------
-- Includes_Cardinality --
--------------------------
overriding function Includes_Cardinality
(Self : not null access constant CMOF_Parameter_Proxy;
C : Integer)
return Boolean
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Includes_Cardinality unimplemented");
raise Program_Error;
return Includes_Cardinality (Self, C);
end Includes_Cardinality;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant CMOF_Parameter_Proxy)
return Optional_String
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Get_Qualified_Name unimplemented");
raise Program_Error;
return Get_Qualified_Name (Self);
end Get_Qualified_Name;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant CMOF_Parameter_Proxy;
N : AMF.CMOF.Named_Elements.CMOF_Named_Element_Access;
Ns : AMF.CMOF.Namespaces.CMOF_Namespace_Access)
return Boolean
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error;
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
-----------------
-- Set_Default --
-----------------
overriding procedure Set_Default
(Self : not null access CMOF_Parameter_Proxy;
To : Optional_String)
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Set_Default unimplemented");
raise Program_Error;
end Set_Default;
-------------------
-- Set_Operation --
-------------------
overriding procedure Set_Operation
(Self : not null access CMOF_Parameter_Proxy;
To : AMF.CMOF.Operations.CMOF_Operation_Access)
is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Set_Operation unimplemented");
raise Program_Error;
end Set_Operation;
end AMF.Internals.CMOF_Parameters;
|
oeis/195/A195023.asm | neoneye/loda-programs | 11 | 241792 | <reponame>neoneye/loda-programs
; A195023: a(n) = 14*n^2 - 4*n.
; 0,10,48,114,208,330,480,658,864,1098,1360,1650,1968,2314,2688,3090,3520,3978,4464,4978,5520,6090,6688,7314,7968,8650,9360,10098,10864,11658,12480,13330,14208,15114,16048,17010,18000,19018,20064,21138,22240,23370,24528,25714,26928,28170,29440,30738,32064,33418,34800,36210,37648,39114,40608,42130,43680,45258,46864,48498,50160,51850,53568,55314,57088,58890,60720,62578,64464,66378,68320,70290,72288,74314,76368,78450,80560,82698,84864,87058,89280,91530,93808,96114,98448,100810,103200,105618,108064
mov $1,$0
mul $1,14
sub $1,4
mul $0,$1
|
Transynther/x86/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_133_66.asm | ljhsiun2/medusa | 9 | 85870 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x12813, %rsi
lea addresses_UC_ht+0x1d013, %rdi
nop
sub $16951, %r8
mov $100, %rcx
rep movsb
nop
nop
nop
nop
nop
lfence
lea addresses_WT_ht+0xe13, %rdi
nop
and $798, %rbx
mov $0x6162636465666768, %r8
movq %r8, (%rdi)
nop
nop
nop
nop
nop
add %r8, %r8
lea addresses_normal_ht+0x351c, %rsi
lea addresses_A_ht+0x9813, %rdi
add %r10, %r10
mov $33, %rcx
rep movsq
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WT_ht+0x1c13, %rsi
lea addresses_UC_ht+0x1902b, %rdi
nop
nop
nop
mfence
mov $80, %rcx
rep movsl
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %rax
// Faulty Load
lea addresses_US+0x11813, %r11
nop
nop
nop
cmp $2274, %r14
mov (%r11), %r12d
lea oracles, %r14
and $0xff, %r12
shlq $12, %r12
mov (%r14,%r12,1), %r12
pop %rax
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'00': 133}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Cubical/Data/Unit/Properties.agda | borsiemir/cubical | 0 | 17037 | <gh_stars>0
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Unit.Properties where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Nat
open import Cubical.Data.Unit.Base
isContrUnit : isContr Unit
isContrUnit = tt , λ {tt → refl}
isPropUnit : isProp Unit
isPropUnit _ _ i = tt -- definitionally equal to: isContr→isProp isContrUnit
isOfHLevelUnit : (n : ℕ) → isOfHLevel n Unit
isOfHLevelUnit n = isContr→isOfHLevel n isContrUnit
|
third_party/universal-ctags/ctags/Units/parser-ada.r/ada-generic-in-package.d/input_1.adb | f110/wing | 1 | 19753 | procedure Input_1 is
generic
type T is private;
type Index is range <>;
type Array_T is array (Index range <>) of T;
Null_Value : T;
with function Img (A, B: T) return boolean;
procedure Generic_Reverse_Array (X : in out Array_T);
procedure Generic_Reverse_Array (X : in out Array_T) is
begin
for I in X'First .. (X'Last + X'First) / 2 loop
declare
Tmp : T;
X_Left : T renames X (I);
X_Right : T renames X (X'Last + X'First - I);
begin
Tmp := X_Left;
X_Left := X_Right;
X_Right := Tmp;
end;
end loop;
end Generic_Reverse_Array;
type Color is (None, Black, Red, Green, Blue, White);
type Color_Array is array (Integer range <>) of Color;
procedure Reverse_Color_Array is new Generic_Reverse_Array
(T => Color, Index => Integer, Array_T => Color_Array, Null_Value => None);
type Shape is (None, Circle, Triangle, Square);
type Shape_Array is array (Integer range <>) of Shape;
procedure Reverse_Shape_Array is new Generic_Reverse_Array
(T => Shape, Index => Integer, Array_T => Shape_Array, Null_Value => None);
begin
null;
end Input_1;
|
WRK-V1.2/TOOLS/crt/src/intel/memcpy.asm | intj-t/openvmsft | 0 | 241754 | page ,132
title memcpy - Copy source memory bytes to destination
;***
;memcpy.asm - contains memcpy and memmove routines
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; memcpy() copies a source memory buffer to a destination buffer.
; Overlapping buffers are not treated specially, so propogation may occur.
; memmove() copies a source memory buffer to a destination buffer.
; Overlapping buffers are treated specially, to avoid propogation.
;
;*******************************************************************************
.xlist
include cruntime.inc
.list
M_EXIT macro
ret ; _cdecl return
endm ; M_EXIT
CODESEG
extrn _VEC_memcpy:near
extrn __sse2_available:dword
page
;***
;memcpy - Copy source buffer to destination buffer
;
;Purpose:
; memcpy() copies a source memory buffer to a destination memory buffer.
; This routine does NOT recognize overlapping buffers, and thus can lead
; to propogation.
; For cases where propogation must be avoided, memmove() must be used.
;
; Algorithm:
;
; Same as memmove. See Below
;
;
;memmove - Copy source buffer to destination buffer
;
;Purpose:
; memmove() copies a source memory buffer to a destination memory buffer.
; This routine recognize overlapping buffers to avoid propogation.
; For cases where propogation is not a problem, memcpy() can be used.
;
; Algorithm:
;
; void * memmove(void * dst, void * src, size_t count)
; {
; void * ret = dst;
;
; if (dst <= src || dst >= (src + count)) {
; /*
; * Non-Overlapping Buffers
; * copy from lower addresses to higher addresses
; */
; while (count--)
; *dst++ = *src++;
; }
; else {
; /*
; * Overlapping Buffers
; * copy from higher addresses to lower addresses
; */
; dst += count - 1;
; src += count - 1;
;
; while (count--)
; *dst-- = *src--;
; }
;
; return(ret);
; }
;
;
;Entry:
; void *dst = pointer to destination buffer
; const void *src = pointer to source buffer
; size_t count = number of bytes to copy
;
;Exit:
; Returns a pointer to the destination buffer in AX/DX:AX
;
;Uses:
; CX, DX
;
;Exceptions:
;*******************************************************************************
ifdef MEM_MOVE
_MEM_ equ <memmove>
else ; MEM_MOVE
_MEM_ equ <memcpy>
endif ; MEM_MOVE
% public _MEM_
_MEM_ proc \
dst:ptr byte, \
src:ptr byte, \
count:IWORD
; destination pointer
; source pointer
; number of bytes to copy
; push ebp ;U - save old frame pointer
; mov ebp, esp ;V - set new frame pointer
push edi ;U - save edi
push esi ;V - save esi
mov esi,[src] ;U - esi = source
mov ecx,[count] ;V - ecx = number of bytes to move
mov edi,[dst] ;U - edi = dest
;
; Check for overlapping buffers:
; If (dst <= src) Or (dst >= src + Count) Then
; Do normal (Upwards) Copy
; Else
; Do Downwards Copy to avoid propagation
;
mov eax,ecx ;V - eax = byte count...
mov edx,ecx ;U - edx = byte count...
add eax,esi ;V - eax = point past source end
cmp edi,esi ;U - dst <= src ?
jbe short CopyUp ;V - yes, copy toward higher addresses
cmp edi,eax ;U - dst < (src + count) ?
jb CopyDown ;V - yes, copy toward lower addresses
;
; Copy toward higher addresses.
;
CopyUp:
;
; First, see if we can use a "fast" copy SSE2 routine
; block size greater than min threshold?
cmp ecx,0100h
jb Dword_align
; SSE2 supported?
cmp DWORD PTR __sse2_available,0
je Dword_align
; alignments equal?
push edi
push esi
and edi,15
and esi,15
cmp edi,esi
pop esi
pop edi
jne Dword_align
; do fast SSE2 copy, params already on stack
pop esi
pop edi
pop ebp
jmp _VEC_memcpy
; no return
;
; The algorithm for forward moves is to align the destination to a dword
; boundary and so we can move dwords with an aligned destination. This
; occurs in 3 steps.
;
; - move x = ((4 - Dest & 3) & 3) bytes
; - move y = ((L-x) >> 2) dwords
; - move (L - x - y*4) bytes
;
Dword_align:
test edi,11b ;U - destination dword aligned?
jnz short CopyLeadUp ;V - if we are not dword aligned already, align
shr ecx,2 ;U - shift down to dword count
and edx,11b ;V - trailing byte count
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindUp ;V - if so, then jump
rep movsd ;N - move all of our dwords
jmp dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
;
; Code to do optimal memory copies for non-dword-aligned destinations.
;
; The following length check is done for two reasons:
;
; 1. to ensure that the actual move length is greater than any possiale
; alignment move, and
;
; 2. to skip the multiple move logic for small moves where it would
; be faster to move the bytes with one instruction.
;
align @WordSize
CopyLeadUp:
mov eax,edi ;U - get destination offset
mov edx,11b ;V - prepare for mask
sub ecx,4 ;U - check for really short string - sub for adjust
jb short ByteCopyUp ;V - branch to just copy bytes
and eax,11b ;U - get offset within first dword
add ecx,eax ;V - update size after leading bytes copied
jmp dword ptr LeadUpVec[eax*4-4] ;N - process leading bytes
align @WordSize
ByteCopyUp:
jmp dword ptr TrailUpVec[ecx*4+16] ;N - process just bytes
align @WordSize
CopyUnwindUp:
jmp dword ptr UnwindUpVec[ecx*4] ;N - unwind dword copy
align @WordSize
LeadUpVec dd LeadUp1, LeadUp2, LeadUp3
align @WordSize
LeadUp1:
and edx,ecx ;U - trailing byte count
mov al,[esi] ;V - get first byte from source
mov [edi],al ;U - write second byte to destination
mov al,[esi+1] ;V - get second byte from source
mov [edi+1],al ;U - write second byte to destination
mov al,[esi+2] ;V - get third byte from source
shr ecx,2 ;U - shift down to dword count
mov [edi+2],al ;V - write third byte to destination
add esi,3 ;U - advance source pointer
add edi,3 ;V - advance destination pointer
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindUp ;V - if so, then jump
rep movsd ;N - move all of our dwords
jmp dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
align @WordSize
LeadUp2:
and edx,ecx ;U - trailing byte count
mov al,[esi] ;V - get first byte from source
mov [edi],al ;U - write second byte to destination
mov al,[esi+1] ;V - get second byte from source
shr ecx,2 ;U - shift down to dword count
mov [edi+1],al ;V - write second byte to destination
add esi,2 ;U - advance source pointer
add edi,2 ;V - advance destination pointer
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindUp ;V - if so, then jump
rep movsd ;N - move all of our dwords
jmp dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
align @WordSize
LeadUp3:
and edx,ecx ;U - trailing byte count
mov al,[esi] ;V - get first byte from source
mov [edi],al ;U - write second byte to destination
add esi,1 ;V - advance source pointer
shr ecx,2 ;U - shift down to dword count
add edi,1 ;V - advance destination pointer
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindUp ;V - if so, then jump
rep movsd ;N - move all of our dwords
jmp dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
align @WordSize
UnwindUpVec dd UnwindUp0, UnwindUp1, UnwindUp2, UnwindUp3
dd UnwindUp4, UnwindUp5, UnwindUp6, UnwindUp7
UnwindUp7:
mov eax,[esi+ecx*4-28] ;U - get dword from source
;V - spare
mov [edi+ecx*4-28],eax ;U - put dword into destination
UnwindUp6:
mov eax,[esi+ecx*4-24] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-24],eax ;U - put dword into destination
UnwindUp5:
mov eax,[esi+ecx*4-20] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-20],eax ;U - put dword into destination
UnwindUp4:
mov eax,[esi+ecx*4-16] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-16],eax ;U - put dword into destination
UnwindUp3:
mov eax,[esi+ecx*4-12] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-12],eax ;U - put dword into destination
UnwindUp2:
mov eax,[esi+ecx*4-8] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-8],eax ;U - put dword into destination
UnwindUp1:
mov eax,[esi+ecx*4-4] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4-4],eax ;U - put dword into destination
lea eax,[ecx*4] ;V - compute update for pointer
add esi,eax ;U - update source pointer
add edi,eax ;V - update destination pointer
UnwindUp0:
jmp dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
;-----------------------------------------------------------------------------
align @WordSize
TrailUpVec dd TrailUp0, TrailUp1, TrailUp2, TrailUp3
align @WordSize
TrailUp0:
mov eax,[dst] ;U - return pointer to destination
pop esi ;V - restore esi
pop edi ;U - restore edi
;V - spare
M_EXIT
align @WordSize
TrailUp1:
mov al,[esi] ;U - get byte from source
;V - spare
mov [edi],al ;U - put byte in destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
align @WordSize
TrailUp2:
mov al,[esi] ;U - get first byte from source
;V - spare
mov [edi],al ;U - put first byte into destination
mov al,[esi+1] ;V - get second byte from source
mov [edi+1],al ;U - put second byte into destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
align @WordSize
TrailUp3:
mov al,[esi] ;U - get first byte from source
;V - spare
mov [edi],al ;U - put first byte into destination
mov al,[esi+1] ;V - get second byte from source
mov [edi+1],al ;U - put second byte into destination
mov al,[esi+2] ;V - get third byte from source
mov [edi+2],al ;U - put third byte into destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
;
; Copy down to avoid propogation in overlapping buffers.
;
align @WordSize
CopyDown:
lea esi,[esi+ecx-4] ;U - point to 4 bytes before src buffer end
lea edi,[edi+ecx-4] ;V - point to 4 bytes before dest buffer end
;
; See if the destination start is dword aligned
;
test edi,11b ;U - test if dword aligned
jnz short CopyLeadDown ;V - if not, jump
shr ecx,2 ;U - shift down to dword count
and edx,11b ;V - trailing byte count
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindDown ;V - if so, then jump
std ;N - set direction flag
rep movsd ;N - move all of our dwords
cld ;N - clear direction flag back
jmp dword ptr TrailDownVec[edx*4] ;N - process trailing bytes
align @WordSize
CopyUnwindDown:
neg ecx ;U - negate dword count for table merging
;V - spare
jmp dword ptr UnwindDownVec[ecx*4+28] ;N - unwind copy
align @WordSize
CopyLeadDown:
mov eax,edi ;U - get destination offset
mov edx,11b ;V - prepare for mask
cmp ecx,4 ;U - check for really short string
jb short ByteCopyDown ;V - branch to just copy bytes
and eax,11b ;U - get offset within first dword
sub ecx,eax ;U - to update size after lead copied
jmp dword ptr LeadDownVec[eax*4-4] ;N - process leading bytes
align @WordSize
ByteCopyDown:
jmp dword ptr TrailDownVec[ecx*4] ;N - process just bytes
align @WordSize
LeadDownVec dd LeadDown1, LeadDown2, LeadDown3
align @WordSize
LeadDown1:
mov al,[esi+3] ;U - load first byte
and edx,ecx ;V - trailing byte count
mov [edi+3],al ;U - write out first byte
sub esi,1 ;V - point to last src dword
shr ecx,2 ;U - shift down to dword count
sub edi,1 ;V - point to last dest dword
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindDown ;V - if so, then jump
std ;N - set direction flag
rep movsd ;N - move all of our dwords
cld ;N - clear direction flag
jmp dword ptr TrailDownVec[edx*4] ;N - process trailing bytes
align @WordSize
LeadDown2:
mov al,[esi+3] ;U - load first byte
and edx,ecx ;V - trailing byte count
mov [edi+3],al ;U - write out first byte
mov al,[esi+2] ;V - get second byte from source
shr ecx,2 ;U - shift down to dword count
mov [edi+2],al ;V - write second byte to destination
sub esi,2 ;U - point to last src dword
sub edi,2 ;V - point to last dest dword
cmp ecx,8 ;U - test if small enough for unwind copy
jb short CopyUnwindDown ;V - if so, then jump
std ;N - set direction flag
rep movsd ;N - move all of our dwords
cld ;N - clear direction flag
jmp dword ptr TrailDownVec[edx*4] ;N - process trailing bytes
align @WordSize
LeadDown3:
mov al,[esi+3] ;U - load first byte
and edx,ecx ;V - trailing byte count
mov [edi+3],al ;U - write out first byte
mov al,[esi+2] ;V - get second byte from source
mov [edi+2],al ;U - write second byte to destination
mov al,[esi+1] ;V - get third byte from source
shr ecx,2 ;U - shift down to dword count
mov [edi+1],al ;V - write third byte to destination
sub esi,3 ;U - point to last src dword
sub edi,3 ;V - point to last dest dword
cmp ecx,8 ;U - test if small enough for unwind copy
jb CopyUnwindDown ;V - if so, then jump
std ;N - set direction flag
rep movsd ;N - move all of our dwords
cld ;N - clear direction flag
jmp dword ptr TrailDownVec[edx*4] ;N - process trailing bytes
;------------------------------------------------------------------
align @WordSize
UnwindDownVec dd UnwindDown7, UnwindDown6, UnwindDown5, UnwindDown4
dd UnwindDown3, UnwindDown2, UnwindDown1, UnwindDown0
UnwindDown7:
mov eax,[esi+ecx*4+28] ;U - get dword from source
;V - spare
mov [edi+ecx*4+28],eax ;U - put dword into destination
UnwindDown6:
mov eax,[esi+ecx*4+24] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+24],eax ;U - put dword into destination
UnwindDown5:
mov eax,[esi+ecx*4+20] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+20],eax ;U - put dword into destination
UnwindDown4:
mov eax,[esi+ecx*4+16] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+16],eax ;U - put dword into destination
UnwindDown3:
mov eax,[esi+ecx*4+12] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+12],eax ;U - put dword into destination
UnwindDown2:
mov eax,[esi+ecx*4+8] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+8],eax ;U - put dword into destination
UnwindDown1:
mov eax,[esi+ecx*4+4] ;U(entry)/V(not) - get dword from source
;V(entry) - spare
mov [edi+ecx*4+4],eax ;U - put dword into destination
lea eax,[ecx*4] ;V - compute update for pointer
add esi,eax ;U - update source pointer
add edi,eax ;V - update destination pointer
UnwindDown0:
jmp dword ptr TrailDownVec[edx*4] ;N - process trailing bytes
;-----------------------------------------------------------------------------
align @WordSize
TrailDownVec dd TrailDown0, TrailDown1, TrailDown2, TrailDown3
align @WordSize
TrailDown0:
mov eax,[dst] ;U - return pointer to destination
;V - spare
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
align @WordSize
TrailDown1:
mov al,[esi+3] ;U - get byte from source
;V - spare
mov [edi+3],al ;U - put byte in destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
align @WordSize
TrailDown2:
mov al,[esi+3] ;U - get first byte from source
;V - spare
mov [edi+3],al ;U - put first byte into destination
mov al,[esi+2] ;V - get second byte from source
mov [edi+2],al ;U - put second byte into destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
align @WordSize
TrailDown3:
mov al,[esi+3] ;U - get first byte from source
;V - spare
mov [edi+3],al ;U - put first byte into destination
mov al,[esi+2] ;V - get second byte from source
mov [edi+2],al ;U - put second byte into destination
mov al,[esi+1] ;V - get third byte from source
mov [edi+1],al ;U - put third byte into destination
mov eax,[dst] ;V - return pointer to destination
pop esi ;U - restore esi
pop edi ;V - restore edi
M_EXIT
_MEM_ endp
end
|
oeis/173/A173686.asm | neoneye/loda-programs | 11 | 174201 | ; A173686: Periodic with period 12: repeat [2,8,2,2,8,5,5,8,5,5,8,2].
; Submitted by <NAME>(s3)
; 2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2,8,5,5,8,5,5,8,2,2,8,2,2
mov $1,$0
mul $0,29
mul $1,58
sub $1,$0
lpb $1
mul $0,2
sub $0,2
sub $1,6
lpe
mod $0,3
mul $0,3
add $0,2
|
system/requireMinimumSystemVersion.applescript | adriannier/applescript-functions | 7 | 2157 | (*
Checks if the specified minimum system version is available.
*)
requireMinimumSystemVersion("10.4.11")
requireMinimumSystemVersion("10.14.2")
requireMinimumSystemVersion("12.3.4")
on requireMinimumSystemVersion(minimumSystemVersion)
set currentVersion to parseVersionString(do shell script "sw_vers -productVersion")
set requiredVersion to parseVersionString(minimumSystemVersion)
if (majorVersion of currentVersion) < (majorVersion of requiredVersion) then
set requirementsMet to false
else if (majorVersion of currentVersion) = (majorVersion of requiredVersion) then
if (minorVersion of currentVersion) < (minorVersion of requiredVersion) then
set requirementsMet to false
else if (minorVersion of currentVersion) = (minorVersion of requiredVersion) then
if (theRevision of currentVersion) < (theRevision of requiredVersion) then
set requirementsMet to false
else
set requirementsMet to true
end if
else
set requirementsMet to true
end if
else
set requirementsMet to true
end if
if requirementsMet then return true
-- Display a dialog if requirements are not met
try
set targetLanguage to first word of (do shell script "defaults read NSGlobalDomain AppleLanguages")
on error
set targetLanguage to "en"
end try
if targetLanguage is "de" then
set dialogTitle to "Nicht unterst" & (ASCII character 159) & "tztes System"
set dialogMessage to "Dieses Skript erfordert mindestens die Systemversion " & minimumSystemVersion & ". "
else
set dialogTitle to "System not supported"
set dialogMessage to "This script requires at least system version " & minimumSystemVersion & ". "
end if
activate
if (majorVersion of currentVersion) ≥ 10 and (minorVersion of currentVersion) ≥ 4 then
display alert dialogTitle message dialogMessage buttons {"OK"} default button "OK" as warning
else
display dialog dialogTitle & return & return & dialogMessage buttons {"OK"} default button "OK" with icon 2
end if
return false
end requireMinimumSystemVersion
on parseVersionString(versionString)
set prvDlmt to text item delimiters
set text item delimiters to "."
try
set majorVersion to (text item 1 of versionString) as integer
on error
set majorVersion to 0
end try
try
set minorVersion to (text item 2 of versionString) as integer
on error
set minorVersion to 0
end try
try
set theRevision to (text item 3 of versionString) as integer
on error
set theRevision to 0
end try
set text item delimiters to prvDlmt
return {majorVersion:majorVersion, minorVersion:minorVersion, theRevision:theRevision}
end parseVersionString |
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_1244.asm | ljhsiun2/medusa | 9 | 244780 | <filename>Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0xca_notsx.log_21829_1244.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x3097, %r11
nop
nop
sub $20507, %rcx
movups (%r11), %xmm5
vpextrq $1, %xmm5, %r8
cmp $26025, %r9
lea addresses_normal_ht+0x82a7, %rsi
nop
nop
nop
and %rax, %rax
mov (%rsi), %rdx
and %r11, %r11
lea addresses_UC_ht+0xdf57, %rsi
add %r11, %r11
mov $0x6162636465666768, %r8
movq %r8, %xmm5
vmovups %ymm5, (%rsi)
nop
nop
add $32291, %rax
lea addresses_A_ht+0x16017, %rax
nop
nop
nop
nop
dec %rsi
mov $0x6162636465666768, %r9
movq %r9, (%rax)
nop
nop
nop
sub $49731, %rsi
lea addresses_WC_ht+0x1b237, %rdx
nop
nop
nop
sub $34072, %r9
vmovups (%rdx), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %r11
nop
nop
nop
nop
cmp $56718, %r9
lea addresses_WC_ht+0x3497, %r9
nop
nop
nop
nop
nop
xor %r11, %r11
movups (%r9), %xmm7
vpextrq $1, %xmm7, %rdx
sub $11626, %rax
lea addresses_WC_ht+0x9ed7, %rsi
lea addresses_normal_ht+0x1e897, %rdi
nop
xor %rdx, %rdx
mov $60, %rcx
rep movsq
nop
nop
sub $8685, %rax
lea addresses_WC_ht+0x1c317, %rsi
lea addresses_normal_ht+0x6497, %rdi
xor $5032, %r11
mov $26, %rcx
rep movsb
nop
nop
nop
cmp $6266, %rax
lea addresses_UC_ht+0x15eb, %r8
clflush (%r8)
nop
nop
nop
nop
add $40752, %rcx
mov (%r8), %ax
nop
nop
nop
inc %r9
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
// Load
lea addresses_WC+0x16097, %rdi
nop
nop
nop
nop
nop
sub %r10, %r10
movups (%rdi), %xmm0
vpextrq $0, %xmm0, %rbx
nop
nop
nop
nop
cmp %r12, %r12
// Store
lea addresses_UC+0xf497, %rdi
inc %r10
movb $0x51, (%rdi)
nop
cmp $1458, %r15
// REPMOV
lea addresses_UC+0x5097, %rsi
lea addresses_UC+0x14d57, %rdi
nop
inc %r14
mov $107, %rcx
rep movsb
nop
nop
inc %rsi
// Faulty Load
lea addresses_UC+0xf497, %r10
nop
nop
nop
sub %r14, %r14
movb (%r10), %r15b
lea oracles, %r12
and $0xff, %r15
shlq $12, %r15
mov (%r12,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': True}}
{'src': {'type': 'addresses_UC', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC', 'congruent': 6, 'same': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 6, 'NT': True, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': True, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
src/SlimShader.Tests/Shaders/Sdk/Direct3D11/CascadedShadowMaps11/RenderCascadeScene_PS.asm | tgjones/slimshader | 125 | 13636 | //
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20714
//
//
///
// Buffer Definitions:
//
// cbuffer cbAllShadowData
// {
//
// float4x4 m_mWorldViewProjection; // Offset: 0 Size: 64 [unused]
// float4x4 m_mWorld; // Offset: 64 Size: 64 [unused]
// float4x4 m_mWorldView; // Offset: 128 Size: 64 [unused]
// float4x4 m_mShadow; // Offset: 192 Size: 64 [unused]
// float4 m_vCascadeOffset[8]; // Offset: 256 Size: 128
// float4 m_vCascadeScale[8]; // Offset: 384 Size: 128
// int m_nCascadeLevels; // Offset: 512 Size: 4 [unused]
// int m_iVisualizeCascades; // Offset: 516 Size: 4
// int m_iPCFBlurForLoopStart; // Offset: 520 Size: 4
// int m_iPCFBlurForLoopEnd; // Offset: 524 Size: 4
// float m_fMinBorderPadding; // Offset: 528 Size: 4
// float m_fMaxBorderPadding; // Offset: 532 Size: 4
// float m_fShadowBiasFromGUI; // Offset: 536 Size: 4
// float m_fShadowPartitionSize; // Offset: 540 Size: 4
// float m_fCascadeBlendArea; // Offset: 544 Size: 4 [unused]
// float m_fTexelSize; // Offset: 548 Size: 4
// float m_fNativeTexelSizeInX; // Offset: 552 Size: 4
// float m_fPaddingForCB3; // Offset: 556 Size: 4 [unused]
// float4 m_fCascadeFrustumsEyeSpaceDepthsFloat[2];// Offset: 560 Size: 32 [unused]
// float4 m_fCascadeFrustumsEyeSpaceDepthsFloat4[8];// Offset: 592 Size: 128 [unused]
// float3 m_vLightDir; // Offset: 720 Size: 12
// float m_fPaddingCB4; // Offset: 732 Size: 4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_samLinear sampler NA NA 0 1
// g_samShadow sampler_c NA NA 5 1
// g_txDiffuse texture float4 2d 0 1
// g_txShadow texture float4 2d 5 1
// cbAllShadowData cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// NORMAL 0 xyz 0 NONE float xyz
// TEXCOORD 0 xy 1 NONE float xy
// TEXCOORD 3 z 1 NONE float
// TEXCOORD 1 xyzw 2 NONE float xyz
// SV_POSITION 0 xyzw 3 POS float
// TEXCOORD 2 xyzw 4 NONE float
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_4_0
dcl_immediateConstantBuffer { { 1.500000, 0, 0, 1.000000},
{ 0, 1.500000, 0, 1.000000},
{ 0, 0, 5.500000, 1.000000},
{ 1.500000, 0, 5.500000, 1.000000},
{ 1.500000, 1.500000, 0, 1.000000},
{ 1.000000, 1.000000, 1.000000, 1.000000},
{ 0, 1.000000, 5.500000, 1.000000},
{ 0.500000, 3.500000, 0.750000, 1.000000} }
dcl_constantbuffer cb0[46], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s5, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t5
dcl_input_ps linear v0.xyz
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 5
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
iadd r1.x, -cb0[32].z, cb0[32].w
imul null, r1.x, r1.x, r1.x
itof r1.x, r1.x
mov r2.x, l(1)
mov r1.yzw, l(0,0,0,0)
mov r3.xy, l(0,0,0,0)
mov r2.y, l(0)
loop
ilt r2.z, r2.y, l(3)
ieq r2.w, r3.x, l(0)
and r2.z, r2.w, r2.z
breakc_z r2.z
mad r1.yzw, v2.xxyz, cb0[r2.y + 24].xxyz, cb0[r2.y + 16].xxyz
min r2.z, r1.z, r1.y
lt r2.z, cb0[33].x, r2.z
max r2.w, r1.z, r1.y
lt r2.w, r2.w, cb0[33].y
and r2.z, r2.w, r2.z
movc r3.xy, r2.zzzz, r2.xyxx, r3.xyxx
iadd r2.y, r2.y, l(1)
endloop
itof r2.x, r3.y
mul r2.x, r2.x, cb0[33].w
mad r1.y, r1.y, cb0[33].w, r2.x
add r1.w, r1.w, -cb0[33].z
mov r2.x, l(0)
mov r2.y, cb0[32].z
loop
ige r2.z, r2.y, cb0[32].w
breakc_nz r2.z
itof r2.z, r2.y
mad r4.x, r2.z, cb0[34].z, r1.y
mov r2.z, r2.x
mov r2.w, cb0[32].z
loop
ige r3.x, r2.w, cb0[32].w
breakc_nz r3.x
itof r3.x, r2.w
mad r4.y, r3.x, cb0[34].y, r1.z
sample_c_lz r3.x, r4.xyxx, t5.xxxx, s5, r1.w
add r2.z, r2.z, r3.x
iadd r2.w, r2.w, l(1)
endloop
mov r2.x, r2.z
iadd r2.y, r2.y, l(1)
endloop
div r1.x, r2.x, r1.x
mov r2.xyz, icb[r3.y + 0].xyzx
mov r2.w, l(1.000000)
movc r2.xyzw, cb0[32].yyyy, r2.xyzw, l(1.000000,1.000000,1.000000,1.000000)
dp3_sat r1.y, l(-1.000000, 1.000000, -1.000000, 0.000000), v0.xyzx
dp3_sat r1.z, l(1.000000, 1.000000, -1.000000, 0.000000), v0.xyzx
mul r1.z, r1.z, l(0.050000)
mad r1.y, r1.y, l(0.050000), r1.z
mov_sat r1.z, -v0.y
mad r1.y, r1.z, l(0.050000), r1.y
dp3_sat r1.z, l(1.000000, 1.000000, 1.000000, 0.000000), v0.xyzx
mad r1.y, r1.z, l(0.050000), r1.y
mul r1.z, r1.y, l(0.500000)
dp3_sat r1.w, cb0[45].xyzx, v0.xyzx
add r1.w, r1.w, r1.y
mad r1.y, -r1.y, l(0.500000), r1.w
mad r1.x, r1.x, r1.y, r1.z
mul r1.xyzw, r2.xyzw, r1.xxxx
mul o0.xyzw, r0.xyzw, r1.xyzw
ret
// Approximately 67 instruction slots used
|
Task/Fast-Fourier-transform/Ada/fast-fourier-transform-2.ada | LaudateCorpus1/RosettaCodeData | 1 | 22543 | with Ada.Numerics;
with Ada.Numerics.Generic_Complex_Elementary_Functions;
function Generic_FFT (X : Complex_Vector) return Complex_Vector is
package Complex_Elementary_Functions is
new Ada.Numerics.Generic_Complex_Elementary_Functions
(Complex_Arrays.Complex_Types);
use Ada.Numerics;
use Complex_Elementary_Functions;
use Complex_Arrays.Complex_Types;
function FFT (X : Complex_Vector; N, S : Positive)
return Complex_Vector is
begin
if N = 1 then
return (1..1 => X (X'First));
else
declare
F : constant Complex := exp (Pi * j / Real_Arrays.Real (N/2));
Even : Complex_Vector := FFT (X, N/2, 2*S);
Odd : Complex_Vector := FFT (X (X'First + S..X'Last), N/2, 2*S);
begin
for K in 0..N/2 - 1 loop
declare
T : constant Complex := Odd (Odd'First + K) / F ** K;
begin
Odd (Odd'First + K) := Even (Even'First + K) - T;
Even (Even'First + K) := Even (Even'First + K) + T;
end;
end loop;
return Even & Odd;
end;
end if;
end FFT;
begin
return FFT (X, X'Length, 1);
end Generic_FFT;
|
boot/head.asm | archibate/ChaOS | 2 | 86476 | <filename>boot/head.asm<gh_stars>1-10
; vim: ft=nasm ai
%include "boot.inc"
org 0x7e00
[BITS 16]
_start:
xor ax, ax
mov ds, ax
mov es, ax
mov si, msg_setup
call print
enable_32:
cli
call delay
mov al, 0xd1
out 0x64, al
call delay
mov al, 0xdf
out 0x60, al
call delay
lgdt [gdtr0]
lidt [idtr0]
mov eax, cr0
or eax, 0x1
mov cr0, eax
jmp .flush
.flush:
mov ax, 0x0010
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp dword 0x0008:start32
delay:
in al, 0x64
and al, 0x02
jnz delay
ret
print:
mov ah, 0x0e
mov bx, 15
.loop:
lodsb
test al, al
jz .done
int 0x10
jmp .loop
.done:
ret
alignb 16
gdt0:
dw 0x0000, 0x0000, 0x0000, 0x0000
dw 0xffff, 0x0000, 0x9a00, 0x00cf
dw 0xffff, 0x0000, 0x9200, 0x00cf
dw 0xffff, 0x0000, 0xfa00, 0x00cf
dw 0xffff, 0x0000, 0xf200, 0x00cf
dw 0x0000, 0x0000, 0x0000, 0x0000
dw 0x0000, 0x0000, 0x0000, 0x0000
gdtr0:
dw $-gdt0-1
dd gdt0
idtr0:
dw 0
dd 0
msg_setup:
db "Seting up kernel...", 0
[BITS 32]
start32:
lea edi, [kernel + KFSIZ]
mov ecx, KZSIZ
xor eax, eax
rep stosb
jmp kernel
times 512-($-$$) db 0
kernel:
|
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/Pause-p.asm | prismotizm/gigaleak | 0 | 24158 | Name: Pause-p.asm
Type: file
Size: 45691
Last-Modified: '1992-07-29T15:00:00Z'
SHA-1: 2551DE977DA0715564E8835295DB1CAA14AB56E6
Description: null
|
source/streams/machine-pc-freebsd/s-naiona.adb | ytomino/drake | 33 | 15632 | with System.Address_To_Named_Access_Conversions;
with System.Zero_Terminated_Strings;
with C.stdlib;
package body System.Native_IO.Names is
use type C.char;
use type C.char_ptr;
use type C.size_t;
function strlen (s : not null access constant C.char) return C.size_t
with Import,
Convention => Intrinsic, External_Name => "__builtin_strlen";
package Name_Pointer_Conv is
new Address_To_Named_Access_Conversions (Name_Character, Name_Pointer);
-- implementation
procedure Open_Ordinary (
Method : Open_Method;
Handle : aliased out Handle_Type;
Mode : File_Mode;
Name : String;
Out_Name : aliased out Name_Pointer;
Form : Packed_Form)
is
Name_Length : constant Natural := Name'Length;
Out_Name_Length : C.size_t;
begin
if Name (Name'First) = '/' then
-- absolute path
Out_Name := Name_Pointer_Conv.To_Pointer (
Address (
C.stdlib.malloc (
C.size_t (Name_Length) * Zero_Terminated_Strings.Expanding
+ 1))); -- NUL
if Out_Name = null then
raise Storage_Error;
end if;
Out_Name_Length := 0;
else
-- current directory
Out_Name := C.unistd.getcwd (null, 0);
Out_Name_Length := strlen (Out_Name);
-- reuse the memory from malloc (similar to reallocf)
declare
New_Out_Name : constant Name_Pointer :=
Name_Pointer_Conv.To_Pointer (
Address (
C.stdlib.realloc (
C.void_ptr (Name_Pointer_Conv.To_Address (Out_Name)),
Out_Name_Length
+ C.size_t (Name_Length)
* Zero_Terminated_Strings.Expanding
+ 2))); -- '/' & NUL
begin
if New_Out_Name = null then
raise Storage_Error;
end if;
Out_Name := New_Out_Name;
end;
-- append slash
declare
Out_Name_All : Name_String (0 .. Out_Name_Length); -- '/'
for Out_Name_All'Address use
Name_Pointer_Conv.To_Address (Out_Name);
begin
if Out_Name_All (Out_Name_Length - 1) /= '/' then
Out_Name_All (Out_Name_Length) := '/';
Out_Name_Length := Out_Name_Length + 1;
end if;
end;
end if;
-- append Item
declare
Out_Name_All : Name_String (0 .. Out_Name_Length); -- NUL
for Out_Name_All'Address use Name_Pointer_Conv.To_Address (Out_Name);
begin
Zero_Terminated_Strings.To_C (
Name,
Out_Name_All (Out_Name_Length)'Access);
end;
-- open
Open_Ordinary (Method, Handle, Mode, Out_Name, Form);
end Open_Ordinary;
end System.Native_IO.Names;
|
tests/miaf/valid-exif.asm | gpac/ComplianceWarden | 3 | 243697 | <reponame>gpac/ComplianceWarden<gh_stars>1-10
%define BE(a) ( ((((a)>>24)&0xFF) << 0) + ((((a)>>16)&0xFF) << 8) + ((((a)>>8)&0xFF) << 16) + ((((a)>>0)&0xFF) << 24))
ftyp_start:
dd BE(ftyp_end - ftyp_start)
dd "ftyp"
db 0x61, 0x76, 0x69, 0x66 ; brand(32) ('avif')
db 0x00, 0x00, 0x00, 0x00 ; version(32)
db 0x6D, 0x69, 0x66, 0x31 ; compatible_brand(32) ('mif1')
db 0x61, 0x76, 0x69, 0x66 ; compatible_brand(32) ('avif')
db 0x6D, 0x69, 0x61, 0x66 ; compatible_brand(32) ('miaf')
db 0x4D, 0x41, 0x31, 0x42 ; compatible_brand(32) ('MA1B')
ftyp_end:
meta_start:
dd BE(meta_end - meta_start)
dd "meta"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
hdlr_start:
dd BE(hdlr_end - hdlr_start)
dd "hdlr"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x00 ; pre_defined(32)
db 0x70, 0x69, 0x63, 0x74 ; handler_type(32) ('pict')
db 0x00, 0x00, 0x00, 0x00 ; reserved1(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved2(32)
db 0x00, 0x00, 0x00, 0x00 ; reserved3(32)
db 0x00 ; name(8)
hdlr_end:
pitm_start:
dd BE(pitm_end - pitm_start)
dd "pitm"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x01 ; item_ID(16)
pitm_end:
iinf_start:
dd BE(iinf_end - iinf_start)
dd "iinf"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x02 ; entry_count(16)
infe_start:
dd BE(infe_end - infe_start)
dd "infe"
db 0x02 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x01 ; item_ID(16)
db 0x00, 0x00 ; item_protection_index(16)
db 0x61, 0x76, 0x30, 0x31 ; item_type(32) ('av01')
db 0x00 ; item_name(8)
infe_end:
infe2_start:
dd BE(infe2_end - infe2_start)
dd "infe"
db 0x02 ; version(8)
db 0x00, 0x00, 0x01 ; flags(24)
db 0x00, 0x02 ; item_ID(16)
db 0x00, 0x00 ; item_protection_index(16)
db 0x45, 0x78, 0x69, 0x66 ; item_type(32) ('Exif')
db 0x00 ; item_name(8)
infe2_end:
iinf_end:
iloc_start:
dd BE(iloc_end - iloc_start)
dd "iloc"
db 0x01 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x44 ; offset_size(4) ('D') length_size(4) ('D')
db 0x00 ; base_offset_size(4) reserved1(4)
db 0x00, 0x02 ; item_count(16)
db 0x00, 0x01 ; item_ID(16)
db 0x00, 0x00 ; "reserved2(12)" "construction_method(4)"
db 0x00, 0x00 ; data_reference_index(16)
; base_offset(0)
db 0x00, 0x01 ; extent_count(16)
dd BE(mdat_start - ftyp_start + 8) ; extent_offset(32)
db 0x00, 0x00, 0x00, 0x01 ; extent_length(32)
db 0x00, 0x02 ; item_ID(16)
db 0x00, 0x00 ; "reserved2(12)" "construction_method(4)"
db 0x00, 0x00 ; data_reference_index(16)
; base_offset(0)
db 0x00, 0x01 ; extent_count(16)
dd BE(mdat_start - ftyp_start + 8) ; extent_offset(32)
db 0x00, 0x00, 0x00, 0x01 ; extent_length(32)
iloc_end:
iprp_start:
dd BE(iprp_end - iprp_start)
dd "iprp"
ipco_start:
dd BE(ipco_end - ipco_start)
dd "ipco"
ispe_start:
dd BE(ispe_end - ispe_start)
dd "ispe"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x07, 0x80 ; image_width(32)
db 0x00, 0x00, 0x04, 0x38 ; image_height(32)
ispe_end:
colr_start:
dd BE(colr_end - colr_start)
dd "colr"
db 0x6E ; (8) ('n')
db 0x63 ; (8) ('c')
db 0x6C ; (8) ('l')
db 0x78 ; (8) ('x')
db 0x00 ; (8)
db 0x02 ; (8)
db 0x00 ; (8)
db 0x02 ; (8)
db 0x00 ; (8)
db 0x02 ; (8)
db 0x80 ; (8)
colr_end:
av1C_start:
dd BE(av1C_end - av1C_start)
dd "av1C"
db 0x81 ; marker(1) version(7)
db 0x09 ; seq_profile(3) seq_level_idx_0(5)
db 0x0C ; seq_tier_0(1) high_bitdepth(1) twelve_bit(1) monochrome(1) chroma_subsampling_x(1) chroma_subsampling_y(1) chroma_sample_position(2)
db 0x00 ; reserved(3) initial_presentation_delay_present(1) reserved(4)
; configOBUs(0)
; obu(0)
db 0x0A ; forbidden(1) obu_type(4) obu_extension_flag(1) obu_has_size_field(1) obu_reserved_1bit(1)
db 0x0B ; leb128_byte(8)
; seqhdr(0)
db 0x00, 0x00, 0x00 ; seq_profile(3) still_picture(1) reduced_still_picture_header(1) timing_info_present_flag(1) initial_display_delay_present_flag(1) operating_points_cnt_minus_1(5) operating_point_idc[i])(12)
db 0x4A, 0xAB, 0xBF, 0xC3, 0x77 ; seq_level_idx[i](5) seq_tier[i](1) frame_width_bits_minus_1(4) frame_height_bits_minus_1(4) max_frame_width_minus_1(11) max_frame_height_minus_1(11) frame_id_numbers_present_flag(1) use_128x128_superblock(1) enable_filter_intra(1) enable_intra_edge_filter(1)
db 0xFF ; enable_interintra_compound(1) enable_masked_compound(1) enable_warped_motion(1) enable_dual_filter(1) enable_order_hint(1) enable_jnt_comp(1) enable_ref_frame_mvs(1) seq_choose_screen_content_tools(1)
db 0xE6 ; seq_choose_integer_mv(1) order_hint_bits_minus_1(3) enable_superres(1) enable_cdef(1) enable_restoration(1) high_bitdepth(1)
db 0x01 ; mono_chrome(1) color_description_present_flag(1) color_range(1) chroma_sample_position(1) separate_uv_delta_q(1) film_grain_params_present(1) bits(2)
; /seqhdr(0)
av1C_end:
pixi_start:
dd BE(pixi_end - pixi_start)
dd "pixi"
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x03 ; (8)
db 0x08 ; (8)
db 0x08 ; (8)
db 0x08 ; (8)
pixi_end:
irot_start:
dd BE(irot_end - irot_start)
dd "irot"
db 0x03 ; (8)
irot_end:
ipco_end:
ipma_start:
dd BE(ipma_end - ipma_start)
dd "ipma"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x01 ; entry_count(32)
db 0x00, 0x01 ; item_ID(16)
db 0x05 ; association_count(8)
db 0x01 ; essential(1) property_index(7)
db 0x02 ; essential(1) property_index(7)
db 0x83 ; essential(1) property_index(7)
db 0x04 ; essential(1) property_index(7)
db 0x85 ; essential(1) property_index(7)
ipma_end:
iprp_end:
iref_start:
dd BE(iref_end - iref_start)
dd "iref"
db 0x00 ; version(8)
db 0x00, 0x00, 0x00 ; flags(24)
db 0x00, 0x00, 0x00, 0x0E ; box_size(32)
db 0x63, 0x64, 0x73, 0x63 ; box_type(32) ('cdsc')
db 0x00, 0x02 ; from_item_ID(16)
db 0x00, 0x01 ; reference_count(16)
db 0x00, 0x01 ; to_item_ID(16)
iref_end:
meta_end:
free_start:
dd BE(free_end - free_start)
dd "free"
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
db 0x00 ; (8)
free_end:
mdat_start:
dd BE(mdat_end - mdat_start)
db "mdat"
db 0x00
mdat_end:
; vim: syntax=nasm
|
Semester_4/ASK/9.asm | BeBa17/My_University | 0 | 27065 | ; wyswietlanie cyfr 0-9 na każdym wyświetlaczu po kolei
$mod842
org 0
start:
mov R1, #10
mov A, #00h
etyk:
mov P2, A
call delay
inc A
djnz R1, etyk
add A, #10h
anl A, #00110000b ; wyświetlacze: 00->01->10->11->00-> ...
jmp etyk
delay:
mov R2, #0fh
d1:
mov R3, #0ffh
d2:
mov R4, #0ffh
djnz R4, $
djnz R3, d2
djnz R2, d1
ret
end |
libsrc/_DEVELOPMENT/adt/wa_priority_queue/c/sdcc_iy/wa_priority_queue_empty_fastcall.asm | jpoikela/z88dk | 640 | 80728 | <reponame>jpoikela/z88dk
; int wa_priority_queue_empty_fastcall(wa_priority_queue_t *q)
SECTION code_clib
SECTION code_adt_wa_priority_queue
PUBLIC _wa_priority_queue_empty_fastcall
EXTERN asm_wa_priority_queue_empty
defc _wa_priority_queue_empty_fastcall = asm_wa_priority_queue_empty
|
src/sdl-video-gl.adb | alire-project/sdlada | 0 | 10268 | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2018 <NAME>
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with Interfaces.C;
with Interfaces.C.Strings;
private with SDL.C_Pointers;
with SDL.Error;
package body SDL.Video.GL is
package C renames Interfaces.C;
use type C.int;
use type SDL.C_Pointers.GL_Context_Pointer;
type Attributes is
(Attribute_Red_Size,
Attribute_Green_Size,
Attribute_Blue_Size,
Attribute_Alpha_Size,
Attribute_Buffer_Size,
Attribute_Double_Buffer,
Attribute_Depth_Buffer_Size,
Attribute_Stencil_Size,
Attribute_Accumulator_Red_Size,
Attribute_Accumulator_Green_Size,
Attribute_Accumulator_Blue_Size,
Attribute_Accumulator_Alpha_Size,
Attribute_Stereo,
Attribute_Multisample_Buffers,
Attribute_Multisample_Samples,
Attribute_Accelerated,
Attribute_Retained_Backing,
Attribute_Context_Major_Version,
Attribute_Context_Minor_Version,
Attribute_Context_EGL,
Attribute_Context_Flags,
Attribute_Context_Profile,
Attribute_Share_With_Current_Context) with
Convention => C;
function To_int is new Ada.Unchecked_Conversion (Source => Profiles, Target => C.int);
function SDL_GL_Set_Attribute (Attr : in Attributes; Value : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_SetAttribute";
function SDL_GL_Get_Attribute (Attr : in Attributes; Value : out C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_GetAttribute";
function Red_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Red_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Red_Size;
procedure Set_Red_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Red_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Red_Size;
function Green_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Green_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Green_Size;
procedure Set_Green_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Green_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Green_Size;
function Blue_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Blue_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Blue_Size;
procedure Set_Blue_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Blue_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Blue_Size;
function Alpha_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Alpha_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Alpha_Size;
procedure Set_Alpha_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Alpha_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Alpha_Size;
function Buffer_Size return Buffer_Sizes is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Buffer_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Buffer_Sizes (Data);
end Buffer_Size;
procedure Set_Buffer_Size (Size : in Buffer_Sizes) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Buffer_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Buffer_Size;
function Is_Double_Buffered return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Double_Buffer, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Data = 1);
end Is_Double_Buffered;
procedure Set_Double_Buffer (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Double_Buffer, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Double_Buffer;
function Depth_Buffer_Size return Depth_Buffer_Sizes is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Depth_Buffer_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Depth_Buffer_Sizes (Data);
end Depth_Buffer_Size;
procedure Set_Depth_Buffer_Size (Size : in Depth_Buffer_Sizes) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Depth_Buffer_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Depth_Buffer_Size;
function Stencil_Buffer_Size return Stencil_Buffer_Sizes is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Stencil_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Stencil_Buffer_Sizes (Data);
end Stencil_Buffer_Size;
procedure Set_Stencil_Buffer_Size (Size : in Stencil_Buffer_Sizes) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Stencil_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Stencil_Buffer_Size;
function Accumulator_Red_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Accumulator_Red_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Accumulator_Red_Size;
procedure Set_Accumulator_Red_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Accumulator_Red_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Accumulator_Red_Size;
function Accumulator_Green_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Accumulator_Green_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Accumulator_Green_Size;
procedure Set_Accumulator_Green_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Accumulator_Green_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Accumulator_Green_Size;
function Accumulator_Blue_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Accumulator_Blue_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Accumulator_Blue_Size;
procedure Set_Accumulator_Blue_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Accumulator_Blue_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Accumulator_Blue_Size;
function Accumulator_Alpha_Size return Colour_Bit_Size is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Accumulator_Alpha_Size, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Colour_Bit_Size (Data);
end Accumulator_Alpha_Size;
procedure Set_Accumulator_Alpha_Size (Size : in Colour_Bit_Size) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Accumulator_Alpha_Size, C.int (Size));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Accumulator_Alpha_Size;
function Is_Stereo return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Stereo, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Data = 1);
end Is_Stereo;
procedure Set_Stereo (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Stereo, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Stereo;
function Is_Multisampled return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Multisample_Buffers, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Data = 1);
end Is_Multisampled;
procedure Set_Multisampling (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Multisample_Buffers, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Multisampling;
function Multisampling_Samples return Multisample_Samples is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Multisample_Samples, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Multisample_Samples (Data);
end Multisampling_Samples;
procedure Set_Multisampling_Samples (Samples : in Multisample_Samples) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Multisample_Samples, C.int (Samples));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Multisampling_Samples;
function Is_Accelerated return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Accelerated, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Result = 1);
end Is_Accelerated;
procedure Set_Accelerated (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Accelerated, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Accelerated;
function Context_Major_Version return Major_Versions is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Context_Major_Version, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Major_Versions (Data);
end Context_Major_Version;
procedure Set_Context_Major_Version (Version : Major_Versions) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Context_Major_Version, C.int (Version));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Context_Major_Version;
function Context_Minor_Version return Minor_Versions is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Context_Minor_Version, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Minor_Versions (Data);
end Context_Minor_Version;
procedure Set_Context_Minor_Version (Version : Minor_Versions) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Context_Minor_Version, C.int (Version));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Context_Minor_Version;
function Is_Context_EGL return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Context_EGL, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Data = 1);
end Is_Context_EGL;
procedure Set_Context_EGL (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Context_EGL, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Context_EGL;
function Context_Flags return Flags is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Context_Flags, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Flags (Data);
end Context_Flags;
procedure Set_Context_Flags (Context_Flags : in Flags) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Context_Flags, C.int (Context_Flags));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Context_Flags;
function Context_Profile return Profiles is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Context_Profile, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return Profiles'Val (Data);
end Context_Profile;
procedure Set_Context_Profile (Profile : in Profiles) is
Result : C.int := SDL_GL_Set_Attribute (Attribute_Context_Profile, To_int (Profile));
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Context_Profile;
function Is_Sharing_With_Current_Context return Boolean is
Data : C.int;
Result : C.int := SDL_GL_Get_Attribute (Attribute_Share_With_Current_Context, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
return (Data = 1);
end Is_Sharing_With_Current_Context;
procedure Set_Share_With_Current_Context (On : in Boolean) is
Data : C.int := (if On = True then 1 else 0);
Result : C.int := SDL_GL_Set_Attribute (Attribute_Share_With_Current_Context, Data);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Share_With_Current_Context;
-- Some helper functions to get make this type work ok.
function Get_Internal_Window (Self : in SDL.Video.Windows.Window) return SDL.C_Pointers.Windows_Pointer with
Import => True,
Convention => Ada;
function Get_Internal_Texture (Self : in SDL.Video.Textures.Texture) return SDL.C_Pointers.Texture_Pointer with
Import => True,
Convention => Ada;
-- The GL context.
procedure Create (Self : in out Contexts; From : in SDL.Video.Windows.Window) is
function SDL_GL_Create_Context (W : in SDL.C_Pointers.Windows_Pointer)
return SDL.C_Pointers.GL_Context_Pointer with
Import => True,
Convention => C,
External_Name => "SDL_GL_CreateContext";
C : SDL.C_Pointers.GL_Context_Pointer := SDL_GL_Create_Context (Get_Internal_Window (From));
begin
if C = null then
raise SDL_GL_Error with SDL.Error.Get;
end if;
Self.Internal := C;
Self.Owns := True;
end Create;
overriding
procedure Finalize (Self : in out Contexts) is
procedure SDL_GL_Delete_Context (W : in SDL.C_Pointers.GL_Context_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_GL_DeleteContext";
begin
-- We have to own this pointer before we go any further...
-- and make sure we don't delete this twice if we do!
if Self.Internal /= null and then Self.Owns then
SDL_GL_Delete_Context (Self.Internal);
Self.Internal := null;
end if;
end Finalize;
-- TODO: Make sure we make all similar functions across the API match this pattern.
-- Create a temporary Context.
function Get_Current return Contexts is
function SDL_GL_Get_Current_Context return SDL.C_Pointers.GL_Context_Pointer with
Import => True,
Convention => C,
External_Name => "SDL_GL_GetCurrentContext";
begin
return C : constant Contexts := (Ada.Finalization.Limited_Controlled with
Internal => SDL_GL_Get_Current_Context, Owns => False)
do
if C.Internal = null then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end return;
end Get_Current;
procedure Set_Current (Self : in Contexts; To : in SDL.Video.Windows.Window) is
function SDL_GL_Make_Current (W : in SDL.C_Pointers.Windows_Pointer;
Context : in SDL.C_Pointers.GL_Context_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_MakeCurrent";
Result : C.int := SDL_GL_Make_Current (Get_Internal_Window (To), Self.Internal);
begin
if Result /= Success then
raise SDL_GL_Error with SDL.Error.Get;
end if;
end Set_Current;
procedure Bind_Texture (Texture : in SDL.Video.Textures.Texture) is
function SDL_GL_Bind_Texture (T : in SDL.C_Pointers.Texture_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_BindTexture";
begin
if SDL_GL_Bind_Texture (Get_Internal_Texture (Texture)) /= SDL.Success then
raise SDL_GL_Error with "Cannot bind texture, unsupported operation in this context.";
end if;
end Bind_Texture;
procedure Bind_Texture (Texture : in SDL.Video.Textures.Texture; Size : out SDL.Sizes) is
function SDL_GL_Bind_Texture (T : in SDL.C_Pointers.Texture_Pointer; W, H : out C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_BindTexture";
begin
if SDL_GL_Bind_Texture (Get_Internal_Texture (Texture), Size.Width, Size.Height) /= SDL.Success then
raise SDL_GL_Error with "Cannot bind texture, unsupported operation in this context.";
end if;
end Bind_Texture;
procedure Unbind_Texture (Texture : in SDL.Video.Textures.Texture) is
function SDL_GL_Unbind_Texture (T : in SDL.C_Pointers.Texture_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_UnbindTexture";
begin
if SDL_GL_Unbind_Texture (Get_Internal_Texture (Texture)) /= SDL.Success then
raise SDL_GL_Error with "Cannot unbind texture, unsupported operation in this context.";
end if;
end Unbind_Texture;
function Get_Sub_Program (Name : in String) return Access_To_Sub_Program is
function SDL_GL_Get_Proc_Address (P : in C.Strings.chars_ptr) return Access_To_Sub_Program with
Import => True,
Convention => C,
External_Name => "SDL_GL_GetProcAddress";
C_Name_Str : C.Strings.chars_ptr := C.Strings.New_String (Name);
Sub_Program : Access_To_Sub_Program := SDL_GL_Get_Proc_Address (C_Name_Str);
begin
C.Strings.Free (C_Name_Str);
return Sub_Program;
end Get_Sub_Program;
function Supports (Extension : in String) return Boolean is
function SDL_GL_Extension_Supported (E : in C.Strings.chars_ptr) return SDL_Bool with
Import => True,
Convention => C,
External_Name => "SDL_GL_ExtensionSupported";
C_Name_Str : C.Strings.chars_ptr := C.Strings.New_String (Extension);
Result : SDL_Bool := SDL_GL_Extension_Supported (C_Name_Str);
begin
C.Strings.Free (C_Name_Str);
return (Result = SDL_True);
end Supports;
function Get_Swap_Interval return Swap_Intervals is
function SDL_GL_Get_Swap_Interval return Swap_Intervals with
Import => True,
Convention => C,
External_Name => "SDL_GL_GetSwapInterval";
begin
return SDL_GL_Get_Swap_Interval;
end Get_Swap_Interval;
function Set_Swap_Interval (Interval : in Allowed_Swap_Intervals; Late_Swap_Tear : in Boolean) return Boolean is
function SDL_GL_Set_Swap_Interval (Interval : in Swap_Intervals) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_SetSwapInterval";
Late_Tearing : Swap_Intervals renames Not_Supported;
Result : C.int;
begin
if Late_Swap_Tear then
-- Override the interval passed.
Result := SDL_GL_Set_Swap_Interval (Late_Tearing);
if Result = -1 then
-- Try again with synchronised.
Result := SDL_GL_Set_Swap_Interval (Synchronised);
return (if Result = -1 then False else True);
elsif Result = Success then
return True;
else
raise SDL_GL_Error with "Something unexpected happend whilst setting swap interval.";
end if;
end if;
Result := SDL_GL_Set_Swap_Interval (Synchronised);
return (if Result = -1 then False else True);
end Set_Swap_Interval;
procedure Swap (Window : in out SDL.Video.Windows.Window) is
procedure SDL_GL_Swap_Window (W : in SDL.C_Pointers.Windows_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_GL_SwapWindow";
begin
SDL_GL_Swap_Window (Get_Internal_Window (Window));
end Swap;
procedure Load_Library (Path : in String) is
function SDL_GL_Load_Library (P : in C.Strings.chars_ptr) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GL_LoadLibrary";
C_Name_Str : C.Strings.chars_ptr := C.Strings.New_String (Path);
Result : C.int := SDL_GL_Load_Library (C_Name_Str);
begin
C.Strings.Free (C_Name_Str);
if Result /= SDL.Success then
raise SDL_GL_Error with "Unable to load OpenGL library """ & Path & '"';
end if;
end Load_Library;
procedure Unload_Library is
procedure SDL_GL_Unload_Library with
Import => True,
Convention => C,
External_Name => "SDL_GL_UnloadLibrary";
begin
SDL_GL_Unload_Library;
end Unload_Library;
end SDL.Video.GL;
|
oeis/111/A111455.asm | neoneye/loda-programs | 11 | 29677 | ; A111455: Numbers n such that 101*n + 97 is prime.
; Submitted by <NAME>
; 0,14,24,32,36,42,50,62,66,72,84,86,90,102,104,116,126,146,164,192,200,206,224,230,240,246,260,270,282,290,326,330,332,336,344,350,354,360,374,396,402,410,414,422,440,456,482,492,494,504,506,510,546,552,570
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,48
sub $2,1
mov $3,$1
add $1,13
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,40
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,101
div $0,101
mul $0,2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.