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/129/A129555.asm | neoneye/loda-programs | 11 | 3476 | ; A129555: A054523 * A129372.
; Submitted by <NAME>
; 1,1,1,3,0,1,2,1,0,1,5,0,0,0,1,3,3,1,0,0,1,7,0,0,0,0,0,1,4,2,0,1,0,0,0,1,9,0,3,0,0,0,0,0,1,5,5,0,0,1,0,0,0,0,1
seq $0,126988 ; Triangle read by rows: T(n,k) = n/k if k is a divisor of n; T(n,k) = 0 if k is not a divisor of n (1 <= k <= n).
dif $0,2
|
scim-spec/scim-spec-protocol/src/main/antlr4/imports/Urn.g4 | bdemers/directory-scimple | 20 | 5170 | /*
* 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.
*/
grammar Urn;
URN: 'urn:' NID ':' NSS;
fragment NID: LETNUM LETNUMHYP+; // TODO limit to {1,31}
fragment LETNUM: [a-zA-Z0-9];
fragment LETNUMHYP: LETNUM | '-';
fragment NSS: URNCHARS+;
fragment URNCHARS: TRANS | '%' HEX HEX;
fragment TRANS: LETNUM | OTHER;
fragment HEX: [a-fA-F0-9];
fragment OTHER: '(' | ')' | '+' | ',' | '-' | '.' | ':' | '=' | '@' | ';' | '$' | '_' | '!' | '*' | '\'';
|
oeis/163/A163607.asm | neoneye/loda-programs | 11 | 97818 | ; A163607: a(n) = ((5 + 2*sqrt(2))*(1 + sqrt(2))^n + (5 - 2*sqrt(2))*(1 - sqrt(2))^n)/2.
; Submitted by <NAME>(s4)
; 5,9,23,55,133,321,775,1871,4517,10905,26327,63559,153445,370449,894343,2159135,5212613,12584361,30381335,73347031,177075397,427497825,1032071047,2491639919,6015350885,14522341689,35060034263,84642410215,204344854693,493332119601,1191009093895,2875350307391,6941709708677,16758769724745,40459249158167,97677268041079,235813785240325,569304838521729,1374423462283783,3318151763089295,8010726988462373,19339605740014041,46689938468490455,112719482676994951,272128903822480357,656977290321955665
mov $3,2
lpb $0
sub $0,1
mov $2,$3
add $3,$1
mov $1,$2
add $1,1
add $3,$2
lpe
mov $0,$3
mul $0,2
add $0,1
|
intro/tests/test1.agda | KMx404/selfev.agda | 2 | 15365 | -- this is the first test I run
-- Its been a while since i used my brain, @KMx404
module test1 where
data 𝕟 : Set where
--zero : 𝕟 --its not practical to do so, we can use more efficient math formulas
suc : 𝕟 → 𝕟 -- since We have the value of zero => n, any next item succ will consider it as n.num
_+_ : 𝕟 → 𝕟 → 𝕟 -- Defining addition? I guess (wtf is guess? haha)
-- zero : zero
--zero + zero = zero
--zero + 𝕟 = 𝕟 -- Zero has no effect in addition
|
oeis/098/A098159.asm | neoneye/loda-programs | 11 | 247407 | ; A098159: Numbers n with property that when writing down all the nonnegative numbers from 0 to n one uses n odd digits.
; Submitted by <NAME>
; 1,17,18,20,21,37,38,40,41,57,58,60,61,77,78,80,81,97,98
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
sub $4,1
sub $0,$4
add $0,3
gcd $0,4
mov $2,$0
mov $3,$0
mul $3,4
mov $5,0
lpb $3
add $1,$2
add $5,$2
add $1,$5
add $2,$1
div $3,3
sub $3,1
lpe
div $1,$2
add $6,$5
lpe
mov $0,$6
|
src/hardware.asm | Amjad50/rtc3test | 19 | 179515 | ; Mostly taken from hardware.inc (https://github.com/gbdev/hardware.inc)
rJOYP EQU $FF00
rDIV EQU $FF04
rTIMA EQU $FF05
rTMA EQU $FF06
rTAC EQU $FF07
rIF EQU $FF0F
rNR52 EQU $FF26
rLCDC EQU $FF40
rSCY EQU $FF42
rSCX EQU $FF43
rBGP EQU $FF47
rVBK EQU $FF4F
rBCPS EQU $FF68
rBCPD EQU $FF69
rIE EQU $FFFF
; MBC3 constants
rRAMG EQU $0000
rRAMB EQU $4000
rRTCL EQU $6000 ; no standard name... hardware.inc only cares about MBC5 :(
; there's no sensible prefix for these, so just leave them unprefixed as the constants they are
RTCS EQU 8
RTCM EQU 9
RTCH EQU 10
RTCDL EQU 11
RTCDH EQU 12
|
home/pokemon.asm | opiter09/ASM-Machina | 1 | 3156 | <reponame>opiter09/ASM-Machina<filename>home/pokemon.asm
DrawHPBar::
; Draw an HP bar d tiles long, and fill it to e pixels.
; If c is nonzero, show at least a sliver regardless.
; The right end of the bar changes with [wHPBarType].
push hl
push de
push bc
; Left
ld a, $71 ; "HP:"
ld [hli], a
ld a, $62
ld [hli], a
push hl
; Middle
ld a, $63 ; empty
.draw
ld [hli], a
dec d
jr nz, .draw
; Right
ld a, [wHPBarType]
dec a
ld a, $6d ; status screen and battle
jr z, .ok
dec a ; pokemon menu
.ok
ld [hl], a
pop hl
ld a, e
and a
jr nz, .fill
; If c is nonzero, draw a pixel anyway.
ld a, c
and a
jr z, .done
ld e, 1
.fill
ld a, e
sub 8
jr c, .partial
ld e, a
ld a, $6b ; full
ld [hli], a
ld a, e
and a
jr z, .done
jr .fill
.partial
; Fill remaining pixels at the end if necessary.
ld a, $63 ; empty
add e
ld [hl], a
.done
pop bc
pop de
pop hl
ret
; loads pokemon data from one of multiple sources to wLoadedMon
; loads base stats to wMonHeader
; INPUT:
; [wWhichPokemon] = index of pokemon within party/box
; [wMonDataLocation] = source
; 00: player's party
; 01: enemy's party
; 02: current box
; 03: daycare
; OUTPUT:
; [wcf91] = pokemon ID
; wLoadedMon = base address of pokemon data
; wMonHeader = base address of base stats
LoadMonData::
jpfar LoadMonData_
OverwritewMoves::
; Write c to [wMoves + b]. Unused.
ld hl, wMoves
ld e, b
ld d, 0
add hl, de
ld a, c
ld [hl], a
ret
LoadFlippedFrontSpriteByMonIndex::
ld a, 1
ld [wSpriteFlipped], a
LoadFrontSpriteByMonIndex::
push hl
ld a, [wd11e]
push af
ld a, [wcf91]
ld [wd11e], a
predef IndexToPokedex
ld hl, wd11e
ld a, [hl]
pop bc
ld [hl], b
and a
pop hl
;jr z, .invalidDexNumber ; dex #0 invalid
;cp NUM_POKEMON + 1
;jr c, .validDexNumber ; dex >#151 invalid
jp .validDexNumber
.invalidDexNumber
ld a, RHYDON ; $1
ld [wcf91], a
ret
.validDexNumber
push hl
ld de, vFrontPic
call LoadMonFrontSprite
pop hl
ldh a, [hLoadedROMBank]
push af
ld a, BANK(CopyUncompressedPicToHL)
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
xor a
ldh [hStartTileID], a
call CopyUncompressedPicToHL
xor a
ld [wSpriteFlipped], a
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ret
PlayCry::
; Play monster a's cry.
call GetCryData
call PlaySound
jp WaitForSoundToFinish
GetCryData::
; Load cry data for monster a.
dec a
ld c, a
ld b, 0
ld hl, CryData
add hl, bc
add hl, bc
add hl, bc
ld a, BANK(CryData)
call BankswitchHome
ld a, [hli]
ld b, a ; cry id
ld a, [hli]
ld [wFrequencyModifier], a
ld a, [hl]
ld [wTempoModifier], a
call BankswitchBack
; Cry headers have 3 channels,
; and start from index CRY_SFX_START,
; so add 3 times the cry id.
ld a, b
ld c, CRY_SFX_START
rlca ; * 2
add b
add c
ret
DisplayPartyMenu::
ldh a, [hTileAnimations]
push af
xor a
ldh [hTileAnimations], a
call GBPalWhiteOutWithDelay3
call ClearSprites
call PartyMenuInit
call DrawPartyMenu
jp HandlePartyMenuInput
GoBackToPartyMenu::
ldh a, [hTileAnimations]
push af
xor a
ldh [hTileAnimations], a
call PartyMenuInit
call RedrawPartyMenu
jp HandlePartyMenuInput
PartyMenuInit::
ld a, 1 ; hardcoded bank
call BankswitchHome
call LoadHpBarAndStatusTilePatterns
ld hl, wd730
set 6, [hl] ; turn off letter printing delay
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
ld [wMenuWatchMovingOutOfBounds], a
ld hl, wTopMenuItemY
inc a
ld [hli], a ; top menu item Y
xor a
ld [hli], a ; top menu item X
ld a, [wPartyAndBillsPCSavedMenuItem]
push af
ld [hli], a ; current menu item ID
inc hl
ld a, [wPartyCount]
and a ; are there more than 0 pokemon in the party?
jr z, .storeMaxMenuItemID
dec a
; if party is not empty, the max menu item ID is ([wPartyCount] - 1)
; otherwise, it is 0
.storeMaxMenuItemID
ld [hli], a ; max menu item ID
ld a, [wForcePlayerToChooseMon]
and a
ld a, A_BUTTON | B_BUTTON
jr z, .next
xor a
ld [wForcePlayerToChooseMon], a
inc a ; a = A_BUTTON
.next
ld [hli], a ; menu watched keys
pop af
ld [hl], a ; old menu item ID
ret
HandlePartyMenuInput::
ld a, 1
ld [wMenuWrappingEnabled], a
ld a, $40
ld [wPartyMenuAnimMonEnabled], a
call HandleMenuInput_
call PlaceUnfilledArrowMenuCursor
ld b, a
xor a
ld [wPartyMenuAnimMonEnabled], a
ld a, [wCurrentMenuItem]
ld [wPartyAndBillsPCSavedMenuItem], a
ld hl, wd730
res 6, [hl] ; turn on letter printing delay
ld a, [wMenuItemToSwap]
and a
jp nz, .swappingPokemon
pop af
ldh [hTileAnimations], a
bit 1, b
jr nz, .noPokemonChosen
ld a, [wPartyCount]
and a
jr z, .noPokemonChosen
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
ld hl, wPartySpecies
ld b, 0
ld c, a
add hl, bc
ld a, [hl]
ld [wcf91], a
ld [wBattleMonSpecies2], a
call BankswitchBack
and a
ret
.noPokemonChosen
call BankswitchBack
scf
ret
.swappingPokemon
bit 1, b ; was the B button pressed?
jr z, .handleSwap ; if not, handle swapping the pokemon
.cancelSwap ; if the B button was pressed
farcall ErasePartyMenuCursors
xor a
ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a
call RedrawPartyMenu
jr HandlePartyMenuInput
.handleSwap
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
farcall SwitchPartyMon
jr HandlePartyMenuInput
DrawPartyMenu::
ld hl, DrawPartyMenu_
jr DrawPartyMenuCommon
RedrawPartyMenu::
ld hl, RedrawPartyMenu_
DrawPartyMenuCommon::
ld b, BANK(RedrawPartyMenu_)
jp Bankswitch
; prints a pokemon's status condition
; INPUT:
; de = address of status condition
; hl = destination address
PrintStatusCondition::
push de
dec de
dec de ; de = address of current HP
ld a, [de]
ld b, a
dec de
ld a, [de]
or b ; is the pokemon's HP zero?
pop de
jr nz, PrintStatusConditionNotFainted
; if the pokemon's HP is 0, print "FNT"
ld a, "F"
ld [hli], a
ld a, "N"
ld [hli], a
ld [hl], "T"
and a
ret
PrintStatusConditionNotFainted::
homecall_sf PrintStatusAilment
ret
; function to print pokemon level, leaving off the ":L" if the level is at least 100
; INPUT:
; hl = destination address
; [wLoadedMonLevel] = level
PrintLevel::
ld a, "<LV>" ; ":L" tile ID
ld [hli], a
ld c, 2 ; number of digits
ld a, [wLoadedMonLevel] ; level
cp 100
jr c, PrintLevelCommon
; if level at least 100, write over the ":L" tile
dec hl
inc c ; increment number of digits to 3
jr PrintLevelCommon
; prints the level without leaving off ":L" regardless of level
; INPUT:
; hl = destination address
; [wLoadedMonLevel] = level
PrintLevelFull::
ld a, "<LV>" ; ":L" tile ID
ld [hli], a
ld c, 3 ; number of digits
ld a, [wLoadedMonLevel] ; level
PrintLevelCommon::
ld [wd11e], a
ld de, wd11e
ld b, LEFT_ALIGN | 1 ; 1 byte
jp PrintNumber
GetwMoves::
; Unused. Returns the move at index a from wMoves in a
ld hl, wMoves
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
ret
; copies the base stat data of a pokemon to wMonHeader
; INPUT:
; [wd0b5] = pokemon ID
GetMonHeader::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(BaseStats)
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
push bc
push de
push hl
ld a, [wd11e]
push af
ld a, [wd0b5]
ld [wd11e], a
ld de, FossilKabutopsPic
ld b, $66 ; size of Kabutops fossil and Ghost sprites
cp FOSSIL_KABUTOPS ; Kabutops fossil
jr z, .specialID
ld de, GhostPic
cp MON_GHOST ; Ghost
jr z, .specialID
ld de, FossilAerodactylPic
ld b, $77 ; size of Aerodactyl fossil sprite
cp FOSSIL_AERODACTYL ; Aerodactyl fossil
jr z, .specialID
cp MEW
jr z, .mew
predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number
ld a, [wd11e]
dec a
ld bc, BASE_DATA_SIZE
ld hl, BaseStats
call AddNTimes
ld de, wMonHeader
ld bc, BASE_DATA_SIZE
call CopyData
jr .done
.specialID
ld hl, wMonHSpriteDim
ld [hl], b ; write sprite dimensions
inc hl
ld [hl], e ; write front sprite pointer
inc hl
ld [hl], d
jr .done
.mew
ld hl, MewBaseStats
ld de, wMonHeader
ld bc, BASE_DATA_SIZE
ld a, BANK(MewBaseStats)
call FarCopyData
.done
ld a, [wd0b5]
ld [wMonHIndex], a
pop af
ld [wd11e], a
pop hl
pop de
pop bc
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ret
; copy party pokemon's name to wcd6d
GetPartyMonName2::
ld a, [wWhichPokemon] ; index within party
ld hl, wPartyMonNicks
; this is called more often
GetPartyMonName::
push hl
push bc
call SkipFixedLengthTextEntries ; add NAME_LENGTH to hl, a times
ld de, wcd6d
push de
ld bc, NAME_LENGTH
call CopyData
pop de
pop bc
pop hl
ret
|
agda/Transformation.agda | halfaya/MusicTools | 28 | 1994 | <reponame>halfaya/MusicTools
{-# OPTIONS --erased-cubical --safe #-}
module Transformation where
open import Data.Integer using (ℤ; +_; _-_; -_)
open import Data.List using (List; _∷_; []; map; reverse)
open import Data.Product using (_,_)
open import Note using (Note; tone; rest)
open import Pitch using (Pitch; transposePitch)
open import Interval using (PitchPair)
retrograde : List Note → List Note
retrograde = reverse
-- Create a list of intervals between all adjacent tones, ignoring rests.
intervals : List Note → List ℤ
intervals [] = []
intervals (rest _ ∷ ns) = intervals ns
intervals (tone d p ∷ ns) = intervals' p ns where
intervals' : Pitch → List Note → List ℤ
intervals' p [] = []
intervals' p (rest d ∷ ns) = intervals' p ns
intervals' p (tone d q ∷ ns) = (+ q) - (+ p) ∷ intervals' q ns
inversion : List Note → List Note
inversion [] = []
inversion (rest d ∷ ns) = rest d ∷ inversion ns
inversion xs@(tone d p ∷ ns) = tone d p ∷ inversion' p is ns where
is : List ℤ
is = map (-_) (intervals xs)
inversion' : Pitch → List ℤ → List Note → List Note
inversion' p [] ns = ns
inversion' _ (_ ∷ _) [] = []
inversion' p is@(_ ∷ _) (rest d ∷ ns) = rest d ∷ inversion' p is ns
inversion' p (i ∷ is) (tone d _ ∷ ns) = let q = transposePitch i p in (tone d q) ∷ inversion' q is ns
|
unittests/ASM/Primary/Primary_18_3.asm | cobalt2727/FEX | 628 | 20105 | %ifdef CONFIG
{
"RegData": {
"RBX": "0x09",
"RCX": "0x9919",
"RDX": "0x9A999929",
"RBP": "0x9E9D9C9B9A999939",
"RDI": "0x81",
"RSP": "0x7F81",
"R8": "0x7F7F7F81",
"R9": "0x02",
"R10": "0x4142427344754777",
"R11": "0x5152535455565687",
"R12": "0x6162636465666768"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov r15, 0xe0000000
mov rax, 0x4142434445464748
mov [r15 + 8 * 0], rax
mov rax, 0x5152535455565758
mov [r15 + 8 * 1], rax
mov rax, 0x6162636465666768
mov [r15 + 8 * 2], rax
mov rax, 0xD1
clc
lock sbb byte [r15 + 8 * 0 + 0], al
clc
lock sbb word [r15 + 8 * 0 + 2], ax
clc
lock sbb dword [r15 + 8 * 0 + 4], eax
clc
lock sbb qword [r15 + 8 * 1 + 0], rax
mov rbx, 0x71
mov rcx, 0x81
mov rdx, 0x91
mov rbp, 0xA1
clc
sbb bl, byte [r15 + 8 * 2]
clc
sbb cx, word [r15 + 8 * 2]
clc
sbb edx, dword [r15 + 8 * 2]
clc
sbb rbp, qword [r15 + 8 * 2]
mov rax, 0x01
clc
sbb al, 0x80
mov rdi, rax
mov rax, 0x01
clc
sbb ax, 0x8080
mov rsp, rax
mov rax, 0x01
clc
sbb eax, 0x80808080
mov r8, rax
mov rax, 0x01
clc
sbb rax, -1
mov r9, rax
mov r10, [r15 + 8 * 0]
mov r11, [r15 + 8 * 1]
mov r12, [r15 + 8 * 2]
hlt
|
src/core/interrupts.asm | jonasbantunes/tictactoe-gb | 0 | 246545 | SERIAL_TYPE EQU $0
SECTION "Interruptions", ROM0
SerialInt:
ld a, [rSC]
.if
bit SERIAL_TYPE, a
jp z, .else ; branch if external clock
.then
ld a, 0
ld [serial_turn], a
call ListenData
jp .end
.else
ld a, [rSB]
ld [serial_data], a
ld a, 1
ld [serial_turn], a
.end
ret
VblankInt:
call loadJoypad
ret
TimerInt:
ld a, [counter]
inc a
.if
cp a, $3
jp c, .else
.then
call TurnOffLCD
call ToggleCursor
; call ToggleMarks
call TurnOnLCD
ld a, 0
ld [counter], a
jp .end
.else
ld [counter], a
.end
ret |
target/cos_117/disasm/iop_overlay1/VMEWT.asm | jrrk2/cray-sim | 49 | 23532 | <reponame>jrrk2/cray-sim<gh_stars>10-100
0x0000 (0x000000) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0001 (0x000002) 0x2925- f:00024 d: 293 | OR[293] = A
0x0002 (0x000004) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0003 (0x000006) 0x292C- f:00024 d: 300 | OR[300] = A
0x0004 (0x000008) 0x2101- f:00020 d: 257 | A = OR[257]
0x0005 (0x00000A) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x0006 (0x00000C) 0x2908- f:00024 d: 264 | OR[264] = A
0x0007 (0x00000E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0008 (0x000010) 0x080D- f:00004 d: 13 | A = A > 13 (0x000D)
0x0009 (0x000012) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x000A (0x000014) 0x2931- f:00024 d: 305 | OR[305] = A
0x000B (0x000016) 0x1006- f:00010 d: 6 | A = 6 (0x0006)
0x000C (0x000018) 0x2919- f:00024 d: 281 | OR[281] = A
0x000D (0x00001A) 0x2102- f:00020 d: 258 | A = OR[258]
0x000E (0x00001C) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x000F (0x00001E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0010 (0x000020) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0011 (0x000022) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0012 (0x000024) 0x291A- f:00024 d: 282 | OR[282] = A
0x0013 (0x000026) 0x2D1A- f:00026 d: 282 | OR[282] = OR[282] + 1
0x0014 (0x000028) 0x2131- f:00020 d: 305 | A = OR[305]
0x0015 (0x00002A) 0x8602- f:00103 d: 2 | P = P + 2 (0x0017), A # 0
0x0016 (0x00002C) 0x7028- f:00070 d: 40 | P = P + 40 (0x003E)
0x0017 (0x00002E) 0x100A- f:00010 d: 10 | A = 10 (0x000A)
0x0018 (0x000030) 0x291B- f:00024 d: 283 | OR[283] = A
0x0019 (0x000032) 0x700A- f:00070 d: 10 | P = P + 10 (0x0023)
0x001A (0x000034) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x001B (0x000036) 0x2932- f:00024 d: 306 | OR[306] = A
0x001C (0x000038) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x001D (0x00003A) 0x2933- f:00024 d: 307 | OR[307] = A
0x001E (0x00003C) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x001F (0x00003E) 0x5800- f:00054 d: 0 | B = A
0x0020 (0x000040) 0x1800-0x3518 f:00014 d: 0 | A = 13592 (0x3518)
0x0022 (0x000044) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0023 (0x000046) 0x101A- f:00010 d: 26 | A = 26 (0x001A)
0x0024 (0x000048) 0x2932- f:00024 d: 306 | OR[306] = A
0x0025 (0x00004A) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x0026 (0x00004C) 0x2933- f:00024 d: 307 | OR[307] = A
0x0027 (0x00004E) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0028 (0x000050) 0x5800- f:00054 d: 0 | B = A
0x0029 (0x000052) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x002A (0x000054) 0x7C09- f:00076 d: 9 | R = OR[9]
0x002B (0x000056) 0x8602- f:00103 d: 2 | P = P + 2 (0x002D), A # 0
0x002C (0x000058) 0x7012- f:00070 d: 18 | P = P + 18 (0x003E)
0x002D (0x00005A) 0x2F1B- f:00027 d: 283 | OR[283] = OR[283] - 1
0x002E (0x00005C) 0x211B- f:00020 d: 283 | A = OR[283]
0x002F (0x00005E) 0x8E15- f:00107 d: 21 | P = P - 21 (0x001A), A # 0
0x0030 (0x000060) 0x2101- f:00020 d: 257 | A = OR[257]
0x0031 (0x000062) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x0032 (0x000064) 0x2908- f:00024 d: 264 | OR[264] = A
0x0033 (0x000066) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0034 (0x000068) 0x0A02- f:00005 d: 2 | A = A < 2 (0x0002)
0x0035 (0x00006A) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0036 (0x00006C) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x0037 (0x00006E) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0038 (0x000070) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x0039 (0x000072) 0x2932- f:00024 d: 306 | OR[306] = A
0x003A (0x000074) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x003B (0x000076) 0x5800- f:00054 d: 0 | B = A
0x003C (0x000078) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x003D (0x00007A) 0x7C09- f:00076 d: 9 | R = OR[9]
0x003E (0x00007C) 0x2125- f:00020 d: 293 | A = OR[293]
0x003F (0x00007E) 0x2926- f:00024 d: 294 | OR[294] = A
0x0040 (0x000080) 0x2101- f:00020 d: 257 | A = OR[257]
0x0041 (0x000082) 0x1405- f:00012 d: 5 | A = A + 5 (0x0005)
0x0042 (0x000084) 0x291D- f:00024 d: 285 | OR[285] = A
0x0043 (0x000086) 0x2101- f:00020 d: 257 | A = OR[257]
0x0044 (0x000088) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x0045 (0x00008A) 0x2921- f:00024 d: 289 | OR[289] = A
0x0046 (0x00008C) 0x2101- f:00020 d: 257 | A = OR[257]
0x0047 (0x00008E) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007)
0x0048 (0x000090) 0x291E- f:00024 d: 286 | OR[286] = A
0x0049 (0x000092) 0x211E- f:00020 d: 286 | A = OR[286]
0x004A (0x000094) 0x391E- f:00034 d: 286 | (OR[286]) = A
0x004B (0x000096) 0x211E- f:00020 d: 286 | A = OR[286]
0x004C (0x000098) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x004D (0x00009A) 0x2908- f:00024 d: 264 | OR[264] = A
0x004E (0x00009C) 0x211E- f:00020 d: 286 | A = OR[286]
0x004F (0x00009E) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0050 (0x0000A0) 0x2101- f:00020 d: 257 | A = OR[257]
0x0051 (0x0000A2) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009)
0x0052 (0x0000A4) 0x2908- f:00024 d: 264 | OR[264] = A
0x0053 (0x0000A6) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0054 (0x0000A8) 0x0E02- f:00007 d: 2 | A = A << 2 (0x0002)
0x0055 (0x0000AA) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x0056 (0x0000AC) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0057 (0x0000AE) 0x0C03- f:00006 d: 3 | A = A >> 3 (0x0003)
0x0058 (0x0000B0) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0059 (0x0000B2) 0x3102- f:00030 d: 258 | A = (OR[258])
0x005A (0x0000B4) 0x080D- f:00004 d: 13 | A = A > 13 (0x000D)
0x005B (0x0000B6) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x005C (0x0000B8) 0x8602- f:00103 d: 2 | P = P + 2 (0x005E), A # 0
0x005D (0x0000BA) 0x7005- f:00070 d: 5 | P = P + 5 (0x0062)
0x005E (0x0000BC) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x005F (0x0000BE) 0x2919- f:00024 d: 281 | OR[281] = A
0x0060 (0x0000C0) 0x7A03-0x027C f:00075 d: 3 | P = OR[3]+636 (0x027C)
0x0062 (0x0000C4) 0x311E- f:00030 d: 286 | A = (OR[286])
0x0063 (0x0000C6) 0x271E- f:00023 d: 286 | A = A - OR[286]
0x0064 (0x0000C8) 0x861A- f:00103 d: 26 | P = P + 26 (0x007E), A # 0
0x0065 (0x0000CA) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0066 (0x0000CC) 0x290D- f:00024 d: 269 | OR[269] = A
0x0067 (0x0000CE) 0x3121- f:00030 d: 289 | A = (OR[289])
0x0068 (0x0000D0) 0x8612- f:00103 d: 18 | P = P + 18 (0x007A), A # 0
0x0069 (0x0000D2) 0x1009- f:00010 d: 9 | A = 9 (0x0009)
0x006A (0x0000D4) 0x2932- f:00024 d: 306 | OR[306] = A
0x006B (0x0000D6) 0x2121- f:00020 d: 289 | A = OR[289]
0x006C (0x0000D8) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x006D (0x0000DA) 0x2933- f:00024 d: 307 | OR[307] = A
0x006E (0x0000DC) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x006F (0x0000DE) 0x2934- f:00024 d: 308 | OR[308] = A
0x0070 (0x0000E0) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0071 (0x0000E2) 0x5800- f:00054 d: 0 | B = A
0x0072 (0x0000E4) 0x1800-0x3518 f:00014 d: 0 | A = 13592 (0x3518)
0x0074 (0x0000E8) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0075 (0x0000EA) 0x2006- f:00020 d: 6 | A = OR[6]
0x0076 (0x0000EC) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x0077 (0x0000EE) 0x2908- f:00024 d: 264 | OR[264] = A
0x0078 (0x0000F0) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0079 (0x0000F2) 0x290D- f:00024 d: 269 | OR[269] = A
0x007A (0x0000F4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x007B (0x0000F6) 0x3921- f:00034 d: 289 | (OR[289]) = A
0x007C (0x0000F8) 0x210D- f:00020 d: 269 | A = OR[269]
0x007D (0x0000FA) 0x7224- f:00071 d: 36 | P = P - 36 (0x0059)
0x007E (0x0000FC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x007F (0x0000FE) 0x292F- f:00024 d: 303 | OR[303] = A
0x0080 (0x000100) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0081 (0x000102) 0x292E- f:00024 d: 302 | OR[302] = A
0x0082 (0x000104) 0x2922- f:00024 d: 290 | OR[290] = A
0x0083 (0x000106) 0x311E- f:00030 d: 286 | A = (OR[286])
0x0084 (0x000108) 0x2923- f:00024 d: 291 | OR[291] = A
0x0085 (0x00010A) 0x271E- f:00023 d: 286 | A = A - OR[286]
0x0086 (0x00010C) 0x8C2D- f:00106 d: 45 | P = P - 45 (0x0059), A = 0
0x0087 (0x00010E) 0x2123- f:00020 d: 291 | A = OR[291]
0x0088 (0x000110) 0xB434- f:00132 d: 52 | R = OR[52], A = 0
0x0089 (0x000112) 0x0000- f:00000 d: 0 | PASS
0x008A (0x000114) 0x2123- f:00020 d: 291 | A = OR[291]
0x008B (0x000116) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004)
0x008C (0x000118) 0x2924- f:00024 d: 292 | OR[292] = A
0x008D (0x00011A) 0x2124- f:00020 d: 292 | A = OR[292]
0x008E (0x00011C) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006)
0x008F (0x00011E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0090 (0x000120) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0091 (0x000122) 0x0A02- f:00005 d: 2 | A = A < 2 (0x0002)
0x0092 (0x000124) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0093 (0x000126) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x0094 (0x000128) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0095 (0x00012A) 0x2124- f:00020 d: 292 | A = OR[292]
0x0096 (0x00012C) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007)
0x0097 (0x00012E) 0x2908- f:00024 d: 264 | OR[264] = A
0x0098 (0x000130) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0099 (0x000132) 0x0A02- f:00005 d: 2 | A = A < 2 (0x0002)
0x009A (0x000134) 0x2920- f:00024 d: 288 | OR[288] = A
0x009B (0x000136) 0x2124- f:00020 d: 292 | A = OR[292]
0x009C (0x000138) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008)
0x009D (0x00013A) 0x2930- f:00024 d: 304 | OR[304] = A
0x009E (0x00013C) 0x3130- f:00030 d: 304 | A = (OR[304])
0x009F (0x00013E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x00A0 (0x000140) 0x291C- f:00024 d: 284 | OR[284] = A
0x00A1 (0x000142) 0x2124- f:00020 d: 292 | A = OR[292]
0x00A2 (0x000144) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x00A3 (0x000146) 0x2908- f:00024 d: 264 | OR[264] = A
0x00A4 (0x000148) 0x3108- f:00030 d: 264 | A = (OR[264])
0x00A5 (0x00014A) 0x292D- f:00024 d: 301 | OR[301] = A
0x00A6 (0x00014C) 0x292F- f:00024 d: 303 | OR[303] = A
0x00A7 (0x00014E) 0x292E- f:00024 d: 302 | OR[302] = A
0x00A8 (0x000150) 0x2131- f:00020 d: 305 | A = OR[305]
0x00A9 (0x000152) 0x8402- f:00102 d: 2 | P = P + 2 (0x00AB), A = 0
0x00AA (0x000154) 0x7020- f:00070 d: 32 | P = P + 32 (0x00CA)
0x00AB (0x000156) 0x211C- f:00020 d: 284 | A = OR[284]
0x00AC (0x000158) 0x8602- f:00103 d: 2 | P = P + 2 (0x00AE), A # 0
0x00AD (0x00015A) 0x701D- f:00070 d: 29 | P = P + 29 (0x00CA)
0x00AE (0x00015C) 0x100A- f:00010 d: 10 | A = 10 (0x000A)
0x00AF (0x00015E) 0x291B- f:00024 d: 283 | OR[283] = A
0x00B0 (0x000160) 0x700A- f:00070 d: 10 | P = P + 10 (0x00BA)
0x00B1 (0x000162) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x00B2 (0x000164) 0x2932- f:00024 d: 306 | OR[306] = A
0x00B3 (0x000166) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x00B4 (0x000168) 0x2933- f:00024 d: 307 | OR[307] = A
0x00B5 (0x00016A) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x00B6 (0x00016C) 0x5800- f:00054 d: 0 | B = A
0x00B7 (0x00016E) 0x1800-0x3518 f:00014 d: 0 | A = 13592 (0x3518)
0x00B9 (0x000172) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00BA (0x000174) 0x101A- f:00010 d: 26 | A = 26 (0x001A)
0x00BB (0x000176) 0x2932- f:00024 d: 306 | OR[306] = A
0x00BC (0x000178) 0x1125- f:00010 d: 293 | A = 293 (0x0125)
0x00BD (0x00017A) 0x2933- f:00024 d: 307 | OR[307] = A
0x00BE (0x00017C) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x00BF (0x00017E) 0x5800- f:00054 d: 0 | B = A
0x00C0 (0x000180) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00C1 (0x000182) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00C2 (0x000184) 0x8602- f:00103 d: 2 | P = P + 2 (0x00C4), A # 0
0x00C3 (0x000186) 0x7007- f:00070 d: 7 | P = P + 7 (0x00CA)
0x00C4 (0x000188) 0x2F1B- f:00027 d: 283 | OR[283] = OR[283] - 1
0x00C5 (0x00018A) 0x211B- f:00020 d: 283 | A = OR[283]
0x00C6 (0x00018C) 0x8E15- f:00107 d: 21 | P = P - 21 (0x00B1), A # 0
0x00C7 (0x00018E) 0x102A- f:00010 d: 42 | A = 42 (0x002A)
0x00C8 (0x000190) 0x2922- f:00024 d: 290 | OR[290] = A
0x00C9 (0x000192) 0x70DD- f:00070 d: 221 | P = P + 221 (0x01A6)
0x00CA (0x000194) 0x2125- f:00020 d: 293 | A = OR[293]
0x00CB (0x000196) 0x2926- f:00024 d: 294 | OR[294] = A
0x00CC (0x000198) 0x2130- f:00020 d: 304 | A = OR[304]
0x00CD (0x00019A) 0x2925- f:00024 d: 293 | OR[293] = A
0x00CE (0x00019C) 0x212E- f:00020 d: 302 | A = OR[302]
0x00CF (0x00019E) 0x1C00-0x0200 f:00016 d: 0 | A = A + 512 (0x0200)
0x00D1 (0x0001A2) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x00D2 (0x0001A4) 0x2913- f:00024 d: 275 | OR[275] = A
0x00D3 (0x0001A6) 0x2113- f:00020 d: 275 | A = OR[275]
0x00D4 (0x0001A8) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x00D5 (0x0001AA) 0x2913- f:00024 d: 275 | OR[275] = A
0x00D6 (0x0001AC) 0x2125- f:00020 d: 293 | A = OR[293]
0x00D7 (0x0001AE) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x00D8 (0x0001B0) 0x2908- f:00024 d: 264 | OR[264] = A
0x00D9 (0x0001B2) 0x2113- f:00020 d: 275 | A = OR[275]
0x00DA (0x0001B4) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x00DB (0x0001B6) 0x7E03-0x023D f:00077 d: 3 | R = OR[3]+573 (0x023D)
0x00DD (0x0001BA) 0x2126- f:00020 d: 294 | A = OR[294]
0x00DE (0x0001BC) 0x2925- f:00024 d: 293 | OR[293] = A
0x00DF (0x0001BE) 0x2122- f:00020 d: 290 | A = OR[290]
0x00E0 (0x0001C0) 0x86C6- f:00103 d: 198 | P = P + 198 (0x01A6), A # 0
0x00E1 (0x0001C2) 0x211C- f:00020 d: 284 | A = OR[284]
0x00E2 (0x0001C4) 0x84C4- f:00102 d: 196 | P = P + 196 (0x01A6), A = 0
0x00E3 (0x0001C6) 0x2124- f:00020 d: 292 | A = OR[292]
0x00E4 (0x0001C8) 0x142B- f:00012 d: 43 | A = A + 43 (0x002B)
0x00E5 (0x0001CA) 0x2927- f:00024 d: 295 | OR[295] = A
0x00E6 (0x0001CC) 0x212E- f:00020 d: 302 | A = OR[302]
0x00E7 (0x0001CE) 0x1E00-0x0200 f:00017 d: 0 | A = A - 512 (0x0200)
0x00E9 (0x0001D2) 0x8003- f:00100 d: 3 | P = P + 3 (0x00EC), C = 0
0x00EA (0x0001D4) 0x8402- f:00102 d: 2 | P = P + 2 (0x00EC), A = 0
0x00EB (0x0001D6) 0x7002- f:00070 d: 2 | P = P + 2 (0x00ED)
0x00EC (0x0001D8) 0x7039- f:00070 d: 57 | P = P + 57 (0x0125)
0x00ED (0x0001DA) 0x2131- f:00020 d: 305 | A = OR[305]
0x00EE (0x0001DC) 0x8602- f:00103 d: 2 | P = P + 2 (0x00F0), A # 0
0x00EF (0x0001DE) 0x7036- f:00070 d: 54 | P = P + 54 (0x0125)
0x00F0 (0x0001E0) 0x101A- f:00010 d: 26 | A = 26 (0x001A)
0x00F1 (0x0001E2) 0x2932- f:00024 d: 306 | OR[306] = A
0x00F2 (0x0001E4) 0x1126- f:00010 d: 294 | A = 294 (0x0126)
0x00F3 (0x0001E6) 0x2933- f:00024 d: 307 | OR[307] = A
0x00F4 (0x0001E8) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x00F5 (0x0001EA) 0x5800- f:00054 d: 0 | B = A
0x00F6 (0x0001EC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00F7 (0x0001EE) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00F8 (0x0001F0) 0x8602- f:00103 d: 2 | P = P + 2 (0x00FA), A # 0
0x00F9 (0x0001F2) 0x7004- f:00070 d: 4 | P = P + 4 (0x00FD)
0x00FA (0x0001F4) 0x2125- f:00020 d: 293 | A = OR[293]
0x00FB (0x0001F6) 0x2926- f:00024 d: 294 | OR[294] = A
0x00FC (0x0001F8) 0x7029- f:00070 d: 41 | P = P + 41 (0x0125)
0x00FD (0x0001FA) 0x3127- f:00030 d: 295 | A = (OR[295])
0x00FE (0x0001FC) 0x292A- f:00024 d: 298 | OR[298] = A
0x00FF (0x0001FE) 0x2127- f:00020 d: 295 | A = OR[295]
0x0100 (0x000200) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0101 (0x000202) 0x2908- f:00024 d: 264 | OR[264] = A
0x0102 (0x000204) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0103 (0x000206) 0x292B- f:00024 d: 299 | OR[299] = A
0x0104 (0x000208) 0x212A- f:00020 d: 298 | A = OR[298]
0x0105 (0x00020A) 0x8402- f:00102 d: 2 | P = P + 2 (0x0107), A = 0
0x0106 (0x00020C) 0x7007- f:00070 d: 7 | P = P + 7 (0x010D)
0x0107 (0x00020E) 0x212B- f:00020 d: 299 | A = OR[299]
0x0108 (0x000210) 0x8402- f:00102 d: 2 | P = P + 2 (0x010A), A = 0
0x0109 (0x000212) 0x7004- f:00070 d: 4 | P = P + 4 (0x010D)
0x010A (0x000214) 0x1024- f:00010 d: 36 | A = 36 (0x0024)
0x010B (0x000216) 0x2922- f:00024 d: 290 | OR[290] = A
0x010C (0x000218) 0x709A- f:00070 d: 154 | P = P + 154 (0x01A6)
0x010D (0x00021A) 0x1800-0x0200 f:00014 d: 0 | A = 512 (0x0200)
0x010F (0x00021E) 0x2928- f:00024 d: 296 | OR[296] = A
0x0110 (0x000220) 0x1026- f:00010 d: 38 | A = 38 (0x0026)
0x0111 (0x000222) 0x2932- f:00024 d: 306 | OR[306] = A
0x0112 (0x000224) 0x212A- f:00020 d: 298 | A = OR[298]
0x0113 (0x000226) 0x2933- f:00024 d: 307 | OR[307] = A
0x0114 (0x000228) 0x212B- f:00020 d: 299 | A = OR[299]
0x0115 (0x00022A) 0x2934- f:00024 d: 308 | OR[308] = A
0x0116 (0x00022C) 0x2125- f:00020 d: 293 | A = OR[293]
0x0117 (0x00022E) 0x2935- f:00024 d: 309 | OR[309] = A
0x0118 (0x000230) 0x2128- f:00020 d: 296 | A = OR[296]
0x0119 (0x000232) 0x2936- f:00024 d: 310 | OR[310] = A
0x011A (0x000234) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x011B (0x000236) 0x2937- f:00024 d: 311 | OR[311] = A
0x011C (0x000238) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x011D (0x00023A) 0x5800- f:00054 d: 0 | B = A
0x011E (0x00023C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x011F (0x00023E) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0120 (0x000240) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0121 (0x000242) 0x2B27- f:00025 d: 295 | OR[295] = A + OR[295]
0x0122 (0x000244) 0x212D- f:00020 d: 301 | A = OR[301]
0x0123 (0x000246) 0x2728- f:00023 d: 296 | A = A - OR[296]
0x0124 (0x000248) 0x292D- f:00024 d: 301 | OR[301] = A
0x0125 (0x00024A) 0x211A- f:00020 d: 282 | A = OR[282]
0x0126 (0x00024C) 0x5800- f:00054 d: 0 | B = A
0x0127 (0x00024E) 0x1800-0x0200 f:00014 d: 0 | A = 512 (0x0200)
0x0129 (0x000252) 0xE800- f:00164 d: 0 | IOB , fn004
0x012A (0x000254) 0x212D- f:00020 d: 301 | A = OR[301]
0x012B (0x000256) 0x1E00-0x0200 f:00017 d: 0 | A = A - 512 (0x0200)
0x012D (0x00025A) 0x8003- f:00100 d: 3 | P = P + 3 (0x0130), C = 0
0x012E (0x00025C) 0x8402- f:00102 d: 2 | P = P + 2 (0x0130), A = 0
0x012F (0x00025E) 0x7002- f:00070 d: 2 | P = P + 2 (0x0131)
0x0130 (0x000260) 0x7005- f:00070 d: 5 | P = P + 5 (0x0135)
0x0131 (0x000262) 0x1800-0x0200 f:00014 d: 0 | A = 512 (0x0200)
0x0133 (0x000266) 0x2929- f:00024 d: 297 | OR[297] = A
0x0134 (0x000268) 0x7003- f:00070 d: 3 | P = P + 3 (0x0137)
0x0135 (0x00026A) 0x212D- f:00020 d: 301 | A = OR[301]
0x0136 (0x00026C) 0x2929- f:00024 d: 297 | OR[297] = A
0x0137 (0x00026E) 0x2129- f:00020 d: 297 | A = OR[297]
0x0138 (0x000270) 0x843F- f:00102 d: 63 | P = P + 63 (0x0177), A = 0
0x0139 (0x000272) 0x3127- f:00030 d: 295 | A = (OR[295])
0x013A (0x000274) 0x292A- f:00024 d: 298 | OR[298] = A
0x013B (0x000276) 0x2127- f:00020 d: 295 | A = OR[295]
0x013C (0x000278) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x013D (0x00027A) 0x2908- f:00024 d: 264 | OR[264] = A
0x013E (0x00027C) 0x3108- f:00030 d: 264 | A = (OR[264])
0x013F (0x00027E) 0x292B- f:00024 d: 299 | OR[299] = A
0x0140 (0x000280) 0x212A- f:00020 d: 298 | A = OR[298]
0x0141 (0x000282) 0x8402- f:00102 d: 2 | P = P + 2 (0x0143), A = 0
0x0142 (0x000284) 0x700B- f:00070 d: 11 | P = P + 11 (0x014D)
0x0143 (0x000286) 0x212B- f:00020 d: 299 | A = OR[299]
0x0144 (0x000288) 0x8402- f:00102 d: 2 | P = P + 2 (0x0146), A = 0
0x0145 (0x00028A) 0x7008- f:00070 d: 8 | P = P + 8 (0x014D)
0x0146 (0x00028C) 0x1024- f:00010 d: 36 | A = 36 (0x0024)
0x0147 (0x00028E) 0x2922- f:00024 d: 290 | OR[290] = A
0x0148 (0x000290) 0x211A- f:00020 d: 282 | A = OR[282]
0x0149 (0x000292) 0x5800- f:00054 d: 0 | B = A
0x014A (0x000294) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x014B (0x000296) 0xE800- f:00164 d: 0 | IOB , fn004
0x014C (0x000298) 0x705A- f:00070 d: 90 | P = P + 90 (0x01A6)
0x014D (0x00029A) 0x2125- f:00020 d: 293 | A = OR[293]
0x014E (0x00029C) 0x2726- f:00023 d: 294 | A = A - OR[294]
0x014F (0x00029E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0151), A = 0
0x0150 (0x0002A0) 0x7014- f:00070 d: 20 | P = P + 20 (0x0164)
0x0151 (0x0002A2) 0x2129- f:00020 d: 297 | A = OR[297]
0x0152 (0x0002A4) 0x2928- f:00024 d: 296 | OR[296] = A
0x0153 (0x0002A6) 0x1026- f:00010 d: 38 | A = 38 (0x0026)
0x0154 (0x0002A8) 0x2932- f:00024 d: 306 | OR[306] = A
0x0155 (0x0002AA) 0x212A- f:00020 d: 298 | A = OR[298]
0x0156 (0x0002AC) 0x2933- f:00024 d: 307 | OR[307] = A
0x0157 (0x0002AE) 0x212B- f:00020 d: 299 | A = OR[299]
0x0158 (0x0002B0) 0x2934- f:00024 d: 308 | OR[308] = A
0x0159 (0x0002B2) 0x2126- f:00020 d: 294 | A = OR[294]
0x015A (0x0002B4) 0x2935- f:00024 d: 309 | OR[309] = A
0x015B (0x0002B6) 0x2129- f:00020 d: 297 | A = OR[297]
0x015C (0x0002B8) 0x2936- f:00024 d: 310 | OR[310] = A
0x015D (0x0002BA) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x015E (0x0002BC) 0x2937- f:00024 d: 311 | OR[311] = A
0x015F (0x0002BE) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0160 (0x0002C0) 0x5800- f:00054 d: 0 | B = A
0x0161 (0x0002C2) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0162 (0x0002C4) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0163 (0x0002C6) 0x7011- f:00070 d: 17 | P = P + 17 (0x0174)
0x0164 (0x0002C8) 0x1026- f:00010 d: 38 | A = 38 (0x0026)
0x0165 (0x0002CA) 0x2932- f:00024 d: 306 | OR[306] = A
0x0166 (0x0002CC) 0x212A- f:00020 d: 298 | A = OR[298]
0x0167 (0x0002CE) 0x2933- f:00024 d: 307 | OR[307] = A
0x0168 (0x0002D0) 0x212B- f:00020 d: 299 | A = OR[299]
0x0169 (0x0002D2) 0x2934- f:00024 d: 308 | OR[308] = A
0x016A (0x0002D4) 0x2126- f:00020 d: 294 | A = OR[294]
0x016B (0x0002D6) 0x2935- f:00024 d: 309 | OR[309] = A
0x016C (0x0002D8) 0x2129- f:00020 d: 297 | A = OR[297]
0x016D (0x0002DA) 0x2936- f:00024 d: 310 | OR[310] = A
0x016E (0x0002DC) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x016F (0x0002DE) 0x2937- f:00024 d: 311 | OR[311] = A
0x0170 (0x0002E0) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0171 (0x0002E2) 0x5800- f:00054 d: 0 | B = A
0x0172 (0x0002E4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0173 (0x0002E6) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0174 (0x0002E8) 0x212D- f:00020 d: 301 | A = OR[301]
0x0175 (0x0002EA) 0x2729- f:00023 d: 297 | A = A - OR[297]
0x0176 (0x0002EC) 0x292D- f:00024 d: 301 | OR[301] = A
0x0177 (0x0002EE) 0x212E- f:00020 d: 302 | A = OR[302]
0x0178 (0x0002F0) 0x1E00-0x0200 f:00017 d: 0 | A = A - 512 (0x0200)
0x017A (0x0002F4) 0x8002- f:00100 d: 2 | P = P + 2 (0x017C), C = 0
0x017B (0x0002F6) 0x8602- f:00103 d: 2 | P = P + 2 (0x017D), A # 0
0x017C (0x0002F8) 0x7002- f:00070 d: 2 | P = P + 2 (0x017E)
0x017D (0x0002FA) 0x7005- f:00070 d: 5 | P = P + 5 (0x0182)
0x017E (0x0002FC) 0x211A- f:00020 d: 282 | A = OR[282]
0x017F (0x0002FE) 0x5800- f:00054 d: 0 | B = A
0x0180 (0x000300) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0181 (0x000302) 0xE800- f:00164 d: 0 | IOB , fn004
0x0182 (0x000304) 0x2128- f:00020 d: 296 | A = OR[296]
0x0183 (0x000306) 0x0A02- f:00005 d: 2 | A = A < 2 (0x0002)
0x0184 (0x000308) 0x2920- f:00024 d: 288 | OR[288] = A
0x0185 (0x00030A) 0x7E03-0x023D f:00077 d: 3 | R = OR[3]+573 (0x023D)
0x0187 (0x00030E) 0x2122- f:00020 d: 290 | A = OR[290]
0x0188 (0x000310) 0x8602- f:00103 d: 2 | P = P + 2 (0x018A), A # 0
0x0189 (0x000312) 0x7006- f:00070 d: 6 | P = P + 6 (0x018F)
0x018A (0x000314) 0x211A- f:00020 d: 282 | A = OR[282]
0x018B (0x000316) 0x5800- f:00054 d: 0 | B = A
0x018C (0x000318) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x018D (0x00031A) 0xE800- f:00164 d: 0 | IOB , fn004
0x018E (0x00031C) 0x7018- f:00070 d: 24 | P = P + 24 (0x01A6)
0x018F (0x00031E) 0x212E- f:00020 d: 302 | A = OR[302]
0x0190 (0x000320) 0x2728- f:00023 d: 296 | A = A - OR[296]
0x0191 (0x000322) 0x292E- f:00024 d: 302 | OR[302] = A
0x0192 (0x000324) 0x212E- f:00020 d: 302 | A = OR[302]
0x0193 (0x000326) 0x8413- f:00102 d: 19 | P = P + 19 (0x01A6), A = 0
0x0194 (0x000328) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x0195 (0x00032A) 0x2B27- f:00025 d: 295 | OR[295] = A + OR[295]
0x0196 (0x00032C) 0x2125- f:00020 d: 293 | A = OR[293]
0x0197 (0x00032E) 0x2726- f:00023 d: 294 | A = A - OR[294]
0x0198 (0x000330) 0x8C6E- f:00106 d: 110 | P = P - 110 (0x012A), A = 0
0x0199 (0x000332) 0x2125- f:00020 d: 293 | A = OR[293]
0x019A (0x000334) 0x291B- f:00024 d: 283 | OR[283] = A
0x019B (0x000336) 0x2126- f:00020 d: 294 | A = OR[294]
0x019C (0x000338) 0x2925- f:00024 d: 293 | OR[293] = A
0x019D (0x00033A) 0x211B- f:00020 d: 283 | A = OR[283]
0x019E (0x00033C) 0x2926- f:00024 d: 294 | OR[294] = A
0x019F (0x00033E) 0x2128- f:00020 d: 296 | A = OR[296]
0x01A0 (0x000340) 0x291B- f:00024 d: 283 | OR[283] = A
0x01A1 (0x000342) 0x2129- f:00020 d: 297 | A = OR[297]
0x01A2 (0x000344) 0x2928- f:00024 d: 296 | OR[296] = A
0x01A3 (0x000346) 0x211B- f:00020 d: 283 | A = OR[283]
0x01A4 (0x000348) 0x2929- f:00024 d: 297 | OR[297] = A
0x01A5 (0x00034A) 0x727B- f:00071 d: 123 | P = P - 123 (0x012A)
0x01A6 (0x00034C) 0x2131- f:00020 d: 305 | A = OR[305]
0x01A7 (0x00034E) 0x8402- f:00102 d: 2 | P = P + 2 (0x01A9), A = 0
0x01A8 (0x000350) 0x7011- f:00070 d: 17 | P = P + 17 (0x01B9)
0x01A9 (0x000352) 0x2125- f:00020 d: 293 | A = OR[293]
0x01AA (0x000354) 0x8602- f:00103 d: 2 | P = P + 2 (0x01AC), A # 0
0x01AB (0x000356) 0x700E- f:00070 d: 14 | P = P + 14 (0x01B9)
0x01AC (0x000358) 0x101B- f:00010 d: 27 | A = 27 (0x001B)
0x01AD (0x00035A) 0x2932- f:00024 d: 306 | OR[306] = A
0x01AE (0x00035C) 0x2125- f:00020 d: 293 | A = OR[293]
0x01AF (0x00035E) 0x2933- f:00024 d: 307 | OR[307] = A
0x01B0 (0x000360) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x01B1 (0x000362) 0x5800- f:00054 d: 0 | B = A
0x01B2 (0x000364) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B3 (0x000366) 0x7C09- f:00076 d: 9 | R = OR[9]
0x01B4 (0x000368) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B5 (0x00036A) 0x2925- f:00024 d: 293 | OR[293] = A
0x01B6 (0x00036C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01B7 (0x00036E) 0x2926- f:00024 d: 294 | OR[294] = A
0x01B8 (0x000370) 0x7012- f:00070 d: 18 | P = P + 18 (0x01CA)
0x01B9 (0x000372) 0x2125- f:00020 d: 293 | A = OR[293]
0x01BA (0x000374) 0x2726- f:00023 d: 294 | A = A - OR[294]
0x01BB (0x000376) 0x8602- f:00103 d: 2 | P = P + 2 (0x01BD), A # 0
0x01BC (0x000378) 0x700E- f:00070 d: 14 | P = P + 14 (0x01CA)
0x01BD (0x00037A) 0x2126- f:00020 d: 294 | A = OR[294]
0x01BE (0x00037C) 0x8602- f:00103 d: 2 | P = P + 2 (0x01C0), A # 0
0x01BF (0x00037E) 0x700B- f:00070 d: 11 | P = P + 11 (0x01CA)
0x01C0 (0x000380) 0x101B- f:00010 d: 27 | A = 27 (0x001B)
0x01C1 (0x000382) 0x2932- f:00024 d: 306 | OR[306] = A
0x01C2 (0x000384) 0x2126- f:00020 d: 294 | A = OR[294]
0x01C3 (0x000386) 0x2933- f:00024 d: 307 | OR[307] = A
0x01C4 (0x000388) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x01C5 (0x00038A) 0x5800- f:00054 d: 0 | B = A
0x01C6 (0x00038C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01C7 (0x00038E) 0x7C09- f:00076 d: 9 | R = OR[9]
0x01C8 (0x000390) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01C9 (0x000392) 0x2926- f:00024 d: 294 | OR[294] = A
0x01CA (0x000394) 0x212F- f:00020 d: 303 | A = OR[303]
0x01CB (0x000396) 0x272E- f:00023 d: 302 | A = A - OR[302]
0x01CC (0x000398) 0x292E- f:00024 d: 302 | OR[302] = A
0x01CD (0x00039A) 0x2124- f:00020 d: 292 | A = OR[292]
0x01CE (0x00039C) 0x142A- f:00012 d: 42 | A = A + 42 (0x002A)
0x01CF (0x00039E) 0x2908- f:00024 d: 264 | OR[264] = A
0x01D0 (0x0003A0) 0x212E- f:00020 d: 302 | A = OR[302]
0x01D1 (0x0003A2) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x01D2 (0x0003A4) 0x2122- f:00020 d: 290 | A = OR[290]
0x01D3 (0x0003A6) 0x8602- f:00103 d: 2 | P = P + 2 (0x01D5), A # 0
0x01D4 (0x0003A8) 0x7024- f:00070 d: 36 | P = P + 36 (0x01F8)
0x01D5 (0x0003AA) 0x2D2C- f:00026 d: 300 | OR[300] = OR[300] + 1
0x01D6 (0x0003AC) 0x212C- f:00020 d: 300 | A = OR[300]
0x01D7 (0x0003AE) 0x1700- f:00013 d: 256 | A = A - 256 (0x0100)
0x01D8 (0x0003B0) 0x8402- f:00102 d: 2 | P = P + 2 (0x01DA), A = 0
0x01D9 (0x0003B2) 0x701E- f:00070 d: 30 | P = P + 30 (0x01F7)
0x01DA (0x0003B4) 0x2F1A- f:00027 d: 282 | OR[282] = OR[282] - 1
0x01DB (0x0003B6) 0x211A- f:00020 d: 282 | A = OR[282]
0x01DC (0x0003B8) 0x1207- f:00011 d: 7 | A = A & 7 (0x0007)
0x01DD (0x0003BA) 0x1430- f:00012 d: 48 | A = A + 48 (0x0030)
0x01DE (0x0003BC) 0x2913- f:00024 d: 275 | OR[275] = A
0x01DF (0x0003BE) 0x211A- f:00020 d: 282 | A = OR[282]
0x01E0 (0x0003C0) 0x0803- f:00004 d: 3 | A = A > 3 (0x0003)
0x01E1 (0x0003C2) 0x1430- f:00012 d: 48 | A = A + 48 (0x0030)
0x01E2 (0x0003C4) 0x2914- f:00024 d: 276 | OR[276] = A
0x01E3 (0x0003C6) 0x2114- f:00020 d: 276 | A = OR[276]
0x01E4 (0x0003C8) 0x0A08- f:00005 d: 8 | A = A < 8 (0x0008)
0x01E5 (0x0003CA) 0x2513- f:00022 d: 275 | A = A + OR[275]
0x01E6 (0x0003CC) 0x2913- f:00024 d: 275 | OR[275] = A
0x01E7 (0x0003CE) 0x102D- f:00010 d: 45 | A = 45 (0x002D)
0x01E8 (0x0003D0) 0x2932- f:00024 d: 306 | OR[306] = A
0x01E9 (0x0003D2) 0x1800-0x0199 f:00014 d: 0 | A = 409 (0x0199)
0x01EB (0x0003D6) 0x2933- f:00024 d: 307 | OR[307] = A
0x01EC (0x0003D8) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x01ED (0x0003DA) 0x2934- f:00024 d: 308 | OR[308] = A
0x01EE (0x0003DC) 0x1800-0xFFFF f:00014 d: 0 | A = 65535 (0xFFFF)
0x01F0 (0x0003E0) 0x2935- f:00024 d: 309 | OR[309] = A
0x01F1 (0x0003E2) 0x2113- f:00020 d: 275 | A = OR[275]
0x01F2 (0x0003E4) 0x2936- f:00024 d: 310 | OR[310] = A
0x01F3 (0x0003E6) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x01F4 (0x0003E8) 0x5800- f:00054 d: 0 | B = A
0x01F5 (0x0003EA) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01F6 (0x0003EC) 0x7C09- f:00076 d: 9 | R = OR[9]
0x01F7 (0x0003EE) 0x7003- f:00070 d: 3 | P = P + 3 (0x01FA)
0x01F8 (0x0003F0) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x01F9 (0x0003F2) 0x292C- f:00024 d: 300 | OR[300] = A
0x01FA (0x0003F4) 0x3123- f:00030 d: 291 | A = (OR[291])
0x01FB (0x0003F6) 0xAE03-0x0205 f:00127 d: 3 | P = OR[3]+517 (0x0205), A # 0
0x01FD (0x0003FA) 0x7A03-0x023C f:00075 d: 3 | P = OR[3]+572 (0x023C)
0x01FF (0x0003FE) 0x3123- f:00030 d: 291 | A = (OR[291])
0x0200 (0x000400) 0x290D- f:00024 d: 269 | OR[269] = A
0x0201 (0x000402) 0x2123- f:00020 d: 291 | A = OR[291]
0x0202 (0x000404) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0203 (0x000406) 0x2908- f:00024 d: 264 | OR[264] = A
0x0204 (0x000408) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0205 (0x00040A) 0x290E- f:00024 d: 270 | OR[270] = A
0x0206 (0x00040C) 0x210D- f:00020 d: 269 | A = OR[269]
0x0207 (0x00040E) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0208 (0x000410) 0x210D- f:00020 d: 269 | A = OR[269]
0x0209 (0x000412) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x020A (0x000414) 0x2908- f:00024 d: 264 | OR[264] = A
0x020B (0x000416) 0x210E- f:00020 d: 270 | A = OR[270]
0x020C (0x000418) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x020D (0x00041A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x020E (0x00041C) 0x3923- f:00034 d: 291 | (OR[291]) = A
0x020F (0x00041E) 0x2122- f:00020 d: 290 | A = OR[290]
0x0210 (0x000420) 0x8603- f:00103 d: 3 | P = P + 3 (0x0213), A # 0
0x0211 (0x000422) 0x100A- f:00010 d: 10 | A = 10 (0x000A)
0x0212 (0x000424) 0x2922- f:00024 d: 290 | OR[290] = A
0x0213 (0x000426) 0x2122- f:00020 d: 290 | A = OR[290]
0x0214 (0x000428) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x0215 (0x00042A) 0x2922- f:00024 d: 290 | OR[290] = A
0x0216 (0x00042C) 0x2124- f:00020 d: 292 | A = OR[292]
0x0217 (0x00042E) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006)
0x0218 (0x000430) 0x2908- f:00024 d: 264 | OR[264] = A
0x0219 (0x000432) 0x3108- f:00030 d: 264 | A = (OR[264])
0x021A (0x000434) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x021C (0x000438) 0x2522- f:00022 d: 290 | A = A + OR[290]
0x021D (0x00043A) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x021E (0x00043C) 0x2124- f:00020 d: 292 | A = OR[292]
0x021F (0x00043E) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006)
0x0220 (0x000440) 0x2908- f:00024 d: 264 | OR[264] = A
0x0221 (0x000442) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0222 (0x000444) 0x0E01- f:00007 d: 1 | A = A << 1 (0x0001)
0x0223 (0x000446) 0x0A01- f:00005 d: 1 | A = A < 1 (0x0001)
0x0224 (0x000448) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000)
0x0225 (0x00044A) 0x0C02- f:00006 d: 2 | A = A >> 2 (0x0002)
0x0226 (0x00044C) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x0227 (0x00044E) 0x2124- f:00020 d: 292 | A = OR[292]
0x0228 (0x000450) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028)
0x0229 (0x000452) 0x2908- f:00024 d: 264 | OR[264] = A
0x022A (0x000454) 0x3108- f:00030 d: 264 | A = (OR[264])
0x022B (0x000456) 0x291B- f:00024 d: 283 | OR[283] = A
0x022C (0x000458) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x022D (0x00045A) 0x2932- f:00024 d: 306 | OR[306] = A
0x022E (0x00045C) 0x211B- f:00020 d: 283 | A = OR[283]
0x022F (0x00045E) 0x2933- f:00024 d: 307 | OR[307] = A
0x0230 (0x000460) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0231 (0x000462) 0x2934- f:00024 d: 308 | OR[308] = A
0x0232 (0x000464) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0233 (0x000466) 0x5800- f:00054 d: 0 | B = A
0x0234 (0x000468) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0235 (0x00046A) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0236 (0x00046C) 0x73DD- f:00071 d: 477 | P = P - 477 (0x0059)
0x0237 (0x00046E) 0x211A- f:00020 d: 282 | A = OR[282]
0x0238 (0x000470) 0x5800- f:00054 d: 0 | B = A
0x0239 (0x000472) 0xE000- f:00160 d: 0 | IOB , fn000
0x023A (0x000474) 0x0400- f:00002 d: 0 | I = 0
0x023B (0x000476) 0x0000- f:00000 d: 0 | PASS
0x023C (0x000478) 0xEE00- f:00167 d: 0 | IOB , fn007
0x023D (0x00047A) 0x2120- f:00020 d: 288 | A = OR[288]
0x023E (0x00047C) 0xE400- f:00162 d: 0 | IOB , fn002
0x023F (0x00047E) 0x2125- f:00020 d: 293 | A = OR[293]
0x0240 (0x000480) 0xE200- f:00161 d: 0 | IOB , fn001
0x0241 (0x000482) 0x1009- f:00010 d: 9 | A = 9 (0x0009)
0x0242 (0x000484) 0x2932- f:00024 d: 306 | OR[306] = A
0x0243 (0x000486) 0x211D- f:00020 d: 285 | A = OR[285]
0x0244 (0x000488) 0x2933- f:00024 d: 307 | OR[307] = A
0x0245 (0x00048A) 0x1064- f:00010 d: 100 | A = 100 (0x0064)
0x0246 (0x00048C) 0x2934- f:00024 d: 308 | OR[308] = A
0x0247 (0x00048E) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0248 (0x000490) 0x5800- f:00054 d: 0 | B = A
0x0249 (0x000492) 0x1800-0x3518 f:00014 d: 0 | A = 13592 (0x3518)
0x024B (0x000496) 0x7C09- f:00076 d: 9 | R = OR[9]
0x024C (0x000498) 0x2006- f:00020 d: 6 | A = OR[6]
0x024D (0x00049A) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B)
0x024E (0x00049C) 0x2908- f:00024 d: 264 | OR[264] = A
0x024F (0x00049E) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0250 (0x0004A0) 0x8602- f:00103 d: 2 | P = P + 2 (0x0252), A # 0
0x0251 (0x0004A2) 0x7005- f:00070 d: 5 | P = P + 5 (0x0256)
0x0252 (0x0004A4) 0x102B- f:00010 d: 43 | A = 43 (0x002B)
0x0253 (0x0004A6) 0x2922- f:00024 d: 290 | OR[290] = A
0x0254 (0x0004A8) 0x7409- f:00072 d: 9 | R = P + 9 (0x025D)
0x0255 (0x0004AA) 0x0200- f:00001 d: 0 | EXIT
0x0256 (0x0004AC) 0x3101- f:00030 d: 257 | A = (OR[257])
0x0257 (0x0004AE) 0x2913- f:00024 d: 275 | OR[275] = A
0x0258 (0x0004B0) 0x080F- f:00004 d: 15 | A = A > 15 (0x000F)
0x0259 (0x0004B2) 0x8403- f:00102 d: 3 | P = P + 3 (0x025C), A = 0
0x025A (0x0004B4) 0x1024- f:00010 d: 36 | A = 36 (0x0024)
0x025B (0x0004B6) 0x2922- f:00024 d: 290 | OR[290] = A
0x025C (0x0004B8) 0x0200- f:00001 d: 0 | EXIT
0x025D (0x0004BA) 0x211A- f:00020 d: 282 | A = OR[282]
0x025E (0x0004BC) 0x5800- f:00054 d: 0 | B = A
0x025F (0x0004BE) 0xE000- f:00160 d: 0 | IOB , fn000
0x0260 (0x0004C0) 0xE600- f:00163 d: 0 | IOB , fn003
0x0261 (0x0004C2) 0x1800-0x4000 f:00014 d: 0 | A = 16384 (0x4000)
0x0263 (0x0004C6) 0xE800- f:00164 d: 0 | IOB , fn004
0x0264 (0x0004C8) 0x101E- f:00010 d: 30 | A = 30 (0x001E)
0x0265 (0x0004CA) 0x8403- f:00102 d: 3 | P = P + 3 (0x0268), A = 0
0x0266 (0x0004CC) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x0267 (0x0004CE) 0x7202- f:00071 d: 2 | P = P - 2 (0x0265)
0x0268 (0x0004D0) 0x211A- f:00020 d: 282 | A = OR[282]
0x0269 (0x0004D2) 0x5800- f:00054 d: 0 | B = A
0x026A (0x0004D4) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x026B (0x0004D6) 0xE800- f:00164 d: 0 | IOB , fn004
0x026C (0x0004D8) 0x1032- f:00010 d: 50 | A = 50 (0x0032)
0x026D (0x0004DA) 0x8403- f:00102 d: 3 | P = P + 3 (0x0270), A = 0
0x026E (0x0004DC) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001)
0x026F (0x0004DE) 0x7202- f:00071 d: 2 | P = P - 2 (0x026D)
0x0270 (0x0004E0) 0x211A- f:00020 d: 282 | A = OR[282]
0x0271 (0x0004E2) 0x5800- f:00054 d: 0 | B = A
0x0272 (0x0004E4) 0xE600- f:00163 d: 0 | IOB , fn003
0x0273 (0x0004E6) 0xEC00- f:00166 d: 0 | IOB , fn006
0x0274 (0x0004E8) 0xE000- f:00160 d: 0 | IOB , fn000
0x0275 (0x0004EA) 0x0200- f:00001 d: 0 | EXIT
0x0276 (0x0004EC) 0x2126- f:00020 d: 294 | A = OR[294]
0x0277 (0x0004EE) 0x8602- f:00103 d: 2 | P = P + 2 (0x0279), A # 0
0x0278 (0x0004F0) 0x700D- f:00070 d: 13 | P = P + 13 (0x0285)
0x0279 (0x0004F2) 0x2125- f:00020 d: 293 | A = OR[293]
0x027A (0x0004F4) 0x2726- f:00023 d: 294 | A = A - OR[294]
0x027B (0x0004F6) 0x8602- f:00103 d: 2 | P = P + 2 (0x027D), A # 0
0x027C (0x0004F8) 0x7009- f:00070 d: 9 | P = P + 9 (0x0285)
0x027D (0x0004FA) 0x101B- f:00010 d: 27 | A = 27 (0x001B)
0x027E (0x0004FC) 0x2932- f:00024 d: 306 | OR[306] = A
0x027F (0x0004FE) 0x2126- f:00020 d: 294 | A = OR[294]
0x0280 (0x000500) 0x2933- f:00024 d: 307 | OR[307] = A
0x0281 (0x000502) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x0282 (0x000504) 0x5800- f:00054 d: 0 | B = A
0x0283 (0x000506) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0284 (0x000508) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0285 (0x00050A) 0x2125- f:00020 d: 293 | A = OR[293]
0x0286 (0x00050C) 0x8602- f:00103 d: 2 | P = P + 2 (0x0288), A # 0
0x0287 (0x00050E) 0x7009- f:00070 d: 9 | P = P + 9 (0x0290)
0x0288 (0x000510) 0x101B- f:00010 d: 27 | A = 27 (0x001B)
0x0289 (0x000512) 0x2932- f:00024 d: 306 | OR[306] = A
0x028A (0x000514) 0x2125- f:00020 d: 293 | A = OR[293]
0x028B (0x000516) 0x2933- f:00024 d: 307 | OR[307] = A
0x028C (0x000518) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x028D (0x00051A) 0x5800- f:00054 d: 0 | B = A
0x028E (0x00051C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x028F (0x00051E) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0290 (0x000520) 0x2102- f:00020 d: 258 | A = OR[258]
0x0291 (0x000522) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003)
0x0292 (0x000524) 0x2908- f:00024 d: 264 | OR[264] = A
0x0293 (0x000526) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0294 (0x000528) 0x840B- f:00102 d: 11 | P = P + 11 (0x029F), A = 0
0x0295 (0x00052A) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x0296 (0x00052C) 0x2932- f:00024 d: 306 | OR[306] = A
0x0297 (0x00052E) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x0298 (0x000530) 0x2933- f:00024 d: 307 | OR[307] = A
0x0299 (0x000532) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x029A (0x000534) 0x5800- f:00054 d: 0 | B = A
0x029B (0x000536) 0x1800-0x3518 f:00014 d: 0 | A = 13592 (0x3518)
0x029D (0x00053A) 0x7C09- f:00076 d: 9 | R = OR[9]
0x029E (0x00053C) 0x720E- f:00071 d: 14 | P = P - 14 (0x0290)
0x029F (0x00053E) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x02A0 (0x000540) 0x2932- f:00024 d: 306 | OR[306] = A
0x02A1 (0x000542) 0x2101- f:00020 d: 257 | A = OR[257]
0x02A2 (0x000544) 0x2933- f:00024 d: 307 | OR[307] = A
0x02A3 (0x000546) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x02A4 (0x000548) 0x5800- f:00054 d: 0 | B = A
0x02A5 (0x00054A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02A6 (0x00054C) 0x7C09- f:00076 d: 9 | R = OR[9]
0x02A7 (0x00054E) 0x2102- f:00020 d: 258 | A = OR[258]
0x02A8 (0x000550) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002)
0x02A9 (0x000552) 0x2908- f:00024 d: 264 | OR[264] = A
0x02AA (0x000554) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02AB (0x000556) 0x3908- f:00034 d: 264 | (OR[264]) = A
0x02AC (0x000558) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x02AD (0x00055A) 0x2932- f:00024 d: 306 | OR[306] = A
0x02AE (0x00055C) 0x1132- f:00010 d: 306 | A = 306 (0x0132)
0x02AF (0x00055E) 0x5800- f:00054 d: 0 | B = A
0x02B0 (0x000560) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x02B1 (0x000562) 0x7C09- f:00076 d: 9 | R = OR[9]
0x02B2 (0x000564) 0x0000- f:00000 d: 0 | PASS
0x02B3 (0x000566) 0x0000- f:00000 d: 0 | PASS
|
data/mapObjects/Route11Gate1F.asm | AmateurPanda92/pokemon-rby-dx | 9 | 11386 | Route11Gate1F_Object:
db $a ; border block
db 5 ; warps
warp 0, 4, 0, -1
warp 0, 5, 1, -1
warp 7, 4, 2, -1
warp 7, 5, 3, -1
warp 6, 8, 0, ROUTE_11_GATE_2F
db 0 ; signs
db 1 ; objects
object SPRITE_GUARD, 4, 1, STAY, NONE, 1 ; person
; warp-to
warp_to 0, 4, ROUTE_11_GATE_1F_WIDTH
warp_to 0, 5, ROUTE_11_GATE_1F_WIDTH
warp_to 7, 4, ROUTE_11_GATE_1F_WIDTH
warp_to 7, 5, ROUTE_11_GATE_1F_WIDTH
warp_to 6, 8, ROUTE_11_GATE_1F_WIDTH ; ROUTE_11_GATE_2F
|
source/amf/uml/amf-internals-uml_generalization_sets.ads | svn2github/matreshka | 24 | 15078 | <filename>source/amf/uml/amf-internals-uml_generalization_sets.ads<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- 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$
------------------------------------------------------------------------------
with AMF.Internals.UML_Packageable_Elements;
with AMF.UML.Classifiers;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Generalization_Sets;
with AMF.UML.Generalizations.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameterable_Elements;
with AMF.UML.String_Expressions;
with AMF.UML.Template_Parameters;
with AMF.Visitors;
package AMF.Internals.UML_Generalization_Sets is
type UML_Generalization_Set_Proxy is
limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
and AMF.UML.Generalization_Sets.UML_Generalization_Set with null record;
overriding function Get_Generalization
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization;
-- Getter of GeneralizationSet::generalization.
--
-- Designates the instances of Generalization which are members of a given
-- GeneralizationSet.
overriding function Get_Is_Covering
(Self : not null access constant UML_Generalization_Set_Proxy)
return Boolean;
-- Getter of GeneralizationSet::isCovering.
--
-- Indicates (via the associated Generalizations) whether or not the set
-- of specific Classifiers are covering for a particular general
-- classifier. When isCovering is true, every instance of a particular
-- general Classifier is also an instance of at least one of its specific
-- Classifiers for the GeneralizationSet. When isCovering is false, there
-- are one or more instances of the particular general Classifier that are
-- not instances of at least one of its specific Classifiers defined for
-- the GeneralizationSet.
overriding procedure Set_Is_Covering
(Self : not null access UML_Generalization_Set_Proxy;
To : Boolean);
-- Setter of GeneralizationSet::isCovering.
--
-- Indicates (via the associated Generalizations) whether or not the set
-- of specific Classifiers are covering for a particular general
-- classifier. When isCovering is true, every instance of a particular
-- general Classifier is also an instance of at least one of its specific
-- Classifiers for the GeneralizationSet. When isCovering is false, there
-- are one or more instances of the particular general Classifier that are
-- not instances of at least one of its specific Classifiers defined for
-- the GeneralizationSet.
overriding function Get_Is_Disjoint
(Self : not null access constant UML_Generalization_Set_Proxy)
return Boolean;
-- Getter of GeneralizationSet::isDisjoint.
--
-- Indicates whether or not the set of specific Classifiers in a
-- Generalization relationship have instance in common. If isDisjoint is
-- true, the specific Classifiers for a particular GeneralizationSet have
-- no members in common; that is, their intersection is empty. If
-- isDisjoint is false, the specific Classifiers in a particular
-- GeneralizationSet have one or more members in common; that is, their
-- intersection is not empty. For example, Person could have two
-- Generalization relationships, each with the different specific
-- Classifier: Manager or Staff. This would be disjoint because every
-- instance of Person must either be a Manager or Staff. In contrast,
-- Person could have two Generalization relationships involving two
-- specific (and non-covering) Classifiers: Sales Person and Manager. This
-- GeneralizationSet would not be disjoint because there are instances of
-- Person which can be a Sales Person and a Manager.
overriding procedure Set_Is_Disjoint
(Self : not null access UML_Generalization_Set_Proxy;
To : Boolean);
-- Setter of GeneralizationSet::isDisjoint.
--
-- Indicates whether or not the set of specific Classifiers in a
-- Generalization relationship have instance in common. If isDisjoint is
-- true, the specific Classifiers for a particular GeneralizationSet have
-- no members in common; that is, their intersection is empty. If
-- isDisjoint is false, the specific Classifiers in a particular
-- GeneralizationSet have one or more members in common; that is, their
-- intersection is not empty. For example, Person could have two
-- Generalization relationships, each with the different specific
-- Classifier: Manager or Staff. This would be disjoint because every
-- instance of Person must either be a Manager or Staff. In contrast,
-- Person could have two Generalization relationships involving two
-- specific (and non-covering) Classifiers: Sales Person and Manager. This
-- GeneralizationSet would not be disjoint because there are instances of
-- Person which can be a Sales Person and a Manager.
overriding function Get_Powertype
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access;
-- Getter of GeneralizationSet::powertype.
--
-- Designates the Classifier that is defined as the power type for the
-- associated GeneralizationSet.
overriding procedure Set_Powertype
(Self : not null access UML_Generalization_Set_Proxy;
To : AMF.UML.Classifiers.UML_Classifier_Access);
-- Setter of GeneralizationSet::powertype.
--
-- Designates the Classifier that is defined as the power type for the
-- associated GeneralizationSet.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Generalization_Set_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Generalization_Set_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Generalization_Set_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function All_Owning_Packages
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Generalization_Set_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Is_Compatible_With
(Self : not null access constant UML_Generalization_Set_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean;
-- Operation ParameterableElement::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. Subclasses
-- should override this operation to specify different compatibility
-- constraints.
overriding function Is_Template_Parameter
(Self : not null access constant UML_Generalization_Set_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding procedure Enter_Element
(Self : not null access constant UML_Generalization_Set_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Generalization_Set_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Generalization_Set_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Generalization_Sets;
|
oeis/248/A248575.asm | neoneye/loda-programs | 11 | 99143 | ; A248575: Rounded sums of the non-integer cube roots of n, as partitioned by the integer roots: round[sum(j from n^3+1 to (n+1)^3-1, j^(1/3))].
; Submitted by <NAME>(s1)
; 0,10,46,128,272,498,822,1264,1840,2570,3470,4560,5856,7378,9142,11168,13472,16074,18990,22240,25840,29810,34166,38928,44112,49738,55822,62384,69440,77010,85110,93760,102976,112778,123182,134208,145872,158194,171190,184880,199280,214410,230286,246928,264352,282578,301622,321504,342240,363850,386350,409760,434096,459378,485622,512848,541072,570314,600590,631920,664320,697810,732406,768128,804992,843018,882222,922624,964240,1007090,1051190,1096560,1143216,1191178,1240462,1291088,1343072,1396434
mul $0,4
add $0,4
div $0,2
mov $1,$0
bin $0,3
mul $0,9
add $0,$1
div $0,8
mul $0,2
|
work/ff3_present_scene.asm | ypyp-pprn-mnmn/ff3_hack | 4 | 101876 | <filename>work/ff3_present_scene.asm
;; encoding: utf-8
; ff3_present_scene.asm
;
; replaces presentScene()
;
;version:
; 0.2 (2017-12-17)
;
;======================================================================================================
ff3_present_scene_begin:
; [in] u8 A : commandId (00-25h)
; 01 : さがる(char:$52)
; 02 : 指示するキャラが前に出る(char:$52)
; 03 : playEffect_05 (back(03) )
; 04 : playEffect_04 (forward(02) )
; 07 : playEffect_0e(死亡・味方)
; 08 : $b38e 行動中のキャラを示す(一定のラインまで前に出る)
; 09 : $b38b 行動終了したキャラを元の位置まで戻す
; 0a : playEffect_0e(死亡・敵 $7e=死亡bit(各bitが敵1体に相当) )
; 0b : playEffect_0e
; (蘇生? bitが立っている敵の枠に敵がいたならグラ復活
; 生存かつ非表示の敵がいたとき $7e=生存bit で呼ばれる)
; 0C : 敵生成(召還・分裂・増殖) playEffect_0F (disp_0C)
; 0d : playEffect_0c (escape(06/07) : $7e9a(sideflag) < 0)
; 0e :
;
; 0F : prize($35:bb49)
; 10 : 対象選択
; 12 : 打撃モーション&エフェクト(char:$52)
; 13 : presentCharacter($34:8185)
; 14 : playEffect_00 (fight/sing 被弾モーション?)
; 15 : playEffect_06 (defend(05) )
; 16 : playEffect_09 (charge(0f) 通常)
; 17 : playEffect_09 (charge(0f) ためすぎ)
; 18 : playEffect_07 (jump(08) )
; 19 : playEffect_08 (landing(09) )
; 1a : playEffect_0a (intimidate(11) )
; 1b : playEffect_0b (cheer(12) )
; 1c : playEffect_0F (disp_0C) ダメージ表示?
; 1d : playEffect_01 (command13/ cast/item)
; 1f : playEffect_00 行動する敵が点滅
; 20 : playEffect_00 (fight/sing 敵の打撃エフェクト?)
; 21 : playEffect_0d (escape(06/07) : $7e9a(effectside) >= 0)
; 22 : playEffect_01 (magicparam+06 == #07)
; 23 : playEffect_01 (magicparam+06 == #0d)
; 24 : playEffect_0c (command15)
; [in] u8 X : actorIndex
; [out] u8 $7d7d : 0
INIT_PATCH $2f,$af4e,$afc0
presentScene:
;.handlers = $af74
stx <$95
asl a
clc
adc #LOW(.handlers)
sta <$93
lda #HIGH(.handlers)
sta <$94
lda #$6c
sta <$92
tya
pha
txa
pha
jsr $0092
pla
tax
pla
tay
rts
;$2f:af74 $af4e_funcTable;
.handlers:
.dw $b469, $b3c7, $b3cd, $b42a
.dw $b443, $b3f6, $b3d9, $b3d3
.dw $b38b, $b38e, $b33e, $b343
.dw $b348, $b34d, $b304, $b2eb
.dw $b2fa, $b260, $b24f, $b24c
.dw $b201, $b246, $b1d8, $b1e0
.dw $b1cf, $b1c1, $b1b5, $b1af
.dw $b1ac, $b15e, $b050, $b024
.dw $b005, $af24, $afff, $afe7
.dw $af44, $afd8
;extra
;$26
.dw psx_blowOnly
.dw psx_abyss
;------------------------------------------------------------------------------------------------------
;$2f:b352 moveCharacterBack
INIT_PATCH $2f,$b352,$b388
moveCharacterBack:
; [in] x : actorIndex
.goals = $7d7f
jsr getMoveOffset
clc
;fall through
moveCharacter_addAndStoreGoal:
.goals = $7d7f
bmi .confused
inc $7d7d
.confused:
adc .goals,x
sta .goals,x
jmp $b45c ;
getMoveOffset:
;[out] u8 a,$7e : offset
lda #0
sta $7d7d
txa
asl a
tay
lda $7d9b,y
and #$08
beq .not_confused
;backattack
lda #$f0
bne .store_and_set_x
.not_confused:
lda $7d8f,x
lsr a
lda #$10
bcc .at_front_line
asl a
.at_front_line:
.store_and_set_x:
sta <$7e
rts
;------------------------------------------------------------------------------------------------------
;$2f:b38e moveCharacterForward
INIT_PATCH $2f,$b38e,$b3c7
moveCharacterForward:
; [in] x : actorIndex
.goals = $7d7f
jsr getMoveOffset
eor #$ff
sec
jmp moveCharacter_addAndStoreGoal
;------------------------------------------------------------------------------------------------------
psx_blowOnly:
jsr $a9cf ;$a9cf();
jsr $a8ea ;loadBlowEffectParams(); // $a8ea();
jmp $aef0 ;dispatchEffectFunction_04(); //$aef0(); //打撃モーション
psx_abyss:
jsr moveCharacterForward
;presentScene_16 (charge)
lda #0
sta $7e19 ;charge motion flag
jsr $a9cf;
jsr $a9b1;
jsr $aefc; dispatchEffectFunction_07();
;jsr psx_blowOnly ;destorys x
jsr $a9cf
jsr $af14 ;dispatchEffectFunction_0d
lda #6
jsr $a1b3 ;clear sprites
ldx <$95 ;index
jmp $b3c7 ;backAndUpdatePpu
;$b3c7:
;======================================================================================================
RESTORE_PC ff3_present_scene_begin |
old_materials/workshop01/hello.asm | MrBat13/hse-acos-course | 9 | 91575 | # First program in MIPS assembly language.
# Prints "Hello World!"
.data
str:
.asciiz "Hello, world!"
.text
.globl main
main:
la $a0, str
li $v0, 4
syscall |
oeis/307/A307467.asm | neoneye/loda-programs | 11 | 172169 | <gh_stars>10-100
; A307467: The number of points, corresponding to the first n primes, and placed on the unit circle according to an algorithm using the data from A077218 (in the spirit of Ulam's spiral, and described in the COMMENTS section below), which lie on the closed arc of the unit circle from 0 to 45 degrees.
; Submitted by <NAME>(w4)
; 1,1,1,1,1,1,1,2,3,4,4,4,5,5,6,7
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
mov $1,0
sub $4,1
sub $0,$4
mov $2,1
mov $3,$0
mul $3,4
mov $5,0
lpb $3
add $5,$2
add $1,$5
add $1,2
add $1,$0
add $2,$1
sub $3,1
add $5,$1
lpe
mov $2,$5
mod $2,8
div $2,2
mov $8,$2
cmp $8,0
add $6,$8
lpe
mov $0,$6
|
oeis/087/A087275.asm | neoneye/loda-programs | 11 | 12185 | <filename>oeis/087/A087275.asm
; A087275: Write n in binary: 1ab..yz, then a(n) = 1b..yz + ... + 1yz + 1z + 1.
; Submitted by <NAME>(s3)
; 0,1,1,3,4,3,4,7,9,9,11,7,9,9,11,15,18,19,22,19,22,23,26,15,18,19,22,19,22,23,26,31,35,37,41,39,43,45,49,39,43,45,49,47,51,53,57,31,35,37,41,39,43,45,49,39,43,45,49,47,51,53,57,63,68,71,76
mov $2,1
lpb $0
mov $3,$0
trn $0,$2
mul $2,2
mod $3,$2
add $1,$3
lpe
mov $0,$1
|
oeis/344/A344508.asm | neoneye/loda-programs | 11 | 245209 | <gh_stars>10-100
; A344508: a(n) = Sum_{k=1..n} k * lcm(k,n).
; Submitted by <NAME>
; 1,6,24,64,175,270,686,928,1647,2150,4356,3792,8619,8526,11250,14592,25721,19926,40432,31200,44835,53966,87814,58272,108125,106470,132678,124656,224547,132750,294066,232960,284229,316166,372400,291168,600991,496014,560742,484000,909421,531846,1102004,791824,868725,1073870,1577226,921600,1678299,1303750,1664640,1562912,2558999,1596510,2365550,1939616,2611113,2736614,3940492,1940400,4506131,3580686,3482136,3727360,4668625,3386790,6571896,4642496,5651307,4427150,8297486,4540320,9277789,7302246
add $0,1
mov $2,$0
lpb $0
gcd $3,$0
mov $4,$0
div $4,$3
mov $3,$4
mul $3,$0
sub $0,1
mul $3,$2
add $1,$3
lpe
mov $0,$1
|
libsrc/stdio/ansi/oz/f_ansi_bel.asm | jpoikela/z88dk | 640 | 25409 | ;
; ANSI Video handling for Sharp OZ family
;
; BEL - chr(7) Beep it out (still nothing here)
;
; -- ONLY FOO STUFF, FOR NOW !! --
;
; <NAME> - Aug. 2002
;
;
; $Id: f_ansi_bel.asm,v 1.3 2016-06-12 16:06:43 dom Exp $
;
SECTION code_clib
PUBLIC ansi_BEL
.ansi_BEL
ret
|
oeis/268/A268827.asm | neoneye/loda-programs | 11 | 241523 | <gh_stars>10-100
; A268827: Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268825(n-1)).
; Submitted by <NAME>
; 0,1,3,2,6,7,5,12,4,10,14,13,15,30,26,25,27,11,9,24,8,54,50,49,51,19,17,48,16,31,29,20,28,18,22,21,23,102,98,97,99,35,33,96,32,47,45,36,44,34,38,37,39,55,53,60,52,58,62,61,63,46,42,41,43,59,57,40,56,198,194,193,195,67,65,192,64,79,77,68,76,66,70,69,71,87,85,92,84,90,94,93,95,78,74,73,75,91,89,72
mov $1,$0
trn $0,1
seq $0,268825 ; Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268823(n-1)).
add $0,1
seq $0,268717 ; Permutation of natural numbers: a(0) = 0, a(n) = A003188(1+A006068(n-1)), where A003188 is binary Gray code and A006068 is its inverse.
cmp $1,0
cmp $1,0
mul $0,$1
|
pdf2keynote/applescripts/insert_image.scpt | majorpb/pdf2keynote | 9 | 3330 | <reponame>majorpb/pdf2keynote
on run argv
set lastIndex to item 1 of argv as number
set theImage to item 2 of argv as POSIX file
tell application "Keynote"
tell the front document
set docWidth to its width
set docHeight to its height
tell slide lastIndex
make new image with properties { file: theImage, width: docWidth, height: docHeight, position: {0,0} }
end tell
end tell
end tell
end run
|
programs/oeis/262/A262037.asm | neoneye/loda | 22 | 165090 | <reponame>neoneye/loda<filename>programs/oeis/262/A262037.asm
; A262037: Replace the second half of digits of n with the first half in reverse order.
; 0,1,2,3,4,5,6,7,8,9,11,11,11,11,11,11,11,11,11,11,22,22,22,22,22,22,22,22,22,22,33,33,33,33,33,33,33,33,33,33,44,44,44,44,44,44,44,44,44,44,55,55,55,55,55,55,55,55,55,55,66,66,66,66,66,66,66,66,66,66,77,77,77,77,77,77,77
mul $0,10
max $1,$0
seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences).
sub $1,$0
div $1,9
mov $0,$1
|
sharding-core/src/main/antlr4/imports/PostgreSQLDALStatement.g4 | supercharles/sharding-sphere | 0 | 4455 | grammar PostgreSQLDALStatement;
import PostgreSQLKeyword, Keyword, BaseRule, DataType, Symbol;
show
: SHOW showParam
;
showParam
: ALL
| ID
;
|
test/interaction/Issue2487-2.agda | shlevy/agda | 1,989 | 13962 | <gh_stars>1000+
{-# OPTIONS --safe #-}
module Issue2487-2 where
import Issue2487.A
|
programs/oeis/080/A080239.asm | neoneye/loda | 22 | 28292 | ; A080239: Antidiagonal sums of triangle A035317.
; 1,1,2,3,6,9,15,24,40,64,104,168,273,441,714,1155,1870,3025,4895,7920,12816,20736,33552,54288,87841,142129,229970,372099,602070,974169,1576239,2550408,4126648,6677056,10803704,17480760,28284465,45765225,74049690,119814915,193864606,313679521,507544127,821223648,1328767776,2149991424,3478759200,5628750624,9107509825,14736260449,23843770274,38580030723,62423800998,101003831721,163427632719,264431464440,427859097160,692290561600,1120149658760,1812440220360,2932589879121,4745030099481,7677619978602,12422650078083,20100270056686,32522920134769,52623190191455,85146110326224,137769300517680,222915410843904,360684711361584,583600122205488,944284833567073,1527884955772561,2472169789339634,4000054745112195,6472224534451830,10472279279564025,16944503814015855,27416783093579880,44361286907595736,71778070001175616,116139356908771352,187917426909946968,304056783818718321,491974210728665289,796030994547383610,1288005205276048899,2084036199823432510,3372041405099481409,5456077604922913919,8828119010022395328,14284196614945309248,23112315624967704576,37396512239913013824,60508827864880718400,97905340104793732225,158414167969674450625,256319508074468182850,414733676044142633475
add $0,1
lpb $0
mov $2,$0
trn $0,4
seq $2,22354 ; Fibonacci sequence beginning 0, 20.
add $1,$2
lpe
div $1,20
mov $0,$1
|
title.asm | unlink2/nesrpg | 5 | 176821 | ; this file contains the title screen
; inits title mode
init_title:
lda #%00010000 ; pattern table 1
sta gfx_flags
lda #GAME_MODE_TITLE
sta game_mode
lda #<update_title
sta update_sub
lda #>update_title
sta update_sub+1
lda #<update_title_crit
sta update_sub_crit
lda #>update_title_crit
sta update_sub_crit+1
; load palette
lda #<palette_data
sta palette_ptr
lda #>palette_data
sta palette_ptr+1
jsr load_palette
rts
; critical updates for title screen
update_title_crit:
jmp update_crit_done
; update for title
update_title:
jmp update_done
|
RMonads/RMonadMorphs.agda | jmchapman/Relative-Monads | 21 | 2394 | <reponame>jmchapman/Relative-Monads<gh_stars>10-100
module RMonads.RMonadMorphs where
open import Library
open import Functors
open import Categories
open import RMonads
open Fun
open RMonad
record RMonadMorph {a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}
(M M' : RMonad J) : Set (a ⊔ b ⊔ c ⊔ d) where
constructor rmonadmorph
open Cat D
field morph : ∀ {X} → Hom (T M X) (T M' X)
lawη : ∀ {X} → comp morph (η M {X}) ≅ η M' {X}
lawbind : ∀ {X Y}{k : Hom (OMap J X) (T M Y)} →
comp (morph {Y}) (bind M k)
≅
comp (bind M' (comp (morph {Y}) k)) (morph {X})
RMonadMorphEq : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}
{M M' : RMonad J}(α α' : RMonadMorph M M') ->
(λ {X} -> RMonadMorph.morph α {X}) ≅ (λ {X} -> RMonadMorph.morph α' {X}) →
α ≅ α'
RMonadMorphEq (rmonadmorph m lη lbind) (rmonadmorph .m lη' lbind') refl =
cong₂ (rmonadmorph m)
(iext λ _ → hir refl)
(iext λ _ → iext λ _ → iext λ _ → hir refl)
IdRMonadMorph : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}
(M : RMonad J) → RMonadMorph M M
IdRMonadMorph {D = D} M = rmonadmorph
iden
idl
(trans idl (trans (cong (bind M) (sym idl)) (sym idr)))
where open Cat D
CompRMonadMorph : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}
{M M' M'' : RMonad J} →
RMonadMorph M' M'' → RMonadMorph M M' → RMonadMorph M M''
CompRMonadMorph {D = D}{M'' = M''}
(rmonadmorph f lawηf lawbindf)
(rmonadmorph g lawηg lawbindg) =
rmonadmorph
(comp f g)
(trans ass (trans (cong (comp f) lawηg) lawηf))
\ {_ _ k} -> trans
ass
(trans (cong (comp f) lawbindg)
(trans (trans (sym ass)
(cong (λ f → comp f g)
(trans (lawbindf {k = comp g k})
(cong (λ g → comp (bind M'' g) f)
(sym ass)))))
ass))
where open Cat D
idr : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}{M M' : RMonad J}
(f : RMonadMorph M M') → CompRMonadMorph f (IdRMonadMorph _) ≅ f
idr {D = D} f = RMonadMorphEq _ _ (iext λ _ → Cat.idr D)
idl : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}{J : Fun C D}{M M' : RMonad J}
(f : RMonadMorph M M') → CompRMonadMorph (IdRMonadMorph _) f ≅ f
idl {D = D} f = RMonadMorphEq _ _ (iext λ _ → Cat.idl D)
ass : ∀{a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}
{J : Fun C D}{M M' M'' M''' : RMonad J}
(f : RMonadMorph M'' M''')(g : RMonadMorph M' M'')(h : RMonadMorph M M') →
CompRMonadMorph (CompRMonadMorph f g) h
≅
CompRMonadMorph f (CompRMonadMorph g h)
ass {D = D} f g h = RMonadMorphEq _ _ (iext λ _ → Cat.ass D)
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1375.asm | ljhsiun2/medusa | 9 | 170183 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1375.asm
.global s_prepare_buffers
s_prepare_buffers:
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x151c4, %rsi
lea addresses_D_ht+0x1d784, %rdi
nop
nop
nop
nop
nop
dec %rbx
mov $116, %rcx
rep movsq
nop
xor $45006, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rax
push %rbx
push %rdx
// Load
lea addresses_UC+0x14ebc, %rdx
nop
nop
nop
cmp %r15, %r15
mov (%rdx), %r12d
nop
sub $57370, %r11
// Faulty Load
lea addresses_D+0xcd84, %rdx
nop
and $2816, %rbx
movups (%rdx), %xmm7
vpextrq $1, %xmm7, %rax
lea oracles, %r11
and $0xff, %rax
shlq $12, %rax
mov (%r11,%rax,1), %rax
pop %rdx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
programs/oeis/028/A028293.asm | jmorken/loda | 1 | 176275 | ; A028293: Period 7.
; 1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1,3,1,2,1,1,2,1
mov $3,$0
add $0,1
mov $1,$0
mov $0,$3
mul $0,$1
mov $2,$0
add $0,1
mov $1,2
add $2,1
mod $2,7
lpb $0
mov $0,$2
sub $0,1
add $1,1
mul $2,2
sub $2,7
trn $2,2
lpe
sub $1,2
|
example.adb | MicroJoe/ada_menu | 1 | 21298 | <filename>example.adb
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded;
with Menu;
procedure Example is
package SU renames Ada.Strings.Unbounded;
M : Menu.T_Menu;
begin
M.Title := SU.To_Unbounded_String("Do you want to recurse?");
Menu.Add_Item(M, (Symbol => 'y',
Name => SU.To_Unbounded_String("Yes"),
Func => Example'access));
Menu.Add_Item(M, (Symbol => 'n',
Name => SU.To_Unbounded_String("No"),
Func => null));
Menu.Add_Item(M, (Symbol => 'm',
Name => SU.To_Unbounded_String("Maybe"),
Func => null));
Menu.Query(M);
end Example;
|
src/coremac.asm | ronaaron/reva | 9 | 105275 | <reponame>ronaaron/reva<filename>src/coremac.asm
; Linux core:
OS = 2
EOF=4
include 'macros'
format elf
section '.flat' writeable executable
public _start
public start
extrn _dlopen
extrn _dlclose
extrn _dlsym
extrn _malloc
extrn _free
extrn _realloc
macro ccall proc,[arg] ; call CDECL procedure
{ common
local size
size = 0
if ~ arg eq
forward
size = size+4
common
end if
push ebp
mov ebp,esp
sub esp,size
and esp,-16
add esp,size
if ~ arg eq
reverse
pushd arg
common
end if
call proc
leave
}
struc termios {
.iflag rd 1
.oflag rd 1
.cflag rd 1
.lflag rd 1
.line rb 1
rd 1 ; pad
.cc rb 32
.ispeed rd 1
.ospeed rd 1
rd 1
}
struc stat_t {
.dev rd 2 ; + 0
rd 1 ; + 8; pad
.inode rd 1 ; +12
.mode rd 1 ; +16
.nlink rd 1 ; +20
.uid rd 1 ; +24
.gid rd 1 ; +28
.rdev rd 2 ; +32
rd 1 ; +40 pad
.size rd 1 ; +44
.hsize rd 1 ; +48
.blksize rd 1 ; +52
.blocks rd 1 ; +56
.atime rd 1 ; +60
.mtime rd 1 ; +64
.ctime rd 1 ; +68
rd 6 ; -- +100
}
linux_read = 3
linux_write = 4
linux_open = 5
linux_close = 6
linux_creat = 8
linux_unlink=10
linux_seek64=140
linux_fstat64=197
linux_ftruncate=194 ; ftruncate64
linux_rename=38
linux_stat=106
linux_fsync=118
linux_signal=48
linux_sigaction=67
linux_sigsuspend=72
linux_sigpending=73
linux_sigreturn=119
linux_getpid=20
linux_readlink=85
linux_select=82
linux_mprotect=125
SEEK_SET=0
SEEK_CUR=1
SEEK_END=2
SIG_ERR=-1
SIG_DFL=0
SIG_IGN=1
SIGHUP=1
SIGINT=2
SIGQUIT=3
SIGILL=4
SIGTRAP=5
SIGABRT=6
SIGBUS=7
SIGFPE=8
SIGKILL=9
SIGUSR1=10
SIGSEGV=11
SIGUSR2=12
SIGPIPE=13
SIGALRM=14
SIGTERM=15
O_RDONLY = 0
O_WRONLY = 1
O_RDWR = 2
; These macros must be defined prior to the general code:
macro BSS { section ".bss" writeable executable
stat_buf stat_t
in_termios rd 17 ; termios
out_termios rd 17 ; termios
ourpid rd 1
fd_set rd 1 ; for select call in 'iskey'
tv rd 2 ; also
bss_start:
}
SIGNAL_COUNT = 4
macro NONBSS {
procname db '/proc' ; actually includes the / from 'exe', so don't separate them!
exe db '/exe'
align 4
}
struc sigaction sact, m, f {
.sa_sigaction dd sact ; void (*sa_sigaction)(int,siginfo*, void *)
.sa_mask dd m ; sigset_t mask;
.sa_flags dd f ; int flags
.sa_restorer dd 0 ; void (*sa_restorer)(void)
}
; sigcontext structure used in ucontext below
; it contains eip we're going to overwrite when catching signal
struc sigcontext {
.gs rw 1
.__gsh rw 1
.fs rw 1
.__fsh rw 1
.es rw 1
.__esh rw 1
.ds rw 1
.__dsh rw 1
.edi rd 1
.esi rd 1
.ebp rd 1
.esp rd 1
.ebx rd 1
.edx rd 1
.ecx rd 1
.eax rd 1
.trapno rd 1
.err rd 1
.eip rd 1
.cs rw 1
.__csh rw 1
.eflags rd 1
.esp_at_signal rd 1
.ss rw 1
.__ssh rw 1
.fpstate rd 1
.oldmask rd 1
.cr2 rd 1
}
SA_SIGINFO equ 0x00000004 ; use sa_sigaction instead of sa_handler
new_act sigaction reva_sig_handler, 0, SA_SIGINFO
; structure type for 3rd parameter of signal handler
struc ucontext {
.uc_flags rd 1
.uc_link rd 1
.uc_stack rd 1 ; signaltstack
.uc_mcontext sigcontext
.uc_sigmask rd 1 ; sigset_t
}
virtual at 0
ucontext ucontext
end virtual
; OS-specific code is here: ---------------------------------------------
align 4
start: jmp _start
os_start:
; mprotect
; mov ebx, os_start
; mov ecx, blz_workmem
; sub ecx, ebx
; mov edx, 7 ; PROT_EXEC|PROT_READ|PROT_WRITE
; mov eax, linux_mprotect
; int 80h
; mov ebx, esp
; mov ecx, 100000
; mov edx, 7 ; PROT_EXEC|PROT_READ|PROT_WRITE
; mov eax, linux_mprotect
; int 80h
mov dword [StdOut], 1
mov dword [StdIn], 0
; save argc, argv
mov eax, [esp+4]
mov [argc], eax
mov eax, [esp+8]
mov [argv], eax
mov eax, [argc]
; mov eax, [esp+4*eax+12]
; mov [environ], eax
; Now, let's get the pid
mov eax, linux_getpid
int 80h
mov [ourpid], eax
; get our file path.
; first construct the file name.
upsh procname
upsh 6
upsh __pad
call _place
; convert pid to decimal value
upsh [ourpid]
upsh 0
call _printr ; stack contains the string nnnn corresponding to our pid
upsh __pad
call _pplace ; append
upsh exe
upsh 4
upsh __pad
call _pplace ; append
; 'pad' has the proc name corresponding to our EXE. Let's figure out what it is:
upsh __pad
mov ebx, __pad
inc ebx
mov edx, 255
mov ecx, app_file_name
mov eax, linux_readlink
int 80h
cmp eax, -1
jne .readlinkok
; failed reading the link, probably we don't have permission. Assume
; 'argv[0]' has the correct value (woe to us if it doesn't!)
upsh [argv]
call _ztc
inc eax ; include NUL
upsh app_file_name
swap
call _move
.readlinkok:
; set signal handlers
; The args go in ebx, ecx, edx, esi, edi, ebp, in that order.
; (this is from the Linux Assembly HOWTO)
; sigaction(signum, sigaction *act, sigact *oldact)
mov ecx, 12
another:
push ecx
mov ebx, ecx
mov ecx, new_act
xor edx, edx
mov eax, linux_sigaction
int 80h
pop ecx
loop another
; mov esi, [tempX]
; save argc, argv
ret
align 4
reva_sig_handler:
mov ebx, [esp+12] ; ucontext
mov ecx, [esp+4] ; exception
push ebp
mov ebp, esp
push esi
sub esp, 8
mov esi, esp
sub esp, 80
cmp ecx, 2
je .break
push ebx
upsh [ebx+9*4] ; edi
upsh [ebx+10*4] ; esi
upsh [ebx+13*4] ; ebx
upsh [ebx+14*4] ; edx
upsh [ebx+15*4] ; ecx
upsh [ebx+16*4] ; eax
upsh [ebx+11*4] ; ebp
upsh [ebx+12*4] ; esp
upsh [ebx+ (19*4)] ; eip
upsh ecx ; exception
call exception
pop ebx
test eax, eax
jz .fail
mov [ebx+19*4], eax
.fail:
pop esi
mov esp, ebp
pop ebp
ret
.break: call ctrlc_handler
jmp .fail
os_type:
upop edx ;
mov ecx, eax
or edx,edx ; Is the count zero?
jz .done ; If so, we can exit
mov ebx, 1 ; stdout
mov eax, 4 ; sys_write
int 80h ; Linux syscall
.done:
drop
ret
os_emit:
mov ebx, 1 ;stdout
mov edx, ebx ;count
lea ecx, [esp-4]
mov [ecx], eax
mov eax, 4 ;sys_write
int 80h
.done:
drop
ret
align 4
os_key:
dup
sub ebx,ebx ;0 = stdin
mov edx, 1 ;count
push ebx
mov ecx, esp
mov eax, 3
int 80h
dec eax
jz .ok
mov dword [esp], -1
.ok:
pop eax
ret
os_idle:
; invoke Sleep, 0
ret
;os_ekey:
; dup
; push esi
; call non_canonical_input
; call os_key
; push eax
; call term_restore
; pop eax
; pop esi
; ret
TCGETS = 5401h
TCSETS = 5402h
TCSETSW = 5403h
TCSETSF = 5404h
ISIG=1
ICANON=2
XCASE=4
ECHO=10o
ECHOE=20o
ECHOK=40o
ECHONL=100o
NOFLSH=200o
TOSTOP=400o
ECHOCTL=1000o
ECHOPRT=2000o
ECHOKE=4000o
FLUSHNO=10000o
PENDIN=40000o
IEXTEN=100000o
; get terminal state into 'in_termios'
; and also 'out_termios' -- this is the one we play with
;term_save:
; mov eax, 54
; xor ebx, ebx
; mov ecx, TCGETS
; mov edx, out_termios
; int 80h
; mov ecx, TCGETS
; mov edx, in_termios
;term_do:
; mov eax, 54
; xor ebx, ebx
; int 80h
; ret
; restore terminal to original state:
;term_restore:
; mov ecx, TCSETSW
; mov edx, in_termios
; jmp term_do
;non_canonical_input:
; mov edx, out_termios
; mov dword [edx+12], ECHONL
; mov ecx, TCSETSW
; jmp term_do
;;---------------------------------------------------------------------
os_bye:
mov ebx, eax
mov eax, 1 ;1 = sys_exit
int 80h
PROC os_syscall
; syscalls can take a variable number of arguments, from 0 to 6.
; The args go in ebx, ecx, edx, esi, edi, ebp, in that order.
; (this is from the Linux Assembly HOWTO)
; At entry, the Forth stack holds args, argcount, syscall-number
; validate argcount, if > 6 return without changing the stack
mov ecx, [esi] ; ecx = argcount
cmp ecx, 6
ja .ret
lea edi, [esi+4 +4*ecx] ; compute data stack adjustment
push edi ; save it
push eax ; save syscall-number
mov eax, esi ; esi modified when argcount>3
lea ecx, [.6 +4*ecx] ; i.e. .0-4*argcount
jmp ecx
.6: mov ebp, [eax+24] ; 3-bytes instruction
nop ; 1-byte nop padding
.5: mov edi, [eax+20]
nop
.4: mov esi, [eax+16]
nop
.3: mov edx, [eax+12]
nop
.2: mov ecx, [eax+8]
nop
.1: mov ebx, [eax+4]
nop
.0: pop eax ; restore syscall-number
int 80h ; eax = syscall result
pop esi ; restore adjusted data stack
.ret: ret
ENDP os_syscall
; syscall interface ends here
;---------------------------------------------------------------------
; ANS FILE ACCESS WORDS
;---------------------------------------------------------------------
os_ro = O_RDONLY
os_rw = O_RDWR
os_wo = O_WRONLY
; EAX is system call to make
; parms are EBX, ECX, EDX, ESI, EDI
; retval in EAX, negative on failure
; ior is 0 if succeeded.
macro linux { int $80 }
PROC openrw ;( a n -- filied )
mov ecx, os_rw
jmp io_open
ENDP openrw
PROC openr ; ( a n -- fileid )
mov ecx, os_ro
; fall through
; sys_open(filename, flags, mode) --> handle
; ( c-addr u fam -- fileid ior ) \ s" file.txt" r/o open-file
; upop ecx ; flags O_RDONLY etc.
io_open:
push ecx
call _fzt
pop ecx
mov ebx, eax ; filename
; mov edx, 666o
; xor edx, edx ; mode
mov eax, linux_open
call_linux:
linux
call_linux_return: ; convert value in EAX into 'ior'
mov ebx, eax
call_linux_return2: ; convert value in EBX into 'ior'
; ebx<0 --> 1 else 0
test ebx, ebx
js .end
xor ebx, ebx
jmp .end
.end: mov dword [__ior], ebx
test ebx, ebx ; jnz is error
ret
ENDP openr
; ( fileid -- )
PROC io_close
mov ebx, eax
mov eax, linux_close
call_linux2: ; convert value in EAX into 'ior'
linux
upop ebx
jmp call_linux_return2
ENDP io_close
; ( c-addr u -- fileid ior ) \ s" file.txt" r/w create-file
PROC io_create
call _fzt
mov ebx, eax ; filename
mov ecx, 666o
mov edx, 1000o
mov eax, linux_creat
jmp call_linux
ENDP io_create
; ( c-addr u1 fileid -- n ) pad 10 file_desc @ read-file
; sys_read(fd, buf, count)
PROC io_read
push eax ; fileid
drop
mov edx,eax ; count
drop
mov ecx ,eax ; count
pop ebx ; fileid
mov eax, linux_read
jmp call_linux
ENDP io_read
; ( c-addr u fileid -- ior ) pad 10 file_desc @ write-file
PROC io_write
push eax ; fileid
drop
mov edx,eax ; count
drop
mov ecx ,eax ; count
pop ebx ; fileid
mov eax, linux_write
jmp call_linux2
ENDP io_write
; ( c-addr u -- x ior )
;PROC io_status
; call _zt
; push eax
; drop
; pop ebx
; mov ecx, stat_buf
; mov eax, linux_stat
; call call_linux
; upsh dword [stat_buf.mode] ; third element is ior
; swap
; ret
;ENDP io_status
; ( fileid -- ud )
; fstat64(fd, fstat64)
PROC io_size
; dup
mov ebx, eax
mov ecx, stat_buf
mov eax, linux_fstat64
linux
mov eax, dword [stat_buf.size]
; mov [esi], eax
; mov eax, dword [stat_buf.hsize]
ret
ENDP io_size
;---------------------------------------------------------------------
; ANS MEMORY ALLOCATION WORDS
;---------------------------------------------------------------------
; For now I will use the libc routines.
PROC mem_alloc
; push eax
ccall _malloc, eax
; add esp, 4
.0:
mov ebx, eax
sub ebx, ebx
sbb ebx, 0
mov dword [__ior], ebx
;u
;upsh 0
;cmp ebx, 0
;jnz .1
; inc eax
;.1: upop [__ior]
ret
ENDP mem_alloc
; ( a-addr -- )
PROC mem_free
; push eax
ccall _free, eax
; add esp, 4
xor eax, eax
upop dword [__ior]
ret
ENDP mem_free
; ( a-addr u -- a-addr2 )
PROC mem_realloc
mov ebx, eax
; push eax
drop
; push eax
ccall _realloc, eax, ebx
; add esp, 8
jmp mem_alloc.0
ENDP mem_realloc
; ( s n <name> -- )
PROC _loadlib
call _fzt
; load the library:
; push 1 or 0x100 ; RTLD_LAZY | RTLD_GLOBAL
; push eax ; library name
ccall _dlopen, eax, 1 or 0x100
; add esp, 8
ret
ENDP _loadlib
PROC _unloadlib
test eax, eax
jz .done
; push eax ; library handle
ccall _dlclose, eax
; add esp, 4
.done:
drop
ret
ENDP _unloadlib
; ( s n lib -- handle )
PROC _osfunc
upop ebx ; EBX is handle
lodsd ; drop count, EAX is function name
; push esi
; push eax ; symbol
; push ebx ; libhandle
ccall _dlsym, ebx, eax, esi
;add esp, 8
pop esi
ret
ENDP _osfunc
_makeexe:
; chmod = oscall 15
mov ecx, 448
mov ebx, eax
mov eax, 15
linux
drop
ret
;---------------------------------------------------------------------
; General code goes here: ---------------------------------------------
include "revacore.asm"
; Our BSS: ---------------------------------------------
|
source/tasking/a-sytaco.ads | ytomino/drake | 33 | 5941 | <reponame>ytomino/drake<gh_stars>10-100
pragma License (Unrestricted);
private with Ada.Finalization;
private with System.Storage_Barriers;
private with System.Synchronous_Objects;
package Ada.Synchronous_Task_Control is
pragma Preelaborate;
type Suspension_Object is limited private;
procedure Set_True (S : in out Suspension_Object);
procedure Set_False (S : in out Suspension_Object);
function Current_State (S : Suspension_Object) return Boolean;
-- modified
procedure Suspend_Until_True (
S : in out Suspension_Object;
Multi : Boolean := False); -- additional
pragma Inline (Current_State);
private
type Suspension_Object is
limited new Finalization.Limited_Controlled with
record
Object : System.Synchronous_Objects.Event;
Waiting : aliased System.Storage_Barriers.Flag; -- for CXDA002
end record;
overriding procedure Initialize (Object : in out Suspension_Object);
overriding procedure Finalize (Object : in out Suspension_Object);
end Ada.Synchronous_Task_Control;
|
ada_gui-gnoga-colors.adb | jrcarter/Ada_GUI | 19 | 14919 | <gh_stars>10-100
-- Ada_GUI implementation based on Gnoga. Adapted 2021
-- --
-- GNOGA - The GNU Omnificent GUI for Ada --
-- --
-- G N O G A . T Y P E S . C O L O R S --
-- --
-- B o d y --
-- --
-- --
-- Copyright (C) 2015 <NAME> --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, 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. --
-- --
-- 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/>. --
-- --
-- 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. --
-- --
-- For more information please go to http://www.gnoga.com --
------------------------------------------------------------------------------
with Ada.Exceptions;
package body Ada_GUI.Gnoga.Colors is
-- Based on CSS extended color keywords
-- http://dev.w3.org/csswg/css-color-3/ §4.3
type CSS_Color_Enumeration is
(aliceblue,
antiquewhite,
aqua,
aquamarine,
azure,
beige,
bisque,
black,
blanchedalmond,
blue,
blueviolet,
brown,
burlywood,
cadetblue,
chartreuse,
chocolate,
coral,
cornflowerblue,
cornsilk,
crimson,
cyan,
darkblue,
darkcyan,
darkgoldenrod,
darkgray,
darkgreen,
darkgrey,
darkkhaki,
darkmagenta,
darkolivegreen,
darkorange,
darkorchid,
darkred,
darksalmon,
darkseagreen,
darkslateblue,
darkslategray,
darkslategrey,
darkturquoise,
darkviolet,
deeppink,
deepskyblue,
dimgray,
dimgrey,
dodgerblue,
firebrick,
floralwhite,
forestgreen,
fuchsia,
gainsboro,
ghostwhite,
gold,
goldenrod,
gray,
green,
greenyellow,
grey,
honeydew,
hotpink,
indianred,
indigo,
ivory,
khaki,
lavender,
lavenderblush,
lawngreen,
lemonchiffon,
lightblue,
lightcoral,
lightcyan,
lightgoldenrodyellow,
lightgray,
lightgreen,
lightgrey,
lightpink,
lightsalmon,
lightseagreen,
lightskyblue,
lightslategray,
lightslategrey,
lightsteelblue,
lightyellow,
lime,
limegreen,
linen,
magenta,
maroon,
mediumaquamarine,
mediumblue,
mediumorchid,
mediumpurple,
mediumseagreen,
mediumslateblue,
mediumspringgreen,
mediumturquoise,
mediumvioletred,
midnightblue,
mintcream,
mistyrose,
moccasin,
navajowhite,
navy,
oldlace,
olive,
olivedrab,
orange,
orangered,
orchid,
palegoldenrod,
palegreen,
paleturquoise,
palevioletred,
papayawhip,
peachpuff,
peru,
pink,
plum,
powderblue,
purple,
red,
rosybrown,
royalblue,
saddlebrown,
salmon,
sandybrown,
seagreen,
seashell,
sienna,
silver,
skyblue,
slateblue,
slategray,
slategrey,
snow,
springgreen,
steelblue,
tan,
teal,
thistle,
tomato,
turquoise,
violet,
wheat,
white,
whitesmoke,
yellow,
yellowgreen);
type Color_Array_Type is array (Color_Enumeration) of Gnoga.RGBA_Type;
RGBA_Colors : constant Color_Array_Type :=
((240, 248, 255, 1.0), -- Alice_Blue
(250, 235, 215, 1.0), -- Antique_White
(0, 255, 255, 1.0), -- Aqua
(127, 255, 212, 1.0), -- Aquamarine
(240, 255, 255, 1.0), -- Azure
(245, 245, 220, 1.0), -- Beige
(255, 228, 196, 1.0), -- Bisque
(0, 0, 0, 1.0), -- Black
(255, 235, 205, 1.0), -- Blanched_Almond
(0, 0, 255, 1.0), -- Blue
(138, 43, 226, 1.0), -- Blue_Violet
(165, 42, 42, 1.0), -- Brown
(222, 184, 135, 1.0), -- Burly_Wood
(95, 158, 160, 1.0), -- Cadet_Blue
(127, 255, 0, 1.0), -- Chartreuse
(210, 105, 30, 1.0), -- Chocolate
(255, 127, 80, 1.0), -- Coral
(100, 149, 237, 1.0), -- Cornflower_Blue
(255, 248, 220, 1.0), -- Cornsilk
(220, 20, 60, 1.0), -- Crimson
(0, 255, 255, 1.0), -- Cyan
(0, 0, 139, 1.0), -- Dark_Blue
(0, 139, 139, 1.0), -- Dark_Cyan
(184, 134, 11, 1.0), -- Dark_Golden_Rod
(169, 169, 169, 1.0), -- Dark_Gray
(0, 100, 0, 1.0), -- Dark_Green
(169, 169, 169, 1.0), -- Dark_Grey
(189, 183, 107, 1.0), -- Dark_Khaki
(139, 0, 139, 1.0), -- Dark_Magenta
(85, 107, 47, 1.0), -- Dark_Olive_Green
(255, 140, 0, 1.0), -- Dark_Orange
(153, 50, 204, 1.0), -- Dark_Orchid
(139, 0, 0, 1.0), -- Dark_Red
(233, 150, 122, 1.0), -- Dark_Salmon
(143, 188, 143, 1.0), -- Dark_Sea_Green
(72, 61, 139, 1.0), -- Dark_Slate_Blue
(47, 79, 79, 1.0), -- Dark_Slate_Gray
(47, 79, 79, 1.0), -- Dark_Slate_Grey
(0, 206, 209, 1.0), -- Dark_Turquoise
(148, 0, 211, 1.0), -- Dark_Violet
(255, 20, 147, 1.0), -- DeepPink
(0, 191, 255, 1.0), -- Deep_Sky_Blue
(105, 105, 105, 1.0), -- Dim_Gray
(105, 105, 105, 1.0), -- Dim_Grey
(30, 144, 255, 1.0), -- Dodger_Blue
(178, 34, 34, 1.0), -- Fire_Brick
(255, 250, 240, 1.0), -- Floral_White
(34, 139, 34, 1.0), -- Forest_Green
(255, 0, 255, 1.0), -- Fuchsia
(220, 220, 220, 1.0), -- Gainsboro
(248, 248, 255, 1.0), -- Ghost_White
(255, 215, 0, 1.0), -- Gold_Deep_Sky_Blue
(218, 165, 32, 1.0), -- Golden_Rod
(128, 128, 128, 1.0), -- Gray
(0, 128, 0, 1.0), -- Green
(173, 255, 47, 1.0), -- Green_Yellow
(128, 128, 128, 1.0), -- Grey
(240, 255, 240, 1.0), -- Honey_Dew
(255, 105, 180, 1.0), -- Hot_Pink
(205, 92, 92, 1.0), -- Indian_Red
(75, 0, 130, 1.0), -- Indigo
(255, 255, 240, 1.0), -- Ivory
(240, 230, 140, 1.0), -- Khaki
(230, 230, 250, 1.0), -- Lavender
(255, 240, 245, 1.0), -- Lavender_Blush
(124, 252, 0, 1.0), -- Lawn_Green
(255, 250, 205, 1.0), -- Lemon_Chiffon
(173, 216, 230, 1.0), -- Light_Blue
(240, 128, 128, 1.0), -- Light_Coral
(224, 255, 255, 1.0), -- Light_Cyan
(250, 250, 210, 1.0), -- Light_Golden_Rod_Yellow
(211, 211, 211, 1.0), -- Light_Gray
(144, 238, 144, 1.0), -- Light_Green
(211, 211, 211, 1.0), -- Light_Grey
(255, 182, 193, 1.0), -- Light_Pink
(255, 160, 122, 1.0), -- Light_Salmon
(32, 178, 170, 1.0), -- Light_Sea_Green
(135, 206, 250, 1.0), -- Light_Sky_Blue
(119, 136, 153, 1.0), -- Light_Slate_Gray
(119, 136, 153, 1.0), -- Light_Slate_Grey
(176, 196, 222, 1.0), -- Light_Steel_Blue
(255, 255, 224, 1.0), -- Light_Yellow
(0, 255, 0, 1.0), -- Lime
(50, 205, 50, 1.0), -- Lime_Green
(250, 240, 230, 1.0), -- Linen
(255, 0, 255, 1.0), -- Magenta
(128, 0, 0, 1.0), -- Maroon
(102, 205, 170, 1.0), -- Medium_Aqua_Marine
(0, 0, 205, 1.0), -- Medium_Blue
(186, 85, 211, 1.0), -- Medium_Orchid
(147, 112, 219, 1.0), -- Medium_Purple
(60, 179, 113, 1.0), -- Medium_Sea_Green
(123, 104, 238, 1.0), -- Medium_Slate_Blue
(0, 250, 154, 1.0), -- Medium_Spring_Green
(72, 209, 204, 1.0), -- Medium_Turquoise
(199, 21, 133, 1.0), -- Medium_Violet_Red
(25, 25, 112, 1.0), -- Midnight_Blue
(245, 255, 250, 1.0), -- Mint_Cream
(255, 228, 225, 1.0), -- Misty_Rose
(255, 228, 181, 1.0), -- Moccasin
(255, 222, 173, 1.0), -- Navajo_White
(0, 0, 128, 1.0), -- Navy
(253, 245, 230, 1.0), -- Old_Lace
(128, 128, 0, 1.0), -- Olive
(107, 142, 35, 1.0), -- Olive_Drab
(255, 165, 0, 1.0), -- Orange
(255, 69, 0, 1.0), -- Orange_Red
(218, 112, 214, 1.0), -- Orchid
(238, 232, 170, 1.0), -- Pale_Golden_Rod
(152, 251, 152, 1.0), -- Pale_Green
(175, 238, 238, 1.0), -- Pale_Turquoise
(219, 112, 147, 1.0), -- Pale_Violet_Red
(255, 239, 213, 1.0), -- Papaya_Whip
(255, 218, 185, 1.0), -- Peach_Puff
(205, 133, 63, 1.0), -- Peru
(255, 192, 203, 1.0), -- Pink
(221, 160, 221, 1.0), -- Plum
(176, 224, 230, 1.0), -- Powder_Blue
(128, 0, 128, 1.0), -- Purple
(255, 0, 0, 1.0), -- Red
(188, 143, 143, 1.0), -- Rosy_Brown
(65, 105, 225, 1.0), -- Royal_Blue
(139, 69, 19, 1.0), -- Saddle_Brown
(250, 128, 114, 1.0), -- Salmon
(244, 164, 96, 1.0), -- Sandy_Brown
(46, 139, 87, 1.0), -- Sea_Green
(255, 245, 238, 1.0), -- Sea_Shell
(160, 82, 45, 1.0), -- Sienna
(192, 192, 192, 1.0), -- Silver
(135, 206, 235, 1.0), -- Sky_Blue
(106, 90, 205, 1.0), -- Slate_Blue
(112, 128, 144, 1.0), -- Slate_Gray
(112, 128, 144, 1.0), -- Slate_Grey
(255, 250, 250, 1.0), -- Snow
(0, 255, 127, 1.0), -- Spring_Green
(70, 130, 180, 1.0), -- Steel_Blue
(210, 180, 140, 1.0), -- Tan
(0, 128, 128, 1.0), -- Teal
(216, 191, 216, 1.0), -- Thistle
(255, 99, 71, 1.0), -- Tomato
(64, 224, 208, 1.0), -- Turquoise
(238, 130, 238, 1.0), -- Violet
(245, 222, 179, 1.0), -- Wheat
(255, 255, 255, 1.0), -- White
(245, 245, 245, 1.0), -- White_Smoke
(255, 255, 0, 1.0), -- Yellow
(154, 205, 50, 1.0)); -- Yellow_Green
---------------
-- To_String --
---------------
function To_String (Value : Color_Enumeration) return String is
begin
return CSS_Color_Enumeration'Image
(CSS_Color_Enumeration'Val (Color_Enumeration'Pos (Value)));
end To_String;
-------------
-- To_RGBA --
-------------
function To_RGBA (Value : Color_Enumeration) return Gnoga.RGBA_Type is
begin
return RGBA_Colors (Value);
end To_RGBA;
--------------------------
-- To_Color_Enumeration --
--------------------------
function To_Color_Enumeration
(Value : Gnoga.RGBA_Type) return Color_Enumeration
is
begin
for C in RGBA_Colors'Range loop
if Value = RGBA_Colors (C) then
return C;
end if;
end loop;
raise Color_Error;
end To_Color_Enumeration;
--------------------------
-- To_Color_Enumeration --
--------------------------
function To_Color_Enumeration (Value : String) return Color_Enumeration is
begin
return Color_Enumeration'Val (CSS_Color_Enumeration'Pos
(CSS_Color_Enumeration'Value (Value)));
exception
when E : Constraint_Error =>
Log ("Error converting to Color_Enumeration from " & Value);
Log (Ada.Exceptions.Exception_Information (E));
raise Color_Error;
end To_Color_Enumeration;
end Ada_GUI.Gnoga.Colors;
|
simd/x86_64/jdmrgext-sse2.asm | t-head-aosp/platform-external-libjpeg-turbo | 3,597 | 240591 | <gh_stars>1000+
;
; jdmrgext.asm - merged upsampling/color conversion (64-bit SSE2)
;
; Copyright 2009, 2012 <NAME> <<EMAIL>> for Cendio AB
; Copyright (C) 2009, 2012, 2016, <NAME>.
; Copyright (C) 2018, <NAME>.
;
; Based on the x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
%include "jcolsamp.inc"
; --------------------------------------------------------------------------
;
; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
;
; GLOBAL(void)
; jsimd_h2v1_merged_upsample_sse2(JDIMENSION output_width,
; JSAMPIMAGE input_buf,
; JDIMENSION in_row_group_ctr,
; JSAMPARRAY output_buf);
;
; r10d = JDIMENSION output_width
; r11 = JSAMPIMAGE input_buf
; r12d = JDIMENSION in_row_group_ctr
; r13 = JSAMPARRAY output_buf
%define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
%define WK_NUM 3
align 32
GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_sse2)
EXTN(jsimd_h2v1_merged_upsample_sse2):
push rbp
mov rax, rsp ; rax = original rbp
sub rsp, byte 4
and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
mov [rsp], rax
mov rbp, rsp ; rbp = aligned rbp
lea rsp, [wk(0)]
collect_args 4
push rbx
mov ecx, r10d ; col
test rcx, rcx
jz near .return
push rcx
mov rdi, r11
mov ecx, r12d
mov rsip, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]
mov rdi, r13
mov rsip, JSAMPROW [rsi+rcx*SIZEOF_JSAMPROW] ; inptr0
mov rbxp, JSAMPROW [rbx+rcx*SIZEOF_JSAMPROW] ; inptr1
mov rdxp, JSAMPROW [rdx+rcx*SIZEOF_JSAMPROW] ; inptr2
mov rdip, JSAMPROW [rdi] ; outptr
pop rcx ; col
.columnloop:
movdqa xmm6, XMMWORD [rbx] ; xmm6=Cb(0123456789ABCDEF)
movdqa xmm7, XMMWORD [rdx] ; xmm7=Cr(0123456789ABCDEF)
pxor xmm1, xmm1 ; xmm1=(all 0's)
pcmpeqw xmm3, xmm3
psllw xmm3, 7 ; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}
movdqa xmm4, xmm6
punpckhbw xmm6, xmm1 ; xmm6=Cb(89ABCDEF)=CbH
punpcklbw xmm4, xmm1 ; xmm4=Cb(01234567)=CbL
movdqa xmm0, xmm7
punpckhbw xmm7, xmm1 ; xmm7=Cr(89ABCDEF)=CrH
punpcklbw xmm0, xmm1 ; xmm0=Cr(01234567)=CrL
paddw xmm6, xmm3
paddw xmm4, xmm3
paddw xmm7, xmm3
paddw xmm0, xmm3
; (Original)
; R = Y + 1.40200 * Cr
; G = Y - 0.34414 * Cb - 0.71414 * Cr
; B = Y + 1.77200 * Cb
;
; (This implementation)
; R = Y + 0.40200 * Cr + Cr
; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr
; B = Y - 0.22800 * Cb + Cb + Cb
movdqa xmm5, xmm6 ; xmm5=CbH
movdqa xmm2, xmm4 ; xmm2=CbL
paddw xmm6, xmm6 ; xmm6=2*CbH
paddw xmm4, xmm4 ; xmm4=2*CbL
movdqa xmm1, xmm7 ; xmm1=CrH
movdqa xmm3, xmm0 ; xmm3=CrL
paddw xmm7, xmm7 ; xmm7=2*CrH
paddw xmm0, xmm0 ; xmm0=2*CrL
pmulhw xmm6, [rel PW_MF0228] ; xmm6=(2*CbH * -FIX(0.22800))
pmulhw xmm4, [rel PW_MF0228] ; xmm4=(2*CbL * -FIX(0.22800))
pmulhw xmm7, [rel PW_F0402] ; xmm7=(2*CrH * FIX(0.40200))
pmulhw xmm0, [rel PW_F0402] ; xmm0=(2*CrL * FIX(0.40200))
paddw xmm6, [rel PW_ONE]
paddw xmm4, [rel PW_ONE]
psraw xmm6, 1 ; xmm6=(CbH * -FIX(0.22800))
psraw xmm4, 1 ; xmm4=(CbL * -FIX(0.22800))
paddw xmm7, [rel PW_ONE]
paddw xmm0, [rel PW_ONE]
psraw xmm7, 1 ; xmm7=(CrH * FIX(0.40200))
psraw xmm0, 1 ; xmm0=(CrL * FIX(0.40200))
paddw xmm6, xmm5
paddw xmm4, xmm2
paddw xmm6, xmm5 ; xmm6=(CbH * FIX(1.77200))=(B-Y)H
paddw xmm4, xmm2 ; xmm4=(CbL * FIX(1.77200))=(B-Y)L
paddw xmm7, xmm1 ; xmm7=(CrH * FIX(1.40200))=(R-Y)H
paddw xmm0, xmm3 ; xmm0=(CrL * FIX(1.40200))=(R-Y)L
movdqa XMMWORD [wk(0)], xmm6 ; wk(0)=(B-Y)H
movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=(R-Y)H
movdqa xmm6, xmm5
movdqa xmm7, xmm2
punpcklwd xmm5, xmm1
punpckhwd xmm6, xmm1
pmaddwd xmm5, [rel PW_MF0344_F0285]
pmaddwd xmm6, [rel PW_MF0344_F0285]
punpcklwd xmm2, xmm3
punpckhwd xmm7, xmm3
pmaddwd xmm2, [rel PW_MF0344_F0285]
pmaddwd xmm7, [rel PW_MF0344_F0285]
paddd xmm5, [rel PD_ONEHALF]
paddd xmm6, [rel PD_ONEHALF]
psrad xmm5, SCALEBITS
psrad xmm6, SCALEBITS
paddd xmm2, [rel PD_ONEHALF]
paddd xmm7, [rel PD_ONEHALF]
psrad xmm2, SCALEBITS
psrad xmm7, SCALEBITS
packssdw xmm5, xmm6 ; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)
packssdw xmm2, xmm7 ; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)
psubw xmm5, xmm1 ; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H
psubw xmm2, xmm3 ; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L
movdqa XMMWORD [wk(2)], xmm5 ; wk(2)=(G-Y)H
mov al, 2 ; Yctr
jmp short .Yloop_1st
.Yloop_2nd:
movdqa xmm0, XMMWORD [wk(1)] ; xmm0=(R-Y)H
movdqa xmm2, XMMWORD [wk(2)] ; xmm2=(G-Y)H
movdqa xmm4, XMMWORD [wk(0)] ; xmm4=(B-Y)H
.Yloop_1st:
movdqa xmm7, XMMWORD [rsi] ; xmm7=Y(0123456789ABCDEF)
pcmpeqw xmm6, xmm6
psrlw xmm6, BYTE_BIT ; xmm6={0xFF 0x00 0xFF 0x00 ..}
pand xmm6, xmm7 ; xmm6=Y(02468ACE)=YE
psrlw xmm7, BYTE_BIT ; xmm7=Y(13579BDF)=YO
movdqa xmm1, xmm0 ; xmm1=xmm0=(R-Y)(L/H)
movdqa xmm3, xmm2 ; xmm3=xmm2=(G-Y)(L/H)
movdqa xmm5, xmm4 ; xmm5=xmm4=(B-Y)(L/H)
paddw xmm0, xmm6 ; xmm0=((R-Y)+YE)=RE=R(02468ACE)
paddw xmm1, xmm7 ; xmm1=((R-Y)+YO)=RO=R(13579BDF)
packuswb xmm0, xmm0 ; xmm0=R(02468ACE********)
packuswb xmm1, xmm1 ; xmm1=R(13579BDF********)
paddw xmm2, xmm6 ; xmm2=((G-Y)+YE)=GE=G(02468ACE)
paddw xmm3, xmm7 ; xmm3=((G-Y)+YO)=GO=G(13579BDF)
packuswb xmm2, xmm2 ; xmm2=G(02468ACE********)
packuswb xmm3, xmm3 ; xmm3=G(13579BDF********)
paddw xmm4, xmm6 ; xmm4=((B-Y)+YE)=BE=B(02468ACE)
paddw xmm5, xmm7 ; xmm5=((B-Y)+YO)=BO=B(13579BDF)
packuswb xmm4, xmm4 ; xmm4=B(02468ACE********)
packuswb xmm5, xmm5 ; xmm5=B(13579BDF********)
%if RGB_PIXELSIZE == 3 ; ---------------
; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)
; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)
; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)
; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)
punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)
punpcklbw xmmE, xmmB ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)
punpcklbw xmmD, xmmF ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)
movdqa xmmG, xmmA
movdqa xmmH, xmmA
punpcklwd xmmA, xmmE ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)
punpckhwd xmmG, xmmE ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)
psrldq xmmH, 2 ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)
psrldq xmmE, 2 ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)
movdqa xmmC, xmmD
movdqa xmmB, xmmD
punpcklwd xmmD, xmmH ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)
punpckhwd xmmC, xmmH ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)
psrldq xmmB, 2 ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)
movdqa xmmF, xmmE
punpcklwd xmmE, xmmB ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)
punpckhwd xmmF, xmmB ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)
pshufd xmmH, xmmA, 0x4E ; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)
movdqa xmmB, xmmE
punpckldq xmmA, xmmD ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)
punpckldq xmmE, xmmH ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)
punpckhdq xmmD, xmmB ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)
pshufd xmmH, xmmG, 0x4E ; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)
movdqa xmmB, xmmF
punpckldq xmmG, xmmC ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)
punpckldq xmmF, xmmH ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)
punpckhdq xmmC, xmmB ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)
punpcklqdq xmmA, xmmE ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)
punpcklqdq xmmD, xmmG ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)
punpcklqdq xmmF, xmmC ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st32
test rdi, SIZEOF_XMMWORD-1
jnz short .out1
; --(aligned)-------------------
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
jmp short .out0
.out1: ; --(unaligned)-----------------
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
add rsi, byte SIZEOF_XMMWORD ; inptr0
dec al ; Yctr
jnz near .Yloop_2nd
add rbx, byte SIZEOF_XMMWORD ; inptr1
add rdx, byte SIZEOF_XMMWORD ; inptr2
jmp near .columnloop
.column_st32:
lea rcx, [rcx+rcx*2] ; imul ecx, RGB_PIXELSIZE
cmp rcx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmF
sub rcx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st15
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD
sub rcx, byte SIZEOF_XMMWORD
.column_st15:
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_MMWORD
jb short .column_st7
movq XMM_MMWORD [rdi], xmmA
add rdi, byte SIZEOF_MMWORD
sub rcx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_DWORD
jb short .column_st3
movd XMM_DWORD [rdi], xmmA
add rdi, byte SIZEOF_DWORD
sub rcx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of rax to the output when it has enough
; space.
movd eax, xmmA
cmp rcx, byte SIZEOF_WORD
jb short .column_st1
mov word [rdi], ax
add rdi, byte SIZEOF_WORD
sub rcx, byte SIZEOF_WORD
shr rax, 16
.column_st1:
; Store the lower 1 byte of rax to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
mov byte [rdi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
%ifdef RGBX_FILLER_0XFF
pcmpeqb xmm6, xmm6 ; xmm6=XE=X(02468ACE********)
pcmpeqb xmm7, xmm7 ; xmm7=XO=X(13579BDF********)
%else
pxor xmm6, xmm6 ; xmm6=XE=X(02468ACE********)
pxor xmm7, xmm7 ; xmm7=XO=X(13579BDF********)
%endif
; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)
; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)
; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)
; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)
punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)
punpcklbw xmmE, xmmG ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)
punpcklbw xmmB, xmmD ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)
punpcklbw xmmF, xmmH ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)
movdqa xmmC, xmmA
punpcklwd xmmA, xmmE ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)
punpckhwd xmmC, xmmE ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)
movdqa xmmG, xmmB
punpcklwd xmmB, xmmF ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)
punpckhwd xmmG, xmmF ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)
movdqa xmmD, xmmA
punpckldq xmmA, xmmB ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)
punpckhdq xmmD, xmmB ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)
movdqa xmmH, xmmC
punpckldq xmmC, xmmG ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)
punpckhdq xmmH, xmmG ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st32
test rdi, SIZEOF_XMMWORD-1
jnz short .out1
; --(aligned)-------------------
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
jmp short .out0
.out1: ; --(unaligned)-----------------
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
add rsi, byte SIZEOF_XMMWORD ; inptr0
dec al ; Yctr
jnz near .Yloop_2nd
add rbx, byte SIZEOF_XMMWORD ; inptr1
add rdx, byte SIZEOF_XMMWORD ; inptr2
jmp near .columnloop
.column_st32:
cmp rcx, byte SIZEOF_XMMWORD/2
jb short .column_st16
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmC
movdqa xmmD, xmmH
sub rcx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD/4
jb short .column_st15
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA, xmmD
sub rcx, byte SIZEOF_XMMWORD/4
.column_st15:
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq XMM_MMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD/8*4
sub rcx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
movd XMM_DWORD [rdi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------
.endcolumn:
sfence ; flush the write buffer
.return:
pop rbx
uncollect_args 4
mov rsp, rbp ; rsp <- aligned rbp
pop rsp ; rsp <- original rbp
pop rbp
ret
; --------------------------------------------------------------------------
;
; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
;
; GLOBAL(void)
; jsimd_h2v2_merged_upsample_sse2(JDIMENSION output_width,
; JSAMPIMAGE input_buf,
; JDIMENSION in_row_group_ctr,
; JSAMPARRAY output_buf);
;
; r10d = JDIMENSION output_width
; r11 = JSAMPIMAGE input_buf
; r12d = JDIMENSION in_row_group_ctr
; r13 = JSAMPARRAY output_buf
align 32
GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_sse2)
EXTN(jsimd_h2v2_merged_upsample_sse2):
push rbp
mov rax, rsp
mov rbp, rsp
collect_args 4
push rbx
mov eax, r10d
mov rdi, r11
mov ecx, r12d
mov rsip, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]
mov rdi, r13
lea rsi, [rsi+rcx*SIZEOF_JSAMPROW]
sub rsp, SIZEOF_JSAMPARRAY*4
mov JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY], rsip ; intpr00
mov JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY], rbxp ; intpr1
mov JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY], rdxp ; intpr2
mov rbx, rsp
push rdi
push rcx
push rax
%ifdef WIN64
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi
mov rdi, rax
mov rsi, rbx
%endif
call EXTN(jsimd_h2v1_merged_upsample_sse2)
pop rax
pop rcx
pop rdi
mov rsip, JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY]
add rdi, byte SIZEOF_JSAMPROW ; outptr1
add rsi, byte SIZEOF_JSAMPROW ; inptr01
mov JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY], rsip ; intpr00
mov JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY], rbxp ; intpr1
mov JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY], rdxp ; intpr2
mov rbx, rsp
push rdi
push rcx
push rax
%ifdef WIN64
mov r8, rcx
mov r9, rdi
mov rcx, rax
mov rdx, rbx
%else
mov rdx, rcx
mov rcx, rdi
mov rdi, rax
mov rsi, rbx
%endif
call EXTN(jsimd_h2v1_merged_upsample_sse2)
pop rax
pop rcx
pop rdi
mov rsip, JSAMPARRAY [rsp+0*SIZEOF_JSAMPARRAY]
mov rbxp, JSAMPARRAY [rsp+1*SIZEOF_JSAMPARRAY]
mov rdxp, JSAMPARRAY [rsp+2*SIZEOF_JSAMPARRAY]
add rsp, SIZEOF_JSAMPARRAY*4
pop rbx
uncollect_args 4
pop rbp
ret
; For some reason, the OS X linker does not honor the request to align the
; segment unless we do this.
align 32
|
ffight/lcs/container/36.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 22010 | copyright zengfr site:http://github.com/zengfr/romhack
003A02 movem.l D0-D3, -(A6)
003A06 movem.l D0-D3, -(A6)
00621C move.b ($a,A3), ($36,A4) [boss+14, container+14, enemy+14]
006222 move.b ($b,A3), ($62,A4) [boss+36, container+36, enemy+36]
009ACA dbra D5, $9ac8
0517D4 move.b ($3e,A6), ($36,A6)
0517DA move.l #$4000000, ($2,A6)
05248C move.b ($3e,A6), ($36,A6)
052492 move.l #$4000000, ($2,A6)
05270A move.b ($3e,A6), ($36,A6)
052710 move.l #$4000000, ($2,A6)
0529A4 move.b ($3e,A6), ($36,A6)
0529AA move.l #$4000000, ($2,A6)
052D54 move.l #$4000000, ($2,A6)
copyright zengfr site:http://github.com/zengfr/romhack
|
Task/Horizontal-sundial-calculations/Ada/horizontal-sundial-calculations.ada | LaudateCorpus1/RosettaCodeData | 1 | 13912 | <reponame>LaudateCorpus1/RosettaCodeData
with Ada.Text_IO;
with Ada.Numerics.Elementary_Functions;
procedure Sundial is
use Ada.Numerics.Elementary_Functions;
use Ada.Numerics;
package Float_IO is new Ada.Text_IO.Float_IO (Float);
Latitude, Longitude, Meridian : Float;
Latitude_Sine : Float;
begin
Ada.Text_IO.Put ("Enter latitude: ");
Float_IO.Get (Latitude);
Ada.Text_IO.Put ("Enter longitude: ");
Float_IO.Get (Longitude);
Ada.Text_IO.Put ("Enter legal meridian: ");
Float_IO.Get (Meridian);
Ada.Text_IO.New_Line;
Latitude_Sine := Sin (Latitude * Pi / 180.0);
Ada.Text_IO.Put_Line
(" sine of latitude:" & Float'Image (Latitude_Sine));
Ada.Text_IO.Put_Line
(" diff longitude:" & Float'Image (Longitude - Meridian));
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
("hour, sun hour angle, dial hour line angle from 6am to 6pm");
for H in -6 .. 6 loop
declare
Hour_Angle : constant Float :=
15.0 * Float (H) - (Longitude - Meridian);
Line_Angle : constant Float :=
Arctan (Latitude_Sine * Tan (Hour_Angle * Pi / 180.0)) * 180.0 /
Pi;
begin
Ada.Text_IO.Put_Line
("HR=" &
Integer'Image (H) &
"; HRA=" &
Float'Image (Hour_Angle) &
"; HLA=" &
Float'Image (Line_Angle));
end;
end loop;
end Sundial;
|
test/arch/Timer.asm | yunxu1019/efront | 1 | 543 | <filename>test/arch/Timer.asm
.386
.model flat,stdcall
option casemap:none
__UNICODE__ equ 1
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
ID_TIMER1 equ 1
ID_TIMER2 equ 2
ICO_1 equ 1
ICO_2 equ 2
DLG_MAIN equ 1
IDC_SECTION equ 100
IDC_COUNT equ 101
.data?
hInstance dd ?
hWinMain dd ?
dwCount dd ?
idTimer dd ?
.code
_ProcTimer proc _hWnd,uMsg,_idEvent,_dwTime
pushad
invoke GetDlgItemInt,hWinMain,IDC_COUNT,NULL,FALSE
inc eax
invoke SetDlgItemInt,hWinMain,IDC_COUNT,eax,FALSE
popad
ret
_ProcTimer endp
_ProcDlgMain proc uses ebx edi esi,hWnd,uMsg,wParam,lParam
mov eax,uMsg
.if eax== WM_TIMER
mov eax,wParam
.if eax==ID_TIMER1
inc dwCount
mov eax,dwCount
and eax,1
inc eax
invoke LoadIcon,hInstance,eax
invoke SendDlgItemMessage,hWnd,\
IDC_SECTION,STM_SETIMAGE,\
IMAGE_ICON,eax
.elseif eax == ID_TIMER2
invoke MessageBeep,-1
.endif
.elseif eax== WM_INITDIALOG
push hWnd
pop hWinMain
invoke SetTimer,hWnd,ID_TIMER1,250,NULL
invoke SetTimer,hWnd,ID_TIMER2,2000,NULL
invoke SetTimer,NULL,NULL,1000,addr _ProcTimer
mov idTimer,eax
.elseif eax==WM_CLOSE
invoke KillTimer,hWnd,ID_TIMER1
invoke KillTimer,hWnd,ID_TIMER2
invoke KillTimer,NULL,idTimer
invoke EndDialog,hWnd,NULL
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,DLG_MAIN,\
NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
end start
|
src/main/antlr/LA.g4 | explodingnuggets/LA-Lang | 0 | 3913 | <gh_stars>0
grammar LA;
@header {
package org.lalang;
}
// REGRAS SINTÁTICAS
programa
: declaracoes 'algoritmo' corpo 'fim_algoritmo';
declaracoes
: (decl_local_global)*
;
decl_local_global
: declaracao_local
| declaracao_global
;
declaracao_local
: 'declare' variavel # declVariavel
| 'constante' IDENT ':' tipo_basico '=' valor_constante # declConstante
| 'tipo' IDENT ':' tipo # declTipo
;
variavel
: first=identificador (',' rest+=identificador)* ':' tipo;
identificador
: first=IDENT ('.' rest+=IDENT)* dimensao;
dimensao
: ('[' exp_aritmetica ']')*;
tipo
: registro | tipo_estendido;
tipo_basico
: 'literal' | 'inteiro' | 'real' | 'logico';
tipo_basico_ident
: tipo_basico | IDENT;
tipo_estendido
: (pointer='^')? tipo_basico_ident;
valor_constante
: CADEIA | NUM_INT | NUM_REAL | 'verdadeiro' | 'falso';
registro
: 'registro' (variavel)* 'fim_registro';
declaracao_global
: 'procedimento' IDENT '(' (parametros)? ')' (declaracao_local)* (cmd)* 'fim_procedimento'
| 'funcao' IDENT '(' (parametros)? ')' ':' type=tipo_estendido (declaracao_local)* (cmd)* 'fim_funcao'
;
parametro
: ('var')? identificador (',' identificador)* ':' tipo_estendido;
parametros
: parametro (',' parametro)*;
corpo
: (declaracao_local)* (cmd)*;
cmd
: cmdLeia
| cmdEscreva
| cmdSe
| cmdCaso
| cmdPara
| cmdEnquanto
| cmdFaca
| cmdAtribuicao
| cmdChamada
| cmdRetorne
;
cmdLeia
: 'leia' '(' (pointerFirst='^')? first=identificador (',' (pointerRest+='^')? rest+=identificador)* ')';
cmdEscreva
: 'escreva' '(' first=expressao (',' rest+=expressao)* ')';
cmdSe
: 'se' expressao 'entao' (seCmd+=cmd)* ('senao' (senaoCmd+=cmd)*)? 'fim_se';
cmdCaso
: 'caso' exp_aritmetica 'seja' selecao ('senao' (senaoCmd+=cmd)*)? 'fim_caso';
cmdPara
: 'para' IDENT '<-' from=exp_aritmetica 'ate' to=exp_aritmetica 'faca' (cmd)* 'fim_para';
cmdEnquanto
: 'enquanto' expressao 'faca' (cmd)* 'fim_enquanto';
cmdFaca
: 'faca' (cmd)* 'ate' expressao;
cmdAtribuicao
: (ptr='^')? identificador '<-' expressao;
cmdChamada
: IDENT '(' expressao (',' expressao)* ')';
cmdRetorne
: 'retorne' expressao;
selecao
: (item_selecao)*;
item_selecao
: constantes ':' (cmd)*;
constantes
: numero_intervalo (',' numero_intervalo)*;
numero_intervalo
: (first_neg=op_unario)? first=NUM_INT ('..' (second_neg=op_unario)? second=NUM_INT)?;
op_unario
: '-';
exp_aritmetica
: first=termo (op1 rest+=termo)*;
termo
: first=fator (op2 rest+=fator)*;
fator
: first=parcela (op3 rest+=parcela)*;
op1
: '+' | '-';
op2
: '*' | '/';
op3
: '%';
parcela
: (op_unario)? parcela_unario | parcela_nao_unario;
parcela_unario
: ('^')? var=identificador
| func=IDENT '(' expressao (',' expressao)* ')'
| inteiro=NUM_INT
| real=NUM_REAL
| '(' expr=expressao ')'
;
parcela_nao_unario
: '&' identificador | cadeia=CADEIA;
exp_relacional
: first=exp_aritmetica (op_relacional second=exp_aritmetica)?;
op_relacional
: '=' | '<>' | '>=' | '<=' | '>' | '<';
expressao
: first=termo_logico (op_logico_1 rest+=termo_logico)*;
termo_logico
: first=fator_logico (op_logico_2 rest+=fator_logico)*;
fator_logico
: ('nao')? parcela_logica;
parcela_logica
: logical=('verdadeiro' | 'falso')
| exp_relacional;
op_logico_1
: 'ou';
op_logico_2
: 'e';
// REGRAS LÉXICAS
IDENT
: [a-zA-Z_][a-zA-Z_0-9]*;
CADEIA
: '"' (~('"')|'\\"')* '"';
NUM_INT
: DIGIT+;
NUM_REAL
: DIGIT+ '.' DIGIT+;
fragment DIGIT
: [0-9];
COMENTARIO
: '{' ~('}')* '}' -> channel(HIDDEN);
WS
: ([ \n\r\t]+ | EOF) -> channel(HIDDEN);
ERRO
: .;
|
oeis/010/A010019.asm | neoneye/loda-programs | 11 | 9103 | ; A010019: a(0) = 1, a(n) = 29*n^2 + 2 for n>0.
; 1,31,118,263,466,727,1046,1423,1858,2351,2902,3511,4178,4903,5686,6527,7426,8383,9398,10471,11602,12791,14038,15343,16706,18127,19606,21143,22738,24391,26102,27871,29698,31583,33526,35527,37586,39703,41878,44111,46402,48751,51158,53623,56146,58727,61366,64063,66818,69631,72502,75431,78418,81463,84566,87727,90946,94223,97558,100951,104402,107911,111478,115103,118786,122527,126326,130183,134098,138071,142102,146191,150338,154543,158806,163127,167506,171943,176438,180991,185602,190271,194998
pow $1,$0
gcd $1,2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,29
add $1,$2
mov $0,$1
|
programs/oeis/207/A207401.asm | neoneye/loda | 22 | 81334 | <reponame>neoneye/loda
; A207401: Number of n X 6 0..1 arrays avoiding 0 0 1 and 0 1 1 horizontally and 0 0 1 and 1 1 0 vertically.
; 16,256,1296,4356,11664,26896,55696,106276,190096,322624,524176,820836,1245456,1838736,2650384,3740356,5180176,7054336,9461776,12517444,16353936,21123216,26998416,34175716,42876304,53348416,65869456,80748196,98327056,118984464,143137296,171243396,203804176,241367296,284529424,333939076,390299536,454371856,526977936,609003684,701402256,805197376,921486736,1051445476,1196329744,1357480336,1536326416,1734389316,1953286416,2194735104,2460556816,2752681156,3073150096,3424122256,3807877264,4226820196,4683486096,5180544576,5720804496,6307218724,6942888976,7631070736,8375178256,9178789636,10045651984,10979686656,11984994576,13065861636,14226764176,15472374544,16807566736,18237422116,19767235216,21402519616,23149013904,25012687716,26999747856,29116644496,31370077456,33767002564,36314638096,39020471296,41892264976,44938064196,48166203024,51585311376,55204321936,59032477156,63079336336,67354782784,71869031056,76632634276,81656491536,86951855376,92530339344,98403925636,104584972816,111086223616,117920812816,125102275204
mov $1,4
add $1,$0
bin $1,3
sub $1,2
pow $1,2
sub $1,4
mul $1,4
add $1,16
mov $0,$1
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c91004c.ada | best08618/asylo | 7 | 24466 | -- C91004C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT A TASK (TYPE) IDENTIFIER, WHEN USED WITHIN ITS OWN BODY
-- REFERS TO THE EXECUTING TASK.
--
-- TEST USING CONDITIONAL ENTRY CALL.
-- WEI 3/ 4/82
-- TLB 10/30/87 RENAMED FROM C910BDB.ADA.
WITH REPORT;
USE REPORT;
PROCEDURE C91004C IS
TASK TYPE TT1 IS
ENTRY E1;
ENTRY BYE;
END TT1;
OBJ_TT1 : ARRAY (NATURAL RANGE 1..2) OF TT1;
SUBTYPE ARG IS NATURAL RANGE 0..9;
SPYNUMB : NATURAL := 0;
PROCEDURE PSPY_NUMB (DIGT: IN ARG) IS
BEGIN
SPYNUMB := 10*SPYNUMB+DIGT;
END PSPY_NUMB;
TASK BODY TT1 IS
BEGIN
ACCEPT E1 DO
PSPY_NUMB (1);
END E1;
SELECT
TT1.E1;
ELSE
PSPY_NUMB (2);
END SELECT;
ACCEPT BYE;
END TT1;
BEGIN
TEST ("C91004C", "TASK IDENTIFIER IN OWN BODY");
OBJ_TT1 (1).E1;
OBJ_TT1 (1).BYE;
IF SPYNUMB /=12 THEN
FAILED ("WRONG TASK OBJECT REFERENCED");
COMMENT ("ACTUAL ORDER WAS:" & INTEGER'IMAGE(SPYNUMB));
END IF;
ABORT OBJ_TT1 (2);
RESULT;
END C91004C;
|
source/network-managers-tcp_v4_out.adb | reznikmm/network | 1 | 21571 | <reponame>reznikmm/network<gh_stars>1-10
-- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Interfaces.C;
with Ada.Exceptions;
package body Network.Managers.TCP_V4_Out is
procedure Change_Watch
(Self : in out Out_Socket'Class;
Set : Network.Polls.Event_Set);
use type Network.Polls.Event_Set;
Write_Event : constant Network.Polls.Event_Set :=
(Network.Polls.Output => True, others => False);
Read_Event : constant Network.Polls.Event_Set :=
(Network.Polls.Input => True, others => False);
------------------
-- Change_Watch --
------------------
procedure Change_Watch
(Self : in out Out_Socket'Class;
Set : Network.Polls.Event_Set)
is
begin
Self.Poll.Change_Watch
(Set,
Interfaces.C.int (GNAT.Sockets.To_C (Self.Internal)),
Self'Unchecked_Access);
Self.Events := Set;
end Change_Watch;
-----------
-- Close --
-----------
overriding procedure Close (Self : in out Out_Socket) is
begin
if not Self.Is_Closed then
Self.Change_Watch ((others => False));
GNAT.Sockets.Close_Socket (Self.Internal);
Self.Is_Closed := True;
end if;
end Close;
------------------
-- Has_Listener --
------------------
overriding function Has_Listener (Self : Out_Socket) return Boolean is
begin
return Self.Listener.Assigned;
end Has_Listener;
---------------
-- Is_Closed --
---------------
overriding function Is_Closed (Self : Out_Socket) return Boolean is
begin
return Self.Is_Closed;
end Is_Closed;
--------------
-- On_Event --
--------------
overriding procedure On_Event
(Self : in out Out_Socket;
Events : Network.Polls.Event_Set)
is
use type Network.Connections.Listener_Access;
function Get_Error return League.Strings.Universal_String;
procedure Disconnect (Error : League.Strings.Universal_String);
----------------
-- Disconnect --
----------------
procedure Disconnect (Error : League.Strings.Universal_String) is
begin
Self.Change_Watch ((others => False));
GNAT.Sockets.Close_Socket (Self.Internal);
Self.Is_Closed := True;
if Self.Listener.Assigned then
Self.Listener.Closed (Error);
end if;
end Disconnect;
---------------
-- Get_Error --
---------------
function Get_Error return League.Strings.Universal_String is
use type GNAT.Sockets.Error_Type;
Option : constant GNAT.Sockets.Option_Type :=
GNAT.Sockets.Get_Socket_Option
(Self.Internal,
GNAT.Sockets.Socket_Level,
GNAT.Sockets.Error);
begin
if Option.Error = GNAT.Sockets.Success then
return League.Strings.Empty_Universal_String;
else
return League.Strings.To_Universal_String
(GNAT.Sockets.Error_Type'Wide_Wide_Image (Option.Error));
end if;
end Get_Error;
Prev : constant Network.Polls.Event_Set := Self.Events;
-- Active poll events
Input : constant Network.Polls.Event := Network.Polls.Input;
Output : constant Network.Polls.Event := Network.Polls.Output;
Listener : array (Input .. Output) of Network.Connections.Listener_Access
:= (others => Self.Listener);
Again : Boolean := True;
begin
Self.In_Event := True;
if Self.Promise.Is_Pending then
Self.Error := Get_Error;
if Self.Error.Is_Empty then
Self.Events := (others => False); -- no events before listener
Self.Promise.Resolve (Self'Unchecked_Access);
-- Usually it changes Listener
if Self.Listener.Assigned then
if not Self.Events (Polls.Output) then
Self.Events := not Write_Event; -- We can write now
Self.Listener.Can_Write;
else
Self.Events := (others => True);
end if;
end if;
if Self.Events /= Prev then
Self.Change_Watch (Self.Events);
end if;
else
Disconnect (Self.Error);
Self.Promise.Reject (Self.Error);
end if;
elsif Self.Is_Closed then
-- Connection has been closed, but some events arrive after that.
null;
else
pragma Assert (Self.Listener.Assigned);
pragma Assert (Self.Error.Is_Empty);
Self.Events := Self.Events and not Events;
-- Report read event to current listener
if Events (Input) then -- Have something to read
Self.Listener.Can_Read;
-- This can change Self.Events, Self.Listener or close
end if;
-- Report write event to current listener
if Events (Output)
and not Self.Events (Output) -- Have space to write
and Self.Listener = Listener (Output)
and not Self.Is_Closed
then
Self.Listener.Can_Write;
-- This can change Self.Events, Self.Listener or close
end if;
-- Now report to changed listener if any
while Again loop
Again := False;
if not Self.Events (Input) -- Can read
and Self.Listener /= Listener (Input)
and not Self.Is_Closed
then
Listener (Input) := Self.Listener;
Self.Listener.Can_Read;
Again := True;
end if;
if not Self.Events (Output) -- Can write
and Self.Listener /= Listener (Output)
and not Self.Is_Closed
then
Listener (Output) := Self.Listener;
Self.Listener.Can_Write;
Again := True;
end if;
end loop;
if Self.Is_Closed then
Disconnect (League.Strings.Empty_Universal_String);
elsif not Self.Error.Is_Empty then
Disconnect (Self.Error);
elsif Events (Network.Polls.Error) then
Disconnect (Get_Error);
elsif Events (Network.Polls.Close) then
Disconnect (League.Strings.Empty_Universal_String);
elsif Self.Events /= Prev then
Self.Change_Watch (Self.Events);
end if;
end if;
Self.In_Event := False;
end On_Event;
----------
-- Read --
----------
overriding procedure Read
(Self : in out Out_Socket;
Data : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
use type Ada.Streams.Stream_Element_Offset;
use type GNAT.Sockets.Error_Type;
Kind : GNAT.Sockets.Error_Type;
begin
GNAT.Sockets.Receive_Socket (Self.Internal, Data, Last);
if Last < Data'First then -- End of stream
Self.Is_Closed := True;
if not Self.In_Event then
raise Program_Error with "Unimplemented";
end if;
end if;
exception
when E : GNAT.Sockets.Socket_Error =>
Last := Data'First - 1;
Kind := GNAT.Sockets.Resolve_Exception (E);
if Kind /= GNAT.Sockets.Resource_Temporarily_Unavailable then
Self.Is_Closed := True;
Self.Error := League.Strings.From_UTF_8_String
(Ada.Exceptions.Exception_Message (E));
if not Self.In_Event then
raise Program_Error with "Unimplemented";
end if;
elsif Self.In_Event then
Self.Events := Self.Events or Read_Event;
else
Self.Change_Watch (Self.Events or Read_Event);
end if;
end Read;
------------
-- Remote --
------------
overriding function Remote (Self : Out_Socket)
return Network.Addresses.Address
is
Result : League.Strings.Universal_String;
Value : GNAT.Sockets.Sock_Addr_Type;
begin
Value := GNAT.Sockets.Get_Peer_Name (Self.Internal);
Result.Append ("/ip4/");
Result.Append
(League.Strings.From_UTF_8_String (GNAT.Sockets.Image (Value.Addr)));
Result.Append ("/tcp/");
declare
Port : constant Wide_Wide_String := Value.Port'Wide_Wide_Image;
begin
Result.Append (Port (2 .. Port'Last));
return Network.Addresses.To_Address (Result);
end;
exception
when GNAT.Sockets.Socket_Error =>
return Network.Addresses.To_Address
(League.Strings.Empty_Universal_String);
end Remote;
------------------------
-- Set_Input_Listener --
------------------------
overriding procedure Set_Input_Listener
(Self : in out Out_Socket;
Value : Network.Streams.Input_Listener_Access)
is
begin
pragma Assert (not Self.Promise.Is_Pending);
Self.Listener := Network.Connections.Listener_Access (Value);
if Self.Error.Is_Empty then
if not Self.In_Event then
raise Program_Error with "Not implemented";
end if;
else
Self.Listener.Closed (Self.Error);
end if;
end Set_Input_Listener;
-------------------------
-- Set_Output_Listener --
-------------------------
overriding procedure Set_Output_Listener
(Self : in out Out_Socket;
Value : Network.Streams.Output_Listener_Access)
is
use type Network.Connections.Listener_Access;
begin
pragma Assert
(Self.Listener = Network.Connections.Listener_Access (Value));
end Set_Output_Listener;
-----------
-- Write --
-----------
overriding procedure Write
(Self : in out Out_Socket; Data : Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
use type Ada.Streams.Stream_Element_Offset;
use type GNAT.Sockets.Error_Type;
Kind : GNAT.Sockets.Error_Type;
begin
GNAT.Sockets.Send_Socket (Self.Internal, Data, Last);
if Last < Data'First then -- End of stream
Self.Is_Closed := True;
if not Self.In_Event then
raise Program_Error with "Unimplemented";
end if;
end if;
exception
when E : GNAT.Sockets.Socket_Error =>
Last := Data'First - 1;
Kind := GNAT.Sockets.Resolve_Exception (E);
if Kind /= GNAT.Sockets.Resource_Temporarily_Unavailable then
Self.Is_Closed := True;
Self.Error := League.Strings.From_UTF_8_String
(Ada.Exceptions.Exception_Message (E));
if not Self.In_Event then
raise Program_Error with "Unimplemented";
end if;
elsif Self.In_Event then
Self.Events := Self.Events or Write_Event;
else
Self.Change_Watch (Self.Events or Write_Event);
end if;
end Write;
end Network.Managers.TCP_V4_Out;
|
oeis/065/A065500.asm | neoneye/loda-programs | 11 | 175091 | <gh_stars>10-100
; A065500: Number of distinct functions from a set with n^n elements to itself that can be defined naturally (in n) by typed lambda-calculus expressions.
; Submitted by <NAME>
; 1,1,3,8,15,64,65,426,847,2528,2529,27730,27731,360372,360373,360374,720735,12252256,12252257,232792578,232792579,232792580,232792581,5354228902,5354228903,26771144424,26771144425,80313433226,80313433227,2329089562828,2329089562829,72201776446830,144403552893631,144403552893632,144403552893633,144403552893634,144403552893635,5342931457063236,5342931457063237,5342931457063238,5342931457063239,219060189739591240,219060189739591241,9419588158802421642,9419588158802421643,9419588158802421644
bin $2,$0
gcd $2,$0
seq $0,75059 ; a(n) = 1 + lcm(1, 2, ..., n) = 1 + A003418(n).
add $2,$0
mov $0,$2
sub $0,2
|
test-resources/ExamplesFromRoy/md_example4.ads | hergin/ada2fuml | 0 | 235 | <reponame>hergin/ada2fuml
with Globals_Example1;
package Md_Example4 is
type T is tagged record
Attribute : Globals_Example1.Itype;
end record;
-- Ada Rules state that all tagged operations must be defined here
function Unrelated (The_I : Globals_Example1.Itype)
return Globals_Example1.Itype;
-- No tagged operations can be defined here because the previous
-- function dosn't involve the tagged type.
end Md_Example4;
|
_incObj/12 Light.asm | kodishmediacenter/msu-md-sonic | 9 | 179505 | ; ---------------------------------------------------------------------------
; Object 12 - lamp (SYZ)
; ---------------------------------------------------------------------------
SpinningLight:
moveq #0,d0
move.b obRoutine(a0),d0
move.w Light_Index(pc,d0.w),d1
jmp Light_Index(pc,d1.w)
; ===========================================================================
Light_Index: dc.w Light_Main-Light_Index
dc.w Light_Animate-Light_Index
; ===========================================================================
Light_Main: ; Routine 0
addq.b #2,obRoutine(a0)
move.l #Map_Light,obMap(a0)
move.w #0,obGfx(a0)
move.b #4,obRender(a0)
move.b #$10,obActWid(a0)
move.b #6,obPriority(a0)
Light_Animate: ; Routine 2
subq.b #1,obTimeFrame(a0)
bpl.s @chkdel
move.b #7,obTimeFrame(a0)
addq.b #1,obFrame(a0)
cmpi.b #6,obFrame(a0)
bcs.s @chkdel
move.b #0,obFrame(a0)
@chkdel:
out_of_range DeleteObject
bra.w DisplaySprite |
projects/batfish/src/org/batfish/grammar/cisco/CiscoParser.g4 | Alexia23/batfish | 1 | 4750 | <gh_stars>1-10
parser grammar CiscoParser;
import
Cisco_common, Cisco_acl, Cisco_bgp, Cisco_ignored, Cisco_interface, Cisco_isis, Cisco_mpls, Cisco_ospf, Cisco_rip, Cisco_routemap, Cisco_static;
options {
superClass = 'org.batfish.grammar.BatfishParser';
tokenVocab = CiscoLexer;
}
@header {
package org.batfish.grammar.cisco;
}
address_aiimgp_stanza
:
ADDRESS ~NEWLINE* NEWLINE
;
address_family_vrfd_stanza
:
ADDRESS_FAMILY
(
IPV4
| IPV6
)
(
MULTICAST
| UNICAST
)? NEWLINE afvrfd_stanza*
(
EXIT_ADDRESS_FAMILY NEWLINE
)?
;
afvrfd_stanza
:
null_afvrfd_stanza
;
aiimgp_stanza
:
address_aiimgp_stanza
;
allow_iimgp_stanza
:
ALLOW ~NEWLINE* NEWLINE aiimgp_stanza*
;
banner_stanza
:
BANNER
(
(
(
ESCAPE_C ~ESCAPE_C* ESCAPE_C
)
|
(
POUND ~POUND* POUND
)
|
(
NEWLINE ~EOF_LITERAL* EOF_LITERAL
)
)
) NEWLINE
;
certificate_stanza
:
CERTIFICATE ~QUIT* QUIT NEWLINE
;
cisco_configuration
:
NEWLINE?
(
sl += stanza
)+ COLON? NEWLINE? EOF
;
hostname_stanza
:
(
HOSTNAME
| SWITCHNAME
) name = ~NEWLINE* NEWLINE
;
iimgp_stanza
:
allow_iimgp_stanza
;
imgp_stanza
:
interface_imgp_stanza
| null_imgp_stanza
;
inband_mgp_stanza
:
(
INBAND
| OUT_OF_BAND
) NEWLINE imgp_stanza*
;
interface_imgp_stanza
:
INTERFACE ~NEWLINE* NEWLINE iimgp_stanza*
;
ip_default_gateway_stanza
:
IP DEFAULT_GATEWAY gateway = IP_ADDRESS NEWLINE
;
ip_route_stanza
:
IP ROUTE
(
VRF vrf = ~NEWLINE
)? ip_route_tail
;
ip_route_tail
:
(
(
address = IP_ADDRESS mask = IP_ADDRESS
)
| prefix = IP_PREFIX
)
(
nexthopip = IP_ADDRESS
| nexthopint = interface_name
| nexthopprefix = IP_PREFIX
| distance = DEC
|
(
TAG tag = DEC
)
| perm = PERMANENT
|
(
TRACK track = DEC
)
|
(
NAME variable
)
)* NEWLINE
;
ip_route_vrfc_stanza
:
IP ROUTE ip_route_tail
;
macro_stanza
:
MACRO ~NEWLINE* NEWLINE
;
management_plane_stanza
:
MANAGEMENT_PLANE NEWLINE mgp_stanza*
;
mgp_stanza
:
inband_mgp_stanza
;
no_ip_access_list_stanza
:
NO IP ACCESS_LIST ~NEWLINE* NEWLINE
;
null_stanza
:
banner_stanza
| certificate_stanza
| macro_stanza
| management_plane_stanza
| no_ip_access_list_stanza
| null_block_stanza
| null_standalone_stanza_DEPRECATED_DO_NOT_ADD_ITEMS
| srlg_stanza
;
null_afvrfd_stanza
:
MAXIMUM ~NEWLINE* NEWLINE
;
null_imgp_stanza
:
NO?
(
VRF
) ~NEWLINE* NEWLINE
;
null_vrfd_stanza
:
(
RD
| ROUTE_TARGET
) ~NEWLINE* NEWLINE
;
srlg_interface_numeric_stanza
:
DEC ~NEWLINE* NEWLINE
;
srlg_interface_stanza
:
INTERFACE ~NEWLINE* NEWLINE srlg_interface_numeric_stanza*
;
srlg_stanza
:
SRLG NEWLINE srlg_interface_stanza*
;
stanza
:
appletalk_access_list_stanza
| extended_access_list_stanza
| hostname_stanza
| interface_stanza
| ip_as_path_access_list_stanza
| ip_community_list_expanded_stanza
| ip_community_list_standard_stanza
| ip_default_gateway_stanza
| ip_prefix_list_stanza
| ip_route_stanza
| ipv6_router_ospf_stanza
| ipx_sap_access_list_stanza
| mpls_ldp_stanza
| mpls_traffic_eng_stanza
| nexus_access_list_stanza
| nexus_prefix_list_stanza
| null_stanza
| prefix_set_stanza
| protocol_type_code_access_list_stanza
| route_map_stanza
| route_policy_stanza
| router_bgp_stanza
| router_isis_stanza
| router_ospf_stanza
| router_rip_stanza
| router_static_stanza
| rsvp_stanza
| standard_access_list_stanza
| switching_mode_stanza
| vrf_context_stanza
| vrf_definition_stanza
;
switching_mode_stanza
:
SWITCHING_MODE ~NEWLINE* NEWLINE
;
vrf_context_stanza
:
VRF CONTEXT name = variable NEWLINE vrfc_stanza*
;
vrf_definition_stanza
:
VRF DEFINITION? name = variable NEWLINE vrfd_stanza*
;
vrfc_stanza
:
ip_route_vrfc_stanza
;
vrfd_stanza
:
address_family_vrfd_stanza
| null_vrfd_stanza
;
|
libraries/pxcrt/amd64/src/crt0.asm | betopp/pathetix | 0 | 15875 | ;crt0.asm
;Entry point for C runtime
;<NAME> <<EMAIL>> 2021
bits 64
section .text
;Entry point, for both initial startup and for signal handling
align 16
global _pxcrt_entry
_pxcrt_entry:
jmp _pxcrt_entry_startup ;Symbol + 0 = initial entry
align 16
jmp _pxcrt_entry_signal ;Symbol + 16 = entry on signal
;Entry for startup
_pxcrt_entry_startup:
;Set thread-local storage pointer for initial thread
mov RAX, _pxcrt_tls0
wrgsbase RAX
;Zero GPRs
mov RAX, 0
mov RCX, RAX
mov RDX, RAX
mov RBX, RAX
mov RSI, RAX
mov RDI, RAX
mov RSP, RAX
mov RBP, RAX
mov R8, RAX
mov R9, RAX
mov R10, RAX
mov R11, RAX
mov R12, RAX
mov R13, RAX
mov R14, RAX
mov R15, RAX
;Use static stack
mov RSP, _pxcrt_stack.top
;Call libc which will call main and then exit
extern _libc_entry
call _libc_entry
hlt
jmp 0
jmp _pxcrt_entry
;Entry for signal handler
_pxcrt_entry_signal:
;Avoid clobbering red-zone of old stack, in case this signal was unexpected.
sub RSP, 128
;Handle signal
extern _libc_signalled
call _libc_signalled
;libc_signalled should ask the kernel to return to the signalled context
hlt
jmp 0
jmp _pxcrt_entry
bits 64
section .bss
;Space for stack
alignb 4096
_pxcrt_stack:
resb 4096 * 4
.top:
bits 64
section .data
;Space for initial thread TLS
align 4096
_pxcrt_tls0:
dq _pxcrt_tls0 ;TLS starts with pointer to itself
times (4096 - 8) db 0
.top:
|
oeis/059/A059830.asm | neoneye/loda-programs | 11 | 12213 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A059830: a(n) = n^6 + n^4 + n^2 + 1.
; 1,4,85,820,4369,16276,47989,120100,266305,538084,1010101,1786324,3006865,4855540,7568149,11441476,16843009,24221380,34117525,47176564,64160401,85961044,113614645,148316260,191435329,244531876,309373429,387952660,482505745,595531444,729810901,888428164,1074791425,1292654980,1546141909,1839767476,2178463249,2567601940,3013022965,3521058724,4098561601,4752931684,5492145205,6324783700,7260063889,8307868276,9478776469,10784097220,12235901185,13847054404,15631252501,17603055604,19777923985
pow $0,2
seq $0,188947 ; a(n) = n^3 - 2*n^2 + 2*n + 1.
sub $0,1
|
string/s005.asm | czfshine/assembly-exercise | 1 | 166310 | ; 8086 assembly file
; by:czfshine
; date: 2018/03/31 17:04:48
;从键盘上输入一串字符(用回车键结束,使用10号功能调用。)放在STRING中,
;试编制一个程序测试字符串中是否存在数字。
;如有,则把CL的第5位置1,否则将该位置置0。
; The Main Data segment
DATA SEGMENT
buf DB 80,?,80 dup(?) ;
DATA ENDS
;entry code segment
CODE SEGMENT
ASSUME CS:CODE ,DS:DATA
START: ;entry point
MOV AX,DATA
MOV DS,AX
LEA DX,buf
MOV AH,0AH
INT 21H
LEA BX,buf
INC BX
MOV CL,[BX]
MOV CH,0
MOV SP,0
L1:
MOV SI,CX
MOV DL,[BX+SI]
CMP DL,'0'
JB L0
CMP DL,'9'
JA L0
OR CL,00010000B
JMP L2
L0:
LOOP L1
L2:
MOV AH,4CH ;return
INT 21H
CODE ENDS
END START |
oeis/021/A021173.asm | neoneye/loda-programs | 11 | 93660 | ; A021173: Decimal expansion of 1/169.
; Submitted by <NAME>iga
; 0,0,5,9,1,7,1,5,9,7,6,3,3,1,3,6,0,9,4,6,7,4,5,5,6,2,1,3,0,1,7,7,5,1,4,7,9,2,8,9,9,4,0,8,2,8,4,0,2,3,6,6,8,6,3,9,0,5,3,2,5,4,4,3,7,8,6,9,8,2,2,4,8,5,2,0,7,1,0,0,5,9,1,7,1,5,9,7,6,3,3,1,3,6,0,9,4,6,7
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
div $2,17
mul $3,10
lpe
mov $0,$2
mod $0,10
|
stm32l0/stm32gd-i2c-peripheral.adb | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 9746 | <filename>stm32l0/stm32gd-i2c-peripheral.adb
with Utils;
package body STM32GD.I2C.Peripheral is
Default_Timeout : constant Natural := 10000;
Count_Down : Natural;
procedure Start (Duration : Natural := Default_Timeout) is
begin
Count_Down := Duration;
end Start;
function Timed_Out return Boolean is
begin
return (Count_Down = 0);
end Timed_Out;
procedure Pause is
begin
if not Timed_Out then Count_Down := Count_Down - 1; end if;
end Pause;
procedure Init is
begin
I2C.CR1.PE := 0;
I2C.TIMINGR.SCLH := 3;
I2C.TIMINGR.SCLL := 4;
I2C.TIMINGR.SDADEL := 0;
I2C.TIMINGR.SCLDEL := 0;
I2C.TIMINGR.PRESC := 1;
I2C.CR1.PE := 1;
end Init;
function Received_Ack return Boolean is
begin
Start;
while I2C.ISR.TXIS = 0 and I2C.ISR.NACKF = 0 and not Timed_Out
loop
Pause;
end loop;
return (I2C.ISR.TXIS = 1 and I2C.ISR.NACKF = 0);
end Received_Ack;
function Wait_For_TXDR_Empty return Boolean is
begin
Start;
while I2C.ISR.TXIS = 0 and not Timed_Out loop
Pause;
end loop;
return (I2C.ISR.TXIS = 1);
end Wait_For_TXDR_Empty;
function Wait_For_TX_Complete return Boolean is
begin
Start;
while I2C.ISR.TC = 0 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_TX_Complete;
function Wait_For_RX_Not_Empty return Boolean is
begin
Start;
while I2C.ISR.RXNE = 0 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_RX_Not_Empty;
function Wait_For_Idle return Boolean is
begin
Start;
while I2C.ISR.BUSY = 1 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_Idle;
function Wait_For_Stop return Boolean is
begin
Start;
while I2C.ISR.STOPF = 1 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_Stop;
function Test (Address : I2C_Address) return Boolean is
Present : Boolean;
begin
I2C.ICR.NACKCF := 1;
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 0;
I2C.CR2.SADD := Address * 2;
I2C.CR2.RD_WRN := 0;
I2C.CR2.AUTOEND := 0;
I2C.CR2.START := 1;
Present := I2C.ISR.NACKF = 0;
I2C.CR2.STOP := 1;
I2C.ICR.NACKCF := 1;
return Present;
end Test;
function Master_Transmit (Address : I2C_Address; Data : Byte;
Restart : Boolean := False) return Boolean is
begin
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD := Address * 2;
I2C.CR2.RD_WRN := 0;
I2C.CR2.AUTOEND := (if not Restart then 1 else 0);
I2C.CR2.START := 1;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Data;
return True;
end Master_Transmit;
function Master_Receive (Address : I2C_Address; Data : out Byte)
return Boolean is
begin
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD := Address * 2;
I2C.CR2.AUTOEND := 1;
I2C.CR2.RD_WRN := 1;
I2C.CR2.START := 1;
if not Wait_For_RX_Not_Empty then return False; end if;
Data := I2C.RXDR.RXDATA;
return True;
end Master_Receive;
function Master_Receive (Address : I2C_Address; Data : out I2C_Data)
return Boolean
is
begin
I2C.CR2.NBYTES := Data'Length;
I2C.CR2.SADD := Address * 2;
I2C.CR2.RD_WRN := 1;
I2C.CR2.AUTOEND := 1;
I2C.CR2.START := 1;
for D of Data loop
if Wait_For_RX_Not_Empty then
D := I2C.RXDR.RXDATA;
end if;
end loop;
return True;
end Master_Receive;
function Write_Register (Address : I2C_Address; Register : Byte;
Data : Byte) return Boolean is
begin
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 2;
I2C.CR2.SADD := Address * 2;
I2C.CR2.AUTOEND := 1;
I2C.CR2.RD_WRN := 0;
I2C.CR2.START := 1;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Register;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Data;
return True;
end Write_Register;
function Read_Register (Address : I2C_Address; Register : Byte;
Data : out Byte) return Boolean is
begin
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD := Address * 2;
I2C.CR2.AUTOEND := 1;
I2C.CR2.RD_WRN := 0;
I2C.CR2.START := 1;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Register;
-- if not Wait_For_TX_Complete then return False; end if;
I2C.CR2.NBYTES := 1;
I2C.CR2.RD_WRN := 1;
I2C.CR2.SADD := Address * 2;
I2C.CR2.START := 1;
if not Wait_For_RX_Not_Empty then return False; end if;
Data := I2C.RXDR.RXDATA;
return True;
end Read_Register;
end STM32GD.I2C.Peripheral;
|
oeis/321/A321213.asm | neoneye/loda-programs | 11 | 82142 | <reponame>neoneye/loda-programs
; A321213: a(n) is the number of divisors of n-th Fermat number (A000215).
; 2,2,2,2,2,4,4,4,4,8,16,32
lpb $0
add $1,$0
sub $2,$0
lpb $0
mod $0,5
add $0,$2
mov $1,$0
add $2,$0
lpe
max $2,$1
mov $0,$2
sub $0,4
add $3,4
mul $3,2
lpe
mov $0,$3
div $0,4
add $0,2
|
src/natools-web-exchanges.adb | faelys/natools-web | 1 | 17568 | <gh_stars>1-10
------------------------------------------------------------------------------
-- Copyright (c) 2014-2019, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Strings.Unbounded;
with AWS.Cookie;
with AWS.Headers.Values;
with AWS.MIME;
with AWS.Parameters;
with AWS.Response.Set;
with Natools.S_Expressions.Atom_Ref_Constructors;
package body Natools.Web.Exchanges is
package Constructors renames Natools.S_Expressions.Atom_Ref_Constructors;
procedure Ensure_Kind
(Object : in out Exchange;
Kind : in Responses.Kind);
-- Switch Object.Kind to Kind, resetting internal state if needed
function Make_Row (Key, Value : in String)
return Containers.Atom_Array_Refs.Immutable_Reference;
-- Create an atom table row from key and value
------------------------------
-- Local Helper Subprograms --
------------------------------
procedure Ensure_Kind
(Object : in out Exchange;
Kind : in Responses.Kind)
is
use type Responses.Kind;
begin
if Object.Kind /= Kind then
Object.Kind := Kind;
Object.Response_Body.Soft_Reset;
end if;
end Ensure_Kind;
function Make_Row (Key, Value : in String)
return Containers.Atom_Array_Refs.Immutable_Reference
is
Data : constant Containers.Atom_Array_Refs.Data_Access
:= new Containers.Atom_Array (1 .. 2);
Result : constant Containers.Atom_Array_Refs.Immutable_Reference
:= Containers.Atom_Array_Refs.Create (Data);
begin
Data (1) := Constructors.Create (S_Expressions.To_Atom (Key));
Data (2) := Constructors.Create (S_Expressions.To_Atom (Value));
return Result;
end Make_Row;
--------------------------------
-- Request Method Subprograms --
--------------------------------
function To_Set (List : Method_Array) return Method_Set is
Result : Method_Set := (others => False);
begin
for I in List'Range loop
Result (List (I)) := True;
end loop;
return Result;
end To_Set;
function Image (List : Method_Array) return String is
begin
return Image (To_Set (List));
end Image;
function Image (Set : Method_Set) return String is
Buffer : String := "GET, HEAD, POST";
First : Boolean := True;
Last : Natural := Buffer'First - 1;
procedure Raw_Append (S : in String);
procedure Append (S : in String);
procedure Raw_Append (S : in String) is
begin
Buffer (Last + 1 .. Last + S'Length) := S;
Last := Last + S'Length;
end Raw_Append;
procedure Append (S : in String) is
begin
if First then
First := False;
else
Raw_Append (", ");
end if;
Raw_Append (S);
end Append;
begin
for M in Set'Range loop
if Set (M) then
Append (Request_Method'Image (M));
end if;
end loop;
return Buffer (Buffer'First .. Last);
end Image;
-----------------------
-- Request Accessors --
-----------------------
function Cookie (Object : in Exchange; Name : in String) return String is
begin
return AWS.Cookie.Get (Object.Request.all, Name);
end Cookie;
function Cookie_Table
(Object : in Exchange)
return Containers.Atom_Table_Refs.Immutable_Reference
is
Headers : constant AWS.Headers.List
:= AWS.Status.Header (Object.Request.all);
Cookies : constant String
:= AWS.Headers.Get_Values (Headers, AWS.Messages.Cookie_Token);
Headers_Set : constant AWS.Headers.Values.Set
:= AWS.Headers.Values.Split (Cookies);
List : Containers.Atom_Row_Lists.List;
begin
for I in Headers_Set'Range loop
if Headers_Set (I).Named_Value then
List.Append (Make_Row
(Ada.Strings.Unbounded.To_String (Headers_Set (I).Name),
Ada.Strings.Unbounded.To_String (Headers_Set (I).Value)));
else
Log (Severities.Error, "Nameless cookie """
& Ada.Strings.Unbounded.To_String (Headers_Set (I).Value) & '"');
end if;
end loop;
return Containers.Create (List);
end Cookie_Table;
function Has_Parameter (Object : Exchange; Name : String) return Boolean is
begin
return AWS.Parameters.Exist
(AWS.Status.Parameters (Object.Request.all),
Name);
end Has_Parameter;
function Header (Object : Exchange; Name : String) return String is
begin
return AWS.Headers.Get_Values
(AWS.Status.Header (Object.Request.all),
Name);
end Header;
procedure Iterate_Parameters
(Object : in Exchange;
Process : not null access procedure (Name, Value : String))
is
Parameters : constant AWS.Parameters.List
:= AWS.Status.Parameters (Object.Request.all);
begin
for I in 1 .. AWS.Parameters.Count (Parameters) loop
Process.all
(AWS.Parameters.Get_Name (Parameters, I),
AWS.Parameters.Get_Value (Parameters, I));
end loop;
end Iterate_Parameters;
function Method (Object : Exchange) return Request_Method is
begin
case AWS.Status.Method (Object.Request.all) is
when AWS.Status.GET => return GET;
when AWS.Status.HEAD => return HEAD;
when AWS.Status.POST => return POST;
when others => return Unknown_Method;
end case;
end Method;
function Parameter
(Object : Exchange;
Name : String)
return String is
begin
return AWS.Parameters.Get
(AWS.Status.Parameters (Object.Request.all), Name);
end Parameter;
overriding procedure Read
(Stream : in out Exchange;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
pragma Unreferenced (Stream, Item, Last);
begin
raise Program_Error with "Reading exchange stream is not implemented";
end Read;
function Path (Object : Exchange) return String is
begin
return AWS.Status.URI (Object.Request.all);
end Path;
-------------------------
-- Identity Management --
-------------------------
function Identity (Object : Exchange) return Containers.Identity is
begin
return Object.Identity;
end Identity;
procedure Set_Identity
(Object : in out Exchange;
Identity : in Containers.Identity) is
begin
Object.Has_Identity := True;
Object.Identity := Identity;
end Set_Identity;
---------------------------
-- Response Construction --
---------------------------
procedure Append
(Object : in out Exchange;
Data : in S_Expressions.Atom) is
begin
Ensure_Kind (Object, Responses.Buffer);
Object.Filter.Apply (Object.Response_Body, Data);
end Append;
procedure Insert_Filter
(Object : in out Exchange;
Filter : in Filters.Filter'Class;
Side : in Filters.Side := Filters.Top) is
begin
Object.Filter.Insert (Filter, Side);
end Insert_Filter;
procedure Method_Not_Allowed
(Object : in out Exchange;
Allow : in Method_Set) is
begin
Object.Status_Code := AWS.Messages.S405;
Object.Allow := Allow;
end Method_Not_Allowed;
procedure Not_Found (Object : in out Exchange) is
begin
Object.Status_Code := AWS.Messages.S404;
end Not_Found;
procedure Remove_Filter
(Object : in out Exchange;
Filter : in Filters.Filter'Class;
Side : in Filters.Side := Filters.Top) is
begin
Object.Filter.Remove (Filter, Side);
end Remove_Filter;
procedure Send_File
(Object : in out Exchange;
File_Name : in S_Expressions.Atom) is
begin
Ensure_Kind (Object, Responses.File);
Object.Response_Body.Soft_Reset;
Object.Response_Body.Append (File_Name);
end Send_File;
procedure Set_Cookie
(Object : in out Exchange;
Key : in String;
Value : in String;
Comment : in String := "";
Domain : in String := "";
Max_Age : in Duration := 10.0 * 365.0 * 86400.0;
Path : in String := "/";
Secure : in Boolean := False;
HTTP_Only : in Boolean := False) is
begin
Object.Set_Cookies.Include (Key,
(Value_Length => Value'Length,
Comment_Length => Comment'Length,
Domain_Length => Domain'Length,
Path_Length => Path'Length,
Value => Value,
Comment => Comment,
Domain => Domain,
Max_Age => Max_Age,
Path => Path,
Secure => Secure,
HTTP_Only => HTTP_Only));
end Set_Cookie;
procedure Set_MIME_Type
(Object : in out Exchange;
MIME_Type : in S_Expressions.Atom)
is
use type S_Expressions.Count;
begin
if Object.Response_Body.Length /= 0 then
Log (Severities.Warning,
"Changing MIME type of partially-created response");
end if;
Object.MIME_Type
:= S_Expressions.Atom_Ref_Constructors.Create (MIME_Type);
end Set_MIME_Type;
procedure Permanent_Redirect
(Object : in out Exchange;
Target : in S_Expressions.Atom) is
begin
Object.Status_Code := AWS.Messages.S301;
Object.Location := Constructors.Create (Target);
end Permanent_Redirect;
procedure Permanent_Redirect
(Object : in out Exchange;
Target : in S_Expressions.Atom_Refs.Immutable_Reference) is
begin
Object.Status_Code := AWS.Messages.S301;
Object.Location := Target;
end Permanent_Redirect;
procedure See_Other
(Object : in out Exchange;
Target : in S_Expressions.Atom) is
begin
See_Other (Object, Constructors.Create (Target));
end See_Other;
procedure See_Other
(Object : in out Exchange;
Target : in S_Expressions.Atom_Refs.Immutable_Reference) is
begin
if AWS.Status.HTTP_Version (Object.Request.all) = AWS.HTTP_10 then
Object.Status_Code := AWS.Messages.S302;
else
Object.Status_Code := AWS.Messages.S303;
end if;
Object.Location := Target;
end See_Other;
---------------------
-- Response Export --
---------------------
function Response (Object : Exchange) return AWS.Response.Data is
Result : AWS.Response.Data;
begin
case Object.Kind is
when Responses.Empty =>
raise Program_Error with "Empty response cannot be exported";
when Responses.Buffer =>
if Object.MIME_Type.Is_Empty then
Result := AWS.Response.Build
("text/html",
Object.Response_Body.Data,
Object.Status_Code);
else
Result := AWS.Response.Build
(S_Expressions.To_String (Object.MIME_Type.Query.Data.all),
Object.Response_Body.Data,
Object.Status_Code);
end if;
when Responses.File =>
if Object.MIME_Type.Is_Empty then
declare
Filename : constant String
:= S_Expressions.To_String (Object.Response_Body.Data);
begin
Result := AWS.Response.File
(AWS.MIME.Content_Type (Filename),
Filename,
Object.Status_Code);
end;
else
Result := AWS.Response.File
(S_Expressions.To_String (Object.MIME_Type.Query.Data.all),
S_Expressions.To_String (Object.Response_Body.Data),
Object.Status_Code);
end if;
end case;
if Object.Allow /= Method_Set'(others => False) then
AWS.Response.Set.Add_Header
(Result,
AWS.Messages.Allow_Token,
Image (Object.Allow));
end if;
if not Object.Location.Is_Empty then
AWS.Response.Set.Add_Header
(Result,
AWS.Messages.Location_Token,
S_Expressions.To_String (Object.Location.Query));
end if;
for Cursor in Object.Set_Cookies.Iterate loop
declare
Element : constant Cookie_Data := Cookie_Maps.Element (Cursor);
begin
-- For newer AWS with HttpOnly support:
-- AWS.Cookie.Set
-- (Content => Result,
-- Key => Cookie_Maps.Key (Cursor),
-- Value => Element.Value,
-- Comment => Element.Comment,
-- Domain => Element.Domain,
-- Max_Age => Element.Max_Age,
-- Path => Element.Path,
-- Secure => Element.Secure,
-- HTTP_Only => Element.HTTP_Only);
-- Otherwise, inject HttpOnly after the always-added Path
AWS.Cookie.Set
(Content => Result,
Key => Cookie_Maps.Key (Cursor),
Value => Element.Value,
Comment => Element.Comment,
Domain => Element.Domain,
Max_Age => Element.Max_Age,
Path => (if Element.HTTP_Only
then Element.Path & "; HttpOnly"
else Element.Path),
Secure => Element.Secure);
end;
end loop;
return Result;
end Response;
end Natools.Web.Exchanges;
|
.emacs.d/elpa/wisi-2.2.1/wisitoken-bnf-generate.adb | caqg/linux-home | 0 | 26919 | <gh_stars>0
-- Abstract :
--
-- Parser for Wisi grammar files, producing Ada source
-- files for a parser.
--
-- Copyright (C) 2012 - 2015, 2017 - 2019 Free Software Foundation, Inc.
--
-- The WisiToken package is free software; you can redistribute it
-- and/or modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 3, 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.
--
-- 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.
pragma License (Modified_GPL);
with Ada.Command_Line;
with Ada.Directories;
with Ada.Exceptions;
with Ada.Real_Time;
with Ada.Strings.Fixed;
with Ada.Strings.Maps;
with Ada.Strings.Unbounded;
with Ada.Text_IO;
with GNAT.Traceback.Symbolic;
with WisiToken.BNF.Generate_Utils;
with WisiToken.BNF.Output_Ada;
with WisiToken.BNF.Output_Ada_Common;
with WisiToken.BNF.Output_Ada_Emacs;
with WisiToken.BNF.Output_Elisp_Common;
with WisiToken.Generate.LR.LALR_Generate;
with WisiToken.Generate.LR.LR1_Generate;
with WisiToken.Generate.Packrat;
with WisiToken.Parse.LR.Parser_No_Recover; -- for reading BNF file
with WisiToken.Productions;
with WisiToken.Syntax_Trees;
with WisiToken.Text_IO_Trace;
with WisiToken_Grammar_Runtime;
with Wisitoken_Grammar_Actions;
with Wisitoken_Grammar_Main;
procedure WisiToken.BNF.Generate
is
procedure Put_Usage
is
use Ada.Text_IO;
First : Boolean := True;
begin
-- verbosity meaning is actually determined by output choice;
-- they should be consistent with this description.
Put_Line (Standard_Error, "version 1.3.0");
Put_Line (Standard_Error, "wisitoken-bnf-generate [options] {wisi grammar file}");
Put_Line (Standard_Error, "Generate source code implementing a parser for the grammar.");
New_Line (Standard_Error);
Put_Line (Standard_Error, "The following grammar file directives control parser generation:");
Put_Line (Standard_Error,
"%generate <algorithm> <output language> [<lexer>] [<interface>] [text_rep]");
Put_Line (Standard_Error, " specify one of each generate parameter. May be repeated.");
Put (Standard_Error, " algorithm: ");
for I of Generate_Algorithm_Image loop
if First then
First := False;
else
Put (Standard_Error, " | ");
end if;
Put (Standard_Error, I.all);
end loop;
New_Line (Standard_Error);
Put (Standard_Error, " output language: ");
First := True;
for I of Output_Language_Image loop
if First then
First := False;
else
Put (Standard_Error, " | ");
end if;
Put (Standard_Error, I.all);
end loop;
New_Line (Standard_Error);
Put_Line (Standard_Error, " interface: interface Process | Module");
Put_Line (Standard_Error, " only valid with Ada_Emacs:");
Put_Line (Standard_Error, " Process is for an external subprocess communicating with Emacs.");
Put_Line (Standard_Error, " Module is for a dynamically loaded Emacs module.");
Put (Standard_Error, " lexer: ");
First := True;
for I of Output_Language_Image loop
if First then
First := False;
else
Put (Standard_Error, " | ");
end if;
Put (Standard_Error, I.all);
end loop;
New_Line (Standard_Error);
Put_Line
(Standard_Error, " text_rep: output LR parse table in a text file, not as source code; for large tables");
New_Line (Standard_Error);
Put_Line (Standard_Error, "options:");
Put_Line (Standard_Error, " --help: show this help");
Put_Line (Standard_Error, " -v level: sets verbosity (default 0):");
Put_Line (Standard_Error, " 0 - only error messages to standard error");
Put_Line (Standard_Error, " 1 - add diagnostics to standard out");
Put_Line (Standard_Error, " 2 - more diagnostics to standard out, ignore unused tokens, unknown conflicts");
Put_Line (Standard_Error, " --generate ...: override grammar file %generate directive");
Put_Line (Standard_Error, " --output_bnf <file_name> : output translated BNF source to file_name");
Put_Line (Standard_Error, " --suffix <string>; appended to grammar file name");
Put_Line (Standard_Error, " --ignore_conflicts; ignore excess/unknown conflicts");
Put_Line (Standard_Error,
" --test_main; generate standalone main program for running the generated parser, modify file names");
Put_Line (Standard_Error, " --time; output execution time of various stages");
end Put_Usage;
Language_Name : Ada.Strings.Unbounded.Unbounded_String; -- The language the grammar defines
Output_File_Name_Root : Ada.Strings.Unbounded.Unbounded_String;
Suffix : Ada.Strings.Unbounded.Unbounded_String;
BNF_File_Name : Ada.Strings.Unbounded.Unbounded_String;
Output_BNF : Boolean := False;
Ignore_Conflicts : Boolean := False;
Test_Main : Boolean := False;
Command_Generate_Set : Generate_Set_Access; -- override grammar file declarations
Trace : aliased WisiToken.Text_IO_Trace.Trace (Wisitoken_Grammar_Actions.Descriptor'Access);
Input_Data : aliased WisiToken_Grammar_Runtime.User_Data_Type;
Grammar_Parser : WisiToken.Parse.LR.Parser_No_Recover.Parser;
Do_Time : Boolean := False;
procedure Use_Input_File (File_Name : in String)
is
use Ada.Strings.Unbounded;
use Ada.Text_IO;
begin
Output_File_Name_Root := +Ada.Directories.Base_Name (File_Name) & Suffix;
Wisitoken_Grammar_Main.Create_Parser
(Parser => Grammar_Parser,
Trace => Trace'Unchecked_Access,
User_Data => Input_Data'Unchecked_Access);
Grammar_Parser.Lexer.Reset_With_File (File_Name);
declare
Language_Name_Dir : constant Integer := Ada.Strings.Fixed.Index
(File_Name, Ada.Strings.Maps.To_Set ("/\"), Going => Ada.Strings.Backward);
Language_Name_Ext : constant Integer := Ada.Strings.Fixed.Index (File_Name, ".wy");
begin
Language_Name := +WisiToken.BNF.Output_Elisp_Common.Elisp_Name_To_Ada
(File_Name
((if Language_Name_Dir = 0
then File_Name'First
else Language_Name_Dir + 1) ..
Language_Name_Ext - 1),
Append_ID => False,
Trim => 0);
end;
exception
when Name_Error | Use_Error =>
raise Name_Error with "input file '" & File_Name & "' could not be opened.";
end Use_Input_File;
begin
declare
use Ada.Command_Line;
Arg_Next : Integer := 1;
begin
loop
exit when Argument (Arg_Next)(1) /= '-';
-- --help, -v first, then alphabetical
if Argument (Arg_Next) = "--help" then
Put_Usage;
return;
elsif Argument (Arg_Next) = "-v" then
Arg_Next := Arg_Next + 1;
WisiToken.Trace_Generate := Integer'Value (Argument (Arg_Next));
Arg_Next := Arg_Next + 1;
elsif Argument (Arg_Next) = "--ignore_conflicts" then
Ignore_Conflicts := True;
Arg_Next := Arg_Next + 1;
elsif Argument (Arg_Next) = "--generate" then
Arg_Next := Arg_Next + 1;
declare
Tuple : Generate_Tuple;
Done : Boolean := False;
begin
begin
Tuple.Gen_Alg := Generate_Algorithm'Value (Argument (Arg_Next));
Arg_Next := Arg_Next + 1;
exception
when Constraint_Error =>
raise User_Error with "invalid value for generator_algorithm: '" & Argument (Arg_Next) & ";";
end;
if Tuple.Gen_Alg /= None then
begin
Tuple.Out_Lang := To_Output_Language (Argument (Arg_Next));
Arg_Next := Arg_Next + 1;
end;
loop
exit when Done;
declare
Text : constant String := Argument (Arg_Next);
begin
if Text = "text_rep" then
Tuple.Text_Rep := True;
Arg_Next := Arg_Next + 1;
elsif (for some I of Lexer_Image => To_Lower (Text) = I.all) then
Tuple.Lexer := To_Lexer (Text);
Arg_Next := Arg_Next + 1;
elsif (for some I in Valid_Interface =>
To_Lower (Text) = To_Lower (Valid_Interface'Image (I)))
then
Tuple.Interface_Kind := WisiToken.BNF.Valid_Interface'Value (Text);
Arg_Next := Arg_Next + 1;
else
Done := True;
end if;
end;
end loop;
end if;
Add (Command_Generate_Set, Tuple);
end;
elsif Argument (Arg_Next) = "--output_bnf" then
Output_BNF := True;
Arg_Next := Arg_Next + 1;
BNF_File_Name := +Argument (Arg_Next);
Arg_Next := Arg_Next + 1;
elsif Argument (Arg_Next) = "--suffix" then
Arg_Next := Arg_Next + 1;
Suffix := +Argument (Arg_Next);
Arg_Next := Arg_Next + 1;
elsif Argument (Arg_Next) = "--test_main" then
Arg_Next := Arg_Next + 1;
Test_Main := True;
elsif Argument (Arg_Next) = "--time" then
Arg_Next := Arg_Next + 1;
Do_Time := True;
else
raise User_Error with "invalid argument '" & Argument (Arg_Next) & "'";
end if;
end loop;
Use_Input_File (Argument (Arg_Next));
if Arg_Next /= Argument_Count then
raise User_Error with "arg count" & Integer'Image (Argument_Count) &
" different from expected count" & Integer'Image (Arg_Next);
end if;
end;
begin
Grammar_Parser.Parse;
exception
when WisiToken.Syntax_Error =>
Grammar_Parser.Put_Errors;
raise;
when E : WisiToken.Parse_Error =>
WisiToken.Generate.Put_Error (Ada.Exceptions.Exception_Message (E));
raise;
end;
declare
use all type Ada.Strings.Unbounded.Unbounded_String;
use Ada.Text_IO;
-- Create a .parse_table file unless verbosity > 0
Parse_Table_File : File_Type;
Generate_Set : Generate_Set_Access;
Multiple_Tuples : Boolean;
Lexer_Done : Lexer_Set := (others => False);
-- In general, all of the data in Generate_Utils.Generate_Data
-- depends on the generate tuple parameters. However, if
-- 'If_Lexer_Present' is false, then they don't depend on the lexer,
-- and if 'If_Parser_Present' is false, then they don't depend on the
-- Gen_Alg, except for the parser table. But it's not worth trying to
-- cache results in those cases; they only happen in test grammars,
-- which are small.
procedure Parse_Check
(Lexer : in Lexer_Type;
Parser : in Generate_Algorithm;
Phase : in WisiToken_Grammar_Runtime.Action_Phase)
is
use all type Ada.Containers.Count_Type;
use all type WisiToken_Grammar_Runtime.Action_Phase;
use all type WisiToken_Grammar_Runtime.Meta_Syntax;
begin
Input_Data.User_Parser := Parser;
Input_Data.User_Lexer := Lexer;
-- Specifying the parser and lexer can change the parsed grammar, due
-- to %if {parser | lexer}.
Input_Data.Reset; -- only resets Other data
Input_Data.Phase := Phase;
Grammar_Parser.Execute_Actions;
case Phase is
when Meta =>
case Input_Data.Meta_Syntax is
when Unknown =>
Input_Data.Meta_Syntax := BNF_Syntax;
when BNF_Syntax =>
null;
when EBNF_Syntax =>
declare
Tree : WisiToken.Syntax_Trees.Tree renames Grammar_Parser.Parsers.First_State_Ref.Tree;
begin
if Trace_Generate > Outline then
Ada.Text_IO.Put_Line ("Translate EBNF tree to BNF");
end if;
if Trace_Generate > Detail then
Ada.Text_IO.Put_Line ("EBNF tree:");
Tree.Print_Tree (Wisitoken_Grammar_Actions.Descriptor);
Ada.Text_IO.New_Line;
end if;
WisiToken_Grammar_Runtime.Translate_EBNF_To_BNF (Tree, Input_Data);
if Trace_Generate > Detail then
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("BNF tree:");
Tree.Print_Tree (Wisitoken_Grammar_Actions.Descriptor);
end if;
if Output_BNF then
WisiToken_Grammar_Runtime.Print_Source (-BNF_File_Name, Tree, Input_Data);
end if;
if WisiToken.Generate.Error then
raise WisiToken.Grammar_Error with "errors during translating EBNF to BNF: aborting";
end if;
end;
end case;
when Other =>
if Input_Data.Rule_Count = 0 or Input_Data.Tokens.Rules.Length = 0 then
raise WisiToken.Grammar_Error with "no rules";
end if;
end case;
exception
when E : WisiToken.Syntax_Error | WisiToken.Parse_Error =>
Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, Ada.Exceptions.Exception_Message (E));
Grammar_Parser.Put_Errors;
raise;
end Parse_Check;
begin
-- Get the the input file quads, translate EBNF
Parse_Check (None, None, WisiToken_Grammar_Runtime.Meta);
if Command_Generate_Set = null then
if Input_Data.Generate_Set = null then
raise User_Error with
WisiToken.Generate.Error_Message
(Input_Data.Grammar_Lexer.File_Name, 1,
"generate algorithm, output_language, lexer, interface not specified");
end if;
Generate_Set := Input_Data.Generate_Set;
else
Generate_Set := Command_Generate_Set;
end if;
Multiple_Tuples := Generate_Set'Length > 1;
for Tuple of Generate_Set.all loop
Parse_Check
(Lexer => Tuple.Lexer,
Parser => Tuple.Gen_Alg,
Phase => WisiToken_Grammar_Runtime.Other);
declare
use Ada.Real_Time;
Time_Start : Time;
Time_End : Time;
Generate_Data : aliased WisiToken.BNF.Generate_Utils.Generate_Data :=
WisiToken.BNF.Generate_Utils.Initialize (Input_Data, Ignore_Conflicts);
Packrat_Data : WisiToken.Generate.Packrat.Data
(Generate_Data.Descriptor.First_Terminal, Generate_Data.Descriptor.First_Nonterminal,
Generate_Data.Descriptor.Last_Nonterminal);
Do_Parse_Table_File : constant Boolean := WisiToken.Trace_Generate = 0 and
Tuple.Gen_Alg in LALR .. Packrat_Proc;
begin
if not Lexer_Done (Input_Data.User_Lexer) then
Lexer_Done (Input_Data.User_Lexer) := True;
case Input_Data.User_Lexer is
when re2c_Lexer =>
WisiToken.BNF.Output_Ada_Common.Create_re2c
(Input_Data, Tuple, Generate_Data, -Output_File_Name_Root);
when others =>
null;
end case;
end if;
if Do_Parse_Table_File then
Create
(Parse_Table_File, Out_File,
-Output_File_Name_Root & "_" & To_Lower (Generate_Algorithm'Image (Tuple.Gen_Alg)) &
(if Input_Data.If_Lexer_Present
then "_" & Lexer_Image (Input_Data.User_Lexer).all
else "") &
".parse_table");
Set_Output (Parse_Table_File);
end if;
case Tuple.Gen_Alg is
when None =>
-- Just translate EBNF to BNF, done in Parse_Check
null;
when LALR =>
Time_Start := Clock;
Generate_Data.LR_Parse_Table := WisiToken.Generate.LR.LALR_Generate.Generate
(Generate_Data.Grammar,
Generate_Data.Descriptor.all,
Generate_Utils.To_Conflicts
(Generate_Data, Input_Data.Conflicts, Input_Data.Grammar_Lexer.File_Name),
Generate_Utils.To_McKenzie_Param (Generate_Data, Input_Data.McKenzie_Recover),
Put_Parse_Table => True,
Include_Extra => Test_Main,
Ignore_Conflicts => Ignore_Conflicts,
Partial_Recursion => Input_Data.Language_Params.Partial_Recursion);
if Do_Time then
Time_End := Clock;
Put_Line
(Standard_Error,
"LALR " & Lexer_Image (Tuple.Lexer).all & " generate time:" &
Duration'Image (To_Duration (Time_End - Time_Start)));
end if;
Generate_Data.Parser_State_Count :=
Generate_Data.LR_Parse_Table.State_Last - Generate_Data.LR_Parse_Table.State_First + 1;
WisiToken.BNF.Generate_Utils.Put_Stats (Input_Data, Generate_Data);
when LR1 =>
Time_Start := Clock;
Generate_Data.LR_Parse_Table := WisiToken.Generate.LR.LR1_Generate.Generate
(Generate_Data.Grammar,
Generate_Data.Descriptor.all,
Generate_Utils.To_Conflicts
(Generate_Data, Input_Data.Conflicts, Input_Data.Grammar_Lexer.File_Name),
Generate_Utils.To_McKenzie_Param (Generate_Data, Input_Data.McKenzie_Recover),
Put_Parse_Table => True,
Include_Extra => Test_Main,
Ignore_Conflicts => Ignore_Conflicts,
Partial_Recursion => Input_Data.Language_Params.Partial_Recursion);
if Do_Time then
Time_End := Clock;
Put_Line
(Standard_Error,
"LR1 " & Lexer_Image (Tuple.Lexer).all & " generate time:" &
Duration'Image (To_Duration (Time_End - Time_Start)));
end if;
Generate_Data.Parser_State_Count :=
Generate_Data.LR_Parse_Table.State_Last - Generate_Data.LR_Parse_Table.State_First + 1;
WisiToken.BNF.Generate_Utils.Put_Stats (Input_Data, Generate_Data);
when Packrat_Generate_Algorithm =>
-- The only significant computation done for Packrat is First, done
-- in Initialize; not worth timing.
Packrat_Data := WisiToken.Generate.Packrat.Initialize
(Input_Data.Grammar_Lexer.File_Name, Generate_Data.Grammar, Generate_Data.Source_Line_Map,
Generate_Data.Descriptor.First_Terminal);
Put_Line ("Tokens:");
WisiToken.Put_Tokens (Generate_Data.Descriptor.all);
New_Line;
Put_Line ("Productions:");
WisiToken.Productions.Put (Generate_Data.Grammar, Generate_Data.Descriptor.all);
Packrat_Data.Check_All (Generate_Data.Descriptor.all);
when External =>
null;
end case;
if Do_Parse_Table_File then
Set_Output (Standard_Output);
Close (Parse_Table_File);
end if;
if WisiToken.Generate.Error then
raise WisiToken.Grammar_Error with "errors: aborting";
end if;
case Tuple.Gen_Alg is
when LR_Generate_Algorithm =>
if Tuple.Text_Rep then
WisiToken.Generate.LR.Put_Text_Rep
(Generate_Data.LR_Parse_Table.all,
-Output_File_Name_Root & "_" &
To_Lower (Generate_Algorithm_Image (Tuple.Gen_Alg).all) &
"_parse_table.txt",
Generate_Data.Action_Names.all, Generate_Data.Check_Names.all);
end if;
when others =>
null;
end case;
if Tuple.Gen_Alg /= None then
case Tuple.Out_Lang is
when Ada_Lang =>
WisiToken.BNF.Output_Ada
(Input_Data, -Output_File_Name_Root, Generate_Data, Packrat_Data, Tuple, Test_Main,
Multiple_Tuples);
when Ada_Emacs_Lang =>
WisiToken.BNF.Output_Ada_Emacs
(Input_Data, -Output_File_Name_Root, Generate_Data, Packrat_Data, Tuple,
Test_Main, Multiple_Tuples, -Language_Name);
end case;
if WisiToken.Generate.Error then
raise WisiToken.Grammar_Error with "errors: aborting";
end if;
end if;
end;
end loop;
end;
exception
when WisiToken.Syntax_Error | WisiToken.Parse_Error =>
-- error message already output
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
when E : User_Error =>
declare
use Ada.Command_Line;
use Ada.Exceptions;
use Ada.Text_IO;
begin
Put_Line (Standard_Error, Exception_Message (E));
Put_Command_Line (Ada_Comment);
Set_Exit_Status (Failure);
Put_Usage;
end;
when E : WisiToken.Grammar_Error =>
-- error message not already output
declare
use Ada.Command_Line;
use Ada.Exceptions;
use Ada.Text_IO;
begin
Put_Line (Standard_Error, Exception_Message (E));
Set_Exit_Status (Failure);
end;
when E : others =>
-- IMPROVEME: for some exceptions, Error message already output via wisi.utils.Put_Error
declare
use Ada.Text_IO;
use Ada.Exceptions;
use Ada.Command_Line;
begin
Put_Line (Standard_Error, Exception_Name (E) & ": " & Exception_Message (E));
Put_Line (Standard_Error, GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
Set_Exit_Status (Failure);
end;
end WisiToken.BNF.Generate;
|
programs/oeis/314/A314038.asm | neoneye/loda | 22 | 80175 | <reponame>neoneye/loda
; A314038: Coordination sequence Gal.6.616.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,11,15,21,25,31,35,41,45,51,56,61,67,71,77,81,87,91,97,101,107,112,117,123,127,133,137,143,147,153,157,163,168,173,179,183,189,193,199,203,209,213,219,224,229,235,239,245,249
mov $5,$0
mul $0,6
mov $4,$0
sub $0,1
div $0,11
add $0,1
mov $2,$4
mul $2,2
div $2,22
add $2,$0
mov $1,$2
mov $3,$5
mul $3,4
add $1,$3
mov $0,$1
|
utilities/tt_patterns.ads | rocher/TTS-Runtime-Ravenscar | 2 | 21821 | with Ada.Real_Time;
with XAda.Dispatching.TTS;
generic
with package TTS is new XAda.Dispatching.TTS(<>);
package TT_Patterns is
type Task_State is abstract tagged record
Release_Time: Ada.Real_Time.Time := Ada.Real_Time.Time_First;
Work_Id : TTS.TT_Work_Id;
Sync_Id : TTS.TT_Sync_Id;
end record;
-- Simple Task State. Initialize + Main_Code
type Simple_Task_State is abstract new Task_State with null record;
procedure Initialize (S : in out Simple_Task_State) is abstract;
procedure Main_Code (S : in out Simple_Task_State) is abstract;
type Any_Simple_Task_State is access all Simple_Task_State'Class;
-- Initial_Final Task State. Initialize + Initial_Code + Final_Code
type Initial_Final_Task_State is abstract new Task_State with null record;
procedure Initialize (S : in out Initial_Final_Task_State) is abstract;
procedure Initial_Code (S : in out Initial_Final_Task_State) is abstract;
procedure Final_Code (S : in out Initial_Final_Task_State) is abstract;
type Any_Initial_Final_Task_State is access all Initial_Final_Task_State'Class;
-- Initial_Mandatory_Final Task State. Initialize + Initial_Code + Mandatory_Code + Final_Code
type Initial_Mandatory_Final_Task_State is abstract new Task_State with null record;
procedure Initialize (S : in out Initial_Mandatory_Final_Task_State) is abstract;
procedure Initial_Code (S : in out Initial_Mandatory_Final_Task_State) is abstract;
procedure Mandatory_Code (S : in out Initial_Mandatory_Final_Task_State) is abstract;
procedure Final_Code (S : in out Initial_Mandatory_Final_Task_State) is abstract;
type Any_Initial_Mandatory_Final_Task_State is access all Initial_Mandatory_Final_Task_State'Class;
-- Initial_OptionalFinal Task State. Initialize + (S)Initial_Code + [Condition] Final_Code
type Initial_OptionalFinal_Task_State is abstract new Task_State with null record;
procedure Initialize (S : in out Initial_OptionalFinal_Task_State) is abstract;
procedure Initial_Code (S : in out Initial_OptionalFinal_Task_State) is abstract;
function Final_Is_Required (S : in out Initial_OptionalFinal_Task_State) return Boolean is abstract;
procedure Final_Code (S : in out Initial_OptionalFinal_Task_State) is abstract;
type Any_Initial_OptionalFinal_Task_State is access all Initial_OptionalFinal_Task_State'Class;
-------------------------------
-- SIMPLE TT TASK --
-- --
-- Requires 1 slot per job --
-------------------------------
task type Simple_TT_Task
(Work_Id : TTS.TT_Work_Id;
Task_State : Any_Simple_Task_State;
Synced_Init : Boolean);
---------------------------------
-- INITIAL-FINAL TT TASK --
-- --
-- Requires 2 slots per job, --
-- one for I, and one for F --
---------------------------------
task type Initial_Final_TT_Task
(Work_Id : TTS.TT_Work_Id;
Task_State : Any_Initial_Final_Task_State;
Synced_Init : Boolean);
----------------------------------------------------
-- INITIAL - MANDATORY (sliced) - FINAL TT TASK --
-- --
-- Requires 3 or more slots per job, --
-- for I, M(s) and F parts --
----------------------------------------------------
task type Initial_Mandatory_Final_TT_Task
(Work_Id : TTS.TT_Work_Id;
Task_State : Any_Initial_Mandatory_Final_Task_State;
Synced_Init : Boolean);
----------------------------------------------------
-- INITIAL and MANDATORY sliced - FINAL TT TASK --
-- --
-- Requires one slot for IMs, which starts the --
-- sliced part, then the sliced sequence --
-- ending with a terminal slot, and a slot for --
-- the F part --
----------------------------------------------------
task type InitialMandatorySliced_Final_TT_Task
(Work_Id : TTS.TT_Work_Id;
Task_State : Any_Initial_Mandatory_Final_Task_State;
Synced_Init : Boolean);
----------------------------------------------------
-- INITIAL - [FINAL] TT TASK --
-- --
-- Requires one slot for I, starting the --
-- initial part, then ending with an optional --
-- slot for the final part --
----------------------------------------------------
task type Initial_OptionalFinal_TT_Task
(Initial_Work_Id : TTS.TT_Work_Id;
Optional_Work_Id : TTS.TT_Work_Id;
Task_State : Any_Initial_OptionalFinal_Task_State;
Synced_Init : Boolean);
------------------------------------
-- SIMPLE SYNCED ET TASK --
-- --
-- Requires 1 sync slot per job --
------------------------------------
task type Simple_Synced_ET_Task
(Sync_Id : TTS.TT_Sync_Id;
Task_State : Any_Simple_Task_State;
Synced_Init : Boolean);
----------------------------------------------------
-- SYNC_INITIAL - [FINAL] ET TASK --
-- --
-- Requires one sync slot for starting the --
-- initial part (priority-based), then ending --
-- with an optional slot for the final part --
----------------------------------------------------
task type SyncedInitial_OptionalFinal_ET_Task
(Sync_Id : TTS.TT_Sync_Id;
Work_Id : TTS.TT_Work_Id;
Task_State : Any_Initial_OptionalFinal_Task_State;
Synced_Init : Boolean);
end TT_Patterns;
|
oeis/021/A021539.asm | neoneye/loda-programs | 11 | 92628 | <reponame>neoneye/loda-programs
; A021539: Decimal expansion of 1/535.
; Submitted by Jon Maiga
; 0,0,1,8,6,9,1,5,8,8,7,8,5,0,4,6,7,2,8,9,7,1,9,6,2,6,1,6,8,2,2,4,2,9,9,0,6,5,4,2,0,5,6,0,7,4,7,6,6,3,5,5,1,4,0,1,8,6,9,1,5,8,8,7,8,5,0,4,6,7,2,8,9,7,1,9,6,2,6,1,6,8,2,2,4,2,9,9,0,6,5,4,2,0,5,6,0,7,4
seq $0,199689 ; 8*10^n+1
div $0,428
mod $0,10
|
Assembler/AssemblyCode/RET.asm | KPU-RISC/KPU | 8 | 15168 | <reponame>KPU-RISC/KPU<filename>Assembler/AssemblyCode/RET.asm
; Initialize the stack pointer
MOV XL, 0xFF
MOV XH, 0xFF
MOV SP, X
MOV F, 11110000b
; Call a subroutine...
CALL :SUBROUTINE
MOV F, 10101010b
; Write register F to the Output Port
OUTB F
; Stops program execution
HLT
:SUBROUTINE
MOV F, 01010101b
RET |
programs/oeis/017/A017198.asm | neoneye/loda | 22 | 87443 | ; A017198: a(n) = (9*n + 3)^2.
; 9,144,441,900,1521,2304,3249,4356,5625,7056,8649,10404,12321,14400,16641,19044,21609,24336,27225,30276,33489,36864,40401,44100,47961,51984,56169,60516,65025,69696,74529,79524,84681,90000,95481,101124,106929,112896,119025,125316,131769,138384,145161,152100,159201,166464,173889,181476,189225,197136,205209,213444,221841,230400,239121,248004,257049,266256,275625,285156,294849,304704,314721,324900,335241,345744,356409,367236,378225,389376,400689,412164,423801,435600,447561,459684,471969,484416,497025,509796,522729,535824,549081,562500,576081,589824,603729,617796,632025,646416,660969,675684,690561,705600,720801,736164,751689,767376,783225,799236
mul $0,9
add $0,3
pow $0,2
|
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_2948_71.asm | ljhsiun2/medusa | 9 | 82111 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1764c, %r11
clflush (%r11)
nop
nop
cmp $40913, %rbx
vmovups (%r11), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rsi
nop
nop
xor $11308, %rsi
lea addresses_WC_ht+0x1cd0c, %rcx
add %r11, %r11
mov $0x6162636465666768, %r12
movq %r12, (%rcx)
nop
add %r11, %r11
lea addresses_WC_ht+0xed56, %r12
clflush (%r12)
nop
sub $23821, %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm1
and $0xffffffffffffffc0, %r12
movntdq %xmm1, (%r12)
nop
nop
nop
sub %rbx, %rbx
lea addresses_D_ht+0xa90c, %rsi
nop
nop
nop
nop
nop
add $27883, %rbp
movb $0x61, (%rsi)
nop
nop
nop
nop
nop
sub $62598, %rsi
lea addresses_WC_ht+0x13c0c, %rbp
nop
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %r12
movq %r12, (%rbp)
and %rbx, %rbx
lea addresses_normal_ht+0x16fb4, %rbx
clflush (%rbx)
nop
nop
nop
xor $12907, %r11
movw $0x6162, (%rbx)
nop
nop
nop
nop
nop
inc %r12
lea addresses_normal_ht+0x92, %rcx
nop
nop
nop
nop
xor $54761, %rsi
mov (%rcx), %bp
nop
cmp %rcx, %rcx
lea addresses_normal_ht+0xb5b4, %rdx
nop
nop
nop
nop
nop
add %rbp, %rbp
mov (%rdx), %r11
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x18bc8, %rcx
nop
nop
nop
nop
nop
sub %rsi, %rsi
mov (%rcx), %r11w
nop
nop
and $26472, %rbx
lea addresses_UC_ht+0xaa0c, %rsi
lea addresses_WT_ht+0x620c, %rdi
nop
cmp %r11, %r11
mov $11, %rcx
rep movsw
sub %rdi, %rdi
lea addresses_WC_ht+0x7414, %r12
nop
nop
inc %r11
movw $0x6162, (%r12)
cmp %rcx, %rcx
lea addresses_WC_ht+0x11d0c, %rdx
clflush (%rdx)
nop
nop
nop
add %rdi, %rdi
vmovups (%rdx), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rsi
nop
dec %rbx
lea addresses_WT_ht+0x1550c, %rsi
nop
nop
nop
nop
add %rcx, %rcx
movb (%rsi), %r12b
nop
nop
and $54168, %r12
lea addresses_WC_ht+0x2734, %rsi
cmp %rcx, %rcx
mov (%rsi), %rbx
nop
nop
and %rbp, %rbp
lea addresses_UC_ht+0x1e30c, %rsi
lea addresses_WC_ht+0xcf0c, %rdi
nop
nop
xor $46766, %r12
mov $76, %rcx
rep movsl
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %r9
push %rax
push %rbx
// Store
lea addresses_RW+0x3ebc, %r9
nop
nop
cmp $63485, %r10
movb $0x51, (%r9)
// Exception!!!
nop
nop
nop
nop
mov (0), %r10
nop
xor $38892, %r12
// Faulty Load
mov $0x257ff3000000070c, %r10
nop
nop
nop
nop
and %rax, %rax
mov (%r10), %r13d
lea oracles, %r12
and $0xff, %r13
shlq $12, %r13
mov (%r12,%r13,1), %r13
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'00': 2948}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
test/Fail/ShapeIrrelevantConstructor.agda | cruhland/agda | 1,989 | 14308 | <filename>test/Fail/ShapeIrrelevantConstructor.agda
-- Andreas, 2018-06-14, issue #2513, surviving shape-irrelevance annotations.
data Wrap (A : Set) : Set where
@shape-irrelevant wrap : A → Wrap A
|
apps/web-firmware/demo.asm | MasterQ32/spu-mark-ii | 13 | 85060 | .equ ROM_START, 0x0000
.equ SERIAL_PORT, 0x7FFE
.equ RAM_START, 0x8000
.org RAM_START
entry_point:
push message
.loop:
ld8 [i0:peek] [f:yes]
[ex:zero] jmp .done
st SERIAL_PORT
add 1
jmp .loop
.done:
pop ; remove 0 byte
pop ; remove address
ret ; return to bios
message:
.asciiz "Hello, World!\r\n" |
joystick.asm | bsutherland/c64lib | 1 | 9722 | <filename>joystick.asm
#importonce
#import "cia.asm"
// confusingly, joystick 1 is on port B
.const JOYSTICK1_PORT = CIA_PORT_B
.const JOYSTICK1_DDR = CIA_DDR_PORT_B
// joystick 2 is on port A
.const JOYSTICK2_PORT = CIA_PORT_A
.const JOYSTICK2_DDR = CIA_DDR_PORT_A
// bitmasks for joystick switches
.const JOYSTICK_UP = $01
.const JOYSTICK_DOWN = $02
.const JOYSTICK_LEFT = $04
.const JOYSTICK_RIGHT = $08
.const JOYSTICK_FIRE = $10
.const JOYSTICK_MASK = $1f
|
src/flcagl.agda | shinji-kono/automaton-in-agda | 0 | 11316 | <gh_stars>0
{-# OPTIONS --sized-types #-}
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
module flcagl
(A : Set)
( _≟_ : (a b : A) → Dec ( a ≡ b ) ) where
open import Data.Bool hiding ( _≟_ )
-- open import Data.Maybe
open import Level renaming ( zero to Zero ; suc to succ )
open import Size
module List where
data List (i : Size) (A : Set) : Set where
[] : List i A
_∷_ : {j : Size< i} (x : A) (xs : List j A) → List i A
map : ∀{i A B} → (A → B) → List i A → List i B
map f [] = []
map f ( x ∷ xs)= f x ∷ map f xs
foldr : ∀{i} {A B : Set} → (A → B → B) → B → List i A → B
foldr c n [] = n
foldr c n (x ∷ xs) = c x (foldr c n xs)
any : ∀{i A} → (A → Bool) → List i A → Bool
any p xs = foldr _∨_ false (map p xs)
module Lang where
open List
record Lang (i : Size) : Set where
coinductive
field
ν : Bool
δ : ∀{j : Size< i} → A → Lang j
open Lang
_∋_ : ∀{i} → Lang i → List i A → Bool
l ∋ [] = ν l
l ∋ ( a ∷ as ) = δ l a ∋ as
trie : ∀{i} (f : List i A → Bool) → Lang i
ν (trie f) = f []
δ (trie f) a = trie (λ as → f (a ∷ as))
∅ : ∀{i} → Lang i
ν ∅ = false
δ ∅ x = ∅
ε : ∀{i} → Lang i
ν ε = true
δ ε x = ∅
open import Relation.Nullary.Decidable
char : ∀{i} (a : A) → Lang i
ν (char a) = false
δ (char a) x = if ⌊ a ≟ x ⌋ then ε else ∅
compl : ∀{i} (l : Lang i) → Lang i
ν (compl l) = not (ν l)
δ (compl l) x = compl (δ l x)
_∪_ : ∀{i} (k l : Lang i) → Lang i
ν (k ∪ l) = ν k ∨ ν l
δ (k ∪ l) x = δ k x ∪ δ l x
_·_ : ∀{i} (k l : Lang i) → Lang i
ν (k · l) = ν k ∧ ν l
δ (k · l) x = let k′l = δ k x · l in if ν k then k′l ∪ δ l x else k′l
_*_ : ∀{i} (k l : Lang i ) → Lang i
ν (k * l) = ν k ∧ ν l
δ (_*_ {i} k l) {j} x =
let
k′l : Lang j
k′l = _*_ {j} (δ k {j} x) l
in if ν k then _∪_ {j} k′l (δ l {j} x) else k′l
_* : ∀{i} (l : Lang i) → Lang i
ν (l *) = true
δ (l *) x = δ l x · (l *)
record _≅⟨_⟩≅_ (l : Lang ∞ ) i (k : Lang ∞) : Set where
coinductive
field ≅ν : ν l ≡ ν k
≅δ : ∀ {j : Size< i } (a : A ) → δ l a ≅⟨ j ⟩≅ δ k a
open _≅⟨_⟩≅_
≅refl : ∀{i} {l : Lang ∞} → l ≅⟨ i ⟩≅ l
≅ν ≅refl = refl
≅δ ≅refl a = ≅refl
≅sym : ∀{i} {k l : Lang ∞} (p : l ≅⟨ i ⟩≅ k) → k ≅⟨ i ⟩≅ l
≅ν (≅sym p) = sym (≅ν p)
≅δ (≅sym p) a = ≅sym (≅δ p a)
≅trans : ∀{i} {k l m : Lang ∞}
( p : k ≅⟨ i ⟩≅ l ) ( q : l ≅⟨ i ⟩≅ m ) → k ≅⟨ i ⟩≅ m
≅ν (≅trans p q) = trans (≅ν p) (≅ν q)
≅δ (≅trans p q) a = ≅trans (≅δ p a) (≅δ q a)
open import Relation.Binary
≅isEquivalence : ∀(i : Size) → IsEquivalence _≅⟨ i ⟩≅_
≅isEquivalence i = record { refl = ≅refl; sym = ≅sym; trans = ≅trans }
Bis : ∀(i : Size) → Setoid _ _
Setoid.Carrier (Bis i) = Lang ∞
Setoid._≈_ (Bis i) = _≅⟨ i ⟩≅_
Setoid.isEquivalence (Bis i) = ≅isEquivalence i
-- import Relation.Binary.EqReasoning as EqR
import Relation.Binary.Reasoning.Setoid as EqR
≅trans′ : ∀ i (k l m : Lang ∞)
( p : k ≅⟨ i ⟩≅ l ) ( q : l ≅⟨ i ⟩≅ m ) → k ≅⟨ i ⟩≅ m
≅trans′ i k l m p q = begin
k ≈⟨ p ⟩
l ≈⟨ q ⟩
m ∎ where open EqR (Bis i)
open import Data.Bool.Properties
union-assoc : ∀{i} (k {l m} : Lang ∞) → ((k ∪ l) ∪ m ) ≅⟨ i ⟩≅ ( k ∪ (l ∪ m) )
≅ν (union-assoc k) = ∨-assoc (ν k) _ _
≅δ (union-assoc k) a = union-assoc (δ k a)
union-comm : ∀{i} (l k : Lang ∞) → (l ∪ k ) ≅⟨ i ⟩≅ ( k ∪ l )
≅ν (union-comm l k) = ∨-comm (ν l) _
≅δ (union-comm l k) a = union-comm (δ l a) (δ k a)
union-idem : ∀{i} (l : Lang ∞) → (l ∪ l ) ≅⟨ i ⟩≅ l
≅ν (union-idem l) = ∨-idem _
≅δ (union-idem l) a = union-idem (δ l a)
union-emptyl : ∀{i}{l : Lang ∞} → (∅ ∪ l ) ≅⟨ i ⟩≅ l
≅ν union-emptyl = refl
≅δ union-emptyl a = union-emptyl
union-cong : ∀{i}{k k′ l l′ : Lang ∞}
(p : k ≅⟨ i ⟩≅ k′) (q : l ≅⟨ i ⟩≅ l′ ) → ( k ∪ l ) ≅⟨ i ⟩≅ ( k′ ∪ l′ )
≅ν (union-cong p q) = cong₂ _∨_ (≅ν p) (≅ν q)
≅δ (union-cong p q) a = union-cong (≅δ p a) (≅δ q a)
withExample : (P : Bool → Set) (p : P true) (q : P false) →
{A : Set} (g : A → Bool) (x : A) → P (g x)
withExample P p q g x with g x
... | true = p
... | false = q
rewriteExample : {A : Set} {P : A → Set} {x : A} (p : P x)
{g : A → A} (e : g x ≡ x) → P (g x)
rewriteExample p e rewrite e = p
infixr 6 _∪_
infixr 7 _·_
infix 5 _≅⟨_⟩≅_
union-congl : ∀{i}{k k′ l : Lang ∞}
(p : k ≅⟨ i ⟩≅ k′) → ( k ∪ l ) ≅⟨ i ⟩≅ ( k′ ∪ l )
union-congl eq = union-cong eq ≅refl
union-congr : ∀{i}{k l l′ : Lang ∞}
(p : l ≅⟨ i ⟩≅ l′) → ( k ∪ l ) ≅⟨ i ⟩≅ ( k ∪ l′ )
union-congr eq = union-cong ≅refl eq
union-swap24 : ∀{i} ({x y z w} : Lang ∞) → (x ∪ y) ∪ z ∪ w
≅⟨ i ⟩≅ (x ∪ z) ∪ y ∪ w
union-swap24 {_} {x} {y} {z} {w} = begin
(x ∪ y) ∪ z ∪ w
≈⟨ union-assoc x ⟩
x ∪ y ∪ z ∪ w
≈⟨ union-congr (≅sym ( union-assoc y)) ⟩
x ∪ ((y ∪ z) ∪ w)
≈⟨ ≅sym ( union-assoc x ) ⟩
(x ∪ ( y ∪ z)) ∪ w
≈⟨ union-congl (union-congr (union-comm y z )) ⟩
( x ∪ (z ∪ y)) ∪ w
≈⟨ union-congl (≅sym ( union-assoc x )) ⟩
((x ∪ z) ∪ y) ∪ w
≈⟨ union-assoc (x ∪ z) ⟩
(x ∪ z) ∪ y ∪ w
∎
where open EqR (Bis _)
concat-union-distribr : ∀{i} (k {l m} : Lang ∞) → k · ( l ∪ m ) ≅⟨ i ⟩≅ ( k · l ) ∪ ( k · m )
≅ν (concat-union-distribr k) = ∧-distribˡ-∨ (ν k) _ _
≅δ (concat-union-distribr k) a with ν k
≅δ (concat-union-distribr k {l} {m}) a | true = begin
δ k a · (l ∪ m) ∪ (δ l a ∪ δ m a)
≈⟨ union-congl (concat-union-distribr _) ⟩
(δ k a · l ∪ δ k a · m) ∪ (δ l a ∪ δ m a)
≈⟨ union-swap24 ⟩
(δ k a · l ∪ δ l a) ∪ (δ k a · m ∪ δ m a)
∎
where open EqR (Bis _)
≅δ (concat-union-distribr k) a | false = concat-union-distribr (δ k a)
concat-union-distribl : ∀{i} (k {l m} : Lang ∞) → ( k ∪ l ) · m ≅⟨ i ⟩≅ ( k · m ) ∪ ( l · m )
≅ν (concat-union-distribl k {l} {m}) = ∧-distribʳ-∨ _ (ν k) _
≅δ (concat-union-distribl k {l} {m}) a with ν k | ν l
≅δ (concat-union-distribl k {l} {m}) a | false | false = concat-union-distribl (δ k a)
≅δ (concat-union-distribl k {l} {m}) a | false | true = begin
(if false ∨ true then (δ k a ∪ δ l a) · m ∪ δ m a else (δ k a ∪ δ l a) · m)
≈⟨ ≅refl ⟩
((δ k a ∪ δ l a) · m ) ∪ δ m a
≈⟨ union-congl (concat-union-distribl _) ⟩
(δ k a · m ∪ δ l a · m) ∪ δ m a
≈⟨ union-assoc _ ⟩
(δ k a · m) ∪ ( δ l a · m ∪ δ m a )
≈⟨ ≅refl ⟩
(if false then δ k a · m ∪ δ m a else δ k a · m) ∪ (if true then δ l a · m ∪ δ m a else δ l a · m)
∎
where open EqR (Bis _)
≅δ (concat-union-distribl k {l} {m}) a | true | false = begin
(if true ∨ false then (δ k a ∪ δ l a) · m ∪ δ m a else (δ k a ∪ δ l a) · m) ≈⟨ ≅refl ⟩
((δ k a ∪ δ l a) · m ) ∪ δ m a ≈⟨ union-congl (concat-union-distribl _) ⟩
(δ k a · m ∪ δ l a · m) ∪ δ m a ≈⟨ union-assoc _ ⟩
δ k a · m ∪ ( δ l a · m ∪ δ m a ) ≈⟨ union-congr ( union-comm _ _) ⟩
δ k a · m ∪ δ m a ∪ δ l a · m ≈⟨ ≅sym ( union-assoc _ ) ⟩
(δ k a · m ∪ δ m a) ∪ δ l a · m ≈⟨ ≅refl ⟩
((if true then δ k a · m ∪ δ m a else δ k a · m) ∪ (if false then δ l a · m ∪ δ m a else δ l a · m))
∎
where open EqR (Bis _)
≅δ (concat-union-distribl k {l} {m}) a | true | true = begin
(if true ∨ true then (δ k a ∪ δ l a) · m ∪ δ m a else (δ k a ∪ δ l a) · m) ≈⟨ ≅refl ⟩
(δ k a ∪ δ l a) · m ∪ δ m a ≈⟨ union-congl ( concat-union-distribl _ ) ⟩
(δ k a · m ∪ δ l a · m) ∪ δ m a ≈⟨ union-assoc _ ⟩
δ k a · m ∪ ( δ l a · m ∪ δ m a ) ≈⟨ ≅sym ( union-congr ( union-congr ( union-idem _ ) ) ) ⟩
δ k a · m ∪ ( δ l a · m ∪ (δ m a ∪ δ m a) ) ≈⟨ ≅sym ( union-congr ( union-assoc _ )) ⟩
δ k a · m ∪ ( (δ l a · m ∪ δ m a ) ∪ δ m a ) ≈⟨ union-congr ( union-congl ( union-comm _ _) ) ⟩
δ k a · m ∪ ( (δ m a ∪ δ l a · m ) ∪ δ m a ) ≈⟨ ≅sym ( union-assoc _ ) ⟩
( δ k a · m ∪ (δ m a ∪ δ l a · m )) ∪ δ m a ≈⟨ ≅sym ( union-congl ( union-assoc _ ) ) ⟩
((δ k a · m ∪ δ m a) ∪ δ l a · m) ∪ δ m a ≈⟨ union-assoc _ ⟩
(δ k a · m ∪ δ m a) ∪ δ l a · m ∪ δ m a ≈⟨ ≅refl ⟩
((if true then δ k a · m ∪ δ m a else δ k a · m) ∪ (if true then δ l a · m ∪ δ m a else δ l a · m))
∎
where open EqR (Bis _)
postulate
concat-emptyl : ∀{i} l → ∅ · l ≅⟨ i ⟩≅ ∅
concat-emptyr : ∀{i} l → l · ∅ ≅⟨ i ⟩≅ ∅
concat-unitl : ∀{i} l → ε · l ≅⟨ i ⟩≅ l
concat-unitr : ∀{i} l → l · ε ≅⟨ i ⟩≅ l
star-empty : ∀{i} → ∅ * ≅⟨ i ⟩≅ ε
concat-congl : ∀{i} {m l k : Lang ∞} → l ≅⟨ i ⟩≅ k → l · m ≅⟨ i ⟩≅ k · m
≅ν (concat-congl {i} {m} p ) = cong (λ x → x ∧ ( ν m )) ( ≅ν p )
≅δ (concat-congl {i} {m} {l} {k} p ) a with ν k | ν l | ≅ν p
≅δ (concat-congl {i} {m} {l} {k} p) a | false | false | refl = concat-congl (≅δ p a)
≅δ (concat-congl {i} {m} {l} {k} p) a | true | true | refl = union-congl (concat-congl (≅δ p a))
concat-congr : ∀{i} {m l k : Lang ∞} → l ≅⟨ i ⟩≅ k → m · l ≅⟨ i ⟩≅ m · k
≅ν (concat-congr {i} {m} {_} {k} p ) = cong (λ x → ( ν m ) ∧ x ) ( ≅ν p )
≅δ (concat-congr {i} {m} {l} {k} p ) a with ν m | ν k | ν l | ≅ν p
≅δ (concat-congr {i} {m} {l} {k} p) a | false | x | .x | refl = concat-congr p
≅δ (concat-congr {i} {m} {l} {k} p) a | true | x | .x | refl = union-cong (concat-congr p ) ( ≅δ p a )
concat-assoc : ∀{i} (k {l m} : Lang ∞) → (k · l) · m ≅⟨ i ⟩≅ k · (l · m)
≅ν (concat-assoc {i} k {l} {m} ) = ∧-assoc ( ν k ) ( ν l ) ( ν m )
≅δ (concat-assoc {i} k {l} {m} ) a with ν k
≅δ (concat-assoc {i} k {l} {m}) a | false = concat-assoc _
≅δ (concat-assoc {i} k {l} {m}) a | true with ν l
≅δ (concat-assoc {i} k {l} {m}) a | true | false = begin
( if false then (δ k a · l ∪ δ l a) · m ∪ δ m a else (δ k a · l ∪ δ l a) · m )
≈⟨ ≅refl ⟩
(δ k a · l ∪ δ l a) · m
≈⟨ concat-union-distribl _ ⟩
((δ k a · l) · m ) ∪ ( δ l a · m )
≈⟨ union-congl (concat-assoc _) ⟩
(δ k a · l · m ) ∪ ( δ l a · m )
≈⟨ ≅refl ⟩
δ k a · l · m ∪ (if false then δ l a · m ∪ δ m a else δ l a · m)
∎ where open EqR (Bis _)
≅δ (concat-assoc {i} k {l} {m}) a | true | true = begin
(if true then (δ k a · l ∪ δ l a) · m ∪ δ m a else (δ k a · l ∪ δ l a) · m)
≈⟨ ≅refl ⟩
((( δ k a · l ) ∪ δ l a) · m ) ∪ δ m a
≈⟨ union-congl (concat-union-distribl _ ) ⟩
((δ k a · l) · m ∪ ( δ l a · m )) ∪ δ m a
≈⟨ union-congl ( union-congl (concat-assoc _)) ⟩
(( δ k a · l · m ) ∪ ( δ l a · m )) ∪ δ m a
≈⟨ union-assoc _ ⟩
( δ k a · l · m ) ∪ ( ( δ l a · m ) ∪ δ m a )
≈⟨ ≅refl ⟩
δ k a · l · m ∪ (if true then δ l a · m ∪ δ m a else δ l a · m)
∎ where open EqR (Bis _)
star-concat-idem : ∀{i} (l : Lang ∞) → l * · l * ≅⟨ i ⟩≅ l *
≅ν (star-concat-idem l) = refl
≅δ (star-concat-idem l) a = begin
δ ((l *) · (l *)) a ≈⟨ union-congl (concat-assoc _) ⟩
δ l a · (l * · l *) ∪ δ l a · l * ≈⟨ union-congl (concat-congr (star-concat-idem _)) ⟩
δ l a · l * ∪ δ l a · l * ≈⟨ union-idem _ ⟩
δ (l *) a ∎ where open EqR (Bis _)
star-idem : ∀{i} (l : Lang ∞) → (l *) * ≅⟨ i ⟩≅ l *
≅ν (star-idem l) = refl
≅δ (star-idem l) a = begin
δ ((l *) *) a ≈⟨ concat-assoc (δ l a) ⟩
δ l a · ((l *) · ((l *) *)) ≈⟨ concat-congr ( concat-congr (star-idem l )) ⟩
δ l a · ((l *) · (l *)) ≈⟨ concat-congr (star-concat-idem l ) ⟩
δ l a · l *
∎ where open EqR (Bis _)
postulate
star-rec : ∀{i} (l : Lang ∞) → l * ≅⟨ i ⟩≅ ε ∪ (l · l *)
star-from-rec : ∀{i} (k {l m} : Lang ∞)
→ ν k ≡ false
→ l ≅⟨ i ⟩≅ k · l ∪ m
→ l ≅⟨ i ⟩≅ k * · m
≅ν (star-from-rec k n p) with ≅ν p
... | b rewrite n = b
≅δ (star-from-rec k {l} {m} n p) a with ≅δ p a
... | q rewrite n = begin
(δ l a)
≈⟨ q ⟩
δ k a · l ∪ δ m a
≈⟨ union-congl (concat-congr (star-from-rec k {l} {m} n p)) ⟩
(δ k a · (k * · m) ∪ δ m a)
≈⟨ union-congl (≅sym (concat-assoc _)) ⟩
(δ k a · (k *)) · m ∪ δ m a
∎ where open EqR (Bis _)
open List
record DA (S : Set) : Set where
field ν : (s : S) → Bool
δ : (s : S)(a : A) → S
νs : ∀{i} (ss : List.List i S) → Bool
νs ss = List.any ν ss
δs : ∀{i} (ss : List.List i S) (a : A) → List.List i S
δs ss a = List.map (λ s → δ s a) ss
open Lang
lang : ∀{i} {S} (da : DA S) (s : S) → Lang i
Lang.ν (lang da s) = DA.ν da s
Lang.δ (lang da s) a = lang da (DA.δ da s a)
open import Data.Unit hiding ( _≟_ )
open DA
∅A : DA ⊤
ν ∅A s = false
δ ∅A s a = s
εA : DA Bool
ν εA b = b
δ εA b a = false
open import Relation.Nullary.Decidable
data 3States : Set where
init acc err : 3States
charA : (a : A) → DA 3States
ν (charA a) init = false
ν (charA a) acc = true
ν (charA a) err = false
δ (charA a) init x =
if ⌊ a ≟ x ⌋ then acc else err
δ (charA a) acc x = err
δ (charA a) err x = err
complA : ∀{S} (da : DA S) → DA S
ν (complA da) s = not (ν da s)
δ (complA da) s a = δ da s a
open import Data.Product
_⊕_ : ∀{S1 S2} (da1 : DA S1) (da2 : DA S2) → DA (S1 × S2)
ν (da1 ⊕ da2) (s1 , s2) = ν da1 s1 ∨ ν da2 s2
δ (da1 ⊕ da2) (s1 , s2) a = δ da1 s1 a , δ da2 s2 a
powA : ∀{S} (da : DA S) → DA (List ∞ S)
ν (powA da) ss = νs da ss
δ (powA da) ss a = δs da ss a
open _≅⟨_⟩≅_
powA-nil : ∀{i S} (da : DA S) → lang (powA da) [] ≅⟨ i ⟩≅ ∅
≅ν (powA-nil da) = refl
≅δ (powA-nil da) a = powA-nil da
powA-cons : ∀{i S} (da : DA S) {s : S} {ss : List ∞ S} →
lang (powA da) (s ∷ ss) ≅⟨ i ⟩≅ lang da s ∪ lang (powA da) ss
≅ν (powA-cons da) = refl
≅δ (powA-cons da) a = powA-cons da
composeA : ∀{S1 S2} (da1 : DA S1)(s2 : S2)(da2 : DA S2) → DA (S1 × List ∞ S2)
ν (composeA da1 s2 da2) (s1 , ss2) = (ν da1 s1 ∧ ν da2 s2) ∨ νs da2 ss2
δ (composeA da1 s2 da2) (s1 , ss2) a =
δ da1 s1 a , δs da2 (if ν da1 s1 then s2 ∷ ss2 else ss2) a
-- import Relation.Binary.EqReasoning as EqR
import Relation.Binary.Reasoning.Setoid as EqR
composeA-gen : ∀{i S1 S2} (da1 : DA S1) (da2 : DA S2) → ∀(s1 : S1)(s2 : S2)(ss : List ∞ S2) →
lang (composeA da1 s2 da2) (s1 , ss) ≅⟨ i ⟩≅ lang da1 s1 · lang da2 s2 ∪ lang (powA da2) ss
≅ν (composeA-gen da1 da2 s1 s2 ss) = refl
≅δ (composeA-gen da1 da2 s1 s2 ss) a with ν da1 s1
... | false = composeA-gen da1 da2 (δ da1 s1 a) s2 (δs da2 ss a)
... | true = begin
lang (composeA da1 s2 da2) (δ da1 s1 a , δ da2 s2 a ∷ δs da2 ss a)
≈⟨ composeA-gen da1 da2 (δ da1 s1 a) s2 (δs da2 (s2 ∷ ss) a) ⟩
lang da1 (δ da1 s1 a) · lang da2 s2 ∪ lang (powA da2) (δs da2 (s2 ∷ ss) a)
≈⟨ union-congr (powA-cons da2) ⟩
lang da1 (δ da1 s1 a) · lang da2 s2 ∪
(lang da2 (δ da2 s2 a) ∪ lang (powA da2) (δs da2 ss a))
≈⟨ ≅sym (union-assoc _) ⟩
(lang da1 (δ da1 s1 a) · lang da2 s2 ∪ lang da2 (δ da2 s2 a)) ∪ lang (powA da2) (δs da2 ss a)
∎ where open EqR (Bis _)
postulate
composeA-correct : ∀{i S1 S2} (da1 : DA S1) (da2 : DA S2) s1 s2 →
lang (composeA da1 s2 da2) (s1 , []) ≅⟨ i ⟩≅ lang da1 s1 · lang da2 s2
open import Data.Maybe
acceptingInitial : ∀{S} (s0 : S) (da : DA S) → DA (Maybe S)
ν (acceptingInitial s0 da) (just s) = ν da s
δ (acceptingInitial s0 da) (just s) a = just (δ da s a)
ν (acceptingInitial s0 da) nothing = true
δ (acceptingInitial s0 da) nothing a = just (δ da s0 a)
finalToInitial : ∀{S} (da : DA (Maybe S)) → DA (List ∞ (Maybe S))
ν (finalToInitial da) ss = νs da ss
δ (finalToInitial da) ss a =
let ss′ = δs da ss a
in if νs da ss then δ da nothing a ∷ ss′ else ss′
starA : ∀{S}(s0 : S)(da : DA S) → DA (List ∞(Maybe S))
starA s0 da = finalToInitial (acceptingInitial s0 da)
postulate
acceptingInitial-just : ∀{i S} (s0 : S) (da : DA S) {s : S} →
lang (acceptingInitial s0 da) (just s) ≅⟨ i ⟩≅ lang da s
acceptingInitial-nothing : ∀{i S} (s0 : S) (da : DA S) →
lang (acceptingInitial s0 da) nothing ≅⟨ i ⟩≅ ε ∪ lang da s0
starA-lemma : ∀{i S}(da : DA S)(s0 : S)(ss : List ∞ (Maybe S))→
lang (starA s0 da) ss ≅⟨ i ⟩≅
lang (powA (acceptingInitial s0 da)) ss · (lang da s0) *
starA-correct : ∀{i S} (da : DA S) (s0 : S) →
lang (starA s0 da) (nothing ∷ []) ≅⟨ i ⟩≅ (lang da s0) *
record NAutomaton ( Q : Set ) ( Σ : Set )
: Set where
field
Nδ : Q → Σ → Q → Bool
Nstart : Q → Bool
Nend : Q → Bool
postulate
exists : { S : Set} → ( S → Bool ) → Bool
nlang : ∀{i} {S} (nfa : NAutomaton S A ) (s : S → Bool ) → Lang i
Lang.ν (nlang nfa s) = exists ( λ x → (s x ∧ NAutomaton.Nend nfa x ))
Lang.δ (nlang nfa s) a = nlang nfa (λ x → s x ∧ (NAutomaton.Nδ nfa x a) x)
nlang1 : ∀{i} {S} (nfa : NAutomaton S A ) (s : S → Bool ) → Lang i
Lang.ν (nlang1 nfa s) = NAutomaton.Nend nfa {!!}
Lang.δ (nlang1 nfa s) a = nlang1 nfa (λ x → s x ∧ (NAutomaton.Nδ nfa x a) x)
-- nlang' : ∀{i} {S} (nfa : DA (S → Bool) ) (s : S → Bool ) → Lang i
-- Lang.ν (nlang' nfa s) = DA.ν nfa s
-- Lang.δ (nlang' nfa s) a = nlang' nfa (DA.δ nfa s a)
|
test/asset/agda-stdlib-1.0/Data/Maybe/Base.agda | omega12345/agda-mode | 0 | 11212 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- The Maybe type and some operations
------------------------------------------------------------------------
-- The definitions in this file are reexported by Data.Maybe.
{-# OPTIONS --without-K --safe #-}
module Data.Maybe.Base where
open import Level
open import Data.Bool.Base using (Bool; true; false; not)
open import Data.Unit.Base using (⊤)
open import Data.These using (These; this; that; these)
open import Data.Product as Prod using (_×_; _,_)
open import Function
open import Relation.Nullary
------------------------------------------------------------------------
-- Definition
data Maybe {a} (A : Set a) : Set a where
just : (x : A) → Maybe A
nothing : Maybe A
------------------------------------------------------------------------
-- Some operations
boolToMaybe : Bool → Maybe ⊤
boolToMaybe true = just _
boolToMaybe false = nothing
is-just : ∀ {a} {A : Set a} → Maybe A → Bool
is-just (just _) = true
is-just nothing = false
is-nothing : ∀ {a} {A : Set a} → Maybe A → Bool
is-nothing = not ∘ is-just
decToMaybe : ∀ {a} {A : Set a} → Dec A → Maybe A
decToMaybe (yes x) = just x
decToMaybe (no _) = nothing
-- A dependent eliminator.
maybe : ∀ {a b} {A : Set a} {B : Maybe A → Set b} →
((x : A) → B (just x)) → B nothing → (x : Maybe A) → B x
maybe j n (just x) = j x
maybe j n nothing = n
-- A non-dependent eliminator.
maybe′ : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → B → Maybe A → B
maybe′ = maybe
-- A defaulting mechanism
fromMaybe : ∀ {a} {A : Set a} → A → Maybe A → A
fromMaybe = maybe′ id
-- A safe variant of "fromJust". If the value is nothing, then the
-- return type is the unit type.
module _ {a} {A : Set a} where
From-just : Maybe A → Set a
From-just (just _) = A
From-just nothing = Lift a ⊤
from-just : (x : Maybe A) → From-just x
from-just (just x) = x
from-just nothing = _
-- Functoriality: map.
map : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → Maybe A → Maybe B
map f = maybe (just ∘ f) nothing
-- Alternative: <∣>
_<∣>_ : ∀ {a} {A : Set a} → Maybe A → Maybe A → Maybe A
just x <∣> my = just x
nothing <∣> my = my
------------------------------------------------------------------------
-- Aligning and zipping
module _ {a b c} {A : Set a} {B : Set b} {C : Set c} where
alignWith : (These A B → C) → Maybe A → Maybe B → Maybe C
alignWith f (just a) (just b) = just (f (these a b))
alignWith f (just a) nothing = just (f (this a))
alignWith f nothing (just b) = just (f (that b))
alignWith f nothing nothing = nothing
zipWith : (A → B → C) → Maybe A → Maybe B → Maybe C
zipWith f (just a) (just b) = just (f a b)
zipWith _ _ _ = nothing
module _ {a b} {A : Set a} {B : Set b} where
align : Maybe A → Maybe B → Maybe (These A B)
align = alignWith id
zip : Maybe A → Maybe B → Maybe (A × B)
zip = zipWith _,_
module _ {a b} {A : Set a} {B : Set b} where
-- Injections.
thisM : A → Maybe B → These A B
thisM a = maybe′ (these a) (this a)
thatM : Maybe A → B → These A B
thatM = maybe′ these that
|
Prob1asm_delay10ms/Prob1asm_delay10ms.asm | sachinraghav2/AVR | 2 | 91353 | ; ******************************************************
;Prob 4.1.........Write a delay subroutine to give an exact delay of 10ms using Timer 1 .(Test by outputting 0x55 and 0xaa alternately on the LED's using port B).or AVR
; ******************************************************
.include "C:\VMLAB\include\m8def.inc"
reset:
rjmp start
reti ; Addr $01
reti ; Addr $02
reti ; Addr $03
reti ; Addr $04
reti ; Addr $05
reti ; Addr $06 Use 'rjmp myVector'
reti ; Addr $07 to define a interrupt vector
reti ; Addr $08
reti ; Addr $09
reti ; Addr $0A
reti ; Addr $0B This is just an example
reti ; Addr $0C Not all MCUs have the same
reti ; Addr $0D number of interrupt vectors
reti ; Addr $0E
reti ; Addr $0F
reti ; Addr $10
; Program starts here after Reset
start:
ldi r20, high(RAMEND)
out SPH,r20
ldi r20,low(RAMEND)
out SPL,r20
ldi r16,0x01
out DDRD,r16
forever:
ldi r16,0XFF
out PORTD,r16
call delay
ldi r16,0x00
out PORTD,r16
call delay
rjmp forever
Delay:
ldi r20,0xFB
out TCNT1H,r20
ldi r20,0x1D
out TCNT1L,r20
ldi r20,0x00
out TCCR1A,r20
ldi r20,0x03
out TCCR1B,r20
AGAIN:
IN R20,TIFR
SBRS R20,TOV1
RJMP AGAIN
LDI R20,0X00
OUT TCCR1B,R20
LDI R20,0X04
OUT TIFR,R20
RET
|
examples/Sized/CounterCell.agda | agda/ooAgda | 23 | 17157 | module Sized.CounterCell where
open import Data.Product
open import Data.Nat.Base
open import Data.Nat.Show
open import Data.String.Base using (String; _++_)
open import SizedIO.Object
open import SizedIO.IOObject
open import SizedIO.Base
open import SizedIO.Console hiding (main)
open import SizedIO.ConsoleObject
open import NativeIO
open import Sized.SimpleCell hiding (program; main)
open import Size
data CounterMethod A : Set where
super : (m : CellMethod A) → CounterMethod A
stats : CounterMethod A
pattern getᶜ = super get
pattern putᶜ x = super (put x)
-- CounterResult : ∀{A} →
counterI : (A : Set) → Interface
Method (counterI A) = CounterMethod A
Result (counterI A) (super m) = Result (cellJ A) m
Result (counterI A) stats = Unit
CounterC : (i : Size) → Set
CounterC i = ConsoleObject i (counterI String)
-- counterP is constructor for the consoleObject for interface counterI
counterP : ∀{i} (c : CellC i) (ngets nputs : ℕ) → CounterC i
method (counterP c ngets nputs) getᶜ =
method c get >>= λ { (s , c') →
return (s , counterP c' (1 + ngets) nputs) }
method (counterP c ngets nputs) (putᶜ x) =
method c (put x) >>= λ { (_ , c') →
return (_ , counterP c' ngets (1 + nputs)) }
method (counterP c ngets nputs) stats =
exec (putStrLn ("Counted "
++ show ngets ++ " calls to get and "
++ show nputs ++ " calls to put.")) λ _ →
return (_ , counterP c ngets nputs)
program : String → IOConsole ∞ Unit
program arg =
let c₀ = counterP (cellP "Start") 0 0 in
method c₀ getᶜ >>= λ{ (s , c₁) →
exec1 (putStrLn s) >>
method c₁ (putᶜ arg) >>= λ{ (_ , c₂) →
method c₂ getᶜ >>= λ{ (s' , c₃) →
exec1 (putStrLn s') >>
method c₃ (putᶜ "Over!") >>= λ{ (_ , c₄) →
method c₄ stats >>= λ{ (_ , c₅) →
return _ }}}}}
main : NativeIO Unit
main = translateIOConsole (program "Hello")
-- -}
-- -}
-- -}
-- -}
-- -}
-- -}
-- -}
|
TotalRecognisers.agda | yurrriq/parser-combinators | 7 | 9808 | <gh_stars>1-10
------------------------------------------------------------------------
-- Total recognisers based on the same principles as the parsers in
-- TotalParserCombinators.Parser
--
-- <NAME>
------------------------------------------------------------------------
-- Recognisers are less complicated than parsers, and the following
-- code should (generally) be easier to follow than the code under
-- TotalParserCombinators.
module TotalRecognisers where
------------------------------------------------------------------------
-- Recognisers which do not support left recursion
-- Very simple recognisers, including a formal semantics and a proof
-- of decidability.
import TotalRecognisers.Simple
-- Proof showing that the set of languages accepted by these
-- recognisers is exactly the set of languages which can be decided by
-- Agda programs (when the alphabet is {true, false}).
import TotalRecognisers.Simple.ExpressiveStrength
-- An example: a right recursive expression grammar.
import TotalRecognisers.Simple.Expression
-- An alternative backend (without correctness proof).
import TotalRecognisers.Simple.AlternativeBackend
------------------------------------------------------------------------
-- Recognisers which do support left recursion
-- More complicated recognisers, which can handle left recursion. (The
-- set of basic combinators is also different: tok has been replaced
-- by sat, and nonempty and cast have been added.)
import TotalRecognisers.LeftRecursion
-- These recognisers have the same (maximal) expressive strength as
-- the simple ones, as long as the alphabet is finite. For infinite
-- alphabets it is shown that the expressive strength is not maximal.
import TotalRecognisers.LeftRecursion.ExpressiveStrength
-- A tiny library of derived combinators.
import TotalRecognisers.LeftRecursion.Lib
-- An example: a left recursive expression grammar.
import TotalRecognisers.LeftRecursion.Expression
-- An example of how nonempty can be used: parsing of matching
-- parentheses, along with a correctness proof.
import TotalRecognisers.LeftRecursion.MatchingParentheses
-- The recognisers form a *-continuous Kleene algebra.
import TotalRecognisers.LeftRecursion.KleeneAlgebra
-- A direct proof which shows that the context-sensitive language
-- { aⁿbⁿcⁿ | n ∈ ℕ } can be decided.
import TotalRecognisers.LeftRecursion.NotOnlyContextFree
|
Transynther/x86/_processed/NC/_ht_zr_/i7-8650U_0xd2_notsx.log_176_450.asm | ljhsiun2/medusa | 9 | 89877 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x6886, %rbp
nop
nop
nop
nop
inc %r10
mov (%rbp), %r12d
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_normal_ht+0x12392, %r9
cmp %rbp, %rbp
vmovups (%r9), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rdi
nop
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_normal_ht+0x32e2, %rsi
lea addresses_UC_ht+0x2192, %rdi
nop
nop
nop
and %r12, %r12
mov $103, %rcx
rep movsw
nop
nop
nop
and %r10, %r10
lea addresses_A_ht+0x11d2, %rsi
lea addresses_WT_ht+0x9cd2, %rdi
nop
nop
nop
nop
add $20817, %rbp
mov $41, %rcx
rep movsw
nop
nop
nop
xor $29286, %rdi
lea addresses_UC_ht+0xe4d2, %rsi
lea addresses_D_ht+0x1692, %rdi
nop
nop
nop
sub %r10, %r10
mov $105, %rcx
rep movsw
sub %r9, %r9
lea addresses_WT_ht+0x1a7d2, %r9
nop
nop
nop
nop
xor $45134, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm7
movups %xmm7, (%r9)
nop
nop
nop
nop
nop
add %r10, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r9
push %rbp
push %rbx
push %rdi
push %rdx
// Store
lea addresses_D+0x82aa, %rbp
cmp %r9, %r9
movw $0x5152, (%rbp)
nop
nop
nop
nop
nop
xor %rbx, %rbx
// Store
lea addresses_UC+0xcb72, %rdi
nop
sub %rdx, %rdx
movw $0x5152, (%rdi)
nop
nop
nop
nop
nop
cmp $47159, %rbx
// Store
lea addresses_normal+0xf932, %rdi
nop
nop
nop
nop
nop
and $18656, %rbx
movw $0x5152, (%rdi)
nop
nop
cmp $34716, %rdx
// Store
lea addresses_D+0x165d2, %r9
nop
nop
sub %r15, %r15
movb $0x51, (%r9)
xor %r9, %r9
// Load
lea addresses_US+0xf9b2, %rbx
nop
nop
sub %r15, %r15
movb (%rbx), %dl
nop
sub $12316, %rdx
// Store
lea addresses_WT+0xcfd2, %rdx
nop
nop
nop
add %rbx, %rbx
movw $0x5152, (%rdx)
nop
nop
nop
nop
xor $54092, %r9
// Load
lea addresses_PSE+0x34d2, %rbx
sub $17818, %rdi
mov (%rbx), %r9w
nop
cmp %rbp, %rbp
// Store
lea addresses_WT+0x106d2, %rbx
nop
nop
nop
nop
nop
cmp $52232, %r15
mov $0x5152535455565758, %rbp
movq %rbp, %xmm6
vmovups %ymm6, (%rbx)
// Exception!!!
nop
nop
nop
mov (0), %r9
nop
nop
nop
nop
xor %r9, %r9
// Store
lea addresses_WT+0x18312, %rdx
nop
add $27013, %r11
movb $0x51, (%rdx)
nop
nop
sub $28448, %r11
// Faulty Load
mov $0x7d98200000004d2, %r11
nop
nop
nop
and %rbx, %rbx
vmovups (%r11), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rbp
lea oracles, %rdi
and $0xff, %rbp
shlq $12, %rbp
mov (%rdi,%rbp,1), %rbp
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'44': 174, '00': 2}
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 00 00 44 44 44 44 44 44
*/
|
programs/oeis/264/A264147.asm | neoneye/loda | 22 | 81154 | <reponame>neoneye/loda
; A264147: a(n) = n*F(n+1) - (n+1)*F(n), where F = A000045.
; 0,-1,1,1,5,10,22,43,83,155,285,516,924,1639,2885,5045,8773,15182,26162,44915,76855,131119,223101,378696,641400,1084175,1829257,3081193,5181893,8702290,14594830,24446971,40902299,68359619,114132765,190373580,317258388,528265207,878908877,1461192605,2427505285,4030120214,6686451626,11086820291,18372346495,30428489815,50369233917,83335444368,137810796528,227790079775,376350833425,621534709201,1026029295749,1693101554074,2792812152070,4605132557515,7590844863203,12508096425707,20603960447517,33929195036820,55855312806540,91923803329159,151240568943701,248765120566661,409067890612165,672495960574430,1105289001684002,1816173062151443,2983575314225863,4900249726660735,8046439641560445,13209805319178456,21681975512370024,35580627334136879,58377179900726425,95761230791671225,157056411303425093,257539066262931682,422234902345219582,692134817554849435,1134369993625629995,1858865933852738579,3045597323876188701,4989185776799006556,8171867016143094660,13382859227480079895,21913616593629052637,35877172605652989293,58730376333831776773,96127832858578357670,157318080246053460890,257426068077368736611,421184174349802441999,689030423426288341159,1127074804801588190205,1843385616252491100960,3014601016104191267808,4929407615431408915007,8059570209660438705697,13175960386291412689825
add $0,1
mov $2,$0
lpb $0
sub $0,1
sub $2,1
mov $1,$2
mov $2,$3
add $3,$1
lpe
mov $0,$1
|
models/tests/test04.als | transclosure/Amalgam | 4 | 3964 | <gh_stars>1-10
module tests/test
open util/ordering[Int] as ord
sig A {}
one sig A1,A2,A3 extends A {}
run {} for 0 expect 1
run {} for 1 expect 1
run {} for 2 expect 1
run {} for 3 expect 1
run {} for 4 expect 1
|
src/arch/cores/armv7-m/m4-scb.ads | PThierry/ewok-kernel | 0 | 29058 | <filename>src/arch/cores/armv7-m/m4-scb.ads<gh_stars>0
--
-- Copyright 2018 The wookey project team <<EMAIL>>
-- - <NAME>
-- - <NAME>
-- - <NAME>
-- - <NAME>
-- - <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 ada.unchecked_conversion;
with m4.layout;
package m4.scb
with spark_mode => on
is
------------------------------------------
-- Interrupt Control and State Register --
------------------------------------------
-- Provides software control of the NMI, PendSV, and SysTick exceptions, and
-- provides interrupt status information (ARMv7-M Arch. Ref. Manual, p.655).
type t_SCB_ICSR is record
VECTACTIVE : bits_9;
RETTOBASE : bit;
VECTPENDING : bits_10;
ISRPENDING : boolean;
PENDSTCLR : bit;
PENDSTSET : bit;
PENDSVCLR : bit;
PENDSVSET : bit;
NMIPENDSET : bit;
end record
with size => 32;
for t_SCB_ICSR use record
VECTACTIVE at 0 range 0 .. 8;
RETTOBASE at 0 range 11 .. 11;
VECTPENDING at 0 range 12 .. 21;
ISRPENDING at 0 range 22 .. 22;
PENDSTCLR at 0 range 25 .. 25;
PENDSTSET at 0 range 26 .. 26;
PENDSVCLR at 0 range 27 .. 27;
PENDSVSET at 0 range 28 .. 28;
NMIPENDSET at 0 range 31 .. 31;
end record;
------------------------------------------------------
-- Application interrupt and reset control register --
------------------------------------------------------
type t_SCB_AIRCR is record
VECTKEY : unsigned_16;
ENDIANESS : bit;
reserved_11_14 : bits_4;
PRIGROUP : bits_3;
reserved_3_7 : bits_5;
SYSRESETREQ : bit;
VECTCLRACTIVE : bit;
VECTRESET : bit;
end record
with size => 32;
for t_SCB_AIRCR use record
VECTKEY at 0 range 16 .. 31;
ENDIANESS at 0 range 15 .. 15;
reserved_11_14 at 0 range 11 .. 14;
PRIGROUP at 0 range 8 .. 10;
reserved_3_7 at 0 range 3 .. 7;
SYSRESETREQ at 0 range 2 .. 2;
VECTCLRACTIVE at 0 range 1 .. 1;
VECTRESET at 0 range 0 .. 0;
end record;
----------------------------------------------
-- Configuration and control register (CCR) --
----------------------------------------------
-- The CCR controls entry to Thread mode
type t_SCB_CCR is record
NONBASETHRDENA : boolean; -- If true, processor can enter Thread mode
-- from any level under the control of an
-- EXC_RETURN
USERSETMPEND : boolean;
UNALIGN_TRP : boolean;
DIV_0_TRP : boolean;
BFHFNMIGN : boolean;
STKALIGN : boolean;
end record
with size => 32;
for t_SCB_CCR use record
NONBASETHRDENA at 0 range 0 .. 0;
USERSETMPEND at 0 range 1 .. 1;
UNALIGN_TRP at 0 range 3 .. 3;
DIV_0_TRP at 0 range 4 .. 4;
BFHFNMIGN at 0 range 8 .. 8;
STKALIGN at 0 range 9 .. 9;
end record;
-----------------------------------------------
-- System handler priority registers (SHPRx) --
-----------------------------------------------
type t_priority is record
reserved : bits_4;
priority : bits_4;
end record
with pack, size => 8;
-- SHPR1
type t_SCB_SHPR1 is record
mem_fault : t_priority;
bus_fault : t_priority;
usage_fault : t_priority;
end record
with size => 32;
for t_SCB_SHPR1 use record
mem_fault at 0 range 0 .. 7;
bus_fault at 0 range 8 .. 15;
usage_fault at 0 range 16 .. 23;
end record;
-- SHPR2
type t_SCB_SHPR2 is record
svc_call : t_priority;
end record
with size => 32;
for t_SCB_SHPR2 use record
svc_call at 0 range 24 .. 31;
end record;
-- SHPR3
type t_SCB_SHPR3 is record
pendsv : t_priority;
systick : t_priority;
end record
with size => 32;
for t_SCB_SHPR3 use record
pendsv at 0 range 16 .. 23;
systick at 0 range 24 .. 31;
end record;
-----------------------------------------------
-- System Handler Control and State Register --
-----------------------------------------------
type t_SCB_SHCSR is record
MEMFAULTACT : boolean; -- MemManage exception active
BUSFAULTACT : boolean; -- BusFault exception active
reserved_3 : bit;
USGFAULTACT : boolean; -- UsageFault exception active
reserved_4_6 : bits_3;
SVCALLACT : boolean; -- SVCall active
MONITORACT : boolean; -- Debug monitor active
reserved_9 : bit;
PENDSVACT : boolean; -- PendSV exception active
SYSTICKACT : boolean; -- SysTick exception active
USGFAULTPENDED : boolean; -- UsageFault pending
MEMFAULTPENDED : boolean; -- MemManage pending
BUSFAULTPENDED : boolean; -- BusFault pending
SVCALLPENDED : boolean; -- SVCall pending
MEMFAULTENA : boolean; -- MemManage enable
BUSFAULTENA : boolean; -- BusFault enable
USGFAULTENA : boolean; -- UsageFault enable
end record
with size => 32;
for t_SCB_SHCSR use record
MEMFAULTACT at 0 range 0 .. 0;
BUSFAULTACT at 0 range 1 .. 1;
reserved_3 at 0 range 2 .. 2;
USGFAULTACT at 0 range 3 .. 3;
reserved_4_6 at 0 range 4 .. 6;
SVCALLACT at 0 range 7 .. 7;
MONITORACT at 0 range 8 .. 8;
reserved_9 at 0 range 9 .. 9;
PENDSVACT at 0 range 10 .. 10;
SYSTICKACT at 0 range 11 .. 11;
USGFAULTPENDED at 0 range 12 .. 12;
MEMFAULTPENDED at 0 range 13 .. 13;
BUSFAULTPENDED at 0 range 14 .. 14;
SVCALLPENDED at 0 range 15 .. 15;
MEMFAULTENA at 0 range 16 .. 16;
BUSFAULTENA at 0 range 17 .. 17;
USGFAULTENA at 0 range 18 .. 18;
end record;
----------------------------------------
-- Configurable Fault Status Register --
----------------------------------------
--
-- Memory Management Fault Status Register
--
type t_MMFSR is record
IACCVIOL : boolean;
DACCVIOL : boolean;
reserved_2 : bit;
MUNSTKERR : boolean;
MSTKERR : boolean;
MLSPERR : boolean;
reserved_6 : bit;
MMARVALID : boolean;
end record
with size => 8;
pragma pack (t_MMFSR);
--
-- Bus Fault Status Register
--
type t_BFSR is record
IBUSERR : boolean;
PRECISERR : boolean;
IMPRECISERR : boolean;
UNSTKERR : boolean;
STKERR : boolean;
LSPERR : boolean;
reserved_6 : bit;
BFARVALID : boolean;
end record
with size => 8;
pragma pack (t_BFSR);
--
-- Usage Fault Status Register
--
type t_UFSR is record
UNDEFINSTR : boolean;
INVSTATE : boolean;
INVPC : boolean;
NOCP : boolean;
UNALIGNED : boolean;
DIVBYZERO : boolean;
end record
with size => 16;
for t_UFSR use record
UNDEFINSTR at 0 range 0 .. 0;
INVSTATE at 0 range 1 .. 1;
INVPC at 0 range 2 .. 2;
NOCP at 0 range 3 .. 3;
UNALIGNED at 0 range 8 .. 8;
DIVBYZERO at 0 range 9 .. 9;
end record;
type t_SCB_CFSR is record
MMFSR : t_MMFSR;
BFSR : t_BFSR;
UFSR : t_UFSR;
end record
with size => 32;
function to_unsigned_32 is new ada.unchecked_conversion
(t_SCB_CFSR, unsigned_32);
--------------------------------
-- Hard fault status register --
--------------------------------
type t_SCB_HFSR is record
VECTTBL : boolean; -- Vector table hard fault
FORCED : boolean; -- Forced hard fault
DEBUG_VT : bit; -- Reserved for Debug use
end record
with size => 32;
for t_SCB_HFSR use record
VECTTBL at 0 range 1 .. 1;
FORCED at 0 range 30 .. 30;
DEBUG_VT at 0 range 31 .. 31;
end record;
--------------------------------------
-- MemManage Fault Address Register --
--------------------------------------
type t_SCB_MMFAR is record
ADDRESS : system_address;
end record
with size => 32;
--------------------
-- SCB peripheral --
--------------------
-- /!\ ACTLR register is not in the same record
type t_SCB_peripheral is record
ICSR : t_SCB_ICSR;
VTOR : system_address;
AIRCR : t_SCB_AIRCR;
CCR : t_SCB_CCR;
SHPR1 : t_SCB_SHPR1;
SHPR2 : t_SCB_SHPR2;
SHPR3 : t_SCB_SHPR3;
SHCSR : t_SCB_SHCSR;
CFSR : t_SCB_CFSR;
HFSR : t_SCB_HFSR;
MMFAR : t_SCB_MMFAR;
end record;
for t_SCB_peripheral use record
ICSR at 16#04# range 0 .. 31;
VTOR at 16#08# range 0 .. 31;
AIRCR at 16#0C# range 0 .. 31;
CCR at 16#14# range 0 .. 31;
SHPR1 at 16#18# range 0 .. 31;
SHPR2 at 16#1C# range 0 .. 31;
SHPR3 at 16#20# range 0 .. 31;
SHCSR at 16#24# range 0 .. 31;
CFSR at 16#28# range 0 .. 31;
HFSR at 16#2C# range 0 .. 31;
MMFAR at 16#34# range 0 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
SCB : t_SCB_peripheral
with
import,
volatile,
address => m4.layout.SCB_base2;
procedure reset;
end m4.scb;
|
programs/oeis/074/A074909.asm | neoneye/loda | 22 | 4049 | <filename>programs/oeis/074/A074909.asm
; A074909: Running sum of Pascal's triangle (A007318), or beheaded Pascal's triangle read by beheaded rows.
; 1,1,2,1,3,3,1,4,6,4,1,5,10,10,5,1,6,15,20,15,6,1,7,21,35,35,21,7,1,8,28,56,70,56,28,8,1,9,36,84,126,126,84,36,9,1,10,45,120,210,252,210,120,45,10,1,11,55,165,330,462,462,330,165,55,11,1,12,66,220,495,792,924,792,495,220,66,12,1,13,78,286,715,1287,1716,1716,1287,715,286,78,13,1,14,91,364,1001,2002,3003,3432,3003
lpb $0
add $1,1
mov $2,$0
trn $0,$1
lpe
bin $1,$2
mov $0,$1
|
oeis/167/A167353.asm | neoneye/loda-programs | 11 | 88018 | <filename>oeis/167/A167353.asm<gh_stars>10-100
; A167353: Totally multiplicative sequence with a(p) = (p+1)*(p+3) = p^2+4p+3 for prime p.
; Submitted by <NAME>
; 1,15,24,225,48,360,80,3375,576,720,168,5400,224,1200,1152,50625,360,8640,440,10800,1920,2520,624,81000,2304,3360,13824,18000,960,17280,1088,759375,4032,5400,3840,129600,1520,6600,5376,162000,1848,28800,2024,37800,27648,9360,2400,1215000,6400,34560,8640,50400,3024,207360,8064,270000,10560,14400,3720,259200,3968,16320,46080,11390625,10752,60480,4760,81000,14976,57600,5328,1944000,5624,22800,55296,99000,13440,80640,6560,2430000,331776,27720,7224,432000,17280,30360,23040,567000,8280,414720,17920
add $0,1
mov $1,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $6,$2
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
mov $5,1
lpb $0
dif $0,$2
add $2,1
mul $5,$2
mul $1,$5
add $5,2
mul $1,$5
mod $2,3
lpe
lpe
mov $0,$1
|
src/databases.ads | skordal/databases | 0 | 21654 | <reponame>skordal/databases<gh_stars>0
-- Databases - A simple database library for Ada applications
-- (c) <NAME> 2019 <<EMAIL>>
-- Report bugs and issues on <https://github.com/skordal/databases/issues>
-- vim:ts=3:sw=3:et:si:sta
with Ada.Unchecked_Deallocation;
with Interfaces;
package Databases is
pragma Preelaborate;
-- Exceptions:
Unspecified_Error : exception;
File_Error : exception;
IO_Error : exception;
Invalid_Column_Index : exception;
Invalid_Row_Index : exception;
-- SQL/database specific types:
type Sql_Integer is mod 2**64;
type Sql_Float is new Long_Float;
type Sql_Data_Array is array (Natural range <>) of aliased Interfaces.Unsigned_8;
-- Column data field:
type Column_Data is interface;
type Column_Data_Access is access Column_Data'Class;
-- Gets the value of a data field:
function Get_Value (This : in Column_Data) return Sql_Integer is abstract;
function Get_Value (This : in Column_Data) return Sql_Float is abstract;
function Get_Value (This : in Column_Data) return Sql_Data_Array is abstract;
function Get_Value (This : in COlumn_Data) return String is abstract;
-- Row data:
type Row_Data is interface;
type Row_Data_Access is access Row_Data'Class;
-- Gets the number of available columns:
function Get_Column_Count (This : in Row_Data) return Natural is abstract;
-- Gets the value of a column:
function Get_Column (This : in Row_Data; Index : in Positive) return Column_Data_Access is abstract;
-- Statement execution status:
type Statement_Execution_Status is (Success, Failure);
-- Statement result interface:
type Statement_Result is interface;
type Statement_Result_Access is access Statement_Result'Class;
-- Gets the data for a row of data:
function Get_Row (This : in Statement_Result; Row : in Positive) return Row_Data_Access is abstract;
-- Gets the result of executing a statement:
function Get_Status (This : in Statement_Result) return Statement_Execution_Status is abstract;
-- Gets the number of returned rows:
function Get_Returned_Row_Count (This : in Statement_Result) return Natural is abstract;
-- Prepared statement interface:
type Prepared_Statement is interface;
type Prepared_Statement_Access is access Prepared_Statement'Class;
-- Binds a value to a parameter in a prepared statement. This parameter index starts at 1.
procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Sql_Integer) is abstract;
procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Sql_Float) is abstract;
procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Boolean) is abstract;
procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in String) is abstract;
-- Clears all bound values from a prepared statement:
procedure Clear (This : in out Prepared_Statement) is abstract;
-- Resets a prepared statement so it can be executed again:
procedure Reset (This : in out Prepared_Statement) is abstract;
-- Executes a prepared statement:
function Execute (This : in out Prepared_Statement) return Statement_Result_Access is abstract;
function Execute (This : in out Prepared_Statement) return Statement_Execution_Status is abstract; -- Discards any results
-- Database interface:
type Database is limited interface;
type Database_Access is access Database'Class;
-- Closes an open database connection:
procedure Close (This : in out Database) is abstract;
-- Checks if a database connection is open:
function Is_Open (This : in Database) return Boolean is abstract;
-- Creates a prepared statement from an SQL statement:
function Prepare (This : in out Database; Statement : in String)
return Prepared_Statement_Access is abstract;
-- Functions for freeing the various object types:
procedure Free is new Ada.Unchecked_Deallocation
( Object => Database'Class, Name => Database_Access);
procedure Free is new Ada.Unchecked_Deallocation
( Object => Prepared_Statement'Class, Name => Prepared_Statement_Access);
procedure Free is new Ada.Unchecked_Deallocation
( Object => Statement_Result'Class, Name => Statement_Result_Access);
procedure Free is new Ada.Unchecked_Deallocation
( Object => Column_Data'Class, Name => Column_Data_Access);
procedure Free is new Ada.Unchecked_Deallocation
( Object => Row_Data'Class, Name => Row_Data_Access);
end Databases;
|
programs/oeis/139/A139615.asm | karttu/loda | 1 | 242745 | ; A139615: a(n) = 105*n + 15.
; 15,120,225,330,435,540,645,750,855,960,1065,1170,1275,1380,1485,1590,1695,1800,1905,2010,2115,2220,2325,2430,2535,2640,2745,2850,2955,3060,3165,3270,3375,3480,3585,3690,3795,3900,4005,4110,4215,4320,4425,4530,4635,4740,4845,4950,5055,5160,5265,5370,5475,5580,5685,5790,5895,6000,6105,6210,6315,6420,6525,6630,6735,6840,6945,7050,7155,7260,7365,7470,7575,7680,7785,7890,7995,8100,8205,8310,8415,8520,8625,8730,8835,8940,9045,9150,9255,9360,9465,9570,9675,9780,9885,9990,10095,10200,10305,10410,10515,10620,10725,10830,10935,11040,11145,11250,11355,11460,11565,11670,11775,11880,11985,12090,12195,12300,12405,12510,12615,12720,12825,12930,13035,13140,13245,13350,13455,13560,13665,13770,13875,13980,14085,14190,14295,14400,14505,14610,14715,14820,14925,15030,15135,15240,15345,15450,15555,15660,15765,15870,15975,16080,16185,16290,16395,16500,16605,16710,16815,16920,17025,17130,17235,17340,17445,17550,17655,17760,17865,17970,18075,18180,18285,18390,18495,18600,18705,18810,18915,19020,19125,19230,19335,19440,19545,19650,19755,19860,19965,20070,20175,20280,20385,20490,20595,20700,20805,20910,21015,21120,21225,21330,21435,21540,21645,21750,21855,21960,22065,22170,22275,22380,22485,22590,22695,22800,22905,23010,23115,23220,23325,23430,23535,23640,23745,23850,23955,24060,24165,24270,24375,24480,24585,24690,24795,24900,25005,25110,25215,25320,25425,25530,25635,25740,25845,25950,26055,26160
mov $1,$0
mul $1,105
add $1,15
|
P.agda | JacquesCarette/pi-dual | 14 | 6527 | <filename>P.agda
{-# OPTIONS --without-K #-}
module P where
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Relation.Binary.PropositionalEquality
------------------------------------------------------------------------------
-- For now, a groupoid is just a set
Groupoid : Set₁
Groupoid = Set
mutual
-- types
data B : Set where
ZERO : B
ONE : B
_+_ : B → B → B
_*_ : B → B → B
_~_ : {b : B} → ⟦ b ⟧ → ⟦ b ⟧ → B
-- values
⟦_⟧ : B → Groupoid
⟦ ZERO ⟧ = ⊥
⟦ ONE ⟧ = ⊤
⟦ b₁ + b₂ ⟧ = ⟦ b₁ ⟧ ⊎ ⟦ b₂ ⟧
⟦ b₁ * b₂ ⟧ = ⟦ b₁ ⟧ × ⟦ b₂ ⟧
⟦ v₁ ~ v₂ ⟧ = v₁ ≡ v₂
-- pointed types
data PB : Set where
POINTED : Σ B (λ b → ⟦ b ⟧) → PB
RECIP : PB → PB
-- lift B type constructors to pointed types
_++_ : PB → PB → PB
(POINTED (b₁ , v₁)) ++ (POINTED (b₂ , v₂)) = POINTED (b₁ + b₂ , inj₁ v₁)
_ ++ _ = {!!}
_**_ : PB → PB → PB
(POINTED (b₁ , v₁)) ** (POINTED (b₂ , v₂)) = POINTED (b₁ * b₂ , (v₁ , v₂))
_ ** _ = {!!}
-- All the pi combinators now work on pointed types
data _⟷_ : PB → PB → Set₁ where
swap⋆ : {pb₁ pb₂ : PB} → (pb₁ ** pb₂) ⟷ (pb₂ ** pb₁)
eta : {pb : PB} → POINTED (ONE , tt) ⟷ RECIP pb
-- induction principle to reason about identities; needed ???
ind : {b : B} →
(C : (v₁ v₂ : ⟦ b ⟧) → (p : ⟦ _~_ {b} v₁ v₂ ⟧) → Set) →
(c : (v : ⟦ b ⟧) → C v v refl) →
(v₁ v₂ : ⟦ b ⟧) → (p : ⟦ _~_ {b} v₁ v₂ ⟧) → C v₁ v₂ p
ind C c v .v refl = c v
-- Examples
Bool : B
Bool = ONE + ONE
false : ⟦ Bool ⟧
false = inj₁ tt
true : ⟦ Bool ⟧
true = inj₂ tt
pb1 : PB
pb1 = POINTED (Bool , false)
pb2 : PB
pb2 = POINTED (Bool , true)
FalseID : B
FalseID = _~_ {Bool} false false
pb3 : PB
pb3 = POINTED (FalseID , refl)
FalseID^2 : B
FalseID^2 = _~_ {FalseID} refl refl
pb4 : PB
pb4 = POINTED (FalseID^2 , refl)
------------------------------------------------------------------------------
|
test/Succeed/Issue222.agda | shlevy/agda | 1,989 | 16022 |
-- There were some serious bugs in the termination checker
-- which were hidden by the fact that it didn't go inside
-- records. They should be fixed now.
module Issue222 where
record R (A : Set) : Set where
module M (a : A) where
-- Bug.agda:4,17-18
-- Panic: unbound variable A
-- when checking that the expression A has type _5
|
src/ada-core/src/linted-kos.ads | mstewartgallus/linted | 0 | 14306 | <gh_stars>0
-- Copyright 2015,2016 <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;
with System;
with Libc.Sys.Types;
with Linted.Errors;
with Linted.Results;
package Linted.KOs is
pragma Preelaborate;
use type Interfaces.C.int;
subtype Valid_KO is Interfaces.C.int range -1 .. Interfaces.C.int'Last;
type KO is new Valid_KO with
Default_Value => -1;
Standard_Input : constant KO;
Standard_Output : constant KO;
Standard_Error : constant KO;
type Open_Flags is mod 2**32;
Read_Only : constant Open_Flags := 1;
Write_Only : constant Open_Flags := 2;
Read_Write : constant Open_Flags := 4;
package KO_Results is new Linted.Results (KO);
function Open
(Pathname : String;
Flags : Open_Flags) return KO_Results.Result with
Spark_Mode => Off;
function Close (Object : KO) return Errors.Error with
Spark_Mode => Off;
function Pread
(Object : KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Offset : Libc.Sys.Types.off_t;
Bytes_Read : out Interfaces.C.size_t) return Errors.Error with
Spark_Mode => Off;
private
Invalid : constant KO := -1;
Standard_Input : constant KO := 0;
Standard_Output : constant KO := 1;
Standard_Error : constant KO := 2;
end Linted.KOs;
|
oeis/006/A006152.asm | neoneye/loda-programs | 11 | 17436 | <reponame>neoneye/loda-programs
; A006152: Exponential generating function x*exp(x/(1-x)).
; Submitted by <NAME>
; 1,2,9,52,365,3006,28357,301064,3549177,45965530,648352001,9888877692,162112109029,2841669616982,53025262866045,1049180850990736,21937381717388657,483239096122434354,11184035897992673017,271287473871771163460,6881656485607798743261,182185366874848913979502,5024498372948847847451189,144111542172674220191169432,4291986813748642380761182825,132540945809371632049270556426,4238364943902600403876197998577,140174433368679079763743122719884,4789209304548979732019142449723477
mov $1,$0
add $0,1
seq $1,262 ; Number of "sets of lists": number of partitions of {1,...,n} into any number of lists, where a list means an ordered subset.
mul $1,$0
mov $0,$1
|
oeis/051/A051731.asm | neoneye/loda-programs | 11 | 6876 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A051731: Triangle read by rows: T(n,k) = 1 if k divides n, T(n,k) = 0 otherwise (for n >= 1 and 1 <= k <= n).
; Submitted by <NAME>
; 1,1,1,1,0,1,1,1,0,1,1,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,0,1,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0
seq $0,127446 ; Triangle T(n,k) = n*A051731(n,k) read by rows.
min $0,1
|
fclib/nes/runtime_init.asm | haramako/fc | 2 | 102959 | .export runtime_init
.include "_nes.s"
.segment "CODE"
runtime_init:
;; initialize hardwares
;; See: http://wiki.nesdev.com/w/index.php/Init_code
ldx #$40
stx $4017
ldx #0
stx $2000
stx $2001
stx $4010
;; wait for PPU worm-up
;; See: http://wiki.nesdev.com/w/index.php/PPU_power_up_state#Best_practice
ldx #4
@loop:
bit _nes_PPU_STAT
bpl @loop
dex
bne @loop
rts
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca.log_21829_1719.asm | ljhsiun2/medusa | 9 | 11482 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xc86d, %rsi
lea addresses_WC_ht+0x1a52d, %rdi
clflush (%rsi)
nop
nop
nop
and %rdx, %rdx
mov $62, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_WT_ht+0x182d, %rax
and %r14, %r14
mov (%rax), %r10
nop
nop
nop
add $65496, %rdi
lea addresses_WT_ht+0x1e39d, %rsi
lea addresses_WT_ht+0xee2d, %rdi
clflush (%rsi)
and $4836, %rax
mov $13, %rcx
rep movsq
nop
nop
nop
add %rax, %rax
lea addresses_D_ht+0x1612d, %rsi
lea addresses_WT_ht+0x7cd, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov $22, %rcx
rep movsb
nop
nop
nop
cmp $19358, %rdx
lea addresses_A_ht+0x6f2d, %rcx
nop
nop
nop
nop
and $51679, %rdi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
cmp $43537, %rsi
lea addresses_D_ht+0x692d, %rdi
clflush (%rdi)
nop
nop
nop
nop
xor %r10, %r10
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
sub %r10, %r10
lea addresses_normal_ht+0x412d, %rsi
lea addresses_UC_ht+0x1af2d, %rdi
nop
nop
nop
nop
dec %r15
mov $90, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $58656, %rsi
lea addresses_normal_ht+0x3f2d, %rax
clflush (%rax)
nop
cmp %r14, %r14
mov $0x6162636465666768, %rdx
movq %rdx, (%rax)
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_D_ht+0x164d, %rsi
lea addresses_WC_ht+0x1df2d, %rdi
clflush (%rdi)
nop
nop
nop
nop
xor $8194, %r10
mov $37, %rcx
rep movsw
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0xb56d, %rsi
lea addresses_A_ht+0x10e4d, %rdi
nop
cmp $19391, %rdx
mov $0, %rcx
rep movsb
nop
add $21686, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r9
push %rbp
push %rbx
// Faulty Load
lea addresses_PSE+0xf72d, %r12
clflush (%r12)
nop
nop
nop
dec %rbx
movntdqa (%r12), %xmm6
vpextrq $1, %xmm6, %r10
lea oracles, %rbx
and $0xff, %r10
shlq $12, %r10
mov (%rbx,%r10,1), %r10
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_A_ht', 'congruent': 4}}
{'44': 15202, '49': 696, '00': 2, '46': 5929}
46 44 46 44 46 44 44 46 44 44 46 44 44 44 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 46 44 44 46 44 44 46 44 49 44 46 44 44 46 44 44 46 44 44 44 44 46 44 44 49 44 44 44 46 44 44 46 44 44 44 46 44 44 46 44 44 44 44 49 44 44 44 44 44 44 44 46 44 44 49 44 44 44 46 44 44 44 44 44 44 44 49 44 44 46 44 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 46 44 44 44 44 44 44 44 46 44 46 44 46 44 44 46 44 49 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 44 44 49 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 46 44 44 46 44 44 46 44 46 44 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 44 44 46 44 46 44 44 46 44 46 44 44 44 44 44 44 44 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 44 44 44 46 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 44 44 44 46 44 46 44 49 44 44 46 44 44 44 44 44 46 44 44 44 44 46 44 44 44 44 44 46 44 46 44 44 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 44 44 44 44 44 44 46 44 44 46 44 44 49 44 44 44 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 46 44 46 44 44 46 44 44 44 46 44 44 44 44 44 44 44 49 44 46 44 46 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 49 44 44 46 44 44 46 44 46 44 44 44 44 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 44 44 44 46 44 46 44 44 44 44 46 44 44 44 44 46 44 44 44 44 44 44 44 44 46 44 44 46 44 44 44 44 44 46 44 44 49 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 44 44 44 46 44 49 44 44 46 44 44 44 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 44 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 46 44 44 44 46 44 49 44 44 49 44 44 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 44 44 44 44 44 44 46 44 44 46 44 44 49 44 44 49 44 44 46 44 44 46 44 44 46 44 44 46 44 44 44 44 44 46 44 44 46 44 46 44 44 44 44 46 44 44 46 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 46 44 44 44 46 44 44 44 44 44 44 44 44 46 44 46 44 44 44 44 44 44 44 46 44 44 49 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 46 44 44 44 44 46 44 44 46 44 44 46 44 44 46 44 46 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 46 44 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 49 44 44 44 46 44 44 44 44 44 46 44 46 44 46 44 44 44 44 44 46 44 44 46 44 44 49 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 44 46 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 46 44 44 46 44 44 46 44 44 46 44 44 49 44 44 44 46 44 44 46 44 44 44 46 44 44 44 44 44 44 44 44 46 44 44 46 44 46 44 44 46 44 44 46 44 44 49 44 44 44 46 44 46 44 46 44 44 46 44 44 49 44 44 49 44 44 44 44 44 46 44 44
*/
|
vendor/stdlib/src/Relation/Unary.agda | isabella232/Lemmachine | 56 | 7518 | <reponame>isabella232/Lemmachine
------------------------------------------------------------------------
-- Unary relations
------------------------------------------------------------------------
module Relation.Unary where
open import Data.Empty
open import Data.Function
open import Data.Unit
open import Data.Product
open import Data.Sum
open import Relation.Nullary
------------------------------------------------------------------------
-- Unary relations
Pred : Set → Set₁
Pred a = a → Set
------------------------------------------------------------------------
-- Unary relations can be seen as sets
-- I.e., they can be seen as subsets of the universe of discourse.
private
module Dummy {a : Set} -- The universe of discourse.
where
-- Set membership.
infix 4 _∈_ _∉_
_∈_ : a → Pred a → Set
x ∈ P = P x
_∉_ : a → Pred a → Set
x ∉ P = ¬ x ∈ P
-- The empty set.
∅ : Pred a
∅ = λ _ → ⊥
-- The property of being empty.
Empty : Pred a → Set
Empty P = ∀ x → x ∉ P
∅-Empty : Empty ∅
∅-Empty x ()
-- The universe, i.e. the subset containing all elements in a.
U : Pred a
U = λ _ → ⊤
-- The property of being universal.
Universal : Pred a → Set
Universal P = ∀ x → x ∈ P
U-Universal : Universal U
U-Universal = λ _ → _
-- Set complement.
∁ : Pred a → Pred a
∁ P = λ x → x ∉ P
∁∅-Universal : Universal (∁ ∅)
∁∅-Universal = λ x x∈∅ → x∈∅
∁U-Empty : Empty (∁ U)
∁U-Empty = λ x x∈∁U → x∈∁U _
-- P ⊆ Q means that P is a subset of Q. _⊆′_ is a variant of _⊆_.
infix 4 _⊆_ _⊇_ _⊆′_ _⊇′_
_⊆_ : Pred a → Pred a → Set
P ⊆ Q = ∀ {x} → x ∈ P → x ∈ Q
_⊆′_ : Pred a → Pred a → Set
P ⊆′ Q = ∀ x → x ∈ P → x ∈ Q
_⊇_ : Pred a → Pred a → Set
Q ⊇ P = P ⊆ Q
_⊇′_ : Pred a → Pred a → Set
Q ⊇′ P = P ⊆′ Q
∅-⊆ : (P : Pred a) → ∅ ⊆ P
∅-⊆ P ()
⊆-U : (P : Pred a) → P ⊆ U
⊆-U P _ = _
-- Set union.
infixl 6 _∪_
_∪_ : Pred a → Pred a → Pred a
P ∪ Q = λ x → x ∈ P ⊎ x ∈ Q
-- Set intersection.
infixl 7 _∩_
_∩_ : Pred a → Pred a → Pred a
P ∩ Q = λ x → x ∈ P × x ∈ Q
open Dummy public
------------------------------------------------------------------------
-- Unary relation combinators
infixr 2 _⟨×⟩_
infixr 1 _⟨⊎⟩_
infixr 0 _⟨→⟩_
_⟨×⟩_ : ∀ {A B} → Pred A → Pred B → Pred (A × B)
(P ⟨×⟩ Q) p = P (proj₁ p) × Q (proj₂ p)
_⟨⊎⟩_ : ∀ {A B} → Pred A → Pred B → Pred (A ⊎ B)
(P ⟨⊎⟩ Q) (inj₁ p) = P p
(P ⟨⊎⟩ Q) (inj₂ q) = Q q
_⟨→⟩_ : ∀ {A B} → Pred A → Pred B → Pred (A → B)
(P ⟨→⟩ Q) f = P ⊆ Q ∘₀ f
|
programs/oeis/187/A187949.asm | jmorken/loda | 1 | 83053 | <gh_stars>1-10
; A187949: Positions of 0 in A187948; complement of A187953.
; 2,5,10,13,15,18,23,26,31,34,36,39,44,47,49,52,57,60,65,68,70,73,78,81,86,89,91,94,99,102,104,107,112,115,120,123,125,128,133,136,138,141,146,149,154,157,159,162,167,170,175,178,180,183,188,191,193,196,201,204,209,212,214,217
mov $2,$0
add $2,1
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
cal $0,284620 ; {00->2}-transform of the infinite Fibonacci word A003849.
add $3,$0
pow $0,2
div $3,2
sub $0,$3
add $0,2
add $1,$0
bin $3,2
lpe
|
programs/oeis/174/A174928.asm | neoneye/loda | 22 | 24523 | <reponame>neoneye/loda<gh_stars>10-100
; A174928: Partial sums of A174927.
; 1,65,66,130,131,195,196,260,261,325,326,390,391,455,456,520,521,585,586,650,651,715,716,780,781,845,846,910,911,975,976,1040,1041,1105,1106,1170,1171,1235,1236,1300,1301,1365,1366,1430,1431,1495,1496,1560
mov $1,$0
mod $0,2
mov $2,$1
add $1,$0
mov $0,3
div $1,2
mul $1,7
mul $0,$1
mul $0,3
add $0,1
add $0,$2
|
agda/Esterel/Lang/CanFunction/MergePotentialRuleCan.agda | florence/esterel-calculus | 3 | 9196 | {-
The equivalent "goodness" of can w.r.t. the rmerge reduction.
The lemma proved in this file is
can-irr : ∀ {BV} {FV} θ₁ θ₂ q →
CorrectBinding q BV FV →
(distinct' (proj₁ FV) (proj₁ (Dom θ₂))) →
Can q θ₁ ≡ Can q (θ₁ ← θ₂)
That is, the result of the Can function will not change
provided that the program does not refer to any variables
in the new environment.
-}
module Esterel.Lang.CanFunction.MergePotentialRuleCan where
open import utility
open import Esterel.Lang
open import Esterel.Lang.Binding
open import Esterel.Lang.CanFunction
open import Esterel.Lang.CanFunction.Base
open import Esterel.Context
open import Esterel.Context.Properties
using (plug ; unplug)
open import Esterel.Environment as Env
using (Env ; Θ ; _←_ ; Dom ; module SigMap ; module ShrMap ; module VarMap)
open import Esterel.CompletionCode as Code
using () renaming (CompletionCode to Code)
open import Esterel.Variable.Signal as Signal
using (Signal ; _ₛ)
open import Esterel.Variable.Shared as SharedVar
using (SharedVar ; _ₛₕ)
open import Esterel.Variable.Sequential as SeqVar
using (SeqVar)
open import Data.Bool
using (Bool ; true ; false ; if_then_else_)
open import Data.Empty
using (⊥ ; ⊥-elim)
open import Data.List
using (List ; [] ; _∷_ ; _++_ ; map ; concatMap)
open import Data.List.Properties
using (map-id)
open import Data.List.Any
using (Any ; any ; here ; there)
open import Data.List.Any.Properties
using ()
renaming (++⁺ˡ to ++ˡ ; ++⁺ʳ to ++ʳ)
open import Data.Maybe
using (Maybe ; just ; nothing)
open import Data.Nat
using (ℕ ; zero ; suc ; _≟_ ; _+_)
open import Data.Nat.Properties.Simple
using (+-comm)
open import Data.Product
using (Σ ; proj₁ ; proj₂ ; ∃ ; _,_ ; _,′_ ; _×_)
open import Data.Sum
using (_⊎_ ; inj₁ ; inj₂)
open import Function
using (_∘_ ; _∋_ ; id)
open import Relation.Nullary
using (¬_ ; Dec ; yes ; no)
open import Relation.Nullary.Decidable
using (⌊_⌋)
open import Relation.Binary.PropositionalEquality
using (_≡_ ; refl ; trans ; sym ; cong ; subst)
open import Data.OrderedListMap Signal Signal.unwrap Signal.Status as SigM
open import Data.OrderedListMap SharedVar SharedVar.unwrap (Σ SharedVar.Status (λ _ → ℕ)) as ShrM
open import Data.OrderedListMap SeqVar SeqVar.unwrap ℕ as SeqM
open ListSet Data.Nat._≟_
using (set-subtract ; set-subtract-[] ; set-subtract-split ; set-subtract-merge
; set-subtract-notin
; set-remove-mono-∈ ; set-remove-removed ; set-remove-not-removed)
can-new-irr : ∀ {BV} {FV} θ₁ θ₂ θo q →
CorrectBinding q BV FV →
(∀ S' → S' ∈ (proj₁ FV) → (S' ∉ proj₁ (Dom θ₂)) ⊎ (S' ∈ proj₁ (Dom θo))) →
Can q (θ₁ ← θo) ≡ Can q ((θ₁ ← θ₂) ← θo)
canθ-new-irr : ∀ {BV} {FV} sigs S θ₁ θ₂ θo q →
CorrectBinding q BV FV →
(∀ S' → S' ∈ (proj₁ FV) →
((S' ∉ proj₁ (Dom θ₂)) ⊎ (S' ∈ proj₁ (Dom θo))) ⊎
S' ∈ map (_+_ S) (SigMap.keys sigs)) →
Canθ sigs S q (θ₁ ← θo) ≡ Canθ sigs S q ((θ₁ ← θ₂) ← θo)
can-new-irr θ₁ θ₂ θo nothin CBnothing S-prop = refl
can-new-irr θ₁ θ₂ θo pause CBpause S-prop = refl
can-new-irr θ₁ θ₂ θo (signl S q) (CBsig cbq) S-prop
rewrite canθ-new-irr (Env.sig ([S]-env S)) 0 θ₁ θ₂ θo q cbq
(λ S' S'∈FV →
Data.Sum.map
(S-prop S')
(subst (S' ∈_) (sym (map-id (proj₁ (Dom ([S]-env S))))) ∘
(λ S'∈[S] →
subst (_∈ proj₁ (Dom ([S]-env S)))
(sym (∈:: S'∈[S]))
(Env.sig-∈-single S Signal.unknown)))
(set-subtract-split {ys = Signal.unwrap S ∷ []} S'∈FV))
= refl
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent {FVp = FVp} cbp cbq) S-prop
with S-prop (Signal.unwrap S) (here refl)| Env.Sig∈ S (θ₁ ← θo) | Env.Sig∈ S ((θ₁ ← θ₂) ← θo)
... | inj₂ S∈Domθo | no S∉domθ₁←θo | S∈domθ₁←θ₂←θo? =
⊥-elim (S∉domθ₁←θo (Env.sig-←-monoʳ S θo θ₁ S∈Domθo))
... | inj₂ S∈Domθo | yes S∈domθ₁←θo | no S∉domθ₁←θ₂←θo =
⊥-elim (S∉domθ₁←θ₂←θo (Env.sig-←-monoʳ S θo (θ₁ ← θ₂) S∈Domθo))
... | inj₂ S∈Domθo | yes S∈domθ₁←θo | yes S∈domθ₁←θ₂←θo
rewrite SigMap.∈-get-U-irr-m S (Env.sig θ₁) (Env.sig (θ₁ ← θ₂)) (Env.sig θo)
S∈domθ₁←θo S∈domθ₁←θ₂←θo S∈Domθo
with Env.sig-stats {S} ((θ₁ ← θ₂) ← θo) S∈domθ₁←θ₂←θo
... | Signal.present = can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
... | Signal.absent = can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
... | Signal.unknown
rewrite can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
| can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent {FVp = FVp} cbp cbq) S-prop
| inj₁ S∉Domθ₂ | yes S∈domθ₁←θo | yes S∈domθ₁←θ₂←θo
with Env.sig-←⁻ {θ₁} {θo} S S∈domθ₁←θo
... | inj₂ S∈Domθo
rewrite SigMap.∈-get-U-irr-m S (Env.sig θ₁) (Env.sig (θ₁ ← θ₂)) (Env.sig θo)
S∈domθ₁←θo S∈domθ₁←θ₂←θo S∈Domθo
with Env.sig-stats {S} ((θ₁ ← θ₂) ← θo) S∈domθ₁←θ₂←θo
... | Signal.present = can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
... | Signal.absent = can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
... | Signal.unknown
rewrite can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
| can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent {FVp = FVp} cbp cbq) S-prop
| inj₁ S∉Domθ₂ | yes S∈domθ₁←θo | yes S∈domθ₁←θ₂←θo
| inj₁ S∈domθ₁ with Env.sig-←-irr-get {θ₁} {θ₂} {S} S∈domθ₁ S∉Domθ₂
... | a , b rewrite SigMap.get-U-both-irr-m S (Env.sig θ₁) (Env.sig (θ₁ ← θ₂)) (Env.sig θo) S∈domθ₁ a S∈domθ₁←θo S∈domθ₁←θ₂←θo b
with Env.sig-stats {S} ((θ₁ ← θ₂) ← θo) S∈domθ₁←θ₂←θo
... | Signal.present = can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
... | Signal.absent = can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
... | Signal.unknown
rewrite can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
| can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent cbp cbq) S-prop
| inj₁ S∉Domθ₂ | yes S∈domθ₁←θo | no S∉domθ₁←θ₂←θo
rewrite SigMap.keys-assoc-comm (Env.sig θ₁) (Env.sig θ₂) (Env.sig θo)
= ⊥-elim (S∉domθ₁←θ₂←θo (SigMap.U-mono {m = Env.sig (θ₁ ← θo)} {k = S} S∈domθ₁←θo))
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent cbp cbq) S-prop
| inj₁ S∉Domθ₂ | no S∉domθ₁←θo | yes S∈domθ₁←θ₂←θo
with Env.sig-←⁻ {θ₁ ← θo} {θ₂} S
(subst (Signal.unwrap S ∈_)
(SigMap.keys-assoc-comm (Env.sig θ₁) (Env.sig θ₂) (Env.sig θo))
S∈domθ₁←θ₂←θo)
... | (inj₁ S∈Domθ₁←θo) = ⊥-elim (S∉domθ₁←θo S∈Domθ₁←θo)
... | (inj₂ S∈Domθ₂) = ⊥-elim (S∉Domθ₂ S∈Domθ₂)
can-new-irr θ₁ θ₂ θo (present S ∣⇒ p ∣⇒ q) (CBpresent {FVp = FVp} cbp cbq) S-prop
| inj₁ S∉Domθ₂ | no S∉domθ₁←θo | no S∉domθ₁←θ₂←θo
rewrite can-new-irr θ₁ θ₂ θo p cbp
(λ S' S'∈FVp → S-prop S' (++ʳ (Signal.unwrap S ∷ []) (++ˡ S'∈FVp)))
| can-new-irr θ₁ θ₂ θo q cbq
(λ S' S'∈FVq → S-prop S' (++ʳ (Signal.unwrap S ∷ proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (emit S) CBemit S-prop = refl
can-new-irr θ₁ θ₂ θo (p ∥ q) (CBpar {FVp = FVp} cbp cbq BVp≠BVq FVp≠BVq BVp≠FVq Xp≠Xq) S-prop
rewrite can-new-irr θ₁ θ₂ θo p cbp (λ S' S'∈FVp → S-prop S' (++ˡ S'∈FVp))
| can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FVq → S-prop S' (++ʳ (proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (loop q) (CBloop cbq BV≠FV) S-prop =
can-new-irr θ₁ θ₂ θo q cbq S-prop
can-new-irr θ₁ θ₂ θo (loopˢ p q) (CBloopˢ {BVp = BVp} {FVp = FVp} CBp CBq BVp≠FVq BVq≠FVq) S-prop
rewrite can-new-irr θ₁ θ₂ θo p CBp (λ S' S'∈FVp → S-prop S' (++ˡ S'∈FVp))
| can-new-irr θ₁ θ₂ θo q CBq (λ S' S'∈FVq → S-prop S' (++ʳ (proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (p >> q) (CBseq {BVp = BVp} {FVp = FVp} cbp cbq BVp≠FVq) S-prop
with can-new-irr θ₁ θ₂ θo p cbp (λ S' S'∈FVp → S-prop S' (++ˡ S'∈FVp))
... | can-p-θ₁←θo≡can-p-θ₁←θ₂←θo
with any (Code._≟_ Code.nothin) (Canₖ p (θ₁ ← θo))
| any (Code._≟_ Code.nothin) (Canₖ p ((θ₁ ← θ₂) ← θo))
... | yes nothin∈can-p-θ₁←θo | yes nothin∈can-p-θ₁←θ₂←θo
rewrite can-p-θ₁←θo≡can-p-θ₁←θ₂←θo
| can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FVq → S-prop S' (++ʳ (proj₁ FVp) S'∈FVq))
= refl
... | yes nothin∈can-p-θ₁←θo | no nothin∉can-p-θ₁←θ₂←θo
= ⊥-elim (nothin∉can-p-θ₁←θ₂←θo
(subst (λ xs → Code.nothin ∈ proj₁ (proj₂ xs))
can-p-θ₁←θo≡can-p-θ₁←θ₂←θo
nothin∈can-p-θ₁←θo))
... | no nothin∉can-p-θ₁←θo | yes nothin∈can-p-θ₁←θ₂←θo
= ⊥-elim (nothin∉can-p-θ₁←θo
(subst (λ xs → Code.nothin ∈ proj₁ (proj₂ xs))
(sym can-p-θ₁←θo≡can-p-θ₁←θ₂←θo)
nothin∈can-p-θ₁←θ₂←θo))
... | no nothin∉can-p-θ₁←θo | no nothin∉can-p-θ₁←θ₂←θo
rewrite can-p-θ₁←θo≡can-p-θ₁←θ₂←θo = refl
can-new-irr θ₁ θ₂ θo (suspend q S) (CBsusp cbq [S]≠BVp) S-prop =
can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FV → S-prop S' (there S'∈FV))
can-new-irr θ₁ θ₂ θo (exit n) CBexit S-prop = refl
can-new-irr θ₁ θ₂ θo (trap q) (CBtrap cbq) S-prop
rewrite can-new-irr θ₁ θ₂ θo q cbq S-prop
= refl
can-new-irr θ₁ θ₂ θo (shared s ≔ e in: q) (CBshared {FV = FV} cbq) S-prop
rewrite set-subtract-[] (proj₁ FV)
| can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FV → S-prop S' (++ʳ (proj₁ (FVₑ e)) S'∈FV))
= refl
can-new-irr θ₁ θ₂ θo (s ⇐ e) CBsset S-prop = refl
can-new-irr θ₁ θ₂ θo (var x ≔ e in: q) (CBvar {FV = FV} cbq) S-prop
rewrite set-subtract-[] (proj₁ FV)
= can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FV → S-prop S' (++ʳ (proj₁ (FVₑ e)) S'∈FV))
can-new-irr θ₁ θ₂ θo (x ≔ e) CBvset S-prop = refl
can-new-irr θ₁ θ₂ θo (if x ∣⇒ p ∣⇒ q) (CBif {FVp = FVp} cbp cbq) S-prop
rewrite can-new-irr θ₁ θ₂ θo p cbp (λ S' S'∈FVp → S-prop S' (++ˡ S'∈FVp))
| can-new-irr θ₁ θ₂ θo q cbq (λ S' S'∈FVq → S-prop S' (++ʳ (proj₁ FVp) S'∈FVq))
= refl
can-new-irr θ₁ θ₂ θo (ρ⟨ θ , A ⟩· q) (CBρ {FV = FV} cbq) S-prop
rewrite canθ-new-irr (Env.sig θ) 0 θ₁ θ₂ θo q cbq
(λ S' S'∈FV →
Data.Sum.map
(S-prop S')
(subst (S' ∈_) (sym (map-id (proj₁ (Dom θ)))))
(set-subtract-split {ys = proj₁ (Dom θ)} S'∈FV))
= refl
canθ-new-irr-S-prop-accumulate : ∀ {xs ys zs} S status θo →
(∀ S' → S' ∈ xs →
(S' ∉ ys ⊎ S' ∈ proj₁ (Dom θo)) ⊎
S' ∈ (S + 0 ∷ map (_+_ S) (map suc zs))) →
∀ S' → S' ∈ xs →
(S' ∉ ys ⊎ S' ∈ proj₁ (Dom (θo ← [ (S ₛ) ↦ status ]))) ⊎
S' ∈ map (_+_ (suc S)) zs
canθ-new-irr-S-prop-accumulate {zs = zs} S status θo S-prop S' S'∈xs with S-prop S' S'∈xs
... | inj₁ (inj₁ S'∉ys) = inj₁ (inj₁ S'∉ys)
... | inj₁ (inj₂ S'∈Domθo) =
inj₁ (inj₂ (Env.sig-←-monoˡ (S' ₛ) θo [ (S ₛ) ↦ status ] S'∈Domθo))
... | inj₂ (here refl) rewrite +-comm S 0 =
inj₁ (inj₂ (Env.sig-←-monoʳ (S ₛ) [ S ₛ ↦ status ] θo (Env.sig-∈-single (S ₛ) status)))
... | inj₂ (there S'∈map-+-S-suc-zs)
rewrite map-+-compose-suc S zs
= inj₂ S'∈map-+-S-suc-zs
canθ-new-irr {BV} {FV} [] S θ₁ θ₂ θo q cbq S-prop =
can-new-irr θ₁ θ₂ θo q cbq S-prop'
where
S-prop' : ∀ S' → S' ∈ proj₁ FV → S' ∉ proj₁ (Dom θ₂) ⊎ S' ∈ proj₁ (Dom θo)
S-prop' S' S'∈FV with S-prop S' S'∈FV
... | inj₁ S'∉Domθ₂⊎S'∈Domθo = S'∉Domθ₂⊎S'∈Domθo
... | inj₂ ()
canθ-new-irr (nothing ∷ sigs) S θ₁ θ₂ θo q cbq S-prop =
canθ-new-irr sigs (suc S) θ₁ θ₂ θo q cbq
(λ S' S'∈FV →
Data.Sum.map id (subst (S' ∈_) (map-+-compose-suc S (SigMap.keys sigs)))
(S-prop S' S'∈FV))
canθ-new-irr (just Signal.present ∷ sigs) S θ₁ θ₂ θo q cbq S-prop
rewrite sym (Env.←-assoc θ₁ θo ([S]-env-present (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env-present (S ₛ)))
= canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env-present (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.present θo S-prop)
canθ-new-irr (just Signal.absent ∷ sigs) S θ₁ θ₂ θo q cbq S-prop
rewrite sym (Env.←-assoc θ₁ θo ([S]-env-absent (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env-absent (S ₛ)))
= canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env-absent (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.absent θo S-prop)
canθ-new-irr (just Signal.unknown ∷ sigs) S θ₁ θ₂ θo q cbq S-prop
with any (_≟_ S) (Canθₛ sigs (suc S) q ((θ₁ ← θo) ← [S]-env (S ₛ)))
| any (_≟_ S) (Canθₛ sigs (suc S) q (((θ₁ ← θ₂) ← θo) ← [S]-env (S ₛ)))
... | yes S∈canθ-sigs-q-θ₁←θo←[S] | yes S∈canθ-sigs-q-θ₁←θ₂←θo←[S]
rewrite sym (Env.←-assoc θ₁ θo ([S]-env (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env (S ₛ)))
= canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.unknown θo S-prop)
... | no S∉canθ-sigs-q-θ₁←θo←[S] | no S∉canθ-sigs-q-θ₁←θ₂←θo←[S]
rewrite sym (Env.←-assoc θ₁ θo ([S]-env-absent (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env-absent (S ₛ)))
= canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env-absent (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.absent θo S-prop)
... | yes S∈canθ-sigs-q-θ₁←θo←[S] | no S∉canθ-sigs-q-θ₁←θ₂←θo←[S]
rewrite sym (Env.←-assoc θ₁ θo ([S]-env (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env (S ₛ)))
| canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.unknown θo S-prop)
= ⊥-elim
(S∉canθ-sigs-q-θ₁←θ₂←θo←[S]
S∈canθ-sigs-q-θ₁←θo←[S])
... | no S∉canθ-sigs-q-θ₁←θo←[S] | yes S∈canθ-sigs-q-θ₁←θ₂←θo←[S]
rewrite sym (Env.←-assoc θ₁ θo ([S]-env (S ₛ)))
| sym (Env.←-assoc (θ₁ ← θ₂) θo ([S]-env (S ₛ)))
| canθ-new-irr sigs (suc S) θ₁ θ₂ (θo ← [S]-env (S ₛ)) q cbq
(canθ-new-irr-S-prop-accumulate S Signal.unknown θo S-prop)
= ⊥-elim
(S∉canθ-sigs-q-θ₁←θo←[S]
S∈canθ-sigs-q-θ₁←θ₂←θo←[S])
can-irr : ∀ {BV} {FV} θ₁ θ₂ q →
CorrectBinding q BV FV →
(distinct' (proj₁ FV) (proj₁ (Dom θ₂))) →
Can q θ₁ ≡ Can q (θ₁ ← θ₂)
can-irr θ₁ θ₂ q cbq FV≠Domθ₂
with can-new-irr θ₁ θ₂ Env.[]env q cbq (λ S' S'∈FV → inj₁ (FV≠Domθ₂ S' S'∈FV))
... | eq rewrite cong (Can q) (Env.←-comm Env.[]env θ₁ distinct-empty-left)
| cong (Can q) (Env.←-comm Env.[]env (θ₁ ← θ₂) distinct-empty-left)
= eq
|
titanfp/fpbench/antlr/FPY.g4 | billzorn/fpunreal | 4 | 7320 | <filename>titanfp/fpbench/antlr/FPY.g4
grammar FPY;
// see: https://github.com/antlr/grammars-v4/blob/master/python/python3-py/Python3.g4
tokens { INDENT, DEDENT }
@lexer::header{
from antlr4.Token import CommonToken
import re
import importlib
# Pre-compile re
only_spaces = re.compile("[^\r\n\f]+")
only_newlines = re.compile("[\r\n\f]+")
# Allow languages to extend the lexer and parser, by loading the parser dynamically
module_path = __name__[:-5]
language_name = __name__.split('.')[-1]
language_name = language_name[:-5] # Remove Lexer from name
LanguageParser = getattr(importlib.import_module('{}Parser'.format(module_path)), '{}Parser'.format(language_name))
}
@lexer::members {
@property
def tokens(self):
try:
return self._tokens
except AttributeError:
self._tokens = []
return self._tokens
@property
def indents(self):
try:
return self._indents
except AttributeError:
self._indents = []
return self._indents
@property
def opened(self):
try:
return self._opened
except AttributeError:
self._opened = 0
return self._opened
@opened.setter
def opened(self, value):
self._opened = value
@property
def lastToken(self):
try:
return self._lastToken
except AttributeError:
self._lastToken = None
return self._lastToken
@lastToken.setter
def lastToken(self, value):
self._lastToken = value
def reset(self):
super().reset()
self.tokens = []
self.indents = []
self.opened = 0
self.lastToken = None
def emitToken(self, t):
super().emitToken(t)
self.tokens.append(t)
def nextToken(self):
if self._input.LA(1) == Token.EOF and self.indents:
for i in range(len(self.tokens)-1,-1,-1):
if self.tokens[i].type == Token.EOF:
self.tokens.pop(i)
self.emitToken(self.commonToken(LanguageParser.NEWLINE, '\n'))
while self.indents:
self.emitToken(self.createDedent())
self.indents.pop()
self.emitToken(self.commonToken(LanguageParser.EOF, "<EOF>"))
next = super().nextToken()
if next.channel == Token.DEFAULT_CHANNEL:
self.lastToken = next
return next if not self.tokens else self.tokens.pop(0)
def createDedent(self):
dedent = self.commonToken(LanguageParser.DEDENT, "")
dedent.line = self.lastToken.line
return dedent
def commonToken(self, type, text, indent=0):
stop = self.getCharIndex()-1-indent
start = (stop - len(text) + 1) if text else stop
return CommonToken(self._tokenFactorySourcePair, type, super().DEFAULT_TOKEN_CHANNEL, start, stop)
@staticmethod
def getIndentationCount(spaces):
count = 0
for ch in spaces:
if ch == '\t':
count += 8 - (count % 8)
else:
count += 1
return count
def atStartOfInput(self):
return Lexer.column.fget(self) == 0 and Lexer.line.fget(self) == 1
}
// entry rules
parse_fpy : fpy* EOF ;
// grammar
fpy : FPCORE (ident=symbolic)? args=arglist COLON body=suite;
arglist : OPEN_PAREN (arg=argument (COMMA args+=argument)* COMMA?)? CLOSE_PAREN;
argument : name=symbolic dims=dimlist? (BANG props+=prop)*;
dimlist : OPEN_BRACK (dim=dimension (COMMA dims+=dimension)* COMMA?)? CLOSE_BRACK;
dimension
: name=symbolic
| size=number
;
number
: d=DECNUM
| x=HEXNUM
| r=RATIONAL
;
expr
: e=note
| head=note COMMA
| head=note (COMMA rest+=note)+ COMMA?
;
note : e=comp (BANG props+=prop)* ;
comp : e=arith (ops+=(LT | LE | GT | GE | EQ | NE) es+=arith)*;
arith : e=term (ops+=(PLUS | MINUS) es+=term)* ;
term : e=factor (ops+=(TIMES | DIVIDE | MOD) es+=factor)* ;
factor : op=(PLUS | MINUS) f=factor | e=power ;
power : e=atom (op=POWER f=factor)? ;
atom
: x=symbolic
| n=number
| parens=OPEN_PAREN (e=expr)? CLOSE_PAREN
| bracks=OPEN_BRACK (lst=expr)? CLOSE_BRACK
| call=atom OPEN_PAREN (args=expr)? CLOSE_PAREN
| deref=atom OPEN_BRACK (args=expr)? CLOSE_BRACK
| dig=DIG OPEN_PAREN (digits=expr)? CLOSE_PAREN
| abort=ABORT
;
prop : x=symbolic d=datum ;
simple_stmt : e=expr NEWLINE ;
binding
: x=symbolic IS body=suite
;
block : NEWLINE INDENT bindings+=binding+ DEDENT ;
if_stmt : (((IF test=expr COLON body=suite)
|(IF COLON testsuite=suite THEN COLON bodysuite=suite))
((eliftypes+=ELIF tests+=expr COLON bodies+=suite)
|(ELIF COLON testsuites+=suite eliftypes+=THEN COLON bodysuites+=suite))*
ELSE COLON else_body=suite)
;
let_stmt : (LET COLON bindings=block
IN COLON body=suite)
;
while_stmt : (WITH COLON inits=block
((WHILE test=expr COLON updates=block)
|(WHILE COLON testsuite=suite
DO COLON updates=block))
IN COLON body=suite)
;
for_stmt : (FOR COLON dims=block
WITH COLON inits=block
DO COLON updates=block
IN COLON body=suite)
;
tensor_stmt : (TENSOR COLON dims=block
(WITH COLON inits=block
DO COLON updates=block)?
OF COLON body=suite)
;
compound_stmt
: if_stmt
| let_stmt
| while_stmt
| for_stmt
| tensor_stmt
;
statement
: simple_stmt
| compound_stmt
;
datum
: x=symbolic_data
| n=number
| s=STRING
| open_ (data+=datum)* close_
;
simple_data : (data+=datum)+ NEWLINE ;
data_suite
: data=simple_data
| body=suite
;
annotation : x=symbolic COLON data=data_suite ;
suite
: e=simple_stmt
| NEWLINE INDENT (props+=annotation)* body=statement DEDENT
;
symbolic : x=SYMBOL | s_str=S_STRING ;
symbolic_data
: x=FPCORE
| x=IF
| x=THEN
| x=ELIF
| x=ELSE
| x=LET
| x=WHILE
| x=FOR
| x=TENSOR
| x=WITH
| x=DO
| x=IN
| x=OF
| x=POWER
| x=PLUS
| x=MINUS
| x=TIMES
| x=DIVIDE
| x=MOD
| x=LT
| x=LE
| x=GT
| x=GE
| x=EQ
| x=NE
| x=IS
| x=COLON
| x=COMMA
| x=BANG
| x=ABORT
| x=SYM
| x=DIG
| x=SYMBOL
| s_str=S_STRING
;
open_ : OPEN_PAREN | OPEN_BRACK ;
close_ : CLOSE_PAREN | CLOSE_BRACK ;
// tokens
OPEN_PAREN : '(' {self.opened += 1};
CLOSE_PAREN : ')' {self.opened -= 1};
OPEN_BRACK : '[' {self.opened += 1};
CLOSE_BRACK : ']' {self.opened -= 1};
// All of these constructs need to be declared explicitly, to control the precedence
// in lexer rules.
FPCORE : 'FPCore' ;
IF : 'if' ;
THEN : 'then' ;
ELIF : 'elif' ;
ELSE : 'else' ;
LET : 'let' ;
WHILE : 'while' ;
FOR : 'for' ;
TENSOR : 'tensor' ;
WITH : 'with' ;
DO : 'do' ;
IN : 'in' ;
OF : 'of' ;
POWER : '**' ;
PLUS : '+' ;
MINUS : '-' ;
TIMES : '*' ;
DIVIDE : '/' ;
MOD : '%' ;
LE : '<=' ;
LT : '<' ;
GE : '>=' ;
GT : '>' ;
EQ : '==' ;
NE : '!=' ;
IS : '=' ;
COLON : ':' ;
COMMA : ',' ;
BANG : '!' ;
ABORT : 'abort' ;
SYM : 'symbol' ;
DIG : 'digits' ;
DECNUM : [+-]? ([0-9]+ ('.' [0-9]+)? | '.' [0-9]+) ([eE] [-+]? [0-9]+)? ;
HEXNUM : [+-]? '0' [xX] ([0-9a-fA-F]+ ('.' [0-9a-fA-F]+)? | '.' [0-9a-fA-F]+) ([pP] [-+]? [0-9]+)? ;
RATIONAL : [+-]? [0-9]+ '/' [0-9]* [1-9] [0-9]* ;
SYMBOL : SIMPLE_SYMBOL_START SIMPLE_SYMBOL_CHAR* ;
S_STRING : 's"' STRING_CHAR* '"' ;
STRING : '"' STRING_CHAR* '"' ;
NEWLINE
: ( {self.atStartOfInput()}? SPACES
| ( '\r'? '\n' | '\r' | '\f' ) SPACES?
)
{
tempt = Lexer.text.fget(self)
newLine = only_spaces.sub("", tempt)
spaces = only_newlines.sub("", tempt)
la_char = ""
try:
la = self._input.LA(1)
la_char = chr(la)
except ValueError: # End of file
pass
# Strip newlines inside open clauses except if we are near EOF. We keep NEWLINEs near EOF to
# satisfy the final newline needed by the single_put rule used by the REPL.
try:
nextnext_la = self._input.LA(2)
nextnext_la_char = chr(nextnext_la)
except ValueError:
nextnext_eof = True
else:
nextnext_eof = False
if self.opened > 0 or nextnext_eof is False and (la_char == '\r' or la_char == '\n' or la_char == '\f' or la_char == '#'):
self.skip()
else:
indent = self.getIndentationCount(spaces)
previous = self.indents[-1] if self.indents else 0
self.emitToken(self.commonToken(self.NEWLINE, newLine, indent=indent)) # NEWLINE is actually the '\n' char
if indent == previous:
self.skip()
elif indent > previous:
self.indents.append(indent)
self.emitToken(self.commonToken(LanguageParser.INDENT, spaces))
else:
while self.indents and self.indents[-1] > indent:
self.emitToken(self.createDedent())
self.indents.pop()
}
;
SKIP_
: ( SPACES | COMMENT | LINE_JOINING ) -> skip
;
UNK_
: .
;
// fragments
fragment SPACES
: [ \t]+
;
fragment COMMENT
: '#' ~[\r\n\f]*
;
fragment LINE_JOINING
: '\\' SPACES? ( '\r'? '\n' | '\r' | '\f' )
;
fragment SIMPLE_SYMBOL_START
: [a-zA-Z~@$^&_.?]
;
fragment SIMPLE_SYMBOL_CHAR
: [a-zA-Z0-9~@$^&_.?]
;
// // legacy symbols from the s-expression FPCore grammar
// fragment SYMBOL_START
// : [a-zA-Z~!@$%^&*_\-+=<>.?/:]
// ;
// fragment SYMBOL_CHAR
// : [a-zA-Z0-9~!@$%^&*_\-+=<>.?/:]
// ;
fragment STRING_CHAR
: [\u0008-\u000d\u0020-\u0021\u0023-\u005b\u005d-\u007e]
| '\\' [bfnrtv\u0022\u005c]
;
|
src/gen-artifacts.ads | My-Colaborations/dynamo | 0 | 26753 | -----------------------------------------------------------------------
-- gen-artifacts -- Artifacts for Code Generator
-- Copyright (C) 2011, 2012, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Finalization;
with DOM.Core;
with Util.Log;
with Gen.Model;
with Gen.Model.Packages;
with Gen.Model.Projects;
-- The <b>Gen.Artifacts</b> package represents the methods and process to prepare,
-- control and realize the code generation.
package Gen.Artifacts is
type Iteration_Mode is (ITERATION_PACKAGE, ITERATION_TABLE);
type Generator is limited interface and Util.Log.Logging;
-- Report an error and set the exit status accordingly
procedure Error (Handler : in out Generator;
Message : in String;
Arg1 : in String;
Arg2 : in String := "") is abstract;
-- Get the config directory path.
function Get_Config_Directory (Handler : in Generator) return String is abstract;
-- Get the result directory path.
function Get_Result_Directory (Handler : in Generator) return String is abstract;
-- Get the configuration parameter.
function Get_Parameter (Handler : in Generator;
Name : in String;
Default : in String := "") return String is abstract;
-- Get the configuration parameter.
function Get_Parameter (Handler : in Generator;
Name : in String;
Default : in Boolean := False) return Boolean is abstract;
-- Tell the generator to activate the generation of the given template name.
-- The name is a property name that must be defined in generator.properties to
-- indicate the template file. Several artifacts can trigger the generation
-- of a given template. The template is generated only once.
procedure Add_Generation (Handler : in out Generator;
Name : in String;
Mode : in Iteration_Mode;
Mapping : in String) is abstract;
-- Scan the dynamo directories and execute the <b>Process</b> procedure with the
-- directory path.
procedure Scan_Directories (Handler : in Generator;
Process : not null access
procedure (Dir : in String)) is abstract;
-- ------------------------------
-- Model Definition
-- ------------------------------
type Artifact is abstract new Ada.Finalization.Limited_Controlled with private;
-- After the configuration file is read, processes the node whose root
-- is passed in <b>Node</b> and initializes the <b>Model</b> with the information.
procedure Initialize (Handler : in out Artifact;
Path : in String;
Node : in DOM.Core.Node;
Model : in out Gen.Model.Packages.Model_Definition'Class;
Context : in out Generator'Class);
-- Prepare the model after all the configuration files have been read and before
-- actually invoking the generation.
procedure Prepare (Handler : in out Artifact;
Model : in out Gen.Model.Packages.Model_Definition'Class;
Context : in out Generator'Class) is null;
-- After the generation, perform a finalization step for the generation process.
procedure Finish (Handler : in out Artifact;
Model : in out Gen.Model.Packages.Model_Definition'Class;
Project : in out Gen.Model.Projects.Project_Definition'Class;
Context : in out Generator'Class) is null;
-- Check whether this artifact has been initialized.
function Is_Initialized (Handler : in Artifact) return Boolean;
private
type Artifact is abstract new Ada.Finalization.Limited_Controlled with record
Initialized : Boolean := False;
end record;
end Gen.Artifacts;
|
oeis/142/A142037.asm | neoneye/loda-programs | 11 | 16430 | <reponame>neoneye/loda-programs
; A142037: Primes congruent to 7 mod 32.
; Submitted by <NAME>
; 7,71,103,167,199,263,359,487,647,743,839,967,1031,1063,1223,1319,1447,1511,1543,1607,1831,2087,2311,2503,2663,2791,2887,3079,3271,3463,3527,3559,3623,3719,3847,3911,3943,4007,4231,4327,4391,4423,4519,4583,4679,4871,4903,4967,4999,5351,5479,5639,5927,6151,6247,6311,6343,6599,6791,6823,6983,7079,7207,7559,7591,7687,7879,8039,8167,8231,8263,8423,8647,8807,8839,8999,9127,9319,9479,9511,9767,10151,10247,10343,10567,10631,10663,11047,11239,11399,11527,11719,11783,12007,12071,12263,12391,12487,12583
mov $2,36
mul $2,$0
mov $4,6
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,32
lpe
mov $0,$4
add $0,1
|
tests/addr/5.asm | NullMember/customasm | 414 | 7553 | #ruledef test
{
ld {x} => 0x55 @ x`8
}
#bankdef test { #addr 0x1_0000_0000_0000_0000, #outp 0 }
#ruledef test2
{
ld2 {x} => 0x55 @ x`128
}
ld2 $ ; = 0x55_0000_0000_0000_0001_0000_0000_0000_0000
#addr 0x1_0000_0000_0000_0020 ; = 0x00_0000_0000_0000_0000_0000_0000_0000
ld2 $ ; = 0x55_0000_0000_0000_0001_0000_0000_0000_0020 |
oeis/057/A057105.asm | neoneye/loda-programs | 11 | 244097 | ; A057105: Triangle of numbers (when unsigned) related to congruum problem: T(n,k)=k^2+2nk-n^2 with n>k>0 and starting at T(2,1)=1.
; Submitted by <NAME>(s4)
; 1,-2,7,-7,4,17,-14,-1,14,31,-23,-8,9,28,49,-34,-17,2,23,46,71,-47,-28,-7,16,41,68,97,-62,-41,-18,7,34,63,94,127,-79,-56,-31,-4,25,56,89,124,161,-98,-73,-46,-17,14,47,82,119,158,199,-119,-92,-63,-32,1,36,73,112,153,196,241,-142,-113,-82,-49,-14,23,62,103
lpb $0
add $2,1
sub $0,$2
lpe
sub $2,$0
add $0,1
pow $0,2
add $2,1
pow $2,2
sub $0,$2
add $2,$0
add $2,$0
mov $0,$2
|
experiments/tests/deadlock.als | kaiyuanw/ASketch | 1 | 2088 | pred Test0{
some disj State0, State1, State2 : State {
Process = none
State = State0 + State1 + State2
Mutex = none
holds = none -> none -> none
waits = none -> none -> none
!Deadlock[]
}
}
pred Test1{
some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj State0, State1, State2 : State {
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
no Process
no holds
no waits
!Deadlock[]
}
}
pred Test2{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1 : Mutex {
Process = none
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1
holds = none -> none -> none
waits = none -> none -> none
!Deadlock[]
}
}
pred Test3{
some disj Process0 : Process | some disj Mutex0 : Mutex | some disj State0, State1, State2: State {
Process = Process0
Mutex = Mutex0
State = State0 + State1 + State2
holds = State0->Process0->Mutex0 + State1->Process0->Mutex0
waits = State0->Process0->Mutex0
Deadlock[]
}
}
pred Test4{
some disj Process0 : Process | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj State0, State1, State2 : State {
Process = Process0
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
waits = State0->Process0->Mutex0
no holds
Deadlock[]
}
}
pred Test5{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0 : Process {
Process = Process0
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
waits = none -> none -> none
holds = State0->Process0->Mutex2 + State1->Process0->Mutex2 + State2->Process0->Mutex2
!Deadlock[]
}
}
pred Test6{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0, Process1 : Process {
Process = Process0 + Process1
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
holds = none -> none -> none
waits = State0->Process0->Mutex2 + State0->Process1->Mutex0 + State0->Process1->Mutex1 + State0->Process1->Mutex2 + State1->Process0->Mutex1 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process1->Mutex0 + State2->Process1->Mutex1
Deadlock[]
}
}
pred Test7{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0, Process1 : Process {
Process = Process0 + Process1
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
holds = State0->Process0->Mutex2 + State0->Process1->Mutex1 + State0->Process1->Mutex2 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process1->Mutex0 + State2->Process1->Mutex1 + State2->Process1->Mutex2
waits = State0->Process1->Mutex2 + State1->Process0->Mutex2 + State1->Process1->Mutex2 + State2->Process1->Mutex2
Deadlock[]
}
}
pred Test8{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0, Process1, Process2 : Process {
Process = Process0 + Process1 + Process2
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
holds = State0->Process0->Mutex2 + State0->Process1->Mutex1 + State0->Process1->Mutex2 + State0->Process2->Mutex1 + State0->Process2->Mutex2 + State1->Process2->Mutex0 + State1->Process2->Mutex1
waits = State0->Process0->Mutex2 + State0->Process1->Mutex1 + State1->Process0->Mutex2 + State1->Process2->Mutex1 + State2->Process1->Mutex1 + State2->Process2->Mutex0 + State2->Process2->Mutex2
!Deadlock[]
}
}
pred Test9{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0, Process1 : Process {
Process = Process0 + Process1
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
holds = State0->Process0->Mutex2 + State0->Process1->Mutex1 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process1->Mutex0 + State2->Process1->Mutex1 + State2->Process1->Mutex2
waits = State0->Process1->Mutex0 + State0->Process1->Mutex1 + State0->Process1->Mutex2 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process0->Mutex0 + State2->Process0->Mutex1
!Deadlock[]
}
}
pred Test10{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0, Process1 : Process {
Process = Process0 + Process1
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
holds = State0->Process0->Mutex2 + State0->Process1->Mutex0 + State0->Process1->Mutex1 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process1->Mutex0 + State2->Process1->Mutex1 + State2->Process1->Mutex2
waits = State0->Process1->Mutex0 + State0->Process1->Mutex1 + State0->Process1->Mutex2 + State1->Process1->Mutex0 + State1->Process1->Mutex1 + State1->Process1->Mutex2 + State2->Process1->Mutex0 + State2->Process1->Mutex1
!Deadlock[]
}
}
pred Test11{
some disj State0, State1, State2 : State | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj Process0 : Process {
Process = Process0
State = State0 + State1 + State2
Mutex = Mutex0 + Mutex1 + Mutex2
holds =State0->Process0->Mutex0 + State0->Process0->Mutex1 + State0->Process0->Mutex2 + State1->Process0->Mutex0 + State1->Process0->Mutex1 + State1->Process0->Mutex2 + State2->Process0->Mutex0 + State2->Process0->Mutex1 + State2->Process0->Mutex2
waits = State0->Process0->Mutex0 + State0->Process0->Mutex1 + State0->Process0->Mutex2 + State1->Process0->Mutex0 + State1->Process0->Mutex1 + State1->Process0->Mutex2 + State2->Process0->Mutex0 + State2->Process0->Mutex1 + State2->Process0->Mutex2
Deadlock[]
}
}
pred Test12{
some disj Process0 : Process | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj State0, State1, State2 : State {
Process = Process0
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
holds = State0->Process0->Mutex0 + State0->Process0->Mutex1 + State0->Process0->Mutex2 + State1->Process0->Mutex0 + State1->Process0->Mutex1 + State1->Process0->Mutex2 + State2->Process0->Mutex0 + State2->Process0->Mutex1 + State2->Process0->Mutex2
no waits
!Deadlock[]
}
}
pred Test13{
some disj Process0 : Process | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj State0, State1, State2 : State {
Process = Process0
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
holds = State0->Process0->Mutex0 + State0->Process0->Mutex1 + State0->Process0->Mutex2 + State1->Process0->Mutex0 + State1->Process0->Mutex1 + State1->Process0->Mutex2 + State2->Process0->Mutex0 + State2->Process0->Mutex1 + State2->Process0->Mutex2
waits = State0->Process0->Mutex0 + State0->Process0->Mutex1 + State0->Process0->Mutex2
Deadlock[]
}
}
pred Test14{
some disj Process0, Process1, Process2 : Process | some disj Mutex0, Mutex1, Mutex2: Mutex | some disj State0, State1, State2 : State {
Process = Process0 + Process1 + Process2
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
holds = State0->Process2->Mutex0 + State0->Process2->Mutex1 + State0->Process2->Mutex2 + State1->Process2->Mutex0 + State1->Process2->Mutex1 + State1->Process2->Mutex2 + State2->Process2->Mutex0 + State2->Process2->Mutex1 + State2->Process2->Mutex2
no waits
!Deadlock[]
}
}
pred Test15{
some disj Process0, Process1 : Process | some disj Mutex0, Mutex1, Mutex2 : Mutex | some disj State0, State1, State2 : State {
Process = Process0 + Process1
Mutex = Mutex0 + Mutex1 + Mutex2
State = State0 + State1 + State2
holds = State2->Process0->Mutex0 + State2->Process0->Mutex1 + State2->Process0->Mutex2
waits = State0->Process0->Mutex1 + State1->Process0->Mutex0 + State1->Process1->Mutex2
Deadlock[]
}
}
|
src/Examples/Main.agda | Zalastax/thesis | 1 | 12996 | <filename>src/Examples/Main.agda
module Examples.Main where
import Examples.PingPong as PingPong
import Examples.InfiniteBind as InfiniteBind
import Examples.TestSelectiveReceive as SelectiveReceive
import Examples.TestCall as Call
open import Runtime
open import SimulationEnvironment
open import ActorMonad
import IO
open ∞ActorM
pingpongEntry = singleton-env (PingPong.spawner .force)
infinitebindEntry = singleton-env (InfiniteBind.binder .force)
selectiveReceiveEntry = singleton-env SelectiveReceive.spawner
callEntry = singleton-env (Call.calltestActor .force)
main = IO.run (run-env pingpongEntry)
|
sprite/539E34.spr.asm | RockmanEXEZone/MMBN45-English-Translation | 6 | 98972 | .include "sprite/template.asm"
.gba
.create TEMP+"/539E34.dmp",0
header
anim
frame @tile,@pal,@sub,@oam,1,ANIM_END
tiles @tile, TEMP+"/539E34.img.bin"
pal @pal, TEMP+"/539E34.pal.bin"
subanim_none @sub
oamlist_single @oam
// tile x y size flip pal
oam 0, -88, -10, SIZE_16x16, FLIP_NONE, 0
oam 4, -88, 6, SIZE_16x8, FLIP_NONE, 0
oam 6, -72, - 4, SIZE_32x8, FLIP_NONE, 0
oam 10, -40, - 4, SIZE_8x8, FLIP_NONE, 0
oam 11, -48, 4, SIZE_8x8, FLIP_NONE, 0
oam 12, -26, - 4, SIZE_8x16, FLIP_NONE, 0
oam 14, -18, - 4, SIZE_32x8, FLIP_NONE, 0
oam 18, 24, - 4, SIZE_8x16, FLIP_NONE, 0
oam 20, 32, - 4, SIZE_32x8, FLIP_NONE, 0
oam 24, 64, - 4, SIZE_16x8, FLIP_NONE, 0
oam_end
oamlist_end
.close
|
misc/terminal.asm | arpruss/ozdev | 6 | 242702 | <filename>misc/terminal.asm<gh_stars>1-10
;
; Terminal Emulator for ZQ700
; 25/06/2000
; <NAME>
;
;
; Assemble with TASM31 as follows
; C:>TASM -80 -g3 <filename.asm> <filename.wzd>
; This generates a text list file: <filename.lst>
; and a binary object file: <filename.wzd>
;
; This wzd file is ready to download to the wizard.
;
; Note: You will need the file wzdhdr0.asm in the same directory
;
;**************************************************************************
; This program is unsupported freeware
;
; Based on wzdhdr0.asm by <NAME>
.nocodes
#define TITLE .Text "Terminal " ;14 Chrs max
#define NAME .Text "Bxxx0001" ; B + 7 Chrs
#define DESCRIP .Text "Terminal Emulator - Connect up to a Unix box!"; use \r\n for cr lf
.nolist
#include wzdhdr0.asm
SERSTAT .EQU 45H
SIN .EQU 40H
SOUT .EQU 40H
KEYLINESEL .EQU 17
KEYLINEDATA .EQU 16
FIRSTCHAR .EQU 32 ; ASCII codes that are defined in the font table
LASTCHAR .EQU 126
BYTESPERLINE .EQU 30 ; Display arributes
LINESPERROW .EQU 8
LINEONSCREEN .EQU 10
CHARSPERLINE .EQU 30 ; May be different if chars are not 8 wide
;
;
;=================== The entry setup ===============
START PUSH AF ;Save all the registers
PUSH BC
PUSH DE
PUSH HL
DI ;Disable interupts
IN A,(01H) ;Save the Memory Management Regs in BC
LD C,A ; This stuff is only here to demonstrate
IN A,(02H) ; how to do it. It's not needed in this pgm
LD B,A
PUSH BC ; Put the saved regs on the stack
LD A,0FCH ; Set the page registers so that
OUT (01H),A ; 8000H is mapped to the first
LD A,03H ; location in graphics memory
OUT (02H),A
;=================== Main program ===============
; Clear the screen
LD A,13
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
CALL DISPLAY
SUB A
LD (CURSORY),A
; Send a welcome string!
LD HL,WELCOMEMSG-1
NEXTWCHAR INC HL
LD A,(HL)
CALL DISPLAY
OR A ;Check for 00 Terminator
JR NZ, NEXTWCHAR
; Set up for the main loop
LD HL,MULTICHARS ; Point multichar strings to empty str
JR MAINLOOP ; Jump into the middle of it
;======= the top of the main loop ==========
; During the main loop HL must be keep safe - it holds the
; "Multi character string" pointer.
; Read the character and update the display
SERCHAR IN A,(SIN) ;Get the Serial Character into A
; As well as updating the display, place the charater to be echoed
; back to the host
QUEUECHAR LD IX,CHARTOSEND ; Store it to be send so that it is
LD (IX),A ; echoed
CALL DISPLAY ; Place it on the screen
;
; See if there is a character to read
;
MAINLOOP IN A,(SERSTAT) ; Check Serial Status
AND 1
JR NZ,SERCHAR ; Read the byte and process it.
; See if there is still part of a
; mulitcharacter string to send
; This is used for arrow keys and escapes.
LD A,(HL)
OR A ;Check for 00 Terminator
JR NZ, SENDSTRCHAR ; Nope - don't send anything
;
; See if there is a char to send
;
NEXT1 LD A,(CHARTOSEND)
OR A ; Check for 00 - nosend
JR NZ,CLEARANDSEND
;
; See if a key is pressed down
;
LD A,(KEYSEL)
OR A
JR NZ,TESTKEYUP
;
; See if a new key has been pressed
;
LD A,1 ; Select first row of keys
LD B,A ; B - Row select - hard code to 1
LD C,A ; C - Key Mask - hard code to 1
OUT (KEYLINESEL),A ; Set the line select
IN A,(KEYLINEDATA) ; Get the First row of data
AND C ; Check for ESC key
JR Z, MAINLOOP ; No key down - back to top
LD (KEYSELMASK),BC ; Save the mask and select of the key
JR MAINLOOP ; Back to the top
;===== Out of the main line of the program =======
; See if the key has been lifted
TESTKEYUP LD BC,(KEYSELMASK)
LD A,B
OUT (KEYLINESEL),A ;Select first row of keys
IN A,(KEYLINEDATA) ;Get the First row of data
AND C ;Check for the matching Mask
JR NZ, MAINLOOP ;Still set - key still down
LD B,C ;reset the key pressed flag (C is 0!)
LD (KEYSELMASK),BC
JR EXIT ; Really this should jump back to the
; top - but I'll make it exit
; Put this anywhere really
SENDSTRCHAR INC HL
JR SENDACHAR ;If not then jump output the character
CLEARANDSEND ; Send out character in chartosend - drops through to SENDACHAR
LD A, (CHARTOSEND)
LD IX, CHARTOSEND ; Clear the char to send byte
LD (IX), 0
; Send a character in 'A' to the serial port,
; Part of the main loop!!!!
; INPUT A = character to send
; USES B, IX
SENDACHAR LD D,A ; Save the char to send
WAIT IN A,(SERSTAT) ; Check CLEAR TO SEND
AND 20H
JR Z,WAIT ; Wait until clear to send
LD A,D ; Send it to the Serial Out Port
OUT (SOUT),A
JR MAINLOOP ; Go back for next byte
;=================== End of the mail loop propper
;=================== Exit the program ===============
EXIT POP BC ;Get the saved MMU regs
LD A,C ;Restore the MMU regs
OUT (01H),A
LD A,B
OUT (02H),A
EI ;Enable Interupts
POP HL ;Restore the regs
POP DE
POP BC
POP AF
RET
;===========================================================================
; DISPLAY - Subrotine to put a character on the screen and update the
; cursor positions
; A = character to show
; All others are safe
;===========================================================================
DISPLAY PUSH HL ; Save registers
; HL used to calc the index the Line start tables
; calc the index in the font tables
PUSH BC
; BC used to hold the memory address of the char on display
;
PUSH IX
; IX used to index the font table
;
LD (CHARTODRAW),A; ; Save the character to draw
CP 13 ; Is it a newline????
JR Z,NEWLINE
LD HL, LINESTARTS ; Address of 'line start' table
LD A, (CURSORY) ; Add on 2*cursory
SLA A
ADD A,L
LD L,A
JR NC, NOINCY
INC H
NOINCY LD C, (HL) ; Load the start of the line into BC
INC HL
LD B, (HL)
LD A, (CURSORX) ; Add on cursorX
ADD A,C
LD C,A
JR NC, NOINCX
INC B
; Find which font character to show
NOINCX LD IX, FONT ; default to unknown character
LD A,(CHARTODRAW) ; Load the character
CP FIRSTCHAR ; Is it greater then the first char
JR C, NOCHAR ; Nope - put the default character
CP LASTCHAR+1 ; Is it less than the last char+1
JR NC, NOCHAR ; Nope - put the default
SUB FIRSTCHAR-1 ; Calc entry in the table
LD L,A ; Put the font table index into HL
SUB A ; Zero out H
LD H,A
SLA L ; Multiply HL by 8
RL H
SLA L
RL H
SLA L
RL H
LD A, FONT&0FFH
ADD A,L
LD L,A
LD A, FONT/256
ADC A,H
LD H,A
LD (TEMP),HL
LD IX,(TEMP)
LD (TEMP),HL ; Put it in reg that the font
LD IX,(TEMP) ; is indexed from
; Place the character on the screen, one line at a time
NOCHAR LD H,8 ; How many character lines to place?
NEXTSCANLNE LD A,(IX) ; Place a line of character into
LD (BC),A ; The video memory
INC IX ; Move on to the next line of font
LD A,C ; Move bc to the next row
ADD A,BYTESPERLINE
LD C,A
JR NC, NOINLINC
INC B
NOINLINC DEC H ; Have we updated all lines???
JR NZ,NEXTSCANLNE ; Nope - do the next one??
; Update the cursor position
LD A,(CURSORX)
CP CHARSPERLINE-1; Last cursor place on the line?
JR Z,NEWLINE ; Yes - we have to do a newline
INC A ; Otherwise move the cursor across one char
LD (CURSORX),A ; and exit
JR DLEAVE
; Move the cursor onto a fresh line, scrolling if needed
NEWLINE SUB A ; Move cursor back to start of the line
LD (CURSORX),A
; See if we need to scroll
LD A,(CURSORY) ; Last line ?
CP LINEONSCREEN-1 ; Are we in the last line
JR Z,SCROLL ; Yes - scroll instead
INC A ; No, Increment the line we are on
LD (CURSORY),A ; and then leave
DLEAVE LD A,(CHARTODRAW) ; Restore the character to A
POP IX ; For the caller. It may want to
POP BC ; Do something with it
POP HL
RET
SCROLL ; The code to scroll the line goes here!
PUSH IY ; IY is the only one not restored on exit
LD IX,8000H ; The start of the first line
LD IY,80F0H ; The start of the second line
LD B,LINEONSCREEN-1 ; Counter - Scroll all but last line
EACHLINE LD C,BYTESPERLINE * LINESPERROW ; How many bytes per line
PERLINE LD A, (IY) ; Load from next line
LD (IX),A ; Save in the line
INC IX ; Move on to next bytes
INC IY
DEC C
JR NZ,PERLINE ; Still more on this line?
DEC B
JR NZ,EACHLINE ;Another line to go?
; Clear off the last line
LD C,BYTESPERLINE * LINESPERROW ; Loop counter
SUB A ; Clear out A
CLEARLOOP LD (IX),A ; Empty one byte
INC IX ; Increment the pointer
DEC C ; Dec the counter
JR NZ, CLEARLOOP ; need to do it again?
POP IY
JR DLEAVE
;============ End of code =============
.nocodes
MULTICHARS .DB 00
WELCOMEMSG .Text "ZQ700 Terminal program"
.DB 10
.DB 13
.Text "Written by <EMAIL>"
.DB 10
.DB 13
.DB 00
;
CHARTOSEND .DB 00
;
CHARTODRAW .DB 00
.DB 00 ; This must be zero!
;
; Order is important!
KEYDOWN .DB 00
KEYSELMASK ; Accessed as a double byte
KEYSEL .DB 00
KEYMASK .DB 00
TEMP .DB 0,0
CURSORY .DB 00H
CURSORX .DB 00H
LINESTARTS .DB 00H
.DB 80H
.DB 0F0H
.DB 80H
.DB 0E0H
.DB 81H
.DB 0D0H ; Line 4
.DB 82H
.DB 0C0H
.DB 83H
.DB 0B0H
.DB 84H
.DB 0A0H
.DB 85H
.DB 090H ; Line 8
.DB 86H
.DB 080H
.DB 87H
.DB 70H ; Line 10
.DB 88H
FONT .DB 01FH, 011H, 011H, 011H, 011H, 011H, 01FH, 000H ; unknown
.DB 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H ; ' ' 32
.DB 004H, 004H, 004H, 004H, 000H, 000H, 004H, 000H ; '!' 33
.DB 00AH, 00AH, 000H, 000H, 000H, 000H, 000H, 000H ; '"' 34
.DB 000H, 00AH, 01FH, 00AH, 01FH, 00AH, 000H, 000H ; '#' 35
.DB 004H, 00EH, 005H, 00EH, 014H, 00EH, 004H, 000H ; '$' 36
.DB 003H, 013H, 008H, 004H, 002H, 019H, 018H, 000H ; '%' 37
.DB 006H, 009H, 009H, 006H, 015H, 009H, 016H, 000H ; '&' 38
.DB 004H, 004H, 004H, 000H, 000H, 000H, 000H, 000H ; ''' 39
.DB 008H, 004H, 002H, 002H, 002H, 004H, 008H, 000H ; '(' 40
.DB 002H, 004H, 008H, 008H, 008H, 004H, 002H, 000H ; ')' 41
.DB 000H, 004H, 004H, 01FH, 00EH, 00AH, 000H, 000H ; '*' 42
.DB 000H, 004H, 004H, 01FH, 004H, 004H, 000H, 000H ; '+' 43
.DB 000H, 000H, 000H, 000H, 000H, 006H, 006H, 002H ; ',' 44
.DB 000H, 000H, 000H, 00EH, 000H, 000H, 000H, 000H ; '-' 45
.DB 000H, 000H, 000H, 000H, 000H, 006H, 006H, 000H ; '.' 46
.DB 010H, 008H, 008H, 004H, 002H, 002H, 001H, 000H ; '/' 47
.DB 00EH, 011H, 011H, 015H, 011H, 011H, 00EH, 000H ; '0' 48
.DB 004H, 006H, 004H, 004H, 004H, 004H, 00EH, 000H ; '1' 49
.DB 00EH, 011H, 010H, 008H, 004H, 002H, 01FH, 000H ; '2' 50
.DB 00EH, 011H, 010H, 00EH, 010H, 011H, 00EH, 000H ; '3' 51
.DB 008H, 00CH, 00AH, 01FH, 008H, 008H, 01CH, 000H ; '4' 52
.DB 01FH, 001H, 001H, 00FH, 010H, 011H, 00EH, 000H ; '5' 53
.DB 01CH, 002H, 001H, 00FH, 011H, 011H, 00EH, 000H ; '6' 54
.DB 01FH, 010H, 010H, 008H, 004H, 002H, 002H, 000H ; '7' 55
.DB 00EH, 011H, 011H, 00EH, 011H, 011H, 00EH, 000H ; '8' 56
.DB 00EH, 011H, 011H, 01EH, 010H, 008H, 007H, 000H ; '9' 57
.DB 000H, 000H, 006H, 006H, 000H, 006H, 006H, 000H ; ':' 58
.DB 000H, 000H, 006H, 006H, 000H, 006H, 006H, 002H ; ';' 59
.DB 000H, 018H, 006H, 001H, 006H, 018H, 000H, 000H ; '<' 60
.DB 000H, 000H, 01FH, 000H, 01FH, 000H, 000H, 000H ; '=' 61
.DB 000H, 003H, 00CH, 010H, 00CH, 003H, 000H, 000H ; '>' 62
.DB 00EH, 011H, 008H, 004H, 004H, 000H, 004H, 000H ; '?' 63
.DB 00EH, 011H, 01DH, 01BH, 01DH, 001H, 00EH, 000H ; '@' 64
.DB 00EH, 011H, 011H, 01FH, 011H, 011H, 011H, 000H ; 'A' 65
.DB 00FH, 011H, 011H, 00FH, 011H, 011H, 00FH, 000H ; 'B'
.DB 00EH, 011H, 001H, 001H, 001H, 011H, 00EH, 000H ; 'C'
.DB 00FH, 011H, 011H, 011H, 011H, 011H, 00FH, 000H ; 'D'
.DB 01FH, 001H, 001H, 00FH, 001H, 001H, 01FH, 000H ; 'E'
.DB 01FH, 001H, 001H, 00FH, 001H, 001H, 001H, 000H ; 'F' 70
.DB 00EH, 011H, 001H, 001H, 019H, 011H, 00EH, 000H ; 'G'
.DB 011H, 011H, 011H, 01FH, 011H, 011H, 011H, 000H ; 'H'
.DB 00EH, 004H, 004H, 004H, 004H, 004H, 00EH, 000H ; 'I'
.DB 010H, 010H, 010H, 010H, 010H, 011H, 00EH, 000H ; 'J'
.DB 011H, 009H, 005H, 003H, 005H, 009H, 011H, 000H ; 'K' 75
.DB 001H, 001H, 001H, 001H, 001H, 001H, 01FH, 000H ; 'L'
.DB 011H, 01BH, 015H, 011H, 011H, 011H, 011H, 000H ; 'M'
.DB 011H, 013H, 015H, 015H, 015H, 019H, 011H, 000H ; 'N'
.DB 00EH, 011H, 011H, 011H, 011H, 011H, 00EH, 000H ; 'O'
.DB 00FH, 011H, 011H, 00FH, 001H, 001H, 001H, 000H ; 'P' 80
.DB 00EH, 011H, 011H, 011H, 011H, 015H, 00EH, 008H ; 'Q'
.DB 00FH, 011H, 011H, 00FH, 005H, 009H, 011H, 000H ; 'R'
.DB 00EH, 011H, 001H, 00EH, 010H, 011H, 00EH, 000H ; 'S'
.DB 01FH, 004H, 004H, 004H, 004H, 004H, 004H, 000H ; 'T'
.DB 011H, 011H, 011H, 011H, 011H, 011H, 00EH, 000H ; 'U' 85
.DB 011H, 011H, 011H, 011H, 00AH, 00AH, 004H, 000H ; 'V'
.DB 011H, 011H, 011H, 011H, 015H, 01BH, 011H, 000H ; 'W'
.DB 011H, 011H, 00AH, 004H, 00AH, 011H, 011H, 000H ; 'X'
.DB 011H, 011H, 011H, 00AH, 004H, 004H, 004H, 000H ; 'Y'
.DB 01EH, 010H, 008H, 004H, 002H, 001H, 01EH, 000H ; 'Z' 90
.DB 00EH, 002H, 002H, 002H, 002H, 002H, 00EH, 000H ; '[' 91
.DB 001H, 002H, 002H, 004H, 008H, 008H, 010H, 000H ; '\' 92
.DB 00EH, 008H, 008H, 008H, 008H, 008H, 00EH, 000H ; ']' 93
.DB 004H, 00aH, 011H, 000H, 000H, 000H, 000H, 000H ; '^' 64
.DB 000H, 000H, 000H, 000H, 000H, 000H, 01FH, 000H ; '_' 95
.DB 003H, 002H, 002H, 000H, 000H, 000H, 000H, 000H ; '`' 97
.DB 000H, 000H, 00EH, 010H, 01EH, 011H, 01EH, 000H ; 'a' 98
.DB 001H, 001H, 00FH, 011H, 011H, 011H, 00FH, 000H ; 'b' 99
.DB 000H, 000H, 00EH, 011H, 001H, 011H, 00EH, 000H ; 'c' 100
.DB 010H, 010H, 01eH, 011H, 011H, 011H, 01eH, 000H ; 'd' 101
.DB 000H, 000H, 00EH, 011H, 01FH, 001H, 01EH, 000H ; 'e' 112
.DB 00CH, 002H, 002H, 007H, 002H, 002H, 002H, 000H ; 'f' 103
.DB 000H, 000H, 01eH, 011H, 011H, 01eH, 010H, 00EH ; 'g' 104
.DB 001H, 001H, 001H, 00FH, 011H, 011H, 011H, 000H ; 'h' 105
.DB 000H, 004H, 000H, 006H, 004H, 004H, 00eH, 000H ; 'i' 106
.DB 000H, 008H, 000H, 008H, 008H, 008H, 008H, 006H ; 'j' 107
.DB 001H, 001H, 009H, 005H, 003H, 005H, 009H, 000H ; 'k' 108
.DB 002H, 002H, 002H, 002H, 002H, 002H, 002H, 000H ; 'l' 109
.DB 000H, 000H, 00AH, 015H, 015H, 015H, 015H, 000H ; 'm' 110
.DB 000H, 000H, 00FH, 011H, 011H, 011H, 011H, 000H ; 'n' 111
.DB 000H, 000H, 00EH, 011H, 011H, 011H, 00EH, 000H ; 'o' 112
.DB 000H, 000H, 00FH, 011H, 011H, 00FH, 001H, 001H ; 'p' 113
.DB 000H, 000H, 01eH, 011H, 011H, 01eH, 010H, 010H ; 'q' 114
.DB 000H, 000H, 00DH, 003H, 001H, 001H, 001H, 000H ; 'r' 115
.DB 000H, 000H, 00EH, 001H, 00EH, 010H, 00EH, 000H ; 's' 116
.DB 002H, 007H, 002H, 002H, 002H, 002H, 004H, 000H ; 't' 117
.DB 000H, 000H, 011H, 011H, 011H, 011H, 01EH, 000H ; 'u' 118
.DB 000H, 000H, 011H, 011H, 00AH, 00AH, 004H, 000H ; 'v' 119
.DB 000H, 000H, 011H, 011H, 015H, 01BH, 011H, 000H ; 'w' 120
.DB 000H, 000H, 011H, 00AH, 004H, 00AH, 011H, 000H ; 'x' 121
.DB 000H, 000H, 011H, 011H, 011H, 01eH, 010H, 00EH ; 'y' 122
.DB 000H, 000H, 01EH, 008H, 004H, 002H, 01EH, 000H ; 'z' 123
.DB 008H, 004H, 004H, 002H, 004H, 004H, 008H, 000H ; '{' 124
.DB 004H, 004H, 004H, 004H, 004H, 004H, 004H, 000H ; '|' 125
.DB 002H, 004H, 004H, 008H, 004H, 004H, 002H, 000H ; '}' 126
.END
|
_build/dispatcher/jmp_ippsECCPGetSizeStd192r1_e530da88.asm | zyktrcn/ippcp | 1 | 247201 | extern m7_ippsECCPGetSizeStd192r1:function
extern n8_ippsECCPGetSizeStd192r1:function
extern y8_ippsECCPGetSizeStd192r1:function
extern e9_ippsECCPGetSizeStd192r1:function
extern l9_ippsECCPGetSizeStd192r1:function
extern n0_ippsECCPGetSizeStd192r1:function
extern k0_ippsECCPGetSizeStd192r1:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsECCPGetSizeStd192r1
.Larraddr_ippsECCPGetSizeStd192r1:
dq m7_ippsECCPGetSizeStd192r1
dq n8_ippsECCPGetSizeStd192r1
dq y8_ippsECCPGetSizeStd192r1
dq e9_ippsECCPGetSizeStd192r1
dq l9_ippsECCPGetSizeStd192r1
dq n0_ippsECCPGetSizeStd192r1
dq k0_ippsECCPGetSizeStd192r1
segment .text
global ippsECCPGetSizeStd192r1:function (ippsECCPGetSizeStd192r1.LEndippsECCPGetSizeStd192r1 - ippsECCPGetSizeStd192r1)
.Lin_ippsECCPGetSizeStd192r1:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsECCPGetSizeStd192r1:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsECCPGetSizeStd192r1]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsECCPGetSizeStd192r1:
|
oeis/324/A324476.asm | neoneye/loda-programs | 11 | 25763 | <filename>oeis/324/A324476.asm
; A324476: Packing numbers for n-tripods.
; 1,2,5,8,11,14,19,23,28,32,38
mov $2,$0
lpb $0
sub $0,1
mov $1,3
add $2,$0
trn $0,3
lpe
mul $1,$2
div $1,2
mov $0,$1
add $0,1
|
oeis/065/A065440.asm | neoneye/loda-programs | 11 | 100443 | <gh_stars>10-100
; A065440: a(n) = (n-1)^n.
; 1,0,1,8,81,1024,15625,279936,5764801,134217728,3486784401,100000000000,3138428376721,106993205379072,3937376385699289,155568095557812224,6568408355712890625,295147905179352825856,14063084452067724991009,708235345355337676357632,37589973457545958193355601,2097152000000000000000000000,122694327386105632949003612841,7511413302012830262726227918848,480250763996501976790165756943041,32009658644406818986777955348250624,2220446049250313080847263336181640625,160059109085386090080713531498405298176
mov $1,$0
sub $0,1
pow $0,$1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.