text stringlengths 1 1.05M |
|---|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>execve(path, argv, envp) -> str
Invokes the syscall execve.
See 'man 2 execve' for more information.
Arguments:
path(char*): path
argv(char**): argv
envp(char**): envp
Returns:
int
</%docstring>
<%page args="path=0, argv=0, envp=0"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = ['path']
can_pushstr_array = ['argv', 'envp']
argument_names = ['path', 'argv', 'envp']
argument_values = [path, argv, envp]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False)))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_execve']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* execve(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)}
|
; A087547: a(n) = n!*2^(n+1) * (Integral_{x = 0..1} 1/(1+x^2)^(n+1) dx - Pi*(2*n)!/(2^(n+1)*n!).
; Submitted by Jon Maiga
; 0,1,4,22,160,1464,16224,211632,3179520,54092160,1028113920,21594021120,496702402560,12418039065600,335293281792000,9723592350259200,301432670532403200,9947299050359193600,348155822449999872000,12881771833023700992000,502389223133024747520000,20597960581356022824960000,885712356089251153182720000,39857057148017029670830080000,1873281711808817133413990400000,91790804499080441270524968960000,4681331044964312548127759400960000,248110545786400026177376883834880000
mov $1,8
lpb $0
mul $2,$0
mul $0,2
sub $0,1
add $2,$1
mul $1,$0
div $0,2
lpe
mov $0,$2
div $0,8
|
%macro imprimir 2
; 2 = nro de params
mov eax, 4
mov ebx, 1
mov ecx, %1 ; primer param
mov edx, %2 ; segundo param
int 0x80
%endmacro
section .data
msg1 db "mensaje1", 0xA, 0xD
len1 equ $-msg1
msg2 db "mensaje2", 0xA, 0xD
len2 equ $-msg2
section .bss
rpta resb 1
section .text
imprime:
mov eax, 4
mov ebx, 1
int 0x80
ret ; para no repetir
global _start
_start:
; usando procedimientos
mov ecx, msg2
mov edx, len2
call imprime
mov ecx, msg1
mov edx, len1
call imprime
; usando macro
imprimir msg1, len1
imprimir msg2, len2
; Finalizar
mov eax, 1
mov ebx, 0 ; Ok
;mov ebx, 1 ; Error
int 0x80
|
; A170343: Number of reduced words of length n in Coxeter group on 46 generators S_i with relations (S_i)^2 = (S_i S_j)^42 = I.
; Submitted by Jon Maiga
; 1,46,2070,93150,4191750,188628750,8488293750,381973218750,17188794843750,773495767968750,34807309558593750,1566328930136718750,70484801856152343750,3171816083526855468750,142731723758708496093750
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
div $3,$2
mul $2,45
lpe
mov $0,$2
div $0,45
|
; A001835: a(n) = 4*a(n-1) - a(n-2), with a(0) = 1, a(1) = 1.
; 1,1,3,11,41,153,571,2131,7953,29681,110771,413403,1542841,5757961,21489003,80198051,299303201,1117014753,4168755811,15558008491,58063278153,216695104121,808717138331,3018173449203,11263976658481,42037733184721,156886956080403,585510091136891,2185153408467161,8155103542731753,30435260762459851,113585939507107651,423908497265970753,1582048049556775361,5904283700961130691,22035086754287747403,82236063316189858921,306909166510471688281,1145400602725696894203,4274693244392315888531
sub $0,1
mov $1,1
lpb $0
sub $0,1
add $2,$1
add $2,$1
add $1,$2
lpe
mov $0,$1
|
CPU 386
BITS 32
segment .text use32
%include "rtl.inc"
run:
..start:
push ebp
mov ebp, esp
call InitRTL
push testingCreate
call echostring
nop
call TestCreate
push testingUpdate
call echostring
nop
call TestUpdate
push testingOpen
call echostring
nop
call TestOpen
push testsPassed
call echostring
mov esp, ebp
pop ebp
push dword 0
call [ExitProcess]
;
; Test read/write functions on new file
;
TestCreate:
push ebp
mov ebp, esp
push dword 0
%define .testFileHandle ebp - 4
push dword 0
%define .tempPos ebp - 8
push dword 0
%define .tempSize ebp - 12
push dword 0
%define .tempCh ebp - 16
; Create test file with read/write access
push testFileName
call fcreate
test eax, eax
jnz .CreateSucceeded
push fcreateFailed
call echostring
push dword 1
call [ExitProcess]
.CreateSucceeded:
mov [.testFileHandle], eax
; Get file position
push dword [.testFileHandle]
lea eax, [.tempPos]
push eax
call fpos
test eax, eax
jnz .GetPos0Succeeded
push fposFailed
call echostring
push dword 2
call [ExitProcess]
.GetPos0Succeeded:
cmp dword [.tempPos], 0
jz .IsPos0
push fposFailed
call echostring
push dword 3
call [ExitProcess]
.IsPos0:
; Skip to offset 13
push dword [.testFileHandle]
push dword 13
call fseek
test eax, eax
jnz .fseekMidSucceeded
push fseekFailed
call echostring
push dword 4
call [ExitProcess]
.fseekMidSucceeded:
; Change file size by setting EOF
push dword [.testFileHandle]
call fseteof
test eax, eax
jnz .fseteofSucceeded
push fseteofFailed
call echostring
push dword 5
call [ExitProcess]
.fseteofSucceeded:
; Attempt to read a character past EOF
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadChPastEOFSucceeded
push freadchFailed
call echostring
push dword 6
call [ExitProcess]
.ReadChPastEOFSucceeded:
; Write an uppercase character
push dword [.testFileHandle]
push upperTestText + 13
call fwritech
test eax, eax
jnz .WriteChSucceeded
push fwritechFailed
call echostring
push dword 7
call [ExitProcess]
.WriteChSucceeded:
; Write the last uppercase half of the test string
push dword [.testFileHandle]
push upperTestText + 14
push dword 12
call fwrite
cmp eax, 12
je .WriteSucceeded
push fwriteFailed
call echostring
push dword 8
call [ExitProcess]
.WriteSucceeded:
; Verify file size
push dword [.testFileHandle]
lea eax, [.tempSize]
push eax
call fsize
test eax, eax
jnz .FsizeSucceeded
push fsizeFailed
call echostring
push dword 9
call [ExitProcess]
.FsizeSucceeded:
cmp dword [.tempSize], 26
je .FileSizeIsCorrect
push fsizeFailed
call echostring
push dword 10
call [ExitProcess]
.FileSizeIsCorrect:
; Go back to offset 13
push dword [.testFileHandle]
push dword 13
call fseek
test eax, eax
jnz .FseekMidChSucceeded
push fseekFailed
call echostring
push dword 11
call [ExitProcess]
.FseekMidChSucceeded:
; Read the first uppercase character
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadMidChSucceeded
push freadchFailed
call echostring
push dword 12
call [ExitProcess]
.ReadMidChSucceeded:
cmp byte [.tempCh], 'N'
je .MidCharIsCorrect
push freadchFailed
call echostring
push dword 13
call [ExitProcess]
.MidCharIsCorrect:
; Go back to offset 25
push dword [.testFileHandle]
push dword 25
call fseek
test eax, eax
jnz .FseekLastChSucceeded
push fseekFailed
call echostring
push dword 14
call [ExitProcess]
.FseekLastChSucceeded:
; Read the first uppercase character
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadLastChSucceeded
push freadchFailed
call echostring
push dword 15
call [ExitProcess]
.ReadLastChSucceeded:
cmp byte [.tempCh], 'Z'
je .LastCharIsCorrect
push freadchFailed
call echostring
push dword 16
call [ExitProcess]
.LastCharIsCorrect:
.Exit:
; Close the file
lea eax, [.testFileHandle]
push eax
call fclose
cmp dword [.testFileHandle], 0
je .FileClosed
push fcloseFailed
call echostring
push dword 17
call [ExitProcess]
.FileClosed:
mov esp, ebp
pop ebp
ret
;
; Test read/write functions on existing file
;
TestUpdate:
push ebp
mov ebp, esp
push dword 0
%define .testFileHandle ebp - 4
push dword 0
%define .tempPos ebp - 8
push dword 0
%define .tempSize ebp - 12
push dword 0
%define .tempCh ebp - 16
; Open the test file with read/write access
push testFileName
call fupdate
test eax, eax
jnz .UpdateSucceeded
push fupdateFailed
call echostring
push dword 18
call [ExitProcess]
.UpdateSucceeded:
mov [.testFileHandle], eax
; Get file position
push dword [.testFileHandle]
lea eax, [.tempPos]
push eax
call fpos
test eax, eax
jnz .GetPos0Succeeded
push fposFailed
call echostring
push dword 19
call [ExitProcess]
.GetPos0Succeeded:
cmp dword [.tempPos], 0
jz .IsPos0
push fposFailed
call echostring
push dword 20
call [ExitProcess]
.IsPos0:
; Skip to offset 26
push dword [.testFileHandle]
push dword 26
call fseek
test eax, eax
jnz .fseekMidSucceeded
push fseekFailed
call echostring
push dword 21
call [ExitProcess]
.fseekMidSucceeded:
; Change file size by setting EOF
push dword [.testFileHandle]
call fseteof
test eax, eax
jnz .fseteofSucceeded
push fseteofFailed
call echostring
push dword 22
call [ExitProcess]
.fseteofSucceeded:
; Attempt to read a character past EOF
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadChPastEOFSucceeded
push freadchFailed
call echostring
push dword 23
call [ExitProcess]
.ReadChPastEOFSucceeded:
; Return to offset 0
push dword [.testFileHandle]
push dword 0
call fseek
test eax, eax
jnz .fseek0Succeeded
push fseekFailed
call echostring
push dword 24
call [ExitProcess]
.fseek0Succeeded:
; Write an uppercase character
push dword [.testFileHandle]
push lowerTestText
call fwritech
test eax, eax
jnz .WriteChSucceeded
push fwritechFailed
call echostring
push dword 25
call [ExitProcess]
.WriteChSucceeded:
; Write the last uppercase half of the test string
push dword [.testFileHandle]
push lowerTestText + 1
push dword 12
call fwrite
cmp eax, 12
je .WriteSucceeded
push fwriteFailed
call echostring
push dword 26
call [ExitProcess]
.WriteSucceeded:
; Verify file size
push dword [.testFileHandle]
lea eax, [.tempSize]
push eax
call fsize
test eax, eax
jnz .FsizeSucceeded
push fsizeFailed
call echostring
push dword 27
call [ExitProcess]
.FsizeSucceeded:
cmp dword [.tempSize], 26
je .FileSizeIsCorrect
push fsizeFailed
call echostring
push dword 28
call [ExitProcess]
.FileSizeIsCorrect:
; Return to offset 0
push dword [.testFileHandle]
push dword 0
call fseek
test eax, eax
jnz .FseekFirstChSucceeded
push fseekFailed
call echostring
push dword 29
call [ExitProcess]
.FseekFirstChSucceeded:
; Read the last lowercase character
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadFirstChSucceeded
push freadchFailed
call echostring
push dword 30
call [ExitProcess]
.ReadFirstChSucceeded:
cmp byte [.tempCh], 'a'
je .FirstCharIsCorrect
push freadchFailed
call echostring
push dword 31
call [ExitProcess]
.FirstCharIsCorrect:
; Return to offset 12
push dword [.testFileHandle]
push dword 12
call fseek
test eax, eax
jnz .FseekLastChSucceeded
push fseekFailed
call echostring
push dword 32
call [ExitProcess]
.FseekLastChSucceeded:
; Read the mid lower character
push dword [.testFileHandle]
lea eax, [.tempCh]
push eax
call freadch
test eax, eax
jnz .ReadMidChSucceeded
push freadchFailed
call echostring
push dword 33
call [ExitProcess]
.ReadMidChSucceeded:
cmp byte [.tempCh], 'm'
je .LastCharIsCorrect
push freadchFailed
call echostring
push dword 34
call [ExitProcess]
.LastCharIsCorrect:
.Exit:
; Close the file
lea eax, [.testFileHandle]
push eax
call fclose
cmp dword [.testFileHandle], 0
je .FileClosed
push fcloseFailed
call echostring
push dword 35
call [ExitProcess]
.FileClosed:
mov esp, ebp
pop ebp
ret
;
; Test read/write functions on read only file
;
TestOpen:
push ebp
mov ebp, esp
push dword 0
%define .testFileHandle ebp - 4
push dword 0
%define .tempPos ebp - 8
push dword 0
%define .tempSize ebp - 12
push dword 0
%define .tempCh ebp - 16
push dword 0
push dword 0
push dword 0
push dword 0
%define .tempStr ebp - 32
; Open the test file with read/write access
push testFileName
call fopen
test eax, eax
jnz .UpdateSucceeded
push fupdateFailed
call echostring
push dword 36
call [ExitProcess]
.UpdateSucceeded:
mov [.testFileHandle], eax
; Write an uppercase character
push dword [.testFileHandle]
push upperTestText
call fwritech
test eax, eax
jz .WriteChFailed
push fwritechFailed
call echostring
push dword 37
call [ExitProcess]
.WriteChFailed:
; Write the last uppercase half of the test string
push dword [.testFileHandle]
push upperTestText + 1
push dword 12
call fwrite
test eax, eax
jz .WriteFailed
push fwriteFailed
call echostring
push dword 38
call [ExitProcess]
.WriteFailed:
; Change file size by setting EOF
push dword [.testFileHandle]
call fseteof
test eax, eax
jz .fseteofFailed
push fseteofFailed
call echostring
push dword 39
call [ExitProcess]
.fseteofFailed:
; Verify file size
push dword [.testFileHandle]
lea eax, [.tempSize]
push eax
call fsize
test eax, eax
jnz .FsizeSucceeded
push fsizeFailed
call echostring
push dword 40
call [ExitProcess]
.FsizeSucceeded:
cmp dword [.tempSize], 26
je .FileSizeIsCorrect
push fsizeFailed
call echostring
push dword 41
call [ExitProcess]
.FileSizeIsCorrect:
; Get file position
push dword [.testFileHandle]
lea eax, [.tempPos]
push eax
call fpos
test eax, eax
jnz .GetPos0Succeeded
push fposFailed
call echostring
push dword 42
call [ExitProcess]
.GetPos0Succeeded:
cmp dword [.tempPos], 0
jz .IsPos0
push fposFailed
call echostring
push dword 43
call [ExitProcess]
.IsPos0:
; Read the first character
push dword [.testFileHandle]
lea eax, [.tempStr]
push eax
call freadch
test eax, eax
jnz .ReadFirstChSucceeded
push freadchFailed
call echostring
push dword 44
call [ExitProcess]
.ReadFirstChSucceeded:
; Read the next 12 characters
push dword [.testFileHandle]
lea eax, [.tempStr + 1]
push eax
push dword 12
call fread
cmp eax, 12
je .FreadStartSucceeded
push freadFailed
call echostring
push dword 45
call [ExitProcess]
.FreadStartSucceeded:
; Verify that first 13 characters are lowercase
mov esi, lowerTestText
lea edi, [.tempStr]
mov ecx, 13
xor eax, eax
.CompareLower:
mov al, [esi]
inc esi
sub al, [edi]
inc edi
dec ecx
jnz .CompareLower
test eax, eax
jz .StringIsLowercase
push freadFailed
call echostring
push dword 46
call [ExitProcess]
.StringIsLowercase:
; Read the middle character
push dword [.testFileHandle]
lea eax, [.tempStr]
push eax
call freadch
test eax, eax
jnz .ReadMidChSucceeded
push freadchFailed
call echostring
push dword 47
call [ExitProcess]
.ReadMidChSucceeded:
; Read the next 12 characters
push dword [.testFileHandle]
lea eax, [.tempStr + 1]
push eax
push dword 12
call fread
cmp eax, 12
je .FreadMidSucceeded
push freadFailed
call echostring
push dword 48
call [ExitProcess]
.FreadMidSucceeded:
; Verify that last 13 characters are uppercase
mov esi, upperTestText + 13
lea edi, [.tempStr]
mov ecx, 13
xor eax, eax
.CompareUpper:
mov al, [esi]
inc esi
sub al, [edi]
inc edi
dec ecx
jnz .CompareUpper
test eax, eax
jz .StringIsUppercase
push freadFailed
call echostring
push dword 49
call [ExitProcess]
.StringIsUppercase:
; Return to the middle of the file
push dword [.testFileHandle]
push dword 13
call fseek
test eax, eax
jnz .SeekMidSucceeded
push fseekFailed
call echostring
push dword 50
call [ExitProcess]
.SeekMidSucceeded:
.Exit:
; Close the file
lea eax, [.testFileHandle]
push eax
call fclose
cmp dword [.testFileHandle], 0
je .FileClosed
push fcloseFailed
call echostring
push dword 51
call [ExitProcess]
.FileClosed:
mov esp, ebp
pop ebp
ret
segment .data use32
declstring testFileName, 'test.txt'
declstring lowerTestText, 'abcdefghijklmnopqrstuvwxyz'
declstring upperTestText, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
declstring testingCreate, 13,10,'Testing create file read/write I/O...',13,10
declstring testingUpdate, 13,10,'Testing update file read/write I/O...',13,10
declstring testingOpen, 13,10,'Testing oppen file read only I/O...',13,10
declstring testsPassed, 13,10,'Tests passed',13,10
declstring fcreateFailed, 13,10,'fcreate FAILED',13,10
declstring fupdateFailed, 13,10,'fupdate FAILED',13,10
declstring fopenFailed, 13,10,'fopen FAILED',13,10
declstring fcloseFailed, 13,10,'fclose FAILED',13,10
declstring freadFailed, 13,10,'fread FAILED',13,10
declstring freadchFailed, 13,10,'freadch FAILED',13,10
declstring fwriteFailed, 13,10,'fwrite FAILED',13,10
declstring fwritechFailed, 13,10,'fwritech FAILED',13,10
declstring fseekFailed, 13,10,'fseek FAILED',13,10
declstring fposFailed, 13,10,'fpos FAILED',13,10
declstring fsizeFailed, 13,10,'fsize FAILED',13,10
declstring fseteofFailed, 13,10,'fseteof FAILED',13,10
section .bss use32
|
;
;==================================================================================================
; ROMWBW 2.X CONFIGURATION DEFAULTS FOR RC2014 Z80
;==================================================================================================
;
; THIS FILE CONTAINS THE FULL SET OF DEFAULT CONFIGURATION SETTINGS FOR THE PLATFORM
; INDICATED ABOVE. THIS FILE SHOULD *NOT* NORMALLY BE CHANGED. INSTEAD, YOU SHOULD
; OVERRIDE ANY SETTINGS YOU WANT USING A CONFIGURATION FILE IN THE CONFIG DIRECTORY
; UNDER THIS DIRECTORY.
;
; THIS FILE CAN BE CONSIDERED A REFERENCE THAT LISTS ALL POSSIBLE CONFIGURATION SETTINGS
; FOR THE PLATFORM.
;
#DEFINE PLATFORM_NAME "RC2014"
;
PLATFORM .EQU PLT_RCZ80 ; PLT_[SBC|ZETA|ZETA2|N8|MK4|UNA|RCZ80|RCZ180|EZZ80|SCZ180|DYNO]
CPUFAM .EQU CPU_Z80 ; CPU FAMILY: CPU_[Z80|Z180|Z280]
BIOS .EQU BIOS_WBW ; HARDWARE BIOS: BIOS_[WBW|UNA]
BATCOND .EQU FALSE ; ENABLE LOW BATTERY WARNING MESSAGE
HBIOS_MUTEX .EQU FALSE ; ENABLE REENTRANT CALLS TO HBIOS (ADDS OVERHEAD)
USELZSA2 .EQU TRUE ; ENABLE FONT COMPRESSION
TICKFREQ .EQU 50 ; DESIRED PERIODIC TIMER INTERRUPT FREQUENCY (HZ)
;
BOOT_TIMEOUT .EQU -1 ; AUTO BOOT TIMEOUT IN SECONDS, -1 TO DISABLE, 0 FOR IMMEDIATE
;
CPUOSC .EQU 7372800 ; CPU OSC FREQ IN MHZ
INTMODE .EQU 1 ; INTERRUPTS: 0=NONE, 1=MODE 1, 2=MODE 2
DEFSERCFG .EQU SER_115200_8N1 ; DEFAULT SERIAL LINE CONFIG (SEE STD.ASM)
;
RAMSIZE .EQU 512 ; SIZE OF RAM IN KB (MUST MATCH YOUR HARDWARE!!!)
RAM_RESERVE .EQU 0 ; RESERVE FIRST N KB OF RAM (USUALLY 0)
ROM_RESERVE .EQU 0 ; RESERVE FIRST N KB OR ROM (USUALLY 0)
MEMMGR .EQU MM_Z2 ; MEMORY MANAGER: MM_[SBC|Z2|N8|Z180|Z280]
MPGSEL_0 .EQU $78 ; Z2 MEM MGR BANK 0 PAGE SELECT REG (WRITE ONLY)
MPGSEL_1 .EQU $79 ; Z2 MEM MGR BANK 1 PAGE SELECT REG (WRITE ONLY)
MPGSEL_2 .EQU $7A ; Z2 MEM MGR BANK 2 PAGE SELECT REG (WRITE ONLY)
MPGSEL_3 .EQU $7B ; Z2 MEM MGR BANK 3 PAGE SELECT REG (WRITE ONLY)
MPGENA .EQU $7C ; Z2 MEM MGR PAGING ENABLE REGISTER (BIT 0, WRITE ONLY)
;
RTCIO .EQU $C0 ; RTC LATCH REGISTER ADR
;
KIOENABLE .EQU FALSE ; ENABLE ZILOG KIO SUPPORT
KIOBASE .EQU $80 ; KIO BASE I/O ADDRESS
;
CTCENABLE .EQU FALSE ; ENABLE ZILOG CTC SUPPORT
CTCDEBUG .EQU FALSE ; ENABLE CTC DRIVER DEBUG OUTPUT
CTCBASE .EQU $88 ; CTC BASE I/O ADDRESS
CTCTIMER .EQU FALSE ; ENABLE CTC PERIODIC TIMER
CTCMODE .EQU CTCMODE_TIM16 ; CTC MODE: CTCMODE_[NONE|CTR|TIM16|TIM256]
CTCPRE .EQU 256 ; PRESCALE CONSTANT (1-256)
CTCPRECH .EQU 2 ; PRESCALE CHANNEL (0-3)
CTCTIMCH .EQU 3 ; TIMER CHANNEL (0-3)
CTCOSC .EQU CPUOSC ; CTC CLOCK FREQUENCY
;
EIPCENABLE .EQU FALSE ; EIPC: ENABLE Z80 EIPC (Z84C15) INITIALIZATION
;
SKZENABLE .EQU FALSE ; ENABLE SERGEY'S Z80-512K FEATURES
SKZDIV .EQU DIV_1 ; UART CLK (CLK2) DIVIDER FOR Z80-512K
;
WDOGMODE .EQU WDOG_NONE ; WATCHDOG MODE: WDOG_[NONE|EZZ80|SKZ]
WDOGIO .EQU $6E ; WATCHDOG REGISTER ADR
;
DIAGENABLE .EQU TRUE ; ENABLES OUTPUT TO 8 BIT LED DIAGNOSTIC PORT
DIAGPORT .EQU $00 ; DIAGNOSTIC PORT ADDRESS
DIAGDISKIO .EQU TRUE ; ENABLES DISK I/O ACTIVITY ON DIAGNOSTIC LEDS
;
LEDENABLE .EQU FALSE ; ENABLES STATUS LED (SINGLE LED)
LEDPORT .EQU $0E ; STATUS LED PORT ADDRESS
LEDDISKIO .EQU TRUE ; ENABLES DISK I/O ACTIVITY ON STATUS LED
;
DSKYENABLE .EQU FALSE ; ENABLES DSKY (DO NOT COMBINE WITH PPIDE)
;
BOOTCON .EQU 0 ; BOOT CONSOLE DEVICE
CRTACT .EQU FALSE ; ACTIVATE CRT (VDU,CVDU,PROPIO,ETC) AT STARTUP
VDAEMU .EQU EMUTYP_ANSI ; VDA EMULATION: EMUTYP_[TTY|ANSI]
ANSITRACE .EQU 1 ; ANSI DRIVER TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
MKYENABLE .EQU FALSE ; MSX 5255 PPI KEYBOARD COMPATIBLE DRIVER (REQUIRES TMS VDA DRIVER)
MKYKBLOUT .EQU KBD_US ; KBD KEYBOARD LANGUAGE: KBD_[US|DE]
;
DSRTCENABLE .EQU TRUE ; DSRTC: ENABLE DS-1302 CLOCK DRIVER (DSRTC.ASM)
DSRTCMODE .EQU DSRTCMODE_STD ; DSRTC: OPERATING MODE: DSRTC_[STD|MFPIC]
DSRTCCHG .EQU FALSE ; DSRTC: FORCE BATTERY CHARGE ON (USE WITH CAUTION!!!)
;
BQRTCENABLE .EQU FALSE ; BQRTC: ENABLE BQ4845 CLOCK DRIVER (BQRTC.ASM)
BQRTC_BASE .EQU $50 ; BQRTC: I/O BASE ADDRESS
;
INTRTCENABLE .EQU FALSE ; ENABLE PERIODIC INTERRUPT CLOCK DRIVER (INTRTC.ASM)
;
RP5RTCENABLE .EQU FALSE ; RP5C01 RTC BASED CLOCK (RP5RTC.ASM)
;
HTIMENABLE .EQU FALSE ; ENABLE SIMH TIMER SUPPORT
SIMRTCENABLE .EQU FALSE ; ENABLE SIMH CLOCK DRIVER (SIMRTC.ASM)
;
DS7RTCENABLE .EQU FALSE ; DS7RTC: ENABLE DS-1307 I2C CLOCK DRIVER (DS7RTC.ASM)
DS7RTCMODE .EQU DS7RTCMODE_PCF ; DS7RTC: OPERATING MODE: DS7RTC_[PCF]
;
DUARTENABLE .EQU FALSE ; DUART: ENABLE 2681/2692 SERIAL DRIVER (DUART.ASM)
DUARTCNT .EQU 2 ; DUART: NUMBER OF CHIPS TO DETECT (1-2)
DUART0BASE .EQU $A0 ; DUART 0: BASE ADDRESS OF CHIP
DUART0ACFG .EQU DEFSERCFG ; DUART 0A: SERIAL LINE CONFIG
DUART0BCFG .EQU DEFSERCFG ; DUART 0B: SERIAL LINE CONFIG
DUART1BASE .EQU $40 ; DUART 1: BASE ADDRESS OF CHIP
DUART1ACFG .EQU DEFSERCFG ; DUART 1A: SERIAL LINE CONFIG
DUART1BCFG .EQU DEFSERCFG ; DUART 1B: SERIAL LINE CONFIG
;
UARTENABLE .EQU TRUE ; UART: ENABLE 8250/16550-LIKE SERIAL DRIVER (UART.ASM)
UARTOSC .EQU 1843200 ; UART: OSC FREQUENCY IN MHZ
UARTCFG .EQU DEFSERCFG | SER_RTS ; UART: LINE CONFIG FOR UART PORTS
UARTSBC .EQU FALSE ; UART: AUTO-DETECT SBC/ZETA ONBOARD UART
UARTCAS .EQU FALSE ; UART: AUTO-DETECT ECB CASSETTE UART
UARTMFP .EQU FALSE ; UART: AUTO-DETECT MF/PIC UART
UART4 .EQU FALSE ; UART: AUTO-DETECT 4UART UART
UARTRC .EQU TRUE ; UART: AUTO-DETECT RC UART
;
ASCIENABLE .EQU FALSE ; ASCI: ENABLE Z180 ASCI SERIAL DRIVER (ASCI.ASM)
;
Z2UENABLE .EQU FALSE ; Z2U: ENABLE Z280 UART SERIAL DRIVER (Z2U.ASM)
;
ACIAENABLE .EQU TRUE ; ACIA: ENABLE MOTOROLA 6850 ACIA DRIVER (ACIA.ASM)
ACIADEBUG .EQU FALSE ; ACIA: ENABLE DEBUG OUTPUT
ACIACNT .EQU 1 ; ACIA: NUMBER OF CHIPS TO DETECT (1-2)
ACIA0BASE .EQU $80 ; ACIA 0: REGISTERS BASE ADR
ACIA0CLK .EQU CPUOSC ; ACIA 0: OSC FREQ IN HZ
ACIA0DIV .EQU 1 ; ACIA 0: SERIAL CLOCK DIVIDER
ACIA0CFG .EQU DEFSERCFG ; ACIA 0: SERIAL LINE CONFIG (SEE STD.ASM)
ACIA1BASE .EQU $40 ; ACIA 1: REGISTERS BASE ADR
ACIA1CLK .EQU CPUOSC ; ACIA 1: OSC FREQ IN HZ
ACIA1DIV .EQU 1 ; ACIA 1: SERIAL CLOCK DIVIDER
ACIA1CFG .EQU DEFSERCFG ; ACIA 1: SERIAL LINE CONFIG (SEE STD.ASM)
;
SIOENABLE .EQU TRUE ; SIO: ENABLE ZILOG SIO SERIAL DRIVER (SIO.ASM)
SIODEBUG .EQU FALSE ; SIO: ENABLE DEBUG OUTPUT
SIOBOOT .EQU 0 ; SIO: REBOOT ON RCV CHAR (0=DISABLED)
SIOCNT .EQU 2 ; SIO: NUMBER OF CHIPS TO DETECT (1-2), 2 CHANNELS PER CHIP
SIO0MODE .EQU SIOMODE_RC ; SIO 0: CHIP TYPE: SIOMODE_[STD|RC|SMB|ZP]
SIO0BASE .EQU $80 ; SIO 0: REGISTERS BASE ADR
SIO0ACLK .EQU CPUOSC ; SIO 0A: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800
SIO0ACFG .EQU DEFSERCFG ; SIO 0A: SERIAL LINE CONFIG
SIO0ACTCC .EQU -1 ; SIO 0A: CTC CHANNEL 0=A, 1=B, 2=C, 3=D, -1 FOR NONE
SIO0BCLK .EQU CPUOSC ; SIO 0B: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800
SIO0BCFG .EQU DEFSERCFG ; SIO 0B: SERIAL LINE CONFIG
SIO0BCTCC .EQU -1 ; SIO 0B: CTC CHANNEL 0=A, 1=B, 2=C, 3=D, -1 FOR NONE
SIO1MODE .EQU SIOMODE_RC ; SIO 1: CHIP TYPE: SIOMODE_[STD|RC|SMB|ZP]
SIO1BASE .EQU $84 ; SIO 1: REGISTERS BASE ADR
SIO1ACLK .EQU CPUOSC ; SIO 1A: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800
SIO1ACFG .EQU DEFSERCFG ; SIO 1A: SERIAL LINE CONFIG
SIO1ACTCC .EQU -1 ; SIO 1A: CTC CHANNEL 0=A, 1=B, 2=C, 3=D, -1 FOR NONE
SIO1BCLK .EQU CPUOSC ; SIO 1B: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800
SIO1BCFG .EQU DEFSERCFG ; SIO 1B: SERIAL LINE CONFIG
SIO1BCTCC .EQU -1 ; SIO 1B: CTC CHANNEL 0=A, 1=B, 2=C, 3=D, -1 FOR NONE
;
XIOCFG .EQU DEFSERCFG ; XIO: SERIAL LINE CONFIG
;
VDUENABLE .EQU FALSE ; VDU: ENABLE VDU VIDEO/KBD DRIVER (VDU.ASM)
CVDUENABLE .EQU FALSE ; CVDU: ENABLE CVDU VIDEO/KBD DRIVER (CVDU.ASM)
NECENABLE .EQU FALSE ; NEC: ENABLE NEC UPD7220 VIDEO/KBD DRIVER (NEC.ASM)
TMSENABLE .EQU FALSE ; TMS: ENABLE TMS9918 VIDEO/KBD DRIVER (TMS.ASM)
TMSMODE .EQU TMSMODE_RC ; TMS: DRIVER MODE: TMSMODE_[SCG/N8/RC/RCV9958]
TMSTIMENABLE .EQU FALSE ; TMS: ENABLE TIMER INTERRUPTS (REQUIRES IM1)
VGAENABLE .EQU FALSE ; VGA: ENABLE VGA VIDEO/KBD DRIVER (VGA.ASM)
;
MDENABLE .EQU TRUE ; MD: ENABLE MEMORY (ROM/RAM) DISK DRIVER (MD.ASM)
MDROM .EQU TRUE ; MD: ENABLE ROM DISK
MDRAM .EQU TRUE ; MD: ENABLE RAM DISK
MDTRACE .EQU 1 ; MD: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
MDFFENABLE .EQU FALSE ; MD: ENABLE FLASH FILE SYSTEM
;
FDENABLE .EQU FALSE ; FD: ENABLE FLOPPY DISK DRIVER (FD.ASM)
FDMODE .EQU FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|ZETA2|DIDE|N8|DIO3|RCSMC|RCWDC|DYNO|EPWDC]
FDCNT .EQU 2 ; FD: NUMBER OF FLOPPY DRIVES ON THE INTERFACE (1-2)
FDTRACE .EQU 1 ; FD: TRACE LEVEL (0=NO,1=FATAL,2=ERRORS,3=ALL)
FDMEDIA .EQU FDM144 ; FD: DEFAULT MEDIA FORMAT FDM[720|144|360|120|111]
FDMEDIAALT .EQU FDM720 ; FD: ALTERNATE MEDIA FORMAT FDM[720|144|360|120|111]
FDMAUTO .EQU TRUE ; FD: AUTO SELECT DEFAULT/ALTERNATE MEDIA FORMATS
;
RFENABLE .EQU FALSE ; RF: ENABLE RAM FLOPPY DRIVER
;
IDEENABLE .EQU FALSE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
IDETRACE .EQU 1 ; IDE: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IDECNT .EQU 1 ; IDE: NUMBER OF IDE INTERFACES TO DETECT (1-3), 2 DRIVES EACH
IDE0MODE .EQU IDEMODE_RC ; IDE 0: DRIVER MODE: IDEMODE_[DIO|DIDE|MK4|RC]
IDE0BASE .EQU $10 ; IDE 0: IO BASE ADDRESS
IDE0DATLO .EQU $00 ; IDE 0: DATA LO PORT FOR 16-BIT I/O
IDE0DATHI .EQU $00 ; IDE 0: DATA HI PORT FOR 16-BIT I/O
IDE0A8BIT .EQU TRUE ; IDE 0A (MASTER): 8 BIT XFER
IDE0B8BIT .EQU TRUE ; IDE 0B (MASTER): 8 BIT XFER
IDE1MODE .EQU IDEMODE_NONE ; IDE 1: DRIVER MODE: IDEMODE_[DIO|DIDE|MK4|RC]
IDE1BASE .EQU $00 ; IDE 1: IO BASE ADDRESS
IDE1DATLO .EQU $00 ; IDE 1: DATA LO PORT FOR 16-BIT I/O
IDE1DATHI .EQU $00 ; IDE 1: DATA HI PORT FOR 16-BIT I/O
IDE1A8BIT .EQU TRUE ; IDE 1A (MASTER): 8 BIT XFER
IDE1B8BIT .EQU TRUE ; IDE 1B (MASTER): 8 BIT XFER
IDE2MODE .EQU IDEMODE_NONE ; IDE 2: DRIVER MODE: IDEMODE_[DIO|DIDE|MK4|RC]
IDE2BASE .EQU $00 ; IDE 2: IO BASE ADDRESS
IDE2DATLO .EQU $00 ; IDE 2: DATA LO PORT FOR 16-BIT I/O
IDE2DATHI .EQU $00 ; IDE 2: DATA HI PORT FOR 16-BIT I/O
IDE2A8BIT .EQU TRUE ; IDE 2A (MASTER): 8 BIT XFER
IDE2B8BIT .EQU TRUE ; IDE 2B (MASTER): 8 BIT XFER
;
PPIDEENABLE .EQU FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
PPIDETRACE .EQU 1 ; PPIDE: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPIDECNT .EQU 1 ; PPIDE: NUMBER OF PPI CHIPS TO DETECT (1-3), 2 DRIVES PER CHIP
PPIDE0BASE .EQU $20 ; PPIDE 0: PPI REGISTERS BASE ADR
PPIDE0A8BIT .EQU FALSE ; PPIDE 0A (MASTER): 8 BIT XFER
PPIDE0B8BIT .EQU FALSE ; PPIDE 0B (SLAVE): 8 BIT XFER
PPIDE1BASE .EQU $00 ; PPIDE 1: PPI REGISTERS BASE ADR
PPIDE1A8BIT .EQU FALSE ; PPIDE 1A (MASTER): 8 BIT XFER
PPIDE1B8BIT .EQU FALSE ; PPIDE 0B (SLAVE): 8 BIT XFER
PPIDE2BASE .EQU $00 ; PPIDE 2: PPI REGISTERS BASE ADR
PPIDE2A8BIT .EQU FALSE ; PPIDE 2A (MASTER): 8 BIT XFER
PPIDE2B8BIT .EQU FALSE ; PPIDE 0B (SLAVE): 8 BIT XFER
;
SDENABLE .EQU FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDMODE .EQU SDMODE_MT ; SD: DRIVER MODE: SDMODE_[JUHA|N8|CSIO|PPI|UART|DSD|MK4|SC|MT]
SDCNT .EQU 2 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD & SC ONLY
SDTRACE .EQU 1 ; SD: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SDCSIOFAST .EQU FALSE ; SD: ENABLE TABLE-DRIVEN BIT INVERTER IN CSIO MODE
SDMTSWAP .EQU FALSE ; SD: SWAP THE LOGICAL ORDER OF THE SPI PORTS OF THE MT011
;
PRPENABLE .EQU FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)
PRPSDENABLE .EQU TRUE ; PRP: ENABLE PROPIO DRIVER SD CARD SUPPORT
PRPSDTRACE .EQU 1 ; PRP: SD CARD TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PRPCONENABLE .EQU TRUE ; PRP: ENABLE PROPIO DRIVER VIDEO/KBD SUPPORT
;
PPPENABLE .EQU FALSE ; PPP: ENABLE ZETA PARALLEL PORT PROPELLER BOARD DRIVER (PPP.ASM)
;
HDSKENABLE .EQU FALSE ; HDSK: ENABLE SIMH HDSK DISK DRIVER (HDSK.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PPI_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP
;
UFENABLE .EQU FALSE ; UF: ENABLE ECB USB FIFO DRIVER (UF.ASM)
;
SN76489ENABLE .EQU FALSE ; SN76489 SOUND DRIVER
AUDIOTRACE .EQU FALSE ; ENABLE TRACING TO CONSOLE OF SOUND DRIVER
SN7CLK .EQU CPUOSC / 4 ; DEFAULT TO CPUOSC / 4
;
AY38910ENABLE .EQU FALSE ; AY: AY-3-8910 / YM2149 SOUND DRIVER
AY_CLK .EQU CPUOSC / 4 ; DEFAULT TO CPUOSC / 4
AYMODE .EQU AYMODE_NONE ; AY: DRIVER MODE: AYMODE_[SCG/N8/RCZ80/RCZ180]
;
SPKENABLE .EQU FALSE ; SPK: ENABLE RTC LATCH IOBIT SOUND DRIVER (SPK.ASM)
|
; A010806: 18th powers: a(n) = n^18.
; 0,1,262144,387420489,68719476736,3814697265625,101559956668416,1628413597910449,18014398509481984,150094635296999121,1000000000000000000,5559917313492231481,26623333280885243904,112455406951957393129,426878854210636742656,1477891880035400390625,4722366482869645213696,14063084452067724991009,39346408075296537575424,104127350297911241532841,262144000000000000000000,630880792396715529789561,1457498964228107529355264,3244150909895248285300369,6979147079584381377970176,14551915228366851806640625
pow $0,18
|
SECTION code_clib
SECTION code_l
PUBLIC l_inc_hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
l_inc_hl:
ret
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (C) 2022 Intel Corporation
;
; SPDX-License-Identifier: MIT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "reg_sizes.asm"
%ifndef RFC1951_LOOKUP
%define RFC1951_LOOKUP
section .data
align 8
;; /* Structure contain lookup data based on RFC 1951 */
;; struct rfc1951_tables {
;; uint8_t len_to_code[264];
;; uint8_t dist_extra_bit_count[32];
;; uint32_t dist_start[32];
;; uint8_t len_extra_bit_count[32];
;; uint16_t len_start[32];
;; };
mk_global rfc1951_lookup_table, data, internal
rfc1951_lookup_table:
len_to_code:
db 0x00, 0x00, 0x00
db 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
db 0x09, 0x09, 0x0a, 0x0a, 0x0b, 0x0b, 0x0c, 0x0c
db 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0e
db 0x0f, 0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x10
db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
db 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12
db 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13
db 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14
db 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15
db 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15
db 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16
db 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16
db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
db 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18
db 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18
db 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19
db 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19
db 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19
db 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19
db 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a
db 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a
db 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a
db 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a
db 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b
db 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b
db 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b
db 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b
db 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c
db 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c
db 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c
db 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1d
db 0x00, 0x00, 0x00, 0x00, 0x00
dist_extra_bit_count:
db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02
db 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06
db 0x07, 0x07, 0x08, 0x08, 0x09, 0x09, 0x0a, 0x0a
db 0x0b, 0x0b, 0x0c, 0x0c, 0x0d, 0x0d, 0x00, 0x00
dist_start:
dd 0x00000001, 0x00000002, 0x00000003, 0x00000004
dd 0x00000005, 0x00000007, 0x00000009, 0x0000000d
dd 0x00000011, 0x00000019, 0x00000021, 0x00000031
dd 0x00000041, 0x00000061, 0x00000081, 0x000000c1
dd 0x00000101, 0x00000181, 0x00000201, 0x00000301
dd 0x00000401, 0x00000601, 0x00000801, 0x00000c01
dd 0x00001001, 0x00001801, 0x00002001, 0x00003001
dd 0x00004001, 0x00006001, 0x00000000, 0x00000000
len_extra_bit_count:
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
db 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02
db 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04
db 0x05, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00
len_start:
dw 0x0003, 0x0004, 0x0005, 0x0006
dw 000007, 0x0008, 0x0009, 0x000a
dw 0x000b, 0x000d, 0x000f, 0x0011
dw 0x0013, 0x0017, 0x001b, 0x001f
dw 0x0023, 0x002b, 0x0033, 0x003b
dw 0x0043, 0x0053, 0x0063, 0x0073
dw 0x0083, 0x00a3, 0x00c3, 0x00e3
dw 0x0102, 0x0000, 0x0000, 0x0000
%endif ; RFC1951_LOOKUP
|
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/application_manager/application_table.h"
#include <utility>
namespace mojo {
ApplicationTable::ApplicationTable() {}
ApplicationTable::~ApplicationTable() {}
ApplicationInstance* ApplicationTable::GetOrStartApplication(
ApplicationManager* manager,
std::string name) {
auto result = map_.emplace(std::move(name), nullptr);
auto it = result.first;
if (result.second) {
auto application = std::make_unique<ApplicationInstance>();
if (!application->Start(manager, it->first)) {
map_.erase(it);
return nullptr;
}
it->second = std::move(application);
}
return it->second.get();
}
void ApplicationTable::StopApplication(const std::string& name) {
map_.erase(name);
}
} // namespace mojo
|
; A059171: Size of largest conjugacy class in S_n, the symmetric group on n symbols.
; 1,1,3,8,30,144,840,5760,45360,403200,3991680,43545600,518918400,6706022400,93405312000,1394852659200,22230464256000,376610217984000,6758061133824000
lpb $0,1
mov $3,$0
gcd $2,$3
mov $4,$2
sub $2,1
fac $2
add $1,$4
add $1,1
mul $2,$1
pow $0,$5
mul $2,2
lpe
sub $2,1
mov $1,$2
div $1,2
add $1,1
|
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/inference/tensorrt/plugin/trt_plugin.h"
namespace paddle {
namespace inference {
namespace tensorrt {
void PluginTensorRT::serializeBase(void*& buffer) {
SerializeValue(&buffer, input_dims_);
SerializeValue(&buffer, max_batch_size_);
SerializeValue(&buffer, data_type_);
SerializeValue(&buffer, data_format_);
}
void PluginTensorRT::deserializeBase(void const*& serialData,
size_t& serialLength) {
DeserializeValue(&serialData, &serialLength, &input_dims_);
DeserializeValue(&serialData, &serialLength, &max_batch_size_);
DeserializeValue(&serialData, &serialLength, &data_type_);
DeserializeValue(&serialData, &serialLength, &data_format_);
}
size_t PluginTensorRT::getBaseSerializationSize() {
return (SerializedSize(input_dims_) + SerializedSize(max_batch_size_) +
SerializedSize(data_type_) + SerializedSize(data_format_));
}
bool PluginTensorRT::supportsFormat(nvinfer1::DataType type,
nvinfer1::PluginFormat format) const {
return ((type == nvinfer1::DataType::kFLOAT) &&
(format == nvinfer1::PluginFormat::kNCHW));
}
void PluginTensorRT::configureWithFormat(const nvinfer1::Dims* inputDims,
int nbInputs,
const nvinfer1::Dims* outputDims,
int nbOutputs, nvinfer1::DataType type,
nvinfer1::PluginFormat format,
int maxBatchSize) {
data_type_ = type;
data_format_ = format;
input_dims_.assign(inputDims, inputDims + nbInputs);
max_batch_size_ = maxBatchSize;
}
} // namespace tensorrt
} // namespace inference
} // namespace paddle
|
bits 64
vlddqu xmm0,[edi]
vlddqu ymm0,[edi]
|
####################################################################
# <naam van programma>
#
# Doel: If and else nabootsen
####################################################################
# Input: /
# Output: /
#
# Register gebruik:
# $t0: De waarde die we verglijken in de if statement
# $t1: een getal in op slagen
# $t2: een getal in op slagen
####################################################################
#
# if($t0 > 0)
# $t1 = 10;
# else
# $t1 = 20;
# $t2 = 30;
####################################################################
.data
#<Hier komen de gegevensdeclaraties>
###################### Code Segment ################################
.text
.globl main
main:
#<Hier komen de instructies>
li $t0, -5
blez $t0, twenty
li $t1, 10
b end
twenty:
li $t1, 20
end:
li $t2, 30
li $v0, 10
syscall
####################################################################
# <naam van de functie en parameters>
#
# Doel: <Algemene beschrijving van de functie>
####################################################################
# Input: <welke invoer wordt er gebruikt>
# Output: <welke uitvoer wordt er geproduceerd>
#
# Register gebruik:
# <uitleg over het gebruik van de registers, bijv. welk registers
# worden gebruikt om de diverse gegevens in te bewaren>
####################################################################
#
# Pseudo-code beschrijving:
# < speudo-code die de logische structuur duidelijk maakt>
#
####################################################################
####################################################################
# <naam van de functie en parameters>
#
# Doel: <Algemene beschrijving van de functie>
####################################################################
# Input: <welke invoer wordt er gebruikt>
# Output: <welke uitvoer wordt er geproduceerd>
#
# Register gebruik:
# <uitleg over het gebruik van de registers, bijv. welk registers
# worden gebruikt om de diverse gegevens in te bewaren>
####################################################################
#
# Pseudo-code beschrijving:
# < speudo-code die de logische structuur duidelijk maakt>
#
#################################################################### |
Total: 823.01MB
ROUTINE ======================== main.(*Graph).buildAdjList
373.65MB 373.65MB (flat, cum) 45.40% of Total
. . 10ca200: MOVQ GS:0x30, CX ;graph.go:101
. . 10ca209: LEAQ -0x60(SP), AX
. . 10ca20e: CMPQ 0x10(CX), AX
. . 10ca212: JBE 0x10ca6be
. . 10ca218: SUBQ $0xe0, SP
. . 10ca21f: MOVQ BP, 0xd8(SP)
. . 10ca227: LEAQ 0xd8(SP), BP
. . 10ca22f: XORL AX, AX
. . 10ca231: XORL CX, CX
. . 10ca233: JMP 0x10ca4df ;graph.go:103
. . 10ca238: MOVQ 0x88(SP), R10 ;graph.go:109
. . 10ca240: LEAQ 0x1(R10), R9
. . 10ca244: MOVQ 0x78(SP), R10
. . 10ca249: MOVQ 0x70(SP), R11
. . 10ca24e: MOVQ 0x98(SP), R12
. . 10ca256: MOVQ 0x68(SP), R13
. . 10ca25b: MOVQ 0xc0(SP), R14
. . 10ca263: MOVQ R10, AX
. . 10ca266: MOVQ 0x50(SP), CX ;graph.go:106
. . 10ca26b: MOVQ R11, DX ;graph.go:110
. . 10ca26e: MOVQ 0xe8(SP), BX
. . 10ca276: MOVQ R12, SI
. . 10ca279: MOVQ R13, DI
. . 10ca27c: MOVQ R14, R8 ;graph.go:109
. . 10ca27f: CMPQ AX, R9
. . 10ca282: JGE 0x10ca4d6
. . 10ca288: MOVQ 0(R8)(R9*8), R10
. . 10ca28c: MOVQ 0x8(BX), R11 ;graph.go:110
. . 10ca290: MOVQ 0(BX), R12
. . 10ca293: CMPQ R11, R10
. . 10ca296: JAE 0x10ca6b2
. . 10ca29c: MOVQ R9, 0x88(SP) ;graph.go:109
. . 10ca2a4: MOVQ R10, 0x58(SP)
. . 10ca2a9: LEAQ 0(R10)(R10*2), AX ;graph.go:110
. . 10ca2ad: MOVQ AX, 0x80(SP)
. . 10ca2b5: MOVQ 0(R12)(AX*8), CX
. . 10ca2b9: MOVQ 0x10(R12)(AX*8), BX
. . 10ca2be: MOVQ 0x8(R12)(AX*8), R8
. . 10ca2c3: MOVQ SI, 0(SP)
. . 10ca2c7: MOVQ DI, 0x8(SP)
. . 10ca2cc: MOVQ DX, 0x10(SP)
. . 10ca2d1: MOVQ CX, 0x18(SP)
. . 10ca2d6: MOVQ R8, 0x20(SP)
. . 10ca2db: MOVQ BX, 0x28(SP)
. . 10ca2e0: CALL main.distance(SB)
. . 10ca2e5: CMPQ $0x1, 0x30(SP)
. . 10ca2eb: JNE 0x10ca4bc
. . 10ca2f1: MOVQ 0xe8(SP), DX ;graph.go:111
. . 10ca2f9: MOVQ 0x18(DX), BX
. . 10ca2fd: MOVQ 0x20(DX), CX
. . 10ca301: MOVQ 0x60(SP), AX
. . 10ca306: CMPQ CX, AX
. . 10ca309: JAE 0x10ca6ad
. . 10ca30f: MOVQ 0x90(SP), SI
. . 10ca317: MOVQ 0x10(BX)(SI*8), DI
. . 10ca31c: MOVQ 0x8(BX)(SI*8), R8
. . 10ca321: MOVQ 0(BX)(SI*8), R9
. . 10ca325: LEAQ 0x1(R8), R10
. . 10ca329: LEAQ 0(BX)(SI*8), R11
. . 10ca32d: CMPQ DI, R10
. . 10ca330: JA 0x10ca425
. . 10ca336: LEAQ 0x1(R8), DI
. . 10ca33a: MOVQ DI, 0x8(BX)(SI*8)
. . 10ca33f: MOVQ 0x58(SP), BX
. . 10ca344: MOVQ BX, 0(R9)(R8*8)
. . 10ca348: MOVQ 0x20(DX), CX ;graph.go:112
. . 10ca34c: MOVQ 0x18(DX), DI
. . 10ca350: CMPQ CX, BX
. . 10ca353: JAE 0x10ca6a5
. . 10ca359: MOVQ 0x80(SP), BX
. . 10ca361: MOVQ 0(DI)(BX*8), R8
. . 10ca365: MOVQ 0x10(DI)(BX*8), R9
. . 10ca36a: MOVQ 0x8(DI)(BX*8), R10
. . 10ca36f: LEAQ 0x1(R10), R11
. . 10ca373: LEAQ 0(DI)(BX*8), R12
. . 10ca377: CMPQ R9, R11
. . 10ca37a: JA 0x10ca38e
. . 10ca37c: LEAQ 0x1(R10), R9
. . 10ca380: MOVQ R9, 0x8(DI)(BX*8)
. . 10ca385: MOVQ AX, 0(R8)(R10*8)
. . 10ca389: JMP 0x10ca238
. . 10ca38e: MOVQ R12, 0xb8(SP)
. . 10ca396: MOVQ DI, 0xb0(SP)
. . 10ca39e: LEAQ runtime.types+85824(SB), AX
. . 10ca3a5: MOVQ AX, 0(SP)
. . 10ca3a9: MOVQ R8, 0x8(SP)
. . 10ca3ae: MOVQ R10, 0x10(SP)
. . 10ca3b3: MOVQ R9, 0x18(SP)
. . 10ca3b8: MOVQ R11, 0x20(SP)
72.02MB 72.02MB 10ca3bd: CALL runtime.growslice(SB) ;main.(*Graph).buildAdjList graph.go:112
. . 10ca3c2: MOVQ 0x28(SP), AX ;graph.go:112
. . 10ca3c7: MOVQ 0x30(SP), CX
. . 10ca3cc: MOVQ 0x38(SP), DX
. . 10ca3d1: MOVQ 0x80(SP), BX
. . 10ca3d9: MOVQ 0xb0(SP), SI
. . 10ca3e1: MOVQ DX, 0x10(SI)(BX*8)
. . 10ca3e6: CMPL $0x0, runtime.writeBarrier(SB)
. . 10ca3ed: JNE 0x10ca416
. . 10ca3ef: MOVQ AX, 0(SI)(BX*8)
. . 10ca3f3: MOVQ 0xe8(SP), DX ;graph.go:110
. . 10ca3fb: MOVQ SI, DI ;graph.go:112
. . 10ca3fe: MOVQ CX, R10
. . 10ca401: MOVQ AX, R8
. . 10ca404: MOVQ 0x60(SP), AX
. . 10ca409: MOVQ 0x90(SP), SI ;graph.go:111
. . 10ca411: JMP 0x10ca37c ;graph.go:112
. . 10ca416: MOVQ 0xb8(SP), DI
. . 10ca41e: CALL runtime.gcWriteBarrier(SB)
. . 10ca423: JMP 0x10ca3f3
. . 10ca425: MOVQ BX, 0xa8(SP) ;graph.go:111
. . 10ca42d: MOVQ R11, 0xa0(SP)
. . 10ca435: LEAQ runtime.types+85824(SB), AX
. . 10ca43c: MOVQ AX, 0(SP)
. . 10ca440: MOVQ R9, 0x8(SP)
. . 10ca445: MOVQ R8, 0x10(SP)
. . 10ca44a: MOVQ DI, 0x18(SP)
. . 10ca44f: MOVQ R10, 0x20(SP)
56.51MB 56.51MB 10ca454: CALL runtime.growslice(SB) ;main.(*Graph).buildAdjList graph.go:111
. . 10ca459: MOVQ 0x28(SP), AX ;graph.go:111
. . 10ca45e: MOVQ 0x30(SP), CX
. . 10ca463: MOVQ 0x38(SP), DX
. . 10ca468: MOVQ 0x90(SP), BX
. . 10ca470: MOVQ 0xa8(SP), SI
. . 10ca478: MOVQ DX, 0x10(SI)(BX*8)
. . 10ca47d: CMPL $0x0, runtime.writeBarrier(SB)
. . 10ca484: JNE 0x10ca4ad
. . 10ca486: MOVQ AX, 0(SI)(BX*8)
. . 10ca48a: MOVQ 0xe8(SP), DX ;graph.go:112
. . 10ca492: MOVQ SI, BX ;graph.go:111
. . 10ca495: MOVQ 0x90(SP), SI
. . 10ca49d: MOVQ CX, R8
. . 10ca4a0: MOVQ AX, R9
. . 10ca4a3: MOVQ 0x60(SP), AX ;graph.go:112
. . 10ca4a8: JMP 0x10ca336 ;graph.go:111
. . 10ca4ad: MOVQ 0xa0(SP), DI
. . 10ca4b5: CALL runtime.gcWriteBarrier(SB)
. . 10ca4ba: JMP 0x10ca48a
. . 10ca4bc: MOVQ 0x60(SP), AX ;graph.go:103
. . 10ca4c1: MOVQ 0xe8(SP), DX ;graph.go:110
. . 10ca4c9: MOVQ 0x90(SP), SI ;graph.go:111
. . 10ca4d1: JMP 0x10ca238 ;graph.go:109
. . 10ca4d6: MOVQ 0x60(SP), DX ;graph.go:103
. . 10ca4db: LEAQ 0x1(DX), AX
. . 10ca4df: MOVQ 0xe8(SP), DX
. . 10ca4e7: MOVQ 0x8(DX), BX
. . 10ca4eb: MOVQ 0(DX), SI
. . 10ca4ee: CMPQ BX, AX
. . 10ca4f1: JGE 0x10ca600
. . 10ca4f7: MOVQ AX, 0x60(SP)
. . 10ca4fc: MOVQ CX, 0x50(SP) ;graph.go:106
. . 10ca501: LEAQ 0(AX)(AX*2), CX ;graph.go:104
. . 10ca505: MOVQ CX, 0x90(SP)
. . 10ca50d: MOVQ 0x10(SI)(CX*8), DX
. . 10ca512: MOVQ DX, 0x70(SP)
. . 10ca517: MOVQ 0x8(SI)(CX*8), BX
. . 10ca51c: MOVQ BX, 0x68(SP)
. . 10ca521: MOVQ 0(SI)(CX*8), SI
. . 10ca525: MOVQ SI, 0x98(SP)
. . 10ca52d: MOVQ 0xf0(SP), DI ;graph.go:105
. . 10ca535: MOVQ DI, 0(SP)
. . 10ca539: MOVQ SI, 0x8(SP)
. . 10ca53e: MOVQ BX, 0x10(SP)
. . 10ca543: MOVQ DX, 0x18(SP)
. . 10ca548: CALL main.(*index).nearCount(SB)
. . 10ca54d: MOVQ 0x20(SP), AX
. . 10ca552: MOVQ AX, 0x78(SP)
. . 10ca557: LEAQ runtime.types+85824(SB), CX ;graph.go:107
. . 10ca55e: MOVQ CX, 0(SP)
. . 10ca562: MOVQ AX, 0x8(SP)
. . 10ca567: MOVQ AX, 0x10(SP)
245.11MB 245.11MB 10ca56c: CALL runtime.makeslice(SB) ;main.(*Graph).buildAdjList graph.go:107
. . 10ca571: MOVQ 0x18(SP), AX ;graph.go:107
. . 10ca576: MOVQ AX, 0xc0(SP)
. . 10ca57e: MOVQ 0xf0(SP), CX ;graph.go:108
. . 10ca586: MOVQ CX, 0(SP)
. . 10ca58a: MOVQ 0x98(SP), DX
. . 10ca592: MOVQ DX, 0x8(SP)
. . 10ca597: MOVQ 0x68(SP), BX
. . 10ca59c: MOVQ BX, 0x10(SP)
. . 10ca5a1: MOVQ 0x70(SP), SI
. . 10ca5a6: MOVQ SI, 0x18(SP)
. . 10ca5ab: MOVQ AX, 0x20(SP)
. . 10ca5b0: MOVQ 0x78(SP), DI
. . 10ca5b5: MOVQ DI, 0x28(SP)
. . 10ca5ba: MOVQ DI, 0x30(SP)
. . 10ca5bf: CALL main.(*index).near(SB)
. . 10ca5c4: MOVQ 0x78(SP), AX ;graph.go:106
. . 10ca5c9: MOVQ 0x50(SP), CX
. . 10ca5ce: ADDQ AX, CX
. . 10ca5d1: MOVQ CX, 0x50(SP)
. . 10ca5d6: MOVQ 0x70(SP), DX ;graph.go:109
. . 10ca5db: MOVQ 0xe8(SP), BX
. . 10ca5e3: MOVQ 0x98(SP), SI
. . 10ca5eb: MOVQ 0x68(SP), DI
. . 10ca5f0: MOVQ 0xc0(SP), R8
. . 10ca5f8: XORL R9, R9
. . 10ca5fb: JMP 0x10ca27f
. . 10ca600: XORPS X0, X0 ;graph.go:116
. . 10ca603: CVTSI2SDQ CX, X0
. . 10ca608: XORPS X1, X1
. . 10ca60b: CVTSI2SDQ BX, X1
. . 10ca610: DIVSD X1, X0
. . 10ca614: MOVSD_XMM X0, 0(SP)
. . 10ca619: CALL runtime.convT64(SB)
. . 10ca61e: MOVQ 0x8(SP), AX
. . 10ca623: XORPS X0, X0
. . 10ca626: MOVUPS X0, 0xc8(SP)
. . 10ca62e: LEAQ runtime.types+84096(SB), CX
. . 10ca635: MOVQ CX, 0xc8(SP)
. . 10ca63d: MOVQ AX, 0xd0(SP)
. . 10ca645: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10ca64c: LEAQ go.itab.*os.File,io.Writer(SB), CX
. . 10ca653: MOVQ CX, 0(SP)
. . 10ca657: MOVQ AX, 0x8(SP)
. . 10ca65c: LEAQ go.string.*+3228(SB), AX
. . 10ca663: MOVQ AX, 0x10(SP)
. . 10ca668: MOVQ $0xa, 0x18(SP)
. . 10ca671: LEAQ 0xc8(SP), AX
. . 10ca679: MOVQ AX, 0x20(SP)
. . 10ca67e: MOVQ $0x1, 0x28(SP)
. . 10ca687: MOVQ $0x1, 0x30(SP)
. . 10ca690: CALL fmt.Fprintf(SB)
. . 10ca695: MOVQ 0xd8(SP), BP
. . 10ca69d: ADDQ $0xe0, SP
. . 10ca6a4: RET
. . 10ca6a5: MOVQ BX, AX ;graph.go:112
. . 10ca6a8: CALL runtime.panicIndex(SB)
. . 10ca6ad: CALL runtime.panicIndex(SB) ;graph.go:111
. . 10ca6b2: MOVQ R10, AX ;graph.go:110
. . 10ca6b5: MOVQ R11, CX
. . 10ca6b8: CALL runtime.panicIndex(SB)
. . 10ca6bd: NOPL
. . 10ca6be: CALL runtime.morestack_noctxt(SB) ;graph.go:101
. . 10ca6c3: JMP main.(*Graph).buildAdjList(SB)
. . 10ca6c8: INT $0x3
. . 10ca6c9: INT $0x3
. . 10ca6ca: INT $0x3
. . 10ca6cb: INT $0x3
. . 10ca6cc: INT $0x3
. . 10ca6cd: INT $0x3
. . 10ca6ce: INT $0x3
ROUTINE ======================== main.(*index).add
97.50MB 97.50MB (flat, cum) 11.85% of Total
. . 10cbdc0: MOVQ GS:0x30, CX ;index.go:29
. . 10cbdc9: LEAQ -0x18(SP), AX
. . 10cbdce: CMPQ 0x10(CX), AX
. . 10cbdd2: JBE 0x10cc0c6
. . 10cbdd8: SUBQ $0x98, SP
. . 10cbddf: MOVQ BP, 0x90(SP)
. . 10cbde7: LEAQ 0x90(SP), BP
. . 10cbdef: MOVQ 0xa0(SP), BX ;index.go:32
. . 10cbdf7: MOVQ 0x38(BX), DX
. . 10cbdfb: MOVQ 0x28(BX), SI
. . 10cbdff: MOVQ 0xb8(SP), DI
. . 10cbe07: LEAQ -0x1(DI), CX
. . 10cbe0b: CMPQ DX, CX
. . 10cbe0e: JA 0x10cc0c0
. . 10cbe14: MOVQ CX, 0x58(SP)
. . 10cbe19: MOVQ DX, 0x50(SP)
. . 10cbe1e: MOVQ SI, 0x78(SP)
. . 10cbe23: MOVQ 0xb0(SP), R8 ;index.go:33
. . 10cbe2b: XORL AX, AX
. . 10cbe2d: JMP 0x10cbe82
. . 10cbe2f: LEAQ 0x1(R8), R10 ;index.go:39
. . 10cbe33: MOVQ R10, 0x8(BX)(SI*8)
. . 10cbe38: MOVQ 0xa8(SP), R10
. . 10cbe40: MOVQ R10, 0(R9)(R8*8)
. . 10cbe44: MOVQ 0x78(SP), R9 ;index.go:33
. . 10cbe49: MOVQ 0x50(SP), R11
. . 10cbe4e: MOVQ 0x58(SP), R12
. . 10cbe53: MOVQ 0xb8(SP), R13
. . 10cbe5b: MOVQ 0xb0(SP), R14
. . 10cbe63: MOVQ 0x68(SP), R15
. . 10cbe68: MOVQ R12, CX ;index.go:104
. . 10cbe6b: MOVQ R11, DX ;index.go:103
. . 10cbe6e: MOVQ 0xa0(SP), BX ;index.go:36
. . 10cbe76: MOVQ R9, SI ;index.go:104
. . 10cbe79: MOVQ R13, DI ;index.go:33
. . 10cbe7c: MOVQ R14, R8 ;index.go:105
. . 10cbe7f: MOVQ R15, AX ;index.go:33
. . 10cbe82: CMPQ DI, AX
. . 10cbe85: JGE 0x10cc093
. . 10cbe8b: NOPL ;index.go:34
. . 10cbe8c: CMPQ DX, AX ;index.go:103
. . 10cbe8f: JA 0x10cc0b8
. . 10cbe95: CMPQ CX, AX ;index.go:104
. . 10cbe98: JA 0x10cc0b3
. . 10cbe9e: MOVQ AX, 0x48(SP) ;index.go:33
. . 10cbea3: SUBQ AX, CX ;index.go:104
. . 10cbea6: MOVQ CX, 0x40(SP)
. . 10cbeab: SUBQ AX, DX
. . 10cbeae: NEGQ DX
. . 10cbeb1: SARQ $0x3f, DX
. . 10cbeb5: ANDQ AX, DX
. . 10cbeb8: ADDQ SI, DX
. . 10cbebb: MOVQ DX, 0x70(SP)
. . 10cbec0: CMPQ R8, SI ;index.go:105
. . 10cbec3: JE 0x10cbed8
. . 10cbec5: MOVQ SI, 0(SP)
. . 10cbec9: MOVQ R8, 0x8(SP)
. . 10cbece: MOVQ AX, 0x10(SP)
. . 10cbed3: CALL runtime.memmove(SB)
. . 10cbed8: MOVQ 0x48(SP), AX ;index.go:106
. . 10cbedd: INCQ AX
. . 10cbee0: MOVQ AX, 0x68(SP)
. . 10cbee5: MOVQ 0xb8(SP), CX
. . 10cbeed: SUBQ AX, CX
. . 10cbef0: MOVQ 0x40(SP), BX
. . 10cbef5: CMPQ CX, BX
. . 10cbef8: CMOVG CX, BX
. . 10cbefc: MOVQ 0xc0(SP), CX
. . 10cbf04: SUBQ AX, CX
. . 10cbf07: NEGQ CX
. . 10cbf0a: SARQ $0x3f, CX
. . 10cbf0e: ANDQ AX, CX
. . 10cbf11: MOVQ 0xb0(SP), DI
. . 10cbf19: ADDQ DI, CX
. . 10cbf1c: MOVQ 0x70(SP), R8
. . 10cbf21: CMPQ R8, CX
. . 10cbf24: JNE 0x10cc07b
. . 10cbf2a: MOVQ 0xa0(SP), AX ;index.go:36
. . 10cbf32: MOVQ 0(AX), CX
. . 10cbf35: MOVQ 0x8(AX), DX
. . 10cbf39: MOVQ 0x20(CX), CX
. . 10cbf3d: MOVQ DX, 0(SP)
. . 10cbf41: CALL CX
. . 10cbf43: MOVQ 0xa0(SP), AX ;index.go:37
. . 10cbf4b: MOVQ 0(AX), CX
. . 10cbf4e: MOVQ 0x8(AX), DX
. . 10cbf52: MOVQ 0x40(CX), CX
. . 10cbf56: MOVQ DX, 0(SP)
. . 10cbf5a: MOVQ 0x78(SP), DX
. . 10cbf5f: MOVQ DX, 0x8(SP)
. . 10cbf64: MOVQ 0x58(SP), BX
. . 10cbf69: MOVQ BX, 0x10(SP)
. . 10cbf6e: MOVQ 0x50(SP), SI
. . 10cbf73: MOVQ SI, 0x18(SP)
. . 10cbf78: CALL CX
. . 10cbf7a: MOVQ 0xa0(SP), AX ;index.go:38
. . 10cbf82: MOVQ 0(AX), CX
. . 10cbf85: MOVQ 0x8(AX), DX
. . 10cbf89: MOVQ 0x38(CX), CX
. . 10cbf8d: MOVQ DX, 0(SP)
. . 10cbf91: CALL CX
. . 10cbf93: MOVQ 0x8(SP), AX
. . 10cbf98: MOVQ 0xa0(SP), CX
. . 10cbfa0: MOVQ 0x40(CX), DX
. . 10cbfa4: TESTQ DX, DX
. . 10cbfa7: JE 0x10cc0ae
. . 10cbfad: MOVQ DX, BX
. . 10cbfb0: XORL DX, DX
. . 10cbfb2: DIVQ BX
. . 10cbfb5: MOVQ 0x10(CX), BX ;index.go:39
. . 10cbfb9: MOVQ 0x18(CX), SI
. . 10cbfbd: CMPQ SI, DX
. . 10cbfc0: JAE 0x10cc0a3
. . 10cbfc6: LEAQ 0(DX)(DX*2), SI
. . 10cbfca: MOVQ 0x10(BX)(SI*8), DI
. . 10cbfcf: MOVQ 0x8(BX)(SI*8), R8
. . 10cbfd4: MOVQ 0(BX)(SI*8), R9
. . 10cbfd8: LEAQ 0x1(R8), R10
. . 10cbfdc: LEAQ 0(BX)(SI*8), R11
. . 10cbfe0: CMPQ DI, R10
. . 10cbfe3: JBE 0x10cbe2f
. . 10cbfe9: MOVQ BX, 0x88(SP)
. . 10cbff1: MOVQ SI, 0x60(SP)
. . 10cbff6: MOVQ R11, 0x80(SP)
. . 10cbffe: LEAQ runtime.types+85824(SB), AX
. . 10cc005: MOVQ AX, 0(SP)
. . 10cc009: MOVQ R9, 0x8(SP)
. . 10cc00e: MOVQ R8, 0x10(SP)
. . 10cc013: MOVQ DI, 0x18(SP)
. . 10cc018: MOVQ R10, 0x20(SP)
97.50MB 97.50MB 10cc01d: CALL runtime.growslice(SB) ;main.(*index).add index.go:39
. . 10cc022: MOVQ 0x28(SP), AX ;index.go:39
. . 10cc027: MOVQ 0x30(SP), CX
. . 10cc02c: MOVQ 0x38(SP), DX
. . 10cc031: MOVQ 0x60(SP), BX
. . 10cc036: MOVQ 0x88(SP), SI
. . 10cc03e: MOVQ DX, 0x10(SI)(BX*8)
. . 10cc043: CMPL $0x0, runtime.writeBarrier(SB)
. . 10cc04a: JNE 0x10cc06c
. . 10cc04c: MOVQ AX, 0(SI)(BX*8)
. . 10cc050: MOVQ CX, R8
. . 10cc053: MOVQ AX, R9
. . 10cc056: MOVQ 0xa0(SP), CX ;index.go:36
. . 10cc05e: MOVQ BX, DX ;index.go:39
. . 10cc061: MOVQ SI, BX
. . 10cc064: MOVQ DX, SI
. . 10cc067: JMP 0x10cbe2f
. . 10cc06c: MOVQ 0x80(SP), DI
. . 10cc074: CALL runtime.gcWriteBarrier(SB)
. . 10cc079: JMP 0x10cc050
. . 10cc07b: MOVQ R8, 0(SP) ;index.go:106
. . 10cc07f: MOVQ CX, 0x8(SP)
. . 10cc084: MOVQ BX, 0x10(SP)
. . 10cc089: CALL runtime.memmove(SB)
. . 10cc08e: JMP 0x10cbf2a
. . 10cc093: MOVQ 0x90(SP), BP
. . 10cc09b: ADDQ $0x98, SP
. . 10cc0a2: RET
. . 10cc0a3: MOVQ DX, AX ;index.go:39
. . 10cc0a6: MOVQ SI, CX
. . 10cc0a9: CALL runtime.panicIndexU(SB)
. . 10cc0ae: CALL runtime.panicdivide(SB) ;index.go:38
. . 10cc0b3: CALL runtime.panicSliceB(SB) ;index.go:104
. . 10cc0b8: MOVQ AX, CX ;index.go:103
. . 10cc0bb: CALL runtime.panicSliceAcap(SB)
. . 10cc0c0: CALL runtime.panicSliceAcap(SB) ;index.go:32
. . 10cc0c5: NOPL
. . 10cc0c6: CALL runtime.morestack_noctxt(SB) ;index.go:29
. . 10cc0cb: ?
. . 10cc0cc: LOCK CLD
. . 10cc0ce: ?
ROUTINE ======================== main.LoadDictionary
158.86MB 822.01MB (flat, cum) 99.88% of Total
. . 10c9ab0: MOVQ GS:0x30, CX ;graph.go:39
. . 10c9ab9: LEAQ 0xfffffec0(SP), AX
. . 10c9ac1: CMPQ 0x10(CX), AX
. . 10c9ac5: JBE 0x10ca1ef
. . 10c9acb: SUBQ $0x1c0, SP
. . 10c9ad2: MOVQ BP, 0x1b8(SP)
. . 10c9ada: LEAQ 0x1b8(SP), BP
. . 10c9ae2: MOVQ $0x0, 0x1f0(SP)
. . 10c9aee: LEAQ go.string.*+5959(SB), AX ;graph.go:40
. . 10c9af5: MOVQ AX, 0(SP)
. . 10c9af9: MOVQ $0xe, 0x8(SP)
. . 10c9b02: CALL main.newTimer(SB)
. . 10c9b07: MOVQ 0x10(SP), AX
. . 10c9b0c: MOVL $0x0, 0x68(SP)
. . 10c9b14: MOVQ AX, 0x80(SP)
. . 10c9b1c: LEAQ 0x68(SP), AX
. . 10c9b21: MOVQ AX, 0(SP)
. . 10c9b25: CALL runtime.deferprocStack(SB)
. . 10c9b2a: TESTL AX, AX
. . 10c9b2c: JNE 0x10ca1d0
. . 10c9b32: NOPL ;graph.go:41
. . 10c9b33: MOVQ 0x1c8(SP), AX ;file.go:280
. . 10c9b3b: MOVQ AX, 0(SP)
. . 10c9b3f: MOVQ 0x1d0(SP), AX
. . 10c9b47: MOVQ AX, 0x8(SP)
. . 10c9b4c: MOVQ $0x0, 0x10(SP)
. . 10c9b55: MOVL $0x0, 0x18(SP)
. . 10c9b5d: CALL os.OpenFile(SB)
. . 10c9b62: MOVQ 0x20(SP), AX
. . 10c9b67: MOVQ AX, 0x118(SP)
. . 10c9b6f: MOVQ 0x30(SP), CX
. . 10c9b74: MOVQ 0x28(SP), DX
. . 10c9b79: TESTQ DX, DX ;graph.go:42
. . 10c9b7c: JE 0x10c9bc2
. . 10c9b7e: JE 0x10c9b84 ;graph.go:43
. . 10c9b80: MOVQ 0x8(DX), DX
. . 10c9b84: XORPS X0, X0
. . 10c9b87: MOVUPS X0, 0x128(SP)
. . 10c9b8f: MOVQ DX, 0x128(SP)
. . 10c9b97: MOVQ CX, 0x130(SP)
. . 10c9b9f: LEAQ 0x128(SP), AX
. . 10c9ba7: MOVQ AX, 0(SP)
. . 10c9bab: MOVQ $0x1, 0x8(SP)
. . 10c9bb4: MOVQ $0x1, 0x10(SP)
. . 10c9bbd: CALL log.Fatal(SB)
. . 10c9bc2: MOVL $0x18, 0xa0(SP) ;graph.go:45
. . 10c9bcd: LEAQ go.func.*+293(SB), AX
. . 10c9bd4: MOVQ AX, 0xb8(SP)
. . 10c9bdc: MOVQ 0x118(SP), AX
. . 10c9be4: MOVQ AX, 0xd0(SP)
. . 10c9bec: LEAQ 0xa0(SP), CX
. . 10c9bf4: MOVQ CX, 0(SP)
. . 10c9bf8: CALL runtime.deferprocStack(SB)
. . 10c9bfd: TESTL AX, AX
. . 10c9bff: JNE 0x10ca1ba
. . 10c9c05: LEAQ runtime.types+157344(SB), AX ;graph.go:47
. . 10c9c0c: MOVQ AX, 0(SP)
. . 10c9c10: CALL runtime.newobject(SB)
. . 10c9c15: MOVQ 0x8(SP), AX
. . 10c9c1a: MOVQ AX, 0x120(SP)
. . 10c9c22: LEAQ runtime.types+141632(SB), CX ;graph.go:48
. . 10c9c29: MOVQ CX, 0(SP)
. . 10c9c2d: XORPS X0, X0
. . 10c9c30: MOVUPS X0, 0x8(SP)
. . 10c9c35: CALL runtime.makeslice(SB)
. . 10c9c3a: MOVQ 0x18(SP), AX
. . 10c9c3f: CMPL $0x0, runtime.writeBarrier(SB) ;graph.go:47
. . 10c9c46: JNE 0x10ca175
. . 10c9c4c: XORPS X0, X0
. . 10c9c4f: MOVQ 0x120(SP), CX
. . 10c9c57: MOVUPS X0, 0(CX)
. . 10c9c5a: MOVUPS X0, 0x10(CX)
. . 10c9c5e: MOVUPS X0, 0x20(CX)
. . 10c9c62: MOVQ AX, 0(CX)
. . 10c9c65: NOPL ;graph.go:53
. . 10c9c66: LEAQ 0x138(SP), DI ;scan.go:87
. . 10c9c6e: MOVQ BP, -0x10(SP)
. . 10c9c73: LEAQ -0x10(SP), BP
. . 10c9c78: CALL 0x10586ba
. . 10c9c7d: MOVQ 0(BP), BP
. . 10c9c81: LEAQ 0x138(SP), DI
. . 10c9c89: MOVQ BP, -0x10(SP)
. . 10c9c8e: LEAQ -0x10(SP), BP
. . 10c9c93: CALL 0x10586ba
. . 10c9c98: MOVQ 0(BP), BP
. . 10c9c9c: LEAQ go.itab.*os.File,io.Reader(SB), AX
. . 10c9ca3: MOVQ AX, 0x138(SP)
. . 10c9cab: MOVQ 0x118(SP), AX
. . 10c9cb3: MOVQ AX, 0x140(SP)
. . 10c9cbb: LEAQ go.func.*+5(SB), AX
. . 10c9cc2: MOVQ AX, 0x148(SP)
. . 10c9cca: MOVQ $0x10000, 0x150(SP)
. . 10c9cd6: XORL AX, AX
. . 10c9cd8: JMP 0x10c9cdd ;graph.go:54
. . 10c9cda: MOVQ SI, AX ;graph.go:74
. . 10c9cdd: MOVQ AX, 0x48(SP)
. . 10c9ce2: LEAQ 0x138(SP), CX ;graph.go:54
. . 10c9cea: MOVQ CX, 0(SP)
. . 10c9cee: CALL bufio.(*Scanner).Scan(SB)
. . 10c9cf3: CMPB $0x0, 0x8(SP)
. . 10c9cf8: JE 0x10c9e3b
. . 10c9cfe: NOPL ;graph.go:55
. . 10c9cff: MOVQ 0x160(SP), AX ;scan.go:106
. . 10c9d07: MOVQ AX, 0x40(SP)
. . 10c9d0c: MOVQ 0x158(SP), CX
. . 10c9d14: MOVQ CX, 0x100(SP)
. . 10c9d1c: LEAQ runtime.types+88832(SB), DX ;graph.go:56
. . 10c9d23: MOVQ DX, 0(SP)
. . 10c9d27: MOVQ AX, 0x8(SP)
. . 10c9d2c: MOVQ AX, 0x10(SP)
9.50MB 9.50MB 10c9d31: CALL runtime.makeslice(SB) ;main.LoadDictionary graph.go:56
. . 10c9d36: MOVQ 0x18(SP), AX ;graph.go:56
. . 10c9d3b: MOVQ AX, 0x110(SP)
. . 10c9d43: MOVQ 0x100(SP), CX ;graph.go:57
. . 10c9d4b: CMPQ CX, AX
. . 10c9d4e: JE 0x10c9d68
. . 10c9d50: MOVQ AX, 0(SP)
. . 10c9d54: MOVQ CX, 0x8(SP)
. . 10c9d59: MOVQ 0x40(SP), CX
. . 10c9d5e: MOVQ CX, 0x10(SP)
. . 10c9d63: CALL runtime.memmove(SB)
. . 10c9d68: MOVQ 0x120(SP), CX ;graph.go:58
. . 10c9d70: MOVQ 0x8(CX), DX
. . 10c9d74: MOVQ 0x10(CX), BX
. . 10c9d78: LEAQ 0x1(DX), SI
. . 10c9d7c: MOVQ 0(CX), R8
. . 10c9d7f: CMPQ BX, SI
. . 10c9d82: JA 0x10c9ddb
. . 10c9d84: LEAQ 0x1(DX), BX
. . 10c9d88: MOVQ BX, 0x8(CX)
. . 10c9d8c: LEAQ 0(DX)(DX*2), DX
. . 10c9d90: MOVQ 0x40(SP), BX
. . 10c9d95: MOVQ BX, 0x8(R8)(DX*8)
. . 10c9d9a: MOVQ BX, 0x10(R8)(DX*8)
. . 10c9d9f: MOVQ 0x48(SP), SI ;graph.go:59
. . 10c9da4: CMPQ SI, BX
. . 10c9da7: CMOVG BX, SI ;graph.go:74
. . 10c9dab: LEAQ 0(R8)(DX*8), DI ;graph.go:58
. . 10c9daf: CMPL $0x0, runtime.writeBarrier(SB)
. . 10c9db6: JNE 0x10c9dc9
. . 10c9db8: MOVQ 0x110(SP), AX
. . 10c9dc0: MOVQ AX, 0(R8)(DX*8)
. . 10c9dc4: JMP 0x10c9cda
. . 10c9dc9: MOVQ 0x110(SP), AX
. . 10c9dd1: CALL runtime.gcWriteBarrier(SB)
. . 10c9dd6: JMP 0x10c9cda
. . 10c9ddb: LEAQ runtime.types+141632(SB), AX
. . 10c9de2: MOVQ AX, 0(SP)
. . 10c9de6: MOVQ R8, 0x8(SP)
. . 10c9deb: MOVQ DX, 0x10(SP)
. . 10c9df0: MOVQ BX, 0x18(SP)
. . 10c9df5: MOVQ SI, 0x20(SP)
126.47MB 126.47MB 10c9dfa: CALL runtime.growslice(SB) ;main.LoadDictionary graph.go:58
. . 10c9dff: MOVQ 0x28(SP), AX ;graph.go:58
. . 10c9e04: MOVQ 0x30(SP), CX
. . 10c9e09: MOVQ 0x38(SP), DX
. . 10c9e0e: MOVQ 0x120(SP), DI
. . 10c9e16: MOVQ DX, 0x10(DI)
. . 10c9e1a: CMPL $0x0, runtime.writeBarrier(SB)
. . 10c9e21: JNE 0x10c9e34
. . 10c9e23: MOVQ AX, 0(DI)
. . 10c9e26: MOVQ CX, DX
. . 10c9e29: MOVQ AX, R8
. . 10c9e2c: MOVQ DI, CX
. . 10c9e2f: JMP 0x10c9d84
. . 10c9e34: CALL runtime.gcWriteBarrier(SB)
. . 10c9e39: JMP 0x10c9e26
. . 10c9e3b: MOVQ 0x1e8(SP), AX ;graph.go:64
. . 10c9e43: TESTQ AX, AX
. . 10c9e46: JNE 0x10ca117
. . 10c9e4c: MOVQ 0x120(SP), AX ;graph.go:68
. . 10c9e54: MOVQ 0x8(AX), CX
. . 10c9e58: MOVQ CX, 0x60(SP)
. . 10c9e5d: LEAQ runtime.types+77184(SB), DX
. . 10c9e64: MOVQ DX, 0(SP)
. . 10c9e68: MOVQ CX, 0x8(SP)
. . 10c9e6d: MOVQ CX, 0x10(SP)
22.89MB 22.89MB 10c9e72: CALL runtime.makeslice(SB) ;main.LoadDictionary graph.go:68
. . 10c9e77: MOVQ 0x18(SP), AX ;graph.go:68
. . 10c9e7c: MOVQ 0x60(SP), CX
. . 10c9e81: MOVQ 0x120(SP), DX
. . 10c9e89: MOVQ CX, 0x20(DX)
. . 10c9e8d: MOVQ CX, 0x28(DX)
. . 10c9e91: CMPL $0x0, runtime.writeBarrier(SB)
. . 10c9e98: JNE 0x10ca109
. . 10c9e9e: MOVQ AX, 0x18(DX)
. . 10c9ea2: XORL AX, AX
. . 10c9ea4: JMP 0x10c9eb5 ;graph.go:69
. . 10c9ea6: LEAQ 0x1(SI), BX
. . 10c9eaa: MOVQ 0x60(SP), CX
. . 10c9eaf: MOVQ AX, DX ;graph.go:70
. . 10c9eb2: MOVQ BX, AX ;graph.go:69
. . 10c9eb5: CMPQ CX, AX
. . 10c9eb8: JGE 0x10c9f36
. . 10c9eba: MOVQ AX, 0x50(SP)
. . 10c9ebf: LEAQ runtime.types+85824(SB), AX ;graph.go:70
. . 10c9ec6: MOVQ AX, 0(SP)
. . 10c9eca: XORPS X0, X0
. . 10c9ecd: MOVUPS X0, 0x8(SP)
. . 10c9ed2: CALL runtime.makeslice(SB)
. . 10c9ed7: MOVQ 0x120(SP), AX
. . 10c9edf: MOVQ 0x20(AX), CX
. . 10c9ee3: MOVQ 0x18(AX), DX
. . 10c9ee7: MOVQ 0x18(SP), BX
. . 10c9eec: MOVQ 0x50(SP), SI
. . 10c9ef1: CMPQ CX, SI
. . 10c9ef4: JAE 0x10ca1e6
. . 10c9efa: LEAQ 0(SI)(SI*2), CX
. . 10c9efe: MOVQ $0x0, 0x8(DX)(CX*8)
. . 10c9f07: MOVQ $0x0, 0x10(DX)(CX*8)
. . 10c9f10: LEAQ 0(DX)(CX*8), DI
. . 10c9f14: CMPL $0x0, runtime.writeBarrier(SB)
. . 10c9f1b: JNE 0x10c9f23
. . 10c9f1d: MOVQ BX, 0(DX)(CX*8)
. . 10c9f21: JMP 0x10c9ea6
. . 10c9f23: MOVQ AX, CX ;graph.go:47
. . 10c9f26: MOVQ BX, AX ;graph.go:70
. . 10c9f29: CALL runtime.gcWriteBarrier(SB)
. . 10c9f2e: MOVQ CX, AX
. . 10c9f31: JMP 0x10c9ea6
. . 10c9f36: LEAQ go.string.*+3388(SB), AX ;graph.go:73
. . 10c9f3d: MOVQ AX, 0(SP)
. . 10c9f41: MOVQ $0xa, 0x8(SP)
. . 10c9f4a: CALL main.newTimer(SB)
. . 10c9f4f: MOVQ 0x10(SP), AX
. . 10c9f54: MOVQ AX, 0xe8(SP)
. . 10c9f5c: MOVQ $0x800000, 0(SP) ;graph.go:74
. . 10c9f64: MOVQ 0x48(SP), CX
. . 10c9f69: MOVQ CX, 0x8(SP)
. 192MB 10c9f6e: CALL main.newIndex(SB) ;main.LoadDictionary graph.go:74
. . 10c9f73: MOVQ 0x10(SP), AX ;graph.go:74
. . 10c9f78: MOVQ AX, 0xf8(SP)
. . 10c9f80: MOVQ 0x120(SP), CX ;graph.go:75
. . 10c9f88: MOVQ 0x8(CX), DX
. . 10c9f8c: MOVQ 0(CX), BX
. . 10c9f8f: TESTQ DX, DX
. . 10c9f92: JLE 0x10c9ffb
. . 10c9f94: MOVQ DX, 0x60(SP)
. . 10c9f99: XORL SI, SI
. . 10c9f9b: JMP 0x10c9fb4
. . 10c9f9d: MOVQ 0x108(SP), DX
. . 10c9fa5: LEAQ 0x18(DX), BX
. . 10c9fa9: MOVQ AX, SI
. . 10c9fac: MOVQ 0xf8(SP), AX ;graph.go:76
. . 10c9fb4: MOVQ BX, 0x108(SP) ;graph.go:75
. . 10c9fbc: MOVQ SI, 0x58(SP)
. . 10c9fc1: MOVQ 0x10(BX), CX
. . 10c9fc5: MOVQ 0x8(BX), DX
. . 10c9fc9: MOVQ 0(BX), DI
. . 10c9fcc: MOVQ AX, 0(SP) ;graph.go:76
. . 10c9fd0: MOVQ SI, 0x8(SP)
. . 10c9fd5: MOVQ DI, 0x10(SP)
. . 10c9fda: MOVQ DX, 0x18(SP)
. . 10c9fdf: MOVQ CX, 0x20(SP)
. 97.50MB 10c9fe4: CALL main.(*index).add(SB) ;main.LoadDictionary graph.go:76
. . 10c9fe9: MOVQ 0x58(SP), AX ;graph.go:75
. . 10c9fee: INCQ AX
. . 10c9ff1: MOVQ 0x60(SP), CX
. . 10c9ff6: CMPQ CX, AX
. . 10c9ff9: JL 0x10c9f9d
. . 10c9ffb: MOVQ 0xe8(SP), DX ;graph.go:78
. . 10ca003: MOVQ 0(DX), AX
. . 10ca006: CALL AX
. . 10ca008: LEAQ go.string.*+4694(SB), AX ;graph.go:86
. . 10ca00f: MOVQ AX, 0(SP)
. . 10ca013: MOVQ $0xc, 0x8(SP)
. . 10ca01c: CALL main.newTimer(SB)
. . 10ca021: MOVQ 0x10(SP), AX
. . 10ca026: MOVQ AX, 0xf0(SP)
. . 10ca02e: MOVQ 0x120(SP), CX ;graph.go:87
. . 10ca036: MOVQ CX, 0(SP)
. . 10ca03a: MOVQ 0xf8(SP), BX
. . 10ca042: MOVQ BX, 0x8(SP)
. 373.65MB 10ca047: CALL main.(*Graph).buildAdjList(SB) ;main.LoadDictionary graph.go:87
. . 10ca04c: MOVQ 0xf0(SP), DX ;graph.go:88
. . 10ca054: MOVQ 0(DX), AX
. . 10ca057: CALL AX
. . 10ca059: MOVQ 0x1e8(SP), AX ;graph.go:64
. . 10ca061: TESTQ AX, AX
. . 10ca064: JNE 0x10ca0ab ;graph.go:90
. . 10ca066: MOVZX 0x1d8(SP), AX ;graph.go:39
. . 10ca06e: TESTL AL, AL
. . 10ca070: JNE 0x10ca098 ;graph.go:94
. . 10ca072: MOVQ 0x120(SP), AX ;graph.go:98
. . 10ca07a: MOVQ AX, 0x1f0(SP)
. . 10ca082: NOPL
. . 10ca083: CALL runtime.deferreturn(SB)
. . 10ca088: MOVQ 0x1b8(SP), BP
. . 10ca090: ADDQ $0x1c0, SP
. . 10ca097: RET
. . 10ca098: MOVQ 0x120(SP), AX ;graph.go:95
. . 10ca0a0: MOVQ AX, 0(SP)
. . 10ca0a4: CALL main.adjListStats(SB)
. . 10ca0a9: JMP 0x10ca072
. . 10ca0ab: MOVQ $0x0, 0(SP) ;graph.go:91
. . 10ca0b3: MOVQ 0x1e0(SP), CX
. . 10ca0bb: MOVQ CX, 0x8(SP)
. . 10ca0c0: MOVQ AX, 0x10(SP)
. . 10ca0c5: LEAQ go.string.*+2067(SB), AX
. . 10ca0cc: MOVQ AX, 0x18(SP)
. . 10ca0d1: MOVQ $0x8, 0x20(SP)
. . 10ca0da: CALL runtime.concatstring2(SB)
. . 10ca0df: MOVQ 0x30(SP), AX
. . 10ca0e4: MOVQ 0x28(SP), CX
. . 10ca0e9: MOVQ 0x120(SP), DX
. . 10ca0f1: MOVQ DX, 0(SP)
. . 10ca0f5: MOVQ CX, 0x8(SP)
. . 10ca0fa: MOVQ AX, 0x10(SP)
. . 10ca0ff: CALL main.(*Graph).dumpAdjList(SB)
. . 10ca104: JMP 0x10ca066
. . 10ca109: LEAQ 0x18(DX), DI ;graph.go:68
. . 10ca10d: CALL runtime.gcWriteBarrier(SB)
. . 10ca112: JMP 0x10c9ea2
. . 10ca117: MOVQ $0x0, 0(SP) ;graph.go:65
. . 10ca11f: MOVQ 0x1e0(SP), CX
. . 10ca127: MOVQ CX, 0x8(SP)
. . 10ca12c: MOVQ AX, 0x10(SP)
. . 10ca131: LEAQ go.string.*+5334(SB), DX
. . 10ca138: MOVQ DX, 0x18(SP)
. . 10ca13d: MOVQ $0xd, 0x20(SP)
. . 10ca146: CALL runtime.concatstring2(SB)
. . 10ca14b: MOVQ 0x30(SP), AX
. . 10ca150: MOVQ 0x28(SP), CX
. . 10ca155: MOVQ 0x120(SP), DX
. . 10ca15d: MOVQ DX, 0(SP)
. . 10ca161: MOVQ CX, 0x8(SP)
. . 10ca166: MOVQ AX, 0x10(SP)
. . 10ca16b: CALL main.(*Graph).dumpVertices(SB)
. . 10ca170: JMP 0x10c9e4c
. . 10ca175: MOVQ AX, 0x110(SP) ;graph.go:48
. . 10ca17d: LEAQ runtime.types+157344(SB), AX ;graph.go:47
. . 10ca184: MOVQ AX, 0(SP)
. . 10ca188: MOVQ 0x120(SP), AX
. . 10ca190: MOVQ AX, 0x8(SP)
. . 10ca195: CALL runtime.typedmemclr(SB)
. . 10ca19a: MOVQ 0x120(SP), DI
. . 10ca1a2: MOVQ 0x110(SP), AX
. . 10ca1aa: CALL runtime.gcWriteBarrier(SB)
. . 10ca1af: MOVQ DI, CX ;graph.go:68
. . 10ca1b2: XORPS X0, X0 ;graph.go:48
. . 10ca1b5: JMP 0x10c9c65 ;graph.go:47
. . 10ca1ba: NOPL ;graph.go:45
. . 10ca1bb: CALL runtime.deferreturn(SB)
. . 10ca1c0: MOVQ 0x1b8(SP), BP
. . 10ca1c8: ADDQ $0x1c0, SP
. . 10ca1cf: RET
. . 10ca1d0: NOPL ;graph.go:40
. . 10ca1d1: CALL runtime.deferreturn(SB)
. . 10ca1d6: MOVQ 0x1b8(SP), BP
. . 10ca1de: ADDQ $0x1c0, SP
. . 10ca1e5: RET
. . 10ca1e6: MOVQ SI, AX ;graph.go:70
. . 10ca1e9: CALL runtime.panicIndex(SB)
. . 10ca1ee: NOPL
. . 10ca1ef: CALL runtime.morestack_noctxt(SB) ;graph.go:39
. . 10ca1f4: JMP main.LoadDictionary(SB)
. . 10ca1f9: INT $0x3
. . 10ca1fa: INT $0x3
. . 10ca1fb: INT $0x3
. . 10ca1fc: INT $0x3
. . 10ca1fd: INT $0x3
. . 10ca1fe: INT $0x3
ROUTINE ======================== main.main
0 822.01MB (flat, cum) 99.88% of Total
. . 10cc890: MOVQ GS:0x30, CX ;main.go:24
. . 10cc899: LEAQ 0xfffffd98(SP), AX
. . 10cc8a1: CMPQ 0x10(CX), AX
. . 10cc8a5: JBE 0x10cd58f
. . 10cc8ab: SUBQ $0x2e8, SP
. . 10cc8b2: MOVQ BP, 0x2e0(SP)
. . 10cc8ba: LEAQ 0x2e0(SP), BP
. . 10cc8c2: MOVQ os.Args+8(SB), CX ;main.go:25
. . 10cc8c9: MOVQ os.Args(SB), DX ;flag.go:996
. . 10cc8d0: MOVQ os.Args+16(SB), BX
. . 10cc8d7: CMPQ $0x1, CX
. . 10cc8db: JB 0x10cd584
. . 10cc8e1: MOVQ flag.CommandLine(SB), AX
. . 10cc8e8: MOVQ AX, 0(SP)
. . 10cc8ec: LEAQ -0x1(BX), AX
. . 10cc8f0: MOVQ AX, BX
. . 10cc8f3: NEGQ AX
. . 10cc8f6: SARQ $0x3f, AX
. . 10cc8fa: ANDQ $0x10, AX
. . 10cc8fe: ADDQ DX, AX
. . 10cc901: MOVQ AX, 0x8(SP)
. . 10cc906: LEAQ -0x1(CX), AX
. . 10cc90a: MOVQ AX, 0x10(SP)
. . 10cc90f: MOVQ BX, 0x18(SP)
. . 10cc914: CALL flag.(*FlagSet).Parse(SB)
. . 10cc919: MOVQ main.cpuprofile(SB), AX ;main.go:27
. . 10cc920: MOVQ 0(AX), CX
. . 10cc923: MOVQ 0x8(AX), AX
. . 10cc927: TESTQ AX, AX
. . 10cc92a: JNE 0x10cd427
. . 10cc930: MOVQ main.traceprofile(SB), AX ;main.go:37
. . 10cc937: MOVQ 0(AX), CX
. . 10cc93a: MOVQ 0x8(AX), AX
. . 10cc93e: TESTQ AX, AX
. . 10cc941: JNE 0x10cd2c5
. . 10cc947: MOVQ main.dump(SB), AX ;main.go:47
. . 10cc94e: MOVQ 0x8(AX), CX
. . 10cc952: MOVQ 0(AX), AX
. . 10cc955: TESTQ CX, CX
. . 10cc958: JNE 0x10cd2b2
. . 10cc95e: XORPS X0, X0 ;main.go:51
. . 10cc961: MOVUPS X0, 0x250(SP)
. . 10cc969: LEAQ runtime.types+88512(SB), AX
. . 10cc970: MOVQ AX, 0x250(SP)
. . 10cc978: LEAQ internal/bytealg.IndexString.args_stackmap+640(SB), CX
. . 10cc97f: MOVQ CX, 0x258(SP)
. . 10cc987: MOVQ os.Stdout(SB), CX ;print.go:274
. . 10cc98e: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10cc995: MOVQ DX, 0(SP)
. . 10cc999: MOVQ CX, 0x8(SP)
. . 10cc99e: LEAQ 0x250(SP), CX
. . 10cc9a6: MOVQ CX, 0x10(SP)
. . 10cc9ab: MOVQ $0x1, 0x18(SP)
. . 10cc9b4: MOVQ $0x1, 0x20(SP)
. . 10cc9bd: CALL fmt.Fprintln(SB)
. . 10cc9c2: MOVQ main.dict(SB), AX ;main.go:52
. . 10cc9c9: MOVQ main.perfStats(SB), CX
. . 10cc9d0: MOVQ main.dump(SB), DX
. . 10cc9d7: MOVQ 0x8(AX), BX
. . 10cc9db: MOVQ 0(AX), AX
. . 10cc9de: MOVZX 0(CX), CX
. . 10cc9e1: MOVQ 0(DX), SI
. . 10cc9e4: MOVQ 0x8(DX), DX
. . 10cc9e8: MOVQ AX, 0(SP)
. . 10cc9ec: MOVQ BX, 0x8(SP)
. . 10cc9f1: MOVB CL, 0x10(SP)
. . 10cc9f5: MOVQ SI, 0x18(SP)
. . 10cc9fa: MOVQ DX, 0x20(SP)
. 822.01MB 10cc9ff: CALL main.LoadDictionary(SB) ;main.main main.go:52
. . 10cca04: MOVQ 0x28(SP), AX ;main.go:52
. . 10cca09: MOVQ AX, 0x1d0(SP)
. . 10cca11: MOVQ 0x8(AX), CX ;graph.go:303
. . 10cca15: MOVQ CX, 0x78(SP)
. . 10cca1a: MOVQ AX, 0(SP) ;main.go:53
. . 10cca1e: CALL main.(*Graph).EdgeCount(SB)
. . 10cca23: MOVQ 0x8(SP), AX
. . 10cca28: MOVQ AX, 0x70(SP)
. . 10cca2d: MOVQ 0x78(SP), CX
. . 10cca32: MOVQ CX, 0(SP)
. . 10cca36: CALL runtime.convT64(SB)
. . 10cca3b: MOVQ 0x8(SP), AX
. . 10cca40: MOVQ AX, 0x1f8(SP)
. . 10cca48: MOVQ 0x70(SP), CX
. . 10cca4d: MOVQ CX, 0(SP)
. . 10cca51: CALL runtime.convT64(SB)
. . 10cca56: MOVQ 0x8(SP), AX
. . 10cca5b: XORPS X0, X0
. . 10cca5e: MOVUPS X0, 0x2c0(SP)
. . 10cca66: MOVUPS X0, 0x2d0(SP)
. . 10cca6e: LEAQ runtime.types+85824(SB), CX
. . 10cca75: MOVQ CX, 0x2c0(SP)
. . 10cca7d: MOVQ 0x1f8(SP), DX
. . 10cca85: MOVQ DX, 0x2c8(SP)
. . 10cca8d: MOVQ CX, 0x2d0(SP)
. . 10cca95: MOVQ AX, 0x2d8(SP)
. . 10cca9d: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10ccaa4: LEAQ go.itab.*os.File,io.Writer(SB), CX
. . 10ccaab: MOVQ CX, 0(SP)
. . 10ccaaf: MOVQ AX, 0x8(SP)
. . 10ccab4: LEAQ go.string.*+10897(SB), AX
. . 10ccabb: MOVQ AX, 0x10(SP)
. . 10ccac0: MOVQ $0x14, 0x18(SP)
. . 10ccac9: LEAQ 0x2c0(SP), AX
. . 10ccad1: MOVQ AX, 0x20(SP)
. . 10ccad6: MOVQ $0x2, 0x28(SP)
. . 10ccadf: MOVQ $0x2, 0x30(SP)
. . 10ccae8: CALL fmt.Fprintf(SB)
. . 10ccaed: MOVQ main.dictStats(SB), AX ;main.go:55
. . 10ccaf4: CMPB $0x0, 0(AX)
. . 10ccaf7: JNE 0x10cd291
. . 10ccafd: MOVQ main.src(SB), AX ;main.go:59
. . 10ccb04: MOVQ 0(AX), CX
. . 10ccb07: MOVQ 0x8(AX), AX
. . 10ccb0b: TESTQ AX, AX
. . 10ccb0e: JE 0x10ccb22
. . 10ccb10: MOVQ main.dest(SB), DX
. . 10ccb17: CMPQ $0x0, 0x8(DX)
. . 10ccb1c: JNE 0x10ccd2e
. . 10ccb22: MOVQ main.printGraph(SB), AX ;main.go:83
. . 10ccb29: CMPB $0x0, 0(AX)
. . 10ccb2c: JNE 0x10ccd18
. . 10ccb32: MOVQ main.memprofile(SB), AX ;main.go:87
. . 10ccb39: CMPQ $0x0, 0x8(AX)
. . 10ccb3e: JNE 0x10ccb56
. . 10ccb40: NOPL ;main.go:98
. . 10ccb41: CALL runtime.deferreturn(SB)
. . 10ccb46: MOVQ 0x2e0(SP), BP
. . 10ccb4e: ADDQ $0x2e8, SP
. . 10ccb55: RET
. . 10ccb56: CALL runtime.GC(SB) ;main.go:88
. . 10ccb5b: MOVQ main.memprofile(SB), AX ;main.go:89
. . 10ccb62: MOVQ 0(AX), CX
. . 10ccb65: MOVQ 0x8(AX), AX
. . 10ccb69: MOVQ CX, 0(SP) ;file.go:289
. . 10ccb6d: MOVQ AX, 0x8(SP)
. . 10ccb72: MOVQ $0x602, 0x10(SP)
. . 10ccb7b: MOVL $0x1b6, 0x18(SP)
. . 10ccb83: CALL os.OpenFile(SB)
. . 10ccb88: MOVQ 0x20(SP), AX
. . 10ccb8d: MOVQ AX, 0x1f0(SP)
. . 10ccb95: MOVQ 0x28(SP), CX
. . 10ccb9a: MOVQ 0x30(SP), DX
. . 10ccb9f: TESTQ CX, CX ;main.go:90
. . 10ccba2: JE 0x10ccc0e
. . 10ccba4: JE 0x10ccbaa ;main.go:91
. . 10ccba6: MOVQ 0x8(CX), CX
. . 10ccbaa: XORPS X0, X0
. . 10ccbad: MOVUPS X0, 0x260(SP)
. . 10ccbb5: MOVUPS X0, 0x270(SP)
. . 10ccbbd: LEAQ runtime.types+88512(SB), AX
. . 10ccbc4: MOVQ AX, 0x260(SP)
. . 10ccbcc: LEAQ internal/bytealg.IndexString.args_stackmap+672(SB), BX
. . 10ccbd3: MOVQ BX, 0x268(SP)
. . 10ccbdb: MOVQ CX, 0x270(SP)
. . 10ccbe3: MOVQ DX, 0x278(SP)
. . 10ccbeb: LEAQ 0x260(SP), CX
. . 10ccbf3: MOVQ CX, 0(SP)
. . 10ccbf7: MOVQ $0x2, 0x8(SP)
. . 10ccc00: MOVQ $0x2, 0x10(SP)
. . 10ccc09: CALL log.Fatal(SB)
. . 10ccc0e: MOVL $0x18, 0xf0(SP) ;main.go:93
. . 10ccc19: LEAQ go.func.*+293(SB), AX
. . 10ccc20: MOVQ AX, 0x108(SP)
. . 10ccc28: MOVQ 0x1f0(SP), AX
. . 10ccc30: MOVQ AX, 0x120(SP)
. . 10ccc38: LEAQ 0xf0(SP), CX
. . 10ccc40: MOVQ CX, 0(SP)
. . 10ccc44: CALL runtime.deferprocStack(SB)
. . 10ccc49: TESTL AX, AX
. . 10ccc4b: JNE 0x10ccd02
. . 10ccc51: NOPL ;pprof.go:522
. . 10ccc52: LEAQ go.itab.*os.File,io.Writer(SB), AX ;pprof.go:533
. . 10ccc59: MOVQ AX, 0(SP)
. . 10ccc5d: MOVQ 0x1f0(SP), AX
. . 10ccc65: MOVQ AX, 0x8(SP)
. . 10ccc6a: MOVQ $0x0, 0x10(SP)
. . 10ccc73: XORPS X0, X0
. . 10ccc76: MOVUPS X0, 0x18(SP)
. . 10ccc7b: CALL runtime/pprof.writeHeapInternal(SB)
. . 10ccc80: MOVQ 0x28(SP), AX
. . 10ccc85: MOVQ 0x30(SP), CX
. . 10ccc8a: TESTQ AX, AX ;main.go:94
. . 10ccc8d: JE 0x10ccb40
. . 10ccc93: JE 0x10ccc99 ;main.go:95
. . 10ccc95: MOVQ 0x8(AX), AX
. . 10ccc99: XORPS X0, X0
. . 10ccc9c: MOVUPS X0, 0x260(SP)
. . 10ccca4: MOVUPS X0, 0x270(SP)
. . 10cccac: LEAQ runtime.types+88512(SB), DX
. . 10cccb3: MOVQ DX, 0x260(SP)
. . 10cccbb: LEAQ internal/bytealg.IndexString.args_stackmap+688(SB), DX
. . 10cccc2: MOVQ DX, 0x268(SP)
. . 10cccca: MOVQ AX, 0x270(SP)
. . 10cccd2: MOVQ CX, 0x278(SP)
. . 10cccda: LEAQ 0x260(SP), AX
. . 10ccce2: MOVQ AX, 0(SP)
. . 10ccce6: MOVQ $0x2, 0x8(SP)
. . 10cccef: MOVQ $0x2, 0x10(SP)
. . 10cccf8: CALL log.Fatal(SB)
. . 10cccfd: JMP 0x10ccb40
. . 10ccd02: NOPL ;main.go:93
. . 10ccd03: CALL runtime.deferreturn(SB)
. . 10ccd08: MOVQ 0x2e0(SP), BP
. . 10ccd10: ADDQ $0x2e8, SP
. . 10ccd17: RET
. . 10ccd18: MOVQ 0x1d0(SP), AX ;main.go:84
. . 10ccd20: MOVQ AX, 0(SP)
. . 10ccd24: CALL main.(*Graph).PrintAdjList(SB)
. . 10ccd29: JMP 0x10ccb32
. . 10ccd2e: MOVQ CX, 0(SP) ;main.go:60
. . 10ccd32: MOVQ AX, 0x8(SP)
. . 10ccd37: CALL runtime.convTstring(SB)
. . 10ccd3c: MOVQ main.dest(SB), AX
. . 10ccd43: MOVQ 0x10(SP), CX
. . 10ccd48: MOVQ CX, 0x1f8(SP)
. . 10ccd50: MOVQ 0(AX), DX
. . 10ccd53: MOVQ 0x8(AX), AX
. . 10ccd57: MOVQ DX, 0(SP)
. . 10ccd5b: MOVQ AX, 0x8(SP)
. . 10ccd60: CALL runtime.convTstring(SB)
. . 10ccd65: MOVQ 0x10(SP), AX
. . 10ccd6a: XORPS X0, X0
. . 10ccd6d: MOVUPS X0, 0x2a0(SP)
. . 10ccd75: MOVUPS X0, 0x2b0(SP)
. . 10ccd7d: LEAQ runtime.types+88512(SB), CX
. . 10ccd84: MOVQ CX, 0x2a0(SP)
. . 10ccd8c: MOVQ 0x1f8(SP), DX
. . 10ccd94: MOVQ DX, 0x2a8(SP)
. . 10ccd9c: MOVQ CX, 0x2b0(SP)
. . 10ccda4: MOVQ AX, 0x2b8(SP)
. . 10ccdac: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10ccdb3: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10ccdba: MOVQ DX, 0(SP)
. . 10ccdbe: MOVQ AX, 0x8(SP)
. . 10ccdc3: LEAQ go.string.*+16166(SB), AX
. . 10ccdca: MOVQ AX, 0x10(SP)
. . 10ccdcf: MOVQ $0x1b, 0x18(SP)
. . 10ccdd8: LEAQ 0x2a0(SP), AX
. . 10ccde0: MOVQ AX, 0x20(SP)
. . 10ccde5: MOVQ $0x2, 0x28(SP)
. . 10ccdee: MOVQ $0x2, 0x30(SP)
. . 10ccdf7: CALL fmt.Fprintf(SB)
. . 10ccdfc: MOVQ main.src(SB), AX ;main.go:61
. . 10cce03: MOVQ 0x8(AX), CX
. . 10cce07: MOVQ 0(AX), AX
. . 10cce0a: MOVQ 0x1d0(SP), DX
. . 10cce12: MOVQ DX, 0(SP)
. . 10cce16: MOVQ AX, 0x8(SP)
. . 10cce1b: MOVQ CX, 0x10(SP)
. . 10cce20: CALL main.(*Graph).Find(SB)
. . 10cce25: MOVQ main.dest(SB), AX ;main.go:62
. . 10cce2c: MOVQ 0x18(SP), CX ;main.go:61
. . 10cce31: MOVQ CX, 0x58(SP)
. . 10cce36: MOVQ 0x8(AX), DX ;main.go:62
. . 10cce3a: MOVQ 0(AX), AX
. . 10cce3d: MOVQ 0x1d0(SP), BX
. . 10cce45: MOVQ BX, 0(SP)
. . 10cce49: MOVQ AX, 0x8(SP)
. . 10cce4e: MOVQ DX, 0x10(SP)
. . 10cce53: CALL main.(*Graph).Find(SB)
. . 10cce58: MOVQ 0x18(SP), AX
. . 10cce5d: MOVQ 0x58(SP), CX ;main.go:64
. . 10cce62: TESTQ CX, CX
. . 10cce65: JL 0x10cd136
. . 10cce6b: TESTQ AX, AX
. . 10cce6e: JL 0x10cd133
. . 10cce74: XORPS X0, X0 ;main.go:74
. . 10cce77: MOVUPS X0, 0x220(SP)
. . 10cce7f: LEAQ runtime.types+88512(SB), AX
. . 10cce86: MOVQ AX, 0x220(SP)
. . 10cce8e: LEAQ internal/bytealg.IndexString.args_stackmap+656(SB), CX
. . 10cce95: MOVQ CX, 0x228(SP)
. . 10cce9d: MOVQ os.Stdout(SB), CX ;print.go:274
. . 10ccea4: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10cceab: MOVQ DX, 0(SP)
. . 10cceaf: MOVQ CX, 0x8(SP)
. . 10cceb4: LEAQ 0x220(SP), CX
. . 10ccebc: MOVQ CX, 0x10(SP)
. . 10ccec1: MOVQ $0x1, 0x18(SP)
. . 10cceca: MOVQ $0x1, 0x20(SP)
. . 10cced3: CALL fmt.Fprintln(SB)
. . 10cced8: MOVQ 0x1d0(SP), AX ;main.go:75
. . 10ccee0: MOVQ AX, 0(SP)
. . 10ccee4: MOVQ 0x58(SP), CX
. . 10ccee9: MOVQ CX, 0x8(SP)
. . 10cceee: CALL main.(*Graph).AllPaths(SB)
. . 10ccef3: MOVQ main.dest(SB), AX ;main.go:76
. . 10ccefa: MOVQ 0x10(SP), CX ;main.go:75
. . 10cceff: MOVQ 0x8(AX), DX ;main.go:76
. . 10ccf03: MOVQ 0(AX), AX
. . 10ccf06: MOVQ CX, 0(SP)
. . 10ccf0a: MOVQ AX, 0x8(SP)
. . 10ccf0f: MOVQ DX, 0x10(SP)
. . 10ccf14: CALL main.(*Paths).To(SB)
. . 10ccf19: MOVQ 0x18(SP), AX
. . 10ccf1e: MOVQ AX, 0x1c8(SP)
. . 10ccf26: MOVQ 0x20(SP), CX
. . 10ccf2b: MOVQ CX, 0x60(SP)
. . 10ccf30: TESTQ CX, CX ;main.go:77
. . 10ccf33: JE 0x10cd045
. . 10ccf39: MOVQ 0x1d0(SP), DX ;main.go:80
. . 10ccf41: XORL BX, BX
. . 10ccf43: JMP 0x10cd023
. . 10ccf48: MOVQ BX, 0x78(SP)
. . 10ccf4d: LEAQ 0(SI)(SI*2), AX ;main.go:81
. . 10ccf51: MOVQ 0x10(R8)(AX*8), CX
. . 10ccf56: MOVQ 0(R8)(AX*8), DX
. . 10ccf5a: MOVQ 0x8(R8)(AX*8), AX
. . 10ccf5f: MOVQ $0x0, 0(SP)
. . 10ccf67: MOVQ DX, 0x8(SP)
. . 10ccf6c: MOVQ AX, 0x10(SP)
. . 10ccf71: MOVQ CX, 0x18(SP)
. . 10ccf76: CALL runtime.slicebytetostring(SB)
. . 10ccf7b: MOVQ 0x28(SP), AX
. . 10ccf80: MOVQ 0x20(SP), CX
. . 10ccf85: MOVQ CX, 0(SP)
. . 10ccf89: MOVQ AX, 0x8(SP)
. . 10ccf8e: CALL runtime.convTstring(SB)
. . 10ccf93: MOVQ 0x10(SP), AX
. . 10ccf98: XORPS X0, X0
. . 10ccf9b: MOVUPS X0, 0x210(SP)
. . 10ccfa3: LEAQ runtime.types+88512(SB), CX
. . 10ccfaa: MOVQ CX, 0x210(SP)
. . 10ccfb2: MOVQ AX, 0x218(SP)
. . 10ccfba: MOVQ os.Stdout(SB), AX ;print.go:274
. . 10ccfc1: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10ccfc8: MOVQ DX, 0(SP)
. . 10ccfcc: MOVQ AX, 0x8(SP)
. . 10ccfd1: LEAQ 0x210(SP), AX
. . 10ccfd9: MOVQ AX, 0x10(SP)
. . 10ccfde: MOVQ $0x1, 0x18(SP)
. . 10ccfe7: MOVQ $0x1, 0x20(SP)
. . 10ccff0: CALL fmt.Fprintln(SB)
. . 10ccff5: MOVQ 0x78(SP), AX ;main.go:80
. . 10ccffa: LEAQ 0x1(AX), BX
. . 10ccffe: MOVQ 0x60(SP), AX
. . 10cd003: MOVQ 0x1d0(SP), CX
. . 10cd00b: MOVQ 0x1c8(SP), DX
. . 10cd013: MOVQ DX, AX
. . 10cd016: MOVQ 0x60(SP), CX
. . 10cd01b: MOVQ 0x1d0(SP), DX ;main.go:81
. . 10cd023: CMPQ CX, BX ;main.go:80
. . 10cd026: JGE 0x10ccb32
. . 10cd02c: MOVQ 0(AX)(BX*8), SI
. . 10cd030: MOVQ 0x8(DX), DI ;main.go:81
. . 10cd034: MOVQ 0(DX), R8
. . 10cd037: CMPQ DI, SI
. . 10cd03a: JB 0x10ccf48
. . 10cd040: JMP 0x10cd579
. . 10cd045: MOVQ main.src(SB), AX ;main.go:78
. . 10cd04c: MOVQ 0x8(AX), CX
. . 10cd050: MOVQ 0(AX), AX
. . 10cd053: MOVQ AX, 0(SP)
. . 10cd057: MOVQ CX, 0x8(SP)
. . 10cd05c: CALL runtime.convTstring(SB)
. . 10cd061: MOVQ main.dest(SB), AX
. . 10cd068: MOVQ 0x10(SP), CX
. . 10cd06d: MOVQ CX, 0x1f8(SP)
. . 10cd075: MOVQ 0x8(AX), DX
. . 10cd079: MOVQ 0(AX), AX
. . 10cd07c: MOVQ AX, 0(SP)
. . 10cd080: MOVQ DX, 0x8(SP)
. . 10cd085: CALL runtime.convTstring(SB)
. . 10cd08a: MOVQ 0x10(SP), AX
. . 10cd08f: XORPS X0, X0
. . 10cd092: MOVUPS X0, 0x280(SP)
. . 10cd09a: MOVUPS X0, 0x290(SP)
. . 10cd0a2: LEAQ runtime.types+88512(SB), CX
. . 10cd0a9: MOVQ CX, 0x280(SP)
. . 10cd0b1: MOVQ 0x1f8(SP), DX
. . 10cd0b9: MOVQ DX, 0x288(SP)
. . 10cd0c1: MOVQ CX, 0x290(SP)
. . 10cd0c9: MOVQ AX, 0x298(SP)
. . 10cd0d1: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10cd0d8: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10cd0df: MOVQ DX, 0(SP)
. . 10cd0e3: MOVQ AX, 0x8(SP)
. . 10cd0e8: LEAQ go.string.*+19932(SB), AX
. . 10cd0ef: MOVQ AX, 0x10(SP)
. . 10cd0f4: MOVQ $0x1f, 0x18(SP)
. . 10cd0fd: LEAQ 0x280(SP), AX
. . 10cd105: MOVQ AX, 0x20(SP)
. . 10cd10a: MOVQ $0x2, 0x28(SP)
. . 10cd113: MOVQ $0x2, 0x30(SP)
. . 10cd11c: CALL fmt.Fprintf(SB)
. . 10cd121: MOVQ 0x1c8(SP), AX ;main.go:80
. . 10cd129: MOVQ 0x60(SP), CX
. . 10cd12e: JMP 0x10ccf39
. . 10cd133: TESTQ CX, CX ;main.go:64
. . 10cd136: JL 0x10cd1ef ;main.go:65
. . 10cd13c: TESTQ AX, AX ;main.go:68
. . 10cd13f: JL 0x10cd157
. . 10cd141: NOPL ;main.go:71
. . 10cd142: CALL runtime.deferreturn(SB)
. . 10cd147: MOVQ 0x2e0(SP), BP
. . 10cd14f: ADDQ $0x2e8, SP
. . 10cd156: RET
. . 10cd157: MOVQ main.dest(SB), AX ;main.go:69
. . 10cd15e: MOVQ 0(AX), CX
. . 10cd161: MOVQ 0x8(AX), AX
. . 10cd165: MOVQ CX, 0(SP)
. . 10cd169: MOVQ AX, 0x8(SP)
. . 10cd16e: CALL runtime.convTstring(SB)
. . 10cd173: MOVQ 0x10(SP), AX
. . 10cd178: XORPS X0, X0
. . 10cd17b: MOVUPS X0, 0x230(SP)
. . 10cd183: LEAQ runtime.types+88512(SB), CX
. . 10cd18a: MOVQ CX, 0x230(SP)
. . 10cd192: MOVQ AX, 0x238(SP)
. . 10cd19a: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10cd1a1: LEAQ go.itab.*os.File,io.Writer(SB), CX
. . 10cd1a8: MOVQ CX, 0(SP)
. . 10cd1ac: MOVQ AX, 0x8(SP)
. . 10cd1b1: LEAQ go.string.*+7812(SB), AX
. . 10cd1b8: MOVQ AX, 0x10(SP)
. . 10cd1bd: MOVQ $0x11, 0x18(SP)
. . 10cd1c6: LEAQ 0x230(SP), AX
. . 10cd1ce: MOVQ AX, 0x20(SP)
. . 10cd1d3: MOVQ $0x1, 0x28(SP)
. . 10cd1dc: MOVQ $0x1, 0x30(SP)
. . 10cd1e5: CALL fmt.Fprintf(SB)
. . 10cd1ea: JMP 0x10cd141 ;main.go:71
. . 10cd1ef: MOVQ AX, 0x50(SP) ;main.go:62
. . 10cd1f4: MOVQ main.src(SB), AX ;main.go:66
. . 10cd1fb: MOVQ 0x8(AX), CX
. . 10cd1ff: MOVQ 0(AX), AX
. . 10cd202: MOVQ AX, 0(SP)
. . 10cd206: MOVQ CX, 0x8(SP)
. . 10cd20b: CALL runtime.convTstring(SB)
. . 10cd210: MOVQ 0x10(SP), AX
. . 10cd215: XORPS X0, X0
. . 10cd218: MOVUPS X0, 0x240(SP)
. . 10cd220: LEAQ runtime.types+88512(SB), CX
. . 10cd227: MOVQ CX, 0x240(SP)
. . 10cd22f: MOVQ AX, 0x248(SP)
. . 10cd237: MOVQ os.Stdout(SB), AX ;print.go:213
. . 10cd23e: LEAQ go.itab.*os.File,io.Writer(SB), DX
. . 10cd245: MOVQ DX, 0(SP)
. . 10cd249: MOVQ AX, 0x8(SP)
. . 10cd24e: LEAQ go.string.*+7812(SB), AX
. . 10cd255: MOVQ AX, 0x10(SP)
. . 10cd25a: MOVQ $0x11, 0x18(SP)
. . 10cd263: LEAQ 0x240(SP), BX
. . 10cd26b: MOVQ BX, 0x20(SP)
. . 10cd270: MOVQ $0x1, 0x28(SP)
. . 10cd279: MOVQ $0x1, 0x30(SP)
. . 10cd282: CALL fmt.Fprintf(SB)
. . 10cd287: MOVQ 0x50(SP), AX ;main.go:68
. . 10cd28c: JMP 0x10cd13c
. . 10cd291: MOVQ main.dict(SB), AX ;main.go:56
. . 10cd298: MOVQ 0x8(AX), CX
. . 10cd29c: MOVQ 0(AX), AX
. . 10cd29f: MOVQ AX, 0(SP)
. . 10cd2a3: MOVQ CX, 0x8(SP)
. . 10cd2a8: CALL main.dictionaryStats(SB)
. . 10cd2ad: JMP 0x10ccafd
. . 10cd2b2: MOVQ AX, 0(SP) ;main.go:48
. . 10cd2b6: MOVQ CX, 0x8(SP)
. . 10cd2bb: CALL main.createPathIfNotExists(SB)
. . 10cd2c0: JMP 0x10cc95e
. . 10cd2c5: NOPL ;main.go:38
. . 10cd2c6: MOVQ CX, 0(SP) ;file.go:289
. . 10cd2ca: MOVQ AX, 0x8(SP)
. . 10cd2cf: MOVQ $0x602, 0x10(SP)
. . 10cd2d8: MOVL $0x1b6, 0x18(SP)
. . 10cd2e0: CALL os.OpenFile(SB)
. . 10cd2e5: MOVQ 0x20(SP), AX
. . 10cd2ea: MOVQ AX, 0x1d8(SP)
. . 10cd2f2: MOVQ 0x30(SP), CX
. . 10cd2f7: MOVQ 0x28(SP), DX
. . 10cd2fc: TESTQ DX, DX ;main.go:39
. . 10cd2ff: JE 0x10cd36b
. . 10cd301: JE 0x10cd307 ;main.go:40
. . 10cd303: MOVQ 0x8(DX), DX
. . 10cd307: XORPS X0, X0
. . 10cd30a: MOVUPS X0, 0x260(SP)
. . 10cd312: MOVUPS X0, 0x270(SP)
. . 10cd31a: LEAQ runtime.types+88512(SB), AX
. . 10cd321: MOVQ AX, 0x260(SP)
. . 10cd329: LEAQ internal/bytealg.IndexString.args_stackmap+624(SB), BX
. . 10cd330: MOVQ BX, 0x268(SP)
. . 10cd338: MOVQ DX, 0x270(SP)
. . 10cd340: MOVQ CX, 0x278(SP)
. . 10cd348: LEAQ 0x260(SP), CX
. . 10cd350: MOVQ CX, 0(SP)
. . 10cd354: MOVQ $0x2, 0x8(SP)
. . 10cd35d: MOVQ $0x2, 0x10(SP)
. . 10cd366: CALL log.Fatal(SB)
. . 10cd36b: MOVL $0x18, 0x138(SP) ;main.go:42
. . 10cd376: LEAQ go.func.*+293(SB), AX
. . 10cd37d: MOVQ AX, 0x150(SP)
. . 10cd385: MOVQ 0x1d8(SP), CX
. . 10cd38d: MOVQ CX, 0x168(SP)
. . 10cd395: LEAQ 0x138(SP), DX
. . 10cd39d: MOVQ DX, 0(SP)
. . 10cd3a1: CALL runtime.deferprocStack(SB)
. . 10cd3a6: TESTL AX, AX
. . 10cd3a8: JNE 0x10cd411
. . 10cd3aa: LEAQ go.itab.*os.File,io.Writer(SB), AX ;main.go:43
. . 10cd3b1: MOVQ AX, 0(SP)
. . 10cd3b5: MOVQ 0x1d8(SP), CX
. . 10cd3bd: MOVQ CX, 0x8(SP)
. . 10cd3c2: CALL runtime/trace.Start(SB)
. . 10cd3c7: MOVL $0x0, 0x80(SP) ;main.go:44
. . 10cd3d2: LEAQ go.func.*+1597(SB), AX
. . 10cd3d9: MOVQ AX, 0x98(SP)
. . 10cd3e1: LEAQ 0x80(SP), AX
. . 10cd3e9: MOVQ AX, 0(SP)
. . 10cd3ed: CALL runtime.deferprocStack(SB)
. . 10cd3f2: TESTL AX, AX
. . 10cd3f4: JNE 0x10cd3fb
. . 10cd3f6: JMP 0x10cc947
. . 10cd3fb: NOPL
. . 10cd3fc: CALL runtime.deferreturn(SB)
. . 10cd401: MOVQ 0x2e0(SP), BP
. . 10cd409: ADDQ $0x2e8, SP
. . 10cd410: RET
. . 10cd411: NOPL ;main.go:42
. . 10cd412: CALL runtime.deferreturn(SB)
. . 10cd417: MOVQ 0x2e0(SP), BP
. . 10cd41f: ADDQ $0x2e8, SP
. . 10cd426: RET
. . 10cd427: NOPL ;main.go:28
. . 10cd428: MOVQ CX, 0(SP) ;file.go:289
. . 10cd42c: MOVQ AX, 0x8(SP)
. . 10cd431: MOVQ $0x602, 0x10(SP)
. . 10cd43a: MOVL $0x1b6, 0x18(SP)
. . 10cd442: CALL os.OpenFile(SB)
. . 10cd447: MOVQ 0x20(SP), AX
. . 10cd44c: MOVQ AX, 0x1e0(SP)
. . 10cd454: MOVQ 0x28(SP), CX
. . 10cd459: MOVQ CX, 0x68(SP)
. . 10cd45e: MOVQ 0x30(SP), DX
. . 10cd463: MOVQ DX, 0x1e8(SP)
. . 10cd46b: MOVL $0x18, 0x180(SP) ;main.go:29
. . 10cd476: LEAQ go.func.*+293(SB), BX
. . 10cd47d: MOVQ BX, 0x198(SP)
. . 10cd485: MOVQ AX, 0x1b0(SP)
. . 10cd48d: LEAQ 0x180(SP), SI
. . 10cd495: MOVQ SI, 0(SP)
. . 10cd499: CALL runtime.deferprocStack(SB)
. . 10cd49e: TESTL AX, AX
. . 10cd4a0: JNE 0x10cd563
. . 10cd4a6: MOVQ 0x68(SP), AX ;main.go:30
. . 10cd4ab: TESTQ AX, AX
. . 10cd4ae: JE 0x10cd4fc
. . 10cd4b0: JE 0x10cd4b6 ;main.go:31
. . 10cd4b2: MOVQ 0x8(AX), AX
. . 10cd4b6: XORPS X0, X0
. . 10cd4b9: MOVUPS X0, 0x200(SP)
. . 10cd4c1: MOVQ AX, 0x200(SP)
. . 10cd4c9: MOVQ 0x1e8(SP), AX
. . 10cd4d1: MOVQ AX, 0x208(SP)
. . 10cd4d9: LEAQ 0x200(SP), AX
. . 10cd4e1: MOVQ AX, 0(SP)
. . 10cd4e5: MOVQ $0x1, 0x8(SP)
. . 10cd4ee: MOVQ $0x1, 0x10(SP)
. . 10cd4f7: CALL log.Fatal(SB)
. . 10cd4fc: LEAQ go.itab.*os.File,io.Writer(SB), AX ;main.go:33
. . 10cd503: MOVQ AX, 0(SP)
. . 10cd507: MOVQ 0x1e0(SP), CX
. . 10cd50f: MOVQ CX, 0x8(SP)
. . 10cd514: CALL runtime/pprof.StartCPUProfile(SB)
. . 10cd519: MOVL $0x0, 0xb8(SP) ;main.go:34
. . 10cd524: LEAQ go.func.*+1565(SB), AX
. . 10cd52b: MOVQ AX, 0xd0(SP)
. . 10cd533: LEAQ 0xb8(SP), AX
. . 10cd53b: MOVQ AX, 0(SP)
. . 10cd53f: CALL runtime.deferprocStack(SB)
. . 10cd544: TESTL AX, AX
. . 10cd546: JNE 0x10cd54d
. . 10cd548: JMP 0x10cc930
. . 10cd54d: NOPL
. . 10cd54e: CALL runtime.deferreturn(SB)
. . 10cd553: MOVQ 0x2e0(SP), BP
. . 10cd55b: ADDQ $0x2e8, SP
. . 10cd562: RET
. . 10cd563: NOPL ;main.go:29
. . 10cd564: CALL runtime.deferreturn(SB)
. . 10cd569: MOVQ 0x2e0(SP), BP
. . 10cd571: ADDQ $0x2e8, SP
. . 10cd578: RET
. . 10cd579: MOVQ SI, AX ;main.go:81
. . 10cd57c: MOVQ DI, CX
. . 10cd57f: CALL runtime.panicIndex(SB)
. . 10cd584: MOVL $0x1, AX ;flag.go:996
. . 10cd589: CALL runtime.panicSliceB(SB)
. . 10cd58e: NOPL
. . 10cd58f: CALL runtime.morestack_noctxt(SB) ;main.go:24
. . 10cd594: JMP main.main(SB)
. . 10cd599: INT $0x3
. . 10cd59a: INT $0x3
. . 10cd59b: INT $0x3
. . 10cd59c: INT $0x3
. . 10cd59d: INT $0x3
. . 10cd59e: INT $0x3
ROUTINE ======================== main.newIndex
192MB 192MB (flat, cum) 23.33% of Total
. . 10cbba0: MOVQ GS:0x30, CX ;index.go:16
. . 10cbba9: CMPQ 0x10(CX), SP
. . 10cbbad: JBE 0x10cbdae
. . 10cbbb3: SUBQ $0x48, SP
. . 10cbbb7: MOVQ BP, 0x40(SP)
. . 10cbbbc: LEAQ 0x40(SP), BP
. . 10cbbc1: LEAQ runtime.types+77184(SB), AX ;index.go:17
. . 10cbbc8: MOVQ AX, 0(SP)
. . 10cbbcc: MOVQ 0x50(SP), AX
. . 10cbbd1: MOVQ AX, 0x8(SP)
. . 10cbbd6: MOVQ AX, 0x10(SP)
192MB 192MB 10cbbdb: CALL runtime.makeslice(SB) ;main.newIndex index.go:17
. . 10cbbe0: MOVQ 0x18(SP), AX ;index.go:17
. . 10cbbe5: MOVQ AX, 0x38(SP)
. . 10cbbea: XORL CX, CX
. . 10cbbec: JMP 0x10cbbf5 ;index.go:18
. . 10cbbee: LEAQ 0x1(AX), CX
. . 10cbbf2: MOVQ BX, AX ;index.go:19
. . 10cbbf5: MOVQ 0x50(SP), DX ;index.go:18
. . 10cbbfa: CMPQ DX, CX
. . 10cbbfd: JGE 0x10cbc64
. . 10cbbff: MOVQ CX, 0x20(SP)
. . 10cbc04: LEAQ runtime.types+85824(SB), AX ;index.go:19
. . 10cbc0b: MOVQ AX, 0(SP)
. . 10cbc0f: XORPS X0, X0
. . 10cbc12: MOVUPS X0, 0x8(SP)
. . 10cbc17: CALL runtime.makeslice(SB)
. . 10cbc1c: MOVQ 0x20(SP), AX
. . 10cbc21: LEAQ 0(AX)(AX*2), CX
. . 10cbc25: MOVQ 0x18(SP), DX
. . 10cbc2a: MOVQ 0x38(SP), BX
. . 10cbc2f: MOVQ $0x0, 0x8(BX)(CX*8)
. . 10cbc38: MOVQ $0x0, 0x10(BX)(CX*8)
. . 10cbc41: LEAQ 0(BX)(CX*8), DI
. . 10cbc45: CMPL $0x0, runtime.writeBarrier(SB)
. . 10cbc4c: JNE 0x10cbc54
. . 10cbc4e: MOVQ DX, 0(BX)(CX*8)
. . 10cbc52: JMP 0x10cbbee
. . 10cbc54: MOVQ AX, CX ;index.go:18
. . 10cbc57: MOVQ DX, AX ;index.go:19
. . 10cbc5a: CALL runtime.gcWriteBarrier(SB)
. . 10cbc5f: MOVQ CX, AX ;index.go:18
. . 10cbc62: JMP 0x10cbbee ;index.go:19
. . 10cbc64: NOPL ;murmur64.go:18
. . 10cbc65: MOVL $0x0, 0(SP) ;murmur64.go:22
. . 10cbc6c: CALL erichgess/wordladder/vendor/github.com/spaolacci/murmur3.New128WithSeed(SB)
. . 10cbc71: MOVQ 0x10(SP), AX
. . 10cbc76: MOVQ 0x8(SP), CX
. . 10cbc7b: LEAQ go.itab.*erichgess/wordladder/vendor/github.com/spaolacci/murmur3.digest128,erichgess/wordladder/vendor/github.com/spaolacci/murmur3.Hash128(SB), DX
. . 10cbc82: CMPQ DX, CX
. . 10cbc85: JNE 0x10cbd8c
. . 10cbc8b: MOVQ AX, 0x28(SP)
. . 10cbc90: LEAQ runtime.types+88832(SB), AX ;index.go:23
. . 10cbc97: MOVQ AX, 0(SP)
. . 10cbc9b: MOVQ $0x0, 0x8(SP)
. . 10cbca4: MOVQ 0x58(SP), AX
. . 10cbca9: MOVQ AX, 0x10(SP)
. . 10cbcae: CALL runtime.makeslice(SB)
. . 10cbcb3: MOVQ 0x18(SP), AX
. . 10cbcb8: MOVQ AX, 0x30(SP)
. . 10cbcbd: LEAQ runtime.types+195232(SB), CX ;index.go:25
. . 10cbcc4: MOVQ CX, 0(SP)
. . 10cbcc8: CALL runtime.newobject(SB)
. . 10cbccd: MOVQ 0x8(SP), AX
;index.go:22
. . 10cbcd2: LEAQ go.itab.*erichgess/wordladder/vendor/github.com/spaolacci/murmur3.digest64,hash.Hash64(SB), CX
. . 10cbcd9: MOVQ CX, 0(AX)
. . 10cbcdc: CMPL $0x0, runtime.writeBarrier(SB)
. . 10cbce3: JNE 0x10cbd73
. . 10cbce9: MOVQ 0x28(SP), CX
. . 10cbcee: MOVQ CX, 0x8(AX)
. . 10cbcf2: MOVQ $0x0, 0x30(AX) ;index.go:23
. . 10cbcfa: MOVQ 0x58(SP), CX
. . 10cbcff: MOVQ CX, 0x38(AX)
. . 10cbd03: CMPL $0x0, runtime.writeBarrier(SB)
. . 10cbd0a: JNE 0x10cbd5d
. . 10cbd0c: MOVQ 0x30(SP), CX
. . 10cbd11: MOVQ CX, 0x28(AX)
. . 10cbd15: MOVQ 0x50(SP), CX ;index.go:24
. . 10cbd1a: MOVQ CX, 0x18(AX)
. . 10cbd1e: MOVQ CX, 0x20(AX)
. . 10cbd22: CMPL $0x0, runtime.writeBarrier(SB)
. . 10cbd29: JNE 0x10cbd47
. . 10cbd2b: MOVQ 0x38(SP), DX
. . 10cbd30: MOVQ DX, 0x10(AX)
. . 10cbd34: MOVQ CX, 0x40(AX) ;index.go:25
. . 10cbd38: MOVQ AX, 0x60(SP) ;index.go:21
. . 10cbd3d: MOVQ 0x40(SP), BP
. . 10cbd42: ADDQ $0x48, SP
. . 10cbd46: RET
. . 10cbd47: LEAQ 0x10(AX), DI ;index.go:24
. . 10cbd4b: MOVQ AX, DX ;index.go:25
. . 10cbd4e: MOVQ 0x38(SP), AX ;index.go:24
. . 10cbd53: CALL runtime.gcWriteBarrier(SB)
. . 10cbd58: MOVQ DX, AX ;index.go:25
. . 10cbd5b: JMP 0x10cbd34 ;index.go:24
. . 10cbd5d: LEAQ 0x28(AX), DI ;index.go:23
. . 10cbd61: MOVQ AX, CX ;index.go:25
. . 10cbd64: MOVQ 0x30(SP), AX ;index.go:23
. . 10cbd69: CALL runtime.gcWriteBarrier(SB)
. . 10cbd6e: MOVQ CX, AX ;index.go:24
. . 10cbd71: JMP 0x10cbd15 ;index.go:23
. . 10cbd73: LEAQ 0x8(AX), DI ;index.go:22
. . 10cbd77: MOVQ AX, CX ;index.go:25
. . 10cbd7a: MOVQ 0x28(SP), AX ;index.go:22
. . 10cbd7f: CALL runtime.gcWriteBarrier(SB)
. . 10cbd84: MOVQ CX, AX ;index.go:23
. . 10cbd87: JMP 0x10cbcf2 ;index.go:22
. . 10cbd8c: MOVQ CX, 0(SP) ;murmur64.go:22
. . 10cbd90: LEAQ runtime.types+200128(SB), AX
. . 10cbd97: MOVQ AX, 0x8(SP)
. . 10cbd9c: LEAQ runtime.types+156224(SB), AX
. . 10cbda3: MOVQ AX, 0x10(SP)
. . 10cbda8: CALL runtime.panicdottypeI(SB)
. . 10cbdad: NOPL
. . 10cbdae: CALL runtime.morestack_noctxt(SB) ;index.go:16
. . 10cbdb3: JMP main.newIndex(SB)
. . 10cbdb8: INT $0x3
. . 10cbdb9: INT $0x3
. . 10cbdba: INT $0x3
. . 10cbdbb: INT $0x3
. . 10cbdbc: INT $0x3
. . 10cbdbd: INT $0x3
. . 10cbdbe: INT $0x3
ROUTINE ======================== runtime.main
0 822.01MB (flat, cum) 99.88% of Total
. . 102caf0: MOVQ GS:0x30, CX ;proc.go:113
. . 102caf9: CMPQ 0x10(CX), SP
. . 102cafd: JBE 0x102ce70
. . 102cb03: SUBQ $0x78, SP
. . 102cb07: MOVQ BP, 0x70(SP)
. . 102cb0c: LEAQ 0x70(SP), BP
. . 102cb11: MOVQ GS:0x30, AX ;proc.go:114
. . 102cb1a: MOVQ AX, 0x68(SP)
. . 102cb1f: MOVQ 0x30(AX), CX ;proc.go:118
. . 102cb23: MOVQ 0(CX), CX
. . 102cb26: MOVQ $0x0, 0x130(CX)
;proc.go:124
. . 102cb31: MOVQ $0x3b9aca00, runtime.maxstacksize(SB)
. . 102cb3c: MOVB $0x1, runtime.mainStarted(SB) ;proc.go:130
. . 102cb43: LEAQ go.func.*+949(SB), CX ;proc.go:133
. . 102cb4a: MOVQ CX, 0(SP)
. . 102cb4e: CALL runtime.systemstack(SB)
. . 102cb53: MOVQ GS:0x30, AX ;proc.go:3550
. . 102cb5c: MOVQ 0x30(AX), AX
. . 102cb60: NOPL ;proc.go:144
. . 102cb61: INCL 0x274(AX) ;proc.go:3550
. . 102cb67: MOVQ GS:0x30, AX ;proc.go:3511
. . 102cb70: MOVQ 0x30(AX), CX ;proc.go:3512
. . 102cb74: NOPL ;proc.go:3551
. . 102cb75: MOVQ AX, DX ;runtime2.go:254
. . 102cb78: MOVQ AX, 0x168(CX)
. . 102cb7f: MOVQ 0x30(DX), AX ;proc.go:3513
. . 102cb83: MOVQ AX, 0xd8(DX) ;runtime2.go:292
. . 102cb8a: MOVQ 0x68(SP), AX ;proc.go:146
. . 102cb8f: MOVQ 0x30(AX), AX
. . 102cb93: LEAQ runtime.m0(SB), CX
. . 102cb9a: CMPQ CX, AX
. . 102cb9d: JNE 0x102ce56
. . 102cba3: LEAQ runtime..inittask(SB), AX ;proc.go:150
. . 102cbaa: MOVQ AX, 0(SP)
. . 102cbae: CALL runtime.doInit(SB)
. . 102cbb3: CALL runtime.nanotime(SB) ;proc.go:151
. . 102cbb8: CMPQ $0x0, 0(SP)
. . 102cbbd: JE 0x102ce3d
. . 102cbc3: MOVB $0x1, 0x27(SP) ;proc.go:156
. . 102cbc8: MOVL $0x8, 0x30(SP) ;proc.go:157
. . 102cbd0: LEAQ go.func.*+957(SB), AX
. . 102cbd7: MOVQ AX, 0x48(SP)
. . 102cbdc: LEAQ 0x27(SP), AX
. . 102cbe1: MOVQ AX, 0x60(SP)
. . 102cbe6: LEAQ 0x30(SP), AX
. . 102cbeb: MOVQ AX, 0(SP)
. . 102cbef: CALL runtime.deferprocStack(SB)
. . 102cbf4: TESTL AX, AX
. . 102cbf6: JNE 0x102cdc9
. . 102cbfc: CALL runtime.nanotime(SB) ;proc.go:164
. . 102cc01: MOVQ 0(SP), AX
. . 102cc05: MOVQ AX, runtime.runtimeInitTime(SB)
. . 102cc0c: CALL runtime.gcenable(SB) ;proc.go:166
. . 102cc11: LEAQ runtime.types+83072(SB), AX ;proc.go:168
. . 102cc18: MOVQ AX, 0(SP)
. . 102cc1c: MOVQ $0x0, 0x8(SP)
. . 102cc25: CALL runtime.makechan(SB)
. . 102cc2a: MOVQ 0x10(SP), AX
. . 102cc2f: CMPL $0x0, runtime.writeBarrier(SB)
. . 102cc36: JNE 0x102cdb8
. . 102cc3c: MOVQ AX, runtime.main_init_done(SB)
. . 102cc43: CMPB $0x0, runtime.iscgo(SB) ;proc.go:169
. . 102cc4a: JE 0x102ccba
. . 102cc4c: CMPQ $0x0, __cgo_thread_start(SB) ;proc.go:170
. . 102cc54: JE 0x102ce24
. . 102cc5a: CMPQ $0x0, runtime._cgo_setenv(SB) ;proc.go:174
. . 102cc62: JE 0x102ce0b
. . 102cc68: CMPQ $0x0, runtime._cgo_unsetenv(SB) ;proc.go:177
. . 102cc70: JE 0x102cdf2
;proc.go:181
. . 102cc76: CMPQ $0x0, __cgo_notify_runtime_init_done(SB)
. . 102cc7e: JE 0x102cdd9
. . 102cc84: XORL AX, AX ;proc.go:1865
. . 102cc86: LEAQ runtime.newmHandoff+32(SB), CX
. . 102cc8d: MOVL $0x1, DX
. . 102cc92: LOCK CMPXCHGL DX, 0(CX)
. . 102cc96: SETE CL
. . 102cc99: TESTL CL, CL
. . 102cc9b: JNE 0x102cd9a
;proc.go:187
. . 102cca1: MOVQ __cgo_notify_runtime_init_done(SB), AX
. . 102cca8: MOVQ AX, 0(SP)
. . 102ccac: MOVQ $0x0, 0x8(SP)
. . 102ccb5: CALL runtime.cgocall(SB)
. . 102ccba: LEAQ main..inittask(SB), AX ;proc.go:190
. . 102ccc1: MOVQ AX, 0(SP)
. . 102ccc5: CALL runtime.doInit(SB)
. . 102ccca: MOVQ runtime.main_init_done(SB), AX ;proc.go:192
. . 102ccd1: MOVQ AX, 0(SP)
. . 102ccd5: CALL runtime.closechan(SB)
. . 102ccda: MOVB $0x0, 0x27(SP) ;proc.go:194
. . 102ccdf: CALL runtime.unlockOSThread(SB) ;proc.go:195
. . 102cce4: CMPB $0x0, runtime.isarchive(SB) ;proc.go:197
. . 102cceb: JNE 0x102cd8a
. . 102ccf1: CMPB $0x0, runtime.islibrary(SB)
. . 102ccf8: JNE 0x102cd8a
. . 102ccfe: MOVQ go.func.*+965(SB), AX ;proc.go:203
. . 102cd05: LEAQ go.func.*+965(SB), DX
. 822.01MB 102cd0c: CALL AX ;runtime.main proc.go:203
. . 102cd0e: MOVL runtime.runningPanicDefers(SB), AX ;proc.go:212
. . 102cd14: TESTL AX, AX
. . 102cd16: JE 0x102cd4c
. . 102cd18: XORL AX, AX
. . 102cd1a: JMP 0x102cd3a ;proc.go:214
. . 102cd1c: MOVQ AX, 0x28(SP)
. . 102cd21: NOPL ;proc.go:218
. . 102cd22: LEAQ go.func.*+893(SB), AX ;proc.go:269
. . 102cd29: MOVQ AX, 0(SP)
. . 102cd2d: CALL runtime.mcall(SB)
. . 102cd32: MOVQ 0x28(SP), AX ;proc.go:214
. . 102cd37: INCQ AX
. . 102cd3a: CMPQ $0x3e8, AX
. . 102cd40: JGE 0x102cd4c
. . 102cd42: MOVL runtime.runningPanicDefers(SB), CX ;proc.go:215
. . 102cd48: TESTL CX, CX
. . 102cd4a: JNE 0x102cd1c
. . 102cd4c: MOVL runtime.panicking(SB), AX ;proc.go:221
. . 102cd52: TESTL AX, AX
. . 102cd54: JNE 0x102cd6c
. . 102cd56: MOVL $0x0, 0(SP) ;proc.go:225
. . 102cd5d: CALL runtime.exit(SB)
. . 102cd62: XORL AX, AX ;proc.go:228
. . 102cd64: MOVL $0x0, 0(AX)
. . 102cd6a: JMP 0x102cd62
. . 102cd6c: XORPS X0, X0 ;proc.go:222
. . 102cd6f: MOVUPS X0, 0(SP)
. . 102cd73: MOVW $0x1008, 0x10(SP)
. . 102cd7a: MOVQ $0x1, 0x18(SP)
. . 102cd83: CALL runtime.gopark(SB)
. . 102cd88: JMP 0x102cd56
. . 102cd8a: NOPL ;proc.go:200
. . 102cd8b: CALL runtime.deferreturn(SB)
. . 102cd90: MOVQ 0x70(SP), BP
. . 102cd95: ADDQ $0x78, SP
. . 102cd99: RET
. . 102cd9a: LEAQ go.func.*+1509(SB), AX ;proc.go:1868
. . 102cda1: MOVQ AX, 0(SP)
. . 102cda5: MOVQ $0x0, 0x8(SP)
. . 102cdae: CALL runtime.newm(SB)
. . 102cdb3: JMP 0x102cca1 ;proc.go:186
. . 102cdb8: LEAQ runtime.main_init_done(SB), DI ;proc.go:168
. . 102cdbf: CALL runtime.gcWriteBarrier(SB)
. . 102cdc4: JMP 0x102cc43
. . 102cdc9: NOPL ;proc.go:157
. . 102cdca: CALL runtime.deferreturn(SB)
. . 102cdcf: MOVQ 0x70(SP), BP
. . 102cdd4: ADDQ $0x78, SP
. . 102cdd8: RET
. . 102cdd9: LEAQ go.string.*+25131(SB), AX ;proc.go:182
. . 102cde0: MOVQ AX, 0(SP)
. . 102cde4: MOVQ $0x25, 0x8(SP)
. . 102cded: CALL runtime.throw(SB)
. . 102cdf2: LEAQ go.string.*+11787(SB), AX ;proc.go:178
. . 102cdf9: MOVQ AX, 0(SP)
. . 102cdfd: MOVQ $0x15, 0x8(SP)
. . 102ce06: CALL runtime.throw(SB)
. . 102ce0b: LEAQ go.string.*+9742(SB), AX ;proc.go:175
. . 102ce12: MOVQ AX, 0(SP)
. . 102ce16: MOVQ $0x13, 0x8(SP)
. . 102ce1f: CALL runtime.throw(SB)
. . 102ce24: LEAQ go.string.*+14919(SB), AX ;proc.go:171
. . 102ce2b: MOVQ AX, 0(SP)
. . 102ce2f: MOVQ $0x19, 0x8(SP)
. . 102ce38: CALL runtime.throw(SB)
. . 102ce3d: LEAQ go.string.*+13763(SB), AX ;proc.go:152
. . 102ce44: MOVQ AX, 0(SP)
. . 102ce48: MOVQ $0x17, 0x8(SP)
. . 102ce51: CALL runtime.throw(SB)
. . 102ce56: LEAQ go.string.*+12882(SB), AX ;proc.go:147
. . 102ce5d: MOVQ AX, 0(SP)
. . 102ce61: MOVQ $0x16, 0x8(SP)
. . 102ce6a: CALL runtime.throw(SB)
. . 102ce6f: NOPL
. . 102ce70: CALL runtime.morestack_noctxt(SB) ;proc.go:113
. . 102ce75: JMP runtime.main(SB)
. . 102ce7a: INT $0x3
. . 102ce7b: INT $0x3
. . 102ce7c: INT $0x3
. . 102ce7d: INT $0x3
. . 102ce7e: INT $0x3
|
#include "editaddressdialog.h"
#include "ui_editaddressdialog.h"
#include "addresstablemodel.h"
#include "guiutil.h"
#include <QDataWidgetMapper>
#include <QMessageBox>
EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
QDialog(parent),
ui(new Ui::EditAddressDialog), mapper(0), mode(mode), model(0)
{
ui->setupUi(this);
GUIUtil::setupAddressWidget(ui->addressEdit, this);
switch(mode)
{
case NewReceivingAddress:
setWindowTitle(tr("New receiving address"));
ui->addressEdit->setEnabled(false);
ui->addressEdit->setVisible(false);
ui->stealthCB->setEnabled(true);
ui->stealthCB->setVisible(true);
break;
case NewSendingAddress:
setWindowTitle(tr("New sending address"));
ui->stealthCB->setVisible(false);
break;
case EditReceivingAddress:
setWindowTitle(tr("Edit receiving address"));
ui->addressEdit->setEnabled(false);
ui->addressEdit->setVisible(true);
ui->stealthCB->setEnabled(false);
ui->stealthCB->setVisible(true);
break;
case EditSendingAddress:
setWindowTitle(tr("Edit sending address"));
ui->stealthCB->setVisible(false);
break;
}
mapper = new QDataWidgetMapper(this);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
}
EditAddressDialog::~EditAddressDialog()
{
delete ui;
}
void EditAddressDialog::setModel(AddressTableModel *model)
{
this->model = model;
if(!model)
return;
mapper->setModel(model);
mapper->addMapping(ui->labelEdit, AddressTableModel::Label);
mapper->addMapping(ui->addressEdit, AddressTableModel::Address);
mapper->addMapping(ui->stealthCB, AddressTableModel::Type);
}
void EditAddressDialog::loadRow(int row)
{
mapper->setCurrentIndex(row);
}
bool EditAddressDialog::saveCurrentRow()
{
if(!model)
return false;
switch(mode)
{
case NewReceivingAddress:
case NewSendingAddress:
{
int typeInd = ui->stealthCB->isChecked() ? AddressTableModel::AT_Stealth : AddressTableModel::AT_Normal;
address = model->addRow(
mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,
ui->labelEdit->text(),
ui->addressEdit->text(),
typeInd);
}
break;
case EditReceivingAddress:
case EditSendingAddress:
if(mapper->submit())
{
address = ui->addressEdit->text();
}
break;
}
return !address.isEmpty();
}
void EditAddressDialog::accept()
{
if(!model)
return;
if(!saveCurrentRow())
{
switch(model->getEditStatus())
{
case AddressTableModel::OK:
// Failed with unknown reason. Just reject.
break;
case AddressTableModel::NO_CHANGES:
// No changes were made during edit operation. Just reject.
break;
case AddressTableModel::INVALID_ADDRESS:
QMessageBox::warning(this, windowTitle(),
tr("The entered address \"%1\" is not a valid ion address.").arg(ui->addressEdit->text()),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::DUPLICATE_ADDRESS:
QMessageBox::warning(this, windowTitle(),
tr("The entered address \"%1\" is already in the address book.").arg(ui->addressEdit->text()),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::WALLET_UNLOCK_FAILURE:
QMessageBox::critical(this, windowTitle(),
tr("Could not unlock wallet."),
QMessageBox::Ok, QMessageBox::Ok);
break;
case AddressTableModel::KEY_GENERATION_FAILURE:
QMessageBox::critical(this, windowTitle(),
tr("New key generation failed."),
QMessageBox::Ok, QMessageBox::Ok);
break;
}
return;
}
QDialog::accept();
}
QString EditAddressDialog::getAddress() const
{
return address;
}
void EditAddressDialog::setAddress(const QString &address)
{
this->address = address;
ui->addressEdit->setText(address);
}
|
<%
from pwnlib.shellcraft.thumb.linux import syscall
%>
<%page args="fd, owner, group"/>
<%docstring>
Invokes the syscall fchown. See 'man 2 fchown' for more information.
Arguments:
fd(int): fd
owner(uid_t): owner
group(gid_t): group
</%docstring>
${syscall('SYS_fchown', fd, owner, group)}
|
#ifndef _DREAM_EQUATIONS_RUNAWAY_SOURCE_TERM_HANDLER_HPP
#define _DREAM_EQUATIONS_RUNAWAY_SOURCE_TERM_HANDLER_HPP
#include <string>
#include "DREAM/Equations/Fluid/AvalancheGrowthTerm.hpp"
#include "DREAM/Equations/Fluid/ComptonRateTerm.hpp"
#include "DREAM/Equations/Fluid/DreicerRateTerm.hpp"
#include "DREAM/Equations/Fluid/ExternalAvalancheTerm.hpp"
#include "DREAM/Equations/Fluid/HottailRateTerm.hpp"
#include "DREAM/Equations/Fluid/TritiumRateTerm.hpp"
#include "DREAM/Equations/Kinetic/AvalancheSourceRP.hpp"
#include "FVM/Equation/EquationTerm.hpp"
#include "FVM/Equation/Operator.hpp"
#include "FVM/Grid/Grid.hpp"
#include "FVM/Matrix.hpp"
namespace DREAM {
class RunawaySourceTermHandler {
protected:
FVM::EquationTerm *avalanche=nullptr; // Avalanche source applied to n_re
FVM::EquationTerm *avalanche_neg=nullptr; // Avalanche source applied to n_re_neg (same p|| direction as, but subtracted from, n_re)
FVM::EquationTerm *avalanche_negpos=nullptr;// Avalanche source applied to n_re_neg (oppositive p|| direction as n_re; positive contribution to RE generation)
ComptonRateTerm *compton=nullptr;
DreicerRateTerm *dreicer=nullptr;
HottailRateTerm *hottail=nullptr;
// There can be multiple tritium species in the simulation...
std::vector<TritiumRateTerm*> tritium;
// Description of equation
std::string description;
void applyToAll(std::function<void(FVM::EquationTerm*)>);
void applyToAll(const std::function<void(FVM::EquationTerm*)>) const;
public:
RunawaySourceTermHandler();
~RunawaySourceTermHandler();
void AddSourceTerm(const std::string& desc, AvalancheGrowthTerm *t) { this->description += desc; this->avalanche = t; }
void AddSourceTerm(const std::string& desc, AvalancheSourceRP *t) { this->description += desc; this->avalanche = t; }
void AddAvalancheNreNeg(AvalancheSourceRP *t) { this->avalanche_neg = t; }
void AddAvalancheNreNegPos(AvalancheSourceRP *t) { this->avalanche_negpos = t; }
void AddSourceTerm(const std::string& desc, ExternalAvalancheTerm *t) { this->description += desc; this->avalanche = t; }
void AddSourceTerm(const std::string& desc, ComptonRateTerm *t) { this->description += desc; this->compton = t; }
void AddSourceTerm(const std::string& desc, DreicerRateTerm *t) { this->description += desc; this->dreicer = t; }
void AddSourceTerm(const std::string& desc, HottailRateTerm *t) { this->description += desc; this->hottail = t; }
void AddSourceTerm(const std::string& desc, TritiumRateTerm *t) {
if (this->tritium.empty())
this->description += desc;
this->tritium.push_back(t);
}
void AddToOperators(FVM::Operator*, FVM::Operator*, FVM::Operator*, FVM::Operator *nRE_neg=nullptr);
const std::string& GetDescription() const { return description; }
};
}
#endif/*_DREAM_EQUATIONS_RUNAWAY_SOURCE_TERM_HANDLER_HPP*/
|
; ##########################################################################
Do_Status proc hParent:DWORD
LOCAL sbParts[4] :DWORD
invoke CreateStatusWindow,WS_CHILD or WS_VISIBLE or \
SBS_SIZEGRIP,NULL, hParent, 200
mov hStatus, eax
; -------------------------------------
; sbParts is a DWORD array of 4 members
; -------------------------------------
mov [sbParts + 0], 125 ; pixels from left
mov [sbParts + 4], 250 ; pixels from left
mov [sbParts + 8], 375 ; pixels from left
mov [sbParts + 12], -1 ; last part
invoke SendMessage,hStatus,SB_SETPARTS,4,ADDR sbParts
ret
Do_Status endp
; ##########################################################################
|
; A231681: a(n) = Sum_{i=0..n} digsum_8(i)^2, where digsum_8(i) = A053829(i).
; 0,1,5,14,30,55,91,140,141,145,154,170,195,231,280,344,348,357,373,398,434,483,547,628,637,653,678,714,763,827,908,1008,1024,1049,1085,1134,1198,1279,1379,1500,1525,1561,1610,1674,1755,1855,1976,2120,2156,2205,2269,2350,2450,2571,2715,2884,2933,2997,3078,3178,3299,3443,3612,3808,3809,3813,3822,3838,3863
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,53829 ; Sum of digits of (n written in base 8).
pow $0,2
add $1,$0
lpe
mov $0,$1
|
; int open(const char *path, int oflag, ...)
SECTION code_clib
SECTION code_fcntl
PUBLIC open
EXTERN asm_open
defc open = asm_open
|
; A123932: a(0) = 1, a(n) = 4 for n > 0.
; 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
pow $1,$0
gcd $1,4
|
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_HPP
#define SHARE_VM_CLASSFILE_JAVACLASSES_HPP
#include "classfile/systemDictionary.hpp"
#include "jvmtifiles/jvmti.h"
#include "oops/oop.hpp"
#include "runtime/os.hpp"
#include "utilities/utf8.hpp"
// Interface for manipulating the basic Java classes.
//
// All dependencies on layout of actual Java classes should be kept here.
// If the layout of any of the classes above changes the offsets must be adjusted.
//
// For most classes we hardwire the offsets for performance reasons. In certain
// cases (e.g. java.security.AccessControlContext) we compute the offsets at
// startup since the layout here differs between JDK1.2 and JDK1.3.
//
// Note that fields (static and non-static) are arranged with oops before non-oops
// on a per class basis. The offsets below have to reflect this ordering.
//
// When editing the layouts please update the check_offset verification code
// correspondingly. The names in the enums must be identical to the actual field
// names in order for the verification code to work.
// Interface to java.lang.String objects
class java_lang_String : AllStatic {
private:
static int value_offset;
static int offset_offset;
static int count_offset;
static int hash_offset;
static bool initialized;
static Handle basic_create(int length, TRAPS);
static void set_value( oop string, typeArrayOop buffer) {
assert(initialized, "Must be initialized");
string->obj_field_put(value_offset, (oop)buffer);
}
static void set_offset(oop string, int offset) {
assert(initialized, "Must be initialized");
if (offset_offset > 0) {
string->int_field_put(offset_offset, offset);
}
}
static void set_count( oop string, int count) {
assert(initialized, "Must be initialized");
if (count_offset > 0) {
string->int_field_put(count_offset, count);
}
}
public:
static void compute_offsets();
// Instance creation
static Handle create_from_unicode(jchar* unicode, int len, TRAPS);
static oop create_oop_from_unicode(jchar* unicode, int len, TRAPS);
static Handle create_from_str(const char* utf8_str, TRAPS);
static oop create_oop_from_str(const char* utf8_str, TRAPS);
static Handle create_from_symbol(Symbol* symbol, TRAPS);
static Handle create_from_platform_dependent_str(const char* str, TRAPS);
static Handle char_converter(Handle java_string, jchar from_char, jchar to_char, TRAPS);
static bool has_offset_field() {
assert(initialized, "Must be initialized");
return (offset_offset > 0);
}
static bool has_count_field() {
assert(initialized, "Must be initialized");
return (count_offset > 0);
}
static bool has_hash_field() {
assert(initialized, "Must be initialized");
return (hash_offset > 0);
}
static int value_offset_in_bytes() {
assert(initialized && (value_offset > 0), "Must be initialized");
return value_offset;
}
static int count_offset_in_bytes() {
assert(initialized && (count_offset > 0), "Must be initialized");
return count_offset;
}
static int offset_offset_in_bytes() {
assert(initialized && (offset_offset > 0), "Must be initialized");
return offset_offset;
}
static int hash_offset_in_bytes() {
assert(initialized && (hash_offset > 0), "Must be initialized");
return hash_offset;
}
// Accessors
static typeArrayOop value(oop java_string) {
assert(initialized && (value_offset > 0), "Must be initialized");
assert(is_instance(java_string), "must be java_string");
return (typeArrayOop) java_string->obj_field(value_offset);
}
static int offset(oop java_string) {
assert(initialized, "Must be initialized");
assert(is_instance(java_string), "must be java_string");
if (offset_offset > 0) {
return java_string->int_field(offset_offset);
} else {
return 0;
}
}
static int length(oop java_string) {
assert(initialized, "Must be initialized");
assert(is_instance(java_string), "must be java_string");
if (count_offset > 0) {
return java_string->int_field(count_offset);
} else {
return ((typeArrayOop)java_string->obj_field(value_offset))->length();
}
}
static int utf8_length(oop java_string);
// String converters
static char* as_utf8_string(oop java_string);
static char* as_utf8_string(oop java_string, char* buf, int buflen);
static char* as_utf8_string(oop java_string, int start, int len);
static char* as_platform_dependent_str(Handle java_string, TRAPS);
static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
// produce an ascii string with all other values quoted using \u####
static char* as_quoted_ascii(oop java_string);
// Compute the hash value for a java.lang.String object which would
// contain the characters passed in.
//
// As the hash value used by the String object itself, in
// String.hashCode(). This value is normally calculated in Java code
// in the String.hashCode method(), but is precomputed for String
// objects in the shared archive file.
// hash P(31) from Kernighan & Ritchie
//
// For this reason, THIS ALGORITHM MUST MATCH String.hashCode().
template <typename T> static unsigned int hash_code(T* s, int len) {
unsigned int h = 0;
while (len-- > 0) {
h = 31*h + (unsigned int) *s;
s++;
}
return h;
}
static unsigned int hash_code(oop java_string);
// This is the string hash code used by the StringTable, which may be
// the same as String.hashCode or an alternate hash code.
static unsigned int hash_string(oop java_string);
static bool equals(oop java_string, jchar* chars, int len);
static bool equals(oop str1, oop str2);
// Conversion between '.' and '/' formats
static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
// Conversion
static Symbol* as_symbol(Handle java_string, TRAPS);
static Symbol* as_symbol_or_null(oop java_string);
// Testers
static bool is_instance(oop obj) {
return obj != NULL && obj->klass() == SystemDictionary::String_klass();
}
// Debugging
static void print(Handle java_string, outputStream* st);
friend class JavaClasses;
};
// Interface to java.lang.Class objects
#define CLASS_INJECTED_FIELDS(macro) \
macro(java_lang_Class, klass, intptr_signature, false) \
macro(java_lang_Class, array_klass, intptr_signature, false) \
macro(java_lang_Class, oop_size, int_signature, false) \
macro(java_lang_Class, static_oop_field_count, int_signature, false) \
macro(java_lang_Class, protection_domain, object_signature, false) \
macro(java_lang_Class, init_lock, object_signature, false) \
macro(java_lang_Class, signers, object_signature, false)
class java_lang_Class : AllStatic {
friend class VMStructs;
private:
// The fake offsets are added by the class loader when java.lang.Class is loaded
static int _klass_offset;
static int _array_klass_offset;
static int _oop_size_offset;
static int _static_oop_field_count_offset;
static int _protection_domain_offset;
static int _init_lock_offset;
static int _signers_offset;
static bool offsets_computed;
static int classRedefinedCount_offset;
static GrowableArray<Klass*>* _fixup_mirror_list;
static void set_init_lock(oop java_class, oop init_lock);
static void set_protection_domain(oop java_class, oop protection_domain);
public:
static void compute_offsets();
// Instance creation
static oop create_mirror(KlassHandle k, Handle protection_domain, TRAPS);
static void fixup_mirror(KlassHandle k, TRAPS);
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
// Conversion
static Klass* as_Klass(oop java_class);
static void set_klass(oop java_class, Klass* klass);
static BasicType as_BasicType(oop java_class, Klass** reference_klass = NULL);
static BasicType as_BasicType(oop java_class, KlassHandle* reference_klass) {
Klass* refk_oop = NULL;
BasicType result = as_BasicType(java_class, &refk_oop);
(*reference_klass) = KlassHandle(refk_oop);
return result;
}
static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
static void print_signature(oop java_class, outputStream *st);
// Testing
static bool is_instance(oop obj) {
return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
}
static bool is_primitive(oop java_class);
static BasicType primitive_type(oop java_class);
static oop primitive_mirror(BasicType t);
// JVM_NewArray support
static Klass* array_klass(oop java_class);
static void set_array_klass(oop java_class, Klass* klass);
// compiler support for class operations
static int klass_offset_in_bytes() { return _klass_offset; }
static int array_klass_offset_in_bytes() { return _array_klass_offset; }
// Support for classRedefinedCount field
static int classRedefinedCount(oop the_class_mirror);
static void set_classRedefinedCount(oop the_class_mirror, int value);
// Support for embedded per-class oops
static oop protection_domain(oop java_class);
static oop init_lock(oop java_class);
static objArrayOop signers(oop java_class);
static void set_signers(oop java_class, objArrayOop signers);
static int oop_size(oop java_class);
static void set_oop_size(oop java_class, int size);
static int static_oop_field_count(oop java_class);
static void set_static_oop_field_count(oop java_class, int size);
static GrowableArray<Klass*>* fixup_mirror_list() {
return _fixup_mirror_list;
}
static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
_fixup_mirror_list = v;
}
// Debugging
friend class JavaClasses;
friend class InstanceKlass; // verification code accesses offsets
friend class ClassFileParser; // access to number_of_fake_fields
};
// Interface to java.lang.Thread objects
class java_lang_Thread : AllStatic {
private:
// Note that for this class the layout changed between JDK1.2 and JDK1.3,
// so we compute the offsets at startup rather than hard-wiring them.
static int _name_offset;
static int _group_offset;
static int _contextClassLoader_offset;
static int _inheritedAccessControlContext_offset;
static int _priority_offset;
static int _eetop_offset;
static int _daemon_offset;
static int _stillborn_offset;
static int _stackSize_offset;
static int _tid_offset;
static int _thread_status_offset;
static int _park_blocker_offset;
static int _park_event_offset ;
static void compute_offsets();
public:
// Instance creation
static oop create();
// Returns the JavaThread associated with the thread obj
static JavaThread* thread(oop java_thread);
// Set JavaThread for instance
static void set_thread(oop java_thread, JavaThread* thread);
// Name
static typeArrayOop name(oop java_thread);
static void set_name(oop java_thread, typeArrayOop name);
// Priority
static ThreadPriority priority(oop java_thread);
static void set_priority(oop java_thread, ThreadPriority priority);
// Thread group
static oop threadGroup(oop java_thread);
// Stillborn
static bool is_stillborn(oop java_thread);
static void set_stillborn(oop java_thread);
// Alive (NOTE: this is not really a field, but provides the correct
// definition without doing a Java call)
static bool is_alive(oop java_thread);
// Daemon
static bool is_daemon(oop java_thread);
static void set_daemon(oop java_thread);
// Context ClassLoader
static oop context_class_loader(oop java_thread);
// Control context
static oop inherited_access_control_context(oop java_thread);
// Stack size hint
static jlong stackSize(oop java_thread);
// Thread ID
static jlong thread_id(oop java_thread);
// Blocker object responsible for thread parking
static oop park_blocker(oop java_thread);
// Pointer to type-stable park handler, encoded as jlong.
// Should be set when apparently null
// For details, see unsafe.cpp Unsafe_Unpark
static jlong park_event(oop java_thread);
static bool set_park_event(oop java_thread, jlong ptr);
// Java Thread Status for JVMTI and M&M use.
// This thread status info is saved in threadStatus field of
// java.lang.Thread java class.
enum ThreadStatus {
NEW = 0,
RUNNABLE = JVMTI_THREAD_STATE_ALIVE + // runnable / running
JVMTI_THREAD_STATE_RUNNABLE,
SLEEPING = JVMTI_THREAD_STATE_ALIVE + // Thread.sleep()
JVMTI_THREAD_STATE_WAITING +
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
JVMTI_THREAD_STATE_SLEEPING,
IN_OBJECT_WAIT = JVMTI_THREAD_STATE_ALIVE + // Object.wait()
JVMTI_THREAD_STATE_WAITING +
JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
IN_OBJECT_WAIT_TIMED = JVMTI_THREAD_STATE_ALIVE + // Object.wait(long)
JVMTI_THREAD_STATE_WAITING +
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
PARKED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park()
JVMTI_THREAD_STATE_WAITING +
JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
JVMTI_THREAD_STATE_PARKED,
PARKED_TIMED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park(long)
JVMTI_THREAD_STATE_WAITING +
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
JVMTI_THREAD_STATE_PARKED,
BLOCKED_ON_MONITOR_ENTER = JVMTI_THREAD_STATE_ALIVE + // (re-)entering a synchronization block
JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER,
TERMINATED = JVMTI_THREAD_STATE_TERMINATED
};
// Write thread status info to threadStatus field of java.lang.Thread.
static void set_thread_status(oop java_thread_oop, ThreadStatus status);
// Read thread status info from threadStatus field of java.lang.Thread.
static ThreadStatus get_thread_status(oop java_thread_oop);
static const char* thread_status_name(oop java_thread_oop);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.ThreadGroup objects
class java_lang_ThreadGroup : AllStatic {
private:
static int _parent_offset;
static int _name_offset;
static int _threads_offset;
static int _groups_offset;
static int _maxPriority_offset;
static int _destroyed_offset;
static int _daemon_offset;
static int _vmAllowSuspension_offset;
static int _nthreads_offset;
static int _ngroups_offset;
static void compute_offsets();
public:
// parent ThreadGroup
static oop parent(oop java_thread_group);
// name
static typeArrayOop name(oop java_thread_group);
// ("name as oop" accessor is not necessary)
// Number of threads in group
static int nthreads(oop java_thread_group);
// threads
static objArrayOop threads(oop java_thread_group);
// Number of threads in group
static int ngroups(oop java_thread_group);
// groups
static objArrayOop groups(oop java_thread_group);
// maxPriority in group
static ThreadPriority maxPriority(oop java_thread_group);
// Destroyed
static bool is_destroyed(oop java_thread_group);
// Daemon
static bool is_daemon(oop java_thread_group);
// vmAllowSuspension
static bool is_vmAllowSuspension(oop java_thread_group);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.Throwable objects
class java_lang_Throwable: AllStatic {
friend class BacktraceBuilder;
private:
// Offsets
enum {
hc_backtrace_offset = 0,
hc_detailMessage_offset = 1,
hc_cause_offset = 2, // New since 1.4
hc_stackTrace_offset = 3 // New since 1.4
};
enum {
hc_static_unassigned_stacktrace_offset = 0 // New since 1.7
};
// Trace constants
enum {
trace_methods_offset = 0,
trace_bcis_offset = 1,
trace_mirrors_offset = 2,
trace_next_offset = 3,
trace_size = 4,
trace_chunk_size = 32
};
static int backtrace_offset;
static int detailMessage_offset;
static int cause_offset;
static int stackTrace_offset;
static int static_unassigned_stacktrace_offset;
// Printing
static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci);
// StackTrace (programmatic access, new since 1.4)
static void clear_stacktrace(oop throwable);
// No stack trace available
static const char* no_stack_trace_message();
// Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed)
static void set_stacktrace(oop throwable, oop st_element_array);
static oop unassigned_stacktrace();
public:
// Backtrace
static oop backtrace(oop throwable);
static void set_backtrace(oop throwable, oop value);
// Needed by JVMTI to filter out this internal field.
static int get_backtrace_offset() { return backtrace_offset;}
static int get_detailMessage_offset() { return detailMessage_offset;}
// Message
static oop message(oop throwable);
static oop message(Handle throwable);
static void set_message(oop throwable, oop value);
static void print_stack_element(outputStream *st, Handle mirror, int method,
int version, int bci);
static void print_stack_element(outputStream *st, methodHandle method, int bci);
static void print_stack_usage(Handle stream);
// Allocate space for backtrace (created but stack trace not filled in)
static void allocate_backtrace(Handle throwable, TRAPS);
// Fill in current stack trace for throwable with preallocated backtrace (no GC)
static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
// Fill in current stack trace, can cause GC
static void fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS);
static void fill_in_stack_trace(Handle throwable, methodHandle method = methodHandle());
// Programmatic access to stack trace
static oop get_stack_trace_element(oop throwable, int index, TRAPS);
static int get_stack_trace_depth(oop throwable, TRAPS);
// Printing
static void print(oop throwable, outputStream* st);
static void print(Handle throwable, outputStream* st);
static void print_stack_trace(oop throwable, outputStream* st);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.reflect.AccessibleObject objects
class java_lang_reflect_AccessibleObject: AllStatic {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int override_offset;
static void compute_offsets();
public:
// Accessors
static jboolean override(oop reflect);
static void set_override(oop reflect, jboolean value);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.reflect.Method objects
class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int clazz_offset;
static int name_offset;
static int returnType_offset;
static int parameterTypes_offset;
static int exceptionTypes_offset;
static int slot_offset;
static int modifiers_offset;
static int signature_offset;
static int annotations_offset;
static int parameter_annotations_offset;
static int annotation_default_offset;
static int type_annotations_offset;
static void compute_offsets();
public:
// Allocation
static Handle create(TRAPS);
// Accessors
static oop clazz(oop reflect);
static void set_clazz(oop reflect, oop value);
static oop name(oop method);
static void set_name(oop method, oop value);
static oop return_type(oop method);
static void set_return_type(oop method, oop value);
static oop parameter_types(oop method);
static void set_parameter_types(oop method, oop value);
static oop exception_types(oop method);
static void set_exception_types(oop method, oop value);
static int slot(oop reflect);
static void set_slot(oop reflect, int value);
static int modifiers(oop method);
static void set_modifiers(oop method, int value);
static bool has_signature_field();
static oop signature(oop method);
static void set_signature(oop method, oop value);
static bool has_annotations_field();
static oop annotations(oop method);
static void set_annotations(oop method, oop value);
static bool has_parameter_annotations_field();
static oop parameter_annotations(oop method);
static void set_parameter_annotations(oop method, oop value);
static bool has_annotation_default_field();
static oop annotation_default(oop method);
static void set_annotation_default(oop method, oop value);
static bool has_type_annotations_field();
static oop type_annotations(oop method);
static void set_type_annotations(oop method, oop value);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.reflect.Constructor objects
class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int clazz_offset;
static int parameterTypes_offset;
static int exceptionTypes_offset;
static int slot_offset;
static int modifiers_offset;
static int signature_offset;
static int annotations_offset;
static int parameter_annotations_offset;
static int type_annotations_offset;
static void compute_offsets();
public:
// Allocation
static Handle create(TRAPS);
// Accessors
static oop clazz(oop reflect);
static void set_clazz(oop reflect, oop value);
static oop parameter_types(oop constructor);
static void set_parameter_types(oop constructor, oop value);
static oop exception_types(oop constructor);
static void set_exception_types(oop constructor, oop value);
static int slot(oop reflect);
static void set_slot(oop reflect, int value);
static int modifiers(oop constructor);
static void set_modifiers(oop constructor, int value);
static bool has_signature_field();
static oop signature(oop constructor);
static void set_signature(oop constructor, oop value);
static bool has_annotations_field();
static oop annotations(oop constructor);
static void set_annotations(oop constructor, oop value);
static bool has_parameter_annotations_field();
static oop parameter_annotations(oop method);
static void set_parameter_annotations(oop method, oop value);
static bool has_type_annotations_field();
static oop type_annotations(oop constructor);
static void set_type_annotations(oop constructor, oop value);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.reflect.Field objects
class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int clazz_offset;
static int name_offset;
static int type_offset;
static int slot_offset;
static int modifiers_offset;
static int signature_offset;
static int annotations_offset;
static int type_annotations_offset;
static void compute_offsets();
public:
// Allocation
static Handle create(TRAPS);
// Accessors
static oop clazz(oop reflect);
static void set_clazz(oop reflect, oop value);
static oop name(oop field);
static void set_name(oop field, oop value);
static oop type(oop field);
static void set_type(oop field, oop value);
static int slot(oop reflect);
static void set_slot(oop reflect, int value);
static int modifiers(oop field);
static void set_modifiers(oop field, int value);
static bool has_signature_field();
static oop signature(oop constructor);
static void set_signature(oop constructor, oop value);
static bool has_annotations_field();
static oop annotations(oop constructor);
static void set_annotations(oop constructor, oop value);
static bool has_parameter_annotations_field();
static oop parameter_annotations(oop method);
static void set_parameter_annotations(oop method, oop value);
static bool has_annotation_default_field();
static oop annotation_default(oop method);
static void set_annotation_default(oop method, oop value);
static bool has_type_annotations_field();
static oop type_annotations(oop field);
static void set_type_annotations(oop field, oop value);
// Debugging
friend class JavaClasses;
};
class java_lang_reflect_Parameter {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int name_offset;
static int modifiers_offset;
static int index_offset;
static int executable_offset;
static void compute_offsets();
public:
// Allocation
static Handle create(TRAPS);
// Accessors
static oop name(oop field);
static void set_name(oop field, oop value);
static int index(oop reflect);
static void set_index(oop reflect, int value);
static int modifiers(oop reflect);
static void set_modifiers(oop reflect, int value);
static oop executable(oop constructor);
static void set_executable(oop constructor, oop value);
friend class JavaClasses;
};
// Interface to sun.reflect.ConstantPool objects
class sun_reflect_ConstantPool {
private:
// Note that to reduce dependencies on the JDK we compute these
// offsets at run-time.
static int _oop_offset;
static void compute_offsets();
public:
// Allocation
static Handle create(TRAPS);
// Accessors
static void set_cp(oop reflect, ConstantPool* value);
static int oop_offset() {
return _oop_offset;
}
static ConstantPool* get_cp(oop reflect);
// Debugging
friend class JavaClasses;
};
// Interface to sun.reflect.UnsafeStaticFieldAccessorImpl objects
class sun_reflect_UnsafeStaticFieldAccessorImpl {
private:
static int _base_offset;
static void compute_offsets();
public:
static int base_offset() {
return _base_offset;
}
// Debugging
friend class JavaClasses;
};
// Interface to java.lang primitive type boxing objects:
// - java.lang.Boolean
// - java.lang.Character
// - java.lang.Float
// - java.lang.Double
// - java.lang.Byte
// - java.lang.Short
// - java.lang.Integer
// - java.lang.Long
// This could be separated out into 8 individual classes.
class java_lang_boxing_object: AllStatic {
private:
enum {
hc_value_offset = 0
};
static int value_offset;
static int long_value_offset;
static oop initialize_and_allocate(BasicType type, TRAPS);
public:
// Allocation. Returns a boxed value, or NULL for invalid type.
static oop create(BasicType type, jvalue* value, TRAPS);
// Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop.
static BasicType get_value(oop box, jvalue* value);
static BasicType set_value(oop box, jvalue* value);
static BasicType basic_type(oop box);
static bool is_instance(oop box) { return basic_type(box) != T_ILLEGAL; }
static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
static void print(oop box, outputStream* st) { jvalue value; print(get_value(box, &value), &value, st); }
static void print(BasicType type, jvalue* value, outputStream* st);
static int value_offset_in_bytes(BasicType type) {
return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
value_offset;
}
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.ref.Reference objects
class java_lang_ref_Reference: AllStatic {
public:
enum {
hc_referent_offset = 0,
hc_queue_offset = 1,
hc_next_offset = 2,
hc_discovered_offset = 3 // Is not last, see SoftRefs.
};
enum {
hc_static_lock_offset = 0,
hc_static_pending_offset = 1
};
static int referent_offset;
static int queue_offset;
static int next_offset;
static int discovered_offset;
static int static_lock_offset;
static int static_pending_offset;
static int number_of_fake_oop_fields;
// Accessors
static oop referent(oop ref) {
return ref->obj_field(referent_offset);
}
static void set_referent(oop ref, oop value) {
ref->obj_field_put(referent_offset, value);
}
static void set_referent_raw(oop ref, oop value) {
ref->obj_field_put_raw(referent_offset, value);
}
static HeapWord* referent_addr(oop ref) {
return ref->obj_field_addr<HeapWord>(referent_offset);
}
static oop next(oop ref) {
return ref->obj_field(next_offset);
}
static void set_next(oop ref, oop value) {
ref->obj_field_put(next_offset, value);
}
static void set_next_raw(oop ref, oop value) {
ref->obj_field_put_raw(next_offset, value);
}
static HeapWord* next_addr(oop ref) {
return ref->obj_field_addr<HeapWord>(next_offset);
}
static oop discovered(oop ref) {
return ref->obj_field(discovered_offset);
}
static void set_discovered(oop ref, oop value) {
ref->obj_field_put(discovered_offset, value);
}
static void set_discovered_raw(oop ref, oop value) {
ref->obj_field_put_raw(discovered_offset, value);
}
static HeapWord* discovered_addr(oop ref) {
return ref->obj_field_addr<HeapWord>(discovered_offset);
}
// Accessors for statics
static oop pending_list_lock();
static oop pending_list();
static HeapWord* pending_list_lock_addr();
static HeapWord* pending_list_addr();
};
// Interface to java.lang.ref.SoftReference objects
class java_lang_ref_SoftReference: public java_lang_ref_Reference {
public:
enum {
// The timestamp is a long field and may need to be adjusted for alignment.
hc_timestamp_offset = hc_discovered_offset + 1
};
enum {
hc_static_clock_offset = 0
};
static int timestamp_offset;
static int static_clock_offset;
// Accessors
static jlong timestamp(oop ref);
// Accessors for statics
static jlong clock();
static void set_clock(jlong value);
};
// Interface to java.lang.invoke.MethodHandle objects
class MethodHandleEntry;
class java_lang_invoke_MethodHandle: AllStatic {
friend class JavaClasses;
private:
static int _type_offset; // the MethodType of this MH
static int _form_offset; // the LambdaForm of this MH
static void compute_offsets();
public:
// Accessors
static oop type(oop mh);
static void set_type(oop mh, oop mtype);
static oop form(oop mh);
static void set_form(oop mh, oop lform);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Accessors for code generation:
static int type_offset_in_bytes() { return _type_offset; }
static int form_offset_in_bytes() { return _form_offset; }
};
// Interface to java.lang.invoke.DirectMethodHandle objects
class java_lang_invoke_DirectMethodHandle: AllStatic {
friend class JavaClasses;
private:
static int _member_offset; // the MemberName of this DMH
static void compute_offsets();
public:
// Accessors
static oop member(oop mh);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Accessors for code generation:
static int member_offset_in_bytes() { return _member_offset; }
};
// Interface to java.lang.invoke.LambdaForm objects
// (These are a private interface for managing adapter code generation.)
class java_lang_invoke_LambdaForm: AllStatic {
friend class JavaClasses;
private:
static int _vmentry_offset; // type is MemberName
static void compute_offsets();
public:
// Accessors
static oop vmentry(oop lform);
static void set_vmentry(oop lform, oop invoker);
// Testers
static bool is_subclass(Klass* klass) {
return SystemDictionary::LambdaForm_klass() != NULL &&
klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Accessors for code generation:
static int vmentry_offset_in_bytes() { return _vmentry_offset; }
};
// Interface to java.lang.invoke.MemberName objects
// (These are a private interface for Java code to query the class hierarchy.)
#define MEMBERNAME_INJECTED_FIELDS(macro) \
macro(java_lang_invoke_MemberName, vmloader, object_signature, false) \
macro(java_lang_invoke_MemberName, vmindex, intptr_signature, false) \
macro(java_lang_invoke_MemberName, vmtarget, intptr_signature, false)
class java_lang_invoke_MemberName: AllStatic {
friend class JavaClasses;
private:
// From java.lang.invoke.MemberName:
// private Class<?> clazz; // class in which the method is defined
// private String name; // may be null if not yet materialized
// private Object type; // may be null if not yet materialized
// private int flags; // modifier bits; see reflect.Modifier
// private intptr vmtarget; // VM-specific target value
// private intptr_t vmindex; // member index within class or interface
static int _clazz_offset;
static int _name_offset;
static int _type_offset;
static int _flags_offset;
static int _vmtarget_offset;
static int _vmloader_offset;
static int _vmindex_offset;
static void compute_offsets();
public:
// Accessors
static oop clazz(oop mname);
static void set_clazz(oop mname, oop clazz);
static oop type(oop mname);
static void set_type(oop mname, oop type);
static oop name(oop mname);
static void set_name(oop mname, oop name);
static int flags(oop mname);
static void set_flags(oop mname, int flags);
static Metadata* vmtarget(oop mname);
static void set_vmtarget(oop mname, Metadata* target);
#if INCLUDE_JVMTI
static void adjust_vmtarget(oop mname, Metadata* target);
#endif // INCLUDE_JVMTI
static intptr_t vmindex(oop mname);
static void set_vmindex(oop mname, intptr_t index);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::MemberName_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
enum {
MN_IS_METHOD = 0x00010000, // method (not constructor)
MN_IS_CONSTRUCTOR = 0x00020000, // constructor
MN_IS_FIELD = 0x00040000, // field
MN_IS_TYPE = 0x00080000, // nested type
MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected
MN_REFERENCE_KIND_SHIFT = 24, // refKind
MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
// The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers:
MN_SEARCH_SUPERCLASSES = 0x00100000, // walk super classes
MN_SEARCH_INTERFACES = 0x00200000 // walk implemented interfaces
};
// Accessors for code generation:
static int clazz_offset_in_bytes() { return _clazz_offset; }
static int type_offset_in_bytes() { return _type_offset; }
static int name_offset_in_bytes() { return _name_offset; }
static int flags_offset_in_bytes() { return _flags_offset; }
static int vmtarget_offset_in_bytes() { return _vmtarget_offset; }
static int vmindex_offset_in_bytes() { return _vmindex_offset; }
};
// Interface to java.lang.invoke.MethodType objects
class java_lang_invoke_MethodType: AllStatic {
friend class JavaClasses;
private:
static int _rtype_offset;
static int _ptypes_offset;
static void compute_offsets();
public:
// Accessors
static oop rtype(oop mt);
static objArrayOop ptypes(oop mt);
static oop ptype(oop mt, int index);
static int ptype_count(oop mt);
static int ptype_slot_count(oop mt); // extra counts for long/double
static int rtype_slot_count(oop mt); // extra counts for long/double
static Symbol* as_signature(oop mt, bool intern_if_not_found, TRAPS);
static void print_signature(oop mt, outputStream* st);
static bool is_instance(oop obj) {
return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
}
static bool equals(oop mt1, oop mt2);
// Accessors for code generation:
static int rtype_offset_in_bytes() { return _rtype_offset; }
static int ptypes_offset_in_bytes() { return _ptypes_offset; }
};
// Interface to java.lang.invoke.CallSite objects
class java_lang_invoke_CallSite: AllStatic {
friend class JavaClasses;
private:
static int _target_offset;
static void compute_offsets();
public:
// Accessors
static oop target( oop site) { return site->obj_field( _target_offset); }
static void set_target( oop site, oop target) { site->obj_field_put( _target_offset, target); }
static volatile oop target_volatile(oop site) { return site->obj_field_volatile( _target_offset); }
static void set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); }
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::CallSite_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Accessors for code generation:
static int target_offset_in_bytes() { return _target_offset; }
};
// Interface to java.security.AccessControlContext objects
class java_security_AccessControlContext: AllStatic {
private:
// Note that for this class the layout changed between JDK1.2 and JDK1.3,
// so we compute the offsets at startup rather than hard-wiring them.
static int _context_offset;
static int _privilegedContext_offset;
static int _isPrivileged_offset;
static int _isAuthorized_offset;
static void compute_offsets();
public:
static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS);
static bool is_authorized(Handle context);
// Debugging/initialization
friend class JavaClasses;
};
// Interface to java.lang.ClassLoader objects
#define CLASSLOADER_INJECTED_FIELDS(macro) \
macro(java_lang_ClassLoader, loader_data, intptr_signature, false)
class java_lang_ClassLoader : AllStatic {
private:
// The fake offsets are added by the class loader when java.lang.Class is loaded
enum {
hc_parent_offset = 0
};
static int _loader_data_offset;
static bool offsets_computed;
static int parent_offset;
static int parallelCapable_offset;
public:
static void compute_offsets();
static ClassLoaderData** loader_data_addr(oop loader);
static ClassLoaderData* loader_data(oop loader);
static oop parent(oop loader);
static bool isAncestor(oop loader, oop cl);
// Support for parallelCapable field
static bool parallelCapable(oop the_class_mirror);
static bool is_trusted_loader(oop loader);
// Fix for 4474172
static oop non_reflection_class_loader(oop loader);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
}
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
// Debugging
friend class JavaClasses;
friend class ClassFileParser; // access to number_of_fake_fields
};
// Interface to java.lang.System objects
class java_lang_System : AllStatic {
private:
enum {
hc_static_in_offset = 0,
hc_static_out_offset = 1,
hc_static_err_offset = 2,
hc_static_security_offset = 3
};
static int static_in_offset;
static int static_out_offset;
static int static_err_offset;
static int static_security_offset;
public:
static int in_offset_in_bytes();
static int out_offset_in_bytes();
static int err_offset_in_bytes();
static bool has_security_manager();
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.StackTraceElement objects
class java_lang_StackTraceElement: AllStatic {
private:
enum {
hc_declaringClass_offset = 0,
hc_methodName_offset = 1,
hc_fileName_offset = 2,
hc_lineNumber_offset = 3
};
static int declaringClass_offset;
static int methodName_offset;
static int fileName_offset;
static int lineNumber_offset;
public:
// Setters
static void set_declaringClass(oop element, oop value);
static void set_methodName(oop element, oop value);
static void set_fileName(oop element, oop value);
static void set_lineNumber(oop element, int value);
// Create an instance of StackTraceElement
static oop create(Handle mirror, int method, int version, int bci, TRAPS);
static oop create(methodHandle method, int bci, TRAPS);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.AssertionStatusDirectives objects
class java_lang_AssertionStatusDirectives: AllStatic {
private:
enum {
hc_classes_offset,
hc_classEnabled_offset,
hc_packages_offset,
hc_packageEnabled_offset,
hc_deflt_offset
};
static int classes_offset;
static int classEnabled_offset;
static int packages_offset;
static int packageEnabled_offset;
static int deflt_offset;
public:
// Setters
static void set_classes(oop obj, oop val);
static void set_classEnabled(oop obj, oop val);
static void set_packages(oop obj, oop val);
static void set_packageEnabled(oop obj, oop val);
static void set_deflt(oop obj, bool val);
// Debugging
friend class JavaClasses;
};
class java_nio_Buffer: AllStatic {
private:
static int _limit_offset;
public:
static int limit_offset();
static void compute_offsets();
};
class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
private:
static int _owner_offset;
public:
static void initialize(TRAPS);
static oop get_owner_threadObj(oop obj);
};
// Use to declare fields that need to be injected into Java classes
// for the JVM to use. The name_index and signature_index are
// declared in vmSymbols. The may_be_java flag is used to declare
// fields that might already exist in Java but should be injected if
// they don't. Otherwise the field is unconditionally injected and
// the JVM uses the injected one. This is to ensure that name
// collisions don't occur. In general may_be_java should be false
// unless there's a good reason.
class InjectedField {
public:
const SystemDictionary::WKID klass_id;
const vmSymbols::SID name_index;
const vmSymbols::SID signature_index;
const bool may_be_java;
Klass* klass() const { return SystemDictionary::well_known_klass(klass_id); }
Symbol* name() const { return lookup_symbol(name_index); }
Symbol* signature() const { return lookup_symbol(signature_index); }
int compute_offset();
// Find the Symbol for this index
static Symbol* lookup_symbol(int symbol_index) {
return vmSymbols::symbol_at((vmSymbols::SID)symbol_index);
}
};
#define DECLARE_INJECTED_FIELD_ENUM(klass, name, signature, may_be_java) \
klass##_##name##_enum,
#define ALL_INJECTED_FIELDS(macro) \
CLASS_INJECTED_FIELDS(macro) \
CLASSLOADER_INJECTED_FIELDS(macro) \
MEMBERNAME_INJECTED_FIELDS(macro)
// Interface to hard-coded offset checking
class JavaClasses : AllStatic {
private:
static InjectedField _injected_fields[];
static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
public:
enum InjectedFieldID {
ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD_ENUM)
MAX_enum
};
static int compute_injected_offset(InjectedFieldID id);
static void compute_hard_coded_offsets();
static void compute_offsets();
static void check_offsets() PRODUCT_RETURN;
static InjectedField* get_injected(Symbol* class_name, int* field_count);
};
#undef DECLARE_INJECTED_FIELD_ENUM
#endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP
|
// Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "src/backends/backend/triton_model_instance.h"
#include "src/backends/backend/triton_model.h"
#include "src/core/logging.h"
#include "src/core/metrics.h"
#include "src/core/model_config.pb.h"
namespace nvidia { namespace inferenceserver {
TritonModelInstance::TritonModelInstance(
TritonModel* model, const std::string& name, const size_t index,
const TRITONSERVER_InstanceGroupKind kind, const int32_t device_id)
: model_(model), name_(name), index_(index), kind_(kind),
device_id_(device_id), state_(nullptr)
{
#ifdef TRITON_ENABLE_METRICS
if (Metrics::Enabled()) {
// Use an ID in the metric only for GPU instances. Otherwise use
// -1 to indicate no device should be reported in the metric.
const int id =
(kind_ == TRITONSERVER_INSTANCEGROUPKIND_GPU) ? device_id_ : -1;
reporter_.reset(new MetricModelReporter(
model_->Name(), model_->Version(), id, model_->Config().metric_tags()));
}
#endif // TRITON_ENABLE_METRICS
}
TritonModelInstance::~TritonModelInstance()
{
// Model finalization is optional...
if (model_->Backend()->ModelInstanceFiniFn() != nullptr) {
LOG_TRITONSERVER_ERROR(
model_->Backend()->ModelInstanceFiniFn()(
reinterpret_cast<TRITONBACKEND_ModelInstance*>(this)),
"failed finalizing model instance");
}
}
Status
TritonModelInstance::CreateInstances(
TritonModel* model, const inference::ModelConfig& model_config,
std::vector<std::unique_ptr<TritonModelInstance>>* instances)
{
for (const auto& group : model_config.instance_group()) {
for (int32_t c = 0; c < group.count(); ++c) {
if (group.kind() == inference::ModelInstanceGroup::KIND_CPU) {
RETURN_IF_ERROR(CreateInstance(
model, group.name(), c, TRITONSERVER_INSTANCEGROUPKIND_CPU,
0 /* device_id */, instances));
} else if (group.kind() == inference::ModelInstanceGroup::KIND_GPU) {
for (const int32_t device_id : group.gpus()) {
RETURN_IF_ERROR(CreateInstance(
model, group.name(), c, TRITONSERVER_INSTANCEGROUPKIND_GPU,
device_id, instances));
}
} else if (group.kind() == inference::ModelInstanceGroup::KIND_MODEL) {
RETURN_IF_ERROR(CreateInstance(
model, group.name(), c, TRITONSERVER_INSTANCEGROUPKIND_MODEL,
0 /* device_id */, instances));
} else {
return Status(
Status::Code::INVALID_ARG,
std::string("instance_group kind ") +
ModelInstanceGroup_Kind_Name(group.kind()) + " not supported");
}
}
}
return Status::Success;
}
Status
TritonModelInstance::CreateInstance(
TritonModel* model, const std::string& name, const size_t index,
const TRITONSERVER_InstanceGroupKind kind, const int32_t device_id,
std::vector<std::unique_ptr<TritonModelInstance>>* instances)
{
std::unique_ptr<TritonModelInstance> local_instance(
new TritonModelInstance(model, name, index, kind, device_id));
TRITONBACKEND_ModelInstance* triton_instance =
reinterpret_cast<TRITONBACKEND_ModelInstance*>(local_instance.get());
// Instance initialization is optional...
if (model->Backend()->ModelInstanceInitFn() != nullptr) {
RETURN_IF_TRITONSERVER_ERROR(
model->Backend()->ModelInstanceInitFn()(triton_instance));
}
instances->push_back(std::move(local_instance));
return Status::Success;
}
extern "C" {
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceName(
TRITONBACKEND_ModelInstance* instance, const char** name)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
*name = ti->Name().c_str();
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceKind(
TRITONBACKEND_ModelInstance* instance, TRITONSERVER_InstanceGroupKind* kind)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
*kind = ti->Kind();
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceDeviceId(
TRITONBACKEND_ModelInstance* instance, int32_t* device_id)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
*device_id = ti->DeviceId();
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceModel(
TRITONBACKEND_ModelInstance* instance, TRITONBACKEND_Model** model)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
*model = reinterpret_cast<TRITONBACKEND_Model*>(ti->Model());
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceState(
TRITONBACKEND_ModelInstance* instance, void** state)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
*state = ti->State();
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceSetState(
TRITONBACKEND_ModelInstance* instance, void* state)
{
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
ti->SetState(state);
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceReportStatistics(
TRITONBACKEND_ModelInstance* instance, TRITONBACKEND_Request* request,
const bool success, const uint64_t exec_start_ns,
const uint64_t compute_start_ns, const uint64_t compute_end_ns,
const uint64_t exec_end_ns)
{
#ifdef TRITON_ENABLE_STATS
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
InferenceRequest* tr = reinterpret_cast<InferenceRequest*>(request);
tr->ReportStatistics(
ti->MetricReporter(), success, exec_start_ns, compute_start_ns,
compute_end_ns, exec_end_ns);
#endif // TRITON_ENABLE_STATS
return nullptr; // success
}
TRITONSERVER_Error*
TRITONBACKEND_ModelInstanceReportBatchStatistics(
TRITONBACKEND_ModelInstance* instance, const uint64_t batch_size,
const uint64_t exec_start_ns, const uint64_t compute_start_ns,
const uint64_t compute_end_ns, const uint64_t exec_end_ns)
{
#ifdef TRITON_ENABLE_STATS
TritonModelInstance* ti = reinterpret_cast<TritonModelInstance*>(instance);
ti->Model()->MutableStatsAggregator()->UpdateInferBatchStats(
ti->MetricReporter(), batch_size, exec_start_ns, compute_start_ns,
compute_end_ns, exec_end_ns);
#endif // TRITON_ENABLE_STATS
return nullptr; // success
}
} // extern C
}} // namespace nvidia::inferenceserver
|
; A158953: Trajectory of 12 under repeated application of the map n --> A102370(n) .
; 12,28,44,60,76,92,108,124,140,156,172,188,204,220,236,252,268,284,300,316,332,348,364,380,396,412,428,444,460,476,492,508,524,540,556,572,588,604,620,636,652,668,684,700,716,732,748,764,780,796,812,828,844
mov $1,$0
mul $1,16
add $1,12
|
/*=========================================================================
Program: Visualization Toolkit
Module: TestBoxPlot.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSmartPointer.h"
#include "vtkAxis.h"
#include "vtkChartBox.h"
#include "vtkCommand.h"
#include "vtkComputeQuartiles.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
#include "vtkIntArray.h"
#include "vtkLookupTable.h"
#include "vtkPlotBox.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkStatisticsAlgorithm.h"
#include "vtkStringArray.h"
#include "vtkTable.h"
#include "vtkTextProperty.h"
#include "vtkTestErrorObserver.h"
//----------------------------------------------------------------------------
int TestBoxPlot2(int, char*[])
{
// Set up a 2D scene, add an XY chart to it
vtkSmartPointer<vtkContextView> view = vtkSmartPointer<vtkContextView>::New();
view->GetRenderWindow()->SetSize(400, 400);
view->GetRenderWindow()->SetMultiSamples(0);
vtkSmartPointer<vtkChartBox> chart = vtkSmartPointer<vtkChartBox>::New();
view->GetScene()->AddItem(chart);
// Creates a vtkPlotBox input table
int numberOfColumns = 5;
vtkSmartPointer<vtkTable> inputBoxPlotTable = vtkSmartPointer<vtkTable>::New();
for (int i = 0; i < numberOfColumns; ++i)
{
char num[10];
snprintf(num, sizeof(num), "Run %d", i + 1);
vtkSmartPointer<vtkIntArray> arrIndex = vtkSmartPointer<vtkIntArray>::New();
arrIndex->SetName(num);
inputBoxPlotTable->AddColumn(arrIndex);
}
// Data from the Michelson Morley experiment
inputBoxPlotTable->SetNumberOfRows(20);
double values[20][5] = {
{ 850, 960, 880, 890, 890 },
{ 740, 940, 880, 810, 840 },
{ 900, 960, 880, 810, 780 },
{ 1070, 940, 860, 820, 810 },
{ 930, 880, 720, 800, 760 },
{ 850, 800, 720, 770, 810 },
{ 950, 850, 620, 760, 790 },
{ 980, 880, 860, 740, 810 },
{ 980, 900, 970, 750, 820 },
{ 880, 840, 950, 760, 850 },
{ 1000, 830, 880, 910, 870 },
{ 980, 790, 910, 920, 870 },
{ 930, 810, 850, 890, 810 },
{ 650, 880, 870, 860, 740 },
{ 760, 880, 840, 880, 810 },
{ 810, 830, 840, 720, 940 },
{ 1000, 800, 850, 840, 950 },
{ 1000, 790, 840, 850, 800 },
{ 960, 760, 840, 850, 810 },
{ 960, 800, 840, 780, 870 },
};
for (int j = 0; j < 20; ++j)
{
for (int i = 0; i < 5; ++i)
{
inputBoxPlotTable->SetValue(j, i, values[j][i]);
}
}
// Compute the min, q1, median, q3 qnd max.
vtkSmartPointer<vtkComputeQuartiles> quartiles = vtkSmartPointer<vtkComputeQuartiles>::New();
quartiles->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputBoxPlotTable);
quartiles->Update();
vtkSmartPointer<vtkLookupTable> lookup = vtkSmartPointer<vtkLookupTable>::New();
lookup->SetNumberOfColors(5);
lookup->SetRange(0, 4);
lookup->Build();
chart->GetPlot(0)->SetInputData(inputBoxPlotTable);
chart->GetPlot(0)->LegendVisibilityOn();
chart->SetColumnVisibilityAll(true);
chart->SetTitle("Michelson-Morley experiment");
chart->GetTitleProperties()->SetVerticalJustificationToTop();
chart->GetTitleProperties()->SetFontSize(20);
chart->GetTitleProperties()->FrameOn();
chart->GetYAxis()->SetTitle("Speed of Light (km/s - 299000)");
vtkSmartPointer<vtkTest::ErrorObserver> errorObserver =
vtkSmartPointer<vtkTest::ErrorObserver>::New();
chart->GetPlot(0)->AddObserver(vtkCommand::ErrorEvent, errorObserver);
// Set the labels
vtkSmartPointer<vtkStringArray> labels = vtkSmartPointer<vtkStringArray>::New();
labels->SetNumberOfValues(5);
labels->SetValue(0, "Run 1");
labels->SetValue(1, "Run 2");
labels->SetValue(2, "Run 3");
labels->SetValue(3, "Run 4");
labels->SetValue(4, "Run 5");
chart->GetPlot(0)->SetLabels(labels);
// Render the scene
view->GetRenderWindow()->SetMultiSamples(0);
view->GetRenderer()->SetBackground(.8, .8, .8);
view->GetInteractor()->Initialize();
// Detect bad input error message from PlotBox
view->Render();
int status = errorObserver->CheckErrorMessage("Input table must contain 5 rows per column");
// Now render a valid plot
vtkTable* outTable = quartiles->GetOutput();
chart->GetPlot(0)->SetInputData(outTable);
view->Render();
view->GetInteractor()->Start();
return status;
}
|
;================================================================================
; Randomize Tablets
;--------------------------------------------------------------------------------
ItemSet_EtherTablet:
PHA : LDA !NPC_FLAGS_2 : ORA.b #$01 : STA !NPC_FLAGS_2 : PLA
RTL
;--------------------------------------------------------------------------------
ItemSet_BombosTablet:
PHA : LDA !NPC_FLAGS_2 : ORA.b #$02 : STA !NPC_FLAGS_2 : PLA
RTL
;--------------------------------------------------------------------------------
ItemCheck_EtherTablet:
LDA !NPC_FLAGS_2 : AND.b #$01
RTL
;--------------------------------------------------------------------------------
ItemCheck_BombosTablet:
LDA !NPC_FLAGS_2 : AND.b #$02
RTL
;--------------------------------------------------------------------------------
SetTabletItem:
JSL.l GetSpriteID
PHA
LDA $8A : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet
.bombos
JSL.l ItemSet_BombosTablet : BRA .done
.ether
JSL.l ItemSet_EtherTablet
.done
PLA
RTL
;--------------------------------------------------------------------------------
SpawnTabletItem:
; JSL.l HeartPieceGet
;RTL
JSL.l LoadOutdoorValue
JSL.l PrepDynamicTile
LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE
JSL.l SetTabletItem
LDA.b #$EB
STA $7FFE00
JSL Sprite_SpawnDynamically
LDA $22 : STA $0D10, Y
LDA $23 : STA $0D30, Y
LDA $20 : STA $0D00, Y
LDA $21 : STA $0D20, Y
LDA.b #$00 : STA $0F20, Y
LDA.b #$7F : STA $0F70, Y ; spawn WAY up high
RTL
;--------------------------------------------------------------------------------
MaybeUnlockTabletAnimation:
PHA : PHP
JSL.l IsMedallion : BCC +
STZ $0112 ; disable falling-medallion mode
STZ $03EF ; release link from item-up pose
LDA.b #$00 : STA $5D ; set link to ground state
REP #$20 ; set 16-bit accumulator
LDA $8A : CMP.w #$0030 : BNE ++ ; Desert
SEP #$20 ; set 8-bit accumulator
LDA.b #$02 : STA $2F ; face link forward
LDA.b #$3C : STA $46 ; lock link for 60f
++
SEP #$20 ; set 8-bit accumulator
+
PLP : PLA
RTL
;--------------------------------------------------------------------------------
IsMedallion:
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$03 : BNE + ; Death Mountain
LDA $22 : CMP.w #1890 : !BGE ++
SEC
BRL .done
++
BRA .false
+ CMP.w #$30 : BNE + ; Desert
LDA $22 : CMP.w #512 : !BLT ++
SEC
BRL .done
++
+
.false
CLC
.done
SEP #$20 ; set 8-bit accumulator
RTL
;--------------------------------------------------------------------------------
LoadNarrowObject:
LDA AddReceivedItemExpanded_wide_item_flag, X : STA ($92), Y ; AddReceiveItem.wide_item_flag? ; LDA.b #$00 : STA ($92), Y in the japanese version
PLY
;JSL.l DrawNarrowDroppedObject
JMP.l LoadNarrowObjectReturn
;--------------------------------------------------------------------------------
DrawNarrowDroppedObject:
; If it's a 16x16 sprite, we'll only draw one, otherwise we'll end up drawing
; two 8x8 sprites stack on top of each other
CMP.b #$02 : BEQ .large_sprite
REP #$20
; Shift Y coordinate 8 pixels down
LDA $08 : STA $00
SEP #$20
JSL.l Ancilla_SetOam_XY_Long
; always use the same character graphic (0x34)
LDA.b #$34 : STA ($90), Y : INY
LDA AddReceivedItemExpanded_properties, X : BPL .valid_lower_properties
LDA $74
.valid_lower_properties
ASL A : ORA.b #$30 : STA ($90), Y
INY : PHY
TYA : !SUB.b #$04 : LSR #2 : TAY
LDA.b #$00 : STA ($92), Y
PLY
.large_sprite
RTL
;-------------------------------------------------------------------------------- |
assume cs:code
code segment
mov ax,0ffffh
mov ds,ax ; (ds) <- ffffh
mov bx,0 ; EA
mov dx,0 ; sum
mov cx,12 ; loop counter
s: mov al,[bx]
mov ah,0 ; (ax) <- (ffff0h + (bx))
add dx,ax
inc bx
loop s
mov ax,4c00h
int 21h
code ends
end
|
;
; Small C+ Library Functions
;
; Renamed once more and rechristened for ANSIstdio
;
; This outputs a character to the console
;
; 1/4/2000 (Original Aug 98)
;
;
;
; $Id: fputc_cons.asm,v 1.3 2015/01/19 01:33:21 pauloscustodio Exp $
;
PUBLIC fputc_cons ;Print char
.fputc_cons
ld hl,2
add hl,sp
ld a,(hl)
cp 8
jr nz,fputc_cons1
ld c,$53 ;CURSOR
rst $10
ld a,e
and a
ret z
dec e
ld c,$52 ;LOCATE
rst $10
ret
.fputc_cons1
cp 13
jr nz,fputc_cons2
ld a,10
ld c,$5b ;PUTCHAR
rst $10
ld a,13
.fputc_cons2
ld c,$5b ;PUTCHAR
rst $10
ret
|
<%
from pwnlib.shellcraft.thumb.linux import syscall
%>
<%page args=""/>
<%docstring>
Invokes the syscall sync. See 'man 2 sync' for more information.
Arguments:
</%docstring>
${syscall('SYS_sync')}
|
; ==================================================================
; MikeBASIC interpreter
; Copyright (C) 2006 - 2019 MikeOS Developers -- see doc/LICENSE.TXT
; Copyright (C) 2020 Dzmitry Taranovich
;
; BASIC CODE INTERPRETER (4.5)
; ==================================================================
bits 16
org 32768
call load_script_and_proceed
ret
; ------------------------------------------------------------------
; Token types
%DEFINE VARIABLE 1
%DEFINE STRING_VAR 2
%DEFINE NUMBER 3
%DEFINE STRING 4
%DEFINE QUOTE 5
%DEFINE CHAR 6
%DEFINE UNKNOWN 7
%DEFINE LABEL 8
%INCLUDE "mikedev.inc"
load_script_and_proceed:
cmp si, 0
jne .load_source
ret
.load_source:
call os_string_parse
mov cx, 45056 ; 44K, so 20K left for program
call os_load_file
jnc .run_interpreter
ret
.run_interpreter:
mov ax, 45056
jmp run_basic
; ------------------------------------------------------------------
; The BASIC interpreter execution starts here -- a parameter string
; is passed in SI and copied into the first string, unless SI = 0
run_basic:
mov word [orig_stack], sp ; Save stack pointer -- we might jump to the
; error printing code and quit in the middle
; some nested loops, and we want to preserve
; the stack
mov word [load_point], ax ; AX was passed as starting location of code
mov word [prog], ax ; prog = pointer to current execution point in code
add bx, ax ; We were passed the .BAS byte size in BX
dec bx
dec bx
mov word [prog_end], bx ; Make note of program end point
call clear_ram ; Clear variables etc. from previous run
; of a BASIC program
cmp si, 0 ; Passed a parameter string?
je mainloop
mov di, string_vars ; If so, copy it into $1
call os_string_copy
mainloop:
call get_token ; Get a token from the start of the line
cmp ax, STRING ; Is the type a string of characters?
je .keyword ; If so, let's see if it's a keyword to process
cmp ax, VARIABLE ; If it's a variable at the start of the line,
je near assign ; this is an assign (eg "X = Y + 5")
cmp ax, STRING_VAR ; Same for a string variable (eg $1)
je near assign
cmp ax, LABEL ; Don't need to do anything here - skip
je mainloop
mov si, err_syntax ; Otherwise show an error and quit
jmp error
.keyword:
mov si, token ; Start trying to match commands
mov di, alert_cmd
call os_string_compare
jc near do_alert
mov di, askfile_cmd
call os_string_compare
jc near do_askfile
mov di, break_cmd
call os_string_compare
jc near do_break
mov di, case_cmd
call os_string_compare
jc near do_case
mov di, call_cmd
call os_string_compare
jc near do_call
mov di, cls_cmd
call os_string_compare
jc near do_cls
mov di, cursor_cmd
call os_string_compare
jc near do_cursor
mov di, curschar_cmd
call os_string_compare
jc near do_curschar
mov di, curscol_cmd
call os_string_compare
jc near do_curscol
mov di, curspos_cmd
call os_string_compare
jc near do_curspos
mov di, delete_cmd
call os_string_compare
jc near do_delete
mov di, do_cmd
call os_string_compare
jc near do_do
mov di, end_cmd
call os_string_compare
jc near do_end
mov di, else_cmd
call os_string_compare
jc near do_else
mov di, files_cmd
call os_string_compare
jc near do_files
mov di, for_cmd
call os_string_compare
jc near do_for
mov di, getkey_cmd
call os_string_compare
jc near do_getkey
mov di, gosub_cmd
call os_string_compare
jc near do_gosub
mov di, goto_cmd
call os_string_compare
jc near do_goto
mov di, if_cmd
call os_string_compare
jc near do_if
mov di, include_cmd
call os_string_compare
jc near do_include
mov di, ink_cmd
call os_string_compare
jc near do_ink
mov di, input_cmd
call os_string_compare
jc near do_input
mov di, len_cmd
call os_string_compare
jc near do_len
mov di, listbox_cmd
call os_string_compare
jc near do_listbox
mov di, load_cmd
call os_string_compare
jc near do_load
mov di, loop_cmd
call os_string_compare
jc near do_loop
mov di, move_cmd
call os_string_compare
jc near do_move
mov di, next_cmd
call os_string_compare
jc near do_next
mov di, number_cmd
call os_string_compare
jc near do_number
mov di, page_cmd
call os_string_compare
jc near do_page
mov di, pause_cmd
call os_string_compare
jc near do_pause
mov di, peek_cmd
call os_string_compare
jc near do_peek
mov di, peekint_cmd
call os_string_compare
jc near do_peekint
mov di, poke_cmd
call os_string_compare
jc near do_poke
mov di, pokeint_cmd
call os_string_compare
jc near do_pokeint
mov di, port_cmd
call os_string_compare
jc near do_port
mov di, print_cmd
call os_string_compare
jc near do_print
mov di, rand_cmd
call os_string_compare
jc near do_rand
mov di, read_cmd
call os_string_compare
jc near do_read
mov di, rem_cmd
call os_string_compare
jc near do_rem
mov di, rename_cmd
call os_string_compare
jc near do_rename
mov di, return_cmd
call os_string_compare
jc near do_return
mov di, save_cmd
call os_string_compare
jc near do_save
mov di, serial_cmd
call os_string_compare
jc near do_serial
mov di, size_cmd
call os_string_compare
jc near do_size
mov di, sound_cmd
call os_string_compare
jc near do_sound
mov di, string_cmd
call os_string_compare
jc near do_string
mov di, waitkey_cmd
call os_string_compare
jc near do_waitkey
mov si, err_cmd_unknown ; Command not found?
jmp error
; ------------------------------------------------------------------
; CLEAR RAM
clear_ram:
pusha
mov al, 0
mov di, variables
mov cx, 52
rep stosb
mov di, for_variables
mov cx, 52
rep stosb
mov di, for_code_points
mov cx, 52
rep stosb
mov di, do_loop_store
mov cx, 10
rep stosb
mov byte [gosub_depth], 0
mov byte [loop_in], 0
mov di, gosub_points
mov cx, 20
rep stosb
mov di, string_vars
mov cx, 1024
rep stosb
mov byte [ink_colour], 7 ; White ink
popa
ret
; ------------------------------------------------------------------
; ASSIGNMENT
assign:
cmp ax, VARIABLE ; Are we starting with a number var?
je .do_num_var
mov di, string_vars ; Otherwise it's a string var
mov ax, 128
mul bx ; (BX = string number, passed back from get_token)
add di, ax
push di
call get_token
mov byte al, [token]
cmp al, '='
jne near .error
call get_token ; See if second is quote
cmp ax, QUOTE
je .second_is_quote
cmp ax, STRING_VAR
jne near .error
mov si, string_vars ; Otherwise it's a string var
mov ax, 128
mul bx ; (BX = string number, passed back from get_token)
add si, ax
pop di
call os_string_copy
jmp .string_check_for_more
.second_is_quote:
mov si, token
pop di
call os_string_copy
.string_check_for_more:
push di
mov word ax, [prog] ; Save code location in case there's no delimiter
mov word [.tmp_loc], ax
call get_token ; Any more to deal with in this assignment?
mov byte al, [token]
cmp al, '+'
je .string_theres_more
mov word ax, [.tmp_loc] ; Not a delimiter, so step back before the token
mov word [prog], ax ; that we just grabbed
pop di
jmp mainloop ; And go back to the code interpreter!
.string_theres_more:
call get_token
cmp ax, STRING_VAR
je .another_string_var
cmp ax, QUOTE
je .another_quote
cmp ax, VARIABLE
je .add_number_var
jmp .error
.another_string_var:
pop di
mov si, string_vars
mov ax, 128
mul bx ; (BX = string number, passed back from get_token)
add si, ax
mov ax, di
mov cx, di
mov bx, si
call os_string_join
jmp .string_check_for_more
.another_quote:
pop di
mov ax, di
mov cx, di
mov bx, token
call os_string_join
jmp .string_check_for_more
.add_number_var:
mov ax, 0
mov byte al, [token]
call get_var
call os_int_to_string
mov bx, ax
pop di
mov ax, di
mov cx, di
call os_string_join
jmp .string_check_for_more
.do_num_var:
mov ax, 0
mov byte al, [token]
mov byte [.tmp], al
call get_token
mov byte al, [token]
cmp al, '='
jne near .error
call get_token
cmp ax, NUMBER
je .second_is_num
cmp ax, VARIABLE
je .second_is_variable
cmp ax, STRING
je near .second_is_string
cmp ax, UNKNOWN
jne near .error
mov byte al, [token] ; Address of string var?
cmp al, '&'
jne near .error
call get_token ; Let's see if there's a string var
cmp ax, STRING_VAR
jne near .error
mov di, string_vars
mov ax, 128
mul bx
add di, ax
mov bx, di
mov byte al, [.tmp]
call set_var
jmp mainloop
.second_is_variable:
mov ax, 0
mov byte al, [token]
call get_var
mov bx, ax
mov byte al, [.tmp]
call set_var
jmp .check_for_more
.second_is_num:
mov si, token
call os_string_to_int
mov bx, ax ; Number to insert in variable table
mov ax, 0
mov byte al, [.tmp]
call set_var
; The assignment could be simply "X = 5" etc. Or it could be
; "X = Y + 5" -- ie more complicated. So here we check to see if
; there's a delimiter...
.check_for_more:
mov word ax, [prog] ; Save code location in case there's no delimiter
mov word [.tmp_loc], ax
call get_token ; Any more to deal with in this assignment?
mov byte al, [token]
cmp al, '+'
je .theres_more
cmp al, '-'
je .theres_more
cmp al, '*'
je .theres_more
cmp al, '/'
je .theres_more
cmp al, '%'
je .theres_more
mov word ax, [.tmp_loc] ; Not a delimiter, so step back before the token
mov word [prog], ax ; that we just grabbed
jmp mainloop ; And go back to the code interpreter!
.theres_more:
mov byte [.delim], al
call get_token
cmp ax, VARIABLE
je .handle_variable
mov si, token
call os_string_to_int
mov bx, ax
mov ax, 0
mov byte al, [.tmp]
call get_var ; This also points SI at right place in variable table
cmp byte [.delim], '+'
jne .not_plus
add ax, bx
jmp .finish
.not_plus:
cmp byte [.delim], '-'
jne .not_minus
sub ax, bx
jmp .finish
.not_minus:
cmp byte [.delim], '*'
jne .not_times
mul bx
jmp .finish
.not_times:
cmp byte [.delim], '/'
jne .not_divide
cmp bx, 0
je .divide_zero
mov dx, 0
div bx
jmp .finish
.not_divide:
mov dx, 0
div bx
mov ax, dx ; Get remainder
.finish:
mov bx, ax
mov byte al, [.tmp]
call set_var
jmp .check_for_more
.divide_zero:
mov si, err_divide_by_zero
jmp error
.handle_variable:
mov ax, 0
mov byte al, [token]
call get_var
mov bx, ax
mov ax, 0
mov byte al, [.tmp]
call get_var
cmp byte [.delim], '+'
jne .vnot_plus
add ax, bx
jmp .vfinish
.vnot_plus:
cmp byte [.delim], '-'
jne .vnot_minus
sub ax, bx
jmp .vfinish
.vnot_minus:
cmp byte [.delim], '*'
jne .vnot_times
mul bx
jmp .vfinish
.vnot_times:
cmp byte [.delim], '/'
jne .vnot_divide
mov dx, 0
div bx
jmp .finish
.vnot_divide:
mov dx, 0
div bx
mov ax, dx ; Get remainder
.vfinish:
mov bx, ax
mov byte al, [.tmp]
call set_var
jmp .check_for_more
.second_is_string: ; These are "X = word" functions
mov di, token
mov si, ink_keyword
call os_string_compare
je .is_ink
mov si, progstart_keyword
call os_string_compare
je .is_progstart
mov si, ramstart_keyword
call os_string_compare
je .is_ramstart
mov si, timer_keyword
call os_string_compare
je .is_timer
mov si, variables_keyword
call os_string_compare
je .is_variables
mov si, version_keyword
call os_string_compare
je .is_version
jmp .error
.is_ink:
mov ax, 0
mov byte al, [.tmp]
mov bx, 0
mov byte bl, [ink_colour]
call set_var
jmp mainloop
.is_progstart:
mov ax, 0
mov byte al, [.tmp]
mov word bx, [load_point]
call set_var
jmp mainloop
.is_ramstart:
mov ax, 0
mov byte al, [.tmp]
mov word bx, [prog_end]
inc bx
inc bx
inc bx
call set_var
jmp mainloop
.is_timer:
mov ah, 0
int 1Ah
mov bx, dx
mov ax, 0
mov byte al, [.tmp]
call set_var
jmp mainloop
.is_variables:
mov bx, vars_loc
mov ax, 0
mov byte al, [.tmp]
call set_var
jmp mainloop
.is_version:
call os_get_api_version
mov bh, 0
mov bl, al
mov al, [.tmp]
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.tmp db 0
.tmp_loc dw 0
.delim db 0
; ==================================================================
; SPECIFIC COMMAND CODE STARTS HERE
; ------------------------------------------------------------------
; ALERT
do_alert:
mov bh, [work_page] ; Store the cursor position
mov ah, 03h
int 10h
call get_token
cmp ax, QUOTE
je .is_quote
cmp ax, STRING_VAR
je .is_string
mov si, err_syntax
jmp error
.is_string:
mov si, string_vars
mov ax, 128
mul bx
add ax, si
jmp .display_message
.is_quote:
mov ax, token ; First string for alert box
.display_message:
mov bx, 0 ; Others are blank
mov cx, 0
mov dx, 0 ; One-choice box
call os_dialog_box
mov bh, [work_page] ; Move the cursor back
mov ah, 02h
int 10h
jmp mainloop
;-------------------------------------------------------------------
; ASKFILE
do_askfile:
mov bh, [work_page] ; Store the cursor position
mov ah, 03h
int 10h
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars ; Get the string location
mov ax, 128
mul bx
add ax, si
mov word [.tmp], ax
call os_file_selector ; Present the selector
mov word di, [.tmp] ; Copy the string
mov si, ax
call os_string_copy
mov bh, [work_page] ; Move the cursor back
mov ah, 02h
int 10h
jmp mainloop
.error:
mov si, err_syntax
jmp error
.data:
.tmp dw 0
; ------------------------------------------------------------------
; BREAK
do_break:
mov si, err_break
jmp error
; ------------------------------------------------------------------
; CALL
do_call:
call get_token
cmp ax, NUMBER
je .is_number
mov ax, 0
mov byte al, [token]
call get_var
jmp .execute_call
.is_number:
mov si, token
call os_string_to_int
.execute_call:
mov bx, 0
mov cx, 0
mov dx, 0
mov di, 0
mov si, 0
call ax
jmp mainloop
; ------------------------------------------------------------------
; CASE
do_case:
call get_token
cmp ax, STRING
jne .error
mov si, token
mov di, upper_keyword
call os_string_compare
jc .uppercase
mov di, lower_keyword
call os_string_compare
jc .lowercase
jmp .error
.uppercase:
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add ax, si
call os_string_uppercase
jmp mainloop
.lowercase:
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add ax, si
call os_string_lowercase
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; CLS
do_cls:
mov ah, 5
mov byte al, [work_page]
int 10h
call os_clear_screen
mov ah, 5
mov byte al, [disp_page]
int 10h
jmp mainloop
; ------------------------------------------------------------------
; CURSOR
do_cursor:
call get_token
mov si, token
mov di, .on_str
call os_string_compare
jc .turn_on
mov si, token
mov di, .off_str
call os_string_compare
jc .turn_off
mov si, err_syntax
jmp error
.turn_on:
call os_show_cursor
jmp mainloop
.turn_off:
call os_hide_cursor
jmp mainloop
.on_str db "ON", 0
.off_str db "OFF", 0
; ------------------------------------------------------------------
; CURSCHAR
do_curschar:
call get_token
cmp ax, VARIABLE
je .is_variable
mov si, err_syntax
jmp error
.is_variable:
mov ax, 0
mov byte al, [token]
push ax ; Store variable we're going to use
mov ah, 08h
mov bx, 0
mov byte bh, [work_page]
int 10h ; Get char at current cursor location
mov bx, 0 ; We only want the lower byte (the char, not attribute)
mov bl, al
pop ax ; Get the variable back
call set_var ; And store the value
jmp mainloop
; ------------------------------------------------------------------
; CURSCOL
do_curscol:
call get_token
cmp ax, VARIABLE
jne .error
mov ah, 0
mov byte al, [token]
push ax
mov ah, 8
mov bx, 0
mov byte bh, [work_page]
int 10h
mov bh, 0
mov bl, ah ; Get colour for higher byte; ignore lower byte (char)
pop ax
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; CURSPOS
do_curspos:
mov byte bh, [work_page]
mov ah, 3
int 10h
call get_token
cmp ax, VARIABLE
jne .error
mov ah, 0 ; Get the column in the first variable
mov byte al, [token]
mov bx, 0
mov bl, dl
call set_var
call get_token
cmp ax, VARIABLE
jne .error
mov ah, 0 ; Get the row to the second
mov byte al, [token]
mov bx, 0
mov bl, dh
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; DELETE
do_delete:
call get_token
cmp ax, QUOTE
je .is_quote
cmp ax, STRING_VAR
jne near .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
jmp .get_filename
.is_quote:
mov si, token
.get_filename:
mov ax, si
call os_file_exists
jc .no_file
call os_remove_file
jc .del_fail
jmp .returngood
.no_file:
mov ax, 0
mov byte al, 'R'
mov bx, 2
call set_var
jmp mainloop
.returngood:
mov ax, 0
mov byte al, 'R'
mov bx, 0
call set_var
jmp mainloop
.del_fail:
mov ax, 0
mov byte al, 'R'
mov bx, 1
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; DO
do_do:
cmp byte [loop_in], 20
je .loop_max
mov word di, do_loop_store
mov byte al, [loop_in]
mov ah, 0
add di, ax
mov word ax, [prog]
sub ax, 3
stosw
inc byte [loop_in]
inc byte [loop_in]
jmp mainloop
.loop_max:
mov si, err_doloop_maximum
jmp error
;-------------------------------------------------------------------
; ELSE
do_else:
cmp byte [last_if_true], 1
je .last_true
inc word [prog]
jmp mainloop
.last_true:
mov word si, [prog]
.next_line:
lodsb
cmp al, 10
jne .next_line
dec si
mov word [prog], si
jmp mainloop
; ------------------------------------------------------------------
; END
do_end:
mov ah, 5 ; Restore active page
mov al, 0
int 10h
mov byte [work_page], 0
mov byte [disp_page], 0
mov word sp, [orig_stack]
ret
; ------------------------------------------------------------------
; FILES
do_files:
mov ax, .filelist ; get a copy of the filelist
call os_get_file_list
mov si, ax
call os_get_cursor_pos ; move cursor to start of line
mov dl, 0
call os_move_cursor
mov ah, 9 ; print character function
mov bh, [work_page] ; define parameters (page, colour, times)
mov bl, [ink_colour]
mov cx, 1
.file_list_loop:
lodsb ; get a byte from the list
cmp al, ',' ; a comma means the next file, so create a new line for it
je .nextfile
cmp al, 0 ; the list is null terminated
je .end_of_list
int 10h ; okay, it's not a comma or a null so print it
call os_get_cursor_pos ; find the location of the cursor
inc dl ; move the cursor forward
call os_move_cursor
jmp .file_list_loop ; keep going until the list is finished
.nextfile:
call os_get_cursor_pos ; if the column is over 60 we need a new line
cmp dl, 60
jge .newline
.next_column: ; print spaces until the next column
mov al, ' '
int 10h
inc dl
call os_move_cursor
cmp dl, 15
je .file_list_loop
cmp dl, 30
je .file_list_loop
cmp dl, 45
je .file_list_loop
cmp dl, 60
je .file_list_loop
jmp .next_column
.newline:
call os_print_newline ; create a new line
jmp .file_list_loop
.end_of_list:
call os_print_newline
jmp mainloop ; preform next command
.data:
.filelist times 256 db 0
; ------------------------------------------------------------------
; FOR
do_for:
call get_token ; Get the variable we're using in this loop
cmp ax, VARIABLE
jne near .error
mov ax, 0
mov byte al, [token]
mov byte [.tmp_var], al ; Store it in a temporary location for now
call get_token
mov ax, 0 ; Check it's followed up with '='
mov byte al, [token]
cmp al, '='
jne .error
call get_token ; Next we want a number
cmp ax, VARIABLE
je .first_is_var
cmp ax, NUMBER
jne .error
mov si, token ; Convert it
call os_string_to_int
jmp .continue
.first_is_var:
mov ax, 0 ; It's a variable, so get it's value
mov al, [token]
call get_var
; At this stage, we've read something like "FOR X = 1"
; so let's store that 1 in the variable table
.continue:
mov bx, ax
mov ax, 0
mov byte al, [.tmp_var]
call set_var
call get_token ; Next we're looking for "TO"
cmp ax, STRING
jne .error
mov ax, token
call os_string_uppercase
mov si, token
mov di, .to_string
call os_string_compare
jnc .error
; So now we're at "FOR X = 1 TO"
call get_token
cmp ax, VARIABLE
je .second_is_var
cmp ax, NUMBER
jne .error
.second_is_number:
mov si, token ; Get target number
call os_string_to_int
jmp .continue2
.second_is_var:
mov ax, 0 ; It's a variable, so get it's value
mov al, [token]
call get_var
.continue2:
mov bx, ax
mov ax, 0
mov byte al, [.tmp_var]
sub al, 65 ; Store target number in table
mov di, for_variables
add di, ax
add di, ax
mov ax, bx
stosw
; So we've got the variable, assigned it the starting number, and put into
; our table the limit it should reach. But we also need to store the point in
; code after the FOR line we should return to if NEXT X doesn't complete the loop...
mov ax, 0
mov byte al, [.tmp_var]
sub al, 65 ; Store code position to return to in table
mov di, for_code_points
add di, ax
add di, ax
mov word ax, [prog]
stosw
jmp mainloop
.error:
mov si, err_syntax
jmp error
.tmp_var db 0
.to_string db 'TO', 0
; ------------------------------------------------------------------
; GETKEY
do_getkey:
call get_token
cmp ax, VARIABLE
je .is_variable
mov si, err_syntax
jmp error
.is_variable:
mov ax, 0
mov byte al, [token]
push ax
call os_check_for_key
cmp ax, 48E0h
je .up_pressed
cmp ax, 50E0h
je .down_pressed
cmp ax, 4BE0h
je .left_pressed
cmp ax, 4DE0h
je .right_pressed
.store:
mov bx, 0
mov bl, al
pop ax
call set_var
jmp mainloop
.up_pressed:
mov ax, 1
jmp .store
.down_pressed:
mov ax, 2
jmp .store
.left_pressed:
mov ax, 3
jmp .store
.right_pressed:
mov ax, 4
jmp .store
; ------------------------------------------------------------------
; GOSUB
do_gosub:
call get_token ; Get the number (label)
cmp ax, STRING
je .is_ok
mov si, err_goto_notlabel
jmp error
.is_ok:
mov si, token ; Back up this label
mov di, .tmp_token
call os_string_copy
mov ax, .tmp_token
call os_string_length
mov di, .tmp_token ; Add ':' char to end for searching
add di, ax
mov al, ':'
stosb
mov al, 0
stosb
inc byte [gosub_depth]
mov ax, 0
mov byte al, [gosub_depth] ; Get current GOSUB nest level
cmp al, 9
jle .within_limit
mov si, err_nest_limit
jmp error
.within_limit:
mov di, gosub_points ; Move into our table of pointers
add di, ax ; Table is words (not bytes)
add di, ax
mov word ax, [prog]
stosw ; Store current location before jump
mov word ax, [load_point]
mov word [prog], ax ; Return to start of program to find label
.loop:
call get_token
cmp ax, LABEL
jne .line_loop
mov si, token
mov di, .tmp_token
call os_string_compare
jc mainloop
.line_loop: ; Go to end of line
mov word si, [prog]
mov byte al, [si]
inc word [prog]
cmp al, 10
jne .line_loop
mov word ax, [prog]
mov word bx, [prog_end]
cmp ax, bx
jg .past_end
jmp .loop
.past_end:
mov si, err_label_notfound
jmp error
.tmp_token times 30 db 0
; ------------------------------------------------------------------
; GOTO
do_goto:
call get_token ; Get the next token
cmp ax, STRING
je .is_ok
mov si, err_goto_notlabel
jmp error
.is_ok:
mov si, token ; Back up this label
mov di, .tmp_token
call os_string_copy
mov ax, .tmp_token
call os_string_length
mov di, .tmp_token ; Add ':' char to end for searching
add di, ax
mov al, ':'
stosb
mov al, 0
stosb
mov word ax, [load_point]
mov word [prog], ax ; Return to start of program to find label
.loop:
call get_token
cmp ax, LABEL
jne .line_loop
mov si, token
mov di, .tmp_token
call os_string_compare
jc mainloop
.line_loop: ; Go to end of line
mov word si, [prog]
mov byte al, [si]
inc word [prog]
cmp al, 10
jne .line_loop
mov word ax, [prog]
mov word bx, [prog_end]
cmp ax, bx
jg .past_end
jmp .loop
.past_end:
mov si, err_label_notfound
jmp error
.tmp_token times 30 db 0
; ------------------------------------------------------------------
; IF
do_if:
call get_token
cmp ax, VARIABLE ; If can only be followed by a variable
je .num_var
cmp ax, STRING_VAR
je near .string_var
mov si, err_syntax
jmp error
.num_var:
mov ax, 0
mov byte al, [token]
call get_var
mov dx, ax ; Store value of first part of comparison
call get_token ; Get the delimiter
mov byte al, [token]
cmp al, '='
je .equals
cmp al, '>'
je .greater
cmp al, '<'
je .less
cmp al, '!'
je .not_equals
mov si, err_syntax ; If not one of the above, error out
jmp error
.equals:
call get_token ; Is this 'X = Y' (equals another variable?)
cmp ax, CHAR
je .equals_char
mov byte al, [token]
call is_letter
jc .equals_var
mov si, token ; Otherwise it's, eg 'X = 1' (a number)
call os_string_to_int
cmp ax, dx ; On to the THEN bit if 'X = num' matches
je near .on_to_then
jmp .finish_line ; Otherwise skip the rest of the line
.equals_char:
mov ax, 0
mov byte al, [token]
cmp ax, dx
je near .on_to_then
jmp .finish_line
.equals_var:
mov ax, 0
mov byte al, [token]
call get_var
cmp ax, dx ; Do the variables match?
je near .on_to_then ; On to the THEN bit if so
jmp .finish_line ; Otherwise skip the rest of the line
.not_equals:
mov byte al, [token + 1]
cmp al, '='
jne .error
call get_token
cmp ax, CHAR
je .not_equals_char
cmp ax, VARIABLE
je .not_equals_var
cmp ax, NUMBER
je .not_equals_number
mov si, err_syntax
jmp error
.not_equals_char:
mov ax, 0
mov byte al, [token]
cmp ax, dx
jne near .on_to_then
jmp .finish_line
.not_equals_var:
mov ax, 0
mov byte al, [token]
call get_var
cmp ax, dx
jne near .on_to_then
jmp .finish_line
.not_equals_number:
mov si, token
call os_string_to_int
cmp ax, dx
jne near .on_to_then
jmp .finish_line
.greater:
call get_token ; Greater than a variable or number?
mov byte al, [token]
call is_letter
jc .greater_var
mov si, token ; Must be a number here...
call os_string_to_int
cmp ax, dx
jl near .on_to_then
jmp .finish_line
.greater_var: ; Variable in this case
mov ax, 0
mov byte al, [token]
call get_var
cmp ax, dx ; Make the comparison!
jl .on_to_then
jmp .finish_line
.less:
call get_token
mov byte al, [token]
call is_letter
jc .less_var
mov si, token
call os_string_to_int
cmp ax, dx
jg .on_to_then
jmp .finish_line
.less_var:
mov ax, 0
mov byte al, [token]
call get_var
cmp ax, dx
jg .on_to_then
jmp .finish_line
.string_var:
mov byte [.tmp_string_var], bl
call get_token
mov byte al, [token]
mov byte [.tmp_string_op], al
cmp al, '='
je .get_second
cmp al, '!'
jne .error
mov byte al, [token + 1]
cmp al, '='
jne .error
.get_second:
call get_token
cmp ax, STRING_VAR
je .second_is_string_var
cmp ax, QUOTE
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov di, token
mov al, [.tmp_string_op]
cmp al, '='
je .string_equals
cmp al, '!'
je .string_not_equals
jmp .error
.second_is_string_var:
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov di, string_vars
mov bx, 0
mov byte bl, [.tmp_string_var]
mov ax, 128
mul bx
add di, ax
mov al, [.tmp_string_op]
cmp al, '!'
je .string_not_equals
.string_equals:
call os_string_compare
jc .on_to_then
jmp .finish_line
.string_not_equals:
call os_string_compare
jnc .on_to_then
jmp .finish_line
.on_to_then:
call get_token
mov si, token ; Look for AND for more comparison
mov di, and_keyword
call os_string_compare
jc do_if
mov si, token ; Look for THEN to perform more operations
mov di, then_keyword
call os_string_compare
jc .then_present
mov si, err_syntax
jmp error
.then_present: ; Continue rest of line like any other command!
mov byte [last_if_true], 1
jmp mainloop
.finish_line: ; IF wasn't fulfilled, so skip rest of line
mov word si, [prog]
mov byte al, [si]
inc word [prog]
cmp al, 10
jne .finish_line
mov byte [last_if_true], 0
jmp mainloop
.error:
mov si, err_syntax
jmp error
.tmp_string_var db 0
.tmp_string_op db 0
; ------------------------------------------------------------------
; INCLUDE
do_include:
call get_token
cmp ax, QUOTE
je .is_ok
mov si, err_syntax
jmp error
.is_ok:
mov ax, token
mov word cx, [prog_end]
inc cx ; Add a bit of space after original code
inc cx
inc cx
push cx
call os_load_file
jc .load_fail
pop cx
add cx, bx
mov word [prog_end], cx
jmp mainloop
.load_fail:
pop cx
mov si, err_file_notfound
jmp error
; ------------------------------------------------------------------
; INK
do_ink:
call get_token ; Get column
cmp ax, VARIABLE
je .first_is_var
mov si, token
call os_string_to_int
mov byte [ink_colour], al
jmp mainloop
.first_is_var:
mov ax, 0
mov byte al, [token]
call get_var
mov byte [ink_colour], al
jmp mainloop
; ------------------------------------------------------------------
; INPUT
do_input:
mov byte [.tmpstring], 0
call get_token
cmp ax, VARIABLE ; We can only INPUT to variables!
je .number_var
cmp ax, STRING_VAR
je .string_var
mov si, err_syntax
jmp error
.number_var:
mov ax, .tmpstring ; Get input from the user
mov bx, 6
call os_input_string
mov ax, .tmpstring
call os_string_length
cmp ax, 0
jne .char_entered
mov byte [.tmpstring], '0' ; If enter hit, fill variable with zero
mov byte [.tmpstring + 1], 0
.char_entered:
mov si, .tmpstring ; Convert to integer format
call os_string_to_int
mov bx, ax
mov ax, 0
mov byte al, [token] ; Get the variable where we're storing it...
call set_var ; ...and store it!
call os_print_newline
jmp mainloop
.string_var:
mov ax, 128
mul bx
add ax, string_vars
mov bx, 128
call os_input_string
call os_print_newline
jmp mainloop
.tmpstring times 6 db 0
; -----------------------------------------------------------
; LEN
do_len:
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov ax, si
call os_string_length
mov word [.num1], ax
call get_token
cmp ax, VARIABLE
je .is_ok
mov si, err_syntax
jmp error
.is_ok:
mov ax, 0
mov byte al, [token]
mov bl, al
jmp .finish
.finish:
mov bx, [.num1]
mov byte al, [token]
call set_var
mov ax, 0
jmp mainloop
.error:
mov si, err_syntax
jmp error
.num1 dw 0
; ------------------------------------------------------------------
; LISTBOX
do_listbox:
mov bh, [work_page] ; Store the cursor position
mov ah, 03h
int 10h
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov word [.s1], si
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov word [.s2], si
call get_token
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov word [.s3], si
call get_token
cmp ax, VARIABLE
jne .error
mov byte al, [token]
mov byte [.var], al
mov word ax, [.s1]
mov word bx, [.s2]
mov word cx, [.s3]
call os_list_dialog
jc .esc_pressed
pusha
mov bh, [work_page] ; Move the cursor back
mov ah, 02h
int 10h
popa
mov bx, ax
mov ax, 0
mov byte al, [.var]
call set_var
jmp mainloop
.esc_pressed:
mov ax, 0
mov byte al, [.var]
mov bx, 0
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.s1 dw 0
.s2 dw 0
.s3 dw 0
.var db 0
; ------------------------------------------------------------------
; LOAD
do_load:
call get_token
cmp ax, QUOTE
je .is_quote
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
jmp .get_position
.is_quote:
mov si, token
.get_position:
mov ax, si
call os_file_exists
jc .file_not_exists
mov dx, ax ; Store for now
call get_token
cmp ax, VARIABLE
je .second_is_var
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
.load_part:
mov cx, ax
mov ax, dx
call os_load_file
mov ax, 0
mov byte al, 'S'
call set_var
mov ax, 0
mov byte al, 'R'
mov bx, 0
call set_var
jmp mainloop
.second_is_var:
mov ax, 0
mov byte al, [token]
call get_var
jmp .load_part
.file_not_exists:
mov ax, 0
mov byte al, 'R'
mov bx, 1
call set_var
call get_token ; Skip past the loading point -- unnecessary now
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; LOOP
do_loop:
cmp byte [loop_in], 0
je .no_do
dec byte [loop_in]
dec byte [loop_in]
mov dx, 0
call get_token
mov di, token
mov si, .endless_word
call os_string_compare
jc .loop_back
mov si, .while_word
call os_string_compare
jc .while_set
mov si, .until_word
call os_string_compare
jnc .error
.get_first_var:
call get_token
cmp ax, VARIABLE
jne .error
mov al, [token]
call get_var
mov cx, ax
.check_equals:
call get_token
cmp ax, UNKNOWN
jne .error
mov ax, [token]
cmp al, '='
je .sign_ok
cmp al, '>'
je .sign_ok
cmp al, '<'
je .sign_ok
jmp .error
.sign_ok:
mov byte [.sign], al
.get_second_var:
call get_token
cmp ax, NUMBER
je .second_is_num
cmp ax, VARIABLE
je .second_is_var
cmp ax, CHAR
jne .error
.second_is_char:
mov ah, 0
mov al, [token]
jmp .check_true
.second_is_var:
mov al, [token]
call get_var
jmp .check_true
.second_is_num:
mov si, token
call os_string_to_int
.check_true:
mov byte bl, [.sign]
cmp bl, '='
je .sign_equals
cmp bl, '>'
je .sign_greater
jmp .sign_lesser
.sign_equals:
cmp ax, cx
jne .false
jmp .true
.sign_greater:
cmp ax, cx
jge .false
jmp .true
.sign_lesser:
cmp ax, cx
jle .false
jmp .true
.true:
cmp dx, 1
je .loop_back
jmp mainloop
.false:
cmp dx, 1
je mainloop
.loop_back:
mov word si, do_loop_store
mov byte al, [loop_in]
mov ah, 0
add si, ax
lodsw
mov word [prog], ax
jmp mainloop
.while_set:
mov dx, 1
jmp .get_first_var
.no_do:
mov si, err_loop
jmp error
.error:
mov si, err_syntax
jmp error
.data:
.while_word db "WHILE", 0
.until_word db "UNTIL", 0
.endless_word db "ENDLESS", 0
.sign db 0
; ------------------------------------------------------------------
; MOVE
do_move:
call get_token
cmp ax, VARIABLE
je .first_is_var
mov si, token
call os_string_to_int
mov dl, al
jmp .onto_second
.first_is_var:
mov ax, 0
mov byte al, [token]
call get_var
mov dl, al
.onto_second:
call get_token
cmp ax, VARIABLE
je .second_is_var
mov si, token
call os_string_to_int
mov dh, al
jmp .finish
.second_is_var:
mov ax, 0
mov byte al, [token]
call get_var
mov dh, al
.finish:
mov byte bh, [work_page]
mov ah, 2
int 10h
jmp mainloop
; ------------------------------------------------------------------
; NEXT
do_next:
call get_token
cmp ax, VARIABLE ; NEXT must be followed by a variable
jne .error
mov ax, 0
mov byte al, [token]
call get_var
inc ax ; NEXT increments the variable, of course!
mov bx, ax
mov ax, 0
mov byte al, [token]
sub al, 65
mov si, for_variables
add si, ax
add si, ax
lodsw ; Get the target number from the table
inc ax ; (Make the loop inclusive of target number)
cmp ax, bx ; Do the variable and target match?
je .loop_finished
mov ax, 0 ; If not, store the updated variable
mov byte al, [token]
call set_var
mov ax, 0 ; Find the code point and go back
mov byte al, [token]
sub al, 65
mov si, for_code_points
add si, ax
add si, ax
lodsw
mov word [prog], ax
jmp mainloop
.loop_finished:
jmp mainloop
.error:
mov si, err_syntax
jmp error
;-------------------------------------------------------------------
; NUMBER
do_number:
call get_token ; Check if it's string to number, or number to string
cmp ax, STRING_VAR
je .is_string
cmp ax, VARIABLE
je .is_variable
jmp .error
.is_string:
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov [.tmp], si
call get_token
mov si, [.tmp]
cmp ax, VARIABLE
jne .error
call os_string_to_int
mov bx, ax
mov ax, 0
mov byte al, [token]
call set_var
jmp mainloop
.is_variable:
mov ax, 0 ; Get the value of the number
mov byte al, [token]
call get_var
call os_int_to_string ; Convert to a string
mov [.tmp], ax
call get_token ; Get the second parameter
mov si, [.tmp]
cmp ax, STRING_VAR ; Make sure it's a string variable
jne .error
mov di, string_vars ; Locate string variable
mov ax, 128
mul bx
add di, ax
call os_string_copy ; Save converted string
jmp mainloop
.error:
mov si, err_syntax
jmp error
.tmp dw 0
;-------------------------------------------------------------------
; PAGE
do_page:
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
mov byte [work_page], al ; Set work page variable
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
mov byte [disp_page], al ; Set display page variable
; Change display page -- AL should already be present from the os_string_to_int
mov ah, 5
int 10h
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; PAUSE
do_pause:
call get_token
cmp ax, VARIABLE
je .is_var
mov si, token
call os_string_to_int
jmp .finish
.is_var:
mov ax, 0
mov byte al, [token]
call get_var
.finish:
call os_pause
jmp mainloop
; ------------------------------------------------------------------
; PEEK
do_peek:
call get_token
cmp ax, VARIABLE
jne .error
mov ax, 0
mov byte al, [token]
mov byte [.tmp_var], al
call get_token
cmp ax, VARIABLE
je .dereference
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
.store:
mov si, ax
mov bx, 0
mov byte bl, [si]
mov ax, 0
mov byte al, [.tmp_var]
call set_var
jmp mainloop
.dereference:
mov byte al, [token]
call get_var
jmp .store
.error:
mov si, err_syntax
jmp error
.tmp_var db 0
; ------------------------------------------------------------------
; PEEKINT
do_peekint:
call get_token
cmp ax, VARIABLE
jne .error
.get_second:
mov al, [token]
mov cx, ax
call get_token
cmp ax, VARIABLE
je .address_is_var
cmp ax, NUMBER
jne .error
.address_is_number:
mov si, token
call os_string_to_int
jmp .load_data
.address_is_var:
mov al, [token]
call get_var
.load_data:
mov si, ax
mov bx, [si]
mov ax, cx
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; POKE
do_poke:
call get_token
cmp ax, VARIABLE
je .first_is_var
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
cmp ax, 255
jg .error
mov byte [.first_value], al
jmp .onto_second
.first_is_var:
mov ax, 0
mov byte al, [token]
call get_var
mov byte [.first_value], al
.onto_second:
call get_token
cmp ax, VARIABLE
je .second_is_var
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
.got_value:
mov di, ax
mov ax, 0
mov byte al, [.first_value]
mov byte [di], al
jmp mainloop
.second_is_var:
mov ax, 0
mov byte al, [token]
call get_var
jmp .got_value
.error:
mov si, err_syntax
jmp error
.first_value db 0
; ------------------------------------------------------------------
; POKEINT
do_pokeint:
call get_token
cmp ax, VARIABLE
je .data_is_var
cmp ax, NUMBER
jne .error
.data_is_num:
mov si, token
call os_string_to_int
jmp .get_second
.data_is_var:
mov al, [token]
call get_var
.get_second:
mov cx, ax
call get_token
cmp ax, VARIABLE
je .address_is_var
cmp ax, NUMBER
jne .error
.address_is_num:
mov si, token
call os_string_to_int
jmp .save_data
.address_is_var:
mov al, [token]
call get_var
.save_data:
mov si, ax
mov [si], cx
jmp mainloop
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; PORT
do_port:
call get_token
mov si, token
mov di, .out_cmd
call os_string_compare
jc .do_out_cmd
mov di, .in_cmd
call os_string_compare
jc .do_in_cmd
jmp .error
.do_out_cmd:
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int ; Now AX = port number
mov dx, ax
call get_token
cmp ax, NUMBER
je .out_is_num
cmp ax, VARIABLE
je .out_is_var
jmp .error
.out_is_num:
mov si, token
call os_string_to_int
call os_port_byte_out
jmp mainloop
.out_is_var:
mov ax, 0
mov byte al, [token]
call get_var
call os_port_byte_out
jmp mainloop
.do_in_cmd:
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
mov dx, ax
call get_token
cmp ax, VARIABLE
jne .error
mov byte cl, [token]
call os_port_byte_in
mov bx, 0
mov bl, al
mov al, cl
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.out_cmd db "OUT", 0
.in_cmd db "IN", 0
; ------------------------------------------------------------------
; PRINT
do_print:
call get_token ; Get part after PRINT
cmp ax, QUOTE ; What type is it?
je .print_quote
cmp ax, VARIABLE ; Numerical variable (eg X)
je .print_var
cmp ax, STRING_VAR ; String variable (eg $1)
je .print_string_var
cmp ax, STRING ; Special keyword (eg CHR or HEX)
je .print_keyword
mov si, err_print_type ; We only print quoted strings and vars!
jmp error
.print_var:
mov ax, 0
mov byte al, [token]
call get_var ; Get its value
call os_int_to_string ; Convert to string
mov si, ax
call os_print_string
jmp .newline_or_not
.print_quote: ; If it's quoted text, print it
mov si, token
.print_quote_loop:
lodsb
cmp al, 0
je .newline_or_not
mov ah, 09h
mov byte bl, [ink_colour]
mov byte bh, [work_page]
mov cx, 1
int 10h
mov ah, 3
int 10h
cmp dl, 79
jge .quote_newline
inc dl
.move_cur_quote:
mov byte bh, [work_page]
mov ah, 02h
int 10h
jmp .print_quote_loop
.quote_newline:
cmp dh, 24
je .move_cur_quote
mov dl, 0
inc dh
jmp .move_cur_quote
.print_string_var:
mov si, string_vars
mov ax, 128
mul bx
add si, ax
jmp .print_quote_loop
.print_keyword:
mov si, token
mov di, chr_keyword
call os_string_compare
jc .is_chr
mov di, hex_keyword
call os_string_compare
jc .is_hex
mov si, err_syntax
jmp error
.is_chr:
call get_token
cmp ax, VARIABLE
je .is_chr_variable
cmp ax, NUMBER
je .is_chr_number
.is_chr_variable:
mov ax, 0
mov byte al, [token]
call get_var
jmp .print_chr
.is_chr_number:
mov si, token
call os_string_to_int
.print_chr:
mov ah, 09h
mov byte bl, [ink_colour]
mov byte bh, [work_page]
mov cx, 1
int 10h
mov ah, 3 ; Move the cursor forward
int 10h
inc dl
cmp dl, 79
jg .end_line ; If it's over the end of the line
.move_cur:
mov ah, 2
int 10h
jmp .newline_or_not
.is_hex:
call get_token
cmp ax, VARIABLE
jne .error
mov ax, 0
mov byte al, [token]
call get_var
call os_print_2hex
jmp .newline_or_not
.end_line:
mov dl, 0
inc dh
cmp dh, 25
jl .move_cur
mov dh, 24
mov dl, 79
jmp .move_cur
.error:
mov si, err_syntax
jmp error
.newline_or_not:
; We want to see if the command ends with ';' -- which means that
; we shouldn't print a newline after it finishes. So we store the
; current program location to pop ahead and see if there's the ';'
; character -- otherwise we put the program location back and resume
; the main loop
mov word ax, [prog]
mov word [.tmp_loc], ax
call get_token
cmp ax, UNKNOWN
jne .ignore
mov ax, 0
mov al, [token]
cmp al, ';'
jne .ignore
jmp mainloop ; And go back to interpreting the code!
.ignore:
mov ah, 5
mov al, [work_page]
int 10h
mov bh, [work_page]
call os_print_newline
mov ah, 5
mov al, [disp_page]
mov word ax, [.tmp_loc]
mov word [prog], ax
jmp mainloop
.tmp_loc dw 0
; ------------------------------------------------------------------
; RAND
do_rand:
call get_token
cmp ax, VARIABLE
jne .error
mov byte al, [token]
mov byte [.tmp], al
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
mov word [.num1], ax
call get_token
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
mov word [.num2], ax
mov word ax, [.num1]
mov word bx, [.num2]
call os_get_random
mov bx, cx
mov ax, 0
mov byte al, [.tmp]
call set_var
jmp mainloop
.tmp db 0
.num1 dw 0
.num2 dw 0
.error:
mov si, err_syntax
jmp error
; ------------------------------------------------------------------
; READ
do_read:
call get_token ; Get the next token
cmp ax, STRING ; Check for a label
je .is_ok
mov si, err_goto_notlabel
jmp error
.is_ok:
mov si, token ; Back up this label
mov di, .tmp_token
call os_string_copy
mov ax, .tmp_token
call os_string_length
mov di, .tmp_token ; Add ':' char to end for searching
add di, ax
mov al, ':'
stosb
mov al, 0
stosb
call get_token ; Now get the offset variable
cmp ax, VARIABLE
je .second_part_is_var
mov si, err_syntax
jmp error
.second_part_is_var:
mov ax, 0
mov byte al, [token]
call get_var
cmp ax, 0 ; Want to be searching for at least the first byte!
jg .var_bigger_than_zero
mov si, err_syntax
jmp error
.var_bigger_than_zero:
mov word [.to_skip], ax
call get_token ; And now the var to store result into
cmp ax, VARIABLE
je .third_part_is_var
mov si, err_syntax
jmp error
.third_part_is_var: ; Keep it for later
mov ax, 0
mov byte al, [token]
mov byte [.var_to_use], al
; OK, so now we have all the stuff we need. Let's search for the label
mov word ax, [prog] ; Store current location
mov word [.curr_location], ax
mov word ax, [load_point]
mov word [prog], ax ; Return to start of program to find label
.loop:
call get_token
cmp ax, LABEL
jne .line_loop
mov si, token
mov di, .tmp_token
call os_string_compare
jc .found_label
.line_loop: ; Go to end of line
mov word si, [prog]
mov byte al, [si]
inc word [prog]
cmp al, 10
jne .line_loop
mov word ax, [prog]
mov word bx, [prog_end]
cmp ax, bx
jg .past_end
jmp .loop
.past_end:
mov si, err_label_notfound
jmp error
.found_label:
mov word cx, [.to_skip] ; Skip requested number of data entries
.data_skip_loop:
push cx
call get_token
pop cx
loop .data_skip_loop
cmp ax, NUMBER
je .data_is_num
mov si, err_syntax
jmp error
.data_is_num:
mov si, token
call os_string_to_int
mov bx, ax
mov ax, 0
mov byte al, [.var_to_use]
call set_var
mov word ax, [.curr_location]
mov word [prog], ax
jmp mainloop
.curr_location dw 0
.to_skip dw 0
.var_to_use db 0
.tmp_token times 30 db 0
; ------------------------------------------------------------------
; REM
do_rem:
mov word si, [prog]
mov byte al, [si]
inc word [prog]
cmp al, 10 ; Find end of line after REM
jne do_rem
jmp mainloop
; ------------------------------------------------------------------
; RENAME
do_rename:
call get_token
cmp ax, STRING_VAR ; Is it a string or a quote?
je .first_is_string
cmp ax, QUOTE
je .first_is_quote
jmp .error
.first_is_string:
mov si, string_vars ; Locate string
mov ax, 128
mul bx
add si, ax
jmp .save_file1
.first_is_quote:
mov si, token ; The location of quotes is provided
.save_file1:
mov word di, .file1 ; The filename is saved to temporary strings because
call os_string_copy ; getting a second quote will overwrite the previous
.get_second:
call get_token
cmp ax, STRING_VAR
je .second_is_string
cmp ax, QUOTE
je .second_is_quote
jmp .error
.second_is_string:
mov si, string_vars ; Locate second string
mov ax, 128
mul bx
add si, ax
jmp .save_file2
.second_is_quote:
mov si, token
.save_file2:
mov word di, .file2
call os_string_copy
.check_exists:
mov word ax, .file1 ; Check if the source file exists
call os_file_exists
jc .file_not_found ; If it doesn't exists set "R = 1"
clc
mov ax, .file2 ; The second file is the destination and should not exist
call os_file_exists
jnc .file_exists ; If it exists set "R = 3"
.rename:
mov word ax, .file1 ; Seem to be okay, lets rename
mov word bx, .file2
call os_rename_file
jc .rename_failed ; If it failed set "R = 2", usually caused by a read-only disk
mov ax, 0 ; It worked sucessfully, so set "R = 0" to indicate no error
mov byte al, 'R'
mov bx, 0
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.file_not_found:
mov ax, 0 ; Set R variable to 1
mov byte al, 'R'
mov bx, 1
call set_var
jmp mainloop
.rename_failed:
mov ax, 0 ; Set R variable to 2
mov byte al, 'R'
mov bx, 2
call set_var
jmp mainloop
.file_exists:
mov ax, 0
mov byte al, 'R' ; Set R variable to 3
mov bx, 3
call set_var
jmp mainloop
.data:
.file1 times 12 db 0
.file2 times 12 db 0
; ------------------------------------------------------------------
; RETURN
do_return:
mov ax, 0
mov byte al, [gosub_depth]
cmp al, 0
jne .is_ok
mov si, err_return
jmp error
.is_ok:
mov si, gosub_points
add si, ax ; Table is words (not bytes)
add si, ax
lodsw
mov word [prog], ax
dec byte [gosub_depth]
jmp mainloop
; ------------------------------------------------------------------
; SAVE
do_save:
call get_token
cmp ax, QUOTE
je .is_quote
cmp ax, STRING_VAR
jne near .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
jmp .get_position
.is_quote:
mov si, token
.get_position:
mov di, .tmp_filename
call os_string_copy
call get_token
cmp ax, VARIABLE
je .second_is_var
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
.set_data_loc:
mov word [.data_loc], ax
call get_token
cmp ax, VARIABLE
je .third_is_var
cmp ax, NUMBER
jne .error
mov si, token
call os_string_to_int
.check_exists:
mov word [.data_size], ax
mov word ax, .tmp_filename
call os_file_exists
jc .write_file
jmp .file_exists_fail
.write_file:
mov word ax, .tmp_filename
mov word bx, [.data_loc]
mov word cx, [.data_size]
call os_write_file
jc .save_failure
mov ax, 0
mov byte al, 'R'
mov bx, 0
call set_var
jmp mainloop
.second_is_var:
mov ax, 0
mov byte al, [token]
call get_var
jmp .set_data_loc
.third_is_var:
mov ax, 0
mov byte al, [token]
call get_var
jmp .check_exists
.file_exists_fail:
mov ax, 0
mov byte al, 'R'
mov bx, 2
call set_var
jmp mainloop
.save_failure:
mov ax, 0
mov byte al, 'R'
mov bx, 1
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.filename_loc dw 0
.data_loc dw 0
.data_size dw 0
.tmp_filename times 15 db 0
; ------------------------------------------------------------------
; SERIAL
do_serial:
call get_token
mov si, token
mov di, .on_cmd
call os_string_compare
jc .do_on_cmd
mov di, .send_cmd
call os_string_compare
jc .do_send_cmd
mov di, .rec_cmd
call os_string_compare
jc .do_rec_cmd
jmp .error
.do_on_cmd:
call get_token
cmp ax, NUMBER
je .do_on_cmd_ok
jmp .error
.do_on_cmd_ok:
mov si, token
call os_string_to_int
cmp ax, 1200
je .on_cmd_slow_mode
cmp ax, 9600
je .on_cmd_fast_mode
jmp .error
.on_cmd_fast_mode:
mov ax, 0
call os_serial_port_enable
jmp mainloop
.on_cmd_slow_mode:
mov ax, 1
call os_serial_port_enable
jmp mainloop
.do_send_cmd:
call get_token
cmp ax, NUMBER
je .send_number
cmp ax, VARIABLE
je .send_variable
jmp .error
.send_number:
mov si, token
call os_string_to_int
call os_send_via_serial
jmp mainloop
.send_variable:
mov ax, 0
mov byte al, [token]
call get_var
call os_send_via_serial
jmp mainloop
.do_rec_cmd:
call get_token
cmp ax, VARIABLE
jne .error
mov byte al, [token]
mov cx, 0
mov cl, al
call os_get_via_serial
mov bx, 0
mov bl, al
mov al, cl
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.on_cmd db "ON", 0
.send_cmd db "SEND", 0
.rec_cmd db "REC", 0
; ------------------------------------------------------------------
; SIZE
do_size:
call get_token
cmp ax, STRING_VAR
je .is_string
cmp ax, QUOTE
je .is_quote
jmp .error
.is_string:
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov ax, si
jmp .get_size
.is_quote:
mov ax, token
.get_size:
call os_get_file_size
jc .file_not_found
mov ax, 0
mov al, 'S'
call set_var
mov ax, 0
mov al, 'R'
mov bx, 0
call set_var
jmp mainloop
.error:
mov si, err_syntax
jmp error
.file_not_found:
mov ax, 0
mov al, [token]
mov bx, 0
call set_var
mov ax, 0
mov al, 'R'
mov bx, 1
call set_var
jmp mainloop
; ------------------------------------------------------------------
; SOUND
do_sound:
call get_token
cmp ax, VARIABLE
je .first_is_var
mov si, token
call os_string_to_int
jmp .done_first
.first_is_var:
mov ax, 0
mov byte al, [token]
call get_var
.done_first:
call os_speaker_tone
call get_token
cmp ax, VARIABLE
je .second_is_var
mov si, token
call os_string_to_int
jmp .finish
.second_is_var:
mov ax, 0
mov byte al, [token]
call get_var
.finish:
call os_pause
call os_speaker_off
jmp mainloop
;-------------------------------------------------------------------
; STRING
do_string:
call get_token ; The first parameter is the word 'GET', 'SET', LOAD or SAVE
mov si, token
mov di, .get_cmd
call os_string_compare
jc .set_str
mov di, .set_cmd
call os_string_compare
jc .get_str
mov di, .load_cmd
call os_string_compare
jc .load_str
mov di, .save_cmd
call os_string_compare
jc .save_str
jmp .error
.set_str:
mov cx, 1
jmp .check_second
.get_str:
mov cx, 2
jmp .check_second
.load_str:
mov cx, 3
jmp .check_second
.save_str:
mov cx, 4
.check_second:
call get_token ; The next should be a string variable, locate it
cmp ax, STRING_VAR
jne .error
mov si, string_vars
mov ax, 128
mul bx
add si, ax
mov word [.string_loc], si
.check_third:
call get_token ; Now there should be a number
cmp ax, NUMBER
je .third_is_number
cmp ax, VARIABLE
je .third_is_variable
jmp .error
.third_is_number:
mov si, token
call os_string_to_int
jmp .got_number
.third_is_variable:
mov ah, 0
mov al, [token]
call get_var
jmp .got_number
.got_number:
cmp ax, 128
jg .outrange
cmp ax, 0
je .outrange
sub ax, 1
mov dx, ax
cmp cx, 3 ; load/save only need two variables
je .load_var
cmp cx, 4
je .save_var
.check_forth:
call get_token ; Next a numerical variable
cmp ax, VARIABLE
jne .error
mov byte al, [token]
mov byte [.tmp], al
cmp cx, 2
je .set_var
.get_var:
mov word si, [.string_loc] ; Move to string location
add si, dx ; Add offset
lodsb ; Load data
mov ah, 0
mov bx, ax ; Set data in numerical variable
mov byte al, [.tmp]
call set_var
jmp mainloop
.set_var:
mov byte al, [.tmp] ; Retrieve the variable
call get_var ; Get it's value
mov di, [.string_loc] ; Locate the string
add di, dx ; Add the offset
stosb ; Store data
jmp mainloop
.load_var:
inc dx
mov si, dx
mov di, [.string_loc]
call os_string_copy
jmp mainloop
.save_var:
inc dx
mov si, [.string_loc]
mov di, dx
call os_string_copy
jmp mainloop
.error:
mov si, err_syntax
jmp error
.outrange:
mov dx, ax
dec dx
cmp cx, 3
je .load_var
cmp cx, 4
je .save_var
mov si, err_string_range
jmp error
.data:
.get_cmd db "GET", 0
.set_cmd db "SET", 0
.load_cmd db "LOAD", 0
.save_cmd db "STORE", 0
.string_loc dw 0
.tmp db 0
; ------------------------------------------------------------------
; WAITKEY
do_waitkey:
call get_token
cmp ax, VARIABLE
je .is_variable
mov si, err_syntax
jmp error
.is_variable:
mov ax, 0
mov byte al, [token]
push ax
call os_wait_for_key
cmp ax, 48E0h
je .up_pressed
cmp ax, 50E0h
je .down_pressed
cmp ax, 4BE0h
je .left_pressed
cmp ax, 4DE0h
je .right_pressed
.store:
mov bx, 0
mov bl, al
pop ax
call set_var
jmp mainloop
.up_pressed:
mov ax, 1
jmp .store
.down_pressed:
mov ax, 2
jmp .store
.left_pressed:
mov ax, 3
jmp .store
.right_pressed:
mov ax, 4
jmp .store
; ==================================================================
; INTERNAL ROUTINES FOR INTERPRETER
; ------------------------------------------------------------------
; Get value of variable character specified in AL (eg 'A')
get_var:
mov ah, 0
sub al, 65
mov si, variables
add si, ax
add si, ax
lodsw
ret
; ------------------------------------------------------------------
; Set value of variable character specified in AL (eg 'A')
; with number specified in BX
set_var:
mov ah, 0
sub al, 65 ; Remove ASCII codes before 'A'
mov di, variables ; Find position in table (of words)
add di, ax
add di, ax
mov ax, bx
stosw
ret
; ------------------------------------------------------------------
; Get token from current position in prog
get_token:
mov word si, [prog]
lodsb
cmp al, 10
je .newline
cmp al, ' '
je .newline
call is_number
jc get_number_token
cmp al, '"'
je get_quote_token
cmp al, 39 ; Quote mark (')
je get_char_token
cmp al, '$'
je near get_string_var_token
jmp get_string_token
.newline:
inc word [prog]
jmp get_token
get_number_token:
mov word si, [prog]
mov di, token
.loop:
lodsb
cmp al, 10
je .done
cmp al, ' '
je .done
call is_number
jc .fine
mov si, err_char_in_num
jmp error
.fine:
stosb
inc word [prog]
jmp .loop
.done:
mov al, 0 ; Zero-terminate the token
stosb
mov ax, NUMBER ; Pass back the token type
ret
get_char_token:
inc word [prog] ; Move past first quote (')
mov word si, [prog]
lodsb
mov byte [token], al
lodsb
cmp al, 39 ; Needs to finish with another quote
je .is_ok
mov si, err_quote_term
jmp error
.is_ok:
inc word [prog]
inc word [prog]
mov ax, CHAR
ret
get_quote_token:
inc word [prog] ; Move past first quote (") char
mov word si, [prog]
mov di, token
.loop:
lodsb
cmp al, '"'
je .done
cmp al, 10
je .error
stosb
inc word [prog]
jmp .loop
.done:
mov al, 0 ; Zero-terminate the token
stosb
inc word [prog] ; Move past final quote
mov ax, QUOTE ; Pass back token type
ret
.error:
mov si, err_quote_term
jmp error
get_string_var_token:
lodsb
mov bx, 0 ; If it's a string var, pass number of string in BX
mov bl, al
sub bl, 49
inc word [prog]
inc word [prog]
mov ax, STRING_VAR
ret
get_string_token:
mov word si, [prog]
mov di, token
.loop:
lodsb
cmp al, 10
je .done
cmp al, ' '
je .done
stosb
inc word [prog]
jmp .loop
.done:
mov al, 0 ; Zero-terminate the token
stosb
mov ax, token
call os_string_uppercase
mov ax, token
call os_string_length ; How long was the token?
cmp ax, 1 ; If 1 char, it's a variable or delimiter
je .is_not_string
mov si, token ; If the token ends with ':', it's a label
add si, ax
dec si
lodsb
cmp al, ':'
je .is_label
mov ax, STRING ; Otherwise it's a general string of characters
ret
.is_label:
mov ax, LABEL
ret
.is_not_string:
mov byte al, [token]
call is_letter
jc .is_var
mov ax, UNKNOWN
ret
.is_var:
mov ax, VARIABLE ; Otherwise probably a variable
ret
; ------------------------------------------------------------------
; Set carry flag if AL contains ASCII number
is_number:
cmp al, 48
jl .not_number
cmp al, 57
jg .not_number
stc
ret
.not_number:
clc
ret
; ------------------------------------------------------------------
; Set carry flag if AL contains ASCII letter
is_letter:
cmp al, 65
jl .not_letter
cmp al, 90
jg .not_letter
stc
ret
.not_letter:
clc
ret
; ------------------------------------------------------------------
; Print error message and quit out
error:
mov ah, 5 ; Revert display page
mov al, 0
int 10h
mov byte [work_page], 0
mov byte [disp_page], 0
call os_print_newline
call os_print_string ; Print error message
mov si, line_num_starter
call os_print_string
; And now print the line number where the error occurred. We do this
; by working from the start of the program to the current point,
; counting the number of newline characters along the way
mov word si, [load_point]
mov word bx, [prog]
mov cx, 1
.loop:
lodsb
cmp al, 10
jne .not_newline
inc cx
.not_newline:
cmp si, bx
je .finish
jmp .loop
.finish:
mov ax, cx
call os_int_to_string
mov si, ax
call os_print_string
call os_print_newline
mov word sp, [orig_stack] ; Restore the stack to as it was when BASIC started
ret ; And finish
; Error messages text...
err_char_in_num db "Error: unexpected char in number", 0
err_cmd_unknown db "Error: unknown command", 0
err_divide_by_zero db "Error: attempt to divide by zero", 0
err_doloop_maximum db "Error: DO/LOOP nesting limit exceeded", 0
err_file_notfound db "Error: file not found", 0
err_goto_notlabel db "Error: GOTO or GOSUB not followed by label", 0
err_label_notfound db "Error: label not found", 0
err_nest_limit db "Error: FOR or GOSUB nest limit exceeded", 0
err_next db "Error: NEXT without FOR", 0
err_loop db "Error: LOOP without DO", 0
err_print_type db "Error: PRINT not followed by quoted text or variable", 0
err_quote_term db "Error: quoted string or char not terminated correctly", 0
err_return db "Error: RETURN without GOSUB", 0
err_string_range db "Error: string location out of range", 0
err_syntax db "Error: syntax error", 0
err_break db "BREAK CALLED", 0
line_num_starter db " - line ", 0
; ==================================================================
; DATA SECTION
orig_stack dw 0 ; Original stack location when BASIC started
prog dw 0 ; Pointer to current location in BASIC code
prog_end dw 0 ; Pointer to final byte of BASIC code
load_point dw 0
token_type db 0 ; Type of last token read (eg NUMBER, VARIABLE)
token times 255 db 0 ; Storage space for the token
vars_loc:
variables times 26 dw 0 ; Storage space for variables A to Z
for_variables times 26 dw 0 ; Storage for FOR loops
for_code_points times 26 dw 0 ; Storage for code positions where FOR loops start
do_loop_store times 10 dw 0 ; Storage for DO loops
loop_in db 0 ; Loop level
last_if_true db 1 ; Checking for 'ELSE'
ink_colour db 0 ; Text printing colour
work_page db 0 ; Page to print to
disp_page db 0 ; Page to display
alert_cmd db "ALERT", 0
askfile_cmd db "ASKFILE", 0
break_cmd db "BREAK", 0
call_cmd db "CALL", 0
case_cmd db "CASE", 0
cls_cmd db "CLS", 0
cursor_cmd db "CURSOR", 0
curschar_cmd db "CURSCHAR", 0
curscol_cmd db "CURSCOL", 0
curspos_cmd db "CURSPOS", 0
delete_cmd db "DELETE", 0
do_cmd db "DO", 0
else_cmd db "ELSE", 0
end_cmd db "END", 0
files_cmd db "FILES", 0
for_cmd db "FOR", 0
gosub_cmd db "GOSUB", 0
goto_cmd db "GOTO", 0
getkey_cmd db "GETKEY", 0
if_cmd db "IF", 0
include_cmd db "INCLUDE", 0
ink_cmd db "INK", 0
input_cmd db "INPUT", 0
len_cmd db "LEN", 0
listbox_cmd db "LISTBOX", 0
load_cmd db "LOAD", 0
loop_cmd db "LOOP", 0
move_cmd db "MOVE", 0
next_cmd db "NEXT", 0
number_cmd db "NUMBER", 0
page_cmd db "PAGE", 0
pause_cmd db "PAUSE", 0
peek_cmd db "PEEK", 0
peekint_cmd db "PEEKINT", 0
poke_cmd db "POKE", 0
pokeint_cmd db "POKEINT", 0
port_cmd db "PORT", 0
print_cmd db "PRINT", 0
rand_cmd db "RAND", 0
read_cmd db "READ", 0
rem_cmd db "REM", 0
rename_cmd db "RENAME", 0
return_cmd db "RETURN", 0
save_cmd db "SAVE", 0
serial_cmd db "SERIAL", 0
size_cmd db "SIZE", 0
sound_cmd db "SOUND", 0
string_cmd db "STRING", 0
waitkey_cmd db "WAITKEY", 0
and_keyword db "AND", 0
then_keyword db "THEN", 0
chr_keyword db "CHR", 0
hex_keyword db "HEX", 0
lower_keyword db "LOWER", 0
upper_keyword db "UPPER", 0
ink_keyword db "INK", 0
progstart_keyword db "PROGSTART", 0
ramstart_keyword db "RAMSTART", 0
timer_keyword db "TIMER", 0
variables_keyword db "VARIABLES", 0
version_keyword db "VERSION", 0
gosub_depth db 0
gosub_points times 10 dw 0 ; Points in code to RETURN to
string_vars times 1024 db 0 ; 8 * 128 byte strings
; ------------------------------------------------------------------
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "Phase2Cmp.h"
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
Phase2Cmp::Phase2Cmp(Phase2Cmp&& other) noexcept : phase1(other.phase1), logSrv{other.logSrv} {
std::cout << "Move constructor Phase2aCmp called\n";
other.phase1 = nullptr;
other.logSrv = nullptr;
}
void Phase2Cmp::setPhase1(IPhase1* p1) {
std::cout << "setting phase1 for phase2\n";
this->phase1 = p1;
}
void Phase2Cmp::setLogService(const celix_log_service_t* ls) {
this->logSrv = ls;
}
double Phase2Cmp::getData() {
if (this->logSrv != nullptr) {
this->logSrv->info(this->logSrv->handle, (char *) "getting data from phase2cmp A\n");
}
return phase1->getData() * 42.0;
}
void Phase2Cmp::setName(srv::info::IName *name) {
std::cout << "Setting IName with name: " << (name != nullptr ? name->getName() : "null") << std::endl;
};
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rbp
push %rbx
push %rcx
// Store
mov $0x66, %rcx
nop
nop
xor %r11, %r11
mov $0x5152535455565758, %rbx
movq %rbx, (%rcx)
nop
nop
and %r8, %r8
// Faulty Load
lea addresses_UC+0x1c666, %rbp
nop
nop
cmp %r13, %r13
movb (%rbp), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_P', 'AVXalign': False, 'size': 8}}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file CreateCapillaryPressureModel.cpp
*
* Created on November 1, 2016, 10:06 AM
*/
#include "CreateCapillaryPressureModel.h"
#include "BaseLib/ConfigTree.h"
#include "BaseLib/Error.h"
#include "MathLib/Curve/CreatePiecewiseLinearCurve.h"
#include "MathLib/Curve/PiecewiseLinearMonotonicCurve.h"
#include "BrooksCoreyCapillaryPressureSaturation.h"
#include "CapillaryPressureSaturation.h"
#include "CapillaryPressureSaturationCurve.h"
#include "VanGenuchtenCapillaryPressureSaturation.h"
namespace MaterialLib
{
namespace PorousMedium
{
/**
\param config ConfigTree object which contains the input data
including `<type>BrooksCorey</type>`
and it has a tag of `<capillary_pressure>`
*/
static std::unique_ptr<CapillaryPressureSaturation> createBrooksCorey(
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{material__porous_medium__capillary_pressure__type}
config.checkConfigParameter("type", "BrooksCorey");
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__pd}
const auto pd = config.getConfigParameter<double>("pd");
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__sr}
const auto Sr = config.getConfigParameter<double>("sr");
double Sg_r = 0.0;
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__sg_r}
if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r"))
{
DBUG(
"Using value %g for nonwetting phase residual saturation in "
"capillary pressure model.",
(*Sg_r_ptr));
Sg_r = *Sg_r_ptr;
}
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__smax}
const auto Smax = config.getConfigParameter<double>("smax");
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__m}
const auto m = config.getConfigParameter<double>("m");
if (m < 1.0) // m >= 1
{
OGS_FATAL(
"The exponent parameter of BrooksCorey capillary pressure "
"saturation model, m, must not be smaller than 1");
}
//! \ogs_file_param{material__porous_medium__capillary_pressure__BrooksCorey__pc_max}
const auto Pc_max = config.getConfigParameter<double>("pc_max");
return std::make_unique<BrooksCoreyCapillaryPressureSaturation>(
pd, Sr, Sg_r, Smax, m, Pc_max);
}
/**
\param config ConfigTree object which contains the input data
including `<type>vanGenuchten</type>`
and it has a tag of `<capillary_pressure>`
*/
static std::unique_ptr<CapillaryPressureSaturation> createVanGenuchten(
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{material__porous_medium__capillary_pressure__type}
config.checkConfigParameter("type", "vanGenuchten");
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__pd}
const auto pd = config.getConfigParameter<double>("pd");
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__sr}
const auto Sr = config.getConfigParameter<double>("sr");
double Sg_r = 0.0;
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__sg_r}
if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r"))
{
DBUG(
"Using value %g for nonwetting phase residual saturation in "
"capillary pressure model.",
(*Sg_r_ptr));
Sg_r = *Sg_r_ptr;
}
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__smax}
const auto Smax = config.getConfigParameter<double>("smax");
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__m}
const auto m = config.getConfigParameter<double>("m");
if (m < 0. || m > 1.0)
{
OGS_FATAL(
"The exponent parameter of van Genuchten capillary pressure "
"saturation model, m, must be in an interval of [0, 1]");
}
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__pc_max}
const auto Pc_max = config.getConfigParameter<double>("pc_max");
bool has_regularized = false;
if (auto const has_regularized_conf =
//! \ogs_file_param{material__porous_medium__capillary_pressure__vanGenuchten__has_regularized}
config.getConfigParameterOptional<bool>("has_regularized"))
{
DBUG("capillary pressure model: %s",
(*has_regularized_conf) ? "true" : "false");
has_regularized = *has_regularized_conf;
}
return std::make_unique<VanGenuchtenCapillaryPressureSaturation>(
pd, Sr, Sg_r, Smax, m, Pc_max, has_regularized);
}
std::unique_ptr<CapillaryPressureSaturation> createCapillaryPressureModel(
BaseLib::ConfigTree const& config)
{
//! \ogs_file_param{material__porous_medium__capillary_pressure__type}
auto const type = config.peekConfigParameter<std::string>("type");
if (type == "BrooksCorey")
{
return createBrooksCorey(config);
}
if (type == "vanGenuchten")
{
return createVanGenuchten(config);
}
if (type == "Curve")
{
//! \ogs_file_param{material__porous_medium__capillary_pressure__type}
config.checkConfigParameter("type", "Curve");
//! \ogs_file_param{material__porous_medium__capillary_pressure__Curve__curve}
auto const& curve_config = config.getConfigSubtree("curve");
auto curve = MathLib::createPiecewiseLinearCurve<
MathLib::PiecewiseLinearMonotonicCurve>(curve_config);
return std::make_unique<CapillaryPressureSaturationCurve>(
std::move(curve));
}
OGS_FATAL(
"The capillary pressure saturation models %s are unavailable.\n"
"The available types are: \n\tBrooksCorey, \n\tvanGenuchten,",
"\n\tCurve.\n",
type.data());
}
} // end namespace
} // end namespace
|
// Minimal example program generating two long jumps
// Commodore 64 PRG executable file
.file [name="longjump2.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: {
// long1()
jsr long1
// long2()
jsr long2
// }
rts
}
long1: {
.label SCREEN = $400
ldx #0
__b1:
// asm
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
// SCREEN[i] = i
txa
sta SCREEN,x
// for(byte i : 0..10)
inx
cpx #$b
beq !__b1+
jmp __b1
!__b1:
// }
rts
}
long2: {
.label SCREEN = $400
ldx #0
__b1:
// asm
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
// SCREEN[i] = i
txa
sta SCREEN,x
// for(byte i : 0..10)
inx
cpx #$b
beq !__b1+
jmp __b1
!__b1:
// }
rts
}
|
PokemonFanClub_h:
db INTERIOR ; tileset
db POKEMON_FAN_CLUB_HEIGHT, POKEMON_FAN_CLUB_WIDTH ; dimensions (y, x)
dw PokemonFanClub_Blocks ; blocks
dw PokemonFanClub_TextPointers ; texts
dw PokemonFanClub_Script ; scripts
db 0 ; connections
dw PokemonFanClub_Object ; objects
|
; A010954: Binomial coefficient C(38,n).
; 1,38,703,8436,73815,501942,2760681,12620256,48903492,163011640,472733756,1203322288,2707475148,5414950296,9669554100,15471286560,22239974430,28781143380,33578000610,35345263800,33578000610,28781143380,22239974430,15471286560,9669554100,5414950296,2707475148,1203322288,472733756,163011640,48903492,12620256,2760681,501942,73815,8436,703,38,1
mov $1,38
bin $1,$0
|
; Upper Case Conversion (Ucase.asm)
; This program tests the Str_ucase procedure, which converts
; the letters in a string to uppercase.
INCLUDE Irvine32.inc
Str_ucase PROTO,
pString:PTR BYTE
.data
string_1 BYTE "abcdef",0
string_2 BYTE "aB234cdEfg",0
string_3 BYTE 0
.code
main PROC
call Clrscr
INVOKE Str_ucase,ADDR string_1
INVOKE Str_ucase,ADDR string_2
INVOKE Str_ucase,ADDR string_3
exit
main ENDP
END main |
; A013830: a(n) = 4^(5*n + 1).
; 4,4096,4194304,4294967296,4398046511104,4503599627370496,4611686018427387904,4722366482869645213696,4835703278458516698824704,4951760157141521099596496896,5070602400912917605986812821504,5192296858534827628530496329220096
mul $0,5
add $0,1
mov $1,4
pow $1,$0
mov $0,$1
|
#include "Hook.h"
#include "../SGD Wrappers/SGD_GraphicsManager.h"
#include "../SGD Wrappers/SGD_AudioManager.h"
#include "DestroyEntityMessage.h"
#include "Game.h"
#include "GamePlayState.h"
#include "LevelManager.h"
#include "ImmovableBox.h"
#include "MovableBox.h"
#include "Zombie.h"
#include "Player.h"
#include "Lever.h"
#include "Room.h"
Hook::Hook(SGD::Point position, float rotation, Entity* owner) : Bullet(position, rotation, owner)
{
if (owner != nullptr)
{
Player* player = dynamic_cast<Player*>(owner);
SetSpeed(250 * (float)player->GetHookLevel());
m_hImage = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/graphics/grapplingHook.png");
m_Rope = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/graphics/SkinnyRope.png");
SetSize({ 16, 16 });
m_Box = nullptr;
}
else
SetSize({ 32, 32 });
SGD::Vector newVel = { 0, 1 };
newVel.Rotate(rotation);
newVel *= GetSpeed();
SetVelocity(newVel);
SetPosition({ position.x - GetSize().width / 2, position.y - GetSize().height / 2 });
}
Hook::~Hook()
{
SGD::GraphicsManager::GetInstance()->UnloadTexture(m_hImage);
SGD::GraphicsManager::GetInstance()->UnloadTexture(m_Rope);
}
/*virtual*/ void Hook::Update(float elapsedTime) /*override;*/
{
SGD::Rectangle rect = Game::GetInstance()->GetWorldCamera();
SGD::Point point = GetRect().ComputeCenter() + GetVelocity()*elapsedTime;
if (GetOwner() != nullptr)
{
Player* player = (Player*)GetOwner();
if (m_Box != nullptr && m_Box->GetType() != ENT_ZOMBIE)
m_lifeTimer -= elapsedTime;
if (((GetOwner()->GetPosition() - GetPosition()).ComputeLength() > 150 * player->GetHookLevel()) || m_lifeTimer <= 0 ||
CheckCollision(GetPosition() + GetVelocity()*elapsedTime) || !rect.IsPointInRectangle(point))
{
if (m_Box != nullptr && m_Box->GetType() == ENT_IMMOVABLE)
{
ImmovableBox* box = (ImmovableBox*)m_Box;
box->SetHook(nullptr);
}
DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
pMsg->QueueMessage();
pMsg = nullptr;
}
Entity::Update(elapsedTime);
}
}
/*virtual*/ void Hook::Render(void) /*override;*/
{
if (GetOwner() != nullptr)
SGD::GraphicsManager::GetInstance()->DrawTextureSection(m_Rope, GetOwner()->GetPositionInWorldSpace(),
{ 0, 0, (GetOwner()->GetPosition() - GetPosition()).ComputeLength(), 8 }, GetRotation() + SGD::PI / 2, {}, {}, { 1.0f, 0.5f });
if (GetOwner() != nullptr)
SGD::GraphicsManager::GetInstance()->DrawTexture(m_hImage, GetPositionInWorldSpace(), GetRotation(), GetSize() / 2, {}, { 1.0f, 1.0f });
else
SGD::GraphicsManager::GetInstance()->DrawTexture(m_hImage, { GetPositionInWorldSpace().x - 32, GetPositionInWorldSpace().y - 25 }, GetRotation(), {}, {}, { 0.3f, 0.3f });
}
/*virtual*/ void Hook::HandleCollision(const IEntity* pOther) /*override;*/
{
float rotate = 0;
if (pOther->GetType() == ENT_MOVABLE)
{
if (m_Box == nullptr)
{
if (GetRotation() == SGD::PI)
rotate = 0;
else if (GetRotation() == 0)
rotate = SGD::PI;
else if (GetRotation() == (3 * SGD::PI) / 2)
rotate = SGD::PI / 2;
else if (GetRotation() == SGD::PI / 2)
rotate = (3 * SGD::PI) / 2;
SGD::Vector newVel = { 0, 1 };
newVel.Rotate(rotate);
newVel *= GetSpeed();
SetVelocity(newVel);
m_Box = (IEntity*)pOther;
}
}
else if (pOther->GetType() == ENT_PLAYER)
{
if (m_Box != nullptr || GetOwner() == nullptr)
{
Player* player = (Player*)pOther;
if (!player->HaveHook())
{
GamePlayState::GetInstance()->CreatMessage(GamePlayState::GetInstance()->_HookBox);
player->PlayPickupSound();
player->SetHaveHook(true);
}
else if (player->IsBeingPulled())
player->SetBeingPulled(false);
DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
pMsg->QueueMessage();
pMsg = nullptr;
}
}
else if (pOther->GetType() == ENT_IMMOVABLE)
{
if (pOther != m_Box)
{
SetVelocity({ 0, 0 });
m_Box = (IEntity*)pOther;
}
}
else if (pOther->GetType() == ENT_PIZZA)
{
if (pOther != m_Box)
{
m_Box = nullptr;
DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
pMsg->QueueMessage();
pMsg = nullptr;
}
}
else if (pOther->GetType() == ENT_LEVER)
{
Lever* lever = (Lever*)pOther;
if (m_Lever != lever)
{
if (lever->GetActive() == true)
{
lever->TurnOff();
lever->PlayOffSound();
}
else
{
lever->PlayOnSound();
lever->TurnOn();
}
SGD::Event* activ = new SGD::Event("PUZZLE_OBJECT_ACTIVATED", nullptr, lever);
activ->QueueEvent();
activ = nullptr;
DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
pMsg->QueueMessage();
pMsg = nullptr;
m_Lever = lever;
}
}
else if (pOther->GetType() == ENT_ZOMBIE)
{
if (m_Box == nullptr)
{
Zombie* zomb = (Zombie*)(pOther);
if (zomb->IsArmored())
{
zomb->SetHasWon(false);
zomb->SetmovedPlayer(false);
SetVelocity({ 0, 0 });
}
else
{
DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
pMsg->QueueMessage();
pMsg = nullptr;
}
m_Box = zomb;
}
}
}
bool Hook::CheckCollision(SGD::Point point)
{
std::vector<Room*> rooms = GamePlayState::GetInstance()->GetLevelManager()->GetRooms();
for (size_t i = 0; i < rooms.size(); i++)
{
if (rooms[i]->IsPlayerHere() && rooms[i]->CheckCollision(point, this))
{
return true;
}
}
return false;
} |
; A249997: Expansion of 1/((1-x)*(1+3*x)*(1-4*x)).
; 1,2,15,40,221,702,3355,11780,52041,193402,817895,3138720,12953461,50618102,206059635,813476860,3286192481,13047914802,52482224575,209057202200,838843897101,3347530323502,13413657088715,53584020970740,214547906035321,857556157684202
add $0,2
mov $2,-9
mov $3,$0
mul $0,-9
add $3,2
mov $4,2
lpb $0
mov $1,4
add $4,$2
div $4,2
sub $0,$4
sub $3,1
pow $1,$3
pow $4,$3
sub $1,$4
mov $3,1
mov $4,-3
mul $4,$1
lpe
sub $1,89
div $1,84
add $1,1
|
#include "Libraries/Sensors/Temperature/Lm75.h"
namespace Treehopper {
namespace Libraries {
namespace Sensors {
namespace Temperature {
Lm75::Lm75(I2c &i2c, bool a0, bool a1, bool a2)
: dev((0x48 | (a0 ? 1 : 0) | ((a1 ? 1 : 0) << 1) | ((a2 ? 1 : 0) << 2)), i2c) {
}
void Lm75::update() {
auto data = dev.readWordDataBE(0x00);
_celsius = ((int16_t) data / 32.0) / 8.0;
}
}
}
}
} |
; wPrinterStatus
const_def 1
const PRINTER_STATUS_CHECKING
const PRINTER_STATUS_TRANSMITTING
const PRINTER_STATUS_PRINTING
const PRINTER_ERROR_1
const PRINTER_ERROR_2
const PRINTER_ERROR_3
const PRINTER_ERROR_4
|
db DEX_SEEL ; pokedex id
db 65 ; base hp
db 45 ; base attack
db 55 ; base defense
db 45 ; base speed
db 70 ; base special
db WATER ; species type 1
db WATER ; species type 2
db 190 ; catch rate
db 100 ; base exp yield
INCBIN "pic/ymon/seel.pic",0,1 ; 66, sprite dimensions
dw SeelPicFront
dw SeelPicBack
; attacks known at lvl 0
db HEADBUTT
db 0
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 6,7,8
tmlearn 9,10,11,12,13,14,16
tmlearn 20
tmlearn 31,32
tmlearn 34,40
tmlearn 44
tmlearn 50,53,54
db BANK(SeelPicFront)
|
/*
* Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
#include "RTdef.h"
#if RT_COMPILE
#include "FracturePattern.h"
// Empty until base has code proven to be non-portable
#endif |
/**
* \file PnlWzemUsrDetail.cpp
* API code for job PnlWzemUsrDetail (implementation)
* \copyright (C) 2016-2020 MPSI Technologies GmbH
* \author Alexander Wirthmueller (auto-generation)
* \date created: 6 Dec 2020
*/
// IP header --- ABOVE
#include "PnlWzemUsrDetail.h"
using namespace std;
using namespace Sbecore;
using namespace Xmlio;
/******************************************************************************
class PnlWzemUsrDetail::VecVDo
******************************************************************************/
uint PnlWzemUsrDetail::VecVDo::getIx(
const string& sref
) {
string s = StrMod::lc(sref);
if (s == "butsaveclick") return BUTSAVECLICK;
if (s == "butprsviewclick") return BUTPRSVIEWCLICK;
if (s == "butusgviewclick") return BUTUSGVIEWCLICK;
return(0);
};
string PnlWzemUsrDetail::VecVDo::getSref(
const uint ix
) {
if (ix == BUTSAVECLICK) return("ButSaveClick");
if (ix == BUTPRSVIEWCLICK) return("ButPrsViewClick");
if (ix == BUTUSGVIEWCLICK) return("ButUsgViewClick");
return("");
};
/******************************************************************************
class PnlWzemUsrDetail::ContIac
******************************************************************************/
PnlWzemUsrDetail::ContIac::ContIac(
const uint numFPupSte
, const uint numFPupLcl
, const uint numFPupUlv
, const string& TxfPwd
, const string& TxfFky
, const string& TxfCmt
) :
Block()
{
this->numFPupSte = numFPupSte;
this->numFPupLcl = numFPupLcl;
this->numFPupUlv = numFPupUlv;
this->TxfPwd = TxfPwd;
this->TxfFky = TxfFky;
this->TxfCmt = TxfCmt;
mask = {NUMFPUPSTE, NUMFPUPLCL, NUMFPUPULV, TXFPWD, TXFFKY, TXFCMT};
};
bool PnlWzemUsrDetail::ContIac::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContIacWzemUsrDetail");
else
basefound = checkXPath(docctx, basexpath);
string itemtag = "ContitemIacWzemUsrDetail";
if (basefound) {
if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFPupSte", numFPupSte)) add(NUMFPUPSTE);
if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFPupLcl", numFPupLcl)) add(NUMFPUPLCL);
if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFPupUlv", numFPupUlv)) add(NUMFPUPULV);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxfPwd", TxfPwd)) add(TXFPWD);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxfFky", TxfFky)) add(TXFFKY);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxfCmt", TxfCmt)) add(TXFCMT);
};
return basefound;
};
void PnlWzemUsrDetail::ContIac::writeXML(
xmlTextWriter* wr
, string difftag
, bool shorttags
) {
if (difftag.length() == 0) difftag = "ContIacWzemUsrDetail";
string itemtag;
if (shorttags) itemtag = "Ci";
else itemtag = "ContitemIacWzemUsrDetail";
xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
writeUintAttr(wr, itemtag, "sref", "numFPupSte", numFPupSte);
writeUintAttr(wr, itemtag, "sref", "numFPupLcl", numFPupLcl);
writeUintAttr(wr, itemtag, "sref", "numFPupUlv", numFPupUlv);
writeStringAttr(wr, itemtag, "sref", "TxfPwd", TxfPwd);
writeStringAttr(wr, itemtag, "sref", "TxfFky", TxfFky);
writeStringAttr(wr, itemtag, "sref", "TxfCmt", TxfCmt);
xmlTextWriterEndElement(wr);
};
set<uint> PnlWzemUsrDetail::ContIac::comm(
const ContIac* comp
) {
set<uint> items;
if (numFPupSte == comp->numFPupSte) insert(items, NUMFPUPSTE);
if (numFPupLcl == comp->numFPupLcl) insert(items, NUMFPUPLCL);
if (numFPupUlv == comp->numFPupUlv) insert(items, NUMFPUPULV);
if (TxfPwd == comp->TxfPwd) insert(items, TXFPWD);
if (TxfFky == comp->TxfFky) insert(items, TXFFKY);
if (TxfCmt == comp->TxfCmt) insert(items, TXFCMT);
return(items);
};
set<uint> PnlWzemUsrDetail::ContIac::diff(
const ContIac* comp
) {
set<uint> commitems;
set<uint> diffitems;
commitems = comm(comp);
diffitems = {NUMFPUPSTE, NUMFPUPLCL, NUMFPUPULV, TXFPWD, TXFFKY, TXFCMT};
for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
return(diffitems);
};
/******************************************************************************
class PnlWzemUsrDetail::ContInf
******************************************************************************/
PnlWzemUsrDetail::ContInf::ContInf(
const string& TxtPrs
, const string& TxtSrf
, const string& TxtUsg
) :
Block()
{
this->TxtPrs = TxtPrs;
this->TxtSrf = TxtSrf;
this->TxtUsg = TxtUsg;
mask = {TXTPRS, TXTSRF, TXTUSG};
};
bool PnlWzemUsrDetail::ContInf::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContInfWzemUsrDetail");
else
basefound = checkXPath(docctx, basexpath);
string itemtag = "ContitemInfWzemUsrDetail";
if (basefound) {
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxtPrs", TxtPrs)) add(TXTPRS);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxtSrf", TxtSrf)) add(TXTSRF);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxtUsg", TxtUsg)) add(TXTUSG);
};
return basefound;
};
set<uint> PnlWzemUsrDetail::ContInf::comm(
const ContInf* comp
) {
set<uint> items;
if (TxtPrs == comp->TxtPrs) insert(items, TXTPRS);
if (TxtSrf == comp->TxtSrf) insert(items, TXTSRF);
if (TxtUsg == comp->TxtUsg) insert(items, TXTUSG);
return(items);
};
set<uint> PnlWzemUsrDetail::ContInf::diff(
const ContInf* comp
) {
set<uint> commitems;
set<uint> diffitems;
commitems = comm(comp);
diffitems = {TXTPRS, TXTSRF, TXTUSG};
for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
return(diffitems);
};
/******************************************************************************
class PnlWzemUsrDetail::StatApp
******************************************************************************/
PnlWzemUsrDetail::StatApp::StatApp(
const uint ixWzemVExpstate
) :
Block()
{
this->ixWzemVExpstate = ixWzemVExpstate;
mask = {IXWZEMVEXPSTATE};
};
bool PnlWzemUsrDetail::StatApp::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
string srefIxWzemVExpstate;
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatAppWzemUsrDetail");
else
basefound = checkXPath(docctx, basexpath);
string itemtag = "StatitemAppWzemUsrDetail";
if (basefound) {
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "srefIxWzemVExpstate", srefIxWzemVExpstate)) {
ixWzemVExpstate = VecWzemVExpstate::getIx(srefIxWzemVExpstate);
add(IXWZEMVEXPSTATE);
};
};
return basefound;
};
set<uint> PnlWzemUsrDetail::StatApp::comm(
const StatApp* comp
) {
set<uint> items;
if (ixWzemVExpstate == comp->ixWzemVExpstate) insert(items, IXWZEMVEXPSTATE);
return(items);
};
set<uint> PnlWzemUsrDetail::StatApp::diff(
const StatApp* comp
) {
set<uint> commitems;
set<uint> diffitems;
commitems = comm(comp);
diffitems = {IXWZEMVEXPSTATE};
for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
return(diffitems);
};
/******************************************************************************
class PnlWzemUsrDetail::StatShr
******************************************************************************/
PnlWzemUsrDetail::StatShr::StatShr(
const bool ButSaveAvail
, const bool ButSaveActive
, const bool TxtPrsActive
, const bool ButPrsViewAvail
, const bool ButPrsViewActive
, const bool TxtSrfActive
, const bool TxtUsgActive
, const bool ButUsgViewAvail
, const bool ButUsgViewActive
, const bool PupSteActive
, const bool PupLclActive
, const bool PupUlvActive
, const bool TxfPwdActive
, const bool TxfFkyActive
, const bool TxfCmtActive
) :
Block()
{
this->ButSaveAvail = ButSaveAvail;
this->ButSaveActive = ButSaveActive;
this->TxtPrsActive = TxtPrsActive;
this->ButPrsViewAvail = ButPrsViewAvail;
this->ButPrsViewActive = ButPrsViewActive;
this->TxtSrfActive = TxtSrfActive;
this->TxtUsgActive = TxtUsgActive;
this->ButUsgViewAvail = ButUsgViewAvail;
this->ButUsgViewActive = ButUsgViewActive;
this->PupSteActive = PupSteActive;
this->PupLclActive = PupLclActive;
this->PupUlvActive = PupUlvActive;
this->TxfPwdActive = TxfPwdActive;
this->TxfFkyActive = TxfFkyActive;
this->TxfCmtActive = TxfCmtActive;
mask = {BUTSAVEAVAIL, BUTSAVEACTIVE, TXTPRSACTIVE, BUTPRSVIEWAVAIL, BUTPRSVIEWACTIVE, TXTSRFACTIVE, TXTUSGACTIVE, BUTUSGVIEWAVAIL, BUTUSGVIEWACTIVE, PUPSTEACTIVE, PUPLCLACTIVE, PUPULVACTIVE, TXFPWDACTIVE, TXFFKYACTIVE, TXFCMTACTIVE};
};
bool PnlWzemUsrDetail::StatShr::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatShrWzemUsrDetail");
else
basefound = checkXPath(docctx, basexpath);
string itemtag = "StatitemShrWzemUsrDetail";
if (basefound) {
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButSaveAvail", ButSaveAvail)) add(BUTSAVEAVAIL);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButSaveActive", ButSaveActive)) add(BUTSAVEACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxtPrsActive", TxtPrsActive)) add(TXTPRSACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButPrsViewAvail", ButPrsViewAvail)) add(BUTPRSVIEWAVAIL);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButPrsViewActive", ButPrsViewActive)) add(BUTPRSVIEWACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxtSrfActive", TxtSrfActive)) add(TXTSRFACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxtUsgActive", TxtUsgActive)) add(TXTUSGACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButUsgViewAvail", ButUsgViewAvail)) add(BUTUSGVIEWAVAIL);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButUsgViewActive", ButUsgViewActive)) add(BUTUSGVIEWACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "PupSteActive", PupSteActive)) add(PUPSTEACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "PupLclActive", PupLclActive)) add(PUPLCLACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "PupUlvActive", PupUlvActive)) add(PUPULVACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxfPwdActive", TxfPwdActive)) add(TXFPWDACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxfFkyActive", TxfFkyActive)) add(TXFFKYACTIVE);
if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TxfCmtActive", TxfCmtActive)) add(TXFCMTACTIVE);
};
return basefound;
};
set<uint> PnlWzemUsrDetail::StatShr::comm(
const StatShr* comp
) {
set<uint> items;
if (ButSaveAvail == comp->ButSaveAvail) insert(items, BUTSAVEAVAIL);
if (ButSaveActive == comp->ButSaveActive) insert(items, BUTSAVEACTIVE);
if (TxtPrsActive == comp->TxtPrsActive) insert(items, TXTPRSACTIVE);
if (ButPrsViewAvail == comp->ButPrsViewAvail) insert(items, BUTPRSVIEWAVAIL);
if (ButPrsViewActive == comp->ButPrsViewActive) insert(items, BUTPRSVIEWACTIVE);
if (TxtSrfActive == comp->TxtSrfActive) insert(items, TXTSRFACTIVE);
if (TxtUsgActive == comp->TxtUsgActive) insert(items, TXTUSGACTIVE);
if (ButUsgViewAvail == comp->ButUsgViewAvail) insert(items, BUTUSGVIEWAVAIL);
if (ButUsgViewActive == comp->ButUsgViewActive) insert(items, BUTUSGVIEWACTIVE);
if (PupSteActive == comp->PupSteActive) insert(items, PUPSTEACTIVE);
if (PupLclActive == comp->PupLclActive) insert(items, PUPLCLACTIVE);
if (PupUlvActive == comp->PupUlvActive) insert(items, PUPULVACTIVE);
if (TxfPwdActive == comp->TxfPwdActive) insert(items, TXFPWDACTIVE);
if (TxfFkyActive == comp->TxfFkyActive) insert(items, TXFFKYACTIVE);
if (TxfCmtActive == comp->TxfCmtActive) insert(items, TXFCMTACTIVE);
return(items);
};
set<uint> PnlWzemUsrDetail::StatShr::diff(
const StatShr* comp
) {
set<uint> commitems;
set<uint> diffitems;
commitems = comm(comp);
diffitems = {BUTSAVEAVAIL, BUTSAVEACTIVE, TXTPRSACTIVE, BUTPRSVIEWAVAIL, BUTPRSVIEWACTIVE, TXTSRFACTIVE, TXTUSGACTIVE, BUTUSGVIEWAVAIL, BUTUSGVIEWACTIVE, PUPSTEACTIVE, PUPLCLACTIVE, PUPULVACTIVE, TXFPWDACTIVE, TXFFKYACTIVE, TXFCMTACTIVE};
for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
return(diffitems);
};
/******************************************************************************
class PnlWzemUsrDetail::Tag
******************************************************************************/
PnlWzemUsrDetail::Tag::Tag(
const string& Cpt
, const string& CptPrs
, const string& CptSrf
, const string& CptUsg
, const string& CptSte
, const string& CptLcl
, const string& CptUlv
, const string& CptPwd
, const string& CptFky
, const string& CptCmt
) :
Block()
{
this->Cpt = Cpt;
this->CptPrs = CptPrs;
this->CptSrf = CptSrf;
this->CptUsg = CptUsg;
this->CptSte = CptSte;
this->CptLcl = CptLcl;
this->CptUlv = CptUlv;
this->CptPwd = CptPwd;
this->CptFky = CptFky;
this->CptCmt = CptCmt;
mask = {CPT, CPTPRS, CPTSRF, CPTUSG, CPTSTE, CPTLCL, CPTULV, CPTPWD, CPTFKY, CPTCMT};
};
bool PnlWzemUsrDetail::Tag::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "TagWzemUsrDetail");
else
basefound = checkXPath(docctx, basexpath);
string itemtag = "TagitemWzemUsrDetail";
if (basefound) {
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Cpt", Cpt)) add(CPT);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptPrs", CptPrs)) add(CPTPRS);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptSrf", CptSrf)) add(CPTSRF);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptUsg", CptUsg)) add(CPTUSG);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptSte", CptSte)) add(CPTSTE);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptLcl", CptLcl)) add(CPTLCL);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptUlv", CptUlv)) add(CPTULV);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptPwd", CptPwd)) add(CPTPWD);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptFky", CptFky)) add(CPTFKY);
if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "CptCmt", CptCmt)) add(CPTCMT);
};
return basefound;
};
/******************************************************************************
class PnlWzemUsrDetail::DpchAppData
******************************************************************************/
PnlWzemUsrDetail::DpchAppData::DpchAppData(
const string& scrJref
, ContIac* contiac
, const set<uint>& mask
) :
DpchAppWzem(VecWzemVDpch::DPCHAPPWZEMUSRDETAILDATA, scrJref)
{
if (find(mask, ALL)) this->mask = {SCRJREF, CONTIAC};
else this->mask = mask;
if (find(this->mask, CONTIAC) && contiac) this->contiac = *contiac;
};
string PnlWzemUsrDetail::DpchAppData::getSrefsMask() {
vector<string> ss;
string srefs;
if (has(SCRJREF)) ss.push_back("scrJref");
if (has(CONTIAC)) ss.push_back("contiac");
StrMod::vectorToString(ss, srefs);
return(srefs);
};
void PnlWzemUsrDetail::DpchAppData::writeXML(
xmlTextWriter* wr
) {
xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWzemUsrDetailData");
xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wzem");
if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
if (has(CONTIAC)) contiac.writeXML(wr);
xmlTextWriterEndElement(wr);
};
/******************************************************************************
class PnlWzemUsrDetail::DpchAppDo
******************************************************************************/
PnlWzemUsrDetail::DpchAppDo::DpchAppDo(
const string& scrJref
, const uint ixVDo
, const set<uint>& mask
) :
DpchAppWzem(VecWzemVDpch::DPCHAPPWZEMUSRDETAILDO, scrJref)
{
if (find(mask, ALL)) this->mask = {SCRJREF, IXVDO};
else this->mask = mask;
this->ixVDo = ixVDo;
};
string PnlWzemUsrDetail::DpchAppDo::getSrefsMask() {
vector<string> ss;
string srefs;
if (has(SCRJREF)) ss.push_back("scrJref");
if (has(IXVDO)) ss.push_back("ixVDo");
StrMod::vectorToString(ss, srefs);
return(srefs);
};
void PnlWzemUsrDetail::DpchAppDo::writeXML(
xmlTextWriter* wr
) {
xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWzemUsrDetailDo");
xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wzem");
if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
if (has(IXVDO)) writeString(wr, "srefIxVDo", VecVDo::getSref(ixVDo));
xmlTextWriterEndElement(wr);
};
/******************************************************************************
class PnlWzemUsrDetail::DpchEngData
******************************************************************************/
PnlWzemUsrDetail::DpchEngData::DpchEngData() :
DpchEngWzem(VecWzemVDpch::DPCHENGWZEMUSRDETAILDATA)
{
feedFPupLcl.tag = "FeedFPupLcl";
feedFPupSte.tag = "FeedFPupSte";
feedFPupUlv.tag = "FeedFPupUlv";
};
string PnlWzemUsrDetail::DpchEngData::getSrefsMask() {
vector<string> ss;
string srefs;
if (has(SCRJREF)) ss.push_back("scrJref");
if (has(CONTIAC)) ss.push_back("contiac");
if (has(CONTINF)) ss.push_back("continf");
if (has(FEEDFPUPLCL)) ss.push_back("feedFPupLcl");
if (has(FEEDFPUPSTE)) ss.push_back("feedFPupSte");
if (has(FEEDFPUPULV)) ss.push_back("feedFPupUlv");
if (has(STATAPP)) ss.push_back("statapp");
if (has(STATSHR)) ss.push_back("statshr");
if (has(TAG)) ss.push_back("tag");
StrMod::vectorToString(ss, srefs);
return(srefs);
};
void PnlWzemUsrDetail::DpchEngData::readXML(
xmlXPathContext* docctx
, string basexpath
, bool addbasetag
) {
clear();
bool basefound;
if (addbasetag)
basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngWzemUsrDetailData");
else
basefound = checkXPath(docctx, basexpath);
if (basefound) {
if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
if (contiac.readXML(docctx, basexpath, true)) add(CONTIAC);
if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
if (feedFPupLcl.readXML(docctx, basexpath, true)) add(FEEDFPUPLCL);
if (feedFPupSte.readXML(docctx, basexpath, true)) add(FEEDFPUPSTE);
if (feedFPupUlv.readXML(docctx, basexpath, true)) add(FEEDFPUPULV);
if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
if (statshr.readXML(docctx, basexpath, true)) add(STATSHR);
if (tag.readXML(docctx, basexpath, true)) add(TAG);
} else {
contiac = ContIac();
continf = ContInf();
feedFPupLcl.clear();
feedFPupSte.clear();
feedFPupUlv.clear();
statapp = StatApp();
statshr = StatShr();
tag = Tag();
};
};
|
; Executable name : uppercaser2
; Version : 1.0
; Created date : 3/25/2009
; Last update : 3/25/2009
; Author : Jeff Duntemann
; Description : A simple program in assembly for Linux, using NASM 2.05,
; demonstrating simple text file I/O (through redirection) for reading an
; input file to a buffer in blocks, forcing lowercase characters to
; uppercase, and writing the modified buffer to an output file.
;
; Run it this way:
; uppercaser2 > (output file) < (input file)
;
; Build using these commands:
; nasm -f elf -g -F stabs uppercaser2.asm
; ld -o uppercaser2 uppercaser2.o
;
SECTION .bss ; Section containing uninitialized data
BUFFLEN equ 1024 ; Length of buffer
Buff: resb BUFFLEN ; Text buffer itself
SECTION .data ; Section containing initialised data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
nop ; This no-op keeps gdb happy...
; Read a buffer full of text from stdin:
read:
mov eax,3 ; Specify sys_read call
mov ebx,0 ; Specify File Descriptor 0: Standard Input
mov ecx,Buff ; Pass offset of the buffer to read to
mov edx,BUFFLEN ; Pass number of bytes to read at one pass
int 80h ; Call sys_read to fill the buffer
mov esi,eax ; Copy sys_read return value for safekeeping
cmp eax,0 ; If eax=0, sys_read reached EOF on stdin
je Done ; Jump If Equal (to 0, from compare)
; Set up the registers for the process buffer step:
mov ecx,esi ; Place the number of bytes read into ecx
mov ebp,Buff ; Place address of buffer into ebp
; dec ebp ; Adjust count to offset
; Go through the buffer and convert lowercase to uppercase characters:
Scan:
cmp byte [Buff-1+ecx],61h ; Test input char against lowercase 'a'
jb Next ; If below 'a' in ASCII, not lowercase
cmp byte [Buff-1+ecx],7Ah ; Test input char against lowercase 'z'
ja Next ; If above 'z' in ASCII, not lowercase
; At this point, we have a lowercase char
sub byte [Buff-1+ecx],20h ; Subtract 20h to give uppercase...
Next: dec ecx ; Decrement counter
jnz Scan ; If characters remain, loop back
; Write the buffer full of processed text to stdout:
Write:
mov eax,4 ; Specify sys_write call
mov ebx,1 ; Specify File Descriptor 1: Standard output
mov ecx,Buff ; Pass offset of the buffer
mov edx,esi ; Pass the # of bytes of data in the buffer
int 80h ; Make kernel call
jmp read ; Loop back and load another buffer full
; All done! Let's end this party:
Done:
mov eax,1 ; Code for Exit Syscall
mov ebx,0 ; Return a code of zero
int 80H ; Make kernel call
|
;<Maximum and minimum of array>
LXI H,ARRAY
MOV B,M
MOV C,M
MVI D,SIZE
LOOP: MOV A,M
CMP B
JC MIN
MOV B,A
MIN: CMP C
JNC SKIP
MOV C,A
SKIP: INX H
DCR D
JNZ LOOP
LXI H,2000H
MOV M,B;Move maximum to 2000H
INX H
MOV M,C;Move minimum to 2001H
HLT
SIZE: EQU 10
ARRAY: db 12,4,128,3,151,1,7,9,8,18 |
;------------------------------------------------------------------------------ ;
; Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; ExceptionHandlerAsm.Asm
;
; Abstract:
;
; IA32 CPU Exception Handler
;
; Notes:
;
;------------------------------------------------------------------------------
.686
.model flat,C
;
; CommonExceptionHandler()
;
CommonExceptionHandler PROTO C
.data
EXTRN mErrorCodeFlag:DWORD ; Error code flags for exceptions
EXTRN mDoFarReturnFlag:DWORD ; Do far return flag
.code
ALIGN 8
;
; exception handler stub table
;
AsmIdtVectorBegin:
REPEAT 32
db 6ah ; push #VectorNum
db ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegin) / 32) ; VectorNum
push eax
mov eax, CommonInterruptEntry
jmp eax
ENDM
AsmIdtVectorEnd:
HookAfterStubBegin:
db 6ah ; push
VectorNum:
db 0 ; 0 will be fixed
push eax
mov eax, HookAfterStubHeaderEnd
jmp eax
HookAfterStubHeaderEnd:
pop eax
sub esp, 8 ; reserve room for filling exception data later
push [esp + 8]
xchg ecx, [esp] ; get vector number
bt mErrorCodeFlag, ecx
jnc @F
push [esp] ; addition push if exception data needed
@@:
xchg ecx, [esp] ; restore ecx
push eax
;----------------------------------------------------------------------------;
; CommonInterruptEntry ;
;----------------------------------------------------------------------------;
; The follow algorithm is used for the common interrupt routine.
; Entry from each interrupt with a push eax and eax=interrupt number
; Stack:
; +---------------------+
; + EFlags +
; +---------------------+
; + CS +
; +---------------------+
; + EIP +
; +---------------------+
; + Error Code +
; +---------------------+
; + Vector Number +
; +---------------------+
; + EBP +
; +---------------------+ <-- EBP
CommonInterruptEntry PROC PUBLIC
cli
pop eax
;
; All interrupt handlers are invoked through interrupt gates, so
; IF flag automatically cleared at the entry point
;
;
; Get vector number from top of stack
;
xchg ecx, [esp]
and ecx, 0FFh ; Vector number should be less than 256
cmp ecx, 32 ; Intel reserved vector for exceptions?
jae NoErrorCode
bt mErrorCodeFlag, ecx
jc HasErrorCode
NoErrorCode:
;
; Stack:
; +---------------------+
; + EFlags +
; +---------------------+
; + CS +
; +---------------------+
; + EIP +
; +---------------------+
; + ECX +
; +---------------------+ <-- ESP
;
; Registers:
; ECX - Vector Number
;
;
; Put Vector Number on stack
;
push ecx
;
; Put 0 (dummy) error code on stack, and restore ECX
;
xor ecx, ecx ; ECX = 0
xchg ecx, [esp+4]
jmp ErrorCodeAndVectorOnStack
HasErrorCode:
;
; Stack:
; +---------------------+
; + EFlags +
; +---------------------+
; + CS +
; +---------------------+
; + EIP +
; +---------------------+
; + Error Code +
; +---------------------+
; + ECX +
; +---------------------+ <-- ESP
;
; Registers:
; ECX - Vector Number
;
;
; Put Vector Number on stack and restore ECX
;
xchg ecx, [esp]
ErrorCodeAndVectorOnStack:
push ebp
mov ebp, esp
;
; Stack:
; +---------------------+
; + EFlags +
; +---------------------+
; + CS +
; +---------------------+
; + EIP +
; +---------------------+
; + Error Code +
; +---------------------+
; + Vector Number +
; +---------------------+
; + EBP +
; +---------------------+ <-- EBP
;
;
; Align stack to make sure that EFI_FX_SAVE_STATE_IA32 of EFI_SYSTEM_CONTEXT_IA32
; is 16-byte aligned
;
and esp, 0fffffff0h
sub esp, 12
sub esp, 8
push 0 ; clear EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
push 0 ; clear EXCEPTION_HANDLER_CONTEXT.ExceptionDataFlag
;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;
push eax
push ecx
push edx
push ebx
lea ecx, [ebp + 6 * 4]
push ecx ; ESP
push dword ptr [ebp] ; EBP
push esi
push edi
;; UINT32 Gs, Fs, Es, Ds, Cs, Ss;
mov eax, ss
push eax
movzx eax, word ptr [ebp + 4 * 4]
push eax
mov eax, ds
push eax
mov eax, es
push eax
mov eax, fs
push eax
mov eax, gs
push eax
;; UINT32 Eip;
mov eax, [ebp + 3 * 4]
push eax
;; UINT32 Gdtr[2], Idtr[2];
sub esp, 8
sidt [esp]
mov eax, [esp + 2]
xchg eax, [esp]
and eax, 0FFFFh
mov [esp+4], eax
sub esp, 8
sgdt [esp]
mov eax, [esp + 2]
xchg eax, [esp]
and eax, 0FFFFh
mov [esp+4], eax
;; UINT32 Ldtr, Tr;
xor eax, eax
str ax
push eax
sldt ax
push eax
;; UINT32 EFlags;
mov eax, [ebp + 5 * 4]
push eax
;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
mov eax, 1
push ebx ; temporarily save value of ebx on stack
cpuid ; use CPUID to determine if FXSAVE/FXRESTOR and DE
; are supported
pop ebx ; retore value of ebx that was overwritten by CPUID
mov eax, cr4
push eax ; push cr4 firstly
test edx, BIT24 ; Test for FXSAVE/FXRESTOR support
jz @F
or eax, BIT9 ; Set CR4.OSFXSR
@@:
test edx, BIT2 ; Test for Debugging Extensions support
jz @F
or eax, BIT3 ; Set CR4.DE
@@:
mov cr4, eax
mov eax, cr3
push eax
mov eax, cr2
push eax
xor eax, eax
push eax
mov eax, cr0
push eax
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
mov eax, dr7
push eax
mov eax, dr6
push eax
mov eax, dr3
push eax
mov eax, dr2
push eax
mov eax, dr1
push eax
mov eax, dr0
push eax
;; FX_SAVE_STATE_IA32 FxSaveState;
sub esp, 512
mov edi, esp
test edx, BIT24 ; Test for FXSAVE/FXRESTOR support.
; edx still contains result from CPUID above
jz @F
db 0fh, 0aeh, 07h ;fxsave [edi]
@@:
;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear
cld
;; UINT32 ExceptionData;
push dword ptr [ebp + 2 * 4]
;; Prepare parameter and call
mov edx, esp
push edx
mov edx, dword ptr [ebp + 1 * 4]
push edx
;
; Call External Exception Handler
;
mov eax, CommonExceptionHandler
call eax
add esp, 8
cli
;; UINT32 ExceptionData;
add esp, 4
;; FX_SAVE_STATE_IA32 FxSaveState;
mov esi, esp
mov eax, 1
cpuid ; use CPUID to determine if FXSAVE/FXRESTOR
; are supported
test edx, BIT24 ; Test for FXSAVE/FXRESTOR support
jz @F
db 0fh, 0aeh, 0eh ; fxrstor [esi]
@@:
add esp, 512
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
;; Skip restoration of DRx registers to support in-circuit emualators
;; or debuggers set breakpoint in interrupt/exception context
add esp, 4 * 6
;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
pop eax
mov cr0, eax
add esp, 4 ; not for Cr1
pop eax
mov cr2, eax
pop eax
mov cr3, eax
pop eax
mov cr4, eax
;; UINT32 EFlags;
pop dword ptr [ebp + 5 * 4]
;; UINT32 Ldtr, Tr;
;; UINT32 Gdtr[2], Idtr[2];
;; Best not let anyone mess with these particular registers...
add esp, 24
;; UINT32 Eip;
pop dword ptr [ebp + 3 * 4]
;; UINT32 Gs, Fs, Es, Ds, Cs, Ss;
;; NOTE - modified segment registers could hang the debugger... We
;; could attempt to insulate ourselves against this possibility,
;; but that poses risks as well.
;;
pop gs
pop fs
pop es
pop ds
pop dword ptr [ebp + 4 * 4]
pop ss
;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;
pop edi
pop esi
add esp, 4 ; not for ebp
add esp, 4 ; not for esp
pop ebx
pop edx
pop ecx
pop eax
pop dword ptr [ebp - 8]
pop dword ptr [ebp - 4]
mov esp, ebp
pop ebp
add esp, 8
cmp dword ptr [esp - 16], 0 ; check EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
jz DoReturn
cmp dword ptr [esp - 20], 1 ; check EXCEPTION_HANDLER_CONTEXT.ExceptionDataFlag
jz ErrorCode
jmp dword ptr [esp - 16]
ErrorCode:
sub esp, 4
jmp dword ptr [esp - 12]
DoReturn:
cmp mDoFarReturnFlag, 0 ; Check if need to do far return instead of IRET
jz DoIret
push [esp + 8] ; save EFLAGS
add esp, 16
push [esp - 8] ; save CS in new location
push [esp - 8] ; save EIP in new location
push [esp - 8] ; save EFLAGS in new location
popfd ; restore EFLAGS
retf ; far return
DoIret:
iretd
CommonInterruptEntry ENDP
;---------------------------------------;
; _AsmGetTemplateAddressMap ;
;----------------------------------------------------------------------------;
;
; Protocol prototype
; AsmGetTemplateAddressMap (
; EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap
; );
;
; Routine Description:
;
; Return address map of interrupt handler template so that C code can generate
; interrupt table.
;
; Arguments:
;
;
; Returns:
;
; Nothing
;
;
; Input: [ebp][0] = Original ebp
; [ebp][4] = Return address
;
; Output: Nothing
;
; Destroys: Nothing
;-----------------------------------------------------------------------------;
AsmGetTemplateAddressMap proc near public
push ebp ; C prolog
mov ebp, esp
pushad
mov ebx, dword ptr [ebp + 08h]
mov dword ptr [ebx], AsmIdtVectorBegin
mov dword ptr [ebx + 4h], (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32
mov dword ptr [ebx + 8h], HookAfterStubBegin
popad
pop ebp
ret
AsmGetTemplateAddressMap ENDP
;-------------------------------------------------------------------------------------
; AsmVectorNumFixup (*NewVectorAddr, VectorNum, *OldVectorAddr);
;-------------------------------------------------------------------------------------
AsmVectorNumFixup proc near public
mov eax, dword ptr [esp + 8]
mov ecx, [esp + 4]
mov [ecx + (VectorNum - HookAfterStubBegin)], al
ret
AsmVectorNumFixup ENDP
END
|
; A095805: Reduced numerators in Wolfram's iteration for sqrt(2).
; Submitted by Christian Krause
; 0,1,1,5,11,11,45,45,181,181,181,181,181,181,11585,11585,11585,92681,185363,370727,741455,741455,741455,5931641,11863283,11863283,11863283,94906265,189812531,189812531,189812531,1518500249
seq $0,95804 ; Values of s in Wolfram's iteration for sqrt(2).
lpb $0
dif $0,2
lpe
|
li t0 542
sw t0 0
lw s6 0
|
#ifndef LAYERSTACK_HPP
# define LAYERSTACK_HPP
# include "Interfaces/ILayerManager.hpp"
namespace NAMESPACE
{
class LayerStack : public ILayerManager
{
std::vector<ILayer *> layers;
unsigned int numberOfRegularLayers;
public:
typedef typename std::vector<ILayer *>::iterator iterator;
typedef typename std::vector<ILayer *>::const_iterator const_iterator;
typedef typename std::vector<ILayer *>::reverse_iterator reverse_iterator;
typedef typename std::vector<ILayer *>::const_reverse_iterator const_reverse_iterator;
LayerStack();
~LayerStack();
virtual void pushLayer(ILayer *layer) override;
virtual void popLayer(ILayer *layer) override;
inline iterator begin() { return (layers.begin()); }
inline iterator end() { return (layers.end()); }
inline const_iterator begin() const { return (layers.begin()); }
inline const_iterator end() const { return (layers.end()); }
inline reverse_iterator rbegin() { return (layers.rbegin()); }
inline reverse_iterator rend() { return (layers.rend()); }
inline const_reverse_iterator rbegin() const { return (layers.rbegin()); }
inline const_reverse_iterator rend() const { return (layers.rend()); }
};
}
#endif
|
/*
All modification made by Cambricon Corporation: © 2019Cambricon Corporation
All rights reserved.
All other contributions:
Copyright (c) 2014--2019, the respective contributors
All rights reserved.
For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXAMPLES_CLAS_OFFLINE_MULTICORE_POST_PROCESS_CLAS_OFF_POST_HPP_
#define EXAMPLES_CLAS_OFFLINE_MULTICORE_POST_PROCESS_CLAS_OFF_POST_HPP_
#include "clas_processor.hpp"
template<typename Dtype, template <typename> class Qtype>
class ClassOffPostProcessor: public ClassPostProcessor<Dtype, Qtype> {
public:
ClassOffPostProcessor() {}
~ClassOffPostProcessor() {
delete [] reinterpret_cast<float*>(outCpuPtrs_[0]);
delete outCpuPtrs_;
free(syncCpuPtrs_);
}
virtual void runParallel();
virtual void runSerial() {}
private:
Dtype* outCpuPtrs_;
void* syncCpuPtrs_;
};
#endif // EXAMPLES_CLAS_OFFLINE_MULTICORE_POST_PROCESS_CLAS_OFF_POST_HPP_
|
; A071005: Binary expansion of Pi/3, A019670.
; Submitted by Christian Krause
; 1,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,1,1,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,1,1,1,0,1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,0,0,0,1,1,1,1,0,1,0
add $0,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
mul $1,4
div $1,12
mov $4,2
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,2
|
format ELF64 executable 3
entry start
include 'procs.inc'
segment readable
childMsg db 'This is the child process', 0h
parentMsg db 'This is the parent process', 0h
segment readable executable
start:
mov rax, 57 ; SYS_FORK (kernel opcode 57)
syscall
cmp rax, 0 ; if eax is zero, we are in the child process
jnz .parent ; jump to child if eax is zero
.child:
mov rax, childMsg
call sprintLF
call quitProgram
.parent:
mov rax, parentMsg
call sprintLF
call quitProgram
|
; ** Map 'BruceIsBackHome' Tile Collision **
; A = Title
; X = Actor
rts |
.target "65C02"
.setting "LaunchCommand", "wsl ../x6502/x6502 {0}"
.memory "fill", $8000, $8000, $ea
.org $8000
lda #$ff
sta $6002
lda #$55
sta $6000
xor #$ff
jmp $8007
.org $fffc
.byte $00
.byte $80
|
;
; Old School Computer Architecture - interfacing FLOS
; Stefano Bodrato, 2011
;
; Like 'rename' but with a FLOS style error handling
;
; $Id: rename_file.asm,v 1.4 2016-06-22 22:13:09 dom Exp $
;
SECTION code_clib
PUBLIC rename_file
PUBLIC _rename_file
EXTERN rename_file_callee
EXTERN ASMDISP_RENAME_FILE_CALLEE
rename_file:
_rename_file:
pop bc
pop de
pop hl
push hl
push de
push bc
jp rename_file_callee + ASMDISP_RENAME_FILE_CALLEE
|
SECTION code_fcntl
PUBLIC zx_01_output_fzx_oterm_msg_pscroll
EXTERN console_01_output_char_proc_putchar_scroll
zx_01_output_fzx_oterm_msg_pscroll:
; * OTERM_MSG_PSCROLL
;
; enter : hl = number of pixels to scroll
; exit : hl = actual number if pixels scrolled
; else carry set if screen clears
; can use: af, bc, de, hl
;
; Scroll the window upward at least hl pixels
ld de,7
add hl,de ; round up to next char
ld a,l
and $f8
ld l,a
push hl ; save actual number of pixels to scroll
srl h
rra
srl h
rra
srl h
rra ; a = number of chars to scroll
call console_01_output_char_proc_putchar_scroll
pop hl ; hl = actual number of pixels scrolled
ret
|
; A189636: Positions of 0 in A116178; complement of A189637.
; Submitted by Jamie Morken(s4)
; 1,2,4,5,7,10,11,13,14,16,19,20,22,25,28,29,31,32,34,37,38,40,41,43,46,47,49,52,55,56,58,59,61,64,65,67,70,73,74,76,79,82,83,85,86,88,91,92,94,95,97,100,101,103,106,109,110,112,113,115,118,119,121,122,124,127,128,130,133,136,137,139,140,142,145,146,148,151,154,155,157,160,163,164,166,167
mov $1,1
mov $2,$0
pow $2,2
lpb $2
mov $3,$1
seq $3,118006 ; Define a sequence of binary words by w(1) = 01 and w(n+1) = w(n)w(n)Reverse[w(n)]. Sequence gives the limiting word w(infinity).
sub $0,$3
add $1,2
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,2
add $0,1
|
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_ret
; function present in some rom crts
; if number of pops changes, check crts
pop hl
pop hl
pop hl
l_ret:
; Do-nothing function used as a stub by some library functions
ret
|
/** @file
ProxyTransaction - Base class for protocol client transactions.
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "http/HttpSM.h"
#include "Plugin.h"
#define HttpTxnDebug(fmt, ...) SsnDebug(this, "http_txn", fmt, __VA_ARGS__)
ProxyTransaction::ProxyTransaction(ProxySession *session) : VConnection(nullptr), _proxy_ssn(session) {}
ProxyTransaction::~ProxyTransaction()
{
this->_sm = nullptr;
this->mutex.clear();
}
void
ProxyTransaction::new_transaction(bool from_early_data)
{
ink_release_assert(_sm == nullptr);
// Defensive programming, make sure nothing persists across
// connection re-use
ink_release_assert(_proxy_ssn != nullptr);
_sm = HttpSM::allocate();
_sm->init(from_early_data);
HttpTxnDebug("[%" PRId64 "] Starting transaction %d using sm [%" PRId64 "]", _proxy_ssn->connection_id(),
_proxy_ssn->get_transact_count(), _sm->sm_id);
// PI tag valid only for internal requests
if (this->get_netvc()->get_is_internal_request()) {
PluginIdentity *pi = dynamic_cast<PluginIdentity *>(this->get_netvc());
if (pi) {
_sm->plugin_tag = pi->getPluginTag();
_sm->plugin_id = pi->getPluginId();
}
}
this->increment_client_transactions_stat();
_sm->attach_client_session(this, _reader);
}
bool
ProxyTransaction::attach_server_session(PoolableSession *ssession, bool transaction_done)
{
return _proxy_ssn->attach_server_session(ssession, transaction_done);
}
void
ProxyTransaction::set_rx_error_code(ProxyError e)
{
if (this->_sm) {
this->_sm->t_state.client_info.rx_error_code = e;
}
}
void
ProxyTransaction::set_tx_error_code(ProxyError e)
{
if (this->_sm) {
this->_sm->t_state.client_info.tx_error_code = e;
}
}
NetVConnection *
ProxyTransaction::get_netvc() const
{
return (_proxy_ssn) ? _proxy_ssn->get_netvc() : nullptr;
}
bool
ProxyTransaction::is_first_transaction() const
{
return _proxy_ssn->get_transact_count() == 1;
}
void
ProxyTransaction::set_session_active()
{
if (_proxy_ssn) {
_proxy_ssn->set_session_active();
}
}
void
ProxyTransaction::clear_session_active()
{
if (_proxy_ssn) {
_proxy_ssn->clear_session_active();
}
}
const IpAllow::ACL &
ProxyTransaction::get_acl() const
{
return _proxy_ssn ? _proxy_ssn->acl : IpAllow::DENY_ALL_ACL;
}
// outbound values Set via the server port definition. Really only used for Http1 at the moment
in_port_t
ProxyTransaction::get_outbound_port() const
{
return upstream_outbound_options.outbound_port;
}
void
ProxyTransaction::set_outbound_port(in_port_t port)
{
upstream_outbound_options.outbound_port = port;
}
IpAddr
ProxyTransaction::get_outbound_ip4() const
{
return upstream_outbound_options.outbound_ip4;
}
IpAddr
ProxyTransaction::get_outbound_ip6() const
{
return upstream_outbound_options.outbound_ip6;
}
void
ProxyTransaction::set_outbound_ip(const IpAddr &new_addr)
{
if (new_addr.isIp4()) {
upstream_outbound_options.outbound_ip4 = new_addr;
} else if (new_addr.isIp6()) {
upstream_outbound_options.outbound_ip6 = new_addr;
} else {
upstream_outbound_options.outbound_ip4.invalidate();
upstream_outbound_options.outbound_ip6.invalidate();
}
}
bool
ProxyTransaction::is_outbound_transparent() const
{
return upstream_outbound_options.f_outbound_transparent;
}
void
ProxyTransaction::set_outbound_transparent(bool flag)
{
upstream_outbound_options.f_outbound_transparent = flag;
}
int
ProxyTransaction::get_transaction_priority_weight() const
{
return 0;
}
int
ProxyTransaction::get_transaction_priority_dependence() const
{
return 0;
}
void
ProxyTransaction::transaction_done()
{
SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread());
this->decrement_client_transactions_stat();
}
// Implement VConnection interface.
VIO *
ProxyTransaction::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf)
{
return _proxy_ssn->do_io_read(c, nbytes, buf);
}
VIO *
ProxyTransaction::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner)
{
return _proxy_ssn->do_io_write(c, nbytes, buf, owner);
}
void
ProxyTransaction::do_io_close(int lerrno)
{
_proxy_ssn->do_io_close(lerrno);
// this->destroy(); Parent owns this data structure. No need for separate destroy.
}
void
ProxyTransaction::do_io_shutdown(ShutdownHowTo_t howto)
{
_proxy_ssn->do_io_shutdown(howto);
}
void
ProxyTransaction::reenable(VIO *vio)
{
_proxy_ssn->reenable(vio);
}
bool
ProxyTransaction::has_request_body(int64_t request_content_length, bool is_chunked) const
{
return request_content_length > 0 || is_chunked;
}
|
; void zx_scroll_wc_up(struct r_Rect8 *r, uchar rows, uchar attr)
SECTION code_clib
SECTION code_arch
PUBLIC zx_scroll_wc_up
EXTERN asm_zx_scroll_wc_up
zx_scroll_wc_up:
pop af
pop hl
pop de
pop ix
push hl
push de
push hl
push af
jp asm_zx_scroll_wc_up
|
ld a, 3
ld hl, basescradr + #0a0c
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a2c
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #07cc), a
ld (basescradr + #080c), a
ld (basescradr + #082c), a
ld (basescradr + #084c), a
ld (basescradr + #0a4c), a
ld (basescradr + #0e0c), a
ld (basescradr + #0e2c), a
ld (basescradr + #0f0c), a
ld (basescradr + #0f2c), a
ld a, 255
ld hl, basescradr + #0855
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0875
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0895
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08b5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08d5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08f5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #00ed
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #07cd
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #0f35), a
ld a, 252
ld (basescradr + #00f5), a
ld (basescradr + #01f5), a
ld (basescradr + #07d5), a
ld a, 7
ld hl, basescradr + #02ec
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #00ec), a
ld (basescradr + #06ec), a
ld (basescradr + #07ec), a
ld a, 71
ld (basescradr + #01ec), a
ld (basescradr + #05ec), a
ld (basescradr + #090c), a
ld (basescradr + #092c), a
ld (basescradr + #094c), a
ld (basescradr + #0d0c), a
ld (basescradr + #0d2c), a
ld a, 254
ld hl, basescradr + #02f5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0815
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0835
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 68
ld hl, basescradr + #0eed
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #120c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #160b
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #090a), a
ld (basescradr + #092a), a
ld (basescradr + #094a), a
ld (basescradr + #096a), a
ld (basescradr + #098a), a
ld (basescradr + #09aa), a
ld (basescradr + #09ac), a
ld (basescradr + #09ca), a
ld (basescradr + #09cc), a
ld (basescradr + #09ea), a
ld (basescradr + #09ec), a
ld (basescradr + #0d0a), a
ld (basescradr + #0d2a), a
ld (basescradr + #0d4a), a
ld (basescradr + #0d6a), a
ld (basescradr + #0d8a), a
ld (basescradr + #0daa), a
ld (basescradr + #0dac), a
ld (basescradr + #0dca), a
ld (basescradr + #0dcc), a
ld (basescradr + #0dea), a
ld (basescradr + #0dec), a
ld a, 1
ld hl, basescradr + #0a6c
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a8c
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #086c), a
ld (basescradr + #088c), a
ld (basescradr + #0b4c), a
ld (basescradr + #0c4c), a
ld (basescradr + #0e4c), a
ld (basescradr + #0e6c), a
ld (basescradr + #0e8c), a
ld (basescradr + #0f4c), a
ld (basescradr + #0f6c), a
ld (basescradr + #0f8c), a
ld a, 69
ld (basescradr + #096c), a
ld (basescradr + #098c), a
ld (basescradr + #0d4c), a
ld (basescradr + #0d6c), a
ld (basescradr + #0d8c), a
ld a, 128
ld hl, basescradr + #08b6
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08d6
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0996
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #0ef6), a
xor a
ld hl, basescradr + #0aac
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0acc
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0aec
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0fec
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #100c
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld (basescradr + #08ac), a
ld (basescradr + #08cc), a
ld (basescradr + #08ec), a
ld (basescradr + #0eac), a
ld (basescradr + #0ecc), a
ld (basescradr + #0eec), a
ld (basescradr + #0fac), a
ld (basescradr + #0fcc), a
ld (basescradr + #120b), a
ld (basescradr + #1215), a
ld (basescradr + #160a), a
ld a, 192
ld hl, basescradr + #08f6
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0dd6
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 127
ld hl, basescradr + #0aed
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 96
ld (basescradr + #1115), a
ret
|
// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006. All Rights Reserved
//
// The Wild Magic Version 4 Restricted Libraries source code is supplied
// under the terms of the license agreement
// http://www.geometrictools.com/License/Wm4RestrictedLicense.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.
#include "Wm4OpenGLRendererPCH.h"
#include "Wm4OpenGLRenderer.h"
#include "Wm4Camera.h"
using namespace Wm4;
//----------------------------------------------------------------------------
OpenGLRenderer::OpenGLRenderer (FrameBuffer::FormatType eFormat,
FrameBuffer::DepthType eDepth, FrameBuffer::StencilType eStencil,
FrameBuffer::BufferingType eBuffering,
FrameBuffer::MultisamplingType eMultisampling, int iWidth, int iHeight)
:
Renderer(eFormat,eDepth,eStencil,eBuffering,eMultisampling,iWidth,iHeight)
{
}
//----------------------------------------------------------------------------
OpenGLRenderer::~OpenGLRenderer ()
{
}
//----------------------------------------------------------------------------
void OpenGLRenderer::InitializeState ()
{
// vertices always exist
glEnableClientState(GL_VERTEX_ARRAY);
// colors disabled, current color is WHITE
glDisableClientState(GL_COLOR_ARRAY);
glColor4fv((const float*)ColorRGBA::WHITE);
// normals disabled
glDisableClientState(GL_NORMAL_ARRAY);
// Query for capabilities.
// Get the number of supported texture images for vertex program.
m_iMaxVShaderImages = 0;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS,&m_iMaxVShaderImages);
// Get the number of supported texture units for pixel programs.
m_iMaxPShaderImages = 0;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&m_iMaxPShaderImages);
// TO DO. The OpenGL shading language has separate concepts of "texture
// image units" and "texture coordinate sets". The values iMaxTextures
// and iMaxTCoords can be different. Replace m_iMaxTextures with
// m_iMaxTextureImageUnits and add m_iMaxTCoords. Anytime shader programs
// are loaded, the number of texture coordinate inputs/outputs and the
// number of samplers need to be compared with what the hardware can
// support.
m_iMaxTCoords = 0;
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&m_iMaxTCoords);
// OpenGL supports a primary and a secondary color
m_iMaxColors = 2;
// Set up light model. TO DO: Do we need the OpenGL calls for a
// shader-based engine?
GLint iMaxLights;
glGetIntegerv(GL_MAX_LIGHTS,&iMaxLights);
assert(iMaxLights > 0);
m_iMaxLights = (int)iMaxLights;
m_aspkLight = WM4_NEW ObjectPtr[m_iMaxLights];
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,(const float*)ColorRGBA::BLACK);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,GL_FALSE);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE);
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR);
glDisable(GL_LIGHTING);
// get stencil buffer size
GLint iBits = 0;
glGetIntegerv(GL_STENCIL_BITS,&iBits);
m_iMaxStencilIndices = (iBits > 0 ? (1 << iBits) : 0);
GLint iMaxUseClipPlanes = 0;
glGetIntegerv(GL_MAX_CLIP_PLANES,&iMaxUseClipPlanes);
m_iMaxUserClipPlanes = (int)iMaxUseClipPlanes;
// Disable drawing of lines as sequences of dashes.
glDisable(GL_LINE_STIPPLE);
// Initialize global render state to default settings.
SetGlobalState(GlobalState::Default);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::SetBackgroundColor (const ColorRGBA& rkColor)
{
Renderer::SetBackgroundColor(rkColor);
glClearColor(rkColor[0],rkColor[1],rkColor[2],rkColor[3]);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearBackBuffer ()
{
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,m_iWidth,m_iHeight);
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearZBuffer ()
{
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,m_iWidth,m_iHeight);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearStencilBuffer ()
{
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,m_iWidth,m_iHeight);
glStencilMask(~0);
glClear(GL_STENCIL_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearBuffers ()
{
glEnable(GL_SCISSOR_TEST);
glScissor(0,0,m_iWidth,m_iHeight);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glStencilMask(~0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearBackBuffer (int iXPos, int iYPos, int iWidth,
int iHeight)
{
glEnable(GL_SCISSOR_TEST);
glScissor(iXPos,iYPos,iWidth,iHeight);
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearZBuffer (int iXPos, int iYPos, int iWidth,
int iHeight)
{
glEnable(GL_SCISSOR_TEST);
glScissor(iXPos,iYPos,iWidth,iHeight);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearStencilBuffer (int iXPos, int iYPos, int iWidth,
int iHeight)
{
glEnable(GL_SCISSOR_TEST);
glScissor(iXPos,iYPos,iWidth,iHeight);
glStencilMask(~0);
glClear(GL_STENCIL_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::ClearBuffers (int iXPos, int iYPos, int iWidth,
int iHeight)
{
glEnable(GL_SCISSOR_TEST);
glScissor(iXPos,iYPos,iWidth,iHeight);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glStencilMask(~0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::SetColorMask (bool bAllowRed, bool bAllowGreen,
bool bAllowBlue, bool bAllowAlpha)
{
Renderer::SetColorMask(bAllowRed,bAllowGreen,bAllowBlue,bAllowAlpha);
glColorMask((GLboolean)bAllowRed,(GLboolean)bAllowGreen,
(GLboolean)bAllowBlue,(GLboolean)bAllowAlpha);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::EnableUserClipPlane (int i, const Plane3f& rkPlane)
{
GLdouble adPlane[4] =
{
(double)rkPlane.Normal.X(),
(double)rkPlane.Normal.Y(),
(double)rkPlane.Normal.Z(),
(double)-rkPlane.Constant
};
glClipPlane(GL_CLIP_PLANE0 + i,adPlane);
glEnable(GL_CLIP_PLANE0 + i);
}
//----------------------------------------------------------------------------
void OpenGLRenderer::DisableUserClipPlane (int i)
{
glDisable(GL_CLIP_PLANE0 + i);
}
//----------------------------------------------------------------------------
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Calculator Accessory -- Manager
FILE: calc.asm
AUTHOR: Adam de Boor, Mar 13, 1990
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 3/13/90 Initial revision
DESCRIPTION:
Main file for calculator application.
$Id: calcManager.asm,v 1.1 97/04/04 14:47:02 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include calc.def
include calcVariable.def
include gstring.def
include char.def
include input.def
include Objects/inputC.def
ifdef GCM
include calc.grdef
else
include calc.rdef
endif
; Code resources
include calcEngine.asm
include calcMath.asm
include calcDisplay.asm
include calcProcess.asm
include calcTrigger.asm
|
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <tweetNotifier.h>
using namespace std;
int main(int argc, char *argv[]) {
char *username = (char*) malloc(512);
const char *kConsKey = "your-consumer-key";
const char *kConsSec = "your-consumer-secret";
const char *kAtokKey = "your-access-token";
const char *kAtokSec = "your-access-token-secret";
username = strcpy(username, "realDonaldTrump");
if(argc > 1)
username = strcpy(username, argv[1]);
// you can optionally have another argument with a
// path to a sound that you wanto to be played
// instead of "mamma mia" from super mario
tn::TweetNotifier tweet_not(username,
kConsKey, kConsSec, kAtokKey, kAtokSec);
tn::TnStatus status = tweet_not.start_notifier();
if(status == tn::Get_Id_Error)
cout << "error getting user id" << endl;
else if(status == tn::Stream_Connect_Error)
cout << "error connecting to stream" << endl;
else; // status is Ok, stream just disconnected, try to reconnect
free(username);
return 0;
}
|
###############################################################################
# Copyright 2018 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.text
.p2align 4, 0x90
_CONST_DATA:
_INIT_IDX:
.word 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7
_INCR_IDX:
.word 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8
.p2align 4, 0x90
.globl _s8_getAesGcmConst_table_ct
_s8_getAesGcmConst_table_ct:
push %ebx
call .L__0000gas_1
.L__0000gas_1:
pop %ebx
sub $(.L__0000gas_1-_CONST_DATA), %ebx
pxor %xmm2, %xmm2
mov %ecx, %eax
shl $(16), %ecx
or %eax, %ecx
movd %ecx, %xmm3
pshufd $(0), %xmm3, %xmm3
movdqa ((_INIT_IDX-_CONST_DATA))(%ebx), %xmm6
xor %eax, %eax
.p2align 4, 0x90
.Lsearch_loopgas_1:
movdqa %xmm6, %xmm7
paddw ((_INCR_IDX-_CONST_DATA))(%ebx), %xmm6
pcmpeqw %xmm3, %xmm7
pand (%edx,%eax,2), %xmm7
add $(8), %eax
cmp $(256), %eax
por %xmm7, %xmm2
jl .Lsearch_loopgas_1
movdqa %xmm2, %xmm3
psrldq $(8), %xmm2
por %xmm3, %xmm2
movdqa %xmm2, %xmm3
psrldq $(4), %xmm2
por %xmm3, %xmm2
movd %xmm2, %eax
pop %ebx
and $(3), %ecx
shl $(4), %ecx
shr %cl, %eax
ret
.p2align 4, 0x90
.globl _s8_AesGcmMulGcm_table2K
_s8_AesGcmMulGcm_table2K:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (8)(%ebp), %edi
movdqu (%edi), %xmm0
movl (12)(%ebp), %esi
movl (16)(%ebp), %edx
movd %xmm0, %ebx
mov $(4042322160), %eax
and %ebx, %eax
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
movdqa (1024)(%esi,%ecx), %xmm5
movzbl %al, %ecx
movdqa (1024)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
movdqa (1024)(%esi,%ecx), %xmm3
movzbl %al, %ecx
movdqa (1024)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1280)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1280)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1280)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1280)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (256)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (256)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (256)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (256)(%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1536)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1536)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1536)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1536)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (512)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (512)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (512)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (512)(%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1792)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1792)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1792)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1792)(%esi,%ecx), %xmm2
movzbl %bh, %ecx
pxor (768)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (768)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (768)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (768)(%esi,%ecx), %xmm2
movdqa %xmm3, %xmm0
pslldq $(1), %xmm3
pxor %xmm3, %xmm2
movdqa %xmm2, %xmm1
pslldq $(1), %xmm2
pxor %xmm2, %xmm5
psrldq $(15), %xmm0
movd %xmm0, %ecx
call _s8_getAesGcmConst_table_ct
shl $(8), %eax
movdqa %xmm5, %xmm0
pslldq $(1), %xmm5
pxor %xmm5, %xmm4
psrldq $(15), %xmm1
movd %xmm1, %ecx
mov %eax, %ebx
call _s8_getAesGcmConst_table_ct
xor %ebx, %eax
shl $(8), %eax
psrldq $(15), %xmm0
movd %xmm0, %ecx
mov %eax, %ebx
call _s8_getAesGcmConst_table_ct
xor %ebx, %eax
movd %eax, %xmm0
pxor %xmm4, %xmm0
movdqu %xmm0, (%edi)
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.p2align 4, 0x90
.globl _s8_AesGcmAuth_table2K
_s8_AesGcmAuth_table2K:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (8)(%ebp), %edi
movdqu (%edi), %xmm0
movl (20)(%ebp), %esi
movl (12)(%ebp), %edi
movl (24)(%ebp), %edx
.p2align 4, 0x90
.Lauth_loopgas_3:
movdqu (%edi), %xmm4
pxor %xmm4, %xmm0
movd %xmm0, %ebx
mov $(4042322160), %eax
and %ebx, %eax
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
movdqa (1024)(%esi,%ecx), %xmm5
movzbl %al, %ecx
movdqa (1024)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
movdqa (1024)(%esi,%ecx), %xmm3
movzbl %al, %ecx
movdqa (1024)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1280)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1280)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1280)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1280)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (256)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (256)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (256)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (256)(%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1536)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1536)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1536)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1536)(%esi,%ecx), %xmm2
psrldq $(4), %xmm0
movd %xmm0, %eax
and $(4042322160), %eax
movzbl %bh, %ecx
pxor (512)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (512)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (512)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (512)(%esi,%ecx), %xmm2
movd %xmm0, %ebx
shl $(4), %ebx
and $(4042322160), %ebx
movzbl %ah, %ecx
pxor (1792)(%esi,%ecx), %xmm5
movzbl %al, %ecx
pxor (1792)(%esi,%ecx), %xmm4
shr $(16), %eax
movzbl %ah, %ecx
pxor (1792)(%esi,%ecx), %xmm3
movzbl %al, %ecx
pxor (1792)(%esi,%ecx), %xmm2
movzbl %bh, %ecx
pxor (768)(%esi,%ecx), %xmm5
movzbl %bl, %ecx
pxor (768)(%esi,%ecx), %xmm4
shr $(16), %ebx
movzbl %bh, %ecx
pxor (768)(%esi,%ecx), %xmm3
movzbl %bl, %ecx
pxor (768)(%esi,%ecx), %xmm2
movdqa %xmm3, %xmm0
pslldq $(1), %xmm3
pxor %xmm3, %xmm2
movdqa %xmm2, %xmm1
pslldq $(1), %xmm2
pxor %xmm2, %xmm5
psrldq $(15), %xmm0
movd %xmm0, %ecx
call _s8_getAesGcmConst_table_ct
shl $(8), %eax
movdqa %xmm5, %xmm0
pslldq $(1), %xmm5
pxor %xmm5, %xmm4
psrldq $(15), %xmm1
movd %xmm1, %ecx
mov %eax, %ebx
call _s8_getAesGcmConst_table_ct
xor %ebx, %eax
shl $(8), %eax
psrldq $(15), %xmm0
movd %xmm0, %ecx
mov %eax, %ebx
call _s8_getAesGcmConst_table_ct
xor %ebx, %eax
movd %eax, %xmm0
pxor %xmm4, %xmm0
add $(16), %edi
subl $(16), (16)(%ebp)
jnz .Lauth_loopgas_3
movl (8)(%ebp), %edi
movdqu %xmm0, (%edi)
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
|
;=======================================================================================================================
; ;
; Name: socOS (System On Chip Operation System) ;
; Year: 2020 ;
; License: MIT License ;
; ;
;=======================================================================================================================
; Require:
;.include "m8def.inc"
;.include "kernel/kernel_def.asm"
;.include "kernel/drivers/device_def.asm"
;.include "kernel/drivers/soc/timer_base_def.asm"
; st_timer_w_pwm_base size
.equ SZ_ST_TIMER_W_PWM_BASE = SZ_ST_TIMER_BASE + 0x0A
; st_timer_w_pwm_base:st_timer_base inherited fields
.equ ST_TIMER_W_PWM_BASE_COUNTER_CONTROL_REGISTER_ADDRESS_OFFSET = ST_TIMER_BASE_COUNTER_CONTROL_REGISTER_ADDRESS_OFFSET
.equ ST_TIMER_W_PWM_BASE_COUNTER_REGISTER_ADDRESS_OFFSET = ST_TIMER_BASE_COUNTER_REGISTER_ADDRESS_OFFSET
.equ ST_TIMER_W_PWM_BASE_DIVIDER_BIT_MASK_OFFSET = ST_TIMER_BASE_DIVIDER_BIT_MASK_OFFSET
.equ ST_TIMER_W_PWM_BASE_OVERFLOW_INTERRUPT_BIT_MASK_OFFSET = ST_TIMER_BASE_OVERFLOW_INTERRUPT_BIT_MASK_OFFSET
.equ ST_TIMER_W_PWM_BASE_OVERFLOW_HANDLER_OFFSET = ST_TIMER_BASE_OVERFLOW_HANDLER_OFFSET
; st_timer_pwm_base new fields
.equ ST_TIMER_W_PWM_BASE_COMPARE_CONTROL_REGISTER_ADDRESS_OFFSET = SZ_ST_TIMER_BASE
.equ ST_TIMER_W_PWM_BASE_DDRX_ADDRESS_OFFSET = SZ_ST_TIMER_BASE + 0x02
.equ ST_TIMER_W_PWM_BASE_DDRX_BIT_MASK_OFFSET = SZ_ST_TIMER_BASE + 0x04
.equ ST_TIMER_W_PWM_BASE_MODE_OFFSET = SZ_ST_TIMER_BASE + 0x05
.equ ST_TIMER_W_PWM_BASE_COMPARE_THRESHOLD_OFFSET = SZ_ST_TIMER_BASE + 0x06
.equ ST_TIMER_W_PWM_BASE_COMPARE_INTERRUPT_BIT_MASK_OFFSET = SZ_ST_TIMER_BASE + 0x07
.equ ST_TIMER_W_PWM_BASE_COMPARE_HANDLER_OFFSET = SZ_ST_TIMER_BASE + 0x08
; enum TIMER_W_PWM_DIVIDER
.equ TIMER_W_PWM_DIVIDER_CLOCK_DISABLED = 0x00
.equ TIMER_W_PWM_DIVIDER_1X = 0x01
.equ TIMER_W_PWM_DIVIDER_8X = 0x02
.equ TIMER_W_PWM_DIVIDER_32X = 0x03
.equ TIMER_W_PWM_DIVIDER_64X = 0x04
.equ TIMER_W_PWM_DIVIDER_128X = 0x05
.equ TIMER_W_PWM_DIVIDER_256X = 0x06
.equ TIMER_W_PWM_DIVIDER_1024X = 0x07
; enum TIMER_W_PWM_MODE
.equ TIMER_W_PWM_MODE_OFF = 0x00
.equ TIMER_W_PWM_MODE_CTC = 0x01
.equ TIMER_W_PWM_MODE_PHASE_CORRECTION = 0x02
.equ TIMER_W_PWM_MODE_PHASE_CORRECTION_INVERTED = 0x03
.equ TIMER_W_PWM_MODE_FAST = 0x04
.equ TIMER_W_PWM_MODE_FAST_INVERTED = 0x05
; enum TIMER_W_PWM_COMPARE_THRESHOLD
.equ TIMER_W_PWM_COMPARE_THRESHOLD_ZERO = 0x00 |
; A081204: Staircase on Pascal's triangle.
; 1,2,3,10,15,56,84,330,495,2002,3003,12376,18564,77520,116280,490314,735471,3124550,4686825,20030010,30045015,129024480,193536720,834451800,1251677700,5414950296,8122425444,35240152720,52860229080,229911617056,344867425584,1503232609098,2254848913647,9847379391150,14771069086725,64617565719070,96926348578605,424655979547800,636983969321700,2794563003870330,4191844505805495,18412956934908690,27619435402363035,121455445321173600,182183167981760400,801957983888792640,1202936975833188960
trn $1,$0
add $1,$0
mul $1,2
add $1,$0
add $1,1
div $1,2
bin $1,$0
mov $0,$1
|
; void dzx7_mega_back_callee(void *src, void *dst)
SECTION code_clib
SECTION code_compress_zx7
PUBLIC _dzx7_mega_back_callee
EXTERN asm_dzx7_mega_back
_dzx7_mega_back_callee:
pop hl
pop de
ex (sp),hl
jp asm_dzx7_mega_back
|
; A163444: a(n) = 12*a(n-1) - 34*a(n-2) for n > 1; a(0) = 1, a(1) = 8.
; Submitted by Jamie Morken(s1)
; 1,8,62,472,3556,26624,198584,1477792,10981648,81534848,605042144,4488320896,33288417856,246858103808,1830491038592,13572716933632,100635907891456,746158518953984,5532281359138304,41017986665224192,304118273771987968,2254807738646233088,16717671555507206144,123948595552114548736,918982313738129575936,6813535516085660254208,50517027525931517468672,374544122764265760980992,2776950537289517537837056,20588906273489174580690944,152650557014026498681831424,1131783870869686048438484992
mov $1,1
mov $3,1
lpb $0
sub $0,1
mul $1,2
mov $2,$3
mul $3,6
add $3,$1
mul $1,3
add $1,$2
lpe
mov $0,$3
|
// stdafx.cpp : source file that includes just the standard includes
// stdafx.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#ifdef _ATL_STATIC_REGISTRY
#include <statreg.h>
#include <statreg.cpp>
#endif
//#include <atlimpl.cpp>
|
// Copyright Gavin Band 2008 - 2012.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef STATFILE_TYPEREADERBASE_HPP
#define STATFILE_TYPEREADERBASE_HPP
#include "statfile/types.hpp"
namespace statfile {
template<
typename T1 = empty,
typename T2 = empty,
typename T3 = empty,
typename T4 = empty,
typename T5 = empty,
typename T6 = empty,
typename T7 = empty,
typename T8 = empty,
typename T9 = empty,
typename T10 = empty
>
struct TypeReaderBase: public TypeReaderBase< T2, T3, T4, T5, T6, T7, T8, T9, T10 >
{
using TypeReaderBase< T2, T3, T4, T5, T6, T7, T8, T9, T10 >::read_value ;
virtual void read_value( T1& ) {} ;
} ;
template<>
struct TypeReaderBase< empty, empty, empty, empty, empty, empty, empty, empty, empty, empty >
{
void read_value( empty& ) {} ;
virtual ~TypeReaderBase() {} ;
} ;
}
#endif
|
; A001789: a(n) = binomial(n,3)*2^(n-3).
; 1,8,40,160,560,1792,5376,15360,42240,112640,292864,745472,1863680,4587520,11141120,26738688,63504384,149422080,348651520,807403520,1857028096,4244635648,9646899200,21810380800,49073356800,109924319232,245215789056,544923975680,1206617374720,2662879723520,5858335391744,12850542149632,28110560952320,61332132986880,133487583559680,289858752872448,628027297890304,1357896860303360,2930198488023040,6311196743434240,13569072998383616,29123863996530688,62408279992565760,133524692077117440
mov $1,-2
pow $1,$0
mov $2,-4
bin $2,$0
mul $1,$2
mov $0,$1
|
; A212069: Number of (w,x,y,z) with all terms in {1,...,n} and 3*w = x+y+z.
; 0,1,2,9,22,41,72,115,170,243,334,443,576,733,914,1125,1366,1637,1944,2287,2666,3087,3550,4055,4608,5209,5858,6561,7318,8129,9000,9931,10922,11979,13102,14291,15552,16885,18290,19773,21334,22973
mov $12,$0
mov $14,$0
lpb $14
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
lpb $11
mov $0,$9
sub $11,1
sub $0,$11
mov $2,$0
mul $0,2
div $2,2
mov $5,6
mov $7,6
lpb $2
div $0,6
mod $2,2
div $2,5
add $5,$7
mul $0,$5
lpe
mov $1,$0
div $1,2
add $10,$1
lpe
add $13,$10
lpe
mov $1,$13
|
#pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//Serial peripheral interface/Inter-IC2
namespace I2s2extCr1{ ///<control register 1
using Addr = Register::Address<0x40003400,0xffff0000,0x00000000,unsigned>;
///Bidirectional data mode enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> bidimode{};
///Output enable in bidirectional mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> bidioe{};
///Hardware CRC calculation enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> crcen{};
///CRC transfer next
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> crcnext{};
///Data frame format
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> dff{};
///Receive only
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> rxonly{};
///Software slave management
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> ssm{};
///Internal slave select
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> ssi{};
///Frame format
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> lsbfirst{};
///SPI enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> spe{};
///Baud rate control
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,3),Register::ReadWriteAccess,unsigned> br{};
///Master selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mstr{};
///Clock polarity
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cpol{};
///Clock phase
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> cpha{};
}
namespace I2s2extCr2{ ///<control register 2
using Addr = Register::Address<0x40003404,0xffff8000,0x00000000,unsigned>;
///Rx buffer DMA enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> rxdmaen{};
///Tx buffer DMA enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> txdmaen{};
///SS output enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> ssoe{};
///NSS pulse management
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> nssp{};
///Frame format
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> frf{};
///Error interrupt enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> errie{};
///RX buffer not empty interrupt enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> rxneie{};
///Tx buffer empty interrupt enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> txeie{};
///Data size
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,8),Register::ReadWriteAccess,unsigned> ds{};
///FIFO reception threshold
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> frxth{};
///Last DMA transfer for reception
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> ldmaRx{};
///Last DMA transfer for transmission
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> ldmaTx{};
}
namespace I2s2extSr{ ///<status register
using Addr = Register::Address<0x40003408,0xffffe000,0x00000000,unsigned>;
///Receive buffer not empty
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> rxne{};
///Transmit buffer empty
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> txe{};
///Channel side
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chside{};
///Underrun flag
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> udr{};
///CRC error flag
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> crcerr{};
///Mode fault
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> modf{};
///Overrun flag
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> ovr{};
///Busy flag
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> bsy{};
///TI frame format error
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> tifrfe{};
///FIFO reception level
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,9),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> frlvl{};
///FIFO transmission level
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> ftlvl{};
}
namespace I2s2extDr{ ///<data register
using Addr = Register::Address<0x4000340c,0xffff0000,0x00000000,unsigned>;
///Data register
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> dr{};
}
namespace I2s2extCrcpr{ ///<CRC polynomial register
using Addr = Register::Address<0x40003410,0xffff0000,0x00000000,unsigned>;
///CRC polynomial register
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> crcpoly{};
}
namespace I2s2extRxcrcr{ ///<RX CRC register
using Addr = Register::Address<0x40003414,0xffff0000,0x00000000,unsigned>;
///Rx CRC register
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> rxcrc{};
}
namespace I2s2extTxcrcr{ ///<TX CRC register
using Addr = Register::Address<0x40003418,0xffff0000,0x00000000,unsigned>;
///Tx CRC register
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,0),Register::ReadWriteAccess,unsigned> txcrc{};
}
namespace I2s2extI2scfgr{ ///<I2S configuration register
using Addr = Register::Address<0x4000341c,0xfffff040,0x00000000,unsigned>;
///I2S mode selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> i2smod{};
///I2S Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> i2se{};
///I2S configuration mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,unsigned> i2scfg{};
///PCM frame synchronization
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> pcmsync{};
///I2S standard selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,4),Register::ReadWriteAccess,unsigned> i2sstd{};
///Steady state clock polarity
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> ckpol{};
///Data length to be transferred
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,1),Register::ReadWriteAccess,unsigned> datlen{};
///Channel length (number of bits per audio channel)
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> chlen{};
}
namespace I2s2extI2spr{ ///<I2S prescaler register
using Addr = Register::Address<0x40003420,0xfffffc00,0x00000000,unsigned>;
///Master clock output enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> mckoe{};
///Odd factor for the prescaler
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> odd{};
///I2S Linear prescaler
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> i2sdiv{};
}
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x13b6e, %rsi
lea addresses_WT_ht+0x1d1e4, %rdi
nop
and %r10, %r10
mov $119, %rcx
rep movsl
nop
cmp $7099, %r9
lea addresses_WC_ht+0x1b044, %r9
nop
nop
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rdi
movq %rdi, (%r9)
nop
inc %r10
lea addresses_normal_ht+0xf78c, %rbx
nop
nop
sub %rdi, %rdi
movw $0x6162, (%rbx)
nop
xor %r10, %r10
lea addresses_D_ht+0xe4cc, %r9
nop
cmp $53689, %r11
vmovups (%r9), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbx
nop
nop
add $29934, %rdi
lea addresses_A_ht+0xc2fc, %rsi
lea addresses_normal_ht+0xfecc, %rdi
nop
nop
nop
nop
xor $33365, %r9
mov $120, %rcx
rep movsw
nop
cmp %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %rax
push %rbp
// Faulty Load
lea addresses_A+0x6cc, %rax
nop
cmp $21130, %r12
vmovups (%rax), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r13
lea oracles, %rbp
and $0xff, %r13
shlq $12, %r13
mov (%rbp,%r13,1), %r13
pop %rbp
pop %rax
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
/** @file
A brief file description
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "tscore/ink_config.h"
#include "RecordsConfig.h"
#if TS_USE_REMOTE_UNWINDING
#define MGMT_CRASHLOG_HELPER "traffic_crashlog"
#else
#define MGMT_CRASHLOG_HELPER NULL
#endif
//-------------------------------------------------------------------------
// RecordsConfig
//-------------------------------------------------------------------------
// clang-format off
static const RecordElement RecordsConfig[] =
{
//##############################################################################
//#
//# records.config items
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.product_company", RECD_STRING, "Apache Software Foundation", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.product_vendor", RECD_STRING, "Apache", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.product_name", RECD_STRING, "Traffic Server", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.proxy_name", RECD_STRING, "traffic_server", RECU_DYNAMIC, RR_REQUIRED, RECC_STR, ".+", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.bin_path", RECD_STRING, TS_BUILD_BINDIR, RECU_NULL, RR_REQUIRED, RECC_NULL, nullptr, RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.proxy_binary", RECD_STRING, "traffic_server", RECU_NULL, RR_REQUIRED, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.manager_binary", RECD_STRING, "traffic_manager", RECU_NULL, RR_REQUIRED, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.proxy_binary_opts", RECD_STRING, "-M", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.env_prep", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// Jira TS-21
{RECT_CONFIG, "proxy.config.local_state_dir", RECD_STRING, TS_BUILD_RUNTIMEDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.syslog_facility", RECD_STRING, "LOG_DAEMON", RECU_RESTART_TM, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
//# Negative core limit means max out limit
{RECT_CONFIG, "proxy.config.core_limit", RECD_INT, "-1", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.crash_log_helper", RECD_STRING, MGMT_CRASHLOG_HELPER, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// 0 - Disabled, 1 - enabled for important pages (e.g. cache directory), 2 - enabled for all pages
{RECT_CONFIG, "proxy.config.mlock_enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
//# 0 = disable (seconds)
{RECT_CONFIG, "proxy.config.dump_mem_info_frequency", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//# 0 = disable
{RECT_CONFIG, "proxy.config.http_ui_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-3]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.max_disk_errors", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.output.logfile", RECD_STRING, "traffic.out", RECU_RESTART_TM, RR_REQUIRED, RECC_NULL, nullptr,
RECA_NULL}
,
{RECT_CONFIG, "proxy.config.output.logfile_perm", RECD_STRING, "rw-r--r--", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// traffic.out rotation, default is 0 (aka rolling turned off) to preserve compatibility
{RECT_CONFIG, "proxy.config.output.logfile.rolling_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.output.logfile.rolling_interval_sec", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.output.logfile.rolling_size_mb", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.output.logfile.rolling_min_count", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
//# 0 = disable
{RECT_CONFIG, "proxy.config.res_track_memory", RECD_INT, "0", RECU_RESTART_TS, RR_REQUIRED, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.memory.max_usage", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
//##############################################################################
//# Traffic Server system settings
//##############################################################################
// The percent of the /proc/sys/fs/file-max value to set the RLIMIT_NOFILE cur/max to
{RECT_CONFIG, "proxy.config.system.file_max_pct", RECD_FLOAT, "0.9", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_READ_ONLY}
,
// Traffic Server Execution threads configuration
// By default Traffic Server set number of execution threads equal to total CPUs
{RECT_CONFIG, "proxy.config.exec_thread.autoconfig", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.exec_thread.autoconfig.scale", RECD_FLOAT, "1.5", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.exec_thread.limit", RECD_INT, "2", RECU_RESTART_TS, RR_NULL, RECC_INT, "[1-" TS_STR(TS_MAX_NUMBER_EVENT_THREADS) "]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.exec_thread.affinity", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-4]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.accept_threads", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-" TS_STR(TS_MAX_NUMBER_EVENT_THREADS) "]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.task_threads", RECD_INT, "2", RECU_RESTART_TS, RR_NULL, RECC_INT, "[1-" TS_STR(TS_MAX_NUMBER_EVENT_THREADS) "]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.thread.default.stacksize", RECD_INT, "1048576", RECU_RESTART_TS, RR_NULL, RECC_INT, "[131072-104857600]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.restart.active_client_threshold", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.restart.stop_listening", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.stop.shutdown_timeout", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.thread.max_heartbeat_mseconds", RECD_INT, "60", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1000]", RECA_READ_ONLY}
,
//##############################################################################
//#
//# Support for SRV records
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.srv_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
//##############################################################################
//#
//# Support for disabling check for Accept-* / Content-* header mismatch
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.http.cache.ignore_accept_mismatch", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_accept_language_mismatch", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_accept_encoding_mismatch", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_accept_charset_mismatch", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
//
// Websocket configs
//
{RECT_CONFIG, "proxy.config.http.websocket.max_number_of_connections", RECD_INT, "-1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Redirection
//#
//# 1. number_of_redirections: The maximum number of redirections TS permits. Disabled if set to 0 (default)
//# 2. proxy.config.http.redirect_use_orig_cache_key: Location Header if set to 0 (default), else use original request cache key
//# 3. redirection_host_no_port: do not include default port in host header during redirection
//# 4. post_copy_size: The maximum POST data size TS permits to copy
//# 5. redirect.actions: How to handle redirects.
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.http.number_of_redirections", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.redirect_use_orig_cache_key", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.redirect_host_no_port", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.post_copy_size", RECD_INT, "2048", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.redirect.actions", RECD_STRING, "routable:follow", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Diagnostics
//#
//# Enable by setting proxy.config.diags.debug.enabled to 1
//# Route each type of diagnostic with a string, each character representing:
//# O stdout
//# E stderr
//# S syslog
//# L diags.log
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.diags.debug.enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.debug.tags", RECD_STRING, "http|dns", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.debug.client_ip", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.action.enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.action.tags", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.show_location", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.diag", RECD_STRING, "E", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.debug", RECD_STRING, "E", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.status", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.note", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.warning", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.error", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.fatal", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.alert", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.output.emergency", RECD_STRING, "L", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.logfile_perm", RECD_STRING, "rw-r--r--", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// diags.log rotation, default is 0 (aka rolling turned off) to preserve compatibility
{RECT_CONFIG, "proxy.config.diags.logfile.rolling_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.logfile.rolling_interval_sec", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.logfile.rolling_size_mb", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.diags.logfile.rolling_min_count", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
//##############################################################################
//#
//# Local Manager
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.lm.pserver_timeout_secs", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.lm.pserver_timeout_msecs", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.admin.autoconf.localhost_only", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.admin.user_id", RECD_STRING, TS_PKGSYSUSER, RECU_NULL, RR_REQUIRED, RECC_NULL, nullptr, RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.admin.cli_path", RECD_STRING, "cli", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.admin.api.restricted", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
//##############################################################################
//#
//# UDP configuration stuff: hidden variables
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.udp.free_cancelled_pkts_sec", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.udp.periodic_cleanup", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.udp.send_retries", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.udp.threads", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Process Manager
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.process_manager.timeout", RECD_INT, "5", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Alarm Configuration
//#
//##############################################################################
// #################################################################
// # execute alarm as "<abs_path>/<bin> "<MSG_STRING_FROM_PROXY>"" #
// #################################################################
{RECT_CONFIG, "proxy.config.alarm.bin", RECD_STRING, "example_alarm_bin.sh", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.alarm.abs_path", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.alarm.script_runtime", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-300]", RECA_NULL}
,
// ###########
// # Parsing #
// ###########
{RECT_CONFIG, "proxy.config.header.parse.no_host_url_redirect", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
//##############################################################################
//#
//# HTTP Engine
//#
//##############################################################################
// ##########
// # basics #
// ##########
// #
{RECT_CONFIG, "proxy.config.http.allow_half_open", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.enabled", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.server_ports", RECD_STRING, "8080 8080:ipv6", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.wait_for_cache", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-3]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_request_via_str", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-4]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_response_via_str", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-4]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.request_via_str", RECD_STRING, "ApacheTrafficServer/" PACKAGE_VERSION, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.response_via_str", RECD_STRING, "ApacheTrafficServer/" PACKAGE_VERSION, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.response_server_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.response_server_str", RECD_STRING, "ATS/" PACKAGE_VERSION, RECU_DYNAMIC, RR_NULL, RECC_NULL, ".*", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.no_dns_just_forward_to_parent", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.uncacheable_requests_bypass_parent", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.no_origin_server_dns", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.use_client_target_addr", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.use_client_source_port", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.keep_alive_enabled_in", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.keep_alive_enabled_out", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.keep_alive_post_out", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.chunking_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.chunking.size", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.flow_control.enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.flow_control.high_water", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.flow_control.low_water", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.post.check.content_length.enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.strict_uri_parsing", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// # Send http11 requests
// #
// # 0 - Never
// # 1 - Always
// # 2 - if the server has returned http1.1 before
// # 3 - if the client request is 1.1 & the server
// # has returned 1.1 before
// #
{RECT_CONFIG, "proxy.config.http.send_http11_requests", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.send_100_continue_response", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.disallow_post_100_continue", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.server_session_sharing.match", RECD_STRING, "both", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.server_session_sharing.pool", RECD_STRING, "thread", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.default_buffer_size", RECD_INT, "8", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.default_buffer_water_mark", RECD_INT, "32768", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.enable_http_info", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.server_max_connections", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.max", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.match", RECD_STRING, "ip", RECU_DYNAMIC, RR_NULL, RECC_STR, "^(?:ip|host|both|none)$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.alert_delay", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.queue_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.queue_delay", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.min", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.attach_server_session_to_client", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.max_connections_in", RECD_INT, "30000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.max_connections_active_in", RECD_INT, "10000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
// ###########################
// # HTTP referrer filtering #
// ###########################
{RECT_CONFIG, "proxy.config.http.referer_filter", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.referer_format_redirect", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.referer_default_redirect", RECD_STRING, "http://www.example.com/", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.auth_server_session_private", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.max_post_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "^[0-9]+$", RECA_NULL}
,
// ##############################
// # parent proxy configuration #
// ##############################
{RECT_CONFIG, "proxy.config.http.parent_proxies", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.file", RECD_STRING, "parent.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.retry_time", RECD_INT, "300", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//# Parent fail threshold is the number of request that must fail within
//# the retry window for the parent to be marked down
{RECT_CONFIG, "proxy.config.http.parent_proxy.fail_threshold", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.total_connect_attempts", RECD_INT, "4", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.per_parent_connect_attempts", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.mark_down_hostdb", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.self_detect", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.forward.proxy_auth_to_parent", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ###################################
// # NO DNS DOC IN CACHE #
// ###################################
{RECT_CONFIG, "proxy.config.http.doc_in_cache_skip_dns", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// ###################################
// # HTTP connection timeouts (secs) #
// ###################################
// #
// # out: proxy -> os connection
// # in : ua -> proxy connection
// #
{RECT_CONFIG, "proxy.config.http.keep_alive_no_activity_timeout_in", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.keep_alive_no_activity_timeout_out", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.websocket.no_activity_timeout", RECD_INT, "600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.websocket.active_timeout", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.transaction_no_activity_timeout_in", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.transaction_no_activity_timeout_out", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.transaction_active_timeout_in", RECD_INT, "900", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.transaction_active_timeout_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.accept_no_activity_timeout", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.background_fill_active_timeout", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.background_fill_completed_threshold", RECD_FLOAT, "0.0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ##################################
// # origin server connect attempts #
// ##################################
{RECT_CONFIG, "proxy.config.http.connect_attempts_max_retries", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.connect_attempts_max_retries_dead_server", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.connect_attempts_rr_retries", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.post_connect_attempts_timeout", RECD_INT, "1800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.down_server.cache_time", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.down_server.abort_threshold", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.negative_revalidating_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.negative_revalidating_lifetime", RECD_INT, "1800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.negative_caching_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.negative_caching_lifetime", RECD_INT, "1800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.negative_caching_list", RECD_STRING, "204 305 403 404 405 414 500 501 502 503 504", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// #########################
// # proxy users variables #
// #########################
{RECT_CONFIG, "proxy.config.http.anonymize_remove_from", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.anonymize_remove_referer", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.anonymize_remove_user_agent", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.anonymize_remove_cookie", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.anonymize_remove_client_ip", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_client_ip", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.anonymize_other_header_list", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_squid_x_forwarded_for", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_forwarded", RECD_STRING, "none", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.proxy_protocol_whitelist", RECD_STRING, "none", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_age_in_response", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.enable_http_stats", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.allow_multi_range", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
// This defaults to a special invalid value so the HTTP transaction handling code can tell that it was not explicitly set.
{RECT_CONFIG, "proxy.config.http.normalize_ae", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
// ####################################################
// # Global User-Agent header #
// ####################################################
{RECT_CONFIG, "proxy.config.http.global_user_agent_header", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.request_line_max_size", RECD_INT, "65535", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.header_field_max_size", RECD_INT, "131070", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ############
// # security #
// ############
{RECT_CONFIG, "proxy.config.http.request_header_max_size", RECD_INT, "131072", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.response_header_max_size", RECD_INT, "131072", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.push_method_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// #################
// # cache control #
// #################
{RECT_CONFIG, "proxy.config.http.cache.http", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.generation", RECD_INT, "-1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_client_no_cache", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_client_cc_max_age", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ims_on_client_no_cache", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_server_no_cache", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # cache responses to cookies has 4 options
// #
// # 0 - do not cache any responses to cookies
// # 1 - cache for any content-type (ignore cookies)
// # 2 - cache only for image types
// # 3 - cache for all but text content-types
// # 4 - cache for all but text content-types except OS response without "Set-Cookie" or with "Cache-Control: public"
{RECT_CONFIG, "proxy.config.http.cache.cache_responses_to_cookies", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-4]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.ignore_authentication", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.cache_urls_that_look_dynamic", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.post_method", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.max_open_read_retries", RECD_INT, "-1", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.open_read_retry_time", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.max_open_write_retries", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # open_write_fail_action has 3 options:
// #
// # 0 - default. disable cache and goto origin
// # 1 - return error if cache miss
// # 2 - serve stale until proxy.config.http.cache.max_stale_age, then goto origin, if revalidate
// # 3 - return error if cache miss or serve stale until proxy.config.http.cache.max_stale_age, then goto origin, if revalidate
// # 4 - return error if cache miss or if revalidate
{RECT_CONFIG, "proxy.config.http.cache.open_write_fail_action", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # when_to_revalidate has 4 options:
// #
// # 0 - default. use use cache directives or heuristic
// # 1 - stale if heuristic
// # 2 - always stale (always revalidate)
// # 3 - never stale
// #
{RECT_CONFIG, "proxy.config.http.cache.when_to_revalidate", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//
// # required headers: three options
// #
// # 0 - No required headers to make document cachable
// # 1 - at least, "Last-Modified:" header required
// # 2 - explicit lifetime required, "Expires:" or "Cache-Control:"
// #
{RECT_CONFIG, "proxy.config.http.cache.required_headers", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.max_stale_age", RECD_INT, "604800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.range.lookup", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.range.write", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ########################
// # heuristic expiration #
// ########################
{RECT_CONFIG, "proxy.config.http.cache.heuristic_min_lifetime", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.heuristic_max_lifetime", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.heuristic_lm_factor", RECD_FLOAT, "0.10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.guaranteed_min_lifetime", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.guaranteed_max_lifetime", RECD_INT, "31536000", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ###################
// # Error Reporting #
// ###################
{RECT_CONFIG, "proxy.config.http.errors.log_error_pages", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.slow.log.threshold", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.connection.slow.log.threshold", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.stream.slow.log.threshold", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
//##############################################################################
//#
//# Customizable User Response Pages
//#
//##############################################################################
//# 1 - enable customizable user response pages in only the "default" directory
//# 2 - enable language-targeted user response pages
//# 3 - enable host-targeted user response pages
{RECT_CONFIG, "proxy.config.body_factory.enable_customizations", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT,
"[1-3]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.enable_logging", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.template_sets_dir", RECD_STRING, "body_factory", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.response_max_size", RECD_INT, "8192", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//# 0 - never suppress generated responses
//# 1 - always suppress generated responses
//# 2 - suppress responses for intercepted traffic
{RECT_CONFIG, "proxy.config.body_factory.response_suppression_mode", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.body_factory.template_base", RECD_STRING, "NONE", RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
,
//##############################################################################
//#
//# SOCKS Processor
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.socks.socks_needed", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.socks_version", RECD_INT, "4", RECU_RESTART_TS, RR_NULL, RECC_INT, "[4-5]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.socks_config_file", RECD_STRING, "socks.config", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.socks_timeout", RECD_INT, "100", RECU_RESTART_TS, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.server_connect_timeout", RECD_INT, "10", RECU_RESTART_TS, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.per_server_connection_attempts", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.connection_attempts", RECD_INT, "4", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.server_retry_timeout", RECD_INT, "300", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.default_servers", RECD_STRING, "", RECU_RESTART_TS, RR_NULL, RECC_STR, "^([^[:space:]]+:[0-9]+;?)*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.server_retry_time", RECD_INT, "300", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.server_fail_threshold", RECD_INT, "2", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.accept_enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.accept_port", RECD_INT, "1080", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-65535]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.socks.http_port", RECD_INT, "80", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# I/O Subsystem
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.io.max_buffer_size", RECD_INT, "32768", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Net Subsystem
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.net.connections_throttle", RECD_INT, "30000", RECU_RESTART_TS, RR_REQUIRED, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.listen_backlog", RECD_INT, "-1", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// This option takes different defaults depending on features / platform. TODO: This should use the
// autoconf stuff probably ?
{RECT_CONFIG, "proxy.config.net.defer_accept", RECD_INT,
#ifdef TCP_DEFER_ACCEPT
"45",
#else
"1",
#endif
RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-65535]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_recv_buffer_size_in", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_send_buffer_size_in", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_option_flag_in", RECD_INT, "0x5", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_packet_mark_in", RECD_INT, "0x0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_packet_tos_in", RECD_INT, "0x0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_recv_buffer_size_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_send_buffer_size_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_option_flag_out", RECD_INT, "0x1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_packet_mark_out", RECD_INT, "0x0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_packet_tos_out", RECD_INT, "0x0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_mss_in", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.poll_timeout", RECD_INT, "10", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.default_inactivity_timeout", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.inactivity_check_frequency", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.event_period", RECD_INT, "10", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.accept_period", RECD_INT, "10", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.retry_delay", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.throttle_delay", RECD_INT, "50", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.sock_option_tfo_queue_size_in", RECD_INT, "10000", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.tcp_congestion_control_in", RECD_STRING, "", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.net.tcp_congestion_control_out", RECD_STRING, "", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Hit Evacuation
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.cache.hit_evacuate_percent", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.hit_evacuate_size_limit", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Cache
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.cache.storage_filename", RECD_STRING, "storage.config", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.control.filename", RECD_STRING, "cache.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ip_allow.filename", RECD_STRING, "ip_allow.yaml", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.hosting_filename", RECD_STRING, "hosting.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.volume_filename", RECD_STRING, "volume.config", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.permit.pinning", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// # default the ram cache size to AUTO_SIZE (-1)
// # alternatively: 20971520 (20MB)
{RECT_CONFIG, "proxy.config.cache.ram_cache.size", RECD_INT, "-1", RECU_RESTART_TS, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ram_cache.algorithm", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ram_cache.use_seen_filter", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ram_cache.compress", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-3]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ram_cache.compress_percent", RECD_INT, "90", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # how often should the directory be synced (seconds)
{RECT_CONFIG, "proxy.config.cache.dir.sync_frequency", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.hostdb.disable_reverse_lookup", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.select_alternate", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.ram_cache_cutoff", RECD_INT, "4194304", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # The maximum number of alternates that are allowed for any given URL.
// # (0 disables the maximum number of alts check)
{RECT_CONFIG, "proxy.config.cache.limits.http.max_alts", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.force_sector_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.target_fragment_size", RECD_INT, "1048576", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # The maximum size of a document that will be stored in the cache.
// # (0 disables the maximum document size check)
{RECT_CONFIG, "proxy.config.cache.max_doc_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.min_average_object_size", RECD_INT, "8000", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.threads_per_disk", RECD_INT, "8", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.agg_write_backlog", RECD_INT, "5242880", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.enable_checksum", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.alt_rewrite_max_size", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.enable_read_while_writer", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.mutex_retry_delay", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.read_while_writer.max_retries", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.cache.read_while_writer_retry.delay", RECD_INT, "50", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# DNS
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.dns.lookup_timeout", RECD_INT, "20", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.retries", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-9]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.search_default_domains", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.failover_number", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.failover_period", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.max_dns_in_flight", RECD_INT, "2048", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.validate_query_name", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.splitDNS.enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.splitdns.filename", RECD_STRING, "splitdns.config", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.nameservers", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.local_ipv6", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.local_ipv4", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.resolv_conf", RECD_STRING, "/etc/resolv.conf", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.round_robin_nameservers", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.dedicated_thread", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.dns.connection_mode", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.ip_resolve", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# HostDB
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.hostdb", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
// # up to 511 characters, may not be changed while running
{RECT_CONFIG, "proxy.config.hostdb.filename", RECD_STRING, "host.db", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # in entries, may not be changed while running
{RECT_CONFIG, "proxy.config.hostdb.max_count", RECD_INT, "-1", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.round_robin_max_count", RECD_INT, "16", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.storage_path", RECD_STRING, TS_BUILD_CACHEDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.max_size", RECD_INT, "10M", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.partitions", RECD_INT, "64", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # in minutes (all three)
// # 0 = obey, 1 = ignore, 2 = min(X,ttl), 3 = max(X,ttl)
{RECT_CONFIG, "proxy.config.hostdb.ttl_mode", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-3]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.lookup_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.timeout", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.verify_after", RECD_INT, "720", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.fail.timeout", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.re_dns_on_reload", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.serve_stale_for", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # move entries to the owner on a lookup?
{RECT_CONFIG, "proxy.config.hostdb.migrate_on_demand", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # round-robin addresses for single clients
// # (can cause authentication problems)
{RECT_CONFIG, "proxy.config.hostdb.strict_round_robin", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.timed_round_robin", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// # how often should the hostdb be synced (seconds)
{RECT_CONFIG, "proxy.config.cache.hostdb.sync_frequency", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.host_file.path", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.hostdb.host_file.interval", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##########################################################################
//#
//# HTTP
//#
//##########################################################################
//##########################################################################
// ###########
// # CONNECT #
// ###########
{RECT_CONFIG, "proxy.config.http.connect_ports", RECD_STRING, "443", RECU_DYNAMIC, RR_NULL, RECC_STR, "^(\\*|[[:digit:][:space:]]+)$", RECA_NULL}
,
// ##########################
// # Various update periods #
// ##########################
// Periods of update threads
{RECT_CONFIG, "proxy.config.config_update_interval_ms", RECD_INT, "3000", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.raw_stat_sync_interval_ms", RECD_INT, "5000", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.remote_sync_interval_ms", RECD_INT, "5000", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// ###########
// # Parsing #
// ###########
//##############################################################################
//#
//# New Logging Config
//#
//##############################################################################
//# possible values for logging_enabled
//# 0: no logging at all
//# 1: log errors only
//# 2: full logging
{RECT_CONFIG, "proxy.config.log.logging_enabled", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-4]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.log_buffer_size", RECD_INT, "9216", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.max_secs_per_buffer", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.max_space_mb_for_logs", RECD_INT, "25000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.max_space_mb_headroom", RECD_INT, "1000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.hostname", RECD_STRING, "localhost", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.logfile_dir", RECD_STRING, TS_BUILD_LOGDIR, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.logfile_perm", RECD_STRING, "rw-r--r--", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.config.filename", RECD_STRING, "logging.yaml", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.preproc_threads", RECD_INT, "1", RECU_DYNAMIC, RR_REQUIRED, RECC_INT, "[1-128]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-4]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_interval_sec", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_offset_hr", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_size_mb", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_min_count", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_max_count", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.rolling_allow_empty", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.auto_delete_rolled_files", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.sampling_frequency", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.space_used_frequency", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.file_stat_frequency", RECD_INT, "32", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.ascii_buffer_size", RECD_INT, "36864", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.max_line_size", RECD_INT, "9216", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// How often periodic tasks get executed in the Log.cc infrastructure
{RECT_CONFIG, "proxy.config.log.periodic_tasks_interval", RECD_INT, "5", RECU_DYNAMIC, RR_NULL, RECC_NULL, "^[0-9]+$", RECA_NULL}
,
//##############################################################################
//#
//# Reverse Proxy
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.reverse_proxy.enabled", RECD_INT, "1", RECU_DYNAMIC, RR_REQUIRED, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.url_remap.filename", RECD_STRING, "remap.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.url_remap.remap_required", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.url_remap.pristine_host_hdr", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
//##############################################################################
//#
//# SSL Termination
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.ssl.server.session_ticket.enable", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.TLSv1", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.TLSv1_1", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// Disable this when using some versions of OpenSSL that causes crashes. See TS-2355.
{RECT_CONFIG, "proxy.config.ssl.TLSv1_2", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.TLSv1_3", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.TLSv1", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.TLSv1_1", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.TLSv1_2", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.TLSv1_3", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.cipher_suite", RECD_STRING, "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-CCM:ECDHE-ECDSA-AES128-CCM:ECDHE-ECDSA-AES256-CCM8:ECDHE-ECDSA-AES128-CCM8:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-CCM8:DHE-RSA-AES128-CCM8:DHE-RSA-AES256-CCM:DHE-RSA-AES128-CCM:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-CCM8:AES128-CCM8:AES256-CCM:AES128-CCM:AES256-SHA256:AES128-SHA2", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// Computed from openssl ciphers 'ALL:!aNULL:!aDH:!aECDH:!aPSK:!aSRP:!eNULL:!kSRP:!SSLv2:!SSLv3:!TLSv1:!TLSv1.1:@STRENGTH'
{RECT_CONFIG, "proxy.config.ssl.client.cipher_suite", RECD_STRING, "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-CCM8:ECDHE-ECDSA-AES256-CCM:DHE-RSA-AES256-CCM8:DHE-RSA-AES256-CCM:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-ARIA256-GCM-SHA384:ECDHE-ARIA256-GCM-SHA384:DHE-DSS-ARIA256-GCM-SHA384:DHE-RSA-ARIA256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA256:ECDHE-ECDSA-CAMELLIA256-SHA384:ECDHE-RSA-CAMELLIA256-SHA384:DHE-RSA-CAMELLIA256-SHA256:DHE-DSS-CAMELLIA256-SHA256:RSA-PSK-AES256-GCM-SHA384:RSA-PSK-CHACHA20-POLY1305:RSA-PSK-ARIA256-GCM-SHA384:AES256-GCM-SHA384:AES256-CCM8:AES256-CCM:ARIA256-GCM-SHA384:AES256-SHA256:CAMELLIA256-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-CCM8:ECDHE-ECDSA-AES128-CCM:DHE-RSA-AES128-CCM8:DHE-RSA-AES128-CCM:ECDHE-ECDSA-ARIA128-GCM-SHA256:ECDHE-ARIA128-GCM-SHA256:DHE-DSS-ARIA128-GCM-SHA256:DHE-RSA-ARIA128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:DHE-DSS-AES128-SHA256:ECDHE-ECDSA-CAMELLIA128-SHA256:ECDHE-RSA-CAMELLIA128-SHA256:DHE-RSA-CAMELLIA128-SHA256:DHE-DSS-CAMELLIA128-SHA256:RSA-PSK-AES128-GCM-SHA256:RSA-PSK-ARIA128-GCM-SHA256:AES128-GCM-SHA256:AES128-CCM8:AES128-CCM:ARIA128-GCM-SHA256:AES128-SHA256:CAMELLIA128-SHA256", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.honor_cipher_order", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.certification_level", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.cert.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.cert_chain.filename", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.multicert.filename", RECD_STRING, "ssl_multicert.config", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.multicert.exit_on_load_fail", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.servername.filename", RECD_STRING, "sni.yaml", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.ticket_key.filename", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.private_key.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.CA.cert.filename", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.CA.cert.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.verify.server", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.verify.server.policy", RECD_STRING, "PERMISSIVE", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.verify.server.properties", RECD_STRING, "ALL", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.cert.filename", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.cert.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.private_key.filename", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.private_key.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.CA.cert.filename", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.CA.cert.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.sni_policy", RECD_STRING, "host", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache", RECD_INT, "2", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache.size", RECD_INT, "102400", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache.num_buckets", RECD_INT, "256", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache.skip_cache_on_bucket_contention", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.max_record_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, "[0-16383]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache.timeout", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.session_cache.auto_clear", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.hsts_max_age", RECD_INT, "-1", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.hsts_include_subdomains", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.allow_client_renegotiation", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.server.dhparams_file", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.handshake_timeout_in", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-65535]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.cert.load_elevated", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.ssl.server.groups_list", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.groups_list", RECD_STRING, nullptr, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# OCSP (Online Certificate Status Protocol) Stapling Configuration
//#
//##############################################################################
// # Enable OCSP stapling. Disabled by default.
{RECT_CONFIG, "proxy.config.ssl.ocsp.enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
// # Number of seconds before an OCSP response expires in the stapling cache. 3600s (1 hour) by default.
{RECT_CONFIG, "proxy.config.ssl.ocsp.cache_timeout", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_NULL, "^[0-9]+$", RECA_NULL}
,
// # Timeout for queries to OCSP responders. 10s by default.
{RECT_CONFIG, "proxy.config.ssl.ocsp.request_timeout", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, "^[0-9]+$", RECA_NULL}
,
// # Update period for stapling caches. 60s (1 min) by default.
{RECT_CONFIG, "proxy.config.ssl.ocsp.update_period", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, "^[0-9]+$", RECA_NULL}
,
// # Base path for OCSP prefetched responses
{RECT_CONFIG, "proxy.config.ssl.ocsp.response.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//##############################################################################
//#
//# Configuration for TLSv1.3 and above
//#
//##############################################################################
{RECT_CONFIG, "proxy.config.ssl.server.TLSv1_3.cipher_suites", RECD_STRING, "TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.TLSv1_3.cipher_suites", RECD_STRING, "TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256", RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//############################################################################
//#
//# WCCP
//#
//############################################################################
{RECT_LOCAL, "proxy.config.wccp.addr", RECD_STRING, "", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.wccp.services", RECD_STRING, "", RECU_RESTART_TM, RR_NULL, RECC_NULL, nullptr, RECA_NULL }
,
//##############################################################################
//# Plug-in Configuration
//##############################################################################
//# Directory in which to find plugins
{RECT_CONFIG, "proxy.config.plugin.plugin_dir", RECD_STRING, TS_BUILD_LIBEXECDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_READ_ONLY}
,
{RECT_CONFIG, "proxy.config.plugin.load_elevated", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_READ_ONLY}
,
// Interim configuration setting for obeying keepalive requests on internal
// (PluginVC) sessions. See TS-4960 and friends.
{RECT_LOCAL, "proxy.config.http.keepalive_internal_vc", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL},
//##############################################################################
//#
//# Local Manager Specific Records File
//#
//# <RECORD-TYPE> <NAME> <TYPE> <VALUE (till end of line)>
//#
//# *NOTE*: All NODE Records must be placed continuously!
//#
//# Add NODE Records Here
//##############################################################################
{RECT_NODE, "proxy.node.hostname_FQ", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.hostname", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//#
//# Restart Stats
//#
{RECT_NODE, "proxy.node.restarts.manager.start_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.restarts.proxy.start_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.restarts.proxy.cache_ready_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.restarts.proxy.stop_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.restarts.proxy.restart_count", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//#
//# Manager Version Info
//#
{RECT_NODE, "proxy.node.version.manager.short", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.long", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.build_number", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.build_time", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.build_date", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.build_machine", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_NODE, "proxy.node.version.manager.build_person", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//#
//# SSL parent proxying info
//#
//# Set the value of this variable to 1 if this node
//# is also the default parent for all ssl requests
//# in a cluster. Setting the value to 1 will prevent
//# SSL requests from this proxy to a parent from
//# self-looping.
//#
{RECT_LOCAL, "proxy.local.http.parent_proxy.disable_connect_tunneling", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.forward_connect_method", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
//############
//#
//# HTTP/2 global configuration.
//#
//############
{RECT_CONFIG, "proxy.config.http2.stream_priority_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_concurrent_streams_in", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.min_concurrent_streams_in", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_active_streams_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.initial_window_size_in", RECD_INT, "1048576", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_frame_size", RECD_INT, "16384", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.header_table_size", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_header_list_size", RECD_INT, "131072", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.accept_no_activity_timeout", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.no_activity_timeout_in", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.active_timeout_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.push_diary_size", RECD_INT, "256", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.zombie_debug_timeout_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.stream_error_rate_threshold", RECD_FLOAT, "0.1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_settings_per_frame", RECD_INT, "7", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_settings_per_minute", RECD_INT, "14", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_settings_frames_per_minute", RECD_INT, "14", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_ping_frames_per_minute", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.max_priority_frames_per_minute", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.min_avg_window_update", RECD_FLOAT, "2560.0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//############
//#
//# HTTP/3 global configuration.
//#
//############
{RECT_CONFIG, "proxy.config.http3.header_table_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http3.max_header_list_size", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http3.qpack_blocked_streams", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http3.num_placeholders", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http3.max_settings", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
//############
//#
//# QUIC global configuration.
//#
//############
{RECT_CONFIG, "proxy.config.quic.instance_id", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.connection_table.size", RECD_INT, "65521", RECU_RESTART_TS, RR_NULL, RECC_INT, "[1-536870909]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.num_alt_connection_ids", RECD_INT, "8", RECU_RESTART_TS, RR_NULL, RECC_INT, "[8-256]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.server.stateless_retry_enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.client.vn_exercise_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.client.cm_exercise_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.server.supported_groups", RECD_STRING, "P-256:X25519:P-384:P-521" , RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.client.supported_groups", RECD_STRING, "P-256:X25519:P-384:P-521" , RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.client.session_file", RECD_STRING, nullptr , RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.client.keylog_file", RECD_STRING, nullptr , RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
// Transport Parameters
{RECT_CONFIG, "proxy.config.quic.no_activity_timeout_in", RECD_INT, "30000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.no_activity_timeout_out", RECD_INT, "30000", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.preferred_address_ipv4", RECD_STRING, nullptr , RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.preferred_address_ipv6", RECD_STRING, nullptr , RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_data_in", RECD_INT, "65536", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_data_out", RECD_INT, "65536", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_bidi_local_in", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_bidi_local_out", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_bidi_remote_in", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_bidi_remote_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_uni_in", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_stream_data_uni_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_streams_bidi_in", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_streams_bidi_out", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_streams_uni_in", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.initial_max_streams_uni_out", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.ack_delay_exponent_in", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.ack_delay_exponent_out", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.max_ack_delay_in", RECD_INT, "25", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.max_ack_delay_out", RECD_INT, "25", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
// Constants of Loss Detection
{RECT_CONFIG, "proxy.config.quic.loss_detection.packet_threshold", RECD_INT, "3", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.loss_detection.time_threshold", RECD_FLOAT, "1.25", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.loss_detection.granularity", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_STR, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.loss_detection.initial_rtt", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
// Constatns of Congestion Control
{RECT_CONFIG, "proxy.config.quic.congestion_control.max_datagram_size", RECD_INT, "1200", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.congestion_control.initial_window_scale", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.congestion_control.minimum_window_scale", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.congestion_control.loss_reduction_factor", RECD_FLOAT, "0.5", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[\\.0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.quic.congestion_control.persistent_congestion_threshold", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[\\.0-9]+$", RECA_NULL}
,
//# Add LOCAL Records Here
{RECT_LOCAL, "proxy.local.incoming_ip_to_bind", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_LOCAL, "proxy.local.outgoing_ip_to_bind", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//# Librecords based stats system (new as of v2.1.3)
{RECT_CONFIG, "proxy.config.stat_api.max_stats_allowed", RECD_INT, "256", RECU_RESTART_TS, RR_NULL, RECC_INT, "[256-1000]", RECA_NULL}
,
//############
//#
//# Per-thread freelist / allocator controls
//#
//############
/* this should be renamed in 6.0 */
{RECT_CONFIG, "proxy.config.allocator.thread_freelist_size", RECD_INT, "512", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.allocator.thread_freelist_low_watermark", RECD_INT, "32", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.allocator.hugepages", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.allocator.dontdump_iobuffers", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL}
,
//############
//#
//# Eric's super cool remap processor
//#
//############
{RECT_CONFIG, "proxy.config.remap.num_remap_threads", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
//###########
//#
//# Temporary and esoteric values.
//#
//###########
{RECT_CONFIG, "proxy.config.cache.http.compatibility.4-2-0-fixup", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL},
// Controls for TLS ASYN_JOBS and engine loading
{RECT_CONFIG, "proxy.config.ssl.async.handshake.enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_NULL, "[0-1]", RECA_NULL},
{RECT_CONFIG, "proxy.config.ssl.engine.conf_file", RECD_STRING, nullptr, RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL},
};
// clang-format on
void
RecordsConfigIterate(RecordElementCallback callback, void *data)
{
for (unsigned i = 0; i < countof(RecordsConfig); ++i) {
callback(&RecordsConfig[i], data);
}
}
|
; A114182: F(4n) - 2n - 1 where F(n) = Fibonacci numbers. Also, the floor of the log base phi of sequence A090162 (phi = (1+Sqrt(5))/2).
; 0,16,137,978,6754,46355,317796,2178292,14930333,102334134,701408710,4807526951,32951280072,225851433688,1548008755889,10610209857690,72723460248106,498454011879227,3416454622906668,23416728348467644
add $0,1
mul $0,2
mov $2,1
lpb $0,1
sub $0,1
add $1,$2
add $2,$1
add $3,5
trn $3,6
add $3,2
lpe
sub $1,$3
|
;-- XX18 --------------------------------------------------------------------------------------------------------------------------
UBnkDrawCam0xLo DB 0 ; XX18+0
UBnkDrawCam0xHi DB 0 ; XX18+1
UBnkDrawCam0xSgn DB 0 ; XX18+2
UBnkDrawCam0x equ UBnkDrawCam0xLo
UBnkDrawCam0yLo DB 0 ; XX18+3
UBnkDrawCam0yHi DB 0 ; XX18+4
UBnkDrawCam0ySgn DB 0 ; XX18+5
UBnkDrawCam0y equ UBnkDrawCam0yLo
UBnkDrawCam0zLo DB 0 ; XX18+6
UBnkDrawCam0zHi DB 0 ; XX18+7
UBnkDrawCam0zSgn DB 0 ; XX18+8
UBnkDrawCam0z equ UBnkDrawCam0zLo
XX18 equ UBnkDrawCam0xLo
|
; ****************************************************************************************************************
; ****************************************************************************************************************
;
; Memory and Macro Allocation.
;
; ****************************************************************************************************************
; ****************************************************************************************************************
OSMathLibrary = 0x0003 ; the Maths library is here.
BootMonitor = 0x210 ; address to boot monitor
; ****************************************************************************************************************
; Memory Allocation
; ****************************************************************************************************************
ScreenMirror = 0xC00 ; Screen mirror, 128 bytes, 256 byte page boundary.
ScreenCursor = ScreenMirror+0x80 ; Position on that screen (00..7F)
SystemVariables = 0xD00 ; System variables start here.
Variables = SystemVariables ; 128 16 bit variables start here.
IsRunning = SystemVariables-1 ; Non-zero if free running, zero if stopped (1 byte)
ProgramBase = SystemVariables-3 ; Program base address (2 bytes)
KeyboardBuffer = 0xE00 ; Keyboard Buffer
KeyboardBufferSize = 80 ; Size of keyboard Buffer
; ****************************************************************************************************************
; Macros
; ****************************************************************************************************************
lpi macro ptr,addr ; load pointer register with constant
ldi (addr) / 256
xpah ptr
ldi (addr) & 255
xpal ptr
endm
pushp macro ptr ; push pointer register on stack
xpah ptr
st @-1(p2)
xpal ptr
st @-1(p2)
endm
pullp macro ptr ; pull pointer register off stack
ld @1(p2)
xpal ptr
ld @1(p2)
xpah ptr
endm
pushe macro ; push E on stack
lde
st @-1(p2)
endm
pulle macro ; pull E off stack
ld @1(p2)
xae
endm
pusha macro ; push A on stack
st @-1(p2)
endm
pulla macro
ld @1(p2)
endm
setv macro ch,value ; sets a variable to a value, assumes P3 = Variables.
ldi (value) & 255
st ((ch) & 0x3F)*2(p3)
ldi (value) / 256
st ((ch) & 0x3F)*2+1(p3)
endm
code macro lineNo,code ; a debugging macro, which fakes up a line of code.
db strlen(code)+4 ; one byte offset to next (0 = End of code)
dw lineNo ; two byte line number (low byte first)
db code,0 ; ASCIIZ string
endm
special macro ch,method
db ch
dw (method)-1
endm |
; Original address was $B03C
; "Unused Level 12"
.word $0000 ; Alternate level layout
.word $0000 ; Alternate object layout
.byte LEVEL1_SIZE_04 | LEVEL1_YSTART_070
.byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18 | LEVEL2_UNUSEDFLAG
.byte LEVEL3_TILESET_04 | LEVEL3_VSCROLL_LOCKLOW
.byte LEVEL4_BGBANK_INDEX(4) | LEVEL4_INITACT_NOTHING
.byte LEVEL5_BGM_ATHLETIC | LEVEL5_TIME_300
.byte $19, $00, $68, $18, $02, $42, $12, $0E, $25, $13, $06, $24, $17, $0A, $22, $15
.byte $07, $04, $19, $0B, $04, $19, $0F, $61, $12, $08, $41, $11, $0F, $42, $14, $11
.byte $04, $36, $15, $62, $16, $19, $24, $15, $1A, $42, $18, $1A, $04, $18, $1C, $04
.byte $36, $20, $61, $13, $23, $10, $03, $19, $23, $63, $12, $24, $41, $14, $24, $04
.byte $36, $25, $10, $31, $2A, $60, $30, $2C, $82, $11, $2C, $10, $02, $35, $2C, $80
.byte $18, $2C, $40, $19, $2C, $62, $12, $2D, $04, $35, $2E, $80, $18, $2E, $40, $15
.byte $30, $10, $02, $16, $31, $04, $34, $35, $23, $34, $37, $00, $37, $34, $10, $38
.byte $34, $10, $37, $38, $10, $38, $38, $10, $19, $34, $65, $16, $3C, $61, $FF
|
BITS 32
metodi EQU 1
SECTION .rodata
vakio_pii dq 3.141592654 ;const double pii = 3.14...
SECTION .text
EXTERN set_method
GLOBAL laske_ala:function
;vastaa: double laske_ala(double). xmm0 = ympyrän pinta-ala. Siirretään lopuksi ala FPU:n st0-rekisteriin (Sys V 32-bit ABI)
laske_ala: push ebp ;ABI: rekisterin tila säilytettävä
mov ebp, esp ;funktion pinokehys
sub esp, 8 ;pinomuistin varaus. double (8 tavua) välikaisesti pinoon.
movsd xmm0, [ebp + 8] ;säde pinosta
mulsd xmm0, xmm0 ;xmm0 = säde²
mulsd xmm0, [vakio_pii] ;π otetaan muistivakioista, xmm0 = π * säde²
movsd [ebp - 8], xmm0 ;pinoon
fld qword [ebp - 8] ;st0:aan
push metodi
call set_method ;kerrotaan main():iin laskentatapa
add esp, 4
leave ;funktion pinon kehyksen purku ja väliaikaisen muistin vapautus
ret
|
#include "optionsdialog.h"
#include "ui_optionsdialog.h"
#include "bitcoinamountfield.h"
#include "bitcoinunits.h"
#include "monitoreddatamapper.h"
#include "netbase.h"
#include "optionsmodel.h"
#include "qvalidatedlineedit.h"
#include "qvaluecombobox.h"
#include <QCheckBox>
#include <QDir>
#include <QIntValidator>
#include <QLabel>
#include <QLineEdit>
#include <QLocale>
#include <QMessageBox>
#include <QPushButton>
#include <QRegExp>
#include <QRegExpValidator>
#include <QTabWidget>
#include <QWidget>
OptionsDialog::OptionsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::OptionsDialog),
model(0),
mapper(0),
fRestartWarningDisplayed_Proxy(false),
fRestartWarningDisplayed_Lang(false),
fProxyIpValid(true)
{
ui->setupUi(this);
/* Network elements init */
#ifndef USE_UPNP
ui->mapPortUpnp->setEnabled(false);
#endif
ui->socksVersion->setEnabled(false);
ui->socksVersion->addItem("5", 5);
ui->socksVersion->addItem("4", 4);
ui->socksVersion->setCurrentIndex(0);
ui->proxyIp->setEnabled(false);
ui->proxyPort->setEnabled(false);
ui->proxyPort->setValidator(new QIntValidator(0, 65535, this));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));
ui->proxyIp->installEventFilter(this);
/* Window elements init */
#ifdef Q_WS_MAC
ui->tabWindow->setVisible(false);
#endif
/* Display elements init */
QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
foreach(const QString &langStr, translations.entryList())
{
QLocale locale(langStr);
/** check if the locale name consists of 2 parts (language_country) */
if(langStr.contains("_"))
{
#if QT_VERSION >= 0x040800
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
}
else
{
#if QT_VERSION >= 0x040800
/** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language (locale name)", e.g. "German (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
}
}
ui->unit->setModel(new BitcoinUnits(this));
connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning_Proxy()));
connect(ui->lang, SIGNAL(activated(int)), this, SLOT(showRestartWarning_Lang()));
/* Widget-to-option mapper */
mapper = new MonitoredDataMapper(this);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
mapper->setOrientation(Qt::Vertical);
/* enable save buttons when data modified */
connect(mapper, SIGNAL(viewModified()), this, SLOT(enableSaveButtons()));
/* disable save buttons when new data loaded */
connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableSaveButtons()));
/* disable/enable save buttons when proxy IP is invalid/valid */
connect(this, SIGNAL(proxyIpValid(bool)), this, SLOT(setSaveButtonState(bool)));
}
OptionsDialog::~OptionsDialog()
{
delete ui;
}
void OptionsDialog::setModel(OptionsModel *model)
{
this->model = model;
if(model)
{
connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
mapper->setModel(model);
setMapper();
mapper->toFirst();
}
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void OptionsDialog::setMapper()
{
/* Main */
mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
mapper->addMapping(ui->detachDatabases, OptionsModel::DetachDatabases);
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion);
mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);
/* Window */
#ifndef Q_WS_MAC
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);
mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);
#endif
/* Display */
mapper->addMapping(ui->lang, OptionsModel::Language);
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);
}
void OptionsDialog::enableSaveButtons()
{
// prevent enabling of the save buttons when data modified, if there is an invalid proxy address present
if(fProxyIpValid)
setSaveButtonState(true);
}
void OptionsDialog::disableSaveButtons()
{
setSaveButtonState(false);
}
void OptionsDialog::setSaveButtonState(bool fState)
{
ui->applyButton->setEnabled(fState);
ui->okButton->setEnabled(fState);
}
void OptionsDialog::on_okButton_clicked()
{
mapper->submit();
accept();
}
void OptionsDialog::on_cancelButton_clicked()
{
reject();
}
void OptionsDialog::on_applyButton_clicked()
{
mapper->submit();
ui->applyButton->setEnabled(false);
}
void OptionsDialog::showRestartWarning_Proxy()
{
if(!fRestartWarningDisplayed_Proxy)
{
QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting Picocoin."), QMessageBox::Ok);
fRestartWarningDisplayed_Proxy = true;
}
}
void OptionsDialog::showRestartWarning_Lang()
{
if(!fRestartWarningDisplayed_Lang)
{
QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting Picocoin."), QMessageBox::Ok);
fRestartWarningDisplayed_Lang = true;
}
}
void OptionsDialog::updateDisplayUnit()
{
if(model)
{
// Update transactionFee with the current unit
ui->transactionFee->setDisplayUnit(model->getDisplayUnit());
}
}
bool OptionsDialog::eventFilter(QObject *object, QEvent *event)
{
if(object == ui->proxyIp && event->type() == QEvent::FocusOut)
{
// Check proxyIP for a valid IPv4/IPv6 address
CService addr;
if(!LookupNumeric(ui->proxyIp->text().toStdString().c_str(), addr))
{
ui->proxyIp->setValid(false);
fProxyIpValid = false;
ui->statusLabel->setStyleSheet("QLabel { color: red; }");
ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
emit proxyIpValid(false);
}
else
{
fProxyIpValid = true;
ui->statusLabel->clear();
emit proxyIpValid(true);
}
}
return QDialog::eventFilter(object, event);
}
|
include macros.inc
.code
; bool AVX_Packed_Array_Mean_Byte_(const uint8_t* input, uint32_t arrayLength, uint64_t* sum, double* mean)
AVX_Packed_Array_Mean_Byte_ proc frame
_CreateFrame CM_, 0, 64, rbx, r10, r11, r12
_SaveXmmRegs xmm6, xmm7, xmm8, xmm9
_EndProlog
xor eax, eax
test rdx, rdx ; Exit if arrayLenght == 0
jz InvalidArg
test rcx, 0fh ; Exit if not aligned
jnz InvalidArg
; Initializations
vpxor xmm8, xmm8, xmm8 ; xmm8 = last sum temp register (4 int32_t)
vpxor xmm9, xmm9, xmm9 ; xmm9 = packed zeros for conversions
mov r12, rdx ; Save arrayLength to final calculation
cmp rdx, 32 ; Do one by one if we can't fill the two xmm registers needed
jb OneByOne
@@:
vmovdqa xmm0, xmmword ptr [rcx]
vmovdqa xmm1, xmmword ptr [rcx+16]
; This will convert uint8_t to uint16_t.
; Needed to avoid truncation.
vpunpcklbw xmm2, xmm0, xmm9
vpunpckhbw xmm3, xmm0, xmm9
vpunpcklbw xmm4, xmm1, xmm9
vpunpckhbw xmm5, xmm1, xmm9
; Sum everything.
vpaddw xmm0, xmm2, xmm3
vpaddw xmm1, xmm4, xmm5
vpaddw xmm6, xmm0, xmm1 ; xmm6 = 8 uint16_t
; As we're going to sum this result with the
; next result, we need to convert it to uint32_t
; because uint16_t + uint16_t may overflow.
vpunpcklwd xmm1, xmm6, xmm9
vpunpckhwd xmm0, xmm6, xmm9
vpaddd xmm8, xmm0, xmm1 ; xmm8 = 4 uint32_t
add rcx, 32 * type byte ; Advance to next 32 numbers
sub rdx, 32
cmp rdx, 32
jae @B
; Sum the 4 integers in the temp sum register.
vpextrd eax, xmm8, 0
vpextrd r10d, xmm8, 1
add rax, r10 ; Use rax as uint32_t + uint32_t may overflow
vpextrd r10d, xmm8, 2
vpextrd r11d, xmm8, 3
add r10, r11
add rax, r10
OneByOne:
test rdx, rdx
jz Done
mov bl, byte ptr [rcx]
add rax, rbx
add rcx, type byte ; Advance to the next number
dec rdx
jnz OneByOne
Done:
mov qword ptr [r8], rax ; Save the final sum
; Calculate mean.
vcvtsi2sd xmm0, xmm0, rax ; Convert rax to double
vcvtsi2sd xmm1, xmm1, r12 ; Convert saved arrayLength do double
vdivsd xmm2, xmm0, xmm1
vmovsd real8 ptr [r9], xmm2 ; Save mean value
mov rax, 1
InvalidArg:
_RestoreXmmRegs xmm6, xmm7, xmm8, xmm9
_DeleteFrame rbx, r10, r11, r12
ret
AVX_Packed_Array_Mean_Byte_ endp
end |
DATA SEGMENT
NUM1 DB ?
NUM2 DB ?
RESULT DB ?
MSG1 DB 10,13,"ENTER FIRST NUMBER: $"
MSG2 DB 10,13,"ENTER SECOND NUMBER: $"
MSG3 DB 10,13,"RESULT: $"
MSG4 DB 10,13,"0 OR 1: $"
CMPR DW 45
ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
SUB AL,30H
MOV NUM1,AL
LEA DX,MSG2
MOV AH,9
INT 21H
MOV AH,1
INT 21H
SUB AL,30H
MOV NUM2,AL
MUL NUM1
MOV RESULT,AL
AAM
ADD AH,30H
ADD AL,30H
MOV BX,AX
LEA DX,MSG3
MOV AH,9
INT 21H
MOV AH,2
MOV DL,BH
INT 21H
MOV AH,2
MOV DL,BL
INT 21H
LEA DX,MSG4
MOV AH,9
INT 21H
CMP BX,CMPR
JL @LESS
JG @GREATER
@GREATER:
MOV DL, '1'
JMP @DISPLAY
@LESS:
MOV DL, '0'
JMP @DISPLAY
@DISPLAY:
MOV AH, 2
INT 21H
MOV AH,4CH
INT 21H
ENDS
END START
|
; Sends a command to DOS and fetches the response.
;
; Syntax: dos <command>
;
; e.g. to delete a file: dos s:filename
.include "c64.inc"
.include "cshell.inc"
PTR1 = 6
YTEMP = 8
PTR2 = 9
.cpu "6502"
CSHELL_HEADER
ldy #PPB_ARGPTR
lda (PPB), y
tay
jsr parse_parameters
jsr open_submit_file
jsr parse_file
jsr close_submit_file
lda nflag
bne nflag_cmd
jsr copy_to_destination
rts
; --- File dumper ------------------------------------------------------------
; Just lists the buffer to stdout without doing anything.
nflag_cmd:
lda #<buffer
sta PTR1+0
lda #>buffer
sta PTR1+1
-
ldy #0
lda (PTR1), y
beq nflag_eof
jsr CHROUT
inc PTR1+0
bne +
inc PTR1+1
+
jmp -
nflag_eof:
lda #13
jmp CHROUT
; --- Parameter parsing -----------------------------------------------------
; On entry, Y is the PPB offset.
parse_parameters:
lda (PPB), y
cmp #'-'
bne no_arguments
iny
lda (PPB), y
cmp #'h'
bne +
; Print help.
jsr print
.null "syntax: submit [-h] [-n] <subfile> [<parameters>...]", 13
jmp error
+
cmp #'n'
bne +
inc nflag
+
iny
lda (PPB), y
no_arguments:
-
cmp #' '
bne +
iny
lda (PPB), y
jmp -
+
; Y is now pointing at the first actual word. Parse the string, accumulating
; pointers to them, and null-terminating.
ldx #0
argument_parse_loop:
tya
sta words, x ; store offset to this word
inx
- ; skip non-whitespace
iny
lda (PPB), y
beq end_of_line
cmp #' '
bne -
lda #0
sta (PPB), y ; terminate last word
- ; skip whitespace
iny
lda (PPB), y
beq end_of_line
cmp #' '
beq -
jmp argument_parse_loop
end_of_line:
rts
; --- Utilities --------------------------------------------------------------
; (Here to keep them within relative jump range)
file_error:
jsr print
.null "File error", 13
; fall through
error:
lda #1
ldy #PPB_STATUS
sta (PPB), y
jmp (CSHELL)
; --- Load source file -------------------------------------------------------
open_submit_file:
; Copy the source filename to the buffer.
ldy words
ldx #0
-
lda (PPB), y
beq +
sta buffer, x
iny
inx
jmp -
+
; Now append the .sub suffix.
ldy #4
-
lda dotsub, y
sta buffer, x
inx
dey
bpl -
dex
; X is the file length.
txa
ldx #<buffer
ldy #>buffer
jsr SETNAM
ldy #PPB_DRIVE
lda (PPB), y
tax
lda #1
ldy #0
jsr SETLFS
; Try and open the file.
jsr OPEN
jsr get_drive_status
rts
close_submit_file:
lda #1
jmp CLOSE
; Read the drive status bytes into the buffer.
get_drive_status:
ldy #PPB_DRIVE
lda (PPB), y
tax
lda #15
ldy #15
jsr SETLFS
lda #0
jsr SETNAM
jsr OPEN
ldx #15
jsr CHKIN
jsr CHRIN
cmp #'2'
bcc no_drive_error
-
jsr CHROUT
jsr READST
and #$40 ; check for EOF
bne +
jsr CHRIN
jmp -
+
ldx #0
jsr CHKIN
lda #15
jsr CLOSE
lda #1
ldy #PPB_STATUS
sta (PPB), y
jmp (CSHELL)
no_drive_error:
-
jsr READST
and #$40 ; check for EOF
bne +
jsr CHRIN
jmp -
+
ldx #0
jsr CHKOUT
lda #15
jsr CLOSE
rts
; --- Read and parse the file ------------------------------------------------
parse_file:
lda #<buffer
sta PTR1+0
lda #>buffer
sta PTR1+1
ldx #1
jsr CHKIN
parse_loop:
jsr READST
and #$40 ; check for EOF
bne eof
jsr CHRIN
cmp #'$'
bne not_dollar
jsr CHRIN
cmp #'$'
beq not_dollar ; $$ gets turned into a $
sec
sbc #'0'
cmp #10
bcs parse_loop ; out of range
tay
lda words, y
beq not_dollar ; no such parameter
tay
-
lda (PPB), y
beq parse_loop
iny
sty YTEMP
ldy #0
sta (PTR1), y
ldy YTEMP
inc PTR1+0
bne -
inc PTR1+1
jmp -
not_dollar:
ldy #0
sta (PTR1), y
inc PTR1+0
bne +
inc PTR1+1
+
jmp parse_loop
eof:
ldx #0
jsr CHKIN
lda #0
ldy #0
sta (PTR1), y ; null-terminate buffer
rts
; --- Copy to destination ----------------------------------------------------
; Copies the contents of the buffer to just below TOP.
; On entry, PTR1 points to the end of the buffer.
copy_to_destination:
; Set PTR1 to the length of the buffer.
sec
lda PTR1+0
sbc #<buffer
sta PTR1+0
lda PTR1+1
sbc #>buffer
sta PTR1+1
; Now compute the start address into PTR2.
sec
jsr MEMTOP
sec
txa
sbc PTR1+0
sta PTR2+0
tya
sbc PTR1+1
sta PTR2+1
; Update the kernal's top-of-memory address.
ldx PTR2+0
ldy PTR2+1
clc
jsr MEMTOP
; Tell cshell to start reading input from the buffer.
ldy #PPB_INPUTBUF
lda PTR2+0
sta (PPB), y
iny
lda PTR2+1
sta (PPB), y
; Now copy the buffer.
lda #<buffer
sta PTR1+0
lda #>buffer
sta PTR1+1
ldy #0
-
lda (PTR1), y
sta (PTR2), y
beq end_of_copy
inc PTR1+0
bne +
inc PTR1+1
+
inc PTR2+0
bne +
inc PTR2+1
+
jmp -
end_of_copy:
rts
; --- Utilities --------------------------------------------------------------
print:
pla ; low byte
sta 2
pla ; high byte
sta 3
ldy #1
-
lda (2), y
inc 2
bne +
inc 3
+
tax ; set flags for A
beq +
jsr CHROUT
jmp -
+
lda 3
pha
lda 2
pha
rts
dotsub: .text 0, 'bus.' ; backwards
nflag: .byte 0
words: .fill 10, 0
buffer:
|
; CISP 310 - Michael Dinh
; Assignment 4: Gas Mileage
; 10/11/2020
INCLUDE io.h
.DATA
tankCap DWORD ?
gasMile DWORD ?
prompt1 BYTE "Enter how many gallons of gas your car can hold.", 0
prompt2 BYTE "Enter how many miles your car can drive on a full tank.", 0
string BYTE 40 DUP (?)
resultLb BYTE "Total approx. MPG your car gets is", 0
mpgN BYTE 11 DUP(?), 0
.CODE
MainProc PROC
; reserve stack space
sub rsp, 120
; first, read gas capacity and mileage, and convert to int
input prompt1, string, 40
atod string
mov tankCap, eax
input prompt2, string, 40
atod string
mov gasMile, eax
; now we need to calculate the gas mileage
; gas mileage = gasMile / tankCap
; i.e. total miles on a full tank / capacity of the tank
; since we are dealing with integer division,
; assume we can drop the remainder for our purposes
mov eax, gasMile ; put gasMile to EAX
div tankCap ; perform div with tankCap as divisor
dtoa mpgN, eax ; convert to ASCII, store in mpgN
; last, we need to output our results to the user
output resultLb, mpgN
; program end
add rsp, 120 ; restore stack
mov rax, 0 ; value to return (0)
ret
MainProc ENDP
END |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
lea addresses_UC_ht+0xacfc, %rax
nop
nop
nop
nop
nop
inc %rcx
mov (%rax), %r8d
nop
xor %r11, %r11
lea addresses_WC_ht+0x1e100, %rbx
and $12164, %rbp
mov (%rbx), %edi
nop
xor $38689, %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rax
push %rdx
// Load
lea addresses_RW+0x725c, %r8
nop
nop
xor %r14, %r14
vmovups (%r8), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %rax
dec %r8
// Faulty Load
lea addresses_normal+0x485c, %rax
nop
nop
nop
nop
cmp %r11, %r11
movb (%rax), %r14b
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rdx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
; A285679: Positions of 2 in A285677.
; 3,5,10,12,17,22,24,29,31,36,41,43,48,53,55,60,62,67,72,74,79,81,86,91,93,98,103,105,110,112,117,122,124,129,134,136,141,143,148,153,155,160,162,167,172,174,179,184,186,191,193,198,203,205,210,212,217,222,224,229,234,236,241,243,248,253,255,260,265,267,272,274,279,284,286,291,293,298,303,305,310,315,317,322,324,329,334,336,341,346,348,353,355,360,365,367,372,374,379,384
mov $1,$0
seq $1,276886 ; Sums-complement of the Beatty sequence for 2 + phi.
mov $2,$1
add $2,2
add $0,$2
div $0,2
add $0,$1
add $0,1
|
#include "wrap_light_manager.h"
#include <pybind11/stl.h>
namespace py = pybind11;
#include "light_manager.h"
void wrap_light_manager(pybind11::module_& m) {
py::class_<LightManager> t(m, "LightManager");
t.def("add_light", &LightManager::add_light);
t.def("remove_light", &LightManager::remove_light);
t.def("set_sun", &LightManager::set_sun);
t.def("get_sun", &LightManager::get_sun);
}
|
-- 7 Billion Humans --
-- 32: Creative Writhing --
-- Size: 11/8 --
-- Speed: 38/40 --
a:
step s
b:
pickup c
write 99
drop
if s == datacube:
jump a
endif
if e == datacube:
step e
else:
step w
endif
jump b
|
; A266611: Middle column of the "Rule 41" elementary cellular automaton starting with a single ON (black) cell.
; 1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1
mov $2,3
bin $2,$0
add $0,$2
mod $0,2
mov $1,$0
|
;*****************************************************************************
;* MMX/SSE2/AVX-optimized 10-bit H.264 intra prediction code
;*****************************************************************************
;* Copyright (C) 2005-2011 x264 project
;*
;* Authors: Daniel Kang <daniel.d.kang@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
cextern pw_16
cextern pw_8
cextern pw_4
cextern pw_2
cextern pw_1
pw_m32101234: dw -3, -2, -1, 0, 1, 2, 3, 4
pw_m3: times 8 dw -3
pw_pixel_max: times 8 dw ((1 << 10)-1)
pw_512: times 8 dw 512
pd_17: times 4 dd 17
pd_16: times 4 dd 16
SECTION .text
; dest, left, right, src
; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2
%macro PRED4x4_LOWPASS 4
paddw %2, %3
psrlw %2, 1
pavgw %1, %4, %2
%endmacro
;-----------------------------------------------------------------------------
; void ff_pred4x4_down_right(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_DR 0
cglobal pred4x4_down_right_10, 3, 3
sub r0, r2
lea r1, [r0+r2*2]
movhps m1, [r1-8]
movhps m2, [r0+r2*1-8]
movhps m4, [r0-8]
punpckhwd m2, m4
movq m3, [r0]
punpckhdq m1, m2
PALIGNR m3, m1, 10, m1
movhps m4, [r1+r2*1-8]
PALIGNR m0, m3, m4, 14, m4
movhps m4, [r1+r2*2-8]
PALIGNR m2, m0, m4, 14, m4
PRED4x4_LOWPASS m0, m2, m3, m0
movq [r1+r2*2], m0
psrldq m0, 2
movq [r1+r2*1], m0
psrldq m0, 2
movq [r0+r2*2], m0
psrldq m0, 2
movq [r0+r2*1], m0
RET
%endmacro
INIT_XMM sse2
PRED4x4_DR
INIT_XMM ssse3
PRED4x4_DR
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED4x4_DR
%endif
;------------------------------------------------------------------------------
; void ff_pred4x4_vertical_right(pixel *src, const pixel *topright, int stride)
;------------------------------------------------------------------------------
%macro PRED4x4_VR 0
cglobal pred4x4_vertical_right_10, 3, 3, 6
sub r0, r2
lea r1, [r0+r2*2]
movq m5, [r0] ; ........t3t2t1t0
movhps m1, [r0-8]
PALIGNR m0, m5, m1, 14, m1 ; ......t3t2t1t0lt
pavgw m5, m0
movhps m1, [r0+r2*1-8]
PALIGNR m0, m1, 14, m1 ; ....t3t2t1t0ltl0
movhps m2, [r0+r2*2-8]
PALIGNR m1, m0, m2, 14, m2 ; ..t3t2t1t0ltl0l1
movhps m3, [r1+r2*1-8]
PALIGNR m2, m1, m3, 14, m3 ; t3t2t1t0ltl0l1l2
PRED4x4_LOWPASS m1, m0, m2, m1
pslldq m0, m1, 12
psrldq m1, 4
movq [r0+r2*1], m5
movq [r0+r2*2], m1
PALIGNR m5, m0, 14, m2
pslldq m0, 2
movq [r1+r2*1], m5
PALIGNR m1, m0, 14, m0
movq [r1+r2*2], m1
RET
%endmacro
INIT_XMM sse2
PRED4x4_VR
INIT_XMM ssse3
PRED4x4_VR
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED4x4_VR
%endif
;-------------------------------------------------------------------------------
; void ff_pred4x4_horizontal_down(pixel *src, const pixel *topright, int stride)
;-------------------------------------------------------------------------------
%macro PRED4x4_HD 0
cglobal pred4x4_horizontal_down_10, 3, 3
sub r0, r2
lea r1, [r0+r2*2]
movq m0, [r0-8] ; lt ..
movhps m0, [r0]
pslldq m0, 2 ; t2 t1 t0 lt .. .. .. ..
movq m1, [r1+r2*2-8] ; l3
movq m3, [r1+r2*1-8]
punpcklwd m1, m3 ; l2 l3
movq m2, [r0+r2*2-8] ; l1
movq m3, [r0+r2*1-8]
punpcklwd m2, m3 ; l0 l1
punpckhdq m1, m2 ; l0 l1 l2 l3
punpckhqdq m1, m0 ; t2 t1 t0 lt l0 l1 l2 l3
psrldq m0, m1, 4 ; .. .. t2 t1 t0 lt l0 l1
psrldq m3, m1, 2 ; .. t2 t1 t0 lt l0 l1 l2
pavgw m5, m1, m3
PRED4x4_LOWPASS m3, m1, m0, m3
punpcklwd m5, m3
psrldq m3, 8
PALIGNR m3, m5, 12, m4
movq [r1+r2*2], m5
movhps [r0+r2*2], m5
psrldq m5, 4
movq [r1+r2*1], m5
movq [r0+r2*1], m3
RET
%endmacro
INIT_XMM sse2
PRED4x4_HD
INIT_XMM ssse3
PRED4x4_HD
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED4x4_HD
%endif
;-----------------------------------------------------------------------------
; void ff_pred4x4_dc(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro HADDD 2 ; sum junk
%if mmsize == 16
movhlps %2, %1
paddd %1, %2
pshuflw %2, %1, 0xE
paddd %1, %2
%else
pshufw %2, %1, 0xE
paddd %1, %2
%endif
%endmacro
%macro HADDW 2
pmaddwd %1, [pw_1]
HADDD %1, %2
%endmacro
INIT_MMX mmxext
cglobal pred4x4_dc_10, 3, 3
sub r0, r2
lea r1, [r0+r2*2]
movq m2, [r0+r2*1-8]
paddw m2, [r0+r2*2-8]
paddw m2, [r1+r2*1-8]
paddw m2, [r1+r2*2-8]
psrlq m2, 48
movq m0, [r0]
HADDW m0, m1
paddw m0, [pw_4]
paddw m0, m2
psrlw m0, 3
SPLATW m0, m0, 0
movq [r0+r2*1], m0
movq [r0+r2*2], m0
movq [r1+r2*1], m0
movq [r1+r2*2], m0
RET
;-----------------------------------------------------------------------------
; void ff_pred4x4_down_left(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_DL 0
cglobal pred4x4_down_left_10, 3, 3
sub r0, r2
movq m0, [r0]
movhps m0, [r1]
psrldq m2, m0, 2
pslldq m3, m0, 2
pshufhw m2, m2, 10100100b
PRED4x4_LOWPASS m0, m3, m2, m0
lea r1, [r0+r2*2]
movhps [r1+r2*2], m0
psrldq m0, 2
movq [r0+r2*1], m0
psrldq m0, 2
movq [r0+r2*2], m0
psrldq m0, 2
movq [r1+r2*1], m0
RET
%endmacro
INIT_XMM sse2
PRED4x4_DL
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED4x4_DL
%endif
;-----------------------------------------------------------------------------
; void ff_pred4x4_vertical_left(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED4x4_VL 0
cglobal pred4x4_vertical_left_10, 3, 3
sub r0, r2
movu m1, [r0]
movhps m1, [r1]
psrldq m0, m1, 2
psrldq m2, m1, 4
pavgw m4, m0, m1
PRED4x4_LOWPASS m0, m1, m2, m0
lea r1, [r0+r2*2]
movq [r0+r2*1], m4
movq [r0+r2*2], m0
psrldq m4, 2
psrldq m0, 2
movq [r1+r2*1], m4
movq [r1+r2*2], m0
RET
%endmacro
INIT_XMM sse2
PRED4x4_VL
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED4x4_VL
%endif
;-----------------------------------------------------------------------------
; void ff_pred4x4_horizontal_up(pixel *src, const pixel *topright, int stride)
;-----------------------------------------------------------------------------
INIT_MMX mmxext
cglobal pred4x4_horizontal_up_10, 3, 3
sub r0, r2
lea r1, [r0+r2*2]
movq m0, [r0+r2*1-8]
punpckhwd m0, [r0+r2*2-8]
movq m1, [r1+r2*1-8]
punpckhwd m1, [r1+r2*2-8]
punpckhdq m0, m1
pshufw m1, m1, 0xFF
movq [r1+r2*2], m1
movd [r1+r2*1+4], m1
pshufw m2, m0, 11111001b
movq m1, m2
pavgw m2, m0
pshufw m5, m0, 11111110b
PRED4x4_LOWPASS m1, m0, m5, m1
movq m6, m2
punpcklwd m6, m1
movq [r0+r2*1], m6
psrlq m2, 16
psrlq m1, 16
punpcklwd m2, m1
movq [r0+r2*2], m2
psrlq m2, 32
movd [r1+r2*1], m2
RET
;-----------------------------------------------------------------------------
; void ff_pred8x8_vertical(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_vertical_10, 2, 2
sub r0, r1
mova m0, [r0]
%rep 3
mova [r0+r1*1], m0
mova [r0+r1*2], m0
lea r0, [r0+r1*2]
%endrep
mova [r0+r1*1], m0
mova [r0+r1*2], m0
RET
;-----------------------------------------------------------------------------
; void ff_pred8x8_horizontal(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_horizontal_10, 2, 3
mov r2d, 4
.loop:
movq m0, [r0+r1*0-8]
movq m1, [r0+r1*1-8]
pshuflw m0, m0, 0xff
pshuflw m1, m1, 0xff
punpcklqdq m0, m0
punpcklqdq m1, m1
mova [r0+r1*0], m0
mova [r0+r1*1], m1
lea r0, [r0+r1*2]
dec r2d
jg .loop
REP_RET
;-----------------------------------------------------------------------------
; void ff_predict_8x8_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro MOV8 2-3
; sort of a hack, but it works
%if mmsize==8
movq [%1+0], %2
movq [%1+8], %3
%else
movdqa [%1], %2
%endif
%endmacro
%macro PRED8x8_DC 1
cglobal pred8x8_dc_10, 2, 6
sub r0, r1
pxor m4, m4
movq m0, [r0+0]
movq m1, [r0+8]
%if mmsize==16
punpcklwd m0, m1
movhlps m1, m0
paddw m0, m1
%else
pshufw m2, m0, 00001110b
pshufw m3, m1, 00001110b
paddw m0, m2
paddw m1, m3
punpcklwd m0, m1
%endif
%1 m2, m0, 00001110b
paddw m0, m2
lea r5, [r1*3]
lea r4, [r0+r1*4]
movzx r2d, word [r0+r1*1-2]
movzx r3d, word [r0+r1*2-2]
add r2d, r3d
movzx r3d, word [r0+r5*1-2]
add r2d, r3d
movzx r3d, word [r4-2]
add r2d, r3d
movd m2, r2d ; s2
movzx r2d, word [r4+r1*1-2]
movzx r3d, word [r4+r1*2-2]
add r2d, r3d
movzx r3d, word [r4+r5*1-2]
add r2d, r3d
movzx r3d, word [r4+r1*4-2]
add r2d, r3d
movd m3, r2d ; s3
punpcklwd m2, m3
punpckldq m0, m2 ; s0, s1, s2, s3
%1 m3, m0, 11110110b ; s2, s1, s3, s3
%1 m0, m0, 01110100b ; s0, s1, s3, s1
paddw m0, m3
psrlw m0, 2
pavgw m0, m4 ; s0+s2, s1, s3, s1+s3
%if mmsize==16
punpcklwd m0, m0
pshufd m3, m0, 11111010b
punpckldq m0, m0
SWAP 0,1
%else
pshufw m1, m0, 0x00
pshufw m2, m0, 0x55
pshufw m3, m0, 0xaa
pshufw m4, m0, 0xff
%endif
MOV8 r0+r1*1, m1, m2
MOV8 r0+r1*2, m1, m2
MOV8 r0+r5*1, m1, m2
MOV8 r0+r1*4, m1, m2
MOV8 r4+r1*1, m3, m4
MOV8 r4+r1*2, m3, m4
MOV8 r4+r5*1, m3, m4
MOV8 r4+r1*4, m3, m4
RET
%endmacro
INIT_MMX mmxext
PRED8x8_DC pshufw
INIT_XMM sse2
PRED8x8_DC pshuflw
;-----------------------------------------------------------------------------
; void ff_pred8x8_top_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_top_dc_10, 2, 4
sub r0, r1
mova m0, [r0]
pshuflw m1, m0, 0x4e
pshufhw m1, m1, 0x4e
paddw m0, m1
pshuflw m1, m0, 0xb1
pshufhw m1, m1, 0xb1
paddw m0, m1
lea r2, [r1*3]
lea r3, [r0+r1*4]
paddw m0, [pw_2]
psrlw m0, 2
mova [r0+r1*1], m0
mova [r0+r1*2], m0
mova [r0+r2*1], m0
mova [r0+r1*4], m0
mova [r3+r1*1], m0
mova [r3+r1*2], m0
mova [r3+r2*1], m0
mova [r3+r1*4], m0
RET
;-----------------------------------------------------------------------------
; void ff_pred8x8_plane(pixel *src, int stride)
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal pred8x8_plane_10, 2, 7, 7
sub r0, r1
lea r2, [r1*3]
lea r3, [r0+r1*4]
mova m2, [r0]
pmaddwd m2, [pw_m32101234]
HADDD m2, m1
movd m0, [r0-4]
psrld m0, 14
psubw m2, m0 ; H
movd m0, [r3+r1*4-4]
movd m1, [r0+12]
paddw m0, m1
psllw m0, 4 ; 16*(src[7*stride-1] + src[-stride+7])
movzx r4d, word [r3+r1*1-2] ; src[4*stride-1]
movzx r5d, word [r0+r2*1-2] ; src[2*stride-1]
sub r4d, r5d
movzx r6d, word [r3+r1*2-2] ; src[5*stride-1]
movzx r5d, word [r0+r1*2-2] ; src[1*stride-1]
sub r6d, r5d
lea r4d, [r4+r6*2]
movzx r5d, word [r3+r2*1-2] ; src[6*stride-1]
movzx r6d, word [r0+r1*1-2] ; src[0*stride-1]
sub r5d, r6d
lea r5d, [r5*3]
add r4d, r5d
movzx r6d, word [r3+r1*4-2] ; src[7*stride-1]
movzx r5d, word [r0+r1*0-2] ; src[ -stride-1]
sub r6d, r5d
lea r4d, [r4+r6*4]
movd m3, r4d ; V
punpckldq m2, m3
pmaddwd m2, [pd_17]
paddd m2, [pd_16]
psrad m2, 5 ; b, c
mova m3, [pw_pixel_max]
pxor m1, m1
SPLATW m0, m0, 1
SPLATW m4, m2, 2
SPLATW m2, m2, 0
pmullw m2, [pw_m32101234] ; b
pmullw m5, m4, [pw_m3] ; c
paddw m5, [pw_16]
mov r2d, 8
add r0, r1
.loop:
paddsw m6, m2, m5
paddsw m6, m0
psraw m6, 5
CLIPW m6, m1, m3
mova [r0], m6
paddw m5, m4
add r0, r1
dec r2d
jg .loop
REP_RET
;-----------------------------------------------------------------------------
; void ff_pred8x8l_128_dc(pixel *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_128_DC 0
cglobal pred8x8l_128_dc_10, 4, 4
mova m0, [pw_512] ; (1<<(BIT_DEPTH-1))
lea r1, [r3*3]
lea r2, [r0+r3*4]
MOV8 r0+r3*0, m0, m0
MOV8 r0+r3*1, m0, m0
MOV8 r0+r3*2, m0, m0
MOV8 r0+r1*1, m0, m0
MOV8 r2+r3*0, m0, m0
MOV8 r2+r3*1, m0, m0
MOV8 r2+r3*2, m0, m0
MOV8 r2+r1*1, m0, m0
RET
%endmacro
INIT_MMX mmxext
PRED8x8L_128_DC
INIT_XMM sse2
PRED8x8L_128_DC
;-----------------------------------------------------------------------------
; void ff_pred8x8l_top_dc(pixel *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_TOP_DC 0
cglobal pred8x8l_top_dc_10, 4, 4, 6
sub r0, r3
mova m0, [r0]
shr r1d, 14
shr r2d, 13
neg r1
pslldq m1, m0, 2
psrldq m2, m0, 2
pinsrw m1, [r0+r1], 0
pinsrw m2, [r0+r2+14], 7
lea r1, [r3*3]
lea r2, [r0+r3*4]
PRED4x4_LOWPASS m0, m2, m1, m0
HADDW m0, m1
paddw m0, [pw_4]
psrlw m0, 3
SPLATW m0, m0, 0
mova [r0+r3*1], m0
mova [r0+r3*2], m0
mova [r0+r1*1], m0
mova [r0+r3*4], m0
mova [r2+r3*1], m0
mova [r2+r3*2], m0
mova [r2+r1*1], m0
mova [r2+r3*4], m0
RET
%endmacro
INIT_XMM sse2
PRED8x8L_TOP_DC
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_TOP_DC
%endif
;-------------------------------------------------------------------------------
; void ff_pred8x8l_dc(pixel *src, int has_topleft, int has_topright, int stride)
;-------------------------------------------------------------------------------
;TODO: see if scalar is faster
%macro PRED8x8L_DC 0
cglobal pred8x8l_dc_10, 4, 6, 6
sub r0, r3
lea r4, [r0+r3*4]
lea r5, [r3*3]
mova m0, [r0+r3*2-16]
punpckhwd m0, [r0+r3*1-16]
mova m1, [r4+r3*0-16]
punpckhwd m1, [r0+r5*1-16]
punpckhdq m1, m0
mova m2, [r4+r3*2-16]
punpckhwd m2, [r4+r3*1-16]
mova m3, [r4+r3*4-16]
punpckhwd m3, [r4+r5*1-16]
punpckhdq m3, m2
punpckhqdq m3, m1
mova m0, [r0]
shr r1d, 14
shr r2d, 13
neg r1
pslldq m1, m0, 2
psrldq m2, m0, 2
pinsrw m1, [r0+r1], 0
pinsrw m2, [r0+r2+14], 7
not r1
and r1, r3
pslldq m4, m3, 2
psrldq m5, m3, 2
pshuflw m4, m4, 11100101b
pinsrw m5, [r0+r1-2], 7
PRED4x4_LOWPASS m3, m4, m5, m3
PRED4x4_LOWPASS m0, m2, m1, m0
paddw m0, m3
HADDW m0, m1
paddw m0, [pw_8]
psrlw m0, 4
SPLATW m0, m0
mova [r0+r3*1], m0
mova [r0+r3*2], m0
mova [r0+r5*1], m0
mova [r0+r3*4], m0
mova [r4+r3*1], m0
mova [r4+r3*2], m0
mova [r4+r5*1], m0
mova [r4+r3*4], m0
RET
%endmacro
INIT_XMM sse2
PRED8x8L_DC
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_DC
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_vertical(pixel *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL 0
cglobal pred8x8l_vertical_10, 4, 4, 6
sub r0, r3
mova m0, [r0]
shr r1d, 14
shr r2d, 13
neg r1
pslldq m1, m0, 2
psrldq m2, m0, 2
pinsrw m1, [r0+r1], 0
pinsrw m2, [r0+r2+14], 7
lea r1, [r3*3]
lea r2, [r0+r3*4]
PRED4x4_LOWPASS m0, m2, m1, m0
mova [r0+r3*1], m0
mova [r0+r3*2], m0
mova [r0+r1*1], m0
mova [r0+r3*4], m0
mova [r2+r3*1], m0
mova [r2+r3*2], m0
mova [r2+r1*1], m0
mova [r2+r3*4], m0
RET
%endmacro
INIT_XMM sse2
PRED8x8L_VERTICAL
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_VERTICAL
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL 0
cglobal pred8x8l_horizontal_10, 4, 4, 5
mova m0, [r0-16]
shr r1d, 14
dec r1
and r1, r3
sub r1, r3
punpckhwd m0, [r0+r1-16]
mova m1, [r0+r3*2-16]
punpckhwd m1, [r0+r3*1-16]
lea r2, [r0+r3*4]
lea r1, [r3*3]
punpckhdq m1, m0
mova m2, [r2+r3*0-16]
punpckhwd m2, [r0+r1-16]
mova m3, [r2+r3*2-16]
punpckhwd m3, [r2+r3*1-16]
punpckhdq m3, m2
punpckhqdq m3, m1
PALIGNR m4, m3, [r2+r1-16], 14, m0
pslldq m0, m4, 2
pshuflw m0, m0, 11100101b
PRED4x4_LOWPASS m4, m3, m0, m4
punpckhwd m3, m4, m4
punpcklwd m4, m4
pshufd m0, m3, 0xff
pshufd m1, m3, 0xaa
pshufd m2, m3, 0x55
pshufd m3, m3, 0x00
mova [r0+r3*0], m0
mova [r0+r3*1], m1
mova [r0+r3*2], m2
mova [r0+r1*1], m3
pshufd m0, m4, 0xff
pshufd m1, m4, 0xaa
pshufd m2, m4, 0x55
pshufd m3, m4, 0x00
mova [r2+r3*0], m0
mova [r2+r3*1], m1
mova [r2+r3*2], m2
mova [r2+r1*1], m3
RET
%endmacro
INIT_XMM sse2
PRED8x8L_HORIZONTAL
INIT_XMM ssse3
PRED8x8L_HORIZONTAL
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_HORIZONTAL
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_down_left(pixel *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_DOWN_LEFT 0
cglobal pred8x8l_down_left_10, 4, 4, 7
sub r0, r3
mova m3, [r0]
shr r1d, 14
neg r1
shr r2d, 13
pslldq m1, m3, 2
psrldq m2, m3, 2
pinsrw m1, [r0+r1], 0
pinsrw m2, [r0+r2+14], 7
PRED4x4_LOWPASS m6, m2, m1, m3
jz .fix_tr ; flags from shr r2d
mova m1, [r0+16]
psrldq m5, m1, 2
PALIGNR m2, m1, m3, 14, m3
pshufhw m5, m5, 10100100b
PRED4x4_LOWPASS m1, m2, m5, m1
.do_topright:
lea r1, [r3*3]
psrldq m5, m1, 14
lea r2, [r0+r3*4]
PALIGNR m2, m1, m6, 2, m0
PALIGNR m3, m1, m6, 14, m0
PALIGNR m5, m1, 2, m0
pslldq m4, m6, 2
PRED4x4_LOWPASS m6, m4, m2, m6
PRED4x4_LOWPASS m1, m3, m5, m1
mova [r2+r3*4], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r2+r1*1], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r2+r3*2], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r2+r3*1], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r0+r3*4], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r0+r1*1], m1
PALIGNR m1, m6, 14, m2
pslldq m6, 2
mova [r0+r3*2], m1
PALIGNR m1, m6, 14, m6
mova [r0+r3*1], m1
RET
.fix_tr:
punpckhwd m3, m3
pshufd m1, m3, 0xFF
jmp .do_topright
%endmacro
INIT_XMM sse2
PRED8x8L_DOWN_LEFT
INIT_XMM ssse3
PRED8x8L_DOWN_LEFT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_DOWN_LEFT
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_down_right(pixel *src, int has_topleft, int has_topright,
; int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_DOWN_RIGHT 0
; standard forbids this when has_topleft is false
; no need to check
cglobal pred8x8l_down_right_10, 4, 5, 8
sub r0, r3
lea r4, [r0+r3*4]
lea r1, [r3*3]
mova m0, [r0+r3*1-16]
punpckhwd m0, [r0+r3*0-16]
mova m1, [r0+r1*1-16]
punpckhwd m1, [r0+r3*2-16]
punpckhdq m1, m0
mova m2, [r4+r3*1-16]
punpckhwd m2, [r4+r3*0-16]
mova m3, [r4+r1*1-16]
punpckhwd m3, [r4+r3*2-16]
punpckhdq m3, m2
punpckhqdq m3, m1
mova m0, [r4+r3*4-16]
mova m1, [r0]
PALIGNR m4, m3, m0, 14, m0
PALIGNR m1, m3, 2, m2
pslldq m0, m4, 2
pshuflw m0, m0, 11100101b
PRED4x4_LOWPASS m6, m1, m4, m3
PRED4x4_LOWPASS m4, m3, m0, m4
mova m3, [r0]
shr r2d, 13
pslldq m1, m3, 2
psrldq m2, m3, 2
pinsrw m1, [r0-2], 0
pinsrw m2, [r0+r2+14], 7
PRED4x4_LOWPASS m3, m2, m1, m3
PALIGNR m2, m3, m6, 2, m0
PALIGNR m5, m3, m6, 14, m0
psrldq m7, m3, 2
PRED4x4_LOWPASS m6, m4, m2, m6
PRED4x4_LOWPASS m3, m5, m7, m3
mova [r4+r3*4], m6
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r0+r3*1], m3
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r0+r3*2], m3
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r0+r1*1], m3
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r0+r3*4], m3
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r4+r3*1], m3
PALIGNR m3, m6, 14, m2
pslldq m6, 2
mova [r4+r3*2], m3
PALIGNR m3, m6, 14, m6
mova [r4+r1*1], m3
RET
%endmacro
INIT_XMM sse2
PRED8x8L_DOWN_RIGHT
INIT_XMM ssse3
PRED8x8L_DOWN_RIGHT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_DOWN_RIGHT
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_vertical_right(pixel *src, int has_topleft,
; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_VERTICAL_RIGHT 0
; likewise with 8x8l_down_right
cglobal pred8x8l_vertical_right_10, 4, 5, 7
sub r0, r3
lea r4, [r0+r3*4]
lea r1, [r3*3]
mova m0, [r0+r3*1-16]
punpckhwd m0, [r0+r3*0-16]
mova m1, [r0+r1*1-16]
punpckhwd m1, [r0+r3*2-16]
punpckhdq m1, m0
mova m2, [r4+r3*1-16]
punpckhwd m2, [r4+r3*0-16]
mova m3, [r4+r1*1-16]
punpckhwd m3, [r4+r3*2-16]
punpckhdq m3, m2
punpckhqdq m3, m1
mova m0, [r4+r3*4-16]
mova m1, [r0]
PALIGNR m4, m3, m0, 14, m0
PALIGNR m1, m3, 2, m2
PRED4x4_LOWPASS m3, m1, m4, m3
mova m2, [r0]
shr r2d, 13
pslldq m1, m2, 2
psrldq m5, m2, 2
pinsrw m1, [r0-2], 0
pinsrw m5, [r0+r2+14], 7
PRED4x4_LOWPASS m2, m5, m1, m2
PALIGNR m6, m2, m3, 12, m1
PALIGNR m5, m2, m3, 14, m0
PRED4x4_LOWPASS m0, m6, m2, m5
pavgw m2, m5
mova [r0+r3*2], m0
mova [r0+r3*1], m2
pslldq m6, m3, 4
pslldq m1, m3, 2
PRED4x4_LOWPASS m1, m3, m6, m1
PALIGNR m2, m1, 14, m4
mova [r0+r1*1], m2
pslldq m1, 2
PALIGNR m0, m1, 14, m3
mova [r0+r3*4], m0
pslldq m1, 2
PALIGNR m2, m1, 14, m4
mova [r4+r3*1], m2
pslldq m1, 2
PALIGNR m0, m1, 14, m3
mova [r4+r3*2], m0
pslldq m1, 2
PALIGNR m2, m1, 14, m4
mova [r4+r1*1], m2
pslldq m1, 2
PALIGNR m0, m1, 14, m1
mova [r4+r3*4], m0
RET
%endmacro
INIT_XMM sse2
PRED8x8L_VERTICAL_RIGHT
INIT_XMM ssse3
PRED8x8L_VERTICAL_RIGHT
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_VERTICAL_RIGHT
%endif
;-----------------------------------------------------------------------------
; void ff_pred8x8l_horizontal_up(pixel *src, int has_topleft,
; int has_topright, int stride)
;-----------------------------------------------------------------------------
%macro PRED8x8L_HORIZONTAL_UP 0
cglobal pred8x8l_horizontal_up_10, 4, 4, 6
mova m0, [r0+r3*0-16]
punpckhwd m0, [r0+r3*1-16]
shr r1d, 14
dec r1
and r1, r3
sub r1, r3
mova m4, [r0+r1*1-16]
lea r1, [r3*3]
lea r2, [r0+r3*4]
mova m1, [r0+r3*2-16]
punpckhwd m1, [r0+r1*1-16]
punpckhdq m0, m1
mova m2, [r2+r3*0-16]
punpckhwd m2, [r2+r3*1-16]
mova m3, [r2+r3*2-16]
punpckhwd m3, [r2+r1*1-16]
punpckhdq m2, m3
punpckhqdq m0, m2
PALIGNR m1, m0, m4, 14, m4
psrldq m2, m0, 2
pshufhw m2, m2, 10100100b
PRED4x4_LOWPASS m0, m1, m2, m0
psrldq m1, m0, 2
psrldq m2, m0, 4
pshufhw m1, m1, 10100100b
pshufhw m2, m2, 01010100b
pavgw m4, m0, m1
PRED4x4_LOWPASS m1, m2, m0, m1
punpckhwd m5, m4, m1
punpcklwd m4, m1
mova [r2+r3*0], m5
mova [r0+r3*0], m4
pshufd m0, m5, 11111001b
pshufd m1, m5, 11111110b
pshufd m2, m5, 11111111b
mova [r2+r3*1], m0
mova [r2+r3*2], m1
mova [r2+r1*1], m2
PALIGNR m2, m5, m4, 4, m0
PALIGNR m3, m5, m4, 8, m1
PALIGNR m5, m5, m4, 12, m4
mova [r0+r3*1], m2
mova [r0+r3*2], m3
mova [r0+r1*1], m5
RET
%endmacro
INIT_XMM sse2
PRED8x8L_HORIZONTAL_UP
INIT_XMM ssse3
PRED8x8L_HORIZONTAL_UP
%if HAVE_AVX_EXTERNAL
INIT_XMM avx
PRED8x8L_HORIZONTAL_UP
%endif
;-----------------------------------------------------------------------------
; void ff_pred16x16_vertical(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro MOV16 3-5
mova [%1+ 0], %2
mova [%1+mmsize], %3
%if mmsize==8
mova [%1+ 16], %4
mova [%1+ 24], %5
%endif
%endmacro
%macro PRED16x16_VERTICAL 0
cglobal pred16x16_vertical_10, 2, 3
sub r0, r1
mov r2d, 8
mova m0, [r0+ 0]
mova m1, [r0+mmsize]
%if mmsize==8
mova m2, [r0+16]
mova m3, [r0+24]
%endif
.loop:
MOV16 r0+r1*1, m0, m1, m2, m3
MOV16 r0+r1*2, m0, m1, m2, m3
lea r0, [r0+r1*2]
dec r2d
jg .loop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_VERTICAL
INIT_XMM sse2
PRED16x16_VERTICAL
;-----------------------------------------------------------------------------
; void ff_pred16x16_horizontal(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_HORIZONTAL 0
cglobal pred16x16_horizontal_10, 2, 3
mov r2d, 8
.vloop:
movd m0, [r0+r1*0-4]
movd m1, [r0+r1*1-4]
SPLATW m0, m0, 1
SPLATW m1, m1, 1
MOV16 r0+r1*0, m0, m0, m0, m0
MOV16 r0+r1*1, m1, m1, m1, m1
lea r0, [r0+r1*2]
dec r2d
jg .vloop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_HORIZONTAL
INIT_XMM sse2
PRED16x16_HORIZONTAL
;-----------------------------------------------------------------------------
; void ff_pred16x16_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_DC 0
cglobal pred16x16_dc_10, 2, 6
mov r5, r0
sub r0, r1
mova m0, [r0+0]
paddw m0, [r0+mmsize]
%if mmsize==8
paddw m0, [r0+16]
paddw m0, [r0+24]
%endif
HADDW m0, m2
lea r0, [r0+r1-2]
movzx r3d, word [r0]
movzx r4d, word [r0+r1]
%rep 7
lea r0, [r0+r1*2]
movzx r2d, word [r0]
add r3d, r2d
movzx r2d, word [r0+r1]
add r4d, r2d
%endrep
lea r3d, [r3+r4+16]
movd m1, r3d
paddw m0, m1
psrlw m0, 5
SPLATW m0, m0
mov r3d, 8
.loop:
MOV16 r5+r1*0, m0, m0, m0, m0
MOV16 r5+r1*1, m0, m0, m0, m0
lea r5, [r5+r1*2]
dec r3d
jg .loop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_DC
INIT_XMM sse2
PRED16x16_DC
;-----------------------------------------------------------------------------
; void ff_pred16x16_top_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_TOP_DC 0
cglobal pred16x16_top_dc_10, 2, 3
sub r0, r1
mova m0, [r0+0]
paddw m0, [r0+mmsize]
%if mmsize==8
paddw m0, [r0+16]
paddw m0, [r0+24]
%endif
HADDW m0, m2
SPLATW m0, m0
paddw m0, [pw_8]
psrlw m0, 4
mov r2d, 8
.loop:
MOV16 r0+r1*1, m0, m0, m0, m0
MOV16 r0+r1*2, m0, m0, m0, m0
lea r0, [r0+r1*2]
dec r2d
jg .loop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_TOP_DC
INIT_XMM sse2
PRED16x16_TOP_DC
;-----------------------------------------------------------------------------
; void ff_pred16x16_left_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_LEFT_DC 0
cglobal pred16x16_left_dc_10, 2, 6
mov r5, r0
sub r0, 2
movzx r3d, word [r0]
movzx r4d, word [r0+r1]
%rep 7
lea r0, [r0+r1*2]
movzx r2d, word [r0]
add r3d, r2d
movzx r2d, word [r0+r1]
add r4d, r2d
%endrep
lea r3d, [r3+r4+8]
shr r3d, 4
movd m0, r3d
SPLATW m0, m0
mov r3d, 8
.loop:
MOV16 r5+r1*0, m0, m0, m0, m0
MOV16 r5+r1*1, m0, m0, m0, m0
lea r5, [r5+r1*2]
dec r3d
jg .loop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_LEFT_DC
INIT_XMM sse2
PRED16x16_LEFT_DC
;-----------------------------------------------------------------------------
; void ff_pred16x16_128_dc(pixel *src, int stride)
;-----------------------------------------------------------------------------
%macro PRED16x16_128_DC 0
cglobal pred16x16_128_dc_10, 2,3
mova m0, [pw_512]
mov r2d, 8
.loop:
MOV16 r0+r1*0, m0, m0, m0, m0
MOV16 r0+r1*1, m0, m0, m0, m0
lea r0, [r0+r1*2]
dec r2d
jg .loop
REP_RET
%endmacro
INIT_MMX mmxext
PRED16x16_128_DC
INIT_XMM sse2
PRED16x16_128_DC
|
; A172252: a(n) = 4*2^n - 9.
; -1,7,23,55,119,247,503,1015,2039,4087,8183,16375,32759,65527,131063,262135,524279,1048567,2097143,4194295,8388599,16777207,33554423,67108855,134217719,268435447,536870903,1073741815,2147483639
mov $1,2
pow $1,$0
sub $1,2
mul $1,8
add $1,7
mov $0,$1
|
;
; Fixed Point functions
;
; int f2i (long v)
; fixed point to integer
;
; ------
; $Id: f2i.asm,v 1.1 2009/04/10 12:47:42 stefano Exp $
;
XLIB f2i
.f2i
pop bc ; RET addr.
pop hl
pop de
push de
push hl
push bc
;; DEHL holds value
;rr d
;rr e
;rr h
;rr l
;rr d
;rr e
;rr h
;rr l
ld d,l
ld l,h
ld h,e
rl d
rl l
rl h
rl d
rl l
rl h
ret
|
<%
from pwnlib.shellcraft.aarch64.linux import syscall
%>
<%page args="from_, to"/>
<%docstring>
Invokes the syscall symlink. See 'man 2 symlink' for more information.
Arguments:
from(char): from
to(char): to
</%docstring>
${syscall('SYS_symlink', from_, to)}
|
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.text
.p2align 6, 0x90
.globl _k0_cpAddMulDgt_BNU
_k0_cpAddMulDgt_BNU:
push %rbx
push %r12
mov %edx, %edx
movq (%rsi), %rax
cmp $(1), %rdx
jnz .Lgeneral_casegas_1
mul %rcx
addq %rax, (%rdi)
adc $(0), %rdx
mov %rdx, %rax
vzeroupper
pop %r12
pop %rbx
ret
.Lgeneral_casegas_1:
lea (-40)(%rsi,%rdx,8), %rsi
lea (-40)(%rdi,%rdx,8), %rdi
mov $(5), %rbx
sub %rdx, %rbx
mul %rcx
mov %rax, %r8
movq (8)(%rsi,%rbx,8), %rax
mov %rdx, %r9
cmp $(0), %rbx
jge .Lskip_muladd_loop4gas_1
.p2align 6, 0x90
.Lmuladd_loop4gas_1:
mul %rcx
xor %r10, %r10
addq %r8, (%rdi,%rbx,8)
adc %rax, %r9
movq (16)(%rsi,%rbx,8), %rax
adc %rdx, %r10
mul %rcx
xor %r11, %r11
addq %r9, (8)(%rdi,%rbx,8)
adc %rax, %r10
movq (24)(%rsi,%rbx,8), %rax
adc %rdx, %r11
mul %rcx
xor %r8, %r8
addq %r10, (16)(%rdi,%rbx,8)
adc %rax, %r11
movq (32)(%rsi,%rbx,8), %rax
adc %rdx, %r8
mul %rcx
xor %r9, %r9
addq %r11, (24)(%rdi,%rbx,8)
adc %rax, %r8
movq (40)(%rsi,%rbx,8), %rax
adc %rdx, %r9
add $(4), %rbx
jnc .Lmuladd_loop4gas_1
.Lskip_muladd_loop4gas_1:
mul %rcx
xor %r10, %r10
addq %r8, (%rdi,%rbx,8)
adc %rax, %r9
adc %rdx, %r10
cmp $(2), %rbx
ja .Lfin_mul1x4n_2gas_1
jz .Lfin_mul1x4n_3gas_1
jp .Lfin_mul1x4n_4gas_1
.Lfin_mul1x4n_1gas_1:
movq (16)(%rsi,%rbx,8), %rax
mul %rcx
xor %r11, %r11
addq %r9, (8)(%rdi,%rbx,8)
adc %rax, %r10
movq (24)(%rsi,%rbx,8), %rax
adc %rdx, %r11
mul %rcx
xor %r8, %r8
addq %r10, (16)(%rdi,%rbx,8)
adc %rax, %r11
movq (32)(%rsi,%rbx,8), %rax
adc %rdx, %r8
mul %rcx
xor %r9, %r9
addq %r11, (24)(%rdi,%rbx,8)
adc %rax, %r8
adc $(0), %rdx
addq %r8, (32)(%rdi,%rbx,8)
adc $(0), %rdx
mov %rdx, %rax
jmp .Lexitgas_1
.Lfin_mul1x4n_4gas_1:
movq (16)(%rsi,%rbx,8), %rax
mul %rcx
xor %r11, %r11
addq %r9, (8)(%rdi,%rbx,8)
adc %rax, %r10
movq (24)(%rsi,%rbx,8), %rax
adc %rdx, %r11
mul %rcx
xor %r8, %r8
addq %r10, (16)(%rdi,%rbx,8)
adc %rax, %r11
adc $(0), %rdx
addq %r11, (24)(%rdi,%rbx,8)
adc $(0), %rdx
mov %rdx, %rax
jmp .Lexitgas_1
.Lfin_mul1x4n_3gas_1:
movq (16)(%rsi,%rbx,8), %rax
mul %rcx
xor %r11, %r11
addq %r9, (8)(%rdi,%rbx,8)
adc %rax, %r10
adc $(0), %rdx
addq %r10, (16)(%rdi,%rbx,8)
adc $(0), %rdx
mov %rdx, %rax
jmp .Lexitgas_1
.Lfin_mul1x4n_2gas_1:
addq %r9, (8)(%rdi,%rbx,8)
adc $(0), %r10
mov %r10, %rax
.Lexitgas_1:
vzeroupper
pop %r12
pop %rbx
ret
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.