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
oeis/028/A028189.asm
neoneye/loda-programs
11
245966
; A028189: Expansion of 1/((1-5x)(1-7x)(1-11x)(1-12x)). ; Submitted by <NAME> ; 1,35,782,14254,231459,3493041,50160064,695287148,9389676197,124321003807,1620910078866,20877357884682,266266935091015,3368664326093933,42334402590112388,529044108699525256 mov $1,1 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 trn $2,1 sub $0,$2 seq $0,20975 ; Expansion of 1/((1-7*x)*(1-11*x)*(1-12*x)). sub $0,$1 mul $1,6 add $1,$0 lpe mov $0,$1
src/ada-libc/src/libc-stddef.ads
mstewartgallus/linted
0
26941
-- Copyright 2015 <NAME> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -- implied. See the License for the specific language governing -- permissions and limitations under the License. with Interfaces.C; package Libc.Stddef is pragma Pure; -- unsupported macro: NULL __null -- arg-macro: procedure offsetof (TYPE, MEMBER) -- __builtin_offsetof (TYPE, MEMBER) subtype ptrdiff_t is Interfaces.C .ptrdiff_t; -- /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h:150 subtype size_t is Interfaces.C .size_t; -- /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h:212 -- subtype wchar_t is Interfaces.C.wchar_t; -- subtype wint_t is Interfaces.C.unsigned; end Libc.Stddef;
de0nano-interface/firmware/src/fx2lib/examples/bulkloop/dscr.a51
mfkiwl/myriadrf-boards
30
177591
<gh_stars>10-100 ; Copyright (C) 2009 Ubixum, Inc. ; ; This library is free software; you can redistribute it and/or ; modify it under the terms of the GNU Lesser General Public ; License as published by the Free Software Foundation; either ; version 2.1 of the License, or (at your option) any later version. ; ; This 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 ; Lesser General Public License for more details. ; ; You should have received a copy of the GNU Lesser General Public ; License along with this library; if not, write to the Free Software ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ; this is a the default ; full speed and high speed ; descriptors found in the TRM ; change however you want but leave ; the descriptor pointers so the setupdat.c file works right .module DEV_DSCR ; descriptor types ; same as setupdat.h DSCR_DEVICE_TYPE=1 DSCR_CONFIG_TYPE=2 DSCR_STRING_TYPE=3 DSCR_INTERFACE_TYPE=4 DSCR_ENDPOINT_TYPE=5 DSCR_DEVQUAL_TYPE=6 ; for the repeating interfaces DSCR_INTERFACE_LEN=9 DSCR_ENDPOINT_LEN=7 ; endpoint types ENDPOINT_TYPE_CONTROL=0 ENDPOINT_TYPE_ISO=1 ENDPOINT_TYPE_BULK=2 ENDPOINT_TYPE_INT=3 .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end ; These need to be in code memory. If ; they aren't you'll have to manully copy them somewhere ; in code memory otherwise SUDPTRH:L don't work right .area DSCR_AREA (CODE) _dev_dscr: .db dev_dscr_end-_dev_dscr ; len .db DSCR_DEVICE_TYPE ; type .dw 0x0002 ; usb 2.0 .db 0xff ; class (vendor specific) .db 0xff ; subclass (vendor specific) .db 0xff ; protocol (vendor specific) .db 64 ; packet size (ep0) .dw 0xB404 ; vendor id .dw 0x0410 ; product id .dw 0x0100 ; version id .db 1 ; manufacturure str idx .db 2 ; product str idx .db 0 ; serial str idx .db 1 ; n configurations dev_dscr_end: _dev_qual_dscr: .db dev_qualdscr_end-_dev_qual_dscr .db DSCR_DEVQUAL_TYPE .dw 0x0002 ; usb 2.0 .db 0xff .db 0xff .db 0xff .db 64 ; max packet .db 1 ; n configs .db 0 ; extra reserved byte dev_qualdscr_end: _highspd_dscr: .db highspd_dscr_end-_highspd_dscr ; dscr len ;; Descriptor length .db DSCR_CONFIG_TYPE ; can't use .dw because byte order is different .db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length of config lsb .db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length of config msb .db 1 ; n interfaces .db 1 ; config number .db 0 ; config string .db 0x80 ; attrs = bus powered, no wakeup .db 0x32 ; max power = 100ma highspd_dscr_end: ; all the interfaces next ; NOTE the default TRM actually has more alt interfaces ; but you can add them back in if you need them. ; here, we just use the default alt setting 1 from the trm .db DSCR_INTERFACE_LEN .db DSCR_INTERFACE_TYPE .db 0 ; index .db 0 ; alt setting idx .db 2 ; n endpoints .db 0xff ; class .db 0xff .db 0xff .db 3 ; string index ; endpoint 2 out .db DSCR_ENDPOINT_LEN .db DSCR_ENDPOINT_TYPE .db 0x02 ; ep2 dir=OUT and address .db ENDPOINT_TYPE_BULK ; type .db 0x00 ; max packet LSB .db 0x02 ; max packet size=512 bytes .db 0x00 ; polling interval ; endpoint 6 in .db DSCR_ENDPOINT_LEN .db DSCR_ENDPOINT_TYPE .db 0x86 ; ep6 dir=in and address .db ENDPOINT_TYPE_BULK ; type .db 0x00 ; max packet LSB .db 0x02 ; max packet size=512 bytes .db 0x00 ; polling interval highspd_dscr_realend: .even _fullspd_dscr: .db fullspd_dscr_end-_fullspd_dscr ; dscr len .db DSCR_CONFIG_TYPE ; can't use .dw because byte order is different .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb .db 1 ; n interfaces .db 1 ; config number .db 0 ; config string .db 0x80 ; attrs = bus powered, no wakeup .db 0x32 ; max power = 100ma fullspd_dscr_end: ; all the interfaces next ; NOTE the default TRM actually has more alt interfaces ; but you can add them back in if you need them. ; here, we just use the default alt setting 1 from the trm .db DSCR_INTERFACE_LEN .db DSCR_INTERFACE_TYPE .db 0 ; index .db 0 ; alt setting idx .db 2 ; n endpoints .db 0xff ; class .db 0xff .db 0xff .db 3 ; string index ; endpoint 2 out .db DSCR_ENDPOINT_LEN .db DSCR_ENDPOINT_TYPE .db 0x02 ; ep2 dir=OUT and address .db ENDPOINT_TYPE_BULK ; type .db 0x40 ; max packet LSB .db 0x00 ; max packet size=64 bytes .db 0x00 ; polling interval ; endpoint 6 in .db DSCR_ENDPOINT_LEN .db DSCR_ENDPOINT_TYPE .db 0x86 ; ep6 dir=in and address .db ENDPOINT_TYPE_BULK ; type .db 0x40 ; max packet LSB .db 0x00 ; max packet size=64 bytes .db 0x00 ; polling interval fullspd_dscr_realend: .even _dev_strings: ; sample string _string0: .db string0end-_string0 ; len .db DSCR_STRING_TYPE .db 0x09, 0x04 ; who knows string0end: ; add more strings here _string1: .db string1end-_string1 .db DSCR_STRING_TYPE .ascii 'H' .db 0 .ascii 'i' .db 0 string1end: _string2: .db string2end-_string2 .db DSCR_STRING_TYPE .ascii 'T' .db 0 .ascii 'h' .db 0 .ascii 'e' .db 0 .ascii 'r' .db 0 .ascii 'e' .db 0 string2end: _string3: .db string3end-_string3 .db DSCR_STRING_TYPE .ascii 'i' .db 0 .ascii 'F' .db 0 .ascii 'a' .db 0 .ascii 'c' .db 0 .ascii 'e' .db 0 string3end: _dev_strings_end: .dw 0x0000 ; just in case someone passes an index higher than the end to the firmware
data/pokemon/dex_entries/hypno.asm
AtmaBuster/pokeplat-gen2
6
26548
<filename>data/pokemon/dex_entries/hypno.asm db "HYPNOSIS@" ; species name db "The longer it" next "swings its" next "pendulum, the" page "longer the effects" next "of its hypnosis" next "last.@"
Md5Assembly/Md5Assembly/UnsafeMemoryCopy.asm
bretcope/blog-md5
0
29202
.code UnsafeMemoryCopy PROC mov r9,rdx mov r10d,r8d cmp r10d,8 jle Switch mov eax,r8d cdq and edx,7 add eax,edx sar eax,3 mov r11d,eax mov eax,r8d cdq and edx,7 add eax,edx and eax,7 sub eax,edx mov r10d,eax test r11d,r11d jle Switch CopyLong: mov rax,qword ptr [rcx] mov qword ptr [r9],rax add rcx,8 add r9,8 dec r11d test r11d,r11d jg CopyLong Switch: lea eax,[r10-1] movsxd rax,eax cmp rax,7 ja Default lea rdx,[offset CaseAddresses] mov rdx,qword ptr [rdx+rax*8] jmp rdx Default: jmp Return Case1: movzx ecx,byte ptr [rcx] mov byte ptr [r9],cl jmp Return Case2: movsx rcx,word ptr [rcx] mov word ptr [r9],cx jmp Return Case3: movsx rax,word ptr [rcx] mov word ptr [r9],ax movzx ecx,byte ptr [rcx+2] mov byte ptr [r9+2],cl jmp Return Case4: mov ecx,dword ptr [rcx] mov dword ptr [r9],ecx jmp Return Case5: mov eax,dword ptr [rcx] mov dword ptr [r9],eax movzx ecx,byte ptr [rcx+4] mov byte ptr [r9+4],cl jmp Return Case6: mov eax,dword ptr [rcx] mov dword ptr [r9],eax movsx rcx,word ptr [rcx+4] mov word ptr [r9+4],cx jmp Return Case7: mov eax,dword ptr [rcx] mov dword ptr [r9],eax movsx rax,word ptr [rcx+4] mov word ptr [r9+4],ax movzx ecx,byte ptr [rcx+6] mov byte ptr [r9+6],cl jmp Return Case8: mov rax,qword ptr [rcx] mov qword ptr [r9],rax Return: ret CaseAddresses dq offset Case1, offset Case2, offset Case3, offset Case4, offset Case5, offset Case6, offset Case7, offset Case8 UnsafeMemoryCopy ENDP END
tests/test.asm
daniel3735928559/jsavr
5
173872
<gh_stars>1-10 ldi r30,56 ldi r31,244 add r30,r31 sub r31,r30 cp r30,r31 rjmp 1 ldi r18,99 subi r30,1 cpi r30,43 breq -3 ldi r26,44 ldi r27,1 st X,r30 ld r0,X
programs/oeis/256/A256654.asm
jmorken/loda
1
85504
<gh_stars>1-10 ; A256654: Least Fibonacci number not less than n. ; 1,2,3,5,5,8,8,8,13,13,13,13,13,21,21,21,21,21,21,21,21,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,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377,377 lpb $0 trn $1,$0 sub $0,1 trn $0,$3 add $3,$0 add $3,1 add $1,$3 mov $2,$3 mov $3,$1 sub $3,$2 lpe add $1,1
libsrc/_DEVELOPMENT/l/sdcc/__mullong_callee.asm
meesokim/z88dk
0
3788
<reponame>meesokim/z88dk INCLUDE "clib_cfg.asm" SECTION code_l_sdcc PUBLIC __mullong_callee EXTERN l_mulu_32_32x32 __mullong_callee: ; multiply two 32-bit multiplicands into a 32-bit product ; ; enter : stack = multiplicand (32-bit), multiplicand (32-bit), ret ; ; exit : dehl = product pop af exx pop hl pop de ; dehl = multiplicand exx pop hl pop de ; dehl = multiplicand push af IF (__CLIB_OPT_IMATH <= 50) || (__SDCC_IY) jp l_mulu_32_32x32 ENDIF IF (__CLIB_OPT_IMATH > 50) && (__SDCC_IX) push ix call l_mulu_32_32x32 pop ix ret ENDIF
Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_572.asm
ljhsiun2/medusa
9
242594
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x1ddd1, %rsi lea addresses_WC_ht+0x6af5, %rdi clflush (%rsi) nop nop xor $16463, %rax mov $96, %rcx rep movsq nop nop sub $5369, %rbp lea addresses_WC_ht+0x6f5, %r14 nop nop dec %r15 movb $0x61, (%r14) nop nop sub %rax, %rax lea addresses_WC_ht+0x1040b, %rcx nop nop xor %rax, %rax mov (%rcx), %r15 nop nop nop nop nop add $2237, %rdi lea addresses_D_ht+0x1a7f5, %rax nop nop cmp %r15, %r15 mov $0x6162636465666768, %rcx movq %rcx, %xmm6 vmovups %ymm6, (%rax) nop nop and $56674, %rax lea addresses_WT_ht+0x87f5, %rsi lea addresses_UC_ht+0x9ef5, %rdi clflush (%rdi) nop and %r9, %r9 mov $85, %rcx rep movsw nop nop nop nop sub $51590, %rsi lea addresses_normal_ht+0x3455, %rsi lea addresses_normal_ht+0x8ff5, %rdi nop nop lfence mov $95, %rcx rep movsw nop nop nop xor %rsi, %rsi lea addresses_WT_ht+0x60f5, %rsi lea addresses_WC_ht+0x1ea87, %rdi clflush (%rsi) nop nop sub $22922, %rax mov $52, %rcx rep movsw nop and %r14, %r14 lea addresses_WT_ht+0xaff5, %rbp nop nop nop add %r9, %r9 mov $0x6162636465666768, %rcx movq %rcx, (%rbp) xor %rax, %rax lea addresses_D_ht+0x9731, %rsi clflush (%rsi) nop nop nop and %r9, %r9 mov (%rsi), %r14 dec %r15 lea addresses_UC_ht+0xdc35, %r14 nop nop nop nop nop sub %r9, %r9 movb (%r14), %cl nop xor $6666, %r14 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r8 push %r9 push %rax push %rsi // Store lea addresses_UC+0x96d5, %r10 clflush (%r10) nop nop dec %r12 mov $0x5152535455565758, %rax movq %rax, %xmm4 movups %xmm4, (%r10) nop nop xor %r10, %r10 // Store lea addresses_normal+0x5ff5, %r12 dec %rax mov $0x5152535455565758, %rsi movq %rsi, (%r12) nop sub %r9, %r9 // Faulty Load lea addresses_US+0x7ff5, %r8 nop sub %r12, %r12 movb (%r8), %r9b lea oracles, %r10 and $0xff, %r9 shlq $12, %r9 mov (%r10,%r9,1), %r9 pop %rsi pop %rax pop %r9 pop %r8 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 1}} {'src': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
libsrc/_DEVELOPMENT/target/rc2014/device/acia/z80/acia_flush_Tx.asm
ahjelm/z88dk
640
93195
<reponame>ahjelm/z88dk SECTION code_driver SECTION code_driver_character_output PUBLIC _acia_flush_Tx_di PUBLIC _acia_flush_Tx EXTERN asm_z80_push_di, asm_z80_pop_ei EXTERN aciaTxCount, aciaTxBuffer, aciaTxIn, aciaTxOut _acia_flush_Tx_di: push af push hl call asm_z80_push_di ; di call _acia_flush_Tx call asm_z80_pop_ei ; ei pop hl pop af ret _acia_flush_Tx: xor a ld (aciaTxCount),a ; reset the Tx counter (set 0) ld hl,aciaTxBuffer ; load Tx buffer pointer home ld (aciaTxIn),hl ld (aciaTxOut),hl ret EXTERN _acia_need defc NEED = _acia_need
tools/scitools/conf/understand/ada/ada95/a-chahan.ads
brucegua/moocos
1
26770
<filename>tools/scitools/conf/understand/ada/ada95/a-chahan.ads ----------------------------------------------------------------------------- -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . C H A R A C T E R S . H A N D L I N G -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ package Ada.Characters.Handling is pragma Preelaborate (Handling); ---------------------------------------- -- Character Classification Functions -- ---------------------------------------- function Is_Control (Item : in Character) return Boolean; function Is_Graphic (Item : in Character) return Boolean; function Is_Letter (Item : in Character) return Boolean; function Is_Lower (Item : in Character) return Boolean; function Is_Upper (Item : in Character) return Boolean; function Is_Basic (Item : in Character) return Boolean; function Is_Digit (Item : in Character) return Boolean; function Is_Decimal_Digit (Item : in Character) return Boolean renames Is_Digit; function Is_Hexadecimal_Digit (Item : in Character) return Boolean; function Is_Alphanumeric (Item : in Character) return Boolean; function Is_Special (Item : in Character) return Boolean; --------------------------------------------------- -- Conversion Functions for Character and String -- --------------------------------------------------- function To_Lower (Item : in Character) return Character; function To_Upper (Item : in Character) return Character; function To_Basic (Item : in Character) return Character; function To_Lower (Item : in String) return String; function To_Upper (Item : in String) return String; function To_Basic (Item : in String) return String; ---------------------------------------------------------------------- -- Classifications of and Conversions Between Character and ISO 646 -- ---------------------------------------------------------------------- subtype ISO_646 is Character range Character'Val (0) .. Character'Val (127); function Is_ISO_646 (Item : in Character) return Boolean; function Is_ISO_646 (Item : in String) return Boolean; function To_ISO_646 (Item : in Character; Substitute : in ISO_646 := ' ') return ISO_646; function To_ISO_646 (Item : in String; Substitute : in ISO_646 := ' ') return String; ------------------------------------------------------ -- Classifications of Wide_Character and Characters -- ------------------------------------------------------ function Is_Character (Item : in Wide_Character) return Boolean; function Is_String (Item : in Wide_String) return Boolean; ------------------------------------------------------ -- Conversions between Wide_Character and Character -- ------------------------------------------------------ function To_Character (Item : in Wide_Character; Substitute : in Character := ' ') return Character; function To_String (Item : in Wide_String; Substitute : in Character := ' ') return String; function To_Wide_Character (Item : in Character) return Wide_Character; function To_Wide_String (Item : in String) return Wide_String; private pragma Inline (Is_Control); pragma Inline (Is_Graphic); pragma Inline (Is_Letter); pragma Inline (Is_Lower); pragma Inline (Is_Upper); pragma Inline (Is_Basic); pragma Inline (Is_Digit); pragma Inline (Is_Hexadecimal_Digit); pragma Inline (Is_Alphanumeric); pragma Inline (Is_Special); pragma Inline (To_Lower); pragma Inline (To_Upper); pragma Inline (To_Basic); pragma Inline (Is_ISO_646); pragma Inline (Is_Character); pragma Inline (To_Character); pragma Inline (To_Wide_Character); end Ada.Characters.Handling;
resource/graphics/ckirmse.adb
marcelkauf/Meridian59-101
214
7409
[Users] <EMAIL>=
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_400.asm
ljhsiun2/medusa
9
20245
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %rax push %rbx push %rcx push %rsi lea addresses_A_ht+0xf453, %rcx nop nop add $50852, %r12 movups (%rcx), %xmm6 vpextrq $1, %xmm6, %rax sub $34033, %rbx lea addresses_WT_ht+0x17a53, %rax nop nop nop nop add $35320, %r15 movb $0x61, (%rax) nop nop nop nop nop cmp $2486, %rax lea addresses_A_ht+0x5a53, %rbx nop nop xor %r11, %r11 mov (%rbx), %ecx nop nop nop nop inc %rcx lea addresses_normal_ht+0xd653, %r11 nop nop nop nop nop cmp %rbx, %rbx vmovups (%r11), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rsi inc %r11 lea addresses_A_ht+0xc853, %rbx nop nop cmp $50281, %rax mov (%rbx), %r15 nop nop xor $59215, %r12 lea addresses_WC_ht+0x3153, %r12 nop nop nop nop cmp %rax, %rax mov (%r12), %bx xor %r11, %r11 lea addresses_WT_ht+0x10b53, %rax nop nop nop nop nop sub %rsi, %rsi movups (%rax), %xmm0 vpextrq $0, %xmm0, %r11 nop nop nop add $3930, %rax lea addresses_A_ht+0x1cb23, %rcx nop nop nop nop cmp %rax, %rax movb $0x61, (%rcx) and %rcx, %rcx lea addresses_UC_ht+0x10e93, %rax sub %rbx, %rbx movl $0x61626364, (%rax) add %r12, %r12 lea addresses_D_ht+0x1ae53, %r12 cmp %rsi, %rsi vmovups (%r12), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %r15 nop nop nop nop nop add %r11, %r11 pop %rsi pop %rcx pop %rbx pop %rax pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %rbp push %rbx push %rcx // Faulty Load lea addresses_normal+0x19653, %rbp nop nop sub $39268, %r14 mov (%rbp), %r8d lea oracles, %r11 and $0xff, %r8 shlq $12, %r8 mov (%r11,%r8,1), %r8 pop %rcx pop %rbx pop %rbp pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': True, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_10026_802.asm
ljhsiun2/medusa
9
98478
<filename>Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_10026_802.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xb434, %r11 nop nop nop cmp $15252, %r10 movb $0x61, (%r11) nop nop nop nop nop cmp $36885, %rsi lea addresses_normal_ht+0x4954, %rsi cmp $62412, %r13 mov $0x6162636465666768, %r11 movq %r11, %xmm3 vmovups %ymm3, (%rsi) nop sub %r13, %r13 lea addresses_WC_ht+0x8634, %rdx nop nop xor $63453, %rbp movw $0x6162, (%rdx) nop nop cmp $28722, %rdi lea addresses_WC_ht+0x6e34, %rdx nop nop nop nop add %rbp, %rbp movw $0x6162, (%rdx) cmp %rsi, %rsi lea addresses_WT_ht+0x4b7e, %r10 nop nop nop nop xor $61485, %rsi movb $0x61, (%r10) nop nop nop nop sub %rbp, %rbp lea addresses_A_ht+0x1a1bc, %rsi lea addresses_WC_ht+0x9424, %rdi cmp $39538, %r11 mov $46, %rcx rep movsw nop nop nop sub %r13, %r13 lea addresses_D_ht+0x10834, %r11 nop sub $62169, %rdi vmovups (%r11), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rsi nop nop nop nop nop xor $36712, %rdi lea addresses_D_ht+0xc9ef, %r11 nop nop nop nop nop dec %r10 mov (%r11), %rbp xor $56059, %rdi lea addresses_normal_ht+0xb834, %r13 nop nop nop nop sub $37120, %r10 movb $0x61, (%r13) nop nop nop nop nop cmp %rdx, %rdx lea addresses_normal_ht+0x1b434, %r11 nop nop nop cmp %rbp, %rbp movups (%r11), %xmm6 vpextrq $1, %xmm6, %r13 nop nop nop nop nop add %rsi, %rsi lea addresses_WT_ht+0x1d5b4, %rdi nop nop nop nop nop add $59404, %r13 mov (%rdi), %ebp nop add $26532, %r13 lea addresses_WC_ht+0x1ec34, %rdx nop sub %rsi, %rsi mov (%rdx), %r11d nop nop sub $36541, %rsi lea addresses_WC_ht+0x18c54, %r11 nop nop nop dec %rdi movw $0x6162, (%r11) nop nop sub %r13, %r13 lea addresses_WT_ht+0x11db4, %rbp nop nop nop xor %r11, %r11 mov (%rbp), %r13w cmp $59540, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %r9 push %rbp push %rbx // Faulty Load lea addresses_normal+0x1c834, %rbp nop nop xor $8124, %r10 mov (%rbp), %r11w lea oracles, %rbx and $0xff, %r11 shlq $12, %r11 mov (%rbx,%r11,1), %r11 pop %rbx pop %rbp pop %r9 pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'34': 10026} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
programs/oeis/228/A228368.asm
neoneye/loda
22
21763
<reponame>neoneye/loda ; A228368: Difference between the n-th element of the ruler function and the highest power of 2 dividing n. ; 0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-11,0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-26,0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-11,0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-57,0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-11,0,0,0,-1,0,0,0,-4,0,0,0,-1,0,0,0,-26,0,0,0,-1 mov $2,1 lpb $0 sub $0,1 mul $0,2 dif $0,4 sub $2,1 mul $2,2 add $1,$2 lpe div $1,2 mov $0,$1
sbsext/tk2/ed/ed.asm
olifink/smsqe
0
90239
* ED - Entry point for BASIC program editor  1985 T.Tebby QJUMP * section ed * xdef ed * xref ed_keyin xref ed_wrall xref ed_snorm xref ut_chan xref ut_ckprc xref ut_trp3r xref gu_achp0 xref err_bp * include dev8_sbsext_ed_keys include dev8_sbsext_ed_data include dev8_keys_con * * Permanent register usage * * d5 row*8 (index into row table) * d6 row * d7 column * a0 edit window ID * a5 workspace address * a6 base of basic variables * ed bsr.l ut_ckprc check not in procedure bne.s ed_rts1 ... oops moveq #2,d6 assume BASIC channel 2 bsr.l ut_chan and look for # number bne.s ed_rts1 ... oops move.w d6,d5 * clr.b bv_auto(a6) no normal editing please clr.b bv_arrow(a6) moveq #0,d4 assume start at move.w bv_edlin(a6),d4 ... next edit line move.w ca..gtint,a2 jsr (a2) get one integer bne.s ed_rts1 subq.w #1,d3 just one? bgt.l err_bp ... oops blt.s ed_alchp ... not even one move.w (a6,a1.l),d4 set start line * ed_alchp move.l a0,a4 set channel move.l bv_bfbas(a6),a1 moveq #sd.chenq,d0 jsr ut_trp3r bne.l ed_rts ... not a window moveq #ed_rtab/8+1,d0 base of table + one spare row move.l bv_bfbas(a6),a1 add.w 2(a6,a1.l),d0 lsl.l #3,d0 base of table + 8 * number of rows jsr gu_achp0 allocate working heap move.l a0,a5 set work area pointer ed_rts1 bne.s ed_rts ... no * * All set, now we can initialise everything * move.w d5,ed_chno(a5) edit channel number sf bv_cont(a6) do not continue move.w #4,bv_stopn(a6) ... in fact stop moveq #mt.inf,d0 trap #1 cmpi.l #'1.03',d2 bls.s need_offset movea.w pa..ini,a2 adda.w #qlv_jump,a2 bra.s got_vector need_offset movea.w pa..graph,a2 adda.w #qlv_jump+pao_ini,a2 got_vector * move.l a2,ed_paini(a5) set address * move.l a4,a0 set our channel ID moveq #sd.clear,d0 clear screen moveq #-1,d3 trap #3 st ed_clear(a5) but do not clear 0 moveq #sd.extop,d0 now set window size to character multipl move.l a5,a1 and set up values in data structure lea ed_setwn(pc),a2 trap #3 tst.l d0 ok bne.s ed_exit ; trap #15 ; move.l a1,a0 ; move.l a5,a1 ; bsr.s ed_setwn2 ; move.l a4,a0 moveq #0,d3 start at row 0 of line d4 moveq #0,d5 at top rhs moveq #0,d6 moveq #0,d7 bsr.l ed_wrall write all lines in window starting d4 * bsr.l ed_keyin get input keystroke * moveq #sd.extop,d0 restore the old window size move.l a5,a1 lea ed_rstwn(pc),a2 trap #3 moveq #0,d0 * * move.w edr_lnr(a5),d4 top row number * move.w d4,bv_lsbas(a6) and set listing range * move.w d4,bv_lsaft(a6) * subq.w #1,d4 * move.w d4,bv_lsbef(a6) * ed_exit move.l d0,d4 save the error return move.w edr_lnr(a5),bv_edlin(a6) next line to edit * moveq #mt.rechp,d0 return the workspace move.l a5,a0 trap #1 * move.l d4,d0 set error return ed_rts rts * page * * EXTOP to set up window and related data structure * ed_setwn ; move.l a0,a1 ; moveq #0,d0 ; rts ;ed_setwn2 lea ed_xsize(a1),a3 save x and y sizes move.l sd_xsize(a0),(a3)+ move.l sd_xinc(a0),(a3)+ and set x and y increments * movem.w sd_xsize(a0),d0/d1 get x and y size movem.w sd_xinc(a0),d4/d5 and increments divu d4,d0 set number of characters across move.w d0,d2 divu d5,d1 ... and down move.w d1,d3 * move.w d0,(a3)+ set number of columns move.w d1,(a3)+ number of rows * subq.w #1,d0 number of columns-1 move.w d0,(a3)+ subq.w #1,d1 number of rows-1 move.w d1,(a3)+ * subq.w #ed.xoff-1,d0 set number of columns in extra rows move.w d0,(a3)+ * subq.w #5,d0 ensure at least 5 characters left in row blt.s err_or subq.w #1,d1 at least 2 rows ble.s err_or * mulu d4,d2 set window width to multiple of xinc mulu d5,d3 and window height to multiple of yinc movem.w d2/d3,sd_xsize(a0) bra.s rts_ok * ed_rstwn move.l sd_xsize(a0),d0 set position to bottom rh corner sub.l sd_xinc(a0),d0 move.l d0,sd_xpos(a0) move.l ed_xsize(a1),sd_xsize(a0) reset size st sd_nlsta(a0) ... and flag newline rts_ok moveq #0,d0 rts err_or moveq #err.or,d0 set out of range rts end
45/runtime/rt/gwini.asm
minblock/msdos
0
18241
TITLE GWINI - GW BASIC 2.0 Initialization/Utility Routines ;*** ; GWINI - GW BASIC 2.0 Initialization/Utility Routines ; ; Copyright <C> 1986, Microsoft Corporation ; ;Purpose: ; ; The routines in this module are always called; regardless of ; whether the statements they are initializing are found in the ; program or not. This module should not cause any statement ; processing module to be linked in (i.e. only low-level routines ; should be called). ; ;****************************************************************************** INCLUDE switch.inc INCLUDE rmacros.inc ; general runtime macros UseSeg _BSS UseSeg _DATA UseSeg ER_TEXT UseSeg RT_TEXT INCLUDE seg.inc ; Segment definitions INCLUDE baslibma.inc INCLUDE files.inc INCLUDE nhutil.inc INCLUDE idmac.inc ; Internal debugging macros INCLUDE const.inc ; bit flag constants INCLUDE rtps.inc ; constants shared with QBI .radix 10 sBegin _DATA globalW b$pCommSave,Near_Ret,1 ; conditional vector to B$CommSave globalW b$pCommRestore,Near_Ret,1 ; conditional vector to B$CommRestore ; b$TempSD is a general purpose string descriptor for temporary use globalW b$TempSD,?,2 ; handle (ppData) & SB externB b$CRTWIDTH ; Physical width externB b$SCRNWIDTH ; Logical width externB b$WDOBOT externB b$WDOTOP externW b$CURSOR ; (1,1)-relative screen cursor externB b$LINCNT externW b$VWINI_PTR ;Calls B$GRPINI once initialized externW __aenvseg ; Added with revision [28] ;*** ;b$IOFLAG - General Purpose IO Bits ;OEM-callback routine (variable) ; ;Purpose: ; This variable keeps track of the global state of the I/O module. ; Most of the bits in the flag variable are used to handle all the ; different cases for I/O redirection. ; ;Allocation: ; b$IOFLAG is a BYTE value declared in the _DATA segment by ; the OEM-Independent code. ; ;Values: ; Field definitions of b$IOFLAG are in CONST.INC. Initially, all ; fields are set to 0. ; ; RED_INP is a bit that is set when input from stdin is being redirected ; from a file. This field is set during console initialization ; by the runtime and is not changed. (01H) ; ; RED_OUT is a bit that is set when output stdout is being redirected ; to a file. This field is set during console initialization ; by the runtime and is not changed. (02H) ; ; LPR_ECHO is a bit that is set when output to the screen is being ; echoed to the line printer. Its value does not affect redirected ; IO, but the printer will not echo redirected output. (04H) ; This field is set/cleared when the Print Scrn key is recognized. ; ; F_KDSP is a bit that is set when currently updating a function key ; display, and output should not be sent to the printer or a ; redirected file. A special routine to map the function keys ; is called when this is true. (08H) ; ; IN_INPUT is a bit that is set when redirected output to stdout is ; to be inhibited. This is when an INPUT statement is being ; processed, and the user is editing his input. Not until the ; user hits <return> is the data entered sent to the redirected ; file, so that the editing corrections are not present. ; However, while IN_INPUT is set , output will go to the screen, ; using screen cursor values. (10H) ; ; F_EDIT is a bit that is set when in the INPUT statement, and B$PRTMAP ; should be disabled as B$EDTMAP does the mapping. (20H) ; ; SCN_INIT is a bit that is set to indicate that the screen has been ; physically initialized. This field is set by the OEM at the ; time the screen is actually initialized (B$SCINIT). (40H) ; ; SCN_SCROLL is a bit indicating that we need to scroll the screen ; upon the first screen operation because we entered on the last ; line of the screen. This flag is only used by the OEM before ; the screen has been physically initialized. (80H) ; ;Initially Set: ; RED_INP is set by the OEM-Independent code before B$GWINI or ; B$RTLLINIT are called. ; RED_OUT is set by the OEM-Independent code before B$GWINI or ; B$RTLLINIT are called. ; LPR_ECHO is statically initialized to be 0. ; F_KDSP is statically initialized to be 0. ; IN_INPUT is statically initialized to be 0. ; F_EDIT is statically initialized to be 0. ; SCN_INIT is statically initialized to be 0. ; SCN_SCROLL is statically initialized to be 0. ; ;Modified By: ; RED_INP and RED_OUT should not be modified once initialized. ; LPR_ECHO is modified by the OEM-Independent code upon detection ; of the Print Screen Key and upon a RUN command. ; F_KDSP is set at the beginning of the function key update routines ; and cleared at the end of them. ; IN_INPUT and F_EDIT are set and cleared by the Screen Editor ; SCN_INIT and SCN_SCROLL are only modified by the OEM-Dependent code. ; ;Used By: ; All the fields of b$IOFLAG except for SCN_INIT and SCN_SCROLL are ; only used by the OEM-Independent Code. SCN_INIT is used by both ; the OEM-Dependent code and the termination code. If SCN_INIT ; is 1 at termination time, then B$RESETSCN will be called. Otherwise ; B$RESETSCN will not be called by the termination code. SCN_SCROLL ; is not used by the OEM-Independent Code in any way. This flag ; may be used for any purpose. ;**** globalB b$IOFLAG,0 ; general-purpose IO bits defined above. ;*** ;b$vKEYDSP - Vector for indirect call to B$KEYDSP, display/clear function keys ;OEM-callback routine (variable) ; ;Purpose: ; Update the function key display. If b$KEY_SW is set to 0 then ; the function key display is disabled and is removed from the ; screen if it existed. If b$KEY_SW is set to -1, then the ; function key display is enabled and is displayed on the screen ; if needed. ; ; This routine is called indirectly through the vector ; b$vKEYDSP ; ;Entry: ; B$KEY_SW set appropriately: 0 = turn off function key display ; -1 = display function keys. ; ;Exit: ; None. ; ;Uses: ; Per Convention ; ;Preserves: ; AX, BX, CX, DX ; ;Exceptions: ; Just returns unless B$KEYDSP is linked in by B$INPP or B$KFUN. ; ;Vector Information: ; b$vKeyDSP is a WORD value defined in the _DATA segment by the ; OEM-Independent code. It is set up by an initializer before ; the BASIC runtime is first called. It should not be modified. ;****************************************************************************** globalW b$vKEYDSP,Near_Ret,1 sEnd _DATA sBegin _BSS externB b$KEY_SW ;GWDATA - externW B$WNDWSW ;GWDATA - ;*** ; b$HugeShift, b$HugeDelta - OS selector shift count for HUGE access ;OEM-callback routine (variable) ; ;Purpose: ; This value is used to access successive pieces of a ; HUGE array. To get to the next segment of memory in ; which the array exists, use the following formula: ; (assuming that the array is accessed through DS:) ; ; DS: = DS: + (1 << b$HugeShift) ; ; The value (1 << b$HugeShift) is precomputed and stored ; in the variable b$HugeDelta. ; ; NOTE: For DOS, these variables are guarenteed to be identical ; each time the program is run and could be replaced by ; constants. ; ;Allocation: ; b$HugeShift is a BYTE value defined in the _BSS segment by ; the runtime code. ; ; b$HugeDelta is a WORD value defined in the _BSS segment by ; the runtime code. ; ;Values: ; The values for b$HugeShift and b$HugeDelta are dependent upon ; the operating system. Both variables are initialized by the ; runtime during runtime initialization and should not be changed. ; ;Initially Set: ; The values of these variables are undefined until they are set ; at initialization time. They are initialized after B$GWINI and ; and B$RTLLINIT are called but before any user code is executed ; or interpreted. ; ;Modified By: ; These variables should not be modified once they are initialized. ; ;Used By: ; These variables are used by anyone who wants to access a dynamic ; array bigger than 64K. ;**************************************************************************** globalB b$HugeShift,? ;OS selector shift count for HUGE access ;NOTE: this uses an extra byte from ;b$HugeDelta when we pass b$HugeShift to ;DOSGETHUGESHIFT (which returns a WORD) globalW b$HugeDelta,? ;OS selector seg increment for HUGE access ;*** ;b$Buf1, b$Buf2 - temporary buffer space ;OEM-callback routine (variable) ; ;Purpose: ; Both b$Buf1 and b$Buf2 are large buffers of temporary storage ; for general use. These buffers are used in many places ; throughout the runtime. While it is theoretically possible for ; the OEM code to use either or both of these buffers any time they ; are not in use, there is no way to determine whether they are being ; used. The mechanism in the rest of the runtime for determining ; availability is visual inspection and use of the routines ; B$HoldBuf(n) and B$FreeBuf(n) which do not exist in a release ; version. ; ; These buffers are mainly described here for the understanding ; of the sample code supplied by MicroSoft. However, there are a ; couple of specific times the buffers are guaranteed to be free, ; which are described below. ; ; Note that b$Buf2 immediately follows b$Buf1, so if both are ; available you have a block of 258 contiguous bytes of DGROUP. ; ;Allocated: ; b$Buf1 is a block of 129 BYTES allocated in _BSS by the runtime. ; b$Buf2 is a block of 129 BYTES allocated in _BSS by the runtime. ; ;Values: ; Undefined ; ;Initially Set: ; Undefined ; ;Modified By: ; Undefined ; ;Used By: ; b$BUF1 is guaranteed to be available during the calls to ; B$GWINI and B$RTLLINI. Furthermore, it is guaranteed ; that the value of b$BUF1 will not change between these ; two calls. ; b$BUF2 is guaranteed to be available with the same conditions as ; b$BUF1. Also, b$BUF2 will be available for use during ; the execution of any of the routines in LLCOM5.ASM. ; However, the contents of the buffer may change between ; calls to these routines. ;****************************************************************************** ; ; NOTE -- Any (or all) of these LARGE buffers can be used by anyone ; that wants to, provided they are not used in a calling routine. ; IN DEBUG CODE, call B$HoldBuf(1,2,12,3) to allocate the the buffers to ; your routine, and B$FreeBuf(1,2,12,3) to release the buffers. ; ;######### labelB <PUBLIC,b$PATHNAM> ; pathname buffer globalB b$Buf1,,FILNAML ; 1st large (pathname-sized) scratch buffer globalB b$Buf2,,FILNAML ; 2nd large (pathname-sized) scratch buffer globalB b$Buf3,,16 ; 3rd scratch buffer ; these buffers MUST remain contiguous sEnd _BSS sBegin RT_TEXT assumes cs,RT_TEXT PAGE SUBTTL Screen initialization ;*** ; B$WHOME - Home the text cursor ; Moved here from iotty.asm with revision [60]. See note below! ; ; Input: ; b$WDOTOP set ; Output: ; [DL] == home row of cursor ; [DH] == home column of cursor ; Modifies: ; NONE ; Note: ; IMPORTANT: Must be kept in sync with the local WHOME routine in iotty.asm ;**** cProc B$WHOME,<PUBLIC,NEAR> cBegin MOV DL,b$WDOTOP MOV DH,1 cEnd ;*** ; B$CRLF - Adust cursor row/column while doing a CR/LF. [61] ; Added with [60]. ; ; Purpose: ; This routine is called every time a CR/LF is to be output ; to the screen. It checks whether the screen will need to be ; scrolled and if not, increments DL. Flags are set indicating ; whether or not the screen must be scrolled. DH is set to 1. ; ; Entry: ; DL = current line ; ; Exit: ; DH = 1 ; DL = new line ; ZF ==> didn't change DL, since on last line ; NZ ==> changed DL, since not on last line ; ; Modifies: ; None ;**** cProc B$CRLF,<PUBLIC,NEAR> cBegin MOV DH,1 ; reset cursor column to 1 CMP DL,b$LINCNT ; on status line? JNE NOT_STATUS ; brif not -- don't adjust line MOV DL,b$WDOBOT ; move cursor to bottom ; line of text window NOT_STATUS: CMP b$WDOBOT,DL ; Are we at bottom of window? JE NO_INC ; brif so -- ZF ==> last line INC DX ; increment row (NZ) NO_INC: ; return with flags set cEnd ;*** ;B$SCNCLR - Home Text & Graphics Cursor, Refresh Function Key Display ;OEM-callback routine ; ; Re-written with revision [54]. ; ;Purpose: ; This routine is used to initialize the screen editor, reset ; the graphics viewport and window to the screen dimensions, ; center the graphics cursor, home the text cursor and display ; the function keys if needed. ; ; This routine must be called at initialization and whenever ; screen characters are no longer accessible to the user because ; the screen dimensions have changed. This routine should only ; be called from B$SCRSTT, B$SWIDTH, B$RESETSCN, and during ; initialization. ; ;Entry: ; None. ; ;Exit: ; None. ; ;Uses: ; Per Convention ; ;Preserves: ; BX, CX, DX ; ;Exceptions: ; None. ;**** cProc B$SCNCLR,<NEAR,PUBLIC> cBegin CALL B$WHOME ; DX=text cursor home MOV b$CURSOR,DX ; update b$CURSOR CALL [b$vKEYDSP] ; Conditionally display softkeys ; (displays user cursor at position ; b$CURSOR when done) cEnd <nogen> ; fall into B$VIEWINIT ; Added as part of revision [30] ;*** ;B$VIEWINIT - Initialize viewport, center graphics cursor ;OEM-callback routine ; ;Purpose: ; Initialize the graphics viewport and centers the graphics cursor. ; Sets the logical coordinate system to be identical to the ; physical coordinate system (disable WINDOW command). ; ;Entry: ; None ; ;Exit: ; None ; ;Uses: ; Per Convention ; ;Preserves: ; AX, BX, CX, DX ; ;Exceptions: ; None. ;**** cProc B$VIEWINIT,<NEAR,PUBLIC> cBegin CALL [b$VWINI_PTR] ;Initialize viewport, center graphics cursor MOV B$WNDWSW,0 ;Turn B$WNDWSW and B$WNDWSC off Near_Ret: ;near ret for vectors cEnd ;*** ;B$SCNSWI - Set screen width(logical/physical) and height ;OEM-callback routine ; ;Purpose: ; B$SCNSWI will set the screen width (both logical and physical) ; and screen height. Since this routine is used to communicate ; the screen dimensions to the Screen Editor, it must be called at ; initialization and whenever the character dimensions of the ; screen are modified. ; ;Input: ; AL=width, CL=height ; ;Output: ; None. ; ;Uses: ; Per Convention ; ;Preserves: ; AX, BX, CX, DX ; ;Exceptions: ; None. ;**** cProc B$SCNSWI,<PUBLIC,NEAR> cBegin MOV b$CRTWIDTH,AL ; Set physical width of screen MOV b$SCRNWIDTH,AL ; Set SCRN: logical width MOV B$LINCNT,CL ;Save physical height MOV b$WDOTOP,1 ;Init window top PUSH CX DEC CL ; Reserve status line MOV b$WDOBOT,CL ;Set window bottom POP CX cEnd ; End of B$SCNSWI ;*** ;B$UPCASE - Convert Character to Upper Case ;DBCS-callback ; ;Purpose: ; Convert the character in AL to uppercase if possible. If it is ; not a character or it is already uppercase, it is not modified. ; This is done by a comparison against the range 'a'-> 'z'. It does ; not use the Operating System call to case convert characters ; outside of this range. ; ; NOTE: It is the caller's responsibility to make sure that it is ; not sending 1/2 of a KANJI character to this routine. ; ; WARNING: Because this routine is called by B$GETCH ; ; DS != DGROUP ; ; If you go to change the code, keep this in mind!!! ;Entry: ; AL = Character to convert ; ;Exit: ; AL = UpperCase version of character ; ;Uses: ; Per Convention ; ;Preserves: ; AH, BX, CX, DX ; ;Exceptions: ; None. ;**** cProc B$UPCASE,<PUBLIC,NEAR> cBegin CMP AL,'a' ;Is AL < 'a' JB upret ;Skip it CMP AL,'z' ;Is AL > 'z' JA upret ;Skit it upit: AND AL,255-' ' ;Convert to Upper Case upret: cEnd ;*** ;B$Mul32x16 -- 32 by 16 bit multiply ; ;Purpose: ; Added with revision [68]. ; ;Entry: ; [DX|AX] = multiplicand ; [CX] = multiplier ; ;Exit: ; [DX|AX] = [DX|AX] * [CX] ; CF ==> overflow ; ;Uses: ; BX ; ;Preserves ; CX ; ;Exceptions: ; None ; ;****************************************************************************** cProc B$Mul32x16,<PUBLIC,NEAR> cBegin xchg bx,dx ; [BX|AX] = multiplicand mul cx ; multiply low word by 1000 ([DX|AX] = result) push ax ; save low word result push dx ; save first overflow xchg ax,bx ; AX = high word mul cx ; [DX|AX] = result of high word multiply pop dx ; DX = original high word jc Overflow ; brif overflow (need to clean stack) add ax,dx ; AX = high word of result (PSW.C if overflow) xchg ax,dx ; DX = high word of result OverFlow: pop ax ; AX = low word of result cEnd page sEnd RT_TEXT END
test/Succeed/fol-theorems/Common/FOL.agda
asr/apia
10
11783
------------------------------------------------------------------------------ -- Common FOL definitions ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module Common.FOL where infix 6 ∃ infix 4 _≡_ infixr 4 _,_ postulate D : Set -- The existential quantifier type on D. data ∃ (A : D → Set) : Set where _,_ : (t : D) → A t → ∃ A -- The identity type on D. data _≡_ (x : D) : D → Set where refl : x ≡ x
src/LibraBFT/Impl/Types/EpochChangeProof.agda
LaudateCorpus1/bft-consensus-agda
0
13466
<filename>src/LibraBFT/Impl/Types/EpochChangeProof.agda {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import LibraBFT.Base.Types open import LibraBFT.Impl.OBM.Logging.Logging import LibraBFT.Impl.Types.Verifier as Verifier open import LibraBFT.ImplShared.Consensus.Types open import Optics.All open import Util.Encode open import Util.PKCS hiding (verify) open import Util.Prelude ------------------------------------------------------------------------------ import Data.List.Base as List open import Data.String using (String) module LibraBFT.Impl.Types.EpochChangeProof where obmLastLIWS : EpochChangeProof → Either ErrLog LedgerInfoWithSignatures obmLastLIWS self = maybeS (lastMay (self ^∙ ecpLedgerInfoWithSigs)) (Left fakeErr {-["EpochChangeProof", "obmLastLIWS", "empty"]-}) pure -- first/lowest epoch of the proof to indicate which epoch this proof is helping with epoch : EpochChangeProof -> Either ErrLog Epoch epoch self = maybeS (headMay (self ^∙ ecpLedgerInfoWithSigs)) (Left fakeErr {-["EpochChangeProof", "epoch", "empty"]-}) (pure ∘ (_^∙ liwsLedgerInfo ∙ liEpoch)) obmLastEpoch : EpochChangeProof → Epoch obmLastEpoch self = eitherS (obmLastLIWS self) (const ({-Epoch-} 0)) (_^∙ liwsLedgerInfo ∙ liEpoch) verify : {verifier : Set} ⦃ _ : Verifier.Verifier verifier ⦄ → EpochChangeProof → verifier → Either ErrLog LedgerInfoWithSignatures verify self verifier = do lcheck (not (null (self ^∙ ecpLedgerInfoWithSigs))) (here' ("empty" ∷ [])) lastLedgerInfoWithSigs ← last (self ^∙ ecpLedgerInfoWithSigs) lcheckInfo (not (Verifier.isLedgerInfoStale verifier (lastLedgerInfoWithSigs ^∙ liwsLedgerInfo))) (here' ("stale" ∷ [])) -- Skip stale ledger infos in the proof prefix. let ledgerInfosWithSigs = List.boolFilter (λ liws → not (Verifier.isLedgerInfoStale verifier (liws ^∙ liwsLedgerInfo))) (self ^∙ ecpLedgerInfoWithSigs) -- check the non-stale chain loop verifier ledgerInfosWithSigs pure lastLedgerInfoWithSigs where loop : {verifier : Set} ⦃ _ : Verifier.Verifier verifier ⦄ → verifier → List LedgerInfoWithSignatures → Either ErrLog Unit loop verifierRef = λ where [] → pure unit (liws ∷ liwss) → do Verifier.verify verifierRef liws verifierRef' ← case liws ^∙ liwsLedgerInfo ∙ liNextEpochState of λ where nothing → Left fakeErr -- ["empty ValidatorSet"] (just vs) → pure vs loop verifierRef' liwss here' : List String → List String here' t = "EpochChangeProof" ∷ "verify" ∷ t last : ∀ {A : Set} → List A → Either ErrLog A last [] = Left fakeErr last (x ∷ []) = Right x last (_ ∷ x ∷ xs) = last xs
src/util/icon/gotofn.asm
olifink/qspread
0
3444
* Sprite gotofn * * Mode 4 * +----|---------------+ * - g gg ggg w w - * |g g g g ww ww | * |g gg ggg wwwww | * |g g g g wwwww | * | g g ggg wwwww | * | wwwwwwwww | * | wwwwwww | * | wwwww | * | www | * | w | * | | * | www w w w w w | * | w w w ww w w w| * | ww w w w ww w | * | w w w w w w w| * | w w w w w | * +----|---------------+ * section sprite xdef mes_gotofn mes_gotofn dc.w $0100,$0000 dc.w 20,16,4,0 dc.l mcs_gotofn-* dc.l mms_gotofn-* dc.l 0 mcs_gotofn dc.w $5B00,$8808 dc.w $8080,$0000 dc.w $9200,$8D0D dc.w $8080,$0000 dc.w $9B00,$8F0F dc.w $8080,$0000 dc.w $9200,$8F0F dc.w $8080,$0000 dc.w $5300,$8F0F dc.w $8080,$0000 dc.w $0000,$3F3F dc.w $E0E0,$0000 dc.w $0000,$1F1F dc.w $C0C0,$0000 dc.w $0000,$0F0F dc.w $8080,$0000 dc.w $0000,$0707 dc.w $0000,$0000 dc.w $0000,$0202 dc.w $0000,$0000 dc.w $0000,$0000 dc.w $0000,$0000 dc.w $0E0E,$A9A9 dc.w $2020,$0000 dc.w $0808,$ADAD dc.w $5050,$0000 dc.w $0C0C,$ABAB dc.w $4040,$0000 dc.w $0808,$A9A9 dc.w $5050,$0000 dc.w $0808,$4949 dc.w $2020,$0000 mms_gotofn dc.w $5B5B,$8888 dc.w $8080,$0000 dc.w $9292,$8D8D dc.w $8080,$0000 dc.w $9B9B,$8F8F dc.w $8080,$0000 dc.w $9292,$8F8F dc.w $8080,$0000 dc.w $5353,$8F8F dc.w $8080,$0000 dc.w $0000,$3F3F dc.w $E0E0,$0000 dc.w $0000,$1F1F dc.w $C0C0,$0000 dc.w $0000,$0F0F dc.w $8080,$0000 dc.w $0000,$0707 dc.w $0000,$0000 dc.w $0000,$0202 dc.w $0000,$0000 dc.w $0000,$0000 dc.w $0000,$0000 dc.w $0E0E,$A9A9 dc.w $2020,$0000 dc.w $0808,$ADAD dc.w $5050,$0000 dc.w $0C0C,$ABAB dc.w $4040,$0000 dc.w $0808,$A9A9 dc.w $5050,$0000 dc.w $0808,$4949 dc.w $2020,$0000 * end
tools-src/gnu/gcc/gcc/ada/g-comlin.ads
enfoTek/tomato.linksys.e2000.nvram-mod
80
1606
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . C O M M A N D _ L I N E -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1999-2001 Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- 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 is maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- High level package for command line parsing -- This package provides an interface to Ada.Command_Line, to do the -- parsing of command line arguments. Here is a small usage example: -- -- begin -- loop -- case Getopt ("a b: ad") is -- Accepts '-a', '-ad', or '-b argument' -- when ASCII.NUL => exit; -- -- when 'a' => -- if Full_Switch = "a" then -- Put_Line ("Got a"); -- else -- Put_Line ("Got ad"); -- end if; -- -- when 'b' => -- Put_Line ("Got b + " & Parameter); -- -- when others => -- raise Program_Error; -- cannot occur! -- end case; -- end loop; -- -- loop -- declare -- S : constant String := Get_Argument (Do_Expansion => True); -- begin -- exit when S'Length = 0; -- Put_Line ("Got " & S); -- end; -- end loop; -- -- exception -- when Invalid_Switch => Put_Line ("Invalid Switch " & Full_Switch); -- when Invalid_Parameter => Put_Line ("No parameter for " & Full_Switch); -- end; -- -- A more complicated example would involve the use of sections for the -- switches, as for instance in gnatmake. These sections are separated by -- special switches, chosen by the programer. Each section act as a -- command line of its own. -- -- begin -- Initialize_Option_Scan ('-', False, "largs bargs cargs"); -- loop -- -- same loop as above to get switches and arguments -- end loop; -- -- Goto_Section ("bargs"); -- loop -- -- same loop as above to get switches and arguments -- -- The supports switches in Get_Opt might be different -- end loop; -- -- Goto_Section ("cargs"); -- loop -- -- same loop as above to get switches and arguments -- -- The supports switches in Get_Opt might be different -- end loop; -- end; with GNAT.Directory_Operations; with GNAT.Regexp; package GNAT.Command_Line is procedure Initialize_Option_Scan (Switch_Char : Character := '-'; Stop_At_First_Non_Switch : Boolean := False; Section_Delimiters : String := ""); -- This procedure resets the internal state of the package to prepare -- to rescan the parameters. It need not (but may be) called before the -- first use of Getopt, but it must be called if you want to start -- rescanning the command line parameters from the start. The optional -- parameter Switch_Char can be used to reset the switch character, -- e.g. to '/' for use in DOS-like systems. The optional parameter -- Stop_At_First_Non_Switch indicates if Getopt is to look for switches -- on the whole command line, or if it has to stop as soon as a -- non-switch argument is found. -- -- Example: -- -- Arguments: my_application file1 -c -- -- if Stop_At_First_Non_Switch is False, then -c will be considered -- as a switch (returned by getopt), otherwise it will be considered -- as a normal argument (returned by Get_Argument). -- -- if SECTION_DELIMITERS is set, then every following subprogram -- (Getopt and Get_Argument) will only operate within a section, which -- is delimited by any of these delimiters or the end of the command line. -- -- Example: -- Initialize_Option_Scan ("largs bargs cargs"); -- -- Arguments on command line : my_application -c -bargs -d -e -largs -f -- This line is made of three section, the first one is the default one -- and includes only the '-c' switch, the second one is between -bargs -- and -largs and includes '-d -e' and the last one includes '-f' procedure Goto_Section (Name : String := ""); -- Change the current section. The next Getopt of Get_Argument will -- start looking at the beginning of the section. An empty name ("") -- refers to the first section between the program name and the first -- section delimiter. -- If the section does not exist, then Invalid_Section is raised. function Full_Switch return String; -- Returns the full name of the last switch found (Getopt only returns -- the first character) function Getopt (Switches : String) return Character; -- This function moves to the next switch on the command line (defined -- as a switch character followed by a character within Switches, -- casing being significant). The result returned is the first -- character of the particular switch located. If there are no more -- switches in the current section, returns ASCII.NUL. The switches -- need not be separated by spaces (they can be concatenated if they do -- not require an argument, e.g. -ab is the same as two separate -- arguments -a -b). -- -- Switches is a string of all the possible switches, separated by a -- space. A switch can be followed by one of the following characters : -- -- ':' The switch requires a parameter. There can optionally be a space -- on the command line between the switch and its parameter -- '!' The switch requires a parameter, but there can be no space on the -- command line between the switch and its parameter -- '?' The switch may have an optional parameter. There can no space -- between the switch and its argument -- ex/ if Switches has the following value : "a? b" -- The command line can be : -- -afoo : -a switch with 'foo' parameter -- -a foo : -a switch and another element on the -- command line 'foo', returned by Get_Argument -- -- Example: if Switches is "-a: -aO:", you can have the following -- command lines : -- -aarg : 'a' switch with 'arg' parameter -- -a arg : 'a' switch with 'arg' parameter -- -aOarg : 'aO' switch with 'arg' parameter -- -aO arg : 'aO' switch with 'arg' parameter -- -- Example: -- -- Getopt ("a b: ac ad?") -- -- accept either 'a' or 'ac' with no argument, -- accept 'b' with a required argument -- accept 'ad' with an optional argument -- -- If the first item in switches is '*', then Getopt will catch -- every element on the command line that was not caught by any other -- switch. The character returned by GetOpt is '*' -- -- Example -- Getopt ("* a b") -- If the command line is '-a -c toto.o -b', GetOpt will return -- successively 'a', '*', '*' and 'b'. When '*' is returnd, -- Full_Switch returns the corresponding item on the command line. -- -- -- When Getopt encounters an invalid switch, it raises the exception -- Invalid_Switch and sets Full_Switch to return the invalid switch. -- When Getopt can not find the parameter associated with a switch, it -- raises Invalid_Parameter, and sets Full_Switch to return the invalid -- switch character. -- -- Note: in case of ambiguity, e.g. switches a ab abc, then the longest -- matching switch is returned. -- -- Arbitrary characters are allowed for switches, although it is -- strongly recommanded to use only letters and digits for portability -- reasons. function Get_Argument (Do_Expansion : Boolean := False) return String; -- Returns the next element in the command line which is not a switch. -- This function should not be called before Getopt has returned -- ASCII.NUL. -- -- If Expansion is True, then the parameter on the command -- line will considered as filename with wild cards, and will be -- expanded. The matching file names will be returned one at a time. -- When there are no more arguments on the command line, this function -- returns an empty string. This is useful in non-Unix systems for -- obtaining normal expansion of wild card references. function Parameter return String; -- Returns parameter associated with the last switch returned by Getopt. -- If no parameter was associated with the last switch, or no previous -- call has been made to Get_Argument, raises Invalid_Parameter. -- If the last switch was associated with an optional argument and this -- argument was not found on the command line, Parameter returns an empty -- string type Expansion_Iterator is limited private; -- Type used during expansion of file names procedure Start_Expansion (Iterator : out Expansion_Iterator; Pattern : String; Directory : String := ""; Basic_Regexp : Boolean := True); -- Initialize an wild card expansion. The next calls to Expansion will -- return the next file name in Directory which match Pattern (Pattern -- is a regular expression, using only the Unix shell and DOS syntax if -- Basic_Regexp is True. When Directory is an empty string, the current -- directory is searched. function Expansion (Iterator : Expansion_Iterator) return String; -- Return the next file in the directory matching the parameters given -- to Start_Expansion and updates Iterator to point to the next entry. -- Returns an empty string when there are no more files in the directory. -- If Expansion is called again after an empty string has been returned, -- then the exception GNAT.Directory_Operations.Directory_Error is raised. Invalid_Section : exception; -- Raised when an invalid section is selected by Goto_Section Invalid_Switch : exception; -- Raised when an invalid switch is detected in the command line Invalid_Parameter : exception; -- Raised when a parameter is missing, or an attempt is made to obtain -- a parameter for a switch that does not allow a parameter private type Expansion_Iterator is limited record Dir : GNAT.Directory_Operations.Dir_Type; Regexp : GNAT.Regexp.Regexp; end record; end GNAT.Command_Line;
agda/Prelude.agda
ThiBen/catt
11
6879
<reponame>ThiBen/catt {-# OPTIONS --rewriting #-} -- -- Prelude.agda - Some base definitions -- module Prelude where open import Agda.Primitive public record ⊤ : Set where constructor tt {-# BUILTIN UNIT ⊤ #-} record Σ {i j} (A : Set i) (B : A → Set j) : Set (i ⊔ j) where constructor _,_ field fst : A snd : B fst open Σ public data ℕ : Set where O : ℕ S : ℕ → ℕ {-# BUILTIN NATURAL ℕ #-} uncurry : ∀ {i j k} {A : Set i} {B : A → Set j} {C : Set k} → (φ : (a : A) → (b : B a) → C) → Σ A B → C uncurry φ (a , b) = φ a b curry : ∀ {i j k} {A : Set i} {B : A → Set j} {C : Set k} → (ψ : Σ A B → C) → (a : A) → (b : B a) → C curry ψ a b = ψ (a , b) infix 30 _==_ data _==_ {i} {A : Set i} (a : A) : A → Set i where idp : a == a {-# BUILTIN EQUALITY _==_ #-} {-# BUILTIN REFL idp #-} transport : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ : A} (p : a₀ == a₁) → P a₀ → P a₁ transport P idp x = x sym : ∀ {i} {A : Set i} {a₀ a₁ : A} (p : a₀ == a₁) → a₁ == a₀ sym idp = idp etrans : ∀ {i} {A : Set i} {a₀ a₁ a₂ : A} → a₀ == a₁ → a₁ == a₂ → a₀ == a₂ etrans idp idp = idp proof-irrelevance : ∀ {a} {A : Set a} {x y : A} (p q : x == y) → p == q proof-irrelevance idp idp = idp elimtransport : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ : A} (p : a₀ == a₁) (q : a₀ == a₁) (r : p == q) (x : P a₀) → transport P p x == transport P q x elimtransport P p .p idp x = idp tr! : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ : A} (p : a₀ == a₁) (q : a₀ == a₁) (x : P a₀) → transport P p x == transport P q x tr! P p q x = elimtransport P p q (proof-irrelevance p q) x tr² : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ a₂ : A} (p : a₀ == a₁) (q : a₁ == a₂) (x : P a₀) → transport P q (transport P p x) == transport P (etrans p q) x tr² P idp idp x = idp tr³ : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ a₂ a₃ : A} (p₀ : a₀ == a₁) (p₁ : a₁ == a₂) (p₂ : a₂ == a₃) (x : P a₀) → transport P p₂ (transport P p₁ (transport P p₀ x)) == transport P (etrans p₀ (etrans p₁ p₂)) x tr³ P idp idp idp x = idp tr⁴ : ∀{i j} {A : Set i} (P : A → Set j) {a₀ a₁ a₂ a₃ a₄ : A} (p₀ : a₀ == a₁) (p₁ : a₁ == a₂) (p₂ : a₂ == a₃) (p₃ : a₃ == a₄) (x : P a₀) → transport P p₃ (transport P p₂ (transport P p₁ (transport P p₀ x))) == transport P (etrans p₀ (etrans p₁ (etrans p₂ p₃))) x tr⁴ P idp idp idp idp x = idp hfiber : ∀ {i} {A B : Set i} (f : A → B) (b : B) → Set i hfiber {A = A} f b = Σ A (λ a → f a == b) PathOver : ∀ {i j} {A : Set i} (B : A → Set j) {a₀ a₁ : A} (p : a₀ == a₁) (b₉ : B a₀) (b₁ : B a₁) → Set j PathOver B idp b₀ b₁ = b₀ == b₁ infix 30 PathOver syntax PathOver B p u v = u == v [ B ↓ p ] Σ-r : ∀ {i j k} {A : Set i} {B : A → Set j} (C : Σ A B → Set k) → A → Set (j ⊔ k) Σ-r {A = A} {B = B} C a = Σ (B a) (λ b → C (a , b)) Σ-in : ∀ {i j k} {A : Set i} {B : A → Set j} (C : (a : A) → B a → Set k) → A → Set (j ⊔ k) Σ-in {A = A} {B = B} C a = Σ (B a) (λ b → C a b) infix 30 _↦_ postulate _↦_ : ∀ {i} {A : Set i} → A → A → Set i {-# BUILTIN REWRITE _↦_ #-} data bool : Set where true : bool false : bool data ⊥ : Set where if_then_else : ∀ {a} {A : Set a} → bool → A → A → A if true then A else B = A if false then A else B = B _≤_ : ℕ → ℕ → bool O ≤ n₁ = true S n₀ ≤ O = false S n₀ ≤ S n₁ = n₀ ≤ n₁ min : ℕ → ℕ → ℕ min n₀ n₁ with n₀ ≤ n₁ min n₀ n₁ | true = n₀ min n₀ n₁ | false = n₁ ≤S : ∀ (n₀ n₁ : ℕ) → (n₀ ≤ n₁) == true → (n₀ ≤ S n₁) == true ≤S O n₁ x = idp ≤S (S n₀) O () ≤S (S n₀) (S n₁) x = ≤S n₀ n₁ x S≤S : ∀ (n₀ n₁ : ℕ) → (n₀ ≤ n₁) == true → (S n₀ ≤ S n₁) == true S≤S n₀ n₁ x = x
src/Categories/Category/Instance/Properties/Setoids/Complete.agda
Trebor-Huang/agda-categories
279
8047
<reponame>Trebor-Huang/agda-categories {-# OPTIONS --without-K --safe #-} module Categories.Category.Instance.Properties.Setoids.Complete where open import Level open import Data.Product using (Σ; proj₁; proj₂; _,_; Σ-syntax; _×_; -,_) open import Function.Equality using (Π) open import Relation.Binary using (Setoid; Rel) open import Categories.Category using (Category; _[_,_]) open import Categories.Functor open import Categories.Category.Instance.Setoids open import Categories.Category.Complete import Categories.Category.Construction.Cones as Co open Π using (_⟨$⟩_) Setoids-Complete : (o ℓ e c ℓ′ : Level) → Complete o ℓ e (Setoids (c ⊔ ℓ ⊔ o ⊔ ℓ′) (o ⊔ ℓ′)) Setoids-Complete o ℓ e c ℓ′ {J} F = record { terminal = record { ⊤ = record { N = record { Carrier = Σ (∀ j → F₀.Carrier j) (λ S → ∀ {X Y} (f : J [ X , Y ]) → [ F₀ Y ] F₁ f ⟨$⟩ S X ≈ S Y) ; _≈_ = λ { (S₁ , _) (S₂ , _) → ∀ j → [ F₀ j ] S₁ j ≈ S₂ j } ; isEquivalence = record { refl = λ j → F₀.refl j ; sym = λ a≈b j → F₀.sym j (a≈b j) ; trans = λ a≈b b≈c j → F₀.trans j (a≈b j) (b≈c j) } } ; apex = record { ψ = λ j → record { _⟨$⟩_ = λ { (S , _) → S j } ; cong = λ eq → eq j } ; commute = λ { {X} {Y} X⇒Y {_ , eq} {y} f≈g → F₀.trans Y (eq X⇒Y) (f≈g Y) } } } ; ⊤-is-terminal = record { ! = λ {K} → let module K = Cone K in record { arr = record { _⟨$⟩_ = λ x → (λ j → K.ψ j ⟨$⟩ x) , λ f → K.commute f (Setoid.refl K.N) ; cong = λ a≈b j → Π.cong (K.ψ j) a≈b } ; commute = λ x≈y → Π.cong (K.ψ _) x≈y } ; !-unique = λ {K} f x≈y j → let module K = Cone K in F₀.sym j (Cone⇒.commute f (Setoid.sym K.N x≈y)) } } } where open Functor F open Co F module J = Category J module F₀ j = Setoid (F₀ j) [_]_≈_ = Setoid._≈_
libsrc/oz/ozinterrupt/serial_int.asm
grancier/z180
0
85586
<filename>libsrc/oz/ozinterrupt/serial_int.asm ; ; Sharp OZ family functions ; ; ported from the OZ-7xx SDK by by <NAME> ; by <NAME> - Oct. 2003 ; ; ; interrupt driven serial routines ; ; ; ------ ; $Id: serial_int.asm,v 1.5 2016/06/27 21:25:36 dom Exp $ ; SECTION code_clib PUBLIC serial_int PUBLIC serial_int_check PUBLIC ozserbufget PUBLIC ozserbufput PUBLIC SerialBuffer PUBLIC ozrxhandshaking PUBLIC ozrxxoff EXTERN ozcustomisr EXTERN rxxoff_hook EXTERN serial_hook EXTERN ozintwait EXTERN serial_check_hook ; Don't exchange the items position !! rxxoff_handler: ld a,(ozrxxoff) or a ;jp z,$rxxoff_hook+2 jp z,rxxoff_hook+3 ld hl,ozserbufput ld a,(hl) dec hl ; hl=ozserbufget sub (hl) cp 150 jp nc,rxxoff_hook+3 waittop2: in a,(45h) and 20h jr z,waittop2 ld a,17 ; XON out (40h),a xor a ld (ozrxxoff),a jp rxxoff_hook+3 serial_int_check: ld a,(ozserbufget) ld c,a ld a,(ozserbufput) cp c jp z,serial_check_hook+3 ei ret serial_int: in a,(45h) and 1 jp z,serial_hook+3 ;; no serial data in a,(40h) push hl ld e,a ld hl,ozserbufput ld a,(hl) ld c,a inc a dec hl ; hl=ozserbufget cp (hl) jp z,BufferFull inc hl ; hl=ozserbufput ld (hl),a ei ld b,0 inc hl ; hl=SerialBuffer add hl,bc ld (hl),e ld hl,ozserbufget sub (hl) ; a=buffer size cp 200 jr c,noXOFF ld a,(ozrxhandshaking) or a jr z,noXOFF ld a,(ozrxxoff) or a jr nz,noXOFF waittop: in a,(45h) and 20h jr z,waittop ld a,19 ; XOFF out (40h),a ld a,1 ld (ozrxxoff),a noXOFF: BufferFull: pop hl jp serial_hook+3 SECTION bss_clib defc BufLen = 256 ozserbufget: defs 1 ozserbufput: defs 1 SerialBuffer: defs BufLen ozrxhandshaking: defs 1 ozrxxoff: defs 1
src/debug/serial.asm
RyanSchuster/vos64
1
15180
<filename>src/debug/serial.asm<gh_stars>1-10 %define MOD_SERIAL ; module: Serial %include "debug/serial.inc" ;------------------------------------------------------------------------------- ; Local macro constants ; ; Got a bit carried away here... ; Default base addresses (don't trust these) %define PORT_COM1 0x03F8 %define PORT_COM2 0x02F8 %define PORT_COM3 0x03E8 %define PORT_COM4 0x02E8 ; Register offsets %define COM_RBR_THR 0x0000 ; DLAB = 0, rx buf/tx holding register %define COM_IER 0x0001 ; DLAB = 0, interrupt enable %define COM_DL_LSB 0x0000 ; DLAB = 1, divisor latch lsb %define COM_DL_MSB 0x0001 ; DLAB = 1, divisor latch msb %define COM_IIR_FCR 0x0002 ; interrupt id/fifo control register %define COM_LCR 0x0003 ; line control register %define COM_MCR 0x0004 ; modem control register %define COM_LSR 0x0005 ; line status register %define COM_MSR 0x0006 ; modem status register %define COM_SCR 0x0007 ; scratch register ; Register bitfields %define IER_ERBFI 0x01 ; enable rx buffer full interrupt %define IER_ETBEI 0x02 ; enable tx buffer empty interrupt %define IER_ELSI 0x04 ; enable line status interrupt %define IER_EDSSI 0x08 ; enable delta status signals interrupt %define DL_115200 0x0001 ; is this enough bauds for you? %define DL_57600 0x0002 %define DL_38400 0x0003 %define DL_19200 0x0006 %define DL_9600 0x000C %define DL_7200 0x0010 %define DL_4800 0x0018 %define DL_3600 0x0020 %define DL_2400 0x0030 %define DL_2000 0x003A %define DL_1800 0x0040 %define DL_1200 0x0060 %define DL_600 0x00C0 %define DL_300 0x0180 %define DL_150 0x0300 %define DL_134P5 0x0359 %define DL_110 0x0417 %define DL_75 0x0600 %define DL_50 0x0900 %define IIR_PEND 0x01 ; interrupt pending if zero %define IIR_IID_MASK 0x0E ; interrupt id mask %define IIR_IID_STAT 0x06 ; status interrupt highest %define IIR_IID_RX 0x04 ; rx buf full second highest %define IIR_IID_FIFO 0x0C ; no rx, buf fifo full second highest %define IIR_IID_TX 0x02 ; tx buf empty third highest %define IIR_IID_MODEM 0x00 ; delta flags set lowest %define IIR_FIFO_EN 0xC0 %define FCR_ENABLE 0x01 ; enable fifos %define FCR_RFRES 0x02 ; receive fifo reset %define FCR_TFRES 0x04 ; transmit fifo reset %define FCR_DMASEL 0x08 ; DMA mode select %define FCF_RXTRIG_MASK 0xC0 ; bytes before rx int is fired %define FCR_RXTRIG_1 0x00 %define FCR_RXTRIG_4 0x40 %define FCR_RXTRIG_8 0x80 %define FCR_RXTRIG_14 0xC0 %define LCR_SIZE_MASK 0x03 ; for pulling out all size bits %define LCR_SIZE_5BIT 0x00 %define LCR_SIZE_6BIT 0x01 %define LCR_SIZE_7BIT 0x02 %define LCR_SIZE_8BIT 0x03 %define LCR_1STOP 0x00 %define LCR_2STOP 0x04 ; long (2 or 1.5) stop bits %define LCR_PARITY_MASK 0x38 ; for extracting parity bits %define LCR_PARITY_NONE 0x00 %define LCR_PARITY_ODD 0x08 %define LCR_PARITY_EVEN 0x18 %define LCR_PARITY_MARK 0x28 %define LCR_PARITY_SPACE 0x38 %define LCR_SBR 0x40 ; set break %define LCR_DLAB 0x80 ; divisor latch access bit %define MCR_DTR 0x01 ; data terminal ready %define MCR_RTS 0x02 ; request to send %define MCR_OUT_1 0x04 ; don't know, just write a 1 %define MCR_OUT_2 0x08 ; interrupts? just write a 1 %define MCR_LOOP 0x10 ; local loopback for self-test %define LSR_RBF 0x01 ; receiver buffer full %define LSR_OE 0x02 ; overrun error %define LSR_PE 0x04 ; parity error %define LSR_FE 0x08 ; framing error %define LSR_BREAK 0x10 ; broken line detected %define LSR_THRE 0x20 ; tx holding register empty %define LSR_TEMT 0x40 ; transmitter empty %define LSR_FIFOERR 0x80 ; error(s) in the rx fifo chain %define MSR_DCTS 0x01 ; data clear to send %define MSR_DDSR 0x02 ; delta data set ready %define MSR_TERI 0x04 ; trailing edge ring indicator %define MSR_DDCD 0x08 ; delta data carrier detect %define MSR_CTS 0x10 ; clear to send %define MSR_DSR 0x20 ; data set ready %define MSR_RI 0x40 ; ring indicator %define MSR_DCD 0x80 ; data carrier detect [section .text] [bits 64] [global SerialInit] SerialInit: push rax push rdx ; Disable interrupts xor al, al mov dx, PORT_COM1 + COM_LCR out dx, al ; clear DLAB just in case mov dx, PORT_COM1 + COM_IER out dx, al ; Set the DLAB bit so we can set the baud rate mov dx, PORT_COM1 + COM_LCR mov al, LCR_DLAB out dx, al ; Set baud to 115200 (divisor of 1) mov dx, PORT_COM1 + COM_DL_LSB mov ax, DL_115200 out dx, ax ; Set trigger threshold, reset, and enable fifos mov dx, PORT_COM1 + COM_IIR_FCR mov al, FCR_RXTRIG_14 | FCR_TFRES | FCR_RFRES | FCR_ENABLE out dx, al ; Clear DLAB and set the line properties mov dx, PORT_COM1 + COM_LCR mov al, LCR_PARITY_NONE | LCR_1STOP | LCR_SIZE_8BIT out dx, al pop rdx pop rax ret [global SerialPutChar] SerialPutChar: push rax push rdx mov ah, al ; Wait until the tx buffer is empty .wait: mov dx, PORT_COM1 + COM_LSR in al, dx test al, LSR_THRE jz .wait ; Write the character mov al, ah mov dx, PORT_COM1 + COM_RBR_THR out dx, al pop rdx pop rax ret [global SerialClrScr] SerialClrScr: push rax ; Do something here? pop rax ret [section .data] [section .bss]
source/ada83/directio.ads
ytomino/drake
33
24780
pragma License (Unrestricted); with Ada.Direct_IO; generic package Direct_IO renames Ada.Direct_IO;
programs/oeis/008/A008811.asm
jmorken/loda
1
242977
; A008811: Expansion of x*(1+x^4)/((1-x)^2*(1-x^4)). ; 0,1,2,3,4,7,10,13,16,21,26,31,36,43,50,57,64,73,82,91,100,111,122,133,144,157,170,183,196,211,226,241,256,273,290,307,324,343,362,381,400,421,442,463,484,507,530,553,576,601,626,651,676,703,730,757,784,813,842,871,900,931,962,993,1024,1057,1090,1123,1156,1191,1226,1261,1296,1333,1370,1407,1444,1483,1522,1561,1600,1641,1682,1723,1764,1807,1850,1893,1936,1981,2026,2071,2116,2163,2210,2257,2304,2353,2402,2451,2500,2551,2602,2653,2704,2757,2810,2863,2916,2971,3026,3081,3136,3193,3250,3307,3364,3423,3482,3541,3600,3661,3722,3783,3844,3907,3970,4033,4096,4161,4226,4291,4356,4423,4490,4557,4624,4693,4762,4831,4900,4971,5042,5113,5184,5257,5330,5403,5476,5551,5626,5701,5776,5853,5930,6007,6084,6163,6242,6321,6400,6481,6562,6643,6724,6807,6890,6973,7056,7141,7226,7311,7396,7483,7570,7657,7744,7833,7922,8011,8100,8191,8282,8373,8464,8557,8650,8743,8836,8931,9026,9121,9216,9313,9410,9507,9604,9703,9802,9901,10000,10101,10202,10303,10404,10507,10610,10713,10816,10921,11026,11131,11236,11343,11450,11557,11664,11773,11882,11991,12100,12211,12322,12433,12544,12657,12770,12883,12996,13111,13226,13341,13456,13573,13690,13807,13924,14043,14162,14281,14400,14521,14642,14763,14884,15007,15130,15253,15376,15501 lpb $0 add $1,$0 trn $0,4 add $1,$0 lpe
3-mid/opengl/source/platform/glx/opengl-context.adb
charlie5/lace
20
26920
<filename>3-mid/opengl/source/platform/glx/opengl-context.adb with glx.Pointers; package body openGL.Context -- TODO: Finish this package. is procedure define (Self : in out Item; Profile : in openGL.surface_Profile.item'Class) is pragma Unreferenced (Profile); use GlX, glx.Pointers; begin if Self.glx_Context = null then raise Program_Error with "No openGL context"; end if; end define; procedure make_Current (Self : in Item; read_Surface : in Surface.item; write_Surface : in Surface.item) is pragma Unreferenced (write_Surface); Success : glx.Bool with Unreferenced; begin null; end make_Current; function glx_Context_debug (Self : in Item'Class) return glx.Context.item is begin return Self.glx_Context; end glx_Context_debug; end openGL.Context;
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1123.asm
ljhsiun2/medusa
9
101369
.global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xb35e, %rsi lea addresses_A_ht+0x16450, %rdi nop nop sub $18820, %r15 mov $106, %rcx rep movsw nop nop nop add %rbp, %rbp lea addresses_WC_ht+0x1e798, %rsi lea addresses_UC_ht+0x1bc96, %rdi nop and %rbp, %rbp mov $36, %rcx rep movsq nop cmp $6988, %rbp lea addresses_D_ht+0x8926, %rsi nop nop nop nop nop cmp %r8, %r8 mov (%rsi), %edi nop nop nop dec %rsi lea addresses_UC_ht+0xa2e8, %rbp nop nop nop nop xor $24928, %r8 mov $0x6162636465666768, %r15 movq %r15, (%rbp) nop nop nop nop nop and %r15, %r15 lea addresses_WT_ht+0x1a138, %rcx nop cmp %rdx, %rdx movups (%rcx), %xmm2 vpextrq $0, %xmm2, %rdi nop nop nop nop nop xor %r15, %r15 lea addresses_D_ht+0x9444, %rsi clflush (%rsi) nop nop nop nop dec %rbp mov (%rsi), %dx nop nop nop nop nop add $60939, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %rbx push %rdi // Faulty Load lea addresses_A+0xc578, %rbx clflush (%rbx) nop nop cmp %rdi, %rdi mov (%rbx), %r14 lea oracles, %rdi and $0xff, %r14 shlq $12, %r14 mov (%rdi,%r14,1), %r14 pop %rdi pop %rbx pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': True, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 1}, 'dst': {'same': True, 'type': 'addresses_A_ht', 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 4}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'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 */
Task/Grayscale-image/Ada/grayscale-image-3.ada
LaudateCorpus1/RosettaCodeData
1
29445
function Color (Picture : Grayscale_Image) return Image is Result : Image (Picture'Range (1), Picture'Range (2)); begin for I in Picture'Range (1) loop for J in Picture'Range (2) loop Result (I, J) := (others => Picture (I, J)); end loop; end loop; return Result; end Color;
examples/compress_and_back/demo_ada.adb
jrmarino/zstd-ada
13
22514
with Zstandard.Functions; use Zstandard.Functions; with Ada.Text_IO; use Ada.Text_IO; procedure Demo_Ada is message : constant String := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus " & "tempor erat quis metus faucibus, a elementum odio varius. Donec " & "ultrices posuere nisl. Aliquam molestie, nibh a ultrices dictum, " & "neque nisi pellentesque sapien, a molestie urna quam eu leo. Morbi " & "nec finibus odio, vel maximus lorem. Proin eget viverra tellus, eu " & "vestibulum est. Aliquam pharetra vulputate porttitor. Integer eu " & "varius dui. Vivamus non metus id metus cursus auctor. Integer erat " & "augue, pharetra in nisl a, aliquet tempor leo."; begin Put_Line ("Zstandard version: " & Zstd_Version); Put_Line (""); Put_Line ("message:"); Put_Line (message); declare nominal : Boolean; compacted : constant String := Compress (source_data => message, successful => nominal, quality => 1); begin if not nominal then Put_Line ("FAILURE!"); Put_Line (compacted); return; end if; Put_Line (""); Put_Line (" original length:" & message'Length'Img); Put_Line ("compressed length:" & compacted'Length'Img); Put_Line (""); Put_Line ("Testing decompression ..."); declare vessel : String := Decompress (source_data => compacted, successful => nominal); begin if not nominal then Put_Line ("FAILURE!"); Put_Line (vessel); return; end if; if message = vessel then Put_Line ("SUCCESS! Decompressed text is the same as the original"); else Put_Line ("ERROR! Return value different"); Put_Line (vessel); end if; end; end; end Demo_Ada;
timer.asm
bsutherland/c64lib
1
178334
#importonce .const TIMER_KERNAL_JIFFY = $00a0 .const TIMER_KERNAL_JIFFY_LSB = TIMER_KERNAL_JIFFY + 2 .macro timer_nop_jiffies(j) { lda TIMER_KERNAL_JIFFY_LSB adc #(j-1) nop_loop: cmp TIMER_KERNAL_JIFFY_LSB bcs nop_loop }
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0x84_notsx.log_132_721.asm
ljhsiun2/medusa
9
97170
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0x84_notsx.log_132_721.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_A_ht+0x3837, %rsi lea addresses_WT_ht+0x19cbe, %rdi nop nop nop nop nop cmp $43770, %r14 mov $91, %rcx rep movsw nop nop sub %rax, %rax lea addresses_UC_ht+0x8dfe, %r8 clflush (%r8) nop nop nop add %r11, %r11 movb (%r8), %al cmp %rsi, %rsi lea addresses_normal_ht+0xd73e, %rsi lea addresses_UC_ht+0x14f6, %rdi clflush (%rsi) nop nop nop dec %r11 mov $47, %rcx rep movsl nop nop nop nop nop dec %r14 lea addresses_UC_ht+0x654e, %r8 nop nop nop sub $58998, %rdi mov (%r8), %esi nop add %r14, %r14 lea addresses_WC_ht+0x7a32, %rcx and %r14, %r14 mov $0x6162636465666768, %r8 movq %r8, %xmm2 and $0xffffffffffffffc0, %rcx movntdq %xmm2, (%rcx) nop nop nop nop nop dec %r11 lea addresses_normal_ht+0x17cbe, %rcx clflush (%rcx) dec %rax movups (%rcx), %xmm3 vpextrq $1, %xmm3, %rdi cmp %r14, %r14 lea addresses_UC_ht+0x164be, %rsi lea addresses_WC_ht+0xd8be, %rdi nop nop add %r13, %r13 mov $80, %rcx rep movsb dec %rcx lea addresses_UC_ht+0x8be, %r8 clflush (%r8) nop nop nop nop nop xor $4505, %rsi movl $0x61626364, (%r8) nop inc %rsi lea addresses_WT_ht+0x16bbe, %rsi add %r14, %r14 mov (%rsi), %r11d nop and $39823, %rsi lea addresses_WC_ht+0xf8de, %rsi lea addresses_WC_ht+0x6c3e, %rdi nop nop dec %r14 mov $126, %rcx rep movsq nop nop nop dec %r11 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rbx push %rdi push %rdx push %rsi // Store mov $0x66625800000003fa, %r15 nop xor %rdx, %rdx movw $0x5152, (%r15) nop nop nop nop nop add $47114, %rdx // Faulty Load lea addresses_US+0x9cbe, %rdi nop nop nop nop nop add %rbx, %rbx movups (%rdi), %xmm7 vpextrq $0, %xmm7, %r15 lea oracles, %rbx and $0xff, %r15 shlq $12, %r15 mov (%rbx,%r15,1), %r15 pop %rsi pop %rdx pop %rdi pop %rbx pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_US', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'95': 7, '00': 119, '1a': 3, '45': 1, '47': 2} 00 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 95 95 95 95 47 00 00 00 00 00 00 00 00 00 00 00 00 00 95 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 95 00 00 95 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 */
B2G/gecko/js/src/jswin64.asm
wilebeast/FireFox-OS
3
25466
; This Source Code Form is subject to the terms of the Mozilla Public ; License, v. 2.0. If a copy of the MPL was not distributed with this ; file, You can obtain one at http://mozilla.org/MPL/2.0/. .CODE extern fmod:PROC ; This is a workaround for KB982107 (http://support.microsoft.com/kb/982107) js_myfmod PROC FRAME .ENDPROLOG fnclex jmp fmod js_myfmod ENDP END
alloy4fun_models/trainstlt/models/2/XPv47MDmaLMnybgbQ.als
Kaixi26/org.alloytools.alloy
0
1703
open main pred idXPv47MDmaLMnybgbQ_prop3 { always (all t:Train, k:Track | t.pos = k implies after t.pos = k) } pred __repair { idXPv47MDmaLMnybgbQ_prop3 } check __repair { idXPv47MDmaLMnybgbQ_prop3 <=> prop3o }
tests/exec/power.adb
xuedong/mini-ada
0
28288
with Ada.Text_IO; use Ada.Text_IO; procedure Power is procedure PrintInt(N: Integer) is C: Integer := N rem 10; begin if N > 9 then PrintInt(N / 10); end if; Put(Character'Val(48 + C)); end; procedure PrintSInt(N: Integer) is C: Integer := N rem 10; begin if N >= 0 then Printint(N); return; end if; Put('-'); if N < -9 then Printint(- N / 10); end if; Put(Character'Val(48 - C)); end; function Power(X, N: Integer) return Integer is P: Integer; begin if N = 0 then return 1; end if; P := Power(X, N / 2); P := P * P; if N rem 2 = 1 then P := X * P; end if; return P; end; begin PrintSInt(Power(2, 0)); New_Line; PrintSInt(Power(2, 8)); New_Line; PrintsInt(Power(2, 30)); New_Line; PrintsInt(Power(2, 31)); New_Line; end; -- Local Variables: -- compile-command: "gnatmake power.adb && ./power" -- End:
wof/lcs/base/2AA.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
97052
copyright zengfr site:http://github.com/zengfr/romhack 002A7A movea.l (A4), A1 [enemy+80] 002A7C bsr $2c9c [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002AF2 movea.l (A4), A1 [base+2A4, base+2C4, base+2E4] 002AF4 bsr $2e86 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002B12 lea (-$104,A2), A2 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002BC8 movea.l (A4), A2 [base+295, base+2B5, base+2D5] 002BCA move.w (A0)+, D2 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002C56 bsr $2c9c [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002C94 movea.l (A4), A1 [base+2A4, base+2C4, base+2E4] 002C96 bsr $2c9c [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002D84 movea.l (A4), A1 [base+2A4, base+2C4, base+2E4] 002D86 bsr $2e86 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002DB0 movea.l (A4), A1 [base+2A4, base+2C4, base+2E4] 002DB2 bsr $2e86 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002E08 movea.l (A4), A1 [base+2C4, base+2E4] 002E0A bsr $2e86 [base+2A8, base+2AA, base+2C8, base+2CA] 002E22 lea (-$108,A2), A2 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 002E62 movea.l (A4), A1 [base+292, base+2B2, base+2D2] 002E64 suba.w #$c, A1 [base+288, base+28A, base+2A8, base+2AA, base+2C8, base+2CA] 01A5A6 adda.w #$800, A1 [base+2A8, base+2AA] 01A74C dbra D7, $1a74a copyright zengfr site:http://github.com/zengfr/romhack
testcode/test_lea.asm
1justinbarnett/ece411-sp2017
0
87037
<reponame>1justinbarnett/ece411-sp2017 ORIGIN 4x0000 SEGMENT CodeSegment: LEA R0, VALUE1 ; R0 should contain the value 4x0012 ENDLOOP: BRnzp ENDLOOP NOP NOP NOP NOP NOP NOP NOP SEGMENT DATA: VALUE1: DATA2 4x0000
codigo/ej5/COM/ex_com.asm
IgnacioPardo/TD2_TP1
0
8058
<filename>codigo/ej5/COM/ex_com.asm<gh_stars>0 SET R0, 0x99 SET R1, 0xD2 COM R0, R1
src/Equational-reasoning.agda
nad/up-to
0
7803
------------------------------------------------------------------------ -- Overloaded "equational" reasoning combinators ------------------------------------------------------------------------ {-# OPTIONS --safe #-} module Equational-reasoning where open import Equality.Propositional open import Prelude infix -1 _■ finally₁ finally₁∽ finally₁→ finally₁← finally₂ finally₂∽ finally₂→ finally₂← finally₁-≡∼ finally₁-≡∽ finally₁-≡→ finally₁-≡← finally₂-≡∼ finally₂-≡∽ finally₂-≡→ finally₂-≡← infixr -2 step-⟨⟩∼ step-≡∼ step-≡→ step-∼ step-∼→ step-∼′ step-∼→′ infixl -2 step-⟨⟩∽ step-≡∽ step-≡← step-∽ step-∼← step-∽′ step-∼←′ ------------------------------------------------------------------------ -- Reflexivity record Reflexive {a p} {A : Type a} (P : A → A → Type p) : Type (a ⊔ p) where constructor is-reflexive field reflexive : ∀ {x} → P x x open Reflexive ⦃ … ⦄ public _■ : ∀ {a p} {A : Type a} {P : A → A → Type p} ⦃ r : Reflexive P ⦄ (x : A) → P x x _ ■ = reflexive -- Transitivity-like combinators. These combinators can be used when -- two arguments are definitionally equal. (The Reflexive instance -- argument is used to make type inference easier.) step-⟨⟩∼ step-⟨⟩∽ : ∀ {a p} {A : Type a} {P : A → A → Type p} ⦃ p : Reflexive P ⦄ x {y} → P x y → P x y step-⟨⟩∼ _ p = p step-⟨⟩∽ = step-⟨⟩∼ syntax step-⟨⟩∼ x Pxy = x ∼⟨⟩ Pxy syntax step-⟨⟩∽ x Pxy = Pxy ∽⟨⟩ x -- Transitivity-like combinators. These combinators can be used when -- two arguments are propositionally equal. (The Reflexive instance -- argument is used to make type inference easier.) -- It can be easier for Agda to type-check typical "equational" -- reasoning chains if the transitivity proof gets the equality -- arguments in the opposite order, because then the y argument is -- (perhaps more) known once the proof of P x y is type-checked. -- -- This optimisation can be quite effective for some examples, but did -- not seem to have much effect when I applied it to the current code -- base. -- -- The idea behind this optimisation came up in discussions with Ulf -- Norell. step-≡∼ step-≡∽ step-≡→ step-≡← : ∀ {a p} {A : Type a} {P : A → A → Type p} ⦃ r : Reflexive P ⦄ x {y z} → P y z → x ≡ y → P x z step-≡∼ _ p refl = p step-≡∽ = step-≡∼ step-≡→ = step-≡∼ step-≡← = step-≡∼ syntax step-≡∼ x Pyz x≡y = x ∼≡⟨ x≡y ⟩ Pyz syntax step-≡∽ x Pyz x≡y = Pyz ∽≡⟨ x≡y ⟩ x syntax step-≡→ x Pyz x≡y = x →≡⟨ x≡y ⟩ Pyz syntax step-≡← x Pyz x≡y = Pyz ←≡⟨ x≡y ⟩ x finally₂-≡∼ finally₂-≡∽ finally₂-≡→ finally₂-≡← : ∀ {a p} {A : Type a} {P : A → A → Type p} ⦃ r : Reflexive P ⦄ x y → x ≡ y → P x y finally₂-≡∼ _ _ refl = reflexive finally₂-≡∽ = finally₂-≡∼ finally₂-≡→ = finally₂-≡∼ finally₂-≡← = finally₂-≡∼ syntax finally₂-≡∼ x y x≡y = x ∼≡⟨ x≡y ⟩■ y syntax finally₂-≡∽ x y x≡y = y ∽≡⟨ x≡y ⟩■ x syntax finally₂-≡→ x y x≡y = x →≡⟨ x≡y ⟩■ y syntax finally₂-≡← x y x≡y = y ←≡⟨ x≡y ⟩■ x finally₁-≡∼ finally₁-≡∽ finally₁-≡→ finally₁-≡← : ∀ {a p} {A : Type a} {P : A → A → Type p} ⦃ r : Reflexive P ⦄ x {y} → x ≡ y → P x y finally₁-≡∼ _ refl = reflexive finally₁-≡∽ = finally₁-≡∼ finally₁-≡→ = finally₁-≡∼ finally₁-≡← = finally₁-≡∼ syntax finally₁-≡∼ x x≡y = x ∼≡⟨ x≡y ⟩■ syntax finally₁-≡∽ x x≡y = ∽≡⟨ x≡y ⟩■ x syntax finally₁-≡→ x x≡y = x →≡⟨ x≡y ⟩■ syntax finally₁-≡← x x≡y = ←≡⟨ x≡y ⟩■ x ------------------------------------------------------------------------ -- Symmetry record Symmetric {a p} {A : Type a} (P : A → A → Type p) : Type (a ⊔ p) where constructor is-symmetric field symmetric : ∀ {x y} → P x y → P y x open Symmetric ⦃ … ⦄ public ------------------------------------------------------------------------ -- Transitivity -- One variant of transitivity. -- -- Note that the combinator can (depending on the available instances) -- be used to convert from one type to another, but only in its first -- argument (in order to make instance resolution easier). record Transitive {a b p q} {A : Type a} {B : Type b} (P : A → A → Type p) (Q : A → B → Type q) : Type (a ⊔ b ⊔ p ⊔ q) where constructor is-transitive field transitive : ∀ {x y z} → P x y → Q y z → Q x z open Transitive ⦃ … ⦄ public step-∼ step-∽ step-∼→ step-∼← : ∀ {a b p q} {A : Type a} {B : Type b} {P : A → A → Type p} {Q : A → B → Type q} ⦃ t : Transitive P Q ⦄ x {y z} → Q y z → P x y → Q x z step-∼ _ = flip transitive step-∽ = step-∼ step-∼→ = step-∼ step-∼← = step-∼ syntax step-∼ x Qyz Pxy = x ∼⟨ Pxy ⟩ Qyz syntax step-∽ x Qyz Pxy = Qyz ∽⟨ Pxy ⟩ x syntax step-∼→ x Qyz Pxy = x →⟨ Pxy ⟩ Qyz syntax step-∼← x Qyz Pxy = Qyz ←⟨ Pxy ⟩ x -- Another variant of transitivity. -- -- Note that the combinator can (depending on the available instances) -- be used to convert from one type to another, but only in its second -- argument (in order to make instance resolution easier). record Transitive′ {a b p q} {A : Type a} {B : Type b} (P : A → B → Type p) (Q : B → B → Type q) : Type (a ⊔ b ⊔ p ⊔ q) where constructor is-transitive field transitive′ : ∀ {x y z} → P x y → Q y z → P x z open Transitive′ ⦃ … ⦄ public step-∼′ step-∽′ step-∼→′ step-∼←′ : ∀ {a b p q} {A : Type a} {B : Type b} {P : A → B → Type p} {Q : B → B → Type q} ⦃ t : Transitive′ P Q ⦄ x {y z} → Q y z → P x y → P x z step-∼′ _ = flip transitive′ step-∽′ = step-∼′ step-∼→′ = step-∼′ step-∼←′ = step-∼′ syntax step-∼′ x Qyz Pxy = x ∼′⟨ Pxy ⟩ Qyz syntax step-∽′ x Qyz Pxy = Qyz ∽′⟨ Pxy ⟩ x syntax step-∼→′ x Qyz Pxy = x →′⟨ Pxy ⟩ Qyz syntax step-∼←′ x Qyz Pxy = Qyz ←′⟨ Pxy ⟩ x ------------------------------------------------------------------------ -- A finally combinator -- This combinator is intended to be used in the last step of an -- equational reasoning proof: -- -- x ∼⟨ ? ⟩■ -- y -- -- Note that the combinator can (depending on the available instances) -- be used to convert from one type to another. record Convertible {a b p q} {A : Type a} {B : Type b} (P : A → B → Type p) (Q : A → B → Type q) : Type (a ⊔ b ⊔ p ⊔ q) where constructor is-convertible field convert : ∀ {x y} → P x y → Q x y open Convertible ⦃ … ⦄ public finally₂ finally₂∽ finally₂→ finally₂← : ∀ {a b p q} {A : Type a} {B : Type b} {P : A → B → Type p} {Q : A → B → Type q} ⦃ c : Convertible P Q ⦄ x y → P x y → Q x y finally₂ _ _ = convert finally₂∽ = finally₂ finally₂→ = finally₂ finally₂← = finally₂ syntax finally₂ x y x∼y = x ∼⟨ x∼y ⟩■ y syntax finally₂∽ x y x∼y = y ∽⟨ x∼y ⟩■ x syntax finally₂→ x y x→y = x →⟨ x→y ⟩■ y syntax finally₂← x y x→y = y ←⟨ x→y ⟩■ x finally₁ finally₁∽ finally₁→ finally₁← : ∀ {a b p q} {A : Type a} {B : Type b} {P : A → B → Type p} {Q : A → B → Type q} ⦃ c : Convertible P Q ⦄ x {y} → P x y → Q x y finally₁ _ = convert finally₁∽ = finally₁ finally₁→ = finally₁ finally₁← = finally₁ syntax finally₁ x x∼y = x ∼⟨ x∼y ⟩■ syntax finally₁∽ x x∼y = ∽⟨ x∼y ⟩■ x syntax finally₁→ x x→y = x →⟨ x→y ⟩■ syntax finally₁← x x→y = ←⟨ x→y ⟩■ x
target/cos_117/disasm/iop_overlay1/TAPEC.asm
jrrk2/cray-sim
49
163870
0x0000 (0x000000) 0x211A- f:00020 d: 282 | A = OR[282] 0x0001 (0x000002) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x0002 (0x000004) 0x8002- f:00100 d: 2 | P = P + 2 (0x0004), C = 0 0x0003 (0x000006) 0x7006- f:00070 d: 6 | P = P + 6 (0x0009) 0x0004 (0x000008) 0x211E- f:00020 d: 286 | A = OR[286] 0x0005 (0x00000A) 0x8402- f:00102 d: 2 | P = P + 2 (0x0007), A = 0 0x0006 (0x00000C) 0x7003- f:00070 d: 3 | P = P + 3 (0x0009) 0x0007 (0x00000E) 0x7C34- f:00076 d: 52 | R = OR[52] 0x0008 (0x000010) 0x0000- f:00000 d: 0 | PASS 0x0009 (0x000012) 0x2104- f:00020 d: 260 | A = OR[260] 0x000A (0x000014) 0x290D- f:00024 d: 269 | OR[269] = A 0x000B (0x000016) 0x2104- f:00020 d: 260 | A = OR[260] 0x000C (0x000018) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x000D (0x00001A) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC) 0x000F (0x00001E) 0x2904- f:00024 d: 260 | OR[260] = A 0x0010 (0x000020) 0x2104- f:00020 d: 260 | A = OR[260] 0x0011 (0x000022) 0x291F- f:00024 d: 287 | OR[287] = A 0x0012 (0x000024) 0x103C- f:00010 d: 60 | A = 60 (0x003C) 0x0013 (0x000026) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028) 0x0014 (0x000028) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0015 (0x00002A) 0x2504- f:00022 d: 260 | A = A + OR[260] 0x0016 (0x00002C) 0x2904- f:00024 d: 260 | OR[260] = A 0x0017 (0x00002E) 0x2104- f:00020 d: 260 | A = OR[260] 0x0018 (0x000030) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x0019 (0x000032) 0xB234- f:00131 d: 52 | R = OR[52], C = 1 0x001A (0x000034) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x001B (0x000036) 0x210D- f:00020 d: 269 | A = OR[269] 0x001C (0x000038) 0x3904- f:00034 d: 260 | (OR[260]) = A 0x001D (0x00003A) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1 0x001E (0x00003C) 0x211F- f:00020 d: 287 | A = OR[287] 0x001F (0x00003E) 0x143C- f:00012 d: 60 | A = A + 60 (0x003C) 0x0020 (0x000040) 0x2920- f:00024 d: 288 | OR[288] = A 0x0021 (0x000042) 0x2120- f:00020 d: 288 | A = OR[288] 0x0022 (0x000044) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028) 0x0023 (0x000046) 0x2921- f:00024 d: 289 | OR[289] = A 0x0024 (0x000048) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0025 (0x00004A) 0x2922- f:00024 d: 290 | OR[290] = A 0x0026 (0x00004C) 0x211E- f:00020 d: 286 | A = OR[286] 0x0027 (0x00004E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0029), A = 0 0x0028 (0x000050) 0x7013- f:00070 d: 19 | P = P + 19 (0x003B) 0x0029 (0x000052) 0x1026- f:00010 d: 38 | A = 38 (0x0026) 0x002A (0x000054) 0x2943- f:00024 d: 323 | OR[323] = A 0x002B (0x000056) 0x2118- f:00020 d: 280 | A = OR[280] 0x002C (0x000058) 0x2944- f:00024 d: 324 | OR[324] = A 0x002D (0x00005A) 0x2119- f:00020 d: 281 | A = OR[281] 0x002E (0x00005C) 0x2945- f:00024 d: 325 | OR[325] = A 0x002F (0x00005E) 0x211F- f:00020 d: 287 | A = OR[287] 0x0030 (0x000060) 0x2946- f:00024 d: 326 | OR[326] = A 0x0031 (0x000062) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0032 (0x000064) 0x2947- f:00024 d: 327 | OR[327] = A 0x0033 (0x000066) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0034 (0x000068) 0x2948- f:00024 d: 328 | OR[328] = A 0x0035 (0x00006A) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x0036 (0x00006C) 0x5800- f:00054 d: 0 | B = A 0x0037 (0x00006E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0038 (0x000070) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0039 (0x000072) 0x2D19- f:00026 d: 281 | OR[281] = OR[281] + 1 0x003A (0x000074) 0x2F1A- f:00027 d: 282 | OR[282] = OR[282] - 1 0x003B (0x000076) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x003D (0x00007A) 0x2003- f:00020 d: 3 | A = OR[3] 0x003E (0x00007C) 0x1C00-0x0331 f:00016 d: 0 | A = A + 817 (0x0331) 0x0040 (0x000080) 0x2913- f:00024 d: 275 | OR[275] = A 0x0041 (0x000082) 0x1016- f:00010 d: 22 | A = 22 (0x0016) 0x0042 (0x000084) 0x2914- f:00024 d: 276 | OR[276] = A 0x0043 (0x000086) 0x101D- f:00010 d: 29 | A = 29 (0x001D) 0x0044 (0x000088) 0x2915- f:00024 d: 277 | OR[277] = A 0x0045 (0x00008A) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x0047 (0x00008E) 0x2003- f:00020 d: 3 | A = OR[3] 0x0048 (0x000090) 0x1C00-0x0363 f:00016 d: 0 | A = A + 867 (0x0363) 0x004A (0x000094) 0x2913- f:00024 d: 275 | OR[275] = A 0x004B (0x000096) 0x1005- f:00010 d: 5 | A = 5 (0x0005) 0x004C (0x000098) 0x2914- f:00024 d: 276 | OR[276] = A 0x004D (0x00009A) 0x1045- f:00010 d: 69 | A = 69 (0x0045) 0x004E (0x00009C) 0x2915- f:00024 d: 277 | OR[277] = A 0x004F (0x00009E) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x0051 (0x0000A2) 0x211D- f:00020 d: 285 | A = OR[285] 0x0052 (0x0000A4) 0x2913- f:00024 d: 275 | OR[275] = A 0x0053 (0x0000A6) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0054 (0x0000A8) 0x2914- f:00024 d: 276 | OR[276] = A 0x0055 (0x0000AA) 0x104B- f:00010 d: 75 | A = 75 (0x004B) 0x0056 (0x0000AC) 0x2915- f:00024 d: 277 | OR[277] = A 0x0057 (0x0000AE) 0x7E03-0x0243 f:00077 d: 3 | R = OR[3]+579 (0x0243) 0x0059 (0x0000B2) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x005B (0x0000B6) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x005D (0x0000BA) 0x2003- f:00020 d: 3 | A = OR[3] 0x005E (0x0000BC) 0x1C00-0x033D f:00016 d: 0 | A = A + 829 (0x033D) 0x0060 (0x0000C0) 0x2913- f:00024 d: 275 | OR[275] = A 0x0061 (0x0000C2) 0x104B- f:00010 d: 75 | A = 75 (0x004B) 0x0062 (0x0000C4) 0x2914- f:00024 d: 276 | OR[276] = A 0x0063 (0x0000C6) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0064 (0x0000C8) 0x2915- f:00024 d: 277 | OR[277] = A 0x0065 (0x0000CA) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x0067 (0x0000CE) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x0069 (0x0000D2) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x006B (0x0000D6) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x006C (0x0000D8) 0x2923- f:00024 d: 291 | OR[291] = A 0x006D (0x0000DA) 0x211E- f:00020 d: 286 | A = OR[286] 0x006E (0x0000DC) 0x8602- f:00103 d: 2 | P = P + 2 (0x0070), A # 0 0x006F (0x0000DE) 0x7013- f:00070 d: 19 | P = P + 19 (0x0082) 0x0070 (0x0000E0) 0x2003- f:00020 d: 3 | A = OR[3] 0x0071 (0x0000E2) 0x1C00-0x0366 f:00016 d: 0 | A = A + 870 (0x0366) 0x0073 (0x0000E6) 0x2913- f:00024 d: 275 | OR[275] = A 0x0074 (0x0000E8) 0x100D- f:00010 d: 13 | A = 13 (0x000D) 0x0075 (0x0000EA) 0x2914- f:00024 d: 276 | OR[276] = A 0x0076 (0x0000EC) 0x1021- f:00010 d: 33 | A = 33 (0x0021) 0x0077 (0x0000EE) 0x2915- f:00024 d: 277 | OR[277] = A 0x0078 (0x0000F0) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x007A (0x0000F4) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x007C (0x0000F8) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x007E (0x0000FC) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x007F (0x0000FE) 0x291A- f:00024 d: 282 | OR[282] = A 0x0080 (0x000100) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0081 (0x000102) 0x2923- f:00024 d: 291 | OR[291] = A 0x0082 (0x000104) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x0083 (0x000106) 0x2926- f:00024 d: 294 | OR[294] = A 0x0084 (0x000108) 0x2122- f:00020 d: 290 | A = OR[290] 0x0085 (0x00010A) 0x271C- f:00023 d: 284 | A = A - OR[284] 0x0086 (0x00010C) 0x85A3- f:00102 d: 419 | P = P + 419 (0x0229), A = 0 0x0087 (0x00010E) 0x211A- f:00020 d: 282 | A = OR[282] 0x0088 (0x000110) 0x8602- f:00103 d: 2 | P = P + 2 (0x008A), A # 0 0x0089 (0x000112) 0x7186- f:00070 d: 390 | P = P + 390 (0x020F) 0x008A (0x000114) 0x2F26- f:00027 d: 294 | OR[294] = OR[294] - 1 0x008B (0x000116) 0x1026- f:00010 d: 38 | A = 38 (0x0026) 0x008C (0x000118) 0x2943- f:00024 d: 323 | OR[323] = A 0x008D (0x00011A) 0x2118- f:00020 d: 280 | A = OR[280] 0x008E (0x00011C) 0x2944- f:00024 d: 324 | OR[324] = A 0x008F (0x00011E) 0x2119- f:00020 d: 281 | A = OR[281] 0x0090 (0x000120) 0x2945- f:00024 d: 325 | OR[325] = A 0x0091 (0x000122) 0x211F- f:00020 d: 287 | A = OR[287] 0x0092 (0x000124) 0x2946- f:00024 d: 326 | OR[326] = A 0x0093 (0x000126) 0x100F- f:00010 d: 15 | A = 15 (0x000F) 0x0094 (0x000128) 0x2947- f:00024 d: 327 | OR[327] = A 0x0095 (0x00012A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0096 (0x00012C) 0x2948- f:00024 d: 328 | OR[328] = A 0x0097 (0x00012E) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x0098 (0x000130) 0x5800- f:00054 d: 0 | B = A 0x0099 (0x000132) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x009A (0x000134) 0x7C09- f:00076 d: 9 | R = OR[9] 0x009B (0x000136) 0x100F- f:00010 d: 15 | A = 15 (0x000F) 0x009C (0x000138) 0x2B19- f:00025 d: 281 | OR[281] = A + OR[281] 0x009D (0x00013A) 0x211A- f:00020 d: 282 | A = OR[282] 0x009E (0x00013C) 0x160F- f:00013 d: 15 | A = A - 15 (0x000F) 0x009F (0x00013E) 0x291A- f:00024 d: 282 | OR[282] = A 0x00A0 (0x000140) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00A1 (0x000142) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x00A2 (0x000144) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x00A3 (0x000146) 0x2913- f:00024 d: 275 | OR[275] = A 0x00A4 (0x000148) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x00A5 (0x00014A) 0x2914- f:00024 d: 276 | OR[276] = A 0x00A6 (0x00014C) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x00A7 (0x00014E) 0x2915- f:00024 d: 277 | OR[277] = A 0x00A8 (0x000150) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x00AA (0x000154) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00AB (0x000156) 0x2924- f:00024 d: 292 | OR[292] = A 0x00AC (0x000158) 0x1009- f:00010 d: 9 | A = 9 (0x0009) 0x00AD (0x00015A) 0x2915- f:00024 d: 277 | OR[277] = A 0x00AE (0x00015C) 0x2115- f:00020 d: 277 | A = OR[277] 0x00AF (0x00015E) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x00B0 (0x000160) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x00B1 (0x000162) 0x290D- f:00024 d: 269 | OR[269] = A 0x00B2 (0x000164) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x00B3 (0x000166) 0x290D- f:00024 d: 269 | OR[269] = A 0x00B4 (0x000168) 0x2115- f:00020 d: 277 | A = OR[277] 0x00B5 (0x00016A) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x00B6 (0x00016C) 0x2908- f:00024 d: 264 | OR[264] = A 0x00B7 (0x00016E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00B8 (0x000170) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x00B9 (0x000172) 0x8604- f:00103 d: 4 | P = P + 4 (0x00BD), A # 0 0x00BA (0x000174) 0x210D- f:00020 d: 269 | A = OR[269] 0x00BB (0x000176) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x00BC (0x000178) 0x290D- f:00024 d: 269 | OR[269] = A 0x00BD (0x00017A) 0x210D- f:00020 d: 269 | A = OR[269] 0x00BE (0x00017C) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x00BF (0x00017E) 0x2914- f:00024 d: 276 | OR[276] = A 0x00C0 (0x000180) 0x2114- f:00020 d: 276 | A = OR[276] 0x00C1 (0x000182) 0x0A08- f:00005 d: 8 | A = A < 8 (0x0008) 0x00C2 (0x000184) 0x2914- f:00024 d: 276 | OR[276] = A 0x00C3 (0x000186) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x00C4 (0x000188) 0x2115- f:00020 d: 277 | A = OR[277] 0x00C5 (0x00018A) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x00C6 (0x00018C) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x00C7 (0x00018E) 0x290D- f:00024 d: 269 | OR[269] = A 0x00C8 (0x000190) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x00C9 (0x000192) 0x290D- f:00024 d: 269 | OR[269] = A 0x00CA (0x000194) 0x2115- f:00020 d: 277 | A = OR[277] 0x00CB (0x000196) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x00CC (0x000198) 0x2908- f:00024 d: 264 | OR[264] = A 0x00CD (0x00019A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00CE (0x00019C) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x00CF (0x00019E) 0x8604- f:00103 d: 4 | P = P + 4 (0x00D3), A # 0 0x00D0 (0x0001A0) 0x210D- f:00020 d: 269 | A = OR[269] 0x00D1 (0x0001A2) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x00D2 (0x0001A4) 0x290D- f:00024 d: 269 | OR[269] = A 0x00D3 (0x0001A6) 0x210D- f:00020 d: 269 | A = OR[269] 0x00D4 (0x0001A8) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x00D5 (0x0001AA) 0x2913- f:00024 d: 275 | OR[275] = A 0x00D6 (0x0001AC) 0x2113- f:00020 d: 275 | A = OR[275] 0x00D7 (0x0001AE) 0x2514- f:00022 d: 276 | A = A + OR[276] 0x00D8 (0x0001B0) 0x2913- f:00024 d: 275 | OR[275] = A 0x00D9 (0x0001B2) 0x2113- f:00020 d: 275 | A = OR[275] 0x00DA (0x0001B4) 0x8602- f:00103 d: 2 | P = P + 2 (0x00DC), A # 0 0x00DB (0x0001B6) 0x7009- f:00070 d: 9 | P = P + 9 (0x00E4) 0x00DC (0x0001B8) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x00DD (0x0001BA) 0x2924- f:00024 d: 292 | OR[292] = A 0x00DE (0x0001BC) 0x1005- f:00010 d: 5 | A = 5 (0x0005) 0x00DF (0x0001BE) 0x2914- f:00024 d: 276 | OR[276] = A 0x00E0 (0x0001C0) 0x100C- f:00010 d: 12 | A = 12 (0x000C) 0x00E1 (0x0001C2) 0x2915- f:00024 d: 277 | OR[277] = A 0x00E2 (0x0001C4) 0x7E03-0x0243 f:00077 d: 3 | R = OR[3]+579 (0x0243) 0x00E4 (0x0001C8) 0x1004- f:00010 d: 4 | A = 4 (0x0004) 0x00E5 (0x0001CA) 0x2928- f:00024 d: 296 | OR[296] = A 0x00E6 (0x0001CC) 0x1027- f:00010 d: 39 | A = 39 (0x0027) 0x00E7 (0x0001CE) 0x292A- f:00024 d: 298 | OR[298] = A 0x00E8 (0x0001D0) 0x112D- f:00010 d: 301 | A = 301 (0x012D) 0x00E9 (0x0001D2) 0x292C- f:00024 d: 300 | OR[300] = A 0x00EA (0x0001D4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00EB (0x0001D6) 0x293D- f:00024 d: 317 | OR[317] = A 0x00EC (0x0001D8) 0x2128- f:00020 d: 296 | A = OR[296] 0x00ED (0x0001DA) 0x8460- f:00102 d: 96 | P = P + 96 (0x014D), A = 0 0x00EE (0x0001DC) 0x212A- f:00020 d: 298 | A = OR[298] 0x00EF (0x0001DE) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x00F0 (0x0001E0) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x00F1 (0x0001E2) 0x290D- f:00024 d: 269 | OR[269] = A 0x00F2 (0x0001E4) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x00F3 (0x0001E6) 0x290D- f:00024 d: 269 | OR[269] = A 0x00F4 (0x0001E8) 0x212A- f:00020 d: 298 | A = OR[298] 0x00F5 (0x0001EA) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x00F6 (0x0001EC) 0x2908- f:00024 d: 264 | OR[264] = A 0x00F7 (0x0001EE) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00F8 (0x0001F0) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x00F9 (0x0001F2) 0x8604- f:00103 d: 4 | P = P + 4 (0x00FD), A # 0 0x00FA (0x0001F4) 0x210D- f:00020 d: 269 | A = OR[269] 0x00FB (0x0001F6) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x00FC (0x0001F8) 0x290D- f:00024 d: 269 | OR[269] = A 0x00FD (0x0001FA) 0x210D- f:00020 d: 269 | A = OR[269] 0x00FE (0x0001FC) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x00FF (0x0001FE) 0x2941- f:00024 d: 321 | OR[321] = A 0x0100 (0x000200) 0x212A- f:00020 d: 298 | A = OR[298] 0x0101 (0x000202) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x0102 (0x000204) 0x2929- f:00024 d: 297 | OR[297] = A 0x0103 (0x000206) 0x2129- f:00020 d: 297 | A = OR[297] 0x0104 (0x000208) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x0105 (0x00020A) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x0106 (0x00020C) 0x290D- f:00024 d: 269 | OR[269] = A 0x0107 (0x00020E) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x0108 (0x000210) 0x290D- f:00024 d: 269 | OR[269] = A 0x0109 (0x000212) 0x2129- f:00020 d: 297 | A = OR[297] 0x010A (0x000214) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x010B (0x000216) 0x2908- f:00024 d: 264 | OR[264] = A 0x010C (0x000218) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x010D (0x00021A) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x010E (0x00021C) 0x8604- f:00103 d: 4 | P = P + 4 (0x0112), A # 0 0x010F (0x00021E) 0x210D- f:00020 d: 269 | A = OR[269] 0x0110 (0x000220) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0111 (0x000222) 0x290D- f:00024 d: 269 | OR[269] = A 0x0112 (0x000224) 0x210D- f:00020 d: 269 | A = OR[269] 0x0113 (0x000226) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0114 (0x000228) 0x293F- f:00024 d: 319 | OR[319] = A 0x0115 (0x00022A) 0x213F- f:00020 d: 319 | A = OR[319] 0x0116 (0x00022C) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008) 0x0117 (0x00022E) 0x8004- f:00100 d: 4 | P = P + 4 (0x011B), C = 0 0x0118 (0x000230) 0x8403- f:00102 d: 3 | P = P + 3 (0x011B), A = 0 0x0119 (0x000232) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x011A (0x000234) 0x293F- f:00024 d: 319 | OR[319] = A 0x011B (0x000236) 0x213D- f:00020 d: 317 | A = OR[317] 0x011C (0x000238) 0x253F- f:00022 d: 319 | A = A + OR[319] 0x011D (0x00023A) 0x293D- f:00024 d: 317 | OR[317] = A 0x011E (0x00023C) 0x212A- f:00020 d: 298 | A = OR[298] 0x011F (0x00023E) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0120 (0x000240) 0x292B- f:00024 d: 299 | OR[299] = A 0x0121 (0x000242) 0x213F- f:00020 d: 319 | A = OR[319] 0x0122 (0x000244) 0x8427- f:00102 d: 39 | P = P + 39 (0x0149), A = 0 0x0123 (0x000246) 0x212B- f:00020 d: 299 | A = OR[299] 0x0124 (0x000248) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x0125 (0x00024A) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x0126 (0x00024C) 0x290D- f:00024 d: 269 | OR[269] = A 0x0127 (0x00024E) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x0128 (0x000250) 0x290D- f:00024 d: 269 | OR[269] = A 0x0129 (0x000252) 0x212B- f:00020 d: 299 | A = OR[299] 0x012A (0x000254) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x012B (0x000256) 0x2908- f:00024 d: 264 | OR[264] = A 0x012C (0x000258) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x012D (0x00025A) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x012E (0x00025C) 0x8604- f:00103 d: 4 | P = P + 4 (0x0132), A # 0 0x012F (0x00025E) 0x210D- f:00020 d: 269 | A = OR[269] 0x0130 (0x000260) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0131 (0x000262) 0x290D- f:00024 d: 269 | OR[269] = A 0x0132 (0x000264) 0x210D- f:00020 d: 269 | A = OR[269] 0x0133 (0x000266) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0134 (0x000268) 0x2940- f:00024 d: 320 | OR[320] = A 0x0135 (0x00026A) 0x2140- f:00020 d: 320 | A = OR[320] 0x0136 (0x00026C) 0x12A0- f:00011 d: 160 | A = A & 160 (0x00A0) 0x0137 (0x00026E) 0x2942- f:00024 d: 322 | OR[322] = A 0x0138 (0x000270) 0x2142- f:00020 d: 322 | A = OR[322] 0x0139 (0x000272) 0x8402- f:00102 d: 2 | P = P + 2 (0x013B), A = 0 0x013A (0x000274) 0x700D- f:00070 d: 13 | P = P + 13 (0x0147) 0x013B (0x000276) 0x212C- f:00020 d: 300 | A = OR[300] 0x013C (0x000278) 0x5800- f:00054 d: 0 | B = A 0x013D (0x00027A) 0x2141- f:00020 d: 321 | A = OR[321] 0x013E (0x00027C) 0x6800- f:00064 d: 0 | OR[B] = A 0x013F (0x00027E) 0x5C00- f:00056 d: 0 | B = B + 1 0x0140 (0x000280) 0x2140- f:00020 d: 320 | A = OR[320] 0x0141 (0x000282) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F) 0x0142 (0x000284) 0x6800- f:00064 d: 0 | OR[B] = A 0x0143 (0x000286) 0x5000- f:00050 d: 0 | A = B 0x0144 (0x000288) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0145 (0x00028A) 0x292C- f:00024 d: 300 | OR[300] = A 0x0146 (0x00028C) 0x2F3F- f:00027 d: 319 | OR[319] = OR[319] - 1 0x0147 (0x00028E) 0x2D2B- f:00026 d: 299 | OR[299] = OR[299] + 1 0x0148 (0x000290) 0x7227- f:00071 d: 39 | P = P - 39 (0x0121) 0x0149 (0x000292) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x014A (0x000294) 0x2B2A- f:00025 d: 298 | OR[298] = A + OR[298] 0x014B (0x000296) 0x2F28- f:00027 d: 296 | OR[296] = OR[296] - 1 0x014C (0x000298) 0x7260- f:00071 d: 96 | P = P - 96 (0x00EC) 0x014D (0x00029A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x014E (0x00029C) 0x293E- f:00024 d: 318 | OR[318] = A 0x014F (0x00029E) 0x213D- f:00020 d: 317 | A = OR[317] 0x0150 (0x0002A0) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x0151 (0x0002A2) 0x8003- f:00100 d: 3 | P = P + 3 (0x0154), C = 0 0x0152 (0x0002A4) 0x8402- f:00102 d: 2 | P = P + 2 (0x0154), A = 0 0x0153 (0x0002A6) 0x7002- f:00070 d: 2 | P = P + 2 (0x0155) 0x0154 (0x0002A8) 0x7006- f:00070 d: 6 | P = P + 6 (0x015A) 0x0155 (0x0002AA) 0x213D- f:00020 d: 317 | A = OR[317] 0x0156 (0x0002AC) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x0157 (0x0002AE) 0x293E- f:00024 d: 318 | OR[318] = A 0x0158 (0x0002B0) 0x1004- f:00010 d: 4 | A = 4 (0x0004) 0x0159 (0x0002B2) 0x293D- f:00024 d: 317 | OR[317] = A 0x015A (0x0002B4) 0x112D- f:00010 d: 301 | A = 301 (0x012D) 0x015B (0x0002B6) 0x292C- f:00024 d: 300 | OR[300] = A 0x015C (0x0002B8) 0x1015- f:00010 d: 21 | A = 21 (0x0015) 0x015D (0x0002BA) 0x2915- f:00024 d: 277 | OR[277] = A 0x015E (0x0002BC) 0x7E03-0x02FF f:00077 d: 3 | R = OR[3]+767 (0x02FF) 0x0160 (0x0002C0) 0x211F- f:00020 d: 287 | A = OR[287] 0x0161 (0x0002C2) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x0162 (0x0002C4) 0x2908- f:00024 d: 264 | OR[264] = A 0x0163 (0x0002C6) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0164 (0x0002C8) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0165 (0x0002CA) 0x2913- f:00024 d: 275 | OR[275] = A 0x0166 (0x0002CC) 0x2113- f:00020 d: 275 | A = OR[275] 0x0167 (0x0002CE) 0x8402- f:00102 d: 2 | P = P + 2 (0x0169), A = 0 0x0168 (0x0002D0) 0x701B- f:00070 d: 27 | P = P + 27 (0x0183) 0x0169 (0x0002D2) 0x2124- f:00020 d: 292 | A = OR[292] 0x016A (0x0002D4) 0x8402- f:00102 d: 2 | P = P + 2 (0x016C), A = 0 0x016B (0x0002D6) 0x7013- f:00070 d: 19 | P = P + 19 (0x017E) 0x016C (0x0002D8) 0x1031- f:00010 d: 49 | A = 49 (0x0031) 0x016D (0x0002DA) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x016E (0x0002DC) 0x2917- f:00024 d: 279 | OR[279] = A 0x016F (0x0002DE) 0x3117- f:00030 d: 279 | A = (OR[279]) 0x0170 (0x0002E0) 0x2913- f:00024 d: 275 | OR[275] = A 0x0171 (0x0002E2) 0x2113- f:00020 d: 275 | A = OR[275] 0x0172 (0x0002E4) 0x8402- f:00102 d: 2 | P = P + 2 (0x0174), A = 0 0x0173 (0x0002E6) 0x7006- f:00070 d: 6 | P = P + 6 (0x0179) 0x0174 (0x0002E8) 0x2003- f:00020 d: 3 | A = OR[3] 0x0175 (0x0002EA) 0x1C00-0x0373 f:00016 d: 0 | A = A + 883 (0x0373) 0x0177 (0x0002EE) 0x2913- f:00024 d: 275 | OR[275] = A 0x0178 (0x0002F0) 0x7005- f:00070 d: 5 | P = P + 5 (0x017D) 0x0179 (0x0002F2) 0x2003- f:00020 d: 3 | A = OR[3] 0x017A (0x0002F4) 0x1C00-0x037D f:00016 d: 0 | A = A + 893 (0x037D) 0x017C (0x0002F8) 0x2913- f:00024 d: 275 | OR[275] = A 0x017D (0x0002FA) 0x7005- f:00070 d: 5 | P = P + 5 (0x0182) 0x017E (0x0002FC) 0x2003- f:00020 d: 3 | A = OR[3] 0x017F (0x0002FE) 0x1C00-0x0378 f:00016 d: 0 | A = A + 888 (0x0378) 0x0181 (0x000302) 0x2913- f:00024 d: 275 | OR[275] = A 0x0182 (0x000304) 0x7026- f:00070 d: 38 | P = P + 38 (0x01A8) 0x0183 (0x000306) 0x1004- f:00010 d: 4 | A = 4 (0x0004) 0x0184 (0x000308) 0x0A04- f:00005 d: 4 | A = A < 4 (0x0004) 0x0185 (0x00030A) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000) 0x0186 (0x00030C) 0x2916- f:00024 d: 278 | OR[278] = A 0x0187 (0x00030E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0188 (0x000310) 0x2917- f:00024 d: 279 | OR[279] = A 0x0189 (0x000312) 0x1006- f:00010 d: 6 | A = 6 (0x0006) 0x018A (0x000314) 0x2914- f:00024 d: 276 | OR[276] = A 0x018B (0x000316) 0x2114- f:00020 d: 276 | A = OR[276] 0x018C (0x000318) 0x841C- f:00102 d: 28 | P = P + 28 (0x01A8), A = 0 0x018D (0x00031A) 0x100F- f:00010 d: 15 | A = 15 (0x000F) 0x018E (0x00031C) 0x2716- f:00023 d: 278 | A = A - OR[278] 0x018F (0x00031E) 0x120F- f:00011 d: 15 | A = A & 15 (0x000F) 0x0190 (0x000320) 0x5800- f:00054 d: 0 | B = A 0x0191 (0x000322) 0x2116- f:00020 d: 278 | A = OR[278] 0x0192 (0x000324) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004) 0x0193 (0x000326) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x0194 (0x000328) 0x290D- f:00024 d: 269 | OR[269] = A 0x0195 (0x00032A) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x0196 (0x00032C) 0x4800- f:00044 d: 0 | A = A > B 0x0197 (0x00032E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x0198 (0x000330) 0x2915- f:00024 d: 277 | OR[277] = A 0x0199 (0x000332) 0x2115- f:00020 d: 277 | A = OR[277] 0x019A (0x000334) 0x8602- f:00103 d: 2 | P = P + 2 (0x019C), A # 0 0x019B (0x000336) 0x7006- f:00070 d: 6 | P = P + 6 (0x01A1) 0x019C (0x000338) 0x2003- f:00020 d: 3 | A = OR[3] 0x019D (0x00033A) 0x1C00-0x0382 f:00016 d: 0 | A = A + 898 (0x0382) 0x019F (0x00033E) 0x2517- f:00022 d: 279 | A = A + OR[279] 0x01A0 (0x000340) 0x2913- f:00024 d: 275 | OR[275] = A 0x01A1 (0x000342) 0x2D16- f:00026 d: 278 | OR[278] = OR[278] + 1 0x01A2 (0x000344) 0x2117- f:00020 d: 279 | A = OR[279] 0x01A3 (0x000346) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x01A4 (0x000348) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01A5 (0x00034A) 0x2917- f:00024 d: 279 | OR[279] = A 0x01A6 (0x00034C) 0x2F14- f:00027 d: 276 | OR[276] = OR[276] - 1 0x01A7 (0x00034E) 0x721C- f:00071 d: 28 | P = P - 28 (0x018B) 0x01A8 (0x000350) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x01A9 (0x000352) 0x2914- f:00024 d: 276 | OR[276] = A 0x01AA (0x000354) 0x102B- f:00010 d: 43 | A = 43 (0x002B) 0x01AB (0x000356) 0x2915- f:00024 d: 277 | OR[277] = A 0x01AC (0x000358) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x01AE (0x00035C) 0x1031- f:00010 d: 49 | A = 49 (0x0031) 0x01AF (0x00035E) 0x251F- f:00022 d: 287 | A = A + OR[287] 0x01B0 (0x000360) 0x2913- f:00024 d: 275 | OR[275] = A 0x01B1 (0x000362) 0x1006- f:00010 d: 6 | A = 6 (0x0006) 0x01B2 (0x000364) 0x2914- f:00024 d: 276 | OR[276] = A 0x01B3 (0x000366) 0x1036- f:00010 d: 54 | A = 54 (0x0036) 0x01B4 (0x000368) 0x2915- f:00024 d: 277 | OR[277] = A 0x01B5 (0x00036A) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x01B7 (0x00036E) 0x211F- f:00020 d: 287 | A = OR[287] 0x01B8 (0x000370) 0x1436- f:00012 d: 54 | A = A + 54 (0x0036) 0x01B9 (0x000372) 0x2908- f:00024 d: 264 | OR[264] = A 0x01BA (0x000374) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01BB (0x000376) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x01BC (0x000378) 0x2913- f:00024 d: 275 | OR[275] = A 0x01BD (0x00037A) 0x2113- f:00020 d: 275 | A = OR[275] 0x01BE (0x00037C) 0x8602- f:00103 d: 2 | P = P + 2 (0x01C0), A # 0 0x01BF (0x00037E) 0x701E- f:00070 d: 30 | P = P + 30 (0x01DD) 0x01C0 (0x000380) 0x102B- f:00010 d: 43 | A = 43 (0x002B) 0x01C1 (0x000382) 0x2927- f:00024 d: 295 | OR[295] = A 0x01C2 (0x000384) 0x103F- f:00010 d: 63 | A = 63 (0x003F) 0x01C3 (0x000386) 0x2915- f:00024 d: 277 | OR[277] = A 0x01C4 (0x000388) 0x2127- f:00020 d: 295 | A = OR[295] 0x01C5 (0x00038A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x01C6 (0x00038C) 0x290D- f:00024 d: 269 | OR[269] = A 0x01C7 (0x00038E) 0x2115- f:00020 d: 277 | A = OR[277] 0x01C8 (0x000390) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x01C9 (0x000392) 0x2520- f:00022 d: 288 | A = A + OR[288] 0x01CA (0x000394) 0x290E- f:00024 d: 270 | OR[270] = A 0x01CB (0x000396) 0x2115- f:00020 d: 277 | A = OR[277] 0x01CC (0x000398) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x01CD (0x00039A) 0x2908- f:00024 d: 264 | OR[264] = A 0x01CE (0x00039C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01CF (0x00039E) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x01D0 (0x0003A0) 0x8607- f:00103 d: 7 | P = P + 7 (0x01D7), A # 0 0x01D1 (0x0003A2) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x01D2 (0x0003A4) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x01D3 (0x0003A6) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x01D4 (0x0003A8) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x01D5 (0x0003AA) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x01D6 (0x0003AC) 0x7006- f:00070 d: 6 | P = P + 6 (0x01DC) 0x01D7 (0x0003AE) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x01D8 (0x0003B0) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x01DA (0x0003B4) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x01DB (0x0003B6) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x01DC (0x0003B8) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x01DD (0x0003BA) 0x211F- f:00020 d: 287 | A = OR[287] 0x01DE (0x0003BC) 0x1437- f:00012 d: 55 | A = A + 55 (0x0037) 0x01DF (0x0003BE) 0x2908- f:00024 d: 264 | OR[264] = A 0x01E0 (0x0003C0) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01E1 (0x0003C2) 0x2913- f:00024 d: 275 | OR[275] = A 0x01E2 (0x0003C4) 0x2113- f:00020 d: 275 | A = OR[275] 0x01E3 (0x0003C6) 0x8602- f:00103 d: 2 | P = P + 2 (0x01E5), A # 0 0x01E4 (0x0003C8) 0x7008- f:00070 d: 8 | P = P + 8 (0x01EC) 0x01E5 (0x0003CA) 0x1005- f:00010 d: 5 | A = 5 (0x0005) 0x01E6 (0x0003CC) 0x2914- f:00024 d: 276 | OR[276] = A 0x01E7 (0x0003CE) 0x103F- f:00010 d: 63 | A = 63 (0x003F) 0x01E8 (0x0003D0) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01E9 (0x0003D2) 0x2915- f:00024 d: 277 | OR[277] = A 0x01EA (0x0003D4) 0x7E03-0x0243 f:00077 d: 3 | R = OR[3]+579 (0x0243) 0x01EC (0x0003D8) 0x211F- f:00020 d: 287 | A = OR[287] 0x01ED (0x0003DA) 0x1434- f:00012 d: 52 | A = A + 52 (0x0034) 0x01EE (0x0003DC) 0x2908- f:00024 d: 264 | OR[264] = A 0x01EF (0x0003DE) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01F0 (0x0003E0) 0x2913- f:00024 d: 275 | OR[275] = A 0x01F1 (0x0003E2) 0x2113- f:00020 d: 275 | A = OR[275] 0x01F2 (0x0003E4) 0x8604- f:00103 d: 4 | P = P + 4 (0x01F6), A # 0 0x01F3 (0x0003E6) 0x1800-0x2020 f:00014 d: 0 | A = 8224 (0x2020) 0x01F5 (0x0003EA) 0x2913- f:00024 d: 275 | OR[275] = A 0x01F6 (0x0003EC) 0x2120- f:00020 d: 288 | A = OR[288] 0x01F7 (0x0003EE) 0x1425- f:00012 d: 37 | A = A + 37 (0x0025) 0x01F8 (0x0003F0) 0x2908- f:00024 d: 264 | OR[264] = A 0x01F9 (0x0003F2) 0x2113- f:00020 d: 275 | A = OR[275] 0x01FA (0x0003F4) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01FB (0x0003F6) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x01FD (0x0003FA) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x01FF (0x0003FE) 0x213E- f:00020 d: 318 | A = OR[318] 0x0200 (0x000400) 0x8602- f:00103 d: 2 | P = P + 2 (0x0202), A # 0 0x0201 (0x000402) 0x700D- f:00070 d: 13 | P = P + 13 (0x020E) 0x0202 (0x000404) 0x1015- f:00010 d: 21 | A = 21 (0x0015) 0x0203 (0x000406) 0x2915- f:00024 d: 277 | OR[277] = A 0x0204 (0x000408) 0x213E- f:00020 d: 318 | A = OR[318] 0x0205 (0x00040A) 0x293D- f:00024 d: 317 | OR[317] = A 0x0206 (0x00040C) 0x1135- f:00010 d: 309 | A = 309 (0x0135) 0x0207 (0x00040E) 0x292C- f:00024 d: 300 | OR[300] = A 0x0208 (0x000410) 0x7E03-0x02FF f:00077 d: 3 | R = OR[3]+767 (0x02FF) 0x020A (0x000414) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x020C (0x000418) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x020E (0x00041C) 0x701A- f:00070 d: 26 | P = P + 26 (0x0228) 0x020F (0x00041E) 0x2123- f:00020 d: 291 | A = OR[291] 0x0210 (0x000420) 0x8602- f:00103 d: 2 | P = P + 2 (0x0212), A # 0 0x0211 (0x000422) 0x7015- f:00070 d: 21 | P = P + 21 (0x0226) 0x0212 (0x000424) 0x2126- f:00020 d: 294 | A = OR[294] 0x0213 (0x000426) 0x8602- f:00103 d: 2 | P = P + 2 (0x0215), A # 0 0x0214 (0x000428) 0x7012- f:00070 d: 18 | P = P + 18 (0x0226) 0x0215 (0x00042A) 0x2003- f:00020 d: 3 | A = OR[3] 0x0216 (0x00042C) 0x1C00-0x036D f:00016 d: 0 | A = A + 877 (0x036D) 0x0218 (0x000430) 0x2913- f:00024 d: 275 | OR[275] = A 0x0219 (0x000432) 0x100B- f:00010 d: 11 | A = 11 (0x000B) 0x021A (0x000434) 0x2914- f:00024 d: 276 | OR[276] = A 0x021B (0x000436) 0x1022- f:00010 d: 34 | A = 34 (0x0022) 0x021C (0x000438) 0x2915- f:00024 d: 277 | OR[277] = A 0x021D (0x00043A) 0x7E03-0x029A f:00077 d: 3 | R = OR[3]+666 (0x029A) 0x021F (0x00043E) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x0221 (0x000442) 0x7E03-0x02F2 f:00077 d: 3 | R = OR[3]+754 (0x02F2) 0x0223 (0x000446) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0224 (0x000448) 0x2923- f:00024 d: 291 | OR[291] = A 0x0225 (0x00044A) 0x7003- f:00070 d: 3 | P = P + 3 (0x0228) 0x0226 (0x00044C) 0x7E03-0x02D8 f:00077 d: 3 | R = OR[3]+728 (0x02D8) 0x0228 (0x000450) 0x73A4- f:00071 d: 420 | P = P - 420 (0x0084) 0x0229 (0x000452) 0x2F04- f:00027 d: 260 | OR[260] = OR[260] - 1 0x022A (0x000454) 0x3104- f:00030 d: 260 | A = (OR[260]) 0x022B (0x000456) 0x2904- f:00024 d: 260 | OR[260] = A 0x022C (0x000458) 0x2104- f:00020 d: 260 | A = OR[260] 0x022D (0x00045A) 0x2706- f:00023 d: 262 | A = A - OR[262] 0x022E (0x00045C) 0x8007- f:00100 d: 7 | P = P + 7 (0x0235), C = 0 0x022F (0x00045E) 0x2104- f:00020 d: 260 | A = OR[260] 0x0230 (0x000460) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x0231 (0x000462) 0x8003- f:00100 d: 3 | P = P + 3 (0x0234), C = 0 0x0232 (0x000464) 0x8402- f:00102 d: 2 | P = P + 2 (0x0234), A = 0 0x0233 (0x000466) 0x7002- f:00070 d: 2 | P = P + 2 (0x0235) 0x0234 (0x000468) 0x7003- f:00070 d: 3 | P = P + 3 (0x0237) 0x0235 (0x00046A) 0x7C34- f:00076 d: 52 | R = OR[52] 0x0236 (0x00046C) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x0237 (0x00046E) 0x102A- f:00010 d: 42 | A = 42 (0x002A) 0x0238 (0x000470) 0x2943- f:00024 d: 323 | OR[323] = A 0x0239 (0x000472) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x023A (0x000474) 0x5800- f:00054 d: 0 | B = A 0x023B (0x000476) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x023C (0x000478) 0x7C09- f:00076 d: 9 | R = OR[9] 0x023D (0x00047A) 0x2113- f:00020 d: 275 | A = OR[275] 0x023E (0x00047C) 0x3921- f:00034 d: 289 | (OR[289]) = A 0x023F (0x00047E) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x0240 (0x000480) 0x2943- f:00024 d: 323 | OR[323] = A 0x0241 (0x000482) 0x1800-0x000F f:00014 d: 0 | A = 15 (0x000F) 0x0243 (0x000486) 0x2944- f:00024 d: 324 | OR[324] = A 0x0244 (0x000488) 0x2121- f:00020 d: 289 | A = OR[289] 0x0245 (0x00048A) 0x2945- f:00024 d: 325 | OR[325] = A 0x0246 (0x00048C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0247 (0x00048E) 0x2946- f:00024 d: 326 | OR[326] = A 0x0248 (0x000490) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x0249 (0x000492) 0x2947- f:00024 d: 327 | OR[327] = A 0x024A (0x000494) 0x2120- f:00020 d: 288 | A = OR[288] 0x024B (0x000496) 0x2948- f:00024 d: 328 | OR[328] = A 0x024C (0x000498) 0x2115- f:00020 d: 277 | A = OR[277] 0x024D (0x00049A) 0x2949- f:00024 d: 329 | OR[329] = A 0x024E (0x00049C) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x024F (0x00049E) 0x294A- f:00024 d: 330 | OR[330] = A 0x0250 (0x0004A0) 0x2114- f:00020 d: 276 | A = OR[276] 0x0251 (0x0004A2) 0x294B- f:00024 d: 331 | OR[331] = A 0x0252 (0x0004A4) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x0253 (0x0004A6) 0x5800- f:00054 d: 0 | B = A 0x0254 (0x0004A8) 0x1800-0x5718 f:00014 d: 0 | A = 22296 (0x5718) 0x0256 (0x0004AC) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0257 (0x0004AE) 0x0200- f:00001 d: 0 | EXIT 0x0258 (0x0004B0) 0x2113- f:00020 d: 275 | A = OR[275] 0x0259 (0x0004B2) 0x3921- f:00034 d: 289 | (OR[289]) = A 0x025A (0x0004B4) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x025B (0x0004B6) 0x2943- f:00024 d: 323 | OR[323] = A 0x025C (0x0004B8) 0x1800-0x0010 f:00014 d: 0 | A = 16 (0x0010) 0x025E (0x0004BC) 0x2944- f:00024 d: 324 | OR[324] = A 0x025F (0x0004BE) 0x2121- f:00020 d: 289 | A = OR[289] 0x0260 (0x0004C0) 0x2945- f:00024 d: 325 | OR[325] = A 0x0261 (0x0004C2) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0262 (0x0004C4) 0x2946- f:00024 d: 326 | OR[326] = A 0x0263 (0x0004C6) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x0264 (0x0004C8) 0x2947- f:00024 d: 327 | OR[327] = A 0x0265 (0x0004CA) 0x2120- f:00020 d: 288 | A = OR[288] 0x0266 (0x0004CC) 0x2948- f:00024 d: 328 | OR[328] = A 0x0267 (0x0004CE) 0x2115- f:00020 d: 277 | A = OR[277] 0x0268 (0x0004D0) 0x2949- f:00024 d: 329 | OR[329] = A 0x0269 (0x0004D2) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x026A (0x0004D4) 0x294A- f:00024 d: 330 | OR[330] = A 0x026B (0x0004D6) 0x2114- f:00020 d: 276 | A = OR[276] 0x026C (0x0004D8) 0x294B- f:00024 d: 331 | OR[331] = A 0x026D (0x0004DA) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x026E (0x0004DC) 0x5800- f:00054 d: 0 | B = A 0x026F (0x0004DE) 0x1800-0x5718 f:00014 d: 0 | A = 22296 (0x5718) 0x0271 (0x0004E2) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0272 (0x0004E4) 0x2915- f:00024 d: 277 | OR[277] = A 0x0273 (0x0004E6) 0x0200- f:00001 d: 0 | EXIT 0x0274 (0x0004E8) 0x2113- f:00020 d: 275 | A = OR[275] 0x0275 (0x0004EA) 0x3921- f:00034 d: 289 | (OR[289]) = A 0x0276 (0x0004EC) 0x2115- f:00020 d: 277 | A = OR[277] 0x0277 (0x0004EE) 0x2925- f:00024 d: 293 | OR[293] = A 0x0278 (0x0004F0) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x0279 (0x0004F2) 0x2943- f:00024 d: 323 | OR[323] = A 0x027A (0x0004F4) 0x1800-0x0011 f:00014 d: 0 | A = 17 (0x0011) 0x027C (0x0004F8) 0x2944- f:00024 d: 324 | OR[324] = A 0x027D (0x0004FA) 0x2121- f:00020 d: 289 | A = OR[289] 0x027E (0x0004FC) 0x2945- f:00024 d: 325 | OR[325] = A 0x027F (0x0004FE) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0280 (0x000500) 0x2946- f:00024 d: 326 | OR[326] = A 0x0281 (0x000502) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x0282 (0x000504) 0x2947- f:00024 d: 327 | OR[327] = A 0x0283 (0x000506) 0x2120- f:00020 d: 288 | A = OR[288] 0x0284 (0x000508) 0x2948- f:00024 d: 328 | OR[328] = A 0x0285 (0x00050A) 0x2115- f:00020 d: 277 | A = OR[277] 0x0286 (0x00050C) 0x2949- f:00024 d: 329 | OR[329] = A 0x0287 (0x00050E) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0288 (0x000510) 0x294A- f:00024 d: 330 | OR[330] = A 0x0289 (0x000512) 0x2114- f:00020 d: 276 | A = OR[276] 0x028A (0x000514) 0x294B- f:00024 d: 331 | OR[331] = A 0x028B (0x000516) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x028C (0x000518) 0x5800- f:00054 d: 0 | B = A 0x028D (0x00051A) 0x1800-0x5718 f:00014 d: 0 | A = 22296 (0x5718) 0x028F (0x00051E) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0290 (0x000520) 0x2125- f:00020 d: 293 | A = OR[293] 0x0291 (0x000522) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0292 (0x000524) 0x2915- f:00024 d: 277 | OR[277] = A 0x0293 (0x000526) 0x0200- f:00001 d: 0 | EXIT 0x0294 (0x000528) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0295 (0x00052A) 0x2916- f:00024 d: 278 | OR[278] = A 0x0296 (0x00052C) 0x2116- f:00020 d: 278 | A = OR[278] 0x0297 (0x00052E) 0x2714- f:00023 d: 276 | A = A - OR[276] 0x0298 (0x000530) 0x8439- f:00102 d: 57 | P = P + 57 (0x02D1), A = 0 0x0299 (0x000532) 0x2116- f:00020 d: 278 | A = OR[278] 0x029A (0x000534) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x029B (0x000536) 0x2513- f:00022 d: 275 | A = A + OR[275] 0x029C (0x000538) 0x290D- f:00024 d: 269 | OR[269] = A 0x029D (0x00053A) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x029E (0x00053C) 0x290D- f:00024 d: 269 | OR[269] = A 0x029F (0x00053E) 0x2116- f:00020 d: 278 | A = OR[278] 0x02A0 (0x000540) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x02A1 (0x000542) 0x2908- f:00024 d: 264 | OR[264] = A 0x02A2 (0x000544) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02A3 (0x000546) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x02A4 (0x000548) 0x8604- f:00103 d: 4 | P = P + 4 (0x02A8), A # 0 0x02A5 (0x00054A) 0x210D- f:00020 d: 269 | A = OR[269] 0x02A6 (0x00054C) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x02A7 (0x00054E) 0x290D- f:00024 d: 269 | OR[269] = A 0x02A8 (0x000550) 0x210D- f:00020 d: 269 | A = OR[269] 0x02A9 (0x000552) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x02AA (0x000554) 0x2917- f:00024 d: 279 | OR[279] = A 0x02AB (0x000556) 0x2D16- f:00026 d: 278 | OR[278] = OR[278] + 1 0x02AC (0x000558) 0x8602- f:00103 d: 2 | P = P + 2 (0x02AE), A # 0 0x02AD (0x00055A) 0x0200- f:00001 d: 0 | EXIT 0x02AE (0x00055C) 0x2117- f:00020 d: 279 | A = OR[279] 0x02AF (0x00055E) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020) 0x02B0 (0x000560) 0x8005- f:00100 d: 5 | P = P + 5 (0x02B5), C = 0 0x02B1 (0x000562) 0x107F- f:00010 d: 127 | A = 127 (0x007F) 0x02B2 (0x000564) 0x2717- f:00023 d: 279 | A = A - OR[279] 0x02B3 (0x000566) 0x8002- f:00100 d: 2 | P = P + 2 (0x02B5), C = 0 0x02B4 (0x000568) 0x7003- f:00070 d: 3 | P = P + 3 (0x02B7) 0x02B5 (0x00056A) 0x1020- f:00010 d: 32 | A = 32 (0x0020) 0x02B6 (0x00056C) 0x2917- f:00024 d: 279 | OR[279] = A 0x02B7 (0x00056E) 0x2117- f:00020 d: 279 | A = OR[279] 0x02B8 (0x000570) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x02B9 (0x000572) 0x290D- f:00024 d: 269 | OR[269] = A 0x02BA (0x000574) 0x2115- f:00020 d: 277 | A = OR[277] 0x02BB (0x000576) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x02BC (0x000578) 0x2520- f:00022 d: 288 | A = A + OR[288] 0x02BD (0x00057A) 0x290E- f:00024 d: 270 | OR[270] = A 0x02BE (0x00057C) 0x2115- f:00020 d: 277 | A = OR[277] 0x02BF (0x00057E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x02C0 (0x000580) 0x2908- f:00024 d: 264 | OR[264] = A 0x02C1 (0x000582) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02C2 (0x000584) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x02C3 (0x000586) 0x8607- f:00103 d: 7 | P = P + 7 (0x02CA), A # 0 0x02C4 (0x000588) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x02C5 (0x00058A) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x02C6 (0x00058C) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x02C7 (0x00058E) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x02C8 (0x000590) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x02C9 (0x000592) 0x7006- f:00070 d: 6 | P = P + 6 (0x02CF) 0x02CA (0x000594) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x02CB (0x000596) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x02CD (0x00059A) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x02CE (0x00059C) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x02CF (0x00059E) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x02D0 (0x0005A0) 0x723A- f:00071 d: 58 | P = P - 58 (0x0296) 0x02D1 (0x0005A2) 0x0200- f:00001 d: 0 | EXIT 0x02D2 (0x0005A4) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x02D3 (0x0005A6) 0x2943- f:00024 d: 323 | OR[323] = A 0x02D4 (0x0005A8) 0x1800-0x0123 f:00014 d: 0 | A = 291 (0x0123) 0x02D6 (0x0005AC) 0x2944- f:00024 d: 324 | OR[324] = A 0x02D7 (0x0005AE) 0x1800-0x0005 f:00014 d: 0 | A = 5 (0x0005) 0x02D9 (0x0005B2) 0x2945- f:00024 d: 325 | OR[325] = A 0x02DA (0x0005B4) 0x211B- f:00020 d: 283 | A = OR[283] 0x02DB (0x0005B6) 0x2522- f:00022 d: 290 | A = A + OR[290] 0x02DC (0x0005B8) 0x2946- f:00024 d: 326 | OR[326] = A 0x02DD (0x0005BA) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02DE (0x0005BC) 0x2947- f:00024 d: 327 | OR[327] = A 0x02DF (0x0005BE) 0x2120- f:00020 d: 288 | A = OR[288] 0x02E0 (0x0005C0) 0x2948- f:00024 d: 328 | OR[328] = A 0x02E1 (0x0005C2) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02E2 (0x0005C4) 0x2949- f:00024 d: 329 | OR[329] = A 0x02E3 (0x0005C6) 0x1050- f:00010 d: 80 | A = 80 (0x0050) 0x02E4 (0x0005C8) 0x294A- f:00024 d: 330 | OR[330] = A 0x02E5 (0x0005CA) 0x1143- f:00010 d: 323 | A = 323 (0x0143) 0x02E6 (0x0005CC) 0x5800- f:00054 d: 0 | B = A 0x02E7 (0x0005CE) 0x1800-0x5718 f:00014 d: 0 | A = 22296 (0x5718) 0x02E9 (0x0005D2) 0x7C09- f:00076 d: 9 | R = OR[9] 0x02EA (0x0005D4) 0x2D22- f:00026 d: 290 | OR[290] = OR[290] + 1 0x02EB (0x0005D6) 0x0200- f:00001 d: 0 | EXIT 0x02EC (0x0005D8) 0x2120- f:00020 d: 288 | A = OR[288] 0x02ED (0x0005DA) 0x2913- f:00024 d: 275 | OR[275] = A 0x02EE (0x0005DC) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x02EF (0x0005DE) 0x2914- f:00024 d: 276 | OR[276] = A 0x02F0 (0x0005E0) 0x2114- f:00020 d: 276 | A = OR[276] 0x02F1 (0x0005E2) 0x8407- f:00102 d: 7 | P = P + 7 (0x02F8), A = 0 0x02F2 (0x0005E4) 0x1800-0x2020 f:00014 d: 0 | A = 8224 (0x2020) 0x02F4 (0x0005E8) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x02F5 (0x0005EA) 0x2D13- f:00026 d: 275 | OR[275] = OR[275] + 1 0x02F6 (0x0005EC) 0x2F14- f:00027 d: 276 | OR[276] = OR[276] - 1 0x02F7 (0x0005EE) 0x7207- f:00071 d: 7 | P = P - 7 (0x02F0) 0x02F8 (0x0005F0) 0x0200- f:00001 d: 0 | EXIT 0x02F9 (0x0005F2) 0x213D- f:00020 d: 317 | A = OR[317] 0x02FA (0x0005F4) 0x8430- f:00102 d: 48 | P = P + 48 (0x032A), A = 0 0x02FB (0x0005F6) 0x212C- f:00020 d: 300 | A = OR[300] 0x02FC (0x0005F8) 0x5800- f:00054 d: 0 | B = A 0x02FD (0x0005FA) 0x6000- f:00060 d: 0 | A = OR[B] 0x02FE (0x0005FC) 0x2913- f:00024 d: 275 | OR[275] = A 0x02FF (0x0005FE) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0300 (0x000600) 0x2914- f:00024 d: 276 | OR[276] = A 0x0301 (0x000602) 0x768D- f:00073 d: 141 | R = P - 141 (0x0274) 0x0302 (0x000604) 0x102D- f:00010 d: 45 | A = 45 (0x002D) 0x0303 (0x000606) 0x2927- f:00024 d: 295 | OR[295] = A 0x0304 (0x000608) 0x2127- f:00020 d: 295 | A = OR[295] 0x0305 (0x00060A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0306 (0x00060C) 0x290D- f:00024 d: 269 | OR[269] = A 0x0307 (0x00060E) 0x2115- f:00020 d: 277 | A = OR[277] 0x0308 (0x000610) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x0309 (0x000612) 0x2520- f:00022 d: 288 | A = A + OR[288] 0x030A (0x000614) 0x290E- f:00024 d: 270 | OR[270] = A 0x030B (0x000616) 0x2115- f:00020 d: 277 | A = OR[277] 0x030C (0x000618) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x030D (0x00061A) 0x2908- f:00024 d: 264 | OR[264] = A 0x030E (0x00061C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x030F (0x00061E) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x0310 (0x000620) 0x8607- f:00103 d: 7 | P = P + 7 (0x0317), A # 0 0x0311 (0x000622) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x0312 (0x000624) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x0313 (0x000626) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0314 (0x000628) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x0315 (0x00062A) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x0316 (0x00062C) 0x7006- f:00070 d: 6 | P = P + 6 (0x031C) 0x0317 (0x00062E) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x0318 (0x000630) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x031A (0x000634) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x031B (0x000636) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x031C (0x000638) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x031D (0x00063A) 0x212C- f:00020 d: 300 | A = OR[300] 0x031E (0x00063C) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x031F (0x00063E) 0x5800- f:00054 d: 0 | B = A 0x0320 (0x000640) 0x6000- f:00060 d: 0 | A = OR[B] 0x0321 (0x000642) 0x2913- f:00024 d: 275 | OR[275] = A 0x0322 (0x000644) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0323 (0x000646) 0x2914- f:00024 d: 276 | OR[276] = A 0x0324 (0x000648) 0x76CC- f:00073 d: 204 | R = P - 204 (0x0258) 0x0325 (0x00064A) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0326 (0x00064C) 0x2B2C- f:00025 d: 300 | OR[300] = A + OR[300] 0x0327 (0x00064E) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x0328 (0x000650) 0x2F3D- f:00027 d: 317 | OR[317] = OR[317] - 1 0x0329 (0x000652) 0x7230- f:00071 d: 48 | P = P - 48 (0x02F9) 0x032A (0x000654) 0x0200- f:00001 d: 0 | EXIT 0x032B (0x000656) 0x2A20- f:00025 d: 32 | OR[32] = A + OR[32] 0x032C (0x000658) 0x5441- f:00052 d: 65 | A = A + B | **** non-standard encoding with D:0x0041 **** 0x032D (0x00065A) 0x5045- f:00050 d: 69 | A = B | **** non-standard encoding with D:0x0045 **** 0x032E (0x00065C) 0x2043- f:00020 d: 67 | A = OR[67] 0x032F (0x00065E) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E **** 0x0330 (0x000660) 0x4649- f:00043 d: 73 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0049 **** 0x0331 (0x000662) 0x4755- f:00043 d: 341 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0155 **** 0x0332 (0x000664) 0x5241- f:00051 d: 65 | A = A & B | **** non-standard encoding with D:0x0041 **** 0x0333 (0x000666) 0x5449- f:00052 d: 73 | A = A + B | **** non-standard encoding with D:0x0049 **** 0x0334 (0x000668) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E **** 0x0335 (0x00066A) 0x202A- f:00020 d: 42 | A = OR[42] 0x0336 (0x00066C) 0x0000- f:00000 d: 0 | PASS 0x0337 (0x00066E) 0x4445- f:00042 d: 69 | C = 1, IOB = DN | **** non-standard encoding with D:0x0045 **** 0x0338 (0x000670) 0x5649- f:00053 d: 73 | A = A - B | **** non-standard encoding with D:0x0049 **** 0x0339 (0x000672) 0x4345- f:00041 d: 325 | C = 1, io 0505 = BZ 0x033A (0x000674) 0x2020- f:00020 d: 32 | A = OR[32] 0x033B (0x000676) 0x2020- f:00020 d: 32 | A = OR[32] 0x033C (0x000678) 0x2020- f:00020 d: 32 | A = OR[32] 0x033D (0x00067A) 0x4A53- f:00045 d: 83 | A = A < B | **** non-standard encoding with D:0x0053 **** 0x033E (0x00067C) 0x5120- f:00050 d: 288 | A = B | **** non-standard encoding with D:0x0120 **** 0x033F (0x00067E) 0x2020- f:00020 d: 32 | A = OR[32] 0x0340 (0x000680) 0x2049- f:00020 d: 73 | A = OR[73] 0x0341 (0x000682) 0x4F50- f:00047 d: 336 | A = A << B | **** non-standard encoding with D:0x0150 **** 0x0342 (0x000684) 0x2043- f:00020 d: 67 | A = OR[67] 0x0343 (0x000686) 0x482F- f:00044 d: 47 | A = A > B | **** non-standard encoding with D:0x002F **** 0x0344 (0x000688) 0x4355- f:00041 d: 341 | C = 1, io 0525 = BZ 0x0345 (0x00068A) 0x2020- f:00020 d: 32 | A = OR[32] 0x0346 (0x00068C) 0x2020- f:00020 d: 32 | A = OR[32] 0x0347 (0x00068E) 0x2020- f:00020 d: 32 | A = OR[32] 0x0348 (0x000690) 0x2020- f:00020 d: 32 | A = OR[32] 0x0349 (0x000692) 0x2020- f:00020 d: 32 | A = OR[32] 0x034A (0x000694) 0x2020- f:00020 d: 32 | A = OR[32] 0x034B (0x000696) 0x2053- f:00020 d: 83 | A = OR[83] 0x034C (0x000698) 0x5441- f:00052 d: 65 | A = A + B | **** non-standard encoding with D:0x0041 **** 0x034D (0x00069A) 0x5455- f:00052 d: 85 | A = A + B | **** non-standard encoding with D:0x0055 **** 0x034E (0x00069C) 0x5320- f:00051 d: 288 | A = A & B | **** non-standard encoding with D:0x0120 **** 0x034F (0x00069E) 0x2020- f:00020 d: 32 | A = OR[32] 0x0350 (0x0006A0) 0x2020- f:00020 d: 32 | A = OR[32] 0x0351 (0x0006A2) 0x2020- f:00020 d: 32 | A = OR[32] 0x0352 (0x0006A4) 0x2056- f:00020 d: 86 | A = OR[86] 0x0353 (0x0006A6) 0x534E- f:00051 d: 334 | A = A & B | **** non-standard encoding with D:0x014E **** 0x0354 (0x0006A8) 0x2020- f:00020 d: 32 | A = OR[32] 0x0355 (0x0006AA) 0x2020- f:00020 d: 32 | A = OR[32] 0x0356 (0x0006AC) 0x2020- f:00020 d: 32 | A = OR[32] 0x0357 (0x0006AE) 0x4642- f:00043 d: 66 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0042 **** 0x0358 (0x0006B0) 0x4320- f:00041 d: 288 | C = 1, io 0440 = BZ 0x0359 (0x0006B2) 0x2020- f:00020 d: 32 | A = OR[32] 0x035A (0x0006B4) 0x2020- f:00020 d: 32 | A = OR[32] 0x035B (0x0006B6) 0x5346- f:00051 d: 326 | A = A & B | **** non-standard encoding with D:0x0146 **** 0x035C (0x0006B8) 0x4500- f:00042 d: 256 | C = 1, IOB = DN | **** non-standard encoding with D:0x0100 **** 0x035D (0x0006BA) 0x4652- f:00043 d: 82 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0052 **** 0x035E (0x0006BC) 0x414D- f:00040 d: 333 | C = 1, io 0515 = DN 0x035F (0x0006BE) 0x4500- f:00042 d: 256 | C = 1, IOB = DN | **** non-standard encoding with D:0x0100 **** 0x0360 (0x0006C0) 0x4E4F- f:00047 d: 79 | A = A << B | **** non-standard encoding with D:0x004F **** 0x0361 (0x0006C2) 0x5420- f:00052 d: 32 | A = A + B | **** non-standard encoding with D:0x0020 **** 0x0362 (0x0006C4) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F **** 0x0363 (0x0006C6) 0x4747- f:00043 d: 327 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0147 **** 0x0364 (0x0006C8) 0x4544- f:00042 d: 324 | C = 1, IOB = DN | **** non-standard encoding with D:0x0144 **** 0x0365 (0x0006CA) 0x204F- f:00020 d: 79 | A = OR[79] 0x0366 (0x0006CC) 0x4E00- f:00047 d: 0 | A = A << B 0x0367 (0x0006CE) 0x454E- f:00042 d: 334 | C = 1, IOB = DN | **** non-standard encoding with D:0x014E **** 0x0368 (0x0006D0) 0x4420- f:00042 d: 32 | C = 1, IOB = DN | **** non-standard encoding with D:0x0020 **** 0x0369 (0x0006D2) 0x4F46- f:00047 d: 326 | A = A << B | **** non-standard encoding with D:0x0146 **** 0x036A (0x0006D4) 0x2044- f:00020 d: 68 | A = OR[68] 0x036B (0x0006D6) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN 0x036C (0x0006D8) 0x4100- f:00040 d: 256 | C = 1, io 0400 = DN 0x036D (0x0006DA) 0x4944- f:00044 d: 324 | A = A > B | **** non-standard encoding with D:0x0144 **** 0x036E (0x0006DC) 0x4C45- f:00046 d: 69 | A = A >> B | **** non-standard encoding with D:0x0045 **** 0x036F (0x0006DE) 0x2020- f:00020 d: 32 | A = OR[32] 0x0370 (0x0006E0) 0x2020- f:00020 d: 32 | A = OR[32] 0x0371 (0x0006E2) 0x0000- f:00000 d: 0 | PASS 0x0372 (0x0006E4) 0x5244- f:00051 d: 68 | A = A & B | **** non-standard encoding with D:0x0044 **** 0x0373 (0x0006E6) 0x2F57- f:00027 d: 343 | OR[343] = OR[343] - 1 0x0374 (0x0006E8) 0x5420- f:00052 d: 32 | A = A + B | **** non-standard encoding with D:0x0020 **** 0x0375 (0x0006EA) 0x2020- f:00020 d: 32 | A = OR[32] 0x0376 (0x0006EC) 0x0000- f:00000 d: 0 | PASS 0x0377 (0x0006EE) 0x4D4F- f:00046 d: 335 | A = A >> B | **** non-standard encoding with D:0x014F **** 0x0378 (0x0006F0) 0x554E- f:00052 d: 334 | A = A + B | **** non-standard encoding with D:0x014E **** 0x0379 (0x0006F2) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 **** 0x037A (0x0006F4) 0x4420- f:00042 d: 32 | C = 1, IOB = DN | **** non-standard encoding with D:0x0020 **** 0x037B (0x0006F6) 0x0000- f:00000 d: 0 | PASS 0x037C (0x0006F8) 0x444F- f:00042 d: 79 | C = 1, IOB = DN | **** non-standard encoding with D:0x004F **** 0x037D (0x0006FA) 0x574E- f:00053 d: 334 | A = A - B | **** non-standard encoding with D:0x014E **** 0x037E (0x0006FC) 0x2020- f:00020 d: 32 | A = OR[32] 0x037F (0x0006FE) 0x2020- f:00020 d: 32 | A = OR[32] 0x0380 (0x000700) 0x0000- f:00000 d: 0 | PASS 0x0381 (0x000702) 0x4F50- f:00047 d: 336 | A = A << B | **** non-standard encoding with D:0x0150 **** 0x0382 (0x000704) 0x2D44- f:00026 d: 324 | OR[324] = OR[324] + 1 0x0383 (0x000706) 0x4F57- f:00047 d: 343 | A = A << B | **** non-standard encoding with D:0x0157 **** 0x0384 (0x000708) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 **** 0x0385 (0x00070A) 0x0000- f:00000 d: 0 | PASS 0x0386 (0x00070C) 0x5245- f:00051 d: 69 | A = A & B | **** non-standard encoding with D:0x0045 **** 0x0387 (0x00070E) 0x4144- f:00040 d: 324 | C = 1, io 0504 = DN 0x0388 (0x000710) 0x2020- f:00020 d: 32 | A = OR[32] 0x0389 (0x000712) 0x2020- f:00020 d: 32 | A = OR[32] 0x038A (0x000714) 0x0000- f:00000 d: 0 | PASS 0x038B (0x000716) 0x4D41- f:00046 d: 321 | A = A >> B | **** non-standard encoding with D:0x0141 **** 0x038C (0x000718) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E **** 0x038D (0x00071A) 0x542E- f:00052 d: 46 | A = A + B | **** non-standard encoding with D:0x002E **** 0x038E (0x00071C) 0x2020- f:00020 d: 32 | A = OR[32] 0x038F (0x00071E) 0x0000- f:00000 d: 0 | PASS 0x0390 (0x000720) 0x5359- f:00051 d: 345 | A = A & B | **** non-standard encoding with D:0x0159 **** 0x0391 (0x000722) 0x532D- f:00051 d: 301 | A = A & B | **** non-standard encoding with D:0x012D **** 0x0392 (0x000724) 0x444F- f:00042 d: 79 | C = 1, IOB = DN | **** non-standard encoding with D:0x004F **** 0x0393 (0x000726) 0x574E- f:00053 d: 334 | A = A - B | **** non-standard encoding with D:0x014E **** 0x0394 (0x000728) 0x0000- f:00000 d: 0 | PASS 0x0395 (0x00072A) 0x4F46- f:00047 d: 326 | A = A << B | **** non-standard encoding with D:0x0146 **** 0x0396 (0x00072C) 0x464C- f:00043 d: 76 | C = 1, IOB = BZ | **** non-standard encoding with D:0x004C **** 0x0397 (0x00072E) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E **** 0x0398 (0x000730) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 **** 0x0399 (0x000732) 0x0000- f:00000 d: 0 | PASS 0x039A (0x000734) 0x4F50- f:00047 d: 336 | A = A << B | **** non-standard encoding with D:0x0150 **** 0x039B (0x000736) 0x2D49- f:00026 d: 329 | OR[329] = OR[329] + 1 0x039C (0x000738) 0x4E54- f:00047 d: 84 | A = A << B | **** non-standard encoding with D:0x0054 **** 0x039D (0x00073A) 0x564E- f:00053 d: 78 | A = A - B | **** non-standard encoding with D:0x004E **** 0x039E (0x00073C) 0x0000- f:00000 d: 0 | PASS 0x039F (0x00073E) 0x0000- f:00000 d: 0 | PASS 0x03A0 (0x000740) 0x0000- f:00000 d: 0 | PASS 0x03A1 (0x000742) 0x0000- f:00000 d: 0 | PASS 0x03A2 (0x000744) 0x0000- f:00000 d: 0 | PASS 0x03A3 (0x000746) 0x0000- f:00000 d: 0 | PASS
src/main/antlr4/formulaParser.g4
duhongming1990/A2LParser
0
5230
<filename>src/main/antlr4/formulaParser.g4 parser grammar formulaParser; options { tokenVocab=formulaLexer; } @header { package net.alenzen.a2l.antlr; } expression : IDENTIFIER | value | in_brackets | unary_function | firstExpression=expression binaryOpInfix=binary_middle_operator secondExpression=expression | binaryOpPrefix=binary_leeding_operator BRACKET_OPEN firstExpression=expression COMMA secondExpression=expression BRACKET_CLOSE ; value : INT | DECIMAL | HEX_VALUE; in_brackets : BRACKET_OPEN expression BRACKET_CLOSE; unary_function : bit_not_function | not_function | exp_function | sqrt_function | abs_function | sin_function | cos_function | tan_function | asin_function | acos_function | atan_function | sinh_function | cosh_function | tanh_function | log_function | log10_function | sysc_function | plus_function | minus_function ; bit_not_function : BIT_NOT expression; not_function : NOT expression; exp_function : EXP in_brackets; sqrt_function : SQRT in_brackets; abs_function : ABS in_brackets; sin_function : SIN in_brackets; cos_function : COS in_brackets; tan_function : TAN in_brackets; asin_function : ASIN in_brackets; acos_function : ACOS in_brackets; atan_function : ATAN in_brackets; sinh_function : SINH in_brackets; cosh_function : COSH in_brackets; tanh_function : TANH in_brackets; log_function : LOG in_brackets; log10_function : LOG10 in_brackets; sysc_function : (SYSC | SYSC_DOLLAR) BRACKET_OPEN IDENTIFIER BRACKET_CLOSE; plus_function : PLUS expression; minus_function : MINUS expression; binary_middle_operator : PLUS | MINUS | MULTIPLICATION | DIVIDE | BIT_AND | BIT_OR | BIT_XOR | BITSHIFT_LEFT | BITSHIFT_RIGHT | AND | OR ; binary_leeding_operator : POW;
dv3/qxl/hd/fpart.asm
olifink/smsqe
0
166442
<filename>dv3/qxl/hd/fpart.asm<gh_stars>0 ; DV3 QXL Find Partition V3.01  1999 <NAME> section dv3 xdef hd_fpart include 'dev8_keys_err' include 'dev8_keys_qlwa' include 'dev8_keys_atari' include 'dev8_dv3_keys' include 'dev8_dv3_hd_keys' ;+++ ; DV3 QXL find partition. ; Always returns no partition table ; ; d1 r as d3 but in ths format if required ; d2 r size of partition, -1 no partition table ; d3 r sector number with partition root ; d4 r partition ID ; d7 c p drive ID / number ; a3 c p pointer to linkage block ; a4 c p pointer to physical definition ; ; error return 0 or error ;--- hd_fpart st hdl_npart(a3) ; set no partition found moveq #0,d1 moveq #-1,d2 ; size unknown moveq #0,d3 move.l #art.qflg,d4 ; for QDOS disk moveq #0,d0 rts end
oeis/153/A153885.asm
neoneye/loda-programs
11
102433
; A153885: a(n) = ((8 + sqrt(5))^n - (8 - sqrt(5))^n)/(2*sqrt(5)). ; Submitted by <NAME> ; 1,16,197,2208,23705,249008,2585533,26677056,274286449,2814636880,28851289589,295557057504,3026686834313,30989122956272,317251444075885,3247664850794112,33244802412228577,340304612398804624,3483430456059387941,35656915165420734240,364988245739227859321,3736053937067822428976,38242556494470715163677,391453721624529919309248,4006948712818706514291025,41015409829252038989410768,419836583211728939487401813,4297476151461792731423193696,43989260013896676273014392169,450277067286101049214261846640 mov $1,6 mov $3,1 lpb $0 sub $0,1 mov $2,$3 mul $3,10 add $3,$1 mul $1,6 add $1,$2 lpe mov $0,$3
Lambda/Substitution/OneSemantics.agda
nad/codata
1
5628
------------------------------------------------------------------------ -- Big-step semantics for the untyped λ-calculus ------------------------------------------------------------------------ module Lambda.Substitution.OneSemantics where open import Codata.Musical.Notation open import Data.Fin open import Function open import Data.Nat open import Lambda.Syntax open WHNF open import Lambda.Substitution -- Semantic domain. ⊥ represents non-termination. data Sem (n : ℕ) : Set where ⊥ : Sem n val : (v : Value n) → Sem n -- Big-step semantics. mutual infix 4 _⇒_ _⇒?_ data _⇒_ {n} : Tm n → Sem n → Set where val : ∀ {v} → ⌜ v ⌝ ⇒ val v app : ∀ {t₁ t₂ t v s} (t₁⇓ : t₁ ⇒? val (ƛ t)) (t₂⇓ : t₂ ⇒? val v) (t₁t₂⇒ : t / sub ⌜ v ⌝ ⇒? s) → t₁ · t₂ ⇒ s ·ˡ : ∀ {t₁ t₂} (t₁⇑ : t₁ ⇒? ⊥) → t₁ · t₂ ⇒ ⊥ ·ʳ : ∀ {t₁ t₂ v} (t₁⇓ : t₁ ⇒? val v) (t₂⇑ : t₂ ⇒? ⊥) → t₁ · t₂ ⇒ ⊥ -- Conditional coinduction: coinduction only for diverging -- computations. _⇒?_ : ∀ {n} → Tm n → Sem n → Set t ⇒? ⊥ = ∞ (t ⇒ ⊥) t ⇒? val v = t ⇒ val v -- Example. Ω-loops : Ω ⇒ ⊥ Ω-loops = app val val (♯ Ω-loops)
test/asset/agda-stdlib-1.0/Relation/Unary/Indexed.agda
omega12345/agda-mode
5
8433
<reponame>omega12345/agda-mode<gh_stars>1-10 ------------------------------------------------------------------------ -- The Agda standard library -- -- Indexed unary relations ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Relation.Unary.Indexed where open import Data.Product using (∃; _×_) open import Level open import Relation.Nullary using (¬_) IPred : ∀ {i a} {I : Set i} → (I → Set a) → (ℓ : Level) → Set _ IPred A ℓ = ∀ {i} → A i → Set ℓ module _ {i a} {I : Set i} {A : I → Set a} where _∈_ : ∀ {ℓ} → (∀ i → A i) → IPred A ℓ → Set _ x ∈ P = ∀ i → P (x i) _∉_ : ∀ {ℓ} → (∀ i → A i) → IPred A ℓ → Set _ t ∉ P = ¬ (t ∈ P)
Cubical/Data/DiffInt.agda
dan-iel-lee/cubical
0
10495
<filename>Cubical/Data/DiffInt.agda {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.DiffInt where open import Cubical.Data.DiffInt.Base public open import Cubical.Data.DiffInt.Properties public
projects/batfish/src/org/batfish/grammar/vyos/VyosParser.g4
gaberger/batfish
1
2138
parser grammar VyosParser; options { superClass = 'org.batfish.grammar.BatfishParser'; tokenVocab = VyosLexer; } @header { package org.batfish.grammar.vyos; } braced_clause : OPEN_BRACE NEWLINE statement* CLOSE_BRACE NEWLINE ; statement : word+ ( braced_clause | terminator ) ; terminator : NEWLINE ; vyos_configuration : statement+ EOF ; word : WORD ;
models/amalgam/paper/dtree.als
transclosure/Amalgam
4
2366
/* Directed trees (irreflexive, connected, acyclic) (Also serves as a test case for predicate expansion.) */ sig Node { edges: set Node } pred irreflexive { no iden & edges } pred canreach[n1: Node, n2: Node] { n2 in n1.^edges } pred allreachable { all n1: Node, n2: Node-n1 | canreach[n1,n2] } pred injective { edges.~edges in iden } pred directedacyclic { no n: Node | n in n.^edges } pred partialTree { irreflexive allreachable injective directedacyclic } // To test resolving no-arg pred with multi-arg inside to also resolve, // "why need this edge?" //run partialTree for 5 //run partialTree for 6 run partialTree for 7
oeis/132/A132752.asm
neoneye/loda-programs
11
4422
; A132752: Triangle T(n, k) = 2*A132749(n, k) - 1, read by rows. ; Submitted by <NAME> ; 1,3,1,3,3,1,3,5,5,1,3,7,11,7,1,3,9,19,19,9,1,3,11,29,39,29,11,1,3,13,41,69,69,41,13,1,3,15,55,111,139,111,55,15,1,3,17,71,167,251,251,167,71,17,1,3,19,89,239,419,503,419,239,89,19,1,3,21,109,329,659,923,923,659,329,109,21,1,3,23,131,439,989,1583,1847,1583,989,439,131,23,1,3,25,155,571,1429,2573,3431,3431,2573 lpb $0 add $1,1 sub $0,$1 bin $2,$0 lpe bin $1,$0 add $2,$1 mov $0,$2 sub $0,1 mul $0,2 add $0,1
src/data.asm
harraps/Simple-NES-Game
0
241259
<gh_stars>0 ; ====== ; BANK 1 ; ====== ; add three interrupts in bank 1 .bank 1 .org $e000 ; ============ ; PALETTE DATA ; ============ ; define colors of palettes pal_data: ; sprite palette: .byte $0f,$0c,$16,$30 ; 0: marine .byte $0f,$08,$2a,$38 ; 1: jungle .byte $0f,$07,$2d,$3d ; 2: rust .byte $0f,$11,$23,$34 ; 3: aesthetic ; background palette: .byte $0f,$0c,$16,$30 ; 0: marine .byte $0f,$08,$2a,$38 ; 1: jungle .byte $0f,$07,$2d,$3d ; 2: rust .byte $0f,$11,$23,$34 ; 3: aesthetic ; =========== ; SPRITE DATA ; =========== ; define sprites animations spr_data: .byte CENTER_Y,$32,%00000001,CENTER_X ; sprite 0 .byte CENTER_Y,$33,%00000001,CENTER_X ; sprite 1 .byte CENTER_Y,$42,%00000001,CENTER_X ; sprite 2 .byte CENTER_Y,$43,%00000001,CENTER_X ; sprite 3 .byte CENTER_Y,$32,%00000010,CENTER_X ; sprite 4 .byte CENTER_Y,$33,%00000010,CENTER_X ; sprite 5 .byte CENTER_Y,$42,%00000010,CENTER_X ; sprite 6 .byte CENTER_Y,$43,%00000010,CENTER_X ; sprite 7 ; other data can be defined here .org $fffA .word NMI ; location of NMI Interrupt .word RESET ; code to run at reset (LABEL defined in bank 0) .word 0 ; location of VBlank Interrupt ; ====== ; BANK 2 ; ====== ; add picture data in bank 2 .bank 2 .org $0000 .incbin "data/mario.chr" ; test sprite sheet ; .incbin "data/foreground.chr" ; load foreground picture data ($0000) ; .incbin "data/background.chr" ; load background picture data ($1000)
awa/plugins/awa-tags/src/awa-tags-modules.adb
fuzzysloth/ada-awa
81
9340
<gh_stars>10-100 ----------------------------------------------------------------------- -- awa-tags-modules -- Module awa-tags -- Copyright (C) 2013, 2016 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ADO.Sessions.Entities; with ADO.Statements; with ADO.Queries; with ADO.SQL; with Security.Permissions; with AWA.Permissions; with AWA.Services.Contexts; with AWA.Modules.Get; with AWA.Modules.Beans; with AWA.Users.Models; with AWA.Tags.Models; with AWA.Tags.Beans; with AWA.Tags.Components; with Util.Log.Loggers; package body AWA.Tags.Modules is package ASC renames AWA.Services.Contexts; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Tags.Module"); package Register is new AWA.Modules.Beans (Module => Tag_Module, Module_Access => Tag_Module_Access); -- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified -- by <tt>Entity_Type</tt>. procedure Add_Tag (Session : in out ADO.Sessions.Master_Session; Id : in ADO.Identifier; Entity_Type : in ADO.Entity_Type; Tag : in String); -- Remove the tag identified by <tt>Tag</tt> and associated with the database entity -- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>. procedure Remove_Tag (Session : in out ADO.Sessions.Master_Session; Id : in ADO.Identifier; Entity_Type : in ADO.Entity_Type; Tag : in String); -- ------------------------------ -- Initialize the tags module. -- ------------------------------ overriding procedure Initialize (Plugin : in out Tag_Module; App : in AWA.Modules.Application_Access; Props : in ASF.Applications.Config) is begin Log.Info ("Initializing the awa-tags module"); App.Add_Components (AWA.Tags.Components.Definition); -- Register the tag list bean. Register.Register (Plugin => Plugin, Name => "AWA.Tags.Beans.Tag_List_Bean", Handler => AWA.Tags.Beans.Create_Tag_List_Bean'Access); -- Register the tag search bean. Register.Register (Plugin => Plugin, Name => "AWA.Tags.Beans.Tag_Search_Bean", Handler => AWA.Tags.Beans.Create_Tag_Search_Bean'Access); -- Register the tag info list bean. Register.Register (Plugin => Plugin, Name => "AWA.Tags.Beans.Tag_Info_List_Bean", Handler => AWA.Tags.Beans.Create_Tag_Info_List_Bean'Access); AWA.Modules.Module (Plugin).Initialize (App, Props); -- Add here the creation of manager instances. end Initialize; -- ------------------------------ -- Get the tags module. -- ------------------------------ function Get_Tag_Module return Tag_Module_Access is function Get is new AWA.Modules.Get (Tag_Module, Tag_Module_Access, NAME); begin return Get; end Get_Tag_Module; -- ------------------------------ -- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified -- by <tt>Entity_Type</tt>. The permission represented by <tt>Permission</tt> is checked -- to make sure the current user can add the tag. If the permission is granted, the -- tag represented by <tt>Tag</tt> is associated with the said database entity. -- ------------------------------ procedure Add_Tag (Model : in Tag_Module; Id : in ADO.Identifier; Entity_Type : in String; Permission : in String; Tag : in String) is pragma Unreferenced (Model); Ctx : constant ASC.Service_Context_Access := ASC.Current; User : constant AWA.Users.Models.User_Ref := Ctx.Get_User; Ident : constant String := Entity_Type & ADO.Identifier'Image (Id); DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx); Kind : ADO.Entity_Type; begin -- Check that the user has the permission on the given object. AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission), Entity => Id); Log.Info ("User {0} add tag {1} on {2}", ADO.Identifier'Image (User.Get_Id), Tag, Ident); Ctx.Start; Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type); Add_Tag (DB, Id, Kind, Tag); Ctx.Commit; end Add_Tag; -- ------------------------------ -- Remove the tag identified by <tt>Tag</tt> and associated with the database entity -- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>. -- The permission represented by <tt>Permission</tt> is checked to make sure the current user -- can remove the tag. -- ------------------------------ procedure Remove_Tag (Model : in Tag_Module; Id : in ADO.Identifier; Entity_Type : in String; Permission : in String; Tag : in String) is pragma Unreferenced (Model); Ctx : constant ASC.Service_Context_Access := ASC.Current; User : constant AWA.Users.Models.User_Ref := Ctx.Get_User; Ident : constant String := Entity_Type & ADO.Identifier'Image (Id); DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx); Kind : ADO.Entity_Type; begin -- Check that the user has the permission on the given object. AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission), Entity => Id); Log.Info ("User {0} removes tag {1} on {2}", ADO.Identifier'Image (User.Get_Id), Tag, Ident); Ctx.Start; Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type); Remove_Tag (DB, Id, Kind, Tag); Ctx.Commit; end Remove_Tag; -- ------------------------------ -- Remove the tags defined by the <tt>Deleted</tt> tag list and add the tags defined -- in the <tt>Added</tt> tag list. The tags are associated with the database entity -- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>. -- The permission represented by <tt>Permission</tt> is checked to make sure the current user -- can remove or add the tag. -- ------------------------------ procedure Update_Tags (Model : in Tag_Module; Id : in ADO.Identifier; Entity_Type : in String; Permission : in String; Added : in Util.Strings.Vectors.Vector; Deleted : in Util.Strings.Vectors.Vector) is pragma Unreferenced (Model); Ctx : constant ASC.Service_Context_Access := ASC.Current; User : constant AWA.Users.Models.User_Ref := Ctx.Get_User; Ident : constant String := Entity_Type & ADO.Identifier'Image (Id); DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx); Kind : ADO.Entity_Type; Iter : Util.Strings.Vectors.Cursor; begin -- Check that the user has the permission on the given object. AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission), Entity => Id); Ctx.Start; Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type); -- Delete the tags that have been removed. Iter := Deleted.First; while Util.Strings.Vectors.Has_Element (Iter) loop declare Tag : constant String := Util.Strings.Vectors.Element (Iter); begin Log.Info ("User {0} removes tag {1} on {2}", ADO.Identifier'Image (User.Get_Id), Tag, Ident); Remove_Tag (DB, Id, Kind, Tag); end; Util.Strings.Vectors.Next (Iter); end loop; -- And add the new ones. Iter := Added.First; while Util.Strings.Vectors.Has_Element (Iter) loop declare Tag : constant String := Util.Strings.Vectors.Element (Iter); begin Log.Info ("User {0} adds tag {1} on {2}", ADO.Identifier'Image (User.Get_Id), Tag, Ident); Add_Tag (DB, Id, Kind, Tag); end; Util.Strings.Vectors.Next (Iter); end loop; Ctx.Commit; end Update_Tags; -- ------------------------------ -- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified -- by <tt>Entity_Type</tt>. -- ------------------------------ procedure Add_Tag (Session : in out ADO.Sessions.Master_Session; Id : in ADO.Identifier; Entity_Type : in ADO.Entity_Type; Tag : in String) is Query : ADO.Queries.Context; Tag_Info : AWA.Tags.Models.Tag_Ref; Tag_Link : AWA.Tags.Models.Tagged_Entity_Ref; begin Query.Set_Query (AWA.Tags.Models.Query_Check_Tag); declare Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query); begin -- Build the query. Stmt.Bind_Param (Name => "entity_type", Value => Entity_Type); Stmt.Bind_Param (Name => "entity_id", Value => Id); Stmt.Bind_Param (Name => "tag", Value => Tag); -- Run the query. Stmt.Execute; if not Stmt.Has_Elements then -- The tag is not defined in the database. -- Create it and link it to the entity. Tag_Info.Set_Name (Tag); Tag_Link.Set_Tag (Tag_Info); Tag_Link.Set_For_Entity_Id (Id); Tag_Link.Set_Entity_Type (Entity_Type); Tag_Info.Save (Session); Tag_Link.Save (Session); elsif Stmt.Is_Null (1) then -- The tag is defined but the entity is not linked with it. Tag_Info.Set_Id (Stmt.Get_Identifier (0)); Tag_Link.Set_Tag (Tag_Info); Tag_Link.Set_For_Entity_Id (Id); Tag_Link.Set_Entity_Type (Entity_Type); Tag_Link.Save (Session); end if; end; end Add_Tag; -- ------------------------------ -- Remove the tag identified by <tt>Tag</tt> and associated with the database entity -- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>. -- ------------------------------ procedure Remove_Tag (Session : in out ADO.Sessions.Master_Session; Id : in ADO.Identifier; Entity_Type : in ADO.Entity_Type; Tag : in String) is Query : ADO.SQL.Query; Tag_Link : AWA.Tags.Models.Tagged_Entity_Ref; Found : Boolean; begin Query.Set_Join ("INNER JOIN awa_tag AS tag ON tag.id = o.tag_id"); Query.Set_Filter ("tag.name = :tag AND o.for_entity_id = :entity_id " & "AND o.entity_type = :entity_type"); -- Build the query. Query.Bind_Param (Name => "entity_type", Value => Entity_Type); Query.Bind_Param (Name => "entity_id", Value => Id); Query.Bind_Param (Name => "tag", Value => Tag); Tag_Link.Find (Session, Query, Found); if Found then Tag_Link.Delete (Session); end if; end Remove_Tag; -- ------------------------------ -- Find the tag identifier associated with the given tag. -- Return NO_IDENTIFIER if there is no such tag. -- ------------------------------ procedure Find_Tag_Id (Session : in out ADO.Sessions.Session'Class; Tag : in String; Result : out ADO.Identifier) is begin if Tag'Length = 0 then Result := ADO.NO_IDENTIFIER; else declare Query : ADO.SQL.Query; Found : Boolean; Tag_Info : AWA.Tags.Models.Tag_Ref; begin Query.Set_Filter ("o.name = ?"); Query.Bind_Param (1, Tag); Tag_Info.Find (Session => Session, Query => Query, Found => Found); if not Found then Result := ADO.NO_IDENTIFIER; else Result := Tag_Info.Get_Id; end if; end; end if; end Find_Tag_Id; end AWA.Tags.Modules;
Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_ch7.ads
djamal2727/Main-Bearing-Analytical-Model
0
20891
<gh_stars>0 ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ C H 7 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, 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. 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 COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Types; use Types; package Sem_Ch7 is procedure Analyze_Package_Body (N : Node_Id); procedure Analyze_Package_Declaration (N : Node_Id); procedure Analyze_Package_Specification (N : Node_Id); procedure Analyze_Private_Type_Declaration (N : Node_Id); procedure End_Package_Scope (P : Entity_Id); -- Calls Uninstall_Declarations, and then pops the scope stack procedure Exchange_Declarations (Id : Entity_Id); -- Exchange private and full declaration on entry/exit from a package -- declaration or body. The semantic links of the respective nodes -- are preserved in the exchange. procedure Install_Visible_Declarations (P : Entity_Id); procedure Install_Private_Declarations (P : Entity_Id); -- On entrance to a package body, make declarations in package spec -- immediately visible. -- -- When compiling the body of a package, both routines are called in -- succession. When compiling the body of a child package, the call -- to Install_Private_Declaration is immediate for private children, -- but is deferred until the compilation of the private part of the -- child for public child packages. function Unit_Requires_Body (Pack_Id : Entity_Id; Do_Abstract_States : Boolean := False) return Boolean; -- Determine whether package Pack_Id requires a body. A specification needs -- a body if it contains declarations that require completion in the body. -- A non-Ghost [generic] package does not require a body when it declares -- Ghost entities exclusively. When flag Do_Abstract_States is set to True, -- non-null abstract states are considered in determining the need for a -- body. procedure May_Need_Implicit_Body (E : Entity_Id); -- If a package declaration contains tasks or RACWs and does not require -- a body, create an implicit body at the end of the current declarative -- part to activate those tasks or contain the bodies for the RACW -- calling stubs. procedure New_Private_Type (N : Node_Id; Id : Entity_Id; Def : Node_Id); -- Common processing for private type declarations and for formal private -- type declarations. For private types, N and Def are the type declaration -- node; for formal private types, Def is the formal type definition. procedure Uninstall_Declarations (P : Entity_Id); -- At the end of a package declaration or body, declarations in the visible -- part are no longer immediately visible, and declarations in the private -- part are not visible at all. For inner packages, place visible entities -- at the end of their homonym chains. For compilation units, make -- all entities invisible. In both cases, exchange private and visible -- declarations to restore order of elaboration. end Sem_Ch7;
io.asm
TobiasKaiser/ahci_sbe
2
178989
<filename>io.asm ; io.asm -- User interface functions via BIOS ; Copyright (C) 2014, 2016 <NAME> <<EMAIL>> ; Password dialog ; --------------- window_width equ 56 ; pw_dialog provides the interface for the user to enter a password by ; keyboard. ; Returns 0 on success, 1 on Escape pw_dialog: pusha call restore_last_password mov [cur_style], byte 0x1F ; white on blue mov [horiz_line_left], byte 0xB3 ; vertical line mov [horiz_line_middle], byte 0x20 ; space mov [horiz_line_right], byte 0xB3 ; vertical line mov DH, 7 ; line number call horiz_line mov DH, 8 ; line number call horiz_line mov DH, 9 ; line number call horiz_line mov DH, 10 ; line number call horiz_line mov DH, 11 ; line number call horiz_line mov DH, 13 ; line number call horiz_line mov DH, 14 ; line number call horiz_line mov DH, 15 ; line number call horiz_line mov DH, 16 ; line number call horiz_line mov DH, 17 ; line number call horiz_line mov [horiz_line_middle], byte 0xC4 ; horizontal lines following mov [horiz_line_left], byte 0xDA ; top left corner mov [horiz_line_right], byte 0xBF ; top right corner mov DH, 6 ; line number call horiz_line mov [horiz_line_left], byte 0xC3 ; |- mov [horiz_line_right], byte 0xB4 ; -| mov DH, 12 ; line number call horiz_line mov [horiz_line_left], byte 0xC0 ; bottom left corner mov [horiz_line_right], byte 0xD9 ; bottom right corner mov DH, 18 ; line number call horiz_line mov DL, (80-window_width)/2+2 mov DH, 8 mov AH, 02h ; set cursor position int 10h mov AX, pw_dialog_msg call puts mov [cur_style], byte 0x70 ; black on gray mov DH, 16 mov AH, 02h ; set cursor position int 10h mov AX, pw_dialog_usage_msg call puts mov [cur_style], byte 0x1F ; Neatly fill the space between the usage hints mov DH, 16 mov DL, (80-window_width)/2+2+12 mov AH, 02h ; set cursor position int 10h mov AL, ` ` call putc call putc mov DL, (80-window_width)/2+2+12+29 mov AH, 02h ; set cursor position int 10h mov AL, ` ` call putc call putc mov DL, (80-window_width)/2+2 mov DH, 10 mov AH, 02h ; set cursor position int 10h mov AX, identify_strbuf call puts mov DH, 14 mov AH, 02h ; set cursor position int 10h mov AX, pw_dialog_prompt call puts mov EDI, 0 ; restore last password to dialog mov ECX, [last_password_length] restore_asterisks: cmp ECX, 0 jz restore_asterisks_end mov AL, '*' call putc inc EDI dec ECX jmp restore_asterisks restore_asterisks_end: mov ECX, [ahci_data_buf] add ECX, 2 ; the password field for SECURITY UNLOCK is now at ES:ECX pw_dialog_loop: call getc cmp AL, `\r` jz pw_dialog_end_loop cmp AL, 0x1b ; escape key cancels password dialog and continues boot with locked hdd jz pw_dialog_escape cmp AL, `\b` jz pw_dialog_backspace cmp EDI, 32 jnz pw_addchar_ok jmp pw_dialog_loop ; too long pw_addchar_ok: mov [ES:ECX+EDI], AL mov AL, '*' call putc inc EDI jmp pw_dialog_loop pw_dialog_backspace: cmp EDI, 0 jnz pw_delchar_ok jmp pw_dialog_loop ; already empty buffer pw_dialog_escape: mov [cur_style], byte 0x07 ; grey on black popa mov AX, 1 ; dialog cancelled ret pw_delchar_ok: mov [ES:ECX+EDI], byte 0 call backspace dec EDI jmp pw_dialog_loop pw_dialog_end_loop: call clear_last_password ; check if shift is pressed. If so, set [unlock_multiple], else clear it. mov AH, 0x02 int 16h and AL, 3 ; first two bits are shift left and right cmp AL, 0 jz pw_dialog_no_multiple mov [unlock_multiple], byte 1 mov [last_password_length], EDI call store_last_password pw_dialog_no_multiple: mov [cur_style], byte 0x07 ; grey on black popa mov AX, 0 ; success ret ; Error box: Wrong password ; ------------------------- wrong_password_error_box: pusha mov [cur_style], byte 0x4F ; white on red mov [horiz_line_left], byte 0xB3 ; vertical line mov [horiz_line_middle], byte 0x20 ; space mov [horiz_line_right], byte 0xB3 ; vertical line mov DH, 11 ; line number call horiz_line mov DH, 12 ; line number call horiz_line mov DH, 13 ; line number call horiz_line mov [horiz_line_middle], byte 0xC4 ; horizontal lines following mov [horiz_line_left], byte 0xDA ; top left corner mov [horiz_line_right], byte 0xBF ; top right corner mov DH, 10 ; line number call horiz_line mov [horiz_line_left], byte 0xC0 ; bottom left corner mov [horiz_line_right], byte 0xD9 ; bottom right corner mov DH, 14 ; line number call horiz_line mov DL, (80-window_width)/2+2 mov DH, 12 mov AH, 02h ; set cursor position int 10h mov AX, wrong_password_msg call puts wait_return: call getc cmp AL, `\r` jnz wait_return mov [cur_style], byte 0x07 ; grey on black popa ret cls_blank: ; Clear screen mov AH, 06h mov AL, 0 mov BH, 07h mov CH, 0 mov CL, 0 mov DH, 24 mov DL, 79 int 10h ; Move cursor to 0, 0 mov DL, 0 mov DH, 0 mov BH, 0 ; page number mov AH, 02h ; set cursor position int 10h ret cls: pusha call cls_blank ; Print version info at bottom mov DL, 0 mov DH, 24 mov BH, 0 ; page number mov AH, 02h ; set cursor position int 10h mov AX, version_str call puts ; Move cursor to 0, 0 mov DL, 0 mov DH, 0 mov BH, 0 ; page number mov AH, 02h ; set cursor position int 10h popa ret horiz_line: ; DH is line number, chars are [horiz_line_(left|middle|right)] mov AH, 09h mov BL, [cur_style] mov BH, 0 ; page number mov CX, 1 ; count mov DL, (80-window_width)/2 mov AH, 02h ; set cursor position int 10h mov AH, 09h ; print char mov AL, [horiz_line_left] int 10h pw_top_line_loop: inc DL cmp DL, 80 - (80-window_width)/2 - 1 mov AH, 02h ; set cursor position int 10h jz pw_end_top_line mov AH, 09h ; print char mov AL, [horiz_line_middle] int 10h jmp pw_top_line_loop pw_end_top_line: mov AH, 09h ; print char mov AL, [horiz_line_right] int 10h ret ; Basic user interaction procedures ; --------------------------------- nl: push AX mov AL, `\n` call putc pop AX ret getc: ; changes AH... mov AH, 0 int 0x16 ret pause: push AX mov AX, pause_msg call puts call getc pop AX ret puts: push AX push BX mov BX, AX puts_loop: mov AL, [BX] cmp AL, 0 jz end_puts call putc inc BX jmp puts_loop end_puts: pop BX pop AX ret putdword: push EAX shr EAX, 16 call putword pop EAX call putword ret putword: push AX xchg AL, AH call putbyte pop AX call putbyte ret putbyte: push AX shr AL, 4 call putnibble pop AX push AX call putnibble pop AX ret putnibble: and AL, 0fh cmp AL, 0ah jge putnibble_alpha putnibble_numeric: add AL, '0' jmp putnibble_endfork putnibble_alpha: add AL, 'A'-0ah putnibble_endfork: ;mov AL, 'Z' call putc ret backspace: pusha mov AH, 03h ; get cursor position mov BH, 0 ; page number int 10h sub DL, 1 mov AH, 02h ; set cursor position int 10h mov AH, 09h mov AL, ' ' mov BL, [cur_style] mov BH, 0 ; page number mov CX, 1 ; count int 10h popa ret putc: pusha cmp AL, `\n` jz putc_nl cmp AL, `\r` jz putc_nl jmp putc_print_char putc_nl: mov AH, 03h ; get cursor position mov BH, 0 ; page number int 10h mov DL, 79 jmp nl_jump putc_print_char: mov AH, 09h mov AL, AL ; character mov BL, [cur_style] mov BH, 0 ; page number mov CX, 1 ; count int 10h mov AH, 03h ; get cursor position mov BH, 0 ; page number int 10h nl_jump: inc DL ; column cmp DL, 79 jle putc_set_cursor mov DL, 0 inc DH cmp DH, 24 jle putc_set_cursor ; Scroll one line up mov AH, 06h mov AL, 1 mov BH, 07h mov CH, 0 mov CL, 0 mov DH, 24 mov DL, 79 int 10h mov AH, 03h ; get cursor position mov BH, 0 ; page number mov DL, 0 putc_set_cursor: mov AH, 02h ; set cursor position int 10h popa ret
alloy4fun_models/trashltl/models/7/8Mpi7ffLSgDGwqFpA.als
Kaixi26/org.alloytools.alloy
0
3643
<filename>alloy4fun_models/trashltl/models/7/8Mpi7ffLSgDGwqFpA.als open main pred id8Mpi7ffLSgDGwqFpA_prop8 { eventually link.File in Trash } pred __repair { id8Mpi7ffLSgDGwqFpA_prop8 } check __repair { id8Mpi7ffLSgDGwqFpA_prop8 <=> prop8o }
programs/oeis/111/A111072.asm
neoneye/loda
22
18477
; A111072: Write the digit string 0123456789, repeated infinitely many times. Then, starting from the first "0" digit at the left end, move to the right by one digit (to the "1"), then two digits (to the "3"), then three digits (to the "6"), four digits ("0"), five digits ("5"), and so on. Partial sums of the digits thus reached are 0, 1, 4, 10, 10, 15, ... ; 0,1,4,10,10,15,16,24,30,35,40,46,54,55,60,60,66,69,70,70,70,71,74,80,80,85,86,94,100,105,110,116,124,125,130,130,136,139,140,140,140,141,144,150,150,155,156,164,170,175,180,186,194,195,200,200,206,209,210,210,210,211,214,220,220,225,226,234,240,245,250,256,264,265,270,270,276,279,280,280,280,281,284,290,290,295,296,304,310,315,320,326,334,335,340,340,346,349,350,350 lpb $0 mov $2,$0 sub $0,1 seq $2,8954 ; Final digit of triangular number n*(n+1)/2. add $1,$2 lpe mov $0,$1
Source/Levels/L0601.asm
AbePralle/FGB
0
84452
; L0601.asm ; Generated 09.05.2000 by mlevel ; Modified 09.05.2000 by <NAME> INCLUDE "Source/Defs.inc" INCLUDE "Source/Levels.inc" ;--------------------------------------------------------------------- SECTION "Level0601Section",ROMX ;--------------------------------------------------------------------- L0601_Contents:: DW L0601_Load DW L0601_Init DW L0601_Check DW L0601_Map ;--------------------------------------------------------------------- ; Load ;--------------------------------------------------------------------- L0601_Load: DW ((L0601_LoadFinished - L0601_Load2)) ;size L0601_Load2: call ParseMap ret L0601_LoadFinished: ;--------------------------------------------------------------------- ; Map ;--------------------------------------------------------------------- L0601_Map: INCBIN "Data/Levels/L0601_wolf.lvl" ;--------------------------------------------------------------------- ; Init ;--------------------------------------------------------------------- L0601_Init: DW ((L0601_InitFinished - L0601_Init2)) ;size L0601_Init2: call UseAlternatePalette ret L0601_InitFinished: ;--------------------------------------------------------------------- ; Check ;--------------------------------------------------------------------- L0601_Check: DW ((L0601_CheckFinished - L0601_Check2)) ;size L0601_Check2: ret L0601_CheckFinished: PRINT "0601 Script Sizes (Load/Init/Check) (of $500): " PRINT (L0601_LoadFinished - L0601_Load2) PRINT " / " PRINT (L0601_InitFinished - L0601_Init2) PRINT " / " PRINT (L0601_CheckFinished - L0601_Check2) PRINT "\n"
libsrc/_DEVELOPMENT/string/z80/asm_strncat.asm
jpoikela/z88dk
8
168983
; =============================================================== ; Dec 2013 ; =============================================================== ; ; char *strncat(char * restrict s1, const char * restrict s2, size_t n) ; ; Append at most n chars from string s2 to the end of string s1, ; return s1. s1 is always terminated with a 0. ; ; The maximum length of s1 will be strlen(s1) + n + 1 ; ; =============================================================== SECTION code_clib SECTION code_string PUBLIC asm_strncat PUBLIC asm0_strncat EXTERN __str_locate_nul asm_strncat: ; enter : hl = char *s2 = src ; de = char *s1 = dst ; bc = size_t n ; ; exit : hl = char *s1 = dst ; de = ptr in s1 to terminating 0 ; carry set if all of s2 not appended ; ; uses : af, bc, de, hl ld a,b or c jr z, zero_n asm0_strncat: push de ; save dst ex de,hl call __str_locate_nul ; a = 0 ex de,hl loop: ; append src to dst cp (hl) jr z, done ldi jp pe, loop scf done: ; terminate dst ld (de),a pop hl ret zero_n: ld l,e ld h,d scf ret
open.agda
heades/AUGL
0
8138
module Open where open import bool open import nat open import product open import sum open import functor data Row : Set₁ where Empty : Row Ty : Set → Row Prod : Row → Row → Row infixr 19 _♯_ _′ = Ty _♯_ = Prod all : Row → Set all Empty = ⊤ all (Ty x) = x all (Prod r₁ r₂) = (all r₁) × (all r₂) one : Row → Set one Empty = ⊥ one (Ty x) = x one (Prod r₁ r₂) = (one r₁) ⊎ (one r₂) _⊗_ : {A B : Row} → all A → all B → all (A ♯ B) _⊗_ p₁ p₂ = p₁ , p₂ _&_ : {A : Set}{B : Row} → A → all B → all (A ′ ♯ B) _&_ {A}{B} = _⊗_ {A ′}{B} _⊕_ : {A B : Row} → (one A) ⊎ (one B) → one (A ♯ B) _⊕_ p = p ⊕inj₁ : {A B : Row} → one A → one (A ♯ B) ⊕inj₁ = inj₁ ⊕inj₂ : {A B : Row} → one B → one (A ♯ B) ⊕inj₂ = inj₂ inj : {A : Set}{B : Row} → A → one (A ′ ♯ B) inj {A}{B} = ⊕inj₁ {A ′}{B} test₁ : all (ℕ ′ ♯ 𝔹 ′ ♯ Empty) test₁ = _&_ {ℕ}{𝔹 ′ ♯ Empty} 1 (_&_ {𝔹}{Empty} tt triv)
source/interfaces/i-c.adb
ytomino/drake
33
18316
<reponame>ytomino/drake with Ada.Exception_Identification.From_Here; with Ada.Unchecked_Conversion; with System.C_Encoding; pragma Warnings (Off, System.C_Encoding); -- break "pure" rule with C; pragma Warnings (Off, C); -- break "pure" rule package body Interfaces.C is use Ada.Exception_Identification.From_Here; generic type Element is private; type Element_Array is array (size_t range <>) of aliased Element; type Element_Access is access constant Element; function Pointer_Add (Left : not null Element_Access; Right : ptrdiff_t) return not null Element_Access; function Pointer_Add (Left : not null Element_Access; Right : ptrdiff_t) return not null Element_Access is function To_ptrdiff_t is new Ada.Unchecked_Conversion (Element_Access, ptrdiff_t); function To_Pointer is new Ada.Unchecked_Conversion (ptrdiff_t, Element_Access); begin return To_Pointer ( To_ptrdiff_t (Left) + Right * (Element_Array'Component_Size / Standard'Storage_Unit)); end Pointer_Add; generic type Element is private; type Element_Array is array (size_t range <>) of aliased Element; type Element_Access is access constant Element; function Pointer_Sub (Left, Right : not null Element_Access) return ptrdiff_t; function Pointer_Sub (Left, Right : not null Element_Access) return ptrdiff_t is function To_ptrdiff_t is new Ada.Unchecked_Conversion (Element_Access, ptrdiff_t); begin return (To_ptrdiff_t (Left) - To_ptrdiff_t (Right)) / (Element_Array'Component_Size / Standard'Storage_Unit); end Pointer_Sub; generic type Element is (<>); type Element_Array is array (size_t range <>) of aliased Element; type Element_ptr is access constant Element; with function Find_nul (s : not null Element_ptr; n : size_t) return Element_ptr; function Generic_Is_Nul_Terminated (Item : Element_Array) return Boolean; function Generic_Is_Nul_Terminated (Item : Element_Array) return Boolean is function To_Pointer (Value : System.Address) return Element_ptr with Import, Convention => Intrinsic; -- System.Address_To_Constant_Access_Conversions is "preelaborate". nul_Pos : constant Element_ptr := Find_nul (To_Pointer (Item'Address), Item'Length); begin return nul_Pos /= null; end Generic_Is_Nul_Terminated; generic type Element is (<>); type Element_Array is array (size_t range <>) of aliased Element; type Element_ptr is access constant Element; with function Find_nul (s : not null Element_ptr; n : size_t) return Element_ptr; function Generic_Length (Item : Element_Array) return size_t; function Generic_Length (Item : Element_Array) return size_t is function "-" is new Pointer_Sub (Element, Element_Array, Element_ptr); function To_Pointer (Value : System.Address) return Element_ptr with Import, Convention => Intrinsic; -- Same as above. Item_ptr : constant Element_ptr := To_Pointer (Item'Address); nul_Pos : constant Element_ptr := Find_nul (Item_ptr, Item'Length); begin if nul_Pos = null then Raise_Exception (Terminator_Error'Identity); -- CXB3005 end if; return size_t (nul_Pos - Item_ptr); end Generic_Length; generic type Character_Type is (<>); type String_Type is array (Positive range <>) of Character_Type; type Element is (<>); type Element_Array is array (size_t range <>) of aliased Element; package Simple_Conversions is pragma Compile_Time_Error ( String_Type'Component_Size /= Element_Array'Component_Size, "size mismatch!"); procedure To_Non_Nul_Terminated ( Item : String_Type; Target : out Element_Array; Count : out size_t; Substitute : Element_Array); -- unreferenced procedure From_Non_Nul_Terminated ( Item : Element_Array; Target : out String_Type; Count : out Natural; Substitute : String_Type); -- unreferenced end Simple_Conversions; package body Simple_Conversions is procedure To_Non_Nul_Terminated ( Item : String_Type; Target : out Element_Array; Count : out size_t; Substitute : Element_Array) is pragma Unreferenced (Substitute); begin Count := Item'Length; if Count > 0 then if Count > Target'Length then raise Constraint_Error; end if; declare Item_As_C : Element_Array (0 .. Count - 1); for Item_As_C'Address use Item'Address; begin Target (Target'First .. Target'First + Count - 1) := Item_As_C; end; end if; end To_Non_Nul_Terminated; procedure From_Non_Nul_Terminated ( Item : Element_Array; Target : out String_Type; Count : out Natural; Substitute : String_Type) is pragma Unreferenced (Substitute); begin Count := Item'Length; if Count > Target'Length then raise Constraint_Error; end if; declare Item_As_Ada : String_Type (1 .. Count); for Item_As_Ada'Address use Item'Address; begin Target (Target'First .. Target'First + Count - 1) := Item_As_Ada; end; end From_Non_Nul_Terminated; end Simple_Conversions; generic type Character_Type is (<>); type String_Type is array (Positive range <>) of Character_Type; type Element is (<>); type Element_Array is array (size_t range <>) of aliased Element; with function Length (Item : Element_Array) return size_t; with procedure To_Non_Nul_Terminated ( Item : String_Type; Target : out Element_Array; Count : out size_t; Substitute : Element_Array); with procedure From_Non_Nul_Terminated ( Item : Element_Array; Target : out String_Type; Count : out Natural; Substitute : String_Type); Expanding_To_C : size_t; Expanding_To_Ada : Positive; package Functions is function To_Nul_Terminated ( Item : String_Type; Substitute : Element_Array) return Element_Array; function To_Non_Nul_Terminated ( Item : String_Type; Substitute : Element_Array) return Element_Array; function From_Nul_Terminated ( Item : Element_Array; Substitute : String_Type) return String_Type; function From_Non_Nul_Terminated ( Item : Element_Array; Substitute : String_Type) return String_Type; procedure To_Nul_Terminated ( Item : String_Type; Target : out Element_Array; Count : out size_t; Substitute : Element_Array); procedure From_Nul_Terminated ( Item : Element_Array; Target : out String_Type; Count : out Natural; Substitute : String_Type); end Functions; package body Functions is function To_Nul_Terminated ( Item : String_Type; Substitute : Element_Array) return Element_Array is Result : Element_Array ( 0 .. Item'Length * C.size_t'Max (Expanding_To_C, Substitute'Length)); -- +1 for nul Count : size_t; begin To_Non_Nul_Terminated (Item, Result, Count, Substitute => Substitute); Result (Count) := Element'Val (0); Count := Count + 1; return Result (0 .. Count - 1); end To_Nul_Terminated; function To_Non_Nul_Terminated ( Item : String_Type; Substitute : Element_Array) return Element_Array is begin if Item'Length > 0 then declare Result : Element_Array ( 0 .. Item'Length * C.size_t'Max (Expanding_To_C, Substitute'Length) - 1); Count : size_t; begin To_Non_Nul_Terminated (Item, Result, Count, Substitute => Substitute); if Count > 0 then return Result (0 .. Count - 1); end if; end; end if; raise Constraint_Error; -- RM B.3(50/2) end To_Non_Nul_Terminated; function From_Nul_Terminated ( Item : Element_Array; Substitute : String_Type) return String_Type is Item_Length : constant size_t := Length (Item); Result : String_Type ( 1 .. Natural (Item_Length) * Integer'Max (Expanding_To_Ada, Substitute'Length)); Count : Natural; begin if Item_Length = 0 then Count := 0; else From_Non_Nul_Terminated ( Item (Item'First .. Item'First + Item_Length - 1), Result, Count, Substitute => Substitute); end if; return Result (1 .. Count); end From_Nul_Terminated; function From_Non_Nul_Terminated ( Item : Element_Array; Substitute : String_Type) return String_Type is Result : String_Type ( 1 .. Item'Length * Integer'Max (Expanding_To_Ada, Substitute'Length)); Count : Natural; begin From_Non_Nul_Terminated ( Item, Result, Count, Substitute => Substitute); return Result (1 .. Count); end From_Non_Nul_Terminated; procedure To_Nul_Terminated ( Item : String_Type; Target : out Element_Array; Count : out size_t; Substitute : Element_Array) is begin To_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); Count := Count + 1; if Target'First + Count - 1 > Target'Last then raise Constraint_Error; end if; Target (Target'First + Count - 1) := Element'Val (0); end To_Nul_Terminated; procedure From_Nul_Terminated ( Item : Element_Array; Target : out String_Type; Count : out Natural; Substitute : String_Type) is Item_Length : constant size_t := Length (Item); begin if Item_Length = 0 then Count := 0; else From_Non_Nul_Terminated ( Item (Item'First .. Item'First + Item_Length - 1), Target, Count, Substitute => Substitute); end if; end From_Nul_Terminated; end Functions; -- char type char_const_ptr is access constant char; for char_const_ptr'Storage_Size use 0; function memchr ( s : not null char_const_ptr; c : int; n : size_t) return char_const_ptr with Import, Convention => Intrinsic, External_Name => "__builtin_memchr"; function Find_nul (s : not null char_const_ptr; n : size_t) return char_const_ptr; function Find_nul (s : not null char_const_ptr; n : size_t) return char_const_ptr is begin return memchr (s, 0, n); end Find_nul; procedure To_Non_Nul_Terminated ( Item : String; Target : out char_array; Count : out size_t; Substitute : char_array); procedure To_Non_Nul_Terminated ( Item : String; Target : out char_array; Count : out size_t; Substitute : char_array) is Target_As : Standard.C.char_array ( Standard.C.size_t (Target'First) .. Standard.C.size_t (Target'Last)); for Target_As'Address use Target'Address; Substitute_As : Standard.C.char_array ( Standard.C.size_t (Substitute'First) .. Standard.C.size_t (Substitute'Last)); for Substitute_As'Address use Substitute'Address; begin System.C_Encoding.To_Non_Nul_Terminated ( Item, Target_As, Standard.C.size_t (Count), Substitute => Substitute_As); end To_Non_Nul_Terminated; procedure From_Non_Nul_Terminated ( Item : char_array; Target : out String; Count : out Natural; Substitute : String); procedure From_Non_Nul_Terminated ( Item : char_array; Target : out String; Count : out Natural; Substitute : String) is Item_As : Standard.C.char_array ( Standard.C.size_t (Item'First) .. Standard.C.size_t (Item'Last)); for Item_As'Address use Item'Address; begin System.C_Encoding.From_Non_Nul_Terminated ( Item_As, Target, Count, Substitute => Substitute); end From_Non_Nul_Terminated; package char_Func is new Functions ( Character, String, char, char_array, Length, To_Non_Nul_Terminated, From_Non_Nul_Terminated, Expanding_To_C => System.C_Encoding.Expanding_To_char, Expanding_To_Ada => System.C_Encoding.Expanding_To_Character); -- wchar_t type wchar_t_const_ptr is access constant wchar_t; for wchar_t_const_ptr'Storage_Size use 0; -- libc function wmemchr ( ws : not null wchar_t_const_ptr; wc : int; n : size_t) return wchar_t_const_ptr with Import, Convention => C; function Find_nul (s : not null wchar_t_const_ptr; n : size_t) return wchar_t_const_ptr; function Find_nul (s : not null wchar_t_const_ptr; n : size_t) return wchar_t_const_ptr is begin return wmemchr (s, 0, n); end Find_nul; procedure To_Non_Nul_Terminated ( Item : Wide_String; Target : out wchar_array; Count : out size_t; Substitute : wchar_array); procedure To_Non_Nul_Terminated ( Item : Wide_String; Target : out wchar_array; Count : out size_t; Substitute : wchar_array) is Target_As : Standard.C.wchar_t_array ( Standard.C.size_t (Target'First) .. Standard.C.size_t (Target'Last)); for Target_As'Address use Target'Address; Substitute_As : Standard.C.wchar_t_array ( Standard.C.size_t (Substitute'First) .. Standard.C.size_t (Substitute'Last)); for Substitute_As'Address use Substitute'Address; begin System.C_Encoding.To_Non_Nul_Terminated ( Item, Target_As, Standard.C.size_t (Count), Substitute => Substitute_As); end To_Non_Nul_Terminated; procedure From_Non_Nul_Terminated ( Item : wchar_array; Target : out Wide_String; Count : out Natural; Substitute : Wide_String); procedure From_Non_Nul_Terminated ( Item : wchar_array; Target : out Wide_String; Count : out Natural; Substitute : Wide_String) is Item_As : Standard.C.wchar_t_array ( Standard.C.size_t (Item'First) .. Standard.C.size_t (Item'Last)); for Item_As'Address use Item'Address; begin System.C_Encoding.From_Non_Nul_Terminated ( Item_As, Target, Count, Substitute => Substitute); end From_Non_Nul_Terminated; procedure To_Non_Nul_Terminated ( Item : Wide_Wide_String; Target : out wchar_array; Count : out size_t; Substitute : wchar_array); procedure To_Non_Nul_Terminated ( Item : Wide_Wide_String; Target : out wchar_array; Count : out size_t; Substitute : wchar_array) is Target_As : Standard.C.wchar_t_array ( Standard.C.size_t (Target'First) .. Standard.C.size_t (Target'Last)); for Target_As'Address use Target'Address; Substitute_As : Standard.C.wchar_t_array ( Standard.C.size_t (Substitute'First) .. Standard.C.size_t (Substitute'Last)); for Substitute_As'Address use Substitute'Address; begin System.C_Encoding.To_Non_Nul_Terminated ( Item, Target_As, Standard.C.size_t (Count), Substitute => Substitute_As); end To_Non_Nul_Terminated; procedure From_Non_Nul_Terminated ( Item : wchar_array; Target : out Wide_Wide_String; Count : out Natural; Substitute : Wide_Wide_String); procedure From_Non_Nul_Terminated ( Item : wchar_array; Target : out Wide_Wide_String; Count : out Natural; Substitute : Wide_Wide_String) is Item_As : Standard.C.wchar_t_array ( Standard.C.size_t (Item'First) .. Standard.C.size_t (Item'Last)); for Item_As'Address use Item'Address; begin System.C_Encoding.From_Non_Nul_Terminated ( Item_As, Target, Count, Substitute => Substitute); end From_Non_Nul_Terminated; package wchar_Wide_Func is new Functions ( Wide_Character, Wide_String, wchar_t, wchar_array, Length, To_Non_Nul_Terminated, From_Non_Nul_Terminated, Expanding_To_C => System.C_Encoding.Expanding_From_Wide_To_wchar_t, Expanding_To_Ada => System.C_Encoding.Expanding_From_wchar_t_To_Wide); package wchar_Wide_Wide_Func is new Functions ( Wide_Wide_Character, Wide_Wide_String, wchar_t, wchar_array, Length, To_Non_Nul_Terminated, From_Non_Nul_Terminated, Expanding_To_C => System.C_Encoding.Expanding_From_Wide_Wide_To_wchar_t, Expanding_To_Ada => System.C_Encoding.Expanding_From_wchar_t_To_Wide_Wide); -- char16_t type char16_t_const_ptr is access constant char16_t; for char16_t_const_ptr'Storage_Size use 0; function Find_nul (s : not null char16_t_const_ptr; n : size_t) return char16_t_const_ptr; function Find_nul (s : not null char16_t_const_ptr; n : size_t) return char16_t_const_ptr is function "+" is new Pointer_Add (char16_t, char16_array, char16_t_const_ptr); p : not null char16_t_const_ptr := s; r : size_t := n; begin while r > 0 loop if p.all = char16_nul then return p; end if; p := p + 1; r := r - 1; end loop; return null; end Find_nul; package char16_Conv is new Simple_Conversions ( Wide_Character, Wide_String, char16_t, char16_array); package char16_Func is new Functions ( Wide_Character, Wide_String, char16_t, char16_array, Length, char16_Conv.To_Non_Nul_Terminated, char16_Conv.From_Non_Nul_Terminated, Expanding_To_C => 1, Expanding_To_Ada => 1); -- char32_t type char32_t_const_ptr is access constant char32_t; for char32_t_const_ptr'Storage_Size use 0; function Find_nul (s : not null char32_t_const_ptr; n : size_t) return char32_t_const_ptr; function Find_nul (s : not null char32_t_const_ptr; n : size_t) return char32_t_const_ptr is function "+" is new Pointer_Add (char32_t, char32_array, char32_t_const_ptr); p : not null char32_t_const_ptr := s; r : size_t := n; begin while r > 0 loop if p.all = char32_nul then return p; end if; p := p + 1; r := r - 1; end loop; return null; end Find_nul; package char32_Conv is new Simple_Conversions ( Wide_Wide_Character, Wide_Wide_String, char32_t, char32_array); package char32_Func is new Functions ( Wide_Wide_Character, Wide_Wide_String, char32_t, char32_array, Length, char32_Conv.To_Non_Nul_Terminated, char32_Conv.From_Non_Nul_Terminated, Expanding_To_C => 1, Expanding_To_Ada => 1); -- implementation of Characters and Strings function To_char ( Item : Character; Substitute : char) return char is begin return char ( System.C_Encoding.To_char ( Item, Substitute => Standard.C.char (Substitute))); end To_char; function To_char ( Item : Character) return char is begin return To_char (Item, Substitute => '?'); end To_char; function To_Character ( Item : char; Substitute : Character) return Character is begin return System.C_Encoding.To_Character ( Standard.C.char (Item), Substitute => Substitute); end To_Character; function To_Character ( Item : char) return Character is begin return To_Character (Item, Substitute => '?'); end To_Character; function Is_Nul_Terminated (Item : char_array) return Boolean is function Is_Nul_Terminated_char_array is new Generic_Is_Nul_Terminated ( char, char_array, char_const_ptr, Find_nul); begin return Is_Nul_Terminated_char_array (Item); end Is_Nul_Terminated; function Length (Item : char_array) return size_t is function Length_char_array is new Generic_Length ( char, char_array, char_const_ptr, Find_nul); pragma Inline_Always (Length_char_array); begin return Length_char_array (Item); end Length; function To_char_array ( Item : String; Append_Nul : Boolean := True; Substitute : char_array := (0 => '?')) return char_array is begin if Append_Nul then return char_Func.To_Nul_Terminated (Item, Substitute => Substitute); else return char_Func.To_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_char_array; function To_String ( Item : char_array; Trim_Nul : Boolean := True; Substitute : String := "?") return String is begin if Trim_Nul then return char_Func.From_Nul_Terminated (Item, Substitute => Substitute); else return char_Func.From_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_String; procedure To_char_array ( Item : String; Target : out char_array; Count : out size_t; Append_Nul : Boolean := True; Substitute : char_array := (0 => '?')) is begin if Append_Nul then char_Func.To_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else To_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_char_array; procedure To_String ( Item : char_array; Target : out String; Count : out Natural; Trim_Nul : Boolean := True; Substitute : String := "?") is begin if Trim_Nul then char_Func.From_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else From_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_String; -- implementation of Wide Character and Wide String function To_wchar_t ( Item : Wide_Character; Substitute : wchar_t) return wchar_t is begin return Standard.C.wchar_t'Pos ( System.C_Encoding.To_wchar_t ( Item, Substitute => Standard.C.wchar_t'Val (Substitute))); end To_wchar_t; function To_wchar_t ( Item : Wide_Character) return wchar_t is begin return To_wchar_t (Item, Substitute => Character'Pos ('?')); end To_wchar_t; function To_Wide_Character ( Item : wchar_t; Substitute : Wide_Character) return Wide_Character is begin return System.C_Encoding.To_Wide_Character ( Standard.C.wchar_t'Val (Item), Substitute => Substitute); end To_Wide_Character; function To_Wide_Character ( Item : wchar_t) return Wide_Character is begin return To_Wide_Character (Item, Substitute => '?'); end To_Wide_Character; function Is_Nul_Terminated (Item : wchar_array) return Boolean is function Is_Nul_Terminated_wchar_array is new Generic_Is_Nul_Terminated ( wchar_t, wchar_array, wchar_t_const_ptr, Find_nul); begin return Is_Nul_Terminated_wchar_array (Item); end Is_Nul_Terminated; function Length (Item : wchar_array) return size_t is function Length_wchar_array is new Generic_Length ( wchar_t, wchar_array, wchar_t_const_ptr, Find_nul); pragma Inline_Always (Length_wchar_array); begin return Length_wchar_array (Item); end Length; function To_wchar_array ( Item : Wide_String; Append_Nul : Boolean := True; Substitute : wchar_array := (0 => Character'Pos ('?'))) return wchar_array is begin if Append_Nul then return wchar_Wide_Func.To_Nul_Terminated (Item, Substitute => Substitute); else return wchar_Wide_Func.To_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_wchar_array; function To_Wide_String ( Item : wchar_array; Trim_Nul : Boolean := True; Substitute : Wide_String := "?") return Wide_String is begin if Trim_Nul then return wchar_Wide_Func.From_Nul_Terminated (Item, Substitute => Substitute); else return wchar_Wide_Func.From_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_Wide_String; procedure To_wchar_array ( Item : Wide_String; Target : out wchar_array; Count : out size_t; Append_Nul : Boolean := True; Substitute : wchar_array := (0 => Character'Pos ('?'))) is begin if Append_Nul then wchar_Wide_Func.To_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else To_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_wchar_array; procedure To_Wide_String ( Item : wchar_array; Target : out Wide_String; Count : out Natural; Trim_Nul : Boolean := True; Substitute : Wide_String := "?") is begin if Trim_Nul then wchar_Wide_Func.From_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else From_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_Wide_String; -- implementation of Wide Wide Character and Wide Wide String function To_wchar_t ( Item : Wide_Wide_Character; Substitute : wchar_t := Character'Pos ('?')) return wchar_t is begin return Standard.C.wchar_t'Pos ( System.C_Encoding.To_wchar_t ( Item, Substitute => Standard.C.wchar_t'Val (Substitute))); end To_wchar_t; function To_Wide_Wide_Character ( Item : wchar_t; Substitute : Wide_Wide_Character := '?') return Wide_Wide_Character is begin return System.C_Encoding.To_Wide_Wide_Character ( Standard.C.wchar_t'Val (Item), Substitute => Substitute); end To_Wide_Wide_Character; function To_wchar_array ( Item : Wide_Wide_String; Append_Nul : Boolean := True; Substitute : wchar_array := (0 => Character'Pos ('?'))) return wchar_array is begin if Append_Nul then return wchar_Wide_Wide_Func.To_Nul_Terminated (Item, Substitute => Substitute); else return wchar_Wide_Wide_Func.To_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_wchar_array; function To_Wide_Wide_String ( Item : wchar_array; Trim_Nul : Boolean := True; Substitute : Wide_Wide_String := "?") return Wide_Wide_String is begin if Trim_Nul then return wchar_Wide_Wide_Func.From_Nul_Terminated (Item, Substitute => Substitute); else return wchar_Wide_Wide_Func.From_Non_Nul_Terminated (Item, Substitute => Substitute); end if; end To_Wide_Wide_String; procedure To_wchar_array ( Item : Wide_Wide_String; Target : out wchar_array; Count : out size_t; Append_Nul : Boolean := True; Substitute : wchar_array := (0 => Character'Pos ('?'))) is begin if Append_Nul then wchar_Wide_Wide_Func.To_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else To_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_wchar_array; procedure To_Wide_Wide_String ( Item : wchar_array; Target : out Wide_Wide_String; Count : out Natural; Trim_Nul : Boolean := True; Substitute : Wide_Wide_String := "?") is begin if Trim_Nul then wchar_Wide_Wide_Func.From_Nul_Terminated (Item, Target, Count, Substitute => Substitute); else From_Non_Nul_Terminated (Item, Target, Count, Substitute => Substitute); end if; end To_Wide_Wide_String; -- implementation of -- ISO/IEC 10646:2003 compatible types defined by ISO/IEC TR 19769:2004. -- Wide_Character (UTF-16) from/to char16_t (UTF-16) function To_C (Item : Wide_Character) return char16_t is begin return char16_t (Item); end To_C; function To_Ada (Item : char16_t) return Wide_Character is begin return Wide_Character (Item); end To_Ada; function Is_Nul_Terminated (Item : char16_array) return Boolean is function Is_Nul_Terminated_char16_array is new Generic_Is_Nul_Terminated ( char16_t, char16_array, char16_t_const_ptr, Find_nul); begin return Is_Nul_Terminated_char16_array (Item); end Is_Nul_Terminated; function Length (Item : char16_array) return size_t is function Length_char16_array is new Generic_Length ( char16_t, char16_array, char16_t_const_ptr, Find_nul); pragma Inline_Always (Length_char16_array); begin return Length_char16_array (Item); end Length; function To_C ( Item : Wide_String; Append_Nul : Boolean := True; Substitute : char16_array := "?") return char16_array is pragma Unreferenced (Substitute); begin if Append_Nul then return char16_Func.To_Nul_Terminated (Item, Substitute => (1 .. 0 => <>)); -- unreferenced else return char16_Func.To_Non_Nul_Terminated (Item, Substitute => (1 .. 0 => <>)); -- unreferenced end if; end To_C; function To_Ada ( Item : char16_array; Trim_Nul : Boolean := True; Substitute : Wide_String := "?") return Wide_String is pragma Unreferenced (Substitute); begin if Trim_Nul then return char16_Func.From_Nul_Terminated (Item, Substitute => ""); -- unreferenced else return char16_Func.From_Non_Nul_Terminated (Item, Substitute => ""); -- unreferenced end if; end To_Ada; procedure To_C ( Item : Wide_String; Target : out char16_array; Count : out size_t; Append_Nul : Boolean := True; Substitute : char16_array := "?") is pragma Unreferenced (Substitute); begin if Append_Nul then char16_Func.To_Nul_Terminated (Item, Target, Count, Substitute => (1 .. 0 => <>)); -- unreferenced else char16_Conv.To_Non_Nul_Terminated (Item, Target, Count, Substitute => (1 .. 0 => <>)); -- unreferenced end if; end To_C; procedure To_Ada ( Item : char16_array; Target : out Wide_String; Count : out Natural; Trim_Nul : Boolean := True; Substitute : Wide_String := "?") is pragma Unreferenced (Substitute); begin if Trim_Nul then char16_Func.From_Nul_Terminated (Item, Target, Count, Substitute => ""); -- unreferenced else char16_Conv.From_Non_Nul_Terminated (Item, Target, Count, Substitute => ""); -- unreferenced end if; end To_Ada; -- Wide_Wide_Character (UTF-32) from/to char32_t (UTF-32) function To_C (Item : Wide_Wide_Character) return char32_t is begin return char32_t (Item); end To_C; function To_Ada (Item : char32_t) return Wide_Wide_Character is begin return Wide_Wide_Character (Item); end To_Ada; function Is_Nul_Terminated (Item : char32_array) return Boolean is function Is_Nul_Terminated_char32_array is new Generic_Is_Nul_Terminated ( char32_t, char32_array, char32_t_const_ptr, Find_nul); begin return Is_Nul_Terminated_char32_array (Item); end Is_Nul_Terminated; function Length (Item : char32_array) return size_t is function Length_char32_array is new Generic_Length ( char32_t, char32_array, char32_t_const_ptr, Find_nul); pragma Inline_Always (Length_char32_array); begin return Length_char32_array (Item); end Length; function To_C ( Item : Wide_Wide_String; Append_Nul : Boolean := True; Substitute : char32_array := "?") return char32_array is pragma Unreferenced (Substitute); begin if Append_Nul then return char32_Func.To_Nul_Terminated (Item, Substitute => (1 .. 0 => <>)); -- unreferenced else return char32_Func.To_Non_Nul_Terminated (Item, Substitute => (1 .. 0 => <>)); -- unreferenced end if; end To_C; function To_Ada ( Item : char32_array; Trim_Nul : Boolean := True; Substitute : Wide_Wide_String := "?") return Wide_Wide_String is pragma Unreferenced (Substitute); begin if Trim_Nul then return char32_Func.From_Nul_Terminated (Item, Substitute => ""); -- unreferenced else return char32_Func.From_Non_Nul_Terminated (Item, Substitute => ""); -- unreferenced end if; end To_Ada; procedure To_C ( Item : Wide_Wide_String; Target : out char32_array; Count : out size_t; Append_Nul : Boolean := True; Substitute : char32_array := "?") is pragma Unreferenced (Substitute); begin if Append_Nul then char32_Func.To_Nul_Terminated (Item, Target, Count, Substitute => (1 .. 0 => <>)); -- unreferenced else char32_Conv.To_Non_Nul_Terminated (Item, Target, Count, Substitute => (1 .. 0 => <>)); -- unreferenced end if; end To_C; procedure To_Ada ( Item : char32_array; Target : out Wide_Wide_String; Count : out Natural; Trim_Nul : Boolean := True; Substitute : Wide_Wide_String := "?") is pragma Unreferenced (Substitute); begin if Trim_Nul then char32_Func.From_Nul_Terminated (Item, Target, Count, Substitute => ""); -- unreferenced else char32_Conv.From_Non_Nul_Terminated (Item, Target, Count, Substitute => ""); -- unreferenced end if; end To_Ada; end Interfaces.C;
tier-1/gmp/source/gmp-discrete.adb
charlie5/cBound
2
19330
<reponame>charlie5/cBound with gmp_c.Binding; with ada.Unchecked_Deallocation; with gmp_c.a_a_mpf_struct; with gmp_c.a_a_mpz_struct; with gmp_c.mpz_srcptr; with gmp_c.mpz_ptr; with interfaces.C.strings; with Interfaces.C.Strings; use Interfaces.C.Strings; package body GMP.discrete -- -- -- is use gmp_c.Binding; use gmp_c.mpz_t; use interfaces.C; package C renames interfaces.C; -- Private subprograms specs -- function Data (Self : in Integer) return gmp_c.mpz_srcptr.item; -- function Data (Self : in Integer) return gmp_c.mpz_ptr.item; -- forge -- procedure define (Self : in out Integer) is begin self.Lean := new gmp_c.mpz_t.item; init (Self.lean (0)'access); end; procedure define (Self : in out Integer; Value : in long_long_Integer) is begin self.Lean := new gmp_c.mpz_t.item; init_set_si (Data (Self), c.Long (Value)); end; procedure define (Self : in out Integer; Value : in discrete.Integer) is begin self.Lean := new gmp_c.mpz_t.item; init_set (Data (Self), Data (Value)); end; function to_Integer return Integer is Self : Integer; begin define (Self); return Self; end; function to_Integer (From : long_long_Integer) return Integer is Self : Integer; begin define (Self, From); return Self; end; function to_Integer (From : discrete.Integer) return Integer is Self : Integer; begin define (Self, From); return Self; end; procedure destroy (Self : in out Integer) is procedure deallocate is new ada.Unchecked_Deallocation (gmp_c.mpz_t.item, gmp_c.mpz_t.pointer); begin clear (Self.lean (0)'access); deallocate (self.Lean); end; -- Attributes -- function Data (Self : in Integer) return gmp_c.mpz_srcptr.item is lean_Src : gmp_c.a_a_mpz_struct.Pointer := Self.lean (0)'access; begin return gmp_c.mpz_srcptr.item (lean_Src); end; -- function Data (Self : in Integer) return gmp_c.mpz_ptr.item -- is -- lean_Src : gmp_c.a_a_mpz_struct.view := Self.lean (0)'access; -- begin -- return gmp_c.a_a_mpz_struct.mpz_ptr (lean_Src); -- end; function Value (Self : in Integer) return long_long_Integer is begin return long_long_Integer (get_si (Data (Self))); end; function Image (Self : in Integer) return String is Image_c : c.Strings.chars_ptr := get_Str (c.strings.null_Ptr, 10, Data (Self)); Result : String := Value (Image_c); begin free (Image_c); return Result; end; function hex_Image (Self : in Integer) return String is Image_c : c.Strings.chars_ptr := get_Str (c.strings.null_Ptr, 16, Data (Self)); Result : String := "16#" & Value (Image_c) & "#"; begin free (Image_c); return Result; end; function oct_Image (Self : in Integer) return String is Image_c : c.Strings.chars_ptr := get_Str (c.strings.null_Ptr, 8, Data (Self)); Result : String := "8#" & Value (Image_c) & "#"; begin free (Image_c); return Result; end; -- Operations -- function "=" (Left, Right : in Integer) return Boolean is begin return cmp (Data (Left), Data (Right)) = 0; end; function "<" (Left, Right : in Integer) return Boolean is begin return cmp (Data (Left), Data (Right)) = -1; end; function "**" (Left : in Integer; Right : in long_long_Integer) return Integer is Result : Integer := to_Integer; begin pow_ui (Data (Result), Data (Left), c.unsigned_Long (Right)); return Result; end; function "*" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin mul (Data (Result), Data (Left), Data (Right)); return Result; end; function "/" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin cdiv_q (Data (Result), Data (Left), Data (Right)); return Result; end; function "+" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin add (Data (Result), Data (Left), Data (Right)); return Result; end; function "-" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin sub (Data (Result), Data (Left), Data (Right)); return Result; end; function "or" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin ior (Data (Result), Data (Left), Data (Right)); return Result; end; function "xor" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin z_xor (Data (Result), Data (Left), Data (Right)); return Result; end; function "and" (Left, Right : in Integer) return Integer is Result : Integer := to_Integer; begin z_and (Data (Result), Data (Left), Data (Right)); return Result; end; -- Unary operators -- function "-" (Self : in Integer) return Integer is Result : Integer := to_Integer; begin neg (Data (Result), Data (Self)); return Result; end; function "not" (Self : in Integer) return Integer is Result : Integer := to_Integer; begin com (Data (Result), Data (Self)); return Result; end; end GMP.Discrete;
配套代码/SQLite_L20/SQLite_20/1.asm
zmrbak/SQLiteReverse
84
94204
<filename>配套代码/SQLite_L20/SQLite_20/1.asm ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.24.28117.0 TITLE C:\Users\libit\source\repos\SQLite_20\SQLite_20\SQLite_20.cpp .686P .XMM include listing.inc .model flat INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?index@@3HA ; index _BSS SEGMENT ?index@@3HA DD 01H DUP (?) ; index _BSS ENDS CONST SEGMENT $SG5563 DB 'e_f: %d,%d,%d,%d,%d', 0aH, 00H ORG $+3 $SG5583 DB 'Hello World!', 0aH, 00H ORG $+2 $SG5584 DB 'sqlite3_exec:0x%p', 0aH, 00H ORG $+1 $SG5585 DB 'e_f:0x%p', 0aH, 00H ORG $+2 $SG5586 DB 'c_f:0x%p', 0aH, 00H CONST ENDS PUBLIC ___local_stdio_printf_options PUBLIC __vfprintf_l PUBLIC _printf PUBLIC ?e_f@@YGHHHHH@Z ; e_f PUBLIC ?c_f@@YAHHHHH@Z ; c_f PUBLIC ?sqlite3_exec@@YAHHHP6AHHHHH@ZHH@Z ; sqlite3_exec PUBLIC _main PUBLIC ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage EXTRN ___acrt_iob_func:PROC EXTRN _getchar:PROC EXTRN ___stdio_common_vfprintf:PROC ; COMDAT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA _BSS SEGMENT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA DQ 01H DUP (?) ; `__local_stdio_printf_options'::`2'::_OptionsStorage _BSS ENDS ; Function compile flags: /Odtp _TEXT SEGMENT _main PROC ; File C:\Users\libit\source\repos\SQLite_20\SQLite_20\SQLite_20.cpp ; Line 32 push ebp mov ebp, esp ; Line 33 push OFFSET $SG5583 call _printf add esp, 4 ; Line 34 push 0 push 0 push OFFSET ?c_f@@YAHHHHH@Z ; c_f push 0 push 0 call ?sqlite3_exec@@YAHHHP6AHHHHH@ZHH@Z ; sqlite3_exec add esp, 20 ; 00000014H ; Line 35 push OFFSET ?sqlite3_exec@@YAHHHP6AHHHHH@ZHH@Z ; sqlite3_exec push OFFSET $SG5584 call _printf add esp, 8 ; Line 36 push OFFSET ?e_f@@YGHHHHH@Z ; e_f push OFFSET $SG5585 call _printf add esp, 8 ; Line 37 push OFFSET ?c_f@@YAHHHHH@Z ; c_f push OFFSET $SG5586 call _printf add esp, 8 ; Line 38 call _getchar ; Line 39 xor eax, eax pop ebp ret 0 _main ENDP _TEXT ENDS ; Function compile flags: /Odtp _TEXT SEGMENT _i$1 = -4 ; size = 4 _db$ = 8 ; size = 4 _sql$ = 12 ; size = 4 _callback$ = 16 ; size = 4 _argument$ = 20 ; size = 4 _errmsg$ = 24 ; size = 4 ?sqlite3_exec@@YAHHHP6AHHHHH@ZHH@Z PROC ; sqlite3_exec ; File C:\Users\libit\source\repos\SQLite_20\SQLite_20\SQLite_20.cpp ; Line 23 push ebp mov ebp, esp push ecx ; Line 24 mov DWORD PTR _i$1[ebp], 0 jmp SHORT $LN4@sqlite3_ex $LN2@sqlite3_ex: mov eax, DWORD PTR _i$1[ebp] add eax, 1 mov DWORD PTR _i$1[ebp], eax $LN4@sqlite3_ex: cmp DWORD PTR _i$1[ebp], 5 jae SHORT $LN3@sqlite3_ex ; Line 26 push 4 push 3 push 2 push 1 call DWORD PTR _callback$[ebp] add esp, 16 ; 00000010H ; Line 27 jmp SHORT $LN2@sqlite3_ex $LN3@sqlite3_ex: ; Line 28 xor eax, eax ; Line 29 mov esp, ebp pop ebp ret 0 ?sqlite3_exec@@YAHHHP6AHHHHH@ZHH@Z ENDP ; sqlite3_exec _TEXT ENDS ; Function compile flags: /Odtp _TEXT SEGMENT _a$ = 8 ; size = 4 _b$ = 12 ; size = 4 _c$ = 16 ; size = 4 _d$ = 20 ; size = 4 ?c_f@@YAHHHHH@Z PROC ; c_f ; File C:\Users\libit\source\repos\SQLite_20\SQLite_20\SQLite_20.cpp ; Line 18 push ebp mov ebp, esp ; Line 19 mov eax, DWORD PTR _d$[ebp] push eax mov ecx, DWORD PTR _c$[ebp] push ecx mov edx, DWORD PTR _b$[ebp] push edx mov eax, DWORD PTR _a$[ebp] push eax call ?e_f@@YGHHHHH@Z ; e_f ; Line 20 pop ebp ret 0 ?c_f@@YAHHHHH@Z ENDP ; c_f _TEXT ENDS ; Function compile flags: /Odtp _TEXT SEGMENT _a$ = 8 ; size = 4 _b$ = 12 ; size = 4 _c$ = 16 ; size = 4 _d$ = 20 ; size = 4 ?e_f@@YGHHHHH@Z PROC ; e_f ; File C:\Users\libit\source\repos\SQLite_20\SQLite_20\SQLite_20.cpp ; Line 11 push ebp mov ebp, esp ; Line 12 mov eax, DWORD PTR ?index@@3HA ; index add eax, 1 mov DWORD PTR ?index@@3HA, eax ; index ; Line 13 mov ecx, DWORD PTR _d$[ebp] push ecx mov edx, DWORD PTR _c$[ebp] push edx mov eax, DWORD PTR _b$[ebp] push eax mov ecx, DWORD PTR _a$[ebp] push ecx mov edx, DWORD PTR ?index@@3HA ; index push edx push OFFSET $SG5563 call _printf add esp, 24 ; 00000018H ; Line 14 xor eax, eax ; Line 15 pop ebp ret 16 ; 00000010H ?e_f@@YGHHHHH@Z ENDP ; e_f _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT _printf _TEXT SEGMENT __Result$ = -8 ; size = 4 __ArgList$ = -4 ; size = 4 __Format$ = 8 ; size = 4 _printf PROC ; COMDAT ; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h ; Line 954 push ebp mov ebp, esp sub esp, 8 ; Line 957 lea eax, DWORD PTR __Format$[ebp+4] mov DWORD PTR __ArgList$[ebp], eax ; Line 958 mov ecx, DWORD PTR __ArgList$[ebp] push ecx push 0 mov edx, DWORD PTR __Format$[ebp] push edx push 1 call ___acrt_iob_func add esp, 4 push eax call __vfprintf_l add esp, 16 ; 00000010H mov DWORD PTR __Result$[ebp], eax ; Line 959 mov DWORD PTR __ArgList$[ebp], 0 ; Line 960 mov eax, DWORD PTR __Result$[ebp] ; Line 961 mov esp, ebp pop ebp ret 0 _printf ENDP _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT __vfprintf_l _TEXT SEGMENT __Stream$ = 8 ; size = 4 __Format$ = 12 ; size = 4 __Locale$ = 16 ; size = 4 __ArgList$ = 20 ; size = 4 __vfprintf_l PROC ; COMDAT ; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h ; Line 642 push ebp mov ebp, esp ; Line 643 mov eax, DWORD PTR __ArgList$[ebp] push eax mov ecx, DWORD PTR __Locale$[ebp] push ecx mov edx, DWORD PTR __Format$[ebp] push edx mov eax, DWORD PTR __Stream$[ebp] push eax call ___local_stdio_printf_options mov ecx, DWORD PTR [eax+4] push ecx mov edx, DWORD PTR [eax] push edx call ___stdio_common_vfprintf add esp, 24 ; 00000018H ; Line 644 pop ebp ret 0 __vfprintf_l ENDP _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ___local_stdio_printf_options _TEXT SEGMENT ___local_stdio_printf_options PROC ; COMDAT ; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_stdio_config.h ; Line 86 push ebp mov ebp, esp ; Line 88 mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage ; Line 89 pop ebp ret 0 ___local_stdio_printf_options ENDP _TEXT ENDS END
asm/donghyeok/5/asm_gio/source/asm_ctrl_interrupt.asm
daeroro/IntegrationProject
0
26053
;------------------------------------------------------------------------------- ; user disable interrupt by kimdonghyeok ; 2019-05-03 ;------------------------------------------------------------------------------- .text .arm ;------------------------------------------------------------------------------- ; user disable interrupt .global _disable_ALL_interrupt_ .asmfunc _disable_ALL_interrupt_ ; cpsid i //i-irq f-fiq cpsid if ;i-irq f-fiq ; cps #17 ; mrs r1, spsr ; orr r1, r1, #0xc0 ; msr spsr_cxsf, r1 bx lr .endasmfunc ;-------------------------------------------------------------------------------
src/shared/generic/lsc-internal-sha256.adb
Componolit/libsparkcrypto
30
17300
<reponame>Componolit/libsparkcrypto ------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2010, <NAME> -- Copyright (C) 2010, secunet Security Networks AG -- 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 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. ------------------------------------------------------------------------------- with Interfaces; with LSC.Internal.Byteorder32; with LSC.Internal.SHA256.Tables; with LSC.Internal.Pad32; with LSC.Internal.Debug; pragma Unreferenced (LSC.Internal.Debug); package body LSC.Internal.SHA256 is function Init_Data_Length return Data_Length; function Init_Data_Length return Data_Length is begin return Data_Length'(0, 0); end Init_Data_Length; ---------------------------------------------------------------------------- procedure Add (Item : in out Data_Length; Value : in Types.Word32) with Depends => (Item =>+ Value), Inline; procedure Add (Item : in out Data_Length; Value : in Types.Word32) is begin if Item.LSW > Types.Word32'Last - Value then Item.MSW := Item.MSW + 1; end if; Item.LSW := Item.LSW + Value; end Add; ---------------------------------------------------------------------------- function Ch (x : Types.Word32; y : Types.Word32; z : Types.Word32) return Types.Word32 with Post => Ch'Result = ((x and y) xor ((not x) and z)), Inline; function Ch (x : Types.Word32; y : Types.Word32; z : Types.Word32) return Types.Word32 is begin return (x and y) xor ((not x) and z); end Ch; ---------------------------------------------------------------------------- function Maj (x : Types.Word32; y : Types.Word32; z : Types.Word32) return Types.Word32 with Post => Maj'Result = ((x and y) xor (x and z) xor (y and z)), Inline; function Maj (x : Types.Word32; y : Types.Word32; z : Types.Word32) return Types.Word32 is begin return (x and y) xor (x and z) xor (y and z); end Maj; ---------------------------------------------------------------------------- function Cap_Sigma_0_256 (x : Types.Word32) return Types.Word32 is begin return Interfaces.Rotate_Right (x, 2) xor Interfaces.Rotate_Right (x, 13) xor Interfaces.Rotate_Right (x, 22); end Cap_Sigma_0_256; pragma Inline (Cap_Sigma_0_256); ---------------------------------------------------------------------------- function Cap_Sigma_1_256 (x : Types.Word32) return Types.Word32 is begin return Interfaces.Rotate_Right (x, 6) xor Interfaces.Rotate_Right (x, 11) xor Interfaces.Rotate_Right (x, 25); end Cap_Sigma_1_256; pragma Inline (Cap_Sigma_1_256); ---------------------------------------------------------------------------- function Sigma_0_256 (x : Types.Word32) return Types.Word32 is begin return Interfaces.Rotate_Right (x, 7) xor Interfaces.Rotate_Right (x, 18) xor Interfaces.Shift_Right (x, 3); end Sigma_0_256; pragma Inline (Sigma_0_256); ---------------------------------------------------------------------------- function Sigma_1_256 (x : Types.Word32) return Types.Word32 is begin return Interfaces.Rotate_Right (x, 17) xor Interfaces.Rotate_Right (x, 19) xor Interfaces.Shift_Right (x, 10); end Sigma_1_256; pragma Inline (Sigma_1_256); ---------------------------------------------------------------------------- function SHA256_Context_Init return Context_Type is begin return Context_Type' (Length => Init_Data_Length, H => SHA256_Hash_Type'(0 => 16#6a09e667#, 1 => 16#bb67ae85#, 2 => 16#3c6ef372#, 3 => 16#a54ff53a#, 4 => 16#510e527f#, 5 => 16#9b05688c#, 6 => 16#1f83d9ab#, 7 => 16#5be0cd19#), W => Null_Schedule); end SHA256_Context_Init; ---------------------------------------------------------------------------- procedure Context_Update_Internal (Context : in out Context_Type; Block : in Block_Type) with Depends => (Context =>+ Block); procedure Context_Update_Internal (Context : in out Context_Type; Block : in Block_Type) is a, b, c, d, e, f, g, h : Types.Word32; procedure SHA256_Op (r : in Schedule_Index; a0 : in Types.Word32; a1 : in Types.Word32; a2 : in Types.Word32; a3 : in out Types.Word32; a4 : in Types.Word32; a5 : in Types.Word32; a6 : in Types.Word32; a7 : in out Types.Word32) with Global => Context, Depends => (a3 =>+ (a4, a5, a6, a7, r, Context), a7 => (a0, a1, a2, a4, a5, a6, a7, r, Context)); procedure SHA256_Op (r : in Schedule_Index; a0 : in Types.Word32; a1 : in Types.Word32; a2 : in Types.Word32; a3 : in out Types.Word32; a4 : in Types.Word32; a5 : in Types.Word32; a6 : in Types.Word32; a7 : in out Types.Word32) is T1, T2 : Types.Word32; begin T1 := a7 + Cap_Sigma_1_256 (a4) + Ch (a4, a5, a6) + Tables.K (r) + Context.W (r); T2 := Cap_Sigma_0_256 (a0) + Maj (a0, a1, a2); a3 := a3 + T1; a7 := T1 + T2; end SHA256_Op; begin pragma Debug (Debug.Put_Line ("BLOCK UPDATE:")); -- Print out initial state of H pragma Debug (Debug.Put_Line ("SHA-256 initial hash values:")); pragma Debug (Debug.Print_Word32_Array (Context.H, 2, Types.Index'Last, True)); ------------------------------------------- -- Section 6.3.2 SHA-256 Hash Computations ------------------------------------------- -- 1. Prepare the message schedule, Context.W(t): for t in Schedule_Index range 0 .. 15 loop Context.W (t) := Byteorder32.Native_To_BE (Block (t)); end loop; for t in Schedule_Index range 16 .. 63 loop Context.W (t) := Sigma_1_256 (Context.W (t - 2)) + Context.W (t - 7) + Sigma_0_256 (Context.W (t - 15)) + Context.W (t - 16); end loop; pragma Debug (Debug.Put_Line ("Message block:")); pragma Debug (Debug.Print_Word32_Array (Context.W, 2, 8, True)); -- 2. Initialize the eight working variables a, b, c, d, e, f, g, and -- h with the (i-1)st hash value: a := Context.H (0); b := Context.H (1); c := Context.H (2); d := Context.H (3); e := Context.H (4); f := Context.H (5); g := Context.H (6); h := Context.H (7); -- 3. For t = 0 to 63: SHA256_Op (0, a, b, c, d, e, f, g, h); SHA256_Op (1, h, a, b, c, d, e, f, g); SHA256_Op (2, g, h, a, b, c, d, e, f); SHA256_Op (3, f, g, h, a, b, c, d, e); SHA256_Op (4, e, f, g, h, a, b, c, d); SHA256_Op (5, d, e, f, g, h, a, b, c); SHA256_Op (6, c, d, e, f, g, h, a, b); SHA256_Op (7, b, c, d, e, f, g, h, a); SHA256_Op (8, a, b, c, d, e, f, g, h); SHA256_Op (9, h, a, b, c, d, e, f, g); SHA256_Op (10, g, h, a, b, c, d, e, f); SHA256_Op (11, f, g, h, a, b, c, d, e); SHA256_Op (12, e, f, g, h, a, b, c, d); SHA256_Op (13, d, e, f, g, h, a, b, c); SHA256_Op (14, c, d, e, f, g, h, a, b); SHA256_Op (15, b, c, d, e, f, g, h, a); SHA256_Op (16, a, b, c, d, e, f, g, h); SHA256_Op (17, h, a, b, c, d, e, f, g); SHA256_Op (18, g, h, a, b, c, d, e, f); SHA256_Op (19, f, g, h, a, b, c, d, e); SHA256_Op (20, e, f, g, h, a, b, c, d); SHA256_Op (21, d, e, f, g, h, a, b, c); SHA256_Op (22, c, d, e, f, g, h, a, b); SHA256_Op (23, b, c, d, e, f, g, h, a); SHA256_Op (24, a, b, c, d, e, f, g, h); SHA256_Op (25, h, a, b, c, d, e, f, g); SHA256_Op (26, g, h, a, b, c, d, e, f); SHA256_Op (27, f, g, h, a, b, c, d, e); SHA256_Op (28, e, f, g, h, a, b, c, d); SHA256_Op (29, d, e, f, g, h, a, b, c); SHA256_Op (30, c, d, e, f, g, h, a, b); SHA256_Op (31, b, c, d, e, f, g, h, a); SHA256_Op (32, a, b, c, d, e, f, g, h); SHA256_Op (33, h, a, b, c, d, e, f, g); SHA256_Op (34, g, h, a, b, c, d, e, f); SHA256_Op (35, f, g, h, a, b, c, d, e); SHA256_Op (36, e, f, g, h, a, b, c, d); SHA256_Op (37, d, e, f, g, h, a, b, c); SHA256_Op (38, c, d, e, f, g, h, a, b); SHA256_Op (39, b, c, d, e, f, g, h, a); SHA256_Op (40, a, b, c, d, e, f, g, h); SHA256_Op (41, h, a, b, c, d, e, f, g); SHA256_Op (42, g, h, a, b, c, d, e, f); SHA256_Op (43, f, g, h, a, b, c, d, e); SHA256_Op (44, e, f, g, h, a, b, c, d); SHA256_Op (45, d, e, f, g, h, a, b, c); SHA256_Op (46, c, d, e, f, g, h, a, b); SHA256_Op (47, b, c, d, e, f, g, h, a); SHA256_Op (48, a, b, c, d, e, f, g, h); SHA256_Op (49, h, a, b, c, d, e, f, g); SHA256_Op (50, g, h, a, b, c, d, e, f); SHA256_Op (51, f, g, h, a, b, c, d, e); SHA256_Op (52, e, f, g, h, a, b, c, d); SHA256_Op (53, d, e, f, g, h, a, b, c); SHA256_Op (54, c, d, e, f, g, h, a, b); SHA256_Op (55, b, c, d, e, f, g, h, a); SHA256_Op (56, a, b, c, d, e, f, g, h); SHA256_Op (57, h, a, b, c, d, e, f, g); SHA256_Op (58, g, h, a, b, c, d, e, f); SHA256_Op (59, f, g, h, a, b, c, d, e); SHA256_Op (60, e, f, g, h, a, b, c, d); SHA256_Op (61, d, e, f, g, h, a, b, c); SHA256_Op (62, c, d, e, f, g, h, a, b); SHA256_Op (63, b, c, d, e, f, g, h, a); -- 4. Compute the i-th intermediate hash value H-i: Context.H := SHA256_Hash_Type' (0 => a + Context.H (0), 1 => b + Context.H (1), 2 => c + Context.H (2), 3 => d + Context.H (3), 4 => e + Context.H (4), 5 => f + Context.H (5), 6 => g + Context.H (6), 7 => h + Context.H (7)); pragma Debug (Debug.Put_Line ("SHA-256 final hash values:")); pragma Debug (Debug.Print_Word32_Array (Context.H, 2, Types.Index'Last, True)); end Context_Update_Internal; ---------------------------------------------------------------------------- procedure Context_Update (Context : in out Context_Type; Block : in Block_Type) is begin Context_Update_Internal (Context, Block); Add (Context.Length, 512); end Context_Update; ---------------------------------------------------------------------------- procedure Context_Finalize (Context : in out Context_Type; Block : in Block_Type; Length : in Block_Length_Type) is Final_Block : Block_Type; begin pragma Debug (Debug.Put_Line ("FINAL BLOCK:")); Final_Block := Block; -- Add length of last block to data length. Add (Context.Length, Length); -- Set trailing '1' marker and zero out rest of the block. Pad32.Block_Terminate (Block => Final_Block, Length => Types.Word64 (Length)); -- Terminator and length values won't fit into current block. if Length >= 448 then Context_Update_Internal (Context => Context, Block => Final_Block); Final_Block := Null_Block; end if; -- Set length in final block. Final_Block (Block_Type'Last - 1) := Byteorder32.BE_To_Native (Context.Length.MSW); Final_Block (Block_Type'Last) := Byteorder32.BE_To_Native (Context.Length.LSW); Context_Update_Internal (Context => Context, Block => Final_Block); end Context_Finalize; ---------------------------------------------------------------------------- function SHA256_Get_Hash (Context : Context_Type) return SHA256_Hash_Type is begin return SHA256_Hash_Type'(0 => Byteorder32.BE_To_Native (Context.H (0)), 1 => Byteorder32.BE_To_Native (Context.H (1)), 2 => Byteorder32.BE_To_Native (Context.H (2)), 3 => Byteorder32.BE_To_Native (Context.H (3)), 4 => Byteorder32.BE_To_Native (Context.H (4)), 5 => Byteorder32.BE_To_Native (Context.H (5)), 6 => Byteorder32.BE_To_Native (Context.H (6)), 7 => Byteorder32.BE_To_Native (Context.H (7))); end SHA256_Get_Hash; ---------------------------------------------------------------------------- procedure Hash_Context (Message : in Message_Type; Length : in Message_Index; Ctx : in out Context_Type) is Dummy : constant Block_Type := Null_Block; Last_Length : Block_Length_Type; Last_Block : Message_Index; begin Last_Length := Types.Word32 (Length mod Block_Size); Last_Block := Message'First + Length / Block_Size; -- handle all blocks, but the last. if Last_Block > Message'First then for I in Message_Index range Message'First .. Last_Block - 1 loop pragma Loop_Invariant (Last_Block - 1 <= Message'Last and (if Last_Length /= 0 then Last_Block <= Message'Last) and I < Last_Block); Context_Update (Ctx, Message (I)); end loop; end if; if Last_Length = 0 then Context_Finalize (Ctx, Dummy, 0); else Context_Finalize (Ctx, Message (Last_Block), Last_Length); end if; end Hash_Context; ---------------------------------------------------------------------------- function Hash (Message : Message_Type; Length : Message_Index) return SHA256_Hash_Type is Ctx : Context_Type; begin Ctx := SHA256_Context_Init; Hash_Context (Message, Length, Ctx); return SHA256_Get_Hash (Ctx); end Hash; end LSC.Internal.SHA256;
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sdcc_iy/esxdos_f_opendir_p3_fastcall.asm
jpoikela/z88dk
640
174627
<reponame>jpoikela/z88dk ; uchar esxdos_f_opendir_p3(char *path) INCLUDE "config_private.inc" SECTION code_clib SECTION code_esxdos PUBLIC _esxdos_f_opendir_p3_fastcall EXTERN asm_esxdos_f_opendir _esxdos_f_opendir_p3_fastcall: ld a,__ESXDOS_DRIVE_CURRENT ld b,__ESXDOS_MODE_USE_HEADER push iy call asm_esxdos_f_opendir pop iy ret
examples/Sized/ConsoleExample.agda
agda/ooAgda
23
11704
module Sized.ConsoleExample where open import SizedIO.Base open import SizedIO.Console hiding (main) open import NativeIO myProgram : ∀{i} → IOConsole i Unit force myProgram = do' getLine λ line → do (putStrLn line) λ _ → do (putStrLn line) λ _ → myProgram main : NativeIO Unit main = translateIOConsole myProgram
tlsf/src/tlsf.ads
vasil-sd/ada-tlsf
3
23038
package TLSF with SPARK_Mode, Pure, Preelaborate is end TLSF;
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_21829_1723.asm
ljhsiun2/medusa
9
102473
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1ca40, %rsi lea addresses_WC_ht+0x1972c, %rdi clflush (%rdi) nop nop nop nop nop add %r9, %r9 mov $53, %rcx rep movsw nop nop nop nop sub %r11, %r11 lea addresses_normal_ht+0x4c9c, %rsi lea addresses_WC_ht+0x872c, %rdi nop nop nop inc %rbx mov $14, %rcx rep movsb nop nop nop nop inc %r9 lea addresses_UC_ht+0x14aac, %rbx cmp $5070, %r14 movw $0x6162, (%rbx) nop nop nop nop nop xor %rbx, %rbx lea addresses_normal_ht+0x1cf4, %rsi lea addresses_D_ht+0x14c0c, %rdi nop nop nop nop sub %r14, %r14 mov $104, %rcx rep movsq nop nop nop nop nop and %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r9 push %rax push %rcx push %rdi push %rdx // Store lea addresses_US+0xc68c, %r11 nop nop nop nop sub %rcx, %rcx movw $0x5152, (%r11) nop nop nop nop nop cmp %r13, %r13 // Faulty Load lea addresses_US+0x172c, %r13 nop nop nop nop nop dec %r9 mov (%r13), %ecx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': 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 */
Gas/Dos/GIT/Core.asm
Gabidal/GAS_Pack
1
81635
<reponame>Gabidal/GAS_Pack %include 'GINF\GI.asm'
src/textures.asm
TypeDefinition/NautiBuoy
2
242274
INCLUDE "./src/include/hardware.inc" SECTION "Background & Window Tiles", ROMX FontTileDataEN:: INCBIN "./tile_data/font_en.2bpp" .end:: FontTileDataJP:: INCBIN "./tile_data/font_jp.2bpp" .end:: BGWindowTileData:: INCBIN "./tile_data/background_and_ui.2bpp" ; INCBIN copies the binary file contents directly into the ROM. .end:: TitleScreenTileData:: INCBIN "./tile_data/title_screen.2bpp" .end:: StoryModeTileData:: INCBIN "./tile_data/story_mode.2bpp" .end:: SECTION "Sprites", ROMX Sprites:: INCBIN "./tile_data/player.2bpp" INCBIN "./tile_data/squid.2bpp" INCBIN "./tile_data/turtle.2bpp" INCBIN "./tile_data/stingray.2bpp" INCBIN "./tile_data/pufferfish.2bpp" INCBIN "./tile_data/powerups.2bpp" INCBIN "./tile_data/projectiles.2bpp" INCBIN "./tile_data/explosion.2bpp" INCBIN "./tile_data/hammerhead_shark.2bpp" INCBIN "./tile_data/player_fast.2bpp" .end:: ParticleEffectSprites:: .smallExplosion:: db $98 ; sprite ID db OAMF_PAL0 db $9A ; sprite ID db OAMF_PAL0 .mediumExplosion:: db $9C ; sprite ID db OAMF_PAL0 db $9E ; sprite ID db OAMF_PAL0 .bigExplosion db $A0 ; sprite ID db OAMF_PAL0 db $A2 ; sprite ID db OAMF_PAL0 BulletSprites:: .upDefaultSprite:: db $96 ; sprite ID db OAMF_PAL0 | OAMF_YFLIP .downDefaultSprite:: db $96 ; sprite ID db OAMF_PAL0 .rightDefaultSprite:: db $94 ; sprite ID db OAMF_PAL0 .leftDefaultSprite:: db $94 ; sprite ID db OAMF_PAL0 | OAMF_XFLIP .upPowerUpBulletSprite db $92 ; sprite ID db OAMF_PAL0 | OAMF_YFLIP .downPowerUpBulletDefaultSprite db $92 ; sprite ID db OAMF_PAL0 .rightPowerUpBulletDefaultSprite db $88 ; sprite ID db OAMF_PAL0 .leftPowerUpBulletDefaultSprite db $88 ; sprite ID db OAMF_PAL0 | OAMF_XFLIP .upSpikeProjectileSprite db $8C ; sprite ID db OAMF_PAL0 .downSpikeProjectileSprite db $8C ; sprite ID db OAMF_PAL0 .rightSpikeProjectileSprite db $8A ; sprite ID db OAMF_PAL0 .leftSpikeProjectileSprite db $8A ; sprite ID db OAMF_PAL0 .upInkProjectileSprite db $90 ; sprite ID db OAMF_PAL0 | OAMF_YFLIP .downInkProjectileSprite db $90 ; sprite ID db OAMF_PAL0 .rightInkProjectileSprite db $8E ; sprite ID db OAMF_PAL0 .leftInkProjectileSprite db $8E ; sprite ID db OAMF_PAL0 | OAMF_XFLIP .upWindProjectileSprite:: db $CA ; sprite ID db OAMF_PAL0 | OAMF_YFLIP db $CE ; sprite ID db OAMF_PAL0 | OAMF_YFLIP .downWindProjectileSprite db $CA ; sprite ID db OAMF_PAL0 db $CE ; sprite ID db OAMF_PAL0 .leftWindProjectileSprite db $C8 ; sprite ID db OAMF_PAL0 db $CC ; sprite ID db OAMF_PAL0 .rightWindProjectileSprite db $CC ; sprite ID db OAMF_PAL0 | OAMF_XFLIP db $C8 ; sprite ID db OAMF_PAL0 | OAMF_XFLIP PlayerAnimation:: .upAnimation:: ; Frame 1 db 0 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db 2 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db 4 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db 6 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP .downAnimation:: ; Frame 1 db 0 db OAMF_PAL0 | OAMF_PRI db 2 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db 4 db OAMF_PAL0 | OAMF_PRI db 6 db OAMF_PAL0 | OAMF_PRI .leftAnimation:: db 10 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db 8 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP ; Frame 2 db 14 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db 12 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP .rightAnimation:: db 8 db OAMF_PAL0 | OAMF_PRI db 10 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db 12 db OAMF_PAL0 | OAMF_PRI db 14 db OAMF_PAL0 | OAMF_PRI .upSpeedAnimation:: ; Frame 1 db $F0 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db $F2 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $F4 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db $F6 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP .downSpeedAnimation:: ; Frame 1 db $F0 db OAMF_PAL0 | OAMF_PRI db $F2 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $F4 db OAMF_PAL0 | OAMF_PRI db $F6 db OAMF_PAL0 | OAMF_PRI .leftSpeedAnimation:: db $FA db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db $F8 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP ; Frame 2 db $FE db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db $FC db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP .rightSpeedAnimation:: db $F8 db OAMF_PAL0 | OAMF_PRI db $FA db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $FC db OAMF_PAL0 | OAMF_PRI db $FE db OAMF_PAL0 | OAMF_PRI .upSpeedDecAnimation:: ; Frame 1 db 0 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db 2 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $F4 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP db $F6 db OAMF_PAL0 | OAMF_PRI | OAMF_YFLIP .downSpeedDecAnimation:: ; Frame 1 db 0 db OAMF_PAL0 | OAMF_PRI db 2 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $F4 db OAMF_PAL0 | OAMF_PRI db $F6 db OAMF_PAL0 | OAMF_PRI .leftSpeedDecAnimation:: db 10 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db 8 db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP ; Frame 2 db $FE db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP db $FC db OAMF_PAL0 | OAMF_PRI | OAMF_XFLIP .rightSpeedDecAnimation:: db 8 db OAMF_PAL0 | OAMF_PRI db 10 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $FC db OAMF_PAL0 | OAMF_PRI db $FE db OAMF_PAL0 | OAMF_PRI /* Animation, sprite IDs for the enemy*/ EnemyAAnimation:: .upAnimation:: ; Frame 1 db $10 db OAMF_PAL0 | OAMF_PRI db $12 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $14 db OAMF_PAL0 | OAMF_PRI db $16 db OAMF_PAL0 | OAMF_PRI .downAnimation ; Frame 1 db $10 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $12 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $14 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $16 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI .leftAnimation ; Frame 1 db $1C db OAMF_PAL0 | OAMF_PRI db $1E db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $20 db OAMF_PAL0 | OAMF_PRI db $22 db OAMF_PAL0 | OAMF_PRI .rightAnimation ; Frame 1 db $1E db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $1C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $22 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $20 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .attackUpAnimation:: ; Frame 1 db $18 db OAMF_PAL0 | OAMF_PRI db $1A db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $14 db OAMF_PAL0 | OAMF_PRI db $16 db OAMF_PAL0 | OAMF_PRI .attackDownAnimation ; Frame 1 db $18 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $1A db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $14 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $16 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI .attackLeftAnimation ; Frame 1 db $1C db OAMF_PAL0 | OAMF_PRI db $24 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $20 db OAMF_PAL0 | OAMF_PRI db $22 db OAMF_PAL0 | OAMF_PRI .attackRightAnimation ; Frame 1 db $24 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $1C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $22 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $20 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI /* Enemy B sprite animation */ EnemyBAnimation:: .upAnimation:: ; up and down has the same frames ; Frame 1 db $26 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $26 db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $28 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $28 db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP | OAMF_PRI .downAnimation:: ; up and down has the same frames ; Frame 1 db $26 db OAMF_PAL0 | OAMF_PRI db $26 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $28 db OAMF_PAL0 | OAMF_PRI db $28 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .rightAnimation:: ; Frame 1 db $2E db OAMF_PAL0 | OAMF_PRI db $30 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $32 db OAMF_PAL0 | OAMF_PRI db $34 db OAMF_PAL0 | OAMF_PRI .leftAnimation:: ; Frame 1 db $30 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $2E db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $34 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $32 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .attackUpAnimation:: ; up and down same animation ; Frame 1, up db $2C db OAMF_PAL0 | OAMF_PRI db $2C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2, right db $2A db OAMF_PAL0 | OAMF_PRI db $2A db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .attackRightAnimation:: ; Frame 2, right db $2A db OAMF_PAL0 | OAMF_PRI db $2A db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 1, up db $2C db OAMF_PAL0 | OAMF_PRI db $2C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .hideInShellUpAnimation:: ; Frame 1 db $36 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $36 db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $38 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $38 db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP | OAMF_PRI .hideInShellDownAnimation:: ; Frame 1 db $36 db OAMF_PAL0 | OAMF_PRI db $36 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $38 db OAMF_PAL0 | OAMF_PRI db $38 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .hideInShellRightAnimation:: ; Frame 1 db $3A db OAMF_PAL0 | OAMF_PRI db $3C db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $3E db OAMF_PAL0 | OAMF_PRI db $40 db OAMF_PAL0 | OAMF_PRI .hideInShellLeftAnimation:: ; Frame 1 db $3C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $3A db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $40 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $3E db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI /* Animation, sprite IDs for the enemy C*/ EnemyCAnimation:: .upAnimation:: ; Frame 1 db $58 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $5A db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $5C db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $5E db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI .downAnimation:: ; Frame 1 db $58 db OAMF_PAL0 | OAMF_PRI db $5A db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $5C db OAMF_PAL0 | OAMF_PRI db $5E db OAMF_PAL0 | OAMF_PRI .rightAnimation:: ; Frame 1 db $6C db OAMF_PAL0 | OAMF_PRI db $6E db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $70 db OAMF_PAL0 | OAMF_PRI db $72 db OAMF_PAL0 | OAMF_PRI .leftAnimation:: ; Frame 1 db $6E db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $6C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 2 db $72 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $70 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI .attackUpAnimation:: ; Frame 1 db $60 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $64 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $66 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 3 db $60 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 4, SHOOT db $68 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $6A db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $64 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $66 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI ; Frame 2 db $60 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_YFLIP | OAMF_PRI .attackDownAnimation:: ; Frame 1 db $60 db OAMF_PAL0 | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $64 db OAMF_PAL0 | OAMF_PRI db $66 db OAMF_PAL0 | OAMF_PRI ; Frame 3 db $60 db OAMF_PAL0 | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_PRI ; Frame 4, SHOOT db $68 db OAMF_PAL0 | OAMF_PRI db $6A db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $64 db OAMF_PAL0 | OAMF_PRI db $66 db OAMF_PAL0 | OAMF_PRI ; Frame 2 db $60 db OAMF_PAL0 | OAMF_PRI db $62 db OAMF_PAL0 | OAMF_PRI .attackRightAnimation:: ; Frame 1 db $74 db OAMF_PAL0 | OAMF_PRI db $76 db OAMF_PAL0 | OAMF_PRI db $78 db OAMF_PAL0 | OAMF_PRI db $7A db OAMF_PAL0 | OAMF_PRI db $74 db OAMF_PAL0 | OAMF_PRI db $76 db OAMF_PAL0 | OAMF_PRI ; Frame 4, SHOOT db $7C db OAMF_PAL0 | OAMF_PRI db $7E db OAMF_PAL0 | OAMF_PRI db $78 db OAMF_PAL0 | OAMF_PRI db $7A db OAMF_PAL0 | OAMF_PRI db $74 db OAMF_PAL0 | OAMF_PRI db $76 db OAMF_PAL0 | OAMF_PRI .attackLeftAnimation:: ; Frame 1 db $76 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $74 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $7A db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $78 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $76 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $74 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI ; Frame 4, SHOOT db $7E db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $7C db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $7A db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $78 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $76 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI db $74 db OAMF_PAL0 | OAMF_XFLIP | OAMF_PRI /* Animation for enemy D */ EnemyDAnimation:: .sleepAnimation:: ; Frame 1 db $42 db OAMF_PAL0 db $44 db OAMF_PAL0 ; Frame 2 db $46 db OAMF_PAL0 db $48 db OAMF_PAL0 .upAnimation:: ; up and down has the same frames ; Frame 1 db $46 db OAMF_PAL0 db $4A db OAMF_PAL0 ; Frame 2 db $4C db OAMF_PAL0 db $4E db OAMF_PAL0 .downAnimation:: ; up and down has the same frames ; Frame 1 db $46 db OAMF_PAL0 | OAMF_YFLIP db $4A db OAMF_PAL0 | OAMF_YFLIP ; Frame 2 db $4C db OAMF_PAL0 | OAMF_YFLIP db $4E db OAMF_PAL0 | OAMF_YFLIP .rightAnimation:: ; Frame 1 db $50 db OAMF_PAL0 db $52 db OAMF_PAL0 ; Frame 2 db $54 db OAMF_PAL0 db $56 db OAMF_PAL0 .leftAnimation:: ; Frame 1 db $52 db OAMF_PAL0 | OAMF_XFLIP db $50 db OAMF_PAL0 | OAMF_XFLIP ; Frame 2 db $56 db OAMF_PAL0 | OAMF_XFLIP db $54 db OAMF_PAL0 | OAMF_XFLIP BossEnemyAnimation:: .upAnimation:: ; first frame db $AA ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_YFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_YFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_YFLIP db $B6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $B4 ; top right db OAMF_PAL0 | OAMF_YFLIP ; second frame db $B6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B4 ; top right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP .downAnimation:: ; first frame db $A8 ; top left db OAMF_PAL0 db $AA ; bottom left db OAMF_PAL0 db $AC ; top middle left db OAMF_PAL0 db $AE ; bottom middle left db OAMF_PAL0 db $B0 ; top middle right db OAMF_PAL0 db $B2 ; bottom middle right db OAMF_PAL0 db $B4 ; top right db OAMF_PAL0 db $B6 ; bottom right db OAMF_PAL0 ; first frame db $B4 ; top right db OAMF_PAL0 | OAMF_XFLIP db $B6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_XFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL0 | OAMF_XFLIP .leftAnimation:: ; FIRST FRAME db $C4 ; top right db OAMF_PAL0 | OAMF_XFLIP db $C6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_XFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_XFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_XFLIP db $BA ; bottom left db OAMF_PAL0 | OAMF_XFLIP ; SECOND FRAME db $C6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C4 ; top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BA ; bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP .rightAnimation:: ; FIRST FRAME db $B8 ; top left db OAMF_PAL0 db $BA ; bottom left db OAMF_PAL0 db $BC ; middle top left db OAMF_PAL0 db $BE ; middle bottom left db OAMF_PAL0 db $C0 ; middle top right db OAMF_PAL0 db $C2 ; middle bottom right db OAMF_PAL0 db $C4 ; top right db OAMF_PAL0 db $C6 ; bottom right db OAMF_PAL0 ; second frame db $BA ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_YFLIP db $C6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $C4 ; top right db OAMF_PAL0 | OAMF_YFLIP .upAnimationDefaultFire:: ; first frame db $AA ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_YFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_YFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_YFLIP db $B6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $B4 ; top right db OAMF_PAL0 | OAMF_YFLIP ; second frame db $B6 ; bottom right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $B4 ; top right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $A8 ; top left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP .downAnimationDefaultFire:: ; first frame db $A8 ; top left db OAMF_PAL0 db $AA ; bottom left db OAMF_PAL0 db $AC ; top middle left db OAMF_PAL0 db $AE ; bottom middle left db OAMF_PAL0 db $B0 ; top middle right db OAMF_PAL0 db $B2 ; bottom middle right db OAMF_PAL0 db $B4 ; top right db OAMF_PAL0 db $B6 ; bottom right db OAMF_PAL0 ; first frame db $B4 ; top right db OAMF_PAL1 | OAMF_XFLIP db $B6 ; bottom right db OAMF_PAL1 | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL1 | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL1 | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL1 | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL1 | OAMF_XFLIP db $A8 ; top left db OAMF_PAL1 | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL1 | OAMF_XFLIP .leftAnimationDefaultFire:: ; FIRST FRAME db $C4 ; top right db OAMF_PAL0 | OAMF_XFLIP db $C6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_XFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_XFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_XFLIP db $BA ; bottom left db OAMF_PAL0 | OAMF_XFLIP ; SECOND FRAME db $C6 ; bottom right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $C4 ; top right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $BA ; bottom left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $B8 ; top left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP .rightAnimationDefaultFire:: ; FIRST FRAME db $B8 ; top left db OAMF_PAL0 db $BA ; bottom left db OAMF_PAL0 db $BC ; middle top left db OAMF_PAL0 db $BE ; middle bottom left db OAMF_PAL0 db $C0 ; middle top right db OAMF_PAL0 db $C2 ; middle bottom right db OAMF_PAL0 db $C4 ; top right db OAMF_PAL0 db $C6 ; bottom right db OAMF_PAL0 ; second frame db $BA ; bottom left db OAMF_PAL1 | OAMF_YFLIP db $B8 ; top left db OAMF_PAL1 | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL1 | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL1 | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL1 | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL1 | OAMF_YFLIP db $C6 ; bottom right db OAMF_PAL1 | OAMF_YFLIP db $C4 ; top right db OAMF_PAL1 | OAMF_YFLIP .chargeAnimationUp:: ; first frame db $B6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B4 ; top right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP ; second frame db $D2 ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $D0 ; top left db OAMF_PAL0 | OAMF_YFLIP db $D6 ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP db $D4 ; top middle left db OAMF_PAL0 | OAMF_YFLIP db $DA ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP db $D8 ; top middle right db OAMF_PAL0 | OAMF_YFLIP db $DE ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $DC ; top right db OAMF_PAL0 | OAMF_YFLIP .chargeAnimationDown:: ; first frame db $B4 ; top right db OAMF_PAL0 | OAMF_XFLIP db $B6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $B0 ; top middle right db OAMF_PAL0 | OAMF_XFLIP db $B2 ; bottom middle right db OAMF_PAL0 | OAMF_XFLIP db $AC ; top middle left db OAMF_PAL0 | OAMF_XFLIP db $AE ; bottom middle left db OAMF_PAL0 | OAMF_XFLIP db $A8 ; top left db OAMF_PAL0 | OAMF_XFLIP db $AA ; bottom left db OAMF_PAL0 | OAMF_XFLIP ; second frame db $D0 ; top left db OAMF_PAL0 db $D2 ; bottom left db OAMF_PAL0 db $D4 ; top middle left db OAMF_PAL0 db $D6 ; bottom middle left db OAMF_PAL0 db $D8 ; top middle right db OAMF_PAL0 db $DA ; bottom middle right db OAMF_PAL0 db $DC ; top right db OAMF_PAL0 db $DE ; bottom right db OAMF_PAL0 .chargeAnimationLeft:: ; SECOND FRAME db $C6 ; bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C4 ; top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $BA ; bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP ; SECOND FRAME db $EC ; top right db OAMF_PAL0 | OAMF_XFLIP db $EE ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $E8 ; middle top right db OAMF_PAL0 | OAMF_XFLIP db $EA ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP db $E4 ; middle top left db OAMF_PAL0 | OAMF_XFLIP db $E6 ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP db $E0 ; top left db OAMF_PAL0 | OAMF_XFLIP db $E2 ; bottom left db OAMF_PAL0 | OAMF_XFLIP .chargeAnimationRight:: ; first frame db $BA ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $B8 ; top left db OAMF_PAL0 | OAMF_YFLIP db $BE ; middle bottom left db OAMF_PAL0 | OAMF_YFLIP db $BC ; middle top left db OAMF_PAL0 | OAMF_YFLIP db $C2 ; middle bottom right db OAMF_PAL0 | OAMF_YFLIP db $C0 ; middle top right db OAMF_PAL0 | OAMF_YFLIP db $C6 ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $C4 ; top right db OAMF_PAL0 | OAMF_YFLIP ; SECOND FRAME db $E0 ; top left db OAMF_PAL0 db $E2 ; bottom left db OAMF_PAL0 db $E4 ; middle top left db OAMF_PAL0 db $E6 ; middle bottom left db OAMF_PAL0 db $E8 ; middle top right db OAMF_PAL0 db $EA ; middle bottom right db OAMF_PAL0 db $EC ; top right db OAMF_PAL0 db $EE ; bottom right db OAMF_PAL0 .ramUp:: ; first frame db $D2 ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $D0 ; top left db OAMF_PAL0 | OAMF_YFLIP db $D6 ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP db $D4 ; top middle left db OAMF_PAL0 | OAMF_YFLIP db $DA ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP db $D8 ; top middle right db OAMF_PAL0 | OAMF_YFLIP db $DE ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $DC ; top right db OAMF_PAL0 | OAMF_YFLIP ; second frame db $DE ; bottom right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $DC ; top right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $DA ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $D8 ; top middle right db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $D6 ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $D4 ; top middle left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $D2 ; bottom left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP db $D0 ; top left db OAMF_PAL0 | OAMF_YFLIP | OAMF_XFLIP .ramDown:: ; first frame db $D0 ; top left db OAMF_PAL0 db $D2 ; bottom left db OAMF_PAL0 db $D4 ; top middle left db OAMF_PAL0 db $D6 ; bottom middle left db OAMF_PAL0 db $D8 ; top middle right db OAMF_PAL0 db $DA ; bottom middle right db OAMF_PAL0 db $DC ; top right db OAMF_PAL0 db $DE ; bottom right db OAMF_PAL0 ; second frame db $DC ; top right db OAMF_PAL0 | OAMF_XFLIP db $DE ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $D8 ; top middle right db OAMF_PAL0 | OAMF_XFLIP db $DA ; bottom middle right db OAMF_PAL0 | OAMF_XFLIP db $D4 ; top middle left db OAMF_PAL0 | OAMF_XFLIP db $D6 ; bottom middle left db OAMF_PAL0 | OAMF_XFLIP db $D0 ; top left db OAMF_PAL0 | OAMF_XFLIP db $D2 ; bottom left db OAMF_PAL0 | OAMF_XFLIP .ramLeft:: ; first FRAME db $EC ; top right db OAMF_PAL0 | OAMF_XFLIP db $EE ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $E8 ; middle top right db OAMF_PAL0 | OAMF_XFLIP db $EA ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP db $E4 ; middle top left db OAMF_PAL0 | OAMF_XFLIP db $E6 ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP db $E0 ; top left db OAMF_PAL0 | OAMF_XFLIP db $E2 ; bottom left db OAMF_PAL0 | OAMF_XFLIP ; second FRAME db $EE ; bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $EC ; top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $EA ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $E8 ; middle top right db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $E6 ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $E4 ; middle top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $E2 ; bottom left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP db $E0 ; top left db OAMF_PAL0 | OAMF_XFLIP | OAMF_YFLIP .ramRight:: ; first FRAME db $E0 ; top left db OAMF_PAL0 db $E2 ; bottom left db OAMF_PAL0 db $E4 ; middle top left db OAMF_PAL0 db $E6 ; middle bottom left db OAMF_PAL0 db $E8 ; middle top right db OAMF_PAL0 db $EA ; middle bottom right db OAMF_PAL0 db $EC ; top right db OAMF_PAL0 db $EE ; bottom right db OAMF_PAL0 ; second frame db $E2 ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $E0 ; top left db OAMF_PAL0 | OAMF_YFLIP db $E6 ; middle bottom left db OAMF_PAL0 | OAMF_YFLIP db $E4 ; middle top left db OAMF_PAL0 | OAMF_YFLIP db $EA ; middle bottom right db OAMF_PAL0 | OAMF_YFLIP db $E8 ; middle top right db OAMF_PAL0 | OAMF_YFLIP db $EE ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $EC ; top right db OAMF_PAL0 | OAMF_YFLIP .projectileBarrageUp:: ; first frame db $D2 ; bottom left db OAMF_PAL0 | OAMF_YFLIP db $D0 ; top left db OAMF_PAL0 | OAMF_YFLIP db $D6 ; bottom middle left db OAMF_PAL0 | OAMF_YFLIP db $D4 ; top middle left db OAMF_PAL0 | OAMF_YFLIP db $DA ; bottom middle right db OAMF_PAL0 | OAMF_YFLIP db $D8 ; top middle right db OAMF_PAL0 | OAMF_YFLIP db $DE ; bottom right db OAMF_PAL0 | OAMF_YFLIP db $DC ; top right db OAMF_PAL0 | OAMF_YFLIP ; second frame db $DE ; bottom right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $DC ; top right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $DA ; bottom middle right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $D8 ; top middle right db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $D6 ; bottom middle left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $D4 ; top middle left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $D2 ; bottom left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP db $D0 ; top left db OAMF_PAL1 | OAMF_YFLIP | OAMF_XFLIP .projectileBarrageDown ; first frame db $D0 ; top left db OAMF_PAL0 db $D2 ; bottom left db OAMF_PAL0 db $D4 ; top middle left db OAMF_PAL0 db $D6 ; bottom middle left db OAMF_PAL0 db $D8 ; top middle right db OAMF_PAL0 db $DA ; bottom middle right db OAMF_PAL0 db $DC ; top right db OAMF_PAL0 db $DE ; bottom right db OAMF_PAL0 ; second frame db $DC ; top right db OAMF_PAL1 | OAMF_XFLIP db $DE ; bottom right db OAMF_PAL1 | OAMF_XFLIP db $D8 ; top middle right db OAMF_PAL1 | OAMF_XFLIP db $DA ; bottom middle right db OAMF_PAL1 | OAMF_XFLIP db $D4 ; top middle left db OAMF_PAL1 | OAMF_XFLIP db $D6 ; bottom middle left db OAMF_PAL1 | OAMF_XFLIP db $D0 ; top left db OAMF_PAL1 | OAMF_XFLIP db $D2 ; bottom left db OAMF_PAL1 | OAMF_XFLIP .projectileBarrageLeft ; first FRAME db $EC ; top right db OAMF_PAL0 | OAMF_XFLIP db $EE ; bottom right db OAMF_PAL0 | OAMF_XFLIP db $E8 ; middle top right db OAMF_PAL0 | OAMF_XFLIP db $EA ; middle bottom right db OAMF_PAL0 | OAMF_XFLIP db $E4 ; middle top left db OAMF_PAL0 | OAMF_XFLIP db $E6 ; middle bottom left db OAMF_PAL0 | OAMF_XFLIP db $E0 ; top left db OAMF_PAL0 | OAMF_XFLIP db $E2 ; bottom left db OAMF_PAL0 | OAMF_XFLIP ; second FRAME db $EE ; bottom right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $EC ; top right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $EA ; middle bottom right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $E8 ; middle top right db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $E6 ; middle bottom left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $E4 ; middle top left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $E2 ; bottom left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP db $E0 ; top left db OAMF_PAL1 | OAMF_XFLIP | OAMF_YFLIP .projectileBarrageRight ; first FRAME db $E0 ; top left db OAMF_PAL0 db $E2 ; bottom left db OAMF_PAL0 db $E4 ; middle top left db OAMF_PAL0 db $E6 ; middle bottom left db OAMF_PAL0 db $E8 ; middle top right db OAMF_PAL0 db $EA ; middle bottom right db OAMF_PAL0 db $EC ; top right db OAMF_PAL0 db $EE ; bottom right db OAMF_PAL0 ; second frame db $E2 ; bottom left db OAMF_PAL1 | OAMF_YFLIP db $E0 ; top left db OAMF_PAL1 | OAMF_YFLIP db $E6 ; middle bottom left db OAMF_PAL1 | OAMF_YFLIP db $E4 ; middle top left db OAMF_PAL1 | OAMF_YFLIP db $EA ; middle bottom right db OAMF_PAL1 | OAMF_YFLIP db $E8 ; middle top right db OAMF_PAL1 | OAMF_YFLIP db $EE ; bottom right db OAMF_PAL1 | OAMF_YFLIP db $EC ; top right db OAMF_PAL1 | OAMF_YFLIP
langs/markov/src/main/antlr/it/unicam/quasylab/sibilla/langs/markov/MarkovChainModel.g4
nicdelgUnicam/sibilla
0
1731
grammar MarkovChainModel; @header { package it.unicam.quasylab.sibilla.langs.markov; } model : (model_type)? element* state_declaration rules_declaration configuration_declaration (measure_declaration)*; configuration_declaration: single_declaration | multiple_declarations ; single_declaration: 'init' '(' variables? ')' '=' assignments ; variables: vars+=ID (',' vars+=ID)* ; multiple_declarations: 'init' '{' init_declarations+ '}' ; init_declarations: (defaultToken = 'default')? name=ID '(' variables? ')' '=' assignments ; assignments: '[' variable_assignment (',' variable_assignment)* ']' ; variable_assignment: name=ID '=' value=expr; model_type: 'ctmc' # ctmcModel | 'dtmc' # dtmcModel ; state_declaration: 'state' '{' variable_declaration+ '}' ; variable_declaration: '[' min=expr '..' max=expr ']' name = ID ';' ; element : const_declaration | param_declaration ; const_declaration : 'const' name=ID '=' expr ';'; rules_declaration : 'rules' '{' rule_case* '}' ; rule_case: '[]' (guard=expr) '->' (step ('+' step)*) ';' ; step: (weight=expr ':')? updates; updates : '_' # emptyUpdate | variable_update ('&' variable_update)* # listUpdate ; variable_update : '(' target=NEXT_ID '=' value=expr ')' ; measure_declaration : 'measure' name=ID '=' expr ';'; param_declaration : 'param' name=ID '=' value=REAL ';'; expr : left=expr op=('&'|'&&') right=expr # andExpression | left=expr op=('|'|'||') right=expr # orExpression | left=expr '^' right=expr # exponentExpression | left=expr op=('*'|'/') right=expr # mulDivExpression | left=expr op=('+'|'-'|'%') right=expr # addSubExpression | left=expr op=('<'|'<='|'=='|'>='|'>') right=expr # relationExpression | '!' arg=expr # negationExpression | guard=expr '?' thenBranch=expr ':' elseBranch=expr # ifThenElseExpression | op=('-'|'+') arg=expr # unaryExpression | '(' expr ')' # bracketExpression | INTEGER # intValue | REAL # realValue | 'false' # falseValue | 'true' # trueValue | 'int' '(' arg = expr ')' # castToIntExpression // | 'now' # nowExpression | reference=ID # referenceExpression // | 'abs' '(' expr ')' ; fragment DIGIT : [0-9]; fragment LETTER : [a-zA-Z_]; ID : LETTER (DIGIT|LETTER)*; INTEGER : DIGIT+; REAL : ((DIGIT* '.' DIGIT+)|DIGIT+ '.')(('E'|'e')('-')?DIGIT+)?; NEXT_ID : LETTER (DIGIT|LETTER)* '\''; COMMENT : '/*' .*? '*/' -> channel(HIDDEN) // match anything between /* and */ ; WS : [ \r\t\u000C\n]+ -> channel(HIDDEN) ;
test/Fail/MissingDefinitionData.agda
shlevy/agda
1,989
9406
<filename>test/Fail/MissingDefinitionData.agda {-# OPTIONS --allow-unsolved-metas #-} data U : ∀ t → Set data T t : Set
oeis/303/A303277.asm
neoneye/loda-programs
11
15923
<gh_stars>10-100 ; A303277: If n = Product (p_j^k_j) then a(n) = (Sum (k_j))^(Sum (p_j)). ; Submitted by <NAME> ; 1,1,1,4,1,32,1,9,8,128,1,243,1,512,256,16,1,243,1,2187,1024,8192,1,1024,32,32768,27,19683,1,59049,1,25,16384,524288,4096,1024,1,2097152,65536,16384,1,531441,1,1594323,6561,33554432,1,3125,128,2187,1048576,14348907,1,1024,65536,262144,4194304,2147483648,1,1048576,1,8589934592,59049,36,262144,43046721,1,1162261467,67108864,4782969,1,3125,1,549755813888,6561,10460353203,262144,387420489,1,78125,64,8796093022208,1,16777216,4194304,35184372088832,4294967296,67108864,1,1048576,1048576,847288609443 add $0,1 lpb $0 mov $3,$0 lpb $3 mov $4,$0 mov $6,$2 cmp $6,0 add $2,$6 mod $4,$2 cmp $4,0 cmp $4,0 mov $5,$2 add $2,1 cmp $5,1 max $4,$5 sub $3,$4 lpe lpb $0 dif $0,$2 add $8,1 lpe add $7,$2 lpe pow $8,$7 mov $0,$8
Computability/Prelude.agda
jesyspa/computability-in-agda
2
7340
{-# OPTIONS --without-K #-} module Computability.Prelude where open import Data.Bool public using (Bool; false; true) open import Data.Empty public using (⊥; ⊥-elim) open import Data.Nat public using (ℕ; zero; suc; _+_; _*_) open import Data.Product public using (Σ; Σ-syntax; _×_; _,_; proj₁; proj₂) open import Data.Sum public using (_⊎_) open import Data.Unit public using (⊤) open import Relation.Binary.PropositionalEquality public using (_≡_; refl) open import Level public using (Level) renaming (zero to lzero; suc to lsuc)
src/MFORTH/main.asm
malyn/MFORTH
10
179378
; Copyright (c) 2009-2012, <NAME> <<EMAIL>>. ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; 1. Redistributions of source code must retain the above copyright notice ; unmodified, this list of conditions, and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; 3. Neither the name of <NAME> nor the names of the contributors ; to this software may be used to endorse or promote products derived from ; this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. ; ====================================================================== ; MFORTH Version Information ; ====================================================================== MFORTH_MAJOR .EQU 1 MFORTH_MINOR .EQU 1 ;MFORTH_COMMIT .EQU Supplied on the TASM command line. ; ====================================================================== ; MFORTH Register Usage ; ====================================================================== ; ; HL - Word Pointer (W); only used by the Address Interpreter, available ; for general use by CODE words. ; DE - Instruction Pointer (IP); must be preserved with SAVEDE/RESTOREDE. ; BC - Return Stack Pointer (RSP); must be preserved if used (usually by ; pushing BC onto the stack). B always contains the TASK page. ; SP - Parameter Stack Pointer (PSP). ; A - Unused. ; ====================================================================== ; MFORTH Memory Maps ; ====================================================================== ; ; Model 100 Memory Map: ; ; +--------------------------------+ 0000h (32k) or 2000h (24k) ; | Files, BASIC variables, etc. | ; +--------------------------------+ [FRETOP] ; | | ; | Free Memory | ; | | ; +--------------------------------+ SP ; | Stack | ; +--------------------------------+ [STKTOP] ; | System variables | ; +--------------------------------+ FFFFh ; ; ; MFORTH Memory Map: ; ; +--------------------------------+ 0000h (32k) or 2000h (24k) ; | Files, BASIC variables, etc. | ; +--------------------------------+ [FRETOP] aka [TICKTIB] ; | Terminal Input Buffer | ; +--------------------------------+ [TICKTIB] + TIBSIZE aka [DP] aka HERE ; | Dictionary | ; | (see below for temp regions) | ; | vvvv | ; | | ; | | ; | ^^^^ | ; | Additional Tasks (256b each) | ; +--------------------------------+ xx00h (first whole page below BOPSTK) ; | Initial MFORTH Task (Task #0) | ; +--------------------------------+ [BOPSTK] ; | Original Stack (unused by us) | ; +--------------------------------+ [STKTOP] ; | System variables | ; +--------------------------------+ FFFFh ; ; ; Transient Regions (based on HERE): ; ; +--------------------------------+ [TICKTIB] + TIBSIZE aka [DP] aka HERE ; | Empty; space for the header and| ; | name of the next definition so | ; | that CREATE can reference the | ; | WORD buffer and not clobber it.| ; +--------------------------------+ [DP] + WORDOFFSET ; | Buffer used by WORD | ; | vvvv | ; | ^^^^ | ; | Buffer used by HLD | ; +--------------------------------+ [DP] + SQOFFSET aka [DP] + HLDEND ; | S" buffer | ; +--------------------------------+ [DP] + PADOFFSET ; | PAD buffer for Task #0 | ; +--------------------------------+ [DP] + PADOFFSET + tasknum*PADSIZE ; | Additional per-task PAD buffers| ; | vvvv | ; +--------------------------------+ ; ; ; Task Page (at xx00h in high memory): ; ; +--------------------------------+ xx00h ; | User Variables | ; +--------------------------------+ xx40h ; | ^^^^ | ; | Return Stack | ; +--------------------------------+ xx7Fh ; | Return/Param Stack Guard Cell | ; +--------------------------------+ xx81h ; | ^^^^ | ; | Parameter Stack | ; +--------------------------------+ xxFFh ; ; ; Dictionary Header: ; ; The MFORTH dictionary uses the layout described by <NAME> ; in his Forth Dimensions I/5 article titled "A Modest Proposal for ; Dictionary Headers". ; ; The 00h byte is called the Name Field Address in MFORTH, even though ; it only points to the name count and flags. The Link Field Address ; points to the Name Field Address of the preceding definition. ; ; The Profiler Execution Count (the dotted cell at 03h) is only used ; when the profiler is enabled at build time. That cell is not used, ; nor is it even allocated (the fixed size of the dictionary header is ; only three bytes, in other words) when the profiler is disabled. The ; Profiler Execution Count stores the number of times that the word ; was executed by NEXT when the PROFILING variable is non-zero. ; ; The header below is for the word DUP; note that the word name is ; stored in reverse order in memory. ; ; +--------------------------------+ -03h ; | 1 | 'P' | ; +--------------------------------+ -02h ; | 0 | 'U' | ; +--------------------------------+ -01h ; | 0 | 'D' | ; +--------------------------------+ 00h ; | P | S | Count | ; +--------------------------------+ 01h ; | Link | ; | Field | ; +--------------------------------+ 03h ; . Profiler . ; . Execution Count . ; +--------------------------------+ 03h/05h ; | Code | ; | Field | ; | (JMP $xxxx) | ; +--------------------------------+ 06h/08h ; . Parameter . ; . Field . ; . . . . . . . . . . . . . . . . . ; ; ; Word List: ; ; An MFORTH wid is a pointer to a word list (HERE, in the case of word ; lists created by WORDLIST). A word list is a single cell that is ; the equivalent of LATEST for that word list. The value at the word ; list is updated as new words are added to the word list. ; ====================================================================== ; Undocumented 8085 Opcodes ; ====================================================================== ; INSTR ARGS OPCODE BYTES MOD CLASS .ADDINSTR DSUB "" 08 1 NOP 1 .ADDINSTR LDEH * 28 2 NOP 1 .ADDINSTR LDES * 38 2 NOP 1 .ADDINSTR LHLX "" ED 1 NOP 1 .ADDINSTR RDEL "" 18 1 NOP 1 .ADDINSTR SHLX "" D9 1 NOP 1 ; ====================================================================== ; Model 100/102 Constants ; ====================================================================== FRETOP: .EQU 0FBB6h ; Beginning of free space on the machine ; (after all files, BASIC vars, etc.) STKTOP: .EQU 0F678h ; Top of the system stack; system stack ; grows downward, although we don't ; use this stack for anything. ALTBGN: .EQU 0FCC0h ; Beginning of the Alternate LCD buffer ALTEND: .EQU 0FDFFh ; End of the Alternate LCD buffer STACKGUARD: .EQU 076h ; The guard value used to see if a Task ; has over-/under-flown a stack. $76 ; is "HLT" just in case someone tries ; to execute the stack pointer. ; ====================================================================== ; MFORTH Dictionary Constants ; ====================================================================== NFASZ: .EQU 1 ; Size of the Name Field. #DEFINE INXNFATOLFA(r) INX r LFASZ: .EQU 2 ; Size of the Link Field. #IFNDEF PROFILER NFATOCFASZ: .EQU NFASZ+LFASZ #DEFINE INXNFATOCFA(r) INX r\ INX r\ INX r #ELSE NFATOPECSZ: .EQU NFASZ+LFASZ PECSZ: .EQU 2 ; Size of the Profiler Execution Count. NFATOCFASZ: .EQU NFASZ+LFASZ+PECSZ #DEFINE INXNFATOCFA(r) INX r\ INX r\ INX r\ INX r\ INX r #ENDIF CFASZ: .EQU 3 ; Size of the Code Field. #DEFINE INXCFATOPFA(r) INX r\ INX r\ INX r ; ====================================================================== ; MFORTH Constants ; ====================================================================== TIBSIZE: .EQU 80 ; Length of the Terminal Input Buffer. WORDOFFSET: .EQU 64 ; Offset from HERE to WORD buffer. WORDSIZE: .EQU 258 ; Size of WORD buffer. HLDEND: .EQU WORDOFFSET+WORDSIZE ; End (and thus, start) of HLD. SQOFFSET: .EQU HLDEND ; Offset from HERE to S" buffer. SQSIZE: .EQU 80 ; Size of S" buffer. PADOFFSET: .EQU SQOFFSET+SQSIZE ; Offset from HERE to first PAD buffer. PADSIZE: .EQU 256 ; Size of each task's PAD buffer. MAXICBS: .EQU 8 ; Maximum number of active input sources. MAXFCBS: .EQU 8 ; Maximum number of files open at one time. MAXSOES: .EQU 8 ; Max. number of word lists in the search order. ; ====================================================================== ; Global variables (stored in the Alternate LCD buffer) ; Max of 320 bytes. ; ; OPON and the variables used by OPON take up the first 23 bytes. ; That leaves 297 bytes remaining. ; ; These globals are shared across all of the active tasks, so they must ; either be safe (not used from multiple tasks at a time; DP is such a ; variable as we atomically add new dictionary entries without an ; intervening PAUSE) or be defined in the manual as not being usable from ; multiple tasks. All of the terminal input variables fall into this ; category as we specifically state that only a single terminal/operator ; is supported. ; ====================================================================== OPON .EQU ALTBGN + 0 #IF (OPONLEN > 16) #ECHO "\t*** ERROR: OPON is too large; Global Variables expect OPONLEN<=16 ***\n" #ENDIF HOLDH: .EQU ALTBGN + 16 HOLDD: .EQU ALTBGN + 18 INTH: .EQU ALTBGN + 20 INTD: .EQU ALTBGN + 22 DP: .EQU ALTBGN + 24 ; Data Pointer. BOPSTK: .EQU ALTBGN + 26 ; Initial value of SP on entry to MFORTH. TICKCURRENT: .EQU ALTBGN + 28 ; Pointer to the compilation word list. TICKSTATE: .EQU ALTBGN + 30 ; Compilation-state flag. TICKTIB: .EQU ALTBGN + 32 ; Terminal Input Buffer pointer. TICKHLD: .EQU ALTBGN + 34 ; Pictured Numeric Output hold pointer. TICKNUMTASKS:.EQU ALTBGN + 36 ; Number of tasks TICKFIRSTTASK:.EQU ALTBGN + 38 ; Address of the first task (always XX00) TICKNUMUSERVARS:.EQU ALTBGN+ 40 ; Number of USER variables SAVED: .EQU ALTBGN + 42 ; DE is saved here when used as a temporary. TICKPREVLEAVE:.EQU ALTBGN + 44 ; Pointer to the previous LEAVE in a DO..LOOP. TICKPREVENDB:.EQU ALTBGN + 46 ; Pointer to the previous ?ENDB in a FORB..NEXTB TICKICB: .EQU ALTBGN + 48 ; Address of the current Input Control Block. PROFILING: .EQU ALTBGN + 50 ; Non-zero if the profiler is on. TICKTICKS: .EQU ALTBGN + 52 ; (double) Number of ticks (4ms) since start. SAVEB: .EQU ALTBGN + 56 ; DE is saved here when used as a temporary. FORTHWL: .EQU ALTBGN + 58 ; FORTH word list. ASSEMBLERWL:.EQU ALTBGN + 60 ; ASSEMBLER word list. ; 2 bytes free. ICBSTART: .EQU ALTBGN + 64 ; Start of the 8, 8-byte Input Control Blocks. FCBSTART: .EQU ALTBGN + 128; Start of the 8, 8-byte File Control Blocks. SOESTART: .EQU ALTBGN + 192; Start of the 8, 2-byte Search Order Entries. ; 112 bytes free. ; ====================================================================== ; System-provided user variables ; ; User variable offsets are the absolute offset into the Task Page and ; are not an index or count or anything like that. In other words, the ; third User Variable is 4 (0, 2, 4) and not 2 (0, 1, 2). ; ====================================================================== USERSAVEDSP:.EQU 0 ; Saved stack pointer USERBASE: .EQU 2 ; Number-conversion radix pointer. USERB: .EQU 4 ; "B" register USERBEND: .EQU 6 ; "B" register end NUMUSERVARS:.EQU 4 ; Total number of user variables. ; ====================================================================== ; MFORTH Macros ; ====================================================================== ; ---------------------------------------------------------------------- ; Save and restore DE (corrupts HL). #DEFINE SAVEDE XCHG\ SHLD SAVED #DEFINE RESTOREDE LHLD SAVED\ XCHG ; ---------------------------------------------------------------------- ; Save and restore BC (corrupts HL). #DEFINE SAVEBC MOV H,B\ MOV L,C\ SHLD SAVEB #DEFINE RESTOREBC LHLD SAVEB\ MOV B,H\ MOV C,L ; ====================================================================== ; Interrupt Vectors ; ====================================================================== RST0: .ORG 00000h INX SP INX SP JMP INIT RST1: .ORG 00008h RET RST2: .ORG 00010h RET RST3: .ORG 00018h RET RST4: .ORG 00020h RET ; Power down interrupt. TRAP: .ORG 00024h DI JMP INTRAP RST5: .ORG 00028h RET RST55: .ORG 0002Ch DI JMP INT55 RST6: .ORG 00030h JMP STDCALL RST65: .ORG 00034h DI JMP INT65 RST7: .ORG 00038h RET RST75: .ORG 0003Ch DI JMP INT75 ; ====================================================================== ; The Main ROM tests the two bytes at 40h to see if they contain the ; values "A" and "B". If so, then the Main ROM creates an Option ROM ; trigger file with the name of the remaining six bytes at 42h-47h. ; ; Many Option ROMs use these eight bytes to contain OPON, but we use a ; much more thorough (and thus slightly too-long) variant of OPON that ; protects OPON from interrupts. ; ; In any event, the "AB" mechanism causes problems if you are using REX, ; as the Main ROM will detect that the ROM has changed (between MFORTH ; and REX) and cold boot the computer. We obviously do not want this to ; happen, so we install/overwrite the trigger file ourselves during our ; initialization process. ; ====================================================================== .ORG 00040h HLT\ HLT\ HLT\ HLT HLT\ HLT\ HLT\ HLT ; ====================================================================== ; Interrupt Handlers ; ====================================================================== ; Power down interrupt INTRAP: CALL INTCALL ; Let the Main ROM turn off the computer .WORD 00024h ; ..and handle the wake-up sequence. RET INT55: CALL INTCALL .WORD 0002Ch RET INT65: CALL INTCALL .WORD 00034h RET INT75: CALL INTCALL .WORD 0003Ch PUSH H PUSH PSW CALL INCTICKS POP PSW POP H RET INCTICKS: LXI H,TICKTICKS INR M RNZ INX H INR M RNZ INX H INR M RNZ INR M RET ; ====================================================================== ; Option ROM Support Code ; ====================================================================== ; ---------------------------------------------------------------------- ; STDON: Switches to the Main ROM. ; ; Here is how the stack looks on entry into this call: ; ; TOS: $0363 (STDCALL: Main ROM code that happens to be "EI; RET") ; T-1: Main ROM routine to call ; T-2: RAM address to return to after the call (OPON in AltLCD) ; T-3: Option ROM address to return to after the call through OPON ; ; This call needs to preserve all registers on entry into the Main ROM. ; Some clever manipulation of the stack is done to ensure that this ; happens. First, we push A+PSW onto the stack since we will use A for ; manipulating the contents of the Cassette Port register at $FF45. This ; means that we need the Main ROM to call POP PSW, RET in order to first ; POP PSW before RETurning to the Main ROM routine. Thankfully the Main ROM ; has those exact two instructions at $26C8. ; ; So we need to get $26C8 onto the stack as the initial return address, but ; to do that we need to use HL. That means that we have to preserve HL ; without pushing it to the stack (since the stack has to be in a specific ; configuration on entry into Main ROM). To do that we first push HL to ; the stack, put $26C8 in HL, and then swap the top-of-stack with HL, thus ; putting $26C8 on the stack and restoring HL. ; ; Here is how the stack looks on entry into the Main ROM: ; ; TOS: $26C8 (Main ROM code that happens to be "POP PSW; RET") ; T-1: PSW ; T-2: $0363 (STDCALL: Main ROM code that happens to be "EI; RET") ; T-3: Main ROM routine to call ; T-4: RAM address to return to after the call (OPON in AltLCD) ; T-5: Option ROM address to return to after the call through OPON ; ; The final RET statement is supplied here for posterity, but in fact by ; the point that the PC gets to that location we will be in the Main ROM. ; Thankfully the Main ROM (both M100 and T200) has a RET statement at $008E, ; so STDON is ORGed in such a way as to ensure that the final RET statement ; falls at $008E. STDON: .ORG 0007Eh PUSH PSW ; Preserve A+PSW (which $26C8 POPs). PUSH H ; Get $26C8 onto the stack LXI H,026C8h ; ..by swapping the value through HL XTHL ; ..and the top-of-stack. LDA 0FF45h ; Get the saved contents of port $E8, ANI 0FEh ; ..clear the low bit to switch to the Main ROM, STA 0FF45h ; ..updated the saved contents of the port, OUT 0E8h ; ..and then actually modify the port. STDONRET: RET ; Now in Main ROM; return to $26C8. #IF (STDONRET != $008E) #ECHO "\t*** ERROR: STDON is not ORGed properly; RET statement not at $008E ***\n" #ENDIF ; ---------------------------------------------------------------------- ; Switches to the Option ROM after a call to the Main ROM. ; ; Here is how the stack looks on entry into this call: ; ; TOS: Option ROM address to return to after the call through OPON ; ; INIT copies this routine into RAM so that the OPON routine is available to ; the Main ROM (which is where it is used). STDON sets up the stack in such ; a way as to ensure that the Main ROM calls this routine after the Main ROM ; call has completed. ; ; This code is interrupt-sensitive, so we disable interrupts until after we ; have properly restore the registers (we only use A+PSW here) and enable ; the Option ROM. OPONIMG: DI PUSH PSW LDA 0FF45h ; Get the saved contents of port $E8, ORI 001h ; ..set the low bit to switch to the Option ROM, STA 0FF45h ; ..updated the saved contents of the port, OUT 0E8h ; ..and then actually modify the port. POP PSW ; Now in Option ROM; restore A+PSW. EI RET ; Return to whatever called STDCALL/INTCALL. OPONLEN: .EQU $-OPONIMG ; Calculate length of OPON for use by INIT. ; ---------------------------------------------------------------------- ; Calls a routine in the Main ROM. ; ; This call needs to preserve all registers on entry into the Main ROM ; and cannot use a register to specify the address of the Main ROM routine ; that is being called. Instead, the Main ROM address is contained in the ; next two bytes of the instruction stream, which are accessed by popping ; the return address from the stack and dereferencing that pointer. The ; real return address is then computed by skipping over the Main ROM address ; that was embedded in the instruction stream and pushing that value onto ; the stack. ; ; This entire process is interrupt-sensitive, so we disable interrupts here ; and then have the Main ROM enable interrupts before it calls the Main ROM ; routine that we are trying to invoke. The Main ROM has the instructions ; "EI; RET" at address $0363, so we push that onto the stack as the initial ; address to return to once in Main ROM. After that we proceed to RET to ; the Main ROM routine that we want to call, then OPON, and then back into ; the Option ROM code that CALLed STDCALL. ; ; Here is the layout of the stack at the point where we JMP STDON: ; ; TOS: $0363 (Main ROM code that happens to be "EI; RET") ; T-1: Main ROM routine to call ; T-2: RAM address to return to after the call (OPON in AltLCD) ; T-3: Option ROM address to return to after the call through OPON ; ; That stack is obviously clear of all of those items on return from STDCALL. STDCALL: DI SHLD HOLDH ; Preserve HL XCHG ; ..and DE SHLD HOLDD ; ..since we will need them as temporaries. POP H ; Get the STDCALL return address, MOV E,M ; ..which is actually the address of the INX H ; ..Main ROM routine that we want to call, MOV D,M ; ..and put that address in DE. Then point INX H ; ..HL at the actual Option ROM return address PUSH H ; ..and push that address (T-3) to the stack. LXI H,OPON ; Return from Main ROM through OPON, which we PUSH H ; ..push onto the stack (T-2). PUSH D ; Push the Main ROM routine to call (T-1). LHLD HOLDD ; Restore DE XCHG ; ..and HL LHLD HOLDH ; ..so that they can be used as Main ROM args. PUSH H ; Get $0363 onto the stack LXI H,00363h ; ..by swapping the value through HL XTHL ; ..and the top-of-stack. JMP STDON ; Jump to STDON to get into Main ROM. ; ---------------------------------------------------------------------- ; Calls an interrupt handler routine in the Main ROM. ; ; This code is almost identical to STDCALL except that we do not need to ; disable interrupts and we definitely do not want to re-enable them as ; part of the jump into the Main ROM (which STDCALL accomplishes by pushing ; $0363 onto the stack). ; ; Here is the layout of the stack at the point where we JMP STDON: ; ; TOS: Main ROM routine to call ; T-1: RAM address to return to after the call (OPON in AltLCD) ; T-2: Option ROM address to return to after the call through OPON ; ; That stack is obviously clear of all of those items on return from INTCALL. INTCALL: SHLD INTH ; Preserve HL XCHG ; ..and DE SHLD INTD ; ..since we will need them as temporaries. POP H ; Get the INTCALL return address, MOV E,M ; ..which is actually the address of the INX H ; ..Main ROM routine that we want to call, MOV D,M ; ..and put that address in DE. Then point INX H ; ..HL at the actual Option ROM return address PUSH H ; ..and push that address (T-2) to the stack. LXI H,OPON ; Return from Main ROM through OPON, which we PUSH H ; ..push onto the stack (T-1). PUSH D ; Push the Main ROM routine to call (TOS). LHLD INTD ; Restore DE XCHG ; ..and HL LHLD INTH ; ..so that they can be used as Main ROM args. JMP STDON ; Jump to STDON to get into Main ROM. ; ====================================================================== ; MFORTH Initialization ; ====================================================================== ; ---------------------------------------------------------------------- ; Initialize MFORTH. ; ; This routine is called on a MFORTH cold-start each time that MFORTH is ; activated from the Main ROM Menu. Note that MFORTH does not maintain ; any state between invocations. ; ; We disable interrupts, copy OPON into high memory, call LNKFIL to ensure ; that all of the cached file start addresses are accurate, set up our memory ; map (by figuring out where free space starts and ends), initialize the ; return stack, and JMP to the MFORTH COLD word. INIT: DI ; Copy OPON into high memory. LXI D,OPONIMG ; First source byte in DE LXI H,OPON ; First target byte in HL MVI B,OPONLEN ; Number of bytes to copy in B _init1: LDAX D ; Load value from [DE] MOV M,A ; Save value to [HL] INX D ; Next source byte INX H ; Next target byte DCR B ; Decrement counter JNZ _init1 ; Keep looping until all bytes are copied ; Call LNKFIL to ensure that the file addresses are accurate. CALL STDCALL ; Call the .WORD 02146h ; .."LNKFIL" routine. ; Set up our memory map. LHLD FRETOP ; Store the beginning of free memory to HL SHLD TICKTIB ; ..and then to the Terminal Input Buffer. LXI B,TIBSIZE ; Add TIBSIZE DAD B ; ..to HL SHLD DP ; ..and then store that in the Data Pointer. LXI H,0 ; Get the location of the DAD SP ; ..OS stack pointer on entry into MFORTH SHLD BOPSTK ; ..and store it in in BOPSTK. ; Initialize the system word lists. LXI H,_latestFORTH-NFATOCFASZ SHLD FORTHWL LXI H,_latestASSEMBLER-NFATOCFASZ SHLD ASSEMBLERWL ; Make the FORTH word list the current compilation word ; list; ABORT will initialize the default search order. LXI H,FORTHWL SHLD TICKCURRENT ; Four USER variables are currently in use (SavedSP, Base, B, Bend). LXI H,NUMUSERVARS SHLD TICKNUMUSERVARS ; Create the first task, which needs to be in place for us ; to enter in to the Inner Interpreter (which needs a return ; stack, for example). The first task begins at the page ; that is below the page where the SP currently resides. This ; could put us right below the system stack (if SP is at xx00, ; for example), but that's okay because we don't actually use ; the system stack for anything (each task has its own stack). LXI H,1 SHLD TICKNUMTASKS LXI H,0 ; Get SP DAD SP ; ..into HL, LXI B,0100h ; ..then subtract 256 DSUB ; ..from HL to get into the middle of the page, MVI L,0 ; ..then clear L to get to the start of the page SHLD TICKFIRSTTASK ;.and then store address of the first task. MOV B,H ; Put the current task's page into its home in B MVI C,07fh ; ..and initialize the return stack to xx7F. MVI M,STACKGUARD; Set the Saved Stack Pointer to the guard INX H ; ..value since this task will be running (not MVI M,STACKGUARD; ..resumed by PAUSE) after the JMP to COLD. MVI L,080h ; Set HL to the parameter stack guard cell MVI M,STACKGUARD; ..then move the guard value INX H ; ..into both bytes MVI M,STACKGUARD; ..of that cell. MVI L,0ffh ; Initialize the SP, which begins at xxFF. SPHL ; Disable the profiler. LXI H,0 SHLD PROFILING ; Reset the tick counter. LXI H,0 SHLD TICKTICKS SHLD TICKTICKS+2 ; Enable interrupts and jump to COLD (which never returns). EI LXI H,COLD ; Point W at COLD (needed by ENTER). LXI D,COLD ; Point IP at COLD (needed by NEXT). JMP COLD ; ====================================================================== ; MFORTH Kernel and FORTH Word List ; ====================================================================== ; Kernel routines and macros. #include "kernel.asm" ; ANS word sets. LINK_CORE .EQU NFATOCFASZ #include "answords/core.asm" LINK_COREEXT .EQU LAST_CORE #include "answords/core-ext.asm" LINK_DOUBLE .EQU LAST_COREEXT #include "answords/double.asm" LINK_FACILITY .EQU LAST_DOUBLE #include "answords/facility.asm" LINK_FACILITYEXT .EQU LAST_FACILITY #include "answords/facility-ext.asm" LINK_FILE .EQU LAST_FACILITYEXT #include "answords/file.asm" LINK_SEARCH .EQU LAST_FILE #include "answords/search.asm" LINK_SEARCHEXT .EQU LAST_SEARCH #include "answords/search-ext.asm" LINK_STRING .EQU LAST_SEARCHEXT #include "answords/string.asm" LINK_TOOLS .EQU LAST_STRING #include "answords/tools.asm" LINK_TOOLSEXT .EQU LAST_TOOLS #include "answords/tools-ext.asm" ; MFORTH word sets. LINK_BREG .EQU LAST_TOOLSEXT #include "mforthwords/breg.asm" LINK_MFORTH .EQU LAST_BREG #include "mforthwords/mforth.asm" LINK_TASK .EQU LAST_MFORTH #include "mforthwords/task.asm" #IFNDEF PROFILER _latestFORTH .EQU LAST_TASK #ELSE LINK_PROFILER .EQU LAST_TASK #include "mforthwords/profiler.asm" _latestFORTH .EQU LAST_PROFILER #ENDIF ; ====================================================================== ; Additional Word Lists ; ====================================================================== ; ASSEMBLER Word List LINK_ASSEMBLER .EQU NFATOCFASZ #include "mforthwords/assembler.asm" _latestASSEMBLER .EQU LAST_ASSEMBLER ; ====================================================================== ; Display ROM statistics. ; ====================================================================== #ECHO "\tEnd of ROM: " #ECHO $ #ECHO "\n" ; ====================================================================== ; Zero-out the rest of the ROM. ; ====================================================================== .ORG 07FFFh .BYTE 0 ; ====================================================================== ; Perfect Hash of ROM Dictionary ; ====================================================================== #IFNDEF PHASH ; Temporarily store _latestFORTH at 07FFE for use by phashgen.exe. .ORG 07FFEh .WORD _latestFORTH-NFATOCFASZ #ELSE ; phash.asm already generated. #include "phash.asm" #ENDIF ; ====================================================================== ; End of ROM. ; ====================================================================== .END
examples/embedded_simulator/runtime/rv32i/src/crt0/s-macres.adb
Fabien-Chouteau/libriscv
0
2839
<filename>examples/embedded_simulator/runtime/rv32i/src/crt0/s-macres.adb ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . M A C H I N E _ R E S E T -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011-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. -- -- -- -- -- -- -- -- -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ package body System.Machine_Reset is procedure OS_Exit; pragma Import (Ada, OS_Exit, "__gnat_exit"); pragma No_Return (OS_Exit); -- Reset the board procedure OS_Abort; pragma Export (Ada, OS_Abort, "abort"); pragma No_Return (OS_Abort); -- Same as OS_Exit (rename in body to allow multiple pragma Export) -------------- -- OS_Abort -- -------------- procedure OS_Abort renames OS_Exit; ---------- -- Stop -- ---------- procedure Stop renames OS_Exit; end System.Machine_Reset;
examples/outdated-and-incorrect/Alonzo/PreludeInt.agda
asr/agda-kanso
1
13846
<filename>examples/outdated-and-incorrect/Alonzo/PreludeInt.agda module PreludeInt where open import AlonzoPrelude import RTP int : Nat -> Int int = RTP.primNatToInt _+_ : Int -> Int -> Int _+_ = RTP.primIntAdd _-_ : Int -> Int -> Int _-_ = RTP.primIntSub _*_ : Int -> Int -> Int _*_ = RTP.primIntMul div : Int -> Int -> Int div = RTP.primIntDiv mod : Int -> Int -> Int mod = RTP.primIntMod
examples/todomvc/src/logic/todos-archive.agda
frankymacster/redux
0
14852
<gh_stars>0 open import Data.Bool as Bool using (Bool; false; true; if_then_else_; not) open import Data.String using (String) open import Data.Nat using (ℕ; _+_; _≟_; suc; _>_; _<_; _∸_) open import Relation.Nullary.Decidable using (⌊_⌋) open import Data.List as l using (List; filter; map; take; foldl; length; []; _∷_) open import Data.List.Properties -- open import Data.List.Extrema using (max) open import Data.Maybe using (to-witness) open import Data.Fin using (fromℕ; _-_; zero; Fin) open import Data.Fin.Properties using (≤-totalOrder) open import Data.Product as Prod using (∃; ∃₂; _×_; _,_; Σ) import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl; cong) open Eq.≡-Reasoning open import Level using (Level) open import Data.Vec as v using (Vec; fromList; toList; last; length; []; _∷_; [_]; _∷ʳ_; _++_; lookup; head; initLast; filter; map) open import Data.Vec.Bounded as vb using ([]; _∷_; fromVec; filter; Vec≤) open import Relation.Binary.PropositionalEquality as P using (_≡_; _≢_; refl; _≗_; cong₂) open import Data.Nat.Properties using (+-comm) open import Relation.Unary using (Pred; Decidable) open import Relation.Nullary using (does) open import Data.Vec.Bounded.Base using (padRight; ≤-cast) import Data.Nat.Properties as ℕₚ open import Relation.Nullary.Decidable.Core using (dec-false) open import Function using (_∘_) open import Data.List.Extrema ℕₚ.≤-totalOrder -- TODO add to std-lib vecLast : ∀ {a} {A : Set a} {l} {n : ℕ} (xs : Vec A n) → last (xs ∷ʳ l) ≡ l vecLast [] = refl vecLast (_ ∷ xs) = P.trans (prop (xs ∷ʳ _)) (vecLast xs) where prop : ∀ {a} {A : Set a} {n x} (xs : Vec A (suc n)) → last (x v.∷ xs) ≡ last xs prop xs with initLast xs ... | _ , _ , refl = refl -- operations -- AddTodo -- DeleteTodo -- CompleteTodo -- ClearCompleted -- CompleteAllTodos -- horizontal properties -- AddTodo -- non-commutative -- DeleteTodo -- idempotent -- CompleteTodo -- idempotent -- ClearCompleted -- idempotent -- CompleteAllTodos -- idempotent -- EditTodo -- EditTodo - EditTodo Todo list length doesn't change -- vertical properties -- AddTodo -- AddTodoSetsNewCompletedToFalse -- AddTodoSetsNewIdToNonExistingId -- AddTodoSetsNewTextToText -- doesn't change id of other Todos -- doesn't change text of other Todos -- doesn't change completed of other Todos -- DeleteTodo -- DeleteTodoRemoveTodoWithId -- DeleteTodoRemoves1Element -- only way to add todo is with AddTodo and AddTodo gives non existing id to new todo -- doesn't change id of other Todos -- doesn't change text of other Todos -- doesn't change completed of other Todos -- CompleteTodo -- CompleteTodoSetsTodoWithIdCompletedToTrue -- doesn't touch any other Todo -- doesn't change id of any Todo -- doesn't change text of any Todo -- ClearCompleted -- doesn't remove Todos where completed = false -- doesn't change id of any Todo -- doesn't change completed of any Todo -- doesn't change text of any Todo -- CompleteAllTodos -- all Todos have completed = true -- doesn't change id of any Todo -- doesn't change text of any Todo -- EditTodo -- modifies Todo with given id's text -- doesn't change the id -- doesn't change completed -- doesn't modify other Todos record Todo : Set where field text : String completed : Bool id : ℕ AddTodo : ∀ {n : ℕ} → (Vec Todo n) → String → (Vec Todo (1 + n)) AddTodo todos text = todos ∷ʳ record { id = 1 -- argmax (λ todo → λ e → e) todos) + 1 ; completed = false ; text = text } ListAddTodo : List Todo → String → List Todo ListAddTodo todos text = todos l.∷ʳ record { id = (max 0 (l.map (λ e → Todo.id e) todos)) + 1 ; completed = false ; text = text } ListAddTodoAddsNewListItem : (todos : List Todo) (text : String) → l.length (ListAddTodo todos text) ≡ l.length todos + 1 ListAddTodoAddsNewListItem todos text = length-++ todos listVec : Vec ℕ 1 listVec = v.fromList (2 l.∷ l.[]) listLast : ℕ listLast = v.last (v.fromList (2 l.∷ l.[])) listLastIs2 : v.last (v.fromList (2 l.∷ l.[])) ≡ 2 listLastIs2 = refl record Id : Set where field id : ℕ natListToVec : (xs : List ℕ) → Vec ℕ (l.length xs) natListToVec nats = v.fromList nats -- natListLast : List ℕ → ℕ -- natListLast nats = v.last {(l.length nats) ∸ 1} (v.fromList nats) -- natListLast : List ℕ → ℕ -- natListLast [] = 0 -- natListLast nats@(x ∷ xs) = v.last (v.fromList nats) natListFromList : v.fromList (1 l.∷ l.[]) ≡ (1 v.∷ v.[]) natListFromList = refl ListOf1sConcatFromList : v.fromList (1 l.∷ l.[] l.++ 1 l.∷ l.[]) ≡ (1 v.∷ v.[] v.++ 1 v.∷ v.[]) ListOf1sConcatFromList = refl open import Data.Nat.Properties {-# BUILTIN SIZE Size #-} private variable a : Level A : Set a i : Size vec-length-++ : ∀ {n : ℕ} (xs : Vec A n) {ys} → v.length (xs v.++ ys) ≡ v.length xs + v.length ys vec-length-++ xs {ys} = refl -- vec-fromList-++ : -- (as bs : List A) → -- v.fromList (as l.++ bs) ≡ v.fromList as v.++ v.fromList bs -- vec-fromList-++ [] bs = v.[] -- vec-fromList-++ (a ∷ as) bs = ? -- natListConcatFromList : (nats1 : List ℕ) → (nats2 : List ℕ) → v.fromList (nats1 l.++ nats2) ≡ (nats1 v.++ nats2) -- natListConcatFromList nats = ? -- natListConcatFromList : (nats : List ℕ) → v.fromList (nats l.++ (1 l.∷ l.[])) ≡ ((v.fromList nats) v.++ (1 v.∷ v.[])) -- natListConcatFromList = {! !} natListLast : List ℕ → ℕ natListLast [] = 0 natListLast (x ∷ []) = x natListLast (_ ∷ y ∷ l) = natListLast (y l.∷ l) natListConcatLast : ∀ l → natListLast (l l.++ l.[ 1 ]) ≡ 1 natListConcatLast [] = refl natListConcatLast (_ ∷ []) = refl natListConcatLast (_ ∷ _ ∷ l) = natListConcatLast (_ l.∷ l) TodoListConcatLast [] = refl TodoListConcatLast (_ ∷ []) = refl TodoListConcatLast (_ ∷ _ ∷ l) = TodoListConcatLast (_ l.∷ l) TodoListConcatLast : ∀ l → (TodoListLast (l l.++ l.[ record { id = 1 ; completed = false ; text = "text" } ])) ≡ record { id = 1 ; completed = false ; text = "text" } TodoListConcatLastCompleted : ∀ l → Todo.completed (TodoListLast (l l.++ l.[ record { id = 1 ; completed = false ; text = "text" } ])) ≡ false TodoListConcatLastCompleted [] = refl TodoListConcatLastCompleted (_ ∷ []) = refl TodoListConcatLastCompleted (_ ∷ _ ∷ l) = TodoListConcatLastCompleted (_ l.∷ l) -- _ : v.last (v.fromList (2 l.∷ l.[] l.++ 1 l.∷ l.[])) ≡ 1 -- _ = refl -- natListConcatLast : (nats : List ℕ) → natListLast (nats l.++ 1 l.∷ l.[]) ≡ 1 -- natListConcatLast [] = refl -- natListConcatLast nats@(x ∷ xs) = -- begin -- natListLast (nats l.++ 1 l.∷ l.[]) -- ≡⟨⟩ -- v.last (v.fromList ((x l.∷ xs) l.++ 1 l.∷ l.[])) -- ≡⟨⟩ -- ? -- ≡⟨⟩ -- 1 -- ∎ -- TodoListLast : List Todo → Todo -- TodoListLast [] = record {} -- TodoListLast todos@(x ∷ xs) = v.last (v.fromList todos) -- ListWith2ToVec : v.fromList (2 l.∷ l.[]) ≡ 2 v.∷ v.[] -- ListWith2ToVec = refl -- idListLastIdIs2 : Id.id (v.last (v.fromList (record {id = 2} l.∷ l.[]))) ≡ 2 -- idListLastIdIs2 = refl -- todoListLastIdIs2 : Todo.id (v.last (v.fromList (record {id = 2; text = ""; completed = false} l.∷ l.[]))) ≡ 2 -- todoListLastIdIs2 = refl -- ListTodoLastTextIsText : -- (todos : List Todo) (text : String) → -- Todo.text (v.last (v.fromList ( -- record -- { text = text -- ; completed = false -- ; id = max 0 (l.map Todo.id todos) + 1 -- } l.∷ l.[] -- ))) ≡ text -- ListTodoLastTextIsText todos text = refl -- -- ListAddTodoLastAddedElementIsTodo : -- -- (todos : List Todo) (text : String) → -- -- Todo.text (TodoListLast (ListAddTodo todos text)) ≡ text -- -- ListAddTodoLastAddedElementIsTodo [] text = refl -- -- ListAddTodoLastAddedElementIsTodo todos@(x ∷ xs) text = -- -- begin -- -- Todo.text (TodoListLast (ListAddTodo todos text)) -- -- ≡⟨⟩ -- -- Todo.text ( -- -- TodoListLast ( -- -- todos -- -- l.++ -- -- ( -- -- record -- -- { text = text -- -- ; completed = false -- -- ; id = max 0 (l.map Todo.id todos) + 1 -- -- } -- -- l.∷ -- -- l.[] -- -- ) -- -- ) -- -- ) -- -- ≡⟨⟩ -- -- Todo.text ( -- -- record -- -- { text = text -- -- ; completed = false -- -- ; id = max 0 (l.map Todo.id todos) + 1 -- -- } -- -- ) -- -- ≡⟨ ? ⟩ -- -- text -- -- ∎ -- -- open import Data.Nat.Base -- -- infixr 5 _vb∷ʳ_ -- -- _vb∷ʳ_ : ∀ {n} → Vec≤ A n → A → Vec≤ A (suc n) -- -- (as , p) vb∷ʳ a = as , s≤s p v.∷ʳ a -- -- Vec≤AddTodo : ∀ {n : ℕ} → (Vec≤ Todo n) → String → (Vec≤ Todo (1 + n)) -- -- Vec≤AddTodo todos text = -- -- todos vb∷ʳ -- -- record -- -- { id = 1 -- argmax (λ todo → λ e → e) todos) + 1 -- -- ; completed = false -- -- ; text = text -- -- } -- vecLength-++ : -- ∀ {n m} (xs : Vec A n) {ys : Vec A m} → -- v.length (xs ++ ys) ≡ v.length xs + v.length ys -- vecLength-++ [] = refl -- vecLength-++ (x ∷ xs) = cong suc (vecLength-++ xs) -- AddTodoAddsNewListItem : -- ∀ {n : ℕ} → (todos : Vec Todo n) (text : String) → -- v.length (AddTodo todos text) ≡ v.length todos + 1 -- AddTodoAddsNewListItem [] text = refl -- AddTodoAddsNewListItem (x v.∷ xs) text = -- begin -- v.length (AddTodo (x v.∷ xs) text) -- ≡⟨⟩ -- 1 + v.length (x v.∷ xs) -- ≡⟨ +-comm 1 (v.length (x v.∷ xs))⟩ -- v.length (x v.∷ xs) + 1 -- ∎ -- ListTodoAddTodoAddsNewListItem : -- (todos : List Todo) (text : String) → -- l.length (ListAddTodo todos text) ≡ l.length todos + 1 -- ListTodoAddTodoAddsNewListItem [] text = refl -- ListTodoAddTodoAddsNewListItem todos text = -- +-comm 1 (l.length todos) -- AddTodoLastAddedElementIsTodo : -- ∀ {n} (todos : Vec Todo n) (text : String) → -- last (AddTodo todos text) ≡ -- record -- { id = 1 -- ; completed = false -- ; text = text -- } -- AddTodoLastAddedElementIsTodo todos text = vecLast todos -- -- should set (new element).completed to false -- AddTodoSetsNewCompletedToFalse : -- ∀ {n} (todos : Vec Todo n) (text : String) → -- Todo.completed (last (AddTodo todos text)) ≡ false -- AddTodoSetsNewCompletedToFalse todos text -- rewrite -- (AddTodoLastAddedElementIsTodo todos text) = -- refl -- -- should set (new element).id to an id not existing already in the list -- AddTodoSetsNewIdTo1 : -- ∀ {n} (todos : Vec Todo n) (text : String) → -- Todo.id (last (AddTodo todos text)) ≡ 1 -- AddTodoSetsNewIdTo1 todos text -- rewrite -- (AddTodoLastAddedElementIsTodo todos text) = -- refl -- -- TODO should not touch other elements in the list -- {-# COMPILE JS AddTodo = -- function (todos) { -- return function (text) { -- return [ -- ...todos, -- { -- id: todos.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, -- completed: false, -- text: text -- } -- ] -- } -- } -- #-} -- -- DeleteTodo : (List Todo) → ℕ → (List Todo) -- -- DeleteTodo todos id' = filter (λ todo → Todo.id todo ≟ id') todos -- open import Relation.Nullary -- dec-¬ : ∀ {a} {P : Set a} → Dec P → Dec (¬ P) -- dec-¬ (yes p) = no λ prf → prf p -- dec-¬ (no ¬p) = yes ¬p -- VecFilter : Vec≤.vec (v.filter (λ e → e ≟ 2) (2 v.∷ 1 v.∷ v.[])) ≡ (2 v.∷ v.[]) -- VecFilter = refl -- -- VecFilter' : Vec≤.vec (v.filter (λ e → dec-¬ (e ≟ 2)) (2 v.∷ 1 v.∷ v.[])) ≡ (1 v.∷ v.[]) -- -- VecFilter' = refl -- -- VecFilter'' : {n : ℕ} → Vec≤.vec (v.filter (λ e → e ≟ 2) (n v.∷ v.[])) ≡ 2 v.∷ v.[] -- -- VecFilter'' = ? -- -- VecFilter''' : {n : ℕ} → v.filter (λ e → e ≟ n) (n v.∷ v.[]) ≡ n vb.∷ vb.[] -- -- VecFilter''' = {! !} -- -- ListFilter : l.filter (λ e → e ≟ 2) (2 l.∷ l.[]) ≡ 2 l.∷ l.[] -- -- ListFilter = refl -- -- ListFilter' : {n : ℕ} → l.filter (λ e → e ≟ n) (n l.∷ l.[]) ≡ n l.∷ l.[] -- -- ListFilter' = {! !} -- -- DeleteNat : ∀ {n m} → (Vec ℕ n) → ℕ → (Vec ℕ m) -- -- DeleteNat nats nat = Vec≤.vec (v.filter (λ e → e ≟ nat) nats) -- DeleteNat : List ℕ → ℕ → List ℕ -- DeleteNat nats nat = l.filter (λ e → dec-¬ (e ≟ nat)) nats -- DeleteNat-idem : -- (nats : List ℕ) → -- (nat : ℕ) → -- DeleteNat (DeleteNat nats nat) nat ≡ DeleteNat nats nat -- DeleteNat-idem nats nat = filter-idem (λ e → dec-¬ (e ≟ nat)) nats -- -- begin -- -- DeleteNat (DeleteNat nats nat) nat -- -- ≡⟨⟩ -- -- DeleteNat (l.filter (λ e → dec-¬ (e ≟ nat)) nats) nat -- -- ≡⟨⟩ -- -- l.filter (λ e → dec-¬ (e ≟ nat)) (l.filter (λ e → dec-¬ (e ≟ nat)) nats) -- -- ≡⟨⟩ -- -- (l.filter (λ e → dec-¬ (e ≟ nat)) ∘ l.filter (λ e → dec-¬ (e ≟ nat))) nats -- -- ≡⟨ filter-idem (λ e → dec-¬ (e ≟ nat)) nats ⟩ -- -- l.filter (λ e → dec-¬ (e ≟ nat)) nats -- -- ≡⟨⟩ -- -- DeleteNat nats nat -- -- ∎ -- private -- variable -- p : Level -- -- VecTodoDeleteTodo : -- -- ∀ {n} → -- -- (Vec Todo n) -- -- → ℕ → -- -- (Vec Todo n) -- -- VecTodoDeleteTodo todos id' = -- -- Vec≤.vec (v.filter (λ todo → dec-¬ (Todo.id todo ≟ id')) todos) -- ListTodoDeleteTodo : -- ∀ {n} → -- (List Todo) -- → ℕ → -- (List Todo) -- ListTodoDeleteTodo todos id' = -- l.filter (λ todo → dec-¬ (Todo.id todo ≟ id')) todos -- ListTodoDeleteTodo-idem : -- (todos : List Todo) → -- (id' : ℕ) → -- ListTodoDeleteTodo (ListTodoDeleteTodo todos id') id' ≡ ListTodoDeleteTodo todos id' -- ListTodoDeleteTodo-idem todos id' = -- filter-idem (λ e → dec-¬ (Todo.id e ≟ id')) todos -- -- Vec≤DeleteTodo : ∀ {n} → (Vec≤ Todo n) → ℕ → (Vec≤ Todo n) -- -- Vec≤DeleteTodo todos id' = vb.filter (λ todo → Todo.id todo ≟ id') todos DeleteNat : (List ℕ) → ℕ → (List ℕ) DeleteNat nats id = filter' (λ n → not (n ≡ᵇ id)) nats -- https://stackoverflow.com/questions/65622605/agda-std-lib-list-check-that-a-filtered-list-is-empty/65622709#65622709 DeleteNatRemoveNatWithId : (nats : List ℕ) (id : ℕ) → filter' (λ n → n ≡ᵇ id) (DeleteNat nats id) ≡ l.[] DeleteNatRemoveNatWithId [] id = refl DeleteNatRemoveNatWithId (x ∷ xs) id with (x ≡ᵇ id) | inspect (_≡ᵇ id) x ... | true | P.[ eq ] = DeleteNatRemoveNatWithId xs id ... | false | P.[ eq ] rewrite eq = DeleteNatRemoveNatWithId xs id -- DONT WORK -- DeleteNatRemoveNatWithId (x ∷ xs) id with x ≡ᵇ id | inspect (l._∷ (filter' (λ n → not (n ≡ᵇ id)) xs)) x -- ... | true | P.[ eq ] = DeleteNatRemoveNatWithId xs id -- ... | false | P.[ eq ] rewrite eq = {! !} -- cong (x List.∷_) (DeleteNatRemoveNatWithId xs id) -- x List.∷ filter' (λ n → n ≡ᵇ id) (DeleteNat xs id) ≡ x List.∷ List.[] -- cong (List._∷_) (DeleteNatRemoveNatWithId xs id) -- List._∷_ (filter' (λ n → n ≡ᵇ id) (DeleteNat xs id)) ≡ List._∷_ List.[] -- cong₂ (List._∷_) refl (DeleteNatRemoveNatWithId xs id) -- _x_1193 List.∷ filter' (λ n → n ≡ᵇ id) (DeleteNat xs id) ≡ _x_1193 List.∷ List.[] -- cong₂ (x List.∷_) refl (DeleteNatRemoveNatWithId xs id) -- cong (filter' (λ n → n ≡ᵇ id) (x List.∷_)) (DeleteNatRemoveNatWithId xs id) -- cong (filter' (λ n → n ≡ᵇ id)) (DeleteNatRemoveNatWithId xs id) -- filter' (λ n → n ≡ᵇ id) (filter' (λ n → n ≡ᵇ id) (DeleteNat xs id)) ≡ List.[] -- DeleteTodo is well-defined -- DeleteTodoRemoveTodoWithId : -- (todos : List Todo) (id : ℕ) → -- l.filter (λ todo → Todo.id todo ≟ id) (DeleteTodo todos id) ≡ l.[] -- DeleteTodoRemoveTodoWithId [] id = refl -- DeleteTodoRemoveTodoWithId (x ∷ xs) id with (Todo.id x ≟ id) | inspect (_≡ᵇ id) (Todo.id x) -- ... | yes px | P.[ eq ] = DeleteTodoRemoveTodoWithId xs id -- ... | no npx | P.[ eq ] rewrite eq = {! !} -- -- filterProof : v.filter (λ e → e ≟ 2) (2 v.∷ v.[]) ≡ (2 vb.∷ vb.[]) -- -- filterProof = refl -- -- filterProof' : v.filter (λ e → dec-¬ (e ≟ 2)) (2 v.∷ v.[]) ≡ vb.[] -- -- filterProof' = refl -- -- dropWhileProof : v.dropWhile (λ e → e ≟ 2) (2 v.∷ 3 v.∷ v.[]) ≡ 3 vb.∷ vb.[] -- -- dropWhileProof = refl -- -- dropWhileProof' : v.dropWhile (λ e → e ≟ 3) (2 v.∷ 3 v.∷ v.[]) ≡ (2 vb.∷ 3 vb.∷ vb.[]) -- -- dropWhileProof' = refl -- -- todoFilterProof : -- -- v.filter -- -- (λ todo → dec-¬ ((Todo.id todo) ≟ 2)) -- -- ( -- -- record -- -- { id = 2 -- -- ; completed = false -- -- ; text = "" -- -- } -- -- v.∷ -- -- record -- -- { id = 1 -- -- ; completed = false -- -- ; text = "" -- -- } -- -- v.∷ -- -- v.[] -- -- ) -- -- ≡ -- -- ( -- -- record -- -- { id = 1 -- -- ; completed = false -- -- ; text = "" -- -- } -- -- vb.∷ -- -- vb.[] -- -- ) -- -- todoFilterProof = refl -- -- should remove element from the list unless there are no elements -- -- should remove element with given id -- -- DeleteTodoRemoveTodoById : -- -- ∀ {n : ℕ} (id' : ℕ) (todos : Vec Todo n) → -- -- padRight -- -- record -- -- { id = 1 -- argmax (λ todo → λ e → e) todos) + 1 -- -- ; completed = false -- -- ; text = "" -- -- } -- -- (v.filter (λ todo → dec-¬ ((Todo.id todo) ≟ id')) (DeleteTodo todos id')) -- -- ≡ DeleteTodo todos id' -- -- DeleteTodoRemoveTodoById id' v.[] = refl -- -- DeleteTodoRemoveTodoById id' (x v.∷ xs) = {! !} (DeleteTodoRemoveTodoById xs) -- -- {-# COMPILE JS DeleteTodo = -- -- function (todos) { -- -- return function (id) { -- -- return todos.filter(function (todo) { -- -- return todo.id !== id -- -- }); -- -- } -- -- } -- -- #-} -- -- EditTodo: can't use updateAt since id doesn't necessarily correspond to Vec index -- VecTodoEditTodo : ∀ {n} → (Vec Todo n) → ℕ → String → (Vec Todo n) -- VecTodoEditTodo todos id text = -- v.map (λ todo → -- if (⌊ Todo.id todo ≟ id ⌋) -- then record todo { text = text } -- else todo) -- todos -- ListTodoEditTodo : (List Todo) → ℕ → String → (List Todo) -- ListTodoEditTodo todos id text = -- l.map (λ todo → -- if (⌊ Todo.id todo ≟ id ⌋) -- then record todo { text = text } -- else todo) -- todos -- ListTodoEditTodo-idem : -- (todos : List Todo) → -- (id' : ℕ) → -- (text : String) → -- ListTodoEditTodo (ListTodoEditTodo todos id' text) id' text ≡ ListTodoEditTodo todos id' text -- ListTodoEditTodo-idem todos id' text = -- begin -- ListTodoEditTodo (ListTodoEditTodo todos id' text) id' text -- ≡⟨ {! !} ⟩ -- ListTodoEditTodo todos id' text -- ∎ -- -- {-# COMPILE JS EditTodo = -- -- function (todos) { -- -- return function (id) { -- -- return function (text) { -- -- return todos.map(function (todo) { -- -- if (todo.id === id) { -- -- todo.text = text; -- -- } -- -- return todo; -- -- }); -- -- } -- -- } -- -- } -- -- #-} -- VecTodoCompleteTodo : ∀ {n} → (Vec Todo n) → ℕ → (Vec Todo n) -- VecTodoCompleteTodo todos id = -- v.map (λ todo → -- if (⌊ Todo.id todo ≟ id ⌋) -- then record todo { completed = true } -- else todo) -- todos -- ListTodoCompleteTodo : (List Todo) → ℕ → (List Todo) -- ListTodoCompleteTodo todos id = -- l.map (λ todo → -- if (⌊ Todo.id todo ≟ id ⌋) -- then record todo { completed = true } -- else todo) -- todos -- ListTodoCompleteTodo-idem : -- (todos : List Todo) → -- (id' : ℕ) → -- ListTodoCompleteTodo (ListTodoCompleteTodo todos id') id' ≡ ListTodoCompleteTodo todos id' -- ListTodoCompleteTodo-idem todos id' = -- begin -- ListTodoCompleteTodo (ListTodoCompleteTodo todos id') id' -- ≡⟨ {! !} ⟩ -- ListTodoCompleteTodo todos id' -- ∎ -- -- {-# COMPILE JS CompleteTodo = -- -- function (todos) { -- -- return function (id) { -- -- return todos.map(function (todo) { -- -- if (todo.id === id) { -- -- todo.completed = true; -- -- } -- -- return todo; -- -- }); -- -- } -- -- } -- -- #-} -- CompleteAllTodos : ∀ {n} → (Vec Todo n) → (Vec Todo n) -- CompleteAllTodos todos = -- v.map (λ todo → -- record todo { completed = true }) -- todos -- ListTodoCompleteAllTodos : (List Todo) → (List Todo) -- ListTodoCompleteAllTodos todos = -- l.map (λ todo → -- record todo { completed = true }) -- todos -- ListTodoCompleteAllTodos-idem : -- (todos : List Todo) → -- ListTodoCompleteAllTodos (ListTodoCompleteAllTodos todos) ≡ ListTodoCompleteAllTodos todos -- ListTodoCompleteAllTodos-idem todos = {! !} -- -- {-# COMPILE JS CompleteAllTodos = -- -- function (todos) { -- -- return todos.map(function(todo) { -- -- todo.completed = true; -- -- return todo; -- -- }); -- -- } -- -- #-} -- VecTodoClearCompleted : ∀ {n} → (Vec Todo n) → (Vec Todo n) -- VecTodoClearCompleted todos = -- padRight -- record -- { id = 1 -- argmax (λ todo → λ e → e) todos) + 1 -- ; completed = false -- ; text = "" -- } -- (v.filter (λ todo → dec-¬ ((Todo.completed todo) Bool.≟ true)) todos) -- ListTodoClearCompleted : (List Todo) → (List Todo) -- ListTodoClearCompleted todos = -- (l.filter (λ todo → dec-¬ ((Todo.completed todo) Bool.≟ true)) todos) -- ListTodoClearCompleted-idem : -- (todos : List Todo) → -- ListTodoClearCompleted (ListTodoClearCompleted todos) ≡ ListTodoClearCompleted todos -- ListTodoClearCompleted-idem todos = -- filter-idem (λ e → dec-¬ (Todo.completed e Bool.≟ true)) todos -- -- should remove all elements where completed = true -- -- should not change other elements -- -- should not change (all elements).text -- -- should not change (all elements).id -- -- {-# COMPILE JS ClearCompleted = -- -- function (todos) { -- -- return todos.filter(function(todo) { -- -- return !todo.completed; -- -- }); -- -- } -- -- #-} -- -- add-todos-length-increased-by-1 : ∀ (todos : List Todo) → length (AddTodo todos "test") -- -- add-todos-length-increased-by-1 = ? -- -- delete-todos-length-decreased-by-1-except-if-length-0 : () -- -- edit-todos-length-not-changed : () -- -- complete-todos-length-not-changed : () -- -- complete-all-todos-length-not-changed : () -- -- clear-completed-todos-not-have-completed : () -- -- should not generate duplicate ids after CLEAR_COMPLETE -- -- data Action : Set where -- -- ADD_TODO DELETE_TODO EDIT_TODO COMPLETE_TODO COMPLETE_ALL_TODOS CLEAR_COMPLETED : Action -- -- Reducer : Todos → Action → Todos -- -- Reducer todos ADD_TODO = AddTodo todos id -- -- Reducer todos DELETE_TODO = DeleteTodo todos id -- -- Reducer todos EDIT_TODO = EditTodo todos id -- -- Reducer todos COMPLETE_TODO = CompleteTodo todos id -- -- Reducer todos COMPLETE_ALL_TODOS = CompleteAllTodos todos id -- -- Reducer todos CLEAR_COMPLETED = ClearCompleted todos id
bddisasm_test/special/only_64.asm
andreaswimmer/bddisasm
675
20799
<gh_stars>100-1000 bits 64 db 0x63, 0xC1 ; MOVSXD eax, cx db 0x66, 0x63, 0xC1 ; MOVSXD eax, ecx db 0x48, 0x63, 0xC1 ; MOVSXD rax, ecx db 0x0F, 0x01, 0xF8 ; SWAPGS db 0x0F, 0x05 ; SYSCALL db 0x0F, 0x07 ; SYSRET db 0xF3, 0x0F, 0xAE, 0xC0 ; RDFSBASE eax db 0xF3, 0x0F, 0xAE, 0xC8 ; RDGSBASE eax db 0xF3, 0x0F, 0xAE, 0xD0 ; WRFSBASE eax db 0xF3, 0x0F, 0xAE, 0xD8 ; WRGSBASE eax
Driver/Socket/TCPIP/tcpipManager.asm
steakknife/pcgeos
504
88674
<filename>Driver/Socket/TCPIP/tcpipManager.asm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Geoworks 1994 -- All Rights Reserved GEOWORKS CONFIDENTIAL PROJECT: PC GEOS MODULE: TCP/IP Driver FILE: tcpipManager.asm AUTHOR: <NAME>, Jul 5, 1994 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- jwu 7/ 5/94 Initial revision DESCRIPTION: Manager file for TCP/IP driver. $Id: tcpipManager.asm,v 1.1 97/04/18 11:57:04 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;--------------------------------------------------------------------------- ; System Includes ;--------------------------------------------------------------------------- include geos.def include heap.def include geode.def ifdef FULL_EXECUTE_IN_PLACE include Internal/xip.def ; must be included *before* resource.def endif include resource.def include ec.def include system.def include library.def include object.def include timer.def include timedate.def include driver.def include thread.def include Internal/semInt.def include sem.def include Internal/heapInt.def include Internal/im.def include Internal/threadIn.def include file.def include localize.def include initfile.def include chunkarr.def include assert.def include Objects/processC.def include medium.def ;--------------------------------------------------------------------------- ; System Libraries ;--------------------------------------------------------------------------- UseLib ui.def UseLib Objects/vTextC.def UseLib socket.def UseLib sac.def UseLib Internal/netutils.def UseLib Internal/socketInt.def UseLib resolver.def ;--------------------------------------------------------------------------- ; Driver Declaration ;--------------------------------------------------------------------------- DefDriver Internal/ip.def ;--------------------------------------------------------------------------- ; Internal def files ;--------------------------------------------------------------------------- include tcpip.def include tcpipGlobal.def include tcpipAddrCtrl.def include dhcpConstant.def ;--------------------------------------------------------------------------- ; Compiled UI definitions ;--------------------------------------------------------------------------- include tcpipStrings.rdef include tcpipAddrCtrl.rdef ;--------------------------------------------------------------------------- ; Code files ;--------------------------------------------------------------------------- include tcpipEntry.asm include tcpipSocket.asm include tcpipLink.asm include tcpipUtils.asm include tcpipAddrCtrl.asm include tcpipDhcp.asm ifdef WRITE_LOG_FILE include tcpipLog.asm endif
test/Fail/UselessPrivateImport.agda
shlevy/agda
1,989
13523
<reponame>shlevy/agda {-# OPTIONS --warning=error #-} module UselessPrivateImport where private open import Common.Prelude
Esercizi/Peso di una parola (numeri di 1 o 0 presenti in posizione pari o dispari)/Calcola quanti '1' o '0' sono presenti in posizione pari o dispari.asm
lucafioravanti/MIPS
0
104403
# Caricato con LI un valore in un registro, # calcolare quanti bit di peso '1' sono presenti nelle posizioni pari # # esempio: 0x55555555 = 0101 0101 0101 0101 0101 0101 0101 0101 => n = 0 # esempio: 0xaaaaaaaa = 1010 1010 1010 1010 1010 1010 1010 1010 => n = 16 .text li $t0, 0x55555555 li $t1, 0x00000002 ## se voglio contare nelle pos. dispari metto 1 ## se voglio contare nelle pos. pari metto 2 loop: and $t2, $t0, $t1 # AND = mascheratura, nasconde i bit. Esce 1 solo con 1-1 in ingresso. bne $t2, $zero, uno # controllo se and ha dato risultato positivo e salto j zero uno: addi $s0, $s0, 1 zero: sll $t1, $t1, 2 # scorro di due posizioni per controllare il prossimo bit slti $s1, $s2, 15 # s1 = 1 se ho finito addi $s2, $s2, 1 # incremento ciclo bne $s1, $zero, loop # se non ho finito, faccio nuovo ciclo li $v0, 10 syscall # in s0 ho il risultato. ## se voglio contare gli zeri, ## ## loop: ## and $t2, $t0, $t1 ## beq $t2, $zero, zero ## j uno ## ## e invero i nomi delle etichette sotto
awa/src/awa-modules-get.ads
fuzzysloth/ada-awa
81
24055
----------------------------------------------------------------------- -- awa-modules-get -- Get a specific module instance -- Copyright (C) 2011 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- The <b>Get</b> function is an helper that retrieves a given module -- instance from the current application. generic type Module_Type is new Module with private; type Module_Type_Access is access all Module_Type'Class; Name : String; function AWA.Modules.Get return Module_Type_Access;
lib/sprites.asm
c64lib/chipset
11
243797
#import "vic2.asm" #importonce .filenamespace c64lib /* * Calculates sprite X position register address */ .function spriteXReg(spriteNo) { .return VIC2 + spriteNo * 2 } .assert "Reg address for sprite0 X pos", spriteXReg(0), SPRITE_0_X .assert "Reg address for sprite7 X pos", spriteXReg(7), SPRITE_7_X /* * Calculates sprite Y position register address */ .function spriteYReg(spriteNo) { .return spriteXReg(spriteNo) + 1 } .assert "Reg address for sprite0 Y pos", spriteYReg(0), SPRITE_0_Y .assert "Reg address for sprite7 Y pos", spriteYReg(7), SPRITE_7_Y /* * Calculates sprite bit position */ .function spriteMask(spriteNo) { .return pow(2, spriteNo) } .assert "Bit mask for sprite 0", spriteMask(0), %00000001 .assert "Bit mask for sprite 7", spriteMask(7), %10000000 /* * Calculate sprite color register address */ .function spriteColorReg(spriteNo) { .return SPRITE_0_COLOR + spriteNo } .assert "Reg address for sprite0 color", spriteColorReg(0), SPRITE_0_COLOR .assert "Reg address for sprite7 color", spriteColorReg(7), SPRITE_7_COLOR /* * Sets X position of given sprite (uses sprite MSB register if necessary) * MOD: A */ .macro locateSpriteX(x, spriteNo) { .if (x > 255) { lda #<x sta spriteXReg(spriteNo) lda SPRITE_MSB_X ora #spriteMask(spriteNo) sta SPRITE_MSB_X } else { lda #x sta spriteXReg(spriteNo) } } .assert "locateSpriteX stores X in SPRITE_X reg", { locateSpriteX(5, 3) }, { lda #$05 sta SPRITE_3_X } .assert "locateSpriteX stores X in SPRITE_X and MSB regs", { locateSpriteX(257, 3) }, { lda #$01 sta SPRITE_3_X lda SPRITE_MSB_X ora #%00001000 sta SPRITE_MSB_X } /* * Sets Y position of given sprite * MOD: A */ .macro locateSpriteY(y, spriteNo) { lda #y sta spriteYReg(spriteNo) } .assert "locateSpriteY stores Y in SPRITE_Y reg", { locateSpriteY(5, 3) }, { lda #$05 sta SPRITE_3_Y } /* * Sets X,Y position of given sprite * MOD A */ .macro locateSprite(x, y, spriteNo) { locateSpriteX(x, spriteNo) locateSpriteY(y, spriteNo) } .macro sh(data) { .assert "Hires sprite line length must be 24", data.size(), 24 .byte convertHires(data.substring(0, 8)), convertHires(data.substring(8, 16)), convertHires(data.substring(16,24)) } .macro sm(data) { .assert "Multicolor sprite line length must be 12", data.size(), 12 .byte convertMultic(data.substring(0, 4)), convertMultic(data.substring(4, 8)), convertMultic(data.substring(8,12)) }
src/ada/src/comms/uxas-comms-transport-zeromq_socket_configurations.adb
VVCAS-Sean/OpenUxAS
88
604
<reponame>VVCAS-Sean/OpenUxAS package body UxAS.Comms.Transport.ZeroMQ_Socket_Configurations is ---------- -- Make -- ---------- function Make (Network_Name : String; Socket_Address : String; Is_Receive : Boolean; Zmq_Socket_Type : ZMQ.Sockets.Socket_Type; Number_Of_IO_Threads : Positive; Is_Server_Bind : Boolean; Receive_High_Water_Mark : Int32; Send_High_Water_Mark : Int32) return ZeroMq_Socket_Configuration is Result : ZeroMq_Socket_Configuration; begin Result.Is_Receive := Is_Receive; Copy (Network_Name, To => Result.Network_Name); Copy (Socket_Address, To => Result.Socket_Address); Result.Zmq_Socket_Type := Zmq_Socket_Type; Result.Number_Of_IO_Threads := Number_Of_IO_Threads; Result.Is_Server_Bind := Is_Server_Bind; Result.Receive_High_Water_Mark := Receive_High_Water_Mark; Result.Send_High_Water_Mark := Send_High_Water_Mark; return Result; end Make; end UxAS.Comms.Transport.ZeroMQ_Socket_Configurations;
agda-stdlib/src/Data/List/Relation/Unary/All/Properties.agda
DreamLinuxer/popl21-artifact
5
4241
<gh_stars>1-10 ------------------------------------------------------------------------ -- The Agda standard library -- -- Properties related to All ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.List.Relation.Unary.All.Properties where open import Axiom.Extensionality.Propositional using (Extensionality) open import Data.Bool.Base using (Bool; T; true; false) open import Data.Bool.Properties using (T-∧) open import Data.Empty open import Data.Fin.Base using (Fin) renaming (zero to fzero; suc to fsuc) open import Data.List.Base as List using ( List; []; _∷_; [_]; _∷ʳ_; fromMaybe; null; _++_; concat; map; mapMaybe ; inits; tails; drop; take; applyUpTo; applyDownFrom; replicate; tabulate ; filter; zipWith; all; derun; deduplicate ) open import Data.List.Membership.Propositional open import Data.List.Membership.Propositional.Properties open import Data.List.Relation.Unary.All as All using ( All; []; _∷_; lookup; updateAt ; _[_]=_; here; there ; Null ) open import Data.List.Relation.Unary.Any as Any using (Any; here; there) import Data.List.Relation.Binary.Equality.Setoid as ListEq using (_≋_; []; _∷_) open import Data.List.Relation.Binary.Pointwise using (Pointwise; []; _∷_) open import Data.List.Relation.Binary.Subset.Propositional using (_⊆_) open import Data.Maybe.Base as Maybe using (Maybe; just; nothing) open import Data.Maybe.Relation.Unary.All as MAll using (just; nothing) open import Data.Nat.Base using (zero; suc; z≤n; s≤s; _<_) open import Data.Nat.Properties using (≤-refl; ≤-step) open import Data.Product as Prod using (_×_; _,_; uncurry; uncurry′) open import Function.Base open import Function.Equality using (_⟨$⟩_) open import Function.Equivalence using (_⇔_; equivalence; Equivalence) open import Function.Inverse using (_↔_; inverse) open import Function.Surjection using (_↠_; surjection) open import Level using (Level) open import Relation.Binary as B using (REL; Setoid; _Respects_) open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong; cong₂; _≗_) open import Relation.Nullary.Reflects using (invert) open import Relation.Nullary open import Relation.Nullary.Negation using (¬?; contradiction; decidable-stable) open import Relation.Unary using (Decidable; Pred; Universal) renaming (_⊆_ to _⋐_) private variable a b c p q r ℓ : Level A : Set a B : Set b C : Set c ------------------------------------------------------------------------ -- Properties regarding Null Null⇒null : ∀ {xs : List A} → Null xs → T (null xs) Null⇒null [] = _ null⇒Null : ∀ {xs : List A} → T (null xs) → Null xs null⇒Null {xs = [] } _ = [] null⇒Null {xs = _ ∷ _} () ------------------------------------------------------------------------ -- Properties of the "points-to" relation _[_]=_ module _ {p} {P : Pred A p} where -- Relation _[_]=_ is deterministic: each index points to a single value. []=-injective : ∀ {x xs} {px qx : P x} {pxs : All P xs} {i : x ∈ xs} → pxs [ i ]= px → pxs [ i ]= qx → px ≡ qx []=-injective here here = refl []=-injective (there x↦px) (there x↦qx) = []=-injective x↦px x↦qx -- See also Data.List.Relation.Unary.All.Properties.WithK.[]=-irrelevant. ------------------------------------------------------------------------ -- Lemmas relating Any, All and negation. module _ {P : A → Set p} where ¬Any⇒All¬ : ∀ xs → ¬ Any P xs → All (¬_ ∘ P) xs ¬Any⇒All¬ [] ¬p = [] ¬Any⇒All¬ (x ∷ xs) ¬p = ¬p ∘ here ∷ ¬Any⇒All¬ xs (¬p ∘ there) All¬⇒¬Any : ∀ {xs} → All (¬_ ∘ P) xs → ¬ Any P xs All¬⇒¬Any (¬p ∷ _) (here p) = ¬p p All¬⇒¬Any (_ ∷ ¬p) (there p) = All¬⇒¬Any ¬p p ¬All⇒Any¬ : Decidable P → ∀ xs → ¬ All P xs → Any (¬_ ∘ P) xs ¬All⇒Any¬ dec [] ¬∀ = ⊥-elim (¬∀ []) ¬All⇒Any¬ dec (x ∷ xs) ¬∀ with dec x ... | true because [p] = there (¬All⇒Any¬ dec xs (¬∀ ∘ _∷_ (invert [p]))) ... | false because [¬p] = here (invert [¬p]) Any¬⇒¬All : ∀ {xs} → Any (¬_ ∘ P) xs → ¬ All P xs Any¬⇒¬All (here ¬p) = ¬p ∘ All.head Any¬⇒¬All (there ¬p) = Any¬⇒¬All ¬p ∘ All.tail ¬Any↠All¬ : ∀ {xs} → (¬ Any P xs) ↠ All (¬_ ∘ P) xs ¬Any↠All¬ = surjection (¬Any⇒All¬ _) All¬⇒¬Any to∘from where to∘from : ∀ {xs} (¬p : All (¬_ ∘ P) xs) → ¬Any⇒All¬ xs (All¬⇒¬Any ¬p) ≡ ¬p to∘from [] = refl to∘from (¬p ∷ ¬ps) = cong₂ _∷_ refl (to∘from ¬ps) -- If equality of functions were extensional, then the surjection -- could be strengthened to a bijection. from∘to : Extensionality _ _ → ∀ xs → (¬p : ¬ Any P xs) → All¬⇒¬Any (¬Any⇒All¬ xs ¬p) ≡ ¬p from∘to ext [] ¬p = ext λ () from∘to ext (x ∷ xs) ¬p = ext λ { (here p) → refl ; (there p) → cong (λ f → f p) $ from∘to ext xs (¬p ∘ there) } Any¬⇔¬All : ∀ {xs} → Decidable P → Any (¬_ ∘ P) xs ⇔ (¬ All P xs) Any¬⇔¬All dec = equivalence Any¬⇒¬All (¬All⇒Any¬ dec _) where -- If equality of functions were extensional, then the logical -- equivalence could be strengthened to a surjection. to∘from : Extensionality _ _ → ∀ {xs} (¬∀ : ¬ All P xs) → Any¬⇒¬All (¬All⇒Any¬ dec xs ¬∀) ≡ ¬∀ to∘from ext ¬∀ = ext (⊥-elim ∘ ¬∀) module _ {_~_ : REL A B ℓ} where All-swap : ∀ {xs ys} → All (λ x → All (x ~_) ys) xs → All (λ y → All (_~ y) xs) ys All-swap {ys = []} _ = [] All-swap {ys = y ∷ ys} [] = All.universal (λ _ → []) (y ∷ ys) All-swap {ys = y ∷ ys} ((x~y ∷ x~ys) ∷ pxs) = (x~y ∷ (All.map All.head pxs)) ∷ All-swap (x~ys ∷ (All.map All.tail pxs)) ------------------------------------------------------------------------ -- Defining properties of lookup and _[_]=_ -- -- pxs [ i ]= px if and only if lookup pxs i = px. module _ {P : A → Set p} where -- `i` points to `lookup pxs i` in `pxs`. []=lookup : ∀ {x xs} (pxs : All P xs) (i : x ∈ xs) → pxs [ i ]= lookup pxs i []=lookup (px ∷ pxs) (here refl) = here []=lookup (px ∷ pxs) (there i) = there ([]=lookup pxs i) -- If `i` points to `px` in `pxs`, then `lookup pxs i ≡ px`. []=⇒lookup : ∀ {x xs} {px : P x} {pxs : All P xs} {i : x ∈ xs} → pxs [ i ]= px → lookup pxs i ≡ px []=⇒lookup x↦px = []=-injective ([]=lookup _ _) x↦px -- If `lookup pxs i ≡ px`, then `i` points to `px` in `pxs`. lookup⇒[]= : ∀{x xs} {px : P x} (pxs : All P xs) (i : x ∈ xs) → lookup pxs i ≡ px → pxs [ i ]= px lookup⇒[]= pxs i refl = []=lookup pxs i ------------------------------------------------------------------------ -- Properties of operations over `All` ------------------------------------------------------------------------ -- map module _ {P : Pred A p} {Q : Pred A q} {f : P ⋐ Q} where map-cong : ∀ {xs} {g : P ⋐ Q} (pxs : All P xs) → (∀ {x} → f {x} ≗ g) → All.map f pxs ≡ All.map g pxs map-cong [] _ = refl map-cong (px ∷ pxs) feq = cong₂ _∷_ (feq px) (map-cong pxs feq) map-id : ∀ {xs} (pxs : All P xs) → All.map id pxs ≡ pxs map-id [] = refl map-id (px ∷ pxs) = cong (px ∷_) (map-id pxs) map-compose : ∀ {r} {R : Pred A r} {xs} {g : Q ⋐ R} (pxs : All P xs) → All.map g (All.map f pxs) ≡ All.map (g ∘ f) pxs map-compose [] = refl map-compose (px ∷ pxs) = cong (_ ∷_) (map-compose pxs) lookup-map : ∀ {xs x} (pxs : All P xs) (i : x ∈ xs) → lookup (All.map f pxs) i ≡ f (lookup pxs i) lookup-map (px ∷ pxs) (here refl) = refl lookup-map (px ∷ pxs) (there i) = lookup-map pxs i ------------------------------------------------------------------------ -- _[_]%=_ / updateAt module _ {P : Pred A p} where -- Defining properties of updateAt: -- (+) updateAt actually updates the element at the given index. updateAt-updates : ∀ {x xs} (i : x ∈ xs) {f : P x → P x} {px : P x} (pxs : All P xs) → pxs [ i ]= px → updateAt i f pxs [ i ]= f px updateAt-updates (here refl) (px ∷ pxs) here = here updateAt-updates (there i) (px ∷ pxs) (there x↦px) = there (updateAt-updates i pxs x↦px) -- (-) updateAt i does not touch the elements at other indices. updateAt-minimal : ∀ {x y xs} (i : x ∈ xs) (j : y ∈ xs) → ∀ {f : P y → P y} {px : P x} (pxs : All P xs) → i ≢∈ j → pxs [ i ]= px → updateAt j f pxs [ i ]= px updateAt-minimal (here .refl) (here refl) (px ∷ pxs) i≢j here = ⊥-elim (i≢j refl refl) updateAt-minimal (here .refl) (there j) (px ∷ pxs) i≢j here = here updateAt-minimal (there i) (here refl) (px ∷ pxs) i≢j (there val) = there val updateAt-minimal (there i) (there j) (px ∷ pxs) i≢j (there val) = there (updateAt-minimal i j pxs (there-injective-≢∈ i≢j) val) -- lookup after updateAt reduces. -- For same index this is an easy consequence of updateAt-updates -- using []=↔lookup. lookup∘updateAt : ∀ {x xs} (pxs : All P xs) (i : x ∈ xs) {f : P x → P x} → lookup (updateAt i f pxs) i ≡ f (lookup pxs i) lookup∘updateAt pxs i = []=⇒lookup (updateAt-updates i pxs (lookup⇒[]= pxs i refl)) -- For different indices it easily follows from updateAt-minimal. lookup∘updateAt′ : ∀ {x y xs} (i : x ∈ xs) (j : y ∈ xs) → ∀ {f : P y → P y} {px : P x} (pxs : All P xs) → i ≢∈ j → lookup (updateAt j f pxs) i ≡ lookup pxs i lookup∘updateAt′ i j pxs i≢j = []=⇒lookup (updateAt-minimal i j pxs i≢j (lookup⇒[]= pxs i refl)) -- The other properties are consequences of (+) and (-). -- We spell the most natural properties out. -- Direct inductive proofs are in most cases easier than just using -- the defining properties. -- In the explanations, we make use of shorthand f = g ↾ x -- meaning that f and g agree at point x, i.e. f x ≡ g x. -- updateAt (i : x ∈ xs) is a morphism -- from the monoid of endofunctions P x → P x -- to the monoid of endofunctions All P xs → All P xs. -- 1a. relative identity: f = id ↾ (lookup pxs i) -- implies updateAt i f = id ↾ pxs updateAt-id-relative : ∀ {x xs} (i : x ∈ xs) {f : P x → P x} (pxs : All P xs) → f (lookup pxs i) ≡ lookup pxs i → updateAt i f pxs ≡ pxs updateAt-id-relative (here refl)(px ∷ pxs) eq = cong (_∷ pxs) eq updateAt-id-relative (there i) (px ∷ pxs) eq = cong (px ∷_) (updateAt-id-relative i pxs eq) -- 1b. identity: updateAt i id ≗ id updateAt-id : ∀ {x xs} (i : x ∈ xs) (pxs : All P xs) → updateAt i id pxs ≡ pxs updateAt-id i pxs = updateAt-id-relative i pxs refl -- 2a. relative composition: f ∘ g = h ↾ (lookup i pxs) -- implies updateAt i f ∘ updateAt i g = updateAt i h ↾ pxs updateAt-compose-relative : ∀ {x xs} (i : x ∈ xs) {f g h : P x → P x} (pxs : All P xs) → f (g (lookup pxs i)) ≡ h (lookup pxs i) → updateAt i f (updateAt i g pxs) ≡ updateAt i h pxs updateAt-compose-relative (here refl) (px ∷ pxs) fg=h = cong (_∷ pxs) fg=h updateAt-compose-relative (there i) (px ∷ pxs) fg=h = cong (px ∷_) (updateAt-compose-relative i pxs fg=h) -- 2b. composition: updateAt i f ∘ updateAt i g ≗ updateAt i (f ∘ g) updateAt-compose : ∀ {x xs} (i : x ∈ xs) {f g : P x → P x} → updateAt {P = P} i f ∘ updateAt i g ≗ updateAt i (f ∘ g) updateAt-compose (here refl) (px ∷ pxs) = refl updateAt-compose (there i) (px ∷ pxs) = cong (px ∷_) (updateAt-compose i pxs) -- 3. congruence: updateAt i is a congruence wrt. extensional equality. -- 3a. If f = g ↾ (lookup pxs i) -- then updateAt i f = updateAt i g ↾ pxs updateAt-cong-relative : ∀ {x xs} (i : x ∈ xs) {f g : P x → P x} (pxs : All P xs) → f (lookup pxs i) ≡ g (lookup pxs i) → updateAt i f pxs ≡ updateAt i g pxs updateAt-cong-relative (here refl) (px ∷ pxs) f=g = cong (_∷ pxs) f=g updateAt-cong-relative (there i) (px ∷ pxs) f=g = cong (px ∷_) (updateAt-cong-relative i pxs f=g) -- 3b. congruence: f ≗ g → updateAt i f ≗ updateAt i g updateAt-cong : ∀ {x xs} (i : x ∈ xs) {f g : P x → P x} → f ≗ g → updateAt i f ≗ updateAt i g updateAt-cong i f≗g pxs = updateAt-cong-relative i pxs (f≗g (lookup pxs i)) -- The order of updates at different indices i ≢ j does not matter. -- This a consequence of updateAt-updates and updateAt-minimal -- but easier to prove inductively. updateAt-commutes : ∀ {x y xs} (i : x ∈ xs) (j : y ∈ xs) → ∀ {f : P x → P x} {g : P y → P y} → i ≢∈ j → updateAt i f ∘ updateAt j g ≗ updateAt j g ∘ updateAt i f updateAt-commutes (here refl) (here refl) i≢j (px ∷ pxs) = ⊥-elim (i≢j refl refl) updateAt-commutes (here refl) (there j) i≢j (px ∷ pxs) = refl updateAt-commutes (there i) (here refl) i≢j (px ∷ pxs) = refl updateAt-commutes (there i) (there j) i≢j (px ∷ pxs) = cong (px ∷_) (updateAt-commutes i j (there-injective-≢∈ i≢j) pxs) module _ {P : Pred A p} {Q : Pred A q} where map-updateAt : ∀ {x xs} {f : P ⋐ Q} {g : P x → P x} {h : Q x → Q x} (pxs : All P xs) (i : x ∈ xs) → f (g (lookup pxs i)) ≡ h (f (lookup pxs i)) → All.map f (pxs All.[ i ]%= g) ≡ (All.map f pxs) All.[ i ]%= h map-updateAt (px ∷ pxs) (here refl) = cong (_∷ _) map-updateAt (px ∷ pxs) (there i) feq = cong (_ ∷_) (map-updateAt pxs i feq) ------------------------------------------------------------------------ -- Introduction (⁺) and elimination (⁻) rules for list operations ------------------------------------------------------------------------ -- map module _ {P : B → Set p} {f : A → B} where map⁺ : ∀ {xs} → All (P ∘ f) xs → All P (map f xs) map⁺ [] = [] map⁺ (p ∷ ps) = p ∷ map⁺ ps map⁻ : ∀ {xs} → All P (map f xs) → All (P ∘ f) xs map⁻ {xs = []} [] = [] map⁻ {xs = _ ∷ _} (p ∷ ps) = p ∷ map⁻ ps -- A variant of All.map. module _ {P : A → Set p} {Q : B → Set q} {f : A → B} where gmap : P ⋐ Q ∘ f → All P ⋐ All Q ∘ map f gmap g = map⁺ ∘ All.map g ------------------------------------------------------------------------ -- mapMaybe module _ (P : B → Set p) {f : A → Maybe B} where mapMaybe⁺ : ∀ {xs} → All (MAll.All P) (map f xs) → All P (mapMaybe f xs) mapMaybe⁺ {[]} [] = [] mapMaybe⁺ {x ∷ xs} (px ∷ pxs) with f x ... | nothing = mapMaybe⁺ pxs ... | just v with px ... | just pv = pv ∷ mapMaybe⁺ pxs ------------------------------------------------------------------------ -- _++_ module _ {P : A → Set p} where ++⁺ : ∀ {xs ys} → All P xs → All P ys → All P (xs ++ ys) ++⁺ [] pys = pys ++⁺ (px ∷ pxs) pys = px ∷ ++⁺ pxs pys ++⁻ˡ : ∀ xs {ys} → All P (xs ++ ys) → All P xs ++⁻ˡ [] p = [] ++⁻ˡ (x ∷ xs) (px ∷ pxs) = px ∷ (++⁻ˡ _ pxs) ++⁻ʳ : ∀ xs {ys} → All P (xs ++ ys) → All P ys ++⁻ʳ [] p = p ++⁻ʳ (x ∷ xs) (px ∷ pxs) = ++⁻ʳ xs pxs ++⁻ : ∀ xs {ys} → All P (xs ++ ys) → All P xs × All P ys ++⁻ [] p = [] , p ++⁻ (x ∷ xs) (px ∷ pxs) = Prod.map (px ∷_) id (++⁻ _ pxs) ++↔ : ∀ {xs ys} → (All P xs × All P ys) ↔ All P (xs ++ ys) ++↔ {xs} = inverse (uncurry ++⁺) (++⁻ xs) ++⁻∘++⁺ (++⁺∘++⁻ xs) where ++⁺∘++⁻ : ∀ xs {ys} (p : All P (xs ++ ys)) → uncurry′ ++⁺ (++⁻ xs p) ≡ p ++⁺∘++⁻ [] p = refl ++⁺∘++⁻ (x ∷ xs) (px ∷ pxs) = cong (_∷_ px) $ ++⁺∘++⁻ xs pxs ++⁻∘++⁺ : ∀ {xs ys} (p : All P xs × All P ys) → ++⁻ xs (uncurry ++⁺ p) ≡ p ++⁻∘++⁺ ([] , pys) = refl ++⁻∘++⁺ (px ∷ pxs , pys) rewrite ++⁻∘++⁺ (pxs , pys) = refl ------------------------------------------------------------------------ -- concat module _ {P : A → Set p} where concat⁺ : ∀ {xss} → All (All P) xss → All P (concat xss) concat⁺ [] = [] concat⁺ (pxs ∷ pxss) = ++⁺ pxs (concat⁺ pxss) concat⁻ : ∀ {xss} → All P (concat xss) → All (All P) xss concat⁻ {[]} [] = [] concat⁻ {xs ∷ xss} pxs = ++⁻ˡ xs pxs ∷ concat⁻ (++⁻ʳ xs pxs) ------------------------------------------------------------------------ -- take and drop module _ {P : A → Set p} where drop⁺ : ∀ {xs} n → All P xs → All P (drop n xs) drop⁺ zero pxs = pxs drop⁺ (suc n) [] = [] drop⁺ (suc n) (px ∷ pxs) = drop⁺ n pxs take⁺ : ∀ {xs} n → All P xs → All P (take n xs) take⁺ zero pxs = [] take⁺ (suc n) [] = [] take⁺ (suc n) (px ∷ pxs) = px ∷ take⁺ n pxs ------------------------------------------------------------------------ -- applyUpTo module _ {P : A → Set p} where applyUpTo⁺₁ : ∀ f n → (∀ {i} → i < n → P (f i)) → All P (applyUpTo f n) applyUpTo⁺₁ f zero Pf = [] applyUpTo⁺₁ f (suc n) Pf = Pf (s≤s z≤n) ∷ applyUpTo⁺₁ (f ∘ suc) n (Pf ∘ s≤s) applyUpTo⁺₂ : ∀ f n → (∀ i → P (f i)) → All P (applyUpTo f n) applyUpTo⁺₂ f n Pf = applyUpTo⁺₁ f n (λ _ → Pf _) applyUpTo⁻ : ∀ f n → All P (applyUpTo f n) → ∀ {i} → i < n → P (f i) applyUpTo⁻ f (suc n) (px ∷ _) (s≤s z≤n) = px applyUpTo⁻ f (suc n) (_ ∷ pxs) (s≤s (s≤s i<n)) = applyUpTo⁻ (f ∘ suc) n pxs (s≤s i<n) ------------------------------------------------------------------------ -- applyDownFrom module _ {P : A → Set p} where applyDownFrom⁺₁ : ∀ f n → (∀ {i} → i < n → P (f i)) → All P (applyDownFrom f n) applyDownFrom⁺₁ f zero Pf = [] applyDownFrom⁺₁ f (suc n) Pf = Pf ≤-refl ∷ applyDownFrom⁺₁ f n (Pf ∘ ≤-step) applyDownFrom⁺₂ : ∀ f n → (∀ i → P (f i)) → All P (applyDownFrom f n) applyDownFrom⁺₂ f n Pf = applyDownFrom⁺₁ f n (λ _ → Pf _) ------------------------------------------------------------------------ -- tabulate module _ {P : A → Set p} where tabulate⁺ : ∀ {n} {f : Fin n → A} → (∀ i → P (f i)) → All P (tabulate f) tabulate⁺ {zero} Pf = [] tabulate⁺ {suc n} Pf = Pf fzero ∷ tabulate⁺ (Pf ∘ fsuc) tabulate⁻ : ∀ {n} {f : Fin n → A} → All P (tabulate f) → (∀ i → P (f i)) tabulate⁻ {suc n} (px ∷ _) fzero = px tabulate⁻ {suc n} (_ ∷ pf) (fsuc i) = tabulate⁻ pf i ------------------------------------------------------------------------ -- remove module _ {P : A → Set p} {Q : A → Set q} where ─⁺ : ∀ {xs} (p : Any P xs) → All Q xs → All Q (xs Any.─ p) ─⁺ (here px) (_ ∷ qs) = qs ─⁺ (there p) (q ∷ qs) = q ∷ ─⁺ p qs ─⁻ : ∀ {xs} (p : Any P xs) → Q (Any.lookup p) → All Q (xs Any.─ p) → All Q xs ─⁻ (here px) q qs = q ∷ qs ─⁻ (there p) q (q′ ∷ qs) = q′ ∷ ─⁻ p q qs ------------------------------------------------------------------------ -- filter module _ {P : A → Set p} (P? : Decidable P) where all-filter : ∀ xs → All P (filter P? xs) all-filter [] = [] all-filter (x ∷ xs) with P? x ... | true because [Px] = invert [Px] ∷ all-filter xs ... | false because _ = all-filter xs module _ {P : A → Set p} {Q : A → Set q} (P? : Decidable P) where filter⁺ : ∀ {xs} → All Q xs → All Q (filter P? xs) filter⁺ {xs = _} [] = [] filter⁺ {xs = x ∷ _} (Qx ∷ Qxs) with does (P? x) ... | false = filter⁺ Qxs ... | true = Qx ∷ filter⁺ Qxs filter⁻ : ∀ {xs} → All Q (filter P? xs) → All Q (filter (¬? ∘ P?) xs) → All Q xs filter⁻ {[]} [] [] = [] filter⁻ {x ∷ xs} all⁺ all⁻ with P? x | ¬? (P? x) filter⁻ {x ∷ xs} all⁺ all⁻ | yes Px | yes ¬Px = contradiction Px ¬Px filter⁻ {x ∷ xs} (qx ∷ all⁺) all⁻ | yes Px | no ¬¬Px = qx ∷ filter⁻ all⁺ all⁻ filter⁻ {x ∷ xs} all⁺ (qx ∷ all⁻) | no _ | yes ¬Px = qx ∷ filter⁻ all⁺ all⁻ filter⁻ {x ∷ xs} all⁺ all⁻ | no ¬Px | no ¬¬Px = contradiction ¬Px ¬¬Px ------------------------------------------------------------------------ -- derun and deduplicate module _ {P : A → Set p} {R : A → A → Set q} (R? : B.Decidable R) where derun⁺ : ∀ {xs} → All P xs → All P (derun R? xs) derun⁺ {[]} [] = [] derun⁺ {x ∷ []} (px ∷ []) = px ∷ [] derun⁺ {x ∷ y ∷ xs} (px ∷ all[P,y∷xs]) with does (R? x y) ... | false = px ∷ derun⁺ all[P,y∷xs] ... | true = derun⁺ all[P,y∷xs] deduplicate⁺ : ∀ {xs} → All P xs → All P (deduplicate R? xs) deduplicate⁺ [] = [] deduplicate⁺ {x ∷ _} (px ∷ all[P,xs]) = px ∷ filter⁺ (¬? ∘ R? x) (deduplicate⁺ all[P,xs]) derun⁻ : P B.Respects (flip R) → ∀ xs → All P (derun R? xs) → All P xs derun⁻ P-resp-R [] [] = [] derun⁻ P-resp-R (x ∷ xs) all[P,x∷xs] = aux x xs all[P,x∷xs] where aux : ∀ x xs → All P (derun R? (x ∷ xs)) → All P (x ∷ xs) aux x [] (px ∷ []) = px ∷ [] aux x (y ∷ xs) all[P,x∷y∷xs] with R? x y aux x (y ∷ xs) all[P,y∷xs] | yes Rxy with aux y xs all[P,y∷xs] aux x (y ∷ xs) all[P,y∷xs] | yes Rxy | r@(py ∷ _) = P-resp-R Rxy py ∷ r aux x (y ∷ xs) (px ∷ all[P,y∷xs]) | no _ = px ∷ aux y xs all[P,y∷xs] module _ (P-resp-R : P B.Respects R) where deduplicate⁻ : ∀ xs → All P (deduplicate R? xs) → All P xs deduplicate⁻ [] [] = [] deduplicate⁻ (x ∷ xs) (px ∷ app[P,dedup[xs]]) = px ∷ deduplicate⁻ xs (filter⁻ (¬? ∘ R? x) app[P,dedup[xs]] (All.tabulate aux)) where aux : ∀ {z} → z ∈ filter (¬? ∘ ¬? ∘ R? x) (deduplicate R? xs) → P z aux {z} z∈filter = P-resp-R (decidable-stable (R? x z) (Prod.proj₂ (∈-filter⁻ (¬? ∘ ¬? ∘ R? x) {z} {deduplicate R? xs} z∈filter))) px ------------------------------------------------------------------------ -- zipWith module _ (P : C → Set p) (f : A → B → C) where zipWith⁺ : ∀ {xs ys} → Pointwise (λ x y → P (f x y)) xs ys → All P (zipWith f xs ys) zipWith⁺ [] = [] zipWith⁺ (Pfxy ∷ Pfxsys) = Pfxy ∷ zipWith⁺ Pfxsys ------------------------------------------------------------------------ -- Operations for constructing lists ------------------------------------------------------------------------ -- singleton module _ {P : A → Set p} where singleton⁻ : ∀ {x} → All P [ x ] → P x singleton⁻ (px ∷ []) = px ------------------------------------------------------------------------ -- snoc module _ {P : A → Set p} {x xs} where ∷ʳ⁺ : All P xs → P x → All P (xs ∷ʳ x) ∷ʳ⁺ pxs px = ++⁺ pxs (px ∷ []) ∷ʳ⁻ : All P (xs ∷ʳ x) → All P xs × P x ∷ʳ⁻ pxs = Prod.map₂ singleton⁻ $ ++⁻ xs pxs ------------------------------------------------------------------------ -- fromMaybe module _ {P : A → Set p} where fromMaybe⁺ : ∀ {mx} → MAll.All P mx → All P (fromMaybe mx) fromMaybe⁺ (just px) = px ∷ [] fromMaybe⁺ nothing = [] fromMaybe⁻ : ∀ mx → All P (fromMaybe mx) → MAll.All P mx fromMaybe⁻ (just x) (px ∷ []) = just px fromMaybe⁻ nothing p = nothing ------------------------------------------------------------------------ -- replicate module _ {P : A → Set p} where replicate⁺ : ∀ n {x} → P x → All P (replicate n x) replicate⁺ zero px = [] replicate⁺ (suc n) px = px ∷ replicate⁺ n px replicate⁻ : ∀ {n x} → All P (replicate (suc n) x) → P x replicate⁻ (px ∷ _) = px ------------------------------------------------------------------------ -- inits module _ {P : A → Set p} where inits⁺ : ∀ {xs} → All P xs → All (All P) (inits xs) inits⁺ [] = [] ∷ [] inits⁺ (px ∷ pxs) = [] ∷ gmap (px ∷_) (inits⁺ pxs) inits⁻ : ∀ xs → All (All P) (inits xs) → All P xs inits⁻ [] pxs = [] inits⁻ (x ∷ []) ([] ∷ p[x] ∷ []) = p[x] inits⁻ (x ∷ xs@(_ ∷ _)) ([] ∷ pxs@(p[x] ∷ _)) = singleton⁻ p[x] ∷ inits⁻ xs (All.map (drop⁺ 1) (map⁻ pxs)) ------------------------------------------------------------------------ -- tails module _ {P : A → Set p} where tails⁺ : ∀ {xs} → All P xs → All (All P) (tails xs) tails⁺ [] = [] ∷ [] tails⁺ pxxs@(_ ∷ pxs) = pxxs ∷ tails⁺ pxs tails⁻ : ∀ xs → All (All P) (tails xs) → All P xs tails⁻ [] pxs = [] tails⁻ (x ∷ xs) (pxxs ∷ _) = pxxs ------------------------------------------------------------------------ -- all module _ (p : A → Bool) where all⁺ : ∀ xs → T (all p xs) → All (T ∘ p) xs all⁺ [] _ = [] all⁺ (x ∷ xs) px∷xs with Equivalence.to (T-∧ {p x}) ⟨$⟩ px∷xs ... | (px , pxs) = px ∷ all⁺ xs pxs all⁻ : ∀ {xs} → All (T ∘ p) xs → T (all p xs) all⁻ [] = _ all⁻ (px ∷ pxs) = Equivalence.from T-∧ ⟨$⟩ (px , all⁻ pxs) ------------------------------------------------------------------------ -- All is anti-monotone. anti-mono : ∀ {P : A → Set p} {xs ys} → xs ⊆ ys → All P ys → All P xs anti-mono xs⊆ys pys = All.tabulate (lookup pys ∘ xs⊆ys) all-anti-mono : ∀ (p : A → Bool) {xs ys} → xs ⊆ ys → T (all p ys) → T (all p xs) all-anti-mono p xs⊆ys = all⁻ p ∘ anti-mono xs⊆ys ∘ all⁺ p _ ------------------------------------------------------------------------ -- Interactions with pointwise equality ------------------------------------------------------------------------ module _ {c ℓ} (S : Setoid c ℓ) where open Setoid S open ListEq S respects : {P : Pred Carrier p} → P Respects _≈_ → (All P) Respects _≋_ respects p≈ [] [] = [] respects p≈ (x≈y ∷ xs≈ys) (px ∷ pxs) = p≈ x≈y px ∷ respects p≈ xs≈ys pxs ------------------------------------------------------------------------ -- DEPRECATED NAMES ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 0.16 All-all = all⁻ {-# WARNING_ON_USAGE All-all "Warning: All-all was deprecated in v0.16. Please use all⁻ instead." #-} all-All = all⁺ {-# WARNING_ON_USAGE all-All "Warning: all-All was deprecated in v0.16. Please use all⁺ instead." #-} All-map = map⁺ {-# WARNING_ON_USAGE All-map "Warning: All-map was deprecated in v0.16. Please use map⁺ instead." #-} map-All = map⁻ {-# WARNING_ON_USAGE map-All "Warning: map-All was deprecated in v0.16. Please use map⁻ instead." #-} -- Version 1.0 filter⁺₁ = all-filter {-# WARNING_ON_USAGE filter⁺₁ "Warning: filter⁺₁ was deprecated in v1.0. Please use all-filter instead." #-} filter⁺₂ = filter⁺ {-# WARNING_ON_USAGE filter⁺₂ "Warning: filter⁺₂ was deprecated in v1.0. Please use filter⁺ instead." #-} -- Version 1.3 Any¬→¬All = Any¬⇒¬All {-# WARNING_ON_USAGE Any¬→¬All "Warning: Any¬→¬All was deprecated in v1.3. Please use Any¬⇒¬All instead." #-}
programs/oeis/033/A033999.asm
neoneye/loda
22
101437
<reponame>neoneye/loda<filename>programs/oeis/033/A033999.asm ; A033999: a(n) = (-1)^n. ; 1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1 mov $1,-1 bin $1,$0 mov $0,$1
asm/masm32/kanmia/kanmia.asm
dindoliboon/archive
4
91686
; ######################################################################### .386 ; minimum processor needed for 32 bit .model flat, stdcall ; FLAT memory model & STDCALL calling option casemap :none ; set code to case sensitive ; ######################################################################### include \masm32\include\windows.inc include \masm32\include\gdi32.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc include \masm32\include\comctl32.inc include \masm32\include\comdlg32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\gdi32.lib includelib \masm32\lib\comctl32.lib includelib \masm32\lib\comdlg32.lib ; ######################################################################### szText MACRO Name, Text:VARARG LOCAL lbl jmp lbl Name db Text,0 lbl: ENDM m2m MACRO M1, M2 push M2 pop M1 ENDM return MACRO arg mov eax, arg ret ENDM LOWORD MACRO bigword mov eax, bigword and eax, 0FFFFh ENDM HIWORD MACRO bigword mov ebx, bigword shr ebx, 16 ENDM stralloc MACRO ln invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, ln mov hGlobal, eax invoke GlobalLock, hGlobal ENDM strfree MACRO strhandle invoke GlobalUnlock, strhandle invoke GlobalFree, hGlobal ENDM ; ######################################################################### WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD TopXY PROTO :DWORD,:DWORD RichEdMl PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD RichEdProc PROTO :DWORD,:DWORD,:DWORD,:DWORD GetFileName PROTO :DWORD,:DWORD,:DWORD SaveFileName PROTO :DWORD,:DWORD,:DWORD ModifyControl PROTO WordWrap PROTO SetTitle PROTO Confirmation PROTO :DWORD ; ######################################################################### .const MAX_SIZE equ 260 IDM_MENU equ 1 IDM_NEWWIN equ 101 IDM_NEW equ 102 IDM_OPEN equ 103 IDM_SAVE equ 104 IDM_SAVEDOS equ 105 IDM_SAVEUNIX equ 106 IDM_PAGESET equ 107 IDM_PRINT equ 108 IDM_PROPERTIES equ 109 IDM_EXIT equ 110 IDM_UNDO equ 201 IDM_REDO equ 202 IDM_CUT equ 203 IDM_COPY equ 204 IDM_PASTE equ 205 IDM_CLEAR equ 206 IDM_SELECTALL equ 207 IDM_FONT equ 301 IDM_BGCOLOR equ 302 IDM_TOOL equ 303 IDM_STATUS equ 304 IDM_SELECTION equ 305 IDM_CLEARHIS equ 306 IDM_HISFILE equ 307 IDM_RELOAD equ 308 IDM_WORDWRAP equ 309 IDM_ADDFAV equ 401 IDM_ORGFAV equ 402 IDM_FAVFILE equ 403 IDM_FIND equ 501 IDM_FINDNEXT equ 502 IDM_REPLACE equ 503 IDM_GOTO equ 504 IDM_TIMEDATE equ 505 IDM_FILE equ 506 IDM_ABOUT equ 601 tbb TBBUTTON <STD_FILENEW, IDM_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_FILEOPEN, IDM_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_FILESAVE, IDM_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0> TBBUTTON <STD_PRINT, IDM_PRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_PROPERTIES, IDM_PROPERTIES, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0> TBBUTTON <STD_CUT, IDM_CUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_COPY, IDM_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_PASTE, IDM_PASTE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_DELETE, IDM_CLEAR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0> TBBUTTON <STD_UNDO, IDM_UNDO, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_REDOW, IDM_REDO, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0> TBBUTTON <STD_FIND, IDM_FIND, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> TBBUTTON <STD_REPLACE, IDM_REPLACE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0> .data szLineFeed db 10,0 szDirty db " ~ ",0 szClean db " - ",0 szKanmia db "Kanmia",0 szUntitled db "Untitled",0 szRE db "riched20.dll",0 szREtext db "richedit20a",0 szTitleO db "Open",0 szTitleS db "Save As",0 szFilter db "All Files",0,"*.*",0, "Text Files",0,"*.txt",0,0 szAbout db "About Kanmia",0 szAboutMsg db "Kanmia 1.0 / March 2001",13,10, "Coded in 32-bit Windows assembly",13,10,13,10, "Thanks to exit for help with alpha version!",13,10, "<EMAIL>",0 CommandLine dd 0 hWnd dd 0 hMenu dd 0 hInstance dd 0 hRichEd dd 0 hStatus dd 0 hToolBar dd 0 hSelectBar dd 0 hSaveDos dd 1 hWrap dd 0 hPopup dd 0 lpRichEd dd 0 hUnix dd 0 hUnixLine dd 0 hUnixCounter dd 0 hSaveWrap dd 0 ofn OPENFILENAME <> .data? szFileName db MAX_SIZE dup (?) szDisplayName db MAX_SIZE dup (?) szBuffer db MAX_SIZE dup (?) hGlobal HANDLE ? hMem DWORD ? ; ######################################################################### .code start: invoke GetModuleHandle, NULL ; provides the instance handle mov hInstance, eax invoke GetCommandLine ; provides the command line address mov CommandLine, eax invoke InitCommonControls invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT invoke ExitProcess,eax ; cleanup & return to operating system ; ######################################################################### WinMain proc hInst :DWORD, hPrevInst :DWORD, CmdLine :DWORD, CmdShow :DWORD ;==================== ; Put LOCALs on stack ;==================== LOCAL wc :WNDCLASSEX LOCAL msg :MSG LOCAL Wwd :DWORD LOCAL Wht :DWORD LOCAL Wtx :DWORD LOCAL Wty :DWORD szText szClassName,"Kanmia_Class" ;================================================== ; Fill WNDCLASSEX structure with required variables ;================================================== mov wc.cbSize, sizeof WNDCLASSEX mov wc.style, CS_DBLCLKS ;CS_HREDRAW or CS_VREDRAW \ ; or CS_BYTEALIGNWINDOW mov wc.lpfnWndProc, offset WndProc ; address of WndProc mov wc.cbClsExtra, NULL mov wc.cbWndExtra, NULL m2m wc.hInstance, hInst ; instance handle ; invoke GetStockObject,HOLLOW_BRUSH ;COLOR_BTNFACE+1 mov wc.hbrBackground, NULL mov wc.lpszMenuName, NULL mov wc.lpszClassName, offset szClassName ; window class name invoke LoadIcon,hInst,1 ; icon ID ; resource icon mov wc.hIcon, eax ; invoke LoadCursor,NULL,IDC_ARROW ; system cursor mov wc.hCursor, NULL mov wc.hIconSm, 0 invoke RegisterClassEx, ADDR wc ; register the window class ;================================ ; Centre window at following size ;================================ mov Wwd, 500 mov Wht, 350 invoke GetSystemMetrics,SM_CXSCREEN ; get screen width in pixels invoke TopXY,Wwd,eax mov Wtx, eax invoke GetSystemMetrics,SM_CYSCREEN ; get screen height in pixels invoke TopXY,Wht,eax mov Wty, eax ; ================================== ; Create the main application window ; ================================== invoke CreateWindowEx, 0, ADDR szClassName, NULL, WS_OVERLAPPEDWINDOW, Wtx,Wty,Wwd,Wht, NULL,NULL, hInst,NULL mov hWnd,eax ; copy return value into handle DWORD invoke LoadMenu,hInst,1 ; load resource menu mov hMenu, eax invoke SetMenu,hWnd,eax ; set it to main window invoke ShowWindow,hWnd,SW_SHOWNORMAL ; display the window invoke UpdateWindow,hWnd ; update the display ;=================================== ; Loop until PostQuitMessage is sent ;=================================== StartLoop: invoke GetMessage,ADDR msg,NULL,0,0 ; get each message cmp eax, 0 ; exit if GetMessage() je ExitLoop ; returns zero invoke TranslateMessage, ADDR msg ; translate it invoke DispatchMessage, ADDR msg ; send it to message proc jmp StartLoop ExitLoop: return msg.wParam WinMain endp ; ######################################################################### WndProc proc hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD LOCAL tba :TBADDBITMAP LOCAL sbParts[4] :DWORD LOCAL sHeight :DWORD LOCAL tHeight :DWORD LOCAL rc :RECT LOCAL hlcreat :DWORD invoke ModifyControl .if uMsg == WM_COMMAND ;======== menu commands ======== LOWORD wParam .if eax == IDM_NEWWIN invoke GetModuleFileName, NULL, addr szBuffer, MAX_SIZE invoke WinExec, addr szBuffer, SW_SHOWNORMAL .elseif eax == IDM_NEW invoke Confirmation, hRichEd .if eax == IDYES invoke SendMessage, hWin, WM_COMMAND, IDM_SAVE, 0 .elseif eax == IDNO jmp @F .elseif eax == IDCANCEL return 0 .endif invoke SendMessage,hRichEd,EM_GETMODIFY,0,0 .if eax == 0 @@: mov szFileName[0],0 invoke SendMessage,hRichEd,WM_SETTEXT,0,0 invoke SendMessage,hRichEd, EM_SETMODIFY, FALSE, 0 .endif .elseif eax == IDM_OPEN invoke Confirmation, hRichEd .if eax == IDYES invoke SendMessage, hWin, WM_COMMAND, IDM_SAVE, 0 .elseif eax == IDNO jmp @F .elseif eax == IDCANCEL return 0 .endif invoke SendMessage,hRichEd,EM_GETMODIFY,0,0 .if eax == 0 @@: invoke GetFileName, hWin, addr szTitleO, addr szFilter .if eax != 0 invoke lstrcpy, addr szFileName, addr szBuffer invoke Read_File_In,hRichEd,ADDR szFileName .endif .endif .elseif eax == IDM_SAVE invoke exist, addr szFileName .if eax == 1 mov eax, hSaveDos .if eax == 1 invoke Write_To_Disk,hRichEd,ADDR szFileName .else jmp saveunix .endif invoke SendMessage,hRichEd,EM_SETMODIFY,0,0 .else mov eax, hSaveDos .if eax == 1 invoke SendMessage, hWin, WM_COMMAND, IDM_SAVEDOS, 0 .else invoke SendMessage, hWin, WM_COMMAND, IDM_SAVEUNIX, 0 .endif .endif .elseif eax == IDM_SAVEDOS invoke SaveFileName, hWin, addr szTitleS, addr szFilter .if eax != 0 invoke lstrcpy, addr szFileName, addr szBuffer invoke Write_To_Disk,hRichEd,ADDR szFileName invoke SendMessage,hRichEd,EM_SETMODIFY,0,0 mov hSaveDos, 1 .endif invoke SetFocus, hRichEd .elseif eax == IDM_SAVEUNIX invoke SaveFileName, hWin, addr szTitleS, addr szFilter .if eax != 0 invoke lstrcpy, addr szFileName, addr szBuffer saveunix: invoke EnableWindow, hRichEd, FALSE mov eax, hWrap mov hSaveWrap, eax mov hWrap, 0 invoke SendMessage, hWin, WM_SIZE, 0, 0 invoke SendMessage, hRichEd, EM_GETLINECOUNT, 0, 0 mov hUnix, eax mov hUnixCounter, 0 invoke _lcreat, addr szFileName, 0 mov hlcreat, eax ConvertLine: invoke SendMessage, hRichEd, EM_LINEINDEX, hUnixCounter, 0 invoke SendMessage, hRichEd, EM_LINELENGTH, eax, 0 mov hUnixLine, eax stralloc hUnixLine mov hMem, eax LOWORD hMem mov eax, hUnixLine mov [hMem], eax invoke SendMessage, hRichEd, EM_GETLINE, hUnixCounter, addr hMem mov hUnixLine, eax mov eax, offset hMem .if eax != NULL invoke _hwrite, hlcreat, addr hMem, hUnixLine .endif strfree hMem add hUnixCounter, 1 mov eax, hUnix .if hUnixCounter != eax invoke _hwrite, hlcreat, addr szLineFeed, 1 jmp ConvertLine .endif invoke _lclose, hlcreat invoke SendMessage,hRichEd,EM_SETMODIFY,0,0 mov eax, hSaveWrap mov hWrap, eax invoke SendMessage, hWin, WM_SIZE, 0, 0 invoke EnableWindow, hRichEd, TRUE mov hSaveDos, 0 .endif invoke SetFocus, hRichEd .elseif eax == IDM_EXIT invoke SendMessage,hWin,WM_SYSCOMMAND,SC_CLOSE,NULL .elseif eax == IDM_UNDO invoke SendMessage, hRichEd, EM_UNDO, 0 , 0 .elseif eax == IDM_REDO invoke SendMessage, hRichEd, EM_REDO, 0 , 0 .elseif eax == IDM_CUT invoke SendMessage, hRichEd, WM_CUT, 0 , 0 .elseif eax == IDM_COPY invoke SendMessage, hRichEd, WM_COPY, 0 , 0 .elseif eax == IDM_PASTE invoke SendMessage, hRichEd, WM_PASTE, 0 , 0 .elseif eax == IDM_CLEAR invoke SendMessage, hRichEd, WM_CLEAR, 0 , 0 .elseif eax == IDM_SELECTALL invoke SendMessage, hRichEd, EM_SETSEL, 0 , -1 .elseif eax == IDM_SELECTION invoke SendMessage, hRichEd, EM_SETOPTIONS, ECOOP_XOR, ECO_SELECTIONBAR .if hSelectBar == 1 mov hSelectBar, 0 .else mov hSelectBar, 1 .endif .elseif eax == IDM_TOOL invoke IsWindowVisible, hToolBar .if eax == 0 invoke ShowWindow, hToolBar, SW_SHOW .else invoke ShowWindow, hToolBar, SW_HIDE .endif invoke SendMessage, hWin, WM_SIZE, 0, 0 .elseif eax == IDM_STATUS invoke IsWindowVisible, hStatus .if eax == 0 invoke ShowWindow, hStatus, SW_SHOW .else invoke ShowWindow, hStatus, SW_HIDE .endif invoke SendMessage, hWin, WM_SIZE, 0, 0 .elseif eax == IDM_WORDWRAP .if hWrap == 1 mov hWrap, 0 .else mov hWrap, 1 .endif ; Instead of destroying our rich edit, we can keep our ; modifications like the dirty option, undo/redo editing ; and we don't have to allocate memory! invoke SendMessage, hWin, WM_SIZE, 0, 0 ; .elseif eax == IDM_CONTENTS ; invoke MessageBox, hWin, addr szHelpMsg, addr szHelp, MB_ICONWARNING or MB_OK .elseif eax == IDM_ABOUT invoke MessageBox, hWin, addr szAboutMsg, addr szAbout, MB_ICONINFORMATION or MB_OK .endif invoke SetTitle ;====== end menu commands ====== .elseif uMsg == WM_CREATE invoke LoadLibrary, ADDR szRE invoke RichEdMl,0,0,250,200,hWin,800 mov hRichEd, eax invoke SetWindowLong,hRichEd,GWL_WNDPROC,RichEdProc mov lpRichEd, eax ;edit_font equ <SYSTEM_FIXED_FONT> ; edit_font equ <ANSI_FIXED_FONT> invoke GetStockObject, SYSTEM_FIXED_FONT invoke SendMessage,hRichEd,WM_SETFONT,eax,0 invoke SendMessage, hRichEd, EM_SETEDITSTYLE, SES_EMULATESYSEDIT, 0 invoke SendMessage, hRichEd, EM_SETTEXTMODE, TM_PLAINTEXT or \ TM_MULTILEVELUNDO or TM_MULTICODEPAGE, 0 invoke SendMessage, hRichEd, EM_EXLIMITTEXT, 0, -1 invoke CreateStatusWindow, WS_CHILD or WS_VISIBLE or \ SBS_SIZEGRIP,0, hWin, 200 mov hStatus, eax mov tba.hInst, HINST_COMMCTRL mov tba.nID, 2 ; btnsize 1=big 2=small invoke SendMessage,hToolBar,TB_ADDBITMAP,1,ADDR tba invoke CreateToolbarEx,hWin,WS_CHILD or WS_CLIPSIBLINGS or \ TBSTYLE_FLAT or WS_VISIBLE, 300,17,HINST_COMMCTRL, IDB_STD_SMALL_COLOR,ADDR tbb, 17,16,16,0,0,sizeof(TBBUTTON) mov hToolBar, eax invoke SendMessage, hStatus, SB_SETTEXT, 0 or SBT_NOBORDERS, NULL invoke SendMessage, hStatus, SB_SETTEXT, 1 or 0, NULL invoke SendMessage, hStatus, SB_SETTEXT, 2 or 0, NULL invoke SendMessage, hStatus, SB_SETTEXT, 3 or 0, NULL invoke SendMessage, hWin, WM_COMMAND, IDM_SELECTION, 0 .elseif uMsg == WM_SETFOCUS invoke SetFocus, hRichEd .elseif uMsg == WM_SIZE invoke ShowWindow, hRichEd, SW_HIDE invoke GetWindowRect, hToolBar, addr rc invoke SendMessage, hToolBar, TB_AUTOSIZE, 0, 0 invoke MoveWindow, hStatus, 0, 0, 0, 0, TRUE invoke IsWindowVisible, hToolBar .if eax == 0 mov tHeight, 0 .else invoke GetWindowRect, hToolBar, addr rc mov eax, rc.bottom sub eax, 3 sub eax, rc.top mov tHeight, eax .endif invoke IsWindowVisible, hStatus .if eax == 0 mov sHeight, 0 .else invoke GetWindowRect, hStatus, addr rc mov eax, rc.bottom sub eax, rc.top mov sHeight, eax invoke GetClientRect, hWin, addr rc mov eax, rc.right sub eax, rc.left .if wParam == SIZE_MAXIMIZED sub eax, 175 .else sub eax, 192 .endif mov [sbParts + 0], eax ; msg add eax, 115 mov [sbParts + 4], eax ; Ln 1 add eax, 30 mov [sbParts + 8], eax ; Col 1 add eax, 30 mov [sbParts + 12], eax ; Col 1 invoke SendMessage, hStatus, SB_SETPARTS, 4, addr sbParts .endif invoke GetClientRect, hWin, addr rc mov eax, rc.bottom sub eax, tHeight sub eax, sHeight invoke MoveWindow, hRichEd, 0, tHeight, rc.right, eax, TRUE invoke WordWrap invoke ShowWindow, hRichEd, SW_SHOW .elseif uMsg == WM_CLOSE invoke Confirmation, hRichEd .if eax == IDYES invoke SendMessage, hWin, WM_COMMAND, IDM_SAVE, 0 .elseif eax == IDNO jmp @F .elseif eax == IDCANCEL return 0 .endif invoke SendMessage,hRichEd,EM_GETMODIFY,0,0 .if eax == 0 @@: .else return 0 .endif .elseif uMsg == WM_DESTROY invoke PostQuitMessage,NULL return 0 .endif invoke DefWindowProc,hWin,uMsg,wParam,lParam ret WndProc endp ; ######################################################################## TopXY proc wDim:DWORD, sDim:DWORD shr sDim, 1 ; divide screen dimension by 2 shr wDim, 1 ; divide window dimension by 2 mov eax, wDim ; copy window dimension into eax sub sDim, eax ; sub half win dimension from half screen dimension return sDim TopXY endp ; ######################################################################### RichEdMl proc a:DWORD,b:DWORD,wd:DWORD,ht:DWORD,hParent:DWORD,ID:DWORD invoke CreateWindowEx, WS_EX_CLIENTEDGE, addr szREtext, 0, WS_VISIBLE or ES_SUNKEN or WS_CHILDWINDOW or WS_CLIPSIBLINGS or \ ES_MULTILINE or WS_VSCROLL or ES_AUTOVSCROLL or ES_NOHIDESEL or \ WS_HSCROLL or ES_AUTOHSCROLL or ES_DISABLENOSCROLL, a, b, wd, ht, hParent, ID, hInstance, NULL ret RichEdMl endp ; ######################################################################### RichEdProc proc hCtl :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD LOCAL pt :POINT .if uMsg == WM_RBUTTONDOWN invoke GetMenu, hWnd invoke GetSubMenu, eax, 1 mov hPopup, eax invoke GetCursorPos,addr pt invoke TrackPopupMenu, hPopup, TPM_LEFTALIGN or TPM_RIGHTBUTTON, pt.x, pt.y, 0, hWnd, NULL invoke SetFocus, hCtl .endif invoke CallWindowProc,lpRichEd,hCtl,uMsg,wParam,lParam ret RichEdProc endp ; ######################################################################### ModifyControl proc LOCAL chrange : CHARRANGE invoke SendMessage, hRichEd, EM_CANUNDO, 0, 0 .if eax == 0 invoke EnableMenuItem, hMenu, IDM_UNDO, MF_GRAYED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_UNDO, FALSE .else invoke EnableMenuItem, hMenu, IDM_UNDO, MF_ENABLED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_UNDO, TRUE .endif invoke SendMessage, hRichEd, EM_CANREDO, 0, 0 .if eax == 0 invoke EnableMenuItem, hMenu, IDM_REDO, MF_GRAYED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_REDO, FALSE .else invoke EnableMenuItem, hMenu, IDM_REDO, MF_ENABLED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_REDO, TRUE .endif invoke SendMessage, hRichEd, EM_CANPASTE, 0, 0 .if eax == 0 invoke EnableMenuItem, hMenu, IDM_PASTE, MF_GRAYED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_PASTE, FALSE .else invoke EnableMenuItem, hMenu, IDM_PASTE, MF_ENABLED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_PASTE, TRUE .endif invoke SendMessage, hRichEd, EM_EXGETSEL, 0, addr chrange mov eax, chrange.cpMin .if eax == chrange.cpMax invoke EnableMenuItem, hMenu, IDM_COPY, MF_GRAYED invoke EnableMenuItem, hMenu, IDM_CUT, MF_GRAYED invoke EnableMenuItem, hMenu, IDM_CLEAR, MF_GRAYED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_COPY, FALSE invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_CUT, FALSE invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_CLEAR, FALSE .else invoke EnableMenuItem, hMenu, IDM_COPY, MF_ENABLED invoke EnableMenuItem, hMenu, IDM_CUT, MF_ENABLED invoke EnableMenuItem, hMenu, IDM_CLEAR, MF_ENABLED invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_COPY, TRUE invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_CUT, TRUE invoke SendMessage, hToolBar, TB_ENABLEBUTTON, IDM_CLEAR, TRUE .endif .if hSelectBar == 1 invoke CheckMenuItem, hMenu, IDM_SELECTION, MF_CHECKED .else invoke CheckMenuItem, hMenu, IDM_SELECTION, MF_UNCHECKED .endif .if hSaveDos == 1 invoke CheckMenuItem, hMenu, IDM_SAVEDOS, MF_CHECKED invoke CheckMenuItem, hMenu, IDM_SAVEUNIX, MF_UNCHECKED .else invoke CheckMenuItem, hMenu, IDM_SAVEDOS, MF_UNCHECKED invoke CheckMenuItem, hMenu, IDM_SAVEUNIX, MF_CHECKED .endif .if hWrap == 1 invoke CheckMenuItem, hMenu, IDM_WORDWRAP, MF_CHECKED .else invoke CheckMenuItem, hMenu, IDM_WORDWRAP, MF_UNCHECKED .endif invoke IsWindowVisible, hStatus .if eax == 0 invoke CheckMenuItem, hMenu, IDM_STATUS, MF_UNCHECKED .else invoke CheckMenuItem, hMenu, IDM_STATUS, MF_CHECKED .endif invoke IsWindowVisible, hToolBar .if eax == 0 invoke CheckMenuItem, hMenu, IDM_TOOL, MF_UNCHECKED .else invoke CheckMenuItem, hMenu, IDM_TOOL, MF_CHECKED .endif return 0 ModifyControl endp ; ######################################################################### WordWrap proc .if hWrap == 0 invoke SendMessage, hRichEd, EM_SETTARGETDEVICE, NULL, 1 invoke ShowScrollBar, hRichEd, SB_HORZ, TRUE .else invoke SendMessage, hRichEd, EM_SETTARGETDEVICE, NULL, 0 invoke ShowScrollBar, hRichEd, SB_HORZ, FALSE .endif ret WordWrap endp ; ######################################################################### SetTitle proc invoke StrLen, addr szFileName .if eax == 0 invoke lstrcpy, addr szDisplayName, addr szUntitled .else invoke lstrcpy, addr szDisplayName, addr szFileName .endif invoke SendMessage, hRichEd, EM_GETMODIFY, 0, 0 .if eax == 0 invoke szCatStr, addr szDisplayName, addr szClean .else invoke szCatStr, addr szDisplayName, addr szDirty .endif invoke szCatStr, addr szDisplayName, addr szKanmia invoke GetWindowText, hWnd, addr szBuffer, MAX_SIZE invoke lstrcmp, addr szBuffer, addr szDisplayName .if eax != 0 invoke SetWindowText, hWnd, addr szDisplayName .endif return 0 SetTitle endp ; ######################################################################## GetFileName proc hParent:DWORD,lpTitle:DWORD,lpFilter:DWORD mov szBuffer[0],0 mov ofn.lStructSize, sizeof OPENFILENAME m2m ofn.hWndOwner, hParent m2m ofn.hInstance, hInstance m2m ofn.lpstrFilter, lpFilter m2m ofn.lpstrFile, offset szBuffer mov ofn.nMaxFile, sizeof szBuffer m2m ofn.lpstrTitle, lpTitle mov ofn.Flags, OFN_EXPLORER or OFN_FILEMUSTEXIST or \ OFN_LONGNAMES invoke GetOpenFileName,ADDR ofn ret GetFileName endp ; ######################################################################### SaveFileName proc hParent:DWORD,lpTitle:DWORD,lpFilter:DWORD invoke lstrcpy, addr szBuffer, addr szFileName mov ofn.lStructSize, sizeof OPENFILENAME m2m ofn.hWndOwner, hParent m2m ofn.hInstance, hInstance m2m ofn.lpstrFilter, lpFilter m2m ofn.lpstrFile, offset szBuffer mov ofn.nMaxFile, sizeof szBuffer m2m ofn.lpstrTitle, lpTitle mov ofn.Flags, OFN_EXPLORER or OFN_LONGNAMES or OFN_OVERWRITEPROMPT or OFN_PATHMUSTEXIST invoke GetSaveFileName,ADDR ofn ret SaveFileName endp ; ######################################################################### Confirmation proc hEditor:DWORD invoke SendMessage,hEditor,WM_GETTEXTLENGTH,0,0 cmp eax, 0 jne @F return 0 @@: invoke SendMessage,hEditor,EM_GETMODIFY,0,0 cmp eax, 0 ; zero = unmodified jne @F return 0 @@: szText confirm,"Do you want to save the changes?" invoke MessageBox,hWnd,ADDR confirm, ADDR szKanmia, MB_YESNOCANCEL or MB_ICONWARNING ret Confirmation endp ; ######################################################################### end start
Commands/Miscellaneous Commands suite/round/round <real> rounding toward zero.applescript
looking-for-a-job/applescript-examples
1
3101
#!/usr/bin/osascript round -3.67 --> 3 round -3.67 rounding toward zero --> -3 round 3.67 rounding toward zero --> 3
header/001/SUROM.asm
freem/nes_corelib
16
27475
; SUROM: 512KB PRG-ROM + 8KB PRG-RAM + 8KB CHR-RAM/ROM ; http://bootgod.dyndns.org:7777/search.php?keywords=SUROM&kwtype=pcb ; todo: create NES 2.0 Mapper 001.1 version and use that. ;------------------------------------------------------------------------------; ; number of 16k PRG banks ; Valid configurations: $08 (128K), $10 (256K) PRG_BANKS = $08 ; CHR RAM/ROM toggle ; Valid configurations: $00 (8K CHR-RAM), $01 (8K CHR-ROM) CHR_BANKS = $01 ; MMC1 mirroring is mapper controlled. This just sets the default. ; If you want one-screen mapping, you will need to set it via MMC1 writes. ; %0000 = Horizontal ; %0001 = Vertical MIRRORING = %0001 ; Should the SRAM be battery backed or not? ; %0010 = battery backed ; %0000 = no battery SRAM_BATTERY = %0000 ; Mapper 001 (MMC1 - SUROM) iNES header .byte "NES",$1A .byte $20 ; 32x 16K PRG banks .byte CHR_BANKS ; 8K CHR-RAM .byte $10|SRAM_BATTERY|MIRRORING ; flags 6 .byte $00 ; flags 7 .byte $01 ; PRG RAM size in 8K increments .dsb 7, $00 ; clear the remaining bytes
test/asset/agda-stdlib-1.0/Function.agda
omega12345/agda-mode
0
514
------------------------------------------------------------------------ -- The Agda standard library -- -- Simple combinators working solely on and with functions ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Function where open import Level open import Strict infixr 9 _∘_ _∘′_ infixl 8 _ˢ_ infixl 1 _on_ infixl 1 _⟨_⟩_ infixr -1 _$_ _$′_ _$!_ _$!′_ infixr 0 _-[_]-_ infixl 0 _|>_ _|>′_ _∋_ ------------------------------------------------------------------------ -- Types -- Unary functions on a given set. Fun₁ : ∀ {i} → Set i → Set i Fun₁ A = A → A -- Binary functions on a given set. Fun₂ : ∀ {i} → Set i → Set i Fun₂ A = A → A → A ------------------------------------------------------------------------ -- Functions _∘_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} → (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) f ∘ g = λ x → f (g x) _∘′_ : ∀ {a b c} {A : Set a} {B : Set b} {C : Set c} → (B → C) → (A → B) → (A → C) f ∘′ g = _∘_ f g id : ∀ {a} {A : Set a} → A → A id x = x const : ∀ {a b} {A : Set a} {B : Set b} → A → B → A const x = λ _ → x -- The S combinator. (Written infix as in Conor McBride's paper -- "Outrageous but Meaningful Coincidences: Dependent type-safe syntax -- and evaluation".) _ˢ_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : (x : A) → B x → Set c} → ((x : A) (y : B x) → C x y) → (g : (x : A) → B x) → ((x : A) → C x (g x)) f ˢ g = λ x → f x (g x) flip : ∀ {a b c} {A : Set a} {B : Set b} {C : A → B → Set c} → ((x : A) (y : B) → C x y) → ((y : B) (x : A) → C x y) flip f = λ y x → f x y -- Note that _$_ is right associative, like in Haskell. If you want a -- left associative infix application operator, use -- Category.Functor._<$>_, available from -- Category.Monad.Identity.IdentityMonad. _$_ : ∀ {a b} {A : Set a} {B : A → Set b} → ((x : A) → B x) → ((x : A) → B x) f $ x = f x _$′_ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → (A → B) _$′_ = _$_ -- Strict (call-by-value) application _$!_ : ∀ {a b} {A : Set a} {B : A → Set b} → ((x : A) → B x) → ((x : A) → B x) _$!_ = flip force _$!′_ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → (A → B) _$!′_ = _$!_ -- flipped application aka pipe-forward _|>_ : ∀ {a b} {A : Set a} {B : A → Set b} → (a : A) → (∀ a → B a) → B a _|>_ = flip _$_ _|>′_ : ∀ {a b} {A : Set a} {B : Set b} → A → (A → B) → B _|>′_ = _|>_ _⟨_⟩_ : ∀ {a b c} {A : Set a} {B : Set b} {C : Set c} → A → (A → B → C) → B → C x ⟨ f ⟩ y = f x y _on_ : ∀ {a b c} {A : Set a} {B : Set b} {C : Set c} → (B → B → C) → (A → B) → (A → A → C) _*_ on f = λ x y → f x * f y _-[_]-_ : ∀ {a b c d e} {A : Set a} {B : Set b} {C : Set c} {D : Set d} {E : Set e} → (A → B → C) → (C → D → E) → (A → B → D) → (A → B → E) f -[ _*_ ]- g = λ x y → f x y * g x y -- In Agda you cannot annotate every subexpression with a type -- signature. This function can be used instead. _∋_ : ∀ {a} (A : Set a) → A → A A ∋ x = x -- Conversely it is sometimes useful to be able to extract the -- type of a given expression: typeOf : ∀ {a} {A : Set a} → A → Set a typeOf {A = A} _ = A -- Case expressions (to be used with pattern-matching lambdas, see -- README.Case). infix 0 case_return_of_ case_of_ case_return_of_ : ∀ {a b} {A : Set a} (x : A) (B : A → Set b) → ((x : A) → B x) → B x case x return B of f = f x case_of_ : ∀ {a b} {A : Set a} {B : Set b} → A → (A → B) → B case x of f = case x return _ of f
oeis/045/A045440.asm
neoneye/loda-programs
11
21272
<gh_stars>10-100 ; A045440: Primes congruent to {0, 1, 4, 5} mod 7. ; Submitted by <NAME> ; 5,7,11,19,29,43,47,53,61,67,71,89,103,109,113,127,131,137,151,173,179,193,197,211,229,239,257,263,271,277,281,313,337,347,379,383,389,397,421,431,439,449,463,467,487,491,509,523,547,557,571,593,599,607,613,617,631,641,659,673,677,683,691,701,719,733,739,743,757,761,809,823,827,859,883,887,907,911,929,953,967,971,977,991,1009,1013,1019,1033,1051,1061,1069,1093,1097,1103,1117,1153,1163,1181,1187,1201 mov $1,1 mov $2,332202 lpb $2 mov $3,$6 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,7 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,18 mov $5,$1 div $5,4 mov $6,$5 lpe mov $0,$5 sub $0,1 mul $0,2 add $0,3
tools-src/gnu/gcc/gcc/ada/a-reatim.ads
enfoTek/tomato.linksys.e2000.nvram-mod
80
3487
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . R E A L _ T I M E -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- 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 System.Task_Primitives.Operations; pragma Elaborate_All (System.Task_Primitives.Operations); package Ada.Real_Time is type Time is private; Time_First : constant Time; Time_Last : constant Time; Time_Unit : constant := 10#1.0#E-9; type Time_Span is private; Time_Span_First : constant Time_Span; Time_Span_Last : constant Time_Span; Time_Span_Zero : constant Time_Span; Time_Span_Unit : constant Time_Span; Tick : constant Time_Span; function Clock return Time; function "+" (Left : Time; Right : Time_Span) return Time; function "+" (Left : Time_Span; Right : Time) return Time; function "-" (Left : Time; Right : Time_Span) return Time; function "-" (Left : Time; Right : Time) return Time_Span; function "<" (Left, Right : Time) return Boolean; function "<=" (Left, Right : Time) return Boolean; function ">" (Left, Right : Time) return Boolean; function ">=" (Left, Right : Time) return Boolean; function "+" (Left, Right : Time_Span) return Time_Span; function "-" (Left, Right : Time_Span) return Time_Span; function "-" (Right : Time_Span) return Time_Span; function "*" (Left : Time_Span; Right : Integer) return Time_Span; function "*" (Left : Integer; Right : Time_Span) return Time_Span; function "/" (Left, Right : Time_Span) return Integer; function "/" (Left : Time_Span; Right : Integer) return Time_Span; function "abs" (Right : Time_Span) return Time_Span; function "<" (Left, Right : Time_Span) return Boolean; function "<=" (Left, Right : Time_Span) return Boolean; function ">" (Left, Right : Time_Span) return Boolean; function ">=" (Left, Right : Time_Span) return Boolean; function To_Duration (TS : Time_Span) return Duration; function To_Time_Span (D : Duration) return Time_Span; function Nanoseconds (NS : Integer) return Time_Span; function Microseconds (US : Integer) return Time_Span; function Milliseconds (MS : Integer) return Time_Span; -- Seconds_Count needs 64 bits, since Time has the full range of -- Duration. The delta of Duration is 10 ** (-9), so the maximum -- number of seconds is 2**63/10**9 = 8*10**9 which does not quite -- fit in 32 bits. type Seconds_Count is range -2 ** 63 .. 2 ** 63 - 1; procedure Split (T : Time; SC : out Seconds_Count; TS : out Time_Span); function Time_Of (SC : Seconds_Count; TS : Time_Span) return Time; private type Time is new Duration; Time_First : constant Time := Time'First; Time_Last : constant Time := Time'Last; type Time_Span is new Duration; Time_Span_First : constant Time_Span := Time_Span'First; Time_Span_Last : constant Time_Span := Time_Span'Last; Time_Span_Zero : constant Time_Span := 0.0; Time_Span_Unit : constant Time_Span := 10#1.0#E-9; Tick : constant Time_Span := Time_Span (System.Task_Primitives.Operations.RT_Resolution); -- Time and Time_Span are represented in 64-bit Duration value in -- in nanoseconds. For example, 1 second and 1 nanosecond is -- represented as the stored integer 1_000_000_001. pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); pragma Import (Intrinsic, "abs"); end Ada.Real_Time;
programs/oeis/004/A004729.asm
neoneye/loda
22
96951
; A004729: Divisors of 2^32 - 1 (for a(1) to a(31), the 31 regular polygons with an odd number of sides constructible with ruler and compass). ; 1,3,5,15,17,51,85,255,257,771,1285,3855,4369,13107,21845,65535,65537,196611,327685,983055,1114129,3342387,5570645,16711935,16843009,50529027,84215045,252645135,286331153,858993459,1431655765,4294967295 mov $1,1 lpb $0 sub $0,1 seq $1,48724 ; Write n and 2n in binary and add them mod 2. lpe mov $0,$1
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_21829_1699.asm
ljhsiun2/medusa
9
177326
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r9 push %rax push %rbx push %rdi // Store lea addresses_D+0x11deb, %r11 nop nop nop nop nop xor $12746, %rbx mov $0x5152535455565758, %rax movq %rax, %xmm3 movups %xmm3, (%r11) nop nop sub $34988, %r9 // Faulty Load mov $0x3a5d5a000000052b, %r10 nop nop nop nop nop xor $35641, %rdi movups (%r10), %xmm1 vpextrq $0, %xmm1, %rax lea oracles, %rbx and $0xff, %rax shlq $12, %rax mov (%rbx,%rax,1), %rax pop %rdi pop %rbx pop %rax pop %r9 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
legacy/src/server/compiler/output/FieldChanges/FieldChanges.g4
gjcampbell/antlr-editor
2
2228
grammar FieldChanges; session : SESSION sessionName documents ; sessionName : NAME ; documents : document+ ; document : TAB documentName fieldValues+ ; documentName : DOC_NAME ; fieldValues : fieldValue+ ; fieldValue : TAB TAB action fieldName value ; action : ADD | REMOVE ; fieldName : FIELD_NAME ; value : NAME ; ADD : 'Add'; REMOVE : 'Remove'; SESSION : 'Session'; DOC_NAME : [a-zA-Z0-9\-_]+; TAB : (' '|[\t]); FIELD_NAME : ([a-zA-Z0-9 ]~[:\t\r\n])+':'; NAME : ([a-zA-Z0-9 ]~[:\t\r\n])+; NL : [ \t\r\n]+ -> skip;
src/gl/generated/gl-api-shorts.ads
Roldak/OpenGLAda
79
14770
-- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" -- Autogenerated by Generate, do not edit package GL.API.Shorts is pragma Preelaborate; Vertex_Attrib1 : T26; Vertex_Attrib2 : T27; Vertex_Attrib2v : T28; Vertex_Attrib3 : T29; Vertex_Attrib3v : T30; Vertex_Attrib4 : T31; Vertex_Attrib4v : T32; end GL.API.Shorts;
oeis/158/A158111.asm
neoneye/loda-programs
11
171746
<reponame>neoneye/loda-programs ; A158111: E.g.f.: sm^-1(x) = Sum_{n>=0} a(n)*x^(3n+1)/(3n+1)!; a(n) = coefficient of x^(3n+1)/(3n+1)! in the Maclaurin expansion of the inverse of the Dixon elliptic function sm(x,0). ; Submitted by <NAME> ; 1,4,400,179200,216832000,552487936000,2554704216064000,19415752042086400000,225960522265801523200000,3818732826292045742080000000,89923520593525093134499840000000,2854532237720860556461562920960000000,118891267701073842176624095657984000000000 mov $2,1 lpb $0 mul $0,3 sub $0,1 mul $2,$0 mul $2,$0 sub $0,1 mul $2,$0 div $0,3 lpe mov $0,$2
programs/oeis/151/A151920.asm
neoneye/loda
22
165050
; A151920: a(n) = (Sum_{i=1..n+1} 3^wt(i))/3, where wt() = A000120(). ; 1,2,5,6,9,12,21,22,25,28,37,40,49,58,85,86,89,92,101,104,113,122,149,152,161,170,197,206,233,260,341,342,345,348,357,360,369,378,405,408,417,426,453,462,489,516,597,600,609,618,645,654,681,708,789,798,825,852,933,960,1041,1122,1365,1366,1369,1372,1381,1384,1393,1402,1429,1432,1441,1450,1477,1486,1513,1540,1621,1624,1633,1642,1669,1678,1705,1732,1813,1822,1849,1876,1957,1984,2065,2146,2389,2392,2401,2410,2437,2446 add $0,1 seq $0,130665 ; a(n) = Sum_{k=0..n} 3^wt(k), where wt() = A000120(). div $0,3
libtool/src/gmp-6.1.2/mpn/alpha/ev6/nails/addmul_3.asm
kroggen/aergo
1,602
91053
<reponame>kroggen/aergo dnl Alpha ev6 nails mpn_addmul_3. dnl Copyright 2002, 2006 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 Runs at 3.0 cycles/limb. C With 2-way unrolling, we could probably reach 2.25 c/l (3.33 i/c). C INPUT PARAMETERS define(`rp',`r16') define(`up',`r17') define(`n',`r18') define(`vp',`r19') C Useful register aliases define(`numb_mask',`r24') define(`ulimb',`r25') define(`rlimb',`r27') define(`m0a',`r0') define(`m0b',`r1') define(`m1a',`r2') define(`m1b',`r3') define(`m2a',`r20') define(`m2b',`r21') define(`acc0',`r4') define(`acc1',`r5') define(`acc2',`r22') define(`v0',`r6') define(`v1',`r7') define(`v2',`r23') C Used for temps: r8 r19 r28 define(`NAIL_BITS',`GMP_NAIL_BITS') define(`NUMB_BITS',`GMP_NUMB_BITS') C This declaration is munged by configure NAILS_SUPPORT(3-63) ASM_START() PROLOGUE(mpn_addmul_3) lda numb_mask,-1(r31) srl numb_mask,NAIL_BITS,numb_mask ldq v0, 0(vp) ldq v1, 8(vp) ldq v2, 16(vp) bis r31, r31, acc0 C zero acc0 sll v0,NAIL_BITS, v0 bis r31, r31, acc1 C zero acc1 sll v1,NAIL_BITS, v1 bis r31, r31, acc2 C zero acc2 sll v2,NAIL_BITS, v2 bis r31, r31, r19 ldq ulimb, 0(up) lda up, 8(up) mulq v0, ulimb, m0a C U1 umulh v0, ulimb, m0b C U1 mulq v1, ulimb, m1a C U1 umulh v1, ulimb, m1b C U1 lda n, -1(n) mulq v2, ulimb, m2a C U1 umulh v2, ulimb, m2b C U1 beq n, L(end) C U0 ALIGN(16) L(top): ldq rlimb, 0(rp) C L1 ldq ulimb, 0(up) C L0 bis r31, r31, r31 C U0 nop addq r19, acc0, acc0 C U1 propagate nail lda rp, 8(rp) C L1 srl m0a,NAIL_BITS, r8 C U0 lda up, 8(up) C L0 mulq v0, ulimb, m0a C U1 addq r8, acc0, r19 C U0 addq m0b, acc1, acc0 C L1 umulh v0, ulimb, m0b C U1 bis r31, r31, r31 C L0 nop addq rlimb, r19, r19 C L1 srl m1a,NAIL_BITS, r8 C U0 bis r31, r31, r31 C L0 nop mulq v1, ulimb, m1a C U1 addq r8, acc0, acc0 C U0 addq m1b, acc2, acc1 C L1 umulh v1, ulimb, m1b C U1 and r19,numb_mask, r28 C L0 extract numb part bis r31, r31, r31 C L1 nop srl m2a,NAIL_BITS, r8 C U0 lda n, -1(n) C L0 mulq v2, ulimb, m2a C U1 addq r8, acc1, acc1 C L0 bis r31, m2b, acc2 C L1 umulh v2, ulimb, m2b C U1 srl r19,NUMB_BITS, r19 C U0 extract nail part stq r28, -8(rp) C L bne n, L(top) C U0 L(end): ldq rlimb, 0(rp) addq r19, acc0, acc0 C propagate nail lda rp, 8(rp) srl m0a,NAIL_BITS, r8 C U0 addq r8, acc0, r19 addq m0b, acc1, acc0 addq rlimb, r19, r19 srl m1a,NAIL_BITS, r8 C U0 addq r8, acc0, acc0 addq m1b, acc2, acc1 and r19,numb_mask, r28 C extract limb srl m2a,NAIL_BITS, r8 C U0 addq r8, acc1, acc1 bis r31, m2b, acc2 srl r19,NUMB_BITS, r19 C extract nail stq r28, -8(rp) addq r19, acc0, acc0 C propagate nail and acc0,numb_mask, r28 stq r28, 0(rp) srl acc0,NUMB_BITS, r19 addq r19, acc1, acc1 and acc1,numb_mask, r28 stq r28, 8(rp) srl acc1,NUMB_BITS, r19 addq r19, acc2, m0a ret r31, (r26), 1 EPILOGUE() ASM_END()