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
src/vulkan.adb
persan/a-vulkan
0
27657
<filename>src/vulkan.adb pragma Ada_2012; with Vulkan.Low_Level.Vulkan_Core_H; with Interfaces.C; package body Vulkan is use Vulkan.Low_Level.Vulkan_Core_H; use Interfaces.C; -------------------------------- -- VkEnumerateInstanceVersion -- -------------------------------- function VkEnumerateInstanceVersion return Integer is ApiVersion : aliased Unsigned_Short; Result : VkResult; begin Result := VkEnumerateInstanceVersion (ApiVersion'Access); if Result /= 0 then raise Vulkan_Error with Result'Img; end if; return Integer (ApiVersion); end VkEnumerateInstanceVersion; end Vulkan;
programs/oeis/004/A004450.asm
neoneye/loda
22
23518
<filename>programs/oeis/004/A004450.asm ; A004450: Nimsum n + 9. ; 9,8,11,10,13,12,15,14,1,0,3,2,5,4,7,6,25,24,27,26,29,28,31,30,17,16,19,18,21,20,23,22,41,40,43,42,45,44,47,46,33,32,35,34,37,36,39,38,57,56,59,58,61,60,63,62,49,48,51,50,53,52,55,54,73,72,75,74,77,76,79,78,65,64,67,66,69,68,71,70,89,88,91,90,93,92,95,94,81,80,83,82,85,84,87,86,105,104,107,106 mov $1,-1 pow $1,$0 seq $0,4449 ; Nimsum n + 8. add $1,2 add $1,$0 sub $1,2 mov $0,$1
source/Controller_MainWindow.adb
bracke/Meaning
0
3659
<gh_stars>0 with RASCAL.Memory; use RASCAL.Memory; with RASCAL.OS; use RASCAL.OS; with RASCAL.Utility; use RASCAL.Utility; with RASCAL.FileExternal; use RASCAL.FileExternal; with RASCAL.Heap; use RASCAL.Heap; with RASCAL.WimpTask; use RASCAL.WimpTask; with RASCAL.ToolboxMenu; use RASCAL.ToolboxMenu; with RASCAL.Toolbox; use RASCAL.Toolbox; with RASCAL.ToolboxWritableField; use RASCAL.ToolboxWritableField; with RASCAL.ToolboxTextArea; use RASCAL.ToolboxTextArea; with RASCAL.Bugz; use RASCAL.Bugz; with RASCAL.Mode; use RASCAL.Mode; with Main; use Main; with Ada.Exceptions; with AcronymList; use AcronymList; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces.C; use Interfaces.C; with Ada.Characters.Handling; with Reporter; package body Controller_MainWindow is -- package Memory renames RASCAL.Memory; package OS renames RASCAL.OS; package Utility renames RASCAL.Utility; package FileExternal renames RASCAL.FileExternal; package Heap renames RASCAL.Heap; package WimpTask renames RASCAL.WimpTask; package ToolboxMenu renames RASCAL.ToolboxMenu; package Toolbox renames RASCAL.Toolbox; package ToolboxWritableField renames RASCAL.ToolboxWritableField; package ToolboxTextArea renames RASCAL.ToolboxTextArea; package Bugz renames RASCAL.Bugz; package Mode renames RASCAL.Mode; -- procedure Open_Window is begin if x_pos > Mode.Get_X_Resolution (OSUnits) or y_pos > Mode.Get_Y_Resolution (OSUnits) or x_pos < 0 or y_pos < 0 then Toolbox.Show_Object (main_objectid,0,0,Centre); else Toolbox.Show_Object_At (main_objectid,x_pos,y_pos,0,0); end if; end Open_Window; -- procedure Handle (The : in TEL_OKButtonPressed_Type) is Object : Object_ID := Get_Self_Id(Main_Task); Acronym : String := Ada.Characters.Handling.To_Lower(Get_Value(Object,1)); Start : AcronymList.Position; i : AcronymList.Position; Meaning : Meaning_Pointer; Result : UString; begin if not IsEmpty(Acronym_List.all) then Start := First (Acronym_List.all); i := Start; loop -- For each file loop.. Meaning := Retrieve (Acronym_List.all,i); declare Acronym_Str : UString; Meaning_Str : UString; Offset : natural := 0; FileSize : natural := Meaning.all.FileSize; begin -- for each line in filebuffer loop.. while Offset < FileSize loop Acronym_Str := U(MemoryToString(Heap.Get_Address(Meaning.all.Buffer.all),Offset,ASCII.LF)); Offset := Offset + Ada.Strings.Unbounded.Length(Acronym_Str) + 1; if Acronym = Ada.Characters.Handling.To_Lower(S(Acronym_Str)) then -- It is a match.. if Offset < FileSize and Ada.Strings.Unbounded.Length(Acronym_Str) > 0 then Meaning_Str := U(MemoryToString(Get_Address(Meaning.all.Buffer.all),Offset,ASCII.LF)); Offset := Offset + Ada.Strings.Unbounded.Length(Meaning_Str) + 1; Ada.Strings.Unbounded.Append(Result,Meaning.all.Category); Ada.Strings.Unbounded.Append(Result,": "); Ada.Strings.Unbounded.Append(Result,Meaning_Str); Ada.Strings.Unbounded.Append(Result," " & ASCII.LF); end if; end if; end loop; end; if IsLast (Acronym_List.all, i) then exit; end if; GoAhead (Acronym_List.all, i); end loop; if Ada.Strings.Unbounded.Length(Result) = 0 then Result := Not_Found_Message; end if; ToolboxTextArea.Set_Text(Object,0,S(Result)); end if; exception when e: others => Report_Error("SEARCHING",Ada.Exceptions.Exception_Information (e)); end Handle; -- procedure Handle (The : in TEL_EscapeButtonPressed_Type) is Object : Object_ID := Get_Self_Id(Main_Task); begin Hide_Object(Object); end Handle; -- procedure Handle (The : in TEL_RenewSelected_Type) is begin Discard_Acronyms; Read_Acronyms; exception when e: others => Report_Error("RENEW",Ada.Exceptions.Exception_Information (e)); end Handle; -- procedure Handle (The : in TEL_OpenWindow_Type) is begin Open_Window; exception when Exception_Data : others => Report_Error("OPENWINDOW",Ada.Exceptions.Exception_Information (Exception_Data)); end Handle; end Controller_MainWindow;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_142.asm
ljhsiun2/medusa
9
94855
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_D_ht+0xa5a7, %r9 nop nop nop inc %r12 mov (%r9), %r11d nop nop nop nop nop xor $40000, %r13 lea addresses_WC_ht+0x1b137, %rsi lea addresses_normal_ht+0x12b5f, %rdi sub %r15, %r15 mov $107, %rcx rep movsb nop inc %rdi lea addresses_UC_ht+0x171cf, %rsi lea addresses_WC_ht+0xdd37, %rdi nop nop nop xor %r11, %r11 mov $126, %rcx rep movsw nop nop nop nop nop sub $5714, %rcx lea addresses_UC_ht+0x79ff, %rsi lea addresses_WC_ht+0x1cb37, %rdi nop nop add %r11, %r11 mov $122, %rcx rep movsq nop nop nop nop nop and %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r15 push %r8 push %rbp push %rcx push %rdx // Store lea addresses_RW+0x80e7, %rdx nop nop nop nop xor %rcx, %rcx movb $0x51, (%rdx) nop nop nop dec %rcx // Load lea addresses_WC+0xf037, %rbp nop nop nop nop dec %r15 movb (%rbp), %r8b nop nop nop add $54408, %rdx // Store lea addresses_UC+0x19d17, %rbp nop nop nop nop nop add %r8, %r8 mov $0x5152535455565758, %r13 movq %r13, (%rbp) nop nop nop sub $23061, %rdx // Load lea addresses_PSE+0x13937, %rcx nop nop nop nop xor %rdx, %rdx movb (%rcx), %r8b nop nop nop nop add $55984, %r13 // Store lea addresses_normal+0x953f, %rdx nop nop inc %r15 movb $0x51, (%rdx) nop nop nop nop xor $30587, %r15 // Faulty Load lea addresses_PSE+0x13937, %rcx sub $56683, %r10 movb (%rcx), %r13b lea oracles, %rcx and $0xff, %r13 shlq $12, %r13 mov (%rcx,%r13,1), %r13 pop %rdx pop %rcx pop %rbp pop %r8 pop %r15 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_RW', 'AVXalign': False, 'size': 1}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}} {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal', 'AVXalign': False, 'size': 1}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}} {'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 */
homotopy/3x3/Transpose.agda
UlrikBuchholtz/HoTT-Agda
1
7254
{-# OPTIONS --without-K #-} open import homotopy.3x3.Common open import homotopy.3x3.PushoutPushout module homotopy.3x3.Transpose where open M using (Pushout^2) type-of : ∀ {i} {A : Type i} (u : A) → Type i type-of {A = A} _ = A module _ {i} (d : Span^2 {i}) where open Span^2 d transpose-f : (f : type-of H₁₁ → _) (g : type-of H₃₃ → _) → Span^2 transpose-f f g = span^2 A₀₀ A₂₀ A₄₀ A₀₂ A₂₂ A₄₂ A₀₄ A₂₄ A₄₄ f₁₀ f₃₀ f₁₂ f₃₂ f₁₄ f₃₄ f₀₁ f₀₃ f₂₁ f₂₃ f₄₁ f₄₃ (f H₁₁) H₃₁ H₁₃ (g H₃₃) transpose : Span^2 transpose = span^2 A₀₀ A₂₀ A₄₀ A₀₂ A₂₂ A₄₂ A₀₄ A₂₄ A₄₄ f₁₀ f₃₀ f₁₂ f₃₂ f₁₄ f₃₄ f₀₁ f₀₃ f₂₁ f₂₃ f₄₁ f₄₃ (! ∘ H₁₁) H₃₁ H₁₃ (! ∘ H₃₃) ch1 : ∀ {i j} {A : Type i} {x y : A} {p : x == y} {f g : A → Type j} {a : f x → g x} {b : f y → g y} → (a == b [ (λ u → f u → g u) ↓ p ]) → (a == b [ (λ u → fst u → snd u) ↓ pair×= (ap f p) (ap g p)]) ch1 {p = idp} α = α ch2 : ∀ {i j} {X : Type i} {x y : X} {p : x == y} {A B₁ B₂ C : X → Type j} {f₁ : (x : X) → A x → B₁ x} {g₁ : (x : X) → B₁ x → C x} {f₂ : (x : X) → A x → B₂ x} {g₂ : (x : X) → B₂ x → C x} {a : _} {b : _} → (a == b [ (λ z → (x : A z) → g₁ z (f₁ z x) == g₂ z (f₂ z x)) ↓ p ]) → (a == b [ (λ u → (x : SquareFunc.A u) → SquareFunc.g₁ u (SquareFunc.f₁ u x) == SquareFunc.g₂ u (SquareFunc.f₂ u x)) ↓ square=-raw (ap A p) (ap B₁ p) (ap B₂ p) (ap C p) (ch1 (apd f₁ p)) (ch1 (apd f₂ p)) (ch1 (apd g₁ p)) (ch1 (apd g₂ p)) ]) ch2 {p = idp} α = α ap-span^2=-priv : ∀ {i} {d d' : Span^2 {i}} (p : d == d') → ap transpose p == span^2=-raw (ap Span^2.A₀₀ p) (ap Span^2.A₂₀ p) (ap Span^2.A₄₀ p) (ap Span^2.A₀₂ p) (ap Span^2.A₂₂ p) (ap Span^2.A₄₂ p) (ap Span^2.A₀₄ p) (ap Span^2.A₂₄ p) (ap Span^2.A₄₄ p) (ch1 (apd Span^2.f₁₀ p)) (ch1 (apd Span^2.f₃₀ p)) (ch1 (apd Span^2.f₁₂ p)) (ch1 (apd Span^2.f₃₂ p)) (ch1 (apd Span^2.f₁₄ p)) (ch1 (apd Span^2.f₃₄ p)) (ch1 (apd Span^2.f₀₁ p)) (ch1 (apd Span^2.f₀₃ p)) (ch1 (apd Span^2.f₂₁ p)) (ch1 (apd Span^2.f₂₃ p)) (ch1 (apd Span^2.f₄₁ p)) (ch1 (apd Span^2.f₄₃ p)) (ch2 (ap↓ (λ u → ! ∘ u) (apd Span^2.H₁₁ p))) (ch2 (apd Span^2.H₃₁ p)) (ch2 (apd Span^2.H₁₃ p)) (ch2 (ap↓ (λ u → ! ∘ u) (apd Span^2.H₃₃ p))) ap-span^2=-priv {i} {d} {.d} idp = idp ap-span^2=-priv2 : ∀ {i} {A₀₀ A₀₀' : Type i} (eq-A₀₀ : A₀₀ == A₀₀') {A₀₂ A₀₂' : Type i} (eq-A₀₂ : A₀₂ == A₀₂') {A₀₄ A₀₄' : Type i} (eq-A₀₄ : A₀₄ == A₀₄') {A₂₀ A₂₀' : Type i} (eq-A₂₀ : A₂₀ == A₂₀') {A₂₂ A₂₂' : Type i} (eq-A₂₂ : A₂₂ == A₂₂') {A₂₄ A₂₄' : Type i} (eq-A₂₄ : A₂₄ == A₂₄') {A₄₀ A₄₀' : Type i} (eq-A₄₀ : A₄₀ == A₄₀') {A₄₂ A₄₂' : Type i} (eq-A₄₂ : A₄₂ == A₄₂') {A₄₄ A₄₄' : Type i} (eq-A₄₄ : A₄₄ == A₄₄') {f₀₁ : A₀₂ → A₀₀} {f₀₁' : A₀₂' → A₀₀'} (eq-f₀₁ : f₀₁ == f₀₁' [ (λ u → fst u → snd u) ↓ pair×= eq-A₀₂ eq-A₀₀ ]) {f₀₃ : A₀₂ → A₀₄} {f₀₃' : A₀₂' → A₀₄'} (eq-f₀₃ : f₀₃ == f₀₃' [ (λ u → fst u → snd u) ↓ pair×= eq-A₀₂ eq-A₀₄ ]) {f₂₁ : A₂₂ → A₂₀} {f₂₁' : A₂₂' → A₂₀'} (eq-f₂₁ : f₂₁ == f₂₁' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₂ eq-A₂₀ ]) {f₂₃ : A₂₂ → A₂₄} {f₂₃' : A₂₂' → A₂₄'} (eq-f₂₃ : f₂₃ == f₂₃' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₂ eq-A₂₄ ]) {f₄₁ : A₄₂ → A₄₀} {f₄₁' : A₄₂' → A₄₀'} (eq-f₄₁ : f₄₁ == f₄₁' [ (λ u → fst u → snd u) ↓ pair×= eq-A₄₂ eq-A₄₀ ]) {f₄₃ : A₄₂ → A₄₄} {f₄₃' : A₄₂' → A₄₄'} (eq-f₄₃ : f₄₃ == f₄₃' [ (λ u → fst u → snd u) ↓ pair×= eq-A₄₂ eq-A₄₄ ]) {f₁₀ : A₂₀ → A₀₀} {f₁₀' : A₂₀' → A₀₀'} (eq-f₁₀ : f₁₀ == f₁₀' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₀ eq-A₀₀ ]) {f₃₀ : A₂₀ → A₄₀} {f₃₀' : A₂₀' → A₄₀'} (eq-f₃₀ : f₃₀ == f₃₀' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₀ eq-A₄₀ ]) {f₁₂ : A₂₂ → A₀₂} {f₁₂' : A₂₂' → A₀₂'} (eq-f₁₂ : f₁₂ == f₁₂' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₂ eq-A₀₂ ]) {f₃₂ : A₂₂ → A₄₂} {f₃₂' : A₂₂' → A₄₂'} (eq-f₃₂ : f₃₂ == f₃₂' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₂ eq-A₄₂ ]) {f₁₄ : A₂₄ → A₀₄} {f₁₄' : A₂₄' → A₀₄'} (eq-f₁₄ : f₁₄ == f₁₄' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₄ eq-A₀₄ ]) {f₃₄ : A₂₄ → A₄₄} {f₃₄' : A₂₄' → A₄₄'} (eq-f₃₄ : f₃₄ == f₃₄' [ (λ u → fst u → snd u) ↓ pair×= eq-A₂₄ eq-A₄₄ ]) {H₁₁ : (x : A₂₂) → f₁₀ (f₂₁ x) == f₀₁ (f₁₂ x)} {H₁₁' : (x : A₂₂') → f₁₀' (f₂₁' x) == f₀₁' (f₁₂' x)} (eq-H₁₁ : H₁₁ == H₁₁' [ (λ u → ((x : SquareFunc.A u) → SquareFunc.g₁ u (SquareFunc.f₁ u x) == SquareFunc.g₂ u (SquareFunc.f₂ u x))) ↓ square=-raw eq-A₂₂ eq-A₂₀ eq-A₀₂ eq-A₀₀ eq-f₂₁ eq-f₁₂ eq-f₁₀ eq-f₀₁ ]) {H₁₃ : (x : A₂₂) → f₀₃ (f₁₂ x) == f₁₄ (f₂₃ x)} {H₁₃' : (x : A₂₂') → f₀₃' (f₁₂' x) == f₁₄' (f₂₃' x)} (eq-H₁₃ : H₁₃ == H₁₃' [ (λ u → ((x : SquareFunc.A u) → SquareFunc.g₁ u (SquareFunc.f₁ u x) == SquareFunc.g₂ u (SquareFunc.f₂ u x))) ↓ square=-raw eq-A₂₂ eq-A₀₂ eq-A₂₄ eq-A₀₄ eq-f₁₂ eq-f₂₃ eq-f₀₃ eq-f₁₄ ]) {H₃₁ : (x : A₂₂) → f₃₀ (f₂₁ x) == f₄₁ (f₃₂ x)} {H₃₁' : (x : A₂₂') → f₃₀' (f₂₁' x) == f₄₁' (f₃₂' x)} (eq-H₃₁ : H₃₁ == H₃₁' [ (λ u → ((x : SquareFunc.A u) → SquareFunc.g₁ u (SquareFunc.f₁ u x) == SquareFunc.g₂ u (SquareFunc.f₂ u x))) ↓ square=-raw eq-A₂₂ eq-A₂₀ eq-A₄₂ eq-A₄₀ eq-f₂₁ eq-f₃₂ eq-f₃₀ eq-f₄₁ ]) {H₃₃ : (x : A₂₂) → f₄₃ (f₃₂ x) == f₃₄ (f₂₃ x)} {H₃₃' : (x : A₂₂') → f₄₃' (f₃₂' x) == f₃₄' (f₂₃' x)} (eq-H₃₃ : H₃₃ == H₃₃' [ (λ u → ((x : SquareFunc.A u) → SquareFunc.g₁ u (SquareFunc.f₁ u x) == SquareFunc.g₂ u (SquareFunc.f₂ u x))) ↓ square=-raw eq-A₂₂ eq-A₄₂ eq-A₂₄ eq-A₄₄ eq-f₃₂ eq-f₂₃ eq-f₄₃ eq-f₃₄ ]) → ap transpose (span^2=-raw eq-A₀₀ eq-A₀₂ eq-A₀₄ eq-A₂₀ eq-A₂₂ eq-A₂₄ eq-A₄₀ eq-A₄₂ eq-A₄₄ eq-f₀₁ eq-f₀₃ eq-f₂₁ eq-f₂₃ eq-f₄₁ eq-f₄₃ eq-f₁₀ eq-f₃₀ eq-f₁₂ eq-f₃₂ eq-f₁₄ eq-f₃₄ eq-H₁₁ eq-H₁₃ eq-H₃₁ eq-H₃₃) == span^2=-raw eq-A₀₀ eq-A₂₀ eq-A₄₀ eq-A₀₂ eq-A₂₂ eq-A₄₂ eq-A₀₄ eq-A₂₄ eq-A₄₄ eq-f₁₀ eq-f₃₀ eq-f₁₂ eq-f₃₂ eq-f₁₄ eq-f₃₄ eq-f₀₁ eq-f₀₃ eq-f₂₁ eq-f₂₃ eq-f₄₁ eq-f₄₃ (square-thing _ _ _ _ _ _ _ _ (ap↓ (λ u → ! ∘ u) eq-H₁₁)) eq-H₃₁ eq-H₁₃ (square-thing _ _ _ _ _ _ _ _ (ap↓ (λ u → ! ∘ u) eq-H₃₃)) ap-span^2=-priv2 idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp = idp module _ {i} (d : Span^2 {i}) where open Span^2 d transpose-transpose : transpose (transpose d) == d transpose-transpose = span^2=-raw idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp (λ= (!-! ∘ Span^2.H₁₁ d)) idp idp (λ= (!-! ∘ Span^2.H₃₃ d)) module _ {i} (d : Span^2 {i}) where transpose-equiv : Span^2 {i} ≃ Span^2 transpose-equiv = equiv transpose transpose transpose-transpose transpose-transpose module _ {i} (d : Span^2 {i}) where open Span^2 d d' : (H₁₁' : type-of H₁₁) (H₃₃' : type-of H₃₃) → Span^2 d' H₁₁' H₃₃' = record d {H₁₁ = H₁₁'; H₃₃ = H₃₃'} e : {H₁₁' : type-of H₁₁} (eq₁ : H₁₁ == H₁₁') {H₃₃' : type-of H₃₃} (eq₃ : H₃₃ == H₃₃') (c : M.A₂∙ (d' H₁₁' H₃₃')) → left (M.f₁∙ (d' H₁₁' H₃₃') c) == right (M.f₃∙ (d' H₁₁' H₃₃') c) e {H₁₁'} eq₁ {H₃₃'} eq₃ = E.f module _ where e-glue : {H₁₁' : type-of H₁₁} (eq₁ : H₁₁ == H₁₁') {H₃₃' : type-of H₃₃} (eq₃ : H₃₃ == H₃₃') (c : Span^2.A₂₂ (d' H₁₁' H₃₃')) → glue (left (f₂₁ c)) == glue (right (f₂₃ c)) [ (λ z → left (M.f₁∙ (d' H₁₁' H₃₃') z) == right (M.f₃∙ (d' H₁₁' H₃₃') z)) ↓ glue c ] e-glue idp idp c = apd glue (glue c) module E = PushoutElim {P = λ c → left (M.f₁∙ (d' H₁₁' H₃₃') c) == right (M.f₃∙ (d' H₁₁' H₃₃') c) :> Pushout^2 d} (glue ∘ left) (glue ∘ right) (e-glue eq₁ eq₃) module F {H₁₁' : type-of H₁₁} (eq₁ : H₁₁ == H₁₁') {H₃₃' : type-of H₃₃} (eq₃ : H₃₃ == H₃₃') = PushoutRec {d = M.v-h-span (d' H₁₁' H₃₃')} {D = Pushout^2 d} left right (e eq₁ eq₃) tr-tr-fun : Pushout^2 (transpose (transpose d)) → Pushout^2 d tr-tr-fun = F.f (! (λ= (!-! ∘ H₁₁))) (! (λ= (!-! ∘ H₃₃))) lemma12 : (c : M.A₂∙ d) → e idp idp c == glue c lemma12 = Pushout-elim (λ a → idp) (λ b → idp) (λ c → ↓-=-in (! (E.glue-β idp idp c))) result' : {H₁₁' : type-of H₁₁} (eq₁ : H₁₁ == H₁₁') {H₃₃' : type-of H₃₃} (eq₃ : H₃₃ == H₃₃') (x : Pushout^2 (d' H₁₁' H₃₃')) → transport Pushout^2 (span^2=-raw idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp (! eq₁) idp idp (! eq₃) :> (d' H₁₁' H₃₃' == d)) x == F.f eq₁ eq₃ x result' idp idp = Pushout-elim (λ a → idp) (λ b → idp) (λ c → ↓-='-in (F.glue-β idp idp c ∙ lemma12 c ∙ ! (ap-idf (glue c)))) result : {H₁₁' : type-of H₁₁} (eq₁ : H₁₁' == H₁₁) {H₃₃' : type-of H₃₃} (eq₃ : H₃₃' == H₃₃) (x : Pushout^2 (d' H₁₁' H₃₃')) → transport Pushout^2 (span^2=-raw idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp eq₁ idp idp eq₃ :> (d' H₁₁' H₃₃' == d)) x == F.f (! eq₁) (! eq₃) x result eq₁ eq₃ x = ap (λ u → transport Pushout^2 (span^2=-raw idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp (fst u) idp idp (snd u) :> (_ == d)) x) (pair×= (! (!-! eq₁)) (! (!-! eq₃))) ∙ result' (! eq₁) (! eq₃) x result2 : (x : Pushout^2 (transpose (transpose d))) → transport Pushout^2 (transpose-transpose d) x == tr-tr-fun x result2 = result (λ= (!-! ∘ Span^2.H₁₁ d)) (λ= (!-! ∘ Span^2.H₃₃ d)) -- module _ {i} where -- postulate -- to : (d : Span^2 {i}) → Pushout^2 d → Pushout^2 (transpose d) -- from : (d : Span^2 {i}) → Pushout^2 (transpose d) → Pushout^2 d -- from d = tr-tr-fun d ∘ to (transpose d) -- postulate -- from-to : (d : Span^2 {i}) (x : Pushout^2 d) → from d (to d x) == x -- lemma3 : {d d' : Span^2 {i}} (p : d == d') (x : Pushout^2 d) → transport (Pushout^2 ∘ transpose) p (to d x) == to d' (transport Pushout^2 p x) -- lemma3 {d} {.d} idp x = idp -- lemma34 : (d : Span^2 {i}) (x : Pushout^2 (transpose (transpose d))) → transport (Pushout^2 ∘ transpose) (transpose-transpose d) (to (transpose (transpose d)) x) == to d (tr-tr-fun d x) -- lemma34 d x = lemma3 (transpose-transpose d) x ∙ ap (to d) (result2 d x) -- lm2 : (d : Span^2 {i}) → ap transpose (transpose-transpose d) == transpose-transpose (transpose d) -- lm2 d = ap-span^2=-priv2 idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp -- (! (! (λ= (!-! ∘ Span^2.H₁₁ d)))) idp idp (! (! (λ= (!-! ∘ Span^2.H₃₃ d)))) ∙ ap (λ u → span^2=-raw idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp idp (fst u) idp idp (snd u)) (pair×= (lm3 (Span^2.H₁₁ d)) (lm3 (Span^2.H₃₃ d))) where -- lm3 : ∀ {i j} {A : Type i} {B : Type j} {f g : A → B} (p : (a : A) → f a == g a) -- → ap (λ f → ! ∘ f) (! (! (λ= (!-! ∘ p)))) == ! (! (λ= (!-! ∘ ! ∘ p))) -- lm3 p = transport (λ u → ap (λ f → ! ∘ f) (! (! (λ= (!-! ∘ u)))) == ! (! (λ= (!-! ∘ ! ∘ u)))) (λ= (app=-β p)) (lm3' (λ= p)) where -- lm3' : ∀ {i j} {A : Type i} {B : Type j} {f g : A → B} (p : f == g) -- → ap (λ f → ! ∘ f) (! (! (λ= (!-! ∘ app= p)))) == ! (! (λ= (!-! ∘ ! ∘ app= p))) -- lm3' idp = ap (λ u → ap (λ u → ! ∘ u) (! (! u))) (! (λ=-η idp)) ∙ ap (! ∘ !) (λ=-η idp) -- lemma345 : (d : Span^2 {i}) (x : Pushout^2 (transpose (transpose (transpose d)))) -- → transport (Pushout^2 ∘ transpose) (transpose-transpose d) x == tr-tr-fun (transpose d) x -- lemma345 d x = -- transport (Pushout^2 ∘ transpose) (transpose-transpose d) x -- =⟨ ap (λ u → coe u x) (ap-∘ Pushout^2 transpose (transpose-transpose d)) ⟩ -- transport Pushout^2 (ap transpose (transpose-transpose d)) x -- =⟨ ap (λ u → transport Pushout^2 u x) (lm2 d) ⟩ -- transport Pushout^2 (transpose-transpose (transpose d)) x -- =⟨ result2 (transpose d) x ⟩ -- tr-tr-fun (transpose d) x ∎ -- to-from : (d : Span^2 {i}) (x : Pushout^2 (transpose d)) → to d (from d x) == x -- to-from d x = -- to d (tr-tr-fun d (to (transpose d) x)) -- =⟨ ! (lemma34 d (to (transpose d) x)) ⟩ -- transport (Pushout^2 ∘ transpose) (transpose-transpose d) (to (transpose (transpose d)) (to (transpose d) x)) -- =⟨ lemma345 d (to (transpose (transpose d)) (to (transpose d) x)) ⟩ -- tr-tr-fun (transpose d) (to (transpose (transpose d)) (to (transpose d) x)) -- =⟨ from-to (transpose d) x ⟩ -- x ∎
applet/aide/source/editors/aide-editor-of_comment.adb
charlie5/aIDE
3
14542
with Glib, glib.Error, gtk.Builder, gtk.Handlers, gtk.Text_Buffer, gtk.Text_Iter, gtk.Enums, ada.Characters.latin_1; package body aIDE.Editor.of_comment is use Gtk.Builder, Gtk.Text_Buffer, Gtk.Text_Iter, Glib, Glib.Error; function on_comment_text_View_leave (the_Entry : access Gtk_Text_View_Record'Class; the_Operation : in AdaM.Comment.view) return Boolean is use Gtk.Text_Iter; Start : Gtk_Text_Iter; the_End : Gtk_Text_Iter; Continue : Boolean; the_Lines : AdaM.text_Lines; begin the_Entry.Get_Buffer.get_start_Iter (Start); the_End := Start; Forward_Line (the_End, Continue); if Start = the_End then return False; end if; loop declare use AdaM; the_Text : constant String := the_Entry.Get_Buffer.Get_Text (Start, the_End); begin if the_Text (the_Text'Last) = ada.Characters.Latin_1.LF then the_Lines.append (+the_Text (the_Text'First .. the_Text'Last - 1)); -- Drop Line Feed. else the_Lines.append (+the_Text); end if; end; exit when not Continue; Start := the_End; the_End := Start; Forward_Line (the_End, Continue); end loop; the_Operation.Lines_are (the_Lines); return False; end on_comment_text_View_leave; procedure on_rid_Button_clicked (the_Button : access Gtk_Button_Record'Class; the_comment_Editor : in aIDE.Editor.of_comment.view) is pragma Unreferenced (the_comment_Editor); begin the_Button.get_Parent.get_Parent.get_Parent.destroy; end on_rid_Button_clicked; package text_View_return_Callbacks is new Gtk.Handlers.User_Return_Callback (Gtk_Text_View_Record, Boolean, AdaM.Comment.view); package Button_Callbacks is new Gtk.Handlers.User_Callback (Gtk_Button_Record, aIDE.Editor.of_Comment.view); package body Forge is function to_comment_Editor (the_Comment : in AdaM.Comment.view) return View is Self : constant Editor.of_Comment.view := new Editor.of_Comment.item; the_Builder : Gtk_Builder; Error : aliased GError; Result : Guint; pragma Unreferenced (Result); begin Self.Comment := the_Comment; Gtk_New (the_Builder); Result := the_Builder.Add_From_File ("glade/editor/comment_editor.glade", Error'Access); if Error /= null then raise Program_Error with "Error: adam.Editor.of_comment ~ " & Get_Message (Error); end if; Self.Top := gtk_Frame (the_Builder.get_Object ("Top")); Self.comment_text_View := gtk_Text_View (the_Builder.get_Object ("comment_text_View")); Self.comment_text_View.Override_Background_Color (State => Gtk.Enums.Gtk_State_Flag_Normal, Color => (0.85, 0.92, 0.98, 1.0)); Self.parameters_Alignment := gtk_Alignment (the_Builder.get_Object ("parameters_Alignment")); Self.rid_Button := gtk_Button (the_Builder.get_Object ("rid_Button")); Text_View_return_Callbacks.Connect (Self.comment_text_View, "focus-out-event", on_comment_text_View_leave'Access, the_Comment); Button_Callbacks.Connect (Self.rid_Button, "clicked", on_rid_Button_clicked'Access, Self); declare use AdaM; Buffer : constant Gtk_Text_Buffer := Self.comment_text_View.Get_Buffer; Iter : Gtk_Text_Iter; begin Buffer.Get_Start_Iter (Iter); for i in 1 .. Natural (the_Comment.Lines.Length) loop if i /= Natural (the_Comment.Lines.Length) then Buffer.Insert (Iter, +Self.Comment.Lines.Element (i) & Ada.Characters.Latin_1.LF); else Buffer.Insert (Iter, +Self.Comment.Lines.Element (i)); end if; end loop; end; return Self; end to_comment_Editor; end Forge; overriding function top_Widget (Self : in Item) return gtk.Widget.Gtk_Widget is begin return gtk.Widget.Gtk_Widget (Self.Top); end top_Widget; end aIDE.Editor.of_comment;
Transynther/x86/_processed/NC/_zr_un_/i7-8650U_0xd2.log_4273_1550.asm
ljhsiun2/medusa
9
87278
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x18520, %rsi lea addresses_UC_ht+0xa10c, %rdi nop dec %r9 mov $18, %rcx rep movsl and $20771, %rdx lea addresses_UC_ht+0xb940, %r10 xor $54132, %rbx mov $0x6162636465666768, %rdx movq %rdx, %xmm7 and $0xffffffffffffffc0, %r10 vmovntdq %ymm7, (%r10) nop nop nop inc %rdi lea addresses_WC_ht+0xf960, %r9 xor $16919, %rsi mov $0x6162636465666768, %rbx movq %rbx, (%r9) inc %r10 lea addresses_UC_ht+0xf560, %rsi lea addresses_normal_ht+0x16760, %rdi nop nop inc %r11 mov $86, %rcx rep movsq nop nop nop cmp $60627, %rcx lea addresses_A_ht+0x14984, %rsi lea addresses_UC_ht+0x13360, %rdi add %rbx, %rbx mov $19, %rcx rep movsw nop nop nop nop nop xor %rsi, %rsi lea addresses_WT_ht+0x109f8, %rbx clflush (%rbx) cmp $9708, %r10 movl $0x61626364, (%rbx) nop nop nop nop xor %r11, %r11 lea addresses_D_ht+0x1a50a, %rsi lea addresses_D_ht+0x13d60, %rdi nop nop cmp %rdx, %rdx mov $93, %rcx rep movsq nop nop nop nop xor %r10, %r10 lea addresses_WT_ht+0x1c870, %r11 nop add %rsi, %rsi vmovups (%r11), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rbx cmp %r10, %r10 lea addresses_D_ht+0xba38, %r10 nop dec %rsi movb (%r10), %r9b nop nop nop nop sub $40399, %rdi lea addresses_normal_ht+0x1a460, %rbx nop and %rcx, %rcx mov (%rbx), %r11d and %rcx, %rcx lea addresses_WC_ht+0xc32d, %rcx nop xor $51208, %r9 movl $0x61626364, (%rcx) nop nop and $31815, %rdx lea addresses_WC_ht+0x1e640, %rcx nop nop nop nop nop inc %r11 movw $0x6162, (%rcx) nop nop nop nop cmp %rsi, %rsi lea addresses_UC_ht+0x18f20, %rsi nop inc %r11 and $0xffffffffffffffc0, %rsi movaps (%rsi), %xmm1 vpextrq $1, %xmm1, %r10 nop nop nop dec %r9 lea addresses_D_ht+0xdf66, %rdi sub %rcx, %rcx movl $0x61626364, (%rdi) nop nop cmp $21418, %rdx lea addresses_D_ht+0x1bd60, %rcx nop nop nop nop inc %rbx movw $0x6162, (%rcx) nop nop nop cmp $43180, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r8 push %r9 push %rax push %rbp push %rdi push %rdx push %rsi // Store mov $0x3570220000000560, %rsi nop nop xor $38164, %rdi mov $0x5152535455565758, %r9 movq %r9, (%rsi) nop nop nop nop nop xor %r8, %r8 // Faulty Load mov $0x3570220000000560, %r8 nop nop sub $48648, %rdx movb (%r8), %r9b lea oracles, %rbp and $0xff, %r9 shlq $12, %r9 mov (%rbp,%r9,1), %r9 pop %rsi pop %rdx pop %rdi pop %rbp pop %rax pop %r9 pop %r8 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'16': 4172, '00': 101} 16 16 16 16 16 00 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 00 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 00 16 16 16 16 16 16 16 16 16 16 16 16 */
libsrc/z80_crt0s/crt0/l_asr.asm
grancier/z180
8
12458
; Z88 Small C+ Run time Library ; Moved functions over to proper libdefs ; To make startup code smaller and neater! ; ; 6/9/98 djm ; ; 22/3/99 djm Rewritten to be shorter.. SECTION code_crt0_sccz80 PUBLIC l_asr .l_asr ex de,hl .l_asr1 dec e ret m sra h rr l jp l_asr1 IF ARCHAIC .l_asr ex de,hl .l_asr1 dec e ret m ld a,h rla ld a,h rra ld h,a ld a,l rra ld l,a jr l_asr1 ENDIF
comparisons/agda/Vec.agda
iain-logan/she
1
13643
module Vec where open import SHE-Prelude data Nat : Set where z : Nat s : Nat -> Nat data Vec (X : Set) : Nat -> Set where vNil : Vec X z _:-_ : forall {n} -> X -> Vec X n -> Vec X (s n) _+N_ : Nat -> Nat -> Nat z +N n = n s m +N n = s (m +N n) _vappend_ : forall {X m n} -> Vec X m -> Vec X n -> Vec X (m +N n) vNil vappend ys = ys (x :- xs) vappend ys = x :- (xs vappend ys) vec : forall {n X} -> X -> Vec X n vec {z} x = vNil vec {s n} x = x :- vec x _N>=_ : Nat -> Nat -> Set m N>= z = One z N>= s n = Zero s m N>= s n = m N>= n vtake : {X : Set}{m : Nat}(n : Nat) -> m N>= n -> Vec X m -> Vec X n vtake (s n) () vNil vtake z p xs = vNil vtake (s n) p (x :- xs) = x :- (vtake n p xs) VecApp : forall {n} -> Applicative \X -> Vec X n VecApp {n} = record { pure = vec ; _<*>_ = vapp } where vapp : forall {n X Y} -> Vec (X -> Y) n -> Vec X n -> Vec Y n vapp vNil vNil = vNil vapp (f :- fs) (x :- xs) = f x :- vapp fs xs v1 : Vec Nat (s (s (s z))) v1 = Applicative.pure VecApp z v2 : Vec Nat (s z) v2 = vtake (s z) <> v1 v3 : Vec Nat (s z) v3 = vec {s z} z v5 : Vec Nat (s z) v5 = vtake (s z) <> (z :- (z :- vNil)) v6 : Vec Nat (s z) v6 = vtake (s z) <> (z :- (z :- vNil))
LP/Rewrite.agda
hbasold/Sandbox
0
697
open import Signature import Program module Rewrite (Σ : Sig) (V : Set) (P : Program.Program Σ V) where open import Terms Σ open import Program Σ V open import Data.Empty renaming (⊥ to ∅) open import Data.Unit open import Data.Product as Prod renaming (Σ to ⨿) open import Data.Sum as Sum open import Data.Fin open import Relation.Nullary open import Relation.Unary open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst) data _⟿_ (t : T V) : T V → Set where rew-step : (cl : dom P) (i : dom (getb P cl)) {σ : Subst V V} → matches (geth P cl) t σ → -- (mgm t (geth P cl) σ) → t ⟿ app σ (get (getb P cl) i) Val : Pred (T V) _ Val t = (cl : dom P) (i : dom (getb P cl)) {σ : Subst V V} → ¬ (matches (geth P cl) t σ) no-rewrite-on-vals : (t : T V) → Val t → (s : T V) → ¬ (t ⟿ s) no-rewrite-on-vals t p ._ (rew-step cl i q) = p cl i q data _↓_ (t : T V) : T V → Set where val : Val t → t ↓ t step : (r s : T V) → r ↓ s → t ⟿ r → t ↓ s {- Strongly normalising terms wrt to P are either in normal form, i.e. values, or for every clause that matches, every rewrite step must be SN. This is an adaption of the usual (constructive) definition. -} data SN (t : T V) : Set where val-sn : Val t → SN t steps-sn : (cl : dom P) (i : dom (getb P cl)) {σ : Subst V V} → (matches t (geth P cl) σ) → SN (app σ (get (getb P cl) i)) → SN t -- | Determines whether a term t is derivable from an axiom, i.e., whether -- there is a clause " ⇒ p" such that p matches t. Axiom : Pred (T V) _ Axiom t = ∃₂ λ cl σ → (mgm t (geth P cl) σ) × (domEmpty (getb P cl)) -- | An inductively valid term is derivable in finitely many steps from -- axioms. data Valid (t : T V) : Set where val-sn : Axiom t → Valid t steps-sn : (cl : dom P) (i : dom (getb P cl)) {σ : Subst V V} → (matches t (geth P cl) σ) → Valid (app σ (get (getb P cl) i)) → Valid t {- ⊥ : {X : Set} → X ⊎ ⊤ ⊥ = inj₂ tt record Rew-Branch (F : T V → Set) (t : T V) : Set where constructor prf-branch field clause : dom P matcher : Subst V V isMgm : mgm t (geth P clause) matcher next : (i : dom (getb P clause)) → F (app matcher (get (getb P clause) i)) -- | Set of rewrite trees starting in t that use the rules given in P. -- If the tree is ⊥, then t cannot be rewritten by any of the rules of P. data Rew (t : T V) : Set where in-prf : Rew-Branch Rew t ⊎ ⊤ → Rew t -- | Just as Rew, only that we also allow infinite rewriting sequences. record Rew∞ (t : T V) : Set where coinductive field out-prf : Rew-Branch Rew∞ t ⊎ ⊤ open Rew∞ out-prf⁻¹ : ∀{t} → Rew-Branch Rew∞ t ⊎ ⊤ → Rew∞ t out-prf (out-prf⁻¹ b) = b -- | Finite rewriting trees are included in the set of the possibly infinite -- ones. χ-prf : ∀{t} → Rew t → Rew∞ t χ-prf (in-prf (inj₁ (prf-branch c m isMgm next))) = out-prf⁻¹ (inj₁ (prf-branch c m isMgm (λ i → χ-prf (next i)))) χ-prf (in-prf (inj₂ tt)) = out-prf⁻¹ ⊥ Rew-Step : (F : {s : T V} → Rew∞ s → Set) → {t : T V} (R : Rew∞ t) → Set Rew-Step F R with out-prf R Rew-Step F R | inj₁ (prf-branch clause matcher isMgm next) = {!!} Rew-Step F R | inj₂ tt = ∅ data Path {t : T V} (R : Rew∞ t) : Set where root : Path R step : {!!} → Path R -}
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_249.asm
ljhsiun2/medusa
9
24821
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_249.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r14 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xf516, %r12 nop sub %r13, %r13 movl $0x61626364, (%r12) and %rsi, %rsi lea addresses_A_ht+0x12916, %rdi nop nop xor %r10, %r10 mov $0x6162636465666768, %r14 movq %r14, %xmm2 vmovups %ymm2, (%rdi) nop nop nop nop lfence lea addresses_WC_ht+0xa916, %r10 nop nop nop lfence mov (%r10), %r13 nop nop nop nop xor %r13, %r13 lea addresses_WC_ht+0x7416, %rdi nop nop nop dec %r12 movb (%rdi), %r10b nop nop dec %r13 lea addresses_normal_ht+0x18a96, %rsi lea addresses_normal_ht+0xcef0, %rdi clflush (%rsi) inc %rdx mov $116, %rcx rep movsb nop nop nop dec %rsi lea addresses_UC_ht+0x1edc2, %r12 nop sub $17260, %r13 mov $0x6162636465666768, %rcx movq %rcx, %xmm5 vmovups %ymm5, (%r12) nop nop nop nop nop sub %r13, %r13 lea addresses_WT_ht+0xc5be, %rsi lea addresses_A_ht+0x1b816, %rdi nop nop nop nop cmp $44520, %r10 mov $88, %rcx rep movsq nop nop nop nop xor $36013, %rsi lea addresses_WC_ht+0xc216, %r12 nop nop nop nop inc %r10 mov (%r12), %rdx nop sub $61893, %r12 lea addresses_WC_ht+0x2756, %rsi lea addresses_UC_ht+0x12d16, %rdi clflush (%rdi) nop nop nop nop nop cmp %r14, %r14 mov $51, %rcx rep movsq nop nop nop nop nop xor %r14, %r14 lea addresses_normal_ht+0x2116, %rsi lea addresses_UC_ht+0x15f16, %rdi nop nop nop nop nop add $54232, %rdx mov $30, %rcx rep movsl nop nop nop nop nop sub %rsi, %rsi lea addresses_WC_ht+0x15716, %rdx inc %rdi movb $0x61, (%rdx) nop nop nop nop nop cmp $51707, %rdi lea addresses_D_ht+0x9316, %rsi lea addresses_UC_ht+0x13c90, %rdi clflush (%rdi) nop nop nop nop nop and %rdx, %rdx mov $44, %rcx rep movsw nop nop nop inc %rdx lea addresses_UC_ht+0x1ab16, %r10 nop nop nop nop nop and %rcx, %rcx mov $0x6162636465666768, %rdx movq %rdx, %xmm7 vmovups %ymm7, (%r10) add $45814, %rdi lea addresses_D_ht+0xe716, %r12 nop nop nop nop nop dec %r10 movups (%r12), %xmm2 vpextrq $0, %xmm2, %rdi nop nop add %rcx, %rcx lea addresses_A_ht+0xee96, %rsi cmp $27946, %r12 mov $0x6162636465666768, %rdi movq %rdi, %xmm7 and $0xffffffffffffffc0, %rsi movntdq %xmm7, (%rsi) nop nop nop xor $18, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r9 push %rbp push %rbx push %rdx push %rsi // Store mov $0x752ac0000000228, %r9 sub %r11, %r11 mov $0x5152535455565758, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%r9) nop nop nop nop and $54559, %rbx // Faulty Load lea addresses_US+0xb716, %rsi nop nop nop add %rbp, %rbp mov (%rsi), %r9w lea oracles, %rbx and $0xff, %r9 shlq $12, %r9 mov (%rbx,%r9,1), %r9 pop %rsi pop %rdx pop %rbx pop %rbp pop %r9 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 1}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': True, 'type': 'addresses_WC_ht', 'same': True, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': True, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
programs/oeis/256/A256321.asm
neoneye/loda
22
100995
; A256321: Number of partitions of 5n into exactly 3 parts. ; 0,2,8,19,33,52,75,102,133,169,208,252,300,352,408,469,533,602,675,752,833,919,1008,1102,1200,1302,1408,1519,1633,1752,1875,2002,2133,2269,2408,2552,2700,2852,3008,3169,3333,3502,3675,3852,4033,4219,4408,4602,4800,5002,5208,5419,5633,5852,6075,6302,6533,6769,7008,7252,7500,7752,8008,8269,8533,8802,9075,9352,9633,9919,10208,10502,10800,11102,11408,11719,12033,12352,12675,13002,13333,13669,14008,14352,14700,15052,15408,15769,16133,16502,16875,17252,17633,18019,18408,18802,19200,19602,20008,20419 mul $0,5 seq $0,69905 ; Number of partitions of n into 3 positive parts.
programs/oeis/206/A206605.asm
neoneye/loda
22
98047
; A206605: Fibonacci sequence beginning 14, 11. ; 14,11,25,36,61,97,158,255,413,668,1081,1749,2830,4579,7409,11988,19397,31385,50782,82167,132949,215116,348065,563181,911246,1474427,2385673,3860100,6245773,10105873,16351646,26457519,42809165,69266684,112075849,181342533,293418382,474760915,768179297,1242940212,2011119509,3254059721,5265179230,8519238951,13784418181,22303657132,36088075313,58391732445,94479807758,152871540203,247351347961,400222888164,647574236125,1047797124289,1695371360414,2743168484703,4438539845117,7181708329820,11620248174937,18801956504757,30422204679694,49224161184451,79646365864145,128870527048596,208516892912741,337387419961337,545904312874078,883291732835415,1429196045709493,2312487778544908,3741683824254401,6054171602799309,9795855427053710,15850027029853019,25645882456906729,41495909486759748,67141791943666477,108637701430426225,175779493374092702,284417194804518927,460196688178611629,744613882983130556,1204810571161742185,1949424454144872741,3154235025306614926,5103659479451487667,8257894504758102593,13361553984209590260,21619448488967692853,34981002473177283113,56600450962144975966,91581453435322259079,148181904397467235045,239763357832789494124,387945262230256729169,627708620063046223293,1015653882293302952462,1643362502356349175755,2659016384649652128217,4302378887006001303972 mov $1,14 mov $2,11 lpb $0 sub $0,1 mov $3,$2 add $2,$1 sub $1,3 trn $1,$3 add $1,$3 lpe mov $0,$1
utils/disk-tools/readsecs/read.asm
vbmacher/qsOS
1
94370
.model large .stack 100h .data nBuffer db 65024 dup (0) ;fat table .code xor ax, ax xor dl, dl ;reset int 13h mov ax, @data mov es, ax mov ds, ax mov bx, offset nBuffer xor dx, dx xor ch, ch mov cl, 1 mov ah, 02h mov al, 18 ;18 sektorov int 13h mov cx, 18*512 mov si, offset nBuffer cld mov ah, 02h l: lodsb mov dl, al int 21h loop l mov ax, 4c00h int 21h end
bb-runtimes/examples/stm32f4-discovery/leds-po/leds.ads
JCGobbi/Nucleo-STM32G474RE
0
13449
------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2013, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ pragma Warnings (Off); with System.STM32F4; use System.STM32F4; pragma Warnings (On); package Leds is pragma Elaborate_Body; -- Bit definitions for RCC AHB1ENR register RCC_AHB1ENR_GPIOD : constant Word := 16#08#; RCC_AHB1ENR_GPIOA : constant Word := 16#01#; RCC_APB2ENR_SYSCFGEN : constant Word := 16#4000#; GPIOD_Base : constant := AHB1_Peripheral_Base + 16#0C00#; GPIOA_Base : constant := AHB1_Peripheral_Base + 16#0000#; SYSCFG_Base : constant := APB2_Peripheral_Base + 16#3800#; EXTI_Base : constant := APB2_Peripheral_Base + 16#3c00#; GPIOD : GPIO_Registers with Volatile, Address => System'To_Address (GPIOD_Base); pragma Import (Ada, GPIOD); GPIOA : GPIO_Registers with Volatile, Address => System'To_Address (GPIOA_Base); pragma Import (Ada, GPIOA); type EXTI_Registers is record IMR : Bits_32x1; EMR : Bits_32x1; RTSR : Bits_32x1; FTSR : Bits_32x1; SWIER : Bits_32x1; PR : Bits_32x1; end record; EXTI : EXTI_Registers with Volatile, Address => System'To_Address (EXTI_Base); pragma Import (Ada, EXTI); type SYSCFG_Registers is record MEMRM : Word; PMC : Word; EXTICR1 : Bits_8x4; EXTICR2 : Bits_8x4; EXTICR3 : Bits_8x4; EXTICR4 : Bits_8x4; CMPCR : Word; end record; SYSCFG : SYSCFG_Registers with Volatile, Address => System'To_Address (SYSCFG_Base); pragma Import (Ada, SYSCFG); function Get_Direction return Boolean; -- Direction given by the push-button. This is a wrapper around the -- protected object. end Leds;
src/agda/FRP/JS/Time.agda
agda/agda-frp-js
63
12428
<filename>src/agda/FRP/JS/Time.agda open import FRP.JS.Nat using ( ℕ ; _*_ ) open import FRP.JS.Bool using ( Bool ) open import FRP.JS.String using ( String ) open import FRP.JS.RSet using ( ⟦_⟧ ; ⟨_⟩ ) open import FRP.JS.Behaviour using ( Beh ) open import FRP.JS.Delay using ( Delay ) renaming ( _≟_ to _≟d_ ; _≠_ to _≠d_ ; _≤_ to _≤d_ ; _<_ to _<d_ ; _+_ to _+d_ ; _∸_ to _∸d_ ) module FRP.JS.Time where open import FRP.JS.Time.Core public using ( Time ; epoch ) _≟_ : Time → Time → Bool epoch t ≟ epoch u = t ≟d u {-# COMPILED_JS _≟_ function(d) { return function(e) { return d === e; }; } #-} _≠_ : Time → Time → Bool epoch t ≠ epoch u = t ≠d u {-# COMPILED_JS _≠_ function(d) { return function(e) { return d !== e; }; } #-} _≤_ : Time → Time → Bool epoch t ≤ epoch u = t ≤d u {-# COMPILED_JS _≤_ function(d) { return function(e) { return d <= e; }; } #-} _<_ : Time → Time → Bool epoch t < epoch u = t <d u {-# COMPILED_JS _<_ function(d) { return function(e) { return d < e; }; } #-} _+_ : Time → Delay → Time epoch t + d = epoch (t +d d) {-# COMPILED_JS _+_ function(d) { return function(e) { return d + e; }; } #-} _∸_ : Time → Time → Delay epoch t ∸ epoch u = t ∸d u {-# COMPILED_JS _∸_ function(d) { return function(e) { return Math.min(0, d - e); }; } #-} postulate toUTCString : Time → String every : Delay → ⟦ Beh ⟨ Time ⟩ ⟧ {-# COMPILED_JS toUTCString function(t) { return require("agda.frp").date(t).toUTCString(); } #-} {-# COMPILED_JS every function(d) { return function(t) { return require("agda.frp").every(d); }; } #-}
programs/oeis/131/A131472.asm
karttu/loda
1
91561
; A131472: a(n) = n^6 + n. ; 0,2,66,732,4100,15630,46662,117656,262152,531450,1000010,1771572,2985996,4826822,7529550,11390640,16777232,24137586,34012242,47045900,64000020,85766142,113379926,148035912,191103000,244140650,308915802,387420516,481890332,594823350,729000030,887503712,1073741856,1291468002,1544804450,1838265660,2176782372,2565726446,3010936422,3518743800,4096000040,4750104282,5489031786,6321363092,7256313900,8303765670,9474296942,10779215376,12230590512,13841287250,15625000050,17596287852,19770609716,22164361182,24794911350,27680640680,30840979512,34296447306,38068692602,42180533700,46656000060,51520374422,56800235646,62523502272,68719476800,75418890690,82653950082,90458382236,98867482692,107918163150,117649000070,128100283992,139314069576,151334226362,164206490250,177978515700,192699928652,208422380166,225199600782,243087455600,262144000080,282429536562,304006671506,326940373452,351298031700,377149515710,404567235222,433626201096,464404086872,496981291050,531441000090,567869252132,606355001436,646990183542,689869781150,735091890720,782757789792,832972005026,885842380962,941480149500,1000000000100,1061520150702,1126162419366,1194052296632,1265319018600,1340095640730,1418519112362,1500730351956,1586874323052,1677100110950,1771561000110,1870414552272,1973822685296,2081951752722,2194972624050,2313060765740,2436396322932,2565164201886,2699554153142,2839760855400,2985984000120,3138428376842,3297303959226,3462825991812,3635215077500,3814697265750,4001504141502,4195872914816,4398046511232,4608273662850,4826809000130,5053913144412,5289852801156,5534900853902,5789336458950,6053445140760,6327518888072,6611856250746,6906762437322,7212549413300,7529536000140,7858047974982,8198418171086,8550986578992,8916100448400,9294114390770,9685390482642,10090298369676,10509215371412,10942526586750,11390625000150,11853911588552,12332795429016,12827693807082,13339032325850,13867245015780,14412774445212,14976071831606,15557597153502,16157819263200,16777216000160,17416274305122,18075490334946,18755369578172,19456426971300,20179187015790,20924183895782,21691961596536,22483074023592,23298085122650,24137569000170,25002110044692,25892303048876,26808753332262,27752076864750,28722900390800,29721861554352,30749609024466,31806802621682,32894113445100,34012224000180,35161828327262,36343632130806,37558352909352,38806720086200,40089475140810,41407371740922,42761175875396,44151665987772,45579633110550,47045881000190,48551226272832,50096498540736,51682540549442,53310208315650,54980371265820,56693912375492,58451728309326,60254729561862,62103840599000,64000000000200,65944160601402,67937289638666,69980368892532,72074394833100,74220378765830,76419346978062,78672340886256,80980417183952,83344647990450,85766121000210,88245939632972,90785223184596,93385106978622,96046742518550,98771297640840,101559956668632,104413920566186,107334407094042,110322650964900,113379904000220,116507435287542,119706531338526,122978496247712,126324651852000,129746337890850,133244912167202,136821750709116,140478247932132,144215816802350,148035889000230,151939915085112,155929364660456,160005726539802,164170508913450,168425239515860,172771465793772,177210755075046,181744694738222,186374892382800,191102976000240,195930594145682,200859416110386,205891132094892,211027453382900,216270112515870,221620863468342,227081481823976,232653764952312,238339532186250 mov $1,$0 pow $0,6 add $1,$0
Sources/Globe_3d/globe_3d-software_anti_aliasing.ads
ForYouEyesOnly/Space-Convoy
1
14271
-- GLOBE_3D.Software_Anti_Aliasing provides a software method for -- smoothing pictures by displaying several times a scene with -- subpixel translations. generic with procedure Display; package GLOBE_3D.Software_Anti_Aliasing is -- Returns the number of phases needed for anti - aliasing: -- 1 for clearing accum buffer + #jitterings + 1 for display function Anti_Alias_phases return Positive; -- Display only one layer of anti - aliasing: procedure Display_with_Anti_Aliasing (phase : Positive); type Quality is (Q1, Q3, Q4, Q11, Q16, Q29, Q90); -- Q1 means no aliasing at all procedure Set_Quality (q : Quality); end GLOBE_3D.Software_Anti_Aliasing;
src/intel/tools/tests/gen9/halt.asm
PWN-Hunter/mesa3d
0
95081
(-f0.1.any4h) halt(8) JIP: 176 UIP: 192 { align1 1Q }; halt(8) JIP: 16 UIP: 16 { align1 1Q }; (-f0.1.any4h) halt(16) JIP: 176 UIP: 192 { align1 1H }; halt(16) JIP: 16 UIP: 16 { align1 1H };
alloy4fun_models/trainstlt/models/3/bKBcEg2kRTmoLEWyT.als
Kaixi26/org.alloytools.alloy
0
3010
<filename>alloy4fun_models/trainstlt/models/3/bKBcEg2kRTmoLEWyT.als open main pred idbKBcEg2kRTmoLEWyT_prop4 { always ~prox.prox in iden } pred __repair { idbKBcEg2kRTmoLEWyT_prop4 } check __repair { idbKBcEg2kRTmoLEWyT_prop4 <=> prop4o }
source/league/matreshka-internals-text_codecs.adb
svn2github/matreshka
24
21586
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Strings.Internals; with Matreshka.Internals.Strings.Configuration; with Matreshka.Internals.Text_Codecs.ASCII; with Matreshka.Internals.Text_Codecs.IANA_Registry; with Matreshka.Internals.Text_Codecs.IBM437; with Matreshka.Internals.Text_Codecs.ISO88591; with Matreshka.Internals.Text_Codecs.ISO88595; with Matreshka.Internals.Text_Codecs.KOI8R; with Matreshka.Internals.Text_Codecs.KOI8U; with Matreshka.Internals.Text_Codecs.SHIFTJIS; with Matreshka.Internals.Text_Codecs.UTF16; with Matreshka.Internals.Text_Codecs.UTF8; with Matreshka.Internals.Text_Codecs.Windows1250; with Matreshka.Internals.Text_Codecs.Windows1251; with Matreshka.Internals.Text_Codecs.Windows1252; with Matreshka.Internals.Unicode.Characters.General_Punctuation; with Matreshka.Internals.Unicode.Characters.Latin; with Matreshka.Internals.Utf16; package body Matreshka.Internals.Text_Codecs is use Matreshka.Internals.Strings.Configuration; use Matreshka.Internals.Text_Codecs.IANA_Registry; use Matreshka.Internals.Unicode.Characters.General_Punctuation; use Matreshka.Internals.Unicode.Characters.Latin; use type Matreshka.Internals.Unicode.Code_Unit_32; MIB_ASCII : constant Character_Set := 3; MIB_ISO88591 : constant Character_Set := 4; MIB_ISO88595 : constant Character_Set := 8; MIB_SHIFTJIS : constant Character_Set := 17; MIB_IBM437 : constant Character_Set := 2011; MIB_KOI8R : constant Character_Set := 2084; MIB_KOI8U : constant Character_Set := 2088; MIB_WINDOWS1250 : constant Character_Set := 2250; MIB_WINDOWS1251 : constant Character_Set := 2251; MIB_WINDOWS1252 : constant Character_Set := 2252; Decoders : constant array (Character_Set) of Decoder_Factory := (MIB_ASCII => ASCII.Decoder'Access, MIB_ISO88591 => ISO88591.Decoder'Access, MIB_ISO88595 => ISO88595.Decoder'Access, MIB_SHIFTJIS => SHIFTJIS.Decoder'Access, MIB_UTF8 => UTF8.Decoder'Access, MIB_UTF16BE => UTF16.BE_Decoder'Access, MIB_UTF16LE => UTF16.LE_Decoder'Access, MIB_IBM437 => IBM437.Decoder'Access, MIB_KOI8R => KOI8R.Decoder'Access, MIB_KOI8U => KOI8U.Decoder'Access, MIB_WINDOWS1250 => Windows1250.Decoder'Access, MIB_WINDOWS1251 => Windows1251.Decoder'Access, MIB_WINDOWS1252 => Windows1252.Decoder'Access, others => null); Encoders : constant array (Character_Set) of Encoder_Factory := (MIB_ASCII => ASCII.Encoder'Access, MIB_ISO88591 => ISO88591.Encoder'Access, MIB_ISO88595 => ISO88595.Encoder'Access, MIB_UTF8 => UTF8.Encoder'Access, MIB_IBM437 => IBM437.Encoder'Access, MIB_KOI8R => KOI8R.Encoder'Access, MIB_KOI8U => KOI8U.Encoder'Access, MIB_WINDOWS1250 => Windows1250.Encoder'Access, MIB_WINDOWS1251 => Windows1251.Encoder'Access, MIB_WINDOWS1252 => Windows1252.Encoder'Access, others => null); ------------ -- Decode -- ------------ procedure Decode (Self : in out Abstract_Decoder'Class; Data : Ada.Streams.Stream_Element_Array; String : out Matreshka.Internals.Strings.Shared_String_Access) is use type Matreshka.Internals.Utf16.Utf16_String_Index; begin if Data'Length = 0 then -- Returns shared empty string object when source data is empty. String := Matreshka.Internals.Strings.Shared_Empty'Access; else String := Matreshka.Internals.Strings.Allocate (Data'Length); Self.Decode_Append (Data, String); if String.Unused = 0 then Matreshka.Internals.Strings.Dereference (String); String := Matreshka.Internals.Strings.Shared_Empty'Access; end if; end if; end Decode; ------------- -- Decoder -- ------------- function Decoder (Set : Character_Set) return Decoder_Factory is begin return Decoders (Set); end Decoder; ------------- -- Encoder -- ------------- function Encoder (Set : Character_Set) return Encoder_Factory is begin return Encoders (Set); end Encoder; ---------------------- -- To_Character_Set -- ---------------------- function To_Character_Set (Item : League.Strings.Universal_String) return Character_Set is Name : constant League.Strings.Universal_String := Transform_Character_Set_Name (Item); begin if Name.Is_Empty then raise Constraint_Error with "Invalid name of character set"; end if; -- Lookup MIB. for J in To_MIB'Range loop if String_Handler.Is_Equal (League.Strings.Internals.Internal (Name), To_MIB (J).Name) then return To_MIB (J).MIB; end if; end loop; return 0; end To_Character_Set; ---------------------------------- -- Transform_Character_Set_Name -- ---------------------------------- function Transform_Character_Set_Name (Name : League.Strings.Universal_String) return League.Strings.Universal_String is -- Set of characters in the character set name is restricted by RFC2978 -- IANA Charset Registration Procedures, section 2.3. Naming -- Requirements -- -- "mime-charset = 1*mime-charset-chars -- mime-charset-chars = ALPHA / DIGIT / -- "!" / "#" / "$" / "%" / "&" / -- "'" / "+" / "-" / "^" / "_" / -- "`" / "{" / "}" / "~" -- ALPHA = "A".."Z" ; Case insensitive ASCII Letter -- DIGIT = "0".."9" ; Numeric digit" -- To determine matching of character set names transformation algoriphm -- from Unicode Technical Standard #22 Unicode Character Mapping Markup -- Language (CharMapML), section 1.4 Charset Alias Matching is used: -- -- "Names and aliases of charsets are often spelled with small -- variations. To recognize accidental but unambiguous misspellings and -- avoid adding each possible variation to a list of recognized names, -- it is customary to match names case-insensitively and to ignore some -- punctuation. For best results, names should be compared after -- applying the following transformations: -- -- 1. Delete all characters except a-z, A-Z, and 0-9. -- -- 2. Map uppercase A-Z to the corresponding lowercase a-z. -- -- 3. From left to right, delete each 0 that is not preceded by a -- digit." Source : constant League.Strings.Universal_String := Name.To_Lowercase; Aux : League.Strings.Universal_String; C : Wide_Wide_Character; Digit : Boolean := False; begin for J in 1 .. Source.Length loop C := Source.Element (J).To_Wide_Wide_Character; case C is when 'a' .. 'z' => Aux.Append (C); Digit := False; when '0' .. '9' => if C /= '0' or Digit then Aux.Append (C); Digit := True; end if; when '!' | '#' | '$' | '%' | '&' | ''' | '+' | '-' | '^' | '_' | '`' | '{' | '}' | '~' => if J = 1 or J = Source.Length then return League.Strings.Empty_Universal_String; end if; when others => return League.Strings.Empty_Universal_String; end case; end loop; return Aux; end Transform_Character_Set_Name; -------------------------- -- Unchecked_Append_Raw -- -------------------------- procedure Unchecked_Append_Raw (Self : in out Abstract_Decoder'Class; Buffer : not null Matreshka.Internals.Strings.Shared_String_Access; Code : Matreshka.Internals.Unicode.Code_Point) is pragma Unreferenced (Self); begin Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Code); Buffer.Length := Buffer.Length + 1; end Unchecked_Append_Raw; ---------------------------- -- Unchecked_Append_XML10 -- ---------------------------- procedure Unchecked_Append_XML10 (Self : in out Abstract_Decoder'Class; Buffer : not null Matreshka.Internals.Strings.Shared_String_Access; Code : Matreshka.Internals.Unicode.Code_Point) is pragma Suppress (Access_Check); begin if Code = Carriage_Return then Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Line_Feed); Buffer.Length := Buffer.Length + 1; Self.Skip_LF := True; elsif Code = Line_Feed then if not Self.Skip_LF then Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Line_Feed); Buffer.Length := Buffer.Length + 1; end if; Self.Skip_LF := False; else Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Code); Buffer.Length := Buffer.Length + 1; Self.Skip_LF := False; end if; end Unchecked_Append_XML10; ---------------------------- -- Unchecked_Append_XML11 -- ---------------------------- procedure Unchecked_Append_XML11 (Self : in out Abstract_Decoder'Class; Buffer : not null Matreshka.Internals.Strings.Shared_String_Access; Code : Matreshka.Internals.Unicode.Code_Point) is begin if Code = Carriage_Return then Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Line_Feed); Buffer.Length := Buffer.Length + 1; Self.Skip_LF := True; elsif Code = Line_Feed or Code = Next_Line then if not Self.Skip_LF then Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Line_Feed); Buffer.Length := Buffer.Length + 1; end if; Self.Skip_LF := False; elsif Code = Line_Separator then Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Line_Feed); Buffer.Length := Buffer.Length + 1; Self.Skip_LF := False; else Matreshka.Internals.Utf16.Unchecked_Store (Buffer.Value, Buffer.Unused, Code); Buffer.Length := Buffer.Length + 1; Self.Skip_LF := False; end if; end Unchecked_Append_XML11; end Matreshka.Internals.Text_Codecs;
programs/oeis/131/A131724.asm
karttu/loda
0
174354
; A131724: Period 6: repeat [1, 9, 7, 13, 11, 9]. ; 1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13,11,9,1,9,7,13 mod $0,6 mul $0,3 add $0,1 lpb $0,1 mov $1,$0 sub $0,4 lpe mov $0,$1 add $0,3 mov $1,$0 sub $1,3 mul $1,2 add $1,1
nasm assembly/library/concat_str.asm
AI-Factor-y/NASM-library
0
175373
concatinate_strings: ; the two strings should be in ebx and ecx ; the resut of concatenation is stored in result_concat_string section .bss result_concat_string : resb 100 counter_i : resd 1 counter_res: resd 1 section .text push rax push rbx push rcx mov word[counter_i],0 mov word[counter_res],0 push rcx concat_str_1: mov eax,[counter_i] mov cl, byte[ebx+eax] cmp cl,0 je exit_concat_str_1 push rbx mov ebx, result_concat_string mov eax, [counter_res] mov byte[ebx+eax],cl pop rbx inc dword[counter_i] inc dword[counter_res] jmp concat_str_1 exit_concat_str_1: pop rcx mov word[counter_i],0 concat_str_2: mov eax,[counter_i] mov dl, byte[ecx+eax] cmp dl,0 je exit_concat_str_2 push rbx mov ebx, result_concat_string mov eax, [counter_res] mov byte[ebx+eax],dl pop rbx inc dword[counter_i] inc dword[counter_res] jmp concat_str_2 exit_concat_str_2: mov ebx, result_concat_string mov eax, [counter_res] mov byte[ebx+eax],0 pop rcx pop rbx pop rax ret
src/qt/qtwebkit/Source/JavaScriptCore/jit/JITStubsMSVC64.asm
viewdy/phantomjs
1
25759
;/* ; Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies) ; ; 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. ; ; THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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. ;*/ EXTERN cti_vm_throw : near PUBLIC ctiTrampoline PUBLIC ctiVMThrowTrampoline PUBLIC ctiOpThrowNotCaught _TEXT SEGMENT ctiTrampoline PROC ; Dump register parameters to their home address mov qword ptr[rsp+20h], r9 mov qword ptr[rsp+18h], r8 mov qword ptr[rsp+10h], rdx mov qword ptr[rsp+8h], rcx push rbp mov rbp, rsp push r12 push r13 push r14 push r15 push rbx ; Decrease rsp to point to the start of our JITStackFrame sub rsp, 58h mov r12, 512 mov r14, 0FFFF000000000000h mov r15, 0FFFF000000000002h mov r13, r8 call rcx add rsp, 58h pop rbx pop r15 pop r14 pop r13 pop r12 pop rbp ret ctiTrampoline ENDP ctiVMThrowTrampoline PROC mov rcx, rsp call cti_vm_throw int 3 ctiVMThrowTrampoline ENDP ctiOpThrowNotCaught PROC add rsp, 58h pop rbx pop r15 pop r14 pop r13 pop r12 pop rbp ret ctiOpThrowNotCaught ENDP _TEXT ENDS END
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_688.asm
ljhsiun2/medusa
9
21599
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_688.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0xc84, %rdi sub %rbx, %rbx vmovups (%rdi), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r12 nop nop nop nop nop and %r12, %r12 lea addresses_D_ht+0x5034, %rsi lea addresses_normal_ht+0x19b44, %rdi inc %r13 mov $22, %rcx rep movsb nop nop nop nop add $56306, %rbx lea addresses_normal_ht+0xcb24, %r13 nop nop nop nop nop cmp %rbp, %rbp movb $0x61, (%r13) nop nop nop nop cmp $11604, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi // Store lea addresses_D+0xf084, %r12 nop nop add $16799, %rax movl $0x51525354, (%r12) nop nop cmp $47331, %rax // Store lea addresses_A+0xb884, %rcx cmp %r10, %r10 mov $0x5152535455565758, %rdi movq %rdi, %xmm7 vmovups %ymm7, (%rcx) nop nop sub %r12, %r12 // Store lea addresses_UC+0x15084, %rdx nop nop nop xor %r9, %r9 movl $0x51525354, (%rdx) nop xor $20699, %r12 // REPMOV lea addresses_RW+0x5464, %rsi lea addresses_D+0xb084, %rdi nop dec %rdx mov $126, %rcx rep movsq sub %r12, %r12 // Store mov $0xdfb, %r12 xor %r9, %r9 mov $0x5152535455565758, %rdx movq %rdx, %xmm6 vmovups %ymm6, (%r12) nop nop nop sub %rax, %rax // Store mov $0x13c9660000000884, %r10 nop dec %rsi movb $0x51, (%r10) nop nop nop and $59486, %rdx // Faulty Load lea addresses_D+0xf084, %rsi nop nop nop nop nop and %r12, %r12 movb (%rsi), %dl lea oracles, %rsi and $0xff, %rdx shlq $12, %rdx mov (%rsi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_RW', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'54': 21829} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1188.asm
ljhsiun2/medusa
9
246482
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_WC_ht+0x17912, %r12 nop nop nop nop nop cmp $21257, %rdi mov (%r12), %r9w xor $5049, %r9 lea addresses_WC_ht+0x8ef8, %rsi lea addresses_UC_ht+0x14bd2, %rdi clflush (%rdi) nop nop nop and $14830, %r9 mov $103, %rcx rep movsl nop nop nop nop sub %rsi, %rsi lea addresses_WT_ht+0xc112, %rsi lea addresses_WC_ht+0x2ad2, %rdi nop nop and %r11, %r11 mov $23, %rcx rep movsw nop nop nop nop cmp %r11, %r11 lea addresses_A_ht+0x1c8ca, %rdi nop nop lfence and $0xffffffffffffffc0, %rdi movntdqa (%rdi), %xmm0 vpextrq $1, %xmm0, %r12 xor $24332, %r12 lea addresses_WT_ht+0x2256, %r11 nop sub $35453, %rsi movb (%r11), %cl sub $59831, %r12 lea addresses_WC_ht+0xcd12, %rsi lea addresses_UC_ht+0x14c92, %rdi nop nop xor $24459, %r9 mov $14, %rcx rep movsl sub $21600, %rsi lea addresses_UC_ht+0xba82, %rcx clflush (%rcx) nop inc %r9 movb $0x61, (%rcx) nop nop nop nop and $15105, %r8 lea addresses_UC_ht+0xa532, %rsi nop nop nop xor %r11, %r11 mov $0x6162636465666768, %r9 movq %r9, %xmm6 movups %xmm6, (%rsi) nop nop cmp $1652, %rsi pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r14 push %r15 push %r8 push %rbx // Store lea addresses_WC+0x1b7b2, %r10 nop nop nop xor %r13, %r13 mov $0x5152535455565758, %r12 movq %r12, (%r10) nop nop nop nop add %r12, %r12 // Store lea addresses_normal+0xe112, %r15 nop nop sub $25580, %r8 movb $0x51, (%r15) nop nop nop xor $33074, %r15 // Faulty Load lea addresses_WT+0x10912, %r12 nop nop nop nop and $13650, %r15 mov (%r12), %rbx lea oracles, %r12 and $0xff, %rbx shlq $12, %rbx mov (%r12,%rbx,1), %rbx pop %rbx pop %r8 pop %r15 pop %r14 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_WT', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
alloy4fun_models/trainstlt/models/3/jPBbcYgrLxTaTgiJa.als
Kaixi26/org.alloytools.alloy
0
4620
<reponame>Kaixi26/org.alloytools.alloy open main pred idjPBbcYgrLxTaTgiJa_prop4 { all t: Train | always prox.~prox in iden } pred __repair { idjPBbcYgrLxTaTgiJa_prop4 } check __repair { idjPBbcYgrLxTaTgiJa_prop4 <=> prop4o }
base/ntos/ke/amd64/systable.asm
yang235/wrk-v1.2
209
176492
;++ ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). ; If you do not agree to the terms, do not use the code. ; ; Module Name: ; ; systable.asm ; ; Abstract: ; ; This module implements the system service dispatch table. ; ;-- include ksamd64.inc TABLE_ERROR macro t .err ; Maximum number of in-memory system service arguments exceeded. endm TABLE_BEGIN1 macro t title t endm TABLE_BEGIN2 macro t _TEXT$00 segment page 'code' endm TABLE_BEGIN3 macro t endm TABLE_BEGIN4 macro t public KiServiceTable KiServiceTable label qword endm TABLE_BEGIN5 macro t endm TABLE_BEGIN6 macro t endm TABLE_BEGIN7 macro t endm TABLE_BEGIN8 macro t endm TABLE_ENTRY macro l,bias,numargs .erre numargs le 14 extrn Nt&l:proc dq offset Nt&l+numargs endm TABLE_END macro n public KiServiceLimit KiServiceLimit label dword dd n + 1 endm ARGTBL_BEGIN macro endm ARGTBL_ENTRY macro e0, e1, e2, e3, e4, e5, e6, e7 endm ARGTBL_END macro _TEXT$00 ends end endm TABLE_BEGIN1 <"System Service Dispatch Table"> TABLE_BEGIN2 <"System Service Dispatch Table"> TABLE_BEGIN3 <"System Service Dispatch Table"> TABLE_BEGIN4 <"System Service Dispatch Table"> TABLE_BEGIN5 <"System Service Dispatch Table"> TABLE_BEGIN6 <"System Service Dispatch Table"> TABLE_BEGIN7 <"System Service Dispatch Table"> TABLE_BEGIN8 <"System Service Dispatch Table"> TABLE_ENTRY MapUserPhysicalPagesScatter, 0, 0 TABLE_ENTRY WaitForSingleObject, 0, 0 TABLE_ENTRY CallbackReturn, 0, 0 TABLE_ENTRY ReadFile, 1, 5 TABLE_ENTRY DeviceIoControlFile, 1, 6 TABLE_ENTRY WriteFile, 1, 5 TABLE_ENTRY RemoveIoCompletion, 1, 1 TABLE_ENTRY ReleaseSemaphore, 0, 0 TABLE_ENTRY ReplyWaitReceivePort, 0, 0 TABLE_ENTRY ReplyPort, 0, 0 TABLE_ENTRY SetInformationThread, 0, 0 TABLE_ENTRY SetEvent, 0, 0 TABLE_ENTRY Close, 0, 0 TABLE_ENTRY QueryObject, 1, 1 TABLE_ENTRY QueryInformationFile, 1, 1 TABLE_ENTRY OpenKey, 0, 0 TABLE_ENTRY EnumerateValueKey, 1, 2 TABLE_ENTRY FindAtom, 0, 0 TABLE_ENTRY QueryDefaultLocale, 0, 0 TABLE_ENTRY QueryKey, 1, 1 TABLE_ENTRY QueryValueKey, 1, 2 TABLE_ENTRY AllocateVirtualMemory, 1, 2 TABLE_ENTRY QueryInformationProcess, 1, 1 TABLE_ENTRY WaitForMultipleObjects32, 1, 1 TABLE_ENTRY WriteFileGather, 1, 5 TABLE_ENTRY SetInformationProcess, 0, 0 TABLE_ENTRY CreateKey, 1, 3 TABLE_ENTRY FreeVirtualMemory, 0, 0 TABLE_ENTRY ImpersonateClientOfPort, 0, 0 TABLE_ENTRY ReleaseMutant, 0, 0 TABLE_ENTRY QueryInformationToken, 1, 1 TABLE_ENTRY RequestWaitReplyPort, 0, 0 TABLE_ENTRY QueryVirtualMemory, 1, 2 TABLE_ENTRY OpenThreadToken, 0, 0 TABLE_ENTRY QueryInformationThread, 1, 1 TABLE_ENTRY OpenProcess, 0, 0 TABLE_ENTRY SetInformationFile, 1, 1 TABLE_ENTRY MapViewOfSection, 1, 6 TABLE_ENTRY AccessCheckAndAuditAlarm, 1, 7 TABLE_ENTRY UnmapViewOfSection, 0, 0 TABLE_ENTRY ReplyWaitReceivePortEx, 1, 1 TABLE_ENTRY TerminateProcess, 0, 0 TABLE_ENTRY SetEventBoostPriority, 0, 0 TABLE_ENTRY ReadFileScatter, 1, 5 TABLE_ENTRY OpenThreadTokenEx, 1, 1 TABLE_ENTRY OpenProcessTokenEx, 0, 0 TABLE_ENTRY QueryPerformanceCounter, 0, 0 TABLE_ENTRY EnumerateKey, 1, 2 TABLE_ENTRY OpenFile, 1, 2 TABLE_ENTRY DelayExecution, 0, 0 TABLE_ENTRY QueryDirectoryFile, 1, 7 TABLE_ENTRY QuerySystemInformation, 0, 0 TABLE_ENTRY OpenSection, 0, 0 TABLE_ENTRY QueryTimer, 1, 1 TABLE_ENTRY FsControlFile, 1, 6 TABLE_ENTRY WriteVirtualMemory, 1, 1 TABLE_ENTRY CloseObjectAuditAlarm, 0, 0 TABLE_ENTRY DuplicateObject, 1, 3 TABLE_ENTRY QueryAttributesFile, 0, 0 TABLE_ENTRY ClearEvent, 0, 0 TABLE_ENTRY ReadVirtualMemory, 1, 1 TABLE_ENTRY OpenEvent, 0, 0 TABLE_ENTRY AdjustPrivilegesToken, 1, 2 TABLE_ENTRY DuplicateToken, 1, 2 TABLE_ENTRY Continue, 0, 0 TABLE_ENTRY QueryDefaultUILanguage, 0, 0 TABLE_ENTRY QueueApcThread, 1, 1 TABLE_ENTRY YieldExecution, 0, 0 TABLE_ENTRY AddAtom, 0, 0 TABLE_ENTRY CreateEvent, 1, 1 TABLE_ENTRY QueryVolumeInformationFile, 1, 1 TABLE_ENTRY CreateSection, 1, 3 TABLE_ENTRY FlushBuffersFile, 0, 0 TABLE_ENTRY ApphelpCacheControl, 0, 0 TABLE_ENTRY CreateProcessEx, 1, 5 TABLE_ENTRY CreateThread, 1, 4 TABLE_ENTRY IsProcessInJob, 0, 0 TABLE_ENTRY ProtectVirtualMemory, 1, 1 TABLE_ENTRY QuerySection, 1, 1 TABLE_ENTRY ResumeThread, 0, 0 TABLE_ENTRY TerminateThread, 0, 0 TABLE_ENTRY ReadRequestData, 1, 2 TABLE_ENTRY CreateFile, 1, 7 TABLE_ENTRY QueryEvent, 1, 1 TABLE_ENTRY WriteRequestData, 1, 2 TABLE_ENTRY OpenDirectoryObject, 0, 0 TABLE_ENTRY AccessCheckByTypeAndAuditAlarm, 1, 12 TABLE_ENTRY QuerySystemTime, 0, 0 TABLE_ENTRY WaitForMultipleObjects, 1, 1 TABLE_ENTRY SetInformationObject, 0, 0 TABLE_ENTRY CancelIoFile, 0, 0 TABLE_ENTRY TraceEvent, 0, 0 TABLE_ENTRY PowerInformation, 1, 1 TABLE_ENTRY SetValueKey, 1, 2 TABLE_ENTRY CancelTimer, 0, 0 TABLE_ENTRY SetTimer, 1, 3 TABLE_ENTRY AcceptConnectPort, 1, 2 TABLE_ENTRY AccessCheck, 1, 4 TABLE_ENTRY AccessCheckByType, 1, 7 TABLE_ENTRY AccessCheckByTypeResultList, 1, 7 TABLE_ENTRY AccessCheckByTypeResultListAndAuditAlarm, 1, 12 TABLE_ENTRY AccessCheckByTypeResultListAndAuditAlarmByHandle, 1, 13 TABLE_ENTRY AddBootEntry, 0, 0 TABLE_ENTRY AddDriverEntry, 0, 0 TABLE_ENTRY AdjustGroupsToken, 1, 2 TABLE_ENTRY AlertResumeThread, 0, 0 TABLE_ENTRY AlertThread, 0, 0 TABLE_ENTRY AllocateLocallyUniqueId, 0, 0 TABLE_ENTRY AllocateUserPhysicalPages, 0, 0 TABLE_ENTRY AllocateUuids, 0, 0 TABLE_ENTRY AreMappedFilesTheSame, 0, 0 TABLE_ENTRY AssignProcessToJobObject, 0, 0 TABLE_ENTRY CancelDeviceWakeupRequest, 0, 0 TABLE_ENTRY CompactKeys, 0, 0 TABLE_ENTRY CompareTokens, 0, 0 TABLE_ENTRY CompleteConnectPort, 0, 0 TABLE_ENTRY CompressKey, 0, 0 TABLE_ENTRY ConnectPort, 1, 4 TABLE_ENTRY CreateDebugObject, 0, 0 TABLE_ENTRY CreateDirectoryObject, 0, 0 TABLE_ENTRY CreateEventPair, 0, 0 TABLE_ENTRY CreateIoCompletion, 0, 0 TABLE_ENTRY CreateJobObject, 0, 0 TABLE_ENTRY CreateJobSet, 0, 0 TABLE_ENTRY CreateKeyedEvent, 0, 0 TABLE_ENTRY CreateMailslotFile, 1, 4 TABLE_ENTRY CreateMutant, 0, 0 TABLE_ENTRY CreateNamedPipeFile, 1, 10 TABLE_ENTRY CreatePagingFile, 0, 0 TABLE_ENTRY CreatePort, 1, 1 TABLE_ENTRY CreateProcess, 1, 4 TABLE_ENTRY CreateProfile, 1, 5 TABLE_ENTRY CreateSemaphore, 1, 1 TABLE_ENTRY CreateSymbolicLinkObject, 0, 0 TABLE_ENTRY CreateTimer, 0, 0 TABLE_ENTRY CreateToken, 1, 9 TABLE_ENTRY CreateWaitablePort, 1, 1 TABLE_ENTRY DebugActiveProcess, 0, 0 TABLE_ENTRY DebugContinue, 0, 0 TABLE_ENTRY DeleteAtom, 0, 0 TABLE_ENTRY DeleteBootEntry, 0, 0 TABLE_ENTRY DeleteDriverEntry, 0, 0 TABLE_ENTRY DeleteFile, 0, 0 TABLE_ENTRY DeleteKey, 0, 0 TABLE_ENTRY DeleteObjectAuditAlarm, 0, 0 TABLE_ENTRY DeleteValueKey, 0, 0 TABLE_ENTRY DisplayString, 0, 0 TABLE_ENTRY EnumerateBootEntries, 0, 0 TABLE_ENTRY EnumerateDriverEntries, 0, 0 TABLE_ENTRY EnumerateSystemEnvironmentValuesEx, 0, 0 TABLE_ENTRY ExtendSection, 0, 0 TABLE_ENTRY FilterToken, 1, 2 TABLE_ENTRY FlushInstructionCache, 0, 0 TABLE_ENTRY FlushKey, 0, 0 TABLE_ENTRY FlushVirtualMemory, 0, 0 TABLE_ENTRY FlushWriteBuffer, 0, 0 TABLE_ENTRY FreeUserPhysicalPages, 0, 0 TABLE_ENTRY GetContextThread, 0, 0 TABLE_ENTRY GetCurrentProcessorNumber, 0, 0 TABLE_ENTRY GetDevicePowerState, 0, 0 TABLE_ENTRY GetPlugPlayEvent, 0, 0 TABLE_ENTRY GetWriteWatch, 1, 3 TABLE_ENTRY ImpersonateAnonymousToken, 0, 0 TABLE_ENTRY ImpersonateThread, 0, 0 TABLE_ENTRY InitializeRegistry, 0, 0 TABLE_ENTRY InitiatePowerAction, 0, 0 TABLE_ENTRY IsSystemResumeAutomatic, 0, 0 TABLE_ENTRY ListenPort, 0, 0 TABLE_ENTRY LoadDriver, 0, 0 TABLE_ENTRY LoadKey, 0, 0 TABLE_ENTRY LoadKey2, 0, 0 TABLE_ENTRY LoadKeyEx, 0, 0 TABLE_ENTRY LockFile, 1, 6 TABLE_ENTRY LockProductActivationKeys, 0, 0 TABLE_ENTRY LockRegistryKey, 0, 0 TABLE_ENTRY LockVirtualMemory, 0, 0 TABLE_ENTRY MakePermanentObject, 0, 0 TABLE_ENTRY MakeTemporaryObject, 0, 0 TABLE_ENTRY MapUserPhysicalPages, 0, 0 TABLE_ENTRY ModifyBootEntry, 0, 0 TABLE_ENTRY ModifyDriverEntry, 0, 0 TABLE_ENTRY NotifyChangeDirectoryFile, 1, 5 TABLE_ENTRY NotifyChangeKey, 1, 6 TABLE_ENTRY NotifyChangeMultipleKeys, 1, 8 TABLE_ENTRY OpenEventPair, 0, 0 TABLE_ENTRY OpenIoCompletion, 0, 0 TABLE_ENTRY OpenJobObject, 0, 0 TABLE_ENTRY OpenKeyedEvent, 0, 0 TABLE_ENTRY OpenMutant, 0, 0 TABLE_ENTRY OpenObjectAuditAlarm, 1, 8 TABLE_ENTRY OpenProcessToken, 0, 0 TABLE_ENTRY OpenSemaphore, 0, 0 TABLE_ENTRY OpenSymbolicLinkObject, 0, 0 TABLE_ENTRY OpenThread, 0, 0 TABLE_ENTRY OpenTimer, 0, 0 TABLE_ENTRY PlugPlayControl, 0, 0 TABLE_ENTRY PrivilegeCheck, 0, 0 TABLE_ENTRY PrivilegeObjectAuditAlarm, 1, 2 TABLE_ENTRY PrivilegedServiceAuditAlarm, 1, 1 TABLE_ENTRY PulseEvent, 0, 0 TABLE_ENTRY QueryBootEntryOrder, 0, 0 TABLE_ENTRY QueryBootOptions, 0, 0 TABLE_ENTRY QueryDebugFilterState, 0, 0 TABLE_ENTRY QueryDirectoryObject, 1, 3 TABLE_ENTRY QueryDriverEntryOrder, 0, 0 TABLE_ENTRY QueryEaFile, 1, 5 TABLE_ENTRY QueryFullAttributesFile, 0, 0 TABLE_ENTRY QueryInformationAtom, 1, 1 TABLE_ENTRY QueryInformationJobObject, 1, 1 TABLE_ENTRY QueryInformationPort, 1, 1 TABLE_ENTRY QueryInstallUILanguage, 0, 0 TABLE_ENTRY QueryIntervalProfile, 0, 0 TABLE_ENTRY QueryIoCompletion, 1, 1 TABLE_ENTRY QueryMultipleValueKey, 1, 2 TABLE_ENTRY QueryMutant, 1, 1 TABLE_ENTRY QueryOpenSubKeys, 0, 0 TABLE_ENTRY QueryOpenSubKeysEx, 0, 0 TABLE_ENTRY QueryPortInformationProcess, 0, 0 TABLE_ENTRY QueryQuotaInformationFile, 1, 5 TABLE_ENTRY QuerySecurityObject, 1, 1 TABLE_ENTRY QuerySemaphore, 1, 1 TABLE_ENTRY QuerySymbolicLinkObject, 0, 0 TABLE_ENTRY QuerySystemEnvironmentValue, 0, 0 TABLE_ENTRY QuerySystemEnvironmentValueEx, 1, 1 TABLE_ENTRY QueryTimerResolution, 0, 0 TABLE_ENTRY RaiseException, 0, 0 TABLE_ENTRY RaiseHardError, 1, 2 TABLE_ENTRY RegisterThreadTerminatePort, 0, 0 TABLE_ENTRY ReleaseKeyedEvent, 0, 0 TABLE_ENTRY RemoveProcessDebug, 0, 0 TABLE_ENTRY RenameKey, 0, 0 TABLE_ENTRY ReplaceKey, 0, 0 TABLE_ENTRY ReplyWaitReplyPort, 0, 0 TABLE_ENTRY RequestDeviceWakeup, 0, 0 TABLE_ENTRY RequestPort, 0, 0 TABLE_ENTRY RequestWakeupLatency, 0, 0 TABLE_ENTRY ResetEvent, 0, 0 TABLE_ENTRY ResetWriteWatch, 0, 0 TABLE_ENTRY RestoreKey, 0, 0 TABLE_ENTRY ResumeProcess, 0, 0 TABLE_ENTRY SaveKey, 0, 0 TABLE_ENTRY SaveKeyEx, 0, 0 TABLE_ENTRY SaveMergedKeys, 0, 0 TABLE_ENTRY SecureConnectPort, 1, 5 TABLE_ENTRY SetBootEntryOrder, 0, 0 TABLE_ENTRY SetBootOptions, 0, 0 TABLE_ENTRY SetContextThread, 0, 0 TABLE_ENTRY SetDebugFilterState, 0, 0 TABLE_ENTRY SetDefaultHardErrorPort, 0, 0 TABLE_ENTRY SetDefaultLocale, 0, 0 TABLE_ENTRY SetDefaultUILanguage, 0, 0 TABLE_ENTRY SetDriverEntryOrder, 0, 0 TABLE_ENTRY SetEaFile, 0, 0 TABLE_ENTRY SetHighEventPair, 0, 0 TABLE_ENTRY SetHighWaitLowEventPair, 0, 0 TABLE_ENTRY SetInformationDebugObject, 1, 1 TABLE_ENTRY SetInformationJobObject, 0, 0 TABLE_ENTRY SetInformationKey, 0, 0 TABLE_ENTRY SetInformationToken, 0, 0 TABLE_ENTRY SetIntervalProfile, 0, 0 TABLE_ENTRY SetIoCompletion, 1, 1 TABLE_ENTRY SetLdtEntries, 1, 2 TABLE_ENTRY SetLowEventPair, 0, 0 TABLE_ENTRY SetLowWaitHighEventPair, 0, 0 TABLE_ENTRY SetQuotaInformationFile, 0, 0 TABLE_ENTRY SetSecurityObject, 0, 0 TABLE_ENTRY SetSystemEnvironmentValue, 0, 0 TABLE_ENTRY SetSystemEnvironmentValueEx, 1, 1 TABLE_ENTRY SetSystemInformation, 0, 0 TABLE_ENTRY SetSystemPowerState, 0, 0 TABLE_ENTRY SetSystemTime, 0, 0 TABLE_ENTRY SetThreadExecutionState, 0, 0 TABLE_ENTRY SetTimerResolution, 0, 0 TABLE_ENTRY SetUuidSeed, 0, 0 TABLE_ENTRY SetVolumeInformationFile, 1, 1 TABLE_ENTRY ShutdownSystem, 0, 0 TABLE_ENTRY SignalAndWaitForSingleObject, 0, 0 TABLE_ENTRY StartProfile, 0, 0 TABLE_ENTRY StopProfile, 0, 0 TABLE_ENTRY SuspendProcess, 0, 0 TABLE_ENTRY SuspendThread, 0, 0 TABLE_ENTRY SystemDebugControl, 1, 2 TABLE_ENTRY TerminateJobObject, 0, 0 TABLE_ENTRY TestAlert, 0, 0 TABLE_ENTRY TranslateFilePath, 0, 0 TABLE_ENTRY UnloadDriver, 0, 0 TABLE_ENTRY UnloadKey, 0, 0 TABLE_ENTRY UnloadKey2, 0, 0 TABLE_ENTRY UnloadKeyEx, 0, 0 TABLE_ENTRY UnlockFile, 1, 1 TABLE_ENTRY UnlockVirtualMemory, 0, 0 TABLE_ENTRY VdmControl, 0, 0 TABLE_ENTRY WaitForDebugEvent, 0, 0 TABLE_ENTRY WaitForKeyedEvent, 0, 0 TABLE_ENTRY WaitHighEventPair, 0, 0 TABLE_ENTRY WaitLowEventPair, 0, 0 TABLE_END 295 ARGTBL_BEGIN ARGTBL_ENTRY 0,0,0,20,24,20,4,0 ARGTBL_ENTRY 0,0,0,0,0,4,4,0 ARGTBL_ENTRY 8,0,0,4,8,8,4,4 ARGTBL_ENTRY 20,0,12,0,0,0,4,0 ARGTBL_ENTRY 8,0,4,0,4,24,28,0 ARGTBL_ENTRY 4,0,0,20,4,0,0,8 ARGTBL_ENTRY 8,0,28,0,0,4,24,4 ARGTBL_ENTRY 0,12,0,0,4,0,8,8 ARGTBL_ENTRY 0,0,4,0,0,4,4,12 ARGTBL_ENTRY 0,0,20,16,0,4,4,0 ARGTBL_ENTRY 0,8,28,4,8,0,48,0 ARGTBL_ENTRY 4,0,0,0,4,8,0,12 ARGTBL_ENTRY 8,16,28,28,48,52,0,0 ARGTBL_ENTRY 8,0,0,0,0,0,0,0 ARGTBL_ENTRY 0,0,0,0,0,16,0,0 ARGTBL_ENTRY 0,0,0,0,0,16,0,40 ARGTBL_ENTRY 0,4,16,20,4,0,0,36 ARGTBL_ENTRY 4,0,0,0,0,0,0,0 ARGTBL_ENTRY 0,0,0,0,0,0,0,8 ARGTBL_ENTRY 0,0,0,0,0,0,0,0 ARGTBL_ENTRY 0,12,0,0,0,0,0,0 ARGTBL_ENTRY 0,0,0,0,24,0,0,0 ARGTBL_ENTRY 0,0,0,0,0,20,24,32 ARGTBL_ENTRY 0,0,0,0,0,32,0,0 ARGTBL_ENTRY 0,0,0,0,0,8,4,0 ARGTBL_ENTRY 0,0,0,12,0,20,0,4 ARGTBL_ENTRY 4,4,0,0,4,8,4,0 ARGTBL_ENTRY 0,0,20,4,4,0,0,4 ARGTBL_ENTRY 0,0,8,0,0,0,0,0 ARGTBL_ENTRY 0,0,0,0,0,0,0,0 ARGTBL_ENTRY 0,0,0,20,0,0,0,0 ARGTBL_ENTRY 0,0,0,0,0,0,0,4 ARGTBL_ENTRY 0,0,0,0,4,8,0,0 ARGTBL_ENTRY 0,0,0,4,0,0,0,0 ARGTBL_ENTRY 0,0,4,0,0,0,0,0 ARGTBL_ENTRY 0,8,0,0,0,0,0,0 ARGTBL_ENTRY 0,4,0,0,0,0,0,0 ARGTBL_END
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_931.asm
ljhsiun2/medusa
9
165205
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0xace8, %r14 cmp $41044, %rbp mov (%r14), %r11 cmp $2137, %r10 lea addresses_UC_ht+0x17ee8, %rsi lea addresses_normal_ht+0x1c6e0, %rdi nop sub %r8, %r8 mov $31, %rcx rep movsw nop nop nop nop inc %rdi lea addresses_WT_ht+0x9ce8, %r10 xor %r14, %r14 movw $0x6162, (%r10) nop nop nop nop xor %rbp, %rbp lea addresses_WT_ht+0x8b0, %rsi lea addresses_UC_ht+0x8408, %rdi nop nop nop nop cmp $55277, %r14 mov $89, %rcx rep movsb nop nop nop nop nop xor %rcx, %rcx lea addresses_A_ht+0x1c948, %rbp nop nop nop nop dec %r10 movb $0x61, (%rbp) nop nop nop cmp $19358, %rsi lea addresses_UC_ht+0x15130, %rbp nop sub $22826, %r11 movb $0x61, (%rbp) nop nop nop nop mfence pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r8 push %rbp push %rdi push %rdx // Faulty Load lea addresses_PSE+0x148e8, %r13 nop nop dec %rdi movups (%r13), %xmm3 vpextrq $1, %xmm3, %r10 lea oracles, %r13 and $0xff, %r10 shlq $12, %r10 mov (%r13,%r10,1), %r10 pop %rdx pop %rdi pop %rbp pop %r8 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'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 */
programs/oeis/092/A092443.asm
karttu/loda
1
89365
<filename>programs/oeis/092/A092443.asm ; A092443: Sequence arising from enumeration of domino tilings of Aztec Pillow-like regions. ; 3,12,50,210,882,3696,15444,64350,267410,1108536,4585308,18929092,78004500,320932800,1318498920,5409723510,22169259090,90751353000,371125269900,1516311817020,6189965556060,25249187564640,102917884095000,419218847880300,1706543186909652,6942859461273456 mov $2,$0 mul $0,2 add $0,1 bin $0,$2 mov $1,$2 add $1,3 mul $0,$1 mov $1,$0
src/skill-field_restrictions.adb
skill-lang/adaCommon
0
29584
<reponame>skill-lang/adaCommon<gh_stars>0 -- ___ _ ___ _ _ -- -- / __| |/ (_) | | Common SKilL implementation -- -- \__ \ ' <| | | |__ runtime field restriction handling -- -- |___/_|\_\_|_|____| by: <NAME> -- -- -- pragma Ada_2012; package body Skill.Field_Restrictions is The_Nonnull : aliased Nonnull_T; function Nonnull return Base is (The_Nonnull'Access); The_Constant_Length_Pointer : aliased Constant_Length_Pointer_T; function Constant_Length_Pointer return Base is (The_Constant_Length_Pointer'Access); end Skill.Field_Restrictions;
Logic.agda
Lolirofle/stuff-in-agda
6
6370
module Logic where open import Type renaming (Type to Stmt ; Typeω to Stmtω) public
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48009f.ada
best08618/asylo
7
12741
-- C48009F.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. --* -- FOR ALLOCATORS OF THE FORM "NEW T'(X)", CHECK THAT CONSTRAINT_ERROR -- IS RAISED IF T IS A CONSTRAINED OR UNCONSTRAINED MULTI-DIMENSIONAL -- ARRAY TYPE AND ALL COMPONENTS OF X DO NOT HAVE THE SAME LENGTH OR -- BOUNDS. -- RM 01/08/80 -- NL 10/13/81 -- SPS 10/26/82 -- JBG 03/03/83 -- EG 07/05/84 WITH REPORT; PROCEDURE C48009F IS USE REPORT; BEGIN TEST("C48009F","FOR ALLOCATORS OF THE FORM 'NEW T'(X)', CHECK " & "THAT CONSTRAINT_ERROR IS RAISED WHEN " & "X IS AN ILL-FORMED MULTIDIMENSIONAL AGGREGATE"); DECLARE TYPE TG00 IS ARRAY( 4..2 ) OF INTEGER; TYPE TG10 IS ARRAY( 1..2 ) OF INTEGER; TYPE TG20 IS ARRAY( INTEGER RANGE <> ) OF INTEGER; TYPE TG0 IS ARRAY( 3..2 ) OF TG00; TYPE TG1 IS ARRAY( 1..2 ) OF TG10; TYPE TG2 IS ARRAY( INTEGER RANGE <> ) OF TG20(1..3); TYPE ATG0 IS ACCESS TG0; TYPE ATG1 IS ACCESS TG1; TYPE ATG2 IS ACCESS TG2; VG0 : ATG0; VG1 : ATG1; VG2 : ATG2; BEGIN BEGIN VG0 := NEW TG0 '( 5..4 => ( 3..1 => 2 ) ); FAILED ("NO EXCEPTION RAISED - CASE 0"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - CASE 0" ); END; BEGIN VG1 := NEW TG1 '( ( 1 , 2 ) , ( 3 , 4 , 5 ) ); FAILED ("NO EXCEPTION RAISED - CASE 1"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - CASE 1" ); END; BEGIN VG2 := NEW TG2'( 1 => ( 1..2 => 7) , 2 => ( 1..3 => 7)); FAILED ("NO EXCEPTION RAISED - CASE 2"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - CASE 2" ); END; END; RESULT; END C48009F;
apple-music-love-current-track.applescript
lukerandall/raycast-scripts
1
2628
<reponame>lukerandall/raycast-scripts #!/usr/bin/osascript # @raycast.title Love Current Track # @raycast.author <NAME> # @raycast.authorURL https://github.com/lukerandall # @raycast.description Love currently playing track in Apple Music. # @raycast.icon ❤️ # @raycast.mode silent # @raycast.packageName Music # @raycast.schemaVersion 1 tell application "Music" if player state is playing then set track_name to the name of the current track set track_loved to the loved of the current track if track_loved is true then do shell script "echo \"" & track_name & " is already a loved track\"" else set loved of current track to true do shell script "echo \"Loved " & track_name & "\"" end if else do shell script "echo No song is currently playing" end if end tell
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt41_pkg.ads
best08618/asylo
0
7284
<reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt41_pkg.ads with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Opt41_Pkg is type Enum is (One, Two, Three, Four, Five, Six); type Rec (D : Enum) is record case D is when One => I : Integer; when Two | Five | Six => S : Unbounded_String; case D is when Two => B : Boolean; when others => null; end case; when others => null; end case; end record; type Rec_Ptr is access all Rec; function Rec_Write (R : Rec) return Unbounded_String; function Rec_Read (Str : String_Access) return Rec; end Opt41_Pkg;
3-mid/opengl/source/lean/model/opengl-model-hexagon_column-lit_colored_faceted.ads
charlie5/lace-alire
1
27680
with openGL.Geometry, openGL.Texture; package openGL.Model.hexagon_Column.lit_colored_faceted -- -- Models a lit, colored and textured column with 6 faceted shaft sides. -- is type Item is new Model.hexagon_Column.Item with private; type View is access all Item'Class; --------- --- Faces -- type hex_Face is record center_Color : lucid_Color; -- The color of the center of the hex. Colors : lucid_Colors (1 .. 6); -- The color of each of the faces 4 vertices. end record; type shaft_Face is record Color : lucid_Color; -- The color of the shaft. end record; --------- --- Forge -- function new_hexagon_Column (Radius : in Real; Height : in Real; Upper, Lower : in hex_Face; Shaft : in shaft_Face) return View; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views; private type Item is new Model.hexagon_Column.item with record upper_Face, lower_Face : hex_Face; Shaft : shaft_Face; end record; end openGL.Model.hexagon_Column.lit_colored_faceted;
9_32BitAddition.asm
furkanisitan/ExampleProgramsFor8085Microprocessor
0
93165
LXI B, 0200H LXI H, 0204H LXI D, 0208H STC ; Eldeyi 1 yap CMC ; Eldeyi tümle C=0 MVI A, 4 ; A=4 (sayılar 4 byte tan oluşuyor) MORE: STA TMP ; A yı sakla LDAX B ; BC deki veriyi A ya yükle ADC M ; A=A+[HL]+C STAX D ; A yı D adresine kaydet INX B INX H ; 1 er arttır INX D LDA TMP ; TMP deki veriyi A ya yükle DCR A ; A-=1 JNZ MORE ; 0 değilse atla HLT TMP: DS 1 ; 1 byte boyutunda değişken ; 0205H 0204H 0203H 0202H Sayi1(16 bit) ; 0209H 0208H 0207H 0206H Sayi2(16 bit) ; 020DH 020CH 020BH 020AH Toplam(16 bit)
projects/batfish/src/org/batfish/grammar/flatjuniper/FlatJuniper_bgp.g4
Alexia23/batfish
1
4134
parser grammar FlatJuniper_bgp; import FlatJuniper_common; options { tokenVocab = FlatJuniperLexer; } apsendt_path_count : PATH_COUNT count = DEC ; apsendt_prefix_policy : PREFIX_POLICY policy = variable ; bfi6t_any : ANY s_null_filler ; bfi6t_null : LABELED_UNICAST s_null_filler ; bfi6t_unicast : UNICAST bfi6t_unicast_tail ; bfi6t_unicast_tail : //intentional blank | bfi6ut_prefix_limit ; bfi6ut_prefix_limit : PREFIX_LIMIT s_null_filler ; bfit_flow : FLOW s_null_filler ; bfit_labeled_unicast : LABELED_UNICAST s_null_filler ; bfit_any : ANY s_null_filler ; bfit_multicast : MULTICAST s_null_filler ; bfit_unicast : UNICAST bfit_unicast_tail ; bfit_unicast_tail : //intentional blank | bfiut_add_path | bfiut_prefix_limit | bfiut_rib_group ; bfiuapt_receive : RECEIVE ; bfiuapt_send : SEND bfiuapt_send_tail ; bfiuapt_send_tail : apsendt_path_count | apsendt_prefix_policy ; bfiut_add_path : ADD_PATH bfiut_add_path_tail ; bfiut_add_path_tail : bfiuapt_receive | bfiuapt_send ; bfiut_prefix_limit : PREFIX_LIMIT s_null_filler ; bfiut_rib_group : RIB_GROUP name = variable ; bft_inet : INET bft_inet_tail ; bft_inet_tail : bfit_any | bfit_flow | bfit_labeled_unicast | bfit_multicast | bfit_unicast ; bft_inet6 : INET6 bft_inet6_tail ; bft_inet6_tail : bfi6t_any | bfi6t_null | bfi6t_unicast ; bft_null : ( INET_MDT | INET_MVPN | INET_VPN | INET6_VPN | L2VPN ) s_null_filler ; bmt_no_nexthop_change : NO_NEXTHOP_CHANGE ; bmt_ttl : TTL DEC ; bpast_as : as = DEC ; bt_advertise_inactive : ADVERTISE_INACTIVE ; bt_advertise_peer_as : ADVERTISE_PEER_AS ; bt_apply_groups : s_apply_groups ; bt_as_override : AS_OVERRIDE ; bt_cluster : CLUSTER IP_ADDRESS ; bt_common : bt_advertise_inactive | bt_advertise_peer_as | bt_apply_groups | bt_as_override | bt_cluster | bt_damping | bt_description | bt_disable_4byte_as | bt_export | bt_family | bt_import | bt_local_address | bt_local_as | bt_multihop | bt_multipath | bt_no_client_reflect | bt_null | bt_passive | bt_path_selection | bt_peer_as | bt_remove_private | bt_tcp_mss | bt_type ; bt_damping : DAMPING ; bt_description : s_description ; bt_disable_4byte_as : DISABLE_4BYTE_AS ; bt_enable : ENABLE ; bt_export : EXPORT expr = policy_expression ; bt_family : FAMILY bt_family_tail ; bt_family_tail : bft_inet | bft_inet6 | bft_null ; bt_group : GROUP ( name = variable | WILDCARD ) bt_group_tail ; bt_group_tail : // intentional blank | bt_common | bt_neighbor ; bt_import : IMPORT expr = policy_expression ; bt_local_address : LOCAL_ADDRESS ( IP_ADDRESS | IPV6_ADDRESS )? ; bt_local_as : LOCAL_AS bt_local_as_tail ; bt_local_as_tail : last_number? last_common* ; bt_multihop : MULTIHOP bt_multihop_tail ; bt_multihop_tail : // intentional blank | bmt_no_nexthop_change | bmt_ttl ; bt_multipath : MULTIPATH MULTIPLE_AS? ; bt_neighbor : NEIGHBOR ( IP_ADDRESS | IPV6_ADDRESS | WILDCARD ) bt_neighbor_tail ; bt_neighbor_tail : // intentional blank | bt_common ; bt_no_client_reflect : NO_CLIENT_REFLECT ; bt_null : ( AUTHENTICATION_KEY | BFD_LIVENESS_DETECTION | HOLD_TIME | KEEP | LOG_UPDOWN | MTU_DISCOVERY | OUT_DELAY | PRECISION_TIMERS | TRACEOPTIONS ) s_null_filler ; bt_passive : PASSIVE ; bt_path_selection : PATH_SELECTION bt_path_selection_tail ; bt_path_selection_tail : pst_always_compare_med ; bt_peer_as : PEER_AS bt_peer_as_tail ; bt_peer_as_tail : // intentional blank | bpast_as ; bt_remove_private : 'remove-private' ; bt_tcp_mss : TCP_MSS DEC ; bt_type : TYPE ( EXTERNAL | INTERNAL ) ; last_alias : ALIAS ; last_common : last_alias | last_loops | last_private ; last_loops : LOOPS DEC ; last_number : as = DEC ; last_private : PRIVATE ; pst_always_compare_med : ALWAYS_COMPARE_MED ; s_protocols_bgp : BGP s_protocols_bgp_tail ; s_protocols_bgp_tail : bt_common | bt_enable | bt_group | bt_neighbor ;
programs/oeis/305/A305064.asm
neoneye/loda
22
178028
; A305064: a(n) = 42*2^n - 20. ; 22,64,148,316,652,1324,2668,5356,10732,21484,42988,85996,172012,344044,688108,1376236,2752492,5505004,11010028,22020076,44040172,88080364,176160748,352321516,704643052,1409286124,2818572268,5637144556,11274289132,22548578284,45097156588,90194313196,180388626412,360777252844,721554505708,1443109011436,2886218022892,5772436045804,11544872091628,23089744183276,46179488366572,92358976733164,184717953466348,369435906932716,738871813865452,1477743627730924,2955487255461868,5910974510923756,11821949021847532,23643898043695084,47287796087390188,94575592174780396,189151184349560812,378302368699121644,756604737398243308,1513209474796486636,3026418949592973292,6052837899185946604,12105675798371893228,24211351596743786476,48422703193487572972,96845406386975145964,193690812773950291948,387381625547900583916,774763251095801167852,1549526502191602335724,3099053004383204671468,6198106008766409342956,12396212017532818685932,24792424035065637371884,49584848070131274743788,99169696140262549487596,198339392280525098975212,396678784561050197950444,793357569122100395900908,1586715138244200791801836,3173430276488401583603692,6346860552976803167207404,12693721105953606334414828,25387442211907212668829676,50774884423814425337659372,101549768847628850675318764,203099537695257701350637548,406199075390515402701275116,812398150781030805402550252,1624796301562061610805100524,3249592603124123221610201068,6499185206248246443220402156,12998370412496492886440804332,25996740824992985772881608684,51993481649985971545763217388,103986963299971943091526434796,207973926599943886183052869612,415947853199887772366105739244,831895706399775544732211478508,1663791412799551089464422957036,3327582825599102178928845914092,6655165651198204357857691828204,13310331302396408715715383656428,26620662604792817431430767312876 mov $1,2 pow $1,$0 sub $1,1 mul $1,42 add $1,22 mov $0,$1
base/mvdm/wow16/win87em/emexcept.asm
npocmaka/Windows-Server-2003
17
24805
page ,132 subttl emexcept.asm - Microsoft exception handler ;*** ;emexcept.asm - Microsoft exception handler ; ; Copyright (c) 1987-89, Microsoft Corporation ; ;Purpose: ; Microsoft exception handler ; ; This Module contains Proprietary Information of Microsoft ; Corporation and should be treated as Confidential. ; ;Revision History: (Also see emulator.hst.) ; ; 12-08-89 WAJ Add fld tbyte ptr [mem] denormal check. ; ;******************************************************************************* ;---------------------------------------------------------------------- ; Structure for FSTENV and FLDENV, Store and Load 8087 Environment ;---------------------------------------------------------------------- glb <ENV_ControlWord,ENV_StatusWord,ENV_TagWord,ENV_IP> glb <ENV_Opcode,ENV_OperandPointer,ENV_ControlMask> glb <ENV_CallOffset,ENV_CallSegment,ENV_CallFwait,ENV_Call8087Inst> glb <ENV_CallLongRet> ENV_DS EQU -4 ENV_BX EQU -2 ENV_ControlWord EQU 0 ENV_StatusWord EQU 2 ENV_TagWord EQU 4 ENV_IP EQU 6 ENV_Opcode EQU 8 ENV_OperandPointer EQU 10 ENV_ControlMask EQU 16 ENV_Temp EQU 18 ; Note ENV_Temp occupies ENV_CallOffset EQU 18 ; the same space as ENV_Call*. ENV_CallSegment EQU 20 ; This is possible because there ENV_CallFwait EQU 22 ; is never simultaneous use of ENV_Call8087Inst EQU 23 ; this space ENV_CallLongRet EQU 25 ENV_OldBP EQU 28 ENV_OldAX EQU 30 ENV_IRETadd EQU 32 ENV_Size EQU 28 ; UNDONE 386 version is bad - 387 environment is longer PAGE ;---------------------------------------------------------------------------- ; ; 8087 EXCEPTION HANDLER - Fields 8087 stack over flow and under flow. ; ;---------------------------------------------------------------------------- ; ; I. The 8087 state vector. ; ; Upon the execution of a FSAVE or FSTENV instruction the state of the ; 8087 is saved in a user defined state vector. The first seven words ; saved in the state vector by the two instructions are identical. The ; definition of the words is: ; ; Word. Bits. Bytes. Function. ; ----- ----- ------ --------- ; 0 15..0 1..0 Control word. ; 1 15..0 3..2 Status word. ( 8087 stack ; pointer and condition codes. ; 2 15..0 5..4 Tag word ( 8087 stack slot usage ; flags ). ; 3 15..0 7..6 Instruction pointer. Operator ; segment offset. ; 4 15..12 8 Operator paragraph bits ( ( ; bits 16..19 ) of address ). ; 4 11 8 Always zero. ; 4 10..8 8 Upper opcode bits ( major opcode ). ; 4 7..0 9 Lower opcode bits ( minor opcode ). ; 5 15..0 11..10 Operand Segment offset. ; 6 15..12 12 Operand paragraph bits. ; 6 11..0 Not used. Must be zero. ; ; II. Restarting instructions. ; ; Of interest in this handler is the necessity of restarting ; 8087 instructions which fail because of 8087 stack overflow ; and underflow. Even though the 8087 saves enough information ; to restart an instruction, it is incapable of doing so. The ; instruction restart must be done in software. ; ; There are two cases which must be considered after the stack ; exception has been dealt with. ; ; 1. The faulting instruction deals with top of stack. ; 2. The faulting instruction deals with memory. ; ; The first case is handled by changing the upper five bits ( ; 15..11 ) of vector word four ( 4 ) to "11011B". This changes ; word four into an "escape opcode" 8087 instruction. The ; modified opcode is placed in the interrupt code segment and ; executed. ; ; The second case is handled by changing the upper five bits ; ( 15..11 ) of vector word four ( 4 ) to "11011B", changing ; the MOD of the opcode to "00B" ( 0 displacement ), loading ; the operand address into DS:SI, and changing the RM field of ; the opcode to "100B" (SI+DISP addressing). The faulting ; instruction may be restarted as above. ; ; Instruction restart may also be accomplished by building an ; instruction stream in the interrupt stack and calling the ; instruction stream indirectly. This method is the preferred ; method because it is reentrant. ; ; III. Data Segment Considerations. ; ; DS is restored from the task interrupt vector. DS is used for ; stack overflow memory. ; ; ; Documentation of the invalid exception handling code for the stand-alone ; 8087/80287 emulator ; ; The emulator software is being enhanced for the cmerge 4.0 generation of ; languages to support a larger subset of the numeric processor instruction ; set. In addition to providing instructions which were not previously ; emulated, the model for representing the numeric processor stack is also ; being modified. The 4.0 languages and their predecessors are object compat- ; ible so it will be possible for programs to be developed which will contain ; code generated by the old model as well as the new model. For this reason ; it is important to understand the characteristics of both models and how ; the two models will interact. ; ; I. The Old Model: Infinite Stack ; ; The old model used an infinite stack model as the basis of its ; emulation of the numeric processor. Only the classical stack form of ; instructions with operands were emulated so only ST(0) (top of stack) ; and ST(1) (next to top of stack) were referenced by any given instruction. ; In addition, the stack was allowed to overflow beyond the eight registers ; available on the chip into a memory stack overflow area. The code genera- ; tor did not attempt to maintain all of its register data in the first eight ; register slots but instead made use of this overflow area. In order to ; maintain compatible behavior with or without the presence of the chip, this ; model made it necessary to handle and recover from stack overflow exceptions ; in the case where the chip is present as well as when it is being emulated. ; ; This stack overflow exception handling could in turn generate a recoverable ; stack underflow exception since a situation could arise where a desired ; operand had been pushed into the memory overflow area (during stack overflow) ; and was not available in the on-chip register area when needed. This ; scenario would signal an invalid exception due to stack underflow. ; It is recoverable because the required operand is still available in the ; overflow area and simply needs to be moved into a register on the chip. ; ; II. The New Model: Finite Stack ; ; The new model uses a finite stack model: only the eight registers on the ; chip are available for use, so in the new model the invalid exception ; would never be signalled due to stack overflow. In addition, it extends ; the emulated instruction set to include the general register form of ; instructions with operands (operands can be ST(i),ST or ST,ST(i)). Since ; the new code generator is aware of how many items it has placed on the stack, ; it does not allow stack overflow or stack underflow to occur. It can remove ; items from the registers either by storing to memory (FST or FSTP), or by ; using FFREE to mark the register as empty (this instruction is being added ; to the emulated instruction set). The new model uses FFREE in a well-defined ; manner: it will only free registers from the boundaries of the block of ; registers it is using. For example, if the new code is using ST(0)-ST(6), ; it must free the registers in the order ST(6),ST(5),ST(4),... and so on. ; It cannot create gaps of free registers within the block of registers ; it is using. ; ; III. The Hybrid Model: Combination of New and Old Code ; ; Due to the possibility of mixture of code generated using both of the above ; models, the new exception handling and emulation software has to be able to ; handle all situations which can arise as a result of the interaction of the ; two models. The following summarizes the behavior of the two models and ; restrictions placed on their interaction. ; ; New Code: ; ; 1. Cannot call anyone with any active entries on the stack. ; The new model is always at a conceptual stack level of zero ; when it makes external calls. Thus old code will never ; incorrectly make use of register data that was placed on the ; register stack by new code. ; ; 2. May create gaps of free registers in the register stack. ; It will not create gaps in the memory stack overflow area. ; ; 3. Only causes stack overflow by pushing old code entries off of ; the register stack and into the memory stack overflow area. ; It will never overflow its own entries into the memory stack ; overflow area. ; ; 4. Cannot cause stack underflow. ; ; ; Old Code: ; ; 1. Can only reference ST(0), ST(1). ; ; 2. Can cause stack overflow by pushing too many entries onto the ; register stack. ; ; 3. Can cause stack underflow in two situations: ; ; a. It is trying to get something that is in the memory stack ; overflow area (stack overflow occurred previously). ; ; b. There are free entries on the chip. This situation could ; arise if new code creates free entries then calls old code, ; so this is a situation that could not have existed before ; the new model was introduced. ; ; IV. Stack Overflow/Underflow Exception Handling ; ; The following algorithms will be used for detecting and recovering from ; stack overflow and underflow conditions (signalled via the invalid ; exception). All invalid exceptions are "before" exceptions so that ; the instruction has to be reexecuted once the exception has been handled. ; ; A. Stack Overflow ; ; If ST(7) is used (possible stack overflow) then { ; check for instructions which could cause stack overflow ; (includes FLD,FPTAN,...) ; if instruction could cause stack overflow then { ; save ST(7) in stack overflow area at [CURstk] ; mark ST(7) empty ; if FLD ST(7) instruction then ; FLD [CURstk] or rotate chip (clear exceptions) ; else reexecute the instruction with ST(7) empty ; } ; } ; ; B. Stack Underflow ; ; If ST(0) is free then assume stack underflow since the stack ; overflow case has already been handled (if the invalid ; is due to a denormal exception, the exception will occur ; again when the instruction is reexecuted): ; ; if chip has any registers in use (check the tag word) then { ; rotate chip until ST(0) is not empty ; rotate tag word to reflect state of chip ; } ; else (no registers in use) ; if operand is in stack overflow area then { ; load into ST(0) from stack overflow area ; mark ST(0) full ; } ; else { ; indicate true stack underflow ; go print error ; } ; if ST(1) is empty then { ; if any of ST(2) thru ST(7) are in use then { ; rotate chip until ST(1) is not empty ; (to share code with first chip rotation above: ; store pop st(0) into temp ; rotate chip until st(0) is not free ; load st(0) back onto chip) ; update tag word appropriately ; } ; else ; load ST(1) from overflow area if there ; } ; ; At this point, ST(0) and ST(1) have been filled if possible. ; Now we must categorize the instructions to determine which ; of these is required. Then we will either issue true stack ; underflow or reexecute the instruction with the compressed ; stack. ;---------------------------------------------------------------------------- ; ; References: ; Intel 8086 Family Numerics Supplement. 121586-001 Rev A. ; Intel iAPX 86,88 User's Manual. ; ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; ; All registers must be saved by __FPEXCEPTION87 except CS,IP,SS,SP. ; ;---------------------------------------------------------------------------- ifdef WINDOWS ; stack consists of IRET frame and status word before FCLEX ; ; Since the environment is different in protect mode, reconstruct ; the opcode like in real mode. lab protiret iret lab protexskipsegovr inc bx ; bump past segment override jmp short protexsegovr ; try again public __FPEXCEPTION87P __FPEXCEPTION87P: lab protexception push eax ; save user ax push ebp sub esp,ENV_Size ; get Enough bytes for Environment mov ebp,esp ; set up for rational offsets. fstenv word ptr [ebp] ; save environment. mov eax,offset protiret ; set up for near return address xchg ax,[ebp+ENV_Size+4] ; swap status word and near ret addr mov ENV_StatusWord[ebp],ax ; save status word into environment push ebx push ds ; save a few more registers lds ebx,dword ptr ENV_IP[ebp] ; get address of instruction lab protexsegovr mov ax,[ebx] ; get 1st 2 bytes of instruction add al,28h ; add -(ESC 0) jnc protexskipsegovr ; wasn't ESC - skip seg. override xchg al,ah ; swap bytes to make real opcode mov ENV_Opcode[ebp],ax ; save it in environment sti jmp short exceptionhandler endif ;WINDOWS ifdef DOS5 ; stack consists of IRET frame and status word before FCLEX ; ; Since the environment is different in protect mode, reconstruct ; the opcode like in real mode. lab protiret iret lab protexskipsegovr inc bx ; bump past segment override jmp short protexsegovr ; try again lab protexception push eax ; save user ax push ebp sub esp,ENV_Size ; get Enough bytes for Environment mov ebp,esp ; set up for rational offsets. fstenv word ptr [ebp] ; save environment. mov eax,offset protiret ; set up for near return address xchg ax,[ebp+ENV_Size+4] ; swap status word and near ret addr mov ENV_StatusWord[ebp],ax ; save status word into environment push ebx push ds ; save a few more registers lds ebx,dword ptr ENV_IP[ebp] ; get address of instruction lab protexsegovr mov ax,[ebx] ; get 1st 2 bytes of instruction add al,28h ; add -(ESC 0) jnc protexskipsegovr ; wasn't ESC - skip seg. override xchg al,ah ; swap bytes to make real opcode mov ENV_Opcode[ebp],ax ; save it in environment endif ;DOS5 ifdef DOS3and5 jmp short exceptionhandler endif ;DOS3and5 ifdef DOS3 public __FPEXCEPTION87 __FPEXCEPTION87: PUSH AX ; Save user's AX next to IRET PUSH BP SUB SP,ENV_Size ; Get Enough bytes for Environment ; 8087 status. MOV BP,SP ; Set up for rational offsets. ;Caveat Programmer! ;FSTENV does an implicit set of all exception masks. FNSTENV WORD PTR [BP] ; Save environment. FCLEX ; Clear exceptions. STI ; Restore host interrupts. PUSH BX PUSH DS ; Need access to user data endif ;DOS3 ;---------------------------------------------------------------------------- ; In a multitasking environment one would not want to restore ; interrupts at this point. One would wait until the 8087 had been ; flushed and any operand data copied to a storage area. ;---------------------------------------------------------------------------- ;--------------- ; Inside of the while exception loop and Redo8087Instruction ; registers AX and BX must contain the values as described ; below: ; AL bit 0 = 1 indicates invalid exception ; bit 1 = 1 indicates denormal exception ; bit 2 = 1 indicates divide by zero exception ; bit 3 = 1 indicates numeric overflow ; bit 4 = 1 indicates numeric underflow ; bit 5 = 1 indicates precision loss ; bit 6 = unused by 8087 ; bit 7 = 1 indicates sqrt of negative number ; (this flag is not from the NPX status word, but ; is set after all other exceptions have been ; handled if the opcode is FSQRT) ; AH bit 0 = unused ; bit 1 = 1 indicates stack overflow ; bit 2 = 1 indicates stack underflow ; bit 3 = unused ; bit 4 = unused ; bit 5 = 1 indicates memory operand ; bit 6 = 1 indicates instruction was reexcuted ; bit 7 = 1 indicates ST relative operand ; BL = The complement of the exception masks copied from ; UserControlWord altered so that Denormal and Invalid ; exceptions are always unmasked, while the reserved ; bits are masked. ; BH bit 0 = 1 indicates 8087 only invalid handling complete ; bit 1 = 1 indicates 8087 only denormal handling complete ; bit 2 = 1 indicates 8087 only divide by zero handling complete ; bit 3 = 1 indicates 8087 only numeric overflow handling complete ; bit 4 = 1 indicates 8087 only numeric underflow handling complete ; bit 5 = 1 indicates 8087 only precision loss handling complete ; bit 6 = unused ; bit 7 = unused ; ; Algorithm: Handle 8087 exceptions which do not occur in the ; emulator and then jump to the common exception handling code. ; ; To handle 8087 only exceptions we must first determine if the ; exception occured before the 8087 executed the instruction ; or afterward. Invalid, denormal (except FLD) and divide by ; zero exceptions all occur before 8087 instruction execution, ; others occur afterward. "Before" exceptions must set the ; "before" flag in AH and then reexecute the instruction. After ; reexecution (while all exceptions are masked) all of the ; exceptions resulting from the current 8087 instruction will ; be known and can be handled as a group. "After" exceptions ; are handled individually since reexecution of an already ; executed instruction will destroy the validity of the 8087 stack. ; A flag in AH is used by Redo8087instruction to avoid reexecuting ; an instruction twice. At the beginning of Redo8087instruction ; the flag is checked, and if it is set the instruction is not ; redone. ; ; "Before" exceptions must be reexecuted because it is ; difficult to determine stack over/underflow if reexecution ; is not performed. Stack over/underflow is signaled by ; an invalid exception. The current algorithm for stack over/ ; underflow detection is as follows: ; ; ... ; ;--------------- ProfBegin EXCEPT lab exceptionhandler ifdef MTHREAD LOADthreadDS ; macro in emthread.asm ; loads thread's DS; trashes AX else ;MTHREAD ifdef standalone XOR AX,AX ; Prepare to access vector, clear flags MOV DS,AX MOV DS,DS:[4*TSKINT+2] ; DS = emulator task data segment elseifdef _COM_ mov ds, [__EmDataSeg] xor ax,ax else mov ax, edataBASE mov ds,ax xor ax,ax endif endif ;MTHREAD MOV AL,ENV_StatusWord[eBP] ; Get 8087 status flags. XOR BH,BH ; Clear out 8087 handling flags ;---------------------------------------------------------------------------- ; ; Can the interrupt be serviced by this routine? Dispatch exceptional ; conditions. ; ; Multi-pass algorithm ; Handle exception and reexcute instruction if necessary ; Loop back to WhileException and handle additional exceptions ; ; AX = status before exception handling ; BX = flag indicating exception handled ; ;---------------------------------------------------------------------------- cmp [ExtendStack], 0 ; check if the extended stack was jne WhileException ; turned off. or bh, Invalid lab WhileException ifndef _NOSTKEXCHLR ; no stack overflow/underflow handler TEST BH,Invalid ; stack over/underflow already handled? JNZ short NotOverUnderflow ; Yes - forget stack over/underflow TEST AL,Invalid ; Invalid exception? JZ short NotOverUnderflow ; No - bypass over/underflow checking OR BH,Invalid ; Indicate stack over/undeflow checked JMP ProcessOverUnderflow ; See about stack over/underflow endif ;_NOSTKEXCHLR lab NotOverUnderflow ; Either the exception was not an invalid or stack over/underflow has ; already been handled. ; check for denormal exception - completely resolved on pass 1 TEST AL,Denormal ; Denormal exception? JZ short NotDenormal ; No - bypass denormal handling JMP ProcessDenormal ; Process the denormal lab NotDenormal ; check for zero divide exception TEST BH,ZeroDivide ; Divide by zero already handled? JNZ short NotZeroDivide ; Yes - bypass divide by zero handling TEST AL,ZeroDivide ; Divide by zero exception? JZ short NotZeroDivide ; No - bypass divide by zero handling OR BH,ZeroDivide ; Indicate divide by zero handled CALL ReDo8087Instruction ; Process divide by zero exception JMP WhileException lab NotZeroDivide ; check for numeric overflow exception TEST BH,Overflow ; Overflow already handled? JNZ short AllExceptionsHandled ; Yes - bypass overflow handling TEST AL,Overflow ; Overflow exception? JZ short AllExceptionsHandled ; No - bypass overflow handling OR BH,Overflow ; Indicate overflow handled JMP ProcessNumericOverflow ; Process numeric overflow lab AllExceptionsHandled ; We have already handled any exceptions which require instruction ; reexecution. ; At this point 8087 instruction reexecution is done. We need ; to extract a little more information for error message ; generation. MOV BL, BYTE PTR UserControlWord ; 8087 exception masks OR BL, 0C0H ; Mask reserved AND BL, 0FDH ; Unmask denormal. DON'T unmask invalid ; here. (Otherwiae user has no way of ; masking invalids.) NOT BL ; complement AND AL, BL ; eliminate all masked exceptions ; from AL TEST AL,Invalid ; Possibly square root of neg? JZ short NotFLDshortorlongNaN ; No - don't set square root flag PUSH AX ; ... Use AX as scratch ... MOV AX,ENV_Opcode[eBP] ; Get the instruction op code AND AH,7 ; Mask off the junk CMP AX,001FAh ; Square root op code? JNE short NotSquareRootError ; No - don't set square root flag POP AX ; ... Restore AX ... OR AL,SquareRootNeg ; Set the square root flag JMP short NotFLDshortorlongNaN ;----------------------------------------------------------------------------- ; Test for invalid exception caused by an FLD of a NaN underflow or overflow. ;----------------------------------------------------------------------------- lab NotSquareRootError ; Next check for FLD of a NaN ; (only happens for SNaNs on ; the 80387; not for 8087/287) MOV AX,ENV_Opcode[eBP] AND AX,0338h ; Mask off the inessential bits CMP AX,0100h ; Check for possible FLD ; of short/long real from memory. ; We are assuming that an invalid ; exception means FLD of a NaN ; since stack over/under-flow ; has already been dealt with. ; (we don't handle FLD ST(n) or ; FLD temp real in this way) POP AX ; ... Restore AX ... JNE short NotFLDshortorlongNaN ; ; (MOD==11 case: no special code) ; We don't handle FLD ST(n) here since it isn't properly ; handled in our stack overlow checking code either and ; it doesn't generate an invalid in the case of an SNaN ; without a stack overflow; FFREE ST(n) will not cause ; an Invalid exception. ; ; FLD TBYTE PTR ... shouldn't cause an Invalid due to a NaN ; XOR AL,Invalid ; Turn off invalid exception. ; There should be a NaN in ST(0); ; we will just leave it there. lab NotFLDshortorlongNaN FCLEX FLDCW ENV_ControlWord[eBP] ; Restore original Control Word lab CleanUpHost or [UserStatusWord],ax ; OR into user status word POP DS POP eBX ADD eSP,ENV_Size ; Point to users BP POP eBP TEST AX,0FFFFh-Reexecuted ; exceptions? JNZ Exceptions8087 ; Process other exceptions as emulator POP eAX ; Now just IRET address on stack ret ; return to OEM interrupt exit routine lab Exceptions8087 ; toss OEM routine return address push eax push ebx mov ebx,esp ; UNDONE - this does not work for 386 mov eax,ss:[ebx+4] ; get original AX mov ss:[ebx+6],eax ; overwrite OEM routine return address pop ebx pop eax ifdef i386 add esp,4 ; remove original AX else add sp,2 ; remove original AX endif JMP CommonExceptions PAGE ;----------------------------------------------------------------------------- ; Test for stack underflow or overflow. ;----------------------------------------------------------------------------- ; There are eight sets of tag bits in the tag word. Each set ; denotes the state of one of the 8087 stack elements. ; 00 - normal ; 01 - true zero ; 10 - special: nan,infinity,unnormal ; 11 - empty ; If all are empty we have underflow, if all are full we have overflow ; There was an invalid exception: check to see if it was stack ; overflow or underflow. ; Register usage in this code block: ; BX = tag word, complemented ; CL = NPX stack ptr ifndef _NOSTKEXCHLR ; no stack overflow/underflow handler lab ProcessOverUnderflow PUSH eSI PUSH eBX ; Make room for local temps PUSH eCX PUSH eDX PUSH eDI MOV BX,ENV_TagWord[eBP] ; Get tag word. MOV CX,ENV_StatusWord[eBP] ; Get status word NOT BX ; Tag zero means empty, else full MOV CL,CH ; Get stack pointer into CL AND CL,038h ; Mask to stack pointer SHR CL,1 SHR CL,1 ; compute number of bits to shift ROR BX,CL ; tag ST(0) in low BL. ; To service stack overflow we must make sure there is an empty space ; above the top of stack before the instruction is reexecuted. If ; after reexecution we again get an invalid exception, then we ; know there was something besides stack overflow causing the invalid ; exception. ; We check for stack overflow by seeing if ST(7) is empty. We make ; the check by testing the complemented, rotated tag word in BX. TEST BH,0C0h ; Possible stack overflow? JZ short StackUnderflowCheck ; No - bypass offloading stack ; ST(7) is not empty, so we may have stack overflow. We verify that ; we have stack overflow by looking at the instruction to be sure ; that it can generate stack overflow (i.e., it puts more stuff on ; the stack than it removes). ; Note that a subset of the 287 instruction set is being decoded ; here; only those instructions which can generate invalid exceptions ; get to this point in the code (see Table 2-14 in the Numeric ; Supplement for list of instructions and possible exceptions). ; ; The instructions which can generate stack overflow are: ; all memory FLDs,FILDs,FBLDs,constant instructions, ; FPTAN and FXTRACT MOV DX,ENV_Opcode[eBP] ; Get the instruction op code XOR DX,001E0h ; Toggle arith, mod and special bits ; Test for mod of 0,1, or 2 (indicates memory operand) TEST DL,0C0h ; Memory operand instruction? JNZ short MemoryFLDCheck ; Yes - go see what kind ; Test bits 5 & 8 of instruction opcode: of remaining instructions, only those ; with stack relative operands do NOT have both of these bits as 1 in the opcode ; (remember these bits are toggled). TEST DX,00120h ; ST Relative Op group? JNZ short StackUnderflowCheck ; Yes - ST Relative Ops ; cannot cause stack overflow ; Test bit 4 of the instruction opcode: of remaining instructions, only the ; transcendentals have this bit set. TEST DL,010h ; Constant or arith instruction? JNZ short TransCheck ; No - must be Transcendental ; Test bit 3 of the instruction opcode: of remaining instructions, only the ; constant instructions have this bit set. TEST DL,008h ; Constant instruction? JNZ short StackOverflowVerified ; Yes, can cause stack overflow ; The instructions which get to this point are FCHS, FABS, FTST and FXAM. ; None of these can cause stack overflow. JMP StackUnderflowCheck ; so go check for stack underflow lab TransCheck ; The instruction was a transcendental. Of the transcendentals, only ; FPTAN and FXTRACT can cause stack overflow, so check for these. CMP DL,012h ; is this FPTAN JE short StackOverflowVerified ; yes, can cause stack overflow CMP DL,014h ; is this FXTRACT JE short StackOverflowVerified ; yes, can cause stack overflow JMP StackUnderflowCheck ; not either one, won't cause overflow lab MemoryFLDCheck TEST DX,00110h ; FLD memory instruction? JNZ short StackUnderflowCheck ; no - go check for stack underflow lab StackOverflowVerified ; ST(7) was not empty and the instruction can cause stack overflow. ; To recover from stack overflow, move ST(7) contents to the ; stack extension area, modifying the tag word appropriately. AND BH,0FFh-0C0h ; Indicate 1st above TOS is free PUSHST ; Let PUSHST make room for value. FDECSTP ; Point to bottom stack element. FSTP TBYTE PTR [eSI] ; Store out bottom stack element. JMP InvalidReexecute ; No - reexecute instruction lab StackUnderflowCheck ; To service stack underflow we must make sure all the operands the ; instruction requires are placed on the stack before the instruction ; is reexecuted. If after reexecution we again get an invalid ; exception, then its due to something else. TEST BL,003h ; Is ST(0) empty? JZ short UFMemoryFLDcheck ; yes - first check for memory FLD JMP ST1EmptyCheck ; No - Let's try to fill ST(1), too. ; We may need it! ; ; This block of code is for making sure that FLD memory operand is not ; among those instructions where stack underflow could occur; this is ; so FLD of SNaN can be detected (under the AllExceptionsHandled ; section) for the case of the 80387. ; lab UFMemoryFLDcheck MOV DX,ENV_Opcode[eBP] ; Get the instruction opcode XOR DX,001E0h ; Toggle arith, mod and special bits TEST DL,0C0h ; Memory operand instruction? JZ ST0Empty ; No - continue underflow processing ; Try to fill ST(0) TEST DX,00110h ; FLD memory instruction? JNZ ST0Empty ; No - continue underflow processing ; Try to fill ST(0) JMP ST1EmptyCheck ; Let's try to fill ST(1), too. ; We may need it! ; Formerly we did JMP InvalidReexecute here; but this caused ; an "invalid" to be reported for instructions with two stack ; operands. (Doing JMP ST1EMptyCheck fixes this bug: ; Fortran 4.01 BCP #1767.) ; ; This fixes the underflow-handling case of instructions ; needing both ST0 and ST1 under the conditions that ST0 ; is full but ST1 is empty. lab ST0Empty ; assume stack underflow since ST(0) is empty and we did not have ; stack overflow OR BX,BX ; Are any registers on the chip in ; use? (BX = 0 if not) JZ short LoadST0FromMemory ; No, load ST(0) from memory stack CALL RotateChip ; yes, then point ST(0) at first ; valid register and update tag in BX JMP ST1EmptyCheck ; go check if ST(1) is empty lab LoadST0FromMemory MOV eSI,[CURstk] ; Get pointer to memory stack CMP eSI,[BASstk] ; Anything in memory to load? JNE short LoadST0 ; Yes, go load it JMP TrueUnderflow ; No, go issue error lab LoadST0 OR BL,003h ; Indicate ST(0) is full FINCSTP ; Avoid altering stack pointer. FLD TBYTE PTR [eSI] ; Load value from memory. POPST ; Let POPST decrement memory pointer. lab ST1EmptyCheck TEST BL,00Ch ; Is ST(1) empty? JNZ short EndST1EmptyCheck ; No - so don't load from memory MOV SI,BX ; move tag word to SI AND SI,0FFF0h ; mask off ST(0),ST(1) OR SI,SI ; Are any of ST(2)-ST(7) in use? ; (SI = 0 if not) JZ short LoadST1FromMemory ; No, try to get ST(1) from memory FSTP TBYTE PTR [REG8087ST0] ; offload ST(0) temporarily SHR BX,1 SHR BX,1 ; ST(1) becomes ST(0) in tag word CALL RotateChip ; get 1st in-use register into ST(1) FLD TBYTE PTR [REG8087ST0] ; reload ST(0) SHL BX,1 SHL BX,1 ; adjust tag word for reloaded ST(0) OR BL,003h ; Indicate ST(0) is full JMP SHORT EndST1EmptyCheck ; ST(0) and ST(1) are full lab LoadST1FromMemory MOV eSI,[CURstk] ; Get pointer to memory stack CMP eSI,[BASstk] ; Anything in memory to load? JE short EndST1EmptyCheck ; No, so don't load it. OR BL,00Ch ; Indicate ST(1) is full FINCSTP ; Point to ST(1) FINCSTP ; Point to ST(2) FLD TBYTE PTR [eSI] ; Load value from memory into ST(1). FDECSTP ; Point to ST(0) POPST ; Let POPST decrement memory pointer. lab EndST1EmptyCheck ; At this point we know that ST(0) is full. ST(1) may or may not be full ; and may or may not be needed. ; Now we look at the instruction opcode and begin categorizing instructions ; to determine whether they can cause stack underflow and if so, whether ; they require ST(0) only or ST(1) as well. MOV DX,ENV_Opcode[eBP] ; Get the instruction op code XOR DX,001E0h ; Toggle arith, mod, and special bits ; Test for mod of 0,1, or 2 (indicates memory operand) TEST DL,0C0h ; Memory operand instruction? JNZ short StackUnderflowServiced ; Yes, then stack underflow cannot ; be a problem since memory instructions ; require at most one stack operand ; and we know that ST(0) is full ; Test bits 5 & 8 of instruction opcode: of remaining instructions, only those ; with stack relative operands do NOT have both of these bits as 1 in the opcode ; (remember these bits are toggled). TEST DX,00120h ; ST Relative Op group? JNZ short STRelativeOpGroup ; Yes - ST Relative Ops lab ConstOrTrans ; Test bit 4 of the instruction opcode: of remaining instructions, only the ; transcendentals have this bit set. TEST DL,010h ; Constant or arith instruction? JNZ short TranscendentalInst ; No - must be Transcendental ; The instructions that get to here are the constant instructions and ; FCHS, FABS, FTST and FXAM. The constant instructions do not have any ; stack operands; the others require ST(0) which we know is valid. ; Therefore, none of the remaining instructions can cause stack underflow. lab StackUnderflowServiced JMP InvalidReexecute ; Stack underflow corrected ; reexecute instruction lab TranscendentalInst ; Transcendentals may require one or two stack elements as operands. ; Here we decide whether or not ST(1) needs to be present. MOV CL,DL ; Need low op code in CL AND CL,00Fh ; Mask to low four bits ; Read the next block of comments column-wise. It shows the transcendental ; instructions represented by each bit in the constant loaded into DX below. ; Note: as it turns out, of the instructions requiring two operands below, ; only FSCALE and FPREM generate invalid exceptions when the second operand ; is missing. ; FFFFFRFFFFFRFFRR ; 2YPPXEDIPYSERSEE ; XLTATSENRLQSNCSS ; M2ATRECCE2REDAEE ; 1XNAARSSMXTRILRR ; ...NCVTT.P.VNEVV ; ....TEPP.1.ET.EE ; .....D.....D..DD MOV DX,0101000011000100b ; 1's for 2 operand instructions SHL DX,CL ; Get corresponding bit into sign JNS short StackUnderflowServiced ; If just ST(0) needed we're O.K. TEST BL,00Ch ; ST(1) full? JNZ short StackUnderflowServiced ; Yes - stack underflow no problem lab STRelativeOpGroup ; The following code block handles the general operand ST(x) even though ; the original code generator only uses ST(0) and ST(1) as operands. ; The current code generator uses ST(x) but will never cause stack underflow ; exceptions. AND DX,00007h ; Mask to relative register number SHL DL,1 ; Compute tag word shift amount MOV CX,DX ; Get amount into CL MOV DX,BX ; Get tag into DX ROR DX,CL ; Shift operand tag into low DL TEST DL,003h ; Is operand register empty? JNZ short InvalidReexecute ; No - go reexecute ; The following conditions could cause a true underflow error to be ; erroneously generated at this point: ; FST ST(x) signals an invalid because ST(0) is empty. ST(0) gets filled ; by the stack underflow recovery code in this handler, but then ; the instruction is classified as an STRelative instruction and the ; above paragraph of code checks if ST(x) is empty. HOWEVER, FST ST(x) does ; not require ST(x) to be empty so a true underflow error should not occur. ; This code should be changed if this situation can ever occur. JMP TrueUnderflow ; true stack underflow ;*** RotateChip - rotate coprocessor registers ; ; ENTRY ; BX: tag word, complemented ; ST(0): empty ; at least one other register on the chip is non-empty ; (or else this routine will loop infinitely) ; ; RETURNS ; BX: updated tag word, complemented ; ST(0): non-empty ; ; DESCRIPTION ; This routine rotates the registers on the coprocessor ; until the first in-use register is in ST(0). This ; will correct a stack underflow exception which has been ; caused by old model code encountering a gap of free ; registers created by new model code. The complemented ; tag word is also updated appropriately. ; lab RotateChip ROR BX,1 ; Rotate tag word ROR BX,1 FINCSTP ; Point to new ST(0) TEST BX,00003h ; Is this register empty? JZ short RotateChip ; No, go rotate again RET lab TrueUnderflow OR AH,StackUnderflow/256 ; indicate true stack underflow MOV BYTE PTR ENV_StatusWord[eBP],0 ; Clear exceptions FLDENV WORD PTR [eBP] ; Restore old environment. POP eDI POP eDX POP eCX POP eBX POP eSI JMP CleanUpHost ; Leave exception handler. lab InvalidReexecute AND AL,0FFH-Invalid ; Reset invalid flag. CALL ReDo8087Instruction ; Was invalid so redo instruction. POP eDI POP eDX POP eCX POP eBX POP eSI JMP WhileException endif ;_NOSTKEXCHLR ;---------------------------------------------------------------------------- PAGE lab ProcessDenormal ; Correct 8087 bug. The FLD instruction signals a denormal ; exception AFTER it has completed. Reexecuting FLD for a ; denormal exception would thus mess up the 8087 stack. INTEL ; documentation states denormal exceptions are BEFORE ; exceptions, so there is a contradiction. To avoid reexecution ; of FLD we do as follows: And op code with 138H to mask out ; MOD, RM, ESC and memory format bits. Compare with 100H to ; distinguish FLD from other instructions which could possibly ; generate a denormal exception. or byte ptr [UserStatusWord],Denormal ; set denorm bit push ecx mov cx,ENV_Opcode[eBP] ; see if we have a reg,reg operation and cl, bMOD cmp cl, bMOD ; if MOD = 11b then we have a reg,reg op je notMemOpDenormal mov cx,ENV_Opcode[eBP] and cx, not (0fc00h or bMOD or bRM) ; remove escape, OpSizeBit, MOD and R/M cmp cx,0008h ; check for FMUL real-memory je short isMemOpDenormal cmp cx,0010h ; check for FCOM real-memory je short isMemOpDenormal and cl,30h ; clear low opcode bit cmp cx,0030h ; check for FDIV/FDIVR real-memory jne short notMemOpDenormal ; have FDIV/FDIVR real-memory ; have FMUL real-memory ; have FCOM real-memory ; ; do the following steps ; 1. free ST(7) if not free to avoid stack overflow ; 2. change instruction to FLD real-memory and redo ; 3. normalize TOS ; 4. change instruction to FMUL or FDIV[R]P ST(1),ST and redo lab isMemOpDenormal TEST BH,0C0h ; 1. Possible stack overflow? JZ short nostkovr ; No - bypass offloading stack AND BH,0FFh-0C0h ; Indicate 1st above TOS is free PUSHST ; Let PUSHST make room for value. FDECSTP ; Point to bottom stack element. FSTP TBYTE PTR [eSI] ; Store out bottom stack element. lab nostkovr mov cx,ENV_Opcode[ebp] ; 2. get original instruction push cx ; save it for later and cx,0400h add cx,0104h ; changed to FLD real DS:[SI] mov ENV_Opcode[ebp],cx ; change for redo call ReDoIt ; do FLD denormal call normalize ; 3. normalize TOS pop cx ; 4. restore original instruction and cx,0038h ; reduce to operation cmp cl,08h ; is it FMUL je short isFMUL ; yes cmp cl,10h ; is it FCOM je short isFCOM ; yes xor cl,08h ; must be FDIV[R] - flip R bit lab isFMUL or cx,06C1h ; or to FoprP ST(1),ST mov ENV_Opcode[ebp],cx ; change for redo call ReDo8087Instruction ; do FDIV[R]P ST(1),ST jmp short denormaldone ; done with FDIV[R] denormal lab notMemOpDenormal MOV cx,ENV_Opcode[eBP] and cx, 0738h cmp cx, 0328h je short noredo ; check for FLD long double AND cx,0138H CMP cx,0100H ; check for FLD float/double JZ short noredo CALL ReDo8087Instruction ; redo other instructions lab noredo call normalize jmp short denormaldone ; FCOM is a little more complicated to recover because of status ; ; FCOM is like FDIV in that the operands need to be exchanged ; and the value loaded onto the chip needs to be popped. ; ; This routine is like a mini ReDo8087Instruction lab isFCOM OR AH,Reexecuted/256 ; Flag instruction reexecuted FCLEX ; clear exceptions FXCH ; swap ST(0) and ST(1) FCOM ST(1) ; so that ST(1) is the "source" FXCH FSTP ST(0) ; toss stack entry FSTSW [NewStatusWord] ; get status word FWAIT OR AL,BYTE PTR [NewStatusWord] ; Include new with unhandled exceptions lab denormaldone pop ecx AND AL,0FFh-Denormal ; clear denormal exception jmp WhileException lab normalize fstp tbyte ptr ENV_Temp[ebp] ; save denormal/unnormal fwait mov cx,ENV_Temp[ebp+8] ; get old exponent test cx,07FFFh ; test for zero exponent jz short isdenormal ; denormal temp real test byte ptr ENV_Temp[ebp+7],80h ; test for unnormal jnz short isnormal ; no - skip normalization fild qword ptr ENV_Temp[ebp] ; load mantissa as integer*8 fstp tbyte ptr ENV_Temp[ebp] ; save mantissa fwait cmp word ptr ENV_Temp[ebp+8],0 ; check for 0.0 je short isdenormal ; yes - we had a pseudo-zero sub cx,403Eh ; exponent adjust (3fff+3f) add ENV_Temp[ebp+8],cx ; add to mantissa exponent lab isnormal fld tbyte ptr ENV_Temp[ebp] ; reload normalized number ret lab isdenormal xor cx,cx ; make it into a zero mov ENV_Temp[ebp],cx mov ENV_Temp[ebp+2],cx mov ENV_Temp[ebp+4],cx mov ENV_Temp[ebp+6],cx mov ENV_Temp[ebp+8],cx jmp isnormal ; reload it as zero PAGE lab ProcessNumericOverflow ; We must reexecute for numeric overflow only if the instruction ; was an FST or FSTP. This is because only these instructions ; signal the exception before the instruction is executed. ; If we reexecute under other conditions the state of the 8087 ; will be destroyed. Only memory operand versions of FST and ; FSTP can produce the Overflow exception, and of all the ; non-arithmetic memory operand instructions, only FST and ; FSTP produce overflow exceptions. Thus it is sufficient ; to reexecute only in case of non-arithmetic memory operand ; instructions. To check for these and the op code with 001C0H ; to mask down to the arith and MOD fields, flip the arith ; bit by xoring with 00100H and if the result is below 000C0H ; then we have a non-arithmetic memory operand instruction. PUSH eAX MOV AX,ENV_Opcode[eBP] AND AX,001C0H XOR AH,001H CMP AX,000C0H POP eAX JAE short NumericOverflowRet CALL ReDo8087Instruction lab NumericOverflowRet JMP WhileException PAGE ;---------------------------------------------------------------------------- ; Reexecute aborted 8087 instruction, and include any exceptions in ENV [BP] ;---------------------------------------------------------------------------- ifdef WINDOWS lab ReDo8087InstructionRet ret endif lab ReDo8087Instruction TEST AH,Reexecuted/256 ; Already reexecuted? JNZ short ReDo8087InstructionRet ; If so don't do it again OR AH,Reexecuted/256 ; Flag instruction reexecuted lab ReDoIt PUSH DS PUSH eDI PUSH eSI PUSH eCX PUSH eBX FCLEX ; clear error summary flags ifdef WINDOWS mov di, ss ; assume SS mov bx, __WINFLAGS test bx, WF_PMODE jz SkipSSAlias push es ; push ax ; CHICAGO needs 32-bit register saves ... ; push dx push eax ; for CHICAGO push ebx ; for CHICAGO push ecx ; for CHICAGO push edx ; for CHICAGO push ebp ; for CHICAGO push esi ; for CHICAGO push edi ; for CHICAGO push ss call ALLOCDSTOCSALIAS pop edi ; for CHICAGO mov di, ax ; pop dx ; CHICAGO needs 32-bit register restores ; pop ax pop esi ; for CHICAGO pop ebp ; for CHICAGO pop edx ; for CHICAGO pop ecx ; for CHICAGO pop ebx ; for CHICAGO pop eax ; for CHICAGO pop es or di, di jz ReExecuteRestoreRet lab SkipSSAlias else ;not WINDOWS ifdef DOS3and5 mov di,ss ; assume SS cmp [protmode],0 ; check if protect mode je noSSalias ; no - don't get SS alias endif ;DOS3and5 ifdef DOS5 ifdef SQL_EMMT push ax push ss ; The SQL server may have switched stacks push ds ; so update SSalias. mov ax,offset SSalias push ax os2call DOSCREATECSALIAS pop ax endif ;SQL_EMMT mov di,[SSalias] ; Get segment alias to stack endif ;DOS5 endif ;not WINDOWS ifdef DOS3and5 lab noSSalias endif ;DOS3and5 MOV CX,ENV_Opcode[eBP] ; Get aborted 8087 instruction. MOV BX,CX ; Copy instruction. AND CH,07H ; Clear upper 5 bits. OR CH,0D8H ; "OR" in escape code. AND BL,0C0H ; Mask to MOD field. XOR BL,0C0H ; If MOD = "11" (no memory operand) JZ short REEXECUTE ; then address mode modification code ; must be bypassed. AND CL,38H ; Clear MOD and RM fields, OR CL,4H ; Turn on bits in MOD and RM fields ; to force DS:[SI+0] addressing. LDS SI,ENV_OperandPointer[eBP] ; DS:SI <-- operand address lab REEXECUTE XCHG CH,CL ; convert to non-byte swapped ; code format ; ; Stack restart method. Restart instruction in interrupt stack ; frame. Code is reentrant. ; ifdef WINDOWS mov ENV_CallSegment[ebp],di ; Code segment alias to stack elseifdef DOS5 mov ENV_CallSegment[ebp],di ; Code segment alias to stack else MOV ENV_CallSegment[eBP],SS ; Stack segment endif LEA eDI,ENV_CallFwait[eBP] ; Offset to code in stack. MOV ENV_CallOffset[BP],eDI MOV BYTE PTR ENV_CallFwait[eBP],09BH ; FWAIT. MOV ENV_Call8087Inst[eBP],CX ; 8087 instruction. MOV BYTE PTR ENV_CallLongRet[eBP],0CBH ; Intra segment return. CALL DWORD PTR ENV_CallOffset[eBP] ; Reexecute instruction. ifdef WINDOWS mov bx, __WINFLAGS test bx, WF_PMODE jz ReExecuteRestoreRet push es ; if in PMODE, free alias ; push ax ; CHICAGO needs 32-bit register saves ; push dx push eax ; for CHICAGO push ebx ; for CHICAGO push ecx ; for CHICAGO push edx ; for CHICAGO push ebp ; for CHICAGO push esi ; for CHICAGO push edi ; for CHICAGO push ENV_CallSegment[eBP] call FREESELECTOR ; pop dx ; CHICAGO needs 32-bit register restores ; pop ax pop edi ; for CHICAGO pop esi ; for CHICAGO pop ebp ; for CHICAGO pop edx ; for CHICAGO pop ecx ; for CHICAGO pop ebx ; for CHICAGO pop eax ; for CHICAGO pop es endif ;WINDOWS lab ReExecuteRestoreRet POP eBX POP eCX POP eSI POP eDI POP DS ifdef SQL_EMMT push ax ; free the ss alias because we always push [SSalias] ; get a new one for the SQL_EMMT os2call DOSFREESEG pop ax endif ;SQL_EMMT FSTSW [NewStatusWord] ; 8/18/84 GFW need proper DS set FWAIT OR AL,BYTE PTR [NewStatusWord] ; Include new with unhandled exceptions ifndef WINDOWS lab ReDo8087InstructionRet endif RET ProfEnd EXCEPT
boards/rfm69_sensor/mspgd-board.ads
ekoeppen/MSP430_Generic_Ada_Drivers
0
16500
<filename>boards/rfm69_sensor/mspgd-board.ads<gh_stars>0 with Interfaces; with Startup; with MSPGD.GPIO; use MSPGD.GPIO; with MSPGD.GPIO.Pin; with MSPGD.UART.Peripheral; with MSPGD.SPI.Peripheral; with MSPGD.Clock; use MSPGD.Clock; with MSPGD.Clock.Source; package MSPGD.Board is pragma Preelaborate; package Clock is new MSPGD.Clock.Source (Source => SMCLK, Input => DCO, Frequency => 8_000_000); package LED is new MSPGD.GPIO.Pin (Port => 2, Pin => 5, Direction => Output); package LED2 is new MSPGD.GPIO.Pin (Port => 1, Pin => 3, Direction => Output); package RX is new MSPGD.GPIO.Pin (Port => 1, Pin => 1, Alt_Func => Secondary); package TX is new MSPGD.GPIO.Pin (Port => 1, Pin => 2, Alt_Func => Secondary); package SCLK is new MSPGD.GPIO.Pin (Port => 1, Pin => 5, Alt_Func => Secondary); package MISO is new MSPGD.GPIO.Pin (Port => 1, Pin => 6, Alt_Func => Secondary); package MOSI is new MSPGD.GPIO.Pin (Port => 1, Pin => 7, Alt_Func => Secondary); package SSEL is new MSPGD.GPIO.Pin (Port => 2, Pin => 1, Direction => Output); package MODEM_RST is new MSPGD.GPIO.Pin (Port => 2, Pin => 0, Direction => Output); package IRQ is new MSPGD.GPIO.Pin (Port => 2, Pin => 2); package BUTTON is new MSPGD.GPIO.Pin (Port => 2, Pin => 7); package TEMP_NTC is new MSPGD.GPIO.Pin (Port => 1, Pin => 0); package TEMP_REF is new MSPGD.GPIO.Pin (Port => 1, Pin => 4); package UART is new MSPGD.UART.Peripheral (Speed => 9600, Clock => Clock); package SPI is new MSPGD.SPI.Peripheral (Module => MSPGD.SPI.USCI_B, Speed => 4_000_000, Clock => Clock); procedure Init; procedure Power_Up; procedure Power_Down; function Read_NTC return Unsigned_16; function Read_VCC return Unsigned_16; end MSPGD.Board;
codec/common/x86/deblock.asm
gpatil/openh264
1
27771
<gh_stars>1-10 ;*! ;* \copy ;* Copyright (c) 2009-2013, Cisco Systems ;* 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. ;* ;* 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. ;* ;* ;* deblock.asm ;* ;* Abstract ;* edge loop ;* ;* History ;* 08/07/2009 Created ;* ;* ;*************************************************************************/ %include "asm_inc.asm" ;******************************************************************************* ; Macros and other preprocessor constants ;******************************************************************************* SECTION .rodata align=16 ALIGN 16 FOUR_16B_SSE2: dw 4, 4, 4, 4, 4, 4, 4, 4 SECTION .text %ifdef WIN64 WELS_EXTERN DeblockLumaLt4V_ssse3 push rbp mov r11,[rsp + 16 + 20h] ; pTC PUSH_XMM 16 sub rsp,1B0h lea rbp,[rsp+20h] movd xmm4,r8d movd xmm2,r9d mov qword [rbp+180h],r12 mov r10,rcx movsxd r12,edx add edx,edx movsxd rdx,edx sub r10,r12 movsx r8d,byte [r11] pxor xmm3,xmm3 punpcklwd xmm2,xmm2 movaps [rbp+50h],xmm14 lea rax,[r12+r12*2] movdqa xmm14,[rdx+rcx] neg rax pshufd xmm0,xmm2,0 movd xmm2,r8d movsx edx,byte [r11+1] movsx r8d,byte [r11+2] movsx r11d,byte [r11+3] movaps [rbp+70h],xmm12 movd xmm1,edx movaps [rbp+80h],xmm11 movd xmm12,r8d movd xmm11,r11d movdqa xmm5, [rax+rcx] lea rax,[r12+r12] punpcklwd xmm12,xmm12 neg rax punpcklwd xmm11,xmm11 movaps [rbp],xmm8 movdqa xmm8, [r10] punpcklwd xmm2,xmm2 punpcklwd xmm1,xmm1 punpcklqdq xmm12,xmm12 punpcklqdq xmm11,xmm11 punpcklqdq xmm2,xmm2 punpcklqdq xmm1,xmm1 shufps xmm12,xmm11,88h movdqa xmm11,xmm8 movaps [rbp+30h],xmm9 movdqa xmm9,[rcx] shufps xmm2,xmm1,88h movdqa xmm1,xmm5 punpcklbw xmm11,xmm3 movaps [rbp+20h],xmm6 movaps [rbp+60h],xmm13 movdqa xmm13,xmm11 movaps [rbp+90h],xmm10 movdqa xmm10,xmm9 movdqa xmm6,[rax+rcx] punpcklbw xmm1,xmm3 movaps [rbp+0A0h],xmm12 psubw xmm13,xmm1 movaps [rbp+40h],xmm15 movdqa xmm15,xmm14 movaps [rbp+10h],xmm7 movdqa xmm7,xmm6 punpcklbw xmm10,xmm3 movdqa xmm12,[r12+rcx] punpcklbw xmm7,xmm3 punpcklbw xmm12,xmm3 punpcklbw xmm15,xmm3 pabsw xmm3,xmm13 movdqa xmm13,xmm10 psubw xmm13,xmm15 movdqa [rbp+0F0h],xmm15 pabsw xmm15,xmm13 movdqa xmm13,xmm11 movdqa [rbp+0B0h],xmm1 movdqa xmm1,xmm0 pavgw xmm13,xmm10 pcmpgtw xmm1,xmm3 movdqa [rbp+120h],xmm13 movaps xmm13,xmm2 punpcklwd xmm4,xmm4 movdqa xmm3,xmm0 movdqa [rbp+100h],xmm1 psubw xmm13,xmm1 movdqa xmm1,xmm10 pcmpgtw xmm3,xmm15 pshufd xmm4,xmm4,0 psubw xmm1,xmm11 movdqa [rbp+0D0h],xmm10 psubw xmm13,xmm3 movdqa [rbp+110h],xmm3 pabsw xmm15,xmm1 movdqa xmm3,xmm4 psubw xmm10,xmm12 pcmpgtw xmm3,xmm15 pabsw xmm15,xmm10 movdqa xmm10,xmm0 psllw xmm1,2 movdqa [rbp+0C0h],xmm11 psubw xmm11,xmm7 pcmpgtw xmm10,xmm15 pabsw xmm11,xmm11 movdqa xmm15,xmm0 pand xmm3,xmm10 pcmpgtw xmm15,xmm11 movaps xmm11,xmm2 pxor xmm10,xmm10 pand xmm3,xmm15 pcmpgtw xmm11,xmm10 pcmpeqw xmm10,xmm2 por xmm11,xmm10 pand xmm3,xmm11 movdqa xmm11,xmm7 psubw xmm11,xmm12 pxor xmm15,xmm15 paddw xmm11,xmm1 psubw xmm15,xmm13 movdqa [rbp+0E0h],xmm12 paddw xmm11,[FOUR_16B_SSE2] pxor xmm12,xmm12 psraw xmm11,3 punpckhbw xmm8,xmm12 pmaxsw xmm15,xmm11 punpckhbw xmm5,xmm12 movdqa xmm11,xmm8 pminsw xmm13,xmm15 psubw xmm11,xmm5 punpckhbw xmm9,xmm12 pand xmm13,xmm3 movdqa [rbp+130h],xmm13 pabsw xmm13,xmm11 punpckhbw xmm14,xmm12 movdqa xmm11,xmm9 psubw xmm11,xmm14 movdqa xmm15,xmm0 movdqa [rbp+140h],xmm14 pabsw xmm14,xmm11 movdqa xmm11,xmm8 pcmpgtw xmm15,xmm14 movdqa xmm1,[r12+rcx] pavgw xmm11,xmm9 movdqa [rbp+170h],xmm11 movdqa xmm10,xmm9 punpckhbw xmm6,xmm12 psubw xmm10,xmm8 punpckhbw xmm1,xmm12 movdqa xmm12,xmm0 movaps xmm11,[rbp+0A0h] pcmpgtw xmm12,xmm13 movaps xmm13,xmm11 psubw xmm13,xmm12 movdqa [rbp+160h],xmm15 psubw xmm13,xmm15 movdqa xmm15,xmm9 psubw xmm15,xmm1 movdqa [rbp+150h],xmm12 pabsw xmm12,xmm10 pabsw xmm14,xmm15 movdqa xmm15,xmm8 pcmpgtw xmm4,xmm12 movdqa xmm12,xmm0 psubw xmm15,xmm6 pcmpgtw xmm12,xmm14 pabsw xmm14,xmm15 psllw xmm10,2 pcmpgtw xmm0,xmm14 movdqa xmm14,xmm6 psubw xmm14,xmm1 pand xmm4,xmm12 paddw xmm14,xmm10 pand xmm4,xmm0 paddw xmm14,[FOUR_16B_SSE2] pxor xmm15,xmm15 movaps xmm12,xmm11 psubw xmm15,xmm13 pxor xmm0,xmm0 psraw xmm14,3 pcmpgtw xmm12,xmm0 pcmpeqw xmm0,xmm11 pmaxsw xmm15,xmm14 por xmm12,xmm0 movdqa xmm0,[rbp+120h] pminsw xmm13,xmm15 movdqa xmm15,[rbp+0B0h] movdqa xmm10,xmm7 pand xmm4,xmm12 paddw xmm15,xmm0 pxor xmm12,xmm12 paddw xmm10,xmm7 movdqa xmm14,xmm12 psubw xmm15,xmm10 psubw xmm14,xmm2 psraw xmm15,1 pmaxsw xmm15,xmm14 movdqa xmm10,xmm6 pminsw xmm15,xmm2 paddw xmm10,xmm6 pand xmm15,xmm3 psubw xmm12,xmm11 pand xmm15,[rbp+100h] pand xmm13,xmm4 paddw xmm7,xmm15 paddw xmm8,xmm13 movdqa xmm15,[rbp+170h] psubw xmm9,xmm13 paddw xmm5,xmm15 psubw xmm5,xmm10 psraw xmm5,1 pmaxsw xmm5,xmm12 pminsw xmm5,xmm11 pand xmm5,xmm4 pand xmm5,[rbp+150h] paddw xmm6,xmm5 movdqa xmm5,[rbp+0C0h] packuswb xmm7,xmm6 movdqa xmm6,[rbp+130h] paddw xmm5,xmm6 packuswb xmm5,xmm8 movdqa xmm8,[rbp+0D0h] psubw xmm8,xmm6 movdqa xmm6,[rbp+0F0h] paddw xmm6,xmm0 movdqa xmm0,[rbp+0E0h] packuswb xmm8,xmm9 movdqa xmm9,xmm0 paddw xmm9,xmm0 psubw xmm6,xmm9 psraw xmm6,1 pmaxsw xmm14,xmm6 pminsw xmm2,xmm14 pand xmm2,xmm3 pand xmm2,[rbp+110h] paddw xmm0,xmm2 movdqa xmm2,[rbp+140h] paddw xmm2,xmm15 movdqa xmm15,xmm1 paddw xmm15,xmm1 psubw xmm2,xmm15 psraw xmm2,1 pmaxsw xmm12,xmm2 pminsw xmm11,xmm12 pand xmm11,xmm4 pand xmm11,[rbp+160h] paddw xmm1,xmm11 movdqa [rax+rcx],xmm7 movdqa [r10],xmm5 packuswb xmm0,xmm1 movdqa [rcx],xmm8 movdqa [r12+rcx],xmm0 mov r12,qword [rbp+180h] lea rsp,[rbp+190h] POP_XMM pop rbp ret WELS_EXTERN DeblockLumaEq4V_ssse3 mov rax,rsp push rbx push rbp push rsi push rdi sub rsp,1D8h movaps [rax-38h],xmm6 movaps [rax-48h],xmm7 movaps [rax-58h],xmm8 pxor xmm1,xmm1 movsxd r10,edx mov rbp,rcx mov r11d,r8d mov rdx,rcx mov rdi,rbp mov rbx,rbp movdqa xmm5,[rbp] movaps [rax-68h],xmm9 movaps [rax-78h],xmm10 punpcklbw xmm5,xmm1 movaps [rax-88h],xmm11 movaps [rax-98h],xmm12 movaps [rax-0A8h],xmm13 movaps [rax-0B8h],xmm14 movdqa xmm14,[r10+rbp] movaps [rax-0C8h],xmm15 lea eax,[r10*4] movsxd r8,eax lea eax,[r10+r10*2] movsxd rcx,eax lea eax,[r10+r10] sub rdx,r8 punpcklbw xmm14,xmm1 movdqa [rsp+90h],xmm5 movdqa [rsp+30h],xmm14 movsxd rsi,eax movsx eax,r11w sub rdi,rcx sub rbx,rsi mov r8,rbp sub r8,r10 movd xmm0,eax movsx eax,r9w movdqa xmm12,[rdi] movdqa xmm6, [rsi+rbp] movdqa xmm13,[rbx] punpcklwd xmm0,xmm0 pshufd xmm11,xmm0,0 punpcklbw xmm13,xmm1 punpcklbw xmm6,xmm1 movdqa xmm8,[r8] movd xmm0,eax movdqa xmm10,xmm11 mov eax,2 punpcklbw xmm8,xmm1 punpcklbw xmm12,xmm1 cwde punpcklwd xmm0,xmm0 psraw xmm10,2 movdqa xmm1,xmm8 movdqa [rsp+0F0h],xmm13 movdqa [rsp+0B0h],xmm8 pshufd xmm7,xmm0,0 psubw xmm1,xmm13 movdqa xmm0,xmm5 movdqa xmm4,xmm7 movdqa xmm2,xmm7 psubw xmm0,xmm8 pabsw xmm3,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm5 movdqa [rsp+40h],xmm7 movdqa [rsp+60h],xmm6 pcmpgtw xmm4,xmm0 psubw xmm1,xmm14 pabsw xmm0,xmm1 pcmpgtw xmm2,xmm0 pand xmm4,xmm2 movdqa xmm0,xmm11 pcmpgtw xmm0,xmm3 pand xmm4,xmm0 movd xmm0,eax movdqa [rsp+20h],xmm4 punpcklwd xmm0,xmm0 pshufd xmm2,xmm0,0 paddw xmm10,xmm2 movdqa [rsp+0A0h],xmm2 movdqa xmm15,xmm7 pxor xmm4,xmm4 movdqa xmm0,xmm8 psubw xmm0,xmm12 mov eax,4 pabsw xmm0,xmm0 movdqa xmm1,xmm10 cwde pcmpgtw xmm15,xmm0 pcmpgtw xmm1,xmm3 movdqa xmm3,xmm7 movdqa xmm7,[rdx] movdqa xmm0,xmm5 psubw xmm0,xmm6 pand xmm15,xmm1 punpcklbw xmm7,xmm4 movdqa xmm9,xmm15 pabsw xmm0,xmm0 psllw xmm7,1 pandn xmm9,xmm12 pcmpgtw xmm3,xmm0 paddw xmm7,xmm12 movd xmm0,eax pand xmm3,xmm1 paddw xmm7,xmm12 punpcklwd xmm0,xmm0 paddw xmm7,xmm12 pshufd xmm1,xmm0,0 paddw xmm7,xmm13 movdqa xmm0,xmm3 pandn xmm0,xmm6 paddw xmm7,xmm8 movdqa [rsp+70h],xmm1 paddw xmm7,xmm5 movdqa [rsp+120h],xmm0 movdqa xmm0,[rcx+rbp] punpcklbw xmm0,xmm4 paddw xmm7,xmm1 movdqa xmm4,xmm15 psllw xmm0,1 psraw xmm7,3 paddw xmm0,xmm6 pand xmm7,xmm15 paddw xmm0,xmm6 paddw xmm0,xmm6 paddw xmm0,xmm14 movdqa xmm6,xmm15 paddw xmm0,xmm5 pandn xmm6,xmm13 paddw xmm0,xmm8 paddw xmm0,xmm1 psraw xmm0,3 movdqa xmm1,xmm12 paddw xmm1,xmm13 pand xmm0,xmm3 movdqa [rsp+100h],xmm0 movdqa xmm0,xmm8 paddw xmm0,xmm5 paddw xmm1,xmm0 movdqa xmm0,xmm3 paddw xmm1,xmm2 psraw xmm1,2 pandn xmm0,xmm14 pand xmm4,xmm1 movdqa [rsp+0E0h],xmm0 movdqa xmm0,xmm5 paddw xmm0,xmm8 movdqa xmm1,[rsp+60h] paddw xmm1,xmm14 movdqa xmm14,xmm3 paddw xmm1,xmm0 movdqa xmm0,xmm8 paddw xmm0,[rsp+30h] paddw xmm1,xmm2 psraw xmm1,2 pand xmm14,xmm1 movdqa xmm1,xmm13 paddw xmm1,xmm13 paddw xmm1,xmm0 paddw xmm1,xmm2 psraw xmm1,2 movdqa xmm0,[rsp+30h] movdqa xmm2,xmm13 movdqa xmm5,xmm15 paddw xmm0,[rsp+70h] pandn xmm5,xmm1 paddw xmm2,xmm8 movdqa xmm8,[rsp+90h] movdqa xmm1,xmm12 paddw xmm2,xmm8 psllw xmm2,1 paddw xmm2,xmm0 paddw xmm1,xmm2 movdqa xmm0,xmm8 movdqa xmm8,xmm3 movdqa xmm2,[rsp+30h] paddw xmm0,xmm13 psraw xmm1,3 pand xmm15,xmm1 movdqa xmm1,xmm2 paddw xmm1,xmm2 paddw xmm2,[rsp+90h] paddw xmm2,[rsp+0B0h] paddw xmm1,xmm0 movdqa xmm0,xmm13 movdqa xmm13,[r8] paddw xmm0, [rsp+70h] paddw xmm1, [rsp+0A0h] psllw xmm2,1 paddw xmm2,xmm0 psraw xmm1,2 movdqa xmm0, [rdi] pandn xmm8,xmm1 movdqa xmm1, [rsp+60h] paddw xmm1,xmm2 movdqa xmm2, [rbx] psraw xmm1,3 pand xmm3,xmm1 movdqa xmm1, [rbp] movdqa [rsp+0D0h],xmm3 pxor xmm3,xmm3 punpckhbw xmm0,xmm3 punpckhbw xmm1,xmm3 punpckhbw xmm13,xmm3 movdqa [rsp+0C0h],xmm0 movdqa xmm0,[r10+rbp] movdqa [rsp],xmm1 punpckhbw xmm0,xmm3 punpckhbw xmm2,xmm3 movdqa [rsp+80h],xmm0 movdqa xmm0,[rsi+rbp] movdqa [rsp+10h],xmm13 punpckhbw xmm0,xmm3 movdqa [rsp+50h],xmm0 movdqa xmm0,xmm1 movdqa xmm1,xmm13 psubw xmm0,xmm13 psubw xmm1,xmm2 pabsw xmm3,xmm0 pabsw xmm0,xmm1 movdqa xmm1,[rsp] movdqa xmm13,[rsp+40h] movdqa [rsp+110h],xmm2 psubw xmm1, [rsp+80h] pcmpgtw xmm13,xmm0 pcmpgtw xmm11,xmm3 pabsw xmm0,xmm1 pcmpgtw xmm10,xmm3 movdqa xmm1, [rsp+40h] movdqa xmm2,xmm1 movdqa xmm3,xmm1 pcmpgtw xmm2,xmm0 movdqa xmm0, [rsp+10h] pand xmm13,xmm2 pand xmm13,xmm11 movdqa xmm11,[rsp+0C0h] psubw xmm0,xmm11 pabsw xmm0,xmm0 pcmpgtw xmm3,xmm0 pand xmm3,xmm10 movdqa xmm0,[rsp] psubw xmm0,[rsp+50h] movdqa xmm2,[rdx] pabsw xmm0,xmm0 por xmm7,xmm9 movdqa xmm9,[rsp+20h] pcmpgtw xmm1,xmm0 pand xmm9,xmm7 movdqa xmm7,[rsp+20h] movdqa xmm0,xmm7 pandn xmm0,xmm12 movdqa xmm12,[rsp+110h] pand xmm1,xmm10 movdqa xmm10,[rsp+70h] movdqa [rsp+40h],xmm1 movdqa xmm1,xmm13 por xmm9,xmm0 pxor xmm0,xmm0 por xmm4,xmm6 movdqa xmm6,xmm7 punpckhbw xmm2,xmm0 por xmm15,xmm5 movdqa xmm5,[rsp+20h] movdqa xmm0,xmm3 psllw xmm2,1 pandn xmm0,xmm11 pand xmm6,xmm4 movdqa xmm4,[rsp] paddw xmm2,xmm11 pand xmm5,xmm15 movdqa xmm15,[rsp+20h] paddw xmm2,xmm11 paddw xmm2,xmm11 paddw xmm2,xmm12 paddw xmm2,[rsp+10h] paddw xmm2,[rsp] paddw xmm2,xmm10 psraw xmm2,3 pand xmm2,xmm3 por xmm2,xmm0 pand xmm1,xmm2 movdqa xmm0,xmm13 movdqa xmm2,xmm11 pandn xmm0,xmm11 paddw xmm2,xmm12 por xmm1,xmm0 packuswb xmm9,xmm1 movdqa xmm0,xmm7 movdqa xmm7,[rsp+0A0h] pandn xmm0,[rsp+0F0h] movdqa xmm1,xmm3 por xmm6,xmm0 movdqa xmm0,[rsp+10h] paddw xmm0,xmm4 paddw xmm2,xmm0 paddw xmm2,xmm7 movdqa xmm0,xmm3 pandn xmm0,xmm12 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 movdqa xmm2,xmm13 movdqa xmm0,xmm13 pand xmm2,xmm1 pandn xmm0,xmm12 movdqa xmm1,xmm12 paddw xmm1,[rsp+10h] por xmm2,xmm0 movdqa xmm0,xmm15 pandn xmm0,[rsp+0B0h] paddw xmm1,xmm4 packuswb xmm6,xmm2 movdqa xmm2,xmm3 psllw xmm1,1 por xmm5,xmm0 movdqa xmm0,[rsp+80h] paddw xmm0,xmm10 paddw xmm1,xmm0 paddw xmm11,xmm1 psraw xmm11,3 movdqa xmm1,xmm12 pand xmm2,xmm11 paddw xmm1,xmm12 movdqa xmm11,[rsp+80h] movdqa xmm0, [rsp+10h] por xmm14,[rsp+0E0h] paddw xmm0,xmm11 movdqa xmm4,xmm15 paddw xmm1,xmm0 movdqa xmm0,xmm13 paddw xmm1,xmm7 psraw xmm1,2 pandn xmm3,xmm1 por xmm2,xmm3 movdqa xmm1,xmm13 movdqa xmm3,[rsp+10h] pandn xmm0,xmm3 pand xmm1,xmm2 movdqa xmm2,xmm11 paddw xmm2,[rsp] por xmm1,xmm0 movdqa xmm0,[rsp+0D0h] por xmm0,xmm8 paddw xmm2,xmm3 packuswb xmm5,xmm1 movdqa xmm8,[rsp+40h] movdqa xmm1,[rsp+50h] movdqa xmm3,xmm8 pand xmm4,xmm0 psllw xmm2,1 movdqa xmm0,xmm15 pandn xmm0,[rsp+90h] por xmm4,xmm0 movdqa xmm0,xmm12 paddw xmm0,xmm10 paddw xmm2,xmm0 paddw xmm1,xmm2 movdqa xmm0,[rsp] movdqa xmm2,xmm11 paddw xmm0,xmm12 movdqa xmm12,[rsp] paddw xmm2,xmm11 paddw xmm2,xmm0 psraw xmm1,3 movdqa xmm0,xmm8 pand xmm3,xmm1 paddw xmm2,xmm7 movdqa xmm1,xmm13 psraw xmm2,2 pandn xmm0,xmm2 por xmm3,xmm0 movdqa xmm2,[rsp+50h] movdqa xmm0,xmm13 pandn xmm0,xmm12 pand xmm1,xmm3 paddw xmm2,xmm11 movdqa xmm3,xmm15 por xmm1,xmm0 pand xmm3,xmm14 movdqa xmm14,[rsp+10h] movdqa xmm0,xmm15 pandn xmm0,[rsp+30h] packuswb xmm4,xmm1 movdqa xmm1,xmm8 por xmm3,xmm0 movdqa xmm0,xmm12 paddw xmm0,xmm14 paddw xmm2,xmm0 paddw xmm2,xmm7 movdqa xmm0,xmm8 pandn xmm0,xmm11 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 movdqa xmm2,xmm13 movdqa xmm0,xmm13 pandn xmm0,xmm11 pand xmm2,xmm1 movdqa xmm1,xmm15 por xmm2,xmm0 packuswb xmm3,xmm2 movdqa xmm0,[rsp+100h] por xmm0,[rsp+120h] pand xmm1,xmm0 movdqa xmm2,[rcx+rbp] movdqa xmm7,[rsp+50h] pandn xmm15,[rsp+60h] lea r11,[rsp+1D8h] pxor xmm0,xmm0 por xmm1,xmm15 movaps xmm15,[r11-0A8h] movdqa [rdi],xmm9 movaps xmm9,[r11-48h] punpckhbw xmm2,xmm0 psllw xmm2,1 paddw xmm2,xmm7 paddw xmm2,xmm7 movdqa [rbx],xmm6 movaps xmm6,[r11-18h] paddw xmm2,xmm7 paddw xmm2,xmm11 movaps xmm11,[r11-68h] paddw xmm2,xmm12 movaps xmm12,[r11-78h] paddw xmm2,xmm14 paddw xmm2,xmm10 psraw xmm2,3 movaps xmm10,[r11-58h] movaps xmm14,[r11-98h] movdqa xmm0,xmm13 pand xmm2,xmm8 pandn xmm8,xmm7 pandn xmm13,xmm7 por xmm2,xmm8 movaps xmm7,[r11-28h] movaps xmm8,[r11-38h] movdqa [r8],xmm5 pand xmm0,xmm2 por xmm0,xmm13 packuswb xmm1,xmm0 movaps xmm13,[r11-88h] movdqa [rbp],xmm4 movdqa [r10+rbp],xmm3 movdqa [rsi+rbp],xmm1 mov rsp,r11 pop rdi pop rsi pop rbp pop rbx ret WELS_EXTERN DeblockChromaLt4V_ssse3 mov rax,rsp push rbx push rdi PUSH_XMM 16 sub rsp,0C8h mov r10,qword [rax + 30h] ; pTC pxor xmm1,xmm1 mov rbx,rcx movsxd r11,r8d movsx ecx,byte [r10] movsx r8d,byte [r10+2] mov rdi,rdx movq xmm2,[rbx] movq xmm9,[r11+rbx] movsx edx,byte [r10+1] mov word [rsp+2],cx mov word [rsp],cx movsx eax,byte [r10+3] mov word [rsp+6],dx mov word [rsp+4],dx movdqa xmm11,xmm1 mov word [rsp+0Eh],ax mov word [rsp+0Ch],ax lea eax,[r11+r11] movsxd rcx,eax mov rax,rbx mov rdx,rdi sub rax,rcx mov word [rsp+0Ah],r8w mov word [rsp+8],r8w movdqa xmm6,[rsp] movdqa xmm7,xmm6 movq xmm13, [rax] mov rax,rdi sub rax,rcx mov rcx,rbx pcmpgtw xmm7,xmm1 psubw xmm11,xmm6 sub rcx,r11 sub rdx,r11 movq xmm0,[rax] movsx eax,r9w movq xmm15,[rcx] punpcklqdq xmm13,xmm0 movq xmm0, [rdx] movdqa xmm4,xmm13 punpcklqdq xmm15,xmm0 movq xmm0, [rdi] punpcklbw xmm4,xmm1 movdqa xmm12,xmm15 punpcklqdq xmm2,xmm0 movq xmm0, [r11+rdi] punpcklbw xmm12,xmm1 movdqa xmm14,xmm2 punpcklqdq xmm9,xmm0 punpckhbw xmm2,xmm1 punpcklbw xmm14,xmm1 movd xmm0,eax movsx eax,word [rsp + 0C8h + 38h + 160] ; iBeta punpckhbw xmm13,xmm1 punpckhbw xmm15,xmm1 movdqa xmm3,xmm9 movdqa [rsp+10h],xmm2 punpcklwd xmm0,xmm0 punpckhbw xmm9,xmm1 punpcklbw xmm3,xmm1 movdqa xmm1,xmm14 pshufd xmm10,xmm0,0 movd xmm0,eax mov eax,4 cwde punpcklwd xmm0,xmm0 pshufd xmm8,xmm0,0 movd xmm0,eax punpcklwd xmm0,xmm0 pshufd xmm5,xmm0,0 psubw xmm1,xmm12 movdqa xmm2,xmm10 lea r11,[rsp+0C8h] psllw xmm1,2 movdqa xmm0,xmm4 psubw xmm4,xmm12 psubw xmm0,xmm3 psubw xmm3,xmm14 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm11 psraw xmm1,3 pmaxsw xmm0,xmm1 pminsw xmm6,xmm0 movdqa xmm1,xmm8 movdqa xmm0,xmm12 psubw xmm0,xmm14 pabsw xmm0,xmm0 pcmpgtw xmm2,xmm0 pabsw xmm0,xmm4 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm3 movdqa xmm3,[rsp] pand xmm2,xmm1 movdqa xmm1,xmm8 pcmpgtw xmm1,xmm0 movdqa xmm0,xmm13 pand xmm2,xmm1 psubw xmm0,xmm9 psubw xmm13,xmm15 pand xmm2,xmm7 pand xmm6,xmm2 paddw xmm12,xmm6 psubw xmm14,xmm6 movdqa xmm2,[rsp+10h] movaps xmm6,[r11-18h] movdqa xmm1,xmm2 psubw xmm1,xmm15 psubw xmm9,xmm2 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm15 psubw xmm0,xmm2 psraw xmm1,3 pmaxsw xmm11,xmm1 pabsw xmm0,xmm0 movdqa xmm1,xmm8 pcmpgtw xmm10,xmm0 pabsw xmm0,xmm13 pminsw xmm3,xmm11 movaps xmm11,[r11-68h] movaps xmm13,[rsp+40h] pcmpgtw xmm1,xmm0 pabsw xmm0,xmm9 movaps xmm9, [r11-48h] pand xmm10,xmm1 pcmpgtw xmm8,xmm0 pand xmm10,xmm8 pand xmm10,xmm7 movaps xmm8,[r11-38h] movaps xmm7,[r11-28h] pand xmm3,xmm10 paddw xmm15,xmm3 psubw xmm2,xmm3 movaps xmm10,[r11-58h] packuswb xmm12,xmm15 movaps xmm15,[rsp+20h] packuswb xmm14,xmm2 movq [rcx],xmm12 movq [rbx],xmm14 psrldq xmm12,8 psrldq xmm14,8 movq [rdx],xmm12 movaps xmm12,[r11-78h] movq [rdi],xmm14 movaps xmm14,[rsp+30h] mov rsp,r11 POP_XMM pop rdi pop rbx ret WELS_EXTERN DeblockChromaEq4V_ssse3 mov rax,rsp push rbx PUSH_XMM 15 sub rsp,90h pxor xmm1,xmm1 mov r11,rcx mov rbx,rdx mov r10d,r9d movq xmm13,[r11] lea eax,[r8+r8] movsxd r9,eax mov rax,rcx sub rax,r9 movq xmm14,[rax] mov rax,rdx sub rax,r9 movq xmm0,[rax] movsxd rax,r8d sub rcx,rax sub rdx,rax movq xmm12,[rax+r11] movq xmm10,[rcx] punpcklqdq xmm14,xmm0 movdqa xmm8,xmm14 movq xmm0,[rdx] punpcklbw xmm8,xmm1 punpckhbw xmm14,xmm1 punpcklqdq xmm10,xmm0 movq xmm0,[rbx] movdqa xmm5,xmm10 punpcklqdq xmm13,xmm0 movq xmm0, [rax+rbx] punpcklbw xmm5,xmm1 movsx eax,r10w movdqa xmm9,xmm13 punpcklqdq xmm12,xmm0 punpcklbw xmm9,xmm1 punpckhbw xmm10,xmm1 movd xmm0,eax movsx eax,word [rsp + 90h + 8h + 28h + 144] ; iBeta punpckhbw xmm13,xmm1 movdqa xmm7,xmm12 punpcklwd xmm0,xmm0 punpckhbw xmm12,xmm1 pshufd xmm11,xmm0,0 punpcklbw xmm7,xmm1 movd xmm0,eax movdqa xmm1,xmm8 psubw xmm1,xmm5 punpcklwd xmm0,xmm0 movdqa xmm6,xmm11 pshufd xmm3,xmm0,0 movdqa xmm0,xmm5 psubw xmm0,xmm9 movdqa xmm2,xmm3 pabsw xmm0,xmm0 pcmpgtw xmm6,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm3 pcmpgtw xmm2,xmm0 pand xmm6,xmm2 movdqa xmm0,xmm7 movdqa xmm2,xmm3 psubw xmm0,xmm9 pabsw xmm0,xmm0 pcmpgtw xmm1,xmm0 pand xmm6,xmm1 movdqa xmm0,xmm10 movdqa xmm1,xmm14 psubw xmm0,xmm13 psubw xmm1,xmm10 pabsw xmm0,xmm0 pcmpgtw xmm11,xmm0 pabsw xmm0,xmm1 pcmpgtw xmm2,xmm0 pand xmm11,xmm2 movdqa xmm0,xmm12 movdqa xmm4,xmm6 movdqa xmm1,xmm8 mov eax,2 cwde paddw xmm1,xmm8 psubw xmm0,xmm13 paddw xmm1,xmm5 pabsw xmm0,xmm0 movdqa xmm2,xmm14 paddw xmm1,xmm7 pcmpgtw xmm3,xmm0 paddw xmm2,xmm14 movd xmm0,eax pand xmm11,xmm3 paddw xmm7,xmm7 paddw xmm2,xmm10 punpcklwd xmm0,xmm0 paddw xmm2,xmm12 paddw xmm12,xmm12 pshufd xmm3,xmm0,0 paddw xmm7,xmm9 paddw xmm12,xmm13 movdqa xmm0,xmm6 paddw xmm1,xmm3 pandn xmm0,xmm5 paddw xmm7,xmm8 psraw xmm1,2 paddw xmm12,xmm14 paddw xmm7,xmm3 movaps xmm14,[rsp] pand xmm4,xmm1 paddw xmm12,xmm3 psraw xmm7,2 movdqa xmm1,xmm11 por xmm4,xmm0 psraw xmm12,2 paddw xmm2,xmm3 movdqa xmm0,xmm11 pandn xmm0,xmm10 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 packuswb xmm4,xmm1 movdqa xmm0,xmm11 movdqa xmm1,xmm6 pand xmm1,xmm7 movaps xmm7,[rsp+70h] movq [rcx],xmm4 pandn xmm6,xmm9 pandn xmm11,xmm13 pand xmm0,xmm12 por xmm1,xmm6 por xmm0,xmm11 psrldq xmm4,8 packuswb xmm1,xmm0 movq [r11],xmm1 psrldq xmm1,8 movq [rdx],xmm4 lea r11,[rsp+90h] movaps xmm6,[r11-10h] movaps xmm8,[r11-30h] movaps xmm9,[r11-40h] movq [rbx],xmm1 movaps xmm10,[r11-50h] movaps xmm11,[r11-60h] movaps xmm12,[r11-70h] movaps xmm13,[r11-80h] mov rsp,r11 POP_XMM pop rbx ret WELS_EXTERN DeblockChromaEq4H_ssse3 mov rax,rsp mov [rax+20h],rbx push rdi PUSH_XMM 16 sub rsp,140h mov rdi,rdx lea eax,[r8*4] movsxd r10,eax mov eax,[rcx-2] mov [rsp+10h],eax lea rbx,[r10+rdx-2] lea r11,[r10+rcx-2] movdqa xmm5,[rsp+10h] movsxd r10,r8d mov eax,[r10+rcx-2] lea rdx,[r10+r10*2] mov [rsp+20h],eax mov eax,[rcx+r10*2-2] mov [rsp+30h],eax mov eax,[rdx+rcx-2] movdqa xmm2,[rsp+20h] mov [rsp+40h],eax mov eax, [rdi-2] movdqa xmm4,[rsp+30h] mov [rsp+50h],eax mov eax,[r10+rdi-2] movdqa xmm3,[rsp+40h] mov [rsp+60h],eax mov eax,[rdi+r10*2-2] punpckldq xmm5,[rsp+50h] mov [rsp+70h],eax mov eax, [rdx+rdi-2] punpckldq xmm2, [rsp+60h] mov [rsp+80h],eax mov eax,[r11] punpckldq xmm4, [rsp+70h] mov [rsp+50h],eax mov eax,[rbx] punpckldq xmm3,[rsp+80h] mov [rsp+60h],eax mov eax,[r10+r11] movdqa xmm0, [rsp+50h] punpckldq xmm0, [rsp+60h] punpcklqdq xmm5,xmm0 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax,[r10+rbx] movdqa xmm0,[rsp+50h] movdqa xmm1,xmm5 mov [rsp+60h],eax mov eax,[r11+r10*2] punpckldq xmm0, [rsp+60h] punpcklqdq xmm2,xmm0 punpcklbw xmm1,xmm2 punpckhbw xmm5,xmm2 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax,[rbx+r10*2] movdqa xmm0,[rsp+50h] mov [rsp+60h],eax mov eax, [rdx+r11] movdqa xmm15,xmm1 punpckldq xmm0,[rsp+60h] punpcklqdq xmm4,xmm0 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax, [rdx+rbx] movdqa xmm0,[rsp+50h] mov [rsp+60h],eax punpckldq xmm0, [rsp+60h] punpcklqdq xmm3,xmm0 movdqa xmm0,xmm4 punpcklbw xmm0,xmm3 punpckhbw xmm4,xmm3 punpcklwd xmm15,xmm0 punpckhwd xmm1,xmm0 movdqa xmm0,xmm5 movdqa xmm12,xmm15 punpcklwd xmm0,xmm4 punpckhwd xmm5,xmm4 punpckldq xmm12,xmm0 punpckhdq xmm15,xmm0 movdqa xmm0,xmm1 movdqa xmm11,xmm12 punpckldq xmm0,xmm5 punpckhdq xmm1,xmm5 punpcklqdq xmm11,xmm0 punpckhqdq xmm12,xmm0 movsx eax,r9w movdqa xmm14,xmm15 punpcklqdq xmm14,xmm1 punpckhqdq xmm15,xmm1 pxor xmm1,xmm1 movd xmm0,eax movdqa xmm4,xmm12 movdqa xmm8,xmm11 movsx eax,word [rsp+170h + 160] ; iBeta punpcklwd xmm0,xmm0 punpcklbw xmm4,xmm1 punpckhbw xmm12,xmm1 movdqa xmm9,xmm14 movdqa xmm7,xmm15 movdqa xmm10,xmm15 pshufd xmm13,xmm0,0 punpcklbw xmm9,xmm1 punpckhbw xmm14,xmm1 movdqa xmm6,xmm13 movd xmm0,eax movdqa [rsp],xmm11 mov eax,2 cwde punpckhbw xmm11,xmm1 punpckhbw xmm10,xmm1 punpcklbw xmm7,xmm1 punpcklwd xmm0,xmm0 punpcklbw xmm8,xmm1 pshufd xmm3,xmm0,0 movdqa xmm1,xmm8 movdqa xmm0,xmm4 psubw xmm0,xmm9 psubw xmm1,xmm4 movdqa xmm2,xmm3 pabsw xmm0,xmm0 pcmpgtw xmm6,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm3 pcmpgtw xmm2,xmm0 pand xmm6,xmm2 movdqa xmm0,xmm7 movdqa xmm2,xmm3 psubw xmm0,xmm9 pabsw xmm0,xmm0 pcmpgtw xmm1,xmm0 pand xmm6,xmm1 movdqa xmm0,xmm12 movdqa xmm1,xmm11 psubw xmm0,xmm14 psubw xmm1,xmm12 movdqa xmm5,xmm6 pabsw xmm0,xmm0 pcmpgtw xmm13,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm8 pcmpgtw xmm2,xmm0 paddw xmm1,xmm8 movdqa xmm0,xmm10 pand xmm13,xmm2 psubw xmm0,xmm14 paddw xmm1,xmm4 movdqa xmm2,xmm11 pabsw xmm0,xmm0 paddw xmm2,xmm11 paddw xmm1,xmm7 pcmpgtw xmm3,xmm0 paddw xmm2,xmm12 movd xmm0,eax pand xmm13,xmm3 paddw xmm2,xmm10 punpcklwd xmm0,xmm0 pshufd xmm3,xmm0,0 movdqa xmm0,xmm6 paddw xmm1,xmm3 pandn xmm0,xmm4 paddw xmm2,xmm3 psraw xmm1,2 pand xmm5,xmm1 por xmm5,xmm0 paddw xmm7,xmm7 paddw xmm10,xmm10 psraw xmm2,2 movdqa xmm1,xmm13 movdqa xmm0,xmm13 pandn xmm0,xmm12 pand xmm1,xmm2 paddw xmm7,xmm9 por xmm1,xmm0 paddw xmm10,xmm14 paddw xmm7,xmm8 movdqa xmm0,xmm13 packuswb xmm5,xmm1 paddw xmm7,xmm3 paddw xmm10,xmm11 movdqa xmm1,xmm6 paddw xmm10,xmm3 pandn xmm6,xmm9 psraw xmm7,2 pand xmm1,xmm7 psraw xmm10,2 pandn xmm13,xmm14 pand xmm0,xmm10 por xmm1,xmm6 movdqa xmm6,[rsp] movdqa xmm4,xmm6 por xmm0,xmm13 punpcklbw xmm4,xmm5 punpckhbw xmm6,xmm5 movdqa xmm3,xmm4 packuswb xmm1,xmm0 movdqa xmm0,xmm1 punpckhbw xmm1,xmm15 punpcklbw xmm0,xmm15 punpcklwd xmm3,xmm0 punpckhwd xmm4,xmm0 movdqa xmm0,xmm6 movdqa xmm2,xmm3 punpcklwd xmm0,xmm1 punpckhwd xmm6,xmm1 movdqa xmm1,xmm4 punpckldq xmm2,xmm0 punpckhdq xmm3,xmm0 punpckldq xmm1,xmm6 movdqa xmm0,xmm2 punpcklqdq xmm0,xmm1 punpckhdq xmm4,xmm6 punpckhqdq xmm2,xmm1 movdqa [rsp+10h],xmm0 movdqa [rsp+60h],xmm2 movdqa xmm0,xmm3 mov eax,[rsp+10h] mov [rcx-2],eax mov eax,[rsp+60h] punpcklqdq xmm0,xmm4 punpckhqdq xmm3,xmm4 mov [r10+rcx-2],eax movdqa [rsp+20h],xmm0 mov eax, [rsp+20h] movdqa [rsp+70h],xmm3 mov [rcx+r10*2-2],eax mov eax,[rsp+70h] mov [rdx+rcx-2],eax mov eax,[rsp+18h] mov [r11],eax mov eax,[rsp+68h] mov [r10+r11],eax mov eax,[rsp+28h] mov [r11+r10*2],eax mov eax,[rsp+78h] mov [rdx+r11],eax mov eax,[rsp+14h] mov [rdi-2],eax mov eax,[rsp+64h] mov [r10+rdi-2],eax mov eax,[rsp+24h] mov [rdi+r10*2-2],eax mov eax, [rsp+74h] mov [rdx+rdi-2],eax mov eax, [rsp+1Ch] mov [rbx],eax mov eax, [rsp+6Ch] mov [r10+rbx],eax mov eax,[rsp+2Ch] mov [rbx+r10*2],eax mov eax,[rsp+7Ch] mov [rdx+rbx],eax lea rsp,[rsp+140h] POP_XMM mov rbx, [rsp+28h] pop rdi ret WELS_EXTERN DeblockChromaLt4H_ssse3 mov rax,rsp push rbx push rbp push rsi push rdi push r12 PUSH_XMM 16 sub rsp,170h movsxd rsi,r8d lea eax,[r8*4] mov r11d,r9d movsxd r10,eax mov eax, [rcx-2] mov r12,rdx mov [rsp+40h],eax mov eax, [rsi+rcx-2] lea rbx,[r10+rcx-2] movdqa xmm5,[rsp+40h] mov [rsp+50h],eax mov eax, [rcx+rsi*2-2] lea rbp,[r10+rdx-2] movdqa xmm2, [rsp+50h] mov [rsp+60h],eax lea r10,[rsi+rsi*2] mov rdi,rcx mov eax,[r10+rcx-2] movdqa xmm4,[rsp+60h] mov [rsp+70h],eax mov eax,[rdx-2] mov [rsp+80h],eax mov eax, [rsi+rdx-2] movdqa xmm3,[rsp+70h] mov [rsp+90h],eax mov eax,[rdx+rsi*2-2] punpckldq xmm5,[rsp+80h] mov [rsp+0A0h],eax mov eax, [r10+rdx-2] punpckldq xmm2,[rsp+90h] mov [rsp+0B0h],eax mov eax, [rbx] punpckldq xmm4,[rsp+0A0h] mov [rsp+80h],eax mov eax,[rbp] punpckldq xmm3,[rsp+0B0h] mov [rsp+90h],eax mov eax,[rsi+rbx] movdqa xmm0,[rsp+80h] punpckldq xmm0,[rsp+90h] punpcklqdq xmm5,xmm0 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax,[rsi+rbp] movdqa xmm0,[rsp+80h] movdqa xmm1,xmm5 mov [rsp+90h],eax mov eax,[rbx+rsi*2] punpckldq xmm0,[rsp+90h] punpcklqdq xmm2,xmm0 punpcklbw xmm1,xmm2 punpckhbw xmm5,xmm2 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax,[rbp+rsi*2] movdqa xmm0, [rsp+80h] mov [rsp+90h],eax mov eax,[r10+rbx] movdqa xmm7,xmm1 punpckldq xmm0,[rsp+90h] punpcklqdq xmm4,xmm0 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax, [r10+rbp] movdqa xmm0,[rsp+80h] mov [rsp+90h],eax punpckldq xmm0,[rsp+90h] punpcklqdq xmm3,xmm0 movdqa xmm0,xmm4 punpcklbw xmm0,xmm3 punpckhbw xmm4,xmm3 punpcklwd xmm7,xmm0 punpckhwd xmm1,xmm0 movdqa xmm0,xmm5 movdqa xmm6,xmm7 punpcklwd xmm0,xmm4 punpckhwd xmm5,xmm4 punpckldq xmm6,xmm0 punpckhdq xmm7,xmm0 movdqa xmm0,xmm1 punpckldq xmm0,xmm5 mov rax, [rsp+1C8h+160] ; pTC punpckhdq xmm1,xmm5 movdqa xmm9,xmm6 punpckhqdq xmm6,xmm0 punpcklqdq xmm9,xmm0 movdqa xmm2,xmm7 movdqa xmm13,xmm6 movdqa xmm4,xmm9 movdqa [rsp+10h],xmm9 punpcklqdq xmm2,xmm1 punpckhqdq xmm7,xmm1 pxor xmm1,xmm1 movsx ecx,byte [rax+3] movsx edx,byte [rax+2] movsx r8d,byte [rax+1] movsx r9d,byte [rax] movdqa xmm10,xmm1 movdqa xmm15,xmm2 punpckhbw xmm2,xmm1 punpckhbw xmm6,xmm1 punpcklbw xmm4,xmm1 movsx eax,r11w mov word [rsp+0Eh],cx mov word [rsp+0Ch],cx movdqa xmm3,xmm7 movdqa xmm8,xmm7 movdqa [rsp+20h],xmm7 punpcklbw xmm15,xmm1 punpcklbw xmm13,xmm1 punpcklbw xmm3,xmm1 mov word [rsp+0Ah],dx mov word [rsp+8],dx mov word [rsp+6],r8w movd xmm0,eax movdqa [rsp+30h],xmm6 punpckhbw xmm9,xmm1 punpckhbw xmm8,xmm1 punpcklwd xmm0,xmm0 movsx eax,word [rsp+1C0h+160] ; iBeta mov word [rsp+4],r8w mov word [rsp+2],r9w pshufd xmm12,xmm0,0 mov word [rsp],r9w movd xmm0,eax mov eax,4 cwde movdqa xmm14, [rsp] movdqa [rsp],xmm2 movdqa xmm2,xmm12 punpcklwd xmm0,xmm0 pshufd xmm11,xmm0,0 psubw xmm10,xmm14 movd xmm0,eax movdqa xmm7,xmm14 movdqa xmm6,xmm14 pcmpgtw xmm7,xmm1 punpcklwd xmm0,xmm0 pshufd xmm5,xmm0,0 movdqa xmm0,xmm4 movdqa xmm1,xmm15 psubw xmm4,xmm13 psubw xmm0,xmm3 psubw xmm1,xmm13 psubw xmm3,xmm15 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm10 psraw xmm1,3 pmaxsw xmm0,xmm1 pminsw xmm6,xmm0 movdqa xmm1,xmm11 movdqa xmm0,xmm13 psubw xmm0,xmm15 pabsw xmm0,xmm0 pcmpgtw xmm2,xmm0 pabsw xmm0,xmm4 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm3 pand xmm2,xmm1 movdqa xmm1,xmm11 movdqa xmm3,[rsp+30h] pcmpgtw xmm1,xmm0 movdqa xmm0,xmm9 pand xmm2,xmm1 psubw xmm0,xmm8 psubw xmm9,xmm3 pand xmm2,xmm7 pand xmm6,xmm2 psubw xmm15,xmm6 paddw xmm13,xmm6 movdqa xmm2,[rsp] movdqa xmm1,xmm2 psubw xmm1,xmm3 psubw xmm8,xmm2 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm3 movdqa xmm5,[rsp+10h] psubw xmm0,xmm2 psraw xmm1,3 movdqa xmm4,xmm5 pabsw xmm0,xmm0 pmaxsw xmm10,xmm1 movdqa xmm1,xmm11 pcmpgtw xmm12,xmm0 pabsw xmm0,xmm9 pminsw xmm14,xmm10 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm8 pcmpgtw xmm11,xmm0 pand xmm12,xmm1 movdqa xmm1,[rsp+20h] pand xmm12,xmm11 pand xmm12,xmm7 pand xmm14,xmm12 paddw xmm3,xmm14 psubw xmm2,xmm14 packuswb xmm13,xmm3 packuswb xmm15,xmm2 punpcklbw xmm4,xmm13 punpckhbw xmm5,xmm13 movdqa xmm0,xmm15 punpcklbw xmm0,xmm1 punpckhbw xmm15,xmm1 movdqa xmm3,xmm4 punpcklwd xmm3,xmm0 punpckhwd xmm4,xmm0 movdqa xmm0,xmm5 movdqa xmm2,xmm3 movdqa xmm1,xmm4 punpcklwd xmm0,xmm15 punpckhwd xmm5,xmm15 punpckldq xmm2,xmm0 punpckhdq xmm3,xmm0 punpckldq xmm1,xmm5 movdqa xmm0,xmm2 punpcklqdq xmm0,xmm1 punpckhdq xmm4,xmm5 punpckhqdq xmm2,xmm1 movdqa [rsp+40h],xmm0 movdqa xmm0,xmm3 movdqa [rsp+90h],xmm2 mov eax,[rsp+40h] mov [rdi-2],eax mov eax, [rsp+90h] punpcklqdq xmm0,xmm4 punpckhqdq xmm3,xmm4 mov [rsi+rdi-2],eax movdqa [rsp+50h],xmm0 mov eax,[rsp+50h] movdqa [rsp+0A0h],xmm3 mov [rdi+rsi*2-2],eax mov eax,[rsp+0A0h] mov [r10+rdi-2],eax mov eax,[rsp+48h] mov [rbx],eax mov eax,[rsp+98h] mov [rsi+rbx],eax mov eax,[rsp+58h] mov [rbx+rsi*2],eax mov eax, [rsp+0A8h] mov [r10+rbx],eax mov eax, [rsp+44h] mov [r12-2],eax mov eax,[rsp+94h] mov [rsi+r12-2],eax mov eax,[rsp+54h] mov [r12+rsi*2-2],eax mov eax, [rsp+0A4h] mov [r10+r12-2],eax mov eax,[rsp+4Ch] mov [rbp],eax mov eax,[rsp+9Ch] mov [rsi+rbp],eax mov eax, [rsp+5Ch] mov [rbp+rsi*2],eax mov eax,[rsp+0ACh] mov [r10+rbp],eax lea r11,[rsp+170h] mov rsp,r11 POP_XMM pop r12 pop rdi pop rsi pop rbp pop rbx ret %elifdef UNIX64 WELS_EXTERN DeblockLumaLt4V_ssse3 push rbp mov r11,r8 ; pTC sub rsp,1B0h lea rbp,[rsp+20h] movd xmm4,edx movd xmm2,ecx mov qword [rbp+180h],r12 mov r10,rdi movsxd r12,esi add rsi,rsi movsxd rdx,esi sub r10,r12 movsx r8d,byte [r11] pxor xmm3,xmm3 punpcklwd xmm2,xmm2 movaps [rbp+50h],xmm14 lea rax,[r12+r12*2] movdqa xmm14,[rdx+rdi] neg rax pshufd xmm0,xmm2,0 movd xmm2,r8d movsx rsi,byte [r11+1] movsx r8d,byte [r11+2] movsx r11d,byte [r11+3] movaps [rbp+70h],xmm12 movd xmm1,esi movaps [rbp+80h],xmm11 movd xmm12,r8d movd xmm11,r11d movdqa xmm5, [rax+rdi] lea rax,[r12+r12] punpcklwd xmm12,xmm12 neg rax punpcklwd xmm11,xmm11 movaps [rbp],xmm8 movdqa xmm8, [r10] punpcklwd xmm2,xmm2 punpcklwd xmm1,xmm1 punpcklqdq xmm12,xmm12 punpcklqdq xmm11,xmm11 punpcklqdq xmm2,xmm2 punpcklqdq xmm1,xmm1 shufps xmm12,xmm11,88h movdqa xmm11,xmm8 movaps [rbp+30h],xmm9 movdqa xmm9,[rdi] shufps xmm2,xmm1,88h movdqa xmm1,xmm5 punpcklbw xmm11,xmm3 movaps [rbp+20h],xmm6 movaps [rbp+60h],xmm13 movdqa xmm13,xmm11 movaps [rbp+90h],xmm10 movdqa xmm10,xmm9 movdqa xmm6,[rax+rdi] punpcklbw xmm1,xmm3 movaps [rbp+0A0h],xmm12 psubw xmm13,xmm1 movaps [rbp+40h],xmm15 movdqa xmm15,xmm14 movaps [rbp+10h],xmm7 movdqa xmm7,xmm6 punpcklbw xmm10,xmm3 movdqa xmm12,[r12+rdi] punpcklbw xmm7,xmm3 punpcklbw xmm12,xmm3 punpcklbw xmm15,xmm3 pabsw xmm3,xmm13 movdqa xmm13,xmm10 psubw xmm13,xmm15 movdqa [rbp+0F0h],xmm15 pabsw xmm15,xmm13 movdqa xmm13,xmm11 movdqa [rbp+0B0h],xmm1 movdqa xmm1,xmm0 pavgw xmm13,xmm10 pcmpgtw xmm1,xmm3 movdqa [rbp+120h],xmm13 movaps xmm13,xmm2 punpcklwd xmm4,xmm4 movdqa xmm3,xmm0 movdqa [rbp+100h],xmm1 psubw xmm13,xmm1 movdqa xmm1,xmm10 pcmpgtw xmm3,xmm15 pshufd xmm4,xmm4,0 psubw xmm1,xmm11 movdqa [rbp+0D0h],xmm10 psubw xmm13,xmm3 movdqa [rbp+110h],xmm3 pabsw xmm15,xmm1 movdqa xmm3,xmm4 psubw xmm10,xmm12 pcmpgtw xmm3,xmm15 pabsw xmm15,xmm10 movdqa xmm10,xmm0 psllw xmm1,2 movdqa [rbp+0C0h],xmm11 psubw xmm11,xmm7 pcmpgtw xmm10,xmm15 pabsw xmm11,xmm11 movdqa xmm15,xmm0 pand xmm3,xmm10 pcmpgtw xmm15,xmm11 movaps xmm11,xmm2 pxor xmm10,xmm10 pand xmm3,xmm15 pcmpgtw xmm11,xmm10 pcmpeqw xmm10,xmm2 por xmm11,xmm10 pand xmm3,xmm11 movdqa xmm11,xmm7 psubw xmm11,xmm12 pxor xmm15,xmm15 paddw xmm11,xmm1 psubw xmm15,xmm13 movdqa [rbp+0E0h],xmm12 paddw xmm11,[FOUR_16B_SSE2] pxor xmm12,xmm12 psraw xmm11,3 punpckhbw xmm8,xmm12 pmaxsw xmm15,xmm11 punpckhbw xmm5,xmm12 movdqa xmm11,xmm8 pminsw xmm13,xmm15 psubw xmm11,xmm5 punpckhbw xmm9,xmm12 pand xmm13,xmm3 movdqa [rbp+130h],xmm13 pabsw xmm13,xmm11 punpckhbw xmm14,xmm12 movdqa xmm11,xmm9 psubw xmm11,xmm14 movdqa xmm15,xmm0 movdqa [rbp+140h],xmm14 pabsw xmm14,xmm11 movdqa xmm11,xmm8 pcmpgtw xmm15,xmm14 movdqa xmm1,[r12+rdi] pavgw xmm11,xmm9 movdqa [rbp+170h],xmm11 movdqa xmm10,xmm9 punpckhbw xmm6,xmm12 psubw xmm10,xmm8 punpckhbw xmm1,xmm12 movdqa xmm12,xmm0 movaps xmm11,[rbp+0A0h] pcmpgtw xmm12,xmm13 movaps xmm13,xmm11 psubw xmm13,xmm12 movdqa [rbp+160h],xmm15 psubw xmm13,xmm15 movdqa xmm15,xmm9 psubw xmm15,xmm1 movdqa [rbp+150h],xmm12 pabsw xmm12,xmm10 pabsw xmm14,xmm15 movdqa xmm15,xmm8 pcmpgtw xmm4,xmm12 movdqa xmm12,xmm0 psubw xmm15,xmm6 pcmpgtw xmm12,xmm14 pabsw xmm14,xmm15 psllw xmm10,2 pcmpgtw xmm0,xmm14 movdqa xmm14,xmm6 psubw xmm14,xmm1 pand xmm4,xmm12 paddw xmm14,xmm10 pand xmm4,xmm0 paddw xmm14,[FOUR_16B_SSE2] pxor xmm15,xmm15 movaps xmm12,xmm11 psubw xmm15,xmm13 pxor xmm0,xmm0 psraw xmm14,3 pcmpgtw xmm12,xmm0 pcmpeqw xmm0,xmm11 pmaxsw xmm15,xmm14 por xmm12,xmm0 movdqa xmm0,[rbp+120h] pminsw xmm13,xmm15 movdqa xmm15,[rbp+0B0h] movdqa xmm10,xmm7 pand xmm4,xmm12 paddw xmm15,xmm0 pxor xmm12,xmm12 paddw xmm10,xmm7 movdqa xmm14,xmm12 psubw xmm15,xmm10 psubw xmm14,xmm2 psraw xmm15,1 pmaxsw xmm15,xmm14 movdqa xmm10,xmm6 pminsw xmm15,xmm2 paddw xmm10,xmm6 pand xmm15,xmm3 psubw xmm12,xmm11 pand xmm15,[rbp+100h] pand xmm13,xmm4 paddw xmm7,xmm15 paddw xmm8,xmm13 movdqa xmm15,[rbp+170h] psubw xmm9,xmm13 paddw xmm5,xmm15 psubw xmm5,xmm10 psraw xmm5,1 pmaxsw xmm5,xmm12 pminsw xmm5,xmm11 pand xmm5,xmm4 pand xmm5,[rbp+150h] paddw xmm6,xmm5 movdqa xmm5,[rbp+0C0h] packuswb xmm7,xmm6 movdqa xmm6,[rbp+130h] paddw xmm5,xmm6 packuswb xmm5,xmm8 movdqa xmm8,[rbp+0D0h] psubw xmm8,xmm6 movdqa xmm6,[rbp+0F0h] paddw xmm6,xmm0 movdqa xmm0,[rbp+0E0h] packuswb xmm8,xmm9 movdqa xmm9,xmm0 paddw xmm9,xmm0 psubw xmm6,xmm9 psraw xmm6,1 pmaxsw xmm14,xmm6 pminsw xmm2,xmm14 pand xmm2,xmm3 pand xmm2,[rbp+110h] paddw xmm0,xmm2 movdqa xmm2,[rbp+140h] paddw xmm2,xmm15 movdqa xmm15,xmm1 paddw xmm15,xmm1 psubw xmm2,xmm15 psraw xmm2,1 pmaxsw xmm12,xmm2 pminsw xmm11,xmm12 pand xmm11,xmm4 pand xmm11,[rbp+160h] paddw xmm1,xmm11 movdqa [rax+rdi],xmm7 movdqa [r10],xmm5 packuswb xmm0,xmm1 movdqa [rdi],xmm8 movdqa [r12+rdi],xmm0 mov r12,qword [rbp+180h] lea rsp,[rbp+190h] pop rbp ret WELS_EXTERN DeblockLumaEq4V_ssse3 mov rax,rsp push rbx push rbp mov r8, rdx mov r9, rcx mov rcx, rdi mov rdx, rsi sub rsp,1D8h movaps [rax-38h],xmm6 movaps [rax-48h],xmm7 movaps [rax-58h],xmm8 pxor xmm1,xmm1 movsxd r10,edx mov rbp,rcx mov r11d,r8d mov rdx,rcx mov rdi,rbp mov rbx,rbp movdqa xmm5,[rbp] movaps [rax-68h],xmm9 movaps [rax-78h],xmm10 punpcklbw xmm5,xmm1 movaps [rax-88h],xmm11 movaps [rax-98h],xmm12 movaps [rax-0A8h],xmm13 movaps [rax-0B8h],xmm14 movdqa xmm14,[r10+rbp] movaps [rax-0C8h],xmm15 lea eax,[r10*4] movsxd r8,eax lea eax,[r10+r10*2] movsxd rcx,eax lea eax,[r10+r10] sub rdx,r8 punpcklbw xmm14,xmm1 movdqa [rsp+90h],xmm5 movdqa [rsp+30h],xmm14 movsxd rsi,eax movsx eax,r11w sub rdi,rcx sub rbx,rsi mov r8,rbp sub r8,r10 movd xmm0,eax movsx eax,r9w movdqa xmm12,[rdi] movdqa xmm6, [rsi+rbp] movdqa xmm13,[rbx] punpcklwd xmm0,xmm0 pshufd xmm11,xmm0,0 punpcklbw xmm13,xmm1 punpcklbw xmm6,xmm1 movdqa xmm8,[r8] movd xmm0,eax movdqa xmm10,xmm11 mov eax,2 punpcklbw xmm8,xmm1 punpcklbw xmm12,xmm1 cwde punpcklwd xmm0,xmm0 psraw xmm10,2 movdqa xmm1,xmm8 movdqa [rsp+0F0h],xmm13 movdqa [rsp+0B0h],xmm8 pshufd xmm7,xmm0,0 psubw xmm1,xmm13 movdqa xmm0,xmm5 movdqa xmm4,xmm7 movdqa xmm2,xmm7 psubw xmm0,xmm8 pabsw xmm3,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm5 movdqa [rsp+40h],xmm7 movdqa [rsp+60h],xmm6 pcmpgtw xmm4,xmm0 psubw xmm1,xmm14 pabsw xmm0,xmm1 pcmpgtw xmm2,xmm0 pand xmm4,xmm2 movdqa xmm0,xmm11 pcmpgtw xmm0,xmm3 pand xmm4,xmm0 movd xmm0,eax movdqa [rsp+20h],xmm4 punpcklwd xmm0,xmm0 pshufd xmm2,xmm0,0 paddw xmm10,xmm2 movdqa [rsp+0A0h],xmm2 movdqa xmm15,xmm7 pxor xmm4,xmm4 movdqa xmm0,xmm8 psubw xmm0,xmm12 mov eax,4 pabsw xmm0,xmm0 movdqa xmm1,xmm10 cwde pcmpgtw xmm15,xmm0 pcmpgtw xmm1,xmm3 movdqa xmm3,xmm7 movdqa xmm7,[rdx] movdqa xmm0,xmm5 psubw xmm0,xmm6 pand xmm15,xmm1 punpcklbw xmm7,xmm4 movdqa xmm9,xmm15 pabsw xmm0,xmm0 psllw xmm7,1 pandn xmm9,xmm12 pcmpgtw xmm3,xmm0 paddw xmm7,xmm12 movd xmm0,eax pand xmm3,xmm1 paddw xmm7,xmm12 punpcklwd xmm0,xmm0 paddw xmm7,xmm12 pshufd xmm1,xmm0,0 paddw xmm7,xmm13 movdqa xmm0,xmm3 pandn xmm0,xmm6 paddw xmm7,xmm8 movdqa [rsp+70h],xmm1 paddw xmm7,xmm5 movdqa [rsp+120h],xmm0 movdqa xmm0,[rcx+rbp] punpcklbw xmm0,xmm4 paddw xmm7,xmm1 movdqa xmm4,xmm15 psllw xmm0,1 psraw xmm7,3 paddw xmm0,xmm6 pand xmm7,xmm15 paddw xmm0,xmm6 paddw xmm0,xmm6 paddw xmm0,xmm14 movdqa xmm6,xmm15 paddw xmm0,xmm5 pandn xmm6,xmm13 paddw xmm0,xmm8 paddw xmm0,xmm1 psraw xmm0,3 movdqa xmm1,xmm12 paddw xmm1,xmm13 pand xmm0,xmm3 movdqa [rsp+100h],xmm0 movdqa xmm0,xmm8 paddw xmm0,xmm5 paddw xmm1,xmm0 movdqa xmm0,xmm3 paddw xmm1,xmm2 psraw xmm1,2 pandn xmm0,xmm14 pand xmm4,xmm1 movdqa [rsp+0E0h],xmm0 movdqa xmm0,xmm5 paddw xmm0,xmm8 movdqa xmm1,[rsp+60h] paddw xmm1,xmm14 movdqa xmm14,xmm3 paddw xmm1,xmm0 movdqa xmm0,xmm8 paddw xmm0,[rsp+30h] paddw xmm1,xmm2 psraw xmm1,2 pand xmm14,xmm1 movdqa xmm1,xmm13 paddw xmm1,xmm13 paddw xmm1,xmm0 paddw xmm1,xmm2 psraw xmm1,2 movdqa xmm0,[rsp+30h] movdqa xmm2,xmm13 movdqa xmm5,xmm15 paddw xmm0,[rsp+70h] pandn xmm5,xmm1 paddw xmm2,xmm8 movdqa xmm8,[rsp+90h] movdqa xmm1,xmm12 paddw xmm2,xmm8 psllw xmm2,1 paddw xmm2,xmm0 paddw xmm1,xmm2 movdqa xmm0,xmm8 movdqa xmm8,xmm3 movdqa xmm2,[rsp+30h] paddw xmm0,xmm13 psraw xmm1,3 pand xmm15,xmm1 movdqa xmm1,xmm2 paddw xmm1,xmm2 paddw xmm2,[rsp+90h] paddw xmm2,[rsp+0B0h] paddw xmm1,xmm0 movdqa xmm0,xmm13 movdqa xmm13,[r8] paddw xmm0, [rsp+70h] paddw xmm1, [rsp+0A0h] psllw xmm2,1 paddw xmm2,xmm0 psraw xmm1,2 movdqa xmm0, [rdi] pandn xmm8,xmm1 movdqa xmm1, [rsp+60h] paddw xmm1,xmm2 movdqa xmm2, [rbx] psraw xmm1,3 pand xmm3,xmm1 movdqa xmm1, [rbp] movdqa [rsp+0D0h],xmm3 pxor xmm3,xmm3 punpckhbw xmm0,xmm3 punpckhbw xmm1,xmm3 punpckhbw xmm13,xmm3 movdqa [rsp+0C0h],xmm0 movdqa xmm0,[r10+rbp] movdqa [rsp],xmm1 punpckhbw xmm0,xmm3 punpckhbw xmm2,xmm3 movdqa [rsp+80h],xmm0 movdqa xmm0,[rsi+rbp] movdqa [rsp+10h],xmm13 punpckhbw xmm0,xmm3 movdqa [rsp+50h],xmm0 movdqa xmm0,xmm1 movdqa xmm1,xmm13 psubw xmm0,xmm13 psubw xmm1,xmm2 pabsw xmm3,xmm0 pabsw xmm0,xmm1 movdqa xmm1,[rsp] movdqa xmm13,[rsp+40h] movdqa [rsp+110h],xmm2 psubw xmm1, [rsp+80h] pcmpgtw xmm13,xmm0 pcmpgtw xmm11,xmm3 pabsw xmm0,xmm1 pcmpgtw xmm10,xmm3 movdqa xmm1, [rsp+40h] movdqa xmm2,xmm1 movdqa xmm3,xmm1 pcmpgtw xmm2,xmm0 movdqa xmm0, [rsp+10h] pand xmm13,xmm2 pand xmm13,xmm11 movdqa xmm11,[rsp+0C0h] psubw xmm0,xmm11 pabsw xmm0,xmm0 pcmpgtw xmm3,xmm0 pand xmm3,xmm10 movdqa xmm0,[rsp] psubw xmm0,[rsp+50h] movdqa xmm2,[rdx] pabsw xmm0,xmm0 por xmm7,xmm9 movdqa xmm9,[rsp+20h] pcmpgtw xmm1,xmm0 pand xmm9,xmm7 movdqa xmm7,[rsp+20h] movdqa xmm0,xmm7 pandn xmm0,xmm12 movdqa xmm12,[rsp+110h] pand xmm1,xmm10 movdqa xmm10,[rsp+70h] movdqa [rsp+40h],xmm1 movdqa xmm1,xmm13 por xmm9,xmm0 pxor xmm0,xmm0 por xmm4,xmm6 movdqa xmm6,xmm7 punpckhbw xmm2,xmm0 por xmm15,xmm5 movdqa xmm5,[rsp+20h] movdqa xmm0,xmm3 psllw xmm2,1 pandn xmm0,xmm11 pand xmm6,xmm4 movdqa xmm4,[rsp] paddw xmm2,xmm11 pand xmm5,xmm15 movdqa xmm15,[rsp+20h] paddw xmm2,xmm11 paddw xmm2,xmm11 paddw xmm2,xmm12 paddw xmm2,[rsp+10h] paddw xmm2,[rsp] paddw xmm2,xmm10 psraw xmm2,3 pand xmm2,xmm3 por xmm2,xmm0 pand xmm1,xmm2 movdqa xmm0,xmm13 movdqa xmm2,xmm11 pandn xmm0,xmm11 paddw xmm2,xmm12 por xmm1,xmm0 packuswb xmm9,xmm1 movdqa xmm0,xmm7 movdqa xmm7,[rsp+0A0h] pandn xmm0,[rsp+0F0h] movdqa xmm1,xmm3 por xmm6,xmm0 movdqa xmm0,[rsp+10h] paddw xmm0,xmm4 paddw xmm2,xmm0 paddw xmm2,xmm7 movdqa xmm0,xmm3 pandn xmm0,xmm12 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 movdqa xmm2,xmm13 movdqa xmm0,xmm13 pand xmm2,xmm1 pandn xmm0,xmm12 movdqa xmm1,xmm12 paddw xmm1,[rsp+10h] por xmm2,xmm0 movdqa xmm0,xmm15 pandn xmm0,[rsp+0B0h] paddw xmm1,xmm4 packuswb xmm6,xmm2 movdqa xmm2,xmm3 psllw xmm1,1 por xmm5,xmm0 movdqa xmm0,[rsp+80h] paddw xmm0,xmm10 paddw xmm1,xmm0 paddw xmm11,xmm1 psraw xmm11,3 movdqa xmm1,xmm12 pand xmm2,xmm11 paddw xmm1,xmm12 movdqa xmm11,[rsp+80h] movdqa xmm0, [rsp+10h] por xmm14,[rsp+0E0h] paddw xmm0,xmm11 movdqa xmm4,xmm15 paddw xmm1,xmm0 movdqa xmm0,xmm13 paddw xmm1,xmm7 psraw xmm1,2 pandn xmm3,xmm1 por xmm2,xmm3 movdqa xmm1,xmm13 movdqa xmm3,[rsp+10h] pandn xmm0,xmm3 pand xmm1,xmm2 movdqa xmm2,xmm11 paddw xmm2,[rsp] por xmm1,xmm0 movdqa xmm0,[rsp+0D0h] por xmm0,xmm8 paddw xmm2,xmm3 packuswb xmm5,xmm1 movdqa xmm8,[rsp+40h] movdqa xmm1,[rsp+50h] movdqa xmm3,xmm8 pand xmm4,xmm0 psllw xmm2,1 movdqa xmm0,xmm15 pandn xmm0,[rsp+90h] por xmm4,xmm0 movdqa xmm0,xmm12 paddw xmm0,xmm10 paddw xmm2,xmm0 paddw xmm1,xmm2 movdqa xmm0,[rsp] movdqa xmm2,xmm11 paddw xmm0,xmm12 movdqa xmm12,[rsp] paddw xmm2,xmm11 paddw xmm2,xmm0 psraw xmm1,3 movdqa xmm0,xmm8 pand xmm3,xmm1 paddw xmm2,xmm7 movdqa xmm1,xmm13 psraw xmm2,2 pandn xmm0,xmm2 por xmm3,xmm0 movdqa xmm2,[rsp+50h] movdqa xmm0,xmm13 pandn xmm0,xmm12 pand xmm1,xmm3 paddw xmm2,xmm11 movdqa xmm3,xmm15 por xmm1,xmm0 pand xmm3,xmm14 movdqa xmm14,[rsp+10h] movdqa xmm0,xmm15 pandn xmm0,[rsp+30h] packuswb xmm4,xmm1 movdqa xmm1,xmm8 por xmm3,xmm0 movdqa xmm0,xmm12 paddw xmm0,xmm14 paddw xmm2,xmm0 paddw xmm2,xmm7 movdqa xmm0,xmm8 pandn xmm0,xmm11 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 movdqa xmm2,xmm13 movdqa xmm0,xmm13 pandn xmm0,xmm11 pand xmm2,xmm1 movdqa xmm1,xmm15 por xmm2,xmm0 packuswb xmm3,xmm2 movdqa xmm0,[rsp+100h] por xmm0,[rsp+120h] pand xmm1,xmm0 movdqa xmm2,[rcx+rbp] movdqa xmm7,[rsp+50h] pandn xmm15,[rsp+60h] lea r11,[rsp+1D8h] pxor xmm0,xmm0 por xmm1,xmm15 movaps xmm15,[r11-0A8h] movdqa [rdi],xmm9 movaps xmm9,[r11-48h] punpckhbw xmm2,xmm0 psllw xmm2,1 paddw xmm2,xmm7 paddw xmm2,xmm7 movdqa [rbx],xmm6 movaps xmm6,[r11-18h] paddw xmm2,xmm7 paddw xmm2,xmm11 movaps xmm11,[r11-68h] paddw xmm2,xmm12 movaps xmm12,[r11-78h] paddw xmm2,xmm14 paddw xmm2,xmm10 psraw xmm2,3 movaps xmm10,[r11-58h] movaps xmm14,[r11-98h] movdqa xmm0,xmm13 pand xmm2,xmm8 pandn xmm8,xmm7 pandn xmm13,xmm7 por xmm2,xmm8 movaps xmm7,[r11-28h] movaps xmm8,[r11-38h] movdqa [r8],xmm5 pand xmm0,xmm2 por xmm0,xmm13 packuswb xmm1,xmm0 movaps xmm13,[r11-88h] movdqa [rbp],xmm4 movdqa [r10+rbp],xmm3 movdqa [rsi+rbp],xmm1 mov rsp,r11 pop rbp pop rbx ret WELS_EXTERN DeblockChromaLt4V_ssse3 mov rax,rsp push rbx push rbp mov r10, rdx mov r11, rcx mov rcx, rdi mov rdx, rsi mov rsi, r10 mov r10, r9 mov rbp, r8 mov r8, rsi mov r9, r11 sub rsp,0C8h pxor xmm1,xmm1 mov rbx,rcx movsxd r11,r8d movsx ecx,byte [r10] movsx r8d,byte [r10+2] mov rdi,rdx movq xmm2,[rbx] movq xmm9,[r11+rbx] movsx edx,byte [r10+1] mov word [rsp+2],cx mov word [rsp],cx movsx eax,byte [r10+3] mov word [rsp+6],dx mov word [rsp+4],dx movdqa xmm11,xmm1 mov word [rsp+0Eh],ax mov word [rsp+0Ch],ax lea eax,[r11+r11] movsxd rcx,eax mov rax,rbx mov rdx,rdi sub rax,rcx mov word [rsp+0Ah],r8w mov word [rsp+8],r8w movdqa xmm6,[rsp] movdqa xmm7,xmm6 movq xmm13, [rax] mov rax,rdi sub rax,rcx mov rcx,rbx pcmpgtw xmm7,xmm1 psubw xmm11,xmm6 sub rcx,r11 sub rdx,r11 movq xmm0,[rax] movsx eax,r9w movq xmm15,[rcx] punpcklqdq xmm13,xmm0 movq xmm0, [rdx] movdqa xmm4,xmm13 punpcklqdq xmm15,xmm0 movq xmm0, [rdi] punpcklbw xmm4,xmm1 movdqa xmm12,xmm15 punpcklqdq xmm2,xmm0 movq xmm0, [r11+rdi] punpcklbw xmm12,xmm1 movdqa xmm14,xmm2 punpcklqdq xmm9,xmm0 punpckhbw xmm2,xmm1 punpcklbw xmm14,xmm1 movd xmm0,eax mov eax, ebp ; iBeta punpckhbw xmm13,xmm1 punpckhbw xmm15,xmm1 movdqa xmm3,xmm9 movdqa [rsp+10h],xmm2 punpcklwd xmm0,xmm0 punpckhbw xmm9,xmm1 punpcklbw xmm3,xmm1 movdqa xmm1,xmm14 pshufd xmm10,xmm0,0 movd xmm0,eax mov eax,4 cwde punpcklwd xmm0,xmm0 pshufd xmm8,xmm0,0 movd xmm0,eax punpcklwd xmm0,xmm0 pshufd xmm5,xmm0,0 psubw xmm1,xmm12 movdqa xmm2,xmm10 lea r11,[rsp+0C8h] psllw xmm1,2 movdqa xmm0,xmm4 psubw xmm4,xmm12 psubw xmm0,xmm3 psubw xmm3,xmm14 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm11 psraw xmm1,3 pmaxsw xmm0,xmm1 pminsw xmm6,xmm0 movdqa xmm1,xmm8 movdqa xmm0,xmm12 psubw xmm0,xmm14 pabsw xmm0,xmm0 pcmpgtw xmm2,xmm0 pabsw xmm0,xmm4 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm3 movdqa xmm3,[rsp] pand xmm2,xmm1 movdqa xmm1,xmm8 pcmpgtw xmm1,xmm0 movdqa xmm0,xmm13 pand xmm2,xmm1 psubw xmm0,xmm9 psubw xmm13,xmm15 pand xmm2,xmm7 pand xmm6,xmm2 paddw xmm12,xmm6 psubw xmm14,xmm6 movdqa xmm2,[rsp+10h] movaps xmm6,[r11-18h] movdqa xmm1,xmm2 psubw xmm1,xmm15 psubw xmm9,xmm2 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm15 psubw xmm0,xmm2 psraw xmm1,3 pmaxsw xmm11,xmm1 pabsw xmm0,xmm0 movdqa xmm1,xmm8 pcmpgtw xmm10,xmm0 pabsw xmm0,xmm13 pminsw xmm3,xmm11 movaps xmm11,[r11-68h] movaps xmm13,[rsp+40h] pcmpgtw xmm1,xmm0 pabsw xmm0,xmm9 movaps xmm9, [r11-48h] pand xmm10,xmm1 pcmpgtw xmm8,xmm0 pand xmm10,xmm8 pand xmm10,xmm7 movaps xmm8,[r11-38h] movaps xmm7,[r11-28h] pand xmm3,xmm10 paddw xmm15,xmm3 psubw xmm2,xmm3 movaps xmm10,[r11-58h] packuswb xmm12,xmm15 movaps xmm15,[rsp+20h] packuswb xmm14,xmm2 movq [rcx],xmm12 movq [rbx],xmm14 psrldq xmm12,8 psrldq xmm14,8 movq [rdx],xmm12 movaps xmm12,[r11-78h] movq [rdi],xmm14 movaps xmm14,[rsp+30h] mov rsp,r11 pop rbp pop rbx ret WELS_EXTERN DeblockChromaEq4V_ssse3 mov rax,rsp push rbx push rbp mov rbp, r8 mov r8, rdx mov r9, rcx mov rcx, rdi mov rdx, rsi sub rsp,90h pxor xmm1,xmm1 mov r11,rcx mov rbx,rdx mov r10d,r9d movq xmm13,[r11] lea eax,[r8+r8] movsxd r9,eax mov rax,rcx sub rax,r9 movq xmm14,[rax] mov rax,rdx sub rax,r9 movq xmm0,[rax] movsxd rax,r8d sub rcx,rax sub rdx,rax movq xmm12,[rax+r11] movq xmm10,[rcx] punpcklqdq xmm14,xmm0 movdqa xmm8,xmm14 movq xmm0,[rdx] punpcklbw xmm8,xmm1 punpckhbw xmm14,xmm1 punpcklqdq xmm10,xmm0 movq xmm0,[rbx] movdqa xmm5,xmm10 punpcklqdq xmm13,xmm0 movq xmm0, [rax+rbx] punpcklbw xmm5,xmm1 movsx eax,r10w movdqa xmm9,xmm13 punpcklqdq xmm12,xmm0 punpcklbw xmm9,xmm1 punpckhbw xmm10,xmm1 movd xmm0,eax mov eax, ebp ; iBeta punpckhbw xmm13,xmm1 movdqa xmm7,xmm12 punpcklwd xmm0,xmm0 punpckhbw xmm12,xmm1 pshufd xmm11,xmm0,0 punpcklbw xmm7,xmm1 movd xmm0,eax movdqa xmm1,xmm8 psubw xmm1,xmm5 punpcklwd xmm0,xmm0 movdqa xmm6,xmm11 pshufd xmm3,xmm0,0 movdqa xmm0,xmm5 psubw xmm0,xmm9 movdqa xmm2,xmm3 pabsw xmm0,xmm0 pcmpgtw xmm6,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm3 pcmpgtw xmm2,xmm0 pand xmm6,xmm2 movdqa xmm0,xmm7 movdqa xmm2,xmm3 psubw xmm0,xmm9 pabsw xmm0,xmm0 pcmpgtw xmm1,xmm0 pand xmm6,xmm1 movdqa xmm0,xmm10 movdqa xmm1,xmm14 psubw xmm0,xmm13 psubw xmm1,xmm10 pabsw xmm0,xmm0 pcmpgtw xmm11,xmm0 pabsw xmm0,xmm1 pcmpgtw xmm2,xmm0 pand xmm11,xmm2 movdqa xmm0,xmm12 movdqa xmm4,xmm6 movdqa xmm1,xmm8 mov eax,2 cwde paddw xmm1,xmm8 psubw xmm0,xmm13 paddw xmm1,xmm5 pabsw xmm0,xmm0 movdqa xmm2,xmm14 paddw xmm1,xmm7 pcmpgtw xmm3,xmm0 paddw xmm2,xmm14 movd xmm0,eax pand xmm11,xmm3 paddw xmm7,xmm7 paddw xmm2,xmm10 punpcklwd xmm0,xmm0 paddw xmm2,xmm12 paddw xmm12,xmm12 pshufd xmm3,xmm0,0 paddw xmm7,xmm9 paddw xmm12,xmm13 movdqa xmm0,xmm6 paddw xmm1,xmm3 pandn xmm0,xmm5 paddw xmm7,xmm8 psraw xmm1,2 paddw xmm12,xmm14 paddw xmm7,xmm3 ;movaps xmm14,[rsp] pand xmm4,xmm1 paddw xmm12,xmm3 psraw xmm7,2 movdqa xmm1,xmm11 por xmm4,xmm0 psraw xmm12,2 paddw xmm2,xmm3 movdqa xmm0,xmm11 pandn xmm0,xmm10 psraw xmm2,2 pand xmm1,xmm2 por xmm1,xmm0 packuswb xmm4,xmm1 movdqa xmm0,xmm11 movdqa xmm1,xmm6 pand xmm1,xmm7 movq [rcx],xmm4 pandn xmm6,xmm9 pandn xmm11,xmm13 pand xmm0,xmm12 por xmm1,xmm6 por xmm0,xmm11 psrldq xmm4,8 packuswb xmm1,xmm0 movq [r11],xmm1 psrldq xmm1,8 movq [rdx],xmm4 lea r11,[rsp+90h] movq [rbx],xmm1 mov rsp,r11 pop rbp pop rbx ret WELS_EXTERN DeblockChromaEq4H_ssse3 mov rax,rsp push rbx push rbp push r12 mov rbp, r8 mov r8, rdx mov r9, rcx mov rcx, rdi mov rdx, rsi mov rdi, rdx sub rsp,140h lea eax,[r8*4] movsxd r10,eax mov eax,[rcx-2] mov [rsp+10h],eax lea rbx,[r10+rdx-2] lea r11,[r10+rcx-2] movdqa xmm5,[rsp+10h] movsxd r10,r8d mov eax,[r10+rcx-2] lea rdx,[r10+r10*2] mov [rsp+20h],eax mov eax,[rcx+r10*2-2] mov [rsp+30h],eax mov eax,[rdx+rcx-2] movdqa xmm2,[rsp+20h] mov [rsp+40h],eax mov eax, [rdi-2] movdqa xmm4,[rsp+30h] mov [rsp+50h],eax mov eax,[r10+rdi-2] movdqa xmm3,[rsp+40h] mov [rsp+60h],eax mov eax,[rdi+r10*2-2] punpckldq xmm5,[rsp+50h] mov [rsp+70h],eax mov eax, [rdx+rdi-2] punpckldq xmm2, [rsp+60h] mov [rsp+80h],eax mov eax,[r11] punpckldq xmm4, [rsp+70h] mov [rsp+50h],eax mov eax,[rbx] punpckldq xmm3,[rsp+80h] mov [rsp+60h],eax mov eax,[r10+r11] movdqa xmm0, [rsp+50h] punpckldq xmm0, [rsp+60h] punpcklqdq xmm5,xmm0 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax,[r10+rbx] movdqa xmm0,[rsp+50h] movdqa xmm1,xmm5 mov [rsp+60h],eax mov eax,[r11+r10*2] punpckldq xmm0, [rsp+60h] punpcklqdq xmm2,xmm0 punpcklbw xmm1,xmm2 punpckhbw xmm5,xmm2 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax,[rbx+r10*2] movdqa xmm0,[rsp+50h] mov [rsp+60h],eax mov eax, [rdx+r11] movdqa xmm15,xmm1 punpckldq xmm0,[rsp+60h] punpcklqdq xmm4,xmm0 movdqa [rsp+50h],xmm0 mov [rsp+50h],eax mov eax, [rdx+rbx] movdqa xmm0,[rsp+50h] mov [rsp+60h],eax punpckldq xmm0, [rsp+60h] punpcklqdq xmm3,xmm0 movdqa xmm0,xmm4 punpcklbw xmm0,xmm3 punpckhbw xmm4,xmm3 punpcklwd xmm15,xmm0 punpckhwd xmm1,xmm0 movdqa xmm0,xmm5 movdqa xmm12,xmm15 punpcklwd xmm0,xmm4 punpckhwd xmm5,xmm4 punpckldq xmm12,xmm0 punpckhdq xmm15,xmm0 movdqa xmm0,xmm1 movdqa xmm11,xmm12 punpckldq xmm0,xmm5 punpckhdq xmm1,xmm5 punpcklqdq xmm11,xmm0 punpckhqdq xmm12,xmm0 movsx eax,r9w movdqa xmm14,xmm15 punpcklqdq xmm14,xmm1 punpckhqdq xmm15,xmm1 pxor xmm1,xmm1 movd xmm0,eax movdqa xmm4,xmm12 movdqa xmm8,xmm11 mov eax, ebp ; iBeta punpcklwd xmm0,xmm0 punpcklbw xmm4,xmm1 punpckhbw xmm12,xmm1 movdqa xmm9,xmm14 movdqa xmm7,xmm15 movdqa xmm10,xmm15 pshufd xmm13,xmm0,0 punpcklbw xmm9,xmm1 punpckhbw xmm14,xmm1 movdqa xmm6,xmm13 movd xmm0,eax movdqa [rsp],xmm11 mov eax,2 cwde punpckhbw xmm11,xmm1 punpckhbw xmm10,xmm1 punpcklbw xmm7,xmm1 punpcklwd xmm0,xmm0 punpcklbw xmm8,xmm1 pshufd xmm3,xmm0,0 movdqa xmm1,xmm8 movdqa xmm0,xmm4 psubw xmm0,xmm9 psubw xmm1,xmm4 movdqa xmm2,xmm3 pabsw xmm0,xmm0 pcmpgtw xmm6,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm3 pcmpgtw xmm2,xmm0 pand xmm6,xmm2 movdqa xmm0,xmm7 movdqa xmm2,xmm3 psubw xmm0,xmm9 pabsw xmm0,xmm0 pcmpgtw xmm1,xmm0 pand xmm6,xmm1 movdqa xmm0,xmm12 movdqa xmm1,xmm11 psubw xmm0,xmm14 psubw xmm1,xmm12 movdqa xmm5,xmm6 pabsw xmm0,xmm0 pcmpgtw xmm13,xmm0 pabsw xmm0,xmm1 movdqa xmm1,xmm8 pcmpgtw xmm2,xmm0 paddw xmm1,xmm8 movdqa xmm0,xmm10 pand xmm13,xmm2 psubw xmm0,xmm14 paddw xmm1,xmm4 movdqa xmm2,xmm11 pabsw xmm0,xmm0 paddw xmm2,xmm11 paddw xmm1,xmm7 pcmpgtw xmm3,xmm0 paddw xmm2,xmm12 movd xmm0,eax pand xmm13,xmm3 paddw xmm2,xmm10 punpcklwd xmm0,xmm0 pshufd xmm3,xmm0,0 movdqa xmm0,xmm6 paddw xmm1,xmm3 pandn xmm0,xmm4 paddw xmm2,xmm3 psraw xmm1,2 pand xmm5,xmm1 por xmm5,xmm0 paddw xmm7,xmm7 paddw xmm10,xmm10 psraw xmm2,2 movdqa xmm1,xmm13 movdqa xmm0,xmm13 pandn xmm0,xmm12 pand xmm1,xmm2 paddw xmm7,xmm9 por xmm1,xmm0 paddw xmm10,xmm14 paddw xmm7,xmm8 movdqa xmm0,xmm13 packuswb xmm5,xmm1 paddw xmm7,xmm3 paddw xmm10,xmm11 movdqa xmm1,xmm6 paddw xmm10,xmm3 pandn xmm6,xmm9 psraw xmm7,2 pand xmm1,xmm7 psraw xmm10,2 pandn xmm13,xmm14 pand xmm0,xmm10 por xmm1,xmm6 movdqa xmm6,[rsp] movdqa xmm4,xmm6 por xmm0,xmm13 punpcklbw xmm4,xmm5 punpckhbw xmm6,xmm5 movdqa xmm3,xmm4 packuswb xmm1,xmm0 movdqa xmm0,xmm1 punpckhbw xmm1,xmm15 punpcklbw xmm0,xmm15 punpcklwd xmm3,xmm0 punpckhwd xmm4,xmm0 movdqa xmm0,xmm6 movdqa xmm2,xmm3 punpcklwd xmm0,xmm1 punpckhwd xmm6,xmm1 movdqa xmm1,xmm4 punpckldq xmm2,xmm0 punpckhdq xmm3,xmm0 punpckldq xmm1,xmm6 movdqa xmm0,xmm2 punpcklqdq xmm0,xmm1 punpckhdq xmm4,xmm6 punpckhqdq xmm2,xmm1 movdqa [rsp+10h],xmm0 movdqa [rsp+60h],xmm2 movdqa xmm0,xmm3 mov eax,[rsp+10h] mov [rcx-2],eax mov eax,[rsp+60h] punpcklqdq xmm0,xmm4 punpckhqdq xmm3,xmm4 mov [r10+rcx-2],eax movdqa [rsp+20h],xmm0 mov eax, [rsp+20h] movdqa [rsp+70h],xmm3 mov [rcx+r10*2-2],eax mov eax,[rsp+70h] mov [rdx+rcx-2],eax mov eax,[rsp+18h] mov [r11],eax mov eax,[rsp+68h] mov [r10+r11],eax mov eax,[rsp+28h] mov [r11+r10*2],eax mov eax,[rsp+78h] mov [rdx+r11],eax mov eax,[rsp+14h] mov [rdi-2],eax mov eax,[rsp+64h] mov [r10+rdi-2],eax mov eax,[rsp+24h] mov [rdi+r10*2-2],eax mov eax, [rsp+74h] mov [rdx+rdi-2],eax mov eax, [rsp+1Ch] mov [rbx],eax mov eax, [rsp+6Ch] mov [r10+rbx],eax mov eax,[rsp+2Ch] mov [rbx+r10*2],eax mov eax,[rsp+7Ch] mov [rdx+rbx],eax lea r11,[rsp+140h] mov rbx, [r11+28h] mov rsp,r11 pop r12 pop rbp pop rbx ret WELS_EXTERN DeblockChromaLt4H_ssse3 mov rax,rsp push rbx push rbp push r12 push r13 push r14 sub rsp,170h mov r13, r8 mov r14, r9 mov r8, rdx mov r9, rcx mov rdx, rdi mov rcx, rsi movsxd rsi,r8d lea eax,[r8*4] mov r11d,r9d movsxd r10,eax mov eax, [rcx-2] mov r12,rdx mov [rsp+40h],eax mov eax, [rsi+rcx-2] lea rbx,[r10+rcx-2] movdqa xmm5,[rsp+40h] mov [rsp+50h],eax mov eax, [rcx+rsi*2-2] lea rbp,[r10+rdx-2] movdqa xmm2, [rsp+50h] mov [rsp+60h],eax lea r10,[rsi+rsi*2] mov rdi,rcx mov eax,[r10+rcx-2] movdqa xmm4,[rsp+60h] mov [rsp+70h],eax mov eax,[rdx-2] mov [rsp+80h],eax mov eax, [rsi+rdx-2] movdqa xmm3,[rsp+70h] mov [rsp+90h],eax mov eax,[rdx+rsi*2-2] punpckldq xmm5,[rsp+80h] mov [rsp+0A0h],eax mov eax, [r10+rdx-2] punpckldq xmm2,[rsp+90h] mov [rsp+0B0h],eax mov eax, [rbx] punpckldq xmm4,[rsp+0A0h] mov [rsp+80h],eax mov eax,[rbp] punpckldq xmm3,[rsp+0B0h] mov [rsp+90h],eax mov eax,[rsi+rbx] movdqa xmm0,[rsp+80h] punpckldq xmm0,[rsp+90h] punpcklqdq xmm5,xmm0 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax,[rsi+rbp] movdqa xmm0,[rsp+80h] movdqa xmm1,xmm5 mov [rsp+90h],eax mov eax,[rbx+rsi*2] punpckldq xmm0,[rsp+90h] punpcklqdq xmm2,xmm0 punpcklbw xmm1,xmm2 punpckhbw xmm5,xmm2 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax,[rbp+rsi*2] movdqa xmm0, [rsp+80h] mov [rsp+90h],eax mov eax,[r10+rbx] movdqa xmm7,xmm1 punpckldq xmm0,[rsp+90h] punpcklqdq xmm4,xmm0 movdqa [rsp+80h],xmm0 mov [rsp+80h],eax mov eax, [r10+rbp] movdqa xmm0,[rsp+80h] mov [rsp+90h],eax punpckldq xmm0,[rsp+90h] punpcklqdq xmm3,xmm0 movdqa xmm0,xmm4 punpcklbw xmm0,xmm3 punpckhbw xmm4,xmm3 punpcklwd xmm7,xmm0 punpckhwd xmm1,xmm0 movdqa xmm0,xmm5 movdqa xmm6,xmm7 punpcklwd xmm0,xmm4 punpckhwd xmm5,xmm4 punpckldq xmm6,xmm0 punpckhdq xmm7,xmm0 movdqa xmm0,xmm1 punpckldq xmm0,xmm5 mov rax, r14 ; pTC punpckhdq xmm1,xmm5 movdqa xmm9,xmm6 punpckhqdq xmm6,xmm0 punpcklqdq xmm9,xmm0 movdqa xmm2,xmm7 movdqa xmm13,xmm6 movdqa xmm4,xmm9 movdqa [rsp+10h],xmm9 punpcklqdq xmm2,xmm1 punpckhqdq xmm7,xmm1 pxor xmm1,xmm1 movsx ecx,byte [rax+3] movsx edx,byte [rax+2] movsx r8d,byte [rax+1] movsx r9d,byte [rax] movdqa xmm10,xmm1 movdqa xmm15,xmm2 punpckhbw xmm2,xmm1 punpckhbw xmm6,xmm1 punpcklbw xmm4,xmm1 movsx eax,r11w mov word [rsp+0Eh],cx mov word [rsp+0Ch],cx movdqa xmm3,xmm7 movdqa xmm8,xmm7 movdqa [rsp+20h],xmm7 punpcklbw xmm15,xmm1 punpcklbw xmm13,xmm1 punpcklbw xmm3,xmm1 mov word [rsp+0Ah],dx mov word [rsp+8],dx mov word [rsp+6],r8w movd xmm0,eax movdqa [rsp+30h],xmm6 punpckhbw xmm9,xmm1 punpckhbw xmm8,xmm1 punpcklwd xmm0,xmm0 mov eax, r13d ; iBeta mov word [rsp+4],r8w mov word [rsp+2],r9w pshufd xmm12,xmm0,0 mov word [rsp],r9w movd xmm0,eax mov eax,4 cwde movdqa xmm14, [rsp] movdqa [rsp],xmm2 movdqa xmm2,xmm12 punpcklwd xmm0,xmm0 pshufd xmm11,xmm0,0 psubw xmm10,xmm14 movd xmm0,eax movdqa xmm7,xmm14 movdqa xmm6,xmm14 pcmpgtw xmm7,xmm1 punpcklwd xmm0,xmm0 pshufd xmm5,xmm0,0 movdqa xmm0,xmm4 movdqa xmm1,xmm15 psubw xmm4,xmm13 psubw xmm0,xmm3 psubw xmm1,xmm13 psubw xmm3,xmm15 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm10 psraw xmm1,3 pmaxsw xmm0,xmm1 pminsw xmm6,xmm0 movdqa xmm1,xmm11 movdqa xmm0,xmm13 psubw xmm0,xmm15 pabsw xmm0,xmm0 pcmpgtw xmm2,xmm0 pabsw xmm0,xmm4 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm3 pand xmm2,xmm1 movdqa xmm1,xmm11 movdqa xmm3,[rsp+30h] pcmpgtw xmm1,xmm0 movdqa xmm0,xmm9 pand xmm2,xmm1 psubw xmm0,xmm8 psubw xmm9,xmm3 pand xmm2,xmm7 pand xmm6,xmm2 psubw xmm15,xmm6 paddw xmm13,xmm6 movdqa xmm2,[rsp] movdqa xmm1,xmm2 psubw xmm1,xmm3 psubw xmm8,xmm2 psllw xmm1,2 paddw xmm1,xmm0 paddw xmm1,xmm5 movdqa xmm0,xmm3 movdqa xmm5,[rsp+10h] psubw xmm0,xmm2 psraw xmm1,3 movdqa xmm4,xmm5 pabsw xmm0,xmm0 pmaxsw xmm10,xmm1 movdqa xmm1,xmm11 pcmpgtw xmm12,xmm0 pabsw xmm0,xmm9 pminsw xmm14,xmm10 pcmpgtw xmm1,xmm0 pabsw xmm0,xmm8 pcmpgtw xmm11,xmm0 pand xmm12,xmm1 movdqa xmm1,[rsp+20h] pand xmm12,xmm11 pand xmm12,xmm7 pand xmm14,xmm12 paddw xmm3,xmm14 psubw xmm2,xmm14 packuswb xmm13,xmm3 packuswb xmm15,xmm2 punpcklbw xmm4,xmm13 punpckhbw xmm5,xmm13 movdqa xmm0,xmm15 punpcklbw xmm0,xmm1 punpckhbw xmm15,xmm1 movdqa xmm3,xmm4 punpcklwd xmm3,xmm0 punpckhwd xmm4,xmm0 movdqa xmm0,xmm5 movdqa xmm2,xmm3 movdqa xmm1,xmm4 punpcklwd xmm0,xmm15 punpckhwd xmm5,xmm15 punpckldq xmm2,xmm0 punpckhdq xmm3,xmm0 punpckldq xmm1,xmm5 movdqa xmm0,xmm2 punpcklqdq xmm0,xmm1 punpckhdq xmm4,xmm5 punpckhqdq xmm2,xmm1 movdqa [rsp+40h],xmm0 movdqa xmm0,xmm3 movdqa [rsp+90h],xmm2 mov eax,[rsp+40h] mov [rdi-2],eax mov eax, [rsp+90h] punpcklqdq xmm0,xmm4 punpckhqdq xmm3,xmm4 mov [rsi+rdi-2],eax movdqa [rsp+50h],xmm0 mov eax,[rsp+50h] movdqa [rsp+0A0h],xmm3 mov [rdi+rsi*2-2],eax mov eax,[rsp+0A0h] mov [r10+rdi-2],eax mov eax,[rsp+48h] mov [rbx],eax mov eax,[rsp+98h] mov [rsi+rbx],eax mov eax,[rsp+58h] mov [rbx+rsi*2],eax mov eax, [rsp+0A8h] mov [r10+rbx],eax mov eax, [rsp+44h] mov [r12-2],eax mov eax,[rsp+94h] mov [rsi+r12-2],eax mov eax,[rsp+54h] mov [r12+rsi*2-2],eax mov eax, [rsp+0A4h] mov [r10+r12-2],eax mov eax,[rsp+4Ch] mov [rbp],eax mov eax,[rsp+9Ch] mov [rsi+rbp],eax mov eax, [rsp+5Ch] mov [rbp+rsi*2],eax mov eax,[rsp+0ACh] mov [r10+rbp],eax lea r11,[rsp+170h] mov rsp,r11 pop r14 pop r13 pop r12 pop rbp pop rbx ret %elifdef X86_32 ;******************************************************************************** ; void DeblockChromaEq4V_ssse3(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta) ;******************************************************************************** WELS_EXTERN DeblockChromaEq4V_ssse3 push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,68h mov edx,[ebp+10h] ; iStride mov eax,[ebp+8] ; pPixCb mov ecx,[ebp+0Ch] ; pPixCr movq xmm4,[ecx] movq xmm5,[edx+ecx] push esi push edi lea esi,[edx+edx] mov edi,eax sub edi,esi movq xmm1,[edi] mov edi,ecx sub edi,esi movq xmm2,[edi] punpcklqdq xmm1,xmm2 mov esi,eax sub esi,edx movq xmm2,[esi] mov edi,ecx sub edi,edx movq xmm3,[edi] punpcklqdq xmm2,xmm3 movq xmm3,[eax] punpcklqdq xmm3,xmm4 movq xmm4,[edx+eax] mov edx, [ebp + 14h] punpcklqdq xmm4,xmm5 movd xmm5,edx mov edx, [ebp + 18h] pxor xmm0,xmm0 movdqa xmm6,xmm5 punpcklwd xmm6,xmm5 pshufd xmm5,xmm6,0 movd xmm6,edx movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa xmm7,xmm1 punpckhbw xmm1,xmm0 punpcklbw xmm7,xmm0 movdqa [esp+40h],xmm1 movdqa [esp+60h],xmm7 movdqa xmm7,xmm2 punpcklbw xmm7,xmm0 movdqa [esp+10h],xmm7 movdqa xmm7,xmm3 punpcklbw xmm7,xmm0 punpckhbw xmm3,xmm0 movdqa [esp+50h],xmm7 movdqa xmm7,xmm4 punpckhbw xmm4,xmm0 punpckhbw xmm2,xmm0 punpcklbw xmm7,xmm0 movdqa [esp+30h],xmm3 movdqa xmm3,[esp+10h] movdqa xmm1,xmm3 psubw xmm1,[esp+50h] pabsw xmm1,xmm1 movdqa [esp+20h],xmm4 movdqa xmm0,xmm5 pcmpgtw xmm0,xmm1 movdqa xmm1,[esp+60h] psubw xmm1,xmm3 pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 pand xmm0,xmm4 movdqa xmm1,xmm7 psubw xmm1,[esp+50h] pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 movdqa xmm1,xmm2 psubw xmm1,[esp+30h] pabsw xmm1,xmm1 pcmpgtw xmm5,xmm1 movdqa xmm1,[esp+40h] pand xmm0,xmm4 psubw xmm1,xmm2 pabsw xmm1,xmm1 movdqa xmm4,xmm6 pcmpgtw xmm4,xmm1 movdqa xmm1,[esp+20h] psubw xmm1,[esp+30h] pand xmm5,xmm4 pabsw xmm1,xmm1 pcmpgtw xmm6,xmm1 pand xmm5,xmm6 mov edx,2 movsx edx,dx movd xmm1,edx movdqa xmm4,xmm1 punpcklwd xmm4,xmm1 pshufd xmm1,xmm4,0 movdqa xmm4,[esp+60h] movdqa xmm6,xmm4 paddw xmm6,xmm4 paddw xmm6,xmm3 paddw xmm6,xmm7 movdqa [esp+10h],xmm1 paddw xmm6,[esp+10h] psraw xmm6,2 movdqa xmm4,xmm0 pandn xmm4,xmm3 movdqa xmm3,[esp+40h] movdqa xmm1,xmm0 pand xmm1,xmm6 por xmm1,xmm4 movdqa xmm6,xmm3 paddw xmm6,xmm3 movdqa xmm3,[esp+10h] paddw xmm6,xmm2 paddw xmm6,[esp+20h] paddw xmm6,xmm3 psraw xmm6,2 movdqa xmm4,xmm5 pand xmm4,xmm6 movdqa xmm6,xmm5 pandn xmm6,xmm2 por xmm4,xmm6 packuswb xmm1,xmm4 movdqa xmm4,[esp+50h] movdqa xmm6,xmm7 paddw xmm6,xmm7 paddw xmm6,xmm4 paddw xmm6,[esp+60h] paddw xmm6,xmm3 psraw xmm6,2 movdqa xmm2,xmm0 pand xmm2,xmm6 pandn xmm0,xmm4 por xmm2,xmm0 movdqa xmm0,[esp+20h] movdqa xmm6,xmm0 paddw xmm6,xmm0 movdqa xmm0,[esp+30h] paddw xmm6,xmm0 paddw xmm6,[esp+40h] movdqa xmm4,xmm5 paddw xmm6,xmm3 movq [esi],xmm1 psraw xmm6,2 pand xmm4,xmm6 pandn xmm5,xmm0 por xmm4,xmm5 packuswb xmm2,xmm4 movq [eax],xmm2 psrldq xmm1,8 movq [edi],xmm1 pop edi psrldq xmm2,8 movq [ecx],xmm2 pop esi mov esp,ebp pop ebp ret ;****************************************************************************** ; void DeblockChromaLt4V_ssse3(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta, int8_t * pTC); ;******************************************************************************* WELS_EXTERN DeblockChromaLt4V_ssse3 push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,0E4h push ebx push esi mov esi, [ebp+1Ch] ; pTC movsx ebx, byte [esi+2] push edi movsx di,byte [esi+3] mov word [esp+0Ch],bx movsx bx,byte [esi+1] movsx esi,byte [esi] mov word [esp+0Eh],si movzx esi,di movd xmm1,esi movzx esi,di movd xmm2,esi mov si,word [esp+0Ch] mov edx, [ebp + 10h] mov eax, [ebp + 08h] movzx edi,si movzx esi,si mov ecx, [ebp + 0Ch] movd xmm4,esi movzx esi,bx movd xmm5,esi movd xmm3,edi movzx esi,bx movd xmm6,esi mov si,word [esp+0Eh] movzx edi,si movzx esi,si punpcklwd xmm6,xmm2 pxor xmm0,xmm0 movdqa [esp+40h],xmm0 movd xmm7,edi movd xmm0,esi lea esi,[edx+edx] mov edi,eax sub edi,esi punpcklwd xmm5,xmm1 movdqa xmm1,[esp+40h] punpcklwd xmm0,xmm4 movq xmm4,[edx+ecx] punpcklwd xmm7,xmm3 movq xmm3,[eax] punpcklwd xmm0,xmm6 movq xmm6,[edi] punpcklwd xmm7,xmm5 punpcklwd xmm0,xmm7 mov edi,ecx sub edi,esi movdqa xmm2,xmm1 psubw xmm2,xmm0 movdqa [esp+60h],xmm2 movq xmm2, [edi] punpcklqdq xmm6,xmm2 mov esi,eax sub esi,edx movq xmm7,[esi] mov edi,ecx sub edi,edx movq xmm2,[edi] punpcklqdq xmm7,xmm2 movq xmm2,[ecx] punpcklqdq xmm3,xmm2 movq xmm2,[edx+eax] movsx edx,word [ebp + 14h] punpcklqdq xmm2,xmm4 movdqa [esp+0E0h],xmm2 movd xmm2,edx movsx edx,word [ebp + 18h] movdqa xmm4,xmm2 punpcklwd xmm4,xmm2 movd xmm2,edx movdqa xmm5,xmm2 punpcklwd xmm5,xmm2 pshufd xmm2,xmm5,0 movdqa [esp+50h],xmm2 movdqa xmm2,xmm6 punpcklbw xmm2,xmm1 movdqa [esp+0D0h],xmm3 pshufd xmm4,xmm4,0 movdqa [esp+30h],xmm2 punpckhbw xmm6,xmm1 movdqa [esp+80h],xmm6 movdqa xmm6,[esp+0D0h] punpckhbw xmm6,xmm1 movdqa [esp+70h],xmm6 movdqa xmm6, [esp+0E0h] punpckhbw xmm6,xmm1 movdqa [esp+90h],xmm6 movdqa xmm5, [esp+0E0h] movdqa xmm2,xmm7 punpckhbw xmm7,xmm1 punpcklbw xmm5,xmm1 movdqa [esp+0A0h],xmm7 punpcklbw xmm3,xmm1 mov edx,4 punpcklbw xmm2,xmm1 movsx edx,dx movd xmm6,edx movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa xmm7,[esp+30h] movdqa [esp+20h],xmm6 psubw xmm7,xmm5 movdqa xmm6,xmm0 pcmpgtw xmm6,xmm1 movdqa xmm1,[esp+60h] movdqa [esp+40h],xmm6 movdqa xmm6,xmm3 psubw xmm6,xmm2 psllw xmm6,2 paddw xmm6,xmm7 paddw xmm6, [esp+20h] movdqa xmm7, [esp+50h] psraw xmm6,3 pmaxsw xmm1,xmm6 movdqa [esp+10h],xmm0 movdqa xmm6, [esp+10h] pminsw xmm6,xmm1 movdqa [esp+10h],xmm6 movdqa xmm1,xmm2 psubw xmm1,xmm3 pabsw xmm1,xmm1 movdqa xmm6,xmm4 pcmpgtw xmm6,xmm1 movdqa xmm1, [esp+30h] psubw xmm1,xmm2 pabsw xmm1,xmm1 pcmpgtw xmm7,xmm1 movdqa xmm1,[esp+50h] pand xmm6,xmm7 movdqa xmm7,[esp+50h] psubw xmm5,xmm3 pabsw xmm5,xmm5 pcmpgtw xmm1,xmm5 movdqa xmm5,[esp+80h] psubw xmm5,[esp+90h] pand xmm6,xmm1 pand xmm6,[esp+40h] movdqa xmm1,[esp+10h] pand xmm1,xmm6 movdqa xmm6,[esp+70h] movdqa [esp+30h],xmm1 movdqa xmm1,[esp+0A0h] psubw xmm6,xmm1 psllw xmm6,2 paddw xmm6,xmm5 paddw xmm6,[esp+20h] movdqa xmm5,[esp+60h] psraw xmm6,3 pmaxsw xmm5,xmm6 pminsw xmm0,xmm5 movdqa xmm5,[esp+70h] movdqa xmm6,xmm1 psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm4,xmm6 movdqa xmm6,[esp+80h] psubw xmm6,xmm1 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+90h] pand xmm4,xmm7 movdqa xmm7,[esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 pand xmm4,xmm7 pand xmm4,[esp+40h] pand xmm0,xmm4 movdqa xmm4,[esp+30h] paddw xmm2,xmm4 paddw xmm1,xmm0 packuswb xmm2,xmm1 movq [esi],xmm2 psubw xmm3,xmm4 psubw xmm5,xmm0 packuswb xmm3,xmm5 movq [eax],xmm3 psrldq xmm2,8 movq [edi],xmm2 pop edi pop esi psrldq xmm3,8 movq [ecx],xmm3 pop ebx mov esp,ebp pop ebp ret ;*************************************************************************** ; void DeblockChromaEq4H_ssse3(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta) ;*************************************************************************** WELS_EXTERN DeblockChromaEq4H_ssse3 push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,0C8h mov ecx,dword [ebp+8] mov edx,dword [ebp+0Ch] mov eax,dword [ebp+10h] sub ecx,2 sub edx,2 push esi lea esi,[eax+eax*2] mov dword [esp+18h],ecx mov dword [esp+4],edx lea ecx,[ecx+eax*4] lea edx,[edx+eax*4] lea eax,[esp+7Ch] push edi mov dword [esp+14h],esi mov dword [esp+18h],ecx mov dword [esp+0Ch],edx mov dword [esp+10h],eax mov esi,dword [esp+1Ch] mov ecx,dword [ebp+10h] mov edx,dword [esp+14h] movd xmm0,dword [esi] movd xmm1,dword [esi+ecx] movd xmm2,dword [esi+ecx*2] movd xmm3,dword [esi+edx] mov esi,dword [esp+8] movd xmm4,dword [esi] movd xmm5,dword [esi+ecx] movd xmm6,dword [esi+ecx*2] movd xmm7,dword [esi+edx] punpckldq xmm0,xmm4 punpckldq xmm1,xmm5 punpckldq xmm2,xmm6 punpckldq xmm3,xmm7 mov esi,dword [esp+18h] mov edi,dword [esp+0Ch] movd xmm4,dword [esi] movd xmm5,dword [edi] punpckldq xmm4,xmm5 punpcklqdq xmm0,xmm4 movd xmm4,dword [esi+ecx] movd xmm5,dword [edi+ecx] punpckldq xmm4,xmm5 punpcklqdq xmm1,xmm4 movd xmm4,dword [esi+ecx*2] movd xmm5,dword [edi+ecx*2] punpckldq xmm4,xmm5 punpcklqdq xmm2,xmm4 movd xmm4,dword [esi+edx] movd xmm5,dword [edi+edx] punpckldq xmm4,xmm5 punpcklqdq xmm3,xmm4 movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov edi,dword [esp+10h] movdqa [edi],xmm0 movdqa [edi+10h],xmm5 movdqa [edi+20h],xmm1 movdqa [edi+30h],xmm6 movsx ecx,word [ebp+14h] movsx edx,word [ebp+18h] movdqa xmm6,[esp+80h] movdqa xmm4,[esp+90h] movdqa xmm5,[esp+0A0h] movdqa xmm7,[esp+0B0h] pxor xmm0,xmm0 movd xmm1,ecx movdqa xmm2,xmm1 punpcklwd xmm2,xmm1 pshufd xmm1,xmm2,0 movd xmm2,edx movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm2,xmm3,0 movdqa xmm3,xmm6 punpckhbw xmm6,xmm0 movdqa [esp+60h],xmm6 movdqa xmm6,[esp+90h] punpckhbw xmm6,xmm0 movdqa [esp+30h],xmm6 movdqa xmm6,[esp+0A0h] punpckhbw xmm6,xmm0 movdqa [esp+40h],xmm6 movdqa xmm6,[esp+0B0h] punpckhbw xmm6,xmm0 movdqa [esp+70h],xmm6 punpcklbw xmm7,xmm0 punpcklbw xmm4,xmm0 punpcklbw xmm5,xmm0 punpcklbw xmm3,xmm0 movdqa [esp+50h],xmm7 movdqa xmm6,xmm4 psubw xmm6,xmm5 pabsw xmm6,xmm6 movdqa xmm0,xmm1 pcmpgtw xmm0,xmm6 movdqa xmm6,xmm3 psubw xmm6,xmm4 pabsw xmm6,xmm6 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pand xmm0,xmm7 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+30h] psubw xmm6,[esp+40h] pabsw xmm6,xmm6 pcmpgtw xmm1,xmm6 movdqa xmm6,[esp+60h] psubw xmm6,[esp+30h] pabsw xmm6,xmm6 pand xmm0,xmm7 movdqa xmm7,xmm2 pcmpgtw xmm7,xmm6 movdqa xmm6,[esp+70h] psubw xmm6,[esp+40h] pabsw xmm6,xmm6 pand xmm1,xmm7 pcmpgtw xmm2,xmm6 pand xmm1,xmm2 mov eax,2 movsx ecx,ax movd xmm2,ecx movdqa xmm6,xmm2 punpcklwd xmm6,xmm2 pshufd xmm2,xmm6,0 movdqa [esp+20h],xmm2 movdqa xmm2,xmm3 paddw xmm2,xmm3 paddw xmm2,xmm4 paddw xmm2,[esp+50h] paddw xmm2,[esp+20h] psraw xmm2,2 movdqa xmm6,xmm0 pand xmm6,xmm2 movdqa xmm2,xmm0 pandn xmm2,xmm4 por xmm6,xmm2 movdqa xmm2,[esp+60h] movdqa xmm7,xmm2 paddw xmm7,xmm2 paddw xmm7,[esp+30h] paddw xmm7,[esp+70h] paddw xmm7,[esp+20h] movdqa xmm4,xmm1 movdqa xmm2,xmm1 pandn xmm2,[esp+30h] psraw xmm7,2 pand xmm4,xmm7 por xmm4,xmm2 movdqa xmm2,[esp+50h] packuswb xmm6,xmm4 movdqa [esp+90h],xmm6 movdqa xmm6,xmm2 paddw xmm6,xmm2 movdqa xmm2,[esp+20h] paddw xmm6,xmm5 paddw xmm6,xmm3 movdqa xmm4,xmm0 pandn xmm0,xmm5 paddw xmm6,xmm2 psraw xmm6,2 pand xmm4,xmm6 por xmm4,xmm0 movdqa xmm0,[esp+70h] movdqa xmm5,xmm0 paddw xmm5,xmm0 movdqa xmm0,[esp+40h] paddw xmm5,xmm0 paddw xmm5,[esp+60h] movdqa xmm3,xmm1 paddw xmm5,xmm2 psraw xmm5,2 pand xmm3,xmm5 pandn xmm1,xmm0 por xmm3,xmm1 packuswb xmm4,xmm3 movdqa [esp+0A0h],xmm4 mov esi,dword [esp+10h] movdqa xmm0,[esi] movdqa xmm1,[esi+10h] movdqa xmm2,[esi+20h] movdqa xmm3,[esi+30h] movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov esi,dword [esp+1Ch] mov ecx,dword [ebp+10h] mov edx,dword [esp+14h] mov edi,dword [esp+8] movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov esi,dword [esp+18h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov edi,dword [esp+0Ch] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 pop edi pop esi mov esp,ebp pop ebp ret ;******************************************************************************* ; void DeblockChromaLt4H_ssse3(uint8_t * pPixCb, uint8_t * pPixCr, int32_t iStride, ; int32_t iAlpha, int32_t iBeta, int8_t * pTC); ;******************************************************************************* WELS_EXTERN DeblockChromaLt4H_ssse3 push ebp mov ebp,esp and esp,0FFFFFFF0h sub esp,108h mov ecx,dword [ebp+8] mov edx,dword [ebp+0Ch] mov eax,dword [ebp+10h] sub ecx,2 sub edx,2 push esi lea esi,[eax+eax*2] mov dword [esp+10h],ecx mov dword [esp+4],edx lea ecx,[ecx+eax*4] lea edx,[edx+eax*4] lea eax,[esp+6Ch] push edi mov dword [esp+0Ch],esi mov dword [esp+18h],ecx mov dword [esp+10h],edx mov dword [esp+1Ch],eax mov esi,dword [esp+14h] mov ecx,dword [ebp+10h] mov edx,dword [esp+0Ch] movd xmm0,dword [esi] movd xmm1,dword [esi+ecx] movd xmm2,dword [esi+ecx*2] movd xmm3,dword [esi+edx] mov esi,dword [esp+8] movd xmm4,dword [esi] movd xmm5,dword [esi+ecx] movd xmm6,dword [esi+ecx*2] movd xmm7,dword [esi+edx] punpckldq xmm0,xmm4 punpckldq xmm1,xmm5 punpckldq xmm2,xmm6 punpckldq xmm3,xmm7 mov esi,dword [esp+18h] mov edi,dword [esp+10h] movd xmm4,dword [esi] movd xmm5,dword [edi] punpckldq xmm4,xmm5 punpcklqdq xmm0,xmm4 movd xmm4,dword [esi+ecx] movd xmm5,dword [edi+ecx] punpckldq xmm4,xmm5 punpcklqdq xmm1,xmm4 movd xmm4,dword [esi+ecx*2] movd xmm5,dword [edi+ecx*2] punpckldq xmm4,xmm5 punpcklqdq xmm2,xmm4 movd xmm4,dword [esi+edx] movd xmm5,dword [edi+edx] punpckldq xmm4,xmm5 punpcklqdq xmm3,xmm4 movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov edi,dword [esp+1Ch] movdqa [edi],xmm0 movdqa [edi+10h],xmm5 movdqa [edi+20h],xmm1 movdqa [edi+30h],xmm6 mov eax,dword [ebp+1Ch] movsx cx,byte [eax+3] movsx dx,byte [eax+2] movsx si,byte [eax+1] movsx ax,byte [eax] movzx edi,cx movzx ecx,cx movd xmm2,ecx movzx ecx,dx movzx edx,dx movd xmm3,ecx movd xmm4,edx movzx ecx,si movzx edx,si movd xmm5,ecx pxor xmm0,xmm0 movd xmm6,edx movzx ecx,ax movdqa [esp+60h],xmm0 movzx edx,ax movsx eax,word [ebp+14h] punpcklwd xmm6,xmm2 movd xmm1,edi movd xmm7,ecx movsx ecx,word [ebp+18h] movd xmm0,edx punpcklwd xmm7,xmm3 punpcklwd xmm5,xmm1 movdqa xmm1,[esp+60h] punpcklwd xmm7,xmm5 movdqa xmm5,[esp+0A0h] punpcklwd xmm0,xmm4 punpcklwd xmm0,xmm6 movdqa xmm6, [esp+70h] punpcklwd xmm0,xmm7 movdqa xmm7,[esp+80h] movdqa xmm2,xmm1 psubw xmm2,xmm0 movdqa [esp+0D0h],xmm2 movd xmm2,eax movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm4,xmm3,0 movd xmm2,ecx movdqa xmm3,xmm2 punpcklwd xmm3,xmm2 pshufd xmm2,xmm3,0 movdqa xmm3, [esp+90h] movdqa [esp+50h],xmm2 movdqa xmm2,xmm6 punpcklbw xmm2,xmm1 punpckhbw xmm6,xmm1 movdqa [esp+40h],xmm2 movdqa [esp+0B0h],xmm6 movdqa xmm6,[esp+90h] movdqa xmm2,xmm7 punpckhbw xmm7,xmm1 punpckhbw xmm6,xmm1 punpcklbw xmm2,xmm1 punpcklbw xmm3,xmm1 punpcklbw xmm5,xmm1 movdqa [esp+0F0h],xmm7 movdqa [esp+0C0h],xmm6 movdqa xmm6, [esp+0A0h] punpckhbw xmm6,xmm1 movdqa [esp+0E0h],xmm6 mov edx,4 movsx eax,dx movd xmm6,eax movdqa xmm7,xmm6 punpcklwd xmm7,xmm6 pshufd xmm6,xmm7,0 movdqa [esp+30h],xmm6 movdqa xmm7, [esp+40h] psubw xmm7,xmm5 movdqa xmm6,xmm0 pcmpgtw xmm6,xmm1 movdqa [esp+60h],xmm6 movdqa xmm1, [esp+0D0h] movdqa xmm6,xmm3 psubw xmm6,xmm2 psllw xmm6,2 paddw xmm6,xmm7 paddw xmm6,[esp+30h] psraw xmm6,3 pmaxsw xmm1,xmm6 movdqa xmm7,[esp+50h] movdqa [esp+20h],xmm0 movdqa xmm6, [esp+20h] pminsw xmm6,xmm1 movdqa [esp+20h],xmm6 movdqa xmm6,xmm4 movdqa xmm1,xmm2 psubw xmm1,xmm3 pabsw xmm1,xmm1 pcmpgtw xmm6,xmm1 movdqa xmm1, [esp+40h] psubw xmm1,xmm2 pabsw xmm1,xmm1 pcmpgtw xmm7,xmm1 movdqa xmm1, [esp+50h] pand xmm6,xmm7 movdqa xmm7, [esp+50h] psubw xmm5,xmm3 pabsw xmm5,xmm5 pcmpgtw xmm1,xmm5 movdqa xmm5, [esp+0B0h] psubw xmm5,[esp+0E0h] pand xmm6,xmm1 pand xmm6, [esp+60h] movdqa xmm1, [esp+20h] pand xmm1,xmm6 movdqa xmm6, [esp+0C0h] movdqa [esp+40h],xmm1 movdqa xmm1, [esp+0F0h] psubw xmm6,xmm1 psllw xmm6,2 paddw xmm6,xmm5 paddw xmm6, [esp+30h] movdqa xmm5, [esp+0D0h] psraw xmm6,3 pmaxsw xmm5,xmm6 pminsw xmm0,xmm5 movdqa xmm5,[esp+0C0h] movdqa xmm6,xmm1 psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm4,xmm6 movdqa xmm6,[esp+0B0h] psubw xmm6,xmm1 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 movdqa xmm6, [esp+0E0h] pand xmm4,xmm7 movdqa xmm7, [esp+50h] psubw xmm6,xmm5 pabsw xmm6,xmm6 pcmpgtw xmm7,xmm6 pand xmm4,xmm7 pand xmm4,[esp+60h] pand xmm0,xmm4 movdqa xmm4, [esp+40h] paddw xmm2,xmm4 paddw xmm1,xmm0 psubw xmm3,xmm4 psubw xmm5,xmm0 packuswb xmm2,xmm1 packuswb xmm3,xmm5 movdqa [esp+80h],xmm2 movdqa [esp+90h],xmm3 mov esi,dword [esp+1Ch] movdqa xmm0, [esi] movdqa xmm1, [esi+10h] movdqa xmm2, [esi+20h] movdqa xmm3, [esi+30h] movdqa xmm6,xmm0 punpcklbw xmm0,xmm1 punpckhbw xmm6,xmm1 movdqa xmm7,xmm2 punpcklbw xmm2,xmm3 punpckhbw xmm7,xmm3 movdqa xmm4,xmm0 movdqa xmm5,xmm6 punpcklwd xmm0,xmm2 punpckhwd xmm4,xmm2 punpcklwd xmm6,xmm7 punpckhwd xmm5,xmm7 movdqa xmm1,xmm0 movdqa xmm2,xmm4 punpckldq xmm0,xmm6 punpckhdq xmm1,xmm6 punpckldq xmm4,xmm5 punpckhdq xmm2,xmm5 movdqa xmm5,xmm0 movdqa xmm6,xmm1 punpcklqdq xmm0,xmm4 punpckhqdq xmm5,xmm4 punpcklqdq xmm1,xmm2 punpckhqdq xmm6,xmm2 mov esi,dword [esp+14h] mov ecx,dword [ebp+10h] mov edx,dword [esp+0Ch] mov edi,dword [esp+8] movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov esi,dword [esp+18h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 movd dword [esi],xmm0 movd dword [esi+ecx],xmm5 movd dword [esi+ecx*2],xmm1 movd dword [esi+edx],xmm6 psrldq xmm0,4 psrldq xmm5,4 psrldq xmm1,4 psrldq xmm6,4 mov edi,dword [esp+10h] movd dword [edi],xmm0 movd dword [edi+ecx],xmm5 movd dword [edi+ecx*2],xmm1 movd dword [edi+edx],xmm6 pop edi pop esi mov esp,ebp pop ebp ret ;******************************************************************************* ; void DeblockLumaLt4V_ssse3(uint8_t * pPix, int32_t iStride, int32_t iAlpha, ; int32_t iBeta, int8_t * pTC) ;******************************************************************************* WELS_EXTERN DeblockLumaLt4V_ssse3 push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 420 ; 000001a4H mov eax, dword [ebp+8] mov ecx, dword [ebp+12] pxor xmm0, xmm0 push ebx mov edx, dword [ebp+24] movdqa [esp+424-384], xmm0 push esi lea esi, [ecx+ecx*2] push edi mov edi, eax sub edi, esi movdqa xmm0, [edi] lea esi, [ecx+ecx] movdqa [esp+432-208], xmm0 mov edi, eax sub edi, esi movdqa xmm0, [edi] movdqa [esp+448-208], xmm0 mov ebx, eax sub ebx, ecx movdqa xmm0, [ebx] movdqa [esp+464-208], xmm0 movdqa xmm0, [eax] add ecx, eax movdqa [esp+480-208], xmm0 movdqa xmm0, [ecx] mov dword [esp+432-404], ecx movsx ecx, word [ebp+16] movdqa [esp+496-208], xmm0 movdqa xmm0, [esi+eax] movsx si, byte [edx] movdqa [esp+512-208], xmm0 movd xmm0, ecx movsx ecx, word [ebp+20] movdqa xmm1, xmm0 punpcklwd xmm1, xmm0 pshufd xmm0, xmm1, 0 movdqa [esp+432-112], xmm0 movd xmm0, ecx movsx cx, byte [edx+1] movdqa xmm1, xmm0 punpcklwd xmm1, xmm0 mov dword [esp+432-408], ebx movzx ebx, cx pshufd xmm0, xmm1, 0 movd xmm1, ebx movzx ebx, cx movd xmm2, ebx movzx ebx, cx movzx ecx, cx movd xmm4, ecx movzx ecx, si movd xmm5, ecx movzx ecx, si movd xmm6, ecx movzx ecx, si movd xmm7, ecx movzx ecx, si movdqa [esp+432-336], xmm0 movd xmm0, ecx movsx cx, byte [edx+3] movsx dx, byte [edx+2] movd xmm3, ebx punpcklwd xmm0, xmm4 movzx esi, cx punpcklwd xmm6, xmm2 punpcklwd xmm5, xmm1 punpcklwd xmm0, xmm6 punpcklwd xmm7, xmm3 punpcklwd xmm7, xmm5 punpcklwd xmm0, xmm7 movdqa [esp+432-400], xmm0 movd xmm0, esi movzx esi, cx movd xmm2, esi movzx esi, cx movzx ecx, cx movd xmm4, ecx movzx ecx, dx movd xmm3, esi movd xmm5, ecx punpcklwd xmm5, xmm0 movdqa xmm0, [esp+432-384] movzx ecx, dx movd xmm6, ecx movzx ecx, dx movzx edx, dx punpcklwd xmm6, xmm2 movd xmm7, ecx movd xmm1, edx movdqa xmm2, [esp+448-208] punpcklbw xmm2, xmm0 mov ecx, 4 movsx edx, cx punpcklwd xmm7, xmm3 punpcklwd xmm7, xmm5 movdqa xmm5, [esp+496-208] movdqa xmm3, [esp+464-208] punpcklbw xmm5, xmm0 movdqa [esp+432-240], xmm5 movdqa xmm5, [esp+512-208] punpcklbw xmm5, xmm0 movdqa [esp+432-352], xmm5 punpcklwd xmm1, xmm4 movdqa xmm4, [esp+432-208] punpcklwd xmm1, xmm6 movdqa xmm6, [esp+480-208] punpcklwd xmm1, xmm7 punpcklbw xmm6, xmm0 punpcklbw xmm3, xmm0 punpcklbw xmm4, xmm0 movdqa xmm7, xmm3 psubw xmm7, xmm4 pabsw xmm7, xmm7 movdqa [esp+432-272], xmm4 movdqa xmm4, [esp+432-336] movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-288], xmm5 movdqa xmm7, xmm6 psubw xmm7, [esp+432-352] pabsw xmm7, xmm7 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-256], xmm5 movdqa xmm5, xmm3 pavgw xmm5, xmm6 movdqa [esp+432-304], xmm5 movdqa xmm5, [esp+432-400] psubw xmm5, [esp+432-288] psubw xmm5, [esp+432-256] movdqa [esp+432-224], xmm5 movdqa xmm5, xmm6 psubw xmm5, xmm3 movdqa [esp+432-32], xmm6 psubw xmm6, [esp+432-240] movdqa xmm7, xmm5 movdqa [esp+432-384], xmm5 movdqa xmm5, [esp+432-112] pabsw xmm7, xmm7 pcmpgtw xmm5, xmm7 pabsw xmm6, xmm6 movdqa xmm7, xmm4 pcmpgtw xmm7, xmm6 pand xmm5, xmm7 movdqa xmm6, xmm3 psubw xmm6, xmm2 pabsw xmm6, xmm6 movdqa xmm7, xmm4 pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+432-400] pand xmm5, xmm7 movdqa xmm7, xmm6 pcmpeqw xmm6, xmm0 pcmpgtw xmm7, xmm0 por xmm7, xmm6 pand xmm5, xmm7 movdqa [esp+432-320], xmm5 movd xmm5, edx movdqa xmm6, xmm5 punpcklwd xmm6, xmm5 pshufd xmm5, xmm6, 0 movdqa [esp+432-336], xmm5 movdqa xmm5, [esp+432-224] movdqa [esp+432-368], xmm5 movdqa xmm6, xmm0 psubw xmm6, xmm5 movdqa xmm5, [esp+432-384] psllw xmm5, 2 movdqa xmm7, xmm2 psubw xmm7, [esp+432-240] paddw xmm7, xmm5 paddw xmm7, [esp+432-336] movdqa xmm5, [esp+432-368] psraw xmm7, 3 pmaxsw xmm6, xmm7 pminsw xmm5, xmm6 pand xmm5, [esp+432-320] movdqa xmm6, [esp+432-400] movdqa [esp+432-64], xmm5 movdqa [esp+432-384], xmm6 movdqa xmm5, xmm0 psubw xmm5, xmm6 movdqa [esp+432-368], xmm5 movdqa xmm6, xmm5 movdqa xmm5, [esp+432-272] paddw xmm5, [esp+432-304] movdqa xmm7, xmm2 paddw xmm7, xmm2 psubw xmm5, xmm7 psraw xmm5, 1 pmaxsw xmm6, xmm5 movdqa xmm5, [esp+432-384] pminsw xmm5, xmm6 pand xmm5, [esp+432-320] pand xmm5, [esp+432-288] movdqa xmm6, [esp+432-240] movdqa [esp+432-96], xmm5 movdqa xmm5, [esp+432-352] paddw xmm5, [esp+432-304] movdqa xmm7, xmm6 paddw xmm7, xmm6 movdqa xmm6, [esp+432-368] psubw xmm5, xmm7 movdqa xmm7, [esp+496-208] psraw xmm5, 1 pmaxsw xmm6, xmm5 movdqa xmm5, [esp+432-400] pminsw xmm5, xmm6 pand xmm5, [esp+432-320] pand xmm5, [esp+432-256] movdqa xmm6, [esp+448-208] punpckhbw xmm7, xmm0 movdqa [esp+432-352], xmm7 movdqa xmm7, [esp+512-208] punpckhbw xmm6, xmm0 movdqa [esp+432-48], xmm5 movdqa xmm5, [esp+432-208] movdqa [esp+432-368], xmm6 movdqa xmm6, [esp+464-208] punpckhbw xmm7, xmm0 punpckhbw xmm5, xmm0 movdqa [esp+432-384], xmm7 punpckhbw xmm6, xmm0 movdqa [esp+432-400], xmm6 movdqa xmm7, [esp+432-400] movdqa xmm6, [esp+480-208] psubw xmm7, xmm5 movdqa [esp+432-16], xmm5 pabsw xmm7, xmm7 punpckhbw xmm6, xmm0 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-288], xmm5 movdqa xmm7, xmm6 psubw xmm7, [esp+432-384] pabsw xmm7, xmm7 movdqa xmm5, xmm4 pcmpgtw xmm5, xmm7 movdqa [esp+432-256], xmm5 movdqa xmm5, [esp+432-400] movdqa [esp+432-80], xmm6 pavgw xmm5, xmm6 movdqa [esp+432-304], xmm5 movdqa xmm5, xmm1 psubw xmm5, [esp+432-288] psubw xmm5, [esp+432-256] movdqa [esp+432-224], xmm5 movdqa xmm5, xmm6 psubw xmm5, [esp+432-400] psubw xmm6, [esp+432-352] movdqa [esp+432-272], xmm5 movdqa xmm7, xmm5 movdqa xmm5, [esp+432-112] pabsw xmm7, xmm7 pcmpgtw xmm5, xmm7 movdqa xmm7, xmm4 pabsw xmm6, xmm6 pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+432-368] pand xmm5, xmm7 movdqa xmm7, [esp+432-400] psubw xmm7, xmm6 psubw xmm6, [esp+432-352] pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm5, xmm4 paddw xmm2, [esp+432-96] movdqa xmm4, xmm1 pcmpgtw xmm4, xmm0 movdqa xmm7, xmm1 pcmpeqw xmm7, xmm0 por xmm4, xmm7 pand xmm5, xmm4 movdqa xmm4, [esp+432-224] movdqa [esp+432-320], xmm5 movdqa xmm5, [esp+432-272] movdqa xmm7, xmm0 psubw xmm7, xmm4 psubw xmm0, xmm1 psllw xmm5, 2 paddw xmm6, xmm5 paddw xmm6, [esp+432-336] movdqa xmm5, [esp+432-368] movdqa [esp+432-336], xmm0 psraw xmm6, 3 pmaxsw xmm7, xmm6 pminsw xmm4, xmm7 pand xmm4, [esp+432-320] movdqa xmm6, xmm0 movdqa xmm0, [esp+432-16] paddw xmm0, [esp+432-304] movdqa [esp+432-272], xmm4 movdqa xmm4, [esp+432-368] paddw xmm4, xmm4 psubw xmm0, xmm4 movdqa xmm4, [esp+432-64] psraw xmm0, 1 pmaxsw xmm6, xmm0 movdqa xmm0, [esp+432-400] movdqa xmm7, xmm1 pminsw xmm7, xmm6 movdqa xmm6, [esp+432-320] pand xmm7, xmm6 pand xmm7, [esp+432-288] paddw xmm5, xmm7 packuswb xmm2, xmm5 movdqa xmm5, [esp+432-272] paddw xmm0, xmm5 paddw xmm3, xmm4 packuswb xmm3, xmm0 movdqa xmm0, [esp+432-32] psubw xmm0, xmm4 movdqa xmm4, [esp+432-80] psubw xmm4, xmm5 movdqa xmm5, [esp+432-240] paddw xmm5, [esp+432-48] packuswb xmm0, xmm4 movdqa xmm4, [esp+432-384] paddw xmm4, [esp+432-304] movdqa [esp+480-208], xmm0 movdqa xmm0, [esp+432-352] movdqa xmm7, xmm0 paddw xmm0, xmm0 mov ecx, dword [esp+432-408] mov edx, dword [esp+432-404] psubw xmm4, xmm0 movdqa xmm0, [esp+432-336] movdqa [edi], xmm2 psraw xmm4, 1 pmaxsw xmm0, xmm4 pminsw xmm1, xmm0 movdqa xmm0, [esp+480-208] pop edi pand xmm1, xmm6 pand xmm1, [esp+428-256] movdqa [ecx], xmm3 paddw xmm7, xmm1 pop esi packuswb xmm5, xmm7 movdqa [eax], xmm0 movdqa [edx], xmm5 pop ebx mov esp, ebp pop ebp ret ;******************************************************************************* ; void DeblockLumaEq4V_ssse3(uint8_t * pPix, int32_t iStride, int32_t iAlpha, ; int32_t iBeta) ;******************************************************************************* WELS_EXTERN DeblockLumaEq4V_ssse3 push ebp mov ebp, esp and esp, -16 ; fffffff0H sub esp, 628 ; 00000274H mov eax, dword [ebp+8] mov ecx, dword [ebp+12] push ebx push esi lea edx, [ecx*4] pxor xmm0, xmm0 movdqa xmm2, xmm0 movdqa xmm0, [ecx+eax] mov esi, eax sub esi, edx movdqa xmm3, [esi] movdqa xmm5, [eax] push edi lea edi, [ecx+ecx] lea ebx, [ecx+ecx*2] mov dword [esp+640-600], edi mov esi, eax sub esi, edi movdqa xmm1, [esi] movdqa [esp+720-272], xmm0 mov edi, eax sub edi, ecx movdqa xmm4, [edi] add ecx, eax mov dword [esp+640-596], ecx mov ecx, dword [esp+640-600] movdqa xmm0, [ecx+eax] movdqa [esp+736-272], xmm0 movdqa xmm0, [eax+ebx] mov edx, eax sub edx, ebx movsx ebx, word [ebp+16] movdqa xmm6, [edx] add ecx, eax movdqa [esp+752-272], xmm0 movd xmm0, ebx movsx ebx, word [ebp+20] movdqa xmm7, xmm0 punpcklwd xmm7, xmm0 pshufd xmm0, xmm7, 0 movdqa [esp+640-320], xmm0 movd xmm0, ebx movdqa xmm7, xmm0 punpcklwd xmm7, xmm0 pshufd xmm0, xmm7, 0 movdqa xmm7, [esp+736-272] punpcklbw xmm7, xmm2 movdqa [esp+640-416], xmm7 movdqa [esp+640-512], xmm0 movdqa xmm0, xmm1 movdqa [esp+672-272], xmm1 movdqa xmm1, xmm4 movdqa [esp+704-272], xmm5 punpcklbw xmm5, xmm2 punpcklbw xmm1, xmm2 movdqa xmm7, xmm5 psubw xmm7, xmm1 pabsw xmm7, xmm7 movdqa [esp+640-560], xmm7 punpcklbw xmm0, xmm2 movdqa [esp+688-272], xmm4 movdqa xmm4, [esp+720-272] movdqa [esp+640-480], xmm0 movdqa xmm7, xmm1 psubw xmm7, xmm0 movdqa xmm0, [esp+640-512] pabsw xmm7, xmm7 punpcklbw xmm4, xmm2 pcmpgtw xmm0, xmm7 movdqa [esp+640-384], xmm4 movdqa xmm7, xmm5 psubw xmm7, xmm4 movdqa xmm4, [esp+640-512] movdqa [esp+656-272], xmm6 punpcklbw xmm6, xmm2 pabsw xmm7, xmm7 movdqa [esp+640-48], xmm2 movdqa [esp+640-368], xmm6 movdqa [esp+640-144], xmm1 movdqa [esp+640-400], xmm5 pcmpgtw xmm4, xmm7 pand xmm0, xmm4 movdqa xmm4, [esp+640-320] pcmpgtw xmm4, [esp+640-560] pand xmm0, xmm4 mov ebx, 2 movsx ebx, bx movd xmm4, ebx movdqa xmm7, xmm4 punpcklwd xmm7, xmm4 movdqa xmm4, [esp+640-320] psraw xmm4, 2 pshufd xmm7, xmm7, 0 paddw xmm4, xmm7 movdqa [esp+640-576], xmm4 pcmpgtw xmm4, [esp+640-560] movdqa [esp+640-560], xmm4 movdqa xmm4, [esp+640-512] movdqa [esp+640-624], xmm7 movdqa xmm7, xmm1 psubw xmm7, xmm6 pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm4, [esp+640-560] movdqa [esp+640-544], xmm4 movdqa xmm4, [esp+640-512] movdqa xmm7, xmm5 psubw xmm7, [esp+640-416] pabsw xmm7, xmm7 pcmpgtw xmm4, xmm7 pand xmm4, [esp+640-560] movdqa [esp+640-560], xmm4 movdqa xmm4, [esp+640-544] pandn xmm4, xmm6 movdqa [esp+640-16], xmm4 mov ebx, 4 movsx ebx, bx movd xmm4, ebx movdqa xmm7, xmm4 punpcklwd xmm7, xmm4 movdqa xmm4, xmm3 punpcklbw xmm4, xmm2 psllw xmm4, 1 paddw xmm4, xmm6 paddw xmm4, xmm6 paddw xmm4, xmm6 paddw xmm4, [esp+640-480] movdqa xmm6, [esp+640-560] pshufd xmm7, xmm7, 0 paddw xmm4, xmm1 movdqa [esp+640-592], xmm7 paddw xmm4, xmm5 paddw xmm4, xmm7 movdqa xmm7, [esp+640-416] pandn xmm6, xmm7 movdqa [esp+640-80], xmm6 movdqa xmm6, [esp+752-272] punpcklbw xmm6, xmm2 psllw xmm6, 1 paddw xmm6, xmm7 paddw xmm6, xmm7 paddw xmm6, xmm7 paddw xmm6, [esp+640-384] movdqa xmm7, [esp+640-480] paddw xmm6, xmm5 paddw xmm6, xmm1 paddw xmm6, [esp+640-592] psraw xmm6, 3 pand xmm6, [esp+640-560] movdqa [esp+640-112], xmm6 movdqa xmm6, [esp+640-544] pandn xmm6, xmm7 movdqa [esp+640-336], xmm6 movdqa xmm6, [esp+640-544] movdqa [esp+640-528], xmm6 movdqa xmm6, [esp+640-368] paddw xmm6, xmm7 movdqa xmm7, xmm1 psraw xmm4, 3 pand xmm4, [esp+640-544] paddw xmm7, xmm5 paddw xmm6, xmm7 paddw xmm6, [esp+640-624] movdqa xmm7, [esp+640-528] paddw xmm5, xmm1 psraw xmm6, 2 pand xmm7, xmm6 movdqa xmm6, [esp+640-384] movdqa [esp+640-64], xmm7 movdqa xmm7, [esp+640-560] pandn xmm7, xmm6 movdqa [esp+640-304], xmm7 movdqa xmm7, [esp+640-560] movdqa [esp+640-528], xmm7 movdqa xmm7, [esp+640-416] paddw xmm7, xmm6 paddw xmm7, xmm5 paddw xmm7, [esp+640-624] movdqa xmm5, [esp+640-528] psraw xmm7, 2 pand xmm5, xmm7 movdqa [esp+640-32], xmm5 movdqa xmm5, [esp+640-544] movdqa [esp+640-528], xmm5 movdqa xmm5, [esp+640-480] movdqa xmm7, xmm5 paddw xmm7, xmm5 movdqa xmm5, xmm1 paddw xmm5, xmm6 paddw xmm6, [esp+640-592] paddw xmm7, xmm5 paddw xmm7, [esp+640-624] movdqa xmm5, [esp+640-528] psraw xmm7, 2 pandn xmm5, xmm7 movdqa xmm7, [esp+640-480] paddw xmm7, xmm1 paddw xmm7, [esp+640-400] movdqa xmm1, [esp+640-544] movdqa [esp+640-352], xmm5 movdqa xmm5, [esp+640-368] psllw xmm7, 1 paddw xmm7, xmm6 paddw xmm5, xmm7 movdqa xmm7, [esp+640-400] psraw xmm5, 3 pand xmm1, xmm5 movdqa xmm5, [esp+640-480] movdqa [esp+640-96], xmm1 movdqa xmm1, [esp+640-560] movdqa [esp+640-528], xmm1 movdqa xmm1, [esp+640-384] movdqa xmm6, xmm1 paddw xmm6, xmm1 paddw xmm1, [esp+640-400] paddw xmm1, [esp+640-144] paddw xmm7, xmm5 paddw xmm5, [esp+640-592] paddw xmm6, xmm7 paddw xmm6, [esp+640-624] movdqa xmm7, [esp+640-528] psraw xmm6, 2 psllw xmm1, 1 paddw xmm1, xmm5 movdqa xmm5, [esp+656-272] pandn xmm7, xmm6 movdqa xmm6, [esp+640-416] paddw xmm6, xmm1 movdqa xmm1, [esp+640-560] psraw xmm6, 3 pand xmm1, xmm6 movdqa xmm6, [esp+704-272] movdqa [esp+640-128], xmm1 movdqa xmm1, [esp+672-272] punpckhbw xmm1, xmm2 movdqa [esp+640-448], xmm1 movdqa xmm1, [esp+688-272] punpckhbw xmm1, xmm2 punpckhbw xmm6, xmm2 movdqa [esp+640-288], xmm7 punpckhbw xmm5, xmm2 movdqa [esp+640-496], xmm1 movdqa [esp+640-432], xmm6 movdqa xmm7, [esp+720-272] punpckhbw xmm7, xmm2 movdqa [esp+640-464], xmm7 movdqa xmm7, [esp+736-272] punpckhbw xmm7, xmm2 movdqa [esp+640-528], xmm7 movdqa xmm7, xmm6 psubw xmm6, [esp+640-464] psubw xmm7, xmm1 pabsw xmm7, xmm7 movdqa [esp+640-560], xmm7 por xmm4, [esp+640-16] pabsw xmm6, xmm6 movdqa xmm7, xmm1 psubw xmm7, [esp+640-448] movdqa xmm1, [esp+640-512] pabsw xmm7, xmm7 pcmpgtw xmm1, xmm7 movdqa xmm7, [esp+640-512] pcmpgtw xmm7, xmm6 movdqa xmm6, [esp+640-320] pand xmm1, xmm7 movdqa xmm7, [esp+640-560] pcmpgtw xmm6, xmm7 pand xmm1, xmm6 movdqa xmm6, [esp+640-576] pcmpgtw xmm6, xmm7 movdqa xmm7, [esp+640-496] punpckhbw xmm3, xmm2 movdqa [esp+640-560], xmm6 movdqa xmm6, [esp+640-512] psubw xmm7, xmm5 pabsw xmm7, xmm7 pcmpgtw xmm6, xmm7 pand xmm6, [esp+640-560] movdqa xmm7, [esp+640-432] psubw xmm7, [esp+640-528] psllw xmm3, 1 movdqa [esp+640-544], xmm6 movdqa xmm6, [esp+640-512] movdqa xmm2, [esp+640-544] paddw xmm3, xmm5 paddw xmm3, xmm5 paddw xmm3, xmm5 paddw xmm3, [esp+640-448] paddw xmm3, [esp+640-496] pabsw xmm7, xmm7 pcmpgtw xmm6, xmm7 pand xmm6, [esp+640-560] movdqa [esp+640-560], xmm6 movdqa xmm6, xmm0 pand xmm6, xmm4 movdqa xmm4, xmm0 pandn xmm4, [esp+640-368] por xmm6, xmm4 movdqa xmm4, [esp+640-432] paddw xmm3, xmm4 paddw xmm3, [esp+640-592] psraw xmm3, 3 pand xmm3, xmm2 pandn xmm2, xmm5 por xmm3, xmm2 movdqa xmm7, xmm1 pand xmm7, xmm3 movdqa xmm3, [esp+640-64] por xmm3, [esp+640-336] movdqa xmm2, xmm1 pandn xmm2, xmm5 por xmm7, xmm2 movdqa xmm2, xmm0 pand xmm2, xmm3 movdqa xmm3, xmm0 pandn xmm3, [esp+640-480] por xmm2, xmm3 packuswb xmm6, xmm7 movdqa [esp+640-336], xmm2 movdqa [esp+656-272], xmm6 movdqa xmm6, [esp+640-544] movdqa xmm2, xmm5 paddw xmm2, [esp+640-448] movdqa xmm3, xmm1 movdqa xmm7, [esp+640-496] paddw xmm7, xmm4 paddw xmm2, xmm7 paddw xmm2, [esp+640-624] movdqa xmm7, [esp+640-544] psraw xmm2, 2 pand xmm6, xmm2 movdqa xmm2, [esp+640-448] pandn xmm7, xmm2 por xmm6, xmm7 pand xmm3, xmm6 movdqa xmm6, xmm1 pandn xmm6, xmm2 paddw xmm2, [esp+640-496] paddw xmm2, xmm4 por xmm3, xmm6 movdqa xmm6, [esp+640-336] packuswb xmm6, xmm3 psllw xmm2, 1 movdqa [esp+672-272], xmm6 movdqa xmm6, [esp+640-96] por xmm6, [esp+640-352] movdqa xmm3, xmm0 pand xmm3, xmm6 movdqa xmm6, xmm0 pandn xmm6, [esp+640-144] por xmm3, xmm6 movdqa xmm6, [esp+640-544] movdqa [esp+640-352], xmm3 movdqa xmm3, [esp+640-464] paddw xmm3, [esp+640-592] paddw xmm2, xmm3 movdqa xmm3, [esp+640-448] paddw xmm5, xmm2 movdqa xmm2, [esp+640-496] psraw xmm5, 3 pand xmm6, xmm5 movdqa xmm5, [esp+640-464] paddw xmm2, xmm5 paddw xmm5, [esp+640-432] movdqa xmm4, xmm3 paddw xmm4, xmm3 paddw xmm4, xmm2 paddw xmm4, [esp+640-624] movdqa xmm2, [esp+640-544] paddw xmm3, [esp+640-592] psraw xmm4, 2 pandn xmm2, xmm4 por xmm6, xmm2 movdqa xmm7, xmm1 pand xmm7, xmm6 movdqa xmm6, [esp+640-496] movdqa xmm2, xmm1 pandn xmm2, xmm6 por xmm7, xmm2 movdqa xmm2, [esp+640-352] packuswb xmm2, xmm7 movdqa [esp+688-272], xmm2 movdqa xmm2, [esp+640-128] por xmm2, [esp+640-288] movdqa xmm4, xmm0 pand xmm4, xmm2 paddw xmm5, xmm6 movdqa xmm2, xmm0 pandn xmm2, [esp+640-400] por xmm4, xmm2 movdqa xmm2, [esp+640-528] psllw xmm5, 1 paddw xmm5, xmm3 movdqa xmm3, [esp+640-560] paddw xmm2, xmm5 psraw xmm2, 3 movdqa [esp+640-288], xmm4 movdqa xmm4, [esp+640-560] pand xmm4, xmm2 movdqa xmm2, [esp+640-464] movdqa xmm5, xmm2 paddw xmm5, xmm2 movdqa xmm2, [esp+640-432] paddw xmm2, [esp+640-448] movdqa xmm7, xmm1 paddw xmm5, xmm2 paddw xmm5, [esp+640-624] movdqa xmm6, [esp+640-560] psraw xmm5, 2 pandn xmm3, xmm5 por xmm4, xmm3 movdqa xmm3, [esp+640-32] por xmm3, [esp+640-304] pand xmm7, xmm4 movdqa xmm4, [esp+640-432] movdqa xmm5, [esp+640-464] movdqa xmm2, xmm1 pandn xmm2, xmm4 paddw xmm4, [esp+640-496] por xmm7, xmm2 movdqa xmm2, [esp+640-288] packuswb xmm2, xmm7 movdqa [esp+704-272], xmm2 movdqa xmm2, xmm0 pand xmm2, xmm3 movdqa xmm3, xmm0 pandn xmm3, [esp+640-384] por xmm2, xmm3 movdqa [esp+640-304], xmm2 movdqa xmm2, [esp+640-528] movdqa xmm3, xmm2 paddw xmm3, [esp+640-464] paddw xmm3, xmm4 paddw xmm3, [esp+640-624] psraw xmm3, 2 pand xmm6, xmm3 movdqa xmm3, [esp+640-560] movdqa xmm4, xmm3 pandn xmm4, xmm5 por xmm6, xmm4 movdqa xmm7, xmm1 pand xmm7, xmm6 movdqa xmm6, [esp+640-304] movdqa xmm4, xmm1 pandn xmm4, xmm5 por xmm7, xmm4 movdqa xmm4, xmm0 pandn xmm0, [esp+640-416] packuswb xmm6, xmm7 movdqa xmm7, [esp+640-112] por xmm7, [esp+640-80] pand xmm4, xmm7 por xmm4, xmm0 movdqa xmm0, [esp+752-272] punpckhbw xmm0, [esp+640-48] psllw xmm0, 1 paddw xmm0, xmm2 paddw xmm0, xmm2 paddw xmm0, xmm2 paddw xmm0, xmm5 paddw xmm0, [esp+640-432] paddw xmm0, [esp+640-496] paddw xmm0, [esp+640-592] psraw xmm0, 3 pand xmm0, xmm3 movdqa xmm7, xmm1 pandn xmm3, xmm2 por xmm0, xmm3 pand xmm7, xmm0 movdqa xmm0, [esp+656-272] movdqa [edx], xmm0 movdqa xmm0, [esp+672-272] mov edx, dword [esp+640-596] movdqa [esi], xmm0 movdqa xmm0, [esp+688-272] movdqa [edi], xmm0 movdqa xmm0, [esp+704-272] pop edi pandn xmm1, xmm2 movdqa [eax], xmm0 por xmm7, xmm1 pop esi packuswb xmm4, xmm7 movdqa [edx], xmm6 movdqa [ecx], xmm4 pop ebx mov esp, ebp pop ebp ret %endif ;******************************************************************************** ; ; void DeblockLumaTransposeH2V_sse2(uint8_t * pPixY, int32_t iStride, uint8_t * pDst); ; ;******************************************************************************** WELS_EXTERN DeblockLumaTransposeH2V_sse2 push r3 push r4 push r5 %assign push_num 3 LOAD_3_PARA PUSH_XMM 8 SIGN_EXTENSION r1, r1d mov r5, r7 mov r3, r7 and r3, 0Fh sub r7, r3 sub r7, 10h lea r3, [r0 + r1 * 8] lea r4, [r1 * 3] movq xmm0, [r0] movq xmm7, [r3] punpcklqdq xmm0, xmm7 movq xmm1, [r0 + r1] movq xmm7, [r3 + r1] punpcklqdq xmm1, xmm7 movq xmm2, [r0 + r1*2] movq xmm7, [r3 + r1*2] punpcklqdq xmm2, xmm7 movq xmm3, [r0 + r4] movq xmm7, [r3 + r4] punpcklqdq xmm3, xmm7 lea r0, [r0 + r1 * 4] lea r3, [r3 + r1 * 4] movq xmm4, [r0] movq xmm7, [r3] punpcklqdq xmm4, xmm7 movq xmm5, [r0 + r1] movq xmm7, [r3 + r1] punpcklqdq xmm5, xmm7 movq xmm6, [r0 + r1*2] movq xmm7, [r3 + r1*2] punpcklqdq xmm6, xmm7 movdqa [r7], xmm0 movq xmm7, [r0 + r4] movq xmm0, [r3 + r4] punpcklqdq xmm7, xmm0 movdqa xmm0, [r7] SSE2_TransTwo8x8B xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, [r7] ;pOut: m5, m3, m4, m8, m6, m2, m7, m1 movdqa [r2], xmm4 movdqa [r2 + 10h], xmm2 movdqa [r2 + 20h], xmm3 movdqa [r2 + 30h], xmm7 movdqa [r2 + 40h], xmm5 movdqa [r2 + 50h], xmm1 movdqa [r2 + 60h], xmm6 movdqa [r2 + 70h], xmm0 mov r7, r5 POP_XMM pop r5 pop r4 pop r3 ret ;******************************************************************************************* ; ; void DeblockLumaTransposeV2H_sse2(uint8_t * pPixY, int32_t iStride, uint8_t * pSrc); ; ;******************************************************************************************* WELS_EXTERN DeblockLumaTransposeV2H_sse2 push r3 push r4 %assign push_num 2 LOAD_3_PARA PUSH_XMM 8 SIGN_EXTENSION r1, r1d mov r4, r7 mov r3, r7 and r3, 0Fh sub r7, r3 sub r7, 10h movdqa xmm0, [r2] movdqa xmm1, [r2 + 10h] movdqa xmm2, [r2 + 20h] movdqa xmm3, [r2 + 30h] movdqa xmm4, [r2 + 40h] movdqa xmm5, [r2 + 50h] movdqa xmm6, [r2 + 60h] movdqa xmm7, [r2 + 70h] SSE2_TransTwo8x8B xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, [r7] ;pOut: m5, m3, m4, m8, m6, m2, m7, m1 lea r2, [r1 * 3] movq [r0], xmm4 movq [r0 + r1], xmm2 movq [r0 + r1*2], xmm3 movq [r0 + r2], xmm7 lea r0, [r0 + r1*4] movq [r0], xmm5 movq [r0 + r1], xmm1 movq [r0 + r1*2], xmm6 movq [r0 + r2], xmm0 psrldq xmm4, 8 psrldq xmm2, 8 psrldq xmm3, 8 psrldq xmm7, 8 psrldq xmm5, 8 psrldq xmm1, 8 psrldq xmm6, 8 psrldq xmm0, 8 lea r0, [r0 + r1*4] movq [r0], xmm4 movq [r0 + r1], xmm2 movq [r0 + r1*2], xmm3 movq [r0 + r2], xmm7 lea r0, [r0 + r1*4] movq [r0], xmm5 movq [r0 + r1], xmm1 movq [r0 + r1*2], xmm6 movq [r0 + r2], xmm0 mov r7, r4 POP_XMM pop r4 pop r3 ret
libsrc/_DEVELOPMENT/l/z80/ascii/txt_to_num/fast/l_fast_htou.asm
jpoikela/z88dk
640
21266
<filename>libsrc/_DEVELOPMENT/l/z80/ascii/txt_to_num/fast/l_fast_htou.asm SECTION code_clib SECTION code_l PUBLIC l_fast_htou EXTERN l_char2num l_fast_htou: ; ascii hex string to unsigned integer ; whitespace is not skipped, leading 0x not consumed ; char consumption stops on overflow ; ; enter : de = char *buffer ; ; exit : de = & next char to interpret in buffer ; hl = unsigned result (0 on invalid input, ahl = partial result on overflow) ; carry set on unsigned overflow ; ; uses : af, bc, de, hl ld hl,0 loop: ld a,(de) call l_char2num jr c, done cp 16 jr nc, done inc de add a,a add a,a add a,a add a,a ld c,a ld a,(de) call l_char2num jr c, done_shift cp 16 jr nc, done_shift inc de add a,c ld c,a ld a,h ld h,l ld l,c or a jr z, loop unsigned_overflow: scf ret done_shift: ld a,c add a,a adc hl,hl adc a,a adc hl,hl adc a,a adc hl,hl adc a,a adc hl,hl adc a,a ret z ; unsigned overflow scf ret done: xor a ret
examples/outdated-and-incorrect/iird/IID.agda
asr/agda-kanso
1
14875
-- The simpler case of index inductive definitions. (no induction-recursion) module IID where open import LF -- A code for an IID -- I - index set -- E = I for general IIDs -- E = One for restricted IIDs data OP (I : Set)(E : Set) : Set1 where ι : E -> OP I E σ : (A : Set)(γ : A -> OP I E) -> OP I E δ : (A : Set)(i : A -> I)(γ : OP I E) -> OP I E -- The type of constructor arguments. Parameterised over -- U - the inductive type -- This is the F of the simple polynomial type μF Args : {I : Set}{E : Set} -> OP I E -> (U : I -> Set) -> Set Args (ι e) U = One Args (σ A γ) U = A × \a -> Args (γ a) U Args (δ A i γ) U = ((a : A) -> U (i a)) × \_ -> Args γ U -- Computing the index index : {I : Set}{E : Set}(γ : OP I E)(U : I -> Set) -> Args γ U -> E index (ι e) U _ = e index (σ A γ) U a = index (γ (π₀ a)) U (π₁ a) index (δ A i γ) U a = index γ U (π₁ a) -- The assumptions of a particular inductive occurrence in a value. IndArg : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) -> Args γ U -> Set IndArg (ι e) U _ = Zero IndArg (σ A γ) U a = IndArg (γ (π₀ a)) U (π₁ a) IndArg (δ A i γ) U a = A + IndArg γ U (π₁ a) -- Given the assumptions of an inductive occurence in a value we can compute -- its index. IndIndex : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) -> (a : Args γ U) -> IndArg γ U a -> I IndIndex (ι e) U _ () IndIndex (σ A γ) U arg c = IndIndex (γ (π₀ arg)) U (π₁ arg) c IndIndex (δ A i γ) U arg (inl a) = i a IndIndex (δ A i γ) U arg (inr a) = IndIndex γ U (π₁ arg) a -- Given the assumptions of an inductive occurrence in a value we can compute -- its value. Ind : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) -> (a : Args γ U)(v : IndArg γ U a) -> U (IndIndex γ U a v) Ind (ι e) U _ () Ind (σ A γ) U arg c = Ind (γ (π₀ arg)) U (π₁ arg) c Ind (δ A i γ) U arg (inl a) = (π₀ arg) a Ind (δ A i γ) U arg (inr a) = Ind γ U (π₁ arg) a -- The type of induction hypotheses. Basically -- forall assumptions, the predicate holds for an inductive occurrence with -- those assumptions IndHyp : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) -> (F : (i : I) -> U i -> Set)(a : Args γ U) -> Set IndHyp γ U F a = (v : IndArg γ U a) -> F (IndIndex γ U a v) (Ind γ U a v) IndHyp₁ : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) -> (F : (i : I) -> U i -> Set1)(a : Args γ U) -> Set1 IndHyp₁ γ U F a = (v : IndArg γ U a) -> F (IndIndex γ U a v) (Ind γ U a v) -- If we can prove a predicate F for any values, we can construct the inductive -- hypotheses for a given value. -- Termination note: g will only be applied to values smaller than a induction : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) (F : (i : I) -> U i -> Set) (g : (i : I)(u : U i) -> F i u) (a : Args γ U) -> IndHyp γ U F a induction γ U F g a = \hyp -> g (IndIndex γ U a hyp) (Ind γ U a hyp) induction₁ : {I : Set}{E : Set} (γ : OP I E)(U : I -> Set) (F : (i : I) -> U i -> Set1) (g : (i : I)(u : U i) -> F i u) (a : Args γ U) -> IndHyp₁ γ U F a induction₁ γ U F g a = \hyp -> g (IndIndex γ U a hyp) (Ind γ U a hyp)
programs/oeis/223/A223451.asm
neoneye/loda
22
5616
; A223451: Number of idempotent 2X2 -n..n matrices of rank 1 ; 10,26,42,58,74,106,122,138,154,186,202,234,250,282,314,330,346,378,394,426,458,490,506,538,554,586,602,634,650,714,730,746,778,810,842,874,890,922,954,986,1002,1066,1082,1114,1146,1178,1194,1226,1242,1274,1306,1338,1354,1386,1418,1450,1482,1514,1530,1594,1610,1642,1674,1690,1722,1786,1802,1834,1866,1930,1946,1978,1994,2026,2058,2090,2122,2186,2202,2234,2250,2282,2298,2362,2394,2426,2458,2490,2506,2570,2602,2634,2666,2698,2730,2762,2778,2810,2842,2874 lpb $0 mov $2,$0 sub $0,1 seq $2,34444 ; a(n) is the number of unitary divisors of n (d such that d divides n, gcd(d, n/d) = 1). add $1,$2 lpe mul $1,8 add $1,10 mov $0,$1
programs/oeis/114/A114121.asm
neoneye/loda
22
247169
; A114121: Expansion of (sqrt(1 - 4*x) + (1 - 2*x))/(2*(1 - 4*x)). ; 1,2,7,26,99,382,1486,5812,22819,89846,354522,1401292,5546382,21977516,87167164,345994216,1374282019,5461770406,21717436834,86392108636,343801171354,1368640564996,5450095992964,21708901408216,86492546019214,344680279929532,1373859173316676,5477069340194552,21838743809862204,87091227287698456,347362666934142456,1385635681234477520,5527998088898683171,22056458290717684486,88013497032458494834,351241044087684248572,1401847890855829693026,5595431765037458318612,22335776255825211532084,89166371160513839426936,355985059270325381907354,1421318110039025035520596,5675158521564462243948364,22661589656345944531834216,90495505146178692775676164,361398720465121774409616616,1443337764006409849565212744,5764610727314106224870804656,23024574135499233852596789134,91966968643754766044909164636,367358322329839447041582049972,1467455027661601627512704425432,5862135324975892193665586885572,23418672132957796148712205124776,93558530660375402160598266653224,373782162923473655170945457103472,1493369237077285801812789348537916,5966624491381298333753607735687352,23839797012668418483110185721836744,95255099590384551628407244568534896,380614453366410629527898334830772472 mov $1,$0 sub $1,1 add $0,$1 bin $0,$1 mov $2,4 pow $2,$1 add $0,$2
1A/S5/PIM/tps/tp4/stocks_materiel.adb
MOUDDENEHamza/ENSEEIHT
4
12627
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; -- Auteur: <NAME>. -- Gérer un stock de matériel informatique. -- package body Stocks_Materiel is procedure Creer (Stock : out T_Stock) is begin null; end Creer; function Nb_Materiels (Stock: in T_Stock) return Integer is begin return -1; end; procedure Enregistrer ( Stock : in out T_Stock; Numero_Serie : in Integer; Nature : in T_Nature; Annee_Achat : in Integer ) is begin null; end; end Stocks_Materiel;
programs/oeis/098/A098077.asm
neoneye/loda
22
20641
; A098077: a(n) = n^2*(n+1)*(2*n+1)/3. ; 2,20,84,240,550,1092,1960,3264,5130,7700,11132,15600,21294,28420,37200,47872,60690,75924,93860,114800,139062,166980,198904,235200,276250,322452,374220,431984,496190,567300,645792,732160,826914,930580,1043700,1166832,1300550,1445444,1602120,1771200,1953322,2149140,2359324,2584560,2825550,3083012,3357680,3650304,3961650,4292500,4643652,5015920,5410134,5827140,6267800,6732992,7223610,7740564,8284780,8857200,9458782,10090500,10753344,11448320,12176450,12938772,13736340,14570224,15441510,16351300,17300712,18290880,19322954,20398100,21517500,22682352,23893870,25153284,26461840,27820800,29231442,30695060,32212964,33786480,35416950,37105732,38854200,40663744,42535770,44471700,46472972,48541040,50677374,52883460,55160800,57510912,59935330,62435604,65013300,67670000 add $0,2 mul $0,2 mov $2,$0 sub $0,2 bin $2,3 mul $0,$2 div $0,4
programs/oeis/099/A099546.asm
karttu/loda
0
105532
; A099546: Odd part of n modulo 5. ; 1,1,3,1,0,3,2,1,4,0,1,3,3,2,0,1,2,4,4,0,1,1,3,3,0,3,2,2,4,0,1,1,3,2,0,4,2,4,4,0,1,1,3,1,0,3,2,3,4,0,1,3,3,2,0,2,2,4,4,0,1,1,3,1,0,3,2,2,4,0,1,4,3,2,0,4,2,4,4,0,1,1,3,1,0,3,2,1,4,0,1,3,3,2,0,3,2,4,4,0,1,1 add $0,1 mov $2,2 lpb $0,1 gcd $2,$0 div $0,$2 lpe mod $0,5 mov $1,$0
tools-src/gnu/gcc/gcc/ada/ttypef.ads
enfoTek/tomato.linksys.e2000.nvram-mod
80
21211
<reponame>enfoTek/tomato.linksys.e2000.nvram-mod ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- T T Y P E F -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- This module contains values for the predefined floating-point attributes. -- All references to these attribute values in a program being compiled must -- use the values in this package, not the values returned by referencing -- the corresponding attributes (since that would give host machine values). -- Boolean-valued attributes are defined in System.Parameters, because they -- need a finer control than what is provided by the formats described below. -- The codes for the eight floating-point formats supported are: -- IEEES - IEEE Single Float -- IEEEL - IEEE Double Float -- IEEEX - IEEE Double Extended Float -- VAXFF - VAX F Float -- VAXDF - VAX D Float -- VAXGF - VAX G Float -- AAMPS - AAMP 32-bit Float -- AAMPL - AAMP 48-bit Float package Ttypef is ---------------------------------- -- Universal Integer Attributes -- ---------------------------------- -- Note that the constant declarations below specify values -- using the Ada model, so IEEES_Machine_Emax does not specify -- the IEEE definition of the single precision float type, -- but the value of the Ada attribute which is one higher -- as the binary point is at a different location. IEEES_Digits : constant := 6; IEEEL_Digits : constant := 15; IEEEX_Digits : constant := 18; VAXFF_Digits : constant := 6; VAXDF_Digits : constant := 9; VAXGF_Digits : constant := 15; AAMPS_Digits : constant := 6; AAMPL_Digits : constant := 9; IEEES_Machine_Emax : constant := 128; IEEEL_Machine_Emax : constant := 1024; IEEEX_Machine_Emax : constant := 16384; VAXFF_Machine_Emax : constant := 127; VAXDF_Machine_Emax : constant := 127; VAXGF_Machine_Emax : constant := 1023; AAMPS_Machine_Emax : constant := 127; AAMPL_Machine_Emax : constant := 127; IEEES_Machine_Emin : constant := -125; IEEEL_Machine_Emin : constant := -1021; IEEEX_Machine_Emin : constant := -16381; VAXFF_Machine_Emin : constant := -127; VAXDF_Machine_Emin : constant := -127; VAXGF_Machine_Emin : constant := -1023; AAMPS_Machine_Emin : constant := -127; AAMPL_Machine_Emin : constant := -127; IEEES_Machine_Mantissa : constant := 24; IEEEL_Machine_Mantissa : constant := 53; IEEEX_Machine_Mantissa : constant := 64; VAXFF_Machine_Mantissa : constant := 24; VAXDF_Machine_Mantissa : constant := 56; VAXGF_Machine_Mantissa : constant := 53; AAMPS_Machine_Mantissa : constant := 24; AAMPL_Machine_Mantissa : constant := 40; IEEES_Model_Emin : constant := -125; IEEEL_Model_Emin : constant := -1021; IEEEX_Model_Emin : constant := -16381; VAXFF_Model_Emin : constant := -127; VAXDF_Model_Emin : constant := -127; VAXGF_Model_Emin : constant := -1023; AAMPS_Model_Emin : constant := -127; AAMPL_Model_Emin : constant := -127; IEEES_Model_Mantissa : constant := 24; IEEEL_Model_Mantissa : constant := 53; IEEEX_Model_Mantissa : constant := 64; VAXFF_Model_Mantissa : constant := 24; VAXDF_Model_Mantissa : constant := 56; VAXGF_Model_Mantissa : constant := 53; AAMPS_Model_Mantissa : constant := 24; AAMPL_Model_Mantissa : constant := 40; IEEES_Safe_Emax : constant := 128; IEEEL_Safe_Emax : constant := 1024; IEEEX_Safe_Emax : constant := 16384; VAXFF_Safe_Emax : constant := 127; VAXDF_Safe_Emax : constant := 127; VAXGF_Safe_Emax : constant := 1023; AAMPS_Safe_Emax : constant := 127; AAMPL_Safe_Emax : constant := 127; ------------------------------- -- Universal Real Attributes -- ------------------------------- IEEES_Model_Epsilon : constant := 2#1.0#E-23; IEEEL_Model_Epsilon : constant := 2#1.0#E-52; IEEEX_Model_Epsilon : constant := 2#1.0#E-63; VAXFF_Model_Epsilon : constant := 16#0.1000_000#E-4; VAXDF_Model_Epsilon : constant := 16#0.4000_0000_0000_000#E-7; VAXGF_Model_Epsilon : constant := 16#0.4000_0000_0000_00#E-12; AAMPS_Model_Epsilon : constant := 2#1.0#E-23; AAMPL_Model_Epsilon : constant := 2#1.0#E-39; IEEES_Model_Small : constant := 2#1.0#E-126; IEEEL_Model_Small : constant := 2#1.0#E-1022; IEEEX_Model_Small : constant := 2#1.0#E-16381; VAXFF_Model_Small : constant := 16#0.8000_000#E-21; VAXDF_Model_Small : constant := 16#0.8000_0000_0000_000#E-31; VAXGF_Model_Small : constant := 16#0.8000_0000_0000_00#E-51; AAMPS_Model_Small : constant := 16#0.8000_000#E-21; AAMPL_Model_Small : constant := 16#0.8000_0000_000#E-31; IEEES_Safe_First : constant := -16#0.FFFF_FF#E+32; IEEEL_Safe_First : constant := -16#0.FFFF_FFFF_FFFF_F8#E+256; IEEEX_Safe_First : constant := -16#0.FFFF_FFFF_FFFF_FFFF#E+4096; VAXFF_Safe_First : constant := -16#0.7FFF_FF8#E+32; VAXDF_Safe_First : constant := -16#0.7FFF_FFFF_FFFF_FF8#E-38; VAXGF_Safe_First : constant := -16#0.7FFF_FFFF_FFFF_FC#E-256; AAMPS_Safe_First : constant := -16#0.7FFF_FF8#E+32; AAMPL_Safe_First : constant := -16#0.7FFF_FFFF_FF8#E+32; IEEES_Safe_Large : constant := 16#0.FFFF_FF#E+32; IEEEL_Safe_Large : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256; IEEEX_Safe_Large : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096; VAXFF_Safe_Large : constant := 16#0.7FFF_FC0#E+32; VAXDF_Safe_Large : constant := 16#0.7FFF_FFFF_0000_000#E+32; VAXGF_Safe_Large : constant := 16#0.7FFF_FFFF_FFFF_F0#E+256; AAMPS_Safe_Large : constant := 16#0.7FFF_FC0#E+32; AAMPL_Safe_Large : constant := 16#0.7FFF_FFFF#E+32; IEEES_Safe_Last : constant := 16#0.FFFF_FF#E+32; IEEEL_Safe_Last : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256; IEEEX_Safe_Last : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096; VAXFF_Safe_Last : constant := 16#0.7FFF_FF8#E+32; VAXDF_Safe_Last : constant := 16#0.7FFF_FFFF_FFFF_FC0#E+32; VAXGF_Safe_Last : constant := 16#0.7FFF_FFFF_FFFF_FC#E+256; AAMPS_Safe_Last : constant := 16#0.7FFF_FF8#E+32; AAMPL_Safe_Last : constant := 16#0.7FFF_FFFF_FF8#E+32; IEEES_Safe_Small : constant := 2#1.0#E-126; IEEEL_Safe_Small : constant := 2#1.0#E-1022; IEEEX_Safe_Small : constant := 2#1.0#E-16381; VAXFF_Safe_Small : constant := 16#0.1000_000#E-31; VAXDF_Safe_Small : constant := 16#0.1000_0000_0000_000#E-31; VAXGF_Safe_Small : constant := 16#0.1000_0000_0000_00#E-255; AAMPS_Safe_Small : constant := 16#0.1000_000#E-31; AAMPL_Safe_Small : constant := 16#0.1000_0000_000#E-31; ---------------------- -- Typed Attributes -- ---------------------- -- The attributes First and Last are typed attributes in Ada, and yield -- values of the appropriate float type. However we still describe them -- as universal real values in this file, since we are talking about the -- target floating-point types, not the host floating-point types. IEEES_First : constant := -16#0.FFFF_FF#E+32; IEEEL_First : constant := -16#0.FFFF_FFFF_FFFF_F8#E+256; IEEEX_First : constant := -16#0.FFFF_FFFF_FFFF_FFFF#E+4096; VAXFF_First : constant := -16#0.7FFF_FF8#E+32; VAXDF_First : constant := -16#0.7FFF_FFFF_FFFF_FF8#E+32; VAXGF_First : constant := -16#0.7FFF_FFFF_FFFF_FC#E+256; AAMPS_First : constant := -16#0.7FFF_FF8#E+32; AAMPL_First : constant := -16#0.7FFF_FFFF_FF8#E+32; IEEES_Last : constant := 16#0.FFFF_FF#E+32; IEEEL_Last : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256; IEEEX_Last : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096; VAXFF_Last : constant := 16#0.7FFF_FF8#E+32; VAXDF_Last : constant := 16#0.7FFF_FFFF_FFFF_FC0#E+32; VAXGF_Last : constant := 16#0.7FFF_FFFF_FFFF_FC#E+256; AAMPS_Last : constant := 16#0.7FFF_FF8#E+32; AAMPL_Last : constant := 16#0.7FFF_FFFF_FF8#E+32; end Ttypef;
test/succeed/Issue840a.agda
larrytheliquid/agda
1
14169
module Issue840a where ------------------------------------------------------------------------ -- Prelude record ⊤ : Set where data ⊥ : Set where data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x data Bool : Set where true false : Bool {-# BUILTIN BOOL Bool #-} {-# BUILTIN TRUE true #-} {-# BUILTIN FALSE false #-} postulate String : Set {-# BUILTIN STRING String #-} primitive primStringEquality : String → String → Bool infixr 4 _,_ record Σ (A : Set) (B : A → Set) : Set where constructor _,_ field proj₁ : A proj₂ : B proj₁ ------------------------------------------------------------------------ -- Other stuff mutual infixl 5 _,_∶_ data Signature : Set₁ where ∅ : Signature _,_∶_ : (Sig : Signature) (ℓ : String) (A : Record Sig → Set) → Signature record Record (Sig : Signature) : Set where constructor rec field fun : Record-fun Sig Record-fun : Signature → Set Record-fun ∅ = ⊤ Record-fun (Sig , ℓ ∶ A) = Σ (Record Sig) A _∈_ : String → Signature → Set ℓ ∈ ∅ = ⊥ ℓ ∈ (Sig , ℓ′ ∶ A) with primStringEquality ℓ ℓ′ ... | true = ⊤ ... | false = ℓ ∈ Sig Restrict : (Sig : Signature) (ℓ : String) → ℓ ∈ Sig → Signature Restrict ∅ ℓ () Restrict (Sig , ℓ′ ∶ A) ℓ ℓ∈ with primStringEquality ℓ ℓ′ ... | true = Sig ... | false = Restrict Sig ℓ ℓ∈ Proj : (Sig : Signature) (ℓ : String) {ℓ∈ : ℓ ∈ Sig} → Record (Restrict Sig ℓ ℓ∈) → Set Proj ∅ ℓ {} Proj (Sig , ℓ′ ∶ A) ℓ {ℓ∈} with primStringEquality ℓ ℓ′ ... | true = A ... | false = Proj Sig ℓ {ℓ∈} _∣_ : {Sig : Signature} → Record Sig → (ℓ : String) {ℓ∈ : ℓ ∈ Sig} → Record (Restrict Sig ℓ ℓ∈) _∣_ {Sig = ∅} r ℓ {} _∣_ {Sig = Sig , ℓ′ ∶ A} (rec r) ℓ {ℓ∈} with primStringEquality ℓ ℓ′ ... | true = Σ.proj₁ r ... | false = _∣_ (Σ.proj₁ r) ℓ {ℓ∈} infixl 5 _·_ _·_ : {Sig : Signature} (r : Record Sig) (ℓ : String) {ℓ∈ : ℓ ∈ Sig} → Proj Sig ℓ {ℓ∈} (r ∣ ℓ) _·_ {Sig = ∅} r ℓ {} _·_ {Sig = Sig , ℓ′ ∶ A} (rec r) ℓ {ℓ∈} with primStringEquality ℓ ℓ′ ... | true = Σ.proj₂ r ... | false = _·_ (Σ.proj₁ r) ℓ {ℓ∈} R : Set → Signature R A = ∅ , "f" ∶ (λ _ → A → A) , "x" ∶ (λ _ → A) , "lemma" ∶ (λ r → ∀ y → (r · "f") y ≡ y) record GS (A B : Set) : Set where field get : A → B set : A → B → A get-set : ∀ a b → get (set a b) ≡ b set-get : ∀ a → set a (get a) ≡ a f : {A : Set} → GS (Record (R A)) (Record (∅ , "f" ∶ (λ _ → A → A) , "lemma" ∶ (λ r → ∀ x → (r · "f") x ≡ x))) f = record { set = λ r f-lemma → rec (rec (rec (rec _ , f-lemma · "f") , r · "x") , f-lemma · "lemma") ; get-set = λ { (rec (rec (rec (_ , _) , _) , _)) (rec (rec (_ , _) , _)) → refl } ; set-get = λ { (rec (rec (rec (rec _ , _) , _) , _)) → refl } }
antlr-editing-plugins/antlr-error-highlighting/src/main/resources/org/nemesis/antlr/error/highlighting/BadWildcards.g4
timboudreau/ANTLR4-Plugins-for-NetBeans
1
5902
<reponame>timboudreau/ANTLR4-Plugins-for-NetBeans<filename>antlr-editing-plugins/antlr-error-highlighting/src/main/resources/org/nemesis/antlr/error/highlighting/BadWildcards.g4 /* * Copyright 2019 Mastfrog Technologies. * * 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. */ grammar BadWildcards; compilation_unit : things+ EOF; things : intArray | namespaceStatement; description : lines=DESCRIPTION*; namespaceStatement : description? K_NAMESPACE ( IDENT | QUALIFIED_ID ) S_SEMICOLON; foo : numericExpression baz; baz : K_NAMESPACE* | foo*; GOOP : K_NAMESPACE? S_ASTERISK*; fragment MOOP : (DESC_DELIMITER? TRUE*)+ | (FALSE? STRING*); thing : S_SLASH exp=description?; moo : (thing x=baz*); numericExpression : ( L_INT | L_FLOAT ) #singleFloat | (( L_FLOAT | L_INT ) OP numericExpression ) #mathFloat | ( S_OPEN_PARENS numericExpression S_CLOSE_PARENS ) #parentheticFloat; intArray : description? S_OPEN_BRACKET L_INT* S_CLOSE_BRACKET; OP : S_PLUS | S_MINUS | S_SLASH | S_ASTERISK | S_PERCENT; QUALIFIED_ID : IDENT ( S_DOT IDENT )+; K_NAMESPACE : 'namespace';//fooxegae K_INT : 'int'; K_INT_ARRAY : 'intArray'; S_SLASH : '/'; S_ASTERISK : '*'; S_PERCENT : '%'; S_OPEN_PARENS : '('; S_CLOSE_PARENS : ')'; S_OPEN_BRACE : '{'; S_CLOSE_BRACE : '}'; S_COLON : ':'; S_SEMICOLON : ';'; S_COMMA : ','; S_DOT : '.'; S_OPEN_BRACKET : '['; S_CLOSE_BRACKET : ']'; COMMENT : '/*'.*? '*/' -> channel( 1 ); S_WHITESPACE : ( ' ' | '\t' | '\n' | '\r' )+ -> channel( 2 ); L_STRING : ( STRING | STRING2 ); L_FLOAT : ( S_MINUS )? DIGIT+ ( S_DOT DIGIT+ ); L_INT : ( S_MINUS )? DIGITS; DESCRIPTION : DESC_DELIMITER ( ESC |. )*? S_LINE_END; IDENT : ( 'a'..'z' | 'A'..'Z' | '_' )( 'a'..'z' | 'A'..'Z' | '0'..'9' | '_' )*; fragment DESC_DELIMITER : '**'; fragment TRUE : 'true'; fragment FALSE : 'false'; fragment STRING : '"' ( ESC |. )*? '"'; fragment STRING2 : '\'' ( ESC2 |. )*? '\''; fragment DIGITS : DIGIT+; fragment DIGIT : [0-9]; fragment S_PLUS : '+'; fragment S_MINUS : '-'; fragment ESC : '\\"' | '\\\\'; fragment ESC2 : '\\\'' | '\\\\'; fragment WS : ' ' | '\t' | '\n' | '\r'; fragment S_LINE_END : '\r'? '\n';
init.asm
jhyunleehi/xv6-public
0
94200
_init: file format elf32-i386 Disassembly of section .text: 00000000 <main>: char *argv[] = { "sh", 0 }; int main(void) { 0: f3 0f 1e fb endbr32 4: 8d 4c 24 04 lea 0x4(%esp),%ecx 8: 83 e4 f0 and $0xfffffff0,%esp b: ff 71 fc pushl -0x4(%ecx) e: 55 push %ebp f: 89 e5 mov %esp,%ebp 11: 51 push %ecx 12: 83 ec 14 sub $0x14,%esp int pid, wpid; if(open("console", O_RDWR) < 0){ 15: 83 ec 08 sub $0x8,%esp 18: 6a 02 push $0x2 1a: 68 d6 08 00 00 push $0x8d6 1f: e8 9c 03 00 00 call 3c0 <open> 24: 83 c4 10 add $0x10,%esp 27: 85 c0 test %eax,%eax 29: 79 26 jns 51 <main+0x51> mknod("console", 1, 1); 2b: 83 ec 04 sub $0x4,%esp 2e: 6a 01 push $0x1 30: 6a 01 push $0x1 32: 68 d6 08 00 00 push $0x8d6 37: e8 8c 03 00 00 call 3c8 <mknod> 3c: 83 c4 10 add $0x10,%esp open("console", O_RDWR); 3f: 83 ec 08 sub $0x8,%esp 42: 6a 02 push $0x2 44: 68 d6 08 00 00 push $0x8d6 49: e8 72 03 00 00 call 3c0 <open> 4e: 83 c4 10 add $0x10,%esp } dup(0); // stdout 51: 83 ec 0c sub $0xc,%esp 54: 6a 00 push $0x0 56: e8 9d 03 00 00 call 3f8 <dup> 5b: 83 c4 10 add $0x10,%esp dup(0); // stderr 5e: 83 ec 0c sub $0xc,%esp 61: 6a 00 push $0x0 63: e8 90 03 00 00 call 3f8 <dup> 68: 83 c4 10 add $0x10,%esp for(;;){ printf(1, "init: starting sh\n"); 6b: 83 ec 08 sub $0x8,%esp 6e: 68 de 08 00 00 push $0x8de 73: 6a 01 push $0x1 75: e8 92 04 00 00 call 50c <printf> 7a: 83 c4 10 add $0x10,%esp pid = fork(); 7d: e8 f6 02 00 00 call 378 <fork> 82: 89 45 f4 mov %eax,-0xc(%ebp) if(pid < 0){ 85: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 89: 79 17 jns a2 <main+0xa2> printf(1, "init: fork failed\n"); 8b: 83 ec 08 sub $0x8,%esp 8e: 68 f1 08 00 00 push $0x8f1 93: 6a 01 push $0x1 95: e8 72 04 00 00 call 50c <printf> 9a: 83 c4 10 add $0x10,%esp exit(); 9d: e8 de 02 00 00 call 380 <exit> } if(pid == 0){ a2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) a6: 75 3e jne e6 <main+0xe6> exec("sh", argv); a8: 83 ec 08 sub $0x8,%esp ab: 68 70 0b 00 00 push $0xb70 b0: 68 d3 08 00 00 push $0x8d3 b5: e8 fe 02 00 00 call 3b8 <exec> ba: 83 c4 10 add $0x10,%esp printf(1, "init: exec sh failed\n"); bd: 83 ec 08 sub $0x8,%esp c0: 68 04 09 00 00 push $0x904 c5: 6a 01 push $0x1 c7: e8 40 04 00 00 call 50c <printf> cc: 83 c4 10 add $0x10,%esp exit(); cf: e8 ac 02 00 00 call 380 <exit> } while((wpid=wait()) >= 0 && wpid != pid) printf(1, "zombie!\n"); d4: 83 ec 08 sub $0x8,%esp d7: 68 1a 09 00 00 push $0x91a dc: 6a 01 push $0x1 de: e8 29 04 00 00 call 50c <printf> e3: 83 c4 10 add $0x10,%esp while((wpid=wait()) >= 0 && wpid != pid) e6: e8 9d 02 00 00 call 388 <wait> eb: 89 45 f0 mov %eax,-0x10(%ebp) ee: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) f2: 0f 88 73 ff ff ff js 6b <main+0x6b> f8: 8b 45 f0 mov -0x10(%ebp),%eax fb: 3b 45 f4 cmp -0xc(%ebp),%eax fe: 75 d4 jne d4 <main+0xd4> printf(1, "init: starting sh\n"); 100: e9 66 ff ff ff jmp 6b <main+0x6b> 00000105 <stosb>: : "cc"); } static inline void stosb(void *addr, int data, int cnt) { 105: 55 push %ebp 106: 89 e5 mov %esp,%ebp 108: 57 push %edi 109: 53 push %ebx asm volatile("cld; rep stosb" 10a: 8b 4d 08 mov 0x8(%ebp),%ecx 10d: 8b 55 10 mov 0x10(%ebp),%edx 110: 8b 45 0c mov 0xc(%ebp),%eax 113: 89 cb mov %ecx,%ebx 115: 89 df mov %ebx,%edi 117: 89 d1 mov %edx,%ecx 119: fc cld 11a: f3 aa rep stos %al,%es:(%edi) 11c: 89 ca mov %ecx,%edx 11e: 89 fb mov %edi,%ebx 120: 89 5d 08 mov %ebx,0x8(%ebp) 123: 89 55 10 mov %edx,0x10(%ebp) : "=D"(addr), "=c"(cnt) : "0"(addr), "1"(cnt), "a"(data) : "memory", "cc"); } 126: 90 nop 127: 5b pop %ebx 128: 5f pop %edi 129: 5d pop %ebp 12a: c3 ret 0000012b <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 12b: f3 0f 1e fb endbr32 12f: 55 push %ebp 130: 89 e5 mov %esp,%ebp 132: 83 ec 10 sub $0x10,%esp char *os; os = s; 135: 8b 45 08 mov 0x8(%ebp),%eax 138: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 13b: 90 nop 13c: 8b 55 0c mov 0xc(%ebp),%edx 13f: 8d 42 01 lea 0x1(%edx),%eax 142: 89 45 0c mov %eax,0xc(%ebp) 145: 8b 45 08 mov 0x8(%ebp),%eax 148: 8d 48 01 lea 0x1(%eax),%ecx 14b: 89 4d 08 mov %ecx,0x8(%ebp) 14e: 0f b6 12 movzbl (%edx),%edx 151: 88 10 mov %dl,(%eax) 153: 0f b6 00 movzbl (%eax),%eax 156: 84 c0 test %al,%al 158: 75 e2 jne 13c <strcpy+0x11> ; return os; 15a: 8b 45 fc mov -0x4(%ebp),%eax } 15d: c9 leave 15e: c3 ret 0000015f <strcmp>: int strcmp(const char *p, const char *q) { 15f: f3 0f 1e fb endbr32 163: 55 push %ebp 164: 89 e5 mov %esp,%ebp while(*p && *p == *q) 166: eb 08 jmp 170 <strcmp+0x11> p++, q++; 168: 83 45 08 01 addl $0x1,0x8(%ebp) 16c: 83 45 0c 01 addl $0x1,0xc(%ebp) while(*p && *p == *q) 170: 8b 45 08 mov 0x8(%ebp),%eax 173: 0f b6 00 movzbl (%eax),%eax 176: 84 c0 test %al,%al 178: 74 10 je 18a <strcmp+0x2b> 17a: 8b 45 08 mov 0x8(%ebp),%eax 17d: 0f b6 10 movzbl (%eax),%edx 180: 8b 45 0c mov 0xc(%ebp),%eax 183: 0f b6 00 movzbl (%eax),%eax 186: 38 c2 cmp %al,%dl 188: 74 de je 168 <strcmp+0x9> return (uchar)*p - (uchar)*q; 18a: 8b 45 08 mov 0x8(%ebp),%eax 18d: 0f b6 00 movzbl (%eax),%eax 190: 0f b6 d0 movzbl %al,%edx 193: 8b 45 0c mov 0xc(%ebp),%eax 196: 0f b6 00 movzbl (%eax),%eax 199: 0f b6 c0 movzbl %al,%eax 19c: 29 c2 sub %eax,%edx 19e: 89 d0 mov %edx,%eax } 1a0: 5d pop %ebp 1a1: c3 ret 000001a2 <strlen>: uint strlen(const char *s) { 1a2: f3 0f 1e fb endbr32 1a6: 55 push %ebp 1a7: 89 e5 mov %esp,%ebp 1a9: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1ac: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1b3: eb 04 jmp 1b9 <strlen+0x17> 1b5: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1b9: 8b 55 fc mov -0x4(%ebp),%edx 1bc: 8b 45 08 mov 0x8(%ebp),%eax 1bf: 01 d0 add %edx,%eax 1c1: 0f b6 00 movzbl (%eax),%eax 1c4: 84 c0 test %al,%al 1c6: 75 ed jne 1b5 <strlen+0x13> ; return n; 1c8: 8b 45 fc mov -0x4(%ebp),%eax } 1cb: c9 leave 1cc: c3 ret 000001cd <memset>: void* memset(void *dst, int c, uint n) { 1cd: f3 0f 1e fb endbr32 1d1: 55 push %ebp 1d2: 89 e5 mov %esp,%ebp stosb(dst, c, n); 1d4: 8b 45 10 mov 0x10(%ebp),%eax 1d7: 50 push %eax 1d8: ff 75 0c pushl 0xc(%ebp) 1db: ff 75 08 pushl 0x8(%ebp) 1de: e8 22 ff ff ff call 105 <stosb> 1e3: 83 c4 0c add $0xc,%esp return dst; 1e6: 8b 45 08 mov 0x8(%ebp),%eax } 1e9: c9 leave 1ea: c3 ret 000001eb <strchr>: char* strchr(const char *s, char c) { 1eb: f3 0f 1e fb endbr32 1ef: 55 push %ebp 1f0: 89 e5 mov %esp,%ebp 1f2: 83 ec 04 sub $0x4,%esp 1f5: 8b 45 0c mov 0xc(%ebp),%eax 1f8: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 1fb: eb 14 jmp 211 <strchr+0x26> if(*s == c) 1fd: 8b 45 08 mov 0x8(%ebp),%eax 200: 0f b6 00 movzbl (%eax),%eax 203: 38 45 fc cmp %al,-0x4(%ebp) 206: 75 05 jne 20d <strchr+0x22> return (char*)s; 208: 8b 45 08 mov 0x8(%ebp),%eax 20b: eb 13 jmp 220 <strchr+0x35> for(; *s; s++) 20d: 83 45 08 01 addl $0x1,0x8(%ebp) 211: 8b 45 08 mov 0x8(%ebp),%eax 214: 0f b6 00 movzbl (%eax),%eax 217: 84 c0 test %al,%al 219: 75 e2 jne 1fd <strchr+0x12> return 0; 21b: b8 00 00 00 00 mov $0x0,%eax } 220: c9 leave 221: c3 ret 00000222 <gets>: char* gets(char *buf, int max) { 222: f3 0f 1e fb endbr32 226: 55 push %ebp 227: 89 e5 mov %esp,%ebp 229: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 22c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 233: eb 42 jmp 277 <gets+0x55> cc = read(0, &c, 1); 235: 83 ec 04 sub $0x4,%esp 238: 6a 01 push $0x1 23a: 8d 45 ef lea -0x11(%ebp),%eax 23d: 50 push %eax 23e: 6a 00 push $0x0 240: e8 53 01 00 00 call 398 <read> 245: 83 c4 10 add $0x10,%esp 248: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 24b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 24f: 7e 33 jle 284 <gets+0x62> break; buf[i++] = c; 251: 8b 45 f4 mov -0xc(%ebp),%eax 254: 8d 50 01 lea 0x1(%eax),%edx 257: 89 55 f4 mov %edx,-0xc(%ebp) 25a: 89 c2 mov %eax,%edx 25c: 8b 45 08 mov 0x8(%ebp),%eax 25f: 01 c2 add %eax,%edx 261: 0f b6 45 ef movzbl -0x11(%ebp),%eax 265: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 267: 0f b6 45 ef movzbl -0x11(%ebp),%eax 26b: 3c 0a cmp $0xa,%al 26d: 74 16 je 285 <gets+0x63> 26f: 0f b6 45 ef movzbl -0x11(%ebp),%eax 273: 3c 0d cmp $0xd,%al 275: 74 0e je 285 <gets+0x63> for(i=0; i+1 < max; ){ 277: 8b 45 f4 mov -0xc(%ebp),%eax 27a: 83 c0 01 add $0x1,%eax 27d: 39 45 0c cmp %eax,0xc(%ebp) 280: 7f b3 jg 235 <gets+0x13> 282: eb 01 jmp 285 <gets+0x63> break; 284: 90 nop break; } buf[i] = '\0'; 285: 8b 55 f4 mov -0xc(%ebp),%edx 288: 8b 45 08 mov 0x8(%ebp),%eax 28b: 01 d0 add %edx,%eax 28d: c6 00 00 movb $0x0,(%eax) return buf; 290: 8b 45 08 mov 0x8(%ebp),%eax } 293: c9 leave 294: c3 ret 00000295 <stat>: int stat(const char *n, struct stat *st) { 295: f3 0f 1e fb endbr32 299: 55 push %ebp 29a: 89 e5 mov %esp,%ebp 29c: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 29f: 83 ec 08 sub $0x8,%esp 2a2: 6a 00 push $0x0 2a4: ff 75 08 pushl 0x8(%ebp) 2a7: e8 14 01 00 00 call 3c0 <open> 2ac: 83 c4 10 add $0x10,%esp 2af: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 2b2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 2b6: 79 07 jns 2bf <stat+0x2a> return -1; 2b8: b8 ff ff ff ff mov $0xffffffff,%eax 2bd: eb 25 jmp 2e4 <stat+0x4f> r = fstat(fd, st); 2bf: 83 ec 08 sub $0x8,%esp 2c2: ff 75 0c pushl 0xc(%ebp) 2c5: ff 75 f4 pushl -0xc(%ebp) 2c8: e8 0b 01 00 00 call 3d8 <fstat> 2cd: 83 c4 10 add $0x10,%esp 2d0: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 2d3: 83 ec 0c sub $0xc,%esp 2d6: ff 75 f4 pushl -0xc(%ebp) 2d9: e8 ca 00 00 00 call 3a8 <close> 2de: 83 c4 10 add $0x10,%esp return r; 2e1: 8b 45 f0 mov -0x10(%ebp),%eax } 2e4: c9 leave 2e5: c3 ret 000002e6 <atoi>: int atoi(const char *s) { 2e6: f3 0f 1e fb endbr32 2ea: 55 push %ebp 2eb: 89 e5 mov %esp,%ebp 2ed: 83 ec 10 sub $0x10,%esp int n; n = 0; 2f0: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 2f7: eb 25 jmp 31e <atoi+0x38> n = n*10 + *s++ - '0'; 2f9: 8b 55 fc mov -0x4(%ebp),%edx 2fc: 89 d0 mov %edx,%eax 2fe: c1 e0 02 shl $0x2,%eax 301: 01 d0 add %edx,%eax 303: 01 c0 add %eax,%eax 305: 89 c1 mov %eax,%ecx 307: 8b 45 08 mov 0x8(%ebp),%eax 30a: 8d 50 01 lea 0x1(%eax),%edx 30d: 89 55 08 mov %edx,0x8(%ebp) 310: 0f b6 00 movzbl (%eax),%eax 313: 0f be c0 movsbl %al,%eax 316: 01 c8 add %ecx,%eax 318: 83 e8 30 sub $0x30,%eax 31b: 89 45 fc mov %eax,-0x4(%ebp) while('0' <= *s && *s <= '9') 31e: 8b 45 08 mov 0x8(%ebp),%eax 321: 0f b6 00 movzbl (%eax),%eax 324: 3c 2f cmp $0x2f,%al 326: 7e 0a jle 332 <atoi+0x4c> 328: 8b 45 08 mov 0x8(%ebp),%eax 32b: 0f b6 00 movzbl (%eax),%eax 32e: 3c 39 cmp $0x39,%al 330: 7e c7 jle 2f9 <atoi+0x13> return n; 332: 8b 45 fc mov -0x4(%ebp),%eax } 335: c9 leave 336: c3 ret 00000337 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 337: f3 0f 1e fb endbr32 33b: 55 push %ebp 33c: 89 e5 mov %esp,%ebp 33e: 83 ec 10 sub $0x10,%esp char *dst; const char *src; dst = vdst; 341: 8b 45 08 mov 0x8(%ebp),%eax 344: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 347: 8b 45 0c mov 0xc(%ebp),%eax 34a: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 34d: eb 17 jmp 366 <memmove+0x2f> *dst++ = *src++; 34f: 8b 55 f8 mov -0x8(%ebp),%edx 352: 8d 42 01 lea 0x1(%edx),%eax 355: 89 45 f8 mov %eax,-0x8(%ebp) 358: 8b 45 fc mov -0x4(%ebp),%eax 35b: 8d 48 01 lea 0x1(%eax),%ecx 35e: 89 4d fc mov %ecx,-0x4(%ebp) 361: 0f b6 12 movzbl (%edx),%edx 364: 88 10 mov %dl,(%eax) while(n-- > 0) 366: 8b 45 10 mov 0x10(%ebp),%eax 369: 8d 50 ff lea -0x1(%eax),%edx 36c: 89 55 10 mov %edx,0x10(%ebp) 36f: 85 c0 test %eax,%eax 371: 7f dc jg 34f <memmove+0x18> return vdst; 373: 8b 45 08 mov 0x8(%ebp),%eax } 376: c9 leave 377: c3 ret 00000378 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 378: b8 01 00 00 00 mov $0x1,%eax 37d: cd 40 int $0x40 37f: c3 ret 00000380 <exit>: SYSCALL(exit) 380: b8 02 00 00 00 mov $0x2,%eax 385: cd 40 int $0x40 387: c3 ret 00000388 <wait>: SYSCALL(wait) 388: b8 03 00 00 00 mov $0x3,%eax 38d: cd 40 int $0x40 38f: c3 ret 00000390 <pipe>: SYSCALL(pipe) 390: b8 04 00 00 00 mov $0x4,%eax 395: cd 40 int $0x40 397: c3 ret 00000398 <read>: SYSCALL(read) 398: b8 05 00 00 00 mov $0x5,%eax 39d: cd 40 int $0x40 39f: c3 ret 000003a0 <write>: SYSCALL(write) 3a0: b8 10 00 00 00 mov $0x10,%eax 3a5: cd 40 int $0x40 3a7: c3 ret 000003a8 <close>: SYSCALL(close) 3a8: b8 15 00 00 00 mov $0x15,%eax 3ad: cd 40 int $0x40 3af: c3 ret 000003b0 <kill>: SYSCALL(kill) 3b0: b8 06 00 00 00 mov $0x6,%eax 3b5: cd 40 int $0x40 3b7: c3 ret 000003b8 <exec>: SYSCALL(exec) 3b8: b8 07 00 00 00 mov $0x7,%eax 3bd: cd 40 int $0x40 3bf: c3 ret 000003c0 <open>: SYSCALL(open) 3c0: b8 0f 00 00 00 mov $0xf,%eax 3c5: cd 40 int $0x40 3c7: c3 ret 000003c8 <mknod>: SYSCALL(mknod) 3c8: b8 11 00 00 00 mov $0x11,%eax 3cd: cd 40 int $0x40 3cf: c3 ret 000003d0 <unlink>: SYSCALL(unlink) 3d0: b8 12 00 00 00 mov $0x12,%eax 3d5: cd 40 int $0x40 3d7: c3 ret 000003d8 <fstat>: SYSCALL(fstat) 3d8: b8 08 00 00 00 mov $0x8,%eax 3dd: cd 40 int $0x40 3df: c3 ret 000003e0 <link>: SYSCALL(link) 3e0: b8 13 00 00 00 mov $0x13,%eax 3e5: cd 40 int $0x40 3e7: c3 ret 000003e8 <mkdir>: SYSCALL(mkdir) 3e8: b8 14 00 00 00 mov $0x14,%eax 3ed: cd 40 int $0x40 3ef: c3 ret 000003f0 <chdir>: SYSCALL(chdir) 3f0: b8 09 00 00 00 mov $0x9,%eax 3f5: cd 40 int $0x40 3f7: c3 ret 000003f8 <dup>: SYSCALL(dup) 3f8: b8 0a 00 00 00 mov $0xa,%eax 3fd: cd 40 int $0x40 3ff: c3 ret 00000400 <getpid>: SYSCALL(getpid) 400: b8 0b 00 00 00 mov $0xb,%eax 405: cd 40 int $0x40 407: c3 ret 00000408 <sbrk>: SYSCALL(sbrk) 408: b8 0c 00 00 00 mov $0xc,%eax 40d: cd 40 int $0x40 40f: c3 ret 00000410 <sleep>: SYSCALL(sleep) 410: b8 0d 00 00 00 mov $0xd,%eax 415: cd 40 int $0x40 417: c3 ret 00000418 <uptime>: SYSCALL(uptime) 418: b8 0e 00 00 00 mov $0xe,%eax 41d: cd 40 int $0x40 41f: c3 ret 00000420 <cps>: SYSCALL(cps) 420: b8 16 00 00 00 mov $0x16,%eax 425: cd 40 int $0x40 427: c3 ret 00000428 <cdate>: 428: b8 17 00 00 00 mov $0x17,%eax 42d: cd 40 int $0x40 42f: c3 ret 00000430 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 430: f3 0f 1e fb endbr32 434: 55 push %ebp 435: 89 e5 mov %esp,%ebp 437: 83 ec 18 sub $0x18,%esp 43a: 8b 45 0c mov 0xc(%ebp),%eax 43d: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 440: 83 ec 04 sub $0x4,%esp 443: 6a 01 push $0x1 445: 8d 45 f4 lea -0xc(%ebp),%eax 448: 50 push %eax 449: ff 75 08 pushl 0x8(%ebp) 44c: e8 4f ff ff ff call 3a0 <write> 451: 83 c4 10 add $0x10,%esp } 454: 90 nop 455: c9 leave 456: c3 ret 00000457 <printint>: static void printint(int fd, int xx, int base, int sgn) { 457: f3 0f 1e fb endbr32 45b: 55 push %ebp 45c: 89 e5 mov %esp,%ebp 45e: 83 ec 28 sub $0x28,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 461: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 468: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 46c: 74 17 je 485 <printint+0x2e> 46e: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 472: 79 11 jns 485 <printint+0x2e> neg = 1; 474: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 47b: 8b 45 0c mov 0xc(%ebp),%eax 47e: f7 d8 neg %eax 480: 89 45 ec mov %eax,-0x14(%ebp) 483: eb 06 jmp 48b <printint+0x34> } else { x = xx; 485: 8b 45 0c mov 0xc(%ebp),%eax 488: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 48b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 492: 8b 4d 10 mov 0x10(%ebp),%ecx 495: 8b 45 ec mov -0x14(%ebp),%eax 498: ba 00 00 00 00 mov $0x0,%edx 49d: f7 f1 div %ecx 49f: 89 d1 mov %edx,%ecx 4a1: 8b 45 f4 mov -0xc(%ebp),%eax 4a4: 8d 50 01 lea 0x1(%eax),%edx 4a7: 89 55 f4 mov %edx,-0xc(%ebp) 4aa: 0f b6 91 78 0b 00 00 movzbl 0xb78(%ecx),%edx 4b1: 88 54 05 dc mov %dl,-0x24(%ebp,%eax,1) }while((x /= base) != 0); 4b5: 8b 4d 10 mov 0x10(%ebp),%ecx 4b8: 8b 45 ec mov -0x14(%ebp),%eax 4bb: ba 00 00 00 00 mov $0x0,%edx 4c0: f7 f1 div %ecx 4c2: 89 45 ec mov %eax,-0x14(%ebp) 4c5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4c9: 75 c7 jne 492 <printint+0x3b> if(neg) 4cb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 4cf: 74 2d je 4fe <printint+0xa7> buf[i++] = '-'; 4d1: 8b 45 f4 mov -0xc(%ebp),%eax 4d4: 8d 50 01 lea 0x1(%eax),%edx 4d7: 89 55 f4 mov %edx,-0xc(%ebp) 4da: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 4df: eb 1d jmp 4fe <printint+0xa7> putc(fd, buf[i]); 4e1: 8d 55 dc lea -0x24(%ebp),%edx 4e4: 8b 45 f4 mov -0xc(%ebp),%eax 4e7: 01 d0 add %edx,%eax 4e9: 0f b6 00 movzbl (%eax),%eax 4ec: 0f be c0 movsbl %al,%eax 4ef: 83 ec 08 sub $0x8,%esp 4f2: 50 push %eax 4f3: ff 75 08 pushl 0x8(%ebp) 4f6: e8 35 ff ff ff call 430 <putc> 4fb: 83 c4 10 add $0x10,%esp while(--i >= 0) 4fe: 83 6d f4 01 subl $0x1,-0xc(%ebp) 502: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 506: 79 d9 jns 4e1 <printint+0x8a> } 508: 90 nop 509: 90 nop 50a: c9 leave 50b: c3 ret 0000050c <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 50c: f3 0f 1e fb endbr32 510: 55 push %ebp 511: 89 e5 mov %esp,%ebp 513: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 516: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 51d: 8d 45 0c lea 0xc(%ebp),%eax 520: 83 c0 04 add $0x4,%eax 523: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 526: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 52d: e9 59 01 00 00 jmp 68b <printf+0x17f> c = fmt[i] & 0xff; 532: 8b 55 0c mov 0xc(%ebp),%edx 535: 8b 45 f0 mov -0x10(%ebp),%eax 538: 01 d0 add %edx,%eax 53a: 0f b6 00 movzbl (%eax),%eax 53d: 0f be c0 movsbl %al,%eax 540: 25 ff 00 00 00 and $0xff,%eax 545: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 548: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 54c: 75 2c jne 57a <printf+0x6e> if(c == '%'){ 54e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 552: 75 0c jne 560 <printf+0x54> state = '%'; 554: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 55b: e9 27 01 00 00 jmp 687 <printf+0x17b> } else { putc(fd, c); 560: 8b 45 e4 mov -0x1c(%ebp),%eax 563: 0f be c0 movsbl %al,%eax 566: 83 ec 08 sub $0x8,%esp 569: 50 push %eax 56a: ff 75 08 pushl 0x8(%ebp) 56d: e8 be fe ff ff call 430 <putc> 572: 83 c4 10 add $0x10,%esp 575: e9 0d 01 00 00 jmp 687 <printf+0x17b> } } else if(state == '%'){ 57a: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 57e: 0f 85 03 01 00 00 jne 687 <printf+0x17b> if(c == 'd'){ 584: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 588: 75 1e jne 5a8 <printf+0x9c> printint(fd, *ap, 10, 1); 58a: 8b 45 e8 mov -0x18(%ebp),%eax 58d: 8b 00 mov (%eax),%eax 58f: 6a 01 push $0x1 591: 6a 0a push $0xa 593: 50 push %eax 594: ff 75 08 pushl 0x8(%ebp) 597: e8 bb fe ff ff call 457 <printint> 59c: 83 c4 10 add $0x10,%esp ap++; 59f: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5a3: e9 d8 00 00 00 jmp 680 <printf+0x174> } else if(c == 'x' || c == 'p'){ 5a8: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 5ac: 74 06 je 5b4 <printf+0xa8> 5ae: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 5b2: 75 1e jne 5d2 <printf+0xc6> printint(fd, *ap, 16, 0); 5b4: 8b 45 e8 mov -0x18(%ebp),%eax 5b7: 8b 00 mov (%eax),%eax 5b9: 6a 00 push $0x0 5bb: 6a 10 push $0x10 5bd: 50 push %eax 5be: ff 75 08 pushl 0x8(%ebp) 5c1: e8 91 fe ff ff call 457 <printint> 5c6: 83 c4 10 add $0x10,%esp ap++; 5c9: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5cd: e9 ae 00 00 00 jmp 680 <printf+0x174> } else if(c == 's'){ 5d2: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 5d6: 75 43 jne 61b <printf+0x10f> s = (char*)*ap; 5d8: 8b 45 e8 mov -0x18(%ebp),%eax 5db: 8b 00 mov (%eax),%eax 5dd: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 5e0: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 5e4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 5e8: 75 25 jne 60f <printf+0x103> s = "(null)"; 5ea: c7 45 f4 23 09 00 00 movl $0x923,-0xc(%ebp) while(*s != 0){ 5f1: eb 1c jmp 60f <printf+0x103> putc(fd, *s); 5f3: 8b 45 f4 mov -0xc(%ebp),%eax 5f6: 0f b6 00 movzbl (%eax),%eax 5f9: 0f be c0 movsbl %al,%eax 5fc: 83 ec 08 sub $0x8,%esp 5ff: 50 push %eax 600: ff 75 08 pushl 0x8(%ebp) 603: e8 28 fe ff ff call 430 <putc> 608: 83 c4 10 add $0x10,%esp s++; 60b: 83 45 f4 01 addl $0x1,-0xc(%ebp) while(*s != 0){ 60f: 8b 45 f4 mov -0xc(%ebp),%eax 612: 0f b6 00 movzbl (%eax),%eax 615: 84 c0 test %al,%al 617: 75 da jne 5f3 <printf+0xe7> 619: eb 65 jmp 680 <printf+0x174> } } else if(c == 'c'){ 61b: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 61f: 75 1d jne 63e <printf+0x132> putc(fd, *ap); 621: 8b 45 e8 mov -0x18(%ebp),%eax 624: 8b 00 mov (%eax),%eax 626: 0f be c0 movsbl %al,%eax 629: 83 ec 08 sub $0x8,%esp 62c: 50 push %eax 62d: ff 75 08 pushl 0x8(%ebp) 630: e8 fb fd ff ff call 430 <putc> 635: 83 c4 10 add $0x10,%esp ap++; 638: 83 45 e8 04 addl $0x4,-0x18(%ebp) 63c: eb 42 jmp 680 <printf+0x174> } else if(c == '%'){ 63e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 642: 75 17 jne 65b <printf+0x14f> putc(fd, c); 644: 8b 45 e4 mov -0x1c(%ebp),%eax 647: 0f be c0 movsbl %al,%eax 64a: 83 ec 08 sub $0x8,%esp 64d: 50 push %eax 64e: ff 75 08 pushl 0x8(%ebp) 651: e8 da fd ff ff call 430 <putc> 656: 83 c4 10 add $0x10,%esp 659: eb 25 jmp 680 <printf+0x174> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 65b: 83 ec 08 sub $0x8,%esp 65e: 6a 25 push $0x25 660: ff 75 08 pushl 0x8(%ebp) 663: e8 c8 fd ff ff call 430 <putc> 668: 83 c4 10 add $0x10,%esp putc(fd, c); 66b: 8b 45 e4 mov -0x1c(%ebp),%eax 66e: 0f be c0 movsbl %al,%eax 671: 83 ec 08 sub $0x8,%esp 674: 50 push %eax 675: ff 75 08 pushl 0x8(%ebp) 678: e8 b3 fd ff ff call 430 <putc> 67d: 83 c4 10 add $0x10,%esp } state = 0; 680: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) for(i = 0; fmt[i]; i++){ 687: 83 45 f0 01 addl $0x1,-0x10(%ebp) 68b: 8b 55 0c mov 0xc(%ebp),%edx 68e: 8b 45 f0 mov -0x10(%ebp),%eax 691: 01 d0 add %edx,%eax 693: 0f b6 00 movzbl (%eax),%eax 696: 84 c0 test %al,%al 698: 0f 85 94 fe ff ff jne 532 <printf+0x26> } } } 69e: 90 nop 69f: 90 nop 6a0: c9 leave 6a1: c3 ret 000006a2 <free>: static Header base; static Header *freep; void free(void *ap) { 6a2: f3 0f 1e fb endbr32 6a6: 55 push %ebp 6a7: 89 e5 mov %esp,%ebp 6a9: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 6ac: 8b 45 08 mov 0x8(%ebp),%eax 6af: 83 e8 08 sub $0x8,%eax 6b2: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6b5: a1 94 0b 00 00 mov 0xb94,%eax 6ba: 89 45 fc mov %eax,-0x4(%ebp) 6bd: eb 24 jmp 6e3 <free+0x41> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6bf: 8b 45 fc mov -0x4(%ebp),%eax 6c2: 8b 00 mov (%eax),%eax 6c4: 39 45 fc cmp %eax,-0x4(%ebp) 6c7: 72 12 jb 6db <free+0x39> 6c9: 8b 45 f8 mov -0x8(%ebp),%eax 6cc: 3b 45 fc cmp -0x4(%ebp),%eax 6cf: 77 24 ja 6f5 <free+0x53> 6d1: 8b 45 fc mov -0x4(%ebp),%eax 6d4: 8b 00 mov (%eax),%eax 6d6: 39 45 f8 cmp %eax,-0x8(%ebp) 6d9: 72 1a jb 6f5 <free+0x53> for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6db: 8b 45 fc mov -0x4(%ebp),%eax 6de: 8b 00 mov (%eax),%eax 6e0: 89 45 fc mov %eax,-0x4(%ebp) 6e3: 8b 45 f8 mov -0x8(%ebp),%eax 6e6: 3b 45 fc cmp -0x4(%ebp),%eax 6e9: 76 d4 jbe 6bf <free+0x1d> 6eb: 8b 45 fc mov -0x4(%ebp),%eax 6ee: 8b 00 mov (%eax),%eax 6f0: 39 45 f8 cmp %eax,-0x8(%ebp) 6f3: 73 ca jae 6bf <free+0x1d> break; if(bp + bp->s.size == p->s.ptr){ 6f5: 8b 45 f8 mov -0x8(%ebp),%eax 6f8: 8b 40 04 mov 0x4(%eax),%eax 6fb: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 702: 8b 45 f8 mov -0x8(%ebp),%eax 705: 01 c2 add %eax,%edx 707: 8b 45 fc mov -0x4(%ebp),%eax 70a: 8b 00 mov (%eax),%eax 70c: 39 c2 cmp %eax,%edx 70e: 75 24 jne 734 <free+0x92> bp->s.size += p->s.ptr->s.size; 710: 8b 45 f8 mov -0x8(%ebp),%eax 713: 8b 50 04 mov 0x4(%eax),%edx 716: 8b 45 fc mov -0x4(%ebp),%eax 719: 8b 00 mov (%eax),%eax 71b: 8b 40 04 mov 0x4(%eax),%eax 71e: 01 c2 add %eax,%edx 720: 8b 45 f8 mov -0x8(%ebp),%eax 723: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 726: 8b 45 fc mov -0x4(%ebp),%eax 729: 8b 00 mov (%eax),%eax 72b: 8b 10 mov (%eax),%edx 72d: 8b 45 f8 mov -0x8(%ebp),%eax 730: 89 10 mov %edx,(%eax) 732: eb 0a jmp 73e <free+0x9c> } else bp->s.ptr = p->s.ptr; 734: 8b 45 fc mov -0x4(%ebp),%eax 737: 8b 10 mov (%eax),%edx 739: 8b 45 f8 mov -0x8(%ebp),%eax 73c: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 73e: 8b 45 fc mov -0x4(%ebp),%eax 741: 8b 40 04 mov 0x4(%eax),%eax 744: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 74b: 8b 45 fc mov -0x4(%ebp),%eax 74e: 01 d0 add %edx,%eax 750: 39 45 f8 cmp %eax,-0x8(%ebp) 753: 75 20 jne 775 <free+0xd3> p->s.size += bp->s.size; 755: 8b 45 fc mov -0x4(%ebp),%eax 758: 8b 50 04 mov 0x4(%eax),%edx 75b: 8b 45 f8 mov -0x8(%ebp),%eax 75e: 8b 40 04 mov 0x4(%eax),%eax 761: 01 c2 add %eax,%edx 763: 8b 45 fc mov -0x4(%ebp),%eax 766: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 769: 8b 45 f8 mov -0x8(%ebp),%eax 76c: 8b 10 mov (%eax),%edx 76e: 8b 45 fc mov -0x4(%ebp),%eax 771: 89 10 mov %edx,(%eax) 773: eb 08 jmp 77d <free+0xdb> } else p->s.ptr = bp; 775: 8b 45 fc mov -0x4(%ebp),%eax 778: 8b 55 f8 mov -0x8(%ebp),%edx 77b: 89 10 mov %edx,(%eax) freep = p; 77d: 8b 45 fc mov -0x4(%ebp),%eax 780: a3 94 0b 00 00 mov %eax,0xb94 } 785: 90 nop 786: c9 leave 787: c3 ret 00000788 <morecore>: static Header* morecore(uint nu) { 788: f3 0f 1e fb endbr32 78c: 55 push %ebp 78d: 89 e5 mov %esp,%ebp 78f: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 792: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 799: 77 07 ja 7a2 <morecore+0x1a> nu = 4096; 79b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 7a2: 8b 45 08 mov 0x8(%ebp),%eax 7a5: c1 e0 03 shl $0x3,%eax 7a8: 83 ec 0c sub $0xc,%esp 7ab: 50 push %eax 7ac: e8 57 fc ff ff call 408 <sbrk> 7b1: 83 c4 10 add $0x10,%esp 7b4: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 7b7: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 7bb: 75 07 jne 7c4 <morecore+0x3c> return 0; 7bd: b8 00 00 00 00 mov $0x0,%eax 7c2: eb 26 jmp 7ea <morecore+0x62> hp = (Header*)p; 7c4: 8b 45 f4 mov -0xc(%ebp),%eax 7c7: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 7ca: 8b 45 f0 mov -0x10(%ebp),%eax 7cd: 8b 55 08 mov 0x8(%ebp),%edx 7d0: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 7d3: 8b 45 f0 mov -0x10(%ebp),%eax 7d6: 83 c0 08 add $0x8,%eax 7d9: 83 ec 0c sub $0xc,%esp 7dc: 50 push %eax 7dd: e8 c0 fe ff ff call 6a2 <free> 7e2: 83 c4 10 add $0x10,%esp return freep; 7e5: a1 94 0b 00 00 mov 0xb94,%eax } 7ea: c9 leave 7eb: c3 ret 000007ec <malloc>: void* malloc(uint nbytes) { 7ec: f3 0f 1e fb endbr32 7f0: 55 push %ebp 7f1: 89 e5 mov %esp,%ebp 7f3: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7f6: 8b 45 08 mov 0x8(%ebp),%eax 7f9: 83 c0 07 add $0x7,%eax 7fc: c1 e8 03 shr $0x3,%eax 7ff: 83 c0 01 add $0x1,%eax 802: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 805: a1 94 0b 00 00 mov 0xb94,%eax 80a: 89 45 f0 mov %eax,-0x10(%ebp) 80d: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 811: 75 23 jne 836 <malloc+0x4a> base.s.ptr = freep = prevp = &base; 813: c7 45 f0 8c 0b 00 00 movl $0xb8c,-0x10(%ebp) 81a: 8b 45 f0 mov -0x10(%ebp),%eax 81d: a3 94 0b 00 00 mov %eax,0xb94 822: a1 94 0b 00 00 mov 0xb94,%eax 827: a3 8c 0b 00 00 mov %eax,0xb8c base.s.size = 0; 82c: c7 05 90 0b 00 00 00 movl $0x0,0xb90 833: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 836: 8b 45 f0 mov -0x10(%ebp),%eax 839: 8b 00 mov (%eax),%eax 83b: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 83e: 8b 45 f4 mov -0xc(%ebp),%eax 841: 8b 40 04 mov 0x4(%eax),%eax 844: 39 45 ec cmp %eax,-0x14(%ebp) 847: 77 4d ja 896 <malloc+0xaa> if(p->s.size == nunits) 849: 8b 45 f4 mov -0xc(%ebp),%eax 84c: 8b 40 04 mov 0x4(%eax),%eax 84f: 39 45 ec cmp %eax,-0x14(%ebp) 852: 75 0c jne 860 <malloc+0x74> prevp->s.ptr = p->s.ptr; 854: 8b 45 f4 mov -0xc(%ebp),%eax 857: 8b 10 mov (%eax),%edx 859: 8b 45 f0 mov -0x10(%ebp),%eax 85c: 89 10 mov %edx,(%eax) 85e: eb 26 jmp 886 <malloc+0x9a> else { p->s.size -= nunits; 860: 8b 45 f4 mov -0xc(%ebp),%eax 863: 8b 40 04 mov 0x4(%eax),%eax 866: 2b 45 ec sub -0x14(%ebp),%eax 869: 89 c2 mov %eax,%edx 86b: 8b 45 f4 mov -0xc(%ebp),%eax 86e: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 871: 8b 45 f4 mov -0xc(%ebp),%eax 874: 8b 40 04 mov 0x4(%eax),%eax 877: c1 e0 03 shl $0x3,%eax 87a: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 87d: 8b 45 f4 mov -0xc(%ebp),%eax 880: 8b 55 ec mov -0x14(%ebp),%edx 883: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 886: 8b 45 f0 mov -0x10(%ebp),%eax 889: a3 94 0b 00 00 mov %eax,0xb94 return (void*)(p + 1); 88e: 8b 45 f4 mov -0xc(%ebp),%eax 891: 83 c0 08 add $0x8,%eax 894: eb 3b jmp 8d1 <malloc+0xe5> } if(p == freep) 896: a1 94 0b 00 00 mov 0xb94,%eax 89b: 39 45 f4 cmp %eax,-0xc(%ebp) 89e: 75 1e jne 8be <malloc+0xd2> if((p = morecore(nunits)) == 0) 8a0: 83 ec 0c sub $0xc,%esp 8a3: ff 75 ec pushl -0x14(%ebp) 8a6: e8 dd fe ff ff call 788 <morecore> 8ab: 83 c4 10 add $0x10,%esp 8ae: 89 45 f4 mov %eax,-0xc(%ebp) 8b1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 8b5: 75 07 jne 8be <malloc+0xd2> return 0; 8b7: b8 00 00 00 00 mov $0x0,%eax 8bc: eb 13 jmp 8d1 <malloc+0xe5> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8be: 8b 45 f4 mov -0xc(%ebp),%eax 8c1: 89 45 f0 mov %eax,-0x10(%ebp) 8c4: 8b 45 f4 mov -0xc(%ebp),%eax 8c7: 8b 00 mov (%eax),%eax 8c9: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 8cc: e9 6d ff ff ff jmp 83e <malloc+0x52> } } 8d1: c9 leave 8d2: c3 ret
Sources/Globe_3d/models/icosahedron.ads
ForYouEyesOnly/Space-Convoy
1
22136
with GLOBE_3D; package Icosahedron is procedure Create ( object : in out GLOBE_3D.p_Object_3D; scale : GLOBE_3D.Real; centre : GLOBE_3D.Point_3D; alpha : GLOBE_3D.Real; polyball : Boolean ); end Icosahedron;
programs/oeis/168/A168225.asm
neoneye/loda
22
18800
<gh_stars>10-100 ; A168225: a(n) = n^4*(n^7 + 1)/2. ; 0,1,1032,88614,2097280,24414375,181399176,988664572,4294969344,15690533085,50000005000,142655842626,371504195712,896080211299,2024782604040,4324877955000,8796093054976,17135948195577,32134205092104,58245129514270,102400000080000,175138750368351,292159150822792,476404879096884,760840571750400,1192092895703125,1835172243722376,2779530283543482,4146754734043264,6100254883206555,8857350000405000,12704238448664176,18014398510006272,25271053257456369,35094421819684360,48274578687273750,65810851921973376,88958810890667287,119286025112818824,158737918662392940,209715200001280000,275164515859537101,358684160556790152,464646869737320754,598341940647073920,766139150612401875,975677192106099976,1236079607544445992,1558201490607734784,1954910524294376425,2441406250003125000,3035581807607514126,3758432754679138432,4634517964690041039,5692478020157107080,6965616958280942500,8492553694696114176,10317949946526678597,12493322000088427144,15077944222374980010,18139852800006480000,21756958805724842251,26018280341925935112,31025304194284288224,36893488147427491840,43753915870052870625,51755117070065747976,61065066452494084102,71873375885355851904,84393695092600546695,98866337150012005000,115561146060863488476,134780624734494984192,156863342784194053309,182187644702182456200,211175680160538281250,244297779428934453376,282077198194586301507,325095257418230285064,373996905263779939480,429496729600020480000,492385451091827139801,563536928477461009672,643915709269066647294,734585160817144748160,836716218448097389375,951596789218559402376,1080641851732773889812,1225404294441399322624,1387586536883526541365,1569052980450032805000,1771843337437423203226,1998186889428743655552,2250517728383750701179,2531491036246067635720,2844000461382340530000,3191196652759247486976,3576507015440446328017,4003656753749025880584,4476691271293630255350 mov $1,$0 pow $0,4 mov $2,$1 pow $2,7 mul $2,$0 add $0,$2 div $0,2
Examples/interprocess-communication/exeapp3.asm
agguro/linux-nasm
6
28049
;name: exeapp3.asm ; ;build: nasm -felf64 exeapp3.asm -o exeapp3.o ; ld -s -melf_x86_64 -o exeapp3 exeapp3.o ; ;description: Demonstration on how to execute a bash script from a program and the environment parameters. ; be sure that the script is set executable with chmod +x ; We set an environment parameter TESTVAR to a value and read it out with the script test.sh. ; Running the script directly doesn't display the TESTVAR value. (unless someone has defined it already) ; It's pretty much the same as running an executable. The script must be marked as executable. bits 64 [list -] %include "unistd.inc" [list +] section .data filename: db "test.sh",0 .len: equ $-filename ;... put more arguments here envp1: db "TESTVAR=123456",0 ;... put more environment paraters here argvPtr: dq filename ; more pointers to arguments here dq 0 ; terminate the list of pointers with 0 envPtr: dq envp1 dq 0 forkerror: db "fork error",10 .len: equ $-forkerror execveerror: db "execve error(not expected)",10 .len: equ $-execveerror wait4error: db "wait4 error",10 .len: equ $-wait4error section .text global _start _start: syscall fork and rax,rax jns .continue syscall write,stderr,forkerror,forkerror.len jmp .exit .continue: jz .runchild ; wait for child to terminate syscall wait4, 0, 0, 0, 0 jns .exit syscall write,stderr,wait4error,wait4error.len jmp .exit .runchild: syscall execve,filename,argvPtr,envPtr jns .exit syscall write,stderr,execveerror,execveerror.len .exit: syscall exit,0
lecture7/callret.asm
netguy204/cmsc313_examples
1
7055
<filename>lecture7/callret.asm [SECTION .data] ;;; Here we declare initialized data. For example: messages, prompts, ;;; and numbers that we know in advance hello: db "Hello, World!", 10 hello_len: EQU $-hello [SECTION .bss] ;;; Here we declare uninitialized data. We're reserving space (and ;;; potentially associating names with that space) that our code ;;; will use as it executes. Think of these as "global variables" [SECTION .text] ;;; This is where our program lives. global _start ; make start global so ld can find it sayhi: ;; protect the old values in eax-edx push eax push ebx push ecx push edx mov eax, 4 mov ebx, 1 mov ecx, hello mov edx, hello_len int 80h pop edx pop ecx pop ebx pop eax ret _start: ; the program actually starts here ;; say hi a few times mov eax, 10 .loop: cmp eax, 0 je .loopend call sayhi dec eax jmp .loop .loopend: ;; call sys_exit to finish things off mov eax, 1 ; sys_exit syscall mov ebx, 0 ; no error int 80H ; kernel interrupt
AppleScript/LogOutlookMetaData.applescript
maxheadroom/helpers
0
1392
-- Set location of logfile set this_file to (((path to home folder) as string) & "MailLog.log") -- a function to append data to the logfile on write_to_file(this_data, target_file, append_data) try set the target_file to the target_file as string set the open_target_file to open for access file target_file with write permission if append_data is false then set eof of the open_target_file to 0 write this_data to the open_target_file starting at eof close access the open_target_file return true on error try close access file target_file end try return false end try end write_to_file -- a function to replace characters in a given string on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars -- Loop through the messages received from Outlook. tell application "Microsoft Outlook" set theMessages to current messages -- Count the messages received from Outlook. set theMessageCount to count theMessages repeat with a from 1 to theMessageCount -- Target the current message in the loop. tell item a of theMessages -- Retrieve the name of the current message's sender. set theSender to sender try set theSenderName to name of theSender on error try set theSenderName to address of theSender on error set theSenderName to "unresolved Sender Name" end try end try try set theSenderAddress to address of theSender on error set theSenderAddress to "unresolved" end try -- Retrieve the current message's subject. set theSubject to subject set timeReceived to time received set timeSent to time sent set thePriority to priority set theSource to source as text set theSize to length of theSource -- extract CC recipients set theCC to cc recipients set CCList to "" repeat with rcp in theCC set recipientEMail to email address of rcp set CCList to CCList & address of recipientEMail as text set CCList to CCList & "," end repeat -- extract the TO recipients set theTO to to recipients set TOList to "" repeat with rcp in theTO set recipientEMail to email address of rcp set TOList to TOList & address of recipientEMail as text set TOList to TOList & "," end repeat if thePriority = priority normal then set mailPriority to "normal" else if thePriority = priority high then set mailPriority to "high" else if thePriority = priority low then set mailPriority to "low" else set mailPriority to "none" end if set isMeeting to is meeting end tell set theSubject to my replace_chars(theSubject, "|", "--") set output to timeReceived & "|" & timeSent & "|" & theSenderAddress & "|" & TOList & "|" & CCList & "|" & theSubject & "|" & mailPriority & "|" & isMeeting & "|" & theSize & return my write_to_file(output as string, this_file, true) end repeat end tell
tasking.adb
charlesincharge/Intro_to_Ada
0
21219
-- Concurrency can be offered by the OS, the language, or a combination -- Link to some papers that say that threading can't be a library. -- Ousterhout has an interesting paper here that shows that you can't guarantee pthreads correctness. -- Processes offer protection but are too heavy-weight. -- Compiler must take care of low-level thread management, as opposed to RTOS with Ada.Text_IO; procedure Tasking is -- Specification of nested task task HelloTask; task body HelloTask is begin -- Task body begins executing as soon as Tasking starts for idx in 1 .. 5 loop Ada.Text_IO.Put_Line("The task says hello."); delay 1.0; end loop; end HelloTask; begin Ada.Text_IO.Put_Line("Starting Program!"); -- Tasking ends when both the body and task have ended -- Task must terminate end Tasking;
bindings/glu.adb
ForYouEyesOnly/Space-Convoy
1
5875
<gh_stars>1-10 with Ada.Unchecked_Conversion, System; package body GLU is type loc_DoublePtr is new GL.doublePtr; pragma No_Strict_Aliasing (Matrix_Double_Ptr); pragma No_Strict_Aliasing (Viewport_Ptr); pragma No_Strict_Aliasing (loc_DoublePtr); -- recommended by GNAT 2005 procedure Get (pname : GL.ParameterNameEnm; params : out Matrix_Double) is function Cvt is new Ada.Unchecked_Conversion (System.Address, Matrix_Double_Ptr); -- This method is functionally identical as GNAT's Unrestricted_Access -- but has no type safety (cf GNAT Docs) begin Get (pname, Cvt (params (0, 0)'Address)); end Get; procedure Get (params : out Viewport_Rec) is function Cvt is new Ada.Unchecked_Conversion (System.Address, Viewport_Ptr); begin Get (GL.VIEWPORT, Cvt (params.X'Address)); end Get; procedure Project (objx : GL.Double; objy : GL.Double; objz : GL.Double; modelMatrix : Matrix_Double; projMatrix : Matrix_Double; viewport : Viewport_Rec; winx : out GL.Double; winy : out GL.Double; winz : out GL.Double; result : out Boolean) is function CvV is new Ada.Unchecked_Conversion (System.Address, Viewport_Ptr); function CvM is new Ada.Unchecked_Conversion (System.Address, Matrix_Double_Ptr); function Cvt is new Ada.Unchecked_Conversion (System.Address, loc_DoublePtr); wx, wy, wz : GL.Double; use GL; begin -- Call the same function with C style result := Project ( objx, objy, objz, CvM (modelMatrix'Address), CvM (projMatrix'Address), CvV (viewport'Address), GL.doublePtr (Cvt (wx'Address)), GL.doublePtr (Cvt (wy'Address)), GL.doublePtr (Cvt (wz'Address)) ) = GL.GL_Boolean'Pos (GL.GL_True); winx := wx; winy := wy; winz := wz; end Project; end GLU;
oeis/049/A049672.asm
neoneye/loda-programs
11
7922
; A049672: a(n) = (F(4*n) - F(n))/2, where F=A000045 (the Fibonacci sequence). ; Submitted by <NAME>(s1) ; 0,1,10,71,492,3380,23180,158899,1089144,7465159,51167050,350704322,2403763416,16475639933,112925716670,774004377655,5305104928368,36361730123272,249227005938340,1708227311451263,11708364174230460,80250321908178071,550043889183042110,3770056902373158886,25840354427429138352,177112424089630920025,1213946614199987480530,8320513875310281732839,57029650512971985117204,390887039715493614844604,2679179627495483320019900,18363370352752889627276587,125864412841774744074122976,862687519539670318896772903 mov $2,$0 mul $2,2 mov $3,$0 lpb $3 mov $0,$2 sub $3,1 sub $0,$3 seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. add $1,$0 add $2,2 lpe mov $0,$1
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_capacity.asm
meesokim/z88dk
0
167414
; size_t b_vector_capacity(b_vector_t *v) SECTION code_adt_b_vector PUBLIC b_vector_capacity defc b_vector_capacity = asm_b_vector_capacity INCLUDE "adt/b_vector/z80/asm_b_vector_capacity.asm"
tests/lsc_internal_test_bignum.adb
Componolit/libsparkcrypto
30
30604
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2011, <NAME> and <NAME> -- Copyright (C) 2011, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the author 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 LSC.Internal.Types; with LSC.Internal.Bignum; with OpenSSL; with AUnit.Assertions; use AUnit.Assertions; pragma Style_Checks ("-s"); pragma Warnings (Off, "formal parameter ""T"" is not referenced"); use type LSC.Internal.Bignum.Big_Int; package body LSC_Internal_Test_Bignum is Window_Size : constant := 5; subtype Mod_Range_Small is Natural range 0 .. 63; subtype Mod_Range is Natural range 0 .. 127; subtype Pub_Exp_Range is Natural range 0 .. 0; subtype Window_Aux_Range is Natural range 0 .. 128 * (2 ** Window_Size) - 1; subtype LInt_Small is LSC.Internal.Bignum.Big_Int (Mod_Range_Small); subtype LInt is LSC.Internal.Bignum.Big_Int (Mod_Range); subtype SInt is LSC.Internal.Bignum.Big_Int (Pub_Exp_Range); subtype Window_Aux is LSC.Internal.Bignum.Big_Int (Window_Aux_Range); Pub_Exp : constant SInt := SInt'(0 => 16#00010001#); -- 2048 bit Modulus_Small : constant LInt_Small := LInt_Small' (16#e3855b7b#, 16#695e1d0c#, 16#2f3a389f#, 16#e4e8cfbc#, 16#366c3c0b#, 16#07f34b0d#, 16#a92ff519#, 16#566a909a#, 16#d79ecc36#, 16#e392c334#, 16#dbbb737f#, 16#80c97ddd#, 16#812a798c#, 16#0fdf31b2#, 16#c9c3978b#, 16#f526906b#, 16#cf23d190#, 16#ea1e08a2#, 16#08cf9c02#, 16#b3b794fb#, 16#7855c403#, 16#49b10dd8#, 16#6ca17d12#, 16#b069b1ab#, 16#b8d28b35#, 16#a08d0a13#, 16#1a1bf74d#, 16#30ca19b3#, 16#29e5abd7#, 16#4ccb0a06#, 16#7bae2533#, 16#fc040833#, 16#2c1c80c5#, 16#ea729a13#, 16#ac5ffd04#, 16#a2dcc2f9#, 16#c1f9c72c#, 16#f466adf6#, 16#ea152c47#, 16#42d76640#, 16#8b5c067a#, 16#8c870d16#, 16#d3dacf2f#, 16#df33c327#, 16#fdddf873#, 16#592c3110#, 16#a94e6415#, 16#6b0f63f4#, 16#84919783#, 16#da1672d1#, 16#6d2b736e#, 16#3c02711d#, 16#eba01b1d#, 16#04463ba8#, 16#a8f0f41b#, 16#d41c9a16#, 16#2e0a1c54#, 16#e8340e9b#, 16#0194cdee#, 16#4beacec6#, 16#e23ee4a4#, 16#ec602901#, 16#079751bd#, 16#Dad31766#); Priv_Exp_Small : constant LInt_Small := LInt_Small' (16#3fd9f299#, 16#64a02913#, 16#780db9d7#, 16#164c83cd#, 16#70ac88cc#, 16#14e9bfcc#, 16#bff4fa46#, 16#a2956db0#, 16#d5952d92#, 16#d8e23b1b#, 16#d252925c#, 16#f63f2570#, 16#1232a957#, 16#0ecdf6fc#, 16#23356dd5#, 16#6dfd8463#, 16#b88e9193#, 16#3e337443#, 16#c30bd004#, 16#f86471bc#, 16#26836b1f#, 16#36792ee7#, 16#fd7774c3#, 16#e947afe5#, 16#403e454e#, 16#60886c2f#, 16#7da04cab#, 16#0006c1c8#, 16#87bfa8cc#, 16#c644e026#, 16#8eea8cce#, 16#beca39f9#, 16#60c3808d#, 16#2faf499f#, 16#c81d0c50#, 16#ef2e6e1b#, 16#ae3dbc3f#, 16#54a6e7b8#, 16#efdc4e55#, 16#e0ed4e41#, 16#6ddee985#, 16#2c988959#, 16#2bdbffad#, 16#ec9c5635#, 16#a6ad3fef#, 16#5df1f2a6#, 16#e4ec57d3#, 16#1c823145#, 16#eecff08e#, 16#51b9f682#, 16#c8ec37a1#, 16#1212a615#, 16#9265aeed#, 16#4b4e2491#, 16#2b29d53a#, 16#2bd57be9#, 16#ffd21ce0#, 16#bccc6401#, 16#e2d6c019#, 16#c98b2771#, 16#4d4cde01#, 16#d507d875#, 16#886bab53#, 16#7cac4629#); -- 4096 bit Modulus : constant LInt := LInt' (16#27a3f371#, 16#f66dc29e#, 16#2c4cf251#, 16#0aa490b7#, 16#2eabfddb#, 16#4e6d1cc7#, 16#e67fc1bb#, 16#be3cc1e1#, 16#4338d3ae#, 16#372d809a#, 16#b9d33026#, 16#e3d05bff#, 16#886580b8#, 16#020b3b03#, 16#55c15179#, 16#a3c026b2#, 16#3e550dcb#, 16#821fcfee#, 16#4f44c3f9#, 16#25c8b0a5#, 16#30612a20#, 16#8c970432#, 16#32e395aa#, 16#1337a822#, 16#3db2c677#, 16#35a256d5#, 16#fcbf1cfc#, 16#6354fbe1#, 16#8d0874a2#, 16#a017fe19#, 16#07f415fc#, 16#e0a45678#, 16#c3e2f1c3#, 16#4b73d538#, 16#962f1c1c#, 16#448f15fb#, 16#d4ba9b05#, 16#9f6cc819#, 16#f36d2a06#, 16#d1c1d04a#, 16#efb31b76#, 16#c7cae1cf#, 16#e61520e4#, 16#984ec779#, 16#56f79b73#, 16#2f8ca314#, 16#a0c4e830#, 16#2e3eba5b#, 16#f739a437#, 16#7852b71e#, 16#aab09aa6#, 16#3d8dcdc3#, 16#f16ab197#, 16#8b3753d1#, 16#ec52c4e1#, 16#f70e4f7d#, 16#b4af5c60#, 16#82ae6ca4#, 16#fa6a8a1d#, 16#5655c33d#, 16#5096b17f#, 16#71c61b6a#, 16#28c84e83#, 16#07a0f985#, 16#b5523b0c#, 16#d31e75f6#, 16#c8139152#, 16#c94fb87f#, 16#d0d092c4#, 16#b5bae11d#, 16#3ebaa999#, 16#599cd667#, 16#a156c841#, 16#88a90d02#, 16#73e10c30#, 16#56b72050#, 16#1cb3c2d9#, 16#abef5973#, 16#8f42b61a#, 16#e54c7b3c#, 16#0b93bb83#, 16#5ca62bc2#, 16#1a9996a5#, 16#26b48d1b#, 16#98f932d1#, 16#3f56babe#, 16#dab5a0eb#, 16#4e0de31d#, 16#4bbe26d4#, 16#2812c4f8#, 16#f6d1866c#, 16#6800ef71#, 16#49cca290#, 16#aa1bbdee#, 16#ee8a75ea#, 16#4fc8516b#, 16#242c7f52#, 16#96df15ea#, 16#eaac1b33#, 16#c533d8fa#, 16#a649ef23#, 16#7d29eebb#, 16#8342ce68#, 16#36abe9c0#, 16#82adff4d#, 16#8fcc54b0#, 16#89144572#, 16#09dfcece#, 16#bcc22be3#, 16#b2184072#, 16#cf2cf6c3#, 16#dbb62eeb#, 16#9c44b29b#, 16#08dea7eb#, 16#8a92c57e#, 16#4ed90ea9#, 16#a73379d1#, 16#20767c8f#, 16#bcc1a56d#, 16#6fa7e726#, 16#d74d548d#, 16#ec21f388#, 16#a2344841#, 16#8b08a316#, 16#c99b8d76#, 16#d670befe#, 16#31a09763#, 16#d0055749#); Priv_Exp : constant LInt := LInt' (16#2e274601#, 16#8fab5c50#, 16#48b5239e#, 16#5a37865c#, 16#5670b41d#, 16#2da87796#, 16#3a82b988#, 16#7a7ce911#, 16#bd4e57b1#, 16#8f6d3da4#, 16#8669e6a0#, 16#3314c3e7#, 16#36248f99#, 16#4b3e25a7#, 16#600a6f7f#, 16#04eafed8#, 16#45050c07#, 16#f32daf96#, 16#6b6b4f21#, 16#cd177764#, 16#e4d13b46#, 16#80f34af3#, 16#1f601841#, 16#65bf67b8#, 16#33729106#, 16#56b14c9d#, 16#267c46be#, 16#d4acf88c#, 16#fc8ec97e#, 16#06d4df7e#, 16#198ec5fb#, 16#a098a033#, 16#c7dcc150#, 16#dc980d3f#, 16#29778f62#, 16#29f4cbca#, 16#e6d86584#, 16#9e366a7a#, 16#b39ab77a#, 16#1a956df3#, 16#da64c05b#, 16#6f4183a2#, 16#452ad7db#, 16#84d1f44e#, 16#88c4a697#, 16#d272546e#, 16#c0f5da10#, 16#dca7e68b#, 16#2316a1e5#, 16#93305fcd#, 16#10a0897b#, 16#e203fc89#, 16#163ef9fa#, 16#a3625c15#, 16#9719bace#, 16#c5bd6a66#, 16#466893e9#, 16#eb33cb36#, 16#ff6854e6#, 16#f8cf002f#, 16#5c84f1a6#, 16#f9d89029#, 16#a42c2f21#, 16#7c29e8b3#, 16#07188900#, 16#37a9da54#, 16#672715c3#, 16#ab9b69ac#, 16#2a32533c#, 16#592932ba#, 16#90843f00#, 16#4f540d7d#, 16#44f04b78#, 16#efeab1d4#, 16#bc5e76db#, 16#cd5bd78b#, 16#0eb2723f#, 16#bd633630#, 16#90bf30be#, 16#0023372e#, 16#5d50308b#, 16#4cbf539a#, 16#1abb5b44#, 16#30cc98de#, 16#869b24e0#, 16#78bda399#, 16#25e6f54c#, 16#96dac865#, 16#8db1dc73#, 16#770a4d97#, 16#31123fee#, 16#139ea6d0#, 16#786e32b2#, 16#f3998ab6#, 16#5fd4f43b#, 16#ae506344#, 16#797f633d#, 16#81682a87#, 16#9b5cb744#, 16#a40a97e5#, 16#e788eed8#, 16#5c2b1448#, 16#90780722#, 16#77af3218#, 16#66114d4f#, 16#8857c6c0#, 16#9899ef8a#, 16#dea4d612#, 16#f5986865#, 16#41b3caca#, 16#ebace112#, 16#1678338c#, 16#34e40889#, 16#3291e166#, 16#3f855200#, 16#e81eddcb#, 16#b08e2e77#, 16#238ac815#, 16#d2442787#, 16#bb20cea2#, 16#c4ae4e94#, 16#b575336a#, 16#cd55d286#, 16#e7387f77#, 16#a780f030#, 16#46526c31#, 16#0e4752a9#, 16#9b036fe1#); --------------------------------------------------------------------------- procedure Test_RSA2048 (T : in out Test_Cases.Test_Case'Class) is Aux1, Aux2, Aux3, R : LInt; M_Inv : LSC.Internal.Types.Word32; Aux4 : Window_Aux; Plain1_Small, OpenSSL_Plain1_Small : LInt_Small; Plain2_Small, Plain3_Small, OpenSSL_Plain2_Small : LInt_Small; Cipher1_Small, Cipher2_Small, OpenSSL_Cipher_Small : LInt_Small; OpenSSL_Modulus_Small, OpenSSL_Priv_Exp_Small : LInt_Small; OpenSSL_Pub_Exp : SInt; Success_Enc, Success_Dec : Boolean; begin LSC.Internal.Bignum.Native_To_BE (Pub_Exp, Pub_Exp'First, Pub_Exp'Last, OpenSSL_Pub_Exp, OpenSSL_Pub_Exp'First); -- Create original data for I in Natural range Modulus_Small'Range loop Plain1_Small (I) := LSC.Internal.Types.Word32 (I); end loop; -- Convert modulus, exponent and plaintext to format expected by OpenSSL LSC.Internal.Bignum.Native_To_BE (Priv_Exp_Small, Priv_Exp_Small'First, Priv_Exp_Small'Last, OpenSSL_Priv_Exp_Small, OpenSSL_Priv_Exp_Small'First); LSC.Internal.Bignum.Native_To_BE (Modulus_Small, Modulus_Small'First, Modulus_Small'Last, OpenSSL_Modulus_Small, OpenSSL_Modulus_Small'First); LSC.Internal.Bignum.Native_To_BE (Plain1_Small, Plain1_Small'First, Plain1_Small'Last, OpenSSL_Plain1_Small, OpenSSL_Plain1_Small'First); OpenSSL.RSA_Public_Encrypt (OpenSSL_Modulus_Small, OpenSSL_Pub_Exp, OpenSSL_Plain1_Small, OpenSSL_Cipher_Small, Success_Enc); OpenSSL.RSA_Private_Decrypt (OpenSSL_Modulus_Small, OpenSSL_Pub_Exp, OpenSSL_Priv_Exp_Small, OpenSSL_Cipher_Small, OpenSSL_Plain2_Small, Success_Dec); LSC.Internal.Bignum.Native_To_BE (OpenSSL_Cipher_Small, OpenSSL_Cipher_Small'First, OpenSSL_Cipher_Small'Last, Cipher2_Small, Cipher2_Small'First); LSC.Internal.Bignum.Native_To_BE (OpenSSL_Plain2_Small, OpenSSL_Plain2_Small'First, OpenSSL_Plain2_Small'Last, Plain3_Small, Plain3_Small'First); -- Precompute R^2 mod m LSC.Internal.Bignum.Size_Square_Mod (M => Modulus_Small, M_First => Modulus_Small'First, M_Last => Modulus_Small'Last, R => R, R_First => R'First); -- Precompute inverse M_Inv := LSC.Internal.Bignum.Word_Inverse (Modulus_Small (Modulus_Small'First)); -- Encrypt LSC.Internal.Bignum.Mont_Exp_Window (A => Cipher1_Small, A_First => Cipher1_Small'First, A_Last => Cipher1_Small'Last, X => Plain1_Small, X_First => Plain1_Small'First, E => Pub_Exp, E_First => Pub_Exp'First, E_Last => Pub_Exp'Last, M => Modulus_Small, M_First => Modulus_Small'First, K => Window_Size, Aux1 => Aux1, Aux1_First => Aux1'First, Aux2 => Aux2, Aux2_First => Aux2'First, Aux3 => Aux3, Aux3_First => Aux3'First, Aux4 => Aux4, Aux4_First => Aux4'First, R => R, R_First => R'First, M_Inv => M_Inv); -- Decrypt LSC.Internal.Bignum.Mont_Exp_Window (A => Plain2_Small, A_First => Plain2_Small'First, A_Last => Plain2_Small'Last, X => Cipher1_Small, X_First => Cipher1_Small'First, E => Priv_Exp_Small, E_First => Priv_Exp_Small'First, E_Last => Priv_Exp_Small'Last, M => Modulus_Small, M_First => Modulus_Small'First, K => Window_Size, Aux1 => Aux1, Aux1_First => Aux1'First, Aux2 => Aux2, Aux2_First => Aux2'First, Aux3 => Aux3, Aux3_First => Aux3'First, Aux4 => Aux4, Aux4_First => Aux4'First, R => R, R_First => R'First, M_Inv => M_Inv); Assert (Success_Enc, "encryption failed"); Assert (Success_Dec, "decryption failed"); Assert (Cipher1_Small = Cipher2_Small, "cipher texts differ"); Assert (Plain1_Small = Plain2_Small, "Plain1 /= Plain2"); Assert (Plain2_Small = Plain3_Small, "Plain2 /= Plain3"); end Test_RSA2048; --------------------------------------------------------------------------- procedure Test_RSA4096 (T : in out Test_Cases.Test_Case'Class) is Plain1, OpenSSL_Plain1 : LInt; Plain2, Plain3, OpenSSL_Plain2 : LInt; Cipher1, Cipher2, OpenSSL_Cipher : LInt; OpenSSL_Modulus, OpenSSL_Priv_Exp : LInt; OpenSSL_Pub_Exp : SInt; Aux1, Aux2, Aux3, R : LInt; Aux4 : Window_Aux; M_Inv : LSC.Internal.Types.Word32; Success_Enc, Success_Dec : Boolean; begin LSC.Internal.Bignum.Native_To_BE (Pub_Exp, Pub_Exp'First, Pub_Exp'Last, OpenSSL_Pub_Exp, OpenSSL_Pub_Exp'First); -- Create original data for I in Natural range Modulus'Range loop Plain1 (I) := LSC.Internal.Types.Word32 (I); end loop; -- Convert modulus, exponent and plaintext to format expected by OpenSSL LSC.Internal.Bignum.Native_To_BE (Priv_Exp, Priv_Exp'First, Priv_Exp'Last, OpenSSL_Priv_Exp, OpenSSL_Priv_Exp'First); LSC.Internal.Bignum.Native_To_BE (Modulus, Modulus'First, Modulus'Last, OpenSSL_Modulus, OpenSSL_Modulus'First); LSC.Internal.Bignum.Native_To_BE (Plain1, Plain1'First, Plain1'Last, OpenSSL_Plain1, OpenSSL_Plain1'First); OpenSSL.RSA_Public_Encrypt (OpenSSL_Modulus, OpenSSL_Pub_Exp, OpenSSL_Plain1, OpenSSL_Cipher, Success_Enc); OpenSSL.RSA_Private_Decrypt (OpenSSL_Modulus, OpenSSL_Pub_Exp, OpenSSL_Priv_Exp, OpenSSL_Cipher, OpenSSL_Plain2, Success_Dec); LSC.Internal.Bignum.Native_To_BE (OpenSSL_Cipher, OpenSSL_Cipher'First, OpenSSL_Cipher'Last, Cipher2, Cipher2'First); LSC.Internal.Bignum.Native_To_BE (OpenSSL_Plain2, OpenSSL_Plain2'First, OpenSSL_Plain2'Last, Plain3, Plain3'First); -- Precompute R^2 mod m LSC.Internal.Bignum.Size_Square_Mod (M => Modulus, M_First => Modulus'First, M_Last => Modulus'Last, R => R, R_First => R'First); -- Precompute inverse M_Inv := LSC.Internal.Bignum.Word_Inverse (Modulus (Modulus'First)); -- Encrypt LSC.Internal.Bignum.Mont_Exp_Window (A => Cipher1, A_First => Cipher1'First, A_Last => Cipher1'Last, X => Plain1, X_First => Plain1'First, E => Pub_Exp, E_First => Pub_Exp'First, E_Last => Pub_Exp'Last, M => Modulus, M_First => Modulus'First, K => Window_Size, Aux1 => Aux1, Aux1_First => Aux1'First, Aux2 => Aux2, Aux2_First => Aux2'First, Aux3 => Aux3, Aux3_First => Aux3'First, Aux4 => Aux4, Aux4_First => Aux4'First, R => R, R_First => R'First, M_Inv => M_Inv); -- Decrypt LSC.Internal.Bignum.Mont_Exp_Window (A => Plain2, A_First => Plain2'First, A_Last => Plain2'Last, X => Cipher1, X_First => Cipher1'First, E => Priv_Exp, E_First => Priv_Exp'First, E_Last => Priv_Exp'Last, M => Modulus, M_First => Modulus'First, K => Window_Size, Aux1 => Aux1, Aux1_First => Aux1'First, Aux2 => Aux2, Aux2_First => Aux2'First, Aux3 => Aux3, Aux3_First => Aux3'First, Aux4 => Aux4, Aux4_First => Aux4'First, R => R, R_First => R'First, M_Inv => M_Inv); Assert (Success_Enc, "encryption failed"); Assert (Success_Dec, "decryption failed"); Assert (Cipher1 = Cipher2, "cipher texts differ"); Assert (Plain1 = Plain2, "Plain1 /= Plain2"); Assert (Plain2 = Plain3, "Plain2 /= Plain3"); end Test_RSA4096; --------------------------------------------------------------------------- procedure Register_Tests (T : in out Test_Case) is use AUnit.Test_Cases.Registration; begin Register_Routine (T, Test_RSA2048'Access, "Insecure RSA 2048 (encrypt/decrypt)"); Register_Routine (T, Test_RSA4096'Access, "Insecure RSA 4096 (encrypt/decrypt)"); end Register_Tests; --------------------------------------------------------------------------- function Name (T : Test_Case) return Test_String is begin return Format ("Bignum"); end Name; end LSC_Internal_Test_Bignum;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1000.asm
ljhsiun2/medusa
9
170590
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xc1f4, %r12 nop nop nop nop add $45314, %rdx vmovups (%r12), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rax nop nop nop cmp $7657, %rbp lea addresses_WC_ht+0x2c3e, %rsi nop nop xor %rdi, %rdi movw $0x6162, (%rsi) nop nop cmp $14445, %r12 lea addresses_WT_ht+0x1865e, %rdx sub %rdi, %rdi movb (%rdx), %r12b nop nop nop nop nop cmp $51476, %rax lea addresses_UC_ht+0x2ab6, %r12 nop nop nop dec %rax vmovups (%r12), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rsi nop nop nop nop sub $60358, %rsi lea addresses_normal_ht+0x144fe, %r14 nop nop nop nop nop xor $42320, %r12 movb $0x61, (%r14) nop nop nop nop and %rax, %rax lea addresses_normal_ht+0x80fe, %rsi lea addresses_WT_ht+0x1a0fe, %rdi nop nop nop nop dec %r12 mov $90, %rcx rep movsb nop nop mfence lea addresses_A_ht+0xf4d8, %r14 nop nop nop cmp $46935, %rsi mov (%r14), %dx add $30765, %r14 lea addresses_normal_ht+0x1d796, %rdx clflush (%rdx) nop and %rbp, %rbp mov (%rdx), %r14 nop nop nop nop add $32124, %rbp lea addresses_WC_ht+0x7cfe, %rsi lea addresses_UC_ht+0x675e, %rdi nop sub $65472, %rdx mov $49, %rcx rep movsb nop nop xor $3774, %rax lea addresses_D_ht+0x1ecfe, %rsi lea addresses_WT_ht+0x154fe, %rdi nop nop nop sub %rax, %rax mov $114, %rcx rep movsl xor %rsi, %rsi lea addresses_A_ht+0x18fe, %r14 nop nop nop nop nop cmp $27769, %rax mov $0x6162636465666768, %rdi movq %rdi, (%r14) nop nop nop nop cmp $63589, %rbp lea addresses_WT_ht+0x2efe, %rcx xor %rdi, %rdi movb (%rcx), %al nop nop cmp %r12, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rbp push %rbx push %rcx push %rsi // Store mov $0x2f853600000008fe, %rcx nop inc %rsi mov $0x5152535455565758, %r15 movq %r15, %xmm2 vmovups %ymm2, (%rcx) nop nop nop nop xor %rcx, %rcx // Store mov $0x64d384000000073e, %rcx nop nop add %r9, %r9 movb $0x51, (%rcx) nop nop nop nop nop and %rcx, %rcx // Faulty Load lea addresses_PSE+0x104fe, %r15 nop sub %r12, %r12 mov (%r15), %bx lea oracles, %rcx and $0xff, %rbx shlq $12, %rbx mov (%rcx,%rbx,1), %rbx pop %rsi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': True, 'NT': 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 */
test/link/group3/seg1a.asm
nigelperks/BasicAssembler
0
6807
IDEAL ASSUME CS:SEG1, DS:SEG1, ES:SEG1, SS:SEG1 SEGMENT SEG1 PUBLIC ORG 100h start: mov ax, 1234h mov dx, 5678h call start int 21h jmp near CS:100h ENDS GROUP MYGROUP SEG1 END start
programs/oeis/340/A340498.asm
karttu/loda
1
22917
; A340498: Where 2^n appears in A340488 for the first time. ; 3,6,16,56,216,856,3416,13656,54616,218456,873816,3495256,13981016,55924056,223696216,894784856,3579139416,14316557656,57266230616,229064922456,916259689816 mov $1,$0 sub $0,2 add $1,1 add $1,$0 cal $1,86893 ; a(n) is the index of F(n+1) at the unique occurrence of the ordered pair of reversed consecutive terms (F(n+1),F(n)) in Stern's diatomic sequence A002487, where F(k) denotes the k-th term of the Fibonacci sequence A000045. add $1,3
tier-1/clib/source/thin/clib-timeval.ads
charlie5/cBound
2
25273
-- This file is generated by SWIG. Please do *not* modify by hand. -- with Interfaces.C; with Interfaces.C.Pointers; with Interfaces.C.Strings; with System; package clib.timeval is -- Item -- type Item is record tv_sec : aliased Interfaces.C.long; tv_usec : aliased Interfaces.C.long; end record; -- Items -- type Items is array (Interfaces.C.size_t range <>) of aliased clib.timeval.Item; -- Pointer -- type Pointer is access all clib.timeval.Item; -- Pointers -- type Pointers is array (Interfaces.C.size_t range <>) of aliased clib.timeval.Pointer; -- Pointer_Pointer -- type Pointer_Pointer is access all clib.timeval.Pointer; end clib.timeval;
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1472.asm
ljhsiun2/medusa
9
178310
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x2f45, %r8 add %rdi, %rdi mov $0x6162636465666768, %r14 movq %r14, %xmm0 vmovups %ymm0, (%r8) nop nop nop nop nop sub $34548, %rcx lea addresses_WC_ht+0x36ae, %rsi lea addresses_UC_ht+0x1167f, %rdi nop nop sub %r11, %r11 mov $56, %rcx rep movsb nop xor $32092, %rdi lea addresses_A_ht+0x3e74, %rsi lea addresses_WC_ht+0x2186, %rdi nop nop nop nop xor %rax, %rax mov $30, %rcx rep movsl nop nop nop add $48273, %rsi lea addresses_D_ht+0xd0f4, %rsi lea addresses_D_ht+0x38f4, %rdi nop nop add $30388, %r8 mov $0, %rcx rep movsq nop nop nop nop nop sub $2563, %rcx lea addresses_WC_ht+0x1a594, %rcx nop add $24299, %r14 vmovups (%rcx), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rdi and %rsi, %rsi lea addresses_WT_ht+0x12e00, %rsi lea addresses_UC_ht+0xb492, %rdi nop sub $10099, %rbp mov $58, %rcx rep movsl nop nop xor %rcx, %rcx lea addresses_WT_ht+0x1de06, %r8 nop nop add $35317, %r14 movl $0x61626364, (%r8) sub $52900, %r11 lea addresses_D_ht+0x16274, %rsi lea addresses_normal_ht+0x1b25d, %rdi nop nop nop nop cmp %r14, %r14 mov $117, %rcx rep movsl nop nop cmp $36014, %rax lea addresses_normal_ht+0x172f4, %rsi lea addresses_WT_ht+0x157f4, %rdi nop nop nop nop inc %r8 mov $58, %rcx rep movsw and %rdi, %rdi lea addresses_WC_ht+0xc374, %rdi nop cmp %rax, %rax movb (%rdi), %cl nop nop nop inc %rcx lea addresses_D_ht+0x1b358, %r11 nop nop nop inc %rsi movl $0x61626364, (%r11) nop nop nop inc %rbp lea addresses_WC_ht+0x1aee0, %rsi clflush (%rsi) nop nop nop nop nop dec %rdi vmovups (%rsi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r8 nop nop nop xor %r8, %r8 lea addresses_WC_ht+0x9b6c, %rax and $53359, %rsi movl $0x61626364, (%rax) cmp $63, %r14 lea addresses_A_ht+0x1ecb8, %rsi lea addresses_normal_ht+0xaf74, %rdi nop nop cmp $58959, %r8 mov $97, %rcx rep movsw sub $63617, %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rbx push %rdi push %rdx // Faulty Load lea addresses_UC+0x1ea74, %r13 nop nop nop nop nop sub $55401, %rdx mov (%r13), %edi lea oracles, %r8 and $0xff, %rdi shlq $12, %rdi mov (%r8,%rdi,1), %rdi pop %rdx pop %rdi pop %rbx pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': True, 'AVXalign': False, 'congruent': 2}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 5}} {'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 */
alloy4fun_models/trashltl/models/16/sMFYnbuTiyEtf8PY5.als
Kaixi26/org.alloytools.alloy
0
727
<gh_stars>0 open main pred idsMFYnbuTiyEtf8PY5_prop17 { always (all f:Trash | after no Trash&f) } pred __repair { idsMFYnbuTiyEtf8PY5_prop17 } check __repair { idsMFYnbuTiyEtf8PY5_prop17 <=> prop17o }
src/stopwatch.ads
mosteo/stopwatch
0
29716
<reponame>mosteo/stopwatch<gh_stars>0 private with Ada.Calendar; package Stopwatch is type Instance is tagged private; procedure Reset (This : in out Instance); function Elapsed (This : Instance) return Duration; procedure Hold (This : in out Instance; Enable : Boolean := True); -- Stop counting time, or re-start if not Enable procedure Release (This : in out Instance); -- Equivalent to Hold (Enable => False) function Is_Held (This : Instance) return Boolean; function Image (This : Instance; Decimals : Natural := 2) return String; -- Elapsed time in seconds, without leading space, without units function Image (Elapsed : Duration; Decimals : Natural := 2) return String; -- Convenience to format durations even without a stopwatch private use Ada.Calendar; type Instance is tagged record Start : Time := Clock; -- Last moment the timer was released/started Held : Boolean := False; Elapsed : Duration := 0.0; -- Track elapsed time when held end record; end Stopwatch;
cmd/cps/rebuild/uf_main.asm
minblock/msdos
0
87122
; Copyright 1990 Central Point Software, Inc. ; All rights reserved. ;--------------------------------------------------------- ; MAIN MODULE of "Unformat". ; (see _ORG module source for linking info) ; A utility to attempt recovery from ; an accidental hard disk "Format". ; ; Written by GWD. June - August 1987. ; Revised 9-29-87. ; Upgraded for DOS 3.31 huge partitions, etc. 12-23-87. ; Now uses 'include' file. ; Shortened a little. 3-31-88. ; Deals with changed DOS 4.xx DPB structure. 7-29-88. ; Uses new, powerful 'display' procedure. 8-5-88. ; Amended for new Restore_partition function. v5.00 10-31-88. ; Improved INT25h protocol determination. v5.00 11-18-88. ; New partition display function (/PARTN /L) added. 5.00 12-6-88. ; Refuses to run under 5.x DOS. 5.10 1-4-89. ; Cosmetic. In walk, bad sub is now subtracted from path shown. 2-3-89. ; Cosmetic. Show_dir_info now shows time=0 as 12:00am, not 0:00am. 3-21-89. ; Check_cluster proc now accepts 'de_zero' OR 'de_zapped' entries. 3-21-89. ; Now checks for network drives (IBM & Novell). 5-1-89. ; Added international support (date & time displays). 5-23-89. ; Added display of names of INT 25h errors. 02-14-90 6.0 BETA. ; READ_DISK, WRITE_DISK now return true error code. 02-15-90 6.0 BETA. ; ; M000 MD 9/23/90 Removed display of copyright message ; M001 MD 10/14/90 Removed display of no action message with help ; M002 MD 10/29/90 Exit correctly when Mirror file not found ; ;---------------------------------------------------------- ; .LALL ;List all macro def's. prog SEGMENT public para ASSUME CS:prog, DS:prog cr EQU 13 lf EQU 10 ; asm_message MACRO dy1,dy2,dy3,dy4,dy5,dy6 %OUT *MSG: dy1&dy2&dy3&dy4&dy5&dy6 ENDM PUBLIC PROGRESS PUBLIC START PUBLIC CLUSTER_INDEX PUBLIC STACK_END_PTR PUBLIC CLUSTER_CNT_PLUS_1 PUBLIC CURR_FNAME PUBLIC OPTION_TABLE PUBLIC HSUB_COUNT PUBLIC OPTIONS ; ; The following are in the ORG module. ; EXTRN top_of_mem:word, fcb1:byte, parms:byte ;; EXTRN banner:byte ; ; The following are in the I/O module. ; EXTRN display:near, dis_word:word EXTRN get_country_info:near EXTRN printc:near, pr_text:near EXTRN getline:near, flushkey:near, uppercase:near EXTRN skipb:near, ask_trunc:near, tab:near EXTRN pr_dec:near, pr_decl:near EXTRN crout:near, pr_hex_word:near EXTRN pr_hex_byte:near, ask_for_yes:near EXTRN show_progress:near, show_dir_info:near EXTRN copy_fname:near, display_options:near EXTRN look_for_parms:near ; EXTRN print_flags:byte, pf_allowed:abs EXTRN pf_con_pe:abs, pf_ptime:abs, red_pointer:word ; ; The following are in the message (MSG) module. ; EXTRN MSG_INSERT_DISK:BYTE EXTRN yes_char:abs, no_char:abs, quit_char:abs EXTRN msg_bad_parms:byte, msg_network:byte EXTRN msg_write_fake:byte EXTRN msg_warning:byte, msg_bad_drive:byte, msg_print:byte EXTRN msg_dos:byte, msg_strange_disk:byte, msg_small_mem:byte EXTRN msg_abort:byte, msg_no_action:byte EXTRN msg_sys_read_err:byte, msg_read:byte, msg_write:byte EXTRN msg_error:byte EXTRN msg_examined_ent:byte EXTRN msg_root_files:byte, msg_subdirs_found:byte EXTRN msg_searching:byte, msg_stop_hunt:byte EXTRN msg_nothing_found:byte EXTRN msg_only:byte, msg_crosslink:byte EXTRN msg_delete:byte, msg_trunc:byte, msg_ignoring:byte EXTRN msg_walk1:byte, msg_walk2:byte, msg_write_warn:byte EXTRN msg_files:byte, msg_files_rec:byte, msg_done:byte EXTRN msg_help:byte, msg_using_drv:byte, msg_path:byte EXTRN msg_rp_title:byte, msg_listp_title:byte EXTRN msg_i25_wrprot:byte, msg_i25_unit:byte EXTRN msg_i25_not_ready:byte, msg_i25_bad_cmd:byte EXTRN msg_i25_crc:byte, msg_i25_req:byte EXTRN msg_i25_seek:byte, msg_i25_media:byte EXTRN msg_i25_rnf:byte, msg_i25_paper:byte EXTRN msg_i25_writef:byte, msg_i25_readf:byte EXTRN msg_i25_general:byte ; EXTRN restore_partitions:near ;In 'partn' module. EXTRN list_partitions:near ; EXTRN j_rebuild:near ;In Jim's 'Rebuild' module. ; EXTRN last_byte:byte ;In 'last' module. ; INCLUDE UF_INCL.INC ; ;-------------------------------------------------------------------------- ; This is used to translate the INT 25h error codes into text. ; i25_error_struc STRUC i25_err_code DB -1 i25_err_ptr DW 0 ;Offset of asciiz message text. i25_error_struc ENDS ; ;-------------------------------------------------------------------------- ; The following are copied from the Disk Parm Block. ; They must remain contiguous & in this order! ; dpb_start EQU $ ; drive DB -1 ;0=A, 1=B, 2=C, etc. DB ? sector_size DW ? ; Bytes. cluster_mask DB ? ; [sectors/cluster] -1. DB ? ; Log2 [sectors/cluster]. fat_1st_sector DW ? fat_count DB ? root_entries DW ? first_data_sector DW ? cluster_cnt_plus_1 DW ? ;This is also the max allowed cluster number. fat_size DW 0 ;In sectors. A byte, before DOS 4.xx. dpb_length1 EQU ($-1) - dpb_start ;Include only the lo byte of FAT_SIZE. dpb_mid EQU $ dir_1st_sector DW ? DW ?,? ;Driver address. media DB 0 ;F8h for a hard disk. DB ? ;-1 mefore media chk. DW ?,? ;Ptr to next DPB. DW ? ;Last allocated cluster. DW ? ;Free clusters. ; dpb_length2 EQU $ - dpb_mid ;Excludes FAT_SIZE. ; ;------------------------------------------------------------------ EVEN root_sectors DW ? ;Derived from the DPB above. cluster_size DW ? ;In sectors. clusters DW ? ;Total clusters on disk, not count+1. dirs_per_cluster DW ? ;# of dir entries that will fit in 1 subdir cluster. fat16bit DB 0 ;NZ means FAT is 16-bit type, 0 means 12-bit type. ; ;--------------------------------------------------------------------- ; User-selected disposition of fragmented files. ; frag_opt DB "?" ; ; "D" Delete this one file, ask again for next. ; "d" Delete all such files, don't ask again. ; "T" Truncate (shorten) this file, ask again. ; "t" Truncate all such files, don't ask again. ; ; Caution - these are not global equates. They are defined ; in this module and again, identically, in the I/O module. ; ;---------------------------------------------------------------------- ; Flags derived from the command-line parameters. ; options DW 0 ;See include-file OPT_xxxxx equates. ; ;---------------------------------------------------------------------- ; Miscellanious variables. ; dos_ver DW 0 ;E.g., for DOS 3.20, =0314h. progress DW 0 ;Percentage of disk 'hunt' completed. ; free_root_entries DW 0 ;Count. free_root_entry DW 0 ;Offset of first free (unused) root entry. file_counter DW 0 rootsub_count DW 0 ;Root-level subdirs. hsub_count DW 0 ;Subdirs found during HUNT (any level). repeat DW 0 ;Used as loop counter in various places. root_offset DW 0 ;Offset of the root entry currently being processed. cluster_index DW 0 ;Selects a disk cluster. ; ;----------------------------------------------------------------- ; Variables used by directory tree walker. ; tree_struc STRUC tcluster0 DW ? ;First cluster of current directory (special: 0=root). tcluster DW ? ;Current cluster of the current directory. toffset DW ? ;Offset of an entry in the current cluster. tree_struc ENDS ; ; tree_level DW -1 ;Offset into TREE. ; tree_size EQU 33 ;Max allowed depth of subdirectory tree. tree LABEL word tree_struc tree_size DUP( <0,0,0> ) ; pathdrv DB "Q:" ; path DB 66 DUP(0) ;ASCIIZ path name (e.g. "\SUBDIR.1\PROGS"). path_guard DB -1 ; curr_fname DB "current_.fil",0 ;Temp storage for ASCIIZ file name. ; clu_in_buffer DW -1 ;# of cluster now in the cluster-segment (-1=none). clu_dirty DB 0 ;0=data unchanged. NZ=data must be rewritten to disk. ; ;------------------------------------------------------------------------ ; This controls the protocol used for INT 25h/26h. ; i25_protocol DB i25p_unknown i25p_unknown EQU "?" ;Use old method. i25p_old EQU "o" ;Use old method. i25p_new EQU "n" ;Use NEW method. ; ; Parm block for DISK_READ and DISK_WRITE. Keep together & in order! EVEN sector_lo DW 0 sector_hi DW 0 sector_count DW 1 dta DW 0 dta_seg DW 0F000h ; ;------------------------------------------------------------------------- fat_para DW 0 ;Paragraphs required for FAT when in 16-bit format. ; fat_seg DW ? ;Segments are determined at run-time, of course. dir_seg DW ? cluster_seg DW ? ;Room for 1 cluster only. Used when hunting/walking. stack_end_ptr DW ? ;Offset in CS (& SS) of free space beyond our stack. ; prog_size DW OFFSET last_byte ;Space used by the load module. stack_size EQU 300 ; ; ;===================== Program Code begins ======================= ; start: nop cld sti mov bx,prog_size lea bx,[bx+stack_size] lea sp,[bx] add bx,31 and bl,0F0h mov stack_end_ptr,bx xor bx,bx push bx mov bp,sp xor al,0FFh ;If drive is valid then AL becomes FF, else 0. and fcb1,al ;If no drive was specified, FCB1 was already 0. ; lea di,parms mov bl,[di] inc di mov bh,0 mov [bx+di],bh ;Make sure parmline ends with a 0. mov cx,bx cmp cl,2 jb start2 mov al,"?" cld repne scasb ;Search parmline for "?". jne start2 ;For now, ignore other parms. ; call show_banner ;M000 jmp short show_help start2: MOV AX,3306H ; get true DOS version MOV BX,0 ; ala DOS 5.0 INT 21H CMP BL,5 ; function supported? JB START3 MOV AX,BX JMP SHORT START4 START3: mov ah,30h ;Get DOS version. int 21h start4: xchg al,ah mov dos_ver,ax ; cmp ax,600h RI-Don't need to check upper dos version ; jae wrong_dos cmp ax,200h jae dos_ok wrong_dos: lea dx,msg_dos call pr_text jmp exit dos_ok: xor ax,ax mov options,ax ;Init all parm switches OFF. mov print_flags,al ; call get_country_info ; lea si,parms+1 ;Examine the command line. call look_for_parms jc bad_parms test options,opt_j ; if /J specified jz parms_ok ; that better be all cmp options,opt_j ; that is specified je parms_ok bad_parms: lea dx,msg_bad_parms call pr_text jmp exit ; don't show help message on bad cmd line show_help: lea dx,msg_help call pr_text jmp exit ;M001 bad_drive: ; call show_banner ;M000 bad_drive2: lea dx,msg_bad_drive call pr_text jmp exit network_drive: ; call show_banner ;M000 lea dx,msg_network call pr_text jmp exit parms_ok: mov ax,options test ax, opt_partn jz not_partn ; ; User has selected the /PARTN option, & possibly the /L (list) option. ; ; call show_banner ;M000 test ax, NOT (opt_wrfake OR opt_partn OR opt_list) jnz bad_parms lea dx,msg_rp_title ;"Partition Table restoration" test ax, opt_list jz show_partn_title lea dx,msg_listp_title ;"Partition Table display" show_partn_title: call pr_text call display_print_opt ;(If no /P, does nothing.) test print_flags, pf_allowed ;Was /P option selected? jz do_partn ;No. mov al,pf_con_pe or al,pf_ptime ;Combine two extrn symbols. or print_flags,al ;Activate printing now. do_partn: call display_options test options, opt_list jnz do_list_partn call restore_partitions ;In _PARTN module. jmp exit do_list_partn: call list_partitions ;In _PARTN module. jmp exit ; ; For cases other than /PARTN, we require a valid drive specifier. ; not_partn: mov al,fcb1 cmp al,0 jz bad_drive dec al mov drive,al add al,"A" mov pathdrv,al ;; MOV INSERT_DRV,AL call check_network_drive jc network_drive CALL HAVE_DISKETTE_INSERTED mov bx,options test bx, NOT opt_j ;Any parms other than /J ? jnz do_unformat ;Yes, must be meant for us. Skip Jim's stuff. test print_flags, pf_allowed jnz do_unformat ;Print options means it's for us. do_j: mov ah,0 ;Assume no option. test bx, opt_j jz do_j2 mov ah,1 ;Inform j_rebuild of the /J option. do_j2: mov bx,stack_end_ptr mov al,drive nop call j_rebuild ;Try Jim's Rebuild first. nop push cs pop ds push cs pop es cld sti mov bp,sp cmp al,1 ;Jim's side completed successfully? je j_exit ;Yes. Nothing more to do. cmp al,2 ;User terminated? M002 je j_exit ; M002 cmp al,6 ;Panic exit? je j_exit test options, opt_j ;Jim's option? jnz j_exit ;Yes. Not for us. ; mov ah,0Fh ;Get video mode into AL. ; int 10h ; and al,7Fh ;Clear the EGA keep_screen bit. ; mov ah,0 ;Re-init, to same mode (erases screen). ; int 10h ; gotta first find how many lines to clear MOV CX,184FH XOR DX,DX MOV AX,1130H XOR BH,BH PUSH CX INT 10H POP CX CMP DX,18H JBE CLEAR_SCREEN MOV CH,DL CLEAR_SCREEN: MOV AX,0600H MOV BH,7 MOV DX,CX MOV CX,0 INT 10H ; clear screen MOV AH,2 MOV DX,0 MOV BH,0 INT 10H ; move cursor to 0,0 jmp short do_unformat j_exit: jmp exit ; ;------------------------------------------------------------------- do_unformat: ; call show_banner ;M000 lea dx,msg_warning call pr_text mov ah,2Ah ;Get date from DOS. int 21h ;Returns DH=month, DL=day, CX=year. mov bx,cx ;Save year into BX. mov al,dl mov ah,0 ;Need correct date for our subdir template. mov si,ax ;Build it in SI. mov al,dh mov cl,5 shl ax,cl or si,ax sub bx,1980 mov cl,9 shl bx,cl or si,bx mov subdir.date, si call display_print_opt or print_flags, pf_con_pe mov al,drive add al,"A" lea dx,msg_using_drv ;"Using drive @0a:",cr,lf call display call ask_for_yes ;"Are you SURE? If so, type in YES." jnz no_action call look_for_parms ;Slash parms are allowed after the YES. jnc parms2_ok badp_stp: jmp bad_parms no_action: lea dx,msg_no_action ;"No action taken". call pr_text jmp exit parms2_ok: mov ax,options test ax, opt_j OR opt_partn ;These are not allowed here. jnz badp_stp get_drv_parms: cmp dos_ver, 314h ;3.20? jb get_dpb mov bl,drive mov bh,0 inc bx mov ax,4409h int 21h jc get_dpb test dx,9200h ;Network, remote or SUBST? jnz strange_disk get_dpb: mov dl,drive inc dl mov ah,32h ;Get Drive Parm Block (DPB) for drive DL. int 21h ;Returns addr in DS:BX. cmp al,0FFh ;Should never happen, but check anyway. jne copy_drv_parms push cs pop ds jmp bad_drive2 ; strange_disk: lea dx,msg_strange_disk call pr_text jmp no_action ; copy_drv_parms: push cs pop es cld lea si,[bx+1] mov di,OFFSET dpb_start+1 ;Don't copy the drive byte. mov cx,dpb_length1-1 rep movsb cmp cs:dos_ver,400h jb copy_drvp2 movsb ;Copy the high byte of FAT_SIZE. jmp short copy_drvp3 copy_drvp2: inc di ;Leave high byte of FAT_SIZE = 0. copy_drvp3: mov cx,dpb_length2 rep movsb push cs pop ds mov al,0 cmp cluster_cnt_plus_1, 4085 jbe know_fat_type mov al,16h ;Non-zero means 16-bit FAT. know_fat_type: mov fat16bit,al ; cmp root_entries,4096 ;Root must fit inside a 64k segment. jb rt_sz_ok strange_stp: jmp strange_disk ; rt_sz_ok: mov ax,cluster_cnt_plus_1 cmp ax,1 jbe strange_stp mov bx,ax dec bx ;BX = cluster count. mov clusters,bx inc ax ;One more, for number of FAT entries (C+2). cmp ax,0FFF6h jae strange_stp add ax,7 ;Provide for rounding up. mov cl,3 ;8 words (FAT entries) per paragraph. shr ax,cl ;AX = paragraphs for the 16-bit FAT. mov bx,sector_size test bx,0F1FFh ;Allow 512, 1024 and 2048 byte sectors. jnz strange_stp mov cl,4 shr bx,cl ;BX = paragraphs per sector. xor dx,dx div bx ;Compute for whole-sector requirement. call roundup mul bx ;AX = paragraphs for 16-bit FAT. mov fat_para,ax ; mov ax,32 mul root_entries ;(32 bytes/entry) * #entries. jc strange_stp ;Root dir exceeds 64k bytes. div sector_size call roundup mov root_sectors,ax ;Number of sectors in root dir. ; mov al,cluster_mask mov ah,0 inc ax mov cluster_size,ax mul sector_size mov cx,32 div cx mov dirs_per_cluster,ax ; ; Check available memory and setup pointers to our FAT, Dir & cluster buffers. ; Bytes needed = ; 100h + program + stack + FAT16 (maybe 128k) + root + 1 cluster. ; mov bx,stack_end_ptr ;The offset base of free space. mov cl,4 shr bx,cl ;Convert to paragraphs. mov ax,cs add bx,ax ;BX:0000 points at 1st free byte. mov fat_seg,bx add bx,fat_para jc small_mem mov dir_seg,bx mov ax,sector_size mul root_sectors shr ax,cl ;CL=4. add bx,ax jc small_mem mov cluster_seg,bx mov ax,cluster_size mul sector_size shr ax,cl add bx,ax ;BX = para just above what we need. jc small_mem cmp bx,top_of_mem jb enough_mem small_mem: lea dx,msg_small_mem call pr_text jmp exit ; enough_mem: ;Now we clear all our memory buffers. mov dx,fat_seg ;First (and lowest) buffer. sub bx,dx ;Compute total paragraphs for our buffers. xor ax,ax cld clr_all_bufs: mov es,dx xor di,di mov cx,8 ;Eight words per paragraph. rep stosw inc dx ;Next para. dec bx jnz clr_all_bufs push cs pop es nop test print_flags, pf_allowed jz show_opts or print_flags, pf_ptime ;Turn on printing, now. show_opts: call display_options ; ; Determine which INT 25h/26h protocol is required. ; mov ax,dos_ver mov bl,i25p_old cmp ax,(3*256)+30 ;Older than 3.30 DOS? jb init_25p ;Always use old method. mov bl,i25p_unknown cmp ax,(3*256)+40 ;Older than 3.40 DOS? jb init_25p mov bl,i25p_new ;Always use new method. init_25p: mov i25_protocol,bl xor ax,ax mov sector_lo,ax mov sector_hi,ax mov dta,ax inc ax mov sector_count,ax mov ax,fat_seg mov dta_seg,ax try_protocol: call read_disk ;See if the chosen protocol really works. jnc try_ok cmp al,7 ;Error = unknown media ? jne try_strange mov al,i25p_new xchg al,i25_protocol cmp al,i25p_unknown je try_protocol try_strange: jmp strange_disk try_ok: cmp i25_protocol,i25p_unknown jne read_fat mov i25_protocol,i25p_old jmp short read_fat ; sys_read_err: lea dx,msg_sys_read_err ;"Can't read system area of disk." call pr_text jmp no_action ; ; Read in the entire first FAT into our buffer. ; read_fat: mov ax,fat_1st_sector mov sector_lo,ax xor ax,ax mov sector_hi,ax mov dta,ax ;Might be more than 128 sectors, which mov cx,fat_size ;complicates reading & FAT addressing. mov sector_count,1 ;So, we will read 1 at a time. mov ax,fat_seg mov dta_seg,ax readf_lp: call read_disk jc sys_read_err mov ax,sector_size add dta,ax jnc readf_next add dta_seg,1000h ;Next 64k segment. mov dta,0 readf_next: inc sector_lo loop readf_lp ; test fat16bit,0FFh ;Disk FAT is already in 16-bit format? jnz fat_is_16 ;Yes. call fat12_expand ;No, convert 12-bit format into 16-bit. fat_is_16: mov ax,options test ax, opt_keep_fat jnz read_root ;Leave the FAT intact. mov dx,fm_bad test ax, opt_erase_fat jz orig_fat0 mov dx,fm_free orig_fat0: mov cx,clusters mov di,2*2 ;Begin with cluster 2 (doubled for offset). mov bl,media mov bh,0FFh mov ds,fat_seg ASSUME DS:nothing xor si,si xor ax,ax ;AX = FM_FREE. xchg bx,[si] ;Should be unchanged. cmp bx,[si] ;FAT media byte was intact? jne orig_fat_lp ;No - clear all FAT entries (AX=0). mov ax,dx ;Write all entries, unless they match AX. orig_fat_lp: cmp ax,[di] ;Matches FM_BAD (or FM_FREE)? je orig_fat_next ;Yes, leave this one unchanged. mov [di],si ;Clear all other FAT entries. orig_fat_next: inc di inc di loopnz orig_fat_lp ;Until CX=0 (done) or DI=0 (segment limit). jcxz orig_fat_end mov di,ds add di,1000h ;2nd segment. mov ds,di xor di,di jmp orig_fat_lp orig_fat_end: ASSUME DS:prog push cs pop ds nop ; ; Read the entire root directory into our buffer. ; read_root: mov ax,root_sectors mov sector_count,ax xor ax,ax mov dta,ax mov sector_hi,ax mov ax,dir_1st_sector mov sector_lo,ax mov ax,dir_seg mov dta_seg,ax call read_disk jnc root_rdok jmp sys_read_err ; root_rdok: mov ax,options test ax, opt_keep_root jnz alrf_stp ;Leave root intact. test options, opt_erase_root jz examine_root mov es,dir_seg cld xor di,di mov ax,sector_size shr ax,1 ;Words per sector. mul root_sectors mov cx,ax xor ax,ax ;Clear the entire root dir to zeros. rep stosw alrf_stp: jmp alloc_root_files ; ; Examine the root directory in the buffer. ; 1 - Existing files and level_1 subdirs are not harmed. ; 2 - Deleted root files & dirs are discarded. ; 3 - Format-zapped (1st byte=0) level_1 subdirectories will live again. ; 4 - Format-zapped root files will live again. ; 5 - Entries zapped by CPS Formatter will live again (with correct 1st char). ; 6 - The root directory is packed. ; examine_root: mov ax,root_entries mov repeat,ax ;This is the big loop counter. mov free_root_entries,ax mov es,dir_seg cld ; examine_root_lp: mov ax,root_offset mov di,ax call check_dir_entry ;Returns AH=status, AL=attribute. test ah, de_invalid OR de_sublink jnz root_corrupted test ah,de_zeros jz exr_not_z ;Not all zeros. jmp ex_root_done ;Root has been zeroed. root_corrupted: mov byte ptr es:[di],0 ;End-of-dir mark. mov ax,di mov cl,5 shr ax,cl ;Figure how many. lea dx,msg_examined_ent ;"Examined @0d root entries.",cr,lf call display jmp ex_root_done ;Ignore remainder of root. exr_not_z: test ah,de_zapsaved ;Zapped by CPS Formatter (recoverable)? jz exr_not_zs ;No. mov dl,es:[di].zapsav_loc mov es:[di].filename, dl ;Restore the saved 1st character. push ax push di lea di,[di].zapsav_loc mov cx,zapsav_length mov al,0 cld rep stosb ;Clear the zap-save area (don't need it now). pop di pop ax exr_not_zs: test al,vol_attr jnz resurrect_vol test ah,de_deleted jnz ignore_dir_entry mov bx,es:[di].start_cluster TEST AL,DIR_ATTR ; if this is a sub-dir JNZ EXR_CLU ; size is gonna be zero, branch MOV CX,ES:[DI].FILE_SIZE OR CX,ES:[DI].FILE_SIZE+2 ; is file size zero? JNZ EXR_CLU ; no, branch OR BX,BX ; yes and if starting clu iz not zero JNZ IGNORE_DIR_ENTRY ; jmp JMP SHORT RESURRECT_FILE ; otherwise, process the zero len file EXR_CLU: cmp bx,2 ;Valid starting cluster? jb ignore_dir_entry cmp bx,cluster_cnt_plus_1 ja ignore_dir_entry test al,dir_attr jnz resurrect_dir resurrect_file: inc file_counter test ah, de_live OR de_zapsaved jnz decide_if_pack ;Accept name as-is. mov byte ptr es:[di].filename, "F" ;Fix 1st char of name. jmp short decide_if_pack resurrect_vol: test ah,de_zapsaved jnz decide_if_pack ;Accept restored name. ignore_dir_entry: jmp short next_root_entry resurrect_dir: inc rootsub_count test ah, de_live OR de_zapsaved jnz decide_if_pack ;Don't alter the name. mov byte ptr es:[di].filename, "D" ;Fix the lost 1st char. call make_subdir_entry push di lea di,[di].extension lea si,subdir.extension mov cx,3 rep movsb ;Change the extension only. pop di decide_if_pack: ;Valid root entry accepted. test options, opt_list ;First, should we display it? jz decide_ip2 ;No. call show_dir_info call crout decide_ip2: dec free_root_entries mov si,free_root_entry add free_root_entry,32 cmp di,si ;Need to relocate this dir entry? je next_root_entry ;No. pack: push es ;We want all entries to be packed near pop ds ;the beginning of the root directory. nop push di xchg di,si mov cx,32/2 rep movsw ;Relocate this directory entry. pop di ;Recover the pointer to old location. push di ;Resave it. mov cl,32/2 xor ax,ax rep stosw ;Erase the old occurrance of this entry. pop di push cs pop ds ;Restore DS=CS. nop next_root_entry: add root_offset,32 dec repeat jz ex_root_done call flushkey jc ex_rt_abt jmp examine_root_lp ex_rt_abt: jmp no_action ex_root_done: xor ax,ax cmp ax,free_root_entries jz alloc_root_files ;Root is full. mov di,free_root_entry mov es:[di],al ;End-of-dir mark. ; ; Count the files & subdirs in the root. Also, maybe mark ; up the FAT, according to the root entry start_clusters. ; alloc_root_files: xor ax,ax mov rootsub_count,ax ;We're going to count them again. mov file_counter,ax mov es,dir_seg xor di,di mov cx,root_entries mov free_root_entries,cx alloc_rtf_lp: mov ax,di call check_dir_entry test ah, de_zapped OR de_zeros OR de_invalid jnz alloc_rtf_done test ah,de_live jz alloc_rtf_next test al,vol_attr jnz alloc_rtf_next ;Don't count vol label as a file. test al,dir_attr jnz alloc_rtf_d mov dx,fm_file_start inc file_counter mov ax,es:[di].file_size or ax,es:[di].file_size+2 jz alloc_rtf_next ;Zero length file has no clusters. jmp short alloc_rtf_st alloc_rtf_d: mov dx,fm_sub_start inc rootsub_count alloc_rtf_st: test options, opt_keep_fat jnz alloc_rtf_next ;We're only counting them. mov ax,dx mov bx,es:[di].start_cluster call store_link alloc_rtf_next: dec free_root_entries add di,32 loop alloc_rtf_lp ; alloc_rtf_done: mov ax,file_counter or ax,rootsub_count jz hunt1 call crout mov ax,file_counter lea dx,msg_root_files ;"Files found in root: @0d",cr,lf call display mov ax,rootsub_count lea dx,msg_subdirs_found ;"Subdirectories found in root: @0d",crlf call display or ax,ax jz hunt1 ;No subs in root, positively MUST hunt. test options, opt_keep_fat jz hunt1 ;No, must search the disk to locate subsubs. jmp nowalk ;Yes, hunt and tree walk are not needed. ; ;---------------------------------------------------------- ; Hunt across the disk, reading every data cluster, ; looking for ones which look like subdirectories. ; hunt1: lea dx,msg_searching ;"Searching disk...",cr,lf call pr_text mov cluster_index,2 mov hsub_count,0 mov progress,0 mov ax,clusters mov repeat,ax ; h1_lp: call show_progress call flushkey jnc h1_no_esc h1_esc: lea dx,msg_stop_hunt ;"Complete remainder of search (Y/N/Q)? " call pr_text call getline jc h1_esc ;Reject ESC here, since Q is allowed. jz h1_esc ;No default - must enter something. cmp al,yes_char je h1_no_esc ;Continue search. cmp al,no_char je h1_answ_no cmp al,quit_char jne h1_esc ;Ask again. lea dx,msg_abort ;"Cancelled" call pr_text jmp no_action h1_answ_no: jmp h1_done h1_no_esc: mov bx,cluster_index call get_link ;Fetch FAT entry # BX. cmp ax,fm_bad je h1_next_clu_stp ;Skip cluster already marked bad. mov ax,bx call calc_sector ;Updates SECTOR_HI & SECTOR_LO. h1_read_it: mov ax,cluster_seg mov dta_seg,ax mov es,ax xor di,di mov dta,di mov ax,cluster_size mov sector_count,ax call read_disk ;Read the entire cluster. jnc h1_chk mov bx,cluster_index mov ax,fm_bad ;Mark it bad in the FAT. jmp short h1_mod_fat h1_chk: call check_cluster ;Is this a subdirectory cluster? or ax,ax jnz h1_found_sub ;Yes, it is. h1_next_clu_stp: jmp short h1_next_clu h1_found_sub: mov dx,ax ;Save return code from CHECK_CLUSTER. call get_link ;Get FAT entry currently there (#BX). test options, opt_keep_fat ;FAT is assumed already valid? jz h1_fsub ;No, must build it. cmp ax,fm_free ;Cluster is (should be) allocated? je h1_next_clu_stp ;No. Believe valid FAT, ignore find. jmp short h1_fsubc ;Maybe need a new root entry. h1_fsub: or ax,ax ;Free cluster (as expected)? jnz h1_next_clu_stp ;Ignore it, cluster already allocated. h1_fsubc: mov ax,dx cmp ax,fm_sub_start ;Is it the start of a subdir? je h1_fsubd ;Yes. cmp ax,fm_end ;Complete subdir in the cluster? je h1_fsubd ;Yes. cmp ax,fm_sub_nul ;Empty, but a complete subdir? jne h1_mod_fat ;No. Make no root entry. h1_fsubd: cmp bx, es:[di].start_cluster ;Self-link is correct? jne h1_next_clu_stp ;Wrong. Ignore it. inc hsub_count cmp word ptr es:[di+32].start_cluster, 0 ;Root level subdir? jz h1_make_sub ;Yes. h1_mod_fat: call store_link ;BX= cluster #, AX= new FAT entry jmp short h1_next_clu ;(if /KF, STORE_LINK did nothing). h1_make_sub: test options, opt_keep_root ;Root is already valid & protected? jnz h1_next_clu ;Yes. call store_link cmp free_root_entries,0 ;We need to create a root entry. jz h1_done ;Abnormal exit, root dir is full. inc rootsub_count ;Another subdir in root. call make_root_sub ;Create root subdir entry. h1_next_clu: inc cluster_index dec repeat jz h1_done jmp h1_lp ;Keep looking. ; h1_done: call crout mov ax,rootsub_count or ax,file_counter jnz show_hunt_results lea dx,msg_nothing_found call pr_text jmp no_action ; show_hunt_results: mov ax,file_counter lea dx,msg_root_files ;"Files found in root: @0d",cr,lf call display mov ax,rootsub_count lea dx,msg_subdirs_found ;"Subdirectories found in root: @0d",crlf call display ; test options, opt_keep_fat jz cleanup_fat nowalk: lea dx,msg_write_fake ;" changes not written to disk." test options,opt_wrfake jnz fp_ww lea dx,msg_write_warn ;"Next phase writes to hard disk." fp_ww: call pr_text ;(This appears also at WALK_DONE.) call ask_for_yes jnz cancel_stp jmp write_system_area cancel_stp: jmp no_action ; cleanup_fat: call link_subs ;Deal with all those FM_SUB_XXXs in the FAT. ; ;----------------------------------------------------------------------- ; Now, we walk the directory tree structure, twice. ; ; First walk: Mark 'live'-file starting_clusters, verify tree structure. ; Display paths. In verbose /L mode only, list each filename. ; ; Second walk: 1. Display paths. ; 2. Check file lengths. ; 3. If fragmented, prompt user. ; 4. Delete/truncate as selected, or complete the FAT chains. ; walk_begin: lea dx,msg_walk1 call pr_text mov repeat,2 walk_tree: lea di,tree mov cx,((SIZE tree_struc) * tree_size)/2 xor ax,ax mov file_counter,ax push cs pop es cld rep stosw ;First, set things up. mov tree_level,ax mov word ptr path,ax ;AX=0. mov clu_dirty,al ;Buffer never modified in 1st walk. dec ax ;AX=-1. mov clu_in_buffer,ax mov tree.toffset,ax ;Special value for beginning of dir. jmp walk_show_path ;Show it, then jump to WALK_LP. ; walk_abort: lea dx,msg_abort call pr_text jmp exit walk_lp: call flushkey jc walk_abort ; call dir_walk ;Returns ES:DI=dir entry, & AX=result. jc walk_dir_end ; mov dl,es:[di] ;Just to see in debugger. test ah, de_zeros OR de_zapped OR de_invalid jnz walk_dir_end test ah,de_deleted jnz walk_lp ;Ignore deleted entries. Get another. test ah,de_sublink ;Entries "." or ".."? jnz walk_lp ;Ignore them (already checked by DIR_WALK). test al,vol_attr jnz walk_lp ;Ignore volume label (uses no disk space). test al,dir_attr jnz walk_subdir ;It's a subdirectory entry. mov dx,es:[di].file_size or dx,es:[di].file_size+2 ; jz walk_lp ;Ignore zero length file (no disk space). JNZ WALK_NON0_FILE ; non-zero file, branch CMP REPEAT,2 ; is it the first pass JE WALK1C_STP ; yes, jmp INC FILE_COUNTER ; no, increment the file counter JMP WALK_LP ; and then jump WALK1C_STP: JMP WALK1C WALK_NON0_FILE: cmp repeat,2 ;Must be a live file. First walk or 2nd? je walk1 jmp walk2 ; walk_subdir: mov bx,es:[di].start_cluster ;For subdir_nul handling. call add_to_path ;(also returns CHECK_CLU code) jc walk_suberr cmp ax,fm_sub_nul ;Empty-subdir FAT mark? jne walk_show_path ;No. mov ax,fm_end ;Since this subdir IS part of the call store_link ;tree, change mark #BX to FM_END. jmp short walk_show_path walk_suberr: test options, opt_list jz walk_lp call show_dir_info lea dx,msg_ignoring ;"Ignoring this subdirectory." call pr_text lea dx,path ;To see in debug. call sub_from_path cmp repeat,2 ;Which walk? je walk_lp ;Walk1 - just ignore it. mov byte ptr es:[di],0E5h ;Mark deleted in walk2. jmp walk2_dirt ;Maybe dirtied the buffer. walk_dir_end: cmp tree_level,0 ;Root level? jnz walk_backup jmp walk_done walk_backup: lea dx,path ;To see in debug. call sub_from_path walk_show_path: ;Arrive from WALK_TREE, _SUBDIR or _DIR_END. lea ax,pathdrv lea dx,msg_path ;"Path=@0t\",cr,lf call display jmp walk_lp ; ; This is done only during the first walk. ; walk1: mov bx,es:[di].start_cluster call get_link cmp ax,fm_free ;Starting cluster is free? je walk1b ;Yes. Allocate it for this file. cmp ax,fm_file_start ;Already start-of-file there? jne walk_lp_stp ;No. Ignore cross-link. cmp tree_level,0 ;This is a root level file? jz walk1c ;Must've been marked by EXAMINE_ROOT. walk_lp_stp: jmp walk_lp ;Error! Ignore cross-link. walk1b: mov ax,fm_file_start call store_link ;Allocate the starting cluster. walk1c: inc file_counter test options, opt_list jz walk_nv call show_dir_info call crout walk_nv: jmp walk_lp ; ; This is done only during the second walk. ; walk2: mov bx,es:[di].start_cluster call get_link cmp ax,fm_file_start ;The expected FAT entry. jne walk2_cross ;Must've detected crosslink in walk1. call check_contig_free ;Returns CF, AX=#contiguous clusters. mov cx,ax jc walk2_frag ;Not enough. File must be fragmented. inc file_counter call complete_chain ;File seems contiguous, so it's easy. jmp walk_lp walk2_cross: call show_dir_info lea dx,msg_crosslink ;"Deleting crosslinked file.",CRLF. call pr_text mov byte ptr es:[di],0E5h ;Delete only the directory entry. jmp short walk2_dirt walk2_frag: ;CX holds max contig clusters. call show_dir_info ;File name, size, date & time. mov ax,sector_size mul cluster_size mul cx mov dis_word+(2*1),ax mov dis_word+(2*2),dx lea dx,msg_only ;"Only @1l bytes are recoverable",crlf call display mov al,frag_opt cmp al,"d" ;Was 'ALL' previously specified? jae walk2_td ;Yes, so don't ask again. call ask_trunc ;"Truncate or delete this file?" jnc walk2_savop jmp walk_abort walk2_savop: mov frag_opt,al walk2_td: call uppercase cmp al,"T" ;Delete or Truncate the file? je walk_truncate lea dx,msg_delete call pr_text ;"Deleting this file." mov byte ptr es:[di],0E5h ;Mark deleted, in the directory. mov bx,es:[di].start_cluster mov ax,fm_file_del call store_link ;Mark cluster to be freed, later. jmp short walk2_dirt walk_truncate: lea dx,msg_trunc ;"Truncating this file." call pr_text mov ax,cluster_size mul cx mul sector_size ;Clusters * sect/clu * bytes/sect. mov es:[di].file_size,ax ;Change size in directory entry. mov es:[di].file_size+2,dx call complete_chain ;CX = # of clusters. inc file_counter walk2_dirt: cmp tree_level,0 jz walk2_dirt2 ;Root directory is not in cluster buffer. mov clu_dirty,-1 ;We have modified data in the cluster buffer. walk2_dirt2: call crout jmp walk_lp ; walk_done: dec repeat jz walks_both_done mov ax,file_counter lea dx,msg_files ;lf,"Files found: @0d",cr,lf,lf call display lea dx,msg_write_warn ;"Next phase writes to hard disk." test options, opt_wrfake jz walk_warn lea dx,msg_write_fake ;"/W not specified. Writes faked" walk_warn: call pr_text call ask_for_yes jz walk_wr_yes jmp no_action walk_wr_yes: lea dx,msg_walk2 call pr_text jmp walk_tree walks_both_done: xor ax,ax call read_sub_cluster ;Write last changes (if any) to disk. call fix_fm_dels ;Deal with any FM_FILE_DELs in FAT. mov ax,file_counter lea dx,msg_files_rec ;cr,lf,"@0d files recovered." call display ; ; ; Lastly, we write the new FAT and root directory to the hard disk. ; write_system_area: nop ;A place to put a breakpoint. test options, opt_keep_fat jnz write_dir cmp fat16bit,0 jnz write_fats ;Disk FAT is 16-bit, so leave it that way. call fat16_compress ;Back to 12-bit format. write_fats: mov ax,fat_1st_sector mov sector_lo,ax mov al,fat_count mov ah,0 mov repeat,ax write_fat: xor ax,ax mov dta,ax mov sector_hi,ax mov ax,fat_seg mov dta_seg,ax mov cx,fat_size mov sector_count,1 write_fat_sec: call write_disk jc exit mov ax,sector_size add dta,ax jnc write_fat_next add dta_seg,1000h mov dta,0 write_fat_next: inc sector_lo loop write_fat_sec sub repeat,1 ;Is there a 2nd FAT? ja write_fat ;Yes. ; ; Even if root is 'protected', it might be slightly modified. Rewrite it. ; write_dir: mov ax,dir_seg mov dta_seg,ax xor ax,ax mov dta,ax mov sector_hi,ax mov ax,dir_1st_sector mov sector_lo,ax mov ax,root_sectors mov sector_count,ax call write_disk jc exit ; all_done: lea dx,msg_done call pr_text ; exit: mov ah,0Dh ;Flush DOS disk buffers. int 21h nop int 20h ;Terminate. Return to DOS. ; ;========================== Procedures ============================= ; ; Read (write) logical sectors into (from) memory. ; ; On entry: rw_parm block must be setup with sector_lo & hi, ; sector_count and dta (disk transfer address). ; ; On exit: If error then CF=true and AX=error code, else CF=false. ; Error messages and sector # are printed in here. ; ; Only AX is changed. ; read_disk PROC NEAR mov ah,"R" jmp short rw_disk write_disk PROC NEAR mov ah,"W" rw_disk: push bx push cx push dx push si push di push bp cmp ah,"R" je rw_2 test options, opt_wrfake ;Faking writes? jz rw_2 jmp rw_done ;Faking. Leave with CF=false. rw_2: push ds mov al,drive lea bx,sector_lo mov cx,0FFFFh mov dx,cx cmp i25_protocol,i25p_new je rw_3 mov dx,sector_lo mov cx,sector_count lds bx,dword ptr dta rw_3: cmp ah,"W" jne rw_25 lea si,msg_write ;"writing" push si int 26h jmp short rw_4 rw_25: lea si,msg_read ;"reading" push si int 25h rw_4: pop cx ;Discard extra flags from stupid DOS. pop si ;Recover ptr to error message part. pop ds ;Recover DS. cld sti jnc rw_done ;No error. cmp al,7 ;Error = unknown media (wrong protocol)? jne rw_show_err ;No, display it. cmp i25_protocol, i25p_unknown je rw_error ;Suppress err msg during protocol testing. rw_show_err: mov cx,ax ;Preserve error code into CX. mov dis_word+(2*4),ax mov dis_word+(2*1),si mov ax,sector_hi mov dis_word+(2*2),ax mov ax,sector_lo mov dis_word+(2*3),ax lea si,int25_error_list rw_find_err_lp: xor bx,bx mov al, [si].i25_err_code cmp al,-1 je rw_found_err ;End of list, without match. BX=0. mov bx, [si].i25_err_ptr cmp cl,al ;Matching error code? je rw_found_err lea si,[si] + SIZE i25_error_struc jmp rw_find_err_lp rw_found_err: mov dis_word+(2*5),bx lea dx,msg_error ; ; "Error @1t sector# @2w@3wh, code @4wh@5t.",cr,lf ; ; Error writing sector# 00000000h, code 0000h sector not found. ; call display mov ax,cx ;Recover error code. rw_error: stc rw_done: pop bp pop di pop si pop dx pop cx pop bx ret write_disk ENDP read_disk ENDP ; ;------------------------------------------------------------------- ; Calculate logical sector from cluster number. ; ; On entry: AX= cluster number (range 2 to nnnn). ; On exit: If in range then CF=false and SECTOR_HI & _LO are updated. ; If invalid cluster number then CF=true. ; ; All regs are unchanged. ; calc_sector PROC NEAR push ax push dx mov dx,cluster_cnt_plus_1 cmp dx,ax ;Carry true if Max < requested #. jb calcsec_done sub ax,2 jb calcsec_done ;Return with CF=true. mul cluster_size add ax,first_data_sector adc dx,0 ;Should always yield CF=false. mov sector_lo,ax mov sector_hi,dx calcsec_done: pop dx pop ax ret calc_sector ENDP ; ;------------------------------------------------------------------ ; Read one entire subdirectory cluster into our cluster buffer. ; If current contents of our cluster buffer have been modified ; (CLU_DIRTY non zero), that data will be rewritten to disk before ; the new cluster is read from disk. ; ; On entry: AX=cluster number (special value 0 means ; just flush the buffer, don't read anything). ; ; On exit: If successful then CF=false. ; If error writing (fatal), CF=true and AX=FFFF (-1). ; If error reading, then CF=true and AX=DOS code. ; Only AX is changed. ; read_sub_cluster PROC NEAR push bx cmp ax,clu_in_buffer ;Buffer already holds desired data? je read_sclu_exit ;Yes. Do nothing, return CF=false. mov bx,ax ;Save cluster # into BX. mov ax,cluster_seg mov dta_seg,ax mov dta,0 mov ax,cluster_size mov sector_count,ax ; mov ax,clu_in_buffer cmp ax,-1 ;Buffer contains any data? je read_sclu ;None. cmp clu_dirty,0 ;Buffer holds modified data? jz read_sclu ;No. call calc_sector ;For the cluster NOW in buffer. call write_disk ;Write modified data back to disk. mov clu_dirty,0 mov ax,-1 ;Assume write error. jc read_sclu_exit ;Error while writing. read_sclu: mov clu_dirty,0 mov clu_in_buffer,-1 mov ax,bx or ax,ax ;Special value for flush-only? jz read_sclu_exit ;Yes, don't read anything. CF=0. call calc_sector ;For desired cluster. call read_disk jc read_sclu_exit mov clu_in_buffer,bx read_sclu_exit: pop bx ret read_sub_cluster ENDP ; ;---------------------------------------------------------------- ; On entry: BX=cluster number, AX=new link value to be written. ; On exit: all regs preserved. ; store_link PROC NEAR cmp bx,cluster_cnt_plus_1 ja stlnk2 ;Out of range. test options, opt_keep_fat jnz stlnk3 ;Do nothing. push bx push ds push ax mov ax,fat_seg shl bx,1 ;FAT entries are words. jc stlnk4 ;Offset beyond the first 64k. stlnk1: mov ds,ax pop ax mov [bx],ax pop ds pop bx ret stlnk2: nop stlnk3: ret stlnk4: add ah,10h ;Next 64k segment. jmp stlnk1 store_link ENDP ; ;----------------------------------------------------------------- ; On entry: BX = cluster number (2 to nnn). ; On exit: AX = FAT entry for that cluster. Only AX is changed. ; get_link PROC NEAR push bx push ds mov ax,fat_seg shl bx,1 ;Scale by 2 for array of words. jc gtlnk2 ;Beyond the first 64k. Next segment. gtlnk1: mov ds,ax nop mov ax,[bx] pop ds pop bx ret gtlnk2: add ah,10h jmp gtlnk1 get_link ENDP ; ;---------------------------------------------------------------- ; On entry: BX = cluster number (2 to nnn). ; On exit: AX = FAT entry for that cluster. ; ; AX is changed. SI and ES are destroyed. ; get_link_fast PROC NEAR mov ax,fat_seg mov si,bx shl si,1 ;Scale by 2 for array of words. jc gtlf2 ;Beyond the first 64k. gtlf1: mov es,ax mov ax,es:[si] ret gtlf2: add ah,10h ;Next seg. jmp gtlf1 get_link_fast ENDP ; ;---------------------------------------------------------------- ; Make a new subdir entry in the root directory. ; On entry: BX = starting cluster #. ; On exit: If successful then CF=false, else CF=true (too many). ; All regs preserved. ; make_root_sub PROC NEAR push ax push cx push si push di push es call make_subdir_entry jc make_rs_exit ;Give up - more than 999 subdirs. mov subdir.start_cluster, bx mov es,dir_seg nop mov di,free_root_entry ;ES:DI = free root dir entry. lea si,subdir mov cx,32/2 cld rep movsw ;Write the new root entry. sub free_root_entries,1 jbe make_rs_done ;Full root, no end-of-dir mark needed. mov free_root_entry,di ;Update ptr. mov al,0 stosb ;New end-of-dir mark in root. make_rs_done: clc make_rs_exit: pop es pop di pop si pop cx pop ax ret make_root_sub ENDP ; ;----------------------------------------------------------------------- ; Build a new subdirectory entry at SUBDIR (new ext #). ; Subdirectory name will be "SUBDIR.n". ; It's up to somebody else to copy it somewhere useful. ; ; On entry: nothing ; On exit: If number of subdirs exceeds 999, CF=true. Else CF=false. ; ; No registers changed. ; make_subdir_entry PROC NEAR push ax push di mov ax,rootsub_count mov di,999 cmp di,ax ;More than 3 decimal digits? jb mksub_exit lea di,subdir.extension xchg di,red_pointer call pr_dec ;Write decimal string. mov red_pointer,di ;Shut off redirection of PRINTC. clc mksub_exit: pop di pop ax ret make_subdir_entry ENDP ;--------------------------------------------------------------------- ; CHECK VALIDITY OF A DIRECTORY ENTRY. ; ; On entry: ES:AX points at a possible directory entry. ; ; On exit: AH returns the status of the directory entry ; ; de_zeros All zeros (may be an unused dir entry). ; de_live A valid live entry (file or subdir). ; de_deleted Deleted entry (first byte of name = E5h). ; de_zapped Zapped valid entry (first byte = 00). ; de_sublink Entry "." or ".." (allowed only if input AX=0 or 32). ; de_zapsaved Zapped by CPS Format, 1st char saved in 'reserved' area. ; de_invalid Not valid (can't be a directory entry). ; ; Only combination of above bit flags used is DE_ZAPPED+DE_ZAPSAVED. ; ; If AH= 'de_invalid' then AL=??, ; else AH=status and AL= the file attribute byte. ; ; Only AX is changed. ; check_dir_entry PROC NEAR push bx push cx push si push di push ds push es ; push es pop ds ;DS=ES=yonder. cld mov bx,ax ;Offset of the entry to be examined. lea di,[bx] xor ax,ax ;AX = 0. This also inits AH= DE_XXX unknown. mov cx,32/2 repz scasw ;Entire entry is zeros? jnz chkd_res mov ah,de_zeros ;And AL=0. jmp chkd_exit chkd_res: lea di,[bx].dir_reserved mov cx,10 mov al,0 ;Reserved bytes should normally be zeros. repz scasb jz chkd1 ;They're all 0. Do normal processing (AH=0). push cs pop ds ;DS=CS for CMPSB. nop lea di,[bx].zapsav_loc+1 mov si,OFFSET zapsav_text mov cx,zapsav_length repe cmpsb ;Is it the special mark from CPS Formatter? jne chkd_invalid push es pop ds ;DS=ES=yonder, again. nop mov ah,de_zapsaved ;Change AH from 0 to DE_ZAPSAVED. ; chkd1: test [bx].file_attr, dir_attr jz chkd_file cmp byte ptr [bx], "." ;Special subdir linking entry? je chkd_dots chkd_file: ;Either file or normal subdir entry. lea si,[bx].filename+1 mov cx,8+3-1 ;Name + ext - 1. chkd_lp: ifdef DBCS ; ### if DBCS ### call dbcs_chk_file jnc @f ; if valid file name lea si,[bx].filename+2 ; try for 1st char is Double Byte mov cx,8+3-2 call dbcs_chk_file jc chkd_invalid ; if invalid @@: else ; ### if Not DBCS ### lodsb ;Fetch one char from filename. cmp al," " jb chkd_invalid ;Reject control chars in filename. call chk_fnchar loopne chkd_lp je chkd_invalid endif ; ### end if Not DBCS ### ; ; Seems OK, so far. Now we check the first char of the filename. ; mov al,[bx].filename cmp al,0 ;1st char could have special things. je chkd_zapped ifdef DBCS cmp al,05 jz chkd_lead ; if this is converted lead byte E5h endif cmp al," " jb chkd_invalid cmp al,0E5h je chkd_deleted ifdef DBCS call IsDBCSLeadByte jz chkd_lead ; if this is lead byte endif call chk_fnchar je chkd_invalid ;First char of filename is invalid. ifdef DBCS chkd_lead: endif or ah,de_live jmp short chkd_get_attr ; chkd_dots: test byte ptr [bx].file_attr, vol_attr OR sys_attr OR hide_attr jnz chkd_invalid mov al,[bx].filename+1 xor cx,cx ;". " allowed only at offset 0 (1st entry). cmp al," " je chkd_blanks ;Entry is ". " mov cl,32 ;Allowed offset of ".." in a directory. cmp al,"." jne chkd_invalid ;2nd char is neither "." nor " ". chkd_blanks: cmp bx,cx ;Sublink is in the allowed position? jne chkd_invalid or ah,de_sublink lea di,[bx].filename+2 mov al," " mov cx,8+3-2 repz scasb ;Remainder of subdir name is blanks? je chkd_get_attr ;Yes - correct. ; chkd_invalid: mov ah,de_invalid jmp short chkd_exit chkd_zapped: or ah,de_zapped jmp short chkd_get_attr chkd_deleted: or ah,de_deleted chkd_get_attr: test ah,de_zapsaved jz chkd_attr2 test ah,de_zapped ;Only allowed combo is DE_ZAPPED+DE_ZAPSAVED. jz chkd_invalid chkd_attr2: mov al,[bx].file_attr test al,vol_attr jnz chkd_exit ;Start_cluster of volume label is ignored. test ah, de_live OR de_sublink jz chkd_exit mov cx,[bx].start_cluster ;For some types, check this too. cmp cx,cs:cluster_cnt_plus_1 ja chkd_invalid ; chkd_exit: pop es pop ds pop di pop si pop cx pop bx ret check_dir_entry ENDP ifdef DBCS ;--------------------------------------------------------------------- ; ; *** Check if file name is valid (DBCS supported) *** ; ; input: DS:SI = string address ; CX = string length ; output: CF = 1 if invalid ; dbcs_chk_file proc near chkf_loop: lodsb call IsDBCSLeadByte jnz @f ; if not lead byte dec cx jz chkf_invalid ; if no tail byte lodsb ; get tail byte call IsDBCSTailByte jnz chkf_invalid ; if not tail byte jmp short chkf_next @@: cmp al," " jb chkf_invalid ; if control char call chk_fnchar jz chkf_invalid chkf_next: loop chkf_loop clc ; valid file name jmp short chkf_ret chkf_invalid: stc ; invalid file name chkf_ret: ret dbcs_chk_file endp endif ;------------------------------------------------------------------- ; Check if a character is legal for a filename (or extension). ; It is checked for lowercase, ascii>126 and against BAD_CHAR_LIST. ; ; On entry: AL= character under test. ; On exit: If char is allowed then ZF=false. ; If illegal then ZF=true. ; ; DI is destroyed. ; chk_fnchar PROC NEAR push cx push es push cs pop es cld cmp al,7Eh ja chkfnc_err cmp al,"a" jb chkfnc1 cmp al,"z" ;Lowercase letters are illegal. jb chkfnc_err chkfnc1: mov di,OFFSET bad_char_list mov cl,bad_char_length xor ch,ch repne scasb chkfnc_done: pop es pop cx ret chkfnc_err: cmp al,al ;Set ZF=true for a bad character. jmp chkfnc_done ; there =$ bad_char_list DB '."/\[]:|<>+=;,' bad_char_length =$-there ; chk_fnchar ENDP ;--------------------------------------------------------------------- ; On entry: CLUSTER_SEGment is assumed to contain a ; disk cluster for examination. ; ; On exit: AX returns a code (usually the suggested FAT entry) ; 0 = Not a valid subdirectory. ; FM_END = complete subdir in this cluster. ; FM_SUB_START = with "." & "..", but no 00 end-of-dir mark. ; FM_SUB_MID = partial: missing both ".." and end-mark. ; FM_SUB_TAIL = partial: no "..", but with end-mark. ; FM_SUB_NUL = complete, but without any live files. ; ; If fm_sub_start, _end or _nul is returned, the caller should examine ; the start_cluster values in the 1st and 2nd entries ("." & ".."). ; ; Only AX is changed. ; check_cluster PROC NEAR push bx push cx push dx push es mov es,cluster_seg xor bx,bx ;Begin at offset 0 in the cluster segment. xor dx,dx ;State flags. mov cx,dirs_per_cluster chcl_lp: mov ax,bx ;AX = offset into cluster_seg. call check_dir_entry test ah, de_invalid OR de_zapsaved jnz chcl_not_sub test al,vol_attr jnz chcl_not_sub ;Volume label not allowed in subdir. test dh, de_zeros OR de_zapped ;Already found one zero entry? jz chcl_next ;Not yet. test ah, de_zeros OR de_zapped ;Remainder should be 0, too. jz chcl_not_sub chcl_next: or dh,ah ;Accumulate status bits. add bx,32 loop chcl_lp test dh, de_sublink jz chcl_not_start ;No "." and ".." entries. mov ax,fm_sub_start test dh, de_zeros OR de_zapped ;Was end-of-dir mark (0) found? jz chcl_done ;No. May be only part of a subdir. mov ax,fm_sub_nul ;Assume null. test dh,de_live ;Any live entries? jz chcl_done ;None. Deleted or empty complete subdir. mov ax,fm_end ;Complete subdir in this cluster! jmp short chcl_done chcl_not_start: test dh,de_live ;Any live entries? jz chcl_not_sub ;None. We'll ignore it. mov ax,fm_sub_mid test dh, de_zeros OR de_zapped ;Was the end-of-dir mark (0) found? jz chcl_done ;No. mov ax,fm_sub_tail jmp short chcl_done chcl_not_sub: xor ax,ax chcl_done: pop es pop dx pop cx pop bx ret check_cluster ENDP ; ;-------------------------------------------------------------------- ; Convert a 12-bit FAT in memory to 16-bit FAT format. ; ; The FAT_segment must be large enough to hold the 16-bit version. ; fat12_expand PROC NEAR push ax push cx push si push di push es mov ax,cluster_cnt_plus_1 ;Also = the max cluster number. mov di,ax shl di,1 ;DI = 2 * max. mov si,ax shr si,1 add si,ax ;SI = 1.5 * max. mov es,fat_seg nop mov cl,4 test al,1 ;Even or odd? jz f12e_get2 f12e_lp: mov ax,es:[si] ;Loop begins with the odd # entry. dec si shr ax,cl ;CL=4. cmp ax,0FF6h ;4086. jb f12e_store1 mov ah,0FFh f12e_store1: mov es:[di],ax dec di dec di f12e_get2: mov ax,es:[si] ;Fetch the even entry. dec si dec si and ax,0FFFh cmp ax,0FF7h jb f12e_store2 mov ah,0FFh f12e_store2: mov es:[di],ax dec di dec di cmp si,di ;Done yet? jne f12e_lp pop es pop di pop si pop cx pop ax ret fat12_expand ENDP ;--------------------------------------------------------------- ; Convert the 16-bit FAT in memory to 12-bit format. ; ; fat16_compress PROC NEAR push ax push bx push cx push dx push si push di push es mov bx,cluster_cnt_plus_1 ; = max cluster number. inc bx ;Count = max +1. mov es,fat_seg cld xor si,si xor di,di mov cl,4 f16c_lp: mov ax,es:[si] and ax,0FFFh inc si inc si mov dx,es:[si] inc si inc si shl dx,cl ;CL=4. or ah,dl mov es:[di],ax inc di inc di mov es:[di],dh inc di sub bx,2 ja f16c_lp ; mov ax,fat_size mov bx,sector_size shr bx,1 mul bx ;# words in 12-bit FAT. mov cx,ax mov ax,di inc ax ;Round up. shr ax,1 ;Convert offset to word count. sub cx,ax ;Words beyond 12-bit format of FAT. jbe f16c_done xor ax,ax rep stosw ;Clear out the now unused part. f16c_done: pop es pop di pop si pop dx pop cx pop bx pop ax ret fat16_compress ENDP ; ;----------------------------------------------------------------- ; Scan the FAT (in forward direction) for a value. ; ; On entry: AX = FAT entry value to search for, ; DI = 1st cluster number to examine. ; ; On exit: If found then ZF=true and AX=cluster number. ; If not found then ZF=false and AX=? ; ; AX, SI & ES are changed. ; scan_fat PROC NEAR push bx push cx push dx mov bx,di ;Beginning cluster #. mov cx,cluster_cnt_plus_1 ;Also = max cluster #. sub cx,bx jb scanf_done ;Leave with ZF=false, AX unchanged. inc cx ;Count = 1 + max - beginning. mov dx,ax ;Save value to hunt for. dec bx ;Setup for pre-increment. scanf_lp: inc bx call get_link_fast cmp ax,dx loopne scanf_lp mov ax,bx ;Return cluster number (=? if ZF=false). scanf_done: pop dx pop cx pop bx ret scan_fat ENDP ; ;--------------------------------------------------------------- ; Scan the FAT (in backward direction) for a value. ; ; On entry: AX = FAT entry value to search for, ; DI = 1st cluster # to examine. ; ; On exit: If found then ZF=true and AX=cluster number. ; If not found then ZF=false and AX=? ; ; AX, SI & ES are always changed. ; scan_fat_r PROC NEAR push bx push cx push dx mov bx,di mov cx,di sub cx,2 jb scanfr_done inc cx inc bx ;Setup for pre-decrement. mov dx,ax ;Save desired value. scanfr_lp: dec bx call get_link_fast cmp ax,dx loopne scanfr_lp mov ax,bx ;Cluster #. scanfr_done: pop dx pop cx pop bx ret scan_fat_r ENDP ; ;----------------------------------------------------------------- ; Link up (in the FAT) the pieces of subdirs we've found. ; ; On entry: DS=CS. ; On exit: All FM_SUB_XXXs are gone from the FAT. ; Destroys AX,BX,CX,DX,SI,DI,ES. ; link_subs PROC NEAR ; ; Start by linking up the FAT sub_mids to the sub_starts as best we can. ; xor dx,dx ;Beginning of chain is undefined, at first. ls1_top: mov es,fat_seg cld mov bx,1 ;Init to 1 (pre-incremented to 2). mov cx,clusters ls1_lp: jcxz ls1_done ls1_scan: inc bx call get_link_fast cmp ax,fm_free loope ls1_scan je ls1_done ;Nothing more of interest. cmp ax,fm_sub_start je ls1_found_start cmp ax,fm_sub_mid jne ls1_lp or dx,dx ;Any chain-building in progress? jz ls1_lp ;No, don't yet know where a chain starts. mov ax,bx ;Cluster # of the sub_mid we've just found. mov bx,dx ;End of previous chain. call store_link ;Link previous chain to this sub_mid. mov dx,ax ;New end of the growing chain. mov bx,ax jmp ls1_lp ls1_found_start: mov ax,dx mov dx,bx or ax,ax ;Any previous chain? jz ls1_top ;No. Start over, with BX= start of 1st chain. jmp ls1_lp ;Yes, ls1_done: or dx,dx ;Did we find any 'sub_start's? jnz linksub2 ;Yes. mov dx,fm_free ;None, so replace all jmp short ls3_start ;FM_SUB_XX's with FM_FREE. ; ; Search for sub_tails and then link them to sub_mids or sub_starts. ; linksub2: mov bx,1 ;Init 2-1. mov cx,clusters ls2_lp: jcxz linksub3 ls2_scan: inc bx call get_link_fast cmp ax,fm_sub_tail loopne ls2_scan jne linksub3 ;Not found. Nothing more of interest. mov di,bx dec di ;The entry just before the sub_tail. mov ax,fm_sub_mid call scan_fat_r ;Hunt backwards for a sub_mid entry. je ls2_found ;Returns AX=cluster # where it was found. mov ax,fm_sub_start ;Try for a sub_start, too. call scan_fat_r je ls2_found mov di,bx inc di ;The entry just after the sub_tail. mov ax,fm_sub_mid call scan_fat ;Hunt forwards. je ls2_found mov ax,fm_sub_start call scan_fat je ls2_found mov ax,fm_free ;No place to link the sub_tail, so erase it. jmp short ls2_store ls2_found: ;AX= cluster of item found by SCAN_FAT. xchg ax,bx ;So AX=clu of sub_tail, BX=_start or _mid. call store_link ;Replace _start or _mid with ptr to sub_tail. mov bx,ax ;BX selects the TAIL entry. mov ax,fm_end ;End the chain. ls2_store: call store_link jmp ls2_lp ; ; Change every remaining FM_SUB_START or FM_SUB_MID into FM_END. ; (Note: at this point, there should be no remaining FM_SUB_TAILs) ; linksub3: mov dx,fm_end ; ; Special entry for deleting (DX will be FM_FREE). ; ls3_start: mov cx,clusters mov bx,1 ls3_lp: jcxz linksub4 ls3_scan: inc bx call get_link_fast cmp ax,fm_free loope ls3_scan je linksub4 cmp ax,fm_sub_start je ls3_change cmp ax,fm_sub_mid jne ls3_lp ls3_change: mov ax,dx ;DX is either FM_END or FM_FREE. call store_link jmp ls3_lp ; linksub4: push cs pop es ret link_subs ENDP ; ;------------------------------------------------------------------ ; Files we deleted in WALK2 were marked in the FAT as fm_file_del, ; instead of fm_free (this improves performance regarding ; fragmented files). This proc is provided to search the FAT ; and convert any fm_file_dels into fm_free. Also, during ; HUNT empty subdirs were marked fm_sub_nul to allow their ; possible recovery. Remaining fm_sub_nuls are now freed. ; ; On entry: nothing. ; On exit: AX,BX,CX,DI destroyed. ; fix_fm_dels PROC NEAR mov dx,fm_file_del fix_fd_top: mov di,2 fix_fd_lp: mov ax,dx call scan_fat jne fix_fd2 mov di,ax ;Update cluster # for next loop. mov bx,ax mov ax,fm_free call store_link jmp fix_fd_lp ;Look some more. fix_fd2: mov ax,fm_sub_nul xchg ax,dx cmp ax,dx ;1st or 2nd pass? jne fix_fd_top ;Do it a 2nd time, for FM_SUB_NULs. ret fix_fm_dels ENDP ; ;----------------------------------------------------------------- ; WALK THROUGH A DIRECTORY, GET THE NEXT ENTRY. ; ; On entry: TREE_LEVEL, TREE and PATH are assumed setup. ; ; On exit: If successful then CF=false and AX returns ; the same results as CHECK_DIR_ENTRY. ; Also, ES:DI points to the directory entry. ; ; But if a disk error occurs, then CF=true. ; ; Only AX,ES,DI are changed. ; dir_walk PROC NEAR push bx push cx push dx push si ; mov si,tree_level ;Inside this proc, SI= offset into TREE. mov di,tree [si].toffset cmp di,-1 ;Special value for beginning of new path? jne dw0 ;No. mov di,-32 ;So upcoming 'ADD DI,32' will yield 0. dw0: or si,si jnz dw_nonroot dw_root: mov es,dir_seg nop add di,32 mov ax,32 mul root_entries cmp di,ax jae dw_dir_end mov tree [si].toffset, di ;Update. cmp byte ptr es:[di],0 ;End-of-dir mark? jz dw_dir_end ;End of root. jmp short dw_examine dw_dir_end: mov ah,de_zeros ;Slightly fake # for 'no more entries'. xor al,al ;CF=0. jmp short dw_done dw_nonroot: mov es,cluster_seg nop add di,32 ;Next entry. mov ax,32 mul dirs_per_cluster ;# dir entries that fit in a cluster. cmp di,ax ;Are we still inside current cluster? jb dw_read ;Yes. mov bx,tree [si].tcluster ;Get current cluster number. call get_link ;Get FAT entry to find next cluster. cmp ax,fm_bad ;End of chain (any 'reserved' value)? jae dw_dir_end ;No more clusters for this subdir. mov tree [si].tcluster, ax ;Update. xor di,di ;Begin new cluster of this subdir. dw_read: mov tree [si].toffset, di ;Update. or si,si ;Level = root? jz dw_examine ;Root is always in memory. mov ax,tree [si].tcluster call read_sub_cluster ;Buffer management done internally. jnc dw_examine ;No error. dw_disk_err: stc jmp short dw_done ; dw_examine: cmp byte ptr es:[di],0 ;End of directory? jz dw_dir_end mov ax,di call check_dir_entry ;Entry at ES:AX. test ah,de_sublink jnz dw_sublink jmp short dw_done ;Return with ES:DI ptg at the file entry. ; dw_sublink: ;Dir entry was "." or "..". or si,si jz dw_invalid ;Sublinks musn't be in the root! mov dx, tree [si].tcluster cmp dx, tree [si].tcluster0 ;Sublinks OK only in 1st cluster. jne dw_invalid mov dx,es:[di].start_cluster ;Do a few checks on it. cmp byte ptr es:[di].filename+1, "." je dw_sublink2 cmp dx, tree [si].tcluster ;Should point at itself. jne dw_invalid jmp short dw_done ;Note CF=false. dw_invalid: mov ah,de_invalid xor al,al jmp short dw_done dw_sublink2: ;Dir entry was ".." mov bx,si sub bx,SIZE tree_struc cmp dx,tree [bx].tcluster0 ;Previous level. jne dw_invalid ;Back-link doesn't point at 'parent'. dw_done: pop si pop dx pop cx pop bx ret dir_walk ENDP ; ;-------------------------------------------------------------- ; ADD TO THE PATH (and update the level). ; ; On entry: ES:DI points at a subdirectory entry. ; On exit: If success then CF=false, TREE_LEVEL, TREE and PATH are ; updated and the new cluster is read into our cluster buffer. ; CHECK_CLUSTER is called, and AX returns it's result code. ; But if error then CF=true, AX=?. ; ; Only AX is changed. ; add_to_path PROC NEAR mov ax,di call check_dir_entry push bx push cx push dx push si push es ; * Note ES must be before DI (for seg:offset pair). push di ; * push bp mov bp,sp ;Now [BP+2]=stacked DI, [BP+4]=stacked ES. ; cmp ax,(256*de_live) + dir_attr jne adp_err_stp mov bx,tree_level add bx,SIZE tree_struc ;Advance pointer to next rec. cmp bx,(SIZE tree_struc) * tree_size jae adp_err_stp mov ax,es:[di].start_cluster mov tree [bx].tcluster, ax mov tree [bx].tcluster0, ax mov tree [bx].toffset, -1 ;Special value for new path. ; mov si,bx cmp bx,SIZE tree_struc ;First-level subdir? jbe adp1 ;Yes, looping tree can't occur yet. adp_circ_lp: sub si, SIZE tree_struc jbe adp1 ;Reached root level. Done checking. cmp ax, tree [si].tcluster0 ;This subdir occurs twice in the tree? je adp_err ;Yes! Invalid tree (circular). cmp ax, tree [si].tcluster jne adp_circ_lp adp_err_stp: jmp short adp_err ; adp1: lea di,path ;Next, we add to the text of the path. push cs pop es cld xor ax,ax mov cx,SIZE path repnz scasb ;Find the 1st zero (the end). jnz adp_err mov dx,bx ;Save new tree_level value into DX. lea bx,[di] mov byte ptr [bx-1],"\" ;Replace 0 with \. les di,dword ptr [bp+2] ;Recover ptr to dir entry. call copy_fname ;From subdir name at ES:DI to CS:BX. lea bx,[bx] ;Just to see it in debug. cmp path_guard,-1 ;Path has grown too long? je adp2 ;OK. mov byte ptr [bx-1],0 ;Reject addition to path. jmp short adp_err ; adp2: mov si,dx ;Fetch new tree_level into SI. mov bx,tree [si].tcluster call get_link cmp ax,fm_free ;Validate the FAT entry for this cluster. je adp_err ;Cluster is unallocated! cmp ax,fm_bad je adp_err ;Cluster is marked bad! mov ax,bx call read_sub_cluster jc adp_err call check_cluster cmp ax,fm_sub_start ;Fm_sub_start, _end or _sub_nul are expected. je adp3 cmp ax,fm_end je adp3 cmp ax,fm_sub_nul jne adp_err adp3: mov tree_level,si ;Update TREE_LEVEL (at last!). clc ;Success (CF=false). jmp short adp_exit adp_err: stc adp_exit: pop bp pop di pop es pop si pop dx pop cx pop bx ret add_to_path ENDP ; ;----------------------------------------------------------- ; Subtract the last subdir from path name ; (shorten the path) and back up tree level by 1. ; ; On entry: nothing. ; On exit: If new level = 0 then ZF=true, else ZF=false. ; ; All regs saved. ; sub_from_path PROC NEAR push ax push bx push cx push di push es ; push cs pop es cld mov bx,tree_level sub bx,SIZE tree_struc ja subp0 ;Not root. xor ax,ax xor bx,bx mov tree_level,ax ;0. Root. mov word ptr path,ax lea di,path mov cx,SIZE path rep stosb jmp short subp3 subp0: mov tree_level,bx lea di,path mov cx,SIZE path xor ax,ax repnz scasb ;Find final 0. mov ax,cx mov cx,SIZE path sub cx,ax ifdef DBCS ; ### if DBCS ### push si lea si,path xor ah,ah subp1: lea di,[di-1] mov al,[di] mov [di],ah call CheckDBCSTailByte jz subp1a ; if this is tail byte cmp al,'\' jz subp1b ; if '\' is found subp1a: loop subp1 ; do next subp1b: pop si else ; ### if Not DBCS ### mov al,"\" subp1: lea di,[di-1] cmp al,[di] ;"\" ? mov [di],ah ;Zero. loopne subp1 ;Continue until we replace a \. endif ; ### end if Not DBCS ### subp3: or bx,bx pop es pop di pop cx pop bx pop ax ret sub_from_path ENDP ; ;-------------------------------------------------------------------- ; Check the length of a file against the number ; of contiguous free clusters in the FAT. ; ; On entry: ES:DI points at a directory entry. ; ; On exit: If enough contiguous space is free then CF=false and ; AX = number of clusters which will be needed for the file. ; But if not, then CF=true and AX= max contiguous file size. ; ; Only AX is changed. ; check_contig_free PROC NEAR push bx push cx push dx push di mov ax,sector_size mul cluster_size mov cx,ax mov ax,es:[di].file_size mov dx,es:[di].file_size+2 mov bx,es:[di].start_cluster div cx ;File_size / (bytes/cluster) = # clusters. call roundup mov di,ax ;DI= desired # clusters. or di,di jz chfr_done ;Zero length file. mov cx,cluster_cnt_plus_1 ;Max cluster #. sub cx,bx ;Max # of FAT entries to examine. mov dx,1 ;Already know 1st one is allocated. cmp dx,di je chfr_enuf ;1-cluster file. Done. chfr_lp: inc bx call get_link cmp ax,fm_free ;Is this cluster free for use? jne chfr_not_free inc dx ;Found one more free cluster. cmp dx,di ;Enough? je chfr_enuf chfr_2: loop chfr_lp ;Loop until enough, or end of FAT. jmp short chfr_fail ;Never got enough. chfr_enuf: clc ;Success. jmp short chfr_done chfr_not_free: cmp ax,fm_bad ;Is the non-free cluster just a bad one? je chfr_2 ;Yes. Skip bad clu and keep looking. chfr_fail: stc chfr_done: mov ax,dx pop di pop dx pop cx pop bx ret check_contig_free ENDP ; ;----------------------------------------------------------------------- ; Complete a file's contiguous FAT chain. ; ; On entry: ES:DI points to the directory entry and ; CX= number of clusters (total) for the file. ; Note: this routine does not read the FAT links before ; overwriting them, so the caller must check beforehand. ; ; On exit: nothing. All regs preserved. ; complete_chain PROC NEAR jcxz compch_exit push ax push bx push cx push si push di mov si,es:[di].start_cluster mov di,si ;DI=entry to be written, SI=entry under test. cmp cx,1 je compch_end dec cx ;Decr count. Final one is special. compch_lp: inc si ;Next clu #. mov bx,si call get_link cmp ax,fm_bad ;Bad cluster? je compch_lp ;Skip it. Look at next one. mov bx,di mov ax,si ;Value stored = number of next free cluster. call store_link mov di,si loop compch_lp compch_end: mov bx,di mov ax,fm_end call store_link pop di pop si pop cx pop bx pop ax compch_exit: ret complete_chain ENDP ; ;-------------------------------------------------------------- ; Round up the 16-bit quotient after an unsigned division. ; ; On entry: AX,DX = result of DIV. ; On exit: if DX was non-zero, then AX is incremented. ; roundup PROC NEAR push cx xor cx,cx cmp cx,dx ;CF=true if 0 is below DX. adc ax,0 pop cx ret roundup ENDP ; ;------------------------------------------------------------------- ; Announce UnFormat name & version #. DX is destroyed. ; ;show_banner PROC NEAR ;M000 - function removed ;lea dx,banner ;call pr_text ; ret ;show_banner ENDP ; ;------------------------------------------------------------------- ; If the printing option was selected, announce that fact. ; DX is destroyed. ; display_print_opt PROC NEAR test print_flags, pf_allowed jz disp_p_o_end lea dx,msg_print ;"Output will be echoed to LPT1." call pr_text disp_p_o_end: ret display_print_opt ENDP HAVE_DISKETTE_INSERTED PROC NEAR CMP DOS_VER,0300H JB H_D_I_EXIT MOV BL,DRIVE INC BL MOV AX,4408H ;Check if removable. INT 21H or ax,ax ; CMP AX,0 JNE H_D_I_EXIT mov al,drive add al,"A" LEA DX,MSG_INSERT_DISK ;"Insert disk in drive @0a:" call display ; MOV AH,9 ; INT 21H H_D_I_RETRY: mov ax,0C00h int 21h MOV ah,01h ;Get one key via DOS. INT 21H CMP AL,13 ;Return key? JNE H_D_I_RETRY H_D_I_EXIT: RET HAVE_DISKETTE_INSERTED ENDP ; ;-------------------------------------------------------------------- ; On entry: DRIVE and DOS_VERSION are assumed valid. ; ; On exit: if it's a network drive then CF=true. Otherwise CF=false. ; ; Destroys AX,BX,CX,DX,SI,DI. ; check_network_drive PROC NEAR ; Added 05-01-89, GWD. push bp push ds push es cld cmp dos_ver,300h jb chknet_not_ibm xor ax,ax int 2Ah ;Is network installed? or ah,ah jz chknet_not_ibm ;No. mov bl,drive mov bh,0 inc bx mov ax,4409h ;Is this drive remote? int 21h jc chknet_not_ibm test dx,1000h jnz chknet_error ;It's remote. Can't touch it. mov al,drive add al,"A" mov net_string,al lea si,net_string clc mov ax,0300h int 2Ah ;Returns CF=true when INT25h is illegal. jmp short chknet_done chknet_not_ibm: ;Look for Novell Netware 286. mov cx,-1 clc mov ax,0DC00h ;'Request Novell connection #'. int 21h jc chknet_ok ;Novell is not there. cmp cx,-1 je chknet_ok mov si,-1 clc mov ax,0EF01h ;'Get Novell drive table'. int 21h ;Returns ES:SI = pointer to table. jc chknet_ok cmp si,-1 je chknet_ok mov bl,drive mov bh,0 test byte ptr es:[bx+si],80h ;Is it a local drive? jz chknet_error ;No - cannot process it. chknet_ok: clc jmp short chknet_done chknet_error: stc chknet_done: pop es pop ds pop bp cld sti ret check_network_drive ENDP ; net_string DB "x:\",0 ; ; ifdef DBCS ; ### if DBCS ### ;-------------------------------------------------------------------- ; ; Test if the character is DBCS Lead Byte ; ; input: AL = character to check ; outpit: ZF = 1 if DBCS Lead Byte ; DBCSLeadByteTable dd 0 IsDBCSLeadByte proc near push ax push si push ds lds si,cs:DBCSLeadByteTable cmp word ptr cs:DBCSLeadByteTable+2,0 jnz idlb_check ; if table is already set push ax mov ax,6300h int 21h ; get DBCS lead byte table pop ax mov word ptr cs:DBCSLeadByteTable,si mov word ptr cs:DBCSLeadByteTable+2,ds idlb_check: cmp word ptr [si],0 jz idlb_not ; if end of table cmp al,[si] jb idlb_next ; if below low value cmp al,[si+1] jbe idlb_yes ; if below high value idlb_next: add si,2 ; do next jmp short idlb_check idlb_not: or al,1 ; reset ZF jmp short idlb_end idlb_yes: and al,0 ; set ZF idlb_end: pop ds pop si pop ax ret IsDBCSLeadByte endp ; ; Test if the character is DBCS Tail Byte ; ; input: AL = character to check ; outpit: ZF = 1 if DBCS Tail Byte ; IsDBCSTailByte proc near push ax push si lea si,tail_byte_table idtb_check: cmp word ptr cs:[si],0 jz idtb_not ; if end of table cmp al,cs:[si] jb idtb_next ; if below low value cmp al,cs:[si+1] jbe idtb_yes ; if below high value idtb_next: add si,2 ; do next jmp short idtb_check idtb_not: or al,1 ; reset ZF jmp short idtb_end idtb_yes: and al,0 ; set ZF idtb_end: pop si pop ax ret IsDBCSTailByte endp tail_byte_table label byte ifdef JAPAN db 40h,7eh db 80h,0fch dw 0 endif ifdef TAIWAN db 40h,7eh db 0a1h,0feh dw 0 endif ifdef KOREA db 0a1h,0abh db 0b0h,0c8h db 0cah,0fdh dw 0 endif ; ; Check if the character position is at Tail Byte of DBCS ; ; input: ds:si = start address of the string ; ds:di = character position to check ; output: ZF = 1 if at Tail Byte ; CheckDBCSTailByte proc near push ax push cx push di mov cx,di ; save character position cdtb_check: cmp di,si jz cdtb_next ; if at the top dec di ; go back mov al,[di] ; get character call IsDBCSLeadByte jz cdtb_check ; if DBCS lead byte do next inc di ; adjust cdtb_next: sub cx,di ; if the length is odd then xor cl,1 ; the character position is test cl,1 ; at the tail byte pop di pop cx pop ax ret CheckDBCSTailByte endp endif ; ### end if DBCS ### ;-------------------------------------------------------------------- ; Table of possible command line parms/options. ; Note: for parsing to work properly with similar keywords ; like "/LIST" and "/L", the longer one must be first ; in the list. ; option_table LABEL byte opt_def <options, opt_wrfake, action_switch, 5, "/TEST"> opt_def <options, opt_partn, action_switch, 6, "/PARTN"> opt_def <options, opt_j, action_switch, 2, "/J"> opt_def <options, opt_u, action_switch, 2, "/U"> opt_def <print_flags, pf_allowed, action_switch, 2, "/P"> opt_def <options, opt_list, action_switch, 2, "/L"> ;opt_def <options, opt_keep_fat+opt_k+opt_f, action_switch, 3, "/KF"> ;opt_def <options, opt_keep_root+opt_k+opt_r, action_switch, 3, "/KR"> ;opt_def <options, opt_erase_fat+opt_f, action_switch, 3, "/EF"> ;opt_def <options, opt_erase_root+opt_r, action_switch, 3, "/ER"> opt_def <0,0,0> ; ;------------------------------------------------------------------------ int25_error_list LABEL byte i25_error_struc <0, msg_i25_wrprot> i25_error_struc <1, msg_i25_unit> i25_error_struc <2, msg_i25_not_ready> i25_error_struc <3, msg_i25_bad_cmd> i25_error_struc <4, msg_i25_crc> i25_error_struc <5, msg_i25_req> i25_error_struc <6, msg_i25_seek> i25_error_struc <7, msg_i25_media> i25_error_struc <8, msg_i25_rnf> i25_error_struc <9, msg_i25_paper> i25_error_struc <0Ah, msg_i25_readf> i25_error_struc <0Bh, msg_i25_writef> i25_error_struc <0Ch, msg_i25_general> i25_error_struc <-1> ;End of list. ; ;------------------------------------------------------------------------ EVEN ;Make sure it does NOT align, in the program file. there =$ zapsav_text DB "zSav",0 ;This is the special mark for dir entries zapsav_length =$-there ;zapped by the CPS Formatter. ; subdir dir_str <"SUBDIR "," ",dir_attr> ;Template for dir entries. ; prog ENDS END  
antlr/SBHasm.g4
Blanvillain/7billionhumans
0
1451
grammar SBHasm; // PARSER asm : line+ ; line : (cmd|comment|label|sbhcomment|sbhcommentd)? (EOL) ; cmd : JUMP | step | pickup | cond | write | drop | calc | setval | take | give | nearest | END | pickup | listen | tell | foreachdir; pickup : PICKUP (direction | mem)? ; step : STEP (directions | mem) ; directions : direction (COMMA directions)? ; label : LABEL; cond : IF expressions COLON EOL line+ (sonst EOL line+)? ENDIF ; expressions : expression ((AND | OR) EOL expression)* ; expression : (direction | items | number) COMPARE (direction | items | number) ; comment : COMMENT; items : (item | mem | MYITEM | NOTHING) ; item : ITEM ; write : WRITE (number | direction | mem) ; calc : mem EQUAL CALC (direction | mem | MYITEM | number) calcop (direction | mem | MYITEM | number); setval : mem EQUAL SET (direction | mem | MYITEM | number | NOTHING) ; take : TAKE (direction | mem) ; give : GIVE (direction | mem) ; nearest : mem EQUAL NEAREST item ; drop : DROP ; sonst : ELSE ; sbhcomment : GAMECOMMENT number; sbhcommentd : GAMECOMMENTDEF number; listen : LISTEN message ; tell : TELL (everyone | direction) message ; direction : DIRECTION ; mem : MEM ; number : NUMBER ; calcop : CALC_OP ; message : MESSAGE ; everyone : EVERYONE ; foreachdir : mem EQUAL FOREACHDIR directions COLON EOL line+ ENDFOR; // LEXER COMMENT : '--' ~ [\r\n]* -> channel(HIDDEN) ; WHITESPACE : [ \t] -> channel(HIDDEN) ; JUMP : 'jump ' [a-z] ; STEP : 'step' ; PICKUP : 'pickup' ; IF : 'if' ; ELSE : 'else:' ; ENDIF : 'endif' ; DROP : 'drop' ; WRITE : 'write' ; CALC : 'calc' ; SET : 'set' ; TAKE : 'takefrom' ; GIVE : 'giveto' ; NEAREST : 'nearest' ; MYITEM : 'myitem' ; END : 'end' ; NOTHING : 'nothing' ; ITEM : 'printer' | 'datacube' | 'hole' | 'worker' | 'shredder' | 'wall' | 'button'; MEM : 'mem'[1-4] ; COMPARE : '==' | '<' | '>' | '!=' | '>=' | '<='; CALC_OP : '+' | '-' | '/' | 'x' ; NUMBER : [0-9]+ ; DIRECTION : 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'nw' | 'c' | 'w' ; LABEL : [a-z]{self.column < 5}?':' ; EOL : [\r\n]+ ; COLON : ':' ; COMMA : ',' ; EQUAL : '=' ; AND : 'and' ; OR : 'or' ; LISTEN : 'listenfor' ; TELL : 'tell' ; EVERYONE : 'everyone' ; MESSAGE : 'ready' | 'ok' | 'hi' | 'go' | 'coffeetime' | 'ugh' | 'morning' ; FOREACHDIR : 'foreachdir' ; ENDFOR : 'endfor' ; GAMECOMMENT : 'comment'; GAMECOMMENTDEF : 'DEFINE COMMENT' ;
mc-sema/validator/x86/tests/ROR16rCL.asm
randolphwong/mcsema
2
177698
BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_OF ;TEST_FILE_META_END ; ROR16rCL mov bx, 0x414 mov cl, 0x3 ;TEST_BEGIN_RECORDING ror bx, cl ;TEST_END_RECORDING
source/kernel.ads
bracke/Meaning
1
14560
<filename>source/kernel.ads -------------------------------------------------------------------------------- -- -- -- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU Lesser General Public -- -- License as published by the Free Software Foundation; either -- -- version 2.1 of the License, or (at your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- Lesser General Public License for more details. -- -- -- -- You should have received a copy of the GNU Lesser General Public -- -- License along with this library; if not, write to the Free Software -- -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- -------------------------------------------------------------------------------- -- @brief Interface to host RISC OS -- $Author$ -- $Date$ -- $Revision$ -- -------------------------------------------------------------------------- -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT -- WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -- TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -- PARTICULAR PURPOSE. The user assumes the entire risk as to the accuracy -- and the use of this file. -- -- Ada version Copyright (c) P.J.Burwood, 1996 -- Royalty-free, unlimited, worldwide, non-exclusive use, modification, -- reproduction and further distribution of this Ada file is permitted. -- -- C version contains additional copyrights, see below -- -------------------------------------------------------------------------- with Interfaces.C; with System; package Kernel is subtype void is System.Address; subtype void_ptr is System.Address; subtype void_ptr_ptr is System.Address; -- -- kernel.h:18 -- type vector_of_c_signed_int is array (integer range <>) of Interfaces.C.int; -- -- only r0 - r9 matter for swi's -- kernel.h:19 -- type SWI_Regs is record R : vector_of_c_signed_int (0 .. 9); end record; pragma Convention (C, SWI_Regs); -- -- error number -- error message (zero terminated) -- kernel.h:36 -- type oserror is record ErrNum : Interfaces.C.int; ErrMess : Interfaces.C.char_array (0 .. 251); end record; pragma Convention (C, oserror); type oserror_access is access all oserror; -- kernel.h:83 kernel_NONX : constant Interfaces.C.unsigned := 16#80000000#; -- -- Generic SWI interface. Returns NULL if there was no error. -- The SWI called normally has the X bit set. To call a non-X bit set SWI, -- kernel_NONX must be orred into no (in which case, if an error occurs, -- swi does not return). -- function swi (no : Interfaces.C.unsigned; r_in : access SWI_Regs; r_out : access SWI_Regs) return oserror_access; procedure swi (no : Interfaces.C.unsigned; r_in : access SWI_Regs; r_out : access SWI_Regs); -- -- As swi, but for use with SWIs which return status in the C flag. -- The int to which carry points is set -- to reflect the state of the C flag on -- exit from the SWI. -- function swi_c (no : Interfaces.C.unsigned; r_in : access SWI_Regs; r_out : access SWI_Regs; carry : access Interfaces.C.int) return oserror_access; procedure swi_c (no : Interfaces.C.unsigned; r_in : access SWI_Regs; r_out : access SWI_Regs; carry : access Interfaces.C.int); -- -- Returns a pointer to an error block describing the last os error since -- last_oserror was last called (or since the program started if there has -- been no such call). If there has been no os error, returns a null -- pointer. Note that occurrence of a further error may overwrite the -- contents of the block. -- If swi caused the last os error, the error already returned by that call -- gets returned by this too. -- function last_oserror return oserror_access; -- kernel.h:199 private -- kernel.h:84 pragma Import (C, swi, "_kernel_swi"); -- kernel.h:93 pragma Import (C, swi_c, "_kernel_swi_c"); -- kernel.h:199 pragma Import (C, last_oserror, "_kernel_last_oserror"); -- -- Interface to host OS. -- Copyright (C) Acorn Computers Ltd., 1990 -- end Kernel;
Univalence/OldUnivalence/SimpleHoTT.agda
JacquesCarette/pi-dual
14
9551
<filename>Univalence/OldUnivalence/SimpleHoTT.agda {-# OPTIONS --without-K #-} module SimpleHoTT where open import Data.Empty open import Data.Sum renaming (map to _⊎→_) open import Function renaming (_∘_ to _○_) infixr 8 _∘_ -- path composition infix 4 _≡_ -- propositional equality infix 2 _∎ -- equational reasoning for paths infixr 2 _≡⟨_⟩_ -- equational reasoning for paths ------------------------------------------------------------------------------ -- Equivalences a la HoTT (using HoTT paths and path induction) -- Our own version of refl that makes 'a' explicit data _≡_ {ℓ} {A : Set ℓ} : (a b : A) → Set ℓ where refl : (a : A) → (a ≡ a) -- not sure where else to put this [Z] hetType : {A B : Set} → (a : A) → A ≡ B → B hetType a (refl _) = a -- J pathInd : ∀ {u ℓ} → {A : Set u} → (C : {x y : A} → x ≡ y → Set ℓ) → (c : (x : A) → C (refl x)) → ({x y : A} (p : x ≡ y) → C p) pathInd C c (refl x) = c x basedPathInd : {A : Set} → (a : A) → (C : (x : A) → (a ≡ x) → Set) → C a (refl a) → ((x : A) (p : a ≡ x) → C x p) basedPathInd a C c .a (refl .a) = c ! : ∀ {u} → {A : Set u} {x y : A} → (x ≡ y) → (y ≡ x) ! = pathInd (λ {x} {y} _ → y ≡ x) refl _∘_ : ∀ {u} → {A : Set u} → {x y z : A} → (x ≡ y) → (y ≡ z) → (x ≡ z) _∘_ {u} {A} {x} {y} {z} p q = pathInd {u} (λ {x} {y} p → ((z : A) → (q : y ≡ z) → (x ≡ z))) (λ x z q → pathInd (λ {x} {z} _ → x ≡ z) refl {x} {z} q) {x} {y} p z q -- p = p . refl unitTransR : {A : Set} {x y : A} → (p : x ≡ y) → (p ≡ p ∘ refl y) unitTransR {A} {x} {y} p = pathInd (λ {x} {y} p → p ≡ p ∘ (refl y)) (λ x → refl (refl x)) {x} {y} p -- p = refl . p unitTransL : {A : Set} {x y : A} → (p : x ≡ y) → (p ≡ refl x ∘ p) unitTransL {A} {x} {y} p = pathInd (λ {x} {y} p → p ≡ (refl x) ∘ p) (λ x → refl (refl x)) {x} {y} p ap : ∀ {ℓ ℓ'} → {A : Set ℓ} {B : Set ℓ'} {x y : A} → (f : A → B) → (x ≡ y) → (f x ≡ f y) ap {ℓ} {ℓ'} {A} {B} {x} {y} f p = pathInd -- on p (λ {x} {y} p → f x ≡ f y) (λ x → refl (f x)) {x} {y} p ap2 : ∀ {ℓ ℓ' ℓ''} → {A : Set ℓ} {B : Set ℓ'} {C : Set ℓ''} {x₁ y₁ : A} {x₂ y₂ : B} → (f : A → B → C) → (x₁ ≡ y₁) → (x₂ ≡ y₂) → (f x₁ x₂ ≡ f y₁ y₂) ap2 {ℓ} {ℓ'} {ℓ''} {A} {B} {C} {x₁} {y₁} {x₂} {y₂} f p₁ p₂ = pathInd -- on p₁ (λ {x₁} {y₁} p₁ → f x₁ x₂ ≡ f y₁ y₂) (λ x → pathInd -- on p₂ (λ {x₂} {y₂} p₂ → f x x₂ ≡ f x y₂) (λ y → refl (f x y)) {x₂} {y₂} p₂) {x₁} {y₁} p₁ -- Abbreviations for path compositions _≡⟨_⟩_ : ∀ {u} → {A : Set u} (x : A) {y z : A} → (x ≡ y) → (y ≡ z) → (x ≡ z) _ ≡⟨ p ⟩ q = p ∘ q bydef : ∀ {u} → {A : Set u} {x : A} → (x ≡ x) bydef {u} {A} {x} = refl x _∎ : ∀ {u} → {A : Set u} (x : A) → x ≡ x _∎ x = refl x -- Transport; Lifting transport : ∀ {ℓ ℓ'} → {A : Set ℓ} {x y : A} → (P : A → Set ℓ') → (p : x ≡ y) → P x → P y transport {ℓ} {ℓ'} {A} {x} {y} P p = pathInd -- on p (λ {x} {y} p → (P x → P y)) (λ _ → id) {x} {y} p -- Lemma 2.3.10 transport-f : ∀ {ℓ ℓ' ℓ''} → {A : Set ℓ} {B : Set ℓ'} {x y : A} → (f : A → B) → (P : B → Set ℓ'') → (p : x ≡ y) → (u : P (f x)) → transport (P ○ f) p u ≡ transport P (ap f p) u transport-f {ℓ} {ℓ'} {ℓ''} {A} {B} {x} {y} f P p u = pathInd -- on p (λ {x} {y} p → (u : P (f x)) → transport (P ○ f) p u ≡ transport P (ap f p) u) (λ x u → refl u) {x} {y} p u -- Lemma 2.11.2 transportIdR : {A : Set} {a y z : A} → (p : y ≡ z) → (q : a ≡ y) → transport (λ x → a ≡ x) p q ≡ q ∘ p transportIdR {A} {a} {y} {z} p q = pathInd (λ {y} {z} p → (q : a ≡ y) → transport (λ x → a ≡ x) p q ≡ q ∘ p) (λ y q → transport (λ x → a ≡ x) (refl y) q ≡⟨ bydef ⟩ q ≡⟨ unitTransR q ⟩ q ∘ refl y ∎) {y} {z} p q transportIdL : {A : Set} {a y z : A} → (p : y ≡ z) → (q : y ≡ a) → transport (λ x → x ≡ a) p q ≡ ! p ∘ q transportIdL {A} {a} {y} {z} p q = pathInd (λ {y} {z} p → (q : y ≡ a) → transport (λ x → x ≡ a) p q ≡ ! p ∘ q) (λ y q → transport (λ x → x ≡ a) (refl y) q ≡⟨ bydef ⟩ q ≡⟨ unitTransL q ⟩ ! (refl y) ∘ q ∎) {y} {z} p q transportIdRefl : {A : Set} {y z : A} → (p : y ≡ z) → (q : y ≡ y) → transport (λ x → x ≡ x) p q ≡ ! p ∘ q ∘ p transportIdRefl {A} {y} {z} p q = pathInd (λ {y} {z} p → (q : y ≡ y) → transport (λ x → x ≡ x) p q ≡ ! p ∘ q ∘ p) (λ y q → transport (λ x → x ≡ x) (refl y) q ≡⟨ bydef ⟩ q ≡⟨ unitTransR q ⟩ q ∘ refl y ≡⟨ unitTransL (q ∘ refl y) ⟩ ! (refl y) ∘ q ∘ refl y ∎) {y} {z} p q -- tools for coproducts (Sec. 2.12) indCP : {A B : Set} → (C : A ⊎ B → Set) → ((a : A) → C (inj₁ a)) → ((b : B) → C (inj₂ b)) → ((x : A ⊎ B) → C x) indCP C f g (inj₁ a) = f a indCP C f g (inj₂ b) = g b code : {A B : Set} → (a₀ : A) → A ⊎ B → Set code a₀ (inj₁ a) = a₀ ≡ a code a₀ (inj₂ b) = ⊥ encode : {A B : Set} → (a₀ : A) → (x : A ⊎ B) → (p : inj₁ a₀ ≡ x) → code a₀ x encode {A} {B} a₀ x p = transport (code a₀) p (refl a₀) decode : {A B : Set} → (a₀ : A) → (x : A ⊎ B) → (c : code a₀ x) → inj₁ a₀ ≡ x decode a₀ (inj₁ a) c = ap inj₁ c decode a₀ (inj₂ b) ()
programs/oeis/152/A152948.asm
jmorken/loda
1
96804
; A152948: a(n) = (n^2 - 3*n + 6)/2. ; 2,2,3,5,8,12,17,23,30,38,47,57,68,80,93,107,122,138,155,173,192,212,233,255,278,302,327,353,380,408,437,467,498,530,563,597,632,668,705,743,782,822,863,905,948,992,1037,1083,1130,1178,1227,1277,1328,1380,1433,1487,1542,1598,1655,1713,1772,1832,1893,1955,2018,2082,2147,2213,2280,2348,2417,2487,2558,2630,2703,2777,2852,2928,3005,3083,3162,3242,3323,3405,3488,3572,3657,3743,3830,3918,4007,4097,4188,4280,4373,4467,4562,4658,4755,4853,4952,5052,5153,5255,5358,5462,5567,5673,5780,5888,5997,6107,6218,6330,6443,6557,6672,6788,6905,7023,7142,7262,7383,7505,7628,7752,7877,8003,8130,8258,8387,8517,8648,8780,8913,9047,9182,9318,9455,9593,9732,9872,10013,10155,10298,10442,10587,10733,10880,11028,11177,11327,11478,11630,11783,11937,12092,12248,12405,12563,12722,12882,13043,13205,13368,13532,13697,13863,14030,14198,14367,14537,14708,14880,15053,15227,15402,15578,15755,15933,16112,16292,16473,16655,16838,17022,17207,17393,17580,17768,17957,18147,18338,18530,18723,18917,19112,19308,19505,19703,19902,20102,20303,20505,20708,20912,21117,21323,21530,21738,21947,22157,22368,22580,22793,23007,23222,23438,23655,23873,24092,24312,24533,24755,24978,25202,25427,25653,25880,26108,26337,26567,26798,27030,27263,27497,27732,27968,28205,28443,28682,28922,29163,29405,29648,29892,30137,30383,30630,30878 bin $0,2 mov $1,$0 add $1,2
LM/Aula2/return0_pr/return0.asm
Kw-Vinicius/Linguagem-de-Montagem-
0
80231
<reponame>Kw-Vinicius/Linguagem-de-Montagem- ;########################################### ; Primeiro Exemplo Return ;######################################### ; ; assembler: nasm -f elf -o <program>.o <program>.asm ; linker: ld -m elf_i386 -s -o <program> <program>.o SECTION .text ;seção de códigos global _start ;Ponto de Entrada para o programa _start: ;Final de Qualquer Programa em Assembly ;ebx carrega o número para o S.O e eax em 1 diz que o ebx pode sair para o kernel mov ebx,15 mov eax,1 ;comando de saida para o kernel int 0x80 ;interrupção 80 hex, chamada ao kernel
commands/communication/duckduckgo-email-protection/configure-@duck.com-script-command.applescript
rashed-imam/script-commands
1
2256
#!/usr/bin/osascript # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Configure # @raycast.mode compact # Optional parameters: # @raycast.icon images/duckduckgo_logo.png # @raycast.argument1 { "type": "text", "placeholder": "@duck.com authorizationID" } # @raycast.packageName DuckDuckGo Email Protection # Documentation: # @raycast.description Use this script command to configure your @duck.com authorizationID # @raycast.author Rediwed # @raycast.authorURL github.com/Rediwed on run argv set prefix to do shell script "curl -X POST https://quack.duckduckgo.com/api/email/addresses --header 'Authorization: Bearer " & (item 1 of argv) & "'" if text 3 through 9 of prefix is "address" then setAuthorizationID(item 1 of argv) else tell me to error "Could not configure authorizationID. Duck.com API result: " & prefix end if end run on setAuthorizationID(authorizationID) try return do shell script "defaults write com.dpe.ddgEmailProtection AuthorizationID " & authorizationID on error tell me to error "Authorization ID not set, please run configure script command" end try end setAuthorizationID
agda/BBHeap/Order/Properties.agda
bgbianchi/sorting
6
2756
module BBHeap.Order.Properties {A : Set}(_≤_ : A → A → Set) where open import BBHeap _≤_ open import BBHeap.Order _≤_ renaming (Acc to Accₕ ; acc to accₕ) open import Data.Nat open import Induction.Nat open import Induction.WellFounded ii-acc : ∀ {b} {h} → Acc _<′_ (# {b} h) → Accₕ h ii-acc (acc rs) = accₕ (λ h' #h'<′#h → ii-acc (rs (# h') #h'<′#h)) ≺-wf : ∀ {b} h → Accₕ {b} h ≺-wf = λ h → ii-acc (<-well-founded (# h))
3-mid/physics/implement/c_math/source/thin/c_math_c-pointers.ads
charlie5/lace
20
15049
<filename>3-mid/physics/implement/c_math/source/thin/c_math_c-pointers.ads<gh_stars>10-100 -- This file is generated by SWIG. Please do *not* modify by hand. -- with Interfaces.C; package c_math_c.Pointers is -- Real_Pointer -- type Real_Pointer is access all c_math_c.Real; -- Real_Pointers -- type Real_Pointers is array (Interfaces.C .size_t range <>) of aliased c_math_c.Pointers.Real_Pointer; -- Index_Pointer -- type Index_Pointer is access all c_math_c.Index; -- Index_Pointers -- type Index_Pointers is array (Interfaces.C .size_t range <>) of aliased c_math_c.Pointers.Index_Pointer; end c_math_c.Pointers;
libsrc/_DEVELOPMENT/font/fzx/fonts/dkud3/Pearl/_ff_dkud3_Pearl.asm
jpoikela/z88dk
640
100434
SECTION rodata_font SECTION rodata_font_fzx PUBLIC _ff_dkud3_Pearl _ff_dkud3_Pearl: BINARY "font/fzx/fonts/dkud3/Pearl/pearl2.fzx"
asm_main.asm
CISVVC/cis208-chapter05-arrays-JoseC1
0
174082
<reponame>CISVVC/cis208-chapter05-arrays-JoseC1 %include "asm_io.inc" ;These Macros Control the Size of the array and The scalar it is being multiplied by %define ARRAY_SIZE DWORD 5 %define SCALAR 5 ; initialized data is put in the .data segment segment .data syswrite: equ 4 stdout: equ 1 exit: equ 1 SUCCESS: equ 0 kernelcall: equ 80h ;Defining an array of 5 16 bit elements predefined to 1,2,3,4,5 a1: dw 1,2,3,4,5 ; uninitialized data is put in the .bss segment segment .bss ; code is put in the .text segment segment .text extern printf ;Need access to the printf function to display array global asm_main asm_main: enter 0,0 ; setup routine pusha mov eax, a1 ;Moving the address of a1 array into eax ;void print_array(int a[], int size); ;Calling my print_array function to display how the array originally looks push ARRAY_SIZE ;passing in the size to function push eax ;Passing in the address of the first element of the array into function call print_array add esp,8 ; Deallocating parameter memory call print_nl ;Print a newline ;void mult_array(int a[], int size, int scalar) push SCALAR ;Passing the scalar to multiply array by to function push ARRAY_SIZE ;Passing the size to function push eax ;Passing in the address of the first element of the array into funciton call mult_array add esp, 12 ;Deallocating parameter memory ;void print_array(int a[], int size); ;Trying to see how array looks after WE Multiply it by Scalar push ARRAY_SIZE ;passing in the size to function push eax ;Passing in the address of the first element of the array into function call print_array add esp,8 ; Deallocating parameter memory call print_nl ;Print a newline popa mov eax, SUCCESS ; return back to the C program leave ret ;void mult_array(int a[], int size, int scalar) ;STACK ; Address of Array = ebp +8 ; Size of array = ebp +12 ; Sclar to multiply array by = ebp + 16 mult_array: enter 0,0 ;Creating stack frame pusha ;Pushing all registers XOR ecx, ecx ;Ecx = i = 0 XOR eax, eax ; eax = a[i] * scalar mov ebx, DWORD[ebp+8] ; Moving the address of the array into ebx .for: cmp ecx, DWORD[ebp+12] jge .done ;If i >= size of array we are done mov ax, word[ebx + 2 * ecx] ; ax = a[i] mul word[ebp+16] ; ax = a[i] *scalar mov word[ebx+2 *ecx], ax ; a[i] = ax inc ecx ;i++ jmp short .for ;Go back to for loop .done: popa leave ret ;Returning back ;void print_array(int a[], int size); ;STACK ; int size = ebp +12 ; Array Address = ebp + 8 ; Return Address = ebp +4 print_array: enter 0,0 ;Creating stack frame pusha ;pushing all registers mov ecx, DWORD[ebp+12] ;ecx = Array_size XOR eax, eax ;Eax = 0 Going to use later mov ebx, [ebp+8] ;Ebx = The address of the first element of array mov edx, 0 ; Edx = offset for: mov ax, WORD[ebx + 2 * edx] ; Moving the element value into a 16 bit register movzx eax, ax ; Extending the answer in ax into a DWORD push eax;Pushing the elements of array on stack call print_int ; Printing the array element add esp, 4 ;Deallocating memory inc edx ;Going to the next Array element offset++ loop for; Stop the loop once ecx = 0 popa leave ;Destroying Stack frame ret ;Return back
alloy4fun_models/trashltl/models/7/6Wzq8f6LP5g32D3LD.als
Kaixi26/org.alloytools.alloy
0
4746
<filename>alloy4fun_models/trashltl/models/7/6Wzq8f6LP5g32D3LD.als open main pred id6Wzq8f6LP5g32D3LD_prop8 { eventually (File.link in Trash) } pred __repair { id6Wzq8f6LP5g32D3LD_prop8 } check __repair { id6Wzq8f6LP5g32D3LD_prop8 <=> prop8o }
problemas de boletines/Problema 22.asm
ubidragon/AVR-US
0
15489
<reponame>ubidragon/AVR-US ; Problema 22 ; Se conecta un pulsador al pin 6 del puerto B. ; Hacer un programa para el AVR que establezca el pin 6 del ; puerto B como entrada. Que active la resistencia de “pull-up” ; de ese pin y que cuente en un registro R20 cuántas veces ; se ha pulsado dicho pulsador. IMPORTANTE: Si el pulsador ; sigue pulsado sólo debe contar una vez. CBI DDRB,6 SBI PORTB,6 ;PINB6 CONFIGURADO COMO ENTRADA ;Y RESISTENCIA DE PULL UP ACTIVADA CLR R20 BUCLE: SBIS PINB,6 RJMP BUCLE BUCLE2: SBIC PINB,6 RJMP BUCLE2 INC R20 RJMP BUCLE
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_73.asm
ljhsiun2/medusa
9
167119
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xfdc6, %r13 nop nop nop nop nop dec %r8 mov $0x6162636465666768, %rdi movq %rdi, (%r13) nop nop nop xor $7382, %r12 lea addresses_UC_ht+0x18b57, %r13 cmp %rdx, %rdx movw $0x6162, (%r13) nop nop nop add %r13, %r13 lea addresses_WC_ht+0x11974, %rsi lea addresses_WT_ht+0x79e, %rdi nop inc %r9 mov $113, %rcx rep movsq nop nop nop nop cmp %r8, %r8 lea addresses_D_ht+0x1d75e, %rdi add $44969, %r12 vmovups (%rdi), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %r13 nop dec %r8 lea addresses_normal_ht+0x906e, %r8 nop nop lfence mov $0x6162636465666768, %rcx movq %rcx, (%r8) nop nop nop nop nop sub $28733, %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %r9 push %rbp push %rcx // Store lea addresses_A+0x1f59e, %r13 nop nop nop nop sub %r12, %r12 movb $0x51, (%r13) nop nop add %r13, %r13 // Load lea addresses_PSE+0xe59e, %r15 nop add %rcx, %rcx movb (%r15), %r12b nop nop xor $26707, %r15 // Load lea addresses_normal+0x6e2e, %r12 nop nop add $24246, %r8 mov (%r12), %rcx nop nop nop sub %r8, %r8 // Store lea addresses_RW+0x1031e, %r13 nop and %r15, %r15 movw $0x5152, (%r13) nop cmp $62818, %r9 // Store lea addresses_RW+0x1d268, %r13 nop nop nop nop nop add %rbp, %rbp movw $0x5152, (%r13) nop nop cmp %r8, %r8 // Faulty Load lea addresses_PSE+0x5f9e, %r13 nop nop nop xor $7971, %rcx movb (%r13), %r12b lea oracles, %rbp and $0xff, %r12 shlq $12, %r12 mov (%rbp,%r12,1), %r12 pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A', 'AVXalign': True, 'size': 1}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_RW', 'AVXalign': False, 'size': 2}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}} {'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}} {'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 */
Layer2FadeOut/fadeout.asm
ped7g/ZXSpectrumNextMisc
15
88989
; "Fade Out" example, fading out to black image in Layer2 320x256 mode ; © <NAME> 2020, license: https://opensource.org/licenses/MIT ; requires ZX Spectrum Next with core3.0+ ; ; Assembles with sjasmplus - https://github.com/z00m128/sjasmplus (v1.15.0+) ; Does use imagemagick "convert" tool to prepare image data for direct INCBIN ; The Makefile has the full-rebuild instructions OPT reset --zxnext --syntax=abfw DEVICE ZXSPECTRUMNEXT INCLUDE "constants.i.asm" MMU 0 n, 9*2, $0000 ; include fadeout image into 16ki banks 9-13 (8ki pages 18-26) fadeout_pic: INCBIN "fadeout.tga", 0x12 + 3*256, 256*320 BORDER MACRO color? ld a,color? ; out (254),a ENDM ; Read NextReg into A (does modify A, and NextReg selected on the I/O port) ; is not optimized for speed + restores BC MACRO NEXTREG2A register? ld a,register? call ReadNextReg ENDM ORG $E000 start: di nextreg TURBO_CONTROL_NR_07,3 ; 28MHz nextreg LAYER2_RAM_BANK_NR_12,$$fadeout_pic/2 ; Layer 2 from bank where l2buf starts nextreg LAYER2_CONTROL_NR_70,%00'01'0000 ; 320x256x8 mode, palette offset +0 nextreg DISPLAY_CONTROL_NR_69,%1'0'000000 ; Layer 2 ON, ULA shadow off, Timex = 0 nextreg LAYER2_XOFFSET_MSB_NR_71,0 ,, LAYER2_XOFFSET_NR_16,0 ,, LAYER2_YOFFSET_NR_17,0 ; layer2 X/Y offset = [+0, +0] nextreg CLIP_WINDOW_CONTROL_NR_1C,1 ; layer2 clip 320x256 nextreg CLIP_LAYER2_NR_18,0 ,, CLIP_LAYER2_NR_18,159 ,, CLIP_LAYER2_NR_18,0 ,, CLIP_LAYER2_NR_18,255 ; the example image does use the Layer2 default palette, so no setting of that ; the fadeout effect will read *current* (any) palette and do fadeout from it ; read current palette values nextreg PALETTE_CONTROL_NR_43,%0'001'0'0'0'0 ; select Layer 2 palette, select first palette ld b,0 ; repeat counter (0 == 256x) ld de,originalPalette .readPaletteLoop: ld a,b nextreg PALETTE_INDEX_NR_40,a ; select color NEXTREG2A PALETTE_VALUE_9BIT_NR_44 ; read p000000B part of color ld (de),a inc de NEXTREG2A PALETTE_VALUE_NR_41 ; read RRRGGGBB part of color ld (de),a inc de inc b jr nz,.readPaletteLoop .reinitFadeOutLoop: ; copy current palette values to "live colors" buffer which will be fading out ld hl,originalPalette ld de,liveColorsBuffer ld bc,2*256 ldir ; prepare fade-out constants - the fadeout will use "Bresenham line algorithm" ; to go from initial channel value 0..7 to 0 in N steps linearly ld de,liveColorsBuffer ld hl,BresenhamData ld b,0 ; counter: 0 == 256x ld a,(duration) neg dec a ld c,a ; initial "D" for Bresenham = -duration - 1 .initBresenhamDataLoop: ; blue channel init ld a,(de) ; p000000B inc e rra ld a,(de) ; RRRGGGBB rla rla ; A = xxxxBBBx and 7<<1 ; A = 2*Blue (2*{0..7}) = 2*dy ld (hl),a ; deltaD = 2*dy inc l ld (hl),c ; init D inc hl ; green channel init ld a,(de) ; RRRGGGBB rrca and 7<<1 ; A = 2*Green (2*{0..7}) = 2*dy ld (hl),a ; deltaD = 2*dy inc l ld (hl),c ; init D inc hl ; red channel init ld a,(de) ; RRRGGGBB inc de swapnib and 7<<1 ; A = 2*Red (2*{0..7}) = 2*dy ld (hl),a ; deltaD = 2*dy inc l ld (hl),c ; init D inc hl djnz .initBresenhamDataLoop ; do the fade-out effect ld a,(duration) ld b,a ; number of frames to fadeout FadeOutLoop: BORDER 0 push bc call WaitForScanline224 ; do not read keyboard while fading out BORDER 1 call FadeOutColors pop bc djnz FadeOutLoop ; fade out done, wait 0.5s, then restore original colors BORDER 0 ld e,25 .blackWait: call IdleLoopWithKeyboard ; while idling, read keyboard (to modify duration) dec e jr nz,.blackWait ; restore colors in palette ld hl,originalPalette ld b,0 nextreg PALETTE_INDEX_NR_40,0 ; select color 0 before loop .resetColors: ld c,(hl) inc l ld a,(hl) inc hl nextreg PALETTE_VALUE_9BIT_NR_44,a ld a,c nextreg PALETTE_VALUE_9BIT_NR_44,a djnz .resetColors ; wait another 0.5s, then re-run the fadeout effect ld e,25 .originalWait: call IdleLoopWithKeyboard ; while idling, read keyboard (to modify duration) dec e jr nz,.originalWait ; restore live colors and bresenham init jr start.reinitFadeOutLoop IdleLoopWithKeyboard: call WaitForScanline224 ld hl,durationPickTable ld a,~(1<<3) ; keys 12345 in a,(254) DUP 5 rrca jr nc,.setNewDuration inc hl EDUP ld a,~(1<<4) ; keys 67890 in a,(254) rlca rlca rlca ; check 6, 7, ... (not 0, 9, 8, ...) DUP 5 rlca jr nc,.setNewDuration inc hl EDUP ret .setNewDuration: ld a,(hl) ld (duration),a ret FadeOutColors: ld de,liveColorsBuffer ld hl,BresenhamData nextreg PALETTE_INDEX_NR_40,0 ; select color 0 before loop ld a,(duration) add a,a ld b,a ; constant for adjusting D when it gets >= 0 (2*dx) ; do the subroutine twice, as it will return upon processing every 256 bytes of palette data call .fadeOutLoop inc d ; fix "only inc e" done on last byte to reach other 256 bytes .fadeOutLoop: ; do Bresenham linear subtraction of R,G,B channel value (single frame tick) ; check if Blue channel should decrement ld a,(hl) ; read deltaD for current channel (deltaD = 2*dy) inc l add a,(hl) ; regA = D + deltaD jp c,.decrementChannelB ; D < 0 -> don't decrement yet ld (hl),a ; store updated D inc hl ld a,(de) ; p000000B part of current color (live value, fading out) ld (.b2),a ; modify it in nextreg instruction setting second color byte ld c,0 ; "sub" value for final color (no change to "RRRGGGBB" so far) jp .continueWithOtherChannels .decrementChannelB: sub b ; regA = D - 2*dx (D >= 0) ld (hl),a ; store updated D inc hl ; decrement "BBB" composed from one bit in first byte and two bits in second byte ld a,(de) ; p000000B part of current color (live value, fading out) xor 1 ; can't just `dec a` because of priority bits ld (de),a ; store the modified lowB ld (.b2),a ; modify it in nextreg instruction setting second color byte and 1 ; if "1", then "BB" in main color byte needs to be adjusted too ld c,a ; "sub" value for final color is 0 or 1 depending on new lowB .continueWithOtherChannels: ; check if Green channel should decrement ld a,(hl) ; read deltaD for current channel (deltaD = 2*dy) inc l add a,(hl) ; regA = D + deltaD jp nc,.doNotDecrementChannelG ; D < 0 -> don't decrement yet sub b ; regA = D - 2*dx (D >= 0) set 2,c ; add %000'001'00 to "sub" value to decrement Green channel .doNotDecrementChannelG: ld (hl),a ; store updated D inc hl ; check if Red channel should decrement ld a,(hl) ; read deltaD for current channel (deltaD = 2*dy) inc l add a,(hl) ; regA = D + deltaD jp nc,.doNotDecrementChannelR ; D < 0 -> don't decrement yet sub b ; regA = D - 2*dx (D >= 0) set 5,c ; add %001'000'00 to "sub" value to decrement Red channel .doNotDecrementChannelR: ld (hl),a ; store updated D inc hl ; output the final color and update the "live" color buffer inc e ld a,(de) ; RRRGGGBB part of current color (live value, fading out) sub c ; adjust it by calculated "sub" value ld (de),a ; store the modified color nextreg PALETTE_VALUE_9BIT_NR_44,a .b2=$+3:nextreg PALETTE_VALUE_9BIT_NR_44,0 ; self-modified code to set second byte of color inc e jr nz,.fadeOutLoop ret WaitForScanline224: ; wait for scanline 224 (just below 320x256 area) ; read NextReg $1F - LSB of current raster line ld bc,TBBLUE_REGISTER_SELECT_P_243B ld a,VIDEO_LINE_LSB_NR_1F out (c),a ; select NextReg $1F inc b ; BC = TBBLUE_REGISTER_ACCESS_P_253B ; if already at scanline 224, then wait extra whole frame (for super-fast game loops) .cantStartAt224: in a,(c) ; read the raster line LSB cp 224 jr z,.cantStartAt224 ; if not yet at scanline 224, wait for it ... wait for it ... .waitLoop: in a,(c) ; read the raster line LSB cp 224 jr nz,.waitLoop ; and because the max scanline number is between 260..319 (depends on video mode), ; I don't need to read MSB. 256+224 = 480 -> such scanline is not part of any mode. ret ReadNextReg: ; reads nextreg in A into A (does modify currently selected NextReg on I/O port) push bc ld bc,TBBLUE_REGISTER_SELECT_P_243B out (c),a inc b ; bc = TBBLUE_REGISTER_ACCESS_P_253B in a,(c) ; read desired NextReg state pop bc ret ALIGN 256 originalPalette: BLOCK 256*2, 0 liveColorsBuffer: BLOCK 256*2, 0 BresenhamData: BLOCK 3*2*256, 0 ; 3x channel (R,G,B), two bytes (deltaD, current "D") duration: DB 52 ; duration of fadeout in frames ; minimum valid duration is 7 (to reach 0 by -1 from color value 7) ; maximum valid duration is 127 (as 2*duration must fit into 8 bit value) durationPickTable: DB 7, 12, 19, 28, 39, 52, 67, 84, 103, 124 ; durations for keys 1,2,3,...,9,0 ; reserve space for stack BLOCK 1024, $AA ; $AAAA is debug filler in case of debugging stack stack: DW $AAAA SAVENEX OPEN "fadeout.nex", start, stack, 0, 2 ; nexstack-ok SAVENEX CORE 3,0,0 : SAVENEX CFG 0 SAVENEX AUTO : SAVENEX CLOSE CSPECTMAP "fadeout.map"
alloy4fun_models/trashltl/models/8/ZbbvnFpE26NfqQo8t.als
Kaixi26/org.alloytools.alloy
0
545
<filename>alloy4fun_models/trashltl/models/8/ZbbvnFpE26NfqQo8t.als open main pred idZbbvnFpE26NfqQo8t_prop9 { all p : Protected | always p not in Trash' } pred __repair { idZbbvnFpE26NfqQo8t_prop9 } check __repair { idZbbvnFpE26NfqQo8t_prop9 <=> prop9o }
alloy4fun_models/trashltl/models/11/7JBD4i64gNZjmih2R.als
Kaixi26/org.alloytools.alloy
0
2559
open main pred id7JBD4i64gNZjmih2R_prop12 { all f : File | eventually f in Trash => after eventually f not in Trash } pred __repair { id7JBD4i64gNZjmih2R_prop12 } check __repair { id7JBD4i64gNZjmih2R_prop12 <=> prop12o }
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_671.asm
ljhsiun2/medusa
9
89825
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x107ec, %r13 nop nop nop nop nop sub $48582, %rdi mov $0x6162636465666768, %r15 movq %r15, (%r13) nop nop nop nop nop cmp %r9, %r9 lea addresses_A_ht+0xe7ec, %rdx nop sub $1235, %rdi mov $0x6162636465666768, %r10 movq %r10, %xmm4 vmovups %ymm4, (%rdx) nop and $7844, %r10 lea addresses_UC_ht+0xeaec, %rsi lea addresses_WC_ht+0x11cec, %rdi clflush (%rsi) nop nop add $8958, %r15 mov $8, %rcx rep movsb nop dec %rsi lea addresses_WT_ht+0x1c58c, %rsi nop nop nop nop nop cmp $11612, %r13 mov (%rsi), %r15d nop nop nop cmp $11717, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %r8 push %r9 push %rax push %rsi // Store lea addresses_A+0x69ac, %r11 cmp %r9, %r9 movb $0x51, (%r11) sub %rsi, %rsi // Faulty Load lea addresses_normal+0x15cec, %r15 nop nop nop nop cmp $41693, %r12 movups (%r15), %xmm7 vpextrq $0, %xmm7, %r11 lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rsi pop %rax pop %r9 pop %r8 pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
src/jsa-tabulated_text_io.ads
sparre/JSA
1
19050
------------------------------------------------------------------------------ -- -- package Tabulated_Text_IO (spec) -- ------------------------------------------------------------------------------ -- Update log: -- -- 2000.02.01 (<NAME>) -- Written. -- ------------------------------------------------------------------------------ -- Standard packages: with Ada.Characters.Latin_1; with Ada.Strings.Unbounded; with Ada.Text_IO; ------------------------------------------------------------------------------ package JSA.Tabulated_Text_IO is --------------------------------------------------------------------------- -- Tabulator: Tabulator : Character := Ada.Characters.Latin_1.HT; --------------------------------------------------------------------------- -- procedure New_Record: procedure New_Record (File : in Ada.Text_IO.File_Type); --------------------------------------------------------------------------- -- procedure Skip_Record: procedure Skip_Record (File : in Ada.Text_IO.File_Type); --------------------------------------------------------------------------- -- procedure New_Field: procedure New_Field (File : in Ada.Text_IO.File_Type); --------------------------------------------------------------------------- -- procedure Skip_Field: procedure Skip_Field (File : in Ada.Text_IO.File_Type); --------------------------------------------------------------------------- -- procedure Put: procedure Put (File : in Ada.Text_IO.File_Type; Field : in Ada.Strings.Unbounded.Unbounded_String); --------------------------------------------------------------------------- -- procedure Get: procedure Get (File : in Ada.Text_IO.File_Type; Field : out Ada.Strings.Unbounded.Unbounded_String); --------------------------------------------------------------------------- end JSA.Tabulated_Text_IO;
Examples/ch11/WriteColors.asm
satadriver/LiunuxOS
0
93394
<filename>Examples/ch11/WriteColors.asm TITLE Writing Text Colors (WriteColors.asm) ; Demonstration of WriteConsoleOutputCharacter, ; and WriteConsoleOutputAttribute functions. ; Last update: 9/28/01 INCLUDE Irvine32.inc .data outHandle DWORD ? cellsWritten DWORD ? xyPos COORD <10,2> ; Array of character codes: buffer BYTE 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 BYTE 16,17,18,19.20 BufSize = ($ - buffer) ; Array of attributes: attributes WORD 0Fh,0Eh,0Dh,0Ch,0Bh,0Ah,9,8,7,6 WORD 5,4,3,2,1,0F0h,0E0h,0D0h,0C0h,0B0h .code main PROC ; Get the Console standard output handle: INVOKE GetStdHandle,STD_OUTPUT_HANDLE mov outHandle,eax ; Set the colors from (10,2) to (30,2): INVOKE WriteConsoleOutputAttribute, outHandle, ADDR attributes, BufSize, xyPos, ADDR cellsWritten ; Write character codes 1 to 20: INVOKE WriteConsoleOutputCharacter, outHandle, ADDR buffer, BufSize, xyPos, ADDR cellsWritten call ReadChar exit main ENDP END main
oeis/058/A058932.asm
neoneye/loda-programs
11
8655
; A058932: Number of unlabeled claw-free cubic graphs with 2n nodes and connectivity 1. ; Submitted by <NAME> ; 0,0,0,0,0,0,1,1,3,5,11,20 mov $5,$0 lpb $0 sub $0,2 mov $2,$0 mov $0,1 max $2,0 seq $2,293046 ; Number of even permutations on {1,2,...,n} with exactly 2 weak excedances. mov $4,$2 min $4,1 add $5,$4 mov $3,$5 cmp $3,0 add $5,$3 div $2,$5 lpe mov $0,$2
components/src/screen/adafruit-charliewing.ads
rocher/Ada_Drivers_Library
192
17638
<reponame>rocher/Ada_Drivers_Library<filename>components/src/screen/adafruit-charliewing.ads ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2019, 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. -- -- -- ------------------------------------------------------------------------------ -- Driver for the AdaFruit Charlie Wing matrix LED board. -- See the IS31FL3731 package for API documentation. with HAL; with HAL.I2C; with IS31FL3731; package AdaFruit.CharlieWing is subtype X_Coord is IS31FL3731.X_Coord range 0 .. 15; subtype Y_Coord is IS31FL3731.Y_Coord range 0 .. 6; type Device (Port : not null HAL.I2C.Any_I2C_Port; AD : HAL.UInt2) is new IS31FL3731.Device with private; overriding function LED_Address (This : Device; X : IS31FL3731.X_Coord; Y : IS31FL3731.Y_Coord) return IS31FL3731.LED_Id with Pre => X in X_Coord and then Y in Y_Coord; -- LED address conversion specific to the LED arrangement of the Charlie -- Wing. private type Device (Port : not null HAL.I2C.Any_I2C_Port; AD : HAL.UInt2) is new IS31FL3731.Device (Port, AD) with null record; end AdaFruit.CharlieWing;
Just_beginner_things/Combining_C&Assembly/check.asm
ashcode028/Operating-system-in-action
4
22889
global add section .text add: mov rax,rdi add rax,rsi ret
oeis/332/A332189.asm
neoneye/loda-programs
11
247688
; A332189: a(n) = 8*(10^(2n+1)-1)/9 + 10^n. ; Submitted by <NAME> ; 9,898,88988,8889888,888898888,88888988888,8888889888888,888888898888888,88888888988888888,8888888889888888888,888888888898888888888,88888888888988888888888,8888888888889888888888888,888888888888898888888888888,88888888888888988888888888888,8888888888888889888888888888888 add $0,1 mov $1,10 pow $1,$0 mul $1,8 add $1,5 bin $1,2 mov $0,$1 mul $0,8 div $0,2880
src/Beside.agda
cspollard/diff
0
8400
open import Relation.Binary using (Rel) open import Algebra.Bundles using (CommutativeRing) open import Normed module Beside {r ℓr} {CR : CommutativeRing r ℓr} (open CommutativeRing CR using () renaming (Carrier to X)) {rel} {_≤_ : Rel X rel} {ma ℓma} (MA : NormedModule CR _≤_ ma ℓma) {mb ℓmb} (MB : NormedModule CR _≤_ mb ℓmb) {mc ℓmc} (MC : NormedModule CR _≤_ mc ℓmc) {md ℓmd} (MD : NormedModule CR _≤_ md ℓmd) where open import Data.Product using (_,_; map) open import Function using (_∘_) open CommutativeRing CR open import Limit using (D[_,_][_,_]) open import Assume using (assume) private MAC = directProduct MA MC MBD = directProduct MB MD module MA = NormedModule MA module MB = NormedModule MB module MC = NormedModule MC module MD = NormedModule MD module MAC = NormedModule MAC module MBD = NormedModule MBD ⊗-differentiable-at : ∀ {f g x y} → D[ MA , MB ][ f , x ] → D[ MC , MD ][ g , y ] → D[ MAC , MBD ][ map f g , (x , y) ] ⊗-differentiable-at (f' , _) (g' , _) = (λ (x , y) (dx , dy) → f' x dx , g' y dy) , assume
src/host/x86/asm/has/uXmhasLAHF.asm
Navegos/uasmlib
3
92148
<gh_stars>1-10 include uXmx86asm.inc option casemap:none ifndef __X64__ .686P .xmm .model flat, c else .X64P .xmm option win64:11 option stackbase:rsp endif option frame:auto .code align 16 uXm_has_LAHF proto VECCALL (byte) align 16 uXm_has_LAHF proc VECCALL (byte) ifndef __X64__ mov al, false else mov eax, 80000001h cpuid and ecx, bit_LAHF cmp ecx, bit_LAHF ; LAHF/SAHF available in 64-bit mode support by microprocessor .if EQUAL? mov al, true .else mov al, false .endif endif ;__X64__ ret uXm_has_LAHF endp end ;.code
examples/outdated-and-incorrect/Alonzo/TestInt.agda
asr/agda-kanso
1
14085
module TestInt where open import PreludeInt open import PreludeShow mainS = showInt result where result = (mod (((int 2) + (int 2)) * (int 5)) (int 3))
examples/random_sfmt.adb
ytomino/drake
33
9819
<filename>examples/random_sfmt.adb<gh_stars>10-100 pragma License (Unrestricted); -- BSD 3-Clause -- translated unit from SFMT (test.c) -- -- Copyright (C) 2007 <NAME>, <NAME> and Hiroshima -- University. All rights reserved. -- -- The new BSD License is applied to this software, see LICENSE.txt -- -- -- Ada version by yt -- with Ada.Command_Line; with Ada.Execution_Time; with Ada.Formatting; with Ada.Integer_Text_IO; with Ada.Real_Time; with Ada.Text_IO; with Ada.Numerics.SFMT_19937; procedure random_sfmt is use Ada.Numerics.SFMT_19937; -- use Ada.Numerics.SFMT.Params_216091; use type Ada.Execution_Time.CPU_Time; use type Ada.Real_Time.Time_Span; use type Unsigned_32; use type Unsigned_64; package Unsigned_32_IO is new Ada.Text_IO.Modular_IO (Unsigned_32); package Unsigned_64_IO is new Ada.Text_IO.Modular_IO (Unsigned_64); function Hex_Image is new Ada.Formatting.Modular_Image ( Unsigned_32, Form => Ada.Formatting.Simple, Signs => Ada.Formatting.Triming_Unsign_Marks, Base => 16, Set => Ada.Formatting.Lower_Case, Digits_Width => 8); function Hex_Image is new Ada.Formatting.Modular_Image ( Unsigned_64, Form => Ada.Formatting.Simple, Signs => Ada.Formatting.Triming_Unsign_Marks, Base => 16, Set => Ada.Formatting.Lower_Case, Digits_Width => 8); Gen : aliased Generator; BLOCK_SIZE : constant := 100000; BLOCK_SIZE64 : constant := 50000; COUNT : constant := 1000; procedure check32; procedure speed32; procedure check64; procedure speed64; array1 : Unsigned_64_Array (0 .. BLOCK_SIZE / 4 * 2 - 1); array2 : Unsigned_64_Array (0 .. 10000 / 4 * 2 - 1); procedure check32 is array32 : Unsigned_32_Array (0 .. BLOCK_SIZE - 1); for array32'Address use array1'Address; pragma Compile_Time_Error (array32'Size /= array1'Size, "bad array32"); array32_2 : Unsigned_32_Array (0 .. 10000 - 1); for array32_2'Address use array2'Address; pragma Compile_Time_Error (array32_2'Size /= array2'Size, "bad array32_2"); ini : constant Unsigned_32_Array := (16#1234#, 16#5678#, 16#9abc#, 16#def0#); r32 : Unsigned_32; begin if Min_Array_Length_32 > 10000 then raise Program_Error with "array size too small!"; end if; Ada.Text_IO.Put_Line (Id); Ada.Text_IO.Put_Line ("32 bit generated randoms"); Ada.Text_IO.Put_Line ("init_gen_rand__________"); -- 32 bit generation Reset (Gen, 1234); Fill_Random_32 (Gen, array32 (0 .. 10000 - 1)); Fill_Random_32 (Gen, array32_2 (0 .. 10000 - 1)); Reset (Gen, 1234); for i in 0 .. 10000 - 1 loop if i < 1000 then Unsigned_32_IO.Put (array32 (i), Width => 10); Ada.Text_IO.Put (' '); if i rem 5 = 4 then Ada.Text_IO.New_Line; end if; end if; r32 := Random_32 (Gen); if r32 /= array32 (i) then raise Program_Error with "mismatch at" & Integer'Image (i) & " array32:" & Hex_Image (array32 (i)) & " gen:" & Hex_Image (r32); end if; end loop; for i in 0 .. 700 - 1 loop r32 := Random_32 (Gen); if r32 /= array32_2 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array32_2:" & Hex_Image (array32_2 (i)) & " gen:" & Hex_Image (r32); end if; end loop; Ada.Text_IO.New_Line; Reset (Gen, Initialize (ini)); Ada.Text_IO.Put_Line ("init_by_array__________"); Fill_Random_32 (Gen, array32 (0 .. 10000 - 1)); Fill_Random_32 (Gen, array32_2 (0 .. 10000 - 1)); Reset (Gen, Initialize (ini)); for i in 0 .. 10000 - 1 loop if i < 1000 then Unsigned_32_IO.Put (array32 (i), Width => 10); Ada.Text_IO.Put (' '); if i rem 5 = 4 then Ada.Text_IO.New_Line; end if; end if; r32 := Random_32 (Gen); if r32 /= array32 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array32:" & Hex_Image (array32 (i)) & " gen:" & Hex_Image (r32); end if; end loop; for i in 0 .. 700 - 1 loop r32 := Random_32 (Gen); if r32 /= array32_2 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array32_2:" & Hex_Image (array32_2 (i)) & " gen:" & Hex_Image (r32); end if; end loop; end check32; procedure speed32 is clo : Ada.Execution_Time.CPU_Time; min : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Last; array32 : Unsigned_32_Array (0 .. BLOCK_SIZE - 1); for array32'Address use array1'Address; pragma Compile_Time_Error (array32'Size /= array1'Size, "bad array32"); clo_Span : Ada.Real_Time.Time_Span; Dummy : Unsigned_32; begin if Min_Array_Length_32 > BLOCK_SIZE then raise Program_Error with "array size too small!"; end if; -- 32 bit generation Reset (Gen, 1234); for i in 0 .. 10 - 1 loop clo := Ada.Execution_Time.Clock; for j in 0 .. COUNT - 1 loop Fill_Random_32 (Gen, array32 (0 .. BLOCK_SIZE - 1)); end loop; clo_Span := Ada.Execution_Time.Clock - clo; if clo_Span < min then min := clo_Span; end if; end loop; Ada.Text_IO.Put ("32 bit BLOCK:"); Ada.Integer_Text_IO.Put (Integer (Ada.Real_Time.To_Duration (min) * 1000), Width => 1); Ada.Text_IO.Put ("ms for "); Ada.Integer_Text_IO.Put (BLOCK_SIZE * COUNT, Width => 0); Ada.Text_IO.Put (" randoms generation"); Ada.Text_IO.New_Line; min := Ada.Real_Time.Time_Span_Last; Reset (Gen, 1234); for i in 0 .. 10 - 1 loop clo := Ada.Execution_Time.Clock; for j in 0 .. BLOCK_SIZE * COUNT - 1 loop Dummy := Random_32 (Gen); end loop; clo_Span:= Ada.Execution_Time.Clock - clo; if clo_Span < min then min := clo_Span; end if; end loop; Ada.Text_IO.Put ("32 bit SEQUE:"); Ada.Integer_Text_IO.Put (Integer (Ada.Real_Time.To_Duration (min) * 1000), Width => 1); Ada.Text_IO.Put ("ms for "); Ada.Integer_Text_IO.Put (BLOCK_SIZE * COUNT, Width => 0); Ada.Text_IO.Put (" randoms generation"); Ada.Text_IO.New_Line; end speed32; procedure check64 is array64 : Unsigned_64_Array renames array1; array64_2 : Unsigned_64_Array renames array2; r : Unsigned_64; ini : constant Unsigned_32_Array := (5, 4, 3, 2, 1); begin if Min_Array_Length_64 > 5000 then raise Program_Error with "array size too small!"; end if; Ada.Text_IO.Put_Line (Id); Ada.Text_IO.Put_Line ("64 bit generated randoms"); Ada.Text_IO.Put_Line ("init_gen_rand__________"); -- 64 bit generation Reset (Gen, 4321); Fill_Random_64 (Gen, array64 (0 .. 5000 - 1)); Fill_Random_64 (Gen, array64_2 (0 .. 5000 - 1)); Reset (Gen, 4321); for i in 0 .. 5000 - 1 loop if i < 1000 then Unsigned_64_IO.Put (array64 (i), Width => 20); Ada.Text_IO.Put (' '); if i rem 3 = 2 then Ada.Text_IO.New_Line; end if; end if; r := Random_64 (Gen); if r /= array64 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array64:" & Hex_Image (array64 (i)) & " gen:" & Hex_Image (r); end if; end loop; Ada.Text_IO.New_Line; for i in 0 .. 700 - 1 loop r := Random_64 (Gen); if r /= array64_2 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array64_2:" & Hex_Image (array64_2 (i)) & " gen:" & Hex_Image (r); end if; end loop; Ada.Text_IO.Put_Line ("init_by_array__________"); -- 64 bit generation Reset (Gen, Initialize (ini)); Fill_Random_64 (Gen, array64 (0 .. 5000 - 1)); Fill_Random_64 (Gen, array64_2 (0 .. 5000 - 1)); Reset (Gen, Initialize (ini)); for i in 0 .. 5000 - 1 loop if i < 1000 then Unsigned_64_IO.Put (array64 (i), Width => 20); Ada.Text_IO.Put (' '); if i rem 3 = 2 then Ada.Text_IO.New_Line; end if; end if; r := Random_64 (Gen); if r /= array64 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array64:" & Hex_Image (array64 (i)) & " gen:" & Hex_Image (r); end if; end loop; Ada.Text_IO.New_Line; for i in 0 .. 700 - 1 loop r := Random_64 (Gen); if r /= array64_2 (i) then raise Program_Error with "mismatch at" & Integer'Image (I) & " array64_2:" & Hex_Image (array64_2 (i)) & " gen:" & Hex_Image (r); end if; end loop; end check64; procedure speed64 is clo : Ada.Execution_Time.CPU_Time; min : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Last; array64 : Unsigned_64_Array renames array1; clo_Span : Ada.Real_Time.Time_Span; Dummy : Unsigned_64; begin if Min_Array_Length_64 > BLOCK_SIZE64 then raise Program_Error with "array size too small!"; end if; -- 64 bit generation Reset (Gen, 1234); for i in 0 .. 10 - 1 loop clo := Ada.Execution_Time.Clock; for j in 0 .. COUNT - 1 loop Fill_Random_64 (Gen, array64 (0 .. BLOCK_SIZE64 - 1)); end loop; clo_Span := Ada.Execution_Time.Clock - clo; if clo_Span < min then min := clo_Span; end if; end loop; Ada.Text_IO.Put ("64 bit BLOCK:"); Ada.Integer_Text_IO.Put (Integer (Ada.Real_Time.To_Duration (min) * 1000), Width => 1); Ada.Text_IO.Put ("ms for "); Ada.Integer_Text_IO.Put (BLOCK_SIZE64 * COUNT, Width => 0); Ada.Text_IO.Put (" randoms generation"); Ada.Text_IO.New_Line; min := Ada.Real_Time.Time_Span_Last; Reset (Gen, 1234); for i in 0 .. 10 - 1 loop clo := Ada.Execution_Time.Clock; for j in 0 .. BLOCK_SIZE64 * COUNT - 1 loop Dummy := Random_64 (Gen); end loop; clo_Span := Ada.Execution_Time.Clock - clo; if clo_Span < min then min := clo_Span; end if; end loop; Ada.Text_IO.Put ("64 bit SEQUE:"); Ada.Integer_Text_IO.Put (Integer (Ada.Real_Time.To_Duration (min) * 1000), Width => 1); Ada.Text_IO.Put ("ms for "); Ada.Integer_Text_IO.Put (BLOCK_SIZE64 * COUNT, Width => 0); Ada.Text_IO.Put (" randoms generation"); Ada.Text_IO.New_Line; end speed64; speed : Boolean := False; bit32 : Boolean := False; bit64 : Boolean := False; begin for i in 1 .. Ada.Command_Line.Argument_Count loop declare argv_i : constant String := Ada.Command_Line.Argument (i); begin if argv_i = "-s" then speed := True; end if; if argv_i = "-b32" then bit32 := True; end if; if argv_i = "-b64" then bit64 := True; end if; end; end loop; if not (speed or else bit32 or else bit64) then Ada.Text_IO.Put_Line ("usage:"); Ada.Text_IO.Put_Line ( Ada.Command_Line.Command_Name & " [-s | -b32 | -b64]"); return; end if; if speed then speed32; speed64; end if; if bit32 then check32; end if; if bit64 then check64; end if; end random_sfmt;
fixp.asm
gp48k/lpfp
17
21334
; Convert floating point between -1.0 and +1.0 to signed integer between -127 and 127 ; WARNING!!! Bounds not checked, does wreak havoc for out of bounds input. ; Input: DE = floating point number in the -1.0 .. +1.0 range ; Output: A = signed integer ; Pollutes: F,AF',BC,DE,HL FFIX: LD BC,F7F CALL FMUL LD A,H ADD A,A EX AF,AF' ; Save sign to F' RES 7,H LD A,$47 SUB H CP 8 JR NC,FFIX0 LD B,A LD A,L SCF FFIXL: RRA OR A DJNZ FFIXL RRA ADC A,B ; Proper rounding EX AF,AF' JR NC,FFIXP EX AF,AF' NEG RET FFIZP: EX AF,AF' RET FFIX0: XOR A RET ; Convert floating point array as above ; In: HL = floating point array, DE = fixed point array, B = array size ; Pollutes: AF,AF',B,BC',DE,DE',HL,HL' FFIXA: LD A,(HL) INC HL EX AF,AF' LD A,(HL) INC HL EXX LD D,A EX AF,AF' LD E,A CALL FFIX EXX LD (DE),A INC DE DJNZ FFIXA RET ; Multiply two signed integers to be interpreted as above ; In: D,E = multiplicands ; Out: A = product ; Pollutes: F, HL MULFIX: LD H,SIGSQRT/256 LD A,E ADD A,D JP PO,MULFIX1 LD L,A LD A,(HL) LD L,E SUB A,(HL) LD L,D SUB A,(HL) RET MULFIX1:LD A,E SUB A,D LD L,A LD A,(HL) NEG LD L,E ADD A,(HL) LD L,D ADD A,(HL) RET