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 |
|---|---|---|---|---|
source/vampire-villages-teaming.ads | ytomino/vampire | 1 | 16557 | -- The Village of Vampire by YT, このソースコードはNYSLです
with Ada.Numerics.MT19937;
package Vampire.Villages.Teaming is
type Role_Set is array (Person_Role) of Natural;
type Role_Set_Array is array (Positive range <>) of Role_Set;
function Possibilities (
People_Count : Ada.Containers.Count_Type;
Male_And_Female : Boolean;
Execution : Execution_Mode;
Formation : Formation_Mode;
Unfortunate : Unfortunate_Mode;
Monster_Side : Monster_Side_Mode)
return Role_Set_Array;
function Select_Set (
Sets : Role_Set_Array;
Appearance : Role_Appearances;
Generator : aliased in out Ada.Numerics.MT19937.Generator)
return Role_Set;
procedure Shuffle (
People : in out Villages.People.Vector;
Victim : access Villages.Person_Role;
Set : Role_Set;
Generator : aliased in out Ada.Numerics.MT19937.Generator);
end Vampire.Villages.Teaming;
|
archive/agda-1/Delay.agda | m0davis/oscar | 0 | 9086 |
module Delay where
open import OscarPrelude
mutual
data Delay (i : Size) (A : Set) : Set where
now : A → Delay i A
later : ∞Delay i A → Delay i A
record ∞Delay (i : Size) (A : Set) : Set where
coinductive
field
force : {j : Size< i} → Delay j A
open ∞Delay public
private
module BindDelay
where
mutual
bindDelay : ∀ {i A B} → Delay i A → (A → Delay i B) → Delay i B
bindDelay (now a) f = f a
bindDelay (later ∞a) f = later (bind∞Delay ∞a f)
bind∞Delay : ∀ {i A B} → ∞Delay i A → (A → Delay i B) → ∞Delay i B
force (bind∞Delay ∞a f) = bindDelay (force ∞a) f
module _
where
open BindDelay
open BindDelay public using () renaming (bind∞Delay to _∞>>=_)
instance FunctorDelay : {i : Size} → Functor (Delay i)
Functor.fmap FunctorDelay f x = bindDelay x $ now ∘ f
instance ApplicativeDelay : {i : Size} → Applicative (Delay i)
Applicative.pure ApplicativeDelay x = now x
Applicative._<*>_ ApplicativeDelay (now f) x = f <$> x
Applicative._<*>_ ApplicativeDelay (later ∞f) x = later ∘ bind∞Delay ∞f $ flip fmap x
Applicative.super ApplicativeDelay = FunctorDelay
instance MonadDelay : {i : Size} → Monad (Delay i)
Monad._>>=_ MonadDelay = bindDelay
Monad.super MonadDelay = ApplicativeDelay
{-# DISPLAY BindDelay.bindDelay x f = x >>= f #-}
mutual
data _∼_ {i : Size} {A : Set} : (a? b? : Delay ∞ A) → Set where
∼now : ∀ a → now a ∼ now a
∼later : ∀ {a∞ b∞} (eq : a∞ ∞∼⟨ i ⟩∼ b∞) → later a∞ ∼ later b∞
_∼⟨_⟩∼_ = λ {A} a? i b? → _∼_ {i}{A} a? b?
record _∞∼⟨_⟩∼_ {A} (a∞ : ∞Delay ∞ A) i (b∞ : ∞Delay ∞ A) : Set where
coinductive
field
∼force : {j : Size< i} → force a∞ ∼⟨ j ⟩∼ force b∞
open _∞∼⟨_⟩∼_ public
_∞∼_ = λ {i} {A} a∞ b∞ → _∞∼⟨_⟩∼_ {A} a∞ i b∞
mutual
∼refl : ∀{i A} (a? : Delay ∞ A) → a? ∼⟨ i ⟩∼ a?
∼refl (now a) = ∼now a
∼refl (later a∞) = ∼later (∞∼refl a∞)
∞∼refl : ∀{i A} (a∞ : ∞Delay ∞ A) → a∞ ∞∼⟨ i ⟩∼ a∞
∼force (∞∼refl a∞) = ∼refl (force a∞)
mutual
∼sym : ∀{i A}{a? b? : Delay ∞ A } → a? ∼⟨ i ⟩∼ b? → b? ∼⟨ i ⟩∼ a?
∼sym (∼now a) = ∼now a
∼sym (∼later eq) = ∼later (∞∼sym eq)
∞∼sym : ∀{i A}{a∞ b∞ : ∞Delay ∞ A} → a∞ ∞∼⟨ i ⟩∼ b∞ → b∞ ∞∼⟨ i ⟩∼ a∞
∼force (∞∼sym eq) = ∼sym (∼force eq)
mutual
∼trans : ∀{i A}{a? b? c? : Delay ∞ A} →
a? ∼⟨ i ⟩∼ b? → b? ∼⟨ i ⟩∼ c? → a? ∼⟨ i ⟩∼ c?
∼trans (∼now a) (∼now .a) = ∼now a
∼trans (∼later eq) (∼later eq′) = ∼later (∞∼trans eq eq′)
∞∼trans : ∀{i A}{a∞ b∞ c∞ : ∞Delay ∞ A} →
a∞ ∞∼⟨ i ⟩∼ b∞ → b∞ ∞∼⟨ i ⟩∼ c∞ → a∞ ∞∼⟨ i ⟩∼ c∞
∼force (∞∼trans eq eq′) = ∼trans (∼force eq) (∼force eq′)
--∼setoid : (i : Size) (A : Set) → Setoid lzero lzero
--∞∼setoid : (i : Size) (A : Set) → Setoid lzero lzero
mutual
bind-assoc : ∀{i A B C} (m : Delay ∞ A)
{k : A → Delay ∞ B} {l : B → Delay ∞ C} →
((m >>= k) >>= l) ∼⟨ i ⟩∼ (m >>= λ a → (k a >>= l))
bind-assoc (now a) = ∼refl _
bind-assoc (later a∞) = ∼later (∞bind-assoc a∞)
∞bind-assoc : ∀{i A B C} (a∞ : ∞Delay ∞ A)
{k : A → Delay ∞ B} {l : B → Delay ∞ C} →
((a∞ ∞>>= k) ∞>>= l) ∞∼⟨ i ⟩∼ (a∞ ∞>>= λ a → (k a >>= l))
∼force (∞bind-assoc a∞) = bind-assoc (force a∞)
mutual
bind-cong-l : ∀{i A B}{a? b? : Delay ∞ A} → a? ∼⟨ i ⟩∼ b? →
(k : A → Delay ∞ B) → (a? >>= k) ∼⟨ i ⟩∼ (b? >>= k)
bind-cong-l (∼now a) k = ∼refl _
bind-cong-l (∼later eq) k = ∼later (∞bind-cong-l eq k)
∞bind-cong-l : ∀{i A B}{a∞ b∞ : ∞Delay ∞ A} → a∞ ∞∼⟨ i ⟩∼ b∞ →
(k : A → Delay ∞ B) → (a∞ ∞>>= k) ∞∼⟨ i ⟩∼ (b∞ ∞>>= k)
∼force (∞bind-cong-l eq k) = bind-cong-l (∼force eq) k
mutual
bind-cong-r : ∀{i A B}(a? : Delay ∞ A){k l : A → Delay ∞ B} →
(∀ a → (k a) ∼⟨ i ⟩∼ (l a)) → (a? >>= k) ∼⟨ i ⟩∼ (a? >>= l)
bind-cong-r (now a) h = h a
bind-cong-r (later a∞) h = ∼later (∞bind-cong-r a∞ h)
∞bind-cong-r : ∀{i A B}(a∞ : ∞Delay ∞ A){k l : A → Delay ∞ B} →
(∀ a → (k a) ∼⟨ i ⟩∼ (l a)) → (a∞ ∞>>= k) ∞∼⟨ i ⟩∼ (a∞ ∞>>= l)
∼force (∞bind-cong-r a∞ h) = bind-cong-r (force a∞) h
map-compose : ∀{i A B C} (a? : Delay ∞ A) {f : A → B} {g : B → C} →
(g <$> (f <$> a?)) ∼⟨ i ⟩∼ ((g ∘ f) <$> a?)
map-compose a? = bind-assoc a?
map-cong : ∀{i A B}{a? b? : Delay ∞ A} (f : A → B) →
a? ∼⟨ i ⟩∼ b? → (f <$> a?) ∼⟨ i ⟩∼ (f <$> b?)
map-cong f eq = bind-cong-l eq (now ∘ f)
data _⇓_ {A : Set} : (a? : Delay ∞ A) (a : A) → Set where
now⇓ : ∀{a} → now a ⇓ a
later⇓ : ∀{a} {a∞ : ∞Delay ∞ A} → force a∞ ⇓ a → later a∞ ⇓ a
_⇓ : {A : Set} (x : Delay ∞ A) → Set
x ⇓ = ∃ λ a → x ⇓ a
map⇓ : ∀{A B}{a : A}{a? : Delay ∞ A}(f : A → B) → a? ⇓ a → (f <$> a?) ⇓ f a
map⇓ f now⇓ = now⇓
map⇓ f (later⇓ a⇓) = later⇓ (map⇓ f a⇓)
bind⇓ : ∀{A B}(f : A → Delay ∞ B){?a : Delay ∞ A}{a : A}{b : B} →
?a ⇓ a → f a ⇓ b → (?a >>= f) ⇓ b
bind⇓ f now⇓ q = q
bind⇓ f (later⇓ p) q = later⇓ (bind⇓ f p q)
infixl 4 _>>=⇓_
_>>=⇓_ : ∀{A B}{f : A → Delay ∞ B}{?a : Delay ∞ A}{a : A}{b : B} →
?a ⇓ a → f a ⇓ b → (?a >>= f) ⇓ b
_>>=⇓_ = bind⇓ _
infixl 4 _⇓>>=⇓_
_⇓>>=⇓_ : ∀{A B}{f : A → Delay ∞ B}{?a : Delay ∞ A}{b : B} →
(?a⇓ : ?a ⇓) → f (fst ?a⇓) ⇓ b → (?a >>= f) ⇓ b
_⇓>>=⇓_ (_ , a⇓) = bind⇓ _ a⇓
_⇓Dec>>=⇓_else⇓_ : ∀{A B}{f-yes : A → Delay ∞ B}{f-no : ¬ A → Delay ∞ B}{?a : Delay ∞ (Dec A)}{b : B} →
(?a⇓ : ?a ⇓) →
((a : A) → f-yes a ⇓ b) →
((¬a : ¬ A) → f-no ¬a ⇓ b) →
((?a >>= (λ { (yes y) → f-yes y ; (no n) → f-no n }))) ⇓ b
(yes y , y⇓) ⇓Dec>>=⇓ fy⇓ else⇓ fn⇓ = y⇓ >>=⇓ fy⇓ y
(no n , n⇓) ⇓Dec>>=⇓ fy⇓ else⇓ fn⇓ = n⇓ >>=⇓ fn⇓ n
_⇓DecEq>>=⇓_else⇓_ : ∀{A : Set} {A₁ A₂ : A} {B}{f-yes : A₁ ≡ A₂ → Delay ∞ B}{f-no : A₁ ≢ A₂ → Delay ∞ B}{?a : Delay ∞ (Dec (A₁ ≡ A₂))}{b : B} →
(?a⇓ : ?a ⇓) →
((eq : A₁ ≡ A₂) → f-yes eq ⇓ b) →
((¬eq : A₁ ≢ A₂) → f-no ¬eq ⇓ b) →
((?a >>= (λ { (yes refl) → f-yes refl ; (no n) → f-no n }))) ⇓ b
(yes refl , y⇓) ⇓DecEq>>=⇓ fy⇓ else⇓ fn⇓ = y⇓ >>=⇓ fy⇓ refl
(no n , n⇓) ⇓DecEq>>=⇓ fy⇓ else⇓ fn⇓ = n⇓ >>=⇓ fn⇓ n
app⇓ : ∀{A}{B}{f? : Delay ∞ (A → B)}{f : A → B}{x? : Delay ∞ A}{x : A} → f? ⇓ f → x? ⇓ x → (f? <*> x?) ⇓ f x
app⇓ now⇓ now⇓ = now⇓
app⇓ now⇓ (later⇓ x?) = later⇓ $ map⇓ _ x?
app⇓ (later⇓ f?) now⇓ = later⇓ $ bind⇓ _ f? now⇓
app⇓ (later⇓ ⇓f) (later⇓ ⇓x) = later⇓ $ bind⇓ _ ⇓f $ later⇓ $ bind⇓ _ ⇓x now⇓
subst∼⇓ : ∀{A}{a? a?′ : Delay ∞ A}{a : A} → a? ⇓ a → a? ∼ a?′ → a?′ ⇓ a
subst∼⇓ now⇓ (∼now a) = now⇓
subst∼⇓ (later⇓ p) (∼later eq) = later⇓ (subst∼⇓ p (∼force eq))
traverse-list⇓ : ∀{A}{B} (f? : A → Delay ∞ B) → (∀ x → f? x ⇓) → (xs : List A) → traverse f? xs ⇓
traverse-list⇓ f? f?⇓ [] = [] , now⇓
traverse-list⇓ f? f?⇓ (x ∷ xs)
with f?⇓ x | traverse-list⇓ f? f?⇓ xs
… | y , y⇓ | ys , ys⇓ = y ∷ ys , app⇓ (map⇓ _ y⇓) ys⇓
|
alloy4fun_models/trashltl/models/11/tfD2mKyQHExaPAXvN.als | Kaixi26/org.alloytools.alloy | 0 | 5138 | open main
pred idtfD2mKyQHExaPAXvN_prop12 {
eventually all f:File | eventually f in Trash implies f in Trash
}
pred __repair { idtfD2mKyQHExaPAXvN_prop12 }
check __repair { idtfD2mKyQHExaPAXvN_prop12 <=> prop12o } |
Ada/src/Problem_46.adb | Tim-Tom/project-euler | 0 | 23055 | <gh_stars>0
with Ada.Text_IO;
with Ada.Containers.Vectors;
with Ada.Numerics.Long_Elementary_Functions;
with PrimeInstances;
package body Problem_46 is
package IO renames Ada.Text_IO;
package Math renames Ada.Numerics.Long_Elementary_Functions;
package Positive_Primes renames PrimeInstances.Positive_Primes;
package Positive_Vector is new Ada.Containers.Vectors(Index_Type => Positive,
Element_Type => Positive);
procedure Solve is
gen : Positive_Primes.Prime_Generator := Positive_Primes.Make_Generator;
primes : Positive_Vector.Vector := Positive_Vector.Empty_Vector;
prime, composite : Positive;
function goldbach_composite(composite : Positive) return Boolean is
use Positive_Vector;
prime_cursor : Cursor := primes.First;
begin
while prime_cursor /= No_Element loop
declare
root : constant Long_Float := Math.Sqrt(Long_Float(composite - Element(prime_cursor))/2.0);
begin
if root = Long_Float'floor(root) then
return True;
end if;
end;
Positive_Vector.Next(prime_cursor);
end loop;
return False;
end;
begin
-- initialize virtual lists
Positive_Primes.Next_Prime(gen, prime); -- skip 2. It's an ugly prime for this problem
Positive_Primes.Next_Prime(gen, prime);
composite := 3;
main_loop:
loop
while composite < prime loop
exit main_loop when not goldbach_composite(composite);
composite := composite + 2;
end loop;
if composite = prime then
composite := composite + 2;
end if;
primes.Append(prime);
Positive_Primes.Next_Prime(gen, prime);
end loop main_loop;
IO.Put_Line(Positive'Image(composite));
end Solve;
end Problem_46;
|
Practicas/practica_08/ejercicio_2.asm | PyCoderMx/Arquitectura-de-Computadoras | 0 | 91054 | <filename>Practicas/practica_08/ejercicio_2.asm<gh_stars>0
# =============================================
# Autor: <NAME>
# Email: <EMAIL>
# Fecha: 03/11/2019
# =============================================
# Universidad Nacional Autonoma de Mexico
# Organizacion y Arquitectura de Computadoras
#
# Practica 08:
# Convencion de llamadas a subrutinas.
#
# Ejercicio 02:
# Fibonacci recursivo.
# =============================================
.data
msg: .asciiz "Ingresa un numero: "
# ---------------------------------------------
# Macro: end
# ---------------------------------------------
# Termina la ejecucion del programa
# con una llamada al sistema.
# ---------------------------------------------
.macro end()
li $v0, 10 # Se prepara para finalizar la ejecucion.
syscall # Llamada al sistema para terminar el programa.
.end_macro
# ---------------------------------------------
# Macro: read_int
# ---------------------------------------------
# Lee un entero de la terminal y lo guarda
# en %rd.
# ---------------------------------------------
.macro read_int(%rd)
li $v0, 4 # Se prepara para imprimir un mensaje.
la $a0, msg # Guarda en $a0 la cadena 'msg'.
syscall # Imprime la cadena solicitando un numero al usuario.
li $v0, 5 # Se prepara para leer un entero.
syscall # Llamada al sistema para leer dicho entero.
move %rd, $v0 # Guarda en el registro %rd el valor ingresado.
.end_macro
# ---------------------------------------------
# Macro: print_int
# ---------------------------------------------
# Imprime en la terminal el entero guardado
# en %rs.
# ---------------------------------------------
.macro print_int(%rs)
move $a0, %rs # Guarda el valor del registro %rs en $a0.
li $v0, 1 # Se prepara para imprimir un entero.
syscall # Llamada al sistema para imprimir dicho entero.
.end_macro
# ---------------------------------------------
# Macro: pre_foo0
# ---------------------------------------------
# Preambulo de foo como rutina invocada.
# ---------------------------------------------
.macro pre_foo0()
addi $sp, $sp, -12 # Guarda espacio en la pila para 3 palabras (12 bytes).
sw $a0, 4($sp) # Guarda el valor del registro $a0 (sp[4] = $a0).
sw $ra, 0($sp) # Guarda la direccion de retorno (sp[0] = $ra).
.end_macro
# ---------------------------------------------
# Macro: con_foo0
# ---------------------------------------------
# Conclusion de foo como rutina invodada.
# ---------------------------------------------
.macro con_foo0()
lw $ra, 0($sp) # Restaura de la pila la direccion de retorno.
addi $sp, $sp, 12 # Limpia la pila haciendo POP de 12 bytes (3 palabras).
jr $ra # Regresamos.
.end_macro
# ---------------------------------------------
# Macro: pre_foo1
# ---------------------------------------------
# Preambulo para invocar foo(n-1).
# ---------------------------------------------
.macro pre_foo1()
addi $a0, $a0, -1 # n = n - 1.
.end_macro
# ---------------------------------------------
# Macro: con_foo1
# ---------------------------------------------
# Conclusion de la invocacion de foo(n-1).
# ---------------------------------------------
.macro con_foo1()
lw $a0, 4($sp) # Restaura el valor de 'n' de la pila.
sw $v0, 8($sp) # Guarda el resultado de foo(n-1) en la pila.
.end_macro
# ---------------------------------------------
# Macro: pre_foo2
# ---------------------------------------------
# Preambulo para invocar foo(n-2).
# ---------------------------------------------
.macro pre_foo2()
addi $a0, $a0, -2 # n = n - 2.
.end_macro
# ---------------------------------------------
# Macro: con_foo2
# ---------------------------------------------
# Conclusion de la invocacion de foo(n-2).
# ---------------------------------------------
.macro con_foo2()
lw $t0, 8($sp) # Restaura el valor de foo(n-1) de la pila.
.end_macro
# ---------------------------------------------
# Macro: inv_foo
# ---------------------------------------------
# Invocacion a la subrutina foo.
# ---------------------------------------------
.macro inv_foo()
jal foo # Simplemente invocamos a la subrutina foo.
.end_macro
.text
.globl main
# ---------------------------------------------
# Procedimiento: main
# ---------------------------------------------
# Procedimiento principal del programa.
# ---------------------------------------------
main:
read_int($a0) # Lee un entero 'n' de stdin y lo guarda en $a0.
inv_foo() # Guarda el n-esimo termino de la sucesion de fibonacci en $v0.
print_int($v0) # Imprime el termino calculado por foo.
end() # Finaliza la ejecucion del programa.
# ---------------------------------------------
# Procedimiento: foo
# ---------------------------------------------
# Calcula el n-esimo termino de la sucesion
# de fibonacci usando recursion.
#
# Entrada:
# n - Un entero en el registro $a0.
#
# Salida:
# El n-esimo termino de la sucesion
# de fibonacci en el registro $v0.
# ---------------------------------------------
foo:
pre_foo0() # Prologo de foo(n).
beq $a0, 1, base1 # Si n = 1, foo(n) = 1.
beq $a0, 2, base1 # Si n = 2, foo(n) = 1.
pre_foo1() # Prologo a la invocacion de foo(n-1).
inv_foo() # Invocacion de foo(n-1).
con_foo1() # Conclusion de la invocacion de foo(n-1).
move $t0, $v0 # Guardamos el contenido de $v0 en un registro temporal $t0.
pre_foo2() # Prologo a la invocacion de foo(n-2).
inv_foo() # Invocacion de foo(n-2).
con_foo2() # Conclusion de la invocacion de foo(n-2).
add $v0, $v0, $t0 # Regresamos foo(n) = foo(n-1) + foo(n-2).
j return # Regresamos al caller.
# ---------------------------------------------
# Procedimiento: base1
# ---------------------------------------------
# Guarda un 1 en el registro $v0.
# ---------------------------------------------
base1:
li $v0, 1 # Caso base para el procedimiento recursivo foo.
# ---------------------------------------------
# Procedimiento: return
# ---------------------------------------------
# Conclusion de foo como rutina invodada.
# ---------------------------------------------
return:
con_foo0() # Conclusion del procedimiento foo(n).
|
WRK-V1.2/PUBLIC/INTERNAL/SDKTOOLS/masm/asmmsg.asm | intj-t/openvmsft | 0 | 101229 | <filename>WRK-V1.2/PUBLIC/INTERNAL/SDKTOOLS/masm/asmmsg.asm<gh_stars>0
;This was originally created from asmmsg.txt by mkmsg
;Only used by the OS2 1.2 version of MASM 5.NT
HDR segment byte public 'MSG'
HDR ends
MSG segment byte public 'MSG'
MSG ends
PAD segment byte public 'MSG'
PAD ends
EPAD segment byte common 'MSG'
EPAD ends
DGROUP group HDR,MSG,PAD,EPAD
MSG segment
dw 258
db "Internal error",10,0
dw 261
db "%s(%hd): %s A%c%03hd: %s%s",0
dw 263
db "Internal unknown error",10,0
dw 265
db "End of file encountered on input file",10,0
dw 266
db "Open segments",0
dw 267
db "Open procedures",0
dw 268
db "Number of open conditionals:",0
dw 269
db "%s",10,"Copyright (C) Microsoft Corp 1981, 1989. All rights reserved.",10,10,0
dw 270
db "Unable to open cref file: %s",10,0
dw 271
db "Write error on object file",10,0
dw 272
db "Write error on listing file",10,0
dw 273
db "Write error on cross-reference file",10,0
dw 274
db "Unable to open input file: %s",10,0
dw 275
db "Unable to access input file: %s",10,0
dw 276
db "Unable to open listing file: %s",10,0
dw 277
db "Unable to open object file: %s",10,0
dw 278
db " Warning Errors",0
dw 279
db " Severe Errors",0
dw 280
db 10,"%7ld Source Lines",10,"%7ld Total Lines",10,0
dw 281
db "%7hd Symbols",10,0
dw 282
db "Bytes symbol space free",10,0
dw 283
db "%s(%hd): Out of memory",10,0
dw 284
db "Extra file name ignored",10,0
dw 285
db "Line invalid, start again",10,0
dw 287
db "Path expected after I option",10,0
dw 288
db "Unknown case option: %c. Use /help for list",10,0
dw 289
db "Unknown option: %c. Use /help for list of options",10,0
dw 290
db "Read error on standard input",10,0
dw 291
db "Out of memory",10,0
dw 292
db "Expected source file",10,0
dw 293
db "Warning level (0-2) expected after W option",10,0
MSG ends
FAR_HDR segment byte public 'FAR_MSG'
FAR_HDR ends
FAR_MSG segment byte public 'FAR_MSG'
FAR_MSG ends
FAR_PAD segment byte public 'FAR_MSG'
FAR_PAD ends
FAR_EPAD segment byte common 'FAR_MSG'
FAR_EPAD ends
FMGROUP group FAR_HDR,FAR_MSG,FAR_PAD,FAR_EPAD
FAR_MSG segment
dw 257
db "Block nesting error",0
dw 258
db "Extra characters on line",0
dw 259
db "Internal error - Register already defined",0
dw 260
db "Unknown type specifier",0
dw 261
db "Redefinition of symbol",0
dw 262
db "Symbol is multidefined",0
dw 263
db "Phase error between passes",0
dw 264
db "Already had ELSE clause",0
dw 265
db "Must be in conditional block",0
dw 266
db "Symbol not defined",0
dw 267
db "Syntax error",0
dw 268
db "Type illegal in context",0
dw 269
db "Group name must be unique",0
dw 270
db "Must be declared during Pass 1",0
dw 271
db "Illegal public declaration",0
dw 272
db "Symbol already different kind",0
dw 273
db "Reserved word used as symbol",0
dw 274
db "Forward reference illegal",0
dw 275
db "Operand must be register",0
dw 276
db "Wrong type of register",0
dw 277
db "Operand must be segment or group",0
dw 279
db "Operand must be type specifier",0
dw 280
db "Symbol already defined locally",0
dw 281
db "Segment parameters are changed",0
dw 282
db "Improper align/combine type",0
dw 283
db "Reference to multidefined symbol",0
dw 284
db "Operand expected",0
dw 285
db "Operator expected",0
dw 286
db "Division by 0 or overflow",0
dw 287
db "Negative shift count",0
dw 288
db "Operand types must match",0
dw 289
db "Illegal use of external",0
dw 291
db "Operand must be record or field name",0
dw 292
db "Operand must have size",0
dw 293
db "Extra NOP inserted",0
dw 295
db "Left operand must have segment",0
dw 296
db "One operand must be constant",0
dw 297
db "Operands must be in same segment, or one constant",0
dw 299
db "Constant expected",0
dw 300
db "Operand must have segment",0
dw 301
db "Must be associated with data",0
dw 302
db "Must be associated with code",0
dw 303
db "Multiple base registers",0
dw 304
db "Multiple index registers",0
dw 305
db "Must be index or base register",0
dw 306
db "Illegal use of register",0
dw 307
db "Value out of range",0
dw 308
db "Operand not in current CS ASSUME segment",0
dw 309
db "Improper operand type",0
dw 310
db "Jump out of range by %ld byte(s)",0
dw 312
db "Illegal register value",0
dw 313
db "Immediate mode illegal",0
dw 314
db "Illegal size for operand",0
dw 315
db "Byte register illegal",0
dw 316
db "Illegal use of CS register",0
dw 317
db "Must be accumulator register",0
dw 318
db "Improper use of segment register",0
dw 319
db "Missing or unreachable CS",0
dw 320
db "Operand combination illegal",0
dw 321
db "Near JMP/CALL to different CS",0
dw 322
db "Label cannot have segment override",0
dw 323
db "Must have instruction after prefix",0
dw 324
db "Cannot override ES for destination",0
dw 325
db "Cannot address with segment register",0
dw 326
db "Must be in segment block",0
dw 327
db "Illegal combination with segment alignment",0
dw 328
db "Forward needs override or FAR",0
dw 329
db "Illegal value for DUP count",0
dw 330
db "Symbol is already external",0
dw 331
db "DUP nesting too deep",0
dw 332
db "Illegal use of undefined operand (?)",0
dw 333
db "Too many values for struc or record initialization",0
dw 334
db "Angle brackets required around initialized list",0
dw 335
db "Directive illegal in structure",0
dw 336
db "Override with DUP illegal",0
dw 337
db "Field cannot be overridden",0
dw 340
db "Circular chain of EQU aliases",0
dw 341
db "Cannot emulate coprocessor opcode",0
dw 342
db "End of file, no END directive",0
dw 343
db "Data emitted with no segment",0
dw 344
db "Forced error - pass1",0
dw 345
db "Forced error - pass2",0
dw 346
db "Forced error",0
dw 347
db "Forced error - expression equals 0",0
dw 348
db "Forced error - expression not equal 0",0
dw 349
db "Forced error - symbol not defined",0
dw 350
db "Forced error - symbol defined",0
dw 351
db "Forced error - string blank",0
dw 352
db "Forced error - string not blank",0
dw 353
db "Forced error - strings identical",0
dw 354
db "Forced error - strings different",0
dw 355
db "Wrong length for override value ",0
dw 356
db "Line too long expanding symbol",0
dw 357
db "Impure memory reference",0
dw 358
db "Missing data; zero assumed",0
dw 359
db "Segment near (or at) 64K limit",0
dw 360
db "Cannot change processor in segment",0
dw 361
db "Operand size does not match segment word size",0
dw 362
db "Address size does not match segment word size",0
dw 363
db "Jump within short distance",0
dw 364
db "Align must be power of 2",0
dw 365
db "Expected",0
dw 366
db "Line too long",0
dw 367
db "Non-digit in number",0
dw 368
db "Empty string",0
dw 369
db "Missing operand",0
dw 370
db "Open parenthesis or bracket",0
dw 371
db "Not in macro expansion",0
dw 372
db "Unexpected end of line",0
dw 373
db "Include file not found",0
dw 401
db "a",9,9,"Alphabetize segments",0
dw 402
db "c",9,9,"Generate cross-reference",0
dw 403
db "d",9,9,"Generate pass 1 listing",0
dw 404
db "D<sym>[=<val>] Define symbol",0
dw 405
db "e",9,9,"Emulate floating point instructions and IEEE format",0
dw 406
db "I<path>",9,"Search directory for include files",0
dw 407
db "l[a]",9,9,"Generate listing, a-list all",0
dw 408
db "M{lxu}",9,9,"Preserve case of labels: l-All, x-Globals, u-Uppercase Globals",0
dw 409
db "n",9,9,"Suppress symbol tables in listing",0
dw 410
db "p",9,9,"Check for pure code",0
dw 411
db "s",9,9,"Order segments sequentially",0
dw 412
db "t",9,9,"Suppress messages for successful assembly",0
dw 413
db "v",9,9,"Display extra source statistics",0
dw 414
db "w{012}",9,9,"Set warning level: 0-None, 1-Serious, 2-Advisory",0
dw 415
db "X",9,9,"List false conditionals",0
dw 416
db "z",9,9,"Display source line for each error message",0
dw 417
db "Zi",9,9,"Generate symbolic information for CodeView",0
dw 418
db "Zd",9,9,"Generate line-number information",0
dw 430
db "Usage: masm /options source(.asm),[out(.obj)],[list(.lst)],[cref(.crf)][;]",0
dw 431
db "Usage: masm -Switches sourceFile -o objFile",0
dw 432
db "Run with -help for usage",0
FAR_MSG ends
end
|
specs/ada/common/tkmrpc-operations-ees.ads | DrenfongWong/tkm-rpc | 0 | 28056 |
package Tkmrpc.Operations.Ees is
Esa_Acquire : constant Operations.Operation_Type := 16#0100#;
Esa_Expire : constant Operations.Operation_Type := 16#0101#;
end Tkmrpc.Operations.Ees;
|
aunit/aunit.ads | btmalone/alog | 0 | 9273 | <reponame>btmalone/alog
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- A U N I T --
-- --
-- S p e c --
-- --
-- --
-- Copyright (C) 2006-2011, AdaCore --
-- --
-- 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 is maintained by AdaCore (http://www.adacore.com) --
-- --
------------------------------------------------------------------------------
-- Test Suite Framework
package AUnit is
type Message_String is access String;
subtype Test_String is Message_String;
type Status is (Success, Failure);
-- String manipulation functions.
function Format (S : String) return Message_String;
function Message_Alloc (Length : Natural) return Message_String;
procedure Message_Free (Msg : in out Message_String);
end AUnit;
|
src/core/asm/arm/thumb/inst_0xd0.asm | Hiroshi123/bin_tools | 0 | 247648 | <reponame>Hiroshi123/bin_tools
;;; 1101|1111
__0xdf_service_call:
ret
|
programs/oeis/243/A243501.asm | jmorken/loda | 1 | 171867 | <reponame>jmorken/loda<gh_stars>1-10
; A243501: Permutation of even numbers: a(n) = 2*A048673(n).
; 2,4,6,10,8,16,12,28,26,22,14,46,18,34,36,82,20,76,24,64,56,40,30,136,50,52,126,100,32,106,38,244,66,58,78,226,42,70,86,190,44,166,48,118,176,88,54,406,122,148,96,154,60,376,92,298,116,94,62,316,68,112,276,730,120,196,72,172,146,232,74,676,80,124,246,208,144,256,84,568,626,130,90,496,134,142,156,352,98,526,188,262,186,160,162,1216,102,364,326,442,104,286,108,460,386,178,110,1126,114,274,206,892,128,346,204,280,426,184,210,946,170,202,216,334,344,826,132,2188,236,358,138,586,254,214,876,514,140,436,150,694,266,220,222,2026,218,238,606,370,152,736,158,622,476,430,260,766,164,250,296,1702,320,1876,168,388,456,268,174,1486,290,400,576,424,180,466,540,1054,306,292,182,1576,192,562,336,784,288,556,248,478,1376,484,194,3646,198,304,596,1090,200,976,212,1324,356,310,342,856,302,322,726,1378,300,1156,224,532,366,328,330,3376,408,340,396,820,324,616,228,2674,1226,382,230,1036,234,610,716,838,240,1276,372,550,416,628,242,2836,252,508,3126,604,848,646,392,1000,446,1030
cal $0,3961 ; Completely multiplicative with a(prime(k)) = prime(k+1).
add $0,1
mov $1,$0
|
3_StoringDataToMemory.asm | furkanisitan/ExampleProgramsFor8085Microprocessor | 0 | 98881 | MVI A, 00FFH ; 00FFH verisini A ya yükle
MVI B, 10 ; 10 verisini B ye yükle
LXI H, 0200H ; 0200H verisini HL ye yükle
NXT: MOV M, A ; M(HL) ye A yı yükle
INX H ; HL yi 1 arttır
DCR B ; B yi 1 azalt
JNZ NXT ; 0 değilse NXT ye atla
HLT ; Sonlandır
; 0200H dan başlayarak ileri doğru 10 bellek boyunca
; tüm belleklerin içeriğine 00FFH ekler. |
arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral/src/demo_usart_dma_continuous.adb | rocher/Ada_Drivers_Library | 192 | 19687 | <reponame>rocher/Ada_Drivers_Library<gh_stars>100-1000
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, 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. --
-- --
------------------------------------------------------------------------------
-- The file declares the main procedure for the demonstration.
-- The main program uses the DMA controller to send a block of characters
-- to a USART. The characters are sent continuously as long as the program
-- executes. Note that all the LEDs flash initially, before any characters
-- are sent, as a confirmation of overall execution.
with STM32; use STM32;
with STM32.DMA; use STM32.DMA;
with STM32.GPIO; use STM32.GPIO;
with STM32.USARTs; use STM32.USARTs;
with STM32.Device; use STM32.Device;
with STM32.Board; use STM32.Board;
with Ada.Real_Time; use Ada.Real_Time;
with Peripherals; use Peripherals;
procedure Demo_USART_DMA_Continuous is
type Data is array (1 .. 26) of Character; -- arbitrary size, component type
for Data'Component_Size use 8; -- confirming
Bytes_To_Transfer : constant := Data'Length;
Source_Block : constant Data := "abcdefghijklmnopqrstuvwxyz";
procedure Initialize_GPIO_Port_Pins;
procedure Initialize_USART;
procedure Initialize_DMA;
procedure Blink_LEDs;
-------------------------------
-- Initialize_GPIO_Port_Pins --
-------------------------------
procedure Initialize_GPIO_Port_Pins is
begin
Enable_Clock (RX_Pin & TX_Pin);
Configure_IO
(RX_Pin & TX_Pin,
(Mode => Mode_AF,
AF => Transceiver_AF,
AF_Speed => Speed_50MHz,
AF_Output_Type => Push_Pull,
Resistors => Pull_Up));
end Initialize_GPIO_Port_Pins;
----------------------
-- Initialize_USART --
----------------------
procedure Initialize_USART is
begin
Enable_Clock (Transceiver);
Enable (Transceiver);
Set_Baud_Rate (Transceiver, 115_200);
Set_Mode (Transceiver, Tx_Mode);
Set_Stop_Bits (Transceiver, Stopbits_1);
Set_Word_Length (Transceiver, Word_Length_8);
Set_Parity (Transceiver, No_Parity);
Set_Flow_Control (Transceiver, No_Flow_Control);
end Initialize_USART;
--------------------
-- Initialize_DMA --
--------------------
procedure Initialize_DMA is
Configuration : DMA_Stream_Configuration;
begin
Enable_Clock (Controller);
Reset (Controller, Tx_Stream);
Configuration.Channel := Tx_Channel;
Configuration.Direction := Memory_To_Peripheral;
Configuration.Increment_Peripheral_Address := False;
Configuration.Increment_Memory_Address := True;
Configuration.Peripheral_Data_Format := Bytes;
Configuration.Memory_Data_Format := Bytes;
Configuration.Operation_Mode := Circular_Mode;
Configuration.Priority := Priority_Very_High;
Configuration.FIFO_Enabled := True;
Configuration.FIFO_Threshold := FIFO_Threshold_Full_Configuration;
Configuration.Memory_Burst_Size := Memory_Burst_Inc4;
Configuration.Peripheral_Burst_Size := Peripheral_Burst_Single;
Configure (Controller, Tx_Stream, Configuration);
-- note the controller is disabled by the call to Configure
end Initialize_DMA;
----------------
-- Blink_LEDs --
----------------
procedure Blink_LEDs is
begin
for K in 1 .. 3 loop
All_LEDs_On;
delay until Clock + Milliseconds (200);
All_LEDs_Off;
delay until Clock + Milliseconds (200);
end loop;
end Blink_LEDs;
begin
Initialize_LEDs;
Blink_LEDs; -- just to signal that we are indeed running...
Initialize_GPIO_Port_Pins;
Initialize_USART;
Initialize_DMA;
Enable (Transceiver);
Start_Transfer
(Controller,
Tx_Stream,
Source => Source_Block'Address,
Destination => Data_Register_Address (Transceiver),
Data_Count => Bytes_To_Transfer);
-- also enables the stream
Enable_DMA_Transmit_Requests (Transceiver);
-- at this point the characters will be coming continuously from the USART
Turn_On (Green_LED);
loop
null;
end loop;
end Demo_USART_DMA_Continuous;
|
programs/oeis/178/A178445.asm | neoneye/loda | 22 | 105279 | <filename>programs/oeis/178/A178445.asm
; A178445: Prime(n)^2 mod n^2.
; 0,1,7,1,21,25,44,41,43,41,114,73,160,85,184,249,13,157,157,241,37,433,12,433,34,61,403,473,107,169,753,777,256,825,151,769,7,577,511,1129,102,1009,1350,465,334,1513,341,1345,1108,2441
mov $2,$0
mul $0,2
mov $4,2
lpb $4
seq $0,173919 ; Numbers that are prime or one less than a prime.
mov $1,$0
pow $1,2
add $2,1
pow $2,$4
mod $1,$2
mov $4,$3
lpe
mov $0,$1
|
maps/Route31.asm | pokeachromicdevs/pokeoctober | 1 | 246876 | object_const_def ; object_event constants
const ROUTE31_FISHER
const ROUTE31_YOUNGSTER
const ROUTE31_SUPER_NERD
const ROUTE31_COOLTRAINER_M
const ROUTE31_FRUIT_TREE
const ROUTE31_POKE_BALL1
const ROUTE31_POKE_BALL2
Route31_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_NEWMAP, .CheckMomCall
.CheckMomCall:
checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
iffalse .DoMomCall
return
.DoMomCall:
specialphonecall SPECIALCALL_WORRIED
return
TrainerInstructorStanley:
trainer INSTRUCTOR, STANLEY, EVENT_BEAT_INSTRUCTOR_STANLEY, InstructorStanley1SeenText, InstructorStanley1BeatenText, 0, .Script
.Script:
loadvar VAR_CALLERID, PHONE_INSTRUCTOR_STANLEY
endifjustbattled
opentext
checkflag ENGINE_STANLEY
iftrue .WadeRematch
checkflag ENGINE_STANLEY_HAS_ITEM
iftrue .WadeItem
checkcellnum PHONE_INSTRUCTOR_STANLEY
iftrue .AcceptedNumberSTD
checkevent EVENT_STANLEY_ASKED_FOR_PHONE_NUMBER
iftrue .AskAgain
writetext InstructorStanley1AfterText
waitbutton
setevent EVENT_STANLEY_ASKED_FOR_PHONE_NUMBER
scall .AskPhoneNumberSTD
sjump .Continue
.AskAgain:
scall .AskAgainSTD
.Continue:
askforphonenumber PHONE_INSTRUCTOR_STANLEY
ifequal PHONE_CONTACTS_FULL, .PhoneFullSTD
ifequal PHONE_CONTACT_REFUSED, .DeclinedNumberSTD
gettrainername STRING_BUFFER_3, BUG_CATCHER, STANLEY1
scall .RegisterNumberSTD
sjump .AcceptedNumberSTD
.WadeRematch:
scall .RematchSTD
winlosstext InstructorStanley1BeatenText, 0
readmem wWadeFightCount
ifequal 4, .Fight4
ifequal 3, .Fight3
ifequal 2, .Fight2
ifequal 1, .Fight1
ifequal 0, .LoadFight0
.Fight4:
checkevent EVENT_BEAT_ELITE_FOUR
iftrue .LoadFight4
.Fight3:
checkevent EVENT_CLEARED_RADIO_TOWER
iftrue .LoadFight3
.Fight2:
checkflag ENGINE_FLYPOINT_MAHOGANY
iftrue .LoadFight2
.Fight1:
checkflag ENGINE_FLYPOINT_GOLDENROD
iftrue .LoadFight1
.LoadFight0:
loadtrainer INSTRUCTOR, STANLEY
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 1
clearflag ENGINE_STANLEY
end
.LoadFight1:
loadtrainer BUG_CATCHER, STANLEY2
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 2
clearflag ENGINE_STANLEY
end
.LoadFight2:
loadtrainer BUG_CATCHER, STANLEY3
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 3
clearflag ENGINE_STANLEY
end
.LoadFight3:
loadtrainer BUG_CATCHER, STANLEY4
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 4
clearflag ENGINE_STANLEY
end
.LoadFight4:
loadtrainer INSTRUCTOR, STANLEY
startbattle
reloadmapafterbattle
clearflag ENGINE_STANLEY
end
.WadeItem:
scall .ItemSTD
checkevent EVENT_STANLEY_HAS_BERRY
iftrue .Berry
checkevent EVENT_STANLEY_HAS_PSNCUREBERRY
iftrue .Psncureberry
checkevent EVENT_STANLEY_HAS_PRZCUREBERRY
iftrue .Przcureberry
checkevent EVENT_STANLEY_HAS_BITTER_BERRY
iftrue .BitterBerry
.Berry:
verbosegiveitem BERRY
iffalse .PackFull
sjump .Done
.Psncureberry:
verbosegiveitem PSNCUREBERRY
iffalse .PackFull
sjump .Done
.Przcureberry:
verbosegiveitem PRZCUREBERRY
iffalse .PackFull
sjump .Done
.BitterBerry:
verbosegiveitem BITTER_BERRY
iffalse .PackFull
.Done:
clearflag ENGINE_STANLEY_HAS_ITEM
sjump .AcceptedNumberSTD
.PackFull:
sjump .PackFullSTD
.AskPhoneNumberSTD:
jumpstd asknumber1m
end
.AskAgainSTD:
jumpstd asknumber2m
end
.RegisterNumberSTD:
jumpstd registerednumberm
end
.AcceptedNumberSTD:
jumpstd numberacceptedm
end
.DeclinedNumberSTD:
jumpstd numberdeclinedm
end
.PhoneFullSTD:
jumpstd phonefullm
end
.RematchSTD:
jumpstd rematchm
end
.ItemSTD:
jumpstd giftm
end
.PackFullSTD:
jumpstd packfullm
end
Route31MailRecipientScript:
faceplayer
opentext
checkevent EVENT_GOT_TM50_NIGHTMARE
iftrue .DescribeNightmare
checkevent EVENT_GOT_KENYA
iftrue .TryGiveKenya
writetext Text_Route31SleepyMan
waitbutton
closetext
end
.TryGiveKenya:
writetext Text_Route31SleepyManGotMail
buttonsound
checkpokemail ReceivedSpearowMailText
ifequal POKEMAIL_WRONG_MAIL, .WrongMail
ifequal POKEMAIL_REFUSED, .Refused
ifequal POKEMAIL_NO_MAIL, .NoMail
ifequal POKEMAIL_LAST_MON, .LastMon
; POKEMAIL_CORRECT
writetext Text_Route31HandOverMailMon
buttonsound
writetext Text_Route31ReadingMail
buttonsound
setevent EVENT_GAVE_KENYA
verbosegiveitem TM_NIGHTMARE
iffalse .NoRoomForItems
setevent EVENT_GOT_TM50_NIGHTMARE
.DescribeNightmare:
writetext Text_Route31DescribeNightmare
waitbutton
.NoRoomForItems:
closetext
end
.WrongMail:
writetext Text_Route31WrongMail
waitbutton
closetext
end
.NoMail:
writetext Text_Route31MissingMail
waitbutton
closetext
end
.Refused:
writetext Text_Route31DeclinedToHandOverMail
waitbutton
closetext
end
.LastMon:
writetext Text_Route31CantTakeLastMon
waitbutton
closetext
end
ReceivedSpearowMailText:
db "DARK CAVE leads"
next "to another road@"
Route31YoungsterScript:
jumptextfaceplayer Route31YoungsterText
Route31Sign:
jumptext Route31SignText
DarkCaveSign:
jumptext MrPokemonHouseText
Route31CooltrainerMScript:
jumptextfaceplayer Route31CooltrainerMText
Route31FruitTree:
fruittree FRUITTREE_ROUTE_31
Route31Potion:
itemball POTION
Route31PokeBall:
itemball POKE_BALL
Route31CooltrainerMText:
text "DARK CAVE…"
para "If #MON could"
line "light it up, I'd"
cont "explore it."
done
InstructorStanley1SeenText:
text "Do you want to"
line "learn about"
cont "BERRIES?"
done
InstructorStanley1BeatenText:
text "Oh…I guess not…"
done
InstructorStanley1AfterText:
text "We take kids out"
line "here for some"
para "experience out in"
line "the real world"
para "pretty frequently."
done
Text_Route31SleepyMan:
text "… Hnuurg… Huh?"
para "I walked too far"
line "today looking for"
cont "#MON."
para "My feet hurt and"
line "I'm sleepy…"
para "If I were a wild"
line "#MON, I'd be"
cont "easy to catch…"
para "…Zzzz…"
done
Text_Route31SleepyManGotMail:
text "…Zzzz… Huh?"
para "What's that? You"
line "have MAIL for me?"
done
Text_Route31HandOverMailMon:
text "<PLAYER> handed"
line "over the #MON"
cont "holding the MAIL."
done
Text_Route31ReadingMail:
text "Let's see…"
para "…DARK CAVE leads"
line "to another road…"
para "That's good to"
line "know."
para "Thanks for bring-"
line "ing this to me."
para "My friend's a good"
line "guy, and you're"
cont "swell too!"
para "I'd like to do"
line "something good in"
cont "return too!"
para "I know! I want you"
line "to have this!"
done
Text_Route31DescribeNightmare:
text "TM50 is NIGHTMARE."
para "It's a wicked move"
line "that steadily cuts"
para "the HP of a sleep-"
line "ing enemy."
para "Ooooh…"
line "That's scary…"
para "I don't want to"
line "have bad dreams."
done
Text_Route31WrongMail:
text "This MAIL isn't"
line "for me."
done
Text_Route31MissingMail:
text "Why is this #-"
line "MON so special?"
para "It doesn't have"
line "any MAIL."
done
Text_Route31DeclinedToHandOverMail:
text "What? You don't"
line "want anything?"
done
Text_Route31CantTakeLastMon:
text "If I take that"
line "#MON from you,"
para "what are you going"
line "to use in battle?"
done
Route31YoungsterText:
text "I found a good"
line "#MON in DARK"
cont "CAVE."
para "I'm going to raise"
line "it to take on"
cont "FALKNER."
para "He's the leader of"
line "VIOLET CITY's GYM."
done
Route31SignText:
text "ROUTE 31"
para "VIOLET CITY -"
line "CHERRYGROVE CITY"
done
MrPokemonHouseText:
text "MR. #MON's"
line "HOUSE"
done
Route31_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 21, 3, MR_POKEMONS_HOUSE, 1
warp_event 1, 4, ROUTE_31_VIOLET_GATE, 4
db 0 ; coord events
db 1 ; bg events
bg_event 19, 3, BGEVENT_READ, MrPokemonHouseText
db 7 ; object events
object_event 13, 8, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31MailRecipientScript, -1
object_event 28, 9, SPRITE_YOUNGSTER, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31YoungsterScript, -1
object_event 27, 13, SPRITE_SUPER_NERD, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_BROWN, OBJECTTYPE_TRAINER, 5, TrainerInstructorStanley, -1
object_event 33, 8, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31CooltrainerMScript, -1
object_event 9, 8, SPRITE_FRUIT_TREE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31FruitTree, -1
object_event 35, 5, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route31Potion, EVENT_ROUTE_31_POTION
object_event 36, 9, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route31PokeBall, EVENT_ROUTE_31_POKE_BALL
|
verify/alfy/2_simple/symbol.alfy.asm | alexandruradovici/alf-alfy-asm-public | 0 | 101679 |
; script
start:
; attribution
; value symbol s
set r2 's'
; c: r3
set r3 0
store r3 r2
; attribution
; expression +
; c: r3
set r3 0
load r3 r3
; value int 6
set r4 6
; typecast int symbol
add r2 r3 r4
; c: r3
set r3 0
; typecast symbol int
set r5 0x00000000000000FF
and r4 r2 r5
store r3 r4
; asm
; c: r2
set r2 0
load r2 r2
write r2
stop |
programs/oeis/016/A016248.asm | neoneye/loda | 22 | 19390 | <gh_stars>10-100
; A016248: Expansion of 1/((1-x)(1-6x)(1-12x)).
; 1,19,271,3511,43687,533575,6458887,77842567,936126343,11245609351,135019871623,1620673815943,19450697930119,233424047994247,2801182612927879,33614755577116039,403380452257281415
lpb $0
mov $2,$0
sub $0,1
seq $2,16175 ; Expansion of 1/((1-6x)(1-12x)).
add $1,$2
lpe
add $1,1
mov $0,$1
|
oeis/063/A063930.asm | neoneye/loda-programs | 11 | 104977 | ; A063930: Radius of B-excircle of Pythagorean triangle with a=(n+1)^2-m^2, b=2*(n+1)*m and c=(n+1)^2+m^2.
; Submitted by <NAME>
; 3,4,10,5,12,21,6,14,24,36,7,16,27,40,55,8,18,30,44,60,78,9,20,33,48,65,84,105,10,22,36,52,70,90,112,136,11,24,39,56,75,96,119,144,171,12,26,42,60,80,102,126,152,180,210,13,28,45,64,85,108,133,160,189,220
lpb $0
mov $1,$0
sub $0,1
sub $0,$2
add $2,1
lpe
add $0,1
add $1,3
mul $0,$1
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_743.asm | ljhsiun2/medusa | 9 | 246346 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %r8
push %rcx
push %rdi
// Store
lea addresses_UC+0x1e6f4, %r12
clflush (%r12)
nop
nop
nop
nop
and $53816, %rcx
movw $0x5152, (%r12)
nop
nop
nop
nop
cmp $43040, %r10
// Faulty Load
lea addresses_WT+0x154b0, %r13
nop
nop
add $7746, %rdi
mov (%r13), %r10d
lea oracles, %r8
and $0xff, %r10
shlq $12, %r10
mov (%r8,%r10,1), %r10
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
oeis/216/A216754.asm | neoneye/loda-programs | 11 | 10082 | ; A216754: Digital root of fourth power of Fibonacci numbers.
; Submitted by <NAME>(s2)
; 0,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7,9,4,1,4,9,7,1,1,9,1,1,7
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
pow $0,4
sub $0,1
lpb $0
mod $0,9
lpe
add $0,1
|
compiler/ti-cgt-arm_18.12.4.LTS/lib/src/fs_add16.asm | JosiahCraw/TI-Arm-Docker | 0 | 165213 | ;******************************************************************************
;* FS_ADD16.ASM - 16 BIT STATE - *
;* *
;* Copyright (c) 1996 Texas Instruments Incorporated *
;* http://www.ti.com/ *
;* *
;* 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 Texas Instruments Incorporated nor the names *
;* of its contributors may be used to endorse or promote products *
;* derived from this software without specific prior written *
;* permission. *
;* *
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
;* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
;* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
;* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
;* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
;* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
;* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
;* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
;* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
;* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
;* *
;******************************************************************************
;*****************************************************************************
;* FS$ADD/FS$SUB - ADD/SUBTRACT TWO IEEE 754 FORMAT SINGLE PRECISION FLOATING
;* POINT NUMBERS.
;*****************************************************************************
;*
;* o INPUT OP1 IS IN r0
;* o INPUT OP2 IS IN r1
;* o RESULT IS RETURNED IN r0
;* o FOR SUBTRACTION, INPUT OP2 IN r1 IS KILLED
;*
;* o SUBTRACTION, OP1 - OP2, IS IMPLEMENTED WITH ADDITION, OP1 + (-OP2)
;* o SIGNALLING NOT-A-NUMBER (SNaN) AND QUIET NOT-A-NUMBER (QNaN)
;* ARE TREATED AS INFINITY
;* o OVERFLOW RETURNS +/- INFINITY (0x7f800000/ff800000)
;* o DENORMALIZED NUMBERS ARE TREATED AS UNDERFLOWS
;* o UNDERFLOW RETURNS ZERO (0x00000000)
;* o ROUNDING MODE: ROUND TO NEAREST (TIE TO EVEN)
;*
;* o IF OPERATION INVOLVES INFINITY AS AN INPUT, THE FOLLOWING SUMMARIZES
;* THE RESULT:
;* +----------+----------+----------+
;* ADDITION + OP2 !INF | OP2 -INF + OP2 +INF +
;* +----------+==========+==========+==========+
;* + OP1 !INF + - | -INF + +INF +
;* +----------+----------+----------+----------+
;* + OP1 -INF + -INF | -INF + -INF +
;* +----------+----------+----------+----------+
;* + OP1 +INF + +INF | +INF + +INF +
;* +----------+----------+----------+----------+
;*
;* +----------+----------+----------+
;* SUBTRACTION + OP2 !INF | OP2 -INF + OP2 +INF +
;* +----------+==========+==========+==========+
;* + OP1 !INF + - | +INF + -INF +
;* +----------+----------+----------+----------+
;* + OP1 -INF + -INF | -INF + -INF +
;* +----------+----------+----------+----------+
;* + OP1 +INF + +INF | +INF + +INF +
;* +----------+----------+----------+----------+
;*
;****************************************************************************
;*
;* +--------------------------------------------------------------+
;* | SINGLE PRECISION FLOATING POINT FORMAT |
;* | |
;* | 31 30 23 22 0 |
;* | +-+--------+-----------------------+ |
;* | |S| E | M + |
;* | +-+--------+-----------------------+ |
;* | |
;* | <S> SIGN FIELD : 0 - POSITIVE VALUE |
;* | 1 - NEGATIVE VALUE |
;* | |
;* | <E> EXPONENT FIELD: 00 - ZERO IFF M == 0 |
;* | 01...FE - EXPONENT VALUE (127 BIAS) |
;* | FF - INFINITY |
;* | |
;* | <M> MANTISSA FIELD: FRACTIONAL MAGNITUDE WITH IMPLIED 1 |
;* +--------------------------------------------------------------+
;*
;****************************************************************************
.thumb
.if __TI_EABI_ASSEMBLER ; ASSIGN EXTERNAL NAMES BASED ON
.asg __aeabi_fadd, __TI_FS$ADD ; RTS BEING BUILT
.asg __aeabi_fsub, __TI_FS$SUB
.else
.clink
.asg FS$ADD, __TI_FS$ADD
.asg FS$SUB, __TI_FS$SUB
.endif
.global __TI_FS$ADD
.global __TI_FS$SUB
m0 .set r2
e0 .set r3
m1 .set r4
e1 .set r5
shift .set r6
tmp .set r7
.if __TI_ARM9ABI_ASSEMBLER | __TI_EABI_ASSEMBLER
.thumbfunc __TI_FS$ADD
.thumbfunc __TI_FS$SUB
.endif
__TI_FS$SUB: .asmfunc stack_usage(24)
PUSH {r2-r7} ;
MOVS tmp, #1 ;
LSLS tmp, tmp, #31 ;
EORS r1, tmp ; NEGATE INPUT #2
B $1 ;
__TI_FS$ADD: PUSH {r2-r7} ;
MOVS tmp, #1 ;
LSLS tmp, tmp, #31 ;
$1: LSLS m1, r1, #8 ; PUT INPUT #2 MANTISSA IN m1
LSLS e1, r1, #1 ; PUT INPUT #2 EXPONENT IN e1
LSRS e1, e1, #24 ;
BNE $2 ;
CMP m1, #0 ; IF DENORMALIZED NUMBER (m0 != 0 AND
BNE unfl ; e1 == 0), THEN UNDERFLOW
POP {r2-r7} ; ELSE IT IS ZERO SO RETURN INPUT #1
BX lr ;
$2: ORRS m1, tmp ; SET IMPLIED ONE IN MANTISSA
CMP e1, #0xFF ; IF e1 == 0xFF, THEN OVERFLOW
BEQ ovfl1 ;
LSRS m1, m1, #2 ; ADJUST THE MANTISSA
CMP r1, #0 ; IF INPUT #2 IS NEGATIVE,
BPL $3 ;
NEGS m1, m1 ; THEN NEGATE THE MANTISSA
$3: LSLS m0, r0, #8 ; PUT INPUT #1 MANTISSA IN m0
LSLS e0, r0, #1 ; PUT INPUT #1 EXPONENT IN e0
LSRS e0, e0, #24 ;
BNE $4 ;
CMP m0, #0 ; IF A DENORMALIZED NUMBER
BNE unfl ; (m0 != 0 AND e0 == 0), THEN UNDERFLOW
MOVS r0, r1 ; ELSE IT IS ZERO SO RETURN INPUT #2
POP {r2-r7} ;
BX lr ;
$4: ORRS m0, tmp ; SET IMPLIED ONE IN MANTISSA
CMP e0, #0xFF ; IF e0 == 0xFF, THEN OVERFLOW
BEQ ovfl0 ;
LSRS m0, m0, #2 ; ADJUST THE MANTISSA
CMP r0, #0 ; IF INPUT #1 IS NEGATIVE,
BPL $5 ;
NEGS m0, m0 ; THEN NEGATE THE MANTISSA
$5: SUBS shift, e0, e1 ; GET THE SHIFT AMOUNT
BPL $6 ;
MOVS tmp, m0 ; IF THE SHIFT AMOUNT IS NEGATIVE, THEN
MOVS m0, m1 ; SWAP THE TWO MANTISSA SO THAT m0
MOVS m1, tmp ; CONTAINS THE LARGER VALUE,
NEGS shift, shift ; AND NEGATE THE SHIFT AMOUNT,
MOVS e0, e1 ; AND ENSURE THE LARGER EXP. IS IN e0
$6: CMP shift, #25 ; IF THE SECOND MANTISSA IS SIGNIFICANT,
BPL $7 ;
MOVS tmp, m1
ASRS tmp, shift ; ADD IT TO THE FIRST MANTISSA
ADDS m0, tmp ;
sticky .set m1 ; USE M1 TO HOLD THE STICKY BIT
MOVS tmp, #28 ; CALCULATE STICKY BIT
SUBS tmp, shift, tmp ;
RSBS tmp, tmp, #0 ;
LSLS sticky, tmp ; GET THE BITS THAT WERE SHIFTED OUT
$7: CMP m0, #0x0 ; IF THE RESULT IS ZERO,
BEQ unfl ; THEN UNDERFLOW
BPL $8 ;
NEGS m0, m0 ; IF THE RESULT IS NEGATIVE, THEN
MOVS tmp, #0x1 ; NEGATE THE RESULT AND
B loop ;
$8: MOVS tmp, #0x0 ; NOTE THE SIGN
loop: SUBS e0, #1 ; NORMALIZE THE RESULTING MANTISSA
LSLS m0, m0, #1 ; ADJUSTING THE EXPONENT AS NECESSARY
BPL loop ;
MOVS e1, m0 ; COPY MANTISSA
MOVS shift, #0x80 ;
ANDS e1, shift ; CHECK IF GUARD BIT IS SET
BEQ $9 ; IF GUARD BIT == 0, DO NOT ROUND
MOVS e1, m0 ; COPY MANTISSA
MOVS shift, #0x20 ;
ANDS e1, shift ; IF RESULT REQUIRED NORMALIZATION
ORRS sticky, e1 ; BIT 26 MUST BE ADDED TO STICKY
ADDS m0, #0x80 ; ROUND THE MANTISSA TO THE NEAREST
BCS $9a ; OVERFLOW
MOVS e1, m0 ; COPY MANTISSA
MOVS shift, #0x40 ;
ANDS e1, shift ; GET ROUND BIT
ORRS sticky, e1 ; (ROUND + STICKY)
BNE $9 ; IF (ROUND + STICKY)==1, M0 IS CORRECT
MOVS shift, #0x1 ; IF (ROUND + STICKY)==0,
LSLS shift, shift, #8 ; M0 MUST BE EVEN
BICS m0, shift ; CLEAR LAST BIT
B $9
$9a: ADDS e0, e0, #1 ; ADJUST EXPONENT IF AN OVERFLOW OCCURS
$9: LSLS m0, m0, #1 ; REMOVE THE IMPLIED ONE
ADDS e0, #2 ; NORMALIZE THE EXPONENT
BLE unfl ; CHECK FOR UNDERFLOW
CMP e0, #0xFF ;
BCS ovfl ; CHECK FOR OVERFLOW
LSRS r0, m0, #9 ; REPACK THE MANTISSA INTO r0
LSLS e0, e0, #23 ;
ORRS r0, e0 ; REPACK THE EXPONENT INTO r0
LSLS tmp, tmp, #31 ;
ORRS r0, tmp ; REPACK THE SIGN INTO r0
POP {r2-r7} ;
BX lr ;
unfl: MOVS r0, #0 ; UNDERFLOW
POP {r2-r7} ;
BX lr ;
; OVERFLOW
ovfl1: MOVS r0, r1 ; SIGN BIT in R1
ovfl0: LSRS tmp, r0, #31 ; ISOLATE SIGN BIT
ovfl: LSLS tmp, tmp, #31 ;
MOVS r0, #0ffh ; EXPONENT = Emax = 255
LSLS r0, r0, #23 ; SHIFT EXPONENT INTO PLACE
ORRS r0, tmp ; COMBINE WITH SIGN BIT
POP {r2-r7} ;
BX lr ;
.endasmfunc
.end
|
programs/oeis/135/A135497.asm | neoneye/loda | 22 | 82427 | ; A135497: a(n) = n^5 - n^2.
; 0,0,28,234,1008,3100,7740,16758,32704,58968,99900,160930,248688,371124,537628,759150,1048320,1419568,1889244,2475738,3199600,4083660,5153148,6435814,7962048,9765000,11880700,14348178,17209584,20510308,24299100,28628190,33553408,39134304,45434268,52520650,60464880,69342588,79233724,90222678,102398400,115854520,130689468,147006594,164914288,184526100,205960860,229342798,254801664,282472848,312497500,345022650,380201328,418192684,459162108,503281350,550728640,601688808,656353404,714920818,777596400,844592580,916128988,992432574,1073737728,1160286400,1252328220,1350120618,1453928944,1564026588,1680695100,1804224310,1934912448,2073066264,2219001148,2373041250,2535519600,2706778228,2887168284,3077050158,3276793600,3486777840,3707391708,3939033754,4182112368,4437045900,4704262780,4984201638,5277311424,5584051528,5904891900,6240313170,6590806768,6956875044,7339031388,7737800350,8153717760,8587330848,9039198364,9509890698
mov $1,$0
pow $0,5
pow $1,2
sub $0,$1
|
source/nodes/program-nodes-operator_symbols.adb | reznikmm/gela | 0 | 8151 | <reponame>reznikmm/gela
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Operator_Symbols is
function Create
(Operator_Symbol_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Operator_Symbol is
begin
return Result : Operator_Symbol :=
(Operator_Symbol_Token => Operator_Symbol_Token,
Corresponding_Defining_Operator_Symbol => null,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Operator_Symbol is
begin
return Result : Implicit_Operator_Symbol :=
(Corresponding_Defining_Operator_Symbol => null,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Corresponding_Defining_Operator_Symbol
(Self : Base_Operator_Symbol)
return Program.Elements.Defining_Operator_Symbols
.Defining_Operator_Symbol_Access is
begin
return Self.Corresponding_Defining_Operator_Symbol;
end Corresponding_Defining_Operator_Symbol;
overriding function Operator_Symbol_Token
(Self : Operator_Symbol)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Operator_Symbol_Token;
end Operator_Symbol_Token;
overriding function Image (Self : Operator_Symbol) return Text is
begin
return Self.Operator_Symbol_Token.Image;
end Image;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Operator_Symbol)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Operator_Symbol)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Operator_Symbol)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
overriding function Image (Self : Implicit_Operator_Symbol) return Text is
pragma Unreferenced (Self);
begin
return "";
end Image;
procedure Initialize (Self : in out Base_Operator_Symbol'Class) is
begin
null;
end Initialize;
overriding function Is_Operator_Symbol
(Self : Base_Operator_Symbol)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Operator_Symbol;
overriding function Is_Expression
(Self : Base_Operator_Symbol)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Expression;
overriding procedure Visit
(Self : not null access Base_Operator_Symbol;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Operator_Symbol (Self);
end Visit;
overriding function To_Operator_Symbol_Text
(Self : in out Operator_Symbol)
return Program.Elements.Operator_Symbols.Operator_Symbol_Text_Access is
begin
return Self'Unchecked_Access;
end To_Operator_Symbol_Text;
overriding function To_Operator_Symbol_Text
(Self : in out Implicit_Operator_Symbol)
return Program.Elements.Operator_Symbols.Operator_Symbol_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Operator_Symbol_Text;
end Program.Nodes.Operator_Symbols;
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_1.asm | ljhsiun2/medusa | 9 | 11896 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x16390, %rsi
lea addresses_WC_ht+0x16196, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r14, %r14
mov $33, %rcx
rep movsw
nop
nop
sub %r9, %r9
lea addresses_A_ht+0x10f16, %rbx
clflush (%rbx)
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %r14
movq %r14, %xmm4
and $0xffffffffffffffc0, %rbx
movaps %xmm4, (%rbx)
xor $13805, %rbp
lea addresses_A_ht+0x15ca6, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
and $24977, %rbx
mov (%rsi), %edi
nop
nop
nop
add %r9, %r9
lea addresses_UC_ht+0x18996, %rsi
lea addresses_UC_ht+0x185f6, %rdi
clflush (%rsi)
xor $63650, %rdx
mov $44, %rcx
rep movsb
nop
nop
sub %rbx, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rbx
push %rdx
// Faulty Load
lea addresses_normal+0x1d196, %r9
nop
nop
cmp %rbx, %rbx
mov (%r9), %r15w
lea oracles, %rbx
and $0xff, %r15
shlq $12, %r15
mov (%rbx,%r15,1), %r15
pop %rdx
pop %rbx
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
release/src/router/gmp/mpn/x86/k7/gcd_1.asm | ghsecuritylab/Toastman-Tinc | 5 | 244444 | <filename>release/src/router/gmp/mpn/x86/k7/gcd_1.asm<gh_stars>1-10
dnl x86 mpn_gcd_1 optimised for AMD K7.
dnl Contributed to the GNU project by by <NAME>. Rehacked by Torbjorn
dnl Granlund.
dnl Copyright 2000-2002, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/bit (approx)
C AMD K7 5.31
C AMD K8,K9 5.33
C AMD K10 5.30
C AMD bd1 ?
C AMD bobcat 7.02
C Intel P4-2 10.1
C Intel P4-3/4 10.0
C Intel P6/13 5.88
C Intel core2 6.26
C Intel NHM 6.83
C Intel SBR 8.50
C Intel atom 8.90
C VIA nano ?
C Numbers measured with: speed -CD -s16-32 -t16 mpn_gcd_1
C TODO
C * Tune overhead, this takes 2-3 cycles more than old code when v0 is tiny.
C * Stream things better through registers, avoiding some copying.
C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
deflit(MAXSHIFT, 6)
deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
DEF_OBJECT(ctz_table,64)
.byte MAXSHIFT
forloop(i,1,MASK,
` .byte m4_count_trailing_zeros(i)
')
END_OBJECT(ctz_table)
C Threshold of when to call bmod when U is one limb. Should be about
C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
define(`DIV_THRES_LOG2', 7)
define(`up', `%edi')
define(`n', `%esi')
define(`v0', `%edx')
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_gcd_1)
push %edi
push %esi
mov 12(%esp), up
mov 16(%esp), n
mov 20(%esp), v0
mov (up), %eax C U low limb
or v0, %eax C x | y
mov $-1, %ecx
L(twos):
inc %ecx
shr %eax
jnc L(twos)
shr %cl, v0
mov %ecx, %eax C common twos
L(divide_strip_y):
shr v0
jnc L(divide_strip_y)
adc v0, v0
push %eax
push v0
cmp $1, n
jnz L(reduce_nby1)
C Both U and V are single limbs, reduce with bmod if u0 >> v0.
mov (up), %ecx
mov %ecx, %eax
shr $DIV_THRES_LOG2, %ecx
cmp %ecx, v0
ja L(reduced)
mov v0, %esi
xor %edx, %edx
div %esi
mov %edx, %eax
jmp L(reduced)
L(reduce_nby1):
ifdef(`PIC_WITH_EBX',`
push %ebx
call L(movl_eip_to_ebx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
')
push v0 C param 3
push n C param 2
push up C param 1
cmp $BMOD_1_TO_MOD_1_THRESHOLD, n
jl L(bmod)
CALL( mpn_mod_1)
jmp L(called)
L(bmod):
CALL( mpn_modexact_1_odd)
L(called):
add $12, %esp C deallocate params
ifdef(`PIC_WITH_EBX',`
pop %ebx
')
L(reduced):
pop %edx
LEA( ctz_table, %esi)
test %eax, %eax
mov %eax, %ecx
jnz L(mid)
jmp L(end)
ALIGN(16) C K8 BC P4 NHM SBR
L(top): cmovc( %ecx, %eax) C if x-y < 0 0
cmovc( %edi, %edx) C use x,y-x 0
L(mid): and $MASK, %ecx C 0
movzbl (%esi,%ecx), %ecx C 1
jz L(shift_alot) C 1
shr %cl, %eax C 3
mov %eax, %edi C 4
mov %edx, %ecx C 3
sub %eax, %ecx C 4
sub %edx, %eax C 4
jnz L(top) C 5
L(end): pop %ecx
mov %edx, %eax
shl %cl, %eax
pop %esi
pop %edi
ret
L(shift_alot):
shr $MAXSHIFT, %eax
mov %eax, %ecx
jmp L(mid)
ifdef(`PIC_WITH_EBX',`
L(movl_eip_to_ebx):
mov (%esp), %ebx
ret
')
EPILOGUE()
|
lib/aflexnat/ecs.ads | alvaromb/Compilemon | 1 | 16206 | <reponame>alvaromb/Compilemon<filename>lib/aflexnat/ecs.ads<gh_stars>1-10
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by <NAME> of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE equivalence class
-- AUTHOR: <NAME> (UCI)
-- DESCRIPTION finds equivalence classes so DFA will be smaller
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/ecsS.a,v 1.4 90/01/12 15:19:57 self Exp Locker: self $
with misc_defs; use misc_defs;
package ecs is
procedure CCL2ECL;
procedure CRE8ECS(FWD, BCK : in out C_SIZE_ARRAY;
NUM : in INTEGER;
RESULT : out INTEGER);
procedure MKECCL(CCLS : in out CHAR_ARRAY;
LENCCL : in INTEGER;
FWD, BCK : in out UNBOUNDED_INT_ARRAY;
LLSIZ : in INTEGER);
procedure MKECHAR(TCH : in INTEGER;
FWD, BCK : in out C_SIZE_ARRAY);
end ecs;
|
awa/plugins/awa-images/src/awa-images-modules.adb | My-Colaborations/ada-awa | 81 | 7427 | <reponame>My-Colaborations/ada-awa
-----------------------------------------------------------------------
-- awa-images-modules -- Image management module
-- Copyright (C) 2012, 2016, 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Util.Processes;
with Util.Beans.Objects;
with Util.Log.Loggers;
with Util.Streams.Pipes;
with Util.Streams.Texts;
with Util.Strings;
with ADO.Sessions;
with EL.Variables.Default;
with EL.Contexts.Default;
with AWA.Modules.Get;
with AWA.Applications;
with AWA.Storages.Modules;
with AWA.Services.Contexts;
with AWA.Modules.Beans;
with AWA.Images.Beans;
package body AWA.Images.Modules is
package ASC renames AWA.Services.Contexts;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Images.Module");
package Register is new AWA.Modules.Beans (Module => Image_Module,
Module_Access => Image_Module_Access);
-- ------------------------------
-- Job worker procedure to identify an image and generate its thumnbnail.
-- ------------------------------
procedure Thumbnail_Worker (Job : in out AWA.Jobs.Services.Abstract_Job_Type'Class) is
Module : constant Image_Module_Access := Get_Image_Module;
begin
Module.Do_Thumbnail_Job (Job);
end Thumbnail_Worker;
-- ------------------------------
-- Initialize the image module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Image_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the image module");
-- Setup the resource bundles.
App.Register ("imageMsg", "images");
Register.Register (Plugin => Plugin,
Name => "AWA.Images.Beans.Image_List_Bean",
Handler => AWA.Images.Beans.Create_Image_List_Bean'Access);
Register.Register (Plugin => Plugin,
Name => "AWA.Images.Beans.Image_Bean",
Handler => AWA.Images.Beans.Create_Image_Bean'Access);
App.Add_Servlet ("image", Plugin.Image_Servlet'Unchecked_Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
Plugin.Add_Listener (AWA.Storages.Modules.NAME, Plugin'Unchecked_Access);
end Initialize;
-- ------------------------------
-- Configures the module after its initialization and after having
-- read its XML configuration.
-- ------------------------------
overriding
procedure Configure (Plugin : in out Image_Module;
Props : in ASF.Applications.Config) is
pragma Unreferenced (Props);
use type AWA.Jobs.Modules.Job_Module_Access;
begin
Plugin.Job_Module := AWA.Jobs.Modules.Get_Job_Module;
if Plugin.Job_Module = null then
Log.Error ("Cannot find the AWA Job module for the image thumbnail generation");
else
Plugin.Job_Module.Register (Definition => Thumbnail_Job_Definition.Factory);
end if;
Plugin.Thumbnail_Command := Plugin.Get_Config (PARAM_THUMBNAIL_COMMAND);
end Configure;
-- ------------------------------
-- Create a thumbnail job for the image.
-- ------------------------------
procedure Make_Thumbnail_Job (Plugin : in Image_Module;
Image : in AWA.Images.Models.Image_Ref'Class) is
pragma Unreferenced (Plugin);
J : AWA.Jobs.Services.Job_Type;
begin
J.Set_Parameter ("image_id", Image);
J.Schedule (Thumbnail_Job_Definition.Factory.all);
end Make_Thumbnail_Job;
-- ------------------------------
-- Returns true if the storage file has an image mime type.
-- ------------------------------
function Is_Image (File : in AWA.Storages.Models.Storage_Ref'Class) return Boolean is
Mime : constant String := File.Get_Mime_Type;
Pos : constant Natural := Util.Strings.Index (Mime, '/');
begin
if Pos = 0 then
return False;
else
return Mime (Mime'First .. Pos - 1) = "image";
end if;
end Is_Image;
-- ------------------------------
-- Create an image instance.
-- ------------------------------
procedure Create_Image (Plugin : in Image_Module;
File : in AWA.Storages.Models.Storage_Ref'Class) is
begin
if File.Get_Original.Is_Null then
declare
Ctx : constant ASC.Service_Context_Access := ASC.Current;
DB : ADO.Sessions.Master_Session := ASC.Get_Master_Session (Ctx);
Img : AWA.Images.Models.Image_Ref;
begin
Img.Set_Width (0);
Img.Set_Height (0);
Img.Set_Thumb_Height (0);
Img.Set_Thumb_Width (0);
Img.Set_Storage (File);
Img.Set_Folder (File.Get_Folder);
Img.Set_Owner (File.Get_Owner);
Img.Save (DB);
Plugin.Make_Thumbnail_Job (Img);
end;
end if;
end Create_Image;
-- ------------------------------
-- The `On_Create` procedure is called by `Notify_Create` to notify
-- the creation of the item.
-- ------------------------------
overriding
procedure On_Create (Instance : in Image_Module;
Item : in AWA.Storages.Models.Storage_Ref'Class) is
begin
if Is_Image (Item) then
Image_Module'Class (Instance).Create_Image (Item);
end if;
end On_Create;
-- ------------------------------
-- The `On_Update` procedure is called by `Notify_Update` to notify
-- the update of the item.
-- ------------------------------
overriding
procedure On_Update (Instance : in Image_Module;
Item : in AWA.Storages.Models.Storage_Ref'Class) is
begin
if Is_Image (Item) then
Image_Module'Class (Instance).Create_Image (Item);
else
Image_Module'Class (Instance).Delete_Image (Item);
end if;
end On_Update;
-- ------------------------------
-- The `On_Delete` procedure is called by `Notify_Delete` to notify
-- the deletion of the item.
-- ------------------------------
overriding
procedure On_Delete (Instance : in Image_Module;
Item : in AWA.Storages.Models.Storage_Ref'Class) is
begin
Image_Module'Class (Instance).Delete_Image (Item);
end On_Delete;
-- ------------------------------
-- Thumbnail job to identify the image dimension and produce a thumbnail.
-- ------------------------------
procedure Do_Thumbnail_Job (Plugin : in Image_Module;
Job : in out AWA.Jobs.Services.Abstract_Job_Type'Class) is
Image_Id : constant ADO.Identifier := Job.Get_Parameter ("image_id");
begin
Image_Module'Class (Plugin).Build_Thumbnail (Image_Id);
end Do_Thumbnail_Job;
-- ------------------------------
-- Get the image module instance associated with the current application.
-- ------------------------------
function Get_Image_Module return Image_Module_Access is
function Get is new AWA.Modules.Get (Image_Module, Image_Module_Access, NAME);
begin
return Get;
end Get_Image_Module;
procedure Create_Thumbnail (Service : in Image_Module;
Source : in String;
Into : in String;
Width : in out Natural;
Height : in out Natural) is
Ctx : EL.Contexts.Default.Default_Context;
Variables : aliased EL.Variables.Default.Default_Variable_Mapper;
Proc : Util.Processes.Process;
Pipe : aliased Util.Streams.Pipes.Pipe_Stream;
begin
Variables.Bind ("src", Util.Beans.Objects.To_Object (Source));
Variables.Bind ("dst", Util.Beans.Objects.To_Object (Into));
Variables.Bind ("width", Util.Beans.Objects.To_Object (Width));
Variables.Bind ("height", Util.Beans.Objects.To_Object (Height));
Ctx.Set_Variable_Mapper (Variables'Unchecked_Access);
declare
Cmd : constant Util.Beans.Objects.Object := Service.Thumbnail_Command.Get_Value (Ctx);
Command : constant String := Util.Beans.Objects.To_String (Cmd);
Input : Util.Streams.Texts.Reader_Stream;
begin
Width := 0;
Height := 0;
Pipe.Open (Command, Util.Processes.READ_ALL);
Input.Initialize (Pipe'Unchecked_Access, 1024);
while not Input.Is_Eof loop
declare
use Ada.Strings;
Line : Ada.Strings.Unbounded.Unbounded_String;
Pos : Natural;
Sep : Natural;
Last : Natural;
begin
Input.Read_Line (Into => Line, Strip => False);
exit when Ada.Strings.Unbounded.Length (Line) = 0;
Log.Info ("Received: {0}", Line);
-- The '-verbose' option of ImageMagick reports information
-- about the original image. Extract the picture width and
-- height.
-- image.png PNG 120x282 120x282+0+0 8-bit \
-- DirectClass 34.4KB 0.000u 0:00.018
Pos := Ada.Strings.Unbounded.Index (Line, " ");
if Pos > 0 and Width = 0 then
Pos := Ada.Strings.Unbounded.Index (Line, " ", Pos + 1);
if Pos > 0 then
Sep := Ada.Strings.Unbounded.Index (Line, "x", Pos + 1);
Last := Ada.Strings.Unbounded.Index (Line, "=", Pos + 1);
if Sep > 0 and Sep < Last then
Log.Info ("Dimension {0} - {1}..{2}",
Ada.Strings.Unbounded.Slice (Line, Pos, Last),
Natural'Image (Pos), Natural'Image (Last));
Width := Natural'Value (Unbounded.Slice (Line, Pos + 1, Sep - 1));
Height := Natural'Value (Unbounded.Slice (Line, Sep + 1, Last - 1));
end if;
end if;
end if;
end;
end loop;
Pipe.Close;
Util.Processes.Wait (Proc);
if Pipe.Get_Exit_Status /= 0 then
Log.Error ("Command {0} exited with status {1}", Command,
Integer'Image (Pipe.Get_Exit_Status));
end if;
end;
end Create_Thumbnail;
-- Build a thumbnail for the image identified by the Id.
procedure Build_Thumbnail (Service : in Image_Module;
Id : in ADO.Identifier) is
Storage_Service : constant AWA.Storages.Services.Storage_Service_Access
:= AWA.Storages.Modules.Get_Storage_Manager;
Ctx : constant ASC.Service_Context_Access := ASC.Current;
DB : ADO.Sessions.Master_Session := ASC.Get_Master_Session (Ctx);
Img : AWA.Images.Models.Image_Ref;
Thumb : AWA.Images.Models.Image_Ref;
Target_File : AWA.Storages.Storage_File (AWA.Storages.TMP);
Local_File : AWA.Storages.Storage_File (AWA.Storages.CACHE);
Thumbnail : AWA.Storages.Models.Storage_Ref;
Width : Natural := 64;
Height : Natural := 64;
begin
Img.Load (DB, Id);
declare
Image_File : constant AWA.Storages.Models.Storage_Ref'Class := Img.Get_Storage;
begin
Storage_Service.Get_Local_File (From => Image_File.Get_Id, Into => Local_File);
Storage_Service.Create_Local_File (Target_File);
Service.Create_Thumbnail (AWA.Storages.Get_Path (Local_File),
AWA.Storages.Get_Path (Target_File), Width, Height);
Thumbnail.Set_Mime_Type ("image/jpeg");
Thumbnail.Set_Original (Image_File);
Thumbnail.Set_Workspace (Image_File.Get_Workspace);
Thumbnail.Set_Folder (Image_File.Get_Folder);
Thumbnail.Set_Owner (Image_File.Get_Owner);
Thumbnail.Set_Name (String '(Image_File.Get_Name));
Storage_Service.Save (Thumbnail, AWA.Storages.Get_Path (Target_File),
AWA.Storages.Models.DATABASE);
Thumb.Set_Width (64);
Thumb.Set_Height (64);
Thumb.Set_Owner (Image_File.Get_Owner);
Thumb.Set_Folder (Image_File.Get_Folder);
Thumb.Set_Storage (Thumbnail);
Img.Set_Width (Width);
Img.Set_Height (Height);
Img.Set_Thumb_Width (64);
Img.Set_Thumb_Height (64);
Img.Set_Thumbnail (Thumbnail);
Ctx.Start;
Img.Save (DB);
Thumb.Save (DB);
Ctx.Commit;
end;
end Build_Thumbnail;
-- Deletes the storage instance.
procedure Delete_Image (Service : in Image_Module;
File : in AWA.Storages.Models.Storage_Ref'Class) is
begin
null;
end Delete_Image;
-- ------------------------------
-- Scale the image dimension.
-- ------------------------------
procedure Scale (Width : in Natural;
Height : in Natural;
To_Width : in out Natural;
To_Height : in out Natural) is
begin
if To_Width = Natural'Last or To_Height = Natural'Last
or (To_Width = 0 and To_Height = 0)
then
To_Width := Width;
To_Height := Height;
elsif To_Width = 0 then
To_Width := (Width * To_Height) / Height;
elsif To_Height = 0 then
To_Height := (Height * To_Width) / Width;
end if;
end Scale;
-- ------------------------------
-- Get the dimension represented by the string. The string has one
-- of the following formats:
-- original -> Width, Height := Natural'Last
-- default -> Width, Height := 0
-- <width>x -> Width := <width>, Height := 0
-- x<height> -> Width := 0, Height := <height>
-- <width>x<height> -> Width := <width>, Height := <height>
-- ------------------------------
procedure Get_Sizes (Dimension : in String;
Width : out Natural;
Height : out Natural) is
Pos : Natural;
begin
if Dimension = "original" then
Width := Natural'Last;
Height := Natural'Last;
elsif Dimension = "default" then
Width := 800;
Height := 0;
else
Pos := Util.Strings.Index (Dimension, 'x');
if Pos > Dimension'First then
begin
Width := Natural'Value (Dimension (Dimension'First .. Pos - 1));
exception
when Constraint_Error =>
Width := 0;
end;
else
Width := 0;
end if;
if Pos < Dimension'Last then
begin
Height := Natural'Value (Dimension (Pos + 1 .. Dimension'Last));
exception
when Constraint_Error =>
Height := 0;
end;
else
Height := 0;
end if;
end if;
end Get_Sizes;
end AWA.Images.Modules;
|
BootloaderCorePkg/Stage1A/Ia32/Vtf0/PageTables.asm | kokweich/slimbootloader | 1 | 169836 | <reponame>kokweich/slimbootloader
;------------------------------------------------------------------------------
; @file
; Build paging tables dynamically for x64 mode
;
; Copyright (c) 2020 Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;------------------------------------------------------------------------------
%define FSP_HEADER_TEMPRAMINIT_OFFSET 0x30
%define PAGE_REGION_SIZE 0x6000
%define PAGE_PRESENT 0x01
%define PAGE_READ_WRITE 0x02
%define PAGE_USER_SUPERVISOR 0x04
%define PAGE_WRITE_THROUGH 0x08
%define PAGE_CACHE_DISABLE 0x010
%define PAGE_ACCESSED 0x020
%define PAGE_DIRTY 0x040
%define PAGE_PAT 0x080
%define PAGE_GLOBAL 0x0100
%define PAGE_2M_MBO 0x080
%define PAGE_2M_PAT 0x01000
%define PAGE_2M_PDE_ATTR (PAGE_2M_MBO + \
PAGE_ACCESSED + \
PAGE_DIRTY + \
PAGE_READ_WRITE + \
PAGE_PRESENT)
%define PAGE_PDP_ATTR (PAGE_ACCESSED + \
PAGE_READ_WRITE + \
PAGE_PRESENT)
BITS 32
PreparePagingTable:
; Input:
; ECX: Page table base, need 6 pages
; Modify:
; ECX, EDX, ESI
;
; Set up identical paging table for x64
;
mov esi, ecx
mov ecx, PAGE_REGION_SIZE / 4
xor eax, eax
xor edx, edx
clearPageTablesMemoryLoop:
mov dword[ecx * 4 + esi - 4], eax
loop clearPageTablesMemoryLoop
;
; Top level Page Directory Pointers (1 * 512GB entry)
;
lea eax, [esi + (0x1000) + PAGE_PDP_ATTR]
mov dword[esi + (0)], eax
mov dword[esi + (4)], edx
;
; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
;
lea eax, [esi + (0x2000) + PAGE_PDP_ATTR]
mov dword[esi + (0x1000)], eax
mov dword[esi + (0x1004)], edx
lea eax, [esi + (0x3000) + PAGE_PDP_ATTR]
mov dword[esi + (0x1008)], eax
mov dword[esi + (0x100C)], edx
lea eax, [esi + (0x4000) + PAGE_PDP_ATTR]
mov dword[esi + (0x1010)], eax
mov dword[esi + (0x1014)], edx
lea eax, [esi + (0x5000) + PAGE_PDP_ATTR]
mov dword[esi + (0x1018)], eax
mov dword[esi + (0x101C)], edx
;
; Page Table Entries (2048 * 2MB entries => 4GB)
;
mov ecx, 0x800
pageTableEntriesLoop:
mov eax, ecx
dec eax
shl eax, 21
add eax, PAGE_2M_PDE_ATTR
mov [ecx * 8 + esi + (0x2000 - 8)], eax
mov [(ecx * 8 + esi + (0x2000 - 8)) + 4], edx
loop pageTableEntriesLoop
mov eax, esi
OneTimeCallRet PreparePagingTable
|
source/amf/uml/amf-uml-send_signal_actions.ads | svn2github/matreshka | 24 | 15145 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A send signal action is an action that creates a signal instance from its
-- inputs, and transmits it to the target object, where it may cause the
-- firing of a state machine transition or the execution of an activity. The
-- argument values are available to the execution of associated behaviors.
-- The requestor continues execution immediately. Any reply message is
-- ignored and is not transmitted to the requestor. If the input is already a
-- signal instance, use a send object action.
------------------------------------------------------------------------------
limited with AMF.UML.Input_Pins;
with AMF.UML.Invocation_Actions;
limited with AMF.UML.Signals;
package AMF.UML.Send_Signal_Actions is
pragma Preelaborate;
type UML_Send_Signal_Action is limited interface
and AMF.UML.Invocation_Actions.UML_Invocation_Action;
type UML_Send_Signal_Action_Access is
access all UML_Send_Signal_Action'Class;
for UML_Send_Signal_Action_Access'Storage_Size use 0;
not overriding function Get_Signal
(Self : not null access constant UML_Send_Signal_Action)
return AMF.UML.Signals.UML_Signal_Access is abstract;
-- Getter of SendSignalAction::signal.
--
-- The type of signal transmitted to the target object.
not overriding procedure Set_Signal
(Self : not null access UML_Send_Signal_Action;
To : AMF.UML.Signals.UML_Signal_Access) is abstract;
-- Setter of SendSignalAction::signal.
--
-- The type of signal transmitted to the target object.
not overriding function Get_Target
(Self : not null access constant UML_Send_Signal_Action)
return AMF.UML.Input_Pins.UML_Input_Pin_Access is abstract;
-- Getter of SendSignalAction::target.
--
-- The target object to which the signal is sent.
not overriding procedure Set_Target
(Self : not null access UML_Send_Signal_Action;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is abstract;
-- Setter of SendSignalAction::target.
--
-- The target object to which the signal is sent.
end AMF.UML.Send_Signal_Actions;
|
samples/city_mapping.ads | Letractively/ada-util | 60 | 11979 | -----------------------------------------------------------------------
-- city_mapping -- Example of serialization mapping for city CSV records
-- Copyright (C) 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Util.Beans.Objects;
with Util.Serialize.Mappers.Record_Mapper;
with Util.Serialize.Mappers.Vector_Mapper;
with Util.Serialize.Mappers;
with Ada.Containers.Vectors;
package City_Mapping is
use Ada.Strings.Unbounded;
type City is record
Country : Unbounded_String;
City : Unbounded_String;
Name : Unbounded_String;
Region : Unbounded_String;
Latitude : Float;
Longitude : Float;
end record;
type City_Access is access all City;
type City_Fields is (FIELD_COUNTRY, FIELD_CITY, FIELD_NAME,
FIELD_REGION, FIELD_LATITUDE, FIELD_LONGITUDE);
-- Set the name/value pair on the current object.
procedure Set_Member (P : in out City;
Field : in City_Fields;
Value : in Util.Beans.Objects.Object);
package City_Mapper is
new Util.Serialize.Mappers.Record_Mapper (Element_Type => City,
Element_Type_Access => City_Access,
Fields => City_Fields,
Set_Member => Set_Member);
subtype City_Context is City_Mapper.Element_Data;
package City_Vector is
new Ada.Containers.Vectors (Element_Type => City,
Index_Type => Positive);
package City_Vector_Mapper is
new Util.Serialize.Mappers.Vector_Mapper (Vectors => City_Vector,
Element_Mapper => City_Mapper);
subtype City_Vector_Context is City_Vector_Mapper.Vector_Data;
-- Get the address mapper which describes how to load an Address.
function Get_City_Mapper return Util.Serialize.Mappers.Mapper_Access;
-- Get the person vector mapper which describes how to load a list of Person.
function Get_City_Vector_Mapper return City_Vector_Mapper.Mapper_Access;
end City_Mapping;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c46031a.ada | best08618/asylo | 7 | 25151 | -- C46031A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK CONVERSIONS TO FIXED POINT TYPES WHEN THE OPERAND TYPE
-- IS AN INTEGER TYPE.
-- HISTORY:
-- JET 07/11/88 CREATED ORIGINAL TEST.
WITH REPORT; USE REPORT;
PROCEDURE C46031A IS
TYPE FIX1 IS DELTA 2#0.01# RANGE -16#20.0# .. 16#20.0#;
TYPE FIX2 IS DELTA 2#0.0001# RANGE -16#80.0# .. 16#80.0#;
TYPE FIX3 IS DELTA 2#0.000001# RANGE -16#200.0# .. 16#200.0#;
TYPE NEW_INT IS NEW INTEGER RANGE -16#200# .. 16#200#;
I : INTEGER;
J : NEW_INT;
FUNCTION IDENT_NEW (X : NEW_INT) RETURN NEW_INT IS
BEGIN
RETURN X * NEW_INT(IDENT_INT(1));
END IDENT_NEW;
BEGIN
TEST ("C46031A", "CHECK CONVERSIONS TO FIXED POINT TYPES WHEN " &
"THE OPERAND TYPE IS AN INTEGER TYPE");
I := IDENT_INT(-16#1F#);
IF FIX1(I) /= -16#1F.0# THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (1)");
END IF;
J := IDENT_NEW(0);
IF FIX1(J) /= 0.0 THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (2)");
END IF;
I := IDENT_INT(16#7F#);
IF FIX2(I) /= 16#7F.0# THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (3)");
END IF;
J := IDENT_NEW(16#1#);
IF FIX2(J) /= 16#1.0# THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (4)");
END IF;
I := IDENT_INT(-16#55#);
IF FIX3(I) /= -16#55.0# THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (5)");
END IF;
J := IDENT_NEW(-16#1#);
IF FIX3(J) /= -16#1.0# THEN
FAILED ("INCORRECT RESULT FROM CONVERSION (6)");
END IF;
RESULT;
END C46031A;
|
agda/TreeSort/Everything.agda | bgbianchi/sorting | 6 | 10195 | open import Relation.Binary.Core
module TreeSort.Everything {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_)
(trans≤ : Transitive _≤_) where
open import TreeSort.Impl1.Correctness.Order _≤_ tot≤ trans≤
open import TreeSort.Impl1.Correctness.Permutation _≤_ tot≤
open import TreeSort.Impl2.Correctness.Order _≤_ tot≤ trans≤
open import TreeSort.Impl2.Correctness.Permutation _≤_ tot≤
|
tools-src/gnu/gcc/gcc/ada/sem_ch13.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 20926 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ C H 1 3 --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Snames; use Snames;
with Types; use Types;
with Uintp; use Uintp;
package Sem_Ch13 is
procedure Analyze_At_Clause (N : Node_Id);
procedure Analyze_Attribute_Definition_Clause (N : Node_Id);
procedure Analyze_Enumeration_Representation_Clause (N : Node_Id);
procedure Analyze_Free_Statement (N : Node_Id);
procedure Analyze_Record_Representation_Clause (N : Node_Id);
procedure Analyze_Code_Statement (N : Node_Id);
procedure Initialize;
-- Initialize internal tables for new compilation
procedure Set_Enum_Esize (T : Entity_Id);
-- This routine sets the Esize field for an enumeration type T, based
-- on the current representation information available for T. Note that
-- the setting of the RM_Size field is not affected. This routine also
-- initializes the alignment field to zero.
function Minimum_Size
(T : Entity_Id;
Biased : Boolean := False)
return Nat;
-- Given a primitive type, determines the minimum number of bits required
-- to represent all values of the type. This function may not be called
-- with any other types. If the flag Biased is set True, then the minimum
-- size calculation that biased representation is used in the case of a
-- discrete type, e.g. the range 7..8 gives a minimum size of 4 with
-- Biased set to False, and 1 with Biased set to True. Note that the
-- biased parameter only has an effect if the type is not biased, it
-- causes Minimum_Size to indicate the minimum size of an object with
-- the given type, of the size the type would have if it were biased. If
-- the type is already biased, then Minimum_Size returns the biased size,
-- regardless of the setting of Biased. Also, fixed-point types are never
-- biased in the current implementation.
procedure Check_Size
(N : Node_Id;
T : Entity_Id;
Siz : Uint;
Biased : out Boolean);
-- Called when size Siz is specified for subtype T. This subprogram checks
-- that the size is appropriate, posting errors on node N as required.
-- For non-elementary types, a check is only made if an explicit size
-- has been given for the type (and the specified size must match). The
-- parameter Biased is set False if the size specified did not require
-- the use of biased representation, and True if biased representation
-- was required to meet the size requirement. Note that Biased is only
-- set if the type is not currently biased, but biasing it is the only
-- way to meet the requirement. If the type is currently biased, then
-- this biased size is used in the initial check, and Biased is False.
function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id;
-- Searches the Rep_Item chain for the given entity E, for an instance
-- of a representation pragma with the given name Nam. If found then
-- the value returned is the N_Pragma node, otherwise Empty is returned.
function Get_Attribute_Definition_Clause
(E : Entity_Id;
Id : Attribute_Id)
return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance
-- of an attribute definition clause with the given attibute Id Id. If
-- found, the value returned is the N_Attribute_Definition_Clause node,
-- otherwise Empty is returned.
procedure Record_Rep_Item (T : Entity_Id; N : Node_Id);
-- N is the node for either a representation pragma or an attribute
-- definition clause that applies to type T. This procedure links
-- the node N onto the Rep_Item chain for the type T.
function Rep_Item_Too_Early
(T : Entity_Id;
N : Node_Id)
return Boolean;
-- Called at the start of processing a representation clause or a
-- representation pragma. Used to check that the representation item
-- is not being applied to an incompleted type or to a generic formal
-- type or a type derived from a generic formal type. Returns False if
-- no such error occurs. If this error does occur, appropriate error
-- messages are posted on node N, and True is returned.
function Rep_Item_Too_Late
(T : Entity_Id;
N : Node_Id;
FOnly : Boolean := False)
return Boolean;
-- Called at the start of processing a representation clause or a
-- representation pragma. Used to check that a representation item
-- for entity T does not appear too late (according to the rules in
-- RM 13.1(9) and RM 13.1(10)). N is the associated node, which in
-- the pragma case is the pragma or representation clause itself, used
-- for placing error messages if the item is too late.
--
-- Fonly is a flag that causes only the freezing rule (para 9) to be
-- applied, and the tests of para 10 are skipped. This is appropriate
-- for both subtype related attributes (Alignment and Size) and for
-- stream attributes, which, although certainly not subtype related
-- attributes, clearly should not be subject to the para 10 restrictions
-- (see AI95-00137). Similarly, we also skip the para 10 restrictions for
-- the Storage_Size case where they also clearly do not apply.
--
-- If the rep item is too late, an appropriate message is output and
-- True is returned, which is a signal that the caller should abandon
-- processing for the item. If the item is not too late, then False
-- is returned, and the caller can continue processing the item.
--
-- If no error is detected, this call also as a side effect links the
-- representation item onto the head of the representation item chain
-- (referenced by the First_Rep_Item field of the entity).
--
-- Note: Rep_Item_Too_Late must be called with the underlying type in
-- the case of a private or incomplete type. The protocol is to first
-- check for Rep_Item_Too_Early using the initial entity, then take the
-- underlying type, then call Rep_Item_Too_Late on the result.
function Same_Representation (Typ1, Typ2 : Entity_Id) return Boolean;
-- Given two types, where the two types are related by possible derivation,
-- determines if the two types have the same representation, or different
-- representations, requiring the special processing for representation
-- change. A False result is possible only for array, enumeration or
-- record types.
procedure Validate_Unchecked_Conversion
(N : Node_Id;
Act_Unit : Entity_Id);
-- Validate a call to unchecked conversion. N is the node for the actual
-- instantiation, which is used only for error messages. Act_Unit is the
-- entity for the instantiation, from which the actual types etc for this
-- instantiation can be determined. This procedure makes an entry in a
-- table and/or generates an N_Validate_Unchecked_Conversion node. The
-- actual checking is done in Validate_Unchecked_Conversions or in the
-- back end as required.
procedure Validate_Unchecked_Conversions;
-- This routine is called after calling the backend to validate
-- unchecked conversions for size and alignment appropriateness.
-- The reason it is called that late is to take advantage of any
-- back-annotation of size and alignment performed by the backend.
end Sem_Ch13;
|
PInj.agda | kztk-m/sparcl-agda | 0 | 788 | <filename>PInj.agda
{-# OPTIONS --without-K #-}
module PInj where
open import Codata.Delay renaming (length to dlength ; map to dmap )
open import Codata.Thunk
open import Relation.Binary.PropositionalEquality
open import Size
open import Level
open import Data.Product
-- A pair of partial functions that are supposed to form a partial bijection.
record _⊢_⇔_ (i : Size) {ℓ : Level} (A : Set ℓ) (B : Set ℓ) : Set ℓ where
constructor pre-pinj-i
field
forward : A -> Delay B i
backward : B -> Delay A i
open _⊢_⇔_
|
ethereumj-core/src/main/antlr4/org/ethereum/serpent/Serpent.g4 | biafra23/ethereumj | 0 | 6741 | // @author <NAME>
// @since 22.03.2014
grammar Serpent;
tokens {
INDENT, DEDENT }
@lexer::header {
import com.yuvalshavit.antlr4.DenterHelper;
}
@lexer::members {
private final DenterHelper denter = new DenterHelper(NL, SerpentParser.INDENT, SerpentParser.DEDENT) {
@Override
public Token pullToken() {
return SerpentLexer.super.nextToken(); // must be to super.nextToken, or we'll recurse forever!
}
};
@Override
public Token nextToken() {
return denter.nextToken();
}
}
parse: block EOF
;
parse_init_code_block : 'init' ':' INDENT block DEDENT 'code' ':' INDENT block DEDENT;
block: ( asm | array_assign | assign | contract_storage_assign | special_func | if_elif_else_stmt |
while_stmt | ret_func_1 | ret_func_2 | suicide_func | stop_func | single_send_func | msg_func |
single_create_func)* ;
asm: '[asm' asm_symbol 'asm]' NL;
asm_symbol: (ASM_SYMBOLS | INT | HEX_NUMBER)* ;
if_elif_else_stmt: 'if' condition ':' INDENT block DEDENT
('elif' condition ':' INDENT block DEDENT)*
('else:' INDENT block DEDENT)?
;
while_stmt: 'while' condition ':' INDENT block DEDENT;
/* special functions */
special_func :
msg_datasize |
msg_sender |
msg_value |
tx_gasprice |
tx_origin |
tx_gas |
contract_balance |
contract_address |
block_prevhash |
block_coinbase |
block_timestamp |
block_number |
block_difficulty |
block_gaslimit
;
msg_datasize
: 'msg.datasize' ;
msg_sender
: 'msg.sender' ;
msg_value
: 'msg.value' ;
tx_gasprice
: 'tx.gasprice' ;
tx_origin
: 'tx.origin' ;
tx_gas
: 'tx.gas' ;
contract_balance
: 'contract.balance' ;
contract_address
: 'contract.address' ;
block_prevhash
: 'block.prevhash' ;
block_coinbase
: 'block.coinbase' ;
block_timestamp
: 'block.timestamp' ;
block_number
: 'block.number' ;
block_difficulty
: 'block.difficulty' ;
block_gaslimit
: 'block.gaslimit' ;
msg_func: 'msg' '(' int_val ',' int_val ',' int_val ',' arr_def ',' int_val ',' int_val')' ;
send_func: 'send' '(' int_val ',' int_val ',' int_val ')';
single_send_func: send_func NL;
create_func: 'create' '(' int_val ',' int_val ',' int_val ')';
single_create_func: create_func NL;
msg_data: 'msg.data' '[' expression ']' ;
array_assign: VAR '[' int_val ']' EQ_OP expression NL;
array_retreive: VAR '[' int_val ']';
assign: VAR EQ_OP (expression | arr_def | msg_func) NL;
arr_def : '[' (int_val ','?)* ']';
contract_storage_assign: 'contract.storage' '[' expression ']' EQ_OP expression NL;
contract_storage_load: 'contract.storage' '[' expression ']';
mul_expr
: int_val
| mul_expr OP_MUL int_val
;
add_expr
: mul_expr
| add_expr OP_ADD mul_expr
;
rel_exp
: add_expr
| rel_exp OP_REL add_expr
;
eq_exp
: rel_exp
| eq_exp OP_EQ rel_exp
;
and_exp
: eq_exp
| and_exp OP_AND eq_exp
;
ex_or_exp
: and_exp
| ex_or_exp OP_EX_OR and_exp
;
in_or_exp
: ex_or_exp
| in_or_exp OP_IN_OR ex_or_exp
;
log_and_exp
: in_or_exp
| log_and_exp OP_LOG_AND in_or_exp
;
log_or_exp
: log_and_exp
| log_or_exp OP_LOG_OR log_and_exp
;
expression : log_or_exp ;
condition: expression ;
int_val : INT |
hex_num |
get_var |
special_func |
'(' expression ')' |
OP_NOT '(' expression ')' |
msg_data |
send_func |
contract_storage_load |
array_retreive
;
hex_num
: HEX_NUMBER
;
ret_func_1: 'return' '(' expression ')' NL;
ret_func_2: 'return' '(' expression ',' expression ')' NL;
suicide_func: 'suicide' '(' expression ')' NL;
stop_func: 'stop' NL;
get_var: VAR;
INT: [0-9]+;
ASM_SYMBOLS: 'STOP' | 'ADD' | 'MUL' | 'SUB' | 'DIV' | 'SDIV' | 'MOD' |'SMOD' | 'EXP' | 'NEG' | 'LT' | 'GT' | 'SLT' | 'SGT'| 'EQ' | 'NOT' | 'AND' | 'OR' | 'XOR' | 'BYTE' | 'SHA3' | 'ADDRESS' | 'BALANCE' | 'ORIGIN' | 'CALLER' | 'CALLVALUE' | 'CALLDATALOAD' | 'CALLDATASIZE' | 'CALLDATACOPY' | 'CODESIZE' | 'CODECOPY' | 'GASPRICE' | 'PREVHASH' | 'COINBASE' | 'TIMESTAMP' | 'NUMBER' | 'DIFFICULTY' | 'GASLIMIT' | 'POP' | 'DUP' | 'SWAP' | 'MLOAD' | 'MSTORE' | 'MSTORE8' | 'SLOAD' | 'SSTORE' | 'JUMP' | 'JUMPI' | 'PC' | 'MSIZE' | 'GAS' | 'PUSH1' | 'PUSH2' | 'PUSH3' | 'PUSH4' | 'PUSH5' | 'PUSH6' | 'PUSH7' | 'PUSH8' | 'PUSH9' | 'PUSH10' | 'PUSH11' | 'PUSH12' | 'PUSH13' | 'PUSH14' | 'PUSH15' | 'PUSH16' | 'PUSH17' | 'PUSH18' | 'PUSH19' | 'PUSH20' | 'PUSH21' | 'PUSH22' | 'PUSH23' | 'PUSH24' | 'PUSH25' | 'PUSH26' | 'PUSH27' | 'PUSH28' | 'PUSH29' | 'PUSH30' | 'PUSH31' | 'PUSH32' | 'CREATE' | 'CALL' | 'RETURN' | 'SUICIDE';
/* 'xor', 'and', 'or', 'not' operands should be defined
first among lexer rules because it
can be mismatched as a var lexa */
OP_EX_OR: 'xor';
OP_LOG_AND: '&&' | 'and';
OP_LOG_OR: '||' | 'or';
OP_NOT: '!' | 'not';
EQ_OP: '=' ;
NL: ('\r'? '\n' ' '*); // note the ' '*;
WS: [ \t]+ -> skip;
LINE_COMMENT: '//' ~[\r\n]* -> skip;
VAR: [a-zA-Z][a-zA-Z0-9]* ;
OP_ADD : '+' | '-';
OP_MUL : '*' | '/' | '^' | '%' | '#/' | '#%' ;
OP_REL : '<' | '>' | '<=' | '>=';
OP_EQ : '==' | '!=';
OP_AND: '&';
OP_IN_OR: '|';
HEX_DIGIT : [0-9a-fA-F];
HEX_NUMBER : ('0x' | '0X' )HEX_DIGIT+;
|
programs/oeis/336/A336288.asm | karttu/loda | 1 | 7978 | <reponame>karttu/loda<filename>programs/oeis/336/A336288.asm
; A336288: Numbers of squares formed by this procedure on n-th step: Step 1, draw a unit square. Step n, draw a unit square with center in every intersection of lines of the figure in step n-1.
; 1,10,43,116,245,446,735,1128,1641,2290,3091,4060,5213,6566,8135,9936,11985,14298,16891,19780,22981,26510,30383,34616,39225,44226,49635,55468,61741,68470,75671,83360,91553,100266,109515,119316,129685,140638,152191,164360,177161
mov $1,1
add $1,$0
add $1,$0
pow $1,3
add $1,$0
div $1,3
add $1,1
|
programs/oeis/188/A188473.asm | neoneye/loda | 22 | 242155 | <reponame>neoneye/loda<gh_stars>10-100
; A188473: Positions of 1 in A188472.
; 3,8,11,16,19,21,24,29,32,37,40,42,45,50,53,55,58,63,66,71,74,76,79,84,87,92,95,97,100,105,108,110,113,118,121,126,129,131,134,139,142,144,147,152,155,160,163,165,168,173,176,181,184,186,189,194,197,199,202,207,210,215,218,220,223,228,231,236,239,241,244,249,252,254,257,262,265,270
seq $0,188435 ; Positions of 1 in A188433; complement of A188434.
seq $0,4957 ; a(n) = ceiling(n*phi^2), where phi is the golden ratio, A001622.
|
tools-src/gnu/gcc/gcc/ada/5gtasinf.adb | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 24445 | <filename>tools-src/gnu/gcc/gcc/ada/5gtasinf.adb
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . T A S K _ I N F O --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package body contains the routines associated with the implementation
-- of the Task_Info pragma.
-- This is the SGI specific version of this module.
with Interfaces.C;
with System.OS_Interface;
with System;
with Unchecked_Conversion;
package body System.Task_Info is
use System.OS_Interface;
use type Interfaces.C.int;
function To_Resource_T is new
Unchecked_Conversion (Resource_Vector_T, resource_t);
MP_NPROCS : constant := 1;
function Sysmp (Cmd : Integer) return Integer;
pragma Import (C, Sysmp);
function Num_Processors (Cmd : Integer := MP_NPROCS) return Integer
renames Sysmp;
function Geteuid return Integer;
pragma Import (C, Geteuid);
Locking_Map : constant array (Page_Locking) of Interfaces.C.int :=
(NOLOCK => 0,
PROCLOCK => 1,
TXTLOCK => 2,
DATLOCK => 4);
package body Resource_Vector_Functions is
function "+" (R : Resource_T)
return Resource_Vector_T is
Result : Resource_Vector_T := NO_RESOURCES;
begin
Result (Resource_T'Pos (R)) := True;
return Result;
end "+";
function "+" (R1, R2 : Resource_T)
return Resource_Vector_T is
Result : Resource_Vector_T := NO_RESOURCES;
begin
Result (Resource_T'Pos (R1)) := True;
Result (Resource_T'Pos (R2)) := True;
return Result;
end "+";
function "+" (R : Resource_T; S : Resource_Vector_T)
return Resource_Vector_T is
Result : Resource_Vector_T := S;
begin
Result (Resource_T'Pos (R)) := True;
return Result;
end "+";
function "+" (S : Resource_Vector_T; R : Resource_T)
return Resource_Vector_T is
Result : Resource_Vector_T := S;
begin
Result (Resource_T'Pos (R)) := True;
return Result;
end "+";
function "+" (S1, S2 : Resource_Vector_T)
return Resource_Vector_T is
Result : Resource_Vector_T;
begin
Result := S1 or S2;
return Result;
end "+";
function "-" (S : Resource_Vector_T; R : Resource_T)
return Resource_Vector_T is
Result : Resource_Vector_T := S;
begin
Result (Resource_T'Pos (R)) := False;
return Result;
end "-";
end Resource_Vector_Functions;
function New_Sproc (Attr : Sproc_Attributes) return sproc_t is
Sproc_Attr : aliased sproc_attr_t;
Sproc : aliased sproc_t;
Status : int;
begin
Status := sproc_attr_init (Sproc_Attr'Unrestricted_Access);
if Status = 0 then
Status := sproc_attr_setresources
(Sproc_Attr'Unrestricted_Access,
To_Resource_T (Attr.Sproc_Resources));
if Attr.CPU /= ANY_CPU then
if Attr.CPU > Num_Processors then
raise Invalid_CPU_Number;
end if;
Status := sproc_attr_setcpu
(Sproc_Attr'Unrestricted_Access,
int (Attr.CPU));
end if;
if Attr.Resident /= NOLOCK then
if Geteuid /= 0 then
raise Permission_Error;
end if;
Status := sproc_attr_setresident
(Sproc_Attr'Unrestricted_Access,
Locking_Map (Attr.Resident));
end if;
if Attr.NDPRI /= NDP_NONE then
-- if Geteuid /= 0 then
-- raise Permission_Error;
-- end if;
Status := sproc_attr_setprio
(Sproc_Attr'Unrestricted_Access,
int (Attr.NDPRI));
end if;
Status := sproc_create
(Sproc'Unrestricted_Access,
Sproc_Attr'Unrestricted_Access,
null,
System.Null_Address);
if Status /= 0 then
Status := sproc_attr_destroy (Sproc_Attr'Unrestricted_Access);
raise Sproc_Create_Error;
end if;
Status := sproc_attr_destroy (Sproc_Attr'Unrestricted_Access);
end if;
if Status /= 0 then
raise Sproc_Create_Error;
end if;
return Sproc;
end New_Sproc;
function New_Sproc
(Sproc_Resources : Resource_Vector_T := NO_RESOURCES;
CPU : CPU_Number := ANY_CPU;
Resident : Page_Locking := NOLOCK;
NDPRI : Non_Degrading_Priority := NDP_NONE)
return sproc_t is
Attr : Sproc_Attributes :=
(Sproc_Resources, CPU, Resident, NDPRI);
begin
return New_Sproc (Attr);
end New_Sproc;
function Unbound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0)
return Thread_Attributes is
begin
return (False, Thread_Resources, Thread_Timeslice);
end Unbound_Thread_Attributes;
function Bound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0;
Sproc : sproc_t)
return Thread_Attributes is
begin
return (True, Thread_Resources, Thread_Timeslice, Sproc);
end Bound_Thread_Attributes;
function Bound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0;
Sproc_Resources : Resource_Vector_T := NO_RESOURCES;
CPU : CPU_Number := ANY_CPU;
Resident : Page_Locking := NOLOCK;
NDPRI : Non_Degrading_Priority := NDP_NONE)
return Thread_Attributes is
Sproc : sproc_t := New_Sproc
(Sproc_Resources, CPU, Resident, NDPRI);
begin
return (True, Thread_Resources, Thread_Timeslice, Sproc);
end Bound_Thread_Attributes;
function New_Unbound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0)
return Task_Info_Type is
begin
return new Thread_Attributes'
(False, Thread_Resources, Thread_Timeslice);
end New_Unbound_Thread_Attributes;
function New_Bound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0;
Sproc : sproc_t)
return Task_Info_Type is
begin
return new Thread_Attributes'
(True, Thread_Resources, Thread_Timeslice, Sproc);
end New_Bound_Thread_Attributes;
function New_Bound_Thread_Attributes
(Thread_Resources : Resource_Vector_T := NO_RESOURCES;
Thread_Timeslice : Duration := 0.0;
Sproc_Resources : Resource_Vector_T := NO_RESOURCES;
CPU : CPU_Number := ANY_CPU;
Resident : Page_Locking := NOLOCK;
NDPRI : Non_Degrading_Priority := NDP_NONE)
return Task_Info_Type is
Sproc : sproc_t := New_Sproc
(Sproc_Resources, CPU, Resident, NDPRI);
begin
return new Thread_Attributes'
(True, Thread_Resources, Thread_Timeslice, Sproc);
end New_Bound_Thread_Attributes;
end System.Task_Info;
|
test/Succeed/CovariantConstructors.agda | shlevy/agda | 3 | 3089 | -- Andreas, 2015-06-29 constructors should be covariant.
-- They are already treated as strictly positive in the positivity checker.
-- {-# OPTIONS -v tc.polarity:20 -v tc.proj.like:10 #-}
-- {-# OPTIONS -v tc.conv.elim:25 -v tc.conv.atom:30 -v tc.conv.term:30 --show-implicit #-}
open import Common.Size
open import Common.Product
-- U (i : contravariant)
record U (i : Size) : Set where
coinductive
field out : (j : Size< i) → U j
record Tup (P : Set × Set) : Set where
constructor tup
field
fst : proj₁ P
snd : proj₂ P
Dup : Set → Set
Dup X = Tup (X , X)
-- This is accepted, as constructors are taken as monotone.
data D : Set where
c : Dup D → D
fine : ∀{i} → Dup (U ∞) → Dup (U i)
fine (tup x y) = tup x y
-- This should also be accepted.
-- (Additionally, it is the η-short form of fine.)
cast : ∀{i} → Dup (U ∞) → Dup (U i)
cast x = x
|
oeis/097/A097138.asm | neoneye/loda-programs | 11 | 4584 | <reponame>neoneye/loda-programs<filename>oeis/097/A097138.asm
; A097138: Convolution of 4^n and floor(n/2).
; Submitted by <NAME>
; 0,0,1,5,22,90,363,1455,5824,23300,93205,372825,1491306,5965230,23860927,95443715,381774868,1527099480,6108397929,24433591725,97734366910,390937467650,1563749870611,6254999482455,25019997929832,100079991719340,400319966877373,1601279867509505,6405119470038034,25620477880152150,102481911520608615,409927646082434475,1639710584329737916,6558842337318951680,26235369349275806737,104941477397103226965,419765909588412907878,1679063638353651631530,6716254553414606526139,26865018213658426104575
mov $1,2
pow $1,$0
div $0,2
mov $2,$1
pow $2,2
div $2,15
mul $2,4
sub $2,$0
mov $0,$2
div $0,3
|
electrum/src/main/resources/models/book/chapter6/memory/fixedSizeMemory_H.als | haslab/Electrum | 29 | 25 | <filename>electrum/src/main/resources/models/book/chapter6/memory/fixedSizeMemory_H.als
module chapter6/memory/fixedSizeMemory_H [Addr, Data]
open chapter6/memory/fixedSizeMemory [Addr, Data] as memory
sig Memory_H extends memory/Memory {
unwritten: set Addr
}
pred init [m: Memory_H] {
memory/init [m]
m.unwritten = Addr
}
pred read [m: Memory_H, a: Addr, d: Data] {
memory/read [m, a, d]
}
pred write [m, m1: Memory_H, a: Addr, d: Data] {
memory/write [m, m1, a, d]
m1.unwritten = m.unwritten - a
}
|
Terminal/Shell.applescript | rogues-gallery/applescript | 360 | 3172 | -- my alternative to "Finder to Shell" scripts, just for fun.
-- select something in Finder and run the script, a new terminal window opens in the current Finder directory
-- add to the Finder toolbar for easiest use
tell application "Finder"
set go2shell to selection as text
set go2shell to quoted form of POSIX path of go2shell
if go2shell contains "." then
set rmfile to do shell script "basename " & go2shell
set go2shell to do shell script "echo " & go2shell & " | sed -e 's/" & rmfile & "//g'"
set go2shell to quoted form of go2shell
end if
tell application "Terminal"
activate
do script "cd " & go2shell
end tell
end tell
|
test/succeed/Copatterns.agda | np/agda-git-experiment | 1 | 5035 | {-# OPTIONS --copatterns #-}
module Copatterns where
open import Common.Equality
record _×_ (A B : Set) : Set where
constructor _,_
field
fst : A
snd : B
open _×_
pair : {A B : Set} → A → B → A × B
fst (pair a b) = a
snd (pair a b) = b
swap : {A B : Set} → A × B → B × A
fst (swap p) = snd p
snd (swap p) = fst p
swap3 : {A B C : Set} → A × (B × C) → C × (B × A)
fst (swap3 t) = snd (snd t)
fst (snd (swap3 t)) = fst (snd t)
snd (snd (swap3 t)) = fst t
-- should also work if we shuffle the clauses
swap4 : {A B C D : Set} → A × (B × (C × D)) → D × (C × (B × A))
fst (snd (swap4 t)) = fst (snd (snd t))
snd (snd (snd (swap4 t))) = fst t
fst (swap4 t) = snd (snd (snd t))
fst (snd (snd (swap4 t))) = fst (snd t)
-- State monad example
record State (S A : Set) : Set where
constructor state
field
runState : S → A × S
open State
record Monad (M : Set → Set) : Set1 where
constructor monad
field
return : {A : Set} → A → M A
_>>=_ : {A B : Set} → M A → (A → M B) → M B
open Monad {{...}}
stateMonad : {S : Set} → Monad (State S)
runState (return {{stateMonad}} a ) s = a , s
runState (_>>=_ {{stateMonad}} m k) s₀ =
let a , s₁ = runState m s₀
in runState (k a) s₁
leftId : {A B S : Set}(a : A)(k : A → State S B) → (return a >>= k) ≡ k a
leftId a k = refl
rightId : {A B S : Set}(m : State S A) → (m >>= return) ≡ m
rightId m = refl
assoc : {A B C S : Set}(m : State S A)(k : A → State S B)(l : B → State S C) →
((m >>= k) >>= l) ≡ (m >>= λ a → k a >>= l)
assoc m k l = refl
-- multiple clauses with abstractions
fswap3 : {A B C X : Set} → (X → A) × ((X → B) × C) → (X → C) × (X → (B × A))
fst (fswap3 t) x = snd (snd t)
fst (snd (fswap3 t) y) = fst (snd t) y
snd (snd (fswap3 t) z) = fst t z
|
win32/VC10/Win32/libxml2_Release/xpointer.asm | txwizard/libxml2_x64_and_ARM | 0 | 242785 | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27027.1
TITLE C:\Users\DAG\Documents\_Clients\CodeProject Authors Group\Windows on ARM\libxml2\libxml2-2.9.9\xpointer.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM _xmlMalloc:DWORD
COMM _xmlMallocAtomic:DWORD
COMM _xmlRealloc:DWORD
COMM _xmlFree:DWORD
COMM _xmlMemStrdup:DWORD
COMM _xmlXPathNAN:QWORD
COMM _xmlXPathPINF:QWORD
COMM _xmlXPathNINF:QWORD
COMM _xmlIsBaseCharGroup:BYTE:010H
COMM _xmlIsCharGroup:BYTE:010H
COMM _xmlIsCombiningGroup:BYTE:010H
COMM _xmlIsDigitGroup:BYTE:010H
COMM _xmlIsExtenderGroup:BYTE:010H
COMM _xmlIsIdeographicGroup:BYTE:010H
COMM _xmlIsPubidChar_tab:BYTE:0100H
COMM _xmlParserMaxDepth:DWORD
COMM _forbiddenExp:DWORD
COMM _emptyExp:DWORD
_DATA ENDS
msvcjmc SEGMENT
__188180DA_corecrt_math@h DB 01H
__2CC6E67D_corecrt_stdio_config@h DB 01H
__05476D76_corecrt_wstdio@h DB 01H
__A452D4A0_stdio@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__BEF3E6F7_xpointer@c DB 01H
msvcjmc ENDS
PUBLIC _xmlXPtrLocationSetCreate
PUBLIC _xmlXPtrFreeLocationSet
PUBLIC _xmlXPtrLocationSetMerge
PUBLIC _xmlXPtrNewRange
PUBLIC _xmlXPtrNewRangePoints
PUBLIC _xmlXPtrNewRangeNodePoint
PUBLIC _xmlXPtrNewRangePointNode
PUBLIC _xmlXPtrNewRangeNodes
PUBLIC _xmlXPtrNewLocationSetNodes
PUBLIC _xmlXPtrNewLocationSetNodeSet
PUBLIC _xmlXPtrNewRangeNodeObject
PUBLIC _xmlXPtrNewCollapsedRange
PUBLIC _xmlXPtrLocationSetAdd
PUBLIC _xmlXPtrWrapLocationSet
PUBLIC _xmlXPtrLocationSetDel
PUBLIC _xmlXPtrLocationSetRemove
PUBLIC _xmlXPtrNewContext
PUBLIC _xmlXPtrEval
PUBLIC _xmlXPtrRangeToFunction
PUBLIC _xmlXPtrBuildNodeList
PUBLIC _xmlXPtrEvalRangePredicate
PUBLIC _xmlXPtrAdvanceNode
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@ ; `string'
PUBLIC ??_C@_0BB@DMDDEGKA@allocating?5point@ ; `string'
PUBLIC ??_C@_0BB@PBEHJOM@allocating?5range@ ; `string'
PUBLIC ??_C@_0BH@HNICMPAH@allocating?5locationset@ ; `string'
PUBLIC ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@ ; `string'
PUBLIC ??_C@_0BC@MDOPFBLJ@allocating?5buffer@ ; `string'
PUBLIC ??_C@_08DNJCJFMK@xpointer@ ; `string'
PUBLIC ??_C@_07HCLJNICE@element@ ; `string'
PUBLIC ??_C@_05PPEFOGKI@xmlns@ ; `string'
PUBLIC ??_C@_0BJ@PBEDODCO@unsupported?5scheme?5?8?$CFs?8?6@ ; `string'
PUBLIC ??_C@_0CG@PNGJONJE@warning?3?5ChildSeq?5not?5starting?5@ ; `string'
PUBLIC ??_C@_0BO@HMMGLLBJ@allocating?5evaluation?5context@ ; `string'
PUBLIC ??_C@_05CCGOGOBM@range@ ; `string'
PUBLIC ??_C@_0N@FPBCPIBK@range?9inside@ ; `string'
PUBLIC ??_C@_0N@NHPDEMLM@string?9range@ ; `string'
PUBLIC ??_C@_0M@KAHBAHMC@start?9point@ ; `string'
PUBLIC ??_C@_09BKKFPLJK@end?9point@ ; `string'
PUBLIC ??_C@_04NDJIBAID@here@ ; `string'
PUBLIC ??_C@_07NGBELOAG@?5origin@ ; `string'
PUBLIC ??_C@_0DF@PGJMIHPP@xmlXPtrEval?3?5evaluation?5failed?5@ ; `string'
PUBLIC ??_C@_0CP@NCKIHCDF@xmlXPtrEval?3?5object?$CIs?$CJ?5left?5on?5@ ; `string'
PUBLIC ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@ ; `string'
PUBLIC ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@ ; `string'
PUBLIC ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@ ; `string'
EXTRN _xmlStrdup:PROC
EXTRN _xmlStrchr:PROC
EXTRN _xmlStrncmp:PROC
EXTRN _xmlStrEqual:PROC
EXTRN _xmlStrlen:PROC
EXTRN _xmlNewText:PROC
EXTRN _xmlNewTextLen:PROC
EXTRN _xmlCopyNode:PROC
EXTRN _xmlAddChild:PROC
EXTRN _xmlAddNextSibling:PROC
EXTRN _xmlResetError:PROC
EXTRN ___xmlRaiseError:PROC
EXTRN ___xmlGenericError:PROC
EXTRN ___xmlGenericErrorContext:PROC
EXTRN _xmlXPathFreeObject:PROC
EXTRN _xmlXPathObjectCopy:PROC
EXTRN _xmlXPathCmpNodes:PROC
EXTRN _xmlXPathNewContext:PROC
EXTRN _xmlXPathInit:PROC
EXTRN _xmlParseURI:PROC
EXTRN _xmlSaveUri:PROC
EXTRN _xmlFreeURI:PROC
EXTRN _xmlXPathErr:PROC
EXTRN _xmlXPathRegisterNs:PROC
EXTRN _xmlXPathRegisterFunc:PROC
EXTRN _xmlXPathNewParserContext:PROC
EXTRN _xmlXPathFreeParserContext:PROC
EXTRN _valuePop:PROC
EXTRN _valuePush:PROC
EXTRN _xmlXPathNewString:PROC
EXTRN _xmlXPathNewNodeSet:PROC
EXTRN _xmlXPathRoot:PROC
EXTRN _xmlXPathEvalExpr:PROC
EXTRN _xmlXPathParseName:PROC
EXTRN _xmlXPathParseNCName:PROC
EXTRN _xmlXPathEvaluatePredicateResult:PROC
EXTRN _xmlXPathIdFunction:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN _memset:PROC
; COMDAT ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@
CONST SEGMENT
??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@ DB 'Internal erro'
DB 'r at %s:%d', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
CONST SEGMENT
??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@ DB 'Unimplem'
DB 'ented block at %s:%d', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
CONST SEGMENT
??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@ DB 'c:\users\dag'
DB '\documents\_clients\codeproject authors group\windows on arm\'
DB 'libxml2\libxml2-2.9.9\xpointer.c', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0CP@NCKIHCDF@xmlXPtrEval?3?5object?$CIs?$CJ?5left?5on?5@
CONST SEGMENT
??_C@_0CP@NCKIHCDF@xmlXPtrEval?3?5object?$CIs?$CJ?5left?5on?5@ DB 'xmlXPt'
DB 'rEval: object(s) left on the eval stack', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0DF@PGJMIHPP@xmlXPtrEval?3?5evaluation?5failed?5@
CONST SEGMENT
??_C@_0DF@PGJMIHPP@xmlXPtrEval?3?5evaluation?5failed?5@ DB 'xmlXPtrEval: '
DB 'evaluation failed to return a node set', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_07NGBELOAG@?5origin@
CONST SEGMENT
??_C@_07NGBELOAG@?5origin@ DB ' origin', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_04NDJIBAID@here@
CONST SEGMENT
??_C@_04NDJIBAID@here@ DB 'here', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_09BKKFPLJK@end?9point@
CONST SEGMENT
??_C@_09BKKFPLJK@end?9point@ DB 'end-point', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0M@KAHBAHMC@start?9point@
CONST SEGMENT
??_C@_0M@KAHBAHMC@start?9point@ DB 'start-point', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0N@NHPDEMLM@string?9range@
CONST SEGMENT
??_C@_0N@NHPDEMLM@string?9range@ DB 'string-range', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0N@FPBCPIBK@range?9inside@
CONST SEGMENT
??_C@_0N@FPBCPIBK@range?9inside@ DB 'range-inside', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_05CCGOGOBM@range@
CONST SEGMENT
??_C@_05CCGOGOBM@range@ DB 'range', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BO@HMMGLLBJ@allocating?5evaluation?5context@
CONST SEGMENT
??_C@_0BO@HMMGLLBJ@allocating?5evaluation?5context@ DB 'allocating evalua'
DB 'tion context', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0CG@PNGJONJE@warning?3?5ChildSeq?5not?5starting?5@
CONST SEGMENT
??_C@_0CG@PNGJONJE@warning?3?5ChildSeq?5not?5starting?5@ DB 'warning: Chi'
DB 'ldSeq not starting by /1', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BJ@PBEDODCO@unsupported?5scheme?5?8?$CFs?8?6@
CONST SEGMENT
??_C@_0BJ@PBEDODCO@unsupported?5scheme?5?8?$CFs?8?6@ DB 'unsupported sche'
DB 'me ''%s''', 0aH, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_05PPEFOGKI@xmlns@
CONST SEGMENT
??_C@_05PPEFOGKI@xmlns@ DB 'xmlns', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_07HCLJNICE@element@
CONST SEGMENT
??_C@_07HCLJNICE@element@ DB 'element', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_08DNJCJFMK@xpointer@
CONST SEGMENT
??_C@_08DNJCJFMK@xpointer@ DB 'xpointer', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BC@MDOPFBLJ@allocating?5buffer@
CONST SEGMENT
??_C@_0BC@MDOPFBLJ@allocating?5buffer@ DB 'allocating buffer', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
CONST SEGMENT
??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@ DB 'adding location to set', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BH@HNICMPAH@allocating?5locationset@
CONST SEGMENT
??_C@_0BH@HNICMPAH@allocating?5locationset@ DB 'allocating locationset', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BB@PBEHJOM@allocating?5range@
CONST SEGMENT
??_C@_0BB@PBEHJOM@allocating?5range@ DB 'allocating range', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BB@DMDDEGKA@allocating?5point@
CONST SEGMENT
??_C@_0BB@DMDDEGKA@allocating?5point@ DB 'allocating point', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
CONST SEGMENT
??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@ DB 'Memory al'
DB 'location failed : %s', 0aH, 00H ; `string'
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
push ebp
mov ebp, esp
pop ebp
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetEndPoint
_TEXT SEGMENT
_obj$ = 8 ; size = 4
_node$ = 12 ; size = 4
_indx$ = 16 ; size = 4
_xmlXPtrGetEndPoint PROC ; COMDAT
; 2634 : xmlXPtrGetEndPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _obj$[ebp]
test ecx, ecx
je SHORT $LN5@xmlXPtrGet
; 2635 : if ((obj == NULL) || (node == NULL) || (indx == NULL))
mov edx, DWORD PTR _node$[ebp]
test edx, edx
je SHORT $LN5@xmlXPtrGet
mov esi, DWORD PTR _indx$[ebp]
test esi, esi
je SHORT $LN5@xmlXPtrGet
; 2637 :
; 2638 : switch (obj->type) {
mov eax, DWORD PTR [ecx]
sub eax, 5
je SHORT $LN6@xmlXPtrGet
sub eax, 1
jne SHORT $LN5@xmlXPtrGet
$LN6@xmlXPtrGet:
; 2639 : case XPATH_POINT:
; 2640 : *node = obj->user;
; 2641 : if (obj->index <= 0)
; 2642 : *indx = 0;
; 2643 : else
; 2644 : *indx = obj->index;
; 2645 : return(0);
; 2646 : case XPATH_RANGE:
; 2647 : *node = obj->user;
; 2648 : if (obj->index <= 0)
; 2649 : *indx = 0;
; 2650 : else
; 2651 : *indx = obj->index;
; 2652 : return(0);
; 2653 : default:
; 2654 : break;
; 2655 : }
; 2656 : return(-1);
; 2657 : }
mov eax, DWORD PTR [ecx+28]
mov DWORD PTR [edx], eax
xor eax, eax
mov ecx, DWORD PTR [ecx+32]
test ecx, ecx
cmovg eax, ecx
mov DWORD PTR [esi], eax
xor eax, eax
pop esi
pop ebp
ret 0
$LN5@xmlXPtrGet:
; 2636 : return(-1);
or eax, -1
pop esi
; 2639 : case XPATH_POINT:
; 2640 : *node = obj->user;
; 2641 : if (obj->index <= 0)
; 2642 : *indx = 0;
; 2643 : else
; 2644 : *indx = obj->index;
; 2645 : return(0);
; 2646 : case XPATH_RANGE:
; 2647 : *node = obj->user;
; 2648 : if (obj->index <= 0)
; 2649 : *indx = 0;
; 2650 : else
; 2651 : *indx = obj->index;
; 2652 : return(0);
; 2653 : default:
; 2654 : break;
; 2655 : }
; 2656 : return(-1);
; 2657 : }
pop ebp
ret 0
_xmlXPtrGetEndPoint ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetStartPoint
_TEXT SEGMENT
_obj$ = 8 ; size = 4
_node$ = 12 ; size = 4
_indx$ = 16 ; size = 4
_xmlXPtrGetStartPoint PROC ; COMDAT
; 2598 : xmlXPtrGetStartPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _obj$[ebp]
test ecx, ecx
je SHORT $LN5@xmlXPtrGet
; 2599 : if ((obj == NULL) || (node == NULL) || (indx == NULL))
mov edx, DWORD PTR _node$[ebp]
test edx, edx
je SHORT $LN5@xmlXPtrGet
mov esi, DWORD PTR _indx$[ebp]
test esi, esi
je SHORT $LN5@xmlXPtrGet
; 2601 :
; 2602 : switch (obj->type) {
mov eax, DWORD PTR [ecx]
sub eax, 5
je SHORT $LN6@xmlXPtrGet
sub eax, 1
jne SHORT $LN5@xmlXPtrGet
$LN6@xmlXPtrGet:
; 2603 : case XPATH_POINT:
; 2604 : *node = obj->user;
; 2605 : if (obj->index <= 0)
; 2606 : *indx = 0;
; 2607 : else
; 2608 : *indx = obj->index;
; 2609 : return(0);
; 2610 : case XPATH_RANGE:
; 2611 : *node = obj->user;
; 2612 : if (obj->index <= 0)
; 2613 : *indx = 0;
; 2614 : else
; 2615 : *indx = obj->index;
; 2616 : return(0);
; 2617 : default:
; 2618 : break;
; 2619 : }
; 2620 : return(-1);
; 2621 : }
mov eax, DWORD PTR [ecx+28]
mov DWORD PTR [edx], eax
xor eax, eax
mov ecx, DWORD PTR [ecx+32]
test ecx, ecx
cmovg eax, ecx
mov DWORD PTR [esi], eax
xor eax, eax
pop esi
pop ebp
ret 0
$LN5@xmlXPtrGet:
; 2600 : return(-1);
or eax, -1
pop esi
; 2603 : case XPATH_POINT:
; 2604 : *node = obj->user;
; 2605 : if (obj->index <= 0)
; 2606 : *indx = 0;
; 2607 : else
; 2608 : *indx = obj->index;
; 2609 : return(0);
; 2610 : case XPATH_RANGE:
; 2611 : *node = obj->user;
; 2612 : if (obj->index <= 0)
; 2613 : *indx = 0;
; 2614 : else
; 2615 : *indx = obj->index;
; 2616 : return(0);
; 2617 : default:
; 2618 : break;
; 2619 : }
; 2620 : return(-1);
; 2621 : }
pop ebp
ret 0
_xmlXPtrGetStartPoint ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetLastChar
_TEXT SEGMENT
_node$ = 8 ; size = 4
_indx$ = 12 ; size = 4
_xmlXPtrGetLastChar PROC ; COMDAT
; 2552 : xmlXPtrGetLastChar(xmlNodePtr *node, int *indx) {
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _node$[ebp]
test edi, edi
je SHORT $LN5@xmlXPtrGet
; 2553 : xmlNodePtr cur;
; 2554 : int pos, len = 0;
; 2555 :
; 2556 : if ((node == NULL) || (*node == NULL) ||
; 2557 : ((*node)->type == XML_NAMESPACE_DECL) || (indx == NULL))
mov esi, DWORD PTR [edi]
test esi, esi
je SHORT $LN5@xmlXPtrGet
mov eax, DWORD PTR [esi+4]
cmp eax, 18 ; 00000012H
je SHORT $LN5@xmlXPtrGet
mov ebx, DWORD PTR _indx$[ebp]
test ebx, ebx
je SHORT $LN5@xmlXPtrGet
; 2561 :
; 2562 : if ((cur->type == XML_ELEMENT_NODE) ||
; 2563 : (cur->type == XML_DOCUMENT_NODE) ||
cmp eax, 1
je SHORT $LN7@xmlXPtrGet
cmp eax, 9
je SHORT $LN7@xmlXPtrGet
cmp eax, 13 ; 0000000dH
jne SHORT $LN15@xmlXPtrGet
$LN7@xmlXPtrGet:
; 2558 : return(-1);
; 2559 : cur = *node;
; 2560 : pos = *indx;
mov eax, DWORD PTR [ebx]
; 2564 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 2565 : if (pos > 0) {
test eax, eax
jle SHORT $LN15@xmlXPtrGet
; 2566 : cur = xmlXPtrGetNthChild(cur, pos);
push eax
push esi
call _xmlXPtrGetNthChild
add esp, 8
mov esi, eax
$LN15@xmlXPtrGet:
; 2567 : }
; 2568 : }
; 2569 : while (cur != NULL) {
test esi, esi
je SHORT $LN5@xmlXPtrGet
$LL2@xmlXPtrGet:
; 2570 : if (cur->last != NULL)
mov eax, DWORD PTR [esi+16]
test eax, eax
je SHORT $LN9@xmlXPtrGet
; 2571 : cur = cur->last;
mov esi, eax
test esi, esi
jne SHORT $LL2@xmlXPtrGet
$LN5@xmlXPtrGet:
pop edi
; 2585 : }
pop esi
or eax, -1
pop ebx
pop ebp
ret 0
$LN9@xmlXPtrGet:
; 2572 : else if ((cur->type != XML_ELEMENT_NODE) &&
cmp DWORD PTR [esi+4], 1
je SHORT $LN5@xmlXPtrGet
mov eax, DWORD PTR [esi+40]
test eax, eax
je SHORT $LN5@xmlXPtrGet
; 2573 : (cur->content != NULL)) {
; 2574 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
add esp, 4
; 2575 : break;
; 2576 : } else {
; 2577 : return(-1);
; 2578 : }
; 2579 : }
; 2580 : if (cur == NULL)
; 2581 : return(-1);
; 2582 : *node = cur;
mov DWORD PTR [edi], esi
; 2583 : *indx = len;
mov DWORD PTR [ebx], eax
; 2584 : return(0);
xor eax, eax
pop edi
; 2585 : }
pop esi
pop ebx
pop ebp
ret 0
_xmlXPtrGetLastChar ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrSearchString
_TEXT SEGMENT
tv429 = -28 ; size = 4
_len$1$ = -24 ; size = 4
_pos$1$ = -20 ; size = 4
_first$ = -16 ; size = 1
_cur$1$ = -12 ; size = 4
_string$1$ = -8 ; size = 4
_pos$2$ = -4 ; size = 4
_string$ = 8 ; size = 4
_start$ = 12 ; size = 4
_startindex$ = 16 ; size = 4
_end$ = 20 ; size = 4
_endindex$ = 24 ; size = 4
_xmlXPtrSearchString PROC ; COMDAT
; 2468 : xmlNodePtr *end, int *endindex) {
push ebp
mov ebp, esp
sub esp, 28 ; 0000001cH
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push ebx
push edi
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _string$[ebp]
test ecx, ecx
je $LN8@xmlXPtrSea
; 2469 : xmlNodePtr cur;
; 2470 : const xmlChar *str;
; 2471 : int pos; /* 0 based */
; 2472 : int len; /* in bytes */
; 2473 : xmlChar first;
; 2474 :
; 2475 : if (string == NULL)
; 2476 : return(-1);
; 2477 : if ((start == NULL) || (*start == NULL) ||
; 2478 : ((*start)->type == XML_NAMESPACE_DECL) || (startindex == NULL))
mov eax, DWORD PTR _start$[ebp]
test eax, eax
je $LN8@xmlXPtrSea
mov ebx, DWORD PTR [eax]
mov DWORD PTR _cur$1$[ebp], ebx
test ebx, ebx
je $LN8@xmlXPtrSea
cmp DWORD PTR [ebx+4], 18 ; 00000012H
je $LN8@xmlXPtrSea
mov edx, DWORD PTR _startindex$[ebp]
test edx, edx
je $LN8@xmlXPtrSea
; 2480 : if ((end == NULL) || (endindex == NULL))
mov edi, DWORD PTR _end$[ebp]
test edi, edi
je $LN8@xmlXPtrSea
mov eax, DWORD PTR _endindex$[ebp]
test eax, eax
je $LN8@xmlXPtrSea
; 2481 : return(-1);
; 2482 : cur = *start;
; 2483 : pos = *startindex - 1;
; 2484 : first = string[0];
mov cl, BYTE PTR [ecx]
push esi
mov esi, DWORD PTR [edx]
dec esi
mov BYTE PTR _first$[ebp], cl
npad 7
$LL2@xmlXPtrSea:
; 2485 :
; 2486 : while (cur != NULL) {
; 2487 : if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
cmp DWORD PTR [ebx+4], 1
je $LN61@xmlXPtrSea
mov eax, DWORD PTR [ebx+40]
test eax, eax
je $LN66@xmlXPtrSea
; 2488 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
add esp, 4
mov DWORD PTR _len$1$[ebp], eax
; 2489 : while (pos <= len) {
cmp esi, eax
jg $LN66@xmlXPtrSea
npad 7
$LL4@xmlXPtrSea:
; 2490 : if (first != 0) {
cmp BYTE PTR _first$[ebp], 0
je $LN12@xmlXPtrSea
; 2491 : str = xmlStrchr(&cur->content[pos], first);
mov eax, DWORD PTR [ebx+40]
push DWORD PTR _first$[ebp]
add eax, esi
push eax
call _xmlStrchr
mov ecx, eax
add esp, 8
; 2492 : if (str != NULL) {
test ecx, ecx
je $LN14@xmlXPtrSea
; 2493 : pos = (str - (xmlChar *)(cur->content));
sub ecx, DWORD PTR [ebx+40]
; 2393 : if ((start == NULL) || (start->type == XML_NAMESPACE_DECL))
cmp DWORD PTR [ebx+4], 18 ; 00000012H
; 2494 : #ifdef DEBUG_RANGES
; 2495 : xmlGenericError(xmlGenericErrorContext,
; 2496 : "found '%c' at index %d of ->",
; 2497 : first, pos + 1);
; 2498 : xmlDebugDumpString(stdout, cur->content);
; 2499 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2500 : #endif
; 2501 : if (xmlXPtrMatchString(string, cur, pos + 1,
mov edx, DWORD PTR _string$[ebp]
mov DWORD PTR _pos$2$[ebp], ecx
mov DWORD PTR _string$1$[ebp], edx
; 2393 : if ((start == NULL) || (start->type == XML_NAMESPACE_DECL))
je $LN58@xmlXPtrSea
; 2394 : return(-1);
; 2395 : if ((end == NULL) || (*end == NULL) ||
; 2396 : ((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL))
mov eax, DWORD PTR [edi]
test eax, eax
je $LN58@xmlXPtrSea
cmp DWORD PTR [eax+4], 18 ; 00000012H
je $LN58@xmlXPtrSea
; 2397 : return(-1);
; 2398 : cur = start;
; 2399 : pos = startindex - 1;
mov esi, ecx
mov edi, ebx
; 2400 : stringlen = xmlStrlen(string);
push edx
mov DWORD PTR _pos$1$[ebp], esi
call _xmlStrlen
mov ebx, eax
add esp, 4
; 2401 :
; 2402 : while (stringlen > 0) {
test ebx, ebx
jle SHORT $LN63@xmlXPtrSea
$LL21@xmlXPtrSea:
; 2403 : if ((cur == *end) && (pos + stringlen > *endindex))
mov ecx, DWORD PTR _end$[ebp]
lea eax, DWORD PTR [esi+ebx]
mov DWORD PTR tv429[ebp], eax
cmp edi, DWORD PTR [ecx]
jne SHORT $LN52@xmlXPtrSea
mov ecx, DWORD PTR _endindex$[ebp]
cmp eax, DWORD PTR [ecx]
jg $LN43@xmlXPtrSea
$LN52@xmlXPtrSea:
; 2404 : return(0);
; 2405 :
; 2406 : if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
cmp DWORD PTR [edi+4], 1
je SHORT $LN35@xmlXPtrSea
mov eax, DWORD PTR [edi+40]
test eax, eax
je SHORT $LN35@xmlXPtrSea
; 2407 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
mov ecx, DWORD PTR [edi+40]
mov esi, eax
mov eax, DWORD PTR _pos$1$[ebp]
add esp, 4
add ecx, eax
; 2408 : if (len >= pos + stringlen) {
lea edx, DWORD PTR [eax+ebx]
cmp esi, edx
jge SHORT $LN42@xmlXPtrSea
; 2421 : } else {
; 2422 : return(0);
; 2423 : }
; 2424 : } else {
; 2425 : int sub = len - pos;
sub esi, eax
; 2426 : match = (!xmlStrncmp(&cur->content[pos], string, sub));
push esi
push DWORD PTR _string$1$[ebp]
push ecx
call _xmlStrncmp
add esp, 12 ; 0000000cH
test eax, eax
; 2427 : if (match) {
jne SHORT $LN43@xmlXPtrSea
; 2428 : #ifdef DEBUG_RANGES
; 2429 : xmlGenericError(xmlGenericErrorContext,
; 2430 : "found subrange %d bytes at index %d of ->",
; 2431 : sub, pos + 1);
; 2432 : xmlDebugDumpString(stdout, cur->content);
; 2433 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2434 : #endif
; 2435 : string = &string[sub];
add DWORD PTR _string$1$[ebp], esi
; 2436 : stringlen -= sub;
sub ebx, esi
$LN35@xmlXPtrSea:
; 2437 : } else {
; 2438 : return(0);
; 2439 : }
; 2440 : }
; 2441 : }
; 2442 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push edi
call _xmlXPtrAdvanceNode
mov edi, eax
add esp, 8
; 2443 : if (cur == NULL)
test edi, edi
je SHORT $LN43@xmlXPtrSea
; 2444 : return(0);
; 2445 : pos = 0;
xor esi, esi
mov DWORD PTR _pos$1$[ebp], esi
test ebx, ebx
jg SHORT $LL21@xmlXPtrSea
$LN63@xmlXPtrSea:
; 2502 : end, endindex)) {
; 2503 : *start = cur;
mov ecx, DWORD PTR _pos$2$[ebp]
$LN58@xmlXPtrSea:
lea esi, DWORD PTR [ecx+1]
$LN44@xmlXPtrSea:
mov ecx, DWORD PTR _start$[ebp]
mov eax, DWORD PTR _cur$1$[ebp]
mov DWORD PTR [ecx], eax
; 2504 : *startindex = pos + 1;
; 2505 : return(1);
mov eax, 1
mov ecx, DWORD PTR _startindex$[ebp]
mov DWORD PTR [ecx], esi
pop esi
pop edi
; 2538 : }
; 2539 : return(0);
; 2540 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN42@xmlXPtrSea:
; 2409 : match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
mov esi, DWORD PTR _pos$2$[ebp]
push ebx
push DWORD PTR _string$1$[ebp]
inc esi
push ecx
call _xmlStrncmp
add esp, 12 ; 0000000cH
test eax, eax
; 2410 : if (match) {
jne SHORT $LN56@xmlXPtrSea
; 2411 : #ifdef DEBUG_RANGES
; 2412 : xmlGenericError(xmlGenericErrorContext,
; 2413 : "found range %d bytes at index %d of ->",
; 2414 : stringlen, pos + 1);
; 2415 : xmlDebugDumpString(stdout, cur->content);
; 2416 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2417 : #endif
; 2418 : *end = cur;
mov eax, DWORD PTR _end$[ebp]
; 2419 : *endindex = pos + stringlen;
mov ecx, DWORD PTR _endindex$[ebp]
mov DWORD PTR [eax], edi
mov eax, DWORD PTR tv429[ebp]
mov DWORD PTR [ecx], eax
; 2420 : return(1);
jmp SHORT $LN44@xmlXPtrSea
$LN43@xmlXPtrSea:
; 2506 : }
; 2507 : pos++;
; 2508 : } else {
mov esi, DWORD PTR _pos$2$[ebp]
inc esi
$LN56@xmlXPtrSea:
mov ebx, DWORD PTR _cur$1$[ebp]
mov edi, DWORD PTR _end$[ebp]
mov eax, DWORD PTR _len$1$[ebp]
jmp SHORT $LN15@xmlXPtrSea
$LN14@xmlXPtrSea:
; 2509 : pos = len + 1;
mov eax, DWORD PTR _len$1$[ebp]
lea esi, DWORD PTR [eax+1]
$LN15@xmlXPtrSea:
; 2489 : while (pos <= len) {
cmp esi, eax
jle $LL4@xmlXPtrSea
$LN66@xmlXPtrSea:
; 2528 : return(1);
; 2529 : }
; 2530 : }
; 2531 : }
; 2532 : if ((cur == *end) && (pos >= *endindex))
mov eax, DWORD PTR _endindex$[ebp]
$LN61@xmlXPtrSea:
cmp ebx, DWORD PTR [edi]
jne SHORT $LN17@xmlXPtrSea
cmp esi, DWORD PTR [eax]
jge SHORT $LN46@xmlXPtrSea
$LN17@xmlXPtrSea:
; 2533 : return(0);
; 2534 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push ebx
call _xmlXPtrAdvanceNode
mov ebx, eax
mov DWORD PTR _cur$1$[ebp], eax
add esp, 8
; 2535 : if (cur == NULL)
test ebx, ebx
je SHORT $LN46@xmlXPtrSea
; 2537 : pos = 1;
mov eax, DWORD PTR _endindex$[ebp]
mov esi, 1
jmp $LL2@xmlXPtrSea
$LN12@xmlXPtrSea:
; 2510 : }
; 2511 : } else {
; 2512 : /*
; 2513 : * An empty string is considered to match before each
; 2514 : * character of the string-value and after the final
; 2515 : * character.
; 2516 : */
; 2517 : #ifdef DEBUG_RANGES
; 2518 : xmlGenericError(xmlGenericErrorContext,
; 2519 : "found '' at index %d of ->",
; 2520 : pos + 1);
; 2521 : xmlDebugDumpString(stdout, cur->content);
; 2522 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2523 : #endif
; 2524 : *start = cur;
mov ecx, DWORD PTR _start$[ebp]
; 2525 : *startindex = pos + 1;
lea eax, DWORD PTR [esi+1]
pop esi
mov DWORD PTR [ecx], ebx
mov ecx, DWORD PTR _startindex$[ebp]
mov DWORD PTR [ecx], eax
; 2526 : *end = cur;
; 2527 : *endindex = pos + 1;
mov ecx, DWORD PTR _endindex$[ebp]
mov DWORD PTR [edi], ebx
pop edi
; 2538 : }
; 2539 : return(0);
; 2540 : }
pop ebx
mov DWORD PTR [ecx], eax
mov eax, 1
mov esp, ebp
pop ebp
ret 0
$LN46@xmlXPtrSea:
pop esi
pop edi
; 2536 : return(0);
xor eax, eax
; 2538 : }
; 2539 : return(0);
; 2540 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN8@xmlXPtrSea:
pop edi
; 2479 : return(-1);
or eax, -1
; 2538 : }
; 2539 : return(0);
; 2540 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
_xmlXPtrSearchString ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrMatchString
_TEXT SEGMENT
tv281 = -8 ; size = 4
_pos$1$ = -4 ; size = 4
_string$ = 8 ; size = 4
_start$ = 12 ; size = 4
_startindex$ = 16 ; size = 4
_end$ = 20 ; size = 4
_endindex$ = 24 ; size = 4
_xmlXPtrMatchString PROC ; COMDAT
; 2384 : xmlNodePtr *end, int *endindex) {
push ebp
mov ebp, esp
sub esp, 8
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push esi
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _string$[ebp]
test ecx, ecx
je $LN6@xmlXPtrMat
; 2385 : xmlNodePtr cur;
; 2386 : int pos; /* 0 based */
; 2387 : int len; /* in bytes */
; 2388 : int stringlen; /* in bytes */
; 2389 : int match;
; 2390 :
; 2391 : if (string == NULL)
; 2392 : return(-1);
; 2393 : if ((start == NULL) || (start->type == XML_NAMESPACE_DECL))
mov esi, DWORD PTR _start$[ebp]
test esi, esi
je $LN6@xmlXPtrMat
cmp DWORD PTR [esi+4], 18 ; 00000012H
je $LN6@xmlXPtrMat
; 2395 : if ((end == NULL) || (*end == NULL) ||
; 2396 : ((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL))
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je $LN6@xmlXPtrMat
mov eax, DWORD PTR [eax]
test eax, eax
je $LN6@xmlXPtrMat
cmp DWORD PTR [eax+4], 18 ; 00000012H
je $LN6@xmlXPtrMat
cmp DWORD PTR _endindex$[ebp], 0
je $LN6@xmlXPtrMat
; 2397 : return(-1);
; 2398 : cur = start;
; 2399 : pos = startindex - 1;
push ebx
push edi
mov edi, DWORD PTR _startindex$[ebp]
dec edi
; 2400 : stringlen = xmlStrlen(string);
push ecx
mov DWORD PTR _pos$1$[ebp], edi
call _xmlStrlen
mov ebx, eax
add esp, 4
; 2401 :
; 2402 : while (stringlen > 0) {
test ebx, ebx
jle $LN3@xmlXPtrMat
$LL2@xmlXPtrMat:
; 2403 : if ((cur == *end) && (pos + stringlen > *endindex))
mov ecx, DWORD PTR _end$[ebp]
lea eax, DWORD PTR [edi+ebx]
mov DWORD PTR tv281[ebp], eax
cmp esi, DWORD PTR [ecx]
jne SHORT $LN25@xmlXPtrMat
mov ecx, DWORD PTR _endindex$[ebp]
cmp eax, DWORD PTR [ecx]
jg $LN22@xmlXPtrMat
$LN25@xmlXPtrMat:
; 2404 : return(0);
; 2405 :
; 2406 : if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
cmp DWORD PTR [esi+4], 1
je SHORT $LN16@xmlXPtrMat
mov eax, DWORD PTR [esi+40]
test eax, eax
je SHORT $LN16@xmlXPtrMat
; 2407 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
mov edx, DWORD PTR [esi+40]
mov edi, eax
mov eax, DWORD PTR _pos$1$[ebp]
add esp, 4
add edx, eax
; 2408 : if (len >= pos + stringlen) {
lea ecx, DWORD PTR [eax+ebx]
cmp edi, ecx
jge SHORT $LN21@xmlXPtrMat
; 2421 : } else {
; 2422 : return(0);
; 2423 : }
; 2424 : } else {
; 2425 : int sub = len - pos;
sub edi, eax
; 2426 : match = (!xmlStrncmp(&cur->content[pos], string, sub));
push edi
push DWORD PTR _string$[ebp]
push edx
call _xmlStrncmp
add esp, 12 ; 0000000cH
test eax, eax
; 2427 : if (match) {
jne SHORT $LN22@xmlXPtrMat
; 2428 : #ifdef DEBUG_RANGES
; 2429 : xmlGenericError(xmlGenericErrorContext,
; 2430 : "found subrange %d bytes at index %d of ->",
; 2431 : sub, pos + 1);
; 2432 : xmlDebugDumpString(stdout, cur->content);
; 2433 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2434 : #endif
; 2435 : string = &string[sub];
add DWORD PTR _string$[ebp], edi
; 2436 : stringlen -= sub;
sub ebx, edi
$LN16@xmlXPtrMat:
; 2437 : } else {
; 2438 : return(0);
; 2439 : }
; 2440 : }
; 2441 : }
; 2442 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push esi
call _xmlXPtrAdvanceNode
mov esi, eax
add esp, 8
; 2443 : if (cur == NULL)
test esi, esi
je SHORT $LN22@xmlXPtrMat
; 2445 : pos = 0;
xor edi, edi
mov DWORD PTR _pos$1$[ebp], edi
test ebx, ebx
jg SHORT $LL2@xmlXPtrMat
; 2420 : return(1);
lea eax, DWORD PTR [edi+1]
pop edi
pop ebx
pop esi
; 2446 : }
; 2447 : return(1);
; 2448 : }
mov esp, ebp
pop ebp
ret 0
$LN21@xmlXPtrMat:
; 2409 : match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
push ebx
push DWORD PTR _string$[ebp]
push edx
call _xmlStrncmp
add esp, 12 ; 0000000cH
test eax, eax
; 2410 : if (match) {
jne SHORT $LN22@xmlXPtrMat
; 2411 : #ifdef DEBUG_RANGES
; 2412 : xmlGenericError(xmlGenericErrorContext,
; 2413 : "found range %d bytes at index %d of ->",
; 2414 : stringlen, pos + 1);
; 2415 : xmlDebugDumpString(stdout, cur->content);
; 2416 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2417 : #endif
; 2418 : *end = cur;
mov eax, DWORD PTR _end$[ebp]
; 2419 : *endindex = pos + stringlen;
mov ecx, DWORD PTR _endindex$[ebp]
mov DWORD PTR [eax], esi
mov eax, DWORD PTR tv281[ebp]
mov DWORD PTR [ecx], eax
$LN3@xmlXPtrMat:
; 2420 : return(1);
pop edi
pop ebx
mov eax, 1
pop esi
; 2446 : }
; 2447 : return(1);
; 2448 : }
mov esp, ebp
pop ebp
ret 0
$LN22@xmlXPtrMat:
pop edi
pop ebx
; 2444 : return(0);
xor eax, eax
pop esi
; 2446 : }
; 2447 : return(1);
; 2448 : }
mov esp, ebp
pop ebp
ret 0
$LN6@xmlXPtrMat:
; 2394 : return(-1);
or eax, -1
pop esi
; 2446 : }
; 2447 : return(1);
; 2448 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrMatchString ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrAdvanceChar
_TEXT SEGMENT
_node$ = 8 ; size = 4
_indx$ = 12 ; size = 4
_bytes$ = 16 ; size = 4
_xmlXPtrAdvanceChar PROC ; COMDAT
; 2294 : xmlXPtrAdvanceChar(xmlNodePtr *node, int *indx, int bytes) {
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _node$[ebp]
test ecx, ecx
je SHORT $LN7@xmlXPtrAdv
; 2295 : xmlNodePtr cur;
; 2296 : int pos;
; 2297 : int len;
; 2298 :
; 2299 : if ((node == NULL) || (indx == NULL))
mov edx, DWORD PTR _indx$[ebp]
test edx, edx
je SHORT $LN7@xmlXPtrAdv
; 2300 : return(-1);
; 2301 : cur = *node;
mov esi, DWORD PTR [ecx]
; 2302 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
test esi, esi
je SHORT $LN7@xmlXPtrAdv
cmp DWORD PTR [esi+4], 18 ; 00000012H
je SHORT $LN7@xmlXPtrAdv
; 2303 : return(-1);
; 2304 : pos = *indx;
; 2305 :
; 2306 : while (bytes >= 0) {
mov ebx, DWORD PTR _bytes$[ebp]
mov edi, DWORD PTR [edx]
test ebx, ebx
js SHORT $LN7@xmlXPtrAdv
$LL2@xmlXPtrAdv:
; 2307 : /*
; 2308 : * First position to the beginning of the first text node
; 2309 : * corresponding to this point
; 2310 : */
; 2311 : while ((cur != NULL) &&
test esi, esi
je SHORT $LN24@xmlXPtrAdv
$LL4@xmlXPtrAdv:
mov eax, DWORD PTR [esi+4]
cmp eax, 1
je SHORT $LN10@xmlXPtrAdv
cmp eax, 9
je SHORT $LN10@xmlXPtrAdv
cmp eax, 13 ; 0000000dH
jne SHORT $LN5@xmlXPtrAdv
$LN10@xmlXPtrAdv:
; 2312 : ((cur->type == XML_ELEMENT_NODE) ||
; 2313 : (cur->type == XML_DOCUMENT_NODE) ||
; 2314 : (cur->type == XML_HTML_DOCUMENT_NODE))) {
; 2315 : if (pos > 0) {
test edi, edi
jle SHORT $LN11@xmlXPtrAdv
; 2316 : cur = xmlXPtrGetNthChild(cur, pos);
push edi
push esi
call _xmlXPtrGetNthChild
; 2317 : pos = 0;
; 2318 : } else {
jmp SHORT $LN36@xmlXPtrAdv
$LN11@xmlXPtrAdv:
; 2319 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push esi
call _xmlXPtrAdvanceNode
$LN36@xmlXPtrAdv:
; 2307 : /*
; 2308 : * First position to the beginning of the first text node
; 2309 : * corresponding to this point
; 2310 : */
; 2311 : while ((cur != NULL) &&
mov esi, eax
add esp, 8
xor edi, edi
test esi, esi
jne SHORT $LL4@xmlXPtrAdv
$LN24@xmlXPtrAdv:
; 2320 : pos = 0;
; 2321 : }
; 2322 : }
; 2323 :
; 2324 : if (cur == NULL) {
; 2325 : *node = NULL;
mov ecx, DWORD PTR _node$[ebp]
mov DWORD PTR [ecx], 0
; 2326 : *indx = 0;
mov ecx, DWORD PTR _indx$[ebp]
mov DWORD PTR [ecx], 0
$LN7@xmlXPtrAdv:
; 2360 : return(0);
; 2361 : }
; 2362 : }
; 2363 : return(-1);
; 2364 : }
pop edi
pop esi
or eax, -1
pop ebx
pop ebp
ret 0
$LN5@xmlXPtrAdv:
; 2327 : return(-1);
; 2328 : }
; 2329 :
; 2330 : /*
; 2331 : * if there is no move needed return the current value.
; 2332 : */
; 2333 : if (pos == 0) pos = 1;
test edi, edi
mov ecx, 1
cmove edi, ecx
; 2334 : if (bytes == 0) {
test ebx, ebx
je $LN25@xmlXPtrAdv
; 2338 : }
; 2339 : /*
; 2340 : * We should have a text (or cdata) node ...
; 2341 : */
; 2342 : len = 0;
xor ebx, ebx
; 2343 : if ((cur->type != XML_ELEMENT_NODE) &&
cmp eax, ecx
je SHORT $LN16@xmlXPtrAdv
mov eax, DWORD PTR [esi+40]
test eax, eax
je SHORT $LN16@xmlXPtrAdv
; 2344 : (cur->content != NULL)) {
; 2345 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
add esp, 4
mov ebx, eax
$LN16@xmlXPtrAdv:
; 2346 : }
; 2347 : if (pos > len) {
cmp edi, ebx
jle SHORT $LN17@xmlXPtrAdv
; 2348 : /* Strange, the indx in the text node is greater than it's len */
; 2349 : STRANGE
call ___xmlGenericError
mov edi, eax
call ___xmlGenericErrorContext
push 2349 ; 0000092dH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [edi]
call eax
add esp, 16 ; 00000010H
; 2350 : pos = len;
mov edi, ebx
$LN17@xmlXPtrAdv:
; 2351 : }
; 2352 : if (pos + bytes >= len) {
mov eax, DWORD PTR _bytes$[ebp]
add eax, edi
cmp eax, ebx
jl SHORT $LN26@xmlXPtrAdv
; 2353 : bytes -= (len - pos);
sub edi, ebx
mov ebx, DWORD PTR _bytes$[ebp]
; 2354 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
add ebx, edi
push esi
mov DWORD PTR _bytes$[ebp], ebx
call _xmlXPtrAdvanceNode
add esp, 8
; 2355 : pos = 0;
xor edi, edi
mov esi, eax
test ebx, ebx
jns $LL2@xmlXPtrAdv
; 2360 : return(0);
; 2361 : }
; 2362 : }
; 2363 : return(-1);
; 2364 : }
pop edi
pop esi
or eax, -1
pop ebx
pop ebp
ret 0
$LN26@xmlXPtrAdv:
; 2356 : } else if (pos + bytes < len) {
; 2357 : pos += bytes;
; 2358 : *node = cur;
mov ecx, DWORD PTR _node$[ebp]
pop edi
mov DWORD PTR [ecx], esi
; 2359 : *indx = pos;
mov ecx, DWORD PTR _indx$[ebp]
; 2360 : return(0);
; 2361 : }
; 2362 : }
; 2363 : return(-1);
; 2364 : }
pop esi
pop ebx
mov DWORD PTR [ecx], eax
xor eax, eax
pop ebp
ret 0
$LN25@xmlXPtrAdv:
; 2335 : *node = cur;
mov ecx, DWORD PTR _node$[ebp]
; 2336 : *indx = pos;
; 2337 : return(0);
xor eax, eax
mov DWORD PTR [ecx], esi
mov ecx, DWORD PTR _indx$[ebp]
mov DWORD PTR [ecx], edi
pop edi
; 2360 : return(0);
; 2361 : }
; 2362 : }
; 2363 : return(-1);
; 2364 : }
pop esi
pop ebx
pop ebp
ret 0
_xmlXPtrAdvanceChar ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrInsideRange
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_loc$ = 12 ; size = 4
_xmlXPtrInsideRange PROC ; COMDAT
; 2073 : xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _loc$[ebp]
test eax, eax
je SHORT $LN10@xmlXPtrIns
; 2074 : if (loc == NULL)
; 2075 : return(NULL);
; 2076 : if ((ctxt == NULL) || (ctxt->context == NULL) ||
mov ecx, DWORD PTR _ctxt$[ebp]
test ecx, ecx
je SHORT $LN10@xmlXPtrIns
mov ecx, DWORD PTR [ecx+12]
test ecx, ecx
je SHORT $LN10@xmlXPtrIns
cmp DWORD PTR [ecx], 0
je SHORT $LN10@xmlXPtrIns
; 2077 : (ctxt->context->doc == NULL))
; 2078 : return(NULL);
; 2079 : switch (loc->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 5
je SHORT $LN11@xmlXPtrIns
sub ecx, 1
je SHORT $LN17@xmlXPtrIns
; 2115 : case XML_PI_NODE:
; 2116 : case XML_COMMENT_NODE:
; 2117 : case XML_TEXT_NODE:
; 2118 : case XML_CDATA_SECTION_NODE: {
; 2119 : if (node->content == NULL) {
; 2120 : return(xmlXPtrNewRange(node, 0, node, 0));
; 2121 : } else {
; 2122 : return(xmlXPtrNewRange(node, 0, node,
; 2123 : xmlStrlen(node->content)));
; 2124 : }
; 2125 : }
; 2126 : case XML_ATTRIBUTE_NODE:
; 2127 : case XML_ELEMENT_NODE:
; 2128 : case XML_ENTITY_REF_NODE:
; 2129 : case XML_DOCUMENT_NODE:
; 2130 : case XML_NOTATION_NODE:
; 2131 : case XML_HTML_DOCUMENT_NODE: {
; 2132 : return(xmlXPtrNewRange(node, 0, node,
; 2133 : xmlXPtrGetArity(node)));
; 2134 : }
; 2135 : default:
; 2136 : break;
; 2137 : }
; 2138 : return(NULL);
; 2139 : }
; 2140 : }
; 2141 : default:
; 2142 : TODO /* missed one case ??? */
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 2142 ; 0000085eH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
$LN10@xmlXPtrIns:
; 2143 : }
; 2144 : return(NULL);
; 2145 : }
xor eax, eax
pop esi
pop ebp
ret 0
$LN17@xmlXPtrIns:
; 2083 : case XML_PI_NODE:
; 2084 : case XML_COMMENT_NODE:
; 2085 : case XML_TEXT_NODE:
; 2086 : case XML_CDATA_SECTION_NODE: {
; 2087 : if (node->content == NULL) {
; 2088 : return(xmlXPtrNewRange(node, 0, node, 0));
; 2089 : } else {
; 2090 : return(xmlXPtrNewRange(node, 0, node,
; 2091 : xmlStrlen(node->content)));
; 2092 : }
; 2093 : }
; 2094 : case XML_ATTRIBUTE_NODE:
; 2095 : case XML_ELEMENT_NODE:
; 2096 : case XML_ENTITY_REF_NODE:
; 2097 : case XML_DOCUMENT_NODE:
; 2098 : case XML_NOTATION_NODE:
; 2099 : case XML_HTML_DOCUMENT_NODE: {
; 2100 : return(xmlXPtrNewRange(node, 0, node,
; 2101 : xmlXPtrGetArity(node)));
; 2102 : }
; 2103 : default:
; 2104 : break;
; 2105 : }
; 2106 : return(NULL);
; 2107 : }
; 2108 : case XPATH_RANGE: {
; 2109 : xmlNodePtr node = (xmlNodePtr) loc->user;
; 2110 : if (loc->user2 != NULL) {
mov ecx, DWORD PTR [eax+36]
mov esi, DWORD PTR [eax+28]
test ecx, ecx
je SHORT $LN18@xmlXPtrIns
; 2111 : return(xmlXPtrNewRange(node, loc->index,
push DWORD PTR [eax+40]
push ecx
push DWORD PTR [eax+32]
push esi
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
pop esi
; 2143 : }
; 2144 : return(NULL);
; 2145 : }
pop ebp
ret 0
$LN18@xmlXPtrIns:
; 2112 : loc->user2, loc->index2));
; 2113 : } else {
; 2114 : switch (node->type) {
mov eax, DWORD PTR [esi+4]
dec eax
cmp eax, 12 ; 0000000cH
ja SHORT $LN10@xmlXPtrIns
movzx eax, BYTE PTR $LN39@xmlXPtrIns[eax]
jmp DWORD PTR $LN44@xmlXPtrIns[eax*4]
$LN11@xmlXPtrIns:
; 2080 : case XPATH_POINT: {
; 2081 : xmlNodePtr node = (xmlNodePtr) loc->user;
mov esi, DWORD PTR [eax+28]
; 2082 : switch (node->type) {
mov eax, DWORD PTR [esi+4]
dec eax
cmp eax, 12 ; 0000000cH
ja SHORT $LN10@xmlXPtrIns
movzx eax, BYTE PTR $LN40@xmlXPtrIns[eax]
jmp DWORD PTR $LN45@xmlXPtrIns[eax*4]
$LN12@xmlXPtrIns:
; 2143 : }
; 2144 : return(NULL);
; 2145 : }
mov eax, DWORD PTR [esi+40]
test eax, eax
jne SHORT $LN13@xmlXPtrIns
push eax
push esi
push eax
push esi
call _xmlXPtrNewRangeInternal
mov esi, eax
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
mov eax, esi
pop esi
pop ebp
ret 0
$LN13@xmlXPtrIns:
push eax
call _xmlStrlen
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
pop esi
pop ebp
ret 0
$LN14@xmlXPtrIns:
push esi
call _xmlXPtrGetArity
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
pop esi
pop ebp
ret 0
npad 1
$LN44@xmlXPtrIns:
DD $LN14@xmlXPtrIns
DD $LN12@xmlXPtrIns
DD $LN10@xmlXPtrIns
$LN39@xmlXPtrIns:
DB 0
DB 0
DB 1
DB 1
DB 0
DB 2
DB 1
DB 1
DB 0
DB 2
DB 2
DB 0
DB 0
npad 3
$LN45@xmlXPtrIns:
DD $LN14@xmlXPtrIns
DD $LN12@xmlXPtrIns
DD $LN10@xmlXPtrIns
$LN40@xmlXPtrIns:
DB 0
DB 0
DB 1
DB 1
DB 0
DB 2
DB 1
DB 1
DB 0
DB 2
DB 2
DB 0
DB 0
_xmlXPtrInsideRange ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrCoveringRange
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_loc$ = 12 ; size = 4
_xmlXPtrCoveringRange PROC ; COMDAT
; 1949 : xmlXPtrCoveringRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _loc$[ebp]
test ecx, ecx
je SHORT $LN8@xmlXPtrCov
; 1950 : if (loc == NULL)
; 1951 : return(NULL);
; 1952 : if ((ctxt == NULL) || (ctxt->context == NULL) ||
mov eax, DWORD PTR _ctxt$[ebp]
test eax, eax
je SHORT $LN8@xmlXPtrCov
mov eax, DWORD PTR [eax+12]
test eax, eax
je SHORT $LN8@xmlXPtrCov
mov edx, DWORD PTR [eax]
test edx, edx
je SHORT $LN8@xmlXPtrCov
; 1953 : (ctxt->context->doc == NULL))
; 1954 : return(NULL);
; 1955 : switch (loc->type) {
mov eax, DWORD PTR [ecx]
sub eax, 5
je $LN9@xmlXPtrCov
sub eax, 1
je SHORT $LN10@xmlXPtrCov
; 1987 : node, indx + 1));
; 1988 : }
; 1989 : default:
; 1990 : return(NULL);
; 1991 : }
; 1992 : }
; 1993 : }
; 1994 : default:
; 1995 : TODO /* missed one case ??? */
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1995 ; 000007cbH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
$LN8@xmlXPtrCov:
; 1996 : }
; 1997 : return(NULL);
; 1998 : }
xor eax, eax
pop esi
pop ebp
ret 0
$LN10@xmlXPtrCov:
; 1958 : loc->user, loc->index));
; 1959 : case XPATH_RANGE:
; 1960 : if (loc->user2 != NULL) {
mov eax, DWORD PTR [ecx+36]
test eax, eax
je SHORT $LN11@xmlXPtrCov
; 1961 : return(xmlXPtrNewRange(loc->user, loc->index,
push DWORD PTR [ecx+40]
push eax
push DWORD PTR [ecx+32]
push DWORD PTR [ecx+28]
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
pop esi
; 1996 : }
; 1997 : return(NULL);
; 1998 : }
pop ebp
ret 0
$LN11@xmlXPtrCov:
; 1962 : loc->user2, loc->index2));
; 1963 : } else {
; 1964 : xmlNodePtr node = (xmlNodePtr) loc->user;
mov esi, DWORD PTR [ecx+28]
; 1965 : if (node == (xmlNodePtr) ctxt->context->doc) {
cmp esi, edx
je SHORT $LN15@xmlXPtrCov
; 1966 : return(xmlXPtrNewRange(node, 0, node,
; 1967 : xmlXPtrGetArity(node)));
; 1968 : } else {
; 1969 : switch (node->type) {
mov ecx, DWORD PTR [esi+4]
lea eax, DWORD PTR [ecx-1]
cmp eax, 12 ; 0000000cH
ja SHORT $LN8@xmlXPtrCov
movzx eax, BYTE PTR $LN33@xmlXPtrCov[eax]
jmp DWORD PTR $LN35@xmlXPtrCov[eax*4]
$LN15@xmlXPtrCov:
; 1996 : }
; 1997 : return(NULL);
; 1998 : }
push esi
call _xmlXPtrGetArity
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
pop esi
pop ebp
ret 0
$LN16@xmlXPtrCov:
; 1970 : case XML_ATTRIBUTE_NODE:
; 1971 : /* !!! our model is slightly different than XPath */
; 1972 : return(xmlXPtrNewRange(node, 0, node,
; 1973 : xmlXPtrGetArity(node)));
; 1974 : case XML_ELEMENT_NODE:
; 1975 : case XML_TEXT_NODE:
; 1976 : case XML_CDATA_SECTION_NODE:
; 1977 : case XML_ENTITY_REF_NODE:
; 1978 : case XML_PI_NODE:
; 1979 : case XML_COMMENT_NODE:
; 1980 : case XML_DOCUMENT_NODE:
; 1981 : case XML_NOTATION_NODE:
; 1982 : case XML_HTML_DOCUMENT_NODE: {
; 1983 : int indx = xmlXPtrGetIndex(node);
mov eax, esi
; 169 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
cmp ecx, 18 ; 00000012H
je SHORT $LN25@xmlXPtrCov
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov edx, 1
$LL23@xmlXPtrCov:
; 172 : if ((cur->type == XML_ELEMENT_NODE) ||
; 173 : (cur->type == XML_DOCUMENT_NODE) ||
mov ecx, DWORD PTR [eax+4]
cmp ecx, 1
je SHORT $LN27@xmlXPtrCov
cmp ecx, 9
je SHORT $LN27@xmlXPtrCov
cmp ecx, 13 ; 0000000dH
jne SHORT $LN21@xmlXPtrCov
$LN27@xmlXPtrCov:
; 174 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 175 : i++;
inc edx
$LN21@xmlXPtrCov:
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov eax, DWORD PTR [eax+28]
test eax, eax
jne SHORT $LL23@xmlXPtrCov
; 176 : }
; 177 : }
; 178 : return(i);
jmp SHORT $LN20@xmlXPtrCov
$LN25@xmlXPtrCov:
; 170 : return(-1);
or edx, -1
$LN20@xmlXPtrCov:
; 1984 :
; 1985 : node = node->parent;
mov ecx, DWORD PTR [esi+20]
; 1986 : return(xmlXPtrNewRange(node, indx - 1,
lea eax, DWORD PTR [edx+1]
push eax
push ecx
lea eax, DWORD PTR [edx-1]
push eax
push ecx
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
pop esi
; 1996 : }
; 1997 : return(NULL);
; 1998 : }
pop ebp
ret 0
$LN9@xmlXPtrCov:
; 1956 : case XPATH_POINT:
; 1957 : return(xmlXPtrNewRange(loc->user, loc->index,
mov eax, DWORD PTR [ecx+32]
mov ecx, DWORD PTR [ecx+28]
push eax
push ecx
push eax
push ecx
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
pop esi
; 1996 : }
; 1997 : return(NULL);
; 1998 : }
pop ebp
ret 0
$LN35@xmlXPtrCov:
DD $LN16@xmlXPtrCov
DD $LN15@xmlXPtrCov
DD $LN8@xmlXPtrCov
$LN33@xmlXPtrCov:
DB 0
DB 1
DB 0
DB 0
DB 0
DB 2
DB 0
DB 0
DB 0
DB 2
DB 2
DB 0
DB 0
_xmlXPtrCoveringRange ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNbLocChildren
_TEXT SEGMENT
_node$ = 8 ; size = 4
_xmlXPtrNbLocChildren PROC ; COMDAT
; 1676 : xmlXPtrNbLocChildren(xmlNodePtr node) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edx, DWORD PTR _node$[ebp]
xor ecx, ecx
test edx, edx
je SHORT $LN11@xmlXPtrNbL
; 1677 : int ret = 0;
; 1678 : if (node == NULL)
; 1679 : return(-1);
; 1680 : switch (node->type) {
mov eax, DWORD PTR [edx+4]
dec eax
cmp eax, 12 ; 0000000cH
ja SHORT $LN11@xmlXPtrNbL
movzx eax, BYTE PTR $LN17@xmlXPtrNbL[eax]
jmp DWORD PTR $LN19@xmlXPtrNbL[eax*4]
$LN7@xmlXPtrNbL:
; 1681 : case XML_HTML_DOCUMENT_NODE:
; 1682 : case XML_DOCUMENT_NODE:
; 1683 : case XML_ELEMENT_NODE:
; 1684 : node = node->children;
mov edx, DWORD PTR [edx+12]
; 1685 : while (node != NULL) {
test edx, edx
je SHORT $LN2@xmlXPtrNbL
$LL4@xmlXPtrNbL:
; 1686 : if (node->type == XML_ELEMENT_NODE)
; 1687 : ret++;
; 1688 : node = node->next;
cmp DWORD PTR [edx+4], 1
lea eax, DWORD PTR [ecx+1]
mov edx, DWORD PTR [edx+24]
cmovne eax, ecx
mov ecx, eax
test edx, edx
jne SHORT $LL4@xmlXPtrNbL
; 1705 : }
pop ebp
ret 0
$LN10@xmlXPtrNbL:
; 1689 : }
; 1690 : break;
; 1691 : case XML_ATTRIBUTE_NODE:
; 1692 : return(-1);
; 1693 :
; 1694 : case XML_PI_NODE:
; 1695 : case XML_COMMENT_NODE:
; 1696 : case XML_TEXT_NODE:
; 1697 : case XML_CDATA_SECTION_NODE:
; 1698 : case XML_ENTITY_REF_NODE:
; 1699 : ret = xmlStrlen(node->content);
push DWORD PTR [edx+40]
call _xmlStrlen
add esp, 4
mov ecx, eax
$LN2@xmlXPtrNbL:
; 1703 : }
; 1704 : return(ret);
mov eax, ecx
; 1705 : }
pop ebp
ret 0
$LN11@xmlXPtrNbL:
; 1700 : break;
; 1701 : default:
; 1702 : return(-1);
or eax, -1
; 1705 : }
pop ebp
ret 0
npad 1
$LN19@xmlXPtrNbL:
DD $LN7@xmlXPtrNbL
DD $LN11@xmlXPtrNbL
DD $LN10@xmlXPtrNbL
DD $LN11@xmlXPtrNbL
$LN17@xmlXPtrNbL:
DB 0
DB 1
DB 2
DB 2
DB 2
DB 3
DB 2
DB 2
DB 0
DB 3
DB 3
DB 3
DB 0
_xmlXPtrNbLocChildren ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrBuildRangeNodeList
_TEXT SEGMENT
_tmp$4$ = -24 ; size = 4
_end$1$ = -20 ; size = 4
_start$1$ = -16 ; size = 4
$T1 = -12 ; size = 4
_tmp$1$ = -8 ; size = 4
_last$1$ = -8 ; size = 4
_parent$1$ = -4 ; size = 4
_index1$1$ = 8 ; size = 4
_range$ = 8 ; size = 4
_xmlXPtrBuildRangeNodeList PROC ; COMDAT
; 1409 : xmlXPtrBuildRangeNodeList(xmlXPathObjectPtr range) {
push ebp
mov ebp, esp
sub esp, 24 ; 00000018H
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _range$[ebp]
xor esi, esi
xor edx, edx
mov DWORD PTR _last$1$[ebp], esi
xor ebx, ebx
mov DWORD PTR _parent$1$[ebp], edx
test eax, eax
je $LN9@xmlXPtrBui
; 1410 : /* pointers to generated nodes */
; 1411 : xmlNodePtr list = NULL, last = NULL, parent = NULL, tmp;
; 1412 : /* pointers to traversal nodes */
; 1413 : xmlNodePtr start, cur, end;
; 1414 : int index1, index2;
; 1415 :
; 1416 : if (range == NULL)
; 1417 : return(NULL);
; 1418 : if (range->type != XPATH_RANGE)
cmp DWORD PTR [eax], 6
jne $LN9@xmlXPtrBui
; 1419 : return(NULL);
; 1420 : start = (xmlNodePtr) range->user;
mov ecx, DWORD PTR [eax+28]
mov DWORD PTR _start$1$[ebp], ecx
; 1421 :
; 1422 : if ((start == NULL) || (start->type == XML_NAMESPACE_DECL))
test ecx, ecx
je $LN9@xmlXPtrBui
cmp DWORD PTR [ecx+4], 18 ; 00000012H
je $LN9@xmlXPtrBui
; 1423 : return(NULL);
; 1424 : end = range->user2;
mov edi, DWORD PTR [eax+36]
mov DWORD PTR _end$1$[ebp], edi
; 1425 : if (end == NULL)
test edi, edi
jne SHORT $LN10@xmlXPtrBui
; 1426 : return(xmlCopyNode(start, 1));
push 1
push ecx
call _xmlCopyNode
add esp, 8
pop edi
; 1567 : }
; 1568 : return(list);
; 1569 : }
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN10@xmlXPtrBui:
; 1427 : if (end->type == XML_NAMESPACE_DECL)
cmp DWORD PTR [edi+4], 18 ; 00000012H
je $LN9@xmlXPtrBui
; 1428 : return(NULL);
; 1429 :
; 1430 : cur = start;
mov edi, ecx
; 1431 : index1 = range->index;
mov ecx, DWORD PTR [eax+32]
; 1432 : index2 = range->index2;
mov eax, DWORD PTR [eax+40]
mov DWORD PTR _index1$1$[ebp], ecx
mov DWORD PTR $T1[ebp], eax
npad 1
$LL2@xmlXPtrBui:
; 1434 : if (cur == end) {
cmp edi, DWORD PTR _end$1$[ebp]
jne $LN12@xmlXPtrBui
; 1435 : if (cur->type == XML_TEXT_NODE) {
cmp DWORD PTR [edi+4], 3
je $LN55@xmlXPtrBui
; 1461 : } else {
; 1462 : tmp = xmlCopyNode(cur, 0);
push 0
push edi
call _xmlCopyNode
add esp, 8
mov DWORD PTR _tmp$1$[ebp], eax
; 1463 : if (list == NULL)
test ebx, ebx
jne SHORT $LN23@xmlXPtrBui
; 1464 : list = tmp;
mov ebx, eax
jmp SHORT $LN26@xmlXPtrBui
$LN23@xmlXPtrBui:
; 1465 : else {
; 1466 : if (last != NULL)
push eax
test esi, esi
je SHORT $LN25@xmlXPtrBui
; 1467 : xmlAddNextSibling(last, tmp);
push esi
call _xmlAddNextSibling
jmp SHORT $LN65@xmlXPtrBui
$LN25@xmlXPtrBui:
; 1468 : else
; 1469 : xmlAddChild(parent, tmp);
mov ecx, DWORD PTR _parent$1$[ebp]
push ecx
call _xmlAddChild
$LN65@xmlXPtrBui:
; 1470 : }
; 1471 : last = NULL;
mov eax, DWORD PTR _tmp$1$[ebp]
add esp, 8
$LN26@xmlXPtrBui:
xor esi, esi
; 1472 : parent = tmp;
mov DWORD PTR _parent$1$[ebp], eax
; 1473 :
; 1474 : if (index2 > 1) {
mov eax, DWORD PTR $T1[ebp]
mov DWORD PTR _last$1$[ebp], esi
cmp eax, 1
jle SHORT $LN27@xmlXPtrBui
; 1475 : end = xmlXPtrGetNthChild(cur, index2 - 1);
dec eax
push eax
push edi
call _xmlXPtrGetNthChild
add esp, 8
mov DWORD PTR _end$1$[ebp], eax
; 1476 : index2 = 0;
xor eax, eax
mov DWORD PTR $T1[ebp], eax
$LN27@xmlXPtrBui:
; 1477 : }
; 1478 : if ((cur == start) && (index1 > 1)) {
cmp edi, DWORD PTR _start$1$[ebp]
jne SHORT $LN28@xmlXPtrBui
mov eax, DWORD PTR _index1$1$[ebp]
cmp eax, 1
jle SHORT $LN28@xmlXPtrBui
; 1479 : cur = xmlXPtrGetNthChild(cur, index1 - 1);
dec eax
push eax
push edi
call _xmlXPtrGetNthChild
add esp, 8
; 1480 : index1 = 0;
xor ecx, ecx
mov DWORD PTR _index1$1$[ebp], ecx
; 1481 : } else {
jmp $LN66@xmlXPtrBui
$LN28@xmlXPtrBui:
; 1482 : cur = cur->children;
mov edi, DWORD PTR [edi+12]
; 1483 : }
; 1484 : /*
; 1485 : * Now gather the remaining nodes from cur to end
; 1486 : */
; 1487 : continue; /* while */
mov ecx, DWORD PTR _index1$1$[ebp]
jmp $LN58@xmlXPtrBui
$LN12@xmlXPtrBui:
; 1488 : }
; 1489 : } else if ((cur == start) &&
cmp edi, DWORD PTR _start$1$[ebp]
jne $LN30@xmlXPtrBui
test ebx, ebx
jne $LN30@xmlXPtrBui
; 1490 : (list == NULL) /* looks superfluous but ... */ ) {
; 1491 : if ((cur->type == XML_TEXT_NODE) ||
mov eax, DWORD PTR [edi+4]
cmp eax, 3
je SHORT $LN34@xmlXPtrBui
cmp eax, 4
je SHORT $LN34@xmlXPtrBui
; 1502 : }
; 1503 : last = list = tmp;
; 1504 : } else {
; 1505 : if ((cur == start) && (index1 > 1)) {
cmp ecx, 1
jle SHORT $LN38@xmlXPtrBui
; 1506 : tmp = xmlCopyNode(cur, 0);
push ebx
push edi
call _xmlCopyNode
mov ebx, eax
; 1507 : list = tmp;
; 1508 : parent = tmp;
; 1509 : last = NULL;
xor esi, esi
; 1510 : cur = xmlXPtrGetNthChild(cur, index1 - 1);
mov eax, DWORD PTR _index1$1$[ebp]
dec eax
mov DWORD PTR _parent$1$[ebp], ebx
push eax
push edi
mov DWORD PTR _last$1$[ebp], esi
call _xmlXPtrGetNthChild
add esp, 16 ; 00000010H
; 1511 : index1 = 0;
xor ecx, ecx
mov DWORD PTR _index1$1$[ebp], ecx
; 1512 : /*
; 1513 : * Now gather the remaining nodes from cur to end
; 1514 : */
; 1515 : continue; /* while */
jmp $LN66@xmlXPtrBui
$LN38@xmlXPtrBui:
; 1516 : }
; 1517 : tmp = xmlCopyNode(cur, 1);
push 1
push edi
call _xmlCopyNode
; 1518 : list = tmp;
; 1519 : parent = NULL;
; 1520 : last = tmp;
; 1521 : }
; 1522 : } else {
mov ebx, eax
add esp, 8
xor edx, edx
mov esi, ebx
mov DWORD PTR _parent$1$[ebp], edx
mov DWORD PTR _last$1$[ebp], esi
jmp $LN48@xmlXPtrBui
$LN34@xmlXPtrBui:
; 1492 : (cur->type == XML_CDATA_SECTION_NODE)) {
; 1493 : const xmlChar *content = cur->content;
mov eax, DWORD PTR [edi+40]
; 1494 :
; 1495 : if (content == NULL) {
test eax, eax
jne SHORT $LN35@xmlXPtrBui
; 1496 : tmp = xmlNewTextLen(NULL, 0);
push eax
push eax
call _xmlNewTextLen
mov edx, DWORD PTR _parent$1$[ebp]
; 1518 : list = tmp;
; 1519 : parent = NULL;
; 1520 : last = tmp;
; 1521 : }
; 1522 : } else {
mov ebx, eax
mov esi, ebx
add esp, 8
mov DWORD PTR _last$1$[ebp], esi
jmp $LN48@xmlXPtrBui
$LN35@xmlXPtrBui:
; 1497 : } else {
; 1498 : if (index1 > 1) {
cmp ecx, 1
jle SHORT $LN37@xmlXPtrBui
; 1499 : content += (index1 - 1);
dec eax
add eax, ecx
$LN37@xmlXPtrBui:
; 1500 : }
; 1501 : tmp = xmlNewText(content);
push eax
call _xmlNewText
mov edx, DWORD PTR _parent$1$[ebp]
; 1518 : list = tmp;
; 1519 : parent = NULL;
; 1520 : last = tmp;
; 1521 : }
; 1522 : } else {
mov ebx, eax
mov esi, ebx
add esp, 4
mov DWORD PTR _last$1$[ebp], esi
jmp $LN48@xmlXPtrBui
$LN30@xmlXPtrBui:
; 1523 : tmp = NULL;
; 1524 : switch (cur->type) {
mov eax, DWORD PTR [edi+4]
add eax, -2 ; fffffffeH
cmp eax, 18 ; 00000012H
ja SHORT $LN43@xmlXPtrBui
movzx eax, BYTE PTR $LN63@xmlXPtrBui[eax]
jmp DWORD PTR $LN73@xmlXPtrBui[eax*4]
$LN40@xmlXPtrBui:
; 1525 : case XML_DTD_NODE:
; 1526 : case XML_ELEMENT_DECL:
; 1527 : case XML_ATTRIBUTE_DECL:
; 1528 : case XML_ENTITY_NODE:
; 1529 : /* Do not copy DTD informations */
; 1530 : break;
; 1531 : case XML_ENTITY_DECL:
; 1532 : TODO /* handle crossing entities -> stack needed */
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1532 ; 000005fcH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
; 1533 : break;
mov esi, DWORD PTR _last$1$[ebp]
add esp, 16 ; 00000010H
jmp SHORT $LN64@xmlXPtrBui
$LN42@xmlXPtrBui:
; 1534 : case XML_XINCLUDE_START:
; 1535 : case XML_XINCLUDE_END:
; 1536 : /* don't consider it part of the tree content */
; 1537 : break;
; 1538 : case XML_ATTRIBUTE_NODE:
; 1539 : /* Humm, should not happen ! */
; 1540 : STRANGE
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1540 ; 00000604H
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
; 1541 : break;
mov esi, DWORD PTR _last$1$[ebp]
add esp, 16 ; 00000010H
jmp SHORT $LN64@xmlXPtrBui
$LN43@xmlXPtrBui:
; 1542 : default:
; 1543 : tmp = xmlCopyNode(cur, 1);
push 1
push edi
call _xmlCopyNode
add esp, 8
mov DWORD PTR _tmp$4$[ebp], eax
; 1544 : break;
; 1545 : }
; 1546 : if (tmp != NULL) {
test eax, eax
je SHORT $LN64@xmlXPtrBui
; 1547 : if ((list == NULL) || ((last == NULL) && (parent == NULL))) {
test ebx, ebx
je $LN56@xmlXPtrBui
test esi, esi
jne SHORT $LN61@xmlXPtrBui
mov ecx, DWORD PTR _parent$1$[ebp]
test ecx, ecx
je $LN56@xmlXPtrBui
; 1553 : else {
; 1554 : xmlAddChild(parent, tmp);
push eax
push ecx
call _xmlAddChild
; 1555 : last = tmp;
mov esi, DWORD PTR _tmp$4$[ebp]
mov DWORD PTR _last$1$[ebp], esi
jmp SHORT $LN70@xmlXPtrBui
$LN61@xmlXPtrBui:
; 1550 : }
; 1551 : if (last != NULL)
; 1552 : xmlAddNextSibling(last, tmp);
push eax
push esi
call _xmlAddNextSibling
$LN70@xmlXPtrBui:
; 1556 : }
; 1557 : }
; 1558 : }
; 1559 : /*
; 1560 : * Skip to next node in document order
; 1561 : */
; 1562 : if ((list == NULL) || ((last == NULL) && (parent == NULL))) {
add esp, 8
$LN64@xmlXPtrBui:
mov edx, DWORD PTR _parent$1$[ebp]
$LN48@xmlXPtrBui:
test ebx, ebx
je $LN57@xmlXPtrBui
test esi, esi
jne SHORT $LN49@xmlXPtrBui
test edx, edx
je $LN57@xmlXPtrBui
$LN49@xmlXPtrBui:
; 1564 : return(NULL);
; 1565 : }
; 1566 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push edi
call _xmlXPtrAdvanceNode
mov ecx, DWORD PTR _index1$1$[ebp]
add esp, 8
$LN66@xmlXPtrBui:
; 1433 : while (cur != NULL) {
mov edi, eax
$LN58@xmlXPtrBui:
test edi, edi
je SHORT $LN62@xmlXPtrBui
mov edx, DWORD PTR _parent$1$[ebp]
jmp $LL2@xmlXPtrBui
$LN55@xmlXPtrBui:
; 1436 : const xmlChar *content = cur->content;
mov eax, DWORD PTR [edi+40]
; 1437 : int len;
; 1438 :
; 1439 : if (content == NULL) {
test eax, eax
jne SHORT $LN16@xmlXPtrBui
; 1440 : tmp = xmlNewTextLen(NULL, 0);
xor edx, edx
; 1441 : } else {
jmp SHORT $LN19@xmlXPtrBui
$LN16@xmlXPtrBui:
; 1442 : len = index2;
; 1443 : if ((cur == start) && (index1 > 1)) {
cmp edi, DWORD PTR _start$1$[ebp]
jne SHORT $LN18@xmlXPtrBui
cmp ecx, 1
jle SHORT $LN18@xmlXPtrBui
; 1444 : content += (index1 - 1);
; 1445 : len -= (index1 - 1);
mov edx, DWORD PTR $T1[ebp]
dec eax
sub edx, ecx
add eax, ecx
inc edx
; 1446 : index1 = 0;
; 1447 : } else {
jmp SHORT $LN19@xmlXPtrBui
$LN18@xmlXPtrBui:
; 1448 : len = index2;
mov edx, DWORD PTR $T1[ebp]
$LN19@xmlXPtrBui:
; 1449 : }
; 1450 : tmp = xmlNewTextLen(content, len);
; 1451 : }
; 1452 : /* single sub text node selection */
; 1453 : if (list == NULL)
push edx
push eax
call _xmlNewTextLen
add esp, 8
test ebx, ebx
je SHORT $LN1@xmlXPtrBui
; 1454 : return(tmp);
; 1455 : /* prune and return full set */
; 1456 : if (last != NULL)
push eax
test esi, esi
je SHORT $LN21@xmlXPtrBui
; 1457 : xmlAddNextSibling(last, tmp);
push esi
call _xmlAddNextSibling
; 1460 : return(list);
add esp, 8
; 1567 : }
; 1568 : return(list);
; 1569 : }
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN21@xmlXPtrBui:
; 1458 : else
; 1459 : xmlAddChild(parent, tmp);
mov ecx, DWORD PTR _parent$1$[ebp]
push ecx
call _xmlAddChild
; 1460 : return(list);
add esp, 8
$LN62@xmlXPtrBui:
; 1567 : }
; 1568 : return(list);
; 1569 : }
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN56@xmlXPtrBui:
; 1548 : STRANGE
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1548 ; 0000060cH
; 1549 : return(NULL);
jmp SHORT $LN71@xmlXPtrBui
$LN57@xmlXPtrBui:
; 1563 : STRANGE
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1563 ; 0000061bH
$LN71@xmlXPtrBui:
; 1567 : }
; 1568 : return(list);
; 1569 : }
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
$LN9@xmlXPtrBui:
xor eax, eax
$LN1@xmlXPtrBui:
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
npad 2
$LN73@xmlXPtrBui:
DD $LN42@xmlXPtrBui
DD $LN48@xmlXPtrBui
DD $LN40@xmlXPtrBui
DD $LN43@xmlXPtrBui
$LN63@xmlXPtrBui:
DB 0
DB 3
DB 3
DB 3
DB 1
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 1
DB 1
DB 1
DB 2
DB 3
DB 1
DB 1
_xmlXPtrBuildRangeNodeList ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrRangeFunction
_TEXT SEGMENT
_newset$1$ = -8 ; size = 4
_oldset$1$ = -4 ; size = 4
_set$1$ = 8 ; size = 4
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrRangeFunction PROC ; COMDAT
; 2014 : xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
sub esp, 8
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push edi
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _ctxt$[ebp]
test edi, edi
je $LN1@xmlXPtrRan
; 2015 : int i;
; 2016 : xmlXPathObjectPtr set;
; 2017 : xmlLocationSetPtr oldset;
; 2018 : xmlLocationSetPtr newset;
; 2019 :
; 2020 : CHECK_ARITY(1);
cmp DWORD PTR _nargs$[ebp], 1
je SHORT $LN6@xmlXPtrRan
push 12 ; 0000000cH
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN6@xmlXPtrRan:
; 2015 : int i;
; 2016 : xmlXPathObjectPtr set;
; 2017 : xmlLocationSetPtr oldset;
; 2018 : xmlLocationSetPtr newset;
; 2019 :
; 2020 : CHECK_ARITY(1);
mov eax, DWORD PTR [edi+44]
inc eax
cmp DWORD PTR [edi+20], eax
jge SHORT $LN7@xmlXPtrRan
push 23 ; 00000017H
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN7@xmlXPtrRan:
; 2021 : if ((ctxt->value == NULL) ||
mov eax, DWORD PTR [edi+16]
test eax, eax
je $LN9@xmlXPtrRan
mov eax, DWORD PTR [eax]
cmp eax, 7
je SHORT $LN8@xmlXPtrRan
cmp eax, 1
jne $LN9@xmlXPtrRan
$LN8@xmlXPtrRan:
push ebx
push esi
; 2025 :
; 2026 : set = valuePop(ctxt);
push edi
call _valuePop
mov ebx, eax
add esp, 4
mov DWORD PTR _set$1$[ebp], ebx
; 2027 : if (set->type == XPATH_NODESET) {
cmp DWORD PTR [ebx], 1
jne SHORT $LN10@xmlXPtrRan
; 2028 : xmlXPathObjectPtr tmp;
; 2029 :
; 2030 : /*
; 2031 : * First convert to a location set
; 2032 : */
; 2033 : tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
push DWORD PTR [ebx+4]
call _xmlXPtrNewLocationSetNodeSet
; 2034 : xmlXPathFreeObject(set);
push ebx
mov esi, eax
call _xmlXPathFreeObject
add esp, 8
; 2035 : if (tmp == NULL)
test esi, esi
jne SHORT $LN11@xmlXPtrRan
; 2036 : XP_ERROR(XPATH_MEMORY_ERROR)
push 15 ; 0000000fH
push edi
call _xmlXPathErr
add esp, 8
pop esi
pop ebx
$LN1@xmlXPtrRan:
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN11@xmlXPtrRan:
; 2037 : set = tmp;
mov ebx, esi
mov DWORD PTR _set$1$[ebp], esi
$LN10@xmlXPtrRan:
; 2038 : }
; 2039 : oldset = (xmlLocationSetPtr) set->user;
mov eax, DWORD PTR [ebx+28]
; 2040 :
; 2041 : /*
; 2042 : * The loop is to compute the covering range for each item and add it
; 2043 : */
; 2044 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
mov DWORD PTR _oldset$1$[ebp], eax
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR _newset$1$[ebp], eax
; 2045 : if (newset == NULL) {
test eax, eax
jne SHORT $LN12@xmlXPtrRan
; 2046 : xmlXPathFreeObject(set);
push ebx
call _xmlXPathFreeObject
; 2047 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push edi
call _xmlXPathErr
add esp, 12 ; 0000000cH
pop esi
pop ebx
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN12@xmlXPtrRan:
; 2048 : }
; 2049 : if (oldset != NULL) {
mov eax, DWORD PTR _oldset$1$[ebp]
test eax, eax
je SHORT $LN3@xmlXPtrRan
; 2050 : for (i = 0;i < oldset->locNr;i++) {
xor ebx, ebx
cmp DWORD PTR [eax], ebx
jle SHORT $LN52@xmlXPtrRan
$LL4@xmlXPtrRan:
; 2051 : xmlXPtrLocationSetAdd(newset,
mov eax, DWORD PTR [eax+8]
mov ecx, DWORD PTR [eax+ebx*4]
; 1950 : if (loc == NULL)
test ecx, ecx
je SHORT $LN22@xmlXPtrRan
; 1951 : return(NULL);
; 1952 : if ((ctxt == NULL) || (ctxt->context == NULL) ||
mov eax, DWORD PTR [edi+12]
test eax, eax
je SHORT $LN22@xmlXPtrRan
mov edx, DWORD PTR [eax]
test edx, edx
je SHORT $LN22@xmlXPtrRan
; 1953 : (ctxt->context->doc == NULL))
; 1954 : return(NULL);
; 1955 : switch (loc->type) {
mov eax, DWORD PTR [ecx]
sub eax, 5
je $LN23@xmlXPtrRan
sub eax, 1
je SHORT $LN24@xmlXPtrRan
; 1987 : node, indx + 1));
; 1988 : }
; 1989 : default:
; 1990 : return(NULL);
; 1991 : }
; 1992 : }
; 1993 : }
; 1994 : default:
; 1995 : TODO /* missed one case ??? */
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 1995 ; 000007cbH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
$LN22@xmlXPtrRan:
; 2051 : xmlXPtrLocationSetAdd(newset,
xor eax, eax
$LN15@xmlXPtrRan:
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
mov eax, DWORD PTR _oldset$1$[ebp]
inc ebx
add esp, 8
cmp ebx, DWORD PTR [eax]
jl SHORT $LL4@xmlXPtrRan
$LN52@xmlXPtrRan:
; 2052 : xmlXPtrCoveringRange(ctxt, oldset->locTab[i]));
; 2053 : }
; 2054 : }
; 2055 :
; 2056 : /*
; 2057 : * Save the new value and cleanup
; 2058 : */
; 2059 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
mov ebx, DWORD PTR _set$1$[ebp]
$LN3@xmlXPtrRan:
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrWrapLocationSet
push eax
push edi
call _valuePush
; 2060 : xmlXPathFreeObject(set);
push ebx
call _xmlXPathFreeObject
add esp, 16 ; 00000010H
pop esi
pop ebx
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN24@xmlXPtrRan:
; 1960 : if (loc->user2 != NULL) {
mov eax, DWORD PTR [ecx+36]
test eax, eax
je SHORT $LN25@xmlXPtrRan
; 1961 : return(xmlXPtrNewRange(loc->user, loc->index,
push DWORD PTR [ecx+40]
push eax
push DWORD PTR [ecx+32]
push DWORD PTR [ecx+28]
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
jmp SHORT $LN15@xmlXPtrRan
$LN25@xmlXPtrRan:
; 1962 : loc->user2, loc->index2));
; 1963 : } else {
; 1964 : xmlNodePtr node = (xmlNodePtr) loc->user;
mov esi, DWORD PTR [ecx+28]
; 1965 : if (node == (xmlNodePtr) ctxt->context->doc) {
cmp esi, edx
jne SHORT $LN27@xmlXPtrRan
$LN29@xmlXPtrRan:
; 2051 : xmlXPtrLocationSetAdd(newset,
push esi
call _xmlXPtrGetArity
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
jmp SHORT $LN15@xmlXPtrRan
$LN27@xmlXPtrRan:
; 1969 : switch (node->type) {
mov edx, DWORD PTR [esi+4]
lea eax, DWORD PTR [edx-1]
cmp eax, 12 ; 0000000cH
ja SHORT $LN22@xmlXPtrRan
movzx eax, BYTE PTR $LN51@xmlXPtrRan[eax]
jmp DWORD PTR $LN57@xmlXPtrRan[eax*4]
$LN30@xmlXPtrRan:
; 1970 : case XML_ATTRIBUTE_NODE:
; 1971 : /* !!! our model is slightly different than XPath */
; 1972 : return(xmlXPtrNewRange(node, 0, node,
; 1973 : xmlXPtrGetArity(node)));
; 1974 : case XML_ELEMENT_NODE:
; 1975 : case XML_TEXT_NODE:
; 1976 : case XML_CDATA_SECTION_NODE:
; 1977 : case XML_ENTITY_REF_NODE:
; 1978 : case XML_PI_NODE:
; 1979 : case XML_COMMENT_NODE:
; 1980 : case XML_DOCUMENT_NODE:
; 1981 : case XML_NOTATION_NODE:
; 1982 : case XML_HTML_DOCUMENT_NODE: {
; 1983 : int indx = xmlXPtrGetIndex(node);
mov ecx, esi
; 169 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
cmp edx, 18 ; 00000012H
je SHORT $LN39@xmlXPtrRan
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov edx, 1
$LL37@xmlXPtrRan:
; 172 : if ((cur->type == XML_ELEMENT_NODE) ||
; 173 : (cur->type == XML_DOCUMENT_NODE) ||
mov eax, DWORD PTR [ecx+4]
cmp eax, 1
je SHORT $LN41@xmlXPtrRan
cmp eax, 9
je SHORT $LN41@xmlXPtrRan
cmp eax, 13 ; 0000000dH
jne SHORT $LN35@xmlXPtrRan
$LN41@xmlXPtrRan:
; 174 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 175 : i++;
inc edx
$LN35@xmlXPtrRan:
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov ecx, DWORD PTR [ecx+28]
test ecx, ecx
jne SHORT $LL37@xmlXPtrRan
; 1986 : return(xmlXPtrNewRange(node, indx - 1,
mov ecx, DWORD PTR [esi+20]
lea eax, DWORD PTR [edx+1]
push eax
; 2051 : xmlXPtrLocationSetAdd(newset,
push ecx
; 1986 : return(xmlXPtrNewRange(node, indx - 1,
lea eax, DWORD PTR [edx-1]
; 2051 : xmlXPtrLocationSetAdd(newset,
push eax
push ecx
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
jmp $LN15@xmlXPtrRan
$LN39@xmlXPtrRan:
; 1985 : node = node->parent;
mov ecx, DWORD PTR [esi+20]
; 170 : return(-1);
or edx, -1
; 1986 : return(xmlXPtrNewRange(node, indx - 1,
lea eax, DWORD PTR [edx+1]
push eax
; 2051 : xmlXPtrLocationSetAdd(newset,
push ecx
; 1986 : return(xmlXPtrNewRange(node, indx - 1,
lea eax, DWORD PTR [edx-1]
; 2051 : xmlXPtrLocationSetAdd(newset,
push eax
push ecx
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
jmp $LN15@xmlXPtrRan
$LN23@xmlXPtrRan:
; 1957 : return(xmlXPtrNewRange(loc->user, loc->index,
mov eax, DWORD PTR [ecx+32]
mov ecx, DWORD PTR [ecx+28]
push eax
; 2051 : xmlXPtrLocationSetAdd(newset,
push ecx
push eax
push ecx
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
jmp $LN15@xmlXPtrRan
$LN9@xmlXPtrRan:
; 2022 : ((ctxt->value->type != XPATH_LOCATIONSET) &&
; 2023 : (ctxt->value->type != XPATH_NODESET)))
; 2024 : XP_ERROR(XPATH_INVALID_TYPE)
push 11 ; 0000000bH
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2061 : }
mov esp, ebp
pop ebp
ret 0
$LN57@xmlXPtrRan:
DD $LN30@xmlXPtrRan
DD $LN29@xmlXPtrRan
DD $LN22@xmlXPtrRan
$LN51@xmlXPtrRan:
DB 0
DB 1
DB 0
DB 0
DB 0
DB 2
DB 0
DB 0
DB 0
DB 2
DB 2
DB 0
DB 0
_xmlXPtrRangeFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrRangeInsideFunction
_TEXT SEGMENT
_oldset$1$ = -8 ; size = 4
_set$1$ = -4 ; size = 4
_newset$1$ = 8 ; size = 4
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrRangeInsideFunction PROC ; COMDAT
; 2168 : xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
sub esp, 8
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push edi
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _ctxt$[ebp]
test edi, edi
je $LN1@xmlXPtrRan
; 2169 : int i;
; 2170 : xmlXPathObjectPtr set;
; 2171 : xmlLocationSetPtr oldset;
; 2172 : xmlLocationSetPtr newset;
; 2173 :
; 2174 : CHECK_ARITY(1);
cmp DWORD PTR _nargs$[ebp], 1
je SHORT $LN6@xmlXPtrRan
push 12 ; 0000000cH
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
$LN6@xmlXPtrRan:
; 2169 : int i;
; 2170 : xmlXPathObjectPtr set;
; 2171 : xmlLocationSetPtr oldset;
; 2172 : xmlLocationSetPtr newset;
; 2173 :
; 2174 : CHECK_ARITY(1);
mov eax, DWORD PTR [edi+44]
inc eax
cmp DWORD PTR [edi+20], eax
jge SHORT $LN7@xmlXPtrRan
push 23 ; 00000017H
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
$LN7@xmlXPtrRan:
; 2175 : if ((ctxt->value == NULL) ||
mov eax, DWORD PTR [edi+16]
test eax, eax
je $LN9@xmlXPtrRan
mov eax, DWORD PTR [eax]
cmp eax, 7
je SHORT $LN8@xmlXPtrRan
cmp eax, 1
jne $LN9@xmlXPtrRan
$LN8@xmlXPtrRan:
push ebx
push esi
; 2179 :
; 2180 : set = valuePop(ctxt);
push edi
call _valuePop
mov ebx, eax
add esp, 4
mov DWORD PTR _set$1$[ebp], ebx
; 2181 : if (set->type == XPATH_NODESET) {
cmp DWORD PTR [ebx], 1
jne SHORT $LN10@xmlXPtrRan
; 2182 : xmlXPathObjectPtr tmp;
; 2183 :
; 2184 : /*
; 2185 : * First convert to a location set
; 2186 : */
; 2187 : tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
push DWORD PTR [ebx+4]
call _xmlXPtrNewLocationSetNodeSet
; 2188 : xmlXPathFreeObject(set);
push ebx
mov esi, eax
call _xmlXPathFreeObject
add esp, 8
; 2189 : if (tmp == NULL)
test esi, esi
jne SHORT $LN11@xmlXPtrRan
; 2190 : XP_ERROR(XPATH_MEMORY_ERROR)
push 15 ; 0000000fH
push edi
call _xmlXPathErr
add esp, 8
pop esi
pop ebx
$LN1@xmlXPtrRan:
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
$LN11@xmlXPtrRan:
; 2191 : set = tmp;
mov ebx, esi
mov DWORD PTR _set$1$[ebp], esi
$LN10@xmlXPtrRan:
; 2192 : }
; 2193 : oldset = (xmlLocationSetPtr) set->user;
mov esi, DWORD PTR [ebx+28]
; 2194 :
; 2195 : /*
; 2196 : * The loop is to compute the covering range for each item and add it
; 2197 : */
; 2198 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
mov DWORD PTR _oldset$1$[ebp], esi
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR _newset$1$[ebp], eax
; 2199 : if (newset == NULL) {
test eax, eax
jne SHORT $LN12@xmlXPtrRan
; 2200 : xmlXPathFreeObject(set);
push ebx
call _xmlXPathFreeObject
; 2201 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push edi
call _xmlXPathErr
add esp, 12 ; 0000000cH
pop esi
pop ebx
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
$LN12@xmlXPtrRan:
; 2202 : }
; 2203 : for (i = 0;i < oldset->locNr;i++) {
xor ebx, ebx
cmp DWORD PTR [esi], ebx
jle SHORT $LN3@xmlXPtrRan
npad 2
$LL4@xmlXPtrRan:
; 2204 : xmlXPtrLocationSetAdd(newset,
mov eax, DWORD PTR [esi+8]
mov eax, DWORD PTR [eax+ebx*4]
; 2074 : if (loc == NULL)
test eax, eax
je SHORT $LN23@xmlXPtrRan
; 2075 : return(NULL);
; 2076 : if ((ctxt == NULL) || (ctxt->context == NULL) ||
mov ecx, DWORD PTR [edi+12]
test ecx, ecx
je SHORT $LN23@xmlXPtrRan
cmp DWORD PTR [ecx], 0
je SHORT $LN23@xmlXPtrRan
; 2077 : (ctxt->context->doc == NULL))
; 2078 : return(NULL);
; 2079 : switch (loc->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 5
je $LN24@xmlXPtrRan
sub ecx, 1
je SHORT $LN30@xmlXPtrRan
; 2115 : case XML_PI_NODE:
; 2116 : case XML_COMMENT_NODE:
; 2117 : case XML_TEXT_NODE:
; 2118 : case XML_CDATA_SECTION_NODE: {
; 2119 : if (node->content == NULL) {
; 2120 : return(xmlXPtrNewRange(node, 0, node, 0));
; 2121 : } else {
; 2122 : return(xmlXPtrNewRange(node, 0, node,
; 2123 : xmlStrlen(node->content)));
; 2124 : }
; 2125 : }
; 2126 : case XML_ATTRIBUTE_NODE:
; 2127 : case XML_ELEMENT_NODE:
; 2128 : case XML_ENTITY_REF_NODE:
; 2129 : case XML_DOCUMENT_NODE:
; 2130 : case XML_NOTATION_NODE:
; 2131 : case XML_HTML_DOCUMENT_NODE: {
; 2132 : return(xmlXPtrNewRange(node, 0, node,
; 2133 : xmlXPtrGetArity(node)));
; 2134 : }
; 2135 : default:
; 2136 : break;
; 2137 : }
; 2138 : return(NULL);
; 2139 : }
; 2140 : }
; 2141 : default:
; 2142 : TODO /* missed one case ??? */
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 2142 ; 0000085eH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
$LN23@xmlXPtrRan:
; 2204 : xmlXPtrLocationSetAdd(newset,
xor esi, esi
$LN14@xmlXPtrRan:
push esi
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
mov esi, DWORD PTR _oldset$1$[ebp]
inc ebx
add esp, 8
cmp ebx, DWORD PTR [esi]
jl SHORT $LL4@xmlXPtrRan
mov eax, DWORD PTR _newset$1$[ebp]
$LN3@xmlXPtrRan:
; 2205 : xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
; 2206 : }
; 2207 :
; 2208 : /*
; 2209 : * Save the new value and cleanup
; 2210 : */
; 2211 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
push eax
call _xmlXPtrWrapLocationSet
push eax
push edi
call _valuePush
; 2212 : xmlXPathFreeObject(set);
push DWORD PTR _set$1$[ebp]
call _xmlXPathFreeObject
add esp, 16 ; 00000010H
pop esi
pop ebx
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
$LN30@xmlXPtrRan:
; 2110 : if (loc->user2 != NULL) {
mov ecx, DWORD PTR [eax+36]
mov esi, DWORD PTR [eax+28]
test ecx, ecx
je SHORT $LN31@xmlXPtrRan
; 2111 : return(xmlXPtrNewRange(node, loc->index,
push DWORD PTR [eax+40]
push ecx
push DWORD PTR [eax+32]
push esi
call _xmlXPtrNewRange
add esp, 16 ; 00000010H
mov esi, eax
jmp SHORT $LN14@xmlXPtrRan
$LN31@xmlXPtrRan:
; 2112 : loc->user2, loc->index2));
; 2113 : } else {
; 2114 : switch (node->type) {
mov eax, DWORD PTR [esi+4]
dec eax
cmp eax, 12 ; 0000000cH
ja SHORT $LN23@xmlXPtrRan
movzx eax, BYTE PTR $LN56@xmlXPtrRan[eax]
jmp DWORD PTR $LN64@xmlXPtrRan[eax*4]
$LN24@xmlXPtrRan:
; 2080 : case XPATH_POINT: {
; 2081 : xmlNodePtr node = (xmlNodePtr) loc->user;
mov esi, DWORD PTR [eax+28]
; 2082 : switch (node->type) {
mov eax, DWORD PTR [esi+4]
dec eax
cmp eax, 12 ; 0000000cH
ja SHORT $LN23@xmlXPtrRan
movzx eax, BYTE PTR $LN57@xmlXPtrRan[eax]
jmp DWORD PTR $LN65@xmlXPtrRan[eax*4]
$LN25@xmlXPtrRan:
; 2204 : xmlXPtrLocationSetAdd(newset,
mov eax, DWORD PTR [esi+40]
test eax, eax
jne SHORT $LN26@xmlXPtrRan
push eax
push esi
push eax
push esi
call _xmlXPtrNewRangeInternal
mov esi, eax
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
jmp $LN14@xmlXPtrRan
$LN26@xmlXPtrRan:
push eax
call _xmlStrlen
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
mov esi, eax
jmp $LN14@xmlXPtrRan
$LN27@xmlXPtrRan:
push esi
call _xmlXPtrGetArity
push eax
push esi
push 0
push esi
call _xmlXPtrNewRange
add esp, 20 ; 00000014H
mov esi, eax
jmp $LN14@xmlXPtrRan
$LN9@xmlXPtrRan:
; 2176 : ((ctxt->value->type != XPATH_LOCATIONSET) &&
; 2177 : (ctxt->value->type != XPATH_NODESET)))
; 2178 : XP_ERROR(XPATH_INVALID_TYPE)
push 11 ; 0000000bH
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 2213 : }
mov esp, ebp
pop ebp
ret 0
npad 3
$LN64@xmlXPtrRan:
DD $LN27@xmlXPtrRan
DD $LN25@xmlXPtrRan
DD $LN23@xmlXPtrRan
$LN56@xmlXPtrRan:
DB 0
DB 0
DB 1
DB 1
DB 0
DB 2
DB 1
DB 1
DB 0
DB 2
DB 2
DB 0
DB 0
npad 3
$LN65@xmlXPtrRan:
DD $LN27@xmlXPtrRan
DD $LN25@xmlXPtrRan
DD $LN23@xmlXPtrRan
$LN57@xmlXPtrRan:
DB 0
DB 0
DB 1
DB 1
DB 0
DB 2
DB 1
DB 1
DB 0
DB 2
DB 2
DB 0
DB 0
_xmlXPtrRangeInsideFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrOriginFunction
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrOriginFunction PROC ; COMDAT
; 1734 : xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
test esi, esi
je SHORT $LN1@xmlXPtrOri
; 1735 : CHECK_ARITY(0);
cmp DWORD PTR _nargs$[ebp], 0
je SHORT $LN3@xmlXPtrOri
push 12 ; 0000000cH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1741 : }
pop ebp
ret 0
$LN3@xmlXPtrOri:
; 1735 : CHECK_ARITY(0);
mov eax, DWORD PTR [esi+20]
cmp eax, DWORD PTR [esi+44]
jge SHORT $LN4@xmlXPtrOri
push 23 ; 00000017H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1741 : }
pop ebp
ret 0
$LN4@xmlXPtrOri:
; 1736 :
; 1737 : if (ctxt->context->origin == NULL)
mov eax, DWORD PTR [esi+12]
mov eax, DWORD PTR [eax+84]
test eax, eax
jne SHORT $LN5@xmlXPtrOri
; 1738 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1741 : }
pop ebp
ret 0
$LN5@xmlXPtrOri:
; 1739 :
; 1740 : valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->origin, NULL));
push 0
push eax
call _xmlXPtrNewLocationSetNodes
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
$LN1@xmlXPtrOri:
pop esi
; 1741 : }
pop ebp
ret 0
_xmlXPtrOriginFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrHereFunction
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrHereFunction PROC ; COMDAT
; 1716 : xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
test esi, esi
je SHORT $LN1@xmlXPtrHer
; 1717 : CHECK_ARITY(0);
cmp DWORD PTR _nargs$[ebp], 0
je SHORT $LN3@xmlXPtrHer
push 12 ; 0000000cH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1723 : }
pop ebp
ret 0
$LN3@xmlXPtrHer:
; 1717 : CHECK_ARITY(0);
mov eax, DWORD PTR [esi+20]
cmp eax, DWORD PTR [esi+44]
jge SHORT $LN4@xmlXPtrHer
push 23 ; 00000017H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1723 : }
pop ebp
ret 0
$LN4@xmlXPtrHer:
; 1718 :
; 1719 : if (ctxt->context->here == NULL)
mov eax, DWORD PTR [esi+12]
mov eax, DWORD PTR [eax+80]
test eax, eax
jne SHORT $LN5@xmlXPtrHer
; 1720 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1723 : }
pop ebp
ret 0
$LN5@xmlXPtrHer:
; 1721 :
; 1722 : valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->here, NULL));
push 0
push eax
call _xmlXPtrNewLocationSetNodes
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
$LN1@xmlXPtrHer:
pop esi
; 1723 : }
pop ebp
ret 0
_xmlXPtrHereFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEndPointFunction
_TEXT SEGMENT
_oldset$1$ = -4 ; size = 4
_newset$1$ = 8 ; size = 4
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrEndPointFunction PROC ; COMDAT
; 1863 : xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
push ecx
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
test esi, esi
je $LN1@xmlXPtrEnd
; 1864 : xmlXPathObjectPtr tmp, obj, point;
; 1865 : xmlLocationSetPtr newset = NULL;
; 1866 : xmlLocationSetPtr oldset = NULL;
; 1867 :
; 1868 : CHECK_ARITY(1);
cmp DWORD PTR _nargs$[ebp], 1
je SHORT $LN8@xmlXPtrEnd
push 12 ; 0000000cH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN8@xmlXPtrEnd:
; 1864 : xmlXPathObjectPtr tmp, obj, point;
; 1865 : xmlLocationSetPtr newset = NULL;
; 1866 : xmlLocationSetPtr oldset = NULL;
; 1867 :
; 1868 : CHECK_ARITY(1);
mov eax, DWORD PTR [esi+44]
inc eax
cmp DWORD PTR [esi+20], eax
jge SHORT $LN9@xmlXPtrEnd
push 23 ; 00000017H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN9@xmlXPtrEnd:
; 1869 : if ((ctxt->value == NULL) ||
mov eax, DWORD PTR [esi+16]
test eax, eax
je $LN11@xmlXPtrEnd
mov eax, DWORD PTR [eax]
cmp eax, 7
je SHORT $LN10@xmlXPtrEnd
cmp eax, 1
jne $LN11@xmlXPtrEnd
$LN10@xmlXPtrEnd:
push ebx
push edi
; 1873 :
; 1874 : obj = valuePop(ctxt);
push esi
call _valuePop
mov ebx, eax
add esp, 4
; 1875 : if (obj->type == XPATH_NODESET) {
cmp DWORD PTR [ebx], 1
jne SHORT $LN12@xmlXPtrEnd
; 1876 : /*
; 1877 : * First convert to a location set
; 1878 : */
; 1879 : tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval);
push DWORD PTR [ebx+4]
call _xmlXPtrNewLocationSetNodeSet
; 1880 : xmlXPathFreeObject(obj);
push ebx
mov edi, eax
call _xmlXPathFreeObject
add esp, 8
; 1881 : if (tmp == NULL)
test edi, edi
jne SHORT $LN13@xmlXPtrEnd
; 1882 : XP_ERROR(XPATH_MEMORY_ERROR)
push 15 ; 0000000fH
push esi
call _xmlXPathErr
add esp, 8
pop edi
pop ebx
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN13@xmlXPtrEnd:
; 1883 : obj = tmp;
mov ebx, edi
$LN12@xmlXPtrEnd:
; 1884 : }
; 1885 :
; 1886 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR _newset$1$[ebp], eax
; 1887 : if (newset == NULL) {
test eax, eax
jne SHORT $LN14@xmlXPtrEnd
; 1888 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1889 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push esi
call _xmlXPathErr
add esp, 12 ; 0000000cH
pop edi
pop ebx
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN14@xmlXPtrEnd:
; 1890 : }
; 1891 : oldset = (xmlLocationSetPtr) obj->user;
mov eax, DWORD PTR [ebx+28]
mov DWORD PTR _oldset$1$[ebp], eax
; 1892 : if (oldset != NULL) {
test eax, eax
je SHORT $LN48@xmlXPtrEnd
; 1893 : int i;
; 1894 :
; 1895 : for (i = 0; i < oldset->locNr; i++) {
xor edi, edi
cmp DWORD PTR [eax], edi
jle SHORT $LN48@xmlXPtrEnd
npad 6
$LL4@xmlXPtrEnd:
; 1896 : tmp = oldset->locTab[i];
mov eax, DWORD PTR [eax+8]
mov eax, DWORD PTR [eax+edi*4]
; 1897 : if (tmp == NULL)
test eax, eax
je SHORT $LN2@xmlXPtrEnd
; 1898 : continue;
; 1899 : point = NULL;
; 1900 : switch (tmp->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 5
je SHORT $LN17@xmlXPtrEnd
sub ecx, 1
jne SHORT $LN2@xmlXPtrEnd
; 1903 : break;
; 1904 : case XPATH_RANGE: {
; 1905 : xmlNodePtr node = tmp->user2;
mov ecx, DWORD PTR [eax+36]
; 1906 : if (node != NULL) {
test ecx, ecx
je SHORT $LN19@xmlXPtrEnd
; 1907 : if ((node->type == XML_ATTRIBUTE_NODE) ||
mov edx, DWORD PTR [ecx+4]
cmp edx, 2
je SHORT $LN41@xmlXPtrEnd
cmp edx, 18 ; 00000012H
je SHORT $LN41@xmlXPtrEnd
; 1912 : }
; 1913 : point = xmlXPtrNewPoint(node, tmp->index2);
mov eax, DWORD PTR [eax+40]
jmp SHORT $LN24@xmlXPtrEnd
$LN19@xmlXPtrEnd:
; 1914 : } else if (tmp->user == NULL) {
cmp DWORD PTR [eax+28], 0
jne SHORT $LN2@xmlXPtrEnd
; 1915 : point = xmlXPtrNewPoint(node,
xor ecx, ecx
or eax, -1
; 1916 : xmlXPtrNbLocChildren(node));
; 1917 : }
; 1918 : break;
jmp SHORT $LN24@xmlXPtrEnd
$LN17@xmlXPtrEnd:
; 1901 : case XPATH_POINT:
; 1902 : point = xmlXPtrNewPoint(tmp->user, tmp->index);
mov ecx, DWORD PTR [eax+28]
mov eax, DWORD PTR [eax+32]
$LN24@xmlXPtrEnd:
; 1919 : }
; 1920 : default:
; 1921 : /*** Should we raise an error ?
; 1922 : xmlXPathFreeObject(obj);
; 1923 : xmlXPathFreeObject(newset);
; 1924 : XP_ERROR(XPATH_INVALID_TYPE)
; 1925 : ***/
; 1926 : break;
; 1927 : }
; 1928 : if (point != NULL)
push eax
push ecx
call _xmlXPtrNewPoint
add esp, 8
test eax, eax
je SHORT $LN2@xmlXPtrEnd
; 1929 : xmlXPtrLocationSetAdd(newset, point);
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
add esp, 8
$LN2@xmlXPtrEnd:
; 1893 : int i;
; 1894 :
; 1895 : for (i = 0; i < oldset->locNr; i++) {
mov eax, DWORD PTR _oldset$1$[ebp]
inc edi
cmp edi, DWORD PTR [eax]
jl SHORT $LL4@xmlXPtrEnd
$LN48@xmlXPtrEnd:
; 1930 : }
; 1931 : }
; 1932 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1933 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrWrapLocationSet
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
pop edi
pop ebx
$LN1@xmlXPtrEnd:
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN41@xmlXPtrEnd:
; 1908 : (node->type == XML_NAMESPACE_DECL)) {
; 1909 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1910 : xmlXPtrFreeLocationSet(newset);
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrFreeLocationSet
; 1911 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push esi
call _xmlXPathErr
add esp, 16 ; 00000010H
pop edi
pop ebx
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
$LN11@xmlXPtrEnd:
; 1870 : ((ctxt->value->type != XPATH_LOCATIONSET) &&
; 1871 : (ctxt->value->type != XPATH_NODESET)))
; 1872 : XP_ERROR(XPATH_INVALID_TYPE)
push 11 ; 0000000bH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1934 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrEndPointFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrStartPointFunction
_TEXT SEGMENT
_oldset$1$ = -4 ; size = 4
_newset$1$ = 8 ; size = 4
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrStartPointFunction PROC ; COMDAT
; 1767 : xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
push ecx
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
test esi, esi
je $LN1@xmlXPtrSta
; 1768 : xmlXPathObjectPtr tmp, obj, point;
; 1769 : xmlLocationSetPtr newset = NULL;
; 1770 : xmlLocationSetPtr oldset = NULL;
; 1771 :
; 1772 : CHECK_ARITY(1);
cmp DWORD PTR _nargs$[ebp], 1
je SHORT $LN8@xmlXPtrSta
push 12 ; 0000000cH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN8@xmlXPtrSta:
; 1768 : xmlXPathObjectPtr tmp, obj, point;
; 1769 : xmlLocationSetPtr newset = NULL;
; 1770 : xmlLocationSetPtr oldset = NULL;
; 1771 :
; 1772 : CHECK_ARITY(1);
mov eax, DWORD PTR [esi+44]
inc eax
cmp DWORD PTR [esi+20], eax
jge SHORT $LN9@xmlXPtrSta
push 23 ; 00000017H
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN9@xmlXPtrSta:
; 1773 : if ((ctxt->value == NULL) ||
mov eax, DWORD PTR [esi+16]
test eax, eax
je $LN11@xmlXPtrSta
mov eax, DWORD PTR [eax]
cmp eax, 7
je SHORT $LN10@xmlXPtrSta
cmp eax, 1
jne $LN11@xmlXPtrSta
$LN10@xmlXPtrSta:
push ebx
push edi
; 1777 :
; 1778 : obj = valuePop(ctxt);
push esi
call _valuePop
mov ebx, eax
add esp, 4
; 1779 : if (obj->type == XPATH_NODESET) {
cmp DWORD PTR [ebx], 1
jne SHORT $LN12@xmlXPtrSta
; 1780 : /*
; 1781 : * First convert to a location set
; 1782 : */
; 1783 : tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval);
push DWORD PTR [ebx+4]
call _xmlXPtrNewLocationSetNodeSet
; 1784 : xmlXPathFreeObject(obj);
push ebx
mov edi, eax
call _xmlXPathFreeObject
add esp, 8
; 1785 : if (tmp == NULL)
test edi, edi
jne SHORT $LN13@xmlXPtrSta
; 1786 : XP_ERROR(XPATH_MEMORY_ERROR)
push 15 ; 0000000fH
push esi
call _xmlXPathErr
add esp, 8
pop edi
pop ebx
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN13@xmlXPtrSta:
; 1787 : obj = tmp;
mov ebx, edi
$LN12@xmlXPtrSta:
; 1788 : }
; 1789 :
; 1790 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR _newset$1$[ebp], eax
; 1791 : if (newset == NULL) {
test eax, eax
jne SHORT $LN14@xmlXPtrSta
; 1792 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1793 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push esi
call _xmlXPathErr
add esp, 12 ; 0000000cH
pop edi
pop ebx
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN14@xmlXPtrSta:
; 1794 : }
; 1795 : oldset = (xmlLocationSetPtr) obj->user;
mov eax, DWORD PTR [ebx+28]
mov DWORD PTR _oldset$1$[ebp], eax
; 1796 : if (oldset != NULL) {
test eax, eax
je SHORT $LN30@xmlXPtrSta
; 1797 : int i;
; 1798 :
; 1799 : for (i = 0; i < oldset->locNr; i++) {
xor edi, edi
cmp DWORD PTR [eax], edi
jle SHORT $LN30@xmlXPtrSta
npad 6
$LL4@xmlXPtrSta:
; 1800 : tmp = oldset->locTab[i];
mov eax, DWORD PTR [eax+8]
mov ecx, DWORD PTR [eax+edi*4]
; 1801 : if (tmp == NULL)
test ecx, ecx
je SHORT $LN2@xmlXPtrSta
; 1802 : continue;
; 1803 : point = NULL;
; 1804 : switch (tmp->type) {
mov eax, DWORD PTR [ecx]
sub eax, 5
je SHORT $LN17@xmlXPtrSta
sub eax, 1
jne SHORT $LN2@xmlXPtrSta
; 1807 : break;
; 1808 : case XPATH_RANGE: {
; 1809 : xmlNodePtr node = tmp->user;
mov edx, DWORD PTR [ecx+28]
; 1810 : if (node != NULL) {
test edx, edx
je SHORT $LN2@xmlXPtrSta
; 1811 : if ((node->type == XML_ATTRIBUTE_NODE) ||
mov eax, DWORD PTR [edx+4]
cmp eax, 2
je SHORT $LN26@xmlXPtrSta
cmp eax, 18 ; 00000012H
jne SHORT $LN22@xmlXPtrSta
$LN26@xmlXPtrSta:
; 1812 : (node->type == XML_NAMESPACE_DECL)) {
; 1813 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1814 : xmlXPtrFreeLocationSet(newset);
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrFreeLocationSet
; 1815 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push esi
call _xmlXPathErr
add esp, 16 ; 00000010H
pop edi
pop ebx
$LN1@xmlXPtrSta:
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN17@xmlXPtrSta:
; 1805 : case XPATH_POINT:
; 1806 : point = xmlXPtrNewPoint(tmp->user, tmp->index);
mov edx, DWORD PTR [ecx+28]
$LN22@xmlXPtrSta:
; 1816 : }
; 1817 : point = xmlXPtrNewPoint(node, tmp->index);
; 1818 : }
; 1819 : break;
; 1820 : }
; 1821 : default:
; 1822 : /*** Should we raise an error ?
; 1823 : xmlXPathFreeObject(obj);
; 1824 : xmlXPathFreeObject(newset);
; 1825 : XP_ERROR(XPATH_INVALID_TYPE)
; 1826 : ***/
; 1827 : break;
; 1828 : }
; 1829 : if (point != NULL)
mov eax, DWORD PTR [ecx+32]
push eax
push edx
call _xmlXPtrNewPoint
add esp, 8
test eax, eax
je SHORT $LN2@xmlXPtrSta
; 1830 : xmlXPtrLocationSetAdd(newset, point);
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
add esp, 8
$LN2@xmlXPtrSta:
; 1797 : int i;
; 1798 :
; 1799 : for (i = 0; i < oldset->locNr; i++) {
mov eax, DWORD PTR _oldset$1$[ebp]
inc edi
cmp edi, DWORD PTR [eax]
jl SHORT $LL4@xmlXPtrSta
$LN30@xmlXPtrSta:
; 1831 : }
; 1832 : }
; 1833 : xmlXPathFreeObject(obj);
push ebx
call _xmlXPathFreeObject
; 1834 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrWrapLocationSet
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
pop edi
pop ebx
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
$LN11@xmlXPtrSta:
; 1774 : ((ctxt->value->type != XPATH_LOCATIONSET) &&
; 1775 : (ctxt->value->type != XPATH_NODESET)))
; 1776 : XP_ERROR(XPATH_INVALID_TYPE)
push 11 ; 0000000bH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1835 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrStartPointFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrStringRangeFunction
_TEXT SEGMENT
_oldset$1$ = -56 ; size = 4
_set$1$ = -52 ; size = 4
_i$1$ = -48 ; size = 4
_num$1$ = -44 ; size = 4
_pos$1$ = -40 ; size = 4
_rindx$1 = -36 ; size = 4
_fendindex$ = -36 ; size = 4
_number$1$ = -32 ; size = 4
_position$1$ = -28 ; size = 4
_bytes$1$ = -24 ; size = 4
_rend$2 = -24 ; size = 4
_fend$ = -24 ; size = 4
_string$1$ = -20 ; size = 4
_end$1$ = -16 ; size = 4
_endindex$1$ = -12 ; size = 4
_start$ = -8 ; size = 4
_startindex$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_newset$1$ = 12 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrStringRangeFunction PROC ; COMDAT
; 2696 : xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
push ebp
mov ebp, esp
sub esp, 56 ; 00000038H
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _nargs$[ebp]
xor eax, eax
mov DWORD PTR _end$1$[ebp], eax
mov DWORD PTR _position$1$[ebp], eax
mov DWORD PTR _number$1$[ebp], eax
mov DWORD PTR _pos$1$[ebp], eax
mov DWORD PTR _num$1$[ebp], eax
lea eax, DWORD PTR [esi-2]
mov DWORD PTR _endindex$1$[ebp], 0
cmp eax, 2
ja $LN9@xmlXPtrStr
; 2712 :
; 2713 : if (nargs >= 4) {
push ebx
mov ebx, DWORD PTR _ctxt$[ebp]
cmp esi, 4
jl SHORT $LN13@xmlXPtrStr
; 2714 : CHECK_TYPE(XPATH_NUMBER);
mov eax, DWORD PTR [ebx+16]
test eax, eax
je $LN19@xmlXPtrStr
cmp DWORD PTR [eax], 3
jne $LN19@xmlXPtrStr
; 2715 : number = valuePop(ctxt);
push ebx
call _valuePop
mov ecx, eax
add esp, 4
mov DWORD PTR _number$1$[ebp], ecx
; 2716 : if (number != NULL)
test ecx, ecx
je SHORT $LN13@xmlXPtrStr
; 2717 : num = (int) number->floatval;
cvttsd2si eax, QWORD PTR [ecx+16]
mov DWORD PTR _num$1$[ebp], eax
$LN13@xmlXPtrStr:
; 2718 : }
; 2719 : if (nargs >= 3) {
cmp esi, 3
jl SHORT $LN17@xmlXPtrStr
; 2720 : CHECK_TYPE(XPATH_NUMBER);
mov eax, DWORD PTR [ebx+16]
test eax, eax
je $LN19@xmlXPtrStr
cmp DWORD PTR [eax], 3
jne $LN19@xmlXPtrStr
; 2721 : position = valuePop(ctxt);
push ebx
call _valuePop
mov ecx, eax
add esp, 4
mov DWORD PTR _position$1$[ebp], ecx
; 2722 : if (position != NULL)
test ecx, ecx
je SHORT $LN17@xmlXPtrStr
; 2723 : pos = (int) position->floatval;
cvttsd2si eax, QWORD PTR [ecx+16]
mov DWORD PTR _pos$1$[ebp], eax
$LN17@xmlXPtrStr:
; 2724 : }
; 2725 : CHECK_TYPE(XPATH_STRING);
mov eax, DWORD PTR [ebx+16]
test eax, eax
je $LN19@xmlXPtrStr
cmp DWORD PTR [eax], 4
jne $LN19@xmlXPtrStr
; 2726 : string = valuePop(ctxt);
push ebx
call _valuePop
mov esi, eax
add esp, 4
; 2727 : if ((ctxt->value == NULL) ||
mov eax, DWORD PTR [ebx+16]
mov DWORD PTR _string$1$[ebp], esi
test eax, eax
je $LN19@xmlXPtrStr
mov eax, DWORD PTR [eax]
cmp eax, 7
je SHORT $LN20@xmlXPtrStr
cmp eax, 1
jne $LN19@xmlXPtrStr
$LN20@xmlXPtrStr:
push edi
; 2728 : ((ctxt->value->type != XPATH_LOCATIONSET) &&
; 2729 : (ctxt->value->type != XPATH_NODESET)))
; 2730 : XP_ERROR(XPATH_INVALID_TYPE)
; 2731 :
; 2732 : set = valuePop(ctxt);
push ebx
call _valuePop
mov edi, eax
; 2733 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
mov DWORD PTR _set$1$[ebp], edi
call _xmlXPtrLocationSetCreate
add esp, 8
mov DWORD PTR _newset$1$[ebp], eax
; 2734 : if (newset == NULL) {
test eax, eax
jne SHORT $LN22@xmlXPtrStr
; 2735 : xmlXPathFreeObject(set);
push edi
call _xmlXPathFreeObject
; 2736 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push ebx
call _xmlXPathErr
add esp, 12 ; 0000000cH
$LN143@xmlXPtrStr:
pop edi
pop ebx
pop esi
; 2828 : }
mov esp, ebp
pop ebp
ret 0
$LN22@xmlXPtrStr:
; 2737 : }
; 2738 : if (set->nodesetval == NULL) {
mov eax, DWORD PTR [edi+4]
test eax, eax
je $error$149
; 2739 : goto error;
; 2740 : }
; 2741 : if (set->type == XPATH_NODESET) {
cmp DWORD PTR [edi], 1
jne SHORT $LN24@xmlXPtrStr
; 2742 : xmlXPathObjectPtr tmp;
; 2743 :
; 2744 : /*
; 2745 : * First convert to a location set
; 2746 : */
; 2747 : tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
push eax
call _xmlXPtrNewLocationSetNodeSet
; 2748 : xmlXPathFreeObject(set);
push edi
mov esi, eax
call _xmlXPathFreeObject
add esp, 8
; 2749 : if (tmp == NULL)
test esi, esi
jne SHORT $LN25@xmlXPtrStr
; 2750 : XP_ERROR(XPATH_MEMORY_ERROR)
push 15 ; 0000000fH
push ebx
call _xmlXPathErr
add esp, 8
pop edi
pop ebx
pop esi
; 2828 : }
mov esp, ebp
pop ebp
ret 0
$LN25@xmlXPtrStr:
; 2751 : set = tmp;
mov edi, esi
mov esi, DWORD PTR _string$1$[ebp]
mov DWORD PTR _set$1$[ebp], edi
$LN24@xmlXPtrStr:
; 2752 : }
; 2753 : oldset = (xmlLocationSetPtr) set->user;
mov eax, DWORD PTR [edi+28]
; 2754 :
; 2755 : /*
; 2756 : * The loop is to search for each element in the location set
; 2757 : * the list of location set corresponding to that search
; 2758 : */
; 2759 : for (i = 0;i < oldset->locNr;i++) {
xor ecx, ecx
mov DWORD PTR _oldset$1$[ebp], eax
mov DWORD PTR _i$1$[ebp], ecx
cmp DWORD PTR [eax], ecx
jle $error$149
$LL4@xmlXPtrStr:
; 2760 : #ifdef DEBUG_RANGES
; 2761 : xmlXPathDebugDumpObject(stdout, oldset->locTab[i], 0);
; 2762 : #endif
; 2763 :
; 2764 : xmlXPtrGetStartPoint(oldset->locTab[i], &start, &startindex);
mov eax, DWORD PTR [eax+8]
mov edx, DWORD PTR [eax+ecx*4]
; 2599 : if ((obj == NULL) || (node == NULL) || (indx == NULL))
test edx, edx
je SHORT $LN133@xmlXPtrStr
; 2600 : return(-1);
; 2601 :
; 2602 : switch (obj->type) {
mov esi, DWORD PTR [edx]
mov eax, esi
sub eax, 5
je SHORT $LN44@xmlXPtrStr
sub eax, 1
jne SHORT $LN132@xmlXPtrStr
; 2606 : *indx = 0;
; 2607 : else
; 2608 : *indx = obj->index;
; 2609 : return(0);
; 2610 : case XPATH_RANGE:
; 2611 : *node = obj->user;
; 2612 : if (obj->index <= 0)
mov ecx, DWORD PTR [edx+32]
; 2613 : *indx = 0;
; 2614 : else
; 2615 : *indx = obj->index;
; 2616 : return(0);
test ecx, ecx
cmovg eax, ecx
jmp SHORT $LN144@xmlXPtrStr
$LN132@xmlXPtrStr:
; 2600 : return(-1);
; 2601 :
; 2602 : switch (obj->type) {
mov edi, DWORD PTR _start$[ebp]
jmp SHORT $LN45@xmlXPtrStr
$LN44@xmlXPtrStr:
; 2603 : case XPATH_POINT:
; 2604 : *node = obj->user;
; 2605 : if (obj->index <= 0)
mov eax, DWORD PTR [edx+32]
xor ecx, ecx
test eax, eax
cmovle eax, ecx
$LN144@xmlXPtrStr:
; 2638 : switch (obj->type) {
mov edi, DWORD PTR [edx+28]
mov DWORD PTR _startindex$[ebp], eax
mov DWORD PTR _start$[ebp], edi
$LN45@xmlXPtrStr:
sub esi, 5
je SHORT $LN57@xmlXPtrStr
sub esi, 1
jne SHORT $LN58@xmlXPtrStr
; 2642 : *indx = 0;
; 2643 : else
; 2644 : *indx = obj->index;
; 2645 : return(0);
; 2646 : case XPATH_RANGE:
; 2647 : *node = obj->user;
mov eax, DWORD PTR [edx+28]
; 2648 : if (obj->index <= 0)
; 2649 : *indx = 0;
; 2650 : else
; 2651 : *indx = obj->index;
; 2652 : return(0);
xor ecx, ecx
mov DWORD PTR _end$1$[ebp], eax
mov eax, DWORD PTR [edx+32]
test eax, eax
cmovg ecx, eax
mov DWORD PTR _endindex$1$[ebp], ecx
jmp SHORT $LN58@xmlXPtrStr
$LN57@xmlXPtrStr:
; 2639 : case XPATH_POINT:
; 2640 : *node = obj->user;
mov eax, DWORD PTR [edx+28]
; 2641 : if (obj->index <= 0)
mov ecx, DWORD PTR [edx+32]
mov DWORD PTR _end$1$[ebp], eax
xor eax, eax
test ecx, ecx
cmovle ecx, eax
mov DWORD PTR _endindex$1$[ebp], ecx
; 2599 : if ((obj == NULL) || (node == NULL) || (indx == NULL))
jmp SHORT $LN58@xmlXPtrStr
$LN133@xmlXPtrStr:
mov edi, DWORD PTR _start$[ebp]
$LN58@xmlXPtrStr:
; 2765 : xmlXPtrGetEndPoint(oldset->locTab[i], &end, &endindex);
; 2766 : xmlXPtrAdvanceChar(&start, &startindex, 0);
xor ebx, ebx
mov DWORD PTR _bytes$1$[ebp], ebx
; 2301 : cur = *node;
test edi, edi
; 2302 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
je SHORT $LN73@xmlXPtrStr
cmp DWORD PTR [edi+4], 18 ; 00000012H
je SHORT $LN73@xmlXPtrStr
; 2303 : return(-1);
; 2304 : pos = *indx;
mov esi, DWORD PTR _startindex$[ebp]
npad 7
$LL66@xmlXPtrStr:
; 2305 :
; 2306 : while (bytes >= 0) {
; 2307 : /*
; 2308 : * First position to the beginning of the first text node
; 2309 : * corresponding to this point
; 2310 : */
; 2311 : while ((cur != NULL) &&
test edi, edi
je SHORT $LN105@xmlXPtrStr
$LL68@xmlXPtrStr:
mov eax, DWORD PTR [edi+4]
cmp eax, 1
je SHORT $LN74@xmlXPtrStr
cmp eax, 9
je SHORT $LN74@xmlXPtrStr
cmp eax, 13 ; 0000000dH
jne $LN69@xmlXPtrStr
$LN74@xmlXPtrStr:
; 2312 : ((cur->type == XML_ELEMENT_NODE) ||
; 2313 : (cur->type == XML_DOCUMENT_NODE) ||
; 2314 : (cur->type == XML_HTML_DOCUMENT_NODE))) {
; 2315 : if (pos > 0) {
test esi, esi
jle SHORT $LN75@xmlXPtrStr
; 2316 : cur = xmlXPtrGetNthChild(cur, pos);
push esi
push edi
call _xmlXPtrGetNthChild
; 2317 : pos = 0;
; 2318 : } else {
jmp SHORT $LN145@xmlXPtrStr
$LN75@xmlXPtrStr:
; 2319 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
push edi
call _xmlXPtrAdvanceNode
$LN145@xmlXPtrStr:
; 2305 :
; 2306 : while (bytes >= 0) {
; 2307 : /*
; 2308 : * First position to the beginning of the first text node
; 2309 : * corresponding to this point
; 2310 : */
; 2311 : while ((cur != NULL) &&
mov edi, eax
add esp, 8
xor esi, esi
test edi, edi
jne SHORT $LL68@xmlXPtrStr
$LN105@xmlXPtrStr:
; 2320 : pos = 0;
; 2321 : }
; 2322 : }
; 2323 :
; 2324 : if (cur == NULL) {
; 2325 : *node = NULL;
mov DWORD PTR _start$[ebp], 0
; 2326 : *indx = 0;
mov DWORD PTR _startindex$[ebp], 0
$LN73@xmlXPtrStr:
; 2557 : ((*node)->type == XML_NAMESPACE_DECL) || (indx == NULL))
mov edi, DWORD PTR _end$1$[ebp]
test edi, edi
je SHORT $LN140@xmlXPtrStr
mov eax, DWORD PTR [edi+4]
cmp eax, 18 ; 00000012H
je SHORT $LN140@xmlXPtrStr
; 2558 : return(-1);
; 2559 : cur = *node;
mov esi, edi
; 2560 : pos = *indx;
; 2561 :
; 2562 : if ((cur->type == XML_ELEMENT_NODE) ||
; 2563 : (cur->type == XML_DOCUMENT_NODE) ||
cmp eax, 1
je SHORT $LN92@xmlXPtrStr
cmp eax, 9
je SHORT $LN92@xmlXPtrStr
cmp eax, 13 ; 0000000dH
jne SHORT $LN103@xmlXPtrStr
$LN92@xmlXPtrStr:
; 2564 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 2565 : if (pos > 0) {
mov eax, DWORD PTR _endindex$1$[ebp]
test eax, eax
jle SHORT $LN103@xmlXPtrStr
; 2566 : cur = xmlXPtrGetNthChild(cur, pos);
push eax
push edi
call _xmlXPtrGetNthChild
add esp, 8
mov esi, eax
$LN103@xmlXPtrStr:
; 2567 : }
; 2568 : }
; 2569 : while (cur != NULL) {
test esi, esi
je SHORT $LN140@xmlXPtrStr
npad 1
$LL87@xmlXPtrStr:
; 2570 : if (cur->last != NULL)
mov eax, DWORD PTR [esi+16]
test eax, eax
je $LN94@xmlXPtrStr
; 2571 : cur = cur->last;
mov esi, eax
test esi, esi
jne SHORT $LL87@xmlXPtrStr
$LN140@xmlXPtrStr:
; 2360 : return(0);
; 2361 : }
; 2362 : }
; 2363 : return(-1);
; 2364 : }
; 2365 :
; 2366 : /**
; 2367 : * xmlXPtrMatchString:
; 2368 : * @string: the string to search
; 2369 : * @start: the start textnode
; 2370 : * @startindex: the start index
; 2371 : * @end: the end textnode IN/OUT
; 2372 : * @endindex: the end index IN/OUT
; 2373 : *
; 2374 : * Check whether the document contains @string at the position
; 2375 : * (@start, @startindex) and limited by the (@end, @endindex) point
; 2376 : *
; 2377 : * Returns -1 in case of failure, 0 if not found, 1 if found in which case
; 2378 : * (@start, @startindex) will indicate the position of the beginning
; 2379 : * of the range and (@end, @endindex) will indicate the end
; 2380 : * of the range
; 2381 : */
; 2382 : static int
; 2383 : xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex,
; 2384 : xmlNodePtr *end, int *endindex) {
; 2385 : xmlNodePtr cur;
; 2386 : int pos; /* 0 based */
; 2387 : int len; /* in bytes */
; 2388 : int stringlen; /* in bytes */
; 2389 : int match;
; 2390 :
; 2391 : if (string == NULL)
; 2392 : return(-1);
; 2393 : if ((start == NULL) || (start->type == XML_NAMESPACE_DECL))
; 2394 : return(-1);
; 2395 : if ((end == NULL) || (*end == NULL) ||
; 2396 : ((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL))
; 2397 : return(-1);
; 2398 : cur = start;
; 2399 : pos = startindex - 1;
; 2400 : stringlen = xmlStrlen(string);
; 2401 :
; 2402 : while (stringlen > 0) {
; 2403 : if ((cur == *end) && (pos + stringlen > *endindex))
; 2404 : return(0);
; 2405 :
; 2406 : if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
; 2407 : len = xmlStrlen(cur->content);
; 2408 : if (len >= pos + stringlen) {
; 2409 : match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
; 2410 : if (match) {
; 2411 : #ifdef DEBUG_RANGES
; 2412 : xmlGenericError(xmlGenericErrorContext,
; 2413 : "found range %d bytes at index %d of ->",
; 2414 : stringlen, pos + 1);
; 2415 : xmlDebugDumpString(stdout, cur->content);
; 2416 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2417 : #endif
; 2418 : *end = cur;
; 2419 : *endindex = pos + stringlen;
; 2420 : return(1);
; 2421 : } else {
; 2422 : return(0);
; 2423 : }
; 2424 : } else {
; 2425 : int sub = len - pos;
; 2426 : match = (!xmlStrncmp(&cur->content[pos], string, sub));
; 2427 : if (match) {
; 2428 : #ifdef DEBUG_RANGES
; 2429 : xmlGenericError(xmlGenericErrorContext,
; 2430 : "found subrange %d bytes at index %d of ->",
; 2431 : sub, pos + 1);
; 2432 : xmlDebugDumpString(stdout, cur->content);
; 2433 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2434 : #endif
; 2435 : string = &string[sub];
; 2436 : stringlen -= sub;
; 2437 : } else {
; 2438 : return(0);
; 2439 : }
; 2440 : }
; 2441 : }
; 2442 : cur = xmlXPtrAdvanceNode(cur, NULL);
; 2443 : if (cur == NULL)
; 2444 : return(0);
; 2445 : pos = 0;
; 2446 : }
; 2447 : return(1);
; 2448 : }
; 2449 :
; 2450 : /**
; 2451 : * xmlXPtrSearchString:
; 2452 : * @string: the string to search
; 2453 : * @start: the start textnode IN/OUT
; 2454 : * @startindex: the start index IN/OUT
; 2455 : * @end: the end textnode
; 2456 : * @endindex: the end index
; 2457 : *
; 2458 : * Search the next occurrence of @string within the document content
; 2459 : * until the (@end, @endindex) point is reached
; 2460 : *
; 2461 : * Returns -1 in case of failure, 0 if not found, 1 if found in which case
; 2462 : * (@start, @startindex) will indicate the position of the beginning
; 2463 : * of the range and (@end, @endindex) will indicate the end
; 2464 : * of the range
; 2465 : */
; 2466 : static int
; 2467 : xmlXPtrSearchString(const xmlChar *string, xmlNodePtr *start, int *startindex,
; 2468 : xmlNodePtr *end, int *endindex) {
; 2469 : xmlNodePtr cur;
; 2470 : const xmlChar *str;
; 2471 : int pos; /* 0 based */
; 2472 : int len; /* in bytes */
; 2473 : xmlChar first;
; 2474 :
; 2475 : if (string == NULL)
; 2476 : return(-1);
; 2477 : if ((start == NULL) || (*start == NULL) ||
; 2478 : ((*start)->type == XML_NAMESPACE_DECL) || (startindex == NULL))
; 2479 : return(-1);
; 2480 : if ((end == NULL) || (endindex == NULL))
; 2481 : return(-1);
; 2482 : cur = *start;
; 2483 : pos = *startindex - 1;
; 2484 : first = string[0];
; 2485 :
; 2486 : while (cur != NULL) {
; 2487 : if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
; 2488 : len = xmlStrlen(cur->content);
; 2489 : while (pos <= len) {
; 2490 : if (first != 0) {
; 2491 : str = xmlStrchr(&cur->content[pos], first);
; 2492 : if (str != NULL) {
; 2493 : pos = (str - (xmlChar *)(cur->content));
; 2494 : #ifdef DEBUG_RANGES
; 2495 : xmlGenericError(xmlGenericErrorContext,
; 2496 : "found '%c' at index %d of ->",
; 2497 : first, pos + 1);
; 2498 : xmlDebugDumpString(stdout, cur->content);
; 2499 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2500 : #endif
; 2501 : if (xmlXPtrMatchString(string, cur, pos + 1,
; 2502 : end, endindex)) {
; 2503 : *start = cur;
; 2504 : *startindex = pos + 1;
; 2505 : return(1);
; 2506 : }
; 2507 : pos++;
; 2508 : } else {
; 2509 : pos = len + 1;
; 2510 : }
; 2511 : } else {
; 2512 : /*
; 2513 : * An empty string is considered to match before each
; 2514 : * character of the string-value and after the final
; 2515 : * character.
; 2516 : */
; 2517 : #ifdef DEBUG_RANGES
; 2518 : xmlGenericError(xmlGenericErrorContext,
; 2519 : "found '' at index %d of ->",
; 2520 : pos + 1);
; 2521 : xmlDebugDumpString(stdout, cur->content);
; 2522 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2523 : #endif
; 2524 : *start = cur;
; 2525 : *startindex = pos + 1;
; 2526 : *end = cur;
; 2527 : *endindex = pos + 1;
; 2528 : return(1);
; 2529 : }
; 2530 : }
; 2531 : }
; 2532 : if ((cur == *end) && (pos >= *endindex))
; 2533 : return(0);
; 2534 : cur = xmlXPtrAdvanceNode(cur, NULL);
; 2535 : if (cur == NULL)
; 2536 : return(0);
; 2537 : pos = 1;
; 2538 : }
; 2539 : return(0);
; 2540 : }
; 2541 :
; 2542 : /**
; 2543 : * xmlXPtrGetLastChar:
; 2544 : * @node: the node
; 2545 : * @index: the index
; 2546 : *
; 2547 : * Computes the point coordinates of the last char of this point
; 2548 : *
; 2549 : * Returns -1 in case of failure, 0 otherwise
; 2550 : */
; 2551 : static int
; 2552 : xmlXPtrGetLastChar(xmlNodePtr *node, int *indx) {
; 2553 : xmlNodePtr cur;
; 2554 : int pos, len = 0;
; 2555 :
; 2556 : if ((node == NULL) || (*node == NULL) ||
; 2557 : ((*node)->type == XML_NAMESPACE_DECL) || (indx == NULL))
mov ebx, DWORD PTR _endindex$1$[ebp]
$LN129@xmlXPtrStr:
mov esi, DWORD PTR _string$1$[ebp]
mov ecx, DWORD PTR [esi+24]
npad 6
$LL7@xmlXPtrStr:
; 2767 : xmlXPtrGetLastChar(&end, &endindex);
; 2768 :
; 2769 : #ifdef DEBUG_RANGES
; 2770 : xmlGenericError(xmlGenericErrorContext,
; 2771 : "from index %d of ->", startindex);
; 2772 : xmlDebugDumpString(stdout, start->content);
; 2773 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2774 : xmlGenericError(xmlGenericErrorContext,
; 2775 : "to index %d of ->", endindex);
; 2776 : xmlDebugDumpString(stdout, end->content);
; 2777 : xmlGenericError(xmlGenericErrorContext, "\n");
; 2778 : #endif
; 2779 : do {
; 2780 : fend = end;
; 2781 : fendindex = endindex;
; 2782 : found = xmlXPtrSearchString(string->stringval, &start, &startindex,
lea eax, DWORD PTR _fendindex$[ebp]
mov DWORD PTR _fend$[ebp], edi
push eax
lea eax, DWORD PTR _fend$[ebp]
mov DWORD PTR _fendindex$[ebp], ebx
push eax
lea eax, DWORD PTR _startindex$[ebp]
push eax
lea eax, DWORD PTR _start$[ebp]
push eax
push ecx
call _xmlXPtrSearchString
add esp, 20 ; 00000014H
; 2783 : &fend, &fendindex);
; 2784 : if (found == 1) {
cmp eax, 1
jne $LN121@xmlXPtrStr
; 2785 : if (position == NULL) {
cmp DWORD PTR _position$1$[ebp], 0
mov edi, DWORD PTR _fend$[ebp]
mov esi, DWORD PTR _fendindex$[ebp]
jne $LN27@xmlXPtrStr
$LN33@xmlXPtrStr:
; 2803 : xmlXPtrNewRange(start, startindex,
; 2804 : start, startindex));
; 2805 : } else {
; 2806 : xmlXPtrLocationSetAdd(newset,
; 2807 : xmlXPtrNewRange(start, startindex,
; 2808 : fend, fendindex));
; 2809 : }
; 2810 : }
; 2811 : start = fend;
push esi
push edi
push DWORD PTR _startindex$[ebp]
push DWORD PTR _start$[ebp]
jmp $LN147@xmlXPtrStr
$LN69@xmlXPtrStr:
; 2333 : if (pos == 0) pos = 1;
test esi, esi
mov ecx, 1
cmove esi, ecx
; 2334 : if (bytes == 0) {
test ebx, ebx
je SHORT $LN106@xmlXPtrStr
; 2338 : }
; 2339 : /*
; 2340 : * We should have a text (or cdata) node ...
; 2341 : */
; 2342 : len = 0;
xor ebx, ebx
; 2343 : if ((cur->type != XML_ELEMENT_NODE) &&
cmp eax, ecx
je SHORT $LN80@xmlXPtrStr
mov eax, DWORD PTR [edi+40]
test eax, eax
je SHORT $LN80@xmlXPtrStr
; 2344 : (cur->content != NULL)) {
; 2345 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
add esp, 4
mov ebx, eax
$LN80@xmlXPtrStr:
; 2346 : }
; 2347 : if (pos > len) {
cmp esi, ebx
jle SHORT $LN81@xmlXPtrStr
; 2348 : /* Strange, the indx in the text node is greater than it's len */
; 2349 : STRANGE
call ___xmlGenericError
mov esi, eax
call ___xmlGenericErrorContext
push 2349 ; 0000092dH
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BJ@DADKHPPP@Internal?5error?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [esi]
call eax
add esp, 16 ; 00000010H
; 2350 : pos = len;
mov esi, ebx
$LN81@xmlXPtrStr:
; 2351 : }
; 2352 : if (pos + bytes >= len) {
mov eax, DWORD PTR _bytes$1$[ebp]
add eax, esi
cmp eax, ebx
jl SHORT $LN107@xmlXPtrStr
; 2353 : bytes -= (len - pos);
sub esi, ebx
mov ebx, DWORD PTR _bytes$1$[ebp]
; 2354 : cur = xmlXPtrAdvanceNode(cur, NULL);
push 0
add ebx, esi
push edi
mov DWORD PTR _bytes$1$[ebp], ebx
call _xmlXPtrAdvanceNode
add esp, 8
; 2355 : pos = 0;
xor esi, esi
mov edi, eax
test ebx, ebx
jns $LL66@xmlXPtrStr
; 2305 :
; 2306 : while (bytes >= 0) {
; 2307 : /*
; 2308 : * First position to the beginning of the first text node
; 2309 : * corresponding to this point
; 2310 : */
; 2311 : while ((cur != NULL) &&
jmp $LN73@xmlXPtrStr
$LN107@xmlXPtrStr:
; 2356 : } else if (pos + bytes < len) {
; 2357 : pos += bytes;
; 2358 : *node = cur;
mov DWORD PTR _start$[ebp], edi
; 2359 : *indx = pos;
mov DWORD PTR _startindex$[ebp], eax
jmp $LN73@xmlXPtrStr
$LN106@xmlXPtrStr:
; 2335 : *node = cur;
mov DWORD PTR _start$[ebp], edi
; 2336 : *indx = pos;
mov DWORD PTR _startindex$[ebp], esi
; 2337 : return(0);
jmp $LN73@xmlXPtrStr
$LN94@xmlXPtrStr:
; 2572 : else if ((cur->type != XML_ELEMENT_NODE) &&
cmp DWORD PTR [esi+4], 1
je $LN140@xmlXPtrStr
mov eax, DWORD PTR [esi+40]
test eax, eax
je $LN140@xmlXPtrStr
; 2573 : (cur->content != NULL)) {
; 2574 : len = xmlStrlen(cur->content);
push eax
call _xmlStrlen
mov ebx, eax
; 2575 : break;
; 2576 : } else {
; 2577 : return(-1);
; 2578 : }
; 2579 : }
; 2580 : if (cur == NULL)
; 2581 : return(-1);
; 2582 : *node = cur;
mov edi, esi
add esp, 4
mov DWORD PTR _endindex$1$[ebp], ebx
mov DWORD PTR _end$1$[ebp], edi
jmp $LN129@xmlXPtrStr
$LN27@xmlXPtrStr:
; 2786 : xmlXPtrLocationSetAdd(newset,
; 2787 : xmlXPtrNewRange(start, startindex, fend, fendindex));
; 2788 : } else if (xmlXPtrAdvanceChar(&start, &startindex,
; 2789 : pos - 1) == 0) {
mov eax, DWORD PTR _pos$1$[ebp]
dec eax
push eax
lea eax, DWORD PTR _startindex$[ebp]
push eax
lea eax, DWORD PTR _start$[ebp]
push eax
call _xmlXPtrAdvanceChar
add esp, 12 ; 0000000cH
test eax, eax
jne SHORT $LN34@xmlXPtrStr
; 2790 : if ((number != NULL) && (num > 0)) {
cmp DWORD PTR _number$1$[ebp], eax
je $LN33@xmlXPtrStr
mov ecx, DWORD PTR _num$1$[ebp]
test ecx, ecx
jle SHORT $LN30@xmlXPtrStr
; 2791 : int rindx;
; 2792 : xmlNodePtr rend;
; 2793 : rend = start;
; 2794 : rindx = startindex - 1;
mov eax, DWORD PTR _startindex$[ebp]
mov ebx, DWORD PTR _start$[ebp]
dec eax
mov DWORD PTR _rindx$1[ebp], eax
; 2795 : if (xmlXPtrAdvanceChar(&rend, &rindx,
; 2796 : num) == 0) {
lea eax, DWORD PTR _rindx$1[ebp]
push ecx
push eax
lea eax, DWORD PTR _rend$2[ebp]
mov DWORD PTR _rend$2[ebp], ebx
push eax
call _xmlXPtrAdvanceChar
add esp, 12 ; 0000000cH
test eax, eax
jne SHORT $LN135@xmlXPtrStr
; 2797 : xmlXPtrLocationSetAdd(newset,
push DWORD PTR _rindx$1[ebp]
push DWORD PTR _rend$2[ebp]
push DWORD PTR _startindex$[ebp]
push ebx
call _xmlXPtrNewRange
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
add esp, 24 ; 00000018H
$LN135@xmlXPtrStr:
; 2803 : xmlXPtrNewRange(start, startindex,
; 2804 : start, startindex));
; 2805 : } else {
; 2806 : xmlXPtrLocationSetAdd(newset,
; 2807 : xmlXPtrNewRange(start, startindex,
; 2808 : fend, fendindex));
; 2809 : }
; 2810 : }
; 2811 : start = fend;
mov ebx, DWORD PTR _endindex$1$[ebp]
$LN34@xmlXPtrStr:
; 2812 : startindex = fendindex;
; 2813 : if (string->stringval[0] == 0)
mov eax, DWORD PTR _string$1$[ebp]
mov DWORD PTR _start$[ebp], edi
mov edi, DWORD PTR _end$1$[ebp]
mov DWORD PTR _startindex$[ebp], esi
mov ecx, DWORD PTR [eax+24]
cmp BYTE PTR [ecx], 0
jne $LL7@xmlXPtrStr
; 2814 : startindex++;
lea eax, DWORD PTR [esi+1]
mov DWORD PTR _startindex$[ebp], eax
; 2815 : }
; 2816 : } while (found == 1);
jmp $LL7@xmlXPtrStr
$LN30@xmlXPtrStr:
; 2798 : xmlXPtrNewRange(start, startindex,
; 2799 : rend, rindx));
; 2800 : }
; 2801 : } else if ((number != NULL) && (num <= 0)) {
; 2802 : xmlXPtrLocationSetAdd(newset,
mov ecx, DWORD PTR _startindex$[ebp]
mov eax, DWORD PTR _start$[ebp]
push ecx
push eax
push ecx
push eax
$LN147@xmlXPtrStr:
; 2803 : xmlXPtrNewRange(start, startindex,
; 2804 : start, startindex));
; 2805 : } else {
; 2806 : xmlXPtrLocationSetAdd(newset,
; 2807 : xmlXPtrNewRange(start, startindex,
; 2808 : fend, fendindex));
; 2809 : }
; 2810 : }
; 2811 : start = fend;
call _xmlXPtrNewRange
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
add esp, 24 ; 00000018H
jmp SHORT $LN34@xmlXPtrStr
$LN121@xmlXPtrStr:
; 2754 :
; 2755 : /*
; 2756 : * The loop is to search for each element in the location set
; 2757 : * the list of location set corresponding to that search
; 2758 : */
; 2759 : for (i = 0;i < oldset->locNr;i++) {
mov ecx, DWORD PTR _i$1$[ebp]
mov eax, DWORD PTR _oldset$1$[ebp]
inc ecx
mov DWORD PTR _i$1$[ebp], ecx
cmp ecx, DWORD PTR [eax]
jl $LL4@xmlXPtrStr
mov ebx, DWORD PTR _ctxt$[ebp]
mov esi, DWORD PTR _string$1$[ebp]
mov edi, DWORD PTR _set$1$[ebp]
$error$149:
; 2817 : }
; 2818 :
; 2819 : /*
; 2820 : * Save the new value and cleanup
; 2821 : */
; 2822 : error:
; 2823 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrWrapLocationSet
push eax
push ebx
call _valuePush
; 2824 : xmlXPathFreeObject(set);
push edi
call _xmlXPathFreeObject
; 2825 : xmlXPathFreeObject(string);
push esi
call _xmlXPathFreeObject
; 2826 : if (position) xmlXPathFreeObject(position);
mov eax, DWORD PTR _position$1$[ebp]
add esp, 20 ; 00000014H
test eax, eax
je SHORT $LN36@xmlXPtrStr
push eax
call _xmlXPathFreeObject
add esp, 4
$LN36@xmlXPtrStr:
; 2827 : if (number) xmlXPathFreeObject(number);
mov eax, DWORD PTR _number$1$[ebp]
test eax, eax
je $LN143@xmlXPtrStr
push eax
call _xmlXPathFreeObject
add esp, 4
pop edi
pop ebx
pop esi
; 2828 : }
mov esp, ebp
pop ebp
ret 0
$LN19@xmlXPtrStr:
; 2724 : }
; 2725 : CHECK_TYPE(XPATH_STRING);
push 11 ; 0000000bH
push ebx
call _xmlXPathErr
add esp, 8
pop ebx
pop esi
; 2828 : }
mov esp, ebp
pop ebp
ret 0
$LN9@xmlXPtrStr:
; 2697 : int i, startindex, endindex = 0, fendindex;
; 2698 : xmlNodePtr start, end = 0, fend;
; 2699 : xmlXPathObjectPtr set;
; 2700 : xmlLocationSetPtr oldset;
; 2701 : xmlLocationSetPtr newset;
; 2702 : xmlXPathObjectPtr string;
; 2703 : xmlXPathObjectPtr position = NULL;
; 2704 : xmlXPathObjectPtr number = NULL;
; 2705 : int found, pos = 0, num = 0;
; 2706 :
; 2707 : /*
; 2708 : * Grab the arguments
; 2709 : */
; 2710 : if ((nargs < 2) || (nargs > 4))
; 2711 : XP_ERROR(XPATH_INVALID_ARITY);
push 12 ; 0000000cH
push DWORD PTR _ctxt$[ebp]
call _xmlXPathErr
add esp, 8
pop esi
; 2828 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrStringRangeFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEvalXPointer
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_xmlXPtrEvalXPointer PROC ; COMDAT
; 1228 : xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
cmp DWORD PTR [esi+28], 0
jne SHORT $LN70@xmlXPtrEva
; 1229 : if (ctxt->valueTab == NULL) {
; 1230 : /* Allocate the value stack */
; 1231 : ctxt->valueTab = (xmlXPathObjectPtr *)
push 40 ; 00000028H
call DWORD PTR _xmlMalloc
add esp, 4
mov DWORD PTR [esi+28], eax
; 1232 : xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
; 1233 : if (ctxt->valueTab == NULL) {
test eax, eax
jne SHORT $LN7@xmlXPtrEva
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BO@HMMGLLBJ@allocating?5evaluation?5context@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BO@HMMGLLBJ@allocating?5evaluation?5context@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
pop esi
; 1264 : }
pop ebp
ret 0
$LN7@xmlXPtrEva:
; 1234 : xmlXPtrErrMemory("allocating evaluation context");
; 1235 : return;
; 1236 : }
; 1237 : ctxt->valueNr = 0;
mov DWORD PTR [esi+20], 0
; 1238 : ctxt->valueMax = 10;
mov DWORD PTR [esi+24], 10 ; 0000000aH
; 1239 : ctxt->value = NULL;
mov DWORD PTR [esi+16], 0
; 1240 : ctxt->valueFrame = 0;
mov DWORD PTR [esi+44], 0
$LN70@xmlXPtrEva:
mov ecx, DWORD PTR [esi]
$LL2@xmlXPtrEva:
; 1241 : }
; 1242 : SKIP_BLANKS;
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN8@xmlXPtrEva
cmp al, 9
jb SHORT $LN9@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN8@xmlXPtrEva
$LN9@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne SHORT $LN3@xmlXPtrEva
$LN8@xmlXPtrEva:
test al, al
je SHORT $LL2@xmlXPtrEva
inc ecx
mov DWORD PTR [esi], ecx
jmp SHORT $LL2@xmlXPtrEva
$LN3@xmlXPtrEva:
; 1243 : if (CUR == '/') {
push esi
cmp al, 47 ; 0000002fH
jne SHORT $LN10@xmlXPtrEva
; 1244 : xmlXPathRoot(ctxt);
call _xmlXPathRoot
add esp, 4
; 1245 : xmlXPtrEvalChildSeq(ctxt, NULL);
xor ecx, ecx
$LN13@xmlXPtrEva:
push ecx
push esi
call _xmlXPtrEvalChildSeq
add esp, 8
$LL4@xmlXPtrEva:
; 1253 : xmlXPtrEvalFullXPtr(ctxt, name);
; 1254 : /* Short evaluation */
; 1255 : return;
; 1256 : } else {
; 1257 : /* this handle both Bare Names and Child Sequences */
; 1258 : xmlXPtrEvalChildSeq(ctxt, name);
; 1259 : }
; 1260 : }
; 1261 : SKIP_BLANKS;
mov ecx, DWORD PTR [esi]
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN15@xmlXPtrEva
cmp al, 9
jb SHORT $LN16@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN15@xmlXPtrEva
$LN16@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne $LN5@xmlXPtrEva
$LN15@xmlXPtrEva:
test al, al
je SHORT $LL4@xmlXPtrEva
lea eax, DWORD PTR [ecx+1]
mov DWORD PTR [esi], eax
jmp SHORT $LL4@xmlXPtrEva
$LN10@xmlXPtrEva:
; 1246 : } else {
; 1247 : xmlChar *name;
; 1248 :
; 1249 : name = xmlXPathParseName(ctxt);
call _xmlXPathParseName
mov ecx, eax
add esp, 4
; 1250 : if (name == NULL)
test ecx, ecx
je $LN96@xmlXPtrEva
; 1251 : XP_ERROR(XPATH_EXPR_ERROR);
; 1252 : if (CUR == '(') {
mov eax, DWORD PTR [esi]
cmp BYTE PTR [eax], 40 ; 00000028H
jne SHORT $LN13@xmlXPtrEva
$LL26@xmlXPtrEva:
; 1124 : xmlXPtrEvalXPtrPart(ctxt, name);
push ecx
push esi
mov DWORD PTR [esi+8], 0
call _xmlXPtrEvalXPtrPart
; 1125 :
; 1126 : /* in case of syntax error, break here */
; 1127 : if ((ctxt->error != XPATH_EXPRESSION_OK) &&
mov eax, DWORD PTR [esi+8]
add esp, 8
test eax, eax
je SHORT $LN80@xmlXPtrEva
cmp eax, 1900 ; 0000076cH
jne $LN17@xmlXPtrEva
$LN80@xmlXPtrEva:
; 1128 : (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
; 1129 : return;
; 1130 :
; 1131 : /*
; 1132 : * If the returned value is a non-empty nodeset
; 1133 : * or location set, return here.
; 1134 : */
; 1135 : if (ctxt->value != NULL) {
mov eax, DWORD PTR [esi+16]
test eax, eax
je SHORT $LN31@xmlXPtrEva
; 1136 : xmlXPathObjectPtr obj = ctxt->value;
; 1137 :
; 1138 : switch (obj->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 1
je SHORT $LN41@xmlXPtrEva
sub ecx, 6
jne SHORT $LL32@xmlXPtrEva
; 1139 : case XPATH_LOCATIONSET: {
; 1140 : xmlLocationSetPtr loc = ctxt->value->user;
mov eax, DWORD PTR [eax+28]
; 1141 : if ((loc != NULL) && (loc->locNr > 0))
; 1142 : return;
; 1143 : break;
jmp SHORT $LN126@xmlXPtrEva
$LN41@xmlXPtrEva:
; 1144 : }
; 1145 : case XPATH_NODESET: {
; 1146 : xmlNodeSetPtr loc = ctxt->value->nodesetval;
mov eax, DWORD PTR [eax+4]
$LN126@xmlXPtrEva:
; 1147 : if ((loc != NULL) && (loc->nodeNr > 0))
; 1148 : return;
; 1149 : break;
; 1150 : }
; 1151 : default:
; 1152 : break;
; 1153 : }
; 1154 :
; 1155 : /*
; 1156 : * Evaluating to improper values is equivalent to
; 1157 : * a sub-resource error, clean-up the stack
; 1158 : */
; 1159 : do {
; 1160 : obj = valuePop(ctxt);
test eax, eax
je SHORT $LL32@xmlXPtrEva
cmp DWORD PTR [eax], 0
jg SHORT $LN17@xmlXPtrEva
npad 7
$LL32@xmlXPtrEva:
push esi
call _valuePop
add esp, 4
; 1161 : if (obj != NULL) {
test eax, eax
je SHORT $LN31@xmlXPtrEva
; 1162 : xmlXPathFreeObject(obj);
push eax
call _xmlXPathFreeObject
add esp, 4
; 1163 : }
; 1164 : } while (obj != NULL);
jmp SHORT $LL32@xmlXPtrEva
$LN31@xmlXPtrEva:
; 1125 :
; 1126 : /* in case of syntax error, break here */
; 1127 : if ((ctxt->error != XPATH_EXPRESSION_OK) &&
mov ecx, DWORD PTR [esi]
npad 6
$LL33@xmlXPtrEva:
; 1165 : }
; 1166 :
; 1167 : /*
; 1168 : * Is there another XPointer part.
; 1169 : */
; 1170 : SKIP_BLANKS;
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN45@xmlXPtrEva
cmp al, 9
jb SHORT $LN46@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN45@xmlXPtrEva
$LN46@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne SHORT $LN34@xmlXPtrEva
$LN45@xmlXPtrEva:
test al, al
je SHORT $LL33@xmlXPtrEva
inc ecx
mov DWORD PTR [esi], ecx
jmp SHORT $LL33@xmlXPtrEva
$LN34@xmlXPtrEva:
; 1171 : name = xmlXPathParseName(ctxt);
push esi
call _xmlXPathParseName
mov ecx, eax
add esp, 4
test ecx, ecx
jne $LL26@xmlXPtrEva
pop esi
; 1264 : }
pop ebp
ret 0
$LN5@xmlXPtrEva:
; 1262 : if (CUR != 0)
test al, al
je SHORT $LN17@xmlXPtrEva
$LN96@xmlXPtrEva:
; 1263 : XP_ERROR(XPATH_EXPR_ERROR);
push 7
push esi
call _xmlXPathErr
add esp, 8
$LN17@xmlXPtrEva:
pop esi
; 1264 : }
pop ebp
ret 0
_xmlXPtrEvalXPointer ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEvalFullXPtr
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_name$ = 12 ; size = 4
_xmlXPtrEvalFullXPtr PROC ; COMDAT
; 1117 : xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _name$[ebp]
mov esi, DWORD PTR _ctxt$[ebp]
test eax, eax
jne SHORT $LL2@xmlXPtrEva
; 1118 : if (name == NULL)
; 1119 : name = xmlXPathParseName(ctxt);
push esi
call _xmlXPathParseName
add esp, 4
; 1120 : if (name == NULL)
test eax, eax
jne SHORT $LL2@xmlXPtrEva
; 1121 : XP_ERROR(XPATH_EXPR_ERROR);
push 7
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 1172 : }
; 1173 : }
pop ebp
ret 0
$LL2@xmlXPtrEva:
; 1122 : while (name != NULL) {
; 1123 : ctxt->error = XPATH_EXPRESSION_OK;
; 1124 : xmlXPtrEvalXPtrPart(ctxt, name);
push eax
push esi
mov DWORD PTR [esi+8], 0
call _xmlXPtrEvalXPtrPart
; 1125 :
; 1126 : /* in case of syntax error, break here */
; 1127 : if ((ctxt->error != XPATH_EXPRESSION_OK) &&
mov eax, DWORD PTR [esi+8]
add esp, 8
test eax, eax
je SHORT $LN42@xmlXPtrEva
cmp eax, 1900 ; 0000076cH
jne SHORT $LN69@xmlXPtrEva
$LN42@xmlXPtrEva:
; 1128 : (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
; 1129 : return;
; 1130 :
; 1131 : /*
; 1132 : * If the returned value is a non-empty nodeset
; 1133 : * or location set, return here.
; 1134 : */
; 1135 : if (ctxt->value != NULL) {
mov eax, DWORD PTR [esi+16]
test eax, eax
je SHORT $LN7@xmlXPtrEva
; 1136 : xmlXPathObjectPtr obj = ctxt->value;
; 1137 :
; 1138 : switch (obj->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 1
je SHORT $LN17@xmlXPtrEva
sub ecx, 6
jne SHORT $LL8@xmlXPtrEva
; 1139 : case XPATH_LOCATIONSET: {
; 1140 : xmlLocationSetPtr loc = ctxt->value->user;
mov eax, DWORD PTR [eax+28]
; 1141 : if ((loc != NULL) && (loc->locNr > 0))
; 1142 : return;
; 1143 : break;
jmp SHORT $LN75@xmlXPtrEva
$LN17@xmlXPtrEva:
; 1144 : }
; 1145 : case XPATH_NODESET: {
; 1146 : xmlNodeSetPtr loc = ctxt->value->nodesetval;
mov eax, DWORD PTR [eax+4]
$LN75@xmlXPtrEva:
; 1147 : if ((loc != NULL) && (loc->nodeNr > 0))
; 1148 : return;
; 1149 : break;
; 1150 : }
; 1151 : default:
; 1152 : break;
; 1153 : }
; 1154 :
; 1155 : /*
; 1156 : * Evaluating to improper values is equivalent to
; 1157 : * a sub-resource error, clean-up the stack
; 1158 : */
; 1159 : do {
; 1160 : obj = valuePop(ctxt);
test eax, eax
je SHORT $LL8@xmlXPtrEva
cmp DWORD PTR [eax], 0
jg SHORT $LN69@xmlXPtrEva
$LL8@xmlXPtrEva:
push esi
call _valuePop
add esp, 4
; 1161 : if (obj != NULL) {
test eax, eax
je SHORT $LN7@xmlXPtrEva
; 1162 : xmlXPathFreeObject(obj);
push eax
call _xmlXPathFreeObject
add esp, 4
; 1163 : }
; 1164 : } while (obj != NULL);
jmp SHORT $LL8@xmlXPtrEva
$LN7@xmlXPtrEva:
; 1125 :
; 1126 : /* in case of syntax error, break here */
; 1127 : if ((ctxt->error != XPATH_EXPRESSION_OK) &&
mov ecx, DWORD PTR [esi]
$LL9@xmlXPtrEva:
; 1165 : }
; 1166 :
; 1167 : /*
; 1168 : * Is there another XPointer part.
; 1169 : */
; 1170 : SKIP_BLANKS;
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN21@xmlXPtrEva
cmp al, 9
jb SHORT $LN22@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN21@xmlXPtrEva
$LN22@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne SHORT $LN10@xmlXPtrEva
$LN21@xmlXPtrEva:
test al, al
je SHORT $LL9@xmlXPtrEva
inc ecx
mov DWORD PTR [esi], ecx
jmp SHORT $LL9@xmlXPtrEva
$LN10@xmlXPtrEva:
; 1171 : name = xmlXPathParseName(ctxt);
push esi
call _xmlXPathParseName
add esp, 4
test eax, eax
jne $LL2@xmlXPtrEva
$LN69@xmlXPtrEva:
pop esi
; 1172 : }
; 1173 : }
pop ebp
ret 0
_xmlXPtrEvalFullXPtr ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEvalXPtrPart
_TEXT SEGMENT
_left$1$ = -12 ; size = 4
_value$1$ = -8 ; size = 4
_prefix$1$ = -4 ; size = 4
_cur$1$ = -4 ; size = 4
_ctxt$ = 8 ; size = 4
_buffer$1$ = 12 ; size = 4
_name$ = 12 ; size = 4
_xmlXPtrEvalXPtrPart PROC ; COMDAT
; 949 : xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
push ebp
mov ebp, esp
sub esp, 12 ; 0000000cH
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push ebx
push edi
call @__CheckForDebuggerJustMyCode@4
mov ebx, DWORD PTR _name$[ebp]
mov edi, DWORD PTR _ctxt$[ebp]
test ebx, ebx
jne SHORT $LN9@xmlXPtrEva
; 950 : xmlChar *buffer, *cur;
; 951 : int len;
; 952 : int level;
; 953 :
; 954 : if (name == NULL)
; 955 : name = xmlXPathParseName(ctxt);
push edi
call _xmlXPathParseName
mov ebx, eax
add esp, 4
; 956 : if (name == NULL)
test ebx, ebx
jne SHORT $LN9@xmlXPtrEva
; 957 : XP_ERROR(XPATH_EXPR_ERROR);
push 7
push edi
call _xmlXPathErr
add esp, 8
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN9@xmlXPtrEva:
; 958 :
; 959 : if (CUR != '(') {
mov eax, DWORD PTR [edi]
cmp BYTE PTR [eax], 40 ; 00000028H
je SHORT $LN10@xmlXPtrEva
; 960 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
; 961 : XP_ERROR(XPATH_EXPR_ERROR);
push 7
push edi
call _xmlXPathErr
add esp, 12 ; 0000000cH
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN10@xmlXPtrEva:
; 962 : }
; 963 : NEXT;
inc eax
push esi
; 964 : level = 1;
; 965 :
; 966 : len = xmlStrlen(ctxt->cur);
push eax
mov DWORD PTR [edi], eax
mov esi, 1
call _xmlStrlen
; 967 : len++;
inc eax
; 968 : buffer = (xmlChar *) xmlMallocAtomic(len * sizeof (xmlChar));
push eax
call DWORD PTR _xmlMallocAtomic
add esp, 8
mov DWORD PTR _buffer$1$[ebp], eax
; 969 : if (buffer == NULL) {
test eax, eax
jne SHORT $LN11@xmlXPtrEva
; 970 : xmlXPtrErrMemory("allocating buffer");
push OFFSET ??_C@_0BC@MDOPFBLJ@allocating?5buffer@
call _xmlXPtrErrMemory
; 1086 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
add esp, 8
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN11@xmlXPtrEva:
; 971 : xmlFree(name);
; 972 : return;
; 973 : }
; 974 :
; 975 : cur = buffer;
; 976 : while (CUR != 0) {
mov ecx, DWORD PTR [edi]
mov edx, eax
mov DWORD PTR _cur$1$[ebp], edx
mov al, BYTE PTR [ecx]
test al, al
je SHORT $LN73@xmlXPtrEva
$LL2@xmlXPtrEva:
; 977 : if (CUR == ')') {
cmp al, 41 ; 00000029H
jne SHORT $LN12@xmlXPtrEva
; 978 : level--;
sub esi, 1
; 979 : if (level == 0) {
jne SHORT $LN43@xmlXPtrEva
; 980 : NEXT;
mov edx, DWORD PTR _cur$1$[ebp]
test al, al
je SHORT $LN73@xmlXPtrEva
lea eax, DWORD PTR [ecx+1]
mov DWORD PTR [edi], eax
jmp SHORT $LN73@xmlXPtrEva
$LN12@xmlXPtrEva:
; 981 : break;
; 982 : }
; 983 : } else if (CUR == '(') {
cmp al, 40 ; 00000028H
jne SHORT $LN15@xmlXPtrEva
; 984 : level++;
inc esi
jmp SHORT $LN43@xmlXPtrEva
$LN15@xmlXPtrEva:
; 985 : } else if (CUR == '^') {
cmp al, 94 ; 0000005eH
jne SHORT $LN43@xmlXPtrEva
; 986 : if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
mov dl, BYTE PTR [ecx+1]
inc ecx
cmp dl, 41 ; 00000029H
je SHORT $LN19@xmlXPtrEva
cmp dl, 40 ; 00000028H
je SHORT $LN19@xmlXPtrEva
cmp dl, al
jne SHORT $LN43@xmlXPtrEva
$LN19@xmlXPtrEva:
; 987 : NEXT;
mov DWORD PTR [edi], ecx
mov al, BYTE PTR [ecx]
$LN43@xmlXPtrEva:
; 988 : }
; 989 : }
; 990 : *cur++ = CUR;
mov ecx, DWORD PTR _cur$1$[ebp]
mov BYTE PTR [ecx], al
inc ecx
mov DWORD PTR _cur$1$[ebp], ecx
; 991 : NEXT;
mov ecx, DWORD PTR [edi]
cmp BYTE PTR [ecx], 0
je SHORT $LN70@xmlXPtrEva
inc ecx
mov DWORD PTR [edi], ecx
$LN70@xmlXPtrEva:
; 971 : xmlFree(name);
; 972 : return;
; 973 : }
; 974 :
; 975 : cur = buffer;
; 976 : while (CUR != 0) {
mov al, BYTE PTR [ecx]
test al, al
jne SHORT $LL2@xmlXPtrEva
mov edx, DWORD PTR _cur$1$[ebp]
$LN73@xmlXPtrEva:
; 992 : }
; 993 : *cur = 0;
mov BYTE PTR [edx], 0
; 994 :
; 995 : if ((level != 0) && (CUR == 0)) {
test esi, esi
je SHORT $LN71@xmlXPtrEva
mov eax, DWORD PTR [edi]
cmp BYTE PTR [eax], 0
jne SHORT $LN71@xmlXPtrEva
; 996 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
; 997 : xmlFree(buffer);
mov eax, DWORD PTR _buffer$1$[ebp]
push eax
; 998 : XP_ERROR(XPTR_SYNTAX_ERROR);
jmp $LN79@xmlXPtrEva
$LN71@xmlXPtrEva:
; 999 : }
; 1000 :
; 1001 : if (xmlStrEqual(name, (xmlChar *) "xpointer")) {
push OFFSET ??_C@_08DNJCJFMK@xpointer@
push ebx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN21@xmlXPtrEva
; 1002 : const xmlChar *left = CUR_PTR;
; 1003 :
; 1004 : CUR_PTR = buffer;
; 1005 : /*
; 1006 : * To evaluate an xpointer scheme element (4.3) we need:
; 1007 : * context initialized to the root
; 1008 : * context position initalized to 1
; 1009 : * context size initialized to 1
; 1010 : */
; 1011 : ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
mov ecx, DWORD PTR [edi+12]
mov esi, DWORD PTR [edi]
mov eax, DWORD PTR _buffer$1$[ebp]
mov DWORD PTR [edi], eax
mov eax, DWORD PTR [ecx]
mov DWORD PTR [ecx+4], eax
; 1012 : ctxt->context->proximityPosition = 1;
mov eax, DWORD PTR [edi+12]
; 1013 : ctxt->context->contextSize = 1;
; 1014 : xmlXPathEvalExpr(ctxt);
push edi
mov DWORD PTR [eax+72], 1
mov eax, DWORD PTR [edi+12]
mov DWORD PTR [eax+68], 1
call _xmlXPathEvalExpr
add esp, 4
; 1015 : CUR_PTR=left;
mov DWORD PTR [edi], esi
jmp $LN29@xmlXPtrEva
$LN21@xmlXPtrEva:
; 1016 : } else if (xmlStrEqual(name, (xmlChar *) "element")) {
push OFFSET ??_C@_07HCLJNICE@element@
push ebx
call _xmlStrEqual
add esp, 8
test eax, eax
je SHORT $LN23@xmlXPtrEva
; 1017 : const xmlChar *left = CUR_PTR;
; 1018 : xmlChar *name2;
; 1019 :
; 1020 : CUR_PTR = buffer;
mov eax, DWORD PTR _buffer$1$[ebp]
mov esi, DWORD PTR [edi]
mov DWORD PTR [edi], eax
; 1021 : if (buffer[0] == '/') {
push edi
cmp BYTE PTR [eax], 47 ; 0000002fH
jne SHORT $LN25@xmlXPtrEva
; 1022 : xmlXPathRoot(ctxt);
call _xmlXPathRoot
add esp, 4
; 1023 : xmlXPtrEvalChildSeq(ctxt, NULL);
xor eax, eax
$LN27@xmlXPtrEva:
; 1031 : }
; 1032 : xmlXPtrEvalChildSeq(ctxt, name2);
; 1033 : }
; 1034 : CUR_PTR = left;
push eax
push edi
call _xmlXPtrEvalChildSeq
add esp, 8
mov DWORD PTR [edi], esi
jmp $LN29@xmlXPtrEva
$LN25@xmlXPtrEva:
; 1024 : } else {
; 1025 : name2 = xmlXPathParseName(ctxt);
call _xmlXPathParseName
add esp, 4
; 1026 : if (name2 == NULL) {
test eax, eax
jne SHORT $LN27@xmlXPtrEva
; 1027 : CUR_PTR = left;
; 1028 : xmlFree(buffer);
mov eax, DWORD PTR _buffer$1$[ebp]
push eax
mov DWORD PTR [edi], esi
call DWORD PTR _xmlFree
; 1029 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
; 1030 : XP_ERROR(XPATH_EXPR_ERROR);
push 7
push edi
call _xmlXPathErr
add esp, 16 ; 00000010H
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN23@xmlXPtrEva:
; 1035 : #ifdef XPTR_XMLNS_SCHEME
; 1036 : } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) {
push OFFSET ??_C@_05PPEFOGKI@xmlns@
push ebx
call _xmlStrEqual
add esp, 8
test eax, eax
je $LN28@xmlXPtrEva
; 1037 : const xmlChar *left = CUR_PTR;
mov eax, DWORD PTR [edi]
mov DWORD PTR _left$1$[ebp], eax
; 1038 : xmlChar *prefix;
; 1039 : xmlChar *URI;
; 1040 : xmlURIPtr value;
; 1041 :
; 1042 : CUR_PTR = buffer;
mov eax, DWORD PTR _buffer$1$[ebp]
; 1043 : prefix = xmlXPathParseNCName(ctxt);
push edi
mov DWORD PTR [edi], eax
call _xmlXPathParseNCName
mov esi, eax
add esp, 4
mov DWORD PTR _prefix$1$[ebp], esi
; 1044 : if (prefix == NULL) {
test esi, esi
jne SHORT $LN61@xmlXPtrEva
; 1045 : xmlFree(buffer);
push DWORD PTR _buffer$1$[ebp]
call DWORD PTR _xmlFree
; 1046 : xmlFree(name);
push ebx
$LN79@xmlXPtrEva:
call DWORD PTR _xmlFree
; 1047 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push edi
call _xmlXPathErr
add esp, 16 ; 00000010H
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN61@xmlXPtrEva:
mov ecx, DWORD PTR [edi]
npad 4
$LL4@xmlXPtrEva:
; 1048 : }
; 1049 : SKIP_BLANKS;
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN31@xmlXPtrEva
cmp al, 9
jb SHORT $LN32@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN31@xmlXPtrEva
$LN32@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne SHORT $LN5@xmlXPtrEva
$LN31@xmlXPtrEva:
test al, al
je SHORT $LL4@xmlXPtrEva
inc ecx
mov DWORD PTR [edi], ecx
jmp SHORT $LL4@xmlXPtrEva
$LN5@xmlXPtrEva:
; 1050 : if (CUR != '=') {
cmp al, 61 ; 0000003dH
jne $LN72@xmlXPtrEva
$LN78@xmlXPtrEva:
; 1051 : xmlFree(prefix);
; 1052 : xmlFree(buffer);
; 1053 : xmlFree(name);
; 1054 : XP_ERROR(XPTR_SYNTAX_ERROR);
; 1055 : }
; 1056 : NEXT;
; 1057 : SKIP_BLANKS;
inc ecx
mov DWORD PTR [edi], ecx
$LL6@xmlXPtrEva:
mov al, BYTE PTR [ecx]
cmp al, 32 ; 00000020H
je SHORT $LN34@xmlXPtrEva
cmp al, 9
jb SHORT $LN35@xmlXPtrEva
cmp al, 10 ; 0000000aH
jbe SHORT $LN34@xmlXPtrEva
$LN35@xmlXPtrEva:
cmp al, 13 ; 0000000dH
jne SHORT $LN7@xmlXPtrEva
$LN34@xmlXPtrEva:
test al, al
je SHORT $LL6@xmlXPtrEva
jmp SHORT $LN78@xmlXPtrEva
$LN7@xmlXPtrEva:
; 1058 : /* @@ check escaping in the XPointer WD */
; 1059 :
; 1060 : value = xmlParseURI((const char *)ctxt->cur);
push ecx
call _xmlParseURI
add esp, 4
mov DWORD PTR _value$1$[ebp], eax
; 1061 : if (value == NULL) {
test eax, eax
je SHORT $LN72@xmlXPtrEva
; 1066 : }
; 1067 : URI = xmlSaveUri(value);
push eax
call _xmlSaveUri
; 1068 : xmlFreeURI(value);
push DWORD PTR _value$1$[ebp]
mov esi, eax
call _xmlFreeURI
add esp, 8
; 1069 : if (URI == NULL) {
test esi, esi
jne SHORT $LN37@xmlXPtrEva
; 1070 : xmlFree(prefix);
push DWORD PTR _prefix$1$[ebp]
call DWORD PTR _xmlFree
; 1071 : xmlFree(buffer);
push DWORD PTR _buffer$1$[ebp]
call DWORD PTR _xmlFree
; 1072 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
; 1073 : XP_ERROR(XPATH_MEMORY_ERROR);
push 15 ; 0000000fH
push edi
call _xmlXPathErr
add esp, 20 ; 00000014H
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN37@xmlXPtrEva:
; 1074 : }
; 1075 :
; 1076 : xmlXPathRegisterNs(ctxt->context, prefix, URI);
push esi
push DWORD PTR _prefix$1$[ebp]
push DWORD PTR [edi+12]
call _xmlXPathRegisterNs
; 1077 : CUR_PTR = left;
mov eax, DWORD PTR _left$1$[ebp]
; 1078 : xmlFree(URI);
push esi
mov DWORD PTR [edi], eax
call DWORD PTR _xmlFree
; 1079 : xmlFree(prefix);
push DWORD PTR _prefix$1$[ebp]
call DWORD PTR _xmlFree
add esp, 20 ; 00000014H
; 1080 : #endif /* XPTR_XMLNS_SCHEME */
; 1081 : } else {
jmp SHORT $LN29@xmlXPtrEva
$LN72@xmlXPtrEva:
; 1062 : xmlFree(prefix);
push esi
call DWORD PTR _xmlFree
; 1063 : xmlFree(buffer);
push DWORD PTR _buffer$1$[ebp]
call DWORD PTR _xmlFree
; 1064 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
; 1065 : XP_ERROR(XPTR_SYNTAX_ERROR);
push 16 ; 00000010H
push edi
call _xmlXPathErr
add esp, 20 ; 00000014H
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN28@xmlXPtrEva:
; 1082 : xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
push ebx
push OFFSET ??_C@_0BJ@PBEDODCO@unsupported?5scheme?5?8?$CFs?8?6@
push 1900 ; 0000076cH
push edi
call _xmlXPtrErr
add esp, 16 ; 00000010H
$LN29@xmlXPtrEva:
; 1083 : "unsupported scheme '%s'\n", name);
; 1084 : }
; 1085 : xmlFree(buffer);
push DWORD PTR _buffer$1$[ebp]
call DWORD PTR _xmlFree
; 1086 : xmlFree(name);
push ebx
call DWORD PTR _xmlFree
add esp, 8
pop esi
pop edi
; 1087 : }
pop ebx
mov esp, ebp
pop ebp
ret 0
_xmlXPtrEvalXPtrPart ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetChildNo
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_indx$ = 12 ; size = 4
_xmlXPtrGetChildNo PROC ; COMDAT
; 891 : xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [esi+16]
test eax, eax
je SHORT $LN3@xmlXPtrGet
; 892 : xmlNodePtr cur = NULL;
; 893 : xmlXPathObjectPtr obj;
; 894 : xmlNodeSetPtr oldset;
; 895 :
; 896 : CHECK_TYPE(XPATH_NODESET);
cmp DWORD PTR [eax], 1
jne SHORT $LN3@xmlXPtrGet
; 897 : obj = valuePop(ctxt);
push ebx
push edi
push esi
call _valuePop
mov edi, eax
add esp, 4
; 898 : oldset = obj->nodesetval;
; 899 : if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
mov eax, DWORD PTR _indx$[ebp]
test eax, eax
jle SHORT $LN5@xmlXPtrGet
mov ebx, DWORD PTR [edi+4]
test ebx, ebx
je SHORT $LN5@xmlXPtrGet
cmp DWORD PTR [ebx], 1
jne SHORT $LN5@xmlXPtrGet
; 902 : return;
; 903 : }
; 904 : cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
push eax
mov eax, DWORD PTR [ebx+8]
push DWORD PTR [eax]
call _xmlXPtrGetNthChild
add esp, 8
mov ecx, eax
; 905 : if (cur == NULL) {
push edi
test ecx, ecx
je SHORT $LN10@xmlXPtrGet
; 906 : xmlXPathFreeObject(obj);
; 907 : valuePush(ctxt, xmlXPathNewNodeSet(NULL));
; 908 : return;
; 909 : }
; 910 : oldset->nodeTab[0] = cur;
mov eax, DWORD PTR [ebx+8]
; 911 : valuePush(ctxt, obj);
push esi
mov DWORD PTR [eax], ecx
call _valuePush
add esp, 8
pop edi
pop ebx
pop esi
; 912 : }
pop ebp
ret 0
$LN5@xmlXPtrGet:
; 900 : xmlXPathFreeObject(obj);
push edi
$LN10@xmlXPtrGet:
call _xmlXPathFreeObject
; 901 : valuePush(ctxt, xmlXPathNewNodeSet(NULL));
push 0
call _xmlXPathNewNodeSet
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
pop edi
pop ebx
pop esi
; 912 : }
pop ebp
ret 0
$LN3@xmlXPtrGet:
; 892 : xmlNodePtr cur = NULL;
; 893 : xmlXPathObjectPtr obj;
; 894 : xmlNodeSetPtr oldset;
; 895 :
; 896 : CHECK_TYPE(XPATH_NODESET);
push 11 ; 0000000bH
push esi
call _xmlXPathErr
add esp, 8
pop esi
; 912 : }
pop ebp
ret 0
_xmlXPtrGetChildNo ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEvalChildSeq
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_oldset$1$ = 12 ; size = 4
_name$ = 12 ; size = 4
_xmlXPtrEvalChildSeq PROC ; COMDAT
; 1187 : xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) {
push ebp
mov ebp, esp
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _name$[ebp]
test esi, esi
jne SHORT $LN27@xmlXPtrEva
; 1188 : /*
; 1189 : * XPointer don't allow by syntax to address in mutirooted trees
; 1190 : * this might prove useful in some cases, warn about it.
; 1191 : */
; 1192 : if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
mov edi, DWORD PTR _ctxt$[ebp]
mov eax, DWORD PTR [edi]
cmp BYTE PTR [eax], 47 ; 0000002fH
jne SHORT $LN21@xmlXPtrEva
cmp BYTE PTR [eax+1], 49 ; 00000031H
je SHORT $LN21@xmlXPtrEva
; 1193 : xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
push esi
push OFFSET ??_C@_0CG@PNGJONJE@warning?3?5ChildSeq?5not?5starting?5@
push 1901 ; 0000076dH
push edi
call _xmlXPtrErr
add esp, 16 ; 00000010H
; 1194 : "warning: ChildSeq not starting by /1\n", NULL);
; 1195 : }
; 1196 :
; 1197 : if (name != NULL) {
jmp SHORT $LN21@xmlXPtrEva
$LN27@xmlXPtrEva:
; 1198 : valuePush(ctxt, xmlXPathNewString(name));
push esi
call _xmlXPathNewString
mov edi, DWORD PTR _ctxt$[ebp]
push eax
push edi
call _valuePush
; 1199 : xmlFree(name);
push esi
call DWORD PTR _xmlFree
; 1200 : xmlXPathIdFunction(ctxt, 1);
push 1
push edi
call _xmlXPathIdFunction
add esp, 24 ; 00000018H
; 1201 : CHECK_ERROR;
cmp DWORD PTR [edi+8], 0
jne $LN3@xmlXPtrEva
$LN21@xmlXPtrEva:
; 1202 : }
; 1203 :
; 1204 : while (CUR == '/') {
mov esi, DWORD PTR [edi]
mov al, BYTE PTR [esi]
cmp al, 47 ; 0000002fH
jne $LN3@xmlXPtrEva
push ebx
$LL2@xmlXPtrEva:
; 1205 : int child = 0;
xor ebx, ebx
; 1206 : NEXT;
test al, al
je SHORT $LN28@xmlXPtrEva
inc esi
mov DWORD PTR [edi], esi
mov al, BYTE PTR [esi]
$LN28@xmlXPtrEva:
; 1207 :
; 1208 : while ((CUR >= '0') && (CUR <= '9')) {
cmp al, 48 ; 00000030H
jb SHORT $LN29@xmlXPtrEva
$LL4@xmlXPtrEva:
cmp al, 57 ; 00000039H
ja SHORT $LN29@xmlXPtrEva
; 1209 : child = child * 10 + (CUR - '0');
movzx ecx, al
lea ebx, DWORD PTR [ebx+ebx*4]
lea ebx, DWORD PTR [ebx-24]
lea ebx, DWORD PTR [ecx+ebx*2]
; 1210 : NEXT;
test al, al
je SHORT $LN12@xmlXPtrEva
inc esi
mov DWORD PTR [edi], esi
mov al, BYTE PTR [esi]
$LN12@xmlXPtrEva:
; 1207 :
; 1208 : while ((CUR >= '0') && (CUR <= '9')) {
cmp al, 48 ; 00000030H
jae SHORT $LL4@xmlXPtrEva
$LN29@xmlXPtrEva:
; 896 : CHECK_TYPE(XPATH_NODESET);
mov eax, DWORD PTR [edi+16]
test eax, eax
je SHORT $LN16@xmlXPtrEva
cmp DWORD PTR [eax], 1
jne SHORT $LN16@xmlXPtrEva
; 897 : obj = valuePop(ctxt);
push edi
call _valuePop
add esp, 4
mov esi, eax
; 899 : if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
test ebx, ebx
jle SHORT $LN18@xmlXPtrEva
; 898 : oldset = obj->nodesetval;
mov eax, DWORD PTR [esi+4]
mov DWORD PTR _oldset$1$[ebp], eax
; 899 : if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
test eax, eax
je SHORT $LN18@xmlXPtrEva
cmp DWORD PTR [eax], 1
jne SHORT $LN18@xmlXPtrEva
; 901 : valuePush(ctxt, xmlXPathNewNodeSet(NULL));
; 902 : return;
; 903 : }
; 904 : cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
mov eax, DWORD PTR [eax+8]
push ebx
push DWORD PTR [eax]
call _xmlXPtrGetNthChild
add esp, 8
mov ecx, eax
; 905 : if (cur == NULL) {
push esi
test ecx, ecx
je SHORT $LN31@xmlXPtrEva
; 906 : xmlXPathFreeObject(obj);
; 907 : valuePush(ctxt, xmlXPathNewNodeSet(NULL));
; 908 : return;
; 909 : }
; 910 : oldset->nodeTab[0] = cur;
mov eax, DWORD PTR _oldset$1$[ebp]
; 911 : valuePush(ctxt, obj);
push edi
mov eax, DWORD PTR [eax+8]
mov DWORD PTR [eax], ecx
call _valuePush
jmp SHORT $LN30@xmlXPtrEva
$LN18@xmlXPtrEva:
; 900 : xmlXPathFreeObject(obj);
push esi
$LN31@xmlXPtrEva:
; 1202 : }
; 1203 :
; 1204 : while (CUR == '/') {
call _xmlXPathFreeObject
push 0
call _xmlXPathNewNodeSet
push eax
push edi
call _valuePush
add esp, 16 ; 00000010H
jmp SHORT $LN14@xmlXPtrEva
$LN16@xmlXPtrEva:
; 896 : CHECK_TYPE(XPATH_NODESET);
push 11 ; 0000000bH
push edi
call _xmlXPathErr
$LN30@xmlXPtrEva:
; 1202 : }
; 1203 :
; 1204 : while (CUR == '/') {
add esp, 8
$LN14@xmlXPtrEva:
mov esi, DWORD PTR [edi]
mov al, BYTE PTR [esi]
cmp al, 47 ; 0000002fH
je $LL2@xmlXPtrEva
pop ebx
$LN3@xmlXPtrEva:
pop edi
; 1211 : }
; 1212 : xmlXPtrGetChildNo(ctxt, child);
; 1213 : }
; 1214 : }
pop esi
pop ebp
ret 0
_xmlXPtrEvalChildSeq ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangeInternal
_TEXT SEGMENT
_start$ = 8 ; size = 4
_startindex$ = 12 ; size = 4
_end$ = 16 ; size = 4
_endindex$ = 20 ; size = 4
_xmlXPtrNewRangeInternal PROC ; COMDAT
; 344 : xmlNodePtr end, int endindex) {
push ebp
mov ebp, esp
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _start$[ebp]
test esi, esi
je SHORT $LN2@xmlXPtrNew
; 345 : xmlXPathObjectPtr ret;
; 346 :
; 347 : /*
; 348 : * Namespace nodes must be copied (see xmlXPathNodeSetDupNs).
; 349 : * Disallow them for now.
; 350 : */
; 351 : if ((start != NULL) && (start->type == XML_NAMESPACE_DECL))
cmp DWORD PTR [esi+4], 18 ; 00000012H
je SHORT $LN8@xmlXPtrNew
$LN2@xmlXPtrNew:
; 352 : return(NULL);
; 353 : if ((end != NULL) && (end->type == XML_NAMESPACE_DECL))
mov edi, DWORD PTR _end$[ebp]
test edi, edi
je SHORT $LN3@xmlXPtrNew
cmp DWORD PTR [edi+4], 18 ; 00000012H
je SHORT $LN8@xmlXPtrNew
$LN3@xmlXPtrNew:
; 354 : return(NULL);
; 355 :
; 356 : ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
push 48 ; 00000030H
call DWORD PTR _xmlMalloc
add esp, 4
; 357 : if (ret == NULL) {
test eax, eax
jne SHORT $LN4@xmlXPtrNew
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BB@PBEHJOM@allocating?5range@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BB@PBEHJOM@allocating?5range@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
$LN8@xmlXPtrNew:
pop edi
; 367 : return(ret);
; 368 : }
xor eax, eax
pop esi
pop ebp
ret 0
$LN4@xmlXPtrNew:
; 358 : xmlXPtrErrMemory("allocating range");
; 359 : return(NULL);
; 360 : }
; 361 : memset(ret, 0, sizeof(xmlXPathObject));
; 362 : ret->type = XPATH_RANGE;
; 363 : ret->user = start;
; 364 : ret->index = startindex;
mov ecx, DWORD PTR _startindex$[ebp]
mov DWORD PTR [eax+4], 0
mov DWORD PTR [eax+8], 0
mov DWORD PTR [eax+12], 0
mov DWORD PTR [eax+16], 0
mov DWORD PTR [eax+20], 0
mov DWORD PTR [eax+24], 0
mov DWORD PTR [eax+44], 0
; 365 : ret->user2 = end;
mov DWORD PTR [eax+36], edi
mov DWORD PTR [eax+32], ecx
; 366 : ret->index2 = endindex;
mov ecx, DWORD PTR _endindex$[ebp]
pop edi
mov DWORD PTR [eax+28], esi
mov DWORD PTR [eax], 6
mov DWORD PTR [eax+40], ecx
; 367 : return(ret);
; 368 : }
pop esi
pop ebp
ret 0
_xmlXPtrNewRangeInternal ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrRangesEqual
_TEXT SEGMENT
_range1$ = 8 ; size = 4
_range2$ = 12 ; size = 4
_xmlXPtrRangesEqual PROC ; COMDAT
; 311 : xmlXPtrRangesEqual(xmlXPathObjectPtr range1, xmlXPathObjectPtr range2) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _range1$[ebp]
mov edx, DWORD PTR _range2$[ebp]
cmp ecx, edx
jne SHORT $LN2@xmlXPtrRan
$LN12@xmlXPtrRan:
; 327 : return(0);
; 328 : return(1);
; 329 : }
mov eax, 1
pop ebp
ret 0
$LN2@xmlXPtrRan:
; 312 : if (range1 == range2)
; 313 : return(1);
; 314 : if ((range1 == NULL) || (range2 == NULL))
test ecx, ecx
je SHORT $LN4@xmlXPtrRan
test edx, edx
je SHORT $LN4@xmlXPtrRan
; 316 : if (range1->type != range2->type)
mov eax, DWORD PTR [ecx]
cmp eax, DWORD PTR [edx]
jne SHORT $LN4@xmlXPtrRan
; 317 : return(0);
; 318 : if (range1->type != XPATH_RANGE)
cmp eax, 6
jne SHORT $LN4@xmlXPtrRan
; 319 : return(0);
; 320 : if (range1->user != range2->user)
mov eax, DWORD PTR [ecx+28]
cmp eax, DWORD PTR [edx+28]
jne SHORT $LN4@xmlXPtrRan
; 321 : return(0);
; 322 : if (range1->index != range2->index)
mov eax, DWORD PTR [ecx+32]
cmp eax, DWORD PTR [edx+32]
jne SHORT $LN4@xmlXPtrRan
; 323 : return(0);
; 324 : if (range1->user2 != range2->user2)
mov eax, DWORD PTR [ecx+36]
cmp eax, DWORD PTR [edx+36]
jne SHORT $LN4@xmlXPtrRan
; 325 : return(0);
; 326 : if (range1->index2 != range2->index2)
mov eax, DWORD PTR [ecx+40]
cmp eax, DWORD PTR [edx+40]
je SHORT $LN12@xmlXPtrRan
$LN4@xmlXPtrRan:
; 315 : return(0);
xor eax, eax
; 327 : return(0);
; 328 : return(1);
; 329 : }
pop ebp
ret 0
_xmlXPtrRangesEqual ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrRangeCheckOrder
_TEXT SEGMENT
_range$ = 8 ; size = 4
_xmlXPtrRangeCheckOrder PROC ; COMDAT
; 280 : xmlXPtrRangeCheckOrder(xmlXPathObjectPtr range) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _range$[ebp]
test esi, esi
je SHORT $LN5@xmlXPtrRan
; 281 : int tmp;
; 282 : xmlNodePtr tmp2;
; 283 : if (range == NULL)
; 284 : return;
; 285 : if (range->type != XPATH_RANGE)
cmp DWORD PTR [esi], 6
jne SHORT $LN5@xmlXPtrRan
; 286 : return;
; 287 : if (range->user2 == NULL)
mov eax, DWORD PTR [esi+36]
test eax, eax
je SHORT $LN5@xmlXPtrRan
; 288 : return;
; 289 : tmp = xmlXPtrCmpPoints(range->user, range->index,
mov ecx, DWORD PTR [esi+28]
mov edx, DWORD PTR [esi+40]
; 228 : if ((node1 == NULL) || (node2 == NULL))
test ecx, ecx
je SHORT $LN5@xmlXPtrRan
; 229 : return(-2);
; 230 : /*
; 231 : * a couple of optimizations which will avoid computations in most cases
; 232 : */
; 233 : if (node1 == node2) {
cmp ecx, eax
jne SHORT $LN10@xmlXPtrRan
; 234 : if (index1 < index2)
cmp DWORD PTR [esi+32], edx
; 235 : return(1);
; 236 : if (index1 > index2)
jle SHORT $LN5@xmlXPtrRan
; 237 : return(-1);
jmp SHORT $LN14@xmlXPtrRan
$LN10@xmlXPtrRan:
; 238 : return(0);
; 239 : }
; 240 : return(xmlXPathCmpNodes(node1, node2));
push eax
push ecx
call _xmlXPathCmpNodes
add esp, 8
; 290 : range->user2, range->index2);
; 291 : if (tmp == -1) {
cmp eax, -1
jne SHORT $LN5@xmlXPtrRan
$LN14@xmlXPtrRan:
; 292 : tmp2 = range->user;
mov ecx, DWORD PTR [esi+28]
; 293 : range->user = range->user2;
mov eax, DWORD PTR [esi+36]
mov DWORD PTR [esi+28], eax
; 294 : range->user2 = tmp2;
; 295 : tmp = range->index;
; 296 : range->index = range->index2;
mov eax, DWORD PTR [esi+40]
mov DWORD PTR [esi+36], ecx
mov ecx, DWORD PTR [esi+32]
mov DWORD PTR [esi+32], eax
; 297 : range->index2 = tmp;
mov DWORD PTR [esi+40], ecx
$LN5@xmlXPtrRan:
pop esi
; 298 : }
; 299 : }
pop ebp
ret 0
_xmlXPtrRangeCheckOrder ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewPoint
_TEXT SEGMENT
_node$ = 8 ; size = 4
_indx$ = 12 ; size = 4
_xmlXPtrNewPoint PROC ; COMDAT
; 253 : xmlXPtrNewPoint(xmlNodePtr node, int indx) {
push ebp
mov ebp, esp
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _node$[ebp]
test edi, edi
je SHORT $LN6@xmlXPtrNew
; 254 : xmlXPathObjectPtr ret;
; 255 :
; 256 : if (node == NULL)
; 257 : return(NULL);
; 258 : if (indx < 0)
mov esi, DWORD PTR _indx$[ebp]
test esi, esi
js SHORT $LN6@xmlXPtrNew
; 259 : return(NULL);
; 260 :
; 261 : ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
push 48 ; 00000030H
call DWORD PTR _xmlMalloc
add esp, 4
; 262 : if (ret == NULL) {
test eax, eax
jne SHORT $LN4@xmlXPtrNew
; 263 : xmlXPtrErrMemory("allocating point");
push OFFSET ??_C@_0BB@DMDDEGKA@allocating?5point@
call _xmlXPtrErrMemory
add esp, 4
$LN6@xmlXPtrNew:
; 270 : return(ret);
; 271 : }
pop edi
xor eax, eax
pop esi
pop ebp
ret 0
$LN4@xmlXPtrNew:
; 264 : return(NULL);
; 265 : }
; 266 : memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
mov DWORD PTR [eax+4], 0
mov DWORD PTR [eax+8], 0
mov DWORD PTR [eax+12], 0
mov DWORD PTR [eax+16], 0
mov DWORD PTR [eax+20], 0
mov DWORD PTR [eax+24], 0
mov DWORD PTR [eax+36], 0
mov DWORD PTR [eax+40], 0
mov DWORD PTR [eax+44], 0
; 267 : ret->type = XPATH_POINT;
; 268 : ret->user = (void *) node;
mov DWORD PTR [eax+28], edi
pop edi
; 269 : ret->index = indx;
mov DWORD PTR [eax+32], esi
mov DWORD PTR [eax], 5
; 270 : return(ret);
; 271 : }
pop esi
pop ebp
ret 0
_xmlXPtrNewPoint ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrCmpPoints
_TEXT SEGMENT
_node1$ = 8 ; size = 4
_index1$ = 12 ; size = 4
_node2$ = 16 ; size = 4
_index2$ = 20 ; size = 4
_xmlXPtrCmpPoints PROC ; COMDAT
; 227 : xmlXPtrCmpPoints(xmlNodePtr node1, int index1, xmlNodePtr node2, int index2) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _node1$[ebp]
test ecx, ecx
je SHORT $LN3@xmlXPtrCmp
; 228 : if ((node1 == NULL) || (node2 == NULL))
mov eax, DWORD PTR _node2$[ebp]
test eax, eax
je SHORT $LN3@xmlXPtrCmp
; 230 : /*
; 231 : * a couple of optimizations which will avoid computations in most cases
; 232 : */
; 233 : if (node1 == node2) {
cmp ecx, eax
jne SHORT $LN4@xmlXPtrCmp
; 234 : if (index1 < index2)
mov ecx, DWORD PTR _index1$[ebp]
mov edx, DWORD PTR _index2$[ebp]
cmp ecx, edx
jge SHORT $LN5@xmlXPtrCmp
; 235 : return(1);
mov eax, 1
; 241 : }
pop ebp
ret 0
$LN5@xmlXPtrCmp:
; 236 : if (index1 > index2)
xor eax, eax
cmp ecx, edx
setle al
dec eax
; 241 : }
pop ebp
ret 0
$LN4@xmlXPtrCmp:
; 237 : return(-1);
; 238 : return(0);
; 239 : }
; 240 : return(xmlXPathCmpNodes(node1, node2));
push eax
push ecx
call _xmlXPathCmpNodes
add esp, 8
; 241 : }
pop ebp
ret 0
$LN3@xmlXPtrCmp:
; 229 : return(-2);
mov eax, -2 ; fffffffeH
; 241 : }
pop ebp
ret 0
_xmlXPtrCmpPoints ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetNthChild
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_no$ = 12 ; size = 4
_xmlXPtrGetNthChild PROC ; COMDAT
; 189 : xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _cur$[ebp]
test eax, eax
je SHORT $LN1@xmlXPtrGet
; 190 : int i;
; 191 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
cmp DWORD PTR [eax+4], 18 ; 00000012H
je SHORT $LN1@xmlXPtrGet
; 192 : return(cur);
; 193 : cur = cur->children;
mov eax, DWORD PTR [eax+12]
; 194 : for (i = 0;i <= no;cur = cur->next) {
xor ecx, ecx
push esi
mov esi, DWORD PTR _no$[ebp]
test esi, esi
js SHORT $LN18@xmlXPtrGet
$LL4@xmlXPtrGet:
; 195 : if (cur == NULL)
test eax, eax
je SHORT $LN13@xmlXPtrGet
; 197 : if ((cur->type == XML_ELEMENT_NODE) ||
; 198 : (cur->type == XML_DOCUMENT_NODE) ||
mov edx, DWORD PTR [eax+4]
cmp edx, 1
je SHORT $LN9@xmlXPtrGet
cmp edx, 9
je SHORT $LN9@xmlXPtrGet
cmp edx, 13 ; 0000000dH
jne SHORT $LN2@xmlXPtrGet
$LN9@xmlXPtrGet:
; 199 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 200 : i++;
inc ecx
; 201 : if (i == no)
cmp ecx, esi
je SHORT $LN18@xmlXPtrGet
$LN2@xmlXPtrGet:
; 194 : for (i = 0;i <= no;cur = cur->next) {
mov eax, DWORD PTR [eax+24]
cmp ecx, esi
jle SHORT $LL4@xmlXPtrGet
pop esi
; 202 : break;
; 203 : }
; 204 : }
; 205 : return(cur);
; 206 : }
pop ebp
ret 0
$LN13@xmlXPtrGet:
; 196 : return(cur);
xor eax, eax
$LN18@xmlXPtrGet:
pop esi
$LN1@xmlXPtrGet:
; 202 : break;
; 203 : }
; 204 : }
; 205 : return(cur);
; 206 : }
pop ebp
ret 0
_xmlXPtrGetNthChild ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetIndex
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_xmlXPtrGetIndex PROC ; COMDAT
; 167 : xmlXPtrGetIndex(xmlNodePtr cur) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _cur$[ebp]
test ecx, ecx
je SHORT $LN6@xmlXPtrGet
; 168 : int i;
; 169 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
cmp DWORD PTR [ecx+4], 18 ; 00000012H
je SHORT $LN6@xmlXPtrGet
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov edx, 1
npad 1
$LL4@xmlXPtrGet:
; 172 : if ((cur->type == XML_ELEMENT_NODE) ||
; 173 : (cur->type == XML_DOCUMENT_NODE) ||
mov eax, DWORD PTR [ecx+4]
cmp eax, 1
je SHORT $LN8@xmlXPtrGet
cmp eax, 9
je SHORT $LN8@xmlXPtrGet
cmp eax, 13 ; 0000000dH
jne SHORT $LN2@xmlXPtrGet
$LN8@xmlXPtrGet:
; 174 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 175 : i++;
inc edx
$LN2@xmlXPtrGet:
; 171 : for (i = 1;cur != NULL;cur = cur->prev) {
mov ecx, DWORD PTR [ecx+28]
test ecx, ecx
jne SHORT $LL4@xmlXPtrGet
; 176 : }
; 177 : }
; 178 : return(i);
mov eax, edx
; 179 : }
pop ebp
ret 0
$LN6@xmlXPtrGet:
; 170 : return(-1);
or eax, -1
; 179 : }
pop ebp
ret 0
_xmlXPtrGetIndex ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrGetArity
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_xmlXPtrGetArity PROC ; COMDAT
; 144 : xmlXPtrGetArity(xmlNodePtr cur) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _cur$[ebp]
test ecx, ecx
je SHORT $LN6@xmlXPtrGet
; 145 : int i;
; 146 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
cmp DWORD PTR [ecx+4], 18 ; 00000012H
je SHORT $LN6@xmlXPtrGet
; 148 : cur = cur->children;
mov ecx, DWORD PTR [ecx+12]
; 149 : for (i = 0;cur != NULL;cur = cur->next) {
xor edx, edx
test ecx, ecx
je SHORT $LN3@xmlXPtrGet
$LL4@xmlXPtrGet:
; 150 : if ((cur->type == XML_ELEMENT_NODE) ||
; 151 : (cur->type == XML_DOCUMENT_NODE) ||
mov eax, DWORD PTR [ecx+4]
cmp eax, 1
je SHORT $LN8@xmlXPtrGet
cmp eax, 9
je SHORT $LN8@xmlXPtrGet
cmp eax, 13 ; 0000000dH
jne SHORT $LN2@xmlXPtrGet
$LN8@xmlXPtrGet:
; 152 : (cur->type == XML_HTML_DOCUMENT_NODE)) {
; 153 : i++;
inc edx
$LN2@xmlXPtrGet:
; 149 : for (i = 0;cur != NULL;cur = cur->next) {
mov ecx, DWORD PTR [ecx+24]
test ecx, ecx
jne SHORT $LL4@xmlXPtrGet
$LN3@xmlXPtrGet:
; 154 : }
; 155 : }
; 156 : return(i);
mov eax, edx
; 157 : }
pop ebp
ret 0
$LN6@xmlXPtrGet:
; 147 : return(-1);
or eax, -1
; 157 : }
pop ebp
ret 0
_xmlXPtrGetArity ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrAdvanceNode
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_level$ = 12 ; size = 4
_xmlXPtrAdvanceNode PROC ; COMDAT
; 2242 : xmlXPtrAdvanceNode(xmlNodePtr cur, int *level) {
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ebx, DWORD PTR _level$[ebp]
mov esi, DWORD PTR _cur$[ebp]
$next$38:
; 2243 : next:
; 2244 : if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
test esi, esi
je SHORT $LN6@xmlXPtrAdv
cmp DWORD PTR [esi+4], 18 ; 00000012H
je SHORT $LN6@xmlXPtrAdv
; 2245 : return(NULL);
; 2246 : if (cur->children != NULL) {
mov eax, DWORD PTR [esi+12]
test eax, eax
je SHORT $skip$39
; 2247 : cur = cur->children ;
mov esi, eax
; 2248 : if (level != NULL)
test ebx, ebx
je SHORT $found$40
; 2249 : (*level)++;
inc DWORD PTR [ebx]
; 2250 : goto found;
jmp SHORT $found$40
$LL4@xmlXPtrAdv:
; 2251 : }
; 2252 : skip: /* This label should only be needed if something is wrong! */
; 2253 : if (cur->next != NULL) {
; 2254 : cur = cur->next;
; 2255 : goto found;
; 2256 : }
; 2257 : do {
; 2258 : cur = cur->parent;
mov esi, DWORD PTR [esi+20]
; 2259 : if (level != NULL)
test ebx, ebx
je SHORT $LN10@xmlXPtrAdv
; 2260 : (*level)--;
dec DWORD PTR [ebx]
$LN10@xmlXPtrAdv:
; 2261 : if (cur == NULL) return(NULL);
test esi, esi
je SHORT $LN6@xmlXPtrAdv
$skip$39:
; 2262 : if (cur->next != NULL) {
; 2263 : cur = cur->next;
; 2264 : goto found;
; 2265 : }
; 2266 : } while (cur != NULL);
; 2267 :
; 2268 : found:
; 2269 : if ((cur->type != XML_ELEMENT_NODE) &&
; 2270 : (cur->type != XML_TEXT_NODE) &&
; 2271 : (cur->type != XML_DOCUMENT_NODE) &&
; 2272 : (cur->type != XML_HTML_DOCUMENT_NODE) &&
mov eax, DWORD PTR [esi+24]
test eax, eax
je SHORT $LL4@xmlXPtrAdv
mov esi, eax
$found$40:
mov eax, DWORD PTR [esi+4]
cmp eax, 1
je SHORT $LN13@xmlXPtrAdv
cmp eax, 3
je SHORT $LN13@xmlXPtrAdv
cmp eax, 9
je SHORT $LN13@xmlXPtrAdv
cmp eax, 13 ; 0000000dH
je SHORT $LN13@xmlXPtrAdv
cmp eax, 4
je SHORT $LN13@xmlXPtrAdv
; 2273 : (cur->type != XML_CDATA_SECTION_NODE)) {
; 2274 : if (cur->type == XML_ENTITY_REF_NODE) { /* Shouldn't happen */
cmp eax, 5
jne SHORT $next$38
; 2275 : TODO
call ___xmlGenericError
mov edi, eax
call ___xmlGenericErrorContext
push 2275 ; 000008e3H
push OFFSET ??_C@_0GK@GBFDPHAH@c?3?2users?2dag?2documents?2_clients@
push OFFSET ??_C@_0BO@MDEMDPPE@Unimplemented?5block?5at?5?$CFs?3?$CFd?6@
push DWORD PTR [eax]
mov eax, DWORD PTR [edi]
call eax
add esp, 16 ; 00000010H
; 2276 : goto skip;
jmp SHORT $skip$39
$LN13@xmlXPtrAdv:
pop edi
; 2277 : }
; 2278 : goto next;
; 2279 : }
; 2280 : return(cur);
mov eax, esi
; 2281 : }
pop esi
pop ebx
pop ebp
ret 0
$LN6@xmlXPtrAdv:
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret 0
_xmlXPtrAdvanceNode ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrErr
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_error$ = 12 ; size = 4
_msg$ = 16 ; size = 4
_extra$ = 20 ; size = 4
_xmlXPtrErr PROC ; COMDAT
; 96 : {
push ebp
mov ebp, esp
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
mov edi, DWORD PTR _error$[ebp]
test esi, esi
je $LN4@xmlXPtrErr
; 97 : if (ctxt != NULL)
; 98 : ctxt->error = error;
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [esi+8], edi
; 99 : if ((ctxt == NULL) || (ctxt->context == NULL)) {
test eax, eax
je $LN4@xmlXPtrErr
; 101 : NULL, NULL, XML_FROM_XPOINTER, error,
; 102 : XML_ERR_ERROR, NULL, 0,
; 103 : (const char *) extra, NULL, NULL, 0, 0,
; 104 : msg, extra);
; 105 : return;
; 106 : }
; 107 :
; 108 : /* cleanup current last error */
; 109 : xmlResetError(&ctxt->context->lastError);
add eax, 136 ; 00000088H
push ebx
push eax
call _xmlResetError
; 110 :
; 111 : ctxt->context->lastError.domain = XML_FROM_XPOINTER;
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+136], 13 ; 0000000dH
; 112 : ctxt->context->lastError.code = error;
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+140], edi
; 113 : ctxt->context->lastError.level = XML_ERR_ERROR;
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+148], 2
; 114 : ctxt->context->lastError.str1 = (char *) xmlStrdup(ctxt->base);
push DWORD PTR [esi+4]
call _xmlStrdup
mov ecx, DWORD PTR [esi+12]
add esp, 8
mov DWORD PTR [ecx+160], eax
; 115 : ctxt->context->lastError.int1 = ctxt->cur - ctxt->base;
mov eax, DWORD PTR [esi+12]
mov ecx, DWORD PTR [esi]
sub ecx, DWORD PTR [esi+4]
mov DWORD PTR [eax+172], ecx
; 116 : ctxt->context->lastError.node = ctxt->context->debugNode;
mov ecx, DWORD PTR [esi+12]
mov eax, DWORD PTR [ecx+188]
mov DWORD PTR [ecx+184], eax
; 117 : if (ctxt->context->error != NULL) {
mov ebx, DWORD PTR [esi+12]
mov ecx, DWORD PTR [ebx+132]
test ecx, ecx
je SHORT $LN5@xmlXPtrErr
; 118 : ctxt->context->error(ctxt->context->userData,
lea eax, DWORD PTR [ebx+136]
push eax
push DWORD PTR [ebx+128]
call ecx
add esp, 8
pop ebx
pop edi
; 122 : NULL, ctxt->context->debugNode, XML_FROM_XPOINTER,
; 123 : error, XML_ERR_ERROR, NULL, 0,
; 124 : (const char *) extra, (const char *) ctxt->base, NULL,
; 125 : ctxt->cur - ctxt->base, 0,
; 126 : msg, extra);
; 127 : }
; 128 : }
pop esi
pop ebp
ret 0
$LN5@xmlXPtrErr:
; 119 : &ctxt->context->lastError);
; 120 : } else {
; 121 : __xmlRaiseError(NULL, NULL, NULL,
mov edx, DWORD PTR _extra$[ebp]
mov ecx, DWORD PTR [esi+4]
mov eax, DWORD PTR [esi]
push edx
push DWORD PTR _msg$[ebp]
sub eax, ecx
push 0
push eax
push 0
push ecx
push edx
push 0
push 0
push 2
push edi
push 13 ; 0000000dH
push DWORD PTR [ebx+188]
push 0
push 0
push 0
push 0
call ___xmlRaiseError
add esp, 68 ; 00000044H
pop ebx
pop edi
; 122 : NULL, ctxt->context->debugNode, XML_FROM_XPOINTER,
; 123 : error, XML_ERR_ERROR, NULL, 0,
; 124 : (const char *) extra, (const char *) ctxt->base, NULL,
; 125 : ctxt->cur - ctxt->base, 0,
; 126 : msg, extra);
; 127 : }
; 128 : }
pop esi
pop ebp
ret 0
$LN4@xmlXPtrErr:
; 100 : __xmlRaiseError(NULL, NULL, NULL,
mov eax, DWORD PTR _extra$[ebp]
push eax
push DWORD PTR _msg$[ebp]
push 0
push 0
push 0
push 0
push eax
push 0
push 0
push 2
push edi
push 13 ; 0000000dH
push 0
push 0
push 0
push 0
push 0
call ___xmlRaiseError
add esp, 68 ; 00000044H
pop edi
; 122 : NULL, ctxt->context->debugNode, XML_FROM_XPOINTER,
; 123 : error, XML_ERR_ERROR, NULL, 0,
; 124 : (const char *) extra, (const char *) ctxt->base, NULL,
; 125 : ctxt->cur - ctxt->base, 0,
; 126 : msg, extra);
; 127 : }
; 128 : }
pop esi
pop ebp
ret 0
_xmlXPtrErr ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrErrMemory
_TEXT SEGMENT
_extra$ = 8 ; size = 4
_xmlXPtrErrMemory PROC ; COMDAT
; 79 : {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _extra$[ebp]
push eax
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push 0
push 0
push 0
push 0
push eax
push 0
push 0
push 2
push 2
push 13 ; 0000000dH
push 0
push 0
push 0
push 0
push 0
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
; 81 : XML_ERR_NO_MEMORY, XML_ERR_ERROR, NULL, 0, extra,
; 82 : NULL, NULL, 0, 0,
; 83 : "Memory allocation failed : %s\n", extra);
; 84 : }
pop ebp
ret 0
_xmlXPtrErrMemory ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEvalRangePredicate
_TEXT SEGMENT
_obj$1$ = -20 ; size = 4
_i$1$ = -16 ; size = 4
_tmp$1$ = -12 ; size = 4
tv769 = -8 ; size = 4
_cur$1$ = -4 ; size = 4
_newset$1$ = 8 ; size = 4
_ctxt$ = 8 ; size = 4
_xmlXPtrEvalRangePredicate PROC ; COMDAT
; 2841 : xmlXPtrEvalRangePredicate(xmlXPathParserContextPtr ctxt) {
push ebp
mov ebp, esp
sub esp, 20 ; 00000014H
mov ecx, OFFSET __BEF3E6F7_xpointer@c
push esi
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _ctxt$[ebp]
test esi, esi
je $LN10@xmlXPtrEva
mov eax, DWORD PTR [esi]
npad 2
$LL2@xmlXPtrEva:
; 2842 : const xmlChar *cur;
; 2843 : xmlXPathObjectPtr res;
; 2844 : xmlXPathObjectPtr obj, tmp;
; 2845 : xmlLocationSetPtr newset = NULL;
; 2846 : xmlLocationSetPtr oldset;
; 2847 : int i;
; 2848 :
; 2849 : if (ctxt == NULL) return;
; 2850 :
; 2851 : SKIP_BLANKS;
mov cl, BYTE PTR [eax]
cmp cl, 32 ; 00000020H
je SHORT $LN12@xmlXPtrEva
cmp cl, 9
jb SHORT $LN13@xmlXPtrEva
cmp cl, 10 ; 0000000aH
jbe SHORT $LN12@xmlXPtrEva
$LN13@xmlXPtrEva:
cmp cl, 13 ; 0000000dH
jne SHORT $LN3@xmlXPtrEva
$LN12@xmlXPtrEva:
test cl, cl
je SHORT $LL2@xmlXPtrEva
inc eax
mov DWORD PTR [esi], eax
jmp SHORT $LL2@xmlXPtrEva
$LN3@xmlXPtrEva:
push ebx
push edi
; 2852 : if (CUR != '[') {
cmp cl, 91 ; 0000005bH
jne $LN67@xmlXPtrEva
$LN70@xmlXPtrEva:
; 2853 : XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
; 2854 : }
; 2855 : NEXT;
; 2856 : SKIP_BLANKS;
inc eax
mov DWORD PTR [esi], eax
npad 3
$LL4@xmlXPtrEva:
mov cl, BYTE PTR [eax]
cmp cl, 32 ; 00000020H
je SHORT $LN15@xmlXPtrEva
cmp cl, 9
jb SHORT $LN16@xmlXPtrEva
cmp cl, 10 ; 0000000aH
jbe SHORT $LN15@xmlXPtrEva
$LN16@xmlXPtrEva:
cmp cl, 13 ; 0000000dH
jne SHORT $LN5@xmlXPtrEva
$LN15@xmlXPtrEva:
test cl, cl
je SHORT $LL4@xmlXPtrEva
jmp SHORT $LN70@xmlXPtrEva
$LN5@xmlXPtrEva:
; 2857 :
; 2858 : /*
; 2859 : * Extract the old set, and then evaluate the result of the
; 2860 : * expression for all the element in the set. use it to grow
; 2861 : * up a new set.
; 2862 : */
; 2863 : CHECK_TYPE(XPATH_LOCATIONSET);
mov eax, DWORD PTR [esi+16]
test eax, eax
je $LN18@xmlXPtrEva
cmp DWORD PTR [eax], 7
jne $LN18@xmlXPtrEva
; 2864 : obj = valuePop(ctxt);
push esi
call _valuePop
; 2865 : oldset = obj->user;
; 2866 : ctxt->context->node = NULL;
mov ecx, DWORD PTR [esi+12]
mov edi, eax
add esp, 4
mov DWORD PTR _obj$1$[ebp], edi
mov ebx, DWORD PTR [edi+28]
mov DWORD PTR [ecx+4], 0
; 2867 :
; 2868 : if ((oldset == NULL) || (oldset->locNr == 0)) {
test ebx, ebx
je $LN21@xmlXPtrEva
cmp DWORD PTR [ebx], 0
je $LN21@xmlXPtrEva
; 2877 : } else {
; 2878 : /*
; 2879 : * Save the expression pointer since we will have to evaluate
; 2880 : * it multiple times. Initialize the new set.
; 2881 : */
; 2882 : cur = ctxt->cur;
mov eax, DWORD PTR [esi]
; 2883 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
mov DWORD PTR _cur$1$[ebp], eax
call _xmlXPtrLocationSetCreate
; 2884 :
; 2885 : for (i = 0; i < oldset->locNr; i++) {
xor edi, edi
mov DWORD PTR _newset$1$[ebp], eax
add esp, 4
cmp DWORD PTR [ebx], edi
jle $LN7@xmlXPtrEva
npad 8
$LL8@xmlXPtrEva:
; 2886 : ctxt->cur = cur;
mov eax, DWORD PTR _cur$1$[ebp]
; 2887 :
; 2888 : /*
; 2889 : * Run the evaluation with a node list made of a single item
; 2890 : * in the nodeset.
; 2891 : */
; 2892 : ctxt->context->node = oldset->locTab[i]->user;
lea ecx, DWORD PTR [edi*4]
mov DWORD PTR [esi], eax
mov eax, DWORD PTR [ebx+8]
mov DWORD PTR tv769[ebp], ecx
mov eax, DWORD PTR [ecx+eax]
mov ecx, DWORD PTR [esi+12]
mov eax, DWORD PTR [eax+28]
mov DWORD PTR [ecx+4], eax
; 2893 : tmp = xmlXPathNewNodeSet(ctxt->context->node);
mov eax, DWORD PTR [esi+12]
push DWORD PTR [eax+4]
call _xmlXPathNewNodeSet
; 2894 : valuePush(ctxt, tmp);
push eax
push esi
mov DWORD PTR _tmp$1$[ebp], eax
call _valuePush
; 2895 : ctxt->context->contextSize = oldset->locNr;
mov edx, DWORD PTR [esi+12]
; 2896 : ctxt->context->proximityPosition = i + 1;
inc edi
mov ecx, DWORD PTR [ebx]
; 2897 :
; 2898 : xmlXPathEvalExpr(ctxt);
push esi
mov DWORD PTR _i$1$[ebp], edi
mov DWORD PTR [edx+68], ecx
mov ecx, DWORD PTR [esi+12]
mov DWORD PTR [ecx+72], edi
call _xmlXPathEvalExpr
add esp, 16 ; 00000010H
; 2899 : CHECK_ERROR;
cmp DWORD PTR [esi+8], 0
jne $LN68@xmlXPtrEva
; 2900 :
; 2901 : /*
; 2902 : * The result of the evaluation need to be tested to
; 2903 : * decided whether the filter succeeded or not
; 2904 : */
; 2905 : res = valuePop(ctxt);
push esi
call _valuePop
mov edi, eax
; 2906 : if (xmlXPathEvaluatePredicateResult(ctxt, res)) {
push edi
push esi
call _xmlXPathEvaluatePredicateResult
add esp, 12 ; 0000000cH
test eax, eax
je SHORT $LN25@xmlXPtrEva
; 2907 : xmlXPtrLocationSetAdd(newset,
mov ecx, DWORD PTR [ebx+8]
mov eax, DWORD PTR tv769[ebp]
push DWORD PTR [eax+ecx]
call _xmlXPathObjectCopy
push eax
push DWORD PTR _newset$1$[ebp]
call _xmlXPtrLocationSetAdd
add esp, 12 ; 0000000cH
$LN25@xmlXPtrEva:
; 2908 : xmlXPathObjectCopy(oldset->locTab[i]));
; 2909 : }
; 2910 :
; 2911 : /*
; 2912 : * Cleanup
; 2913 : */
; 2914 : if (res != NULL)
test edi, edi
je SHORT $LN26@xmlXPtrEva
; 2915 : xmlXPathFreeObject(res);
push edi
call _xmlXPathFreeObject
add esp, 4
$LN26@xmlXPtrEva:
; 2916 : if (ctxt->value == tmp) {
mov eax, DWORD PTR _tmp$1$[ebp]
cmp DWORD PTR [esi+16], eax
jne SHORT $LN27@xmlXPtrEva
; 2917 : res = valuePop(ctxt);
push esi
call _valuePop
; 2918 : xmlXPathFreeObject(res);
push eax
call _xmlXPathFreeObject
add esp, 8
$LN27@xmlXPtrEva:
; 2919 : }
; 2920 :
; 2921 : ctxt->context->node = NULL;
mov eax, DWORD PTR [esi+12]
mov edi, DWORD PTR _i$1$[ebp]
mov DWORD PTR [eax+4], 0
cmp edi, DWORD PTR [ebx]
jl $LL8@xmlXPtrEva
$LN7@xmlXPtrEva:
; 2922 : }
; 2923 :
; 2924 : /*
; 2925 : * The result is used as the new evaluation set.
; 2926 : */
; 2927 : xmlXPathFreeObject(obj);
push DWORD PTR _obj$1$[ebp]
call _xmlXPathFreeObject
; 2928 : ctxt->context->node = NULL;
mov eax, DWORD PTR [esi+12]
; 2929 : ctxt->context->contextSize = -1;
; 2930 : ctxt->context->proximityPosition = -1;
; 2931 : valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
push DWORD PTR _newset$1$[ebp]
mov DWORD PTR [eax+4], 0
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+68], -1
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+72], -1
call _xmlXPtrWrapLocationSet
push eax
push esi
call _valuePush
add esp, 16 ; 00000010H
jmp SHORT $LN23@xmlXPtrEva
$LN21@xmlXPtrEva:
; 2869 : ctxt->context->contextSize = 0;
mov eax, DWORD PTR [esi+12]
; 2870 : ctxt->context->proximityPosition = 0;
; 2871 : xmlXPathEvalExpr(ctxt);
push esi
mov DWORD PTR [eax+68], 0
mov eax, DWORD PTR [esi+12]
mov DWORD PTR [eax+72], 0
call _xmlXPathEvalExpr
; 2872 : res = valuePop(ctxt);
push esi
call _valuePop
add esp, 8
; 2873 : if (res != NULL)
test eax, eax
je SHORT $LN22@xmlXPtrEva
; 2874 : xmlXPathFreeObject(res);
push eax
call _xmlXPathFreeObject
add esp, 4
$LN22@xmlXPtrEva:
; 2875 : valuePush(ctxt, obj);
push edi
push esi
call _valuePush
add esp, 8
; 2876 : CHECK_ERROR;
cmp DWORD PTR [esi+8], 0
jne SHORT $LN68@xmlXPtrEva
$LN23@xmlXPtrEva:
; 2932 : }
; 2933 : if (CUR != ']') {
mov eax, DWORD PTR [esi]
cmp BYTE PTR [eax], 93 ; 0000005dH
jne SHORT $LN67@xmlXPtrEva
$LN71@xmlXPtrEva:
; 2935 : }
; 2936 :
; 2937 : NEXT;
; 2938 : SKIP_BLANKS;
inc eax
mov DWORD PTR [esi], eax
$LL9@xmlXPtrEva:
mov cl, BYTE PTR [eax]
cmp cl, 32 ; 00000020H
je SHORT $LN29@xmlXPtrEva
cmp cl, 9
jb SHORT $LN30@xmlXPtrEva
cmp cl, 10 ; 0000000aH
jbe SHORT $LN29@xmlXPtrEva
$LN30@xmlXPtrEva:
cmp cl, 13 ; 0000000dH
jne SHORT $LN68@xmlXPtrEva
$LN29@xmlXPtrEva:
test cl, cl
je SHORT $LL9@xmlXPtrEva
jmp SHORT $LN71@xmlXPtrEva
$LN18@xmlXPtrEva:
; 2857 :
; 2858 : /*
; 2859 : * Extract the old set, and then evaluate the result of the
; 2860 : * expression for all the element in the set. use it to grow
; 2861 : * up a new set.
; 2862 : */
; 2863 : CHECK_TYPE(XPATH_LOCATIONSET);
push 11 ; 0000000bH
; 2934 : XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
push esi
call _xmlXPathErr
add esp, 8
pop edi
pop ebx
pop esi
; 2939 : }
mov esp, ebp
pop ebp
ret 0
$LN67@xmlXPtrEva:
; 2934 : XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
push 6
push esi
call _xmlXPathErr
add esp, 8
$LN68@xmlXPtrEva:
pop edi
pop ebx
$LN10@xmlXPtrEva:
pop esi
; 2939 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrEvalRangePredicate ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrBuildNodeList
_TEXT SEGMENT
_list$1$ = -4 ; size = 4
_obj$ = 8 ; size = 4
_xmlXPtrBuildNodeList PROC ; COMDAT
; 1582 : xmlXPtrBuildNodeList(xmlXPathObjectPtr obj) {
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _obj$[ebp]
xor edx, edx
xor esi, esi
mov DWORD PTR _list$1$[ebp], edx
test ecx, ecx
je $LN44@xmlXPtrBui
; 1583 : xmlNodePtr list = NULL, last = NULL;
; 1584 : int i;
; 1585 :
; 1586 : if (obj == NULL)
; 1587 : return(NULL);
; 1588 : switch (obj->type) {
mov eax, DWORD PTR [ecx]
dec eax
cmp eax, 6
ja SHORT $LN30@xmlXPtrBui
jmp DWORD PTR $LN48@xmlXPtrBui[eax*4]
$LN15@xmlXPtrBui:
; 1589 : case XPATH_NODESET: {
; 1590 : xmlNodeSetPtr set = obj->nodesetval;
mov ebx, DWORD PTR [ecx+4]
; 1591 : if (set == NULL)
test ebx, ebx
je $LN44@xmlXPtrBui
; 1592 : return(NULL);
; 1593 : for (i = 0;i < set->nodeNr;i++) {
xor edi, edi
cmp DWORD PTR [ebx], edx
jle SHORT $LN30@xmlXPtrBui
$LL6@xmlXPtrBui:
; 1594 : if (set->nodeTab[i] == NULL)
mov eax, DWORD PTR [ebx+8]
mov ecx, DWORD PTR [eax+edi*4]
test ecx, ecx
je SHORT $LN4@xmlXPtrBui
; 1595 : continue;
; 1596 : switch (set->nodeTab[i]->type) {
mov eax, DWORD PTR [ecx+4]
add eax, -2 ; fffffffeH
cmp eax, 16 ; 00000010H
ja SHORT $LN7@xmlXPtrBui
movzx eax, BYTE PTR $LN45@xmlXPtrBui[eax]
jmp DWORD PTR $LN49@xmlXPtrBui[eax*4]
$LN7@xmlXPtrBui:
; 1597 : case XML_TEXT_NODE:
; 1598 : case XML_CDATA_SECTION_NODE:
; 1599 : case XML_ELEMENT_NODE:
; 1600 : case XML_ENTITY_REF_NODE:
; 1601 : case XML_ENTITY_NODE:
; 1602 : case XML_PI_NODE:
; 1603 : case XML_COMMENT_NODE:
; 1604 : case XML_DOCUMENT_NODE:
; 1605 : case XML_HTML_DOCUMENT_NODE:
; 1606 : #ifdef LIBXML_DOCB_ENABLED
; 1607 : case XML_DOCB_DOCUMENT_NODE:
; 1608 : #endif
; 1609 : case XML_XINCLUDE_START:
; 1610 : case XML_XINCLUDE_END:
; 1611 : break;
; 1612 : case XML_ATTRIBUTE_NODE:
; 1613 : case XML_NAMESPACE_DECL:
; 1614 : case XML_DOCUMENT_TYPE_NODE:
; 1615 : case XML_DOCUMENT_FRAG_NODE:
; 1616 : case XML_NOTATION_NODE:
; 1617 : case XML_DTD_NODE:
; 1618 : case XML_ELEMENT_DECL:
; 1619 : case XML_ATTRIBUTE_DECL:
; 1620 : case XML_ENTITY_DECL:
; 1621 : continue; /* for */
; 1622 : }
; 1623 : if (last == NULL)
push 1
push ecx
call _xmlCopyNode
add esp, 8
test esi, esi
jne SHORT $LN20@xmlXPtrBui
; 1624 : list = last = xmlCopyNode(set->nodeTab[i], 1);
mov esi, eax
mov DWORD PTR _list$1$[ebp], esi
jmp SHORT $LN4@xmlXPtrBui
$LN20@xmlXPtrBui:
; 1625 : else {
; 1626 : xmlAddNextSibling(last, xmlCopyNode(set->nodeTab[i], 1));
push eax
push esi
call _xmlAddNextSibling
; 1627 : if (last->next != NULL)
mov eax, DWORD PTR [esi+24]
add esp, 8
test eax, eax
cmovne esi, eax
$LN4@xmlXPtrBui:
; 1592 : return(NULL);
; 1593 : for (i = 0;i < set->nodeNr;i++) {
inc edi
cmp edi, DWORD PTR [ebx]
jl SHORT $LL6@xmlXPtrBui
; 1654 : default:
; 1655 : break;
; 1656 : }
; 1657 : return(list);
mov edx, DWORD PTR _list$1$[ebp]
$LN30@xmlXPtrBui:
pop edi
; 1658 : }
pop esi
mov eax, edx
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN23@xmlXPtrBui:
; 1628 : last = last->next;
; 1629 : }
; 1630 : }
; 1631 : break;
; 1632 : }
; 1633 : case XPATH_LOCATIONSET: {
; 1634 : xmlLocationSetPtr set = (xmlLocationSetPtr) obj->user;
mov ebx, DWORD PTR [ecx+28]
; 1635 : if (set == NULL)
test ebx, ebx
je $LN44@xmlXPtrBui
; 1636 : return(NULL);
; 1637 : for (i = 0;i < set->locNr;i++) {
xor edi, edi
cmp DWORD PTR [ebx], edx
jle SHORT $LN30@xmlXPtrBui
$LL11@xmlXPtrBui:
; 1638 : if (last == NULL)
mov eax, DWORD PTR [ebx+8]
push DWORD PTR [eax+edi*4]
call _xmlXPtrBuildNodeList
add esp, 4
test esi, esi
jne SHORT $LN25@xmlXPtrBui
; 1639 : list = last = xmlXPtrBuildNodeList(set->locTab[i]);
mov esi, eax
mov DWORD PTR _list$1$[ebp], esi
jmp SHORT $LN26@xmlXPtrBui
$LN25@xmlXPtrBui:
; 1640 : else
; 1641 : xmlAddNextSibling(last,
push eax
push esi
call _xmlAddNextSibling
add esp, 8
$LN26@xmlXPtrBui:
; 1642 : xmlXPtrBuildNodeList(set->locTab[i]));
; 1643 : if (last != NULL) {
test esi, esi
je SHORT $LN9@xmlXPtrBui
; 1644 : while (last->next != NULL)
mov eax, DWORD PTR [esi+24]
test eax, eax
je SHORT $LN9@xmlXPtrBui
npad 2
$LL12@xmlXPtrBui:
; 1645 : last = last->next;
mov esi, eax
mov eax, DWORD PTR [esi+24]
test eax, eax
jne SHORT $LL12@xmlXPtrBui
$LN9@xmlXPtrBui:
; 1636 : return(NULL);
; 1637 : for (i = 0;i < set->locNr;i++) {
inc edi
cmp edi, DWORD PTR [ebx]
jl SHORT $LL11@xmlXPtrBui
; 1654 : default:
; 1655 : break;
; 1656 : }
; 1657 : return(list);
mov edx, DWORD PTR _list$1$[ebp]
mov eax, edx
pop edi
; 1658 : }
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN28@xmlXPtrBui:
; 1646 : }
; 1647 : }
; 1648 : break;
; 1649 : }
; 1650 : case XPATH_RANGE:
; 1651 : return(xmlXPtrBuildRangeNodeList(obj));
push ecx
call _xmlXPtrBuildRangeNodeList
add esp, 4
pop edi
; 1658 : }
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN29@xmlXPtrBui:
; 1652 : case XPATH_POINT:
; 1653 : return(xmlCopyNode(obj->user, 0));
push 0
push DWORD PTR [ecx+28]
call _xmlCopyNode
add esp, 8
pop edi
; 1658 : }
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN44@xmlXPtrBui:
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0
npad 1
$LN48@xmlXPtrBui:
DD $LN15@xmlXPtrBui
DD $LN30@xmlXPtrBui
DD $LN30@xmlXPtrBui
DD $LN30@xmlXPtrBui
DD $LN29@xmlXPtrBui
DD $LN28@xmlXPtrBui
DD $LN23@xmlXPtrBui
$LN49@xmlXPtrBui:
DD $LN4@xmlXPtrBui
DD $LN7@xmlXPtrBui
$LN45@xmlXPtrBui:
DB 0
DB 1
DB 1
DB 1
DB 1
DB 1
DB 1
DB 1
DB 0
DB 0
DB 0
DB 1
DB 0
DB 0
DB 0
DB 0
DB 0
_xmlXPtrBuildNodeList ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrRangeToFunction
_TEXT SEGMENT
_ctxt$ = 8 ; size = 4
_nargs$ = 12 ; size = 4
_xmlXPtrRangeToFunction PROC ; COMDAT
; 2227 : int nargs ATTRIBUTE_UNUSED) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
; 2228 : XP_ERROR(XPATH_EXPR_ERROR);
mov DWORD PTR _nargs$[ebp], 7
; 2229 : }
pop ebp
; 2228 : XP_ERROR(XPATH_EXPR_ERROR);
jmp _xmlXPathErr
_xmlXPtrRangeToFunction ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrEval
_TEXT SEGMENT
_res$1$ = -4 ; size = 4
_str$ = 8 ; size = 4
_ctx$ = 12 ; size = 4
_xmlXPtrEval PROC ; COMDAT
; 1339 : xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) {
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov DWORD PTR _res$1$[ebp], 0
xor esi, esi
call _xmlXPathInit
mov ebx, DWORD PTR _ctx$[ebp]
test ebx, ebx
je $LN6@xmlXPtrEva
; 1340 : xmlXPathParserContextPtr ctxt;
; 1341 : xmlXPathObjectPtr res = NULL, tmp;
; 1342 : xmlXPathObjectPtr init = NULL;
; 1343 : int stack = 0;
; 1344 :
; 1345 : xmlXPathInit();
; 1346 :
; 1347 : if ((ctx == NULL) || (str == NULL))
mov eax, DWORD PTR _str$[ebp]
test eax, eax
je $LN6@xmlXPtrEva
; 1348 : return(NULL);
; 1349 :
; 1350 : ctxt = xmlXPathNewParserContext(str, ctx);
push ebx
push eax
call _xmlXPathNewParserContext
mov edi, eax
add esp, 8
; 1351 : if (ctxt == NULL)
test edi, edi
je $LN6@xmlXPtrEva
; 1352 : return(NULL);
; 1353 : ctxt->xptr = 1;
; 1354 : xmlXPtrEvalXPointer(ctxt);
push edi
mov DWORD PTR [edi+36], 1
call _xmlXPtrEvalXPointer
; 1355 :
; 1356 : if ((ctxt->value != NULL) &&
; 1357 : (ctxt->value->type != XPATH_NODESET) &&
mov eax, DWORD PTR [edi+16]
add esp, 4
test eax, eax
je SHORT $LN8@xmlXPtrEva
mov eax, DWORD PTR [eax]
cmp eax, 1
je SHORT $LN8@xmlXPtrEva
cmp eax, 7
je SHORT $LN8@xmlXPtrEva
; 1358 : (ctxt->value->type != XPATH_LOCATIONSET)) {
; 1359 : xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
push esi
push OFFSET ??_C@_0DF@PGJMIHPP@xmlXPtrEval?3?5evaluation?5failed?5@
push 1902 ; 0000076eH
push edi
call _xmlXPtrErr
add esp, 16 ; 00000010H
; 1360 : "xmlXPtrEval: evaluation failed to return a node set\n",
; 1361 : NULL);
; 1362 : } else {
jmp SHORT $LL4@xmlXPtrEva
$LN8@xmlXPtrEva:
; 1363 : res = valuePop(ctxt);
push edi
call _valuePop
mov DWORD PTR _res$1$[ebp], eax
$LN33@xmlXPtrEva:
; 1364 : }
; 1365 :
; 1366 : do {
; 1367 : tmp = valuePop(ctxt);
add esp, 4
npad 2
$LL4@xmlXPtrEva:
push edi
call _valuePop
mov ecx, eax
add esp, 4
; 1368 : if (tmp != NULL) {
test ecx, ecx
je SHORT $LN24@xmlXPtrEva
; 1369 : if (tmp != init) {
; 1370 : if (tmp->type == XPATH_NODESET) {
cmp DWORD PTR [ecx], 1
jne SHORT $LN12@xmlXPtrEva
; 1371 : /*
; 1372 : * Evaluation may push a root nodeset which is unused
; 1373 : */
; 1374 : xmlNodeSetPtr set;
; 1375 : set = tmp->nodesetval;
mov eax, DWORD PTR [ecx+4]
; 1376 : if ((set == NULL) || (set->nodeNr != 1) ||
test eax, eax
je SHORT $LN12@xmlXPtrEva
cmp DWORD PTR [eax], 1
jne SHORT $LN12@xmlXPtrEva
mov eax, DWORD PTR [eax+8]
mov eax, DWORD PTR [eax]
cmp eax, DWORD PTR [ebx]
je SHORT $LN13@xmlXPtrEva
$LN12@xmlXPtrEva:
; 1377 : (set->nodeTab[0] != (xmlNodePtr) ctx->doc))
; 1378 : stack++;
; 1379 : } else
; 1380 : stack++;
; 1381 : }
; 1382 : xmlXPathFreeObject(tmp);
inc esi
$LN13@xmlXPtrEva:
push ecx
call _xmlXPathFreeObject
; 1383 : }
; 1384 : } while (tmp != NULL);
jmp SHORT $LN33@xmlXPtrEva
$LN24@xmlXPtrEva:
; 1385 : if (stack != 0) {
test esi, esi
je SHORT $LN16@xmlXPtrEva
; 1386 : xmlXPtrErr(ctxt, XML_XPTR_EXTRA_OBJECTS,
push 0
push OFFSET ??_C@_0CP@NCKIHCDF@xmlXPtrEval?3?5object?$CIs?$CJ?5left?5on?5@
push 1903 ; 0000076fH
push edi
call _xmlXPtrErr
add esp, 16 ; 00000010H
$LN16@xmlXPtrEva:
; 1387 : "xmlXPtrEval: object(s) left on the eval stack\n",
; 1388 : NULL);
; 1389 : }
; 1390 : if (ctxt->error != XPATH_EXPRESSION_OK) {
mov ebx, DWORD PTR [edi+8]
test ebx, ebx
je SHORT $LN17@xmlXPtrEva
; 1391 : xmlXPathFreeObject(res);
push DWORD PTR _res$1$[ebp]
call _xmlXPathFreeObject
add esp, 4
$LN17@xmlXPtrEva:
; 1392 : res = NULL;
; 1393 : }
; 1394 :
; 1395 : xmlXPathFreeParserContext(ctxt);
xor esi, esi
test ebx, ebx
push edi
cmove esi, DWORD PTR _res$1$[ebp]
call _xmlXPathFreeParserContext
add esp, 4
; 1396 : return(res);
mov eax, esi
pop edi
; 1397 : }
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0
$LN6@xmlXPtrEva:
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0
_xmlXPtrEval ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewContext
_TEXT SEGMENT
_doc$ = 8 ; size = 4
_here$ = 12 ; size = 4
_origin$ = 16 ; size = 4
_xmlXPtrNewContext PROC ; COMDAT
; 1300 : xmlXPtrNewContext(xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
push DWORD PTR _doc$[ebp]
call _xmlXPathNewContext
mov esi, eax
add esp, 4
test esi, esi
jne SHORT $LN2@xmlXPtrNew
pop esi
; 1326 : }
pop ebp
ret 0
$LN2@xmlXPtrNew:
; 1301 : xmlXPathContextPtr ret;
; 1302 :
; 1303 : ret = xmlXPathNewContext(doc);
; 1304 : if (ret == NULL)
; 1305 : return(ret);
; 1306 : ret->xptr = 1;
; 1307 : ret->here = here;
mov eax, DWORD PTR _here$[ebp]
; 1308 : ret->origin = origin;
; 1309 :
; 1310 : xmlXPathRegisterFunc(ret, (xmlChar *)"range",
push OFFSET _xmlXPtrRangeFunction
mov DWORD PTR [esi+80], eax
mov eax, DWORD PTR _origin$[ebp]
push OFFSET ??_C@_05CCGOGOBM@range@
push esi
mov DWORD PTR [esi+76], 1
mov DWORD PTR [esi+84], eax
call _xmlXPathRegisterFunc
; 1311 : xmlXPtrRangeFunction);
; 1312 : xmlXPathRegisterFunc(ret, (xmlChar *)"range-inside",
push OFFSET _xmlXPtrRangeInsideFunction
push OFFSET ??_C@_0N@FPBCPIBK@range?9inside@
push esi
call _xmlXPathRegisterFunc
; 1313 : xmlXPtrRangeInsideFunction);
; 1314 : xmlXPathRegisterFunc(ret, (xmlChar *)"string-range",
push OFFSET _xmlXPtrStringRangeFunction
push OFFSET ??_C@_0N@NHPDEMLM@string?9range@
push esi
call _xmlXPathRegisterFunc
; 1315 : xmlXPtrStringRangeFunction);
; 1316 : xmlXPathRegisterFunc(ret, (xmlChar *)"start-point",
push OFFSET _xmlXPtrStartPointFunction
push OFFSET ??_C@_0M@KAHBAHMC@start?9point@
push esi
call _xmlXPathRegisterFunc
; 1317 : xmlXPtrStartPointFunction);
; 1318 : xmlXPathRegisterFunc(ret, (xmlChar *)"end-point",
push OFFSET _xmlXPtrEndPointFunction
push OFFSET ??_C@_09BKKFPLJK@end?9point@
push esi
call _xmlXPathRegisterFunc
; 1319 : xmlXPtrEndPointFunction);
; 1320 : xmlXPathRegisterFunc(ret, (xmlChar *)"here",
push OFFSET _xmlXPtrHereFunction
push OFFSET ??_C@_04NDJIBAID@here@
push esi
call _xmlXPathRegisterFunc
add esp, 72 ; 00000048H
; 1321 : xmlXPtrHereFunction);
; 1322 : xmlXPathRegisterFunc(ret, (xmlChar *)" origin",
push OFFSET _xmlXPtrOriginFunction
push OFFSET ??_C@_07NGBELOAG@?5origin@
push esi
call _xmlXPathRegisterFunc
add esp, 12 ; 0000000cH
; 1323 : xmlXPtrOriginFunction);
; 1324 :
; 1325 : return(ret);
mov eax, esi
pop esi
; 1326 : }
pop ebp
ret 0
_xmlXPtrNewContext ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrLocationSetRemove
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_val$ = 12 ; size = 4
_xmlXPtrLocationSetRemove PROC ; COMDAT
; 723 : xmlXPtrLocationSetRemove(xmlLocationSetPtr cur, int val) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _cur$[ebp]
test esi, esi
je SHORT $LN1@xmlXPtrLoc
; 724 : if (cur == NULL) return;
; 725 : if (val >= cur->locNr) return;
mov ecx, DWORD PTR [esi]
mov edx, DWORD PTR _val$[ebp]
cmp edx, ecx
jge SHORT $LN1@xmlXPtrLoc
; 726 : cur->locNr--;
dec ecx
mov DWORD PTR [esi], ecx
; 727 : for (;val < cur->locNr;val++)
cmp edx, ecx
jge SHORT $LN11@xmlXPtrLoc
$LL4@xmlXPtrLoc:
; 728 : cur->locTab[val] = cur->locTab[val + 1];
mov eax, DWORD PTR [esi+8]
lea ecx, DWORD PTR [eax+edx*4]
inc edx
mov eax, DWORD PTR [ecx+4]
mov DWORD PTR [ecx], eax
mov ecx, DWORD PTR [esi]
cmp edx, ecx
jl SHORT $LL4@xmlXPtrLoc
$LN11@xmlXPtrLoc:
; 729 : cur->locTab[cur->locNr] = NULL;
mov eax, DWORD PTR [esi+8]
mov DWORD PTR [eax+ecx*4], 0
$LN1@xmlXPtrLoc:
pop esi
; 730 : }
pop ebp
ret 0
_xmlXPtrLocationSetRemove ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrLocationSetDel
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_val$ = 12 ; size = 4
_xmlXPtrLocationSetDel PROC ; COMDAT
; 690 : xmlXPtrLocationSetDel(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _cur$[ebp]
test esi, esi
je SHORT $LN1@xmlXPtrLoc
; 691 : int i;
; 692 :
; 693 : if (cur == NULL) return;
; 694 : if (val == NULL) return;
push edi
mov edi, DWORD PTR _val$[ebp]
test edi, edi
je SHORT $LN23@xmlXPtrLoc
; 695 :
; 696 : /*
; 697 : * check against doublons
; 698 : */
; 699 : for (i = 0;i < cur->locNr;i++)
mov edx, DWORD PTR [esi]
xor eax, eax
test edx, edx
jle SHORT $LN23@xmlXPtrLoc
; 700 : if (cur->locTab[i] == val) break;
mov ecx, DWORD PTR [esi+8]
$LL4@xmlXPtrLoc:
cmp DWORD PTR [ecx], edi
je SHORT $LN15@xmlXPtrLoc
; 695 :
; 696 : /*
; 697 : * check against doublons
; 698 : */
; 699 : for (i = 0;i < cur->locNr;i++)
inc eax
add ecx, 4
cmp eax, edx
jl SHORT $LL4@xmlXPtrLoc
pop edi
pop esi
; 713 : }
pop ebp
ret 0
$LN15@xmlXPtrLoc:
; 701 :
; 702 : if (i >= cur->locNr) {
cmp eax, edx
jge SHORT $LN23@xmlXPtrLoc
; 703 : #ifdef DEBUG
; 704 : xmlGenericError(xmlGenericErrorContext,
; 705 : "xmlXPtrLocationSetDel: Range wasn't found in RangeList\n");
; 706 : #endif
; 707 : return;
; 708 : }
; 709 : cur->locNr--;
lea ecx, DWORD PTR [edx-1]
mov DWORD PTR [esi], ecx
; 710 : for (;i < cur->locNr;i++)
cmp eax, ecx
jge SHORT $LN20@xmlXPtrLoc
$LL7@xmlXPtrLoc:
; 711 : cur->locTab[i] = cur->locTab[i + 1];
mov ecx, DWORD PTR [esi+8]
lea edx, DWORD PTR [ecx+eax*4]
inc eax
mov ecx, DWORD PTR [edx+4]
mov DWORD PTR [edx], ecx
mov ecx, DWORD PTR [esi]
cmp eax, ecx
jl SHORT $LL7@xmlXPtrLoc
$LN20@xmlXPtrLoc:
; 712 : cur->locTab[cur->locNr] = NULL;
mov eax, DWORD PTR [esi+8]
mov DWORD PTR [eax+ecx*4], 0
$LN23@xmlXPtrLoc:
pop edi
$LN1@xmlXPtrLoc:
pop esi
; 713 : }
pop ebp
ret 0
_xmlXPtrLocationSetDel ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrWrapLocationSet
_TEXT SEGMENT
_val$ = 8 ; size = 4
_xmlXPtrWrapLocationSet PROC ; COMDAT
; 826 : xmlXPtrWrapLocationSet(xmlLocationSetPtr val) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
push 48 ; 00000030H
call DWORD PTR _xmlMalloc
add esp, 4
test eax, eax
jne SHORT $LN2@xmlXPtrWra
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 827 : xmlXPathObjectPtr ret;
; 828 :
; 829 : ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
; 830 : if (ret == NULL) {
; 831 : xmlXPtrErrMemory("allocating locationset");
; 832 : return(NULL);
xor eax, eax
; 837 : return(ret);
; 838 : }
pop ebp
ret 0
$LN2@xmlXPtrWra:
; 833 : }
; 834 : memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
; 835 : ret->type = XPATH_LOCATIONSET;
; 836 : ret->user = (void *) val;
mov ecx, DWORD PTR _val$[ebp]
mov DWORD PTR [eax+4], 0
mov DWORD PTR [eax+8], 0
mov DWORD PTR [eax+12], 0
mov DWORD PTR [eax+16], 0
mov DWORD PTR [eax+20], 0
mov DWORD PTR [eax+24], 0
mov DWORD PTR [eax+32], 0
mov DWORD PTR [eax+36], 0
mov DWORD PTR [eax+40], 0
mov DWORD PTR [eax+44], 0
mov DWORD PTR [eax], 7
mov DWORD PTR [eax+28], ecx
; 837 : return(ret);
; 838 : }
pop ebp
ret 0
_xmlXPtrWrapLocationSet ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrLocationSetAdd
_TEXT SEGMENT
_cur$ = 8 ; size = 4
_val$ = 12 ; size = 4
_xmlXPtrLocationSetAdd PROC ; COMDAT
; 612 : xmlXPtrLocationSetAdd(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
push ebp
mov ebp, esp
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _cur$[ebp]
test edi, edi
je $LN6@xmlXPtrLoc
; 613 : int i;
; 614 :
; 615 : if ((cur == NULL) || (val == NULL)) return;
push esi
mov esi, DWORD PTR _val$[ebp]
test esi, esi
je $LN35@xmlXPtrLoc
; 616 :
; 617 : /*
; 618 : * check against doublons
; 619 : */
; 620 : for (i = 0;i < cur->locNr;i++) {
mov ecx, DWORD PTR [edi]
xor edx, edx
push ebx
test ecx, ecx
jle SHORT $LN3@xmlXPtrLoc
; 621 : if (xmlXPtrRangesEqual(cur->locTab[i], val)) {
mov ebx, DWORD PTR [edi+8]
$LL4@xmlXPtrLoc:
mov ecx, DWORD PTR [ebx]
; 312 : if (range1 == range2)
cmp ecx, esi
je $LN28@xmlXPtrLoc
; 313 : return(1);
; 314 : if ((range1 == NULL) || (range2 == NULL))
test ecx, ecx
je SHORT $LN17@xmlXPtrLoc
; 315 : return(0);
; 316 : if (range1->type != range2->type)
mov eax, DWORD PTR [ecx]
cmp eax, DWORD PTR [esi]
jne SHORT $LN17@xmlXPtrLoc
; 317 : return(0);
; 318 : if (range1->type != XPATH_RANGE)
cmp eax, 6
jne SHORT $LN17@xmlXPtrLoc
; 319 : return(0);
; 320 : if (range1->user != range2->user)
mov eax, DWORD PTR [ecx+28]
cmp eax, DWORD PTR [esi+28]
jne SHORT $LN17@xmlXPtrLoc
; 321 : return(0);
; 322 : if (range1->index != range2->index)
mov eax, DWORD PTR [ecx+32]
cmp eax, DWORD PTR [esi+32]
jne SHORT $LN17@xmlXPtrLoc
; 323 : return(0);
; 324 : if (range1->user2 != range2->user2)
mov eax, DWORD PTR [ecx+36]
cmp eax, DWORD PTR [esi+36]
jne SHORT $LN17@xmlXPtrLoc
; 325 : return(0);
; 326 : if (range1->index2 != range2->index2)
mov eax, DWORD PTR [ecx+40]
cmp eax, DWORD PTR [esi+40]
je SHORT $LN28@xmlXPtrLoc
$LN17@xmlXPtrLoc:
; 616 :
; 617 : /*
; 618 : * check against doublons
; 619 : */
; 620 : for (i = 0;i < cur->locNr;i++) {
mov ecx, DWORD PTR [edi]
inc edx
add ebx, 4
cmp edx, ecx
jl SHORT $LL4@xmlXPtrLoc
$LN3@xmlXPtrLoc:
; 623 : return;
; 624 : }
; 625 : }
; 626 :
; 627 : /*
; 628 : * grow the locTab if needed
; 629 : */
; 630 : if (cur->locMax == 0) {
mov eax, DWORD PTR [edi+4]
test eax, eax
jne SHORT $LN8@xmlXPtrLoc
; 631 : cur->locTab = (xmlXPathObjectPtr *) xmlMalloc(XML_RANGESET_DEFAULT *
push 40 ; 00000028H
call DWORD PTR _xmlMalloc
add esp, 4
mov DWORD PTR [edi+8], eax
; 632 : sizeof(xmlXPathObjectPtr));
; 633 : if (cur->locTab == NULL) {
test eax, eax
jne SHORT $LN10@xmlXPtrLoc
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
pop ebx
pop esi
pop edi
; 653 : }
pop ebp
ret 0
$LN28@xmlXPtrLoc:
; 622 : xmlXPathFreeObject(val);
push esi
call _xmlXPathFreeObject
add esp, 4
pop ebx
pop esi
pop edi
; 653 : }
pop ebp
ret 0
$LN10@xmlXPtrLoc:
xorps xmm0, xmm0
; 634 : xmlXPtrErrMemory("adding location to set");
; 635 : return;
; 636 : }
; 637 : memset(cur->locTab, 0 ,
movups XMMWORD PTR [eax], xmm0
pop ebx
movups XMMWORD PTR [eax+16], xmm0
movq QWORD PTR [eax+32], xmm0
; 651 : }
; 652 : cur->locTab[cur->locNr++] = val;
mov ecx, DWORD PTR [edi]
mov eax, DWORD PTR [edi+8]
mov DWORD PTR [edi+4], 10 ; 0000000aH
mov DWORD PTR [eax+ecx*4], esi
inc DWORD PTR [edi]
pop esi
pop edi
; 653 : }
pop ebp
ret 0
$LN8@xmlXPtrLoc:
; 638 : XML_RANGESET_DEFAULT * (size_t) sizeof(xmlXPathObjectPtr));
; 639 : cur->locMax = XML_RANGESET_DEFAULT;
; 640 : } else if (cur->locNr == cur->locMax) {
cmp ecx, eax
jne SHORT $LN11@xmlXPtrLoc
; 641 : xmlXPathObjectPtr *temp;
; 642 :
; 643 : cur->locMax *= 2;
add eax, eax
mov DWORD PTR [edi+4], eax
; 644 : temp = (xmlXPathObjectPtr *) xmlRealloc(cur->locTab, cur->locMax *
shl eax, 2
push eax
push DWORD PTR [edi+8]
call DWORD PTR _xmlRealloc
add esp, 8
; 645 : sizeof(xmlXPathObjectPtr));
; 646 : if (temp == NULL) {
test eax, eax
jne SHORT $LN12@xmlXPtrLoc
; 647 : xmlXPtrErrMemory("adding location to set");
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
call _xmlXPtrErrMemory
add esp, 4
pop ebx
pop esi
pop edi
; 653 : }
pop ebp
ret 0
$LN12@xmlXPtrLoc:
; 648 : return;
; 649 : }
; 650 : cur->locTab = temp;
mov DWORD PTR [edi+8], eax
$LN11@xmlXPtrLoc:
; 651 : }
; 652 : cur->locTab[cur->locNr++] = val;
mov ecx, DWORD PTR [edi]
mov eax, DWORD PTR [edi+8]
pop ebx
mov DWORD PTR [eax+ecx*4], esi
inc DWORD PTR [edi]
$LN35@xmlXPtrLoc:
pop esi
$LN6@xmlXPtrLoc:
pop edi
; 653 : }
pop ebp
ret 0
_xmlXPtrLocationSetAdd ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewCollapsedRange
_TEXT SEGMENT
_start$ = 8 ; size = 4
_xmlXPtrNewCollapsedRange PROC ; COMDAT
; 510 : xmlXPtrNewCollapsedRange(xmlNodePtr start) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _start$[ebp]
test eax, eax
jne SHORT $LN2@xmlXPtrNew
; 517 : return(ret);
; 518 : }
pop ebp
ret 0
$LN2@xmlXPtrNew:
; 511 : xmlXPathObjectPtr ret;
; 512 :
; 513 : if (start == NULL)
; 514 : return(NULL);
; 515 :
; 516 : ret = xmlXPtrNewRangeInternal(start, -1, NULL, -1);
push -1
push 0
push -1
push eax
call _xmlXPtrNewRangeInternal
add esp, 16 ; 00000010H
; 517 : return(ret);
; 518 : }
pop ebp
ret 0
_xmlXPtrNewCollapsedRange ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangeNodeObject
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewRangeNodeObject PROC ; COMDAT
; 530 : xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edx, DWORD PTR _start$[ebp]
test edx, edx
je SHORT $LN10@xmlXPtrNew
; 531 : xmlNodePtr endNode;
; 532 : int endIndex;
; 533 : xmlXPathObjectPtr ret;
; 534 :
; 535 : if (start == NULL)
; 536 : return(NULL);
; 537 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je SHORT $LN10@xmlXPtrNew
; 538 : return(NULL);
; 539 : switch (end->type) {
mov ecx, DWORD PTR [eax]
sub ecx, 1
je SHORT $LN8@xmlXPtrNew
sub ecx, 4
je SHORT $LN6@xmlXPtrNew
sub ecx, 1
jne SHORT $LN10@xmlXPtrNew
; 544 : case XPATH_RANGE:
; 545 : endNode = end->user2;
mov ecx, DWORD PTR [eax+36]
; 546 : endIndex = end->index2;
mov eax, DWORD PTR [eax+40]
; 547 : break;
jmp SHORT $LN2@xmlXPtrNew
$LN6@xmlXPtrNew:
; 540 : case XPATH_POINT:
; 541 : endNode = end->user;
mov ecx, DWORD PTR [eax+28]
; 542 : endIndex = end->index;
mov eax, DWORD PTR [eax+32]
; 543 : break;
jmp SHORT $LN2@xmlXPtrNew
$LN8@xmlXPtrNew:
; 548 : case XPATH_NODESET:
; 549 : /*
; 550 : * Empty set ...
; 551 : */
; 552 : if ((end->nodesetval == NULL) || (end->nodesetval->nodeNr <= 0))
mov eax, DWORD PTR [eax+4]
test eax, eax
je SHORT $LN10@xmlXPtrNew
mov ecx, DWORD PTR [eax]
test ecx, ecx
jle SHORT $LN10@xmlXPtrNew
; 554 : endNode = end->nodesetval->nodeTab[end->nodesetval->nodeNr - 1];
mov eax, DWORD PTR [eax+8]
mov ecx, DWORD PTR [eax+ecx*4-4]
; 555 : endIndex = -1;
or eax, -1
$LN2@xmlXPtrNew:
; 556 : break;
; 557 : default:
; 558 : /* TODO */
; 559 : return(NULL);
; 560 : }
; 561 :
; 562 : ret = xmlXPtrNewRangeInternal(start, -1, endNode, endIndex);
push esi
push eax
push ecx
push -1
push edx
call _xmlXPtrNewRangeInternal
mov esi, eax
; 563 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 564 : return(ret);
mov eax, esi
pop esi
; 565 : }
pop ebp
ret 0
$LN10@xmlXPtrNew:
; 553 : return(NULL);
xor eax, eax
; 565 : }
pop ebp
ret 0
_xmlXPtrNewRangeNodeObject ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewLocationSetNodeSet
_TEXT SEGMENT
_ret$1$ = -8 ; size = 4
_newset$1$ = -4 ; size = 4
_set$ = 8 ; size = 4
_xmlXPtrNewLocationSetNodeSet PROC ; COMDAT
; 790 : xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set) {
push ebp
mov ebp, esp
sub esp, 8
push ebx
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
push 48 ; 00000030H
call DWORD PTR _xmlMalloc
mov ebx, eax
add esp, 4
mov DWORD PTR _ret$1$[ebp], ebx
test ebx, ebx
jne SHORT $LN5@xmlXPtrNew
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 791 : xmlXPathObjectPtr ret;
; 792 :
; 793 : ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
; 794 : if (ret == NULL) {
; 795 : xmlXPtrErrMemory("allocating locationset");
; 796 : return(NULL);
xor eax, eax
pop ebx
; 815 : }
mov esp, ebp
pop ebp
ret 0
$LN5@xmlXPtrNew:
push edi
; 797 : }
; 798 : memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
push 48 ; 00000030H
push 0
push ebx
call _memset
; 799 : ret->type = XPATH_LOCATIONSET;
; 800 : if (set != NULL) {
mov edi, DWORD PTR _set$[ebp]
add esp, 12 ; 0000000cH
mov DWORD PTR [ebx], 7
test edi, edi
je SHORT $LN6@xmlXPtrNew
; 801 : int i;
; 802 : xmlLocationSetPtr newset;
; 803 :
; 804 : newset = xmlXPtrLocationSetCreate(NULL);
push 0
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR _newset$1$[ebp], eax
; 805 : if (newset == NULL)
test eax, eax
je SHORT $LN6@xmlXPtrNew
; 806 : return(ret);
; 807 :
; 808 : for (i = 0;i < set->nodeNr;i++)
push esi
xor esi, esi
cmp DWORD PTR [edi], esi
jle SHORT $LN3@xmlXPtrNew
mov ebx, eax
npad 7
$LL4@xmlXPtrNew:
; 809 : xmlXPtrLocationSetAdd(newset,
mov eax, DWORD PTR [edi+8]
mov eax, DWORD PTR [eax+esi*4]
; 513 : if (start == NULL)
test eax, eax
je SHORT $LN11@xmlXPtrNew
$LN12@xmlXPtrNew:
; 514 : return(NULL);
; 515 :
; 516 : ret = xmlXPtrNewRangeInternal(start, -1, NULL, -1);
push -1
push 0
push -1
push eax
call _xmlXPtrNewRangeInternal
add esp, 16 ; 00000010H
$LN11@xmlXPtrNew:
; 809 : xmlXPtrLocationSetAdd(newset,
push eax
push ebx
call _xmlXPtrLocationSetAdd
inc esi
add esp, 8
cmp esi, DWORD PTR [edi]
jl SHORT $LL4@xmlXPtrNew
mov ebx, DWORD PTR _ret$1$[ebp]
mov eax, DWORD PTR _newset$1$[ebp]
$LN3@xmlXPtrNew:
; 810 : xmlXPtrNewCollapsedRange(set->nodeTab[i]));
; 811 :
; 812 : ret->user = (void *) newset;
mov DWORD PTR [ebx+28], eax
pop esi
$LN6@xmlXPtrNew:
; 813 : }
; 814 : return(ret);
pop edi
mov eax, ebx
pop ebx
; 815 : }
mov esp, ebp
pop ebp
ret 0
_xmlXPtrNewLocationSetNodeSet ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewLocationSetNodes
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewLocationSetNodes PROC ; COMDAT
; 763 : xmlXPtrNewLocationSetNodes(xmlNodePtr start, xmlNodePtr end) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
push 48 ; 00000030H
call DWORD PTR _xmlMalloc
mov esi, eax
add esp, 4
test esi, esi
jne SHORT $LN2@xmlXPtrNew
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 764 : xmlXPathObjectPtr ret;
; 765 :
; 766 : ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
; 767 : if (ret == NULL) {
; 768 : xmlXPtrErrMemory("allocating locationset");
; 769 : return(NULL);
xor eax, eax
pop esi
; 778 : }
pop ebp
ret 0
$LN2@xmlXPtrNew:
push edi
; 770 : }
; 771 : memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
push 48 ; 00000030H
push 0
push esi
call _memset
; 772 : ret->type = XPATH_LOCATIONSET;
; 773 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
add esp, 12 ; 0000000cH
mov DWORD PTR [esi], 7
test eax, eax
jne SHORT $LN3@xmlXPtrNew
; 513 : if (start == NULL)
mov eax, DWORD PTR _start$[ebp]
test eax, eax
je SHORT $LN15@xmlXPtrNew
; 514 : return(NULL);
; 515 :
; 516 : ret = xmlXPtrNewRangeInternal(start, -1, NULL, -1);
push -1
push 0
push -1
push eax
call _xmlXPtrNewRangeInternal
add esp, 16 ; 00000010H
; 517 : return(ret);
mov edi, eax
; 774 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewCollapsedRange(start));
; 775 : else
; 776 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewRangeNodes(start,end));
; 777 : return(ret);
push edi
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR [esi+28], eax
mov eax, esi
pop edi
pop esi
; 778 : }
pop ebp
ret 0
$LN3@xmlXPtrNew:
; 491 : if (start == NULL)
mov ecx, DWORD PTR _start$[ebp]
test ecx, ecx
jne SHORT $LN12@xmlXPtrNew
$LN15@xmlXPtrNew:
; 774 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewCollapsedRange(start));
; 775 : else
; 776 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewRangeNodes(start,end));
; 777 : return(ret);
xor edi, edi
push edi
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR [esi+28], eax
mov eax, esi
pop edi
pop esi
; 778 : }
pop ebp
ret 0
$LN12@xmlXPtrNew:
; 496 : ret = xmlXPtrNewRangeInternal(start, -1, end, -1);
push -1
push eax
push -1
push ecx
call _xmlXPtrNewRangeInternal
mov edi, eax
; 497 : xmlXPtrRangeCheckOrder(ret);
push edi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 774 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewCollapsedRange(start));
; 775 : else
; 776 : ret->user = xmlXPtrLocationSetCreate(xmlXPtrNewRangeNodes(start,end));
; 777 : return(ret);
push edi
call _xmlXPtrLocationSetCreate
add esp, 4
mov DWORD PTR [esi+28], eax
mov eax, esi
pop edi
pop esi
; 778 : }
pop ebp
ret 0
_xmlXPtrNewLocationSetNodes ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangeNodes
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewRangeNodes PROC ; COMDAT
; 488 : xmlXPtrNewRangeNodes(xmlNodePtr start, xmlNodePtr end) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _start$[ebp]
test ecx, ecx
je SHORT $LN5@xmlXPtrNew
; 489 : xmlXPathObjectPtr ret;
; 490 :
; 491 : if (start == NULL)
; 492 : return(NULL);
; 493 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je SHORT $LN5@xmlXPtrNew
; 495 :
; 496 : ret = xmlXPtrNewRangeInternal(start, -1, end, -1);
push esi
push -1
push eax
push -1
push ecx
call _xmlXPtrNewRangeInternal
mov esi, eax
; 497 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 498 : return(ret);
mov eax, esi
pop esi
; 499 : }
pop ebp
ret 0
$LN5@xmlXPtrNew:
; 494 : return(NULL);
xor eax, eax
; 499 : }
pop ebp
ret 0
_xmlXPtrNewRangeNodes ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangePointNode
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewRangePointNode PROC ; COMDAT
; 438 : xmlXPtrNewRangePointNode(xmlXPathObjectPtr start, xmlNodePtr end) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _start$[ebp]
test eax, eax
je SHORT $LN6@xmlXPtrNew
; 439 : xmlXPathObjectPtr ret;
; 440 :
; 441 : if (start == NULL)
; 442 : return(NULL);
; 443 : if (end == NULL)
mov ecx, DWORD PTR _end$[ebp]
test ecx, ecx
je SHORT $LN6@xmlXPtrNew
; 444 : return(NULL);
; 445 : if (start->type != XPATH_POINT)
cmp DWORD PTR [eax], 5
jne SHORT $LN6@xmlXPtrNew
; 447 :
; 448 : ret = xmlXPtrNewRangeInternal(start->user, start->index, end, -1);
push esi
push -1
push ecx
push DWORD PTR [eax+32]
push DWORD PTR [eax+28]
call _xmlXPtrNewRangeInternal
mov esi, eax
; 449 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 450 : return(ret);
mov eax, esi
pop esi
; 451 : }
pop ebp
ret 0
$LN6@xmlXPtrNew:
; 446 : return(NULL);
xor eax, eax
; 451 : }
pop ebp
ret 0
_xmlXPtrNewRangePointNode ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangeNodePoint
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewRangeNodePoint PROC ; COMDAT
; 463 : xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _start$[ebp]
test ecx, ecx
je SHORT $LN6@xmlXPtrNew
; 464 : xmlXPathObjectPtr ret;
; 465 :
; 466 : if (start == NULL)
; 467 : return(NULL);
; 468 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je SHORT $LN6@xmlXPtrNew
; 469 : return(NULL);
; 470 : if (end->type != XPATH_POINT)
cmp DWORD PTR [eax], 5
jne SHORT $LN6@xmlXPtrNew
; 472 :
; 473 : ret = xmlXPtrNewRangeInternal(start, -1, end->user, end->index);
push esi
push DWORD PTR [eax+32]
push DWORD PTR [eax+28]
push -1
push ecx
call _xmlXPtrNewRangeInternal
mov esi, eax
; 474 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 475 : return(ret);
mov eax, esi
pop esi
; 476 : }
pop ebp
ret 0
$LN6@xmlXPtrNew:
; 471 : return(NULL);
xor eax, eax
; 476 : }
pop ebp
ret 0
_xmlXPtrNewRangeNodePoint ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRangePoints
_TEXT SEGMENT
_start$ = 8 ; size = 4
_end$ = 12 ; size = 4
_xmlXPtrNewRangePoints PROC ; COMDAT
; 410 : xmlXPtrNewRangePoints(xmlXPathObjectPtr start, xmlXPathObjectPtr end) {
push ebp
mov ebp, esp
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _start$[ebp]
test ecx, ecx
je SHORT $LN7@xmlXPtrNew
; 411 : xmlXPathObjectPtr ret;
; 412 :
; 413 : if (start == NULL)
; 414 : return(NULL);
; 415 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je SHORT $LN7@xmlXPtrNew
; 416 : return(NULL);
; 417 : if (start->type != XPATH_POINT)
cmp DWORD PTR [ecx], 5
jne SHORT $LN7@xmlXPtrNew
; 418 : return(NULL);
; 419 : if (end->type != XPATH_POINT)
cmp DWORD PTR [eax], 5
jne SHORT $LN7@xmlXPtrNew
; 421 :
; 422 : ret = xmlXPtrNewRangeInternal(start->user, start->index, end->user,
push esi
push DWORD PTR [eax+32]
push DWORD PTR [eax+28]
push DWORD PTR [ecx+32]
push DWORD PTR [ecx+28]
call _xmlXPtrNewRangeInternal
mov esi, eax
; 423 : end->index);
; 424 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 425 : return(ret);
mov eax, esi
pop esi
; 426 : }
pop ebp
ret 0
$LN7@xmlXPtrNew:
; 420 : return(NULL);
xor eax, eax
; 426 : }
pop ebp
ret 0
_xmlXPtrNewRangePoints ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrNewRange
_TEXT SEGMENT
_start$ = 8 ; size = 4
_startindex$ = 12 ; size = 4
_end$ = 16 ; size = 4
_endindex$ = 20 ; size = 4
_xmlXPtrNewRange PROC ; COMDAT
; 383 : xmlNodePtr end, int endindex) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov ecx, DWORD PTR _start$[ebp]
test ecx, ecx
je SHORT $LN7@xmlXPtrNew
; 384 : xmlXPathObjectPtr ret;
; 385 :
; 386 : if (start == NULL)
; 387 : return(NULL);
; 388 : if (end == NULL)
mov eax, DWORD PTR _end$[ebp]
test eax, eax
je SHORT $LN7@xmlXPtrNew
; 389 : return(NULL);
; 390 : if (startindex < 0)
mov edx, DWORD PTR _startindex$[ebp]
test edx, edx
js SHORT $LN7@xmlXPtrNew
; 391 : return(NULL);
; 392 : if (endindex < 0)
mov esi, DWORD PTR _endindex$[ebp]
test esi, esi
js SHORT $LN7@xmlXPtrNew
; 394 :
; 395 : ret = xmlXPtrNewRangeInternal(start, startindex, end, endindex);
push esi
push eax
push edx
push ecx
call _xmlXPtrNewRangeInternal
mov esi, eax
; 396 : xmlXPtrRangeCheckOrder(ret);
push esi
call _xmlXPtrRangeCheckOrder
add esp, 20 ; 00000014H
; 397 : return(ret);
mov eax, esi
pop esi
; 398 : }
pop ebp
ret 0
$LN7@xmlXPtrNew:
; 393 : return(NULL);
xor eax, eax
pop esi
; 398 : }
pop ebp
ret 0
_xmlXPtrNewRange ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrLocationSetMerge
_TEXT SEGMENT
_i$1$ = 8 ; size = 4
_val1$ = 8 ; size = 4
_val2$ = 12 ; size = 4
_xmlXPtrLocationSetMerge PROC ; COMDAT
; 665 : xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2) {
push ebp
mov ebp, esp
push edi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov edi, DWORD PTR _val1$[ebp]
test edi, edi
jne SHORT $LN5@xmlXPtrLoc
; 666 : int i;
; 667 :
; 668 : if (val1 == NULL) return(NULL);
xor eax, eax
pop edi
; 680 : }
pop ebp
ret 0
$LN5@xmlXPtrLoc:
; 669 : if (val2 == NULL) return(val1);
mov eax, DWORD PTR _val2$[ebp]
test eax, eax
je $LN3@xmlXPtrLoc
; 670 :
; 671 : /*
; 672 : * !!!!! this can be optimized a lot, knowing that both
; 673 : * val1 and val2 already have unicity of their values.
; 674 : */
; 675 :
; 676 : for (i = 0;i < val2->locNr;i++)
push esi
xor esi, esi
mov DWORD PTR _i$1$[ebp], esi
cmp DWORD PTR [eax], esi
jle $LN47@xmlXPtrLoc
push ebx
$LL4@xmlXPtrLoc:
; 677 : xmlXPtrLocationSetAdd(val1, val2->locTab[i]);
mov eax, DWORD PTR [eax+8]
mov esi, DWORD PTR [eax+esi*4]
; 615 : if ((cur == NULL) || (val == NULL)) return;
test esi, esi
je $LN2@xmlXPtrLoc
; 616 :
; 617 : /*
; 618 : * check against doublons
; 619 : */
; 620 : for (i = 0;i < cur->locNr;i++) {
mov ebx, DWORD PTR [edi]
xor edx, edx
test ebx, ebx
jle SHORT $LN10@xmlXPtrLoc
; 320 : if (range1->user != range2->user)
mov ebx, DWORD PTR [edi+8]
npad 3
$LL11@xmlXPtrLoc:
; 621 : if (xmlXPtrRangesEqual(cur->locTab[i], val)) {
mov eax, DWORD PTR [ebx]
; 312 : if (range1 == range2)
cmp eax, esi
je SHORT $LN36@xmlXPtrLoc
; 313 : return(1);
; 314 : if ((range1 == NULL) || (range2 == NULL))
test eax, eax
je SHORT $LN24@xmlXPtrLoc
; 315 : return(0);
; 316 : if (range1->type != range2->type)
mov ecx, DWORD PTR [eax]
cmp ecx, DWORD PTR [esi]
jne SHORT $LN24@xmlXPtrLoc
; 317 : return(0);
; 318 : if (range1->type != XPATH_RANGE)
cmp ecx, 6
jne SHORT $LN24@xmlXPtrLoc
; 319 : return(0);
; 320 : if (range1->user != range2->user)
mov ecx, DWORD PTR [eax+28]
cmp ecx, DWORD PTR [esi+28]
jne SHORT $LN24@xmlXPtrLoc
; 321 : return(0);
; 322 : if (range1->index != range2->index)
mov ecx, DWORD PTR [eax+32]
cmp ecx, DWORD PTR [esi+32]
jne SHORT $LN24@xmlXPtrLoc
; 323 : return(0);
; 324 : if (range1->user2 != range2->user2)
mov ecx, DWORD PTR [eax+36]
cmp ecx, DWORD PTR [esi+36]
jne SHORT $LN24@xmlXPtrLoc
; 325 : return(0);
; 326 : if (range1->index2 != range2->index2)
mov eax, DWORD PTR [eax+40]
cmp eax, DWORD PTR [esi+40]
je SHORT $LN36@xmlXPtrLoc
$LN24@xmlXPtrLoc:
; 620 : for (i = 0;i < cur->locNr;i++) {
inc edx
add ebx, 4
cmp edx, DWORD PTR [edi]
jl SHORT $LL11@xmlXPtrLoc
mov ebx, DWORD PTR [edi]
$LN10@xmlXPtrLoc:
; 624 : }
; 625 : }
; 626 :
; 627 : /*
; 628 : * grow the locTab if needed
; 629 : */
; 630 : if (cur->locMax == 0) {
mov eax, DWORD PTR [edi+4]
test eax, eax
jne SHORT $LN15@xmlXPtrLoc
; 631 : cur->locTab = (xmlXPathObjectPtr *) xmlMalloc(XML_RANGESET_DEFAULT *
push 40 ; 00000028H
call DWORD PTR _xmlMalloc
add esp, 4
mov DWORD PTR [edi+8], eax
; 632 : sizeof(xmlXPathObjectPtr));
; 633 : if (cur->locTab == NULL) {
test eax, eax
jne SHORT $LN17@xmlXPtrLoc
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 635 : return;
jmp SHORT $LN2@xmlXPtrLoc
$LN36@xmlXPtrLoc:
; 622 : xmlXPathFreeObject(val);
push esi
call _xmlXPathFreeObject
add esp, 4
; 623 : return;
jmp SHORT $LN2@xmlXPtrLoc
$LN17@xmlXPtrLoc:
xorps xmm0, xmm0
; 636 : }
; 637 : memset(cur->locTab, 0 ,
movups XMMWORD PTR [eax], xmm0
movups XMMWORD PTR [eax+16], xmm0
movq QWORD PTR [eax+32], xmm0
; 638 : XML_RANGESET_DEFAULT * (size_t) sizeof(xmlXPathObjectPtr));
; 639 : cur->locMax = XML_RANGESET_DEFAULT;
mov DWORD PTR [edi+4], 10 ; 0000000aH
jmp SHORT $LN18@xmlXPtrLoc
$LN15@xmlXPtrLoc:
; 640 : } else if (cur->locNr == cur->locMax) {
cmp ebx, eax
jne SHORT $LN18@xmlXPtrLoc
; 641 : xmlXPathObjectPtr *temp;
; 642 :
; 643 : cur->locMax *= 2;
add eax, eax
mov DWORD PTR [edi+4], eax
; 644 : temp = (xmlXPathObjectPtr *) xmlRealloc(cur->locTab, cur->locMax *
shl eax, 2
push eax
push DWORD PTR [edi+8]
call DWORD PTR _xmlRealloc
add esp, 8
; 645 : sizeof(xmlXPathObjectPtr));
; 646 : if (temp == NULL) {
test eax, eax
jne SHORT $LN19@xmlXPtrLoc
; 647 : xmlXPtrErrMemory("adding location to set");
push OFFSET ??_C@_0BH@MIMPNDJH@adding?5location?5to?5set@
call _xmlXPtrErrMemory
add esp, 4
; 648 : return;
jmp SHORT $LN2@xmlXPtrLoc
$LN19@xmlXPtrLoc:
; 649 : }
; 650 : cur->locTab = temp;
mov DWORD PTR [edi+8], eax
$LN18@xmlXPtrLoc:
; 651 : }
; 652 : cur->locTab[cur->locNr++] = val;
mov ecx, DWORD PTR [edi]
mov eax, DWORD PTR [edi+8]
mov DWORD PTR [eax+ecx*4], esi
inc DWORD PTR [edi]
$LN2@xmlXPtrLoc:
; 670 :
; 671 : /*
; 672 : * !!!!! this can be optimized a lot, knowing that both
; 673 : * val1 and val2 already have unicity of their values.
; 674 : */
; 675 :
; 676 : for (i = 0;i < val2->locNr;i++)
mov esi, DWORD PTR _i$1$[ebp]
mov eax, DWORD PTR _val2$[ebp]
inc esi
mov DWORD PTR _i$1$[ebp], esi
cmp esi, DWORD PTR [eax]
jl $LL4@xmlXPtrLoc
pop ebx
$LN47@xmlXPtrLoc:
pop esi
$LN3@xmlXPtrLoc:
; 678 :
; 679 : return(val1);
mov eax, edi
pop edi
; 680 : }
pop ebp
ret 0
_xmlXPtrLocationSetMerge ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrFreeLocationSet
_TEXT SEGMENT
_obj$ = 8 ; size = 4
_xmlXPtrFreeLocationSet PROC ; COMDAT
; 739 : xmlXPtrFreeLocationSet(xmlLocationSetPtr obj) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
mov esi, DWORD PTR _obj$[ebp]
test esi, esi
je SHORT $LN1@xmlXPtrFre
; 740 : int i;
; 741 :
; 742 : if (obj == NULL) return;
; 743 : if (obj->locTab != NULL) {
mov eax, DWORD PTR [esi+8]
test eax, eax
je SHORT $LN6@xmlXPtrFre
; 744 : for (i = 0;i < obj->locNr; i++) {
push edi
xor edi, edi
cmp DWORD PTR [esi], edi
jle SHORT $LN3@xmlXPtrFre
$LL4@xmlXPtrFre:
; 745 : xmlXPathFreeObject(obj->locTab[i]);
mov eax, DWORD PTR [esi+8]
push DWORD PTR [eax+edi*4]
call _xmlXPathFreeObject
inc edi
add esp, 4
cmp edi, DWORD PTR [esi]
jl SHORT $LL4@xmlXPtrFre
mov eax, DWORD PTR [esi+8]
$LN3@xmlXPtrFre:
; 746 : }
; 747 : xmlFree(obj->locTab);
push eax
call DWORD PTR _xmlFree
add esp, 4
pop edi
$LN6@xmlXPtrFre:
; 748 : }
; 749 : xmlFree(obj);
push esi
call DWORD PTR _xmlFree
add esp, 4
$LN1@xmlXPtrFre:
pop esi
; 750 : }
pop ebp
ret 0
_xmlXPtrFreeLocationSet ENDP
_TEXT ENDS
; Function compile flags: /Ogtp
; File c:\users\dag\documents\_clients\codeproject authors group\windows on arm\libxml2\libxml2-2.9.9\xpointer.c
; COMDAT _xmlXPtrLocationSetCreate
_TEXT SEGMENT
_val$ = 8 ; size = 4
_xmlXPtrLocationSetCreate PROC ; COMDAT
; 578 : xmlXPtrLocationSetCreate(xmlXPathObjectPtr val) {
push ebp
mov ebp, esp
push esi
mov ecx, OFFSET __BEF3E6F7_xpointer@c
call @__CheckForDebuggerJustMyCode@4
push 12 ; 0000000cH
call DWORD PTR _xmlMalloc
mov esi, eax
add esp, 4
test esi, esi
jne SHORT $LN2@xmlXPtrLoc
; 80 : __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_XPOINTER,
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push OFFSET ??_C@_0BP@DJFHNAOK@Memory?5allocation?5failed?5?3?5?$CFs?6@
push eax
push eax
push eax
push eax
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
push eax
push eax
push 2
push 2
push 13 ; 0000000dH
push eax
push eax
push eax
push eax
push eax
call ___xmlRaiseError
add esp, 68 ; 00000044H
; 579 : xmlLocationSetPtr ret;
; 580 :
; 581 : ret = (xmlLocationSetPtr) xmlMalloc(sizeof(xmlLocationSet));
; 582 : if (ret == NULL) {
; 583 : xmlXPtrErrMemory("allocating locationset");
; 584 : return(NULL);
xor eax, eax
pop esi
; 601 : }
pop ebp
ret 0
$LN2@xmlXPtrLoc:
push edi
; 585 : }
; 586 : memset(ret, 0 , (size_t) sizeof(xmlLocationSet));
; 587 : if (val != NULL) {
mov edi, DWORD PTR _val$[ebp]
xorps xmm0, xmm0
movq QWORD PTR [esi], xmm0
mov DWORD PTR [esi+8], 0
test edi, edi
je SHORT $LN3@xmlXPtrLoc
; 588 : ret->locTab = (xmlXPathObjectPtr *) xmlMalloc(XML_RANGESET_DEFAULT *
push 40 ; 00000028H
call DWORD PTR _xmlMalloc
add esp, 4
mov DWORD PTR [esi+8], eax
; 589 : sizeof(xmlXPathObjectPtr));
; 590 : if (ret->locTab == NULL) {
test eax, eax
jne SHORT $LN4@xmlXPtrLoc
; 591 : xmlXPtrErrMemory("allocating locationset");
push OFFSET ??_C@_0BH@HNICMPAH@allocating?5locationset@
call _xmlXPtrErrMemory
; 592 : xmlFree(ret);
push esi
call DWORD PTR _xmlFree
add esp, 8
; 593 : return(NULL);
xor eax, eax
pop edi
pop esi
; 601 : }
pop ebp
ret 0
$LN4@xmlXPtrLoc:
xorps xmm0, xmm0
; 594 : }
; 595 : memset(ret->locTab, 0 ,
movups XMMWORD PTR [eax], xmm0
movups XMMWORD PTR [eax+16], xmm0
movq QWORD PTR [eax+32], xmm0
; 596 : XML_RANGESET_DEFAULT * (size_t) sizeof(xmlXPathObjectPtr));
; 597 : ret->locMax = XML_RANGESET_DEFAULT;
; 598 : ret->locTab[ret->locNr++] = val;
mov ecx, DWORD PTR [esi]
mov eax, DWORD PTR [esi+8]
mov DWORD PTR [esi+4], 10 ; 0000000aH
mov DWORD PTR [eax+ecx*4], edi
inc DWORD PTR [esi]
$LN3@xmlXPtrLoc:
; 599 : }
; 600 : return(ret);
pop edi
mov eax, esi
pop esi
; 601 : }
pop ebp
ret 0
_xmlXPtrLocationSetCreate ENDP
_TEXT ENDS
END
|
SVD2ada/svd/stm32_svd-syscfg.ads | JCGobbi/Nucleo-STM32G474RE | 0 | 20232 | <filename>SVD2ada/svd/stm32_svd-syscfg.ads<gh_stars>0
pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32G474xx.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.SYSCFG is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype MEMRMP_MEM_MODE_Field is HAL.UInt3;
-- Remap Memory register
type MEMRMP_Register is record
-- Memory mapping selection
MEM_MODE : MEMRMP_MEM_MODE_Field := 16#0#;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- User Flash Bank mode
FB_mode : Boolean := False;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MEMRMP_Register use record
MEM_MODE at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
FB_mode at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype CFGR1_FPU_IE_Field is HAL.UInt6;
-- peripheral mode configuration register
type CFGR1_Register is record
-- unspecified
Reserved_0_7 : HAL.UInt8 := 16#1#;
-- BOOSTEN
BOOSTEN : Boolean := False;
-- GPIO analog switch control voltage selection
ANASWVDD : Boolean := False;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- FM+ drive capability on PB6
I2C_PB6_FMP : Boolean := False;
-- FM+ drive capability on PB6
I2C_PB7_FMP : Boolean := False;
-- FM+ drive capability on PB6
I2C_PB8_FMP : Boolean := False;
-- FM+ drive capability on PB6
I2C_PB9_FMP : Boolean := False;
-- I2C1 FM+ drive capability enable
I2C1_FMP : Boolean := False;
-- I2C1 FM+ drive capability enable
I2C2_FMP : Boolean := False;
-- I2C1 FM+ drive capability enable
I2C3_FMP : Boolean := False;
-- I2C1 FM+ drive capability enable
I2C4_FMP : Boolean := False;
-- unspecified
Reserved_24_25 : HAL.UInt2 := 16#0#;
-- FPU Interrupts Enable
FPU_IE : CFGR1_FPU_IE_Field := 16#1F#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR1_Register use record
Reserved_0_7 at 0 range 0 .. 7;
BOOSTEN at 0 range 8 .. 8;
ANASWVDD at 0 range 9 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
I2C_PB6_FMP at 0 range 16 .. 16;
I2C_PB7_FMP at 0 range 17 .. 17;
I2C_PB8_FMP at 0 range 18 .. 18;
I2C_PB9_FMP at 0 range 19 .. 19;
I2C1_FMP at 0 range 20 .. 20;
I2C2_FMP at 0 range 21 .. 21;
I2C3_FMP at 0 range 22 .. 22;
I2C4_FMP at 0 range 23 .. 23;
Reserved_24_25 at 0 range 24 .. 25;
FPU_IE at 0 range 26 .. 31;
end record;
-- EXTICR1_EXTI array element
subtype EXTICR1_EXTI_Element is HAL.UInt4;
-- EXTICR1_EXTI array
type EXTICR1_EXTI_Field_Array is array (0 .. 3) of EXTICR1_EXTI_Element
with Component_Size => 4, Size => 16;
-- Type definition for EXTICR1_EXTI
type EXTICR1_EXTI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTI as a value
Val : HAL.UInt16;
when True =>
-- EXTI as an array
Arr : EXTICR1_EXTI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for EXTICR1_EXTI_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- external interrupt configuration register 1
type EXTICR1_Register is record
-- EXTI x configuration (x = 0 to 3)
EXTI : EXTICR1_EXTI_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EXTICR1_Register use record
EXTI at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- EXTICR2_EXTI array element
subtype EXTICR2_EXTI_Element is HAL.UInt4;
-- EXTICR2_EXTI array
type EXTICR2_EXTI_Field_Array is array (4 .. 7) of EXTICR2_EXTI_Element
with Component_Size => 4, Size => 16;
-- Type definition for EXTICR2_EXTI
type EXTICR2_EXTI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTI as a value
Val : HAL.UInt16;
when True =>
-- EXTI as an array
Arr : EXTICR2_EXTI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for EXTICR2_EXTI_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- external interrupt configuration register 2
type EXTICR2_Register is record
-- EXTI x configuration (x = 4 to 7)
EXTI : EXTICR2_EXTI_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EXTICR2_Register use record
EXTI at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- EXTICR3_EXTI array element
subtype EXTICR3_EXTI_Element is HAL.UInt4;
-- EXTICR3_EXTI array
type EXTICR3_EXTI_Field_Array is array (8 .. 11) of EXTICR3_EXTI_Element
with Component_Size => 4, Size => 16;
-- Type definition for EXTICR3_EXTI
type EXTICR3_EXTI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTI as a value
Val : HAL.UInt16;
when True =>
-- EXTI as an array
Arr : EXTICR3_EXTI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for EXTICR3_EXTI_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- external interrupt configuration register 3
type EXTICR3_Register is record
-- EXTI x configuration (x = 8 to 11)
EXTI : EXTICR3_EXTI_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EXTICR3_Register use record
EXTI at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- EXTICR4_EXTI array element
subtype EXTICR4_EXTI_Element is HAL.UInt4;
-- EXTICR4_EXTI array
type EXTICR4_EXTI_Field_Array is array (12 .. 15) of EXTICR4_EXTI_Element
with Component_Size => 4, Size => 16;
-- Type definition for EXTICR4_EXTI
type EXTICR4_EXTI_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- EXTI as a value
Val : HAL.UInt16;
when True =>
-- EXTI as an array
Arr : EXTICR4_EXTI_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for EXTICR4_EXTI_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- external interrupt configuration register 4
type EXTICR4_Register is record
-- EXTI x configuration (x = 12 to 15)
EXTI : EXTICR4_EXTI_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for EXTICR4_Register use record
EXTI at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CCM SRAM control and status register
type SCSR_Register is record
-- CCM SRAM Erase
CCMER : Boolean := False;
-- Read-only. CCM SRAM busy by erase operation
CCMBSY : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SCSR_Register use record
CCMER at 0 range 0 .. 0;
CCMBSY at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- configuration register 2
type CFGR2_Register is record
-- Core Lockup Lock
CLL : Boolean := False;
-- SRAM Parity Lock
SPL : Boolean := False;
-- PVD Lock
PVDL : Boolean := False;
-- ECC Lock
ECCL : Boolean := False;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- SRAM Parity Flag
SPF : Boolean := False;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR2_Register use record
CLL at 0 range 0 .. 0;
SPL at 0 range 1 .. 1;
PVDL at 0 range 2 .. 2;
ECCL at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
SPF at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
-- SRAM Write protection register 1
type SWPR_Register is record
-- Write protection
Page0_WP : Boolean := False;
-- Write protection
Page1_WP : Boolean := False;
-- Write protection
Page2_WP : Boolean := False;
-- Write protection
Page3_WP : Boolean := False;
-- Write protection
Page4_WP : Boolean := False;
-- Write protection
Page5_WP : Boolean := False;
-- Write protection
Page6_WP : Boolean := False;
-- Write protection
Page7_WP : Boolean := False;
-- Write protection
Page8_WP : Boolean := False;
-- Write protection
Page9_WP : Boolean := False;
-- Write protection
Page10_WP : Boolean := False;
-- Write protection
Page11_WP : Boolean := False;
-- Write protection
Page12_WP : Boolean := False;
-- Write protection
Page13_WP : Boolean := False;
-- Write protection
Page14_WP : Boolean := False;
-- Write protection
Page15_WP : Boolean := False;
-- Write protection
Page16_WP : Boolean := False;
-- Write protection
Page17_WP : Boolean := False;
-- Write protection
Page18_WP : Boolean := False;
-- Write protection
Page19_WP : Boolean := False;
-- Write protection
Page20_WP : Boolean := False;
-- Write protection
Page21_WP : Boolean := False;
-- Write protection
Page22_WP : Boolean := False;
-- Write protection
Page23_WP : Boolean := False;
-- Write protection
Page24_WP : Boolean := False;
-- Write protection
Page25_WP : Boolean := False;
-- Write protection
Page26_WP : Boolean := False;
-- Write protection
Page27_WP : Boolean := False;
-- Write protection
Page28_WP : Boolean := False;
-- Write protection
Page29_WP : Boolean := False;
-- Write protection
Page30_WP : Boolean := False;
-- Write protection
Page31_WP : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SWPR_Register use record
Page0_WP at 0 range 0 .. 0;
Page1_WP at 0 range 1 .. 1;
Page2_WP at 0 range 2 .. 2;
Page3_WP at 0 range 3 .. 3;
Page4_WP at 0 range 4 .. 4;
Page5_WP at 0 range 5 .. 5;
Page6_WP at 0 range 6 .. 6;
Page7_WP at 0 range 7 .. 7;
Page8_WP at 0 range 8 .. 8;
Page9_WP at 0 range 9 .. 9;
Page10_WP at 0 range 10 .. 10;
Page11_WP at 0 range 11 .. 11;
Page12_WP at 0 range 12 .. 12;
Page13_WP at 0 range 13 .. 13;
Page14_WP at 0 range 14 .. 14;
Page15_WP at 0 range 15 .. 15;
Page16_WP at 0 range 16 .. 16;
Page17_WP at 0 range 17 .. 17;
Page18_WP at 0 range 18 .. 18;
Page19_WP at 0 range 19 .. 19;
Page20_WP at 0 range 20 .. 20;
Page21_WP at 0 range 21 .. 21;
Page22_WP at 0 range 22 .. 22;
Page23_WP at 0 range 23 .. 23;
Page24_WP at 0 range 24 .. 24;
Page25_WP at 0 range 25 .. 25;
Page26_WP at 0 range 26 .. 26;
Page27_WP at 0 range 27 .. 27;
Page28_WP at 0 range 28 .. 28;
Page29_WP at 0 range 29 .. 29;
Page30_WP at 0 range 30 .. 30;
Page31_WP at 0 range 31 .. 31;
end record;
subtype SKR_KEY_Field is HAL.UInt8;
-- SRAM2 Key Register
type SKR_Register is record
-- Write-only. SRAM2 Key for software erase
KEY : SKR_KEY_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SKR_Register use record
KEY at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- System configuration controller
type SYSCFG_Peripheral is record
-- Remap Memory register
MEMRMP : aliased MEMRMP_Register;
-- peripheral mode configuration register
CFGR1 : aliased CFGR1_Register;
-- external interrupt configuration register 1
EXTICR1 : aliased EXTICR1_Register;
-- external interrupt configuration register 2
EXTICR2 : aliased EXTICR2_Register;
-- external interrupt configuration register 3
EXTICR3 : aliased EXTICR3_Register;
-- external interrupt configuration register 4
EXTICR4 : aliased EXTICR4_Register;
-- CCM SRAM control and status register
SCSR : aliased SCSR_Register;
-- configuration register 2
CFGR2 : aliased CFGR2_Register;
-- SRAM Write protection register 1
SWPR : aliased SWPR_Register;
-- SRAM2 Key Register
SKR : aliased SKR_Register;
end record
with Volatile;
for SYSCFG_Peripheral use record
MEMRMP at 16#0# range 0 .. 31;
CFGR1 at 16#4# range 0 .. 31;
EXTICR1 at 16#8# range 0 .. 31;
EXTICR2 at 16#C# range 0 .. 31;
EXTICR3 at 16#10# range 0 .. 31;
EXTICR4 at 16#14# range 0 .. 31;
SCSR at 16#18# range 0 .. 31;
CFGR2 at 16#1C# range 0 .. 31;
SWPR at 16#20# range 0 .. 31;
SKR at 16#24# range 0 .. 31;
end record;
-- System configuration controller
SYSCFG_Periph : aliased SYSCFG_Peripheral
with Import, Address => SYSCFG_Base;
end STM32_SVD.SYSCFG;
|
Task/Evaluate-binomial-coefficients/AppleScript/evaluate-binomial-coefficients-1.applescript | LaudateCorpus1/RosettaCodeData | 1 | 1121 | <reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Evaluate-binomial-coefficients/AppleScript/evaluate-binomial-coefficients-1.applescript<gh_stars>1-10
set n to 5
set k to 3
on calculateFactorial(val)
set partial_factorial to 1 as integer
repeat with i from 1 to val
set factorial to i * partial_factorial
set partial_factorial to factorial
end repeat
return factorial
end calculateFactorial
set n_factorial to calculateFactorial(n)
set k_factorial to calculateFactorial(k)
set n_minus_k_factorial to calculateFactorial(n - k)
return n_factorial / (n_minus_k_factorial) * 1 / (k_factorial) as integer
|
python_src/other/export/screen_4_1.asm | fjpena/sword-of-ianna-msx2 | 43 | 20330 | org $0000
; Object types
OBJECT_NONE EQU 0
OBJECT_SWITCH EQU 1
OBJECT_DOOR EQU 2
OBJECT_DOOR_DESTROY EQU 3
OBJECT_FLOOR_DESTROY EQU 4
OBJECT_WALL_DESTROY EQU 5
OBJECT_BOX_LEFT EQU 6
OBJECT_BOX_RIGHT EQU 7
OBJECT_JAR EQU 8
OBJECT_TELEPORTER EQU 9
; Pickable object types
OBJECT_KEY_GREEN EQU 11
OBJECT_KEY_BLUE EQU 12
OBJECT_KEY_YELLOW EQU 13
OBJECT_BREAD EQU 14
OBJECT_MEAT EQU 15
OBJECT_HEALTH EQU 16
OBJECT_KEY_RED EQU 17
OBJECT_KEY_WHITE EQU 18
OBJECT_KEY_PURPLE EQU 19
; Object types for enemies
OBJECT_ENEMY_SKELETON EQU 20
OBJECT_ENEMY_ORC EQU 21
OBJECT_ENEMY_MUMMY EQU 22
OBJECT_ENEMY_TROLL EQU 23
OBJECT_ENEMY_ROCK EQU 24
OBJECT_ENEMY_KNIGHT EQU 25
OBJECT_ENEMY_DALGURAK EQU 26
OBJECT_ENEMY_GOLEM EQU 27
OBJECT_ENEMY_OGRE EQU 28
OBJECT_ENEMY_MINOTAUR EQU 29
OBJECT_ENEMY_DEMON EQU 30
OBJECT_ENEMY_SECONDARY EQU 31
Screen_4_1:
DB 2, 1, 2, 3, 4, 5, 6, 7, 2, 2, 2, 3, 4, 5, 6, 7
DB 2, 2, 2, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 250, 2, 2
DB 4, 5, 80, 81, 2, 2, 2, 2, 89, 90, 2, 2, 80, 81, 2, 2
DB 2, 249, 75, 34, 89, 90, 89, 90, 66, 34, 89, 90, 66, 34, 89, 93
DB 2, 108, 60, 44, 29, 30, 31, 0, 66, 30, 31, 0, 29, 146, 0, 60
DB 9, 2, 59, 0, 18, 5, 6, 29, 65, 3, 4, 66, 0, 0, 147, 75
DB 33, 9, 63, 49, 50, 182, 42, 49, 50, 132, 168, 49, 50, 0, 146, 0
DB 33, 34, 59, 252, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DB 34, 33, 64, 22, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DB 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15
HardScreen_4_1:
DB 85, 85, 85, 85
DB 85, 85, 85, 85
DB 85, 85, 85, 85
DB 85, 85, 85, 85
DB 85, 85, 85, 85
DB 85, 85, 85, 85
DB 85, 80, 0, 0
DB 85, 80, 0, 0
DB 85, 80, 0, 0
DB 85, 85, 85, 85
Obj_4_1:
DB 1 ; PLAYER
DB 3, OBJECT_ENEMY_MUMMY, 6, 7, 1, 33
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY ENEMY
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
|
source/nodes/program-nodes-real_range_specifications.adb | reznikmm/gela | 0 | 20423 | -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Real_Range_Specifications is
function Create
(Range_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Double_Dot_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access)
return Real_Range_Specification is
begin
return Result : Real_Range_Specification :=
(Range_Token => Range_Token, Lower_Bound => Lower_Bound,
Double_Dot_Token => Double_Dot_Token, Upper_Bound => Upper_Bound,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Real_Range_Specification is
begin
return Result : Implicit_Real_Range_Specification :=
(Lower_Bound => Lower_Bound, Upper_Bound => Upper_Bound,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Lower_Bound
(Self : Base_Real_Range_Specification)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Lower_Bound;
end Lower_Bound;
overriding function Upper_Bound
(Self : Base_Real_Range_Specification)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Upper_Bound;
end Upper_Bound;
overriding function Range_Token
(Self : Real_Range_Specification)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Range_Token;
end Range_Token;
overriding function Double_Dot_Token
(Self : Real_Range_Specification)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Double_Dot_Token;
end Double_Dot_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Real_Range_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Real_Range_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Real_Range_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Real_Range_Specification'Class) is
begin
Set_Enclosing_Element (Self.Lower_Bound, Self'Unchecked_Access);
Set_Enclosing_Element (Self.Upper_Bound, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Real_Range_Specification
(Self : Base_Real_Range_Specification)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Real_Range_Specification;
overriding function Is_Definition
(Self : Base_Real_Range_Specification)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Definition;
overriding procedure Visit
(Self : not null access Base_Real_Range_Specification;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Real_Range_Specification (Self);
end Visit;
overriding function To_Real_Range_Specification_Text
(Self : in out Real_Range_Specification)
return Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Text_Access is
begin
return Self'Unchecked_Access;
end To_Real_Range_Specification_Text;
overriding function To_Real_Range_Specification_Text
(Self : in out Implicit_Real_Range_Specification)
return Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Real_Range_Specification_Text;
end Program.Nodes.Real_Range_Specifications;
|
oeis/092/A092526.asm | neoneye/loda-programs | 11 | 84492 | ; A092526: Decimal expansion of (2/3)*cos( (1/3)*arccos(29/2) ) + 1/3, the real root of x^3 - x^2 - 1.
; Submitted by <NAME>
; 1,4,6,5,5,7,1,2,3,1,8,7,6,7,6,8,0,2,6,6,5,6,7,3,1,2,2,5,2,1,9,9,3,9,1,0,8,0,2,5,5,7,7,5,6,8,4,7,2,2,8,5,7,0,1,6,4,3,1,8,3,1,1,1,2,4,9,2,6,2,9,9,6,6,8,5,0,1,7,8,4,0,4,7,8,1,2,5,8,0,1,1,9,4,9,0,9,2,7,0
mov $1,1
mov $2,1
mov $3,$0
mul $3,4
lpb $3
add $1,$2
add $2,$1
pow $2,2
div $2,$1
add $5,$1
mov $1,$5
sub $3,1
lpe
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
|
programs/oeis/049/A049691.asm | neoneye/loda | 22 | 10208 | <gh_stars>10-100
; A049691: a(n)=T(n,n), array T as in A049687. Also a(n)=T(2n,2n), array T given by A049639.
; 0,3,5,9,13,21,25,37,45,57,65,85,93,117,129,145,161,193,205,241,257,281,301,345,361,401,425,461,485,541,557,617,649,689,721,769,793,865,901,949,981,1061,1085,1169,1209,1257,1301,1393,1425,1509,1549,1613,1661,1765,1801,1881,1929,2001,2057,2173,2205,2325,2385,2457,2521,2617,2657,2789,2853,2941,2989,3129,3177,3321,3393,3473,3545,3665,3713,3869,3933,4041,4121,4285,4333,4461,4545,4657,4737,4913,4961,5105,5193,5313,5405,5549,5613,5805,5889,6009
mov $2,$0
seq $0,49696 ; a(n)=T(n,n), array T as in A049695.
min $2,1
add $0,$2
|
src/test/resources/testData/parse/handlers/direct_parameters.scpt | stigger/AppleScript-IDEA | 18 | 4345 | <reponame>stigger/AppleScript-IDEA<filename>src/test/resources/testData/parse/handlers/direct_parameters.scpt
on run argv
return "hello, " & item 1 of argv & "."
end run
on run {input, parameters}
set upperCaseString to ""
repeat with i in input
if (ASCII number i) > 96 and (ASCII number i) < 123 then
set upperCaseString to upperCaseString & (ASCII character ((ASCII number i) - 32))
else
set upperCaseString to upperCaseString & (ASCII character (ASCII number i))
end if
end repeat
return upperCaseString
end run |
deps/gmp.js/mpn/x86_64/divrem_2.asm | 6un9-h0-Dan/cobaul | 184 | 8168 | <gh_stars>100-1000
dnl x86-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
dnl Copyright 2007, 2008, 2010 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 3 of the License, or (at
dnl your option) any later version.
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C norm frac
C K8 20 20
C P4 73 73
C P6 core2 37 37
C P6 corei7 33 33
C TODO
C * Perhaps compute the inverse without relying on divq? Could either use
C Newton's method and mulq, or perhaps the faster fdiv.
C * The loop has not been carefully tuned, nor analysed for critical path
C length. It seems that 20 c/l is a bit long, compared to the 13 c/l for
C mpn_divrem_1.
C * Clean up. This code is really crude.
C INPUT PARAMETERS
define(`qp', `%rdi')
define(`fn', `%rsi')
define(`up_param', `%rdx')
define(`un_param', `%rcx')
define(`dp', `%r8')
define(`dinv', `%r9')
C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15
C cnt qp d dinv
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_divrem_2)
push %r15
lea (%rdx,%rcx,8), %rax
push %r14
push %r13
mov %rsi, %r13
push %r12
lea -24(%rax), %r12
push %rbp
mov %rdi, %rbp
push %rbx
mov 8(%r8), %r11
mov -8(%rax), %r9
mov (%r8), %r8
mov -16(%rax), %r10
xor R32(%r15), R32(%r15)
cmp %r9, %r11
ja L(2)
setb %dl
cmp %r10, %r8
setbe %al
orb %al, %dl
jne L(23)
L(2):
lea -3(%rcx,%r13), %rbx C un + fn - 3
test %rbx, %rbx
js L(6)
mov %r11, %rdx
mov $-1, %rax
not %rdx
div %r11
mov %r11, %rdx
mov %rax, %rdi
imul %rax, %rdx
mov %rdx, %r14
mul %r8
mov %rdx, %rcx
mov $-1, %rdx
add %r8, %r14
adc $0, %rdx
add %rcx, %r14
adc $0, %rdx
js L(8)
L(18):
dec %rdi
sub %r11, %r14
sbb $0, %rdx
jns L(18)
L(8):
C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15
C n2 un n1 dinv qp d0 d1 up fn msl
C n2 un -d1 n1 dinv XX XX
ifdef(`NEW',`
lea (%rbp,%rbx,8), %rbp
mov %rbx, %rcx C un
mov %r9, %rbx
mov %rdi, %r9 C di
mov %r10, %r14
mov %r11, %rsi
neg %rsi C -d1
ALIGN(16)
L(loop):
mov %r9, %rax C di ncp
mul %rbx C 0, 18
add %r14, %rax C 4
mov %rax, %r10 C q0 5
adc %rbx, %rdx C 5
mov %rdx, %rdi C q 6
imul %rsi, %rdx C 6
mov %r8, %rax C ncp
lea (%rdx, %r14), %rbx C n1 -= ... 7
mul %rdi C 7
xor R32(%r14), R32(%r14) C
cmp %rcx, %r13 C
jg L(19) C
mov (%r12), %r14 C
sub $8, %r12 C
L(19): sub %r8, %r14 C ncp
sbb %r11, %rbx C 9
sub %rax, %r14 C 11
sbb %rdx, %rbx C 12
inc %rdi C 7
xor R32(%rdx), R32(%rdx) C
cmp %r10, %rbx C 13
mov %r8, %rax C d0 ncp
adc $-1, %rdx C mask 14
add %rdx, %rdi C q-- 15
and %rdx, %rax C d0 or 0 15
and %r11, %rdx C d1 or 0 15
add %rax, %r14 C 16
adc %rdx, %rbx C 16
cmp %r11, %rbx C 17
jae L(fix) C
L(bck): mov %rdi, (%rbp) C
sub $8, %rbp C
dec %rcx
jns L(loop)
mov %r14, %r10
mov %rbx, %r9
',`
lea (%rbp,%rbx,8), %rbp
mov %rbx, %rcx
mov %r9, %rax
mov %r10, %rsi
ALIGN(16)
L(loop):
mov %rax, %r14 C 0, 19
mul %rdi C 0
mov %r11, %r9 C 1
add %rsi, %rax C 4
mov %rax, %rbx C q0 5
adc %r14, %rdx C q 5
lea 1(%rdx), %r10 C 6
mov %rdx, %rax C 6
imul %rdx, %r9 C 6
sub %r9, %rsi C 10
xor R32(%r9), R32(%r9) C
mul %r8 C 7
cmp %rcx, %r13 C
jg L(13) C
mov (%r12), %r9 C
sub $8, %r12 C
L(13): sub %r8, %r9 C ncp
sbb %r11, %rsi C 11
sub %rax, %r9 C 11
sbb %rdx, %rsi C 12
cmp %rbx, %rsi C 13
sbb %rax, %rax C 14
not %rax C 15
add %rax, %r10 C 16
mov %r8, %rbx C ncp
and %rax, %rbx C 16
and %r11, %rax C 16
add %rbx, %r9 C 17
adc %rsi, %rax C 18
cmp %rax, %r11 C 19
jbe L(fix) C
L(bck): mov %r10, (%rbp) C
sub $8, %rbp C
mov %r9, %rsi C 18
dec %rcx
jns L(loop)
mov %rsi, %r10
mov %rax, %r9
')
L(6):
mov %r10, 8(%r12)
mov %r9, 16(%r12)
pop %rbx
pop %rbp
pop %r12
pop %r13
pop %r14
mov %r15, %rax
pop %r15
ret
L(23): inc R32(%r15)
sub %r8, %r10
sbb %r11, %r9
jmp L(2)
ifdef(`NEW',`
L(fix): seta %dl
cmp %r8, %r14
setae %al
orb %dl, %al
je L(bck)
inc %rdi
sub %r8, %r14
sbb %r11, %rbx
jmp L(bck)
',`
L(fix): jb L(88)
cmp %r8, %r9
jb L(bck)
L(88): inc %r10
sub %r8, %r9
sbb %r11, %rax
jmp L(bck)
')
EPILOGUE()
|
Source/Shared/ntuser/StubNtUserOpenWindowStation.asm | supermanc88/WinObjEx64 | 1 | 101950 | ;*******************************************************************************
;
; (C) COPYRIGHT AUTHORS, 2018
;
; TITLE: StubNtUserOpenWindowStation.asm
;
; VERSION: 1.00
;
; DATE: 30 Nov 2018
;
; win32u NtUserOpenWindowStation implementation.
;
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
; TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
; PARTICULAR PURPOSE.
;
;*******************************************************************************/
public dwNtUserOpenWindowStation
_DATA$00 SEGMENT PARA 'DATA'
dwNtUserOpenWindowStation label dword
dd 0
_DATA$00 ENDS
public StubNtUserOpenWindowStation
_TEXT$00 segment para 'CODE'
ALIGN 16
PUBLIC StubNtUserOpenWindowStation
StubNtUserOpenWindowStation PROC
mov r10, rcx
mov eax, dwNtUserOpenWindowStation
syscall
ret
StubNtUserOpenWindowStation ENDP
_TEXT$00 ENDS
END
|
alloy4fun_models/trashltl/models/11/MqGoFEhDEbRDvQmf9.als | Kaixi26/org.alloytools.alloy | 0 | 206 | open main
pred idMqGoFEhDEbRDvQmf9_prop12 {
all f : File | eventually f in Trash => eventually f not in Trash
}
pred __repair { idMqGoFEhDEbRDvQmf9_prop12 }
check __repair { idMqGoFEhDEbRDvQmf9_prop12 <=> prop12o } |
libsrc/_DEVELOPMENT/target/zx/driver/terminal/zx_01_output_char_64_tty_z88dk/zx_01_output_char_64_tty_z88dk_oterm_msg_tty.asm | jpoikela/z88dk | 640 | 243030 | <reponame>jpoikela/z88dk
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC zx_01_output_char_64_tty_z88dk_oterm_msg_tty
EXTERN l_offset_ix_de, zx_tty_z88dk_state_table
EXTERN asm_tty_execute_action, l_jphl
zx_01_output_char_64_tty_z88dk_oterm_msg_tty:
; implement tty emulation
;
; enter : c = char to output
; exit : c = char to output (possibly modified)
; carry reset if tty emulation absorbs char
; can use: af, bc, de, hl
ld hl,26
call l_offset_ix_de ; hl = & tty_state
; hl = & tty
; c = ascii char
ld de,zx_tty_z88dk_state_table
call l_jphl ; execute tty
ret c ; if producing a char for the terminal
; a = action code
; de = & parameters
ld hl,action_table
jp asm_tty_execute_action
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ACTION TABLE FOR TTY_Z88DK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EXTERN error_einval_znc
EXTERN zx_01_output_char_32_tty_z88dk_01_scroll
EXTERN zx_01_output_char_32_tty_z88dk_02_font_address
EXTERN zx_01_output_char_32_tty_z88dk_08_backspace
EXTERN zx_01_output_char_32_tty_z88dk_09_tab
EXTERN zx_01_output_char_32_tty_z88dk_11_home
EXTERN zx_01_output_char_64_tty_z88dk_12_cls
EXTERN zx_01_output_char_32_tty_z88dk_14_foreground_mask
EXTERN zx_01_output_char_32_tty_z88dk_15_background_attr
EXTERN zx_01_output_char_32_tty_z88dk_16_ink
EXTERN zx_01_output_char_32_tty_z88dk_17_paper
EXTERN zx_01_output_char_32_tty_z88dk_18_flash
EXTERN zx_01_output_char_32_tty_z88dk_19_bright
EXTERN zx_01_output_char_32_tty_z88dk_20_inverse
EXTERN zx_01_output_char_32_tty_z88dk_21_foreground_attr
EXTERN zx_01_output_char_32_tty_z88dk_22_at
EXTERN zx_01_output_char_32_tty_z88dk_23_atr
EXTERN zx_01_output_char_32_tty_z88dk_27_escape
EXTERN zx_01_output_char_32_tty_z88dk_28_left
EXTERN zx_01_output_char_32_tty_z88dk_29_right
EXTERN zx_01_output_char_32_tty_z88dk_30_up
EXTERN zx_01_output_char_32_tty_z88dk_31_down
action_table:
defw zx_01_output_char_32_tty_z88dk_01_scroll
defw zx_01_output_char_32_tty_z88dk_02_font_address
defw error_einval_znc
defw error_einval_znc
defw error_einval_znc
defw error_einval_znc
defw error_einval_znc
defw zx_01_output_char_32_tty_z88dk_08_backspace
defw zx_01_output_char_32_tty_z88dk_09_tab
defw error_einval_znc
defw zx_01_output_char_32_tty_z88dk_11_home
defw zx_01_output_char_64_tty_z88dk_12_cls
defw error_einval_znc
defw zx_01_output_char_32_tty_z88dk_14_foreground_mask ; [ 14 = foreground mask ]
defw zx_01_output_char_32_tty_z88dk_15_background_attr ; [ 15 = background attr ]
defw zx_01_output_char_32_tty_z88dk_16_ink ; [ 16 = ink 0..7 ]
defw zx_01_output_char_32_tty_z88dk_17_paper ; [ 17 = paper 0..7 ]
defw zx_01_output_char_32_tty_z88dk_18_flash ; [ 18 = flash 0..1 ]
defw zx_01_output_char_32_tty_z88dk_19_bright ; [ 19 = bright 0..1 ]
defw zx_01_output_char_32_tty_z88dk_20_inverse ; [ 20 = inverse 0..1 ]
defw zx_01_output_char_32_tty_z88dk_21_foreground_attr ; [ 21 = foreground attr ]
defw zx_01_output_char_32_tty_z88dk_22_at
defw zx_01_output_char_32_tty_z88dk_23_atr
defw error_einval_znc
defw error_einval_znc
defw error_einval_znc
defw zx_01_output_char_32_tty_z88dk_27_escape
defw zx_01_output_char_32_tty_z88dk_28_left
defw zx_01_output_char_32_tty_z88dk_29_right
defw zx_01_output_char_32_tty_z88dk_30_up
defw zx_01_output_char_32_tty_z88dk_31_down
|
src/tutorialspoint.com/src/example10.asm | ishirshov/NASM-tutorial-for-Unix | 0 | 245941 | %include "defines.inc"
section .bss
result resb 1
section .text
global _start
_start:
mov al, 5
mov bl, 3
or al, bl
add al, byte '0'
mov [result], al
mov ecx, result
mov edx, 1
print_stdout:
mov eax, SYS_WRITE
mov ebx, STDOUT
int 80h
sys_exit
|
8086/1arith/sub.asm | iamvk1437k/mpmc | 1 | 4820 | <reponame>iamvk1437k/mpmc
MOV AL,09H ; Load immediate data 09H to register AL
MOV BL,06H ; Load immediate data to register BL
SUB AL, BL ; AL=AL-BL |
src/Fragment/Setoid/Morphism.agda | yallop/agda-fragment | 18 | 6626 | <filename>src/Fragment/Setoid/Morphism.agda
{-# OPTIONS --without-K --exact-split --safe #-}
module Fragment.Setoid.Morphism where
open import Fragment.Setoid.Morphism.Base public
open import Fragment.Setoid.Morphism.Setoid public
open import Fragment.Setoid.Morphism.Properties public
|
ADL/devices/stm32-rcc.adb | JCGobbi/Nucleo-STM32H743ZI | 0 | 8186 | <filename>ADL/devices/stm32-rcc.adb<gh_stars>0
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, 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. --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with STM32_SVD.RCC; use STM32_SVD.RCC;
with STM32_SVD.PWR; use STM32_SVD.PWR;
with STM32_SVD.SYSCFG; use STM32_SVD.SYSCFG;
with STM32_SVD.Flash; use STM32_SVD.Flash;
package body STM32.RCC is
function To_AHB1RSTR_T is new Ada.Unchecked_Conversion
(UInt32, AHB1RSTR_Register);
function To_AHB2RSTR_T is new Ada.Unchecked_Conversion
(UInt32, AHB2RSTR_Register);
function To_AHB3RSTR_T is new Ada.Unchecked_Conversion
(UInt32, AHB3RSTR_Register);
function To_AHB4RSTR_T is new Ada.Unchecked_Conversion
(UInt32, AHB4RSTR_Register);
function To_APB1LRSTR_T is new Ada.Unchecked_Conversion
(UInt32, APB1LRSTR_Register);
function To_APB1HRSTR_T is new Ada.Unchecked_Conversion
(UInt32, APB1HRSTR_Register);
function To_APB2RSTR_T is new Ada.Unchecked_Conversion
(UInt32, APB2RSTR_Register);
function To_APB3RSTR_T is new Ada.Unchecked_Conversion
(UInt32, APB3RSTR_Register);
function To_APB4RSTR_T is new Ada.Unchecked_Conversion
(UInt32, APB4RSTR_Register);
---------------------------------------------------------------------------
------- Enable/Disable/Reset Routines -----------------------------------
---------------------------------------------------------------------------
procedure AHB_Force_Reset is
begin
RCC_Periph.AHB1RSTR := To_AHB1RSTR_T (16#FFFF_FFFF#);
RCC_Periph.AHB2RSTR := To_AHB2RSTR_T (16#FFFF_FFFF#);
RCC_Periph.AHB3RSTR := To_AHB3RSTR_T (16#FFFF_FFFF#);
RCC_Periph.AHB4RSTR := To_AHB4RSTR_T (16#FFFF_FFFF#);
end AHB_Force_Reset;
procedure AHB_Release_Reset is
begin
RCC_Periph.AHB1RSTR := To_AHB1RSTR_T (0);
RCC_Periph.AHB2RSTR := To_AHB2RSTR_T (0);
RCC_Periph.AHB3RSTR := To_AHB3RSTR_T (0);
RCC_Periph.AHB4RSTR := To_AHB4RSTR_T (0);
end AHB_Release_Reset;
procedure APB1_Force_Reset is
begin
RCC_Periph.APB1LRSTR := To_APB1LRSTR_T (16#FFFF_FFFF#);
RCC_Periph.APB1HRSTR := To_APB1HRSTR_T (16#FFFF_FFFF#);
end APB1_Force_Reset;
procedure APB1_Release_Reset is
begin
RCC_Periph.APB1LRSTR := To_APB1LRSTR_T (0);
RCC_Periph.APB1HRSTR := To_APB1HRSTR_T (0);
end APB1_Release_Reset;
procedure APB2_Force_Reset is
begin
RCC_Periph.APB2RSTR := To_APB2RSTR_T (16#FFFF_FFFF#);
end APB2_Force_Reset;
procedure APB2_Release_Reset is
begin
RCC_Periph.APB2RSTR := To_APB2RSTR_T (0);
end APB2_Release_Reset;
procedure APB3_Force_Reset is
begin
RCC_Periph.APB3RSTR := To_APB3RSTR_T (16#FFFF_FFFF#);
end APB3_Force_Reset;
procedure APB3_Release_Reset is
begin
RCC_Periph.APB3RSTR := To_APB3RSTR_T (0);
end APB3_Release_Reset;
procedure APB4_Force_Reset is
begin
RCC_Periph.APB4RSTR := To_APB4RSTR_T (16#FFFF_FFFF#);
end APB4_Force_Reset;
procedure APB4_Release_Reset is
begin
RCC_Periph.APB4RSTR := To_APB4RSTR_T (0);
end APB4_Release_Reset;
procedure Backup_Domain_Reset is
begin
RCC_Periph.BDCR.BDRST := True;
RCC_Periph.BDCR.BDRST := False;
end Backup_Domain_Reset;
---------------------------------------------------------------------------
-- Clock Configuration --------------------------------------------------
---------------------------------------------------------------------------
-------------------
-- Set_HSE Clock --
-------------------
procedure Set_HSE_Clock
(Enable : Boolean;
Bypass : Boolean := False;
Enable_CSS : Boolean := False)
is
begin
if Enable and not RCC_Periph.CR.HSEON then
RCC_Periph.CR.HSEON := True;
loop
exit when RCC_Periph.CR.HSERDY;
end loop;
end if;
RCC_Periph.CR.HSEBYP := Bypass;
RCC_Periph.CR.HSECSSON := Enable_CSS;
end Set_HSE_Clock;
-----------------------
-- HSE Clock_Enabled --
-----------------------
function HSE_Clock_Enabled return Boolean is
begin
return RCC_Periph.CR.HSEON;
end HSE_Clock_Enabled;
-------------------
-- Set_LSE Clock --
-------------------
procedure Set_LSE_Clock
(Enable : Boolean;
Bypass : Boolean := False;
Enable_CSS : Boolean := False;
Capability : HSE_Capability)
is
begin
if Enable and not RCC_Periph.BDCR.LSEON then
RCC_Periph.BDCR.LSEON := True;
loop
exit when RCC_Periph.BDCR.LSERDY;
end loop;
end if;
RCC_Periph.BDCR.LSEBYP := Bypass;
RCC_Periph.BDCR.LSECSSON := Enable_CSS;
RCC_Periph.BDCR.LSEDRV := Capability'Enum_Rep;
end Set_LSE_Clock;
-----------------------
-- LSE Clock_Enabled --
-----------------------
function LSE_Clock_Enabled return Boolean is
begin
return RCC_Periph.BDCR.LSEON;
end LSE_Clock_Enabled;
-------------------
-- Set_HSI_Clock --
-------------------
procedure Set_HSI_Clock
(Enable : Boolean;
Value : HSI_Prescaler)
is
begin
if Enable then
if not RCC_Periph.CR.HSION then
RCC_Periph.CR.HSION := True;
loop
exit when RCC_Periph.CR.HSIRDY;
end loop;
end if;
RCC_Periph.CR.HSIDIV := Value'Enum_Rep;
loop
exit when RCC_Periph.CR.HSIDIVF;
end loop;
else
RCC_Periph.CR.HSION := False;
end if;
end Set_HSI_Clock;
-----------------------
-- HSI_Clock_Enabled --
-----------------------
function HSI_Clock_Enabled return Boolean is
begin
return RCC_Periph.CR.HSION;
end HSI_Clock_Enabled;
---------------------
-- Set_HSI48 Clock --
---------------------
procedure Set_HSI48_Clock (Enable : Boolean) is
begin
if Enable and not RCC_Periph.CR.HSI48ON then
RCC_Periph.CR.HSI48ON := True;
loop
exit when RCC_Periph.CR.HSI48RDY;
end loop;
end if;
end Set_HSI48_Clock;
-------------------------
-- HSI48 Clock_Enabled --
-------------------------
function HSI48_Clock_Enabled return Boolean is
begin
return RCC_Periph.CR.HSI48ON;
end HSI48_Clock_Enabled;
-------------------
-- Set_LSI Clock --
-------------------
procedure Set_LSI_Clock (Enable : Boolean) is
begin
if Enable and not RCC_Periph.CSR.LSION then
RCC_Periph.CSR.LSION := True;
loop
exit when RCC_Periph.CSR.LSIRDY;
end loop;
end if;
end Set_LSI_Clock;
-----------------------
-- LSI Clock_Enabled --
-----------------------
function LSI_Clock_Enabled return Boolean is
begin
return RCC_Periph.CSR.LSION;
end LSI_Clock_Enabled;
-------------------
-- Set_CSI Clock --
-------------------
procedure Set_CSI_Clock (Enable : Boolean) is
begin
if Enable and not RCC_Periph.CR.CSION then
RCC_Periph.CR.CSION := True;
loop
exit when RCC_Periph.CR.CSIRDY;
end loop;
end if;
end Set_CSI_Clock;
-----------------------
-- CSI Clock_Enabled --
-----------------------
function CSI_Clock_Enabled return Boolean is
begin
return RCC_Periph.CR.CSION;
end CSI_Clock_Enabled;
--------------------------------
-- Configure_System_Clock_Mux --
--------------------------------
procedure Configure_System_Clock_Mux (Source : SYSCLK_Clock_Source)
is
begin
RCC_Periph.CFGR.SW := Source'Enum_Rep;
loop
exit when RCC_Periph.CFGR.SWS = Source'Enum_Rep;
end loop;
end Configure_System_Clock_Mux;
-----------------------------------
-- Configure_AHB_Clock_Prescaler --
-----------------------------------
procedure Configure_AHB_Clock_Prescaler
(Bus : AHB_Clock_Range;
Value : AHB_Prescaler)
is
function To_AHB is new Ada.Unchecked_Conversion
(AHB_Prescaler, UInt4);
begin
case Bus is
when AHB_1 =>
RCC_Periph.D1CFGR.D1CPRE := To_AHB (Value);
when AHB_2 =>
RCC_Periph.D1CFGR.HPRE := To_AHB (Value);
end case;
end Configure_AHB_Clock_Prescaler;
-----------------------------------
-- Configure_APB_Clock_Prescaler --
-----------------------------------
procedure Configure_APB_Clock_Prescaler
(Bus : APB_Clock_Range;
Value : APB_Prescaler)
is
function To_APB is new Ada.Unchecked_Conversion
(APB_Prescaler, UInt3);
begin
case Bus is
when APB_1 =>
RCC_Periph.D2CFGR.D2PPRE1 := To_APB (Value);
when APB_2 =>
RCC_Periph.D2CFGR.D2PPRE2 := To_APB (Value);
when APB_3 =>
RCC_Periph.D1CFGR.D1PPRE := To_APB (Value);
when APB_4 =>
RCC_Periph.D3CFGR.D3PPRE := To_APB (Value);
end case;
end Configure_APB_Clock_Prescaler;
------------------------------
-- Configure_PLL_Source_Mux --
------------------------------
procedure Configure_PLL_Source_Mux (Source : PLL_Clock_Source) is
begin
RCC_Periph.PLLCKSELR.PLLSRC := Source'Enum_Rep;
end Configure_PLL_Source_Mux;
-------------------
-- Configure_PLL --
-------------------
procedure Configure_PLL
(PLL : PLL_Range;
Enable : Boolean;
Fractional_Mode : Boolean;
Fraction : UInt13 := 16#0#;
PLLM : PLLM_Range;
PLLN : PLLN_Range;
PLLP : PLLP_Range;
Enable_Output_P : Boolean;
PLLQ : PLLQ_Range;
Enable_Output_Q : Boolean;
PLLR : PLLR_Range;
Enable_Output_R : Boolean;
Input : PLL_Input_Frequency;
VCO : PLL_VCO_Selector)
is
begin
case PLL is
when PLL_1 =>
-- Disable the main PLL before configuring it
RCC_Periph.CR.PLL1ON := False;
if Enable then
-- Configure multiplication and division factors
RCC_Periph.PLLCKSELR.DIVM1 := UInt6 (PLLM);
if Fractional_Mode then
RCC_Periph.PLL1FRACR.FRACN1 := Fraction;
end if;
RCC_Periph.PLLCFGR :=
(PLL1VCOSEL => VCO = Medium_150_To_420MHz,
PLL1RGE => Input'Enum_Rep,
PLL1FRACEN => Fractional_Mode,
DIVP1EN => Enable_Output_P,
DIVQ1EN => Enable_Output_Q,
DIVR1EN => Enable_Output_R,
others => <>);
RCC_Periph.PLL1DIVR :=
(DIVN1 => UInt9 (PLLN - 1),
DIVP1 => UInt7 (PLLP - 1),
DIVQ1 => UInt7 (PLLQ - 1),
DIVR1 => UInt7 (PLLR - 1),
others => <>);
-- Setup PLL and wait for stabilization.
RCC_Periph.CR.PLL1ON := Enable;
loop
exit when RCC_Periph.CR.PLL1RDY;
end loop;
end if;
when PLL_2 =>
-- Disable the main PLL before configuring it
RCC_Periph.CR.PLL2ON := False;
if Enable then
-- Configure multiplication and division factors
RCC_Periph.PLLCKSELR.DIVM2 := UInt6 (PLLM);
if Fractional_Mode then
RCC_Periph.PLL2FRACR.FRACN2 := Fraction;
end if;
RCC_Periph.PLLCFGR :=
(PLL2VCOSEL => VCO = Medium_150_To_420MHz,
PLL2RGE => Input'Enum_Rep,
PLL2FRACEN => Fractional_Mode,
DIVP2EN => Enable_Output_P,
DIVQ2EN => Enable_Output_Q,
DIVR2EN => Enable_Output_R,
others => <>);
RCC_Periph.PLL2DIVR :=
(DIVN2 => UInt9 (PLLN - 1),
DIVP2 => UInt7 (PLLP - 1),
DIVQ2 => UInt7 (PLLQ - 1),
DIVR2 => UInt7 (PLLR - 1),
others => <>);
-- Setup PLL and wait for stabilization.
RCC_Periph.CR.PLL2ON := Enable;
loop
exit when RCC_Periph.CR.PLL2RDY;
end loop;
end if;
when PLL_3 =>
-- Disable the main PLL before configuring it
RCC_Periph.CR.PLL3ON := False;
if Enable then
-- Configure multiplication and division factors
RCC_Periph.PLLCKSELR.DIVM3 := UInt6 (PLLM);
if Fractional_Mode then
RCC_Periph.PLL3FRACR.FRACN3 := Fraction;
end if;
RCC_Periph.PLLCFGR :=
(PLL3VCOSEL => VCO = Medium_150_To_420MHz,
PLL3RGE => Input'Enum_Rep,
PLL3FRACEN => Fractional_Mode,
DIVP3EN => Enable_Output_P,
DIVQ3EN => Enable_Output_Q,
DIVR3EN => Enable_Output_R,
others => <>);
RCC_Periph.PLL3DIVR :=
(DIVN3 => UInt9 (PLLN - 1),
DIVP3 => UInt7 (PLLP - 1),
DIVQ3 => UInt7 (PLLQ - 1),
DIVR3 => UInt7 (PLLR - 1),
others => <>);
-- Setup PLL and wait for stabilization.
RCC_Periph.CR.PLL3ON := Enable;
loop
exit when RCC_Periph.CR.PLL3RDY;
end loop;
end if;
end case;
end Configure_PLL;
----------------------------
-- Configure_PLL_Fraction --
----------------------------
procedure Configure_PLL_Fraction
(PLL : PLL_Range;
Fraction : UInt13)
is
begin
case PLL is
when PLL_1 =>
RCC_Periph.PLLCFGR.PLL1FRACEN := False;
RCC_Periph.PLL1FRACR.FRACN1 := Fraction;
RCC_Periph.PLLCFGR.PLL1FRACEN := True;
when PLL_2 =>
RCC_Periph.PLLCFGR.PLL2FRACEN := False;
RCC_Periph.PLL2FRACR.FRACN2 := Fraction;
RCC_Periph.PLLCFGR.PLL2FRACEN := True;
when PLL_3 =>
RCC_Periph.PLLCFGR.PLL3FRACEN := False;
RCC_Periph.PLL3FRACR.FRACN3 := Fraction;
RCC_Periph.PLLCFGR.PLL3FRACEN := True;
end case;
end Configure_PLL_Fraction;
------------------------------
-- Configure_PER_Source_Mux --
------------------------------
procedure Configure_PER_Source_Mux (Source : PER_Clock_Source)
is
begin
RCC_Periph.D1CCIPR.CKPERSEL := Source'Enum_Rep;
end Configure_PER_Source_Mux;
-------------------------------
-- Configure_TIM_Source_Mode --
-------------------------------
procedure Configure_TIM_Source_Mode (Source : TIM_Source_Mode)
is
begin
RCC_Periph.CFGR.TIMPRE := Source = Factor_4;
end Configure_TIM_Source_Mode;
--------------------------------
-- Configure_MCO_Output_Clock --
--------------------------------
procedure Configure_MCO_Output_Clock
(MCO : MCO_Range;
Source : MCO_Clock_Source;
Value : MCO_Prescaler)
is
begin
case MCO is
when MCO_1 =>
RCC_Periph.CFGR.MCO1SEL := Source'Enum_Rep;
RCC_Periph.CFGR.MCO1PRE := Value'Enum_Rep;
when MCO_2 =>
RCC_Periph.CFGR.MCO2SEL := Source'Enum_Rep;
RCC_Periph.CFGR.MCO2PRE := Value'Enum_Rep;
end case;
end Configure_MCO_Output_Clock;
-----------------------
-- Set_FLASH_Latency --
-----------------------
procedure Set_FLASH_Latency (Latency : FLASH_Wait_State)
is
begin
Flash_Periph.ACR.LATENCY := Latency'Enum_Rep;
end Set_FLASH_Latency;
-----------------------
-- Set_VCORE_Scaling --
-----------------------
procedure Set_VCORE_Scaling (Scale : VCORE_Scaling_Selection)
is
begin
PWR_Periph.D3CR.VOS := Scale'Enum_Rep;
end Set_VCORE_Scaling;
--------------------------
-- PWR_Overdrive_Enable --
--------------------------
procedure PWR_Overdrive_Enable
is
begin
-- The system maximum frequency with VOS1 is 400 MHz, but 480 MHz can be
-- reached by boosting the voltage scaling level to VOS0. This is done
-- through the ODEN bit in the SYSCFG_PWRCR register, after configuring
-- level VOS1. See RM0433 ver 7 pg. 277 chapter 6.6.2 for this sequence.
if PWR_Periph.D3CR.VOS /= Scale_1'Enum_Rep then
PWR_Periph.D3CR.VOS := Scale_1'Enum_Rep; -- Set VOS1
end if;
RCC_Periph.APB4ENR.SYSCFGEN := True; -- Enable SYSCFG clock
SYSCFG_Periph.PWRCR.ODEN := True;
-- Wait for stabilization
-- loop
-- exit when PWR_Periph.D3CR.VOSRDY;
-- end loop;
end PWR_Overdrive_Enable;
end STM32.RCC;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_491.asm | ljhsiun2/medusa | 9 | 243016 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x14b2, %r11
nop
add %rdi, %rdi
movb $0x61, (%r11)
nop
add $49043, %rdx
lea addresses_WC_ht+0x1181e, %rsi
lea addresses_WT_ht+0x138be, %rdi
clflush (%rsi)
nop
cmp $31706, %rdx
mov $93, %rcx
rep movsb
nop
nop
nop
nop
sub $15762, %rdx
lea addresses_A_ht+0x1d4b2, %r13
clflush (%r13)
nop
nop
nop
nop
sub %rdi, %rdi
movb (%r13), %cl
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0x12062, %r13
and $43813, %r9
mov (%r13), %esi
nop
nop
nop
nop
dec %r11
lea addresses_WC_ht+0x186b2, %r9
add $26142, %r11
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
and $0xffffffffffffffc0, %r9
movaps %xmm0, (%r9)
nop
nop
add %rsi, %rsi
lea addresses_UC_ht+0x19cb2, %rdi
clflush (%rdi)
nop
nop
xor %r11, %r11
movb (%rdi), %r13b
sub $56052, %rdx
lea addresses_WT_ht+0x14632, %r9
nop
nop
nop
nop
nop
add $15714, %rcx
movups (%r9), %xmm7
vpextrq $1, %xmm7, %rdi
nop
nop
nop
and %rdi, %rdi
lea addresses_WT_ht+0x170f2, %rdi
clflush (%rdi)
nop
sub %r13, %r13
mov (%rdi), %si
nop
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0x1d212, %rsi
lea addresses_UC_ht+0x2b2, %rdi
nop
and $38344, %rax
mov $70, %rcx
rep movsl
nop
mfence
lea addresses_UC_ht+0x19e62, %rsi
lea addresses_D_ht+0xcb2, %rdi
nop
xor $30356, %r9
mov $47, %rcx
rep movsl
nop
dec %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r9
push %rax
push %rbp
push %rbx
// Faulty Load
lea addresses_PSE+0x154b2, %r15
nop
nop
xor %rax, %rax
vmovups (%r15), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r9
lea oracles, %r13
and $0xff, %r9
shlq $12, %r9
mov (%r13,%r9,1), %r9
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-wichun.ads | orb-zhuchen/Orb | 0 | 8463 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ C H A R A C T E R S . U N I C O D E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2005-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Unicode categorization routines for Wide_Character. Note that this
-- package is strictly speaking Ada 2005 (since it is a child of an
-- Ada 2005 unit), but we make it available in Ada 95 mode, since it
-- only deals with wide characters.
with System.UTF_32;
package Ada.Wide_Characters.Unicode is
pragma Pure;
-- The following type defines the categories from the unicode definitions.
-- The one addition we make is Fe, which represents the characters FFFE
-- and FFFF in any of the planes.
type Category is new System.UTF_32.Category;
-- Cc Other, Control
-- Cf Other, Format
-- Cn Other, Not Assigned
-- Co Other, Private Use
-- Cs Other, Surrogate
-- Ll Letter, Lowercase
-- Lm Letter, Modifier
-- Lo Letter, Other
-- Lt Letter, Titlecase
-- Lu Letter, Uppercase
-- Mc Mark, Spacing Combining
-- Me Mark, Enclosing
-- Mn Mark, Nonspacing
-- Nd Number, Decimal Digit
-- Nl Number, Letter
-- No Number, Other
-- Pc Punctuation, Connector
-- Pd Punctuation, Dash
-- Pe Punctuation, Close
-- Pf Punctuation, Final quote
-- Pi Punctuation, Initial quote
-- Po Punctuation, Other
-- Ps Punctuation, Open
-- Sc Symbol, Currency
-- Sk Symbol, Modifier
-- Sm Symbol, Math
-- So Symbol, Other
-- Zl Separator, Line
-- Zp Separator, Paragraph
-- Zs Separator, Space
-- Fe relative position FFFE/FFFF in plane
function Get_Category (U : Wide_Character) return Category;
pragma Inline (Get_Category);
-- Given a Wide_Character, returns corresponding Category, or Cn if the
-- code does not have an assigned unicode category.
-- The following functions perform category tests corresponding to lexical
-- classes defined in the Ada standard. There are two interfaces for each
-- function. The second takes a Category (e.g. returned by Get_Category).
-- The first takes a Wide_Character. The form taking the Wide_Character is
-- typically more efficient than calling Get_Category, but if several
-- different tests are to be performed on the same code, it is more
-- efficient to use Get_Category to get the category, then test the
-- resulting category.
function Is_Letter (U : Wide_Character) return Boolean;
function Is_Letter (C : Category) return Boolean;
pragma Inline (Is_Letter);
-- Returns true iff U is a letter that can be used to start an identifier,
-- or if C is one of the corresponding categories, which are the following:
-- Letter, Uppercase (Lu)
-- Letter, Lowercase (Ll)
-- Letter, Titlecase (Lt)
-- Letter, Modifier (Lm)
-- Letter, Other (Lo)
-- Number, Letter (Nl)
function Is_Digit (U : Wide_Character) return Boolean;
function Is_Digit (C : Category) return Boolean;
pragma Inline (Is_Digit);
-- Returns true iff U is a digit that can be used to extend an identifer,
-- or if C is one of the corresponding categories, which are the following:
-- Number, Decimal_Digit (Nd)
function Is_Line_Terminator (U : Wide_Character) return Boolean;
pragma Inline (Is_Line_Terminator);
-- Returns true iff U is an allowed line terminator for source programs,
-- if U is in the category Zp (Separator, Paragaph), or Zs (Separator,
-- Line), or if U is a conventional line terminator (CR, LF, VT, FF).
-- There is no category version for this function, since the set of
-- characters does not correspond to a set of Unicode categories.
function Is_Mark (U : Wide_Character) return Boolean;
function Is_Mark (C : Category) return Boolean;
pragma Inline (Is_Mark);
-- Returns true iff U is a mark character which can be used to extend an
-- identifier, or if C is one of the corresponding categories, which are
-- the following:
-- Mark, Non-Spacing (Mn)
-- Mark, Spacing Combining (Mc)
function Is_Other (U : Wide_Character) return Boolean;
function Is_Other (C : Category) return Boolean;
pragma Inline (Is_Other);
-- Returns true iff U is an other format character, which means that it
-- can be used to extend an identifier, but is ignored for the purposes of
-- matching of identiers, or if C is one of the corresponding categories,
-- which are the following:
-- Other, Format (Cf)
function Is_Punctuation (U : Wide_Character) return Boolean;
function Is_Punctuation (C : Category) return Boolean;
pragma Inline (Is_Punctuation);
-- Returns true iff U is a punctuation character that can be used to
-- separate pices of an identifier, or if C is one of the corresponding
-- categories, which are the following:
-- Punctuation, Connector (Pc)
function Is_Space (U : Wide_Character) return Boolean;
function Is_Space (C : Category) return Boolean;
pragma Inline (Is_Space);
-- Returns true iff U is considered a space to be ignored, or if C is one
-- of the corresponding categories, which are the following:
-- Separator, Space (Zs)
function Is_Non_Graphic (U : Wide_Character) return Boolean;
function Is_Non_Graphic (C : Category) return Boolean;
pragma Inline (Is_Non_Graphic);
-- Returns true iff U is considered to be a non-graphic character, or if C
-- is one of the corresponding categories, which are the following:
-- Other, Control (Cc)
-- Other, Private Use (Co)
-- Other, Surrogate (Cs)
-- Separator, Line (Zl)
-- Separator, Paragraph (Zp)
-- FFFE or FFFF positions in any plane (Fe)
--
-- Note that the Ada category format effector is subsumed by the above
-- list of Unicode categories.
--
-- Note that Other, Unassiged (Cn) is quite deliberately not included
-- in the list of categories above. This means that should any of these
-- code positions be defined in future with graphic characters they will
-- be allowed without a need to change implementations or the standard.
--
-- Note that Other, Format (Cf) is also quite deliberately not included
-- in the list of categories above. This means that these characters can
-- be included in character and string literals.
-- The following function is used to fold to upper case, as required by
-- the Ada 2005 standard rules for identifier case folding. Two
-- identifiers are equivalent if they are identical after folding all
-- letters to upper case using this routine. A corresponding function to
-- fold to lower case is also provided.
function To_Lower_Case (U : Wide_Character) return Wide_Character;
pragma Inline (To_Lower_Case);
-- If U represents an upper case letter, returns the corresponding lower
-- case letter, otherwise U is returned unchanged. The folding is locale
-- independent as defined by documents referenced in the note in section
-- 1 of ISO/IEC 10646:2003
function To_Upper_Case (U : Wide_Character) return Wide_Character;
pragma Inline (To_Upper_Case);
-- If U represents a lower case letter, returns the corresponding upper
-- case letter, otherwise U is returned unchanged. The folding is locale
-- independent as defined by documents referenced in the note in section
-- 1 of ISO/IEC 10646:2003
end Ada.Wide_Characters.Unicode;
|
src/cpnd1/nodcap/NF/Typing.agda | wenkokke/nodcap | 4 | 8166 | module nodcap.NF.Typing where
open import Data.Nat as ℕ using (ℕ; suc; zero)
open import Data.Pos as ℕ⁺ using (ℕ⁺; suc; _+_)
open import Data.Environment
open import Data.List as L using (List; []; _∷_; _++_)
open import Data.List.Any as LA using (Any; here; there)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Relation.Binary.PropositionalEquality as P using (_≡_)
open import nodcap.Base
open import nodcap.Typing as FF using (⊢_)
-- Typing Rules.
infix 1 ⊢ⁿᶠ_
data ⊢ⁿᶠ_ : Environment → Set where
send : {Γ Δ : Environment} {A B : Type} →
⊢ⁿᶠ A ∷ Γ → ⊢ⁿᶠ B ∷ Δ →
-------------------
⊢ⁿᶠ A ⊗ B ∷ Γ ++ Δ
recv : {Γ : Environment} {A B : Type} →
⊢ⁿᶠ A ∷ B ∷ Γ →
-------------
⊢ⁿᶠ A ⅋ B ∷ Γ
sel₁ : {Γ : Environment} {A B : Type} →
⊢ⁿᶠ A ∷ Γ →
-----------
⊢ⁿᶠ A ⊕ B ∷ Γ
sel₂ : {Γ : Environment} {A B : Type} →
⊢ⁿᶠ B ∷ Γ →
-----------
⊢ⁿᶠ A ⊕ B ∷ Γ
case : {Γ : Environment} {A B : Type} →
⊢ⁿᶠ A ∷ Γ → ⊢ⁿᶠ B ∷ Γ →
-------------------
⊢ⁿᶠ A & B ∷ Γ
halt :
--------
⊢ⁿᶠ 𝟏 ∷ []
wait : {Γ : Environment} →
⊢ⁿᶠ Γ →
-------
⊢ⁿᶠ ⊥ ∷ Γ
loop : {Γ : Environment} →
-------
⊢ⁿᶠ ⊤ ∷ Γ
mk?₁ : {Γ : Environment} {A : Type} →
⊢ⁿᶠ A ∷ Γ →
---------------------
⊢ⁿᶠ ?[ 1 ] A ∷ Γ
mk!₁ : {Γ : Environment} {A : Type} →
⊢ⁿᶠ A ∷ Γ →
---------------------
⊢ⁿᶠ ![ 1 ] A ∷ Γ
cont : {Γ : Environment} {A : Type} {m n : ℕ⁺} →
⊢ⁿᶠ ?[ m ] A ∷ ?[ n ] A ∷ Γ →
------------------------------
⊢ⁿᶠ ?[ m + n ] A ∷ Γ
pool : {Γ Δ : Environment} {A : Type} {m n : ℕ⁺} →
⊢ⁿᶠ ![ m ] A ∷ Γ → ⊢ⁿᶠ ![ n ] A ∷ Δ →
-------------------------------------
⊢ⁿᶠ ![ m + n ] A ∷ Γ ++ Δ
exch : {Γ Δ : Environment} →
Γ ∼[ bag ] Δ → ⊢ⁿᶠ Γ →
--------------------
⊢ⁿᶠ Δ
fromNF : {Γ : Environment} → ⊢ⁿᶠ Γ → ⊢ Γ
fromNF (send x y) = FF.send (fromNF x) (fromNF y)
fromNF (recv x) = FF.recv (fromNF x)
fromNF (sel₁ x) = FF.sel₁ (fromNF x)
fromNF (sel₂ x) = FF.sel₂ (fromNF x)
fromNF (case x y) = FF.case (fromNF x) (fromNF y)
fromNF halt = FF.halt
fromNF (wait x) = FF.wait (fromNF x)
fromNF loop = FF.loop
fromNF (mk?₁ x) = FF.mk?₁ (fromNF x)
fromNF (mk!₁ x) = FF.mk!₁ (fromNF x)
fromNF (cont x) = FF.cont (fromNF x)
fromNF (pool x y) = FF.pool (fromNF x) (fromNF y)
fromNF (exch x y) = FF.exch x (fromNF y)
-- -}
-- -}
-- -}
-- -}
-- -}
|
programs/oeis/014/A014137.asm | jmorken/loda | 1 | 82220 | ; A014137: Partial sums of Catalan numbers (A000108).
; 1,2,4,9,23,65,197,626,2056,6918,23714,82500,290512,1033412,3707852,13402697,48760367,178405157,656043857,2423307047,8987427467,33453694487,124936258127,467995871777,1757900019101,6619846420553,24987199492705,94520750408709,358268702159069,1360510918810437,5175497420902741
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
trn $2,1
sub $0,$2
add $4,1
mov $5,$0
add $5,$0
bin $5,$0
div $5,$4
add $1,$5
lpe
|
test/foreign/test_foreign.ads | skill-lang/skillAdaTestSuite | 1 | 8385 | package Test_Foreign is
end Test_Foreign;
|
alloy4fun_models/trashltl/models/4/PKDx3ebpLN49TsfDH.als | Kaixi26/org.alloytools.alloy | 0 | 1697 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idPKDx3ebpLN49TsfDH_prop5 {
some f : File | eventually f not in File'
}
pred __repair { idPKDx3ebpLN49TsfDH_prop5 }
check __repair { idPKDx3ebpLN49TsfDH_prop5 <=> prop5o } |
scripts/GameCornerPrizeRoom.asm | AmateurPanda92/pokemon-rby-dx | 9 | 174795 | <reponame>AmateurPanda92/pokemon-rby-dx<gh_stars>1-10
GameCornerPrizeRoom_Script:
jp EnableAutoTextBoxDrawing
GameCornerPrizeRoom_TextPointers:
dw CeladonPrizeRoomText1
dw CeladonPrizeRoomText2
dw CeladonPrizeRoomText3
dw CeladonPrizeRoomText3
dw CeladonPrizeRoomText3
CeladonPrizeRoomText1:
TX_FAR _CeladonPrizeRoomText1
db "@"
CeladonPrizeRoomText2:
TX_FAR _CeladonPrizeRoomText2
db "@"
CeladonPrizeRoomText3:
TX_PRIZE_VENDOR
|
dev/smartdrv/cacheman.asm | minblock/msdos | 0 | 85401 | <filename>dev/smartdrv/cacheman.asm
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
include bambi.inc
public buffer_to_cache
public cache_to_buffer
public reinitialize_cache
;
; data from rdata.asm
;
extrn cache_block_bytes :word
extrn cache_block_words :word
extrn in_bambi :byte
extrn XMShandlevalid :byte
extrn XMShandle :word
;
; routines from xms.asm
;
extrn block_write :near
extrn block_read :near
extrn reallocate_xms_memory :near
;
; routines from queueman.asm
;
extrn initqueue :near
zseg segment public 'CODE'
assume cs:zseg
assume ds:zseg
; BUG BUG assumes ptr+size does not wrap segment
; INPUT
; ES:DI = Near Buffer
; CX = number of words to copy
; BP = Cache entry index
; SI = offset into cache buffer
Buffer_To_Cache proc near
push bp
mov ax,cs:cache_block_words
mul bp ; use word index, multiply by words
add ax,si ; note that on 386 mul will be 9 clocks
adc dx,0
mov bx,cs:XMShandle
call Block_Write
pop bp
; push bp
; push ax
; call data_check_sum
; shl bp,1
; mov WORD PTR cs:buffer_sum[bp],ax
; pop ax
; pop bp
ret
Buffer_To_Cache endp
; INPUT
; ES:DI = Near Buffer
; CX = number of words to copy
; BP = Cache entry index
; SI = offset into cache buffer
Cache_To_Buffer proc near
; push ax
; push bp
; call data_check_sum
; shl bp,1
; cmp WORD PTR cs:buffer_sum[bp],ax
; pop bp
; pop ax
cache_to_buffer_no_check_sum:
mov ax,cs:cache_block_words
mul bp
add ax,si
adc dx,0
mov bx,cs:XMShandle
jmp Block_Read
Cache_To_Buffer endp
;
; INPUT
; CX number of cache elements
; OUTPUT
; none
reinitialize_cache proc near
inc cs:in_bambi
push cx
mov ax,cx
mul cs:cache_block_bytes
mov si,1024
div si
mov bx,ax
;bx = K to allocate
;dx = handle
mov dx,cs:XMShandle
call ReAllocate_XMS_Memory
or ax,ax
pop cx
jz realloc_error1
call InitQueue
dec cs:in_bambi
clc
ret
realloc_error1:
mov ax,ERROR_ALLOCATION_FAILED
dec cs:in_bambi
stc
ret
reinitialize_cache endp
zseg ends
end
|
source/uaflex/lib/uaflex-scanners.adb | svn2github/matreshka | 24 | 9323 | <reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2017, <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 Matreshka.Internals.Unicode;
package body UAFLEX.Scanners is
package Tables is
function To_Class (Value : Matreshka.Internals.Unicode.Code_Point)
return Character_Class;
pragma Inline (To_Class);
function Switch (S : State; Class : Character_Class) return State;
pragma Inline (Switch);
function Rule (S : State) return Rule_Index;
pragma Inline (Rule);
end Tables;
procedure On_Accept
(Self : not null access UAFLEX.Handlers.Handler'Class;
Scanner : not null access UAFLEX.Scanners.Scanner'Class;
Rule : Rule_Index;
Token : out Parser_Tokens.Token;
Skip : in out Boolean);
package body Tables is separate;
use Tables;
procedure On_Accept
(Self : not null access UAFLEX.Handlers.Handler'Class;
Scanner : not null access UAFLEX.Scanners.Scanner'Class;
Rule : Rule_Index;
Token : out Parser_Tokens.Token;
Skip : in out Boolean) is separate;
End_Of_Buffer : constant Wide_Wide_Character :=
Wide_Wide_Character'Val (Abstract_Sources.End_Of_Buffer);
-------------------------
-- Get_Start_Condition --
-------------------------
function Get_Start_Condition
(Self : Scanner'Class)
return Start_Condition
is
begin
return Self.Start;
end Get_Start_Condition;
--------------
-- Get_Text --
--------------
function Get_Text
(Self : Scanner'Class)
return League.Strings.Universal_String
is
begin
if Self.From <= Self.To then
return League.Strings.To_Universal_String
(Self.Buffer (Self.From .. Self.To));
elsif Self.From = Self.To + 1 then
return League.Strings.Empty_Universal_String;
else
return League.Strings.To_Universal_String
(Self.Buffer (Self.From .. Self.Buffer'Last)
& Self.Buffer (1 .. Self.To));
end if;
end Get_Text;
---------------
-- Get_Token --
---------------
procedure Get_Token (Self : access Scanner'Class; Result : out Token) is
procedure Next;
procedure Next is
begin
if Self.Next = Self.Buffer'Last then
Self.Next := 1;
else
Self.Next := Self.Next + 1;
end if;
end Next;
EOF : constant Wide_Wide_Character :=
Wide_Wide_Character'Val (Abstract_Sources.End_Of_Input);
-- EOD : constant Wide_Wide_Character :=
-- Wide_Wide_Character'Val (Abstract_Sources.End_Of_Data);
Current_State : State := Self.Start;
Char : Character_Class;
Next_Rule : Rule_Index;
Skip : Boolean := True;
begin
loop
if Self.Buffer (Self.Next) = EOF then
Result := Parser_Tokens.End_Of_Input;
return;
end if;
Current_State := Self.Start;
Self.Rule := 0;
Self.From := Self.Next;
Self.To := Self.Next - 1;
loop
Char := Self.Classes (Self.Next);
if Char /= Error_Character then
Current_State := Switch (Current_State, Char);
if Current_State not in Looping_State then
if Current_State in Final_State then
Self.Rule := Rule (Current_State);
Self.To := Self.Next;
end if;
exit;
elsif Current_State in Final_State then
Next_Rule := Rule (Current_State);
Self.Rule := Next_Rule;
Self.To := Self.Next;
end if;
Next;
elsif Self.Buffer (Self.Next) = End_Of_Buffer then
Self.Read_Buffer;
else
exit;
end if;
end loop;
Self.Next := Self.To;
Next;
if Self.Rule = 0 then
Result := Parser_Tokens.Error;
return;
else
On_Accept (Self.Handler, Self, Self.Rule, Result, Skip);
if not Skip then
return;
end if;
end if;
end loop;
end Get_Token;
----------------------
-- Get_Token_Length --
----------------------
function Get_Token_Length (Self : Scanner'Class) return Positive is
begin
if Self.From <= Self.To then
return Self.To - Self.From + 1;
else
return Buffer_Index'Last - Self.From + 1 + Self.To;
end if;
end Get_Token_Length;
------------------------
-- Get_Token_Position --
------------------------
function Get_Token_Position (Self : Scanner'Class) return Positive is
Half : constant Buffer_Half :=
Buffer_Half'Val (Boolean'Pos (Self.From >= Buffer_Half_Size));
begin
return Self.Offset (Half) + Self.From;
end Get_Token_Position;
-----------------
-- Read_Buffer --
-----------------
procedure Read_Buffer (Self : in out Scanner'Class) is
use Abstract_Sources;
use type Code_Unit_32;
Next : Code_Unit_32;
Pos : Buffer_Index := Self.Next;
begin
if Self.From <= Buffer_Half_Size xor Self.Next <= Buffer_Half_Size then
raise Constraint_Error with "Token too large";
end if;
if Pos = Buffer_Half_Size then
Self.Offset (High) := Self.Offset (High) + Self.Buffer'Length;
elsif Pos = Self.Buffer'Last then
Self.Offset (Low) := Self.Offset (Low) + Self.Buffer'Length;
end if;
loop
Next := Self.Source.Get_Next;
Self.Buffer (Pos) := Wide_Wide_Character'Val (Next);
if Next = End_Of_Input or Next = Error then
Self.Classes (Pos) := Error_Character;
return;
else
Self.Classes (Pos) := To_Class (Next);
if Pos = Self.Buffer'Last then
Pos := 1;
else
Pos := Pos + 1;
end if;
if Pos = Buffer_Half_Size or Pos = Self.Buffer'Last then
Self.Classes (Pos) := Error_Character;
Self.Buffer (Pos) := End_Of_Buffer;
return;
end if;
end if;
end loop;
end Read_Buffer;
-----------------
-- Set_Handler --
-----------------
procedure Set_Handler
(Self : in out Scanner'Class;
Handler : not null UAFLEX.Handlers.Handler_Access) is
begin
Self.Handler := Handler;
end Set_Handler;
----------------
-- Set_Source --
----------------
procedure Set_Source
(Self : in out Scanner'Class;
Source : not null Abstract_Sources.Source_Access)
is
begin
Self.Source := Source;
end Set_Source;
-------------------------
-- Set_Start_Condition --
-------------------------
procedure Set_Start_Condition
(Self : in out Scanner'Class;
Condition : Start_Condition)
is
begin
Self.Start := Condition;
end Set_Start_Condition;
end UAFLEX.Scanners;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1504.asm | ljhsiun2/medusa | 9 | 179649 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r15
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x3a9a, %r9
nop
nop
nop
nop
xor %r13, %r13
vmovups (%r9), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rbp
nop
nop
add $38738, %r10
lea addresses_WT_ht+0xd8c2, %r14
nop
sub $58073, %r8
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%r14)
nop
nop
nop
add %r14, %r14
lea addresses_normal_ht+0x2cc2, %r8
nop
xor %r15, %r15
movw $0x6162, (%r8)
nop
nop
nop
nop
sub %r9, %r9
lea addresses_A_ht+0x150c2, %r14
nop
nop
nop
nop
nop
inc %r13
movl $0x61626364, (%r14)
nop
nop
nop
cmp $10895, %r15
lea addresses_D_ht+0xf2c2, %rsi
lea addresses_normal_ht+0x133a2, %rdi
clflush (%rsi)
nop
cmp $3409, %r15
mov $76, %rcx
rep movsq
xor %rsi, %rsi
lea addresses_WT_ht+0x69c2, %r10
cmp %r13, %r13
mov (%r10), %r8w
nop
nop
nop
nop
dec %r15
lea addresses_D_ht+0x14fc9, %rbp
nop
nop
nop
nop
xor %rsi, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, (%rbp)
nop
nop
nop
nop
add %r15, %r15
lea addresses_A_ht+0x10025, %r13
nop
nop
nop
nop
lfence
movb $0x61, (%r13)
nop
nop
nop
nop
nop
xor %r10, %r10
lea addresses_normal_ht+0x7c7a, %r10
and $3688, %rcx
and $0xffffffffffffffc0, %r10
movntdqa (%r10), %xmm1
vpextrq $0, %xmm1, %r14
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_normal_ht+0x17cc2, %rsi
lea addresses_WC_ht+0xa942, %rdi
nop
nop
nop
dec %r9
mov $33, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $49999, %r10
lea addresses_D_ht+0x10a42, %r9
nop
nop
add $61952, %r10
vmovups (%r9), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r14
nop
nop
nop
nop
nop
dec %rbp
lea addresses_D_ht+0x32be, %rcx
sub $42281, %rdi
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r14
nop
nop
add $9, %rsi
lea addresses_UC_ht+0x124c2, %r9
clflush (%r9)
nop
and $18847, %r10
movl $0x61626364, (%r9)
nop
nop
nop
nop
nop
and %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %rax
push %rdx
push %rsi
// Store
lea addresses_WC+0x5102, %rsi
nop
nop
nop
nop
nop
and %r13, %r13
mov $0x5152535455565758, %r10
movq %r10, (%rsi)
nop
nop
nop
and %r15, %r15
// Faulty Load
lea addresses_D+0x18cc2, %rax
nop
nop
nop
nop
nop
xor $64940, %rsi
mov (%rax), %r10d
lea oracles, %r15
and $0xff, %r10
shlq $12, %r10
mov (%r15,%r10,1), %r10
pop %rsi
pop %rdx
pop %rax
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': True, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 16, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
SPARK/test_padding.adb | RomainGehrig/lets-prove-leftpad | 443 | 13672 | with Ada.Text_IO;
with Padding;
procedure Test_Padding is
begin
Ada.Text_IO.Put_Line(Padding.Left_Pad ("Alice", ' ', 8));
Ada.Text_IO.Put_Line(Padding.Left_Pad ("Bob", ' ', 8));
Ada.Text_IO.Put_Line(Padding.Left_Pad ("Carol", ' ', 8));
end Test_Padding;
|
libsrc/gfx/wide/w_stencil_add_liner.asm | ahjelm/z88dk | 640 | 171483 | ;
; Z88 Graphics Functions - Small C+ stubs
;
; Written around the Interlogic Standard Library
;
; Trace a relative line in the stencil vectors
;
; <NAME> - 08/10/2009
;
;
; $Id: w_stencil_add_liner.asm,v 1.3 2016-04-23 20:37:40 dom Exp $
;
;; void stencil_add_liner(int dx, int dy, unsigned char *stencil)
IF !__CPU_INTEL__ & !__CPU_GBZ80__
SECTION code_graphics
PUBLIC stencil_add_liner
PUBLIC _stencil_add_liner
EXTERN line_r
EXTERN stencil_add_pixel
;EXTERN swapgfxbk
;EXTERN swapgfxbk1
;EXTERN __graphics_end
EXTERN stencil_ptr
INCLUDE "graphics/grafix.inc"
.stencil_add_liner
._stencil_add_liner
push ix
ld ix,2
add ix,sp
ld l,(ix+2) ;pointer to stencil
ld h,(ix+3)
ld (stencil_ptr),hl
ld d,(ix+5)
ld e,(ix+4) ;y0
ld h,(ix+7)
ld l,(ix+6) ;x0
;call swapgfxbk
ld ix,stencil_add_pixel
call line_r
;jp __graphics_end
pop ix
ret
ENDIF
|
Microprocessor/mouse.asm | Nmane1612/Nihar-Mane | 3 | 26897 | ; mouse test
name "mouse"
org 100h
print macro x, y, attrib, sdat
LOCAL s_dcl, skip_dcl, s_dcl_end
pusha
mov dx, cs
mov es, dx
mov ah, 13h
mov al, 1
mov bh, 0
mov bl, attrib
mov cx, offset s_dcl_end - offset s_dcl
mov dl, x
mov dh, y
mov bp, offset s_dcl
int 10h
popa
jmp skip_dcl
s_dcl DB sdat
s_dcl_end DB 0
skip_dcl:
endm
clear_screen macro
pusha
mov ax, 0600h
mov bh, 0000_1111b
mov cx, 0
mov dh, 24
mov dl, 79
int 10h
popa
endm
print_space macro num
pusha
mov ah, 9
mov al, ' '
mov bl, 0000_1111b
mov cx, num
int 10h
popa
endm
jmp start
curX dw 0
curY dw 0
curB dw 0
start:
mov ax, 1003h ; disable blinking.
mov bx, 0
int 10h
; hide text cursor:
mov ch, 32
mov ah, 1
int 10h
; reset mouse and get its status:
mov ax, 0
int 33h
cmp ax, 0
jne ok
print 1,1,0010_1111b, " mouse not found :-( "
jmp stop
ok:
clear_screen
print 7,7,0010_1011b," note: in the emulator you may need to press and hold mouse buttons "
print 7,8,0010_1011b," because mouse interrupts are not processed in real time. "
print 7,9,0010_1011b," for a real test, click external->run from the menu. "
print 10,11,0010_1111b," click/hold both buttons to exit... "
; display mouse cursor:
mov ax, 1
int 33h
check_mouse_buttons:
mov ax, 3
int 33h
cmp bx, 3 ; both buttons
je hide
cmp cx, curX
jne print_xy
cmp dx, curY
jne print_xy
cmp bx, curB
jne print_buttons
print_xy:
print 0,0,0000_1111b,"x="
mov ax, cx
call print_ax
print_space 4
print 0,1,0000_1111b,"y="
mov ax, dx
call print_ax
print_space 4
mov curX, cx
mov curY, dx
jmp check_mouse_buttons
print_buttons:
print 0,2,0000_1111b,"btn="
mov ax, bx
call print_ax
print_space 4
mov curB, bx
jmp check_mouse_buttons
hide:
mov ax, 2 ; hide mouse cursor.
int 33h
clear_screen
print 1,1,1010_0000b," hardware must be free! free the mice! "
stop:
; show box-shaped blinking text cursor:
mov ah, 1
mov ch, 0
mov cl, 8
int 10h
print 4,7,0000_1010b," press any key.... "
mov ah, 0
int 16h
ret
print_ax proc
cmp ax, 0
jne print_ax_r
push ax
mov al, '0'
mov ah, 0eh
int 10h
pop ax
ret
print_ax_r:
pusha
mov dx, 0
cmp ax, 0
je pn_done
mov bx, 10
div bx
call print_ax_r
mov ax, dx
add al, 30h
mov ah, 0eh
int 10h
jmp pn_done
pn_done:
popa
ret
endp
|
test/Fail/UselessPrivatePragma.agda | cruhland/agda | 1,989 | 7188 | {-# OPTIONS --warning=error #-}
module UselessPrivatePragma where
postulate Char : Set
private
{-# BUILTIN CHAR Char #-}
|
book-01/Assembly/asm/core/array/core_array_compare.asm | gfurtadoalmeida/study-assembly-x64 | 2 | 11655 | .code
; int Core_Array_Compare_(int* a, int* b, int arraysLength, int* matchedValue)
Core_Array_Compare_ proc frame
; Prolog
push rsi
.pushreg rsi
push rdi
.pushreg rdi
.endprolog
mov rax, -1 ; Return code = error
test r8, r8
jle @F
mov rsi, rcx ; rsi = *a[0]
mov rdi, rdx ; rdi = *b[0]
mov rcx, r8 ; Counter = arrays length
mov rax, r8 ; rax = array length
repne cmpsd ; Do rcx times while ZF = 0 {compare rsi with rdi, if equal set ZF = 1 else increment rsi and rdi} decrement rcx
jne @F ; ZF will be 1 if cmpsd finds a match
sub rax, rcx ; rax = index of match + 1
dec rax ; rax = index of match
lea r8, [rsi-type dword] ; Calculate the matched value address
mov qword ptr [r9], r8 ; Set the address in the matched value pointer address
@@:
; Epilog
pop rdi
pop rsi
ret
Core_Array_Compare_ endp
end |
alloy4fun_models/trashltl/models/7/5iFdhhFELT5o9gndY.als | Kaixi26/org.alloytools.alloy | 0 | 1269 | open main
pred id5iFdhhFELT5o9gndY_prop8 {
always (some File.link implies eventually File.link in Trash)
}
pred __repair { id5iFdhhFELT5o9gndY_prop8 }
check __repair { id5iFdhhFELT5o9gndY_prop8 <=> prop8o } |
3-mid/physics/interface/source/physics-space.adb | charlie5/lace | 20 | 14193 | <filename>3-mid/physics/interface/source/physics-space.adb
with
ada.unchecked_Deallocation;
package body physics.Space
is
procedure free (Self : in out View)
is
procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View);
begin
Self.destruct;
deallocate (Self);
end free;
end physics.Space;
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2823.asm | ljhsiun2/medusa | 9 | 171056 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1e0f, %r14
clflush (%r14)
nop
nop
nop
nop
nop
dec %rdi
mov $0x6162636465666768, %r9
movq %r9, (%r14)
nop
nop
cmp %r11, %r11
lea addresses_normal_ht+0x17057, %rdx
nop
nop
nop
nop
nop
inc %rax
vmovups (%rdx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r9
nop
nop
and $28018, %r11
lea addresses_WT_ht+0x1218f, %rsi
lea addresses_normal_ht+0xf70f, %rdi
clflush (%rsi)
inc %rdx
mov $116, %rcx
rep movsl
nop
nop
nop
nop
nop
xor $16380, %r11
lea addresses_WT_ht+0xfd8f, %rax
xor %rdx, %rdx
movb (%rax), %r14b
nop
nop
nop
nop
and %r9, %r9
lea addresses_UC_ht+0x5cbc, %rsi
nop
nop
inc %rcx
movw $0x6162, (%rsi)
nop
nop
nop
and %rdx, %rdx
lea addresses_UC_ht+0x1d3a1, %r14
nop
nop
xor %rax, %rax
movw $0x6162, (%r14)
nop
add %rcx, %rcx
lea addresses_D_ht+0xf07f, %r11
clflush (%r11)
nop
nop
nop
nop
nop
sub %rcx, %rcx
mov (%r11), %r9w
nop
nop
nop
nop
nop
add $9595, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rax
push %rbx
push %rdi
push %rsi
// Store
lea addresses_WT+0x10d8f, %rdi
nop
nop
nop
nop
nop
and %rsi, %rsi
movb $0x51, (%rdi)
nop
dec %r13
// Store
lea addresses_US+0x782f, %r13
sub $48567, %r9
mov $0x5152535455565758, %rbx
movq %rbx, %xmm4
movups %xmm4, (%r13)
nop
nop
nop
and %r9, %r9
// Store
lea addresses_WT+0xd7ff, %r12
cmp %rsi, %rsi
mov $0x5152535455565758, %rax
movq %rax, %xmm3
movups %xmm3, (%r12)
nop
nop
nop
nop
dec %r12
// Load
mov $0x18f, %rax
nop
nop
and $6507, %r12
movntdqa (%rax), %xmm7
vpextrq $0, %xmm7, %r9
nop
nop
nop
add $8830, %rbx
// Faulty Load
lea addresses_RW+0x1898f, %r13
sub $44770, %rsi
movb (%r13), %r9b
lea oracles, %rax
and $0xff, %r9
shlq $12, %r9
mov (%rax,%r9,1), %r9
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
src/vga.asm | AmFobes/MineAssemble | 479 | 81415 | <gh_stars>100-1000
;
; This file contains the VGA mode 0x13 setup and color palette
;
[bits 32]
global init_vga
global palette
section .text
; void init_vga()
; Initialize VGA mode (0x13)
init_vga:
pushad
; Set mode
mov esi, mode0x13
call set_regs
; Set up palette
mov esi, palette
call set_palette
; Clear screen
mov edi, 0xa0000
mov ax, 0x0000
mov ecx, 0x20000
rep stosw
popad
ret
; Set VGA mode
set_regs:
cli
mov dx, 0x3C2
lodsb
out dx, al
mov dx, 0x3DA
lodsb
out dx, al
xor ecx, ecx
mov dx, 0x3C4
.l1:
lodsb
xchg al, ah
mov al, cl
out dx, ax
inc ecx
cmp cl, 4
jbe .l1
mov dx, 0x3D4
mov ax, 0x0E11
out dx, ax
xor ecx, ecx
mov dx, 0x3D4
.l2:
lodsb
xchg al, ah
mov al, cl
out dx, ax
inc ecx
cmp cl, 0x18
jbe .l2
xor ecx, ecx
mov dx, 0x3cE
.l3:
lodsb
xchg al, ah
mov al, cl
out dx, ax
inc ecx
cmp cl, 8
jbe .l3
mov dx, 0x3DA
in al, dx
xor ecx, ecx
mov dx, 0x3C0
.l4:
in ax, dx
mov al, cl
out dx, al
lodsb
out dx, al
inc ecx
cmp cl, 0x14
jbe .l4
mov al, 0x20
out dx, al
sti
ret
; void set_palette()
; Set palette colors
set_palette:
push ax
push cx
push dx
xor cx, cx
.next_color:
mov dx, 0x03C8
mov al, cl
out dx, al
inc dx
mov al, byte [esi]
out dx, al
inc esi
mov al, byte [esi]
out dx, al
inc esi
mov al, byte [esi]
out dx, al
inc esi
inc cx
cmp cx, 256
jl .next_color
pop dx
pop cx
pop ax
ret
section .data
; 256 color RGB palette (6 bits per channel)
palette db 00, 00, 00, 63, 63, 63, 39, 51, 63, 29, 41, 22, 19, 27, 14
db 25, 38, 17, 16, 25, 11, 30, 40, 21, 20, 26, 14, 22, 34, 14
db 14, 22, 09, 27, 40, 18, 18, 26, 12, 27, 40, 19, 23, 35, 15
db 15, 23, 10, 24, 37, 16, 16, 24, 10, 33, 44, 24, 22, 29, 16
db 35, 46, 25, 23, 30, 16, 31, 41, 21, 20, 27, 14, 26, 38, 18
db 17, 25, 12, 27, 40, 20, 18, 26, 13, 23, 37, 14, 15, 24, 09
db 31, 43, 22, 20, 28, 14, 23, 36, 13, 15, 24, 08, 21, 34, 12
db 14, 22, 08, 24, 37, 15, 26, 37, 17, 17, 24, 11, 23, 35, 14
db 15, 23, 09, 26, 37, 16, 17, 24, 10, 23, 35, 13, 15, 23, 08
db 26, 38, 17, 17, 25, 11, 29, 40, 19, 19, 26, 12, 25, 39, 16
db 16, 26, 10, 28, 40, 19, 28, 39, 18, 26, 39, 18, 17, 26, 12
db 27, 39, 19, 27, 38, 17, 18, 25, 11, 31, 42, 21, 27, 39, 18
db 28, 38, 17, 32, 43, 22, 21, 28, 14, 26, 39, 17, 17, 26, 11
db 23, 36, 14, 20, 33, 11, 13, 22, 07, 18, 32, 10, 12, 21, 06
db 23, 36, 15, 15, 24, 10, 25, 37, 18, 16, 24, 12, 25, 36, 16
db 22, 35, 13, 14, 23, 08, 23, 37, 15, 22, 36, 13, 14, 24, 08
db 29, 41, 19, 19, 27, 12, 27, 39, 17, 18, 26, 11, 18, 31, 09
db 12, 20, 06, 19, 32, 10, 20, 32, 12, 13, 21, 08, 25, 36, 15
db 24, 38, 16, 16, 25, 10, 29, 42, 21, 19, 28, 14, 20, 34, 11
db 21, 35, 12, 24, 38, 15, 29, 41, 20, 19, 27, 13, 30, 42, 20
db 20, 28, 13, 20, 34, 12, 13, 22, 08, 28, 41, 19, 18, 27, 12
db 24, 36, 16, 23, 34, 14, 15, 22, 09, 19, 33, 11, 12, 22, 07
db 22, 34, 13, 31, 43, 21, 32, 43, 23, 21, 28, 15, 29, 41, 21
db 24, 36, 15, 30, 42, 21, 17, 30, 08, 11, 20, 05, 28, 40, 20
db 28, 40, 18, 27, 40, 17, 22, 36, 14, 14, 24, 09, 30, 41, 20
db 20, 27, 13, 33, 45, 23, 22, 30, 15, 32, 44, 23, 21, 29, 15
db 25, 40, 17, 16, 26, 11, 25, 38, 16, 25, 37, 17, 16, 24, 11
db 26, 41, 18, 17, 27, 12, 26, 40, 17, 21, 33, 14, 21, 35, 13
db 27, 39, 21, 18, 26, 14, 27, 37, 18, 18, 24, 12, 31, 42, 22
db 30, 40, 20, 20, 26, 13, 36, 26, 18, 24, 17, 12, 23, 16, 11
db 15, 10, 07, 29, 21, 14, 19, 14, 09, 21, 21, 21, 14, 14, 14
db 17, 12, 08, 11, 08, 05, 26, 26, 26, 17, 17, 17, 22, 17, 13
db 14, 11, 08, 22, 35, 14, 14, 23, 09, 27, 36, 18, 21, 33, 13
db 27, 36, 17, 18, 24, 11, 30, 39, 21, 20, 32, 11, 13, 21, 07
db 25, 34, 16, 16, 22, 10, 19, 32, 11, 12, 21, 07, 25, 35, 16
db 16, 23, 10, 20, 33, 12, 21, 34, 13, 18, 31, 10, 19, 31, 11
db 12, 20, 07, 28, 38, 19, 18, 25, 12, 25, 37, 16, 28, 37, 18
db 28, 37, 19, 29, 38, 20, 19, 25, 13, 19, 31, 10, 17, 29, 08
db 11, 19, 05, 15, 28, 07, 10, 18, 04, 21, 33, 12, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
db 00, 00, 00, 00, 00, 00, 00, 00, 00, 36, 25, 46, 40, 47, 52
db 24, 12, 00
; VGA mode 0x13 register values
mode0x13 db 0x63, 0x00, 0x03, 0x01, 0x0F, 0x00, 0x0E, 0x5F, 0x4F
db 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, 0x41, 0x00
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x0E, 0x8F, 0x28
db 0x40, 0x96, 0xB9, 0xA3, 0xFF, 0x00, 0x00, 0x00, 0x00
db 0x00, 0x40, 0x05, 0x0F, 0xFF, 0x00, 0x01, 0x02, 0x03
db 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C
db 0x0D, 0x0E, 0x0F, 0x41, 0x00, 0x0F, 0x00, 0x00 |
data/baseStats_original/forretress.asm | adhi-thirumala/EvoYellow | 16 | 15059 | <gh_stars>10-100
ForretressBaseStats::
dw DEX_FORRETRESS ; pokedex id
db 75 ; base hp
db 90 ; base attack
db 140 ; base defense
db 40 ; base speed
db 60 ; base special
db BUG ; species type 1
db STEEL ; species type 2
db 60 ; catch rate
db 118 ; base exp yield
INCBIN "pic/ymon/forretress.pic",0,1 ; 55, sprite dimensions
dw ForretressPicFront
dw ForretressPicBack
; attacks known at lvl 0
db TACKLE
db 0 ; PROTECT
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 6,8
tmlearn 9,10
tmlearn 18,20,21
tmlearn 26,28,32
tmlearn 33,34,36,39
tmlearn 44
tmlearn 50,54
db Bank(ForretressPicFront) ; padding
|
oeis/040/A040381.asm | neoneye/loda-programs | 11 | 245073 | ; A040381: Continued fraction for sqrt(402).
; Submitted by <NAME>
; 20,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40,20,40
trn $0,1
mod $0,2
mul $0,20
add $0,20
|
src/Tactic/By/Parametrised/Tests.agda | nad/equality | 3 | 2947 | <reponame>nad/equality
------------------------------------------------------------------------
-- Unit tests for Tactic.By.Parametrised
------------------------------------------------------------------------
-- Nothing is exported from this module.
{-# OPTIONS --without-K --safe #-}
open import Equality
module Tactic.By.Parametrised.Tests
{c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where
open Derived-definitions-and-properties eq
open import Prelude
open import Maybe eq
open import Monad eq
open import TC-monad eq hiding (Type)
open import Tactic.By.Parametrised eq
------------------------------------------------------------------------
-- Some unit tests
private
module Tests
(assumption : 48 ≡ 42)
(lemma : ∀ n → n + 8 ≡ n + 2)
(f : ℕ → ℕ → ℕ → ℕ)
where
g : ℕ → ℕ → ℕ → ℕ
g zero _ _ = 12
g (suc _) _ _ = 12
fst : ∀ {a b} {A : Type a} {B : A → Type b} →
Σ A B → A
fst = proj₁
{-# NOINLINE fst #-}
record R (F : Type → Type) : Type₁ where
field
p : {A : Type} {x : F A} → x ≡ x
open R ⦃ … ⦄ public
test₁ : ⟨ 40 + 2 ⟩ ≡ 42
test₁ = ⟨by⟩ refl
test₂ : 48 ≡ 42 → ⟨ 42 ⟩ ≡ 48
test₂ eq = ⟨by⟩ eq
test₃ : (f : ℕ → ℕ) → f ⟨ 42 ⟩ ≡ f 48
test₃ f = ⟨by⟩ assumption
test₄ : (f : ℕ → ℕ) → f ⟨ 48 ⟩ ≡ f 42
test₄ f = ⟨by⟩ assumption
test₅ : (f : ℕ → ℕ → ℕ) → f ⟨ 42 ⟩ ⟨ 42 ⟩ ≡ f 48 48
test₅ f = ⟨by⟩ assumption
test₆ : (f : ℕ → ℕ → ℕ → ℕ) → f ⟨ 48 ⟩ 45 ⟨ 48 ⟩ ≡ f 42 45 42
test₆ f = ⟨by⟩ assumption
test₇ : f ⟨ 48 ⟩ (f ⟨ 48 ⟩ 45 ⟨ 48 ⟩) ⟨ 48 ⟩ ≡ f 42 (f 42 45 42) 42
test₇ = ⟨by⟩ assumption
test₈ : ∀ n → g n (g n 45 ⟨ 48 ⟩) ⟨ 48 ⟩ ≡ g n (g n 45 42) 42
test₈ n = ⟨by⟩ assumption
test₉ : (f : ℕ → ℕ) → f ⟨ 42 ⟩ ≡ f 48
test₉ f = ⟨by⟩ (lemma 40)
test₁₀ : (f : ℕ → ℕ) → f ⟨ 42 ⟩ ≡ f 48
test₁₀ f = ⟨by⟩ (λ (_ : ⊤) → assumption)
test₁₁ : (f : ℕ × ℕ → ℕ × ℕ) → (∀ x → ⟨ _≡_ ⟩ (f x) x) →
fst ⟨ f (12 , 73) ⟩ ≡ fst {B = λ _ → ℕ} (12 , 73)
test₁₁ _ hyp = ⟨by⟩ hyp
test₁₂ : (h : ℕ → Maybe ℕ) →
((xs : ℕ) → h xs ≡ just xs) →
(xs : ℕ) → suc ⟨$⟩ h xs ≡ suc ⟨$⟩ return xs
test₁₂ h hyp xs =
suc ⟨$⟩ ⟨ h xs ⟩ ≡⟨ ⟨by⟩ (hyp xs) ⟩∎
suc ⟨$⟩ return xs ∎
test₁₃ : (h : List ⊤ → Maybe (List ⊤)) →
((xs : List ⊤) → h xs ≡ just xs) →
(x : ⊤) (xs : List ⊤) → _
test₁₃ h hyp x xs =
_∷_ ⟨$⟩ return x ⊛ ⟨ h xs ⟩ ≡⟨ ⟨by⟩ (hyp xs) ⟩∎
_∷_ ⟨$⟩ return x ⊛ return xs ∎
test₁₄ : (h : List ℕ → Maybe (List ℕ)) →
((xs : List ℕ) → h xs ≡ just xs) →
(x : ℕ) (xs : List ℕ) → _
test₁₄ h hyp x xs =
_∷_ ⟨$⟩ ⟨ h xs ⟩ ≡⟨ ⟨by⟩ (hyp xs) ⟩∎
_∷_ ⟨$⟩ return xs ∎
test₁₅ :
(F : Type → Type → Type)
(G : Bool → Type → Type) →
((A : Type) → F (G false A) A ≡ G false (F A A)) →
(A : Type) →
G false (F (G false A) A) ≡
G false (G false (F A A))
test₁₅ F G hyp A =
G false ⟨ F (G false A) A ⟩ ≡⟨ ⟨by⟩ hyp ⟩∎
G false (G false (F A A)) ∎
test₁₆ : 48 ≡ 42 →
_≡_ {A = ℕ → ℕ} (λ x → x + ⟨ 42 ⟩) (λ x → x + 48)
test₁₆ hyp = ⟨by⟩ hyp
test₁₇ :
(P : ℕ → Type)
(f : ∀ {n} → P n → P n)
(p : P 0) →
f ⟨ subst P (refl _) p ⟩ ≡ f p
test₁₇ _ _ _ = ⟨by⟩ subst-refl
test₁₈ :
(subst′ :
∀ {a p} {A : Type a} {x y : A}
(P : A → Type p) → x ≡ y → P x → P y) →
(∀ {a p} {A : Type a} {x : A} (P : A → Type p) (p : P x) →
subst′ P (refl x) p ≡ p) →
(P : ℕ → Type)
(f : ∀ {n} → P n → P n)
(p : P 0) →
f ⟨ subst′ P (refl 0) p ⟩ ≡ f p
test₁₈ _ subst′-refl _ _ _ = ⟨by⟩ subst′-refl
-- test₁₉ :
-- {F : Type → Type} ⦃ r : R F ⦄ {A : Type} {x₁ x₂ : F A}
-- (p₁ p₂ : x₁ ≡ x₂) (assumption : p₁ ≡ p₂) →
-- trans p p₁ ≡ trans p p₂
-- test₁₉ p₁ p₂ assumption =
-- trans p p₁ ≡⟨⟩
-- trans p ⟨ p₁ ⟩ ≡⟨ ⟨by⟩ assumption ⟩∎
-- trans p p₂ ∎
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_778.asm | ljhsiun2/medusa | 9 | 89127 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x754b, %rax
nop
cmp %r15, %r15
vmovups (%rax), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbp
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_normal_ht+0x30bb, %rsi
lea addresses_D_ht+0x1074b, %rdi
nop
sub $21089, %r10
mov $113, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $52065, %r15
lea addresses_UC_ht+0x91cb, %rcx
nop
nop
nop
cmp $48950, %rsi
mov (%rcx), %edi
nop
nop
nop
nop
sub %rax, %rax
lea addresses_WT_ht+0x1dc33, %rsi
lea addresses_WT_ht+0x4b4b, %rdi
nop
dec %r10
mov $34, %rcx
rep movsq
nop
nop
nop
sub $38986, %r10
lea addresses_A_ht+0x15317, %rsi
lea addresses_WT_ht+0x3f1b, %rdi
nop
nop
nop
sub $49951, %r15
mov $39, %rcx
rep movsw
nop
nop
dec %rax
lea addresses_UC_ht+0x17c6b, %rsi
lea addresses_WT_ht+0x1e44b, %rdi
nop
nop
nop
add %r15, %r15
mov $88, %rcx
rep movsq
nop
nop
nop
nop
cmp $59303, %r15
lea addresses_UC_ht+0xa2cb, %rax
nop
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm1
movups %xmm1, (%rax)
nop
and %rcx, %rcx
lea addresses_WT_ht+0x314b, %rsi
lea addresses_normal_ht+0x1854b, %rdi
clflush (%rsi)
nop
and %r15, %r15
mov $93, %rcx
rep movsb
nop
inc %rbp
lea addresses_D_ht+0xdeb3, %rcx
nop
nop
cmp %r10, %r10
movw $0x6162, (%rcx)
nop
nop
sub %r15, %r15
lea addresses_D_ht+0xea4b, %rsi
lea addresses_WT_ht+0xdafb, %rdi
clflush (%rdi)
cmp %r10, %r10
mov $69, %rcx
rep movsw
nop
nop
and $11834, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rbx
push %rdx
// Faulty Load
lea addresses_PSE+0x1154b, %r8
cmp %r11, %r11
mov (%r8), %edx
lea oracles, %r11
and $0xff, %rdx
shlq $12, %rdx
mov (%r11,%rdx,1), %rdx
pop %rdx
pop %rbx
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
hello.asm | simmons/valence64 | 1 | 101258 | <filename>hello.asm
;set up some helpful labels
CLEAR = $E544
CHROUT = $FFD2
.segment "BASICSTUB"
.byte $00
.byte $C0
.code
main:
jsr CLEAR
ldx #0
loop:
lda greeting,x
cmp #0
beq finish
jsr CHROUT
inx
jmp loop
finish:
rts
.data
greeting:
.byte "HELLO, WORLD!"
.byte $00
|
lib/Runtime/Language/arm64/arm64_CallEhFrame.asm | rekhadpr/demoazure1 | 1 | 245456 | <reponame>rekhadpr/demoazure1
;-------------------------------------------------------------------------------------------------------
; Copyright (C) Microsoft. All rights reserved.
; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
;-------------------------------------------------------------------------------------------------------
;
; arm64_CallEhFrame() and arm64_CallCatch() both thunk into jitted code at the
; start of an EH region. The purpose is to restore the frame pointer (fp)
; and locals pointer (x28) to the appropriate values for executing the parent
; function and to create a local frame that can be unwound using the parent
; function's pdata. The parent's frame looks like this:
;
;-------------------
; {x0-x7} -- homed parameters
; lr -- address from which parent was called
; fp -- saved frame pointer, pointed to by current fp
; arg obj
; {x19-x28} -- non-volatile registers: all of them are saved
; {q8-q15} -- non-volatile double registers: all of them are saved
; locals area -- pointed to by x28
; pointer to non-volatile register area above
; stack args
;-------------------
;
; The reason for the "pointer to non-volatile register area" is to allow the
; unwinder to deallocate the locals area regardless of its size. So this thunk can skip
; the allocation of the locals area altogether, and unwinding still works.
; The unwind pseudo-codes for the above prolog look like:
;
; 1. Deallocate stack args (sp now points to "pointer to non-volatile register area")
; 2. Restore rN (rN now points to first saved register)
; 3. Copy rN to sp (sp now points to first saved register)
; 4. Restore {q8-q15} (non-volatile double registers restored)
; 5. Restore {x19-x28} (non-volatile registers restored, sp points to saved r11)
; 6. Restore fp
; 7. Load lr into pc and deallocate remaining stack.
;
; The prologs for the assembly thunks allocate a frame that can be unwound by executing
; the above steps, although we don't allocate a locals area and don't know the size of the
; stack args. The caller doesn't return to this thunk; it executes its own epilog and
; returns to the caller of the thunk (one of the runtime try helpers).
; Windows version
OPT 2 ; disable listing
#include "ksarm64.h"
OPT 1 ; re-enable listing
TTL Lib\Common\arm\arm64_CallEhFrame.asm
IMPORT __chkstk
EXPORT arm64_CallEhFrame
TEXTAREA
NESTED_ENTRY arm64_CallEhFrame
; Params:
; x0 -- thunk target
; x1 -- frame pointer
; x2 -- locals pointer
; x3 -- size of stack args area
; Home params and save registers
PROLOG_SAVE_REG_PAIR fp, lr, #-80!
PROLOG_NOP stp x0, x1, [sp, #16]
PROLOG_NOP stp x2, x3, [sp, #32]
PROLOG_NOP stp x4, x5, [sp, #48]
PROLOG_NOP stp x6, x7, [sp, #64]
PROLOG_STACK_ALLOC (10*8 + 8*16 + 32)
PROLOG_NOP stp q8, q9, [sp, #(16 + 0*16)]
PROLOG_NOP stp q10, q11, [sp, #(16 + 2*16)]
PROLOG_NOP stp q12, q13, [sp, #(16 + 4*16)]
PROLOG_NOP stp q14, q15, [sp, #(16 + 6*16)]
PROLOG_SAVE_REG_PAIR x19, x20, #(16 + 8*16 + 0*8)
PROLOG_SAVE_REG_PAIR x21, x22, #(16 + 8*16 + 2*8)
PROLOG_SAVE_REG_PAIR x23, x24, #(16 + 8*16 + 4*8)
PROLOG_SAVE_REG_PAIR x25, x26, #(16 + 8*16 + 6*8)
PROLOG_SAVE_REG_PAIR x27, x28, #(16 + 8*16 + 8*8)
; Save a pointer to the saved registers
mov x16, sp
str x16, [sp, #0]
; Set up the frame pointer and locals pointer
mov x28, x2
mov fp, x1
; Allocate the arg out area, calling chkstk if necessary
cmp x3,#4095
bgt chkstk_call
sub sp,sp,x3
; Thunk to the jitted code (and don't return)
br x0
|chkstk_call|
; Call chkstk, passing a size/16 count in x15
lsr x15,x3,#4
bl |__chkstk|
sub sp,sp,x15,lsl #4
; Thunk to the jitted code (and don't return)
br x0
NESTED_END arm64_CallEhFrame
; arm64_CallCatch() is similar to arm64_CallEhFrame() except that we also pass the catch object to the jitted code
EXPORT arm64_CallCatch
TEXTAREA
NESTED_ENTRY arm64_CallCatch
; Params:
; x0 -- thunk target
; x1 -- frame pointer
; x2 -- locals pointer
; x3 -- size of stack args area
; x4 -- exception object
; Home params and save registers
PROLOG_SAVE_REG_PAIR fp, lr, #-80!
PROLOG_NOP stp x0, x1, [sp, #16]
PROLOG_NOP stp x2, x3, [sp, #32]
PROLOG_NOP stp x4, x5, [sp, #48]
PROLOG_NOP stp x6, x7, [sp, #64]
PROLOG_STACK_ALLOC (10*8 + 8*16 + 32)
PROLOG_NOP stp q8, q9, [sp, #(16 + 0*16)]
PROLOG_NOP stp q10, q11, [sp, #(16 + 2*16)]
PROLOG_NOP stp q12, q13, [sp, #(16 + 4*16)]
PROLOG_NOP stp q14, q15, [sp, #(16 + 6*16)]
PROLOG_SAVE_REG_PAIR x19, x20, #(16 + 8*16 + 0*8)
PROLOG_SAVE_REG_PAIR x21, x22, #(16 + 8*16 + 2*8)
PROLOG_SAVE_REG_PAIR x23, x24, #(16 + 8*16 + 4*8)
PROLOG_SAVE_REG_PAIR x25, x26, #(16 + 8*16 + 6*8)
PROLOG_SAVE_REG_PAIR x27, x28, #(16 + 8*16 + 8*8)
; Save a pointer to the saved registers
mov x16, sp
str x16, [sp, #0]
; Set up the frame pointer and locals pointer
mov x28, x2
mov fp, x1
; Allocate the arg out area, calling chkstk if necessary
cmp x3,#4095
mov x1, x4
bgt chkstk_call
sub sp,sp,x3
; Thunk to the jitted code (and don't return)
br x0
|chkstk_call_catch|
; Call chkstk, passing a size/16 count in x15
lsr x15,x3,#4
bl |__chkstk|
sub sp,sp,x15,lsl #4
; Thunk to the jitted code (and don't return)
br x0
NESTED_END arm64_CallCatch
END
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_9845_89.asm | ljhsiun2/medusa | 9 | 1928 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1d201, %rsi
lea addresses_UC_ht+0x13401, %rdi
nop
sub $36619, %r14
mov $116, %rcx
rep movsl
xor $5959, %r12
lea addresses_UC_ht+0x9191, %rsi
lea addresses_normal_ht+0xcdc1, %rdi
nop
add $32189, %r15
mov $82, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rax
push %rbx
push %rsi
// Faulty Load
lea addresses_UC+0x1ec01, %rbx
nop
nop
nop
nop
nop
cmp %r15, %r15
mov (%rbx), %r10
lea oracles, %rsi
and $0xff, %r10
shlq $12, %r10
mov (%rsi,%r10,1), %r10
pop %rsi
pop %rbx
pop %rax
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'37': 9845}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
cobol85/Cobol85.g4 | Cmejia/grammars-v4 | 1 | 5151 | <filename>cobol85/Cobol85.g4<gh_stars>1-10
/*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Cobol 85 Grammar for ANTLR4
*
* This is an approximate grammar for Cobol 85. It is akin but neither
* copied from nor identical to Cobol.jj, Cobol.kg and VS COBOL II grammars.
* Tested against the NIST test suite.
*
* Characteristics:
*
* 1. Passes the NIST tests.
*
* 2. To be used in conjunction with the provided preprocessor, which executes
* COPY and REPLACE statements.
*
*
* Known limitations (work under progress):
*
* 1. Picture strings are parsed as (groups of) terminal symbols.
*
* 2. Comments are skipped.
*
*
* Change log:
*
* v1.0
* - fixes
* - compiler options
*
* v0.9 Initial revision
*/
grammar Cobol85;
options
{
language = Java;
}
startRule : compilationUnit EOF;
compilationUnit :
programUnit+
;
programUnit :
compilerOptions?
identificationDivision
environmentDivision?
dataDivision?
procedureDivision?
programUnit*
endProgramStatement?
;
endProgramStatement :
END PROGRAM programName DOT
;
// --- compiler options --------------------------------------------------------------------
compilerOptions :
(PROCESS compilerOption+)+
;
compilerOption :
APOST
| ARITH LPARENCHAR EXTEND RPARENCHAR
| CODEPAGE LPARENCHAR literal RPARENCHAR
| DBCS
| LIB
| NOSEQ
| NOSTDTRUNC
| OPTIMIZE LPARENCHAR FULL RPARENCHAR
| XOPTS LPARENCHAR compilerSubOption+ RPARENCHAR
;
compilerSubOption :
SP
| APOST
;
// --- identification division --------------------------------------------------------------------
identificationDivision :
(IDENTIFICATION | ID) DIVISION DOT
programIdParagraph
identificationDivisionBody*
;
identificationDivisionBody :
authorParagraph
| installationParagraph
| dateWrittenParagraph
| dateCompiledParagraph
| securityParagraph
;
// - program id paragraph ----------------------------------
programIdParagraph :
PROGRAM_ID DOT programName (IS? (COMMON | INITIAL | LIBRARY | DEFINITION) PROGRAM?)? DOT
;
// - author paragraph ----------------------------------
authorParagraph :
AUTHOR DOT commentEntry?
;
// - installation paragraph ----------------------------------
installationParagraph :
INSTALLATION DOT commentEntry?
;
// - date written paragraph ----------------------------------
dateWrittenParagraph :
DATE_WRITTEN DOT commentEntry?
;
// - date compiled paragraph ----------------------------------
dateCompiledParagraph :
DATE_COMPILED DOT commentEntry?
;
// - security paragraph ----------------------------------
securityParagraph :
SECURITY DOT commentEntry?
;
// --- environment division --------------------------------------------------------------------
environmentDivision :
ENVIRONMENT DIVISION DOT
environmentDivisionBody*
;
environmentDivisionBody :
configurationSection
| specialNamesParagraph
| inputOutputSection
;
// -- configuration section ----------------------------------
configurationSection :
CONFIGURATION SECTION DOT
configurationSectionParagraph*
;
// - configuration section paragraph ----------------------------------
configurationSectionParagraph :
sourceComputerParagraph
| objectComputerParagraph
;
// - source computer paragraph ----------------------------------
sourceComputerParagraph :
SOURCE_COMPUTER DOT computerName (WITH? DEBUGGING MODE)? DOT
;
// - object computer paragraph ----------------------------------
objectComputerParagraph :
OBJECT_COMPUTER DOT
computerName objectComputerClause* DOT
;
objectComputerClause :
memorySizeClause
| diskSizeClause
| collatingSequenceClause
| segmentLimitClause
| characterSetClause
;
memorySizeClause :
MEMORY SIZE? integerLiteral (WORDS | CHARACTERS | MODULES)?
;
diskSizeClause :
DISK SIZE? IS? integerLiteral (WORDS | MODULES)?
;
collatingSequenceClause :
PROGRAM? COLLATING? SEQUENCE IS? alphabetName+
;
segmentLimitClause :
SEGMENT_LIMIT IS? integerLiteral
;
characterSetClause :
CHARACTER SET commentEntry?
;
// - special names paragraph ----------------------------------
specialNamesParagraph :
SPECIAL_NAMES DOT
(specialNameClause+ DOT)?
;
specialNameClause :
channelClause
| odtClause
| alphabetClause
| classClause
| currencySignClause
| decimalPointClause
| symbolicCharactersClause
| environmentSwitchNameClause
;
channelClause :
CHANNEL integerLiteral IS? mnemonicName
;
odtClause :
ODT IS? mnemonicName
;
alphabetClause :
ALPHABET alphabetName (FOR ALPHANUMERIC)? IS?
(
EBCDIC
| ASCII
| STANDARD_1
| STANDARD_2
| NATIVE
| cobolWord
| (literal
(
(
(THROUGH | THRU) literal | (ALSO literal)+
)
)?
)+
)
;
classClause :
CLASS className (FOR? (ALPHANUMERIC | NATIONAL))? IS?
(
(identifier | literal) ((THROUGH | THRU) (identifier | literal))?
)+
;
currencySignClause :
CURRENCY SIGN? IS? literal
;
decimalPointClause :
DECIMAL_POINT IS? COMMA
;
symbolicCharactersClause :
SYMBOLIC CHARACTERS? (FOR? (ALPHANUMERIC | NATIONAL))? (symbolicCharacter+ (IS | ARE)? integerLiteral+)+ (IN alphabetName)?
;
environmentSwitchNameClause :
environmentName IS? mnemonicName specialNamesStatusPhrase?
| specialNamesStatusPhrase
;
specialNamesStatusPhrase :
ON STATUS? IS? condition (OFF STATUS? IS? condition)?
| OFF STATUS? IS? condition (ON STATUS? IS? condition)?
;
// -- input output section ----------------------------------
inputOutputSection :
INPUT_OUTPUT SECTION DOT
inputOutputSectionParagraph*
;
// - input output section paragraph ----------------------------------
inputOutputSectionParagraph :
fileControlParagraph
| ioControlParagraph
;
// - file control paragraph ----------------------------------
fileControlParagraph :
FILE_CONTROL (DOT? fileControlEntry)+ DOT
;
fileControlEntry :
selectClause
fileControlClause*
;
fileControlClause :
assignClause
| reserveClause
| organizationClause
| paddingCharacterClause
| recordDelimiterClause
| accessModeClause
| recordKeyClause
| alternateRecordKeyClause
| fileStatusClause
| passwordClause
| relativeKeyClause
;
assignClause :
ASSIGN TO? (assignmentName | literal)
;
selectClause :
SELECT OPTIONAL? fileName
;
reserveClause :
RESERVE (integerLiteral | NO) ALTERNATE? (AREA | AREAS)?
;
organizationClause :
(ORGANIZATION IS?)?
(LINE | RECORD BINARY | RECORD | BINARY)?
(SEQUENTIAL | RELATIVE | INDEXED)
;
paddingCharacterClause :
PADDING CHARACTER? IS? (qualifiedDataName | literal)
;
recordDelimiterClause :
RECORD DELIMITER IS? (STANDARD_1 | IMPLICIT | assignmentName)
;
accessModeClause :
ACCESS MODE? IS?
(
SEQUENTIAL
| RANDOM
| DYNAMIC
| EXCLUSIVE
)
;
recordKeyClause :
RECORD KEY? IS? qualifiedDataName passwordClause? (WITH? DUPLICATES)?
;
alternateRecordKeyClause :
ALTERNATE RECORD KEY? IS? qualifiedDataName passwordClause? (WITH? DUPLICATES)?
;
passwordClause :
PASSWORD IS? dataName
;
fileStatusClause :
FILE? STATUS IS? qualifiedDataName qualifiedDataName?
;
relativeKeyClause :
RELATIVE KEY? IS? qualifiedDataName
;
// - io control paragraph ----------------------------------
ioControlParagraph :
I_O_CONTROL DOT
(ioControlClause (DOT? ioControlClause)* DOT)?
;
ioControlClause :
obsoletePictureStringClause
| rerunClause
| sameAreaClause
| multipleFileClause
| commitmentControlClause
;
rerunClause :
RERUN
(
ON (assignmentName | fileName)
)?
EVERY (rerunEveryRecords | rerunEveryOf | rerunEveryClock)
;
rerunEveryRecords :
integerLiteral RECORDS
;
rerunEveryOf :
END? OF? (REEL | UNIT) OF fileName
;
rerunEveryClock :
integerLiteral CLOCK_UNITS?
;
sameAreaClause :
SAME (RECORD | SORT | SORT_MERGE)? AREA? FOR? fileName+
;
multipleFileClause :
MULTIPLE FILE TAPE? CONTAINS? (fileName POSITION? integerLiteral?)+
;
commitmentControlClause :
COMMITMENT CONTROL FOR? fileName
;
// --- data division --------------------------------------------------------------------
dataDivision :
DATA DIVISION DOT
dataDivisionBody*
;
dataDivisionBody :
fileSection
| workingStorageSection
| linkageSection
| communicationSection
| screenSection
| reportSection
;
// -- file section ----------------------------------
fileSection :
FILE SECTION DOT
(fileAndSortDescriptionEntry dataDescriptionEntry*)*
;
fileAndSortDescriptionEntry :
(FD | SD) fileName (DOT? fileAndSortDescriptionEntryClause)* DOT
;
fileAndSortDescriptionEntryClause :
externalClause
| globalClause
| blockContainsClause
| recordContainsClause
| labelRecordsClause
| valueOfClause
| dataRecordClause
| linageClause
| codeSetClause
| reportClause
| recordingModeClause
;
externalClause :
IS? EXTERNAL
;
globalClause :
IS? GLOBAL
;
blockContainsClause :
BLOCK CONTAINS? (integerLiteral TO)? integerLiteral (RECORDS | CHARACTERS)?
;
recordContainsClause :
RECORD CONTAINS?
(
(integerLiteral TO)? integerLiteral CHARACTERS?
|
IS? VARYING IN? SIZE?
(FROM? integerLiteral (TO integerLiteral)? CHARACTERS?)?
(DEPENDING ON? qualifiedDataName)?
)
;
labelRecordsClause :
LABEL (RECORD IS? | RECORDS ARE?) (OMITTED | STANDARD | dataName+)
;
valueOfClause :
VALUE OF (systemName IS? (qualifiedDataName | literal))+
;
dataRecordClause :
DATA (RECORD IS? | RECORDS ARE?) dataName+
;
linageClause :
LINAGE IS? (dataName | integerLiteral) LINES?
(
WITH? FOOTING AT? (dataName | integerLiteral)
| LINES? AT? TOP (dataName | integerLiteral)
| LINES? AT? BOTTOM (dataName | integerLiteral)
)*
;
recordingModeClause :
RECORDING MODE? IS? modeStatement
;
modeStatement :
cobolWord
;
codeSetClause :
CODE_SET IS? alphabetName
;
reportClause :
(REPORT IS? | REPORTS ARE?) reportName+
;
dataDescriptionEntry :
INTEGERLITERAL (dataName | FILLER)? dataDescriptionEntryClause* DOT
| LEVEL_NUMBER_66 dataName renamesClause DOT
| LEVEL_NUMBER_77 dataDescName dataDescriptionEntryClause* DOT
| LEVEL_NUMBER_88 conditionName conditionValueClause DOT
;
dataDescriptionEntryClause :
dataPictureClause
| dataValueClause
| dataUsageClause
| dataRedefinesClause
| dataExternalClause
| dataGlobalClause
| dataSignClause
| dataOccursClause
| dataSynchronizedClause
| dataJustifiedClause
| dataBlankWhenZeroClause
| obsoletePictureStringClause
;
dataRedefinesClause :
REDEFINES dataName
;
dataBlankWhenZeroClause :
BLANK WHEN? (ZERO | ZEROS | ZEROES)
;
dataJustifiedClause :
(JUSTIFIED | JUST) RIGHT?
;
dataOccursClause :
OCCURS (integerLiteral TO)? integerLiteral TIMES?
(DEPENDING ON? qualifiedDataName)?
(
(ASCENDING | DESCENDING) KEY? IS? qualifiedDataName+
)*
(INDEXED BY? indexName+)?
;
dataPictureClause :
(PICTURE | PIC) IS? pictureString
;
pictureString :
(pictureChars+ pictureCardinality?)+
;
pictureChars :
DOLLARCHAR | IDENTIFIER | integerLiteral | NUMERICLITERAL | keyword | picturePunctuation | ASTERISKCHAR | DOUBLEASTERISKCHAR | LPARENCHAR | RPARENCHAR | PLUSCHAR | MINUSCHAR | LESSTHANCHAR | MORETHANCHAR
;
pictureCardinality :
LPARENCHAR integerLiteral RPARENCHAR
;
picturePunctuation :
SLASHCHAR | COMMACHAR | DOT | COLONCHAR
;
dataExternalClause :
IS? EXTERNAL
;
dataGlobalClause :
IS? GLOBAL
;
dataUsageClause :
(USAGE IS?)?
(
BINARY
| COMP
| COMP_1
| COMP_2
| COMP_3
| COMP_4
| COMPUTATIONAL
| COMPUTATIONAL_1
| COMPUTATIONAL_2
| COMPUTATIONAL_3
| COMPUTATIONAL_4
| DISPLAY
| DISPLAY_1
| INDEX
| PACKED_DECIMAL
| POINTER
)
;
dataSignClause :
(SIGN IS?)? (LEADING | TRAILING) (SEPARATE CHARACTER?)?
;
dataSynchronizedClause :
(SYNCHRONIZED | SYNC) (LEFT | RIGHT)?
;
dataValueClause :
(VALUE IS? | VALUES ARE?)
(
(literal | cobolWord)
(
(THROUGH | THRU) literal
)?
)+
;
conditionValueClause :
dataValueClause
;
renamesClause :
RENAMES qualifiedDataName
(
(THROUGH | THRU) qualifiedDataName
)?
;
// -- working storage section ----------------------------------
workingStorageSection :
WORKING_STORAGE SECTION DOT
dataDescriptionEntry*
;
// -- linkage section ----------------------------------
linkageSection :
LINKAGE SECTION DOT
dataDescriptionEntry*
;
// -- communication section ----------------------------------
communicationSection :
COMMUNICATION SECTION DOT
(communicationDescriptionEntry | dataDescriptionEntry)*
;
communicationDescriptionEntry :
communicationDescriptionEntryFormat1
| communicationDescriptionEntryFormat2
| communicationDescriptionEntryFormat3
;
communicationDescriptionEntryFormat1 :
CD cdName FOR INITIAL? INPUT
(
(
SYMBOLIC QUEUE IS dataDescName
| SYMBOLIC SUB_QUEUE_1 IS dataDescName
| SYMBOLIC SUB_QUEUE_2 IS dataDescName
| SYMBOLIC SUB_QUEUE_3 IS dataDescName
| MESSAGE DATE IS dataDescName
| MESSAGE TIME IS dataDescName
| SYMBOLIC SOURCE IS dataDescName
| TEXT LENGTH IS dataDescName
| END KEY IS dataDescName
| STATUS KEY IS dataDescName
| MESSAGE COUNT IS dataDescName
)
| dataDescName
)*
DOT
;
communicationDescriptionEntryFormat2 :
CD cdName FOR OUTPUT
(
DESTINATION COUNT IS dataDescName
| TEXT LENGTH IS dataDescName
| STATUS KEY IS dataDescName
| DESTINATION TABLE OCCURS integerLiteral TIMES (INDEXED BY indexName+)?
| ERROR KEY IS dataDescName
| SYMBOLIC DESTINATION IS dataDescName
)
DOT
;
communicationDescriptionEntryFormat3 :
CD cdName FOR INITIAL I_O
(
(
MESSAGE DATE IS dataDescName
| MESSAGE TIME IS dataDescName
| SYMBOLIC TERMINAL IS dataDescName
| TEXT LENGTH IS dataDescName
| END KEY IS dataDescName
| STATUS KEY IS dataDescName
)
| dataDescName+
)
DOT
;
// -- screen section ----------------------------------
screenSection :
SCREEN SECTION DOT
;
// -- report section ----------------------------------
reportSection :
REPORT SECTION DOT
(
reportDescriptionEntry reportGroupDescriptionEntry+
)*
;
reportDescriptionEntry :
RD reportName DOT
;
reportGroupDescriptionEntry :
reportGroupDescriptionEntryFormat1
| reportGroupDescriptionEntryFormat2
| reportGroupDescriptionEntryFormat3
;
reportGroupDescriptionEntryFormat1 :
integerLiteral dataName
(
LINE NUMBER? IS?
(
integerLiteral (ON? NEXT PAGE)?
| PLUS integerLiteral
| NEXT PAGE
)
)?
(
NEXT GROUP IS?
(
integerLiteral | PLUS integerLiteral | NEXT PAGE
)
)?
TYPE IS? (
(REPORT HEADING | RH)
| (PAGE HEADING | PH)
| (CONTROL HEADING | CH) (dataName | FINAL)
| (DETAIL | DE)
| (CONTROL FOOTING | CF) (dataName | FINAL)
| (PAGE FOOTING | PF)
| (REPORT FOOTING | RF)
)
(
USAGE IS? (DISPLAY | DISPLAY_1)
)?
DOT
;
reportGroupDescriptionEntryFormat2 :
integerLiteral dataName?
(
LINE NUMBER? IS?
(
integerLiteral (ON? NEXT PAGE)?
| PLUS integerLiteral
| NEXT PAGE
)
)?
(
USAGE IS? (DISPLAY | DISPLAY_1)
)
DOT
;
reportGroupDescriptionEntryFormat3 :
integerLiteral dataName?
(
dataPictureClause
(
(USAGE IS? (DISPLAY | DISPLAY_1))
| (SIGN IS? (LEADING | TRAILING) SEPARATE CHARACTER?)
| ((JUSTIFIED | JUST) RIGHT?)
| (BLANK WHEN? ZERO)
| (
LINE? NUMBER? IS? (
integerLiteral (ON? NEXT PAGE)?
| PLUS integerLiteral
)
)
| (COLUMN NUMBER? IS? integerLiteral)
| (
SOURCE IS? identifier
| VALUE IS? literal
| (
SUM identifier (COMMACHAR identifier)+
(UPON dataName (COMMACHAR dataName)+)?
)
| (RESET ON? (FINAL | dataName))
)
| (GROUP INDICATE?)
)*
)
DOT
;
// --- procedure division --------------------------------------------------------------------
procedureDivision :
PROCEDURE DIVISION (USING dataName+)? (GIVING dataName)? DOT
procedureDeclaratives?
procedureDivisionBody
;
procedureDeclaratives :
DECLARATIVES DOT
(
procedureSectionHeader DOT
useStatement DOT
paragraphs
)+
END DECLARATIVES DOT
;
procedureDivisionBody :
paragraphs procedureSection*
;
procedureSectionHeader :
sectionName SECTION integerLiteral?
;
// -- procedure section ----------------------------------
procedureSection :
procedureSectionHeader DOT paragraphs
;
paragraphs :
sentence* paragraph*
;
paragraph :
paragraphName DOT
(
exitStatement
| alteredGoTo
| sentence*
)
;
sentence :
statements DOT
;
statements :
statement*
;
statement :
acceptStatement
| addStatement
| alterStatement
| callStatement
| cancelStatement
| closeStatement
| computeStatement
| continueStatement
| deleteStatement
| disableStatement
| displayStatement
| divideStatement
| enableStatement
| entryStatement
| evaluateStatement
| exitProgramStatement
| exitStatement
| generateStatement
| gobackStatement
| goToStatement
| ifStatement
| initializeStatement
| initiateStatement
| inspectStatement
| mergeStatement
| moveStatement
| multiplyStatement
| openStatement
| performStatement
| purgeStatement
| readStatement
| receiveStatement
| releaseStatement
| returnStatement
| rewriteStatement
| searchStatement
| sendStatement
| setStatement
| sortStatement
| startStatement
| stopStatement
| stringStatement
| subtractStatement
| terminateStatement
| unstringStatement
| writeStatement
;
// accept statement
acceptStatement :
acceptFromDate
| acceptFromMnemonic
| acceptMessageCount
;
acceptFromDate :
ACCEPT identifier FROM
(
DATE YYYYMMDD?
| DAY YYYYDDD?
| DAY_OF_WEEK
| TIME
| TIMER
| YEAR
| YYYYMMDD
| YYYYDDD
)
;
acceptFromMnemonic :
ACCEPT identifier (FROM mnemonicName)?
;
acceptMessageCount :
ACCEPT identifier MESSAGE? COUNT
;
// add statement
addStatement :
ADD
(
addToStatement
| addToGivingStatement
| addCorrespondingStatement
)
(ON? SIZE ERROR statements)?
(NOT ON? SIZE ERROR statements)?
END_ADD?
;
addToStatement :
(identifier | literal)+ TO (identifier ROUNDED?)+
;
addToGivingStatement :
(identifier | literal)+ (TO (identifier)+)? GIVING (identifier ROUNDED?)+
;
addCorrespondingStatement :
(CORRESPONDING | CORR) identifier TO identifier ROUNDED?
;
// altered go to statement
alteredGoTo :
GO TO? DOT
;
// alter statement
alterStatement :
ALTER (procedureName TO (PROCEED TO)? procedureName)+
;
// call statement
callStatement :
CALL (identifier | literal)
(
USING (callByReferenceStatement | callByContentStatement)+
)?
(ON? OVERFLOW statements)?
onExceptionClause?
notOnExceptionClause?
END_CALL?
;
callByReferenceStatement :
(BY? REFERENCE)? (identifier | ADDRESS OF identifier | fileName)+
;
callByContentStatement :
BY? CONTENT ((LENGTH OF)? identifier | ADDRESS OF identifier | literal)+
;
// cancel statement
cancelStatement :
CANCEL (identifier | literal)+
;
// close statement
closeStatement :
CLOSE
(
fileName (closeReelUnitStatement | closeWithStatement)?
)+
;
closeReelUnitStatement :
(REEL | UNIT) (FOR? REMOVAL | WITH? NO REWIND)?
;
closeWithStatement :
WITH? (NO REWIND | LOCK)
;
// compute statement
computeStatement :
COMPUTE (identifier ROUNDED?)+
(EQUALCHAR | EQUAL)
arithmeticExpression
(ON? SIZE ERROR statements)?
(NOT ON? SIZE ERROR statements)?
END_COMPUTE?
;
// continue statement
continueStatement :
CONTINUE
;
// delete statement
deleteStatement :
DELETE fileName RECORD?
(INVALID KEY? statements)?
(NOT INVALID KEY? statements)?
END_DELETE?
;
// disable statement
disableStatement :
DISABLE
(INPUT TERMINAL? | I_O TERMINAL | OUTPUT)
cdName WITH KEY (identifier | literal)
;
// display statement
displayStatement :
DISPLAY (identifier | literal)+
(UPON (mnemonicName | environmentName))?
(WITH? NO ADVANCING)?
;
// divide statement
divideStatement :
DIVIDE (identifier | literal)
(
divideIntoStatement
| divideIntoGivingStatement
| divideIntoByGivingStatement
)
(REMAINDER identifier)?
(ON? SIZE ERROR statements)?
(NOT ON? SIZE ERROR statements)?
END_DIVIDE?
;
divideIntoStatement :
INTO (identifier | literal) (GIVING (identifier ROUNDED?)+)?
;
divideIntoGivingStatement :
INTO (identifier ROUNDED?)+
;
divideIntoByGivingStatement :
BY (identifier | literal) (GIVING (identifier ROUNDED?)+)?
;
// enable statement
enableStatement :
ENABLE (INPUT TERMINAL? | I_O TERMINAL | OUTPUT)
cdName WITH? KEY (literal | identifier)
;
// entry statement
entryStatement :
ENTRY literal (USING identifier+)?
;
// evaluate statement
evaluateStatement :
EVALUATE evaluateValue
(ALSO evaluateValue)*
(
(WHEN evaluatePhrase (ALSO evaluatePhrase)*)+
statements
)+
(WHEN OTHER statements)?
END_EVALUATE?
;
evaluateValue :
arithmeticExpression
| identifier
| literal
| condition
;
evaluatePhrase :
ANY
| condition
| booleanLiteral
| NOT? (identifier | literal | arithmeticExpression) (
(THROUGH | THRU) (identifier | literal | arithmeticExpression)
)?
;
// exit program statement
exitProgramStatement :
EXIT PROGRAM
;
// exit statement
exitStatement :
EXIT
;
// generate statement
generateStatement :
GENERATE (dataName | reportName)
;
// goback statement
gobackStatement :
GOBACK
;
// goto statement
goToStatement :
GO TO?
(
procedureName+ (DEPENDING ON? identifier)?
| MORE_LABELS
)
;
// if statement
ifStatement :
IF condition THEN? (statement* | NEXT SENTENCE)
(
ELSE (statement* | NEXT SENTENCE)
)?
END_IF?
;
// initialize statement
initializeStatement :
INITIALIZE identifier+
(
REPLACING
(
(
ALPHABETIC
| ALPHANUMERIC
| NUMERIC
| ALPHANUMERIC_EDITED
| NUMERIC_EDITED
| DBCS
| EGCS
)
DATA? BY (identifier | literal)
)+
)?
;
// initiate statement
initiateStatement :
INITIATE reportName+
;
// inspect statement
inspectStatement :
INSPECT identifier
(
inspectTallyingPhrase
| inspectConvertingPhrase
| inspectReplacingPhrase
)
;
inspectTallyingPhrase :
TALLYING
(
identifier FOR
(
CHARACTERS inspectBeforeAfterPhrase*
|
(ALL | LEADING)
(
(identifier | literal) inspectBeforeAfterPhrase*
)+
)+
)+
inspectReplacingPhrase?
;
inspectConvertingPhrase :
CONVERTING (identifier | literal)
TO (identifier | literal) inspectBeforeAfterPhrase*
;
inspectReplacingPhrase :
REPLACING
(
CHARACTERS BY (identifier | literal) inspectBeforeAfterPhrase*
| (ALL | LEADING | FIRST)
(
(identifier | literal) BY (identifier | literal)
inspectBeforeAfterPhrase*
)+
)+
;
inspectBeforeAfterPhrase :
(BEFORE | AFTER) INITIAL? (identifier | literal)
;
// merge statement
mergeStatement :
MERGE fileName
(ON? (ASCENDING | DESCENDING) KEY? qualifiedDataName+)+
(COLLATING? SEQUENCE IS? alphabetName)? USING fileName fileName+
(
OUTPUT PROCEDURE IS? procedureName (
(THROUGH | THRU) procedureName
)?
| GIVING fileName+
)
;
// move statement
moveStatement :
MOVE
(
moveToStatement
| moveCorrespondingToStatement
)
;
moveToStatement :
(identifier | literal) TO identifier+
;
moveCorrespondingToStatement :
(CORRESPONDING | CORR) qualifiedDataName TO identifier+
;
// multiply statement
multiplyStatement :
(
multiplyRegular
| multiplyGiving
)
(ON? SIZE ERROR statements)?
(NOT ON? SIZE ERROR statements)?
END_MULTIPLY?
;
multiplyRegular :
MULTIPLY (identifier | literal) BY (identifier ROUNDED?)+
;
multiplyGiving :
MULTIPLY (identifier | literal) BY (identifier | literal)
GIVING (identifier ROUNDED?)+
;
// open statement
openStatement :
OPEN
(
openInputStatement
| openOutputStatement
| openIOStatement
| openExtendStatement
)+
;
openInputStatement :
INPUT (fileName (REVERSED | WITH? NO REWIND)?)+
;
openOutputStatement :
OUTPUT (fileName (WITH? NO REWIND)?)+
;
openIOStatement :
I_O fileName+
;
openExtendStatement :
EXTEND fileName+
;
// perform statement
performStatement :
performInlineStatement
| performProcedureStatement
;
performInlineStatement :
PERFORM performType? statement+ END_PERFORM
;
performProcedureStatement :
PERFORM procedureName ((THROUGH | THRU) procedureName)? performType?
;
performType :
performTimes
| performUntil
| performVarying
;
performTimes :
(identifier | integerLiteral) TIMES
;
performUntil :
performTestClause? UNTIL condition
;
performVarying :
performTestClause performVaryingClause
| performVaryingClause performTestClause?
;
performVaryingClause :
VARYING (identifier | literal)
FROM (identifier | literal | arithmeticExpression)
BY (identifier | literal | arithmeticExpression)
performUntil
(
AFTER (identifier)
FROM (identifier | literal | arithmeticExpression)
BY (identifier | literal | arithmeticExpression)
performUntil
)*
(statement+ END_PERFORM)?
;
performTestClause :
WITH? TEST (BEFORE | AFTER)
;
// purge statement
purgeStatement :
PURGE cdName+
;
// read statement
readStatement :
READ fileName
NEXT? RECORD?
(INTO identifier)?
(
WITH?
(
(KEPT | NO) LOCK
| WAIT
)
)?
(KEY IS? qualifiedDataName)?
(INVALID KEY? statements)?
(NOT INVALID KEY? statements)?
(AT? END statements)?
(NOT AT? END statements)?
END_READ?
;
// receive statement
receiveStatement :
RECEIVE
(
dataName FROM (THREAD dataName | LAST THREAD | ANY THREAD)
(
BEFORE TIME? (numericLiteral | identifier)
| WITH? NO WAIT
| THREAD IN? dataName
| SIZE IN? (numericLiteral | identifier)
| STATUS IN? (identifier)
| onExceptionClause
| notOnExceptionClause
)
| cdName (MESSAGE | SEGMENT) INTO? identifier (NO DATA statements)? (WITH DATA statements)?
)
END_RECEIVE?
;
// release statement
releaseStatement :
RELEASE recordName (FROM qualifiedDataName)?
;
// return statement
returnStatement :
RETURN fileName RECORD? (INTO qualifiedDataName)?
AT? END statements
(NOT AT? END statements)?
END_RETURN?
;
// rewrite statement
rewriteStatement :
REWRITE recordName (FROM identifier)?
(INVALID KEY? statements)?
(NOT INVALID KEY? statements)?
END_REWRITE?
;
// search statement
searchStatement :
SEARCH ALL? qualifiedDataName
(VARYING qualifiedDataName)?
(AT? END statements)?
(WHEN condition (statements | NEXT SENTENCE))+
END_SEARCH?
;
// send statement
sendStatement :
sendStatementSync | sendStatementAsync
;
sendStatementSync :
SEND (identifier | literal) (FROM identifier)?
(
WITH (identifier | EGI | EMI | ESI)
)?
(REPLACING LINE?)?
onExceptionClause?
notOnExceptionClause?
;
sendStatementAsync :
SEND TO (TOP | BOTTOM) identifier
onExceptionClause?
notOnExceptionClause?
;
// set statement
setStatement :
setToStatement
| setUpDownByStatement
;
setToStatement :
SET
(
identifier+ TO (identifier | ON | OFF | literal)
)+
;
setUpDownByStatement :
SET identifier+ (UP | DOWN) BY? (identifier | literal)
;
// sort statement
sortStatement :
SORT fileName
(ON? (ASCENDING | DESCENDING) KEY? qualifiedDataName+)+
(WITH? DUPLICATES IN? ORDER?)?
(COLLATING? SEQUENCE IS? alphabetName)?
(USING fileName+ | INPUT PROCEDURE IS? procedureName ((THROUGH | THRU) procedureName)?)
(GIVING fileName+ | OUTPUT PROCEDURE IS? procedureName ((THROUGH | THRU) procedureName)?)
;
// start statement
startStatement :
START fileName
(KEY IS? (
EQUAL TO?
| EQUALCHAR
| GREATER THAN?
| MORETHANCHAR
| NOT LESS THAN?
| NOT LESSTHANCHAR
| GREATER THAN? OR EQUAL TO?
| MORETHANOREQUAL
) qualifiedDataName)?
(INVALID KEY? statements)?
(NOT INVALID KEY? statements)?
END_START?
;
// stop statement
stopStatement :
STOP (RUN | literal)
;
// string statement
stringStatement :
STRING
(
(tableCall | literal)+
DELIMITED BY? (identifier | literal | SIZE)
)+
INTO identifier
(WITH? POINTER qualifiedDataName)?
(ON? OVERFLOW statements)?
(NOT ON? OVERFLOW statements)?
END_STRING?
;
// subtract statement
subtractStatement :
SUBTRACT
(
subtractFromStatement
| subtractFromGivingStatement
| subtractCorrespondingStatement
)
(ON? SIZE ERROR statements)?
(NOT ON? SIZE ERROR statements)?
END_SUBTRACT?
;
subtractFromStatement :
(identifier | literal)+ FROM (identifier ROUNDED?)+
;
subtractFromGivingStatement :
(identifier | literal)+ FROM (identifier | literal) ROUNDED? GIVING (identifier ROUNDED?)+
;
subtractCorrespondingStatement :
(CORRESPONDING | CORR) qualifiedDataName FROM qualifiedDataName ROUNDED?
;
// terminate statement
terminateStatement :
TERMINATE reportName
;
// unstring statement
unstringStatement :
UNSTRING qualifiedDataName
(
DELIMITED BY? ALL? (identifier | literal) (OR ALL? (identifier | literal))*
)?
INTO
(
identifier (DELIMITER IN? identifier)? (COUNT IN? identifier)?
)+
(WITH? POINTER qualifiedDataName)?
(TALLYING IN? qualifiedDataName)?
(ON? OVERFLOW statements)?
(NOT ON? OVERFLOW statements)?
END_UNSTRING?
;
// use statement
useStatement :
USE (
useProcedureClause
| useProcedureDebugClause
)
;
useProcedureClause :
GLOBAL? AFTER STANDARD?
(
(EXCEPTION | ERROR)
| (BEGINNING | ENDING)? (FILE | REEL | UNIT)? LABEL
)
PROCEDURE ON? (fileName+ | INPUT | OUTPUT | I_O | EXTEND)
(GIVING dataName+)?
;
useProcedureDebugClause :
FOR? DEBUGGING ON? (
ALL PROCEDURES
| ALL REFERENCES? OF identifier
| procedureName+
| fileName+
)
;
// write statement
writeStatement :
WRITE recordName (FROM (identifier | literal))?
writeAdvancingPhrase?
(AT? (END_OF_PAGE | EOP) statements)?
(NOT AT? (END_OF_PAGE | EOP) statements)?
(INVALID KEY? statements)?
(NOT INVALID KEY? statements)?
END_WRITE?
;
writeAdvancingPhrase :
(BEFORE | AFTER) ADVANCING?
(
PAGE
| (identifier | literal) (LINE | LINES)?
| mnemonicName
)
;
// statement clauses ----------------------------------
onExceptionClause :
ON? EXCEPTION statements
;
notOnExceptionClause :
NOT ON? EXCEPTION statements
;
// arithmetic expression ----------------------------------
arithmeticExpression :
timesDiv ((PLUSCHAR | MINUSCHAR) timesDiv)*
;
timesDiv :
power ((ASTERISKCHAR | SLASHCHAR) power)*
;
power :
(PLUSCHAR | MINUSCHAR)? basis (DOUBLEASTERISKCHAR basis)*
;
basis :
(identifier | literal | LPARENCHAR arithmeticExpression RPARENCHAR)
;
commentEntry :
(
(
literal |
cobolWord |
keyword |
AMPCHAR |
ASTERISKCHAR |
COLONCHAR |
COMMACHAR |
COMMENTTAG |
DOLLARCHAR |
DOUBLEQUOTE |
DOT |
EQUALCHAR |
LESSTHANCHAR |
LESSTHANOREQUAL |
LPARENCHAR |
MINUSCHAR |
MORETHANCHAR |
MORETHANOREQUAL |
PLUSCHAR |
RPARENCHAR |
SINGLEQUOTE |
SLASHCHAR
)+
DOT
)+
;
// logical expressions ----------------------------------
condition :
combinableCondition (
(AND | OR) (combinableCondition | abbreviationRest)
)*
;
combinableCondition : NOT? simpleCondition;
simpleCondition :
LPARENCHAR condition RPARENCHAR
| relationCondition
| classCondition
| conditionNameCondition
;
classCondition :
identifier IS? NOT?
(
NUMERIC
| ALPHABETIC
| ALPHABETIC_LOWER
| ALPHABETIC_UPPER
| className
| DBCS
| KANJI
)
;
conditionNameCondition :
conditionNameReference
;
conditionNameReference :
conditionName
(
((IN | OF) dataName)*
((IN | OF) fileName)?
(LPARENCHAR subscript RPARENCHAR)*
|
((IN | OF) mnemonicName)*
)
;
relationCondition :
arithmeticExpression (relationalOperator arithmeticExpression | signCondition)
;
signCondition :
IS? NOT? (POSITIVE | NEGATIVE | ZERO)
;
relationalOperator :
(IS | ARE)?
(
NOT? (
GREATER THAN?
| MORETHANCHAR
| LESS THAN?
| LESSTHANCHAR
| EQUAL TO?
| EQUALCHAR
)
| GREATER THAN? OR EQUAL TO?
| MORETHANOREQUAL
| LESS THAN? OR EQUAL TO?
| LESSTHANOREQUAL
)
;
abbreviationRest :
(NOT? relationalOperator? abbreviationLeaf)+
;
abbreviationLeaf :
arithmeticExpression
| LPARENCHAR arithmeticExpression abbreviationRest RPARENCHAR
;
// names ----------------------------------
alphabetName :
cobolWord
;
assignmentName :
systemName
;
basisName :
programName
;
cdName :
cobolWord
;
className :
cobolWord
;
computerName :
systemName
;
conditionName :
cobolWord
;
dataName :
cobolWord
;
dataDescName :
FILLER | CURSOR | dataName
;
environmentName :
systemName
;
fileName :
cobolWord
;
functionName :
cobolWord
| LENGTH
| RANDOM
| SUM
| WHEN_COMPILED
;
indexName :
cobolWord
;
languageName :
systemName
;
libraryName :
cobolWord
;
mnemonicName :
cobolWord
;
paragraphName :
cobolWord | integerLiteral
;
procedureName :
paragraphName ((IN | OF) sectionName)?
| sectionName
;
programName :
cobolWord
;
qualifiedDataName :
dataName
((IN | OF) (dataName | tableCall))*
((IN | OF) fileName)?
|
specialRegister
;
recordName :
qualifiedDataName
;
reportName :
qualifiedDataName
;
routineName :
cobolWord
;
sectionName :
cobolWord | integerLiteral
;
systemName :
cobolWord
;
symbolicCharacter :
cobolWord
;
specialRegister :
ADDRESS OF dataName
| DEBUG_ITEM
| LENGTH OF identifier
| RETURN_CODE
| SHIFT_OUT
| SHIFT_IN
| SORT_CONTROL
| SORT_CORE_SIZE
| SORT_FILE_SIZE
| SORT_MESSAGE
| SORT_MODE_SIZE
| SORT_RETURN
| TALLY
| WHEN_COMPILED
;
// identifier ----------------------------------
identifier :
qualifiedDataName
| tableCall
| functionCall
| linageCounterCall
;
// array access
tableCall :
qualifiedDataName (LPARENCHAR subscript RPARENCHAR)* (LPARENCHAR characterPosition COLONCHAR length? RPARENCHAR)?
;
functionCall :
FUNCTION functionName (LPARENCHAR argument RPARENCHAR)* (LPARENCHAR characterPosition COLONCHAR length? RPARENCHAR)?
;
linageCounterCall :
LINAGE_COUNTER ((IN | OF) fileName)?
;
length :
arithmeticExpression
;
characterPosition :
arithmeticExpression
;
subscript :
(
integerLiteral
| qualifiedDataName integerLiteral?
| indexName integerLiteral?
| arithmeticExpression
| ALL
)+
;
argument :
(
literal
| identifier
| qualifiedDataName integerLiteral?
| indexName integerLiteral?
| arithmeticExpression
)+
;
obsoletePictureStringClause :
pictureString
;
// literal ----------------------------------
cobolWord : IDENTIFIER;
literal : NONNUMERICLITERAL | numericLiteral | booleanLiteral | figurativeConstant;
booleanLiteral : TRUE | FALSE;
numericLiteral : NUMERICLITERAL | integerLiteral | ZERO;
integerLiteral : INTEGERLITERAL | LEVEL_NUMBER_66 | LEVEL_NUMBER_77 | LEVEL_NUMBER_88;
figurativeConstant :
ALL literal | HIGH_VALUE | HIGH_VALUES | LOW_VALUE | LOW_VALUES | NULL | NULLS | QUOTE | QUOTES | SPACE | SPACES | ZERO | ZEROS | ZEROES
;
// keywords ----------------------------------
keyword :
ACCEPT | ACCESS | ADD | ADDRESS | ADVANCING | AFTER | ALL | ALPHABET | ALPHABETIC | ALPHABETIC_LOWER | ALPHABETIC_UPPER | ALPHANUMERIC | ALPHANUMERIC_EDITED | ALSO | ALTER | ALTERNATE | AND | ANY | APOST | APPROXIMATE | ARE | AREA | AREAS | ARITH | AS | ASCENDING | ASCII | ASSIGN | AT | AUTHOR
| BEFORE | BEGINNING | BINARY | BLANK | BLOCK | BOTTOM | BY
| CALL | CANCEL | CD | CF | CH | CHANNEL | CHARACTER | CHARACTERS | CLASS | CLOCK_UNITS | CLOSE | COBOL | CODE | CODEPAGE | CODE_SET | COLLATING | COLUMN | COMMA | COMMITMENT | COMMON | COMMUNICATION | COMP | COMP_1 | COMP_2 | COMP_3 | COMP_4 | COMPUTATIONAL | COMPUTATIONAL_1 | COMPUTATIONAL_2 | COMPUTATIONAL_3 | COMPUTATIONAL_4 | COMPUTE | CONFIGURATION | CONTAINS | CONTENT | CONTINUE | CONTROL | CONTROLS | CONVERTING | COPY | CORR | CORRESPONDING | COUNT | CURRENCY | CURSOR
| DATA | DATE | DATE_COMPILED | DATE_WRITTEN | DAY | DAY_OF_WEEK | DBCS | DE | DEBUG_CONTENTS | DEBUG_ITEM | DEBUG_LINE | DEBUG_NAME | DEBUG_SUB_1 | DEBUG_SUB_2 | DEBUG_SUB_3 | DEBUGGING | DECIMAL_POINT | DECLARATIVES | DEFINITION | DELETE | DELIMITED | DELIMITER | DEPENDING | DESCENDING | DESTINATION | DETAIL | DISABLE | DISK | DISPLAY | DISPLAY_1 | DIVIDE | DIVISION | DOWN | DUPLICATES | DYNAMIC
| EBCDIC | EGCS | EGI | ELSE | EMI | ENABLE | END | END_ADD | END_CALL | END_COMPUTE | END_DELETE | END_DIVIDE | END_EVALUATE | END_IF | END_MULTIPLY | END_OF_PAGE | END_PERFORM | END_READ | END_RECEIVE | END_RETURN | END_REWRITE | END_SEARCH | END_START | END_STRING | END_SUBTRACT | END_UNSTRING | END_WRITE | ENDING | ENTER | ENTRY | ENVIRONMENT | EOP | EQUAL | ERROR | ESI | EVALUATE | EVERY | EXCEPTION | EXCLUSIVE | EXIT | EXTEND | EXTERNAL
| FALSE | FD | FILE | FILE_CONTROL | FILLER | FINAL | FIRST | FOOTING | FOR | FROM | FULL | FUNCTION
| GENERATE | GOBACK | GENERIC | GIVING | GLOBAL | GO | GREATER | GROUP
| HEADING | HIGH_VALUE | HIGH_VALUES
| I_O | I_O_CONTROL | ID | IDENTIFICATION | IF | IMPLICIT | IN | INDEX | INDEXED | INDICATE | INITIAL | INITIALIZE | INITIATE | INPUT | INPUT_OUTPUT | INSPECT | INSTALLATION | INTO | INVALID | IS
| JUST | JUSTIFIED | JUSTIFY
| KANJI | KEPT | KEY
| LABEL | LAST | LEADING | LEFT | LENGTH | LESS | LIB | LIBRARY | LIMIT | LIMITS | LINAGE | LINAGE_COUNTER | LINE | LINES | LINE_COUNTER | LINKAGE | LOCK | LOCKFILE | LOW_VALUE | LOW_VALUES
| MEMORY | MERGE | MESSAGE | MODE | MODULES | MORE_LABELS | MOVE | MULTIPLE | MULTIPLY
| NATIONAL | NATIVE | NEGATIVE | NEXT | NO | NOSEQ | NOT | NULL | NULLS | NUMBER | NUMERIC | NUMERIC_EDITED
| OBJECT_COMPUTER | OCCURS | ODT | OF | OFF | OMITTED | ON | OPEN | OPTIMIZE | OPTIONAL | OR | ORDER | ORGANIZATION | OTHER | OUTPUT | OVERFLOW
| PACKED_DECIMAL | PADDING | PAGE | PAGE_COUNTER | PASSWORD | PERFORM | PF | PH | PIC | PICTURE | PLUS | POINTER | POSITION | POSITIVE | PRINTING | PROCEDURE | PROCEDURES | PROCEED | PROCESS | PROGRAM | PROGRAM_ID | PROGRAM_STATUS | PROMPT | PROTECTED | PURGE
| QUEUE | QUOTE | QUOTES
| RANDOM | RD | READ | RECEIVE | RECEIVE_CONTROL | RECORD | RECORDING | RECORDS | REDEFINES | REEL | REFERENCE | REFERENCES | RELATIVE | RELEASE | REMAINDER | REMOVAL | RENAMES | REPLACE | REPLACING | REPLY | REPORT | REPORTING | REPORTS | RERUN | RESERVE | RESET | RETURN | RETURN_CODE | RETURNED | REVERSED | REWIND | REWRITE | RF | RH | RIGHT | ROUNDED | RUN
| SAME | SCREEN | SD | SEARCH | SECTION | SECURITY | SEGMENT | SEGMENT_LIMIT | SELECT | SEND | SENTENCE | SEPARATE | SEQUENCE | SEQUENTIAL | SET | SHARED | SHIFT_IN | SHIFT_OUT | SIGN | SIZE | SORT | SORT_CONTROL | SORT_CORE_SIZE | SORT_FILE_SIZE | SORT_MERGE | SORT_MESSAGE | SORT_MODE_SIZE | SORT_RETURN | SOURCE | SOURCE_COMPUTER | SP | SPACE | SPACES | SPECIAL_NAMES | STANDARD | STANDARD_1 | STANDARD_2 | START | STATUS | STOP | STRING | SUB_QUEUE_1 | SUB_QUEUE_2 | SUB_QUEUE_3 | SUBTRACT | SUM | SUPPRESS | SYMBOLIC | SYNC | SYNCHRONIZED
| TABLE | TALLY | TALLYING | TAPE | TERMINAL | TERMINATE | TEST | TEXT | THAN | THEN | THREAD | THROUGH | THRU | TIME | TIMER | TIMES | TO | TOP | TRAILING | TRUE | TYPE
| UNIT | UNLOCK | UNLOCKFILE | UNLOCKRECORD | UNSTRING | UNTIL | UP | UPON | USAGE | USE | USING
| VALUE | VALUES | VARYING
| WAIT | WHEN | WHEN_COMPILED | WITH | WORDS | WORKING_STORAGE | WRITE
| XOPTS
| YEAR | YYYYMMDD | YYYYDDD
| ZERO | ZEROS| ZEROES
;
// lexer rules --------------------------------------------------------------------------------
// keywords
ACCEPT : A C C E P T;
ACCESS : A C C E S S;
ADD : A D D;
ADDRESS : A D D R E S S;
ADVANCING : A D V A N C I N G;
AFTER : A F T E R;
ALL : A L L;
ALPHABET : A L P H A B E T;
ALPHABETIC : A L P H A B E T I C;
ALPHABETIC_LOWER : A L P H A B E T I C MINUSCHAR L O W E R;
ALPHABETIC_UPPER : A L P H A B E T I C MINUSCHAR U P P E R;
ALPHANUMERIC : A L P H A N U M E R I C;
ALPHANUMERIC_EDITED : A L P H A N U M E R I C MINUSCHAR E D I T E D;
ALSO : A L S O;
ALTER : A L T E R;
ALTERNATE : A L T E R N A T E;
AND : A N D;
ANY : A N Y;
APOST : A P O S T;
APPROXIMATE : A P P R O X I M A T E;
ARE : A R E;
AREA : A R E A;
AREAS : A R E A S;
ARITH : A R I T H;
AS : A S;
ASCENDING : A S C E N D I N G;
ASCII : A S C I I;
ASSIGN : A S S I G N;
AT : A T;
AUTHOR : <NAME>;
BEFORE : B E F O R E;
BEGINNING : B E G I N N I N G;
BINARY : B I N A R Y;
BLANK : B L A N K;
BLOCK : B L O C K;
BOTTOM : B O T T O M;
BY : B Y;
CALL : C A L L;
CANCEL : C A N C E L;
CD : C D;
CF : C F;
CH : C H;
CHANNEL : C H A N N E L;
CHARACTER : C H A R A C T E R;
CHARACTERS : C H A R A C T E R S;
CLASS : C L A S S;
CLOCK_UNITS : C L O C K MINUSCHAR U N I T S;
CLOSE : C L O S E;
COBOL : C O B O L;
CODE : C O D E;
CODEPAGE : C O D E P A G E;
CODE_SET : C O D E MINUSCHAR S E T;
COLLATING : C O L L A T I N G;
COLUMN : C O L U M N;
COMMA : C O M M A;
COMMITMENT : C O M M I T M E N T;
COMMON : C O M M O N;
COMMUNICATION : C O M M U N I C A T I O N;
COMP : C O M P;
COMP_1 : C O M P MINUSCHAR '1';
COMP_2 : C O M P MINUSCHAR '2';
COMP_3 : C O M P MINUSCHAR '3';
COMP_4 : C O M P MINUSCHAR '4';
COMPUTATIONAL : C O M P U T A T I O N A L;
COMPUTATIONAL_1 : C O M P U T A T I O N A L MINUSCHAR '1';
COMPUTATIONAL_2 : C O M P U T A T I O N A L MINUSCHAR '2';
COMPUTATIONAL_3 : C O M P U T A T I O N A L MINUSCHAR '3';
COMPUTATIONAL_4 : C O M P U T A T I O N A L MINUSCHAR '4';
COMPUTE : C O M P U T E;
CONFIGURATION : C O N F I G U R A T I O N;
CONTAINS : C O N T A I N S;
CONTENT : C O N T E N T;
CONTINUE : C O N T I N U E;
CONTROL : C O N T R O L;
CONTROLS : C O N T R O L S;
CONVERTING : C O N V E R T I N G;
COPY : C O P Y;
CORR : C O R R;
CORRESPONDING : C O R R E S P O N D I N G;
COUNT : C O U N T;
CURRENCY : C U R R E N C Y;
CURSOR : C U R S O R;
DATA : D A T A;
DATE : D A T E;
DATE_COMPILED : D A T E MINUSCHAR C O M P I L E D;
DATE_WRITTEN : D A T E MINUSCHAR W R I T T E N;
DAY : D A Y;
DAY_OF_WEEK : D A Y MINUSCHAR O F MINUSCHAR W E E K;
DBCS : D B C S;
DE : D E;
DEBUG_CONTENTS : D E B U G MINUSCHAR C O N T E N T S;
DEBUG_ITEM : D E B U G MINUSCHAR I T E M;
DEBUG_LINE : D E B U G MINUSCHAR L I N E;
DEBUG_NAME : D E B U G MINUSCHAR N A M E;
DEBUG_SUB_1 : D E B U G MINUSCHAR S U B MINUSCHAR '1';
DEBUG_SUB_2 : D E B U G MINUSCHAR S U B MINUSCHAR '2';
DEBUG_SUB_3 : D E B U G MINUSCHAR S U B MINUSCHAR '3';
DEBUGGING : D E B U G G I N G;
DECIMAL_POINT : D E C I M A L MINUSCHAR P O I N T;
DECLARATIVES : D E C L A R A T I V E S;
DEFINITION : D E F I N I T I O N;
DELETE : D E L E T E;
DELIMITED : D E L I M I T E D;
DELIMITER : D E L I M I T E R;
DEPENDING : D E P E N D I N G;
DESCENDING : D E S C E N D I N G;
DESTINATION : D E S T I N A T I O N;
DETAIL : D E T A I L;
DISABLE : D I S A B L E;
DISK : D I S K;
DISPLAY : D I S P L A Y;
DISPLAY_1 : D I S P L A Y MINUSCHAR '1';
DIVIDE : D I V I D E;
DIVISION : D I V I S I O N;
DOWN : D O W N;
DUPLICATES : D U P L I C A T E S;
DYNAMIC : D Y N A M I C;
EBCDIC : E B C D I C;
EGCS : E G C S; // E X T E N S I O N
EGI : E G I;
ELSE : E L S E;
EMI : E M I;
ENABLE : E N A B L E;
END : E N D;
END_ADD : E N D MINUSCHAR A D D;
END_CALL : E N D MINUSCHAR C A L L;
END_COMPUTE : E N D MINUSCHAR C O M P U T E;
END_DELETE : E N D MINUSCHAR D E L E T E;
END_DIVIDE : E N D MINUSCHAR D I V I D E;
END_EVALUATE : E N D MINUSCHAR E V A L U A T E;
END_IF : E N D MINUSCHAR I F;
END_MULTIPLY : E N D MINUSCHAR M U L T I P L Y;
END_OF_PAGE : E N D MINUSCHAR O F MINUSCHAR P A G E;
END_PERFORM : E N D MINUSCHAR P E R F O R M;
END_READ : E N D MINUSCHAR R E A D;
END_RECEIVE : E N D MINUSCHAR R E C E I V E;
END_RETURN : E N D MINUSCHAR R E T U R N;
END_REWRITE : E N D MINUSCHAR R E W R I T E;
END_SEARCH : E N D MINUSCHAR S E A R C H;
END_START : E N D MINUSCHAR S T A R T;
END_STRING : E N D MINUSCHAR S T R I N G;
END_SUBTRACT : E N D MINUSCHAR S U B T R A C T;
END_UNSTRING : E N D MINUSCHAR U N S T R I N G;
END_WRITE : E N D MINUSCHAR W R I T E;
ENDING : E N D I N F;
ENTER : E N T E R;
ENTRY : E N T R Y;
ENVIRONMENT : E N V I R O N M E N T;
EOP : E O P;
EQUAL : E Q U A L;
ERROR : E R R O R;
ESI : E S I;
EVALUATE : E V A L U A T E;
EVERY : E V E R Y;
EXCEPTION : E X C E P T I O N;
EXCLUSIVE : E X C L U S I V E;
EXIT : E X I T;
EXTEND : E X T E N D;
EXTERNAL : E X T E R N A L;
FALSE : F A L S E;
FD : F D;
FILE : F I L E;
FILE_CONTROL : F I L E MINUSCHAR C O N T R O L;
FILLER : F I L L E R;
FINAL : F I N A L;
FIRST : F I R S T;
FOOTING : F O O T I N G;
FOR : F O R;
FROM : F R O M;
FULL : F U L L;
FUNCTION : F U N C T I O N;
GENERATE : G E N E R A T E;
GOBACK : G O B A C K;
GENERIC : G E N E R I C;
GIVING : G I V I N G;
GLOBAL : G L O B A L;
GO : G O;
GREATER : G R E A T E R;
GROUP : G R O U P;
HEADING : H E A D I N G;
HIGH_VALUE : H I G H MINUSCHAR V A L U E;
HIGH_VALUES : H I G H MINUSCHAR V A L U E S;
I_O : I MINUSCHAR O;
I_O_CONTROL : I MINUSCHAR O MINUSCHAR C O N T R O L;
ID : I D;
IDENTIFICATION : I D E N T I F I C A T I O N;
IF : I F;
IMPLICIT : I M P L I C I T;
IN : I N;
INDEX : I N D E X;
INDEXED : I N D E X E D;
INDICATE : I N D I C A T E;
INITIAL : I N I T I A L;
INITIALIZE : I N I T I A L I Z E;
INITIATE : I N I T I A T E;
INPUT : I N P U T;
INPUT_OUTPUT : I N P U T MINUSCHAR O U T P U T;
INSPECT : I N S P E C T;
INSTALLATION : I N S T A L L A T I O N;
INTO : I N T O;
INVALID : I N V A L I D;
IS : I S;
JUST : J U S T;
JUSTIFIED : J U S T I F I E D;
JUSTIFY : J U S T I F Y;
KANJI : K A N J I;
KEPT : K E P T;
KEY : K E Y;
LABEL : L A B E L;
LAST : L A S T;
LEADING : L E A D I N G;
LEFT : L E F T;
LENGTH : L E N G T H;
LESS : L E S S;
LIB : L I B;
LIBRARY : L I B R A R Y;
LIMIT : L I M I T;
LIMITS : L I M I T S;
LINAGE : L I N A G E;
LINAGE_COUNTER : L I N A G E '_' C O U N T E R;
LINE : L I N E;
LINES : L I N E S;
LINE_COUNTER : L I N E MINUSCHAR C O U N T E R;
LINKAGE : L I N K A G E;
LOCK : L O C K;
LOCKFILE : L O C K F I L E;
LOW_VALUE : L O W MINUSCHAR V A L U E;
LOW_VALUES : L O W MINUSCHAR V A L U E S;
MEMORY : M E M O R Y;
MERGE : M E R G E;
MESSAGE : M E S S A G E;
MODE : M O D E;
MODULES : M O D U L E S;
MORE_LABELS : M O R E MINUSCHAR L A B E L S;
MOVE : M O V E;
MULTIPLE : M U L T I P L E;
MULTIPLY : M U L T I P L Y;
NATIONAL : N A T I O N A L;
NATIVE : N A T I V E;
NEGATIVE : N E G A T I V E;
NEXT : N E X T;
NO : N O;
NOSEQ : N O S E Q;
NOSTDTRUNC : N O S T D T R U N C;
NOT : N O T;
NULL : N U L L;
NULLS : N U L L S;
NUMBER : N U M B E R;
NUMERIC : N U M E R I C;
NUMERIC_EDITED : N U M E R I C MINUSCHAR E D I T E D;
OBJECT_COMPUTER : O B J E C T MINUSCHAR C O M P U T E R;
OCCURS : O C C U R S;
ODT : O D T;
OF : O F;
OFF : O F F;
OMITTED : O M I T T E D;
ON : O N;
OPEN : O P E N;
OPTIMIZE : O P T I M I Z E;
OPTIONAL : O P T I O N A L;
OR : O R;
ORDER : O R D E R;
ORGANIZATION : O R G A N I Z A T I O N;
OTHER : O T H E R;
OUTPUT : O U T P U T;
OVERFLOW : O V E R F L O W;
PACKED_DECIMAL : P A C K E D MINUSCHAR D E C I M A L;
PADDING : P A D D I N G;
PAGE : P A G E;
PAGE_COUNTER : P A G E MINUSCHAR C O U N T E R;
PASSWORD : <NAME>;
PERFORM : P E R F O R M;
PF : P F;
PH : P H;
PIC : P I C;
PICTURE : P I C T U R E;
PLUS : P L U S;
POINTER : P O I N T E R;
POSITION : P O S I T I O N;
POSITIVE : P O S I T I V E;
PRINTING : P R I N T I N G;
PROCEDURE : P R O C E D U R E;
PROCEDURES : P R O C E D U R E S;
PROCEED : P R O C E E D;
PROCESS : P R O C E S S;
PROGRAM : P R O G R A M;
PROGRAM_ID : P R O G R A M MINUSCHAR I D;
PROGRAM_STATUS : P R O G R A M MINUSCHAR S T A T U S;
PROMPT : P R O M P T;
PROTECTED : P R O T E C T E D;
PURGE : P U R G E;
QUEUE : Q U E U E;
QUOTE : Q U O T E;
QUOTES : Q U O T E S;
RANDOM : R A N D O M;
RD : R D;
READ : R E A D;
RECEIVE : R E C E I V E;
RECEIVE_CONTROL : R E C E I V E MINUSCHAR C O N T R O L;
RECORD : R E C O R D;
RECORDING : R E C O R D I N G;
RECORDS : R E C O R D S;
REDEFINES : R E D E F I N E S;
REEL : R E E L;
REFERENCE : R E F E R E N C E;
REFERENCES : R E F E R E N C E S;
RELATIVE : R E L A T I V E;
RELEASE : R E L E A S E;
REMAINDER : R E M A I N D E R;
REMOVAL : R E M O V A L;
RENAMES : R E N A M E S;
REPLACE : R E P L A C E;
REPLACING : R E P L A C I N G;
REPLY : R E P L Y; // TANDEM EXTENSION
REPORT : R E P O R T;
REPORTING : R E P O R T I N G;
REPORTS : R E P O R T S;
RERUN : R E R U N;
RESERVE : R E S E R V E;
RESET : R E S E T;
RETURN : R E T U R N;
RETURN_CODE : R E T U R N MINUSCHAR C O D E;
RETURNED : R E T U R N E D;
REVERSED : R E V E R S E D;
REWIND : R E W I N D;
REWRITE : R E W R I T E;
RF : R F;
RH : R H;
RIGHT : R I G H T;
ROUNDED : R O U N D E D;
RUN : R U N;
SAME : S A M E;
SCREEN : S C R E E N;
SD : S D;
SEARCH : S E A R C H;
SECTION : S E C T I O N;
SECURITY : S E C U R I T Y;
SEGMENT : S E G M E N T;
SEGMENT_LIMIT : S E G M E N T MINUSCHAR L I M I T;
SELECT : S E L E C T;
SEND : S E N D;
SENTENCE : S E N T E N C E;
SEPARATE : S E P A R A T E;
SEQUENCE : S E Q U E N C E;
SEQUENTIAL : S E Q U E N T I A L;
SET : S E T;
SHARED : S H A R E D;
SHIFT_IN : S H I F T MINUSCHAR I N;
SHIFT_OUT : S H I F T MINUSCHAR O U T;
SIGN : S I G N;
SIZE : S I Z E;
SORT : S O R T;
SORT_CONTROL : S O R T MINUSCHAR C O N T R O L;
SORT_CORE_SIZE : S O R T MINUSCHAR C O R E MINUSCHAR S I Z E;
SORT_FILE_SIZE : S O R T MINUSCHAR F I L E MINUSCHAR S I Z E;
SORT_MERGE : S O R T MINUSCHAR M E R G E;
SORT_MESSAGE : S O R T MINUSCHAR M E S S A G E;
SORT_MODE_SIZE : S O R T MINUSCHAR M O D E MINUSCHAR S I Z E;
SORT_RETURN : S O R T MINUSCHAR R E T U R N;
SOURCE : S O U R C E;
SOURCE_COMPUTER : S O U R C E MINUSCHAR C O M P U T E R;
SP : S P;
SPACE : S P A C E;
SPACES : S P A C E S;
SPECIAL_NAMES : S P E C I A L MINUSCHAR N A M E S;
STANDARD : S T A N D A R D;
STANDARD_1 : S T A N D A R D MINUSCHAR '1';
STANDARD_2 : S T A N D A R D MINUSCHAR '2';
START : S T A R T;
STATUS : S T A T U S;
STOP : S T O P;
STRING : S T R I N G;
SUB_QUEUE_1 : S U B MINUSCHAR Q U E U E MINUSCHAR '1';
SUB_QUEUE_2 : S U B MINUSCHAR Q U E U E MINUSCHAR '2';
SUB_QUEUE_3 : S U B MINUSCHAR Q U E U E MINUSCHAR '3';
SUBTRACT : S U B T R A C T;
SUM : S U M;
SUPPRESS : S U P P R E S S;
SYMBOLIC : S Y M B O L I C;
SYNC : S Y N C;
SYNCHRONIZED : S Y N C H R O N I Z E D;
TABLE : T A B L E;
TALLY : T A L L Y;
TALLYING : T A L L Y I N G;
TAPE : T A P E;
TERMINAL : T E R M I N A L;
TERMINATE : T E R M I N A T E;
TEST : T E S T;
TEXT : T E X T;
THAN : T H A N;
THEN : T H E N;
THREAD : T H R E A D;
THROUGH : T H R O U G H;
THRU : T H R U;
TIME : T I M E;
TIMER : T I M E R;
TIMES : T I M E S;
TO : T O;
TOP : T O P;
TRAILING : T R A I L I N G;
TRUE : T R U E;
TYPE : T Y P E;
UNIT : U N I T;
UNLOCK : U N L O C K;
UNLOCKFILE : U N L O C K F I L E;
UNLOCKRECORD : U N L O C K R E C O R D;
UNSTRING : U N S T R I N G;
UNTIL : U N T I L;
UP : U P;
UPON : U P O N;
USAGE : U S A G E;
USE : U S E;
USING : U S I N G;
VALUE : V A L U E;
VALUES : V A L U E S;
VARYING : V A R Y I N G;
WAIT : W A I T;
WHEN : W H E N;
WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D;
WITH : W I T H;
WORDS : W O R D S;
WORKING_STORAGE : W O R K I N G MINUSCHAR S T O R A G E;
WRITE : W R I T E;
XOPTS: X O P T S;
YEAR : Y E A R;
YYYYMMDD : Y Y Y Y M M D D;
YYYYDDD : Y Y Y Y D D D;
ZERO : Z E R O;
ZEROS : Z E R O S;
ZEROES : Z E R O E S;
// symbols
AMPCHAR : '&';
ASTERISKCHAR : '*';
DOUBLEASTERISKCHAR : '**';
COLONCHAR : ':';
COMMACHAR : ',';
COMMENTTAG : '>*';
DOLLARCHAR : '$';
DOUBLEQUOTE : '"';
DOT : '.';
EQUALCHAR : '=';
LESSTHANCHAR : '<';
LESSTHANOREQUAL : '<=';
LPARENCHAR : '(';
MINUSCHAR : '-';
MORETHANCHAR : '>';
MORETHANOREQUAL : '>=';
PLUSCHAR : '+';
SINGLEQUOTE : '\'';
RPARENCHAR : ')';
SLASHCHAR : '/';
// literals
NONNUMERICLITERAL : STRINGLITERAL | DBCSLITERAL | HEXNUMBER;
fragment HEXNUMBER :
X '"' [0-9A-F]+ '"'
| X '\'' [0-9A-F]+ '\''
;
fragment STRINGLITERAL :
'"' (~["\n\r] | '""' | '\'')* '"'
| '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
fragment DBCSLITERAL :
[GN] '"' (~["\n\r] | '""' | '\'')* '"'
| [GN] '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
LEVEL_NUMBER_66 : '66';
LEVEL_NUMBER_77 : '77';
LEVEL_NUMBER_88 : '88';
INTEGERLITERAL : (PLUSCHAR | MINUSCHAR)? [0-9]+;
NUMERICLITERAL : (PLUSCHAR | MINUSCHAR)? [0-9]* (DOT | COMMACHAR) [0-9]+ (('e' | 'E') (PLUSCHAR | MINUSCHAR)? [0-9]+)?;
IDENTIFIER : [a-zA-Z0-9]+ ([-_]+ [a-zA-Z0-9]+)*;
// whitespace, line breaks, comments, ...
NEWLINE : '\r'? '\n' -> skip;
COMMENTLINE : COMMENTTAG ~('\n' | '\r')* -> skip;
WS : [ \t\f;]+ -> skip;
SEPARATOR : ', ' -> skip;
// case insensitive chars
fragment A:('a'|'A');
fragment B:('b'|'B');
fragment C:('c'|'C');
fragment D:('d'|'D');
fragment E:('e'|'E');
fragment F:('f'|'F');
fragment G:('g'|'G');
fragment H:('h'|'H');
fragment I:('i'|'I');
fragment J:('j'|'J');
fragment K:('k'|'K');
fragment L:('l'|'L');
fragment M:('m'|'M');
fragment N:('n'|'N');
fragment O:('o'|'O');
fragment P:('p'|'P');
fragment Q:('q'|'Q');
fragment R:('r'|'R');
fragment S:('s'|'S');
fragment T:('t'|'T');
fragment U:('u'|'U');
fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z'); |
Transynther/x86/_processed/US/_st_zr_4k_sm_/i7-7700_9_0xca_notsx.log_21829_686.asm | ljhsiun2/medusa | 9 | 242593 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x2bfe, %rdx
cmp %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%rdx)
nop
add $37298, %r11
lea addresses_D_ht+0x71fe, %rax
nop
nop
add $23606, %rcx
mov (%rax), %r12d
cmp %rdx, %rdx
lea addresses_A_ht+0x4e7e, %rsi
lea addresses_D_ht+0xf7fe, %rdi
nop
nop
xor %rdx, %rdx
mov $90, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_D_ht+0x1028e, %rax
clflush (%rax)
nop
nop
xor $9762, %rcx
movups (%rax), %xmm4
vpextrq $0, %xmm4, %rdi
nop
nop
nop
inc %rdx
lea addresses_A_ht+0x952, %rax
xor $19330, %rdx
movb (%rax), %r12b
and $41446, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %rax
push %rbx
push %rcx
push %rsi
// Store
mov $0x5be, %rcx
nop
nop
cmp %rsi, %rsi
movw $0x5152, (%rcx)
nop
nop
sub %rbx, %rbx
// Store
lea addresses_UC+0xbbfe, %rcx
nop
nop
nop
and $33414, %rbx
mov $0x5152535455565758, %rax
movq %rax, (%rcx)
nop
nop
xor $658, %rbx
// Store
lea addresses_D+0xbc72, %r12
and $19569, %r8
mov $0x5152535455565758, %rax
movq %rax, %xmm1
vmovntdq %ymm1, (%r12)
nop
sub %r12, %r12
// Store
lea addresses_A+0xa2be, %r12
nop
nop
nop
cmp $37293, %rax
movb $0x51, (%r12)
nop
dec %rbx
// Store
lea addresses_US+0x14bfe, %rsi
nop
nop
nop
sub $51082, %rax
movl $0x51525354, (%rsi)
nop
nop
inc %rcx
// Store
lea addresses_normal+0x180e6, %rax
nop
cmp $8160, %r12
movl $0x51525354, (%rax)
sub %r8, %r8
// Store
lea addresses_RW+0xb3fe, %rcx
and $57060, %rbx
movl $0x51525354, (%rcx)
nop
nop
nop
nop
nop
sub $1209, %r11
// Store
lea addresses_US+0x86fe, %rsi
nop
sub $6388, %rcx
mov $0x5152535455565758, %r12
movq %r12, %xmm4
movups %xmm4, (%rsi)
nop
nop
nop
add $21279, %r8
// Load
lea addresses_A+0x437e, %r11
nop
nop
add $386, %r12
mov (%r11), %si
nop
nop
nop
sub %r12, %r12
// Store
lea addresses_US+0x14bfe, %r11
nop
nop
nop
nop
nop
inc %rax
movw $0x5152, (%r11)
nop
nop
xor %r12, %r12
// Store
lea addresses_UC+0x48fe, %rbx
nop
nop
inc %r11
movl $0x51525354, (%rbx)
nop
nop
nop
sub %rax, %rax
// Store
lea addresses_US+0x1bbfe, %rbx
xor %rcx, %rcx
movb $0x51, (%rbx)
nop
sub $52783, %r12
// Faulty Load
lea addresses_US+0x14bfe, %rsi
nop
sub %rbx, %rbx
mov (%rsi), %r8w
lea oracles, %rbx
and $0xff, %r8
shlq $12, %r8
mov (%rbx,%r8,1), %r8
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 2, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_US'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'54': 10, '00': 474, '51': 12199, '52': 9146}
52 51 51 51 52 52 52 51 52 52 52 51 52 51 51 52 52 52 51 51 51 52 51 52 52 52 51 52 51 52 51 51 52 52 52 52 52 52 51 52 51 51 52 51 51 51 52 52 52 51 51 52 52 51 51 51 51 51 51 51 52 52 52 52 52 51 52 51 51 51 52 52 51 51 52 52 51 51 52 52 52 52 51 51 51 51 51 51 52 51 52 51 51 51 51 52 51 52 51 52 52 52 51 51 52 52 51 52 52 51 52 51 51 52 51 51 52 52 52 52 52 51 51 52 51 51 52 51 52 52 51 52 51 51 52 52 52 51 51 52 51 52 52 51 52 51 51 51 51 51 52 51 52 51 52 51 51 51 51 52 00 52 52 51 52 52 51 51 52 51 52 52 51 52 51 52 51 51 52 51 51 52 51 52 00 51 51 51 51 52 52 52 51 51 51 51 51 51 51 51 51 51 52 51 51 52 51 52 52 52 51 51 51 52 51 52 51 51 52 52 52 51 52 51 51 52 52 51 52 51 52 51 51 52 51 51 51 51 51 51 51 52 52 52 51 51 51 51 51 52 51 51 51 51 51 51 51 51 51 52 52 52 51 51 52 52 52 52 51 51 52 51 52 51 51 51 51 51 52 51 51 51 52 51 51 52 51 51 51 51 51 52 51 52 51 52 52 52 00 52 51 52 52 51 51 51 51 51 51 52 51 52 51 52 51 51 51 51 52 51 51 51 52 51 51 51 51 52 52 51 52 52 52 52 00 51 51 51 52 52 51 51 51 51 52 51 51 51 52 52 52 51 51 52 52 52 52 51 52 51 52 51 51 51 52 52 51 51 51 52 51 51 51 52 00 52 52 52 51 51 52 51 51 52 51 52 51 51 51 51 51 52 51 52 52 51 51 52 51 52 51 51 52 51 52 51 51 51 51 51 51 00 52 52 51 52 51 52 52 52 52 51 52 51 51 51 51 52 52 51 52 52 52 52 52 51 51 51 51 51 52 51 52 52 52 51 51 52 52 51 51 52 51 51 51 52 52 51 52 52 51 52 52 52 52 51 52 51 51 52 52 51 51 51 51 52 52 51 52 52 51 52 51 51 52 51 51 51 51 51 52 52 00 52 52 52 51 51 52 51 52 51 51 52 51 51 51 51 52 51 51 51 51 52 52 52 51 51 52 51 52 51 52 51 52 51 52 52 51 52 52 52 51 52 51 52 52 52 52 51 51 51 51 51 51 52 51 51 52 51 51 52 00 51 52 51 52 51 51 52 52 51 52 51 51 51 52 52 51 51 51 51 51 51 52 51 51 51 52 52 51 52 52 52 51 52 51 52 51 51 52 52 52 51 51 52 52 51 52 51 52 51 52 52 51 51 52 52 51 52 52 51 52 51 51 51 51 51 52 51 51 51 51 52 52 51 52 51 52 52 52 00 52 52 51 51 51 51 51 52 52 52 52 00 52 52 51 52 52 52 51 52 52 51 51 51 52 00 51 51 51 52 51 51 51 52 51 51 51 51 52 51 51 52 52 51 51 52 52 51 51 51 51 51 00 52 51 51 52 51 51 52 52 52 51 51 00 52 51 51 51 51 51 52 51 52 51 51 51 51 51 51 51 51 51 51 51 52 51 52 51 51 51 52 51 52 00 52 51 51 51 51 51 52 51 51 51 51 51 52 52 51 52 52 52 52 51 52 51 51 51 52 52 52 51 52 51 52 52 52 52 51 51 52 51 51 52 51 52 51 52 51 52 52 51 51 51 51 52 51 51 52 51 52 51 51 51 52 52 51 52 51 51 51 51 52 51 52 52 00 52 51 51 51 52 51 52 51 51 51 52 52 00 52 52 52 52 52 52 52 00 51 51 51 52 51 52 51 52 52 51 52 52 51 51 52 51 51 52 52 52 52 52 51 52 51 51 52 51 51 52 51 52 52 52 51 51 51 51 52 52 52 51 51 52 51 51 52 51 51 52 51 51 51 51 52 51 51 52 51 51 51 51 52 51 51 52 51 52 52 52 51 52 52 52 51 52 52 51 51 52 52 52 51 51 51 51 51 51 51 51 52 52 51 51 51 51 00 52 51 51 51 52 52 52 52 51 51 51 52 51 52 52 51 51 52 51 52 51 52 52 51 52 52 52 51 52 51 52 51 51 52 51 52 52 51 51 51 51 52 51 52 51 52 52 52 51 52 52 51 51 51 52 51 51 51 52 52 52 51 51 52 51 51 51 52 52 51 51 51 52 52 51 52 52 51 51 51 51 51
*/
|
oeis/214/A214998.asm | neoneye/loda-programs | 11 | 80278 | ; A214998: Power ceiling-floor sequence of 2 + sqrt(3).
; Submitted by <NAME>
; 4,14,53,197,736,2746,10249,38249,142748,532742,1988221,7420141,27692344,103349234,385704593,1439469137,5372171956,20049218686,74824702789,279249592469,1042173667088,3889445075882,14515606636441,54172981469881,202176319243084,754532295502454,2815952862766733,10509279155564477,39221163759491176,146375375882400226,546280339770109729,2038745983198038689,7608703593022045028,28396068388890141422,105975569962538520661,395506211461263941221,1476049275882517244224,5508690892068805035674
add $0,1
mov $1,4
mov $2,1
lpb $0
sub $0,1
add $1,$2
add $2,$1
add $1,$2
add $1,1
lpe
div $1,3
mov $0,$1
|
examples/servlets/sessions/source/sessions.ads | reznikmm/matreshka | 24 | 21174 | <reponame>reznikmm/matreshka<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Examples Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2019, <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 <NAME>, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings;
with League.Calendars;
limited with Sessions.Managers;
with Servlet.HTTP_Sessions;
package Sessions is
type HTTP_Session is new Servlet.HTTP_Sessions.HTTP_Session with private;
type HTTP_Session_Access is access all HTTP_Session'Class;
not overriding procedure Count
(Self : in out HTTP_Session;
Result : out Natural);
-- Increment a counter and return current value.
private
type HTTP_Session is new Servlet.HTTP_Sessions.HTTP_Session with record
Id : League.Strings.Universal_String;
Count : Natural := 0;
end record;
overriding function Get_Id
(Self : HTTP_Session) return League.Strings.Universal_String;
overriding function Get_Creation_Time
(Self : HTTP_Session) return League.Calendars.Date_Time;
overriding function Get_Last_Accessed_Time
(Self : HTTP_Session) return League.Calendars.Date_Time;
overriding function Is_New (Self : HTTP_Session) return Boolean;
end Sessions;
|
SQLParser/parser/SQLLexerRules.g4 | ethanchewy/marketstore | 1,580 | 6975 | lexer grammar SQLLexerRules;
SEMICOLON : ';';
SELECT: [Ss][Ee][Ll][Ee][Cc][Tt];
FROM: [Ff][Rr][Oo][Mm];
ADD: [Aa][Dd][Dd];
AS: [Aa][Ss];
ALL: [Aa][Ll][Ll];
SOME: [Ss][Oo][Mm][Ee];
ANY: [Aa][Nn][Yy];
DISTINCT: [Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt];
WHERE: [Ww][Hh][Ee][Rr][Ee];
GROUP: [Gg][Rr][Oo][Uu][Pp];
BY: [Bb][Yy];
GROUPING: [Gg][Rr][Oo][Uu][Pp][Ii][Nn][Gg];
SETS: [Ss][Ee][Tt][Ss];
CUBE: [Cc][Uu][Bb][Ee];
ROLLUP: [Rr][Oo][Ll][Ll][Uu][Pp];
ORDER: [Oo][Rr][Dd][Ee][Rr];
HAVING: [Hh][Aa][Vv][Ii][Nn][Gg];
LIMIT: [Ll][Ii][Mm][Ii][Tt];
AT: [Aa][Tt];
OR: [Oo][Rr];
AND: [Aa][Nn][Dd];
IN: [Ii][Nn];
NOT: [Nn][Oo][Tt];
NO: [Nn][Oo];
EXISTS: [Ee][Xx][Ii][Ss][Tt][Ss];
BETWEEN: [Bb][Ee][Tt][Ww][Ee][Ee][Nn];
LIKE: [Ll][Ii][Kk][Ee];
IS: [Ii][Ss];
NULL: [Nn][Uu][Ll][Ll];
TRUE: [Tt][Rr][Uu][Ee];
FALSE: [Ff][Aa][Ll][Ss][Ee];
NULLS: [Nn][Uu][Ll][Ll][Ss];
FIRST: [Ff][Ii][Rr][Ss][Tt];
LAST: [Ll][Aa][Ss][Tt];
ESCAPE: [Ee][Ss][Cc][Aa][Pp][Ee];
ASC: [Aa][Ss][Cc];
DESC: [Dd][Ee][Ss][Cc];
SUBSTRING: [Ss][Uu][Bb][Ss][Tt][Rr][Ii][Nn][Gg];
POSITION: [Pp][Oo][Ss][Ii][Tt][Ii][Oo][Nn];
FOR: [Ff][Oo][Rr];
TINYINT: [Tt][Ii][Nn][Yy][Ii][Nn][Tt];
SMALLINT: [Ss][Mm][Aa][Ll][Ll][Ii][Nn][Tt];
INTEGER: [Ii][Nn][Tt][Ee][Gg][Ee][Rr];
DATE: [Dd][Aa][Tt][Ee];
TIME: [Tt][Ii][Mm][Ee];
TIMESTAMP: [Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp];
INTERVAL: [Ii][Nn][Tt][Ee][Rr][Vv][Aa][Ll];
YEAR: [Yy][Ee][Aa][Rr];
MONTH: [Mm][Oo][Nn][Tt][Hh];
DAY: [Dd][Aa][Yy];
HOUR: [Hh][Oo][Uu][Rr];
MINUTE: [Mm][Ii][Nn][Uu][Tt][Ee];
SECOND: [Ss][Ee][Cc][Oo][Nn][Dd];
ZONE: [Zz][Oo][Nn][Ee];
CURRENT_DATE: [Cc][Uu][Rr][Rr][Ee][Nn][Tt]'_'[Dd][Aa][Tt][Ee];
CURRENT_TIME: [Cc][Uu][Rr][Rr][Ee][Nn][Tt]'_'[Tt][Ii][Mm][Ee];
CURRENT_TIMESTAMP: [Cc][Uu][Rr][Rr][Ee][Nn][Tt]'_'[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp];
LOCALTIME: [Ll][Oo][Cc][Aa][Ll][Tt][Ii][Mm][Ee];
LOCALTIMESTAMP: [Ll][Oo][Cc][Aa][Ll][Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp];
EXTRACT: [Ee][Xx][Tt][Rr][Aa][Cc][Tt];
CASE: [Cc][Aa][Ss][Ee];
WHEN: [Ww][Hh][Ee][Nn];
THEN: [Tt][Hh][Ee][Nn];
ELSE: [Ee][Ll][Ss][Ee];
END: [Ee][Nn][Dd];
JOIN: [Jj][Oo][Ii][Nn];
CROSS: [Cc][Rr][Oo][Ss][Ss];
OUTER: [Oo][Uu][Tt][Ee][Rr];
INNER: [Ii][Nn][Nn][Ee][Rr];
LEFT: [Ll][Ee][Ff][Tt];
RIGHT: [Rr][Ii][Gg][Hh][Tt];
FULL: [Ff][Uu][Ll][Ll];
NATURAL: [Nn][Aa][Tt][Uu][Rr][Aa][Ll];
USING: [Uu][Ss][Ii][Nn][Gg];
ON: [Oo][Nn];
FILTER: [Ff][Ii][Ll][Tt][Ee][Rr];
OVER: [Oo][Vv][Ee][Rr];
PARTITION: [Pp][Aa][Rr][Tt][Ii][Tt][Ii][Oo][Nn];
RANGE: [Rr][Aa][Nn][Gg][Ee];
ROWS: [Rr][Oo][Ww][Ss];
UNBOUNDED: [Uu][Nn][Bb][Oo][Uu][Nn][Dd][Ee][Dd];
PRECEDING: [Pp][Rr][Ee][Cc][Ee][Dd][Ii][Nn][Gg];
FOLLOWING: [Ff][Oo][Ll][Ll][Oo][Ww][Ii][Nn][Gg];
CURRENT: [Cc][Uu][Rr][Rr][Ee][Nn][Tt];
ROW: [Rr][Oo][Ww];
WITH: [Ww][Ii][Tt][Hh];
RECURSIVE: [Rr][Ee][Cc][Uu][Rr][Ss][Ii][Vv][Ee];
VALUES: [Vv][Aa][Ll][Uu][Ee][Ss];
CREATE: [Cc][Rr][Ee][Aa][Tt][Ee];
SCHEMA: [Ss][Cc][Hh][Ee][Mm][Aa];
TABLE: [Tt][Aa][Bb][Ll][Ee];
COMMENT: [Cc][Oo][Mm][Mm][Ee][Nn][Tt];
VIEW: [Vv][Ii][Ee][Ww];
REPLACE: [Rr][Ee][Pp][Ll][Aa][Cc][Ee];
INSERT: [Ii][Nn][Ss][Ee][Rr][Tt];
DELETE: [Dd][Ee][Ll][Ee][Tt][Ee];
INTO: [Ii][Nn][Tt][Oo];
CONSTRAINT: [Cc][Oo][Nn][Ss][Tt][Rr][Aa][Ii][Nn][Tt];
DESCRIBE: [Dd][Ee][Ss][Cc][Rr][Ii][Bb][Ee];
GRANT: [Gg][Rr][Aa][Nn][Tt];
REVOKE: [Rr][Ee][Vv][Oo][Kk][Ee];
PRIVILEGES: [Pp][Rr][Ii][Vv][Ii][Ll][Ee][Gg][Ee][Ss];
PUBLIC: [Pp][Uu][Bb][Ll][Ii][Cc];
OPTION: [Oo][Pp][Tt][Ii][Oo][Nn];
EXPLAIN: [Ee][Xx][Pp][Ll][Aa][Ii][Nn];
ANALYZE: [Aa][Nn][Aa][Ll][Yy][Zz][Ee];
FORMAT: [Ff][Oo][Rr][Mm][Aa][Tt];
TYPE: [Tt][Yy][Pp][Ee];
TEXT: [Tt][Ee][Xx][Tt];
GRAPHVIZ: [Gg][Rr][Aa][Pp][Hh][Vv][Ii][Zz];
LOGICAL: [Ll][Oo][Gg][Ii][Cc][Aa][Ll];
DISTRIBUTED: [Dd][Ii][Ss][Tt][Rr][Ii][Bb][Uu][Tt][Ee][Dd];
VALIDATE: [Vv][Aa][Ll][Ii][Dd][Aa][Tt][Ee];
CAST: [Cc][Aa][Ss][Tt];
TRY_CAST: [Tt][Rr][Yy]'_'[Cc][Aa][Ss][Tt];
SHOW: [Ss][Hh][Oo][Ww];
TABLES: [Tt][Aa][Bb][Ll][Ee][Ss];
SCHEMAS: [Ss][Cc][Hh][Ee][Mm][Aa][Ss];
CATALOGS: [Cc][Aa][Tt][Aa][Ll][Oo][Gg][Ss];
COLUMNS: [Cc][Oo][Ll][Uu][Mm][Nn][Ss];
COLUMN: [Cc][Oo][Ll][Uu][Mm][Nn];
USE: [Uu][Ss][Ee];
PARTITIONS: [Pp][Aa][Rr][Tt][Ii][Tt][Ii][Oo][Nn][Ss];
FUNCTIONS: [Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn][Ss];
DROP: [Dd][Rr][Oo][Pp];
UNION: [Uu][Nn][Ii][Oo][Nn];
EXCEPT: [Ee][Xx][Cc][Ee][Pp][Tt];
INTERSECT: [Ii][Nn][Tt][Ee][Rr][Ss][Ee][Cc][Tt];
TO: [Tt][Oo];
SYSTEM: [Ss][Yy][Ss][Tt][Ee][Mm];
BERNOULLI: [Bb][Ee][Rr][Nn][Oo][Uu][Ll][Ll][Ii];
POISSONIZED: [Pp][Oo][Ii][Ss][Ss][Oo][Nn][Ii][Zz][Ee][Dd];
TABLESAMPLE: [Tt][Aa][Bb][Ll][Ee][Ss][Aa][Mm][Pp][Ll][Ee];
ALTER: [Aa][Ll][Tt][Ee][Rr];
RENAME: [Rr][Ee][Nn][Aa][Mm][Ee];
UNNEST: [Uu][Nn][Nn][Ee][Ss][Tt];
ORDINALITY: [Oo][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy];
ARRAY: [Aa][Rr][Rr][Aa][Yy];
MAP: [Mm][Aa][Pp];
SET: [Ss][Ee][Tt];
RESET: [Rr][Ee][Ss][Ee][Tt];
SESSION: [Ss][Ee][Ss][Ss][Ii][Oo][Nn];
DATA: [Dd][Aa][Tt][Aa];
START: [Ss][Tt][Aa][Rr][Tt];
TRANSACTION: [Tt][Rr][Aa][Nn][Ss][Aa][Cc][Tt][Ii][Oo][Nn];
COMMIT: [Cc][Oo][Mm][Mm][Ii][Tt];
ROLLBACK: [Rr][Oo][Ll][Ll][Bb][Aa][Cc][Kk];
WORK: [Ww][Oo][Rr][Kk];
ISOLATION: [Ii][Ss][Oo][Ll][Aa][Tt][Ii][Oo][Nn];
LEVEL: [Ll][Ee][Vv][Ee][Ll];
SERIALIZABLE: [Ss][Ee][Rr][Ii][Aa][Ll][Ii][Zz][Aa][Bb][Ll][Ee];
REPEATABLE: [Rr][Ee][Pp][Ee][Aa][Tt][Aa][Bb][Ll][Ee];
COMMITTED: [Cc][Oo][Mm][Mm][Ii][Tt][Tt][Ee][Dd];
UNCOMMITTED: [Uu][Nn][Cc][Oo][Mm][Mm][Ii][Tt][Tt][Ee][Dd];
READ: [Rr][Ee][Aa][Dd];
WRITE: [Ww][Rr][Ii][Tt][Ee];
ONLY: [Oo][Nn][Ll][Yy];
CALL: [Cc][Aa][Ll][Ll];
PREPARE: [Pp][Rr][Ee][Pp][Aa][Rr][Ee];
DEALLOCATE: [Dd][Ee][Aa][Ll][Ll][Oo][Cc][Aa][Tt][Ee];
EXECUTE: [Ee][Xx][Ee][Cc][Uu][Tt][Ee];
INPUT: [Ii][Nn][Pp][Uu][Tt];
OUTPUT: [Oo][Uu][Tt][Pp][Uu][Tt];
CASCADE: [Cc][Aa][Ss][Cc][Aa][Dd][Ee];
RESTRICT: [Rr][Ee][Ss][Tt][Rr][Ii][Cc][Tt];
INCLUDING: [Ii][Nn][Cc][Ll][Uu][Dd][Ii][Nn][Gg];
EXCLUDING: [Ee][Xx][Cc][Ll][Uu][Dd][Ii][Nn][Gg];
PROPERTIES: [Pp][Rr][Oo][Pp][Ee][Rr][Tt][Ii][Ee][Ss];
NORMALIZE: [Nn][Oo][Rr][Mm][Aa][Ll][Ii][Zz][Ee];
NFD: [Nn][Ff][Dd];
NFC: [Nn][Ff][Cc];
NFKD: [Nn][Ff][Kk][Dd];
NFKC: [Nn][Ff][Kk][Cc];
IF: [Ii][Ff];
NULLIF: [Nn][Uu][Ll][Ll][Ii][Ff];
COALESCE: [Cc][Oo][Aa][Ll][Ee][Ss][Cc][Ee];
TIME_WITH_TIME_ZONE
: [Tt][Ii][Mm][Ee] WS [Ww][Ii][Tt][Hh] WS [Tt][Ii][Mm][Ee] WS [Zz][Oo][Nn][Ee]
;
TIMESTAMP_WITH_TIME_ZONE
: [Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp] WS [Ww][Ii][Tt][Hh] WS [Tt][Ii][Mm][Ee] WS [Zz][Oo][Nn][Ee]
;
DOUBLE_PRECISION
: [Dd][Oo][Uu][Bb][Ll][Ee] WS [Pp][Rr][Ee][Cc][Ii][Ss][Ii][Oo][Nn]
;
EQ : '=';
NEQ : '<>' | '!=';
LT : '<';
LTE : '<=';
GT : '>';
GTE : '>=';
PLUS: '+';
MINUS: '-';
ASTERISK: '*';
SLASH: '/';
PERCENT: '%';
CONCAT: '||';
DOT: '.';
STRING
: '\'' ( ~'\'' | '\'\'' )* '\''
;
// Note: we allow any character inside the binary literal and validate
// its a correct literal when the AST is being constructed. This
// allows us to provide more meaningful error messages to the user
BINARY_LITERAL
: 'X\'' (~'\'')* '\''
;
INTEGER_VALUE
: DIGIT+
;
DECIMAL_VALUE
: DIGIT+ '.' DIGIT*
| '.' DIGIT+
| DIGIT+ ('.' DIGIT*)? EXPONENT
| '.' DIGIT+ EXPONENT
;
IDENTIFIER
: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':' )*
;
DIGIT_IDENTIFIER
: DIGIT (LETTER | DIGIT | '_' | '@' | ':' )+
;
QUOTED_IDENTIFIER
: '"' ( ~'"' | '""' )* '"'
;
BACKQUOTED_IDENTIFIER
: '`' ( ~'`' | '``' )* '`'
;
fragment EXPONENT
: 'E' [+-]? DIGIT+
;
fragment DIGIT
: [0-9]
;
fragment LETTER
: [A-Za-z]
;
SIMPLE_COMMENT
: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
;
BRACKETED_COMMENT
: '/*' .*? '*/' -> channel(HIDDEN)
;
WS
: [ \r\n\t]+ -> channel(HIDDEN)
;
// Catch-all for anything we can't recognize.
// We use this to be able to ignore and recover all the text
// when splitting statements with DelimiterLexer
//UNRECOGNIZED
// : .
// ;
|
programs/oeis/220/A220492.asm | jmorken/loda | 1 | 96961 | ; A220492: Number of primes p between quarter-squares, Q(n) < p <= Q(n+1), where Q(n) = A002620(n).
; 0,0,1,1,1,1,1,1,2,1,1,1,2,2,1,2,2,2,2,1,4,1,2,2,2,3,3,2,2,2,4,2,4,3,1,4,2,4,3,3,3,4,4,3,4,3,2,4,4,5,4,4,4,3,4,4,4,5,4,4,4,4,5,5,5,4,6,4,4,5,5,5,7,2,3,6,6,6,6,5,8,4,5,6,5,4,7
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
pow $0,2
div $0,4
cal $0,230980 ; Number of primes <= n, starting at n=0.
mov $2,$3
mov $4,$0
lpb $2
mov $1,$4
sub $2,1
lpe
lpe
lpb $5
sub $1,$4
mov $5,0
lpe
|
programs/oeis/061/A061019.asm | karttu/loda | 1 | 96130 | <filename>programs/oeis/061/A061019.asm
; A061019: Negate primes in factorization of n.
; 1,-2,-3,4,-5,6,-7,-8,9,10,-11,-12,-13,14,15,16,-17,-18,-19,-20,21,22,-23,24,25,26,-27,-28,-29,-30,-31,-32,33,34,35,36,-37,38,39,40,-41,-42,-43,-44,-45,46,-47,-48,49,-50,51,-52,-53,54,55,56,57,58,-59,60,-61,62,-63,64,65,-66,-67,-68,69,-70
mov $1,$0
cal $0,8836 ; Liouville's function lambda(n) = (-1)^k, where k is number of primes dividing n (counted with multiplicity).
add $1,1
mul $1,$0
|
oeis/208/A208402.asm | neoneye/loda-programs | 11 | 14063 | ; A208402: Number of n X 2 0..3 arrays with new values 0..3 introduced in row major order and no element equal to more than two of its immediate leftward or upward or right-upward antidiagonal neighbors.
; 2,15,187,2795,43947,700075,11188907,178973355,2863377067,45813246635,733008800427,11728128223915,187650001250987,3002399818689195,48038396293720747,768614337478306475,12297829386768001707,196765270136748419755,3148244321981816285867,50371909150884426853035,805950546410852294765227,12895208742560442576710315,206323339880914304669231787,3301173438094417768475175595,52818775009509839870672677547,845100400152154060231042312875,13521606402434451452897794894507,216345702438951169203169189866155
mov $1,4
pow $1,$0
mul $1,2
add $1,2
bin $1,2
div $1,3
mov $0,$1
|
oeis/332/A332125.asm | neoneye/loda-programs | 11 | 12097 | <filename>oeis/332/A332125.asm
; A332125: a(n) = 2*(10^(2n+1)-1)/9 + 3*10^n.
; Submitted by <NAME>(s1)
; 5,252,22522,2225222,222252222,22222522222,2222225222222,222222252222222,22222222522222222,2222222225222222222,222222222252222222222,22222222222522222222222,2222222222225222222222222,222222222222252222222222222,22222222222222522222222222222,2222222222222225222222222222222
mov $1,10
pow $1,$0
mul $1,2
add $1,2
mul $1,10
sub $1,6
bin $1,2
mov $0,$1
div $0,90
sub $0,1
|
linux_x86_64bit/readFile.nasm | japkettu/shellcode | 0 | 169304 | ; open-read-write
; nasm -felf64 readFile.nasm -o readFile.o && ld readFile.o
global _start
section .text
_start:
jmp path
code:
;open
pop rdi
xor eax, eax
add eax, 2
xor esi, esi
syscall
;read
mov edi, eax
xor eax, eax
xor edx, edx
mov rsi, rsp
add edx, 50
syscall
; write
mov dh, ah
xor eax, eax
add eax,1
mov rsi, rsp
xor rdi, rdi
add rdi, 1
syscall
;exit
xor eax, eax
add eax, 60
syscall
path:
call code
var db "/etc/passwd"
|
regtests/ado-drivers-tests.adb | My-Colaborations/ada-ado | 0 | 5712 | -----------------------------------------------------------------------
-- ado-drivers-tests -- Unit tests for database drivers
-- Copyright (C) 2014, 2015, 2016, 2018, 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Exceptions;
with Util.Test_Caller;
with Regtests;
with ADO.Configs;
with ADO.Statements;
with ADO.Sessions;
with ADO.Connections;
package body ADO.Drivers.Tests is
use ADO.Configs;
use ADO.Connections;
package Caller is new Util.Test_Caller (Test, "ADO.Drivers");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test ADO.Drivers.Initialize",
Test_Initialize'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Get_Config",
Test_Get_Config'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Get_Driver",
Test_Get_Driver'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Get_Driver_Index",
Test_Get_Driver_Index'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Get_Driver",
Test_Load_Invalid_Driver'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Connections.Set_Connection",
Test_Set_Connection'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Connections.Set_Connection (Errors)",
Test_Set_Connection_Error'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Connections.Set_Server",
Test_Set_Connection_Server'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Connections.Set_Port",
Test_Set_Connection_Port'Access);
Caller.Add_Test (Suite, "Test ADO.Drivers.Connections.Set_Database",
Test_Set_Connection_Database'Access);
Caller.Add_Test (Suite, "Test ADO.Databases (Errors)",
Test_Empty_Connection'Access);
Caller.Add_Test (Suite, "Test ADO.Databases (DB Closed errors)",
Test_Closed_Connection'Access);
end Add_Tests;
-- ------------------------------
-- Test the Initialize operation.
-- ------------------------------
procedure Test_Initialize (T : in out Test) is
pragma Unreferenced (T);
begin
ADO.Drivers.Initialize ("test-missing-config.properties");
end Test_Initialize;
-- ------------------------------
-- Test the Get_Config operation.
-- ------------------------------
procedure Test_Get_Config (T : in out Test) is
begin
T.Assert (ADO.Configs.Get_Config ("test.database")'Length > 0,
"The Get_Config operation returned no value for the test database");
end Test_Get_Config;
-- ------------------------------
-- Test the Get_Driver operation.
-- ------------------------------
procedure Test_Get_Driver (T : in out Test) is
Mysql_Driver : constant Driver_Access := Connections.Get_Driver ("mysql");
Sqlite_Driver : constant Driver_Access := Connections.Get_Driver ("sqlite");
Postgres_Driver : constant Driver_Access := Connections.Get_Driver ("postgresql");
begin
T.Assert (Mysql_Driver /= null or Sqlite_Driver /= null or Postgres_Driver /= null,
"No database driver was found!");
end Test_Get_Driver;
-- ------------------------------
-- Test loading some invalid database driver.
-- ------------------------------
procedure Test_Load_Invalid_Driver (T : in out Test) is
Invalid_Driver : constant Driver_Access := ADO.Connections.Get_Driver ("invalid");
begin
T.Assert (Invalid_Driver = null,
"The Get_Driver operation must return null for invalid drivers");
end Test_Load_Invalid_Driver;
-- ------------------------------
-- Test the Get_Driver_Index operation.
-- ------------------------------
procedure Test_Get_Driver_Index (T : in out Test) is
Mysql_Driver : constant Driver_Access := Connections.Get_Driver ("mysql");
Sqlite_Driver : constant Driver_Access := Connections.Get_Driver ("sqlite");
Postgres_Driver : constant Driver_Access := Connections.Get_Driver ("postgresql");
begin
if Mysql_Driver /= null then
T.Assert (Mysql_Driver.Get_Driver_Index > 0, "The driver index must be positive");
end if;
if Sqlite_Driver /= null then
T.Assert (Sqlite_Driver.Get_Driver_Index > 0, "The driver index must be positive");
end if;
if Postgres_Driver /= null then
T.Assert (Postgres_Driver.Get_Driver_Index > 0, "The driver index must be positive");
end if;
if Mysql_Driver /= null and Sqlite_Driver /= null then
T.Assert (Mysql_Driver.Get_Driver_Index /= Sqlite_Driver.Get_Driver_Index,
"Two drivers must have different driver indexes");
end if;
if Mysql_Driver /= null and Postgres_Driver /= null then
T.Assert (Mysql_Driver.Get_Driver_Index /= Postgres_Driver.Get_Driver_Index,
"Two drivers must have different driver indexes");
end if;
if Sqlite_Driver /= null and Postgres_Driver /= null then
T.Assert (Sqlite_Driver.Get_Driver_Index /= Postgres_Driver.Get_Driver_Index,
"Two drivers must have different driver indexes");
end if;
end Test_Get_Driver_Index;
-- ------------------------------
-- Test the Set_Connection procedure.
-- ------------------------------
procedure Test_Set_Connection (T : in out Test) is
procedure Check (URI : in String;
Server : in String;
Port : in Integer;
Database : in String);
procedure Check (URI : in String;
Server : in String;
Port : in Integer;
Database : in String) is
Controller : ADO.Connections.Configuration;
begin
Controller.Set_Connection (URI);
Util.Tests.Assert_Equals (T, Server, Controller.Get_Server, "Invalid server for " & URI);
Util.Tests.Assert_Equals (T, Port, Controller.Get_Port, "Invalid port for " & URI);
Util.Tests.Assert_Equals (T, Database, Controller.Get_Database, "Invalid db for " & URI);
Controller.Set_Property ("password", "<PASSWORD>");
Util.Tests.Assert_Equals (T, "test", Controller.Get_Property ("password"),
"Invalid 'password' property for " & URI);
exception
when E : Connection_Error =>
Util.Tests.Assert_Matches (T, "Driver.*not found.*",
Ada.Exceptions.Exception_Message (E),
"Invalid exception raised for " & URI);
end Check;
begin
Check ("mysql://test:3306/db", "test", 3306, "db");
Check ("mysql://test2:3307/db2?user=admin&password=<PASSWORD>", "<PASSWORD>", 3307, "db2");
Check ("sqlite:///test.db", "", 0, "test.db");
Check ("sqlite:///test2.db?user=root&encoding=UTF-8", "", 0, "test2.db");
end Test_Set_Connection;
-- ------------------------------
-- Test the Set_Connection procedure with several error cases.
-- ------------------------------
procedure Test_Set_Connection_Error (T : in out Test) is
procedure Check_Invalid_Connection (URI : in String);
Controller : ADO.Connections.Configuration;
procedure Check_Invalid_Connection (URI : in String) is
begin
Controller.Set_Connection (URI);
T.Fail ("No Connection_Error exception raised for " & URI);
exception
when Connection_Error =>
null;
end Check_Invalid_Connection;
begin
Check_Invalid_Connection ("");
Check_Invalid_Connection ("http://");
Check_Invalid_Connection ("mysql://");
Check_Invalid_Connection ("sqlite://");
Check_Invalid_Connection ("mysql://:toto/");
Check_Invalid_Connection ("sqlite://:toto/");
end Test_Set_Connection_Error;
-- ------------------------------
-- Test the Set_Server operation.
-- ------------------------------
procedure Test_Set_Connection_Server (T : in out Test) is
Controller : ADO.Connections.Configuration;
begin
Controller.Set_Connection ("mysql://localhost:3306/db");
Controller.Set_Server ("server-name");
Util.Tests.Assert_Equals (T, "server-name", Controller.Get_Server,
"Configuration Set_Server returned invalid value");
exception
when E : ADO.Configs.Connection_Error =>
Util.Tests.Assert_Equals (T, "Driver 'mysql' not found",
Ada.Exceptions.Exception_Message (E),
"Invalid exception message");
end Test_Set_Connection_Server;
-- ------------------------------
-- Test the Set_Port operation.
-- ------------------------------
procedure Test_Set_Connection_Port (T : in out Test) is
Controller : ADO.Connections.Configuration;
begin
Controller.Set_Connection ("mysql://localhost:3306/db");
Controller.Set_Port (1234);
Util.Tests.Assert_Equals (T, 1234, Controller.Get_Port,
"Configuration Set_Port returned invalid value");
exception
when E : ADO.Configs.Connection_Error =>
Util.Tests.Assert_Equals (T, "Driver 'mysql' not found",
Ada.Exceptions.Exception_Message (E),
"Invalid exception message");
end Test_Set_Connection_Port;
-- ------------------------------
-- Test the Set_Database operation.
-- ------------------------------
procedure Test_Set_Connection_Database (T : in out Test) is
Controller : ADO.Connections.Configuration;
begin
Controller.Set_Connection ("mysql://localhost:3306/db");
Controller.Set_Database ("test-database");
Util.Tests.Assert_Equals (T, "test-database", Controller.Get_Database,
"Configuration Set_Database returned invalid value");
exception
when E : ADO.Configs.Connection_Error =>
Util.Tests.Assert_Equals (T, "Driver 'mysql' not found",
Ada.Exceptions.Exception_Message (E),
"Invalid exception message");
end Test_Set_Connection_Database;
-- ------------------------------
-- Test the connection operations on an empty connection.
-- ------------------------------
procedure Test_Empty_Connection (T : in out Test) is
use type ADO.Sessions.Connection_Status;
C : ADO.Sessions.Session;
Stmt : ADO.Statements.Query_Statement;
pragma Unreferenced (Stmt);
begin
T.Assert (C.Get_Status = ADO.Sessions.CLOSED,
"The database connection must be closed for an empty connection");
-- Create_Statement must raise Session_Error.
begin
Stmt := C.Create_Statement ("");
T.Fail ("No exception raised for Create_Statement");
exception
when ADO.Sessions.Session_Error =>
null;
end;
-- Create_Statement must raise Session_Error.
begin
Stmt := C.Create_Statement ("select");
T.Fail ("No exception raised for Create_Statement");
exception
when ADO.Sessions.Session_Error =>
null;
end;
end Test_Empty_Connection;
-- ------------------------------
-- Test the connection operations on a closed connection.
-- ------------------------------
procedure Test_Closed_Connection (T : in out Test) is
begin
declare
DB : ADO.Sessions.Master_Session := Regtests.Get_Master_Database;
DB2 : constant ADO.Sessions.Master_Session := DB;
Stmt : ADO.Statements.Query_Statement;
begin
DB.Close;
Stmt := DB2.Create_Statement ("SELECT name FROM test_table");
Stmt.Execute;
Util.Tests.Fail (T, "No Session_Error exception was raised");
exception
when ADO.Sessions.Session_Error =>
null;
end;
declare
DB : ADO.Sessions.Master_Session := Regtests.Get_Master_Database;
DB2 : ADO.Sessions.Master_Session := DB;
begin
DB.Close;
DB2.Begin_Transaction;
Util.Tests.Fail (T, "No Session_Error exception was raised");
exception
when ADO.Sessions.Session_Error =>
null;
end;
declare
DB : ADO.Sessions.Master_Session := Regtests.Get_Master_Database;
DB2 : ADO.Sessions.Master_Session := DB;
begin
DB.Close;
DB2.Commit;
Util.Tests.Fail (T, "No Session_Error exception was raised");
exception
when ADO.Sessions.Session_Error =>
null;
end;
declare
DB : ADO.Sessions.Master_Session := Regtests.Get_Master_Database;
DB2 : ADO.Sessions.Master_Session := DB;
begin
DB.Close;
DB2.Rollback;
Util.Tests.Fail (T, "No Session_Error exception was raised");
exception
when ADO.Sessions.Session_Error =>
null;
end;
end Test_Closed_Connection;
end ADO.Drivers.Tests;
|
src/grammar/Document.g4 | craterdog-bali/js-bali-procedure-compiler | 0 | 7686 | <reponame>craterdog-bali/js-bali-procedure-compiler<gh_stars>0
grammar Document;
import Instructions;
document: EOL* instructions EOL* EOF;
|
libsrc/input/in_GetKeyReset.asm | Frodevan/z88dk | 640 | 82258 | ; void in_GetKeyReset(void)
; 09.2005 aralbrec
SECTION code_clib
PUBLIC in_GetKeyReset
PUBLIC _in_GetKeyReset
EXTERN _in_KeyDebounce, _in_KbdState
.in_GetKeyReset
._in_GetKeyReset
ld a,(_in_KeyDebounce)
ld e,a
ld d,0
IF __CPU_INTEL__
ex de,hl
ld (_in_KbdState),hl
ex de,hl
ELSE
ld (_in_KbdState),de
ENDIF
ret
|
Drive Space Check/Drive Space Check.applescript | josephdadams/applescripts | 2 | 4454 | global webhookurl
global computername
set webhookurl to "#####" --slack webhook here
set computername to "Control Room 2 Video Server"
spaceCheck("/Volumes/FG Tech Recordings", 40)
spaceCheck("/", 35)
on spaceCheck(volume, threshold)
--get the amount of free space
set dSize to (do shell script "df -h '" & volume & "' | grep %") as text
--pull out the percent used from the result
set theCapacity to word 16 in dSize as number
--get the percent remaining
set theRemaining to 100 - theCapacity
--build the request command
set jsonString to "{\"text\":\"" & computername & " - Free Space Remaining on " & volume & ": " & theRemaining & "%\"}"
set curl_command to "curl -X POST -H 'Content-type: application/json' --data '" & jsonString & "' " & webhookurl
--if the space remaining is 35% or less, send out an alert
if theRemaining is less than or equal to threshold then
do shell script curl_command
end if
end spaceCheck |
tests/natools-cron-tests.ads | faelys/natools | 0 | 26057 | ------------------------------------------------------------------------------
-- Copyright (c) 2014-2017, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Cron.Tests provides a test suite for Natools.Cron. --
------------------------------------------------------------------------------
with Natools.Tests;
package Natools.Cron.Tests is
package NT renames Natools.Tests;
procedure All_Tests (Report : in out NT.Reporter'Class);
procedure Basic_Usage (Report : in out NT.Reporter'Class);
procedure Delete_While_Busy (Report : in out NT.Reporter'Class);
procedure Delete_While_Collision (Report : in out NT.Reporter'Class);
procedure Event_List_Extension (Report : in out NT.Reporter'Class);
procedure Event_List_Fusion (Report : in out NT.Reporter'Class);
procedure Insert_While_Busy (Report : in out NT.Reporter'Class);
procedure Time_Collision (Report : in out NT.Reporter'Class);
private
type Bounded_String (Max_Size : Natural) is record
Data : String (1 .. Max_Size);
Size : Natural := 0;
end record;
procedure Append (S : in out Bounded_String; C : Character);
function Get (S : Bounded_String) return String;
procedure Reset (S : in out Bounded_String);
type Test_Callback (Backend : access Bounded_String) is new Callback with
record
Symbol : Character;
end record;
overriding procedure Run (Self : in out Test_Callback);
type Long_Callback (Backend : access Bounded_String) is new Callback with
record
Open, Close : Character;
Wait : Duration;
end record;
overriding procedure Run (Self : in out Long_Callback);
end Natools.Cron.Tests;
|
Transynther/x86/_processed/AVXALIGN/_un_/i9-9900K_12_0xa0_notsx.log_1_717.asm | ljhsiun2/medusa | 9 | 164282 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdx
// Store
lea addresses_normal+0x1c214, %r8
nop
nop
nop
xor $61682, %r15
movw $0x5152, (%r8)
nop
nop
nop
nop
nop
add $5494, %r15
// Store
lea addresses_US+0x4415, %r11
nop
nop
nop
nop
nop
cmp %rbx, %rbx
mov $0x5152535455565758, %r8
movq %r8, %xmm6
movaps %xmm6, (%r11)
nop
nop
nop
dec %rbx
// Faulty Load
lea addresses_WT+0xb285, %r15
clflush (%r15)
nop
add %rdx, %rdx
vmovaps (%r15), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %r8
lea oracles, %r15
and $0xff, %r8
shlq $12, %r8
mov (%r15,%r8,1), %r8
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'AVXalign': True, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'60': 1}
60
*/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.