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
|
---|---|---|---|---|
projects/batfish/src/main/antlr4/org/batfish/grammar/f5_bigip_imish/F5BigipImish_bgp.g4 | adrianliaw/batfish | 16 | 6567 | parser grammar F5BigipImish_bgp;
import F5BigipImish_common;
options {
tokenVocab = F5BigipImishLexer;
}
rb_bgp_always_compare_med
:
ALWAYS_COMPARE_MED NEWLINE
;
rb_bgp_deterministic_med
:
DETERMINISTIC_MED NEWLINE
;
rb_bgp_null
:
(
GRACEFUL_RESTART
| LOG_NEIGHBOR_CHANGES
) null_rest_of_line
;
rb_bgp_router_id
:
ROUTER_ID id = IP_ADDRESS NEWLINE
;
rb_neighbor_ipv4
:
NO? NEIGHBOR ip = IP_ADDRESS
(
rbn_common
| rbn_peer_group_assign
)
;
rb_neighbor_ipv6
:
NO? NEIGHBOR ip6 = IPV6_ADDRESS
(
rbn_common
| rbn_peer_group_assign
)
;
rb_neighbor_peer_group
:
NO? NEIGHBOR name = peer_group_name
(
rbn_common
| rbn_peer_group
)
;
rbn_common
:
(
rbn_description
| rbn_next_hop_self
| rbn_null
| rbn_soft_reconfiguration
| rbn_remote_as
| rbn_route_map_out
| rbn_password
| rbn_update_source
)
;
rbn_description
:
DESCRIPTION text = DESCRIPTION_LINE NEWLINE
;
rbn_next_hop_self
:
NEXT_HOP_SELF NEWLINE
;
rbn_password
:
PASSWORD password = DESCRIPTION_LINE NEWLINE
;
rbn_peer_group
:
PEER_GROUP NEWLINE
;
rbn_peer_group_assign
:
PEER_GROUP name = peer_group_name NEWLINE
;
rbn_null
:
(
ADVERTISEMENT_INTERVAL
| CAPABILITY
| FALL_OVER
| MAXIMUM_PREFIX
) null_rest_of_line
;
rbn_soft_reconfiguration
:
SOFT_RECONFIGURATION INBOUND NEWLINE
;
rbn_remote_as
:
REMOTE_AS remoteas = uint32 NEWLINE
;
rbn_route_map_out
:
ROUTE_MAP name = word OUT NEWLINE
;
rbn_update_source
:
rbn_update_source_ip
| rbn_update_source_interface
;
rbn_update_source_ip
:
UPDATE_SOURCE ip = IP_ADDRESS NEWLINE
;
rbn_update_source_interface
:
UPDATE_SOURCE name = word NEWLINE
;
rb_null
:
(
MAX_PATHS
) null_rest_of_line
;
rb_redistribute
:
REDISTRIBUTE
(
rbr_kernel
| rbr_connected
)
;
rbr_kernel
:
KERNEL
(
ROUTE_MAP rm = word
)?
NEWLINE
;
rbr_connected
:
CONNECTED
(
ROUTE_MAP rm = word
)?
NEWLINE
;
router_bgp
:
BGP localas = uint32 NEWLINE
(
rb_aggregate_address
| rb_bgp
| rb_neighbor_ipv4
| rb_neighbor_ipv6
| rb_neighbor_peer_group
| rb_no
| rb_null
| rb_redistribute
)*
;
peer_group_name
:
~( IP_ADDRESS | IPV6_ADDRESS | NEWLINE )
;
rb_aggregate_address
:
AGGREGATE_ADDRESS prefix = ip_prefix
(
as_set = AS_SET summary_only = SUMMARY_ONLY?
| summary_only = SUMMARY_ONLY
)? NEWLINE
;
rb_bgp
:
BGP
(
rb_bgp_always_compare_med
| rb_bgp_confederation
| rb_bgp_deterministic_med
| rb_bgp_null
| rb_bgp_router_id
)
;
rb_bgp_confederation
:
CONFEDERATION
(
rbbc_identifier
| rbbc_peers
)
;
rbbc_identifier
:
IDENTIFIER id = uint32 NEWLINE
;
rbbc_peers
:
PEERS peers += uint32+ NEWLINE
;
rb_no
:
NO rb_no_null
;
rb_no_null
:
(
BGP
| MAX_PATHS
) null_rest_of_line
;
|
programs/oeis/087/A087737.asm | neoneye/loda | 22 | 167546 | <filename>programs/oeis/087/A087737.asm
; A087737: Value of (n,n+1) concatenated in binary representation.
; 6,11,28,37,46,55,120,137,154,171,188,205,222,239,496,529,562,595,628,661,694,727,760,793,826,859,892,925,958,991,2016,2081,2146,2211,2276,2341,2406,2471,2536,2601,2666,2731,2796,2861,2926,2991,3056,3121,3186,3251,3316,3381,3446,3511,3576,3641,3706,3771,3836,3901,3966,4031,8128,8257,8386,8515,8644,8773,8902,9031,9160,9289,9418,9547,9676,9805,9934,10063,10192,10321,10450,10579,10708,10837,10966,11095,11224,11353,11482,11611,11740,11869,11998,12127,12256,12385,12514,12643,12772,12901
mov $1,$0
add $0,1
add $1,2
mov $2,$0
lpb $1
div $1,2
mul $2,2
lpe
add $1,5
add $2,1
lpb $1
add $0,$2
mod $1,2
lpe
|
Task/The-Twelve-Days-of-Christmas/Ada/the-twelve-days-of-christmas.ada | LaudateCorpus1/RosettaCodeData | 1 | 10943 | <gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
procedure Twelve_Days_Of_Christmas is
type Days is (First, Second, Third, Fourth, Fifth, Sixth,
Seventh, Eighth, Ninth, Tenth, Eleventh, Twelfth);
package E_IO is new Ada.Text_IO.Enumeration_IO(Days);
use E_IO;
Gifts : array (Days) of Unbounded_String :=
(To_Unbounded_String(" A partridge in a pear-tree."),
To_Unbounded_String(" Two turtle doves"),
To_Unbounded_String(" Three French hens"),
To_Unbounded_String(" Four calling birds"),
To_Unbounded_String(" Five golden rings"),
To_Unbounded_String(" Six geese a-laying"),
To_Unbounded_String(" Seven swans a-swimming"),
To_Unbounded_String(" Eight maids a-milking"),
To_Unbounded_String(" Nine ladies dancing"),
To_Unbounded_String(" Ten lords a-leaping"),
To_Unbounded_String(" Eleven pipers piping"),
To_Unbounded_String(" Twelve drummers drumming"));
begin
for Day in Days loop
Put("On the "); Put(Day, Set => Lower_Case); Put(" day of Christmas,");
New_Line; Put_Line("My true love gave to me:");
for D in reverse Days'First..Day loop
Put_Line(To_String(Gifts(D)));
end loop;
if Day = First then
Replace_Slice(Gifts(Day), 2, 2, "And a");
end if;
New_Line;
end loop;
end Twelve_Days_Of_Christmas;
|
Notational Velocity/NV-OpenTopBookmark.applescript | rogues-gallery/applescript | 360 | 611 | --- Opens the top bookmark in NV
tell application "nvALT"
activate
tell application "System Events"
key code 18 using command down
end tell
end tell
--- http://www.github.com/unforswearing
|
include/xcb_atom.ads | docandrew/troodon | 5 | 27439 | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with bits_stdint_uintn_h;
package xcb_atom is
function xcb_atom_name_by_screen (base : Interfaces.C.Strings.chars_ptr; screen : bits_stdint_uintn_h.uint8_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/xcb/xcb_atom.h:10
with Import => True,
Convention => C,
External_Name => "xcb_atom_name_by_screen";
function xcb_atom_name_by_resource (base : Interfaces.C.Strings.chars_ptr; resource : bits_stdint_uintn_h.uint32_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/xcb/xcb_atom.h:11
with Import => True,
Convention => C,
External_Name => "xcb_atom_name_by_resource";
function xcb_atom_name_unique (base : Interfaces.C.Strings.chars_ptr; id : bits_stdint_uintn_h.uint32_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/xcb/xcb_atom.h:12
with Import => True,
Convention => C,
External_Name => "xcb_atom_name_unique";
end xcb_atom;
|
oeis/045/A045737.asm | neoneye/loda-programs | 11 | 95517 | ; A045737: Number of nonroot branch nodes in all noncrossing rooted trees on n nodes on a circle.
; Submitted by <NAME>(s4)
; 0,0,3,28,210,1470,9996,67032,446292,2960100,19594575,129585456,856703848,5663913528,37454912040,247778648880,1639890119016,10858731869160,71939098633185,476841658085100,3162310375905450,20982206739779670,139286138357686320,925054878072330720,6146420780774710800,40856806879915899600,271697765751440732340,1807505136367479398304,12029217690466490989104,80085228886439024708880,533356728434175545510160,3553259308051128116984928,23679556433504906033339856,157852639170334948634592336
mov $1,$0
mul $1,2
add $1,$0
mov $2,$0
mov $0,1
add $0,$1
sub $2,2
bin $0,$2
bin $1,$2
add $0,$1
add $1,$0
mov $0,$1
|
Evernote Sed.applescript | thomasleplus/macosx | 4 | 1007 | <gh_stars>1-10
on run argv
tell application "Evernote"
synchronize
set theNotes to find notes
repeat with aNote in theNotes
set oldTitle to title of aNote as string
-- let's escape single quotes
set delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to "'"
set the pieces to every text item of oldTitle
set AppleScript's text item delimiters to "'\\''"
set escapedTitle to the pieces as string
set AppleScript's text item delimiters to delim
-- now apply each sed commands
repeat with arg in argv
set newTitle to do shell script "echo '" & escapedTitle & "' | sed '" & arg & "'"
set newTitle to text 1 thru -1 of newTitle -- remove line return
end repeat
if newTitle is not equal to oldTitle then
set title of aNote to newTitle
end if
end repeat
synchronize
quit
end tell
end run
|
text/maps/rock_tunnel_pokecenter.asm | adhi-thirumala/EvoYellow | 16 | 93021 | _RockTunnelPokecenterText2::
text "The element types"
line "of #MON make"
cont "them stronger"
cont "than some types"
cont "and weaker than"
cont "others!"
done
_RockTunnelPokecenterText3::
text "I sold a useless"
line "NUGGET for ¥5000!"
done
|
data/baseStats/eevee.asm | etdv-thevoid/pokemon-rgb-enhanced | 1 | 6460 | db EEVEE ; pokedex id
db 55 ; base hp
db 55 ; base attack
db 55 ; base defense
db 55 ; base speed
db 55 ; base special
db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 92 ; base exp yield
INCBIN "pic/gsmon/eevee.pic",0,1 ; 55, sprite dimensions
dw EeveePicFront
dw EeveePicBack
; attacks known at lvl 0
db TACKLE
db TAIL_WHIP
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 3,6,8
tmlearn 9,10
tmlearn 20
tmlearn 28,31,32
tmlearn 33,34,39
tmlearn 44
tmlearn 50
db BANK(EeveePicFront)
|
src/sparknacl-utils.adb | rod-chapman/SPARKNaCl | 76 | 14984 | <filename>src/sparknacl-utils.adb
with Ada.Unchecked_Conversion;
package body SPARKNaCl.Utils
with SPARK_Mode => On
is
pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)");
function To_U32 is new Ada.Unchecked_Conversion (I32, U32);
function To_I32 is new Ada.Unchecked_Conversion (U32, I32);
-- Constant-time conditional swap for a GF32 (32-bit limbs)
procedure CSwap32 (P : in out GF32;
Q : in out GF32;
Swap : in Boolean)
with Global => null,
Contract_Cases =>
(Swap => (P = Q'Old and Q = P'Old and
((P'Old in Normal_GF32) = (Q in Normal_GF32)) and
((Q'Old in Normal_GF32) = (P in Normal_GF32))),
not Swap => (P = P'Old and Q = Q'Old) and
((P'Old in Normal_GF32) = (P in Normal_GF32)) and
((Q'Old in Normal_GF32) = (Q in Normal_GF32)));
-- Constant-time conditional swap for a Normal_GF (16-bit limbs)
procedure CSwap16 (P : in out Normal_GF;
Q : in out Normal_GF;
Swap : in Boolean)
is
T : U16;
C : U16 := 16#FFFF# * Boolean'Pos (Swap);
begin
for I in Index_16 loop
pragma Loop_Optimize (No_Unroll);
T := C and (P (I) xor Q (I));
-- Case 1 - "Swap"
-- Swap -> C = 16#FFFF....# -> T = P(I) xor Q (I) ->
-- P (I) xor T = Q (I) and
-- Q (I) xor T = P (I)
--
-- Case 2 - "Don't Swap"
-- not Swap -> C = 0 -> T = 0 ->
-- P (I) xor T = P (I) and
-- Q (I) xor T = Q (I)
pragma Assert
((if Swap then
(T = (P (I) xor Q (I)) and then
(P (I) xor T) = Q (I) and then
(Q (I) xor T) = P (I))
else
(T = 0 and then
(P (I) xor T) = P (I) and then
(Q (I) xor T) = Q (I)))
);
P (I) := P (I) xor T;
Q (I) := Q (I) xor T;
pragma Loop_Invariant
(if Swap then
(for all J in Index_16 range 0 .. I =>
(P (J) = Q'Loop_Entry (J) and
Q (J) = P'Loop_Entry (J)))
else
(for all J in Index_16 range 0 .. I =>
(P (J) = P'Loop_Entry (J) and
Q (J) = Q'Loop_Entry (J)))
);
end loop;
-- Sanitize local variables as per the implementation in WireGuard.
-- Note that Swap cannot be sanitized here since it is
-- an "in" parameter
pragma Warnings (GNATProve, Off, "statement has no effect");
Sanitize_U16 (T);
Sanitize_U16 (C);
pragma Unreferenced (T);
pragma Unreferenced (C);
end CSwap16;
procedure CSwap32 (P : in out GF32;
Q : in out GF32;
Swap : in Boolean)
is
T : U32;
C : U32 := 16#FFFF_FFFF# * Boolean'Pos (Swap);
-- Do NOT try to evaluate the assumption below at run-time
pragma Assertion_Policy (Assume => Ignore);
begin
-- We need this axiom
pragma Assume
(for all K in I32 => To_I32 (To_U32 (K)) = K);
for I in Index_16 loop
pragma Loop_Optimize (No_Unroll);
T := C and (To_U32 (P (I)) xor To_U32 (Q (I)));
-- Case 1 - "Swap"
-- Swap -> C = 16#FFFF....# -> T = P(I) xor Q (I) ->
-- P (I) xor T = Q (I) and
-- Q (I) xor T = P (I)
--
-- Case 2 - "Don't Swap"
-- not Swap -> C = 0 -> T = 0 ->
-- P (I) xor T = P (I) and
-- Q (I) xor T = Q (I)
pragma Assert
((if Swap then
(T = (To_U32 (P (I)) xor To_U32 (Q (I))) and then
To_I32 (To_U32 (P (I)) xor T) = Q (I) and then
To_I32 (To_U32 (Q (I)) xor T) = P (I))
else
(T = 0 and then
To_I32 (To_U32 (P (I)) xor T) = P (I) and then
To_I32 (To_U32 (Q (I)) xor T) = Q (I)))
);
P (I) := To_I32 (To_U32 (P (I)) xor T);
Q (I) := To_I32 (To_U32 (Q (I)) xor T);
pragma Loop_Invariant
(if Swap then
(for all J in Index_16 range 0 .. I =>
(P (J) = Q'Loop_Entry (J) and
Q (J) = P'Loop_Entry (J)))
else
(for all J in Index_16 range 0 .. I =>
(P (J) = P'Loop_Entry (J) and
Q (J) = Q'Loop_Entry (J)))
);
end loop;
-- Sanitize local variables as per the implementation in WireGuard.
-- Note that Swap cannot be sanitized here since it is
-- an "in" parameter
pragma Warnings (GNATProve, Off, "statement has no effect");
Sanitize_U32 (T);
Sanitize_U32 (C);
pragma Unreferenced (T);
pragma Unreferenced (C);
end CSwap32;
function Pack_25519 (N : in Normal_GF) return Bytes_32
is
-- Subtracting P twice from a Normal_GF might result
-- in a GF where limb 15 can be negative with lower bound -65536
subtype Temp_GF_MSL is I32 range -LM .. LMM1;
subtype Temp_GF is GF32
with Dynamic_Predicate =>
(Temp_GF (15) in Temp_GF_MSL and
(for all K in Index_16 range 0 .. 14 =>
Temp_GF (K) in GF32_Normal_Limb));
-- Expand a NormaL_16 (16 bit limbs) to 32-bit limbs
function To_GF32 (X : in Normal_GF) return GF32
is (GF32'(0 => GF32_Any_Limb (X (0)),
1 => GF32_Any_Limb (X (1)),
2 => GF32_Any_Limb (X (2)),
3 => GF32_Any_Limb (X (3)),
4 => GF32_Any_Limb (X (4)),
5 => GF32_Any_Limb (X (5)),
6 => GF32_Any_Limb (X (6)),
7 => GF32_Any_Limb (X (7)),
8 => GF32_Any_Limb (X (8)),
9 => GF32_Any_Limb (X (9)),
10 => GF32_Any_Limb (X (10)),
11 => GF32_Any_Limb (X (11)),
12 => GF32_Any_Limb (X (12)),
13 => GF32_Any_Limb (X (13)),
14 => GF32_Any_Limb (X (14)),
15 => GF32_Any_Limb (X (15))))
with Global => null,
Pure_Function;
-- Result := T - P;
-- if Underflow, then Result is not a Normal_GF
-- if not Underflow, then Result is a Normal_GF
procedure Subtract_P (T : in Temp_GF;
Result : out Temp_GF;
Underflow : out Boolean)
with Global => null,
Pre => T (15) >= -16#8000#,
Post => (Result (15) >= T (15) - 16#8000#) and then
(Underflow /= (Result in Normal_GF32));
function To_Bytes_32 (X : in Normal_GF32) return Bytes_32
with Global => null;
procedure Subtract_P (T : in Temp_GF;
Result : out Temp_GF;
Underflow : out Boolean)
is
Carry : I32_Bit;
R : GF32;
begin
R := GF32_0;
-- Limb 0 - subtract LSL of P, which is 16#FFED#
R (0) := T (0) - 16#FFED#;
-- Limbs 1 .. 14 - subtract FFFF with carry
for I in Index_16 range 1 .. 14 loop
pragma Loop_Optimize (No_Unroll);
Carry := ASR32_16 (R (I - 1)) mod 2;
R (I) := T (I) - 16#FFFF# - Carry;
R (I - 1) := R (I - 1) mod LM;
pragma Loop_Invariant
(for all J in Index_16 range 0 .. I - 1 =>
R (J) in GF32_Normal_Limb);
end loop;
-- Limb 15 - Subtract MSL (Most Significant Limb)
-- of P (16#7FFF#) with carry.
-- Note that Limb 15 might become negative on underflow
Carry := ASR32_16 (R (14)) mod 2;
R (15) := (T (15) - 16#7FFF#) - Carry;
-- Historical note: the original version of TweetNaCl had a bug
-- here, with the following line written as
-- R (15) := R (15) mod LM;
-- If this bug is re-introduced here, then SPARK _does_ report
-- this as a type-safety error, since if R (15) is normalized
-- but R (14) is not, then the prover is unable to show that
-- R is a Temp_GF subtype in the assignment to Result below.
R (14) := R (14) mod LM;
-- Note that R (15) is not normalized here, so that the
-- result of the first subtraction is numerically correct
-- as the input to the second.
Underflow := R (15) < 0;
Result := R;
Sanitize_GF32 (R);
pragma Unreferenced (R);
end Subtract_P;
function To_Bytes_32 (X : in Normal_GF32) return Bytes_32
is
Result : Bytes_32 := Zero_Bytes_32;
begin
for I in Index_16 loop
pragma Loop_Optimize (No_Unroll);
Result (2 * I) := Byte (X (I) mod 256);
Result (2 * I + 1) := Byte (X (I) / 256);
end loop;
return Result;
end To_Bytes_32;
L : GF32;
R1, R2 : Temp_GF;
First_Underflow : Boolean;
Second_Underflow : Boolean;
begin
-- Make a variable copy of N so can be passed to
-- calls to CSwap below
L := To_GF32 (N);
-- SPARKNaCl differs from TweetNaCl here, in that Pack_25519
-- takes a Normal_GF parameter N, so no further normalization
-- by Car_25519 is required here.
-- Readable, but variable-time version of this algorithm:
-- Subtract_P (L, R1, First_Underflow);
-- if First_Underflow then
-- return L;
-- else
-- Subtract_P (R1, R2, Second_Underflow);
-- if Second_Underflow then
-- return R1;
-- else
-- return R2;
-- end if;
-- end if;
-- Constant-time version: always do both subtractions, then
-- use CSwap to swap the right answer into R2
Subtract_P (L, R1, First_Underflow);
Subtract_P (R1, R2, Second_Underflow);
CSwap32 (R1, R2, Second_Underflow);
CSwap32 (L, R2, First_Underflow);
-- Sanitize local data as per the WireGuard sources
Sanitize_GF32 (L);
Sanitize_GF32 (R1);
Sanitize_Boolean (First_Underflow);
Sanitize_Boolean (Second_Underflow);
-- R2 needs to be a Normal_GF here. The post-conditions
-- of Subtract_P and CSwap conspire to make this so.
return To_Bytes_32 (R2);
pragma Unreferenced (R1);
pragma Unreferenced (L);
pragma Unreferenced (First_Underflow);
pragma Unreferenced (Second_Underflow);
end Pack_25519;
function Unpack_25519 (N : in Bytes_32) return Normal_GF
is
O : Normal_GF with Relaxed_Initialization;
begin
begin
for I in Index_16 loop
pragma Loop_Optimize (No_Unroll);
O (I) := U16 (N (2 * I)) + (U16 (N (2 * I + 1)) * 256);
pragma Loop_Invariant
(for all J in Index_16 range 0 .. I =>
O (J)'Initialized);
end loop;
O (15) := O (15) mod 32768;
end;
return O;
end Unpack_25519;
function Inv_25519 (I : in Normal_GF) return Normal_GF
is
C : Normal_GF;
begin
C := I;
for A in reverse 0 .. 253 loop
pragma Loop_Optimize (No_Unroll);
C := Square (C);
if (A /= 2 and A /= 4) then
C := C * I;
end if;
end loop;
return C;
end Inv_25519;
end SPARKNaCl.Utils;
|
src/kernel.asm | jasonmel/jasonmel-os | 0 | 167622 | [BITS 16]
;;;;; segment .text ;;;;;
segment .text
_start:
; set stack from 0x9000:0000 to 0x9000:FFFF
mov ax, 0x9000
mov ss, ax
mov sp, 0xFFFF
; show welcome
push welcome
call print_str
pop cx
push ds
; copy table here from 0x0080:0000 to 0x0100:label0
mov ax, 0x0080
mov ds, ax
mov ax, 0x0100
mov es, ax
mov cx, 384
xor si, si
mov di, label0
cld
rep
movsw
pop ds
.SHELL
; Show prompt
push prompt
call print_str
pop cx
; Get command
push cmd
call scan_str
pop cx
; Parse for ls
push cmd
push cmd_ls
call strcmp
pop cx
pop cx
or ax, ax
jnz .LS_HANDLER
; ; Parse for add
; push cmd
; push cmd_add
; call strcmp
; pop cx
; pop cx
; or ax, ax
; jnz .ADD_HANDLER
; Parse for rm
push cmd
push cmd_rm
call strcmp
pop cx
pop cx
or ax, ax
jnz .RM_HANDLER
; Parse for lls
push cmd
push cmd_lls
call strcmp
pop cx
pop cx
or ax, ax
jnz .LLS_HANDLER
; ; Parse for ladd
; push cmd
; push cmd_ladd
; call strcmp
; pop cx
; pop cx
; or ax, ax
; jnz .LADD_HANDLER
; ; Parse for lrm
; push cmd
; push cmd_lrm
; call strcmp
; pop cx
; pop cx
; or ax, ax
; jnz .LRM_HANDLER
; ; Parse for label
; push cmd
; push cmd_label
; call strcmp
; pop cx
; pop cx
; or ax, ax
; jnz .LABEL_HANDLER
jmp .DEFAULT_HANDLER
.LS_HANDLER
call ls_handler
jmp .NEXT
;.ADD_HANDLER
; call add_handler
; jmp .NEXT
.RM_HANDLER
call rm_handler
int 0x21
jmp .NEXT
.LLS_HANDLER
call lls_handler
jmp .NEXT
;.LADD_HANDLER
; call ladd_handler
; jmp .NEXT
;.LRM_HANDLER
; call lrm_handler
; jmp .NEXT
;.LABEL_HANDLER
; call label_handler
; jmp .NEXT
.DEFAULT_HANDLER
push default
call print_str
pop cx
call print_nl
jmp .NEXT
.NEXT
jmp .SHELL
; end of SHELL
ret
;;
;; void ls_handler(void)
;;
nop
nop
ls_handler:
push bp
mov bp, sp
push ls_header
call print_str
pop cx
push ds
mov ax, 0x0080
mov ds, ax ; ds = 0x0080
xor cx, cx
.LOOP
; file_n = [0x0080:0x80+0x10*n]
mov ax, 0x0010
mul cl ; ax = 0x10 * cl
add ax, 0x0080 ; ax = 0x10 * cl + 0x80
; check if valid file
push ax
add ax, 0x02
mov bx, ax
pop ax
cmp BYTE [bx], 0x00
je .NEXT
push ax
call print_file
pop ax
.NEXT
inc cl
cmp cl, 0x10
jb .LOOP
.DONE
call print_nl
pop ds
pop bp
;leave
ret
;;
;; void add_handler(void)
;;
; nop
; nop
;add_handler:
; push bp
; mov bp, sp
;.DONE
; call print_nl
; pop bp
; ;leave
; ret
;;
;; void rm_handler(void)
;;
nop
nop
rm_handler:
push bp
mov bp, sp
; Parse for files
xor dx, dx
.LOOP
mov ax, dx
mov cl, 0x10
mul cl ; ax = dx * 0x10
add ax, file0 ; ax = file0 + dx * 0x10
add ax, 0x04
mov bx, cmd
add bx, 0x03 ; bx = cmd + 0x03
push ax
push bx
call strcmp
pop cx
pop cx
or ax, ax
jnz .FOUND
inc dx
cmp dx, 0x10
je .NOT_FOUND
jmp .LOOP
.FOUND
; now dx is the matched file no.
; check if valid file
mov ax, dx
mov cl, 0x10
mul cl ; ax = dx * 0x10
add ax, file0 ; ax = file0 + dx * 0x10
mov bx, ax
cmp BYTE [bx+0x02], 0x00
je .LOOP
; save to kernel table
mov BYTE [bx+0x02], 0x00
; save to system table
mov ax, dx
mov cl, 0x10
mul cl
add ax, 0x80
mov bx, ax
push es
mov ax, 0x0080
mov es, ax
mov BYTE [es:bx+0x02], 0x00
pop es
push rm_found
call print_str
pop cx
jmp .DONE
.NOT_FOUND
push rm_notfound
call print_str
pop cx
.DONE
call print_nl
pop bp
;leave
ret
;;
;; void lls_handler(void)
;;
nop
nop
lls_handler:
push bp
mov bp, sp
; Parse for labels
xor dx, dx
.LOOP
mov ax, dx
mov cl, 0x08
mul cl ; ax = dx * 0x08
add ax, label0 ; ax = label0 + dx * 0x08
mov bx, cmd
add bx, 0x04 ; bx = cmd + 0x04
push ax
push bx
call strcmp
pop cx
pop cx
or ax, ax
jnz .FOUND
inc dx
cmp dx, 0x10
je .NOT_FOUND
jmp .LOOP
.FOUND
mov ax, 0x01
mov cl, dl
shl ax, cl ; now ax is the bit of the label
push ls_header
call print_str
pop cx
push ds
push ax
mov ax, 0x0080
mov ds, ax ; ds = 0x0080
pop ax
;mov [tmp], ax
mov [508], ax
xor cx, cx
.LLOOP
; file_n = [0x0080:0x80+0x10*n]
mov ax, 0x0010
mul cl ; ax = 0x10 * cl
add ax, 0x0080 ; ax = 0x10 * cl + 0x80
; check if valid file
push ax
add ax, 0x02
mov bx, ax
pop ax
cmp BYTE [bx], 0x00
je .NEXT
; check if right label
push ax
mov bx, ax
;mov ax, [tmp]
mov ax, [508]
and ax, [bx]
mov bx, ax
pop ax
cmp bx, 0x00
je .NEXT
push ax
call print_file
pop ax
.NEXT
inc cl
cmp cl, 0x10
jb .LLOOP
pop ds
jmp .DONE
.NOT_FOUND
push lls_notfound
call print_str
pop cx
.DONE
call print_nl
pop bp
;leave
ret
;;
;; void ladd_handler(void)
;;
; nop
; nop
;ladd_handler:
; push bp
; mov bp, sp
;
;.DONE
; call print_nl
; pop bp
; ;leave
; ret
;;
;; void lrm_handler(void)
;;
; nop
; nop
;lrm_handler:
; push bp
; mov bp, sp
;
;.DONE
; call print_nl
; pop bp
; ;leave
; ret
;;
;; void label_handler(void)
;;
; nop
; nop
;label_handler:
; push bp
; mov bp, sp
;
;.DONE
; call print_nl
; pop bp
; ;leave
; ret
;;
;; int strcmp(char* str1, char* str2);
;; @param str1 String to be compared.
;; @param str2 String to be compared.
;; @return 0 if false, current address if true.
;;
nop
nop
strcmp:
push bp
mov bp, sp
mov si, WORD [bp+4] ; str1 (defined)
mov di, WORD [bp+6] ; str2 (user input)
.LOOP
lodsb
cmp al, 0x00 ; check for end of string
je .TRUE
cmp al, BYTE [di] ; check for str2
jne .FALSE
inc di
jmp .LOOP
.FALSE
mov ax, 0x00
jmp .DONE
.TRUE
inc di
mov ax, di
jmp .DONE
.DONE
pop bp
;leave
ret
;;
;; void print_file(file* f);
;; @param f File to print out.
;;
nop
nop
print_file:
push bp
mov bp, sp
mov ax, WORD [bp+4]
; print file name
push ax
add ax, 0x04
push ax
call print_str
pop ax
pop ax
call print_sp
; print size
push ax
mov bx, ax
mov al, [bx+0x03]
mov dx, ax
call print_hex
pop ax
call print_sp
call print_sp
call print_sp
; print label
push ax
mov bx, ax
mov ax, [bx] ; ax = label_map
xor dx, dx
.LABEL_LOOP
mov bx, ax
and bx, 0x01
cmp bx, 0x00
je .LABEL_NEXT
push ax
mov ax, dx
mov bl, 0x08
mul bl
push ax
call print_str
pop ax
pop ax
call print_sp
.LABEL_NEXT
shr ax, 0x01
inc dx
cmp dx, 0x10
je .LABEL_OUT
jmp .LABEL_LOOP
.LABEL_OUT
pop ax
call print_nl
.DONE
pop bp
;leave
ret
;;
;; void print_str(char* str);
;; @param str String to print out.
;;
nop
nop
print_str:
push bp
mov bp, sp
mov si, WORD [bp+4]
pusha
.LOOP
lodsb ; load next character
or al, al ; test for NUL character
jz .DONE
mov ah, 0x0E ; BIOS teletype
mov bh, 0x00 ; display page 0
mov bl, 0x07 ; text attribute
int 0x10 ; invoke BIOS
jmp .LOOP
.DONE
popa
pop bp
;leave
ret
;;
;; void scan_str(char* str);
;; @param str String to scan from the user.
;;
nop
nop
scan_str:
push bp
mov bp, sp
mov di, WORD [bp+4]
.LOOP
mov ah, 0x00 ; get keyboard char
int 0x16
cmp al, 0x0D ; if "return"
je .DONE ; yes? goto end;
stosb
; print out
mov ah, 0x0E ; BIOS teletype
mov bh, 0x00 ; display page 0
mov bl, 0x07 ; text attribute
int 0x10 ; invoke BIOS
jmp .LOOP
.DONE
mov al, 0x00 ; put 0x0 at the end of string
stosb
call print_nl
pop bp
;leave
ret
;;
;; print the word contained in the dx register to the screen.
;;
nop
nop
print_hex:
pusha
mov cx, 4 ; 4 hex digits
.LOOP
rol dx, 4 ; rotate so that lowest 4 bits are used
mov ax, 0E0Fh ; ah = request, al = mask for nybble
and al, dl
add al, 90h ; convert al to ascii hex (four instructions)
daa ;
adc al, 40h
daa
int 10h
loop .LOOP
popa
ret
;;
;; print a new line
;;
nop
nop
print_nl:
push ax
mov ax, 0x0E0D ; CR
int 10h
mov al, 0x0A ; LF
int 10h
pop ax
ret
;;
;; print a space
;;
nop
nop
print_sp:
push ax
mov ax, 0x0E20 ; Space
int 10h
pop ax
ret
;;;;; segment .data ;;;;;
segment .data
welcome db "=====[Jasonmel kernel]=====", 0x0D, 0x0A, 0x00
prompt db "jasonmel> ", 0x00
cmd db " ", 0x00
cmd_ls db "ls", 0x00
cmd_add db "add", 0x00
cmd_rm db "rm", 0x00
cmd_lls db "lls", 0x00
cmd_ladd db "ladd", 0x00
cmd_lrm db "lrm", 0x00
cmd_label db "label", 0x00
default db "Command not found!", 0x0D, 0x0A, 0x00
ls_header db "[Name] [Size] [Label]", 0x0D, 0x0A, 0x00
rm_found db "File deleted!", 0x0D, 0x0A, 0x00
rm_notfound db "File not found!", 0x0D, 0x0A, 0x00
lls_notfound db "Label not found!", 0x0D, 0x0A, 0x00
; copied label_name
label0 db "debug", 0x00, " "
label1 db "ok?", 0x00, " "
label2 db "", 0x00, " "
label3 db "", 0x00, " "
label4 db "", 0x00, " "
label5 db "", 0x00, " "
label6 db "", 0x00, " "
label7 db "", 0x00, " "
label8 db "", 0x00, " "
label9 db "", 0x00, " "
labelA db "", 0x00, " "
labelB db "", 0x00, " "
labelC db "", 0x00, " "
labelD db "", 0x00, " "
labelE db "", 0x00, " "
labelF db "", 0x00, " "
; copied file table
; label_num next size file_name (11 char)
file0 db 0x01, 0x00, 0x01, 0x04, "kernel ", 0x00
file1 db 0x03, 0x00, 0xFF, 0x01, "shell ", 0x00
file2 db 0x02, 0x00, 0xFF, 0x01, "user1 ", 0x00
file3 db 0x02, 0x00, 0xFF, 0x01, "user2 ", 0x00
file4 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
file5 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
file6 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
file7 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
file8 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
file9 db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileA db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileB db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileC db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileD db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileE db 0x00, 0x00, 0x00, 0x00, " ", 0x00
fileF db 0x00, 0x00, 0x00, 0x00, " ", 0x00
;;;;; segment .bss ;;;;;
segment .bss
|
programs/oeis/240/A240877.asm | neoneye/loda | 22 | 175421 | <reponame>neoneye/loda
; A240877: Sum of the denominators of the Farey series of order n (A006843).
; 1,2,4,10,18,38,50,92,124,178,218,328,376,532,616,736,864,1136,1244,1586,1746,1998,2218,2724,2916,3416,3728,4214,4550,5362,5602,6532,7044,7704,8248,9088,9520,10852,11536,12472,13112,14752,15256,17062,17942,19022,20034,22196,22964,25022,26022,27654,28902,31658,32630,34830,36174,38226,39850,43272,44232,47892,49752,52020,54068,57188,58508,62930,65106,68142,69822,74792,76520,81776,84440,87440,90176,94796,96668,102830,105390,109764,113044,119850,121866,127306,130918,135790,139310,147142,149302,155854,159902,165482,169806,176646,179718,189030,193146,199086
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,2618 ; a(n) = n*phi(n).
add $1,$2
lpe
add $1,1
mov $0,$1
|
Task/Function-definition/Ada/function-definition-5.ada | LaudateCorpus1/RosettaCodeData | 1 | 18960 | <reponame>LaudateCorpus1/RosettaCodeData
function Multiply (A, B : Number) return Number is
begin
return A * B;
end Multiply;
|
libsrc/_DEVELOPMENT/font/fzx/fonts/ao/SpecDings/_ff_ao_SpecDings.asm | jpoikela/z88dk | 640 | 176872 | <gh_stars>100-1000
SECTION rodata_font
SECTION rodata_font_fzx
PUBLIC _ff_ao_SpecDings
_ff_ao_SpecDings:
BINARY "font/fzx/fonts/ao/SpecDings/SpecDings.fzx"
|
Driver/Printer/PrintCom/Text/Font/fontEpsonFXInfo.asm | steakknife/pcgeos | 504 | 178327 | <filename>Driver/Printer/PrintCom/Text/Font/fontEpsonFXInfo.asm<gh_stars>100-1000
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Epson model 9-pin drivers
FILE: fontEpsonFXInfo.asm
AUTHOR: <NAME>, 1 Aug 1992
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 8/1/92 Initial revision
DESCRIPTION:
This file contains the font information for the Epson fx printers
Other Printers Supported by this resource:
$Id: fontEpsonFXInfo.asm,v 1.1 97/04/18 11:49:52 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
printerFontInfo segment resource
word 0 ;dummy word to give non-zero offsets.
; mode info blocks
fx80draft label word
fx80nlq label word
nptr fx80_ROMAN12_10CPI
nptr fx80_ROMAN12_5CPI
nptr fx80_ROMAN12_6CPI
nptr fx80_ROMAN12_12CPI
nptr fx80_ROMAN12_17CPI
nptr fx80_ROMAN12_20CPI
nptr fx80_ROMAN12_PROP
nptr fx80_ROMAN24_5CPI
nptr fx80_ROMAN24_6CPI
nptr fx80_ROMAN24_10CPI
nptr fx80_ROMAN24_12CPI
nptr fx80_ROMAN24_PROP
word 0 ; table terminator
fx85draft label word
fx85nlq label word
nptr fx85_ROMAN12_10CPI
nptr fx85_ROMAN12_5CPI
nptr fx85_ROMAN12_6CPI
nptr fx85_ROMAN12_12CPI
nptr fx85_ROMAN12_17CPI
nptr fx85_ROMAN12_20CPI
nptr fx85_ROMAN12_PROP
nptr fx85_ROMAN24_5CPI
nptr fx85_ROMAN24_6CPI
nptr fx85_ROMAN24_10CPI
nptr fx85_ROMAN24_12CPI
nptr fx85_ROMAN24_PROP
word 0 ; table terminator
fx86edraft label word
fx86enlq label word
nptr fx85_ROMAN12_10CPI
nptr fx85_ROMAN12_5CPI
nptr fx86e_ROMAN12_6CPI
nptr fx86e_ROMAN12_12CPI
nptr fx85_ROMAN12_17CPI
nptr fx86e_ROMAN12_20CPI
nptr fx85_ROMAN12_PROP
nptr fx86e_SANS12_5CPI
nptr fx86e_SANS12_6CPI
nptr fx86e_SANS12_10CPI
nptr fx86e_SANS12_12CPI
nptr fx86e_SANS12_17CPI
nptr fx86e_SANS12_20CPI
nptr fx86e_SANS12_PROP
nptr fx85_ROMAN24_5CPI
nptr fx86e_ROMAN24_6CPI
nptr fx85_ROMAN24_10CPI
nptr fx86e_ROMAN24_12CPI
nptr fx85_ROMAN24_PROP
nptr fx86e_SANS24_5CPI
nptr fx86e_SANS24_6CPI
nptr fx86e_SANS24_10CPI
nptr fx86e_SANS24_12CPI
nptr fx86e_SANS24_PROP
word 0 ; table terminator
; font info blocks
fx80_ROMAN12_5CPI FontEntry < FID_DTC_URW_ROMAN, ; 5 pitch draft font
12, ; 12 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx85_ROMAN12_5CPI FontEntry < FID_DTC_URW_ROMAN, ; 5 pitch draft font
12, ; 12 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx80_ROMAN12_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
12, ; 12 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx85_ROMAN12_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
12, ; 12 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx86e_ROMAN12_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
12, ; 12 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx80_ROMAN12_10CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
12, ; 12 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;Mandatory style bits
>
fx85_ROMAN12_10CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
12, ; 12 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;Mandatory style bits
>
fx80_ROMAN12_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx85_ROMAN12_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx86e_ROMAN12_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx80_ROMAN12_17CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
12, ; 12 point font
TP_17_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx85_ROMAN12_17CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
12, ; 12 point font
TP_17_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx80_ROMAN12_20CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_20_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx85_ROMAN12_20CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_20_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx86e_ROMAN12_20CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
12, ; 12 point font
TP_20_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx80_ROMAN12_PROP FontEntry < FID_DTC_URW_ROMAN, ; proport. draft font
12, ; 12 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx85_ROMAN12_PROP FontEntry < FID_DTC_URW_ROMAN, ; proport. draft font
12, ; 12 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx86e_SANS12_5CPI FontEntry < FID_DTC_URW_SANS, ; 5 pitch draft font
12, ; 12 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchSans, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx86e_SANS12_6CPI FontEntry < FID_DTC_URW_SANS, ; 6 pitch draft font
12, ; 12 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchSans, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH ;Mandatory style bits
>
fx86e_SANS12_10CPI FontEntry < FID_DTC_URW_SANS, ; 10 pitch draft font
12, ; 12 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx86e_SANS12_12CPI FontEntry < FID_DTC_URW_SANS, ; 12 pitch draft font
12, ; 12 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx86e_SANS12_17CPI FontEntry < FID_DTC_URW_SANS, ; 10 pitch draft font
12, ; 12 point font
TP_17_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx86e_SANS12_20CPI FontEntry < FID_DTC_URW_SANS, ; 12 pitch draft font
12, ; 12 point font
TP_20_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLHEIGHT,
mask PTS_CONDENSED ;mandatory style bits
>
fx86e_SANS12_PROP FontEntry < FID_DTC_URW_SANS, ; proport. draft font
12, ; 12 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
0 ;mandatory style bits
>
fx80_ROMAN24_5CPI FontEntry < FID_DTC_URW_ROMAN, ; 5 pitch draft font
24, ; 24 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx85_ROMAN24_5CPI FontEntry < FID_DTC_URW_ROMAN, ; 5 pitch draft font
24, ; 24 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx80_ROMAN24_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
24, ; 24 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx85_ROMAN24_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
24, ; 24 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx86e_ROMAN24_6CPI FontEntry < FID_DTC_URW_ROMAN, ; 6 pitch draft font
24, ; 24 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx80_ROMAN24_10CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
24, ; 24 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx85_ROMAN24_10CPI FontEntry < FID_DTC_URW_ROMAN, ; 10 pitch draft font
24, ; 24 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchRoman, ; control code
; text style
; legal bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx80_ROMAN24_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
24, ; 24 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx85_ROMAN24_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
24, ; 24 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx86e_ROMAN24_12CPI FontEntry < FID_DTC_URW_ROMAN, ; 12 pitch draft font
24, ; 24 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx80_ROMAN24_PROP FontEntry < FID_DTC_URW_ROMAN, ; proport. draft font
24, ; 24 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx85_ROMAN24_PROP FontEntry < FID_DTC_URW_ROMAN, ; proport. draft font
24, ; 24 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalRoman, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx86e_SANS24_5CPI FontEntry < FID_DTC_URW_SANS, ; 5 pitch draft font
24, ; 24 point font
TP_5_PITCH, ; 5 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchSans, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx86e_SANS24_6CPI FontEntry < FID_DTC_URW_SANS, ; 6 pitch draft font
24, ; 24 point font
TP_6_PITCH, ; 6 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchSans, ; control code
; text style
; legal bits
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx86e_SANS24_10CPI FontEntry < FID_DTC_URW_SANS, ; 10 pitch draft font
24, ; 24 point font
TP_10_PITCH, ; 10 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set10PitchSans, ; control code
; text style
; legal bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;Mandatory style bits
>
fx86e_SANS24_12CPI FontEntry < FID_DTC_URW_SANS, ; 12 pitch draft font
24, ; 24 point font
TP_12_PITCH, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_Set12PitchSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLHEIGHT ;mandatory style bits
>
fx86e_SANS24_PROP FontEntry < FID_DTC_URW_SANS, ; proport. draft font
24, ; 24 point font
TP_PROPORTIONAL, ; 12 pitch font
PSS_IBM437, ; PrinterCharSet
offset pr_codes_SetProportionalSans, ; control code
; text style
; compatibility bits
mask PTS_CONDENSED or \
mask PTS_SUBSCRIPT or \
mask PTS_SUPERSCRIPT or \
mask PTS_NLQ or \
mask PTS_BOLD or \
mask PTS_ITALIC or \
mask PTS_UNDERLINE or \
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT,
mask PTS_DBLWIDTH or \
mask PTS_DBLHEIGHT ;mandatory style bits
>
printerFontInfo ends
|
programs/oeis/100/A100057.asm | karttu/loda | 0 | 82112 | <reponame>karttu/loda
; A100057: Sum of absolute differences of p(n) defined in A054065, oriented around a clock.
; 2,4,8,12,18,24,30,40,50,60,70,80,96,112,128,144,160,176,192,208,234,260,286,312,338,364,390,416,442,468,494,520,546,588,630,672,714,756,798,840,882,924,966,1008,1050,1092,1134,1176,1218,1260,1302,1344,1386
mov $14,$0
mov $16,$0
add $16,1
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
add $13,1
lpb $13,1
mov $0,$11
sub $13,1
sub $0,$13
mov $7,$0
mov $9,2
lpb $9,1
sub $9,1
add $0,$9
sub $0,1
mov $1,1
mov $2,$0
add $4,$0
lpb $2,1
lpb $4,1
mov $3,$6
mov $5,1
mov $6,$1
add $1,$3
trn $4,$1
lpe
lpb $5,1
trn $5,$1
mov $6,0
lpe
sub $2,1
lpe
mov $10,$9
lpb $10,1
mov $8,$1
sub $10,1
lpe
lpe
lpb $7,1
mov $7,0
sub $8,$1
lpe
mov $1,$8
mul $1,2
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
|
swap.asm | shaochenren/Assembly-swap | 0 | 98786 | ;shaochenren
extern printf
extern scanf
global swap
section .data
section .bss
section .text
swap:
push rbp ;Backup rbp
mov rbp,rsp ;The base pointer now points to top of stack
push rdi ;Backup rdi
push rsi ;Backup rsi
push rdx ;Backup rdx
push rcx ;Backup rcx
push r8 ;Backup r8
push r9 ;Backup r9
push r10 ;Backup r10
push r11 ;Backup r11
push r12 ;Backup r12
push r13 ;Backup r13
push r14 ;Backup r14
push r15 ;Backup r15
push rbx ;Backup rbx
pushf ;Backup rflags
push rax
;===============swap===========
mov r14, rdi ;array
mov r12, rsi ;First value to swap
mov r15, rdx ;Second value to swap
mov r8, [r14 + r12 * 8]
mov r9, [r14 + r15 *8]
mov [r14 + r12 * 8], r9
mov [r14 + r15 *8], r8
;====================================================================
endSwap:
pop rax
popf ;Restore rflags
pop rbx ;Restore rbx
pop r15 ;Restore r15
pop r14 ;Restore r14
pop r13 ;Restore r13
pop r12 ;Restore r12
pop r11 ;Restore r11
pop r10 ;Restore r10
pop r9 ;Restore r9
pop r8 ;Restore r8
pop rcx ;Restore rcx
pop rdx ;Restore rdx
pop rsi ;Restore rsi
pop rdi ;Restore rdi
pop rbp ;Restore rbp
ret
|
Categories/Families.agda | jmchapman/Relative-Monads | 21 | 16714 | <reponame>jmchapman/Relative-Monads
module Categories.Families where
open import Library
open import Categories
open Cat
Fam : Set → Cat
Fam I = record {
Obj = I → Set;
Hom = λ A B → ∀ {i} → A i → B i;
iden = id;
comp = λ f g → f ∘ g;
idl = refl;
idr = refl;
ass = refl}
|
alloy4fun_models/trashltl/models/8/b6XnWtBTrYvKjxNGs.als | Kaixi26/org.alloytools.alloy | 0 | 165 | <filename>alloy4fun_models/trashltl/models/8/b6XnWtBTrYvKjxNGs.als
open main
pred idb6XnWtBTrYvKjxNGs_prop9 {
always Protected not in Trash
}
pred __repair { idb6XnWtBTrYvKjxNGs_prop9 }
check __repair { idb6XnWtBTrYvKjxNGs_prop9 <=> prop9o } |
examples/rdrand_edx.asm | dd86k/ddcput | 1 | 169901 | <filename>examples/rdrand_edx.asm
; Compile with: NASM -fbin cpuid_1.asm
BITS 64 ; Avoids nasm putting the OPCODE prefix (66h)
RDRAND EDX |
Test/Assembler/Test01.asm | CharlesCarley/HackComputer | 0 | 241484 | // -- 01 --
@0 M=-1 // == -1
// -- 02 --
@256 D=A
@1 M=D // == 256
// -- 03 --
@123 MD=A
@2 M=D // == 123
// -- 04 --
@123 D=M // == 123
@3 M=D // == 123
// -- 05 --
@15 M=0
@15 M=M+1 D=M
@16384 A=D+A M=!M
D=M
@4 M=D
@15 M=M+1 D=M
@16384 A=D+A M=!M
D=M
@5 M=D
@15 M=M+1 D=M
@16384 A=D+A M=!M
D=M
@6 M=D
@15 M=M+1 D=M
@16384 A=D+A M=!M
D=M
@7 M=D |
assembler/tests/t_cpualias/t_cpualias.asm | paulscottrobson/RCA-Cosmac-VIP-III | 0 | 93012 | cpu ATMEGAPRIVATE
ldi r16,5
loop: subi r16,1
brne loop
|
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_pxy2saddr_callee.asm | jpoikela/z88dk | 640 | 21542 |
; void *zx_pxy2saddr_callee(uchar x, uchar y)
SECTION code_clib
SECTION code_arch
PUBLIC _zx_pxy2saddr_callee
EXTERN asm_zx_pxy2saddr
_zx_pxy2saddr_callee:
pop hl
ex (sp),hl
jp asm_zx_pxy2saddr
|
asm/dos_reveal_map.asm | Iemnur/DSVEdit | 70 | 28136 | .nds
.relativeinclude on
.erroronwarning on
; Makes the entire map visible but greyed out from the start.
.open "ftc/arm9.bin", 02000000h
.org 0x020220C4
; Make the game not care if you have the map items and just always draw unvisited tiles.
mov r1, r8
nop
.org 0x02024BE8
; Makes rooms never be counted as secret rooms, since secret rooms don't show up even if the game thinks you have the map for that area.
mvn r0, 0h
bx r14
.close
|
source/amf/uml/amf-internals-uml_actors.ads | svn2github/matreshka | 24 | 29057 | ------------------------------------------------------------------------------
-- --
-- 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_Classifiers;
with AMF.String_Collections;
with AMF.UML.Actors;
with AMF.UML.Behaviors.Collections;
with AMF.UML.Classifier_Template_Parameters;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Collaboration_Uses.Collections;
with AMF.UML.Constraints.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Element_Imports.Collections;
with AMF.UML.Features.Collections;
with AMF.UML.Generalization_Sets.Collections;
with AMF.UML.Generalizations.Collections;
with AMF.UML.Interface_Realizations.Collections;
with AMF.UML.Named_Elements.Collections;
with AMF.UML.Namespaces;
with AMF.UML.Package_Imports.Collections;
with AMF.UML.Packageable_Elements.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameterable_Elements.Collections;
with AMF.UML.Properties.Collections;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.Redefinable_Template_Signatures;
with AMF.UML.String_Expressions;
with AMF.UML.Substitutions.Collections;
with AMF.UML.Template_Bindings.Collections;
with AMF.UML.Template_Parameters;
with AMF.UML.Template_Signatures;
with AMF.UML.Types;
with AMF.UML.Use_Cases.Collections;
with AMF.Visitors;
package AMF.Internals.UML_Actors is
type UML_Actor_Proxy is
limited new AMF.Internals.UML_Classifiers.UML_Classifier_Proxy
and AMF.UML.Actors.UML_Actor with null record;
overriding function Get_Classifier_Behavior
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access;
-- Getter of BehavioredClassifier::classifierBehavior.
--
-- A behavior specification that specifies the behavior of the classifier
-- itself.
overriding procedure Set_Classifier_Behavior
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access);
-- Setter of BehavioredClassifier::classifierBehavior.
--
-- A behavior specification that specifies the behavior of the classifier
-- itself.
overriding function Get_Interface_Realization
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Interface_Realizations.Collections.Set_Of_UML_Interface_Realization;
-- Getter of BehavioredClassifier::interfaceRealization.
--
-- The set of InterfaceRealizations owned by the BehavioredClassifier.
-- Interface realizations reference the Interfaces of which the
-- BehavioredClassifier is an implementation.
overriding function Get_Owned_Behavior
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior;
-- Getter of BehavioredClassifier::ownedBehavior.
--
-- References behavior specifications owned by a classifier.
overriding function Get_Attribute
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property;
-- Getter of Classifier::attribute.
--
-- Refers to all of the Properties that are direct (i.e. not inherited or
-- imported) attributes of the classifier.
overriding function Get_Collaboration_Use
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use;
-- Getter of Classifier::collaborationUse.
--
-- References the collaboration uses owned by the classifier.
overriding function Get_Feature
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature;
-- Getter of Classifier::feature.
--
-- Specifies each feature defined in the classifier.
-- Note that there may be members of the Classifier that are of the type
-- Feature but are not included in this association, e.g. inherited
-- features.
overriding function Get_General
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of Classifier::general.
--
-- Specifies the general Classifiers for this Classifier.
-- References the general classifier in the Generalization relationship.
overriding function Get_Generalization
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization;
-- Getter of Classifier::generalization.
--
-- Specifies the Generalization relationships for this Classifier. These
-- Generalizations navigaten to more general classifiers in the
-- generalization hierarchy.
overriding function Get_Inherited_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Classifier::inheritedMember.
--
-- Specifies all elements inherited by this classifier from the general
-- classifiers.
overriding function Get_Is_Abstract
(Self : not null access constant UML_Actor_Proxy)
return Boolean;
-- Getter of Classifier::isAbstract.
--
-- If true, the Classifier does not provide a complete declaration and can
-- typically not be instantiated. An abstract classifier is intended to be
-- used by other classifiers e.g. as the target of general
-- metarelationships or generalization relationships.
overriding function Get_Is_Final_Specialization
(Self : not null access constant UML_Actor_Proxy)
return Boolean;
-- Getter of Classifier::isFinalSpecialization.
--
-- If true, the Classifier cannot be specialized by generalization. Note
-- that this property is preserved through package merge operations; that
-- is, the capability to specialize a Classifier (i.e.,
-- isFinalSpecialization =false) must be preserved in the resulting
-- Classifier of a package merge operation where a Classifier with
-- isFinalSpecialization =false is merged with a matching Classifier with
-- isFinalSpecialization =true: the resulting Classifier will have
-- isFinalSpecialization =false.
overriding procedure Set_Is_Final_Specialization
(Self : not null access UML_Actor_Proxy;
To : Boolean);
-- Setter of Classifier::isFinalSpecialization.
--
-- If true, the Classifier cannot be specialized by generalization. Note
-- that this property is preserved through package merge operations; that
-- is, the capability to specialize a Classifier (i.e.,
-- isFinalSpecialization =false) must be preserved in the resulting
-- Classifier of a package merge operation where a Classifier with
-- isFinalSpecialization =false is merged with a matching Classifier with
-- isFinalSpecialization =true: the resulting Classifier will have
-- isFinalSpecialization =false.
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access;
-- Getter of Classifier::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access);
-- Setter of Classifier::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding function Get_Owned_Use_Case
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case;
-- Getter of Classifier::ownedUseCase.
--
-- References the use cases owned by this classifier.
overriding function Get_Powertype_Extent
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set;
-- Getter of Classifier::powertypeExtent.
--
-- Designates the GeneralizationSet of which the associated Classifier is
-- a power type.
overriding function Get_Redefined_Classifier
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of Classifier::redefinedClassifier.
--
-- References the Classifiers that are redefined by this Classifier.
overriding function Get_Representation
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access;
-- Getter of Classifier::representation.
--
-- References a collaboration use which indicates the collaboration that
-- represents this classifier.
overriding procedure Set_Representation
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access);
-- Setter of Classifier::representation.
--
-- References a collaboration use which indicates the collaboration that
-- represents this classifier.
overriding function Get_Substitution
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution;
-- Getter of Classifier::substitution.
--
-- References the substitutions that are owned by this Classifier.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access;
-- Getter of Classifier::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access);
-- Setter of Classifier::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function Get_Use_Case
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case;
-- Getter of Classifier::useCase.
--
-- The set of use cases for which this Classifier is the subject.
overriding function Get_Element_Import
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import;
-- Getter of Namespace::elementImport.
--
-- References the ElementImports owned by the Namespace.
overriding function Get_Imported_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Getter of Namespace::importedMember.
--
-- References the PackageableElements that are members of this Namespace
-- as a result of either PackageImports or ElementImports.
overriding function Get_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Namespace::member.
--
-- A collection of NamedElements identifiable within the Namespace, either
-- by being owned or by being introduced by importing or inheritance.
overriding function Get_Owned_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Namespace::ownedMember.
--
-- A collection of NamedElements owned by the Namespace.
overriding function Get_Owned_Rule
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Namespace::ownedRule.
--
-- Specifies a set of Constraints owned by this Namespace.
overriding function Get_Package_Import
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import;
-- Getter of Namespace::packageImport.
--
-- References the PackageImports owned by the Namespace.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Actor_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_Actor_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_Actor_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_Actor_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_Actor_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_Package
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Packages.UML_Package_Access;
-- Getter of Type::package.
--
-- Specifies the owning package of this classifier, if any.
overriding procedure Set_Package
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Packages.UML_Package_Access);
-- Setter of Type::package.
--
-- Specifies the owning package of this classifier, if any.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Actor_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_Actor_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_Actor_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_Actor_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 Get_Owned_Template_Signature
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access;
-- Getter of TemplateableElement::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Actor_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access);
-- Setter of TemplateableElement::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding function Get_Template_Binding
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding;
-- Getter of TemplateableElement::templateBinding.
--
-- The optional bindings from this element to templates.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Actor_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Actor_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function All_Features
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature;
-- Operation Classifier::allFeatures.
--
-- The query allFeatures() gives all of the features in the namespace of
-- the classifier. In general, through mechanisms such as inheritance,
-- this will be a larger set than feature.
overriding function Conforms_To
(Self : not null access constant UML_Actor_Proxy;
Other : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean;
-- Operation Classifier::conformsTo.
--
-- The query conformsTo() gives true for a classifier that defines a type
-- that conforms to another. This is used, for example, in the
-- specification of signature conformance for operations.
overriding function General
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::general.
--
-- The general classifiers are the classifiers referenced by the
-- generalization relationships.
overriding function Has_Visibility_Of
(Self : not null access constant UML_Actor_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access)
return Boolean;
-- Operation Classifier::hasVisibilityOf.
--
-- The query hasVisibilityOf() determines whether a named element is
-- visible in the classifier. By default all are visible. It is only
-- called when the argument is something owned by a parent.
overriding function Inherit
(Self : not null access constant UML_Actor_Proxy;
Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Classifier::inherit.
--
-- The query inherit() defines how to inherit a set of elements. Here the
-- operation is defined to inherit them all. It is intended to be
-- redefined in circumstances where inheritance is affected by
-- redefinition.
-- The inherit operation is overridden to exclude redefined properties.
overriding function Inheritable_Members
(Self : not null access constant UML_Actor_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Classifier::inheritableMembers.
--
-- The query inheritableMembers() gives all of the members of a classifier
-- that may be inherited in one of its descendants, subject to whatever
-- visibility restrictions apply.
overriding function Inherited_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Classifier::inheritedMember.
--
-- The inheritedMember association is derived by inheriting the
-- inheritable members of the parents.
-- The inheritedMember association is derived by inheriting the
-- inheritable members of the parents.
overriding function Is_Template
(Self : not null access constant UML_Actor_Proxy)
return Boolean;
-- Operation Classifier::isTemplate.
--
-- The query isTemplate() returns whether this templateable element is
-- actually a template.
overriding function May_Specialize_Type
(Self : not null access constant UML_Actor_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean;
-- Operation Classifier::maySpecializeType.
--
-- The query maySpecializeType() determines whether this classifier may
-- have a generalization relationship to classifiers of the specified
-- type. By default a classifier may specialize classifiers of the same or
-- a more general type. It is intended to be redefined by classifiers that
-- have different specialization constraints.
overriding function Exclude_Collisions
(Self : not null access constant UML_Actor_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::excludeCollisions.
--
-- The query excludeCollisions() excludes from a set of
-- PackageableElements any that would not be distinguishable from each
-- other in this namespace.
overriding function Get_Names_Of_Member
(Self : not null access constant UML_Actor_Proxy;
Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
return AMF.String_Collections.Set_Of_String;
-- Operation Namespace::getNamesOfMember.
--
-- The query getNamesOfMember() takes importing into account. It gives
-- back the set of names that an element would have in an importing
-- namespace, either because it is owned, or if not owned then imported
-- individually, or if not individually then from a package.
-- The query getNamesOfMember() gives a set of all of the names that a
-- member would have in a Namespace. In general a member can have multiple
-- names in a Namespace if it is imported more than once with different
-- aliases. The query takes account of importing. It gives back the set of
-- names that an element would have in an importing namespace, either
-- because it is owned, or if not owned then imported individually, or if
-- not individually then from a package.
overriding function Import_Members
(Self : not null access constant UML_Actor_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::importMembers.
--
-- The query importMembers() defines which of a set of PackageableElements
-- are actually imported into the namespace. This excludes hidden ones,
-- i.e., those which have names that conflict with names of owned members,
-- and also excludes elements which would have the same name when imported.
overriding function Imported_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::importedMember.
--
-- The importedMember property is derived from the ElementImports and the
-- PackageImports. References the PackageableElements that are members of
-- this Namespace as a result of either PackageImports or ElementImports.
overriding function Members_Are_Distinguishable
(Self : not null access constant UML_Actor_Proxy)
return Boolean;
-- Operation Namespace::membersAreDistinguishable.
--
-- The Boolean query membersAreDistinguishable() determines whether all of
-- the namespace's members are distinguishable within it.
overriding function Owned_Member
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Namespace::ownedMember.
--
-- Missing derivation for Namespace::/ownedMember : NamedElement
overriding function All_Owning_Packages
(Self : not null access constant UML_Actor_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_Actor_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_Actor_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Conforms_To
(Self : not null access constant UML_Actor_Proxy;
Other : AMF.UML.Types.UML_Type_Access)
return Boolean;
-- Operation Type::conformsTo.
--
-- The query conformsTo() gives true for a type that conforms to another.
-- By default, two types do not conform to each other. This query is
-- intended to be redefined for specific conformance situations.
overriding function Is_Compatible_With
(Self : not null access constant UML_Actor_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_Actor_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding function Parameterable_Elements
(Self : not null access constant UML_Actor_Proxy)
return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element;
-- Operation TemplateableElement::parameterableElements.
--
-- The query parameterableElements() returns the set of elements that may
-- be used as the parametered elements for a template parameter of this
-- templateable element. By default, this set includes all the owned
-- elements. Subclasses may override this operation if they choose to
-- restrict the set of parameterable elements.
overriding function Is_Consistent_With
(Self : not null access constant UML_Actor_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Actor_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding procedure Enter_Element
(Self : not null access constant UML_Actor_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_Actor_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_Actor_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_Actors;
|
libsrc/_DEVELOPMENT/fcntl/z80/__fcntl_fdstruct_from_fd_2.asm | jpoikela/z88dk | 640 | 169545 |
SECTION code_clib
SECTION code_fcntl
PUBLIC __fcntl_fdstruct_from_fd_2
EXTERN __fcntl_fdstruct_from_fd_1, error_ebdfd_zc
__fcntl_fdstruct_from_fd_2:
; return FDSTRUCT* at index fd
;
; enter : hl = int fd
;
; exit : success
;
; ix = de = FDSTRUCT *
; hl = & fdtbl[fd] + 1b
; carry reset
;
; fail
;
; hl = 0
; carry set, errno = EBDFD
;
; uses : af, de, hl, ix
call __fcntl_fdstruct_from_fd_1
ret c ; if fd out of range
jp z, error_ebdfd_zc ; if fd vacant
push de
pop ix ; ix = FDSTRUCT *
ret
|
alloy4fun_models/trashltl/models/6/L3nQrfm4qjoLmLDEb.als | Kaixi26/org.alloytools.alloy | 0 | 2623 | open main
pred idL3nQrfm4qjoLmLDEb_prop7 {
always all f : File | f in Protected
}
pred __repair { idL3nQrfm4qjoLmLDEb_prop7 }
check __repair { idL3nQrfm4qjoLmLDEb_prop7 <=> prop7o } |
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_1_1335.asm | ljhsiun2/medusa | 9 | 98377 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rax
push %rbx
push %rcx
push %rdi
// Store
lea addresses_A+0x14fe9, %rcx
mfence
movl $0x51525354, (%rcx)
nop
nop
nop
nop
cmp %r10, %r10
// Faulty Load
lea addresses_RW+0x18989, %r10
nop
nop
nop
nop
nop
and %rbx, %rbx
vmovaps (%r10), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdi
lea oracles, %r10
and $0xff, %rdi
shlq $12, %rdi
mov (%r10,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 1}
00
*/
|
kernel/asm.asm | Littledarren/os_exp | 0 | 245314 | <reponame>Littledarren/os_exp
[global TEMP_EAX]
[global TEMP_EBX]
[global TEMP_ECX]
[global TEMP_EDX]
[global TEMP_ESI]
[global TEMP_EBP]
[global TEMP_EDI]
[global TEMP_ESP]
[global TEMP_SS]
[global TEMP_DS]
[global TEMP_ES]
[global TEMP_FS]
[global TEMP_GS]
[global TEMP_CS]
[global TEMP_EIP]
[global TEMP_EFLAGS]
TEMP_EAX: dd 0
TEMP_EBX: dd 0
TEMP_ECX: dd 0
TEMP_EDX: dd 0
TEMP_ESI: dd 0
TEMP_EBP: dd 0
TEMP_EDI: dd 0
TEMP_ESP: dd 0
TEMP_SS: dd 0
TEMP_DS: dd 0
TEMP_ES: dd 0
TEMP_FS: dd 0
TEMP_GS: dd 0
TEMP_CS: dd 0
TEMP_EIP: dd 0
TEMP_EFLAGS: dd 0
;用于系统调用
[global SYS_FUNC]
[global SYS_CODE]
SYS_FUNC: dd 0
SYS_CODE: dd 0
[extern handler]
;保存中断号
%macro m_irq 1
[global _irq__%1]
_irq__%1:
;push eflags
;push cs
;push eip <---esp
push esp
push eax
push ebx
push ecx
push edx
push ebp
push edi
push esi
push ss
push es
push ds
push fs
push gs
;进入内核全局区。
mov ax, 0x10
mov ds, ax
;保存有关信息
pop dword [TEMP_GS]
pop dword [TEMP_FS]
pop dword [TEMP_DS]
pop dword [TEMP_ES]
pop dword [TEMP_SS]
pop dword [TEMP_ESI]
pop dword [TEMP_EDI]
pop dword [TEMP_EBP]
pop dword [TEMP_EDX]
pop dword [TEMP_ECX]
pop dword [TEMP_EBX]
pop dword [TEMP_EAX]
pop dword [TEMP_ESP]
pop dword [TEMP_EIP]
pop dword [TEMP_CS]
pop dword [TEMP_EFLAGS]
;not smart
mov eax, 16
cmp eax, %1
jne NOT_SYS_CALL%1
pop dword [SYS_FUNC]
mov eax, [SYS_FUNC]
cmp eax, 5
jne NOT_EXIT_PARA%1
pop dword [SYS_CODE]
NOT_EXIT_PARA%1:
NOT_SYS_CALL%1:
;进入到内核栈
;最后保存栈,确保传入的参数都被弹出。
mov [TEMP_ESP], esp
mov ax, 0x10
mov ss, ax
mov sp, 0x7e00
push dword %1+32
call handler
pop eax
;到用户栈
push dword [TEMP_SS]
pop ss
mov esp, [TEMP_ESP]
push dword [TEMP_ES]
pop es
push dword [TEMP_FS]
pop fs
push dword [TEMP_GS]
pop gs
;这里绝对不能改ds
mov eax, [TEMP_EAX]
mov ebx, [TEMP_EBX]
mov ecx, [TEMP_ECX]
mov edx, [TEMP_EDX]
mov esi, [TEMP_ESI]
mov edi, [TEMP_EDI]
mov ebp, [TEMP_EBP]
push dword [TEMP_EFLAGS]
push dword [TEMP_CS]
push dword [TEMP_EIP]
push dword [TEMP_DS]
pop ds
iret
%endmacro
;通过系统全局变量来传递参数。同时通过修改这些全局变量可以实现上下文的切换
;0x20 ~0x2f
%assign i 0
%rep 16
m_irq i
%assign i i+1
%endrep
;0x30 ~ 0x30 + 10
%assign i 16
%rep 10
m_irq i
%assign i i+1
%endrep
;0 --> exit without telling
;3 --> fork
;4 --> wait
;5 --> exit with code
;int fork()
[global fork]
fork:
push dword 3
int 0x30
ret
;void exit()
[global exit]
exit:
push dword 0
int 0x30
jmp $
ret
;int Wait()
[global _wait]
_wait:
push dword 4
int 0x30
ret
;void exit(char ch)
[global exit_para]
exit_para:
push ebp
mov ebp, esp
xor eax, eax
mov eax, [ebp + 8]
push eax
push dword 5
int 0x30
leave
ret
; 无特权级切换
; EFLAGS
; CS
; EIP
; ErrorCode -->不存在
; 有特权切换
; SS
; ESP
; EFLAGS
; CS
; EIP
; ErrorCode
;pusha-->
; Push(EAX);
; Push(ECX);
; Push(EDX);
; Push(EBX);
; Push(ESP);这个SP是没有压栈之前的。
; Push(EBP);
; Push(ESI);
; Push(EDI); |
STEP/ANTLR gens/STEP.g4 | KarmaKamikaze/STEP | 1 | 6360 | grammar STEP;
// Parser Rules
// Program
program
: NL* variables? setuploop functions?
;
setuploop
: setup NL*
| loop NL*
| setup NL* loop NL*
;
setup
: SETUP stmt* ENDSETUP
;
loop
: LOOP stmt* ENDLOOP
;
// Global variable declarations
variables
: VARIABLES var_or_nl* ENDVARIABLES NL*
;
var_or_nl
: vardcl
| pindcl
| NL
;
// Function declarations
functions
: FUNCTIONS funcdcl_or_nl* ENDFUNCTIONS NL*
;
funcdcl
: type brackets? FUNCTION ID params stmt* retstmt NL ENDFUNCTION NL
| BLANK FUNCTION ID params stmt* ENDFUNCTION NL
;
funcdcl_or_nl
: funcdcl
| NL
;
brackets
: LBRACK RBRACK
;
params
: LPAREN params_content? RPAREN
;
params_content
: paramstype brackets? ID params_multi*
;
params_multi
: COMMA paramstype brackets? ID
;
type
: NUMBER
| STRING
| BOOLEAN
;
paramstype
: pintype
| type
;
// Statements
stmt
: stmts? NL
;
stmts
: ifstmt
| whilestmt
| forstmt
| vardcl
| assstmt
| funccall
| retstmt
;
loop_stmt
: loop_stmts? NL
;
loop_stmts
: loopifstmt
| whilestmt
| forstmt
| vardcl
| assstmt
| funccall
| retstmt
;
loopifbody
: loop_stmt
| CONTINUE NL
| BREAK NL
;
ifstmt
: IF LPAREN logicexpr RPAREN stmt* elseifstmt* elsestmt? ENDIF;
elseifstmt
: ELSE IF LPAREN logicexpr RPAREN stmt*;
elsestmt
: ELSE stmt*;
loopifstmt
: IF LPAREN logicexpr RPAREN loopifbody* loopelseifstmt* loopelsestmt? ENDIF;
loopelseifstmt
: ELSE IF LPAREN logicexpr RPAREN loopifbody*;
loopelsestmt
: ELSE loopifbody*;
whilestmt
: REPEATWHILE LPAREN logicexpr RPAREN loop_stmt* ENDWHILE
;
forstmt
: REPEATFOR LPAREN for_iter_opt (UPTO|DOWNTO) expr COMMA CHANGEBY expr RPAREN loop_stmt* ENDFOR
;
for_iter_opt
: numdcl
| assstmt
| ID arrindex?
;
assstmt
: ID arrindex? ASSIGN logicexpr
;
funccall
: ID LPAREN params_options? RPAREN
;
params_options
: logicexpr multi_expr*
;
multi_expr
: COMMA logicexpr
;
retstmt
: RETURN logicexpr?
;
arrindex
: LBRACK expr RBRACK
;
// Arithmetic expressions
expr
: expr PLUS term
| expr MINUS term
| term
;
term
: term MULT factor
| term DIVIDE factor
| factor
;
factor
: factor POW value
| value
;
value
: MINUS? (constant
| ID arrindex?
| LPAREN logicexpr RPAREN
| funccall)
;
constant
: NUMLITERAL
| INTLITERAL
| STRLITERAL
| BOOLLITERAL
;
// Boolean expressions
logicexpr
: logicexpr AND logicequal
| logicexpr OR logicequal
| logicequal
;
logicequal
: logiccomp EQ logiccomp
| logiccomp NEQ logiccomp
| logiccomp
;
logiccomp
: logicvalue logiccompop logicvalue
| logicvalue
;
logiccompop
: GRTHANEQ
| GRTHAN
| LTHANEQ
| LTHAN
;
logicvalue
: NEG? expr
;
// Variable declarations
vardcl
: CONSTANT? var_options
;
var_options
: numdcl
| stringdcl
| booldcl
| arrdcl
;
numdcl
: NUMBER ID ASSIGN expr
;
stringdcl
: STRING ID ASSIGN expr
;
booldcl
: BOOLEAN ID ASSIGN logicexpr
;
pindcl
: pinmode pintype ID ASSIGN INTLITERAL
;
pinmode
: INPUT
| OUTPUT
;
pintype
: ANALOGPIN
| DIGITALPIN
;
arrdcl
: type arrsizedcl ID (ASSIGN arrdclrhs)?
;
arrdclrhs
: ID
| LBRACK params_options? RBRACK
| funccall
;
arrsizedcl
: LBRACK INTLITERAL RBRACK
;
// Fragments
fragment LINE_TERMINATOR : ('\r'? '\n' | '\r');
fragment DBLQUOTE : '"';
fragment HASHTAG : '#';
fragment LOWERCASE : [a-z];
fragment UPPERCASE : [A-Z];
fragment LETTER : (LOWERCASE | UPPERCASE);
fragment DIGIT : [0-9];
fragment ID_BODY : LETTER | DIGIT | '_';
fragment STRING_CONTENT : ~["];
fragment ML_COMMENT_CONTENT : ~[#];
fragment EOL_COMMENT_CONTENT : ~[\r\n#];
// Lexer Rules (Tokens)
WHITESPACE : (' ' | '\t') -> skip;
END_OF_LINE_COMMENT : '#' EOL_COMMENT_CONTENT* -> skip;
MULTILINE_COMMENT : '##' ML_COMMENT_CONTENT* '##' -> skip;
LPAREN : '(';
RPAREN : ')';
LBRACK : '[';
RBRACK : ']';
ASSIGN : '=';
PLUS : '+';
MINUS : '-';
DIVIDE : '/';
MULT : '*';
POW : '^';
GRTHAN : '>';
GRTHANEQ : '>=';
LTHAN : '<';
LTHANEQ : '<=';
EQ : '==';
NEQ : '!:';
NEG : '!';
NL : LINE_TERMINATOR;
COMMA : ',';
INTLITERAL : ('0' | [1-9] DIGIT*);
NUMLITERAL : ('0' | [1-9] DIGIT*) ('.' DIGIT+)?;
STRLITERAL : DBLQUOTE STRING_CONTENT* DBLQUOTE;
BOOLLITERAL : NEG? ('true' | 'false');
// Keywords
SETUP : 'setup';
ENDSETUP : 'end setup';
LOOP : 'loop';
ENDLOOP : 'end loop';
FUNCTIONS : 'functions';
ENDFUNCTIONS : 'end functions';
FUNCTION : 'function';
ENDFUNCTION : 'end function';
VARIABLES : 'variables';
ENDVARIABLES : 'end variables';
BLANK : 'blank';
NUMBER : 'number';
STRING : 'string';
BOOLEAN : 'boolean';
ANALOGPIN : 'analogpin';
DIGITALPIN : 'digitalpin';
IF : 'if';
ENDIF : 'end if';
ELSE : 'else';
CONTINUE : 'continue';
BREAK : 'break';
REPEATWHILE : 'repeat while';
ENDWHILE : 'end while';
REPEATFOR : 'repeat for';
ENDFOR : 'end for';
UPTO : 'up to';
DOWNTO : 'down to';
CHANGEBY : 'change by';
RETURN : 'return';
AND : 'and';
OR : 'or';
CONSTANT : 'constant';
INPUT : 'input';
OUTPUT : 'output';
ID : LETTER ID_BODY*; |
pkgs/tools/yasm/src/modules/objfmts/bin/tests/integer-warn.asm | manggoguy/parsec-modified | 2,151 | 245644 | <reponame>manggoguy/parsec-modified
; Tests warnings with integer constant handling (for output, not parsing)
db 0x51a
dw 0x3875bc
dd 0x35783134affff
dq 0xABCDEF012345678989abb
dt 0xa907bc890d0e907f0134afb8adee
|
src/main/antlr/Nottex.g4 | NoTTeX/NoTTeX | 1 | 3369 | <reponame>NoTTeX/NoTTeX<filename>src/main/antlr/Nottex.g4<gh_stars>1-10
grammar Nottex;
markupText : (functionCall
| tagUse
| text)+
;
functionCall : FUNCTION_MARKER name+=ALPHA(ALPHA|NUMBER)* ws LPAREN ws argumentsNode=funcArgs? ws RPAREN
;
tagUse : TAG_MARKER namesNode=tagIdens ws LBRACE content=markupText? RBRACE
;
tagIdens : names+=ALPHA(ALPHA|NUMBER)* (ws COMMA ws names+=ALPHA(ALPHA|NUMBER)*)*
;
text : content+=(ALPHA|NUMBER|COMMA|COLON|QUOTE|LPAREN|RPAREN|LBRACE|RBRACE|PLUS|MINUS|MULTIP|DIVIS|ESCAPED_QUOTE|BACKSLASH|ESCAPED_BACKSLASH|WS)+
;
funcArgs : argumentNodes+=funcArg (ws COMMA ws argumentNodes+=funcArg)*
;
funcArg : string # StringArg
| expr # ExpressionArg
| functionCall # FunctionCallArg
;
expr : left=expr PLUS right=sub # ExprAdd
| left=expr MINUS right=sub # ExprSubtract
| sub # SubExpr
;
sub : left=sub MULTIP right=factor # ExprMultip
| left=sub DIVIS right=factor # ExprDivis
| minuses+=MINUS+ expression=factor # ExprMinus
| factor # SubSubExpr
;
factor : LPAREN expression=expr RPAREN # ExprParens
| NUMBER # ExprNumber
;
string : QUOTE content+=(ALPHA|NUMBER|TAG_MARKER|COMMA|FUNCTION_MARKER|COLON|LPAREN|RPAREN|LBRACE|RBRACE|PLUS|MINUS|MULTIP|DIVIS|ESCAPED_QUOTE|WS|ESCAPED_BACKSLASH)* QUOTE
;
ws : WS*
;
TAG_MARKER : ',,';
COMMA : ',';
FUNCTION_MARKER : '::';
COLON : ':'; // This is needed because ALPHA can't match a single colon; this must be matched separately
LPAREN : '(';
RPAREN : ')';
LBRACE : '{';
RBRACE : '}';
ESCAPED_QUOTE : '\\"';
ESCAPED_BACKSLASH : '\\\\';
BACKSLASH : '\\';
QUOTE : '"';
PLUS : '+';
MINUS : '-';
MULTIP : '*';
DIVIS : '/';
WS : [ \n\r\t];
NUMBER : ('0'|[1-9][0-9]*)('.'[0-9]+)?;
ALPHA : ~(','|':'|'('|')'|'{'|'}'|'"'|' '|'+'|'-'|'*'|'/'|'\n'|'\r'|'\t'|'\\')+;
|
agda-stdlib/src/Data/Sum/Base.agda | DreamLinuxer/popl21-artifact | 5 | 2662 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Sums (disjoint unions)
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Sum.Base where
open import Data.Bool.Base using (true; false)
open import Function.Base using (_∘_; _-[_]-_ ; id)
open import Relation.Nullary.Reflects using (invert)
open import Relation.Nullary using (Dec; yes; no; _because_; ¬_)
open import Level using (Level; _⊔_)
private
variable
a b c d : Level
A : Set a
B : Set b
C : Set c
D : Set d
------------------------------------------------------------------------
-- Definition
infixr 1 _⊎_
data _⊎_ (A : Set a) (B : Set b) : Set (a ⊔ b) where
inj₁ : (x : A) → A ⊎ B
inj₂ : (y : B) → A ⊎ B
------------------------------------------------------------------------
-- Functions
[_,_] : ∀ {C : A ⊎ B → Set c} →
((x : A) → C (inj₁ x)) → ((x : B) → C (inj₂ x)) →
((x : A ⊎ B) → C x)
[ f , g ] (inj₁ x) = f x
[ f , g ] (inj₂ y) = g y
[_,_]′ : (A → C) → (B → C) → (A ⊎ B → C)
[_,_]′ = [_,_]
fromInj₁ : (B → A) → A ⊎ B → A
fromInj₁ = [ id ,_]′
fromInj₂ : (A → B) → A ⊎ B → B
fromInj₂ = [_, id ]′
swap : A ⊎ B → B ⊎ A
swap (inj₁ x) = inj₂ x
swap (inj₂ x) = inj₁ x
map : (A → C) → (B → D) → (A ⊎ B → C ⊎ D)
map f g = [ inj₁ ∘ f , inj₂ ∘ g ]
map₁ : (A → C) → (A ⊎ B → C ⊎ B)
map₁ f = map f id
map₂ : (B → D) → (A ⊎ B → A ⊎ D)
map₂ = map id
infixr 1 _-⊎-_
_-⊎-_ : (A → B → Set c) → (A → B → Set d) → (A → B → Set (c ⊔ d))
f -⊎- g = f -[ _⊎_ ]- g
-- Conversion back and forth with Dec
fromDec : Dec A → A ⊎ ¬ A
fromDec ( true because [p]) = inj₁ (invert [p])
fromDec (false because [¬p]) = inj₂ (invert [¬p])
toDec : A ⊎ ¬ A → Dec A
toDec (inj₁ p) = yes p
toDec (inj₂ ¬p) = no ¬p
|
Lab1-1/lab1-1.adb | gabemgem/LITEC | 0 | 5447 | <gh_stars>0
M:lab1_1
F:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0,0,0,0
F:G$UART0_Init$0$0({2}DF,SV:S),C,0,0,0,0,0
F:G$Sys_Init$0$0({2}DF,SV:S),C,0,0,0,0,0
F:G$putchar$0$0({2}DF,SV:S),C,0,0,0,0,0
F:G$getchar$0$0({2}DF,SC:U),C,0,0,0,0,0
F:G$getchar_nw$0$0({2}DF,SC:U),C,0,0,0,0,0
F:G$main$0$0({2}DF,SV:S),C,0,0,0,0,0
F:G$Port_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$Set_outputs$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$sensor1$0$0({2}DF,SI:S),Z,0,0,0,0,0
F:G$sensor2$0$0({2}DF,SI:S),Z,0,0,0,0,0
S:Llab1_1.getchar$c$1$10({1}SC:U),R,0,0,[]
S:Llab1_1.getchar_nw$c$1$12({1}SC:U),R,0,0,[]
S:G$P0$0$0({1}SC:U),I,0,0
S:G$SP$0$0({1}SC:U),I,0,0
S:G$DPL$0$0({1}SC:U),I,0,0
S:G$DPH$0$0({1}SC:U),I,0,0
S:G$P4$0$0({1}SC:U),I,0,0
S:G$P5$0$0({1}SC:U),I,0,0
S:G$P6$0$0({1}SC:U),I,0,0
S:G$PCON$0$0({1}SC:U),I,0,0
S:G$TCON$0$0({1}SC:U),I,0,0
S:G$TMOD$0$0({1}SC:U),I,0,0
S:G$TL0$0$0({1}SC:U),I,0,0
S:G$TL1$0$0({1}SC:U),I,0,0
S:G$TH0$0$0({1}SC:U),I,0,0
S:G$TH1$0$0({1}SC:U),I,0,0
S:G$CKCON$0$0({1}SC:U),I,0,0
S:G$PSCTL$0$0({1}SC:U),I,0,0
S:G$P1$0$0({1}SC:U),I,0,0
S:G$TMR3CN$0$0({1}SC:U),I,0,0
S:G$TMR3RLL$0$0({1}SC:U),I,0,0
S:G$TMR3RLH$0$0({1}SC:U),I,0,0
S:G$TMR3L$0$0({1}SC:U),I,0,0
S:G$TMR3H$0$0({1}SC:U),I,0,0
S:G$P7$0$0({1}SC:U),I,0,0
S:G$SCON$0$0({1}SC:U),I,0,0
S:G$SCON0$0$0({1}SC:U),I,0,0
S:G$SBUF$0$0({1}SC:U),I,0,0
S:G$SBUF0$0$0({1}SC:U),I,0,0
S:G$SPI0CFG$0$0({1}SC:U),I,0,0
S:G$SPI0DAT$0$0({1}SC:U),I,0,0
S:G$ADC1$0$0({1}SC:U),I,0,0
S:G$SPI0CKR$0$0({1}SC:U),I,0,0
S:G$CPT0CN$0$0({1}SC:U),I,0,0
S:G$CPT1CN$0$0({1}SC:U),I,0,0
S:G$P2$0$0({1}SC:U),I,0,0
S:G$EMI0TC$0$0({1}SC:U),I,0,0
S:G$EMI0CF$0$0({1}SC:U),I,0,0
S:G$PRT0CF$0$0({1}SC:U),I,0,0
S:G$P0MDOUT$0$0({1}SC:U),I,0,0
S:G$PRT1CF$0$0({1}SC:U),I,0,0
S:G$P1MDOUT$0$0({1}SC:U),I,0,0
S:G$PRT2CF$0$0({1}SC:U),I,0,0
S:G$P2MDOUT$0$0({1}SC:U),I,0,0
S:G$PRT3CF$0$0({1}SC:U),I,0,0
S:G$P3MDOUT$0$0({1}SC:U),I,0,0
S:G$IE$0$0({1}SC:U),I,0,0
S:G$SADDR0$0$0({1}SC:U),I,0,0
S:G$ADC1CN$0$0({1}SC:U),I,0,0
S:G$ADC1CF$0$0({1}SC:U),I,0,0
S:G$AMX1SL$0$0({1}SC:U),I,0,0
S:G$P3IF$0$0({1}SC:U),I,0,0
S:G$SADEN1$0$0({1}SC:U),I,0,0
S:G$EMI0CN$0$0({1}SC:U),I,0,0
S:G$_XPAGE$0$0({1}SC:U),I,0,0
S:G$P3$0$0({1}SC:U),I,0,0
S:G$OSCXCN$0$0({1}SC:U),I,0,0
S:G$OSCICN$0$0({1}SC:U),I,0,0
S:G$P74OUT$0$0({1}SC:U),I,0,0
S:G$FLSCL$0$0({1}SC:U),I,0,0
S:G$FLACL$0$0({1}SC:U),I,0,0
S:G$IP$0$0({1}SC:U),I,0,0
S:G$SADEN0$0$0({1}SC:U),I,0,0
S:G$AMX0CF$0$0({1}SC:U),I,0,0
S:G$AMX0SL$0$0({1}SC:U),I,0,0
S:G$ADC0CF$0$0({1}SC:U),I,0,0
S:G$P1MDIN$0$0({1}SC:U),I,0,0
S:G$ADC0L$0$0({1}SC:U),I,0,0
S:G$ADC0H$0$0({1}SC:U),I,0,0
S:G$SMB0CN$0$0({1}SC:U),I,0,0
S:G$SMB0STA$0$0({1}SC:U),I,0,0
S:G$SMB0DAT$0$0({1}SC:U),I,0,0
S:G$SMB0ADR$0$0({1}SC:U),I,0,0
S:G$ADC0GTL$0$0({1}SC:U),I,0,0
S:G$ADC0GTH$0$0({1}SC:U),I,0,0
S:G$ADC0LTL$0$0({1}SC:U),I,0,0
S:G$ADC0LTH$0$0({1}SC:U),I,0,0
S:G$T2CON$0$0({1}SC:U),I,0,0
S:G$T4CON$0$0({1}SC:U),I,0,0
S:G$RCAP2L$0$0({1}SC:U),I,0,0
S:G$RCAP2H$0$0({1}SC:U),I,0,0
S:G$TL2$0$0({1}SC:U),I,0,0
S:G$TH2$0$0({1}SC:U),I,0,0
S:G$SMB0CR$0$0({1}SC:U),I,0,0
S:G$PSW$0$0({1}SC:U),I,0,0
S:G$REF0CN$0$0({1}SC:U),I,0,0
S:G$DAC0L$0$0({1}SC:U),I,0,0
S:G$DAC0H$0$0({1}SC:U),I,0,0
S:G$DAC0CN$0$0({1}SC:U),I,0,0
S:G$DAC1L$0$0({1}SC:U),I,0,0
S:G$DAC1H$0$0({1}SC:U),I,0,0
S:G$DAC1CN$0$0({1}SC:U),I,0,0
S:G$PCA0CN$0$0({1}SC:U),I,0,0
S:G$PCA0MD$0$0({1}SC:U),I,0,0
S:G$PCA0CPM0$0$0({1}SC:U),I,0,0
S:G$PCA0CPM1$0$0({1}SC:U),I,0,0
S:G$PCA0CPM2$0$0({1}SC:U),I,0,0
S:G$PCA0CPM3$0$0({1}SC:U),I,0,0
S:G$PCA0CPM4$0$0({1}SC:U),I,0,0
S:G$ACC$0$0({1}SC:U),I,0,0
S:G$XBR0$0$0({1}SC:U),I,0,0
S:G$XBR1$0$0({1}SC:U),I,0,0
S:G$XBR2$0$0({1}SC:U),I,0,0
S:G$RCAP4L$0$0({1}SC:U),I,0,0
S:G$RCAP4H$0$0({1}SC:U),I,0,0
S:G$EIE1$0$0({1}SC:U),I,0,0
S:G$EIE2$0$0({1}SC:U),I,0,0
S:G$ADC0CN$0$0({1}SC:U),I,0,0
S:G$PCA0L$0$0({1}SC:U),I,0,0
S:G$PCA0CPL0$0$0({1}SC:U),I,0,0
S:G$PCA0CPL1$0$0({1}SC:U),I,0,0
S:G$PCA0CPL2$0$0({1}SC:U),I,0,0
S:G$PCA0CPL3$0$0({1}SC:U),I,0,0
S:G$PCA0CPL4$0$0({1}SC:U),I,0,0
S:G$RSTSRC$0$0({1}SC:U),I,0,0
S:G$B$0$0({1}SC:U),I,0,0
S:G$SCON1$0$0({1}SC:U),I,0,0
S:G$SBUF1$0$0({1}SC:U),I,0,0
S:G$SADDR1$0$0({1}SC:U),I,0,0
S:G$TL4$0$0({1}SC:U),I,0,0
S:G$TH4$0$0({1}SC:U),I,0,0
S:G$EIP1$0$0({1}SC:U),I,0,0
S:G$EIP2$0$0({1}SC:U),I,0,0
S:G$SPI0CN$0$0({1}SC:U),I,0,0
S:G$PCA0H$0$0({1}SC:U),I,0,0
S:G$PCA0CPH0$0$0({1}SC:U),I,0,0
S:G$PCA0CPH1$0$0({1}SC:U),I,0,0
S:G$PCA0CPH2$0$0({1}SC:U),I,0,0
S:G$PCA0CPH3$0$0({1}SC:U),I,0,0
S:G$PCA0CPH4$0$0({1}SC:U),I,0,0
S:G$WDTCN$0$0({1}SC:U),I,0,0
S:G$TMR0$0$0({2}SI:U),I,0,0
S:G$TMR1$0$0({2}SI:U),I,0,0
S:G$TMR2$0$0({2}SI:U),I,0,0
S:G$RCAP2$0$0({2}SI:U),I,0,0
S:G$TMR3$0$0({2}SI:U),I,0,0
S:G$TMR3RL$0$0({2}SI:U),I,0,0
S:G$TMR4$0$0({2}SI:U),I,0,0
S:G$RCAP4$0$0({2}SI:U),I,0,0
S:G$ADC0$0$0({2}SI:U),I,0,0
S:G$ADC0GT$0$0({2}SI:U),I,0,0
S:G$ADC0LT$0$0({2}SI:U),I,0,0
S:G$DAC0$0$0({2}SI:U),I,0,0
S:G$DAC1$0$0({2}SI:U),I,0,0
S:G$PCA0$0$0({2}SI:U),I,0,0
S:G$PCA0CP0$0$0({2}SI:U),I,0,0
S:G$PCA0CP1$0$0({2}SI:U),I,0,0
S:G$PCA0CP2$0$0({2}SI:U),I,0,0
S:G$PCA0CP3$0$0({2}SI:U),I,0,0
S:G$PCA0CP4$0$0({2}SI:U),I,0,0
S:G$P0_0$0$0({1}SX:U),J,0,0
S:G$P0_1$0$0({1}SX:U),J,0,0
S:G$P0_2$0$0({1}SX:U),J,0,0
S:G$P0_3$0$0({1}SX:U),J,0,0
S:G$P0_4$0$0({1}SX:U),J,0,0
S:G$P0_5$0$0({1}SX:U),J,0,0
S:G$P0_6$0$0({1}SX:U),J,0,0
S:G$P0_7$0$0({1}SX:U),J,0,0
S:G$IT0$0$0({1}SX:U),J,0,0
S:G$IE0$0$0({1}SX:U),J,0,0
S:G$IT1$0$0({1}SX:U),J,0,0
S:G$IE1$0$0({1}SX:U),J,0,0
S:G$TR0$0$0({1}SX:U),J,0,0
S:G$TF0$0$0({1}SX:U),J,0,0
S:G$TR1$0$0({1}SX:U),J,0,0
S:G$TF1$0$0({1}SX:U),J,0,0
S:G$P1_0$0$0({1}SX:U),J,0,0
S:G$P1_1$0$0({1}SX:U),J,0,0
S:G$P1_2$0$0({1}SX:U),J,0,0
S:G$P1_3$0$0({1}SX:U),J,0,0
S:G$P1_4$0$0({1}SX:U),J,0,0
S:G$P1_5$0$0({1}SX:U),J,0,0
S:G$P1_6$0$0({1}SX:U),J,0,0
S:G$P1_7$0$0({1}SX:U),J,0,0
S:G$RI$0$0({1}SX:U),J,0,0
S:G$RI0$0$0({1}SX:U),J,0,0
S:G$TI$0$0({1}SX:U),J,0,0
S:G$TI0$0$0({1}SX:U),J,0,0
S:G$RB8$0$0({1}SX:U),J,0,0
S:G$RB80$0$0({1}SX:U),J,0,0
S:G$TB8$0$0({1}SX:U),J,0,0
S:G$TB80$0$0({1}SX:U),J,0,0
S:G$REN$0$0({1}SX:U),J,0,0
S:G$REN0$0$0({1}SX:U),J,0,0
S:G$SM2$0$0({1}SX:U),J,0,0
S:G$SM20$0$0({1}SX:U),J,0,0
S:G$MCE0$0$0({1}SX:U),J,0,0
S:G$SM1$0$0({1}SX:U),J,0,0
S:G$SM10$0$0({1}SX:U),J,0,0
S:G$SM0$0$0({1}SX:U),J,0,0
S:G$SM00$0$0({1}SX:U),J,0,0
S:G$S0MODE$0$0({1}SX:U),J,0,0
S:G$P2_0$0$0({1}SX:U),J,0,0
S:G$P2_1$0$0({1}SX:U),J,0,0
S:G$P2_2$0$0({1}SX:U),J,0,0
S:G$P2_3$0$0({1}SX:U),J,0,0
S:G$P2_4$0$0({1}SX:U),J,0,0
S:G$P2_5$0$0({1}SX:U),J,0,0
S:G$P2_6$0$0({1}SX:U),J,0,0
S:G$P2_7$0$0({1}SX:U),J,0,0
S:G$EX0$0$0({1}SX:U),J,0,0
S:G$ET0$0$0({1}SX:U),J,0,0
S:G$EX1$0$0({1}SX:U),J,0,0
S:G$ET1$0$0({1}SX:U),J,0,0
S:G$ES0$0$0({1}SX:U),J,0,0
S:G$ES$0$0({1}SX:U),J,0,0
S:G$ET2$0$0({1}SX:U),J,0,0
S:G$EA$0$0({1}SX:U),J,0,0
S:G$P3_0$0$0({1}SX:U),J,0,0
S:G$P3_1$0$0({1}SX:U),J,0,0
S:G$P3_2$0$0({1}SX:U),J,0,0
S:G$P3_3$0$0({1}SX:U),J,0,0
S:G$P3_4$0$0({1}SX:U),J,0,0
S:G$P3_5$0$0({1}SX:U),J,0,0
S:G$P3_6$0$0({1}SX:U),J,0,0
S:G$P3_7$0$0({1}SX:U),J,0,0
S:G$PX0$0$0({1}SX:U),J,0,0
S:G$PT0$0$0({1}SX:U),J,0,0
S:G$PX1$0$0({1}SX:U),J,0,0
S:G$PT1$0$0({1}SX:U),J,0,0
S:G$PS0$0$0({1}SX:U),J,0,0
S:G$PS$0$0({1}SX:U),J,0,0
S:G$PT2$0$0({1}SX:U),J,0,0
S:G$SMBTOE$0$0({1}SX:U),J,0,0
S:G$SMBFTE$0$0({1}SX:U),J,0,0
S:G$AA$0$0({1}SX:U),J,0,0
S:G$SI$0$0({1}SX:U),J,0,0
S:G$STO$0$0({1}SX:U),J,0,0
S:G$STA$0$0({1}SX:U),J,0,0
S:G$ENSMB$0$0({1}SX:U),J,0,0
S:G$BUSY$0$0({1}SX:U),J,0,0
S:G$CPRL2$0$0({1}SX:U),J,0,0
S:G$CT2$0$0({1}SX:U),J,0,0
S:G$TR2$0$0({1}SX:U),J,0,0
S:G$EXEN2$0$0({1}SX:U),J,0,0
S:G$TCLK$0$0({1}SX:U),J,0,0
S:G$RCLK$0$0({1}SX:U),J,0,0
S:G$EXF2$0$0({1}SX:U),J,0,0
S:G$TF2$0$0({1}SX:U),J,0,0
S:G$P$0$0({1}SX:U),J,0,0
S:G$F1$0$0({1}SX:U),J,0,0
S:G$OV$0$0({1}SX:U),J,0,0
S:G$RS0$0$0({1}SX:U),J,0,0
S:G$RS1$0$0({1}SX:U),J,0,0
S:G$F0$0$0({1}SX:U),J,0,0
S:G$AC$0$0({1}SX:U),J,0,0
S:G$CY$0$0({1}SX:U),J,0,0
S:G$CCF0$0$0({1}SX:U),J,0,0
S:G$CCF1$0$0({1}SX:U),J,0,0
S:G$CCF2$0$0({1}SX:U),J,0,0
S:G$CCF3$0$0({1}SX:U),J,0,0
S:G$CCF4$0$0({1}SX:U),J,0,0
S:G$CR$0$0({1}SX:U),J,0,0
S:G$CF$0$0({1}SX:U),J,0,0
S:G$ADLJST$0$0({1}SX:U),J,0,0
S:G$AD0LJST$0$0({1}SX:U),J,0,0
S:G$ADWINT$0$0({1}SX:U),J,0,0
S:G$AD0WINT$0$0({1}SX:U),J,0,0
S:G$ADSTM0$0$0({1}SX:U),J,0,0
S:G$AD0CM0$0$0({1}SX:U),J,0,0
S:G$ADSTM1$0$0({1}SX:U),J,0,0
S:G$AD0CM1$0$0({1}SX:U),J,0,0
S:G$ADBUSY$0$0({1}SX:U),J,0,0
S:G$AD0BUSY$0$0({1}SX:U),J,0,0
S:G$ADCINT$0$0({1}SX:U),J,0,0
S:G$AD0INT$0$0({1}SX:U),J,0,0
S:G$ADCTM$0$0({1}SX:U),J,0,0
S:G$AD0TM$0$0({1}SX:U),J,0,0
S:G$ADCEN$0$0({1}SX:U),J,0,0
S:G$AD0EN$0$0({1}SX:U),J,0,0
S:G$SPIEN$0$0({1}SX:U),J,0,0
S:G$MSTEN$0$0({1}SX:U),J,0,0
S:G$SLVSEL$0$0({1}SX:U),J,0,0
S:G$TXBSY$0$0({1}SX:U),J,0,0
S:G$RXOVRN$0$0({1}SX:U),J,0,0
S:G$MODF$0$0({1}SX:U),J,0,0
S:G$WCOL$0$0({1}SX:U),J,0,0
S:G$SPIF$0$0({1}SX:U),J,0,0
S:G$LED0$0$0({1}SX:U),J,0,0
S:G$BILED0$0$0({1}SX:U),J,0,0
S:G$BILED1$0$0({1}SX:U),J,0,0
S:G$BUZZER$0$0({1}SX:U),J,0,0
S:G$SS$0$0({1}SX:U),J,0,0
S:G$PB1$0$0({1}SX:U),J,0,0
S:G$PB2$0$0({1}SX:U),J,0,0
S:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0
S:G$UART0_Init$0$0({2}DF,SV:S),C,0,0
S:G$Sys_Init$0$0({2}DF,SV:S),C,0,0
S:G$getchar_nw$0$0({2}DF,SC:U),C,0,0
S:G$_print_format$0$0({2}DF,SI:S),C,0,0
S:G$printf_small$0$0({2}DF,SV:S),C,0,0
S:G$printf$0$0({2}DF,SI:S),C,0,0
S:G$vprintf$0$0({2}DF,SI:S),C,0,0
S:G$sprintf$0$0({2}DF,SI:S),C,0,0
S:G$vsprintf$0$0({2}DF,SI:S),C,0,0
S:G$puts$0$0({2}DF,SI:S),C,0,0
S:G$getchar$0$0({2}DF,SC:U),C,0,0
S:G$putchar$0$0({2}DF,SV:S),C,0,0
S:G$printf_fast$0$0({2}DF,SV:S),C,0,0
S:G$printf_fast_f$0$0({2}DF,SV:S),C,0,0
S:G$printf_tiny$0$0({2}DF,SV:S),C,0,0
S:G$main$0$0({2}DF,SV:S),C,0,0
S:Flab1_1$__str_0$0$0({23}DA23d,SC:S),D,0,0
S:Flab1_1$__str_1$0$0({22}DA22d,SC:S),D,0,0
S:Flab1_1$__str_2$0$0({42}DA42d,SC:S),D,0,0
S:Flab1_1$__str_3$0$0({48}DA48d,SC:S),D,0,0
S:Flab1_1$__str_4$0$0({48}DA48d,SC:S),D,0,0
|
src/main/antlr/WebbyParser.g4 | ftomassetti/webby | 0 | 4962 | <filename>src/main/antlr/WebbyParser.g4<gh_stars>0
parser grammar WebbyParser;
options { tokenVocab=WebbyLexer; }
webbyFile : (elements=topLevelElement)* EOF
;
newlines : NEWLINE+
;
topLevelElement : constant
| variable
| route
;
constant : CONST name=ID ASSIGN value=expression
;
variable : VAR name=ID ASSIGN value=expression
;
route : METHOD path COLON newlines (lines+=routeLine)+
;
routeLine : INDENT statement newlines;
path : PATH_STRING
;
statement : expression
| reply
| constant
| variable
;
reply : REPLY RESPONSE_TYPE value=expression
;
namedMapLiteral : LBRACKET (entries+=namedMapLiteralEntry ((COMMA | NEWLINE) entries+=namedMapLiteralEntry)* )? RBRACKET
;
namedMapLiteralEntry : name=ID ASSIGN value=expression
;
listLiteral : LSQUARE (values+=expression ((COMMA | NEWLINE) values+=expression)* )? RSQUARE
;
expression : left=expression operator=(DIVISION|ASTERISK) right=expression # binaryOperation
| left=expression operator=(PLUS|MINUS) right=expression # binaryOperation
| LPAREN expression RPAREN # parenExpression
| ID #varReference
| MINUS expression #minusExpression
| namedMapLiteral #namedMapLiteralExpression
| listLiteral # listLiteralExpression
| (REQUIRED)? HEADER name=ID # headerExpression
| STRLIT # stringLiteral
| INTLIT # intLiteral
| DECLIT # decimalLiteral ;
|
oeis/045/A045309.asm | neoneye/loda-programs | 11 | 7158 | ; A045309: Primes congruent to {0, 2} mod 3.
; Submitted by <NAME>
; 2,3,5,11,17,23,29,41,47,53,59,71,83,89,101,107,113,131,137,149,167,173,179,191,197,227,233,239,251,257,263,269,281,293,311,317,347,353,359,383,389,401,419,431,443,449,461,467,479,491,503,509,521,557,563,569,587,593,599,617,641,647,653,659,677,683,701,719,743,761,773,797,809,821,827,839,857,863,881,887,911,929,941,947,953,971,977,983,1013,1019,1031,1049,1061,1091,1097,1103,1109,1151,1163,1181
add $0,1
mov $1,1
mov $2,1
lpb $0
mov $3,$2
gcd $2,2
lpb $3
add $2,1
mov $4,$1
gcd $4,$2
add $2,2
cmp $4,1
cmp $4,0
sub $3,$4
lpe
sub $0,1
add $2,1
mul $1,$2
lpe
mov $0,$2
|
game1/globals.asm | w84death/arm-assembly | 3 | 94604 | @ ---------------------------------------------------
@
@ Raspberry Pi Assembly GAME#1 by KJ/P1X
@
@ http://p1x.in | http://krzysztofjankowski.com
@ https://github.com/w84death/arm-assembly
@
@ ---------------------------------------------------
.arm
.data
@ text styles
.equ welcome_style, 32 @ clear screen + green
.equ desc_style, 16 @ blue
.equ info_style, 8 @ green
@ text colors
.equ ui_cls, 1
.equ ui_cc, 2
.equ ui_red, 4
.equ ui_green, 8
.equ ui_blue, 16
.equ ui_white, 32
@ commands
.equ cmd_quit, 0x0
.equ cmd_west, 0x4
.equ cmd_east, 0x8
.equ cmd_nort, 0xc
.equ cmd_sout, 0x10
.equ cmd_look, 0x14
.equ cmd_rest, 0x18
.equ cmd_help, 0x1c
|
programs/oeis/220/A220073.asm | neoneye/loda | 22 | 104729 | <filename>programs/oeis/220/A220073.asm
; A220073: Mirror of the triangle A130517.
; 1,1,2,2,1,3,3,1,2,4,4,2,1,3,5,5,3,1,2,4,6,6,4,2,1,3,5,7,7,5,3,1,2,4,6,8,8,6,4,2,1,3,5,7,9,9,7,5,3,1,2,4,6,8,10,10,8,6,4,2,1,3,5,7,9,11,11,9,7,5,3,1,2,4,6,8,10,12,12,10,8,6,4,2,1,3,5,7,9,11,13,13,11,9,7,5,3,1,2,4
mul $0,2
add $0,1
seq $0,4737 ; Concatenation of sequences (1,2,...,n-1,n,n-1,...,1) for n >= 1.
|
test/asset/agda-stdlib-1.0/Relation/Nullary/Implication.agda | omega12345/agda-mode | 0 | 14584 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Implications of nullary relations
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Relation.Nullary.Implication where
open import Relation.Nullary
open import Data.Empty
-- Some properties which are preserved by _→_.
infixr 2 _→-dec_
_→-dec_ : ∀ {p q} {P : Set p} {Q : Set q} →
Dec P → Dec Q → Dec (P → Q)
yes p →-dec no ¬q = no (λ f → ¬q (f p))
yes p →-dec yes q = yes (λ _ → q)
no ¬p →-dec _ = yes (λ p → ⊥-elim (¬p p))
|
src/main/antlr/jsonsql/Sql.g4 | tim-patterson/jsonsql | 3 | 1925 | <reponame>tim-patterson/jsonsql
grammar Sql;
@header {
package jsonsql;
}
stmt
: select_stmt ';'
| describe_stmt ';'
| EXPLAIN select_stmt ';'
| insert_stmt ';'
;
insert_stmt
: INSERT INTO? table select_stmt
;
select_stmt
: SELECT named_expr ( ',' named_expr )* FROM source predicate? group_by? order_by? (LIMIT NUMERIC_LITERAL)?
;
named_expr
: expr
| expr AS? IDENTIFIER
;
group_by
: GROUP BY expr ( ',' expr )*
;
order_by_expr
: expr
| expr DESC
| expr ASC
;
order_by
: ORDER BY order_by_expr ( ',' order_by_expr )*
;
predicate
: WHERE expr
;
describe_stmt
: DESCRIBE table
| DESCRIBE table AS TABLE
;
expr
: '(' expr ')'
| expr OP_IDX expr ']'
| expr OP_DOT IDENTIFIER
| STRING_LITERAL
| NUMERIC_LITERAL
| function_call
| IDENTIFIER
| expr ( OP_MULT | OP_DIV ) expr
| expr ( OP_PLUS | OP_MINUS ) expr
| expr ( OP_GT | OP_GTE | OP_LT | OP_LTE ) expr
| expr ( OP_EQ | OP_NEQ ) expr
| expr IS NULL
| expr IS NOT NULL
| expr ( OP_AND | OP_OR ) expr
| TRUE
| FALSE
| NULL
;
table
: table_type STRING_LITERAL
;
table_type
: JSON
| CSV
| DIR
;
subquery
: '(' select_stmt ')'
;
lateral_view
: LATERAL VIEW named_expr
;
join
: JOIN table_or_subquery ON expr
;
source
: table_or_subquery (join)*
;
table_or_subquery
: table (AS? IDENTIFIER)?
| subquery (AS? IDENTIFIER)?
| table_or_subquery lateral_view
;
function_call
: IDENTIFIER '(' OP_MULT ')' // Special case for count(*)
| IDENTIFIER '(' (expr ( ',' expr )*)? ')'
;
// Key words
DESCRIBE: D E S C R I B E;
SELECT: S E L E C T;
JSON: J S O N;
CSV: C S V;
DIR: D I R;
FROM: F R O M;
LIMIT: L I M I T;
WHERE: W H E R E;
EXPLAIN: E X P L A I N;
GROUP: G R O U P;
ORDER: O R D E R;
BY: B Y;
AS: A S;
ASC: A S C;
DESC: D E S C;
IS: I S;
NOT: N O T;
NULL: N U L L;
TRUE: T R U E;
FALSE: F A L S E;
LATERAL: L A T E R A L;
VIEW: V I E W;
JOIN: J O I N;
ON: O N;
INSERT: I N S E R T;
INTO: I N T O;
TABLE: T A B L E;
OP_PLUS: '+';
OP_MINUS: '-';
OP_MULT: '*';
OP_DIV: '/';
OP_GT: '>';
OP_GTE: '>=';
OP_LT: '<';
OP_LTE: '<=';
OP_EQ: '=' | '==';
OP_NEQ: '!=' | '<>';
OP_DOT: '.';
OP_IDX: '[';
OP_AND: A N D;
OP_OR: O R;
IDENTIFIER
: [a-zA-Z_] [a-zA-Z_0-9]*
| '`' ( ~'`' )* '`'
;
SINGLE_LINE_COMMENT
: '--' ~[\r\n]* -> channel(HIDDEN)
;
// Literals
NUMERIC_LITERAL
: '-'? DIGIT+ ( '.' DIGIT* )?
;
STRING_LITERAL
: '\'' ( ~'\'' )* '\''
| '"' ( ~'"' )* '"'
;
// Whitespace
SPACES
: [ \u000B\t\r\n] -> channel(HIDDEN)
;
// Fragments
fragment DIGIT : [0-9];
fragment A : [aA];
fragment B : [bB];
fragment C : [cC];
fragment D : [dD];
fragment E : [eE];
fragment F : [fF];
fragment G : [gG];
fragment H : [hH];
fragment I : [iI];
fragment J : [jJ];
fragment K : [kK];
fragment L : [lL];
fragment M : [mM];
fragment N : [nN];
fragment O : [oO];
fragment P : [pP];
fragment Q : [qQ];
fragment R : [rR];
fragment S : [sS];
fragment T : [tT];
fragment U : [uU];
fragment V : [vV];
fragment W : [wW];
fragment X : [xX];
fragment Y : [yY];
fragment Z : [zZ];
|
beacon/stager/syscalls64.asm | paralax/shad0w | 3 | 81106 | <reponame>paralax/shad0w
section .text
; Windows 10 definitions
global NtAllocateVirtualMemory10
global NtProtectVirtualMemory10
; Windows 8.1 definitions
global NtAllocateVirtualMemory81
global NtProtectVirtualMemory81
; Windows 10
; ----------------------------------------
NtAllocateVirtualMemory10:
mov r10, rcx
mov eax, 18h
syscall
ret
NtProtectVirtualMemory10:
mov r10, rcx
mov eax, 50h
syscall
ret
; ----------------------------------------
; Windows 8.1
; ----------------------------------------
NtAllocateVirtualMemory81:
mov r10, rcx
mov eax, 17h
syscall
ret
NtProtectVirtualMemory81:
mov r10, rcx
mov eax, 4fh
syscall
ret
; ----------------------------------------
; Windows 8.0
; ----------------------------------------
NtAllocateVirtualMemory80:
mov r10, rcx
mov eax, 16h
syscall
ret
NtProtectVirtualMemory80:
mov r10, rcx
mov eax, 4eh
syscall
ret
; ---------------------------------------- |
Cubical/Algebra/CommRing/Localisation/Base.agda | dolio/cubical | 0 | 6479 | -- We define the localisation of a commutative ring
-- at a multiplicatively closed subset and show that it
-- has a commutative ring structure.
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Algebra.CommRing.Localisation.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Powerset
open import Cubical.Foundations.Transport
open import Cubical.Functions.FunExtEquiv
import Cubical.Data.Empty as ⊥
open import Cubical.Data.Bool
open import Cubical.Data.Nat renaming ( _+_ to _+ℕ_ ; _·_ to _·ℕ_
; +-comm to +ℕ-comm ; +-assoc to +ℕ-assoc
; ·-assoc to ·ℕ-assoc ; ·-comm to ·ℕ-comm)
open import Cubical.Data.Vec
open import Cubical.Data.Sigma.Base
open import Cubical.Data.Sigma.Properties
open import Cubical.Data.FinData
open import Cubical.Relation.Nullary
open import Cubical.Relation.Binary
open import Cubical.Algebra.Ring
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.RingSolver.ReflectionSolving
open import Cubical.HITs.SetQuotients as SQ
open import Cubical.HITs.PropositionalTruncation as PT
open Iso
private
variable
ℓ ℓ' : Level
A : Type ℓ
-- A multiplicatively closed subset is assumed to contain 1
record isMultClosedSubset (R' : CommRing ℓ) (S' : ℙ (fst R')) : Type ℓ where
constructor
multclosedsubset
field
containsOne : (R' .snd .CommRingStr.1r) ∈ S'
multClosed : ∀ {s t} → s ∈ S' → t ∈ S' → ((snd R') .CommRingStr._·_ s t) ∈ S'
module Loc (R' : CommRing ℓ) (S' : ℙ (fst R')) (SMultClosedSubset : isMultClosedSubset R' S') where
open isMultClosedSubset
private R = fst R'
open CommRingStr (snd R')
open RingTheory (CommRing→Ring R')
open CommRingTheory R'
S = Σ[ s ∈ R ] (s ∈ S')
-- We define the localisation of R by S by quotienting by the following relation:
_≈_ : R × S → R × S → Type ℓ
(r₁ , s₁) ≈ (r₂ , s₂) = Σ[ s ∈ S ] (fst s · r₁ · fst s₂ ≡ fst s · r₂ · fst s₁)
S⁻¹R = (R × S) / _≈_
-- now define addition for S⁻¹R
open BinaryRelation
locRefl : isRefl _≈_
locRefl _ = (1r , SMultClosedSubset .containsOne) , refl
locSym : isSym _≈_
locSym (r , s , s∈S') (r' , s' , s'∈S') (u , p) = u , sym p
locTrans : isTrans _≈_
locTrans (r , s , s∈S') (r' , s' , s'∈S') (r'' , s'' , s''∈S') ((u , u∈S') , p) ((v , v∈S') , q) =
((u · v · s') , SMultClosedSubset .multClosed (SMultClosedSubset .multClosed u∈S' v∈S') s'∈S')
, path
where
eq1 : (r s r' s' r'' s'' u v : R) → u · v · s' · r · s'' ≡ u · r · s' · v · s''
eq1 = solve R'
eq2 : (r s r' s' r'' s'' u v : R) → u · r' · s · v · s'' ≡ u · s · (v · r' · s'')
eq2 = solve R'
eq3 : (r s r' s' r'' s'' u v : R) → u · s · (v · r'' · s') ≡ u · v · s' · r'' · s
eq3 = solve R'
path : u · v · s' · r · s'' ≡ u · v · s' · r'' · s
path = u · v · s' · r · s'' ≡⟨ eq1 r s r' s' r'' s'' u v ⟩ -- not just ≡⟨ solve R' ⟩
u · r · s' · v · s'' ≡⟨ cong (λ x → x · v · s'') p ⟩
u · r' · s · v · s'' ≡⟨ eq2 r s r' s' r'' s'' u v ⟩
u · s · (v · r' · s'') ≡⟨ cong (u · s ·_) q ⟩
u · s · (v · r'' · s') ≡⟨ eq3 r s r' s' r'' s'' u v ⟩
u · v · s' · r'' · s ∎
locIsEquivRel : isEquivRel _≈_
isEquivRel.reflexive locIsEquivRel = locRefl
isEquivRel.symmetric locIsEquivRel = locSym
isEquivRel.transitive locIsEquivRel = locTrans
_+ₗ_ : S⁻¹R → S⁻¹R → S⁻¹R
_+ₗ_ = setQuotSymmBinOp locRefl locTrans _+ₚ_
(λ a b → subst (λ x → (a +ₚ b) ≈ x) (+ₚ-symm a b) (locRefl (a +ₚ b))) θ
where
_+ₚ_ : R × S → R × S → R × S
(r₁ , s₁ , s₁∈S) +ₚ (r₂ , s₂ , s₂∈S) =
(r₁ · s₂ + r₂ · s₁) , (s₁ · s₂) , SMultClosedSubset .multClosed s₁∈S s₂∈S
+ₚ-symm : (a b : R × S) → (a +ₚ b) ≡ (b +ₚ a)
+ₚ-symm (r₁ , s₁ , s₁∈S) (r₂ , s₂ , s₂∈S) =
ΣPathP (+Comm _ _ , Σ≡Prop (λ x → S' x .snd) (·-comm _ _))
θ : (a a' b : R × S) → a ≈ a' → (a +ₚ b) ≈ (a' +ₚ b)
θ (r₁ , s₁ , s₁∈S) (r'₁ , s'₁ , s'₁∈S) (r₂ , s₂ , s₂∈S) ((s , s∈S) , p) = (s , s∈S) , path
where
eq1 : (r₁ s₁ r'₁ s'₁ s'₁ r₂ s₂ s : R)
→ s · (r₁ · s₂ + r₂ · s₁) · (s'₁ · s₂) ≡ s · r₁ · s'₁ · s₂ · s₂ + s · r₂ · s₁ · s'₁ · s₂
eq1 = solve R'
eq2 : (r₁ s₁ r'₁ s'₁ s'₁ r₂ s₂ s : R)
→ s · r'₁ · s₁ · s₂ · s₂ + s · r₂ · s₁ · s'₁ · s₂ ≡ s · (r'₁ · s₂ + r₂ · s'₁) · (s₁ · s₂)
eq2 = solve R'
path : s · (r₁ · s₂ + r₂ · s₁) · (s'₁ · s₂) ≡ s · (r'₁ · s₂ + r₂ · s'₁) · (s₁ · s₂)
path = s · (r₁ · s₂ + r₂ · s₁) · (s'₁ · s₂)
≡⟨ eq1 r₁ s₁ r'₁ s'₁ s'₁ r₂ s₂ s ⟩
s · r₁ · s'₁ · s₂ · s₂ + s · r₂ · s₁ · s'₁ · s₂
≡⟨ cong (λ x → x · s₂ · s₂ + s · r₂ · s₁ · s'₁ · s₂) p ⟩
s · r'₁ · s₁ · s₂ · s₂ + s · r₂ · s₁ · s'₁ · s₂
≡⟨ eq2 r₁ s₁ r'₁ s'₁ s'₁ r₂ s₂ s ⟩
s · (r'₁ · s₂ + r₂ · s'₁) · (s₁ · s₂) ∎
-- check group-laws for addition
+ₗ-assoc : (x y z : S⁻¹R) → x +ₗ (y +ₗ z) ≡ (x +ₗ y) +ₗ z
+ₗ-assoc = SQ.elimProp3 (λ _ _ _ → squash/ _ _) +ₗ-assoc[]
where
+ₗ-assoc[] : (a b c : R × S) → [ a ] +ₗ ([ b ] +ₗ [ c ]) ≡ ([ a ] +ₗ [ b ]) +ₗ [ c ]
+ₗ-assoc[] (r , s , s∈S) (r' , s' , s'∈S) (r'' , s'' , s''∈S) =
cong [_] (ΣPathP ((path r s r' s' r'' s'') , Σ≡Prop (λ x → ∈-isProp S' x) (·Assoc _ _ _)))
where
path : (r s r' s' r'' s'' : R)
→ r · (s' · s'') + (r' · s'' + r'' · s') · s ≡ (r · s' + r' · s) · s'' + r'' · (s · s')
path = solve R'
0ₗ : S⁻¹R
0ₗ = [ 0r , 1r , SMultClosedSubset .containsOne ]
+ₗ-rid : (x : S⁻¹R) → x +ₗ 0ₗ ≡ x
+ₗ-rid = SQ.elimProp (λ _ → squash/ _ _) +ₗ-rid[]
where
+ₗ-rid[] : (a : R × S) → [ a ] +ₗ 0ₗ ≡ [ a ]
+ₗ-rid[] (r , s , s∈S) = path
where
eq1 : (r s : R) → r · 1r + 0r · s ≡ r
eq1 = solve R'
path : [ r · 1r + 0r · s , s · 1r , SMultClosedSubset .multClosed s∈S
(SMultClosedSubset .containsOne) ]
≡ [ r , s , s∈S ]
path = cong [_] (ΣPathP (eq1 r s , Σ≡Prop (λ x → ∈-isProp S' x) (·Rid _)))
-ₗ_ : S⁻¹R → S⁻¹R
-ₗ_ = SQ.rec squash/ -ₗ[] -ₗWellDef
where
-ₗ[] : R × S → S⁻¹R
-ₗ[] (r , s) = [ - r , s ]
-ₗWellDef : (a b : R × S) → a ≈ b → -ₗ[] a ≡ -ₗ[] b
-ₗWellDef (r , s , _) (r' , s' , _) ((u , u∈S) , p) = eq/ _ _ ((u , u∈S) , path)
where
eq1 : (u r s' : R) → u · - r · s' ≡ - (u · r · s')
eq1 = solve R'
eq2 : (u r' s : R) → - (u · r' · s) ≡ u · - r' · s
eq2 = solve R'
path : u · - r · s' ≡ u · - r' · s
path = eq1 u r s' ∙∙ cong -_ p ∙∙ eq2 u r' s
+ₗ-rinv : (x : S⁻¹R) → x +ₗ (-ₗ x) ≡ 0ₗ
+ₗ-rinv = SQ.elimProp (λ _ → squash/ _ _) +ₗ-rinv[]
where
+ₗ-rinv[] : (a : R × S) → ([ a ] +ₗ (-ₗ [ a ])) ≡ 0ₗ
+ₗ-rinv[] (r , s , s∈S) = eq/ _ _ ((1r , SMultClosedSubset .containsOne) , path r s)
where
path : (r s : R) → 1r · (r · s + - r · s) · 1r ≡ 1r · 0r · (s · s)
path = solve R'
+ₗ-comm : (x y : S⁻¹R) → x +ₗ y ≡ y +ₗ x
+ₗ-comm = SQ.elimProp2 (λ _ _ → squash/ _ _) +ₗ-comm[]
where
+ₗ-comm[] : (a b : R × S) → ([ a ] +ₗ [ b ]) ≡ ([ b ] +ₗ [ a ])
+ₗ-comm[] (r , s , s∈S) (r' , s' , s'∈S) =
cong [_] (ΣPathP ((+Comm _ _) , Σ≡Prop (λ x → ∈-isProp S' x) (·-comm _ _)))
-- Now for multiplication
_·ₗ_ : S⁻¹R → S⁻¹R → S⁻¹R
_·ₗ_ = setQuotSymmBinOp locRefl locTrans _·ₚ_
(λ a b → subst (λ x → (a ·ₚ b) ≈ x) (·ₚ-symm a b) (locRefl (a ·ₚ b))) θ
where
_·ₚ_ : R × S → R × S → R × S
(r₁ , s₁ , s₁∈S) ·ₚ (r₂ , s₂ , s₂∈S) =
(r₁ · r₂) , ((s₁ · s₂) , SMultClosedSubset .multClosed s₁∈S s₂∈S)
·ₚ-symm : (a b : R × S) → (a ·ₚ b) ≡ (b ·ₚ a)
·ₚ-symm (r₁ , s₁ , s₁∈S) (r₂ , s₂ , s₂∈S) =
ΣPathP (·-comm _ _ , Σ≡Prop (λ x → S' x .snd) (·-comm _ _))
θ : (a a' b : R × S) → a ≈ a' → (a ·ₚ b) ≈ (a' ·ₚ b)
θ (r₁ , s₁ , s₁∈S) (r'₁ , s'₁ , s'₁∈S) (r₂ , s₂ , s₂∈S) ((s , s∈S) , p) = (s , s∈S) , path
where
eq1 : (r₁ s₁ r'₁ s'₁ r₂ s₂ s : R)
→ s · (r₁ · r₂) · (s'₁ · s₂) ≡ s · r₁ · s'₁ · r₂ · s₂
eq1 = solve R'
eq2 : (r₁ s₁ r'₁ s'₁ r₂ s₂ s : R)
→ s · r'₁ · s₁ · r₂ · s₂ ≡ s · (r'₁ · r₂) · (s₁ · s₂)
eq2 = solve R'
path : s · (r₁ · r₂) · (s'₁ · s₂) ≡ s · (r'₁ · r₂) · (s₁ · s₂)
path = eq1 r₁ s₁ r'₁ s'₁ r₂ s₂ s ∙∙ cong (λ x → x · r₂ · s₂) p ∙∙ eq2 r₁ s₁ r'₁ s'₁ r₂ s₂ s
-- checking laws for multiplication
1ₗ : S⁻¹R
1ₗ = [ 1r , 1r , SMultClosedSubset .containsOne ]
·ₗ-assoc : (x y z : S⁻¹R) → x ·ₗ (y ·ₗ z) ≡ (x ·ₗ y) ·ₗ z
·ₗ-assoc = SQ.elimProp3 (λ _ _ _ → squash/ _ _) ·ₗ-assoc[]
where
·ₗ-assoc[] : (a b c : R × S) → [ a ] ·ₗ ([ b ] ·ₗ [ c ]) ≡ ([ a ] ·ₗ [ b ]) ·ₗ [ c ]
·ₗ-assoc[] (r , s , s∈S) (r' , s' , s'∈S) (r'' , s'' , s''∈S) =
cong [_] (ΣPathP ((·Assoc _ _ _) , Σ≡Prop (λ x → ∈-isProp S' x) (·Assoc _ _ _)))
·ₗ-rid : (x : S⁻¹R) → x ·ₗ 1ₗ ≡ x
·ₗ-rid = SQ.elimProp (λ _ → squash/ _ _) ·ₗ-rid[]
where
·ₗ-rid[] : (a : R × S) → ([ a ] ·ₗ 1ₗ) ≡ [ a ]
·ₗ-rid[] (r , s , s∈S) = cong [_] (ΣPathP ((·Rid _) , Σ≡Prop (λ x → ∈-isProp S' x) (·Rid _)))
·ₗ-rdist-+ₗ : (x y z : S⁻¹R) → x ·ₗ (y +ₗ z) ≡ (x ·ₗ y) +ₗ (x ·ₗ z)
·ₗ-rdist-+ₗ = SQ.elimProp3 (λ _ _ _ → squash/ _ _) ·ₗ-rdist-+ₗ[]
where
·ₗ-rdist-+ₗ[] : (a b c : R × S) → [ a ] ·ₗ ([ b ] +ₗ [ c ]) ≡ ([ a ] ·ₗ [ b ]) +ₗ ([ a ] ·ₗ [ c ])
·ₗ-rdist-+ₗ[] (r , s , s∈S) (r' , s' , s'∈S) (r'' , s'' , s''∈S) =
eq/ _ _ ((1r , (SMultClosedSubset .containsOne)) , path r s r' s' r'' s'')
where
-- could be shortened even further
path : (r s r' s' r'' s'' : R)
→ 1r · (r · (r' · s'' + r'' · s')) · (s · s' · (s · s''))
≡ 1r · (r · r' · (s · s'') + r · r'' · (s · s')) · (s · (s' · s''))
path = solve R'
·ₗ-comm : (x y : S⁻¹R) → x ·ₗ y ≡ y ·ₗ x
·ₗ-comm = SQ.elimProp2 (λ _ _ → squash/ _ _) ·ₗ-comm[]
where
·ₗ-comm[] : (a b : R × S) → [ a ] ·ₗ [ b ] ≡ [ b ] ·ₗ [ a ]
·ₗ-comm[] (r , s , s∈S) (r' , s' , s'∈S) =
cong [_] (ΣPathP ((·-comm _ _) , Σ≡Prop (λ x → ∈-isProp S' x) (·-comm _ _)))
-- Commutative ring structure on S⁻¹R
S⁻¹RAsCommRing : CommRing ℓ
S⁻¹RAsCommRing = S⁻¹R , S⁻¹RCommRingStr
where
open CommRingStr
S⁻¹RCommRingStr : CommRingStr S⁻¹R
0r S⁻¹RCommRingStr = 0ₗ
1r S⁻¹RCommRingStr = 1ₗ
_+_ S⁻¹RCommRingStr = _+ₗ_
_·_ S⁻¹RCommRingStr = _·ₗ_
- S⁻¹RCommRingStr = -ₗ_
isCommRing S⁻¹RCommRingStr = makeIsCommRing squash/ +ₗ-assoc +ₗ-rid +ₗ-rinv +ₗ-comm
·ₗ-assoc ·ₗ-rid ·ₗ-rdist-+ₗ ·ₗ-comm
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_83_412.asm | ljhsiun2/medusa | 9 | 91227 | <filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_83_412.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xc920, %rbx
nop
nop
cmp %rdx, %rdx
mov (%rbx), %ecx
nop
xor %r11, %r11
lea addresses_WC_ht+0x5870, %rsi
lea addresses_normal_ht+0x1874, %rdi
nop
nop
nop
nop
add %r14, %r14
mov $30, %rcx
rep movsb
nop
nop
nop
nop
nop
and $45093, %rdi
lea addresses_A_ht+0x1d59c, %r14
nop
nop
nop
nop
cmp $4777, %r11
and $0xffffffffffffffc0, %r14
movaps (%r14), %xmm1
vpextrq $1, %xmm1, %rcx
nop
xor %rbx, %rbx
lea addresses_normal_ht+0x1b19c, %rbx
nop
sub %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm1
and $0xffffffffffffffc0, %rbx
vmovaps %ymm1, (%rbx)
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WC_ht+0xc0b9, %rsi
nop
nop
sub %rdx, %rdx
movups (%rsi), %xmm2
vpextrq $1, %xmm2, %rcx
nop
nop
nop
add $64952, %rsi
lea addresses_normal_ht+0x17e9c, %rbx
nop
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm3
vmovups %ymm3, (%rbx)
nop
nop
nop
nop
nop
xor $27624, %rbx
lea addresses_WC_ht+0xb91c, %rcx
nop
sub $29480, %rdi
movb (%rcx), %bl
cmp $62908, %rbx
lea addresses_normal_ht+0x11a5c, %rsi
lea addresses_D_ht+0x1c246, %rdi
clflush (%rsi)
nop
sub %r8, %r8
mov $79, %rcx
rep movsq
nop
nop
nop
cmp %r11, %r11
lea addresses_D_ht+0xf99c, %r14
and $62587, %r8
movl $0x61626364, (%r14)
nop
nop
xor $61433, %r14
lea addresses_WT_ht+0x14916, %r11
add $34735, %rbx
movl $0x61626364, (%r11)
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0x219c, %r11
nop
xor $37881, %rbx
movl $0x61626364, (%r11)
add $20226, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r14
push %r9
push %rax
// Load
mov $0x3ac72d0000000e1c, %r14
nop
nop
add %r9, %r9
mov (%r14), %r10d
cmp %r9, %r9
// Store
lea addresses_RW+0x4e5c, %r14
nop
inc %r11
movw $0x5152, (%r14)
nop
sub $36499, %rax
// Faulty Load
lea addresses_PSE+0x919c, %r10
nop
nop
add %rax, %rax
movb (%r10), %r9b
lea oracles, %r10
and $0xff, %r9
shlq $12, %r9
mov (%r10,%r9,1), %r9
pop %rax
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'33': 83}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/controlled2.adb | best08618/asylo | 7 | 29011 | -- { dg-do compile }
with controlled1; use controlled1;
package body controlled2 is
procedure Test_Suite is
begin
Add_Test
(new Test_Case'(Test_Case1 with Link_Under_Test => 300));
end Test_Suite;
end controlled2;
|
programs/oeis/296/A296200.asm | neoneye/loda | 22 | 164649 | ; A296200: Harary index of the n X n white bishop graph.
; 1,5,21,47,104,182,318,490,755,1075,1531,2065,2786,3612,4684,5892,7413,9105,11185,13475,16236,19250,22826,26702,31239,36127,41783,47845,54790,62200,70616,79560,89641,100317,112269,124887,138928,153710,170070,187250
mov $2,$0
add $2,1
mov $6,$0
lpb $2
mov $0,$6
sub $2,1
sub $0,$2
mov $7,$0
add $7,1
mov $8,0
mov $9,$0
lpb $7
mov $0,$9
sub $7,1
sub $0,$7
mov $3,1
add $3,$0
add $3,3
mov $5,$0
gcd $5,2
mul $3,$5
sub $3,1
mul $0,$3
add $0,2
mul $0,4
mov $4,$0
sub $4,8
div $4,8
add $4,1
add $8,$4
lpe
add $1,$8
lpe
mov $0,$1
|
gtkada_backend/example/engine_control_ui.ads | Fabien-Chouteau/Giza | 7 | 28902 | <reponame>Fabien-Chouteau/Giza<gh_stars>1-10
with Giza.Windows;
with Giza.Widgets.Tabs; use Giza.Widgets.Tabs;
with Giza.Widgets.Composite; use Giza.Widgets.Composite;
with RPM_Widget; use RPM_Widget;
with Power_Phase_Widget; use Power_Phase_Widget;
with Giza.Widgets.Number_Selection; use Giza.Widgets.Number_Selection;
with Giza.Widgets.Background; use Giza.Widgets.Background;
with Giza.Events; use Giza.Events;
with Giza.Graphics; use Giza.Graphics;
package Engine_Control_UI is
subtype Parent is Giza.Windows.Window;
type Engine_Control_Window is new Parent with private;
overriding
procedure On_Init (This : in out Engine_Control_Window);
overriding
procedure On_Displayed (This : in out Engine_Control_Window);
overriding
procedure On_Hidden (This : in out Engine_Control_Window);
overriding
function On_Position_Event
(This : in out Engine_Control_Window;
Evt : Position_Event_Ref;
Pos : Point_T) return Boolean;
private
type Engine_Control_Window is new Giza.Windows.Window with record
RPM_Widget : access RPM;
PP : access PP_Widget;
Tabs : access Gtabs;
Manual : access Composite_Widget;
Auto : access Composite_Widget;
Ignition : access Gnumber_Select;
Duration : access Gnumber_Select;
Target_RPM : access Gnumber_Select;
Background : access Gbackground;
end record;
end Engine_Control_UI;
|
libsrc/_DEVELOPMENT/string/c/sccz80/strtok_r.asm | teknoplop/z88dk | 8 | 6239 |
; char *strtok_r(char * restrict s, const char * restrict sep, char ** restrict lasts)
SECTION code_clib
SECTION code_string
PUBLIC strtok_r
EXTERN asm_strtok_r
strtok_r:
pop af
pop bc
pop de
pop hl
push hl
push de
push bc
push af
jp asm_strtok_r
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_21829_125.asm | ljhsiun2/medusa | 9 | 88617 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r8
push %r9
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x19062, %r9
nop
nop
add %rbp, %rbp
mov $0x6162636465666768, %rax
movq %rax, %xmm3
vmovups %ymm3, (%r9)
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x173e2, %rsi
lea addresses_A_ht+0x18912, %rdi
nop
nop
nop
add $51919, %r8
mov $16, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $8282, %r8
lea addresses_UC_ht+0xb5e2, %rsi
lea addresses_A_ht+0x145e2, %rdi
clflush (%rdi)
nop
nop
nop
nop
and %r8, %r8
mov $86, %rcx
rep movsq
nop
nop
nop
inc %rbp
lea addresses_WC_ht+0x579e, %rbp
nop
add $46893, %rax
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
and $46940, %rbp
lea addresses_A_ht+0xe262, %rsi
lea addresses_D_ht+0x7d5d, %rdi
nop
nop
nop
nop
cmp %r8, %r8
mov $25, %rcx
rep movsq
nop
nop
nop
nop
cmp $60053, %r8
lea addresses_normal_ht+0x2242, %rsi
lea addresses_A_ht+0x3462, %rdi
clflush (%rsi)
nop
nop
nop
add %rbx, %rbx
mov $72, %rcx
rep movsq
nop
nop
nop
dec %rsi
lea addresses_WT_ht+0x19bec, %rsi
lea addresses_normal_ht+0x14312, %rdi
nop
nop
nop
nop
nop
cmp $46768, %rbx
mov $106, %rcx
rep movsl
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1262, %r8
cmp %rdi, %rdi
movb $0x61, (%r8)
nop
nop
inc %rdi
lea addresses_D_ht+0xce62, %rax
nop
cmp $45930, %rsi
and $0xffffffffffffffc0, %rax
vmovaps (%rax), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r8
nop
nop
cmp $50908, %rsi
lea addresses_WC_ht+0x12a62, %rsi
nop
xor %r8, %r8
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
and $25020, %rax
lea addresses_D_ht+0x1736a, %rsi
lea addresses_normal_ht+0x2f82, %rdi
nop
sub %r8, %r8
mov $106, %rcx
rep movsl
nop
add %rsi, %rsi
lea addresses_WC_ht+0xda62, %rax
nop
add $27740, %rsi
mov $0x6162636465666768, %r8
movq %r8, %xmm2
and $0xffffffffffffffc0, %rax
movntdq %xmm2, (%rax)
nop
nop
add %rax, %rax
lea addresses_A_ht+0xabe2, %r9
nop
nop
inc %r8
and $0xffffffffffffffc0, %r9
movntdqa (%r9), %xmm2
vpextrq $1, %xmm2, %rbp
nop
nop
dec %rcx
lea addresses_WC_ht+0x1efb8, %rsi
lea addresses_A_ht+0x14662, %rdi
nop
nop
nop
dec %r9
mov $104, %rcx
rep movsq
sub $39619, %rbx
lea addresses_normal_ht+0x4fc2, %rcx
nop
nop
nop
nop
nop
xor $46680, %r9
mov (%rcx), %ebx
nop
nop
nop
nop
nop
dec %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rdx
push %rsi
// Faulty Load
mov $0x44843a0000000a62, %rdx
nop
nop
nop
nop
add $203, %r8
mov (%rdx), %r15
lea oracles, %rdx
and $0xff, %r15
shlq $12, %r15
mov (%rdx,%r15,1), %r15
pop %rsi
pop %rdx
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 8, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
jraphql-parser-antlr/src/main/antlr4/me/wener/jraphql/parser/antlr/GraphQL.g4 | wenerme/jraphql | 4 | 2617 | // GraphQL Grammer
// ==============
// https://github.com/wenerme/wener/tree/master/tricks/languages/antlr/GraphQL.g4
//
// Appendix B -- Grammar Summary.md https://github.com/facebook/graphql/blob/master/spec/Appendix%20B%20--%20Grammar%20Summary.md
//
// Changes - search `//extension` in grammer to find out where has been extended
// - Add `extend by name` syntax for object and interface
// - Allowed use keyword as name
// - Allowed directives on directive definition, add DIRECTIVE location
// - Allowed schema has optional name
// - Allowed optional '&' for interface
//
// Notes
// - Change type to typeSpce for Go target to prevent name conflict
//
grammar GraphQL;
graphql : document ;
// 2.1 Source Text
// SourceCharacter : [\u0009\u000A\u000D\u0020-\uFFFF] ;
Ignored: (UnicodeBOM | WhiteSpace | LineTerminator | Comma) -> skip;
UnicodeBOM : [\uFEFF];
// Horizontal Tab/Space
WhiteSpace : [\u0009\u0020];
// New Line/Carriage Return New Line
// [\u000A] | '\u000D\u000A' | [\u000D]
LineTerminator : [\u000D\u000A]+;
Comment : '#' ~[\n\r\u2028\u2029]* -> channel(2);
// NOTE overlap with NAME
// CommentChar : ~[\u000D\u000A] ; // TODO SourceCharacter but not LineTerminator
Comma : ',' ;
// 2.1.9 Names
// NOTE: Allowed keyword as name
name
: NAME
| 'type' | 'fragment' | 'extend' | 'implements' | 'schema'
| 'enum' | 'union' | 'interface' | 'input' | 'scalar' | 'directive'
| 'query' | 'mutation' | 'subscription'
| DirectiveLocation
// | 'true' | 'false' | 'null' // NOTE boolean and null is NOT allowed
| 'by' // keyword used by extensions
// | 'on' // will confuse inline spread
;
// 2.2 Query Document
document
: definition+ EOF
;
//extension
executableDocument
: executableDefinition+ EOF
;
//extension
typeSystemDocument
: typeSystemDefinition+ EOF
;
definition
: executableDefinition
| typeSystemDefinition
;
executableDefinition
: operationDefinition
| fragmentDefinition
;
// 2.3 Operations
operationDefinition
: operationType name? variableDefinitions? directives? selectionSet
| selectionSet
;
operationType : 'query' | 'mutation' | 'subscription' ;
// 2.4 Selection Sets
selectionSet : '{' selection+ '}' ;
selection
: field
| fragmentSpread
| inlineFragment
;
// 2.5 Fields
field : alias? name arguments? directives? selectionSet? ;
// 2.6 Arguments
arguments : '(' argument+ ')' ;
argument : name ':' value ;
// 2.7 Field Alias
alias
: name ':'
;
// 2.8 Fragments
fragmentSpread
: '...' fragmentName directives?
;
fragmentDefinition
: 'fragment' fragmentName typeCondition directives? selectionSet
;
fragmentName
: name // TODO name but not `on`
;
typeCondition
: 'on' namedType
;
inlineFragment
: '...' typeCondition? directives? selectionSet
;
//constValue
// : STRING # stringValue | NUMBER # numberValue | BOOLEAN # booleanValue
// ;
// 2.9 Input Values
value
: variable
| floatValue
| intValue
| stringValue
| booleanValue
| nullValue
| enumValue
| listValue
| objectValue
;
// 2.9.1 Int Value
intValue : IntegerPart ;
IntegerPart
: NegativeSign? '0'
| NegativeSign? NonZeroDigit Digit*
;
NegativeSign : '-' ;
fragment Digit : [0123456789] ;
fragment NonZeroDigit : [123456789] ;
// 2.9.2 Float Value
floatValue
: IntegerPart FractionalPart ExponentPart
| IntegerPart ExponentPart
| IntegerPart FractionalPart
;
FractionalPart : '.' Digit+ ;
ExponentPart : ExponentIndicator Sign? Digit+ ;
fragment ExponentIndicator : [eE] ;
fragment Sign : [+-] ;
// 2.9.3 Boolean Value
booleanValue : 'true' | 'false' ;
// 2.9.4 String Value
stringValue
: StringConst
;
StringConst : '""' | '"' StringCharacter+ '"';
fragment StringCharacter
: [\u0009\u0020\u0021\u0023-\u005B\u005D-\uFFFF] // SourceCharacter bit not " \u0022 or \ \u005C or LineTerminator
| '\\u' EscapedUnicode
| '\\' EscapedCharacter
;
fragment EscapedUnicode : [0-9A-Fa-f] [0-9A-Fa-f] [0-9A-Fa-f] [0-9A-Fa-f];
fragment EscapedCharacter : ["\\/bfnrt];
// 2.9.5 Null Value
nullValue : 'null' ;
// 2.9.6 Enum Value
enumValue
: name
; // TODO name but not `true`, `false` or `null`
// 2.9.7 List Value
listValue
: '[' ']'
| '[' value+ ']'
;
// 2.9.8 Input Object Values
objectValue
: '{' '}'
| '{' objectField+ '}'
;
objectField : name ':' value ;
// 2.10 Variables
variable : '$' name ;
variableDefinitions : '(' variableDefinition+ ')' ;
variableDefinition : variable ':' type ( '='? defaultValue)? ;
defaultValue : value ;
// 2.11 Input Types
type
: namedType
| listType
| nonNullType
;
namedType : name ;
listType : '[' type ']' ;
nonNullType : namedType '!' | listType '!' ;
// 2.12
directives : directive+ ;
directive : '@' name arguments? ;
// TypeSystemDefinition
// ====================
typeSystemDefinition
: schemaDefinition
| typeDefinition
| typeExtension
| directiveDefinition
;
//extension name?
schemaDefinition
: 'schema' name? directives? '{' operationTypeDefinition+ '}'
;
operationTypeDefinition : operationType ':' namedType;
description : stringValue ;
typeDefinition
: scalarTypeDefinition
| objectTypeDefinition
| interfaceTypeDefinition
| unionTypeDefinition
| enumTypeDefinition
| inputObjectTypeDefinition
;
typeExtension
: scalarTypeExtension
| objectTypeExtension
| interfaceTypeExtension
| unionTypeExtension
| enumTypeExtension
| inputObjectTypeExtension
;
scalarTypeDefinition : description? 'scalar' name directives?;
scalarTypeExtension : 'extend' 'scalar' name directives;
objectTypeDefinition : description? 'type' name implementsInterfaces? directives? fieldsDefinition?;
objectTypeExtension
: 'extend' 'type' name implementsInterfaces? directives? fieldsDefinition
| 'extend' 'type' name implementsInterfaces? directives
| 'extend' 'type' name implementsInterfaces
| 'extend' 'type' name 'by' name directives? fieldsDefinition? //extension
;
// Recursion 'implements' _ '&'? _ NamedType / ImplementsInterfaces _ '&' _ NamedType
implementsInterfaces
: 'implements' '&'? namedType
| implementsInterfaces '&'? namedType //extension optional '&'?
;
fieldsDefinition : '{' fieldDefinition+ '}' ;
fieldDefinition : description? name argumentsDefinition? ':' type directives? ;
argumentsDefinition : '(' inputValueDefinition* ')' ;
inputValueDefinition : description? name ':' type ('='? defaultValue)? directives? ; // NOTE add '=' for default value
interfaceTypeDefinition : description? 'interface' name directives? fieldsDefinition? ;
interfaceTypeExtension
: 'extend' 'interface' name directives? fieldsDefinition
| 'extend' 'interface' name directives
| 'extend' 'interface' name 'by' name directives? fieldsDefinition? //extension
;
unionTypeDefinition : description? 'union' name directives? unionMemberTypes? ;
// Recursion '=' _ '|'? _ NamedType / UnionMemberTypes '|' NamedType
unionMemberTypes
: '=' '|'? namedType
| unionMemberTypes '|' namedType
;
unionTypeExtension
: 'extend' 'union' name directives? unionMemberTypes
| 'extend' 'union' name directives
;
enumTypeDefinition : description? 'enum' name directives? enumValuesDefinition? ;
enumValuesDefinition : '{' enumValueDefinition+ '}' ;
enumValueDefinition : description? enumValue directives? ;
enumTypeExtension
: 'extend' 'enum' name directives? enumValuesDefinition
| 'extend' 'enum' name directives
;
inputObjectTypeDefinition : description? 'input' name directives? inputFieldsDefinition?;
inputFieldsDefinition : '{' inputValueDefinition+ '}' ;
inputObjectTypeExtension
: 'extend' 'input' name directives? inputFieldsDefinition
| 'extend' 'input' name directives
;
//extension directives? allowed directive on directive
directiveDefinition : description? 'directive' '@' name directives? argumentsDefinition? 'on' directiveLocations;
// Recursion '|'? _ DirectiveLocation / DirectiveLocations _ '|' _ DirectiveLocation
directiveLocations
: '|'? DirectiveLocation
| directiveLocations '|' DirectiveLocation
;
DirectiveLocation
: ExecutableDirectiveLocation
| TypeSystemDirectiveLocation
;
ExecutableDirectiveLocation
: 'QUERY'
| 'MUTATION'
| 'SUBSCRIPTION'
| 'FIELD'
| 'FRAGMENT_DEFINITION'
| 'FRAGMENT_SPREAD'
| 'INLINE_FRAGMENT'
;
TypeSystemDirectiveLocation
: 'SCHEMA'
| 'SCALAR'
| 'OBJECT'
| 'FIELD_DEFINITION'
| 'ARGUMENT_DEFINITION'
| 'INTERFACE'
| 'UNION'
| 'ENUM'
| 'ENUM_VALUE'
| 'INPUT_OBJECT'
| 'INPUT_FIELD_DEFINITION'
| 'DIRECTIVE' //extension
;
// Must in the last
NAME : [_a-zA-Z] [_a-zA-Z0-9]* ;
|
programs/main.asm | poeticAndroid/cyberbit | 1 | 4691 | ;; z28r asm
jump main
ext printStr 0x5020 2
ext readLn 0x5024 2
ext open 0x503c 3
ext read 0x5040 2
data prompt_str "\nProgram: \0"
end
fn main args
vars len
let len = true
while len
let len = open 0x20726964 buffer 0
read buffer len
printStr buffer -1
printStr prompt_str -1
store buffer 0
readLn buffer 16
let len = open 0x20746567 buffer 0
if len
read buffer len
drop run
end
end
return 404
end
fn run
-1
return exec buffer 1 0
end
data buffer ".\0"
end
|
oeis/306/A306863.asm | neoneye/loda-programs | 11 | 22323 | ; A306863: a(n) is the number of primes between the n-th and (n+1)-st odd composite numbers.
; Submitted by <NAME>
; 2,2,1,0,2,0,1,2,1,0,1,0,2,0,1,2,0,1,1,0,1,0,0,1,2,2,1,0,0,0,0,0,1,1,0,2,0,0,0,2,0,1,0,1,1,0,1,0,2,0,0,0,2,2,0,0,0,0,1,0,0,0,0,1,2,1,0,2,0,0,0,1,0,1,0,1,0,2,0,1,2,0,0,0,1,0,0
add $0,1
seq $0,196274 ; Half of the gaps A067970 between odd nonprimes A014076.
sub $0,1
|
programs/oeis/047/A047264.asm | karttu/loda | 1 | 165947 | ; A047264: Numbers that are congruent to 0 or 5 mod 6.
; 0,5,6,11,12,17,18,23,24,29,30,35,36,41,42,47,48,53,54,59,60,65,66,71,72,77,78,83,84,89,90,95,96,101,102,107,108,113,114,119,120,125,126,131,132,137,138,143,144,149,150,155,156,161,162,167,168,173,174,179,180,185,186,191,192,197,198,203,204,209,210,215,216,221,222,227,228,233,234,239,240,245,246,251,252,257,258,263,264,269,270,275,276,281,282,287,288,293,294,299,300,305,306,311,312,317,318,323,324,329,330,335,336,341,342,347,348,353,354,359,360,365,366,371,372,377,378,383,384,389,390,395,396,401,402,407,408,413,414,419,420,425,426,431,432,437,438,443,444,449,450,455,456,461,462,467,468,473,474,479,480,485,486,491,492,497,498,503,504,509,510,515,516,521,522,527,528,533,534,539,540,545,546,551,552,557,558,563,564,569,570,575,576,581,582,587,588,593,594,599,600,605,606,611,612,617,618,623,624,629,630,635,636,641,642,647,648,653,654,659,660,665,666,671,672,677,678,683,684,689,690,695,696,701,702,707,708,713,714,719,720,725,726,731,732,737,738,743,744,749
mov $1,$0
add $1,1
div $1,2
mul $1,4
add $1,$0
|
functions.asm | gaozihang/learning-asm | 0 | 4277 | atoi:
push ebx
push ecx
push edx
push esi
mov esi, eax
mov eax, 0
mov ecx, 0
.multiplyLoop:
xor ebx, ebx
mov bl, [esi + ecx]
cmp bl, 48
jl .finished
cmp bl, 57
jg .finished
sub bl, 48
add eax, ebx
mov ebx, 10
mul ebx
inc ecx
jmp .multiplyLoop
.finished:
cmp ecx, 0
je .restore
mov ebx, 10
div ebx
.restore:
pop esi
pop edx
pop ecx
pop ebx
ret
iprint:
push eax
push ecx
push edx
push esi
mov ecx, 0
divideLoop:
inc ecx
mov edx, 0
mov esi, 10
idiv esi
add edx, 48
push edx
cmp eax, 0
jnz divideLoop
printLoop:
dec ecx
mov eax, esp
call sprint
pop eax
cmp ecx, 0
jnz printLoop
pop esi
pop edx
pop ecx
pop eax
ret
iprintLF:
call iprint
push eax
mov eax, 0Ah
push eax
mov eax, esp
call sprint
pop eax
pop eax
ret
slen:
push ebx
mov ebx, eax
nextchar:
cmp byte[eax], 0
jz finished
inc eax
jmp nextchar
finished:
sub eax, ebx
pop ebx
ret
sprint:
push edx
push ecx
push ebx
push eax
call slen
mov edx, eax
pop eax
mov ecx, eax
mov ebx, 1
mov eax, 4
int 80h
pop ebx
pop ecx
pop edx
ret
sprintLF:
call sprint
push eax
mov eax, 0Ah
push eax
mov eax, esp
call sprint
pop eax
pop eax
ret
quit:
mov ebx, 0
mov eax, 1
int 80h
ret
|
flame32-libs/unit-tests/test-and-1.asm | drako0812/flame32 | 2 | 4399 | <reponame>drako0812/flame32
#include "../../flame32.asm"
; Tests AND
lod 0x12345678
ldl B, 0x0x0000FFFF
and A, B
; 0x00005678
|
res/06.collatz.asm | francesquini/minips | 4 | 105530 | .data
prompt: .asciiz "Digite o n para calcular o comprimento da sequencia de collatz(n). 0 (zero) finaliza a execução: " # String com \0 no final
prompt2: .asciiz "Collatz(n) = "
.text
inicio:
la $a0, prompt # coloca em a0 o parâmetro da chamada a syscall
li $v0, 4 # 4 é o código para imprimir uma string
syscall
# Le inteiro em $v0
li $v0, 5 # 5 é o código para ler um inteiro
syscall
move $a0, $v0
beq $a0, $zero, saida
nop
jal collatz
nop
move $a0, $v0
li $v0, 1 # 1 é o código para imprimir um inteiro
syscall
# Imprime \n
li $a0,'\n'
li $v0, 11 # 11 é o código para imprimir um caractere
syscall
j inicio
nop
saida:
#Finaliza execução
li $v0, 10 # exit syscall code = 10
syscall
collatz:
li $2,1
li $5,1
beq $4,$2,collatz_end2
nop
li $7,1
collatz_loop:
srl $3,$4,31
sll $2,$4,1
addu $2,$2,$4
addu $3,$3,$4
andi $6,$4,0x1
addiu $2,$2,1
srl $4,$3,1
beq $6,$0,collatz_end1
nop
move $4,$2
collatz_end1:
move $2,$5
addiu $5,$5,1
bne $4,$7,collatz_loop
nop
addiu $2,$2,1
jr $31
nop
collatz_end2:
li $2,1
jr $31
nop
|
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-strmap.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 12249 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . M A P S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Note: parts of this code are derived from the ADAR.CSH public domain
-- Ada 83 versions of the Appendix C string handling packages. The main
-- differences are that we avoid the use of the minimize function which
-- is bit-by-bit or character-by-character and therefore rather slow.
-- Generally for character sets we favor the full 32-byte representation.
package body Ada.Strings.Maps is
---------
-- "-" --
---------
function "-" (Left, Right : Character_Set) return Character_Set is
begin
return Left and not Right;
end "-";
---------
-- "=" --
---------
function "=" (Left, Right : Character_Set) return Boolean is
begin
return Character_Set_Internal (Left) = Character_Set_Internal (Right);
end "=";
-----------
-- "and" --
-----------
function "and" (Left, Right : Character_Set) return Character_Set is
begin
return Character_Set
(Character_Set_Internal (Left) and Character_Set_Internal (Right));
end "and";
-----------
-- "not" --
-----------
function "not" (Right : Character_Set) return Character_Set is
begin
return Character_Set (not Character_Set_Internal (Right));
end "not";
----------
-- "or" --
----------
function "or" (Left, Right : Character_Set) return Character_Set is
begin
return Character_Set
(Character_Set_Internal (Left) or Character_Set_Internal (Right));
end "or";
-----------
-- "xor" --
-----------
function "xor" (Left, Right : Character_Set) return Character_Set is
begin
return Character_Set
(Character_Set_Internal (Left) xor Character_Set_Internal (Right));
end "xor";
-----------
-- Is_In --
-----------
function Is_In
(Element : Character;
Set : Character_Set) return Boolean
is
begin
return Set (Element);
end Is_In;
---------------
-- Is_Subset --
---------------
function Is_Subset
(Elements : Character_Set;
Set : Character_Set) return Boolean
is
begin
return (Elements and Set) = Elements;
end Is_Subset;
---------------
-- To_Domain --
---------------
function To_Domain (Map : Character_Mapping) return Character_Sequence
is
Result : String (1 .. Map'Length);
J : Natural;
begin
J := 0;
for C in Map'Range loop
if Map (C) /= C then
J := J + 1;
Result (J) := C;
end if;
end loop;
return Result (1 .. J);
end To_Domain;
----------------
-- To_Mapping --
----------------
function To_Mapping
(From, To : Character_Sequence) return Character_Mapping
is
Result : Character_Mapping;
Inserted : Character_Set := Null_Set;
From_Len : constant Natural := From'Length;
To_Len : constant Natural := To'Length;
begin
if From_Len /= To_Len then
raise Strings.Translation_Error;
end if;
for Char in Character loop
Result (Char) := Char;
end loop;
for J in From'Range loop
if Inserted (From (J)) then
raise Strings.Translation_Error;
end if;
Result (From (J)) := To (J - From'First + To'First);
Inserted (From (J)) := True;
end loop;
return Result;
end To_Mapping;
--------------
-- To_Range --
--------------
function To_Range (Map : Character_Mapping) return Character_Sequence
is
Result : String (1 .. Map'Length);
J : Natural;
begin
J := 0;
for C in Map'Range loop
if Map (C) /= C then
J := J + 1;
Result (J) := Map (C);
end if;
end loop;
return Result (1 .. J);
end To_Range;
---------------
-- To_Ranges --
---------------
function To_Ranges (Set : Character_Set) return Character_Ranges is
Max_Ranges : Character_Ranges (1 .. Set'Length / 2 + 1);
Range_Num : Natural;
C : Character;
begin
C := Character'First;
Range_Num := 0;
loop
-- Skip gap between subsets
while not Set (C) loop
exit when C = Character'Last;
C := Character'Succ (C);
end loop;
exit when not Set (C);
Range_Num := Range_Num + 1;
Max_Ranges (Range_Num).Low := C;
-- Span a subset
loop
exit when not Set (C) or else C = Character'Last;
C := Character'Succ (C);
end loop;
if Set (C) then
Max_Ranges (Range_Num). High := C;
exit;
else
Max_Ranges (Range_Num). High := Character'Pred (C);
end if;
end loop;
return Max_Ranges (1 .. Range_Num);
end To_Ranges;
-----------------
-- To_Sequence --
-----------------
function To_Sequence (Set : Character_Set) return Character_Sequence is
Result : String (1 .. Character'Pos (Character'Last) + 1);
Count : Natural := 0;
begin
for Char in Set'Range loop
if Set (Char) then
Count := Count + 1;
Result (Count) := Char;
end if;
end loop;
return Result (1 .. Count);
end To_Sequence;
------------
-- To_Set --
------------
function To_Set (Ranges : Character_Ranges) return Character_Set is
Result : Character_Set;
begin
for C in Result'Range loop
Result (C) := False;
end loop;
for R in Ranges'Range loop
for C in Ranges (R).Low .. Ranges (R).High loop
Result (C) := True;
end loop;
end loop;
return Result;
end To_Set;
function To_Set (Span : Character_Range) return Character_Set is
Result : Character_Set;
begin
for C in Result'Range loop
Result (C) := False;
end loop;
for C in Span.Low .. Span.High loop
Result (C) := True;
end loop;
return Result;
end To_Set;
function To_Set (Sequence : Character_Sequence) return Character_Set is
Result : Character_Set := Null_Set;
begin
for J in Sequence'Range loop
Result (Sequence (J)) := True;
end loop;
return Result;
end To_Set;
function To_Set (Singleton : Character) return Character_Set is
Result : Character_Set := Null_Set;
begin
Result (Singleton) := True;
return Result;
end To_Set;
-----------
-- Value --
-----------
function Value
(Map : Character_Mapping;
Element : Character) return Character
is
begin
return Map (Element);
end Value;
end Ada.Strings.Maps;
|
oeis/268/A268358.asm | neoneye/loda-programs | 11 | 246490 | ; A268358: Number of n-digit numbers in base ten having at least five different digits with no leading zeros allowed.
; Submitted by <NAME>
; 27216,544320,7212240,81648000,862774416,8839212480,89320326480,897169996800,8988342579216,89952351128640,899806333018320,8999216089718400,89996836576073616,899987262844420800,8999948800775111760,89999794450846828800,899999175545734649616,8999996695408196976960,89999986761304995790800,899999946984229472304000,8999999787753932087619216,89999999150466742407645120,899999996600219954725999440,8999999986395938660038080000,89999999945568930935250214416,899999999782231252169685833280
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,453 ; Stirling numbers of the second kind, S(n,4).
sub $0,$1
mul $1,11
add $1,$0
lpe
mov $0,$1
mul $0,27216
|
userland/test/syscall.asm | Narasimha1997/r3 | 65 | 99188 | [bits 64]
section .data
msg: db "Hello, World!", 10
t_sec: dq 4
t_usec: dq 0
global _start
_fork:
mov rax, 11
int 0x80
ret
section .text
_start:
call _fork
call _fork
call _fork
LOOP_START:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, 14
int 0x80
mov rdi, t_sec
mov rax, 46
int 0x80
jmp LOOP_START
|
rom/dos/errors.asm | hisahi/ellipse1100 | 0 | 7820 | <filename>rom/dos/errors.asm<gh_stars>0
; Ellipse Workstation 1100 (fictitious computer)
; Ellipse DOS error codes
;
; Copyright (c) 2020 <NAME> (hisahi)
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
; Written for the WLA-DX assembler
;
.DEFINE DOS_ERR_NO_ERR $00.W
.DEFINE DOS_ERR_UNK_FUNCTION $01.W
.DEFINE DOS_ERR_BAD_FILE_HANDLE $02.W
.DEFINE DOS_ERR_FILE_NOT_FOUND $03.W
.DEFINE DOS_ERR_VOLUME_NOT_FOUND $04.W
.DEFINE DOS_ERR_BAD_PATH $05.W
.DEFINE DOS_ERR_DRIVE_NOT_READY $06.W
.DEFINE DOS_ERR_NO_MORE_HANDLES $07.W
.DEFINE DOS_ERR_ACCESS_DENIED $08.W
.DEFINE DOS_ERR_OUT_OF_MEMORY $09.W
.DEFINE DOS_ERR_DRIVE_FULL $0A.W
.DEFINE DOS_ERR_FILE_OPEN $0B.W
.DEFINE DOS_ERR_FILE_NOT_EXEC $0C.W
.DEFINE DOS_ERR_NO_MORE_FILES $0D.W
.DEFINE DOS_ERR_BAD_PARAMETER $0E.W
.DEFINE DOS_ERR_PATH_NOT_FOUND $0F.W
.DEFINE DOS_ERR_DOS_BUSY $10.W
.DEFINE DOS_ERR_INVALID_DRIVE $11.W
.DEFINE DOS_ERR_IO_ERROR $12.W
.DEFINE DOS_ERR_READ_ERROR $13.W
.DEFINE DOS_ERR_WRITE_ERROR $14.W
.DEFINE DOS_ERR_EXEC_TOO_LARGE $15.W
.DEFINE DOS_ERR_CANNOT_SEEK $16.W
.DEFINE DOS_ERR_CREATE_ERROR $17.W
|
iTunesScreenshotMaker.applescript | 1234224576/iTunesConnectScreenshotMaker | 0 | 817 | set filePaths to get (choose file of type {"png"} with multiple selections allowed)
set sizes_width to {750, 1242, 640, 640, 750, 2048}
set sizes_height to {1334, 2208, 1136, 960, 1024, 2732}
repeat with filePath in filePaths
set imagePath to get POSIX path of filePath
tell application "Finder"
set saveDirectory to get (folder of filePath as Unicode text)
set fileName to name of filePath as Unicode text
end tell
repeat with i from 1 to 6
tell application "Image Events"
launch
set img to open imagePath
scale img to size item i of sizes_height
crop img to dimensions {item i of sizes_width, item i of sizes_height}
set imgName to (item i of sizes_width as string) & "x" & (item i of sizes_height as string) & "_" & fileName
save img in file (saveDirectory & imgName) as PNG
close img
end tell
end repeat
end repeat |
data/pokemon/dex_entries/stunky.asm | AtmaBuster/pokeplat-gen2 | 6 | 102282 | db "SKUNK@" ; species name
db "The foul fluid"
next "from its rear is"
next "so revolting that"
page "it can make people"
next "feel queasy up to"
next "1.25 miles away.@"
|
game/data/stages/plateau/screen.asm | benoitryder/super-tilt-bro | 91 | 102894 | stage_plateau_palette_data:
; Background
.byt $21,$0f,$00,$10, $21,$0f,$00,$31, $21,$09,$19,$31, $21,$07,$17,$27
; Sprites
.byt $21,$08,$1a,$20, $21,$08,$10,$37, $21,$08,$16,$10, $21,$08,$28,$37
; Temporary 3 char alias for tiles
#define TFP TILE_CHAR_PCT
nametable_flatland:
.byt ZIPNT_ZEROS(148)
.byt
.byt
.byt
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $01, $02, ZIPNT_ZEROS(30)
.byt $03, $04, $05, ZIPNT_ZEROS(67)
.byt
.byt $01, $02, ZIPNT_ZEROS(6)
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $01, $02, ZIPNT_ZEROS(22), $03, $04, $05
.byt ZIPNT_ZEROS(5)
.byt $03, $04, $05, ZIPNT_ZEROS(133)
.byt
.byt
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt
.byt $21, $20, ZIPNT_ZEROS(30)
.byt $1c, $1d, ZIPNT_ZEROS(6), $21, $21,
.byt ZIPNT_ZEROS(22)
.byt $1c, $1d, ZIPNT_ZEROS(2), $06, $07, $08, $09, $1c, $1d
.byt ZIPNT_ZEROS(18)
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $0e, $0f
.byt ZIPNT_ZEROS(2), $1c, $1d
.byt ZIPNT_ZEROS(3), $0b, $0c,
.byt ZIPZ,$1e, $1f
.byt ZIPNT_ZEROS(2), $0e, $0f
.byt ZIPNT_ZEROS(14)
.byt $14, $15, $28, $2c, $29, $2a, $2b, $2c, $2e, $11, $12, $2e, $29, $2a, $21, $13, $14, $15, $2d, $28, ZIPNT_ZEROS(12)
.byt $30, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $31, $32, ZIPNT_ZEROS(12)
.byt $33, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $36, ZIPNT_ZEROS(12)
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $37, $39, $3a, $3a, $3a, $3a, $3a, $3a, $38, $39, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3b, ZIPNT_ZEROS(12)
.byt $33, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3c, $3d, $3a, $3a, $3a, $3a, $3a, $3a, $3e, $3a, $3a, $36, ZIPNT_ZEROS(6)
.byt $3f, $40, $41, $42, $43, $3f, $37, $3a, $3e, $3a, $3a, $3a, $3a, $44, $45, $3a, $3a, $3a, $44, $45, $3a, $3a, $3a, $3a, $3a, $3b, $40, $41, $42, $43, $3f, $40
.byt $3a, $3a, $3a, $3a, $3a, $3a, $33, $3d, $3a, $3a, $44, $45, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $36, $3a, $3a, $3a, $3a, $3a, $3a
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $3a, $3a, $3a, $3a, $3a, $3a, $37, $3a, $3a, $d1, $d2, $39, $3a, $3a, $3e, $3a, $3a, $3a, $3a, $3a, $3a, $d6, $d7, $3a, $3c, $3b, $3a, $3a, $3a, $3a, $3a, $3a
.byt $3a, $3a, $3a, $3a, $3a, $3a, $33, $3a, $3a, $d3, $d4, $3d, $3a, $3a, $3a, $3e, $3a, $3a, $3a, $3a, $38, $d8, $d9, $3a, $3a, $36, $3a, $3a, $3a, $3a, $3a, $3a
.byt $3a, $3a, $3a, $3a, $3a, $3a, $37, $3a, $3a, $3a, $3a, TFP, $45, $3a, $3a, $3a, $3a, $3a, $3a, $3d, $3c, $3d, $3a, TFP, $3a, $3b, $3a, $3a, $3a, $3a, $3a, $3a
.byt $3a, $3a, $3a, $3a, $3a, $3a, $33, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $44, $45, $3a, $3a, $38, $36, $3a, $3a, $3a, $3a, $3a, $3a
; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- -------------------
.byt $46, $46, $46, $46, $46, $46, $37, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3e, $3a, $3a, $3a, $3a, $3a, $3a, $3b, $46, $46, $46, $46, $46, $46
.byt ZIPNT_ZEROS(6), $33, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $36
.byt ZIPNT_ZEROS(6)
nametable_flatland_attributes:
.byt ZIPNT_ZEROS(8+2)
.byt %01010101, ZIPNT_ZEROS(2), %01010101, %01010101, %01010101
.byt %01010101, %01010101, ZIPNT_ZEROS(4), %01010101, %01010101
.byt ZIPNT_ZEROS(8+1)
.byt %00001000, ZIPNT_ZEROS(3), %00001000
.byt ZIPNT_ZEROS(2)
.byt %01010000, %00010001, ZIPNT_ZEROS(4), %01000100, %01010000
.byt %01010101, %00010001, ZIPNT_ZEROS(4), %01000100, %01010101
.byt %01010101, %00010001, ZIPNT_ZEROS(4), %01000100, %01010101
nametable_flatland_end:
.byt ZIPNT_END
#undef TFP
|
Numbers/Rationals/Definition.agda | Smaug123/agdaproofs | 4 | 14802 | {-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Naturals
open import Numbers.Integers.Integers
open import Groups.Groups
open import Groups.Definition
open import Groups.Lemmas
open import Rings.Definition
open import Rings.Orders.Total.Definition
open import Rings.Orders.Partial.Definition
open import Fields.Fields
open import Setoids.Setoids
open import Setoids.Orders.Partial.Definition
open import Setoids.Orders.Total.Definition
open import Functions.Definition
open import Sets.EquivalenceRelations
module Numbers.Rationals.Definition where
open import Fields.FieldOfFractions.Setoid ℤIntDom
open import Fields.FieldOfFractions.Addition ℤIntDom
open import Fields.FieldOfFractions.Multiplication ℤIntDom
open import Fields.FieldOfFractions.Ring ℤIntDom
open import Fields.FieldOfFractions.Field ℤIntDom
open import Fields.FieldOfFractions.Lemmas ℤIntDom
open import Fields.FieldOfFractions.Order ℤIntDom ℤOrderedRing
ℚ : Set
ℚ = fieldOfFractionsSet
ℚSetoid : Setoid ℚ
ℚSetoid = fieldOfFractionsSetoid
_+Q_ : ℚ → ℚ → ℚ
a +Q b = fieldOfFractionsPlus a b
_*Q_ : ℚ → ℚ → ℚ
a *Q b = fieldOfFractionsTimes a b
ℚRing : Ring fieldOfFractionsSetoid _+Q_ _*Q_
ℚRing = fieldOfFractionsRing
0Q : ℚ
0Q = Ring.0R ℚRing
injectionQ : ℤ → ℚ
injectionQ = embedIntoFieldOfFractions
injectionNQ : ℕ → ℚ
injectionNQ n = injectionQ (nonneg n)
injectionQInjective : Injection injectionQ
injectionQInjective {nonneg x} {nonneg .x} refl = refl
injectionQInjective {negSucc x} {negSucc .x} refl = refl
ℚField : Field ℚRing
ℚField = fieldOfFractions
_<Q_ : ℚ → ℚ → Set
_<Q_ = fieldOfFractionsComparison
_=Q_ : ℚ → ℚ → Set
a =Q b = Setoid._∼_ fieldOfFractionsSetoid a b
reflQ : {x : ℚ} → (x =Q x)
reflQ {x} = Equivalence.reflexive (Setoid.eq fieldOfFractionsSetoid) {x}
_≤Q_ : ℚ → ℚ → Set
a ≤Q b = (a <Q b) || (a =Q b)
negateQ : ℚ → ℚ
negateQ a = Group.inverse (Ring.additiveGroup ℚRing) a
_-Q_ : ℚ → ℚ → ℚ
a -Q b = a +Q negateQ b
a-A : (a : ℚ) → (a -Q a) =Q 0Q
a-A a = Group.invRight (Ring.additiveGroup ℚRing) {a}
ℚPartialOrder : SetoidPartialOrder fieldOfFractionsSetoid fieldOfFractionsComparison
ℚPartialOrder = fieldOfFractionsOrder
ℚTotalOrder : SetoidTotalOrder fieldOfFractionsOrder
ℚTotalOrder = fieldOfFractionsTotalOrder
ℚOrderInherited : (a b : ℤ) → a <Z b → injectionQ a <Q injectionQ b
ℚOrderInherited a b a<b = fieldOfFractionsOrderInherited a<b
open SetoidTotalOrder fieldOfFractionsTotalOrder
open SetoidPartialOrder partial
open Setoid fieldOfFractionsSetoid
negateQWellDefined : (a b : ℚ) → (a =Q b) → (negateQ a) =Q (negateQ b)
negateQWellDefined a b a=b = inverseWellDefined (Ring.additiveGroup ℚRing) {a} {b} a=b
ℚPOrdered : PartiallyOrderedRing ℚRing partial
ℚPOrdered = fieldOfFractionsPOrderedRing
ℚOrdered : TotallyOrderedRing ℚPOrdered
ℚOrdered = fieldOfFractionsOrderedRing
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/test_rational_arithmetic.adb | best08618/asylo | 7 | 12685 | -- { dg-do compile }
with Rational_Arithmetic;
use Rational_Arithmetic;
procedure Test_Rational_Arithmetic is
R: Rational := 10/2;
B: Boolean := R = 5/1; -- RHS cannot be a Whole
-- ("/" has been "undefined")
C: Boolean := R = Rational' (5/1);
D: Boolean := (6/3) = R;
E: Boolean := (2/1 = 4/2);
begin
R := 1+1/(4/8);
R := 2*(3/2)-(7/3)*3;
end Test_Rational_Arithmetic;
|
Lab4/code/kernel/syscall.asm | Software-Knowledge/2020-OS-Lab | 0 | 179999 |
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; syscall.asm
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; <NAME>, 2005
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%include "sconst.inc"
extern disp_str
extern do_sys_p
extern do_sys_v
extern sys_delay_c
_NR_get_ticks equ 0 ; 要跟 global.c 中 sys_call_table 的定义相对应!
_NR_disp_str_sys equ 1
_NR_p equ 2
_NR_v equ 3
_NR_sys_delay equ 4
INT_VECTOR_SYS_CALL equ 0x90
; 导出符号
global get_ticks
global disp_str_sys
global sys_disp_str
global p_sys
global v_sys
global sys_p
global sys_v
global delay_sys
global sys_delay
bits 32
[section .text]
; ====================================================================
; get_ticks
; ====================================================================
get_ticks:
mov eax, _NR_get_ticks
int INT_VECTOR_SYS_CALL
ret
disp_str_sys:
; 准备好现场,准备发起中断
mov eax, _NR_disp_str_sys
push ebx
mov ebx, [esp+8]
int INT_VECTOR_SYS_CALL
pop ebx
ret
sys_disp_str:
; 具体执行中断内容
pusha
push ebx
call disp_str
pop ebx
popa
ret
p_sys:
; 准备好现场,准备发起中断
mov eax, _NR_p
push ebx
mov ebx, [esp+8]
int INT_VECTOR_SYS_CALL
pop ebx
ret
sys_p:
; 信号量执行P操作
pusha
push ebx
call do_sys_p
pop ebx
popa
ret
v_sys:
; 准备好现场,准备发起中断
mov eax, _NR_v
push ebx
mov ebx, [esp+8]
int INT_VECTOR_SYS_CALL
pop ebx
ret
sys_v:
; 信号量执行V操作
pusha
push ebx
call do_sys_v
pop ebx
popa
ret
delay_sys:
; 准备好现场,准备发起中断
mov eax, _NR_sys_delay
push ebx
mov ebx, [esp+8]
int INT_VECTOR_SYS_CALL
pop ebx
ret
sys_delay:
push ebx
call sys_delay_c
pop ebx
ret
|
test/blink.asm | DJAndries/gpio2pic | 0 | 174268 | LIST p=16f876
INCLUDE "p16f876.inc"
CBLOCK 0x20
CNT1
CNT2
CNT3
ENDC
ORG 0x00
GOTO main
ORG 0x04
GOTO main
main BCF STATUS, RP0
BCF STATUS, RP1
CLRF PORTC
BSF STATUS, RP0
CLRF TRISC ; all pins are outputs
BCF STATUS, RP0
GOTO loop
setcnt MOVLW 0xFF
MOVWF CNT1
MOVLW 0xFF
MOVWF CNT2
MOVLW 0x01
MOVWF CNT3
RETURN
delay DECFSZ CNT1,1
GOTO delay
DECFSZ CNT2,1
GOTO delay
DECFSZ CNT3,1
GOTO delay
RETURN
loop MOVLW 0x04 ; set all pins high
MOVWF PORTC
CALL setcnt
CALL delay
MOVLW 0x00
MOVWF PORTC
CALL setcnt
CALL delay
GOTO loop
END
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/taft_type1_pkg1.adb | best08618/asylo | 7 | 24077 | with Taft_Type1_Pkg2;
package body Taft_Type1_Pkg1 is
type TAMT1 is new Taft_Type1_Pkg2.Priv (X => 1);
type TAMT2 is new Taft_Type1_Pkg2.Priv;
procedure Check is
Ptr1 : TAMT1_Access := new TAMT1;
Ptr2 : TAMT2_Access := new TAMT2 (X => 2);
begin
if Ptr1.all.X /= 1 then
raise Program_Error;
end if;
if Ptr2.all.X /= 2 then
raise Program_Error;
end if;
end;
end Taft_Type1_Pkg1;
|
OS Term Project/assemblyInput7.asm | bubblecounter/OS-Simulation | 0 | 247674 | <gh_stars>0
LUI S4 0000000000000001
ORI S4 S4 0000000000000001
SYSCALL
ADD S1 V $0
SUB S2 S4 S1
BEQ S2 $0 0000000000101000
ADDI V $0 0000000000000001
ADD S0 $0 V
SYSCALL
ADD S3 $0 $0 |
kernel.asm | ggml1/Bootloader | 0 | 9404 | <filename>kernel.asm
org 0x7e00
jmp 0x0000:START
%macro random 1
mov word [modulo], %1
call RAND
%endmacro
modulo dw 0
RAND:
mov ah, 00h ; interrupt to get system time
int 1ah ; CX:DX has number of clock ticks since midnight (00:00)
mov ax, dx
xor dx, dx
mov cx, word [modulo]
div cx
mov cx, 1
ret
START:
xor ax, ax
mov ds, ax
mov es, ax
mov bl, 15
mov al, 10h
int 10h
call RESET_CURSOR
call PRINT_LOGO
mov ah, 2
mov bh, 0
mov dh, 14
mov dl, 17
int 10h
mov si, login
call PRINT
mov di, username ; READ occurs in di
call READ
call CLEAR_SCREEN
startBegin:
mov si, startHeader1
call PRINT_COLOR
mov si, startHeader2
call PRINT_COLOR
mov si, startHeader3
call PRINT
mov si, startHeader4
call PRINT_COLOR
mov si, startHeader5
call PRINT_COLOR
.while:
mov si, username
call PRINT_COLOR
mov si, aux
call PRINT
mov di, command
call READ
call ANALYZE_COMMAND
jmp .while
jmp end
STRCMP:
lodsb ; getting current char pointed by SI and putting it on AL
;;;;;;
; mov ah, 0xe
; mov bh, 0
; int 10h ;;debug
cmp byte[di], al ;comparing loaded byte from [ES:SI] with [ES:DI]
jne .false ; if different, then strings aren't equal
cmp al, 0 ; string end? then analyze if it is also the end of the other one
je .si_end
cmp byte[di], 0 ; same as above
je .di_end
inc di
jmp STRCMP
.si_end:
cmp byte[di], 0
je .true
jmp .false
.di_end:
cmp al, 0
je .true
jmp .false
.true:
mov cx, 1
ret
.false:
mov cx, 0
ret
RESET_CURSOR:
mov ah, 2
mov bh, 0
mov dh, 0
mov dl, 0
int 10h
ret
GENERATE_RANDOM_NUMBER:
random 1000
mov dh, 0
mov ax, dx
ret
ANALYZE_COMMAND:
.help:
mov di, command
mov si, help
xor cx, cx
call STRCMP
cmp cl, 0
je .clear ; if its not help, try exit
mov si, menu1
call PRINT
mov si, menu2
call PRINT
mov si, getHelpChoice
call PRINT
mov di, temp
call READ
mov di, temp
mov si, choice1 ; comparing with '1'
call STRCMP
cmp cl, 1
je .help.choice1
mov di, temp
mov si, choice2 ; comparing with '2'
call STRCMP
cmp cl, 1
je .help.choice2
jmp .error
.help.choice1:
mov si, availableCommands1
call PRINT
mov si, availableCommands2
call PRINT
mov si, availableCommands3
call PRINT
mov si, availableCommands4
call PRINT
mov si, availableCommands5
call PRINT
mov si, availableCommands6
call PRINT
mov si, availableCommands7
call PRINT
mov si, availableCommands8
call PRINT
jmp .done
.help.choice2:
mov si, creditsHelp
call PRINT
jmp .done
.clear:
mov di, command
mov si, clearCommand
call STRCMP
cmp cl, 0
je .game ; if command is not clear, try game
call CLEAR_SCREEN
jmp .done
.game:
mov di, command
mov si, gameCommand
call STRCMP
cmp cl, 0
je .exit ; if command is not game, try exit
mov si, gamePresentation1
call PRINT
mov si, gamePresentation2
call PRINT
mov si, gamePresentation3
call PRINT
mov si, gamePresentation4
call PRINT
mov si, gamePresentation5
call PRINT
mov si, gamePresentation6
call PRINT
mov si, gamePresentation7
call PRINT
mov si, gamePresentation8
call PRINT
mov si, gamePresentation9
call PRINT
mov si, gamePresentation10
call PRINT
mov si, gamePresentation11
call PRINT
mov si, gamePresentation12
call PRINT
mov si, gamePresentation13
call PRINT
mov di, temp
call READ
mov di, temp
mov si, y
call STRCMP
cmp cl, 0
je .done
call GENERATE_RANDOM_NUMBER
push ax
xor dx, dx
.game.while:
cmp dl, 10
je .game.tooManyTries
inc dl
mov si, askInput
call PRINT
mov di, guess
call READ
mov di, guessNumber
mov si, guess
call transform
mov di, guessNumber
mov ah, byte[di]
inc di
mov al, byte[di]
dec di
mov bx, ax
pop ax
cmp ax, bx
jg .game.high
cmp ax, bx
jl .game.low
mov si, correctAnswer1
call PRINT_COLOR
mov si, correctAnswer2
call PRINT
mov si, correctAnswer3
call PRINT_COLOR
jmp .game.done
.game.high:
push ax
mov si, numberIsHigher
call PRINT_COLOR
jmp .game.while
.game.low:
push ax
mov si, numberIsLower
call PRINT_COLOR
jmp .game.while
.game.tooManyTries:
mov si, wrongAnswer1
call PRINT_COLOR
mov si, wrongAnswer2
call PRINT
mov si, wrongAnswer3
call PRINT_COLOR
pop ax
jmp .game.done
.game.done:
jmp .done
.exit:
mov di, command
mov si, exit
xor cx, cx
call STRCMP
cmp cl, 0
je .credits ; if its not exit, try credits
mov si, ctz
call PRINT
mov di, temp
call READ
mov di, temp
mov si, y
call STRCMP
cmp cl, 1
je end
jmp .done
.credits:
mov di, command
mov si, creditsCommand
xor cx, cx
call STRCMP
cmp cl, 0
je .add ; if not credits, try add
mov si, credits0
call PRINT
mov si, credits1
call PRINT
mov si, credits2
call PRINT
mov si, credits3
call PRINT
mov si, credits4
call PRINT
mov si, credits5
call PRINT
jmp .done
.add:
mov di, command
mov si, addCommand
xor cx, cx
call STRCMP
cmp cl, 0
je .sub ; if its not add, try sub
mov si, escolha
call PRINT
call READ_NUMBER
add ax, bx
mov di, valuef
mov byte[di], ah
inc di
mov byte[di], al
dec di
mov si, valuef
mov di, numf
call transform2
mov si, numf
call inverte_str
mov si, numf
call PRINT
; continue addition
jmp .done
.sub:
mov di, command
mov si, subCommand
xor cx, cx
call STRCMP
cmp cl, 0
je .mult ; if its not sub, try mult
mov si, escolhaSub
call PRINT
call READ_NUMBER
mov cx, 0
cmp ax, bx
jge .positivo
mov cx, 1
xor ax, bx
xor bx, ax ; swap
xor ax, bx
.positivo:
sub ax, bx
cmp cx, 0
je .certo
mov si, menos
push ax
call PRINT
pop ax
.certo:
mov di, valuef
mov byte[di], ah
inc di
mov byte[di], al
dec di
mov si, valuef
mov di, numf
call transform2
mov si, numf
call inverte_str
mov si, numf
call PRINT
; work sub
jmp .done
.mult:
mov di, command
mov si, multCommand
xor cx, cx
call STRCMP
cmp cl, 0
je .div ; if its not mult, try div
mov si, escolhaMult
call PRINT
call READ_NUMBER
mul bx
mov di, valuef
mov byte[di], ah
inc di
mov byte[di], al
dec di
mov si, valuef
mov di, numf
call transform2
mov si, numf
call inverte_str
mov si, numf
call PRINT
; work mult
jmp .done
.div:
mov di, command
mov si, divCommand
xor cx, cx
call STRCMP
cmp cl, 0
je .error ; if its not sub, then its error
mov si, escolhaDiv
call PRINT
call READ_NUMBER
mov si, value2
mov di, zeroString
call STRCMP
cmp cl, 0
je .div.byZero
mov si, quotientResult
call PRINT
mov si, value1
mov ah, byte[si]
inc si
mov al, byte[si]
mov si, value2
mov bh, byte[si]
inc si
mov bl, byte[si]
dec si
xor dx, dx
cmp bx, 0
je .div.byZero
div bx
mov di, valuef
mov byte[di], ah
inc di
mov byte[di], al
dec di
mov si, valuef
mov di, numf
call transform2
mov si, numf
call inverte_str
mov si, numf
call PRINT
mov si, remainderResult
call PRINT
mov si, value1
mov ah, byte[si]
inc si
mov al, byte[si]
mov si, value2
mov bh, byte[si]
inc si
mov bl, byte[si]
dec si
xor dx, dx
div bx
mov ax, dx
mov di, valuef
mov byte[di], ah
inc di
mov byte[di], al
dec di
mov si, valuef
mov di, numf
call transform2
mov si, numf
call inverte_str
mov si, numf
call PRINT
; work div
jmp .done
.div.byZero:
mov si, divByZero
call PRINT
jmp .done
.error:
mov di, command
mov si, unknownCommand
call PRINT
jmp .done
.done:
ret
READ_NUMBER:
mov di, num1
call READ
mov di, value1
mov si, num1
call transform
mov di, num2
call READ
mov di, value2
mov si, num2
call transform
mov di, value1
mov ah, byte[di]
inc di
mov al, byte[di]
dec di
mov di, value2
mov bh, byte[di]
inc di
mov bl, byte[di]
dec di
ret
transform2:
mov bh, byte[si]
inc si
mov bl, byte[si]
dec si
cmp bx, 0
je .end2
mov ch, 0
mov cl, 10
.for1:
cmp bx, 0
je .end
mov ax, bx
mov dx, 0
div cx
mov bx, ax
mov ax, dx
add al, '0'
stosb
jmp .for1
.end:
mov al, 0
stosb
ret
.end2:
mov al, '0'
stosb
mov al, 0
stosb
ret
transform:
xor ax, ax
xor bx, bx
xor cl, cl
.for1:
push si
mov ch, 0
add si, cx
mov ch, byte[si]
cmp ch, 0
je .end
sub ch, '0'
mov ax, 0
mov al, 10
mul bl
mov bx, ax
add bl, ch
inc cl
pop si
jmp .for1
.end:
mov byte[di], bh
inc di
mov byte[di], bl
dec di
pop si
ret
inverte_str:
xor cx, cx
.for1:
mov dx, si
add si, cx
cmp byte[si], 0
je .endfor1
movzx bx, byte[si]
push bx
mov si, dx
inc cx
jmp .for1
.endfor1:
mov si, dx
xor ax, ax
.for2:
cmp ax, cx
je .end
mov dx, si
add si, ax
pop bx
mov byte[si], bl
inc ax
mov si, dx
jmp .for2
.end:
mov si, dx
add si, cx
mov byte[si], 10
mov si, dx
add si, cx
add si, 1
mov byte[si], 13
add si, 1
mov byte[si], 0
ret
READ:
xor cx, cx
mov bl, 15
.for1:
mov ah, 0
int 16h
cmp al, 0x0d ;string end
je .end
cmp al, 0x08
je .backspace
mov ah, 0x0e
int 10h
inc cx
stosb
jmp .for1
.backspace:
cmp cl, 0 ; goes back if theres nothing to erase
je .for1
; removing last character
dec cx
dec di
mov ah, 0x0e
mov al, 0x08 ;;printing backspace
int 10h
mov al, 0x20 ;;printing space
int 10h
mov al, 0x08 ;printing backspace again
int 10h
jmp .for1
.end:
mov al, 0
stosb
mov ah, 0x0e
mov al, 10
int 10h
mov al, 13
int 10h
ret
PRINT_COLOR:
lodsb
cmp al, 0
je .done
mov ah, 0xe
mov bl, 2
int 10h
jmp PRINT_COLOR
.done:
ret
PRINT:
lodsb
cmp al, 0
je .done
mov ah, 0xe
mov bl, 15
int 10h
jmp PRINT
.done:
ret
CLEAR_SCREEN:
mov dx, 4500
xor cx, cx
.while:
mov ah, 0x0e
mov al, 0x20 ;print space
int 10h
dec dx
cmp dx, 0
je .end
jmp .while
.end:
mov ah, 2
mov bh, 0
mov dh, 0
mov dl, 0
int 10h
jmp startBegin
PRINT_LOGO:
mov ah, 2
mov bh, 0
mov dh, 2
mov dl, 7
int 10h
mov si, line1
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 3
mov dl, 7
int 10h
mov si, line2
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 4
mov dl, 7
int 10h
mov si, line3
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 5
mov dl, 7
int 10h
mov si, line4
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 6
mov dl, 7
int 10h
mov si, line5
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 7
mov dl, 7
int 10h
mov si, line6
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 8
mov dl, 7
int 10h
mov si, line7
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 9
mov dl, 7
int 10h
mov si, line8
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 10
mov dl, 7
int 10h
mov si, line9
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 11
mov dl, 7
int 10h
mov si, line10
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 12
mov dl, 7
int 10h
mov si, line11
call PRINT_COLOR
mov ah, 2
mov bh, 0
mov dh, 13
mov dl, 7
int 10h
ret
end:
jmp $
var:
menos db '-', 0
login db 'Type your login: ', 0
aux db '@cin:~$ ', 0
line1 db ' .----------------. .----------------. .----------------. ', 10, 13, 0
line2 db '| .--------------. | | .--------------. | | .--------------. |', 10, 13, 0
line3 db '| | _____ | | | | _______ | | | | ____ ____ | |', 10, 13, 0
line4 db '| | |_ _| | | | | / ____ | | | | ||_ \ / _|| |', 10, 13, 0
line5 db '| | | | | | | | / / \_| | | | | | \/ | | |', 10, 13, 0
line6 db '| | | | _ | | | | | | | | | | | |\ /| | | |', 10, 13, 0
line7 db '| | _| |__/ | | | | | \ \_____/\ | | | | _| |_\/_| |_ | |', 10, 13, 0
line8 db '| | |________| | | | | \_______/ | | | ||_____||_____|| |', 10, 13, 0
line9 db '| | | | | | | | | | | |', 10, 13, 0
line10 db '| |--------------| | | |--------------| | | |--------------| |', 10, 13, 0
line11 db ' ------------------ ------------------ ------------------ ', 10, 13, 0
username: times 20 db 0
command: times 20 db 0
num1: times 10 db 0
num2: times 10 db 0
numf: times 10 db 0
value1: times 4 db 0
value2: times 4 db 0
valuef: times 4 db 0
temp: times 10 db 0
guess: times 10 db 0
generated: times 6 db 0
answer: times 6 db 0
guessNumber: times 20 db 0
startHeader1 db 'LCM Terminal - Version 172.16.31.10', 10, 13, 0
startHeader2 db 'Type ', 0
startHeader3 db '"help" ', 0
startHeader4 db 'for more information.', 10, 13, 0
startHeader5 db '---------------------------------', 10, 13, 0
askInput db 'Enter your guess: (positive integer): ', 0
numberIsLower db '---- The answer is lower than your input ----', 10, 13, 0
numberIsHigher db '---- The answer is higher than your input ----', 10, 13, 0
correctAnswer1 db 10, '******************************************************', 10, 13, 0
correctAnswer2 db '****** You guessed the number! Congratulations! ******', 10, 13, 0
correctAnswer3 db '******************************************************', 10, 10, 13, 0
wrongAnswer1 db 10, '**************************************************************', 10, 13, 0
wrongAnswer2 db '****** You took too long to find the number. Try again! ******', 10, 13, 0
wrongAnswer3 db '**************************************************************', 10, 10, 13, 0
gamePresentation1 db 10, '********************* SMART GUESSING *********************', 10, 13, 0
gamePresentation2 db '** This games objective is to correctly guess which **', 10, 13, 0
gamePresentation3 db '** number the computer has randomly generated, ranging **', 10, 13, 0
gamePresentation4 db '** from 0 to 999 (inclusive). On each round, you will **', 10, 13, 0
gamePresentation5 db '** enter a number you think is the right one. If your **', 10, 13, 0
gamePresentation6 db '** number is higher than the answer, the computer will **', 10, 13, 0
gamePresentation7 db '** output LOWER, and HIGHER if it is lower. If you get **', 10, 13, 0
gamePresentation8 db '** a congratulation message, it means you chose the **', 10, 13, 0
gamePresentation9 db '** correct number and the game is terminated. **', 10, 13, 0
gamePresentation10 db '** **', 10, 13, 0
gamePresentation11 db '** BE CAREFUL: YOU ONLY HAVE 10 TRIES. If you do not **', 10, 13, 0
gamePresentation12 db '** answer correctly in 10 tries, you will lose the game **', 10, 13, 0
gamePresentation13 db '******************* INPUT "Y" TO BEGIN ******************', 10, 13, 0
debug db 'debug', 10, 13, 0
help db 'help', 0
exit db 'exit', 0
menu1 db '(op) Operations', 10, 13, 0
menu2 db '(cr) Credits', 10, 13, 0
getHelpChoice db 10, 'Your choice: ', 0
choice1 db 'op', 0
choice2 db 'cr', 0
creditsHelp db 10, 13, 'Type credits on the terminal to see that section.', 10, 13, 0
creditsCommand db 'credits', 0
addCommand db 'add', 0
subCommand db 'sub', 0
multCommand db 'mult', 0
divCommand db 'div', 0
gameCommand db 'play game', 0
quotientResult db 'Quotient: ', 0
remainderResult db 'Remainder: ', 0
clearCommand db 'clear', 0
availableCommands1 db 10, 13, 'There are 7 commands you can use: ', 10, 13, 0
availableCommands2 db 'Addition: type "add" for more info.', 10, 13, 0
availableCommands3 db 'Subtraction: type "sub" for more info.', 10, 13, 0
availableCommands4 db 'Multiplication: type "mult" for more info.', 10, 13, 0
availableCommands5 db 'Division: type "div" for more info.', 10, 13, 0
availableCommands6 db 'Clear screen: type "clear".', 10, 13, 0
availableCommands7 db 'Guessing game: type "play game".', 10, 13, 0
availableCommands8 db 'Exit terminal: type "exit".', 10, 13, 0
unknownCommand db 'Unknown command. Type help for more information.', 10, 13, 0
ctz db 'Are you sure you want to exit the program?', 10, 13, '[Y/N]', 10, 13, 0
escolha db 'Input two numbers to be added, one on each line: ', 10, 13, 0
escolhaMult db 'Input two numbers to be multiplied, one on each line: ', 10, 13, 0
escolhaDiv db 'Input two numbers to be divided, one on each line: ', 10, 13, 0
escolhaSub db 'Input two numbers to be subtracted, one on each line: ', 10, 13, 0
divByZero db 'You cant divide by zero. Choose another number and try again.', 10, 13, 0
y db 'Y', 0
zeroString db '0', 0
credits0 db 10, '-----------------------------------------', 10, 13, 0
credits1 db '------- Bootloader created by: --------', 10, 13, 0
credits2 db '------- <NAME> - @ggml --------', 10, 13, 0
credits3 db '------- <NAME> - @mlan --------', 10, 13, 0
credits4 db '------- <NAME> - @cfms3 --------', 10, 13, 0
credits5 db '-----------------------------------------', 10, 10, 13, 0
; 10 is \n
; 13 is tab to go back to line begin
|
Classes.agda | esoeylemez/agda-simple | 1 | 7132 | <reponame>esoeylemez/agda-simple
-- Copyright: (c) 2016 <NAME>
-- License: BSD3
-- Maintainer: <NAME> <<EMAIL>>
module Classes where
record Plus {a} (A : Set a) : Set a where
field
_+_ : A → A → A
infixl 6 _+_
open Plus {{...}} public
record Times {a} (A : Set a) : Set a where
field
{{plus}} : Plus A
_*_ : A → A → A
infixl 7 _*_
open Times {{...}} public
|
oeis/074/A074877.asm | neoneye/loda-programs | 11 | 27093 | <filename>oeis/074/A074877.asm
; A074877: Number of function calls required to compute ack(3,n), where ack denotes the Ackermann function.
; Submitted by <NAME>
; 15,106,541,2432,10307,42438,172233,693964,2785999,11164370,44698325,178875096,715664091,2862983902,11452590817,45811673828,183249316583,733002509034,2932020521709,11728103058160,46912454175475,187649900587766,750599770123001,3002399416036092
add $0,1
mov $2,2
mov $3,$0
lpb $0
sub $0,1
add $2,1
mul $2,2
lpe
sub $3,$2
mul $3,3
mov $4,$2
pow $2,2
add $4,$2
div $4,3
add $3,$4
add $4,$3
mov $0,$4
add $0,2
|
Cubical/Data/Sum/Base.agda | limemloh/cubical | 0 | 1761 | {-# OPTIONS --cubical --safe #-}
module Cubical.Data.Sum.Base where
open import Cubical.Core.Everything
private
variable
ℓ ℓ' : Level
A B C D : Type ℓ
data _⊎_ (A : Type ℓ)(B : Type ℓ') : Type (ℓ-max ℓ ℓ') where
inl : A → A ⊎ B
inr : B → A ⊎ B
elim-⊎ : {C : A ⊎ B → Type ℓ} → ((a : A) → C (inl a)) → ((b : B) → C (inr b))
→ (x : A ⊎ B) → C x
elim-⊎ f _ (inl x) = f x
elim-⊎ _ g (inr y) = g y
map-⊎ : (A → C) → (B → D) → A ⊎ B → C ⊎ D
map-⊎ f _ (inl x) = inl (f x)
map-⊎ _ g (inr y) = inr (g y)
|
examples/nonce/demo_ada.adb | jrmarino/libsodium-ada | 10 | 448 | with Sodium.Functions; use Sodium.Functions;
with Ada.Text_IO; use Ada.Text_IO;
procedure Demo_Ada
is
FF : constant Character := Character'Val (255);
n1 : String (1 .. 3) := (others => ASCII.NUL);
n2 : String (1 .. 3) := (others => FF);
n3 : String (1 .. 3) := (3 => Character'Val (254), others => ASCII.NUL);
n4 : String (1 .. 3) := (3 => FF, others => ASCII.NUL);
n5 : String (1 .. 3) := (1 => Character'Val (5), 2 => FF, 3 => FF);
n6 : Box_Nonce;
n7 : Symmetric_Nonce;
begin
if not initialize_sodium_library then
Put_Line ("Initialization failed");
return;
end if;
n6 := Random_Nonce;
n7 := Random_Symmetric_Nonce;
Put_Line ("N1: " & As_Hexidecimal (n1));
increment_nonce (n1);
Put_Line ("+1: " & As_Hexidecimal (n1));
Put_Line ("");
Put_Line ("N2: " & As_Hexidecimal (n2));
increment_nonce (n2);
Put_Line ("+1: " & As_Hexidecimal (n2));
Put_Line ("");
Put_Line ("N3: " & As_Hexidecimal (n3));
increment_nonce (n3);
Put_Line ("+1: " & As_Hexidecimal (n3));
Put_Line ("");
Put_Line ("N4: " & As_Hexidecimal (n4));
increment_nonce (n4);
Put_Line ("+1: " & As_Hexidecimal (n4));
Put_Line ("");
Put_Line ("N5: " & As_Hexidecimal (n5));
increment_nonce (n5);
Put_Line ("+1: " & As_Hexidecimal (n5));
Put_Line ("");
Put_Line ("N6: " & As_Hexidecimal (n6));
increment_nonce (n6);
Put_Line ("+1: " & As_Hexidecimal (n6));
Put_Line ("");
Put_Line ("N7: " & As_Hexidecimal (n7));
increment_nonce (n7);
Put_Line ("+1: " & As_Hexidecimal (n7));
end Demo_Ada;
|
oeis/099/A099273.asm | neoneye/loda-programs | 11 | 87907 | ; A099273: Unsigned member r=-15 of the family of Chebyshev sequences S_r(n) defined in A092184.
; Submitted by <NAME>
; 0,1,15,256,4335,73441,1244160,21077281,357069615,6049106176,102477735375,1736072395201,29410752983040,498246728316481,8440783628397135,142995074954434816,2422475490596994735
mov $2,1
lpb $0
sub $0,1
mov $1,$2
mul $2,16
add $3,$4
add $4,$2
sub $4,$1
mov $2,$4
add $2,$3
mov $3,$1
lpe
mov $0,$3
|
oeis/250/A250754.asm | neoneye/loda-programs | 11 | 102330 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A250754: Number of (n+1) X (7+1) 0..2 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing x(i,j)+x(i-1,j) in the j direction.
; Submitted by <NAME>(s3)
; 527,1707,5471,17211,53327,163467,497471,1506651,4548527,13702827,41223071,123898491,372154127,1117379787,3353974271,10065592731,30204118127,90627034347,271910463071,815790109371,2447487768527,7342698186507,22028564321471,66086632488411,198261776513327,594789087636267,1784374779101471,5353139369689851,16059448173840527,48178404651063627,144535334212275071,433606243154993691,1300819210501318127,3902458593576628587,11707377704875234271,35122136962916399931,105366418585330594127
add $0,3
mov $2,4
lpb $0
sub $0,1
add $3,$2
mul $2,2
add $2,3
sub $3,1
mul $3,3
add $3,9
lpe
mov $0,$3
mul $0,4
div $0,3
add $0,47
|
Mockingbird/Problems/Chapter12.agda | splintah/combinatory-logic | 1 | 2090 | <filename>Mockingbird/Problems/Chapter12.agda
open import Mockingbird.Forest using (Forest)
-- Mockingbirds, Warblers, and Starlings
module Mockingbird.Problems.Chapter12 {b ℓ} (forest : Forest {b} {ℓ}) where
open import Data.Product using (_×_; _,_; proj₁; ∃-syntax)
open import Function using (_$_)
open import Mockingbird.Forest.Birds forest
import Mockingbird.Problems.Chapter11 forest as Chapter₁₁
open Forest forest
problem₁ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasMockingbird ⦄ → HasDoubleMockingbird
problem₁ = record
{ M₂ = B ∙ M
; isDoubleMockingbird = λ x y → begin
B ∙ M ∙ x ∙ y ≈⟨ isBluebird M x y ⟩
M ∙ (x ∙ y) ≈⟨ isMockingbird (x ∙ y) ⟩
x ∙ y ∙ (x ∙ y) ∎
}
problem₂-BCM : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasLark
problem₂-BCM = record
{ L = C ∙ B ∙ M
; isLark = λ x y → begin
C ∙ B ∙ M ∙ x ∙ y ≈⟨ congʳ $ isCardinal B M x ⟩
B ∙ x ∙ M ∙ y ≈⟨ isBluebird x M y ⟩
x ∙ (M ∙ y) ≈⟨ congˡ $ isMockingbird y ⟩
x ∙ (y ∙ y) ∎
} where instance hasCardinal = Chapter₁₁.problem₂₁′
problem₂-BRM : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasLark
problem₂-BRM = record
{ L = R ∙ M ∙ B
; isLark = λ x y → begin
R ∙ M ∙ B ∙ x ∙ y ≈⟨ congʳ $ isRobin M B x ⟩
B ∙ x ∙ M ∙ y ≈⟨ isBluebird x M y ⟩
x ∙ (M ∙ y) ≈⟨ congˡ $ isMockingbird y ⟩
x ∙ (y ∙ y) ∎
} where instance hasRobin = Chapter₁₁.problem₂₀
problem₃ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasWarbler ⦄ → HasLark
problem₃ = record
{ L = B ∙ W ∙ B
; isLark = λ x y → begin
B ∙ W ∙ B ∙ x ∙ y ≈⟨ congʳ $ isBluebird W B x ⟩
W ∙ (B ∙ x) ∙ y ≈⟨ isWarbler (B ∙ x) y ⟩
B ∙ x ∙ y ∙ y ≈⟨ isBluebird x y y ⟩
x ∙ (y ∙ y) ∎
}
problem₄ : ⦃ _ : HasMockingbird ⦄ ⦃ _ : HasQueerBird ⦄ → HasLark
problem₄ = record
{ L = Q ∙ M
; isLark = λ x y → begin
Q ∙ M ∙ x ∙ y ≈⟨ isQueerBird M x y ⟩
x ∙ (M ∙ y) ≈⟨ congˡ $ isMockingbird y ⟩
x ∙ (y ∙ y) ∎
}
problem₅ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasRobin ⦄ ⦃ _ : HasMockingbird ⦄ → HasConverseWarbler
problem₅ = record
{ W′ = M₂ ∙ R
; isConverseWarbler = λ x y → begin
M₂ ∙ R ∙ x ∙ y ≈⟨ congʳ $ isDoubleMockingbird R x ⟩
R ∙ x ∙ (R ∙ x) ∙ y ≈⟨ isRobin x (R ∙ x) y ⟩
R ∙ x ∙ y ∙ x ≈⟨ isRobin x y x ⟩
y ∙ x ∙ x ∎
} where instance hasDoubleMockingbird = problem₁
problem₆′ : ⦃ _ : HasCardinal ⦄ ⦃ _ : HasConverseWarbler ⦄ → HasWarbler
problem₆′ = record
{ W = C ∙ W′
; isWarbler = λ x y → begin
C ∙ W′ ∙ x ∙ y ≈⟨ isCardinal W′ x y ⟩
W′ ∙ y ∙ x ≈⟨ isConverseWarbler y x ⟩
x ∙ y ∙ y ∎
}
problem₆ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasRobin ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasMockingbird ⦄ → HasWarbler
problem₆ = record
{ W = C ∙ (B ∙ M ∙ R)
; isWarbler = λ x y → begin
C ∙ (B ∙ M ∙ R) ∙ x ∙ y ≈⟨⟩
C ∙ (M₂ ∙ R) ∙ x ∙ y ≈⟨⟩
C ∙ W′ ∙ x ∙ y ≈⟨⟩
W ∙ x ∙ y ≈⟨ isWarbler x y ⟩
x ∙ y ∙ y ∎
} where
instance
hasDoubleMockingbird = problem₁
hasConverseWarbler = problem₅
hasWarbler = problem₆′
problem₇ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasWarbler
problem₇ = record
{ W = B ∙ (T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ∙ (B ∙ B ∙ T)
; isWarbler = λ x y → begin
B ∙ (T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ∙ (B ∙ B ∙ T) ∙ x ∙ y ≈˘⟨ congʳ $ congʳ $ isWarbler′ ⟩
W ∙ x ∙ y ≈⟨ isWarbler x y ⟩
x ∙ y ∙ y ∎
} where
instance
hasRobin = Chapter₁₁.problem₂₀
hasCardinal = Chapter₁₁.problem₂₁-bonus
hasWarbler = problem₆
isWarbler′ : W ≈ B ∙ (T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ∙ (B ∙ B ∙ T)
isWarbler′ = begin
W ≈⟨⟩
C ∙ (B ∙ M ∙ R) ≈⟨⟩
C ∙ (B ∙ M ∙ (B ∙ B ∙ T)) ≈⟨⟩
B ∙ (T ∙ (B ∙ B ∙ T)) ∙ (B ∙ B ∙ T) ∙ (B ∙ M ∙ (B ∙ B ∙ T)) ≈⟨ isBluebird (T ∙ (B ∙ B ∙ T)) (B ∙ B ∙ T) (B ∙ M ∙ (B ∙ B ∙ T)) ⟩
T ∙ (B ∙ B ∙ T) ∙ (B ∙ B ∙ T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ≈⟨ isThrush (B ∙ B ∙ T) (B ∙ B ∙ T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ⟩
B ∙ B ∙ T ∙ (B ∙ M ∙ (B ∙ B ∙ T)) ∙ (B ∙ B ∙ T) ≈⟨ congʳ $ isBluebird B T (B ∙ M ∙ (B ∙ B ∙ T)) ⟩
B ∙ (T ∙ (B ∙ M ∙ (B ∙ B ∙ T))) ∙ (B ∙ B ∙ T) ∎
-- TODO: other expression in problem 7.
-- NOTE: the bluebird B is not necessary.
problem₈ : ⦃ _ : HasThrush ⦄ ⦃ _ : HasWarbler ⦄ → HasMockingbird
problem₈ = record
{ M = W ∙ T
; isMockingbird = λ x → begin
W ∙ T ∙ x ≈⟨ isWarbler T x ⟩
T ∙ x ∙ x ≈⟨ isThrush x x ⟩
x ∙ x ∎
}
problem₉-W* : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasWarblerOnceRemoved
problem₉-W* = record
{ W* = B ∙ W
; isWarblerOnceRemoved = λ x y z → begin
B ∙ W ∙ x ∙ y ∙ z ≈⟨ congʳ $ isBluebird W x y ⟩
W ∙ (x ∙ y) ∙ z ≈⟨ isWarbler (x ∙ y) z ⟩
x ∙ y ∙ z ∙ z ∎
} where instance hasWarbler = problem₇
problem₉-W** : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasWarblerTwiceRemoved
problem₉-W** = record
{ W** = B ∙ W*
; isWarblerTwiceRemoved = λ x y z w → begin
B ∙ W* ∙ x ∙ y ∙ z ∙ w ≈⟨ congʳ $ congʳ $ isBluebird W* x y ⟩
W* ∙ (x ∙ y) ∙ z ∙ w ≈⟨ isWarblerOnceRemoved (x ∙ y) z w ⟩
x ∙ y ∙ z ∙ w ∙ w ∎
} where
instance
hasWarbler = problem₇
hasWarblerOnceRemoved = problem₉-W*
problem₁₀ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasWarbler ⦄ → HasHummingbird
problem₁₀ = record
{ H = B ∙ W ∙ (B ∙ C)
; isHummingbird = λ x y z → begin
B ∙ W ∙ (B ∙ C) ∙ x ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isBluebird W (B ∙ C) x ⟩
W ∙ (B ∙ C ∙ x) ∙ y ∙ z ≈⟨ congʳ $ isWarbler (B ∙ C ∙ x) y ⟩
B ∙ C ∙ x ∙ y ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isBluebird C x y ⟩
C ∙ (x ∙ y) ∙ y ∙ z ≈⟨ isCardinal (x ∙ y) y z ⟩
x ∙ y ∙ z ∙ y ∎
}
problem₁₁ : ⦃ _ : HasRobin ⦄ ⦃ _ : HasHummingbird ⦄ → HasWarbler
problem₁₁ = problem₆′
where
instance
hasCardinal = Chapter₁₁.problem₂₁
hasConverseWarbler : HasConverseWarbler
hasConverseWarbler = record
{ W′ = H ∙ R
; isConverseWarbler = λ x y → begin
H ∙ R ∙ x ∙ y ≈⟨ isHummingbird R x y ⟩
R ∙ x ∙ y ∙ x ≈⟨ isRobin x y x ⟩
y ∙ x ∙ x ∎
}
problem₁₂ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasMockingbird ⦄ → HasStarling
problem₁₂ = record
{ S = W** ∙ G
; isStarling = λ x y z → begin
W** ∙ G ∙ x ∙ y ∙ z ≈⟨ isWarblerTwiceRemoved G x y z ⟩
G ∙ x ∙ y ∙ z ∙ z ≈⟨ isGoldfinch x y z z ⟩
x ∙ z ∙ (y ∙ z) ∎
} where
instance
hasWarblerTwiceRemoved = problem₉-W**
hasGoldfinch = Chapter₁₁.problem₄₇
problem₁₃ : ⦃ _ : HasStarling ⦄ ⦃ _ : HasRobin ⦄ → HasHummingbird
problem₁₃ = record
{ H = S ∙ R
; isHummingbird = λ x y z → begin
S ∙ R ∙ x ∙ y ∙ z ≈⟨ congʳ $ isStarling R x y ⟩
R ∙ y ∙ (x ∙ y) ∙ z ≈⟨ isRobin y (x ∙ y) z ⟩
x ∙ y ∙ z ∙ y ∎
}
problem₁₄-SR : ⦃ _ : HasStarling ⦄ ⦃ _ : HasRobin ⦄ → HasWarbler
problem₁₄-SR = record
{ W = R ∙ (S ∙ R ∙ R) ∙ R
; isWarbler = λ x y → begin
R ∙ (S ∙ R ∙ R) ∙ R ∙ x ∙ y ≈˘⟨ congʳ $ congʳ $ isRobin R R (S ∙ R ∙ R) ⟩
R ∙ R ∙ R ∙ (S ∙ R ∙ R) ∙ x ∙ y ≈⟨⟩
C ∙ (S ∙ R ∙ R) ∙ x ∙ y ≈⟨⟩
C ∙ (H ∙ R) ∙ x ∙ y ≈⟨⟩
W ∙ x ∙ y ≈⟨ isWarbler x y ⟩
x ∙ y ∙ y ∎
} where
instance
hasCardinal = Chapter₁₁.problem₂₁
hasHummingbird = problem₁₃
hasWarbler = problem₁₁
problem₁₄-SC : ⦃ _ : HasStarling ⦄ ⦃ _ : HasCardinal ⦄ → HasWarbler
problem₁₄-SC = record
{ W = C ∙ (S ∙ (C ∙ C) ∙ (C ∙ C))
; isWarbler = λ x y → begin
C ∙ (S ∙ (C ∙ C) ∙ (C ∙ C)) ∙ x ∙ y ≈⟨⟩
C ∙ (S ∙ R ∙ R) ∙ x ∙ y ≈⟨ isCardinal (S ∙ R ∙ R) x y ⟩
S ∙ R ∙ R ∙ y ∙ x ≈⟨ congʳ $ isStarling R R y ⟩
R ∙ y ∙ (R ∙ y) ∙ x ≈⟨ isRobin y (R ∙ y) x ⟩
R ∙ y ∙ x ∙ y ≈⟨ isRobin y x y ⟩
x ∙ y ∙ y ∎
} where instance hasRobin = Chapter₁₁.problem₂₃
problem₁₅ : ⦃ _ : HasThrush ⦄ ⦃ _ : HasStarling ⦄ → HasWarbler
problem₁₅ = record
{ W = S ∙ T
; isWarbler = λ x y → begin
S ∙ T ∙ x ∙ y ≈⟨ isStarling T x y ⟩
T ∙ y ∙ (x ∙ y) ≈⟨ isThrush y (x ∙ y) ⟩
x ∙ y ∙ y ∎
}
problem₁₆ : ⦃ _ : HasThrush ⦄ ⦃ _ : HasStarling ⦄ → HasMockingbird
problem₁₆ = record
{ M = S ∙ T ∙ T
; isMockingbird = λ x → begin
S ∙ T ∙ T ∙ x ≈⟨ isStarling T T x ⟩
T ∙ x ∙ (T ∙ x) ≈⟨ isThrush x (T ∙ x) ⟩
T ∙ x ∙ x ≈⟨ isThrush x x ⟩
x ∙ x ∎
}
module Exercises where
exercise₁-a : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄
→ ∃[ G₁ ] (∀ x y z w v → G₁ ∙ x ∙ y ∙ z ∙ w ∙ v ≈ x ∙ y ∙ v ∙ (z ∙ w))
exercise₁-a =
( D₁ ∙ C*
, λ x y z w v → begin
D₁ ∙ C* ∙ x ∙ y ∙ z ∙ w ∙ v ≈⟨ congʳ $ isDickcissel C* x y z w ⟩
C* ∙ x ∙ y ∙ (z ∙ w) ∙ v ≈⟨ isCardinalOnceRemoved x y (z ∙ w) v ⟩
x ∙ y ∙ v ∙ (z ∙ w) ∎
)
where
instance
hasCardinal = Chapter₁₁.problem₂₁′
hasCardinalOnceRemoved = Chapter₁₁.problem₃₁
hasDickcissel = Chapter₁₁.problem₉
-- Note: in the solutions, the bluebird is used, but the exercise does not
-- state that the bluebird may be used.
exercise₁-b : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasMockingbird ⦄
→ ∃[ G₁ ] (∀ x y z w v → G₁ ∙ x ∙ y ∙ z ∙ w ∙ v ≈ x ∙ y ∙ v ∙ (z ∙ w))
→ ∃[ G₂ ] (∀ x y z w → G₂ ∙ x ∙ y ∙ z ∙ w ≈ x ∙ w ∙ (x ∙ w) ∙ (y ∙ z))
exercise₁-b (G₁ , isG₁) =
( G₁ ∙ (B ∙ M)
, λ x y z w → begin
G₁ ∙ (B ∙ M) ∙ x ∙ y ∙ z ∙ w ≈⟨ isG₁ (B ∙ M) x y z w ⟩
B ∙ M ∙ x ∙ w ∙ (y ∙ z) ≈⟨ congʳ $ isBluebird M x w ⟩
M ∙ (x ∙ w) ∙ (y ∙ z) ≈⟨ congʳ $ isMockingbird (x ∙ w) ⟩
x ∙ w ∙ (x ∙ w) ∙ (y ∙ z) ∎
)
exercise₁-c : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄ ⦃ _ : HasIdentity ⦄
→ ∃[ I₂ ] (∀ x → I₂ ∙ x ≈ x ∙ I ∙ I)
exercise₁-c =
( B ∙ (T ∙ I) ∙ (T ∙ I)
, λ x → begin
B ∙ (T ∙ I) ∙ (T ∙ I) ∙ x ≈⟨ isBluebird (T ∙ I) (T ∙ I) x ⟩
T ∙ I ∙ (T ∙ I ∙ x) ≈⟨ isThrush I (T ∙ I ∙ x) ⟩
T ∙ I ∙ x ∙ I ≈⟨ congʳ $ isThrush I x ⟩
x ∙ I ∙ I ∎
)
exercise₁-d : ⦃ _ : HasIdentity ⦄ ⦃ _ : HasFinch ⦄
→ (hasI₂ : ∃[ I₂ ] (∀ x → I₂ ∙ x ≈ x ∙ I ∙ I))
→ ∀ x → proj₁ hasI₂ ∙ (F ∙ x) ≈ x
exercise₁-d (I₂ , isI₂) x = begin
I₂ ∙ (F ∙ x) ≈⟨ isI₂ (F ∙ x) ⟩
F ∙ x ∙ I ∙ I ≈⟨ isFinch x I I ⟩
I ∙ I ∙ x ≈⟨ congʳ $ isIdentity I ⟩
I ∙ x ≈⟨ isIdentity x ⟩
x ∎
exercise₁-e : ⦃ _ : HasFinch ⦄ ⦃ _ : HasQueerBird ⦄ ⦃ _ : HasIdentity ⦄
→ (hasG₂ : ∃[ G₂ ] (∀ x y z w → G₂ ∙ x ∙ y ∙ z ∙ w ≈ x ∙ w ∙ (x ∙ w) ∙ (y ∙ z)))
→ (hasI₂ : ∃[ I₂ ] (∀ x → I₂ ∙ x ≈ x ∙ I ∙ I))
→ IsWarbler (proj₁ hasG₂ ∙ F ∙ (Q ∙ proj₁ hasI₂))
exercise₁-e (G₂ , isG₂) (I₂ , isI₂) x y = begin
G₂ ∙ F ∙ (Q ∙ I₂) ∙ x ∙ y ≈⟨ isG₂ F (Q ∙ I₂) x y ⟩
F ∙ y ∙ (F ∙ y) ∙ (Q ∙ I₂ ∙ x) ≈⟨ isFinch y (F ∙ y) (Q ∙ I₂ ∙ x) ⟩
Q ∙ I₂ ∙ x ∙ (F ∙ y) ∙ y ≈⟨ congʳ $ isQueerBird I₂ x (F ∙ y) ⟩
x ∙ (I₂ ∙ (F ∙ y)) ∙ y ≈⟨ congʳ $ congˡ $ exercise₁-d (I₂ , isI₂) y ⟩
x ∙ y ∙ y ∎
exercise₂ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasWarbler ⦄
→ IsStarling (B ∙ (B ∙ (B ∙ W) ∙ C) ∙ (B ∙ B))
exercise₂ x y z = begin
B ∙ (B ∙ (B ∙ W) ∙ C) ∙ (B ∙ B) ∙ x ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isBluebird (B ∙ (B ∙ W) ∙ C) (B ∙ B) x ⟩
B ∙ (B ∙ W) ∙ C ∙ (B ∙ B ∙ x) ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isBluebird (B ∙ W) C (B ∙ B ∙ x) ⟩
B ∙ W ∙ (C ∙ (B ∙ B ∙ x)) ∙ y ∙ z ≈⟨ congʳ $ isBluebird W (C ∙ (B ∙ B ∙ x)) y ⟩
W ∙ (C ∙ (B ∙ B ∙ x) ∙ y) ∙ z ≈⟨ isWarbler (C ∙ (B ∙ B ∙ x) ∙ y) z ⟩
C ∙ (B ∙ B ∙ x) ∙ y ∙ z ∙ z ≈⟨ congʳ $ isCardinal (B ∙ B ∙ x) y z ⟩
B ∙ B ∙ x ∙ z ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isBluebird B x z ⟩
B ∙ (x ∙ z) ∙ y ∙ z ≈⟨ isBluebird (x ∙ z) y z ⟩
x ∙ z ∙ (y ∙ z) ∎
exercise₃ : ⦃ _ : HasStarling ⦄ ⦃ _ : HasBluebird ⦄ → HasPhoenix
exercise₃ = record
{ Φ = B ∙ (B ∙ S) ∙ B
; isPhoenix = λ x y z w → begin
B ∙ (B ∙ S) ∙ B ∙ x ∙ y ∙ z ∙ w ≈⟨ congʳ $ congʳ $ congʳ $ isBluebird (B ∙ S) B x ⟩
B ∙ S ∙ (B ∙ x) ∙ y ∙ z ∙ w ≈⟨ congʳ $ congʳ $ isBluebird S (B ∙ x) y ⟩
S ∙ (B ∙ x ∙ y) ∙ z ∙ w ≈⟨ isStarling (B ∙ x ∙ y) z w ⟩
B ∙ x ∙ y ∙ w ∙ (z ∙ w) ≈⟨ congʳ $ isBluebird x y w ⟩
x ∙ (y ∙ w) ∙ (z ∙ w) ∎
}
exercise₄ : ⦃ _ : HasBluebird ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasWarbler ⦄ → HasPsiBird
exercise₄ = record
{ Ψ = H* ∙ D₂
; isPsiBird = λ x y z w → begin
H* ∙ D₂ ∙ x ∙ y ∙ z ∙ w ≈⟨⟩
B ∙ H ∙ D₂ ∙ x ∙ y ∙ z ∙ w ≈⟨ congʳ $ congʳ $ congʳ $ isBluebird H D₂ x ⟩
H ∙ (D₂ ∙ x) ∙ y ∙ z ∙ w ≈⟨ congʳ $ isHummingbird (D₂ ∙ x) y z ⟩
D₂ ∙ x ∙ y ∙ z ∙ y ∙ w ≈⟨ isDovekie x y z y w ⟩
x ∙ (y ∙ z) ∙ (y ∙ w) ∎
} where
instance
hasHummingbird = problem₁₀
hasDovekie = Chapter₁₁.problem₁₁
H* = B ∙ H
-- NOTE: my copy of the book contains a mistake (looking at the given
-- solutions): it says Γxyzwv = y(zw)(xywv) instead of Γxyzwv = y(zw)(xyzwv).
exercise₅-a : ⦃ _ : HasPhoenix ⦄ ⦃ _ : HasBluebird ⦄
→ ∃[ Γ ] (∀ x y z w v → Γ ∙ x ∙ y ∙ z ∙ w ∙ v ≈ y ∙ (z ∙ w) ∙ (x ∙ y ∙ z ∙ w ∙ v))
exercise₅-a =
( Φ ∙ (Φ ∙ (Φ ∙ B)) ∙ B
, λ x y z w v → begin
Φ ∙ (Φ ∙ (Φ ∙ B)) ∙ B ∙ x ∙ y ∙ z ∙ w ∙ v ≈⟨ congʳ $ congʳ $ congʳ $ isPhoenix (Φ ∙ (Φ ∙ B)) B x y ⟩
Φ ∙ (Φ ∙ B) ∙ (B ∙ y) ∙ (x ∙ y) ∙ z ∙ w ∙ v ≈⟨ congʳ $ congʳ $ isPhoenix (Φ ∙ B) (B ∙ y) (x ∙ y) z ⟩
Φ ∙ B ∙ (B ∙ y ∙ z) ∙ (x ∙ y ∙ z) ∙ w ∙ v ≈⟨ congʳ $ isPhoenix B (B ∙ y ∙ z) (x ∙ y ∙ z) w ⟩
B ∙ (B ∙ y ∙ z ∙ w) ∙ (x ∙ y ∙ z ∙ w) ∙ v ≈⟨ isBluebird (B ∙ y ∙ z ∙ w) (x ∙ y ∙ z ∙ w) v ⟩
B ∙ y ∙ z ∙ w ∙ (x ∙ y ∙ z ∙ w ∙ v) ≈⟨ congʳ $ isBluebird y z w ⟩
y ∙ (z ∙ w) ∙ (x ∙ y ∙ z ∙ w ∙ v) ∎
)
exercise₅-b : ⦃ _ : HasKestrel ⦄
→ ∃[ Γ ] (∀ x y z w v → Γ ∙ x ∙ y ∙ z ∙ w ∙ v ≈ y ∙ (z ∙ w) ∙ (x ∙ y ∙ z ∙ w ∙ v))
→ HasPsiBird
exercise₅-b (Γ , isΓ) = record
{ Ψ = Γ ∙ (K ∙ K)
; isPsiBird = λ x y z w → begin
Γ ∙ (K ∙ K) ∙ x ∙ y ∙ z ∙ w ≈⟨ isΓ (K ∙ K) x y z w ⟩
x ∙ (y ∙ z) ∙ (K ∙ K ∙ x ∙ y ∙ z ∙ w) ≈⟨ congˡ $ congʳ $ congʳ $ congʳ $ isKestrel K x ⟩
x ∙ (y ∙ z) ∙ (K ∙ y ∙ z ∙ w) ≈⟨ congˡ $ congʳ $ isKestrel y z ⟩
x ∙ (y ∙ z) ∙ (y ∙ w) ∎
}
exercise₅ : ⦃ _ : HasPhoenix ⦄ ⦃ _ : HasBluebird ⦄ ⦃ _ : HasKestrel ⦄ → HasPsiBird
exercise₅ = exercise₅-b exercise₅-a
exercise₆-a : ⦃ _ : HasStarling ⦄ ⦃ _ : HasBluebird ⦄ ⦃ _ : HasThrush ⦄
→ ∃[ S′ ] (∀ x y z → S′ ∙ x ∙ y ∙ z ≈ y ∙ z ∙ (x ∙ z))
exercise₆-a =
( C ∙ S
, λ x y z → begin
C ∙ S ∙ x ∙ y ∙ z ≈⟨ congʳ $ isCardinal S x y ⟩
S ∙ y ∙ x ∙ z ≈⟨ isStarling y x z ⟩
y ∙ z ∙ (x ∙ z) ∎
)
where instance hasCardinal = Chapter₁₁.problem₂₁′
exercise₆-b : ⦃ _ : HasIdentity ⦄
→ ∃[ S′ ] (∀ x y z → S′ ∙ x ∙ y ∙ z ≈ y ∙ z ∙ (x ∙ z))
→ HasWarbler
exercise₆-b (S′ , isS′) = record
{ W = S′ ∙ I
; isWarbler = λ x y → begin
S′ ∙ I ∙ x ∙ y ≈⟨ isS′ I x y ⟩
x ∙ y ∙ (I ∙ y) ≈⟨ congˡ $ isIdentity y ⟩
x ∙ y ∙ y ∎
}
exercise₇ : ⦃ _ : HasQueerBird ⦄ ⦃ _ : HasCardinal ⦄ ⦃ _ : HasWarbler ⦄
→ ∃[ Q̂ ] IsStarling (C ∙ Q̂ ∙ W)
exercise₇ = let Q̂ = Q ∙ (Q ∙ Q ∙ (Q ∙ Q)) ∙ Q in
( Q̂
, λ x y z → begin
C ∙ Q̂ ∙ W ∙ x ∙ y ∙ z ≈⟨ congʳ $ congʳ $ isCardinal Q̂ W x ⟩
Q̂ ∙ x ∙ W ∙ y ∙ z ≈⟨⟩
Q ∙ (Q ∙ Q ∙ (Q ∙ Q)) ∙ Q ∙ x ∙ W ∙ y ∙ z ≈⟨ congʳ $ congʳ $ congʳ $ isQueerBird (Q ∙ Q ∙ (Q ∙ Q)) Q x ⟩
Q ∙ (Q ∙ Q ∙ (Q ∙ Q) ∙ x) ∙ W ∙ y ∙ z ≈⟨ congʳ $ isQueerBird (Q ∙ Q ∙ (Q ∙ Q) ∙ x) W y ⟩
W ∙ (Q ∙ Q ∙ (Q ∙ Q) ∙ x ∙ y) ∙ z ≈⟨ isWarbler (Q ∙ Q ∙ (Q ∙ Q) ∙ x ∙ y) z ⟩
Q ∙ Q ∙ (Q ∙ Q) ∙ x ∙ y ∙ z ∙ z ≈⟨ congʳ $ congʳ $ congʳ $ isQueerBird Q (Q ∙ Q) x ⟩
Q ∙ Q ∙ (Q ∙ x) ∙ y ∙ z ∙ z ≈⟨ congʳ $ congʳ $ isQueerBird Q (Q ∙ x) y ⟩
Q ∙ x ∙ (Q ∙ y) ∙ z ∙ z ≈⟨ congʳ $ isQueerBird x (Q ∙ y) z ⟩
Q ∙ y ∙ (x ∙ z) ∙ z ≈⟨ isQueerBird y (x ∙ z) z ⟩
x ∙ z ∙ (y ∙ z) ∎
)
|
test/Fail/Issue4606.agda | shlevy/agda | 1,989 | 1491 | <gh_stars>1000+
{-# OPTIONS --cubical #-}
module Issue4606 where
open import Agda.Builtin.Cubical.Path
open import Agda.Primitive.Cubical
-- Test case from <NAME>.
----------------------------------------------------------------------
-- Well-Founded Recursion
----------------------------------------------------------------------
data Acc {A : Set}(R : A → A → Set)(x : A) : Set where
acc : (∀ y → R y x → Acc R y) → Acc R x
iswf : {A : Set}(R : A → A → Set) → Set
iswf R = ∀ x → Acc R x
----------------------------------------------------------------------
-- A logical contradiction
----------------------------------------------------------------------
data A : Set where
O : A
S : A → A
E : ∀ x → S x ≡ x
data _<_ (x : A) : A → Set where
<S : x < S x
O<O : O < O
O<O = primTransp (\ i → O < E O i) i0 <S
-- Given that O < O holds, we should not be able to prove that < is
-- well-founded, but we can!
iswf< : iswf _<_
iswf< i = acc (α i)
where
α : ∀ x y → y < x → Acc _<_ y
-- I don't think the following clause should pass
-- the termination checker
α .(S y) y <S = acc (α y)
data ⊥ : Set where
AccO→⊥ : Acc _<_ O → ⊥
AccO→⊥ (acc f) = AccO→⊥ (f O O<O)
contradiction : ⊥
contradiction = AccO→⊥ (iswf< O)
|
programs/oeis/171/A171476.asm | karttu/loda | 1 | 172664 | ; A171476: a(n) = 6*a(n-1)-8*a(n-2) for n>1, a(0)=1, a(1)=6.
; 1,6,28,120,496,2016,8128,32640,130816,523776,2096128,8386560,33550336,134209536,536854528,2147450880,8589869056,34359607296,137438691328,549755289600,2199022206976,8796090925056,35184367894528,140737479966720,562949936644096,2251799780130816,9007199187632128
add $0,1
mov $1,2
pow $1,$0
bin $1,2
|
src/Calf/Types/BigO.agda | jonsterling/agda-calf | 29 | 17354 | <reponame>jonsterling/agda-calf
{-# OPTIONS --prop --without-K --rewriting #-}
-- Big-O bound on the cost of a computation.
open import Calf.CostMonoid
module Calf.Types.BigO (costMonoid : CostMonoid) where
open CostMonoid costMonoid
open import Calf.Prelude
open import Calf.Metalanguage
open import Calf.Step costMonoid
open import Calf.Types.Nat using (nat)
open import Calf.Types.Bounded costMonoid
open import Data.Nat as Nat using (ℕ)
open import Relation.Binary.PropositionalEquality as Eq using (_≡_)
[_]*_ : ℕ → ℂ → ℂ
[ ℕ.zero ]* c = zero
[ ℕ.suc k ]* c = c + [ k ]* c
record given_measured-via_,_∈𝓞_
(A : tp pos) {B : tp pos}
(∣_∣ : val A → val nat)
(f : cmp (Π A λ _ → F B)) (g : ℕ → ℂ) : □
where
constructor _≤n⇒f[n]≤_g[n]via_
field
n' : val nat
k : val nat
h : ∀ x → n' Nat.≤ ∣ x ∣ → IsBounded B (f x) ([ k ]* g ∣ x ∣)
_≤n⇒f[n]≤g[n]via_ : ∀ {A B f ∣_∣ g} → (n' : val nat) → (∀ x → n' Nat.≤ ∣ x ∣ → IsBounded B (f x) (g ∣ x ∣)) → given A measured-via ∣_∣ , f ∈𝓞 g
n' ≤n⇒f[n]≤g[n]via h = n' ≤n⇒f[n]≤ 1 g[n]via (λ x h≤ → Eq.subst (IsBounded _ _) (Eq.sym (+-identityʳ _)) (h x h≤))
|
tests/src/sha2_streams_tests.ads | AntonMeep/sha2 | 0 | 21183 | <reponame>AntonMeep/sha2<filename>tests/src/sha2_streams_tests.ads<gh_stars>0
with AUnit.Test_Fixtures;
with AUnit.Test_Suites;
package SHA2_Streams_Tests is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
private
type Fixture is new AUnit.Test_Fixtures.Test_Fixture with null record;
procedure SHA2_224_Test (Object : in out Fixture);
procedure SHA2_224_One_Million_Test (Object : in out Fixture);
procedure SHA2_224_Extremely_Long_Test (Object : in out Fixture);
procedure SHA2_256_Test (Object : in out Fixture);
procedure SHA2_256_One_Million_Test (Object : in out Fixture);
procedure SHA2_256_Extremely_Long_Test (Object : in out Fixture);
procedure SHA2_384_Test (Object : in out Fixture);
procedure SHA2_384_One_Million_Test (Object : in out Fixture);
procedure SHA2_384_Extremely_Long_Test (Object : in out Fixture);
procedure SHA2_512_Test (Object : in out Fixture);
procedure SHA2_512_One_Million_Test (Object : in out Fixture);
procedure SHA2_512_Extremely_Long_Test (Object : in out Fixture);
procedure SHA2_512_224_Test (Object : in out Fixture);
procedure SHA2_512_224_One_Million_Test (Object : in out Fixture);
procedure SHA2_512_256_Test (Object : in out Fixture);
procedure SHA2_512_256_One_Million_Test (Object : in out Fixture);
end SHA2_Streams_Tests;
|
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/DCLStatement.g4 | minli04g/incubator-shardingsphere | 0 | 6443 | <reponame>minli04g/incubator-shardingsphere<gh_stars>0
/*
* 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 DCLStatement;
import Symbol, Keyword, Literals, BaseRule;
grant
: GRANT (objectPrivileges_ (ON onObjectClause_)? | otherPrivileges_)
;
revoke
: REVOKE (objectPrivileges_ (ON onObjectClause_)? | otherPrivileges_)
;
objectPrivileges_
: objectPrivilegeType_ columnNames? (COMMA_ objectPrivilegeType_ columnNames?)*
;
objectPrivilegeType_
: ALL PRIVILEGES?
| SELECT
| INSERT
| DELETE
| UPDATE
| ALTER
| READ
| WRITE
| EXECUTE
| USE
| INDEX
| REFERENCES
| DEBUG
| UNDER
| FLASHBACK ARCHIVE
| ON COMMIT REFRESH
| QUERY REWRITE
| KEEP SEQUENCE
| INHERIT PRIVILEGES
| TRANSLATE SQL
| MERGE VIEW
;
onObjectClause_
: USER | DIRECTORY | EDITION | MINING MODEL | SQL TRANSLATION PROFILE
| JAVA (SOURCE | RESOURCE) tableName
| tableName
;
otherPrivileges_
: STRING_+ | IDENTIFIER_+
;
createUser
: CREATE USER
;
dropUser
: DROP USER
;
alterUser
: ALTER USER
;
createRole
: CREATE ROLE
;
dropRole
: DROP ROLE
;
alterRole
: ALTER ROLE
;
|
tests/src/NewThis.asm | meghanto/tiny_vm | 2 | 85045 | <filename>tests/src/NewThis.asm
# Allocating a new object of the current class
# Class wraps a single Int
.class NewThis:Obj
.field x
.method $constructor
.args initial
enter
load initial
load $
store_field $:x
const "Creating a NewThis object, value "
call String:print
pop
load $
load_field $:x
call Int:print
pop
const "\n"
call String:print
pop
load $
return 1
.method next
enter
const 1
load $
load_field $:x
call Int:plus
new $
call $:$constructor
return 0
|
libpal/intel_64bit_ms64_masm/read_cr2.asm | mars-research/pal | 26 | 161632 | .code
pal_execute_read_cr2 proc
mov rax, cr2;
ret;
pal_execute_read_cr2 endp
end
|
examples/shared/common/gui/lcd_std_out.ads | rocher/Ada_Drivers_Library | 192 | 15604 | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This package provides a set of convenience routines for putting characters
-- and strings out to the LCD.
with BMP_Fonts; use BMP_Fonts;
with HAL.Bitmap;
with HAL.Framebuffer;
package LCD_Std_Out is
Black : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Black;
Blue : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Blue;
Light_Blue : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Light_Blue;
Green : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Green;
Cyan : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Cyan;
Gray : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Gray;
Magenta : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Magenta;
Light_Green : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Light_Green;
Brown : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Brown;
Red : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Red;
Orange : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Orange;
Yellow : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.Yellow;
White : HAL.Bitmap.Bitmap_Color renames HAL.Bitmap.White;
Default_Text_Color : constant HAL.Bitmap.Bitmap_Color := White;
Default_Background_Color : constant HAL.Bitmap.Bitmap_Color := Black;
Default_Font : constant BMP_Font := Font16x24;
-- Default_Orientation : constant LCD.Orientations := LCD.Portrait_2;
-- Changes to these current values will appear on subsequent calls to the
-- output routines.
Current_Text_Color : HAL.Bitmap.Bitmap_Color := Default_Text_Color;
Current_Background_Color : HAL.Bitmap.Bitmap_Color := Default_Background_Color;
procedure Set_Font (To : BMP_Font);
-- Changes the current font setting so that subsequent output is in the
-- specified font.
procedure Set_Orientation (To : HAL.Framebuffer.Display_Orientation);
-- Configures the screen orientation and fills the screen with the current
-- background color. All previously displayed content is lost.
procedure Clear_Screen;
----------------------------------------------------------------------------
-- These routines maintain a logical line and column, such that text will
-- wrap around to the next "line" when necessary, as determined by the
-- current orientation of the screen.
procedure Put_Line (Msg : String);
-- Note: wraps around to the next line if necessary.
-- Always calls procedure New_Line automatically after printing the string.
procedure Put (Msg : String);
-- Note: wraps around to the next line if necessary.
procedure Put (Msg : Character);
procedure New_Line;
-- A subsequent call to Put or Put_Line will start printing characters at
-- the beginning of the next line, wrapping around to the top of the LCD
-- screen if necessary.
----------------------------------------------------------------------------
-- These routines are provided for convenience, as an alternative to
-- using both this package and an instance of Bitmnapped_Drawing directly,
-- when wanting both the wrap-around semantics and direct X/Y coordinate
-- control. You can combine calls to these routines with the ones above but
-- these do not update the logical line/column state, so more likely you
-- will use one set or the other. If you only need X/Y coordinate control,
-- consider directly using an instance of HAL.Bitmap.
procedure Put (X, Y : Natural; Msg : Character);
-- Prints the character at the specified location. Has no other effect
-- whatsoever, especially none on the state of the current logical line
-- or logical column.
procedure Put (X, Y : Natural; Msg : String);
-- Prints the string, starting at the specified location. Has no other
-- effect whatsoever, especially none on the state of the current logical
-- line or logical column. Does not wrap around.
end LCD_Std_Out;
|
Assembly/keyboard/textbox_longNames.asm | WildGenie/Ninokuni | 14 | 164683 | ;;----------------------------------------------------------------------------;;
;; Fix the position of the textboxes
;; Copyright 2015 <NAME> (aka pleonex)
;;
;; 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.
;;----------------------------------------------------------------------------;;
; # Input length
; The number of characters the user can write
.org 0x02139E30
.dcb 0x0A ; Questions
.dcb 0x06 + 1 ; Player name (warning: in the save only fits 8 bytes,
; that is the player name + \0)
; # L / R X Position
; The following values are the relative position as the screen width would be
; 258. Exactly, X_L = Z and X_R = 258 - Z, where Z are the next numbers.
; So, if you change it, you are moving L to the right the same value as
; R to the left.
.org 0x02139E32
.dcb 0x44 + 66 ; Questions
.dcb 0x6D + 34 ; Player name
; # Number of buttons in the bottom
; Number of buttons below. Valid values are 3 and 4. The difference is if the
; button to change between upper and lower case chars is present. Other values
; make the game crash.
.org 0x02139E34
.dcb 0x03 ; Questions
.dcb 0x04 ; Player name
; # Textboxes X Position
; Position of the text inside the textbox and the char cursor
.org 0x02139E36
.dcb 0x1D + 66 ; Questions
.dcb 0x45 + 35 ; Player name
|
Transynther/x86/_processed/NC/_st_zr_sm_/i7-8650U_0xd2.log_1089_343.asm | ljhsiun2/medusa | 9 | 924 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x171e5, %r11
nop
nop
add $49417, %r8
mov (%r11), %edi
nop
nop
sub $23453, %r14
lea addresses_D_ht+0x10539, %r14
nop
nop
add %rax, %rax
movb (%r14), %bl
nop
nop
xor $46238, %rbx
lea addresses_normal_ht+0xd665, %rax
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, (%rax)
nop
nop
inc %rbx
lea addresses_WC_ht+0xada5, %rbx
nop
nop
and $31463, %r8
movw $0x6162, (%rbx)
nop
nop
nop
nop
add $5008, %rax
lea addresses_A_ht+0x23e5, %rsi
lea addresses_UC_ht+0xe10, %rdi
nop
nop
nop
nop
nop
xor $5452, %rax
mov $106, %rcx
rep movsq
nop
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0x1e585, %rcx
nop
nop
nop
nop
dec %rsi
movl $0x61626364, (%rcx)
and $53118, %rcx
lea addresses_UC_ht+0x16ba5, %r11
clflush (%r11)
nop
nop
cmp $30149, %r14
movl $0x61626364, (%r11)
nop
nop
nop
nop
nop
add $3713, %rbx
lea addresses_WC_ht+0xaa5, %rsi
lea addresses_WT_ht+0x10c25, %rdi
sub %r8, %r8
mov $51, %rcx
rep movsq
nop
nop
nop
nop
xor %rax, %rax
lea addresses_A_ht+0x19f17, %rdi
nop
nop
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %r11
movq %r11, %xmm4
movups %xmm4, (%rdi)
nop
inc %r8
lea addresses_normal_ht+0x1410, %r14
nop
add %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
movups %xmm1, (%r14)
cmp %r8, %r8
lea addresses_normal_ht+0xe1a5, %rsi
lea addresses_A_ht+0xab25, %rdi
nop
nop
nop
cmp %r14, %r14
mov $79, %rcx
rep movsw
nop
nop
xor $47965, %rbx
lea addresses_UC_ht+0xcced, %rax
sub %rsi, %rsi
vmovups (%rax), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r11
nop
nop
nop
nop
nop
sub $45820, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r9
push %rdi
push %rsi
// Store
mov $0x1470d90000000da5, %rsi
and $56213, %r10
movw $0x5152, (%rsi)
nop
nop
nop
nop
cmp %r12, %r12
// Store
lea addresses_A+0x18ba5, %r9
clflush (%r9)
nop
nop
cmp $34966, %r12
movb $0x51, (%r9)
and $60282, %r13
// Store
lea addresses_PSE+0x2d65, %r10
nop
add $26168, %r12
movw $0x5152, (%r10)
cmp $40146, %r10
// Store
lea addresses_A+0x19245, %r10
nop
nop
nop
nop
nop
add $32789, %rdi
movb $0x51, (%r10)
nop
nop
nop
nop
and %r9, %r9
// Store
mov $0x4d48c300000009d5, %r13
clflush (%r13)
nop
nop
nop
nop
add %rdi, %rdi
movl $0x51525354, (%r13)
nop
dec %r14
// Load
lea addresses_A+0xbf75, %rdi
nop
nop
sub %r12, %r12
mov (%rdi), %r13w
nop
nop
nop
and %r12, %r12
// Faulty Load
mov $0x1470d90000000da5, %r9
cmp %r14, %r14
mov (%r9), %rsi
lea oracles, %r14
and $0xff, %rsi
shlq $12, %rsi
mov (%r14,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %r9
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'00': 1018, '52': 71}
00 00 00 00 00 00 00 52 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 52 00 00 00 52 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 52 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 52 00 00 52 00 00 52 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00
*/
|
include/bits_types_struct_timespec_h.ads | docandrew/troodon | 5 | 9560 | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with bits_types_h;
package bits_types_struct_timespec_h is
-- NB: Include guard matches what <linux/time.h> uses.
-- POSIX.1b structure for a time value. This is like a `struct timeval' but
-- has nanoseconds instead of microseconds.
-- Seconds.
type timespec is record
tv_sec : aliased bits_types_h.uu_time_t; -- /usr/include/bits/types/struct_timespec.h:12
tv_nsec : aliased bits_types_h.uu_syscall_slong_t; -- /usr/include/bits/types/struct_timespec.h:16
end record
with Convention => C_Pass_By_Copy; -- /usr/include/bits/types/struct_timespec.h:10
-- Nanoseconds.
-- Padding.
-- Nanoseconds.
-- Nanoseconds.
-- Padding.
end bits_types_struct_timespec_h;
|
P6/data_P6_2/cal_R_same_test41.asm | alxzzhou/BUAA_CO_2020 | 1 | 99706 | lui $1,46731
ori $1,$1,13362
lui $2,16861
ori $2,$2,42828
lui $3,64629
ori $3,$3,4562
lui $4,22312
ori $4,$4,3598
lui $5,47778
ori $5,$5,46211
lui $6,44910
ori $6,$6,21931
mthi $1
mtlo $2
sec0:
nop
nop
nop
subu $3,$6,$6
sec1:
nop
nop
and $6,$3,$2
subu $2,$6,$6
sec2:
nop
nop
sltiu $6,$2,9872
subu $4,$6,$6
sec3:
nop
nop
mfhi $6
subu $4,$6,$6
sec4:
nop
nop
lhu $6,0($0)
subu $4,$6,$6
sec5:
nop
slt $6,$4,$0
nop
subu $5,$6,$6
sec6:
nop
sltu $6,$6,$1
sltu $6,$4,$5
subu $0,$6,$6
sec7:
nop
subu $6,$6,$4
ori $6,$2,46310
subu $3,$6,$6
sec8:
nop
addu $6,$1,$2
mflo $6
subu $3,$6,$6
sec9:
nop
slt $6,$3,$4
lb $6,12($0)
subu $3,$6,$6
sec10:
nop
ori $6,$1,4224
nop
subu $3,$6,$6
sec11:
nop
addiu $6,$4,21397
nor $6,$5,$5
subu $2,$6,$6
sec12:
nop
lui $6,53063
sltiu $6,$3,21922
subu $4,$6,$6
sec13:
nop
addiu $6,$2,17759
mfhi $6
subu $1,$6,$6
sec14:
nop
slti $6,$2,2802
lb $6,0($0)
subu $4,$6,$6
sec15:
nop
mfhi $6
nop
subu $5,$6,$6
sec16:
nop
mfhi $6
addu $6,$6,$3
subu $5,$6,$6
sec17:
nop
mflo $6
ori $6,$6,1748
subu $3,$6,$6
sec18:
nop
mfhi $6
mflo $6
subu $5,$6,$6
sec19:
nop
mflo $6
lbu $6,1($0)
subu $1,$6,$6
sec20:
nop
lb $6,9($0)
nop
subu $1,$6,$6
sec21:
nop
lh $6,0($0)
slt $6,$1,$1
subu $0,$6,$6
sec22:
nop
lb $6,16($0)
xori $6,$5,46415
subu $3,$6,$6
sec23:
nop
lb $6,1($0)
mfhi $6
subu $3,$6,$6
sec24:
nop
lw $6,8($0)
lb $6,3($0)
subu $2,$6,$6
sec25:
and $6,$3,$6
nop
nop
subu $5,$6,$6
sec26:
sltu $6,$4,$4
nop
slt $6,$1,$2
subu $4,$6,$6
sec27:
or $6,$1,$4
nop
slti $6,$4,31299
subu $3,$6,$6
sec28:
slt $6,$5,$2
nop
mfhi $6
subu $6,$6,$6
sec29:
or $6,$1,$5
nop
lb $6,16($0)
subu $5,$6,$6
sec30:
slt $6,$2,$5
sltu $6,$4,$2
nop
subu $2,$6,$6
sec31:
addu $6,$4,$1
sltu $6,$3,$3
subu $6,$5,$2
subu $0,$6,$6
sec32:
nor $6,$4,$4
addu $6,$2,$5
lui $6,29045
subu $0,$6,$6
sec33:
or $6,$0,$3
or $6,$1,$5
mfhi $6
subu $5,$6,$6
sec34:
nor $6,$1,$0
slt $6,$3,$3
lhu $6,6($0)
subu $2,$6,$6
sec35:
or $6,$2,$3
lui $6,53956
nop
subu $3,$6,$6
sec36:
xor $6,$2,$3
andi $6,$1,1030
slt $6,$4,$4
subu $4,$6,$6
sec37:
sltu $6,$2,$3
slti $6,$3,-17327
addiu $6,$5,27891
subu $3,$6,$6
sec38:
and $6,$3,$3
slti $6,$3,-31521
mfhi $6
subu $3,$6,$6
sec39:
or $6,$4,$1
andi $6,$0,21260
lb $6,3($0)
subu $2,$6,$6
sec40:
or $6,$2,$4
mfhi $6
nop
subu $0,$6,$6
sec41:
slt $6,$4,$3
mfhi $6
slt $6,$4,$3
subu $1,$6,$6
sec42:
slt $6,$4,$4
mflo $6
andi $6,$6,42745
subu $6,$6,$6
sec43:
addu $6,$4,$5
mflo $6
mflo $6
subu $4,$6,$6
sec44:
subu $6,$2,$0
mfhi $6
lhu $6,12($0)
subu $0,$6,$6
sec45:
subu $6,$2,$0
lhu $6,8($0)
nop
subu $4,$6,$6
sec46:
and $6,$2,$4
lhu $6,6($0)
addu $6,$0,$4
subu $3,$6,$6
sec47:
or $6,$3,$4
lw $6,8($0)
addiu $6,$2,21002
subu $2,$6,$6
sec48:
or $6,$4,$5
lb $6,14($0)
mflo $6
subu $1,$6,$6
sec49:
addu $6,$5,$5
lb $6,5($0)
lbu $6,6($0)
subu $2,$6,$6
sec50:
xori $6,$2,43774
nop
nop
subu $5,$6,$6
sec51:
lui $6,38257
nop
subu $6,$5,$3
subu $2,$6,$6
sec52:
andi $6,$3,43617
nop
andi $6,$1,65221
subu $2,$6,$6
sec53:
xori $6,$6,20799
nop
mflo $6
subu $2,$6,$6
sec54:
lui $6,23914
nop
lb $6,4($0)
subu $6,$6,$6
sec55:
slti $6,$3,9584
subu $6,$5,$2
nop
subu $5,$6,$6
sec56:
slti $6,$6,16733
addu $6,$0,$3
slt $6,$1,$2
subu $1,$6,$6
sec57:
andi $6,$4,64789
nor $6,$3,$2
lui $6,53035
subu $4,$6,$6
sec58:
addiu $6,$4,27387
sltu $6,$2,$4
mflo $6
subu $3,$6,$6
sec59:
lui $6,3444
or $6,$2,$0
lbu $6,13($0)
subu $2,$6,$6
sec60:
sltiu $6,$4,-17030
ori $6,$2,5865
nop
subu $3,$6,$6
sec61:
sltiu $6,$1,8244
sltiu $6,$5,-11592
sltu $6,$1,$3
subu $3,$6,$6
sec62:
addiu $6,$3,-22041
lui $6,35410
xori $6,$3,27502
subu $4,$6,$6
sec63:
addiu $6,$1,14264
andi $6,$2,45360
mflo $6
subu $2,$6,$6
sec64:
lui $6,5393
xori $6,$3,35572
lw $6,4($0)
subu $4,$6,$6
sec65:
andi $6,$5,19155
mfhi $6
nop
subu $3,$6,$6
sec66:
slti $6,$3,-2241
mflo $6
subu $6,$3,$1
subu $1,$6,$6
sec67:
ori $6,$4,8174
mfhi $6
addiu $6,$4,32131
subu $1,$6,$6
sec68:
lui $6,26312
mflo $6
mflo $6
subu $3,$6,$6
sec69:
sltiu $6,$2,-16919
mflo $6
lb $6,13($0)
subu $2,$6,$6
sec70:
lui $6,63051
lhu $6,12($0)
nop
subu $3,$6,$6
sec71:
lui $6,14074
lb $6,7($0)
xor $6,$1,$6
subu $3,$6,$6
sec72:
slti $6,$4,-20166
lw $6,4($0)
addiu $6,$2,10128
subu $2,$6,$6
sec73:
ori $6,$4,8776
lhu $6,4($0)
mflo $6
subu $5,$6,$6
sec74:
ori $6,$6,31371
lhu $6,16($0)
lb $6,10($0)
subu $1,$6,$6
sec75:
mfhi $6
nop
nop
subu $1,$6,$6
sec76:
mfhi $6
nop
sltu $6,$4,$5
subu $3,$6,$6
sec77:
mfhi $6
nop
lui $6,59759
subu $1,$6,$6
sec78:
mfhi $6
nop
mflo $6
subu $1,$6,$6
sec79:
mflo $6
nop
lhu $6,8($0)
subu $6,$6,$6
sec80:
mfhi $6
subu $6,$3,$5
nop
subu $6,$6,$6
sec81:
mfhi $6
subu $6,$0,$2
sltu $6,$4,$2
subu $4,$6,$6
sec82:
mflo $6
xor $6,$1,$5
andi $6,$1,56400
subu $2,$6,$6
sec83:
mflo $6
sltu $6,$3,$5
mflo $6
subu $2,$6,$6
sec84:
mflo $6
and $6,$0,$5
lb $6,12($0)
subu $2,$6,$6
sec85:
mflo $6
andi $6,$3,9625
nop
subu $2,$6,$6
sec86:
mfhi $6
addiu $6,$3,28413
nor $6,$5,$4
subu $3,$6,$6
sec87:
mfhi $6
ori $6,$1,19119
lui $6,10006
subu $2,$6,$6
sec88:
mflo $6
ori $6,$2,4286
mfhi $6
subu $1,$6,$6
sec89:
mfhi $6
addiu $6,$2,29512
lb $6,0($0)
subu $6,$6,$6
sec90:
mflo $6
mflo $6
nop
subu $2,$6,$6
sec91:
mfhi $6
mfhi $6
xor $6,$5,$4
subu $3,$6,$6
sec92:
mflo $6
mfhi $6
sltiu $6,$5,-7291
subu $5,$6,$6
sec93:
mfhi $6
mflo $6
mfhi $6
subu $2,$6,$6
sec94:
mflo $6
mflo $6
lw $6,0($0)
subu $4,$6,$6
sec95:
mflo $6
lhu $6,0($0)
nop
subu $3,$6,$6
sec96:
mfhi $6
lbu $6,14($0)
and $6,$5,$3
subu $3,$6,$6
sec97:
mflo $6
lb $6,10($0)
lui $6,19730
subu $3,$6,$6
sec98:
mfhi $6
lh $6,10($0)
mfhi $6
subu $2,$6,$6
sec99:
mflo $6
lbu $6,13($0)
lh $6,6($0)
subu $2,$6,$6
sec100:
lh $6,2($0)
nop
nop
subu $2,$6,$6
sec101:
lb $6,3($0)
nop
nor $6,$3,$4
subu $4,$6,$6
sec102:
lbu $6,15($0)
nop
lui $6,15157
subu $4,$6,$6
sec103:
lbu $6,4($0)
nop
mflo $6
subu $2,$6,$6
sec104:
lbu $6,3($0)
nop
lh $6,14($0)
subu $3,$6,$6
sec105:
lhu $6,0($0)
nor $6,$3,$1
nop
subu $2,$6,$6
sec106:
lb $6,7($0)
nor $6,$4,$3
slt $6,$4,$1
subu $4,$6,$6
sec107:
lb $6,7($0)
subu $6,$3,$2
slti $6,$5,-6758
subu $0,$6,$6
sec108:
lhu $6,6($0)
subu $6,$4,$3
mfhi $6
subu $2,$6,$6
sec109:
lbu $6,16($0)
nor $6,$5,$3
lw $6,0($0)
subu $2,$6,$6
sec110:
lh $6,10($0)
lui $6,42326
nop
subu $5,$6,$6
sec111:
lbu $6,5($0)
andi $6,$4,45916
xor $6,$2,$3
subu $0,$6,$6
sec112:
lbu $6,10($0)
slti $6,$4,28038
ori $6,$3,35304
subu $3,$6,$6
sec113:
lw $6,4($0)
slti $6,$1,8496
mfhi $6
subu $5,$6,$6
sec114:
lb $6,14($0)
xori $6,$2,53563
lh $6,8($0)
subu $4,$6,$6
sec115:
lhu $6,0($0)
mflo $6
nop
subu $4,$6,$6
sec116:
lb $6,11($0)
mflo $6
and $6,$1,$3
subu $0,$6,$6
sec117:
lb $6,7($0)
mfhi $6
andi $6,$5,35710
subu $1,$6,$6
sec118:
lw $6,0($0)
mflo $6
mflo $6
subu $6,$6,$6
sec119:
lh $6,10($0)
mflo $6
lhu $6,12($0)
subu $5,$6,$6
sec120:
lb $6,14($0)
lw $6,0($0)
nop
subu $1,$6,$6
sec121:
lh $6,6($0)
lh $6,6($0)
slt $6,$1,$3
subu $3,$6,$6
sec122:
lw $6,0($0)
lhu $6,2($0)
ori $6,$3,6476
subu $3,$6,$6
sec123:
lh $6,2($0)
lbu $6,12($0)
mfhi $6
subu $6,$6,$6
sec124:
lw $6,0($0)
lw $6,16($0)
lbu $6,6($0)
subu $5,$6,$6
|
programs/fontedit.asm | shoaib-jamal/MichalOS | 0 | 176352 | ; ------------------------------------------------------------------
; MichalOS Font Editor
; ------------------------------------------------------------------
%INCLUDE "michalos.inc"
start:
call .draw_background
push ds
mov ax, 800h
mov ds, ax
mov cx, 4096 / 4
mov si, 0
mov di, 16384
rep movsd
pop ds
.main_loop:
call .draw_box_16
call os_wait_for_key
cmp ah, 72
je .cursor_up
cmp ah, 75
je .cursor_left
cmp ah, 77
je .cursor_right
cmp ah, 80
je .cursor_down
cmp al, 27
je .exit
cmp ah, 59 ; F1
je .file_menu
cmp ax, 1F13h ; Ctrl + S
je .save
cmp ax, 180Fh ; Ctrl + O
je .open
cmp ax, 310Eh ; Ctrl + N
je .new
cmp ax, 1011h ; Ctrl + Q
je .new
cmp al, 'q'
je .black
cmp al, 'w'
je .white
cmp al, 'p'
je .import
jmp .main_loop
.import:
mov ax, .number_buffer
mov bx, .number_msg
call os_input_dialog
mov si, .number_buffer
call os_string_to_hex
mov bx, 16
mul bx
add ax, 16384
mov si, ax
mov al, [.current_char]
mov ah, 0
mov bx, 16
mul bx
add ax, 16384
mov di, ax
mov cx, 16
rep movsb
jmp .decode
.black:
call .get_buffer
mov byte [si], 0
jmp .main_loop
.white:
call .get_buffer
mov byte [si], 1
jmp .main_loop
.file_menu:
mov ax, .file_list
mov bx, .file_msg
mov cx, .blank
call os_list_dialog
jc start
cmp ax, 1
je .new
cmp ax, 2
je .open
cmp ax, 3
je .save
cmp ax, 4
je .exit
.new:
mov di, buffer
mov al, 0
mov cx, 256 * 16
rep stosb
mov si, buffer
jmp start
.open:
mov ax, .number_buffer
mov bx, .number_msg
call os_input_dialog
mov si, .number_buffer
call os_string_to_hex
mov [.current_char], al
.decode:
mov al, [.current_char]
mov ah, 0
mov bx, 16
mul bx
add ax, 16384
mov si, ax
mov dx, 0
mov di, buffer
.open_loop:
lodsb
mov bl, al
mov cx, 0
.decode_loop:
rol bl, 1
mov al, bl
and al, 01h
stosb
inc cx
cmp cx, 8
jl .decode_loop
inc dx
cmp dx, 16
jl .open_loop
jmp start
.save:
movzx di, byte [.current_char]
shl di, 4
add di, 16384
mov dx, 0
mov si, buffer
.save_loop:
mov cx, 0
mov bl, 0
.encode_loop:
lodsb
add bl, al
rol bl, 1
inc cx
cmp cx, 8
jl .encode_loop
mov al, bl
ror al, 1
stosb
inc dx
cmp dx, 16
jl .save_loop
push es
mov ax, 800h
mov es, ax
mov cx, 4096 / 4
mov di, 0
mov si, 16384
rep movsd
pop es
mov ax, .font_file
call os_remove_file
jc .save_error
mov ax, .font_file
mov cx, 4096
mov bx, 16384
call os_write_file
jc .save_error
mov ax, .save_ok_msg
mov bx, 0
mov cx, 0
mov dx, 0
call os_dialog_box
jmp start
.save_error:
mov ax, .save_error_msg
mov bx, 0
mov cx, 0
mov dx, 0
call os_dialog_box
jmp start
.cursor_up:
cmp byte [.cursor_y], 0
je .main_loop
dec byte [.cursor_y]
jmp .main_loop
.cursor_left:
cmp byte [.cursor_x], 0
je .main_loop
dec byte [.cursor_x]
jmp .main_loop
.cursor_right:
cmp byte [.cursor_x], 7
je .main_loop
inc byte [.cursor_x]
jmp .main_loop
.cursor_down:
cmp byte [.cursor_y], 15
je .main_loop
inc byte [.cursor_y]
jmp .main_loop
.get_buffer:
push ax
push bx
mov ah, 0
mov bh, 0
mov al, [.cursor_x]
and al, 07h
mov bl, [.cursor_y]
and bl, 0Fh
rol bl, 3
add al, bl
mov si, buffer
add si, ax
pop bx
pop ax
ret
.draw_box_16:
mov al, 0C4h
mov cx, 16
mov dl, 2
mov dh, 2
mov ah, 09h
mov bh, 0
mov bl, 7
call os_move_cursor
int 10h ; Clear the upper cursor area
mov al, 0C4h
mov cx, 16
mov dl, 2
mov dh, 19
mov ah, 09h
mov bh, 0
mov bl, 7
call os_move_cursor
int 10h ; Clear the bottom cursor area
mov cx, 1
mov al, 0B3h
mov dl, 1
mov dh, 3
.clear_left:
call os_move_cursor
int 10h ; Clear the left cursor area
inc dh
cmp dh, 3 + 16
jl .clear_left
mov al, 0B3h
mov dl, 18
mov dh, 3
.clear_right:
call os_move_cursor
int 10h ; Clear the right cursor area
inc dh
cmp dh, 3 + 16
jl .clear_right
mov cx, 1 ; Draw the cursor
mov al, 19h
mov dl, [.cursor_x]
shl dl, 1 ; DL = DL * 2
add dl, 2
mov dh, 2
mov bl, 7
call os_move_cursor
int 10h
add dh, 17
mov al, 18h
call os_move_cursor
int 10h
mov al, 1Ah
mov dh, [.cursor_y]
add dh, 3
mov dl, 1
call os_move_cursor
int 10h
mov al, 1Bh
mov dl, 18
call os_move_cursor
int 10h
mov cx, 1 ; Draw the corners
mov al, 0DAh
mov dl, 1
mov dh, 2
call os_move_cursor
int 10h
mov al, 0C0h
mov dl, 1
mov dh, 19
call os_move_cursor
int 10h
mov al, 0BFh
mov dl, 18
mov dh, 2
call os_move_cursor
int 10h
mov al, 0D9h
mov dh, 19
call os_move_cursor
int 10h
mov al, 219 ; Full character
mov cx, 2 ; Print 2 characters
mov dl, 2 ; Sprite X position
mov dh, 3 ; Sprite Y position
mov ah, 09h ; int 10h function
mov bh, 0 ; Video page
mov si, buffer ; Buffer location
.draw_loop:
call .getcolor ; Get the color
call os_move_cursor
int 10h
inc si
add dl, 2
cmp dl, 2 + 2 * 8 ; End of X?
jl .draw_loop
mov dl, 2
inc dh
cmp dh, 3 + 16 ; End of Y?
jl .draw_loop
.getcolor:
mov bl, [si]
cmp bl, 01h
jne .gotcolor
mov bl, 0Fh
.gotcolor:
ret
.draw_background:
mov ax, .title_msg
mov bx, .footer_msg
mov cx, 7
call os_draw_background
mov dl, 24
mov dh, 0
call os_move_cursor
mov al, [.current_char]
call os_print_2hex
mov dl, 40
mov dh, 5
call os_move_cursor
mov si, .help0
call os_print_string
add dh, 2
call os_move_cursor
mov si, .help1
call os_print_string
inc dh
call os_move_cursor
mov si, .help2
call os_print_string
ret
.exit:
call os_reset_font
ret
.font_file db 'FONT.SYS', 0
.file_msg db 'Choose an option...', 0
.file_list db 'New,Open...,Save,Exit', 0
.save_error_msg db 'Error saving the file!', 0
.title_msg db 'MichalOS Font Editor -', 0
.footer_msg db '[F1] - File', 0
.save_ok_msg db 'File saved.', 0
.help0 db 'Controls:', 0
.help1 db 'Q/W - Black/White', 0
.help2 db 'P - Import from another character', 0
.blank db 0
.cursor_x db 0
.cursor_y db 0
.current_char db 0
.number_msg db 'Enter character number:', 0
.number_buffer times 8 db 0
.driversgmt dw 0
buffer:
; ------------------------------------------------------------------
|
汇编语言/第12章/t12.asm | jckling/only-python | 1 | 245789 | ;编写0号中断的处理程序
;在屏幕中间显示字符串,然后返回DOS
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do0
mov ax,0 ;设置ds:si指向源地址
mov es,ax
mov di,200h ;设置es:di指向目的地址
mov cx,offset do0end-offset do0 ;设置cx为传输长度
cld ;设置传输方向为正
rep movsb
mov ax,0 ;设置中断向量表
mov es,ax
mov word ptr es:[0*4],200h
mov word ptr es:[0*4+2],0
mov ax,4c00h
int 21h
do0:
jmp short do0start
db "overflow!"
do0start:
mov ax,cs
mov ds,ax
mov si,202h ;设置ds:si指向字符串
mov ax,0b800h
mov es,ax
mov di,12*160+36*2 ;设置es:di指向显存空间的中间位置
mov cx,9 ;设置cx为字符串长度
s:
mov al,[si]
mov es:[di],al
inc si
add di,2
loop s
mov ax,4c00h
int 21h
do0end:
nop
code ends
end start |
45/qb/ir/exstmisc.asm | minblock/msdos | 0 | 89019 | page 49,132
TITLE exstmisc.asm - misc. statement executors
;***
;exstmisc.asm - statement executors for QBI
;
; Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
;
;
;****************************************************************************
.xlist
include version.inc
EXSTMISC_ASM = ON
IncludeOnce architec
IncludeOnce context
IncludeOnce executor
IncludeOnce extort
IncludeOnce exint
IncludeOnce opstmt
IncludeOnce opmin
IncludeOnce opcontrl
IncludeOnce opintrsc
IncludeOnce opaftqb4
IncludeOnce qbimsgs
IncludeOnce rtinterp
.list
sBegin DATA
sEnd DATA
assumes es, NOTHING
assumes ss, DATA
EXTRN B$SERR:FAR
sBegin CODE
assumes cs, CODE
extrn I4ToU2:near
;==============================================================================
; Error-related Statements
;==============================================================================
MakeExe exStError,opStError
;note that error code is on stack here - - -
CALLRT B$SERR,DispMov ;Never returns. DispMov variant used
;just so non-RELEASE case won't have
;non-RELEASE static data screwed up.
;Note that calling via ExToRt ensures
;that grs.GRS_oTxCur is set up for
;B$IONERR
;==============================================================================
; Sound-related Statements
;==============================================================================
MakeExe exStBeep0,opStBeep
CALLRT B$BEEP,Disp
MakeExe exStPlay,opStPlay
CALLRT B$SPLY,Disp
MakeExe exStSound,opStSound
;Added with [11]
sub sp,4 ;Make room for argument
mov bx,sp
fstp dword ptr DGROUP:[bx] ;Copy to local stack
fwait
;End of [11]
CALLRT B$SOND,Disp
;==============================================================================
; Heap-related Statements
;==============================================================================
MakeExe exStDefSeg0,opStDefSeg0
CALLRT B$DSG0,Disp
MakeExe exStDefSeg1,opStDefSeg1
call I4toU2 ;coerce I4 addr on stack to a U2
CALLRT B$DSEG,Disp
MakeExe exStPoke,opStPoke
pop bx ;preserve value to be poked
call I4toU2 ;coerce I4 addr on stack to a U2
push bx ;(I4toU2 preserves bx)
CALLRT B$POKE,Disp
;==============================================================================
; Math-related Statements
;==============================================================================
MakeExe exStRandomize0,opStRandomize0
CALLRT B$RNZ0,Disp
MakeExe exStRandomize1,opStRandomize1
;Added with [11]
sub sp,8 ;Make room for argument
mov bx,sp
fstp qword ptr DGROUP:[bx] ;Copy to local stack
fwait
;End of [11]
CALLRT B$RNZP,Disp
;==============================================================================
; READ/DATA Support
;==============================================================================
;NOTE: The actual READ executors are exactly the same as the INPUT executors,
;NOTE: so they share code in exio.asm
;NOTE: The otxFirst field is a pointer to the link field in the first DATA
;NOTE: statement in the module. The otxCur field, however, is a pointer to
;NOTE: the exStData pcode - - - this inconsistency is required by the scanner,
;NOTE: which treats otxFirst as an otx head-of-chain, and otxCur as a 'normal'
;NOTE: otx - - - each of which is updated differently for Edit & CONTinue.
;NOTE: The oLineCur initialization value is 6 bytes to account for the fact
;NOTE: that otxCur points to the exStData pcode.
MakeExe exStRestore0,opStRestore0
xor cx,cx ;remember this is exStRestore0
jmp short Restore_Common
MakeExe exStRestore1,opStRestore1
DbAssertRel ax,nz,0,CODE,<exStRestore1 finds AX == 0>
xchg ax,cx ;cx != 0 indicates exStRestore1
LODSWTX ;ax = oTx. We want the next READ
; to use the first piece of
; data in the first DATA stmt
; found subsequent to this oTx
Restore_Common:
call GetDataSeg ;set up bx and es (preserves ax)
mov di,PTRRS[bx.MRS_data_otxFirst] ; oTx of link field of first DATA
; statement
mov es,dx
jcxz Restore_Common1 ;brif exStRestore0
Walk_Data_Stmts:
cmp ax,di
jbe Restore_Common1 ;brif di contains oTx we want to
; restore to
DbAssertRel di,nz,UNDEFINED,CODE,<exStRestore1 error2>
;if di == UNDEFINED, the above branch should have been taken
mov di,es:[di] ;move to next DATA stmt, if any
jmp short Walk_Data_Stmts
Restore_Common1: ;di = oTx to the link field
; of a DATA statement
inc di
.errnz UNDEFINED - 0FFFFH
jz Restore_Common2 ;brif no DATA statements
sub di,5 ;di = oTx to exStData
GETRS_SEG es
mov PTRRS[bx.MRS_data_otxCur],di
mov PTRRS[bx.MRS_data_oLineCur],6 ; offset into current DATA stmt
Restore_Common2:
jmp DispMov ;NOTE: just using the 'Mov'
;NOTE: varient of 'Disp' so that
;NOTE: DI & ES will get reloaded
;Helper routine for B$IRDPTR and B$IRDPTRUPD, below - - - returns
; the segment part of the address of mrsCur in ES. Note that DATA statements
; are NEVER found at proc level, because QBI moves all DATA statements to
; module level at text insertion.
;Output:
; dx = segment of current mrs table
; bx = pMrsCur
; es = segment of the global Rs table
;Preserves: ax, cx
GetDataSeg PROC NEAR
mov bx,[grs.GRS_oMrsCur]
RS_BASE add,bx
GETRS_SEG es
GETSEG dx,PTRRS[bx.MRS_txd.TXD_bdlText_seg] ;[4][2]
ret
GetDataSeg ENDP
;***
;B$IRDPTR - call back to give far ptr to runtime for next data item to read
;Input:
; none
;Output:
; far ptr to data item in DS:SI
;Destroys:
; ES
;Exceptions:
; Runtime error if no more data to be read
;*******************************************************************************
PUBLIC B$IRDPTR
B$IRDPTR PROC FAR
mov bx,[grs.GRS_oMrsCur]
RS_BASE add,bx
GETRS_SEG es ; es:bx points to mrsCur
mov si,PTRRS[bx.MRS_data_otxCur]
inc si
.errnz UNDEFINED - 0FFFFH
jz Out_Of_Data
dec si
add si,PTRRS[bx.MRS_data_oLineCur] ; ax now oTx of next item to read
call GetDataSeg ; returns seg in dx
push dx
pop ds
RET
Out_Of_Data:
mov al,ER_OD ;Out of Data error
call RtErrorNoSi ;never returns - runtime error
B$IRDPTR ENDP
;***
;B$IRDPTRUPD - call back to allow us to update data ptr after a READ occurs
;Input:
; AL = 0 if last item was just read in current DATA statement, non-zero
; otherwise
; BX = Number of bytes 'eaten' by the latest READ.
;Output:
; current mrs (in the global Rs table) updated with correct data pointer
;Destroys:
; ES
;*******************************************************************************
PUBLIC B$IRDPTRUPD
B$IRDPTRUPD PROC FAR
xchg ax,cx ;remember if @ end of DATA stmt
xchg ax,bx
mov bx,[grs.GRS_oMrsCur]
RS_BASE add,bx
GETRS_SEG es
add PTRRS[bx.MRS_data_oLineCur],ax ; assume not end of data stmt
or cl,cl
jnz RTPTRUPD_Exit ;brif not end of DATA stmt
call GetDataSeg ;seg address is in dx, Rs seg in es
mov ax,bx
mov bx,PTRRS[bx.MRS_data_otxCur]
DbAssertRel bx,nz,UNDEFINED,CODE,<B$IRDPTRUPD error in exstmisc.asm>
mov es,dx ; mrs text seg
mov dx,es:[bx+4] ;dx = pointer to link field of
; next DATA stmt or UNDEFINED
inc dx
.errnz UNDEFINED - 0FFFFH
jnz Not_EndOf_Data ;brif not end of data
mov dl,4 ;so sub dx,5 will set dx = FFFF
Not_EndOf_Data:
xchg ax,bx
sub dx,5 ;dx = UNDEFINED or pointer to
; an exStData pcode
GETRS_SEG es
mov PTRRS[bx.MRS_data_otxCur],dx
mov PTRRS[bx.MRS_data_oLineCur],6
RTPTRUPD_Exit:
RET
B$IRDPTRUPD ENDP
;==============================================================================
; SWAP
;==============================================================================
.errnz SizeD
MakeExe exStSwap2,opStSwap
inc si
inc si
CALLRT B$SWP2,Disp
MakeExe exStSwap4,opStSwap
inc si
inc si
CALLRT B$SWP4,Disp
MakeExe exStSwap8,opStSwap
inc si
inc si
CALLRT B$SWP8,Disp
MakeExe exStSwapSD,opStSwap
inc si
inc si
pop ax
pop bx
xor cx,cx
push ds
push bx
push cx
push ds
push ax
push cx
CALLRT B$SWPN,Disp
MakeExe exStSwapTyp,opStSwap
LODSWTX ;Get size to swap
pop dx
pop bx
push ax ;Add length to arg on stack
push bx
push dx
push ax
CALLRT B$SWPN,Disp
;seg_code = segment address for the CODE segment
;It can be referenced from any module as follows:
; EXTRN seg_code:abs
; mov ax,SEG seg_code
PUBLIC seg_code
seg_code EQU SEG B$IRDPTRUPD
sEnd CODE
end
|
common/sgx/rand.asm | ichetty/openenclave | 1 | 171218 | ;; Copyright (c) Microsoft Corporation. All rights reserved.
;; Licensed under the MIT License.
.CODE
PUBLIC oe_rdrand
oe_rdrand PROC
_rdrand_retry:
rdrand rax
jc _rdrand_epilogue
pause
jmp _rdrand_retry
_rdrand_epilogue:
ret
oe_rdrand ENDP
PUBLIC oe_rdseed
oe_rdseed PROC
_rdseed_retry:
rdseed rax
jc _rdseed_epilogue
pause
jmp _rdseed_retry
_rdseed_epilogue:
ret
oe_rdseed ENDP
END
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_21829_157.asm | ljhsiun2/medusa | 9 | 174428 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x2ae, %rsi
nop
nop
nop
nop
and $43331, %r9
movb $0x61, (%rsi)
nop
nop
cmp %r13, %r13
lea addresses_normal_ht+0x156e, %rsi
nop
nop
nop
and %rbp, %rbp
mov $0x6162636465666768, %r14
movq %r14, (%rsi)
nop
nop
and $49761, %r9
lea addresses_D_ht+0x1b1fd, %r9
nop
nop
nop
and %rbp, %rbp
movups (%r9), %xmm3
vpextrq $1, %xmm3, %rax
cmp %rax, %rax
lea addresses_A_ht+0x372a, %rax
add $64642, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
movups %xmm0, (%rax)
nop
add %rsi, %rsi
lea addresses_UC_ht+0x582e, %r14
nop
nop
nop
nop
nop
cmp %rcx, %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm2
vmovups %ymm2, (%r14)
xor %r14, %r14
lea addresses_normal_ht+0x15ce, %rsi
lea addresses_D_ht+0x826e, %rdi
dec %r13
mov $74, %rcx
rep movsw
nop
nop
nop
add %r14, %r14
lea addresses_UC_ht+0xadae, %r9
nop
nop
nop
nop
nop
cmp $26771, %r14
mov (%r9), %rsi
nop
and $8010, %rsi
lea addresses_WT_ht+0x652e, %r9
clflush (%r9)
nop
cmp $48194, %rdi
mov (%r9), %cx
nop
nop
xor %rax, %rax
lea addresses_WT_ht+0x17b2e, %r13
clflush (%r13)
nop
nop
nop
add $36369, %rbp
mov (%r13), %di
nop
nop
nop
and $64254, %r14
lea addresses_WT_ht+0x1ac82, %r9
nop
nop
nop
nop
nop
cmp %rdi, %rdi
movw $0x6162, (%r9)
nop
nop
nop
nop
nop
dec %rdi
lea addresses_WC_ht+0x1e62e, %rax
nop
cmp $63, %rsi
movups (%rax), %xmm2
vpextrq $0, %xmm2, %rdi
nop
dec %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rcx
push %rdi
push %rdx
// Load
lea addresses_A+0x1102e, %r9
nop
xor %rdx, %rdx
movb (%r9), %r8b
nop
cmp %r11, %r11
// Store
lea addresses_UC+0x1032e, %rdi
nop
nop
nop
and $21958, %rcx
movw $0x5152, (%rdi)
nop
nop
and %rcx, %rcx
// Store
lea addresses_UC+0x1832e, %rcx
add %r9, %r9
movl $0x51525354, (%rcx)
add %rdx, %rdx
// Store
lea addresses_WT+0x1e0ae, %r8
clflush (%r8)
nop
and $32517, %rcx
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
vmovups %ymm1, (%r8)
nop
cmp $19910, %r8
// Store
lea addresses_RW+0x16742, %rdx
sub $43597, %r11
mov $0x5152535455565758, %r8
movq %r8, (%rdx)
nop
nop
nop
nop
inc %r9
// Load
lea addresses_WT+0x1a58e, %r11
xor %r13, %r13
mov (%r11), %r8d
sub %r13, %r13
// Store
lea addresses_UC+0x1832e, %r11
nop
nop
nop
nop
nop
sub %r9, %r9
mov $0x5152535455565758, %r8
movq %r8, (%r11)
nop
xor %rcx, %rcx
// Store
lea addresses_D+0x41ae, %r11
nop
nop
and $32104, %rdi
mov $0x5152535455565758, %r9
movq %r9, %xmm3
vmovntdq %ymm3, (%r11)
nop
nop
nop
nop
nop
dec %rcx
// Faulty Load
lea addresses_UC+0x1832e, %r8
cmp %rcx, %rcx
mov (%r8), %r11
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
Definition/Conversion/Conversion.agda | CoqHott/logrel-mltt | 2 | 2505 | {-# OPTIONS --safe #-}
module Definition.Conversion.Conversion where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.RedSteps
open import Definition.Typed.Properties
open import Definition.Conversion
open import Definition.Conversion.Stability
open import Definition.Typed.Consequences.Syntactic
open import Definition.Typed.Consequences.Injectivity
open import Definition.Typed.Consequences.Equality
open import Definition.Typed.Consequences.Reduction
open import Tools.Product
import Tools.PropositionalEquality as PE
mutual
-- Conversion of algorithmic equality.
convConv↑Term : ∀ {t u A B Γ Δ l}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ A ≡ B ^ [ ! , l ]
→ Γ ⊢ t [conv↑] u ∷ A ^ l
→ Δ ⊢ t [conv↑] u ∷ B ^ l
convConv↑Term Γ≡Δ A≡B ([↑]ₜ B₁ t′ u′ D d d′ whnfB whnft′ whnfu′ t<>u) =
let _ , ⊢B = syntacticEq A≡B
B′ , whnfB′ , D′ = whNorm ⊢B
B₁≡B′ = trans (sym (subset* D)) (trans A≡B (subset* (red D′)))
in [↑]ₜ B′ t′ u′ (stabilityRed* Γ≡Δ (red D′))
(stabilityRed*Term Γ≡Δ (conv* d B₁≡B′))
(stabilityRed*Term Γ≡Δ (conv* d′ B₁≡B′)) whnfB′ whnft′ whnfu′
(convConv↓Term Γ≡Δ B₁≡B′ whnfB′ t<>u)
-- Conversion of algorithmic equality with terms and types in WHNF.
convConv↓Term : ∀ {t u A B Γ Δ l}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ A ≡ B ^ [ ! , l ]
→ Whnf B
→ Γ ⊢ t [conv↓] u ∷ A ^ l
→ Δ ⊢ t [conv↓] u ∷ B ^ l
convConv↓Term Γ≡Δ A≡B whnfB (ℕ-ins x) rewrite ℕ≡A A≡B whnfB =
ℕ-ins (stability~↓! Γ≡Δ x)
convConv↓Term Γ≡Δ A≡B whnfB (ne x) rewrite U≡A-whnf A≡B whnfB = ne (stability~↓! Γ≡Δ x)
convConv↓Term Γ≡Δ A≡B whnfB (ne-ins t u x x₁) with ne≡A x A≡B whnfB
convConv↓Term Γ≡Δ A≡B whnfB (ne-ins t u x x₁) | B , neB , PE.refl =
ne-ins (stabilityTerm Γ≡Δ (conv t A≡B)) (stabilityTerm Γ≡Δ (conv u A≡B))
neB (stability~↓! Γ≡Δ x₁)
convConv↓Term Γ≡Δ A≡B whnfB (zero-refl x) rewrite ℕ≡A A≡B whnfB =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in zero-refl ⊢Δ
convConv↓Term Γ≡Δ A≡B whnfB (suc-cong x) rewrite ℕ≡A A≡B whnfB =
suc-cong (stabilityConv↑Term Γ≡Δ x)
convConv↓Term Γ≡Δ A≡B whnfB (η-eq l< l<' x x₁ x₂ y y₁ x₃) with Π≡A A≡B whnfB
convConv↓Term Γ≡Δ A≡B whnfB (η-eq l< l<' x x₁ x₂ y y₁ x₃) | F′ , G′ , PE.refl =
let F≡F′ , rF≡rF′ , _ , _ , G≡G′ = injectivity A≡B
⊢F , ⊢F′ = syntacticEq F≡F′
in η-eq l< l<'
(stability Γ≡Δ ⊢F′) (stabilityTerm Γ≡Δ (conv x₁ A≡B))
(stabilityTerm Γ≡Δ (conv x₂ A≡B)) y y₁
(convConv↑Term (Γ≡Δ ∙ F≡F′) G≡G′ x₃)
convConv↓Term Γ≡Δ A≡B whnfB (U-refl x x₁) rewrite U≡A-whnf A≡B whnfB =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ in U-refl x ⊢Δ
convConv↓Term Γ≡Δ A≡B whnfB (ℕ-refl x) rewrite U≡A-whnf A≡B whnfB =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ in ℕ-refl ⊢Δ
convConv↓Term Γ≡Δ A≡B whnfB (Empty-refl x _) rewrite U≡A-whnf A≡B whnfB =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ in Empty-refl x ⊢Δ
convConv↓Term Γ≡Δ A≡B whnfB (Π-cong lΠ rF lF lG l< l<' x x₁ x₂) rewrite U≡A-whnf A≡B whnfB =
Π-cong lΠ rF lF lG l< l<' (stability Γ≡Δ x) (stabilityConv↑Term Γ≡Δ x₁) (stabilityConv↑Term (Γ≡Δ ∙ refl x) x₂)
convConv↓Term Γ≡Δ A≡B whnfB (∃-cong lΠ x x₁ x₂) rewrite U≡A-whnf A≡B whnfB =
∃-cong lΠ (stability Γ≡Δ x) (stabilityConv↑Term Γ≡Δ x₁) (stabilityConv↑Term (Γ≡Δ ∙ refl x) x₂)
-- Conversion of algorithmic equality with the same context.
convConvTerm : ∀ {t u A B Γ l}
→ Γ ⊢ t [conv↑] u ∷ A ^ l
→ Γ ⊢ A ≡ B ^ [ ! , l ]
→ Γ ⊢ t [conv↑] u ∷ B ^ l
convConvTerm t<>u A≡B = convConv↑Term (reflConEq (wfEq A≡B)) A≡B t<>u
conv~↑% : ∀ {t u A B Γ l}
-- → ⊢ Γ ≡ Δ
→ Γ ⊢ t ~ u ↑% A ^ l
→ Γ ⊢ A ≡ B ^ [ % , l ]
→ Γ ⊢ t ~ u ↑% B ^ l
conv~↑% (%~↑ ⊢k ⊢l) e = %~↑ (conv ⊢k e) (conv ⊢l e)
--(stabilityTerm ⊢Γ≡Δ (conv ⊢k e)) (stabilityTerm ⊢Γ≡Δ (conv ⊢l e))
convConvTerm%! : ∀ {t u A B Γ r l}
→ Γ ⊢ t [genconv↑] u ∷ A ^ [ r , l ]
→ Γ ⊢ A ≡ B ^ [ r , l ]
→ Γ ⊢ t [genconv↑] u ∷ B ^ [ r , l ]
convConvTerm%! {r = !} = convConvTerm
convConvTerm%! {r = %} = conv~↑%
|
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/cosh.asm | ahjelm/z88dk | 640 | 161995 | <reponame>ahjelm/z88dk<gh_stars>100-1000
SECTION code_fp_am9511
PUBLIC cosh
EXTERN cam32_sccz80_cosh
defc cosh = cam32_sccz80_cosh
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _cosh
EXTERN cam32_sdcc_dcc_cosh
defc _cosh = cam32_sdcc_dcc_cosh
ENDIF
|
oeis/056/A056525.asm | neoneye/loda-programs | 11 | 246068 | <gh_stars>10-100
; A056525: Palindromes with odd number of digits.
; Submitted by <NAME>(s2)
; 1,2,3,4,5,6,7,8,9,101,111,121,131,141,151,161,171,181,191,202,212,222,232,242,252,262,272,282,292,303,313,323,333,343,353,363,373,383,393,404,414,424,434,444,454,464,474,484,494,505,515,525,535,545,555,565,575,585,595,606,616,626,636,646,656,666,676,686,696,707,717,727,737,747,757,767,777,787,797,808,818,828,838,848,858,868,878,888,898,909,919,929,939,949,959,969,979,989,999,10001
add $0,1
lpb $0
mov $2,$0
div $0,10
mod $2,10
max $3,$0
mul $3,10
add $3,$2
lpe
mov $0,$3
|
test/Fail/Issue1436-17.agda | cruhland/agda | 1,989 | 16665 | <reponame>cruhland/agda<filename>test/Fail/Issue1436-17.agda
module _ where
module A where
postulate
_∷_ _∙_ bind : Set
infixr 5 _∷_
infixr 5 _∙_
infix 1 bind
syntax bind c (λ x → d) = x ← c , d
module B where
postulate
_∷_ _∙_ bind : Set
infix 5 _∷_
infixr 4 _∙_
infixl 2 bind
syntax bind c d = c ∙ d
module C where
postulate
bind : Set
infixr 2 bind
syntax bind c d = c ∙ d
open A
open B
open C
-- _∷_ is infix 5.
-- _∙_ has two fixities: infixr 4 and infixr 5.
-- A.bind's notation is infix 1.
-- B.bind and C.bind's notations are infix 2.
-- There is one instance of _∷_ in the grammar.
-- There are three instances of _∙_ in the grammar, one
-- corresponding to A._∙_, one corresponding to B._∙_, and one
-- corresponding to both B.bind and C.bind.
Foo : Set
Foo = ∷ ∙ ← ,
|
src/main/antlr4/empire/lang/Empire.g4 | srydberg/empire | 0 | 6783 | <gh_stars>0
grammar Empire;
prog
: binding*
statement*
EOF
;
binding
: 'bind' Identifier '=' Identifier
;
statement
: '(' condition* ')' outputBlock
;
condition
: Identifier '=' literal
;
literal
: Identifier
| RegexLiteral
;
outputBlock
: OutputBlock
;
Identifier
: Letter (Letter|Digit|Hyphen)*
;
fragment
Letter
: [a-zA-Z_]
;
fragment
Digit
: [0-9]
;
fragment
Hyphen
: '-'
;
RegexLiteral
: '~' '/' (EscapeSequence | ~('/'))* '/'
;
fragment
EscapeSequence
: '\/'
;
OutputBlock
: '{' .*? NewLine '}'
;
fragment
NewLine
: ('\r'? '\n')
;
Whitespace
: [ \r\n\t\u000c]+ -> skip
;
Comment
: '#' ~[\r\n]* ('\r'? '\n' | EOF) -> skip
; |
oeis/067/A067897.asm | neoneye/loda-programs | 11 | 100895 | ; A067897: a(n) = A000085(n) - (1 + Sum_{j=1..n-1} A000085(j)).
; Submitted by <NAME>(s1)
; 0,0,0,0,2,8,32,112,412,1504,5760,22464,91224,379424,1632896,7201472,32709136,152094976,725810176,3540883968,17680145184,90115509888,469094763008,2489169367808,13465672180160,74161734785536
mov $3,1
lpb $0
sub $0,1
sub $1,1
mov $2,$3
mul $2,$0
add $3,$1
mov $1,$2
sub $2,1
lpe
sub $3,$2
mov $0,$3
sub $0,1
|
alloy4fun_models/trainstlt/models/8/qKEGgQZCP6zM2oGTC.als | Kaixi26/org.alloytools.alloy | 0 | 2126 | <filename>alloy4fun_models/trainstlt/models/8/qKEGgQZCP6zM2oGTC.als
open main
pred idqKEGgQZCP6zM2oGTC_prop9 {
eventually Train.pos in Entry
}
pred __repair { idqKEGgQZCP6zM2oGTC_prop9 }
check __repair { idqKEGgQZCP6zM2oGTC_prop9 <=> prop9o } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.